var OU=Object.defineProperty;var _3=e=>{throw TypeError(e)};var IU=(e,t,n)=>t in e?OU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ec=(e,t,n)=>IU(e,typeof t!="symbol"?t+"":t,n),ax=(e,t,n)=>t.has(e)||_3("Cannot "+n);var K=(e,t,n)=>(ax(e,t,"read from private field"),n?n.call(e):t.get(e)),Pe=(e,t,n)=>t.has(e)?_3("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),we=(e,t,n,r)=>(ax(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Ze=(e,t,n)=>(ax(e,t,"access private method"),n);var Gp=(e,t,n,r)=>({set _(i){we(e,t,i,n)},get _(){return K(e,t,r)}});/*! * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% * _ _ _ _ * | |___ __ / \ __| |_ __ ___ (_)_ __ * | __\ \/ / / _ \ / _` | '_ ` _ \| | '_ \ * | |_ > < / ___ \ (_| | | | | | | | | | | * \__/_/\_\/_/ \_\__,_|_| |_| |_|_|_| |_| * * %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% * 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-2025 André Tabarra * * 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 $U(e,t){for(var n=0;nr[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 is=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var jj={exports:{}},b0={},Dj={exports:{}},rt={};/** * @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 tp=Symbol.for("react.element"),BU=Symbol.for("react.portal"),FU=Symbol.for("react.fragment"),zU=Symbol.for("react.strict_mode"),HU=Symbol.for("react.profiler"),WU=Symbol.for("react.provider"),UU=Symbol.for("react.context"),VU=Symbol.for("react.forward_ref"),qU=Symbol.for("react.suspense"),GU=Symbol.for("react.memo"),KU=Symbol.for("react.lazy"),b3=Symbol.iterator;function YU(e){return e===null||typeof e!="object"?null:(e=b3&&e[b3]||e["@@iterator"],typeof e=="function"?e:null)}var Lj={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nj=Object.assign,Pj={};function $u(e,t,n){this.props=e,this.context=t,this.refs=Pj,this.updater=n||Lj}$u.prototype.isReactComponent={};$u.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")};$u.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Oj(){}Oj.prototype=$u.prototype;function mS(e,t,n){this.props=e,this.context=t,this.refs=Pj,this.updater=n||Lj}var gS=mS.prototype=new Oj;gS.constructor=mS;Nj(gS,$u.prototype);gS.isPureReactComponent=!0;var w3=Array.isArray,Ij=Object.prototype.hasOwnProperty,vS={current:null},$j={key:!0,ref:!0,__self:!0,__source:!0};function Bj(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)Ij.call(t,r)&&!$j.hasOwnProperty(r)&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(10&&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 tb={},Uj={exports:{}},Vr={},Vj={exports:{}},qj={};/** * @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(O,A){var j=O.length;O.push(A);e:for(;0>>1,H=O[F];if(0>>1;Fi(Z,j))Xi(W,Z)?(O[F]=W,O[X]=j,F=X):(O[F]=Z,O[G]=j,F=G);else if(Xi(W,j))O[F]=W,O[X]=j,F=X;else break e}}return A}function i(O,A){var j=O.sortIndex-A.sortIndex;return j!==0?j:O.id-A.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=[],h=1,d=null,f=3,m=!1,_=!1,v=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(O){for(var A=n(c);A!==null;){if(A.callback===null)r(c);else if(A.startTime<=O)r(c),A.sortIndex=A.expirationTime,t(l,A);else break;A=n(c)}}function b(O){if(v=!1,x(O),!_)if(n(l)!==null)_=!0,I(S);else{var A=n(c);A!==null&&z(b,A.startTime-O)}}function S(O,A){_=!1,v&&(v=!1,g(k),k=-1),m=!0;var j=f;try{for(x(A),d=n(l);d!==null&&(!(d.expirationTime>A)||O&&!M());){var F=d.callback;if(typeof F=="function"){d.callback=null,f=d.priorityLevel;var H=F(d.expirationTime<=A);A=e.unstable_now(),typeof H=="function"?d.callback=H:d===n(l)&&r(l),x(A)}else r(l);d=n(l)}if(d!==null)var B=!0;else{var G=n(c);G!==null&&z(b,G.startTime-A),B=!1}return B}finally{d=null,f=j,m=!1}}var C=!1,E=null,k=-1,T=5,R=-1;function M(){return!(e.unstable_now()-RO||125F?(O.sortIndex=j,t(c,O),n(l)===null&&O===n(c)&&(v?(g(k),k=-1):v=!0,z(b,j-F))):(O.sortIndex=H,t(l,O),_||m||(_=!0,I(S))),O},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(O){var A=f;return function(){var j=f;f=A;try{return O.apply(this,arguments)}finally{f=j}}}})(qj);Vj.exports=qj;var lV=Vj.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 cV=w,Wr=lV;function pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),nb=Object.prototype.hasOwnProperty,uV=/^[: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]*$/,C3={},k3={};function dV(e){return nb.call(k3,e)?!0:nb.call(C3,e)?!1:uV.test(e)?k3[e]=!0:(C3[e]=!0,!1)}function hV(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 fV(e,t,n,r){if(t===null||typeof t>"u"||hV(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 hr(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 zn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){zn[e]=new hr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];zn[t]=new hr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){zn[e]=new hr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){zn[e]=new hr(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){zn[e]=new hr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){zn[e]=new hr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){zn[e]=new hr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){zn[e]=new hr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){zn[e]=new hr(e,5,!1,e.toLowerCase(),null,!1,!1)});var xS=/[\-:]([a-z])/g;function _S(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(xS,_S);zn[t]=new hr(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(xS,_S);zn[t]=new hr(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(xS,_S);zn[t]=new hr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){zn[e]=new hr(e,1,!1,e.toLowerCase(),null,!1,!1)});zn.xlinkHref=new hr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){zn[e]=new hr(e,1,!1,e.toLowerCase(),null,!0,!0)});function bS(e,t,n,r){var i=zn.hasOwnProperty(t)?zn[t]:null;(i!==null?i.type!==0:r||!(2o||i[a]!==s[o]){var l=` `+i[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=o);break}}}finally{dx=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ah(e):""}function pV(e){switch(e.tag){case 5:return ah(e.type);case 16:return ah("Lazy");case 13:return ah("Suspense");case 19:return ah("SuspenseList");case 0:case 2:case 15:return e=hx(e.type,!1),e;case 11:return e=hx(e.type.render,!1),e;case 1:return e=hx(e.type,!0),e;default:return""}}function ob(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 vc:return"Fragment";case gc:return"Portal";case rb:return"Profiler";case wS:return"StrictMode";case ib:return"Suspense";case sb:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Yj:return(e.displayName||"Context")+".Consumer";case Kj:return(e._context.displayName||"Context")+".Provider";case SS:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case CS:return t=e.displayName||null,t!==null?t:ob(e.type)||"Memo";case bo:t=e._payload,e=e._init;try{return ob(e(t))}catch{}}return null}function mV(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 ob(t);case 8:return t===wS?"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 na(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function gV(e){var t=Qj(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 Xp(e){e._valueTracker||(e._valueTracker=gV(e))}function Jj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Qj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Pg(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 ab(e,t){var n=t.checked;return rn({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function T3(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=na(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 Zj(e,t){t=t.checked,t!=null&&bS(e,"checked",t,!1)}function lb(e,t){Zj(e,t);var n=na(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")?cb(e,t.type,n):t.hasOwnProperty("defaultValue")&&cb(e,t.type,na(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function R3(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 cb(e,t,n){(t!=="number"||Pg(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var lh=Array.isArray;function Ac(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Qp.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xh(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ch={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},vV=["Webkit","ms","Moz","O"];Object.keys(Ch).forEach(function(e){vV.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ch[t]=Ch[e]})});function r8(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ch.hasOwnProperty(e)&&Ch[e]?(""+t).trim():t+"px"}function i8(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=r8(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var yV=rn({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 hb(e,t){if(t){if(yV[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(pe(62))}}function fb(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 pb=null;function kS(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mb=null,jc=null,Dc=null;function j3(e){if(e=ip(e)){if(typeof mb!="function")throw Error(pe(280));var t=e.stateNode;t&&(t=E0(t),mb(e.stateNode,e.type,t))}}function s8(e){jc?Dc?Dc.push(e):Dc=[e]:jc=e}function o8(){if(jc){var e=jc,t=Dc;if(Dc=jc=null,j3(e),t)for(e=0;e>>=0,e===0?32:31-(MV(e)/AV|0)|0}var Jp=64,Zp=4194304;function ch(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 Bg(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=ch(o):(s&=a,s!==0&&(r=ch(s)))}else a=n&~i,a!==0?r=ch(a):s!==0&&(r=ch(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;0n;n++)t.push(e);return t}function np(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ji(t),e[t]=n}function NV(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=Eh),F3=" ",z3=!1;function E8(e,t){switch(e){case"keyup":return lq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T8(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yc=!1;function uq(e,t){switch(e){case"compositionend":return T8(t);case"keypress":return t.which!==32?null:(z3=!0,F3);case"textInput":return e=t.data,e===F3&&z3?null:e;default:return null}}function dq(e,t){if(yc)return e==="compositionend"||!LS&&E8(e,t)?(e=C8(),ng=AS=Io=null,yc=!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)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=V3(n)}}function j8(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?j8(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function D8(){for(var e=window,t=Pg();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Pg(e.document)}return t}function NS(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 _q(e){var t=D8(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&j8(n.ownerDocument.documentElement,n)){if(r!==null&&NS(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=q3(n,s);var a=q3(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=document.documentMode,xc=null,bb=null,Rh=null,wb=!1;function G3(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wb||xc==null||xc!==Pg(r)||(r=xc,"selectionStart"in r&&NS(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}),Rh&&nf(Rh,r)||(Rh=r,r=Hg(bb,"onSelect"),0wc||(e.current=Rb[wc],Rb[wc]=null,wc--)}function Bt(e,t){wc++,Rb[wc]=e.current,e.current=t}var ra={},er=ma(ra),Cr=ma(!1),ol=ra;function hu(e,t){var n=e.type.contextTypes;if(!n)return ra;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 kr(e){return e=e.childContextTypes,e!=null}function Ug(){Yt(Cr),Yt(er)}function e4(e,t,n){if(er.current!==ra)throw Error(pe(168));Bt(er,t),Bt(Cr,n)}function z8(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(pe(108,mV(e)||"Unknown",i));return rn({},n,r)}function Vg(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ra,ol=er.current,Bt(er,e),Bt(Cr,Cr.current),!0}function t4(e,t,n){var r=e.stateNode;if(!r)throw Error(pe(169));n?(e=z8(e,t,ol),r.__reactInternalMemoizedMergedChildContext=e,Yt(Cr),Yt(er),Bt(er,e)):Yt(Cr),Bt(Cr,n)}var Ns=null,T0=!1,Ex=!1;function H8(e){Ns===null?Ns=[e]:Ns.push(e)}function Dq(e){T0=!0,H8(e)}function ga(){if(!Ex&&Ns!==null){Ex=!0;var e=0,t=Ct;try{var n=Ns;for(Ct=1;e>=a,i-=a,Bs=1<<32-ji(t)+i|n<k?(T=E,E=null):T=E.sibling;var R=f(g,E,x[k],b);if(R===null){E===null&&(E=T);break}e&&E&&R.alternate===null&&t(g,E),p=s(R,p,k),C===null?S=R:C.sibling=R,C=R,E=T}if(k===x.length)return n(g,E),Qt&&Ma(g,k),S;if(E===null){for(;kk?(T=E,E=null):T=E.sibling;var M=f(g,E,R.value,b);if(M===null){E===null&&(E=T);break}e&&E&&M.alternate===null&&t(g,E),p=s(M,p,k),C===null?S=M:C.sibling=M,C=M,E=T}if(R.done)return n(g,E),Qt&&Ma(g,k),S;if(E===null){for(;!R.done;k++,R=x.next())R=d(g,R.value,b),R!==null&&(p=s(R,p,k),C===null?S=R:C.sibling=R,C=R);return Qt&&Ma(g,k),S}for(E=r(g,E);!R.done;k++,R=x.next())R=m(E,g,k,R.value,b),R!==null&&(e&&R.alternate!==null&&E.delete(R.key===null?k:R.key),p=s(R,p,k),C===null?S=R:C.sibling=R,C=R);return e&&E.forEach(function(D){return t(g,D)}),Qt&&Ma(g,k),S}function y(g,p,x,b){if(typeof x=="object"&&x!==null&&x.type===vc&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Yp:e:{for(var S=x.key,C=p;C!==null;){if(C.key===S){if(S=x.type,S===vc){if(C.tag===7){n(g,C.sibling),p=i(C,x.props.children),p.return=g,g=p;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===bo&&i4(S)===C.type){n(g,C.sibling),p=i(C,x.props),p.ref=Ad(g,C,x),p.return=g,g=p;break e}n(g,C);break}else t(g,C);C=C.sibling}x.type===vc?(p=el(x.props.children,g.mode,b,x.key),p.return=g,g=p):(b=ug(x.type,x.key,x.props,null,g.mode,b),b.ref=Ad(g,p,x),b.return=g,g=b)}return a(g);case gc:e:{for(C=x.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===x.containerInfo&&p.stateNode.implementation===x.implementation){n(g,p.sibling),p=i(p,x.children||[]),p.return=g,g=p;break e}else{n(g,p);break}else t(g,p);p=p.sibling}p=Nx(x,g.mode,b),p.return=g,g=p}return a(g);case bo:return C=x._init,y(g,p,C(x._payload),b)}if(lh(x))return _(g,p,x,b);if(kd(x))return v(g,p,x,b);om(g,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,p!==null&&p.tag===6?(n(g,p.sibling),p=i(p,x),p.return=g,g=p):(n(g,p),p=Lx(x,g.mode,b),p.return=g,g=p),a(g)):n(g,p)}return y}var pu=q8(!0),G8=q8(!1),Kg=ma(null),Yg=null,kc=null,$S=null;function BS(){$S=kc=Yg=null}function FS(e){var t=Kg.current;Yt(Kg),e._currentValue=t}function jb(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 Nc(e,t){Yg=e,$S=kc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Sr=!0),e.firstContext=null)}function ui(e){var t=e._currentValue;if($S!==e)if(e={context:e,memoizedValue:t,next:null},kc===null){if(Yg===null)throw Error(pe(308));kc=e,Yg.dependencies={lanes:0,firstContext:e}}else kc=kc.next=e;return t}var $a=null;function zS(e){$a===null?$a=[e]:$a.push(e)}function K8(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,zS(t)):(n.next=i.next,i.next=n),t.interleaved=n,Zs(e,r)}function Zs(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 wo=!1;function HS(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y8(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 Ks(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,pt&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Zs(e,n)}return i=r.interleaved,i===null?(t.next=t,zS(r)):(t.next=i.next,i.next=t),r.interleaved=t,Zs(e,n)}function ig(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,TS(e,n)}}function s4(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;wo=!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 h=e.alternate;h!==null&&(h=h.updateQueue,o=h.lastBaseUpdate,o!==a&&(o===null?h.firstBaseUpdate=c:o.next=c,h.lastBaseUpdate=l))}if(s!==null){var d=i.baseState;a=0,h=c=l=null,o=s;do{var f=o.lane,m=o.eventTime;if((r&f)===f){h!==null&&(h=h.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var _=e,v=o;switch(f=t,m=n,v.tag){case 1:if(_=v.payload,typeof _=="function"){d=_.call(m,d,f);break e}d=_;break e;case 3:_.flags=_.flags&-65537|128;case 0:if(_=v.payload,f=typeof _=="function"?_.call(m,d,f):_,f==null)break e;d=rn({},d,f);break e;case 2:wo=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,f=i.effects,f===null?i.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},h===null?(c=h=m,l=d):h=h.next=m,a|=f;if(o=o.next,o===null){if(o=i.shared.pending,o===null)break;f=o,o=f.next,f.next=null,i.lastBaseUpdate=f,i.shared.pending=null}}while(!0);if(h===null&&(l=d),i.baseState=l,i.firstBaseUpdate=c,i.lastBaseUpdate=h,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);cl|=a,e.lanes=a,e.memoizedState=d}}function o4(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Rx.transition;Rx.transition={};try{e(!1),t()}finally{Ct=n,Rx.transition=r}}function hD(){return di().memoizedState}function Oq(e,t,n){var r=Qo(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},fD(e))pD(t,n);else if(n=K8(e,t,n,r),n!==null){var i=ur();Di(n,e,r,i),mD(n,t,r)}}function Iq(e,t,n){var r=Qo(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(fD(e))pD(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,Ni(o,a)){var l=t.interleaved;l===null?(i.next=i,zS(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=K8(e,t,i,r),n!==null&&(i=ur(),Di(n,e,r,i),mD(n,t,r))}}function fD(e){var t=e.alternate;return e===nn||t!==null&&t===nn}function pD(e,t){Mh=Jg=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function mD(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,TS(e,n)}}var Zg={readContext:ui,useCallback:Vn,useContext:Vn,useEffect:Vn,useImperativeHandle:Vn,useInsertionEffect:Vn,useLayoutEffect:Vn,useMemo:Vn,useReducer:Vn,useRef:Vn,useState:Vn,useDebugValue:Vn,useDeferredValue:Vn,useTransition:Vn,useMutableSource:Vn,useSyncExternalStore:Vn,useId:Vn,unstable_isNewReconciler:!1},$q={readContext:ui,useCallback:function(e,t){return qi().memoizedState=[e,t===void 0?null:t],e},useContext:ui,useEffect:l4,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,og(4194308,4,aD.bind(null,t,e),n)},useLayoutEffect:function(e,t){return og(4194308,4,e,t)},useInsertionEffect:function(e,t){return og(4,2,e,t)},useMemo:function(e,t){var n=qi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=qi();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=Oq.bind(null,nn,e),[r.memoizedState,e]},useRef:function(e){var t=qi();return e={current:e},t.memoizedState=e},useState:a4,useDebugValue:XS,useDeferredValue:function(e){return qi().memoizedState=e},useTransition:function(){var e=a4(!1),t=e[0];return e=Pq.bind(null,e[1]),qi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=nn,i=qi();if(Qt){if(n===void 0)throw Error(pe(407));n=n()}else{if(n=t(),jn===null)throw Error(pe(349));ll&30||Z8(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,l4(tD.bind(null,r,s,e),[e]),r.flags|=2048,df(9,eD.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=qi(),t=jn.identifierPrefix;if(Qt){var n=Fs,r=Bs;n=(r&~(1<<32-ji(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=cf++,0<\/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[es]=t,e[of]=r,kD(e,t,!1,!1),t.stateNode=e;e:{switch(a=fb(n,r),n){case"dialog":Ut("cancel",e),Ut("close",e),i=r;break;case"iframe":case"object":case"embed":Ut("load",e),i=r;break;case"video":case"audio":for(i=0;ivu&&(t.flags|=128,r=!0,jd(s,!1),t.lanes=4194304)}else{if(!r)if(e=Qg(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),jd(s,!0),s.tail===null&&s.tailMode==="hidden"&&!a.alternate&&!Qt)return qn(t),null}else 2*fn()-s.renderingStartTime>vu&&n!==1073741824&&(t.flags|=128,r=!0,jd(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=fn(),t.sibling=null,n=tn.current,Bt(tn,r?n&1|2:n&1),t):(qn(t),null);case 22:case 23:return nC(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Pr&1073741824&&(qn(t),t.subtreeFlags&6&&(t.flags|=8192)):qn(t),null;case 24:return null;case 25:return null}throw Error(pe(156,t.tag))}function qq(e,t){switch(OS(t),t.tag){case 1:return kr(t.type)&&Ug(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return mu(),Yt(Cr),Yt(er),VS(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return US(t),null;case 13:if(Yt(tn),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(pe(340));fu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yt(tn),null;case 4:return mu(),null;case 10:return FS(t.type._context),null;case 22:case 23:return nC(),null;case 24:return null;default:return null}}var lm=!1,Qn=!1,Gq=typeof WeakSet=="function"?WeakSet:Set,ke=null;function Ec(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){cn(e,t,r)}else n.current=null}function Fb(e,t,n){try{n()}catch(r){cn(e,t,r)}}var x4=!1;function Kq(e,t){if(Sb=Fg,e=D8(),NS(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,h=0,d=e,f=null;t:for(;;){for(var m;d!==n||i!==0&&d.nodeType!==3||(o=a+i),d!==s||r!==0&&d.nodeType!==3||(l=a+r),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===e)break t;if(f===n&&++c===i&&(o=a),f===s&&++h===r&&(l=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}n=o===-1||l===-1?null:{start:o,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Cb={focusedElem:e,selectionRange:n},Fg=!1,ke=t;ke!==null;)if(t=ke,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ke=e;else for(;ke!==null;){t=ke;try{var _=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(_!==null){var v=_.memoizedProps,y=_.memoizedState,g=t.stateNode,p=g.getSnapshotBeforeUpdate(t.elementType===t.type?v:xi(t.type,v),y);g.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(pe(163))}}catch(b){cn(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ke=e;break}ke=t.return}return _=x4,x4=!1,_}function Ah(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&&Fb(t,n,s)}i=i.next}while(i!==r)}}function A0(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 zb(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 RD(e){var t=e.alternate;t!==null&&(e.alternate=null,RD(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[es],delete t[of],delete t[Tb],delete t[Aq],delete t[jq])),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 MD(e){return e.tag===5||e.tag===3||e.tag===4}function _4(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||MD(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 Hb(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=Wg));else if(r!==4&&(e=e.child,e!==null))for(Hb(e,t,n),e=e.sibling;e!==null;)Hb(e,t,n),e=e.sibling}function Wb(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(Wb(e,t,n),e=e.sibling;e!==null;)Wb(e,t,n),e=e.sibling}var Bn=null,wi=!1;function po(e,t,n){for(n=n.child;n!==null;)AD(e,t,n),n=n.sibling}function AD(e,t,n){if(as&&typeof as.onCommitFiberUnmount=="function")try{as.onCommitFiberUnmount(w0,n)}catch{}switch(n.tag){case 5:Qn||Ec(n,t);case 6:var r=Bn,i=wi;Bn=null,po(e,t,n),Bn=r,wi=i,Bn!==null&&(wi?(e=Bn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Bn.removeChild(n.stateNode));break;case 18:Bn!==null&&(wi?(e=Bn,n=n.stateNode,e.nodeType===8?kx(e.parentNode,n):e.nodeType===1&&kx(e,n),ef(e)):kx(Bn,n.stateNode));break;case 4:r=Bn,i=wi,Bn=n.stateNode.containerInfo,wi=!0,po(e,t,n),Bn=r,wi=i;break;case 0:case 11:case 14:case 15:if(!Qn&&(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)&&Fb(n,t,a),i=i.next}while(i!==r)}po(e,t,n);break;case 1:if(!Qn&&(Ec(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){cn(n,t,o)}po(e,t,n);break;case 21:po(e,t,n);break;case 22:n.mode&1?(Qn=(r=Qn)||n.memoizedState!==null,po(e,t,n),Qn=r):po(e,t,n);break;default:po(e,t,n)}}function b4(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Gq),t.forEach(function(r){var i=rG.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function vi(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=a),r&=~s}if(r=i,r=fn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Xq(r/1960))-r,10e?16:e,$o===null)var r=!1;else{if(e=$o,$o=null,nv=0,pt&6)throw Error(pe(331));var i=pt;for(pt|=4,ke=e.current;ke!==null;){var s=ke,a=s.child;if(ke.flags&16){var o=s.deletions;if(o!==null){for(var l=0;lfn()-eC?Za(e,0):ZS|=n),Er(e,t)}function $D(e,t){t===0&&(e.mode&1?(t=Zp,Zp<<=1,!(Zp&130023424)&&(Zp=4194304)):t=1);var n=ur();e=Zs(e,t),e!==null&&(np(e,t,n),Er(e,n))}function nG(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$D(e,n)}function rG(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(pe(314))}r!==null&&r.delete(t),$D(e,n)}var BD;BD=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Cr.current)Sr=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Sr=!1,Uq(e,t,n);Sr=!!(e.flags&131072)}else Sr=!1,Qt&&t.flags&1048576&&W8(t,Gg,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ag(e,t),e=t.pendingProps;var i=hu(t,er.current);Nc(t,n),i=GS(null,t,r,e,i,n);var s=KS();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,kr(r)?(s=!0,Vg(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,HS(t),i.updater=M0,t.stateNode=i,i._reactInternals=t,Lb(t,r,e,n),t=Ob(null,t,r,!0,s,n)):(t.tag=0,Qt&&s&&PS(t),sr(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ag(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=sG(r),e=xi(r,e),i){case 0:t=Pb(null,t,r,e,n);break e;case 1:t=g4(null,t,r,e,n);break e;case 11:t=p4(null,t,r,e,n);break e;case 14:t=m4(null,t,r,xi(r.type,e),n);break e}throw Error(pe(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:xi(r,i),Pb(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:xi(r,i),g4(e,t,r,i,n);case 3:e:{if(wD(t),e===null)throw Error(pe(387));r=t.pendingProps,s=t.memoizedState,i=s.element,Y8(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=gu(Error(pe(423)),t),t=v4(e,t,r,n,i);break e}else if(r!==i){i=gu(Error(pe(424)),t),t=v4(e,t,r,n,i);break e}else for(Ir=Ko(t.stateNode.containerInfo.firstChild),Fr=t,Qt=!0,ki=null,n=G8(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(fu(),r===i){t=eo(e,t,n);break e}sr(e,t,r,n)}t=t.child}return t;case 5:return X8(t),e===null&&Ab(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,a=i.children,kb(r,i)?a=null:s!==null&&kb(r,s)&&(t.flags|=32),bD(e,t),sr(e,t,a,n),t.child;case 6:return e===null&&Ab(t),null;case 13:return SD(e,t,n);case 4:return WS(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=pu(t,null,r,n):sr(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:xi(r,i),p4(e,t,r,i,n);case 7:return sr(e,t,t.pendingProps,n),t.child;case 8:return sr(e,t,t.pendingProps.children,n),t.child;case 12:return sr(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,Bt(Kg,r._currentValue),r._currentValue=a,s!==null)if(Ni(s.value,a)){if(s.children===i.children&&!Cr.current){t=eo(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=Ks(-1,n&-n),l.tag=2;var c=s.updateQueue;if(c!==null){c=c.shared;var h=c.pending;h===null?l.next=l:(l.next=h.next,h.next=l),c.pending=l}}s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),jb(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(pe(341));a.lanes|=n,o=a.alternate,o!==null&&(o.lanes|=n),jb(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}sr(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Nc(t,n),i=ui(i),r=r(i),t.flags|=1,sr(e,t,r,n),t.child;case 14:return r=t.type,i=xi(r,t.pendingProps),i=xi(r.type,i),m4(e,t,r,i,n);case 15:return xD(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:xi(r,i),ag(e,t),t.tag=1,kr(r)?(e=!0,Vg(t)):e=!1,Nc(t,n),gD(t,r,i),Lb(t,r,i,n),Ob(null,t,r,!0,e,n);case 19:return CD(e,t,n);case 22:return _D(e,t,n)}throw Error(pe(156,t.tag))};function FD(e,t){return f8(e,t)}function iG(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 ii(e,t,n,r){return new iG(e,t,n,r)}function iC(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sG(e){if(typeof e=="function")return iC(e)?1:0;if(e!=null){if(e=e.$$typeof,e===SS)return 11;if(e===CS)return 14}return 2}function Jo(e,t){var n=e.alternate;return n===null?(n=ii(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 ug(e,t,n,r,i,s){var a=2;if(r=e,typeof e=="function")iC(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case vc:return el(n.children,i,s,t);case wS:a=8,i|=8;break;case rb:return e=ii(12,n,t,i|2),e.elementType=rb,e.lanes=s,e;case ib:return e=ii(13,n,t,i),e.elementType=ib,e.lanes=s,e;case sb:return e=ii(19,n,t,i),e.elementType=sb,e.lanes=s,e;case Xj:return D0(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kj:a=10;break e;case Yj:a=9;break e;case SS:a=11;break e;case CS:a=14;break e;case bo:a=16,r=null;break e}throw Error(pe(130,e==null?e:typeof e,""))}return t=ii(a,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function el(e,t,n,r){return e=ii(7,e,r,t),e.lanes=n,e}function D0(e,t,n,r){return e=ii(22,e,r,t),e.elementType=Xj,e.lanes=n,e.stateNode={isHidden:!1},e}function Lx(e,t,n){return e=ii(6,e,null,t),e.lanes=n,e}function Nx(e,t,n){return t=ii(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function oG(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=px(0),this.expirationTimes=px(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=px(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function sC(e,t,n,r,i,s,a,o,l){return e=new oG(e,t,n,o,l),t===1?(t=1,s===!0&&(t|=8)):t=0,s=ii(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},HS(s),e}function aG(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UD)}catch(e){console.error(e)}}UD(),Uj.exports=Vr;var $r=Uj.exports;const VD=Nn($r);var M4=$r;tb.createRoot=M4.createRoot,tb.hydrateRoot=M4.hydrateRoot;var dG=typeof is=="object"&&is&&is.Object===Object&&is,hG=typeof self=="object"&&self&&self.Object===Object&&self;dG||hG||Function("return this")();var fG=typeof window<"u"?w.useLayoutEffect:w.useEffect;function Pi(e,t,n,r){const i=w.useRef(t);fG(()=>{i.current=t},[t]),w.useEffect(()=>{const s=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 pG(e,t,n="mousedown",r={}){Pi(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)}function mG(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,s,a=[],o="",l=e.split("/");for(l[0]||l.shift();i=l.shift();)n=i[0],n==="*"?(a.push(n),o+=i[1]==="?"?"(?:/(.*))?":"/(.*)"):n===":"?(r=i.indexOf("?",1),s=i.indexOf(".",1),a.push(i.substring(1,~r?r:~s?s:i.length)),o+=~r&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(o+=(~r?"?":"")+"\\"+i.substring(s))):o+="/"+i;return{keys:a,pattern:new RegExp("^"+o+(t?"(?=$|/)":"/?$"),"i")}}var qD={exports:{}},GD={};/** * @license React * use-sync-external-store-shim.production.js * * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var yu=w;function gG(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var vG=typeof Object.is=="function"?Object.is:gG,yG=yu.useState,xG=yu.useEffect,_G=yu.useLayoutEffect,bG=yu.useDebugValue;function wG(e,t){var n=t(),r=yG({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return _G(function(){i.value=n,i.getSnapshot=t,Px(i)&&s({inst:i})},[e,n,t]),xG(function(){return Px(i)&&s({inst:i}),e(function(){Px(i)&&s({inst:i})})},[e]),bG(n),n}function Px(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!vG(e,n)}catch{return!0}}function SG(e,t){return t()}var CG=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?SG:wG;GD.useSyncExternalStore=yu.useSyncExternalStore!==void 0?yu.useSyncExternalStore:CG;qD.exports=GD;var KD=qD.exports;const kG=zj.useInsertionEffect,EG=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TG=EG?w.useLayoutEffect:w.useEffect,RG=kG||TG,YD=e=>{const t=w.useRef([e,(...n)=>t[0](...n)]).current;return RG(()=>{t[0]=e}),t[1]},MG="popstate",cC="pushState",uC="replaceState",AG="hashchange",A4=[MG,cC,uC,AG],jG=e=>{for(const t of A4)addEventListener(t,e);return()=>{for(const t of A4)removeEventListener(t,e)}},XD=(e,t)=>KD.useSyncExternalStore(jG,e,t),DG=()=>location.search,LG=({ssrSearch:e=""}={})=>XD(DG,()=>e),j4=()=>location.pathname,NG=({ssrPath:e}={})=>XD(j4,e?()=>e:j4),dC=(e,{replace:t=!1,state:n=null}={})=>history[t?uC:cC](n,"",e),PG=(e={})=>[NG(e),dC],D4=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[D4]>"u"){for(const e of[cC,uC]){const t=history[e];history[e]=function(){const n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,D4,{value:!0})}const OG=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?"~"+t:t.slice(e.length)||"/",QD=(e="")=>e==="/"?"":e,IG=(e,t)=>e[0]==="~"?e.slice(1):QD(t)+e,$G=(e="",t)=>OG(L4(QD(e)),L4(t)),L4=e=>{try{return decodeURI(e)}catch{return e}},JD={hook:PG,searchHook:LG,parser:mG,base:"",ssrPath:void 0,ssrSearch:void 0,hrefs:e=>e},ZD=w.createContext(JD),zu=()=>w.useContext(ZD),e7={},t7=w.createContext(e7),BG=()=>w.useContext(t7),I0=e=>{const[t,n]=e.hook(e);return[$G(e.base,t),YD((r,i)=>n(IG(r,e.base),i))]},va=()=>I0(zu()),hC=(e,t,n,r)=>{const{pattern:i,keys:s}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||"*",r),a=i.exec(n)||[],[o,...l]=a;return o!==void 0?[!0,(()=>{const c=s!==!1?Object.fromEntries(s.map((d,f)=>[d,l[f]])):a.groups;let h={...l};return c&&Object.assign(h,c),h})(),...r?[o]:[]]:[!1,null]},$0=e=>hC(zu().parser,e,va()[0]),FG=({children:e,...t})=>{var h,d;const n=zu(),r=t.hook?JD:n;let i=r;const[s,a]=((h=t.ssrPath)==null?void 0:h.split("?"))??[];a&&(t.ssrSearch=a,t.ssrPath=s),t.hrefs=t.hrefs??((d=t.hook)==null?void 0:d.hrefs);let o=w.useRef({}),l=o.current,c=l;for(let f in r){const m=f==="base"?r[f]+(t[f]||""):t[f]||r[f];l===c&&m!==c[f]&&(o.current=c={...c}),c[f]=m,m!==r[f]&&(i=c)}return w.createElement(ZD.Provider,{value:i,children:e})},N4=({children:e,component:t},n)=>t?w.createElement(t,{params:n}):typeof e=="function"?e(n):e,zG=e=>{let t=w.useRef(e7),n=t.current;for(const r in e)e[r]!==n[r]&&(n=e);return Object.keys(e).length===0&&(n=e),t.current=n},Pa=({path:e,nest:t,match:n,...r})=>{const i=zu(),[s]=I0(i),[a,o,l]=n??hC(i.parser,e,s,t),c=zG({...BG(),...o});if(!a)return null;const h=l?w.createElement(FG,{base:l},N4(r,c)):N4(r,c);return w.createElement(t7.Provider,{value:c,children:h})},fs=w.forwardRef((e,t)=>{const n=zu(),[r,i]=I0(n),{to:s="",href:a=s,onClick:o,asChild:l,children:c,className:h,replace:d,state:f,...m}=e,_=YD(y=>{y.ctrlKey||y.metaKey||y.altKey||y.shiftKey||y.button!==0||(o==null||o(y),y.defaultPrevented||(y.preventDefault(),i(a,e)))}),v=n.hrefs(a[0]==="~"?a.slice(1):n.base+a,n);return l&&w.isValidElement(c)?w.cloneElement(c,{onClick:_,href:v}):w.createElement("a",{...m,onClick:_,href:v,className:h!=null&&h.call?h(r===a):h,children:c,ref:t})}),n7=e=>Array.isArray(e)?e.flatMap(t=>n7(t&&t.type===w.Fragment?t.props.children:t)):[e],r7=({children:e,location:t})=>{const n=zu(),[r]=I0(n);for(const i of n7(e)){let s=0;if(w.isValidElement(i)&&(s=hC(n.parser,i.props.path,t||r,i.props.nest))[0])return w.cloneElement(i,{match:s})}return null};function i7(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{const t=UG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:a=>{const o=a.split(fC);return o[0]===""&&o.length!==1&&o.shift(),o7(o,t)||WG(a)},getConflictingClassGroupIds:(a,o)=>{const l=n[a]||[];return o&&r[a]?[...l,...r[a]]:l}}},o7=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),i=r?o7(e.slice(1),r):void 0;if(i)return i;if(t.validators.length===0)return;const s=e.join(fC);return(a=t.validators.find(({validator:o})=>o(s)))==null?void 0:a.classGroupId},P4=/^\[(.+)\]$/,WG=e=>{if(P4.test(e)){const t=P4.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},UG=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return qG(Object.entries(e.classGroups),n).forEach(([s,a])=>{Kb(a,r,s,t)}),r},Kb=(e,t,n,r)=>{e.forEach(i=>{if(typeof i=="string"){const s=i===""?t:O4(t,i);s.classGroupId=n;return}if(typeof i=="function"){if(VG(i)){Kb(i(r),t,n,r);return}t.validators.push({validator:i,classGroupId:n});return}Object.entries(i).forEach(([s,a])=>{Kb(a,O4(t,s),n,r)})})},O4=(e,t)=>{let n=e;return t.split(fC).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},VG=e=>e.isThemeGetter,qG=(e,t)=>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,GG=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const 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)}}},a7="!",KG=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,i=t[0],s=t.length,a=o=>{const l=[];let c=0,h=0,d;for(let y=0;yh?d-h:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:_,maybePostfixModifierPosition:v}};return n?o=>n({className:o,parseClassName:a}):a},YG=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},XG=e=>({cache:GG(e.cacheSize),parseClassName:KG(e),...HG(e)}),QG=/\s+/,JG=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i}=t,s=[],a=e.trim().split(QG);let o="";for(let l=a.length-1;l>=0;l-=1){const c=a[l],{modifiers:h,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:m}=n(c);let _=!!m,v=r(_?f.substring(0,m):f);if(!v){if(!_){o=c+(o.length>0?" "+o:o);continue}if(v=r(f),!v){o=c+(o.length>0?" "+o:o);continue}_=!1}const y=YG(h).join(":"),g=d?y+a7:y,p=g+v;if(s.includes(p))continue;s.push(p);const x=i(v,_);for(let b=0;b0?" "+o:o)}return o};function ZG(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rd(h),e());return n=XG(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 h=JG(l,n);return i(l,h),h}return function(){return s(ZG.apply(null,arguments))}}const Wt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},c7=/^\[(?:([a-z-]+):)?(.+)\]$/i,tK=/^\d+\/\d+$/,nK=new Set(["px","full","screen"]),rK=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,iK=/\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$/,sK=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,oK=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,aK=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Rs=e=>Oc(e)||nK.has(e)||tK.test(e),mo=e=>Hu(e,"length",mK),Oc=e=>!!e&&!Number.isNaN(Number(e)),Ox=e=>Hu(e,"number",Oc),Ld=e=>!!e&&Number.isInteger(Number(e)),lK=e=>e.endsWith("%")&&Oc(e.slice(0,-1)),Qe=e=>c7.test(e),go=e=>rK.test(e),cK=new Set(["length","size","percentage"]),uK=e=>Hu(e,cK,u7),dK=e=>Hu(e,"position",u7),hK=new Set(["image","url"]),fK=e=>Hu(e,hK,vK),pK=e=>Hu(e,"",gK),Nd=()=>!0,Hu=(e,t,n)=>{const r=c7.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},mK=e=>iK.test(e)&&!sK.test(e),u7=()=>!1,gK=e=>oK.test(e),vK=e=>aK.test(e),yK=()=>{const e=Wt("colors"),t=Wt("spacing"),n=Wt("blur"),r=Wt("brightness"),i=Wt("borderColor"),s=Wt("borderRadius"),a=Wt("borderSpacing"),o=Wt("borderWidth"),l=Wt("contrast"),c=Wt("grayscale"),h=Wt("hueRotate"),d=Wt("invert"),f=Wt("gap"),m=Wt("gradientColorStops"),_=Wt("gradientColorStopPositions"),v=Wt("inset"),y=Wt("margin"),g=Wt("opacity"),p=Wt("padding"),x=Wt("saturate"),b=Wt("scale"),S=Wt("sepia"),C=Wt("skew"),E=Wt("space"),k=Wt("translate"),T=()=>["auto","contain","none"],R=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto",Qe,t],D=()=>[Qe,t],N=()=>["",Rs,mo],L=()=>["auto",Oc,Qe],P=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],I=()=>["solid","dashed","dotted","double","none"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],O=()=>["start","end","center","between","around","evenly","stretch"],A=()=>["","0",Qe],j=()=>["auto","avoid","all","avoid-page","page","left","right","column"],F=()=>[Oc,Qe];return{cacheSize:500,separator:":",theme:{colors:[Nd],spacing:[Rs,mo],blur:["none","",go,Qe],brightness:F(),borderColor:[e],borderRadius:["none","","full",go,Qe],borderSpacing:D(),borderWidth:N(),contrast:F(),grayscale:A(),hueRotate:F(),invert:A(),gap:D(),gradientColorStops:[e],gradientColorStopPositions:[lK,mo],inset:M(),margin:M(),opacity:F(),padding:D(),saturate:F(),scale:F(),sepia:A(),skew:F(),space:D(),translate:D()},classGroups:{aspect:[{aspect:["auto","square","video",Qe]}],container:["container"],columns:[{columns:[go]}],"break-after":[{"break-after":j()}],"break-before":[{"break-before":j()}],"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:[...P(),Qe]}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:T()}],"overscroll-x":[{"overscroll-x":T()}],"overscroll-y":[{"overscroll-y":T()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ld,Qe]}],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",Qe]}],grow:[{grow:A()}],shrink:[{shrink:A()}],order:[{order:["first","last","none",Ld,Qe]}],"grid-cols":[{"grid-cols":[Nd]}],"col-start-end":[{col:["auto",{span:["full",Ld,Qe]},Qe]}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":[Nd]}],"row-start-end":[{row:["auto",{span:[Ld,Qe]},Qe]}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Qe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Qe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...O()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...O(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...O(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[p]}],px:[{px:[p]}],py:[{py:[p]}],ps:[{ps:[p]}],pe:[{pe:[p]}],pt:[{pt:[p]}],pr:[{pr:[p]}],pb:[{pb:[p]}],pl:[{pl:[p]}],m:[{m:[y]}],mx:[{mx:[y]}],my:[{my:[y]}],ms:[{ms:[y]}],me:[{me:[y]}],mt:[{mt:[y]}],mr:[{mr:[y]}],mb:[{mb:[y]}],ml:[{ml:[y]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Qe,t]}],"min-w":[{"min-w":[Qe,t,"min","max","fit"]}],"max-w":[{"max-w":[Qe,t,"none","full","min","max","fit","prose",{screen:[go]},go]}],h:[{h:[Qe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Qe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Qe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",go,mo]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ox]}],"font-family":[{font:[Nd]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Qe]}],"line-clamp":[{"line-clamp":["none",Oc,Ox]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Rs,Qe]}],"list-image":[{"list-image":["none",Qe]}],"list-style-type":[{list:["none","disc","decimal",Qe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...I(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Rs,mo]}],"underline-offset":[{"underline-offset":["auto",Rs,Qe]}],"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:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Qe]}],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",Qe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...P(),dK]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",uK]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},fK]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[_]}],"gradient-via-pos":[{via:[_]}],"gradient-to-pos":[{to:[_]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],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":[g]}],"border-style":[{border:[...I(),"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":[g]}],"divide-style":[{divide:I()}],"border-color":[{border:[i]}],"border-color-x":[{"border-x":[i]}],"border-color-y":[{"border-y":[i]}],"border-color-s":[{"border-s":[i]}],"border-color-e":[{"border-e":[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:["",...I()]}],"outline-offset":[{"outline-offset":[Rs,Qe]}],"outline-w":[{outline:[Rs,mo]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:N()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[Rs,mo]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",go,pK]}],"shadow-color":[{shadow:[Nd]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...z(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":z()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",go,Qe]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[S]}],"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":[h]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[S]}],"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",Qe]}],duration:[{duration:F()}],ease:[{ease:["linear","in","out","in-out",Qe]}],delay:[{delay:F()}],animate:[{animate:["none","spin","ping","pulse","bounce",Qe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[Ld,Qe]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"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",Qe]}],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",Qe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"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",Qe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Rs,mo,Ox]}],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-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"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"]}}},xK=eK(yK),ps=Object.create(null);ps.open="0";ps.close="1";ps.ping="2";ps.pong="3";ps.message="4";ps.upgrade="5";ps.noop="6";const dg=Object.create(null);Object.keys(ps).forEach(e=>{dg[ps[e]]=e});const Yb={type:"error",data:"parser error"},d7=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",h7=typeof ArrayBuffer=="function",f7=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,pC=({type:e,data:t},n,r)=>d7&&t instanceof Blob?n?r(t):I4(t,r):h7&&(t instanceof ArrayBuffer||f7(t))?n?r(t):I4(new Blob([t]),r):r(ps[e]+(t||"")),I4=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function $4(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Ix;function _K(e,t){if(d7&&e.data instanceof Blob)return e.data.arrayBuffer().then($4).then(t);if(h7&&(e.data instanceof ArrayBuffer||f7(e.data)))return t($4(e.data));pC(e,!1,n=>{Ix||(Ix=new TextEncoder),t(Ix.encode(n))})}const B4="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dh=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;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),h=new Uint8Array(c);for(r=0;r>4,h[i++]=(a&15)<<4|o>>2,h[i++]=(o&3)<<6|l&63;return c},wK=typeof ArrayBuffer=="function",mC=(e,t)=>{if(typeof e!="string")return{type:"message",data:p7(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:SK(e.substring(1),t)}:dg[n]?e.length>1?{type:dg[n],data:e.substring(1)}:{type:dg[n]}:Yb},SK=(e,t)=>{if(wK){const n=bK(e);return p7(n,t)}else return{base64:!0,data:e}},p7=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},m7="",CK=(e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach((s,a)=>{pC(s,!1,o=>{r[a]=o,++i===n&&t(r.join(m7))})})},kK=(e,t)=>{const n=e.split(m7),r=[];for(let i=0;i{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 $x;function dm(e){return e.reduce((t,n)=>t+n.length,0)}function hm(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;iMath.pow(2,21)-1){o.enqueue(Yb);break}i=h*Math.pow(2,32)+c.getUint32(4),r=3}else{if(dm(n)e){o.enqueue(Yb);break}}}})}const g7=4;function vn(e){if(e)return RK(e)}function RK(e){for(var t in vn.prototype)e[t]=vn.prototype[t];return e}vn.prototype.on=vn.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};vn.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};vn.prototype.off=vn.prototype.removeListener=vn.prototype.removeAllListeners=vn.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;iPromise.resolve().then(t):(t,n)=>n(t,0),Zr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),MK="arraybuffer";function v7(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const AK=Zr.setTimeout,jK=Zr.clearTimeout;function F0(e,t){t.useNativeTimers?(e.setTimeoutFn=AK.bind(Zr),e.clearTimeoutFn=jK.bind(Zr)):(e.setTimeoutFn=Zr.setTimeout.bind(Zr),e.clearTimeoutFn=Zr.clearTimeout.bind(Zr))}const DK=1.33;function LK(e){return typeof e=="string"?NK(e):Math.ceil((e.byteLength||e.size)*DK)}function NK(e){let t=0,n=0;for(let r=0,i=e.length;r=57344?n+=3:(r++,n+=4);return n}function y7(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function PK(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function OK(e){let t={},n=e.split("&");for(let r=0,i=n.length;r{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)};kK(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,CK(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]=y7()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let x7=!1;try{x7=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const BK=x7;function FK(){}class zK extends $K{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}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 cs extends vn{constructor(t,n,r){super(),this.createRequest=t,F0(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=v7(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(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.getResponseHeader("set-cookie"))),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=cs.requestsCount++,cs.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=FK,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete cs.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()}}cs.requestsCount=0;cs.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",F4);else if(typeof addEventListener=="function"){const e="onpagehide"in Zr?"pagehide":"unload";addEventListener(e,F4,!1)}}function F4(){for(let e in cs.requests)cs.requests.hasOwnProperty(e)&&cs.requests[e].abort()}const HK=function(){const e=_7({xdomain:!1});return e&&e.responseType!==null}();class WK extends zK{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=HK&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new cs(_7,this.uri(),t)}}function _7(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||BK))return new XMLHttpRequest}catch{}if(!t)try{return new Zr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const b7=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class UK extends gC{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=b7?{}:v7(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=this.createSocket(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{try{this.doWrite(r,s)}catch{}i&&B0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},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]=y7()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Bx=Zr.WebSocket||Zr.MozWebSocket;class VK extends UK{createSocket(t,n,r){return b7?new Bx(t,n,r):n?new Bx(t,n):new Bx(t)}doWrite(t,n){this.ws.send(n)}}class qK extends gC{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=TK(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),i=EK();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{i&&B0(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const GK={websocket:VK,webtransport:qK,polling:WK},KK=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,YK=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Xb(e){if(e.length>8e3)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=KK.exec(e||""),s={},a=14;for(;a--;)s[YK[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=XK(s,s.path),s.queryKey=QK(s,s.query),s}function XK(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 QK(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,s){i&&(n[i]=s)}),n}const Qb=typeof addEventListener=="function"&&typeof removeEventListener=="function",hg=[];Qb&&addEventListener("offline",()=>{hg.forEach(e=>e())},!1);class Zo extends vn{constructor(t,n){if(super(),this.binaryType=MK,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=Xb(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=Xb(n.host).host);F0(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=[],this._transportsByName={},n.transports.forEach(r=>{const i=r.prototype.name;this.transports.push(i),this._transportsByName[i]=r}),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=OK(this.opts.query)),Qb&&(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"})},hg.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=g7,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 this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&Zo.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}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))}onOpen(){this.readyState="open",Zo.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();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._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),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;r0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,B0(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}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){if(Zo.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Qb&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=hg.indexOf(this._offlineEventListener);r!==-1&&hg.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}Zo.protocol=g7;class JK extends Zo{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",d=>{if(!r)if(d.type==="pong"&&d.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Zo.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(h(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const f=new Error("probe error");f.transport=n.name,this.emitReserved("upgradeError",f)}}))};function s(){r||(r=!0,h(),n.close(),n=null)}const a=d=>{const f=new Error("probe error: "+d);f.transport=n.name,s(),this.emitReserved("upgradeError",f)};function o(){a("transport closed")}function l(){a("socket closed")}function c(d){n&&d.name!==n.name&&s()}const h=()=>{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()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;rGK[i]).filter(i=>!!i)),super(t,r)}};function eY(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=Xb(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 tY=typeof ArrayBuffer=="function",nY=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,w7=Object.prototype.toString,rY=typeof Blob=="function"||typeof Blob<"u"&&w7.call(Blob)==="[object BlobConstructor]",iY=typeof File=="function"||typeof File<"u"&&w7.call(File)==="[object FileConstructor]";function vC(e){return tY&&(e instanceof ArrayBuffer||nY(e))||rY&&e instanceof Blob||iY&&e instanceof File}function fg(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n=0&&e.num{delete this.acks[t];for(let o=0;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:at.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 at.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 at.EVENT:case at.BINARY_EVENT:this.onevent(t);break;case at.ACK:case at.BINARY_ACK:this.onack(t);break;case at.DISCONNECT:this.ondisconnect();break;case at.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:at.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:at.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;r0&&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 ew extends vn{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,F0(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||dY;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,t||(this.skipReconnect=!0),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 ZK(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=Si(n,"open",function(){r.onopen(),t&&t()}),s=o=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",o),t?t(o):this.maybeReconnectOnOpen()},a=Si(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(Si(t,"ping",this.onping.bind(this)),Si(t,"data",this.ondata.bind(this)),Si(t,"error",this.onerror.bind(this)),Si(t,"close",this.onclose.bind(this)),Si(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){B0(()=>{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 S7(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;rt()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),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 Pd={};function Lh(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=eY(e,t.path||"/socket.io"),r=n.source,i=n.id,s=n.path,a=Pd[i]&&s in Pd[i].nsps,o=t.forceNew||t["force new connection"]||t.multiplex===!1||a;let l;return o?l=new ew(r,t):(Pd[i]||(Pd[i]=new ew(r,t)),l=Pd[i]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Lh,{Manager:ew,Socket:S7,io:Lh,connect:Lh});function J(...e){return xK(s7(e))}const fY=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,"")},br=(e,t=0)=>e.toLocaleString(window.txBrowserLocale,{maximumFractionDigits:t}),xC=e=>{const t={transports:["polling"],upgrade:!1,query:{rooms:e,uiVersion:window.txConsts.txaVersion}};return window.txConsts.isWebInterface?Lh({...t,path:"/socket.io"}):Lh("monitor",{...t,path:"/WebPipe/socket.io"})},C7=async(e,t)=>{const n=()=>navigator.clipboard.writeText(e),r=()=>{const i=document.createElement("textarea");i.value=e,t.appendChild(i),i.select();const s=document.execCommand("copy");return t.removeChild(i),s};if(window.txConsts.isWebInterface)try{return await n()}catch{return r()}else return r()},sv=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}`},pY=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}`},z0=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("rounded-lg border bg-card text-card-foreground shadow-sm",e),...t}));z0.displayName="Card";const H0=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("flex flex-col space-y-1.5 p-6",e),...t}));H0.displayName="CardHeader";const _C=w.forwardRef(({className:e,...t},n)=>u.jsx("h3",{ref:n,className:J("text-2xl font-semibold leading-none tracking-tight",e),...t}));_C.displayName="CardTitle";const k7=w.forwardRef(({className:e,...t},n)=>u.jsx("p",{ref:n,className:J("text-sm text-muted-foreground",e),...t}));k7.displayName="CardDescription";const Uu=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("p-6 pt-0",e),...t}));Uu.displayName="CardContent";const Vu=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{ref:n,className:J("flex items-center p-6 pt-0",e),...t}));Vu.displayName="CardFooter";var E7={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},H4=ft.createContext&&ft.createContext(E7),mY=["attr","size","title"];function gY(e,t){if(e==null)return{};var n=vY(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function vY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function ov(){return ov=Object.assign?Object.assign.bind():function(e){for(var t=1;tft.createElement(t.tag,av({key:n},t.attr),T7(t.child)))}function R7(e){return t=>ft.createElement(bY,ov({attr:av({},e.attr)},t),T7(e.child))}function bY(e){var t=n=>{var{attr:r,size:i,title:s}=e,a=gY(e,mY),o=i||n.size||"1em",l;return n.className&&(l=n.className),e.className&&(l=(l?l+" ":"")+e.className),ft.createElement("svg",ov({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,a,{className:l,style:av(av({color:e.color||n.color},n.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&ft.createElement("title",null,s),e.children)};return H4!==void 0?ft.createElement(H4.Consumer,null,n=>t(n)):t(E7)}function wY(e){return R7({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 U4(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function op(...e){return t=>{let n=!1;const r=e.map(i=>{const s=U4(i,t);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let i=0;i{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(SY);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return u.jsx(tw,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return u.jsx(tw,{...r,ref:t,children:n})});ia.displayName="Slot";var tw=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=kY(n);return w.cloneElement(n,{...CY(r,n.props),ref:t?op(t,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});tw.displayName="SlotClone";var bC=({children:e})=>u.jsx(u.Fragment,{children:e});function SY(e){return w.isValidElement(e)&&e.type===bC}function CY(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 kY(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const V4=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,q4=s7,co=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return q4(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 h=n==null?void 0:n[c],d=s==null?void 0:s[c];if(h===null)return null;const f=V4(h)||V4(d);return i[c][f]}),o=n&&Object.entries(n).reduce((c,h)=>{let[d,f]=h;return f===void 0||(c[d]=f),c},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((c,h)=>{let{class:d,className:f,...m}=h;return Object.entries(m).every(_=>{let[v,y]=_;return Array.isArray(y)?y.includes({...s,...o}[v]):{...s,...o}[v]===y})?[...c,d,f]:c},[]);return q4(e,a,l,n==null?void 0:n.class,n==null?void 0:n.className)},ap=co("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",muted:"bg-muted text-muted-foreground hover:bg-secondary hover:text-seconbg-secondary-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"}}),De=w.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},s)=>{const a=r?ia:"button";return u.jsx(a,{className:J(ap({variant:t,size:n,className:e})),ref:s,...i})});De.displayName="Button";var EY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ee=EY.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?ia:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function lv(e,t){e&&$r.flushSync(()=>e.dispatchEvent(t))}var pn=globalThis!=null&&globalThis.document?w.useLayoutEffect:()=>{};function TY(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var xn=e=>{const{present:t,children:n}=e,r=RY(t),i=typeof n=="function"?n({present:r.isPresent}):w.Children.only(n),s=We(r.ref,MY(i));return typeof n=="function"||r.isPresent?w.cloneElement(i,{ref:s}):null};xn.displayName="Presence";function RY(e){const[t,n]=w.useState(),r=w.useRef({}),i=w.useRef(e),s=w.useRef("none"),a=e?"mounted":"unmounted",[o,l]=TY(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return w.useEffect(()=>{const c=fm(r.current);s.current=o==="mounted"?c:"none"},[o]),pn(()=>{const c=r.current,h=i.current;if(h!==e){const f=s.current,m=fm(c);e?l("MOUNT"):m==="none"||(c==null?void 0:c.display)==="none"?l("UNMOUNT"):l(h&&f!==m?"ANIMATION_OUT":"UNMOUNT"),i.current=e}},[e,l]),pn(()=>{if(t){let c;const h=t.ownerDocument.defaultView??window,d=m=>{const v=fm(r.current).includes(m.animationName);if(m.target===t&&v&&(l("ANIMATION_END"),!i.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",c=h.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},f=m=>{m.target===t&&(s.current=fm(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{h.clearTimeout(c),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(o),ref:w.useCallback(c=>{c&&(r.current=getComputedStyle(c)),n(c)},[])}}function fm(e){return(e==null?void 0:e.animationName)||"none"}function MY(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function AY(e,t){const n=w.createContext(t),r=s=>{const{children:a,...o}=s,l=w.useMemo(()=>o,Object.values(o));return u.jsx(n.Provider,{value:l,children:a})};r.displayName=e+"Provider";function i(s){const a=w.useContext(n);if(a)return a;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[r,i]}function Un(e,t=[]){let n=[];function r(s,a){const o=w.createContext(a),l=n.length;n=[...n,a];const c=d=>{var g;const{scope:f,children:m,..._}=d,v=((g=f==null?void 0:f[e])==null?void 0:g[l])||o,y=w.useMemo(()=>_,Object.values(_));return u.jsx(v.Provider,{value:y,children:m})};c.displayName=s+"Provider";function h(d,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[l])||o,_=w.useContext(m);if(_)return _;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${s}\``)}return[c,h]}const i=()=>{const s=n.map(a=>w.createContext(a));return function(o){const l=(o==null?void 0:o[e])||s;return w.useMemo(()=>({[`__scope${e}`]:{...o,[e]:l}}),[o,l])}};return i.scopeName=e,[r,jY(i,...t)]}function jY(...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 d=l(s)[`__scope${c}`];return{...o,...d}},{});return w.useMemo(()=>({[`__scope${t.scopeName}`]:a}),[a])}};return n.scopeName=t.scopeName,n}function jt(e){const t=w.useRef(e);return w.useEffect(()=>{t.current=e}),w.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}var DY=w.createContext(void 0);function Al(e){const t=w.useContext(DY);return e||t||"ltr"}function nw(e,[t,n]){return Math.min(n,Math.max(t,e))}function fe(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 LY(e,t){return w.useReducer((n,r)=>t[n][r]??n,e)}var wC="ScrollArea",[M7,G9e]=Un(wC),[NY,pi]=M7(wC),A7=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:i,scrollHideDelay:s=600,...a}=e,[o,l]=w.useState(null),[c,h]=w.useState(null),[d,f]=w.useState(null),[m,_]=w.useState(null),[v,y]=w.useState(null),[g,p]=w.useState(0),[x,b]=w.useState(0),[S,C]=w.useState(!1),[E,k]=w.useState(!1),T=We(t,M=>l(M)),R=Al(i);return u.jsx(NY,{scope:n,type:r,dir:R,scrollHideDelay:s,scrollArea:o,viewport:c,onViewportChange:h,content:d,onContentChange:f,scrollbarX:m,onScrollbarXChange:_,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:k,onCornerWidthChange:p,onCornerHeightChange:b,children:u.jsx(Ee.div,{dir:R,...a,ref:T,style:{position:"relative","--radix-scroll-area-corner-width":g+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})})});A7.displayName=wC;var j7="ScrollAreaViewport",D7=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:i,...s}=e,a=pi(j7,n),o=w.useRef(null),l=We(t,o,a.onViewportChange);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),u.jsx(Ee.div,{"data-radix-scroll-area-viewport":"",...s,ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style},children:u.jsx("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});D7.displayName=j7;var bs="ScrollAreaScrollbar",SC=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pi(bs,e.__scopeScrollArea),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:a}=i,o=e.orientation==="horizontal";return w.useEffect(()=>(o?s(!0):a(!0),()=>{o?s(!1):a(!1)}),[o,s,a]),i.type==="hover"?u.jsx(PY,{...r,ref:t,forceMount:n}):i.type==="scroll"?u.jsx(OY,{...r,ref:t,forceMount:n}):i.type==="auto"?u.jsx(L7,{...r,ref:t,forceMount:n}):i.type==="always"?u.jsx(CC,{...r,ref:t}):null});SC.displayName=bs;var PY=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pi(bs,e.__scopeScrollArea),[s,a]=w.useState(!1);return w.useEffect(()=>{const o=i.scrollArea;let l=0;if(o){const c=()=>{window.clearTimeout(l),a(!0)},h=()=>{l=window.setTimeout(()=>a(!1),i.scrollHideDelay)};return o.addEventListener("pointerenter",c),o.addEventListener("pointerleave",h),()=>{window.clearTimeout(l),o.removeEventListener("pointerenter",c),o.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),u.jsx(xn,{present:n||s,children:u.jsx(L7,{"data-state":s?"visible":"hidden",...r,ref:t})})}),OY=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=pi(bs,e.__scopeScrollArea),s=e.orientation==="horizontal",a=U0(()=>l("SCROLL_END"),100),[o,l]=LY("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 w.useEffect(()=>{if(o==="idle"){const c=window.setTimeout(()=>l("HIDE"),i.scrollHideDelay);return()=>window.clearTimeout(c)}},[o,i.scrollHideDelay,l]),w.useEffect(()=>{const c=i.viewport,h=s?"scrollLeft":"scrollTop";if(c){let d=c[h];const f=()=>{const m=c[h];d!==m&&(l("SCROLL"),a()),d=m};return c.addEventListener("scroll",f),()=>c.removeEventListener("scroll",f)}},[i.viewport,s,l,a]),u.jsx(xn,{present:n||o!=="hidden",children:u.jsx(CC,{"data-state":o==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:fe(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:fe(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),L7=w.forwardRef((e,t)=>{const n=pi(bs,e.__scopeScrollArea),{forceMount:r,...i}=e,[s,a]=w.useState(!1),o=e.orientation==="horizontal",l=U0(()=>{if(n.viewport){const c=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,i=pi(bs,e.__scopeScrollArea),s=w.useRef(null),a=w.useRef(0),[o,l]=w.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),c=$7(o.viewport,o.content),h={...r,sizes:o,onSizesChange:l,hasThumb:c>0&&c<1,onThumbChange:f=>s.current=f,onThumbPointerUp:()=>a.current=0,onThumbPointerDown:f=>a.current=f};function d(f,m){return HY(f,a.current,o,m)}return n==="horizontal"?u.jsx(IY,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollLeft,m=G4(f,o,i.dir);s.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollLeft=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollLeft=d(f,i.dir))}}):n==="vertical"?u.jsx($Y,{...h,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const f=i.viewport.scrollTop,m=G4(f,o);s.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:f=>{i.viewport&&(i.viewport.scrollTop=f)},onDragScroll:f=>{i.viewport&&(i.viewport.scrollTop=d(f))}}):null}),IY=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=pi(bs,e.__scopeScrollArea),[a,o]=w.useState(),l=w.useRef(null),c=We(t,l,s.onScrollbarXChange);return w.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),u.jsx(P7,{"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":W0(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,d)=>{if(s.viewport){const f=s.viewport.scrollLeft+h.deltaX;e.onWheelScroll(f),F7(f,d)&&h.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:uv(a.paddingLeft),paddingEnd:uv(a.paddingRight)}})}})}),$Y=w.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...i}=e,s=pi(bs,e.__scopeScrollArea),[a,o]=w.useState(),l=w.useRef(null),c=We(t,l,s.onScrollbarYChange);return w.useEffect(()=>{l.current&&o(getComputedStyle(l.current))},[l]),u.jsx(P7,{"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":W0(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,d)=>{if(s.viewport){const f=s.viewport.scrollTop+h.deltaY;e.onWheelScroll(f),F7(f,d)&&h.preventDefault()}},onResize:()=>{l.current&&s.viewport&&a&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:uv(a.paddingTop),paddingEnd:uv(a.paddingBottom)}})}})}),[BY,N7]=M7(bs),P7=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:i,onThumbChange:s,onThumbPointerUp:a,onThumbPointerDown:o,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:h,onResize:d,...f}=e,m=pi(bs,n),[_,v]=w.useState(null),y=We(t,T=>v(T)),g=w.useRef(null),p=w.useRef(""),x=m.viewport,b=r.content-r.viewport,S=jt(h),C=jt(l),E=U0(d,10);function k(T){if(g.current){const R=T.clientX-g.current.left,M=T.clientY-g.current.top;c({x:R,y:M})}}return w.useEffect(()=>{const T=R=>{const M=R.target;(_==null?void 0:_.contains(M))&&S(R,b)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[x,_,b,S]),w.useEffect(C,[r,C]),xu(_,E),xu(m.content,E),u.jsx(BY,{scope:n,scrollbar:_,hasThumb:i,onThumbChange:jt(s),onThumbPointerUp:jt(a),onThumbPositionChange:C,onThumbPointerDown:jt(o),children:u.jsx(Ee.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:fe(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),g.current=_.getBoundingClientRect(),p.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),k(T))}),onPointerMove:fe(e.onPointerMove,k),onPointerUp:fe(e.onPointerUp,T=>{const R=T.target;R.hasPointerCapture(T.pointerId)&&R.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=p.current,m.viewport&&(m.viewport.style.scrollBehavior=""),g.current=null})})})}),cv="ScrollAreaThumb",O7=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=N7(cv,e.__scopeScrollArea);return u.jsx(xn,{present:n||i.hasThumb,children:u.jsx(FY,{ref:t,...r})})}),FY=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...i}=e,s=pi(cv,n),a=N7(cv,n),{onThumbPositionChange:o}=a,l=We(t,d=>a.onThumbChange(d)),c=w.useRef(void 0),h=U0(()=>{c.current&&(c.current(),c.current=void 0)},100);return w.useEffect(()=>{const d=s.viewport;if(d){const f=()=>{if(h(),!c.current){const m=WY(d,o);c.current=m,o()}};return o(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[s.viewport,h,o]),u.jsx(Ee.div,{"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:fe(e.onPointerDownCapture,d=>{const m=d.target.getBoundingClientRect(),_=d.clientX-m.left,v=d.clientY-m.top;a.onThumbPointerDown({x:_,y:v})}),onPointerUp:fe(e.onPointerUp,a.onThumbPointerUp)})});O7.displayName=cv;var kC="ScrollAreaCorner",I7=w.forwardRef((e,t)=>{const n=pi(kC,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?u.jsx(zY,{...e,ref:t}):null});I7.displayName=kC;var zY=w.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,i=pi(kC,n),[s,a]=w.useState(0),[o,l]=w.useState(0),c=!!(s&&o);return xu(i.scrollbarX,()=>{var d;const h=((d=i.scrollbarX)==null?void 0:d.offsetHeight)||0;i.onCornerHeightChange(h),l(h)}),xu(i.scrollbarY,()=>{var d;const h=((d=i.scrollbarY)==null?void 0:d.offsetWidth)||0;i.onCornerWidthChange(h),a(h)}),c?u.jsx(Ee.div,{...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 uv(e){return e?parseInt(e,10):0}function $7(e,t){const n=e/t;return isNaN(n)?0:n}function W0(e){const t=$7(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function HY(e,t,n,r="ltr"){const i=W0(n),s=i/2,a=t||s,o=i-a,l=n.scrollbar.paddingStart+a,c=n.scrollbar.size-n.scrollbar.paddingEnd-o,h=n.content-n.viewport,d=r==="ltr"?[0,h]:[h*-1,0];return B7([l,c],d)(e)}function G4(e,t,n="ltr"){const r=W0(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=nw(e,l);return B7([0,a],[0,o])(c)}function B7(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 F7(e,t){return e>0&&e{})=>{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 U0(e,t){const n=jt(e),r=w.useRef(0);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),w.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function xu(e,t){const n=jt(t);pn(()=>{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])}var z7=A7,UY=D7,VY=I7;const hi=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(z7,{ref:r,className:J("relative overflow-hidden",e),...n,children:[u.jsx(UY,{className:"h-full w-full rounded-[inherit]",children:t}),u.jsx(H7,{}),u.jsx(VY,{})]}));hi.displayName=z7.displayName;const H7=w.forwardRef(({className:e,orientation:t="vertical",...n},r)=>u.jsx(SC,{ref:r,orientation:t,className:J("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:u.jsx(O7,{className:"relative flex-1 rounded-full bg-border"})}));H7.displayName=SC.displayName;function qY({error:e}){const t=()=>{window.location.reload()};return u.jsx("div",{className:"w-screen h-screen flex flex-col items-center justify-center",children:u.jsx(W7,{title:"App Error:",description:"Due to an unexpected error, the panel has crashed.",error:e,resetButton:u.jsx(De,{variant:"outline",onClick:t,children:"Refresh"})})})}function GY({error:e,resetErrorBoundary:t}){return u.jsx("div",{className:"w-full flex flex-col items-center justify-center",children:u.jsx(W7,{title:"Page Error:",description:"There was an error rendering this page.",error:e,resetButton:u.jsx(De,{variant:"outline",onClick:t,children:"Go Back"})})})}function W7(e){return u.jsxs(z0,{className:"max-w-xl",children:[u.jsxs(H0,{children:[u.jsxs("h1",{className:"text-3xl text-red-500 pb-0 flex flex-row justify-start items-center",children:[u.jsx(wY,{className:"inline-block mr-2"}),e.title]}),u.jsx("span",{className:"text-sm text-muted-foreground pt-0",children:e.description})]}),u.jsxs(Uu,{children:[u.jsxs("p",{className:"truncate",children:["Page: ",u.jsxs("code",{className:"text-muted-foreground ",children:[window.location.pathname??"unknown",window.location.search??""]})]}),u.jsxs("p",{children:["Versions: ",u.jsxs("code",{className:"text-muted-foreground",children:["txAdmin v",window.txConsts.txaVersion," atop FXServer b",window.txConsts.fxsVersion]})]}),u.jsxs("p",{children:["Message: ",u.jsx("code",{className:"text-muted-foreground",children:e.error.message??"unknown"})]}),u.jsx("p",{children:"Stack:"}),u.jsx("pre",{className:"mt-1",children:u.jsx(hi,{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})})]}),u.jsxs(Vu,{className:"flex flex-row justify-between",children:[e.resetButton,u.jsx(De,{asChild:!0,variant:"outline",className:"bg-discord hover:bg-discord-active animate-pulse hover:animate-none",children:u.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"Support Discord"})})]})]})}let KY=0;function nt(e,t){const n=`atom${++KY}`,r={toString(){return n}};return typeof e=="function"?r.read=e:(r.init=e,r.read=YY,r.write=XY),t&&(r.write=t),r}function YY(e){return e(this)}function XY(e,t,n){return t(this,typeof n=="function"?n(e(this)):n)}const K4=(e,t)=>e.unstable_is?e.unstable_is(t):t===e,Y4=e=>"init"in e,X4=e=>!!e.write,dv=new WeakMap,rw=e=>{var t;return iw(e)&&!((t=dv.get(e))!=null&&t[1])},QY=(e,t)=>{const n=dv.get(e);n&&(n[1]=!0,n[0].forEach(r=>r(t)))},JY=e=>{if(dv.has(e))return;const t=[new Set,!1];dv.set(e,t);const n=()=>{t[1]=!0};e.then(n,n),e.onCancel=r=>{t[0].add(r)}},iw=e=>typeof(e==null?void 0:e.then)=="function",Q4=e=>"v"in e||"e"in e,pm=e=>{if("e"in e)throw e.e;return e.v},U7=(e,t,n)=>{n.p.has(e)||(n.p.add(e),t.then(()=>{n.p.delete(e)},()=>{n.p.delete(e)}))},J4=(e,t,n,r,i)=>{var s;n.d.set(r,i.n),rw(n.v)&&U7(t,n.v,i),(s=i.m)==null||s.t.add(t),e&&ZY(e,r,t)},Od=()=>({D:new Map,H:new Set,M:new Set,L:new Set}),Nh=(e,t,n)=>{e[t].add(n)},Z4=(e,t,n)=>{e.D.has(t)||(e.D.set(t,new Set),Nh(e,"M",()=>{var r;(r=n.m)==null||r.l.forEach(i=>Nh(e,"M",i))}))},ZY=(e,t,n)=>{const r=e.D.get(t);r&&r.add(n)},eX=(e,t)=>e.D.get(t),Ta=e=>{let t,n=!1;const r=i=>{try{i()}catch(s){n||(t=s,n=!0)}};for(;e.H.size||e.M.size||e.L.size;)e.D.clear(),e.H.forEach(r),e.H.clear(),e.M.forEach(r),e.M.clear(),e.L.forEach(r),e.L.clear();if(n)throw t},V7=(...[e,t,n,r])=>{const i=(g,p,x)=>{const b="v"in p,S=p.v,C=rw(p.v)?p.v:null;if(iw(x)){JY(x);for(const E of p.d.keys())U7(g,x,e(E));p.v=x}else p.v=x;delete p.e,delete p.x,(!b||!Object.is(S,p.v))&&(++p.n,C&&QY(C,x))},s=(g,p)=>{var x;const b=e(p);if(Q4(b)&&(b.m&&!b.x||Array.from(b.d).every(([R,M])=>s(g,R).n===M)))return b;b.d.clear();let S=!0;const C=R=>{if(K4(p,R)){const D=e(R);if(!Q4(D))if(Y4(R))i(R,D,R.init);else throw new Error("no atom init");return pm(D)}const M=s(g,R);try{return pm(M)}finally{if(S)J4(g,p,b,R,M);else{const D=Od();J4(D,p,b,R,M),d(D,p,b),Ta(D)}}};let E,k;const T={get signal(){return E||(E=new AbortController),E.signal},get setSelf(){return!k&&X4(p)&&(k=(...R)=>{if(!S)return h(p,...R)}),k}};try{const R=t(p,C,T);if(i(p,b,R),iw(R)){(x=R.onCancel)==null||x.call(R,()=>E==null?void 0:E.abort());const M=()=>{if(b.m){const D=Od();d(D,p,b),Ta(D)}};R.then(M,M)}return b}catch(R){return delete b.v,b.e=R,delete b.x,++b.n,b}finally{S=!1}},a=g=>pm(s(void 0,g)),o=(g,p,x)=>{var b,S;const C=new Map;for(const E of((b=x.m)==null?void 0:b.t)||[]){const k=e(E);k.m&&C.set(E,k)}for(const E of x.p)C.set(E,e(E));return(S=eX(g,p))==null||S.forEach(E=>{C.set(E,e(E))}),C},l=(g,p,x)=>{const b=[],S=new Set,C=new Set,E=[[p,x]];for(;E.length>0;){const[k,T]=E[E.length-1];if(C.has(k)){E.pop();continue}if(S.has(k)){b.push([k,T,T.n]),C.add(k),T.x=!0,E.pop();continue}S.add(k);for(const[R,M]of o(g,k,T))k!==R&&!S.has(R)&&E.push([R,M])}Nh(g,"H",()=>{const k=new Set([p]);for(let T=b.length-1;T>=0;--T){const[R,M,D]=b[T];let N=!1;for(const L of M.d.keys())if(L!==R&&k.has(L)){N=!0;break}N&&(s(g,R),d(g,R,M),D!==M.n&&(Z4(g,R,M),k.add(R))),delete M.x}})},c=(g,p,...x)=>{let b=!0;const S=E=>pm(s(g,E)),C=(E,...k)=>{const T=e(E);try{if(K4(p,E)){if(!Y4(E))throw new Error("atom not writable");const R=T.n,M=k[0];i(E,T,M),d(g,E,T),R!==T.n&&(Z4(g,E,T),l(g,E,T));return}else return c(g,E,...k)}finally{b||Ta(g)}};try{return n(p,S,C,...x)}finally{b=!1}},h=(g,...p)=>{const x=Od();try{return c(x,g,...p)}finally{Ta(x)}},d=(g,p,x)=>{if(x.m&&!rw(x.v)){for(const b of x.d.keys())x.m.d.has(b)||(f(g,b,e(b)).t.add(p),x.m.d.add(b));for(const b of x.m.d||[])if(!x.d.has(b)){x.m.d.delete(b);const S=m(g,b,e(b));S==null||S.t.delete(p)}}},f=(g,p,x)=>{if(!x.m){s(g,p);for(const b of x.d.keys())f(g,b,e(b)).t.add(p);if(x.m={l:new Set,d:new Set(x.d.keys()),t:new Set},X4(p)){const b=x.m;let S;const C=(E,k)=>{let T=!0;S=(...R)=>{try{return c(E,p,...R)}finally{T||Ta(E)}};try{return k()}finally{T=!1}};Nh(g,"L",()=>{const E=C(g,()=>r(p,(...k)=>S(...k)));E&&(b.u=k=>C(k,E))})}}return x.m},m=(g,p,x)=>{if(x.m&&!x.m.l.size&&!Array.from(x.m.t).some(b=>{var S;return(S=e(b).m)==null?void 0:S.d.has(p)})){const b=x.m.u;b&&Nh(g,"L",()=>b(g)),delete x.m;for(const S of x.d.keys()){const C=m(g,S,e(S));C==null||C.t.delete(p)}return}return x.m};return{get:a,set:h,sub:(g,p)=>{const x=Od(),b=e(g),C=f(x,g,b).l;return C.add(p),Ta(x),()=>{C.delete(p);const E=Od();m(E,g,b),Ta(E)}},unstable_derive:g=>V7(...g(e,t,n,r))}},tX=()=>{const e=new WeakMap;return V7(r=>{let i=e.get(r);return i||(i={d:new Map,p:new Set,n:0},e.set(r,i)),i},(r,...i)=>r.read(...i),(r,...i)=>r.write(...i),(r,...i)=>{var s;return(s=r.onMount)==null?void 0:s.call(r,...i)})};let Fx;const nX=()=>(Fx||(Fx=tX()),Fx),rX=w.createContext(void 0),q7=e=>w.useContext(rX)||nX(),G7=e=>typeof(e==null?void 0:e.then)=="function",iX=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},sX=ft.use||(e=>{if(e.status==="pending")throw e;if(e.status==="fulfilled")return e.value;throw e.status==="rejected"?e.reason:(iX(e),e)}),zx=new WeakMap,oX=e=>{let t=zx.get(e);return t||(t=new Promise((n,r)=>{let i=e;const s=l=>c=>{i===l&&n(c)},a=l=>c=>{i===l&&r(c)},o=l=>{"onCancel"in l&&typeof l.onCancel=="function"&&l.onCancel(c=>{G7(c)?(zx.set(c,t),i=c,c.then(s(c),a(c)),o(c)):n(c)})};e.then(s(e),a(e)),o(e)}),zx.set(e,t)),t};function ct(e,t){const n=q7(),[[r,i,s],a]=w.useReducer(c=>{const h=n.get(e);return Object.is(c[0],h)&&c[1]===n&&c[2]===e?c:[h,n,e]},void 0,()=>[n.get(e),n,e]);let o=r;if((i!==n||s!==e)&&(a(),o=n.get(e)),w.useEffect(()=>{const c=n.sub(e,()=>{a()});return a(),c},[n,e,void 0]),w.useDebugValue(o),G7(o)){const c=oX(o);return sX(c)}return o}function it(e,t){const n=q7();return w.useCallback((...i)=>n.set(e,...i),[n,e])}function Tr(e,t){return[ct(e),it(e)]}function K7(e){const t=nt(0),n=nt(()=>({i:0}),(l,c)=>{const h=l(n);return Object.assign(h,{m:!0,peek:l,set:c}),c(t,d=>d+1),()=>{h.m=!1,a(h),o(h)}});n.onMount=l=>l();const r=nt(l=>{l(t);const c=l(n);if(!c.m||c.irc||c.i&&!c.irf)return c.p;o(c);const h=new Map,d=v=>{const y=l(v);return h.set(v,y),y};d.peek=c.peek;const f=(...v)=>{try{return++c.i,c.set(...v)}finally{Array.from(h.keys(),l),--c.i}};function m([v,y]){return l(v)!==y}function _(){try{if(c.irf=!1,!c.m)return;a(c),c.c=i.effect(d,f)}catch(v){c.e=v,s(c)}finally{c.p=void 0,--c.i}}return f.recurse=(v,...y)=>{if(!c.fc)try{return c.irc=!0,c.set(v,...y)}finally{c.irc=!1,Array.from(h).some(m)&&s(c)}},++c.i,c.irf?_():c.p=Promise.resolve().then(_)}),i=nt(l=>{l(r)});return i.effect=e,i;function s(l){try{l.irf=!0,l.set(t,c=>c+1)}finally{l.irf=!1}}function a(l){if(l.c)try{l.fc=!0,l.c()}finally{l.fc=!1,l.c=void 0}}function o(l){if("e"in l){const c=l.e;throw delete l.e,c}}}const Y7=""+new URL("favicon_default.svg",import.meta.url).href,aX=""+new URL("favicon_online.svg",import.meta.url).href,lX=""+new URL("favicon_partial.svg",import.meta.url).href,cX=""+new URL("favicon_offline.svg",import.meta.url).href;var Ys=(e=>(e.Unkown="unknown",e.Setup="setup",e.Deployer="deployer",e.Ready="ready",e))(Ys||{}),hh=(e=>(e[e.Disabled=0]="Disabled",e[e.Starting=1]="Starting",e[e.Ready=2]="Ready",e[e.Error=3]="Error",e))(hh||{});const jl=nt(null),X7=nt(e=>{var t;return((t=e(jl))==null?void 0:t.server.name)??"unconfigured"}),EC=nt(e=>{var t;return((t=e(jl))==null?void 0:t.configState)??Ys.Unkown}),Q7=nt(e=>{var t;return((t=e(jl))==null?void 0:t.runner)??{isIdle:!0,isChildAlive:!1}}),uX=()=>it(jl),J7=()=>ct(jl);function Jn(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,h,d=!1,f=0;function m(){h&&clearTimeout(h)}function _(y){var g=y||{},p=g.upcomingOnly,x=p===void 0?!1:p;m(),d=!x}function v(){for(var y=arguments.length,g=new Array(y),p=0;pe?o?(f=Date.now(),s||(h=setTimeout(c?C:S,e))):S():s!==!0&&(h=setTimeout(c?C:S,c===void 0?e-b:e))}return v.cancel=_,v}function TC(e,t,n){var r=n||{},i=r.atBegin,s=i===void 0?!1:i;return Jn(e,t,{debounceMode:s!==!1})}const V0=nt(void 0),RC=nt(void 0),q0=nt(void 0),G0=nt(void 0),MC=nt(0),dX=2.5*60*1e3,hX=()=>{const e=it(V0),t=it(q0),n=it(MC);return r=>{e(r.playerDrop),t(r.svRuntime),n(Date.now())}},fX=()=>{const e=it(G0);return w.useCallback(Jn(150,e,{noLeading:!1,noTrailing:!1}),[e])},pX=()=>{const e=it(V0);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}})}},AC=()=>{const e=ct(MC);return()=>{const t=Date.now();return{isExpired:t-e>dX,isStale:t-e>60*1e3,age:t-e}}},jC=nt([]),K0=nt(e=>e(jC).length),Z7=nt(null),mX=()=>{const e=pX(),t=it(jC),n=it(Z7);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)}},eL=nt(0),Y0=()=>{const e=it(eL);return()=>e(Math.random())},tL=nt(!1),hv="txAdmin",fh=document.getElementById("favicon"),nL=nt(hv),rL=()=>{const e=it(nL);return t=>{t?e(t):(e(hv),document.title=hv,fh.href=Y7)}},gX=K7((e,t)=>{if(!window.txConsts.isWebInterface)return;const n=e(nL),r=e(jl),i=e(K0);r?(r.server.status==="ONLINE"?fh.href=aX:r.server.status==="PARTIAL"?fh.href=lX:fh.href=cX,document.title=`(${i}) ${r.server.name} · ${n}`):(fh.href=Y7,document.title=hv)}),vX=150,eT=Jn(vX,e=>{console.log("sending hotkey event",e),window.postMessage({type:"globalHotkey",action:e})},{noTrailing:!0});function DC(e){return e.code==="KeyK"&&e.ctrlKey?(eT("focusPlayerlistFilter"),!0):e.code==="KeyL"&&e.ctrlKey&&e.shiftKey&&window.txConsts.showAdvanced?(eT("toggleLightMode"),!0):!1}function iL(e){DC(e)&&e.preventDefault()}function Ui({legacyUrl:e}){const t=w.useRef(null),n=location.search??"",r=location.hash??"";return w.useEffect(()=>{var i;t.current&&((i=t.current.contentWindow)==null||i.addEventListener("keydown",iL))},[]),u.jsx("iframe",{ref:t,id:"legacyPageIframe",src:`./legacy/${e}${n}${r}`,className:"w-full"})}function Ye({children:e,className:t,...n}){return u.jsx("code",{className:J("rounded-sm font-mono text-muted-foreground bg-muted px-[0.25rem]",t),...n,children:e})}function yX({params:e}){return rL()("Not Found"),u.jsx("div",{className:"w-full flex items-center justify-center",children:u.jsxs("div",{className:"text-center",children:[u.jsx("h1",{className:"bg-fuchsia-600 text-4xl w-fit mx-auto",children:"404 | Not Found"}),u.jsxs("p",{className:"mt-2",children:["The page ",u.jsxs(Ye,{children:["/",e["*"]]})," does not seem to be correct."]}),u.jsx(fs,{href:"/",className:"text-accent hover:underline",children:"Return to Dashboard?"})]})})}var sL={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(globalThis,()=>(()=>{var n={4567:function(a,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=l(9042),f=l(9924),m=l(844),_=l(4725),v=l(2585),y=l(3656);let g=o.AccessibilityManager=class extends m.Disposable{constructor(p,x,b,S){super(),this._terminal=p,this._coreBrowserService=b,this._renderService=S,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;Cthis._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 f.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,y.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,m.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(p){for(let x=0;x0?this._charsToConsume.shift()!==p&&(this._charsToAnnounce+=p):this._charsToAnnounce+=p,p===` `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(p){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(p)||this._charsToConsume.push(p)}_refreshRows(p,x){this._liveRegionDebouncer.refresh(p,x,this._terminal.rows)}_renderRows(p,x){const b=this._terminal.buffer,S=b.lines.length.toString();for(let C=p;C<=x;C++){const E=b.lines.get(b.ydisp+C),k=[],T=(E==null?void 0:E.translateToString(!0,void 0,void 0,k))||"",R=(b.ydisp+C+1).toString(),M=this._rowElements[C];M&&(T.length===0?(M.innerText=" ",this._rowColumns.set(M,[0,1])):(M.textContent=T,this._rowColumns.set(M,k)),M.setAttribute("aria-posinset",R),M.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(p,x){const b=p.target,S=this._rowElements[x===0?1:this._rowElements.length-2];if(b.getAttribute("aria-posinset")===(x===0?"1":`${this._terminal.buffer.lines.length}`)||p.relatedTarget!==S)return;let C,E;if(x===0?(C=b,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(C=this._rowElements.shift(),E=b,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),x===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(x===0?-1:1),this._rowElements[x===0?1:this._rowElements.length-2].focus(),p.preventDefault(),p.stopImmediatePropagation()}_handleSelectionChange(){var T;if(this._rowElements.length===0)return;const p=document.getSelection();if(!p)return;if(p.isCollapsed)return void(this._rowContainer.contains(p.anchorNode)&&this._terminal.clearSelection());if(!p.anchorNode||!p.focusNode)return void console.error("anchorNode and/or focusNode are null");let x={node:p.anchorNode,offset:p.anchorOffset},b={node:p.focusNode,offset:p.focusOffset};if((x.node.compareDocumentPosition(b.node)&Node.DOCUMENT_POSITION_PRECEDING||x.node===b.node&&x.offset>b.offset)&&([x,b]=[b,x]),x.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(x={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(x.node))return;const S=this._rowElements.slice(-1)[0];if(b.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(b={node:S,offset:((T=S.textContent)==null?void 0:T.length)??0}),!this._rowContainer.contains(b.node))return;const C=({node:R,offset:M})=>{const D=R instanceof Text?R.parentNode:R;let N=parseInt(D==null?void 0:D.getAttribute("aria-posinset"),10)-1;if(isNaN(N))return console.warn("row is invalid. Race condition?"),null;const L=this._rowColumns.get(D);if(!L)return console.warn("columns is null. Race condition?"),null;let P=M=this._terminal.cols&&(++N,P=0),{row:N,column:P}},E=C(x),k=C(b);if(E&&k){if(E.row>k.row||E.row===k.row&&E.column>=k.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(k.row-E.row)*this._terminal.cols-E.column+k.column)}}_handleResize(p){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let x=this._rowContainer.children.length;xp;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const p=this._coreBrowserService.mainDocument.createElement("div");return p.setAttribute("role","listitem"),p.tabIndex=-1,this._refreshRowDimensions(p),p}_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 p=0;p{function l(f){return f.replace(/\r?\n/g,"\r")}function c(f,m){return m?"\x1B[200~"+f+"\x1B[201~":f}function h(f,m,_,v){f=c(f=l(f),_.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),_.triggerDataEvent(f,!0),m.value=""}function d(f,m,_){const v=_.getBoundingClientRect(),y=f.clientX-v.left-10,g=f.clientY-v.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${y}px`,m.style.top=`${g}px`,m.style.zIndex="1000",m.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(f,m){f.clipboardData&&f.clipboardData.setData("text/plain",m.selectionText),f.preventDefault()},o.handlePasteEvent=function(f,m,_,v){f.stopPropagation(),f.clipboardData&&h(f.clipboardData.getData("text/plain"),m,_,v)},o.paste=h,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(f,m,_,v,y){d(f,m,_),y&&v.rightClickSelect(f),m.value=v.selectionText,m.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(h,d,f){this._css.set(h,d,f)}getCss(h,d){return this._css.get(h,d)}setColor(h,d,f){this._color.set(h,d,f)}getColor(h,d){return this._color.get(h,d)}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,h,d){l.addEventListener(c,h,d);let f=!1;return{dispose:()=>{f||(f=!0,l.removeEventListener(c,h,d))}}}},3551:function(a,o,l){var c=this&&this.__decorate||function(g,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,p,x,b);else for(var k=g.length-1;k>=0;k--)(S=g[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(g,p){return function(x,b){p(x,b,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=l(3656),f=l(8460),m=l(844),_=l(2585),v=l(4725);let y=o.Linkifier=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(g,p,x,b,S){super(),this._element=g,this._mouseService=p,this._renderService=x,this._bufferService=b,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new f.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new f.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{var C;this._lastMouseEvent=void 0,(C=this._activeProviderReplies)==null||C.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(g){this._lastMouseEvent=g;const p=this._positionFromMouseEvent(g,this._element,this._mouseService);if(!p)return;this._isMouseOut=!1;const x=g.composedPath();for(let b=0;b{C==null||C.forEach(E=>{E.link.dispose&&E.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=g.y);let x=!1;for(const[C,E]of this._linkProviderService.linkProviders.entries())p?(S=this._activeProviderReplies)!=null&&S.get(C)&&(x=this._checkLinkProviderResult(C,g,x)):E.provideLinks(g.y,k=>{var R,M;if(this._isMouseOut)return;const T=k==null?void 0:k.map(D=>({link:D}));(R=this._activeProviderReplies)==null||R.set(C,T),x=this._checkLinkProviderResult(C,g,x),((M=this._activeProviderReplies)==null?void 0:M.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(g.y,this._activeProviderReplies)})}_removeIntersectingLinks(g,p){const x=new Set;for(let b=0;bg?this._bufferService.cols:E.link.range.end.x;for(let R=k;R<=T;R++){if(x.has(R)){S.splice(C--,1);break}x.add(R)}}}}_checkLinkProviderResult(g,p,x){var C;if(!this._activeProviderReplies)return x;const b=this._activeProviderReplies.get(g);let S=!1;for(let E=0;Ethis._linkAtPosition(k.link,p));E&&(x=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!x)for(let E=0;Ethis._linkAtPosition(T.link,p));if(k){x=!0,this._handleNewLink(k);break}}return x}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(g){if(!this._currentLink)return;const p=this._positionFromMouseEvent(g,this._element,this._mouseService);p&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,p)&&this._currentLink.link.activate(g,this._currentLink.link.text)}_clearCurrentLink(g,p){this._currentLink&&this._lastMouseEvent&&(!g||!p||this._currentLink.link.range.start.y>=g&&this._currentLink.link.range.end.y<=p)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(g){if(!this._lastMouseEvent)return;const p=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);p&&this._linkAtPosition(g.link,p)&&(this._currentLink=g,this._currentLink.state={decorations:{underline:g.link.decorations===void 0||g.link.decorations.underline,pointerCursor:g.link.decorations===void 0||g.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,g.link,this._lastMouseEvent),g.link.decorations={},Object.defineProperties(g.link.decorations,{pointerCursor:{get:()=>{var x,b;return(b=(x=this._currentLink)==null?void 0:x.state)==null?void 0:b.decorations.pointerCursor},set:x=>{var b;(b=this._currentLink)!=null&&b.state&&this._currentLink.state.decorations.pointerCursor!==x&&(this._currentLink.state.decorations.pointerCursor=x,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",x))}},underline:{get:()=>{var x,b;return(b=(x=this._currentLink)==null?void 0:x.state)==null?void 0:b.decorations.underline},set:x=>{var b,S,C;(b=this._currentLink)!=null&&b.state&&((C=(S=this._currentLink)==null?void 0:S.state)==null?void 0:C.decorations.underline)!==x&&(this._currentLink.state.decorations.underline=x,this._currentLink.state.isHovered&&this._fireUnderlineEvent(g.link,x))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(x=>{if(!this._currentLink)return;const b=x.start===0?0:x.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+x.end;if(this._currentLink.link.range.start.y>=b&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(b,S),this._lastMouseEvent)){const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._askForLink(C,!1)}})))}_linkHover(g,p,x){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!0),this._currentLink.state.decorations.pointerCursor&&g.classList.add("xterm-cursor-pointer")),p.hover&&p.hover(x,p.text)}_fireUnderlineEvent(g,p){const x=g.range,b=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(x.start.x-1,x.start.y-b-1,x.end.x,x.end.y-b-1,void 0);(p?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(g,p,x){var b;(b=this._currentLink)!=null&&b.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(p,!1),this._currentLink.state.decorations.pointerCursor&&g.classList.remove("xterm-cursor-pointer")),p.leave&&p.leave(x,p.text)}_linkAtPosition(g,p){const x=g.range.start.y*this._bufferService.cols+g.range.start.x,b=g.range.end.y*this._bufferService.cols+g.range.end.x,S=p.y*this._bufferService.cols+p.x;return x<=S&&S<=b}_positionFromMouseEvent(g,p,x){const b=x.getCoords(g,p,this._bufferService.cols,this._bufferService.rows);if(b)return{x:b[0],y:b[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(g,p,x,b,S){return{x1:g,y1:p,x2:x,y2:b,cols:this._bufferService.cols,fg:S}}};o.Linkifier=y=c([h(1,v.IMouseService),h(2,v.IRenderService),h(3,_.IBufferService),h(4,v.ILinkProviderService)],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(v,y,g,p){var x,b=arguments.length,S=b<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,g):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,y,g,p);else for(var C=v.length-1;C>=0;C--)(x=v[C])&&(S=(b<3?x(S):b>3?x(y,g,S):x(y,g))||S);return b>3&&S&&Object.defineProperty(y,g,S),S},h=this&&this.__param||function(v,y){return function(g,p){y(g,p,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=l(511),f=l(2585);let m=o.OscLinkProvider=class{constructor(v,y,g){this._bufferService=v,this._optionsService=y,this._oscLinkService=g}provideLinks(v,y){var T;const g=this._bufferService.buffer.lines.get(v-1);if(!g)return void y(void 0);const p=[],x=this._optionsService.rawOptions.linkHandler,b=new d.CellData,S=g.getTrimmedLength();let C=-1,E=-1,k=!1;for(let R=0;Rx?x.activate(L,P,D):_(0,P),hover:(L,P)=>{var I;return(I=x==null?void 0:x.hover)==null?void 0:I.call(x,L,P,D)},leave:(L,P)=>{var I;return(I=x==null?void 0:x.leave)==null?void 0:I.call(x,L,P,D)}})}k=!1,b.hasExtendedAttrs()&&b.extended.urlId?(E=R,C=b.extended.urlId):(E=-1,C=-1)}}y(p)}};function _(v,y){if(confirm(`Do you want to navigate to ${y}? WARNING: This link could potentially be dangerous`)){const g=window.open();if(g){try{g.opener=null}catch{}g.location.href=y}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=m=c([h(0,f.IBufferService),h(1,f.IOptionsService),h(2,f.IOscLinkService)],m)},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,h){this._rowCount=h,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),h=l(3656),d=l(3551),f=l(9042),m=l(3730),_=l(1680),v=l(3107),y=l(5744),g=l(2950),p=l(1296),x=l(428),b=l(4269),S=l(5114),C=l(8934),E=l(3230),k=l(9312),T=l(4725),R=l(6731),M=l(8055),D=l(8969),N=l(8460),L=l(844),P=l(6114),I=l(8437),z=l(2584),O=l(7399),A=l(5941),j=l(9074),F=l(2585),H=l(5435),B=l(4567),G=l(779);class Z extends D.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=P,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new L.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(j.DecorationService),this._instantiationService.setService(F.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(G.LinkProviderService),this._instantiationService.setService(T.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows(($,V)=>this.refresh($,V))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport($=>this._reportWindowsOptions($))),this.register(this._inputHandler.onColor($=>this._handleColorEvent($))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize($=>this._afterResize($.cols,$.rows))),this.register((0,L.toDisposable)(()=>{var $,V;this._customKeyEventHandler=void 0,(V=($=this.element)==null?void 0:$.parentNode)==null||V.removeChild(this.element)}))}_handleColorEvent(W){if(this._themeService)for(const $ of W){let V,U="";switch($.index){case 256:V="foreground",U="10";break;case 257:V="background",U="11";break;case 258:V="cursor",U="12";break;default:V="ansi",U="4;"+$.index}switch($.type){case 0:const Q=M.color.toColorRGB(V==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[V]);this.coreService.triggerDataEvent(`${z.C0.ESC}]${U};${(0,A.toRgbString)(Q)}${z.C1_ESCAPED.ST}`);break;case 1:if(V==="ansi")this._themeService.modifyColors(q=>q.ansi[$.index]=M.channels.toColor(...$.color));else{const q=V;this._themeService.modifyColors(ie=>ie[q]=M.channels.toColor(...$.color))}break;case 2:this._themeService.restoreColor($.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(z.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(z.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,$=this.buffer.lines.get(W);if(!$)return;const V=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,Q=$.getWidth(V),q=this._renderService.dimensions.css.cell.width*Q,ie=this.buffer.y*this._renderService.dimensions.css.cell.height,re=V*this._renderService.dimensions.css.cell.width;this.textarea.style.left=re+"px",this.textarea.style.top=ie+"px",this.textarea.style.width=q+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,h.addDisposableDomListener)(this.element,"copy",$=>{this.hasSelection()&&(0,c.copyHandler)($,this._selectionService)}));const W=$=>(0,c.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,h.addDisposableDomListener)(this.textarea,"paste",W)),this.register((0,h.addDisposableDomListener)(this.element,"paste",W)),P.isFirefox?this.register((0,h.addDisposableDomListener)(this.element,"mousedown",$=>{$.button===2&&(0,c.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,h.addDisposableDomListener)(this.element,"contextmenu",$=>{(0,c.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),P.isLinux&&this.register((0,h.addDisposableDomListener)(this.element,"auxclick",$=>{$.button===1&&(0,c.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,h.addDisposableDomListener)(this.textarea,"keyup",W=>this._keyUp(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keydown",W=>this._keyDown(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"keypress",W=>this._keyPress(W),!0)),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionupdate",W=>this._compositionHelper.compositionupdate(W))),this.register((0,h.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,h.addDisposableDomListener)(this.textarea,"input",W=>this._inputEvent(W),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(W){var V;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"),((V=this.element)==null?void 0:V.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 $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.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,h.addDisposableDomListener)(this.screenElement,"mousemove",U=>this.updateCursorStyle(U))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",f.promptLabel),P.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(S.CoreBrowserService,this.textarea,W.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,h.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,h.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(x.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(b.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(g.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(_.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.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(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,h.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,h.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(y.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(p.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const W=this,$=this.element;function V(q){const ie=W._mouseService.getMouseReportCoords(q,W.screenElement);if(!ie)return!1;let re,ce;switch(q.overrideType||q.type){case"mousemove":ce=32,q.buttons===void 0?(re=3,q.button!==void 0&&(re=q.button<3?q.button:3)):re=1&q.buttons?0:4&q.buttons?1:2&q.buttons?2:3;break;case"mouseup":ce=0,re=q.button<3?q.button:3;break;case"mousedown":ce=1,re=q.button<3?q.button:3;break;case"wheel":if(W._customWheelEventHandler&&W._customWheelEventHandler(q)===!1||W.viewport.getLinesScrolled(q)===0)return!1;ce=q.deltaY<0?0:1,re=4;break;default:return!1}return!(ce===void 0||re===void 0||re>4)&&W.coreMouseService.triggerMouseEvent({col:ie.col,row:ie.row,x:ie.x,y:ie.y,button:re,action:ce,ctrl:q.ctrlKey,alt:q.altKey,shift:q.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:q=>(V(q),q.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(q)),wheel:q=>(V(q),this.cancel(q,!0)),mousedrag:q=>{q.buttons&&V(q)},mousemove:q=>{q.buttons||V(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?U.mousemove||($.addEventListener("mousemove",Q.mousemove),U.mousemove=Q.mousemove):($.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&q?U.wheel||($.addEventListener("wheel",Q.wheel,{passive:!1}),U.wheel=Q.wheel):($.removeEventListener("wheel",U.wheel),U.wheel=null),2&q?U.mouseup||(U.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&q?U.mousedrag||(U.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,h.addDisposableDomListener)($,"mousedown",q=>{if(q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(q))return V(q),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(q)})),this.register((0,h.addDisposableDomListener)($,"wheel",q=>{if(!U.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(q)===!1)return!1;if(!this.buffer.hasScrollback){const ie=this.viewport.getLinesScrolled(q);if(ie===0)return;const re=z.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(q.deltaY<0?"A":"B");let ce="";for(let ye=0;ye{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(q),this.cancel(q)},{passive:!0})),this.register((0,h.addDisposableDomListener)($,"touchmove",q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(q)?void 0:this.cancel(q)},{passive:!1}))}refresh(W,$){var V;(V=this._renderService)==null||V.refreshRows(W,$)}updateCursorStyle(W){var $;($=this._selectionService)!=null&&$.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,$,V=0){var U;V===1?(super.scrollLines(W,$,V),this.refresh(0,this.rows-1)):(U=this.viewport)==null||U.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._linkProviderService.registerLinkProvider(W)}registerCharacterJoiner(W){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(W);return this.refresh(0,this.rows-1),$}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,$,V){this._selectionService.setSelection(W,$,V)}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,$){var V;(V=this._selectionService)==null||V.selectLines(W,$)}_keyDown(W){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&W.altKey;if(!$&&!this._compositionHelper.keydown(W))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||W.key!=="Dead"&&W.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const V=(0,O.evaluateKeyboardEvent)(W,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(W),V.type===3||V.type===2){const U=this.rows-1;return this.scrollLines(V.type===2?-U:U),this.cancel(W,!0)}return V.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,W)||(V.cancel&&this.cancel(W,!0),!V.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):(V.key!==z.C0.ETX&&V.key!==z.C0.CR||(this.textarea.value=""),this._onKey.fire({key:V.key,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent(V.key,!0),!this.optionsService.rawOptions.screenReaderMode||W.altKey||W.ctrlKey?this.cancel(W,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(W,$){const V=W.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||W.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||W.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?V:V&&(!$.keyCode||$.keyCode>47)}_keyUp(W){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1||(function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18}(W)||this.focus(),this.updateCursorStyle(W),this._keyPressHandled=!1)}_keyPress(W){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(W)===!1)return!1;if(this.cancel(W),W.charCode)$=W.charCode;else if(W.which===null||W.which===void 0)$=W.keyCode;else{if(W.which===0||W.charCode===0)return!1;$=W.which}return!(!$||(W.altKey||W.ctrlKey||W.metaKey)&&!this._isThirdLevelShift(this.browser,W)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:W}),this._showCursor(),this.coreService.triggerDataEvent($,!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 $=W.data;return this.coreService.triggerDataEvent($,!0),this.cancel(W),!0}return!1}resize(W,$){W!==this.cols||$!==this.rows?super.resize(W,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(W,$){var V,U;(V=this._charSizeService)==null||V.measure(),(U=this.viewport)==null||U.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 $=1;${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,h){this._rowCount=h,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 d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const f=d-this._lastRefreshMs,m=this._debounceThresholdMS-f;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_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(g,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,p,x,b);else for(var k=g.length-1;k>=0;k--)(S=g[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(g,p){return function(x,b){p(x,b,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=l(3656),f=l(4725),m=l(8460),_=l(844),v=l(2585);let y=o.Viewport=class extends _.Disposable{constructor(g,p,x,b,S,C,E,k){super(),this._viewportElement=g,this._scrollArea=p,this._bufferService=x,this._optionsService=b,this._charSizeService=S,this._renderService=C,this._coreBrowserService=E,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 m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(T=>this._activeBuffer=T.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(T=>this._renderDimensions=T)),this._handleThemeChange(k.colors),this.register(k.onChangeColors(T=>this._handleThemeChange(T))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(g){this._viewportElement.style.backgroundColor=g.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(g){if(g)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 p=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==p&&(this._lastRecordedBufferHeight=p,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const g=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==g&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=g),this._refreshAnimationFrame=null}syncScrollArea(g=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(g);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(g)}_handleScroll(g){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 p=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:p,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const g=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(g*(this._smoothScrollState.target-this._smoothScrollState.origin)),g<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(g,p){const x=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(p<0&&this._viewportElement.scrollTop!==0||p>0&&x0&&(x=D),b=""}}return{bufferElements:S,cursorElement:x}}getLinesScrolled(g){if(g.deltaY===0||g.shiftKey)return 0;let p=this._applyScrollModifier(g.deltaY,g);return g.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(p/=this._currentRowHeight+0,this._wheelPartialScroll+=p,p=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):g.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(p*=this._bufferService.rows),p}_applyScrollModifier(g,p){const x=this._optionsService.rawOptions.fastScrollModifier;return x==="alt"&&p.altKey||x==="ctrl"&&p.ctrlKey||x==="shift"&&p.shiftKey?g*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:g*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(g){this._lastTouchY=g.touches[0].pageY}handleTouchMove(g){const p=this._lastTouchY-g.touches[0].pageY;return this._lastTouchY=g.touches[0].pageY,p!==0&&(this._viewportElement.scrollTop+=p,this._bubbleScroll(g,p))}};o.Viewport=y=c([h(2,v.IBufferService),h(3,v.IOptionsService),h(4,f.ICharSizeService),h(5,f.IRenderService),h(6,f.ICoreBrowserService),h(7,f.IThemeService)],y)},3107:function(a,o,l){var c=this&&this.__decorate||function(v,y,g,p){var x,b=arguments.length,S=b<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,g):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,y,g,p);else for(var C=v.length-1;C>=0;C--)(x=v[C])&&(S=(b<3?x(S):b>3?x(y,g,S):x(y,g))||S);return b>3&&S&&Object.defineProperty(y,g,S),S},h=this&&this.__param||function(v,y){return function(g,p){y(g,p,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=l(4725),f=l(844),m=l(2585);let _=o.BufferDecorationRenderer=class extends f.Disposable{constructor(v,y,g,p,x){super(),this._screenElement=v,this._bufferService=y,this._coreBrowserService=g,this._decorationService=p,this._renderService=x,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(b=>this._removeDecoration(b))),this.register((0,f.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 v of this._decorationService.decorations)this._renderDecoration(v);this._dimensionsChanged=!1}_renderDecoration(v){this._refreshStyle(v),this._dimensionsChanged&&this._refreshXPosition(v)}_createElement(v){var p;const y=this._coreBrowserService.mainDocument.createElement("div");y.classList.add("xterm-decoration"),y.classList.toggle("xterm-decoration-top-layer",((p=v==null?void 0:v.options)==null?void 0:p.layer)==="top"),y.style.width=`${Math.round((v.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,y.style.height=(v.options.height||1)*this._renderService.dimensions.css.cell.height+"px",y.style.top=(v.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",y.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const g=v.options.x??0;return g&&g>this._bufferService.cols&&(y.style.display="none"),this._refreshXPosition(v,y),y}_refreshStyle(v){const y=v.marker.line-this._bufferService.buffers.active.ydisp;if(y<0||y>=this._bufferService.rows)v.element&&(v.element.style.display="none",v.onRenderEmitter.fire(v.element));else{let g=this._decorationElements.get(v);g||(g=this._createElement(v),v.element=g,this._decorationElements.set(v,g),this._container.appendChild(g),v.onDispose(()=>{this._decorationElements.delete(v),g.remove()})),g.style.top=y*this._renderService.dimensions.css.cell.height+"px",g.style.display=this._altBufferIsActive?"none":"block",v.onRenderEmitter.fire(g)}}_refreshXPosition(v,y=v.element){if(!y)return;const g=v.options.x??0;(v.options.anchor||"left")==="right"?y.style.right=g?g*this._renderService.dimensions.css.cell.width+"px":"":y.style.left=g?g*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(v){var y;(y=this._decorationElements.get(v))==null||y.remove(),this._decorationElements.delete(v),v.dispose()}};o.BufferDecorationRenderer=_=c([h(1,m.IBufferService),h(2,d.ICoreBrowserService),h(3,m.IDecorationService),h(4,d.IRenderService)],_)},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=l.startBufferLine&&c<=l.endBufferLine}_lineAdjacentToZone(l,c,h){return c>=l.startBufferLine-this._linePadding[h||"full"]&&c<=l.endBufferLine+this._linePadding[h||"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(x,b,S,C){var E,k=arguments.length,T=k<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,S,C);else for(var R=x.length-1;R>=0;R--)(E=x[R])&&(T=(k<3?E(T):k>3?E(b,S,T):E(b,S))||T);return k>3&&T&&Object.defineProperty(b,S,T),T},h=this&&this.__param||function(x,b){return function(S,C){b(S,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=l(5871),f=l(4725),m=l(844),_=l(2585),v={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0};let p=o.OverviewRulerRenderer=class extends m.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(x,b,S,C,E,k,T){var M;super(),this._viewportElement=x,this._screenElement=b,this._bufferService=S,this._decorationService=C,this._renderService=E,this._optionsService=k,this._coreBrowserService=T,this._colorZoneStore=new d.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 R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,m.toDisposable)(()=>{var D;(D=this._canvas)==null||D.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 x=Math.floor(this._canvas.width/3),b=Math.ceil(this._canvas.width/3);y.full=this._canvas.width,y.left=x,y.center=b,y.right=x,this._refreshDrawHeightConstants(),g.full=0,g.left=0,g.center=y.left,g.right=y.left+y.center}_refreshDrawHeightConstants(){v.full=Math.round(2*this._coreBrowserService.dpr);const x=this._canvas.height/this._bufferService.buffer.lines.length,b=Math.round(Math.max(Math.min(x,12),6)*this._coreBrowserService.dpr);v.left=b,v.center=b,v.right=b}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*v.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 b of this._decorationService.decorations)this._colorZoneStore.addDecoration(b);this._ctx.lineWidth=1;const x=this._colorZoneStore.zones;for(const b of x)b.position!=="full"&&this._renderColorZone(b);for(const b of x)b.position==="full"&&this._renderColorZone(b);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(x){this._ctx.fillStyle=x.color,this._ctx.fillRect(g[x.position||"full"],Math.round((this._canvas.height-1)*(x.startBufferLine/this._bufferService.buffers.active.lines.length)-v[x.position||"full"]/2),y[x.position||"full"],Math.round((this._canvas.height-1)*((x.endBufferLine-x.startBufferLine)/this._bufferService.buffers.active.lines.length)+v[x.position||"full"]))}_queueRefresh(x,b){this._shouldUpdateDimensions=x||this._shouldUpdateDimensions,this._shouldUpdateAnchor=b||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=p=c([h(2,_.IBufferService),h(3,_.IDecorationService),h(4,f.IRenderService),h(5,_.IOptionsService),h(6,f.ICoreBrowserService)],p)},2950:function(a,o,l){var c=this&&this.__decorate||function(v,y,g,p){var x,b=arguments.length,S=b<3?y:p===null?p=Object.getOwnPropertyDescriptor(y,g):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(v,y,g,p);else for(var C=v.length-1;C>=0;C--)(x=v[C])&&(S=(b<3?x(S):b>3?x(y,g,S):x(y,g))||S);return b>3&&S&&Object.defineProperty(y,g,S),S},h=this&&this.__param||function(v,y){return function(g,p){y(g,p,v)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=l(4725),f=l(2585),m=l(2584);let _=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,y,g,p,x,b){this._textarea=v,this._compositionView=y,this._bufferService=g,this._optionsService=p,this._coreService=x,this._renderService=b,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(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const y={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let g;this._isSendingComposition=!1,y.start+=this._dataAlreadySent.length,g=this._isComposing?this._textarea.value.substring(y.start,y.end):this._textarea.value.substring(y.start),g.length>0&&this._coreService.triggerDataEvent(g,!0)}},0)}else{this._isSendingComposition=!1;const y=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(y,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const y=this._textarea.value,g=y.replace(v,"");this._dataAlreadySent=g,y.length>v.length?this._coreService.triggerDataEvent(g,!0):y.lengththis.updateCompositionElements(!0),0)}}};o.CompositionHelper=_=c([h(2,f.IBufferService),h(3,f.IOptionsService),h(4,f.ICoreService),h(5,d.IRenderService)],_)},9806:(a,o)=>{function l(c,h,d){const f=d.getBoundingClientRect(),m=c.getComputedStyle(d),_=parseInt(m.getPropertyValue("padding-left")),v=parseInt(m.getPropertyValue("padding-top"));return[h.clientX-f.left-_,h.clientY-f.top-v]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=l,o.getCoords=function(c,h,d,f,m,_,v,y,g){if(!_)return;const p=l(c,h,d);return p?(p[0]=Math.ceil((p[0]+(g?v/2:0))/v),p[1]=Math.ceil(p[1]/y),p[0]=Math.min(Math.max(p[0],1),f+(g?1:0)),p[1]=Math.min(Math.max(p[1],1),m),p):void 0}},9504:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const c=l(2584);function h(y,g,p,x){const b=y-d(y,p),S=g-d(g,p),C=Math.abs(b-S)-function(E,k,T){let R=0;const M=E-d(E,T),D=k-d(k,T);for(let N=0;N=0&&yg?"A":"B"}function m(y,g,p,x,b,S){let C=y,E=g,k="";for(;C!==p||E!==x;)C+=b?1:-1,b&&C>S.cols-1?(k+=S.buffer.translateBufferLineToString(E,!1,y,C),C=0,y=0,E++):!b&&C<0&&(k+=S.buffer.translateBufferLineToString(E,!1,0,y+1),C=S.cols-1,y=C,E--);return k+S.buffer.translateBufferLineToString(E,!1,y,C)}function _(y,g){const p=g?"O":"[";return c.C0.ESC+p+y}function v(y,g){y=Math.floor(y);let p="";for(let x=0;x0?M-d(M,D):T;const P=M,I=function(z,O,A,j,F,H){let B;return B=h(A,j,F,H).length>0?j-d(j,F):O,z=A&&By?"D":"C",v(Math.abs(b-y),_(C,x));C=S>g?"D":"C";const E=Math.abs(S-g);return v(function(k,T){return T.cols-k}(S>g?y:b,p)+(E-1)*p.cols+1+((S>g?b:y)-1),_(C,x))}},1296:function(a,o,l){var c=this&&this.__decorate||function(N,L,P,I){var z,O=arguments.length,A=O<3?L:I===null?I=Object.getOwnPropertyDescriptor(L,P):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(N,L,P,I);else for(var j=N.length-1;j>=0;j--)(z=N[j])&&(A=(O<3?z(A):O>3?z(L,P,A):z(L,P))||A);return O>3&&A&&Object.defineProperty(L,P,A),A},h=this&&this.__param||function(N,L){return function(P,I){L(P,I,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=l(3787),f=l(2550),m=l(2223),_=l(6171),v=l(6052),y=l(4725),g=l(8055),p=l(8460),x=l(844),b=l(2585),S="xterm-dom-renderer-owner-",C="xterm-rows",E="xterm-fg-",k="xterm-bg-",T="xterm-focus",R="xterm-selection";let M=1,D=o.DomRenderer=class extends x.Disposable{constructor(N,L,P,I,z,O,A,j,F,H,B,G,Z){super(),this._terminal=N,this._document=L,this._element=P,this._screenElement=I,this._viewportElement=z,this._helperContainer=O,this._linkifier2=A,this._charSizeService=F,this._optionsService=H,this._bufferService=B,this._coreBrowserService=G,this._themeService=Z,this._terminalClass=M++,this._rowElements=[],this._selectionRenderModel=(0,v.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new p.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(R),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,_.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(X=>this._injectCss(X))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(X=>this._handleLinkHover(X))),this.register(this._linkifier2.onHideLinkUnderline(X=>this._handleLinkLeave(X))),this.register((0,x.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new f.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const P of this._rowElements)P.style.width=`${this.dimensions.css.canvas.width}px`,P.style.height=`${this.dimensions.css.cell.height}px`,P.style.lineHeight=`${this.dimensions.css.cell.height}px`,P.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const L=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=L,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let L=`${this._terminalSelector} .${C} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;L+=`${this._terminalSelector} .${C} .xterm-dim { color: ${g.color.multiplyOpacity(N.foreground,.5).css};}`,L+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const P=`blink_underline_${this._terminalClass}`,I=`blink_bar_${this._terminalClass}`,z=`blink_block_${this._terminalClass}`;L+=`@keyframes ${P} { 50% { border-bottom-style: hidden; }}`,L+=`@keyframes ${I} { 50% { box-shadow: none; }}`,L+=`@keyframes ${z} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,L+=`${this._terminalSelector} .${C}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${C}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${I} 1s step-end infinite;}${this._terminalSelector} .${C}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${z} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,L+=`${this._terminalSelector} .${R} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${R} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${R} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[O,A]of N.ansi.entries())L+=`${this._terminalSelector} .${E}${O} { color: ${A.css}; }${this._terminalSelector} .${E}${O}.xterm-dim { color: ${g.color.multiplyOpacity(A,.5).css}; }${this._terminalSelector} .${k}${O} { background-color: ${A.css}; }`;L+=`${this._terminalSelector} .${E}${m.INVERTED_DEFAULT_COLOR} { color: ${g.color.opaque(N.background).css}; }${this._terminalSelector} .${E}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${g.color.multiplyOpacity(g.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${k}${m.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=L}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,L){for(let P=this._rowElements.length;P<=L;P++){const I=this._document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>L;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,L){this._refreshRowElements(N,L),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(T),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,L,P){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,L,P),this.renderRows(0,this._bufferService.rows-1),!N||!L)return;this._selectionRenderModel.update(this._terminal,N,L,P);const I=this._selectionRenderModel.viewportStartRow,z=this._selectionRenderModel.viewportEndRow,O=this._selectionRenderModel.viewportCappedStartRow,A=this._selectionRenderModel.viewportCappedEndRow;if(O>=this._bufferService.rows||A<0)return;const j=this._document.createDocumentFragment();if(P){const F=N[0]>L[0];j.appendChild(this._createSelectionElement(O,F?L[0]:N[0],F?N[0]:L[0],A-O+1))}else{const F=I===O?N[0]:0,H=O===z?L[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(O,F,H));const B=A-O-1;if(j.appendChild(this._createSelectionElement(O+1,0,this._bufferService.cols,B)),O!==A){const G=z===A?L[0]:this._bufferService.cols;j.appendChild(this._createSelectionElement(A,0,G))}}this._selectionContainer.appendChild(j)}_createSelectionElement(N,L,P,I=1){const z=this._document.createElement("div"),O=L*this.dimensions.css.cell.width;let A=this.dimensions.css.cell.width*(P-L);return O+A>this.dimensions.css.canvas.width&&(A=this.dimensions.css.canvas.width-O),z.style.height=I*this.dimensions.css.cell.height+"px",z.style.top=N*this.dimensions.css.cell.height+"px",z.style.left=`${O}px`,z.style.width=`${A}px`,z}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const N of this._rowElements)N.replaceChildren()}renderRows(N,L){const P=this._bufferService.buffer,I=P.ybase+P.y,z=Math.min(P.x,this._bufferService.cols-1),O=this._optionsService.rawOptions.cursorBlink,A=this._optionsService.rawOptions.cursorStyle,j=this._optionsService.rawOptions.cursorInactiveStyle;for(let F=N;F<=L;F++){const H=F+P.ydisp,B=this._rowElements[F],G=P.lines.get(H);if(!B||!G)break;B.replaceChildren(...this._rowFactory.createRow(G,H,H===I,A,j,z,O,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,L,P,I,z,O){P<0&&(N=0),I<0&&(L=0);const A=this._bufferService.rows-1;P=Math.max(Math.min(P,A),0),I=Math.max(Math.min(I,A),0),z=Math.min(z,this._bufferService.cols);const j=this._bufferService.buffer,F=j.ybase+j.y,H=Math.min(j.x,z-1),B=this._optionsService.rawOptions.cursorBlink,G=this._optionsService.rawOptions.cursorStyle,Z=this._optionsService.rawOptions.cursorInactiveStyle;for(let X=P;X<=I;++X){const W=X+j.ydisp,$=this._rowElements[X],V=j.lines.get(W);if(!$||!V)break;$.replaceChildren(...this._rowFactory.createRow(V,W,W===F,G,Z,H,B,this.dimensions.css.cell.width,this._widthCache,O?X===P?N:0:-1,O?(X===I?L:z)-1:-1))}}};o.DomRenderer=D=c([h(7,b.IInstantiationService),h(8,y.ICharSizeService),h(9,b.IOptionsService),h(10,b.IBufferService),h(11,y.ICoreBrowserService),h(12,y.IThemeService)],D)},3787:function(a,o,l){var c=this&&this.__decorate||function(C,E,k,T){var R,M=arguments.length,D=M<3?E:T===null?T=Object.getOwnPropertyDescriptor(E,k):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(C,E,k,T);else for(var N=C.length-1;N>=0;N--)(R=C[N])&&(D=(M<3?R(D):M>3?R(E,k,D):R(E,k))||D);return M>3&&D&&Object.defineProperty(E,k,D),D},h=this&&this.__param||function(C,E){return function(k,T){E(k,T,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=l(2223),f=l(643),m=l(511),_=l(2585),v=l(8055),y=l(4725),g=l(4269),p=l(6171),x=l(3734);let b=o.DomRendererRowFactory=class{constructor(C,E,k,T,R,M,D){this._document=C,this._characterJoinerService=E,this._optionsService=k,this._coreBrowserService=T,this._coreService=R,this._decorationService=M,this._themeService=D,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,E,k){this._selectionStart=C,this._selectionEnd=E,this._columnSelectMode=k}createRow(C,E,k,T,R,M,D,N,L,P,I){const z=[],O=this._characterJoinerService.getJoinedCharacters(E),A=this._themeService.colors;let j,F=C.getNoBgTrimmedLength();k&&F0&&ie===O[0][0]){ce=!0;const xe=O.shift();le=new g.JoinedCellData(this._workCell,C.translateToString(!0,xe[0],xe[1]),xe[1]-xe[0]),ye=xe[1]-1,re=le.getWidth()}const Re=this._isCellInSelection(ie,E),Ae=k&&ie===M,_e=q&&ie>=P&&ie<=I;let Ce=!1;this._decorationService.forEachDecorationAtCell(ie,E,void 0,xe=>{Ce=!0});let oe=le.getChars()||f.WHITESPACE_CELL_CHAR;if(oe===" "&&(le.isUnderline()||le.isOverline())&&(oe=" "),U=re*N-L.get(oe,le.isBold(),le.isItalic()),j){if(H&&(Re&&V||!Re&&!V&&le.bg===G)&&(Re&&V&&A.selectionForeground||le.fg===Z)&&le.extended.ext===X&&_e===W&&U===$&&!Ae&&!ce&&!Ce){le.isInvisible()?B+=f.WHITESPACE_CELL_CHAR:B+=oe,H++;continue}H&&(j.textContent=B),j=this._document.createElement("span"),H=0,B=""}else j=this._document.createElement("span");if(G=le.bg,Z=le.fg,X=le.extended.ext,W=_e,$=U,V=Re,ce&&M>=ie&&M<=ye&&(M=ie),!this._coreService.isCursorHidden&&Ae&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)D&&Q.push("xterm-cursor-blink"),Q.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){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(le.isBold()&&Q.push("xterm-bold"),le.isItalic()&&Q.push("xterm-italic"),le.isDim()&&Q.push("xterm-dim"),B=le.isInvisible()?f.WHITESPACE_CELL_CHAR:le.getChars()||f.WHITESPACE_CELL_CHAR,le.isUnderline()&&(Q.push(`xterm-underline-${le.extended.underlineStyle}`),B===" "&&(B=" "),!le.isUnderlineColorDefault()))if(le.isUnderlineColorRGB())j.style.textDecorationColor=`rgb(${x.AttributeData.toColorRGB(le.getUnderlineColor()).join(",")})`;else{let xe=le.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&le.isBold()&&xe<8&&(xe+=8),j.style.textDecorationColor=A.ansi[xe].css}le.isOverline()&&(Q.push("xterm-overline"),B===" "&&(B=" ")),le.isStrikethrough()&&Q.push("xterm-strikethrough"),_e&&(j.style.textDecoration="underline");let te=le.getFgColor(),se=le.getFgColorMode(),ue=le.getBgColor(),Y=le.getBgColorMode();const ne=!!le.isInverse();if(ne){const xe=te;te=ue,ue=xe;const Ue=se;se=Y,Y=Ue}let ae,he,be,ve=!1;switch(this._decorationService.forEachDecorationAtCell(ie,E,void 0,xe=>{xe.options.layer!=="top"&&ve||(xe.backgroundColorRGB&&(Y=50331648,ue=xe.backgroundColorRGB.rgba>>8&16777215,ae=xe.backgroundColorRGB),xe.foregroundColorRGB&&(se=50331648,te=xe.foregroundColorRGB.rgba>>8&16777215,he=xe.foregroundColorRGB),ve=xe.options.layer==="top")}),!ve&&Re&&(ae=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,ue=ae.rgba>>8&16777215,Y=50331648,ve=!0,A.selectionForeground&&(se=50331648,te=A.selectionForeground.rgba>>8&16777215,he=A.selectionForeground)),ve&&Q.push("xterm-decoration-top"),Y){case 16777216:case 33554432:be=A.ansi[ue],Q.push(`xterm-bg-${ue}`);break;case 50331648:be=v.channels.toColor(ue>>16,ue>>8&255,255&ue),this._addStyle(j,`background-color:#${S((ue>>>0).toString(16),"0",6)}`);break;default:ne?(be=A.foreground,Q.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):be=A.background}switch(ae||le.isDim()&&(ae=v.color.multiplyOpacity(be,.5)),se){case 16777216:case 33554432:le.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(j,be,A.ansi[te],le,ae,void 0)||Q.push(`xterm-fg-${te}`);break;case 50331648:const xe=v.channels.toColor(te>>16&255,te>>8&255,255&te);this._applyMinimumContrast(j,be,xe,le,ae,he)||this._addStyle(j,`color:#${S(te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(j,be,A.foreground,le,ae,he)||ne&&Q.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}Q.length&&(j.className=Q.join(" "),Q.length=0),Ae||ce||Ce?j.textContent=B:H++,U!==this.defaultSpacing&&(j.style.letterSpacing=`${U}px`),z.push(j),ie=ye}return j&&H&&(j.textContent=B),z}_applyMinimumContrast(C,E,k,T,R,M){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,p.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const D=this._getContrastCache(T);let N;if(R||M||(N=D.getColor(E.rgba,k.rgba)),N===void 0){const L=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);N=v.color.ensureContrastRatio(R||E,M||k,L),D.setColor((R||E).rgba,(M||k).rgba,N??null)}return!!N&&(this._addStyle(C,`color:${N.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,E){C.setAttribute("style",`${C.getAttribute("style")||""}${E};`)}_isCellInSelection(C,E){const k=this._selectionStart,T=this._selectionEnd;return!(!k||!T)&&(this._columnSelectMode?k[0]<=T[0]?C>=k[0]&&E>=k[1]&&C=k[1]&&C>=T[0]&&E<=T[1]:E>k[1]&&E=k[0]&&C=k[0])}};function S(C,E,k){for(;C.length{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 h=l.createElement("span");h.classList.add("xterm-char-measure-element");const d=l.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const f=l.createElement("span");f.classList.add("xterm-char-measure-element"),f.style.fontStyle="italic";const m=l.createElement("span");m.classList.add("xterm-char-measure-element"),m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[h,d,f,m],this._container.appendChild(h),this._container.appendChild(d),this._container.appendChild(f),this._container.appendChild(m),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,h,d){l===this._font&&c===this._fontSize&&h===this._weight&&d===this._weightBold||(this._font=l,this._fontSize=c,this._weight=h,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${h}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${h}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(l,c,h){let d=0;if(!c&&!h&&l.length===1&&(d=l.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const _=this._measure(l,0);return _>0&&(this._flat[d]=_),_}let f=l;c&&(f+="B"),h&&(f+="I");let m=this._holey.get(f);if(m===void 0){let _=0;c&&(_|=1),h&&(_|=2),m=this._measure(l,_),m>0&&this._holey.set(f,m)}return m}_measure(l,c){const h=this._measureElements[c];return h.textContent=l.repeat(32),h.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(h){return 57508<=h&&h<=57558}function c(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=c,o.allowRescaling=function(h,d,f,m){return d===1&&f>Math.ceil(1.5*m)&&h!==void 0&&h>255&&!c(h)&&!l(h)&&!function(_){return 57344<=_&&_<=63743}(h)},o.treatGlyphAsBackgroundColor=function(h){return l(h)||function(d){return 9472<=d&&d<=9631}(h)},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(h,d,f=0){return(h-(2*Math.round(d)-f))%(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(h,d,f,m=!1){if(this.selectionStart=d,this.selectionEnd=f,!d||!f||d[0]===f[0]&&d[1]===f[1])return void this.clear();const _=h.buffers.active.ydisp,v=d[1]-_,y=f[1]-_,g=Math.max(v,0),p=Math.min(y,h.rows-1);g>=h.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=v,this.viewportEndRow=y,this.viewportCappedStartRow=g,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=f[0])}isCellSelected(h,d,f){return!!this.hasSelection&&(f-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&f>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f=this.startCol&&d=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(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=l(2585),f=l(8460),m=l(844);let _=o.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(p,x,b){super(),this._optionsService=b,this.width=0,this.height=0,this._onCharSizeChange=this.register(new f.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new g(this._optionsService))}catch{this._measureStrategy=this.register(new y(p,x,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const p=this._measureStrategy.measure();p.width===this.width&&p.height===this.height||(this.width=p.width,this.height=p.height,this._onCharSizeChange.fire())}};o.CharSizeService=_=c([h(2,d.IOptionsService)],_);class v extends m.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(x,b){x!==void 0&&x>0&&b!==void 0&&b>0&&(this._result.width=x,this._result.height=b)}}class y extends v{constructor(x,b,S){super(),this._document=x,this._parentElement=b,this._optionsService=S,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class g extends v{constructor(x){super(),this._optionsService=x,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const b=this._ctx.measureText("W");if(!("width"in b&&"fontBoundingBoxAscent"in b&&"fontBoundingBoxDescent"in b))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const x=this._ctx.measureText("W");return this._validateAndSet(x.width,x.fontBoundingBoxAscent+x.fontBoundingBoxDescent),this._result}}},4269:function(a,o,l){var c=this&&this.__decorate||function(g,p,x,b){var S,C=arguments.length,E=C<3?p:b===null?b=Object.getOwnPropertyDescriptor(p,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(g,p,x,b);else for(var k=g.length-1;k>=0;k--)(S=g[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(g,p){return function(x,b){p(x,b,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(3734),f=l(643),m=l(511),_=l(2585);class v extends d.AttributeData{constructor(p,x,b){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=x,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=v;let y=o.CharacterJoinerService=class oL{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(p){const x={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(x),x.id}deregister(p){for(let x=0;x1){const D=this._getJoinedRanges(S,k,E,x,C);for(let N=0;N1){const M=this._getJoinedRanges(S,k,E,x,C);for(let D=0;D{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const c=l(844),h=l(8460),d=l(3656);class f extends c.Disposable{constructor(v,y,g){super(),this._textarea=v,this._window=y,this.mainDocument=g,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new m(this._window),this._onDprChange=this.register(new h.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new h.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(p=>this._screenDprMonitor.setWindow(p))),this.register((0,h.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(v){this._window!==v&&(this._window=v,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=f;class m extends c.Disposable{constructor(v){super(),this._parentWindow=v,this._windowResizeListener=this.register(new c.MutableDisposable),this._onDprChange=this.register(new h.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(v){this._parentWindow=v,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var v;this._outerListener&&((v=this._resolutionMediaMatchList)==null||v.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const c=l(844);class h extends c.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,c.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(f){return this.linkProviders.push(f),{dispose:()=>{const m=this.linkProviders.indexOf(f);m!==-1&&this.linkProviders.splice(m,1)}}}}o.LinkProviderService=h},8934:function(a,o,l){var c=this&&this.__decorate||function(_,v,y,g){var p,x=arguments.length,b=x<3?v:g===null?g=Object.getOwnPropertyDescriptor(v,y):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(_,v,y,g);else for(var S=_.length-1;S>=0;S--)(p=_[S])&&(b=(x<3?p(b):x>3?p(v,y,b):p(v,y))||b);return x>3&&b&&Object.defineProperty(v,y,b),b},h=this&&this.__param||function(_,v){return function(y,g){v(y,g,_)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=l(4725),f=l(9806);let m=o.MouseService=class{constructor(_,v){this._renderService=_,this._charSizeService=v}getCoords(_,v,y,g,p){return(0,f.getCoords)(window,_,v,y,g,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,p)}getMouseReportCoords(_,v){const y=(0,f.getCoordsRelativeToElement)(window,_,v);if(this._charSizeService.hasValidSize)return y[0]=Math.min(Math.max(y[0],0),this._renderService.dimensions.css.canvas.width-1),y[1]=Math.min(Math.max(y[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(y[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(y[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(y[0]),y:Math.floor(y[1])}}};o.MouseService=m=c([h(0,d.IRenderService),h(1,d.ICharSizeService)],m)},3230:function(a,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=l(6193),f=l(4725),m=l(8460),_=l(844),v=l(7226),y=l(2585);let g=o.RenderService=class extends _.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,x,b,S,C,E,k,T){super(),this._rowCount=p,this._charSizeService=S,this._renderer=this.register(new _.MutableDisposable),this._pausedResizeTask=new v.DebouncedIdleTask,this._observerDisposable=this.register(new _.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 m.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new m.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new m.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new m.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((R,M)=>this._renderRows(R,M),k),this.register(this._renderDebouncer),this.register(k.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(E.onResize(()=>this._fullRefresh())),this.register(E.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)==null?void 0:R.clear()})),this.register(b.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(b.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()})),this.register(b.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(E.buffer.y,E.buffer.y,!0))),this.register(T.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(k.window,x),this.register(k.onWindowChange(R=>this._registerIntersectionObserver(R,x)))}_registerIntersectionObserver(p,x){if("IntersectionObserver"in p){const b=new p.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});b.observe(x),this._observerDisposable.value=(0,_.toDisposable)(()=>b.disconnect())}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,x,b=!1){this._isPaused?this._needsFullRefresh=!0:(b||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,x,this._rowCount))}_renderRows(p,x){this._renderer.value&&(p=Math.min(p,this._rowCount-1),x=Math.min(x,this._rowCount-1),this._renderer.value.renderRows(p,x),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:x}),this._onRender.fire({start:p,end:x}),this._isNextRenderRedrawOnly=!0)}resize(p,x){this._rowCount=x,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(p){this._renderer.value=p,this._renderer.value&&(this._renderer.value.onRequestRedraw(x=>this.refreshRows(x.start,x.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,x;this._renderer.value&&((x=(p=this._renderer.value).clearTextureAtlas)==null||x.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,x){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var b;return(b=this._renderer.value)==null?void 0:b.handleResize(p,x)}):this._renderer.value.handleResize(p,x),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)==null||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)==null||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)==null||p.handleFocus()}handleSelectionChanged(p,x,b){var S;this._selectionState.start=p,this._selectionState.end=x,this._selectionState.columnSelectMode=b,(S=this._renderer.value)==null||S.handleSelectionChanged(p,x,b)}handleCursorMove(){var p;(p=this._renderer.value)==null||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)==null||p.clear()}};o.RenderService=g=c([h(2,y.IOptionsService),h(3,f.ICharSizeService),h(4,y.IDecorationService),h(5,y.IBufferService),h(6,f.ICoreBrowserService),h(7,f.IThemeService)],g)},9312:function(a,o,l){var c=this&&this.__decorate||function(k,T,R,M){var D,N=arguments.length,L=N<3?T:M===null?M=Object.getOwnPropertyDescriptor(T,R):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(k,T,R,M);else for(var P=k.length-1;P>=0;P--)(D=k[P])&&(L=(N<3?D(L):N>3?D(T,R,L):D(T,R))||L);return N>3&&L&&Object.defineProperty(T,R,L),L},h=this&&this.__param||function(k,T){return function(R,M){T(R,M,k)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=l(9806),f=l(9504),m=l(456),_=l(4725),v=l(8460),y=l(844),g=l(6114),p=l(4841),x=l(511),b=l(2585),S=" ",C=new RegExp(S,"g");let E=o.SelectionService=class extends y.Disposable{constructor(k,T,R,M,D,N,L,P,I){super(),this._element=k,this._screenElement=T,this._linkifier=R,this._bufferService=M,this._coreService=D,this._mouseService=N,this._optionsService=L,this._renderService=P,this._coreBrowserService=I,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new x.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=z=>this._handleMouseMove(z),this._mouseUpListener=z=>this._handleMouseUp(z),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(z=>this._handleTrim(z)),this.register(this._bufferService.buffers.onBufferActivate(z=>this._handleBufferActivate(z))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,y.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 k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!k||!T||k[0]===T[0]&&k[1]===T[1])}get selectionText(){const k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!k||!T)return"";const R=this._bufferService.buffer,M=[];if(this._activeSelectionMode===3){if(k[0]===T[0])return"";const D=k[0]D.replace(C," ")).join(g.isWindows?`\r `:` `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),g.isLinux&&k&&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(k){const T=this._getMouseBufferCoords(k),R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!!(R&&M&&T)&&this._areCoordsInSelection(T,R,M)}isCellInSelection(k,T){const R=this._model.finalSelectionStart,M=this._model.finalSelectionEnd;return!(!R||!M)&&this._areCoordsInSelection([k,T],R,M)}_areCoordsInSelection(k,T,R){return k[1]>T[1]&&k[1]=T[0]&&k[0]=T[0]}_selectWordAtCursor(k,T){var D,N;const R=(N=(D=this._linkifier.currentLink)==null?void 0:D.link)==null?void 0:N.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,p.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const M=this._getMouseBufferCoords(k);return!!M&&(this._selectWordAt(M,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,T){this._model.clearSelection(),k=Math.max(k,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const T=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(k){let T=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=R?0:(T>R&&(T-=R),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(k){return g.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const T=this._getMouseBufferCoords(k);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(k){return k.altKey&&!(g.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const T=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const M=(0,f.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(M,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,R=!(!k||!T||k[0]===T[0]&&k[1]===T[1]);R?k&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,T,R)):this._oldHasSelection&&this._fireOnSelectionChange(k,T,R)}_fireOnSelectionChange(k,T,R){this._oldSelectionStart=k,this._oldSelectionEnd=T,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim(T=>this._handleTrim(T))}_convertViewportColToCharacterIndex(k,T){let R=T;for(let M=0;T>=M;M++){const D=k.loadCell(M,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:D>1&&T!==M&&(R+=D-1)}return R}setSelection(k,T,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,T],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,T,R=!0,M=!0){if(k[0]>=this._bufferService.cols)return;const D=this._bufferService.buffer,N=D.lines.get(k[1]);if(!N)return;const L=D.translateBufferLineToString(k[1],!1);let P=this._convertViewportColToCharacterIndex(N,k[0]),I=P;const z=k[0]-P;let O=0,A=0,j=0,F=0;if(L.charAt(P)===" "){for(;P>0&&L.charAt(P-1)===" ";)P--;for(;I1&&(F+=X-1,I+=X-1);G>0&&P>0&&!this._isCharWordSeparator(N.loadCell(G-1,this._workCell));){N.loadCell(G-1,this._workCell);const W=this._workCell.getChars().length;this._workCell.getWidth()===0?(O++,G--):W>1&&(j+=W-1,P-=W-1),P--,G--}for(;Z1&&(F+=W-1,I+=W-1),I++,Z++}}I++;let H=P+z-O+j,B=Math.min(this._bufferService.cols,I-P+O+A-j-F);if(T||L.slice(P,I).trim()!==""){if(R&&H===0&&N.getCodePoint(0)!==32){const G=D.lines.get(k[1]-1);if(G&&N.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){const Z=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(Z){const X=this._bufferService.cols-Z.start;H-=X,B+=X}}}if(M&&H+B===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const G=D.lines.get(k[1]+1);if(G!=null&&G.isWrapped&&G.getCodePoint(0)!==32){const Z=this._getWordAt([0,k[1]+1],!1,!1,!0);Z&&(B+=Z.length)}}return{start:H,length:B}}}_selectWordAt(k,T){const R=this._getWordAt(k,T);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[R.start,k[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(k){const T=this._getWordAt(k,!0);if(T){let R=k[1];for(;T.start<0;)T.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,R]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const T=this._bufferService.buffer.getWrappedRangeForLine(k),R={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,p.getRangeLength)(R,this._bufferService.cols)}};o.SelectionService=E=c([h(3,b.IBufferService),h(4,b.ICoreService),h(5,_.IMouseService),h(6,b.IOptionsService),h(7,_.IRenderService),h(8,_.ICoreBrowserService)],E)},4725:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=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"),o.ILinkProviderService=(0,c.createDecorator)("LinkProviderService")},6731:function(a,o,l){var c=this&&this.__decorate||function(E,k,T,R){var M,D=arguments.length,N=D<3?k:R===null?R=Object.getOwnPropertyDescriptor(k,T):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(E,k,T,R);else for(var L=E.length-1;L>=0;L--)(M=E[L])&&(N=(D<3?M(N):D>3?M(k,T,N):M(k,T))||N);return D>3&&N&&Object.defineProperty(k,T,N),N},h=this&&this.__param||function(E,k){return function(T,R){k(T,R,E)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=l(7239),f=l(8055),m=l(8460),_=l(844),v=l(2585),y=f.css.toColor("#ffffff"),g=f.css.toColor("#000000"),p=f.css.toColor("#ffffff"),x=f.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[f.css.toColor("#2e3436"),f.css.toColor("#cc0000"),f.css.toColor("#4e9a06"),f.css.toColor("#c4a000"),f.css.toColor("#3465a4"),f.css.toColor("#75507b"),f.css.toColor("#06989a"),f.css.toColor("#d3d7cf"),f.css.toColor("#555753"),f.css.toColor("#ef2929"),f.css.toColor("#8ae234"),f.css.toColor("#fce94f"),f.css.toColor("#729fcf"),f.css.toColor("#ad7fa8"),f.css.toColor("#34e2e2"),f.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let T=0;T<216;T++){const R=k[T/36%6|0],M=k[T/6%6|0],D=k[T%6];E.push({css:f.channels.toCss(R,M,D),rgba:f.channels.toRgba(R,M,D)})}for(let T=0;T<24;T++){const R=8+10*T;E.push({css:f.channels.toCss(R,R,R),rgba:f.channels.toRgba(R,R,R)})}return E})());let S=o.ThemeService=class extends _.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:y,background:g,cursor:p,cursorAccent:x,selectionForeground:void 0,selectionBackgroundTransparent:b,selectionBackgroundOpaque:f.color.blend(g,b),selectionInactiveBackgroundTransparent:b,selectionInactiveBackgroundOpaque:f.color.blend(g,b),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(E={}){const k=this._colors;if(k.foreground=C(E.foreground,y),k.background=C(E.background,g),k.cursor=C(E.cursor,p),k.cursorAccent=C(E.cursorAccent,x),k.selectionBackgroundTransparent=C(E.selectionBackground,b),k.selectionBackgroundOpaque=f.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=C(E.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=f.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=E.selectionForeground?C(E.selectionForeground,f.NULL_COLOR):void 0,k.selectionForeground===f.NULL_COLOR&&(k.selectionForeground=void 0),f.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=f.color.opacity(k.selectionBackgroundTransparent,.3)),f.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=f.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=o.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=C(E.black,o.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=C(E.red,o.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=C(E.green,o.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=C(E.yellow,o.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=C(E.blue,o.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=C(E.magenta,o.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=C(E.cyan,o.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=C(E.white,o.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=C(E.brightBlack,o.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=C(E.brightRed,o.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=C(E.brightGreen,o.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=C(E.brightYellow,o.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=C(E.brightBlue,o.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=C(E.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=C(E.brightCyan,o.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=C(E.brightWhite,o.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const T=Math.min(k.ansi.length-16,E.extendedAnsi.length);for(let R=0;R{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const c=l(8460),h=l(844);class d extends h.Disposable{constructor(m){super(),this._maxLength=m,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(m){if(this._maxLength===m)return;const _=new Array(m);for(let v=0;vthis._length)for(let _=this._length;_=m;y--)this._array[this._getCyclicIndex(y+v.length)]=this._array[this._getCyclicIndex(y)];for(let y=0;ythis._maxLength){const y=this._length+v.length-this._maxLength;this._startIndex+=y,this._length=this._maxLength,this.onTrimEmitter.fire(y)}else this._length+=v.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,_,v){if(!(_<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let g=_-1;g>=0;g--)this.set(m+g+v,this.get(m+g));const y=m+_+v-this._length;if(y>0)for(this._length+=y;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let y=0;y<_;y++)this.set(m+y+v,this.get(m+y))}}_getCyclicIndex(m){return(this._startIndex+m)%this._maxLength}}o.CircularList=d},1439:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function l(c,h=5){if(typeof c!="object")return c;const d=Array.isArray(c)?[]:{};for(const f in c)d[f]=h<=1?c[f]:c[f]&&l(c[f],h-1);return d}},8055:(a,o)=>{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;let l=0,c=0,h=0,d=0;var f,m,_,v,y;function g(x){const b=x.toString(16);return b.length<2?"0"+b:b}function p(x,b){return x>>0},x.toColor=function(b,S,C,E){return{css:x.toCss(b,S,C,E),rgba:x.toRgba(b,S,C,E)}}}(f||(o.channels=f={})),function(x){function b(S,C){return d=Math.round(255*C),[l,c,h]=y.toChannels(S.rgba),{css:f.toCss(l,c,h,d),rgba:f.toRgba(l,c,h,d)}}x.blend=function(S,C){if(d=(255&C.rgba)/255,d===1)return{css:C.css,rgba:C.rgba};const E=C.rgba>>24&255,k=C.rgba>>16&255,T=C.rgba>>8&255,R=S.rgba>>24&255,M=S.rgba>>16&255,D=S.rgba>>8&255;return l=R+Math.round((E-R)*d),c=M+Math.round((k-M)*d),h=D+Math.round((T-D)*d),{css:f.toCss(l,c,h),rgba:f.toRgba(l,c,h)}},x.isOpaque=function(S){return(255&S.rgba)==255},x.ensureContrastRatio=function(S,C,E){const k=y.ensureContrastRatio(S.rgba,C.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},x.opaque=function(S){const C=(255|S.rgba)>>>0;return[l,c,h]=y.toChannels(C),{css:f.toCss(l,c,h),rgba:C}},x.opacity=b,x.multiplyOpacity=function(S,C){return d=255&S.rgba,b(S,d*C/255)},x.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(m||(o.color=m={})),function(x){let b,S;try{const C=document.createElement("canvas");C.width=1,C.height=1;const E=C.getContext("2d",{willReadFrequently:!0});E&&(b=E,b.globalCompositeOperation="copy",S=b.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),f.toColor(l,c,h);case 5:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),d=parseInt(C.slice(4,5).repeat(2),16),f.toColor(l,c,h,d);case 7:return{css:C,rgba:(parseInt(C.slice(1),16)<<8|255)>>>0};case 9:return{css:C,rgba:parseInt(C.slice(1),16)>>>0}}const E=C.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 l=parseInt(E[1]),c=parseInt(E[2]),h=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,c,h,d);if(!b||!S)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=S,b.fillStyle=C,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,c,h,d]=b.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,c,h,d),css:C}}}(_||(o.css=_={})),function(x){function b(S,C,E){const k=S/255,T=C/255,R=E/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}x.relativeLuminance=function(S){return b(S>>16&255,S>>8&255,255&S)},x.relativeLuminance2=b}(v||(o.rgb=v={})),function(x){function b(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let D=E>>24&255,N=E>>16&255,L=E>>8&255,P=p(v.relativeLuminance2(D,N,L),v.relativeLuminance2(T,R,M));for(;P0||N>0||L>0);)D-=Math.max(0,Math.ceil(.1*D)),N-=Math.max(0,Math.ceil(.1*N)),L-=Math.max(0,Math.ceil(.1*L)),P=p(v.relativeLuminance2(D,N,L),v.relativeLuminance2(T,R,M));return(D<<24|N<<16|L<<8|255)>>>0}function S(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let D=E>>24&255,N=E>>16&255,L=E>>8&255,P=p(v.relativeLuminance2(D,N,L),v.relativeLuminance2(T,R,M));for(;P>>0}x.blend=function(C,E){if(d=(255&E)/255,d===1)return E;const k=E>>24&255,T=E>>16&255,R=E>>8&255,M=C>>24&255,D=C>>16&255,N=C>>8&255;return l=M+Math.round((k-M)*d),c=D+Math.round((T-D)*d),h=N+Math.round((R-N)*d),f.toRgba(l,c,h)},x.ensureContrastRatio=function(C,E,k){const T=v.relativeLuminance(C>>8),R=v.relativeLuminance(E>>8);if(p(T,R)>8));if(Lp(T,v.relativeLuminance(P>>8))?N:P}return N}const M=S(C,E,k),D=p(T,v.relativeLuminance(M>>8));if(Dp(T,v.relativeLuminance(N>>8))?M:N}return M}},x.reduceLuminance=b,x.increaseLuminance=S,x.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}}(y||(o.rgba=y={})),o.toPaddedHex=g,o.contrastRatio=p},8969:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const c=l(844),h=l(2585),d=l(4348),f=l(7866),m=l(744),_=l(7302),v=l(6975),y=l(8460),g=l(1753),p=l(1480),x=l(7994),b=l(9282),S=l(5435),C=l(5981),E=l(2660);let k=!1;class T extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new y.EventEmitter),this._onScroll.event(M=>{var D;(D=this._onScrollApi)==null||D.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 D in M)this.optionsService.options[D]=M[D]}constructor(M){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new y.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new y.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new y.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new y.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new y.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new _.OptionsService(M)),this._instantiationService.setService(h.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(h.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(f.LogService)),this._instantiationService.setService(h.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(h.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(g.CoreMouseService)),this._instantiationService.setService(h.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(p.UnicodeService)),this._instantiationService.setService(h.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(x.CharsetService),this._instantiationService.setService(h.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(h.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,y.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,y.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,y.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,y.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(D=>{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(D=>{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((D,N)=>this._inputHandler.parse(D,N))),this.register((0,y.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(M,D){this._writeBuffer.write(M,D)}writeSync(M,D){this._logService.logLevel<=h.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(M,D)}input(M,D=!0){this.coreService.triggerDataEvent(M,D)}resize(M,D){isNaN(M)||isNaN(D)||(M=Math.max(M,m.MINIMUM_COLS),D=Math.max(D,m.MINIMUM_ROWS),this._bufferService.resize(M,D))}scroll(M,D=!1){this._bufferService.scroll(M,D)}scrollLines(M,D,N){this._bufferService.scrollLines(M,D,N)}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 D=M-this._bufferService.buffer.ydisp;D!==0&&this.scrollLines(D)}registerEscHandler(M,D){return this._inputHandler.registerEscHandler(M,D)}registerDcsHandler(M,D){return this._inputHandler.registerDcsHandler(M,D)}registerCsiHandler(M,D){return this._inputHandler.registerCsiHandler(M,D)}registerOscHandler(M,D){return this._inputHandler.registerOscHandler(M,D)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let M=!1;const D=this.optionsService.rawOptions.windowsPty;D&&D.buildNumber!==void 0&&D.buildNumber!==void 0?M=D.backend==="conpty"&&D.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(b.updateWindowsModeWrappedState.bind(null,this._bufferService))),M.push(this.registerCsiHandler({final:"H"},()=>((0,b.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const D of M)D.dispose()})}}}o.CoreTerminal=T},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;cc.fire(h))},o.runAndSubscribe=function(l,c){return c(void 0),l(h=>c(h))}},5435:function(a,o,l){var c=this&&this.__decorate||function(O,A,j,F){var H,B=arguments.length,G=B<3?A:F===null?F=Object.getOwnPropertyDescriptor(A,j):F;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(O,A,j,F);else for(var Z=O.length-1;Z>=0;Z--)(H=O[Z])&&(G=(B<3?H(G):B>3?H(A,j,G):H(A,j))||G);return B>3&&G&&Object.defineProperty(A,j,G),G},h=this&&this.__param||function(O,A){return function(j,F){A(j,F,O)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=l(2584),f=l(7116),m=l(2015),_=l(844),v=l(482),y=l(8437),g=l(8460),p=l(643),x=l(511),b=l(3734),S=l(2585),C=l(1480),E=l(6242),k=l(6351),T=l(5941),R={"(":0,")":1,"*":2,"+":3,"-":1,".":2},M=131072;function D(O,A){if(O>24)return A.setWinLines||!1;switch(O){case 1:return!!A.restoreWin;case 2:return!!A.minimizeWin;case 3:return!!A.setWinPosition;case 4:return!!A.setWinSizePixels;case 5:return!!A.raiseWin;case 6:return!!A.lowerWin;case 7:return!!A.refreshWin;case 8:return!!A.setWinSizeChars;case 9:return!!A.maximizeWin;case 10:return!!A.fullscreenWin;case 11:return!!A.getWinState;case 13:return!!A.getWinPosition;case 14:return!!A.getWinSizePixels;case 15:return!!A.getScreenSizePixels;case 16:return!!A.getCellSizePixels;case 18:return!!A.getWinSizeChars;case 19:return!!A.getScreenSizeChars;case 20:return!!A.getIconTitle;case 21:return!!A.getWinTitle;case 22:return!!A.pushTitle;case 23:return!!A.popTitle;case 24:return!!A.setWinLines}return!1}var N;(function(O){O[O.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",O[O.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(o.WindowsOptionsReportType=N={}));let L=0;class P extends _.Disposable{getAttrData(){return this._curAttrData}constructor(A,j,F,H,B,G,Z,X,W=new m.EscapeSequenceParser){super(),this._bufferService=A,this._charsetService=j,this._coreService=F,this._logService=H,this._optionsService=B,this._oscLinkService=G,this._coreMouseService=Z,this._unicodeService=X,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new x.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new g.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new g.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new g.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new g.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new g.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new g.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new g.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new g.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new g.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new g.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new g.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new g.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate($=>this._activeBuffer=$.activeBuffer)),this._parser.setCsiHandlerFallback(($,V)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:V.toArray()})}),this._parser.setEscHandlerFallback($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})}),this._parser.setExecuteHandlerFallback($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})}),this._parser.setOscHandlerFallback(($,V,U)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:V,data:U})}),this._parser.setDcsHandlerFallback(($,V,U)=>{V==="HOOK"&&(U=U.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:V,payload:U})}),this._parser.setPrintHandler(($,V,U)=>this.print($,V,U)),this._parser.registerCsiHandler({final:"@"},$=>this.insertChars($)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},$=>this.scrollLeft($)),this._parser.registerCsiHandler({final:"A"},$=>this.cursorUp($)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},$=>this.scrollRight($)),this._parser.registerCsiHandler({final:"B"},$=>this.cursorDown($)),this._parser.registerCsiHandler({final:"C"},$=>this.cursorForward($)),this._parser.registerCsiHandler({final:"D"},$=>this.cursorBackward($)),this._parser.registerCsiHandler({final:"E"},$=>this.cursorNextLine($)),this._parser.registerCsiHandler({final:"F"},$=>this.cursorPrecedingLine($)),this._parser.registerCsiHandler({final:"G"},$=>this.cursorCharAbsolute($)),this._parser.registerCsiHandler({final:"H"},$=>this.cursorPosition($)),this._parser.registerCsiHandler({final:"I"},$=>this.cursorForwardTab($)),this._parser.registerCsiHandler({final:"J"},$=>this.eraseInDisplay($,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},$=>this.eraseInDisplay($,!0)),this._parser.registerCsiHandler({final:"K"},$=>this.eraseInLine($,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},$=>this.eraseInLine($,!0)),this._parser.registerCsiHandler({final:"L"},$=>this.insertLines($)),this._parser.registerCsiHandler({final:"M"},$=>this.deleteLines($)),this._parser.registerCsiHandler({final:"P"},$=>this.deleteChars($)),this._parser.registerCsiHandler({final:"S"},$=>this.scrollUp($)),this._parser.registerCsiHandler({final:"T"},$=>this.scrollDown($)),this._parser.registerCsiHandler({final:"X"},$=>this.eraseChars($)),this._parser.registerCsiHandler({final:"Z"},$=>this.cursorBackwardTab($)),this._parser.registerCsiHandler({final:"`"},$=>this.charPosAbsolute($)),this._parser.registerCsiHandler({final:"a"},$=>this.hPositionRelative($)),this._parser.registerCsiHandler({final:"b"},$=>this.repeatPrecedingCharacter($)),this._parser.registerCsiHandler({final:"c"},$=>this.sendDeviceAttributesPrimary($)),this._parser.registerCsiHandler({prefix:">",final:"c"},$=>this.sendDeviceAttributesSecondary($)),this._parser.registerCsiHandler({final:"d"},$=>this.linePosAbsolute($)),this._parser.registerCsiHandler({final:"e"},$=>this.vPositionRelative($)),this._parser.registerCsiHandler({final:"f"},$=>this.hVPosition($)),this._parser.registerCsiHandler({final:"g"},$=>this.tabClear($)),this._parser.registerCsiHandler({final:"h"},$=>this.setMode($)),this._parser.registerCsiHandler({prefix:"?",final:"h"},$=>this.setModePrivate($)),this._parser.registerCsiHandler({final:"l"},$=>this.resetMode($)),this._parser.registerCsiHandler({prefix:"?",final:"l"},$=>this.resetModePrivate($)),this._parser.registerCsiHandler({final:"m"},$=>this.charAttributes($)),this._parser.registerCsiHandler({final:"n"},$=>this.deviceStatus($)),this._parser.registerCsiHandler({prefix:"?",final:"n"},$=>this.deviceStatusPrivate($)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},$=>this.softReset($)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},$=>this.setCursorStyle($)),this._parser.registerCsiHandler({final:"r"},$=>this.setScrollRegion($)),this._parser.registerCsiHandler({final:"s"},$=>this.saveCursor($)),this._parser.registerCsiHandler({final:"t"},$=>this.windowOptions($)),this._parser.registerCsiHandler({final:"u"},$=>this.restoreCursor($)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},$=>this.insertColumns($)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},$=>this.deleteColumns($)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},$=>this.selectProtected($)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},$=>this.requestMode($,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},$=>this.requestMode($,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new E.OscHandler($=>(this.setTitle($),this.setIconName($),!0))),this._parser.registerOscHandler(1,new E.OscHandler($=>this.setIconName($))),this._parser.registerOscHandler(2,new E.OscHandler($=>this.setTitle($))),this._parser.registerOscHandler(4,new E.OscHandler($=>this.setOrReportIndexedColor($))),this._parser.registerOscHandler(8,new E.OscHandler($=>this.setHyperlink($))),this._parser.registerOscHandler(10,new E.OscHandler($=>this.setOrReportFgColor($))),this._parser.registerOscHandler(11,new E.OscHandler($=>this.setOrReportBgColor($))),this._parser.registerOscHandler(12,new E.OscHandler($=>this.setOrReportCursorColor($))),this._parser.registerOscHandler(104,new E.OscHandler($=>this.restoreIndexedColor($))),this._parser.registerOscHandler(110,new E.OscHandler($=>this.restoreFgColor($))),this._parser.registerOscHandler(111,new E.OscHandler($=>this.restoreBgColor($))),this._parser.registerOscHandler(112,new E.OscHandler($=>this.restoreCursorColor($))),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 $ in f.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},()=>this.selectCharset("("+$)),this._parser.registerEscHandler({intermediates:")",final:$},()=>this.selectCharset(")"+$)),this._parser.registerEscHandler({intermediates:"*",final:$},()=>this.selectCharset("*"+$)),this._parser.registerEscHandler({intermediates:"+",final:$},()=>this.selectCharset("+"+$)),this._parser.registerEscHandler({intermediates:"-",final:$},()=>this.selectCharset("-"+$)),this._parser.registerEscHandler({intermediates:".",final:$},()=>this.selectCharset("."+$)),this._parser.registerEscHandler({intermediates:"/",final:$},()=>this.selectCharset("/"+$));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler($=>(this._logService.error("Parsing error: ",$),$)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler(($,V)=>this.requestStatusString($,V)))}_preserveStack(A,j,F,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=A,this._parseStack.cursorStartY=j,this._parseStack.decodedLength=F,this._parseStack.position=H}_logSlowResolvingAsync(A){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([A,new Promise((j,F)=>setTimeout(()=>F("#SLOW_TIMEOUT"),5e3))]).catch(j=>{if(j!=="#SLOW_TIMEOUT")throw j;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(A,j){let F,H=this._activeBuffer.x,B=this._activeBuffer.y,G=0;const Z=this._parseStack.paused;if(Z){if(F=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,j))return this._logSlowResolvingAsync(F),F;H=this._parseStack.cursorStartX,B=this._parseStack.cursorStartY,this._parseStack.paused=!1,A.length>M&&(G=this._parseStack.position+M)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof A=="string"?` "${A}"`:` "${Array.prototype.map.call(A,$=>String.fromCharCode($)).join("")}"`),typeof A=="string"?A.split("").map($=>$.charCodeAt(0)):A),this._parseBuffer.lengthM)for(let $=G;$0&&U.getWidth(this._activeBuffer.x-1)===2&&U.setCellFromCodepoint(this._activeBuffer.x-1,0,1,V);let Q=this._parser.precedingJoinState;for(let q=j;qX){if(W){const ye=U;let le=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),U=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),ce>0&&U instanceof y.BufferLine&&U.copyCellsFrom(ye,le,0,ce,!1);le=0;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}else if($&&(U.insertCells(this._activeBuffer.x,B-ce,this._activeBuffer.getNullCell(V)),U.getWidth(X-1)===2&&U.setCellFromCodepoint(X-1,p.NULL_CELL_CODE,p.NULL_CELL_WIDTH,V)),U.setCellFromCodepoint(this._activeBuffer.x++,H,B,V),B>0)for(;--B;)U.setCellFromCodepoint(this._activeBuffer.x++,0,0,V)}this._parser.precedingJoinState=Q,this._activeBuffer.x0&&U.getWidth(this._activeBuffer.x)===0&&!U.hasContent(this._activeBuffer.x)&&U.setCellFromCodepoint(this._activeBuffer.x,0,1,V),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(A,j){return A.final!=="t"||A.prefix||A.intermediates?this._parser.registerCsiHandler(A,j):this._parser.registerCsiHandler(A,F=>!D(F.params[0],this._optionsService.rawOptions.windowOptions)||j(F))}registerDcsHandler(A,j){return this._parser.registerDcsHandler(A,new k.DcsHandler(j))}registerEscHandler(A,j){return this._parser.registerEscHandler(A,j)}registerOscHandler(A,j){return this._parser.registerOscHandler(A,new E.OscHandler(j))}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 A;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&&((A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&A.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const j=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);j.hasWidth(this._activeBuffer.x)&&!j.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const A=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-A),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(A=this._bufferService.cols-1){this._activeBuffer.x=Math.min(A,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(A,j){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=A,this._activeBuffer.y=this._activeBuffer.scrollTop+j):(this._activeBuffer.x=A,this._activeBuffer.y=j),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(A,j){this._restrictCursor(),this._setCursor(this._activeBuffer.x+A,this._activeBuffer.y+j)}cursorUp(A){const j=this._activeBuffer.y-this._activeBuffer.scrollTop;return j>=0?this._moveCursor(0,-Math.min(j,A.params[0]||1)):this._moveCursor(0,-(A.params[0]||1)),!0}cursorDown(A){const j=this._activeBuffer.scrollBottom-this._activeBuffer.y;return j>=0?this._moveCursor(0,Math.min(j,A.params[0]||1)):this._moveCursor(0,A.params[0]||1),!0}cursorForward(A){return this._moveCursor(A.params[0]||1,0),!0}cursorBackward(A){return this._moveCursor(-(A.params[0]||1),0),!0}cursorNextLine(A){return this.cursorDown(A),this._activeBuffer.x=0,!0}cursorPrecedingLine(A){return this.cursorUp(A),this._activeBuffer.x=0,!0}cursorCharAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(A){return this._setCursor(A.length>=2?(A.params[1]||1)-1:0,(A.params[0]||1)-1),!0}charPosAbsolute(A){return this._setCursor((A.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(A){return this._moveCursor(A.params[0]||1,0),!0}linePosAbsolute(A){return this._setCursor(this._activeBuffer.x,(A.params[0]||1)-1),!0}vPositionRelative(A){return this._moveCursor(0,A.params[0]||1),!0}hVPosition(A){return this.cursorPosition(A),!0}tabClear(A){const j=A.params[0];return j===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:j===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=A.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(A){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let j=A.params[0]||1;for(;j--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(A){const j=A.params[0];return j===1&&(this._curAttrData.bg|=536870912),j!==2&&j!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(A,j,F,H=!1,B=!1){const G=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);G.replaceCells(j,F,this._activeBuffer.getNullCell(this._eraseAttrData()),B),H&&(G.isWrapped=!1)}_resetBufferLine(A,j=!1){const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);F&&(F.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),j),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+A),F.isWrapped=!1)}eraseInDisplay(A,j=!1){let F;switch(this._restrictCursor(this._bufferService.cols),A.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,j);F=this._bufferService.cols&&(this._activeBuffer.lines.get(F+1).isWrapped=!1);F--;)this._resetBufferLine(F,j);this._dirtyRowTracker.markDirty(0);break;case 2:for(F=this._bufferService.rows,this._dirtyRowTracker.markDirty(F-1);F--;)this._resetBufferLine(F,j);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(A,j=!1){switch(this._restrictCursor(this._bufferService.cols),A.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,j);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,j);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,j)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(A){this._restrictCursor();let j=A.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let W=X;for(let $=1;$0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(A){return A.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(A.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(A){return(this._optionsService.rawOptions.termName+"").indexOf(A)===0}setMode(A){for(let j=0;jre?1:2,Q=A.params[0];return q=Q,ie=j?Q===2?4:Q===4?U(G.modes.insertMode):Q===12?3:Q===20?U(V.convertEol):0:Q===1?U(F.applicationCursorKeys):Q===3?V.windowOptions.setWinLines?X===80?2:X===132?1:0:0:Q===6?U(F.origin):Q===7?U(F.wraparound):Q===8?3:Q===9?U(H==="X10"):Q===12?U(V.cursorBlink):Q===25?U(!G.isCursorHidden):Q===45?U(F.reverseWraparound):Q===66?U(F.applicationKeypad):Q===67?4:Q===1e3?U(H==="VT200"):Q===1002?U(H==="DRAG"):Q===1003?U(H==="ANY"):Q===1004?U(F.sendFocus):Q===1005?4:Q===1006?U(B==="SGR"):Q===1015?4:Q===1016?U(B==="SGR_PIXELS"):Q===1048?1:Q===47||Q===1047||Q===1049?U(W===$):Q===2004?U(F.bracketedPasteMode):0,G.triggerDataEvent(`${d.C0.ESC}[${j?"":"?"}${q};${ie}$y`),!0;var q,ie}_updateAttrColor(A,j,F,H,B){return j===2?(A|=50331648,A&=-16777216,A|=b.AttributeData.fromColorRGB([F,H,B])):j===5&&(A&=-50331904,A|=33554432|255&F),A}_extractColor(A,j,F){const H=[0,0,-1,0,0,0];let B=0,G=0;do{if(H[G+B]=A.params[j+G],A.hasSubParams(j+G)){const Z=A.getSubParams(j+G);let X=0;do H[1]===5&&(B=1),H[G+X+1+B]=Z[X];while(++X=2||H[1]===2&&G+B>=5)break;H[1]&&(B=1)}while(++G+j5)&&(A=1),j.extended.underlineStyle=A,j.fg|=268435456,A===0&&(j.fg&=-268435457),j.updateExtended()}_processSGR0(A){A.fg=y.DEFAULT_ATTR_DATA.fg,A.bg=y.DEFAULT_ATTR_DATA.bg,A.extended=A.extended.clone(),A.extended.underlineStyle=0,A.extended.underlineColor&=-67108864,A.updateExtended()}charAttributes(A){if(A.length===1&&A.params[0]===0)return this._processSGR0(this._curAttrData),!0;const j=A.length;let F;const H=this._curAttrData;for(let B=0;B=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(A.hasSubParams(B)?A.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&y.DEFAULT_ATTR_DATA.fg):F===49?(H.bg&=-67108864,H.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):F===38||F===48||F===58?B+=this._extractColor(A,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&y.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",F);return!0}deviceStatus(A){switch(A.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const j=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${j};${F}R`)}return!0}deviceStatusPrivate(A){if(A.params[0]===6){const j=this._activeBuffer.y+1,F=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${j};${F}R`)}return!0}softReset(A){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.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(A){const j=A.params[0]||1;switch(j){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=j%2==1;return this._optionsService.options.cursorBlink=F,!0}setScrollRegion(A){const j=A.params[0]||1;let F;return(A.length<2||(F=A.params[1])>this._bufferService.rows||F===0)&&(F=this._bufferService.rows),F>j&&(this._activeBuffer.scrollTop=j-1,this._activeBuffer.scrollBottom=F-1,this._setCursor(0,0)),!0}windowOptions(A){if(!D(A.params[0],this._optionsService.rawOptions.windowOptions))return!0;const j=A.length>1?A.params[1]:0;switch(A.params[0]){case 14:j!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:j!==0&&j!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),j!==0&&j!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:j!==0&&j!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),j!==0&&j!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(A){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(A){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(A){return this._windowTitle=A,this._onTitleChange.fire(A),!0}setIconName(A){return this._iconName=A,!0}setOrReportIndexedColor(A){const j=[],F=A.split(";");for(;F.length>1;){const H=F.shift(),B=F.shift();if(/^\d+$/.exec(H)){const G=parseInt(H);if(z(G))if(B==="?")j.push({type:0,index:G});else{const Z=(0,T.parseColor)(B);Z&&j.push({type:1,index:G,color:Z})}}}return j.length&&this._onColor.fire(j),!0}setHyperlink(A){const j=A.split(";");return!(j.length<2)&&(j[1]?this._createHyperlink(j[0],j[1]):!j[0]&&this._finishHyperlink())}_createHyperlink(A,j){this._getCurrentLinkId()&&this._finishHyperlink();const F=A.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:j}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(A,j){const F=A.split(";");for(let H=0;H=this._specialColors.length);++H,++j)if(F[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[j]}]);else{const B=(0,T.parseColor)(F[H]);B&&this._onColor.fire([{type:1,index:this._specialColors[j],color:B}])}return!0}setOrReportFgColor(A){return this._setOrReportSpecialColor(A,0)}setOrReportBgColor(A){return this._setOrReportSpecialColor(A,1)}setOrReportCursorColor(A){return this._setOrReportSpecialColor(A,2)}restoreIndexedColor(A){if(!A)return this._onColor.fire([{type:2}]),!0;const j=[],F=A.split(";");for(let H=0;H=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 A=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,A,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=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(A){return this._charsetService.setgLevel(A),!0}screenAlignmentPattern(){const A=new x.CellData;A.content=4194373,A.fg=this._curAttrData.fg,A.bg=this._curAttrData.bg,this._setCursor(0,0);for(let j=0;j(this._coreService.triggerDataEvent(`${d.C0.ESC}${B}${d.C0.ESC}\\`),!0))(A==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:A==='"p'?'P1$r61;1"p':A==="r"?`P1$r${F.scrollTop+1};${F.scrollBottom+1}r`:A==="m"?"P1$r0m":A===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(A,j){this._dirtyRowTracker.markRangeDirty(A,j)}}o.InputHandler=P;let I=class{constructor(O){this._bufferService=O,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(O){Othis.end&&(this.end=O)}markRangeDirty(O,A){O>A&&(L=O,O=A,A=L),Othis.end&&(this.end=A)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function z(O){return 0<=O&&O<256}I=c([h(0,S.IBufferService)],I)},844:(a,o)=>{function l(c){for(const h of c)h.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 h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)==null||h.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(h,d,f){this._data[h]||(this._data[h]={}),this._data[h][d]=f}get(h,d){return this._data[h]?this._data[h][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,h,d,f,m){this._data.get(c,h)||this._data.set(c,h,new l),this._data.get(c,h).set(d,f,m)}get(c,h,d,f){var m;return(m=this._data.get(c,h))==null?void 0:m.get(d,f)}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"&&"title"in process;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 h=l.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[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 h=this._getKey(c);if(h===void 0||(l=this._search(h),l===-1)||this._getKey(this._array[l])!==h)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])===c))do yield this._array[l];while(++l=this._array.length)&&this._getKey(this._array[l])===c))do h(this._array[l]);while(++l=h;){let f=h+d>>1;const m=this._getKey(this._array[f]);if(m>c)d=f-1;else{if(!(m0&&this._getKey(this._array[f-1])===c;)f--;return f}h=f+1}}return h}}},7226:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const c=l(6114);class h{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ig)return y-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-_))}ms`),void this._start();y=g}this.clear()}}class d extends h{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const _=Date.now()+m;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}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(h){const d=h.buffer.lines.get(h.buffer.ybase+h.buffer.y-1),f=d==null?void 0:d.get(h.cols-1),m=h.buffer.lines.get(h.buffer.ybase+h.buffer.y);m&&f&&(m.isWrapped=f[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&f[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(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,f=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=f}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),h=l(7226),d=l(3734),f=l(8437),m=l(4634),_=l(511),v=l(643),y=l(4863),g=l(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(p,x,b){this._hasScrollback=p,this._optionsService=x,this._bufferService=b,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=f.DEFAULT_ATTR_DATA.clone(),this.savedCharset=g.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new h.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(p){return p?(this._nullCell.fg=p.fg,this._nullCell.bg=p.bg,this._nullCell.extended=p.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(p){return p?(this._whitespaceCell.fg=p.fg,this._whitespaceCell.bg=p.bg,this._whitespaceCell.extended=p.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(p,x){return new f.BufferLine(this._bufferService.cols,this.getNullCell(p),x)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const p=this.ybase+this.y-this.ydisp;return p>=0&&po.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:x}fillViewportRows(p){if(this.lines.length===0){p===void 0&&(p=f.DEFAULT_ATTR_DATA);let x=this._rows;for(;x--;)this.lines.push(this.getBlankLine(p))}}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(p,x){const b=this.getNullCell(f.DEFAULT_ATTR_DATA);let S=0;const C=this._getCorrectBufferLength(x);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new f.BufferLine(p,b)));else for(let k=this._rows;k>x;k--)this.lines.length>x+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=C}this.x=Math.min(this.x,p-1),this.y=Math.min(this.y,x-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,p-1),this.scrollTop=0}if(this.scrollBottom=x-1,this._isReflowEnabled&&(this._reflow(p,x),this._cols>p))for(let E=0;E.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let p=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,p=!1);let x=0;for(;this._memoryCleanupPosition100)return!0;return p}get _isReflowEnabled(){const p=this._optionsService.rawOptions.windowsPty;return p&&p.buildNumber?this._hasScrollback&&p.backend==="conpty"&&p.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(p,x){this._cols!==p&&(p>this._cols?this._reflowLarger(p,x):this._reflowSmaller(p,x))}_reflowLarger(p,x){const b=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,p,this.ybase+this.y,this.getNullCell(f.DEFAULT_ATTR_DATA));if(b.length>0){const S=(0,m.reflowLargerCreateNewLayout)(this.lines,b);(0,m.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(p,x,S.countRemoved)}}_reflowLargerAdjustViewport(p,x,b){const S=this.getNullCell(f.DEFAULT_ATTR_DATA);let C=b;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;E--){let k=this.lines.get(E);if(!k||!k.isWrapped&&k.getTrimmedLength()<=p)continue;const T=[k];for(;k.isWrapped&&E>0;)k=this.lines.get(--E),T.unshift(k);const R=this.ybase+this.y;if(R>=E&&R0&&(S.push({start:E+T.length+C,newLines:P}),C+=P.length),T.push(...P);let I=D.length-1,z=D[I];z===0&&(I--,z=D[I]);let O=T.length-N-1,A=M;for(;O>=0;){const F=Math.min(A,z);if(T[I]===void 0)break;if(T[I].copyCellsFrom(T[O],A-F,z-F,F,!0),z-=F,z===0&&(I--,z=D[I]),A-=F,A===0){O--;const H=Math.max(O,0);A=(0,m.getWrappedLineTrimmedLength)(T,H,this._cols)}}for(let F=0;F0;)this.ybase===0?this.y0){const E=[],k=[];for(let I=0;I=0;I--)if(D&&D.start>R+N){for(let z=D.newLines.length-1;z>=0;z--)this.lines.set(I--,D.newLines[z]);I++,E.push({index:R+1,amount:D.newLines.length}),N+=D.newLines.length,D=S[++M]}else this.lines.set(I,k[R--]);let L=0;for(let I=E.length-1;I>=0;I--)E[I].index+=L,this.lines.onInsertEmitter.fire(E[I]),L+=E[I].amount;const P=Math.max(0,T+C-this.lines.maxLength);P>0&&this.lines.onTrimEmitter.fire(P)}}translateBufferLineToString(p,x,b=0,S){const C=this.lines.get(p);return C?C.translateToString(x,b,S):""}getWrappedRangeForLine(p){let x=p,b=p;for(;x>0&&this.lines.get(x).isWrapped;)x--;for(;b+10;);return p>=this._cols?this._cols-1:p<0?0:p}nextStop(p){for(p==null&&(p=this.x);!this.tabs[++p]&&p=this._cols?this._cols-1:p<0?0:p}clearMarkers(p){this._isClearing=!0;for(let x=0;x{x.line-=b,x.line<0&&x.dispose()})),x.register(this.lines.onInsert(b=>{x.line>=b.index&&(x.line+=b.amount)})),x.register(this.lines.onDelete(b=>{x.line>=b.index&&x.lineb.index&&(x.line-=b.amount)})),x.register(x.onDispose(()=>this._removeMarker(x))),x}_removeMarker(p){this._isClearing||this.markers.splice(this.markers.indexOf(p),1)}}},8437:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const c=l(3734),h=l(511),d=l(643),f=l(482);o.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let m=0;class _{constructor(y,g,p=!1){this.isWrapped=p,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*y);const x=g||h.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let b=0;b>22,2097152&g?this._combined[y].charCodeAt(this._combined[y].length-1):p]}set(y,g){this._data[3*y+1]=g[d.CHAR_DATA_ATTR_INDEX],g[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[y]=g[1],this._data[3*y+0]=2097152|y|g[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*y+0]=g[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|g[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(y){return this._data[3*y+0]>>22}hasWidth(y){return 12582912&this._data[3*y+0]}getFg(y){return this._data[3*y+1]}getBg(y){return this._data[3*y+2]}hasContent(y){return 4194303&this._data[3*y+0]}getCodePoint(y){const g=this._data[3*y+0];return 2097152&g?this._combined[y].charCodeAt(this._combined[y].length-1):2097151&g}isCombined(y){return 2097152&this._data[3*y+0]}getString(y){const g=this._data[3*y+0];return 2097152&g?this._combined[y]:2097151&g?(0,f.stringFromCodePoint)(2097151&g):""}isProtected(y){return 536870912&this._data[3*y+2]}loadCell(y,g){return m=3*y,g.content=this._data[m+0],g.fg=this._data[m+1],g.bg=this._data[m+2],2097152&g.content&&(g.combinedData=this._combined[y]),268435456&g.bg&&(g.extended=this._extendedAttrs[y]),g}setCell(y,g){2097152&g.content&&(this._combined[y]=g.combinedData),268435456&g.bg&&(this._extendedAttrs[y]=g.extended),this._data[3*y+0]=g.content,this._data[3*y+1]=g.fg,this._data[3*y+2]=g.bg}setCellFromCodepoint(y,g,p,x){268435456&x.bg&&(this._extendedAttrs[y]=x.extended),this._data[3*y+0]=g|p<<22,this._data[3*y+1]=x.fg,this._data[3*y+2]=x.bg}addCodepointToCell(y,g,p){let x=this._data[3*y+0];2097152&x?this._combined[y]+=(0,f.stringFromCodePoint)(g):2097151&x?(this._combined[y]=(0,f.stringFromCodePoint)(2097151&x)+(0,f.stringFromCodePoint)(g),x&=-2097152,x|=2097152):x=g|4194304,p&&(x&=-12582913,x|=p<<22),this._data[3*y+0]=x}insertCells(y,g,p){if((y%=this.length)&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y-1,0,1,p),g=0;--b)this.setCell(y+g+b,this.loadCell(y+b,x));for(let b=0;bthis.length){if(this._data.buffer.byteLength>=4*p)this._data=new Uint32Array(this._data.buffer,0,p);else{const x=new Uint32Array(p);x.set(this._data),this._data=x}for(let x=this.length;x=y&&delete this._combined[C]}const b=Object.keys(this._extendedAttrs);for(let S=0;S=y&&delete this._extendedAttrs[C]}}return this.length=y,4*p*2=0;--y)if(4194303&this._data[3*y+0])return y+(this._data[3*y+0]>>22);return 0}getNoBgTrimmedLength(){for(let y=this.length-1;y>=0;--y)if(4194303&this._data[3*y+0]||50331648&this._data[3*y+2])return y+(this._data[3*y+0]>>22);return 0}copyCellsFrom(y,g,p,x,b){const S=y._data;if(b)for(let E=x-1;E>=0;E--){for(let k=0;k<3;k++)this._data[3*(p+E)+k]=S[3*(g+E)+k];268435456&S[3*(g+E)+2]&&(this._extendedAttrs[p+E]=y._extendedAttrs[g+E])}else for(let E=0;E=g&&(this._combined[k-g+p]=y._combined[k])}}translateToString(y,g,p,x){g=g??0,p=p??this.length,y&&(p=Math.min(p,this.getTrimmedLength())),x&&(x.length=0);let b="";for(;g>22||1}return x&&x.push(g),b}}o.BufferLine=_},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,h,d){if(h===c.length-1)return c[h].getTrimmedLength();const f=!c[h].hasContent(d-1)&&c[h].getWidth(d-1)===1,m=c[h+1].getWidth(0)===2;return f&&m?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(c,h,d,f,m){const _=[];for(let v=0;v=v&&f0&&(k>x||p[k].getTrimmedLength()===0);k--)E++;E>0&&(_.push(v+p.length-E),_.push(E)),v+=p.length-1}return _},o.reflowLargerCreateNewLayout=function(c,h){const d=[];let f=0,m=h[f],_=0;for(let v=0;vl(c,p,h)).reduce((g,p)=>g+p);let _=0,v=0,y=0;for(;yg&&(_-=g,v++);const p=c[v].getWidth(_-1)===2;p&&_--;const x=p?d-1:d;f.push(x),y+=x}return f},o.getWrappedLineTrimmedLength=l},5295:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const c=l(8460),h=l(844),d=l(9092);class f extends h.Disposable{constructor(_,v){super(),this._optionsService=_,this._bufferService=v,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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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(_){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(_),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(_,v){this._normal.resize(_,v),this._alt.resize(_,v),this.setupTabStops(_)}setupTabStops(_){this._normal.setupTabStops(_),this._alt.setupTabStops(_)}}o.BufferSet=f},511:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const c=l(482),h=l(643),d=l(3734);class f extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const v=new f;return v.setFromCharData(_),v}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(_){this.fg=_[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(_[h.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(_[h.CHAR_DATA_CHAR_INDEX].length===2){const y=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const g=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(y-55296)+g-56320+65536|_[h.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[h.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=_[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},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),h=l(844);class d{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=d._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,h.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}o.Marker=d,d._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,h;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=` `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(l||(o.C0=l={})),function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"}(c||(o.C1=c={})),function(d){d.ST=`${l.ESC}\\`}(h||(o.C1_ESCAPED=h={}))},7399:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const c=l(2584),h={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(d,f,m,_){const v={type:0,cancel:!1,key:void 0},y=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?v.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?v.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?v.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(v.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:v.key=d.ctrlKey?"\b":c.C0.DEL,d.altKey&&(v.key=c.C0.ESC+v.key);break;case 9:if(d.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=d.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,d.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(d.metaKey)break;y?(v.key=c.C0.ESC+"[1;"+(y+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(m?"b":"[1;5D"))):v.key=f?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(d.metaKey)break;y?(v.key=c.C0.ESC+"[1;"+(y+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(m?"f":"[1;5C"))):v.key=f?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(d.metaKey)break;y?(v.key=c.C0.ESC+"[1;"+(y+1)+"A",m||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=f?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(d.metaKey)break;y?(v.key=c.C0.ESC+"[1;"+(y+1)+"B",m||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=f?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=y?c.C0.ESC+"[3;"+(y+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=y?c.C0.ESC+"[1;"+(y+1)+"H":f?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=y?c.C0.ESC+"[1;"+(y+1)+"F":f?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:d.shiftKey?v.type=2:d.ctrlKey?v.key=c.C0.ESC+"[5;"+(y+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:d.shiftKey?v.type=3:d.ctrlKey?v.key=c.C0.ESC+"[6;"+(y+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=y?c.C0.ESC+"[1;"+(y+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=y?c.C0.ESC+"[1;"+(y+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=y?c.C0.ESC+"[1;"+(y+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=y?c.C0.ESC+"[1;"+(y+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=y?c.C0.ESC+"[15;"+(y+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=y?c.C0.ESC+"[17;"+(y+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=y?c.C0.ESC+"[18;"+(y+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=y?c.C0.ESC+"[19;"+(y+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=y?c.C0.ESC+"[20;"+(y+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=y?c.C0.ESC+"[21;"+(y+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=y?c.C0.ESC+"[23;"+(y+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=y?c.C0.ESC+"[24;"+(y+1)+"~":c.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(m&&!_||!d.altKey||d.metaKey)!m||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?v.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(v.key=c.C0.US),d.key==="@"&&(v.key=c.C0.NUL)):d.keyCode===65&&(v.type=1);else{const g=h[d.keyCode],p=g==null?void 0:g[d.shiftKey?1:0];if(p)v.key=c.C0.ESC+p;else if(d.keyCode>=65&&d.keyCode<=90){const x=d.ctrlKey?d.keyCode-64:d.keyCode+32;let b=String.fromCharCode(x);d.shiftKey&&(b=b.toUpperCase()),v.key=c.C0.ESC+b}else if(d.keyCode===32)v.key=c.C0.ESC+(d.ctrlKey?c.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let x=d.code.slice(3,4);d.shiftKey||(x=x.toLowerCase()),v.key=c.C0.ESC+x,v.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?v.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?v.key=c.C0.NUL:d.keyCode>=51&&d.keyCode<=55?v.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?v.key=c.C0.DEL:d.keyCode===219?v.key=c.C0.ESC:d.keyCode===220?v.key=c.C0.FS:d.keyCode===221&&(v.key=c.C0.GS)}return v}},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,h=l.length){let d="";for(let f=c;f65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const h=l.length;if(!h)return 0;let d=0,f=0;if(this._interim){const m=l.charCodeAt(f++);56320<=m&&m<=57343?c[d++]=1024*(this._interim-55296)+m-56320+65536:(c[d++]=this._interim,c[d++]=m),this._interim=0}for(let m=f;m=h)return this._interim=_,d;const v=l.charCodeAt(m);56320<=v&&v<=57343?c[d++]=1024*(_-55296)+v-56320+65536:(c[d++]=_,c[d++]=v)}else _!==65279&&(c[d++]=_)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const h=l.length;if(!h)return 0;let d,f,m,_,v=0,y=0,g=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let C,E=0;for(;(C=63&this.interim[++E])&&E<4;)S<<=6,S|=C;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;g=h)return 0;if(C=l[g++],(192&C)!=128){g--,b=!0;break}this.interim[E++]=C,S<<=6,S|=63&C}b||(k===2?S<128?g--:c[v++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(c[v++]=S):S<65536||S>1114111||(c[v++]=S)),this.interim.fill(0)}const p=h-4;let x=g;for(;x=h)return this.interim[0]=d,v;if(f=l[x++],(192&f)!=128){x--;continue}if(y=(31&d)<<6|63&f,y<128){x--;continue}c[v++]=y}else if((240&d)==224){if(x>=h)return this.interim[0]=d,v;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,v;if(m=l[x++],(192&m)!=128){x--;continue}if(y=(15&d)<<12|(63&f)<<6|63&m,y<2048||y>=55296&&y<=57343||y===65279)continue;c[v++]=y}else if((248&d)==240){if(x>=h)return this.interim[0]=d,v;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,v;if(m=l[x++],(192&m)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,this.interim[2]=m,v;if(_=l[x++],(192&_)!=128){x--;continue}if(y=(7&d)<<18|(63&f)<<12|(63&m)<<6|63&_,y<65536||y>1114111)continue;c[v++]=y}}return v}}},225:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const c=l(1480),h=[[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]],d=[[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 f;o.UnicodeV6=class{constructor(){if(this.version="6",!f){f=new Uint8Array(65536),f.fill(1),f[0]=0,f.fill(0,1,32),f.fill(0,127,160),f.fill(2,4352,4448),f[9001]=2,f[9002]=2,f.fill(2,11904,42192),f[12351]=1,f.fill(2,44032,55204),f.fill(2,63744,64256),f.fill(2,65040,65050),f.fill(2,65072,65136),f.fill(2,65280,65377),f.fill(2,65504,65511);for(let m=0;mv[p][1])return!1;for(;p>=g;)if(y=g+p>>1,_>v[y][1])g=y+1;else{if(!(_=131072&&m<=196605||m>=196608&&m<=262141?2:1}charProperties(m,_){let v=this.wcwidth(m),y=v===0&&_!==0;if(y){const g=c.UnicodeService.extractWidth(_);g===0?y=!1:g>v&&(v=g)}return c.UnicodeService.createPropertyValue(0,v,y)}}},5981:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const c=l(8460),h=l(844);class d extends h.Disposable{constructor(m){super(),this._action=m,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(m,_){if(_!==void 0&&this._syncCalls>_)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const y=this._callbacks.shift();y&&y()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,_){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+=m.length,this._writeBuffer.push(m),this._callbacks.push(_),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(_)}_innerWrite(m=0,_=!0){const v=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const y=this._writeBuffer[this._bufferOffset],g=this._action(y,_);if(g){const x=b=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,b)):this._innerWrite(v,b);return void g.catch(b=>(queueMicrotask(()=>{throw b}),Promise.resolve(!1))).then(x)}const p=this._callbacks[this._bufferOffset];if(p&&p(),this._bufferOffset++,this._pendingData-=y.length,Date.now()-v>=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=d},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 h(d,f){const m=d.toString(16),_=m.length<2?"0"+m:m;switch(f){case 4:return m[0];case 8:return _;case 12:return(_+_).slice(0,3);default:return _+_}}o.parseColor=function(d){if(!d)return;let f=d.toLowerCase();if(f.indexOf("rgb:")===0){f=f.slice(4);const m=l.exec(f);if(m){const _=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/_*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/_*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/_*255)]}}else if(f.indexOf("#")===0&&(f=f.slice(1),c.exec(f)&&[3,6,9,12].includes(f.length))){const m=f.length/3,_=[0,0,0];for(let v=0;v<3;++v){const y=parseInt(f.slice(m*v,m*v+m),16);_[v]=m===1?y<<4:m===2?y:m===3?y>>4:y>>8}return _}},o.toRgbString=function(d,f=16){const[m,_,v]=d;return`rgb:${h(m,f)}/${h(_,f)}/${h(v,f)}`}},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),h=l(8742),d=l(5770),f=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=f}registerHandler(_,v){this._handlers[_]===void 0&&(this._handlers[_]=[]);const y=this._handlers[_];return y.push(v),{dispose:()=>{const g=y.indexOf(v);g!==-1&&y.splice(g,1)}}}clearHandler(_){this._handlers[_]&&delete this._handlers[_]}setHandlerFallback(_){this._handlerFb=_}reset(){if(this._active.length)for(let _=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;_>=0;--_)this._active[_].unhook(!1);this._stack.paused=!1,this._active=f,this._ident=0}hook(_,v){if(this.reset(),this._ident=_,this._active=this._handlers[_]||f,this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(_,v,y){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(_,v,y);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(_,v,y))}unhook(_,v=!0){if(this._active.length){let y=!1,g=this._active.length-1,p=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,y=v,p=this._stack.fallThrough,this._stack.paused=!1),!p&&y===!1){for(;g>=0&&(y=this._active[g].unhook(_),y!==!0);g--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,y;g--}for(;g>=0;g--)if(y=this._active[g].unhook(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,y}else this._handlerFb(this._ident,"UNHOOK",_);this._active=f,this._ident=0}};const m=new h.Params;m.addParam(0),o.DcsHandler=class{constructor(_){this._handler=_,this._data="",this._params=m,this._hitLimit=!1}hook(_){this._params=_.length>1||_.params[0]?_.clone():m,this._data="",this._hitLimit=!1}put(_,v,y){this._hitLimit||(this._data+=(0,c.utf32ToString)(_,v,y),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(_){let v=!1;if(this._hitLimit)v=!1;else if(_&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(y=>(this._params=m,this._data="",this._hitLimit=!1,y));return this._params=m,this._data="",this._hitLimit=!1,v}}},2015:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const c=l(844),h=l(8742),d=l(6242),f=l(6351);class m{constructor(g){this.table=new Uint8Array(g)}setDefault(g,p){this.table.fill(g<<4|p)}add(g,p,x,b){this.table[p<<8|g]=x<<4|b}addMany(g,p,x,b){for(let S=0;Sk),p=(E,k)=>g.slice(E,k),x=p(32,127),b=p(0,24);b.push(25),b.push.apply(b,p(28,32));const S=p(0,14);let C;for(C in y.setDefault(1,0),y.addMany(x,0,2,0),S)y.addMany([24,26,153,154],C,3,0),y.addMany(p(128,144),C,3,0),y.addMany(p(144,152),C,3,0),y.add(156,C,0,0),y.add(27,C,11,1),y.add(157,C,4,8),y.addMany([152,158,159],C,0,7),y.add(155,C,11,3),y.add(144,C,11,9);return y.addMany(b,0,3,0),y.addMany(b,1,3,1),y.add(127,1,0,1),y.addMany(b,8,0,8),y.addMany(b,3,3,3),y.add(127,3,0,3),y.addMany(b,4,3,4),y.add(127,4,0,4),y.addMany(b,6,3,6),y.addMany(b,5,3,5),y.add(127,5,0,5),y.addMany(b,2,3,2),y.add(127,2,0,2),y.add(93,1,4,8),y.addMany(x,8,5,8),y.add(127,8,5,8),y.addMany([156,27,24,26,7],8,6,0),y.addMany(p(28,32),8,0,8),y.addMany([88,94,95],1,0,7),y.addMany(x,7,0,7),y.addMany(b,7,0,7),y.add(156,7,0,0),y.add(127,7,0,7),y.add(91,1,11,3),y.addMany(p(64,127),3,7,0),y.addMany(p(48,60),3,8,4),y.addMany([60,61,62,63],3,9,4),y.addMany(p(48,60),4,8,4),y.addMany(p(64,127),4,7,0),y.addMany([60,61,62,63],4,0,6),y.addMany(p(32,64),6,0,6),y.add(127,6,0,6),y.addMany(p(64,127),6,0,0),y.addMany(p(32,48),3,9,5),y.addMany(p(32,48),5,9,5),y.addMany(p(48,64),5,0,6),y.addMany(p(64,127),5,7,0),y.addMany(p(32,48),4,9,5),y.addMany(p(32,48),1,9,2),y.addMany(p(32,48),2,9,2),y.addMany(p(48,127),2,10,0),y.addMany(p(48,80),1,10,0),y.addMany(p(81,88),1,10,0),y.addMany([89,90,92],1,10,0),y.addMany(p(96,127),1,10,0),y.add(80,1,11,9),y.addMany(b,9,0,9),y.add(127,9,0,9),y.addMany(p(28,32),9,0,9),y.addMany(p(32,48),9,9,12),y.addMany(p(48,60),9,8,10),y.addMany([60,61,62,63],9,9,10),y.addMany(b,11,0,11),y.addMany(p(32,128),11,0,11),y.addMany(p(28,32),11,0,11),y.addMany(b,10,0,10),y.add(127,10,0,10),y.addMany(p(28,32),10,0,10),y.addMany(p(48,60),10,8,10),y.addMany([60,61,62,63],10,0,11),y.addMany(p(32,48),10,9,12),y.addMany(b,12,0,12),y.add(127,12,0,12),y.addMany(p(28,32),12,0,12),y.addMany(p(32,48),12,9,12),y.addMany(p(48,64),12,0,11),y.addMany(p(64,127),12,12,13),y.addMany(p(64,127),10,12,13),y.addMany(p(64,127),9,12,13),y.addMany(b,13,13,13),y.addMany(x,13,13,13),y.add(127,13,0,13),y.addMany([27,156,24,26],13,14,0),y.add(_,0,2,0),y.add(_,8,5,8),y.add(_,6,0,6),y.add(_,11,0,11),y.add(_,13,13,13),y}();class v extends c.Disposable{constructor(g=o.VT500_TRANSITION_TABLE){super(),this._transitions=g,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(p,x,b)=>{},this._executeHandlerFb=p=>{},this._csiHandlerFb=(p,x)=>{},this._escHandlerFb=p=>{},this._errorHandlerFb=p=>p,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 d.OscParser),this._dcsParser=this.register(new f.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(g,p=[64,126]){let x=0;if(g.prefix){if(g.prefix.length>1)throw new Error("only one byte as prefix supported");if(x=g.prefix.charCodeAt(0),x&&60>x||x>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(g.intermediates){if(g.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;SC||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");x<<=8,x|=C}}if(g.final.length!==1)throw new Error("final must be a single byte");const b=g.final.charCodeAt(0);if(p[0]>b||b>p[1])throw new Error(`final must be in range ${p[0]} .. ${p[1]}`);return x<<=8,x|=b,x}identToString(g){const p=[];for(;g;)p.push(String.fromCharCode(255&g)),g>>=8;return p.reverse().join("")}setPrintHandler(g){this._printHandler=g}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(g,p){const x=this._identifier(g,[48,126]);this._escHandlers[x]===void 0&&(this._escHandlers[x]=[]);const b=this._escHandlers[x];return b.push(p),{dispose:()=>{const S=b.indexOf(p);S!==-1&&b.splice(S,1)}}}clearEscHandler(g){this._escHandlers[this._identifier(g,[48,126])]&&delete this._escHandlers[this._identifier(g,[48,126])]}setEscHandlerFallback(g){this._escHandlerFb=g}setExecuteHandler(g,p){this._executeHandlers[g.charCodeAt(0)]=p}clearExecuteHandler(g){this._executeHandlers[g.charCodeAt(0)]&&delete this._executeHandlers[g.charCodeAt(0)]}setExecuteHandlerFallback(g){this._executeHandlerFb=g}registerCsiHandler(g,p){const x=this._identifier(g);this._csiHandlers[x]===void 0&&(this._csiHandlers[x]=[]);const b=this._csiHandlers[x];return b.push(p),{dispose:()=>{const S=b.indexOf(p);S!==-1&&b.splice(S,1)}}}clearCsiHandler(g){this._csiHandlers[this._identifier(g)]&&delete this._csiHandlers[this._identifier(g)]}setCsiHandlerFallback(g){this._csiHandlerFb=g}registerDcsHandler(g,p){return this._dcsParser.registerHandler(this._identifier(g),p)}clearDcsHandler(g){this._dcsParser.clearHandler(this._identifier(g))}setDcsHandlerFallback(g){this._dcsParser.setHandlerFallback(g)}registerOscHandler(g,p){return this._oscParser.registerHandler(g,p)}clearOscHandler(g){this._oscParser.clearHandler(g)}setOscHandlerFallback(g){this._oscParser.setHandlerFallback(g)}setErrorHandler(g){this._errorHandler=g}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(g,p,x,b,S){this._parseStack.state=g,this._parseStack.handlers=p,this._parseStack.handlerPos=x,this._parseStack.transition=b,this._parseStack.chunkPos=S}parse(g,p,x){let b,S=0,C=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(x===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(x===!1&&T>-1){for(;T>=0&&(b=k[T](this._params),b!==!0);T--)if(b instanceof Promise)return this._parseStack.handlerPos=T,b}this._parseStack.handlers=[];break;case 4:if(x===!1&&T>-1){for(;T>=0&&(b=k[T](),b!==!0);T--)if(b instanceof Promise)return this._parseStack.handlerPos=T,b}this._parseStack.handlers=[];break;case 6:if(S=g[this._parseStack.chunkPos],b=this._dcsParser.unhook(S!==24&&S!==26,x),b)return b;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=g[this._parseStack.chunkPos],b=this._oscParser.end(S!==24&&S!==26,x),b)return b;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=E;k>4){case 2:for(let N=k+1;;++N){if(N>=p||(S=g[N])<32||S>126&&S<_){this._printHandler(g,k,N),k=N-1;break}if(++N>=p||(S=g[N])<32||S>126&&S<_){this._printHandler(g,k,N),k=N-1;break}if(++N>=p||(S=g[N])<32||S>126&&S<_){this._printHandler(g,k,N),k=N-1;break}if(++N>=p||(S=g[N])<32||S>126&&S<_){this._printHandler(g,k,N),k=N-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|S];let R=T?T.length-1:-1;for(;R>=0&&(b=T[R](this._params),b!==!0);R--)if(b instanceof Promise)return this._preserveStack(3,T,R,C,k),b;R<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++k47&&S<60);k--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const M=this._escHandlers[this._collect<<8|S];let D=M?M.length-1:-1;for(;D>=0&&(b=M[D](),b!==!0);D--)if(b instanceof Promise)return this._preserveStack(4,M,D,C,k),b;D<0&&this._escHandlerFb(this._collect<<8|S),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|S,this._params);break;case 13:for(let N=k+1;;++N)if(N>=p||(S=g[N])===24||S===26||S===27||S>127&&S<_){this._dcsParser.put(g,k,N),k=N-1;break}break;case 14:if(b=this._dcsParser.unhook(S!==24&&S!==26),b)return this._preserveStack(6,[],0,C,k),b;S===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 N=k+1;;N++)if(N>=p||(S=g[N])<32||S>127&&S<_){this._oscParser.put(g,k,N),k=N-1;break}break;case 6:if(b=this._oscParser.end(S!==24&&S!==26),b)return this._preserveStack(5,[],0,C,k),b;S===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}o.EscapeSequenceParser=v},6242:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const c=l(5770),h=l(482),d=[];o.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(f,m){this._handlers[f]===void 0&&(this._handlers[f]=[]);const _=this._handlers[f];return _.push(m),{dispose:()=>{const v=_.indexOf(m);v!==-1&&_.splice(v,1)}}}clearHandler(f){this._handlers[f]&&delete this._handlers[f]}setHandlerFallback(f){this._handlerFb=f}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let f=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;f>=0;--f)this._active[f].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].start();else this._handlerFb(this._id,"START")}_put(f,m,_){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(f,m,_);else this._handlerFb(this._id,"PUT",(0,h.utf32ToString)(f,m,_))}start(){this.reset(),this._state=1}put(f,m,_){if(this._state!==3){if(this._state===1)for(;m<_;){const v=f[m++];if(v===59){this._state=2,this._start();break}if(v<48||570&&this._put(f,m,_)}}end(f,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let _=!1,v=this._active.length-1,y=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,_=m,y=this._stack.fallThrough,this._stack.paused=!1),!y&&_===!1){for(;v>=0&&(_=this._active[v].end(f),_!==!0);v--)if(_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,_;v--}for(;v>=0;v--)if(_=this._active[v].end(!1),_ instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,_}else this._handlerFb(this._id,"END",f);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(f){this._handler=f,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(f,m,_){this._hitLimit||(this._data+=(0,h.utf32ToString)(f,m,_),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(f){let m=!1;if(this._hitLimit)m=!1;else if(f&&(m=this._handler(this._data),m instanceof Promise))return m.then(_=>(this._data="",this._hitLimit=!1,_));return this._data="",this._hitLimit=!1,m}}},8742:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const l=2147483647;class c{static fromArray(d){const f=new c;if(!d.length)return f;for(let m=Array.isArray(d[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new c(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let f=0;f>8,_=255&this._subParamsIdx[f];_-m>0&&d.push(Array.prototype.slice.call(this._subParams,m,_))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>l?l:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>l?l:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const f=this._subParamsIdx[d]>>8,m=255&this._subParamsIdx[d];return m-f>0?this._subParams.subarray(f,m):null}getSubParamsAll(){const d={};for(let f=0;f>8,_=255&this._subParamsIdx[f];_-m>0&&(d[f]=this._subParams.slice(m,_))}return d}addDigit(d){let f;if(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,_=m[f-1];m[f-1]=~_?Math.min(10*_+d,l):d}}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 h={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(h),c.dispose=()=>this._wrappedAddonDispose(h),c.activate(l)}_wrappedAddonDispose(l){if(l.isDisposed)return;let c=-1;for(let h=0;h{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const c=l(3785),h=l(511);o.BufferApiView=class{constructor(d,f){this._buffer=d,this.type=f}init(d){return this._buffer=d,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(d){const f=this._buffer.lines.get(d);if(f)return new c.BufferLineApiView(f)}getNullCell(){return new h.CellData}}},3785:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const c=l(511);o.BufferLineApiView=class{constructor(h){this._line=h}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(h,d){if(!(h<0||h>=this._line.length))return d?(this._line.loadCell(h,d),d):this._line.loadCell(h,new c.CellData)}translateToString(h,d,f){return this._line.translateToString(h,d,f)}}},8285:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const c=l(8771),h=l(8460),d=l(844);class f extends d.Disposable{constructor(_){super(),this._core=_,this._onBufferChange=this.register(new h.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=f},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,h=>c(h.toArray()))}addCsiHandler(l,c){return this.registerCsiHandler(l,c)}registerDcsHandler(l,c){return this._core.registerDcsHandler(l,(h,d)=>c(h,d.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(y,g,p,x){var b,S=arguments.length,C=S<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(y,g,p,x);else for(var E=y.length-1;E>=0;E--)(b=y[E])&&(C=(S<3?b(C):S>3?b(g,p,C):b(g,p))||C);return S>3&&C&&Object.defineProperty(g,p,C),C},h=this&&this.__param||function(y,g){return function(p,x){g(p,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=l(8460),f=l(844),m=l(5295),_=l(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let v=o.BufferService=class extends f.Disposable{get buffer(){return this.buffers.active}constructor(y){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(y.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(y.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(y,this))}resize(y,g){this.cols=y,this.rows=g,this.buffers.resize(y,g),this._onResize.fire({cols:y,rows:g})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(y,g=!1){const p=this.buffer;let x;x=this._cachedBlankLine,x&&x.length===this.cols&&x.getFg(0)===y.fg&&x.getBg(0)===y.bg||(x=p.getBlankLine(y,g),this._cachedBlankLine=x),x.isWrapped=g;const b=p.ybase+p.scrollTop,S=p.ybase+p.scrollBottom;if(p.scrollTop===0){const C=p.lines.isFull;S===p.lines.length-1?C?p.lines.recycle().copyFrom(x):p.lines.push(x.clone()):p.lines.splice(S+1,0,x.clone()),C?this.isUserScrolling&&(p.ydisp=Math.max(p.ydisp-1,0)):(p.ybase++,this.isUserScrolling||p.ydisp++)}else{const C=S-b+1;p.lines.shiftElements(b+1,C-1,-1),p.lines.set(S,x.clone())}this.isUserScrolling||(p.ydisp=p.ybase),this._onScroll.fire(p.ydisp)}scrollLines(y,g,p){const x=this.buffer;if(y<0){if(x.ydisp===0)return;this.isUserScrolling=!0}else y+x.ydisp>=x.ybase&&(this.isUserScrolling=!1);const b=x.ydisp;x.ydisp=Math.max(Math.min(x.ydisp+y,x.ybase),0),b!==x.ydisp&&(g||this._onScroll.fire(x.ydisp))}};o.BufferService=v=c([h(0,_.IOptionsService)],v)},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(x,b,S,C){var E,k=arguments.length,T=k<3?b:C===null?C=Object.getOwnPropertyDescriptor(b,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,S,C);else for(var R=x.length-1;R>=0;R--)(E=x[R])&&(T=(k<3?E(T):k>3?E(b,S,T):E(b,S))||T);return k>3&&T&&Object.defineProperty(b,S,T),T},h=this&&this.__param||function(x,b){return function(S,C){b(S,C,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=l(2585),f=l(8460),m=l(844),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:x=>x.button!==4&&x.action===1&&(x.ctrl=!1,x.alt=!1,x.shift=!1,!0)},VT200:{events:19,restrict:x=>x.action!==32},DRAG:{events:23,restrict:x=>x.action!==32||x.button!==3},ANY:{events:31,restrict:x=>!0}};function v(x,b){let S=(x.ctrl?16:0)|(x.shift?4:0)|(x.alt?8:0);return x.button===4?(S|=64,S|=x.action):(S|=3&x.button,4&x.button&&(S|=64),8&x.button&&(S|=128),x.action===32?S|=32:x.action!==0||b||(S|=3)),S}const y=String.fromCharCode,g={DEFAULT:x=>{const b=[v(x,!1)+32,x.col+32,x.row+32];return b[0]>255||b[1]>255||b[2]>255?"":`\x1B[M${y(b[0])}${y(b[1])}${y(b[2])}`},SGR:x=>{const b=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${v(x,!0)};${x.col};${x.row}${b}`},SGR_PIXELS:x=>{const b=x.action===0&&x.button!==4?"m":"M";return`\x1B[<${v(x,!0)};${x.x};${x.y}${b}`}};let p=o.CoreMouseService=class extends m.Disposable{constructor(x,b){super(),this._bufferService=x,this._coreService=b,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new f.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(_))this.addProtocol(S,_[S]);for(const S of Object.keys(g))this.addEncoding(S,g[S]);this.reset()}addProtocol(x,b){this._protocols[x]=b}addEncoding(x,b){this._encodings[x]=b}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(x){if(!this._protocols[x])throw new Error(`unknown protocol "${x}"`);this._activeProtocol=x,this._onProtocolChange.fire(this._protocols[x].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(x){if(!this._encodings[x])throw new Error(`unknown encoding "${x}"`);this._activeEncoding=x}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(x){if(x.col<0||x.col>=this._bufferService.cols||x.row<0||x.row>=this._bufferService.rows||x.button===4&&x.action===32||x.button===3&&x.action!==32||x.button!==4&&(x.action===2||x.action===3)||(x.col++,x.row++,x.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,x,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(x))return!1;const b=this._encodings[this._activeEncoding](x);return b&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(b):this._coreService.triggerDataEvent(b,!0)),this._lastEvent=x,!0}explainEvents(x){return{down:!!(1&x),up:!!(2&x),drag:!!(4&x),move:!!(8&x),wheel:!!(16&x)}}_equalEvents(x,b,S){if(S){if(x.x!==b.x||x.y!==b.y)return!1}else if(x.col!==b.col||x.row!==b.row)return!1;return x.button===b.button&&x.action===b.action&&x.ctrl===b.ctrl&&x.alt===b.alt&&x.shift===b.shift}};o.CoreMouseService=p=c([h(0,d.IBufferService),h(1,d.ICoreService)],p)},6975:function(a,o,l){var c=this&&this.__decorate||function(p,x,b,S){var C,E=arguments.length,k=E<3?x:S===null?S=Object.getOwnPropertyDescriptor(x,b):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(p,x,b,S);else for(var T=p.length-1;T>=0;T--)(C=p[T])&&(k=(E<3?C(k):E>3?C(x,b,k):C(x,b))||k);return E>3&&k&&Object.defineProperty(x,b,k),k},h=this&&this.__param||function(p,x){return function(b,S){x(b,S,p)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=l(1439),f=l(8460),m=l(844),_=l(2585),v=Object.freeze({insertMode:!1}),y=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let g=o.CoreService=class extends m.Disposable{constructor(p,x,b){super(),this._bufferService=p,this._logService=x,this._optionsService=b,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new f.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new f.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(v),this.decPrivateModes=(0,d.clone)(y)}reset(){this.modes=(0,d.clone)(v),this.decPrivateModes=(0,d.clone)(y)}triggerDataEvent(p,x=!1){if(this._optionsService.rawOptions.disableStdin)return;const b=this._bufferService.buffer;x&&this._optionsService.rawOptions.scrollOnUserInput&&b.ybase!==b.ydisp&&this._onRequestScrollToBottom.fire(),x&&this._onUserInput.fire(),this._logService.debug(`sending data "${p}"`,()=>p.split("").map(S=>S.charCodeAt(0))),this._onData.fire(p)}triggerBinaryEvent(p){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${p}"`,()=>p.split("").map(x=>x.charCodeAt(0))),this._onBinary.fire(p))}};o.CoreService=g=c([h(0,_.IBufferService),h(1,_.ILogService),h(2,_.IOptionsService)],g)},9074:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const c=l(8055),h=l(8460),d=l(844),f=l(6106);let m=0,_=0;class v extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new f.SortedList(p=>p==null?void 0:p.marker.line),this._onDecorationRegistered=this.register(new h.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new h.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(p){if(p.marker.isDisposed)return;const x=new y(p);if(x){const b=x.marker.onDispose(()=>x.dispose());x.onDispose(()=>{x&&(this._decorations.delete(x)&&this._onDecorationRemoved.fire(x),b.dispose())}),this._decorations.insert(x),this._onDecorationRegistered.fire(x)}return x}reset(){for(const p of this._decorations.values())p.dispose();this._decorations.clear()}*getDecorationsAtCell(p,x,b){let S=0,C=0;for(const E of this._decorations.getKeyIterator(x))S=E.options.x??0,C=S+(E.options.width??1),p>=S&&p{m=C.options.x??0,_=m+(C.options.width??1),p>=m&&p<_&&(!b||(C.options.layer??"bottom")===b)&&S(C)})}}o.DecorationService=v;class y extends d.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(p){super(),this.options=p,this.onRenderEmitter=this.register(new h.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=p.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),h=l(8343);class d{constructor(...m){this._entries=new Map;for(const[_,v]of m)this.set(_,v)}set(m,_){const v=this._entries.get(m);return this._entries.set(m,_),v}forEach(m){for(const[_,v]of this._entries.entries())m(_,v)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(c.IInstantiationService,this)}setService(f,m){this._services.set(f,m)}getService(f){return this._services.get(f)}createInstance(f,...m){const _=(0,h.getServiceDependencies)(f).sort((g,p)=>g.index-p.index),v=[];for(const g of _){const p=this._services.get(g.id);if(!p)throw new Error(`[createInstance] ${f.name} depends on UNKNOWN service ${g.id}.`);v.push(p)}const y=_.length>0?_[0].index:m.length;if(m.length!==y)throw new Error(`[createInstance] First service dependency of ${f.name} at position ${y+1} conflicts with ${m.length} static arguments`);return new f(...m,...v)}}},7866:function(a,o,l){var c=this&&this.__decorate||function(y,g,p,x){var b,S=arguments.length,C=S<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(y,g,p,x);else for(var E=y.length-1;E>=0;E--)(b=y[E])&&(C=(S<3?b(C):S>3?b(g,p,C):b(g,p))||C);return S>3&&C&&Object.defineProperty(g,p,C),C},h=this&&this.__param||function(y,g){return function(p,x){g(p,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(844),f=l(2585),m={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let _,v=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),_=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let g=0;gJSON.stringify(C)).join(", ")})`);const S=x.apply(this,b);return _.trace(`GlyphRenderer#${x.name} return`,S),S}}},7302:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const c=l(8460),h=l(844),d=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:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const f=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends h.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const y={...o.DEFAULT_OPTIONS};for(const g in v)if(g in y)try{const p=v[g];y[g]=this._sanitizeAndValidateOption(g,p)}catch(p){console.error(p)}this.rawOptions=y,this.options={...y},this._setupOptions(),this.register((0,h.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,y){return this.onOptionChange(g=>{g===v&&y(this.rawOptions[v])})}onMultipleOptionChange(v,y){return this.onOptionChange(g=>{v.indexOf(g)!==-1&&y()})}_setupOptions(){const v=g=>{if(!(g in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);return this.rawOptions[g]},y=(g,p)=>{if(!(g in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${g}"`);p=this._sanitizeAndValidateOption(g,p),this.rawOptions[g]!==p&&(this.rawOptions[g]=p,this._onOptionChange.fire(g))};for(const g in this.rawOptions){const p={get:v.bind(this,g),set:y.bind(this,g)};Object.defineProperty(this.options,g,p)}}_sanitizeAndValidateOption(v,y){switch(v){case"cursorStyle":if(y||(y=o.DEFAULT_OPTIONS[v]),!function(g){return g==="block"||g==="underline"||g==="bar"}(y))throw new Error(`"${y}" is not a valid value for ${v}`);break;case"wordSeparator":y||(y=o.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof y=="number"&&1<=y&&y<=1e3)break;y=f.includes(y)?y:o.DEFAULT_OPTIONS[v];break;case"cursorWidth":y=Math.floor(y);case"lineHeight":case"tabStopWidth":if(y<1)throw new Error(`${v} cannot be less than 1, value: ${y}`);break;case"minimumContrastRatio":y=Math.max(1,Math.min(21,Math.round(10*y)/10));break;case"scrollback":if((y=Math.min(y,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${y}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(y<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${y}`);break;case"rows":case"cols":if(!y&&y!==0)throw new Error(`${v} must be numeric, value: ${y}`);break;case"windowsPty":y=y??{}}return y}}o.OptionsService=m},2660:function(a,o,l){var c=this&&this.__decorate||function(m,_,v,y){var g,p=arguments.length,x=p<3?_:y===null?y=Object.getOwnPropertyDescriptor(_,v):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(m,_,v,y);else for(var b=m.length-1;b>=0;b--)(g=m[b])&&(x=(p<3?g(x):p>3?g(_,v,x):g(_,v))||x);return p>3&&x&&Object.defineProperty(_,v,x),x},h=this&&this.__param||function(m,_){return function(v,y){_(v,y,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=l(2585);let f=o.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const _=this._bufferService.buffer;if(m.id===void 0){const b=_.addMarker(_.ybase+_.y),S={data:m,id:this._nextId++,lines:[b]};return b.onDispose(()=>this._removeMarkerFromLink(S,b)),this._dataByLinkId.set(S.id,S),S.id}const v=m,y=this._getEntryIdKey(v),g=this._entriesWithId.get(y);if(g)return this.addLineToLink(g.id,_.ybase+_.y),g.id;const p=_.addMarker(_.ybase+_.y),x={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(x,p)),this._entriesWithId.set(x.key,x),this._dataByLinkId.set(x.id,x),x.id}addLineToLink(m,_){const v=this._dataByLinkId.get(m);if(v&&v.lines.every(y=>y.line!==_)){const y=this._bufferService.buffer.addMarker(_);v.lines.push(y),y.onDispose(()=>this._removeMarkerFromLink(v,y))}}getLinkData(m){var _;return(_=this._dataByLinkId.get(m))==null?void 0:_.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,_){const v=m.lines.indexOf(_);v!==-1&&(m.lines.splice(v,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};o.OscLinkService=f=c([h(0,d.IBufferService)],f)},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(h){return h[c]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const d=function(f,m,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,y,g){y[l]===y?y[c].push({id:v,index:g}):(y[c]=[{id:v,index:g}],y[l]=y)})(d,f,_)};return d.toString=()=>h,o.serviceRegistry.set(h,d),d}},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 h;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(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(h||(o.LogLevelEnum=h={})),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),h=l(225);class d{static extractShouldJoin(m){return(1&m)!=0}static extractWidth(m){return m>>1&3}static extractCharKind(m){return m>>3}static createPropertyValue(m,_,v=!1){return(16777215&m)<<3|(3&_)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const m=new h.UnicodeV6;this.register(m),this._active=m.version,this._activeProvider=m}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(m){if(!this._providers[m])throw new Error(`unknown Unicode version "${m}"`);this._active=m,this._activeProvider=this._providers[m],this._onChange.fire(m)}register(m){this._providers[m.version]=m}wcwidth(m){return this._activeProvider.wcwidth(m)}getStringCellWidth(m){let _=0,v=0;const y=m.length;for(let g=0;g=y)return _+this.wcwidth(p);const S=m.charCodeAt(g);56320<=S&&S<=57343?p=1024*(p-55296)+S-56320+65536:_+=this.wcwidth(S)}const x=this.charProperties(p,v);let b=d.extractWidth(x);d.extractShouldJoin(x)&&(b-=d.extractWidth(v)),_+=b,v=x}return _}charProperties(m,_){return this._activeProvider.charProperties(m,_)}}o.UnicodeService=d}},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),h=i(5741),d=i(8285),f=i(7975),m=i(7090),_=["cols","rows"];class v extends c.Disposable{constructor(g){super(),this._core=this.register(new l.Terminal(g)),this._addonManager=this.register(new h.AddonManager),this._publicOptions={...this._core.options};const p=b=>this._core.options[b],x=(b,S)=>{this._checkReadonlyOptions(b),this._core.options[b]=S};for(const b in this._core.options){const S={get:p.bind(this,b),set:x.bind(this,b)};Object.defineProperty(this._publicOptions,b,S)}}_checkReadonlyOptions(g){if(_.includes(g))throw new Error(`Option "${g}" 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 f.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const g=this._core.coreService.decPrivateModes;let p="none";switch(this._core.coreMouseService.activeProtocol){case"X10":p="x10";break;case"VT200":p="vt200";break;case"DRAG":p="drag";break;case"ANY":p="any"}return{applicationCursorKeysMode:g.applicationCursorKeys,applicationKeypadMode:g.applicationKeypad,bracketedPasteMode:g.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:p,originMode:g.origin,reverseWraparoundMode:g.reverseWraparound,sendFocusMode:g.sendFocus,wraparoundMode:g.wraparound}}get options(){return this._publicOptions}set options(g){for(const p in g)this._publicOptions[p]=g[p]}blur(){this._core.blur()}focus(){this._core.focus()}input(g,p=!0){this._core.input(g,p)}resize(g,p){this._verifyIntegers(g,p),this._core.resize(g,p)}open(g){this._core.open(g)}attachCustomKeyEventHandler(g){this._core.attachCustomKeyEventHandler(g)}attachCustomWheelEventHandler(g){this._core.attachCustomWheelEventHandler(g)}registerLinkProvider(g){return this._core.registerLinkProvider(g)}registerCharacterJoiner(g){return this._checkProposedApi(),this._core.registerCharacterJoiner(g)}deregisterCharacterJoiner(g){this._checkProposedApi(),this._core.deregisterCharacterJoiner(g)}registerMarker(g=0){return this._verifyIntegers(g),this._core.registerMarker(g)}registerDecoration(g){return this._checkProposedApi(),this._verifyPositiveIntegers(g.x??0,g.width??0,g.height??0),this._core.registerDecoration(g)}hasSelection(){return this._core.hasSelection()}select(g,p,x){this._verifyIntegers(g,p,x),this._core.select(g,p,x)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(g,p){this._verifyIntegers(g,p),this._core.selectLines(g,p)}dispose(){super.dispose()}scrollLines(g){this._verifyIntegers(g),this._core.scrollLines(g)}scrollPages(g){this._verifyIntegers(g),this._core.scrollPages(g)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(g){this._verifyIntegers(g),this._core.scrollToLine(g)}clear(){this._core.clear()}write(g,p){this._core.write(g,p)}writeln(g,p){this._core.write(g),this._core.write(`\r `,p)}paste(g){this._core.paste(g)}refresh(g,p){this._verifyIntegers(g,p),this._core.refresh(g,p)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(g){this._addonManager.loadAddon(this,g)}static get strings(){return o}_verifyIntegers(...g){for(const p of g)if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...g){for(const p of g)if(p&&(p===1/0||isNaN(p)||p%1!=0||p<0))throw new Error("This API only accepts positive integers")}}a.Terminal=v})(),s})())})(sL);var aL=sL.exports,lL={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),h=l(627),d=l(237),f=l(860),m=l(374),_=l(296),v=l(345),y=l(859),g=l(399),p=l(855);class x extends y.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var C;return(C=this._charAtlas)==null?void 0:C.pages[0].canvas}constructor(C,E,k,T,R,M,D,N,L,P){super(),this._terminal=C,this._container=E,this._alpha=R,this._themeService=M,this._bufferService=D,this._optionsService=N,this._decorationService=L,this._coreBrowserService=P,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,_.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new y.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new v.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-${k}-layer`),this._canvas.style.zIndex=T.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors(I=>{this._refreshCharAtlas(I),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)})),this.register((0,y.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,m.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(C,E){}handleSelectionChanged(C,E,k=!1){this._selectionModel.update(this._terminal._core,C,E,k)}_setTransparency(C){if(C===this._alpha)return;const E=this._canvas;this._alpha=C,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,E),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(C){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,h.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,C,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,v.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let E=0;E1?this._charAtlas.getRasterizedGlyphCombinedChar(T,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(C.getCode()||p.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!D.size.x||!D.size.y)return;this._ctx.save(),this._clipRow(k),this._bitmapGenerator[D.texturePage]&&this._charAtlas.pages[D.texturePage].canvas!==this._bitmapGenerator[D.texturePage].canvas&&((P=(L=this._bitmapGenerator[D.texturePage])==null?void 0:L.bitmap)==null||P.close(),delete this._bitmapGenerator[D.texturePage]),this._charAtlas.pages[D.texturePage].version!==((I=this._bitmapGenerator[D.texturePage])==null?void 0:I.version)&&(this._bitmapGenerator[D.texturePage]||(this._bitmapGenerator[D.texturePage]=new b(this._charAtlas.pages[D.texturePage].canvas)),this._bitmapGenerator[D.texturePage].refresh(),this._bitmapGenerator[D.texturePage].version=this._charAtlas.pages[D.texturePage].version);let N=D.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,m.allowRescaling)(R,M,D.size.x,this._deviceCellWidth)&&(N=this._deviceCellWidth-1),this._ctx.drawImage(((z=this._bitmapGenerator[D.texturePage])==null?void 0:z.bitmap)||this._charAtlas.pages[D.texturePage].canvas,D.texturePosition.x,D.texturePosition.y,D.size.x,D.size.y,E*this._deviceCellWidth+this._deviceCharLeft-D.offset.x,k*this._deviceCellHeight+this._deviceCharTop-D.offset.y,N,D.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,E){return`${E?"italic":""} ${C?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}o.BaseRenderLayer=x;class b{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,g.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(E=>{this._state===2?this.refresh():this._bitmap=E,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),h=l(56),d=l(374),f=l(345),m=l(859),_=l(873),v=l(43),y=l(630),g=l(744);class p extends m.Disposable{constructor(b,S,C,E,k,T,R,M,D,N,L){super(),this._terminal=b,this._screenElement=S,this._bufferService=E,this._charSizeService=k,this._optionsService=T,this._coreBrowserService=D,this._themeService=L,this._observerDisposable=this.register(new m.MutableDisposable),this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const P=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new g.TextRenderLayer(this._terminal,this._screenElement,0,P,this._bufferService,this._optionsService,R,N,this._coreBrowserService,L),new y.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,N,this._optionsService,L),new v.LinkRenderLayer(this._terminal,this._screenElement,2,C,this._bufferService,this._optionsService,N,this._coreBrowserService,L),new _.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,M,this._coreBrowserService,N,L)];for(const I of this._renderLayers)(0,f.forwardEvent)(I.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,d.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,h.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,(I,z)=>this._setCanvasDevicePixelDimensions(I,z)),this.register(this._coreBrowserService.onWindowChange(I=>{this._observerDisposable.value=(0,h.observeDevicePixelDimensions)(this._renderLayers[0].canvas,I,(z,O)=>this._setCanvasDevicePixelDimensions(z,O))})),this.register((0,m.toDisposable)(()=>{for(const I of this._renderLayers)I.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(b,S){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(b=>b.handleBlur())}handleFocus(){this._runOperation(b=>b.handleFocus())}handleSelectionChanged(b,S,C=!1){this._runOperation(E=>E.handleSelectionChanged(b,S,C)),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation(b=>b.handleCursorMove())}clear(){this._runOperation(b=>b.reset())}_runOperation(b){for(const S of this._renderLayers)b(S)}renderRows(b,S){for(const C of this._renderLayers)C.handleGridChanged(b,S)}clearTextureAtlas(){for(const b of this._renderLayers)b.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const b=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*b),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*b),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/b),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/b),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(b,S){this.dimensions.device.canvas.height=S,this.dimensions.device.canvas.width=b;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=p},873:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CursorRenderLayer=void 0;const c=l(457),h=l(859),d=l(399),f=l(782),m=l(903);class _ extends m.BaseRenderLayer{constructor(y,g,p,x,b,S,C,E,k,T){super(y,g,"cursor",p,!0,T,b,S,k,E),this._onRequestRedraw=x,this._coreService=C,this._cursorBlinkStateManager=this.register(new h.MutableDisposable),this._cell=new f.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(S.onOptionChange(()=>this._handleOptionsChanged())),this._handleOptionsChanged()}resize(y){super.resize(y),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var y;this._clearCursor(),(y=this._cursorBlinkStateManager.value)==null||y.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var y;(y=this._cursorBlinkStateManager.value)==null||y.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var y;(y=this._cursorBlinkStateManager.value)==null||y.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 y;(y=this._cursorBlinkStateManager.value)==null||y.restartBlinkAnimation()}handleGridChanged(y,g){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(y){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const g=this._bufferService.buffer.ybase+this._bufferService.buffer.y,p=g-this._bufferService.buffer.ydisp;if(p<0||p>=this._bufferService.rows)return void this._clearCursor();const x=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(g).loadCell(x,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 b=this._optionsService.rawOptions.cursorStyle,S=this._optionsService.rawOptions.cursorInactiveStyle;return S&&S!=="none"&&this._cursorRenderers[S](x,p,this._cell),this._ctx.restore(),this._state.x=x,this._state.y=p,this._state.isFocused=!1,this._state.style=b,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===x&&this._state.y===p&&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"](x,p,this._cell),this._ctx.restore(),this._state.x=x,this._state.y=p,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(d.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(y,g,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(y,g,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(y,g,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(y,g,p.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(p,y,g),this._ctx.restore()}_renderUnderlineCursor(y,g,p){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(y,g),this._ctx.restore()}_renderOutlineCursor(y,g,p){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(y,g,p.getWidth(),1),this._ctx.restore()}}o.CursorRenderLayer=_},574:(a,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.GridCache=void 0,o.GridCache=class{constructor(){this.cache=[]}resize(l,c){for(let h=0;h{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkRenderLayer=void 0;const c=l(197),h=l(237),d=l(903);class f extends d.BaseRenderLayer{constructor(_,v,y,g,p,x,b,S,C){super(_,v,"link",y,!0,C,p,x,b,S),this.register(g.onShowLinkUnderline(E=>this._handleShowLinkUnderline(E))),this.register(g.onHideLinkUnderline(E=>this._handleHideLinkUnderline(E)))}resize(_){super.resize(_),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 _=this._state.y2-this._state.y1-1;_>0&&this._clearCells(0,this._state.y1+1,this._state.cols,_),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(_){if(_.fg===h.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:_.fg&&(0,c.is256Color)(_.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[_.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,_.y1===_.y2)this._fillBottomLineAtCells(_.x1,_.y1,_.x2-_.x1);else{this._fillBottomLineAtCells(_.x1,_.y1,_.cols-_.x1);for(let v=_.y1+1;v<_.y2;v++)this._fillBottomLineAtCells(0,v,_.cols);this._fillBottomLineAtCells(0,_.y2,_.x2)}this._state=_}_handleHideLinkUnderline(_){this._clearCurrentLink()}}o.LinkRenderLayer=f},630:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionRenderLayer=void 0;const c=l(903);class h extends c.BaseRenderLayer{constructor(f,m,_,v,y,g,p,x){super(f,m,"selection",_,!0,x,v,p,g,y),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(f){super.resize(f),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(f,m,_){super.handleSelectionChanged(f,m,_),this._redrawSelection(f,m,_)}_redrawSelection(f,m,_){if(!this._didStateChange(f,m,_,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!f||!m)return void this._clearState();const v=f[1]-this._bufferService.buffer.ydisp,y=m[1]-this._bufferService.buffer.ydisp,g=Math.max(v,0),p=Math.min(y,this._bufferService.rows-1);if(g>=this._bufferService.rows||p<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,_){const x=f[0],b=m[0]-x,S=p-g+1;this._fillCells(x,g,b,S)}else{const x=v===g?f[0]:0,b=g===y?m[0]:this._bufferService.cols;this._fillCells(x,g,b-x,1);const S=Math.max(p-g-1,0);if(this._fillCells(0,g+1,this._bufferService.cols,S),g!==p){const C=y===p?m[0]:this._bufferService.cols;this._fillCells(0,p,C,1)}}this._state.start=[f[0],f[1]],this._state.end=[m[0],m[1]],this._state.columnSelectMode=_,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(f,m,_,v){return!this._areCoordinatesEqual(f,this._state.start)||!this._areCoordinatesEqual(m,this._state.end)||_!==this._state.columnSelectMode||v!==this._state.ydisp}_areCoordinatesEqual(f,m){return!(!f||!m)&&f[0]===m[0]&&f[1]===m[1]}}o.SelectionRenderLayer=h},744:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TextRenderLayer=void 0;const c=l(577),h=l(147),d=l(782),f=l(855),m=l(903),_=l(574);class v extends m.BaseRenderLayer{constructor(g,p,x,b,S,C,E,k,T,R){super(g,p,"text",x,b,R,S,C,k,T),this._characterJoinerService=E,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new d.CellData,this._state=new _.GridCache,this.register(C.onSpecificOptionChange("allowTransparency",M=>this._setTransparency(M)))}resize(g){super.resize(g);const p=this._getFont(!1,!1);this._characterWidth===g.device.char.width&&this._characterFont===p||(this._characterWidth=g.device.char.width,this._characterFont=p,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(g,p,x){for(let b=g;b<=p;b++){const S=b+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(S),E=this._characterJoinerService.getJoinedCharacters(S);for(let k=0;k0&&k===E[0][0]){R=!0;const D=E.shift();T=new c.JoinedCellData(this._workCell,C.translateToString(!0,D[0],D[1]),D[1]-D[0]),M=D[1]-1}!R&&this._isOverlapping(T)&&M{let M=null;k.isInverse()?M=k.isFgDefault()?this._themeService.colors.foreground.css:k.isFgRGB()?`rgb(${h.AttributeData.toColorRGB(k.getFgColor()).join(",")})`:this._themeService.colors.ansi[k.getFgColor()].css:k.isBgRGB()?M=`rgb(${h.AttributeData.toColorRGB(k.getBgColor()).join(",")})`:k.isBgPalette()&&(M=this._themeService.colors.ansi[k.getBgColor()].css);let D=!1;this._decorationService.forEachDecorationAtCell(T,this._bufferService.buffer.ydisp+R,void 0,N=>{N.options.layer!=="top"&&D||(N.backgroundColorRGB&&(M=N.backgroundColorRGB.css),D=N.options.layer==="top")}),E===null&&(S=T,C=R),R!==C?(x.fillStyle=E||"",this._fillCells(S,C,b-S,1),S=T,C=R):E!==M&&(x.fillStyle=E||"",this._fillCells(S,C,T-S,1),S=T,C=R),E=M}),E!==null&&(x.fillStyle=E,this._fillCells(S,C,b-S,1)),x.restore()}_drawForeground(g,p){this._forEachCell(g,p,(x,b,S)=>this._drawChars(x,b,S))}handleGridChanged(g,p){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,g,this._bufferService.cols,p-g+1),this._drawBackground(g,p),this._drawForeground(g,p))}_isOverlapping(g){if(g.getWidth()!==1||g.getCode()<256)return!1;const p=g.getChars();if(this._characterOverlapCache.hasOwnProperty(p))return this._characterOverlapCache[p];this._ctx.save(),this._ctx.font=this._characterFont;const x=Math.floor(this._ctx.measureText(p).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[p]=x,x}}o.TextRenderLayer=v},274:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellColorResolver=void 0;const c=l(855),h=l(160),d=l(374);let f,m=0,_=0,v=!1,y=!1,g=!1,p=0;o.CellColorResolver=class{constructor(x,b,S,C,E,k){this._terminal=x,this._optionService=b,this._selectionRenderModel=S,this._decorationService=C,this._coreBrowserService=E,this._themeService=k,this.result={fg:0,bg:0,ext:0}}resolve(x,b,S,C){if(this.result.bg=x.bg,this.result.fg=x.fg,this.result.ext=268435456&x.bg?x.extended.ext:0,_=0,m=0,y=!1,v=!1,g=!1,f=this._themeService.colors,p=0,x.getCode()!==c.NULL_CELL_CODE&&x.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));p=b*C%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(b,S,"bottom",E=>{E.backgroundColorRGB&&(_=E.backgroundColorRGB.rgba>>8&16777215,y=!0),E.foregroundColorRGB&&(m=E.foregroundColorRGB.rgba>>8&16777215,v=!0)}),g=this._selectionRenderModel.isCellSelected(this._terminal,b,S),g){if(67108864&this.result.fg||50331648&this.result.bg){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:_=(16777215&this.result.fg)<<8|255;break;default:_=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:_=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:_=(16777215&this.result.bg)<<8|255}_=h.rgba.blend(_,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else _=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(y=!0,f.selectionForeground&&(m=f.selectionForeground.rgba>>8&16777215,v=!0),(0,d.treatGlyphAsBackgroundColor)(x.getCode())){if(67108864&this.result.fg&&!(50331648&this.result.bg))m=(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:m=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:m=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:m=(16777215&this.result.fg)<<8|255;break;default:m=this._themeService.colors.foreground.rgba}m=h.rgba.blend(m,4294967040&(this._coreBrowserService.isFocused?f.selectionBackgroundOpaque:f.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}v=!0}}this._decorationService.forEachDecorationAtCell(b,S,"top",E=>{E.backgroundColorRGB&&(_=E.backgroundColorRGB.rgba>>8&16777215,y=!0),E.foregroundColorRGB&&(m=E.foregroundColorRGB.rgba>>8&16777215,v=!0)}),y&&(_=g?-16777216&x.bg&-134217729|_|50331648:-16777216&x.bg|_|50331648),v&&(m=-16777216&x.fg&-67108865|m|50331648),67108864&this.result.fg&&(y&&!v&&(m=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&f.background.rgba>>8|50331648,v=!0),!y&&v&&(_=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&f.foreground.rgba>>8|50331648,y=!0)),f=void 0,this.result.bg=y?_:this.result.bg,this.result.fg=v?m:this.result.fg,this.result.ext&=536870911,this.result.ext|=p<<29&3758096384}}},627:(a,o,l)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.removeTerminalFromCache=o.acquireTextureAtlas=void 0;const c=l(509),h=l(197),d=[];o.acquireTextureAtlas=function(f,m,_,v,y,g,p,x){const b=(0,h.generateConfig)(v,y,g,p,m,_,x);for(let E=0;E=0){if((0,h.configEquals)(k.config,b))return k.atlas;k.ownedBy.length===1?(k.atlas.dispose(),d.splice(E,1)):k.ownedBy.splice(T,1);break}}for(let E=0;E{Object.defineProperty(o,"__esModule",{value:!0}),o.is256Color=o.configEquals=o.generateConfig=void 0;const c=l(160);o.generateConfig=function(h,d,f,m,_,v,y){const g={foreground:v.foreground,background:v.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:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:_.customGlyphs,devicePixelRatio:y,letterSpacing:_.letterSpacing,lineHeight:_.lineHeight,deviceCellWidth:h,deviceCellHeight:d,deviceCharWidth:f,deviceCharHeight:m,fontFamily:_.fontFamily,fontSize:_.fontSize,fontWeight:_.fontWeight,fontWeightBold:_.fontWeightBold,allowTransparency:_.allowTransparency,drawBoldTextInBrightColors:_.drawBoldTextInBrightColors,minimumContrastRatio:_.minimumContrastRatio,colors:g}},o.configEquals=function(h,d){for(let f=0;f{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 h={"░":[[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:(v,y)=>`M0,${.5-y} L1,${.5-y} M0,${.5+y} L1,${.5+y}`},"║":{1:(v,y)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╒":{1:(v,y)=>`M.5,1 L.5,${.5-y} L1,${.5-y} M.5,${.5+y} L1,${.5+y}`},"╓":{1:(v,y)=>`M${.5-v},1 L${.5-v},.5 L1,.5 M${.5+v},.5 L${.5+v},1`},"╔":{1:(v,y)=>`M1,${.5-y} L${.5-v},${.5-y} L${.5-v},1 M1,${.5+y} L${.5+v},${.5+y} L${.5+v},1`},"╕":{1:(v,y)=>`M0,${.5-y} L.5,${.5-y} L.5,1 M0,${.5+y} L.5,${.5+y}`},"╖":{1:(v,y)=>`M${.5+v},1 L${.5+v},.5 L0,.5 M${.5-v},.5 L${.5-v},1`},"╗":{1:(v,y)=>`M0,${.5+y} L${.5-v},${.5+y} L${.5-v},1 M0,${.5-y} L${.5+v},${.5-y} L${.5+v},1`},"╘":{1:(v,y)=>`M.5,0 L.5,${.5+y} L1,${.5+y} M.5,${.5-y} L1,${.5-y}`},"╙":{1:(v,y)=>`M1,.5 L${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╚":{1:(v,y)=>`M1,${.5-y} L${.5+v},${.5-y} L${.5+v},0 M1,${.5+y} L${.5-v},${.5+y} L${.5-v},0`},"╛":{1:(v,y)=>`M0,${.5+y} L.5,${.5+y} L.5,0 M0,${.5-y} L.5,${.5-y}`},"╜":{1:(v,y)=>`M0,.5 L${.5+v},.5 L${.5+v},0 M${.5-v},.5 L${.5-v},0`},"╝":{1:(v,y)=>`M0,${.5-y} L${.5-v},${.5-y} L${.5-v},0 M0,${.5+y} L${.5+v},${.5+y} L${.5+v},0`},"╞":{1:(v,y)=>`M.5,0 L.5,1 M.5,${.5-y} L1,${.5-y} M.5,${.5+y} L1,${.5+y}`},"╟":{1:(v,y)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1 M${.5+v},.5 L1,.5`},"╠":{1:(v,y)=>`M${.5-v},0 L${.5-v},1 M1,${.5+y} L${.5+v},${.5+y} L${.5+v},1 M1,${.5-y} L${.5+v},${.5-y} L${.5+v},0`},"╡":{1:(v,y)=>`M.5,0 L.5,1 M0,${.5-y} L.5,${.5-y} M0,${.5+y} L.5,${.5+y}`},"╢":{1:(v,y)=>`M0,.5 L${.5-v},.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╣":{1:(v,y)=>`M${.5+v},0 L${.5+v},1 M0,${.5+y} L${.5-v},${.5+y} L${.5-v},1 M0,${.5-y} L${.5-v},${.5-y} L${.5-v},0`},"╤":{1:(v,y)=>`M0,${.5-y} L1,${.5-y} M0,${.5+y} L1,${.5+y} M.5,${.5+y} L.5,1`},"╥":{1:(v,y)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},1 M${.5+v},.5 L${.5+v},1`},"╦":{1:(v,y)=>`M0,${.5-y} L1,${.5-y} M0,${.5+y} L${.5-v},${.5+y} L${.5-v},1 M1,${.5+y} L${.5+v},${.5+y} L${.5+v},1`},"╧":{1:(v,y)=>`M.5,0 L.5,${.5-y} M0,${.5-y} L1,${.5-y} M0,${.5+y} L1,${.5+y}`},"╨":{1:(v,y)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╩":{1:(v,y)=>`M0,${.5+y} L1,${.5+y} M0,${.5-y} L${.5-v},${.5-y} L${.5-v},0 M1,${.5-y} L${.5+v},${.5-y} L${.5+v},0`},"╪":{1:(v,y)=>`M.5,0 L.5,1 M0,${.5-y} L1,${.5-y} M0,${.5+y} L1,${.5+y}`},"╫":{1:(v,y)=>`M0,.5 L1,.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╬":{1:(v,y)=>`M0,${.5+y} L${.5-v},${.5+y} L${.5-v},1 M1,${.5+y} L${.5+v},${.5+y} L${.5+v},1 M0,${.5-y} L${.5-v},${.5-y} L${.5-v},0 M1,${.5-y} L${.5+v},${.5-y} L${.5+v},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:(v,y)=>`M.5,1 L.5,${.5+y/.15*.5} C.5,${.5+y/.15*.5},.5,.5,1,.5`},"╮":{1:(v,y)=>`M.5,1 L.5,${.5+y/.15*.5} C.5,${.5+y/.15*.5},.5,.5,0,.5`},"╯":{1:(v,y)=>`M.5,0 L.5,${.5-y/.15*.5} C.5,${.5-y/.15*.5},.5,.5,0,.5`},"╰":{1:(v,y)=>`M.5,0 L.5,${.5-y/.15*.5} C.5,${.5-y/.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(v,y,g,p,x,b,S,C){const E=o.blockElementDefinitions[y];if(E)return function(M,D,N,L,P,I){for(let z=0;z7&&parseInt(O.slice(7,9),16)||1;else{if(!O.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${O}" when drawing pattern glyph`);[Z,X,W,$]=O.substring(5,O.length-1).split(",").map(V=>parseFloat(V))}for(let V=0;Vv.bezierCurveTo(y[0],y[1],y[2],y[3],y[4],y[5]),L:(v,y)=>v.lineTo(y[0],y[1]),M:(v,y)=>v.moveTo(y[0],y[1])};function _(v,y,g,p,x,b,S,C=0,E=0){const k=v.map(T=>parseFloat(T)||parseInt(T));if(k.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T{Object.defineProperty(o,"__esModule",{value:!0}),o.observeDevicePixelDimensions=void 0;const c=l(859);o.observeDevicePixelDimensions=function(h,d,f){let m=new d.ResizeObserver(_=>{const v=_.find(p=>p.target===h);if(!v)return;if(!("devicePixelContentBoxSize"in v))return m==null||m.disconnect(),void(m=void 0);const y=v.devicePixelContentBoxSize[0].inlineSize,g=v.devicePixelContentBoxSize[0].blockSize;y>0&&g>0&&f(y,g)});try{m.observe(h,{box:["device-pixel-content-box"]})}catch{m.disconnect(),m=void 0}return(0,c.toDisposable)(()=>m==null?void 0:m.disconnect())}},374:(a,o)=>{function l(h){return 57508<=h&&h<=57558}function c(h){return h>=128512&&h<=128591||h>=127744&&h<=128511||h>=128640&&h<=128767||h>=9728&&h<=9983||h>=9984&&h<=10175||h>=65024&&h<=65039||h>=129280&&h<=129535||h>=127462&&h<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(h){if(!h)throw new Error("value must not be falsy");return h},o.isPowerlineGlyph=l,o.isRestrictedPowerlineGlyph=function(h){return 57520<=h&&h<=57527},o.isEmoji=c,o.allowRescaling=function(h,d,f,m){return d===1&&f>Math.ceil(1.5*m)&&h!==void 0&&h>255&&!c(h)&&!l(h)&&!function(_){return 57344<=_&&_<=63743}(h)},o.treatGlyphAsBackgroundColor=function(h){return l(h)||function(d){return 9472<=d&&d<=9631}(h)},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(h,d,f=0){return(h-(2*Math.round(d)-f))%(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(h,d,f,m=!1){if(this.selectionStart=d,this.selectionEnd=f,!d||!f||d[0]===f[0]&&d[1]===f[1])return void this.clear();const _=h.buffers.active.ydisp,v=d[1]-_,y=f[1]-_,g=Math.max(v,0),p=Math.min(y,h.rows-1);g>=h.rows||p<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=v,this.viewportEndRow=y,this.viewportCappedStartRow=g,this.viewportCappedEndRow=p,this.startCol=d[0],this.endCol=f[0])}isCellSelected(h,d,f){return!!this.hasSelection&&(f-=h.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&f>=this.viewportCappedStartRow&&d=this.viewportCappedStartRow&&d>=this.endCol&&f<=this.viewportCappedEndRow:f>this.viewportStartRow&&f=this.startCol&&d=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),h=l(860),d=l(374),f=l(160),m=l(345),_=l(485),v=l(385),y=l(147),g=l(855),p={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 x;class b{get pages(){return this._pages}constructor(T,R,M){this._document=T,this._config=R,this._unicodeService=M,this._didWarmUp=!1,this._cacheMap=new _.FourKeyMap,this._cacheMapCombined=new _.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new y.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new m.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new m.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=E(T,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,d.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const T of this.pages)T.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const T=new v.IdleTaskQueue;for(let R=33;R<126;R++)T.enqueue(()=>{if(!this._cacheMap.get(R,g.DEFAULT_COLOR,g.DEFAULT_COLOR,g.DEFAULT_EXT)){const M=this._drawToCache(R,g.DEFAULT_COLOR,g.DEFAULT_COLOR,g.DEFAULT_EXT);this._cacheMap.set(R,g.DEFAULT_COLOR,g.DEFAULT_COLOR,g.DEFAULT_EXT,M)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const T of this._pages)T.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(b.maxAtlasPages&&this._pages.length>=Math.max(4,b.maxAtlasPages)){const R=this._pages.filter(z=>2*z.canvas.width<=(b.maxTextureSize||4096)).sort((z,O)=>O.canvas.width!==z.canvas.width?O.canvas.width-z.canvas.width:O.percentageUsed-z.percentageUsed);let M=-1,D=0;for(let z=0;zz.glyphs[0].texturePage).sort((z,O)=>z>O?1:-1),P=this.pages.length-N.length,I=this._mergePages(N,P);I.version++;for(let z=L.length-1;z>=0;z--)this._deletePage(L[z]);this.pages.push(I),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(I.canvas)}const T=new S(this._document,this._textureSize);return this._pages.push(T),this._activePages.push(T),this._onAddTextureAtlasCanvas.fire(T.canvas),T}_mergePages(T,R){const M=2*T[0].canvas.width,D=new S(this._document,M,T);for(const[N,L]of T.entries()){const P=N*L.canvas.width%M,I=Math.floor(N/2)*L.canvas.height;D.ctx.drawImage(L.canvas,P,I);for(const O of L.glyphs)O.texturePage=R,O.sizeClipSpace.x=O.size.x/M,O.sizeClipSpace.y=O.size.y/M,O.texturePosition.x+=P,O.texturePosition.y+=I,O.texturePositionClipSpace.x=O.texturePosition.x/M,O.texturePositionClipSpace.y=O.texturePosition.y/M;this._onRemoveTextureAtlasCanvas.fire(L.canvas);const z=this._activePages.indexOf(L);z!==-1&&this._activePages.splice(z,1)}return D}_deletePage(T){this._pages.splice(T,1);for(let R=T;R=this._config.colors.ansi.length)throw new Error("No color found for idx "+T);return this._config.colors.ansi[T]}_getBackgroundColor(T,R,M,D){if(this._config.allowTransparency)return f.NULL_COLOR;let N;switch(T){case 16777216:case 33554432:N=this._getColorFromAnsiIndex(R);break;case 50331648:const L=y.AttributeData.toColorRGB(R);N=f.channels.toColor(L[0],L[1],L[2]);break;default:N=M?f.color.opaque(this._config.colors.foreground):this._config.colors.background}return N}_getForegroundColor(T,R,M,D,N,L,P,I,z,O){const A=this._getMinimumContrastColor(T,R,M,D,N,L,P,z,I,O);if(A)return A;let j;switch(N){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&z&&L<8&&(L+=8),j=this._getColorFromAnsiIndex(L);break;case 50331648:const F=y.AttributeData.toColorRGB(L);j=f.channels.toColor(F[0],F[1],F[2]);break;default:j=P?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(j=f.color.opaque(j)),I&&(j=f.color.multiplyOpacity(j,c.DIM_OPACITY)),j}_resolveBackgroundRgba(T,R,M){switch(T){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return M?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(T,R,M,D){switch(T){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&D&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return M?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(T,R,M,D,N,L,P,I,z,O){if(this._config.minimumContrastRatio===1||O)return;const A=this._getContrastCache(z),j=A.getColor(T,D);if(j!==void 0)return j||void 0;const F=this._resolveBackgroundRgba(R,M,P),H=this._resolveForegroundRgba(N,L,P,I),B=f.rgba.ensureContrastRatio(F,H,this._config.minimumContrastRatio/(z?2:1));if(!B)return void A.setColor(T,D,null);const G=f.channels.toColor(B>>24&255,B>>16&255,B>>8&255);return A.setColor(T,D,G),G}_getContrastCache(T){return T?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(T,R,M,D,N=!1){const L=typeof T=="number"?String.fromCharCode(T):T,P=Math.min(this._config.deviceCellWidth*Math.max(L.length,2)+4,this._textureSize);this._tmpCanvas.width=te?2*te-he:te-he;he>=te||yt===0?(this._tmpCtx.setLineDash([Math.round(te),Math.round(te)]),this._tmpCtx.moveTo(ve+yt,Y),this._tmpCtx.lineTo(xe,Y)):(this._tmpCtx.setLineDash([Math.round(te),Math.round(te)]),this._tmpCtx.moveTo(ve,Y),this._tmpCtx.lineTo(ve+yt,Y),this._tmpCtx.moveTo(ve+yt+te,Y),this._tmpCtx.lineTo(xe,Y)),he=(0,d.computeNextVariantOffset)(xe-ve,te,he);break;case 5:const Me=.6,Fe=.3,et=xe-ve,un=Math.floor(Me*et),st=Math.floor(Fe*et),xt=et-un-st;this._tmpCtx.setLineDash([un,st,xt]),this._tmpCtx.moveTo(ve,Y),this._tmpCtx.lineTo(xe,Y);break;default:this._tmpCtx.moveTo(ve,Y),this._tmpCtx.lineTo(xe,Y)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!ce&&this._config.fontSize>=12&&!this._config.allowTransparency&&L!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const be=this._tmpCtx.measureText(L);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in be&&be.actualBoundingBoxDescent>0){this._tmpCtx.save();const ve=new Path2D;ve.rect(ue,Y-Math.ceil(te/2),this._config.deviceCellWidth*ye,ae-Y+Math.ceil(te/2)),this._tmpCtx.clip(ve),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=$.css,this._tmpCtx.strokeText(L,re,re+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(B){const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),se=te%2==1?.5:0;this._tmpCtx.lineWidth=te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(re,re+se),this._tmpCtx.lineTo(re+this._config.deviceCharWidth*ye,re+se),this._tmpCtx.stroke()}if(ce||this._tmpCtx.fillText(L,re,re+this._config.deviceCharHeight),L==="_"&&!this._config.allowTransparency){let te=C(this._tmpCtx.getImageData(re,re,this._config.deviceCellWidth,this._config.deviceCellHeight),$,ie,le);if(te)for(let se=1;se<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=$.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(L,re,re+this._config.deviceCharHeight-se),te=C(this._tmpCtx.getImageData(re,re,this._config.deviceCellWidth,this._config.deviceCellHeight),$,ie,le),te);se++);}if(H){const te=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),se=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=te,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(re,re+Math.floor(this._config.deviceCharHeight/2)-se),this._tmpCtx.lineTo(re+this._config.deviceCharWidth*ye,re+Math.floor(this._config.deviceCharHeight/2)-se),this._tmpCtx.stroke()}this._tmpCtx.restore();const Re=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ae;if(Ae=this._config.allowTransparency?function(te){for(let se=0;se0)return!1;return!0}(Re):C(Re,$,ie,le),Ae)return p;const _e=this._findGlyphBoundingBox(Re,this._workBoundingBox,P,q,ce,re);let Ce,oe;for(;;){if(this._activePages.length===0){const te=this._createNewPage();Ce=te,oe=te.currentRow,oe.height=_e.size.y;break}Ce=this._activePages[this._activePages.length-1],oe=Ce.currentRow;for(const te of this._activePages)_e.size.y<=te.currentRow.height&&(Ce=te,oe=te.currentRow);for(let te=this._activePages.length-1;te>=0;te--)for(const se of this._activePages[te].fixedRows)se.height<=oe.height&&_e.size.y<=se.height&&(Ce=this._activePages[te],oe=se);if(oe.y+_e.size.y>=Ce.canvas.height||oe.height>_e.size.y+2){let te=!1;if(Ce.currentRow.y+Ce.currentRow.height+_e.size.y>=Ce.canvas.height){let se;for(const ue of this._activePages)if(ue.currentRow.y+ue.currentRow.height+_e.size.y=b.maxAtlasPages&&oe.y+_e.size.y<=Ce.canvas.height&&oe.height>=_e.size.y&&oe.x+_e.size.x<=Ce.canvas.width)te=!0;else{const ue=this._createNewPage();Ce=ue,oe=ue.currentRow,oe.height=_e.size.y,te=!0}}te||(Ce.currentRow.height>0&&Ce.fixedRows.push(Ce.currentRow),oe={x:0,y:Ce.currentRow.y+Ce.currentRow.height,height:_e.size.y},Ce.fixedRows.push(oe),Ce.currentRow={x:0,y:oe.y+oe.height,height:0})}if(oe.x+_e.size.x<=Ce.canvas.width)break;oe===Ce.currentRow?(oe.x=0,oe.y+=oe.height,oe.height=0):Ce.fixedRows.splice(Ce.fixedRows.indexOf(oe),1)}return _e.texturePage=this._pages.indexOf(Ce),_e.texturePosition.x=oe.x,_e.texturePosition.y=oe.y,_e.texturePositionClipSpace.x=oe.x/Ce.canvas.width,_e.texturePositionClipSpace.y=oe.y/Ce.canvas.height,_e.sizeClipSpace.x/=Ce.canvas.width,_e.sizeClipSpace.y/=Ce.canvas.height,oe.height=Math.max(oe.height,_e.size.y),oe.x+=_e.size.x,Ce.ctx.putImageData(Re,_e.texturePosition.x-this._workBoundingBox.left,_e.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,_e.size.x,_e.size.y),Ce.addGlyph(_e),Ce.version++,_e}_findGlyphBoundingBox(T,R,M,D,N,L){R.top=0;const P=D?this._config.deviceCellHeight:this._tmpCanvas.height,I=D?this._config.deviceCellWidth:M;let z=!1;for(let O=0;O=L;O--){for(let A=0;A=0;O--){for(let A=0;A>>24,N=T.rgba>>>16&255,L=T.rgba>>>8&255,P=R.rgba>>>24,I=R.rgba>>>16&255,z=R.rgba>>>8&255,O=Math.floor((Math.abs(D-P)+Math.abs(N-I)+Math.abs(L-z))/12);let A=!0;for(let j=0;j=0;k--)(S=g[k])&&(E=(C<3?S(E):C>3?S(p,x,E):S(p,x))||E);return C>3&&E&&Object.defineProperty(p,x,E),E},h=this&&this.__param||function(g,p){return function(x,b){p(x,b,g)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=l(147),f=l(855),m=l(782),_=l(97);class v extends d.AttributeData{constructor(p,x,b){super(),this.content=0,this.combinedData="",this.fg=p.fg,this.bg=p.bg,this.combinedData=x,this._width=b}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(p){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=v;let y=o.CharacterJoinerService=class cL{constructor(p){this._bufferService=p,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(p){const x={id:this._nextCharacterJoinerId++,handler:p};return this._characterJoiners.push(x),x.id}deregister(p){for(let x=0;x1){const D=this._getJoinedRanges(S,k,E,x,C);for(let N=0;N1){const M=this._getJoinedRanges(S,k,E,x,C);for(let D=0;D{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;let l=0,c=0,h=0,d=0;var f,m,_,v,y;function g(x){const b=x.toString(16);return b.length<2?"0"+b:b}function p(x,b){return x>>0},x.toColor=function(b,S,C,E){return{css:x.toCss(b,S,C,E),rgba:x.toRgba(b,S,C,E)}}}(f||(o.channels=f={})),function(x){function b(S,C){return d=Math.round(255*C),[l,c,h]=y.toChannels(S.rgba),{css:f.toCss(l,c,h,d),rgba:f.toRgba(l,c,h,d)}}x.blend=function(S,C){if(d=(255&C.rgba)/255,d===1)return{css:C.css,rgba:C.rgba};const E=C.rgba>>24&255,k=C.rgba>>16&255,T=C.rgba>>8&255,R=S.rgba>>24&255,M=S.rgba>>16&255,D=S.rgba>>8&255;return l=R+Math.round((E-R)*d),c=M+Math.round((k-M)*d),h=D+Math.round((T-D)*d),{css:f.toCss(l,c,h),rgba:f.toRgba(l,c,h)}},x.isOpaque=function(S){return(255&S.rgba)==255},x.ensureContrastRatio=function(S,C,E){const k=y.ensureContrastRatio(S.rgba,C.rgba,E);if(k)return f.toColor(k>>24&255,k>>16&255,k>>8&255)},x.opaque=function(S){const C=(255|S.rgba)>>>0;return[l,c,h]=y.toChannels(C),{css:f.toCss(l,c,h),rgba:C}},x.opacity=b,x.multiplyOpacity=function(S,C){return d=255&S.rgba,b(S,d*C/255)},x.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(m||(o.color=m={})),function(x){let b,S;try{const C=document.createElement("canvas");C.width=1,C.height=1;const E=C.getContext("2d",{willReadFrequently:!0});E&&(b=E,b.globalCompositeOperation="copy",S=b.createLinearGradient(0,0,1,1))}catch{}x.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),f.toColor(l,c,h);case 5:return l=parseInt(C.slice(1,2).repeat(2),16),c=parseInt(C.slice(2,3).repeat(2),16),h=parseInt(C.slice(3,4).repeat(2),16),d=parseInt(C.slice(4,5).repeat(2),16),f.toColor(l,c,h,d);case 7:return{css:C,rgba:(parseInt(C.slice(1),16)<<8|255)>>>0};case 9:return{css:C,rgba:parseInt(C.slice(1),16)>>>0}}const E=C.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 l=parseInt(E[1]),c=parseInt(E[2]),h=parseInt(E[3]),d=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),f.toColor(l,c,h,d);if(!b||!S)throw new Error("css.toColor: Unsupported css format");if(b.fillStyle=S,b.fillStyle=C,typeof b.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(b.fillRect(0,0,1,1),[l,c,h,d]=b.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:f.toRgba(l,c,h,d),css:C}}}(_||(o.css=_={})),function(x){function b(S,C,E){const k=S/255,T=C/255,R=E/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}x.relativeLuminance=function(S){return b(S>>16&255,S>>8&255,255&S)},x.relativeLuminance2=b}(v||(o.rgb=v={})),function(x){function b(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let D=E>>24&255,N=E>>16&255,L=E>>8&255,P=p(v.relativeLuminance2(D,N,L),v.relativeLuminance2(T,R,M));for(;P0||N>0||L>0);)D-=Math.max(0,Math.ceil(.1*D)),N-=Math.max(0,Math.ceil(.1*N)),L-=Math.max(0,Math.ceil(.1*L)),P=p(v.relativeLuminance2(D,N,L),v.relativeLuminance2(T,R,M));return(D<<24|N<<16|L<<8|255)>>>0}function S(C,E,k){const T=C>>24&255,R=C>>16&255,M=C>>8&255;let D=E>>24&255,N=E>>16&255,L=E>>8&255,P=p(v.relativeLuminance2(D,N,L),v.relativeLuminance2(T,R,M));for(;P>>0}x.blend=function(C,E){if(d=(255&E)/255,d===1)return E;const k=E>>24&255,T=E>>16&255,R=E>>8&255,M=C>>24&255,D=C>>16&255,N=C>>8&255;return l=M+Math.round((k-M)*d),c=D+Math.round((T-D)*d),h=N+Math.round((R-N)*d),f.toRgba(l,c,h)},x.ensureContrastRatio=function(C,E,k){const T=v.relativeLuminance(C>>8),R=v.relativeLuminance(E>>8);if(p(T,R)>8));if(Lp(T,v.relativeLuminance(P>>8))?N:P}return N}const M=S(C,E,k),D=p(T,v.relativeLuminance(M>>8));if(Dp(T,v.relativeLuminance(N>>8))?M:N}return M}},x.reduceLuminance=b,x.increaseLuminance=S,x.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}}(y||(o.rgba=y={})),o.toPaddedHex=g,o.contrastRatio=p},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;cc.fire(h))},o.runAndSubscribe=function(l,c){return c(void 0),l(h=>c(h))}},859:(a,o)=>{function l(c){for(const h of c)h.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 h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)==null||h.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(h,d,f){this._data[h]||(this._data[h]={}),this._data[h][d]=f}get(h,d){return this._data[h]?this._data[h][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=l,o.FourKeyMap=class{constructor(){this._data=new l}set(c,h,d,f,m){this._data.get(c,h)||this._data.set(c,h,new l),this._data.get(c,h).set(d,f,m)}get(c,h,d,f){var m;return(m=this._data.get(c,h))==null?void 0:m.get(d,f)}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"&&"title"in process;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 h=l.match(/Version\/(\d+)/);return h===null||h.length<2?0:parseInt(h[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 h{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ig)return y-_<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(y-_))}ms`),void this._start();y=g}this.clear()}}class d extends h{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const _=Date.now()+m;return{timeRemaining:()=>Math.max(0,_-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends h{_requestCallback(f){return requestIdleCallback(f)}_cancelCallback(f){cancelIdleCallback(f)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(f){this._queue.clear(),this._queue.enqueue(f)}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(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new l;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,f=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=f}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),h=l(855),d=l(147);class f extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(_){const v=new f;return v.setFromCharData(_),v}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(_){this.fg=_[h.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(_[h.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(_[h.CHAR_DATA_CHAR_INDEX].length===2){const y=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=y&&y<=56319){const g=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=g&&g<=57343?this.content=1024*(y-55296)+g-56320+65536|_[h.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=_[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|_[h.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=_[h.CHAR_DATA_CHAR_INDEX],this.content=2097152|_[h.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=f},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,h=l.length){let d="";for(let f=c;f65535?(m-=65536,d+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):d+=String.fromCharCode(m)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(l,c){const h=l.length;if(!h)return 0;let d=0,f=0;if(this._interim){const m=l.charCodeAt(f++);56320<=m&&m<=57343?c[d++]=1024*(this._interim-55296)+m-56320+65536:(c[d++]=this._interim,c[d++]=m),this._interim=0}for(let m=f;m=h)return this._interim=_,d;const v=l.charCodeAt(m);56320<=v&&v<=57343?c[d++]=1024*(_-55296)+v-56320+65536:(c[d++]=_,c[d++]=v)}else _!==65279&&(c[d++]=_)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(l,c){const h=l.length;if(!h)return 0;let d,f,m,_,v=0,y=0,g=0;if(this.interim[0]){let b=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let C,E=0;for(;(C=63&this.interim[++E])&&E<4;)S<<=6,S|=C;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=k-E;for(;g=h)return 0;if(C=l[g++],(192&C)!=128){g--,b=!0;break}this.interim[E++]=C,S<<=6,S|=63&C}b||(k===2?S<128?g--:c[v++]=S:k===3?S<2048||S>=55296&&S<=57343||S===65279||(c[v++]=S):S<65536||S>1114111||(c[v++]=S)),this.interim.fill(0)}const p=h-4;let x=g;for(;x=h)return this.interim[0]=d,v;if(f=l[x++],(192&f)!=128){x--;continue}if(y=(31&d)<<6|63&f,y<128){x--;continue}c[v++]=y}else if((240&d)==224){if(x>=h)return this.interim[0]=d,v;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,v;if(m=l[x++],(192&m)!=128){x--;continue}if(y=(15&d)<<12|(63&f)<<6|63&m,y<2048||y>=55296&&y<=57343||y===65279)continue;c[v++]=y}else if((248&d)==240){if(x>=h)return this.interim[0]=d,v;if(f=l[x++],(192&f)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,v;if(m=l[x++],(192&m)!=128){x--;continue}if(x>=h)return this.interim[0]=d,this.interim[1]=f,this.interim[2]=m,v;if(_=l[x++],(192&_)!=128){x--;continue}if(y=(7&d)<<18|(63&f)<<12|(63&m)<<6|63&_,y<65536||y>1114111)continue;c[v++]=y}}return v}}},776:function(a,o,l){var c=this&&this.__decorate||function(y,g,p,x){var b,S=arguments.length,C=S<3?g:x===null?x=Object.getOwnPropertyDescriptor(g,p):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(y,g,p,x);else for(var E=y.length-1;E>=0;E--)(b=y[E])&&(C=(S<3?b(C):S>3?b(g,p,C):b(g,p))||C);return S>3&&C&&Object.defineProperty(g,p,C),C},h=this&&this.__param||function(y,g){return function(p,x){g(p,x,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=l(859),f=l(97),m={trace:f.LogLevelEnum.TRACE,debug:f.LogLevelEnum.DEBUG,info:f.LogLevelEnum.INFO,warn:f.LogLevelEnum.WARN,error:f.LogLevelEnum.ERROR,off:f.LogLevelEnum.OFF};let _,v=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(y){super(),this._optionsService=y,this._logLevel=f.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),_=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(y){for(let g=0;gJSON.stringify(C)).join(", ")})`);const S=x.apply(this,b);return _.trace(`GlyphRenderer#${x.name} return`,S),S}}},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(h){return h[c]||[]},o.createDecorator=function(h){if(o.serviceRegistry.has(h))return o.serviceRegistry.get(h);const d=function(f,m,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,y,g){y[l]===y?y[c].push({id:v,index:g}):(y[c]=[{id:v,index:g}],y[l]=y)})(d,f,_)};return d.toString=()=>h,o.serviceRegistry.set(h,d),d}},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 h;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(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(h||(o.LogLevelEnum=h={})),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),h=i(949);class d 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 m;return(m=this._renderer)==null?void 0:m.textureAtlas}activate(m){const _=m._core;if(!m.element)return void this.register(_.onWillOpen(()=>this.activate(m)));this._terminal=m;const v=_.coreService,y=_.optionsService,g=_.screenElement,p=_.linkifier,x=_,b=x._bufferService,S=x._renderService,C=x._characterJoinerService,E=x._charSizeService,k=x._coreBrowserService,T=x._decorationService,R=x._logService,M=x._themeService;(0,c.setTraceLogger)(R),this._renderer=new h.CanvasRenderer(m,g,p,b,E,y,C,v,k,T,M),this.register((0,o.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,o.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),S.setRenderer(this._renderer),S.handleResize(b.cols,b.rows),this.register((0,l.toDisposable)(()=>{var D;S.setRenderer(this._terminal._core._createRenderer()),S.handleResize(m.cols,m.rows),(D=this._renderer)==null||D.dispose(),this._renderer=void 0}))}clearTextureAtlas(){var m;(m=this._renderer)==null||m.clearTextureAtlas()}}a.CanvasAddon=d})(),s})())})(lL);var uL=lL.exports,dL={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"))),h=window.getComputedStyle(this._terminal.element),d=l-(parseInt(h.getPropertyValue("padding-top"))+parseInt(h.getPropertyValue("padding-bottom"))),f=c-(parseInt(h.getPropertyValue("padding-right"))+parseInt(h.getPropertyValue("padding-left")))-a;return{cols:Math.max(2,Math.floor(f/s.css.cell.width)),rows:Math.max(1,Math.floor(d/s.css.cell.height))}}}})(),n})())})(dL);var hL=dL.exports,fL={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;cc.fire(h))},o.runAndSubscribe=function(l,c){return c(void 0),l(h=>c(h))}},859:(a,o)=>{function l(c){for(const h of c)h.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 h=this._disposables.indexOf(c);h!==-1&&this._disposables.splice(h,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var h;this._isDisposed||c===this._value||((h=this._value)==null||h.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 h extends l.Disposable{constructor(f){super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new l.MutableDisposable),this._linesCacheTimeoutId=0,this._linesCacheDisposables=new l.MutableDisposable,this._onDidChangeResults=this.register(new o.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(f==null?void 0:f.highlightLimit)??1e3}activate(f){this._terminal=f,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,l.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var f;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&((f=this._lastSearchOptions)!=null&&f.decorations)&&(this._highlightTimeout=setTimeout(()=>{const m=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(m,{...this._lastSearchOptions,incremental:!0,noScroll:!0})},200))}clearDecorations(f){this._selectedDecoration.clear(),(0,l.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),f||(this._cachedSearchTerm=void 0)}clearActiveDecoration(){this._selectedDecoration.clear()}findNext(f,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");const _=!this._lastSearchOptions||this._didOptionsChange(this._lastSearchOptions,m);this._lastSearchOptions=m,m!=null&&m.decorations&&(this._cachedSearchTerm===void 0||f!==this._cachedSearchTerm||_)&&this._highlightAllMatches(f,m);const v=this._findNextAndSelect(f,m);return this._fireResults(m),this._cachedSearchTerm=f,v}_highlightAllMatches(f,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!f||f.length===0)return void this.clearDecorations();m=m||{},this.clearDecorations(!0);const _=[];let v,y=this._find(f,0,0,m);for(;y&&((v==null?void 0:v.row)!==y.row||(v==null?void 0:v.col)!==y.col)&&!(_.length>=this._highlightLimit);)v=y,_.push(v),y=this._find(f,v.col+v.term.length>=this._terminal.cols?v.row+1:v.row,v.col+v.term.length>=this._terminal.cols?0:v.col+1,m);for(const g of _){const p=this._createResultDecoration(g,m.decorations);p&&(this._highlightedLines.add(p.marker.line),this._highlightDecorations.push({decoration:p,match:g,dispose(){p.dispose()}}))}}_find(f,m,_,v){var p;if(!this._terminal||!f||f.length===0)return(p=this._terminal)==null||p.clearSelection(),void this.clearDecorations();if(_>this._terminal.cols)throw new Error(`Invalid col: ${_} to search in terminal of ${this._terminal.cols} cols`);let y;this._initLinesCache();const g={startRow:m,startCol:_};if(y=this._findInLine(f,g,v),!y)for(let x=m+1;x=0&&(p.startRow=S,x=this._findInLine(f,p,m,g),!x);S--);}if(!x&&v!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let S=this._terminal.buffer.active.baseY+this._terminal.rows-1;S>=v&&(p.startRow=S,x=this._findInLine(f,p,m,g),!x);S--);return this._selectResult(x,m==null?void 0:m.decorations,m==null?void 0:m.noScroll)}_initLinesCache(){const f=this._terminal;this._linesCache||(this._linesCache=new Array(f.buffer.active.length),this._linesCacheDisposables.value=(0,l.getDisposeArrayDisposable)([f.onLineFeed(()=>this._destroyLinesCache()),f.onCursorMove(()=>this._destroyLinesCache()),f.onResize(()=>this._destroyLinesCache())])),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(f,m,_){return(f===0||c.includes(m[f-1]))&&(f+_.length===m.length||c.includes(m[f+_.length]))}_findInLine(f,m,_={},v=!1){var M;const y=this._terminal,g=m.startRow,p=m.startCol,x=y.buffer.active.getLine(g);if(x!=null&&x.isWrapped)return v?void(m.startCol+=y.cols):(m.startRow--,m.startCol+=y.cols,this._findInLine(f,m,_));let b=(M=this._linesCache)==null?void 0:M[g];b||(b=this._translateBufferLineToStringWithWrap(g,!0),this._linesCache&&(this._linesCache[g]=b));const[S,C]=b,E=this._bufferColsToStringOffset(g,p),k=_.caseSensitive?f:f.toLowerCase(),T=_.caseSensitive?S:S.toLowerCase();let R=-1;if(_.regex){const D=RegExp(k,"g");let N;if(v)for(;N=D.exec(T.slice(0,E));)R=D.lastIndex-N[0].length,f=N[0],D.lastIndex-=f.length-1;else N=D.exec(T.slice(E)),N&&N[0].length>0&&(R=E+(D.lastIndex-N[0].length),f=N[0])}else v?E-k.length>=0&&(R=T.lastIndexOf(k,E-k.length)):R=T.indexOf(k,E);if(R>=0){if(_.wholeWord&&!this._isWholeWord(R,T,f))return;let D=0;for(;D=C[D+1];)D++;let N=D;for(;N=C[N+1];)N++;const L=R-C[D],P=R+f.length-C[N],I=this._stringLengthToBufferSize(g+D,L);return{term:f,col:I,row:g+D,size:this._stringLengthToBufferSize(g+N,P)-I+y.cols*(N-D)}}}_stringLengthToBufferSize(f,m){const _=this._terminal.buffer.active.getLine(f);if(!_)return 0;for(let v=0;v1&&(m-=g.length-1);const p=_.getCell(v+1);p&&p.getWidth()===0&&m++}return m}_bufferColsToStringOffset(f,m){const _=this._terminal;let v=f,y=0,g=_.buffer.active.getLine(v);for(;m>0&&g;){for(let p=0;pthis._applyStyles(x,m.activeMatchBorder,!0))),p.push(g.onDispose(()=>(0,l.disposeArray)(p))),this._selectedDecoration.value={decoration:g,match:f,dispose(){g.dispose()}}}}}if(!_&&(f.row>=v.buffer.active.viewportY+v.rows||f.rowthis._applyStyles(p,m.matchBorder,!1))),g.push(y.onDispose(()=>(0,l.disposeArray)(g)))}return y}}a.SearchAddon=h})(),s})())})(fL);var pL=fL.exports,mL={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(self,()=>(()=>{var n={6:(a,o)=>{function l(h){try{const d=new URL(h),f=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return h.toLocaleLowerCase().startsWith(f.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(h,d,f,m={}){this._terminal=h,this._regex=d,this._handler=f,this._options=m}provideLinks(h,d){const f=c.computeLink(h,this._regex,this._terminal,this._handler);d(this._addCallbacks(f))}_addCallbacks(h){return h.map(d=>(d.leave=this._options.leave,d.hover=(f,m)=>{if(this._options.hover){const{range:_}=d;this._options.hover(f,m,_)}},d))}};class c{static computeLink(d,f,m,_){const v=new RegExp(f.source,(f.flags||"")+"g"),[y,g]=c._getWindowedLineStrings(d-1,m),p=y.join("");let x;const b=[];for(;x=v.exec(p);){const S=x[0];if(!l(S))continue;const[C,E]=c._mapStrIdx(m,g,0,x.index),[k,T]=c._mapStrIdx(m,C,E,S.length);if(C===-1||E===-1||k===-1||T===-1)continue;const R={start:{x:E+1,y:C+1},end:{x:T,y:k+1}};b.push({range:R,text:S,activate:_})}return b}static _getWindowedLineStrings(d,f){let m,_=d,v=d,y=0,g="";const p=[];if(m=f.buffer.active.getLine(d)){const x=m.translateToString(!0);if(m.isWrapped&&x[0]!==" "){for(y=0;(m=f.buffer.active.getLine(--_))&&y<2048&&(g=m.translateToString(!0),y+=g.length,p.push(g),m.isWrapped&&g.indexOf(" ")===-1););p.reverse()}for(p.push(x),y=0;(m=f.buffer.active.getLine(++v))&&m.isWrapped&&y<2048&&(g=m.translateToString(!0),y+=g.length,p.push(g),g.indexOf(" ")===-1););}return[p,_]}static _mapStrIdx(d,f,m,_){const v=d.buffer.active,y=v.getNullCell();let g=m;for(;_;){const p=v.getLine(f);if(!p)return[-1,-1];for(let x=g;x{var a=s;Object.defineProperty(a,"__esModule",{value:!0}),a.WebLinksAddon=void 0;const o=i(6),l=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function c(h,d){const f=window.open();if(f){try{f.opener=null}catch{}f.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}a.WebLinksAddon=class{constructor(h=c,d={}){this._handler=h,this._options=d}activate(h){this._terminal=h;const d=this._options,f=d.urlRegex||l;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,f,this._handler,d))}dispose(){var h;(h=this._linkProvider)==null||h.dispose()}}})(),s})())})(mL);var gL=mL.exports;/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xX=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vL=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var _X={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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bX=w.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:s,iconNode:a,...o},l)=>w.createElement("svg",{ref:l,..._X,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:vL("lucide",i),...o},[...a.map(([c,h])=>w.createElement(c,h)),...Array.isArray(s)?s:[s]]));/** * @license lucide-react v0.447.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=w.forwardRef(({className:r,...i},s)=>w.createElement(bX,{ref:s,iconNode:t,className:vL(`lucide-${xX(e)}`,r),...i}));return n.displayName=`${e}`,n};/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wX=me("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SX=me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kX=me("BookMarked",[["path",{d:"M10 2v8l3-3 3 3V2",key:"sqw3rj"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yL=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TX=me("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const MX=me("ChartBar",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AX=me("ChartLine",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"m19 9-5 5-4-4-3 3",key:"2osh9i"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jX=me("ChartPie",[["path",{d:"M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",key:"pzmjnu"}],["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LC=me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Dl=me("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xL=me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NC=me("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _L=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sw=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const DX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const LX=me("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const NX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bL=me("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $X=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tT=me("CloudDownload",[["path",{d:"M12 13v8l-4-4",key:"1f5nwf"}],["path",{d:"m12 21 4-4",key:"1lfcce"}],["path",{d:"M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284",key:"ui1hmy"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const FX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zX=me("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.447.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("Dna",[["path",{d:"m10 16 1.5 1.5",key:"11lckj"}],["path",{d:"m14 8-1.5-1.5",key:"1ohn8i"}],["path",{d:"M15 2c-1.798 1.998-2.518 3.995-2.807 5.993",key:"80uv8i"}],["path",{d:"m16.5 10.5 1 1",key:"696xn5"}],["path",{d:"m17 6-2.891-2.891",key:"xu6p2f"}],["path",{d:"M2 15c6.667-6 13.333 0 20-6",key:"1pyr53"}],["path",{d:"m20 9 .891.891",key:"3xwk7g"}],["path",{d:"M3.109 14.109 4 15",key:"q76aoh"}],["path",{d:"m6.5 12.5 1 1",key:"cs35ky"}],["path",{d:"m7 18 2.891 2.891",key:"1sisit"}],["path",{d:"M9 22c1.798-1.998 2.518-3.995 2.807-5.993",key:"q3hbxp"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fv=me("DoorOpen",[["path",{d:"M13 4h3a2 2 0 0 1 2 2v14",key:"hrm0s9"}],["path",{d:"M2 20h3",key:"1gaodv"}],["path",{d:"M13 20h9",key:"s90cdi"}],["path",{d:"M10 12v.01",key:"vx6srw"}],["path",{d:"M13 4.562v16.157a1 1 0 0 1-1.242.97L5 20V5.562a2 2 0 0 1 1.515-1.94l4-1A2 2 0 0 1 13 4.561Z",key:"199qr4"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dl=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const WX=me("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const UX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const VX=me("FilePen",[["path",{d:"M12.5 22H18a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v9.5",key:"1couwa"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M13.378 15.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1y4qbx"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const GX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wL=me("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const KX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pv=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const YX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const XX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SL=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PC=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const QX=me("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const JX=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ZX=me("ListTodo",[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mv=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sn=me("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const eQ=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const tQ=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.447.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("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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const nT=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rQ=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.447.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("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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const sQ=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.447.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("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CL=me("OctagonX",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const aQ=me("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lQ=me("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cQ=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const OC=me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.447.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("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.447.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=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.447.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("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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ow=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.447.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("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** * @license lucide-react v0.447.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("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IC=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mQ=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const kL=me("Shapes",[["path",{d:"M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z",key:"1bo67w"}],["rect",{x:"3",y:"14",width:"7",height:"7",rx:"1",key:"1bkyp8"}],["circle",{cx:"17.5",cy:"17.5",r:"3.5",key:"w3z12y"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EL=me("ShieldAlert",[["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:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TL=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const RL=me("Skull",[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]]);/** * @license lucide-react v0.447.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("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.447.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("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.447.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("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.447.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("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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _Q=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.447.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("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.447.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("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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ML=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const AL=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SQ=me("Trash",[["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"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CQ=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gv=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $C=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.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const rT=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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const jL=me("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const BC=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.447.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("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.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ar=me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** * @license lucide-react v0.447.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EQ=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"}]]),wt=w.forwardRef(({className:e,type:t,...n},r)=>u.jsx("input",{type:t,className:J("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}));wt.displayName="Input";var TQ="Label",Ph=w.forwardRef((e,t)=>u.jsx(Ee.label,{...e,ref:t,onMouseDown:n=>{var i;n.target.closest("button, input, select, textarea")||((i=e.onMouseDown)==null||i.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));Ph.displayName=TQ;var DL=Ph;const RQ=co("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Tn=w.forwardRef(({className:e,...t},n)=>u.jsx(DL,{ref:n,className:J(RQ(),e),...t}));Tn.displayName=DL.displayName;var qu=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(){}},hl=typeof window>"u"||"Deno"in globalThis;function Kr(){}function MQ(e,t){return typeof e=="function"?e(t):e}function aw(e){return typeof e=="number"&&e>=0&&e!==1/0}function LL(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ic(e,t){return typeof e=="function"?e(t):e}function Ei(e,t){return typeof e=="function"?e(t):e}function iT(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:a,stale:o}=e;if(a){if(r){if(t.queryHash!==FC(a,t.options))return!1}else if(!ff(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 sT(e,t){const{exact:n,status:r,predicate:i,mutationKey:s}=e;if(s){if(!t.options.mutationKey)return!1;if(n){if(fl(t.options.mutationKey)!==fl(s))return!1}else if(!ff(t.options.mutationKey,s))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function FC(e,t){return((t==null?void 0:t.queryKeyHashFn)||fl)(e)}function fl(e){return JSON.stringify(e,(t,n)=>lw(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function ff(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!ff(e[n],t[n])):!1}function NL(e,t){if(e===t)return e;const n=oT(e)&&oT(t);if(n||lw(e)&&lw(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{setTimeout(t,e)})}function cw(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?NL(e,t):t}function jQ(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function DQ(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var zC=Symbol();function PL(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===zC?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var qa,Ro,Jc,bj,LQ=(bj=class extends qu{constructor(){super();Pe(this,qa);Pe(this,Ro);Pe(this,Jc);we(this,Jc,t=>{if(!hl&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){K(this,Ro)||this.setEventListener(K(this,Jc))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Ro))==null||t.call(this),we(this,Ro,void 0))}setEventListener(t){var n;we(this,Jc,t),(n=K(this,Ro))==null||n.call(this),we(this,Ro,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){K(this,qa)!==t&&(we(this,qa,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof K(this,qa)=="boolean"?K(this,qa):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},qa=new WeakMap,Ro=new WeakMap,Jc=new WeakMap,bj),HC=new LQ,Zc,Mo,eu,wj,NQ=(wj=class extends qu{constructor(){super();Pe(this,Zc,!0);Pe(this,Mo);Pe(this,eu);we(this,eu,t=>{if(!hl&&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(){K(this,Mo)||this.setEventListener(K(this,eu))}onUnsubscribe(){var t;this.hasListeners()||((t=K(this,Mo))==null||t.call(this),we(this,Mo,void 0))}setEventListener(t){var n;we(this,eu,t),(n=K(this,Mo))==null||n.call(this),we(this,Mo,t(this.setOnline.bind(this)))}setOnline(t){K(this,Zc)!==t&&(we(this,Zc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return K(this,Zc)}},Zc=new WeakMap,Mo=new WeakMap,eu=new WeakMap,wj),yv=new NQ;function uw(){let e,t;const n=new Promise((i,s)=>{e=i,t=s});n.status="pending",n.catch(()=>{});function r(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{r({status:"fulfilled",value:i}),e(i)},n.reject=i=>{r({status:"rejected",reason:i}),t(i)},n}function PQ(e){return Math.min(1e3*2**e,3e4)}function OL(e){return(e??"online")==="online"?yv.isOnline():!0}var IL=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Hx(e){return e instanceof IL}function $L(e){let t=!1,n=0,r=!1,i;const s=uw(),a=v=>{var y;r||(f(new IL(v)),(y=e.abort)==null||y.call(e))},o=()=>{t=!0},l=()=>{t=!1},c=()=>HC.isFocused()&&(e.networkMode==="always"||yv.isOnline())&&e.canRun(),h=()=>OL(e.networkMode)&&e.canRun(),d=v=>{var y;r||(r=!0,(y=e.onSuccess)==null||y.call(e,v),i==null||i(),s.resolve(v))},f=v=>{var y;r||(r=!0,(y=e.onError)==null||y.call(e,v),i==null||i(),s.reject(v))},m=()=>new Promise(v=>{var y;i=g=>{(r||c())&&v(g)},(y=e.onPause)==null||y.call(e)}).then(()=>{var v;i=void 0,r||(v=e.onContinue)==null||v.call(e)}),_=()=>{if(r)return;let v;const y=n===0?e.initialPromise:void 0;try{v=y??e.fn()}catch(g){v=Promise.reject(g)}Promise.resolve(v).then(d).catch(g=>{var C;if(r)return;const p=e.retry??(hl?0:3),x=e.retryDelay??PQ,b=typeof x=="function"?x(n,g):x,S=p===!0||typeof p=="number"&&nc()?void 0:m()).then(()=>{t?f(g):_()})})};return{promise:s,cancel:a,continue:()=>(i==null||i(),s),cancelRetry:o,continueRetry:l,canStart:h,start:()=>(h()?_():m().then(_),s)}}function OQ(){let e=[],t=0,n=o=>{o()},r=o=>{o()},i=o=>setTimeout(o,0);const s=o=>{t?e.push(o):i(()=>{n(o)})},a=()=>{const o=e;e=[],o.length&&i(()=>{r(()=>{o.forEach(l=>{n(l)})})})};return{batch:o=>{let l;t++;try{l=o()}finally{t--,t||a()}return l},batchCalls:o=>(...l)=>{s(()=>{o(...l)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{r=o},setScheduler:o=>{i=o}}}var Sn=OQ(),Ga,Sj,BL=(Sj=class{constructor(){Pe(this,Ga)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),aw(this.gcTime)&&we(this,Ga,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(hl?1/0:5*60*1e3))}clearGcTimeout(){K(this,Ga)&&(clearTimeout(K(this,Ga)),we(this,Ga,void 0))}},Ga=new WeakMap,Sj),tu,nu,Gr,Yn,Qf,Ka,_i,js,Cj,IQ=(Cj=class extends BL{constructor(t){super();Pe(this,_i);Pe(this,tu);Pe(this,nu);Pe(this,Gr);Pe(this,Yn);Pe(this,Qf);Pe(this,Ka);we(this,Ka,!1),we(this,Qf,t.defaultOptions),this.setOptions(t.options),this.observers=[],we(this,Gr,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,we(this,tu,$Q(this.options)),this.state=t.state??K(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=K(this,Yn))==null?void 0:t.promise}setOptions(t){this.options={...K(this,Qf),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&K(this,Gr).remove(this)}setData(t,n){const r=cw(this.state.data,t,this.options);return Ze(this,_i,js).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Ze(this,_i,js).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=K(this,Yn))==null?void 0:r.promise;return(i=K(this,Yn))==null||i.cancel(t),n?n.then(Kr).catch(Kr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(K(this,tu))}isActive(){return this.observers.some(t=>Ei(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===zC||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!LL(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Yn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=K(this,Yn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),K(this,Gr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(K(this,Yn)&&(K(this,Ka)?K(this,Yn).cancel({revert:!0}):K(this,Yn).cancelRetry()),this.scheduleGc()),K(this,Gr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ze(this,_i,js).call(this,{type:"invalidate"})}fetch(t,n){var l,c,h;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(K(this,Yn))return K(this,Yn).continueRetry(),K(this,Yn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const d=this.observers.find(f=>f.options.queryFn);d&&this.setOptions(d.options)}const r=new AbortController,i=d=>{Object.defineProperty(d,"signal",{enumerable:!0,get:()=>(we(this,Ka,!0),r.signal)})},s=()=>{const d=PL(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return i(f),we(this,Ka,!1),this.options.persister?this.options.persister(d,f,this):d(f)},a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};i(a),(l=this.options.behavior)==null||l.onFetch(a,this),we(this,nu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Ze(this,_i,js).call(this,{type:"fetch",meta:(h=a.fetchOptions)==null?void 0:h.meta});const o=d=>{var f,m,_,v;Hx(d)&&d.silent||Ze(this,_i,js).call(this,{type:"error",error:d}),Hx(d)||((m=(f=K(this,Gr).config).onError)==null||m.call(f,d,this),(v=(_=K(this,Gr).config).onSettled)==null||v.call(_,this.state.data,d,this)),this.scheduleGc()};return we(this,Yn,$L({initialPromise:n==null?void 0:n.initialPromise,fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:d=>{var f,m,_,v;if(d===void 0){o(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(d)}catch(y){o(y);return}(m=(f=K(this,Gr).config).onSuccess)==null||m.call(f,d,this),(v=(_=K(this,Gr).config).onSettled)==null||v.call(_,d,this.state.error,this),this.scheduleGc()},onError:o,onFail:(d,f)=>{Ze(this,_i,js).call(this,{type:"failed",failureCount:d,error:f})},onPause:()=>{Ze(this,_i,js).call(this,{type:"pause"})},onContinue:()=>{Ze(this,_i,js).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0})),K(this,Yn).start()}},tu=new WeakMap,nu=new WeakMap,Gr=new WeakMap,Yn=new WeakMap,Qf=new WeakMap,Ka=new WeakMap,_i=new WeakSet,js=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,...FL(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 Hx(i)&&i.revert&&K(this,nu)?{...K(this,nu),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),Sn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),K(this,Gr).notify({query:this,type:"updated",action:t})})},Cj);function FL(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:OL(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function $Q(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 Xi,kj,BQ=(kj=class extends qu{constructor(t={}){super();Pe(this,Xi);this.config=t,we(this,Xi,new Map)}build(t,n,r){const i=n.queryKey,s=n.queryHash??FC(i,n);let a=this.get(s);return a||(a=new IQ({cache:this,queryKey:i,queryHash:s,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(a)),a}add(t){K(this,Xi).has(t.queryHash)||(K(this,Xi).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=K(this,Xi).get(t.queryHash);n&&(t.destroy(),n===t&&K(this,Xi).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Sn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return K(this,Xi).get(t)}getAll(){return[...K(this,Xi).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>iT(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>iT(t,r)):n}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Sn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Xi=new WeakMap,kj),Qi,rr,Ya,Ji,xo,Ej,FQ=(Ej=class extends BL{constructor(t){super();Pe(this,Ji);Pe(this,Qi);Pe(this,rr);Pe(this,Ya);this.mutationId=t.mutationId,we(this,rr,t.mutationCache),we(this,Qi,[]),this.state=t.state||zL(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){K(this,Qi).includes(t)||(K(this,Qi).push(t),this.clearGcTimeout(),K(this,rr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){we(this,Qi,K(this,Qi).filter(n=>n!==t)),this.scheduleGc(),K(this,rr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){K(this,Qi).length||(this.state.status==="pending"?this.scheduleGc():K(this,rr).remove(this))}continue(){var t;return((t=K(this,Ya))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,s,a,o,l,c,h,d,f,m,_,v,y,g,p,x,b,S,C,E;we(this,Ya,$L({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(k,T)=>{Ze(this,Ji,xo).call(this,{type:"failed",failureCount:k,error:T})},onPause:()=>{Ze(this,Ji,xo).call(this,{type:"pause"})},onContinue:()=>{Ze(this,Ji,xo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>K(this,rr).canRun(this)}));const n=this.state.status==="pending",r=!K(this,Ya).canStart();try{if(!n){Ze(this,Ji,xo).call(this,{type:"pending",variables:t,isPaused:r}),await((s=(i=K(this,rr).config).onMutate)==null?void 0:s.call(i,t,this));const T=await((o=(a=this.options).onMutate)==null?void 0:o.call(a,t));T!==this.state.context&&Ze(this,Ji,xo).call(this,{type:"pending",context:T,variables:t,isPaused:r})}const k=await K(this,Ya).start();return await((c=(l=K(this,rr).config).onSuccess)==null?void 0:c.call(l,k,t,this.state.context,this)),await((d=(h=this.options).onSuccess)==null?void 0:d.call(h,k,t,this.state.context)),await((m=(f=K(this,rr).config).onSettled)==null?void 0:m.call(f,k,null,this.state.variables,this.state.context,this)),await((v=(_=this.options).onSettled)==null?void 0:v.call(_,k,null,t,this.state.context)),Ze(this,Ji,xo).call(this,{type:"success",data:k}),k}catch(k){try{throw await((g=(y=K(this,rr).config).onError)==null?void 0:g.call(y,k,t,this.state.context,this)),await((x=(p=this.options).onError)==null?void 0:x.call(p,k,t,this.state.context)),await((S=(b=K(this,rr).config).onSettled)==null?void 0:S.call(b,void 0,k,this.state.variables,this.state.context,this)),await((E=(C=this.options).onSettled)==null?void 0:E.call(C,void 0,k,t,this.state.context)),k}finally{Ze(this,Ji,xo).call(this,{type:"error",error:k})}}finally{K(this,rr).runNext(this)}}},Qi=new WeakMap,rr=new WeakMap,Ya=new WeakMap,Ji=new WeakSet,xo=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:t.isPaused,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),Sn.batch(()=>{K(this,Qi).forEach(r=>{r.onMutationUpdate(t)}),K(this,rr).notify({mutation:this,type:"updated",action:t})})},Ej);function zL(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Os,bi,Jf,Tj,zQ=(Tj=class extends qu{constructor(t={}){super();Pe(this,Os);Pe(this,bi);Pe(this,Jf);this.config=t,we(this,Os,new Set),we(this,bi,new Map),we(this,Jf,0)}build(t,n,r){const i=new FQ({mutationCache:this,mutationId:++Gp(this,Jf)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){K(this,Os).add(t);const n=mm(t);if(typeof n=="string"){const r=K(this,bi).get(n);r?r.push(t):K(this,bi).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(K(this,Os).delete(t)){const n=mm(t);if(typeof n=="string"){const r=K(this,bi).get(n);if(r)if(r.length>1){const i=r.indexOf(t);i!==-1&&r.splice(i,1)}else r[0]===t&&K(this,bi).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=mm(t);if(typeof n=="string"){const r=K(this,bi).get(n),i=r==null?void 0:r.find(s=>s.state.status==="pending");return!i||i===t}else return!0}runNext(t){var r;const n=mm(t);if(typeof n=="string"){const i=(r=K(this,bi).get(n))==null?void 0:r.find(s=>s!==t&&s.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Sn.batch(()=>{K(this,Os).forEach(t=>{this.notify({type:"removed",mutation:t})}),K(this,Os).clear(),K(this,bi).clear()})}getAll(){return Array.from(K(this,Os))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>sT(n,r))}findAll(t={}){return this.getAll().filter(n=>sT(t,n))}notify(t){Sn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Sn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Kr))))}},Os=new WeakMap,bi=new WeakMap,Jf=new WeakMap,Tj);function mm(e){var t;return(t=e.options.scope)==null?void 0:t.id}function lT(e){return{onFetch:(t,n)=>{var h,d,f,m,_;const r=t.options,i=(f=(d=(h=t.fetchOptions)==null?void 0:h.meta)==null?void 0:d.fetchMore)==null?void 0:f.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((_=t.state.data)==null?void 0:_.pageParams)||[];let o={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const y=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},g=PL(t.options,t.fetchOptions),p=async(x,b,S)=>{if(v)return Promise.reject();if(b==null&&x.pages.length)return Promise.resolve(x);const C={queryKey:t.queryKey,pageParam:b,direction:S?"backward":"forward",meta:t.options.meta};y(C);const E=await g(C),{maxPages:k}=t.options,T=S?DQ:jQ;return{pages:T(x.pages,E,k),pageParams:T(x.pageParams,b,k)}};if(i&&s.length){const x=i==="backward",b=x?HQ:cT,S={pages:s,pageParams:a},C=b(r,S);o=await p(S,C,x)}else{const x=e??s.length;do{const b=l===0?a[0]??r.initialPageParam:cT(r,o);if(l>0&&b==null)break;o=await p(o,b),l++}while(l{var v,y;return(y=(v=t.options).persister)==null?void 0:y.call(v,c,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=c}}}function cT(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function HQ(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var ln,Ao,jo,ru,iu,Do,su,ou,Rj,WQ=(Rj=class{constructor(e={}){Pe(this,ln);Pe(this,Ao);Pe(this,jo);Pe(this,ru);Pe(this,iu);Pe(this,Do);Pe(this,su);Pe(this,ou);we(this,ln,e.queryCache||new BQ),we(this,Ao,e.mutationCache||new zQ),we(this,jo,e.defaultOptions||{}),we(this,ru,new Map),we(this,iu,new Map),we(this,Do,0)}mount(){Gp(this,Do)._++,K(this,Do)===1&&(we(this,su,HC.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,ln).onFocus())})),we(this,ou,yv.subscribe(async e=>{e&&(await this.resumePausedMutations(),K(this,ln).onOnline())})))}unmount(){var e,t;Gp(this,Do)._--,K(this,Do)===0&&((e=K(this,su))==null||e.call(this),we(this,su,void 0),(t=K(this,ou))==null||t.call(this),we(this,ou,void 0))}isFetching(e){return K(this,ln).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return K(this,Ao).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,ln).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=K(this,ln).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ic(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return K(this,ln).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=K(this,ln).get(r.queryHash),s=i==null?void 0:i.state.data,a=MQ(t,s);if(a!==void 0)return K(this,ln).build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Sn.batch(()=>K(this,ln).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=K(this,ln).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=K(this,ln);Sn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=K(this,ln),r={type:"active",...e};return Sn.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Sn.batch(()=>K(this,ln).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Kr).catch(Kr)}invalidateQueries(e,t={}){return Sn.batch(()=>{if(K(this,ln).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none")return Promise.resolve();const n={...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sn.batch(()=>K(this,ln).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let s=i.fetch(void 0,n);return n.throwOnError||(s=s.catch(Kr)),i.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(r).then(Kr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=K(this,ln).build(this,t);return n.isStaleByTime(Ic(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Kr).catch(Kr)}fetchInfiniteQuery(e){return e.behavior=lT(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Kr).catch(Kr)}ensureInfiniteQueryData(e){return e.behavior=lT(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yv.isOnline()?K(this,Ao).resumePausedMutations():Promise.resolve()}getQueryCache(){return K(this,ln)}getMutationCache(){return K(this,Ao)}getDefaultOptions(){return K(this,jo)}setDefaultOptions(e){we(this,jo,e)}setQueryDefaults(e,t){K(this,ru).set(fl(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...K(this,ru).values()],n={};return t.forEach(r=>{ff(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){K(this,iu).set(fl(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...K(this,iu).values()];let n={};return t.forEach(r=>{ff(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...K(this,jo).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=FC(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===zC&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...K(this,jo).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){K(this,ln).clear(),K(this,Ao).clear()}},ln=new WeakMap,Ao=new WeakMap,jo=new WeakMap,ru=new WeakMap,iu=new WeakMap,Do=new WeakMap,su=new WeakMap,ou=new WeakMap,Rj),gr,ot,Zf,ir,Xa,au,Lo,Zi,ep,lu,cu,Qa,Ja,No,uu,St,ph,dw,hw,fw,pw,mw,gw,vw,HL,Mj,UQ=(Mj=class extends qu{constructor(t,n){super();Pe(this,St);Pe(this,gr);Pe(this,ot);Pe(this,Zf);Pe(this,ir);Pe(this,Xa);Pe(this,au);Pe(this,Lo);Pe(this,Zi);Pe(this,ep);Pe(this,lu);Pe(this,cu);Pe(this,Qa);Pe(this,Ja);Pe(this,No);Pe(this,uu,new Set);this.options=n,we(this,gr,t),we(this,Zi,null),we(this,Lo,uw()),this.options.experimental_prefetchInRender||K(this,Lo).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(K(this,ot).addObserver(this),uT(K(this,ot),this.options)?Ze(this,St,ph).call(this):this.updateResult(),Ze(this,St,pw).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yw(K(this,ot),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yw(K(this,ot),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ze(this,St,mw).call(this),Ze(this,St,gw).call(this),K(this,ot).removeObserver(this)}setOptions(t,n){const r=this.options,i=K(this,ot);if(this.options=K(this,gr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ei(this.options.enabled,K(this,ot))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ze(this,St,vw).call(this),K(this,ot).setOptions(this.options),r._defaulted&&!vv(this.options,r)&&K(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:K(this,ot),observer:this});const s=this.hasListeners();s&&dT(K(this,ot),i,this.options,r)&&Ze(this,St,ph).call(this),this.updateResult(n),s&&(K(this,ot)!==i||Ei(this.options.enabled,K(this,ot))!==Ei(r.enabled,K(this,ot))||Ic(this.options.staleTime,K(this,ot))!==Ic(r.staleTime,K(this,ot)))&&Ze(this,St,dw).call(this);const a=Ze(this,St,hw).call(this);s&&(K(this,ot)!==i||Ei(this.options.enabled,K(this,ot))!==Ei(r.enabled,K(this,ot))||a!==K(this,No))&&Ze(this,St,fw).call(this,a)}getOptimisticResult(t){const n=K(this,gr).getQueryCache().build(K(this,gr),t),r=this.createResult(n,t);return qQ(this,r)&&(we(this,ir,r),we(this,au,this.options),we(this,Xa,K(this,ot).state)),r}getCurrentResult(){return K(this,ir)}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){K(this,uu).add(t)}getCurrentQuery(){return K(this,ot)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=K(this,gr).defaultQueryOptions(t),r=K(this,gr).getQueryCache().build(K(this,gr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Ze(this,St,ph).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),K(this,ir)))}createResult(t,n){var k;const r=K(this,ot),i=this.options,s=K(this,ir),a=K(this,Xa),o=K(this,au),c=t!==r?t.state:K(this,Zf),{state:h}=t;let d={...h},f=!1,m;if(n._optimisticResults){const T=this.hasListeners(),R=!T&&uT(t,n),M=T&&dT(t,r,n,i);(R||M)&&(d={...d,...FL(h.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:_,errorUpdatedAt:v,status:y}=d;if(n.select&&d.data!==void 0)if(s&&d.data===(a==null?void 0:a.data)&&n.select===K(this,ep))m=K(this,lu);else try{we(this,ep,n.select),m=n.select(d.data),m=cw(s==null?void 0:s.data,m,n),we(this,lu,m),we(this,Zi,null)}catch(T){we(this,Zi,T)}else m=d.data;if(n.placeholderData!==void 0&&m===void 0&&y==="pending"){let T;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(o==null?void 0:o.placeholderData))T=s.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData((k=K(this,cu))==null?void 0:k.state.data,K(this,cu)):n.placeholderData,n.select&&T!==void 0)try{T=n.select(T),we(this,Zi,null)}catch(R){we(this,Zi,R)}T!==void 0&&(y="success",m=cw(s==null?void 0:s.data,T,n),f=!0)}K(this,Zi)&&(_=K(this,Zi),m=K(this,lu),v=Date.now(),y="error");const g=d.fetchStatus==="fetching",p=y==="pending",x=y==="error",b=p&&g,S=m!==void 0,E={status:y,fetchStatus:d.fetchStatus,isPending:p,isSuccess:y==="success",isError:x,isInitialLoading:b,isLoading:b,data:m,dataUpdatedAt:d.dataUpdatedAt,error:_,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:g,isRefetching:g&&!p,isLoadingError:x&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&S,isStale:WC(t,n),refetch:this.refetch,promise:K(this,Lo)};if(this.options.experimental_prefetchInRender){const T=D=>{E.status==="error"?D.reject(E.error):E.data!==void 0&&D.resolve(E.data)},R=()=>{const D=we(this,Lo,E.promise=uw());T(D)},M=K(this,Lo);switch(M.status){case"pending":t.queryHash===r.queryHash&&T(M);break;case"fulfilled":(E.status==="error"||E.data!==M.value)&&R();break;case"rejected":(E.status!=="error"||E.error!==M.reason)&&R();break}}return E}updateResult(t){const n=K(this,ir),r=this.createResult(K(this,ot),this.options);if(we(this,Xa,K(this,ot).state),we(this,au,this.options),K(this,Xa).data!==void 0&&we(this,cu,K(this,ot)),vv(r,n))return;we(this,ir,r);const i={},s=()=>{if(!n)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!K(this,uu).size)return!0;const l=new Set(o??K(this,uu));return this.options.throwOnError&&l.add("error"),Object.keys(K(this,ir)).some(c=>{const h=c;return K(this,ir)[h]!==n[h]&&l.has(h)})};(t==null?void 0:t.listeners)!==!1&&s()&&(i.listeners=!0),Ze(this,St,HL).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ze(this,St,pw).call(this)}},gr=new WeakMap,ot=new WeakMap,Zf=new WeakMap,ir=new WeakMap,Xa=new WeakMap,au=new WeakMap,Lo=new WeakMap,Zi=new WeakMap,ep=new WeakMap,lu=new WeakMap,cu=new WeakMap,Qa=new WeakMap,Ja=new WeakMap,No=new WeakMap,uu=new WeakMap,St=new WeakSet,ph=function(t){Ze(this,St,vw).call(this);let n=K(this,ot).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Kr)),n},dw=function(){Ze(this,St,mw).call(this);const t=Ic(this.options.staleTime,K(this,ot));if(hl||K(this,ir).isStale||!aw(t))return;const r=LL(K(this,ir).dataUpdatedAt,t)+1;we(this,Qa,setTimeout(()=>{K(this,ir).isStale||this.updateResult()},r))},hw=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(K(this,ot)):this.options.refetchInterval)??!1},fw=function(t){Ze(this,St,gw).call(this),we(this,No,t),!(hl||Ei(this.options.enabled,K(this,ot))===!1||!aw(K(this,No))||K(this,No)===0)&&we(this,Ja,setInterval(()=>{(this.options.refetchIntervalInBackground||HC.isFocused())&&Ze(this,St,ph).call(this)},K(this,No)))},pw=function(){Ze(this,St,dw).call(this),Ze(this,St,fw).call(this,Ze(this,St,hw).call(this))},mw=function(){K(this,Qa)&&(clearTimeout(K(this,Qa)),we(this,Qa,void 0))},gw=function(){K(this,Ja)&&(clearInterval(K(this,Ja)),we(this,Ja,void 0))},vw=function(){const t=K(this,gr).getQueryCache().build(K(this,gr),this.options);if(t===K(this,ot))return;const n=K(this,ot);we(this,ot,t),we(this,Zf,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},HL=function(t){Sn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(K(this,ir))}),K(this,gr).getQueryCache().notify({query:K(this,ot),type:"observerResultsUpdated"})})},Mj);function VQ(e,t){return Ei(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function uT(e,t){return VQ(e,t)||e.state.data!==void 0&&yw(e,t,t.refetchOnMount)}function yw(e,t,n){if(Ei(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&WC(e,t)}return!1}function dT(e,t,n,r){return(e!==t||Ei(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&WC(e,n)}function WC(e,t){return Ei(t.enabled,e)!==!1&&e.isStaleByTime(Ic(t.staleTime,e))}function qQ(e,t){return!vv(e.getCurrentResult(),t)}var Po,Oo,vr,Is,Xs,pg,xw,Aj,GQ=(Aj=class extends qu{constructor(n,r){super();Pe(this,Xs);Pe(this,Po);Pe(this,Oo);Pe(this,vr);Pe(this,Is);we(this,Po,n),this.setOptions(r),this.bindMethods(),Ze(this,Xs,pg).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=K(this,Po).defaultMutationOptions(n),vv(this.options,r)||K(this,Po).getMutationCache().notify({type:"observerOptionsUpdated",mutation:K(this,vr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&fl(r.mutationKey)!==fl(this.options.mutationKey)?this.reset():((i=K(this,vr))==null?void 0:i.state.status)==="pending"&&K(this,vr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=K(this,vr))==null||n.removeObserver(this)}onMutationUpdate(n){Ze(this,Xs,pg).call(this),Ze(this,Xs,xw).call(this,n)}getCurrentResult(){return K(this,Oo)}reset(){var n;(n=K(this,vr))==null||n.removeObserver(this),we(this,vr,void 0),Ze(this,Xs,pg).call(this),Ze(this,Xs,xw).call(this)}mutate(n,r){var i;return we(this,Is,r),(i=K(this,vr))==null||i.removeObserver(this),we(this,vr,K(this,Po).getMutationCache().build(K(this,Po),this.options)),K(this,vr).addObserver(this),K(this,vr).execute(n)}},Po=new WeakMap,Oo=new WeakMap,vr=new WeakMap,Is=new WeakMap,Xs=new WeakSet,pg=function(){var r;const n=((r=K(this,vr))==null?void 0:r.state)??zL();we(this,Oo,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},xw=function(n){Sn.batch(()=>{var r,i,s,a,o,l,c,h;if(K(this,Is)&&this.hasListeners()){const d=K(this,Oo).variables,f=K(this,Oo).context;(n==null?void 0:n.type)==="success"?((i=(r=K(this,Is)).onSuccess)==null||i.call(r,n.data,d,f),(a=(s=K(this,Is)).onSettled)==null||a.call(s,n.data,null,d,f)):(n==null?void 0:n.type)==="error"&&((l=(o=K(this,Is)).onError)==null||l.call(o,n.error,d,f),(h=(c=K(this,Is)).onSettled)==null||h.call(c,void 0,n.error,d,f))}this.listeners.forEach(d=>{d(K(this,Oo))})})},Aj),WL=w.createContext(void 0),UL=e=>{const t=w.useContext(WL);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},KQ=({client:e,children:t})=>(w.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(WL.Provider,{value:e,children:t})),VL=w.createContext(!1),YQ=()=>w.useContext(VL);VL.Provider;function XQ(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var QQ=w.createContext(XQ()),JQ=()=>w.useContext(QQ);function qL(e,t){return typeof e=="function"?e(...t):!!e}function _w(){}var ZQ=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},eJ=e=>{w.useEffect(()=>{e.clearReset()},[e])},tJ=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&qL(n,[e.error,r]),nJ=e=>{const t=e.staleTime;e.suspense&&(e.staleTime=typeof t=="function"?(...n)=>Math.max(t(...n),1e3):Math.max(t??1e3,1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},rJ=(e,t)=>e.isLoading&&e.isFetching&&!t,iJ=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,hT=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function sJ(e,t,n){var h,d,f,m,_;const r=UL(),i=YQ(),s=JQ(),a=r.defaultQueryOptions(e);(d=(h=r.getDefaultOptions().queries)==null?void 0:h._experimental_beforeQuery)==null||d.call(h,a),a._optimisticResults=i?"isRestoring":"optimistic",nJ(a),ZQ(a,s),eJ(s);const o=!r.getQueryCache().get(a.queryHash),[l]=w.useState(()=>new t(r,a)),c=l.getOptimisticResult(a);if(w.useSyncExternalStore(w.useCallback(v=>{const y=i?_w:l.subscribe(Sn.batchCalls(v));return l.updateResult(),y},[l,i]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),w.useEffect(()=>{l.setOptions(a,{listeners:!1})},[a,l]),iJ(a,c))throw hT(a,l,s);if(tJ({result:c,errorResetBoundary:s,throwOnError:a.throwOnError,query:r.getQueryCache().get(a.queryHash)}))throw c.error;if((m=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,a,c),a.experimental_prefetchInRender&&!hl&&rJ(c,i)){const v=o?hT(a,l,s):(_=r.getQueryCache().get(a.queryHash))==null?void 0:_.promise;v==null||v.catch(_w).finally(()=>{l.updateResult()})}return a.notifyOnChangeProps?c:l.trackResult(c)}function oJ(e,t){return sJ(e,UQ)}function pl(e,t){const n=UL(),[r]=w.useState(()=>new GQ(n,e));w.useEffect(()=>{r.setOptions(e)},[r,e]);const i=w.useSyncExternalStore(w.useCallback(a=>r.subscribe(Sn.batchCalls(a)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),s=w.useCallback((a,o)=>{r.mutate(a,o).catch(_w)},[r]);if(i.error&&qL(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:s,mutateAsync:i.mutate}}const GL=Symbol("");function Gu(e){const t=nt(e,(n,r,i)=>{const s=typeof i=="function"?i(n(t)):i;r(t,s===GL?e:s)});return t}const aJ=e=>typeof(e==null?void 0:e.then)=="function";function lJ(e=()=>{try{return window.localStorage}catch{return}},t){var n;let r,i;const s={getItem:(l,c)=>{var h,d;const f=_=>{if(_=_||"",r!==_){try{i=JSON.parse(_,t==null?void 0:t.reviver)}catch{return c}r=_}return i},m=(d=(h=e())==null?void 0:h.getItem(l))!=null?d:null;return aJ(m)?m.then(f):f(m)},setItem:(l,c)=>{var h;return(h=e())==null?void 0:h.setItem(l,JSON.stringify(c,void 0))},removeItem:l=>{var c;return(c=e())==null?void 0:c.removeItem(l)}},a=l=>(c,h,d)=>l(c,f=>{let m;try{m=JSON.parse(f||"")}catch{m=d}h(m)});let o;try{o=(n=e())==null?void 0:n.subscribe}catch{}return!o&&typeof window<"u"&&typeof window.addEventListener=="function"&&window.Storage&&(o=(l,c)=>{if(!(e()instanceof window.Storage))return()=>{};const h=d=>{d.storageArea===e()&&d.key===l&&c(d.newValue)};return window.addEventListener("storage",h),()=>{window.removeEventListener("storage",h)}}),o&&(s.subscribe=a(o)),s}const cJ=lJ();function KL(e,t,n=cJ,r){const i=nt(t);return i.onMount=a=>{a(n.getItem(e,t));let o;return n.subscribe&&(o=n.subscribe(e,a,t)),o},nt(a=>a(i),(a,o,l)=>{const c=typeof l=="function"?l(a(i)):l;return c===GL?(o(i,t),n.removeItem(e)):c instanceof Promise?c.then(h=>(o(i,h),n.setItem(e,h))):(o(i,c),n.setItem(e,c))})}const X0=nt(!1),YL=nt(void 0),UC=()=>{const[e,t]=Tr(X0),[n,r]=Tr(YL);return{isAccountModalOpen:e,setAccountModalOpen:t,accountModalTab:n,setAccountModalTab:r}},uJ=()=>{const e=it(X0),t=it(YL);return n=>{e(!0),n&&t(n)}},XL=()=>{const e=it(X0);return()=>{e(!1)}},Q0=nt(!1),QL=Gu({title:"",onConfirm:()=>{}}),lp=()=>{const e=it(Q0),t=it(QL);return n=>{t(n),e(!0)}},dJ=()=>{const e=it(Q0);return()=>{e(!1)}},hJ=()=>{const e=ct(Q0),t=ct(QL);return{isOpen:e,...t}},J0=nt(!1),JL=Gu({title:"",onSubmit:()=>{}}),cp=()=>{const e=it(J0),t=it(JL);return n=>{t(n),e(!0)}},fJ=()=>{const e=it(J0);return()=>{e(!1)}},pJ=()=>{const e=ct(J0),t=ct(JL);return{isOpen:e,...t}},VC=nt(!1),qC=nt(!1),GC=nt(!1),ZL=()=>{const[e,t]=Tr(VC);return{isSheetOpen:e,setIsSheetOpen:t}},eN=()=>{const[e,t]=Tr(qC);return{isSheetOpen:e,setIsSheetOpen:t}},tN=()=>{const[e,t]=Tr(GC);return{isSheetOpen:e,setIsSheetOpen:t}},Z0=()=>{const e=it(VC),t=it(qC),n=it(GC);return()=>{e(!1),t(!1),n(!1)}},e1=Gu(!1),nN=Gu(void 0),bw="playerModal",t1=e=>{rP(bw,e)},n1=()=>{const e=it(nN),t=it(e1);return n=>{const r="mutex"in n?`${n.mutex}#${n.netid}`:n.license;t1(r),e(n),t(!0)}},KC=()=>{const e=it(e1);return()=>{t1(void 0),e(!1)}},mJ=()=>{const e=ct(nN),[t,n]=Tr(e1);return{isModalOpen:t,playerRef:e,closeModal:()=>{t1(void 0),n(!1)}}};function gJ(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vJ=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,yJ=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,xJ={};function fT(e,t){return(xJ.jsx?yJ:vJ).test(e)}const _J=/[ \t\n\f\r]/g;function bJ(e){return typeof e=="object"?e.type==="text"?pT(e.value):!1:pT(e)}function pT(e){return e.replace(_J,"")===""}class up{constructor(t,n,r){this.property=t,this.normal=n,r&&(this.space=r)}}up.prototype.property={};up.prototype.normal={};up.prototype.space=null;function rN(e,t){const n={},r={};let i=-1;for(;++i4&&n.slice(0,4)==="data"&&EJ.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(gT,AJ);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!gT.test(s)){let a=s.replace(TJ,MJ);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}i=YC}return new i(r,t)}function MJ(e){return"-"+e.toLowerCase()}function AJ(e){return e.charAt(1).toUpperCase()}const jJ={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"},DJ=rN([oN,sN,cN,uN,CJ],"html"),XC=rN([oN,sN,cN,uN,kJ],"svg");function LJ(e){return e.join(" ").trim()}var dN={},vT=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NJ=/\n/g,PJ=/^\s*/,OJ=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,IJ=/^:\s*/,$J=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,BJ=/^[;\s]*/,FJ=/^\s+|\s+$/g,zJ=` `,yT="/",xT="*",Oa="",HJ="comment",WJ="declaration",UJ=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(_){var v=_.match(NJ);v&&(n+=v.length);var y=_.lastIndexOf(zJ);r=~y?_.length-y:r+_.length}function s(){var _={line:n,column:r};return function(v){return v.position=new a(_),c(),v}}function a(_){this.start=_,this.end={line:n,column:r},this.source=t.source}a.prototype.content=e;function o(_){var v=new Error(t.source+":"+n+":"+r+": "+_);if(v.reason=_,v.filename=t.source,v.line=n,v.column=r,v.source=e,!t.silent)throw v}function l(_){var v=_.exec(e);if(v){var y=v[0];return i(y),e=e.slice(y.length),v}}function c(){l(PJ)}function h(_){var v;for(_=_||[];v=d();)v!==!1&&_.push(v);return _}function d(){var _=s();if(!(yT!=e.charAt(0)||xT!=e.charAt(1))){for(var v=2;Oa!=e.charAt(v)&&(xT!=e.charAt(v)||yT!=e.charAt(v+1));)++v;if(v+=2,Oa===e.charAt(v-1))return o("End of comment missing");var y=e.slice(2,v-2);return r+=2,i(y),e=e.slice(v),r+=2,_({type:HJ,comment:y})}}function f(){var _=s(),v=l(OJ);if(v){if(d(),!l(IJ))return o("property missing ':'");var y=l($J),g=_({type:WJ,property:_T(v[0].replace(vT,Oa)),value:y?_T(y[0].replace(vT,Oa)):Oa});return l(BJ),g}}function m(){var _=[];h(_);for(var v;v=f();)v!==!1&&(_.push(v),h(_));return _}return c(),m()};function _T(e){return e?e.replace(FJ,Oa):Oa}var VJ=is&&is.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dN,"__esModule",{value:!0});var bT=dN.default=GJ,qJ=VJ(UJ);function GJ(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,qJ.default)(e),i=typeof t=="function";return r.forEach(function(s){if(s.type==="declaration"){var a=s.property,o=s.value;i?t(a,o,s):o&&(n=n||{},n[a]=o)}}),n}const KJ=bT.default||bT,hN=fN("end"),QC=fN("start");function fN(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 YJ(e){const t=QC(e),n=hN(e);if(t&&n)return{start:t,end:n}}function Oh(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?wT(e.position):"start"in e||"end"in e?wT(e):"line"in e||"column"in e?Cw(e):""}function Cw(e){return ST(e&&e.line)+":"+ST(e&&e.column)}function wT(e){return Cw(e&&e.start)+"-"+Cw(e&&e.end)}function ST(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=Oh(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 JC={}.hasOwnProperty,XJ=new Map,QJ=/[A-Z]/g,JJ=/-([a-z])/g,ZJ=new Set(["table","tbody","thead","tfoot","tr"]),eZ=new Set(["td","th"]),pN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function tZ(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=cZ(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=lZ(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?XC:DJ,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=mN(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function mN(e,t,n){if(t.type==="element")return nZ(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return rZ(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return sZ(e,t,n);if(t.type==="mdxjsEsm")return iZ(e,t);if(t.type==="root")return oZ(e,t,n);if(t.type==="text")return aZ(e,t)}function nZ(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=XC,e.schema=i),e.ancestors.push(t);const s=vN(e,t.tagName,!1),a=uZ(e,t);let o=e5(e,t);return ZJ.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!bJ(l):!0})),gN(e,a,s,t),ZC(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function rZ(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}pf(e,t.position)}function iZ(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);pf(e,t.position)}function sZ(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=XC,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:vN(e,t.name,!0),a=dZ(e,t),o=e5(e,t);return gN(e,a,s,t),ZC(a,o),e.ancestors.pop(),e.schema=r,e.create(t,s,a,n)}function oZ(e,t,n){const r={};return ZC(r,e5(e,t)),e.create(t,e.Fragment,r,n)}function aZ(e,t){return t.value}function gN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function ZC(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function lZ(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 cZ(e,t){return n;function n(r,i,s,a){const o=Array.isArray(s.children),l=QC(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 uZ(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&JC.call(t.properties,i)){const s=hZ(e,i,t.properties[i]);if(s){const[a,o]=s;e.tableCellAlignToStyle&&a==="align"&&typeof o=="string"&&eZ.has(t.tagName)?r=o:n[a]=o}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function dZ(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const a=s.expression;a.type;const o=a.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else pf(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,s=e.evaluater.evaluateExpression(o.expression)}else pf(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function e5(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:XJ;for(;++ri?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);s0?(ms(e,e.length,0,t),e):t}const ET={}.hasOwnProperty;function bZ(e){const t={};let n=-1;for(;++n13&&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 Bc(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ts=ya(/[A-Za-z]/),Br=ya(/[\dA-Za-z]/),CZ=ya(/[#-'*+\--9=?A-Z^-~]/);function kw(e){return e!==null&&(e<32||e===127)}const Ew=ya(/\d/),kZ=ya(/[\dA-Fa-f]/),EZ=ya(/[!-/:-@[-`{-~]/);function ze(e){return e!==null&&e<-2}function Rr(e){return e!==null&&(e<0||e===32)}function bt(e){return e===-2||e===-1||e===32}const TZ=ya(new RegExp("\\p{P}|\\p{S}","u")),RZ=ya(/\s/);function ya(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Yu(e){const t=[];let n=-1,r=0,i=0;for(;++n55295&&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 Ft(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return a;function a(l){return bt(l)?(e.enter(n),o(l)):t(l)}function o(l){return bt(l)&&s++a))return;const E=t.events.length;let k=E,T,R;for(;k--;)if(t.events[k][0]==="exit"&&t.events[k][1].type==="chunkFlow"){if(T){R=t.events[k][1].end;break}T=!0}for(g(r),C=E;Cx;){const S=n[b];t.containerState=S[1],S[0].exit.call(t,e)}n.length=x}function p(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function LZ(e,t,n){return Ft(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function RT(e){if(e===null||Rr(e)||RZ(e))return 1;if(TZ(e))return 2}function n5(e,t,n){const r=[];let i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const d={...e[r][1].end},f={...e[n][1].start};MT(d,-l),MT(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:{...e[r][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:f},s={type:l>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:l>1?"strong":"emphasis",start:{...a.start},end:{...o.end}},e[r][1].end={...a.start},e[n][1].start={...o.end},c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=ei(c,[["enter",e[r][1],t],["exit",e[r][1],t]])),c=ei(c,[["enter",i,t],["enter",a,t],["exit",a,t],["enter",s,t]]),c=ei(c,n5(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),c=ei(c,[["exit",s,t],["enter",o,t],["exit",o,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,c=ei(c,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ms(e,r-1,n-r+3,c),n=r+c.length-h-2;break}}for(n=-1;++n0&&bt(C)?Ft(e,p,"linePrefix",s+1)(C):p(C)}function p(C){return C===null||ze(C)?e.check(AT,v,b)(C):(e.enter("codeFlowValue"),x(C))}function x(C){return C===null||ze(C)?(e.exit("codeFlowValue"),p(C)):(e.consume(C),x)}function b(C){return e.exit("codeFenced"),t(C)}function S(C,E,k){let T=0;return R;function R(P){return C.enter("lineEnding"),C.consume(P),C.exit("lineEnding"),M}function M(P){return C.enter("codeFencedFence"),bt(P)?Ft(C,D,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):D(P)}function D(P){return P===o?(C.enter("codeFencedFenceSequence"),N(P)):k(P)}function N(P){return P===o?(T++,C.consume(P),N):T>=a?(C.exit("codeFencedFenceSequence"),bt(P)?Ft(C,L,"whitespace")(P):L(P)):k(P)}function L(P){return P===null||ze(P)?(C.exit("codeFencedFence"),E(P)):k(P)}}}function VZ(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 Vx={name:"codeIndented",tokenize:GZ},qZ={partial:!0,tokenize:KZ};function GZ(e,t,n){const r=this;return i;function i(c){return e.enter("codeIndented"),Ft(e,s,"linePrefix",5)(c)}function s(c){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?a(c):n(c)}function a(c){return c===null?l(c):ze(c)?e.attempt(qZ,a,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||ze(c)?(e.exit("codeFlowValue"),a(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function KZ(e,t,n){const r=this;return i;function i(a){return r.parser.lazy[r.now().line]?n(a):ze(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),i):Ft(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):ze(a)?i(a):n(a)}}const YZ={name:"codeText",previous:QZ,resolve:XZ,tokenize:JZ};function XZ(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=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Id(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Id(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Id(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function CN(e,t,n,r,i,s,a,o,l){const c=l||Number.POSITIVE_INFINITY;let h=0;return d;function d(g){return g===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(g),e.exit(s),f):g===null||g===32||g===41||kw(g)?n(g):(e.enter(r),e.enter(a),e.enter(o),e.enter("chunkString",{contentType:"string"}),v(g))}function f(g){return g===62?(e.enter(s),e.consume(g),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(g))}function m(g){return g===62?(e.exit("chunkString"),e.exit(o),f(g)):g===null||g===60||ze(g)?n(g):(e.consume(g),g===92?_:m)}function _(g){return g===60||g===62||g===92?(e.consume(g),m):m(g)}function v(g){return!h&&(g===null||g===41||Rr(g))?(e.exit("chunkString"),e.exit(o),e.exit(a),e.exit(r),t(g)):h999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in a.parser.constructs?n(m):m===93?(e.exit(s),e.enter(i),e.consume(m),e.exit(i),e.exit(r),t):ze(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),d(m))}function d(m){return m===null||m===91||m===93||ze(m)||o++>999?(e.exit("chunkString"),h(m)):(e.consume(m),l||(l=!bt(m)),m===92?f:d)}function f(m){return m===91||m===92||m===93?(e.consume(m),o++,d):d(m)}}function EN(e,t,n,r,i,s){let a;return o;function o(f){return f===34||f===39||f===40?(e.enter(r),e.enter(i),e.consume(f),e.exit(i),a=f===40?41:f,l):n(f)}function l(f){return f===a?(e.enter(i),e.consume(f),e.exit(i),e.exit(r),t):(e.enter(s),c(f))}function c(f){return f===a?(e.exit(s),l(a)):f===null?n(f):ze(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ft(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(f))}function h(f){return f===a||f===null||ze(f)?(e.exit("chunkString"),c(f)):(e.consume(f),f===92?d:h)}function d(f){return f===a||f===92?(e.consume(f),h):h(f)}}function Ih(e,t){let n;return r;function r(i){return ze(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):bt(i)?Ft(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const oee={name:"definition",tokenize:lee},aee={partial:!0,tokenize:cee};function lee(e,t,n){const r=this;let i;return s;function s(m){return e.enter("definition"),a(m)}function a(m){return kN.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return i=Bc(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):n(m)}function l(m){return Rr(m)?Ih(e,c)(m):c(m)}function c(m){return CN(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function h(m){return e.attempt(aee,d,d)(m)}function d(m){return bt(m)?Ft(e,f,"whitespace")(m):f(m)}function f(m){return m===null||ze(m)?(e.exit("definition"),r.parser.defined.push(i),t(m)):n(m)}}function cee(e,t,n){return r;function r(o){return Rr(o)?Ih(e,i)(o):n(o)}function i(o){return EN(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function s(o){return bt(o)?Ft(e,a,"whitespace")(o):a(o)}function a(o){return o===null||ze(o)?t(o):n(o)}}const uee={name:"hardBreakEscape",tokenize:dee};function dee(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return ze(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const hee={name:"headingAtx",resolve:fee,tokenize:pee};function fee(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"},ms(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function pee(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),a(h)}function a(h){return h===35&&r++<6?(e.consume(h),a):h===null||Rr(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),l(h)):h===null||ze(h)?(e.exit("atxHeading"),t(h)):bt(h)?Ft(e,o,"whitespace")(h):(e.enter("atxHeadingText"),c(h))}function l(h){return h===35?(e.consume(h),l):(e.exit("atxHeadingSequence"),o(h))}function c(h){return h===null||h===35||Rr(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),c)}}const mee=["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"],DT=["pre","script","style","textarea"],gee={concrete:!0,name:"htmlFlow",resolveTo:xee,tokenize:_ee},vee={partial:!0,tokenize:wee},yee={partial:!0,tokenize:bee};function xee(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 _ee(e,t,n){const r=this;let i,s,a,o,l;return c;function c(B){return h(B)}function h(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),d}function d(B){return B===33?(e.consume(B),f):B===47?(e.consume(B),s=!0,v):B===63?(e.consume(B),i=3,r.interrupt?t:j):ts(B)?(e.consume(B),a=String.fromCharCode(B),y):n(B)}function f(B){return B===45?(e.consume(B),i=2,m):B===91?(e.consume(B),i=5,o=0,_):ts(B)?(e.consume(B),i=4,r.interrupt?t:j):n(B)}function m(B){return B===45?(e.consume(B),r.interrupt?t:j):n(B)}function _(B){const G="CDATA[";return B===G.charCodeAt(o++)?(e.consume(B),o===G.length?r.interrupt?t:D:_):n(B)}function v(B){return ts(B)?(e.consume(B),a=String.fromCharCode(B),y):n(B)}function y(B){if(B===null||B===47||B===62||Rr(B)){const G=B===47,Z=a.toLowerCase();return!G&&!s&&DT.includes(Z)?(i=1,r.interrupt?t(B):D(B)):mee.includes(a.toLowerCase())?(i=6,G?(e.consume(B),g):r.interrupt?t(B):D(B)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):s?p(B):x(B))}return B===45||Br(B)?(e.consume(B),a+=String.fromCharCode(B),y):n(B)}function g(B){return B===62?(e.consume(B),r.interrupt?t:D):n(B)}function p(B){return bt(B)?(e.consume(B),p):R(B)}function x(B){return B===47?(e.consume(B),R):B===58||B===95||ts(B)?(e.consume(B),b):bt(B)?(e.consume(B),x):R(B)}function b(B){return B===45||B===46||B===58||B===95||Br(B)?(e.consume(B),b):S(B)}function S(B){return B===61?(e.consume(B),C):bt(B)?(e.consume(B),S):x(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,E):bt(B)?(e.consume(B),C):k(B)}function E(B){return B===l?(e.consume(B),l=null,T):B===null||ze(B)?n(B):(e.consume(B),E)}function k(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Rr(B)?S(B):(e.consume(B),k)}function T(B){return B===47||B===62||bt(B)?x(B):n(B)}function R(B){return B===62?(e.consume(B),M):n(B)}function M(B){return B===null||ze(B)?D(B):bt(B)?(e.consume(B),M):n(B)}function D(B){return B===45&&i===2?(e.consume(B),I):B===60&&i===1?(e.consume(B),z):B===62&&i===4?(e.consume(B),F):B===63&&i===3?(e.consume(B),j):B===93&&i===5?(e.consume(B),A):ze(B)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(vee,H,N)(B)):B===null||ze(B)?(e.exit("htmlFlowData"),N(B)):(e.consume(B),D)}function N(B){return e.check(yee,L,H)(B)}function L(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),P}function P(B){return B===null||ze(B)?N(B):(e.enter("htmlFlowData"),D(B))}function I(B){return B===45?(e.consume(B),j):D(B)}function z(B){return B===47?(e.consume(B),a="",O):D(B)}function O(B){if(B===62){const G=a.toLowerCase();return DT.includes(G)?(e.consume(B),F):D(B)}return ts(B)&&a.length<8?(e.consume(B),a+=String.fromCharCode(B),O):D(B)}function A(B){return B===93?(e.consume(B),j):D(B)}function j(B){return B===62?(e.consume(B),F):B===45&&i===2?(e.consume(B),j):D(B)}function F(B){return B===null||ze(B)?(e.exit("htmlFlowData"),H(B)):(e.consume(B),F)}function H(B){return e.exit("htmlFlow"),t(B)}}function bee(e,t,n){const r=this;return i;function i(a){return ze(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 wee(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(r1,t,n)}}const See={name:"htmlText",tokenize:Cee};function Cee(e,t,n){const r=this;let i,s,a;return o;function o(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),l}function l(j){return j===33?(e.consume(j),c):j===47?(e.consume(j),S):j===63?(e.consume(j),x):ts(j)?(e.consume(j),k):n(j)}function c(j){return j===45?(e.consume(j),h):j===91?(e.consume(j),s=0,_):ts(j)?(e.consume(j),p):n(j)}function h(j){return j===45?(e.consume(j),m):n(j)}function d(j){return j===null?n(j):j===45?(e.consume(j),f):ze(j)?(a=d,z(j)):(e.consume(j),d)}function f(j){return j===45?(e.consume(j),m):d(j)}function m(j){return j===62?I(j):j===45?f(j):d(j)}function _(j){const F="CDATA[";return j===F.charCodeAt(s++)?(e.consume(j),s===F.length?v:_):n(j)}function v(j){return j===null?n(j):j===93?(e.consume(j),y):ze(j)?(a=v,z(j)):(e.consume(j),v)}function y(j){return j===93?(e.consume(j),g):v(j)}function g(j){return j===62?I(j):j===93?(e.consume(j),g):v(j)}function p(j){return j===null||j===62?I(j):ze(j)?(a=p,z(j)):(e.consume(j),p)}function x(j){return j===null?n(j):j===63?(e.consume(j),b):ze(j)?(a=x,z(j)):(e.consume(j),x)}function b(j){return j===62?I(j):x(j)}function S(j){return ts(j)?(e.consume(j),C):n(j)}function C(j){return j===45||Br(j)?(e.consume(j),C):E(j)}function E(j){return ze(j)?(a=E,z(j)):bt(j)?(e.consume(j),E):I(j)}function k(j){return j===45||Br(j)?(e.consume(j),k):j===47||j===62||Rr(j)?T(j):n(j)}function T(j){return j===47?(e.consume(j),I):j===58||j===95||ts(j)?(e.consume(j),R):ze(j)?(a=T,z(j)):bt(j)?(e.consume(j),T):I(j)}function R(j){return j===45||j===46||j===58||j===95||Br(j)?(e.consume(j),R):M(j)}function M(j){return j===61?(e.consume(j),D):ze(j)?(a=M,z(j)):bt(j)?(e.consume(j),M):T(j)}function D(j){return j===null||j===60||j===61||j===62||j===96?n(j):j===34||j===39?(e.consume(j),i=j,N):ze(j)?(a=D,z(j)):bt(j)?(e.consume(j),D):(e.consume(j),L)}function N(j){return j===i?(e.consume(j),i=void 0,P):j===null?n(j):ze(j)?(a=N,z(j)):(e.consume(j),N)}function L(j){return j===null||j===34||j===39||j===60||j===61||j===96?n(j):j===47||j===62||Rr(j)?T(j):(e.consume(j),L)}function P(j){return j===47||j===62||Rr(j)?T(j):n(j)}function I(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):n(j)}function z(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),O}function O(j){return bt(j)?Ft(e,A,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):A(j)}function A(j){return e.enter("htmlTextData"),a(j)}}const r5={name:"labelEnd",resolveAll:Ree,resolveTo:Mee,tokenize:Aee},kee={tokenize:jee},Eee={tokenize:Dee},Tee={tokenize:Lee};function Ree(e){let t=-1;const n=[];for(;++t=3&&(c===null||ze(c))?(e.exit("thematicBreak"),t(c)):n(c)}function l(c){return c===i?(e.consume(c),r++,l):(e.exit("thematicBreakSequence"),bt(c)?Ft(e,o,"whitespace")(c):o(c))}}const mr={continuation:{tokenize:Wee},exit:Vee,name:"list",tokenize:Hee},Fee={partial:!0,tokenize:qee},zee={partial:!0,tokenize:Uee};function Hee(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(m){const _=r.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!r.containerState.marker||m===r.containerState.marker:Ew(m)){if(r.containerState.type||(r.containerState.type=_,e.enter(_,{_container:!0})),_==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(mg,n,c)(m):c(m);if(!r.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return n(m)}function l(m){return Ew(m)&&++a<10?(e.consume(m),l):(!r.interrupt||a<2)&&(r.containerState.marker?m===r.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):n(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||m,e.check(r1,r.interrupt?n:h,e.attempt(Fee,f,d))}function h(m){return r.containerState.initialBlankLine=!0,s++,f(m)}function d(m){return bt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),f):n(m)}function f(m){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Wee(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(r1,i,s);function i(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ft(e,t,"listItemIndent",r.containerState.size+1)(o)}function s(o){return r.containerState.furtherBlankLines||!bt(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(zee,t,a)(o))}function a(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ft(e,e.attempt(mr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Uee(e,t,n){const r=this;return Ft(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 Vee(e){e.exit(this.containerState.type)}function qee(e,t,n){const r=this;return Ft(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!bt(s)&&a&&a[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const LT={name:"setextUnderline",resolveTo:Gee,tokenize:Kee};function Gee(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:{...e[i][1].start},end:{...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={...e[s][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function Kee(e,t,n){const r=this;let i;return s;function s(c){let h=r.events.length,d;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){d=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||d)?(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"),bt(c)?Ft(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ze(c)?(e.exit("setextHeadingLine"),t(c)):n(c)}}const Yee={tokenize:Xee};function Xee(e){const t=this,n=e.attempt(r1,r,e.attempt(this.parser.constructs.flowInitial,i,Ft(e,e.attempt(this.parser.constructs.flow,i,e.attempt(tee,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 Qee={resolveAll:RN()},Jee=TN("string"),Zee=TN("text");function TN(e){return{resolveAll:RN(e==="text"?ete:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,a,o);return a;function a(h){return c(h)?s(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),l}function l(h){return c(h)?(n.exit("data"),s(h)):(n.consume(h),l)}function c(h){if(h===null)return!0;const d=i[h];let f=-1;if(d)for(;++f-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 fte(e,t){let n=-1;const r=[];let i;for(;++n0){const ve=ae.tokenStack[ae.tokenStack.length-1];(ve[1]||PT).call(ae,void 0,ve[0])}for(ne.position={start:vo(Y.length>0?Y[0][1].start:{line:1,column:1,offset:0}),end:vo(Y.length>0?Y[Y.length-2][1].end:{line:1,column:1,offset:0})},be=-1;++be1?"-"+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 Ate(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 jte(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function jN(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 Dte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jN(e,t);const i={src:Yu(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 Lte(e,t){const n={src:Yu(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 Nte(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 Pte(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return jN(e,t);const i={href:Yu(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 Ote(e,t){const n={href:Yu(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 Ite(e,t,n){const r=e.all(t),i=n?$te(n):DN(t),s={},a=[];if(typeof t.checked=="boolean"){const h=r[0];let d;h&&h.type==="element"&&h.tagName==="p"?d=h:(d={type:"element",tagName:"p",properties:{},children:[]},r.unshift(d)),d.children.length>0&&d.children.unshift({type:"text",value:" "}),d.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let o=-1;for(;++o1}function Bte(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},o=QC(t.children[1]),l=hN(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 Ute(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(;++l0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push($T(t.slice(i),i>0,!1)),s.join("")}function $T(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===OT||s===IT;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===OT||s===IT;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function Gte(e,t){const n={type:"text",value:qte(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function Kte(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Yte={blockquote:Cte,break:kte,code:Ete,delete:Tte,emphasis:Rte,footnoteReference:Mte,heading:Ate,html:jte,imageReference:Dte,image:Lte,inlineCode:Nte,linkReference:Pte,link:Ote,listItem:Ite,list:Bte,paragraph:Fte,root:zte,strong:Hte,table:Wte,tableCell:Vte,tableRow:Ute,text:Gte,thematicBreak:Kte,toml:gm,yaml:gm,definition:gm,footnoteDefinition:gm};function gm(){}const LN=-1,i1=0,xv=1,_v=2,i5=3,s5=4,o5=5,a5=6,NN=7,PN=8,BT=typeof self=="object"?self:globalThis,Xte=(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 i1:case LN:return n(a,i);case xv:{const o=n([],i);for(const l of a)o.push(r(l));return o}case _v:{const o=n({},i);for(const[l,c]of a)o[r(l)]=r(c);return o}case i5:return n(new Date(a),i);case s5:{const{source:o,flags:l}=a;return n(new RegExp(o,l),i)}case o5:{const o=n(new Map,i);for(const[l,c]of a)o.set(r(l),r(c));return o}case a5:{const o=n(new Set,i);for(const l of a)o.add(r(l));return o}case NN:{const{name:o,message:l}=a;return n(new BT[o](l),i)}case PN:return n(BigInt(a),i);case"BigInt":return n(Object(BigInt(a)),i)}return n(new BT[s](a),i)};return r},FT=e=>Xte(new Map,e)(0),nc="",{toString:Qte}={},{keys:Jte}=Object,$d=e=>{const t=typeof e;if(t!=="object"||!e)return[i1,t];const n=Qte.call(e).slice(8,-1);switch(n){case"Array":return[xv,nc];case"Object":return[_v,nc];case"Date":return[i5,nc];case"RegExp":return[s5,nc];case"Map":return[o5,nc];case"Set":return[a5,nc]}return n.includes("Array")?[xv,n]:n.includes("Error")?[NN,n]:[_v,n]},vm=([e,t])=>e===i1&&(t==="function"||t==="symbol"),Zte=(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]=$d(a);switch(o){case i1:{let h=a;switch(l){case"bigint":o=PN,h=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+l);h=null;break;case"undefined":return i([LN],a)}return i([o,h],a)}case xv:{if(l)return i([l,[...a]],a);const h=[],d=i([o,h],a);for(const f of a)h.push(s(f));return d}case _v:{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 h=[],d=i([o,h],a);for(const f of Jte(a))(e||!vm($d(a[f])))&&h.push([s(f),s(a[f])]);return d}case i5:return i([o,a.toISOString()],a);case s5:{const{source:h,flags:d}=a;return i([o,{source:h,flags:d}],a)}case o5:{const h=[],d=i([o,h],a);for(const[f,m]of a)(e||!(vm($d(f))||vm($d(m))))&&h.push([s(f),s(m)]);return d}case a5:{const h=[],d=i([o,h],a);for(const f of a)(e||!vm($d(f)))&&h.push(s(f));return d}}const{message:c}=a;return i([o,{name:l,message:c}],a)};return s},zT=(e,{json:t,lossy:n}={})=>{const r=[];return Zte(!(t||n),!!t,new Map,r)(e),r},bv=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?FT(zT(e,t)):structuredClone(e):(e,t)=>FT(zT(e,t));function ene(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 tne(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function nne(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||ene,r=e.options.footnoteBackLabel||tne,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},o=[];let l=-1;for(;++l0&&_.push({type:"text",value:" "});let p=typeof n=="string"?n:n(l,m);typeof p=="string"&&(p={type:"text",value:p}),_.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+f+(m>1?"-"+m:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(l,m),className:["data-footnote-backref"]},children:Array.isArray(p)?p:[p]})}const y=h[h.length-1];if(y&&y.type==="element"&&y.tagName==="p"){const p=y.children[y.children.length-1];p&&p.type==="text"?p.value+=" ":y.children.push({type:"text",value:" "}),y.children.push(..._)}else h.push(..._);const g={type:"element",tagName:"li",properties:{id:t+"fn-"+f},children:e.wrap(h,!0)};e.patch(c,g),o.push(g)}if(o.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...bv(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 ON=function(e){if(e==null)return one;if(typeof e=="function")return s1(e);if(typeof e=="object")return Array.isArray(e)?rne(e):ine(e);if(typeof e=="string")return sne(e);throw new Error("Expected function, string, or object as test")};function rne(e){const t=[];let n=-1;for(;++n":""))+")"})}return f;function f(){let m=IN,_,v,y;if((!t||s(l,c,h[h.length-1]||void 0))&&(m=dne(n(l,h)),m[0]===HT))return m;if("children"in l&&l.children){const g=l;if(g.children&&m[0]!==cne)for(v=(r?g.children.length:-1)+a,y=h.concat(g);v>-1&&v0&&n.push({type:"text",value:` `}),n}function WT(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function UT(e,t){const n=fne(e,t),r=n.one(e,void 0),i=nne(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:` `},i),s}function yne(e,t){return e&&"run"in e?async function(n,r){const i=UT(n,{file:r,...t});await e.run(i,r)}:function(n,r){return UT(n,{file:r,...e||t})}}function VT(e){if(e)throw e}var gg=Object.prototype.hasOwnProperty,BN=Object.prototype.toString,qT=Object.defineProperty,GT=Object.getOwnPropertyDescriptor,KT=function(t){return typeof Array.isArray=="function"?Array.isArray(t):BN.call(t)==="[object Array]"},YT=function(t){if(!t||BN.call(t)!=="[object Object]")return!1;var n=gg.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&gg.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||gg.call(t,i)},XT=function(t,n){qT&&n.name==="__proto__"?qT(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},QT=function(t,n){if(n==="__proto__")if(gg.call(t,n)){if(GT)return GT(t,n).value}else return;return t[n]},xne=function e(){var t,n,r,i,s,a,o=arguments[0],l=1,c=arguments.length,h=!1;for(typeof o=="boolean"&&(h=o,o=arguments[1]||{},l=2),(o==null||typeof o!="object"&&typeof o!="function")&&(o={});la.length;let l;o&&a.push(i);try{l=e.apply(this,a)}catch(c){const h=c;if(o&&n)throw h;return i(h)}o||(l&&l.then&&typeof l.then=="function"?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 Gi={basename:wne,dirname:Sne,extname:Cne,join:kne,sep:"/"};function wne(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');dp(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 Sne(e){if(dp(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 Cne(e){dp(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 kne(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Tne(e,t){let n="",r=0,i=-1,s=0,a=-1,o,l;for(;++a<=e.length;){if(a2){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 dp(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Rne={cwd:Mne};function Mne(){return"/"}function Aw(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function Ane(e){if(typeof e=="string")e=new URL(e);else if(!Aw(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 jne(e)}function jne(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(;++n0){let[m,..._]=h;const v=r[f][1];Mw(v)&&Mw(m)&&(m=Gx(!0,v,m)),r[f]=[c,m,..._]}}}}const Pne=new l5().freeze();function Qx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Jx(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Zx(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 ZT(e){if(!Mw(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function eR(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function ym(e){return One(e)?e:new FN(e)}function One(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Ine(e){return typeof e=="string"||$ne(e)}function $ne(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Bne="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",tR=[],nR={allowDangerousHtml:!0},Fne=/^(https?|ircs?|mailto|xmpp)$/i,zne=[{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 Hne(e){const t=e.allowedElements,n=e.allowElement,r=e.children||"",i=e.className,s=e.components,a=e.disallowedElements,o=e.rehypePlugins||tR,l=e.remarkPlugins||tR,c=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...nR}:nR,h=e.skipHtml,d=e.unwrapDisallowed,f=e.urlTransform||Wne,m=Pne().use(Ste).use(l).use(yne,c).use(o),_=new FN;typeof r=="string"&&(_.value=r);for(const p of zne)Object.hasOwn(e,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Bne+p.id,void 0);const v=m.parse(_);let y=m.runSync(v,_);return i&&(y={type:"element",tagName:"div",properties:{className:i},children:y.type==="root"?y.children:[y]}),$N(y,g),tZ(y,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function g(p,x,b){if(p.type==="raw"&&b&&typeof x=="number")return h?b.children.splice(x,1):b.children[x]={type:"text",value:p.value},x;if(p.type==="element"){let S;for(S in Ux)if(Object.hasOwn(Ux,S)&&Object.hasOwn(p.properties,S)){const C=p.properties[S],E=Ux[S];(E===null||E.includes(p.tagName))&&(p.properties[S]=f(String(C||""),S,p))}}if(p.type==="element"){let S=t?!t.includes(p.tagName):a?a.includes(p.tagName):!1;if(!S&&n&&typeof x=="number"&&(S=!n(p,x,b)),S&&b&&typeof x=="number")return d&&p.children?b.children.splice(x,1,...p.children):b.children.splice(x,1),x}}}function Wne(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||Fne.test(e.slice(0,t))?e:""}function Une({text:e}){const t=e.split(/\s+/),n=t.pop(),r=t.length?t.join(" ")+" ":null;return u.jsxs(u.Fragment,{children:[r,u.jsxs("span",{className:"whitespace-nowrap",children:[n,u.jsx(dl,{className:"inline ml-1 mb-1 h-5 [.text-sm_&]:h-4 [.text-sm_&]:ml-0 [.prose-sm_&]:h-4 [.prose-sm_&]:ml-0 selection:bg-inherit"})]})]})}function kn({children:e,href:t,className:n,rel:r,...i}){const s=va()[1],a=(t==null?void 0:t.startsWith("http"))||(t==null?void 0:t.startsWith("//")),o=l=>{t&&(l.preventDefault(),a?Ju(t):s(t??"/"))};return u.jsx("a",{...i,rel:r??"noopener noreferrer",href:t,className:J("text-accent no-underline hover:underline ml-1 mr-0 cursor-pointer",n),onClick:o,children:a&&typeof e=="string"?u.jsx(Une,{text:e}):e})}const Vne={code:({children:e})=>u.jsx(Ye,{className:"not-prose",children:e}),pre:({children:e})=>u.jsx("pre",{className:"not-prose p-2 rounded bg-muted [.prose-toast_&]:bg-inherit [.prose-toast_&>*]:bg-inherit [.prose-toast_&]:px-0",children:e}),a:({children:e,href:t})=>u.jsx(kn,{href:t,children:e})};function rR({md:e,isSmall:t,isTitle:n,isToast:r}){return u.jsx(Hne,{components:Vne,className:J("prose dark:prose-invert prose-zinc",t&&"prose-sm",n&&"tracking-wide",r&&"prose-toast"),children:fY(e.replace(/\n/g,` `))})}let qne={data:""},Gne=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||qne,Kne=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,Yne=/\/\*[^]*?\*\/| +/g,iR=/\n+/g,To=(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"?To(a,s):s+"{"+To(a,s[1]=="k"?"":t)+"}":typeof a=="object"?r+=To(a,t?t.replace(/([^,])+/g,o=>s.replace(/([^,]*:\S+\([^)]*\))|([^,])+/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+=To.p?To.p(s,a):s+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Ms={},zN=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+zN(e[n]);return t}return e},Xne=(e,t,n,r,i)=>{let s=zN(e),a=Ms[s]||(Ms[s]=(l=>{let c=0,h=11;for(;c>>0;return"go"+h})(s));if(!Ms[a]){let l=s!==e?e:(c=>{let h,d,f=[{}];for(;h=Kne.exec(c.replace(Yne,""));)h[4]?f.shift():h[3]?(d=h[3].replace(iR," ").trim(),f.unshift(f[0][d]=f[0][d]||{})):f[0][h[1]]=h[2].replace(iR," ").trim();return f[0]})(e);Ms[a]=To(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let o=n&&Ms.g?Ms.g:null;return n&&(Ms.g=Ms[a]),((l,c,h,d)=>{d?c.data=c.data.replace(d,l):c.data.indexOf(l)===-1&&(c.data=h?l+c.data:c.data+l)})(Ms[a],t,r,o),a},Qne=(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?"":To(o,""):o===!1?"":o}return r+i+(a??"")},"");function o1(e){let t=this||{},n=e.call?e(t.p):e;return Xne(n.unshift?n.raw?Qne(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,Gne(t.target),t.g,t.o,t.k)}let HN,jw,Dw;o1.bind({g:1});let to=o1.bind({k:1});function Jne(e,t,n,r){To.p=t,HN=e,jw=n,Dw=r}function xa(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:jw&&jw()},o),n.o=/ *go\d+/.test(l),o.className=o1.apply(n,r)+(l?" "+l:"");let c=e;return e[0]&&(c=o.as||e,delete o.as),Dw&&c[0]&&Dw(o),HN(c,o)}return i}}var Zne=e=>typeof e=="function",wv=(e,t)=>Zne(e)?e(t):e,ere=(()=>{let e=0;return()=>(++e).toString()})(),WN=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),tre=20,UN=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,tre)};case 1:return{...e,toasts:e.toasts.map(s=>s.id===t.toast.id?{...s,...t.toast}:s)};case 2:let{toast:n}=t;return UN(e,{type:e.toasts.find(s=>s.id===n.id)?1:0,toast:n});case 3:let{toastId:r}=t;return{...e,toasts:e.toasts.map(s=>s.id===r||r===void 0?{...s,dismissed:!0,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}))}}},vg=[],yg={toasts:[],pausedAt:void 0},Nl=e=>{yg=UN(yg,e),vg.forEach(t=>{t(yg)})},nre={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},rre=(e={})=>{let[t,n]=w.useState(yg);w.useEffect(()=>(vg.push(n),()=>{let i=vg.indexOf(n);i>-1&&vg.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var s,a,o;return{...e,...e[i.type],...i,removeDelay:i.removeDelay||((s=e[i.type])==null?void 0:s.removeDelay)||(e==null?void 0:e.removeDelay),duration:i.duration||((a=e[i.type])==null?void 0:a.duration)||(e==null?void 0:e.duration)||nre[i.type],style:{...e.style,...(o=e[i.type])==null?void 0:o.style,...i.style}}});return{...t,toasts:r}},ire=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||ere()}),hp=e=>(t,n)=>{let r=ire(t,e,n);return Nl({type:2,toast:r}),r.id},or=(e,t)=>hp("blank")(e,t);or.error=hp("error");or.success=hp("success");or.loading=hp("loading");or.custom=hp("custom");or.dismiss=e=>{Nl({type:3,toastId:e})};or.remove=e=>Nl({type:4,toastId:e});or.promise=(e,t,n)=>{let r=or.loading(t.loading,{...n,...n==null?void 0:n.loading});return typeof e=="function"&&(e=e()),e.then(i=>{let s=t.success?wv(t.success,i):void 0;return s?or.success(s,{id:r,...n,...n==null?void 0:n.success}):or.dismiss(r),i}).catch(i=>{let s=t.error?wv(t.error,i):void 0;s?or.error(s,{id:r,...n,...n==null?void 0:n.error}):or.dismiss(r)}),e};var sre=(e,t)=>{Nl({type:1,toast:{id:e,height:t}})},ore=()=>{Nl({type:5,time:Date.now()})},$h=new Map,are=1e3,lre=(e,t=are)=>{if($h.has(e))return;let n=setTimeout(()=>{$h.delete(e),Nl({type:4,toastId:e})},t);$h.set(e,n)},cre=e=>{let{toasts:t,pausedAt:n}=rre(e);w.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&&or.dismiss(o.id);return}return setTimeout(()=>or.dismiss(o.id),l)});return()=>{a.forEach(o=>o&&clearTimeout(o))}},[t,n]);let r=w.useCallback(()=>{n&&Nl({type:6,time:Date.now()})},[n]),i=w.useCallback((s,a)=>{let{reverseOrder:o=!1,gutter:l=8,defaultPosition:c}=a||{},h=t.filter(m=>(m.position||c)===(s.position||c)&&m.height),d=h.findIndex(m=>m.id===s.id),f=h.filter((m,_)=>_m.visible).slice(...o?[f+1]:[0,f]).reduce((m,_)=>m+(_.height||0)+l,0)},[t]);return w.useEffect(()=>{t.forEach(s=>{if(s.dismissed)lre(s.id,s.removeDelay);else{let a=$h.get(s.id);a&&(clearTimeout(a),$h.delete(s.id))}})},[t]),{toasts:t,handlers:{updateHeight:sre,startPause:ore,endPause:r,calculateOffset:i}}},ure=to` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,dre=to` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,hre=to` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,fre=xa("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${ure} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${dre} 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: ${hre} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,pre=to` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,mre=xa("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: ${pre} 1s linear infinite; `,gre=to` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,vre=to` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,yre=xa("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${gre} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${vre} 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; } `,xre=xa("div")` position: absolute; `,_re=xa("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,bre=to` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,wre=xa("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${bre} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,Sre=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?w.createElement(wre,null,t):t:n==="blank"?null:w.createElement(_re,null,w.createElement(mre,{...r}),n!=="loading"&&w.createElement(xre,null,n==="error"?w.createElement(fre,{...r}):w.createElement(yre,{...r})))},Cre=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,kre=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,Ere="0%{opacity:0;} 100%{opacity:1;}",Tre="0%{opacity:1;} 100%{opacity:0;}",Rre=xa("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; `,Mre=xa("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,Are=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=WN()?[Ere,Tre]:[Cre(n),kre(n)];return{animation:t?`${to(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${to(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},jre=w.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?Are(e.position||t||"top-center",e.visible):{opacity:0},s=w.createElement(Sre,{toast:e}),a=w.createElement(Mre,{...e.ariaProps},wv(e.message,e));return w.createElement(Rre,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:s,message:a}):w.createElement(w.Fragment,null,s,a))});Jne(w.createElement);var Dre=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let s=w.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 w.createElement("div",{ref:s,className:t,style:n},i)},Lre=(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:WN()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},Nre=o1` z-index: 9999; > * { pointer-events: auto; } `,xm=16,Pre=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:s,containerClassName:a})=>{let{toasts:o,handlers:l}=cre(n);return w.createElement("div",{id:"_rht_toaster",style:{position:"fixed",zIndex:9999,top:xm,left:xm,right:xm,bottom:xm,pointerEvents:"none",...s},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},o.map(c=>{let h=c.position||t,d=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),f=Lre(h,d);return w.createElement(Dre,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?Nre:"",style:f},c.type==="custom"?wv(c.message,c):i?i(c):w.createElement(jre,{toast:c,position:h}))}))},Sv=or;const Ore=["default","loading","info","success","warning","error"],Ire=co(`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"}}),$re={default:u.jsx(NX,{className:"stroke-muted-foreground animate-toastbar-icon"}),loading:u.jsx(sn,{className:"animate-spin"}),info:u.jsx(PC,{className:"stroke-info animate-toastbar-icon"}),success:u.jsx(LX,{className:"stroke-success animate-toastbar-icon"}),warning:u.jsx(DX,{className:"stroke-warning animate-toastbar-icon"}),error:u.jsx(oQ,{className:"stroke-destructive animate-toastbar-icon"})},Bre=({t:e,type:t,data:n})=>{const[r,i]=w.useState(0);return w.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]),u.jsxs("div",{className:J(Ire({type:t}),e.visible?"animate-toastbar-enter":"animate-toastbar-leave"),children:[u.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:t==="loading"&&r>5?u.jsx("div",{className:"min-w-[2.65rem] text-center bg-muted/75 rounded-full",children:u.jsxs("span",{className:"text-xs text-secondary-foreground",children:[r,"s"]})}):$re[t]}),u.jsxs("div",{className:"flex-grow",children:[typeof n=="string"?u.jsx("span",{className:"block whitespace-pre-line",children:n}):n.md?u.jsxs(u.Fragment,{children:[n.title?u.jsx(rR,{md:`**${n.title}**`,isSmall:!0,isTitle:!0,isToast:!0}):null,u.jsx(rR,{md:n.msg,isSmall:!0,isToast:!0})]}):u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"font-semibold mb-1",children:n.title}),u.jsx("span",{className:"block whitespace-pre-line",children:n.msg})]}),t==="error"&&u.jsxs("small",{className:"block text-xs tracking-wide text-muted-foreground",children:["For support, visit ",u.jsx("a",{href:"http://discord.gg/txAdmin",target:"_blank",onClick:gf,className:"font-semibold no-underline hover:underline m-0",children:"discord.gg/txAdmin"}),"."]})]}),u.jsxs("button",{onClick:()=>Sv.dismiss(e.id),className:"absolute right-4 top-4 opacity-70",children:[u.jsx(Ar,{className:"h-6 sm:w-6 md:h-5 md:w-5"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})};function Fre(){return u.jsx(Pre,{reverseOrder:!0,containerStyle:{top:"var(--content-offset)",zIndex:60}})}const ja=(e,t,n={})=>(n.duration??(n.duration=e==="loading"?1/0:5e3),Sv.custom(r=>u.jsx(Bre,{t:r,type:e,data:t}),n)),zre=(e,t)=>ja(e.type,e,t),qe=Object.assign(zre,{default:(e,t)=>ja("default",e,t),loading:(e,t)=>ja("loading",e,t),info:(e,t)=>ja("info",e,t),success:(e,t)=>ja("success",e,t),warning:(e,t)=>ja("warning",e,t),error:(e,t)=>ja("error",e,t),dismiss:Sv.dismiss,remove:Sv.remove}),c5=Gu(!1),VN=Gu(void 0),Lw="actionModal",qN=e=>{rP(Lw,e)},u5=()=>{const e=it(VN),t=it(c5);return n=>{qN(n),e(n),t(!0)}},Hre=()=>{const e=ct(VN),[t,n]=Tr(c5);return{isModalOpen:t,actionRef:e,closeModal:()=>{qN(void 0),n(!1)}}};var sR=Object.prototype.hasOwnProperty;function Cv(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&Cv(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(sR.call(e,n)&&++r&&!sR.call(t,n)||!(n in t)||!Cv(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}const $s=new WeakMap,Bo=()=>{},ar=Bo(),Nw=Object,gt=e=>e===ar,ns=e=>typeof e=="function",sa=(e,t)=>({...e,...t}),GN=e=>ns(e.then),e_={},_m={},d5="undefined",a1=typeof window!=d5,Pw=typeof document!=d5,Wre=()=>a1&&typeof window.requestAnimationFrame!=d5,KN=(e,t)=>{const n=$s.get(e);return[()=>!gt(t)&&e.get(t)||e_,r=>{if(!gt(t)){const i=e.get(t);t in _m||(_m[t]=i),n[5](t,sa(i,r),i||e_)}},n[6],()=>!gt(t)&&t in _m?_m[t]:!gt(t)&&e.get(t)||e_]};let Ow=!0;const Ure=()=>Ow,[Iw,$w]=a1&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[Bo,Bo],Vre=()=>{const e=Pw&&document.visibilityState;return gt(e)||e!=="hidden"},qre=e=>(Pw&&document.addEventListener("visibilitychange",e),Iw("focus",e),()=>{Pw&&document.removeEventListener("visibilitychange",e),$w("focus",e)}),Gre=e=>{const t=()=>{Ow=!0,e()},n=()=>{Ow=!1};return Iw("online",t),Iw("offline",n),()=>{$w("online",t),$w("offline",n)}},Kre={isOnline:Ure,isVisible:Vre},Yre={initFocus:qre,initReconnect:Gre},oR=!ft.useId,mf=!a1||"Deno"in globalThis,Xre=e=>Wre()?window.requestAnimationFrame(e):setTimeout(e,1),t_=mf?w.useEffect:w.useLayoutEffect,n_=typeof navigator<"u"&&navigator.connection,aR=!mf&&n_&&(["slow-2g","2g"].includes(n_.effectiveType)||n_.saveData),bm=new WeakMap,r_=(e,t)=>Nw.prototype.toString.call(e)===`[object ${t}]`;let Qre=0;const Bw=e=>{const t=typeof e,n=r_(e,"Date"),r=r_(e,"RegExp"),i=r_(e,"Object");let s,a;if(Nw(e)===e&&!n&&!r){if(s=bm.get(e),s)return s;if(s=++Qre+"~",bm.set(e,s),Array.isArray(e)){for(s="@",a=0;a{if(ns(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Bw(e):"",[e,t]};let Jre=0;const Fw=()=>++Jre,YN=0,XN=1,QN=2,Zre=3;var Bd={__proto__:null,ERROR_REVALIDATE_EVENT:Zre,FOCUS_EVENT:YN,MUTATE_EVENT:QN,RECONNECT_EVENT:XN};async function JN(...e){const[t,n,r,i]=e,s=sa({populateCache:!0,throwOnError:!0},typeof i=="boolean"?{revalidate:i}:i||{});let a=s.populateCache;const o=s.rollbackOnError;let l=s.optimisticData;const c=f=>typeof o=="function"?o(f):o!==!1,h=s.throwOnError;if(ns(n)){const f=n,m=[],_=t.keys();for(const v of _)!/^\$(inf|sub)\$/.test(v)&&f(t.get(v)._k)&&m.push(v);return Promise.all(m.map(d))}return d(n);async function d(f){const[m]=h5(f);if(!m)return;const[_,v]=KN(t,m),[y,g,p,x]=$s.get(t),b=()=>{const N=y[m];return(ns(s.revalidate)?s.revalidate(_().data,f):s.revalidate!==!1)&&(delete p[m],delete x[m],N&&N[0])?N[0](QN).then(()=>_().data):_().data};if(e.length<3)return b();let S=r,C;const E=Fw();g[m]=[E,0];const k=!gt(l),T=_(),R=T.data,M=T._c,D=gt(M)?R:M;if(k&&(l=ns(l)?l(D,R):l,v({data:l,_c:D})),ns(S))try{S=S(D)}catch(N){C=N}if(S&&GN(S))if(S=await S.catch(N=>{C=N}),E!==g[m][0]){if(C)throw C;return S}else C&&k&&c(C)&&(a=!0,v({data:D,_c:ar}));if(a&&!C)if(ns(a)){const N=a(S,D);v({data:N,error:ar,_c:ar})}else v({data:S,error:ar,_c:ar});if(g[m][1]=Fw(),Promise.resolve(b()).then(()=>{v({_c:ar})}),C){if(h)throw C;return}return S}}const lR=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},eie=(e,t)=>{if(!$s.has(e)){const n=sa(Yre,t),r={},i=JN.bind(ar,e);let s=Bo;const a={},o=(h,d)=>{const f=a[h]||[];return a[h]=f,f.push(d),()=>f.splice(f.indexOf(d),1)},l=(h,d,f)=>{e.set(h,d);const m=a[h];if(m)for(const _ of m)_(d,f)},c=()=>{if(!$s.has(e)&&($s.set(e,[r,{},{},{},i,l,o]),!mf)){const h=n.initFocus(setTimeout.bind(ar,lR.bind(ar,r,YN))),d=n.initReconnect(setTimeout.bind(ar,lR.bind(ar,r,XN)));s=()=>{h&&h(),d&&d(),$s.delete(e)}}};return c(),[e,i,c,s]}return[e,$s.get(e)[4]]},tie=(e,t,n,r,i)=>{const s=n.errorRetryCount,a=i.retryCount,o=~~((Math.random()+.5)*(1<<(a<8?a:8)))*n.errorRetryInterval;!gt(s)&&a>s||setTimeout(r,o,i)},nie=Cv,[ZN,eP]=eie(new Map),rie=sa({onLoadingSlow:Bo,onSuccess:Bo,onError:Bo,onErrorRetry:tie,onDiscarded:Bo,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:aR?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:aR?5e3:3e3,compare:nie,isPaused:()=>!1,cache:ZN,mutate:eP,fallback:{}},Kre),iie=(e,t)=>{const n=sa(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=sa(i,a))}return n},sie=w.createContext({}),oie="$inf$",tP=a1&&window.__SWR_DEVTOOLS_USE__,aie=tP?window.__SWR_DEVTOOLS_USE__:[],lie=()=>{tP&&(window.__SWR_DEVTOOLS_REACT__=ft)},cie=e=>ns(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],uie=()=>sa(rie,w.useContext(sie)),die=e=>(t,n,r)=>e(t,n&&((...s)=>{const[a]=h5(t),[,,,o]=$s.get(ZN);if(a.startsWith(oie))return n(...s);const l=o[a];return gt(l)?n(...s):(delete o[a],l)}),r),hie=aie.concat(die),fie=e=>function(...n){const r=uie(),[i,s,a]=cie(n),o=iie(r,a);let l=e;const{use:c}=o,h=(c||[]).concat(hie);for(let d=h.length;d--;)l=h[d](l);return l(i,s||o.fetcher||null,o)},pie=(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())}};lie();const i_=ft.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),s_={dedupe:!0},mie=(e,t,n)=>{const{cache:r,compare:i,suspense:s,fallbackData:a,revalidateOnMount:o,revalidateIfStale:l,refreshInterval:c,refreshWhenHidden:h,refreshWhenOffline:d,keepPreviousData:f}=n,[m,_,v,y]=$s.get(r),[g,p]=h5(e),x=w.useRef(!1),b=w.useRef(!1),S=w.useRef(g),C=w.useRef(t),E=w.useRef(n),k=()=>E.current,T=()=>k().isVisible()&&k().isOnline(),[R,M,D,N]=KN(r,g),L=w.useRef({}).current,P=gt(a)?gt(n.fallback)?ar:n.fallback[g]:a,I=(q,ie)=>{for(const re in L){const ce=re;if(ce==="data"){if(!i(q[ce],ie[ce])&&(!gt(q[ce])||!i(Z,ie[ce])))return!1}else if(ie[ce]!==q[ce])return!1}return!0},z=w.useMemo(()=>{const q=!g||!t?!1:gt(o)?k().isPaused()||s?!1:l!==!1:o,ie=Ae=>{const _e=sa(Ae);return delete _e._k,q?{isValidating:!0,isLoading:!0,..._e}:_e},re=R(),ce=N(),ye=ie(re),le=re===ce?ye:ie(ce);let Re=ye;return[()=>{const Ae=ie(R());return I(Ae,Re)?(Re.data=Ae.data,Re.isLoading=Ae.isLoading,Re.isValidating=Ae.isValidating,Re.error=Ae.error,Re):(Re=Ae,Ae)},()=>le]},[r,g]),O=KD.useSyncExternalStore(w.useCallback(q=>D(g,(ie,re)=>{I(re,ie)||q()}),[r,g]),z[0],z[1]),A=!x.current,j=m[g]&&m[g].length>0,F=O.data,H=gt(F)?P&&GN(P)?i_(P):P:F,B=O.error,G=w.useRef(H),Z=f?gt(F)?G.current:F:H,X=j&&!gt(B)?!1:A&&!gt(o)?o:k().isPaused()?!1:s?gt(H)?!1:l:gt(H)||l,W=!!(g&&t&&A&&X),$=gt(O.isValidating)?W:O.isValidating,V=gt(O.isLoading)?W:O.isLoading,U=w.useCallback(async q=>{const ie=C.current;if(!g||!ie||b.current||k().isPaused())return!1;let re,ce,ye=!0;const le=q||{},Re=!v[g]||!le.dedupe,Ae=()=>oR?!b.current&&g===S.current&&x.current:g===S.current,_e={isValidating:!1,isLoading:!1},Ce=()=>{M(_e)},oe=()=>{const se=v[g];se&&se[1]===ce&&delete v[g]},te={isValidating:!0};gt(R().data)&&(te.isLoading=!0);try{if(Re&&(M(te),n.loadingTimeout&>(R().data)&&setTimeout(()=>{ye&&Ae()&&k().onLoadingSlow(g,n)},n.loadingTimeout),v[g]=[ie(p),Fw()]),[re,ce]=v[g],re=await re,Re&&setTimeout(oe,n.dedupingInterval),!v[g]||v[g][1]!==ce)return Re&&Ae()&&k().onDiscarded(g),!1;_e.error=ar;const se=_[g];if(!gt(se)&&(ce<=se[0]||ce<=se[1]||se[1]===0))return Ce(),Re&&Ae()&&k().onDiscarded(g),!1;const ue=R().data;_e.data=i(ue,re)?ue:re,Re&&Ae()&&k().onSuccess(re,g,n)}catch(se){oe();const ue=k(),{shouldRetryOnError:Y}=ue;ue.isPaused()||(_e.error=se,Re&&Ae()&&(ue.onError(se,g,ue),(Y===!0||ns(Y)&&Y(se))&&(!k().revalidateOnFocus||!k().revalidateOnReconnect||T())&&ue.onErrorRetry(se,g,ue,ne=>{const ae=m[g];ae&&ae[0]&&ae[0](Bd.ERROR_REVALIDATE_EVENT,ne)},{retryCount:(le.retryCount||0)+1,dedupe:!0})))}return ye=!1,Ce(),!0},[g,r]),Q=w.useCallback((...q)=>JN(r,S.current,...q),[]);if(t_(()=>{C.current=t,E.current=n,gt(F)||(G.current=F)}),t_(()=>{if(!g)return;const q=U.bind(ar,s_);let ie=0;const ce=pie(g,m,(ye,le={})=>{if(ye==Bd.FOCUS_EVENT){const Re=Date.now();k().revalidateOnFocus&&Re>ie&&T()&&(ie=Re+k().focusThrottleInterval,q())}else if(ye==Bd.RECONNECT_EVENT)k().revalidateOnReconnect&&T()&&q();else{if(ye==Bd.MUTATE_EVENT)return U();if(ye==Bd.ERROR_REVALIDATE_EVENT)return U(le)}});return b.current=!1,S.current=g,x.current=!0,M({_k:p}),X&&(gt(H)||mf?q():Xre(q)),()=>{b.current=!0,ce()}},[g]),t_(()=>{let q;function ie(){const ce=ns(c)?c(R().data):c;ce&&q!==-1&&(q=setTimeout(re,ce))}function re(){!R().error&&(h||k().isVisible())&&(d||k().isOnline())?U(s_).then(ie):ie()}return ie(),()=>{q&&(clearTimeout(q),q=-1)}},[c,h,d,g]),w.useDebugValue(Z),s&>(H)&&g){if(!oR&&mf)throw new Error("Fallback data is required when using Suspense in SSR.");C.current=t,E.current=n,b.current=!1;const q=y[g];if(!gt(q)){const ie=Q(q);i_(ie)}if(gt(B)){const ie=U(s_);gt(Z)||(ie.status="fulfilled",ie.value=!0),i_(ie)}else throw B}return{mutate:Q,get data(){return L.data=!0,Z},get error(){return L.error=!0,B},get isValidating(){return L.isValidating=!0,$},get isLoading(){return L.isLoading=!0,V}}},fp=fie(mie),Xu=nt(window.txConsts.preAuth),nP=nt(e=>!!e(Xu)),gie=nt(e=>{const t=e(Xu);return t?t.csrfToken:void 0}),vie=nt(e=>{const t=e(Xu);if(t)return{permissions:t.permissions,isMaster:t.isMaster}}),yie=()=>ct(nP),xie=()=>ct(gie),_ie=()=>it(Xu),fr=()=>{const e=ct(vie);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}},f5=()=>{const e=it(Xu);return(t="unknown",n="unknown",r=Qu.EXPIRED)=>{console.log("[useExpireAuthData] Logout notice received:",{src:t,reason:n,reasonHash:r}),e(!1),p5(r)}},Pl=()=>{const[e,t]=Tr(Xu),n=pl({mutationKey:["auth"],mutationFn:()=>fetch("/auth/logout",{method:"POST"}).then(r=>r.json()),onSuccess:r=>{r.logout&&(console.log("[useAuth] Manually triggered logout."),t(!1),p5(Qu.LOGOUT))}});return{authData:e,setAuthData:t,logout:{mutate:n.mutate,isLoading:n.isPending}}},bie=K7((e,t)=>{e(nP)||(console.info("[logoutWatcher] Logout Detected, closing all dialogs and modals."),t(X0,!1),t(Q0,!1),t(J0,!1),t(VC,!1),t(qC,!1),t(GC,!1),t(e1,!1),t(c5,!1),t(jl,null),t(V0,void 0),t(RC,void 0),t(q0,void 0),t(G0,void 0),t(MC,0),qe.dismiss(),eP(()=>!0,void 0,{revalidate:!1}))});var Qu=(e=>(e.NONE="",e.LOGOUT="#logout",e.EXPIRED="#expired",e.UPDATED="#updated",e.MASTER_ALREADY_SET="#master_already_set",e))(Qu||{});function wie(){const{setAuthData:e}=Pl(),t=w.useRef(null),n=w.useRef(null),[r,i]=w.useState(),s=va()[1],a=m=>{m.message.startsWith("NetworkError")?i("Network error. If you closed txAdmin, please restart it and try again."):i(m.message)},o=m=>{m==="no_admins_setup"?(i("No admins set up. Redirecting..."),s("/addMaster/pin")):i(m)},l=pl({mutationKey:["oauthRedirect"],mutationFn:()=>{const m=`/auth/cfxre/redirect?origin=${encodeURIComponent(window.location.origin)}`;return fetch(m).then(_=>_.json())},onError:a,onSuccess:m=>{"error"in m?o(m.error):(console.log("Redirecting to",m.authUrl),window.location.href=m.authUrl)}}),c=pl({mutationKey:["auth"],mutationFn:({username:m,password:_})=>fetch(`/auth/password?uiVersion=${encodeURIComponent(window.txConsts.txaVersion)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:m,password:_})}).then(v=>v.json()),onError:a,onSuccess:m=>{"error"in m?m.error==="refreshToUpdate"?(window.location.href="/login#updated",window.location.reload()):o(m.error):e(m)}}),h=m=>{var _,v;m==null||m.preventDefault(),c.mutate({username:((_=t.current)==null?void 0:_.value)||"",password:((v=n.current)==null?void 0:v.value)||""})};let d;window.location.hash==="#logout"?d="Logged Out.":window.location.hash==="#expired"?d="Session Expired.":window.location.hash==="#updated"?d="txAdmin updated, please login again.":window.location.hash==="#master_already_set"&&(d="Master account already configured. Please login instead.");const f=r??d;return w.useEffect(()=>{try{const m=localStorage.getItem("authCredsAutofill");if(m){const[_,v]=JSON.parse(m);t.current.value=_??"",n.current.value=v??""}}catch(m){console.error("Username/Pass autofill failed",m)}},[]),u.jsxs("form",{onSubmit:h,className:"w-full",children:[u.jsx(H0,{className:"space-y-1",children:u.jsx(_C,{className:"text-3xl",children:"Login"})}),u.jsxs(Uu,{className:"grid gap-4",children:[u.jsx("div",{children:u.jsx("button",{type:"button",className:"cfxrebtn",onClick:()=>{l.mutate()},disabled:l.isPending,children:l.isPending?u.jsx("div",{className:"w-[6rem]",children:u.jsx(sn,{className:"mx-auto h-5 w-5 animate-spin"})}):u.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"51.12 12.29 1070.38 231.43",className:"w-[6rem] h-5",children:u.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"})})})}),u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("span",{className:"w-full border-t"})}),u.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:u.jsx("span",{className:"bg-card px-2 text-muted-foreground",children:"OR"})})]}),u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"grid gap-2",children:[u.jsx(Tn,{htmlFor:"frm-login",children:"Login"}),u.jsx(wt,{id:"frm-login",type:"text",ref:t,placeholder:"username",autoCapitalize:"off",autoComplete:"off",required:!0})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(Tn,{htmlFor:"frm-password",children:"Password"}),u.jsx(wt,{id:"frm-password",type:"password",ref:n,placeholder:"password",autoCapitalize:"off",autoComplete:"off",required:!0})]})]})]}),u.jsxs(Vu,{className:"flex-col pb-0",children:[u.jsxs(De,{className:"w-full",disabled:c.isPending,children:[c.isPending&&u.jsx(sn,{className:"mr-2 h-4 w-4 animate-spin"}),"Login"]}),u.jsx("div",{className:"text-destructive mt-2",children:f??u.jsx(u.Fragment,{children:" "})})]})]})}function Sie(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}function p5(e=Qu.NONE){const t=window.location.pathname+window.location.search+window.location.hash,n=t==="/"||t.startsWith("/login")?`/login${e}`:`/login?r=${encodeURIComponent(t)}${e}`;window.history.replaceState(null,"",n)}const Ju=e=>{e&&(window.invokeNative?window.invokeNative("openUrl",e):window.open(e,"_blank"))},gf=e=>{if(window.txConsts.isWebInterface)return;const n=e.target.closest("a");if(!n)return;const r=n.getAttribute("href");r&&(e.preventDefault(),Ju(r))},rP=(e,t)=>{if(typeof e!="string"||!e.length)throw new Error("setUrlSearchParam: paramName must be a non-empty string");const n=new URL(window.location.toString());t?n.searchParams.set(e,t):n.searchParams.delete(e),window.history.replaceState({},"",n)},Cie=e=>{const t=new URL(window.location.href);e?t.hash=e:t.hash="",window.history.replaceState(null,"",t.toString())},kie=KL("liveConsoleCommandHistory",[]),Eie=KL("liveConsoleCommandBookmarks",[]),Tie=50,iP=()=>{const[e,t]=Tr(kie);return{history:e,setHistory:t,appendHistory:n=>{const r=e.filter(i=>i!==n);r.unshift(n)>Tie&&r.pop(),t(r)},wipeHistory:()=>{t([])}}},Rie=()=>{const[e,t]=Tr(Eie);return{bookmarks:e,addBookmark:n=>{e.includes(n)||t([n,...e])},removeBookmark:n=>{t(e.filter(r=>r!==n))}}};function wm({icon:e,title:t,disabled:n,onClick:r}){return u.jsxs("div",{tabIndex:0,className:J(`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:[u.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"}),u.jsx("span",{className:"hidden 2xl:inline ml-1 align-middle",children:t})]})}function Mie(e){const{history:t,appendHistory:n}=iP(),[r,i]=w.useState(-1),s=w.useRef(""),a=e.termInputRef,{hasPerm:o}=fr(),l=o("console.write"),c=ct(Q7);w.useEffect(()=>{e.isConnected&&a.current&&a.current.focus()},[e.isConnected,a]);const h=()=>{if(!a.current)return;r===-1&&(s.current=a.current.value??"");const v=r+1;t[v]&&(a.current.value=t[v],i(v))},d=()=>{if(!a.current)return;const v=r-1;v===-1?(a.current.value=s.current,i(v)):t[v]&&(a.current.value=t[v],i(v))},f=()=>{if(!a.current)return;const v=a.current.value.trim();i(-1),a.current.value="",s.current="",v&&(n(v),e.consoleWrite(v))},m=v=>{e.isConnected&&(v.key==="ArrowUp"?(h(),v.preventDefault()):v.key==="ArrowDown"?(d(),v.preventDefault()):v.key==="Enter"&&(f(),v.preventDefault()))};let _;return l?c.isChildAlive?e.isConnected||(_="Socket connection lost."):_="The server is not running.":_="You do not have permission to write to the console.",u.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:[u.jsxs("div",{className:"flex items-center grow",children:[u.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:u.jsx("path",{d:"m9 18 6-6-6-6"})}),u.jsx(wt,{ref:a,className:J("w-full",!!_&&"placeholder:text-destructive placeholder:opacity-100"),placeholder:_??"Type a command...",type:"text",disabled:!!_,onKeyDown:m,autoCapitalize:"none",autoComplete:"off",autoCorrect:"off"})]}),u.jsxs("div",{className:"flex flex-row justify-evenly gap-3 2xl:gap-1 select-none",children:[u.jsx(wm,{icon:kX,title:"Saved",onClick:e.toggleSaveSheet}),u.jsx(wm,{icon:pQ,title:"Search",disabled:!e.isConnected,onClick:e.toggleSearchBar}),u.jsx(wm,{icon:AL,title:"Clear",disabled:!e.isConnected,onClick:e.consoleClear}),u.jsx(wm,{icon:UX,title:"Download",disabled:!e.isConnected,onClick:()=>{Ju("/fxserver/downloadLog")}})]})]})}function Aie(){return u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.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:[u.jsx("polyline",{points:"4 17 10 11 4 5"}),u.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),u.jsx("p",{className:"font-mono text-sm",children:"Live Console"})]})})}function rc({title:e,onClick:t,isActive:n,children:r}){return u.jsx("button",{title:e,className:J("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 o_="No results",jie={activeMatchBackground:"#FF00DC",activeMatchColorOverviewRuler:"#FF00DC",matchBackground:"#732268",matchOverviewRuler:"#732268"};function sP({show:e,setShow:t,searchAddon:n}){const[r,i]=w.useState(!1),[s,a]=w.useState(!1),[o,l]=w.useState(!1),c=w.useRef(null),[h,d]=w.useState(o_),f=S=>{n.clearDecorations(),S&&d(S)},m=S=>({decorations:jie,caseSensitive:r,wholeWord:s,regex:o,...S});w.useEffect(()=>{var S;e?(S=c.current)==null||S.focus():f(o_)},[e]),w.useEffect(()=>{if(!n)return;const S=n.onDidChangeResults(({resultIndex:C,resultCount:E})=>{d(C===-1?o_:`${C+1}/${E}`)});return()=>{S.dispose()}},[]);const _=()=>{!c.current||!c.current.value||(console.log("backward search for",c.current.value),n.findPrevious(c.current.value,m()))},v=()=>{!c.current||!c.current.value||(console.log("forward search for",c.current.value),n.findNext(c.current.value,m()))},y=S=>{c.current&&(console.log("search input keydown",S.code),S.code==="Enter"&&(S.shiftKey?_():v(),S.preventDefault()))},g=S=>{c.current&&v()},p=()=>{c.current&&(i(!r),f(),n.findNext(c.current.value,m({caseSensitive:!r})))},x=()=>{c.current&&(a(!s),f(),n.findNext(c.current.value,m({wholeWord:!s})))},b=()=>{c.current&&(l(!o),f(),n.findNext(c.current.value,m({regex:!o})))};return Pi("message",S=>{var C;S.data.type==="liveConsoleSearchHotkey"&&(S.data.action==="previous"?_():S.data.action==="next"?v():S.data.action==="focus"&&((C=c.current)==null||C.focus()))}),e?u.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:[u.jsxs("div",{className:"relative",children:[u.jsx(wt,{ref:c,className:"h-8",placeholder:"Search string",onKeyDown:y,onChange:g,onBlur:()=>{n.clearActiveDecoration()}}),u.jsxs("div",{className:"absolute top-1/2 right-1 transform -translate-y-1/2 flex text-muted-foreground gap-2",children:[u.jsx(rc,{title:"Case Sensitive",isActive:r,onClick:p,children:u.jsx(RX,{className:"h-5 w-5"})}),u.jsx(rc,{title:"Whole Word",isActive:s,onClick:x,children:u.jsx(kQ,{className:"h-5 w-5"})}),u.jsx(rc,{title:"Regex",isActive:o,onClick:b,children:u.jsx(hQ,{className:"h-4 w-5"})})]})]}),u.jsx("div",{className:"flex grow text-sm text-muted-foreground whitespace-nowrap min-w-[8ch]",children:h}),u.jsxs("div",{className:"flex gap-2 text-muted-foreground",children:[u.jsx(rc,{title:"Previous",onClick:_,children:u.jsx(SX,{className:"h-5 w-5"})}),u.jsx(rc,{title:"Next",onClick:v,children:u.jsx(wX,{className:"h-5 w-5"})}),u.jsx(rc,{title:"Close",onClick:()=>{t(!1)},children:u.jsx(Ar,{className:"h-5 w-5"})})]})]}):null}function Die({isOpen:e,closeSheet:t}){return u.jsx("div",{className:J("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 Lie({closeSheet:e}){return u.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:u.jsx(Ar,{className:"h-8 w-8"})})}function cR({cmd:e,type:t,onClick:n,onFavAction:r}){const i=s=>{s.stopPropagation(),r()};return u.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:[u.jsx("span",{className:"py-1 line-clamp-4 font-mono group-hover:text-primary",children:e}),u.jsx("div",{className:"min-w-max",children:u.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"?u.jsxs(u.Fragment,{children:[u.jsx(_Q,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Save"})]}):u.jsxs(u.Fragment,{children:[u.jsx(xQ,{className:"size-5"}),u.jsx("span",{className:"sr-only",children:"Remove"})]})})})]})}function Nie({toTermInput:e}){const{history:t,wipeHistory:n}=iP(),{bookmarks:r,addBookmark:i,removeBookmark:s}=Rie(),a=cp(),o=()=>{qe.success("History cleared"),n()},l=()=>{a({title:"Save Command",message:"Enter the command to save:",submitLabel:"Save",onSubmit:c=>{c&&i(c)}})};return u.jsxs("div",{className:"flex flex-row gap-4 max-h-full",children:[u.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[u.jsx("h2",{className:"text-xl font-bold",children:"History"}),u.jsxs(hi,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[u.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:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(Ar,{className:"w-4 h-4 inline"}),"Clear History"]})}),u.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide pb-4",children:t.map((c,h)=>u.jsx(cR,{cmd:c,type:"history",onClick:()=>e(c),onFavAction:()=>i(c)},h))}),t.length===0&&u.jsx("div",{className:"w-full h-auto text-center italic tracking-wider",children:"The command history is empty."})]})]}),u.jsxs("div",{className:"flex flex-col flex-grow gap-2 w-1/2",children:[u.jsx("h2",{className:"text-xl font-bold",children:"Saved"}),u.jsxs(hi,{className:"max-h-full w-full pr-3 text-sm text-muted-foreground",style:{wordBreak:"break-word"},children:[u.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:u.jsxs("div",{className:"flex items-center justify-center gap-2",children:[u.jsx(OC,{className:"w-4 h-4 inline"}),"Add New"]})}),u.jsx("div",{className:"space-y-2 line-clamp-1 text-sm font-mono tracking-wide pb-4",children:r.map((c,h)=>u.jsx(cR,{cmd:c,type:"saved",onClick:()=>e(c),onFavAction:()=>s(c)},h))}),r.length===0&&u.jsxs("div",{className:"w-full h-auto text-center italic tracking-wider",children:["There are no saved commands. ",u.jsx("br",{}),"To save a command, click the star icon next to it."]})]})]})]})}function Pie({isOpen:e,closeSheet:t,toTermInput:n}){return u.jsxs(u.Fragment,{children:[u.jsx(Die,{isOpen:e,closeSheet:t}),u.jsxs("div",{"data-state":e?"open":"closed",className:J("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:[u.jsx(Lie,{closeSheet:t}),u.jsx(Nie,{toTermInput:n})]})]})}class oP{constructor(t,n){ec(this,"btnRef");ec(this,"containerElement");ec(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 Oie={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"},aP={theme:Oie,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},Iie=/[\x00-\x08\x0B-\x1A\x1C-\x1F\x7F]|(?:\x1B\[|\x9B)[\d;]+[@-K]/g,$ie=/\x1B[^m]*?m/g,m5=e=>e.replace(Iie,"").replace($ie,""),Bie=e=>/^{§[0-9a-f]{8}}/.test(e)?{ts:parseInt(e.slice(2,10),16),content:e.slice(11)}:{ts:null,content:e},lP=(e,t)=>{if(t.timestampDisabled)return"";const n=10*60*60*1e3;return new Date(e*1e3+n).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:t.timestampForceHour12??window.txBrowserHour12})+"\x1B[0m "},Fie=(e,t)=>{if(t.copyTimestamp&&t.copyTag)return e;const n=/^(?\d{2}:\d{2}:\d{2}(?: [AP]M)? )?(?\[.{20}] )?(?.*)?/,r=e.match(n);if(!r)return e;const{ts:i,tag:s,content:a}=r.groups??{};let o="";return t.copyTimestamp&&(o+=i??""),t.copyTag&&(o+=s??""),o+(a??"")},zie=async(e,t,n)=>{const r=e.split(/\r?\n/).map(i=>Fie(i,n)).join(`\r `);return C7(r,t)},Hie=/[\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]{3,}/,cP="\x1B[3m",Wie=e=>{if(Hie.test(e))return{markerData:{classes:"bg-warning text-warning-foreground",labelShort:"RTL",labelLong:"VIEW RIGHT-TO-LEFT TEXT",onClick:()=>{qe.warning({title:"Bidirectional Text Detected:",md:!0,msg:`Due to limitations, the terminal cannot display RTL text. This is what the text is supposed to look like: ${m5(e)}`},{duration:7500})}}}},uP=e=>JSON.parse(e.replace(/\u037e/g,";").replace(/\\"/g,'"')),Uie=e=>{const t=m5(e),n=/^(?.)\s+TXADMIN\1 txaEvent "(?\w+)" "(?.*)"$/,r=t.match(n);if(!r||!r.groups)return;const{arg0:i,arg1:s}=r.groups,a=uP(s),o=`txaEvent "${i}" "${s}"`,l=`${cP}`;return{newLine:e.replace(o,l),markerData:{classes:"bg-info text-info-foreground",labelShort:"EVENT",labelLong:"VIEW EVENT",onClick:()=>{qe.info({title:`txAdmin:events:${i}:`,md:!0,msg:"```json\n"+JSON.stringify(a,null,2)+"\n```"},{duration:7500})}}}},Vie=e=>{const t=m5(e),n=/^(?.)\s+TXADMIN\1 txaInitialData "(?.*)"$/,r=t.match(n);if(!r||!r.groups)return;console.log("getTermLineInitialData",r.groups);const{arg0:i}=r.groups,s=uP(i),a=`txaInitialData "${i}"`,o=`${cP}`;return{newLine:e.replace(a,o),markerData:{classes:"bg-info text-info-foreground",labelShort:"CMD",labelLong:"VIEW COMMAND",onClick:()=>{qe.info({title:"Initial Player Data:",md:!0,msg:"```json\n"+JSON.stringify(s,null,2)+"\n```"},{duration:7500})}}}},qie=(e,t)=>e.buffer.active.cursorY===0?t+2:0,Gie=(e,t,n)=>{const r=e.registerMarker(qie(e,t)),i=e.registerDecoration({layer:"top",marker:r});return i&&i.onRender(s=>{if(s.innerHTML)return;const a="rgba(255,255,255, 0.01)",o="rgba(255,255,255, 0.05)",l=document.createElement("button");l.className=J("absolute right-0 px-1 py-0 text-2xs rounded overflow-hidden text-nowrap transition-all",n.classes),l.innerText=n.labelShort,l.onclick=n.onClick;const c=()=>{l.style.width=`calc(${l.innerText.length+1}ch + 0.5rem)`};l.onmouseenter=()=>{l.innerText=n.labelLong,c(),s.style.backgroundColor=o},l.onmouseleave=()=>{l.innerText=n.labelShort,c(),s.style.backgroundColor=a},c(),s.classList.add("rounded"),s.style.backgroundColor=a,s.style.width="100%",s.replaceChildren(l)}),!!i};let g5=!1,kv;try{const e=localStorage.getItem("liveConsoleTimestamp");e==="24h"?kv=!1:e==="12h"?kv=!0:e==="off"&&(g5=!0)}catch{}let v5=!1,y5=!0;try{const e=localStorage.getItem("liveConsoleCopyOpts");if(typeof e=="string"){const t=e.split(",");v5=t.includes("ts"),y5=t.includes("tag")}}catch{}const Fd=150,Kie="\x1B[0;37m",Yie="\x1B[1;90m",uR=lP(Date.now(),{timestampDisabled:g5,timestampForceHour12:kv,copyTimestamp:v5,copyTag:y5}).replace(/\w/g,"-");function Xie(){const[e,t]=w.useState(!1),[n,r]=w.useState(!1),[i,s]=w.useState(!1),a=w.useRef(null),o=w.useRef({ts:0,lastEol:!0,prefix:uR}),l=Y0(),c=w.useMemo(()=>({timestampDisabled:g5,timestampForceHour12:kv,copyTimestamp:v5,copyTag:y5}),[]),h=w.useRef(null),d=w.useRef(null),f=w.useMemo(()=>new aL.Terminal(aP),[]),m=w.useMemo(()=>new hL.FitAddon,[]),_=w.useMemo(()=>new pL.SearchAddon,[]),v=(M,D)=>{Ju(D)},y=w.useMemo(()=>new gL.WebLinksAddon(v),[]),g=Jn(Fd,M=>{window.postMessage({type:"liveConsoleSearchHotkey",action:M})},{noTrailing:!0}),p=()=>{if(!d.current||!f.element||!m){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const M=m.proposeDimensions();M?f.resize(M.cols,M.rows):console.log("refitTerminal: no proposed dimensions")};Pi("resize",TC(100,p)),w.useEffect(()=>{if(d.current&&h.current&&!f.element){console.log("live console xterm init"),d.current.innerHTML="",f.loadAddon(m),f.loadAddon(_),f.loadAddon(y),f.loadAddon(new uL.CanvasAddon),f.loadAddon(new oP(h.current,d.current)),f.open(d.current),f.write("\x1B[?25l"),p();const M=Jn(Fd,()=>{f.scrollLines(Math.min(1,2-f.rows))},{noTrailing:!0}),D=Jn(Fd,()=>{f.scrollLines(Math.max(1,f.rows-2))},{noTrailing:!0}),N=Jn(Fd,()=>{f.scrollToTop()},{noTrailing:!0}),L=Jn(Fd,()=>{f.scrollToBottom()},{noTrailing:!0});f.attachCustomKeyEventHandler(P=>{if(P.code==="F5"&&!P.ctrlKey)return!1;if(P.code==="Escape")return!1;if(P.code==="KeyF"&&(P.ctrlKey||P.metaKey))return!1;if(P.code==="F3")return!1;if(P.code==="KeyC"&&(P.ctrlKey||P.metaKey)){const I=f.getSelection();return I&&(zie(I,f.element,c).then(z=>{z===!1&&qe.error("Failed to copy to clipboard :(")}).catch(z=>{qe.error({title:"Failed to copy to clipboard:",msg:z.message})}),f.clearSelection()),!1}else{if(P.code==="PageUp")return M(),!1;if(P.code==="PageDown")return D(),!1;if(P.code==="Home")return N(),!1;if(P.code==="End")return L(),!1;if(DC(P))return!1}return!0})}},[f]),Pi("keydown",M=>{M.code==="F5"&&!M.ctrlKey?n&&(l(),M.preventDefault()):M.code==="Escape"?(_.clearDecorations(),s(!1)):M.code==="KeyF"&&(M.ctrlKey||M.metaKey)?(i?g("focus"):s(!0),M.preventDefault()):M.code==="F3"&&(g(M.shiftKey?"previous":"next"),M.preventDefault())});const x=M=>{const D=M.split(/\r?\n/);let N=!1;D.length&&!D[D.length-1]&&(D.pop(),N=!0);let L=!1;for(let P=0;P(S.current=xC(["liveconsole"]),S.current.on("connect",()=>{console.log("LiveConsole Socket.IO Connected."),r(!0)}),S.current.on("disconnect",M=>{console.log("LiveConsole Socket.IO Disonnected:",M);const D=b.current+1;b.current=D,setTimeout(()=>{b.current===D&&r(!1)},500)}),S.current.on("error",M=>{console.log("LiveConsole Socket.IO",M)}),S.current.on("consoleData",function(M){x(M)}),()=>{var M,D;(M=S.current)==null||M.removeAllListeners(),(D=S.current)==null||D.disconnect()}),[]);const C=M=>{!n||!S.current||S.current.emit("consoleCommand",M)},E=()=>{f.clear()},k=()=>{s(!i)},T=()=>{t(!e)},R=M=>{a.current&&(a.current.value=M,a.current.focus()),t(!1)};return u.jsxs("div",{className:"dark text-primary flex flex-col h-contentvh w-full bg-card border md:rounded-xl overflow-clip",children:[u.jsx(Aie,{}),u.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[n?null:u.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:u.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[u.jsx(sn,{className:"w-16 h-16 animate-spin"}),u.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Connecting..."})]})}),u.jsx(Pie,{isOpen:e,closeSheet:()=>t(!1),toTermInput:M=>R(M)}),u.jsx("div",{ref:d,className:"absolute top-1 left-2 right-0 bottom-0"}),u.jsx(sP,{show:i,setShow:s,searchAddon:_}),u.jsx("button",{ref:h,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{f.scrollToBottom()},children:u.jsx(_L,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]}),u.jsx(Mie,{termInputRef:a,isConnected:n,consoleWrite:C,consoleClear:E,toggleSaveSheet:T,toggleSearchBar:k})]})}const Qie=e=>1- --e*e*e*e,dR=1e3/60,Sm=({countTo:e,duration:t=1250})=>{const[n,r]=w.useState(0);return w.useEffect(()=>{let i=0;const s=Math.round(t/dR),a=setInterval(()=>{i++;const o=Qie(i/s);r(e*o),i===s&&clearInterval(a)},dR)},[]),Math.floor(n).toLocaleString("en-US")};function Cm(){return u.jsx("div",{className:"h-7 w-28 animate-pulse rounded-md bg-muted"})}function dP({callouts:e}){return e.length!==4?null:u.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:[u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[0].label}),u.jsx("div",{className:"hidden xs:block",children:e[0].icon})]}),e[0].value===!1?u.jsx(Cm,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[0].prefix,u.jsx(Sm,{countTo:e[0].value})]})]}),u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[1].label}),u.jsx("div",{className:"hidden xs:block",children:e[1].icon})]}),e[1].value===!1?u.jsx(Cm,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[1].prefix,u.jsx(Sm,{countTo:e[1].value})]})]}),u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[2].label}),u.jsx("div",{className:"hidden xs:block",children:e[2].icon})]}),e[2].value===!1?u.jsx(Cm,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[2].prefix,u.jsx(Sm,{countTo:e[2].value})]})]}),u.jsxs("div",{className:"py-2 px-4 rounded-lg border shadow-sm",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:e[3].label}),u.jsx("div",{className:"hidden xs:block",children:e[3].icon})]}),e[3].value===!1?u.jsx(Cm,{}):u.jsxs("div",{className:"text-xl xs:text-2xl font-bold",children:[e[3].prefix,u.jsx(Sm,{countTo:e[3].value})]})]})]})}function fi({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,i]=Jie({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:r,o=jt(n),l=w.useCallback(c=>{if(s){const d=typeof c=="function"?c(e):c;d!==e&&o(d)}else i(c)},[s,e,i,o]);return[a,l]}function Jie({defaultProp:e,onChange:t}){const n=w.useState(e),[r]=n,i=w.useRef(r),s=jt(t);return w.useEffect(()=>{i.current!==r&&(s(r),i.current=r)},[r,i,s]),n}function pp(e){const t=e+"CollectionProvider",[n,r]=Un(t),[i,s]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:_,children:v}=m,y=ft.useRef(null),g=ft.useRef(new Map).current;return u.jsx(i,{scope:_,itemMap:g,collectionRef:y,children:v})};a.displayName=t;const o=e+"CollectionSlot",l=ft.forwardRef((m,_)=>{const{scope:v,children:y}=m,g=s(o,v),p=We(_,g.collectionRef);return u.jsx(ia,{ref:p,children:y})});l.displayName=o;const c=e+"CollectionItemSlot",h="data-radix-collection-item",d=ft.forwardRef((m,_)=>{const{scope:v,children:y,...g}=m,p=ft.useRef(null),x=We(_,p),b=s(c,v);return ft.useEffect(()=>(b.itemMap.set(p,{ref:p,...g}),()=>void b.itemMap.delete(p))),u.jsx(ia,{[h]:"",ref:x,children:y})});d.displayName=c;function f(m){const _=s(e+"CollectionConsumer",m);return ft.useCallback(()=>{const y=_.collectionRef.current;if(!y)return[];const g=Array.from(y.querySelectorAll(`[${h}]`));return Array.from(_.itemMap.values()).sort((b,S)=>g.indexOf(b.ref.current)-g.indexOf(S.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:a,Slot:l,ItemSlot:d},f,r]}function Zie(e,t=globalThis==null?void 0:globalThis.document){const n=jt(e);w.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var ese="DismissableLayer",zw="dismissableLayer.update",tse="dismissableLayer.pointerDownOutside",nse="dismissableLayer.focusOutside",hR,hP=w.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Zu=w.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:a,onDismiss:o,...l}=e,c=w.useContext(hP),[h,d]=w.useState(null),f=(h==null?void 0:h.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=w.useState({}),_=We(t,E=>d(E)),v=Array.from(c.layers),[y]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),g=v.indexOf(y),p=h?v.indexOf(h):-1,x=c.layersWithOutsidePointerEventsDisabled.size>0,b=p>=g,S=sse(E=>{const k=E.target,T=[...c.branches].some(R=>R.contains(k));!b||T||(i==null||i(E),a==null||a(E),E.defaultPrevented||o==null||o())},f),C=ose(E=>{const k=E.target;[...c.branches].some(R=>R.contains(k))||(s==null||s(E),a==null||a(E),E.defaultPrevented||o==null||o())},f);return Zie(E=>{p===c.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&o&&(E.preventDefault(),o()))},f),w.useEffect(()=>{if(h)return n&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(hR=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(h)),c.layers.add(h),fR(),()=>{n&&c.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=hR)}},[h,f,n,c]),w.useEffect(()=>()=>{h&&(c.layers.delete(h),c.layersWithOutsidePointerEventsDisabled.delete(h),fR())},[h,c]),w.useEffect(()=>{const E=()=>m({});return document.addEventListener(zw,E),()=>document.removeEventListener(zw,E)},[]),u.jsx(Ee.div,{...l,ref:_,style:{pointerEvents:x?b?"auto":"none":void 0,...e.style},onFocusCapture:fe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:fe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:fe(e.onPointerDownCapture,S.onPointerDownCapture)})});Zu.displayName=ese;var rse="DismissableLayerBranch",ise=w.forwardRef((e,t)=>{const n=w.useContext(hP),r=w.useRef(null),i=We(t,r);return w.useEffect(()=>{const s=r.current;if(s)return n.branches.add(s),()=>{n.branches.delete(s)}},[n.branches]),u.jsx(Ee.div,{...e,ref:i})});ise.displayName=rse;function sse(e,t=globalThis==null?void 0:globalThis.document){const n=jt(e),r=w.useRef(!1),i=w.useRef(()=>{});return w.useEffect(()=>{const s=o=>{if(o.target&&!r.current){let l=function(){fP(tse,n,c,{discrete:!0})};const c={originalEvent:o};o.pointerType==="touch"?(t.removeEventListener("click",i.current),i.current=l,t.addEventListener("click",i.current,{once:!0})):l()}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 ose(e,t=globalThis==null?void 0:globalThis.document){const n=jt(e),r=w.useRef(!1);return w.useEffect(()=>{const i=s=>{s.target&&!r.current&&fP(nse,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 fR(){const e=new CustomEvent(zw);document.dispatchEvent(e)}function fP(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?lv(i,s):i.dispatchEvent(s)}var a_=0;function x5(){w.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??pR()),document.body.insertAdjacentElement("beforeend",e[1]??pR()),a_++,()=>{a_===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),a_--}},[])}function pR(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function ase(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function pP(...e){return t=>e.forEach(n=>ase(n,t))}function lse(...e){return w.useCallback(pP(...e),e)}var mP=w.forwardRef((e,t)=>{const{children:n,...r}=e,i=w.Children.toArray(n),s=i.find(use);if(s){const a=s.props.children,o=i.map(l=>l===s?w.Children.count(a)>1?w.Children.only(null):w.isValidElement(a)?a.props.children:null:l);return u.jsx(Hw,{...r,ref:t,children:w.isValidElement(a)?w.cloneElement(a,void 0,o):null})}return u.jsx(Hw,{...r,ref:t,children:n})});mP.displayName="Slot";var Hw=w.forwardRef((e,t)=>{const{children:n,...r}=e;if(w.isValidElement(n)){const i=hse(n);return w.cloneElement(n,{...dse(r,n.props),ref:t?pP(t,i):i})}return w.Children.count(n)>1?w.Children.only(null):null});Hw.displayName="SlotClone";var cse=({children:e})=>u.jsx(u.Fragment,{children:e});function use(e){return w.isValidElement(e)&&e.type===cse}function dse(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 hse(e){var r,i;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(i=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:i.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var fse=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],pse=fse.reduce((e,t)=>{const n=w.forwardRef((r,i)=>{const{asChild:s,...a}=r,o=s?mP:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),u.jsx(o,{...a,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{}),l_="focusScope.autoFocusOnMount",c_="focusScope.autoFocusOnUnmount",mR={bubbles:!1,cancelable:!0},mse="FocusScope",l1=w.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:s,...a}=e,[o,l]=w.useState(null),c=jt(i),h=jt(s),d=w.useRef(null),f=lse(t,v=>l(v)),m=w.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;w.useEffect(()=>{if(r){let v=function(x){if(m.paused||!o)return;const b=x.target;o.contains(b)?d.current=b:_o(d.current,{select:!0})},y=function(x){if(m.paused||!o)return;const b=x.relatedTarget;b!==null&&(o.contains(b)||_o(d.current,{select:!0}))},g=function(x){if(document.activeElement===document.body)for(const S of x)S.removedNodes.length>0&&_o(o)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const p=new MutationObserver(g);return o&&p.observe(o,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),p.disconnect()}}},[r,o,m.paused]),w.useEffect(()=>{if(o){vR.add(m);const v=document.activeElement;if(!o.contains(v)){const g=new CustomEvent(l_,mR);o.addEventListener(l_,c),o.dispatchEvent(g),g.defaultPrevented||(gse(bse(gP(o)),{select:!0}),document.activeElement===v&&_o(o))}return()=>{o.removeEventListener(l_,c),setTimeout(()=>{const g=new CustomEvent(c_,mR);o.addEventListener(c_,h),o.dispatchEvent(g),g.defaultPrevented||_o(v??document.body,{select:!0}),o.removeEventListener(c_,h),vR.remove(m)},0)}}},[o,c,h,m]);const _=w.useCallback(v=>{if(!n&&!r||m.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,g=document.activeElement;if(y&&g){const p=v.currentTarget,[x,b]=vse(p);x&&b?!v.shiftKey&&g===b?(v.preventDefault(),n&&_o(x,{select:!0})):v.shiftKey&&g===x&&(v.preventDefault(),n&&_o(b,{select:!0})):g===p&&v.preventDefault()}},[n,r,m.paused]);return u.jsx(pse.div,{tabIndex:-1,...a,ref:f,onKeyDown:_})});l1.displayName=mse;function gse(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(_o(r,{select:t}),document.activeElement!==n)return}function vse(e){const t=gP(e),n=gR(t,e),r=gR(t.reverse(),e);return[n,r]}function gP(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 gR(e,t){for(const n of e)if(!yse(n,{upTo:t}))return n}function yse(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 xse(e){return e instanceof HTMLInputElement&&"select"in e}function _o(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&xse(e)&&t&&e.select()}}var vR=_se();function _se(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=yR(e,t),e.unshift(t)},remove(t){var n;e=yR(e,t),(n=e[0])==null||n.resume()}}}function yR(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function bse(e){return e.filter(t=>t.tagName!=="A")}var wse=zj.useId||(()=>{}),Sse=0;function zr(e){const[t,n]=w.useState(wse());return pn(()=>{n(r=>r??String(Sse++))},[e]),t?`radix-${t}`:""}const Cse=["top","right","bottom","left"],oa=Math.min,Or=Math.max,Ev=Math.round,km=Math.floor,us=e=>({x:e,y:e}),kse={left:"right",right:"left",bottom:"top",top:"bottom"},Ese={start:"end",end:"start"};function Ww(e,t,n){return Or(e,oa(t,n))}function no(e,t){return typeof e=="function"?e(t):e}function ro(e){return e.split("-")[0]}function ed(e){return e.split("-")[1]}function _5(e){return e==="x"?"y":"x"}function b5(e){return e==="y"?"height":"width"}function aa(e){return["top","bottom"].includes(ro(e))?"y":"x"}function w5(e){return _5(aa(e))}function Tse(e,t,n){n===void 0&&(n=!1);const r=ed(e),i=w5(e),s=b5(i);let a=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(a=Tv(a)),[a,Tv(a)]}function Rse(e){const t=Tv(e);return[Uw(e),t,Uw(t)]}function Uw(e){return e.replace(/start|end/g,t=>Ese[t])}function Mse(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 Ase(e,t,n,r){const i=ed(e);let s=Mse(ro(e),n==="start",r);return i&&(s=s.map(a=>a+"-"+i),t&&(s=s.concat(s.map(Uw)))),s}function Tv(e){return e.replace(/left|right|bottom|top/g,t=>kse[t])}function jse(e){return{top:0,right:0,bottom:0,left:0,...e}}function vP(e){return typeof e!="number"?jse(e):{top:e,right:e,bottom:e,left:e}}function Rv(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function xR(e,t,n){let{reference:r,floating:i}=e;const s=aa(t),a=w5(t),o=b5(a),l=ro(t),c=s==="y",h=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[o]/2-i[o]/2;let m;switch(l){case"top":m={x:h,y:r.y-i.height};break;case"bottom":m={x:h,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:d};break;case"left":m={x:r.x-i.width,y:d};break;default:m={x:r.x,y:r.y}}switch(ed(t)){case"start":m[a]-=f*(n&&c?-1:1);break;case"end":m[a]+=f*(n&&c?-1:1);break}return m}const Dse=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:h,y:d}=xR(c,r,l),f=r,m={},_=0;for(let v=0;v({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:h=0}=no(e,t)||{};if(c==null)return{};const d=vP(h),f={x:n,y:r},m=w5(i),_=b5(m),v=await a.getDimensions(c),y=m==="y",g=y?"top":"left",p=y?"bottom":"right",x=y?"clientHeight":"clientWidth",b=s.reference[_]+s.reference[m]-f[m]-s.floating[_],S=f[m]-s.reference[m],C=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c));let E=C?C[x]:0;(!E||!await(a.isElement==null?void 0:a.isElement(C)))&&(E=o.floating[x]||s.floating[_]);const k=b/2-S/2,T=E/2-v[_]/2-1,R=oa(d[g],T),M=oa(d[p],T),D=R,N=E-v[_]-M,L=E/2-v[_]/2+k,P=Ww(D,L,N),I=!l.arrow&&ed(i)!=null&&L!==P&&s.reference[_]/2-(LL<=0)){var M,D;const L=(((M=s.flip)==null?void 0:M.index)||0)+1,P=E[L];if(P)return{data:{index:L,overflows:R},reset:{placement:P}};let I=(D=R.filter(z=>z.overflows[0]<=0).sort((z,O)=>z.overflows[1]-O.overflows[1])[0])==null?void 0:D.placement;if(!I)switch(m){case"bestFit":{var N;const z=(N=R.filter(O=>{if(C){const A=aa(O.placement);return A===p||A==="y"}return!0}).map(O=>[O.placement,O.overflows.filter(A=>A>0).reduce((A,j)=>A+j,0)]).sort((O,A)=>O[1]-A[1])[0])==null?void 0:N[0];z&&(I=z);break}case"initialPlacement":I=o;break}if(i!==I)return{reset:{placement:I}}}return{}}}};function _R(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function bR(e){return Cse.some(t=>e[t]>=0)}const Pse=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...i}=no(e,t);switch(r){case"referenceHidden":{const s=await vf(t,{...i,elementContext:"reference"}),a=_R(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:bR(a)}}}case"escaped":{const s=await vf(t,{...i,altBoundary:!0}),a=_R(s,n.floating);return{data:{escapedOffsets:a,escaped:bR(a)}}}default:return{}}}}};async function Ose(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),a=ro(n),o=ed(n),l=aa(n)==="y",c=["left","top"].includes(a)?-1:1,h=s&&l?-1:1,d=no(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:_}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return o&&typeof _=="number"&&(m=o==="end"?_*-1:_),l?{x:m*h,y:f*c}:{x:f*c,y:m*h}}const Ise=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 Ose(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}}}}},$se=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:y=>{let{x:g,y:p}=y;return{x:g,y:p}}},...l}=no(e,t),c={x:n,y:r},h=await vf(t,l),d=aa(ro(i)),f=_5(d);let m=c[f],_=c[d];if(s){const y=f==="y"?"top":"left",g=f==="y"?"bottom":"right",p=m+h[y],x=m-h[g];m=Ww(p,m,x)}if(a){const y=d==="y"?"top":"left",g=d==="y"?"bottom":"right",p=_+h[y],x=_-h[g];_=Ww(p,_,x)}const v=o.fn({...t,[f]:m,[d]:_});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:s,[d]:a}}}}}},Bse=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}=no(e,t),h={x:n,y:r},d=aa(i),f=_5(d);let m=h[f],_=h[d];const v=no(o,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",b=s.reference[f]-s.floating[x]+y.mainAxis,S=s.reference[f]+s.reference[x]-y.mainAxis;mS&&(m=S)}if(c){var g,p;const x=f==="y"?"width":"height",b=["top","left"].includes(ro(i)),S=s.reference[d]-s.floating[x]+(b&&((g=a.offset)==null?void 0:g[d])||0)+(b?0:y.crossAxis),C=s.reference[d]+s.reference[x]+(b?0:((p=a.offset)==null?void 0:p[d])||0)-(b?y.crossAxis:0);_C&&(_=C)}return{[f]:m,[d]:_}}}},Fse=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:a,elements:o}=t,{apply:l=()=>{},...c}=no(e,t),h=await vf(t,c),d=ro(i),f=ed(i),m=aa(i)==="y",{width:_,height:v}=s.floating;let y,g;d==="top"||d==="bottom"?(y=d,g=f===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(g=d,y=f==="end"?"top":"bottom");const p=v-h.top-h.bottom,x=_-h.left-h.right,b=oa(v-h[y],p),S=oa(_-h[g],x),C=!t.middlewareData.shift;let E=b,k=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=p),C&&!f){const R=Or(h.left,0),M=Or(h.right,0),D=Or(h.top,0),N=Or(h.bottom,0);m?k=_-2*(R!==0||M!==0?R+M:Or(h.left,h.right)):E=v-2*(D!==0||N!==0?D+N:Or(h.top,h.bottom))}await l({...t,availableWidth:k,availableHeight:E});const T=await a.getDimensions(o.floating);return _!==T.width||v!==T.height?{reset:{rects:!0}}:{}}}};function c1(){return typeof window<"u"}function td(e){return yP(e)?(e.nodeName||"").toLowerCase():"#document"}function Hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ws(e){var t;return(t=(yP(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yP(e){return c1()?e instanceof Node||e instanceof Hr(e).Node:!1}function Oi(e){return c1()?e instanceof Element||e instanceof Hr(e).Element:!1}function gs(e){return c1()?e instanceof HTMLElement||e instanceof Hr(e).HTMLElement:!1}function wR(e){return!c1()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hr(e).ShadowRoot}function mp(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Ii(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function zse(e){return["table","td","th"].includes(td(e))}function u1(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function S5(e){const t=C5(),n=Oi(e)?Ii(e):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 Hse(e){let t=la(e);for(;gs(t)&&!_u(t);){if(S5(t))return t;if(u1(t))return null;t=la(t)}return null}function C5(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function _u(e){return["html","body","#document"].includes(td(e))}function Ii(e){return Hr(e).getComputedStyle(e)}function d1(e){return Oi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function la(e){if(td(e)==="html")return e;const t=e.assignedSlot||e.parentNode||wR(e)&&e.host||ws(e);return wR(t)?t.host:t}function xP(e){const t=la(e);return _u(t)?e.ownerDocument?e.ownerDocument.body:e.body:gs(t)&&mp(t)?t:xP(t)}function yf(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xP(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),a=Hr(i);if(s){const o=Vw(a);return t.concat(a,a.visualViewport||[],mp(i)?i:[],o&&n?yf(o):[])}return t.concat(i,yf(i,[],n))}function Vw(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _P(e){const t=Ii(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=gs(e),s=i?e.offsetWidth:n,a=i?e.offsetHeight:r,o=Ev(n)!==s||Ev(r)!==a;return o&&(n=s,r=a),{width:n,height:r,$:o}}function k5(e){return Oi(e)?e:e.contextElement}function Fc(e){const t=k5(e);if(!gs(t))return us(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=_P(t);let a=(s?Ev(n.width):n.width)/r,o=(s?Ev(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!o||!Number.isFinite(o))&&(o=1),{x:a,y:o}}const Wse=us(0);function bP(e){const t=Hr(e);return!C5()||!t.visualViewport?Wse:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Use(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hr(e)?!1:t}function ml(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=k5(e);let a=us(1);t&&(r?Oi(r)&&(a=Fc(r)):a=Fc(e));const o=Use(s,n,r)?bP(s):us(0);let l=(i.left+o.x)/a.x,c=(i.top+o.y)/a.y,h=i.width/a.x,d=i.height/a.y;if(s){const f=Hr(s),m=r&&Oi(r)?Hr(r):r;let _=f,v=Vw(_);for(;v&&r&&m!==_;){const y=Fc(v),g=v.getBoundingClientRect(),p=Ii(v),x=g.left+(v.clientLeft+parseFloat(p.paddingLeft))*y.x,b=g.top+(v.clientTop+parseFloat(p.paddingTop))*y.y;l*=y.x,c*=y.y,h*=y.x,d*=y.y,l+=x,c+=b,_=Hr(v),v=Vw(_)}}return Rv({width:h,height:d,x:l,y:c})}function E5(e,t){const n=d1(e).scrollLeft;return t?t.left+n:ml(ws(e)).left+n}function wP(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:E5(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function Vse(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",a=ws(r),o=t?u1(t.floating):!1;if(r===a||o&&s)return n;let l={scrollLeft:0,scrollTop:0},c=us(1);const h=us(0),d=gs(r);if((d||!d&&!s)&&((td(r)!=="body"||mp(a))&&(l=d1(r)),gs(r))){const m=ml(r);c=Fc(r),h.x=m.x+r.clientLeft,h.y=m.y+r.clientTop}const f=a&&!d&&!s?wP(a,l,!0):us(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+h.x+f.x,y:n.y*c.y-l.scrollTop*c.y+h.y+f.y}}function qse(e){return Array.from(e.getClientRects())}function Gse(e){const t=ws(e),n=d1(e),r=e.ownerDocument.body,i=Or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=Or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+E5(e);const o=-n.scrollTop;return Ii(r).direction==="rtl"&&(a+=Or(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:a,y:o}}function Kse(e,t){const n=Hr(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=C5();(!c||c&&t==="fixed")&&(o=i.offsetLeft,l=i.offsetTop)}return{width:s,height:a,x:o,y:l}}function Yse(e,t){const n=ml(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=gs(e)?Fc(e):us(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 SR(e,t,n){let r;if(t==="viewport")r=Kse(e,n);else if(t==="document")r=Gse(ws(e));else if(Oi(t))r=Yse(t,n);else{const i=bP(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Rv(r)}function SP(e,t){const n=la(e);return n===t||!Oi(n)||_u(n)?!1:Ii(n).position==="fixed"||SP(n,t)}function Xse(e,t){const n=t.get(e);if(n)return n;let r=yf(e,[],!1).filter(o=>Oi(o)&&td(o)!=="body"),i=null;const s=Ii(e).position==="fixed";let a=s?la(e):e;for(;Oi(a)&&!_u(a);){const o=Ii(a),l=S5(a);!l&&o.position==="fixed"&&(i=null),(s?!l&&!i:!l&&o.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||mp(a)&&!l&&SP(e,a))?r=r.filter(h=>h!==a):i=o,a=la(a)}return t.set(e,r),r}function Qse(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const a=[...n==="clippingAncestors"?u1(t)?[]:Xse(t,this._c):[].concat(n),r],o=a[0],l=a.reduce((c,h)=>{const d=SR(t,h,i);return c.top=Or(d.top,c.top),c.right=oa(d.right,c.right),c.bottom=oa(d.bottom,c.bottom),c.left=Or(d.left,c.left),c},SR(t,o,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Jse(e){const{width:t,height:n}=_P(e);return{width:t,height:n}}function Zse(e,t,n){const r=gs(t),i=ws(t),s=n==="fixed",a=ml(e,!0,s,t);let o={scrollLeft:0,scrollTop:0};const l=us(0);if(r||!r&&!s)if((td(t)!=="body"||mp(i))&&(o=d1(t)),r){const f=ml(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else i&&(l.x=E5(i));const c=i&&!r&&!s?wP(i,o):us(0),h=a.left+o.scrollLeft-l.x-c.x,d=a.top+o.scrollTop-l.y-c.y;return{x:h,y:d,width:a.width,height:a.height}}function u_(e){return Ii(e).position==="static"}function CR(e,t){if(!gs(e)||Ii(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ws(e)===n&&(n=n.ownerDocument.body),n}function CP(e,t){const n=Hr(e);if(u1(e))return n;if(!gs(e)){let i=la(e);for(;i&&!_u(i);){if(Oi(i)&&!u_(i))return i;i=la(i)}return n}let r=CR(e,t);for(;r&&zse(r)&&u_(r);)r=CR(r,t);return r&&_u(r)&&u_(r)&&!S5(r)?n:r||Hse(e)||n}const eoe=async function(e){const t=this.getOffsetParent||CP,n=this.getDimensions,r=await n(e.floating);return{reference:Zse(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function toe(e){return Ii(e).direction==="rtl"}const noe={convertOffsetParentRelativeRectToViewportRelativeRect:Vse,getDocumentElement:ws,getClippingRect:Qse,getOffsetParent:CP,getElementRects:eoe,getClientRects:qse,getDimensions:Jse,getScale:Fc,isElement:Oi,isRTL:toe};function roe(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:h,width:d,height:f}=e.getBoundingClientRect();if(o||t(),!d||!f)return;const m=km(h),_=km(i.clientWidth-(c+d)),v=km(i.clientHeight-(h+f)),y=km(c),p={rootMargin:-m+"px "+-_+"px "+-v+"px "+-y+"px",threshold:Or(0,oa(1,l))||1};let x=!0;function b(S){const C=S[0].intersectionRatio;if(C!==l){if(!x)return a();C?a(!1,C):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(b,{...p,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,p)}n.observe(e)}return a(!0),s}function ioe(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=k5(e),h=i||s?[...c?yf(c):[],...yf(t)]:[];h.forEach(g=>{i&&g.addEventListener("scroll",n,{passive:!0}),s&&g.addEventListener("resize",n)});const d=c&&o?roe(c,n):null;let f=-1,m=null;a&&(m=new ResizeObserver(g=>{let[p]=g;p&&p.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),c&&!l&&m.observe(c),m.observe(t));let _,v=l?ml(e):null;l&&y();function y(){const g=ml(e);v&&(g.x!==v.x||g.y!==v.y||g.width!==v.width||g.height!==v.height)&&n(),v=g,_=requestAnimationFrame(y)}return n(),()=>{var g;h.forEach(p=>{i&&p.removeEventListener("scroll",n),s&&p.removeEventListener("resize",n)}),d==null||d(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(_)}}const soe=Ise,ooe=$se,aoe=Nse,loe=Fse,coe=Pse,kR=Lse,uoe=Bse,doe=(e,t,n)=>{const r=new Map,i={platform:noe,...n},s={...i.platform,_c:r};return Dse(e,t,{...i,platform:s})};var xg=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Mv(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(!Mv(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)&&!Mv(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function kP(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ER(e,t){const n=kP(e);return Math.round(t*n)/n}function d_(e){const t=w.useRef(e);return xg(()=>{t.current=e}),t}function hoe(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,[h,d]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=w.useState(r);Mv(f,r)||m(r);const[_,v]=w.useState(null),[y,g]=w.useState(null),p=w.useCallback(O=>{O!==C.current&&(C.current=O,v(O))},[]),x=w.useCallback(O=>{O!==E.current&&(E.current=O,g(O))},[]),b=s||_,S=a||y,C=w.useRef(null),E=w.useRef(null),k=w.useRef(h),T=l!=null,R=d_(l),M=d_(i),D=d_(c),N=w.useCallback(()=>{if(!C.current||!E.current)return;const O={placement:t,strategy:n,middleware:f};M.current&&(O.platform=M.current),doe(C.current,E.current,O).then(A=>{const j={...A,isPositioned:D.current!==!1};L.current&&!Mv(k.current,j)&&(k.current=j,$r.flushSync(()=>{d(j)}))})},[f,t,n,M,D]);xg(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(O=>({...O,isPositioned:!1})))},[c]);const L=w.useRef(!1);xg(()=>(L.current=!0,()=>{L.current=!1}),[]),xg(()=>{if(b&&(C.current=b),S&&(E.current=S),b&&S){if(R.current)return R.current(b,S,N);N()}},[b,S,N,R,T]);const P=w.useMemo(()=>({reference:C,floating:E,setReference:p,setFloating:x}),[p,x]),I=w.useMemo(()=>({reference:b,floating:S}),[b,S]),z=w.useMemo(()=>{const O={position:n,left:0,top:0};if(!I.floating)return O;const A=ER(I.floating,h.x),j=ER(I.floating,h.y);return o?{...O,transform:"translate("+A+"px, "+j+"px)",...kP(I.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:A,top:j}},[n,o,I.floating,h.x,h.y]);return w.useMemo(()=>({...h,update:N,refs:P,elements:I,floatingStyles:z}),[h,N,P,I,z])}const foe=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?kR({element:r.current,padding:i}).fn(n):{}:r?kR({element:r,padding:i}).fn(n):{}}}},poe=(e,t)=>({...soe(e),options:[e,t]}),moe=(e,t)=>({...ooe(e),options:[e,t]}),goe=(e,t)=>({...uoe(e),options:[e,t]}),voe=(e,t)=>({...aoe(e),options:[e,t]}),yoe=(e,t)=>({...loe(e),options:[e,t]}),xoe=(e,t)=>({...coe(e),options:[e,t]}),_oe=(e,t)=>({...foe(e),options:[e,t]});var boe="Arrow",EP=w.forwardRef((e,t)=>{const{children:n,width:r=10,height:i=5,...s}=e;return u.jsx(Ee.svg,{...s,ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:u.jsx("polygon",{points:"0,0 30,0 15,10"})})});EP.displayName=boe;var woe=EP;function h1(e){const[t,n]=w.useState(void 0);return pn(()=>{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}var T5="Popper",[TP,nd]=Un(T5),[Soe,RP]=TP(T5),MP=e=>{const{__scopePopper:t,children:n}=e,[r,i]=w.useState(null);return u.jsx(Soe,{scope:t,anchor:r,onAnchorChange:i,children:n})};MP.displayName=T5;var AP="PopperAnchor",jP=w.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...i}=e,s=RP(AP,n),a=w.useRef(null),o=We(t,a);return w.useEffect(()=>{s.onAnchorChange((r==null?void 0:r.current)||a.current)}),r?null:u.jsx(Ee.div,{...i,ref:o})});jP.displayName=AP;var R5="PopperContent",[Coe,koe]=TP(R5),DP=w.forwardRef((e,t)=>{var W,$,V,U,Q,q;const{__scopePopper:n,side:r="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:o=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:h=0,sticky:d="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:_,...v}=e,y=RP(R5,n),[g,p]=w.useState(null),x=We(t,ie=>p(ie)),[b,S]=w.useState(null),C=h1(b),E=(C==null?void 0:C.width)??0,k=(C==null?void 0:C.height)??0,T=r+(s!=="center"?"-"+s:""),R=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},M=Array.isArray(c)?c:[c],D=M.length>0,N={padding:R,boundary:M.filter(Toe),altBoundary:D},{refs:L,floatingStyles:P,placement:I,isPositioned:z,middlewareData:O}=hoe({strategy:"fixed",placement:T,whileElementsMounted:(...ie)=>ioe(...ie,{animationFrame:m==="always"}),elements:{reference:y.anchor},middleware:[poe({mainAxis:i+k,alignmentAxis:a}),l&&moe({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?goe():void 0,...N}),l&&voe({...N}),yoe({...N,apply:({elements:ie,rects:re,availableWidth:ce,availableHeight:ye})=>{const{width:le,height:Re}=re.reference,Ae=ie.floating.style;Ae.setProperty("--radix-popper-available-width",`${ce}px`),Ae.setProperty("--radix-popper-available-height",`${ye}px`),Ae.setProperty("--radix-popper-anchor-width",`${le}px`),Ae.setProperty("--radix-popper-anchor-height",`${Re}px`)}}),b&&_oe({element:b,padding:o}),Roe({arrowWidth:E,arrowHeight:k}),f&&xoe({strategy:"referenceHidden",...N})]}),[A,j]=PP(I),F=jt(_);pn(()=>{z&&(F==null||F())},[z,F]);const H=(W=O.arrow)==null?void 0:W.x,B=($=O.arrow)==null?void 0:$.y,G=((V=O.arrow)==null?void 0:V.centerOffset)!==0,[Z,X]=w.useState();return pn(()=>{g&&X(window.getComputedStyle(g).zIndex)},[g]),u.jsx("div",{ref:L.setFloating,"data-radix-popper-content-wrapper":"",style:{...P,transform:z?P.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Z,"--radix-popper-transform-origin":[(U=O.transformOrigin)==null?void 0:U.x,(Q=O.transformOrigin)==null?void 0:Q.y].join(" "),...((q=O.hide)==null?void 0:q.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:u.jsx(Coe,{scope:n,placedSide:A,onArrowChange:S,arrowX:H,arrowY:B,shouldHideArrow:G,children:u.jsx(Ee.div,{"data-side":A,"data-align":j,...v,ref:x,style:{...v.style,animation:z?void 0:"none"}})})})});DP.displayName=R5;var LP="PopperArrow",Eoe={top:"bottom",right:"left",bottom:"top",left:"right"},NP=w.forwardRef(function(t,n){const{__scopePopper:r,...i}=t,s=koe(LP,r),a=Eoe[s.placedSide];return u.jsx("span",{ref:s.onArrowChange,style:{position:"absolute",left:s.arrowX,top:s.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[s.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[s.placedSide],visibility:s.shouldHideArrow?"hidden":void 0},children:u.jsx(woe,{...i,ref:n,style:{...i.style,display:"block"}})})});NP.displayName=LP;function Toe(e){return e!==null}var Roe=e=>({name:"transformOrigin",options:e,fn(t){var y,g,p;const{placement:n,rects:r,middlewareData:i}=t,a=((y=i.arrow)==null?void 0:y.centerOffset)!==0,o=a?0:e.arrowWidth,l=a?0:e.arrowHeight,[c,h]=PP(n),d={start:"0%",center:"50%",end:"100%"}[h],f=(((g=i.arrow)==null?void 0:g.x)??0)+o/2,m=(((p=i.arrow)==null?void 0:p.y)??0)+l/2;let _="",v="";return c==="bottom"?(_=a?d:`${f}px`,v=`${-l}px`):c==="top"?(_=a?d:`${f}px`,v=`${r.floating.height+l}px`):c==="right"?(_=`${-l}px`,v=a?d:`${m}px`):c==="left"&&(_=`${r.floating.width+l}px`,v=a?d:`${m}px`),{data:{x:_,y:v}}}});function PP(e){const[t,n="center"]=e.split("-");return[t,n]}var M5=MP,A5=jP,j5=DP,D5=NP,Moe="Portal",f1=w.forwardRef((e,t)=>{var o;const{container:n,...r}=e,[i,s]=w.useState(!1);pn(()=>s(!0),[]);const a=n||i&&((o=globalThis==null?void 0:globalThis.document)==null?void 0:o.body);return a?VD.createPortal(u.jsx(Ee.div,{...r,ref:t}),a):null});f1.displayName=Moe;var h_="rovingFocusGroup.onEntryFocus",Aoe={bubbles:!1,cancelable:!0},p1="RovingFocusGroup",[qw,OP,joe]=pp(p1),[Doe,rd]=Un(p1,[joe]),[Loe,Noe]=Doe(p1),IP=w.forwardRef((e,t)=>u.jsx(qw.Provider,{scope:e.__scopeRovingFocusGroup,children:u.jsx(qw.Slot,{scope:e.__scopeRovingFocusGroup,children:u.jsx(Poe,{...e,ref:t})})}));IP.displayName=p1;var Poe=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:s,currentTabStopId:a,defaultCurrentTabStopId:o,onCurrentTabStopIdChange:l,onEntryFocus:c,preventScrollOnEntryFocus:h=!1,...d}=e,f=w.useRef(null),m=We(t,f),_=Al(s),[v=null,y]=fi({prop:a,defaultProp:o,onChange:l}),[g,p]=w.useState(!1),x=jt(c),b=OP(n),S=w.useRef(!1),[C,E]=w.useState(0);return w.useEffect(()=>{const k=f.current;if(k)return k.addEventListener(h_,x),()=>k.removeEventListener(h_,x)},[x]),u.jsx(Loe,{scope:n,orientation:r,dir:_,loop:i,currentTabStopId:v,onItemFocus:w.useCallback(k=>y(k),[y]),onItemShiftTab:w.useCallback(()=>p(!0),[]),onFocusableItemAdd:w.useCallback(()=>E(k=>k+1),[]),onFocusableItemRemove:w.useCallback(()=>E(k=>k-1),[]),children:u.jsx(Ee.div,{tabIndex:g||C===0?-1:0,"data-orientation":r,...d,ref:m,style:{outline:"none",...e.style},onMouseDown:fe(e.onMouseDown,()=>{S.current=!0}),onFocus:fe(e.onFocus,k=>{const T=!S.current;if(k.target===k.currentTarget&&T&&!g){const R=new CustomEvent(h_,Aoe);if(k.currentTarget.dispatchEvent(R),!R.defaultPrevented){const M=b().filter(I=>I.focusable),D=M.find(I=>I.active),N=M.find(I=>I.id===v),P=[D,N,...M].filter(Boolean).map(I=>I.ref.current);FP(P,h)}}S.current=!1}),onBlur:fe(e.onBlur,()=>p(!1))})})}),$P="RovingFocusGroupItem",BP=w.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:s,...a}=e,o=zr(),l=s||o,c=Noe($P,n),h=c.currentTabStopId===l,d=OP(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=c;return w.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),u.jsx(qw.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:u.jsx(Ee.span,{tabIndex:h?0:-1,"data-orientation":c.orientation,...a,ref:t,onMouseDown:fe(e.onMouseDown,_=>{r?c.onItemFocus(l):_.preventDefault()}),onFocus:fe(e.onFocus,()=>c.onItemFocus(l)),onKeyDown:fe(e.onKeyDown,_=>{if(_.key==="Tab"&&_.shiftKey){c.onItemShiftTab();return}if(_.target!==_.currentTarget)return;const v=$oe(_,c.orientation,c.dir);if(v!==void 0){if(_.metaKey||_.ctrlKey||_.altKey||_.shiftKey)return;_.preventDefault();let g=d().filter(p=>p.focusable).map(p=>p.ref.current);if(v==="last")g.reverse();else if(v==="prev"||v==="next"){v==="prev"&&g.reverse();const p=g.indexOf(_.currentTarget);g=c.loop?Boe(g,p+1):g.slice(p+1)}setTimeout(()=>FP(g))}})})})});BP.displayName=$P;var Ooe={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Ioe(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function $oe(e,t,n){const r=Ioe(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return Ooe[r]}function FP(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Boe(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var L5=IP,N5=BP,Foe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},ic=new WeakMap,Em=new WeakMap,Tm={},f_=0,zP=function(e){return e&&(e.host||zP(e.parentNode))},zoe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=zP(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})},Hoe=function(e,t,n,r){var i=zoe(t,Array.isArray(e)?e:[e]);Tm[n]||(Tm[n]=new WeakMap);var s=Tm[n],a=[],o=new Set,l=new Set(i),c=function(d){!d||o.has(d)||(o.add(d),c(d.parentNode))};i.forEach(c);var h=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(f){if(o.has(f))h(f);else try{var m=f.getAttribute(r),_=m!==null&&m!=="false",v=(ic.get(f)||0)+1,y=(s.get(f)||0)+1;ic.set(f,v),s.set(f,y),a.push(f),v===1&&_&&Em.set(f,!0),y===1&&f.setAttribute(n,"true"),_||f.setAttribute(r,"true")}catch(g){console.error("aria-hidden: cannot operate on ",f,g)}})};return h(t),o.clear(),f_++,function(){a.forEach(function(d){var f=ic.get(d)-1,m=s.get(d)-1;ic.set(d,f),s.set(d,m),f||(Em.has(d)||d.removeAttribute(r),Em.delete(d)),m||d.removeAttribute(n)}),f_--,f_||(ic=new WeakMap,ic=new WeakMap,Em=new WeakMap,Tm={})}},P5=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),i=Foe(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Hoe(r,i,n,"aria-hidden")):function(){return null}},rs=function(){return rs=Object.assign||function(t){for(var n,r=1,i=arguments.length;r"u")return sae;var t=oae(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])}},lae=VP(),zc="data-scroll-locked",cae=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(Uoe,` { overflow: hidden `).concat(r,`; padding-right: `).concat(o,"px ").concat(r,`; } body[`).concat(zc,`] { 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(_g,` { right: `).concat(o,"px ").concat(r,`; } .`).concat(bg,` { margin-right: `).concat(o,"px ").concat(r,`; } .`).concat(_g," .").concat(_g,` { right: 0 `).concat(r,`; } .`).concat(bg," .").concat(bg,` { margin-right: 0 `).concat(r,`; } body[`).concat(zc,`] { `).concat(Voe,": ").concat(o,`px; } `)},RR=function(){var e=parseInt(document.body.getAttribute(zc)||"0",10);return isFinite(e)?e:0},uae=function(){w.useEffect(function(){return document.body.setAttribute(zc,(RR()+1).toString()),function(){var e=RR()-1;e<=0?document.body.removeAttribute(zc):document.body.setAttribute(zc,e.toString())}},[])},dae=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;uae();var s=w.useMemo(function(){return aae(i)},[i]);return w.createElement(lae,{styles:cae(s,!t,i,n?"":"!important")})},Gw=!1;if(typeof window<"u")try{var Rm=Object.defineProperty({},"passive",{get:function(){return Gw=!0,!0}});window.addEventListener("test",Rm,Rm),window.removeEventListener("test",Rm,Rm)}catch{Gw=!1}var sc=Gw?{passive:!1}:!1,hae=function(e){return e.tagName==="TEXTAREA"},qP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!hae(e)&&n[t]==="visible")},fae=function(e){return qP(e,"overflowY")},pae=function(e){return qP(e,"overflowX")},MR=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=GP(e,r);if(i){var s=KP(e,r),a=s[1],o=s[2];if(a>o)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},mae=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},gae=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},GP=function(e,t){return e==="v"?fae(t):pae(t)},KP=function(e,t){return e==="v"?mae(t):gae(t)},vae=function(e,t){return e==="h"&&t==="rtl"?-1:1},yae=function(e,t,n,r,i){var s=vae(e,window.getComputedStyle(t).direction),a=s*r,o=n.target,l=t.contains(o),c=!1,h=a>0,d=0,f=0;do{var m=KP(e,o),_=m[0],v=m[1],y=m[2],g=v-y-s*_;(_||g)&&GP(e,o)&&(d+=g,f+=_),o instanceof ShadowRoot?o=o.host:o=o.parentNode}while(!l&&o!==document.body||l&&(t.contains(o)||t===o));return(h&&(Math.abs(d)<1||!i)||!h&&(Math.abs(f)<1||!i))&&(c=!0),c},Mm=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},AR=function(e){return[e.deltaX,e.deltaY]},jR=function(e){return e&&"current"in e?e.current:e},xae=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_ae=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},bae=0,oc=[];function wae(e){var t=w.useRef([]),n=w.useRef([0,0]),r=w.useRef(),i=w.useState(bae++)[0],s=w.useState(VP)[0],a=w.useRef(e);w.useEffect(function(){a.current=e},[e]),w.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var v=Woe([e.lockRef.current],(e.shards||[]).map(jR),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var o=w.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var g=Mm(v),p=n.current,x="deltaX"in v?v.deltaX:p[0]-g[0],b="deltaY"in v?v.deltaY:p[1]-g[1],S,C=v.target,E=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in v&&E==="h"&&C.type==="range")return!1;var k=MR(E,C);if(!k)return!0;if(k?S=E:(S=E==="v"?"h":"v",k=MR(E,C)),!k)return!1;if(!r.current&&"changedTouches"in v&&(x||b)&&(r.current=S),!S)return!0;var T=r.current||S;return yae(T,y,v,T==="h"?x:b,!0)},[]),l=w.useCallback(function(v){var y=v;if(!(!oc.length||oc[oc.length-1]!==s)){var g="deltaY"in y?AR(y):Mm(y),p=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&xae(S.delta,g)})[0];if(p&&p.should){y.cancelable&&y.preventDefault();return}if(!p){var x=(a.current.shards||[]).map(jR).filter(Boolean).filter(function(S){return S.contains(y.target)}),b=x.length>0?o(y,x[0]):!a.current.noIsolation;b&&y.cancelable&&y.preventDefault()}}},[]),c=w.useCallback(function(v,y,g,p){var x={name:v,delta:y,target:g,should:p,shadowParent:Sae(g)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),h=w.useCallback(function(v){n.current=Mm(v),r.current=void 0},[]),d=w.useCallback(function(v){c(v.type,AR(v),v.target,o(v,e.lockRef.current))},[]),f=w.useCallback(function(v){c(v.type,Mm(v),v.target,o(v,e.lockRef.current))},[]);w.useEffect(function(){return oc.push(s),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener("wheel",l,sc),document.addEventListener("touchmove",l,sc),document.addEventListener("touchstart",h,sc),function(){oc=oc.filter(function(v){return v!==s}),document.removeEventListener("wheel",l,sc),document.removeEventListener("touchmove",l,sc),document.removeEventListener("touchstart",h,sc)}},[]);var m=e.removeScrollBar,_=e.inert;return w.createElement(w.Fragment,null,_?w.createElement(s,{styles:_ae(i)}):null,m?w.createElement(dae,{gapMode:e.gapMode}):null)}function Sae(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Cae=Joe(UP,wae);var g1=w.forwardRef(function(e,t){return w.createElement(m1,rs({},e,{ref:t,sideCar:Cae}))});g1.classNames=m1.classNames;var Kw=["Enter"," "],kae=["ArrowDown","PageUp","Home"],YP=["ArrowUp","PageDown","End"],Eae=[...kae,...YP],Tae={ltr:[...Kw,"ArrowRight"],rtl:[...Kw,"ArrowLeft"]},Rae={ltr:["ArrowLeft"],rtl:["ArrowRight"]},gp="Menu",[xf,Mae,Aae]=pp(gp),[Ol,XP]=Un(gp,[Aae,nd,rd]),v1=nd(),QP=rd(),[jae,Il]=Ol(gp),[Dae,vp]=Ol(gp),JP=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:s,modal:a=!0}=e,o=v1(t),[l,c]=w.useState(null),h=w.useRef(!1),d=jt(s),f=Al(i);return w.useEffect(()=>{const m=()=>{h.current=!0,document.addEventListener("pointerdown",_,{capture:!0,once:!0}),document.addEventListener("pointermove",_,{capture:!0,once:!0})},_=()=>h.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",_,{capture:!0}),document.removeEventListener("pointermove",_,{capture:!0})}},[]),u.jsx(M5,{...o,children:u.jsx(jae,{scope:t,open:n,onOpenChange:d,content:l,onContentChange:c,children:u.jsx(Dae,{scope:t,onClose:w.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:h,dir:f,modal:a,children:r})})})};JP.displayName=gp;var Lae="MenuAnchor",O5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=v1(n);return u.jsx(A5,{...i,...r,ref:t})});O5.displayName=Lae;var I5="MenuPortal",[Nae,ZP]=Ol(I5,{forceMount:void 0}),eO=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:i}=e,s=Il(I5,t);return u.jsx(Nae,{scope:t,forceMount:n,children:u.jsx(xn,{present:n||s.open,children:u.jsx(f1,{asChild:!0,container:i,children:r})})})};eO.displayName=I5;var ai="MenuContent",[Pae,$5]=Ol(ai),tO=w.forwardRef((e,t)=>{const n=ZP(ai,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Il(ai,e.__scopeMenu),a=vp(ai,e.__scopeMenu);return u.jsx(xf.Provider,{scope:e.__scopeMenu,children:u.jsx(xn,{present:r||s.open,children:u.jsx(xf.Slot,{scope:e.__scopeMenu,children:a.modal?u.jsx(Oae,{...i,ref:t}):u.jsx(Iae,{...i,ref:t})})})})}),Oae=w.forwardRef((e,t)=>{const n=Il(ai,e.__scopeMenu),r=w.useRef(null),i=We(t,r);return w.useEffect(()=>{const s=r.current;if(s)return P5(s)},[]),u.jsx(B5,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Iae=w.forwardRef((e,t)=>{const n=Il(ai,e.__scopeMenu);return u.jsx(B5,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),B5=w.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:s,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEntryFocus:l,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:f,onDismiss:m,disableOutsideScroll:_,...v}=e,y=Il(ai,n),g=vp(ai,n),p=v1(n),x=QP(n),b=Mae(n),[S,C]=w.useState(null),E=w.useRef(null),k=We(t,E,y.onContentChange),T=w.useRef(0),R=w.useRef(""),M=w.useRef(0),D=w.useRef(null),N=w.useRef("right"),L=w.useRef(0),P=_?g1:w.Fragment,I=_?{as:ia,allowPinchZoom:!0}:void 0,z=A=>{var W,$;const j=R.current+A,F=b().filter(V=>!V.disabled),H=document.activeElement,B=(W=F.find(V=>V.ref.current===H))==null?void 0:W.textValue,G=F.map(V=>V.textValue),Z=Yae(G,j,B),X=($=F.find(V=>V.textValue===Z))==null?void 0:$.ref.current;(function V(U){R.current=U,window.clearTimeout(T.current),U!==""&&(T.current=window.setTimeout(()=>V(""),1e3))})(j),X&&setTimeout(()=>X.focus())};w.useEffect(()=>()=>window.clearTimeout(T.current),[]),x5();const O=w.useCallback(A=>{var F,H;return N.current===((F=D.current)==null?void 0:F.side)&&Qae(A,(H=D.current)==null?void 0:H.area)},[]);return u.jsx(Pae,{scope:n,searchRef:R,onItemEnter:w.useCallback(A=>{O(A)&&A.preventDefault()},[O]),onItemLeave:w.useCallback(A=>{var j;O(A)||((j=E.current)==null||j.focus(),C(null))},[O]),onTriggerLeave:w.useCallback(A=>{O(A)&&A.preventDefault()},[O]),pointerGraceTimerRef:M,onPointerGraceIntentChange:w.useCallback(A=>{D.current=A},[]),children:u.jsx(P,{...I,children:u.jsx(l1,{asChild:!0,trapped:i,onMountAutoFocus:fe(s,A=>{var j;A.preventDefault(),(j=E.current)==null||j.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:u.jsx(Zu,{asChild:!0,disableOutsidePointerEvents:o,onEscapeKeyDown:c,onPointerDownOutside:h,onFocusOutside:d,onInteractOutside:f,onDismiss:m,children:u.jsx(L5,{asChild:!0,...x,dir:g.dir,orientation:"vertical",loop:r,currentTabStopId:S,onCurrentTabStopIdChange:C,onEntryFocus:fe(l,A=>{g.isUsingKeyboardRef.current||A.preventDefault()}),preventScrollOnEntryFocus:!0,children:u.jsx(j5,{role:"menu","aria-orientation":"vertical","data-state":vO(y.open),"data-radix-menu-content":"",dir:g.dir,...p,...v,ref:k,style:{outline:"none",...v.style},onKeyDown:fe(v.onKeyDown,A=>{const F=A.target.closest("[data-radix-menu-content]")===A.currentTarget,H=A.ctrlKey||A.altKey||A.metaKey,B=A.key.length===1;F&&(A.key==="Tab"&&A.preventDefault(),!H&&B&&z(A.key));const G=E.current;if(A.target!==G||!Eae.includes(A.key))return;A.preventDefault();const X=b().filter(W=>!W.disabled).map(W=>W.ref.current);YP.includes(A.key)&&X.reverse(),Gae(X)}),onBlur:fe(e.onBlur,A=>{A.currentTarget.contains(A.target)||(window.clearTimeout(T.current),R.current="")}),onPointerMove:fe(e.onPointerMove,_f(A=>{const j=A.target,F=L.current!==A.clientX;if(A.currentTarget.contains(j)&&F){const H=A.clientX>L.current?"right":"left";N.current=H,L.current=A.clientX}}))})})})})})})});tO.displayName=ai;var $ae="MenuGroup",F5=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ee.div,{role:"group",...r,ref:t})});F5.displayName=$ae;var Bae="MenuLabel",nO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ee.div,{...r,ref:t})});nO.displayName=Bae;var Av="MenuItem",DR="menu.itemSelect",y1=w.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...i}=e,s=w.useRef(null),a=vp(Av,e.__scopeMenu),o=$5(Av,e.__scopeMenu),l=We(t,s),c=w.useRef(!1),h=()=>{const d=s.current;if(!n&&d){const f=new CustomEvent(DR,{bubbles:!0,cancelable:!0});d.addEventListener(DR,m=>r==null?void 0:r(m),{once:!0}),lv(d,f),f.defaultPrevented?c.current=!1:a.onClose()}};return u.jsx(rO,{...i,ref:l,disabled:n,onClick:fe(e.onClick,h),onPointerDown:d=>{var f;(f=e.onPointerDown)==null||f.call(e,d),c.current=!0},onPointerUp:fe(e.onPointerUp,d=>{var f;c.current||(f=d.currentTarget)==null||f.click()}),onKeyDown:fe(e.onKeyDown,d=>{const f=o.searchRef.current!=="";n||f&&d.key===" "||Kw.includes(d.key)&&(d.currentTarget.click(),d.preventDefault())})})});y1.displayName=Av;var rO=w.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:i,...s}=e,a=$5(Av,n),o=QP(n),l=w.useRef(null),c=We(t,l),[h,d]=w.useState(!1),[f,m]=w.useState("");return w.useEffect(()=>{const _=l.current;_&&m((_.textContent??"").trim())},[s.children]),u.jsx(xf.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:u.jsx(N5,{asChild:!0,...o,focusable:!r,children:u.jsx(Ee.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...s,ref:c,onPointerMove:fe(e.onPointerMove,_f(_=>{r?a.onItemLeave(_):(a.onItemEnter(_),_.defaultPrevented||_.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:fe(e.onPointerLeave,_f(_=>a.onItemLeave(_))),onFocus:fe(e.onFocus,()=>d(!0)),onBlur:fe(e.onBlur,()=>d(!1))})})})}),Fae="MenuCheckboxItem",iO=w.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...i}=e;return u.jsx(cO,{scope:e.__scopeMenu,checked:n,children:u.jsx(y1,{role:"menuitemcheckbox","aria-checked":jv(n)?"mixed":n,...i,ref:t,"data-state":H5(n),onSelect:fe(i.onSelect,()=>r==null?void 0:r(jv(n)?!0:!n),{checkForDefaultPrevented:!1})})})});iO.displayName=Fae;var sO="MenuRadioGroup",[zae,Hae]=Ol(sO,{value:void 0,onValueChange:()=>{}}),oO=w.forwardRef((e,t)=>{const{value:n,onValueChange:r,...i}=e,s=jt(r);return u.jsx(zae,{scope:e.__scopeMenu,value:n,onValueChange:s,children:u.jsx(F5,{...i,ref:t})})});oO.displayName=sO;var aO="MenuRadioItem",lO=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=Hae(aO,e.__scopeMenu),s=n===i.value;return u.jsx(cO,{scope:e.__scopeMenu,checked:s,children:u.jsx(y1,{role:"menuitemradio","aria-checked":s,...r,ref:t,"data-state":H5(s),onSelect:fe(r.onSelect,()=>{var a;return(a=i.onValueChange)==null?void 0:a.call(i,n)},{checkForDefaultPrevented:!1})})})});lO.displayName=aO;var z5="MenuItemIndicator",[cO,Wae]=Ol(z5,{checked:!1}),uO=w.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...i}=e,s=Wae(z5,n);return u.jsx(xn,{present:r||jv(s.checked)||s.checked===!0,children:u.jsx(Ee.span,{...i,ref:t,"data-state":H5(s.checked)})})});uO.displayName=z5;var Uae="MenuSeparator",dO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return u.jsx(Ee.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});dO.displayName=Uae;var Vae="MenuArrow",hO=w.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,i=v1(n);return u.jsx(D5,{...i,...r,ref:t})});hO.displayName=Vae;var qae="MenuSub",[Y9e,fO]=Ol(qae),mh="MenuSubTrigger",pO=w.forwardRef((e,t)=>{const n=Il(mh,e.__scopeMenu),r=vp(mh,e.__scopeMenu),i=fO(mh,e.__scopeMenu),s=$5(mh,e.__scopeMenu),a=w.useRef(null),{pointerGraceTimerRef:o,onPointerGraceIntentChange:l}=s,c={__scopeMenu:e.__scopeMenu},h=w.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return w.useEffect(()=>h,[h]),w.useEffect(()=>{const d=o.current;return()=>{window.clearTimeout(d),l(null)}},[o,l]),u.jsx(O5,{asChild:!0,...c,children:u.jsx(rO,{id:i.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":i.contentId,"data-state":vO(n.open),...e,ref:op(t,i.onTriggerChange),onClick:d=>{var f;(f=e.onClick)==null||f.call(e,d),!(e.disabled||d.defaultPrevented)&&(d.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:fe(e.onPointerMove,_f(d=>{s.onItemEnter(d),!d.defaultPrevented&&!e.disabled&&!n.open&&!a.current&&(s.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),h()},100))})),onPointerLeave:fe(e.onPointerLeave,_f(d=>{var m,_;h();const f=(m=n.content)==null?void 0:m.getBoundingClientRect();if(f){const v=(_=n.content)==null?void 0:_.dataset.side,y=v==="right",g=y?-5:5,p=f[y?"left":"right"],x=f[y?"right":"left"];s.onPointerGraceIntentChange({area:[{x:d.clientX+g,y:d.clientY},{x:p,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:p,y:f.bottom}],side:v}),window.clearTimeout(o.current),o.current=window.setTimeout(()=>s.onPointerGraceIntentChange(null),300)}else{if(s.onTriggerLeave(d),d.defaultPrevented)return;s.onPointerGraceIntentChange(null)}})),onKeyDown:fe(e.onKeyDown,d=>{var m;const f=s.searchRef.current!=="";e.disabled||f&&d.key===" "||Tae[r.dir].includes(d.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),d.preventDefault())})})})});pO.displayName=mh;var mO="MenuSubContent",gO=w.forwardRef((e,t)=>{const n=ZP(ai,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,s=Il(ai,e.__scopeMenu),a=vp(ai,e.__scopeMenu),o=fO(mO,e.__scopeMenu),l=w.useRef(null),c=We(t,l);return u.jsx(xf.Provider,{scope:e.__scopeMenu,children:u.jsx(xn,{present:r||s.open,children:u.jsx(xf.Slot,{scope:e.__scopeMenu,children:u.jsx(B5,{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:h=>{var d;a.isUsingKeyboardRef.current&&((d=l.current)==null||d.focus()),h.preventDefault()},onCloseAutoFocus:h=>h.preventDefault(),onFocusOutside:fe(e.onFocusOutside,h=>{h.target!==o.trigger&&s.onOpenChange(!1)}),onEscapeKeyDown:fe(e.onEscapeKeyDown,h=>{a.onClose(),h.preventDefault()}),onKeyDown:fe(e.onKeyDown,h=>{var m;const d=h.currentTarget.contains(h.target),f=Rae[a.dir].includes(h.key);d&&f&&(s.onOpenChange(!1),(m=o.trigger)==null||m.focus(),h.preventDefault())})})})})})});gO.displayName=mO;function vO(e){return e?"open":"closed"}function jv(e){return e==="indeterminate"}function H5(e){return jv(e)?"indeterminate":e?"checked":"unchecked"}function Gae(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Kae(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function Yae(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=Kae(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 Xae(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;sr!=h>r&&n<(c-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function Qae(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return Xae(n,t)}function _f(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Jae=JP,Zae=O5,ele=eO,tle=tO,nle=F5,rle=nO,ile=y1,sle=iO,ole=oO,ale=lO,lle=uO,cle=dO,ule=hO,dle=pO,hle=gO,W5="DropdownMenu",[fle,X9e]=Un(W5,[XP]),pr=XP(),[ple,yO]=fle(W5),xO=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:s,onOpenChange:a,modal:o=!0}=e,l=pr(t),c=w.useRef(null),[h=!1,d]=fi({prop:i,defaultProp:s,onChange:a});return u.jsx(ple,{scope:t,triggerId:zr(),triggerRef:c,contentId:zr(),open:h,onOpenChange:d,onOpenToggle:w.useCallback(()=>d(f=>!f),[d]),modal:o,children:u.jsx(Jae,{...l,open:h,onOpenChange:d,dir:r,modal:o,children:n})})};xO.displayName=W5;var _O="DropdownMenuTrigger",bO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,s=yO(_O,n),a=pr(n);return u.jsx(Zae,{asChild:!0,...a,children:u.jsx(Ee.button,{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:op(t,s.triggerRef),onPointerDown:fe(e.onPointerDown,o=>{!r&&o.button===0&&o.ctrlKey===!1&&(s.onOpenToggle(),s.open||o.preventDefault())}),onKeyDown:fe(e.onKeyDown,o=>{r||(["Enter"," "].includes(o.key)&&s.onOpenToggle(),o.key==="ArrowDown"&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(o.key)&&o.preventDefault())})})})});bO.displayName=_O;var mle="DropdownMenuPortal",wO=e=>{const{__scopeDropdownMenu:t,...n}=e,r=pr(t);return u.jsx(ele,{...r,...n})};wO.displayName=mle;var SO="DropdownMenuContent",CO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=yO(SO,n),s=pr(n),a=w.useRef(!1);return u.jsx(tle,{id:i.contentId,"aria-labelledby":i.triggerId,...s,...r,ref:t,onCloseAutoFocus:fe(e.onCloseAutoFocus,o=>{var l;a.current||(l=i.triggerRef.current)==null||l.focus(),a.current=!1,o.preventDefault()}),onInteractOutside:fe(e.onInteractOutside,o=>{const l=o.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0,h=l.button===2||c;(!i.modal||h)&&(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)"}})});CO.displayName=SO;var gle="DropdownMenuGroup",vle=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(nle,{...i,...r,ref:t})});vle.displayName=gle;var yle="DropdownMenuLabel",kO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(rle,{...i,...r,ref:t})});kO.displayName=yle;var xle="DropdownMenuItem",EO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(ile,{...i,...r,ref:t})});EO.displayName=xle;var _le="DropdownMenuCheckboxItem",TO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(sle,{...i,...r,ref:t})});TO.displayName=_le;var ble="DropdownMenuRadioGroup",RO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(ole,{...i,...r,ref:t})});RO.displayName=ble;var wle="DropdownMenuRadioItem",MO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(ale,{...i,...r,ref:t})});MO.displayName=wle;var Sle="DropdownMenuItemIndicator",AO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(lle,{...i,...r,ref:t})});AO.displayName=Sle;var Cle="DropdownMenuSeparator",jO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(cle,{...i,...r,ref:t})});jO.displayName=Cle;var kle="DropdownMenuArrow",Ele=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(ule,{...i,...r,ref:t})});Ele.displayName=kle;var Tle="DropdownMenuSubTrigger",DO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(dle,{...i,...r,ref:t})});DO.displayName=Tle;var Rle="DropdownMenuSubContent",LO=w.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,i=pr(n);return u.jsx(hle,{...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)"}})});LO.displayName=Rle;var Mle=xO,Ale=bO,jle=wO,NO=CO,PO=kO,OO=EO,IO=TO,Dle=RO,$O=MO,BO=AO,FO=jO,zO=DO,HO=LO;const Hc=Mle,Wc=Ale,WO=Dle,Lle=w.forwardRef(({className:e,inset:t,children:n,...r},i)=>u.jsxs(zO,{ref:i,className:J("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...r,children:[n,u.jsx(xL,{className:"ml-auto"})]}));Lle.displayName=zO.displayName;const Nle=w.forwardRef(({className:e,...t},n)=>u.jsx(HO,{ref:n,className:J("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}));Nle.displayName=HO.displayName;const tl=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(jle,{children:u.jsx(NO,{ref:r,sideOffset:t,className:J("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})}));tl.displayName=NO.displayName;const ss=w.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(OO,{ref:r,className:J("relative flex cursor-default select-none items-center gap-2 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 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",t&&"pl-8",e),...n}));ss.displayName=OO.displayName;const Yw=w.forwardRef(({className:e,children:t,checked:n,...r},i)=>u.jsxs(IO,{ref:i,className:J("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(BO,{children:u.jsx(LC,{className:"h-4 w-4"})})}),t]}));Yw.displayName=IO.displayName;const U5=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs($O,{ref:r,className:J("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(BO,{children:u.jsx(bL,{className:"h-2 w-2 fill-current"})})}),t]}));U5.displayName=$O.displayName;const Dv=w.forwardRef(({className:e,inset:t,...n},r)=>u.jsx(PO,{ref:r,className:J("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));Dv.displayName=PO.displayName;const Fa=w.forwardRef(({className:e,...t},n)=>u.jsx(FO,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Fa.displayName=FO.displayName;const bf=[{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."}],UO=[{label:"Is Admin",value:"isAdmin"},{label:"Is Online",value:"isOnline"},{label:"Has Whitelisted ID",value:"isWhitelisted"},{label:"Has Profile Notes",value:"hasNote"}],Am=Jn(1250,e=>{e()},{noLeading:!0});function Ple({doSearch:e,initialState:t}){const n=w.useRef(null),[r,i]=w.useState(!1),[s,a]=w.useState(!1),[o,l]=w.useState(t.search.type),[c,h]=w.useState(t.filters),[d,f]=w.useState(!!t.search.value),[m,_]=w.useState(t.rememberSearchType),v=()=>{if(!n.current)return;const S=n.current.value.trim();e({value:S,type:o},c,m)};w.useEffect(()=>{v()},[o,c]);const y=S=>{S.key==="Enter"?(Am.cancel({upcomingOnly:!0}),v()):S.key==="Escape"?(n.current.value="",Am(v),f(!1)):(Am(v),f(!0))},g=()=>{n.current.value="",Am.cancel({upcomingOnly:!0}),v(),f(!1)},p=(S,C)=>{h(C?E=>[...E,S]:E=>E.filter(k=>k!==S))};Pi("keydown",S=>{var C;S.code==="KeyF"&&(S.ctrlKey||S.metaKey)&&((C=n.current)==null||C.focus(),S.preventDefault())});const x=bf.find(S=>S.value===o);if(!x)throw new Error(`Invalid search type: ${o}`);const b=c.length?`${c.length} Filter${c.length>1?"s":""}`:"No filters";return u.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[u.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[u.jsxs("div",{className:"relative min-w-44 grow",children:[u.jsx(wt,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:n,placeholder:x.placeholder,defaultValue:t.search.value,onKeyDown:y}),d?u.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:g,children:u.jsx(Ar,{})}):u.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:u.jsx(Ye,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),u.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[u.jsxs(Hc,{children:[u.jsx(Wc,{asChild:!0,children:u.jsxs(De,{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 ",x.label,u.jsx(sw,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(tl,{className:"w-48",children:[u.jsx(Dv,{children:"Search Type"}),u.jsx(Fa,{}),u.jsx(WO,{value:o,onValueChange:l,children:bf.map(S=>u.jsx(U5,{value:S.value,className:"cursor-pointer",children:S.label},S.value))}),u.jsx(Fa,{}),u.jsx(Yw,{checked:m,className:"cursor-pointer",onCheckedChange:_,children:"Remember Option"})]})]}),u.jsxs(Hc,{children:[u.jsx(Wc,{asChild:!0,children:u.jsxs(De,{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:[b,u.jsx(sw,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(tl,{className:"w-44",children:[u.jsx(Dv,{children:"Search Filters"}),u.jsx(Fa,{}),UO.map(S=>u.jsx(Yw,{checked:c.includes(S.value),className:"cursor-pointer",onCheckedChange:C=>{p(S.value,C)},children:S.label},S.value)),u.jsx(Fa,{}),u.jsxs(ss,{className:"cursor-pointer",onClick:()=>h([]),children:[u.jsx(GX,{className:"mr-2 h-4 w-4"}),"Clear Filters"]})]})]}),u.jsx("div",{className:"flex justify-end flex-grow",children:u.jsxs(Hc,{children:[u.jsx(Wc,{asChild:!0,children:u.jsxs(De,{variant:"outline",className:"grow md:grow-0",children:["More",u.jsx(Dl,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(tl,{children:[u.jsx(ss,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(fs,{href:"/ban-identifiers",className:"cursor-pointer",children:[u.jsx(dl,{className:"inline mr-1 h-4"}),"Ban Identifiers"]})}),u.jsx(ss,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(fs,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[u.jsx(dl,{className:"inline mr-1 h-4"}),"Prune Players/HWIDs"]})})]})]})})]})]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:x.description})]})}function ac(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 h=e();if(!(h.length!==r.length||h.some((m,_)=>r[_]!==m)))return i;r=h;let f;if(n.key&&((a=n.debug)!=null&&a.call(n))&&(f=Date.now()),i=t(...h),n.key&&((o=n.debug)!=null&&o.call(n))){const m=Math.round((Date.now()-c)*100)/100,_=Math.round((Date.now()-f)*100)/100,v=_/16,y=(g,p)=>{for(g=String(g);g.lengthMath.abs(e-t)<1,Ile=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}},$le=e=>e,Ble=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},Fle=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:o,height:l}=a;t({width:Math.round(o),height:Math.round(l)})};if(i(n.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const s=new r.ResizeObserver(a=>{const o=a[0];if(o!=null&&o.borderBoxSize){const l=o.borderBoxSize[0];if(l){i({width:l.inlineSize,height:l.blockSize});return}}i(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},LR={passive:!0},zle=typeof window>"u"?!0:"onscrollend"in window,Hle=(e,t)=>{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;let i=0;const s=e.options.useScrollendEvent&&zle?()=>{}:Ile(r,()=>{t(i,!1)},e.options.isScrollingResetDelay),a=c=>()=>{const{horizontal:h,isRtl:d}=e.options;i=h?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),t(i,c)},o=a(!0),l=a(!1);return l(),n.addEventListener("scroll",o,LR),n.addEventListener("scrollend",l,LR),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",l)}},Wle=(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"])},Ule=(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 Vle{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},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:$le,rangeExtractor:Ble,onChange:()=>{},measureElement:Wle,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=ac(()=>(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.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),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.enda.end===o.end?a.index-o.index:a.end-o.end)[0]:void 0},this.getMeasurementOptions=ac(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,r,i,s,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a}),{key:!1}),this.getMeasurements=ac(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:r,scrollMargin:i,getItemKey:s,enabled:a},o)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const c=this.measurementsCache.slice(0,l);for(let h=l;hthis.options.debug}),this.calculateRange=ac(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,r,i)=>this.range=n.length>0&&r>0?qle({measurements:n,outerSize:r,scrollOffset:i}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=ac(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(n,r,i,s)=>r===null?[]:n({startIndex:r.startIndex,endIndex:r.endIndex,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.indexFromElement(n),s=this.measurementsCache[i];if(!s)return;const a=s.key,o=this.elementsCache.get(a);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(i,this.options.measureElement(n,r,this))},this.resizeItem=(n,r)=>{const i=this.measurementsCache[n];if(!i)return;const s=this.itemSizeCache.get(i.key)??i.size,a=r-s;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(i,a,this):i.start{if(!n){this.elementsCache.forEach((r,i)=>{r.isConnected||(this.observer.unobserve(r),this.elementsCache.delete(i))});return}this._measureElement(n,void 0)},this.getVirtualItems=ac(()=>[this.getIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let s=0,a=n.length;sthis.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length!==0)return v_(r[VO(0,r.length-1,i=>v_(r[i]).start,n)])},this.getOffsetForAlignment=(n,r)=>{const i=this.getSize(),s=this.getScrollOffset();r==="auto"&&n>=s+i&&(r="end"),r==="end"&&(n-=i);const a=this.options.horizontal?"scrollWidth":"scrollHeight",l=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-i;return Math.max(Math.min(l,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.measurementsCache[n];if(!i)return;const s=this.getSize(),a=this.getScrollOffset();if(r==="auto")if(i.end>=a+s-this.options.scrollPaddingEnd)r="end";else if(i.start<=a+this.options.scrollPaddingStart)r="start";else return[a,r];const o=i.start-this.options.scrollPaddingStart+(i.size-s)/2;switch(r){case"center":return[this.getOffsetForAlignment(o,r),r];case"end":return[this.getOffsetForAlignment(i.end+this.options.scrollPaddingEnd,r),r];default:return[this.getOffsetForAlignment(i.start-this.options.scrollPaddingStart,r),r]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.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=this.getOffsetForIndex(n,r);if(!s)return;const[a,o]=s;this._scrollToOffset(a,{adjustments:void 0,behavior:i}),i!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[c]=v_(this.getOffsetForIndex(n,o));Ole(c,this.getScrollOffset())||this.scrollToIndex(n,{align:o,behavior:i})}else this.scrollToIndex(n,{align:o,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.getScrollOffset()+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)),Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},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)}}const VO=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,s=n(i);if(sr)t=i-1;else return i}return e>0?e-1:0};function qle({measurements:e,outerSize:t,scrollOffset:n}){const r=e.length-1,s=VO(0,r,o=>e[o].start,n);let a=s;for(;a({}),{})[1],n={...e,onChange:(i,s)=>{var a;s?$r.flushSync(t):t(),(a=e.onChange)==null||a.call(e,i,s)}},[r]=w.useState(()=>new Vle(n));return r.setOptions(n),NR(()=>r._didMount(),[]),NR(()=>r._willUpdate()),r}function V5(e){return Gle({observeElementRect:Fle,observeElementOffset:Hle,scrollToFn:Ule,...e})}var Lv={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 qO(e){var t=function(r,i){var s=OR({},t,i||{});return Yle(r,s)};return OR(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 x1=qO({});function Kle(e){var t=[e.language];if(ds(e,"fallbacks"))if(Xle(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=0&&(i=a[n],i.unitCount=Math.round(i.unitCount),n!==0);n--)_=a[n-1],m=t.unitMeasures[_.unitName]/t.unitMeasures[i.unitName],(i.unitCount%m===0||t.largest&&t.largest-12)return v.slice(0,-1).join(y)+(t.serialComma?",":"")+t.conjunction+v.slice(-1)}else return PR(0,t.units[t.units.length-1],s,t)}function PR(e,t,n,r){var i;ds(r,"decimal")?i=r.decimal:ds(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 OR(e){for(var t,n=1;nnew Date(e<1e10?e*1e3:e),bu=(e,t="2-digit",n="2-digit",r,i)=>e.toLocaleTimeString(window.txBrowserLocale,{hour:t,minute:n,second:r,hour12:i}),Jle=(e,t="2-digit",n="2-digit",r,i)=>bu(_1(e),t,n,r,i),wu=(e,t="long")=>e.toLocaleDateString(window.txBrowserLocale,{dateStyle:t}),GO=(e,t="long")=>wu(_1(e),t),Zle=(e,t="long",n="medium")=>e.toLocaleString(window.txBrowserLocale,{dateStyle:t,timeStyle:n}),zs=(e,t="long",n="medium")=>Zle(_1(e),t,n),wf=e=>{const t=new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()},Xw=e=>{const t=_1(e),n=t.getFullYear()!==Qle;return t.toLocaleString(window.txBrowserLocale,{year:n?"numeric":void 0,month:n?"numeric":"short",day:"2-digit",hour:"2-digit",minute:"2-digit"})},ece=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{className:"relative w-full overflow-auto",children:u.jsx("table",{ref:n,className:J("w-full caption-bottom text-sm",e),...t})}));ece.displayName="Table";const G5=w.forwardRef(({className:e,...t},n)=>u.jsx("thead",{ref:n,className:J("[&_tr]:border-b",e),...t}));G5.displayName="TableHeader";const K5=w.forwardRef(({className:e,...t},n)=>u.jsx("tbody",{ref:n,className:J("[&_tr:last-child]:border-0",e),...t}));K5.displayName="TableBody";const tce=w.forwardRef(({className:e,...t},n)=>u.jsx("tfoot",{ref:n,className:J("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));tce.displayName="TableFooter";const yp=w.forwardRef(({className:e,...t},n)=>u.jsx("tr",{ref:n,className:J("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));yp.displayName="TableRow";const nce=w.forwardRef(({className:e,...t},n)=>u.jsx("th",{ref:n,className:J("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));nce.displayName="TableHead";const ni=w.forwardRef(({className:e,...t},n)=>u.jsx("td",{ref:n,className:J("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));ni.displayName="TableCell";const rce=w.forwardRef(({className:e,...t},n)=>u.jsx("caption",{ref:n,className:J("mt-4 text-sm text-muted-foreground",e),...t}));rce.displayName="TableCaption";const ice="https://monitor/WebPipe",sce=`txAdminPanel/v${window.txConsts.txaVersion} (atop FXServer/b${window.txConsts.fxsVersion})`,KO={"Content-Type":"application/json; charset=UTF-8",Accept:"application/json"};var Pv=(e=>(e[e.DEFAULT=7500]="DEFAULT",e[e.LONG=15e3]="LONG",e[e.REALLY_LONG=3e4]="REALLY_LONG",e[e.REALLY_REALLY_LONG=45e3]="REALLY_REALLY_LONG",e))(Pv||{});class Qw extends Error{constructor(n,r){super();ec(this,"title");ec(this,"message");this.title=n,this.message=r}}const YO=()=>{const e=xie(),t=f5();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=ice+n),r.method??(r.method="GET");const a=await(await fetch(n,{method:r.method,headers:{...KO,"User-Agent":sce,"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("useAuthedFetcher",(a==null?void 0:a.reason)??"unknown"),new Error("Session expired");return a}},oce=async(e,t={})=>{const n=new AbortController,r=setTimeout(()=>{n.abort("timeout")},t.timeout??7500);try{const i=await fetch(e,{headers:KO,method:"GET",signal:n.signal,...t});return clearTimeout(r),await i.json()}catch(i){throw clearTimeout(r),i}},Tt=e=>{const t=w.useRef(void 0),n=w.useRef(void 0),r=YO();return e.abortOnUnmount??(e.abortOnUnmount=!1),w.useEffect(()=>()=>{var i;e.abortOnUnmount&&((i=t.current)==null||i.abort("unmount"),n.current&&qe.dismiss(n.current))},[]),async i=>{var c,h;t.current=new AbortController;let s=e.path;if(i.pathParams)for(const[d,f]of Object.entries(i.pathParams)){const m=new RegExp(`/:${d}(/|$)`),_=s.replace(m,`/${f}$1`);if(_===s)throw new Error(`[useBackendApi] pathParam '${d}' not found in path '${e.path}'`);s=_}if(i.queryParams){const d=new URLSearchParams;for(const[f,m]of Object.entries(i.queryParams))(typeof m=="string"||typeof m=="number"||typeof m=="boolean")&&d.append(f,m.toString());s+=`?${d.toString()}`}const a=`${e.method} ${e.path}`,o=(d,f)=>{if(n.current&&qe.error({title:d,msg:f},{id:n.current}),i.error)try{i.error(f,n.current)}catch(m){console.log("[ERROR CB ERROR]",a,m)}else throw new Qw(d,f)};if(i.toastId&&i.toastLoadingMessage)throw new Error("[useBackendApi] toastId and toastLoadingMessage are mutually exclusive.");i.toastLoadingMessage?n.current=qe.loading(i.toastLoadingMessage):i.toastId?n.current=i.toastId:n.current&&(qe.dismiss(n.current),n.current=void 0);const l=setTimeout(()=>{var d,f;(d=t.current)!=null&&d.signal.aborted||(console.log("[TIMEOUT]",a),(f=t.current)==null||f.abort("timeout"),o("Request Timeout","If you closed txAdmin, please restart it and try again."))},i.timeout??7500);try{console.log("[>>]",a);const d=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 d)throw new Qw("API Error",d.error);if(i.genericHandler&&n.current&&("error"in d?qe.error({title:i.genericHandler.errorTitle,msg:d.error},{id:n.current}):qe.success(i.genericHandler.successMsg,{id:n.current})),n.current&&typeof(d==null?void 0:d.type)=="string"&&typeof(d==null?void 0:d.msg)=="string"&&Ore.includes(d==null?void 0:d.type)&&typeof qe[d.type]=="function"&&qe[d.type](d,{id:n.current}),i.success)try{i.success(d,n.current)}catch(f){console.log("[SUCCESS CB ERROR]",a,f)}return d}catch(d){if((h=t.current)!=null&&h.signal.aborted)return;clearTimeout(l);let f="unknown error";const m=d;typeof m.message!="string"?f=JSON.stringify(m):m.message.startsWith("NetworkError")?f=`Network error. If you closed txAdmin, please restart it and try again.`:m.message.startsWith("JSON.parse:")?f="Invalid JSON response from server.":f=m.message,f.includes("unmount")?console.warn("[UNMOUNTED]",a):(console.error("[ERROR]",a,f),o("Request Error",f))}finally{if(i.finally)try{i.finally()}catch(d){console.log("[FINALLY CB ERROR]",a,d)}}}};function ace({rowData:e,modalOpener:t}){const n=()=>{t({license:e.license})};return u.jsxs(yp,{onClick:n,className:"cursor-pointer",children:[u.jsxs(ni,{className:"px-4 py-2 flex justify-between border-r",children:[u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.displayName}),u.jsxs("div",{className:"hidden md:inline-flex items-center gap-1",children:[u.jsx(gQ,{className:J("h-5",e.isOnline?"text-success-inline animate-pulse":"text-muted")}),u.jsx(TL,{className:J("h-5",e.isAdmin?"text-warning-inline":"text-muted")}),u.jsx(qX,{className:J("h-5",e.notes?"text-secondary-foreground":"text-muted")})]})]}),u.jsx(ni,{className:"min-w-[8rem] px-4 py-2 border-r",children:q5(e.playTime*6e4)}),u.jsx(ni,{className:"min-w-[10rem] px-4 py-2 border-r",children:Xw(e.tsJoined)}),u.jsx(ni,{className:"min-w-[10rem] px-4 py-2",children:Xw(e.tsLastConnection)})]})}function lce({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=u.jsx(sn,{className:"mx-auto animate-spin"}):r?s=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),u.jsx("br",{}),u.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=u.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No players found."}):s=u.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",u.jsx("br",{}),u.jsxs("i",{children:["(this is a bug, please report it in ",u.jsx(kn,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),u.jsx(yp,{children:u.jsx(ni,{colSpan:4,className:"px-4 py-2 text-center",children:s})})}function y_({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":u.jsx(u.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return u.jsxs("th",{onClick:l,className:J("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,u.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function cce({search:e,filters:t}){const n=w.useRef(null),[r,i]=w.useState([]),[s,a]=w.useState(!1),[o,l]=w.useState(!0),[c,h]=w.useState(null),[d,f]=w.useState({key:"tsJoined",desc:!0}),[m,_]=w.useState(!1),v=n1(),y=Tt({method:"GET",path:"/player/search",abortOnUnmount:!0}),g=async E=>{l(!0),h(null),E&&_(!0);const k=T=>{h(T),E&&i([])};try{const T={sortingKey:d.key,sortingDesc:d.desc};e.value&&(T.searchValue=e.value,T.searchType=e.type),t.length&&(T.filters=t.join(",")),!E&&r.length&&(T.offsetParam=r[r.length-1][d.key],T.offsetLicense=r[r.length-1].license);const R=await y({queryParams:T});if(R===void 0)return k("Request failed.");if("error"in R)return k(`Request failed: ${R.error}`);h(null),a(R.hasReachedEnd),_(!1),R.players.length?i(M=>E?R.players:[...M,...R.players]):i([])}catch(T){k(`Failed to fetch more data: ${T.message}`)}finally{l(!1),_(!1)}},p=V5({isScrollingResetDelay:0,count:r.length+1,getScrollElement:()=>{var E;return(E=n.current)==null?void 0:E.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),x=p.getVirtualItems(),b=p.getTotalSize();let S=null,C=null;if(x.length>0){const E=x[0].start-p.options.scrollMargin;E>0&&(S=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:E}})}));const k=b-x[x.length-1].end;k>0&&(C=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:k}})}))}return w.useEffect(()=>{if(!r.length||!x.length)return;const E=x[x.length-1].index;r.length<=E&&!s&&!o&&g()},[r,x,s,o]),w.useEffect(()=>{p.scrollToIndex(0),g(!0)},[e,t,d]),u.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:u.jsx(hi,{className:"h-full",ref:n,children:u.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[u.jsx(G5,{children:u.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[u.jsx("th",{className:"py-2 px-4 font-light tracking-wider text-left text-muted-foreground",children:"Display Name"}),u.jsx(y_,{label:"Play Time",sortKey:"playTime",sortingState:d,setSorting:f}),u.jsx(y_,{label:"First Joined",sortKey:"tsJoined",sortingState:d,setSorting:f}),u.jsx(y_,{label:"Last Connection",sortKey:"tsLastConnection",sortingState:d,setSorting:f})]})}),u.jsxs(K5,{className:J(m&&"opacity-25"),children:[S,x.map(E=>E.index>r.length-1?u.jsx(lce,{playersCount:r.length,hasReachedEnd:s,loadError:c,isFetching:o,retryFetch:g},E.key):u.jsx(ace,{rowData:r[E.index],modalOpener:v},E.key)),C]})]})})})}const uce=w.memo(Ple),dce=w.memo(cce),hce=w.memo(dP),Jw="playerSearchRememberType",fce=()=>{const e=localStorage.getItem(Jw);return!e||!bf.some(t=>t.value===e)?!1:e},pce=e=>{e?localStorage.setItem(Jw,e):localStorage.removeItem(Jw)},mce=(e,t)=>{const n=new URL(window.location.toString());e&&e.value&&e.type?(n.searchParams.set("searchType",e.type),n.searchParams.set("searchQuery",e.value)):(n.searchParams.delete("searchType"),n.searchParams.delete("searchQuery")),t.length?n.searchParams.set("filters",t.join(",")):n.searchParams.delete("filters"),window.history.replaceState({},"",n)},gce=()=>{var l;const e=new URLSearchParams(window.location.search),t=bf.map(c=>c.value),n=e.get("searchType"),r=e.get("searchQuery"),i=UO.map(c=>c.value),s=(l=e.get("filters"))==null?void 0:l.split(",").filter(c=>i.includes(c));let a=bf[0].value,o=!1;try{const c=fce();c&&(a=c,o=!0)}catch(c){console.error("Failed to get stored search type:",c)}return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:a,value:""},filters:s??[],rememberSearchType:o}};function vce(){const[e,t]=w.useState(void 0),[n,r]=w.useState(void 0),i=Tt({method:"GET",path:"/player/stats",abortOnUnmount:!0});w.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=w.useCallback((l,c,h)=>{r({search:l,filters:c}),mce(l,c);try{pce(h?l.type:!1)}catch(d){console.error("Failed to set stored search type:",d)}},[]),a=w.useMemo(gce,[]),o=w.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Players",value:l?e.total:!1,icon:u.jsx(BC,{})},{label:"Players Last 24h",value:l?e.playedLast24h:!1,icon:u.jsx(EX,{})},{label:"New Players Last 24h",value:l?e.joinedLast24h:!1,icon:u.jsx(rT,{}),prefix:"+"},{label:"New Players Last 7d",value:l?e.joinedLast7d:!1,icon:u.jsx(rT,{}),prefix:"+"}]},[e]);return u.jsxs("div",{className:"flex flex-col min-w-96 w-full h-contentvh",children:[u.jsx(hce,{callouts:o}),u.jsx(uce,{doSearch:s,initialState:a}),n?u.jsx(dce,{search:n.search,filters:n.filters}):null]})}function xp(e){const t=w.useRef({value:e,previous:e});return w.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var yce="VisuallyHidden",Y5=w.forwardRef((e,t)=>u.jsx(Ee.span,{...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}}));Y5.displayName=yce;var XO=Y5,xce=[" ","Enter","ArrowUp","ArrowDown"],_ce=[" ","Enter"],_p="Select",[b1,w1,bce]=pp(_p),[id,Q9e]=Un(_p,[bce,nd]),S1=nd(),[wce,_a]=id(_p),[Sce,Cce]=id(_p),QO=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:s,value:a,defaultValue:o,onValueChange:l,dir:c,name:h,autoComplete:d,disabled:f,required:m,form:_}=e,v=S1(t),[y,g]=w.useState(null),[p,x]=w.useState(null),[b,S]=w.useState(!1),C=Al(c),[E=!1,k]=fi({prop:r,defaultProp:i,onChange:s}),[T,R]=fi({prop:a,defaultProp:o,onChange:l}),M=w.useRef(null),D=y?_||!!y.closest("form"):!0,[N,L]=w.useState(new Set),P=Array.from(N).map(I=>I.props.value).join(";");return u.jsx(M5,{...v,children:u.jsxs(wce,{required:m,scope:t,trigger:y,onTriggerChange:g,valueNode:p,onValueNodeChange:x,valueNodeHasChildren:b,onValueNodeHasChildrenChange:S,contentId:zr(),value:T,onValueChange:R,open:E,onOpenChange:k,dir:C,triggerPointerDownPosRef:M,disabled:f,children:[u.jsx(b1.Provider,{scope:t,children:u.jsx(Sce,{scope:e.__scopeSelect,onNativeOptionAdd:w.useCallback(I=>{L(z=>new Set(z).add(I))},[]),onNativeOptionRemove:w.useCallback(I=>{L(z=>{const O=new Set(z);return O.delete(I),O})},[]),children:n})}),D?u.jsxs(wI,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:d,value:T,onChange:I=>R(I.target.value),disabled:f,form:_,children:[T===void 0?u.jsx("option",{value:""}):null,Array.from(N)]},P):null]})})};QO.displayName=_p;var JO="SelectTrigger",ZO=w.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...i}=e,s=S1(n),a=_a(JO,n),o=a.disabled||r,l=We(t,a.onTriggerChange),c=w1(n),h=w.useRef("touch"),[d,f,m]=SI(v=>{const y=c().filter(x=>!x.disabled),g=y.find(x=>x.value===a.value),p=CI(y,v,g);p!==void 0&&a.onValueChange(p.value)}),_=v=>{o||(a.onOpenChange(!0),m()),v&&(a.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return u.jsx(A5,{asChild:!0,...s,children:u.jsx(Ee.button,{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":bI(a.value)?"":void 0,...i,ref:l,onClick:fe(i.onClick,v=>{v.currentTarget.focus(),h.current!=="mouse"&&_(v)}),onPointerDown:fe(i.onPointerDown,v=>{h.current=v.pointerType;const y=v.target;y.hasPointerCapture(v.pointerId)&&y.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(_(v),v.preventDefault())}),onKeyDown:fe(i.onKeyDown,v=>{const y=d.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&f(v.key),!(y&&v.key===" ")&&xce.includes(v.key)&&(_(),v.preventDefault())})})})});ZO.displayName=JO;var eI="SelectValue",tI=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,children:s,placeholder:a="",...o}=e,l=_a(eI,n),{onValueNodeHasChildrenChange:c}=l,h=s!==void 0,d=We(t,l.onValueNodeChange);return pn(()=>{c(h)},[c,h]),u.jsx(Ee.span,{...o,ref:d,style:{pointerEvents:"none"},children:bI(l.value)?u.jsx(u.Fragment,{children:a}):s})});tI.displayName=eI;var kce="SelectIcon",nI=w.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...i}=e;return u.jsx(Ee.span,{"aria-hidden":!0,...i,ref:t,children:r||"▼"})});nI.displayName=kce;var Ece="SelectPortal",rI=e=>u.jsx(f1,{asChild:!0,...e});rI.displayName=Ece;var gl="SelectContent",iI=w.forwardRef((e,t)=>{const n=_a(gl,e.__scopeSelect),[r,i]=w.useState();if(pn(()=>{i(new DocumentFragment)},[]),!n.open){const s=r;return s?$r.createPortal(u.jsx(sI,{scope:e.__scopeSelect,children:u.jsx(b1.Slot,{scope:e.__scopeSelect,children:u.jsx("div",{children:e.children})})}),s):null}return u.jsx(oI,{...e,ref:t})});iI.displayName=gl;var yi=10,[sI,ba]=id(gl),Tce="SelectContentImpl",oI=w.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:s,onPointerDownOutside:a,side:o,sideOffset:l,align:c,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:m,sticky:_,hideWhenDetached:v,avoidCollisions:y,...g}=e,p=_a(gl,n),[x,b]=w.useState(null),[S,C]=w.useState(null),E=We(t,W=>b(W)),[k,T]=w.useState(null),[R,M]=w.useState(null),D=w1(n),[N,L]=w.useState(!1),P=w.useRef(!1);w.useEffect(()=>{if(x)return P5(x)},[x]),x5();const I=w.useCallback(W=>{const[$,...V]=D().map(q=>q.ref.current),[U]=V.slice(-1),Q=document.activeElement;for(const q of W)if(q===Q||(q==null||q.scrollIntoView({block:"nearest"}),q===$&&S&&(S.scrollTop=0),q===U&&S&&(S.scrollTop=S.scrollHeight),q==null||q.focus(),document.activeElement!==Q))return},[D,S]),z=w.useCallback(()=>I([k,x]),[I,k,x]);w.useEffect(()=>{N&&z()},[N,z]);const{onOpenChange:O,triggerPointerDownPosRef:A}=p;w.useEffect(()=>{if(x){let W={x:0,y:0};const $=U=>{var Q,q;W={x:Math.abs(Math.round(U.pageX)-(((Q=A.current)==null?void 0:Q.x)??0)),y:Math.abs(Math.round(U.pageY)-(((q=A.current)==null?void 0:q.y)??0))}},V=U=>{W.x<=10&&W.y<=10?U.preventDefault():x.contains(U.target)||O(!1),document.removeEventListener("pointermove",$),A.current=null};return A.current!==null&&(document.addEventListener("pointermove",$),document.addEventListener("pointerup",V,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",V,{capture:!0})}}},[x,O,A]),w.useEffect(()=>{const W=()=>O(!1);return window.addEventListener("blur",W),window.addEventListener("resize",W),()=>{window.removeEventListener("blur",W),window.removeEventListener("resize",W)}},[O]);const[j,F]=SI(W=>{const $=D().filter(Q=>!Q.disabled),V=$.find(Q=>Q.ref.current===document.activeElement),U=CI($,W,V);U&&setTimeout(()=>U.ref.current.focus())}),H=w.useCallback((W,$,V)=>{const U=!P.current&&!V;(p.value!==void 0&&p.value===$||U)&&(T(W),U&&(P.current=!0))},[p.value]),B=w.useCallback(()=>x==null?void 0:x.focus(),[x]),G=w.useCallback((W,$,V)=>{const U=!P.current&&!V;(p.value!==void 0&&p.value===$||U)&&M(W)},[p.value]),Z=r==="popper"?Zw:aI,X=Z===Zw?{side:o,sideOffset:l,align:c,alignOffset:h,arrowPadding:d,collisionBoundary:f,collisionPadding:m,sticky:_,hideWhenDetached:v,avoidCollisions:y}:{};return u.jsx(sI,{scope:n,content:x,viewport:S,onViewportChange:C,itemRefCallback:H,selectedItem:k,onItemLeave:B,itemTextRefCallback:G,focusSelectedItem:z,selectedItemText:R,position:r,isPositioned:N,searchRef:j,children:u.jsx(g1,{as:ia,allowPinchZoom:!0,children:u.jsx(l1,{asChild:!0,trapped:p.open,onMountAutoFocus:W=>{W.preventDefault()},onUnmountAutoFocus:fe(i,W=>{var $;($=p.trigger)==null||$.focus({preventScroll:!0}),W.preventDefault()}),children:u.jsx(Zu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:W=>W.preventDefault(),onDismiss:()=>p.onOpenChange(!1),children:u.jsx(Z,{role:"listbox",id:p.contentId,"data-state":p.open?"open":"closed",dir:p.dir,onContextMenu:W=>W.preventDefault(),...g,...X,onPlaced:()=>L(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...g.style},onKeyDown:fe(g.onKeyDown,W=>{const $=W.ctrlKey||W.altKey||W.metaKey;if(W.key==="Tab"&&W.preventDefault(),!$&&W.key.length===1&&F(W.key),["ArrowUp","ArrowDown","Home","End"].includes(W.key)){let U=D().filter(Q=>!Q.disabled).map(Q=>Q.ref.current);if(["ArrowUp","End"].includes(W.key)&&(U=U.slice().reverse()),["ArrowUp","ArrowDown"].includes(W.key)){const Q=W.target,q=U.indexOf(Q);U=U.slice(q+1)}setTimeout(()=>I(U)),W.preventDefault()}})})})})})})});oI.displayName=Tce;var Rce="SelectItemAlignedPosition",aI=w.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...i}=e,s=_a(gl,n),a=ba(gl,n),[o,l]=w.useState(null),[c,h]=w.useState(null),d=We(t,E=>h(E)),f=w1(n),m=w.useRef(!1),_=w.useRef(!0),{viewport:v,selectedItem:y,selectedItemText:g,focusSelectedItem:p}=a,x=w.useCallback(()=>{if(s.trigger&&s.valueNode&&o&&c&&v&&y&&g){const E=s.trigger.getBoundingClientRect(),k=c.getBoundingClientRect(),T=s.valueNode.getBoundingClientRect(),R=g.getBoundingClientRect();if(s.dir!=="rtl"){const Q=R.left-k.left,q=T.left-Q,ie=E.left-q,re=E.width+ie,ce=Math.max(re,k.width),ye=window.innerWidth-yi,le=nw(q,[yi,Math.max(yi,ye-ce)]);o.style.minWidth=re+"px",o.style.left=le+"px"}else{const Q=k.right-R.right,q=window.innerWidth-T.right-Q,ie=window.innerWidth-E.right-q,re=E.width+ie,ce=Math.max(re,k.width),ye=window.innerWidth-yi,le=nw(q,[yi,Math.max(yi,ye-ce)]);o.style.minWidth=re+"px",o.style.right=le+"px"}const M=f(),D=window.innerHeight-yi*2,N=v.scrollHeight,L=window.getComputedStyle(c),P=parseInt(L.borderTopWidth,10),I=parseInt(L.paddingTop,10),z=parseInt(L.borderBottomWidth,10),O=parseInt(L.paddingBottom,10),A=P+I+N+O+z,j=Math.min(y.offsetHeight*5,A),F=window.getComputedStyle(v),H=parseInt(F.paddingTop,10),B=parseInt(F.paddingBottom,10),G=E.top+E.height/2-yi,Z=D-G,X=y.offsetHeight/2,W=y.offsetTop+X,$=P+I+W,V=A-$;if($<=G){const Q=M.length>0&&y===M[M.length-1].ref.current;o.style.bottom="0px";const q=c.clientHeight-v.offsetTop-v.offsetHeight,ie=Math.max(Z,X+(Q?B:0)+q+z),re=$+ie;o.style.height=re+"px"}else{const Q=M.length>0&&y===M[0].ref.current;o.style.top="0px";const ie=Math.max(G,P+v.offsetTop+(Q?H:0)+X)+V;o.style.height=ie+"px",v.scrollTop=$-G+v.offsetTop}o.style.margin=`${yi}px 0`,o.style.minHeight=j+"px",o.style.maxHeight=D+"px",r==null||r(),requestAnimationFrame(()=>m.current=!0)}},[f,s.trigger,s.valueNode,o,c,v,y,g,s.dir,r]);pn(()=>x(),[x]);const[b,S]=w.useState();pn(()=>{c&&S(window.getComputedStyle(c).zIndex)},[c]);const C=w.useCallback(E=>{E&&_.current===!0&&(x(),p==null||p(),_.current=!1)},[x,p]);return u.jsx(Ace,{scope:n,contentWrapper:o,shouldExpandOnScrollRef:m,onScrollButtonChange:C,children:u.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:b},children:u.jsx(Ee.div,{...i,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});aI.displayName=Rce;var Mce="SelectPopperPosition",Zw=w.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:i=yi,...s}=e,a=S1(n);return u.jsx(j5,{...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)"}})});Zw.displayName=Mce;var[Ace,X5]=id(gl,{}),e2="SelectViewport",lI=w.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...i}=e,s=ba(e2,n),a=X5(e2,n),o=We(t,s.onViewportChange),l=w.useRef(0);return u.jsxs(u.Fragment,{children:[u.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),u.jsx(b1.Slot,{scope:n,children:u.jsx(Ee.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:o,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:fe(i.onScroll,c=>{const h=c.currentTarget,{contentWrapper:d,shouldExpandOnScrollRef:f}=a;if(f!=null&&f.current&&d){const m=Math.abs(l.current-h.scrollTop);if(m>0){const _=window.innerHeight-yi*2,v=parseFloat(d.style.minHeight),y=parseFloat(d.style.height),g=Math.max(v,y);if(g<_){const p=g+m,x=Math.min(_,p),b=p-x;d.style.height=x+"px",d.style.bottom==="0px"&&(h.scrollTop=b>0?b:0,d.style.justifyContent="flex-end")}}}l.current=h.scrollTop})})})]})});lI.displayName=e2;var cI="SelectGroup",[jce,Dce]=id(cI),Lce=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=zr();return u.jsx(jce,{scope:n,id:i,children:u.jsx(Ee.div,{role:"group","aria-labelledby":i,...r,ref:t})})});Lce.displayName=cI;var uI="SelectLabel",dI=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=Dce(uI,n);return u.jsx(Ee.div,{id:i.id,...r,ref:t})});dI.displayName=uI;var Ov="SelectItem",[Nce,hI]=id(Ov),fI=w.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:i=!1,textValue:s,...a}=e,o=_a(Ov,n),l=ba(Ov,n),c=o.value===r,[h,d]=w.useState(s??""),[f,m]=w.useState(!1),_=We(t,p=>{var x;return(x=l.itemRefCallback)==null?void 0:x.call(l,p,r,i)}),v=zr(),y=w.useRef("touch"),g=()=>{i||(o.onValueChange(r),o.onOpenChange(!1))};if(r==="")throw new Error("A 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 u.jsx(Nce,{scope:n,value:r,disabled:i,textId:v,isSelected:c,onItemTextChange:w.useCallback(p=>{d(x=>x||((p==null?void 0:p.textContent)??"").trim())},[]),children:u.jsx(b1.ItemSlot,{scope:n,value:r,disabled:i,textValue:h,children:u.jsx(Ee.div,{role:"option","aria-labelledby":v,"data-highlighted":f?"":void 0,"aria-selected":c&&f,"data-state":c?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...a,ref:_,onFocus:fe(a.onFocus,()=>m(!0)),onBlur:fe(a.onBlur,()=>m(!1)),onClick:fe(a.onClick,()=>{y.current!=="mouse"&&g()}),onPointerUp:fe(a.onPointerUp,()=>{y.current==="mouse"&&g()}),onPointerDown:fe(a.onPointerDown,p=>{y.current=p.pointerType}),onPointerMove:fe(a.onPointerMove,p=>{var x;y.current=p.pointerType,i?(x=l.onItemLeave)==null||x.call(l):y.current==="mouse"&&p.currentTarget.focus({preventScroll:!0})}),onPointerLeave:fe(a.onPointerLeave,p=>{var x;p.currentTarget===document.activeElement&&((x=l.onItemLeave)==null||x.call(l))}),onKeyDown:fe(a.onKeyDown,p=>{var b;((b=l.searchRef)==null?void 0:b.current)!==""&&p.key===" "||(_ce.includes(p.key)&&g(),p.key===" "&&p.preventDefault())})})})})});fI.displayName=Ov;var gh="SelectItemText",pI=w.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:i,...s}=e,a=_a(gh,n),o=ba(gh,n),l=hI(gh,n),c=Cce(gh,n),[h,d]=w.useState(null),f=We(t,g=>d(g),l.onItemTextChange,g=>{var p;return(p=o.itemTextRefCallback)==null?void 0:p.call(o,g,l.value,l.disabled)}),m=h==null?void 0:h.textContent,_=w.useMemo(()=>u.jsx("option",{value:l.value,disabled:l.disabled,children:m},l.value),[l.disabled,l.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:y}=c;return pn(()=>(v(_),()=>y(_)),[v,y,_]),u.jsxs(u.Fragment,{children:[u.jsx(Ee.span,{id:l.textId,...s,ref:f}),l.isSelected&&a.valueNode&&!a.valueNodeHasChildren?$r.createPortal(s.children,a.valueNode):null]})});pI.displayName=gh;var mI="SelectItemIndicator",gI=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return hI(mI,n).isSelected?u.jsx(Ee.span,{"aria-hidden":!0,...r,ref:t}):null});gI.displayName=mI;var t2="SelectScrollUpButton",vI=w.forwardRef((e,t)=>{const n=ba(t2,e.__scopeSelect),r=X5(t2,e.__scopeSelect),[i,s]=w.useState(!1),a=We(t,r.onScrollButtonChange);return pn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollTop>0;s(c)};const l=n.viewport;return o(),l.addEventListener("scroll",o),()=>l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?u.jsx(xI,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop-l.offsetHeight)}}):null});vI.displayName=t2;var n2="SelectScrollDownButton",yI=w.forwardRef((e,t)=>{const n=ba(n2,e.__scopeSelect),r=X5(n2,e.__scopeSelect),[i,s]=w.useState(!1),a=We(t,r.onScrollButtonChange);return pn(()=>{if(n.viewport&&n.isPositioned){let o=function(){const c=l.scrollHeight-l.clientHeight,h=Math.ceil(l.scrollTop)l.removeEventListener("scroll",o)}},[n.viewport,n.isPositioned]),i?u.jsx(xI,{...e,ref:a,onAutoScroll:()=>{const{viewport:o,selectedItem:l}=n;o&&l&&(o.scrollTop=o.scrollTop+l.offsetHeight)}}):null});yI.displayName=n2;var xI=w.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...i}=e,s=ba("SelectScrollButton",n),a=w.useRef(null),o=w1(n),l=w.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return w.useEffect(()=>()=>l(),[l]),pn(()=>{var h;const c=o().find(d=>d.ref.current===document.activeElement);(h=c==null?void 0:c.ref.current)==null||h.scrollIntoView({block:"nearest"})},[o]),u.jsx(Ee.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:fe(i.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(r,50))}),onPointerMove:fe(i.onPointerMove,()=>{var c;(c=s.onItemLeave)==null||c.call(s),a.current===null&&(a.current=window.setInterval(r,50))}),onPointerLeave:fe(i.onPointerLeave,()=>{l()})})}),Pce="SelectSeparator",_I=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return u.jsx(Ee.div,{"aria-hidden":!0,...r,ref:t})});_I.displayName=Pce;var r2="SelectArrow",Oce=w.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,i=S1(n),s=_a(r2,n),a=ba(r2,n);return s.open&&a.position==="popper"?u.jsx(D5,{...i,...r,ref:t}):null});Oce.displayName=r2;function bI(e){return e===""||e===void 0}var wI=w.forwardRef((e,t)=>{const{value:n,...r}=e,i=w.useRef(null),s=We(t,i),a=xp(n);return w.useEffect(()=>{const o=i.current,l=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(l,"value").set;if(a!==n&&h){const d=new Event("change",{bubbles:!0});h.call(o,n),o.dispatchEvent(d)}},[a,n]),u.jsx(Y5,{asChild:!0,children:u.jsx("select",{...r,ref:s,defaultValue:n})})});wI.displayName="BubbleSelect";function SI(e){const t=jt(e),n=w.useRef(""),r=w.useRef(0),i=w.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=w.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return w.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,s]}function CI(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=Ice(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 Ice(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var kI=QO,C1=ZO,$ce=tI,Bce=nI,EI=rI,k1=iI,TI=lI,RI=dI,E1=fI,MI=pI,Fce=gI,T1=vI,R1=yI,AI=_I;const Hn=kI,Wn=$ce,Dn=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(C1,{ref:r,className:J("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,u.jsx(Bce,{asChild:!0,children:u.jsx(Dl,{className:"h-4 w-4 opacity-50"})})]}));Dn.displayName=C1.displayName;const jI=w.forwardRef(({className:e,...t},n)=>u.jsx(T1,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(NC,{className:"h-4 w-4"})}));jI.displayName=T1.displayName;const DI=w.forwardRef(({className:e,...t},n)=>u.jsx(R1,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Dl,{className:"h-4 w-4"})}));DI.displayName=R1.displayName;const Ln=w.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>u.jsx(EI,{children:u.jsxs(k1,{ref:i,className:J("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:[u.jsx(jI,{}),u.jsx(TI,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(DI,{})]})}));Ln.displayName=k1.displayName;const zce=w.forwardRef(({className:e,...t},n)=>u.jsx(RI,{ref:n,className:J("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));zce.displayName=RI.displayName;const Se=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(E1,{ref:r,className:J("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:[u.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:u.jsx(Fce,{children:u.jsx(LC,{className:"h-4 w-4"})})}),u.jsx(MI,{children:t})]}));Se.displayName=E1.displayName;const Q5=w.forwardRef(({className:e,...t},n)=>u.jsx(AI,{ref:n,className:J("-mx-1 my-1 h-px bg-muted",e),...t}));Q5.displayName=AI.displayName;const Iv=[{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."}],Fo="!any",jm=Jn(1250,e=>{e()},{noLeading:!0});function Hce({doSearch:e,initialState:t,adminStats:n}){const{authData:r}=Pl(),i=w.useRef(null),[s,a]=w.useState(!1),[o,l]=w.useState(t.search.type),[c,h]=w.useState(!!t.search.value),[d,f]=w.useState(t.filterbyType),[m,_]=w.useState(t.filterbyAdmin),v=()=>{if(!i.current)return;const S=i.current.value.trim();e({value:S,type:o},d!==Fo?d:void 0,m!==Fo?m:void 0)};w.useEffect(()=>{v()},[o,d,m]);const y=S=>{S.key==="Enter"?(jm.cancel({upcomingOnly:!0}),v()):S.key==="Escape"?(i.current.value="",jm(v),h(!1)):(jm(v),h(!0))},g=()=>{i.current.value="",jm.cancel({upcomingOnly:!0}),v(),h(!1)};Pi("keydown",S=>{var C;S.code==="KeyF"&&(S.ctrlKey||S.metaKey)&&((C=i.current)==null||C.focus(),S.preventDefault())});const p=Iv.find(S=>S.value===o);if(!p)throw new Error(`Invalid search type: ${o}`);if(!r)throw new Error("authData is not available");const x=w.useMemo(()=>n.filter(S=>S.name!==r.name),[n,r.name]),b=w.useMemo(()=>{var S;return((S=n.find(C=>C.name===r.name))==null?void 0:S.actions)||0},[n,r.name]);return u.jsxs("div",{className:"p-4 mb-2 md:mb-4 md:rounded-xl border border-border bg-card text-card-foreground shadow-sm",children:[u.jsxs("div",{className:"flex flex-wrap-reverse gap-2",children:[u.jsxs("div",{className:"relative min-w-44 grow",children:[u.jsx(wt,{type:"text",autoFocus:!0,autoCapitalize:"off",autoCorrect:"off",ref:i,placeholder:p.placeholder,defaultValue:t.search.value,onKeyDown:y}),c?u.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:g,children:u.jsx(Ar,{})}):u.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:u.jsx(Ye,{className:"text-xs tracking-wide",children:"ctrl+f"})})]}),u.jsxs("div",{className:"grow flex content-start gap-2 flex-wrap",children:[u.jsxs(Hc,{children:[u.jsx(Wc,{asChild:!0,children:u.jsxs(De,{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 ",p.label,u.jsx(sw,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(tl,{className:"w-48",children:[u.jsx(Dv,{children:"Search Type"}),u.jsx(Fa,{}),u.jsx(WO,{value:o,onValueChange:l,children:Iv.map(S=>u.jsx(U5,{value:S.value,className:"cursor-pointer",children:S.label},S.value))})]})]}),u.jsxs(Hn,{defaultValue:d,onValueChange:f,children:[u.jsx(Dn,{className:"w-36 grow md:grow-0",children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:Fo,className:"cursor-pointer",children:"Any type"}),u.jsx(Se,{value:"ban",className:"cursor-pointer",children:"Bans"}),u.jsx(Se,{value:"warn",className:"cursor-pointer",children:"Warns"})]})]}),u.jsxs(Hn,{defaultValue:m,onValueChange:_,children:[u.jsx(Dn,{className:"w-36 grow md:grow-0",children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:Fo,className:"cursor-pointer",children:"By any admin"}),u.jsxs(Se,{value:r.name,className:"cursor-pointer",children:[r.name," ",u.jsxs("span",{className:"opacity-50",children:["(",b,")"]})]}),u.jsx(Q5,{}),x.map(S=>u.jsxs(Se,{className:"cursor-pointer",value:S.name,children:[S.name," ",u.jsxs("span",{className:"opacity-50",children:["(",S.actions,")"]})]},S.name))]})]}),u.jsx("div",{className:"flex justify-end flex-grow",children:u.jsxs(Hc,{children:[u.jsx(Wc,{asChild:!0,children:u.jsxs(De,{variant:"outline",className:"grow md:grow-0",children:["More",u.jsx(Dl,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),u.jsxs(tl,{children:[u.jsx(ss,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(fs,{href:"/system/master-actions#cleandb",className:"cursor-pointer",children:[u.jsx(dl,{className:"inline mr-1 h-4"}),"Bulk Remove"]})}),u.jsx(ss,{className:"h-10 pl-1 pr-2 py-2",asChild:!0,children:u.jsxs(fs,{href:"/settings/ban-templates",className:"cursor-pointer",children:[u.jsx(dl,{className:"inline mr-1 h-4"}),"Ban Templates"]})})]})]})})]})]}),u.jsx("div",{className:"text-xs text-muted-foreground mt-1 px-1",children:p.description})]})}function Wce({action:e,modalOpener:t}){const n=()=>{t(e.id)};let r,i;if(e.type==="warn")r=u.jsx("div",{className:"flex items-center px-1 bg-warning-hint text-warning",children:u.jsx(gv,{className:"size-5"})}),i=u.jsx("span",{className:"tracking-wider text-warning",children:e.id});else if(e.type==="ban")r=u.jsx("div",{className:"flex items-center px-1 bg-destructive-hint text-destructive",children:u.jsx(pv,{className:"size-5"})}),i=u.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=u.jsx($C,{className:"size-4"}):e.banExpiration?e.banExpiration==="permanent"?s=u.jsx(wQ,{className:"size-4"}):e.banExpiration==="active"&&(s=u.jsx(ML,{className:"size-4"})):e.type==="warn"&&!e.warnAcked&&(s=u.jsx(SL,{className:"size-4"})),u.jsxs(yp,{onClick:n,className:"cursor-pointer",children:[u.jsx(ni,{className:J("w-[10.4rem] border-r p-0",e.isRevoked&&"opacity-40"),children:u.jsxs("div",{className:"flex justify-start gap-2",children:[r,u.jsx("div",{className:"p-2 font-mono",children:i}),u.jsx("div",{className:"flex-grow flex justify-end items-center my-auto pr-2 text-muted-foreground",children:s})]})}),u.jsx(ni,{className:"px-4 py-2 border-r",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.playerName?e.playerName:u.jsx("span",{className:"text-muted-foreground italic",children:"unknown"})})}),u.jsx(ni,{className:"px-4 py-2 border-r",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.reason})}),u.jsx(ni,{className:"px-4 py-2 border-r",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:e.author})}),u.jsx(ni,{className:"min-w-[10rem] px-4 py-2",children:u.jsx("span",{className:"text-ellipsis overflow-hidden line-clamp-1 break-all",children:Xw(e.timestamp)})})]})}function Uce({playersCount:e,hasReachedEnd:t,isFetching:n,loadError:r,retryFetch:i}){let s;return n?s=u.jsx(sn,{className:"mx-auto animate-spin"}):r?s=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",r]}),u.jsx("br",{}),u.jsx("button",{className:"underline",onClick:()=>i(),children:"Try again?"})]}):t?s=u.jsx("span",{className:"font-bold text-muted-foreground",children:e?"You have reached the end of the list.":"No actions found."}):s=u.jsxs("span",{children:["You've found the end of the rainbow, but there's no pot of gold here. ",u.jsx("br",{}),u.jsxs("i",{children:["(this is a bug, please report it in ",u.jsx(kn,{href:"https://discord.gg/txAdmin",target:"_blank",rel:"noopener noreferrer",children:"discord.gg/txAdmin"}),")"]})]}),u.jsx(yp,{children:u.jsx(ni,{colSpan:5,className:"px-4 py-2 text-center",children:s})})}function Vce({label:e,sortKey:t,sortingState:n,setSorting:r,className:i}){const s=n.key===t,a=n.desc,o=s?a?"▼":"▲":u.jsx(u.Fragment,{}),l=c=>{c.preventDefault(),r({key:t,desc:s?!a:!0})};return u.jsxs("th",{onClick:l,className:J("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,u.jsx("div",{className:"ml-1 min-w-[2ch] inline-block",children:o})]})}function Dm({label:e,className:t}){return u.jsx("th",{className:J("py-2 px-4 font-light tracking-wider text-left text-muted-foreground",t),children:e})}function qce({search:e,filterbyType:t,filterbyAdmin:n}){const r=w.useRef(null),[i,s]=w.useState([]),[a,o]=w.useState(!1),[l,c]=w.useState(!1),[h,d]=w.useState(null),[f,m]=w.useState({key:"timestamp",desc:!0}),[_,v]=w.useState(!1),y=u5(),g=Tt({method:"GET",path:"/history/search",abortOnUnmount:!0}),p=async k=>{c(!0),d(null),k&&v(!0);const T=R=>{d(R),k&&s([])};try{const R={sortingKey:f.key,sortingDesc:f.desc};e.value&&(R.searchValue=e.value,R.searchType=e.type),t&&t!==Fo&&(R.filterbyType=t),n&&n!==Fo&&(R.filterbyAdmin=n),!k&&i.length&&(R.offsetParam=i[i.length-1][f.key],R.offsetActionId=i[i.length-1].id);const M=await g({queryParams:R});if(M===void 0)return T("Request failed.");if("error"in M)return T(`Request failed: ${M.error}`);d(null),o(M.hasReachedEnd),v(!1),M.history.length?s(D=>k?M.history:[...D,...M.history]):s([])}catch(R){T(`Failed to fetch more data: ${R.message}`)}finally{c(!1),v(!1)}},x=V5({isScrollingResetDelay:0,count:i.length+1,getScrollElement:()=>{var k;return(k=r.current)==null?void 0:k.getElementsByTagName("div")[0]},estimateSize:()=>38,overscan:25}),b=x.getVirtualItems(),S=x.getTotalSize();let C=null,E=null;if(b.length>0){const k=b[0].start-x.options.scrollMargin;k>0&&(C=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:k}})}));const T=S-b[b.length-1].end;T>0&&(E=u.jsx("tr",{children:u.jsx("td",{colSpan:3,style:{height:T}})}))}return w.useEffect(()=>{if(!i.length||!b.length)return;const k=b[b.length-1].index;i.length<=k&&!a&&!l&&p()},[i,b,a,l]),w.useEffect(()=>{x.scrollToIndex(0),p(!0)},[e,t,n,f]),u.jsx("div",{className:"w-full max-h-full min-h-96 overflow-auto border md:rounded-lg",style:{overflowAnchor:"none"},children:u.jsx(hi,{className:"h-full",ref:r,children:u.jsxs("table",{className:"w-full caption-bottom text-sm select-none",children:[u.jsx(G5,{children:u.jsxs("tr",{className:"sticky top-0 z-10 bg-zinc-200 dark:bg-muted text-secondary-foreground text-base shadow-md transition-colors",children:[u.jsx(Dm,{label:"Action"}),u.jsx(Dm,{label:"Player"}),u.jsx(Dm,{label:"Reason"}),u.jsx(Dm,{label:"Author"}),u.jsx(Vce,{label:"Date Time",sortKey:"timestamp",sortingState:f,setSorting:m})]})}),u.jsxs(K5,{className:J(_&&"opacity-25"),children:[C,b.map(k=>k.index>i.length-1?u.jsx(Uce,{playersCount:i.length,hasReachedEnd:a,loadError:h,isFetching:l,retryFetch:p},k.key):u.jsx(Wce,{action:i[k.index],modalOpener:y},k.key)),E]})]})})})}const Gce=w.memo(Hce),Kce=w.memo(qce),Yce=w.memo(dP),Xce=(e,t,n)=>{const r=new URL(window.location.toString());e&&e.type&&e.value?(r.searchParams.set("searchType",e.type),r.searchParams.set("searchQuery",e.value)):(r.searchParams.delete("searchType"),r.searchParams.delete("searchQuery")),t&&t!=="!any"?r.searchParams.set("filterbyType",t):r.searchParams.delete("filterbyType"),n&&n!=="!any"?r.searchParams.set("filterbyAdmin",n):r.searchParams.delete("filterbyAdmin"),window.history.replaceState({},"",r)},Qce=()=>{const e=new URLSearchParams(window.location.search),t=Iv.map(i=>i.value),n=e.get("searchType"),r=e.get("searchQuery");return{search:r&&n&&t.includes(n)?{type:n,value:r}:{type:Iv[0].value,value:""},filterbyType:e.get("filterbyType")??Fo,filterbyAdmin:e.get("filterbyAdmin")??Fo}};function Jce(){const[e,t]=w.useState(void 0),[n,r]=w.useState(void 0),i=Tt({method:"GET",path:"/history/stats",abortOnUnmount:!0});w.useEffect(()=>{i({success(l,c){t(l)}})},[]);const s=w.useCallback((l,c,h)=>{r({search:l,filterbyType:c,filterbyAdmin:h}),Xce(l,c,h)},[]),a=w.useMemo(Qce,[]),o=w.useMemo(()=>{const l=e&&!("error"in e);return[{label:"Total Warns",value:l?e.totalWarns:!1,icon:u.jsx(gv,{})},{label:"New Warns Last 7d",value:l?e.warnsLast7d:!1,icon:u.jsx(gv,{}),prefix:"+"},{label:"Total Bans",value:l?e.totalBans:!1,icon:u.jsx(pv,{})},{label:"New Bans Last 7d",value:l?e.bansLast7d:!1,icon:u.jsx(pv,{}),prefix:"+"}]},[e]);return u.jsxs("div",{className:"flex flex-col min-w-96 w-full h-contentvh",children:[u.jsx(Yce,{callouts:o}),e&&!("error"in e)?u.jsx(Gce,{doSearch:s,initialState:a,adminStats:e.groupedByAdmins}):null,n?u.jsx(Kce,{search:n.search,filterbyType:n.filterbyType,filterbyAdmin:n.filterbyAdmin}):null]})}var J5="Dialog",[LI,NI]=Un(J5),[Zce,Fi]=LI(J5),PI=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,o=w.useRef(null),l=w.useRef(null),[c=!1,h]=fi({prop:r,defaultProp:i,onChange:s});return u.jsx(Zce,{scope:t,triggerRef:o,contentRef:l,contentId:zr(),titleId:zr(),descriptionId:zr(),open:c,onOpenChange:h,onOpenToggle:w.useCallback(()=>h(d=>!d),[h]),modal:a,children:n})};PI.displayName=J5;var OI="DialogTrigger",II=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fi(OI,n),s=We(t,i.triggerRef);return u.jsx(Ee.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":tk(i.open),...r,ref:s,onClick:fe(e.onClick,i.onOpenToggle)})});II.displayName=OI;var Z5="DialogPortal",[eue,$I]=LI(Z5,{forceMount:void 0}),BI=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:i}=e,s=Fi(Z5,t);return u.jsx(eue,{scope:t,forceMount:n,children:w.Children.map(r,a=>u.jsx(xn,{present:n||s.open,children:u.jsx(f1,{asChild:!0,container:i,children:a})}))})};BI.displayName=Z5;var $v="DialogOverlay",FI=w.forwardRef((e,t)=>{const n=$I($v,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Fi($v,e.__scopeDialog);return s.modal?u.jsx(xn,{present:r||s.open,children:u.jsx(tue,{...i,ref:t})}):null});FI.displayName=$v;var tue=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fi($v,n);return u.jsx(g1,{as:ia,allowPinchZoom:!0,shards:[i.contentRef],children:u.jsx(Ee.div,{"data-state":tk(i.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),vl="DialogContent",zI=w.forwardRef((e,t)=>{const n=$I(vl,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,s=Fi(vl,e.__scopeDialog);return u.jsx(xn,{present:r||s.open,children:s.modal?u.jsx(nue,{...i,ref:t}):u.jsx(rue,{...i,ref:t})})});zI.displayName=vl;var nue=w.forwardRef((e,t)=>{const n=Fi(vl,e.__scopeDialog),r=w.useRef(null),i=We(t,n.contentRef,r);return w.useEffect(()=>{const s=r.current;if(s)return P5(s)},[]),u.jsx(HI,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:fe(e.onCloseAutoFocus,s=>{var a;s.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:fe(e.onPointerDownOutside,s=>{const a=s.detail.originalEvent,o=a.button===0&&a.ctrlKey===!0;(a.button===2||o)&&s.preventDefault()}),onFocusOutside:fe(e.onFocusOutside,s=>s.preventDefault())})}),rue=w.forwardRef((e,t)=>{const n=Fi(vl,e.__scopeDialog),r=w.useRef(!1),i=w.useRef(!1);return u.jsx(HI,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:s=>{var a,o;(a=e.onCloseAutoFocus)==null||a.call(e,s),s.defaultPrevented||(r.current||(o=n.triggerRef.current)==null||o.focus(),s.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:s=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,s),s.defaultPrevented||(r.current=!0,s.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=s.target;((c=n.triggerRef.current)==null?void 0:c.contains(a))&&s.preventDefault(),s.detail.originalEvent.type==="focusin"&&i.current&&s.preventDefault()}})}),HI=w.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,...a}=e,o=Fi(vl,n),l=w.useRef(null),c=We(t,l);return x5(),u.jsxs(u.Fragment,{children:[u.jsx(l1,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s,children:u.jsx(Zu,{role:"dialog",id:o.contentId,"aria-describedby":o.descriptionId,"aria-labelledby":o.titleId,"data-state":tk(o.open),...a,ref:c,onDismiss:()=>o.onOpenChange(!1)})}),u.jsxs(u.Fragment,{children:[u.jsx(sue,{titleId:o.titleId}),u.jsx(aue,{contentRef:l,descriptionId:o.descriptionId})]})]})}),ek="DialogTitle",WI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fi(ek,n);return u.jsx(Ee.h2,{id:i.titleId,...r,ref:t})});WI.displayName=ek;var UI="DialogDescription",VI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fi(UI,n);return u.jsx(Ee.p,{id:i.descriptionId,...r,ref:t})});VI.displayName=UI;var qI="DialogClose",GI=w.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,i=Fi(qI,n);return u.jsx(Ee.button,{type:"button",...r,ref:t,onClick:fe(e.onClick,()=>i.onOpenChange(!1))})});GI.displayName=qI;function tk(e){return e?"open":"closed"}var KI="DialogTitleWarning",[iue,YI]=AY(KI,{contentName:vl,titleName:ek,docsSlug:"dialog"}),sue=({titleId:e})=>{const t=YI(KI),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return w.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},oue="DialogDescriptionWarning",aue=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${YI(oue).contentName}}.`;return w.useEffect(()=>{var s;const i=(s=e.current)==null?void 0:s.getAttribute("aria-describedby");t&&i&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},nk=PI,lue=II,rk=BI,bp=FI,wp=zI,Sp=WI,Cp=VI,M1=GI;const $l=nk,cue=rk,XI=w.forwardRef(({className:e,...t},n)=>u.jsx(bp,{ref:n,className:J("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}));XI.displayName=bp.displayName;const wa=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(cue,{children:[u.jsx(XI,{}),u.jsxs(wp,{ref:r,className:J("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,u.jsxs(M1,{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:[u.jsx(Ar,{className:"h-6 w-6"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));wa.displayName=wp.displayName;const Sa=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Sa.displayName="DialogHeader";const kp=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});kp.displayName="DialogFooter";const Ca=w.forwardRef(({className:e,...t},n)=>u.jsx(Sp,{ref:n,className:J("text-lg font-semibold leading-none tracking-tight","attempt-word-wrap",e),...t}));Ca.displayName=Sp.displayName;const QI=w.forwardRef(({className:e,...t},n)=>u.jsx(Cp,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));QI.displayName=Cp.displayName;const uue=({textAreaRef:e,triggerAutoSize:t,maxHeight:n=Number.MAX_SAFE_INTEGER,minHeight:r=0})=>{const[i,s]=w.useState(!0);w.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])},Ep=w.forwardRef(({maxHeight:e=Number.MAX_SAFE_INTEGER,minHeight:t=52,className:n,onChange:r,value:i,...s},a)=>{const o=w.useRef(null),[l,c]=w.useState("");return uue({textAreaRef:o.current,triggerAutoSize:l,maxHeight:e,minHeight:t}),w.useImperativeHandle(a,()=>({textArea:o.current,maxHeight:e,minHeight:t})),w.useEffect(()=>{c(i)},[i,s==null?void 0:s.defaultValue,s==null?void 0:s.placeholder]),u.jsx("textarea",{...s,value:i,ref:o,className:J("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 placeholder:opacity-50",n),onChange:h=>{c(h.target.value),r==null||r(h)}})});Ep.displayName="AutosizeTextarea";const due=["2 hours","8 hours","1 days","2 days","1 weeks","2 weeks","permanent"];function hue({reasonData:e,onSave:t,isDialogOpen:n,setIsDialogOpen:r}){let i="",s="2 days",a,o="days";e&&(i=e.reason,due.includes(sv(e.duration))||e.duration==="permanent"?s=sv(e.duration):(s="custom",a=e.duration.value,o=e.duration.unit));const l=w.useRef(null),c=w.useRef(null),[h,d]=w.useState(s),[f,m]=w.useState(o);w.useEffect(()=>{const v=setTimeout(()=>{n||(d(s),m(o),l.current&&(l.current.textArea.value=""),c.current&&(c.current.value=""))},500);return()=>clearTimeout(v)},[n]);const _=v=>{v.preventDefault();const y=v.currentTarget,g=(e==null?void 0:e.id)||null,p=y.reason.value.trim();if(y.reason.value=p,p.length<3)return y.reason.focus(),qe.warning("Reason must be at least 3 characters long");let x;if(h==="permanent")x="permanent";else if(h==="custom"){if(y.durationMultiplier.value<=0)return y.durationMultiplier.focus(),qe.warning("Custom duration must be a positive number");x={value:parseInt(y.durationMultiplier.value),unit:f}}else{const[b,S]=h.split(" ");x={value:parseInt(b),unit:S}}t({id:g,reason:p,duration:x})};return u.jsx($l,{open:n,onOpenChange:r,children:u.jsx(wa,{className:"md:max-w-xl",children:u.jsx("form",{onSubmit:_,children:u.jsxs("div",{className:"space-y-4",children:[u.jsx(Sa,{children:u.jsxs(Ca,{children:[e?"Edit":"Add"," Template"]})}),u.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[u.jsx(Tn,{htmlFor:"banReason",className:"col-span-6 sm:col-auto",children:"Reason"}),u.jsx(Ep,{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:v=>{const y=v.target;y.value.includes(` `)&&(y.value=y.value.replace(/\s*\r*\n+\s*/g," "))}})]}),u.jsxs("div",{className:"grid grid-cols-6 items-center gap-4",children:[u.jsx(Tn,{htmlFor:"durationSelect",className:"col-span-6 sm:col-auto",children:"Duration"}),u.jsxs("div",{className:"col-span-full sm:col-span-5 space-y-1",children:[u.jsxs(Hn,{onValueChange:d,defaultValue:h,children:[u.jsx(Dn,{id:"durationSelect",className:"tracking-wide",children:u.jsx(Wn,{placeholder:"Select Duration"})}),u.jsxs(Ln,{className:"tracking-wide",children:[u.jsx(Se,{value:"custom",className:"font-bold",children:"Custom (set below)"}),u.jsx(Se,{value:"2 hours",children:"2 HOURS"}),u.jsx(Se,{value:"8 hours",children:"8 HOURS"}),u.jsx(Se,{value:"1 days",children:"1 DAY"}),u.jsx(Se,{value:"2 days",children:"2 DAYS"}),u.jsx(Se,{value:"1 weeks",children:"1 WEEK"}),u.jsx(Se,{value:"2 weeks",children:"2 WEEKS"}),u.jsx(Se,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),u.jsxs("div",{className:"flex flex-row gap-2",children:[u.jsx(wt,{id:"durationMultiplier",type:"number",placeholder:"123",defaultValue:a,disabled:h!=="custom",ref:c,min:1,max:99,required:!0}),u.jsxs(Hn,{onValueChange:m,defaultValue:f,children:[u.jsx(Dn,{id:"durationUnits",className:"tracking-wide",disabled:h!=="custom",children:u.jsx(Wn,{})}),u.jsxs(Ln,{className:"tracking-wide",children:[u.jsx(Se,{value:"hours",children:"HOURS"}),u.jsx(Se,{value:"days",children:"DAYS"}),u.jsx(Se,{value:"weeks",children:"WEEKS"}),u.jsx(Se,{value:"months",children:"MONTHS"})]})]})]})]})]}),u.jsx(kp,{children:u.jsx(De,{type:"submit",children:"Save changes"})})]})})})})}function fue({id:e,reason:t,duration:n,onEdit:r,onRemove:i,disabled:s}){return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"grow sm:flex items-center justify-items-start gap-2",children:[u.jsx("span",{className:"line-clamp-5 md:line-clamp-3",children:t}),u.jsx("div",{className:J("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:sv(n)})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{className:J("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-primary hover:scale-110"),onClick:()=>r(e),disabled:s,children:u.jsx(IC,{className:"size-6"})}),u.jsx("button",{className:J("text-muted-foreground",s?"opacity-50 cursor-not-allowed":"hover:text-destructive hover:scale-110"),onClick:()=>i(e),disabled:s,children:u.jsx(Ar,{className:"size-6"})})]})]})}function pue({onClick:e,disabled:t}){return u.jsxs("li",{onClick:e,className:J("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:[u.jsx(OC,{className:"size-6"}),u.jsx("span",{children:"Add New Reason"})]})}function mue(){for(var e=arguments.length,t=new Array(e),n=0;nr=>{t.forEach(i=>i(r))},t)}const A1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sd(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function ik(e){return"nodeType"in e}function jr(e){var t,n;return e?sd(e)?e:ik(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function sk(e){const{Document:t}=jr(e);return e instanceof t}function Tp(e){return sd(e)?!1:e instanceof jr(e).HTMLElement}function JI(e){return e instanceof jr(e).SVGElement}function od(e){return e?sd(e)?e.document:ik(e)?sk(e)?e:Tp(e)||JI(e)?e.ownerDocument:document:document:document}const vs=A1?w.useLayoutEffect:w.useEffect;function ok(e){const t=w.useRef(e);return vs(()=>{t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i{e.current=setInterval(r,i)},[]),n=w.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Sf(e,t){t===void 0&&(t=[e]);const n=w.useRef(e);return vs(()=>{n.current!==e&&(n.current=e)},t),n}function Rp(e,t){const n=w.useRef();return w.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Bv(e){const t=ok(e),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function i2(e){const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}let x_={};function Mp(e,t){return w.useMemo(()=>{if(t)return t;const n=x_[e]==null?0:x_[e]+1;return x_[e]=n,e+"-"+n},[e,t])}function ZI(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i{const o=Object.entries(a);for(const[l,c]of o){const h=s[l];h!=null&&(s[l]=h+e*c)}return s},{...t})}}const Uc=ZI(1),Cf=ZI(-1);function vue(e){return"clientX"in e&&"clientY"in e}function ak(e){if(!e)return!1;const{KeyboardEvent:t}=jr(e.target);return t&&e instanceof t}function yue(e){if(!e)return!1;const{TouchEvent:t}=jr(e.target);return t&&e instanceof t}function s2(e){if(yue(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 vue(e)?{x:e.clientX,y:e.clientY}:null}const kf=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[kf.Translate.toString(e),kf.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),IR="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function xue(e){return e.matches(IR)?e:e.querySelector(IR)}const _ue={display:"none"};function bue(e){let{id:t,value:n}=e;return ft.createElement("div",{id:t,style:_ue},n)}function wue(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return ft.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function Sue(){const[e,t]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const e9=w.createContext(null);function Cue(e){const t=w.useContext(e9);w.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of ");return t(e)},[e,t])}function kue(){const[e]=w.useState(()=>new Set),t=w.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[w.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 Eue={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. `},Tue={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 Rue(e){let{announcements:t=Tue,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=Eue}=e;const{announce:s,announcement:a}=Sue(),o=Mp("DndLiveRegion"),[l,c]=w.useState(!1);if(w.useEffect(()=>{c(!0)},[]),Cue(w.useMemo(()=>({onDragStart(d){let{active:f}=d;s(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:m}=d;t.onDragMove&&s(t.onDragMove({active:f,over:m}))},onDragOver(d){let{active:f,over:m}=d;s(t.onDragOver({active:f,over:m}))},onDragEnd(d){let{active:f,over:m}=d;s(t.onDragEnd({active:f,over:m}))},onDragCancel(d){let{active:f,over:m}=d;s(t.onDragCancel({active:f,over:m}))}}),[s,t])),!l)return null;const h=ft.createElement(ft.Fragment,null,ft.createElement(bue,{id:r,value:i.draggable}),ft.createElement(wue,{id:o,announcement:a}));return n?$r.createPortal(h,n):h}var wn;(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"})(wn||(wn={}));function Fv(){}function $R(e,t){return w.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function Mue(){for(var e=arguments.length,t=new Array(e),n=0;n[...t].filter(r=>r!=null),[...t])}const $i=Object.freeze({x:0,y:0});function t9(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function n9(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Aue(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function BR(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 r9(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function FR(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 jue=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=FR(t,t.left,t.top),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=t9(FR(l),i);s.push({id:o,data:{droppableContainer:a,value:c}})}}return s.sort(n9)},Due=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=BR(t),s=[];for(const a of r){const{id:o}=a,l=n.get(o);if(l){const c=BR(l),h=i.reduce((f,m,_)=>f+t9(c[_],m),0),d=Number((h/4).toFixed(4));s.push({id:o,data:{droppableContainer:a,value:d}})}}return s.sort(n9)};function Lue(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{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=Lue(o,t);l>0&&i.push({id:a,data:{droppableContainer:s,value:l}})}}return i.sort(Aue)};function Pue(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function i9(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:$i}function Oue(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),s=1;s({...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 Iue=Oue(1);function $ue(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 Bue(e,t,n){const r=$ue(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)),h=i?e.width/i:e.width,d=s?e.height/s:e.height;return{width:h,height:d,top:c,right:l+h,bottom:c+d,left:l}}const Fue={ignoreTransform:!1};function ad(e,t){t===void 0&&(t=Fue);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:h}=jr(e).getComputedStyle(e);c&&(n=Bue(n,c,h))}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 zR(e){return ad(e,{ignoreTransform:!0})}function zue(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function Hue(e,t){return t===void 0&&(t=jr(e).getComputedStyle(e)),t.position==="fixed"}function Wue(e,t){t===void 0&&(t=jr(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 j1(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(sk(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!Tp(i)||JI(i)||n.includes(i))return n;const s=jr(e).getComputedStyle(i);return i!==e&&Wue(i,s)&&n.push(i),Hue(i,s)?n:r(i.parentNode)}return e?r(e):n}function s9(e){const[t]=j1(e,1);return t??null}function __(e){return!A1||!e?null:sd(e)?e:ik(e)?sk(e)||e===od(e).scrollingElement?window:Tp(e)?e:null:null}function o9(e){return sd(e)?e.scrollX:e.scrollLeft}function a9(e){return sd(e)?e.scrollY:e.scrollTop}function o2(e){return{x:o9(e),y:a9(e)}}var An;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(An||(An={}));function l9(e){return!A1||!e?!1:e===document.scrollingElement}function c9(e){const t={x:0,y:0},n=l9(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 Uue={x:.2,y:.2};function Vue(e,t,n,r,i){let{top:s,left:a,right:o,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=Uue);const{isTop:c,isBottom:h,isLeft:d,isRight:f}=c9(e),m={x:0,y:0},_={x:0,y:0},v={height:t.height*i.y,width:t.width*i.x};return!c&&s<=t.top+v.height?(m.y=An.Backward,_.y=r*Math.abs((t.top+v.height-s)/v.height)):!h&&l>=t.bottom-v.height&&(m.y=An.Forward,_.y=r*Math.abs((t.bottom-v.height-l)/v.height)),!f&&o>=t.right-v.width?(m.x=An.Forward,_.x=r*Math.abs((t.right-v.width-o)/v.width)):!d&&a<=t.left+v.width&&(m.x=An.Backward,_.x=r*Math.abs((t.left+v.width-a)/v.width)),{direction:m,speed:_}}function que(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 u9(e){return e.reduce((t,n)=>Uc(t,o2(n)),$i)}function Gue(e){return e.reduce((t,n)=>t+o9(n),0)}function Kue(e){return e.reduce((t,n)=>t+a9(n),0)}function Yue(e,t){if(t===void 0&&(t=ad),!e)return;const{top:n,left:r,bottom:i,right:s}=t(e);s9(e)&&(i<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const Xue=[["x",["left","right"],Gue],["y",["top","bottom"],Kue]];class lk{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=j1(n),i=u9(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,a,o]of Xue)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=o(r),h=i[s]-c;return this.rect[l]+h},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Bh{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 Que(e){const{EventTarget:t}=jr(e);return e instanceof t?e:od(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 Yr;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(Yr||(Yr={}));function HR(e){e.preventDefault()}function Jue(e){e.stopPropagation()}var lt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(lt||(lt={}));const d9={start:[lt.Space,lt.Enter],cancel:[lt.Esc],end:[lt.Space,lt.Enter,lt.Tab]},Zue=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case lt.Right:return{...n,x:n.x+25};case lt.Left:return{...n,x:n.x-25};case lt.Down:return{...n,y:n.y+25};case lt.Up:return{...n,y:n.y-25}}};class ck{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 Bh(od(n)),this.windowListeners=new Bh(jr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(Yr.Resize,this.handleCancel),this.windowListeners.add(Yr.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(Yr.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Yue(r),n($i)}handleKeyDown(t){if(ak(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:s=d9,coordinateGetter:a=Zue,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,h=c?{x:c.left,y:c.top}:$i;this.referenceCoordinates||(this.referenceCoordinates=h);const d=a(t,{active:n,context:r.current,currentCoordinates:h});if(d){const f=Cf(d,h),m={x:0,y:0},{scrollableAncestors:_}=r.current;for(const v of _){const y=t.code,{isTop:g,isRight:p,isLeft:x,isBottom:b,maxScroll:S,minScroll:C}=c9(v),E=que(v),k={x:Math.min(y===lt.Right?E.right-E.width/2:E.right,Math.max(y===lt.Right?E.left:E.left+E.width/2,d.x)),y:Math.min(y===lt.Down?E.bottom-E.height/2:E.bottom,Math.max(y===lt.Down?E.top:E.top+E.height/2,d.y))},T=y===lt.Right&&!p||y===lt.Left&&!x,R=y===lt.Down&&!b||y===lt.Up&&!g;if(T&&k.x!==d.x){const M=v.scrollLeft+f.x,D=y===lt.Right&&M<=S.x||y===lt.Left&&M>=C.x;if(D&&!f.y){v.scrollTo({left:M,behavior:o});return}D?m.x=v.scrollLeft-M:m.x=y===lt.Right?v.scrollLeft-S.x:v.scrollLeft-C.x,m.x&&v.scrollBy({left:-m.x,behavior:o});break}else if(R&&k.y!==d.y){const M=v.scrollTop+f.y,D=y===lt.Down&&M<=S.y||y===lt.Up&&M>=C.y;if(D&&!f.x){v.scrollTo({top:M,behavior:o});return}D?m.y=v.scrollTop-M:m.y=y===lt.Down?v.scrollTop-S.y:v.scrollTop-C.y,m.y&&v.scrollBy({top:-m.y,behavior:o});break}}this.handleMove(t,Uc(Cf(d,this.referenceCoordinates),m))}}}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()}}ck.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=d9,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 WR(e){return!!(e&&"distance"in e)}function UR(e){return!!(e&&"delay"in e)}class uk{constructor(t,n,r){var i;r===void 0&&(r=Que(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=od(a),this.documentListeners=new Bh(this.document),this.listeners=new Bh(r),this.windowListeners=new Bh(jr(a)),this.initialCoordinates=(i=s2(s))!=null?i:$i,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),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(Yr.Resize,this.handleCancel),this.windowListeners.add(Yr.DragStart,HR),this.windowListeners.add(Yr.VisibilityChange,this.handleCancel),this.windowListeners.add(Yr.ContextMenu,HR),this.documentListeners.add(Yr.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(UR(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(WR(n)){this.handlePending(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)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(Yr.Click,Jue,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(Yr.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=s2(t))!=null?n:$i,c=Cf(i,l);if(!r&&o){if(WR(o)){if(o.tolerance!=null&&b_(c,o.tolerance))return this.handleCancel();if(b_(c,o.distance))return this.handleStart()}if(UR(o)&&b_(c,o.tolerance))return this.handleCancel();this.handlePending(o,c);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===lt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const ede={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class dk extends uk{constructor(t){const{event:n}=t,r=od(n.target);super(t,ede,r)}}dk.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 tde={move:{name:"mousemove"},end:{name:"mouseup"}};var a2;(function(e){e[e.RightClick=2]="RightClick"})(a2||(a2={}));class nde extends uk{constructor(t){super(t,tde,od(t.event.target))}}nde.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===a2.RightClick?!1:(r==null||r({event:n}),!0)}}];const w_={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class rde extends uk{constructor(t){super(t,w_)}static setup(){return window.addEventListener(w_.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(w_.move.name,t)};function t(){}}}rde.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 Fh;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Fh||(Fh={}));var zv;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(zv||(zv={}));function ide(e){let{acceleration:t,activator:n=Fh.Pointer,canScroll:r,draggingRect:i,enabled:s,interval:a=5,order:o=zv.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:h,delta:d,threshold:f}=e;const m=ode({delta:d,disabled:!s}),[_,v]=gue(),y=w.useRef({x:0,y:0}),g=w.useRef({x:0,y:0}),p=w.useMemo(()=>{switch(n){case Fh.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case Fh.DraggableRect:return i}},[n,i,l]),x=w.useRef(null),b=w.useCallback(()=>{const C=x.current;if(!C)return;const E=y.current.x*g.current.x,k=y.current.y*g.current.y;C.scrollBy(E,k)},[]),S=w.useMemo(()=>o===zv.TreeOrder?[...c].reverse():c,[o,c]);w.useEffect(()=>{if(!s||!c.length||!p){v();return}for(const C of S){if((r==null?void 0:r(C))===!1)continue;const E=c.indexOf(C),k=h[E];if(!k)continue;const{direction:T,speed:R}=Vue(C,k,p,t,f);for(const M of["x","y"])m[M][T[M]]||(R[M]=0,T[M]=0);if(R.x>0||R.y>0){v(),x.current=C,_(b,a),y.current=R,g.current=T;return}}y.current={x:0,y:0},g.current={x:0,y:0},v()},[t,b,r,v,s,a,JSON.stringify(p),JSON.stringify(m),_,c,S,h,JSON.stringify(f)])}const sde={x:{[An.Backward]:!1,[An.Forward]:!1},y:{[An.Backward]:!1,[An.Forward]:!1}};function ode(e){let{delta:t,disabled:n}=e;const r=i2(t);return Rp(i=>{if(n||!r||!i)return sde;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[An.Backward]:i.x[An.Backward]||s.x===-1,[An.Forward]:i.x[An.Forward]||s.x===1},y:{[An.Backward]:i.y[An.Backward]||s.y===-1,[An.Forward]:i.y[An.Forward]||s.y===1}}},[n,t,r])}function ade(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Rp(i=>{var s;return t==null?null:(s=r??i)!=null?s:null},[r,t])}function lde(e,t){return w.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 Ef;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Ef||(Ef={}));var l2;(function(e){e.Optimized="optimized"})(l2||(l2={}));const VR=new Map;function cde(e,t){let{dragging:n,dependencies:r,config:i}=t;const[s,a]=w.useState(null),{frequency:o,measure:l,strategy:c}=i,h=w.useRef(e),d=y(),f=Sf(d),m=w.useCallback(function(g){g===void 0&&(g=[]),!f.current&&a(p=>p===null?g:p.concat(g.filter(x=>!p.includes(x))))},[f]),_=w.useRef(null),v=Rp(g=>{if(d&&!n)return VR;if(!g||g===VR||h.current!==e||s!=null){const p=new Map;for(let x of e){if(!x)continue;if(s&&s.length>0&&!s.includes(x.id)&&x.rect.current){p.set(x.id,x.rect.current);continue}const b=x.node.current,S=b?new lk(l(b),b):null;x.rect.current=S,S&&p.set(x.id,S)}return p}return g},[e,s,n,d,l]);return w.useEffect(()=>{h.current=e},[e]),w.useEffect(()=>{d||m()},[n,d]),w.useEffect(()=>{s&&s.length>0&&a(null)},[JSON.stringify(s)]),w.useEffect(()=>{d||typeof o!="number"||_.current!==null||(_.current=setTimeout(()=>{m(),_.current=null},o))},[o,d,m,...r]),{droppableRects:v,measureDroppableContainers:m,measuringScheduled:s!=null};function y(){switch(c){case Ef.Always:return!1;case Ef.BeforeDragging:return n;default:return!n}}}function h9(e,t){return Rp(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function ude(e,t){return h9(e,t)}function dde(e){let{callback:t,disabled:n}=e;const r=ok(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function D1(e){let{callback:t,disabled:n}=e;const r=ok(t),i=w.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function hde(e){return new lk(ad(e),e)}function qR(e,t,n){t===void 0&&(t=hde);const[r,i]=w.useState(null);function s(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l??n)!=null?c:null}const h=t(e);return JSON.stringify(l)===JSON.stringify(h)?l:h})}const a=dde({callback(l){if(e)for(const c of l){const{type:h,target:d}=c;if(h==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),o=D1({callback:s});return vs(()=>{s(),e?(o==null||o.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(o==null||o.disconnect(),a==null||a.disconnect())},[e]),r}function fde(e){const t=h9(e);return i9(e,t)}const GR=[];function pde(e){const t=w.useRef(e),n=Rp(r=>e?r&&r!==GR&&e&&t.current&&e.parentNode===t.current.parentNode?r:j1(e):GR,[e]);return w.useEffect(()=>{t.current=e},[e]),n}function mde(e){const[t,n]=w.useState(null),r=w.useRef(e),i=w.useCallback(s=>{const a=__(s.target);a&&n(o=>o?(o.set(a,o2(a)),new Map(o)):null)},[]);return w.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,o2(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]),w.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,a)=>Uc(s,a),$i):u9(e):$i,[e,t])}function KR(e,t){t===void 0&&(t=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},t),w.useEffect(()=>{const r=e!==$i;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Cf(e,n.current):$i}function gde(e){w.useEffect(()=>{if(!A1)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 vde(e,t){return w.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:s}=r;return n[i]=a=>{s(a,t)},n},{}),[e,t])}function f9(e){return w.useMemo(()=>e?zue(e):null,[e])}const YR=[];function yde(e,t){t===void 0&&(t=ad);const[n]=e,r=f9(n?jr(n):null),[i,s]=w.useState(YR);function a(){s(()=>e.length?e.map(l=>l9(l)?r:new lk(t(l),l)):YR)}const o=D1({callback:a});return vs(()=>{o==null||o.disconnect(),a(),e.forEach(l=>o==null?void 0:o.observe(l))},[e]),i}function xde(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Tp(t)?t:e}function _de(e){let{measure:t}=e;const[n,r]=w.useState(null),i=w.useCallback(c=>{for(const{target:h}of c)if(Tp(h)){r(d=>{const f=t(h);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),s=D1({callback:i}),a=w.useCallback(c=>{const h=xde(c);s==null||s.disconnect(),h&&(s==null||s.observe(h)),r(h?t(h):null)},[t,s]),[o,l]=Bv(a);return w.useMemo(()=>({nodeRef:o,rect:n,setRef:l}),[n,o,l])}const bde=[{sensor:dk,options:{}},{sensor:ck,options:{}}],wde={current:{}},wg={draggable:{measure:zR},droppable:{measure:zR,strategy:Ef.WhileDragging,frequency:l2.Optimized},dragOverlay:{measure:ad}};class zh 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 Sde={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new zh,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Fv},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:wg,measureDroppableContainers:Fv,windowRect:null,measuringScheduled:!1},Cde={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Fv,draggableNodes:new Map,over:null,measureDroppableContainers:Fv},L1=w.createContext(Cde),p9=w.createContext(Sde);function kde(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new zh}}}function Ede(e,t){switch(t.type){case wn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case wn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case wn.DragEnd:case wn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case wn.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new zh(e.droppable.containers);return i.set(r,n),{...e,droppable:{...e.droppable,containers:i}}}case wn.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 zh(e.droppable.containers);return a.set(n,{...s,disabled:i}),{...e,droppable:{...e.droppable,containers:a}}}case wn.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new zh(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Tde(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext(L1),s=i2(r),a=i2(n==null?void 0:n.id);return w.useEffect(()=>{if(!t&&!r&&s&&a!=null){if(!ak(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 h of[l.current,c.current]){if(!h)continue;const d=xue(h);if(d){d.focus();break}}})}},[r,t,i,a,s]),null}function Rde(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((i,s)=>s({transform:i,...r}),n):n}function Mde(e){return w.useMemo(()=>({draggable:{...wg.draggable,...e==null?void 0:e.draggable},droppable:{...wg.droppable,...e==null?void 0:e.droppable},dragOverlay:{...wg.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 Ade(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const s=w.useRef(!1),{x:a,y:o}=typeof i=="boolean"?{x:i,y:i}:i;vs(()=>{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 h=n(c),d=i9(h,r);if(a||(d.x=0),o||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=s9(c);f&&f.scrollBy({top:d.y,left:d.x})}},[t,a,o,r,n])}const m9=w.createContext({...$i,scaleX:1,scaleY:1});var So;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(So||(So={}));const jde=w.memo(function(t){var n,r,i,s;let{id:a,accessibility:o,autoScroll:l=!0,children:c,sensors:h=bde,collisionDetection:d=Nue,measuring:f,modifiers:m,..._}=t;const v=w.useReducer(Ede,void 0,kde),[y,g]=v,[p,x]=kue(),[b,S]=w.useState(So.Uninitialized),C=b===So.Initialized,{draggable:{active:E,nodes:k,translate:T},droppable:{containers:R}}=y,M=E!=null?k.get(E):null,D=w.useRef({initial:null,translated:null}),N=w.useMemo(()=>{var st;return E!=null?{id:E,data:(st=M==null?void 0:M.data)!=null?st:wde,rect:D}:null},[E,M]),L=w.useRef(null),[P,I]=w.useState(null),[z,O]=w.useState(null),A=Sf(_,Object.values(_)),j=Mp("DndDescribedBy",a),F=w.useMemo(()=>R.getEnabled(),[R]),H=Mde(f),{droppableRects:B,measureDroppableContainers:G,measuringScheduled:Z}=cde(F,{dragging:C,dependencies:[T.x,T.y],config:H.droppable}),X=ade(k,E),W=w.useMemo(()=>z?s2(z):null,[z]),$=un(),V=ude(X,H.draggable.measure);Ade({activeNode:E!=null?k.get(E):null,config:$.layoutShiftCompensation,initialRect:V,measure:H.draggable.measure});const U=qR(X,H.draggable.measure,V),Q=qR(X?X.parentElement:null),q=w.useRef({activatorEvent:null,active:null,activeNode:X,collisionRect:null,collisions:null,droppableRects:B,draggableNodes:k,draggingNode:null,draggingNodeRect:null,droppableContainers:R,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ie=R.getNodeFor((n=q.current.over)==null?void 0:n.id),re=_de({measure:H.dragOverlay.measure}),ce=(r=re.nodeRef.current)!=null?r:X,ye=C?(i=re.rect)!=null?i:U:null,le=!!(re.nodeRef.current&&re.rect),Re=fde(le?null:U),Ae=f9(ce?jr(ce):null),_e=pde(C?ie??X:null),Ce=yde(_e),oe=Rde(m,{transform:{x:T.x-Re.x,y:T.y-Re.y,scaleX:1,scaleY:1},activatorEvent:z,active:N,activeNodeRect:U,containerNodeRect:Q,draggingNodeRect:ye,over:q.current.over,overlayNodeRect:re.rect,scrollableAncestors:_e,scrollableAncestorRects:Ce,windowRect:Ae}),te=W?Uc(W,T):null,se=mde(_e),ue=KR(se),Y=KR(se,[U]),ne=Uc(oe,ue),ae=ye?Iue(ye,oe):null,he=N&&ae?d({active:N,collisionRect:ae,droppableRects:B,droppableContainers:F,pointerCoordinates:te}):null,be=r9(he,"id"),[ve,xe]=w.useState(null),Ue=le?oe:Uc(oe,Y),Be=Pue(Ue,(s=ve==null?void 0:ve.rect)!=null?s:null,U),Le=w.useRef(null),Ne=w.useCallback((st,xt)=>{let{sensor:Jt,options:dn}=xt;if(L.current==null)return;const Lt=k.get(L.current);if(!Lt)return;const zt=st.nativeEvent,Ht=new Jt({active:L.current,activeNode:Lt,event:zt,options:dn,context:q,onAbort(kt){if(!k.get(kt))return;const{onDragAbort:tt}=A.current,Xe={id:kt};tt==null||tt(Xe),p({type:"onDragAbort",event:Xe})},onPending(kt,hn,tt,Xe){if(!k.get(kt))return;const{onDragPending:_t}=A.current,on={id:kt,constraint:hn,initialCoordinates:tt,offset:Xe};_t==null||_t(on),p({type:"onDragPending",event:on})},onStart(kt){const hn=L.current;if(hn==null)return;const tt=k.get(hn);if(!tt)return;const{onDragStart:Xe}=A.current,Ve={activatorEvent:zt,active:{id:hn,data:tt.data,rect:D}};$r.unstable_batchedUpdates(()=>{Xe==null||Xe(Ve),S(So.Initializing),g({type:wn.DragStart,initialCoordinates:kt,active:hn}),p({type:"onDragStart",event:Ve}),I(Le.current),O(zt)})},onMove(kt){g({type:wn.DragMove,coordinates:kt})},onEnd:_n(wn.DragEnd),onCancel:_n(wn.DragCancel)});Le.current=Ht;function _n(kt){return async function(){const{active:tt,collisions:Xe,over:Ve,scrollAdjustedTranslate:_t}=q.current;let on=null;if(tt&&_t){const{cancelDrop:an}=A.current;on={activatorEvent:zt,active:tt,collisions:Xe,delta:_t,over:Ve},kt===wn.DragEnd&&typeof an=="function"&&await Promise.resolve(an(on))&&(kt=wn.DragCancel)}L.current=null,$r.unstable_batchedUpdates(()=>{g({type:kt}),S(So.Uninitialized),xe(null),I(null),O(null),Le.current=null;const an=kt===wn.DragEnd?"onDragEnd":"onDragCancel";if(on){const On=A.current[an];On==null||On(on),p({type:an,event:on})}})}}},[k]),yt=w.useCallback((st,xt)=>(Jt,dn)=>{const Lt=Jt.nativeEvent,zt=k.get(dn);if(L.current!==null||!zt||Lt.dndKit||Lt.defaultPrevented)return;const Ht={active:zt};st(Jt,xt.options,Ht)===!0&&(Lt.dndKit={capturedBy:xt.sensor},L.current=dn,Ne(Jt,xt))},[k,Ne]),Me=lde(h,yt);gde(h),vs(()=>{U&&b===So.Initializing&&S(So.Initialized)},[U,b]),w.useEffect(()=>{const{onDragMove:st}=A.current,{active:xt,activatorEvent:Jt,collisions:dn,over:Lt}=q.current;if(!xt||!Jt)return;const zt={active:xt,activatorEvent:Jt,collisions:dn,delta:{x:ne.x,y:ne.y},over:Lt};$r.unstable_batchedUpdates(()=>{st==null||st(zt),p({type:"onDragMove",event:zt})})},[ne.x,ne.y]),w.useEffect(()=>{const{active:st,activatorEvent:xt,collisions:Jt,droppableContainers:dn,scrollAdjustedTranslate:Lt}=q.current;if(!st||L.current==null||!xt||!Lt)return;const{onDragOver:zt}=A.current,Ht=dn.get(be),_n=Ht&&Ht.rect.current?{id:Ht.id,rect:Ht.rect.current,data:Ht.data,disabled:Ht.disabled}:null,kt={active:st,activatorEvent:xt,collisions:Jt,delta:{x:Lt.x,y:Lt.y},over:_n};$r.unstable_batchedUpdates(()=>{xe(_n),zt==null||zt(kt),p({type:"onDragOver",event:kt})})},[be]),vs(()=>{q.current={activatorEvent:z,active:N,activeNode:X,collisionRect:ae,collisions:he,droppableRects:B,draggableNodes:k,draggingNode:ce,draggingNodeRect:ye,droppableContainers:R,over:ve,scrollableAncestors:_e,scrollAdjustedTranslate:ne},D.current={initial:ye,translated:ae}},[N,X,he,ae,k,ce,ye,B,R,ve,_e,ne]),ide({...$,delta:T,draggingRect:ae,pointerCoordinates:te,scrollableAncestors:_e,scrollableAncestorRects:Ce});const Fe=w.useMemo(()=>({active:N,activeNode:X,activeNodeRect:U,activatorEvent:z,collisions:he,containerNodeRect:Q,dragOverlay:re,draggableNodes:k,droppableContainers:R,droppableRects:B,over:ve,measureDroppableContainers:G,scrollableAncestors:_e,scrollableAncestorRects:Ce,measuringConfiguration:H,measuringScheduled:Z,windowRect:Ae}),[N,X,U,z,he,Q,re,k,R,B,ve,G,_e,Ce,H,Z,Ae]),et=w.useMemo(()=>({activatorEvent:z,activators:Me,active:N,activeNodeRect:U,ariaDescribedById:{draggable:j},dispatch:g,draggableNodes:k,over:ve,measureDroppableContainers:G}),[z,Me,N,U,g,j,k,ve,G]);return ft.createElement(e9.Provider,{value:x},ft.createElement(L1.Provider,{value:et},ft.createElement(p9.Provider,{value:Fe},ft.createElement(m9.Provider,{value:Be},c)),ft.createElement(Tde,{disabled:(o==null?void 0:o.restoreFocus)===!1})),ft.createElement(Rue,{...o,hiddenTextDescribedById:j}));function un(){const st=(P==null?void 0:P.autoScrollEnabled)===!1,xt=typeof l=="object"?l.enabled===!1:l===!1,Jt=C&&!st&&!xt;return typeof l=="object"?{...l,enabled:Jt}:{enabled:Jt}}}),Dde=w.createContext(null),XR="button",Lde="Draggable";function Nde(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const s=Mp(Lde),{activators:a,activatorEvent:o,active:l,activeNodeRect:c,ariaDescribedById:h,draggableNodes:d,over:f}=w.useContext(L1),{role:m=XR,roleDescription:_="draggable",tabIndex:v=0}=i??{},y=(l==null?void 0:l.id)===t,g=w.useContext(y?m9:Dde),[p,x]=Bv(),[b,S]=Bv(),C=vde(a,t),E=Sf(n);vs(()=>(d.set(t,{id:t,key:s,node:p,activatorNode:b,data:E}),()=>{const T=d.get(t);T&&T.key===s&&d.delete(t)}),[d,t]);const k=w.useMemo(()=>({role:m,tabIndex:v,"aria-disabled":r,"aria-pressed":y&&m===XR?!0:void 0,"aria-roledescription":_,"aria-describedby":h.draggable}),[r,m,v,y,_,h.draggable]);return{active:l,activatorEvent:o,activeNodeRect:c,attributes:k,isDragging:y,listeners:r?void 0:C,node:p,over:f,setNodeRef:x,setActivatorNodeRef:S,transform:g}}function Pde(){return w.useContext(p9)}const Ode="Droppable",Ide={timeout:25};function $de(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const s=Mp(Ode),{active:a,dispatch:o,over:l,measureDroppableContainers:c}=w.useContext(L1),h=w.useRef({disabled:n}),d=w.useRef(!1),f=w.useRef(null),m=w.useRef(null),{disabled:_,updateMeasurementsFor:v,timeout:y}={...Ide,...i},g=Sf(v??r),p=w.useCallback(()=>{if(!d.current){d.current=!0;return}m.current!=null&&clearTimeout(m.current),m.current=setTimeout(()=>{c(Array.isArray(g.current)?g.current:[g.current]),m.current=null},y)},[y]),x=D1({callback:p,disabled:_||!a}),b=w.useCallback((k,T)=>{x&&(T&&(x.unobserve(T),d.current=!1),k&&x.observe(k))},[x]),[S,C]=Bv(b),E=Sf(t);return w.useEffect(()=>{!x||!S.current||(x.disconnect(),d.current=!1,x.observe(S.current))},[S,x]),w.useEffect(()=>(o({type:wn.RegisterDroppable,element:{id:r,key:s,disabled:n,node:S,rect:f,data:E}}),()=>o({type:wn.UnregisterDroppable,key:s,id:r})),[r]),w.useEffect(()=>{n!==h.current.disabled&&(o({type:wn.SetDroppableDisabled,id:r,key:s,disabled:n}),h.current.disabled=n)},[r,s,n,o]),{active:a,rect:f,isOver:(l==null?void 0:l.id)===r,node:S,over:l,setNodeRef:C}}function hk(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Bde(e,t){return e.reduce((n,r,i)=>{const s=t.get(r);return s&&(n[i]=s),n},Array(e.length))}function Lm(e){return e!==null&&e>=0}function Fde(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const s=hk(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}},Nm={scaleX:1,scaleY:1},Hde=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:nn&&i<=a?{x:0,y:-o.height-l,...Nm}:i=a?{x:0,y:o.height+l,...Nm}:{x:0,y:0,...Nm}};function Wde(e,t,n){const r=e[t],i=e[t-1],s=e[t+1];return r?nr.map(C=>typeof C=="object"&&"id"in C?C.id:C),[r]),_=a!=null,v=a?m.indexOf(a.id):-1,y=c?m.indexOf(c.id):-1,g=w.useRef(m),p=!Fde(m,g.current),x=y!==-1&&v===-1||p,b=zde(s);vs(()=>{p&&_&&h(m)},[p,m,_,h]),w.useEffect(()=>{g.current=m},[m]);const S=w.useMemo(()=>({activeIndex:v,containerId:d,disabled:b,disableTransforms:x,items:m,overIndex:y,useDragOverlay:f,sortedRects:Bde(m,l),strategy:i}),[v,d,b.draggable,b.droppable,x,m,y,l,f,i]);return ft.createElement(y9.Provider,{value:S},t)}const Vde=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return hk(n,r,i).indexOf(t)},qde=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},Gde={duration:200,easing:"ease"},x9="transform",Kde=kf.Transition.toString({property:x9,duration:0,easing:"linear"}),Yde={roleDescription:"sortable"};function Xde(e){let{disabled:t,index:n,node:r,rect:i}=e;const[s,a]=w.useState(null),o=w.useRef(n);return vs(()=>{if(!t&&n!==o.current&&r.current){const l=i.current;if(l){const c=ad(r.current,{ignoreTransform:!0}),h={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(h.x||h.y)&&a(h)}}n!==o.current&&(o.current=n)},[t,n,r,i]),w.useEffect(()=>{s&&a(null)},[s]),s}function Qde(e){let{animateLayoutChanges:t=qde,attributes:n,disabled:r,data:i,getNewIndex:s=Vde,id:a,strategy:o,resizeObserverConfig:l,transition:c=Gde}=e;const{items:h,containerId:d,activeIndex:f,disabled:m,disableTransforms:_,sortedRects:v,overIndex:y,useDragOverlay:g,strategy:p}=w.useContext(y9),x=Jde(r,m),b=h.indexOf(a),S=w.useMemo(()=>({sortable:{containerId:d,index:b,items:h},...i}),[d,i,b,h]),C=w.useMemo(()=>h.slice(h.indexOf(a)),[h,a]),{rect:E,node:k,isOver:T,setNodeRef:R}=$de({id:a,data:S,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:C,...l}}),{active:M,activatorEvent:D,activeNodeRect:N,attributes:L,setNodeRef:P,listeners:I,isDragging:z,over:O,setActivatorNodeRef:A,transform:j}=Nde({id:a,data:S,attributes:{...Yde,...n},disabled:x.draggable}),F=mue(R,P),H=!!M,B=H&&!_&&Lm(f)&&Lm(y),G=!g&&z,Z=G&&B?j:null,W=B?Z??(o??p)({rects:v,activeNodeRect:N,activeIndex:f,overIndex:y,index:b}):null,$=Lm(f)&&Lm(y)?s({id:a,items:h,activeIndex:f,overIndex:y}):b,V=M==null?void 0:M.id,U=w.useRef({activeId:V,items:h,newIndex:$,containerId:d}),Q=h!==U.current.items,q=t({active:M,containerId:d,isDragging:z,isSorting:H,id:a,index:b,items:h,newIndex:U.current.newIndex,previousItems:U.current.items,previousContainerId:U.current.containerId,transition:c,wasDragging:U.current.activeId!=null}),ie=Xde({disabled:!q,index:b,node:k,rect:E});return w.useEffect(()=>{H&&U.current.newIndex!==$&&(U.current.newIndex=$),d!==U.current.containerId&&(U.current.containerId=d),h!==U.current.items&&(U.current.items=h)},[H,$,d,h]),w.useEffect(()=>{if(V===U.current.activeId)return;if(V&&!U.current.activeId){U.current.activeId=V;return}const ce=setTimeout(()=>{U.current.activeId=V},50);return()=>clearTimeout(ce)},[V]),{active:M,activeIndex:f,attributes:L,data:S,rect:E,index:b,newIndex:$,items:h,isOver:T,isSorting:H,isDragging:z,listeners:I,node:k,overIndex:y,over:O,setNodeRef:F,setActivatorNodeRef:A,setDroppableNodeRef:R,setDraggableNodeRef:P,transform:ie??W,transition:re()};function re(){if(ie||Q&&U.current.newIndex===b)return Kde;if(!(G&&!ak(D)||!c)&&(H||q))return kf.Transition.toString({...c,property:x9})}}function Jde(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 Hv(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 Zde=[lt.Down,lt.Right,lt.Up,lt.Left],ehe=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:s,over:a,scrollableAncestors:o}}=t;if(Zde.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const f=i.get(d.id);if(f)switch(e.code){case lt.Down:r.topf.top&&l.push(d);break;case lt.Left:r.left>f.left&&l.push(d);break;case lt.Right:r.left1&&(h=c[1].id),h!=null){const d=s.get(n.id),f=s.get(h),m=f?i.get(f.id):null,_=f==null?void 0:f.node.current;if(_&&m&&d&&f){const y=j1(_).some((C,E)=>o[E]!==C),g=_9(d,f),p=the(d,f),x=y||!g?{x:0,y:0}:{x:p?r.width-m.width:0,y:p?r.height-m.height:0},b={x:m.left,y:m.top};return x.x&&x.y?b:Cf(b,x)}}}};function _9(e,t){return!Hv(e)||!Hv(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function the(e,t){return!Hv(e)||!Hv(t)||!_9(e,t)?!1:e.data.current.sortable.index{const t=che(e);t&&t.forEach(n=>uhe(n))},ihe=e=>{e.forEach(t=>{t.target===ca&&ohe(),Mr.has(t.target)&&Bl(t.target)})};function she(e){const t=c2.get(e);t==null||t.disconnect();let n=Mr.get(e),r=0;const i=5;n||(n=ku(e),Mr.set(e,n));const{offsetWidth:s,offsetHeight:a}=ca,l=[n.top-i,s-(n.left+i+n.width),a-(n.top+i+n.height),n.left-i].map(h=>`${-1*Math.floor(h)}px`).join(" "),c=new IntersectionObserver(()=>{++r>1&&Bl(e)},{root:ca,threshold:1,rootMargin:l});c.observe(e),c2.set(e,c)}function Bl(e){clearTimeout(Wv.get(e));const t=N1(e),n=Rf(t)?500:t.duration;Wv.set(e,setTimeout(async()=>{const r=yl.get(e);try{await(r==null?void 0:r.finished),Mr.set(e,ku(e)),she(e)}catch{}},n))}function ohe(){clearTimeout(Wv.get(ca)),Wv.set(ca,setTimeout(()=>{b9.forEach(e=>k9(e,t=>w9(()=>Bl(t))))},100))}function ahe(e){setTimeout(()=>{nhe.set(e,setInterval(()=>w9(Bl.bind(null,e)),2e3))},Math.round(2e3*Math.random()))}function w9(e){typeof requestIdleCallback=="function"?requestIdleCallback(()=>e()):requestAnimationFrame(()=>e())}let u2,Rc;const lhe=typeof window<"u"&&"ResizeObserver"in window;lhe&&(ca=document.documentElement,u2=new MutationObserver(rhe),Rc=new ResizeObserver(ihe),window.addEventListener("scroll",()=>{pk=window.scrollY,fk=window.scrollX}),Rc.observe(ca));function che(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;sn(e,Cu.has(e)));for(let n=0;ni(r,Cu.has(r)))}}function gk(e){return Array.isArray(e)?e:[e]}function Rf(e){return typeof e=="function"}function hhe(e){const t=Mr.get(e),n=ku(e);if(!mk(e))return Mr.set(e,n);let r;if(!t)return;const i=N1(e);if(typeof i!="function"){const s=t.left-n.left,a=t.top-n.top,[o,l,c,h]=S9(e,t,n),d={transform:`translate(${s}px, ${a}px)`},f={transform:"translate(0, 0)"};o!==l&&(d.width=`${o}px`,f.width=`${l}px`),c!==h&&(d.height=`${c}px`,f.height=`${h}px`),r=e.animate([d,f],{duration:i.duration,easing:i.easing})}else{const[s]=gk(i(e,"remain",t,n));r=new Animation(s),r.play()}yl.set(e,r),Mr.set(e,n),r.addEventListener("finish",Bl.bind(null,e))}function QR(e){Uv in e&&delete e[Uv];const t=ku(e);Mr.set(e,t);const n=N1(e);if(!mk(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]=gk(n(e,"add",t));r=new Animation(i),r.play()}yl.set(e,r),r.addEventListener("finish",Bl.bind(null,e))}function JR(e,t){var n;e.remove(),Mr.delete(e),Su.delete(e),yl.delete(e),(n=c2.get(e))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(Tf in e&&delete e[Tf],Object.defineProperty(e,Uv,{value:!0,configurable:!0}),t&&e instanceof HTMLElement)for(const r in t)e.style[r]=""},0)}function fhe(e){var t;if(!Su.has(e)||!Mr.has(e))return;const[n,r]=Su.get(e);Object.defineProperty(e,Tf,{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=C9(e))===null||t===void 0||t.appendChild(e),!mk(e))return JR(e);const[a,o,l,c]=mhe(e),h=N1(e),d=Mr.get(e);(i!==fk||s!==pk)&&phe(e,i,s,h);let f,m={position:"absolute",top:`${a}px`,left:`${o}px`,width:`${l}px`,height:`${c}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Rf(h))Object.assign(e.style,m),f=e.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:h.duration,easing:"ease-out"});else{const[_,v]=gk(h(e,"remove",d));(v==null?void 0:v.styleReset)!==!1&&(m=(v==null?void 0:v.styleReset)||m,Object.assign(e.style,m)),f=new Animation(_),f.play()}yl.set(e,f),f.addEventListener("finish",JR.bind(null,e,m))}function phe(e,t,n,r){const i=fk-t,s=pk-n,a=document.documentElement.style.scrollBehavior;if(getComputedStyle(ca).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,h=l.clientWidth;const d=performance.now();function f(){requestAnimationFrame(()=>{if(!Rf(r)){const m=c-l.clientHeight,_=h-l.clientWidth;d+r.duration>performance.now()?(window.scrollTo({left:window.scrollX-_,top:window.scrollY-m}),c=l.clientHeight,h=l.clientWidth,f()):document.documentElement.style.scrollBehavior=a}})}f()}function mhe(e){const t=Mr.get(e),[n,,r]=S9(e,t,ku(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)||ku(i),o=Math.round(t.top-a.top)-Ki(s.borderTopWidth),l=Math.round(t.left-a.left)-Ki(s.borderLeftWidth);return[o,l,n,r]}function ghe(e,t={}){return u2&&Rc&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Rf(t)&&!t.disrespectUserMotionPreference||(vh.add(e),getComputedStyle(e).position==="static"&&Object.assign(e.style,{position:"relative"}),k9(e,Bl,ahe,i=>Rc==null?void 0:Rc.observe(i)),Rf(t)?Cu.set(e,t):Cu.set(e,{duration:250,easing:"ease-in-out",...t}),u2.observe(e,{childList:!0}),b9.add(e))),Object.freeze({parent:e,enable:()=>{vh.add(e)},disable:()=>{vh.delete(e)},isEnabled:()=>vh.has(e)})}function P1(e){const[t,n]=w.useState(),r=w.useMemo(()=>e,[]),i=w.useCallback(a=>{a instanceof HTMLElement?n(ghe(a,r)):n(void 0)},[r]),s=w.useCallback(a=>{t&&(a?t.enable():t.disable())},[t]);return[i,s]}function vhe({id:e,disabled:t,className:n,children:r}){const{attributes:i,listeners:s,setNodeRef:a,transform:o,transition:l}=Qde({id:e,disabled:t});i.role="listitem";const c={transform:kf.Transform.toString(o&&{...o,scaleY:1}),transition:l};return u.jsxs("li",{ref:a,style:c,...i,className:J("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:[u.jsx("div",{...s,title:"Drag to reorder",className:J("text-muted-foreground my-auto",t?"cursor-not-allowed opacity-50":"cursor-grab hover:text-primary hover:scale-110"),children:u.jsx(YX,{className:"size-6"})}),r]})}function yhe({onDragEnd:e,className:t,children:n,ids:r}){const[i,s]=P1(),a=Mue($R(dk),$R(ck,{coordinateGetter:ehe})),o=l=>{e(l),setTimeout(()=>{s(!0)},1)};return u.jsx(jde,{sensors:a,collisionDetection:jue,onDragStart:()=>s(!1),onDragCancel:()=>s(!0),onDragEnd:o,children:u.jsx(Ude,{items:r,strategy:Hde,children:u.jsx("ol",{ref:i,className:t,children:n})})})}var E9="abcdefghijklmnopqrstuvwxyz",T9="ABCDEFGHIJKLMNOPQRSTUVWXYZ",R9="0123456789",xhe="346789ABCDEFGHJKLMNPQRTUVWXYabcdefghijkmnpqrtwxyz",_he="6789BCDFGHJKLMNPQRTWbcdfghjkmnpqrtwz";const bhe=R9,whe=E9,She=T9;var Che=bhe+whe+She,khe={lowercase:E9,uppercase:T9,numbers:R9,nolookalikes:xhe,nolookalikesSafe:_he,alphanumeric:Che};let Ehe=e=>crypto.getRandomValues(new Uint8Array(e)),The=(e,t,n)=>{let r=(2<{let a="";for(;;){let o=n(i),l=i|0;for(;l--;)if(a+=e[o[l]&r]||"",a.length>=s)return a}}},Rhe=(e,t=21)=>The(e,t|0,Ehe);const Mhe=Rhe(khe.alphanumeric,21);function Ahe(){var E,k;const[e,t]=w.useState(!1),[n,r]=w.useState(),i=lp(),{hasPerm:s}=fr(),[a,o]=w.useState(!1),[l,c]=w.useState(null),[h,d]=w.useState(!1),f=Tt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),m=Tt({method:"POST",path:"/settings/banTemplates",throwGenericErrors:!0}),_=fp("/settings/banTemplates",async()=>{const T=await f({});if(!T)throw new Error("No data returned");return T},{isPaused:()=>a||!!l||e}),v=async T=>{o(!0),c(null),d(!1);try{const R=await _.mutate(T,!1);if(!await m({data:R}))throw new Error("No data returned");d(!0)}catch(R){R instanceof Qw||R instanceof Error?c(R.message):c(JSON.stringify(R))}finally{o(!1)}};w.useEffect(()=>{if(!h)return;const T=setTimeout(()=>{d(!1)},5e3);return()=>clearTimeout(T)},[h]);const y=T=>{const{active:R,over:M}=T;M&&R.id!==M.id&&v(D=>{const N=D.findIndex(P=>P.id===R.id),L=D.findIndex(P=>P.id===M.id);return hk(D,N,L)})},g=({id:T,reason:R,duration:M})=>{v(T?D=>D.map(N=>N.id===T?{id:T,reason:R,duration:M}:N):D=>[...D,{id:Mhe(21),reason:R,duration:M}]),t(!1),r(void 0)},p=T=>{if(!T||!_.data)return;const R=_.data.find(M=>M.id===T);R&&i({title:"Remove Template",actionLabel:"Remove",confirmBtnVariant:"destructive",message:u.jsxs(u.Fragment,{children:["Are you sure you want to remove this ban template? ",u.jsx("br",{}),u.jsx("blockquote",{className:"opacity-70 italic border-l-4 pl-2",children:R.reason})]}),onConfirm:()=>{console.log("Remove confirmed",T),v(M=>M.filter(D=>D.id!==T))}})},x=T=>{!T||!_.data||(console.log("Edit item",T),r(_.data.find(R=>R.id===T)),t(!0))},b=()=>{r(void 0),t(!0)};let S;if(_.error){const T=()=>_.mutate(),R=((E=_==null?void 0:_.error)==null?void 0:E.message)??"unknown error";S=u.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error loading: ",R]}),u.jsx("br",{}),u.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else if(a)S=u.jsx("span",{className:"text-success-inlinex animate-pulse",children:"Saving..."});else if(l){const T=()=>{_.data&&v(()=>_.data)},R=l??"unknown error";S=u.jsxs("div",{className:"inline-flex flex-wrap gap-1",children:[u.jsxs("span",{className:"text-destructive-inline",children:["Error saving: ",R]}),u.jsx("br",{}),u.jsx("button",{className:"underline hover:text-accent",onClick:T,children:"Try again?"})]})}else h?S=u.jsx("span",{className:"text-success-inline",children:"Saved."}):(_.isLoading||_.isValidating)&&(S=u.jsx("span",{className:"text-muted-foreground",children:"Loading..."}));const C=s("settings.write");return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto",children:[u.jsxs("div",{className:"px-2 md:px-0",children:[u.jsx("h1",{className:"text-3xl mb-2",children:"Ban Templates"}),u.jsxs("p",{children:["Here you can configure ban reasons and durations that will appear as dropdown options when banning a player. ",u.jsx("br",{}),"This is useful for common reasons that happen frequently, like violation of your server rules. ",u.jsx("br",{}),C?u.jsxs("span",{className:"text-muted-foreground italic",children:["TIP: You can also drag and drop to reorder the list. ",u.jsx("br",{})]}):u.jsxs("span",{className:"text-warning-inline",children:["You need the ",u.jsx(Ye,{className:"text-warning-inline",children:"Settings: Change"})," permission to edit these reasons."]})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex flex-wrap justify-between text-muted-foreground px-2 md:px-0",children:[u.jsxs("span",{className:"shrink-0",children:["Configured reasons: ",((k=_.data)==null?void 0:k.length)??0]}),S]}),!_.data&&!l&&u.jsxs("div",{className:"text-muted-foreground text-lg md:text-2xl text-center my-4 px-2 md:px-0",children:[u.jsx(sn,{className:"inline animate-spin h-8"}),"Loading..."]}),_.data&&u.jsxs(yhe,{className:"space-y-2 border p-2 rounded-lg",ids:_.data.map(T=>T.id),onDragEnd:y,children:[_.data.length?_.data.map(T=>u.jsx(vhe,{id:T.id,disabled:!C,children:u.jsx(fue,{onEdit:x,onRemove:p,disabled:!C,...T})},T.id)):u.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."}),u.jsx(pue,{onClick:b,disabled:!C})]})]})]}),u.jsx(hue,{reasonData:n,onSave:g,isDialogOpen:e,setIsDialogOpen:t},n==null?void 0:n.id)]})}const zd=150;function ZR({pageName:e}){const[t,n]=w.useState(!0),[r,i]=w.useState(""),[s,a]=w.useState(!1),o=Y0(),l=Tt({method:"GET",path:`/systemLog/${e}`,throwGenericErrors:!0}),c=w.useRef(null),h=w.useRef(null),d=w.useMemo(()=>new aL.Terminal(aP),[]),f=w.useMemo(()=>new hL.FitAddon,[]),m=w.useMemo(()=>new pL.SearchAddon,[]),_=(S,C)=>{Ju(C)},v=w.useMemo(()=>new gL.WebLinksAddon(_),[]),y=Jn(zd,S=>{window.postMessage({type:"liveConsoleSearchHotkey",action:S})},{noTrailing:!0}),g=()=>{if(!h.current||!d.element||!f){console.log("refitTerminal: no containerRef.current or term.element or fitAddon");return}const S=f.proposeDimensions();S?d.resize(S.cols,S.rows):console.log("refitTerminal: no proposed dimensions")};Pi("resize",TC(100,g)),w.useEffect(()=>{if(h.current&&c.current&&!d.element){console.log("xterm init"),h.current.innerHTML="",d.loadAddon(f),d.loadAddon(m),d.loadAddon(v),d.loadAddon(new uL.CanvasAddon),d.loadAddon(new oP(c.current,h.current)),d.open(h.current),d.write("\x1B[?25l"),g();const S=Jn(zd,()=>{d.scrollLines(Math.min(1,2-d.rows))},{noTrailing:!0}),C=Jn(zd,()=>{d.scrollLines(Math.max(1,d.rows-2))},{noTrailing:!0}),E=Jn(zd,()=>{d.scrollToTop()},{noTrailing:!0}),k=Jn(zd,()=>{d.scrollToBottom()},{noTrailing:!0});d.attachCustomKeyEventHandler(T=>T.code==="F5"||T.code==="Escape"||T.code==="KeyF"&&(T.ctrlKey||T.metaKey)||T.code==="F3"?!1:T.code==="KeyC"&&(T.ctrlKey||T.metaKey)?(document.execCommand("copy"),d.clearSelection(),!1):T.code==="PageUp"?(S(),!1):T.code==="PageDown"?(C(),!1):T.code==="Home"?(E(),!1):T.code==="End"?(k(),!1):!DC(T)),l({success:(T,R)=>{n(!1),p(T.data),d.writeln(""),d.writeln("\x1B[33m[END OF LOG - REFRESH THE PAGE TO LOAD MORE]\x1B")},error:(T,R)=>{n(!1),i(T)}})}},[d]),Pi("keydown",S=>{S.code==="F5"?t&&(o(),S.preventDefault()):S.code==="Escape"?(m.clearDecorations(),a(!1)):S.code==="KeyF"&&(S.ctrlKey||S.metaKey)?(s?y("focus"):a(!0),S.preventDefault()):S.code==="F3"&&(y(S.shiftKey?"previous":"next"),S.preventDefault())});const p=S=>{const C=S.split(/\r?\n/);C.length&&!C[C.length-1]&&C.pop();for(const E of C)d.writeln(E)};let x="Console Log",b="Output of txAdmin to it's parent terminal, including usually hidden debug messages.";return e==="action"&&(x="Action Log",b="Log of all actions taken by txAdmin or any admin."),u.jsxs("div",{className:"dark text-primary flex flex-col h-full w-full bg-card border md:rounded-xl overflow-clip",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.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:[u.jsx("polyline",{points:"4 17 10 11 4 5"}),u.jsx("line",{x1:"12",x2:"20",y1:"19",y2:"19"})]}),u.jsxs("p",{className:"font-mono text-sm",children:[x," - ",u.jsx("span",{className:"text-muted-foreground",children:b})]})]})}),u.jsxs("div",{className:"flex flex-col relative grow overflow-hidden",children:[t&&!r?u.jsx("div",{className:"absolute inset-0 z-20 bg-black/60 flex items-center justify-center",children:u.jsxs("div",{className:"flex flex-col gap-6 items-center justify-center text-muted-foreground select-none",children:[u.jsx(sn,{className:"w-16 h-16 animate-spin"}),u.jsx("h2",{className:"text-3xl tracking-wider font-light animate-pulse",children:"   Loading..."})]})}):null,r&&u.jsxs("div",{className:"absolute inset-0 z-20 bg-black/60 flex flex-col gap-4 items-center justify-center",children:[u.jsxs("h2",{className:"text-2xl tracking-wider font-light text-muted-foreground select-none",children:["Error fetching ",x,":"]}),u.jsx("p",{className:"mx-8 max-w-screen-md text-destructive-inline font-mono",children:r})]}),u.jsx("div",{ref:h,className:"absolute top-1 left-2 right-0 bottom-0"}),u.jsx(sP,{show:s,setShow:a,searchAddon:m}),u.jsx("button",{ref:c,className:"absolute bottom-0 right-2 z-10 hidden opacity-75",onClick:()=>{d.scrollToBottom()},children:u.jsx(_L,{className:"w-20 h-20 animate-pulse hover:animate-none hover:scale-110"})})]})]})}const Eu=w.forwardRef(({className:e,...t},n)=>u.jsx("textarea",{className:J("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 placeholder:opacity-50",e),ref:n,...t}));Eu.displayName="Textarea";const jhe=kI,M9=w.forwardRef(({children:e},t)=>u.jsx(C1,{ref:t,asChild:!0,children:e}));M9.displayName=C1.displayName;const A9=w.forwardRef(({className:e,...t},n)=>u.jsx(T1,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(NC,{className:"h-4 w-4"})}));A9.displayName=T1.displayName;const j9=w.forwardRef(({className:e,...t},n)=>u.jsx(R1,{ref:n,className:J("flex cursor-default items-center justify-center py-1",e),...t,children:u.jsx(Dl,{className:"h-4 w-4"})}));j9.displayName=R1.displayName;const D9=w.forwardRef(({className:e,children:t,position:n="popper",...r},i)=>u.jsx(EI,{children:u.jsxs(k1,{ref:i,className:J("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:[u.jsx(A9,{}),u.jsx(TI,{className:J("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),u.jsx(j9,{})]})}));D9.displayName=k1.displayName;const d2=w.forwardRef(({className:e,children:t,...n},r)=>u.jsx(E1,{ref:r,className:J("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:u.jsx(MI,{children:t})}));d2.displayName=E1.displayName;const eM=150,tM="!add-new",Dhe=["permanent","2 hours","8 hours","1 day","2 days","1 week","2 weeks"],L9=w.forwardRef(function({banTemplates:t,disabled:n,onNavigateAway:r},i){const s=w.useRef(null),a=w.useRef(null),o=va()[1],[l,c]=w.useState("2 days"),[h,d]=w.useState("days"),f=KC();w.useImperativeHandle(i,()=>({getData:()=>{var y,g;return{reason:(y=s.current)==null?void 0:y.value.trim(),duration:l==="custom"?`${(g=a.current)==null?void 0:g.value} ${h}`:l}},clearData:()=>{!s.current||!a.current||(s.current.value="",a.current.value="",c("2 days"),d("days"))},focusReason:()=>{var y;(y=s.current)==null||y.focus()}}),[s,a,l,h]);const m=y=>{if(y===tM)o("/settings/ban-templates"),r==null||r();else{if(!t)return;const g=t.find(x=>x.id===y);if(!g)return;const p=sv(g.duration);Dhe.includes(p)?c(p):typeof g.duration=="object"&&(c("custom"),a.current.value=g.duration.value.toString(),d(g.duration.unit)),s.current.value=g.reason,setTimeout(()=>{s.current.focus()},50)}},_=w.useMemo(()=>{if(t)return t.map((y,g)=>{const p=pY(y.duration),x=y.reason.length>eM?y.reason.slice(0,eM-3)+"...":y.reason;return u.jsxs(d2,{value:y.id,className:"focus:bg-secondary focus:text-secondary-foreground",children:[u.jsx("span",{className:"inline-block pr-1 font-mono opacity-75 min-w-[4ch]",children:p})," ",x]},g)})},[t]);let v;return Array.isArray(t)?t.length?v=u.jsxs(u.Fragment,{children:[_,u.jsxs(d2,{value:tM,className:"font-bold text-warning-inline",children:["Add Ban Template",u.jsx(dl,{className:"inline mr-1 h-4"})]})]}):v=u.jsxs("div",{className:"text-warning-inline text-center p-4",children:["You do not have any template configured. ",u.jsx("br",{}),u.jsxs(fs,{href:"/settings/ban-templates",className:"cursor-pointer underline hover:text-accent",onClick:()=>{f()},children:["Add Ban Template",u.jsx(dl,{className:"inline mr-1 h-4"})]})]}):v=u.jsx("div",{className:"text-secondary-foreground text-center p-4",children:u.jsx(sn,{className:"inline animate-spin size-6"})}),u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(Tn,{htmlFor:"banReason",children:"Reason"}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx(wt,{id:"banReason",ref:s,placeholder:"The reason for the ban, rule violated, etc.",className:"w-full",disabled:n,autoFocus:!0}),u.jsxs(jhe,{onValueChange:m,disabled:n,children:[u.jsx(M9,{className:"tracking-wide",children:u.jsx("button",{className:J("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:u.jsx(BX,{className:"size-5"})})}),u.jsx(D9,{className:"tracking-wide w-[calc(100vw-1rem)] sm:max-w-screen-sm",align:"end",children:v})]})]})]}),u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(Tn,{htmlFor:"durationSelect",children:"Duration"}),u.jsxs("div",{className:"space-y-1",children:[u.jsxs(Hn,{onValueChange:c,value:l,disabled:n,children:[u.jsx(Dn,{id:"durationSelect",className:"tracking-wide",children:u.jsx(Wn,{placeholder:"Select Duration"})}),u.jsxs(Ln,{className:"tracking-wide",children:[u.jsx(Se,{value:"custom",className:"font-bold",children:"Custom (set below)"}),u.jsx(Se,{value:"2 hours",children:"2 HOURS"}),u.jsx(Se,{value:"8 hours",children:"8 HOURS"}),u.jsx(Se,{value:"1 day",children:"1 DAY"}),u.jsx(Se,{value:"2 days",children:"2 DAYS"}),u.jsx(Se,{value:"1 week",children:"1 WEEK"}),u.jsx(Se,{value:"2 weeks",children:"2 WEEKS"}),u.jsx(Se,{value:"permanent",className:"font-bold",children:"Permanent"})]})]}),u.jsxs("div",{className:"flex flex-row gap-2",children:[u.jsx(wt,{id:"durationMultiplier",type:"number",placeholder:"123",required:!0,disabled:l!=="custom"||n,ref:a}),u.jsxs(Hn,{onValueChange:d,value:h,children:[u.jsx(Dn,{className:"tracking-wide",id:"durationUnits",disabled:l!=="custom"||n,children:u.jsx(Wn,{})}),u.jsxs(Ln,{className:"tracking-wide",children:[u.jsx(Se,{value:"hours",children:"HOURS"}),u.jsx(Se,{value:"days",children:"DAYS"}),u.jsx(Se,{value:"weeks",children:"WEEKS"}),u.jsx(Se,{value:"months",children:"MONTHS"})]})]})]})]})]})]})});function Lhe(){const e=w.useRef(null),t=w.useRef(null),[n,r]=w.useState(!1),{hasPerm:i}=fr(),s=Tt({method:"GET",path:"/settings/banTemplates",throwGenericErrors:!0}),a=Tt({method:"POST",path:"/history/addLegacyBan",throwGenericErrors:!0}),o=()=>{if(!e.current||!t.current)return;const{reason:h,duration:d}=t.current.getData();if(!h||h.length<3){qe.warning("The reason must be at least 3 characters long."),t.current.focusReason();return}const f=e.current.value;if(!f){qe.warning("You must enter at least one identifier."),e.current.focus();return}const m=f.toLowerCase().split(/[,;\s\n]+/g).map(_=>_.trim()).filter(Boolean);if(!m.length){qe.warning("You must enter at least one valid identifier."),e.current.focus();return}r(!0),a({data:{identifiers:m,reason:h,duration:d},toastLoadingMessage:"Banning identifiers...",genericHandler:{successMsg:"Identifiers banned."},success:_=>{r(!1),e.current.value="",e.current.focus()},error:_=>{r(!1),e.current.focus()}})},l=fp("/settings/banTemplates",async()=>{const h=await s({});if(!h)throw new Error("No data returned");return h}),c=i("players.ban");return u.jsxs("div",{className:"space-y-4 w-full max-w-screen-lg mx-auto px-2 md:px-0",children:[u.jsxs("div",{className:"px-2 md:px-0",children:[u.jsx("h1",{className:"text-3xl mb-2",children:"Ban Identifiers"}),u.jsxs("p",{children:["Here you can ban specific player identifiers (like ",u.jsx(Ye,{children:"license"})," and ",u.jsx(Ye,{children:"discord"}),") without having to search for a registered player.",u.jsx("br",{}),"Bans without a single ",u.jsx(Ye,{children:"license"})," identifier are considered ",u.jsx("em",{children:"Legacy Bans"})," and should be avoided if possible. ",u.jsx("br",{}),c?null:u.jsxs("span",{className:"text-warning-inline",children:["You need the ",u.jsx(Ye,{className:"text-warning-inline",children:"Player: Ban"})," permission to use this feature."]})]})]}),u.jsxs("div",{className:"grid lg:grid-cols-2 gap-4 border bg-card p-4 rounded-lg",children:[u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsx(Tn,{htmlFor:"banIdentifiers",children:"Identifiers"}),u.jsx(Eu,{ref:e,className:"h-full",disabled:n||!c,placeholder:"discord:xxxx, fivem:xxxx, license:xxxx, steam:xxxx, etc..."})]}),u.jsx(L9,{ref:t,banTemplates:l.data,disabled:n||!c})]}),u.jsxs("div",{className:"flex place-content-center gap-4",children:[u.jsx(De,{size:"sm",variant:"outline",disabled:n||!c,onClick:()=>{var h;(h=t.current)==null||h.clearData()},children:"Clear"}),u.jsx(De,{size:"sm",variant:"destructive",disabled:n||!c,onClick:o,children:n?u.jsxs("span",{className:"flex items-center leading-relaxed",children:[u.jsx(sn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})]})]})}var N9={exports:{}},Nhe="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Phe=Nhe,Ohe=Phe;function P9(){}function O9(){}O9.resetWarningCache=P9;var Ihe=function(){function e(r,i,s,a,o,l){if(l!==Ohe){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:O9,resetWarningCache:P9};return n.PropTypes=n,n};N9.exports=Ihe();var $he=N9.exports;const ee=Nn($he);var vk=jp(),Ge=e=>Ap(e,vk),yk=jp();Ge.write=e=>Ap(e,yk);var O1=jp();Ge.onStart=e=>Ap(e,O1);var xk=jp();Ge.onFrame=e=>Ap(e,xk);var _k=jp();Ge.onFinish=e=>Ap(e,_k);var Vc=[];Ge.setTimeout=(e,t)=>{const n=Ge.now()+t,r=()=>{const s=Vc.findIndex(a=>a.cancel==r);~s&&Vc.splice(s,1),Ho-=~s?1:0},i={time:n,handler:e,cancel:r};return Vc.splice(I9(n),0,i),Ho+=1,$9(),i};var I9=e=>~(~Vc.findIndex(t=>t.time>e)||~Vc.length);Ge.cancel=e=>{O1.delete(e),xk.delete(e),_k.delete(e),vk.delete(e),yk.delete(e)};Ge.sync=e=>{h2=!0,Ge.batchedUpdates(e),h2=!1};Ge.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function r(...i){t=i,Ge.onStart(n)}return r.handler=e,r.cancel=()=>{O1.delete(n),t=null},r};var bk=typeof window<"u"?window.requestAnimationFrame:()=>{};Ge.use=e=>bk=e;Ge.now=typeof performance<"u"?()=>performance.now():Date.now;Ge.batchedUpdates=e=>e();Ge.catch=console.error;Ge.frameLoop="always";Ge.advance=()=>{Ge.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):F9()};var zo=-1,Ho=0,h2=!1;function Ap(e,t){h2?(t.delete(e),e(0)):(t.add(e),$9())}function $9(){zo<0&&(zo=0,Ge.frameLoop!=="demand"&&bk(B9))}function Bhe(){zo=-1}function B9(){~zo&&(bk(B9),Ge.batchedUpdates(F9))}function F9(){const e=zo;zo=Ge.now();const t=I9(zo);if(t&&(z9(Vc.splice(0,t),n=>n.handler()),Ho-=t),!Ho){Bhe();return}O1.flush(),vk.flush(e?Math.min(64,zo-e):16.667),xk.flush(),yk.flush(),_k.flush()}function jp(){let e=new Set,t=e;return{add(n){Ho+=t==e&&!e.has(n)?1:0,e.add(n)},delete(n){return Ho-=t==e&&e.has(n)?1:0,e.delete(n)},flush(n){t.size&&(e=new Set,Ho-=t.size,z9(t,r=>r(n)&&e.add(r)),Ho+=e.size,t=e)}}}function z9(e,t){e.forEach(n=>{try{t(n)}catch(r){Ge.catch(r)}})}var Fhe=Object.defineProperty,zhe=(e,t)=>{for(var n in t)Fhe(e,n,{get:t[n],enumerable:!0})},Bi={};zhe(Bi,{assign:()=>Whe,colors:()=>ea,createStringInterpolator:()=>Sk,skipAnimation:()=>W9,to:()=>H9,willAdvance:()=>Ck});function f2(){}var Hhe=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),de={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 Ls(e,t){if(de.arr(e)){if(!de.arr(t)||e.length!==t.length)return!1;for(let n=0;ne.forEach(t);function ys(e,t,n){if(de.arr(e)){for(let r=0;rde.und(e)?[]:de.arr(e)?e:[e];function Hh(e,t){if(e.size){const n=Array.from(e);e.clear(),He(n,t)}}var yh=(e,...t)=>Hh(e,n=>n(...t)),wk=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Sk,H9,ea=null,W9=!1,Ck=f2,Whe=e=>{e.to&&(H9=e.to),e.now&&(Ge.now=e.now),e.colors!==void 0&&(ea=e.colors),e.skipAnimation!=null&&(W9=e.skipAnimation),e.createStringInterpolator&&(Sk=e.createStringInterpolator),e.requestAnimationFrame&&Ge.use(e.requestAnimationFrame),e.batchedUpdates&&(Ge.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ck=e.willAdvance),e.frameLoop&&(Ge.frameLoop=e.frameLoop)},Wh=new Set,ri=[],C_=[],Vv=0,I1={get idle(){return!Wh.size&&!ri.length},start(e){Vv>e.priority?(Wh.add(e),Ge.onStart(Uhe)):(U9(e),Ge(p2))},advance:p2,sort(e){if(Vv)Ge.onFrame(()=>I1.sort(e));else{const t=ri.indexOf(e);~t&&(ri.splice(t,1),V9(e))}},clear(){ri=[],Wh.clear()}};function Uhe(){Wh.forEach(U9),Wh.clear(),Ge(p2)}function U9(e){ri.includes(e)||V9(e)}function V9(e){ri.splice(Vhe(ri,t=>t.priority>e.priority),0,e)}function p2(e){const t=C_;for(let n=0;n0}function Vhe(e,t){const n=e.findIndex(t);return n<0?e.length:n}var qhe=(e,t,n)=>Math.min(Math.max(n,e),t),Ghe={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},Ai="[-+]?\\d*\\.?\\d+",qv=Ai+"%";function $1(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Khe=new RegExp("rgb"+$1(Ai,Ai,Ai)),Yhe=new RegExp("rgba"+$1(Ai,Ai,Ai,Ai)),Xhe=new RegExp("hsl"+$1(Ai,qv,qv)),Qhe=new RegExp("hsla"+$1(Ai,qv,qv,Ai)),Jhe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Zhe=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,efe=/^#([0-9a-fA-F]{6})$/,tfe=/^#([0-9a-fA-F]{8})$/;function nfe(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=efe.exec(e))?parseInt(t[1]+"ff",16)>>>0:ea&&ea[e]!==void 0?ea[e]:(t=Khe.exec(e))?(lc(t[1])<<24|lc(t[2])<<16|lc(t[3])<<8|255)>>>0:(t=Yhe.exec(e))?(lc(t[1])<<24|lc(t[2])<<16|lc(t[3])<<8|iM(t[4]))>>>0:(t=Jhe.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=tfe.exec(e))?parseInt(t[1],16)>>>0:(t=Zhe.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Xhe.exec(e))?(nM(rM(t[1]),Pm(t[2]),Pm(t[3]))|255)>>>0:(t=Qhe.exec(e))?(nM(rM(t[1]),Pm(t[2]),Pm(t[3]))|iM(t[4]))>>>0:null}function k_(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 nM(e,t,n){const r=n<.5?n*(1+t):n+t-n*t,i=2*n-r,s=k_(i,r,e+1/3),a=k_(i,r,e),o=k_(i,r,e-1/3);return Math.round(s*255)<<24|Math.round(a*255)<<16|Math.round(o*255)<<8}function lc(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function rM(e){return(parseFloat(e)%360+360)%360/360}function iM(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function Pm(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function sM(e){let t=nfe(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 Mf=(e,t,n)=>{if(de.fun(e))return e;if(de.arr(e))return Mf({range:e,output:t,extrapolate:n});if(de.str(e.output[0]))return Sk(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 h=ife(c,s);return rfe(c,s[h],s[h+1],i[h],i[h+1],l,a,o,r.map)}};function rfe(e,t,n,r,i,s,a,o,l){let c=l?l(e):e;if(cn){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 ife(e,t){for(var n=1;n=e);++n);return n-1}var sfe=(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 qhe(0,1,i/e)},Gv=1.70158,Om=Gv*1.525,oM=Gv+1,aM=2*Math.PI/3,lM=2*Math.PI/4.5,Im=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,ofe={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=>oM*e*e*e-Gv*e*e,easeOutBack:e=>1+oM*Math.pow(e-1,3)+Gv*Math.pow(e-1,2),easeInOutBack:e=>e<.5?Math.pow(2*e,2)*((Om+1)*2*e-Om)/2:(Math.pow(2*e-2,2)*((Om+1)*(e*2-2)+Om)+2)/2,easeInElastic:e=>e===0?0:e===1?1:-Math.pow(2,10*e-10)*Math.sin((e*10-10.75)*aM),easeOutElastic:e=>e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e*10-.75)*aM)+1,easeInOutElastic:e=>e===0?0:e===1?1:e<.5?-(Math.pow(2,20*e-10)*Math.sin((20*e-11.125)*lM))/2:Math.pow(2,-20*e+10)*Math.sin((20*e-11.125)*lM)/2+1,easeInBounce:e=>1-Im(1-e),easeOutBounce:Im,easeInOutBounce:e=>e<.5?(1-Im(1-2*e))/2:(1+Im(2*e-1))/2,steps:sfe},Af=Symbol.for("FluidValue.get"),Tu=Symbol.for("FluidValue.observers"),ti=e=>!!(e&&e[Af]),yr=e=>e&&e[Af]?e[Af]():e,cM=e=>e[Tu]||null;function afe(e,t){e.eventObserved?e.eventObserved(t):e(t)}function jf(e,t){const n=e[Tu];n&&n.forEach(r=>{afe(r,t)})}var q9=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");lfe(this,e)}},lfe=(e,t)=>G9(e,Af,t);function ld(e,t){if(e[Af]){let n=e[Tu];n||G9(e,Tu,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Df(e,t){const n=e[Tu];if(n&&n.has(t)){const r=n.size-1;r?n.delete(t):e[Tu]=null,e.observerRemoved&&e.observerRemoved(r,t)}}var G9=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Sg=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,cfe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,uM=new RegExp(`(${Sg.source})(%|[a-z]+)`,"i"),ufe=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,B1=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,K9=e=>{const[t,n]=dfe(e);if(!t||wk())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&&B1.test(n))return K9(n);if(n)return n}return e},dfe=e=>{const t=B1.exec(e);if(!t)return[,];const[,n,r]=t;return[n,r]},E_,hfe=(e,t,n,r,i)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(r)}, ${i})`,Y9=e=>{E_||(E_=ea?new RegExp(`(${Object.keys(ea).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(s=>yr(s).replace(B1,K9).replace(cfe,sM).replace(E_,sM)),n=t.map(s=>s.match(Sg).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=>Mf({...e,output:s}));return s=>{var l;const a=!uM.test(t[0])&&((l=t.find(c=>uM.test(c)))==null?void 0:l.replace(Sg,""));let o=0;return t[0].replace(Sg,()=>`${i[o++](s)}${a||""}`).replace(ufe,hfe)}},kk="react-spring: ",X9=e=>{const t=e;let n=!1;if(typeof t!="function")throw new TypeError(`${kk}once requires a function parameter`);return(...r)=>{n||(t(...r),n=!0)}},ffe=X9(console.warn);function pfe(){ffe(`${kk}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var mfe=X9(console.warn);function gfe(){mfe(`${kk}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 F1(e){return de.str(e)&&(e[0]=="#"||/\d/.test(e)||!wk()&&B1.test(e)||e in(ea||{}))}var za=wk()?w.useEffect:w.useLayoutEffect,vfe=()=>{const e=w.useRef(!1);return za(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function Ek(){const e=w.useState()[1],t=vfe();return()=>{t.current&&e(Math.random())}}function yfe(e,t){const[n]=w.useState(()=>({inputs:t,result:e()})),r=w.useRef(),i=r.current;let s=i;return s?s.inputs&&xfe(t,s.inputs)||(s={inputs:t,result:e()}):s=n,w.useEffect(()=>{r.current=s,i==n&&(n.inputs=n.result=void 0)},[s]),s.result}function xfe(e,t){if(e.length!==t.length)return!1;for(let n=0;nw.useEffect(e,_fe),_fe=[];function m2(e){const t=w.useRef();return w.useEffect(()=>{t.current=e}),t.current}var Lf=Symbol.for("Animated:node"),bfe=e=>!!e&&e[Lf]===e,Yi=e=>e&&e[Lf],Rk=(e,t)=>Hhe(e,Lf,t),z1=e=>e&&e[Lf]&&e[Lf].getPayload(),Q9=class{constructor(){Rk(this,this)}getPayload(){return this.payload||[]}},Dp=class extends Q9{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,de.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Dp(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return de.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,de.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Nf=class extends Dp{constructor(e){super(0),this._string=null,this._toString=Mf({output:[e,e]})}static create(e){return new Nf(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(de.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=Mf({output:[this.getValue(),e]})),this._value=0,super.reset()}},Kv={dependencies:null},H1=class extends Q9{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return ys(this.source,(n,r)=>{bfe(n)?t[r]=n.getValue(e):ti(n)?t[r]=yr(n):e||(t[r]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&He(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return ys(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Kv.dependencies&&ti(e)&&Kv.dependencies.add(e);const t=z1(e);t&&He(t,n=>this.add(n))}},J9=class extends H1{constructor(e){super(e)}static create(e){return new J9(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(wfe)),!0)}};function wfe(e){return(F1(e)?Nf:Dp).create(e)}function g2(e){const t=Yi(e);return t?t.constructor:de.arr(e)?J9:F1(e)?Nf:Dp}var dM=(e,t)=>{const n=!de.fun(e)||e.prototype&&e.prototype.isReactComponent;return w.forwardRef((r,i)=>{const s=w.useRef(null),a=n&&w.useCallback(_=>{s.current=kfe(i,_)},[i]),[o,l]=Cfe(r,t),c=Ek(),h=()=>{const _=s.current;if(n&&!_)return;(_?t.applyAnimatedValues(_,o.getValue(!0)):!1)===!1&&c()},d=new Sfe(h,l),f=w.useRef();za(()=>(f.current=d,He(l,_=>ld(_,d)),()=>{f.current&&(He(f.current.deps,_=>Df(_,f.current)),Ge.cancel(f.current.update))})),w.useEffect(h,[]),Tk(()=>()=>{const _=f.current;He(_.deps,v=>Df(v,_))});const m=t.getComponentProps(o.getValue());return w.createElement(e,{...m,ref:a})})},Sfe=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&Ge.write(this.update)}};function Cfe(e,t){const n=new Set;return Kv.dependencies=n,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new H1(e),Kv.dependencies=null,[e,n]}function kfe(e,t){return e&&(de.fun(e)?e(t):e.current=t),t}var hM=Symbol.for("AnimatedComponent"),Efe=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:n=i=>new H1(i),getComponentProps:r=i=>i}={})=>{const i={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:r},s=a=>{const o=fM(a)||"Anonymous";return de.str(a)?a=s[a]||(s[a]=dM(a,i)):a=a[hM]||(a[hM]=dM(a,i)),a.displayName=`Animated(${o})`,a};return ys(e,(a,o)=>{de.arr(e)&&(o=fM(a)),s[o]=s(a)}),{animated:s}},fM=e=>de.str(e)?e:e&&de.str(e.displayName)?e.displayName:de.fun(e)&&e.name||null;function xr(e,...t){return de.fun(e)?e(...t):e}var Uh=(e,t)=>e===!0||!!(t&&e&&(de.fun(e)?e(t):cr(e).includes(t))),Z9=(e,t)=>de.obj(e)?t&&e[t]:e,e$=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,Tfe=e=>e,W1=(e,t=Tfe)=>{let n=Rfe;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);de.und(s)||(r[i]=s)}return r},Rfe=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Mfe={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 Afe(e){const t={};let n=0;if(ys(e,(r,i)=>{Mfe[i]||(t[i]=r,n++)}),n)return t}function Mk(e){const t=Afe(e);if(t){const n={to:t};return ys(e,(r,i)=>i in t||(n[i]=r)),n}return{...e}}function Pf(e){return e=yr(e),de.arr(e)?e.map(Pf):F1(e)?Bi.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function t$(e){for(const t in e)return!0;return!1}function v2(e){return de.fun(e)||de.arr(e)&&de.obj(e[0])}function y2(e,t){var n;(n=e.ref)==null||n.delete(e),t==null||t.delete(e)}function n$(e,t){var n;t&&e.ref!==t&&((n=e.ref)==null||n.delete(e),t.add(e),e.ref=t)}var Ak={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}},x2={...Ak.default,mass:1,damping:1,easing:ofe.linear,clamp:!1},jfe=class{constructor(){this.velocity=0,Object.assign(this,x2)}};function Dfe(e,t,n){n&&(n={...n},pM(n,t),t={...n,...t}),pM(e,t),Object.assign(e,t);for(const a in x2)e[a]==null&&(e[a]=x2[a]);let{frequency:r,damping:i}=e;const{mass:s}=e;return de.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 pM(e,t){if(!de.und(t.decay))e.duration=void 0;else{const n=!de.und(t.tension)||!de.und(t.friction);(n||!de.und(t.frequency)||!de.und(t.damping)||!de.und(t.mass))&&(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}}var mM=[],Lfe=class{constructor(){this.changed=!1,this.values=mM,this.toValues=null,this.fromValues=mM,this.config=new jfe,this.immediate=!1}};function r$(e,{key:t,props:n,defaultProps:r,state:i,actions:s}){return new Promise((a,o)=>{let l,c,h=Uh(n.cancel??(r==null?void 0:r.cancel),t);if(h)m();else{de.und(n.pause)||(i.paused=Uh(n.pause,t));let _=r==null?void 0:r.pause;_!==!0&&(_=i.paused||Uh(_,t)),l=xr(n.delay||0,t),_?(i.resumeQueue.add(f),s.pause()):(s.resume(),f())}function d(){i.resumeQueue.add(f),i.timeouts.delete(c),c.cancel(),l=c.time-Ge.now()}function f(){l>0&&!Bi.skipAnimation?(i.delayed=!0,c=Ge.setTimeout(m,l),i.pauseQueue.add(d),i.timeouts.add(c)):m()}function m(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(d),i.timeouts.delete(c),e<=(i.cancelId||0)&&(h=!0);try{s.start({...n,callId:e,cancel:h},a)}catch(_){o(_)}}})}var jk=(e,t)=>t.length==1?t[0]:t.some(n=>n.cancelled)?qc(e.get()):t.every(n=>n.noop)?i$(e.get()):Ti(e.get(),t.every(n=>n.finished)),i$=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ti=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),qc=e=>({value:e,cancelled:!0,finished:!1});function s$(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=W1(t,(y,g)=>g==="onRest"?void 0:y);let h,d;const f=new Promise((y,g)=>(h=y,d=g)),m=y=>{const g=i<=(n.cancelId||0)&&qc(r)||i!==n.asyncId&&Ti(r,!1);if(g)throw y.result=g,d(y),y},_=(y,g)=>{const p=new gM,x=new vM;return(async()=>{if(Bi.skipAnimation)throw Of(n),x.result=Ti(r,!1),d(x),x;m(p);const b=de.obj(y)?{...y}:{...g,to:y};b.parentId=i,ys(c,(C,E)=>{de.und(b[E])&&(b[E]=C)});const S=await r.start(b);return m(p),n.paused&&await new Promise(C=>{n.resumeQueue.add(C)}),S})()};let v;if(Bi.skipAnimation)return Of(n),Ti(r,!1);try{let y;de.arr(e)?y=(async g=>{for(const p of g)await _(p)})(e):y=Promise.resolve(e(_,r.stop.bind(r))),await Promise.all([y.then(h),f]),v=Ti(r.get(),!0,!1)}catch(y){if(y instanceof gM)v=y.result;else if(y instanceof vM)v=y.result;else throw y}finally{i==n.asyncId&&(n.asyncId=s,n.asyncTo=s?o:void 0,n.promise=s?l:void 0)}return de.fun(a)&&Ge.batchedUpdates(()=>{a(v,r,r.item)}),v})()}function Of(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 gM=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.")}},vM=class extends Error{constructor(){super("SkipAnimationSignal")}},_2=e=>e instanceof Dk,Nfe=1,Dk=class extends q9{constructor(){super(...arguments),this.id=Nfe++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=Yi(this);return e&&e.getValue()}to(...e){return Bi.to(this,e)}interpolate(...e){return pfe(),Bi.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){jf(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||I1.sort(this),jf(this,{type:"priority",parent:this,priority:e})}},xl=Symbol.for("SpringPhase"),o$=1,b2=2,w2=4,T_=e=>(e[xl]&o$)>0,yo=e=>(e[xl]&b2)>0,Hd=e=>(e[xl]&w2)>0,yM=(e,t)=>t?e[xl]|=b2|o$:e[xl]&=~b2,xM=(e,t)=>t?e[xl]|=w2:e[xl]&=~w2,Pfe=class extends Dk{constructor(e,t){if(super(),this.animation=new Lfe,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,!de.und(e)||!de.und(t)){const n=de.obj(e)?{...e}:{...t,from:e};de.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(yo(this)||this._state.asyncTo)||Hd(this)}get goal(){return yr(this.animation.to)}get velocity(){const e=Yi(this);return e instanceof Dp?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return T_(this)}get isAnimating(){return yo(this)}get isPaused(){return Hd(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=z1(r.to);!a&&ti(r.to)&&(i=cr(yr(r.to))),r.values.forEach((c,h)=>{if(c.done)return;const d=c.constructor==Nf?1:a?a[h].lastPosition:i[h];let f=r.immediate,m=d;if(!f){if(m=c.lastPosition,s.tension<=0){c.done=!0;return}let _=c.elapsedTime+=e;const v=r.fromValues[h],y=c.v0!=null?c.v0:c.v0=de.arr(s.velocity)?s.velocity[h]:s.velocity;let g;const p=s.precision||(v==d?.005:Math.min(1,Math.abs(d-v)*.001));if(de.und(s.duration))if(s.decay){const x=s.decay===!0?.998:s.decay,b=Math.exp(-(1-x)*_);m=v+y/(1-x)*(1-b),f=Math.abs(c.lastPosition-m)<=p,g=y*b}else{g=c.lastVelocity==null?y:c.lastVelocity;const x=s.restVelocity||p/10,b=s.clamp?0:s.bounce,S=!de.und(b),C=v==d?c.v0>0:vx,!(!E&&(f=Math.abs(d-m)<=p,f)));++M){S&&(k=m==d||m>d==C,k&&(g=-g*b,m=d));const D=-s.tension*1e-6*(m-d),N=-s.friction*.001*g,L=(D+N)/s.mass;g=g+L*T,m=m+g*T}}else{let x=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,c.durationProgress>0&&(c.elapsedTime=s.duration*c.durationProgress,_=c.elapsedTime+=e)),x=(s.progress||0)+_/this._memoizedDuration,x=x>1?1:x<0?0:x,c.durationProgress=x),m=v+s.easing(x)*(d-v),g=(m-c.lastPosition)/e,f=x==1}c.lastVelocity=g,Number.isNaN(m)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[h].done&&(f=!1),f?c.done=!0:t=!1,c.setValue(m,s.round)&&(n=!0)});const o=Yi(this),l=o.getValue();if(t){const c=yr(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 Ge.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(yo(this)){const{to:e,config:t}=this.animation;Ge.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 de.und(e)?(n=this.queue||[],this.queue=[]):n=[de.obj(e)?e:{...t,to:e}],Promise.all(n.map(r=>this._update(r))).then(r=>jk(this,r))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Of(this._state,e&&this._lastCallId),Ge.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=de.obj(n)?n[t]:n,(n==null||v2(n))&&(n=void 0),r=de.obj(r)?r[t]:r,r==null&&(r=void 0);const i={to:n,from:r};return T_(this)||(e.reverse&&([n,r]=[r,n]),r=yr(r),de.und(r)?Yi(this)||this._set(n):this._set(r)),i}_update({...e},t){const{key:n,defaultProps:r}=this;e.default&&Object.assign(r,W1(e,(a,o)=>/^on/.test(o)?Z9(a,n):a)),bM(this,e,"onProps"),Ud(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 r$(++this._lastCallId,{key:n,props:e,defaultProps:r,state:s,actions:{pause:()=>{Hd(this)||(xM(this,!0),yh(s.pauseQueue),Ud(this,"onPause",Ti(this,Wd(this,this.animation.to)),this))},resume:()=>{Hd(this)&&(xM(this,!1),yo(this)&&this._resume(),yh(s.resumeQueue),Ud(this,"onResume",Ti(this,Wd(this,this.animation.to)),this))},start:this._merge.bind(this,i)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const o=a$(e);if(o)return this._update(o,!0)}return a})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(qc(this));const r=!de.und(e.to),i=!de.und(e.from);if(r||i)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(qc(this));const{key:s,defaultProps:a,animation:o}=this,{to:l,from:c}=o;let{to:h=l,from:d=c}=e;i&&!r&&(!t.default||de.und(h))&&(h=d),t.reverse&&([h,d]=[d,h]);const f=!Ls(d,c);f&&(o.from=d),d=yr(d);const m=!Ls(h,l);m&&this._focus(h);const _=v2(t.to),{config:v}=o,{decay:y,velocity:g}=v;(r||i)&&(v.velocity=0),t.config&&!_&&Dfe(v,xr(t.config,s),t.config!==a.config?xr(a.config,s):void 0);let p=Yi(this);if(!p||de.und(h))return n(Ti(this,!0));const x=de.und(t.reset)?i&&!t.default:!de.und(d)&&Uh(t.reset,s),b=x?d:this.get(),S=Pf(h),C=de.num(S)||de.arr(S)||F1(S),E=!_&&(!C||Uh(a.immediate||t.immediate,s));if(m){const M=g2(h);if(M!==p.constructor)if(E)p=this._set(S);else throw Error(`Cannot animate between ${p.constructor.name} and ${M.name}, as the "to" prop suggests`)}const k=p.constructor;let T=ti(h),R=!1;if(!T){const M=x||!T_(this)&&f;(m||M)&&(R=Ls(Pf(b),S),T=!R),(!Ls(o.immediate,E)&&!E||!Ls(v.decay,y)||!Ls(v.velocity,g))&&(T=!0)}if(R&&yo(this)&&(o.changed&&!x?T=!0:T||this._stop(l)),!_&&((T||ti(l))&&(o.values=p.getPayload(),o.toValues=ti(h)?null:k==Nf?[1]:cr(S)),o.immediate!=E&&(o.immediate=E,!E&&!x&&this._set(l)),T)){const{onRest:M}=o;He(Ife,N=>bM(this,t,N));const D=Ti(this,Wd(this,l));yh(this._pendingCalls,D),this._pendingCalls.add(n),o.changed&&Ge.batchedUpdates(()=>{var N;o.changed=!x,M==null||M(D,this),x?xr(a.onRest,D):(N=o.onStart)==null||N.call(o,D,this)})}x&&this._set(b),_?n(s$(t.to,t,this._state,this)):T?this._start():yo(this)&&!m?this._pendingCalls.add(n):n(i$(b))}_focus(e){const t=this.animation;e!==t.to&&(cM(this)&&this._detach(),t.to=e,cM(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ti(t)&&(ld(t,this),_2(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ti(e)&&Df(e,this)}_set(e,t=!0){const n=yr(e);if(!de.und(n)){const r=Yi(this);if(!r||!Ls(n,r.getValue())){const i=g2(n);!r||r.constructor!=i?Rk(this,i.create(n)):r.setValue(n),r&&Ge.batchedUpdates(()=>{this._onChange(n,t)})}}return Yi(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ud(this,"onStart",Ti(this,Wd(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),xr(this.animation.onChange,e,this)),xr(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;Yi(this).reset(yr(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),yo(this)||(yM(this,!0),Hd(this)||this._resume())}_resume(){Bi.skipAnimation?this.finish():I1.start(this)}_stop(e,t){if(yo(this)){yM(this,!1);const n=this.animation;He(n.values,i=>{i.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),jf(this,{type:"idle",parent:this});const r=t?qc(this.get()):Ti(this.get(),Wd(this,e??n.to));yh(this._pendingCalls,r),n.changed&&(n.changed=!1,Ud(this,"onRest",r,this))}}};function Wd(e,t){const n=Pf(t),r=Pf(e.get());return Ls(r,n)}function a$(e,t=e.loop,n=e.to){const r=xr(t);if(r){const i=r!==!0&&Mk(r),s=(i||e).reverse,a=!i||i.reset;return If({...e,loop:t,default:!1,pause:void 0,to:!s||v2(n)?n:void 0,from:a?e.from:void 0,reset:a,...i})}}function If(e){const{to:t,from:n}=e=Mk(e),r=new Set;return de.obj(t)&&_M(t,r),de.obj(n)&&_M(n,r),e.keys=r.size?Array.from(r):null,e}function Ofe(e){const t=If(e);return de.und(t.default)&&(t.default=W1(t)),t}function _M(e,t){ys(e,(n,r)=>n!=null&&t.add(r))}var Ife=["onStart","onRest","onChange","onPause","onResume"];function bM(e,t,n){e.animation[n]=t[n]!==e$(t,n)?Z9(t[n],e.key):void 0}function Ud(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 $fe=["onStart","onChange","onRest"],Bfe=1,l$=class{constructor(e,t){this.id=Bfe++,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];de.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(If(e)),this}start(e){let{queue:t}=this;return e?t=cr(e).map(If):this.queue=[],this._flush?this._flush(this,t):(f$(this,t),S2(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;He(cr(t),r=>n[r].stop(!!e))}else Of(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(de.und(e))this.start({pause:!0});else{const t=this.springs;He(cr(e),n=>t[n].pause())}return this}resume(e){if(de.und(e))this.start({pause:!1});else{const t=this.springs;He(cr(e),n=>t[n].resume())}return this}each(e){ys(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;Ge.onFrame(this._onFrame)}};function S2(e,t){return Promise.all(t.map(n=>c$(e,n))).then(n=>jk(e,n))}async function c$(e,t,n){const{keys:r,to:i,from:s,loop:a,onRest:o,onResolve:l}=t,c=de.obj(t.default)&&t.default;a&&(t.loop=!1),i===!1&&(t.to=null),s===!1&&(t.from=null);const h=de.arr(i)||de.fun(i)?i:void 0;h?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):He($fe,v=>{const y=t[v];if(de.fun(y)){const g=e._events[v];t[v]=({finished:p,cancelled:x})=>{const b=g.get(y);b?(p||(b.finished=!1),x&&(b.cancelled=!0)):g.set(y,{value:null,finished:p||!1,cancelled:x||!1})},c&&(c[v]=t[v])}});const d=e._state;t.pause===!d.paused?(d.paused=t.pause,yh(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const f=(r||Object.keys(e.springs)).map(v=>e.springs[v].start(t)),m=t.cancel===!0||e$(t,"cancel")===!0;(h||m&&d.asyncId)&&f.push(r$(++e._lastAsyncId,{props:t,state:d,actions:{pause:f2,resume:f2,start(v,y){m?(Of(d,e._lastAsyncId),y(qc(e))):(v.onRest=o,y(s$(h,v,d,e)))}}})),d.paused&&await new Promise(v=>{d.resumeQueue.add(v)});const _=jk(e,await Promise.all(f));if(a&&_.finished&&!(n&&_.noop)){const v=a$(t,a,i);if(v)return f$(e,[v]),c$(e,v,!0)}return l&&Ge.batchedUpdates(()=>l(_,e,e.item)),_}function C2(e,t){const n={...e.springs};return t&&He(cr(t),r=>{de.und(r.keys)&&(r=If(r)),de.obj(r.to)||(r={...r,to:void 0}),h$(n,r,i=>d$(i))}),u$(e,n),n}function u$(e,t){ys(t,(n,r)=>{e.springs[r]||(e.springs[r]=n,ld(n,e))})}function d$(e,t){const n=new Pfe;return n.key=e,t&&ld(n,t),n}function h$(e,t,n){t.keys&&He(t.keys,r=>{(e[r]||(e[r]=n(r)))._prepareNode(t)})}function f$(e,t){He(t,n=>{h$(e.springs,n,r=>d$(r,e))})}var Lp=({children:e,...t})=>{const n=w.useContext(Yv),r=t.pause||!!n.pause,i=t.immediate||!!n.immediate;t=yfe(()=>({pause:r,immediate:i}),[r,i]);const{Provider:s}=Yv;return w.createElement(s,{value:t},e)},Yv=Ffe(Lp,{});Lp.Provider=Yv.Provider;Lp.Consumer=Yv.Consumer;function Ffe(e,t){return Object.assign(e,w.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var p$=()=>{const e=[],t=function(r){gfe();const i=[];return He(e,(s,a)=>{if(de.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 He(e,r=>r.pause(...arguments)),this},t.resume=function(){return He(e,r=>r.resume(...arguments)),this},t.set=function(r){He(e,(i,s)=>{const a=de.fun(r)?r(s,i):r;a&&i.set(a)})},t.start=function(r){const i=[];return He(e,(s,a)=>{if(de.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 He(e,r=>r.stop(...arguments)),this},t.update=function(r){return He(e,(i,s)=>i.update(this._getProps(r,i,s))),this};const n=function(r,i,s){return de.fun(r)?r(s,i):r};return t._getProps=n,t};function zfe(e,t,n){const r=de.fun(t)&&t;r&&!n&&(n=[]);const i=w.useMemo(()=>r||arguments.length==3?p$():void 0,[]),s=w.useRef(0),a=Ek(),o=w.useMemo(()=>({ctrls:[],queue:[],flush(g,p){const x=C2(g,p);return s.current>0&&!o.queue.length&&!Object.keys(x).some(S=>!g.springs[S])?S2(g,p):new Promise(S=>{u$(g,x),o.queue.push(()=>{S(S2(g,p))}),a()})}}),[]),l=w.useRef([...o.ctrls]),c=[],h=m2(e)||0;w.useMemo(()=>{He(l.current.slice(e,h),g=>{y2(g,i),g.stop(!0)}),l.current.length=e,d(h,e)},[e]),w.useMemo(()=>{d(0,Math.min(h,e))},n);function d(g,p){for(let x=g;xC2(g,c[p])),m=w.useContext(Lp),_=m2(m),v=m!==_&&t$(m);za(()=>{s.current++,o.ctrls=l.current;const{queue:g}=o;g.length&&(o.queue=[],He(g,p=>p())),He(l.current,(p,x)=>{i==null||i.add(p),v&&p.start({default:m});const b=c[x];b&&(n$(p,b.ref),p.ref?p.queue.push(b):p.start(b))})}),Tk(()=>()=>{He(o.ctrls,g=>g.stop(!0))});const y=f.map(g=>({...g}));return i?[y,i]:y}function uo(e,t){const n=de.fun(e),[[r],i]=zfe(1,n?e:[e],n?[]:t);return n||arguments.length==2?[r,i]:r}function Fl(e,t,n){const r=de.fun(t)&&t,{reset:i,sort:s,trail:a=0,expires:o=!0,exitBeforeEnter:l=!1,onDestroyed:c,ref:h,config:d}=r?r():t,f=w.useMemo(()=>r||arguments.length==3?p$():void 0,[]),m=cr(e),_=[],v=w.useRef(null),y=i?null:v.current;za(()=>{v.current=_}),Tk(()=>(He(_,L=>{f==null||f.add(L.ctrl),L.ctrl.ref=f}),()=>{He(v.current,L=>{L.expired&&clearTimeout(L.expirationId),y2(L.ctrl,f),L.ctrl.stop(!0)})}));const g=Wfe(m,r?r():t,y),p=i&&v.current||[];za(()=>He(p,({ctrl:L,item:P,key:I})=>{y2(L,f),xr(c,P,I)}));const x=[];if(y&&He(y,(L,P)=>{L.expired?(clearTimeout(L.expirationId),p.push(L)):(P=x[P]=g.indexOf(L.key),~P&&(_[P]=L))}),He(m,(L,P)=>{_[P]||(_[P]={key:g[P],item:L,phase:"mount",ctrl:new l$},_[P].ctrl.item=L)}),x.length){let L=-1;const{leave:P}=r?r():t;He(x,(I,z)=>{const O=y[z];~I?(L=_.indexOf(O),_[L]={...O,item:m[I]}):P&&_.splice(++L,0,O)})}de.fun(s)&&_.sort((L,P)=>s(L.item,P.item));let b=-a;const S=Ek(),C=W1(t),E=new Map,k=w.useRef(new Map),T=w.useRef(!1);He(_,(L,P)=>{const I=L.key,z=L.phase,O=r?r():t;let A,j;const F=xr(O.delay||0,I);if(z=="mount")A=O.enter,j="enter";else{const Z=g.indexOf(I)<0;if(z!="leave")if(Z)A=O.leave,j="leave";else if(A=O.update)j="update";else return;else if(!Z)A=O.enter,j="enter";else return}if(A=xr(A,L.item,P),A=de.obj(A)?Mk(A):{to:A},!A.config){const Z=d||C.config;A.config=xr(Z,L.item,P,j)}b+=a;const H={...C,delay:F+b,ref:h,immediate:O.immediate,reset:!1,...A};if(j=="enter"&&de.und(H.from)){const Z=r?r():t,X=de.und(Z.initial)||y?Z.from:Z.initial;H.from=xr(X,L.item,P)}const{onResolve:B}=H;H.onResolve=Z=>{xr(B,Z);const X=v.current,W=X.find($=>$.key===I);if(W&&!(Z.cancelled&&W.phase!="update")&&W.ctrl.idle){const $=X.every(V=>V.ctrl.idle);if(W.phase=="leave"){const V=xr(o,W.item);if(V!==!1){const U=V===!0?0:V;if(W.expired=!0,!$&&U>0){U<=2147483647&&(W.expirationId=setTimeout(S,U));return}}}$&&X.some(V=>V.expired)&&(k.current.delete(W),l&&(T.current=!0),S())}};const G=C2(L.ctrl,H);j==="leave"&&l?k.current.set(L,{phase:j,springs:G,payload:H}):E.set(L,{phase:j,springs:G,payload:H})});const R=w.useContext(Lp),M=m2(R),D=R!==M&&t$(R);za(()=>{D&&He(_,L=>{L.ctrl.start({default:R})})},[R]),He(E,(L,P)=>{if(k.current.size){const I=_.findIndex(z=>z.key===P.key);_.splice(I,1)}}),za(()=>{He(k.current.size?k.current:E,({phase:L,payload:P},I)=>{const{ctrl:z}=I;I.phase=L,f==null||f.add(z),D&&L=="enter"&&z.start({default:R}),P&&(n$(z,P.ref),(z.ref||f)&&!T.current?z.update(P):(z.start(P),T.current&&(T.current=!1)))})},i?void 0:n);const N=L=>w.createElement(w.Fragment,null,_.map((P,I)=>{const{springs:z}=E.get(P)||P.ctrl,O=L({...z},P.item,P,I);return O&&O.type?w.createElement(O.type,{...O.props,key:de.str(P.key)||de.num(P.key)?P.key:P.ctrl.id,ref:O.ref}):O}));return f?[N,f]:N}var Hfe=1;function Wfe(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):Hfe++})}return de.und(n)?e:de.fun(n)?e.map(n):cr(n)}var m$=class extends Dk{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Mf(...t);const n=this._get(),r=g2(n);Rk(this,r.create(n))}advance(e){const t=this._get(),n=this.get();Ls(t,n)||(Yi(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&wM(this._active)&&R_(this)}_get(){const e=de.arr(this.source)?this.source.map(yr):cr(yr(this.source));return this.calc(...e)}_start(){this.idle&&!wM(this._active)&&(this.idle=!1,He(z1(this),e=>{e.done=!1}),Bi.skipAnimation?(Ge.batchedUpdates(()=>this.advance()),R_(this)):I1.start(this))}_attach(){let e=1;He(cr(this.source),t=>{ti(t)&&ld(t,this),_2(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){He(cr(this.source),e=>{ti(e)&&Df(e,this)}),this._active.clear(),R_(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=cr(this.source).reduce((t,n)=>Math.max(t,(_2(n)?n.priority:0)+1),0))}};function Ufe(e){return e.idle!==!1}function wM(e){return!e.size||Array.from(e).every(Ufe)}function R_(e){e.idle||(e.idle=!0,He(z1(e),t=>{t.done=!0}),jf(e,{type:"idle",parent:e}))}var ua=(e,...t)=>new m$(e,t);Bi.assign({createStringInterpolator:Y9,to:(e,t)=>new m$(e,t)});var g$=/^--/;function Vfe(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!g$.test(e)&&!(Vh.hasOwnProperty(e)&&Vh[e])?t+"px":(""+t).trim()}var SM={};function qfe(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:r,style:i,children:s,scrollTop:a,scrollLeft:o,viewBox:l,...c}=t,h=Object.values(c),d=Object.keys(c).map(f=>n||e.hasAttribute(f)?f:SM[f]||(SM[f]=f.replace(/([A-Z])/g,m=>"-"+m.toLowerCase())));s!==void 0&&(e.textContent=s);for(const f in i)if(i.hasOwnProperty(f)){const m=Vfe(f,i[f]);g$.test(f)?e.style.setProperty(f,m):e.style[f]=m}d.forEach((f,m)=>{e.setAttribute(f,h[m])}),r!==void 0&&(e.className=r),a!==void 0&&(e.scrollTop=a),o!==void 0&&(e.scrollLeft=o),l!==void 0&&e.setAttribute("viewBox",l)}var Vh={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},Gfe=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Kfe=["Webkit","Ms","Moz","O"];Vh=Object.keys(Vh).reduce((e,t)=>(Kfe.forEach(n=>e[Gfe(n,t)]=e[t]),e),Vh);var Yfe=/^(matrix|translate|scale|rotate|skew)/,Xfe=/^(translate)/,Qfe=/^(rotate|skew)/,M_=(e,t)=>de.num(e)&&e!==0?e+t:e,Cg=(e,t)=>de.arr(e)?e.every(n=>Cg(n,t)):de.num(e)?e===t:parseFloat(e)===t,Jfe=class extends H1{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=>M_(o,"px")).join(",")})`,Cg(a,0)])),ys(r,(a,o)=>{if(o==="transform")i.push([a||""]),s.push(l=>[l,l===""]);else if(Yfe.test(o)){if(delete r[o],de.und(a))return;const l=Xfe.test(o)?"px":Qfe.test(o)?"deg":"";i.push(cr(a)),s.push(o==="rotate3d"?([c,h,d,f])=>[`rotate3d(${c},${h},${d},${M_(f,l)})`,Cg(f,0)]:c=>[`${o}(${c.map(h=>M_(h,l)).join(",")})`,Cg(c,o.startsWith("scale")?1:0)])}}),i.length&&(r.transform=new Zfe(i,s)),super(r)}},Zfe=class extends q9{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 He(this.inputs,(n,r)=>{const i=yr(n[0]),[s,a]=this.transforms[r](de.arr(i)?i:n.map(yr));e+=" "+s,t=t&&a}),t?"none":e}observerAdded(e){e==1&&He(this.inputs,t=>He(t,n=>ti(n)&&ld(n,this)))}observerRemoved(e){e==0&&He(this.inputs,t=>He(t,n=>ti(n)&&Df(n,this)))}eventObserved(e){e.type=="change"&&(this._value=null),jf(this,e)}},epe=["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"];Bi.assign({batchedUpdates:$r.unstable_batchedUpdates,createStringInterpolator:Y9,colors:Ghe});var tpe=Efe(epe,{applyAnimatedValues:qfe,createAnimatedStyle:e=>new Jfe(e),getComponentProps:({scrollTop:e,scrollLeft:t,...n})=>n}),Rt=tpe.animated;function _l(){return _l=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&d.height>0,y=Math.round(n[0]),g=Math.round(n[1]);v&&(r==="top"?(y-=d.width/2,g-=d.height+14):r==="right"?(y+=14,g-=d.height/2):r==="bottom"?(y-=d.width/2,g+=14):r==="left"?(y-=d.width+14,g-=d.height/2):r==="center"&&(y-=d.width/2,g-=d.height/2),m={transform:CM(y,g)},f.current||(_=!0),f.current=[y,g]);var p=uo({to:m,config:l,immediate:!o||_}),x=_l({},npe,s.tooltip.wrapper,{transform:(t=p.transform)!=null?t:CM(y,g),opacity:p.transform?1:0});return u.jsx(Rt.div,{ref:h,style:x,children:i})});v$.displayName="TooltipWrapper";var rpe=w.memo(function(e){var t=e.size,n=t===void 0?12:t,r=e.color,i=e.style;return u.jsx("span",{style:_l({display:"block",width:n,height:n,background:r},i===void 0?{}:i)})}),y$=w.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=Xt(),h=Wy(i);if(typeof l=="function")t=l();else{var d=r;h!==void 0&&d!==void 0&&(d=h(d)),t=u.jsxs("div",{style:c.tooltip.basic,children:[a&&u.jsx(rpe,{color:o,style:c.tooltip.chip}),d!==void 0?u.jsxs("span",{children:[n,": ",u.jsx("strong",{children:""+d})]}):n]})}return u.jsx("div",{style:c.tooltip.container,children:t})}),ipe={width:"100%",borderCollapse:"collapse"},spe=w.memo(function(e){var t,n=e.title,r=e.rows,i=r===void 0?[]:r,s=e.renderContent,a=Xt();return i.length?(t=typeof s=="function"?s():u.jsxs("div",{children:[n&&n,u.jsx("table",{style:_l({},ipe,a.tooltip.table),children:u.jsx("tbody",{children:i.map(function(o,l){return u.jsx("tr",{children:o.map(function(c,h){return u.jsx("td",{style:a.tooltip.tableCell,children:c},h)})},l)})})})]}),u.jsx("div",{style:a.tooltip.container,children:t})):null});spe.displayName="TableTooltip";var k2=w.memo(function(e){var t=e.x0,n=e.x1,r=e.y0,i=e.y1,s=Xt(),a=Lr(),o=a.animate,l=a.config,c=w.useMemo(function(){return _l({},s.crosshair.line,{pointerEvents:"none"})},[s.crosshair.line]),h=uo({x1:t,x2:n,y1:r,y2:i,config:l,immediate:!o});return u.jsx(Rt.line,_l({},h,{fill:"none",style:c}))});k2.displayName="CrosshairLine";var ope=w.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}),u.jsxs(u.Fragment,{children:[t&&u.jsx(k2,{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1}),n&&u.jsx(k2,{x0:n.x0,x1:n.x1,y0:n.y0,y1:n.y1})]})});ope.displayName="Crosshair";var x$=w.createContext({showTooltipAt:function(){},showTooltipFromEvent:function(){},hideTooltip:function(){}}),E2={isVisible:!1,position:[null,null],content:null,anchor:null},_$=w.createContext(E2),ape=function(e){var t=w.useState(E2),n=t[0],r=t[1],i=w.useCallback(function(o,l,c){var h=l[0],d=l[1];c===void 0&&(c="top"),r({isVisible:!0,position:[h,d],anchor:c,content:o})},[r]),s=w.useCallback(function(o,l,c){c===void 0&&(c="top");var h=e.current.getBoundingClientRect(),d=e.current.offsetWidth,f=d===h.width?1:d/h.width,m="touches"in l?l.touches[0]:l,_=m.clientX,v=m.clientY,y=(_-h.left)*f,g=(v-h.top)*f;c!=="left"&&c!=="right"||(c=y-1}var Tpe=Epe,Rpe=U1;function Mpe(e,t){var n=this.__data__,r=Rpe(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var Ape=Mpe,jpe=fpe,Dpe=bpe,Lpe=Cpe,Npe=Tpe,Ppe=Ape;function cd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=Hve}var Fk=Wve,Uve=q1,Vve=Fk;function qve(e){return e!=null&&Vve(e.length)&&!Uve(e)}var pd=qve,Gve=pd,Kve=zi;function Yve(e){return Kve(e)&&Gve(e)}var P$=Yve,Qv={exports:{}};function Xve(){return!1}var Qve=Xve;Qv.exports;(function(e,t){var n=Ss,r=Qve,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})(Qv,Qv.exports);var Q1=Qv.exports,Jve=ka,Zve=$k,e0e=zi,t0e="[object Object]",n0e=Function.prototype,r0e=Object.prototype,O$=n0e.toString,i0e=r0e.hasOwnProperty,s0e=O$.call(Object);function o0e(e){if(!e0e(e)||Jve(e)!=t0e)return!1;var t=Zve(e);if(t===null)return!0;var n=i0e.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&O$.call(n)==s0e}var zk=o0e;const Hk=Nn(zk);var a0e=ka,l0e=Fk,c0e=zi,u0e="[object Arguments]",d0e="[object Array]",h0e="[object Boolean]",f0e="[object Date]",p0e="[object Error]",m0e="[object Function]",g0e="[object Map]",v0e="[object Number]",y0e="[object Object]",x0e="[object RegExp]",_0e="[object Set]",b0e="[object String]",w0e="[object WeakMap]",S0e="[object ArrayBuffer]",C0e="[object DataView]",k0e="[object Float32Array]",E0e="[object Float64Array]",T0e="[object Int8Array]",R0e="[object Int16Array]",M0e="[object Int32Array]",A0e="[object Uint8Array]",j0e="[object Uint8ClampedArray]",D0e="[object Uint16Array]",L0e="[object Uint32Array]",qt={};qt[k0e]=qt[E0e]=qt[T0e]=qt[R0e]=qt[M0e]=qt[A0e]=qt[j0e]=qt[D0e]=qt[L0e]=!0;qt[u0e]=qt[d0e]=qt[S0e]=qt[h0e]=qt[C0e]=qt[f0e]=qt[p0e]=qt[m0e]=qt[g0e]=qt[v0e]=qt[y0e]=qt[x0e]=qt[_0e]=qt[b0e]=qt[w0e]=!1;function N0e(e){return c0e(e)&&l0e(e.length)&&!!qt[a0e(e)]}var P0e=N0e;function O0e(e){return function(t){return e(t)}}var Pp=O0e,Jv={exports:{}};Jv.exports;(function(e,t){var n=b$,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})(Jv,Jv.exports);var J1=Jv.exports,I0e=P0e,$0e=Pp,PM=J1,OM=PM&&PM.isTypedArray,B0e=OM?$0e(OM):I0e,Wk=B0e;function F0e(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var I$=F0e,z0e=Ok,H0e=Np,W0e=Object.prototype,U0e=W0e.hasOwnProperty;function V0e(e,t,n){var r=e[t];(!(U0e.call(e,t)&&H0e(r,n))||n===void 0&&!(t in e))&&z0e(e,t,n)}var Uk=V0e,q0e=Uk,G0e=Ok;function K0e(e,t,n,r){var i=!n;n||(n={});for(var s=-1,a=t.length;++s-1&&e%1==0&&e0){if(++t>=iye)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var lye=aye,cye=rye,uye=lye,dye=uye(cye),z$=dye,hye=ey,fye=F$,pye=z$;function mye(e,t){return pye(fye(e,t,hye),e+"")}var Vk=mye,gye=Np,vye=pd,yye=Z1,xye=Cs;function _ye(e,t,n){if(!xye(n))return!1;var r=typeof t;return(r=="number"?vye(n)&&yye(t,n.length):r=="string"&&t in n)?gye(n[t],e):!1}var H$=_ye,bye=Vk,wye=H$;function Sye(e){return bye(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&&wye(n[0],n[1],a)&&(s=i<3?void 0:s,i=1),t=Object(t);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?$m(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?$m(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=Txe.exec(e))?new Zn(t[1],t[2],t[3],1):(t=Rxe.exec(e))?new Zn(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Mxe.exec(e))?$m(t[1],t[2],t[3],t[4]):(t=Axe.exec(e))?$m(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=jxe.exec(e))?ZM(t[1],t[2]/100,t[3]/100,1):(t=Dxe.exec(e))?ZM(t[1],t[2]/100,t[3]/100,t[4]):GM.hasOwnProperty(e)?XM(GM[e]):e==="transparent"?new Zn(NaN,NaN,NaN,0):null}function XM(e){return new Zn(e>>16&255,e>>8&255,e&255,1)}function $m(e,t,n,r){return r<=0&&(e=t=n=NaN),new Zn(e,t,n,r)}function G$(e){return e instanceof yd||(e=so(e)),e?(e=e.rgb(),new Zn(e.r,e.g,e.b,e.opacity)):new Zn}function Mu(e,t,n,r){return arguments.length===1?G$(e):new Zn(e,t,n,r??1)}function Zn(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}ry(Zn,Mu,Kk(yd,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new Zn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?bl:Math.pow(bl,e),new Zn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Zn(nl(this.r),nl(this.g),nl(this.b),Zv(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:QM,formatHex:QM,formatHex8:Pxe,formatRgb:JM,toString:JM}));function QM(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}`}function Pxe(){return`#${Ha(this.r)}${Ha(this.g)}${Ha(this.b)}${Ha((isNaN(this.opacity)?1:this.opacity)*255)}`}function JM(){const e=Zv(this.opacity);return`${e===1?"rgb(":"rgba("}${nl(this.r)}, ${nl(this.g)}, ${nl(this.b)}${e===1?")":`, ${e})`}`}function Zv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function nl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ha(e){return e=nl(e),(e<16?"0":"")+e.toString(16)}function ZM(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 K$(e){if(e instanceof Mi)return new Mi(e.h,e.s,e.l,e.opacity);if(e instanceof yd||(e=so(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+(n0&&l<1?0:a,new Mi(a,o,l,e.opacity)}function Oxe(e,t,n,r){return arguments.length===1?K$(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}ry(Mi,Oxe,Kk(yd,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new Mi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bl:Math.pow(bl,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 Zn(j_(e>=240?e-240:e+120,i,r),j_(e,i,r),j_(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Mi(eA(this.h),Bm(this.s),Bm(this.l),Zv(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=Zv(this.opacity);return`${e===1?"hsl(":"hsla("}${eA(this.h)}, ${Bm(this.s)*100}%, ${Bm(this.l)*100}%${e===1?")":`, ${e})`}`}}));function eA(e){return e=(e||0)%360,e<0?e+360:e}function Bm(e){return Math.max(0,Math.min(1,e||0))}function j_(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 Ixe=Math.PI/180,$xe=180/Math.PI;var Y$=-.14861,Yk=1.78277,Xk=-.29227,iy=-.90649,Bf=1.97294,tA=Bf*iy,nA=Bf*Yk,rA=Yk*Xk-iy*Y$;function Bxe(e){if(e instanceof rl)return new rl(e.h,e.s,e.l,e.opacity);e instanceof Zn||(e=G$(e));var t=e.r/255,n=e.g/255,r=e.b/255,i=(rA*r+tA*t-nA*n)/(rA+tA-nA),s=r-i,a=(Bf*(n-i)-Xk*s)/iy,o=Math.sqrt(a*a+s*s)/(Bf*i*(1-i)),l=o?Math.atan2(a,s)*$xe-120:NaN;return new rl(l<0?l+360:l,o,i,e.opacity)}function xs(e,t,n,r){return arguments.length===1?Bxe(e):new rl(e,t,n,r??1)}function rl(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}ry(rl,xs,Kk(yd,{brighter(e){return e=e==null?Ru:Math.pow(Ru,e),new rl(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?bl:Math.pow(bl,e),new rl(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=isNaN(this.h)?0:(this.h+120)*Ixe,t=+this.l,n=isNaN(this.s)?0:this.s*t*(1-t),r=Math.cos(e),i=Math.sin(e);return new Zn(255*(t+n*(Y$*r+Yk*i)),255*(t+n*(Xk*r+iy*i)),255*(t+n*(Bf*r)),this.opacity)}}));function Fxe(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 zxe(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()=>e;function X$(e,t){return function(n){return e+n*t}}function Hxe(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 Wxe(e,t){var n=t-e;return n?X$(e,n>180||n<-180?n-360*Math.round(n/360):n):sy(isNaN(e)?t:e)}function Uxe(e){return(e=+e)==1?Kc:function(t,n){return n-t?Hxe(t,n,e):sy(isNaN(t)?n:t)}}function Kc(e,t){var n=t-e;return n?X$(e,n):sy(isNaN(e)?t:e)}const e0=function e(t){var n=Uxe(t);function r(i,s){var a=n((i=Mu(i)).r,(s=Mu(s)).r),o=n(i.g,s.g),l=n(i.b,s.b),c=Kc(i.opacity,s.opacity);return function(h){return i.r=a(h),i.g=o(h),i.b=l(h),i.opacity=c(h),i+""}}return r.gamma=e,r}(1);function Vxe(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;an&&(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:Ri(r,i)})),n=D_.lastIndex;return n180?h+=360:h-c>180&&(c+=360),f.push({i:d.push(i(d)+"rotate(",null,r)-2,x:Ri(c,h)})):h&&d.push(i(d)+"rotate("+h+r)}function o(c,h,d,f){c!==h?f.push({i:d.push(i(d)+"skewX(",null,r)-2,x:Ri(c,h)}):h&&d.push(i(d)+"skewX("+h+r)}function l(c,h,d,f,m,_){if(c!==d||h!==f){var v=m.push(i(m)+"scale(",null,",",null,")");_.push({i:v-4,x:Ri(c,d)},{i:v-2,x:Ri(h,f)})}else(d!==1||f!==1)&&m.push(i(m)+"scale("+d+","+f+")")}return function(c,h){var d=[],f=[];return c=e(c),h=e(h),s(c.translateX,c.translateY,h.translateX,h.translateY,d,f),a(c.rotate,h.rotate,d,f),o(c.skewX,h.skewX,d,f),l(c.scaleX,c.scaleY,h.scaleX,h.scaleY,d,f),c=h=null,function(m){for(var _=-1,v=f.length,y;++_t?1:e>=t?0:NaN}function g_e(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function $p(e){let t,n,r;e.length!==2?(t=Yc,n=(o,l)=>Yc(e(o),l),r=(o,l)=>e(o)-l):(t=e===Yc||e===g_e?e:v_e,n=e,r=e);function i(o,l,c=0,h=o.length){if(c>>1;n(o[d],l)<0?c=d+1:h=d}while(c>>1;n(o[d],l)<=0?c=d+1:h=d}while(cc&&r(o[d-1],l)>-r(o[d],l)?d-1:d}return{left:i,center:a,right:s}}function v_e(){return 0}function y_e(e){return e===null?NaN:+e}function*x_e(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const __e=$p(Yc),b_e=__e.right;$p(y_e).center;class oA extends Map{constructor(t,n=C_e){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(aA(this,t))}has(t){return super.has(aA(this,t))}set(t,n){return super.set(w_e(this,t),n)}delete(t){return super.delete(S_e(this,t))}}function aA({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function w_e({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function S_e({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function C_e(e){return e!==null&&typeof e=="object"?e.valueOf():e}function k_e(e=Yc){if(e===Yc)return nB;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 nB(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const E_e=Math.sqrt(50),T_e=Math.sqrt(10),R_e=Math.sqrt(2);function t0(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>=E_e?10:s>=T_e?5:s>=R_e?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/ct&&--l,c=-c):(c=Math.pow(10,i)*a,o=Math.round(e/c),l=Math.round(t/c),o*ct&&--l),l0))return[];if(e===t)return[e];const r=t=i))return[];const o=s-i+1,l=new Array(o);if(r)if(a<0)for(let c=0;c=r)&&(n=r);else{let r=-1;for(let i of e)(i=t(i,++r,e))!=null&&(n=i)&&(n=i)}return n}function lA(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function rB(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?nB:k_e(i);r>n;){if(r-n>600){const l=r-n+1,c=t-n+1,h=Math.log(l),d=.5*Math.exp(2*h/3),f=.5*Math.sqrt(h*d*(l-d)/l)*(c-l/2<0?-1:1),m=Math.max(n,Math.floor(t-c*d/l+f)),_=Math.min(r,Math.floor(t+(l-c)*d/l+f));rB(e,t,m,_,i)}const s=e[t];let a=n,o=r;for(qd(e,n,t),i(e[r],s)>0&&qd(e,n,r);a0;)--o}i(e[n],s)===0?qd(e,n,o):(++o,qd(e,o,r)),o<=t&&(n=o+1),t<=o&&(r=o-1)}return e}function qd(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function M_e(e,t,n){if(e=Float64Array.from(x_e(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return lA(e);if(t>=1)return Co(e);var r,i=(r-1)*t,s=Math.floor(i),a=Co(rB(e,s).subarray(0,s+1)),o=lA(e.subarray(s+1));return a+(o-a)*(i-s)}}function Zk(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);++rt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function P_e(e,t,n){var r=e[0],i=e[1],s=t[0],a=t[1];return i2?O_e:P_e,l=c=null,d}function d(f){return f==null||isNaN(f=+f)?s:(l||(l=o(e.map(r),t,n)))(r(a(f)))}return d.invert=function(f){return a(i((c||(c=o(t,e.map(r),Ri)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,L_e),h()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),h()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),n=Q$,h()},d.clamp=function(f){return arguments.length?(a=f?!0:Wo,h()):a!==Wo},d.interpolate=function(f){return arguments.length?(n=f,h()):n},d.unknown=function(f){return arguments.length?(s=f,d):s},function(f,m){return r=f,i=m,h()}}function sB(){return eE()(Wo,Wo)}function I_e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function n0(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 Au(e){return e=n0(Math.abs(e)),e?e[1]:NaN}function $_e(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 B_e(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var F_e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ff(e){if(!(t=F_e.exec(e)))throw new Error("invalid format: "+e);var t;return new tE({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]})}Ff.prototype=tE.prototype;function tE(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+""}tE.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 z_e(e){e:for(var t=e.length,n=1,r=-1,i;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var oB;function H_e(e,t){var n=n0(e,t);if(!n)return e+"";var r=n[0],i=n[1],s=i-(oB=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")+n0(e,Math.max(0,t+s-1))[0]}function dA(e,t){var n=n0(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 hA={"%":function(e,t){return(e*100).toFixed(t)},b:function(e){return Math.round(e).toString(2)},c:function(e){return e+""},d:I_e,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 dA(e*100,t)},r:dA,s:H_e,X:function(e){return Math.round(e).toString(16).toUpperCase()},x:function(e){return Math.round(e).toString(16)}};function fA(e){return e}var pA=Array.prototype.map,mA=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function W_e(e){var t=e.grouping===void 0||e.thousands===void 0?fA:$_e(pA.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?fA:B_e(pA.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(d){d=Ff(d);var f=d.fill,m=d.align,_=d.sign,v=d.symbol,y=d.zero,g=d.width,p=d.comma,x=d.precision,b=d.trim,S=d.type;S==="n"?(p=!0,S="g"):hA[S]||(x===void 0&&(x=12),b=!0,S="g"),(y||f==="0"&&m==="=")&&(y=!0,f="0",m="=");var C=v==="$"?n:v==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():"",E=v==="$"?r:/[%p]/.test(S)?a:"",k=hA[S],T=/[defgprs%]/.test(S);x=x===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(M){var D=C,N=E,L,P,I;if(S==="c")N=k(M)+N,M="";else{M=+M;var z=M<0||1/M<0;if(M=isNaN(M)?l:k(Math.abs(M),x),b&&(M=z_e(M)),z&&+M==0&&_!=="+"&&(z=!1),D=(z?_==="("?_:o:_==="-"||_==="("?"":_)+D,N=(S==="s"?mA[8+oB/3]:"")+N+(z&&_==="("?")":""),T){for(L=-1,P=M.length;++LI||I>57){N=(I===46?i+M.slice(L+1):M.slice(L))+N,M=M.slice(0,L);break}}}p&&!y&&(M=t(M,1/0));var O=D.length+M.length+N.length,A=O>1)+D+M+N+A.slice(O);break;default:M=A+D+M+N;break}return s(M)}return R.toString=function(){return d+""},R}function h(d,f){var m=c((d=Ff(d),d.type="f",d)),_=Math.max(-8,Math.min(8,Math.floor(Au(f)/3)))*3,v=Math.pow(10,-_),y=mA[8+_/3];return function(g){return m(v*g)+y}}return{format:c,formatPrefix:h}}var zm,Bp,aB;U_e({decimal:".",thousands:",",grouping:[3],currency:["$",""],minus:"-"});function U_e(e){return zm=W_e(e),Bp=zm.format,aB=zm.formatPrefix,zm}function V_e(e){return Math.max(0,-Au(Math.abs(e)))}function q_e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Au(t)/3)))*3-Au(Math.abs(e)))}function G_e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Au(t)-Au(e))+1}function K_e(e,t,n,r){var i=j2(e,t,n),s;switch(r=Ff(r??",f"),r.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(s=q_e(i,a))&&(r.precision=s),aB(r,a)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(s=G_e(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=s-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(s=V_e(i))&&(r.precision=s-(r.type==="%")*2);break}}return Bp(r)}function nE(e){var t=e.domain;return e.ticks=function(n){var r=t();return M2(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return K_e(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,h=10;for(o0;){if(c=A2(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 Uo(){var e=sB();return e.copy=function(){return ly(e,Uo())},Hl.apply(e,arguments),nE(e)}function lB(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],s=e[r],a;return sMath.pow(e,t)}function Z_e(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 yA(e){return(t,n)=>-e(-t,n)}function ebe(e){const t=e(gA,vA),n=t.domain;let r=10,i,s;function a(){return i=Z_e(r),s=J_e(r),n()[0]<0?(i=yA(i),s=yA(s),e(Y_e,X_e)):e(gA,vA),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],h=l[l.length-1];const d=h0){for(;f<=m;++f)for(_=1;_h)break;g.push(v)}}else for(;f<=m;++f)for(_=r-1;_>=1;--_)if(v=f>0?_/s(-f):_*s(f),!(vh)break;g.push(v)}g.length*2{if(o==null&&(o=10),l==null&&(l=r===10?"s":","),typeof l!="function"&&(!(r%1)&&(l=Ff(l)).precision==null&&(l.trim=!0),l=Bp(l)),o===1/0)return l;const c=Math.max(1,r*o/t.ticks().length);return h=>{let d=h/s(Math.round(i(h)));return d*rn(lB(n(),{floor:o=>s(Math.floor(i(o))),ceil:o=>s(Math.ceil(i(o)))})),t}function cB(){const e=ebe(eE()).domain([1,10]);return e.copy=()=>ly(e,cB()).base(e.base()),Hl.apply(e,arguments),e}function xA(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function _A(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function tbe(e){var t=1,n=e(xA(t),_A(t));return n.constant=function(r){return arguments.length?e(xA(t=+r),_A(t)):t},nE(n)}function uB(){var e=tbe(eE());return e.copy=function(){return ly(e,uB()).constant(e.constant())},Hl.apply(e,arguments)}const L_=new Date,N_=new Date;function Rn(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(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),!(s0))return l;let c;do l.push(c=new Date(+s)),t(s,o),e(s);while(cRn(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)=>(L_.setTime(+s),N_.setTime(+a),e(L_),e(N_),Math.floor(n(L_,N_))),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 r0=Rn(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);r0.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Rn(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):r0);r0.range;const Ws=1e3,si=Ws*60,Us=si*60,oo=Us*24,rE=oo*7,bA=oo*30,P_=oo*365,Ua=Rn(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Ws)},(e,t)=>(t-e)/Ws,e=>e.getUTCSeconds());Ua.range;const iE=Rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ws)},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getMinutes());iE.range;const sE=Rn(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*si)},(e,t)=>(t-e)/si,e=>e.getUTCMinutes());sE.range;const oE=Rn(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Ws-e.getMinutes()*si)},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getHours());oE.range;const aE=Rn(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*Us)},(e,t)=>(t-e)/Us,e=>e.getUTCHours());aE.range;const lE=Rn(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*si)/oo,e=>e.getDate()-1);lE.range;const dB=Rn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/oo,e=>e.getUTCDate()-1);dB.range;const hB=Rn(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/oo,e=>Math.floor(e/oo));hB.range;function Wl(e){return Rn(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())*si)/rE)}const cE=Wl(0),nbe=Wl(1),rbe=Wl(2),ibe=Wl(3),sbe=Wl(4),obe=Wl(5),abe=Wl(6);cE.range;nbe.range;rbe.range;ibe.range;sbe.range;obe.range;abe.range;function Ul(e){return Rn(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)/rE)}const uE=Ul(0),lbe=Ul(1),cbe=Ul(2),ube=Ul(3),dbe=Ul(4),hbe=Ul(5),fbe=Ul(6);uE.range;lbe.range;cbe.range;ube.range;dbe.range;hbe.range;fbe.range;const dE=Rn(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());dE.range;const hE=Rn(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());hE.range;const cy=Rn(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());cy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rn(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)});cy.range;const uy=Rn(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());uy.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:Rn(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)});uy.range;function fB(e,t,n,r,i,s){const a=[[Ua,1,Ws],[Ua,5,5*Ws],[Ua,15,15*Ws],[Ua,30,30*Ws],[s,1,si],[s,5,5*si],[s,15,15*si],[s,30,30*si],[i,1,Us],[i,3,3*Us],[i,6,6*Us],[i,12,12*Us],[r,1,oo],[r,2,2*oo],[n,1,rE],[t,1,bA],[t,3,3*bA],[e,1,P_]];function o(c,h,d){const f=hy).right(a,f);if(m===a.length)return e.every(j2(c/P_,h/P_,d));if(m===0)return r0.every(Math.max(j2(c,h,d),1));const[_,v]=a[f/a[m-1][2]0))return l;do l.push(c=new Date(+s)),t(s,o),e(s);while(c=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 O_.setTime(+s),I_.setTime(+a),e(O_),e(I_),Math.floor(n(O_,I_))},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 zf=yn(function(){},function(e,t){e.setTime(+e+t)},function(e,t){return t-e});zf.every=function(e){return e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?yn(function(t){t.setTime(Math.floor(t/e)*e)},function(t,n){t.setTime(+t+n*e)},function(t,n){return(n-t)/e}):zf};zf.range;var i0=1e3,wl=6e4,s0=36e5,pB=864e5,mB=6048e5,L2=yn(function(e){e.setTime(e-e.getMilliseconds())},function(e,t){e.setTime(+e+t*i0)},function(e,t){return(t-e)/i0},function(e){return e.getUTCSeconds()});L2.range;var gB=yn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*i0)},function(e,t){e.setTime(+e+t*wl)},function(e,t){return(t-e)/wl},function(e){return e.getMinutes()});gB.range;var vB=yn(function(e){e.setTime(e-e.getMilliseconds()-e.getSeconds()*i0-e.getMinutes()*wl)},function(e,t){e.setTime(+e+t*s0)},function(e,t){return(t-e)/s0},function(e){return e.getHours()});vB.range;var fE=yn(function(e){e.setHours(0,0,0,0)},function(e,t){e.setDate(e.getDate()+t)},function(e,t){return(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*wl)/pB},function(e){return e.getDate()-1});fE.range;function Vl(e){return yn(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())*wl)/mB})}var o0=Vl(0),Hf=Vl(1),yB=Vl(2),xB=Vl(3),Sl=Vl(4),_B=Vl(5),bB=Vl(6);o0.range;Hf.range;yB.range;xB.range;Sl.range;_B.range;bB.range;var wB=yn(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()});wB.range;var da=yn(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()});da.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:yn(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)})};da.range;var SB=yn(function(e){e.setUTCSeconds(0,0)},function(e,t){e.setTime(+e+t*wl)},function(e,t){return(t-e)/wl},function(e){return e.getUTCMinutes()});SB.range;var CB=yn(function(e){e.setUTCMinutes(0,0,0)},function(e,t){e.setTime(+e+t*s0)},function(e,t){return(t-e)/s0},function(e){return e.getUTCHours()});CB.range;var pE=yn(function(e){e.setUTCHours(0,0,0,0)},function(e,t){e.setUTCDate(e.getUTCDate()+t)},function(e,t){return(t-e)/pB},function(e){return e.getUTCDate()-1});pE.range;function ql(e){return yn(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)/mB})}var a0=ql(0),Wf=ql(1),kB=ql(2),EB=ql(3),Cl=ql(4),TB=ql(5),RB=ql(6);a0.range;Wf.range;kB.range;EB.range;Cl.range;TB.range;RB.range;var MB=yn(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()});MB.range;var ha=yn(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()});ha.every=function(e){return!isFinite(e=Math.floor(e))||!(e>0)?null:yn(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)})};ha.range;function $_(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 B_(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 Gd(e,t,n){return{y:e,m:t,d:n,H:0,M:0,S:0,L:0}}function ybe(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=Kd(i),h=Yd(i),d=Kd(s),f=Yd(s),m=Kd(a),_=Yd(a),v=Kd(o),y=Yd(o),g=Kd(l),p=Yd(l),x={a:z,A:O,b:A,B:j,c:null,d:TA,e:TA,f:zbe,g:Qbe,G:Zbe,H:$be,I:Bbe,j:Fbe,L:AB,m:Hbe,M:Wbe,p:F,q:H,Q:AA,s:jA,S:Ube,u:Vbe,U:qbe,V:Gbe,w:Kbe,W:Ybe,x:null,X:null,y:Xbe,Y:Jbe,Z:ewe,"%":MA},b={a:B,A:G,b:Z,B:X,c:null,d:RA,e:RA,f:iwe,g:pwe,G:gwe,H:twe,I:nwe,j:rwe,L:DB,m:swe,M:owe,p:W,q:$,Q:AA,s:jA,S:awe,u:lwe,U:cwe,V:uwe,w:dwe,W:hwe,x:null,X:null,y:fwe,Y:mwe,Z:vwe,"%":MA},S={a:R,A:M,b:D,B:N,c:L,d:kA,e:kA,f:Nbe,g:CA,G:SA,H:EA,I:EA,j:Abe,L:Lbe,m:Mbe,M:jbe,p:T,q:Rbe,Q:Obe,s:Ibe,S:Dbe,u:Sbe,U:Cbe,V:kbe,w:wbe,W:Ebe,x:P,X:I,y:CA,Y:SA,Z:Tbe,"%":Pbe};x.x=C(n,x),x.X=C(r,x),x.c=C(t,x),b.x=C(n,b),b.X=C(r,b),b.c=C(t,b);function C(V,U){return function(Q){var q=[],ie=-1,re=0,ce=V.length,ye,le,Re;for(Q instanceof Date||(Q=new Date(+Q));++ie53)return null;"w"in q||(q.w=1),"Z"in q?(re=B_(Gd(q.y,0,1)),ce=re.getUTCDay(),re=ce>4||ce===0?Wf.ceil(re):Wf(re),re=pE.offset(re,(q.V-1)*7),q.y=re.getUTCFullYear(),q.m=re.getUTCMonth(),q.d=re.getUTCDate()+(q.w+6)%7):(re=$_(Gd(q.y,0,1)),ce=re.getDay(),re=ce>4||ce===0?Hf.ceil(re):Hf(re),re=fE.offset(re,(q.V-1)*7),q.y=re.getFullYear(),q.m=re.getMonth(),q.d=re.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),ce="Z"in q?B_(Gd(q.y,0,1)).getUTCDay():$_(Gd(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(ce+5)%7:q.w+q.U*7-(ce+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,B_(q)):$_(q)}}function k(V,U,Q,q){for(var ie=0,re=U.length,ce=Q.length,ye,le;ie=ce)return-1;if(ye=U.charCodeAt(ie++),ye===37){if(ye=U.charAt(ie++),le=S[ye in wA?U.charAt(ie++):ye],!le||(q=le(V,Q,q))<0)return-1}else if(ye!=Q.charCodeAt(q++))return-1}return q}function T(V,U,Q){var q=c.exec(U.slice(Q));return q?(V.p=h.get(q[0].toLowerCase()),Q+q[0].length):-1}function R(V,U,Q){var q=m.exec(U.slice(Q));return q?(V.w=_.get(q[0].toLowerCase()),Q+q[0].length):-1}function M(V,U,Q){var q=d.exec(U.slice(Q));return q?(V.w=f.get(q[0].toLowerCase()),Q+q[0].length):-1}function D(V,U,Q){var q=g.exec(U.slice(Q));return q?(V.m=p.get(q[0].toLowerCase()),Q+q[0].length):-1}function N(V,U,Q){var q=v.exec(U.slice(Q));return q?(V.m=y.get(q[0].toLowerCase()),Q+q[0].length):-1}function L(V,U,Q){return k(V,t,U,Q)}function P(V,U,Q){return k(V,n,U,Q)}function I(V,U,Q){return k(V,r,U,Q)}function z(V){return a[V.getDay()]}function O(V){return s[V.getDay()]}function A(V){return l[V.getMonth()]}function j(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 Z(V){return l[V.getUTCMonth()]}function X(V){return o[V.getUTCMonth()]}function W(V){return i[+(V.getUTCHours()>=12)]}function $(V){return 1+~~(V.getUTCMonth()/3)}return{format:function(V){var U=C(V+="",x);return U.toString=function(){return V},U},parse:function(V){var U=E(V+="",!1);return U.toString=function(){return V},U},utcFormat:function(V){var U=C(V+="",b);return U.toString=function(){return V},U},utcParse:function(V){var U=E(V+="",!0);return U.toString=function(){return V},U}}}var wA={"-":"",_:" ",0:"0"},Pn=/^\s*\d+/,xbe=/^%/,_be=/[\\^$*+?|[\]().{}]/g;function vt(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",s=i.length;return r+(s[t.toLowerCase(),n]))}function wbe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Sbe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Cbe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function kbe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function Ebe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function SA(e,t,n){var r=Pn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function CA(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Tbe(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 Rbe(e,t,n){var r=Pn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Mbe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function kA(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function Abe(e,t,n){var r=Pn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function EA(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function jbe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function Dbe(e,t,n){var r=Pn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Lbe(e,t,n){var r=Pn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function Nbe(e,t,n){var r=Pn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Pbe(e,t,n){var r=xbe.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Obe(e,t,n){var r=Pn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Ibe(e,t,n){var r=Pn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function TA(e,t){return vt(e.getDate(),t,2)}function $be(e,t){return vt(e.getHours(),t,2)}function Bbe(e,t){return vt(e.getHours()%12||12,t,2)}function Fbe(e,t){return vt(1+fE.count(da(e),e),t,3)}function AB(e,t){return vt(e.getMilliseconds(),t,3)}function zbe(e,t){return AB(e,t)+"000"}function Hbe(e,t){return vt(e.getMonth()+1,t,2)}function Wbe(e,t){return vt(e.getMinutes(),t,2)}function Ube(e,t){return vt(e.getSeconds(),t,2)}function Vbe(e){var t=e.getDay();return t===0?7:t}function qbe(e,t){return vt(o0.count(da(e)-1,e),t,2)}function jB(e){var t=e.getDay();return t>=4||t===0?Sl(e):Sl.ceil(e)}function Gbe(e,t){return e=jB(e),vt(Sl.count(da(e),e)+(da(e).getDay()===4),t,2)}function Kbe(e){return e.getDay()}function Ybe(e,t){return vt(Hf.count(da(e)-1,e),t,2)}function Xbe(e,t){return vt(e.getFullYear()%100,t,2)}function Qbe(e,t){return e=jB(e),vt(e.getFullYear()%100,t,2)}function Jbe(e,t){return vt(e.getFullYear()%1e4,t,4)}function Zbe(e,t){var n=e.getDay();return e=n>=4||n===0?Sl(e):Sl.ceil(e),vt(e.getFullYear()%1e4,t,4)}function ewe(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+vt(t/60|0,"0",2)+vt(t%60,"0",2)}function RA(e,t){return vt(e.getUTCDate(),t,2)}function twe(e,t){return vt(e.getUTCHours(),t,2)}function nwe(e,t){return vt(e.getUTCHours()%12||12,t,2)}function rwe(e,t){return vt(1+pE.count(ha(e),e),t,3)}function DB(e,t){return vt(e.getUTCMilliseconds(),t,3)}function iwe(e,t){return DB(e,t)+"000"}function swe(e,t){return vt(e.getUTCMonth()+1,t,2)}function owe(e,t){return vt(e.getUTCMinutes(),t,2)}function awe(e,t){return vt(e.getUTCSeconds(),t,2)}function lwe(e){var t=e.getUTCDay();return t===0?7:t}function cwe(e,t){return vt(a0.count(ha(e)-1,e),t,2)}function LB(e){var t=e.getUTCDay();return t>=4||t===0?Cl(e):Cl.ceil(e)}function uwe(e,t){return e=LB(e),vt(Cl.count(ha(e),e)+(ha(e).getUTCDay()===4),t,2)}function dwe(e){return e.getUTCDay()}function hwe(e,t){return vt(Wf.count(ha(e)-1,e),t,2)}function fwe(e,t){return vt(e.getUTCFullYear()%100,t,2)}function pwe(e,t){return e=LB(e),vt(e.getUTCFullYear()%100,t,2)}function mwe(e,t){return vt(e.getUTCFullYear()%1e4,t,4)}function gwe(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Cl(e):Cl.ceil(e),vt(e.getUTCFullYear()%1e4,t,4)}function vwe(){return"+0000"}function MA(){return"%"}function AA(e){return+e}function jA(e){return Math.floor(+e/1e3)}var cc,dy,NB,PB,OB;ywe({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 ywe(e){return cc=ybe(e),dy=cc.format,NB=cc.parse,PB=cc.utcFormat,OB=cc.utcParse,cc}function xwe(e){return new Date(e)}function _we(e){return e instanceof Date?+e:+new Date(+e)}function mE(e,t,n,r,i,s,a,o,l,c){var h=sB(),d=h.invert,f=h.domain,m=c(".%L"),_=c(":%S"),v=c("%I:%M"),y=c("%I %p"),g=c("%a %d"),p=c("%b %d"),x=c("%B"),b=c("%Y");function S(C){return(l(C)qxe(e[e.length-1]);var hy=new Array(3).concat("d8b365f5f5f55ab4ac","a6611adfc27d80cdc1018571","a6611adfc27df5f5f580cdc1018571","8c510ad8b365f6e8c3c7eae55ab4ac01665e","8c510ad8b365f6e8c3f5f5f5c7eae55ab4ac01665e","8c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e","8c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e","5430058c510abf812ddfc27df6e8c3c7eae580cdc135978f01665e003c30","5430058c510abf812ddfc27df6e8c3f5f5f5c7eae580cdc135978f01665e003c30").map(Je);const kwe=Dt(hy);var fy=new Array(3).concat("af8dc3f7f7f77fbf7b","7b3294c2a5cfa6dba0008837","7b3294c2a5cff7f7f7a6dba0008837","762a83af8dc3e7d4e8d9f0d37fbf7b1b7837","762a83af8dc3e7d4e8f7f7f7d9f0d37fbf7b1b7837","762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b7837","762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b7837","40004b762a839970abc2a5cfe7d4e8d9f0d3a6dba05aae611b783700441b","40004b762a839970abc2a5cfe7d4e8f7f7f7d9f0d3a6dba05aae611b783700441b").map(Je);const Ewe=Dt(fy);var py=new Array(3).concat("e9a3c9f7f7f7a1d76a","d01c8bf1b6dab8e1864dac26","d01c8bf1b6daf7f7f7b8e1864dac26","c51b7de9a3c9fde0efe6f5d0a1d76a4d9221","c51b7de9a3c9fde0eff7f7f7e6f5d0a1d76a4d9221","c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221","c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221","8e0152c51b7dde77aef1b6dafde0efe6f5d0b8e1867fbc414d9221276419","8e0152c51b7dde77aef1b6dafde0eff7f7f7e6f5d0b8e1867fbc414d9221276419").map(Je);const Twe=Dt(py);var my=new Array(3).concat("998ec3f7f7f7f1a340","5e3c99b2abd2fdb863e66101","5e3c99b2abd2f7f7f7fdb863e66101","542788998ec3d8daebfee0b6f1a340b35806","542788998ec3d8daebf7f7f7fee0b6f1a340b35806","5427888073acb2abd2d8daebfee0b6fdb863e08214b35806","5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b35806","2d004b5427888073acb2abd2d8daebfee0b6fdb863e08214b358067f3b08","2d004b5427888073acb2abd2d8daebf7f7f7fee0b6fdb863e08214b358067f3b08").map(Je);const Rwe=Dt(my);var gy=new Array(3).concat("ef8a62f7f7f767a9cf","ca0020f4a58292c5de0571b0","ca0020f4a582f7f7f792c5de0571b0","b2182bef8a62fddbc7d1e5f067a9cf2166ac","b2182bef8a62fddbc7f7f7f7d1e5f067a9cf2166ac","b2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac","b2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac","67001fb2182bd6604df4a582fddbc7d1e5f092c5de4393c32166ac053061","67001fb2182bd6604df4a582fddbc7f7f7f7d1e5f092c5de4393c32166ac053061").map(Je);const Mwe=Dt(gy);var vy=new Array(3).concat("ef8a62ffffff999999","ca0020f4a582bababa404040","ca0020f4a582ffffffbababa404040","b2182bef8a62fddbc7e0e0e09999994d4d4d","b2182bef8a62fddbc7ffffffe0e0e09999994d4d4d","b2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d","b2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d","67001fb2182bd6604df4a582fddbc7e0e0e0bababa8787874d4d4d1a1a1a","67001fb2182bd6604df4a582fddbc7ffffffe0e0e0bababa8787874d4d4d1a1a1a").map(Je);const Awe=Dt(vy);var yy=new Array(3).concat("fc8d59ffffbf91bfdb","d7191cfdae61abd9e92c7bb6","d7191cfdae61ffffbfabd9e92c7bb6","d73027fc8d59fee090e0f3f891bfdb4575b4","d73027fc8d59fee090ffffbfe0f3f891bfdb4575b4","d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4","d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4","a50026d73027f46d43fdae61fee090e0f3f8abd9e974add14575b4313695","a50026d73027f46d43fdae61fee090ffffbfe0f3f8abd9e974add14575b4313695").map(Je);const jwe=Dt(yy);var xy=new Array(3).concat("fc8d59ffffbf91cf60","d7191cfdae61a6d96a1a9641","d7191cfdae61ffffbfa6d96a1a9641","d73027fc8d59fee08bd9ef8b91cf601a9850","d73027fc8d59fee08bffffbfd9ef8b91cf601a9850","d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850","d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850","a50026d73027f46d43fdae61fee08bd9ef8ba6d96a66bd631a9850006837","a50026d73027f46d43fdae61fee08bffffbfd9ef8ba6d96a66bd631a9850006837").map(Je);const qB=Dt(xy);var _y=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map(Je);const Dwe=Dt(_y);var by=new Array(3).concat("e5f5f999d8c92ca25f","edf8fbb2e2e266c2a4238b45","edf8fbb2e2e266c2a42ca25f006d2c","edf8fbccece699d8c966c2a42ca25f006d2c","edf8fbccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45005824","f7fcfde5f5f9ccece699d8c966c2a441ae76238b45006d2c00441b").map(Je);const Lwe=Dt(by);var wy=new Array(3).concat("e0ecf49ebcda8856a7","edf8fbb3cde38c96c688419d","edf8fbb3cde38c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68856a7810f7c","edf8fbbfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d6e016b","f7fcfde0ecf4bfd3e69ebcda8c96c68c6bb188419d810f7c4d004b").map(Je);const Nwe=Dt(wy);var Sy=new Array(3).concat("e0f3dba8ddb543a2ca","f0f9e8bae4bc7bccc42b8cbe","f0f9e8bae4bc7bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc443a2ca0868ac","f0f9e8ccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe08589e","f7fcf0e0f3dbccebc5a8ddb57bccc44eb3d32b8cbe0868ac084081").map(Je);const Pwe=Dt(Sy);var Cy=new Array(3).concat("fee8c8fdbb84e34a33","fef0d9fdcc8afc8d59d7301f","fef0d9fdcc8afc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59e34a33b30000","fef0d9fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301f990000","fff7ecfee8c8fdd49efdbb84fc8d59ef6548d7301fb300007f0000").map(Je);const Owe=Dt(Cy);var ky=new Array(3).concat("ece2f0a6bddb1c9099","f6eff7bdc9e167a9cf02818a","f6eff7bdc9e167a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf1c9099016c59","f6eff7d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016450","fff7fbece2f0d0d1e6a6bddb67a9cf3690c002818a016c59014636").map(Je);const Iwe=Dt(ky);var Ey=new Array(3).concat("ece7f2a6bddb2b8cbe","f1eef6bdc9e174a9cf0570b0","f1eef6bdc9e174a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf2b8cbe045a8d","f1eef6d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0034e7b","fff7fbece7f2d0d1e6a6bddb74a9cf3690c00570b0045a8d023858").map(Je);const $we=Dt(Ey);var Ty=new Array(3).concat("e7e1efc994c7dd1c77","f1eef6d7b5d8df65b0ce1256","f1eef6d7b5d8df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0dd1c77980043","f1eef6d4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125691003f","f7f4f9e7e1efd4b9dac994c7df65b0e7298ace125698004367001f").map(Je);const Bwe=Dt(Ty);var Ry=new Array(3).concat("fde0ddfa9fb5c51b8a","feebe2fbb4b9f768a1ae017e","feebe2fbb4b9f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1c51b8a7a0177","feebe2fcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a0177","fff7f3fde0ddfcc5c0fa9fb5f768a1dd3497ae017e7a017749006a").map(Je);const Fwe=Dt(Ry);var My=new Array(3).concat("edf8b17fcdbb2c7fb8","ffffcca1dab441b6c4225ea8","ffffcca1dab441b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c42c7fb8253494","ffffccc7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea80c2c84","ffffd9edf8b1c7e9b47fcdbb41b6c41d91c0225ea8253494081d58").map(Je);const zwe=Dt(My);var Ay=new Array(3).concat("f7fcb9addd8e31a354","ffffccc2e69978c679238443","ffffccc2e69978c67931a354006837","ffffccd9f0a3addd8e78c67931a354006837","ffffccd9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443005a32","ffffe5f7fcb9d9f0a3addd8e78c67941ab5d238443006837004529").map(Je);const GB=Dt(Ay);var jy=new Array(3).concat("fff7bcfec44fd95f0e","ffffd4fed98efe9929cc4c02","ffffd4fed98efe9929d95f0e993404","ffffd4fee391fec44ffe9929d95f0e993404","ffffd4fee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c028c2d04","ffffe5fff7bcfee391fec44ffe9929ec7014cc4c02993404662506").map(Je);const Hwe=Dt(jy);var Dy=new Array(3).concat("ffeda0feb24cf03b20","ffffb2fecc5cfd8d3ce31a1c","ffffb2fecc5cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cf03b20bd0026","ffffb2fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cb10026","ffffccffeda0fed976feb24cfd8d3cfc4e2ae31a1cbd0026800026").map(Je);const KB=Dt(Dy);var Ly=new Array(3).concat("deebf79ecae13182bd","eff3ffbdd7e76baed62171b5","eff3ffbdd7e76baed63182bd08519c","eff3ffc6dbef9ecae16baed63182bd08519c","eff3ffc6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b5084594","f7fbffdeebf7c6dbef9ecae16baed64292c62171b508519c08306b").map(Je);const Wwe=Dt(Ly);var Ny=new Array(3).concat("e5f5e0a1d99b31a354","edf8e9bae4b374c476238b45","edf8e9bae4b374c47631a354006d2c","edf8e9c7e9c0a1d99b74c47631a354006d2c","edf8e9c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45005a32","f7fcf5e5f5e0c7e9c0a1d99b74c47641ab5d238b45006d2c00441b").map(Je);const Uwe=Dt(Ny);var Py=new Array(3).concat("f0f0f0bdbdbd636363","f7f7f7cccccc969696525252","f7f7f7cccccc969696636363252525","f7f7f7d9d9d9bdbdbd969696636363252525","f7f7f7d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525","fffffff0f0f0d9d9d9bdbdbd969696737373525252252525000000").map(Je);const Vwe=Dt(Py);var Oy=new Array(3).concat("efedf5bcbddc756bb1","f2f0f7cbc9e29e9ac86a51a3","f2f0f7cbc9e29e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8756bb154278f","f2f0f7dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a34a1486","fcfbfdefedf5dadaebbcbddc9e9ac8807dba6a51a354278f3f007d").map(Je);const qwe=Dt(Oy);var Iy=new Array(3).concat("fee0d2fc9272de2d26","fee5d9fcae91fb6a4acb181d","fee5d9fcae91fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4ade2d26a50f15","fee5d9fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181d99000d","fff5f0fee0d2fcbba1fc9272fb6a4aef3b2ccb181da50f1567000d").map(Je);const Gwe=Dt(Iy);var $y=new Array(3).concat("fee6cefdae6be6550d","feeddefdbe85fd8d3cd94701","feeddefdbe85fd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3ce6550da63603","feeddefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d948018c2d04","fff5ebfee6cefdd0a2fdae6bfd8d3cf16913d94801a636037f2704").map(Je);const Kwe=Dt($y);function Ywe(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 Xwe=Jk(xs(300,.5,0),xs(-240,.5,1));var Qwe=Jk(xs(-100,.75,.35),xs(80,1.5,.8)),YB=Jk(xs(260,.75,.35),xs(80,1.5,.8)),Hm=xs();function Jwe(e){(e<0||e>1)&&(e-=Math.floor(e));var t=Math.abs(e-.5);return Hm.h=360*e-100,Hm.s=1.5-1.5*t,Hm.l=.8-.9*t,Hm+""}var Wm=Mu(),Zwe=Math.PI/3,e2e=Math.PI*2/3;function t2e(e){var t;return e=(.5-e)*Math.PI,Wm.r=255*(t=Math.sin(e))*t,Wm.g=255*(t=Math.sin(e+Zwe))*t,Wm.b=255*(t=Math.sin(e+e2e))*t,Wm+""}function n2e(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 By(e){var t=e.length;return function(n){return e[Math.max(0,Math.min(t-1,Math.floor(n*t)))]}}const XB=By(Je("44015444025645045745055946075a46085c460a5d460b5e470d60470e6147106347116447136548146748166848176948186a481a6c481b6d481c6e481d6f481f70482071482173482374482475482576482677482878482979472a7a472c7a472d7b472e7c472f7d46307e46327e46337f463480453581453781453882443983443a83443b84433d84433e85423f854240864241864142874144874045884046883f47883f48893e49893e4a893e4c8a3d4d8a3d4e8a3c4f8a3c508b3b518b3b528b3a538b3a548c39558c39568c38588c38598c375a8c375b8d365c8d365d8d355e8d355f8d34608d34618d33628d33638d32648e32658e31668e31678e31688e30698e306a8e2f6b8e2f6c8e2e6d8e2e6e8e2e6f8e2d708e2d718e2c718e2c728e2c738e2b748e2b758e2a768e2a778e2a788e29798e297a8e297b8e287c8e287d8e277e8e277f8e27808e26818e26828e26828e25838e25848e25858e24868e24878e23888e23898e238a8d228b8d228c8d228d8d218e8d218f8d21908d21918c20928c20928c20938c1f948c1f958b1f968b1f978b1f988b1f998a1f9a8a1e9b8a1e9c891e9d891f9e891f9f881fa0881fa1881fa1871fa28720a38620a48621a58521a68522a78522a88423a98324aa8325ab8225ac8226ad8127ad8128ae8029af7f2ab07f2cb17e2db27d2eb37c2fb47c31b57b32b67a34b67935b77937b87838b9773aba763bbb753dbc743fbc7340bd7242be7144bf7046c06f48c16e4ac16d4cc26c4ec36b50c46a52c56954c56856c66758c7655ac8645cc8635ec96260ca6063cb5f65cb5e67cc5c69cd5b6ccd5a6ece5870cf5773d05675d05477d1537ad1517cd2507fd34e81d34d84d44b86d54989d5488bd6468ed64590d74393d74195d84098d83e9bd93c9dd93ba0da39a2da37a5db36a8db34aadc32addc30b0dd2fb2dd2db5de2bb8de29bade28bddf26c0df25c2df23c5e021c8e020cae11fcde11dd0e11cd2e21bd5e21ad8e219dae319dde318dfe318e2e418e5e419e7e419eae51aece51befe51cf1e51df4e61ef6e620f8e621fbe723fde725"));var r2e=By(Je("00000401000501010601010802010902020b02020d03030f03031204041405041606051806051a07061c08071e0907200a08220b09240c09260d0a290e0b2b100b2d110c2f120d31130d34140e36150e38160f3b180f3d19103f1a10421c10441d11471e114920114b21114e22115024125325125527125829115a2a115c2c115f2d11612f116331116533106734106936106b38106c390f6e3b0f703d0f713f0f72400f74420f75440f764510774710784910784a10794c117a4e117b4f127b51127c52137c54137d56147d57157e59157e5a167e5c167f5d177f5f187f601880621980641a80651a80671b80681c816a1c816b1d816d1d816e1e81701f81721f817320817521817621817822817922827b23827c23827e24828025828125818326818426818627818827818928818b29818c29818e2a81902a81912b81932b80942c80962c80982d80992d809b2e7f9c2e7f9e2f7fa02f7fa1307ea3307ea5317ea6317da8327daa337dab337cad347cae347bb0357bb2357bb3367ab5367ab73779b83779ba3878bc3978bd3977bf3a77c03a76c23b75c43c75c53c74c73d73c83e73ca3e72cc3f71cd4071cf4070d0416fd2426fd3436ed5446dd6456cd8456cd9466bdb476adc4869de4968df4a68e04c67e24d66e34e65e44f64e55064e75263e85362e95462ea5661eb5760ec5860ed5a5fee5b5eef5d5ef05f5ef1605df2625df2645cf3655cf4675cf4695cf56b5cf66c5cf66e5cf7705cf7725cf8745cf8765cf9785df9795df97b5dfa7d5efa7f5efa815ffb835ffb8560fb8761fc8961fc8a62fc8c63fc8e64fc9065fd9266fd9467fd9668fd9869fd9a6afd9b6bfe9d6cfe9f6dfea16efea36ffea571fea772fea973feaa74feac76feae77feb078feb27afeb47bfeb67cfeb77efeb97ffebb81febd82febf84fec185fec287fec488fec68afec88cfeca8dfecc8ffecd90fecf92fed194fed395fed597fed799fed89afdda9cfddc9efddea0fde0a1fde2a3fde3a5fde5a7fde7a9fde9aafdebacfcecaefceeb0fcf0b2fcf2b4fcf4b6fcf6b8fcf7b9fcf9bbfcfbbdfcfdbf")),i2e=By(Je("00000401000501010601010802010a02020c02020e03021004031204031405041706041907051b08051d09061f0a07220b07240c08260d08290e092b10092d110a30120a32140b34150b37160b39180c3c190c3e1b0c411c0c431e0c451f0c48210c4a230c4c240c4f260c51280b53290b552b0b572d0b592f0a5b310a5c320a5e340a5f3609613809623909633b09643d09653e0966400a67420a68440a68450a69470b6a490b6a4a0c6b4c0c6b4d0d6c4f0d6c510e6c520e6d540f6d550f6d57106e59106e5a116e5c126e5d126e5f136e61136e62146e64156e65156e67166e69166e6a176e6c186e6d186e6f196e71196e721a6e741a6e751b6e771c6d781c6d7a1d6d7c1d6d7d1e6d7f1e6c801f6c82206c84206b85216b87216b88226a8a226a8c23698d23698f24699025689225689326679526679727669827669a28659b29649d29649f2a63a02a63a22b62a32c61a52c60a62d60a82e5fa92e5eab2f5ead305dae305cb0315bb1325ab3325ab43359b63458b73557b93556ba3655bc3754bd3853bf3952c03a51c13a50c33b4fc43c4ec63d4dc73e4cc83f4bca404acb4149cc4248ce4347cf4446d04545d24644d34743d44842d54a41d74b3fd84c3ed94d3dda4e3cdb503bdd513ade5238df5337e05536e15635e25734e35933e45a31e55c30e65d2fe75e2ee8602de9612bea632aeb6429eb6628ec6726ed6925ee6a24ef6c23ef6e21f06f20f1711ff1731df2741cf3761bf37819f47918f57b17f57d15f67e14f68013f78212f78410f8850ff8870ef8890cf98b0bf98c0af98e09fa9008fa9207fa9407fb9606fb9706fb9906fb9b06fb9d07fc9f07fca108fca309fca50afca60cfca80dfcaa0ffcac11fcae12fcb014fcb216fcb418fbb61afbb81dfbba1ffbbc21fbbe23fac026fac228fac42afac62df9c72ff9c932f9cb35f8cd37f8cf3af7d13df7d340f6d543f6d746f5d949f5db4cf4dd4ff4df53f4e156f3e35af3e55df2e661f2e865f2ea69f1ec6df1ed71f1ef75f1f179f2f27df2f482f3f586f3f68af4f88ef5f992f6fa96f8fb9af9fc9dfafda1fcffa4")),s2e=By(Je("0d088710078813078916078a19068c1b068d1d068e20068f2206902406912605912805922a05932c05942e05952f059631059733059735049837049938049a3a049a3c049b3e049c3f049c41049d43039e44039e46039f48039f4903a04b03a14c02a14e02a25002a25102a35302a35502a45601a45801a45901a55b01a55c01a65e01a66001a66100a76300a76400a76600a76700a86900a86a00a86c00a86e00a86f00a87100a87201a87401a87501a87701a87801a87a02a87b02a87d03a87e03a88004a88104a78305a78405a78606a68707a68808a68a09a58b0aa58d0ba58e0ca48f0da4910ea3920fa39410a29511a19613a19814a099159f9a169f9c179e9d189d9e199da01a9ca11b9ba21d9aa31e9aa51f99a62098a72197a82296aa2395ab2494ac2694ad2793ae2892b02991b12a90b22b8fb32c8eb42e8db52f8cb6308bb7318ab83289ba3388bb3488bc3587bd3786be3885bf3984c03a83c13b82c23c81c33d80c43e7fc5407ec6417dc7427cc8437bc9447aca457acb4679cc4778cc4977cd4a76ce4b75cf4c74d04d73d14e72d24f71d35171d45270d5536fd5546ed6556dd7566cd8576bd9586ada5a6ada5b69db5c68dc5d67dd5e66de5f65de6164df6263e06363e16462e26561e26660e3685fe4695ee56a5de56b5de66c5ce76e5be76f5ae87059e97158e97257ea7457eb7556eb7655ec7754ed7953ed7a52ee7b51ef7c51ef7e50f07f4ff0804ef1814df1834cf2844bf3854bf3874af48849f48948f58b47f58c46f68d45f68f44f79044f79143f79342f89441f89540f9973ff9983ef99a3efa9b3dfa9c3cfa9e3bfb9f3afba139fba238fca338fca537fca636fca835fca934fdab33fdac33fdae32fdaf31fdb130fdb22ffdb42ffdb52efeb72dfeb82cfeba2cfebb2bfebd2afebe2afec029fdc229fdc328fdc527fdc627fdc827fdca26fdcb26fccd25fcce25fcd025fcd225fbd324fbd524fbd724fad824fada24f9dc24f9dd25f8df25f8e125f7e225f7e425f6e626f6e826f5e926f5eb27f4ed27f3ee27f3f027f2f227f1f426f1f525f0f724f0f921")),o2e="__lodash_hash_undefined__";function a2e(e){return this.__data__.set(e,o2e),this}var l2e=a2e;function c2e(e){return this.__data__.has(e)}var u2e=c2e,d2e=Pk,h2e=l2e,f2e=u2e;function l0(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new d2e;++t-1}var QB=E2e;function T2e(e,t,n){for(var r=-1,i=e==null?0:e.length;++r=P2e&&(s=N2e,a=!1,t=new M2e(t));e:for(;++i1?0:e<-1?Uf:Math.acos(e)}function LA(e){return e>=1?c0:e<=-1?-c0:Math.asin(e)}const N2=Math.PI,P2=2*N2,Da=1e-6,V2e=P2-Da;function eF(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return eF;const n=10**t;return function(r){this._+=r[0];for(let i=1,s=r.length;iDa)if(!(Math.abs(d*l-c*h)>Da)||!s)this._append`L${this._x1=t},${this._y1=n}`;else{let m=r-a,_=i-o,v=l*l+c*c,y=m*m+_*_,g=Math.sqrt(v),p=Math.sqrt(f),x=s*Math.tan((N2-Math.acos((v+f-y)/(2*g*p)))/2),b=x/p,S=x/g;Math.abs(b-1)>Da&&this._append`L${t+b*h},${n+b*d}`,this._append`A${s},${s},0,0,${+(d*m>h*_)},${this._x1=t+S*l},${this._y1=n+S*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,h=n+l,d=1^a,f=a?i-s:s-i;this._x1===null?this._append`M${c},${h}`:(Math.abs(this._x1-c)>Da||Math.abs(this._y1-h)>Da)&&this._append`L${c},${h}`,r&&(f<0&&(f=f%P2+P2),f>V2e?this._append`A${r},${r},0,1,${d},${t-o},${n-l}A${r},${r},0,1,${d},${this._x1=c},${this._y1=h}`:f>Da&&this._append`A${r},${r},0,${+(f>=N2)},${d},${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 tF(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 G2e(t)}function K2e(e){return e.innerRadius}function Y2e(e){return e.outerRadius}function X2e(e){return e.startAngle}function Q2e(e){return e.endAngle}function J2e(e){return e&&e.padAngle}function Z2e(e,t,n,r,i,s,a,o){var l=n-e,c=r-t,h=a-i,d=o-s,f=d*l-h*c;if(!(f*fL*L+P*P&&(k=R,T=M),{cx:k,cy:T,x01:-h,y01:-d,x11:k*(i/S-1),y11:T*(i/S-1)}}function eSe(){var e=K2e,t=Y2e,n=Kt(0),r=null,i=X2e,s=Q2e,a=J2e,o=null,l=tF(c);function c(){var h,d,f=+e.apply(this,arguments),m=+t.apply(this,arguments),_=i.apply(this,arguments)-c0,v=s.apply(this,arguments)-c0,y=DA(v-_),g=v>_;if(o||(o=h=l()),mKn))o.moveTo(0,0);else if(y>kg-Kn)o.moveTo(m*Ra(_),m*Vi(_)),o.arc(0,0,m,_,v,!g),f>Kn&&(o.moveTo(f*Ra(v),f*Vi(v)),o.arc(0,0,f,v,_,g));else{var p=_,x=v,b=_,S=v,C=y,E=y,k=a.apply(this,arguments)/2,T=k>Kn&&(r?+r.apply(this,arguments):Mc(f*f+m*m)),R=F_(DA(m-f)/2,+n.apply(this,arguments)),M=R,D=R,N,L;if(T>Kn){var P=LA(T/f*Vi(k)),I=LA(T/m*Vi(k));(C-=P*2)>Kn?(P*=g?1:-1,b+=P,S-=P):(C=0,b=S=(_+v)/2),(E-=I*2)>Kn?(I*=g?1:-1,p+=I,x-=I):(E=0,p=x=(_+v)/2)}var z=m*Ra(p),O=m*Vi(p),A=f*Ra(S),j=f*Vi(S);if(R>Kn){var F=m*Ra(x),H=m*Vi(x),B=f*Ra(b),G=f*Vi(b),Z;if(yKn?D>Kn?(N=Um(B,G,z,O,m,D,g),L=Um(F,H,A,j,m,D,g),o.moveTo(N.cx+N.x01,N.cy+N.y01),DKn)||!(C>Kn)?o.lineTo(A,j):M>Kn?(N=Um(A,j,F,H,f,-M,g),L=Um(z,O,B,G,f,-M,g),o.lineTo(N.cx+N.x01,N.cy+N.y01),Me?1:t>=e?0:NaN}function iSe(e){return e}function sSe(){var e=iSe,t=rSe,n=null,r=Kt(0),i=Kt(kg),s=Kt(0);function a(o){var l,c=(o=_E(o)).length,h,d,f=0,m=new Array(c),_=new Array(c),v=+r.apply(this,arguments),y=Math.min(kg,Math.max(-kg,i.apply(this,arguments)-v)),g,p=Math.min(Math.abs(y)/c,s.apply(this,arguments)),x=p*(y<0?-1:1),b;for(l=0;l0&&(f+=b);for(t!=null?m.sort(function(S,C){return t(_[S],_[C])}):n!=null&&m.sort(function(S,C){return n(o[S],o[C])}),l=0,d=f?(y-c*x)/f:0;l0?b*d:0)+x,_[h]={data:o[h],index:l,value:b,startAngle:v,endAngle:g,padAngle:p};return _}return a.value=function(o){return arguments.length?(e=typeof o=="function"?o:Kt(+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:Kt(+o),a):r},a.endAngle=function(o){return arguments.length?(i=typeof o=="function"?o:Kt(+o),a):i},a.padAngle=function(o){return arguments.length?(s=typeof o=="function"?o:Kt(+o),a):s},a}function fa(){}function u0(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 Fy(e){this._context=e}Fy.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:u0(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:u0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function oSe(e){return new Fy(e)}function sF(e){this._context=e}sF.prototype={areaStart:fa,areaEnd:fa,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:u0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function aSe(e){return new sF(e)}function oF(e){this._context=e}oF.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:u0(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function lSe(e){return new oF(e)}function aF(e,t){this._basis=new Fy(e),this._beta=t}aF.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 cSe=function e(t){function n(r){return t===1?new Fy(r):new aF(r,t)}return n.beta=function(r){return e(+r)},n}(.85);function d0(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 bE(e,t){this._context=e,this._k=(1-t)/6}bE.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:d0(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:d0(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 uSe=function e(t){function n(r){return new bE(r,t)}return n.tension=function(r){return e(+r)},n}(0);function wE(e,t){this._context=e,this._k=(1-t)/6}wE.prototype={areaStart:fa,areaEnd:fa,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:d0(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 dSe=function e(t){function n(r){return new wE(r,t)}return n.tension=function(r){return e(+r)},n}(0);function SE(e,t){this._context=e,this._k=(1-t)/6}SE.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:d0(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 hSe=function e(t){function n(r){return new SE(r,t)}return n.tension=function(r){return e(+r)},n}(0);function CE(e,t,n){var r=e._x1,i=e._y1,s=e._x2,a=e._y2;if(e._l01_a>Kn){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>Kn){var c=2*e._l23_2a+3*e._l23_a*e._l12_a+e._l12_2a,h=3*e._l23_a*(e._l23_a+e._l12_a);s=(s*c+e._x1*e._l23_2a-t*e._l12_2a)/h,a=(a*c+e._y1*e._l23_2a-n*e._l12_2a)/h}e._context.bezierCurveTo(r,i,s,a,e._x2,e._y2)}function lF(e,t){this._context=e,this._alpha=t}lF.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:CE(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 fSe=function e(t){function n(r){return t?new lF(r,t):new bE(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function cF(e,t){this._context=e,this._alpha=t}cF.prototype={areaStart:fa,areaEnd:fa,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:CE(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 pSe=function e(t){function n(r){return t?new cF(r,t):new wE(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function uF(e,t){this._context=e,this._alpha=t}uF.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:CE(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 mSe=function e(t){function n(r){return t?new uF(r,t):new SE(r,0)}return n.alpha=function(r){return e(+r)},n}(.5);function dF(e){this._context=e}dF.prototype={areaStart:fa,areaEnd:fa,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 gSe(e){return new dF(e)}function NA(e){return e<0?-1:1}function PA(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(NA(s)+NA(a))*Math.min(Math.abs(s),Math.abs(a),.5*Math.abs(o))||0}function OA(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function z_(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 h0(e){this._context=e}h0.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:z_(this,this._t0,OA(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,z_(this,OA(this,n=PA(this,e,t)),n);break;default:z_(this,this._t0,n=PA(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function hF(e){this._context=new fF(e)}(hF.prototype=Object.create(h0.prototype)).point=function(e,t){h0.prototype.point.call(this,t,e)};function fF(e){this._context=e}fF.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 vSe(e){return new h0(e)}function ySe(e){return new hF(e)}function pF(e){this._context=e}pF.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=IA(e),i=IA(t),s=0,a=1;a=0;--t)i[t]=(a[t]-i[t+1])/s[t];for(s[n-1]=(e[n]+i[n-1])/2,t=0;t=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 _Se(e){return new zy(e,.5)}function bSe(e){return new zy(e,0)}function wSe(e){return new zy(e,1)}function $A(e,t){if((a=e.length)>1)for(var n=1,r,i,s=e[t[0]],a,o=s.length;n=0;)n[t]=t;return n}function SSe(e,t){return e[t]}function CSe(e){const t=[];return t.key=e,t}function kSe(){var e=Kt([]),t=BA,n=$A,r=SSe;function i(s){var a=Array.from(e.apply(this,arguments),CSe),o,l=a.length,c=-1,h;for(const d of s)for(o=0,++c;o0)for(var n,r=0,i,s,a,o,l,c=e[t[0]].length;r0?(i[0]=a,i[1]=a+=s):s<0?(i[1]=o,i[0]=o+=s):(i[0]=0,i[1]=s)}var TSe=Ip,RSe=q$,MSe=gd;function ASe(e,t,n){for(var r=-1,i=t.length,s={};++r0&&n(o)?t>1?gF(o,t-1,n,r,i):eCe(i,o):r||(i[i.length]=o)}return i}var vF=gF,nCe=vF;function rCe(e){var t=e==null?0:e.length;return t?nCe(e,1):[]}var iCe=rCe,sCe=iCe,oCe=F$,aCe=z$;function lCe(e){return aCe(oCe(e,void 0,sCe),e+"")}var yF=lCe,cCe=KSe,uCe=yF,dCe=uCe(function(e,t){return e==null?{}:cCe(e,t)}),hCe=dCe;const fCe=Nn(hCe);function pCe(e,t){for(var n=-1,r=e==null?0:e.length;++no))return!1;var c=s.get(e),h=s.get(t);if(c&&h)return c==t&&h==e;var d=-1,f=!0,m=n&_Ce?new gCe:void 0;for(s.set(e,t),s.set(t,e);++d=0||(i[n]=e[n]);return i}var rke=["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"],ike=function(e,t){return Li({},t,e)},ske=function(e,t){var n=Mye({},e,t);return rke.forEach(function(r){xh(n,r,ike(io(n,r),n.text))}),n},TF=w.createContext(),RF=function(e){var t=e.children,n=e.animate,r=n===void 0||n,i=e.config,s=i===void 0?"default":i,a=w.useMemo(function(){var o=p_e(s)?Ak[s]:s;return{animate:r,config:o}},[r,s]);return u.jsx(TF.Provider,{value:a,children:t})},s6={animate:ee.bool,motionConfig:ee.oneOfType([ee.oneOf(Object.keys(Ak)),ee.shape({mass:ee.number,tension:ee.number,friction:ee.number,clamp:ee.bool,precision:ee.number,velocity:ee.number,duration:ee.number,easing:ee.func})])};RF.propTypes={children:ee.node.isRequired,animate:s6.animate,config:s6.motionConfig};var Lr=function(){return w.useContext(TF)},oke=function(e){var t=Lr(),n=t.animate,r=t.config,i=function(o){var l=w.useRef();return w.useEffect(function(){l.current=o},[o]),l.current}(e),s=w.useMemo(function(){return Qk(i,e)},[i,e]),a=uo({from:{value:0},to:{value:1},reset:!0,config:r,immediate:!n}).value;return ua(a,s)},ake={nivo:["#d76445","#f47560","#e8c1a0","#97e3d5","#61cdbb","#00b0a7"],BrBG:je(hy),PRGn:je(fy),PiYG:je(py),PuOr:je(my),RdBu:je(gy),RdGy:je(vy),RdYlBu:je(yy),RdYlGn:je(xy),spectral:je(_y),blues:je(Ly),greens:je(Ny),greys:je(Py),oranges:je($y),purples:je(Oy),reds:je(Iy),BuGn:je(by),BuPu:je(wy),GnBu:je(Sy),OrRd:je(Cy),PuBuGn:je(ky),PuBu:je(Ey),PuRd:je(Ty),RdPu:je(Ry),YlGnBu:je(My),YlGn:je(Ay),YlOrBr:je(jy),YlOrRd:je(Dy)},lke=Object.keys(ake);je(hy),je(fy),je(py),je(my),je(gy),je(vy),je(yy),je(xy),je(_y),je(Ly),je(Ny),je(Py),je($y),je(Oy),je(Iy),je(by),je(wy),je(Sy),je(Cy),je(ky),je(Ey),je(Ty),je(Ry),je(My),je(Ay),je(jy),je(Dy);ee.oneOfType([ee.oneOf(lke),ee.func,ee.arrayOf(ee.string)]);var cke={basis:oSe,basisClosed:aSe,basisOpen:lSe,bundle:cSe,cardinal:uSe,cardinalClosed:dSe,cardinalOpen:hSe,catmullRom:fSe,catmullRomClosed:pSe,catmullRomOpen:mSe,linear:rF,linearClosed:gSe,monotoneX:vSe,monotoneY:ySe,natural:xSe,step:_Se,stepAfter:wSe,stepBefore:bSe},AE=Object.keys(cke);AE.filter(function(e){return e.endsWith("Closed")});ZB(AE,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");ZB(AE,"bundle","basisClosed","basisOpen","cardinalClosed","cardinalOpen","catmullRomClosed","catmullRomOpen","linearClosed");ee.shape({top:ee.number,right:ee.number,bottom:ee.number,left:ee.number}).isRequired;var uke=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"];ee.oneOf(uke);Wa(vE);var dke={top:0,right:0,bottom:0,left:0},jE=function(e,t,n){return n===void 0&&(n={}),w.useMemo(function(){var r=Li({},dke,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])},MF=function(){var e=w.useRef(null),t=w.useState({left:0,top:0,width:0,height:0}),n=t[0],r=t[1],i=w.useState(function(){return typeof ResizeObserver>"u"?null:new ResizeObserver(function(s){var a=s[0];return r(a.contentRect)})})[0];return w.useEffect(function(){return e.current&&i!==null&&i.observe(e.current),function(){i!==null&&i.disconnect()}},[]),[e,n]},hke=function(e){return w.useMemo(function(){return ske(nke,e)},[e])},fke=function(e){return typeof e=="function"?e:typeof e=="string"?e.indexOf("time:")===0?dy(e.slice("5")):Bp(e):function(t){return""+t}},Wy=function(e){return w.useMemo(function(){return fke(e)},[e])},AF=w.createContext(),pke={},jF=function(e){var t=e.theme,n=t===void 0?pke:t,r=e.children,i=hke(n);return u.jsx(AF.Provider,{value:i,children:r})};jF.propTypes={children:ee.node.isRequired,theme:ee.object};var Xt=function(){return w.useContext(AF)},mke=["outlineWidth","outlineColor","outlineOpacity"],DE=function(e){return e.outlineWidth,e.outlineColor,e.outlineOpacity,ME(e,mke)},DF=function(e){var t=e.children,n=e.condition,r=e.wrapper;return n?w.cloneElement(r,{},t):t};DF.propTypes={children:ee.node.isRequired,condition:ee.bool.isRequired,wrapper:ee.element.isRequired};var gke={position:"relative"},Uy=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=w.useRef(null);return u.jsx(jF,{theme:n,children:u.jsx(RF,{animate:o,config:l,children:u.jsx(dpe,{container:c,children:u.jsxs(DF,{condition:i,wrapper:u.jsx("div",{style:gke,ref:c}),children:[t,a&&u.jsx(upe,{})]})})})})};Uy.propTypes={children:ee.element.isRequired,isInteractive:ee.bool,renderWrapper:ee.bool,theme:ee.object,animate:ee.bool,motionConfig:ee.string};ee.func.isRequired,ee.bool,ee.bool,ee.object.isRequired,ee.bool.isRequired,ee.string;var LF=function(e){var t=e.children,n=MF(),r=n[0],i=n[1],s=i.width>0&&i.height>0;return u.jsx("div",{ref:r,style:{width:"100%",height:"100%"},children:s&&t({width:i.width,height:i.height})})};LF.propTypes={children:ee.func.isRequired};var vke=["id","colors"],NF=function(e){var t=e.id,n=e.colors,r=ME(e,vke);return u.jsx("linearGradient",Li({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 u.jsx("stop",{offset:s+"%",stopColor:a,stopOpacity:o!==void 0?o:1},s)})}))};NF.propTypes={id:ee.string.isRequired,colors:ee.arrayOf(ee.shape({offset:ee.number.isRequired,color:ee.string.isRequired,opacity:ee.number})).isRequired,gradientTransform:ee.string};var PF={linearGradient:NF},Xd={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},z2=w.memo(function(e){var t=e.id,n=e.background,r=n===void 0?Xd.background:n,i=e.color,s=i===void 0?Xd.color:i,a=e.size,o=a===void 0?Xd.size:a,l=e.padding,c=l===void 0?Xd.padding:l,h=e.stagger,d=h===void 0?Xd.stagger:h,f=o+c,m=o/2,_=c/2;return d===!0&&(f=2*o+2*c),u.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[u.jsx("rect",{width:f,height:f,fill:r}),u.jsx("circle",{cx:_+m,cy:_+m,r:m,fill:s}),d&&u.jsx("circle",{cx:1.5*c+o+m,cy:1.5*c+o+m,r:m,fill:s})]})});z2.displayName="PatternDots",z2.propTypes={id:ee.string.isRequired,color:ee.string.isRequired,background:ee.string.isRequired,size:ee.number.isRequired,padding:ee.number.isRequired,stagger:ee.bool.isRequired};var li=function(e){return e*Math.PI/180},Vy=function(e){return 180*e/Math.PI},yke=function(e){return e.startAngle+(e.endAngle-e.startAngle)/2},il=function(e,t){return{x:Math.cos(e)*t,y:Math.sin(e)*t}},xke=function(e){var t=e%360;return t<0&&(t+=360),t},_ke={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"}}},Qd={spacing:5,rotation:0,background:"#000000",color:"#ffffff",lineWidth:2},H2=w.memo(function(e){var t=e.id,n=e.spacing,r=n===void 0?Qd.spacing:n,i=e.rotation,s=i===void 0?Qd.rotation:i,a=e.background,o=a===void 0?Qd.background:a,l=e.color,c=l===void 0?Qd.color:l,h=e.lineWidth,d=h===void 0?Qd.lineWidth:h,f=Math.round(s)%360,m=Math.abs(r);f>180?f-=360:f>90?f-=180:f<-180?f+=360:f<-90&&(f+=180);var _,v=m,y=m;return f===0?_=` M 0 0 L `+v+` 0 M 0 `+y+" L "+v+" "+y+` `:f===90?_=` M 0 0 L 0 `+y+` M `+v+" 0 L "+v+" "+y+` `:(v=Math.abs(m/Math.sin(li(f))),y=m/Math.sin(li(90-f)),_=f>0?` M 0 `+-y+" L "+2*v+" "+y+` M `+-v+" "+-y+" L "+v+" "+y+` M `+-v+" 0 L "+v+" "+2*y+` `:` M `+-v+" "+y+" L "+v+" "+-y+` M `+-v+" "+2*y+" L "+2*v+" "+-y+` M 0 `+2*y+" L "+2*v+` 0 `),u.jsxs("pattern",{id:t,width:v,height:y,patternUnits:"userSpaceOnUse",children:[u.jsx("rect",{width:v,height:y,fill:o,stroke:"rgba(255, 0, 0, 0.1)",strokeWidth:0}),u.jsx("path",{d:_,strokeWidth:d,stroke:c,strokeLinecap:"square"})]})});H2.displayName="PatternLines",H2.propTypes={id:ee.string.isRequired,spacing:ee.number.isRequired,rotation:ee.number.isRequired,background:ee.string.isRequired,color:ee.string.isRequired,lineWidth:ee.number.isRequired};var Jd={color:"#000000",background:"#ffffff",size:4,padding:4,stagger:!1},W2=w.memo(function(e){var t=e.id,n=e.color,r=n===void 0?Jd.color:n,i=e.background,s=i===void 0?Jd.background:i,a=e.size,o=a===void 0?Jd.size:a,l=e.padding,c=l===void 0?Jd.padding:l,h=e.stagger,d=h===void 0?Jd.stagger:h,f=o+c,m=c/2;return d===!0&&(f=2*o+2*c),u.jsxs("pattern",{id:t,width:f,height:f,patternUnits:"userSpaceOnUse",children:[u.jsx("rect",{width:f,height:f,fill:s}),u.jsx("rect",{x:m,y:m,width:o,height:o,fill:r}),d&&u.jsx("rect",{x:1.5*c+o,y:1.5*c+o,width:o,height:o,fill:r})]})});W2.displayName="PatternSquares",W2.propTypes={id:ee.string.isRequired,color:ee.string.isRequired,background:ee.string.isRequired,size:ee.number.isRequired,padding:ee.number.isRequired,stagger:ee.bool.isRequired};var OF={patternDots:z2,patternLines:H2,patternSquares:W2},bke=["type"],U2=Li({},PF,OF),IF=function(e){var t=e.defs;return!t||t.length<1?null:u.jsx("defs",{"aria-hidden":!0,children:t.map(function(n){var r=n.type,i=ME(n,bke);return U2[r]?w.createElement(U2[r],Li({key:i.id},i)):null})})};IF.propTypes={defs:ee.arrayOf(ee.shape({type:ee.oneOf(Object.keys(U2)).isRequired,id:ee.string.isRequired}))};var wke=w.memo(IF),LE=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,h=e.isFocusable,d=Xt();return u.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:h,tabIndex:h?0:void 0,children:[u.jsx(wke,{defs:i}),u.jsx("rect",{width:t,height:n,fill:d.background}),u.jsx("g",{transform:"translate("+r.left+","+r.top+")",children:s})]})};LE.propTypes={width:ee.number.isRequired,height:ee.number.isRequired,margin:ee.shape({top:ee.number.isRequired,left:ee.number.isRequired}).isRequired,defs:ee.array,children:ee.oneOfType([ee.arrayOf(ee.node),ee.node]).isRequired,role:ee.string,isFocusable:ee.bool,ariaLabel:ee.string,ariaLabelledBy:ee.string,ariaDescribedBy:ee.string};var $F=function(e){var t=e.size,n=e.color,r=e.borderWidth,i=e.borderColor;return u.jsx("circle",{r:t/2,fill:n,stroke:i,strokeWidth:r,style:{pointerEvents:"none"}})};$F.propTypes={size:ee.number.isRequired,color:ee.string.isRequired,borderWidth:ee.number.isRequired,borderColor:ee.string.isRequired};var Ske=w.memo($F),BF=function(e){var t=e.x,n=e.y,r=e.symbol,i=r===void 0?Ske:r,s=e.size,a=e.datum,o=e.color,l=e.borderWidth,c=e.borderColor,h=e.label,d=e.labelTextAnchor,f=d===void 0?"middle":d,m=e.labelYOffset,_=m===void 0?-12:m,v=Xt(),y=Lr(),g=y.animate,p=y.config,x=uo({transform:"translate("+t+", "+n+")",config:p,immediate:!g});return u.jsxs(Rt.g,{transform:x.transform,style:{pointerEvents:"none"},children:[w.createElement(i,{size:s,color:o,datum:a,borderWidth:l,borderColor:c}),h&&u.jsx("text",{textAnchor:f,y:_,style:DE(v.dots.text),children:h})]})};BF.propTypes={x:ee.number.isRequired,y:ee.number.isRequired,datum:ee.object.isRequired,size:ee.number.isRequired,color:ee.string.isRequired,borderWidth:ee.number.isRequired,borderColor:ee.string.isRequired,symbol:ee.oneOfType([ee.func,ee.object]),label:ee.oneOfType([ee.string,ee.number]),labelTextAnchor:ee.oneOf(["start","middle","end"]),labelYOffset:ee.number};w.memo(BF);var FF=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,h=c===void 0?"top-right":c,d=e.legendOffsetX,f=d===void 0?14:d,m=e.legendOffsetY,_=m===void 0?14:m,v=e.legendOrientation,y=v===void 0?"horizontal":v,g=Xt(),p=0,x=0,b=0,S=0;r==="y"?(b=i(s),x=t):(p=i(s),S=n);var C=null;if(l){var E=function(k){var T=k.axis,R=k.width,M=k.height,D=k.position,N=k.offsetX,L=k.offsetY,P=k.orientation,I=0,z=0,O=P==="vertical"?-90:0,A="start";if(T==="x")switch(D){case"top-left":I=-N,z=L,A="end";break;case"top":z=-L,A=P==="horizontal"?"middle":"start";break;case"top-right":I=N,z=L,A=P==="horizontal"?"start":"end";break;case"right":I=N,z=M/2,A=P==="horizontal"?"start":"middle";break;case"bottom-right":I=N,z=M-L,A="start";break;case"bottom":z=M+L,A=P==="horizontal"?"middle":"end";break;case"bottom-left":z=M-L,I=-N,A=P==="horizontal"?"end":"start";break;case"left":I=-N,z=M/2,A=P==="horizontal"?"end":"middle"}else switch(D){case"top-left":I=N,z=-L,A="start";break;case"top":I=R/2,z=-L,A=P==="horizontal"?"middle":"start";break;case"top-right":I=R-N,z=-L,A=P==="horizontal"?"end":"start";break;case"right":I=R+N,A=P==="horizontal"?"start":"middle";break;case"bottom-right":I=R-N,z=L,A="end";break;case"bottom":I=R/2,z=L,A=P==="horizontal"?"middle":"end";break;case"bottom-left":I=N,z=L,A=P==="horizontal"?"start":"end";break;case"left":I=-N,A=P==="horizontal"?"end":"middle"}return{x:I,y:z,rotation:O,textAnchor:A}}({axis:r,width:t,height:n,position:h,offsetX:f,offsetY:_,orientation:y});C=u.jsx("text",{transform:"translate("+E.x+", "+E.y+") rotate("+E.rotation+")",textAnchor:E.textAnchor,dominantBaseline:"central",style:o,children:l})}return u.jsxs("g",{transform:"translate("+p+", "+b+")",children:[u.jsx("line",{x1:0,x2:x,y1:0,y2:S,stroke:g.markers.lineColor,strokeWidth:g.markers.lineStrokeWidth,style:a}),C]})};FF.propTypes={width:ee.number.isRequired,height:ee.number.isRequired,axis:ee.oneOf(["x","y"]).isRequired,scale:ee.func.isRequired,value:ee.oneOfType([ee.number,ee.string,ee.instanceOf(Date)]).isRequired,lineStyle:ee.object,textStyle:ee.object,legend:ee.string,legendPosition:ee.oneOf(["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"]),legendOffsetX:ee.number.isRequired,legendOffsetY:ee.number.isRequired,legendOrientation:ee.oneOf(["horizontal","vertical"]).isRequired};var Cke=w.memo(FF),zF=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 u.jsx(Cke,Li({},a,{width:n,height:r,scale:a.axis==="y"?s:i}),o)}):null};zF.propTypes={width:ee.number.isRequired,height:ee.number.isRequired,xScale:ee.func.isRequired,yScale:ee.func.isRequired,markers:ee.arrayOf(ee.shape({axis:ee.oneOf(["x","y"]).isRequired,value:ee.oneOfType([ee.number,ee.string,ee.instanceOf(Date)]).isRequired,lineStyle:ee.object,textStyle:ee.object}))};var kke=w.memo(zF),HF=function(e){return S$(e)?e:function(t){return io(t,e)}},sl=function(e){return w.useMemo(function(){return HF(e)},[e])},Eke=function(e,t,n,r,i,s){return e<=i&&i<=e+n&&t<=s&&s<=t+r},U_=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]},Tke=Object.keys(PF),Rke=Object.keys(OF),Mke=function(e,t,n){if(e==="*")return!0;if(S$(e))return e(t);if(Hk(e)){var r=n?io(t,n):t;return tke(fCe(r,Object.keys(e)),e)}return!1},WF=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,h=[],d={};return e.length&&t.length&&(h=[].concat(e),t.forEach(function(f){for(var m=function(){var v=n[_],y=v.id,g=v.match;if(Mke(g,f,s)){var p=e.find(function(R){return R.id===y});if(p){if(Rke.includes(p.type))if(p.background==="inherit"||p.color==="inherit"){var x=io(f,o),b=p.background,S=p.color,C=y;p.background==="inherit"&&(C=C+".bg."+x,b=x),p.color==="inherit"&&(C=C+".fg."+x,S=x),xh(f,c,"url(#"+C+")"),d[C]||(h.push(Li({},p,{id:C,background:b,color:S})),d[C]=1)}else xh(f,c,"url(#"+y+")");else if(Tke.includes(p.type))if(p.colors.map(function(R){return R.color}).includes("inherit")){var E=io(f,o),k=y,T=Li({},p,{colors:p.colors.map(function(R,M){return R.color!=="inherit"?R:(k=k+"."+M+"."+E,Li({},R,{color:R.color==="inherit"?E:R.color}))})});T.id=k,xh(f,c,"url(#"+k+")"),d[k]||(h.push(T),d[k]=1)}else xh(f,c,"url(#"+y+")")}return"break"}},_=0;_=Wke){var c=t?null:zke(e);if(c)return Hke(c);a=!1,i=Fke,l=new Ike}else l=t?[]:o;e:for(;++rt||s&&a&&l&&!o&&!c||r&&a&&l||!n&&l||!i)return 1;if(!r&&!s&&!c&&e=o)return l;var c=n[r];return l*(c=="desc"?-1:1)}}return e.index-t.index}var l3e=a3e,q_=ny,c3e=Ip,u3e=NE,d3e=t3e,h3e=r3e,f3e=Pp,p3e=l3e,m3e=ey,g3e=Dr;function v3e(e,t,n){t.length?t=q_(t,function(s){return g3e(s)?function(a){return c3e(a,s.length===1?s[0]:s)}:s}):t=[m3e];var r=-1;t=q_(t,f3e(u3e));var i=d3e(e,function(s,a,o){var l=q_(t,function(c){return c(s)});return{criteria:l,index:++r,value:s}});return h3e(i,function(s,a){return p3e(s,a,n)})}var y3e=v3e,x3e=vF,_3e=y3e,b3e=Vk,l6=H$;b3e(function(e,t){if(e==null)return[];var n=t.length;return n>1&&l6(e,t[0],t[1])?t=[]:n>2&&l6(t[0],t[1],t[2])&&(t=[t[0]]),_3e(e,x3e(t,1),[])});var c6=J1;c6&&c6.isDate;var uc=[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)}],w3e={millisecond:[],second:uc.slice(0,1),minute:uc.slice(0,2),hour:uc.slice(0,3),day:uc.slice(0,4),month:uc.slice(0,5),year:uc.slice(0,6)},S3e=function(e){return function(t){return w3e[e].forEach(function(n){n(t)}),t}},C3e=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=S3e(i);return function(l){if(l===void 0)return l;if(n==="native"||l instanceof Date)return o(l);var c=a?OB(n):NB(n);return o(c(l))}},k3e=function(e,t,n,r){var i,s,a,o,l=e.min,c=l===void 0?0:l,h=e.max,d=h===void 0?"auto":h,f=e.stacked,m=f!==void 0&&f,_=e.reverse,v=_!==void 0&&_,y=e.clamp,g=y!==void 0&&y,p=e.nice,x=p!==void 0&&p;c==="auto"?i=m===!0?(s=t.minStacked)!=null?s:0:t.min:i=c,d==="auto"?a=m===!0?(o=t.maxStacked)!=null?o:0:t.max:a=d;var b=Uo().rangeRound(r==="x"?[0,n]:[n,0]).domain(v?[a,i]:[i,a]).clamp(g);return x===!0?b.nice():typeof x=="number"&&b.nice(x),E3e(b,m)},E3e=function(e,t){t===void 0&&(t=!1);var n=e;return n.type="linear",n.stacked=t,n},T3e=function(e,t,n){var r=j_e().range([0,n]).domain(t.all);return r.type="point",r},R3e=function(e,t,n,r){var i=e.round,s=i===void 0||i,a=ay().range(r==="x"?[0,n]:[n,0]).domain(t.all).round(s);return M3e(a)},M3e=function(e){var t=e;return t.type="band",t},A3e=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,h=c===void 0?"auto":c,d=e.max,f=d===void 0?"auto":d,m=e.useUTC,_=m===void 0||m,v=e.nice,y=v!==void 0&&v,g=C3e({format:a,precision:l,useUTC:_});r=h==="auto"?g(t.min):a!=="native"?g(h):h,i=f==="auto"?g(t.max):a!=="native"?g(f):f;var p=_?bwe():gE();p.range([0,n]),r&&i&&p.domain([r,i]),y===!0?p.nice():typeof y!="object"&&typeof y!="number"||p.nice(y);var x=p;return x.type="time",x.useUTC=_,x},j3e=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,h=c===void 0?"auto":c;if(t.all.some(function(v){return v===0}))throw new Error("a log scale domain must not include or cross zero");var d,f,m=!1;if(t.all.filter(function(v){return v!=null}).forEach(function(v){m||(i===void 0?i=Math.sign(v):Math.sign(v)!==i&&(m=!0))}),m)throw new Error("a log scale domain must be strictly-positive or strictly-negative");d=l==="auto"?t.min:l,f=h==="auto"?t.max:h;var _=cB().domain([d,f]).rangeRound(r==="x"?[0,n]:[n,0]).base(a).nice();return _.type="log",_},D3e=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,h=e.max,d=h===void 0?"auto":h,f=e.reverse,m=f!==void 0&&f;i=c==="auto"?t.min:c,s=d==="auto"?t.max:d;var _=uB().constant(o).rangeRound(r==="x"?[0,n]:[n,0]).nice();m===!0?_.domain([s,i]):_.domain([i,s]);var v=_;return v.type="symlog",v};function PE(e,t,n,r){switch(e.type){case"linear":return k3e(e,t,n,r);case"point":return T3e(e,t,n);case"band":return R3e(e,t,n,r);case"time":return A3e(e,t,n);case"log":return j3e(e,t,n,r);case"symlog":return D3e(e,t,n,r);default:throw new Error("invalid scale spec")}}var GF=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}},KF={millisecond:[zf,zf],second:[L2,L2],minute:[gB,SB],hour:[vB,CB],day:[yn(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)}),yn(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:[o0,a0],sunday:[o0,a0],monday:[Hf,Wf],tuesday:[yB,kB],wednesday:[xB,EB],thursday:[Sl,Cl],friday:[_B,TB],saturday:[bB,RB],month:[wB,MB],year:[da,ha]},L3e=Object.keys(KF),N3e=new RegExp("^every\\s*(\\d+)?\\s*("+L3e.join("|")+")s?$","i"),YF=function(e,t){if(Array.isArray(t))return t;if(typeof t=="string"&&"useUTC"in e){var n=t.match(N3e);if(n){var r=n[1],i=n[2],s=KF[i][e.useUTC?1:0];if(i==="day"){var a,o,l=e.domain(),c=l[0],h=l[1],d=new Date(h);return d.setDate(d.getDate()+1),(a=(o=s.every(Number(r??1)))==null?void 0:o.range(c,d))!=null?a:[]}if(r===void 0)return e.ticks(s);var f=s.every(Number(r));if(f)return e.ticks(f)}throw new Error("Invalid tickValues: "+t)}if("ticks"in e){if(t===void 0)return e.ticks();if(typeof(m=t)=="number"&&isFinite(m)&&Math.floor(m)===m)return e.ticks(t)}var m;return e.domain()};function ci(){return ci=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?(p=m.align[g?"left":"right"],x=m.baseline.center):(i==="after"&&l>0||i==="before"&&l<0)&&(p=m.align[g?"right":"left"],x=m.baseline.center)):(t=function(b){var S;return{x:0,y:(S=_(b))!=null?S:0}},v.lineX=a*(i==="after"?1:-1),y.textX=(a+o)*(i==="after"?1:-1),p=i==="after"?m.align.left:m.align.right),{ticks:f.map(function(b){var S=typeof b=="string"?function(C){var E=String(C).length;return c&&c>0&&E>c?""+String(C).slice(0,c).concat("..."):""+C}(b):b;return ci({key:b instanceof Date?""+b.valueOf():""+b,value:S},t(b),v,y)}),textAlign:p,textBaseline:x}},QF=function(e,t){if(e===void 0||typeof e=="function")return e;if(t.type==="time"){var n=dy(e);return function(r){return n(r instanceof Date?r:new Date(r))}}return Bp(e)},V2=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)||YF(i,a)),l="bandwidth"in i?GF(i):i,c=s==="x"?o.map(function(h){var d,f;return{key:h instanceof Date?""+h.valueOf():""+h,x1:(d=l(h))!=null?d:0,x2:(f=l(h))!=null?f:0,y1:0,y2:r}}):o.map(function(h){var d,f;return{key:h instanceof Date?""+h.valueOf():""+h,x1:0,x2:n,y1:(d=l(h))!=null?d:0,y2:(f=l(h))!=null?f:0}});return c},P3e=w.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,h=Xt(),d=h.axis.ticks.line,f=h.axis.ticks.text,m=(t=r==null?void 0:r(n))!=null?t:n,_=w.useMemo(function(){var v={opacity:c.opacity};return a?{style:ci({},v,{cursor:"pointer"}),onClick:function(y){return a(y,m)}}:{style:v}},[c.opacity,a,m]);return u.jsxs(Rt.g,ci({transform:c.transform},_,{children:[u.jsx("line",{x1:0,x2:i,y1:0,y2:s,style:d}),f.outlineWidth>0&&u.jsx(Rt.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:f,strokeWidth:2*f.outlineWidth,stroke:f.outlineColor,strokeLinejoin:"round",children:""+m}),u.jsx(Rt.text,{dominantBaseline:o,textAnchor:l,transform:c.textTransform,style:DE(f),children:""+m})]}))}),O3e=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,h=e.tickSize,d=h===void 0?5:h,f=e.tickPadding,m=f===void 0?5:f,_=e.tickRotation,v=_===void 0?0:_,y=e.format,g=e.renderTick,p=g===void 0?P3e:g,x=e.truncateTickAt,b=e.legend,S=e.legendPosition,C=S===void 0?"end":S,E=e.legendOffset,k=E===void 0?0:E,T=e.onClick,R=e.ariaHidden,M=Xt(),D=M.axis.legend.text,N=w.useMemo(function(){return QF(y,n)},[y,n]),L=XF({axis:t,scale:n,ticksPosition:l,tickValues:c,tickSize:d,tickPadding:m,tickRotation:v,truncateTickAt:x}),P=L.ticks,I=L.textAlign,z=L.textBaseline,O=null;if(b!==void 0){var A,j=0,F=0,H=0;t==="y"?(H=-90,j=k,C==="start"?(A="start",F=o):C==="middle"?(A="middle",F=o/2):C==="end"&&(A="end")):(F=k,C==="start"?A="start":C==="middle"?(A="middle",j=o/2):C==="end"&&(A="end",j=o)),O=u.jsxs(u.Fragment,{children:[D.outlineWidth>0&&u.jsx("text",{transform:"translate("+j+", "+F+") rotate("+H+")",textAnchor:A,style:ci({dominantBaseline:"central"},D),strokeWidth:2*D.outlineWidth,stroke:D.outlineColor,strokeLinejoin:"round",children:b}),u.jsx("text",{transform:"translate("+j+", "+F+") rotate("+H+")",textAnchor:A,style:ci({dominantBaseline:"central"},D),children:b})]})}var B=Lr(),G=B.animate,Z=B.config,X=uo({transform:"translate("+i+","+a+")",lineX2:t==="x"?o:0,lineY2:t==="x"?0:o,config:Z,immediate:!G}),W=w.useCallback(function(U){return{opacity:1,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+v+")"}},[v]),$=w.useCallback(function(U){return{opacity:0,transform:"translate("+U.x+","+U.y+")",textTransform:"translate("+U.textX+","+U.textY+") rotate("+v+")"}},[v]),V=Fl(P,{keys:function(U){return U.key},initial:W,from:$,enter:W,update:W,leave:{opacity:0},config:Z,immediate:!G});return u.jsxs(Rt.g,{transform:X.transform,"aria-hidden":R,children:[V(function(U,Q,q,ie){return w.createElement(p,ci({tickIndex:ie,format:N,rotate:v,textBaseline:z,textAnchor:I,truncateTickAt:x,animatedProps:U},Q,T?{onClick:T}:{}))}),u.jsx(Rt.line,{style:M.axis.domain.line,x1:0,x2:X.lineX2,y1:0,y2:X.lineY2}),O]})},I3e=w.memo(O3e),JF=["top","right","bottom","left"],$3e=w.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 u.jsx(u.Fragment,{children:JF.map(function(a){var o=s[a];if(!o)return null;var l=a==="top"||a==="bottom";return u.jsx(I3e,ci({},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)})})}),B3e=w.memo(function(e){var t=e.animatedProps,n=Xt();return u.jsx(Rt.line,ci({},t,n.grid.line))}),u6=w.memo(function(e){var t=e.lines,n=Lr(),r=n.animate,i=n.config,s=Fl(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 u.jsx("g",{children:s(function(a,o){return w.createElement(B3e,ci({},o,{key:o.key,animatedProps:a}))})})}),F3e=w.memo(function(e){var t=e.width,n=e.height,r=e.xScale,i=e.yScale,s=e.xValues,a=e.yValues,o=w.useMemo(function(){return!!r&&V2({width:t,height:n,scale:r,axis:"x",values:s})},[r,s,t,n]),l=w.useMemo(function(){return!!i&&V2({width:t,height:n,scale:i,axis:"y",values:a})},[n,t,i,a]);return u.jsxs(u.Fragment,{children:[o&&u.jsx(u6,{lines:o}),l&&u.jsx(u6,{lines:l})]})}),z3e=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,h=t.ticksPosition,d=t.tickValues,f=t.tickSize,m=f===void 0?5:f,_=t.tickPadding,v=_===void 0?5:_,y=t.tickRotation,g=y===void 0?0:y,p=t.format,x=t.legend,b=t.legendPosition,S=b===void 0?"end":b,C=t.legendOffset,E=C===void 0?0:C,k=t.theme,T=XF({axis:r,scale:i,ticksPosition:h,tickValues:d,tickSize:m,tickPadding:v,tickRotation:g,engine:"canvas"}),R=T.ticks,M=T.textAlign,D=T.textBaseline;e.save(),e.translate(a,l),e.textAlign=M,e.textBaseline=D;var N=k.axis.ticks.text;e.font=(N.fontWeight?N.fontWeight+" ":"")+N.fontSize+"px "+N.fontFamily,((n=k.axis.domain.line.strokeWidth)!=null?n:0)>0&&(e.lineWidth=Number(k.axis.domain.line.strokeWidth),e.lineCap="square",k.axis.domain.line.stroke&&(e.strokeStyle=k.axis.domain.line.stroke),e.beginPath(),e.moveTo(0,0),e.lineTo(r==="x"?c:0,r==="x"?0:c),e.stroke());var L=typeof p=="function"?p:function(A){return""+A};if(R.forEach(function(A){var j;((j=k.axis.ticks.line.strokeWidth)!=null?j:0)>0&&(e.lineWidth=Number(k.axis.ticks.line.strokeWidth),e.lineCap="square",k.axis.ticks.line.stroke&&(e.strokeStyle=k.axis.ticks.line.stroke),e.beginPath(),e.moveTo(A.x,A.y),e.lineTo(A.x+A.lineX,A.y+A.lineY),e.stroke());var F=L(A.value);e.save(),e.translate(A.x+A.textX,A.y+A.textY),e.rotate(li(g)),N.outlineWidth>0&&(e.strokeStyle=N.outlineColor,e.lineWidth=2*N.outlineWidth,e.lineJoin="round",e.strokeText(""+F,0,0)),k.axis.ticks.text.fill&&(e.fillStyle=N.fill),e.fillText(""+F,0,0),e.restore()}),x!==void 0){var P=0,I=0,z=0,O="center";r==="y"?(z=-90,P=E,S==="start"?(O="start",I=c):S==="middle"?(O="center",I=c/2):S==="end"&&(O="end")):(I=E,S==="start"?O="start":S==="middle"?(O="center",P=c/2):S==="end"&&(O="end",P=c)),e.translate(P,I),e.rotate(li(z)),e.font=(k.axis.legend.text.fontWeight?k.axis.legend.text.fontWeight+" ":"")+k.axis.legend.text.fontSize+"px "+k.axis.legend.text.fontFamily,k.axis.legend.text.fill&&(e.fillStyle=k.axis.legend.text.fill),e.textAlign=O,e.textBaseline="middle",e.fillText(x,0,0)}e.restore()},H3e=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,h=t.theme,d={top:a,right:o,bottom:l,left:c};JF.forEach(function(f){var m=d[f];if(!m)return null;var _=f==="top"||f==="bottom",v=f==="top"||f==="left"?"before":"after",y=_?n:r,g=QF(m.format,y);z3e(e,ci({},m,{axis:_?"x":"y",x:f==="right"?i:0,y:f==="bottom"?s:0,scale:y,format:g,length:_?i:s,ticksPosition:v,theme:h}))})},d6=function(e,t){var n=t.width,r=t.height,i=t.scale,s=t.axis,a=t.values;V2({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()})},W3e=qF;function U3e(e,t){var n=[];return W3e(e,function(r,i,s){t(r,i,s)&&n.push(r)}),n}var V3e=U3e,q3e=bF,G3e=V3e,K3e=NE,Y3e=Dr;function X3e(e,t){var n=Y3e(e)?q3e:G3e;return n(e,K3e(t))}var Q3e=X3e;const J3e=Nn(Q3e);var Z3e=ka,e4e=zi,t4e="[object Number]";function n4e(e){return typeof e=="number"||e4e(e)&&Z3e(e)==t4e}var r4e=n4e;const h6=Nn(r4e);function i4e(e,t){for(var n=-1,r=e==null?0:e.length;++ni?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);++r1),s}),KRe(e,QRe(e),n),r&&(n=VRe(n,JRe|ZRe|eMe,YRe));for(var i=t.length;i--;)qRe(n,t[i]);return n}),nMe=tMe;const iz=Nn(nMe);function _s(){return _s=Object.assign?Object.assign.bind():function(e){for(var t=1;t180?(y-=l,g-=l):g+=l,{points:[[d,f],[t,n],[g,n]],text:[y,n-h],angle:m+90}},oz=function(e){var t=e.data,n=e.annotations,r=e.getPosition,i=e.getDimensions;return w.useMemo(function(){return sMe({data:t,annotations:n,getPosition:r,getDimensions:i})},[t,n,r,i])},aMe=function(e){var t=e.annotations;return w.useMemo(function(){return t.map(function(n){return _s({},n,{computed:sz(_s({},n))})})},[t])},lMe=function(e){return w.useMemo(function(){return sz(e)},[e])},cMe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=Xt(),a=Lr(),o=a.animate,l=a.config,c=uo({x:n,y:r,config:l,immediate:!o});return typeof i=="function"?w.createElement(i,{x:n,y:r,datum:t}):u.jsxs(u.Fragment,{children:[s.annotations.text.outlineWidth>0&&u.jsx(Rt.text,{x:c.x,y:c.y,style:_s({},s.annotations.text,{strokeLinejoin:"round",strokeWidth:2*s.annotations.text.outlineWidth,stroke:s.annotations.text.outlineColor}),children:i}),u.jsx(Rt.text,{x:c.x,y:c.y,style:iz(s.annotations.text,["outlineWidth","outlineColor"]),children:i})]})},_6=function(e){var t=e.points,n=e.isOutline,r=n!==void 0&&n,i=Xt(),s=w.useMemo(function(){var l=t[0];return t.slice(1).reduce(function(c,h){return c+" L"+h[0]+","+h[1]},"M"+l[0]+","+l[1])},[t]),a=oke(s);if(r&&i.annotations.link.outlineWidth<=0)return null;var o=_s({},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),u.jsx(Rt.path,{fill:"none",d:a,style:o})},uMe=function(e){var t=e.x,n=e.y,r=e.size,i=Xt(),s=Lr(),a=s.animate,o=s.config,l=uo({x:t,y:n,radius:r/2,config:o,immediate:!a});return u.jsxs(u.Fragment,{children:[i.annotations.outline.outlineWidth>0&&u.jsx(Rt.circle,{cx:l.x,cy:l.y,r:l.radius,style:_s({},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})}),u.jsx(Rt.circle,{cx:l.x,cy:l.y,r:l.radius,style:i.annotations.outline})]})},dMe=function(e){var t=e.x,n=e.y,r=e.size,i=r===void 0?q2.dotSize:r,s=Xt(),a=Lr(),o=a.animate,l=a.config,c=uo({x:t,y:n,radius:i/2,config:l,immediate:!o});return u.jsxs(u.Fragment,{children:[s.annotations.outline.outlineWidth>0&&u.jsx(Rt.circle,{cx:c.x,cy:c.y,r:c.radius,style:_s({},s.annotations.outline,{fill:"none",strokeWidth:2*s.annotations.outline.outlineWidth,stroke:s.annotations.outline.outlineColor,opacity:s.annotations.outline.outlineOpacity})}),u.jsx(Rt.circle,{cx:c.x,cy:c.y,r:c.radius,style:s.annotations.symbol})]})},hMe=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=Xt(),l=Lr(),c=l.animate,h=l.config,d=uo({x:t-r/2,y:n-i/2,width:r,height:i,config:h,immediate:!c});return u.jsxs(u.Fragment,{children:[o.annotations.outline.outlineWidth>0&&u.jsx(Rt.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:_s({},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})}),u.jsx(Rt.rect,{x:d.x,y:d.y,rx:a,ry:a,width:d.width,height:d.height,style:o.annotations.outline})]})},fMe=function(e){var t=e.datum,n=e.x,r=e.y,i=e.note,s=lMe(e);if(!rMe(i))throw new Error("note should be a valid react element");return u.jsxs(u.Fragment,{children:[u.jsx(_6,{points:s.points,isOutline:!0}),Vf(e)&&u.jsx(uMe,{x:n,y:r,size:e.size}),G2(e)&&u.jsx(dMe,{x:n,y:r,size:e.size}),qf(e)&&u.jsx(hMe,{x:n,y:r,width:e.width,height:e.height,borderRadius:e.borderRadius}),u.jsx(_6,{points:s.points}),u.jsx(cMe,{datum:t,x:s.text[0],y:s.text[1],note:i})]})},b6=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)})},pMe=function(e,t){var n=t.annotations,r=t.theme;n.length!==0&&(e.save(),n.forEach(function(i){if(!iMe(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(),b6(e,i.computed.points),e.stroke(),e.lineCap="butt"),Vf(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()),G2(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()),qf(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(),b6(e,i.computed.points),e.stroke(),Vf(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()),G2(i)&&(e.fillStyle=r.annotations.symbol.fill,e.beginPath(),e.arc(i.x,i.y,i.size/2,0,2*Math.PI),e.fill()),qf(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 f0(){return f0=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=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 az={nivo:["#e8c1a0","#f47560","#f1e15b","#e8a838","#61cdbb","#97e3d5"],category10:$B,accent:BB,dark2:FB,paired:zB,pastel1:HB,pastel2:WB,set1:UB,set2:VB,set3:vE,tableau10:Cwe},gMe=Object.keys(az),lz={brown_blueGreen:hy,purpleRed_green:fy,pink_yellowGreen:py,purple_orange:my,red_blue:gy,red_grey:vy,red_yellow_blue:yy,red_yellow_green:xy,spectral:_y},vMe=Object.keys(lz),yMe={brown_blueGreen:kwe,purpleRed_green:Ewe,pink_yellowGreen:Twe,purple_orange:Rwe,red_blue:Mwe,red_grey:Awe,red_yellow_blue:jwe,red_yellow_green:qB,spectral:Dwe},cz={blues:Ly,greens:Ny,greys:Py,oranges:$y,purples:Oy,reds:Iy,blue_green:by,blue_purple:wy,green_blue:Sy,orange_red:Cy,purple_blue_green:ky,purple_blue:Ey,purple_red:Ty,red_purple:Ry,yellow_green_blue:My,yellow_green:Ay,yellow_orange_brown:jy,yellow_orange_red:Dy},xMe=Object.keys(cz),_Me={blues:Wwe,greens:Uwe,greys:Vwe,oranges:Kwe,purples:qwe,reds:Gwe,turbo:n2e,viridis:XB,inferno:i2e,magma:r2e,plasma:s2e,cividis:Ywe,warm:Qwe,cool:YB,cubehelixDefault:Xwe,blue_green:Lwe,blue_purple:Nwe,green_blue:Pwe,orange_red:Owe,purple_blue_green:Iwe,purple_blue:$we,purple_red:Bwe,red_purple:Fwe,yellow_green_blue:zwe,yellow_green:GB,yellow_orange_brown:Hwe,yellow_orange_red:KB},G_=f0({},az,lz,cz),bMe=function(e){return gMe.includes(e)},wMe=function(e){return vMe.includes(e)},SMe=function(e){return xMe.includes(e)},CMe={rainbow:Jwe,sinebow:t2e};f0({},yMe,_Me,CMe);var kMe=function(e,t){if(typeof e=="function")return e;if(Hk(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=io(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 io(l,e.from)};if(Array.isArray(e.modifiers)){for(var i,s=[],a=function(){var l=i.value,c=l[0],h=l[1];if(c==="brighter")s.push(function(d){return d.brighter(h)});else if(c==="darker")s.push(function(d){return d.darker(h)});else{if(c!=="opacity")throw new Error("Invalid color modifier: '"+c+"', must be one of: 'brighter', 'darker', 'opacity'");s.push(function(d){return d.opacity=h,d})}},o=mMe(e.modifiers);!(i=o()).done;)a();return s.length===0?r:function(l){return s.reduce(function(c,h){return h(c)},Mu(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}},ju=function(e,t){return w.useMemo(function(){return kMe(e,t)},[e,t])};ee.oneOfType([ee.string,ee.func,ee.shape({theme:ee.string.isRequired}),ee.shape({from:ee.string.isRequired,modifiers:ee.arrayOf(ee.array)})]);var EMe=function(e,t){if(typeof e=="function")return e;var n=typeof t=="function"?t:function(d){return io(d,t)};if(Array.isArray(e)){var r=Wa(e),i=function(d){return r(n(d))};return i.scale=r,i}if(Hk(e)){if(function(d){return d.datum!==void 0}(e))return function(d){return io(d,e.datum)};if(function(d){return d.scheme!==void 0}(e)){if(bMe(e.scheme)){var s=Wa(G_[e.scheme]),a=function(d){return s(n(d))};return a.scale=s,a}if(wMe(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=Wa(G_[e.scheme][e.size||11]),l=function(d){return o(n(d))};return l.scale=o,l}if(SMe(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=Wa(G_[e.scheme][e.size||9]),h=function(d){return c(n(d))};return h.scale=c,h}}throw new Error("Invalid colors, when using an object, you should either pass a 'datum' or a 'scheme' property")}return function(){return e}},uz=function(e,t){return w.useMemo(function(){return EMe(e,t)},[e,t])},TMe=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 u.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"}})},RMe=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 u.jsx("g",{transform:"translate("+t+","+n+")",children:u.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"}})})},MMe=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 u.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"}})},AMe=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 u.jsx("g",{transform:"translate("+t+","+n+")",children:u.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 Va(){return Va=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var S6,IMe=function(e){var t=e.bars,n=e.annotations,r=oz({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 u.jsx(u.Fragment,{children:r.map(function(i,s){return u.jsx(fMe,Et({},i),s)})})},$Me=function(e){var t=e.width,n=e.height,r=e.legends,i=e.toggleSerie;return u.jsx(u.Fragment,{children:r.map(function(s,a){var o,l=s[0],c=s[1];return u.jsx(fz,Et({},l,{containerWidth:t,containerHeight:n,data:(o=l.data)!=null?o:c,toggleSerie:l.toggleSerie&&l.dataFrom==="keys"?i:void 0}),a)})})},BMe=["data"],FMe=function(e){var t,n=e.bar,r=n.data,i=_d(n,BMe),s=e.style,a=s.borderColor,o=s.color,l=s.height,c=s.labelColor,h=s.labelOpacity,d=s.labelX,f=s.labelY,m=s.transform,_=s.width,v=e.borderRadius,y=e.borderWidth,g=e.label,p=e.shouldRenderLabel,x=e.isInteractive,b=e.onClick,S=e.onMouseEnter,C=e.onMouseLeave,E=e.tooltip,k=e.isFocusable,T=e.ariaLabel,R=e.ariaLabelledBy,M=e.ariaDescribedBy,D=Xt(),N=Lk(),L=N.showTooltipFromEvent,P=N.showTooltipAt,I=N.hideTooltip,z=w.useMemo(function(){return function(){return w.createElement(E,Et({},i,r))}},[E,i,r]),O=w.useCallback(function(G){b==null||b(Et({color:i.color},r),G)},[i,r,b]),A=w.useCallback(function(G){return L(z(),G)},[L,z]),j=w.useCallback(function(G){S==null||S(r,G),L(z(),G)},[r,S,L,z]),F=w.useCallback(function(G){C==null||C(r,G),I()},[r,I,C]),H=w.useCallback(function(){P(z(),[i.absX+i.width/2,i.absY])},[P,z,i]),B=w.useCallback(function(){I()},[I]);return u.jsxs(Rt.g,{transform:m,children:[u.jsx(Rt.rect,{width:ua(_,function(G){return Math.max(G,0)}),height:ua(l,function(G){return Math.max(G,0)}),rx:v,ry:v,fill:(t=r.fill)!=null?t:o,strokeWidth:y,stroke:a,focusable:k,tabIndex:k?0:void 0,"aria-label":T?T(r):void 0,"aria-labelledby":R?R(r):void 0,"aria-describedby":M?M(r):void 0,onMouseEnter:x?j:void 0,onMouseMove:x?A:void 0,onMouseLeave:x?F:void 0,onClick:x?O:void 0,onFocus:x&&k?H:void 0,onBlur:x&&k?B:void 0}),p&&u.jsx(Rt.text,{x:d,y:f,textAnchor:"middle",dominantBaseline:"central",fillOpacity:h,style:Et({},D.labels.text,{pointerEvents:"none",fill:c}),children:g})]})},zMe=["color","label"],HMe=function(e){var t=e.color,n=e.label,r=_d(e,zMe);return u.jsx(y$,{id:n,value:r.formattedValue,enableChip:!0,color:t})},At={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:HMe,tooltipLabel:function(e){return e.id+" - "+e.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},Vt=Et({},At,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:FMe,defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),$n=Et({},At,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:typeof window<"u"&&(S6=window.devicePixelRatio)!=null?S6:1}),pz=function(e,t,n,r,i,s){return PE(r,{all:e.map(t),min:0,max:0},i,s).padding(n)},mz=function(e,t){return e.map(function(n){return Et({},t.reduce(function(r,i){return r[i]=null,r},{}),n)})},qy=function(e){return Object.keys(e).reduce(function(t,n){return e[n]&&(t[n]=e[n]),t},{})},Gy=function(e){return[e,Number(e)]},WMe=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],IE=function(e,t){return e>t},gz=function(e,t){return e0?r==="vertical"?VMe.apply(void 0,A):qMe.apply(void 0,A):[]}},KMe=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],YMe=function e(t){var n;return t.some(Array.isArray)?e((n=[]).concat.apply(n,t)):t},XMe=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,h=e.yScale,d=e.margin,f=[];return l.forEach(function(m){return c.domain().forEach(function(_,v){var y,g,p=m[v],x=(y=c(s(p.data)))!=null?y:0,b=((g=function(R){return h(R[n?0:1])}(p))!=null?g:0)+.5*o,S=function(R,M){var D;return((D=h(R[n?1:0]))!=null?D:0)-M}(p,b)-o,C=Gy(p.data[m.key]),E=C[0],k=C[1],T={id:m.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:v,indexValue:_,data:qy(p.data)};f.push({key:m.key+"."+_,index:f.length,data:T,x,y:b,absX:d.left+x,absY:d.top+b,width:t,height:S,color:i(T),label:a(T)})})}),f},QMe=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,h=e.yScale,d=e.margin,f=[];return l.forEach(function(m){return h.domain().forEach(function(_,v){var y,g,p=m[v],x=(y=h(s(p.data)))!=null?y:0,b=((g=function(R){return c(R[n?1:0])}(p))!=null?g:0)+.5*o,S=function(R,M){var D;return((D=c(R[n?0:1]))!=null?D:0)-M}(p,b)-o,C=Gy(p.data[m.key]),E=C[0],k=C[1],T={id:m.key,value:E===null?E:k,formattedValue:r(k),hidden:!1,index:v,indexValue:_,data:qy(p.data)};f.push({key:m.key+"."+_,index:f.length,data:T,x:b,y:x,absX:d.left+b,absY:d.top+x,width:S,height:t,color:i(T),label:a(T)})})}),f},JMe=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,h=c===void 0?0:c,d=e.valueScale,f=e.indexScale,m=e.hiddenIds,_=m===void 0?[]:m,v=_d(e,KMe),y=v.keys.filter(function(O){return!_.includes(O)}),g=kSe().keys(y).offset(ESe)(mz(n,y)),p=r==="vertical"?["y","x",o]:["x","y",l],x=p[0],b=p[1],S=p[2],C=pz(n,v.getIndex,h,f,S,b),E=Et({max:s,min:i,reverse:a},d),k=(t=YMe(g),d.type==="log"?t.filter(function(O){return O!==0}):t),T=Math.min.apply(Math,k),R=Math.max.apply(Math,k),M=PE(E,{all:k,min:T,max:R},x==="x"?o:l,x),D=r==="vertical"?[C,M]:[M,C],N=D[0],L=D[1],P=v.innerPadding>0?v.innerPadding:0,I=C.bandwidth(),z=[Et({},v,{innerPadding:P,stackedData:g,xScale:N,yScale:L}),I,E.reverse];return{xScale:N,yScale:L,bars:I>0?r==="vertical"?XMe.apply(void 0,z):QMe.apply(void 0,z):[]}},ZMe=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=HF(a??(r==="indexes"?"indexValue":"id"));return r==="indexes"?function(c,h,d){var f=o6(c.map(function(m){var _,v;return{id:(_=m.data.indexValue)!=null?_:"",label:d(m.data),hidden:m.data.hidden,color:(v=m.color)!=null?v:"#000"}}),function(m){return m.id});return h==="horizontal"&&f.reverse(),f}(t,s,l):function(c,h,d,f,m,_){var v=o6(c.map(function(y){var g;return{id:y.data.id,label:_(y.data),hidden:y.data.hidden,color:(g=y.color)!=null?g:"#000"}}),function(y){return y.id});return(h==="vertical"&&f==="stacked"&&d==="column"&&m!==!0||h==="horizontal"&&f==="stacked"&&m===!0)&&v.reverse(),v}(t,s,n,i,o,l)},C6=function(e,t,n){var r=e.get(t)||0;e.set(t,r+n)},eAe=function(e,t,n){var r=e.get(t)||0;e.set(t,r+(n>0?n:0))},tAe=function(e,t,n){var r=e.get(t)||0;e.set(t,Math.max(r,Number(n)))},nAe=function(e,t){var n=e.get(t)||0;e.set(t,n+1)},yz=function(e){var t=e.indexBy,n=t===void 0?At.indexBy:t,r=e.keys,i=r===void 0?At.keys:r,s=e.label,a=s===void 0?At.label:s,o=e.tooltipLabel,l=o===void 0?At.tooltipLabel:o,c=e.valueFormat,h=e.colors,d=h===void 0?At.colors:h,f=e.colorBy,m=f===void 0?At.colorBy:f,_=e.borderColor,v=_===void 0?At.borderColor:_,y=e.labelTextColor,g=y===void 0?At.labelTextColor:y,p=e.groupMode,x=p===void 0?At.groupMode:p,b=e.layout,S=b===void 0?At.layout:b,C=e.reverse,E=C===void 0?At.reverse:C,k=e.data,T=e.minValue,R=T===void 0?At.minValue:T,M=e.maxValue,D=M===void 0?At.maxValue:M,N=e.margin,L=e.width,P=e.height,I=e.padding,z=I===void 0?At.padding:I,O=e.innerPadding,A=O===void 0?At.innerPadding:O,j=e.valueScale,F=j===void 0?At.valueScale:j,H=e.indexScale,B=H===void 0?At.indexScale:H,G=e.initialHiddenIds,Z=G===void 0?At.initialHiddenIds:G,X=e.enableLabel,W=X===void 0?At.enableLabel:X,$=e.labelSkipWidth,V=$===void 0?At.labelSkipWidth:$,U=e.labelSkipHeight,Q=U===void 0?At.labelSkipHeight:U,q=e.legends,ie=q===void 0?At.legends:q,re=e.legendLabel,ce=e.totalsOffset,ye=ce===void 0?At.totalsOffset:ce,le=w.useState(Z??[]),Re=le[0],Ae=le[1],_e=w.useCallback(function(Me){Ae(function(Fe){return Fe.indexOf(Me)>-1?Fe.filter(function(et){return et!==Me}):[].concat(Fe,[Me])})},[]),Ce=sl(n),oe=sl(a),te=sl(l),se=Wy(c),ue=Xt(),Y=uz(d,m),ne=ju(v,ue),ae=ju(g,ue),he=(x==="grouped"?GMe:JMe)({layout:S,reverse:E,data:k,getIndex:Ce,keys:i,minValue:R,maxValue:D,width:L,height:P,getColor:Y,padding:z,innerPadding:A,valueScale:F,indexScale:B,hiddenIds:Re,formatValue:se,getTooltipLabel:te,margin:N}),be=he.bars,ve=he.xScale,xe=he.yScale,Ue=w.useMemo(function(){return be.filter(function(Me){return Me.data.value!==null}).map(function(Me,Fe){return Et({},Me,{index:Fe})})},[be]),Be=w.useCallback(function(Me){var Fe=Me.width,et=Me.height;return!!W&&!(V>0&&Fe0&&et0&&(Ie.strokeStyle=Ea,Ie.lineWidth=nr),Ie.beginPath(),Zl>0){var In=Math.min(Zl,mt);Ie.moveTo(Mt+In,en),Ie.lineTo(Mt+Zt-In,en),Ie.quadraticCurveTo(Mt+Zt,en,Mt+Zt,en+In),Ie.lineTo(Mt+Zt,en+mt-In),Ie.quadraticCurveTo(Mt+Zt,en+mt,Mt+Zt-In,en+mt),Ie.lineTo(Mt+In,en+mt),Ie.quadraticCurveTo(Mt,en+mt,Mt,en+mt-In),Ie.lineTo(Mt,en+In),Ie.quadraticCurveTo(Mt,en,Mt+In,en),Ie.closePath()}else Ie.rect(Mt,en,Zt,mt);Ie.fill(),nr>0&&Ie.stroke(),Ts&&(Ie.textBaseline="middle",Ie.textAlign="center",Ie.fillStyle=Te,Ie.fillText(Cd,Mt+Zt/2,en+mt/2))}:L,I=e.enableLabel,z=I===void 0?$n.enableLabel:I,O=e.label,A=e.labelSkipWidth,j=A===void 0?$n.labelSkipWidth:A,F=e.labelSkipHeight,H=F===void 0?$n.labelSkipHeight:F,B=e.labelTextColor,G=e.colorBy,Z=e.colors,X=e.borderRadius,W=X===void 0?$n.borderRadius:X,$=e.borderWidth,V=$===void 0?$n.borderWidth:$,U=e.borderColor,Q=e.annotations,q=Q===void 0?$n.annotations:Q,ie=e.legendLabel,re=e.tooltipLabel,ce=e.valueFormat,ye=e.isInteractive,le=ye===void 0?$n.isInteractive:ye,Re=e.tooltip,Ae=Re===void 0?$n.tooltip:Re,_e=e.onClick,Ce=e.onMouseEnter,oe=e.onMouseLeave,te=e.legends,se=e.pixelRatio,ue=se===void 0?$n.pixelRatio:se,Y=e.canvasRef,ne=e.enableTotals,ae=ne===void 0?$n.enableTotals:ne,he=e.totalsOffset,be=he===void 0?$n.totalsOffset:he,ve=w.useRef(null),xe=Xt(),Ue=jE(s,a,i),Be=Ue.margin,Le=Ue.innerWidth,Ne=Ue.innerHeight,yt=Ue.outerWidth,Me=Ue.outerHeight,Fe=yz({indexBy:n,label:O,tooltipLabel:re,valueFormat:ce,colors:Z,colorBy:G,borderColor:U,labelTextColor:B,groupMode:o,layout:l,reverse:c,data:t,keys:r,minValue:h,maxValue:d,margin:Be,width:Le,height:Ne,padding:_,innerPadding:v,valueScale:f,indexScale:m,enableLabel:z,labelSkipWidth:j,labelSkipHeight:H,legends:te,legendLabel:ie,totalsOffset:be}),et=Fe.bars,un=Fe.barsWithValue,st=Fe.xScale,xt=Fe.yScale,Jt=Fe.getLabel,dn=Fe.getTooltipLabel,Lt=Fe.getBorderColor,zt=Fe.getLabelColor,Ht=Fe.shouldRenderBarLabel,_n=Fe.legendsWithData,kt=Fe.barTotals,hn=Lk(),tt=hn.showTooltipFromEvent,Xe=hn.hideTooltip,Ve=aMe({annotations:oz({data:et,annotations:q,getPosition:function(Ie){return{x:Ie.x,y:Ie.y}},getDimensions:function(Ie){var $e=Ie.width,ut=Ie.height;return{width:$e,height:ut,size:Math.max($e,ut)}}})}),_t=w.useMemo(function(){return{borderRadius:W,borderWidth:V,isInteractive:le,isFocusable:!1,labelSkipWidth:j,labelSkipHeight:H,margin:Be,width:s,height:a,innerWidth:Le,innerHeight:Ne,bars:et,legendData:_n,enableLabel:z,xScale:st,yScale:xt,tooltip:Ae,getTooltipLabel:dn,onClick:_e,onMouseEnter:Ce,onMouseLeave:oe}},[W,V,le,j,H,Be,s,a,Le,Ne,et,_n,z,st,xt,Ae,dn,_e,Ce,oe]),on=Wy(ce);w.useEffect(function(){var Ie,$e=(Ie=ve.current)==null?void 0:Ie.getContext("2d");ve.current&&$e&&(ve.current.width=yt*ue,ve.current.height=Me*ue,$e.scale(ue,ue),$e.fillStyle=xe.background,$e.fillRect(0,0,yt,Me),$e.translate(Be.left,Be.top),N.forEach(function(ut){ut==="grid"?typeof xe.grid.line.strokeWidth=="number"&&xe.grid.line.strokeWidth>0&&($e.lineWidth=xe.grid.line.strokeWidth,$e.strokeStyle=xe.grid.line.stroke,E&&d6($e,{width:Le,height:Ne,scale:st,axis:"x",values:R}),T&&d6($e,{width:Le,height:Ne,scale:xt,axis:"y",values:M})):ut==="axes"?H3e($e,{xScale:st,yScale:xt,width:Le,height:Ne,top:y,right:g,bottom:x,left:S,theme:xe}):ut==="bars"?un.forEach(function(Nt){P($e,{bar:Nt,borderColor:Lt(Nt),borderRadius:W,borderWidth:V,label:Jt(Nt.data),labelColor:zt(Nt),shouldRenderLabel:Ht(Nt)})}):ut==="legends"?_n.forEach(function(Nt){var mt=Nt[0],Zt=Nt[1];OMe($e,Et({},mt,{data:Zt,containerWidth:Le,containerHeight:Ne,theme:xe}))}):ut==="annotations"?pMe($e,{annotations:Ve,theme:xe}):ut==="totals"&&ae?function(Nt,mt,Zt,Mt){Mt===void 0&&(Mt=$n.layout),Nt.fillStyle=Zt.text.fill,Nt.font="bold "+Zt.labels.text.fontSize+"px "+Zt.labels.text.fontFamily,Nt.textBaseline=Mt==="vertical"?"alphabetic":"middle",Nt.textAlign=Mt==="vertical"?"center":"start",mt.forEach(function(en){Nt.fillText(en.formattedValue,en.x,en.y)})}($e,kt,xe,l):typeof ut=="function"&&ut($e,_t)}),$e.save())},[x,S,g,y,un,W,V,Ve,E,T,Lt,Jt,zt,R,M,o,a,Ne,Le,_t,N,l,_n,Be.left,Be.top,Me,yt,ue,P,st,xt,c,Ht,xe,s,kt,ae,on]);var an=w.useCallback(function(Ie){if(et&&ve.current){var $e=U_(ve.current,Ie),ut=$e[0],Nt=$e[1],mt=K_(et,Be,ut,Nt);mt!==void 0?(tt(w.createElement(Ae,Et({},mt.data,{color:mt.color,label:mt.label,value:Number(mt.data.value)})),Ie),Ie.type==="mouseenter"&&(Ce==null||Ce(mt.data,Ie))):Xe()}},[Xe,Be,Ce,et,tt,Ae]),On=w.useCallback(function(Ie){if(et&&ve.current){Xe();var $e=U_(ve.current,Ie),ut=$e[0],Nt=$e[1],mt=K_(et,Be,ut,Nt);mt&&(oe==null||oe(mt.data,Ie))}},[Xe,Be,oe,et]),Jl=w.useCallback(function(Ie){if(et&&ve.current){var $e=U_(ve.current,Ie),ut=$e[0],Nt=$e[1],mt=K_(et,Be,ut,Nt);mt!==void 0&&(_e==null||_e(Et({},mt.data,{color:mt.color}),Ie))}},[Be,_e,et]);return u.jsx("canvas",{ref:function(Ie){ve.current=Ie,Y&&"current"in Y&&(Y.current=Ie)},width:yt*ue,height:Me*ue,style:{width:yt,height:Me,cursor:le?"auto":"normal"},onMouseEnter:le?an:void 0,onMouseMove:le?an:void 0,onMouseLeave:le?On:void 0,onClick:le?Jl:void 0})},cAe=w.forwardRef(function(e,t){var n=e.isInteractive,r=e.renderWrapper,i=e.theme,s=_d(e,aAe);return u.jsx(Uy,{isInteractive:n,renderWrapper:r,theme:i,animate:!1,children:u.jsx(lAe,Et({},s,{canvasRef:t}))})});w.forwardRef(function(e,t){return u.jsx(LF,{children:function(n){var r=n.width,i=n.height;return u.jsx(cAe,Et({width:r,height:i},e,{ref:t}))}})});const qh=window.document.documentElement,xz=window.txConsts.customThemes.map(e=>e.name),uAe=window.txConsts.customThemes.map(e=>`theme-${e.name}`),$E=["dark","light"],_z=xz.find(e=>qh.classList.contains(`theme-${e}`))??$E.find(e=>qh.classList.contains(e))??window.txConsts.defaultTheme,bz=e=>{document.cookie=`txAdmin-theme=${e};path=/;SameSite=Lax;max-age=31536000;`},wz=e=>{if($E.includes(e))return{isInvalid:!1,isDefault:!0,isDarkScheme:e==="dark",lightDarkClass:e,customClass:void 0};if(xz.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}},BE=nt(_z),dAe=nt(e=>{const t=e(BE);return wz(t).isDarkScheme});bz(_z);const K2=(e,t)=>{var l,c;const{isInvalid:n,isDefault:r,isDarkScheme:i,lightDarkClass:s,customClass:a}=wz(t);if(n)throw new Error(`invalid theme ${t}`);qh.classList.remove(...$E,...uAe),qh.classList.add(s),a&&qh.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")),bz(t),console.log(`Changed theme from '${e}' to '${t}'.`)},Sz=()=>{const[e,t]=Tr(BE);return{theme:e,setTheme:r=>{r!==e&&(K2(e,r),t(r))}}},hAe=()=>{const e=it(BE);return()=>e(t=>t==="dark"?(K2(t,"light"),"light"):t==="light"?(K2(t,"dark"),"dark"):(console.log("invalid theme",t),t))},Ky=()=>ct(dAe);var Cz=typeof global=="object"&&global&&global.Object===Object&&global,fAe=typeof self=="object"&&self&&self.Object===Object&&self,ks=Cz||fAe||Function("return this")(),Du=ks.Symbol,kz=Object.prototype,pAe=kz.hasOwnProperty,mAe=kz.toString,Zd=Du?Du.toStringTag:void 0;function gAe(e){var t=pAe.call(e,Zd),n=e[Zd];try{e[Zd]=void 0;var r=!0}catch{}var i=mAe.call(e);return r&&(t?e[Zd]=n:delete e[Zd]),i}var vAe=Object.prototype,yAe=vAe.toString;function xAe(e){return yAe.call(e)}var _Ae="[object Null]",bAe="[object Undefined]",k6=Du?Du.toStringTag:void 0;function zp(e){return e==null?e===void 0?bAe:_Ae:k6&&k6 in Object(e)?gAe(e):xAe(e)}function Hp(e){return e!=null&&typeof e=="object"}var FE=Array.isArray;function Yy(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var wAe="[object AsyncFunction]",SAe="[object Function]",CAe="[object GeneratorFunction]",kAe="[object Proxy]";function Ez(e){if(!Yy(e))return!1;var t=zp(e);return t==SAe||t==CAe||t==wAe||t==kAe}var Y_=ks["__core-js_shared__"],E6=function(){var e=/[^.]+$/.exec(Y_&&Y_.keys&&Y_.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function EAe(e){return!!E6&&E6 in e}var TAe=Function.prototype,RAe=TAe.toString;function Gl(e){if(e!=null){try{return RAe.call(e)}catch{}try{return e+""}catch{}}return""}var MAe=/[\\^$.*+?()[\]{}|]/g,AAe=/^\[object .+?Constructor\]$/,jAe=Function.prototype,DAe=Object.prototype,LAe=jAe.toString,NAe=DAe.hasOwnProperty,PAe=RegExp("^"+LAe.call(NAe).replace(MAe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OAe(e){if(!Yy(e)||EAe(e))return!1;var t=Ez(e)?PAe:AAe;return t.test(Gl(e))}function IAe(e,t){return e==null?void 0:e[t]}function Kl(e,t){var n=IAe(e,t);return OAe(n)?n:void 0}var Y2=Kl(ks,"WeakMap"),T6=Object.create,$Ae=function(){function e(){}return function(t){if(!Yy(t))return{};if(T6)return T6(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),R6=function(){try{var e=Kl(Object,"defineProperty");return e({},"",{}),e}catch{}}();function BAe(e,t){for(var n=-1,r=e==null?0:e.length;++n-1&&e%1==0&&e-1&&e%1==0&&e<=GAe}function KAe(e){return e!=null&&Rz(e.length)&&!Ez(e)}var YAe=Object.prototype;function Mz(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||YAe;return e===n}function XAe(e,t){for(var n=-1,r=Array(e);++n-1}function nje(e,t){var n=this.__data__,r=Xy(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ho(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t+e(t)}function H8e(e,t){return t=Math.max(0,e.bandwidth()-t*2)/2,e.round()&&(t=Math.round(t)),n=>+e(n)+t}function W8e(){return!this.__axis}function WE(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===Q_||e===_h?-1:1,h=e===_h||e===Rg?"x":"y",d=e===Q_||e===Z2?B8e:F8e;function f(m){var _=r??(t.ticks?t.ticks.apply(t,n):t.domain()),v=i??(t.tickFormat?t.tickFormat.apply(t,n):$8e),y=Math.max(s,0)+o,g=t.range(),p=+g[0]+l,x=+g[g.length-1]+l,b=(t.bandwidth?H8e:z8e)(t.copy(),l),S=m.selection?m.selection():m,C=S.selectAll(".domain").data([null]),E=S.selectAll(".tick").data(_,t).order(),k=E.exit(),T=E.enter().append("g").attr("class","tick"),R=E.select("line"),M=E.select("text");C=C.merge(C.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),E=E.merge(T),R=R.merge(T.append("line").attr("stroke","currentColor").attr(h+"2",c*s)),M=M.merge(T.append("text").attr("fill","currentColor").attr(h,c*y).attr("dy",e===Q_?"0em":e===Z2?"0.71em":"0.32em")),m!==S&&(C=C.transition(m),E=E.transition(m),R=R.transition(m),M=M.transition(m),k=k.transition(m).attr("opacity",q6).attr("transform",function(D){return isFinite(D=b(D))?d(D+l):this.getAttribute("transform")}),T.attr("opacity",q6).attr("transform",function(D){var N=this.parentNode.__axis;return d((N&&isFinite(N=N(D))?N:b(D))+l)})),k.remove(),C.attr("d",e===_h||e===Rg?a?"M"+c*a+","+p+"H"+l+"V"+x+"H"+c*a:"M"+l+","+p+"V"+x:a?"M"+p+","+c*a+"V"+l+"H"+x+"V"+c*a:"M"+p+","+l+"H"+x),E.attr("opacity",1).attr("transform",function(D){return d(b(D)+l)}),R.attr(h+"2",c*s),M.attr(h,c*y).text(v),S.filter(W8e).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",e===Rg?"start":e===_h?"end":"middle"),S.each(function(){this.__axis=b})}return f.scale=function(m){return arguments.length?(t=m,f):t},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(m){return arguments.length?(n=m==null?[]:Array.from(m),f):n.slice()},f.tickValues=function(m){return arguments.length?(r=m==null?null:Array.from(m),f):r&&r.slice()},f.tickFormat=function(m){return arguments.length?(i=m,f):i},f.tickSize=function(m){return arguments.length?(s=a=+m,f):s},f.tickSizeInner=function(m){return arguments.length?(s=+m,f):s},f.tickSizeOuter=function(m){return arguments.length?(a=+m,f):a},f.tickPadding=function(m){return arguments.length?(o=+m,f):o},f.offset=function(m){return arguments.length?(l=+m,f):l},f}function U8e(e){return WE(Rg,e)}function Bz(e){return WE(Z2,e)}function Fz(e){return WE(_h,e)}var V8e={value:()=>{}};function UE(){for(var e=0,t=arguments.length,n={},r;e=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}})}Mg.prototype=UE.prototype={constructor:Mg,on:function(e,t){var n=this._,r=q8e(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s0)for(var n=new Array(i),r=0,i,s;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),K6.hasOwnProperty(t)?{space:K6[t],local:e}:e}function K8e(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===eS&&t.documentElement.namespaceURI===eS?t.createElement(e):t.createElementNS(n,e)}}function Y8e(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function zz(e){var t=Jy(e);return(t.local?Y8e:K8e)(t)}function X8e(){}function VE(e){return e==null?X8e:function(){return this.querySelector(e)}}function Q8e(e){typeof e!="function"&&(e=VE(e));for(var t=this._groups,n=t.length,r=new Array(n),i=0;i=x&&(x=p+1);!(S=y[x])&&++x<_;);b._next=S||null}}return a=new Ur(a,r),a._enter=o,a._exit=l,a}function vDe(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function yDe(){return new Ur(this._exit||this._groups.map(Vz),this._parents)}function xDe(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 _De(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=0;)(a=r[i])&&(s&&a.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(a,s),s=a);return this}function wDe(e){e||(e=SDe);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;st?1:e>=t?0:NaN}function CDe(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function kDe(){return Array.from(this)}function EDe(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?IDe:typeof t=="function"?BDe:$De)(e,t,n??"")):Nu(this.node(),e)}function Nu(e,t){return e.style.getPropertyValue(t)||qz(e).getComputedStyle(e,null).getPropertyValue(t)}function zDe(e){return function(){delete this[e]}}function HDe(e,t){return function(){this[e]=t}}function WDe(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function UDe(e,t){return arguments.length>1?this.each((t==null?zDe:typeof t=="function"?WDe:HDe)(e,t)):this.node()[e]}function Gz(e){return e.trim().split(/^|\s+/)}function qE(e){return e.classList||new Kz(e)}function Kz(e){this._node=e,this._names=Gz(e.getAttribute("class")||"")}Kz.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 Yz(e,t){for(var n=qE(e),r=-1,i=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function y7e(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,s;n=0&&e._call.call(void 0,t),e=e._next;--Pu}function Y6(){El=(g0=Yf.now())+Zy,Pu=bh=0;try{A7e()}finally{Pu=0,D7e(),El=0}}function j7e(){var e=Yf.now(),t=e-g0;t>Zz&&(Zy-=t,g0=e)}function D7e(){for(var e,t=m0,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:m0=n);wh=e,rS(r)}function rS(e){if(!Pu){bh&&(bh=clearTimeout(bh));var t=e-El;t>24?(e<1/0&&(bh=setTimeout(Y6,e-Yf.now()-Zy)),eh&&(eh=clearInterval(eh))):(eh||(g0=Yf.now(),eh=setInterval(j7e,Zz)),Pu=1,eH(Y6))}}function X6(e,t,n){var r=new v0;return t=t==null?0:+t,r.restart(i=>{r.stop(),e(i+t)},t,n),r}var L7e=UE("start","end","cancel","interrupt"),N7e=[],nH=0,Q6=1,iS=2,Ag=3,J6=4,sS=5,jg=6;function ex(e,t,n,r,i,s){var a=e.__transition;if(!a)e.__transition={};else if(n in a)return;P7e(e,n,{name:t,index:r,group:i,on:L7e,tween:N7e,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:nH})}function KE(e,t){var n=Hi(e,t);if(n.state>nH)throw new Error("too late; already scheduled");return n}function Es(e,t){var n=Hi(e,t);if(n.state>Ag)throw new Error("too late; already running");return n}function Hi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function P7e(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=tH(s,0,n.time);function s(c){n.state=Q6,n.timer.restart(a,n.delay,n.time),n.delay<=c&&a(c-n.delay)}function a(c){var h,d,f,m;if(n.state!==Q6)return l();for(h in r)if(m=r[h],m.name===n.name){if(m.state===Ag)return X6(a);m.state===J6?(m.state=jg,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete r[h]):+hiS&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function dLe(e,t,n){var r,i,s=uLe(t)?KE:Es;return function(){var a=s(this,e),o=a.on;o!==r&&(i=(r=o).copy()).on(t,n),a.on=i}}function hLe(e,t){var n=this._id;return arguments.length<2?Hi(this.node(),n).on.on(e):this.each(dLe(n,e,t))}function fLe(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function pLe(){return this.on("end.remove",fLe(this._id))}function mLe(e){var t=this._name,n=this._id;typeof e!="function"&&(e=VE(e));for(var r=this._groups,i=r.length,s=new Array(i),a=0;a()=>e;function FLe(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 Vs(e,t,n){this.k=e,this.x=t,this.y=n}Vs.prototype={constructor:Vs,scale:function(e){return e===1?this:new Vs(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Vs(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 oH=new Vs(1,0,0);Vs.prototype;function J_(e){e.stopImmediatePropagation()}function th(e){e.preventDefault(),e.stopImmediatePropagation()}function zLe(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function HLe(){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 Z6(){return this.__zoom||oH}function WLe(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function ULe(){return navigator.maxTouchPoints||"ontouchstart"in this}function VLe(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 qLe(){var e=zLe,t=HLe,n=VLe,r=WLe,i=ULe,s=[0,1/0],a=[[-1/0,-1/0],[1/0,1/0]],o=250,l=a_e,c=UE("start","zoom","end"),h,d,f,m=500,_=150,v=0,y=10;function g(L){L.property("__zoom",Z6).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",T).on("dblclick.zoom",R).filter(i).on("touchstart.zoom",M).on("touchmove.zoom",D).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}g.transform=function(L,P,I,z){var O=L.selection?L.selection():L;O.property("__zoom",Z6),L!==O?S(L,P,I,z):O.interrupt().each(function(){C(this,arguments).event(z).start().zoom(null,typeof P=="function"?P.apply(this,arguments):P).end()})},g.scaleBy=function(L,P,I,z){g.scaleTo(L,function(){var O=this.__zoom.k,A=typeof P=="function"?P.apply(this,arguments):P;return O*A},I,z)},g.scaleTo=function(L,P,I,z){g.transform(L,function(){var O=t.apply(this,arguments),A=this.__zoom,j=I==null?b(O):typeof I=="function"?I.apply(this,arguments):I,F=A.invert(j),H=typeof P=="function"?P.apply(this,arguments):P;return n(x(p(A,H),j,F),O,a)},I,z)},g.translateBy=function(L,P,I,z){g.transform(L,function(){return n(this.__zoom.translate(typeof P=="function"?P.apply(this,arguments):P,typeof I=="function"?I.apply(this,arguments):I),t.apply(this,arguments),a)},null,z)},g.translateTo=function(L,P,I,z,O){g.transform(L,function(){var A=t.apply(this,arguments),j=this.__zoom,F=z==null?b(A):typeof z=="function"?z.apply(this,arguments):z;return n(oH.translate(F[0],F[1]).scale(j.k).translate(typeof P=="function"?-P.apply(this,arguments):-P,typeof I=="function"?-I.apply(this,arguments):-I),A,a)},z,O)};function p(L,P){return P=Math.max(s[0],Math.min(s[1],P)),P===L.k?L:new Vs(P,L.x,L.y)}function x(L,P,I){var z=P[0]-I[0]*L.k,O=P[1]-I[1]*L.k;return z===L.x&&O===L.y?L:new Vs(L.k,z,O)}function b(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function S(L,P,I,z){L.on("start.zoom",function(){C(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){C(this,arguments).event(z).end()}).tween("zoom",function(){var O=this,A=arguments,j=C(O,A).event(z),F=t.apply(O,A),H=I==null?b(F):typeof I=="function"?I.apply(O,A):I,B=Math.max(F[1][0]-F[0][0],F[1][1]-F[0][1]),G=O.__zoom,Z=typeof P=="function"?P.apply(O,A):P,X=l(G.invert(H).concat(B/G.k),Z.invert(H).concat(B/Z.k));return function(W){if(W===1)W=Z;else{var $=X(W),V=B/$[2];W=new Vs(V,H[0]-$[0]*V,H[1]-$[1]*V)}j.zoom(null,W)}})}function C(L,P,I){return!I&&L.__zooming||new E(L,P)}function E(L,P){this.that=L,this.args=P,this.active=0,this.sourceEvent=null,this.extent=t.apply(L,P),this.taps=0}E.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,P){return this.mouse&&L!=="mouse"&&(this.mouse[1]=P.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=P.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=P.invert(this.touch1[0])),this.that.__zoom=P,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var P=lr(this.that).datum();c.call(L,this.that,new FLe(L,{sourceEvent:this.sourceEvent,target:g,type:L,transform:this.that.__zoom,dispatch:c}),P)}};function k(L,...P){if(!e.apply(this,arguments))return;var I=C(this,P).event(L),z=this.__zoom,O=Math.max(s[0],Math.min(s[1],z.k*Math.pow(2,r.apply(this,arguments)))),A=Ci(L);if(I.wheel)(I.mouse[0][0]!==A[0]||I.mouse[0][1]!==A[1])&&(I.mouse[1]=z.invert(I.mouse[0]=A)),clearTimeout(I.wheel);else{if(z.k===O)return;I.mouse=[A,z.invert(A)],Dg(this),I.start()}th(L),I.wheel=setTimeout(j,_),I.zoom("mouse",n(x(p(z,O),I.mouse[0],I.mouse[1]),I.extent,a));function j(){I.wheel=null,I.end()}}function T(L,...P){if(f||!e.apply(this,arguments))return;var I=L.currentTarget,z=C(this,P,!0).event(L),O=lr(L.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",B,!0),A=Ci(L,I),j=L.clientX,F=L.clientY;T7e(L.view),J_(L),z.mouse=[A,this.__zoom.invert(A)],Dg(this),z.start();function H(G){if(th(G),!z.moved){var Z=G.clientX-j,X=G.clientY-F;z.moved=Z*Z+X*X>v}z.event(G).zoom("mouse",n(x(z.that.__zoom,z.mouse[0]=Ci(G,I),z.mouse[1]),z.extent,a))}function B(G){O.on("mousemove.zoom mouseup.zoom",null),R7e(G.view,z.moved),th(G),z.event(G).end()}}function R(L,...P){if(e.apply(this,arguments)){var I=this.__zoom,z=Ci(L.changedTouches?L.changedTouches[0]:L,this),O=I.invert(z),A=I.k*(L.shiftKey?.5:2),j=n(x(p(I,A),z,O),t.apply(this,P),a);th(L),o>0?lr(this).transition().duration(o).call(S,j,z,L):lr(this).call(g.transform,j,z,L)}}function M(L,...P){if(e.apply(this,arguments)){var I=L.touches,z=I.length,O=C(this,P,L.changedTouches.length===z).event(L),A,j,F,H;for(J_(L),j=0;j{let n;for(const r of e)if(r==="+Inf"){if(n!==void 0&&ne==="+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`,aH=e=>{const t=[];for(let n=0;n=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},lH=(e,t)=>{if(e.length!==t.length)throw new Error("Invalid bucket count");let n=0;const r=[];for(let i=0;ii/n)},KLe=60*1e3,YLe=15*60*1e3,dc={bootDuration:void 0,closeReason:void 0,log:[]},XLe=(e,t)=>{var a,o;let n,r,i=[],s=Na(dc);for(const l of e){s===void 0&&(s=Na(dc));const c=(a=s==null?void 0:s.log)==null?void 0:a.length;if(l.type==="svBoot")c&&(i.push(s),s=Na(dc)),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=Na(dc));else if(l.type==="data"){const h=l.ts-YLe,d=c?s.log.at(-1):void 0;let f=l.ts-KLe;if(d){const v=d.end.getTime();v>=h?f=v:(i.push(s),s=Na(dc))}else if(s.bootTime){const v=s.bootTime.getTime();v>=h?f=v:s=Na(dc)}const m=new Date(f),_=new Date(l.ts);n||(n=m),r=_,s.log.push({start:m,end:_,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},QLe=(e,t,n)=>{const 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(){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=w.useCallback(TC(e,o,{atBegin:!1}),[r]);return w.useEffect(()=>{if(!r.current)return;const c=new ResizeObserver(()=>{const h=r.current.clientHeight,d=r.current.clientWidth;h===0||d===0||a.current.width===d&&a.current.height===h||(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]),u.jsxs("div",{ref:r,style:{height:"100%",width:"100%",position:"relative"},children:[u.jsx("div",{ref:i,className:"absolute inset-0 flex items-center justify-center",children:u.jsx(sn,{className:"animate-spin size-16 text-muted-foreground"})}),u.jsx("div",{className:"absolute inset-0",ref:s,children:n})]})}const Xf=w.memo(JLe),ZLe={svMain:1e3/20/1e3,svNetwork:1e3/40/1e3,svSync:1e3/40/1e3},eNe=w.memo(({data:e,minTickIntervalMarker:t,width:n,height:r})=>{const i=Ky(),s=a=>{var h;const o=((h=e.find((d,f)=>f===a.index-1))==null?void 0:h.bucket)??0,l=a.data.bucket,c=(a.value*100).toFixed()+"%";return u.jsxs("div",{className:"p-3 text-gray-900 bg-white rounded-md shadow-md",children:[u.jsxs("div",{children:["Tick duration: ",u.jsx("strong",{children:Lg(o)})," ~ ",u.jsx("strong",{children:Lg(l)})]}),u.jsxs("div",{children:["Time spent: ",u.jsxs("strong",{children:["~",c]})]}),u.jsxs("div",{children:["Tick count: ",a.data.count]})]})};return t=void 0,!n||!r?null:u.jsx(oAe,{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:Lg},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",opacity:.5,strokeWidth:4,strokeDasharray:"6 2",strokeDashoffset:1},legend:"good",legendPosition:"bottom-right",legendOffsetX:10,legendOffsetY:12,legendOrientation:"horizontal",textStyle:{fontSize:"16px",opacity:.5}},{axis:"y",value:t,lineStyle:{stroke:"white",opacity:.55,strokeWidth:2,strokeDasharray:"4 4"},legend:"bad",legendPosition:"top-right",legendOffsetX:10,legendOffsetY:12,legendOrientation:"horizontal",textStyle:{fontSize:"16px",opacity:.5}}]:void 0})});function tNe(){const[e,t]=w.useState({width:0,height:0}),[n,r]=w.useState("svMain"),i=ct(q0),s=ct(G0),a=AC(),o=w.useMemo(()=>{if(!i||a().isExpired)return null;if(!i.perfBoundaries||!i.perfBucketCounts)return"incomplete";const d=s?s.threadName:n??"svMain",{perfBoundaries:f,perfBucketCounts:m}=i,_=ZLe[d],v=GLe(f,_),y=f.findIndex(S=>S===v);let g;y?g=S=>{const C=y+1;return S<=y?GB(1.1-S/C):KB(.25+(S-C)/(f.length-C))}:g=S=>qB(1-(S+1)/f.length);const p=m[d];let x;if(s)x=s.snap.weightedPerf;else{const S=aH(f);x=lH(p,S)}const b=[];for(let S=0;S{const d=a();if(!i||d.isExpired||!i.perfBoundaries||!i.perfBucketCounts)return null;if(s){const f=bu(s.snap.end,"2-digit","2-digit"),m=wu(s.snap.end,"short"),_=wf(s.snap.end)?f:`${f} - ${m}`;return u.jsxs(u.Fragment,{children:["(",u.jsx("span",{className:"text-xs text-warning-inline font-mono",children:_}),")"]})}else return d.isStale?"(minutes ago)":"(last minute)"},[i,s]);let c,h=null;return typeof o=="object"&&o!==null?(c=o.threadName,h=u.jsx(eNe,{...o,width:e.width,height:e.height})):typeof o=="string"?h=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:u.jsxs("p",{className:"max-w-80",children:["Data not yet available. ",u.jsx("br",{}),"The thread performance chart will appear soon after the server is online."]})}):h=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:u.jsx(sn,{className:"animate-spin size-16 text-muted-foreground"})}),u.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:[u.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:[c??n," performance ",l]}),u.jsxs("div",{className:"flex gap-4",children:[u.jsxs(Hn,{defaultValue:n,onValueChange:r,disabled:!!s,children:[u.jsx(Dn,{className:J("w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",!!s&&"hidden"),children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:"svMain",className:"cursor-pointer",children:"svMain"}),u.jsx(Se,{value:"svSync",className:"cursor-pointer",children:"svSync"}),u.jsx(Se,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),u.jsx("div",{className:"hidden xs:block",children:u.jsx(MX,{})})]})]}),u.jsx(Xf,{onDebouncedResize:t,children:h})]})}function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t=t})},sNe={startAngle:{enter:function(e){return $t({},e,{endAngle:e.startAngle})},update:function(e){return e},leave:function(e){return $t({},e,{startAngle:e.endAngle})}},middleAngle:{enter:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return $t({},e,{startAngle:t,endAngle:t})},update:function(e){return e},leave:function(e){var t=e.startAngle+(e.endAngle-e.startAngle)/2;return $t({},e,{startAngle:t,endAngle:t})}},endAngle:{enter:function(e){return $t({},e,{startAngle:e.endAngle})},update:function(e){return e},leave:function(e){return $t({},e,{endAngle:e.startAngle})}},innerRadius:{enter:function(e){return $t({},e,{outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return $t({},e,{innerRadius:e.outerRadius})}},centerRadius:{enter:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return $t({},e,{innerRadius:t,outerRadius:t})},update:function(e){return e},leave:function(e){var t=e.innerRadius+(e.outerRadius-e.innerRadius)/2;return $t({},e,{innerRadius:t,outerRadius:t})}},outerRadius:{enter:function(e){return $t({},e,{innerRadius:e.outerRadius})},update:function(e){return e},leave:function(e){return $t({},e,{outerRadius:e.innerRadius})}},pushIn:{enter:function(e){return $t({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})},update:function(e){return e},leave:function(e){return $t({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})}},pushOut:{enter:function(e){return $t({},e,{innerRadius:e.outerRadius,outerRadius:e.outerRadius+e.outerRadius-e.innerRadius})},update:function(e){return e},leave:function(e){return $t({},e,{innerRadius:e.innerRadius-e.outerRadius+e.innerRadius,outerRadius:e.innerRadius})}}},uH=function(e,t){return w.useMemo(function(){var n=sNe[e];return{enter:function(r){return $t({progress:0},n.enter(r.arc),t?t.enter(r):{})},update:function(r){return $t({progress:1},n.update(r.arc),t?t.update(r):{})},leave:function(r){return $t({progress:0},n.leave(r.arc),t?t.leave(r):{})}}},[e,t])},oNe=function(e,t){var n=yke(e)-Math.PI/2,r=e.innerRadius+(e.outerRadius-e.innerRadius)*t;return il(n,r)},aNe=function(e){return function(t,n,r,i){return ua([t,n,r,i],function(s,a,o,l){var c=oNe({startAngle:s,endAngle:a,innerRadius:o,outerRadius:l},e);return"translate("+c.x+","+c.y+")"})}},lNe=function(e,t,n,r){t===void 0&&(t=.5),n===void 0&&(n="innerRadius");var i=Lr(),s=i.animate,a=i.config,o=uH(n,r);return{transition:Fl(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:aNe(t)}},cNe=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?rNe:l,h=sl(i),d=Xt(),f=ju(o,d),m=w.useMemo(function(){return n.filter(function(p){return Math.abs(Vy(p.arc.endAngle-p.arc.startAngle))>=a})},[n,a]),_=lNe(m,s,r),v=_.transition,y=_.interpolate,g=c;return u.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:v(function(p,x){return w.createElement(g,{key:x.id,datum:x,label:h(x),style:$t({},p,{transform:y(p.startAngle,p.endAngle,p.innerRadius,p.outerRadius),textColor:f(x)})})})})},uNe=function(e){var t=e.label,n=e.style,r=Xt();return u.jsxs(Rt.g,{opacity:n.opacity,children:[u.jsx(Rt.path,{fill:"none",stroke:n.linkColor,strokeWidth:n.thickness,d:n.path}),u.jsx(Rt.text,{transform:n.textPosition,textAnchor:n.textAnchor,dominantBaseline:"central",style:$t({},r.labels.text,{fill:n.textColor}),children:t})]})},dNe=function(e){var t=cH(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2);return t1.5*Math.PI?"start":"end"},dH=function(e,t,n,r){var i,s,a=cH(e.startAngle+(e.endAngle-e.startAngle)/2-Math.PI/2),o=il(a,e.outerRadius+t),l=il(a,e.outerRadius+t+n);return a1.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]}},hNe=iF().x(function(e){return e.x}).y(function(e){return e.y}),fNe=function(e,t,n,r,i,s,a){return ua([e,t,n,r,i,s,a],function(o,l,c,h,d,f,m){var _=dH({startAngle:o,endAngle:l,innerRadius:c,outerRadius:h},d,f,m).points;return hNe(_)})},pNe=function(e,t,n,r){return ua([e,t,n,r],function(i,s,a,o){return dNe({startAngle:i,endAngle:s,innerRadius:a,outerRadius:o})})},mNe=function(e,t,n,r,i,s,a,o){return ua([e,t,n,r,i,s,a,o],function(l,c,h,d,f,m,_,v){var y=dH({startAngle:l,endAngle:c,innerRadius:h,outerRadius:d},f,m,_),g=y.points,p=y.side,x=g[2];return p==="before"?x.x-=v:x.x+=v,"translate("+x.x+","+x.y+")"})},gNe=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,h=e.textColor,d=Lr(),f=d.animate,m=d.config,_=Xt(),v=ju(c,_),y=ju(h,_),g=function(x,b){return w.useMemo(function(){return iNe(x,b)},[x,b])}(t,o),p=function(x){var b=x.offset,S=x.diagonalLength,C=x.straightLength,E=x.textOffset,k=x.getLinkColor,T=x.getTextColor;return w.useMemo(function(){return{enter:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(R),textColor:T(R),opacity:0}},update:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:S,straightLength:C,textOffset:E,linkColor:k(R),textColor:T(R),opacity:1}},leave:function(R){return{startAngle:R.arc.startAngle,endAngle:R.arc.endAngle,innerRadius:R.arc.innerRadius,outerRadius:R.arc.outerRadius,offset:b,diagonalLength:0,straightLength:0,textOffset:E,linkColor:k(R),textColor:T(R),opacity:0}}}},[S,C,E,k,T,b])}({offset:r,diagonalLength:i,straightLength:s,textOffset:l,getLinkColor:v,getTextColor:y});return{transition:Fl(g,{keys:function(x){return x.id},initial:p.update,from:p.enter,enter:p.update,update:p.update,leave:p.leave,config:m,immediate:!f}),interpolateLink:fNe,interpolateTextAnchor:pNe,interpolateTextPosition:mNe}},vNe=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,h=e.textColor,d=e.linkColor,f=e.component,m=f===void 0?uNe:f,_=sl(r),v=gNe({data:n,skipAngle:i,offset:s,diagonalLength:a,straightLength:o,textOffset:c,linkColor:d,textColor:h}),y=v.transition,g=v.interpolateLink,p=v.interpolateTextAnchor,x=v.interpolateTextPosition,b=m;return u.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:y(function(S,C){return w.createElement(b,{key:C.id,datum:C,label:_(C),style:$t({},S,{thickness:l,path:g(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius,S.offset,S.diagonalLength,S.straightLength),textAnchor:p(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius),textPosition:x(S.startAngle,S.endAngle,S.innerRadius,S.outerRadius,S.offset,S.diagonalLength,S.straightLength,S.textOffset)})})})})},yNe=function(e){var t=e.datum,n=e.style,r=e.onClick,i=e.onMouseEnter,s=e.onMouseMove,a=e.onMouseLeave,o=w.useCallback(function(d){return r==null?void 0:r(t,d)},[r,t]),l=w.useCallback(function(d){return i==null?void 0:i(t,d)},[i,t]),c=w.useCallback(function(d){return s==null?void 0:s(t,d)},[s,t]),h=w.useCallback(function(d){return a==null?void 0:a(t,d)},[a,t]);return u.jsx(Rt.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?h:void 0})},xNe=function(e,t,n,r,i){return ua([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)})})},_Ne=function(e,t,n){t===void 0&&(t="innerRadius");var r=Lr(),i=r.animate,s=r.config,a=uH(t,n);return{transition:Fl(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:xNe}},bNe=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,h=e.transitionMode,d=e.component,f=d===void 0?yNe:d,m=Xt(),_=ju(s,m),v=_Ne(n,h,{enter:function(x){return{opacity:0,color:x.color,borderColor:_(x)}},update:function(x){return{opacity:1,color:x.color,borderColor:_(x)}},leave:function(x){return{opacity:0,color:x.color,borderColor:_(x)}}}),y=v.transition,g=v.interpolate,p=f;return u.jsx("g",{transform:"translate("+t[0]+","+t[1]+")",children:y(function(x,b){return w.createElement(p,{key:b.id,datum:b,style:$t({},x,{borderWidth:i,path:g(x.startAngle,x.endAngle,x.innerRadius,x.outerRadius,r)}),onClick:a,onMouseEnter:o,onMouseMove:l,onMouseLeave:c})})})},wNe=function(e,t,n,r,i,s){s===void 0&&(s=!0);var a=[],o=il(li(r),n);a.push([o.x,o.y]);var l=il(li(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 h=il(li(c),n);a.push([h.x,h.y])}a=a.map(function(y){var g=y[0],p=y[1];return[e+g,t+p]}),s&&a.push([e,t]);var d=a.map(function(y){return y[0]}),f=a.map(function(y){return y[1]}),m=Math.min.apply(Math,d),_=Math.max.apply(Math,d),v=Math.min.apply(Math,f);return{points:a,x:m,y:v,width:_-m,height:Math.max.apply(Math,f)-v}},SNe=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 w.useMemo(function(){return eSe().innerRadius(function(a){return a.innerRadius}).outerRadius(function(a){return a.outerRadius}).cornerRadius(r).padAngle(s)},[r,s])};function Tl(){return Tl=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[n]=e[n]);return i}var ej,CNe=function(e){var t=e.width,n=e.height,r=e.legends,i=e.data,s=e.toggleSerie;return u.jsx(u.Fragment,{children:r.map(function(a,o){var l;return u.jsx(fz,Tl({},a,{containerWidth:t,containerHeight:n,data:(l=a.data)!=null?l:i,toggleSerie:a.toggleSerie?s:void 0}),o)})})},Oe={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 u.jsx(y$,{id:t.id,value:t.formattedValue,enableChip:!0,color:t.color})},legends:[],role:"img",pixelRatio:typeof window<"u"&&(ej=window.devicePixelRatio)!=null?ej:1},kNe=["points"],ENe=function(e){var t=e.data,n=e.id,r=n===void 0?Oe.id:n,i=e.value,s=i===void 0?Oe.value:i,a=e.valueFormat,o=e.colors,l=o===void 0?Oe.colors:o,c=sl(r),h=sl(s),d=Wy(a),f=uz(l,"id");return w.useMemo(function(){return t.map(function(m){var _,v=c(m),y=h(m),g={id:v,label:(_=m.label)!=null?_:v,hidden:!1,value:y,formattedValue:d(y),data:m};return Tl({},g,{color:f(g)})})},[t,c,h,d,f])},TNe=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,h=e.activeOuterRadiusOffset,d=e.hiddenIds,f=e.forwardLegendData,m=w.useMemo(function(){var g=sSe().value(function(p){return p.value}).startAngle(li(n)).endAngle(li(r)).padAngle(li(a));return o||g.sortValues(null),g},[n,r,a,o]),_=w.useMemo(function(){var g=t.filter(function(p){return!d.includes(p.id)});return{dataWithArc:m(g).map(function(p){var x=Math.abs(p.endAngle-p.startAngle);return Tl({},p.data,{arc:{index:p.index,startAngle:p.startAngle,endAngle:p.endAngle,innerRadius:l===p.data.id?i-c:i,outerRadius:l===p.data.id?s+h:s,thickness:s-i,padAngle:p.padAngle,angle:x,angleDeg:Vy(x)}})}),legendData:t.map(function(p){return{id:p.id,label:p.label,color:p.color,hidden:d.includes(p.id),data:p}})}},[m,t,d,l,i,c,s,h]),v=_.legendData,y=w.useRef(f);return w.useEffect(function(){typeof y.current=="function"&&y.current(v)},[y,v]),_},RNe=function(e){var t=e.activeId,n=e.onActiveIdChange,r=e.defaultActiveId,i=t!==void 0,s=w.useState(i||r===void 0?null:r),a=s[0],o=s[1];return{activeId:i?t:a,setActiveId:w.useCallback(function(l){n&&n(l),i||o(l)},[i,n,o])}},MNe=function(e){var t=e.data,n=e.width,r=e.height,i=e.innerRadius,s=i===void 0?Oe.innerRadius:i,a=e.startAngle,o=a===void 0?Oe.startAngle:a,l=e.endAngle,c=l===void 0?Oe.endAngle:l,h=e.padAngle,d=h===void 0?Oe.padAngle:h,f=e.sortByValue,m=f===void 0?Oe.sortByValue:f,_=e.cornerRadius,v=_===void 0?Oe.cornerRadius:_,y=e.fit,g=y===void 0?Oe.fit:y,p=e.activeInnerRadiusOffset,x=p===void 0?Oe.activeInnerRadiusOffset:p,b=e.activeOuterRadiusOffset,S=b===void 0?Oe.activeOuterRadiusOffset:b,C=e.activeId,E=e.onActiveIdChange,k=e.defaultActiveId,T=e.forwardLegendData,R=RNe({activeId:C,onActiveIdChange:E,defaultActiveId:k}),M=R.activeId,D=R.setActiveId,N=w.useState([]),L=N[0],P=N[1],I=w.useMemo(function(){var A,j=Math.min(n,r)/2,F=j*Math.min(s,1),H=n/2,B=r/2;if(g){var G=wNe(H,B,j,o-90,c-90),Z=G.points,X=hH(G,kNe),W=Math.min(n/X.width,r/X.height),$={width:X.width*W,height:X.height*W};$.x=(n-$.width)/2,$.y=(r-$.height)/2,H=(H-X.x)/X.width*X.width*W+$.x,B=(B-X.y)/X.height*X.height*W+$.y,A={box:X,ratio:W,points:Z},j*=W,F*=W}return{centerX:H,centerY:B,radius:j,innerRadius:F,debug:A}},[n,r,s,o,c,g]),z=TNe({data:t,startAngle:o,endAngle:c,innerRadius:I.innerRadius,outerRadius:I.radius,padAngle:d,sortByValue:m,activeId:M,activeInnerRadiusOffset:x,activeOuterRadiusOffset:S,hiddenIds:L,forwardLegendData:T}),O=w.useCallback(function(A){P(function(j){return j.indexOf(A)>-1?j.filter(function(F){return F!==A}):[].concat(j,[A])})},[]);return Tl({arcGenerator:SNe({cornerRadius:v,padAngle:li(d)}),activeId:M,setActiveId:D,toggleSerie:O},z,I)},ANe=function(e){var t=e.dataWithArc,n=e.arcGenerator,r=e.centerX,i=e.centerY,s=e.radius,a=e.innerRadius;return w.useMemo(function(){return{dataWithArc:t,arcGenerator:n,centerX:r,centerY:i,radius:s,innerRadius:a}},[t,n,r,i,s,a])},jNe=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,h=e.onMouseLeave,d=e.setActiveId,f=e.tooltip,m=e.transitionMode,_=Lk(),v=_.showTooltipFromEvent,y=_.hideTooltip,g=w.useMemo(function(){if(a)return function(S,C){o==null||o(S,C)}},[a,o]),p=w.useMemo(function(){if(a)return function(S,C){v(w.createElement(f,{datum:S}),C),d(S.id),l==null||l(S,C)}},[a,v,d,l,f]),x=w.useMemo(function(){if(a)return function(S,C){v(w.createElement(f,{datum:S}),C),c==null||c(S,C)}},[a,v,c,f]),b=w.useMemo(function(){if(a)return function(S,C){y(),d(null),h==null||h(S,C)}},[a,y,d,h]);return u.jsx(bNe,{center:t,data:n,arcGenerator:r,borderWidth:i,borderColor:s,transitionMode:m,onClick:g,onMouseEnter:p,onMouseMove:x,onMouseLeave:b})},DNe=["isInteractive","animate","motionConfig","theme","renderWrapper"],LNe=function(e){var t=e.data,n=e.id,r=n===void 0?Oe.id:n,i=e.value,s=i===void 0?Oe.value:i,a=e.valueFormat,o=e.sortByValue,l=o===void 0?Oe.sortByValue:o,c=e.layers,h=c===void 0?Oe.layers:c,d=e.startAngle,f=d===void 0?Oe.startAngle:d,m=e.endAngle,_=m===void 0?Oe.endAngle:m,v=e.padAngle,y=v===void 0?Oe.padAngle:v,g=e.fit,p=g===void 0?Oe.fit:g,x=e.innerRadius,b=x===void 0?Oe.innerRadius:x,S=e.cornerRadius,C=S===void 0?Oe.cornerRadius:S,E=e.activeInnerRadiusOffset,k=E===void 0?Oe.activeInnerRadiusOffset:E,T=e.activeOuterRadiusOffset,R=T===void 0?Oe.activeOuterRadiusOffset:T,M=e.width,D=e.height,N=e.margin,L=e.colors,P=L===void 0?Oe.colors:L,I=e.borderWidth,z=I===void 0?Oe.borderWidth:I,O=e.borderColor,A=O===void 0?Oe.borderColor:O,j=e.enableArcLabels,F=j===void 0?Oe.enableArcLabels:j,H=e.arcLabel,B=H===void 0?Oe.arcLabel:H,G=e.arcLabelsSkipAngle,Z=G===void 0?Oe.arcLabelsSkipAngle:G,X=e.arcLabelsTextColor,W=X===void 0?Oe.arcLabelsTextColor:X,$=e.arcLabelsRadiusOffset,V=$===void 0?Oe.arcLabelsRadiusOffset:$,U=e.arcLabelsComponent,Q=e.enableArcLinkLabels,q=Q===void 0?Oe.enableArcLinkLabels:Q,ie=e.arcLinkLabel,re=ie===void 0?Oe.arcLinkLabel:ie,ce=e.arcLinkLabelsSkipAngle,ye=ce===void 0?Oe.arcLinkLabelsSkipAngle:ce,le=e.arcLinkLabelsOffset,Re=le===void 0?Oe.arcLinkLabelsOffset:le,Ae=e.arcLinkLabelsDiagonalLength,_e=Ae===void 0?Oe.arcLinkLabelsDiagonalLength:Ae,Ce=e.arcLinkLabelsStraightLength,oe=Ce===void 0?Oe.arcLinkLabelsStraightLength:Ce,te=e.arcLinkLabelsThickness,se=te===void 0?Oe.arcLinkLabelsThickness:te,ue=e.arcLinkLabelsTextOffset,Y=ue===void 0?Oe.arcLinkLabelsTextOffset:ue,ne=e.arcLinkLabelsTextColor,ae=ne===void 0?Oe.arcLinkLabelsTextColor:ne,he=e.arcLinkLabelsColor,be=he===void 0?Oe.arcLinkLabelsColor:he,ve=e.arcLinkLabelComponent,xe=e.defs,Ue=xe===void 0?Oe.defs:xe,Be=e.fill,Le=Be===void 0?Oe.fill:Be,Ne=e.isInteractive,yt=Ne===void 0?Oe.isInteractive:Ne,Me=e.onClick,Fe=e.onMouseEnter,et=e.onMouseMove,un=e.onMouseLeave,st=e.tooltip,xt=st===void 0?Oe.tooltip:st,Jt=e.activeId,dn=e.onActiveIdChange,Lt=e.defaultActiveId,zt=e.transitionMode,Ht=zt===void 0?Oe.transitionMode:zt,_n=e.legends,kt=_n===void 0?Oe.legends:_n,hn=e.forwardLegendData,tt=e.role,Xe=tt===void 0?Oe.role:tt,Ve=jE(M,D,N),_t=Ve.outerWidth,on=Ve.outerHeight,an=Ve.margin,On=Ve.innerWidth,Jl=Ve.innerHeight,Ie=ENe({data:t,id:r,value:s,valueFormat:a,colors:P}),$e=MNe({data:Ie,width:On,height:Jl,fit:p,innerRadius:b,startAngle:f,endAngle:_,padAngle:y,sortByValue:l,cornerRadius:C,activeInnerRadiusOffset:k,activeOuterRadiusOffset:R,activeId:Jt,onActiveIdChange:dn,defaultActiveId:Lt,forwardLegendData:hn}),ut=$e.dataWithArc,Nt=$e.legendData,mt=$e.arcGenerator,Zt=$e.centerX,Mt=$e.centerY,en=$e.radius,Ea=$e.innerRadius,Zl=$e.setActiveId,nr=$e.toggleSerie,Cd=WF(Ue,ut,Le),Te={arcs:null,arcLinkLabels:null,arcLabels:null,legends:null};h.includes("arcs")&&(Te.arcs=u.jsx(jNe,{center:[Zt,Mt],data:ut,arcGenerator:mt,borderWidth:z,borderColor:A,isInteractive:yt,onClick:Me,onMouseEnter:Fe,onMouseMove:et,onMouseLeave:un,setActiveId:Zl,tooltip:xt,transitionMode:Ht},"arcs")),q&&h.includes("arcLinkLabels")&&(Te.arcLinkLabels=u.jsx(vNe,{center:[Zt,Mt],data:ut,label:re,skipAngle:ye,offset:Re,diagonalLength:_e,straightLength:oe,strokeWidth:se,textOffset:Y,textColor:ae,linkColor:be,component:ve},"arcLinkLabels")),F&&h.includes("arcLabels")&&(Te.arcLabels=u.jsx(cNe,{center:[Zt,Mt],data:ut,label:B,radiusOffset:V,skipAngle:Z,textColor:W,transitionMode:Ht,component:U},"arcLabels")),kt.length>0&&h.includes("legends")&&(Te.legends=u.jsx(CNe,{width:On,height:Jl,data:Nt,legends:kt,toggleSerie:nr},"legends"));var Ts=ANe({dataWithArc:ut,arcGenerator:mt,centerX:Zt,centerY:Mt,radius:en,innerRadius:Ea});return u.jsx(LE,{width:_t,height:on,margin:an,defs:Cd,role:Xe,children:h.map(function(In,PU){return Te[In]!==void 0?Te[In]:typeof In=="function"?u.jsx(w.Fragment,{children:w.createElement(In,Ts)},PU):null})})},NNe=function(e){var t=e.isInteractive,n=t===void 0?Oe.isInteractive:t,r=e.animate,i=r===void 0?Oe.animate:r,s=e.motionConfig,a=s===void 0?Oe.motionConfig:s,o=e.theme,l=e.renderWrapper,c=hH(e,DNe);return u.jsx(Uy,{animate:i,isInteractive:n,motionConfig:a,renderWrapper:l,theme:o,children:u.jsx(LNe,Tl({isInteractive:n},c))})};const PNe=1.4,hc=e=>so(e).darker(PNe).toString(),Gm="#A97CD2",Cn={player:{label:"Player",description:"Player left by quitting the game, leaving the server or other normal means.",color:"#39E673",border:hc("#39E673"),expected:!0},resource:{label:"Resource",description:"Player kicked out of the server by a resource.",color:"#406FE6",border:hc("#406FE6"),expected:!0},timeout:{label:"Timeout",description:"Player connection timed out due to networking issues or client crash.",color:"#F0E38B",border:hc("#F0E38B"),expected:!1},crash:{label:"Crash",description:"Player left due to a game crash, but was still able to inform the server the crash reason.",color:"#FF913F",border:hc("#FF913F"),expected:!1},security:{label:"Security",description:"Player kicked out of the server due to suspect behavior such as sending too many commands or losing connection to the Cfx.re backend services.",color:"#FF3E26",border:hc("#FF3E26"),expected:!1},unknown:{label:"Unknown",description:"Player left the server for an unknown reason.",color:"#F13BF7",border:hc("#F13BF7"),expected:!1}},tj=Object.keys(Cn).filter(e=>Cn[e].expected),ONe=Object.keys(Cn).filter(e=>!Cn[e].expected),nj=({centerX:e,centerY:t,dataWithArc:n,innerRadius:r,active:i})=>{if(i)return u.jsxs(u.Fragment,{children:[u.jsx("circle",{cx:e,cy:t,r:r*.95,fill:i.color}),u.jsxs("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:[i.label,":"]}),u.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-xl font-bold",opacity:.75,children:br(i.data.count)})]});{const s=w.useMemo(()=>n.reduce((a,o)=>a+o.data.count,0),[n]);return u.jsxs(u.Fragment,{children:[u.jsx("text",{x:e,y:t-15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:"Total:"}),u.jsx("text",{x:e,y:t+15,textAnchor:"middle",dominantBaseline:"central",className:"text-2xl font-bold fill-muted-foreground",children:br(s)})]})}},INe=w.memo(({data:e,activeId:t,setActiveId:n,width:r,height:i})=>{const s=Ky(),[a,o]=w.useState(!1),l=w.useCallback(c=>{if(!t)return nj(c);const h=c.dataWithArc.find(d=>d.id===t);return nj({...c,active:h})},[t]);return!r||!i?null:u.jsx(NNe,{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:"data.border"},valueFormat:".1%",enableArcLinkLabels:!1,layers:["arcs","arcLabels","arcLinkLabels",l],arcLabelsSkipAngle:20,arcLabelsTextColor:{from:"color",modifiers:[["darker",2.5]]},onClick:(c,h)=>o(d=>!d),onMouseEnter:(c,h)=>o(!1),onMouseLeave:(c,h)=>{a&&n(c.id),h.preventDefault()},colors:{datum:"data.color"},tooltip:()=>null,sortByValue:!0})});function $Ne(){const[e,t]=w.useState(null),[n,r]=w.useState({width:0,height:0}),i=ct(V0),s=AC(),a=w.useMemo(()=>{if(!(i!=null&&i.summaryLast6h)||s().isExpired)return null;if(!i.summaryLast6h.length)return"not_enough_data";const h=i.summaryLast6h.reduce((d,f)=>d+f[1],0);return i.summaryLast6h.map(([d,f])=>{var m,_,v;return{id:d,label:((m=Cn[d])==null?void 0:m.label)??d,count:f,value:f/h,color:((_=Cn[d])==null?void 0:_.color)??Gm,border:((v=Cn[d])==null?void 0:v.border)??Gm}})},[i==null?void 0:i.summaryLast6h]),o=w.useMemo(()=>!(i!=null&&i.summaryLast6h)||s().isExpired||!i.summaryLast6h.length?null:i.summaryLast6h.map(([h,d])=>{var f,m,_;return{id:h,label:((f=Cn[h])==null?void 0:f.label)??h,color:((m=Cn[h])==null?void 0:m.color)??Gm,border:((_=Cn[h])==null?void 0:_.border)??Gm}}),[i==null?void 0:i.summaryLast6h]);let l=null;return typeof a=="object"&&a!==null?l=u.jsx(INe,{data:a,activeId:e,setActiveId:t,width:n.width,height:n.height}):typeof a=="string"?l=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-muted-foreground text-center",children:u.jsx("p",{className:"max-w-80",children:"No players have disconnected from the server in the last 6 hours."})}):l=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:u.jsx(sn,{className:"animate-spin size-16 text-muted-foreground"})}),u.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:[u.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Player drop cause (last 6h)"}),u.jsx("div",{className:"hidden sm:block",children:u.jsx(fv,{})})]}),u.jsx(Xf,{onDebouncedResize:r,children:l}),o&&u.jsx("div",{className:"px-4 mx-auto flex flex-wrap justify-center gap-2",children:o.map(c=>u.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:[u.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:c.color,borderColor:c.border}}),u.jsx("span",{className:"text-sm",children:c.label})]},c.id))})]})}const Km=(e,t)=>`translate(${e}, ${t})`;function BNe({svgRef:e,canvasRef:t,setRenderError:n,size:{width:r,height:i},margins:s,isDarkMode:a,bucketLabels:o,dataStart:l,dataEnd:c,lifespans:h,cursorSetter:d}){lr(e).selectAll("*").remove();const f=lr(e);if(f.empty())throw new Error("SVG selection failed.");const m=lr(t);if(m.empty())throw new Error("Canvas selection failed.");if(!(t!=null&&t.getContext))throw new Error("Canvas not supported.");let _=!0;console.log("From:",l.toISOString()),console.log("To:",c.toISOString()),console.log("Window:",q5(c.getTime()-l.getTime())),console.log("Number of lifespans:",h.length);const v=i-s.top-s.bottom,y=r-s.left-s.right;f.append("clipPath").attr("id","fullPerfChartClipPath").append("rect").attr("x",0).attr("y",s.top).attr("width",y).attr("height",i);const g=f.append("g").attr("clip-path","url(#fullPerfChartClipPath)").attr("transform",Km(s.left,0)),p=gE().domain([l,c]).range([0,y]),x=ay().domain(o).range([i-s.bottom,0]),b=IB(a?XB:YB).domain([0,1]),S=Co(h,se=>Co(se.log,ue=>ue.players)),C=Co(h,se=>Co(se.log,ue=>ue.fxsMemory)),E=Co(h,se=>Co(se.log,ue=>ue.nodeMemory)),k=Math.ceil((S+1)/5)*5,T=[i-s.bottom,s.top],R=Uo([0,k],T);Uo([0,C],T),Uo([0,E],T);const M=Uo([382,1350],[7,16]),D=Bz(p).ticks(M(r)),N=f.append("g").attr("transform",Km(s.left,i-s.bottom)).attr("class","time-axis").call(D),L=U8e(x);f.append("g").attr("class","buckets-axis").attr("transform",Km(r-s.right+s.axis,s.top)).call(L);const P=S<=7?Zk(S+1):null,I=Fz(R).tickFormat(se=>se.toString()).tickValues(P);f.append("g").attr("class","players-axis").attr("transform",Km(s.left-s.axis,0)).call(I);let z=[];const O=o.map(se=>Math.floor(x(se))),A=Math.ceil(x.bandwidth()),j=so(b(0)).darker(1.15).formatHsl(),F=()=>{const se=m.node();if(!se)return n("Canvas node not found.");const ue=se.getContext("2d");if(!ue)return n("Canvas 2d context not found.");_&&console.time("drawing canvas heatmap"),ue.clearRect(0,0,y,v),ue.fillStyle=a?"#281C2B":"#E4D4FA",ue.fillRect(0,0,y,v),z=[];let Y=0,ne=0;for(const ae of h){const{bootTime:he,closeTime:be,log:ve}=ae,xe=p(he||ve[0].start),Ue=p(be||ve.at(-1).end),Be=Ue-xe;if(!(Ue<0||xe>y)&&!(Be<5)){Y++;for(const Le of ae.log){const Ne=Math.floor(p(Le.start)),Me=Math.floor(p(Le.end))-Ne;if(Me){z.push(Le);for(let Fe=0;Fe.001?b(et):j,ue.fillRect(Ne,O[Fe],Me,A),ne++}}}}}_&&(console.log("Canvas heatmap finished drawing:",{lifespanCount:Y,snapCount:z.length,rectCount:ne}),console.timeEnd("drawing canvas heatmap"))};F();const H=se=>{const ue=se.bootTime?p(se.bootTime):p(se.log[0].start),Y=se.closeTime?p(se.closeTime):p(se.log.at(-1).end),ne=Y-ue;return ne<5||Y<0+s.left||ue>y+s.left?[]:[{...se,lifespanStartX:ue,lifespanEndX:Y,lifespanWidth:ne}]},B=se=>{const ue=iF(Y=>p(Y.end),Y=>R(Y.players));se.selectAll("path.players-line-bg").data(H).join("path").attr("class","players-line-bg").each((Y,ne,ae)=>{lr(ae[ne]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","black").attr("stroke-width",6).attr("d",ue(Y.log))}),se.selectAll("path.players-line").data(H).join("path").attr("class","players-line").each((Y,ne,ae)=>{lr(ae[ne]).attr("fill","none").attr("stroke-linejoin","round").attr("stroke-linecap","round").attr("stroke","rgb(204, 203, 203)").attr("stroke-width",2).attr("d",ue(Y.log))})};g.selectAll("g.lifespan").data(h).join("g").attr("class","lifespan").call(B);const G=g.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),Z=g.append("line").attr("class","cursorLineHorz").attr("stroke","rgba(216, 245, 19, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3 3"),X=g.append("circle").attr("class","cursorDot").attr("fill","red").attr("r",4),W=g.append("rect").attr("class","cursorTextBg").attr("fill","black").attr("rx",5).attr("ry",5).attr("stroke","rgba(216, 245, 19, 0.35)").attr("stroke-width",1),$=g.append("text").attr("class","cursorText font-mono").attr("fill","rgba(216, 245, 19)").attr("font-size",16),V=$.node(),U=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),X.attr("cx",-99).attr("cy",-99),Z.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),$.attr("x",-99).attr("y",-99),W.attr("x",-99).attr("y",-99),d(void 0)};U();const Q=20*60*1e3,q=$p(se=>se.end).center,ie=se=>{if(!z.length)return;const ue=p.invert(se),Y=q(z,ue);if(Y===-1)return;const ne=z[Y];if(Math.abs(ne.end.getTime()-ue.getTime()){const Y=ie(se);if(!Y)return re=null,U();const{snapIndex:ne,snapData:ae}=Y;if(ne===re)return;re=ne,d(ae);const he={x:Math.round(p(ae.end))+.5,y:Math.round(R(ae.players))+.5,val:ae.players};G.attr("x1",he.x).attr("y1",0).attr("x2",he.x).attr("y2",v),Z.attr("x1",0).attr("y1",he.y).attr("x2",y).attr("y2",he.y),X.attr("cx",he.x).attr("cy",he.y);const be=he.val.toString(),ve=he.x<50,xe=he.y<50;if($.text(be).attr("x",ve?he.x+20:he.x-15).attr("y",xe?he.y+15:he.y-15).attr("text-anchor",ve?"start":"end").attr("dominant-baseline",xe?"hanging":"baseline"),!V)return;const Ue=V.getBBox(),Be=6,Le=2;W.attr("x",Math.round(Ue.x)-Be-.5).attr("y",Math.round(Ue.y)-Le-.5).attr("width",Math.round(Ue.width)+Be*2).attr("height",Math.round(Ue.height)+Le*2)};let ye=!1,le;const Re=20;g.append("rect").attr("x",0).attr("y",0).attr("width",y).attr("height",v).attr("fill","transparent").on("mousemove",function(se){const[ue,Y]=Ci(se);ye?(clearTimeout(le),le=setTimeout(()=>{ce(ue)},Re)):(ye=!0,ce(ue),setTimeout(()=>{ye=!1},Re))}),f.on("mouseleave",function(){setTimeout(()=>{U()},150)});let Ae=!1;const Ce=Jn(20,({transform:se})=>{if(se.k===1&&se.x===0){if(!Ae)return;Ae=!1}else Ae=!0;p.range([parseFloat(se.applyX(0).toFixed(6)),parseFloat(se.applyX(y).toFixed(6))]),D.scale(se.rescaleX(p).range([0,y])),N.call(D),g.selectAll("g.lifespan").call(B),U(),F()},{noLeading:!1,noTrailing:!1}),oe=[[0,s.top],[y,i-s.top]],te=qLe().scaleExtent([1,12]).translateExtent(oe).extent(oe).on("zoom",Ce);f.call(te),_=!1}const FNe=w.memo(({threadName:e,apiData:t,apiDataAge:n,width:r,height:i,isDarkMode:s})=>{const a=it(RC),o=w.useRef(null),l=w.useRef(null),[c,h]=w.useState(""),[d,f]=w.useState(0),m=fX(),_={top:8,right:50,bottom:30,left:40,axis:1},v=w.useMemo(()=>{if(!t)return null;const y=XLe(t.threadPerfLog,g=>{const p=aH(t.boundaries);return lH(g.buckets,p)});return y?{...y,bucketLabels:t.boundaries.map(Lg),cursorSetter:g=>{if(!g)return m(void 0);m({threadName:e,snap:g})}}:null},[t,n,e,s,c]);return w.useEffect(()=>{if(!v)a(void 0);else{const y=QLe(v.lifespans,24,n);a(y)}},[v,n]),w.useEffect(()=>{if(!(!v||!o.current||!l.current||!r||!i)&&v.lifespans.length)try{console.groupCollapsed("Drawing full performance chart:"),console.time("drawFullPerfChart"),BNe({svgRef:o.current,canvasRef:l.current,setRenderError:h,size:{width:r,height:i},margins:_,isDarkMode:s,...v}),f(0),h(""),console.timeEnd("drawFullPerfChart")}catch(y){h(y.message??"Unknown error.")}finally{console.groupEnd()}},[v,r,i,o,l,c]),!r||!i?null:c?u.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: ",c,u.jsx("br",{}),u.jsxs(De,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(y=>y+1),h("")},children:["Retry",d?` (${d})`:""]})]}):u.jsxs(u.Fragment,{children:[u.jsx("svg",{ref:o,width:r,height:i,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),u.jsx("canvas",{ref:l,width:r-_.left-_.right,height:i-_.top-_.bottom,style:{zIndex:0,position:"absolute",top:`${_.top}px`,left:`${_.left}px`}})]})});function zNe({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:u.jsxs("p",{className:"text-center",children:[u.jsx("strong",{children:"There is not enough data to display the chart just yet."}),u.jsx("br",{}),u.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"?u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-2xl text-muted-foreground",children:t[e]??"Unknown BackendApiError"}):u.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 HNe(){const[e,t]=w.useState({width:0,height:0}),[n,r]=w.useState("svMain"),[i,s]=w.useState(""),[a,o]=w.useState(0),l=Ky(),c=Tt({method:"GET",path:"/perfChartData/:thread/"}),h=fp(`/perfChartData/${n}`,async()=>{s("");const f=await c({pathParams:{thread:n}});if(!f)throw new Error("empty_response");return"fail_reason"in f?(s(f.fail_reason),null):(o(Date.now()),f)},{revalidateOnMount:!0,revalidateOnFocus:!1,refreshInterval:60*1e3});let d=null;return h.data?d=u.jsx(FNe,{threadName:n,apiData:h.data,apiDataAge:a,width:e.width,height:e.height,isDarkMode:l}):h.isLoading?d=u.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:u.jsx(sn,{className:"animate-spin size-16 text-muted-foreground"})}):(i||h.error)&&(d=u.jsx(zNe,{error:i||h.error})),u.jsxs("div",{className:"w-full h-[28rem] pt-2 md:rounded-xl border bg-card shadow-sm flex flex-col fill-primary",children:[u.jsxs("div",{className:"px-4 flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsx("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:"Server performance"}),u.jsxs("div",{className:"flex gap-4",children:[u.jsxs(Hn,{defaultValue:n,onValueChange:r,children:[u.jsx(Dn,{className:"w-32 grow md:grow-0 h-6 px-3 py-1 text-sm",children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:"svMain",className:"cursor-pointer",children:"svMain"}),u.jsx(Se,{value:"svSync",className:"cursor-pointer",children:"svSync"}),u.jsx(Se,{value:"svNetwork",className:"cursor-pointer",children:"svNetwork"})]})]}),u.jsx("div",{className:"hidden xs:block",children:u.jsx(AX,{})})]})]}),u.jsx(Xf,{onDebouncedResize:t,children:d})]})}const WNe=w.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 u.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-1 gap-4 h-full pb-2 text-muted-foreground",children:[u.jsxs("div",{className:"flex items-center",children:[u.jsx(ML,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:i}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"Uptime 24h"})]})]}),u.jsxs("div",{className:"flex items-center",children:[u.jsx(CQ,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:s}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"Median Players 24h"})]})]}),u.jsxs("div",{className:"flex items-center",children:[u.jsx(nT,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:"text-center sm:text-right text-xl text-primary",children:a}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"FXServer Memory"})]})]}),u.jsxs("div",{className:J("flex items-center",o??"text-muted-foreground"),title:r?`${r.used.toFixed(2)}MB / ${r.limit}MB`:"",children:[u.jsx(nT,{className:"hidden sm:block sm:size-6 md:size-12 mr-2 opacity-75"}),u.jsxs("div",{className:"flex flex-col mr-auto ml-auto sm:mr-0 sm:ml-auto",children:[u.jsx("span",{className:J("text-center sm:text-right text-xl",o??"text-primary"),children:l}),u.jsx("span",{className:"text-center sm:text-right text-sm",children:"Node.js Memory"})]})]})]})});function UNe(){const e=ct(RC),t=ct(q0),n=ct(G0),r=AC(),i=w.useMemo(()=>{const o=r();if(!t||o.isExpired)return null;if(n&&n.snap){const l=bu(n.snap.end,"2-digit","2-digit"),c=wu(n.snap.end,"short"),h=wf(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:u.jsxs(u.Fragment,{children:["(",u.jsx("span",{className:"text-xs text-warning-inline font-mono",children:h}),")"]})}}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=u.jsx(WNe,{fxsMemory:i.fxsMemory,medianPlayerCount:e==null?void 0:e.medianPlayerCount,uptimePct:e==null?void 0:e.uptimePct,nodeMemory:i.nodeMemory})):a=u.jsx("div",{className:"size-full flex flex-col items-center justify-center",children:u.jsx(sn,{className:"animate-spin size-16 text-muted-foreground"})}),u.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:[u.jsxs("div",{className:"flex flex-row items-center justify-between space-y-0 pb-2 text-muted-foreground",children:[u.jsxs("h3",{className:"tracking-tight text-sm font-medium line-clamp-1",children:["Server stats ",s]}),u.jsx("div",{className:"hidden xs:block",children:u.jsx(KX,{})})]}),a]})}function Up({children:e}){return u.jsx("div",{className:"flex items-center justify-center min-h-[16.5rem] text-xl p1 text-muted-foreground",children:e})}function Vp({msg:e}){return u.jsxs("div",{className:"flex items-center gap-1 text-xl leading-relaxed text-muted-foreground",children:[u.jsx(sn,{className:"inline animate-spin h-5"})," ",e]})}function VNe(){const e=w.useRef(null),t=hX();return w.useEffect(()=>(e.current=xC(["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()}),[]),u.jsxs("div",{className:"w-full min-w-96 flex flex-col gap-4",children:[u.jsxs("div",{className:"w-full grid grid-cols-3 2xl:grid-cols-8 gap-4",children:[u.jsx($Ne,{}),u.jsx(UNe,{}),u.jsx(tNe,{})]}),u.jsx(HNe,{})]})}function qNe(){const e=ct(EC),t=va()[1];return e===Ys.Setup?(t("/server/setup"),null):e===Ys.Deployer?(t("/server/deployer"),null):e!==Ys.Ready?u.jsx("div",{className:"size-full",children:u.jsx(Up,{children:u.jsx(Vp,{msg:`Unknown Config State: ${String(e)}`})})}):u.jsx(VNe,{})}function Kh({isError:e}){return e?u.jsxs("div",{className:"h-full min-h-28 flex flex-col items-center justify-center gap-2 text-destructive-inline",children:[u.jsx(CL,{className:"size-16 opacity-75"}),u.jsx("span",{children:"Error loading data."})]}):u.jsx("div",{className:"h-full min-h-28 flex items-center justify-center text-muted-foreground",children:u.jsx(sn,{className:"animate-spin size-16 opacity-75"})})}function qp({message:e}){return u.jsx("div",{className:"h-full min-h-28 px-4 py-6 flex items-center justify-center text-xl tracking-wider text-muted-foreground/75",children:e})}const rj=e=>{const t=e.indexOf("/");if(t===-1)return{name:e};const n=e.substring(t+1);return{name:e.substring(0,t),version:n||void 0}},GNe=(e,t)=>{const n=e.map(rj),r=t.map(rj),i=new Set(n.map(c=>c.name)),s=new Set(r.map(c=>c.name)),a=n.filter(c=>!s.has(c.name)).map(c=>c!=null&&c.version?`${c.name}/${c.version}`:c.name),o=r.filter(c=>!i.has(c.name)).map(c=>c!=null&&c.version?`${c.name}/${c.version}`:c.name),l=n.filter(c=>s.has(c.name)).map(c=>{const h=r.find(d=>d.name===c.name);return{resName:c.name,oldVer:c.version??"???",newVer:(h==null?void 0:h.version)??"???"}});return{removed:a,added:o,updated:l}},ij=e=>e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122,KNe=(e,t)=>{let n=0;for(;n0&&(ij(t.charCodeAt(n))||!ij(t.charCodeAt(n-1)));)n--;return n<=1?!1:t.slice(0,n)},YNe=e=>e.map((t,n)=>{const r=n===0?!1:KNe(e[n-1],t);return{prefix:r,suffix:r?t.slice(r.length):t}}),XNe=(e,t,n)=>{if(e.length<=t)return{filteredIn:e,filteredOut:!1};const r=e.map(([o,l])=>l).sort((o,l)=>l-o)[t-1];let i=0,s=0;const a=[];for(let o=0;o=r:o{t?e.sort((d,f)=>d[0].localeCompare(f[0])):e.sort((d,f)=>f[1]-d[1]);const s=e.reduce((d,[,f])=>d+f,0),{filteredIn:a,filteredOut:o}=n?XNe(e,n,t):{filteredIn:e,filteredOut:!1},l=YNe(a.map(([d,f])=>d)),c=[];let h=0;for(let d=0;du.jsx(QNe,{datum:s,isOdd:a%2===0,isLast:!i.filteredOut&&a===i.display.length-1},s.key)),i.filteredOut?u.jsx("tr",{children:u.jsxs("td",{colSpan:3,className:J("text-center px-4 py-2 text-muted-foreground",i.display.length%2===0&&"bg-secondary/15","hover:bg-secondary/35"),children:["Showing the top ",i.display.length," out of ",br(e.length)," reasons which account for ",i.displayPct," of all crashes. ",u.jsx("br",{}),"The remaining ",br(i.filteredOut.types)," reasons account for ",i.filteredOut.countPct," of all crashes. "," ",u.jsx("button",{className:"text-accent hover:underline",onClick:()=>r(0),children:"Show All!"})]})}):null]})]})}function XE({children:e}){return u.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-destructive-inline/60 dark:bg-destructive-inline/90",children:e})}function QE({children:e}){return u.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-success-inline/60 dark:bg-success-inline/90",children:e})}function ZNe({children:e}){return u.jsx("span",{className:"font-mono px-1 text-sm text-primary dark:text-background bg-warning/60 dark:bg-warning/90",children:e})}function ePe({change:e}){return u.jsxs(u.Fragment,{children:["Switched from ",u.jsx(XE,{children:e.oldVersion})," to ",u.jsx(QE,{children:e.newVersion})]})}function tPe({change:e}){return u.jsxs(u.Fragment,{children:["Switched from ",u.jsx(XE,{children:e.oldVersion})," to ",u.jsx(QE,{children:e.newVersion})]})}function nPe({change:e}){const t=w.useMemo(()=>GNe(e.resRemoved,e.resAdded),[e.resRemoved,e.resAdded]);let n=null;t.removed.length&&(n=u.jsxs("p",{children:["Removed: ",t.removed.map((s,a,o)=>u.jsxs(w.Fragment,{children:[u.jsx(XE,{children:s}),au.jsxs(w.Fragment,{children:[u.jsx(QE,{children:s}),au.jsxs(w.Fragment,{children:[u.jsxs(ZNe,{children:[s.resName," ",s.oldVer," -> ",s.newVer]}),ae.sort((r,i)=>r.ts-i.ts),[e]);return e.length?u.jsx("div",{className:"md:grid md:grid-cols-[auto_minmax(0,1fr)] gap-4 md:px-4 pt-2 ",children:n.map((r,i)=>u.jsxs(w.Fragment,{children:[u.jsx("div",{className:"hidden mx-auto md:flex items-center gap-4 divide-y",children:u.jsxs("div",{className:"flex flex-col items-center justify-center px-2 py-1 rounded-lg text-xs font-medium bg-muted",children:[u.jsx("span",{children:GO(r.ts,"medium")}),u.jsx("span",{children:Jle(r.ts)})]})}),u.jsxs("div",{className:J("flex-1 col-span-2 md:col-span-1 px-2 md:px-0 py-2 md:py-0",i%2===0&&"bg-secondary/25 md:bg-transparent"),children:[u.jsxs("div",{className:"flex flex-wrap-reverse justify-between",children:[u.jsx("h3",{className:"flex-grow inline text-lg font-semibold",children:r.type in t?t[r.type]:r.type}),u.jsx("div",{className:"md:hidden mx-auto",children:u.jsx("span",{className:"border-muted-foreground border rounded px-2 py-0.5 font-normal text-xs text-muted-foreground",children:zs(r.ts,"medium","short")})})]}),u.jsxs("div",{className:"text-gray-500 dark:text-gray-400",children:[r.type==="fxsChanged"&&u.jsx(ePe,{change:r}),r.type==="gameChanged"&&u.jsx(tPe,{change:r}),r.type==="resourcesChanged"&&u.jsx(nPe,{change:r})]})]})]},i))}):u.jsx(qp,{message:"No environmental changes within this time window."})}var[tx,Z9e]=Un("Tooltip",[nd]),nx=nd(),fH="TooltipProvider",iPe=700,oS="tooltip.open",[sPe,JE]=tx(fH),pH=e=>{const{__scopeTooltip:t,delayDuration:n=iPe,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:s}=e,[a,o]=w.useState(!0),l=w.useRef(!1),c=w.useRef(0);return w.useEffect(()=>{const h=c.current;return()=>window.clearTimeout(h)},[]),u.jsx(sPe,{scope:t,isOpenDelayed:a,delayDuration:n,onOpen:w.useCallback(()=>{window.clearTimeout(c.current),o(!1)},[]),onClose:w.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:w.useCallback(h=>{l.current=h},[]),disableHoverableContent:i,children:s})};pH.displayName=fH;var rx="Tooltip",[oPe,ix]=tx(rx),mH=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:s,disableHoverableContent:a,delayDuration:o}=e,l=JE(rx,e.__scopeTooltip),c=nx(t),[h,d]=w.useState(null),f=zr(),m=w.useRef(0),_=a??l.disableHoverableContent,v=o??l.delayDuration,y=w.useRef(!1),[g=!1,p]=fi({prop:r,defaultProp:i,onChange:E=>{E?(l.onOpen(),document.dispatchEvent(new CustomEvent(oS))):l.onClose(),s==null||s(E)}}),x=w.useMemo(()=>g?y.current?"delayed-open":"instant-open":"closed",[g]),b=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,p(!0)},[p]),S=w.useCallback(()=>{window.clearTimeout(m.current),m.current=0,p(!1)},[p]),C=w.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,p(!0),m.current=0},v)},[v,p]);return w.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),u.jsx(M5,{...c,children:u.jsx(oPe,{scope:t,contentId:f,open:g,stateAttribute:x,trigger:h,onTriggerChange:d,onTriggerEnter:w.useCallback(()=>{l.isOpenDelayed?C():b()},[l.isOpenDelayed,C,b]),onTriggerLeave:w.useCallback(()=>{_?S():(window.clearTimeout(m.current),m.current=0)},[S,_]),onOpen:b,onClose:S,disableHoverableContent:_,children:n})})};mH.displayName=rx;var aS="TooltipTrigger",gH=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=ix(aS,n),s=JE(aS,n),a=nx(n),o=w.useRef(null),l=We(t,o,i.onTriggerChange),c=w.useRef(!1),h=w.useRef(!1),d=w.useCallback(()=>c.current=!1,[]);return w.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),u.jsx(A5,{asChild:!0,...a,children:u.jsx(Ee.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:l,onPointerMove:fe(e.onPointerMove,f=>{f.pointerType!=="touch"&&!h.current&&!s.isPointerInTransitRef.current&&(i.onTriggerEnter(),h.current=!0)}),onPointerLeave:fe(e.onPointerLeave,()=>{i.onTriggerLeave(),h.current=!1}),onPointerDown:fe(e.onPointerDown,()=>{c.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:fe(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:fe(e.onBlur,i.onClose),onClick:fe(e.onClick,i.onClose)})})});gH.displayName=aS;var aPe="TooltipPortal",[e$e,lPe]=tx(aPe,{forceMount:void 0}),Ou="TooltipContent",vH=w.forwardRef((e,t)=>{const n=lPe(Ou,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...s}=e,a=ix(Ou,e.__scopeTooltip);return u.jsx(xn,{present:r||a.open,children:a.disableHoverableContent?u.jsx(yH,{side:i,...s,ref:t}):u.jsx(cPe,{side:i,...s,ref:t})})}),cPe=w.forwardRef((e,t)=>{const n=ix(Ou,e.__scopeTooltip),r=JE(Ou,e.__scopeTooltip),i=w.useRef(null),s=We(t,i),[a,o]=w.useState(null),{trigger:l,onClose:c}=n,h=i.current,{onPointerInTransitChange:d}=r,f=w.useCallback(()=>{o(null),d(!1)},[d]),m=w.useCallback((_,v)=>{const y=_.currentTarget,g={x:_.clientX,y:_.clientY},p=fPe(g,y.getBoundingClientRect()),x=pPe(g,p),b=mPe(v.getBoundingClientRect()),S=vPe([...x,...b]);o(S),d(!0)},[d]);return w.useEffect(()=>()=>f(),[f]),w.useEffect(()=>{if(l&&h){const _=y=>m(y,h),v=y=>m(y,l);return l.addEventListener("pointerleave",_),h.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",_),h.removeEventListener("pointerleave",v)}}},[l,h,m,f]),w.useEffect(()=>{if(a){const _=v=>{const y=v.target,g={x:v.clientX,y:v.clientY},p=(l==null?void 0:l.contains(y))||(h==null?void 0:h.contains(y)),x=!gPe(g,a);p?f():x&&(f(),c())};return document.addEventListener("pointermove",_),()=>document.removeEventListener("pointermove",_)}},[l,h,a,c,f]),u.jsx(yH,{...e,ref:s})}),[uPe,dPe]=tx(rx,{isInside:!1}),yH=w.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:s,onPointerDownOutside:a,...o}=e,l=ix(Ou,n),c=nx(n),{onClose:h}=l;return w.useEffect(()=>(document.addEventListener(oS,h),()=>document.removeEventListener(oS,h)),[h]),w.useEffect(()=>{if(l.trigger){const d=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&h()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[l.trigger,h]),u.jsx(Zu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:a,onFocusOutside:d=>d.preventDefault(),onDismiss:h,children:u.jsxs(j5,{"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)"},children:[u.jsx(bC,{children:r}),u.jsx(uPe,{scope:n,isInside:!0,children:u.jsx(XO,{id:l.contentId,role:"tooltip",children:i||r})})]})})});vH.displayName=Ou;var xH="TooltipArrow",hPe=w.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,i=nx(n);return dPe(xH,n).isInside?null:u.jsx(D5,{...i,...r,ref:t})});hPe.displayName=xH;function fPe(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 pPe(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 mPe(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 gPe(e,t){const{x:n,y:r}=e;let i=!1;for(let s=0,a=t.length-1;sr!=h>r&&n<(c-o)*(r-l)/(h-l)+o&&(i=!i)}return i}function vPe(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),yPe(t)}function yPe(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=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)}var xPe=pH,_Pe=mH,bPe=gH,_H=vH;const bH=xPe,qs=_Pe,Gs=bPe,os=w.forwardRef(({className:e,sideOffset:t=4,...n},r)=>u.jsx(_H,{ref:r,sideOffset:t,className:J("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}));os.displayName=_H.displayName;function wPe({dropTypes:e}){let{totalDrops:t,categories:n}=w.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,s in Cn&&(i[s]={label:Cn[s].label,tooltip:Cn[s].description,color:Cn[s].color,count:a});return{totalDrops:r,categories:Object.entries(i)}},[e]);return n.length?u.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>u.jsxs(qs,{children:[u.jsx(Gs,{asChild:!0,children:u.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[u.jsx("span",{className:"text-xl tracking-wider border-b-2 font-semibold",style:{borderColor:i.color},children:i.label}),u.jsxs("span",{children:[br(i.count)," ",u.jsxs("small",{className:"opacity-75",children:["(",br(i.count/t*100,1),"%)"]})]})]},r)}),u.jsx(os,{className:"max-w-96 text-center",children:u.jsx("p",{children:i.tooltip})})]}))}):u.jsx(qp,{message:"No player drops within this time window."})}function SPe({resKicks:e}){let{totalKicks:t,resources:n}=w.useMemo(()=>{let r=0;const i={};for(const[s,a]of e)r+=a,i[s]={label:s,count:a};return{totalKicks:r,resources:Object.entries(i)}},[e]);return n.length?u.jsx("div",{className:"px-4 py-4 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:n.map(([r,i])=>u.jsxs("div",{className:"px-4 flex flex-col gap-1 items-center justify-center",children:[u.jsx("span",{className:"text-lg tracking-wider border-b-2",children:i.label}),u.jsxs("span",{className:"text-sm",children:[br(i.count)," ",u.jsxs("small",{className:"opacity-75",children:["(",br(i.count/t*100,1),"%)"]})]})]},r))}):u.jsx(qp,{message:"No players kicked by resources within this time window."})}function CPe({isError:e}){return u.jsxs("div",{className:"space-y-1",children:[u.jsx("div",{className:"text-center space-x-2 text-sm text-muted-foreground",children:u.jsx("span",{children:"Loading..."})}),u.jsxs("div",{className:"pb-2 md:rounded-xl border bg-cardx shadow-sm flex flex-col",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b md:rounded-t-[inherit] bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(wL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Overview"})]})}),u.jsx("div",{className:"px-4 py-2 flex flex-wrap justify-evenly gap-4 text-muted-foreground",children:u.jsx(Kh,{isError:e})}),u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(RL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]})}),u.jsx("div",{className:"px-4 pt-2 pb-4",children:u.jsx(Kh,{isError:e})}),u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(kL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),u.jsx("div",{className:"px-4 pt-2 pb-4 space-y-4",children:u.jsx(Kh,{isError:e})})]})]})}const kPe=function({windowStart:t,windowEnd:n,windowData:r,rangeSelected:i,displayLod:s}){const[a,o]=w.useState(50),[l,c]=w.useState(!1),h=new Date(t),d=new Date(n),f=!wf(h)||!wf(h),m=bu(h,"2-digit","2-digit"),_=wu(h,"short"),v=f?`${m} - ${_}`:m,y=bu(d,"2-digit","2-digit"),g=wu(d,"short"),p=f?`${y} - ${g}`:y;return u.jsxs("div",{className:"space-y-1",children:[u.jsx("div",{className:J("text-center space-x-2 text-sm text-muted-foreground",i&&"font-semibold text-primary"),children:u.jsxs("span",{children:["Period from ",u.jsx(Ye,{title:h.toISOString(),children:v})," to ",u.jsx(Ye,{title:d.toISOString(),children:p}),"."]})}),u.jsxs("div",{className:"md:rounded-xl border shadow-sm flex flex-col",children:[u.jsxs("div",{className:"rounded-t-[inherit]",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-b rounded-t-[inherit] bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(wL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Period Overview"})]})}),u.jsx(wPe,{dropTypes:r.dropTypes})]}),u.jsxs("div",{className:"pb-4",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(yL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Resource Kicks"})]})}),u.jsx(SPe,{resKicks:r.resKicks})]}),u.jsxs("div",{className:"pb-4",children:[u.jsx("div",{className:"flex flex-col flex-shrink px-1 sm:px-4 py-2 space-y-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(kL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Environment Changes"})]})}),u.jsx(rPe,{changes:r.changes})]}),u.jsxs("div",{className:"",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between flex-shrink px-1 sm:px-4 border-t border-b bg-secondary/35",children:[u.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(RL,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Crash Reasons"})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs(Hn,{value:a.toString(),onValueChange:x=>o(parseInt(x)),children:[u.jsx(Dn,{className:"w-32 h-6 px-3 py-1 text-sm",children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:"50",className:"cursor-pointer",children:"Top ~50"}),u.jsx(Se,{value:"100",className:"cursor-pointer",children:"Top ~100"}),u.jsx(Se,{value:"0",className:"cursor-pointer",children:"Show All"})]})]}),u.jsxs(Hn,{value:l.toString(),onValueChange:x=>c(x==="true"),children:[u.jsx(Dn,{className:"w-36 h-6 px-3 py-1 text-sm",children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:"false",className:"cursor-pointer",children:"Sort by Count"}),u.jsx(Se,{value:"true",className:"cursor-pointer",children:"Group Reasons"})]})]})]})]}),u.jsx(JNe,{crashTypes:r.crashTypes,crashesGroupReasons:l,crashesTargetLimit:a,setCrashesTargetLimit:o})]})]})]})},EPe=w.memo(kPe),Z_=(e,t)=>`translate(${e}, ${t})`;function TPe({legendRef:e,svgRef:t,canvasRef:n,setRenderError:r,size:{width:i,height:s},rangeSelected:a,rangeSetter:o,margins:l,isDarkMode:c,chartName:h,data:d}){lr(t).selectAll("*").remove();const f=lr(t);if(f.empty())throw new Error("SVG selection failed.");const m=lr(n);if(m.empty())throw new Error("Canvas selection failed.");if(!(n!=null&&n.getContext))throw new Error("Canvas not supported.");let _=!0;console.log("From:",d.startDate.toISOString()),console.log("To:",d.endDate.toISOString()),console.log("Window:",q5(d.startDate.getTime()-d.endDate.getTime())),console.log("Number of intervals:",d.log.length);const v=s-l.top-l.bottom,y=i-l.left-l.right;console.log("Drawable area:",y,v);const g=f.append("g").attr("transform",Z_(l.left,l.top)),p=gE([d.startDate,d.endDate],[0,y]),x=d.maxDrops<10?d.maxDrops+1:d.maxDrops,b=Uo([0,x],[s-l.bottom,l.top]),S=Uo([382,1350],[7,16]),C=Bz(p).ticks(S(i));g.append("g").attr("transform",Z_(0,v)).attr("class","time-axis").call(C);const E=x<=7?Zk(x+1):null,k=Fz(b).ticks(s>200?6:4).tickFormat(oe=>br(oe)).tickValues(E),T=f.append("g").attr("class","counts-axis").attr("transform",Z_(l.left-l.axis,0)).call(k),R=d.displayLod==="day"?24:1,M=new Date(d.startDate.getTime()+R*60*60*1e3),D=p(M)-p(d.startDate),N=Math.floor(D/2),L=d.displayLod==="day"?12:0,P=c?"rgba(255, 255, 255, 0.15)":"rgba(0, 0, 0, 0.35)",I=c?"#00000035":"#00000007",z=c?"#FFFFFFE0":"#000000D0",O=oe=>b(oe)-l.top;(()=>{var se,ue;const oe=m.node();if(!oe)return r("Canvas node not found.");const te=oe.getContext("2d");if(!te)return r("Canvas 2d context not found.");if(!D)return r("Cannot render with zero interval width.");_&&console.time("drawing canvas timeline"),te.clearRect(0,0,y,v),te.fillStyle=I,te.fillRect(0,0,y,v),te.strokeStyle=P,te.setLineDash([2,2]);try{const Y=T.selectAll("g.tick").nodes();for(const ne of Y){const ae=ne==null?void 0:ne.getAttribute("transform");if(!ae)continue;const he=Math.round(+ae.split(",")[1].replace(")","")-l.top)+.5;te.beginPath(),te.moveTo(0,he),te.lineTo(y,he),te.stroke()}}catch(Y){console.error("Error drawing horizontal ticks:",Y)}te.setLineDash([]),te.lineWidth=1;for(const Y of d.log){const ne=p(Y.startDate);if(ne<0||ne>y)continue;const he=Math.round(ne)-N+L,be=ne-he,ve=Math.round(D+be)+1-N-L;if(ve<1)continue;let xe=0,Ue=v+1;for(const[Be,Le]of Y.drops){if(!Le)continue;const Ne=Ue-1,yt=O(xe+Le)+1,Me=Ne-yt,Fe=Math.max(Math.floor(Me),Me>.8?1:0);xe+=Le,!(Fe<1)&&(Ue=Ne-Fe,te.fillStyle=((se=Cn[Be])==null?void 0:se.color)??"white",te.fillRect(he,Ne,ve,-Fe),te.strokeStyle=((ue=Cn[Be])==null?void 0:ue.border)??"black",te.strokeRect(he+.5,Ne+.5,ve-1,-Fe-1))}if(Y.changes){te.fillStyle=z;const Be=Math.round(he-.5+ve/2)+.5,Le=Ue-6,Ne=3;te.beginPath(),te.moveTo(Be,Le-Ne),te.lineTo(Be+Ne,Le),te.lineTo(Be,Le+Ne),te.lineTo(Be-Ne,Le),te.closePath(),te.fill()}}_&&console.timeEnd("drawing canvas timeline")})();let j=null,F=!1,H;const B=`chartMask-${h}`,G=g.append("line").attr("stroke",c?"rgba(216, 245, 19, 0.75)":"rgba(62, 70, 5, 0.75)").attr("stroke-width",1).attr("stroke-dasharray","3,3"),X=g.append("defs").append("mask").attr("id",B),W=X.append("rect").attr("width",y).attr("height",v).attr("fill","white").attr("class","transition-opacity").attr("opacity","0"),$=X.append("rect").attr("height",v).attr("fill","black");g.append("rect").attr("width",y).attr("height",v).attr("fill",c?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0.35)").attr("mask",`url(#${B})`);const V=(oe,te)=>{if(typeof oe!="number"||typeof te!="number"||oe<0&&te<0||oe>y&&te>y){W.attr("opacity","0");return}const se=Math.floor(oe),ue=Math.floor(te);$.attr("x",Math.min(se,ue)+.5-N).attr("width",Math.abs(ue-se)+D+.5),W.attr("opacity","1")},U=oe=>{if(!Array.isArray(oe)||oe.length!==2)return o(null);oe[0].getTime()<=oe[1].getTime()?o({startDate:new Date(oe[0]),endDate:new Date(oe[1])}):o({startDate:new Date(oe[1]),endDate:new Date(oe[0])})},Q=(oe=!1)=>{j=null,F=!1,oe&&(V(),a&&U(null))},q=()=>{G.attr("x1",0).attr("y1",0).attr("x2",0).attr("y2",0),e.style.opacity="0",clearTimeout(H)};q(),a&&(console.log("Upsream range selected:",a.startDate.toISOString(),a.endDate.toISOString()),V(p(a.startDate),p(a.endDate)));const ie=$p(oe=>oe.startDate).center,re=oe=>{const te=p.invert(oe),se=ie(d.log,te);if(se===-1)return;const ue=d.log[se],Y=ue.startDate.getTime();return{datum:ue,datumStartTs:Y,datumStartX:p(ue.startDate),dataumIndex:se}};let ce=null;const ye=oe=>{var Ue;const te=re(oe);if(!te)return;const{datum:se,datumStartX:ue,dataumIndex:Y}=te;if(Y===ce)return;if(ce=Y,j)return F=!0,V(j.x,ue);const ne=e.querySelectorAll("span[data-category]");for(const Be of ne){const Le=Be.getAttribute("data-category");if(!Le)continue;const Ne=((Ue=se.drops.find(([yt])=>yt===Le))==null?void 0:Ue[1])??0;Be.textContent=br(Ne)}const ae=e.querySelector("div.change-flag");ae&&(se.changes?(ae.style.display="block",ae.textContent=se.changes>1?`${se.changes} CHANGES`:"1 CHANGE"):(ae.style.display="none",ae.textContent=""));let he=!1;e.style.opacity==="0"&&(e.style.transitionProperty="opacity",he=!0);const be=e.clientWidth;let ve=ue-be-10+l.left;ve{e.style.transitionProperty="all"},0);const xe=Math.round(ue+D/2)+.5-N;G.attr("x1",xe).attr("y1",0).attr("x2",xe).attr("y2",v)},le=oe=>{const te=re(oe);te&&(q(),j={x:te.datumStartX,datum:te.datum},V(te.datumStartX))},Re=oe=>{if(!j)return Q(!0);const te=re(oe);if(!te||!F&&j.datum.startDate.getTime()===te.datum.startDate.getTime())return Q(!0);console.log("PlayerDrops range selected:",j.datum.startDate,te.datum.startDate),clearTimeout(H),U([j.datum.startDate,te.datum.startDate]),Q()},Ae=()=>{setTimeout(()=>{Q(!!j),q()},150)};let _e=!1;const Ce=20;g.append("rect").attr("width",y).attr("height",v).attr("fill","transparent").on("mousemove",function(oe){const[te]=Ci(oe);_e?(clearTimeout(H),H=setTimeout(()=>{ye(te)},Ce)):(_e=!0,ye(te),setTimeout(()=>{_e=!1},Ce))}).on("mousedown",function(oe){const[te]=Ci(oe);le(te)}).on("mouseup",function(oe){const[te]=Ci(oe);Re(te)}),f.on("mouseleave",Ae),_=!1}const RPe=w.memo(({categories:e})=>e.slice().reverse().map(n=>u.jsxs("div",{className:"flex items-center text-sm",children:[u.jsx("div",{className:"size-4 mr-1 rounded-full border dark:border-0",style:{backgroundColor:Cn[n].color,borderColor:Cn[n].border}}),u.jsxs("span",{className:"tracking-wider",children:[Cn[n].label,":"]}),u.jsx("div",{className:"flex-grow text-right font-semibold min-w-[3ch] text-muted-foreground",children:u.jsx("span",{"data-category":n})})]},n)));function MPe({chartData:e,chartName:t,width:n,height:r,rangeSelected:i,rangeSetter:s}){const a=w.useRef(null),o=w.useRef(null),l=w.useRef(null),[c,h]=w.useState(""),[d,f]=w.useState(0),m=Ky(),_={top:8,right:8,bottom:24,left:42,axis:1};return w.useEffect(()=>{if(!(!e||!l.current||!a.current||!o.current||!n||!r)&&e.log.length)try{console.groupCollapsed(`Drawing player ${t} drops:`),console.time(`drawDropsTimeline-${t}`),TPe({chartName:t,legendRef:l.current,svgRef:a.current,canvasRef:o.current,size:{width:n,height:r},rangeSelected:i,margins:_,isDarkMode:m,data:e,setRenderError:h,rangeSetter:s}),f(0),h(""),console.timeEnd(`drawDropsTimeline-${t}`)}catch(v){h(v.message??"Unknown error.")}finally{console.groupEnd()}},[e,t,n,r,i,s,m,l,a,o,c]),!n||!r?null:c?u.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: ",c,u.jsx("br",{}),u.jsxs(De,{size:"sm",variant:"outline",className:"text-primary",onClick:()=>{f(v=>v+1),h("")},children:["Retry",d?` (${d})`:""]})]}):e.maxDrops?u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:l,style:{zIndex:2,position:"absolute",top:"12px",opacity:0},className:"p-2 rounded-md border shadow-lg dark:bg-zinc-800/90 bg-zinc-200/90 pointer-events-none transition-all",children:[u.jsx(RPe,{categories:e.categoriesSorted}),u.jsx("div",{className:"change-flag w-full mt-1 bg-card/75 rounded-md border text-center text-xs tracking-wider"})]}),u.jsx("svg",{ref:a,width:n,height:r,style:{zIndex:1,position:"absolute",top:"0px",left:"0px"}}),u.jsx("canvas",{ref:o,width:n-_.left-_.right,height:r-_.top-_.bottom,style:{zIndex:0,position:"absolute",top:`${_.top}px`,left:`${_.left}px`}})]}):u.jsx(qp,{message:"No players disconnected from your server recently."})}const sj=w.memo(MPe),APe=(e,t,n)=>{const r=n.getTime(),i=e.findIndex(p=>new Date(p.hour).getTime()>=r),s=e.slice(i);if(s.length===0)return null;const a=Object.fromEntries(tj.map(p=>[p,0])),o=Object.fromEntries(ONe.map(p=>[p,0]));let l=s;if(t==="day"){l=[];let p,x;for(const b of s){const S=new Date(b.hour).getDate();if(!x)p=S,x={hour:b.hour,changes:0,dropTypes:[]};else if(S!==p){l.push(x),p=S,x=Na(b);continue}x.changes+=b.changes;for(const[C,E]of b.dropTypes.slice()){const k=x.dropTypes.find(([T])=>T===C);k?k[1]+=E:x.dropTypes.push([C,E])}}x&&l.push(x)}let c=0,h=0;const d=[];for(const p of l){const x=[],b=[];let S=0,C=0;for(const[E,k]of p.dropTypes)tj.includes(E)?(S+=k,x.push([E,k]),a[E]+=k):(C+=k,b.push([E,k]),o[E]+=k);c=Math.max(c,S),h=Math.max(h,C),d.push({changes:p.changes,expectedDrops:x,unexpectedDrops:b})}const f=Object.entries(a).sort((p,x)=>x[1]-p[1]),m=Object.fromEntries(f.map(([p,x],b)=>[p,b])),_=Object.entries(o).sort((p,x)=>x[1]-p[1]),v=Object.fromEntries(_.map(([p,x],b)=>[p,b])),y=[],g=[];for(let p=0;pm[C]-m[E])}),g.push({startDate:S,changes:b.changes,drops:b.unexpectedDrops.sort(([C],[E])=>v[C]-v[E])})}return{expectedSeries:y,expectedSeriesMax:c,expectedCategoriesSorted:f.map(([p,x])=>p),unexpectedSeries:g,unexpectedSeriesMax:h,unexpectedCategoriesSorted:_.map(([p,x])=>p)}},jPe=w.memo(({isError:e,dataTs:t,summaryData:n,rangeSelected:r,rangeSetter:i,displayLod:s,setDisplayLod:a})=>{const[o,l]=w.useState({width:0,height:0}),[c,h]=w.useState({width:0,height:0}),d=w.useMemo(()=>{if(!n||!t)return;const f=new Date(t),m=new Date(t);s==="day"?(f.setHours(-(14*24)-12,-15,0,0),m.setHours(12,0,0,0)):(f.setHours(f.getHours()-7*24,-45,0,0),m.setMinutes(30,0,0));const _=APe(n,s,f);if(!_)return;const v={displayLod:s,startDate:f,endDate:m};return{expected:{...v,maxDrops:_.expectedSeriesMax,categoriesSorted:_.expectedCategoriesSorted,log:_.expectedSeries},unexpected:{...v,maxDrops:_.unexpectedSeriesMax,categoriesSorted:_.unexpectedCategoriesSorted,log:_.unexpectedSeries}}},[n,s]);return u.jsxs("div",{className:"md:rounded-xl border bg-card shadow-sm flex flex-col",children:[u.jsxs("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-b rounded-t-[inherit] bg-secondary/35",children:[u.jsxs("div",{className:"flex items-center py-2 space-x-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(fv,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Expected Player Drops"})]}),u.jsxs(Hn,{defaultValue:s,onValueChange:a,children:[u.jsx(Dn,{className:"w-32 h-6 px-3 py-1 text-sm",children:u.jsx(Wn,{placeholder:"Filter by admin"})}),u.jsxs(Ln,{className:"px-0",children:[u.jsx(Se,{value:"day",className:"cursor-pointer",children:"Days"}),u.jsx(Se,{value:"hour",className:"cursor-pointer",children:"Hours"})]})]})]}),u.jsx("div",{className:"h-32 max-h-32",children:u.jsx(Xf,{onDebouncedResize:l,children:d?u.jsx(sj,{chartData:d.expected,chartName:"expected",width:o.width,height:o.height,rangeSelected:r,rangeSetter:i}):u.jsx(Kh,{isError:e})})}),u.jsx("div",{className:"flex flex-row items-center justify-between px-1 sm:px-4 border-t border-b bg-secondary/35",children:u.jsxs("div",{className:"flex items-center py-2 gap-2",children:[u.jsx("div",{className:"hidden xs:block",children:u.jsx(fv,{className:"size-4"})}),u.jsx("h2",{className:"font-mono text-sm",children:"Unexpected Player Drops"})]})}),u.jsx("div",{className:"h-52 max-h-52",children:u.jsx(Xf,{onDebouncedResize:h,children:d?u.jsx(sj,{chartData:d.unexpected,chartName:"unexpected",width:c.width,height:c.height,rangeSelected:r,rangeSetter:i}):u.jsx(Kh,{isError:e})})})]})}),DPe=w.memo(jPe),LPe=(e,t)=>{if(!e){const i=t==="day"?14:7;return{queryKey:"detailedDaysAgo="+i,queryParams:{detailedDaysAgo:i}}}const n=new Date(e.endDate);t==="day"?n.setHours(23,59,59,999):n.setMinutes(59,59,999);const r=`${e.startDate.toISOString()},${n.toISOString()}`;return{queryKey:"detailedWindow="+r,queryParams:{detailedWindow:r}}};function NPe(){var c,h;const[e,t]=w.useState("hour"),[n,r]=w.useState(null),{queryKey:i,queryParams:s}=LPe(n,e),a=Tt({method:"GET",path:"/playerDropsData"}),o=fp(`/playerDropsData?${i}`,async()=>{const d=await a({queryParams:s});if(!d)throw new Error("empty_response");if("fail_reason"in d)throw new Error(d.fail_reason);return d},{revalidateOnFocus:!1}),l=d=>{t(d),r(null)};return u.jsxs("div",{className:"w-full space-y-8",children:[u.jsx(DPe,{isError:!!o.error,dataTs:(c=o.data)==null?void 0:c.ts,summaryData:(h=o.data)==null?void 0:h.summary,rangeSelected:n,rangeSetter:r,displayLod:e,setDisplayLod:l}),o.data&&!o.isValidating?u.jsx(EPe,{windowStart:o.data.detailed.windowStart,windowEnd:o.data.detailed.windowEnd,windowData:o.data.detailed.windowData,rangeSelected:n,displayLod:e}):u.jsx(CPe,{isError:!!o.error})]})}var ZE="Tabs",[PPe,t$e]=Un(ZE,[rd]),wH=rd(),[OPe,e3]=PPe(ZE),SH=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",dir:o,activationMode:l="automatic",...c}=e,h=Al(o),[d,f]=fi({prop:r,onChange:i,defaultProp:s});return u.jsx(OPe,{scope:n,baseId:zr(),value:d,onValueChange:f,orientation:a,dir:h,activationMode:l,children:u.jsx(Ee.div,{dir:h,"data-orientation":a,...c,ref:t})})});SH.displayName=ZE;var CH="TabsList",kH=w.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...i}=e,s=e3(CH,n),a=wH(n);return u.jsx(L5,{asChild:!0,...a,orientation:s.orientation,dir:s.dir,loop:r,children:u.jsx(Ee.div,{role:"tablist","aria-orientation":s.orientation,...i,ref:t})})});kH.displayName=CH;var EH="TabsTrigger",TH=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:i=!1,...s}=e,a=e3(EH,n),o=wH(n),l=AH(a.baseId,r),c=jH(a.baseId,r),h=r===a.value;return u.jsx(N5,{asChild:!0,...o,focusable:!i,active:h,children:u.jsx(Ee.button,{type:"button",role:"tab","aria-selected":h,"aria-controls":c,"data-state":h?"active":"inactive","data-disabled":i?"":void 0,disabled:i,id:l,...s,ref:t,onMouseDown:fe(e.onMouseDown,d=>{!i&&d.button===0&&d.ctrlKey===!1?a.onValueChange(r):d.preventDefault()}),onKeyDown:fe(e.onKeyDown,d=>{[" ","Enter"].includes(d.key)&&a.onValueChange(r)}),onFocus:fe(e.onFocus,()=>{const d=a.activationMode!=="manual";!h&&!i&&d&&a.onValueChange(r)})})})});TH.displayName=EH;var RH="TabsContent",MH=w.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:i,children:s,...a}=e,o=e3(RH,n),l=AH(o.baseId,r),c=jH(o.baseId,r),h=r===o.value,d=w.useRef(h);return w.useEffect(()=>{const f=requestAnimationFrame(()=>d.current=!1);return()=>cancelAnimationFrame(f)},[]),u.jsx(xn,{present:i||h,children:({present:f})=>u.jsx(Ee.div,{"data-state":h?"active":"inactive","data-orientation":o.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:c,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:d.current?"0s":void 0},children:f&&s})})});MH.displayName=RH;function AH(e,t){return`${e}-trigger-${t}`}function jH(e,t){return`${e}-content-${t}`}var IPe=SH,DH=kH,LH=TH,NH=MH;const PH=IPe,t3=w.forwardRef(({className:e,...t},n)=>u.jsx(DH,{ref:n,className:J("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));t3.displayName=DH.displayName;const y0=w.forwardRef(({className:e,...t},n)=>u.jsx(LH,{ref:n,className:J("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}));y0.displayName=LH.displayName;const sx=w.forwardRef(({className:e,...t},n)=>u.jsx(NH,{ref:n,className:J("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));sx.displayName=NH.displayName;function $Pe({tab:e,pageCtx:t}){return"cards"in e?u.jsx("div",{id:`tab-${e.ctx.tabId}`,className:"space-y-4",children:e.cards.map(({ctx:n,Component:r})=>u.jsx(r,{pageCtx:t,cardCtx:n},n.cardId))}):u.jsx(e.Component,{pageCtx:t,cardCtx:e.ctx},e.ctx.tabId)}function BPe({entry:e}){return u.jsxs("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-md border odd:bg-card/75",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsxs("div",{className:"font-semibold text-accent",children:[u.jsx(jL,{className:"size-5 mr-2 inline-block align-text-bottom opacity-65"}),e.author]}),u.jsx("div",{className:"text-sm text-muted-foreground",children:zs(e.ts,"short","short")})]}),u.jsx("div",{className:"flex gap-1 flex-wrap text-sm",children:e.keys.length?e.keys.map((t,n)=>u.jsxs("span",{children:[u.jsx("div",{className:"inline px-1 py-0.5 font-mono tracking-wide rounded bg-secondary/50",children:t},t),n{if(!(e!=null&&e.length))return null;const o=e[e.length-1],l=new Date(o.ts),c=bu(l,"2-digit","2-digit"),h=wu(l,"short"),d=wf(l)?c:h;return{author:o.author,dateTime:d}},[e]),i=w.useMemo(()=>e?[...e].reverse():null,[e]),s=()=>{n(!0)},a=Array.isArray(e)?"No changes yet":"loading...";return u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex flex-col px-2 py-1 rounded-lg text-muted-foreground group relative",children:[i!=null&&i.length?u.jsx("div",{className:"absolute inset-0 flex items-center justify-center rounded-[inherit] bg-card opacity-0 border group-hover:opacity-100 transition-opacity text-primary group-active:bg-primary group-active:text-primary-foreground group-active:border-none select-none cursor-pointer",onClick:s,children:"View Changelog"}):null,u.jsxs("div",{className:"tracking-wider leading-3 font-semibold",children:[u.jsx(IC,{className:"size-4 inline-block align-text-bottom"})," Last Updated"]}),u.jsxs("div",{className:"text-xs",children:[u.jsx(TX,{className:"size-4 inline-block align-text-bottom"})," ",(r==null?void 0:r.dateTime)??a]}),u.jsxs("div",{className:"text-xs",children:[u.jsx(jL,{className:"size-4 inline-block align-text-bottom"})," ",(r==null?void 0:r.author)??a]})]}),u.jsx($l,{open:t,onOpenChange:n,children:u.jsxs(wa,{className:"max-sm:p-4 max-w-xl",children:[u.jsx(Sa,{children:u.jsx(Ca,{children:"Recent Setting Changes"})}),u.jsx("div",{className:"pr-3 max-h-[80vh] overflow-auto space-y-3",style:{scrollbarWidth:"thin"},children:i==null?void 0:i.map((o,l)=>u.jsx(BPe,{entry:o},l))})]})})]})}function zPe({changelogData:e}){return u.jsx("header",{className:"border-b mb-4",children:u.jsxs("div",{className:"flex justify-between items-center px-4 py-2",children:[u.jsxs("h1",{className:"text-2xl font-semibold",children:[u.jsx(IC,{className:"size-6 mt-0.5 inline-block align-text-top text-muted-foreground"})," Settings"]}),u.jsx(FPe,{changelogData:e})]})})}var n3="Switch",[HPe,n$e]=Un(n3),[WPe,UPe]=HPe(n3),OH=w.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:h,...d}=e,[f,m]=w.useState(null),_=We(t,x=>m(x)),v=w.useRef(!1),y=f?h||!!f.closest("form"):!0,[g=!1,p]=fi({prop:i,defaultProp:s,onChange:c});return u.jsxs(WPe,{scope:n,checked:g,disabled:o,children:[u.jsx(Ee.button,{type:"button",role:"switch","aria-checked":g,"aria-required":a,"data-state":BH(g),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:_,onClick:fe(e.onClick,x=>{p(b=>!b),y&&(v.current=x.isPropagationStopped(),v.current||x.stopPropagation())})}),y&&u.jsx(VPe,{control:f,bubbles:!v.current,name:r,value:l,checked:g,required:a,disabled:o,form:h,style:{transform:"translateX(-100%)"}})]})});OH.displayName=n3;var IH="SwitchThumb",$H=w.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,i=UPe(IH,n);return u.jsx(Ee.span,{"data-state":BH(i.checked),"data-disabled":i.disabled?"":void 0,...r,ref:t})});$H.displayName=IH;var VPe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=w.useRef(null),a=xp(n),o=h1(t);return w.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function BH(e){return e?"checked":"unchecked"}var FH=OH,qPe=$H;const zH=w.forwardRef(({className:e,...t},n)=>u.jsx(FH,{className:J("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:u.jsx(qPe,{className:J("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));zH.displayName=FH.displayName;const GPe=co("peer",{variants:{variant:{default:"",checkedGreen:"data-[state=unchecked]:bg-input data-[state=checked]:bg-success",checkedYellow:"data-[state=unchecked]:bg-input data-[state=checked]:bg-warning",checkedRed:"data-[state=unchecked]:bg-input data-[state=checked]:bg-destructive",uncheckedGreen:"data-[state=unchecked]:bg-success data-[state=checked]:bg-input",uncheckedYellow:"data-[state=unchecked]:bg-warning data-[state=checked]:bg-input",uncheckedRed:"data-[state=unchecked]:bg-destructive data-[state=checked]:bg-input",redGreen:"data-[state=unchecked]:bg-destructive data-[state=checked]:bg-success",greenRed:"data-[state=unchecked]:bg-success data-[state=checked]:bg-destructive"}},defaultVariants:{variant:"default"}}),wr=w.forwardRef(({id:e,checkedLabel:t,uncheckedLabel:n,variant:r,className:i,...s},a)=>u.jsxs("div",{className:"flex items-center space-x-2",children:[u.jsx(zH,{id:e,className:J(i,GPe({variant:r})),ref:a,...s}),u.jsx("div",{className:"text-sm font-medium leading-none tracking-wide text-muted-foreground select-none hidden peer-data-[state=checked]:inline",children:t}),u.jsx("div",{className:"text-sm font-medium leading-none tracking-wide text-muted-foreground select-none hidden peer-data-[state=unchecked]:inline",children:n})]}));wr.displayName="SwitchText";function KPe(){return u.jsx("span",{className:"tracking-widest text-2xs text-destructive-inline opacity-65 group-hover/cfgCardItem:opacity-100",children:"REQUIRED"})}function YPe(){return u.jsx("span",{className:"tracking-widest text-2xs text-info-inline opacity-0 group-hover/cfgCardItem:opacity-85 group-hover/cfgCardItem:dark:opacity-35",children:"OPTIONAL"})}function XPe(){return u.jsx("span",{className:"rounded-sm bg-accent text-accent-foreground text-2xs tracking-wider font-semibold leading-snug pb-0.5 px-0.5 w-fit mt-0.5",children:"NEW"})}function dt({children:e,className:t}){return u.jsx("div",{className:J("text-sm text-muted-foreground",t),children:e})}function ht({label:e,htmlFor:t,required:n,showOptional:r,showNew:i,showIf:s,children:a}){return s!==void 0&&!s?null:u.jsxs("div",{className:"max-w-4xl space-y-2 sm:grid sm:grid-cols-8 sm:gap-4 sm:space-y-0 sm:items-start group/cfgCardItem",children:[u.jsx("div",{className:"sm:col-span-2",children:u.jsxs(Tn,{className:"flex flex-col text-sm font-medium leading-6",htmlFor:t,children:[e,i&&u.jsx(XPe,{}),n&&u.jsx(KPe,{}),r&&u.jsx(YPe,{})]})}),u.jsx("div",{className:"sm:col-span-6 space-y-2",children:a})]})}function r3(){return u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 flex items-center",children:u.jsx("hr",{className:"w-full border-t"})}),u.jsx("div",{className:"relative flex justify-center tracking-wider text-xs",children:u.jsx("span",{className:"bg-background px-2 text-muted-foreground/75",children:"Advanced Options"})})]})}function QPe({loading:e,error:t,message:n}){let r;if(e)r=u.jsx(sn,{className:"animate-spin size-20 opacity-75"});else if(t)r=u.jsxs(u.Fragment,{children:[u.jsx(CL,{className:"size-16 opacity-75 text-destructive-inline"}),u.jsx("span",{className:"max-w-4xl text-xl text-destructive-inline",children:t})]});else if(n)r=u.jsx("span",{className:"max-w-4xl text-2xl tracking-wider text-muted-foreground/75",children:n});else return null;return u.jsx("div",{className:"absolute inset-0 min-h-20 px-4 py-6 rounded-[inherit] dark:bg-black/25 backdrop-blur-sm flex flex-col items-center justify-center gap-2 text-center",children:r})}function Yl({cardCtx:e,pageCtx:t,advanced:n,onClickSave:r,children:i}){var o;const[s]=P1(),a=((o=t.cardPendingSave)==null?void 0:o.cardId)===e.cardId;return u.jsx("div",{id:`tab-${e.cardId}`,"data-show-advanced":n==null?void 0:n.showing,className:"group/card",children:u.jsxs(z0,{className:"xs:x bg-transparent max-xs:rounded-none max-xs:shadow-none",children:[u.jsxs("ol",{className:"bg-muted/50 border-b p-4 flex flex-wrap items-center gap-1 sm:gap-2.5 select-none text-sm text-muted-foreground tracking-wide",children:[e.tabName!==e.cardName?u.jsxs(u.Fragment,{children:[u.jsx("li",{children:e.tabName}),u.jsx(xL,{className:"size-3.5 mt-0.5 inline align-text-top opacity-75"}),u.jsxs("li",{children:[e.cardName," Settings"]})]}):u.jsxs("li",{children:[e.tabName," Settings"]}),a&&u.jsx("li",{className:"text-warning-inline italic tracking-wide",children:"(unsaved changes)"})]}),u.jsxs("div",{className:"relative rounded-b-[inherit]",children:[u.jsxs(Uu,{className:"space-y-6 pt-6 bg-transparent overflow-x-clip",ref:s,children:[i,u.jsxs("div",{className:"flex flex-wrap-reverse justify-center xs:justify-start gap-2",children:[u.jsxs(De,{size:"xs",disabled:!a||t.isReadOnly,onClick:r,children:["Save ",e.cardName," Settings",t.isSaving&&u.jsx(sn,{className:"h-3.5 mt-0.5 inline animate-spin"})]}),n?u.jsxs(De,{size:"xs",variant:"muted",onClick:()=>n.toggle(!n.showing),children:[n.showing?"Discard":"Show"," Advanced",n.showing?u.jsx(NC,{className:"size-4 ml-1.5"}):u.jsx(Dl,{className:"size-4 ml-1.5"})]}):null]})]}),u.jsx(QPe,{loading:t.isLoading,error:t.swrError})]})]})})}const Xl=e=>{const t=w.useId();return(n,r)=>{const[i,s]=w.useState(void 0),a=()=>{var f,m,_,v;const c=(m=(f=e==null?void 0:e.storedConfigs)==null?void 0:f[n])==null?void 0:m[r],h=(v=(_=e==null?void 0:e.defaultConfigs)==null?void 0:_[n])==null?void 0:v[r];return{storedValue:c,defaultValue:h,initialValue:c??h}},o=()=>s(a().initialValue);w.useEffect(()=>{o()},[e]);const l=a();return{scope:n,key:r,eid:`${t}:${r}`,defaultValue:l.defaultValue,initialValue:l.initialValue,state:{value:i,set:s,discard:o,default:()=>s(l.defaultValue)},hasChanged:c=>e!==void 0&&c!==void 0&&!Cv(c,a().initialValue)}}},Ql=e=>{var i,s;const t={},n={};let r=!1;console.groupCollapsed("Settings Diffing:");for(let[a,o]of e){if(o===void 0)continue;typeof o=="string"&&(o=o.trim()),t[i=a.scope]??(t[i]={}),t[a.scope][a.key]=o;const l=a.hasChanged(o);console.log(l,a.scope,a.key,{initial:a.initialValue,current:o}),a.hasChanged(o)&&(r=!0,n[s=a.scope]??(n[s]={}),n[a.scope][a.key]=o)}return console.log("Final changedConfigs:",n),console.groupEnd(),{hasChanges:r,localConfigs:t,changedConfigs:n}};function JPe({cardCtx:e,pageCtx:t}){const[n,r]=w.useState(!1),i=Xl(t.apiData),s=i("banlist","enabled"),a=i("banlist","rejectionMessage"),o=w.useRef(null),l=i("banlist","requiredHwidMatches"),c={toUi:f=>f?f.toString():void 0,toCfg:f=>f?parseInt(f):void 0},h=()=>{var m;if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};const f=Ql([[s,s.state.value],[a,(m=o.current)==null?void 0:m.textArea.value],[l,l.state.value]]);return t.setCardPendingSave(f.hasChanges?e:null),f},d=()=>{var v;const{changedConfigs:f,hasChanges:m,localConfigs:_}=h();if(m){if((v=_.banlist)!=null&&v.rejectionMessage&&_.banlist.rejectionMessage.length>512)return qe.error({title:"The Ban Rejection Message is too big.",md:!0,msg:"The message must be 512 characters or less."});t.saveChanges(e,_)}};return w.useEffect(()=>{h()},[n,s.state.value,l.state.value]),w.useEffect(()=>{n||l.state.discard()},[n]),u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:d,advanced:{showing:n,toggle:r},children:[u.jsxs(ht,{label:"Ban Checking",children:[u.jsx(wr,{id:s.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:s.state.value,onCheckedChange:s.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Enable checking for ban status on player join. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," txAdmin bans will not work if this option is disabled."]})]}),u.jsxs(ht,{label:"Ban Templates",children:[u.jsx(fs,{asChild:!0,href:"/settings/ban-templates",children:u.jsxs(De,{size:"sm",variant:"secondary",disabled:t.isReadOnly,children:[u.jsx(lQ,{className:"size-4 mr-1.5 inline-block"})," Edit Ban Templates"]})}),u.jsx(dt,{children:"Configure ban reasons and durations that will appear as dropdown options when banning a player. This is useful for common reasons that happen frequently, like violation of your server rules."})]}),u.jsxs(ht,{label:"Ban Rejection Message",htmlFor:a.eid,showOptional:!0,children:[u.jsx(Ep,{id:a.eid,ref:o,placeholder:"You can join http://discord.gg/example to appeal this ban.",defaultValue:a.initialValue,onInput:h,autoComplete:"off",minHeight:60,maxHeight:180,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Optional message to display to a player on the rejection message that shows when they try to connect while being banned. ",u.jsx("br",{}),"If you have a ban appeal process, you can use this field to inform the players."]})]}),n&&u.jsx(r3,{}),u.jsxs(ht,{label:"Required Ban HWID Matches",htmlFor:l.eid,showIf:n,children:[u.jsxs(Hn,{value:c.toUi(l.state.value),onValueChange:f=>l.state.set(c.toCfg(f)),disabled:t.isReadOnly,children:[u.jsx(Dn,{id:l.eid,children:u.jsx(Wn,{placeholder:"Select..."})}),u.jsxs(Ln,{children:[u.jsx(Se,{value:"1",children:"1 - recommended"}),u.jsx(Se,{value:"2",children:"2 - lax"}),u.jsx(Se,{value:"3",children:"3 - very lax"}),u.jsx(Se,{value:"4",children:"4 - virtually disabled"}),u.jsx(Se,{value:"0",children:"Disable HWID Bans"})]})]}),u.jsxs(dt,{children:["This option configures how many HWID tokens must match between a player and an existing ban for the player join to be blocked, or can disable HWID Bans entirely. ",u.jsx("br",{}),"Since Hardware ID Tokens are not guaranteed to be unique, there is the possibility of tokens from two players matching without them being related to each other. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Most players have 3 to 6 HWID tokens."]})]})]})}const oj=e=>{try{return JSON.stringify(JSON.parse(e),null,4)}catch{return e}};function ZPe({cardCtx:e,pageCtx:t}){const n=Xl(t.apiData),r=n("discordBot","enabled"),i=n("discordBot","token"),s=w.useRef(null),a=n("discordBot","guild"),o=w.useRef(null),l=n("discordBot","warningsChannel"),c=w.useRef(null),h=n("discordBot","embedJson"),d=n("discordBot","embedConfigJson"),f=v=>{if(v===void 0)return;const y=v.trim();return y.length?y:null},m=()=>{var y,g,p;if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};const v=Ql([[r,r.state.value],[i,f((y=s.current)==null?void 0:y.value)],[a,f((g=o.current)==null?void 0:g.value)],[l,f((p=c.current)==null?void 0:p.value)],[h,h.state.value],[d,d.state.value]]);return t.setCardPendingSave(v.hasChanges?e:null),v},_=()=>{var p,x,b,S,C;const{changedConfigs:v,hasChanges:y,localConfigs:g}=m();if(y){if((p=g.discordBot)!=null&&p.enabled){if(!((x=g.discordBot)!=null&&x.token))return qe.error("You must provide a Discord Bot Token to enable the bot.");if(!((b=g.discordBot)!=null&&b.guild))return qe.error("You must provide a Server ID to enable the bot.");if(!((S=g.discordBot)!=null&&S.embedJson)||!((C=g.discordBot)!=null&&C.embedConfigJson))return qe.error("You must provide both the Embed JSON and Config JSON to enable the bot.")}t.saveChanges(e,g)}};return w.useEffect(()=>{m()},[r.state.value,h.state.value,d.state.value]),u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:_,children:[u.jsxs(ht,{label:"Discord Bot",children:[u.jsx(wr,{id:r.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:r.state.value,onCheckedChange:r.state.set,disabled:t.isReadOnly}),u.jsx(dt,{children:"Enable Discord Integration."})]}),u.jsxs(ht,{label:"Token",htmlFor:i.eid,required:r.state.value,children:[u.jsx(wt,{id:i.eid,ref:s,defaultValue:i.initialValue,onInput:m,disabled:t.isReadOnly,placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx.xxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxx",maxLength:96,autoComplete:"off",className:"blur-input",required:!0}),u.jsxs(dt,{children:["To get a token and the bot to join your server, follow these two guides:",u.jsx(kn,{href:"https://discordjs.guide/preparations/setting-up-a-bot-application.html",children:"Setting up a bot application"})," and ",u.jsx(kn,{href:"https://discordjs.guide/preparations/adding-your-bot-to-servers.html",children:"Adding your bot to servers"})," ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Do not reuse the same token for another bot. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," The bot requires the ",u.jsx("strong",{children:"Server Members"})," intent, which can be set at the",u.jsx(kn,{href:"https://discord.com/developers/applications",children:"Discord Developer Portal"}),"."]})]}),u.jsxs(ht,{label:"Guild/Server ID",htmlFor:a.eid,required:r.state.value,children:[u.jsx(wt,{id:a.eid,ref:o,defaultValue:a.initialValue,onInput:m,disabled:t.isReadOnly,placeholder:"000000000000000000"}),u.jsxs(dt,{children:["The ID of the Discord Server (also known as Discord Guild). ",u.jsx("br",{}),"To get the Server ID, go to Discord's settings and",u.jsx(kn,{href:"https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png",children:" enable developer mode"}),', then right-click on the guild icon select "Copy ID".']})]}),u.jsxs(ht,{label:"Warnings Channel ID",htmlFor:l.eid,showOptional:!0,children:[u.jsx(wt,{id:l.eid,ref:c,defaultValue:l.initialValue,onInput:m,disabled:t.isReadOnly,placeholder:"000000000000000000"}),u.jsxs(dt,{children:["The ID of the channel to send Announcements (eg server restarts). ",u.jsx("br",{}),"You can leave it blank to disable this feature. ",u.jsx("br",{}),"To get the channel ID, go to Discord's settings and",u.jsx(kn,{href:"https://support.discordapp.com/hc/article_attachments/115002742731/mceclip0.png",children:" enable developer mode"}),', then right-click on the channel name and select "Copy ID".']})]}),u.jsxs(ht,{label:"Status Embed JSON",htmlFor:h.eid,required:r.state.value,children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(Eu,{id:h.eid,placeholder:"{}",value:oj(h.state.value??""),onChange:v=>h.state.set(v.target.value),autoComplete:"off",style:{minHeight:512},disabled:t.isReadOnly,spellCheck:!1}),u.jsxs("div",{className:"w-full flex flex-wrap justify-between gap-6",children:[u.jsxs(De,{className:"grow",variant:"outline",onClick:()=>h.state.discard(),disabled:t.isReadOnly,children:[u.jsx(Ar,{className:"mr-2 h-4 w-4"})," Discard Changes"]}),u.jsxs(De,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",onClick:()=>h.state.default(),disabled:t.isReadOnly,children:[u.jsx(ow,{className:"mr-2 h-4 w-4"})," Reset to Default"]})]})]}),u.jsxs(dt,{children:["The server status embed is customizable by editing the JSON above. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Use the command ",u.jsx(Ye,{children:"/status add"}),' on a channel that the bot has the "Send Message" permission to setup the embed.']})]}),u.jsxs(ht,{label:"Status Config JSON",htmlFor:d.eid,required:r.state.value,children:[u.jsxs("div",{className:"flex flex-col gap-2",children:[u.jsx(Eu,{id:d.eid,placeholder:"{}",value:oj(d.state.value??""),onChange:v=>d.state.set(v.target.value),autoComplete:"off",style:{minHeight:512},disabled:t.isReadOnly,spellCheck:!1}),u.jsxs("div",{className:"w-full flex flex-wrap justify-between gap-6",children:[u.jsxs(De,{className:"grow",variant:"outline",onClick:()=>d.state.discard(),disabled:t.isReadOnly,children:[u.jsx(Ar,{className:"mr-2 h-4 w-4"})," Discard Changes"]}),u.jsxs(De,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",onClick:()=>d.state.default(),disabled:t.isReadOnly,children:[u.jsx(ow,{className:"mr-2 h-4 w-4"})," Reset to Default"]})]})]}),u.jsxs(dt,{children:["The server status embed is customizable by editing the JSON above. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Use the command ",u.jsx(Ye,{children:"/status add"}),' on a channel that the bot has the "Send Message" permission to setup the embed.']})]})]})}function eOe({value:e,label24h:t,label12h:n}){return u.jsx(Se,{value:e,className:"group/timeOption",children:u.jsxs("div",{className:"flex justify-around gap-2 items-center",children:[u.jsx("div",{className:"font-medium min-w-[2ch]",children:t}),u.jsx("div",{className:"text-muted-foreground group-focus/timeOption:text-primary-foreground group-focus/timeOption:dark:text-primary text-sm min-w-[5ch] text-right",children:n})]})})}function tOe({title:e,isOpen:t,onClose:n,onSubmit:r}){const[i,s]=w.useState("00"),[a,o]=w.useState("00"),l=`timeinput-${w.useId()}`,c=`timeinput-${w.useId()}`,h=()=>{r(`${i}:${a}`),s("00"),o("00"),n()},d=w.useMemo(()=>Array.from({length:24},(f,m)=>{const _=m.toString().padStart(2,"0"),v=m<12?"AM":"PM",y=m%12||12;return{value:_,label24h:_,label12h:`${y} ${v}`}}),[]);return u.jsx($l,{open:t,onOpenChange:n,children:u.jsxs(wa,{className:"sm:max-w-sm",onBlur:()=>console.log("blur",Math.random()),children:[u.jsx(Sa,{children:u.jsx(Ca,{children:e})}),u.jsx("div",{className:"grid gap-4 py-4",children:u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("div",{className:"flex flex-col space-y-1.5",children:[u.jsx(Tn,{htmlFor:l,className:"text-sm font-medium",children:"Hour"}),u.jsxs(Hn,{onValueChange:s,value:i,children:[u.jsx(Dn,{id:l,children:u.jsx(Wn,{placeholder:"Select hour"})}),u.jsx(Ln,{children:d.map(f=>u.jsx(eOe,{...f},f.value))})]})]}),u.jsxs("div",{className:"flex flex-col space-y-1.5",children:[u.jsx(Tn,{htmlFor:c,className:"text-sm font-medium",children:"Minute"}),u.jsxs(Hn,{onValueChange:o,value:a,children:[u.jsx(Dn,{id:c,children:u.jsx(Wn,{placeholder:"Select minute"})}),u.jsxs(Ln,{onBlur:f=>f.preventDefault(),children:[u.jsx(Se,{value:"00",children:"00"}),u.jsx(Se,{value:"05",children:"05"}),u.jsx(Se,{value:"10",children:"10"}),u.jsx(Se,{value:"15",children:"15"}),u.jsx(Se,{value:"20",children:"20"}),u.jsx(Se,{value:"25",children:"25"}),u.jsx(Se,{value:"30",children:"30"}),u.jsx(Se,{value:"35",children:"35"}),u.jsx(Se,{value:"40",children:"40"}),u.jsx(Se,{value:"45",children:"45"}),u.jsx(Se,{value:"50",children:"50"}),u.jsx(Se,{value:"55",children:"55"})]})]})]})]})}),u.jsx(kp,{children:u.jsx(De,{onClick:h,children:"Add Time"})})]})})}function aj(e){return Array.from(new Set(e)).sort((n,r)=>{const[i,s]=n.split(":").map(Number),[a,o]=r.split(":").map(Number);return i-a||s-o})}function nOe({restartTimes:e,setRestartTimes:t,disabled:n}){const[r,i]=w.useState(!1),[s]=P1(),a=d=>{!e||n||t(f=>aj([...f??[],d]))},o=d=>{!e||n||t(f=>aj((f??[]).filter((m,_)=>_!==d)))},l=d=>{!e||n||t(d)},c=()=>{n||t([])},h=J("text-muted-foreground",n&&"opacity-50 cursor-not-allowed");return u.jsxs("div",{className:"py-3 px-2 min-h-[4.5rem] flex items-center border rounded-lg",children:[u.jsxs("div",{className:J("w-full flex items-center gap-2",n&&"cursor-not-allowed"),children:[u.jsxs("div",{className:"flex flex-wrap gap-2 grow",ref:s,children:[e&&e.length===0&&u.jsxs("div",{className:"text-sm text-muted-foreground",children:[u.jsxs("span",{children:["No schedule set. Click on the ",u.jsx("strong",{children:"+"})," button to add a time."]}),u.jsxs("p",{children:["Presets: ",u.jsxs("a",{onClick:()=>l(["00:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["1x",u.jsx("span",{className:h,children:"/day"})]}),", ",u.jsxs("a",{onClick:()=>l(["00:00","12:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["2x",u.jsx("span",{className:h,children:"/day"})]}),", ",u.jsxs("a",{onClick:()=>l(["00:00","08:00","16:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["3x",u.jsx("span",{className:h,children:"/day"})]}),", ",u.jsxs("a",{onClick:()=>l(["00:00","06:00","12:00","18:00"]),className:"cursor-pointer text-sm text-primary hover:underline",children:["4x",u.jsx("span",{className:h,children:"/day"})]})]})]}),e&&e.map((d,f)=>u.jsxs("div",{className:"flex items-center space-x-1 bg-secondary text-secondary-foreground px-3 py-1 rounded-md select-none",children:[u.jsx("span",{className:"font-mono",children:d}),!n&&u.jsx("button",{onClick:()=>o(f),className:"ml-2 text-secondary-foreground/50 hover:text-destructive","aria-label":"Remove",disabled:n,children:u.jsx(Ar,{className:"size-4"})})]},d))]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx(De,{onClick:()=>i(!0),variant:"secondary",size:"xs",className:"w-10 hover:bg-primary hover:text-primary-foreground","aria-label":"Add",disabled:n,children:u.jsx(OC,{className:"h-4"})}),u.jsx(De,{onClick:()=>c(),variant:"muted",size:"xs",className:"w-10 hover:bg-destructive hover:text-destructive-foreground","aria-label":"Clear",disabled:n||!e||e.length===0,children:u.jsx(SQ,{className:"h-3.5"})})]})]}),u.jsx(tOe,{title:"Add Restart Time",isOpen:r,onClose:()=>i(!1),onSubmit:a})]})}const rOe=e=>window.txConsts.isWindows?"C:/Users/Admin/Desktop/serverdata":window.txConsts.isZapHosting?"/home/zap9999999/g999999/gta5-fivem-txadmin/serverdata":window.txConsts.isPterodactyl?"/home/container/serverdata/":"/root/fivem/txData/serverdata";function iOe(){try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone;if(window.txConsts.serverTimezone!==e)return u.jsxs(dt,{className:"text-destructive-inline",children:[u.jsx("strong",{children:"Warning:"})," Your server timezone is set to ",u.jsx(Ye,{children:window.txConsts.serverTimezone}),", but your browser timezone is ",u.jsx(Ye,{children:e}),". Make sure to configure the time according to the server timezone."]})}catch(e){console.error(e)}return null}function sOe({cardCtx:e,pageCtx:t}){var N;const[n,r]=w.useState(!1),[i,s]=w.useState(!1),{hasPerm:a}=fr(),o=va()[1],l=lp(),c=Xl(t.apiData),h=c("server","dataPath"),d=w.useRef(null),f=c("restarter","schedule"),m=c("server","quiet"),_=c("server","cfgPath"),v=w.useRef(null),y=c("server","startupArgs"),g=w.useRef(null),p=c("server","onesync"),x=c("server","autoStart"),b=c("restarter","resourceStartingTolerance"),S=(N=t.apiData)==null?void 0:N.forceQuietMode,C={toUi:L=>L?L.toString():void 0,toCfg:L=>L?parseInt(L):void 0},E={toUi:L=>L?L.join(" "):void 0,toCfg:L=>L?L.trim().split(/\s+/):void 0},k=()=>{var z,O,A;if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};let L;g.current&&(L=E.toCfg(g.current.value));let P;(z=d.current)!=null&&z.value&&(P=d.current.value.replace(/\\/g,"/").replace(/\/\/+/,"/"),P.endsWith("/")&&(P=P.slice(0,-1)));const I=Ql([[h,(O=d.current)==null?void 0:O.value],[f,f.state.value],[m,m.state.value],[_,(A=v.current)==null?void 0:A.value],[y,L],[p,p.state.value],[x,x.state.value],[b,b.state.value]]);return t.setCardPendingSave(I.hasChanges?e:null),I},T=()=>{var z,O;const{changedConfigs:L,hasChanges:P,localConfigs:I}=k();if(P){if(!((z=I.server)!=null&&z.dataPath))return qe.error({title:"The Server Data Folder is required.",md:!0,msg:'If you want to return to the Setup page, click on the "Reset" button instead.'});if(I.server.cfgPath!==void 0&&!I.server.cfgPath)return qe.error({title:"The CFG File Path is required.",md:!0,msg:"The value should probably be `server.cfg`."});if(Array.isArray((O=I.server)==null?void 0:O.startupArgs)&&I.server.startupArgs.some(A=>A.toLowerCase()==="onesync"))return qe.error({title:"You cannot set OneSync in Startup Arguments.",md:!0,msg:"Please use the selectbox below it."});t.saveChanges(e,I)}};w.useEffect(()=>{k()},[n,f.state.value,m.state.value,p.state.value,x.state.value,b.state.value]),w.useEffect(()=>{n||(_.state.discard(),y.state.discard(),p.state.discard(),x.state.discard(),b.state.discard())},[n]);const R=w.useMemo(()=>rOe(),[]),M=Tt({method:"POST",path:"/settings/resetServerDataPath",throwGenericErrors:!0}),D=()=>{l({title:"Reset Server Data Path",message:u.jsxs(u.Fragment,{children:["Are you sure you want to reset the server data path? ",u.jsx("br",{}),u.jsx("br",{}),u.jsx("strong",{children:"This will not delete any resource files or database"}),", but just reset the txAdmin configuration, allowing you to go back to the Setup page. ",u.jsx("br",{}),"If you want, you can set the path back to the current value later. ",u.jsx("br",{}),u.jsx("br",{}),u.jsx("strong",{className:"text-warning-inline",children:"Warning:"})," take note of the current path before proceeding, so you can set it back later if you need to. Current path:",u.jsx(wt,{value:h.initialValue,className:"mt-2",readOnly:!0})]}),onConfirm:()=>{s(!0),M({toastLoadingMessage:"Resetting server data path...",success:(L,P)=>{L.type==="success"&&o("/server/setup")},finally:()=>s(!1)})}})};return u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:T,advanced:{showing:n,toggle:r},children:[u.jsxs(ht,{label:"Server Data Folder",htmlFor:h.eid,required:!0,children:[u.jsxs("div",{className:"flex gap-2",children:[u.jsx(wt,{id:h.eid,ref:d,defaultValue:h.initialValue,placeholder:R,onInput:k,disabled:t.isReadOnly,required:!0}),u.jsxs(De,{className:"grow border-destructive text-destructive hover:bg-destructive hover:text-destructive-foreground",variant:"outline",disabled:t.isReadOnly||!a("all_permissions")||i,onClick:D,children:[u.jsx($C,{className:"mr-2 h-4 w-4"})," Reset"]})]}),u.jsxs(dt,{children:["The full path of the folder that ",u.jsx("strong",{children:"contains"})," the ",u.jsx(Ye,{children:"resources"})," folder, usually it's the same place that contains your ",u.jsx(Ye,{children:"server.cfg"}),". ",u.jsx("br",{}),"Resetting this value will allow you to go back to the Setup page, without deleting any files."]})]}),u.jsxs(ht,{label:"Restart Schedule",showOptional:!0,children:[u.jsx(nOe,{restartTimes:f.state.value,setRestartTimes:f.state.set,disabled:t.isReadOnly}),u.jsx(iOe,{}),u.jsxs(dt,{children:["At which times of day to restart the server. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," Make sure your schedule matches your server time and not your local time."]})]}),u.jsxs(ht,{label:"Quiet Mode",children:[u.jsx(wr,{id:m.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:S||m.state.value,onCheckedChange:m.state.set,disabled:t.isReadOnly||S}),u.jsxs(dt,{children:["Do not print FXServer's output to the terminal. ",u.jsx("br",{}),"You will still be able to use the Live Console.",S&&u.jsxs(u.Fragment,{children:[u.jsx("br",{}),u.jsxs("span",{className:"text-warning-inline",children:[window.txConsts.providerName,": This setting is locked and cannot be changed."]})]})]})]}),n&&u.jsx(r3,{}),u.jsxs(ht,{label:"CFG File Path",htmlFor:_.eid,showIf:n,required:!0,children:[u.jsx(wt,{id:_.eid,ref:v,defaultValue:_.initialValue,placeholder:"server.cfg",onInput:k,disabled:t.isReadOnly,required:!0}),u.jsxs(dt,{children:["The path to your server config file, probably named ",u.jsx(Ye,{children:"server.cfg"}),". ",u.jsx("br",{}),"This can either be absolute, or relative to the Server Data folder."]})]}),u.jsxs(ht,{label:"Startup Arguments",htmlFor:y.eid,showIf:n,children:[u.jsx(wt,{id:y.eid,ref:g,defaultValue:E.toUi(y.initialValue),placeholder:"--trace-warning",onInput:k,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Additional command-line arguments to pass to the FXServer instance such as NodeJS CLI flags. ",u.jsx("br",{}),u.jsx("strong",{children:"Warning:"})," You almost certainly should not use this option, commands and convars should be placed in your ",u.jsx(Ye,{children:"server.cfg"})," instead."]})]}),u.jsxs(ht,{label:"OneSync",htmlFor:p.eid,showIf:n,children:[u.jsxs(Hn,{value:p.state.value,onValueChange:p.state.set,disabled:t.isReadOnly,children:[u.jsx(Dn,{id:p.eid,children:u.jsx(Wn,{placeholder:"Select OneSync option"})}),u.jsxs(Ln,{children:[u.jsx(Se,{value:"on",children:"On (recommended)"}),u.jsx(Se,{value:"legacy",children:"Legacy"}),u.jsx(Se,{value:"off",children:"Off"})]})]}),u.jsxs(dt,{children:["Most servers should be using ",u.jsx("strong",{children:"OneSync On"}),". ",u.jsx("br",{}),"The other options are considered deprecated and should not be used unless you know what you're doing. For more information, please read the ",u.jsx(kn,{href:"https://docs.fivem.net/docs/scripting-reference/onesync/",children:"documentation"}),"."]})]}),u.jsxs(ht,{label:"Autostart",showIf:n,children:[u.jsx(wr,{id:x.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",checked:x.state.value,onCheckedChange:x.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Start the server automatically after ",u.jsx("strong",{children:"txAdmin"})," starts."]})]}),u.jsxs(ht,{label:"Resource Starting Tolerance",htmlFor:b.eid,showIf:n,children:[u.jsxs(Hn,{value:C.toUi(b.state.value),onValueChange:L=>b.state.set(C.toCfg(L)),disabled:t.isReadOnly,children:[u.jsx(Dn,{id:b.eid,children:u.jsx(Wn,{placeholder:"Select..."})}),u.jsxs(Ln,{children:[u.jsx(Se,{value:"90",children:"1.5 minutes (default)"}),u.jsx(Se,{value:"180",children:"3 minutes"}),u.jsx(Se,{value:"300",children:"5 minutes"}),u.jsx(Se,{value:"600",children:"10 minutes"})]})]}),u.jsxs(dt,{children:["At server boot, how much time to wait for any single resource to start before restarting the server. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," If you are getting ",u.jsx(Ye,{children:"failed to start in time"})," errors, increase this value."]})]})]})}function oOe({cardCtx:e,pageCtx:t}){const[n,r]=w.useState(!1),i=Xl(t.apiData),s=i("gameFeatures","menuEnabled"),a=i("gameFeatures","menuAlignRight"),o=i("gameFeatures","menuPageKey"),l=i("gameFeatures","playerModePtfx"),c=()=>{if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};const f=Ql([[s,s.state.value],[a,a.state.value],[o,o.state.value],[l,l.state.value]]);return t.setCardPendingSave(f.hasChanges?e:null),f},h=()=>{const{changedConfigs:f,hasChanges:m,localConfigs:_}=c();m&&t.saveChanges(e,_)};w.useEffect(()=>{c()},[n,s.state.value,a.state.value,o.state.value,l.state.value]),w.useEffect(()=>{n||l.state.discard()},[n]);const d=f=>{f.metaKey||f.preventDefault(),["Escape","Backspace"].includes(f.code)?o.state.set("Tab"):o.state.set(f.code)};return u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:h,advanced:{showing:n,toggle:r},children:[u.jsxs(ht,{label:"Game Menu",children:[u.jsx(wr,{id:s.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:s.state.value,onCheckedChange:s.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["When enabled, admins will be able to open the menu by typing ",u.jsx(Ye,{children:"/tx"})," or using the keybind configured in the FiveM/RedM settings."]})]}),u.jsxs(ht,{label:"Align Menu Right",children:[u.jsx(wr,{id:a.eid,checkedLabel:"Right aligned",uncheckedLabel:"Left aligned",checked:a.state.value,onCheckedChange:a.state.set,disabled:t.isReadOnly}),u.jsx(dt,{children:"Move menu to the right side of the screen."})]}),u.jsxs(ht,{label:"Menu Page Switch Key",htmlFor:o.eid,required:!0,children:[u.jsx(wt,{id:o.eid,value:o.state.value,placeholder:"click here and use the key to change",onKeyDown:d,className:"font-mono",readOnly:!0,onInput:c,disabled:t.isReadOnly}),u.jsxs(dt,{children:["The key used to to switch tabs in the menu. ",u.jsx("br",{}),"Click above and press any key to change the configuration. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"})," The default is ",u.jsx(Ye,{children:"Tab"}),", and you cannot use ",u.jsx(Ye,{children:"Escape"})," or ",u.jsx(Ye,{children:"Backspace"}),"."]})]}),n&&u.jsx(r3,{}),u.jsxs(ht,{label:"Player Mode Change Effect",showIf:n,children:[u.jsx(wr,{id:l.eid,checkedLabel:"Enabled",uncheckedLabel:"Disabled",variant:"checkedGreen",checked:l.state.value,onCheckedChange:l.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Play a particle effect and sound when an admin uses NoClip, God Mode, etc. ",u.jsx("br",{}),u.jsx("strong",{className:"text-warning-inline",children:"Warning:"})," This options help prevent admin abuse during PvP by making it visible/audible to all players that an admin is using a special mode. We recommend keeping it enabled."]})]})]})}function aOe({cardCtx:e,pageCtx:t}){const n=Xl(t.apiData),r=n("gameFeatures","hideAdminInPunishments"),i=n("gameFeatures","hideAdminInMessages"),s=n("gameFeatures","hideDefaultAnnouncement"),a=n("gameFeatures","hideDefaultDirectMessage"),o=n("gameFeatures","hideDefaultWarning"),l=n("gameFeatures","hideDefaultScheduledRestartWarning"),c=()=>{if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};const d=Ql([[r,r.state.value],[i,i.state.value],[s,s.state.value],[a,a.state.value],[o,o.state.value],[l,l.state.value]]);return t.setCardPendingSave(d.hasChanges?e:null),d},h=()=>{const{changedConfigs:d,hasChanges:f,localConfigs:m}=c();f&&t.saveChanges(e,m)};return w.useEffect(()=>{c()},[r.state.value,i.state.value,s.state.value,a.state.value,o.state.value,l.state.value]),u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:h,children:[u.jsxs(ht,{label:"Hide Admin Name In Punishments",children:[u.jsx(wr,{id:r.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:r.state.value,onCheckedChange:r.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Never show to the players the admin name on ",u.jsx("strong",{children:"Bans"})," or ",u.jsx("strong",{children:"Warns"}),". ",u.jsx("br",{}),"This information will still be available in the history and logs."]})]}),u.jsxs(ht,{label:"Hide Admin Name In Messages",children:[u.jsx(wr,{id:i.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:i.state.value,onCheckedChange:i.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Do not show the admin name on ",u.jsx("strong",{children:"Announcements"})," or ",u.jsx("strong",{children:"DMs"}),". ",u.jsx("br",{}),"This information will still be available in the live console and logs."]})]}),u.jsxs(ht,{label:"Hide Announcement Notifications",children:[u.jsx(wr,{id:s.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:s.state.value,onCheckedChange:s.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Suppresses the display of announcements, allowing you to implement your own announcement via the event ",u.jsx(Ye,{children:"txAdmin:events:announcement"}),".",u.jsx(kn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsannouncement",children:"Documentation"})]})]}),u.jsxs(ht,{label:"Hide Direct Message Notification",children:[u.jsx(wr,{id:a.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:a.state.value,onCheckedChange:a.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Suppresses the display of direct messages, allowing you to implement your own direct message notification via the event ",u.jsx(Ye,{children:"txAdmin:events:playerDirectMessage"}),".",u.jsx(kn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsplayerdirectmessage",children:"Documentation"})]})]}),u.jsxs(ht,{label:"Hide Warning Notification",children:[u.jsx(wr,{id:o.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:o.state.value,onCheckedChange:o.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Suppresses the display of warnings, allowing you to implement your own warning via the event ",u.jsx(Ye,{children:"txAdmin:events:playerWarned"}),".",u.jsx(kn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsplayerwarned",children:"Documentation"})]})]}),u.jsxs(ht,{label:"Hide Scheduled Restart Warnings",children:[u.jsx(wr,{id:l.eid,checkedLabel:"Hidden",uncheckedLabel:"Visible",checked:l.state.value,onCheckedChange:l.state.set,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Suppresses the display of scheduled restart warnings, allowing you to implement your own warning via the event ",u.jsx(Ye,{children:"txAdmin:events:scheduledRestart"}),".",u.jsx(kn,{href:"https://aka.cfx.re/txadmin-events#txadmineventsscheduledrestart",children:"Documentation"})]})]})]})}const lOe=()=>{const e=Array.isArray(window.txBrowserLocale)?window.txBrowserLocale[0]:window.txBrowserLocale;try{return new Intl.Locale(e).language}catch{}try{if(e.includes("-"))return e.split("-")[0]}catch{}};function cOe({cardCtx:e,pageCtx:t}){const n=w.useMemo(()=>{var m,_;if(!((m=t.apiData)!=null&&m.locales))return null;const c=lOe();let h,d,f=[];for(const v of(_=t.apiData)==null?void 0:_.locales)v.code==="en"?h=v:v.code===c?d={code:v.code,label:`${v.label} (browser)`}:f.push(v);return[h,d,"sep1",...f,"sep2",{code:"custom",label:"Custom (txData/locale.json)"}].filter(Boolean)},[t.apiData]),r=Xl(t.apiData),i=r("general","serverName"),s=w.useRef(null),a=r("general","language"),o=()=>{var h;if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};const c=Ql([[i,(h=s.current)==null?void 0:h.value],[a,a.state.value]]);return t.setCardPendingSave(c.hasChanges?e:null),c},l=()=>{var f,m,_;const{changedConfigs:c,hasChanges:h,localConfigs:d}=o();if(h){if(!((f=d.general)!=null&&f.serverName))return qe.error("The Server Name is required.");if(((_=(m=d.general)==null?void 0:m.serverName)==null?void 0:_.length)>18)return qe.error("The Server Name is too big.");t.saveChanges(e,d)}};return w.useEffect(()=>{o()},[a.state.value]),u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:l,children:[u.jsxs(ht,{label:"Server Name",htmlFor:i.eid,required:!0,children:[u.jsx(wt,{id:i.eid,ref:s,defaultValue:i.initialValue,placeholder:"Example RP",onInput:o,disabled:t.isReadOnly}),u.jsxs(dt,{children:["A ",u.jsx("strong",{children:"short"})," server name to be used in the txAdmin interface and Server/Discord messages. ",u.jsx("br",{}),"The name must be between 1 and 18 characters."]})]}),u.jsxs(ht,{label:"Language",htmlFor:a.eid,required:!0,children:[u.jsxs(Hn,{value:a.state.value,onValueChange:a.state.set,disabled:t.isReadOnly,children:[u.jsx(Dn,{id:a.eid,children:u.jsx(Wn,{placeholder:"Select..."})}),u.jsx(Ln,{children:n==null?void 0:n.map(c=>typeof c=="object"?u.jsx(Se,{value:c.code,children:c.label},c.code):u.jsx(Q5,{},c))})]}),u.jsxs(dt,{children:["The language to use on Chat/Discord messages. ",u.jsx("br",{}),"You can customize the phrases/words by using the ",u.jsx(Ye,{children:"Custom"})," option. ",u.jsx("br",{}),"For more information, please read the ",u.jsx(kn,{href:"https://github.com/tabarra/txAdmin/blob/master/docs/translation.md",children:"documentation"}),"."]})]})]})}var i3="Radio",[uOe,HH]=Un(i3),[dOe,hOe]=uOe(i3),WH=w.forwardRef((e,t)=>{const{__scopeRadio:n,name:r,checked:i=!1,required:s,disabled:a,value:o="on",onCheck:l,form:c,...h}=e,[d,f]=w.useState(null),m=We(t,y=>f(y)),_=w.useRef(!1),v=d?c||!!d.closest("form"):!0;return u.jsxs(dOe,{scope:n,checked:i,disabled:a,children:[u.jsx(Ee.button,{type:"button",role:"radio","aria-checked":i,"data-state":qH(i),"data-disabled":a?"":void 0,disabled:a,value:o,...h,ref:m,onClick:fe(e.onClick,y=>{i||l==null||l(),v&&(_.current=y.isPropagationStopped(),_.current||y.stopPropagation())})}),v&&u.jsx(fOe,{control:d,bubbles:!_.current,name:r,value:o,checked:i,required:s,disabled:a,form:c,style:{transform:"translateX(-100%)"}})]})});WH.displayName=i3;var UH="RadioIndicator",VH=w.forwardRef((e,t)=>{const{__scopeRadio:n,forceMount:r,...i}=e,s=hOe(UH,n);return u.jsx(xn,{present:r||s.checked,children:u.jsx(Ee.span,{"data-state":qH(s.checked),"data-disabled":s.disabled?"":void 0,...i,ref:t})})});VH.displayName=UH;var fOe=e=>{const{control:t,checked:n,bubbles:r=!0,...i}=e,s=w.useRef(null),a=xp(n),o=h1(t);return w.useEffect(()=>{const l=s.current,c=window.HTMLInputElement.prototype,d=Object.getOwnPropertyDescriptor(c,"checked").set;if(a!==n&&d){const f=new Event("click",{bubbles:r});d.call(l,n),l.dispatchEvent(f)}},[a,n,r]),u.jsx("input",{type:"radio","aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...e.style,...o,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function qH(e){return e?"checked":"unchecked"}var pOe=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],s3="RadioGroup",[mOe,r$e]=Un(s3,[rd,HH]),GH=rd(),KH=HH(),[gOe,vOe]=mOe(s3),YH=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,name:r,defaultValue:i,value:s,required:a=!1,disabled:o=!1,orientation:l,dir:c,loop:h=!0,onValueChange:d,...f}=e,m=GH(n),_=Al(c),[v,y]=fi({prop:s,defaultProp:i,onChange:d});return u.jsx(gOe,{scope:n,name:r,required:a,disabled:o,value:v,onValueChange:y,children:u.jsx(L5,{asChild:!0,...m,orientation:l,dir:_,loop:h,children:u.jsx(Ee.div,{role:"radiogroup","aria-required":a,"aria-orientation":l,"data-disabled":o?"":void 0,dir:_,...f,ref:t})})})});YH.displayName=s3;var XH="RadioGroupItem",QH=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,disabled:r,...i}=e,s=vOe(XH,n),a=s.disabled||r,o=GH(n),l=KH(n),c=w.useRef(null),h=We(t,c),d=s.value===i.value,f=w.useRef(!1);return w.useEffect(()=>{const m=v=>{pOe.includes(v.key)&&(f.current=!0)},_=()=>f.current=!1;return document.addEventListener("keydown",m),document.addEventListener("keyup",_),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keyup",_)}},[]),u.jsx(N5,{asChild:!0,...o,focusable:!a,active:d,children:u.jsx(WH,{disabled:a,required:s.required,checked:d,...l,...i,name:s.name,ref:h,onCheck:()=>s.onValueChange(i.value),onKeyDown:fe(m=>{m.key==="Enter"&&m.preventDefault()}),onFocus:fe(i.onFocus,()=>{var m;f.current&&((m=c.current)==null||m.click())})})})});QH.displayName=XH;var yOe="RadioGroupIndicator",JH=w.forwardRef((e,t)=>{const{__scopeRadioGroup:n,...r}=e,i=KH(n);return u.jsx(VH,{...i,...r,ref:t})});JH.displayName=yOe;var ZH=YH,eW=QH,xOe=JH;const tW=w.forwardRef(({className:e,...t},n)=>u.jsx(ZH,{className:J("grid gap-2",e),...t,ref:n}));tW.displayName=ZH.displayName;const nW=w.forwardRef(({className:e,...t},n)=>u.jsx(eW,{ref:n,className:J("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),...t,children:u.jsx(xOe,{className:"flex items-center justify-center",children:u.jsx(bL,{className:"h-2.5 w-2.5 fill-current text-current"})})}));nW.displayName=eW.displayName;function nh(e){const t="radio"+w.useId();return u.jsx("div",{className:"group",children:u.jsxs(Tn,{htmlFor:t,className:"flex items-center gap-3 border rounded-lg p-3 cursor-pointer hover:bg-card data-[state=checked]:border-primary/50 data-[state=checked]:bg-muted select-none","data-state":e.groupValue===e.value?"checked":"unchecked",children:[u.jsx(nW,{value:e.value,id:t}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("span",{className:"font-bold",children:e.title}),u.jsx("p",{className:"text-sm text-muted-foreground",children:e.desc})]})]})})}const Ym="123456789ABCDEFGHJKLMNPQRSTUVWXYZ",lj=/^\d{17,20}$/,Xr={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:lj,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,regexValidFivemUsername:/^\w[\w.-]{1,18}\w$/,regexActionID:new RegExp(`^[${Ym}]{4}-[${Ym}]{4}$`),regexWhitelistReqID:new RegExp(`R[${Ym}]{4}`),regexDiscordSnowflake:lj,regexSvLicenseOld:/^\w{32}$/,regexSvLicenseNew:/^cfxk_\w{1,60}_\w{1,20}$/,regexValidIP:/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,actionIdAlphabet:Ym,nuiWebpipePath:"https://monitor/WebPipe/",regexCustomThemeName:/^[a-z0-9]+(-[a-z0-9]+)*$/};function _Oe({cardCtx:e,pageCtx:t}){const n=Xl(t.apiData),r=n("whitelist","mode"),i=n("whitelist","rejectionMessage"),s=w.useRef(null),a=n("whitelist","discordRoles"),o=w.useRef(null),l={toUi:d=>d?d.join(", "):void 0,toCfg:d=>d?d.split(/[,;]\s*/).map(f=>f.trim()).filter(f=>f.length):void 0},c=()=>{var m;if(!t.apiData)return{changedConfigs:{},hasChanges:!1,localConfigs:{}};let d;o.current&&(d=l.toCfg(o.current.value));const f=Ql([[r,r.state.value],[i,(m=s.current)==null?void 0:m.textArea.value],[a,d]]);return t.setCardPendingSave(f.hasChanges?e:null),f},h=()=>{var _,v,y,g,p,x,b,S,C;const{changedConfigs:d,hasChanges:f,localConfigs:m}=c();if(f){if((_=m.whitelist)!=null&&_.rejectionMessage&&m.whitelist.rejectionMessage.length>512)return qe.error({title:"The Whitelist Rejection Message is too big.",md:!0,msg:"The message must be 512 characters or less."});if(((v=m.whitelist)==null?void 0:v.mode)==="discordMember"||((y=m.whitelist)==null?void 0:y.mode)==="discordRoles"){if(((p=(g=t.apiData)==null?void 0:g.storedConfigs.discordBot)==null?void 0:p.enabled)!==!0)return qe.warning({title:"Discord Bot is required.",msg:"You need to enable the Discord Bot in the Discord tab to use Discord-based whitelist modes."});if(((x=m.whitelist)==null?void 0:x.mode)==="discordRoles"&&(!Array.isArray((b=m.whitelist)==null?void 0:b.discordRoles)||!((S=m.whitelist)!=null&&S.discordRoles.length)))return qe.warning({title:"Discord Roles are required.",msg:'You need to specify at least one Discord Role ID to use the "Discord Server Roles" whitelist mode.'})}if(Array.isArray((C=m.whitelist)==null?void 0:C.discordRoles)){const E=m.whitelist.discordRoles.filter(k=>!Xr.regexDiscordSnowflake.test(k)).map(k=>`- \`${k.slice(0,20)}\``);if(E.length)return qe.error({title:"Invalid Discord Role ID(s).",md:!0,msg:`The following Discord Role ID(s) are invalid: `+E.join(` `)})}t.saveChanges(e,m)}};return w.useEffect(()=>{c()},[r.state.value]),u.jsxs(Yl,{cardCtx:e,pageCtx:t,onClickSave:h,children:[u.jsx(ht,{label:"Whitelist Mode",children:u.jsxs(tW,{value:r.state.value,onValueChange:r.state.set,disabled:t.isReadOnly,children:[u.jsx(nh,{groupValue:r.state.value,value:"disabled",title:"Disabled",desc:"No whitelist status will be checked by txAdmin."}),u.jsx(nh,{groupValue:r.state.value,value:"adminOnly",title:"Admin-only (maintenance mode)",desc:u.jsxs(u.Fragment,{children:["Will only allow server join if your ",u.jsx(Ye,{children:"fivem:"})," or ",u.jsx(Ye,{children:"discord:"})," identifiers are attached to a txAdmin administrator. Also known as maintenance mode."]})}),u.jsx(nh,{groupValue:r.state.value,value:"discordMember",title:"Discord Server Member",desc:u.jsxs(u.Fragment,{children:["Checks if the player joining has a ",u.jsx(Ye,{children:"discord:"})," identifier and is present in the Discord server configured in the Discord Tab."]})}),u.jsx(nh,{groupValue:r.state.value,value:"discordRoles",title:"Discord Server Roles",desc:u.jsxs(u.Fragment,{children:["Checks if the player joining has a ",u.jsx(Ye,{children:"discord:"})," identifier and is present in the Discord server configured in the Discord Tab and has at least one of the roles specified below."]})}),u.jsx(nh,{groupValue:r.state.value,value:"approvedLicense",title:"Approved License",desc:u.jsxs(u.Fragment,{children:["The player ",u.jsx(Ye,{children:"license:"})," identifier must be whitelisted by a txAdmin administrator. This can be done through the ",u.jsx(kn,{href:"/whitelist",children:"Whitelist page"}),", or the ",u.jsx(Ye,{children:"/whitelist"})," Discord bot slash command."]})})]})}),u.jsxs(ht,{label:"Whitelist Rejection Message",htmlFor:i.eid,showOptional:!0,children:[u.jsx(Ep,{id:i.eid,ref:s,placeholder:"Please join http://discord.gg/example and request to be whitelisted.",defaultValue:i.initialValue,onInput:c,autoComplete:"off",minHeight:60,maxHeight:180,disabled:t.isReadOnly}),u.jsxs(dt,{children:["Optional message to display to a player on the rejection message that shows when they try to connect while not being whitelisted. ",u.jsx("br",{}),"If you have a Discord whitelisting process, include here a invite link."]})]}),u.jsxs(ht,{label:"Whitelisted Discord Roles",htmlFor:a.eid,children:[u.jsx(wt,{id:a.eid,ref:o,defaultValue:l.toUi(a.initialValue),placeholder:"000000000000000000, 000000000000000000",onInput:c,disabled:t.isReadOnly}),u.jsxs(dt,{children:["The ID of the Discord roles that are whitelisted to join the server. ",u.jsx("br",{}),"This field supports multiple roles, separated by comma. ",u.jsx("br",{}),u.jsx("strong",{children:"Note:"}),' Requires the whitelist mode to be set to "Discord Server Roles".']})]})]})}const bOe=[{name:"General",Component:cOe},{name:"FXServer",Component:sOe},{name:"Bans",Component:JPe},{name:"Whitelist",Component:_Oe},{name:"Discord",Component:ZPe},{name:"Game",cards:[{name:"Menu",Component:oOe},{name:"Notifications",Component:aOe}]}],cj=e=>e.toLowerCase().replace(/[^a-z0-9]/g,"-"),Xm=bOe.map(e=>{const t={tabId:cj(e.name),tabName:e.name};return"cards"in e&&e.cards?{ctx:t,cards:e.cards.map(n=>({ctx:{...t,cardId:`${t.tabId}-${cj(n.name)}`,cardName:n.name,cardTitle:`${t.tabName} ${n.name}`},Component:n.Component}))}:{ctx:{...t,cardId:t.tabId,cardName:t.tabName,cardTitle:t.tabName},Component:e.Component}});function wOe(){var _;const[e,t]=w.useState(null),[n,r]=w.useState(!1),i=lp(),{hasPerm:s}=fr(),[a,o]=w.useState(()=>{var y,g;const v=(y=window.location)==null?void 0:y.hash.slice(1);return((g=Xm.find(p=>p.ctx.tabId===v))==null?void 0:g.ctx.tabId)??Xm[0].ctx.tabId}),l=Tt({method:"GET",path:"/settings/configs",throwGenericErrors:!0}),c=Tt({method:"POST",path:"/settings/configs/:card",throwGenericErrors:!0}),h=fp("/settings/configs",async()=>{const v=await l({});if(!v)throw new Error("No data returned");return v},{revalidateOnMount:!0,revalidateOnFocus:!1}),d=async(v,y)=>{if(n)return;const g=qe.loading(`Saving ${v.cardTitle} settings...`,{id:"settingsSave"});r(!0);try{if(!h.data)throw new Error("Cannot save changes without swr.data.");const p=await c({pathParams:{card:v.cardId},data:y,timeout:v.cardId==="discord"?Pv.REALLY_REALLY_LONG:Pv.LONG,toastId:g});if(!p)throw new Error("empty_response");if(p.type==="error")return;if(!p.stored)throw new Error("no_stored_data");if(!p.changelog)throw new Error("no_changelog_data");h.mutate({...h.data,storedConfigs:p.stored,changelog:p.changelog},!1),t(null)}catch(p){qe.error({title:`Error saving ${v.cardTitle} settings:`,msg:p.message},{id:g})}finally{r(!1)}},f=v=>{t(null),o(v),Cie(v)},m=v=>{e&&v&&v!==(e==null?void 0:e.tabId)?i({title:"Discard Changes",actionLabel:"Discard",confirmBtnVariant:"destructive",message:u.jsxs(u.Fragment,{children:["You have unsaved changes in the ",u.jsx("strong",{children:e.cardTitle})," tab. ",u.jsx("br",{}),"Are you sure you want to discard them?"]}),onConfirm:()=>{f(v)}}):f(v)};return u.jsxs("div",{className:"w-full mb-10",children:[u.jsx(zPe,{changelogData:(_=h==null?void 0:h.data)==null?void 0:_.changelog}),u.jsx("div",{className:"px-0 xs:px-3 md:px-0 flex flex-row gap-2 w-full",children:u.jsxs(PH,{value:a,onValueChange:m,className:"w-full",children:[u.jsx(t3,{className:"max-xs:sticky max-xs:top-navbarvh z-10 flex-wrap h-[unset] max-xs:w-full max-xs:rounded-none",children:Xm.map(v=>u.jsx(y0,{value:v.ctx.tabId,className:"hover:text-primary",children:v.ctx.tabName},v.ctx.tabId))}),Xm.map(v=>u.jsx(sx,{value:v.ctx.tabId,className:"mt-6",children:u.jsx($Pe,{tab:v,pageCtx:{apiData:h.data,isReadOnly:h.isLoading||n||!h.data||!s("settings.write"),isLoading:h.isLoading,isSaving:n,swrError:h.error?h.error.message:void 0,cardPendingSave:e,setCardPendingSave:t,saveChanges:d}})},v.ctx.tabId))]})})]})}function SOe({permission:e}){return u.jsxs(qs,{children:[u.jsx(Gs,{className:"underline decoration-dotted cursor-help tracking-wider",children:"permission"}),u.jsx(os,{children:e})]})}function COe({pageName:e,permission:t}){let n;return t==="master"?n=u.jsxs(u.Fragment,{children:["You need to be the Master account to view the ",u.jsx("strong",{className:"text-accent",children:e})," page."]}):n=u.jsxs(u.Fragment,{children:["You don't have the required ",u.jsx(SOe,{permission:t})," to view the ",u.jsx("strong",{className:"text-accent",children:e})," page. ",u.jsx("br",{}),"Please contact your server owner if you believe this is an error."]}),u.jsx("div",{className:"w-full px-4 pt-[7.5vh] flex items-start justify-center bg-background",children:u.jsxs("div",{className:"mx-auto max-w-xl text-center border border-destructive/50 rounded-lg p-6 bg-destructive-hint/15 space-y-4",children:[u.jsxs("h1",{className:"text-2xl font-bold tracking-tight text-destructive",children:[u.jsx(EL,{className:"size-6 mr-2 mt-0.5 inline align-text-top"}),"Access Denied"]}),u.jsx("p",{className:"mt-4 text-sm text-primary/90 tracking-wide",children:n}),u.jsx(De,{variant:"outline",size:"sm",asChild:!0,children:u.jsx(fs,{href:"/",children:"Return to Dashboard"})})]})})}const kOe=[{path:"/players",title:"Players",Page:u.jsx(vce,{})},{path:"/history",title:"History",Page:u.jsx(Jce,{})},{path:"/insights/player-drops",title:"Player Drops",Page:u.jsx(NPe,{})},{path:"/whitelist",title:"Whitelist",Page:u.jsx(Ui,{legacyUrl:"whitelist"})},{path:"/admins",title:"Admins",Page:u.jsx(Ui,{legacyUrl:"adminManager"})},{path:"/settings",title:"Settings",permission:"settings.view",Page:u.jsx(wOe,{})},{path:"/system/master-actions",title:"Master Actions",Page:u.jsx(Ui,{legacyUrl:"masterActions"})},{path:"/system/diagnostics",title:"Diagnostics",Page:u.jsx(Ui,{legacyUrl:"diagnostics"})},{path:"/system/console-log",title:"Console Log",permission:"txadmin.log.view",Page:u.jsx(ZR,{pageName:"console"})},{path:"/system/action-log",title:"Action Log",permission:"txadmin.log.view",Page:u.jsx(ZR,{pageName:"action"})},{path:"/",title:"Dashboard",Page:u.jsx(qNe,{})},{path:"/server/console",title:"Live Console",permission:"console.view",Page:u.jsx(Xie,{})},{path:"/server/resources",title:"Resources",Page:u.jsx(Ui,{legacyUrl:"resources"})},{path:"/server/server-log",title:"Server Log",permission:"server.log.view",Page:u.jsx(Ui,{legacyUrl:"serverLog"})},{path:"/server/cfg-editor",title:"CFG Editor",permission:"server.cfg.editor",Page:u.jsx(Ui,{legacyUrl:"cfgEditor"})},{path:"/server/setup",title:"Server Setup",permission:"master",Page:u.jsx(Ui,{legacyUrl:"setup"})},{path:"/server/deployer",title:"Server Deployer",permission:"master",Page:u.jsx(Ui,{legacyUrl:"deployer"})},{path:"/advanced",title:"Advanced",permission:"all_permissions",Page:u.jsx(Ui,{legacyUrl:"advanced"})},{path:"/settings/ban-templates",title:"Ban Templates",Page:u.jsx(Ahe,{})},{path:"/ban-identifiers",title:"Ban Identifiers",Page:u.jsx(Lhe,{})}];function EOe(e){const{hasPerm:t}=fr();rL()(e.title);const r=e.permission&&!t(e.permission)?u.jsx(COe,{pageName:e.title,permission:e.permission}):e.Page;return u.jsx(Pa,{path:e.path,children:r})}function TOe(){return u.jsxs(r7,{children:[kOe.map(e=>u.jsx(EOe,{...e},e.path)),!1,u.jsx(Pa,{component:yX})]})}function ROe(){const e=it(tL),t=ct(eL);return u.jsx(Wj,{FallbackComponent:GY,onError:()=>{console.log("Page ErrorBoundary caught an error"),e(!0)},onReset:()=>{console.log("Page ErrorBoundary reset"),dC("/"),e(!1)},children:u.jsx(TOe,{})},t)}var Sd="NavigationMenu",[o3,rW,MOe]=pp(Sd),[lS,AOe,jOe]=pp(Sd),[a3,i$e]=Un(Sd,[MOe,jOe]),[DOe,gi]=a3(Sd),[LOe,NOe]=a3(Sd),iW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,delayDuration:a=200,skipDelayDuration:o=300,orientation:l="horizontal",dir:c,...h}=e,[d,f]=w.useState(null),m=We(t,T=>f(T)),_=Al(c),v=w.useRef(0),y=w.useRef(0),g=w.useRef(0),[p,x]=w.useState(!0),[b="",S]=fi({prop:r,onChange:T=>{const R=T!=="",M=o>0;R?(window.clearTimeout(g.current),M&&x(!1)):(window.clearTimeout(g.current),g.current=window.setTimeout(()=>x(!0),o)),i==null||i(T)},defaultProp:s}),C=w.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>S(""),150)},[S]),E=w.useCallback(T=>{window.clearTimeout(y.current),S(T)},[S]),k=w.useCallback(T=>{b===T?window.clearTimeout(y.current):v.current=window.setTimeout(()=>{window.clearTimeout(y.current),S(T)},a)},[b,S,a]);return w.useEffect(()=>()=>{window.clearTimeout(v.current),window.clearTimeout(y.current),window.clearTimeout(g.current)},[]),u.jsx(oW,{scope:n,isRootMenu:!0,value:b,dir:_,orientation:l,rootNavigationMenu:d,onTriggerEnter:T=>{window.clearTimeout(v.current),p?k(T):E(T)},onTriggerLeave:()=>{window.clearTimeout(v.current),C()},onContentEnter:()=>window.clearTimeout(y.current),onContentLeave:C,onItemSelect:T=>{S(R=>R===T?"":T)},onItemDismiss:()=>S(""),children:u.jsx(Ee.nav,{"aria-label":"Main","data-orientation":l,dir:_,...h,ref:m})})});iW.displayName=Sd;var sW="NavigationMenuSub",POe=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,onValueChange:i,defaultValue:s,orientation:a="horizontal",...o}=e,l=gi(sW,n),[c="",h]=fi({prop:r,onChange:i,defaultProp:s});return u.jsx(oW,{scope:n,isRootMenu:!1,value:c,dir:l.dir,orientation:a,rootNavigationMenu:l.rootNavigationMenu,onTriggerEnter:d=>h(d),onItemSelect:d=>h(d),onItemDismiss:()=>h(""),children:u.jsx(Ee.div,{"data-orientation":a,...o,ref:t})})});POe.displayName=sW;var oW=e=>{const{scope:t,isRootMenu:n,rootNavigationMenu:r,dir:i,orientation:s,children:a,value:o,onItemSelect:l,onItemDismiss:c,onTriggerEnter:h,onTriggerLeave:d,onContentEnter:f,onContentLeave:m}=e,[_,v]=w.useState(null),[y,g]=w.useState(new Map),[p,x]=w.useState(null);return u.jsx(DOe,{scope:t,isRootMenu:n,rootNavigationMenu:r,value:o,previousValue:xp(o),baseId:zr(),dir:i,orientation:s,viewport:_,onViewportChange:v,indicatorTrack:p,onIndicatorTrackChange:x,onTriggerEnter:jt(h),onTriggerLeave:jt(d),onContentEnter:jt(f),onContentLeave:jt(m),onItemSelect:jt(l),onItemDismiss:jt(c),onViewportContentChange:w.useCallback((b,S)=>{g(C=>(C.set(b,S),new Map(C)))},[]),onViewportContentRemove:w.useCallback(b=>{g(S=>S.has(b)?(S.delete(b),new Map(S)):S)},[]),children:u.jsx(o3.Provider,{scope:t,children:u.jsx(LOe,{scope:t,items:y,children:a})})})},aW="NavigationMenuList",lW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=gi(aW,n),s=u.jsx(Ee.ul,{"data-orientation":i.orientation,...r,ref:t});return u.jsx(Ee.div,{style:{position:"relative"},ref:i.onIndicatorTrackChange,children:u.jsx(o3.Slot,{scope:n,children:i.isRootMenu?u.jsx(yW,{asChild:!0,children:s}):s})})});lW.displayName=aW;var cW="NavigationMenuItem",[OOe,uW]=a3(cW),dW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,...i}=e,s=zr(),a=r||s||"LEGACY_REACT_AUTO_VALUE",o=w.useRef(null),l=w.useRef(null),c=w.useRef(null),h=w.useRef(()=>{}),d=w.useRef(!1),f=w.useCallback((_="start")=>{if(o.current){h.current();const v=uS(o.current);v.length&&u3(_==="start"?v:v.reverse())}},[]),m=w.useCallback(()=>{if(o.current){const _=uS(o.current);_.length&&(h.current=WOe(_))}},[]);return u.jsx(OOe,{scope:n,value:a,triggerRef:l,contentRef:o,focusProxyRef:c,wasEscapeCloseRef:d,onEntryKeyDown:f,onFocusProxyEnter:f,onRootContentClose:m,onContentFocusOutside:m,children:u.jsx(Ee.li,{...i,ref:t})})});dW.displayName=cW;var cS="NavigationMenuTrigger",hW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,disabled:r,...i}=e,s=gi(cS,e.__scopeNavigationMenu),a=uW(cS,e.__scopeNavigationMenu),o=w.useRef(null),l=We(o,a.triggerRef,t),c=_W(s.baseId,a.value),h=bW(s.baseId,a.value),d=w.useRef(!1),f=w.useRef(!1),m=a.value===s.value;return u.jsxs(u.Fragment,{children:[u.jsx(o3.ItemSlot,{scope:n,value:a.value,children:u.jsx(xW,{asChild:!0,children:u.jsx(Ee.button,{id:c,disabled:r,"data-disabled":r?"":void 0,"data-state":d3(m),"aria-expanded":m,"aria-controls":h,...i,ref:l,onPointerEnter:fe(e.onPointerEnter,()=>{f.current=!1,a.wasEscapeCloseRef.current=!1}),onPointerMove:fe(e.onPointerMove,x0(()=>{r||f.current||a.wasEscapeCloseRef.current||d.current||(s.onTriggerEnter(a.value),d.current=!0)})),onPointerLeave:fe(e.onPointerLeave,x0(()=>{r||(s.onTriggerLeave(),d.current=!1)})),onClick:fe(e.onClick,()=>{s.onItemSelect(a.value),f.current=m}),onKeyDown:fe(e.onKeyDown,_=>{const y={horizontal:"ArrowDown",vertical:s.dir==="rtl"?"ArrowLeft":"ArrowRight"}[s.orientation];m&&_.key===y&&(a.onEntryKeyDown(),_.preventDefault())})})})}),m&&u.jsxs(u.Fragment,{children:[u.jsx(XO,{"aria-hidden":!0,tabIndex:0,ref:a.focusProxyRef,onFocus:_=>{const v=a.contentRef.current,y=_.relatedTarget,g=y===o.current,p=v==null?void 0:v.contains(y);(g||!p)&&a.onFocusProxyEnter(g?"start":"end")}}),s.viewport&&u.jsx("span",{"aria-owns":h})]})]})});hW.displayName=cS;var IOe="NavigationMenuLink",uj="navigationMenu.linkSelect",fW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,active:r,onSelect:i,...s}=e;return u.jsx(xW,{asChild:!0,children:u.jsx(Ee.a,{"data-active":r?"":void 0,"aria-current":r?"page":void 0,...s,ref:t,onClick:fe(e.onClick,a=>{const o=a.target,l=new CustomEvent(uj,{bubbles:!0,cancelable:!0});if(o.addEventListener(uj,c=>i==null?void 0:i(c),{once:!0}),lv(o,l),!l.defaultPrevented&&!a.metaKey){const c=new CustomEvent(Ng,{bubbles:!0,cancelable:!0});lv(o,c)}},{checkForDefaultPrevented:!1})})})});fW.displayName=IOe;var l3="NavigationMenuIndicator",pW=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=gi(l3,e.__scopeNavigationMenu),s=!!i.value;return i.indicatorTrack?VD.createPortal(u.jsx(xn,{present:n||s,children:u.jsx($Oe,{...r,ref:t})}),i.indicatorTrack):null});pW.displayName=l3;var $Oe=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=gi(l3,n),s=rW(n),[a,o]=w.useState(null),[l,c]=w.useState(null),h=i.orientation==="horizontal",d=!!i.value;w.useEffect(()=>{var v;const _=(v=s().find(y=>y.value===i.value))==null?void 0:v.ref.current;_&&o(_)},[s,i.value]);const f=()=>{a&&c({size:h?a.offsetWidth:a.offsetHeight,offset:h?a.offsetLeft:a.offsetTop})};return dS(a,f),dS(i.indicatorTrack,f),l?u.jsx(Ee.div,{"aria-hidden":!0,"data-state":d?"visible":"hidden","data-orientation":i.orientation,...r,ref:t,style:{position:"absolute",...h?{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}),Iu="NavigationMenuContent",mW=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=gi(Iu,e.__scopeNavigationMenu),s=uW(Iu,e.__scopeNavigationMenu),a=We(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?u.jsx(BOe,{forceMount:n,...l,ref:a}):u.jsx(xn,{present:n||o,children:u.jsx(gW,{"data-state":d3(o),...l,ref:a,onPointerEnter:fe(e.onPointerEnter,i.onContentEnter),onPointerLeave:fe(e.onPointerLeave,x0(i.onContentLeave)),style:{pointerEvents:!o&&i.isRootMenu?"none":void 0,...l.style}})})});mW.displayName=Iu;var BOe=w.forwardRef((e,t)=>{const n=gi(Iu,e.__scopeNavigationMenu),{onViewportContentChange:r,onViewportContentRemove:i}=n;return pn(()=>{r(e.value,{ref:t,...e})},[e,t,r]),pn(()=>()=>i(e.value),[e.value,i]),null}),Ng="navigationMenu.rootContentDismiss",gW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,value:r,triggerRef:i,focusProxyRef:s,wasEscapeCloseRef:a,onRootContentClose:o,onContentFocusOutside:l,...c}=e,h=gi(Iu,n),d=w.useRef(null),f=We(d,t),m=_W(h.baseId,r),_=bW(h.baseId,r),v=rW(n),y=w.useRef(null),{onItemDismiss:g}=h;w.useEffect(()=>{const x=d.current;if(h.isRootMenu&&x){const b=()=>{var S;g(),o(),x.contains(document.activeElement)&&((S=i.current)==null||S.focus())};return x.addEventListener(Ng,b),()=>x.removeEventListener(Ng,b)}},[h.isRootMenu,e.value,i,g,o]);const p=w.useMemo(()=>{const b=v().map(R=>R.value);h.dir==="rtl"&&b.reverse();const S=b.indexOf(h.value),C=b.indexOf(h.previousValue),E=r===h.value,k=C===b.indexOf(r);if(!E&&!k)return y.current;const T=(()=>{if(S!==C){if(E&&C!==-1)return S>C?"from-end":"from-start";if(k&&S!==-1)return S>C?"to-start":"to-end"}return null})();return y.current=T,T},[h.previousValue,h.value,h.dir,v,r]);return u.jsx(yW,{asChild:!0,children:u.jsx(Zu,{id:_,"aria-labelledby":m,"data-motion":p,"data-orientation":h.orientation,...c,ref:f,disableOutsidePointerEvents:!1,onDismiss:()=>{var b;const x=new Event(Ng,{bubbles:!0,cancelable:!0});(b=d.current)==null||b.dispatchEvent(x)},onFocusOutside:fe(e.onFocusOutside,x=>{var S;l();const b=x.target;(S=h.rootNavigationMenu)!=null&&S.contains(b)&&x.preventDefault()}),onPointerDownOutside:fe(e.onPointerDownOutside,x=>{var E;const b=x.target,S=v().some(k=>{var T;return(T=k.ref.current)==null?void 0:T.contains(b)}),C=h.isRootMenu&&((E=h.viewport)==null?void 0:E.contains(b));(S||C||!h.isRootMenu)&&x.preventDefault()}),onKeyDown:fe(e.onKeyDown,x=>{var C;const b=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!b){const E=uS(x.currentTarget),k=document.activeElement,T=E.findIndex(D=>D===k),M=x.shiftKey?E.slice(0,T).reverse():E.slice(T+1,E.length);u3(M)?x.preventDefault():(C=s.current)==null||C.focus()}}),onEscapeKeyDown:fe(e.onEscapeKeyDown,x=>{a.current=!0})})})}),c3="NavigationMenuViewport",vW=w.forwardRef((e,t)=>{const{forceMount:n,...r}=e,s=!!gi(c3,e.__scopeNavigationMenu).value;return u.jsx(xn,{present:n||s,children:u.jsx(FOe,{...r,ref:t})})});vW.displayName=c3;var FOe=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,children:r,...i}=e,s=gi(c3,n),a=We(t,s.onViewportChange),o=NOe(Iu,e.__scopeNavigationMenu),[l,c]=w.useState(null),[h,d]=w.useState(null),f=l?(l==null?void 0:l.width)+"px":void 0,m=l?(l==null?void 0:l.height)+"px":void 0,_=!!s.value,v=_?s.value:s.previousValue;return dS(h,()=>{h&&c({width:h.offsetWidth,height:h.offsetHeight})}),u.jsx(Ee.div,{"data-state":d3(_),"data-orientation":s.orientation,...i,ref:a,style:{pointerEvents:!_&&s.isRootMenu?"none":void 0,"--radix-navigation-menu-viewport-width":f,"--radix-navigation-menu-viewport-height":m,...i.style},onPointerEnter:fe(e.onPointerEnter,s.onContentEnter),onPointerLeave:fe(e.onPointerLeave,x0(s.onContentLeave)),children:Array.from(o.items).map(([g,{ref:p,forceMount:x,...b}])=>{const S=v===g;return u.jsx(xn,{present:x||S,children:u.jsx(gW,{...b,ref:op(p,C=>{S&&C&&d(C)})})},g)})})}),zOe="FocusGroup",yW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=gi(zOe,n);return u.jsx(lS.Provider,{scope:n,children:u.jsx(lS.Slot,{scope:n,children:u.jsx(Ee.div,{dir:i.dir,...r,ref:t})})})}),dj=["ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],HOe="FocusGroupItem",xW=w.forwardRef((e,t)=>{const{__scopeNavigationMenu:n,...r}=e,i=AOe(n),s=gi(HOe,n);return u.jsx(lS.ItemSlot,{scope:n,children:u.jsx(Ee.button,{...r,ref:t,onKeyDown:fe(e.onKeyDown,a=>{if(["Home","End",...dj].includes(a.key)){let l=i().map(d=>d.ref.current);if([s.dir==="rtl"?"ArrowRight":"ArrowLeft","ArrowUp","End"].includes(a.key)&&l.reverse(),dj.includes(a.key)){const d=l.indexOf(a.currentTarget);l=l.slice(d+1)}setTimeout(()=>u3(l)),a.preventDefault()}})})})});function uS(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 u3(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}function WOe(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 dS(e,t){const n=jt(t);pn(()=>{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 d3(e){return e?"open":"closed"}function _W(e,t){return`${e}-trigger-${t}`}function bW(e,t){return`${e}-content-${t}`}function x0(e){return t=>t.pointerType==="mouse"?e(t):void 0}var wW=iW,SW=lW,UOe=dW,CW=hW,VOe=fW,kW=pW,EW=mW,TW=vW;const hS=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(wW,{ref:r,className:J("relative z-10 flex max-w-max flex-1 items-center justify-center",e),...n,children:[t,u.jsx(jW,{})]}));hS.displayName=wW.displayName;const fS=w.forwardRef(({className:e,...t},n)=>u.jsx(SW,{ref:n,className:J("group flex flex-1 list-none items-center justify-center space-x-1",e),...t}));fS.displayName=SW.displayName;const RW=UOe,qOe=co("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"),MW=w.forwardRef(({className:e,children:t,...n},r)=>u.jsxs(CW,{ref:r,className:J(qOe(),"group",e),...n,children:[t," ",u.jsx(Dl,{className:"relative top-[1px] ml-1 h-3 w-3 transition duration-200 group-data-[state=open]:rotate-180","aria-hidden":"true"})]}));MW.displayName=CW.displayName;const AW=w.forwardRef(({className:e,...t},n)=>u.jsx(EW,{ref:n,className:J("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}));AW.displayName=EW.displayName;const GOe=VOe,jW=w.forwardRef(({className:e,...t},n)=>u.jsx("div",{className:J("absolute left-0 top-full flex justify-center"),children:u.jsx(TW,{className:J("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})}));jW.displayName=TW.displayName;const KOe=w.forwardRef(({className:e,...t},n)=>u.jsx(kW,{ref:n,className:J("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:u.jsx("div",{className:"relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md"})}));KOe.displayName=kW.displayName;function YOe(e,t){const n=ct(tL),r=Y0(),i=Z0(),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 u.jsx(fs,{ref:t,href:e.href,onClick:s,className:e.className,children:e.children})}const h3=w.forwardRef(YOe);function Xn({href:e,children:t,className:n,disabled:r}){const[i]=$0(e);return r?u.jsxs(qs,{children:[u.jsx(Gs,{className:"cursor-help",children:u.jsx(De,{variant:"ghost",className:"w-full justify-start py-1",disabled:!0,children:t})}),u.jsxs(os,{side:"right",className:"text-destructive-inline text-center",children:["You do not have permission ",u.jsx("br",{}),"to access this page."]})]}):u.jsx(h3,{href:e,isActive:i,className:J(ap({variant:i?"secondary":"ghost"}),"w-full justify-start py-1",n),children:t})}function pS({href:e,children:t,className:n}){const[r]=$0(e);return u.jsx(h3,{href:e,isActive:r,className:n,children:t})}const hj=co("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 Sh(e){const[t]=$0(e.href);return u.jsx(GOe,{asChild:!0,active:t,children:e.disabled?u.jsxs(qs,{children:[u.jsx(Gs,{className:"cursor-help",children:u.jsx("a",{className:J(hj({variant:"default"}),"pointer-events-none opacity-50",e.className),children:e.children})}),u.jsxs(os,{side:"bottom",className:"text-destructive-inline text-center",children:["You do not have permission ",u.jsx("br",{}),"to access this page."]})]}):u.jsx(h3,{href:e.href,isActive:t,className:J(hj({variant:t?"secondary":"default"}),e.className),children:e.children})})}function fc(e){return u.jsx(RW,{children:u.jsx(Sh,{href:e.href,disabled:e.disabled,className:e.className,children:e.children})})}function XOe(){const{hasPerm:e}=fr();return u.jsxs("div",{className:"space-x-1 flex flex-row select-none",children:[u.jsx(hS,{children:u.jsxs(fS,{children:[u.jsx(fc,{href:"/players",children:"Players"}),u.jsx(fc,{href:"/history",children:"History"}),u.jsx(fc,{href:"/insights/player-drops",children:"Player Drops"}),u.jsx(fc,{href:"/whitelist",children:"Whitelist"}),u.jsx(fc,{href:"/admins",disabled:!e("manage.admins"),children:"Admins"}),u.jsx(fc,{href:"/settings",disabled:!e("settings.view"),children:"Settings"})]})}),u.jsx(hS,{children:u.jsx(fS,{className:"aaaaaaaaaaa",children:u.jsxs(RW,{children:[u.jsx(MW,{onClick:t=>{t.currentTarget.dataset.state==="open"&&t.preventDefault()},children:"System"}),u.jsxs(AW,{className:"flex flex-col gap-2 p-4 list-none",children:[u.jsx(Sh,{className:"w-36 justify-start",href:"/system/master-actions",children:"Master Actions"}),u.jsx(Sh,{className:"w-36 justify-start",href:"/system/diagnostics",children:"Diagnostics"}),u.jsx(Sh,{className:"w-36 justify-start",href:"/system/console-log",disabled:!e("txadmin.log.view"),children:"Console Log"}),u.jsx(Sh,{className:"w-36 justify-start",href:"/system/action-log",disabled:!e("txadmin.log.view"),children:"Action Log"})]})]})})})]})}var f3="Avatar",[QOe,s$e]=Un(f3),[JOe,DW]=QOe(f3),LW=w.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[i,s]=w.useState("idle");return u.jsx(JOe,{scope:n,imageLoadingStatus:i,onImageLoadingStatusChange:s,children:u.jsx(Ee.span,{...r,ref:t})})});LW.displayName=f3;var NW="AvatarImage",PW=w.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:i=()=>{},...s}=e,a=DW(NW,n),o=ZOe(r,s.referrerPolicy),l=jt(c=>{i(c),a.onImageLoadingStatusChange(c)});return pn(()=>{o!=="idle"&&l(o)},[o,l]),o==="loaded"?u.jsx(Ee.img,{...s,ref:t,src:r}):null});PW.displayName=NW;var OW="AvatarFallback",IW=w.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...i}=e,s=DW(OW,n),[a,o]=w.useState(r===void 0);return w.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>o(!0),r);return()=>window.clearTimeout(l)}},[r]),a&&s.imageLoadingStatus!=="loaded"?u.jsx(Ee.span,{...i,ref:t}):null});IW.displayName=OW;function ZOe(e,t){const[n,r]=w.useState("idle");return pn(()=>{if(!e){r("error");return}let i=!0;const s=new window.Image,a=o=>()=>{i&&r(o)};return r("loading"),s.onload=a("loaded"),s.onerror=a("error"),s.src=e,t&&(s.referrerPolicy=t),()=>{i=!1}},[e,t]),n}var $W=LW,BW=PW,FW=IW;const zW=w.forwardRef(({className:e,...t},n)=>u.jsx($W,{ref:n,className:J("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));zW.displayName=$W.displayName;const HW=w.forwardRef(({className:e,...t},n)=>u.jsx(BW,{ref:n,className:J("aspect-square h-full w-full",e),...t}));HW.displayName=BW.displayName;const WW=w.forwardRef(({className:e,...t},n)=>u.jsx(FW,{ref:n,className:J("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));WW.displayName=FW.displayName;const fj=["#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"],eIe=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()},tIe=e=>{let t=0;for(let n=0;nt(!0),children:[u.jsx(iQ,{className:"h-6 w-6 sm:h-5 sm:w-5"}),u.jsx("div",{className:"hidden sm:flex flex-row min-w-max align-middle",children:"Server"})]})}function sIe({className:e}){const{setIsSheetOpen:t}=ZL();return u.jsxs("button",{className:J(m3,e),title:"Global Menu",onClick:()=>t(!0),children:[u.jsx(rQ,{className:"h-6 w-6 sm:h-5 sm:w-5"}),u.jsx("div",{className:"hidden sm:flex flex-row min-w-max",children:"Menu"})]})}function oIe({className:e}){const{setIsSheetOpen:t}=tN(),n=ct(K0);return u.jsxs("button",{className:J(m3,e),title:"Global Menu",onClick:()=>t(!0),children:[u.jsx(cQ,{className:"h-6 w-6 sm:h-5 sm:w-5"}),u.jsxs("div",{className:"hidden sm:flex flex-row min-w-max",children:["Players",u.jsxs("span",{className:"hidden lg:inline-block font-mono",children:[": ",n]})]})]})}function aIe(){const{authData:e,logout:t}=Pl(),{theme:n,setTheme:r}=Sz(),{setAccountModalOpen:i}=UC();if(!e)return null;const s=()=>{r(n==="light"?"dark":"light")},a=()=>{i(!0)},o=()=>{Ju("https://discord.gg/uAmsGa2")},l=()=>{t.mutate()};return u.jsxs(Hc,{children:[u.jsxs(Wc,{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:[u.jsx("span",{className:"hidden xl:block text-muted-foreground",children:e.name}),u.jsx(UW,{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})]}),u.jsxs(tl,{children:[window.txConsts.isWebInterface&&u.jsxs(ss,{className:"cursor-pointer",onClick:s,children:[u.jsxs("span",{className:"hidden dark:flex items-center",children:[u.jsx(bQ,{className:"mr-2 h-4 w-4"}),"Light Mode"]}),u.jsxs("span",{className:"flex dark:hidden items-center",children:[u.jsx(sQ,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})]}),u.jsxs(ss,{className:"cursor-pointer",onClick:a,children:[u.jsx(QX,{className:"mr-2 h-4 w-4"}),"Your Account"]}),u.jsxs(ss,{className:"cursor-pointer",onClick:o,children:[u.jsx(VW,{size:"14",className:"mr-2"}),"Support"]}),window.txConsts.isWebInterface&&u.jsxs(u.Fragment,{children:[u.jsx(Fa,{}),u.jsxs(ss,{className:"cursor-pointer",onClick:l,children:[u.jsx(eQ,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})]})}function lIe(){return u.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 shadow-lg md:shadow-sm`,children:u.jsxs("div",{className:"h-14 lg:px-3 px-2 w-full max-w-[1920px] flex flex-row justify-between transition-all",children:[u.jsxs("div",{className:"flex flex-row items-center flex-grow gap-5 mr-5",children:[u.jsx("div",{className:"w-sidebar hidden xl:flex justify-center",children:u.jsx(pS,{href:"/",children:u.jsx(p3,{className:"h-9 hover:scale-105 hover:brightness-110"})})}),u.jsx(pS,{href:"/",className:"hidden sm:max-xl:block",children:u.jsx(nIe,{className:"h-8 w-8 lg:h-10 lg:w-10 hover:scale-105 hover:brightness-110"})}),u.jsx("div",{className:"lg:hidden",children:u.jsx(rIe,{})}),u.jsx("nav",{className:"hidden lg:block flex-grow",children:u.jsx(XOe,{})})]}),u.jsxs("div",{className:"flex flex-row items-center gap-2 sm:gap-3",children:[u.jsx(iIe,{className:"lg:hidden"}),u.jsx(sIe,{className:"lg:hidden"}),u.jsx(oIe,{className:"xl:hidden"}),u.jsx(aIe,{})]})]})})}function cIe(){return ct(X7)}function uIe({txConfigState:e}){const[t]=va(),[n,r]=w.useState(""),i=w.useRef("");return w.useEffect(()=>{let s="";if(e===Ys.Setup&&!t.startsWith("/server/setup")?(s="/server/setup",i.current="Go to the setup page!"):e===Ys.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]),u.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-4",children:[u.jsx(SL,{className:"h-12 w-12 opacity-75 animate-pulse"}),u.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?u.jsx(kn,{href:n,className:"animate-toastbar-enter",children:i.current}):u.jsx(kn,{href:"#",className:"animate-toastbar-leave pointer-events-none",children:i.current||u.jsx(u.Fragment,{children:" "})})]})}function dIe(){const e=ct(EC),{hasPerm:t}=fr(),n=e!==Ys.Ready;return u.jsxs("div",{className:"relative",children:[n&&u.jsx(uIe,{txConfigState:e}),u.jsxs("div",{className:J(n&&"opacity-0 pointer-events-none"),children:[u.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight line-clamp-1",children:u.jsx(cIe,{})}),u.jsxs("div",{className:"space-y-1 select-none",children:[u.jsxs(Xn,{href:"/",children:[u.jsx(JX,{className:"mr-2 h-4 w-4"}),"Dashboard"]}),u.jsxs(Xn,{href:"/server/console",disabled:!t("console.view"),children:[u.jsx(vQ,{className:"mr-2 h-4 w-4"}),"Live Console"]}),u.jsxs(Xn,{href:"/server/resources",children:[u.jsx(yL,{className:"mr-2 h-4 w-4"}),"Resources"]}),u.jsxs(Xn,{href:"/server/server-log",disabled:!t("server.log.view"),children:[u.jsx(WX,{className:"mr-2 h-4 w-4"}),"Server Log"]}),u.jsxs(Xn,{href:"/server/cfg-editor",disabled:!t("server.cfg.editor"),children:[u.jsx(VX,{className:"mr-2 h-4 w-4"}),"CFG Editor"]}),window.txConsts.showAdvanced&&u.jsxs(Xn,{href:"/advanced",className:"text-accent",disabled:!t("all_permisisons"),children:[u.jsx(HX,{className:"mr-2 h-4 w-4"}),"Advanced"]}),!1]})]})]})}function hIe({style:e}){return u.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:u.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 fIe({style:e}){return u.jsx("svg",{style:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:u.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 rh=co(`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 pIe(){const e=ct(EC),t=ct(Q7),n=lp(),r=cp(),i=Z0(),{hasPerm:s}=fr(),a=Tt({method:"POST",path:"/fxserver/controls"}),o=Tt({method:"POST",path:"/fxserver/commands"}),l=v=>{const y={start:"Starting server",stop:"Stopping server",restart:"Restarting server"},g=`${y[v]}...`,p=()=>{i(),a({data:{action:v},toastLoadingMessage:g,timeout:Pv.LONG})};v==="start"?p():n({title:y[v],message:`Are you sure you want to ${v} the server?`,onConfirm:p})},c=()=>{l(t.isIdle?"start":"stop")},h=()=>{t.isChildAlive&&l("restart")},d=()=>{t.isChildAlive&&r({title:"Send Announcement",message:"Type the message to be broadcasted to all players.",placeholder:"announcement message",submitLabel:"Send",required:!0,onSubmit:v=>{i(),o({data:{action:"admin_broadcast",parameter:v},toastLoadingMessage:"Sending announcement..."})}})},f=()=>{t.isChildAlive&&r({title:"Kick All Players",message:"Type the kick reason or leave it blank (press enter)",placeholder:"kick reason",submitLabel:"Send",onSubmit:v=>{i(),o({data:{action:"kick_all",parameter:v},toastLoadingMessage:"Kicking players..."})}})},m=s("control.server"),_=s("announcement");return e!==Ys.Ready?u.jsx("div",{className:"w-full h-8 text-center tracking-wider font-light opacity-75",children:"Server not configured."}):u.jsxs("div",{className:"flex flex-row justify-between gap-2",children:[u.jsxs(qs,{children:[u.jsx(Gs,{asChild:!0,children:t.isIdle?u.jsxs("div",{className:"relative flex flex-grow inset-0",children:[u.jsx("div",{className:"absolute inset-0 bg-success animate-pulse rounded blur-sm"}),u.jsx("button",{onClick:c,className:J(rh({type:"success"}),"relative"),disabled:!m,children:u.jsx(dQ,{className:"h-5"})})]}):u.jsx("button",{onClick:c,className:rh({type:"destructive"}),disabled:!m,children:u.jsx(uQ,{className:"h-5"})})}),u.jsx(os,{className:J(!m&&"text-destructive-inline text-center"),children:m?u.jsx("p",{children:t.isIdle?"Start the server! 🚀":"Stop the server"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to control the server."]})})]}),u.jsxs(qs,{children:[u.jsx(Gs,{asChild:!0,children:u.jsx("button",{onClick:h,className:J(rh({type:"warning"})),disabled:!m||!t.isChildAlive,children:u.jsx(ow,{className:"h-5"})})}),u.jsx(os,{className:J(!m&&"text-destructive-inline text-center"),children:m?u.jsx("p",{children:"Restart Server"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to control the server."]})})]}),u.jsxs(qs,{children:[u.jsx(Gs,{asChild:!0,children:u.jsx("button",{onClick:f,className:rh(),disabled:!m||!t.isChildAlive,children:u.jsx(hIe,{style:{height:"1.25rem",width:"1.5rem",fill:"currentcolor"}})})}),u.jsx(os,{className:J(!m&&"text-destructive-inline text-center"),children:m?u.jsx("p",{children:"Kick All Players"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to control the server."]})})]}),u.jsxs(qs,{children:[u.jsx(Gs,{asChild:!0,children:u.jsx("button",{onClick:d,className:rh(),disabled:!_||!t.isChildAlive,children:u.jsx(nQ,{className:"h-5"})})}),u.jsx(os,{className:J(!_&&"text-destructive-inline text-center"),children:_?u.jsx("p",{children:"Send Announcement"}):u.jsxs("p",{children:["You do not have permission ",u.jsx("br",{}),"to send an Announcement."]})})]})]})}const mIe=co("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 Qm({children:e,tooltip:t,type:n}){return u.jsxs(qs,{children:[u.jsx(Gs,{asChild:!0,children:u.jsx("span",{className:mIe({type:n}),children:e})}),u.jsx(os,{side:"right",children:u.jsx("p",{children:t})})]})}const Jm={[hh.Disabled]:{text:"DISABLED",color:"default",description:"Discord bot is disabled."},[hh.Starting]:{text:"STARTING",color:"warning",description:"Discord bot is starting."},[hh.Ready]:{text:"READY",color:"default",description:"Discord bot is ready."},[hh.Error]:{text:"ERROR",color:"destructive",description:"Discord bot is in an error state."}};function gIe(){const e=J7();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==="discordMember"?(i="MEMBER",s="Only Discord server members can join."):e.server.whitelist==="discordRoles"?(i="ROLES",s="Only Discord server members with the specified roles can join."):e.server.whitelist==="approvedLicense"&&(i="LICENSE",s="Only players with an approved license can join."),e.discord in Jm?(o=Jm[e.discord].text,c=Jm[e.discord].color,l=Jm[e.discord].description):(o=`CODE-${e.discord}`,c="destructive",l="Unknown status code")),u.jsxs("div",{className:"flex flex-col gap-[0.375rem]",children:[u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Server:",u.jsx(Qm,{tooltip:n,type:r,children:t})]}),u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Process:",u.jsx(Qm,{tooltip:"Status of the FXServer process.",children:e!=null&&e.runner.isChildAlive?"ALIVE":"DEAD"})]}),u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Whitelist:",u.jsx(Qm,{tooltip:s,type:a,children:i})]}),u.jsxs("div",{className:"flex justify-between items-center text-muted-foreground text-sm gap-1.5",children:["Discord Bot:",u.jsx(Qm,{tooltip:l,type:c,children:o})]})]})}const qW=Intl.DateTimeFormat().resolvedOptions().timeZone,vIe=u.jsxs("p",{className:"text-destructive",children:["Server's timezone: ",u.jsx("b",{children:window.txConsts.serverTimezone})," ",u.jsx("br",{}),"Your timezone: ",u.jsx("b",{children:qW})," ",u.jsx("br",{}),"Either use relative times, or make sure the scheduled is based on the server timezone."]}),pj={suggestions:["+5","+10","+15","+30"],title:"When should the server restart?",message:u.jsxs(u.Fragment,{children:[u.jsxs("p",{children:["Possible formats: ",u.jsx("br",{}),u.jsxs("ul",{className:"list-disc ml-4",children:[u.jsxs("li",{children:[u.jsx(Ye,{children:"+MM"})," relative time in minutes (example: ",u.jsx(Ye,{children:"+15"})," for 15 minutes from now.)"]}),u.jsxs("li",{children:[u.jsx(Ye,{children:"HH:MM"})," absolute 24-hour time (example: ",u.jsx(Ye,{children:"23:30"})," for 11:30 PM.)"]})]})]}),qW!==window.txConsts.serverTimezone&&vIe]}),placeholder:"+15",required:!0,isWide:!0},yIe=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 xIe(){const e=Z0(),t=cp(),{hasPerm:n}=fr(),r=Tt({method:"POST",path:"/fxserver/schedule"}),i=J7();if(!i)return u.jsxs("div",{children:[u.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),u.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,h=!1;const d=typeof s.nextRelativeMs=="number";if(d){const p=s.nextIsTemp?"(temp)":"",x=Nv(s.nextRelativeMs,{units:["h","m"]}),b=s.nextRelativeMs<6e4;b?(l=!0,a=`right now ${p}`):a=`in ${x} ${p}`,s.nextSkip?(o="text-muted-foreground line-through",b||(h=!0)):(o="text-warning-inline",b||(c=!0))}const f=p=>{if(e(),p.includes(",")){qe.error({title:"Invalid scheduled restart time.",msg:`It looks like you are trying to schedule multiple restart times, which can only be done in the Settings page. This input is for just the next (not persistent) restart.`},{duration:1e4});return}if(!yIe(p)){qe.error(`Invalid schedule time: ${p}`);return}r({data:{action:"setNextTempSchedule",parameter:p},toastLoadingMessage:"Scheduling server restart..."})},m=()=>{t({...pj,onSubmit:f,submitLabel:"Edit"})},_=()=>{t({...pj,onSubmit:f,submitLabel:"Schedule"})},v=()=>{e(),r({data:{action:"setNextSkip",parameter:!0},toastLoadingMessage:"Cancelling next server restart..."})},y=()=>{e(),r({data:{action:"setNextSkip",parameter:!1},toastLoadingMessage:"Enabling next server restart..."})},g=n("control.server");return u.jsxs("div",{children:[u.jsx("h2",{className:"mb-1 text-lg font-semibold tracking-tight",children:"Next Restart:"}),u.jsx("span",{className:J("font-light",o),children:a}),u.jsxs("div",{className:"flex flex-row justify-between gap-2 mt-2 flex-wrap",children:[d?u.jsxs(De,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!g||l,onClick:m,children:[u.jsx(aQ,{className:"h-4 w-4 mr-1"})," Edit"]}):u.jsxs(De,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",disabled:!g||l,onClick:_,children:[u.jsx(OX,{className:"h-4 w-4 mr-1"})," Schedule Restart"]}),c&&u.jsxs(De,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border shadow",onClick:v,disabled:!g,children:[u.jsx(IX,{className:"h-4 w-4 mr-1"})," Cancel"]}),h&&u.jsxs(De,{size:"xs",variant:"ghost",className:"flex-grow bg-muted border",onClick:y,disabled:!g,children:[u.jsx(PX,{className:"h-4 w-4 mr-1"})," Enable"]})]})]})}function GW({isSheet:e}){return u.jsxs("aside",{className:J("flex flex-col gap-4 z-10",e?"px-4 py-6":"tx-sidebar hidden lg:flex"),children:[u.jsx("div",{className:J(!e&&"rounded-xl border bg-card text-card-foreground shadow-sm p-4"),children:u.jsx(dIe,{})}),u.jsx("hr",{className:e?"block":"hidden"}),u.jsxs("div",{className:J(!e&&"rounded-xl border bg-card text-card-foreground shadow-sm p-4","flex flex-col gap-4"),children:[u.jsx(pIe,{}),u.jsx(gIe,{}),u.jsx(xIe,{})]}),u.jsx("hr",{className:e?"block":"hidden"}),window.txConsts.adsData.main?u.jsxs("a",{href:window.txConsts.adsData.main.url,onClick:gf,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:[u.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]`}),u.jsx("img",{className:"rounded-xl max-w-sidebar max-h-[80px] m-auto",src:window.txConsts.adsData.main.img})]}):null,window.txConsts.isWebInterface?u.jsxs("div",{className:"flex flex-col items-center justify-center gap-1 text-sm font-light opacity-85 hover:opacity-100",children:[u.jsxs("span",{className:J("text-muted-foreground",window.txConsts.txaVersion.includes("-")&&"text-destructive-inline font-semibold"),children:["tx: ",u.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",u.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]}),u.jsxs("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",onClick:gf,target:"_blank",className:"text-muted-foreground hover:text-accent",children:["© 2019-",new Date().getUTCFullYear()," Tabarra"]})]}):null]})}function _Ie(){const t=ct(K0).toLocaleString("en-US");return u.jsxs("div",{className:"w-full flex justify-between items-center",children:[u.jsx("div",{className:"w-16 h-16 dark:bg-zinc-600/50 bg-zinc-300/75 rounded-full flex items-center justify-center",children:u.jsx(BC,{className:"w-10 h-10 dark:text-zinc-400 text-zinc-500 text-opacity-80 stroke-1"})}),u.jsxs("div",{className:"flex flex-col items-end",children:[u.jsx("div",{className:"text-4xl font-mono font-extralight",children:t}),u.jsx("div",{className:"opacity-80 text-lg font-light tracking-wider",children:"Players"})]})]})}const bIe=new Set([9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]),mj=(e,t=35)=>{const n=[...e].map(s=>(s.codePointAt(0)??0).toString(16)),r=[];let i=0;for(let s=0;st)break;r.push(n[s]),i+=n[s].length+1}return r},wIe=e=>{const t=e.codePointAt(0);return t>=127744&&t<=128511||t>=128512&&t<=128591||t>=128640&&t<=128767||t>=128768&&t<=128895||t>=128896&&t<=129023||t>=129024&&t<=129279||t>=129280&&t<=129535||t>=129536&&t<=129647||t>=129648&&t<=129791||t>=9728&&t<=9983||t>=9984&&t<=10175},SIe=(e,t=36)=>{let n="",r="",i=0,s="",a=0;const o=[...e];for(let l=0;l=t);l++){const c=o[l],h=c.codePointAt(0),d=bIe.has(h);if(!n.length&&d)continue;const f=c===r;if(f&&i>=(d?1:3))continue;let m=!1;if(d&&!((h===65038||h===65039)&&wIe(r))){s||(s=c,m=!0);continue}if(!m&&s){if(a>=t-1)break;n+=s,a++,s=""}r=c,i=f?i+1:1,n+=c,a++}return n},gj=String.fromCodePoint(8709,8203),CIe=e=>{if(!e)return{displayName:gj+"EMPTY NAME",displayNameEmpty:!0,pureName:"emptyname",pureNameEmpty:!0};const t=[o=>o.substring(0,128),o=>o.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,""),o=>o.replace(/\^\d/ig,""),o=>o.replace(/[\p{Control}\u200E\u2067]/ug,""),o=>o.replace(/[\uA980-\uA9DF\u239B-\u23AD\u534D\u5350\u1000-\u109F\u0B80-\u0BFF\uFDFD\u2E3B]/ug,""),o=>o.replace(/[\u{12000}-\u{123FF}\u{12400}-\u{1247F}\u{12480}-\u{1254F}\u{1D000}-\u{1D0FF}]/gu,""),o=>o.replace(new RegExp("(^\\p{Nonspacing_Mark}+)|(\\p{Nonspacing_Mark}{3,})","ug"),(l,c,h)=>{if(c)return"";if(h)return h.substring(0,2)}),SIe];let n=e;for(const o of t){const l=o(n);if(l.length)n=l;else{const c=mj(n);return{displayName:`${gj}${c.join(" ").toUpperCase()}`,displayNameEmpty:!0,pureName:c.join(""),pureNameEmpty:!0}}}const r=n,i=[o=>o.normalize("NFKC"),o=>o.replace(/[^\p{Letter}\p{Number}]/gu,""),o=>o.toLocaleLowerCase()];let s=n;for(const o of i){const l=o(s);if(l.length)s=l;else{const c=mj(s);return{displayName:r,displayNameEmpty:!1,pureName:c.join(""),pureNameEmpty:!0}}}return{displayName:r,displayNameEmpty:!1,pureName:s,pureNameEmpty:!1}};function kIe({filterString:e,setFilterString:t}){const n=w.useRef(null);return Pi("message",r=>{var i;r.data.type==="globalHotkey"&&r.data.action==="focusPlayerlistFilter"&&((i=n.current)==null||i.focus())}),u.jsx("div",{className:"pt-2 px-2 flex gap-2",children:u.jsxs("div",{className:"relative w-full",children:[u.jsx(wt,{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?u.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:u.jsx(Ar,{})}):u.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:u.jsx(Ye,{className:"text-xs tracking-wide",children:"ctrl+k"})})]})})}const EIe=w.memo(kIe);function TIe({virtualItem:e,player:t,modalOpener:n}){return u.jsxs("div",{className:"player",style:{height:`${e.size}px`,transform:`translateY(${e.start}px)`},onClick:()=>n(t.netid),children:[u.jsx("div",{className:"pid-block leading-[1.7]",children:u.jsx("span",{className:"pid-badge",children:t.netid})}),u.jsx("span",{className:"pname",children:t.displayName})]})}function RIe(){const e=ct(jC),t=ct(Z7),n=n1(),r=w.useRef(null),[i,s]=w.useState(""),a=w.useMemo(()=>{const d=CIe(i).pureName;return d!=="emptyname"?e.filter(f=>f.pureName.includes(d)||f.netid.toString().includes(d)):e},[e,i]),o=w.useMemo(()=>{var m;const d=((m=e.at(-1))==null?void 0:m.netid)??0;return`.tx-playerlist .player .pid-block { min-width: ${Math.floor(Math.log10(d))+1+1}ch; }`},[e]),l=V5({isScrollingResetDelay:0,count:a.length,getScrollElement:()=>{var d;return(d=r.current)==null?void 0:d.getElementsByTagName("div")[0]},estimateSize:()=>30,overscan:15}),c=l.getVirtualItems(),h=d=>{t&&n({mutex:t,netid:d})};return u.jsxs(u.Fragment,{children:[u.jsx(EIe,{filterString:i,setFilterString:s}),u.jsxs("div",{className:J("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."]}),u.jsx("div",{className:J("text-center m-6 text-muted-foreground tracking-wider italic",c.length?"hidden":"block"),children:e.length&&i?u.jsxs("p",{children:["No players to show.",u.jsx("span",{className:"text-xs block opacity-75",children:"Clear the filter to show all players."})]}):u.jsxs("p",{children:["No players online.",u.jsx("span",{className:"text-xs block opacity-75",children:"Invite some friends to join in!"})]})}),u.jsx("style",{children:o}),u.jsx(hi,{className:"h-full select-none",ref:r,children:u.jsx("div",{className:"tx-playerlist",style:{height:`${l.getTotalSize()}px`,width:"100%",position:"relative"},children:c.map(d=>u.jsx(TIe,{virtualItem:d,player:a[d.index],modalOpener:h},d.key))})})]})}function KW({isSheet:e}){return u.jsxs("aside",{className:J("flex flex-col z-10",e?"w-full h-screen":"tx-sidebar hidden xl:flex gap-4 h-contentvh"),children:[u.jsx("div",{className:J("text-card-foreground shrink-0 p-4",e?"pr-12 border-b":"rounded-xl border bg-card"),children:u.jsx(_Ie,{})}),u.jsx("div",{className:J("flex flex-col gap-2 flex-grow overflow-hidden",!e&&"min-h-[480px] rounded-xl border bg-card text-card-foreground shadow-sm"),children:u.jsx(RIe,{})})]})}const g3=nk,MIe=rk,YW=w.forwardRef(({className:e,...t},n)=>u.jsx(bp,{className:J("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}));YW.displayName=bp.displayName;const AIe=co("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"}}),ox=w.forwardRef(({side:e="right",className:t,children:n,...r},i)=>u.jsxs(MIe,{children:[u.jsx(YW,{}),u.jsxs(wp,{ref:i,className:J(AIe({side:e}),t),...r,children:[n,u.jsxs(M1,{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:[u.jsx(Ar,{className:"h-8 w-8 sm:h-6 sm:w-6 md:h-4 md:w-4"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));ox.displayName=wp.displayName;const XW=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});XW.displayName="SheetHeader";const QW=w.forwardRef(({className:e,...t},n)=>u.jsx(Sp,{ref:n,className:J("text-lg font-semibold text-foreground",e),...t}));QW.displayName=Sp.displayName;const jIe=w.forwardRef(({className:e,...t},n)=>u.jsx(Cp,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));jIe.displayName=Cp.displayName;function DIe(){const{isSheetOpen:e,setIsSheetOpen:t}=ZL(),{hasPerm:n}=fr();return u.jsx(g3,{open:e,onOpenChange:t,children:u.jsx(ox,{side:"left",className:"p-0 flex flex-col gap-0 w-full xs:w-3/4 select-none",onOpenAutoFocus:r=>r.preventDefault(),children:u.jsxs(hi,{className:"h-full px-6 [&_svg]:shrink-0",children:[u.jsx(XW,{children:u.jsx(QW,{className:"py-6",children:u.jsx(pS,{href:"/",children:u.jsx(p3,{className:"h-9 hover:scale-105 hover:brightness-110"})})})}),u.jsxs("div",{className:"mb-4",children:[u.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"Global Menu"}),u.jsxs("div",{className:"flex flex-wrap flex-row xs:grid grid-cols-2 gap-4",children:[u.jsxs(Xn,{href:"/players",children:[u.jsx(BC,{className:"mr-2 h-4 w-4"}),"Players"]}),u.jsxs(Xn,{href:"/history",children:[u.jsx(fQ,{className:"mr-2 h-4 w-4"}),"History"]}),u.jsxs(Xn,{href:"/insights/player-drops",children:[u.jsx(fv,{className:"mr-2 h-4 w-4"}),"Player Drops"]}),u.jsxs(Xn,{href:"/whitelist",children:[u.jsx($X,{className:"mr-2 h-4 w-4"}),"Whitelist"]}),u.jsxs(Xn,{href:"/admins",disabled:!n("manage.admins"),children:[u.jsx(yQ,{className:"mr-2 h-4 w-4"}),"Admins"]}),u.jsxs(Xn,{href:"/settings",disabled:!n("settings.view"),children:[u.jsx(mQ,{className:"mr-2 h-4 w-4"}),"Settings"]})]})]}),u.jsxs("div",{className:"mb-4",children:[u.jsx("h2",{className:"mb-1.5 text-lg font-semibold tracking-tight",children:"System Menu"}),u.jsxs("div",{className:"flex flex-wrap flex-row xs:grid grid-cols-2 gap-4",children:[u.jsxs(Xn,{href:"/system/master-actions",children:[u.jsx(EQ,{className:"mr-2 h-4 w-4"}),"Master Actions"]}),u.jsxs(Xn,{href:"/system/diagnostics",children:[u.jsx(jX,{className:"mr-2 h-4 w-4"}),"Diagnostics"]}),u.jsxs(Xn,{href:"/system/console-log",disabled:!n("txadmin.log.view"),children:[u.jsx(mv,{className:"mr-2 h-4 w-4"}),"Console Log"]}),u.jsxs(Xn,{href:"/system/action-log",disabled:!n("txadmin.log.view"),children:[u.jsx(mv,{className:"mr-2 h-4 w-4"}),"Action Log"]})]})]})]})})})}function LIe(){const{isSheetOpen:e,setIsSheetOpen:t}=eN();return u.jsx(g3,{open:e,onOpenChange:t,children:u.jsx(ox,{side:"left",className:"w-full xs:w-3/4 p-0",onOpenAutoFocus:n=>n.preventDefault(),children:u.jsx(hi,{className:"h-full",children:u.jsx(GW,{isSheet:!0})})})})}function NIe(){const{isSheetOpen:e,setIsSheetOpen:t}=tN();return u.jsx(g3,{open:e,onOpenChange:t,children:u.jsx(ox,{side:"right",className:"w-full xs:w-3/4 p-0",onOpenAutoFocus:n=>n.preventDefault(),children:u.jsx(hi,{className:"h-full",children:u.jsx(KW,{isSheet:!0})})})})}function PIe(){return u.jsxs(u.Fragment,{children:[u.jsx(DIe,{}),u.jsx(LIe,{}),u.jsx(NIe,{})]})}const JW=nt(!1),ZW=nt(window.txConsts.fxsOutdated),eU=nt(window.txConsts.txaOutdated);function OIe(){const[e,t]=Tr(JW),[n,r]=Tr(ZW),[i,s]=Tr(eU);return{offlineWarning:e,setOfflineWarning:t,fxUpdateData:n,setFxUpdateData:r,txUpdateData:i,setTxUpdateData:s}}const IIe=()=>it(JW),$Ie=()=>{const e=it(ZW),t=it(eU);return n=>{e(n.fxserver),t(n.txadmin),window.txConsts.fxsOutdated=n.fxserver,window.txConsts.txaOutdated=n.txadmin}},tU="tsUpdateDismissed",BIe=12*60*60*1e3,FIe=48*60*60*1e3,zIe=()=>{const e=localStorage.getItem(tU);if(!e)return!1;const t=parseInt(e);return isNaN(t)?!1:t},HIe=e=>{const t=zIe(),n=Date.now();return!t||t+(e?BIe:FIe){a(Math.random())},l=()=>{localStorage.setItem(tU,Date.now().toString()),o()};return w.useEffect(()=>{const c=setInterval(()=>{o()},6e4);return()=>clearInterval(c)},[]),i&&!HIe(r)?null:u.jsx("div",{className:"fixed top-navbarvh w-full flex justify-center z-40",children:u.jsxs("div",{className:J("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:[u.jsxs("h2",{className:"text-md group-hover:font-medium",children:[e,t]}),u.jsxs("span",{className:"hidden group-hover:block text-center text-sm",children:[n,u.jsxs("div",{className:"flex flex-row justify-center items-center mt-3 gap-4",children:[i&&u.jsxs(De,{size:"xs",variant:"outline",onClick:()=>l(),className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:[u.jsx(CX,{className:"h-[0.9rem] mr-1"})," Postpone"]}),u.jsx(De,{size:"xs",variant:"outline",asChild:!0,className:r?"text-foreground border-foreground":"dark:border-primary-foreground dark:hover:border-primary",children:u.jsxs("a",{href:"https://discord.gg/uAmsGa2",target:"_blank",children:[u.jsx(VW,{size:"14",className:"mr-1"})," Support"]})})]})]})]})})}function WIe(){const{offlineWarning:e,txUpdateData:t,fxUpdateData:n}=OIe();return e?u.jsx(eb,{titleIcon:u.jsx(FX,{className:"inline h-[1.2rem] -mt-1 mr-1"}),title:"Socket connection lost.",description:u.jsxs(u.Fragment,{children:["The connection to the txAdmin server has been lost. ",u.jsx("br",{}),"If you closed FXServer, please restart it."]}),isImportant:!0,canPostpone:!1}):t?u.jsx(eb,{titleIcon:u.jsx(tT,{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?u.jsx(eb,{titleIcon:u.jsx(tT,{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}var nU="AlertDialog",[UIe,o$e]=Un(nU,[NI]),fo=NI(),rU=e=>{const{__scopeAlertDialog:t,...n}=e,r=fo(t);return u.jsx(nk,{...r,...n,modal:!0})};rU.displayName=nU;var VIe="AlertDialogTrigger",qIe=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=fo(n);return u.jsx(lue,{...i,...r,ref:t})});qIe.displayName=VIe;var GIe="AlertDialogPortal",iU=e=>{const{__scopeAlertDialog:t,...n}=e,r=fo(t);return u.jsx(rk,{...r,...n})};iU.displayName=GIe;var KIe="AlertDialogOverlay",sU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=fo(n);return u.jsx(bp,{...i,...r,ref:t})});sU.displayName=KIe;var Xc="AlertDialogContent",[YIe,XIe]=UIe(Xc),oU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...i}=e,s=fo(n),a=w.useRef(null),o=We(t,a),l=w.useRef(null);return u.jsx(iue,{contentName:Xc,titleName:aU,docsSlug:"alert-dialog",children:u.jsx(YIe,{scope:n,cancelRef:l,children:u.jsxs(wp,{role:"alertdialog",...s,...i,ref:o,onOpenAutoFocus:fe(i.onOpenAutoFocus,c=>{var h;c.preventDefault(),(h=l.current)==null||h.focus({preventScroll:!0})}),onPointerDownOutside:c=>c.preventDefault(),onInteractOutside:c=>c.preventDefault(),children:[u.jsx(bC,{children:r}),u.jsx(JIe,{contentRef:a})]})})})});oU.displayName=Xc;var aU="AlertDialogTitle",lU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=fo(n);return u.jsx(Sp,{...i,...r,ref:t})});lU.displayName=aU;var cU="AlertDialogDescription",uU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=fo(n);return u.jsx(Cp,{...i,...r,ref:t})});uU.displayName=cU;var QIe="AlertDialogAction",dU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,i=fo(n);return u.jsx(M1,{...i,...r,ref:t})});dU.displayName=QIe;var hU="AlertDialogCancel",fU=w.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=XIe(hU,n),s=fo(n),a=We(t,i);return u.jsx(M1,{...s,...r,ref:a})});fU.displayName=hU;var JIe=({contentRef:e})=>{const t=`\`${Xc}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Xc}\` by passing a \`${cU}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Xc}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return w.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},ZIe=rU,e9e=iU,pU=sU,mU=oU,gU=dU,vU=fU,yU=lU,xU=uU;const t9e=ZIe,n9e=e9e,_U=w.forwardRef(({className:e,...t},n)=>u.jsx(pU,{className:J("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}));_U.displayName=pU.displayName;const bU=w.forwardRef(({className:e,...t},n)=>u.jsxs(n9e,{children:[u.jsx(_U,{}),u.jsx(mU,{ref:n,className:J("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})]}));bU.displayName=mU.displayName;const wU=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col space-y-2 text-center sm:text-left",e),...t});wU.displayName="AlertDialogHeader";const SU=({className:e,...t})=>u.jsx("div",{className:J("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});SU.displayName="AlertDialogFooter";const CU=w.forwardRef(({className:e,...t},n)=>u.jsx(yU,{ref:n,className:J("text-lg font-semibold","attempt-word-wrap",e),...t}));CU.displayName=yU.displayName;const kU=w.forwardRef(({className:e,...t},n)=>u.jsx(xU,{ref:n,className:J("text-sm text-muted-foreground",e),...t}));kU.displayName=xU.displayName;const EU=w.forwardRef(({className:e,...t},n)=>u.jsx(gU,{ref:n,className:J(ap(),e),...t}));EU.displayName=gU.displayName;const TU=w.forwardRef(({className:e,...t},n)=>u.jsx(vU,{ref:n,className:J(ap({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));TU.displayName=vU.displayName;function r9e(){const e=w.useRef(null),t=hJ(),n=dJ(),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 pG(e,r),u.jsx(t9e,{open:t.isOpen,onOpenChange:a,children:u.jsxs(bU,{ref:e,onOpenAutoFocus:o=>{var l;o.preventDefault(),o.target&&"querySelector"in o.target&&typeof o.target.querySelector=="function"&&((l=o.target.querySelector("[data-autofocus]"))==null||l.focus())},children:[u.jsxs(wU,{children:[u.jsx(CU,{children:t.title}),u.jsx(kU,{children:t.message})]}),u.jsxs(SU,{children:[u.jsx(TU,{children:t.cancelLabel??"Cancel"}),u.jsx(EU,{"data-autofocus":!0,onKeyDown:s,onClick:i,className:J(ap({variant:t.confirmBtnVariant??"destructive"})),children:t.actionLabel??"Continue"})]})]})})}function i9e(){const e=w.useRef(null),t=pJ(),n=fJ(),r=()=>{var o,l;if(!t.isOpen)return;n();const a=((o=e.current)==null?void 0:o.value)??((l=e.current)==null?void 0:l.textArea.value)??"";t.onSubmit(a.trim())},i=a=>{a.preventDefault(),r()},s=a=>{t.isOpen&&(a||(n(),t.onCancel&&t.onCancel()))};return u.jsx($l,{open:t.isOpen,onOpenChange:s,children:u.jsx(wa,{className:J(t.isWide&&"md:max-w-2xl"),children:u.jsxs("form",{onSubmit:i,className:"grid gap-4",children:[u.jsxs(Sa,{children:[u.jsx(Ca,{children:t.title}),u.jsx(QI,{children:t.message})]}),t.isMultiline?u.jsx(Ep,{autoFocus:!0,ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required,minHeight:100,maxHeight:240}):u.jsx(wt,{autoFocus:!0,ref:e,placeholder:t.placeholder,autoComplete:"off",required:t.required}),u.jsxs(kp,{className:"gap-2 flex-col",children:[u.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)=>u.jsxs(De,{type:"button",onClick:()=>{e.current.value=a,r()},variant:"outline",children:[u.jsx("span",{className:"sm:hidden mr-auto text-muted-foreground",children:"Suggestion:"}),a]},o))}),u.jsx(De,{type:"submit",variant:t.submitBtnVariant??"default",children:t.submitLabel??"Submit"})]})]})})})}const s9e=w.memo(function(){const{authData:e,setAuthData:t}=Pl(),{setAccountModalTab:n}=UC(),r=XL(),i=Tt({method:"POST",path:"/auth/changePassword"}),[s,a]=w.useState(""),[o,l]=w.useState(""),[c,h]=w.useState(""),[d,f]=w.useState(""),[m,_]=w.useState(!1),v=y=>{if(y==null||y.preventDefault(),!!e){if(f(""),o.lengthXr.adminPasswordMaxLength){f(`The password must be between ${Xr.adminPasswordMinLength} and ${Xr.adminPasswordMaxLength} digits long.`);return}else if(o!==c){f("The passwords do not match.");return}_(!0),i({data:{newPassword:o,oldPassword:e.isTempPassword?void 0:s},error:g=>{_(!1),f(g)},success:g=>{_(!1),"success"in g?e.isTempPassword?(n("identifiers"),t({...e,isTempPassword:!1})):(qe.success("Password changed successfully!"),r()):f(g.error)}})}};if(e)return u.jsx(sx,{value:"password",tabIndex:void 0,children:u.jsxs("form",{onSubmit:v,children:[e.isTempPassword?u.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. ",u.jsx("br",{}),u.jsx("strong",{children:"Make sure to take note of your new password before saving."})]}):u.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."}),u.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[!e.isTempPassword&&u.jsxs("div",{className:"space-y-1",children:[u.jsx(Tn,{htmlFor:"current-password",children:"Current Password"}),u.jsx(wt,{id:"current-password",placeholder:"Enter current password",type:"password",value:s,autoFocus:!0,required:!0,onChange:y=>{a(y.target.value),f("")}})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Tn,{htmlFor:"new-password",children:"New Password"}),u.jsx(wt,{id:"new-password",autoComplete:"new-password",placeholder:"Enter new password",type:"password",value:o,autoFocus:e.isTempPassword,required:!0,onChange:y=>{l(y.target.value),f("")}})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx(Tn,{htmlFor:"confirm-password",children:"Confirm Password"}),u.jsx(wt,{id:"confirm-password",autoComplete:"new-password",placeholder:"Repeat new password",type:"password",required:!0,onChange:y=>{h(y.target.value),f("")}})]})]}),d&&u.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:d}),u.jsx(De,{className:"w-full",type:"submit",disabled:m,children:m?"Saving...":e.isTempPassword?"Save & Next":"Change Password"})]})})});function o9e(){const e=YO(),[t,n]=w.useState(""),[r,i]=w.useState(""),[s,a]=w.useState(""),[o,l]=w.useState(!1),c=XL(),[h,d]=w.useState(!1),{isPending:f,error:m,data:_}=oJ({queryKey:["getIdentifiers"],gcTime:3e4,queryFn:()=>e("/auth/getIdentifiers")}),v=Tt({method:"POST",path:"/auth/changeIdentifiers"});w.useEffect(()=>{_&&(n(_.cfxreId),i(_.discordId))},[_]),w.useEffect(()=>{a(m?m.message:"")},[m]);const y=x=>{x==null||x.preventDefault(),a(""),d(!0),v({data:{cfxreId:t,discordId:r},error:b=>{a(b)},success:b=>{d(!1),"success"in b?(qe.success("Identifiers changed successfully!"),c()):a(b.error)}})},g=async()=>{if(!t)return;const x=t.trim();if(/^\d+$/.test(x))n(`fivem:${x}`);else if(x.startsWith("fivem:"))t!==x&&n(x);else{try{l(!0);const b=await oce(`https://forum.cfx.re/u/${x}.json`);b.user&&typeof b.user.id=="number"?n(`fivem:${b.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)}},p=()=>{if(!r)return;const x=r.trim();/^\d+$/.test(x)?i(`discord:${x}`):r!==x&&i(x)};return u.jsx(sx,{value:"identifiers",tabIndex:void 0,children:u.jsxs("form",{onSubmit:y,children:[u.jsxs("p",{className:"text-sm text-muted-foreground",children:["The identifiers are optional for accessing the ",u.jsx("strong",{children:"Web Panel"})," but required for you to be able to use the ",u.jsx("strong",{children:"In Game Menu"})," and the ",u.jsx("strong",{children:"Discord Bot"}),". ",u.jsx("br",{}),u.jsx("strong",{children:"It is recommended that you configure at least one."})]}),u.jsxs("div",{className:"space-y-3 pt-2 pb-6",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsxs(Tn,{htmlFor:"cfxreId",children:["FiveM identifier ",u.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),u.jsx(wt,{id:"cfxreId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"fivem:000000",value:f||o?"loading...":t,disabled:f||o,autoFocus:!0,onBlur:g,onChange:x=>{n(x.target.value),a("")}}),u.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. ",u.jsx("br",{}),"You can also type in your ",u.jsx(kn,{href:"https://forum.cfx.re/",children:"forum.cfx.re"})," username and it will be converted automatically. ",u.jsx("br",{}),"This is required if you want to login using the Cfx.re button."]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsxs(Tn,{htmlFor:"discordId",children:["Discord identifier ",u.jsx("span",{className:"text-sm opacity-75 text-info",children:"(optional)"})]}),u.jsx(wt,{id:"discordId",autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",placeholder:"discord:000000000000000000",value:f?"loading...":r,disabled:f,onBlur:p,onChange:x=>{i(x.target.value),a("")}}),u.jsxs("p",{className:"text-sm text-muted-foreground",children:["You can get your Discord User ID by following ",u.jsx(kn,{href:"https://support.discordapp.com/hc/en-us/articles/206346498-Where-can-I-find-my-User-Server-Message-ID",children:"this guide"}),". ",u.jsx("br",{}),"This is required if you want to use the Discord Bot slash commands."]})]})]}),s&&u.jsx("p",{className:"text-destructive text-center -mt-2 mb-4",children:s}),u.jsx(De,{className:"w-full",type:"submit",disabled:!_||h,children:h?"Saving...":"Save Changes"})]})})}function a9e(){const{authData:e}=Pl(),{isAccountModalOpen:t,setAccountModalOpen:n,accountModalTab:r,setAccountModalTab:i}=UC();w.useEffect(()=>{e&&e.isTempPassword&&(n(!0),i("password"))},[]);const s=a=>{!a&&e&&!e.isTempPassword&&(n(!1),setTimeout(()=>{i("password")},500))};if(e)return u.jsx($l,{open:t,onOpenChange:s,children:u.jsxs(wa,{className:"sm:max-w-lg",tabIndex:void 0,children:[u.jsx(Sa,{children:u.jsx(Ca,{className:"text-2xl font-bold",children:e.isTempPassword?"Welcome to txAdmin!":`Your Account - ${e.name}`})}),u.jsxs(PH,{defaultValue:"password",value:r,onValueChange:i,children:[u.jsxs(t3,{className:"grid w-full grid-cols-2 mb-4",children:[u.jsx(y0,{value:"password",children:"Password"}),u.jsx(y0,{value:"identifiers",disabled:e.isTempPassword,children:"Identifiers"})]}),u.jsx(s9e,{}),u.jsx(o9e,{})]})]})})}const l9e=5*60;function Qc({tsFetch:e,tsObject:t,serverTime:n,className:r,isDateOnly:i,dateStyle:s,timeStyle:a}){const o=n-e,l=n-t,c=e-l,h=()=>{qe.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.`)},d=i?GO(c,s??"medium"):zs(c,s??"medium",a??"short");return u.jsxs("span",{className:r,title:zs(c,"long","long"),children:[d,Math.abs(o)>l9e&&u.jsx("button",{className:"ml-1 text-warning-inline",onClick:h,children:"(clock drift)"})]})}function vj({type:e,count:t}){const n=t>1?`${e}s`:e;return t===0?u.jsxs("span",{className:J("h-max 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"]}):u.jsxs("span",{className:J("h-max 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 yj=e=>{if(!e)return 3;const t=e.trim().split(` `).length+1;return Math.min(Math.max(t,3),16)};function c9e({playerRef:e,player:t,refreshModalData:n}){const r=w.useRef(null),[i,s]=w.useState(t.notesLog??""),[a,o]=w.useState(yj(t.notes)),l=Tt({method:"POST",path:"/player/save_note"}),c=()=>{var d;s("Saving..."),l({queryParams:e,data:{note:(d=r.current)==null?void 0:d.value.trim()},success:f=>{"error"in f?s(f.error):n()}})},h=d=>{d.key==="Enter"&&!d.shiftKey&&!window.txIsMobile?(d.preventDefault(),c()):o(yj(d.currentTarget.value))};return u.jsxs(u.Fragment,{children:[u.jsxs(Tn,{htmlFor:"playerNotes",children:["Notes: ",u.jsx("span",{className:"text-muted-foreground",children:i})]}),u.jsx(Eu,{ref:r,id:"playerNotes",className:"w-full mt-1",disabled:!t.isRegistered,defaultValue:t.notes,onChange:()=>s("Press enter to save."),onKeyDown:h,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&&u.jsx("div",{className:"mt-2 w-full",children:u.jsx(De,{variant:"outline",size:"xs",onClick:c,disabled:!t.isRegistered,className:"w-full",children:"Save Note"})})]})}function u9e({playerRef:e,player:t,serverTime:n,tsFetch:r,setSelectedTab:i,refreshModalData:s}){const{hasPerm:a}=fr(),o=Tt({method:"POST",path:"/player/whitelist"}),l=t.sessionTime?Nv(t.sessionTime*6e4,{units:["h","m"]}):"--",c=t.tsLastConnection?u.jsx(Qc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsLastConnection,tsFetch:r,isDateOnly:!0}):"--",h=t.playTime?Nv(t.playTime*6e4,{units:["d","h","m"]}):"--",d=t.tsJoined?u.jsx(Qc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsJoined,tsFetch:r,isDateOnly:!0}):"--",f=t.tsWhitelisted?u.jsx(Qc,{className:"opacity-75 cursor-help",serverTime:n,tsObject:t.tsWhitelisted,tsFetch:r,isDateOnly:!0}):"not yet",m=t.actionHistory.filter(g=>g.type==="ban"&&!g.revokedAt).length,_=t.actionHistory.filter(g=>g.type==="warn"&&!g.revokedAt).length,v=()=>{o({queryParams:e,data:{status:!t.tsWhitelisted},toastLoadingMessage:"Updating whitelist...",genericHandler:{successMsg:"Whitelist changed."},success:(g,p)=>{"success"in g&&s()}})},y=w.useMemo(()=>{if(!t||!n)return;let g;for(const p of t.actionHistory)if(!(p.type!=="ban"||p.revokedAt))if(p.exp)p.exp>=n&&(g=Math.max(g??0,p.exp));else return"This player is permanently banned.";if(g!==void 0)return`This player is banned until ${zs(g,"short","short")}`},[t,n]);return u.jsxs("div",{className:"p-1",children:[y?u.jsxs("div",{className:"w-full p-2 pr-3 mb-1 flex items-center justify-between space-x-4 rounded-lg border shadow-lg transition-all text-black/75 dark:text-white/90 border-warning/70 bg-warning-hint",children:[u.jsx("div",{className:"flex-shrink-0 flex flex-col gap-2 items-center",children:u.jsx(EL,{className:"size-5 text-warning"})}),u.jsx("div",{className:"flex-grow text-sm font-medium",children:y})]}):null,u.jsxs("dl",{className:"pb-2",children:[t.isConnected&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Session Time"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:l})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Play Time"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:h})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Join Date"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:d})]}),!t.isConnected&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Last Connection"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:c})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"ID Whitelisted"}),u.jsx("dd",{className:"text-sm leading-6 mt-0",children:f}),u.jsx("dd",{className:"text-right",children:u.jsx(De,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:v,disabled:!a("players.whitelist"),children:t.tsWhitelisted?"Remove":"Add WL"})})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Sanctions"}),u.jsxs("dd",{className:"text-sm leading-6 mt-0 flex flex-wrap gap-2",children:[u.jsx(vj,{type:"Ban",count:m}),u.jsx(vj,{type:"Warn",count:_})]}),u.jsx("dd",{className:"text-right",children:u.jsx(De,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:()=>{i("History")},children:"View"})})]})]}),u.jsx(c9e,{player:t,playerRef:e,refreshModalData:s})]})}const xj=()=>u.jsx("span",{className:"opacity-0",children:` `}),d9e=["fivem:xxxxxxx","license:xxxxxxxxxxxxxx","discord:xxxxxxxxxxxxxxxxxx","etc..."].join(` `),h9e=["2:xxxxxxxxxxxxxx...","4:xxxxxxxxxxxxxx...","5:xxxxxxxxxxxxxx...","etc..."].join(` `);function _0({list:e,highlighted:t,type:n,src:r,onWipeIds:i}){const[s,a]=P1(),o=w.useRef(null),l=w.useRef(null),[c,h]=w.useState(null),[d,f]=w.useState(!1),m=Array.isArray(t)&&t.length,_=m?t.sort((M,D)=>M.localeCompare(D)):e.sort((M,D)=>M.localeCompare(D)),v=m?e.filter(M=>!t.includes(M)).sort((M,D)=>M.localeCompare(D)):[],y=_.length||v.length,g=lp(),p=cp(),x=n==="hwid",b=x?"HWID":"ID",S=`This ${r} has no ${b}s.`,C=Array.isArray(c),E=M=>C&&c.includes(M);w.useEffect(()=>{if(d){const M=setTimeout(()=>{f(!1)},2750);return()=>{clearTimeout(M)}}},[d]);const k=()=>{if(!i)return;const M=x?`${b}s`:`${b}s (except license)`;g({title:`Wipe ${r} ${b}s`,message:u.jsxs("p",{children:["Are you sure you want wipe all ",M," of this ",r,"? ",u.jsx("br",{}),u.jsx("strong",{children:"This action cannot be undone."})]}),onConfirm:i})},T=()=>{p({title:`Compare ${b}s`,message:u.jsxs("p",{children:["Paste in a list of ",b,"s to compare with the current list. ",u.jsx("br",{}),"Separate each ",b," with a new line or comma."]}),placeholder:x?h9e:d9e,submitLabel:"Compare",required:!0,isMultiline:!0,isWide:!0,onSubmit:M=>{console.log(M);const D=M.split(/[\n\s,;]+/).map(N=>N.trim()).filter(N=>N.length).filter(N=>N.length&&e.includes(N));h(D)}})},R=()=>{if(!o.current)throw new Error("divRef.current undefined");if(!y)return;const M=[..._,...v].join(`\r `);C7(M,o.current).then(D=>{D!==!1?f({msg:"Copied!",success:!0}):qe.error("Failed to copy to clipboard :(")}).catch(D=>{qe.error({title:"Failed to copy to clipboard:",msg:D.message}),f({msg:"Error :(",success:!1})})};return u.jsxs("div",{children:[u.jsxs("div",{className:"flex justify-between items-center pb-1",ref:o,children:[u.jsxs("h3",{className:"text-xl",children:[x?"Hardware IDs":"Player Identifiers",C&&c.length?u.jsxs("span",{className:"ml-2 text-sm font-normal italic text-success-inline",children:["(",c.length," matches found)"]}):null]}),u.jsx("div",{ref:s,className:J("w-24 min-h-6 flex justify-end gap-2.5",!y&&"hidden"),children:d?u.jsx("span",{ref:l,className:J("w-full text-center text-sm select-none pointer-events-none animate-toastbar-enter",d.success?"text-success-inline":"text-destructive-inline"),children:d.msg}):u.jsxs(u.Fragment,{children:[i&&u.jsx("button",{onClick:k,title:"Wipe all IDs except license.",children:u.jsx(AL,{className:"h-5 opacity-50 hover:opacity-100 hover:text-destructive"})}),u.jsx("button",{onClick:T,title:"Compare IDs.",children:u.jsx(ZX,{className:"h-6 opacity-50 hover:opacity-100 hover:text-primary"})}),u.jsx("button",{onClick:R,title:"Copy IDs to clipboard.",children:u.jsx(zX,{className:"h-5 opacity-50 hover:opacity-100 hover:text-primary"})})]})})]}),u.jsxs("div",{className:"relative border rounded",children:[u.jsxs("p",{className:J("font-mono break-all whitespace-pre-wrap rounded-[inherit] divide-y divide-border/50 text-muted-foreground",y&&x?"text-2xs leading-5 font-extralight tracking-widest":"text-xs leading-6 tracking-wider"),children:[!y&&u.jsx("span",{className:"block px-1 opacity-50 italic",children:S}),_.map(M=>u.jsxs("span",{className:J("block px-1 font-semibold",C&&(E(M)?"text-success-inline font-semibold":"opacity-50")),children:[M,u.jsx(xj,{})]},M)),v.map(M=>u.jsxs("span",{className:J("block px-1 opacity-50",E(M)&&"opacity-100 text-success-inline font-semibold"),children:[M,u.jsx(xj,{})]},M))]}),C&&!c.length&&u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"absolute inset-0 dark:bg-black/25 rounded-[inherit] backdrop-blur-sm flex items-center justify-center p-4",children:u.jsxs("span",{className:"text-xl tracking-wider text-warning-inline",children:["No matching ",b," found."]})}),u.jsxs("button",{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100",onClick:()=>h(null),children:[u.jsx(Ar,{className:"h-8 w-8 sm:h-6 sm:w-6"}),u.jsx("span",{className:"sr-only",children:"Close"})]})]})]})]})}function f9e({player:e,refreshModalData:t}){return u.jsx(bH,{children:u.jsxs("div",{className:"flex flex-col gap-4 p-1",children:[u.jsx(_0,{type:"id",src:"player",list:(e==null?void 0:e.oldIds)??[],highlighted:e.ids}),u.jsx(_0,{type:"hwid",src:"player",list:(e==null?void 0:e.oldHwids)??[],highlighted:e.hwids})]})})}function p9e({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=zs(e.revokedAt??0,"medium","short");r=`Revoked by ${e.revokedBy} on ${a}.`}else if(typeof e.exp=="number"){const a=zs(e.exp,"medium","short");r=e.exp{n(e.id)},className:J("pl-2 border-l-4 hover:bg-muted rounded-r-sm bg-muted/30 cursor-pointer",i),children:[u.jsxs("div",{className:"flex w-full justify-between",children:[u.jsx("strong",{className:"text-sm text-muted-foreground",children:s}),u.jsxs("small",{className:"text-right text-2xs space-x-1",children:[u.jsx(Ye,{className:"tracking-widest",children:e.id}),u.jsx("span",{className:"opacity-75 cursor-help",title:zs(e.ts,"long","long"),children:zs(e.ts,"medium","short")})]})]}),u.jsx("span",{className:"text-sm",children:e.reason}),r&&u.jsx("small",{className:"block text-xs opacity-75",children:r})]})}function m9e({actionHistory:e,serverTime:t,refreshModalData:n}){const r=u5();if(!e.length)return u.jsx(Up,{children:"No bans/warns found."});const i=a=>{r(a)},s=[...e].reverse();return u.jsx("div",{className:"flex flex-col gap-1 p-1",children:s.map(a=>u.jsx(p9e,{action:a,serverTime:t,modalOpener:i},a.id))})}function g9e({playerRef:e,banTemplates:t}){const n=w.useRef(null),[r,i]=w.useState(!1),{hasPerm:s}=fr(),a=KC(),o=Tt({method:"POST",path:"/player/ban",throwGenericErrors:!0});if(!s("players.ban"))return u.jsx(Up,{children:"You don't have permission to ban players."});const l=()=>{if(!n.current)return;const{reason:c,duration:h}=n.current.getData();if(!c||c.length<3){qe.warning("The reason must be at least 3 characters long."),n.current.focusReason();return}i(!0),o({queryParams:e,data:{reason:c,duration:h},toastLoadingMessage:"Banning player...",genericHandler:{successMsg:"Player banned."},success:d=>{i(!1),a()},error:d=>{i(!1)}})};return u.jsxs("div",{className:"grid gap-4 p-1",children:[u.jsx(L9,{ref:n,banTemplates:t,disabled:r,onNavigateAway:()=>{a()}}),u.jsx("div",{className:"flex place-content-end",children:u.jsx(De,{size:"sm",variant:"destructive",disabled:r,onClick:l,children:r?u.jsxs("span",{className:"flex items-center leading-relaxed",children:[u.jsx(sn,{className:"inline animate-spin h-4"})," Banning..."]}):"Apply Ban"})})]})}function v9e({playerRef:e,player:t}){const{hasPerm:n}=fr(),r=cp(),i=KC(),s=va()[1],[a]=$0("/admins"),o=Y0(),l=Z0(),c=Tt({method:"POST",path:"/player/message"}),h=Tt({method:"POST",path:"/player/kick"}),d=Tt({method:"POST",path:"/player/warn"}),f=g=>{"success"in g&&(i(),l())},m=()=>{if(!t)return;const g=new URLSearchParams;g.set("autofill","true"),g.set("name",t.pureName);for(const p of t.ids)p.startsWith("discord:")?g.set("discord",p):p.startsWith("fivem:")&&g.set("citizenfx",p);s(`/admins?${g.toString()}`),console.log("isAlreadyInAdminPage",a),a&&o(),i(),l()},_=()=>{t&&r({title:`Direct Message ${t.displayName}`,message:"Type direct message below",placeholder:"whatever you wanna say",submitLabel:"Send",required:!0,onSubmit:g=>{c({queryParams:e,data:{message:g},genericHandler:{successMsg:"Direct message sent."},toastLoadingMessage:"Sending direct message...",success:f})}})},v=()=>{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:g=>{h({queryParams:e,data:{reason:g},genericHandler:{successMsg:"Player kicked."},toastLoadingMessage:"Kicking player...",success:f})}})},y=()=>{t&&r({title:`Warn ${t.displayName}`,message:u.jsxs("p",{children:["Type below the warn reason. ",u.jsx("br",{}),"Offline players will receive the warning when they come back online."]}),placeholder:"The reason for the warn, rule violated, etc.",submitLabel:"Send",required:!0,onSubmit:g=>{d({queryParams:e,data:{reason:g},genericHandler:{successMsg:"Warning sent."},toastLoadingMessage:"Sending warning...",success:f})}})};return u.jsxs(kp,{className:"max-w-2xl gap-2 p-2 md:p-4 border-t grid grid-cols-2 sm:flex",children:[u.jsxs(De,{variant:"outline",size:"sm",disabled:!n("manage.admins")||!t||!t.ids.length,onClick:m,className:"pl-2 sm:mr-auto",children:[u.jsx(TL,{className:"h-5 mr-1"})," Give Admin"]}),u.jsxs(De,{variant:"outline",size:"sm",disabled:!n("players.direct_message")||!t||!t.isConnected,onClick:_,className:"pl-2",children:[u.jsx(tQ,{className:"h-5 mr-1"})," DM"]}),u.jsxs(De,{variant:"outline",size:"sm",disabled:!n("players.kick")||!t||!t.isConnected,onClick:v,className:"pl-2",children:[u.jsx(fIe,{style:{height:"1.25rem",width:"1.75rem",marginRight:"0.25rem",fill:"currentcolor"}})," Kick"]}),u.jsxs(De,{variant:"outline",size:"sm",disabled:!n("players.warn")||!t,onClick:y,className:"pl-2",children:[u.jsx(gv,{className:"h-5 mr-1"})," Warn"]})]})}const ih=[{title:"Info",icon:u.jsx(PC,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"History",icon:u.jsx(XX,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:u.jsx(mv,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Ban",icon:u.jsx(pv,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function y9e(){const{isModalOpen:e,closeModal:t,playerRef:n}=mJ(),[r,i]=w.useState(ih[0].title),[s,a]=w.useState(0),[o,l]=w.useState(void 0),[c,h]=w.useState(""),[d,f]=w.useState(0),m=Tt({method:"GET",path:"/player",abortOnUnmount:!0}),_=()=>{a(s+1)};w.useEffect(()=>{n&&(l(void 0),h(""),m({queryParams:n,success:p=>{"error"in p?h(p.error):(l(p),f(Math.round(Date.now()/1e3)),!("license"in n)&&p.player.license&&t1(p.player.license))},error:p=>{h(p)}}))},[n,s]),w.useEffect(()=>{e||setTimeout(()=>{i(ih[0].title)},200)},[e]);const v=p=>{e&&!p&&t()},y=p=>{if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();const x=ih.findIndex(C=>C.title===r),b=p.key==="ArrowUp"?x-1:x+1,S=ih[b];if(S){i(S.title);const C=document.getElementById(`player-modal-tab-${S.title}`);C&&C.focus()}}};let g;return o?o.player.netid?g=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-success-inline font-mono mr-2",children:["[",o.player.netid,"]"]}),o.player.displayName]}):g=u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"text-destructive-inline font-mono mr-2",children:"[OFF]"}),o.player.displayName]}):c?g=u.jsx("span",{className:"text-destructive-inline",children:"Error!"}):g=u.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."}),u.jsx($l,{open:e,onOpenChange:v,children:u.jsxs(wa,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[u.jsx(Sa,{className:"px-4 py-3 border-b",children:u.jsx(Ca,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:g})}),u.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[u.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:ih.map(p=>u.jsxs(De,{id:`player-modal-tab-${p.title}`,variant:r===p.title?"secondary":"ghost",className:J("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",p.className),onClick:()=>i(p.title),onKeyDown:y,children:[p.icon," ",p.title]},p.title))}),u.jsx(hi,{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?u.jsxs(u.Fragment,{children:[r==="Info"&&u.jsx(u9e,{playerRef:n,player:o.player,serverTime:o.serverTime,tsFetch:d,setSelectedTab:i,refreshModalData:_}),r==="History"&&u.jsx(m9e,{actionHistory:o.player.actionHistory,serverTime:o.serverTime,refreshModalData:_}),r==="IDs"&&u.jsx(f9e,{player:o.player,refreshModalData:_}),r==="Ban"&&u.jsx(g9e,{banTemplates:o.banTemplates,playerRef:n})]}):u.jsx(Up,{children:c?u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):u.jsx(Vp,{msg:"Loading..."})})})]}),u.jsx(v9e,{playerRef:n,player:o==null?void 0:o.player})]})})}function x9e(){const e=f5(),t=_ie(),n=w.useRef(0),r=IIe(),i=uX(),s=mX(),a=$Ie();return w.useEffect(()=>{const o=window.txConsts.isWebInterface?["status","playerlist"]:["status"],l=xC(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 h=n.current+1;n.current=h,setTimeout(()=>{n.current===h&&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(){e("main socketio","got refreshToUpdate",Qu.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 _9e({action:e}){return u.jsxs("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:[u.jsx(_0,{type:"id",src:"action",list:e.ids}),u.jsx(_0,{type:"hwid",src:"action",list:"hwids"in e&&e.hwids?e.hwids:[]})]})}const b9e=e=>{if(!e)return 3;const t=e.trim().split(` `).length+1;return Math.min(Math.max(t,3),16)};function w9e({actionReason:e}){const t=w.useRef(null),[n,r]=w.useState(b9e(e));return u.jsxs(u.Fragment,{children:[u.jsx(Tn,{htmlFor:"actionReason",children:"Reason:"}),u.jsx(Eu,{ref:t,id:"actionReason",className:"w-full mt-1",readOnly:!0,value:e,style:{height:`${1+1.25*n}rem`}})]})}function S9e({action:e,serverTime:t,tsFetch:n}){const r=n1();let i;if(e.type==="ban")if(e.expiration===!1)i=u.jsx("span",{className:"text-destructive-inline",children:"Never"});else if(e.expiration>t){const d=Nv((t-e.expiration)*1e3,{units:["mo","w","d","h","m"]});i=u.jsxs("span",{className:"text-warning-inline",children:["In ",d]})}else i=u.jsx(Qc,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.expiration,tsFetch:n});let s;e.type==="warn"&&e.acked?s=u.jsx("span",{className:"opacity-75",children:"Yes"}):s=u.jsx("span",{className:"text-warning-inline",children:"Not yet"});let a;e.revocation.timestamp?a=u.jsxs("span",{className:"text-warning-inline",children:["By ",e.revocation.author," on ",u.jsx(Qc,{isDateOnly:!0,className:"cursor-help",serverTime:t,tsObject:e.revocation.timestamp,tsFetch:n})]}):a=u.jsx("span",{className:"opacity-75",children:"No"});const o=e.playerName!==!1?u.jsx("span",{children:e.playerName}):u.jsx("span",{className:"italic opacity-75",children:"unknown player"}),l=e.ids.filter(d=>d.startsWith("license:")),c=l.length===1?l[0].split(":")[1]:!1,h=()=>{c&&r({license:c})};return u.jsxs("div",{className:"px-1 mb-1 md:mb-4",children:[u.jsxs("dl",{className:"pb-2",children:[u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Date/Time"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:u.jsx(Qc,{className:"opacity-75 cursor-help",serverTime:t,tsObject:e.timestamp,tsFetch:n})})]}),e.type==="ban"&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Expiration"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:i})]}),e.type==="warn"&&u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player Accepted"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:s})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Revoked"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:a})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Admin"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2 mt-0",children:e.author})]}),u.jsxs("div",{className:"py-0.5 grid grid-cols-3 gap-4 px-0",children:[u.jsx("dt",{className:"text-sm font-medium leading-6 text-muted-foreground",children:"Player"}),u.jsx("dd",{className:"text-sm leading-6 col-span-2x mt-0",children:o}),u.jsx("dd",{className:"text-right",children:u.jsx(De,{variant:"outline",size:"inline",style:{minWidth:"8.25ch"},onClick:h,disabled:!c,children:"View"})})]})]}),u.jsx(w9e,{actionReason:e.reason})]})}function C9e({action:e,refreshModalData:t}){const[n,r]=w.useState(!1),{hasPerm:i}=fr(),s=Tt({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:d=>{r(!1),"success"in d&&t()}})},l=!!e.revocation.timestamp,c=i(e.type==="warn"?"players.warn":"players.ban"),h=l?`${e.type} revoked`:c?`Revoke ${a}`:"Revoke (no permission)";return u.jsx("div",{className:"flex flex-col gap-4 px-1 mb-1 md:mb-4",children:u.jsxs("div",{className:"space-y-2",children:[u.jsxs("h3",{className:"text-xl",children:["Revoke ",a]}),u.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.",u.jsxs("ul",{className:"list-disc list-inside pt-1",children:[e.type==="ban"&&u.jsx("li",{children:"The player will be able to rejoin the server."}),u.jsx("li",{children:"The player will not be notified of the revocation."}),u.jsxs("li",{children:["This ",e.type," will not be removed from the player history."]}),u.jsx("li",{children:"The revocation cannot be undone!"})]})]}),u.jsx(De,{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?u.jsxs("span",{className:"flex items-center leading-relaxed",children:[u.jsx(sn,{className:"inline animate-spin h-4"})," Revoking..."]}):h})]})})}const sh=[{title:"Info",icon:u.jsx(PC,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"IDs",icon:u.jsx(mv,{className:"mr-2 h-5 w-5 hidden xs:block"})},{title:"Revoke",icon:u.jsx($C,{className:"mr-2 h-5 w-5 hidden xs:block"}),className:"hover:bg-destructive hover:text-destructive-foreground"}];function k9e(){const{isModalOpen:e,closeModal:t,actionRef:n}=Hre(),[r,i]=w.useState(sh[0].title),[s,a]=w.useState(0),[o,l]=w.useState(void 0),[c,h]=w.useState(""),[d,f]=w.useState(0),m=Tt({method:"GET",path:"/history/action",abortOnUnmount:!0}),_=()=>{a(s+1)};w.useEffect(()=>{n&&(l(void 0),h(""),m({queryParams:{id:n},success:p=>{"error"in p?h(p.error):(l(p),f(Math.round(Date.now()/1e3)))},error:p=>{h(p)}}))},[n,s]),w.useEffect(()=>{e||setTimeout(()=>{i(sh[0].title)},200)},[e]);const v=p=>{e&&!p&&t()},y=p=>{if(p.key==="ArrowUp"||p.key==="ArrowDown"){p.preventDefault();const x=sh.findIndex(C=>C.title===r),b=p.key==="ArrowUp"?x-1:x+1,S=sh[b];if(S){i(S.title);const C=document.getElementById(`action-modal-tab-${S.title}`);C&&C.focus()}}};let g;if(o){const p=o.action.playerName!==!1?u.jsx("span",{children:o.action.playerName}):u.jsx("span",{className:"italic opacity-75",children:"unknown player"});if(o.action.type==="ban")g=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-destructive-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Banned ",p]});else if(o.action.type==="warn")g=u.jsxs(u.Fragment,{children:[u.jsxs("span",{className:"text-warning-inline font-mono mr-2",children:["[",o.action.id,"]"]}),"Warned ",p]});else throw new Error(`Unknown action type: ${o.action.type}`)}else c?g=u.jsx("span",{className:"text-destructive-inline",children:"Error!"}):g=u.jsx("span",{className:"text-muted-foreground italic",children:"Loading..."});return u.jsx($l,{open:e,onOpenChange:v,children:u.jsxs(wa,{className:"max-w-2xl h-full sm:h-auto max-h-full p-0 gap-1 sm:gap-4 flex flex-col",children:[u.jsx(Sa,{className:"px-4 py-3 border-b",children:u.jsx(Ca,{className:"tracking-wide line-clamp-1 leading-7 break-all mr-6",children:g})}),u.jsxs("div",{className:"flex flex-col md:flex-row md:px-4 h-full",children:[u.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:sh.map(p=>u.jsxs(De,{id:`action-modal-tab-${p.title}`,variant:r===p.title?"secondary":"ghost",className:J("w-full tracking-wider justify-center md:justify-start","h-7 rounded-sm px-2 text-sm","md:h-10 md:text-base",p.className),onClick:()=>i(p.title),onKeyDown:y,children:[p.icon," ",p.title]},p.title))}),u.jsx(hi,{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?u.jsxs(u.Fragment,{children:[r==="Info"&&u.jsx(S9e,{action:o.action,serverTime:o.serverTime,tsFetch:d}),r==="IDs"&&u.jsx(_9e,{action:o.action}),r==="Revoke"&&u.jsx(C9e,{action:o.action,refreshModalData:_})]}):u.jsx(Up,{children:c?u.jsxs("span",{className:"text-destructive-inline",children:["Error: ",c]}):u.jsx(Vp,{msg:"Loading..."})})})]})]})})}function E9e(){const e=f5(),t=uJ(),n=n1(),r=u5(),i=hAe();return Pi("message",s=>{s.data.type==="logoutNotice"?e("child iframe","got logoutNotice"):s.data.type==="openAccountModal"?t():s.data.type==="openPlayerModal"?n(s.data.ref):s.data.type==="navigateToPage"?dC(s.data.href):s.data.type==="globalHotkey"&&s.data.action==="toggleLightMode"&&i()}),w.useEffect(()=>{const s=new URL(window.location.toString()),a=s.searchParams.get(bw),o=s.searchParams.get(Lw);if(!(!a&&!o)){if(a){if(a.includes("#")){const[l,c]=a.split("#"),h=parseInt(c);if(l.length&&c.length&&!isNaN(h))return n({mutex:l,netid:h})}else if(a.length)return n({license:a})}else if(o&&o.length)return r(o);s.searchParams.delete(bw),s.searchParams.delete(Lw),window.history.replaceState({},"",s)}},[]),Pi("keydown",iL),u.jsx(u.Fragment,{children:u.jsxs(bH,{delayDuration:300,disableHoverableContent:!0,children:[u.jsx(lIe,{}),u.jsxs("div",{className:"md:px-3 min-h-full pt-[var(--page-pt)] pb-[var(--page-pb)] w-full max-w-[1920px] mx-auto flex flex-row gap-4",children:[u.jsx(GW,{}),u.jsx("main",{className:"flex flex-1 min-h-contentvh min-w-[360px]",children:u.jsx(ROe,{})}),window.txConsts.isWebInterface&&u.jsx(KW,{})]}),u.jsx(PIe,{}),u.jsx(WIe,{}),u.jsx(r9e,{}),u.jsx(i9e,{}),u.jsx(Fre,{}),u.jsx(a9e,{}),u.jsx(y9e,{}),u.jsx(k9e,{}),u.jsx(x9e,{})]})})}const pc=({children:e})=>u.jsx("h1",{className:"text-2xl font-bold text-red-500 mb-4",children:e}),oh=({children:e})=>u.jsx("p",{className:"whitespace-pre-wrap pb-2",children:e}),mc=({returnTo:e})=>u.jsx(Vu,{className:"w-full flex justify-center mt-4 pb-0",children:u.jsx(fs,{href:e,children:u.jsx(De,{className:"x",children:"Try Again"})})});function RU({error:e,returnTo:t}){var n,r;if(t=t??"/login","errorTitle"in e)return u.jsxs("div",{children:[u.jsx(pc,{children:e.errorTitle}),u.jsx(oh,{children:e.errorMessage}),u.jsx(mc,{returnTo:t})]});if(e.errorCode==="invalid_session")return u.jsxs("div",{children:[u.jsx(pc,{children:"Invalid Browser Session."}),u.jsxs(oh,{children:["You may have restarted txAdmin right before entering this page. ",u.jsx("br",{}),"Please return and try again."]}),u.jsx(mc,{returnTo:t})]});if(e.errorCode==="clock_desync")return u.jsxs("div",{children:[u.jsx(pc,{children:"Please Update/Synchronize your VPS clock."}),u.jsx(oh,{children:"Failed to login because this host's time is wrong. Please make sure to synchronize it with the internet."}),u.jsx(mc,{returnTo:t})]});if(e.errorCode==="timeout")return u.jsxs("div",{children:[u.jsx(pc,{children:"Connection to FiveM servers timed out."}),u.jsx(oh,{children:"Please try again or login using your existing username and backup password."}),u.jsx(mc,{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 u.jsxs("div",{children:[u.jsx(pc,{children:`The Cfx.re account '${s}' is not an admin.`}),u.jsxs(oh,{children:["The account above with identifier ",u.jsx(Ye,{children:i})," is not assigned to any account registered on txAdmin. ",u.jsx("br",{}),"You can also try to login using your username and backup password."]}),u.jsx(mc,{returnTo:t})]})}else return u.jsxs(u.Fragment,{children:[u.jsx(pc,{children:"Unknown Error:"}),u.jsx("div",{className:"text-left rounded-sm text-muted-foreground bg-muted p-1",children:u.jsx("code",{className:"text-left whitespace-pre-wrap ",children:JSON.stringify(e,null,2)})}),u.jsx(mc,{returnTo:t})]})}function T9e(){const{authData:e,setAuthData:t}=Pl(),[n,r]=w.useState(),i=w.useRef(!1),s=pl({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 w.useEffect(()=>{if(!(e||i.current))return i.current=!0,s.mutate({redirectUri:window.location.href}),s.reset},[]),n?u.jsx(RU,{error:n}):u.jsx(Vp,{msg:"Logging in..."})}function R9e(){const[e,t]=w.useState(!1),[n,r]=w.useState(),[i,s]=w.useState(!1),a=w.useRef(null),o=pl({mutationFn:({pin:h,origin:d})=>fetch("/auth/addMaster/pin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({pin:h,origin:d})}).then(f=>f.json()),onSuccess:h=>{"error"in h?h.error==="master_already_set"?(t(!0),window.location.href=`/login${Qu.MASTER_ALREADY_SET}`):(s(!0),r(h.error)):(t(!0),console.log("Redirecting to",h.authUrl),window.location.href=h.authUrl)},onError:h=>{s(!0),h.message.startsWith("NetworkError")?r("Network error. If you closed txAdmin, please restart it and try again."):r(h.message)}}),l=h=>{var d;h==null||h.preventDefault(),s(!1),r(void 0),o.mutate({pin:((d=a.current)==null?void 0:d.value)||"0000",origin:window.location.origin})};w.useEffect(()=>{/^#\d{4}$/.test(window.location.hash)&&(r("Auto-filled ✔"),a.current.value=window.location.hash.substring(1))},[]);const c=o.isPending||e;return u.jsxs("form",{onSubmit:l,className:"w-full",children:[u.jsxs(H0,{className:"space-y-1",children:[u.jsx(_C,{className:"text-3xl",children:"No Cfx.re account linked."}),u.jsx(k7,{className:"text-sm text-muted-foreground",children:'Type the PIN from your terminal and click "Link Account".'})]}),u.jsxs(Uu,{className:"grid gap-2",children:[u.jsx("span",{className:J("text-center",i?"text-destructive":"text-success"),children:n??u.jsx(u.Fragment,{children:" "})}),u.jsx(wt,{className:J("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)},onChange:h=>{h.target.value.length===4&&l()},disabled:c,required:!0})]}),u.jsx(Vu,{children:u.jsxs(De,{className:"w-full",disabled:c,children:[c&&u.jsx(sn,{className:"mr-2 h-4 w-4 animate-spin"}),"Link Account"]})})]})}var v3="Checkbox",[M9e,a$e]=Un(v3),[A9e,j9e]=M9e(v3),MU=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:i,defaultChecked:s,required:a,disabled:o,value:l="on",onCheckedChange:c,form:h,...d}=e,[f,m]=w.useState(null),_=We(t,b=>m(b)),v=w.useRef(!1),y=f?h||!!f.closest("form"):!0,[g=!1,p]=fi({prop:i,defaultProp:s,onChange:c}),x=w.useRef(g);return w.useEffect(()=>{const b=f==null?void 0:f.form;if(b){const S=()=>p(x.current);return b.addEventListener("reset",S),()=>b.removeEventListener("reset",S)}},[f,p]),u.jsxs(A9e,{scope:n,state:g,disabled:o,children:[u.jsx(Ee.button,{type:"button",role:"checkbox","aria-checked":ta(g)?"mixed":g,"aria-required":a,"data-state":DU(g),"data-disabled":o?"":void 0,disabled:o,value:l,...d,ref:_,onKeyDown:fe(e.onKeyDown,b=>{b.key==="Enter"&&b.preventDefault()}),onClick:fe(e.onClick,b=>{p(S=>ta(S)?!0:!S),y&&(v.current=b.isPropagationStopped(),v.current||b.stopPropagation())})}),y&&u.jsx(D9e,{control:f,bubbles:!v.current,name:r,value:l,checked:g,required:a,disabled:o,form:h,style:{transform:"translateX(-100%)"},defaultChecked:ta(s)?!1:s})]})});MU.displayName=v3;var AU="CheckboxIndicator",jU=w.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...i}=e,s=j9e(AU,n);return u.jsx(xn,{present:r||ta(s.state)||s.state===!0,children:u.jsx(Ee.span,{"data-state":DU(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:t,style:{pointerEvents:"none",...e.style}})})});jU.displayName=AU;var D9e=e=>{const{control:t,checked:n,bubbles:r=!0,defaultChecked:i,...s}=e,a=w.useRef(null),o=xp(n),l=h1(t);w.useEffect(()=>{const h=a.current,d=window.HTMLInputElement.prototype,m=Object.getOwnPropertyDescriptor(d,"checked").set;if(o!==n&&m){const _=new Event("click",{bubbles:r});h.indeterminate=ta(n),m.call(h,ta(n)?!1:n),h.dispatchEvent(_)}},[o,n,r]);const c=w.useRef(ta(n)?!1:n);return u.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i??c.current,...s,tabIndex:-1,ref:a,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function ta(e){return e==="indeterminate"}function DU(e){return ta(e)?"indeterminate":e?"checked":"unchecked"}var LU=MU,L9e=jU;const NU=w.forwardRef(({className:e,...t},n)=>u.jsx(LU,{ref:n,className:J("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:u.jsx(L9e,{className:J("flex items-center justify-center text-current"),children:u.jsx(LC,{className:"h-4 w-4"})})}));NU.displayName=LU.displayName;function N9e({fivemId:e,fivemName:t,profilePicture:n}){const{setAuthData:r}=Pl(),[i,s]=w.useState(),a=w.useRef(null),o=w.useRef(null),l=w.useRef(null),c=w.useRef(null),h=pl({mutationKey:["auth"],mutationFn:({discordId:f,password:m})=>fetch("/auth/addMaster/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({discordId:f,password:m})}).then(_=>_.json()),onSuccess:f=>{"error"in f?s(f.error):(window.txConsts.hasMasterAccount=!0,r(f))},onError:f=>{f.message.startsWith("NetworkError")?s("Network error. If you closed txAdmin, please restart it and try again."):s(f.message)}}),d=f=>{var g,p,x,b,S;f==null||f.preventDefault(),s(void 0);let m,_=(p=(g=a.current)==null?void 0:g.value)==null?void 0:p.trim();if(typeof _=="string"&&_.length>0){if(_.startsWith("discord:")&&(_=_.substring(8),a.current.value=_),!Xr.validIdentifierParts.discord.test(_)){s(`The Discord ID needs to be the numeric "User ID" instead of the username. You can also leave it blank.`);return}m=_}if(((x=c.current)==null?void 0:x.value)!=="on"){s("You MUST agree to the terms.");return}const v=((b=o.current)==null?void 0:b.value)||"",y=((S=l.current)==null?void 0:S.value)||"";if(v.lengthXr.adminPasswordMaxLength){s(`The password must be between ${Xr.adminPasswordMinLength} and ${Xr.adminPasswordMaxLength} characters long.`);return}else if(v!==y){s("The passwords do not match.");return}h.mutate({discordId:m,password:v})};return w.useEffect(()=>{try{const f=localStorage.getItem("authCredsAutofill");if(f){const[m,_]=JSON.parse(f);o.current.value=_??"",l.current.value=_??""}}catch(f){console.error("Passwords autofill failed",f)}},[]),u.jsxs("form",{onSubmit:d,className:"w-full text-left",children:[u.jsxs(Uu,{className:"flex flex-col gap-4",children:[u.jsxs("div",{children:["Cfx.re account",u.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:[u.jsx(UW,{className:"h-16 w-16 text-3xl",username:t,profilePicture:n}),u.jsxs("div",{className:"text-left ml-4 overflow-hidden text-ellipsis",children:[u.jsx("span",{className:"text-2xl",children:t})," ",u.jsx("br",{}),u.jsx("code",{className:"text-muted-foreground",children:e})]})]})]}),u.jsx("input",{type:"text",name:"frm-username",className:"hidden",value:t,readOnly:!0}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex flex-row justify-between items-center",children:[u.jsx(Ph,{htmlFor:"frm-discord",children:"Discord ID"}),u.jsx("span",{className:"text-muted-foreground text-xs",children:"(optional)"})]}),u.jsx(wt,{className:"dark:placeholder:text-zinc-800",id:"frm-discord",type:"text",ref:a,placeholder:"000000000000000000",disabled:h.isPending})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsxs("div",{className:"flex flex-row justify-between items-center",children:[u.jsx(Ph,{htmlFor:"frm-password",children:"Backup Password"}),u.jsxs("span",{className:"text-muted-foreground text-xs",children:["(",Xr.adminPasswordMinLength,"~",Xr.adminPasswordMaxLength," digits)"]})]}),u.jsx(wt,{className:"dark:placeholder:text-zinc-800",id:"frm-password",type:"password",ref:o,placeholder:"password",disabled:h.isPending,required:!0})]}),u.jsxs("div",{className:"grid gap-2",children:[u.jsx(Ph,{htmlFor:"frm-password2",children:"Confirm Password"}),u.jsx(wt,{className:"dark:placeholder:text-zinc-800",id:"frm-password2",type:"password",ref:l,placeholder:"password",disabled:h.isPending,required:!0})]}),u.jsxs("div",{className:"flex items-center space-x-2 mt-2",children:[u.jsx(NU,{id:"terms",ref:c,required:!0}),u.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 ",u.jsx("a",{href:"https://fivem.net/terms",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"Creator PLA"})," as well as the ",u.jsx("a",{href:"https://github.com/tabarra/txAdmin/blob/master/LICENSE",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:"txAdmin License"}),"."]})]})]}),u.jsxs(Vu,{className:"flex-col gap-2",children:[u.jsx("span",{className:"text-center text-destructive whitespace-pre-wrap",children:i}),u.jsxs(De,{className:"w-full",disabled:h.isPending,children:[h.isPending&&u.jsx(sn,{className:"mr-2 h-4 w-4 animate-spin"}),"Register"]})]})]})}function P9e(){const e=w.useRef(!1),[t,n]=w.useState(),[r,i]=w.useState(),s=pl({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 w.useEffect(()=>{if(!(t||e.current))return e.current=!0,s.mutate({redirectUri:window.location.href}),s.reset},[]),t?u.jsx(N9e,{...t}):r?u.jsx(RU,{error:r,returnTo:"/addMaster/pin"}):u.jsx(Vp,{msg:"Authenticating..."})}function O9e(){return u.jsx("div",{className:"min-h-screen flex items-center justify-center pattern-dots",children:u.jsxs("div",{className:"text-center m-4 w-full xs:w-[25rem] min-w-[20rem]",children:[window.txConsts.providerLogo?u.jsx("img",{className:"max-w-56 max-h-24 m-auto",src:window.txConsts.providerLogo,alt:window.txConsts.providerName}):u.jsx(p3,{className:"w-52 mx-auto"}),u.jsx(z0,{className:"min-h-64 mt-8 mb-4 p-4 flex items-center justify-center bg-card/50",children:u.jsxs(r7,{children:[u.jsx(Pa,{path:"/login",children:u.jsx(wie,{})}),u.jsx(Pa,{path:"/login/callback",children:u.jsx(T9e,{})}),u.jsx(Pa,{path:"/addMaster/pin",children:u.jsx(R9e,{})}),u.jsx(Pa,{path:"/addMaster/callback",children:u.jsx(P9e,{})}),u.jsx(Pa,{path:"/:fullPath*",children:u.jsx("small",{children:"redirecting to the login page..."})})]})}),u.jsxs("div",{className:"mx-auto flex flex-wrap gap-4 justify-center mb-2",children:[window.txConsts.adsData.login?u.jsxs("a",{href:window.txConsts.adsData.login.url,onClick:gf,target:"_blank",className:`w-48 h-16 relative group shadow-sm opacity-90 hover:opacity-100 dark:brightness-90 dark:hover:brightness-110`,children:[u.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]`}),u.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:window.txConsts.adsData.login.img})]}):null,u.jsxs("a",{href:"https://discord.gg/uAmsGa2",onClick:gf,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:[u.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]`}),u.jsx("img",{className:"rounded-lg max-w-48 max-h-16 m-auto",src:"img/discord.png"})]})]}),u.jsx("div",{children:u.jsxs("small",{className:"text-muted-foreground text-sm font-light",children:["tx: ",u.jsxs("strong",{children:["v",window.txConsts.txaVersion]})," | fx: ",u.jsxs("strong",{children:["b",window.txConsts.fxsVersion]})]})})]})})}function I9e({children:e}){const{theme:t,setTheme:n}=Sz();return w.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]),u.jsx(u.Fragment,{children:e})}var y3={exports:{}};y3.exports=x3;var $9e=y3.exports.isMobile=x3;y3.exports.default=x3;const B9e=/(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,F9e=/CrOS/,z9e=/android|ipad|playbook|silk/i;function x3(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=B9e.test(t)&&!F9e.test(t)||!!e.tablet&&z9e.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=()=>{},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=$9e({tablet:!0})}catch{window.txIsMobile=!1}try{window.txBrowserLocale=(window==null?void 0:window.nuiSystemLanguages)??navigator.language??"en"}catch{window.txBrowserLocale="en"}try{const e=Intl.DateTimeFormat(window.txBrowserLocale,{hour:"numeric"}).resolvedOptions().hour12;window.txBrowserHour12=e??!0}catch{window.txBrowserHour12=!0}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 H9e=["/login","/addMaster"],_j=e=>H9e.some(t=>e.startsWith(t));function W9e(){ct(bie),ct(gX);const e=yie();return w.useEffect(()=>{if(e){const n=new URLSearchParams(window.location.search).get("r");n?Sie(n)?window.history.replaceState(null,"",n):window.history.replaceState(null,"","/"):_j(window.location.pathname)&&window.history.replaceState(null,"","/")}else!window.txConsts.hasMasterAccount&&!window.location.pathname.startsWith("/addMaster")?(console.log("No master account detected. Redirecting to addMaster page."),window.history.replaceState(null,"","/addMaster/pin")):_j(window.location.pathname)||(console.log("User is not authenticated. Redirecting to login page."),p5())},[e]),e?u.jsx(E9e,{}):u.jsx(O9e,{})}const U9e=new WQ;tb.createRoot(document.getElementById("root")).render(u.jsx(w.StrictMode,{children:u.jsx(Wj,{FallbackComponent:qY,children:u.jsx(KQ,{client:U9e,children:u.jsx(I9e,{children:u.jsx(W9e,{})})})})})); //# sourceMappingURL=index-d9le87ol.js.map