diff --git a/backend/routers/memory.py b/backend/routers/memory.py index dea6740..a5a2d2b 100644 --- a/backend/routers/memory.py +++ b/backend/routers/memory.py @@ -36,6 +36,12 @@ def export() -> dict: return memory.export_text() +@router.get("/memory/graph") +def graph(min_score: float = 0.45, top_k: int = 3) -> dict: + """Fakten als Ähnlichkeits-Graph (Knoten + semantische Kanten) für die Visualisierung.""" + return memory.graph(min_score=min_score, top_k=top_k) + + @router.post("/memory/learn", status_code=201) def learn(body: LearnIn) -> dict: """Auto-Lernen: Gesprächs-Turns/Text durchreichen → Mem0 extrahiert Fakten selbst.""" diff --git a/backend/services/memory.py b/backend/services/memory.py index 133b1e2..a4e7492 100644 --- a/backend/services/memory.py +++ b/backend/services/memory.py @@ -84,6 +84,11 @@ def learn(text: str | None = None, messages: list[dict] | None = None, "source": source, "category": category}) +def graph(min_score: float = 0.45, top_k: int = 3) -> dict: + """Fakten als Ähnlichkeits-Graph (Knoten + semantische Kanten) für die UI-Visualisierung.""" + return _get("/graph", min_score=min_score, top_k=top_k) + + def export_text() -> dict: rows = sorted(list_memories(), key=lambda r: (r.get("category", ""), r.get("updated_at", ""))) lines = ["# Mission Control — Gedächtnis\n"] diff --git a/frontend/dist/assets/GraphView-C2Rr5maK.js b/frontend/dist/assets/GraphView-C2Rr5maK.js new file mode 100644 index 0000000..8b69b4b --- /dev/null +++ b/frontend/dist/assets/GraphView-C2Rr5maK.js @@ -0,0 +1,3956 @@ +import{r as K,a as Hv,g as Hr,R as Um,c as q2,j as Ne,l as Z2,S as K2,b as Vx,T as $2}from"./index-DuvhfsJu.js";/** + * @license + * Copyright 2010-2023 Three.js Authors + * SPDX-License-Identifier: MIT + */const Yd="154",ab={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},J2={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},lb=0,L0=1,cb=2,Q2=3,ub=0,qd=1,gu=2,Or=3,ls=0,yi=1,vn=2,eC=2,Fs=0,pa=1,I0=2,D0=3,U0=4,hb=5,aa=100,fb=101,db=102,O0=103,N0=104,pb=200,mb=201,gb=202,vb=203,Vv=204,Wv=205,yb=206,_b=207,xb=208,wb=209,Sb=210,Eb=0,bb=1,Mb=2,Ld=3,Tb=4,Ab=5,Cb=6,Rb=7,ih=0,Pb=1,Lb=2,zr=0,Ib=1,Db=2,Ub=3,Xv=4,Ob=5,Zd=300,xo=301,wo=302,Cu=303,Ru=304,Jl=306,Pu=1e3,vi=1001,Lu=1002,Dn=1003,Id=1004,tC=1004,vu=1005,nC=1005,fn=1006,jv=1007,iC=1007,So=1008,rC=1008,os=1009,Nb=1010,Fb=1011,Kd=1012,Yv=1013,Ns=1014,rs=1015,Vl=1016,qv=1017,Zv=1018,mo=1020,kb=1021,Bi=1023,zb=1024,Bb=1025,go=1026,xa=1027,Gb=1028,Kv=1029,Hb=1030,$v=1031,Jv=1033,vd=33776,yd=33777,_d=33778,xd=33779,F0=35840,k0=35841,z0=35842,B0=35843,Vb=36196,G0=37492,H0=37496,V0=37808,W0=37809,X0=37810,j0=37811,Y0=37812,q0=37813,Z0=37814,K0=37815,$0=37816,J0=37817,Q0=37818,ev=37819,tv=37820,nv=37821,wd=36492,Wb=36283,iv=36284,rv=36285,sv=36286,Xb=2200,jb=2201,Yb=2202,Iu=2300,Du=2301,Sd=2302,ua=2400,ha=2401,Uu=2402,$d=2500,Qv=2501,sC=0,oC=1,aC=2,ey=3e3,vo=3001,qb=3200,ty=3201,Mo=0,Zb=1,yo="",Mt="srgb",Br="srgb-linear",ny="display-p3",lC=0,Ed=7680,cC=7681,uC=7682,hC=7683,fC=34055,dC=34056,pC=5386,mC=512,gC=513,vC=514,yC=515,_C=516,xC=517,wC=518,Kb=519,$b=512,Jb=513,Qb=514,eM=515,tM=516,nM=517,iM=518,rM=519,Ou=35044,SC=35048,EC=35040,bC=35045,MC=35049,TC=35041,AC=35046,CC=35050,RC=35042,PC="100",ov="300 es",Dd=1035,ss=2e3,Nu=2001;let Hs=class{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){if(this._listeners===void 0)return!1;const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){if(this._listeners===void 0)return;const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){if(this._listeners===void 0)return;const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,o=i.length;s>8&255]+mi[r>>16&255]+mi[r>>24&255]+"-"+mi[e&255]+mi[e>>8&255]+"-"+mi[e>>16&15|64]+mi[e>>24&255]+"-"+mi[t&63|128]+mi[t>>8&255]+"-"+mi[t>>16&255]+mi[t>>24&255]+mi[n&255]+mi[n>>8&255]+mi[n>>16&255]+mi[n>>24&255]).toLowerCase()}function Tn(r,e,t){return Math.max(e,Math.min(t,r))}function iy(r,e){return(r%e+e)%e}function LC(r,e,t,n,i){return n+(r-e)*(i-n)/(t-e)}function IC(r,e,t){return r!==e?(t-r)/(e-r):0}function yu(r,e,t){return(1-t)*r+t*e}function DC(r,e,t,n){return yu(r,e,1-Math.exp(-t*n))}function UC(r,e=1){return e-Math.abs(iy(r,e*2)-e)}function OC(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*(3-2*r))}function NC(r,e,t){return r<=e?0:r>=t?1:(r=(r-e)/(t-e),r*r*r*(r*(r*6-15)+10))}function FC(r,e){return r+Math.floor(Math.random()*(e-r+1))}function kC(r,e){return r+Math.random()*(e-r)}function zC(r){return r*(.5-Math.random())}function BC(r){r!==void 0&&(Wx=r);let e=Wx+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function GC(r){return r*ma}function HC(r){return r*Wl}function av(r){return(r&r-1)===0&&r!==0}function sM(r){return Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))}function Ud(r){return Math.pow(2,Math.floor(Math.log(r)/Math.LN2))}function VC(r,e,t,n,i){const s=Math.cos,o=Math.sin,a=s(t/2),l=o(t/2),c=s((e+n)/2),u=o((e+n)/2),h=s((e-n)/2),p=o((e-n)/2),m=s((n-e)/2),v=o((n-e)/2);switch(i){case"XYX":r.set(a*u,l*h,l*p,a*c);break;case"YZY":r.set(l*p,a*u,l*h,a*c);break;case"ZXZ":r.set(l*h,l*p,a*u,a*c);break;case"XZX":r.set(a*u,l*v,l*m,a*c);break;case"YXY":r.set(l*m,a*u,l*v,a*c);break;case"ZYZ":r.set(l*v,l*m,a*u,a*c);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+i)}}function Qi(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return r/4294967295;case Uint16Array:return r/65535;case Uint8Array:return r/255;case Int32Array:return Math.max(r/2147483647,-1);case Int16Array:return Math.max(r/32767,-1);case Int8Array:return Math.max(r/127,-1);default:throw new Error("Invalid component type.")}}function Lt(r,e){switch(e.constructor){case Float32Array:return r;case Uint32Array:return Math.round(r*4294967295);case Uint16Array:return Math.round(r*65535);case Uint8Array:return Math.round(r*255);case Int32Array:return Math.round(r*2147483647);case Int16Array:return Math.round(r*32767);case Int8Array:return Math.round(r*127);default:throw new Error("Invalid component type.")}}const Od={DEG2RAD:ma,RAD2DEG:Wl,generateUUID:er,clamp:Tn,euclideanModulo:iy,mapLinear:LC,inverseLerp:IC,lerp:yu,damp:DC,pingpong:UC,smoothstep:OC,smootherstep:NC,randInt:FC,randFloat:kC,randFloatSpread:zC,seededRandom:BC,degToRad:GC,radToDeg:HC,isPowerOfTwo:av,ceilPowerOfTwo:sM,floorPowerOfTwo:Ud,setQuaternionFromProperEuler:VC,normalize:Lt,denormalize:Qi};class De{constructor(e=0,t=0){De.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,i=e.elements;return this.x=i[0]*t+i[3]*n+i[6],this.y=i[1]*t+i[4]*n+i[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Tn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),i=Math.sin(t),s=this.x-e.x,o=this.y-e.y;return this.x=s*n-o*i+e.x,this.y=s*i+o*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Ct{constructor(e,t,n,i,s,o,a,l,c){Ct.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,a,l,c)}set(e,t,n,i,s,o,a,l,c){const u=this.elements;return u[0]=e,u[1]=i,u[2]=a,u[3]=t,u[4]=s,u[5]=l,u[6]=n,u[7]=o,u[8]=c,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[3],l=n[6],c=n[1],u=n[4],h=n[7],p=n[2],m=n[5],v=n[8],_=i[0],y=i[3],g=i[6],x=i[1],w=i[4],E=i[7],b=i[2],M=i[5],A=i[8];return s[0]=o*_+a*x+l*b,s[3]=o*y+a*w+l*M,s[6]=o*g+a*E+l*A,s[1]=c*_+u*x+h*b,s[4]=c*y+u*w+h*M,s[7]=c*g+u*E+h*A,s[2]=p*_+m*x+v*b,s[5]=p*y+m*w+v*M,s[8]=p*g+m*E+v*A,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8];return t*o*u-t*a*c-n*s*u+n*a*l+i*s*c-i*o*l}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=u*o-a*c,p=a*l-u*s,m=c*s-o*l,v=t*h+n*p+i*m;if(v===0)return this.set(0,0,0,0,0,0,0,0,0);const _=1/v;return e[0]=h*_,e[1]=(i*c-u*n)*_,e[2]=(a*n-i*o)*_,e[3]=p*_,e[4]=(u*t-i*l)*_,e[5]=(i*s-a*t)*_,e[6]=m*_,e[7]=(n*l-c*t)*_,e[8]=(o*t-n*s)*_,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,i,s,o,a){const l=Math.cos(s),c=Math.sin(s);return this.set(n*l,n*c,-n*(l*o+c*a)+o+e,-i*c,i*l,-i*(-c*o+l*a)+a+t,0,0,1),this}scale(e,t){return this.premultiply(Om.makeScale(e,t)),this}rotate(e){return this.premultiply(Om.makeRotation(-e)),this}translate(e,t){return this.premultiply(Om.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<9;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const Om=new Ct;function oM(r){for(let e=r.length-1;e>=0;--e)if(r[e]>=65535)return!0;return!1}const WC={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function Dl(r,e){return new WC[r](e)}function Fu(r){return document.createElementNS("http://www.w3.org/1999/xhtml",r)}const Xx={};function _u(r){r in Xx||(Xx[r]=!0,console.warn(r))}function zl(r){return r<.04045?r*.0773993808:Math.pow(r*.9478672986+.0521327014,2.4)}function Nm(r){return r<.0031308?r*12.92:1.055*Math.pow(r,.41666)-.055}const XC=new Ct().fromArray([.8224621,.0331941,.0170827,.177538,.9668058,.0723974,-1e-7,1e-7,.9105199]),jC=new Ct().fromArray([1.2249401,-.0420569,-.0196376,-.2249404,1.0420571,-.0786361,1e-7,0,1.0982735]);function YC(r){return r.convertSRGBToLinear().applyMatrix3(jC)}function qC(r){return r.applyMatrix3(XC).convertLinearToSRGB()}const ZC={[Br]:r=>r,[Mt]:r=>r.convertSRGBToLinear(),[ny]:YC},KC={[Br]:r=>r,[Mt]:r=>r.convertLinearToSRGB(),[ny]:qC},vr={enabled:!0,get legacyMode(){return console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),!this.enabled},set legacyMode(r){console.warn("THREE.ColorManagement: .legacyMode=false renamed to .enabled=true in r150."),this.enabled=!r},get workingColorSpace(){return Br},set workingColorSpace(r){console.warn("THREE.ColorManagement: .workingColorSpace is readonly.")},convert:function(r,e,t){if(this.enabled===!1||e===t||!e||!t)return r;const n=ZC[e],i=KC[t];if(n===void 0||i===void 0)throw new Error(`Unsupported color space conversion, "${e}" to "${t}".`);return i(n(r))},fromWorkingColorSpace:function(r,e){return this.convert(r,this.workingColorSpace,e)},toWorkingColorSpace:function(r,e){return this.convert(r,e,this.workingColorSpace)}};let Ka;class ry{static getDataURL(e){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let t;if(e instanceof HTMLCanvasElement)t=e;else{Ka===void 0&&(Ka=Fu("canvas")),Ka.width=e.width,Ka.height=e.height;const n=Ka.getContext("2d");e instanceof ImageData?n.putImageData(e,0,0):n.drawImage(e,0,0,e.width,e.height),t=Ka}return t.width>2048||t.height>2048?(console.warn("THREE.ImageUtils.getDataURL: Image converted to jpg for performance reasons",e),t.toDataURL("image/jpeg",.6)):t.toDataURL("image/png")}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=Fu("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const i=n.getImageData(0,0,e.width,e.height),s=i.data;for(let o=0;o0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Zd)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Pu:e.x=e.x-Math.floor(e.x);break;case vi:e.x=e.x<0?0:1;break;case Lu:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Pu:e.y=e.y-Math.floor(e.y);break;case vi:e.y=e.y<0?0:1;break;case Lu:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}get encoding(){return _u("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace===Mt?vo:ey}set encoding(e){_u("THREE.Texture: Property .encoding has been replaced by .colorSpace."),this.colorSpace=e===vo?Mt:yo}}Sn.DEFAULT_IMAGE=null;Sn.DEFAULT_MAPPING=Zd;Sn.DEFAULT_ANISOTROPY=1;class Xt{constructor(e=0,t=0,n=0,i=1){Xt.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=i}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,i){return this.x=e,this.y=t,this.z=n,this.w=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=this.w,o=e.elements;return this.x=o[0]*t+o[4]*n+o[8]*i+o[12]*s,this.y=o[1]*t+o[5]*n+o[9]*i+o[13]*s,this.z=o[2]*t+o[6]*n+o[10]*i+o[14]*s,this.w=o[3]*t+o[7]*n+o[11]*i+o[15]*s,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,i,s;const l=e.elements,c=l[0],u=l[4],h=l[8],p=l[1],m=l[5],v=l[9],_=l[2],y=l[6],g=l[10];if(Math.abs(u-p)<.01&&Math.abs(h-_)<.01&&Math.abs(v-y)<.01){if(Math.abs(u+p)<.1&&Math.abs(h+_)<.1&&Math.abs(v+y)<.1&&Math.abs(c+m+g-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const w=(c+1)/2,E=(m+1)/2,b=(g+1)/2,M=(u+p)/4,A=(h+_)/4,P=(v+y)/4;return w>E&&w>b?w<.01?(n=0,i=.707106781,s=.707106781):(n=Math.sqrt(w),i=M/n,s=A/n):E>b?E<.01?(n=.707106781,i=0,s=.707106781):(i=Math.sqrt(E),n=M/i,s=P/i):b<.01?(n=.707106781,i=.707106781,s=0):(s=Math.sqrt(b),n=A/s,i=P/s),this.set(n,i,s,t),this}let x=Math.sqrt((y-v)*(y-v)+(h-_)*(h-_)+(p-u)*(p-u));return Math.abs(x)<.001&&(x=1),this.x=(y-v)/x,this.y=(h-_)/x,this.z=(p-u)/x,this.w=Math.acos((c+m+g-1)/2),this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this.w=Math.max(e.w,Math.min(t.w,this.w)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this.w=Math.max(e,Math.min(t,this.w)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class Gr extends Hs{constructor(e=1,t=1,n={}){super(),this.isWebGLRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new Xt(0,0,e,t),this.scissorTest=!1,this.viewport=new Xt(0,0,e,t);const i={width:e,height:t,depth:1};n.encoding!==void 0&&(_u("THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace."),n.colorSpace=n.encoding===vo?Mt:yo),this.texture=new Sn(i,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.flipY=!1,this.texture.generateMipmaps=n.generateMipmaps!==void 0?n.generateMipmaps:!1,this.texture.internalFormat=n.internalFormat!==void 0?n.internalFormat:null,this.texture.minFilter=n.minFilter!==void 0?n.minFilter:fn,this.depthBuffer=n.depthBuffer!==void 0?n.depthBuffer:!0,this.stencilBuffer=n.stencilBuffer!==void 0?n.stencilBuffer:!1,this.depthTexture=n.depthTexture!==void 0?n.depthTexture:null,this.samples=n.samples!==void 0?n.samples:0}setSize(e,t,n=1){(this.width!==e||this.height!==t||this.depth!==n)&&(this.width=e,this.height=t,this.depth=n,this.texture.image.width=e,this.texture.image.height=t,this.texture.image.depth=n,this.dispose()),this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.texture=e.texture.clone(),this.texture.isRenderTargetTexture=!0;const t=Object.assign({},e.texture.image);return this.texture.source=new fa(t),this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Jd extends Sn{constructor(e=null,t=1,n=1,i=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Dn,this.minFilter=Dn,this.wrapR=vi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class QC extends Gr{constructor(e=1,t=1,n=1){super(e,t),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new Jd(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class sy extends Sn{constructor(e=null,t=1,n=1,i=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:i},this.magFilter=Dn,this.minFilter=Dn,this.wrapR=vi,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class eR extends Gr{constructor(e=1,t=1,n=1){super(e,t),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new sy(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class tR extends Gr{constructor(e=1,t=1,n=1,i={}){super(e,t,i),this.isWebGLMultipleRenderTargets=!0;const s=this.texture;this.texture=[];for(let o=0;o=0?1:-1,w=1-g*g;if(w>Number.EPSILON){const b=Math.sqrt(w),M=Math.atan2(b,g*x);y=Math.sin(y*M)/b,a=Math.sin(a*M)/b}const E=a*x;if(l=l*y+p*E,c=c*y+m*E,u=u*y+v*E,h=h*y+_*E,y===1-a){const b=1/Math.sqrt(l*l+c*c+u*u+h*h);l*=b,c*=b,u*=b,h*=b}}e[t]=l,e[t+1]=c,e[t+2]=u,e[t+3]=h}static multiplyQuaternionsFlat(e,t,n,i,s,o){const a=n[i],l=n[i+1],c=n[i+2],u=n[i+3],h=s[o],p=s[o+1],m=s[o+2],v=s[o+3];return e[t]=a*v+u*h+l*m-c*p,e[t+1]=l*v+u*p+c*h-a*m,e[t+2]=c*v+u*m+a*p-l*h,e[t+3]=u*v-a*h-l*p-c*m,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,i){return this._x=e,this._y=t,this._z=n,this._w=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t){const n=e._x,i=e._y,s=e._z,o=e._order,a=Math.cos,l=Math.sin,c=a(n/2),u=a(i/2),h=a(s/2),p=l(n/2),m=l(i/2),v=l(s/2);switch(o){case"XYZ":this._x=p*u*h+c*m*v,this._y=c*m*h-p*u*v,this._z=c*u*v+p*m*h,this._w=c*u*h-p*m*v;break;case"YXZ":this._x=p*u*h+c*m*v,this._y=c*m*h-p*u*v,this._z=c*u*v-p*m*h,this._w=c*u*h+p*m*v;break;case"ZXY":this._x=p*u*h-c*m*v,this._y=c*m*h+p*u*v,this._z=c*u*v+p*m*h,this._w=c*u*h-p*m*v;break;case"ZYX":this._x=p*u*h-c*m*v,this._y=c*m*h+p*u*v,this._z=c*u*v-p*m*h,this._w=c*u*h+p*m*v;break;case"YZX":this._x=p*u*h+c*m*v,this._y=c*m*h+p*u*v,this._z=c*u*v-p*m*h,this._w=c*u*h-p*m*v;break;case"XZY":this._x=p*u*h-c*m*v,this._y=c*m*h-p*u*v,this._z=c*u*v+p*m*h,this._w=c*u*h+p*m*v;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+o)}return t!==!1&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,i=Math.sin(n);return this._x=e.x*i,this._y=e.y*i,this._z=e.z*i,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],i=t[4],s=t[8],o=t[1],a=t[5],l=t[9],c=t[2],u=t[6],h=t[10],p=n+a+h;if(p>0){const m=.5/Math.sqrt(p+1);this._w=.25/m,this._x=(u-l)*m,this._y=(s-c)*m,this._z=(o-i)*m}else if(n>a&&n>h){const m=2*Math.sqrt(1+n-a-h);this._w=(u-l)/m,this._x=.25*m,this._y=(i+o)/m,this._z=(s+c)/m}else if(a>h){const m=2*Math.sqrt(1+a-n-h);this._w=(s-c)/m,this._x=(i+o)/m,this._y=.25*m,this._z=(l+u)/m}else{const m=2*Math.sqrt(1+h-n-a);this._w=(o-i)/m,this._x=(s+c)/m,this._y=(l+u)/m,this._z=.25*m}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return nMath.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(Tn(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const i=Math.min(1,t/n);return this.slerp(e,i),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,i=e._y,s=e._z,o=e._w,a=t._x,l=t._y,c=t._z,u=t._w;return this._x=n*u+o*a+i*c-s*l,this._y=i*u+o*l+s*a-n*c,this._z=s*u+o*c+n*l-i*a,this._w=o*u-n*a-i*l-s*c,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,i=this._y,s=this._z,o=this._w;let a=o*e._w+n*e._x+i*e._y+s*e._z;if(a<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,a=-a):this.copy(e),a>=1)return this._w=o,this._x=n,this._y=i,this._z=s,this;const l=1-a*a;if(l<=Number.EPSILON){const m=1-t;return this._w=m*o+t*this._w,this._x=m*n+t*this._x,this._y=m*i+t*this._y,this._z=m*s+t*this._z,this.normalize(),this._onChangeCallback(),this}const c=Math.sqrt(l),u=Math.atan2(c,a),h=Math.sin((1-t)*u)/c,p=Math.sin(t*u)/c;return this._w=o*h+this._w*p,this._x=n*h+this._x*p,this._y=i*h+this._y*p,this._z=s*h+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=Math.random(),t=Math.sqrt(1-e),n=Math.sqrt(e),i=2*Math.PI*Math.random(),s=2*Math.PI*Math.random();return this.set(t*Math.cos(i),n*Math.sin(s),n*Math.cos(s),t*Math.sin(i))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class Y{constructor(e=0,t=0,n=0){Y.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(jx.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(jx.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6]*i,this.y=s[1]*t+s[4]*n+s[7]*i,this.z=s[2]*t+s[5]*n+s[8]*i,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,i=this.z,s=e.elements,o=1/(s[3]*t+s[7]*n+s[11]*i+s[15]);return this.x=(s[0]*t+s[4]*n+s[8]*i+s[12])*o,this.y=(s[1]*t+s[5]*n+s[9]*i+s[13])*o,this.z=(s[2]*t+s[6]*n+s[10]*i+s[14])*o,this}applyQuaternion(e){const t=this.x,n=this.y,i=this.z,s=e.x,o=e.y,a=e.z,l=e.w,c=l*t+o*i-a*n,u=l*n+a*t-s*i,h=l*i+s*n-o*t,p=-s*t-o*n-a*i;return this.x=c*l+p*-s+u*-a-h*-o,this.y=u*l+p*-o+h*-s-c*-a,this.z=h*l+p*-a+c*-o-u*-s,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,i=this.z,s=e.elements;return this.x=s[0]*t+s[4]*n+s[8]*i,this.y=s[1]*t+s[5]*n+s[9]*i,this.z=s[2]*t+s[6]*n+s[10]*i,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=Math.max(e.x,Math.min(t.x,this.x)),this.y=Math.max(e.y,Math.min(t.y,this.y)),this.z=Math.max(e.z,Math.min(t.z,this.z)),this}clampScalar(e,t){return this.x=Math.max(e,Math.min(t,this.x)),this.y=Math.max(e,Math.min(t,this.y)),this.z=Math.max(e,Math.min(t,this.z)),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(Math.max(e,Math.min(t,n)))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,i=e.y,s=e.z,o=t.x,a=t.y,l=t.z;return this.x=i*l-s*a,this.y=s*o-n*l,this.z=n*a-i*o,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return km.copy(this).projectOnVector(e),this.sub(km)}reflect(e){return this.sub(km.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(Tn(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,i=this.z-e.z;return t*t+n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const i=Math.sin(t)*e;return this.x=i*Math.sin(n),this.y=Math.cos(t)*e,this.z=i*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),i=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=i,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=(Math.random()-.5)*2,t=Math.random()*Math.PI*2,n=Math.sqrt(1-e**2);return this.x=n*Math.cos(t),this.y=n*Math.sin(t),this.z=e,this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const km=new Y,jx=new si;class ir{constructor(e=new Y(1/0,1/0,1/0),t=new Y(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;tthis.max.x||e.ythis.max.y||e.zthis.max.z)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y||e.max.zthis.max.z)}intersectsSphere(e){return this.clampPoint(e.center,Es),Es.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Rc),hf.subVectors(this.max,Rc),Ja.subVectors(e.a,Rc),Qa.subVectors(e.b,Rc),el.subVectors(e.c,Rc),io.subVectors(Qa,Ja),ro.subVectors(el,Qa),Xo.subVectors(Ja,el);let t=[0,-io.z,io.y,0,-ro.z,ro.y,0,-Xo.z,Xo.y,io.z,0,-io.x,ro.z,0,-ro.x,Xo.z,0,-Xo.x,-io.y,io.x,0,-ro.y,ro.x,0,-Xo.y,Xo.x,0];return!zm(t,Ja,Qa,el,hf)||(t=[1,0,0,0,1,0,0,0,1],!zm(t,Ja,Qa,el,hf))?!1:(ff.crossVectors(io,ro),t=[ff.x,ff.y,ff.z],zm(t,Ja,Qa,el,hf))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Es).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Es).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(Ss[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),Ss[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),Ss[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),Ss[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),Ss[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),Ss[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),Ss[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),Ss[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(Ss),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const Ss=[new Y,new Y,new Y,new Y,new Y,new Y,new Y,new Y],Es=new Y,$a=new ir,Ja=new Y,Qa=new Y,el=new Y,io=new Y,ro=new Y,Xo=new Y,Rc=new Y,hf=new Y,ff=new Y,jo=new Y;function zm(r,e,t,n,i){for(let s=0,o=r.length-3;s<=o;s+=3){jo.fromArray(r,s);const a=i.x*Math.abs(jo.x)+i.y*Math.abs(jo.y)+i.z*Math.abs(jo.z),l=e.dot(jo),c=t.dot(jo),u=n.dot(jo);if(Math.max(-Math.max(l,c,u),Math.min(l,c,u))>a)return!1}return!0}const nR=new ir,Pc=new Y,Bm=new Y;let rr=class{constructor(e=new Y,t=-1){this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):nR.setFromPoints(e).getCenter(n);let i=0;for(let s=0,o=e.length;sthis.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;Pc.subVectors(e,this.center);const t=Pc.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),i=(n-this.radius)*.5;this.center.addScaledVector(Pc,i/n),this.radius+=i}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(Bm.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(Pc.copy(e.center).add(Bm)),this.expandByPoint(Pc.copy(e.center).sub(Bm))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}};const bs=new Y,Gm=new Y,df=new Y,so=new Y,Hm=new Y,pf=new Y,Vm=new Y;class Ql{constructor(e=new Y,t=new Y(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,bs)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=bs.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(bs.copy(this.origin).addScaledVector(this.direction,t),bs.distanceToSquared(e))}distanceSqToSegment(e,t,n,i){Gm.copy(e).add(t).multiplyScalar(.5),df.copy(t).sub(e).normalize(),so.copy(this.origin).sub(Gm);const s=e.distanceTo(t)*.5,o=-this.direction.dot(df),a=so.dot(this.direction),l=-so.dot(df),c=so.lengthSq(),u=Math.abs(1-o*o);let h,p,m,v;if(u>0)if(h=o*l-a,p=o*a-l,v=s*u,h>=0)if(p>=-v)if(p<=v){const _=1/u;h*=_,p*=_,m=h*(h+o*p+2*a)+p*(o*h+p+2*l)+c}else p=s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+c;else p=-s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+c;else p<=-v?(h=Math.max(0,-(-o*s+a)),p=h>0?-s:Math.min(Math.max(-s,-l),s),m=-h*h+p*(p+2*l)+c):p<=v?(h=0,p=Math.min(Math.max(-s,-l),s),m=p*(p+2*l)+c):(h=Math.max(0,-(o*s+a)),p=h>0?s:Math.min(Math.max(-s,-l),s),m=-h*h+p*(p+2*l)+c);else p=o>0?-s:s,h=Math.max(0,-(o*p+a)),m=-h*h+p*(p+2*l)+c;return n&&n.copy(this.origin).addScaledVector(this.direction,h),i&&i.copy(Gm).addScaledVector(df,p),m}intersectSphere(e,t){bs.subVectors(e.center,this.origin);const n=bs.dot(this.direction),i=bs.dot(bs)-n*n,s=e.radius*e.radius;if(i>s)return null;const o=Math.sqrt(s-i),a=n-o,l=n+o;return l<0?null:a<0?this.at(l,t):this.at(a,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,i,s,o,a,l;const c=1/this.direction.x,u=1/this.direction.y,h=1/this.direction.z,p=this.origin;return c>=0?(n=(e.min.x-p.x)*c,i=(e.max.x-p.x)*c):(n=(e.max.x-p.x)*c,i=(e.min.x-p.x)*c),u>=0?(s=(e.min.y-p.y)*u,o=(e.max.y-p.y)*u):(s=(e.max.y-p.y)*u,o=(e.min.y-p.y)*u),n>o||s>i||((s>n||isNaN(n))&&(n=s),(o=0?(a=(e.min.z-p.z)*h,l=(e.max.z-p.z)*h):(a=(e.max.z-p.z)*h,l=(e.min.z-p.z)*h),n>l||a>i)||((a>n||n!==n)&&(n=a),(l=0?n:i,t)}intersectsBox(e){return this.intersectBox(e,bs)!==null}intersectTriangle(e,t,n,i,s){Hm.subVectors(t,e),pf.subVectors(n,e),Vm.crossVectors(Hm,pf);let o=this.direction.dot(Vm),a;if(o>0){if(i)return null;a=1}else if(o<0)a=-1,o=-o;else return null;so.subVectors(this.origin,e);const l=a*this.direction.dot(pf.crossVectors(so,pf));if(l<0)return null;const c=a*this.direction.dot(Hm.cross(so));if(c<0||l+c>o)return null;const u=-a*so.dot(Vm);return u<0?null:this.at(u/o,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class yt{constructor(e,t,n,i,s,o,a,l,c,u,h,p,m,v,_,y){yt.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,i,s,o,a,l,c,u,h,p,m,v,_,y)}set(e,t,n,i,s,o,a,l,c,u,h,p,m,v,_,y){const g=this.elements;return g[0]=e,g[4]=t,g[8]=n,g[12]=i,g[1]=s,g[5]=o,g[9]=a,g[13]=l,g[2]=c,g[6]=u,g[10]=h,g[14]=p,g[3]=m,g[7]=v,g[11]=_,g[15]=y,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new yt().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,i=1/tl.setFromMatrixColumn(e,0).length(),s=1/tl.setFromMatrixColumn(e,1).length(),o=1/tl.setFromMatrixColumn(e,2).length();return t[0]=n[0]*i,t[1]=n[1]*i,t[2]=n[2]*i,t[3]=0,t[4]=n[4]*s,t[5]=n[5]*s,t[6]=n[6]*s,t[7]=0,t[8]=n[8]*o,t[9]=n[9]*o,t[10]=n[10]*o,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,i=e.y,s=e.z,o=Math.cos(n),a=Math.sin(n),l=Math.cos(i),c=Math.sin(i),u=Math.cos(s),h=Math.sin(s);if(e.order==="XYZ"){const p=o*u,m=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=-l*h,t[8]=c,t[1]=m+v*c,t[5]=p-_*c,t[9]=-a*l,t[2]=_-p*c,t[6]=v+m*c,t[10]=o*l}else if(e.order==="YXZ"){const p=l*u,m=l*h,v=c*u,_=c*h;t[0]=p+_*a,t[4]=v*a-m,t[8]=o*c,t[1]=o*h,t[5]=o*u,t[9]=-a,t[2]=m*a-v,t[6]=_+p*a,t[10]=o*l}else if(e.order==="ZXY"){const p=l*u,m=l*h,v=c*u,_=c*h;t[0]=p-_*a,t[4]=-o*h,t[8]=v+m*a,t[1]=m+v*a,t[5]=o*u,t[9]=_-p*a,t[2]=-o*c,t[6]=a,t[10]=o*l}else if(e.order==="ZYX"){const p=o*u,m=o*h,v=a*u,_=a*h;t[0]=l*u,t[4]=v*c-m,t[8]=p*c+_,t[1]=l*h,t[5]=_*c+p,t[9]=m*c-v,t[2]=-c,t[6]=a*l,t[10]=o*l}else if(e.order==="YZX"){const p=o*l,m=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=_-p*h,t[8]=v*h+m,t[1]=h,t[5]=o*u,t[9]=-a*u,t[2]=-c*u,t[6]=m*h+v,t[10]=p-_*h}else if(e.order==="XZY"){const p=o*l,m=o*c,v=a*l,_=a*c;t[0]=l*u,t[4]=-h,t[8]=c*u,t[1]=p*h+_,t[5]=o*u,t[9]=m*h-v,t[2]=v*h-m,t[6]=a*u,t[10]=_*h+p}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(iR,e,rR)}lookAt(e,t,n){const i=this.elements;return $i.subVectors(e,t),$i.lengthSq()===0&&($i.z=1),$i.normalize(),oo.crossVectors(n,$i),oo.lengthSq()===0&&(Math.abs(n.z)===1?$i.x+=1e-4:$i.z+=1e-4,$i.normalize(),oo.crossVectors(n,$i)),oo.normalize(),mf.crossVectors($i,oo),i[0]=oo.x,i[4]=mf.x,i[8]=$i.x,i[1]=oo.y,i[5]=mf.y,i[9]=$i.y,i[2]=oo.z,i[6]=mf.z,i[10]=$i.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,i=t.elements,s=this.elements,o=n[0],a=n[4],l=n[8],c=n[12],u=n[1],h=n[5],p=n[9],m=n[13],v=n[2],_=n[6],y=n[10],g=n[14],x=n[3],w=n[7],E=n[11],b=n[15],M=i[0],A=i[4],P=i[8],C=i[12],L=i[1],F=i[5],N=i[9],I=i[13],X=i[2],q=i[6],W=i[10],O=i[14],k=i[3],G=i[7],B=i[11],D=i[15];return s[0]=o*M+a*L+l*X+c*k,s[4]=o*A+a*F+l*q+c*G,s[8]=o*P+a*N+l*W+c*B,s[12]=o*C+a*I+l*O+c*D,s[1]=u*M+h*L+p*X+m*k,s[5]=u*A+h*F+p*q+m*G,s[9]=u*P+h*N+p*W+m*B,s[13]=u*C+h*I+p*O+m*D,s[2]=v*M+_*L+y*X+g*k,s[6]=v*A+_*F+y*q+g*G,s[10]=v*P+_*N+y*W+g*B,s[14]=v*C+_*I+y*O+g*D,s[3]=x*M+w*L+E*X+b*k,s[7]=x*A+w*F+E*q+b*G,s[11]=x*P+w*N+E*W+b*B,s[15]=x*C+w*I+E*O+b*D,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],i=e[8],s=e[12],o=e[1],a=e[5],l=e[9],c=e[13],u=e[2],h=e[6],p=e[10],m=e[14],v=e[3],_=e[7],y=e[11],g=e[15];return v*(+s*l*h-i*c*h-s*a*p+n*c*p+i*a*m-n*l*m)+_*(+t*l*m-t*c*p+s*o*p-i*o*m+i*c*u-s*l*u)+y*(+t*c*h-t*a*m-s*o*h+n*o*m+s*a*u-n*c*u)+g*(-i*a*u-t*l*h+t*a*p+i*o*h-n*o*p+n*l*u)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const i=this.elements;return e.isVector3?(i[12]=e.x,i[13]=e.y,i[14]=e.z):(i[12]=e,i[13]=t,i[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],i=e[2],s=e[3],o=e[4],a=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],m=e[11],v=e[12],_=e[13],y=e[14],g=e[15],x=h*y*c-_*p*c+_*l*m-a*y*m-h*l*g+a*p*g,w=v*p*c-u*y*c-v*l*m+o*y*m+u*l*g-o*p*g,E=u*_*c-v*h*c+v*a*m-o*_*m-u*a*g+o*h*g,b=v*h*l-u*_*l-v*a*p+o*_*p+u*a*y-o*h*y,M=t*x+n*w+i*E+s*b;if(M===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const A=1/M;return e[0]=x*A,e[1]=(_*p*s-h*y*s-_*i*m+n*y*m+h*i*g-n*p*g)*A,e[2]=(a*y*s-_*l*s+_*i*c-n*y*c-a*i*g+n*l*g)*A,e[3]=(h*l*s-a*p*s-h*i*c+n*p*c+a*i*m-n*l*m)*A,e[4]=w*A,e[5]=(u*y*s-v*p*s+v*i*m-t*y*m-u*i*g+t*p*g)*A,e[6]=(v*l*s-o*y*s-v*i*c+t*y*c+o*i*g-t*l*g)*A,e[7]=(o*p*s-u*l*s+u*i*c-t*p*c-o*i*m+t*l*m)*A,e[8]=E*A,e[9]=(v*h*s-u*_*s-v*n*m+t*_*m+u*n*g-t*h*g)*A,e[10]=(o*_*s-v*a*s+v*n*c-t*_*c-o*n*g+t*a*g)*A,e[11]=(u*a*s-o*h*s-u*n*c+t*h*c+o*n*m-t*a*m)*A,e[12]=b*A,e[13]=(u*_*i-v*h*i+v*n*p-t*_*p-u*n*y+t*h*y)*A,e[14]=(v*a*i-o*_*i-v*n*l+t*_*l+o*n*y-t*a*y)*A,e[15]=(o*h*i-u*a*i+u*n*l-t*h*l-o*n*p+t*a*p)*A,this}scale(e){const t=this.elements,n=e.x,i=e.y,s=e.z;return t[0]*=n,t[4]*=i,t[8]*=s,t[1]*=n,t[5]*=i,t[9]*=s,t[2]*=n,t[6]*=i,t[10]*=s,t[3]*=n,t[7]*=i,t[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],i=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,i))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),i=Math.sin(t),s=1-n,o=e.x,a=e.y,l=e.z,c=s*o,u=s*a;return this.set(c*o+n,c*a-i*l,c*l+i*a,0,c*a+i*l,u*a+n,u*l-i*o,0,c*l-i*a,u*l+i*o,s*l*l+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,i,s,o){return this.set(1,n,s,0,e,1,o,0,t,i,1,0,0,0,0,1),this}compose(e,t,n){const i=this.elements,s=t._x,o=t._y,a=t._z,l=t._w,c=s+s,u=o+o,h=a+a,p=s*c,m=s*u,v=s*h,_=o*u,y=o*h,g=a*h,x=l*c,w=l*u,E=l*h,b=n.x,M=n.y,A=n.z;return i[0]=(1-(_+g))*b,i[1]=(m+E)*b,i[2]=(v-w)*b,i[3]=0,i[4]=(m-E)*M,i[5]=(1-(p+g))*M,i[6]=(y+x)*M,i[7]=0,i[8]=(v+w)*A,i[9]=(y-x)*A,i[10]=(1-(p+_))*A,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this}decompose(e,t,n){const i=this.elements;let s=tl.set(i[0],i[1],i[2]).length();const o=tl.set(i[4],i[5],i[6]).length(),a=tl.set(i[8],i[9],i[10]).length();this.determinant()<0&&(s=-s),e.x=i[12],e.y=i[13],e.z=i[14],Cr.copy(this);const c=1/s,u=1/o,h=1/a;return Cr.elements[0]*=c,Cr.elements[1]*=c,Cr.elements[2]*=c,Cr.elements[4]*=u,Cr.elements[5]*=u,Cr.elements[6]*=u,Cr.elements[8]*=h,Cr.elements[9]*=h,Cr.elements[10]*=h,t.setFromRotationMatrix(Cr),n.x=s,n.y=o,n.z=a,this}makePerspective(e,t,n,i,s,o,a=ss){const l=this.elements,c=2*s/(t-e),u=2*s/(n-i),h=(t+e)/(t-e),p=(n+i)/(n-i);let m,v;if(a===ss)m=-(o+s)/(o-s),v=-2*o*s/(o-s);else if(a===Nu)m=-o/(o-s),v=-o*s/(o-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+a);return l[0]=c,l[4]=0,l[8]=h,l[12]=0,l[1]=0,l[5]=u,l[9]=p,l[13]=0,l[2]=0,l[6]=0,l[10]=m,l[14]=v,l[3]=0,l[7]=0,l[11]=-1,l[15]=0,this}makeOrthographic(e,t,n,i,s,o,a=ss){const l=this.elements,c=1/(t-e),u=1/(n-i),h=1/(o-s),p=(t+e)*c,m=(n+i)*u;let v,_;if(a===ss)v=(o+s)*h,_=-2*h;else if(a===Nu)v=s*h,_=-1*h;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+a);return l[0]=2*c,l[4]=0,l[8]=0,l[12]=-p,l[1]=0,l[5]=2*u,l[9]=0,l[13]=-m,l[2]=0,l[6]=0,l[10]=_,l[14]=-v,l[3]=0,l[7]=0,l[11]=0,l[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let i=0;i<16;i++)if(t[i]!==n[i])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const tl=new Y,Cr=new yt,iR=new Y(0,0,0),rR=new Y(1,1,1),oo=new Y,mf=new Y,$i=new Y,Yx=new yt,qx=new si;class Eo{constructor(e=0,t=0,n=0,i=Eo.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=i}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,i=this._order){return this._x=e,this._y=t,this._z=n,this._order=i,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const i=e.elements,s=i[0],o=i[4],a=i[8],l=i[1],c=i[5],u=i[9],h=i[2],p=i[6],m=i[10];switch(t){case"XYZ":this._y=Math.asin(Tn(a,-1,1)),Math.abs(a)<.9999999?(this._x=Math.atan2(-u,m),this._z=Math.atan2(-o,s)):(this._x=Math.atan2(p,c),this._z=0);break;case"YXZ":this._x=Math.asin(-Tn(u,-1,1)),Math.abs(u)<.9999999?(this._y=Math.atan2(a,m),this._z=Math.atan2(l,c)):(this._y=Math.atan2(-h,s),this._z=0);break;case"ZXY":this._x=Math.asin(Tn(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-h,m),this._z=Math.atan2(-o,c)):(this._y=0,this._z=Math.atan2(l,s));break;case"ZYX":this._y=Math.asin(-Tn(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(p,m),this._z=Math.atan2(l,s)):(this._x=0,this._z=Math.atan2(-o,c));break;case"YZX":this._z=Math.asin(Tn(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(-u,c),this._y=Math.atan2(-h,s)):(this._x=0,this._y=Math.atan2(a,m));break;case"XZY":this._z=Math.asin(-Tn(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(p,c),this._y=Math.atan2(a,s)):(this._x=Math.atan2(-u,m),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return Yx.makeRotationFromQuaternion(e),this.setFromRotationMatrix(Yx,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return qx.setFromEuler(this),this.setFromQuaternion(qx,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Eo.DEFAULT_ORDER="XYZ";class ga{constructor(){this.mask=1}set(e){this.mask=(1<>>0}enable(e){this.mask|=1<1){for(let t=0;t1){for(let n=0;n0&&(n=n.concat(o))}return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Lc,e,oR),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(Lc,aR,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,i=t.length;n0&&(i.userData=this.userData),i.layers=this.layers.mask,i.matrix=this.matrix.toArray(),i.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(i.matrixAutoUpdate=!1),this.isInstancedMesh&&(i.type="InstancedMesh",i.count=this.count,i.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(i.instanceColor=this.instanceColor.toJSON()));function s(a,l){return a[l.uuid]===void 0&&(a[l.uuid]=l.toJSON(e)),l.uuid}if(this.isScene)this.background&&(this.background.isColor?i.background=this.background.toJSON():this.background.isTexture&&(i.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(i.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){i.geometry=s(e.geometries,this.geometry);const a=this.geometry.parameters;if(a!==void 0&&a.shapes!==void 0){const l=a.shapes;if(Array.isArray(l))for(let c=0,u=l.length;c0){i.children=[];for(let a=0;a0){i.animations=[];for(let a=0;a0&&(n.geometries=a),l.length>0&&(n.materials=l),c.length>0&&(n.textures=c),u.length>0&&(n.images=u),h.length>0&&(n.shapes=h),p.length>0&&(n.skeletons=p),m.length>0&&(n.animations=m),v.length>0&&(n.nodes=v)}return n.object=i,n;function o(a){const l=[];for(const c in a){const u=a[c];delete u.metadata,l.push(u)}return l}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations,this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n0?i.multiplyScalar(1/Math.sqrt(s)):i.set(0,0,0)}static getBarycoord(e,t,n,i,s){Rr.subVectors(i,t),Ts.subVectors(n,t),Wm.subVectors(e,t);const o=Rr.dot(Rr),a=Rr.dot(Ts),l=Rr.dot(Wm),c=Ts.dot(Ts),u=Ts.dot(Wm),h=o*c-a*a;if(h===0)return s.set(-2,-1,-1);const p=1/h,m=(c*l-a*u)*p,v=(o*u-a*l)*p;return s.set(1-m-v,v,m)}static containsPoint(e,t,n,i){return this.getBarycoord(e,t,n,i,As),As.x>=0&&As.y>=0&&As.x+As.y<=1}static getUV(e,t,n,i,s,o,a,l){return vf===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),vf=!0),this.getInterpolation(e,t,n,i,s,o,a,l)}static getInterpolation(e,t,n,i,s,o,a,l){return this.getBarycoord(e,t,n,i,As),l.setScalar(0),l.addScaledVector(s,As.x),l.addScaledVector(o,As.y),l.addScaledVector(a,As.z),l}static isFrontFacing(e,t,n,i){return Rr.subVectors(n,t),Ts.subVectors(e,t),Rr.cross(Ts).dot(i)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,i){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[i]),this}setFromAttributeAndIndices(e,t,n,i){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return Rr.subVectors(this.c,this.b),Ts.subVectors(this.a,this.b),Rr.cross(Ts).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return zi.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return zi.getBarycoord(e,this.a,this.b,this.c,t)}getUV(e,t,n,i,s){return vf===!1&&(console.warn("THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation()."),vf=!0),zi.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}getInterpolation(e,t,n,i,s){return zi.getInterpolation(e,this.a,this.b,this.c,t,n,i,s)}containsPoint(e){return zi.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return zi.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,i=this.b,s=this.c;let o,a;il.subVectors(i,n),rl.subVectors(s,n),Xm.subVectors(e,n);const l=il.dot(Xm),c=rl.dot(Xm);if(l<=0&&c<=0)return t.copy(n);jm.subVectors(e,i);const u=il.dot(jm),h=rl.dot(jm);if(u>=0&&h<=u)return t.copy(i);const p=l*h-u*c;if(p<=0&&l>=0&&u<=0)return o=l/(l-u),t.copy(n).addScaledVector(il,o);Ym.subVectors(e,s);const m=il.dot(Ym),v=rl.dot(Ym);if(v>=0&&m<=v)return t.copy(s);const _=m*c-l*v;if(_<=0&&c>=0&&v<=0)return a=c/(c-v),t.copy(n).addScaledVector(rl,a);const y=u*v-m*h;if(y<=0&&h-u>=0&&m-v>=0)return e1.subVectors(s,i),a=(h-u)/(h-u+(m-v)),t.copy(i).addScaledVector(e1,a);const g=1/(y+_+p);return o=_*g,a=p*g,t.copy(n).addScaledVector(il,o).addScaledVector(rl,a)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}let cR=0;class oi extends Hs{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:cR++}),this.uuid=er(),this.name="",this.type="Material",this.blending=pa,this.side=ls,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Vv,this.blendDst=Wv,this.blendEquation=aa,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.depthFunc=Ld,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=Kb,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ed,this.stencilZFail=Ed,this.stencilZPass=Ed,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBuild(){}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const i=this[t];if(i===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}i&&i.isColor?i.set(n):i&&i.isVector3&&n&&n.isVector3?i.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==pa&&(n.blending=this.blending),this.side!==ls&&(n.side=this.side),this.vertexColors&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=this.transparent),n.depthFunc=this.depthFunc,n.depthTest=this.depthTest,n.depthWrite=this.depthWrite,n.colorWrite=this.colorWrite,n.stencilWrite=this.stencilWrite,n.stencilWriteMask=this.stencilWriteMask,n.stencilFunc=this.stencilFunc,n.stencilRef=this.stencilRef,n.stencilFuncMask=this.stencilFuncMask,n.stencilFail=this.stencilFail,n.stencilZFail=this.stencilZFail,n.stencilZPass=this.stencilZPass,this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=this.alphaHash),this.alphaToCoverage===!0&&(n.alphaToCoverage=this.alphaToCoverage),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=this.premultipliedAlpha),this.forceSinglePass===!0&&(n.forceSinglePass=this.forceSinglePass),this.wireframe===!0&&(n.wireframe=this.wireframe),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=this.flatShading),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function i(s){const o=[];for(const a in s){const l=s[a];delete l.metadata,o.push(l)}return o}if(t){const s=i(e.textures),o=i(e.images);s.length>0&&(n.textures=s),o.length>0&&(n.images=o)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const i=t.length;n=new Array(i);for(let s=0;s!==i;++s)n[s]=t[s].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}const aM={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Pr={h:0,s:0,l:0},yf={h:0,s:0,l:0};function qm(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*6*(2/3-t):r}class Ke{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const i=e;i&&i.isColor?this.copy(i):typeof i=="number"?this.setHex(i):typeof i=="string"&&this.setStyle(i)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=Mt){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,vr.toWorkingColorSpace(this,t),this}setRGB(e,t,n,i=vr.workingColorSpace){return this.r=e,this.g=t,this.b=n,vr.toWorkingColorSpace(this,i),this}setHSL(e,t,n,i=vr.workingColorSpace){if(e=iy(e,1),t=Tn(t,0,1),n=Tn(n,0,1),t===0)this.r=this.g=this.b=n;else{const s=n<=.5?n*(1+t):n+t-n*t,o=2*n-s;this.r=qm(o,s,e+1/3),this.g=qm(o,s,e),this.b=qm(o,s,e-1/3)}return vr.toWorkingColorSpace(this,i),this}setStyle(e,t=Mt){function n(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let i;if(i=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const o=i[1],a=i[2];switch(o){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,t);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,t);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(a))return n(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(i=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=i[1],o=s.length;if(o===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,t);if(o===6)return this.setHex(parseInt(s,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=Mt){const n=aM[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=zl(e.r),this.g=zl(e.g),this.b=zl(e.b),this}copyLinearToSRGB(e){return this.r=Nm(e.r),this.g=Nm(e.g),this.b=Nm(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=Mt){return vr.fromWorkingColorSpace(gi.copy(this),e),Math.round(Tn(gi.r*255,0,255))*65536+Math.round(Tn(gi.g*255,0,255))*256+Math.round(Tn(gi.b*255,0,255))}getHexString(e=Mt){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=vr.workingColorSpace){vr.fromWorkingColorSpace(gi.copy(this),t);const n=gi.r,i=gi.g,s=gi.b,o=Math.max(n,i,s),a=Math.min(n,i,s);let l,c;const u=(a+o)/2;if(a===o)l=0,c=0;else{const h=o-a;switch(c=u<=.5?h/(o+a):h/(2-o-a),o){case n:l=(i-s)/h+(i>-c-14,n[l|256]=1024>>-c-14|32768,i[l]=-c-1,i[l|256]=-c-1):c<=15?(n[l]=c+15<<10,n[l|256]=c+15<<10|32768,i[l]=13,i[l|256]=13):c<128?(n[l]=31744,n[l|256]=64512,i[l]=24,i[l|256]=24):(n[l]=31744,n[l|256]=64512,i[l]=13,i[l|256]=13)}const s=new Uint32Array(2048),o=new Uint32Array(64),a=new Uint32Array(64);for(let l=1;l<1024;++l){let c=l<<13,u=0;for(;(c&8388608)===0;)c<<=1,u-=8388608;c&=-8388609,u+=947912704,s[l]=c|u}for(let l=1024;l<2048;++l)s[l]=939524096+(l-1024<<13);for(let l=1;l<31;++l)o[l]=l<<23;o[31]=1199570944,o[32]=2147483648;for(let l=33;l<63;++l)o[l]=2147483648+(l-32<<23);o[63]=3347054592;for(let l=1;l<64;++l)l!==32&&(a[l]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:i,mantissaTable:s,exponentTable:o,offsetTable:a}}function ki(r){Math.abs(r)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),r=Tn(r,-65504,65504),Os.floatView[0]=r;const e=Os.uint32View[0],t=e>>23&511;return Os.baseTable[t]+((e&8388607)>>Os.shiftTable[t])}function hu(r){const e=r>>10;return Os.uint32View[0]=Os.mantissaTable[Os.offsetTable[e]+(r&1023)]+Os.exponentTable[e],Os.floatView[0]}const hR={toHalfFloat:ki,fromHalfFloat:hu},Fn=new Y,_f=new De;class $t{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=Ou,this.updateRange={offset:0,count:-1},this.gpuType=rs,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let i=0,s=this.itemSize;i0&&(e.userData=this.userData),this.parameters!==void 0){const l=this.parameters;for(const c in l)l[c]!==void 0&&(e[c]=l[c]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const l in n){const c=n[l];e.data.attributes[l]=c.toJSON(e.data)}const i={};let s=!1;for(const l in this.morphAttributes){const c=this.morphAttributes[l],u=[];for(let h=0,p=c.length;h0&&(i[l]=u,s=!0)}s&&(e.data.morphAttributes=i,e.data.morphTargetsRelative=this.morphTargetsRelative);const o=this.groups;o.length>0&&(e.data.groups=JSON.parse(JSON.stringify(o)));const a=this.boundingSphere;return a!==null&&(e.data.boundingSphere={center:a.center.toArray(),radius:a.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone(t));const i=e.attributes;for(const c in i){const u=i[c];this.setAttribute(c,u.clone(t))}const s=e.morphAttributes;for(const c in s){const u=[],h=s[c];for(let p=0,m=h.length;p0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s(e.far-e.near)**2))&&(t1.copy(s).invert(),Yo.copy(e.ray).applyMatrix4(t1),!(n.boundingBox!==null&&Yo.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,Yo)))}_computeIntersections(e,t,n){let i;const s=this.geometry,o=this.material,a=s.index,l=s.attributes.position,c=s.attributes.uv,u=s.attributes.uv1,h=s.attributes.normal,p=s.groups,m=s.drawRange;if(a!==null)if(Array.isArray(o))for(let v=0,_=p.length;v<_;v++){const y=p[v],g=o[y.materialIndex],x=Math.max(y.start,m.start),w=Math.min(a.count,Math.min(y.start+y.count,m.start+m.count));for(let E=x,b=w;Et.far?null:{distance:c,point:Tf.clone(),object:r}}function Af(r,e,t,n,i,s,o,a,l,c){r.getVertexPosition(a,ol),r.getVertexPosition(l,al),r.getVertexPosition(c,ll);const u=xR(r,e,t,n,ol,al,ll,Mf);if(u){i&&(Sf.fromBufferAttribute(i,a),Ef.fromBufferAttribute(i,l),bf.fromBufferAttribute(i,c),u.uv=zi.getInterpolation(Mf,ol,al,ll,Sf,Ef,bf,new De)),s&&(Sf.fromBufferAttribute(s,a),Ef.fromBufferAttribute(s,l),bf.fromBufferAttribute(s,c),u.uv1=zi.getInterpolation(Mf,ol,al,ll,Sf,Ef,bf,new De),u.uv2=u.uv1),o&&(i1.fromBufferAttribute(o,a),r1.fromBufferAttribute(o,l),s1.fromBufferAttribute(o,c),u.normal=zi.getInterpolation(Mf,ol,al,ll,i1,r1,s1,new Y),u.normal.dot(n.direction)>0&&u.normal.multiplyScalar(-1));const h={a,b:l,c,normal:new Y,materialIndex:0};zi.getNormal(ol,al,ll,h.normal),u.face=h}return u}class Ws extends Tt{constructor(e=1,t=1,n=1,i=1,s=1,o=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:i,heightSegments:s,depthSegments:o};const a=this;i=Math.floor(i),s=Math.floor(s),o=Math.floor(o);const l=[],c=[],u=[],h=[];let p=0,m=0;v("z","y","x",-1,-1,n,t,e,o,s,0),v("z","y","x",1,-1,n,t,-e,o,s,1),v("x","z","y",1,1,e,n,t,i,o,2),v("x","z","y",1,-1,e,n,-t,i,o,3),v("x","y","z",1,-1,e,t,n,i,s,4),v("x","y","z",-1,-1,e,t,-n,i,s,5),this.setIndex(l),this.setAttribute("position",new st(c,3)),this.setAttribute("normal",new st(u,3)),this.setAttribute("uv",new st(h,2));function v(_,y,g,x,w,E,b,M,A,P,C){const L=E/A,F=b/P,N=E/2,I=b/2,X=M/2,q=A+1,W=P+1;let O=0,k=0;const G=new Y;for(let B=0;B0?1:-1,u.push(G.x,G.y,G.z),h.push(V/A),h.push(1-B/P),O+=1}}for(let B=0;B0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const i in this.extensions)this.extensions[i]===!0&&(n[i]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class rh extends jt{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new yt,this.projectionMatrix=new yt,this.projectionMatrixInverse=new yt,this.coordinateSystem=ss}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(-t[8],-t[9],-t[10]).normalize()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}class zn extends rh{constructor(e=50,t=1,n=.1,i=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=i,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Wl*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(ma*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return Wl*2*Math.atan(Math.tan(ma*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}setViewOffset(e,t,n,i,s,o){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(ma*.5*this.fov)/this.zoom,n=2*t,i=this.aspect*n,s=-.5*i;const o=this.view;if(this.view!==null&&this.view.enabled){const l=o.fullWidth,c=o.fullHeight;s+=o.offsetX*i/l,t-=o.offsetY*n/c,i*=o.width/l,n*=o.height/c}const a=this.filmOffset;a!==0&&(s+=e*a/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+i,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const cl=-90,ul=1;class cM extends jt{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null;const i=new zn(cl,ul,e,t);i.layers=this.layers,this.add(i);const s=new zn(cl,ul,e,t);s.layers=this.layers,this.add(s);const o=new zn(cl,ul,e,t);o.layers=this.layers,this.add(o);const a=new zn(cl,ul,e,t);a.layers=this.layers,this.add(a);const l=new zn(cl,ul,e,t);l.layers=this.layers,this.add(l);const c=new zn(cl,ul,e,t);c.layers=this.layers,this.add(c)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,i,s,o,a,l]=t;for(const c of t)this.remove(c);if(e===ss)n.up.set(0,1,0),n.lookAt(1,0,0),i.up.set(0,1,0),i.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),o.up.set(0,0,1),o.lookAt(0,-1,0),a.up.set(0,1,0),a.lookAt(0,0,1),l.up.set(0,1,0),l.lookAt(0,0,-1);else if(e===Nu)n.up.set(0,-1,0),n.lookAt(-1,0,0),i.up.set(0,-1,0),i.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),o.up.set(0,0,-1),o.lookAt(0,-1,0),a.up.set(0,-1,0),a.lookAt(0,0,1),l.up.set(0,-1,0),l.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const c of t)this.add(c),c.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const n=this.renderTarget;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[i,s,o,a,l,c]=this.children,u=e.getRenderTarget(),h=e.toneMapping,p=e.xr.enabled;e.toneMapping=zr,e.xr.enabled=!1;const m=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0),e.render(t,i),e.setRenderTarget(n,1),e.render(t,s),e.setRenderTarget(n,2),e.render(t,o),e.setRenderTarget(n,3),e.render(t,a),e.setRenderTarget(n,4),e.render(t,l),n.texture.generateMipmaps=m,e.setRenderTarget(n,5),e.render(t,c),e.setRenderTarget(u),e.toneMapping=h,e.xr.enabled=p,n.texture.needsPMREMUpdate=!0}}class sh extends Sn{constructor(e,t,n,i,s,o,a,l,c,u){e=e!==void 0?e:[],t=t!==void 0?t:xo,super(e,t,n,i,s,o,a,l,c,u),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class uM extends Gr{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},i=[n,n,n,n,n,n];t.encoding!==void 0&&(_u("THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace."),t.colorSpace=t.encoding===vo?Mt:yo),this.texture=new sh(i,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:fn}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:` + + varying vec3 vWorldDirection; + + vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); + + } + + void main() { + + vWorldDirection = transformDirection( position, modelMatrix ); + + #include + #include + + } + `,fragmentShader:` + + uniform sampler2D tEquirect; + + varying vec3 vWorldDirection; + + #include + + void main() { + + vec3 direction = normalize( vWorldDirection ); + + vec2 sampleUV = equirectUv( direction ); + + gl_FragColor = texture2D( tEquirect, sampleUV ); + + } + `},i=new Ws(5,5,5),s=new cs({name:"CubemapFromEquirect",uniforms:Xl(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:yi,blending:Fs});s.uniforms.tEquirect.value=t;const o=new _n(i,s),a=t.minFilter;return t.minFilter===So&&(t.minFilter=fn),new cM(1,10,this).update(e,o),t.minFilter=a,o.geometry.dispose(),o.material.dispose(),this}clear(e,t,n,i){const s=e.getRenderTarget();for(let o=0;o<6;o++)e.setRenderTarget(this,o),e.clear(t,n,i);e.setRenderTarget(s)}}const $m=new Y,bR=new Y,MR=new Ct;class Us{constructor(e=new Y(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,i){return this.normal.set(e,t,n),this.constant=i,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const i=$m.subVectors(n,t).cross(bR.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(i,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta($m),i=this.normal.dot(n);if(i===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/i;return s<0||s>1?null:t.copy(e.start).addScaledVector(n,s)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||MR.getNormalMatrix(e),i=this.coplanarPoint($m).applyMatrix4(e),s=this.normal.applyMatrix3(n).normalize();return this.constant=-i.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const qo=new rr,Cf=new Y;class oh{constructor(e=new Us,t=new Us,n=new Us,i=new Us,s=new Us,o=new Us){this.planes=[e,t,n,i,s,o]}set(e,t,n,i,s,o){const a=this.planes;return a[0].copy(e),a[1].copy(t),a[2].copy(n),a[3].copy(i),a[4].copy(s),a[5].copy(o),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=ss){const n=this.planes,i=e.elements,s=i[0],o=i[1],a=i[2],l=i[3],c=i[4],u=i[5],h=i[6],p=i[7],m=i[8],v=i[9],_=i[10],y=i[11],g=i[12],x=i[13],w=i[14],E=i[15];if(n[0].setComponents(l-s,p-c,y-m,E-g).normalize(),n[1].setComponents(l+s,p+c,y+m,E+g).normalize(),n[2].setComponents(l+o,p+u,y+v,E+x).normalize(),n[3].setComponents(l-o,p-u,y-v,E-x).normalize(),n[4].setComponents(l-a,p-h,y-_,E-w).normalize(),t===ss)n[5].setComponents(l+a,p+h,y+_,E+w).normalize();else if(t===Nu)n[5].setComponents(a,h,_,w).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),qo.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),qo.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(qo)}intersectsSprite(e){return qo.center.set(0,0,0),qo.radius=.7071067811865476,qo.applyMatrix4(e.matrixWorld),this.intersectsSphere(qo)}intersectsSphere(e){const t=this.planes,n=e.center,i=-e.radius;for(let s=0;s<6;s++)if(t[s].distanceToPoint(n)0?e.max.x:e.min.x,Cf.y=i.normal.y>0?e.max.y:e.min.y,Cf.z=i.normal.z>0?e.max.z:e.min.z,i.distanceToPoint(Cf)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function hM(){let r=null,e=!1,t=null,n=null;function i(s,o){t(s,o),n=r.requestAnimationFrame(i)}return{start:function(){e!==!0&&t!==null&&(n=r.requestAnimationFrame(i),e=!0)},stop:function(){r.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(s){t=s},setContext:function(s){r=s}}}function TR(r,e){const t=e.isWebGL2,n=new WeakMap;function i(c,u){const h=c.array,p=c.usage,m=r.createBuffer();r.bindBuffer(u,m),r.bufferData(u,h,p),c.onUploadCallback();let v;if(h instanceof Float32Array)v=r.FLOAT;else if(h instanceof Uint16Array)if(c.isFloat16BufferAttribute)if(t)v=r.HALF_FLOAT;else throw new Error("THREE.WebGLAttributes: Usage of Float16BufferAttribute requires WebGL2.");else v=r.UNSIGNED_SHORT;else if(h instanceof Int16Array)v=r.SHORT;else if(h instanceof Uint32Array)v=r.UNSIGNED_INT;else if(h instanceof Int32Array)v=r.INT;else if(h instanceof Int8Array)v=r.BYTE;else if(h instanceof Uint8Array)v=r.UNSIGNED_BYTE;else if(h instanceof Uint8ClampedArray)v=r.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+h);return{buffer:m,type:v,bytesPerElement:h.BYTES_PER_ELEMENT,version:c.version}}function s(c,u,h){const p=u.array,m=u.updateRange;r.bindBuffer(h,c),m.count===-1?r.bufferSubData(h,0,p):(t?r.bufferSubData(h,m.offset*p.BYTES_PER_ELEMENT,p,m.offset,m.count):r.bufferSubData(h,m.offset*p.BYTES_PER_ELEMENT,p.subarray(m.offset,m.offset+m.count)),m.count=-1),u.onUploadCallback()}function o(c){return c.isInterleavedBufferAttribute&&(c=c.data),n.get(c)}function a(c){c.isInterleavedBufferAttribute&&(c=c.data);const u=n.get(c);u&&(r.deleteBuffer(u.buffer),n.delete(c))}function l(c,u){if(c.isGLBufferAttribute){const p=n.get(c);(!p||p.version 0 + vec4 plane; + #pragma unroll_loop_start + for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard; + } + #pragma unroll_loop_end + #if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES + bool clipped = true; + #pragma unroll_loop_start + for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) { + plane = clippingPlanes[ i ]; + clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped; + } + #pragma unroll_loop_end + if ( clipped ) discard; + #endif +#endif`,GR=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; + uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ]; +#endif`,HR=`#if NUM_CLIPPING_PLANES > 0 + varying vec3 vClipPosition; +#endif`,VR=`#if NUM_CLIPPING_PLANES > 0 + vClipPosition = - mvPosition.xyz; +#endif`,WR=`#if defined( USE_COLOR_ALPHA ) + diffuseColor *= vColor; +#elif defined( USE_COLOR ) + diffuseColor.rgb *= vColor; +#endif`,XR=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) + varying vec3 vColor; +#endif`,jR=`#if defined( USE_COLOR_ALPHA ) + varying vec4 vColor; +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + varying vec3 vColor; +#endif`,YR=`#if defined( USE_COLOR_ALPHA ) + vColor = vec4( 1.0 ); +#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) + vColor = vec3( 1.0 ); +#endif +#ifdef USE_COLOR + vColor *= color; +#endif +#ifdef USE_INSTANCING_COLOR + vColor.xyz *= instanceColor.xyz; +#endif`,qR=`#define PI 3.141592653589793 +#define PI2 6.283185307179586 +#define PI_HALF 1.5707963267948966 +#define RECIPROCAL_PI 0.3183098861837907 +#define RECIPROCAL_PI2 0.15915494309189535 +#define EPSILON 1e-6 +#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +#define whiteComplement( a ) ( 1.0 - saturate( a ) ) +float pow2( const in float x ) { return x*x; } +vec3 pow2( const in vec3 x ) { return x*x; } +float pow3( const in float x ) { return x*x*x; } +float pow4( const in float x ) { float x2 = x*x; return x2*x2; } +float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); } +float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); } +highp float rand( const in vec2 uv ) { + const highp float a = 12.9898, b = 78.233, c = 43758.5453; + highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI ); + return fract( sin( sn ) * c ); +} +#ifdef HIGH_PRECISION + float precisionSafeLength( vec3 v ) { return length( v ); } +#else + float precisionSafeLength( vec3 v ) { + float maxComponent = max3( abs( v ) ); + return length( v / maxComponent ) * maxComponent; + } +#endif +struct IncidentLight { + vec3 color; + vec3 direction; + bool visible; +}; +struct ReflectedLight { + vec3 directDiffuse; + vec3 directSpecular; + vec3 indirectDiffuse; + vec3 indirectSpecular; +}; +struct GeometricContext { + vec3 position; + vec3 normal; + vec3 viewDir; +#ifdef USE_CLEARCOAT + vec3 clearcoatNormal; +#endif +}; +#ifdef USE_ALPHAHASH + varying vec3 vPosition; +#endif +vec3 transformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz ); +} +vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) { + return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz ); +} +mat3 transposeMat3( const in mat3 m ) { + mat3 tmp; + tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x ); + tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y ); + tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z ); + return tmp; +} +float luminance( const in vec3 rgb ) { + const vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 ); + return dot( weights, rgb ); +} +bool isPerspectiveMatrix( mat4 m ) { + return m[ 2 ][ 3 ] == - 1.0; +} +vec2 equirectUv( in vec3 dir ) { + float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5; + float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5; + return vec2( u, v ); +} +vec3 BRDF_Lambert( const in vec3 diffuseColor ) { + return RECIPROCAL_PI * diffuseColor; +} +vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} +float F_Schlick( const in float f0, const in float f90, const in float dotVH ) { + float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH ); + return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel ); +} // validated`,ZR=`#ifdef ENVMAP_TYPE_CUBE_UV + #define cubeUV_minMipLevel 4.0 + #define cubeUV_minTileSize 16.0 + float getFace( vec3 direction ) { + vec3 absDirection = abs( direction ); + float face = - 1.0; + if ( absDirection.x > absDirection.z ) { + if ( absDirection.x > absDirection.y ) + face = direction.x > 0.0 ? 0.0 : 3.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } else { + if ( absDirection.z > absDirection.y ) + face = direction.z > 0.0 ? 2.0 : 5.0; + else + face = direction.y > 0.0 ? 1.0 : 4.0; + } + return face; + } + vec2 getUV( vec3 direction, float face ) { + vec2 uv; + if ( face == 0.0 ) { + uv = vec2( direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 1.0 ) { + uv = vec2( - direction.x, - direction.z ) / abs( direction.y ); + } else if ( face == 2.0 ) { + uv = vec2( - direction.x, direction.y ) / abs( direction.z ); + } else if ( face == 3.0 ) { + uv = vec2( - direction.z, direction.y ) / abs( direction.x ); + } else if ( face == 4.0 ) { + uv = vec2( - direction.x, direction.z ) / abs( direction.y ); + } else { + uv = vec2( direction.x, direction.y ) / abs( direction.z ); + } + return 0.5 * ( uv + 1.0 ); + } + vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) { + float face = getFace( direction ); + float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 ); + mipInt = max( mipInt, cubeUV_minMipLevel ); + float faceSize = exp2( mipInt ); + highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0; + if ( face > 2.0 ) { + uv.y += faceSize; + face -= 3.0; + } + uv.x += face * faceSize; + uv.x += filterInt * 3.0 * cubeUV_minTileSize; + uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize ); + uv.x *= CUBEUV_TEXEL_WIDTH; + uv.y *= CUBEUV_TEXEL_HEIGHT; + #ifdef texture2DGradEXT + return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb; + #else + return texture2D( envMap, uv ).rgb; + #endif + } + #define cubeUV_r0 1.0 + #define cubeUV_v0 0.339 + #define cubeUV_m0 - 2.0 + #define cubeUV_r1 0.8 + #define cubeUV_v1 0.276 + #define cubeUV_m1 - 1.0 + #define cubeUV_r4 0.4 + #define cubeUV_v4 0.046 + #define cubeUV_m4 2.0 + #define cubeUV_r5 0.305 + #define cubeUV_v5 0.016 + #define cubeUV_m5 3.0 + #define cubeUV_r6 0.21 + #define cubeUV_v6 0.0038 + #define cubeUV_m6 4.0 + float roughnessToMip( float roughness ) { + float mip = 0.0; + if ( roughness >= cubeUV_r1 ) { + mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0; + } else if ( roughness >= cubeUV_r4 ) { + mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1; + } else if ( roughness >= cubeUV_r5 ) { + mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4; + } else if ( roughness >= cubeUV_r6 ) { + mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5; + } else { + mip = - 2.0 * log2( 1.16 * roughness ); } + return mip; + } + vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) { + float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP ); + float mipF = fract( mip ); + float mipInt = floor( mip ); + vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt ); + if ( mipF == 0.0 ) { + return vec4( color0, 1.0 ); + } else { + vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 ); + return vec4( mix( color0, color1, mipF ), 1.0 ); + } + } +#endif`,KR=`vec3 transformedNormal = objectNormal; +#ifdef USE_INSTANCING + mat3 m = mat3( instanceMatrix ); + transformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) ); + transformedNormal = m * transformedNormal; +#endif +transformedNormal = normalMatrix * transformedNormal; +#ifdef FLIP_SIDED + transformedNormal = - transformedNormal; +#endif +#ifdef USE_TANGENT + vec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #ifdef FLIP_SIDED + transformedTangent = - transformedTangent; + #endif +#endif`,$R=`#ifdef USE_DISPLACEMENTMAP + uniform sampler2D displacementMap; + uniform float displacementScale; + uniform float displacementBias; +#endif`,JR=`#ifdef USE_DISPLACEMENTMAP + transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias ); +#endif`,QR=`#ifdef USE_EMISSIVEMAP + vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv ); + totalEmissiveRadiance *= emissiveColor.rgb; +#endif`,eP=`#ifdef USE_EMISSIVEMAP + uniform sampler2D emissiveMap; +#endif`,tP="gl_FragColor = linearToOutputTexel( gl_FragColor );",nP=`vec4 LinearToLinear( in vec4 value ) { + return value; +} +vec4 LinearTosRGB( in vec4 value ) { + return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a ); +}`,iP=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vec3 cameraToFrag; + if ( isOrthographic ) { + cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToFrag = normalize( vWorldPosition - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vec3 reflectVec = reflect( cameraToFrag, worldNormal ); + #else + vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio ); + #endif + #else + vec3 reflectVec = vReflect; + #endif + #ifdef ENVMAP_TYPE_CUBE + vec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) ); + #else + vec4 envColor = vec4( 0.0 ); + #endif + #ifdef ENVMAP_BLENDING_MULTIPLY + outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_MIX ) + outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity ); + #elif defined( ENVMAP_BLENDING_ADD ) + outgoingLight += envColor.xyz * specularStrength * reflectivity; + #endif +#endif`,rP=`#ifdef USE_ENVMAP + uniform float envMapIntensity; + uniform float flipEnvMap; + #ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; + #else + uniform sampler2D envMap; + #endif + +#endif`,sP=`#ifdef USE_ENVMAP + uniform float reflectivity; + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + varying vec3 vWorldPosition; + uniform float refractionRatio; + #else + varying vec3 vReflect; + #endif +#endif`,oP=`#ifdef USE_ENVMAP + #if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT ) + #define ENV_WORLDPOS + #endif + #ifdef ENV_WORLDPOS + + varying vec3 vWorldPosition; + #else + varying vec3 vReflect; + uniform float refractionRatio; + #endif +#endif`,aP=`#ifdef USE_ENVMAP + #ifdef ENV_WORLDPOS + vWorldPosition = worldPosition.xyz; + #else + vec3 cameraToVertex; + if ( isOrthographic ) { + cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) ); + } else { + cameraToVertex = normalize( worldPosition.xyz - cameraPosition ); + } + vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + #ifdef ENVMAP_MODE_REFLECTION + vReflect = reflect( cameraToVertex, worldNormal ); + #else + vReflect = refract( cameraToVertex, worldNormal, refractionRatio ); + #endif + #endif +#endif`,lP=`#ifdef USE_FOG + vFogDepth = - mvPosition.z; +#endif`,cP=`#ifdef USE_FOG + varying float vFogDepth; +#endif`,uP=`#ifdef USE_FOG + #ifdef FOG_EXP2 + float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth ); + #else + float fogFactor = smoothstep( fogNear, fogFar, vFogDepth ); + #endif + gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor ); +#endif`,hP=`#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif +#endif`,fP=`#ifdef USE_GRADIENTMAP + uniform sampler2D gradientMap; +#endif +vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) { + float dotNL = dot( normal, lightDirection ); + vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 ); + #ifdef USE_GRADIENTMAP + return vec3( texture2D( gradientMap, coord ).r ); + #else + vec2 fw = fwidth( coord ) * 0.5; + return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) ); + #endif +}`,dP=`#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + reflectedLight.indirectDiffuse += lightMapIrradiance; +#endif`,pP=`#ifdef USE_LIGHTMAP + uniform sampler2D lightMap; + uniform float lightMapIntensity; +#endif`,mP=`LambertMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularStrength = specularStrength;`,gP=`varying vec3 vViewPosition; +struct LambertMaterial { + vec3 diffuseColor; + float specularStrength; +}; +void RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Lambert +#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,vP=`uniform bool receiveShadow; +uniform vec3 ambientLightColor; +uniform vec3 lightProbe[ 9 ]; +vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) { + float x = normal.x, y = normal.y, z = normal.z; + vec3 result = shCoefficients[ 0 ] * 0.886227; + result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y; + result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z; + result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x; + result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y; + result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z; + result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 ); + result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z; + result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y ); + return result; +} +vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) { + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe ); + return irradiance; +} +vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) { + vec3 irradiance = ambientLightColor; + return irradiance; +} +float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) { + #if defined ( LEGACY_LIGHTS ) + if ( cutoffDistance > 0.0 && decayExponent > 0.0 ) { + return pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent ); + } + return 1.0; + #else + float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 ); + if ( cutoffDistance > 0.0 ) { + distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) ); + } + return distanceFalloff; + #endif +} +float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) { + return smoothstep( coneCosine, penumbraCosine, angleCosine ); +} +#if NUM_DIR_LIGHTS > 0 + struct DirectionalLight { + vec3 direction; + vec3 color; + }; + uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ]; + void getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) { + light.color = directionalLight.color; + light.direction = directionalLight.direction; + light.visible = true; + } +#endif +#if NUM_POINT_LIGHTS > 0 + struct PointLight { + vec3 position; + vec3 color; + float distance; + float decay; + }; + uniform PointLight pointLights[ NUM_POINT_LIGHTS ]; + void getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) { + vec3 lVector = pointLight.position - geometry.position; + light.direction = normalize( lVector ); + float lightDistance = length( lVector ); + light.color = pointLight.color; + light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } +#endif +#if NUM_SPOT_LIGHTS > 0 + struct SpotLight { + vec3 position; + vec3 direction; + vec3 color; + float distance; + float decay; + float coneCos; + float penumbraCos; + }; + uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ]; + void getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) { + vec3 lVector = spotLight.position - geometry.position; + light.direction = normalize( lVector ); + float angleCos = dot( light.direction, spotLight.direction ); + float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos ); + if ( spotAttenuation > 0.0 ) { + float lightDistance = length( lVector ); + light.color = spotLight.color * spotAttenuation; + light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay ); + light.visible = ( light.color != vec3( 0.0 ) ); + } else { + light.color = vec3( 0.0 ); + light.visible = false; + } + } +#endif +#if NUM_RECT_AREA_LIGHTS > 0 + struct RectAreaLight { + vec3 color; + vec3 position; + vec3 halfWidth; + vec3 halfHeight; + }; + uniform sampler2D ltc_1; uniform sampler2D ltc_2; + uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ]; +#endif +#if NUM_HEMI_LIGHTS > 0 + struct HemisphereLight { + vec3 direction; + vec3 skyColor; + vec3 groundColor; + }; + uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ]; + vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) { + float dotNL = dot( normal, hemiLight.direction ); + float hemiDiffuseWeight = 0.5 * dotNL + 0.5; + vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight ); + return irradiance; + } +#endif`,yP=`#ifdef USE_ENVMAP + vec3 getIBLIrradiance( const in vec3 normal ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 worldNormal = inverseTransformDirection( normal, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 ); + return PI * envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 reflectVec = reflect( - viewDir, normal ); + reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) ); + reflectVec = inverseTransformDirection( reflectVec, viewMatrix ); + vec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness ); + return envMapColor.rgb * envMapIntensity; + #else + return vec3( 0.0 ); + #endif + } + #ifdef USE_ANISOTROPY + vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) { + #ifdef ENVMAP_TYPE_CUBE_UV + vec3 bentNormal = cross( bitangent, viewDir ); + bentNormal = normalize( cross( bentNormal, bitangent ) ); + bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) ); + return getIBLRadiance( viewDir, bentNormal, roughness ); + #else + return vec3( 0.0 ); + #endif + } + #endif +#endif`,_P=`ToonMaterial material; +material.diffuseColor = diffuseColor.rgb;`,xP=`varying vec3 vViewPosition; +struct ToonMaterial { + vec3 diffuseColor; +}; +void RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + vec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_Toon +#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,wP=`BlinnPhongMaterial material; +material.diffuseColor = diffuseColor.rgb; +material.specularColor = specular; +material.specularShininess = shininess; +material.specularStrength = specularStrength;`,SP=`varying vec3 vViewPosition; +struct BlinnPhongMaterial { + vec3 diffuseColor; + vec3 specularColor; + float specularShininess; + float specularStrength; +}; +void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); + reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength; +} +void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +#define RE_Direct RE_Direct_BlinnPhong +#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,EP=`PhysicalMaterial material; +material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor ); +vec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) ); +float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z ); +material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness; +material.roughness = min( material.roughness, 1.0 ); +#ifdef IOR + material.ior = ior; + #ifdef USE_SPECULAR + float specularIntensityFactor = specularIntensity; + vec3 specularColorFactor = specularColor; + #ifdef USE_SPECULAR_COLORMAP + specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a; + #endif + material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor ); + #else + float specularIntensityFactor = 1.0; + vec3 specularColorFactor = vec3( 1.0 ); + material.specularF90 = 1.0; + #endif + material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor ); +#else + material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor ); + material.specularF90 = 1.0; +#endif +#ifdef USE_CLEARCOAT + material.clearcoat = clearcoat; + material.clearcoatRoughness = clearcoatRoughness; + material.clearcoatF0 = vec3( 0.04 ); + material.clearcoatF90 = 1.0; + #ifdef USE_CLEARCOATMAP + material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x; + #endif + #ifdef USE_CLEARCOAT_ROUGHNESSMAP + material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y; + #endif + material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 ); + material.clearcoatRoughness += geometryRoughness; + material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 ); +#endif +#ifdef USE_IRIDESCENCE + material.iridescence = iridescence; + material.iridescenceIOR = iridescenceIOR; + #ifdef USE_IRIDESCENCEMAP + material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r; + #endif + #ifdef USE_IRIDESCENCE_THICKNESSMAP + material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum; + #else + material.iridescenceThickness = iridescenceThicknessMaximum; + #endif +#endif +#ifdef USE_SHEEN + material.sheenColor = sheenColor; + #ifdef USE_SHEEN_COLORMAP + material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb; + #endif + material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 ); + #ifdef USE_SHEEN_ROUGHNESSMAP + material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a; + #endif +#endif +#ifdef USE_ANISOTROPY + #ifdef USE_ANISOTROPYMAP + mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x ); + vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb; + vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b; + #else + vec2 anisotropyV = anisotropyVector; + #endif + material.anisotropy = length( anisotropyV ); + anisotropyV /= material.anisotropy; + material.anisotropy = saturate( material.anisotropy ); + material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) ); + material.anisotropyT = tbn[ 0 ] * anisotropyV.x - tbn[ 1 ] * anisotropyV.y; + material.anisotropyB = tbn[ 1 ] * anisotropyV.x + tbn[ 0 ] * anisotropyV.y; +#endif`,bP=`struct PhysicalMaterial { + vec3 diffuseColor; + float roughness; + vec3 specularColor; + float specularF90; + #ifdef USE_CLEARCOAT + float clearcoat; + float clearcoatRoughness; + vec3 clearcoatF0; + float clearcoatF90; + #endif + #ifdef USE_IRIDESCENCE + float iridescence; + float iridescenceIOR; + float iridescenceThickness; + vec3 iridescenceFresnel; + vec3 iridescenceF0; + #endif + #ifdef USE_SHEEN + vec3 sheenColor; + float sheenRoughness; + #endif + #ifdef IOR + float ior; + #endif + #ifdef USE_TRANSMISSION + float transmission; + float transmissionAlpha; + float thickness; + float attenuationDistance; + vec3 attenuationColor; + #endif + #ifdef USE_ANISOTROPY + float anisotropy; + float alphaT; + vec3 anisotropyT; + vec3 anisotropyB; + #endif +}; +vec3 clearcoatSpecular = vec3( 0.0 ); +vec3 sheenSpecular = vec3( 0.0 ); +vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) { + float x = clamp( 1.0 - dotVH, 0.0, 1.0 ); + float x2 = x * x; + float x5 = clamp( x * x2 * x2, 0.0, 0.9999 ); + return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 ); +} +float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) { + float a2 = pow2( alpha ); + float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) ); + float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) ); + return 0.5 / max( gv + gl, EPSILON ); +} +float D_GGX( const in float alpha, const in float dotNH ) { + float a2 = pow2( alpha ); + float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0; + return RECIPROCAL_PI * a2 / pow2( denom ); +} +#ifdef USE_ANISOTROPY + float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) { + float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) ); + float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) ); + float v = 0.5 / ( gv + gl ); + return saturate(v); + } + float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) { + float a2 = alphaT * alphaB; + highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH ); + highp float v2 = dot( v, v ); + float w2 = a2 / v2; + return RECIPROCAL_PI * a2 * pow2 ( w2 ); + } +#endif +#ifdef USE_CLEARCOAT + vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) { + vec3 f0 = material.clearcoatF0; + float f90 = material.clearcoatF90; + float roughness = material.clearcoatRoughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + return F * ( V * D ); + } +#endif +vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) { + vec3 f0 = material.specularColor; + float f90 = material.specularF90; + float roughness = material.roughness; + float alpha = pow2( roughness ); + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float dotVH = saturate( dot( viewDir, halfDir ) ); + vec3 F = F_Schlick( f0, f90, dotVH ); + #ifdef USE_IRIDESCENCE + F = mix( F, material.iridescenceFresnel, material.iridescence ); + #endif + #ifdef USE_ANISOTROPY + float dotTL = dot( material.anisotropyT, lightDir ); + float dotTV = dot( material.anisotropyT, viewDir ); + float dotTH = dot( material.anisotropyT, halfDir ); + float dotBL = dot( material.anisotropyB, lightDir ); + float dotBV = dot( material.anisotropyB, viewDir ); + float dotBH = dot( material.anisotropyB, halfDir ); + float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL ); + float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH ); + #else + float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV ); + float D = D_GGX( alpha, dotNH ); + #endif + return F * ( V * D ); +} +vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) { + const float LUT_SIZE = 64.0; + const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE; + const float LUT_BIAS = 0.5 / LUT_SIZE; + float dotNV = saturate( dot( N, V ) ); + vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) ); + uv = uv * LUT_SCALE + LUT_BIAS; + return uv; +} +float LTC_ClippedSphereFormFactor( const in vec3 f ) { + float l = length( f ); + return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 ); +} +vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) { + float x = dot( v1, v2 ); + float y = abs( x ); + float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y; + float b = 3.4175940 + ( 4.1616724 + y ) * y; + float v = a / b; + float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v; + return cross( v1, v2 ) * theta_sintheta; +} +vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) { + vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ]; + vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ]; + vec3 lightNormal = cross( v1, v2 ); + if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 ); + vec3 T1, T2; + T1 = normalize( V - N * dot( V, N ) ); + T2 = - cross( N, T1 ); + mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) ); + vec3 coords[ 4 ]; + coords[ 0 ] = mat * ( rectCoords[ 0 ] - P ); + coords[ 1 ] = mat * ( rectCoords[ 1 ] - P ); + coords[ 2 ] = mat * ( rectCoords[ 2 ] - P ); + coords[ 3 ] = mat * ( rectCoords[ 3 ] - P ); + coords[ 0 ] = normalize( coords[ 0 ] ); + coords[ 1 ] = normalize( coords[ 1 ] ); + coords[ 2 ] = normalize( coords[ 2 ] ); + coords[ 3 ] = normalize( coords[ 3 ] ); + vec3 vectorFormFactor = vec3( 0.0 ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] ); + vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] ); + float result = LTC_ClippedSphereFormFactor( vectorFormFactor ); + return vec3( result ); +} +#if defined( USE_SHEEN ) +float D_Charlie( float roughness, float dotNH ) { + float alpha = pow2( roughness ); + float invAlpha = 1.0 / alpha; + float cos2h = dotNH * dotNH; + float sin2h = max( 1.0 - cos2h, 0.0078125 ); + return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI ); +} +float V_Neubelt( float dotNV, float dotNL ) { + return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) ); +} +vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) { + vec3 halfDir = normalize( lightDir + viewDir ); + float dotNL = saturate( dot( normal, lightDir ) ); + float dotNV = saturate( dot( normal, viewDir ) ); + float dotNH = saturate( dot( normal, halfDir ) ); + float D = D_Charlie( sheenRoughness, dotNH ); + float V = V_Neubelt( dotNV, dotNL ); + return sheenColor * ( D * V ); +} +#endif +float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + float r2 = roughness * roughness; + float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95; + float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72; + float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) ); + return saturate( DG * RECIPROCAL_PI ); +} +vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) { + float dotNV = saturate( dot( normal, viewDir ) ); + const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 ); + const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 ); + vec4 r = roughness * c0 + c1; + float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y; + vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw; + return fab; +} +vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) { + vec2 fab = DFGApprox( normal, viewDir, roughness ); + return specularColor * fab.x + specularF90 * fab.y; +} +#ifdef USE_IRIDESCENCE +void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#else +void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) { +#endif + vec2 fab = DFGApprox( normal, viewDir, roughness ); + #ifdef USE_IRIDESCENCE + vec3 Fr = mix( specularColor, iridescenceF0, iridescence ); + #else + vec3 Fr = specularColor; + #endif + vec3 FssEss = Fr * fab.x + specularF90 * fab.y; + float Ess = fab.x + fab.y; + float Ems = 1.0 - Ess; + vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg ); + singleScatter += FssEss; + multiScatter += Fms * Ems; +} +#if NUM_RECT_AREA_LIGHTS > 0 + void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + vec3 normal = geometry.normal; + vec3 viewDir = geometry.viewDir; + vec3 position = geometry.position; + vec3 lightPos = rectAreaLight.position; + vec3 halfWidth = rectAreaLight.halfWidth; + vec3 halfHeight = rectAreaLight.halfHeight; + vec3 lightColor = rectAreaLight.color; + float roughness = material.roughness; + vec3 rectCoords[ 4 ]; + rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight; + rectCoords[ 2 ] = lightPos - halfWidth + halfHeight; + rectCoords[ 3 ] = lightPos + halfWidth + halfHeight; + vec2 uv = LTC_Uv( normal, viewDir, roughness ); + vec4 t1 = texture2D( ltc_1, uv ); + vec4 t2 = texture2D( ltc_2, uv ); + mat3 mInv = mat3( + vec3( t1.x, 0, t1.y ), + vec3( 0, 1, 0 ), + vec3( t1.z, 0, t1.w ) + ); + vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y ); + reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords ); + reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords ); + } +#endif +void RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + float dotNL = saturate( dot( geometry.normal, directLight.direction ) ); + vec3 irradiance = dotNL * directLight.color; + #ifdef USE_CLEARCOAT + float dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) ); + vec3 ccIrradiance = dotNLcc * directLight.color; + clearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material ); + #endif + #ifdef USE_SHEEN + sheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness ); + #endif + reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material ); + reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) { + reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor ); +} +void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) { + #ifdef USE_CLEARCOAT + clearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness ); + #endif + #ifdef USE_SHEEN + sheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness ); + #endif + vec3 singleScattering = vec3( 0.0 ); + vec3 multiScattering = vec3( 0.0 ); + vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI; + #ifdef USE_IRIDESCENCE + computeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering ); + #else + computeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering ); + #endif + vec3 totalScattering = singleScattering + multiScattering; + vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) ); + reflectedLight.indirectSpecular += radiance * singleScattering; + reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance; + reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance; +} +#define RE_Direct RE_Direct_Physical +#define RE_Direct_RectArea RE_Direct_RectArea_Physical +#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical +#define RE_IndirectSpecular RE_IndirectSpecular_Physical +float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) { + return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion ); +}`,MP=` +GeometricContext geometry; +geometry.position = - vViewPosition; +geometry.normal = normal; +geometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition ); +#ifdef USE_CLEARCOAT + geometry.clearcoatNormal = clearcoatNormal; +#endif +#ifdef USE_IRIDESCENCE + float dotNVi = saturate( dot( normal, geometry.viewDir ) ); + if ( material.iridescenceThickness == 0.0 ) { + material.iridescence = 0.0; + } else { + material.iridescence = saturate( material.iridescence ); + } + if ( material.iridescence > 0.0 ) { + material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor ); + material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi ); + } +#endif +IncidentLight directLight; +#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct ) + PointLight pointLight; + #if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) { + pointLight = pointLights[ i ]; + getPointLightInfo( pointLight, geometry, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS ) + pointLightShadow = pointLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0; + #endif + RE_Direct( directLight, geometry, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct ) + SpotLight spotLight; + vec4 spotColor; + vec3 spotLightCoord; + bool inSpotLightMap; + #if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) { + spotLight = spotLights[ i ]; + getSpotLightInfo( spotLight, geometry, directLight ); + #if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX + #elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + #define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS + #else + #define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS ) + #endif + #if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS ) + spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w; + inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) ); + spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy ); + directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color; + #endif + #undef SPOT_LIGHT_MAP_INDEX + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + spotLightShadow = spotLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometry, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct ) + DirectionalLight directionalLight; + #if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLightShadow; + #endif + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) { + directionalLight = directionalLights[ i ]; + getDirectionalLightInfo( directionalLight, geometry, directLight ); + #if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS ) + directionalLightShadow = directionalLightShadows[ i ]; + directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + #endif + RE_Direct( directLight, geometry, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea ) + RectAreaLight rectAreaLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) { + rectAreaLight = rectAreaLights[ i ]; + RE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight ); + } + #pragma unroll_loop_end +#endif +#if defined( RE_IndirectDiffuse ) + vec3 iblIrradiance = vec3( 0.0 ); + vec3 irradiance = getAmbientLightIrradiance( ambientLightColor ); + irradiance += getLightProbeIrradiance( lightProbe, geometry.normal ); + #if ( NUM_HEMI_LIGHTS > 0 ) + #pragma unroll_loop_start + for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) { + irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal ); + } + #pragma unroll_loop_end + #endif +#endif +#if defined( RE_IndirectSpecular ) + vec3 radiance = vec3( 0.0 ); + vec3 clearcoatRadiance = vec3( 0.0 ); +#endif`,TP=`#if defined( RE_IndirectDiffuse ) + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity; + irradiance += lightMapIrradiance; + #endif + #if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV ) + iblIrradiance += getIBLIrradiance( geometry.normal ); + #endif +#endif +#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular ) + #ifdef USE_ANISOTROPY + radiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy ); + #else + radiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness ); + #endif + #ifdef USE_CLEARCOAT + clearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness ); + #endif +#endif`,AP=`#if defined( RE_IndirectDiffuse ) + RE_IndirectDiffuse( irradiance, geometry, material, reflectedLight ); +#endif +#if defined( RE_IndirectSpecular ) + RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight ); +#endif`,CP=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + gl_FragDepthEXT = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5; +#endif`,RP=`#if defined( USE_LOGDEPTHBUF ) && defined( USE_LOGDEPTHBUF_EXT ) + uniform float logDepthBufFC; + varying float vFragDepth; + varying float vIsPerspective; +#endif`,PP=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + varying float vFragDepth; + varying float vIsPerspective; + #else + uniform float logDepthBufFC; + #endif +#endif`,LP=`#ifdef USE_LOGDEPTHBUF + #ifdef USE_LOGDEPTHBUF_EXT + vFragDepth = 1.0 + gl_Position.w; + vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) ); + #else + if ( isPerspectiveMatrix( projectionMatrix ) ) { + gl_Position.z = log2( max( EPSILON, gl_Position.w + 1.0 ) ) * logDepthBufFC - 1.0; + gl_Position.z *= gl_Position.w; + } + #endif +#endif`,IP=`#ifdef USE_MAP + diffuseColor *= texture2D( map, vMapUv ); +#endif`,DP=`#ifdef USE_MAP + uniform sampler2D map; +#endif`,UP=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + #if defined( USE_POINTS_UV ) + vec2 uv = vUv; + #else + vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy; + #endif +#endif +#ifdef USE_MAP + diffuseColor *= texture2D( map, uv ); +#endif +#ifdef USE_ALPHAMAP + diffuseColor.a *= texture2D( alphaMap, uv ).g; +#endif`,OP=`#if defined( USE_POINTS_UV ) + varying vec2 vUv; +#else + #if defined( USE_MAP ) || defined( USE_ALPHAMAP ) + uniform mat3 uvTransform; + #endif +#endif +#ifdef USE_MAP + uniform sampler2D map; +#endif +#ifdef USE_ALPHAMAP + uniform sampler2D alphaMap; +#endif`,NP=`float metalnessFactor = metalness; +#ifdef USE_METALNESSMAP + vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv ); + metalnessFactor *= texelMetalness.b; +#endif`,FP=`#ifdef USE_METALNESSMAP + uniform sampler2D metalnessMap; +#endif`,kP=`#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE ) + vColor *= morphTargetBaseInfluence; + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + #if defined( USE_COLOR_ALPHA ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ]; + #elif defined( USE_COLOR ) + if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ]; + #endif + } +#endif`,zP=`#ifdef USE_MORPHNORMALS + objectNormal *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ]; + } + #else + objectNormal += morphNormal0 * morphTargetInfluences[ 0 ]; + objectNormal += morphNormal1 * morphTargetInfluences[ 1 ]; + objectNormal += morphNormal2 * morphTargetInfluences[ 2 ]; + objectNormal += morphNormal3 * morphTargetInfluences[ 3 ]; + #endif +#endif`,BP=`#ifdef USE_MORPHTARGETS + uniform float morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ]; + uniform sampler2DArray morphTargetsTexture; + uniform ivec2 morphTargetsTextureSize; + vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) { + int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset; + int y = texelIndex / morphTargetsTextureSize.x; + int x = texelIndex - y * morphTargetsTextureSize.x; + ivec3 morphUV = ivec3( x, y, morphTargetIndex ); + return texelFetch( morphTargetsTexture, morphUV, 0 ); + } + #else + #ifndef USE_MORPHNORMALS + uniform float morphTargetInfluences[ 8 ]; + #else + uniform float morphTargetInfluences[ 4 ]; + #endif + #endif +#endif`,GP=`#ifdef USE_MORPHTARGETS + transformed *= morphTargetBaseInfluence; + #ifdef MORPHTARGETS_TEXTURE + for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) { + if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ]; + } + #else + transformed += morphTarget0 * morphTargetInfluences[ 0 ]; + transformed += morphTarget1 * morphTargetInfluences[ 1 ]; + transformed += morphTarget2 * morphTargetInfluences[ 2 ]; + transformed += morphTarget3 * morphTargetInfluences[ 3 ]; + #ifndef USE_MORPHNORMALS + transformed += morphTarget4 * morphTargetInfluences[ 4 ]; + transformed += morphTarget5 * morphTargetInfluences[ 5 ]; + transformed += morphTarget6 * morphTargetInfluences[ 6 ]; + transformed += morphTarget7 * morphTargetInfluences[ 7 ]; + #endif + #endif +#endif`,HP=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0; +#ifdef FLAT_SHADED + vec3 fdx = dFdx( vViewPosition ); + vec3 fdy = dFdy( vViewPosition ); + vec3 normal = normalize( cross( fdx, fdy ) ); +#else + vec3 normal = normalize( vNormal ); + #ifdef DOUBLE_SIDED + normal *= faceDirection; + #endif +#endif +#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) + #ifdef USE_TANGENT + mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn = getTangentFrame( - vViewPosition, normal, + #if defined( USE_NORMALMAP ) + vNormalMapUv + #elif defined( USE_CLEARCOAT_NORMALMAP ) + vClearcoatNormalMapUv + #else + vUv + #endif + ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn[0] *= faceDirection; + tbn[1] *= faceDirection; + #endif +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + #ifdef USE_TANGENT + mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal ); + #else + mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv ); + #endif + #if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED ) + tbn2[0] *= faceDirection; + tbn2[1] *= faceDirection; + #endif +#endif +vec3 geometryNormal = normal;`,VP=`#ifdef USE_NORMALMAP_OBJECTSPACE + normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + #ifdef FLIP_SIDED + normal = - normal; + #endif + #ifdef DOUBLE_SIDED + normal = normal * faceDirection; + #endif + normal = normalize( normalMatrix * normal ); +#elif defined( USE_NORMALMAP_TANGENTSPACE ) + vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0; + mapN.xy *= normalScale; + normal = normalize( tbn * mapN ); +#elif defined( USE_BUMPMAP ) + normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection ); +#endif`,WP=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,XP=`#ifndef FLAT_SHADED + varying vec3 vNormal; + #ifdef USE_TANGENT + varying vec3 vTangent; + varying vec3 vBitangent; + #endif +#endif`,jP=`#ifndef FLAT_SHADED + vNormal = normalize( transformedNormal ); + #ifdef USE_TANGENT + vTangent = normalize( transformedTangent ); + vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w ); + #endif +#endif`,YP=`#ifdef USE_NORMALMAP + uniform sampler2D normalMap; + uniform vec2 normalScale; +#endif +#ifdef USE_NORMALMAP_OBJECTSPACE + uniform mat3 normalMatrix; +#endif +#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) ) + mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) { + vec3 q0 = dFdx( eye_pos.xyz ); + vec3 q1 = dFdy( eye_pos.xyz ); + vec2 st0 = dFdx( uv.st ); + vec2 st1 = dFdy( uv.st ); + vec3 N = surf_norm; + vec3 q1perp = cross( q1, N ); + vec3 q0perp = cross( N, q0 ); + vec3 T = q1perp * st0.x + q0perp * st1.x; + vec3 B = q1perp * st0.y + q0perp * st1.y; + float det = max( dot( T, T ), dot( B, B ) ); + float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det ); + return mat3( T * scale, B * scale, N ); + } +#endif`,qP=`#ifdef USE_CLEARCOAT + vec3 clearcoatNormal = geometryNormal; +#endif`,ZP=`#ifdef USE_CLEARCOAT_NORMALMAP + vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0; + clearcoatMapN.xy *= clearcoatNormalScale; + clearcoatNormal = normalize( tbn2 * clearcoatMapN ); +#endif`,KP=`#ifdef USE_CLEARCOATMAP + uniform sampler2D clearcoatMap; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform sampler2D clearcoatNormalMap; + uniform vec2 clearcoatNormalScale; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform sampler2D clearcoatRoughnessMap; +#endif`,$P=`#ifdef USE_IRIDESCENCEMAP + uniform sampler2D iridescenceMap; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform sampler2D iridescenceThicknessMap; +#endif`,JP=`#ifdef OPAQUE +diffuseColor.a = 1.0; +#endif +#ifdef USE_TRANSMISSION +diffuseColor.a *= material.transmissionAlpha; +#endif +gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,QP=`vec3 packNormalToRGB( const in vec3 normal ) { + return normalize( normal ) * 0.5 + 0.5; +} +vec3 unpackRGBToNormal( const in vec3 rgb ) { + return 2.0 * rgb.xyz - 1.0; +} +const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.; +const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); +const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); +const float ShiftRight8 = 1. / 256.; +vec4 packDepthToRGBA( const in float v ) { + vec4 r = vec4( fract( v * PackFactors ), v ); + r.yzw -= r.xyz * ShiftRight8; return r * PackUpscale; +} +float unpackRGBAToDepth( const in vec4 v ) { + return dot( v, UnpackFactors ); +} +vec2 packDepthToRG( in highp float v ) { + return packDepthToRGBA( v ).yx; +} +float unpackRGToDepth( const in highp vec2 v ) { + return unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) ); +} +vec4 pack2HalfToRGBA( vec2 v ) { + vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) ); + return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w ); +} +vec2 unpackRGBATo2Half( vec4 v ) { + return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); +} +float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { + return ( viewZ + near ) / ( near - far ); +} +float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) { + return depth * ( near - far ) - near; +} +float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { + return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ ); +} +float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) { + return ( near * far ) / ( ( far - near ) * depth - far ); +}`,eL=`#ifdef PREMULTIPLIED_ALPHA + gl_FragColor.rgb *= gl_FragColor.a; +#endif`,tL=`vec4 mvPosition = vec4( transformed, 1.0 ); +#ifdef USE_INSTANCING + mvPosition = instanceMatrix * mvPosition; +#endif +mvPosition = modelViewMatrix * mvPosition; +gl_Position = projectionMatrix * mvPosition;`,nL=`#ifdef DITHERING + gl_FragColor.rgb = dithering( gl_FragColor.rgb ); +#endif`,iL=`#ifdef DITHERING + vec3 dithering( vec3 color ) { + float grid_position = rand( gl_FragCoord.xy ); + vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 ); + dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position ); + return color + dither_shift_RGB; + } +#endif`,rL=`float roughnessFactor = roughness; +#ifdef USE_ROUGHNESSMAP + vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv ); + roughnessFactor *= texelRoughness.g; +#endif`,sL=`#ifdef USE_ROUGHNESSMAP + uniform sampler2D roughnessMap; +#endif`,oL=`#if NUM_SPOT_LIGHT_COORDS > 0 + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#if NUM_SPOT_LIGHT_MAPS > 0 + uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ]; + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif + float texture2DCompare( sampler2D depths, vec2 uv, float compare ) { + return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) ); + } + vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) { + return unpackRGBATo2Half( texture2D( shadow, uv ) ); + } + float VSMShadow (sampler2D shadow, vec2 uv, float compare ){ + float occlusion = 1.0; + vec2 distribution = texture2DDistribution( shadow, uv ); + float hard_shadow = step( compare , distribution.x ); + if (hard_shadow != 1.0 ) { + float distance = compare - distribution.x ; + float variance = max( 0.00000, distribution.y * distribution.y ); + float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 ); + } + return occlusion; + } + float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) { + float shadow = 1.0; + shadowCoord.xyz /= shadowCoord.w; + shadowCoord.z += shadowBias; + bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0; + bool frustumTest = inFrustum && shadowCoord.z <= 1.0; + if ( frustumTest ) { + #if defined( SHADOWMAP_TYPE_PCF ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx0 = - texelSize.x * shadowRadius; + float dy0 = - texelSize.y * shadowRadius; + float dx1 = + texelSize.x * shadowRadius; + float dy1 = + texelSize.y * shadowRadius; + float dx2 = dx0 / 2.0; + float dy2 = dy0 / 2.0; + float dx3 = dx1 / 2.0; + float dy3 = dy1 / 2.0; + shadow = ( + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) + + texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z ) + ) * ( 1.0 / 17.0 ); + #elif defined( SHADOWMAP_TYPE_PCF_SOFT ) + vec2 texelSize = vec2( 1.0 ) / shadowMapSize; + float dx = texelSize.x; + float dy = texelSize.y; + vec2 uv = shadowCoord.xy; + vec2 f = fract( uv * shadowMapSize + 0.5 ); + uv -= f * texelSize; + shadow = ( + texture2DCompare( shadowMap, uv, shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) + + texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ), + f.x ) + + mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ), + f.y ) + + mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ), + f.x ), + mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ), + texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ), + f.x ), + f.y ) + ) * ( 1.0 / 9.0 ); + #elif defined( SHADOWMAP_TYPE_VSM ) + shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z ); + #else + shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ); + #endif + } + return shadow; + } + vec2 cubeToUV( vec3 v, float texelSizeY ) { + vec3 absV = abs( v ); + float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) ); + absV *= scaleToCube; + v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY ); + vec2 planar = v.xy; + float almostATexel = 1.5 * texelSizeY; + float almostOne = 1.0 - almostATexel; + if ( absV.z >= almostOne ) { + if ( v.z > 0.0 ) + planar.x = 4.0 - v.x; + } else if ( absV.x >= almostOne ) { + float signX = sign( v.x ); + planar.x = v.z * signX + 2.0 * signX; + } else if ( absV.y >= almostOne ) { + float signY = sign( v.y ); + planar.x = v.x + 2.0 * signY + 2.0; + planar.y = v.z * signY - 2.0; + } + return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 ); + } + float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) { + vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) ); + vec3 lightToPosition = shadowCoord.xyz; + float dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias; + vec3 bd3D = normalize( lightToPosition ); + #if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM ) + vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y; + return ( + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) + + texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp ) + ) * ( 1.0 / 9.0 ); + #else + return texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ); + #endif + } +#endif`,aL=`#if NUM_SPOT_LIGHT_COORDS > 0 + uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ]; + varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ]; +#endif +#ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ]; + varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ]; + struct DirectionalLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ]; + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + struct SpotLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + }; + uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ]; + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ]; + varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ]; + struct PointLightShadow { + float shadowBias; + float shadowNormalBias; + float shadowRadius; + vec2 shadowMapSize; + float shadowCameraNear; + float shadowCameraFar; + }; + uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ]; + #endif +#endif`,lL=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 ) + vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix ); + vec4 shadowWorldPosition; +#endif +#if defined( USE_SHADOWMAP ) + #if NUM_DIR_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 ); + vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 ); + vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end + #endif +#endif +#if NUM_SPOT_LIGHT_COORDS > 0 + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) { + shadowWorldPosition = worldPosition; + #if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS ) + shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias; + #endif + vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition; + } + #pragma unroll_loop_end +#endif`,cL=`float getShadowMask() { + float shadow = 1.0; + #ifdef USE_SHADOWMAP + #if NUM_DIR_LIGHT_SHADOWS > 0 + DirectionalLightShadow directionalLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) { + directionalLight = directionalLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_SPOT_LIGHT_SHADOWS > 0 + SpotLightShadow spotLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) { + spotLight = spotLightShadows[ i ]; + shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0; + } + #pragma unroll_loop_end + #endif + #if NUM_POINT_LIGHT_SHADOWS > 0 + PointLightShadow pointLight; + #pragma unroll_loop_start + for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) { + pointLight = pointLightShadows[ i ]; + shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0; + } + #pragma unroll_loop_end + #endif + #endif + return shadow; +}`,uL=`#ifdef USE_SKINNING + mat4 boneMatX = getBoneMatrix( skinIndex.x ); + mat4 boneMatY = getBoneMatrix( skinIndex.y ); + mat4 boneMatZ = getBoneMatrix( skinIndex.z ); + mat4 boneMatW = getBoneMatrix( skinIndex.w ); +#endif`,hL=`#ifdef USE_SKINNING + uniform mat4 bindMatrix; + uniform mat4 bindMatrixInverse; + uniform highp sampler2D boneTexture; + uniform int boneTextureSize; + mat4 getBoneMatrix( const in float i ) { + float j = i * 4.0; + float x = mod( j, float( boneTextureSize ) ); + float y = floor( j / float( boneTextureSize ) ); + float dx = 1.0 / float( boneTextureSize ); + float dy = 1.0 / float( boneTextureSize ); + y = dy * ( y + 0.5 ); + vec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) ); + vec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) ); + vec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) ); + vec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) ); + mat4 bone = mat4( v1, v2, v3, v4 ); + return bone; + } +#endif`,fL=`#ifdef USE_SKINNING + vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 ); + vec4 skinned = vec4( 0.0 ); + skinned += boneMatX * skinVertex * skinWeight.x; + skinned += boneMatY * skinVertex * skinWeight.y; + skinned += boneMatZ * skinVertex * skinWeight.z; + skinned += boneMatW * skinVertex * skinWeight.w; + transformed = ( bindMatrixInverse * skinned ).xyz; +#endif`,dL=`#ifdef USE_SKINNING + mat4 skinMatrix = mat4( 0.0 ); + skinMatrix += skinWeight.x * boneMatX; + skinMatrix += skinWeight.y * boneMatY; + skinMatrix += skinWeight.z * boneMatZ; + skinMatrix += skinWeight.w * boneMatW; + skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix; + objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz; + #ifdef USE_TANGENT + objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz; + #endif +#endif`,pL=`float specularStrength; +#ifdef USE_SPECULARMAP + vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv ); + specularStrength = texelSpecular.r; +#else + specularStrength = 1.0; +#endif`,mL=`#ifdef USE_SPECULARMAP + uniform sampler2D specularMap; +#endif`,gL=`#if defined( TONE_MAPPING ) + gl_FragColor.rgb = toneMapping( gl_FragColor.rgb ); +#endif`,vL=`#ifndef saturate +#define saturate( a ) clamp( a, 0.0, 1.0 ) +#endif +uniform float toneMappingExposure; +vec3 LinearToneMapping( vec3 color ) { + return saturate( toneMappingExposure * color ); +} +vec3 ReinhardToneMapping( vec3 color ) { + color *= toneMappingExposure; + return saturate( color / ( vec3( 1.0 ) + color ) ); +} +vec3 OptimizedCineonToneMapping( vec3 color ) { + color *= toneMappingExposure; + color = max( vec3( 0.0 ), color - 0.004 ); + return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) ); +} +vec3 RRTAndODTFit( vec3 v ) { + vec3 a = v * ( v + 0.0245786 ) - 0.000090537; + vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081; + return a / b; +} +vec3 ACESFilmicToneMapping( vec3 color ) { + const mat3 ACESInputMat = mat3( + vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ), + vec3( 0.04823, 0.01566, 0.83777 ) + ); + const mat3 ACESOutputMat = mat3( + vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ), + vec3( -0.07367, -0.00605, 1.07602 ) + ); + color *= toneMappingExposure / 0.6; + color = ACESInputMat * color; + color = RRTAndODTFit( color ); + color = ACESOutputMat * color; + return saturate( color ); +} +vec3 CustomToneMapping( vec3 color ) { return color; }`,yL=`#ifdef USE_TRANSMISSION + material.transmission = transmission; + material.transmissionAlpha = 1.0; + material.thickness = thickness; + material.attenuationDistance = attenuationDistance; + material.attenuationColor = attenuationColor; + #ifdef USE_TRANSMISSIONMAP + material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r; + #endif + #ifdef USE_THICKNESSMAP + material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g; + #endif + vec3 pos = vWorldPosition; + vec3 v = normalize( cameraPosition - pos ); + vec3 n = inverseTransformDirection( normal, viewMatrix ); + vec4 transmitted = getIBLVolumeRefraction( + n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90, + pos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness, + material.attenuationColor, material.attenuationDistance ); + material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission ); + totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission ); +#endif`,_L=`#ifdef USE_TRANSMISSION + uniform float transmission; + uniform float thickness; + uniform float attenuationDistance; + uniform vec3 attenuationColor; + #ifdef USE_TRANSMISSIONMAP + uniform sampler2D transmissionMap; + #endif + #ifdef USE_THICKNESSMAP + uniform sampler2D thicknessMap; + #endif + uniform vec2 transmissionSamplerSize; + uniform sampler2D transmissionSamplerMap; + uniform mat4 modelMatrix; + uniform mat4 projectionMatrix; + varying vec3 vWorldPosition; + float w0( float a ) { + return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 ); + } + float w1( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 ); + } + float w2( float a ){ + return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 ); + } + float w3( float a ) { + return ( 1.0 / 6.0 ) * ( a * a * a ); + } + float g0( float a ) { + return w0( a ) + w1( a ); + } + float g1( float a ) { + return w2( a ) + w3( a ); + } + float h0( float a ) { + return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) ); + } + float h1( float a ) { + return 1.0 + w3( a ) / ( w2( a ) + w3( a ) ); + } + vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) { + uv = uv * texelSize.zw + 0.5; + vec2 iuv = floor( uv ); + vec2 fuv = fract( uv ); + float g0x = g0( fuv.x ); + float g1x = g1( fuv.x ); + float h0x = h0( fuv.x ); + float h1x = h1( fuv.x ); + float h0y = h0( fuv.y ); + float h1y = h1( fuv.y ); + vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy; + vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy; + return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) + + g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) ); + } + vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) { + vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) ); + vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) ); + vec2 fLodSizeInv = 1.0 / fLodSize; + vec2 cLodSizeInv = 1.0 / cLodSize; + vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) ); + vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) ); + return mix( fSample, cSample, fract( lod ) ); + } + vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) { + vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior ); + vec3 modelScale; + modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) ); + modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) ); + modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) ); + return normalize( refractionVector ) * thickness * modelScale; + } + float applyIorToRoughness( const in float roughness, const in float ior ) { + return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 ); + } + vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) { + float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior ); + return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod ); + } + vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) { + if ( isinf( attenuationDistance ) ) { + return vec3( 1.0 ); + } else { + vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance; + vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance; + } + } + vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor, + const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix, + const in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness, + const in vec3 attenuationColor, const in float attenuationDistance ) { + vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix ); + vec3 refractedRayExit = position + transmissionRay; + vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 ); + vec2 refractionCoords = ndcPos.xy / ndcPos.w; + refractionCoords += 1.0; + refractionCoords /= 2.0; + vec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior ); + vec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance ); + vec3 attenuatedColor = transmittance * transmittedLight.rgb; + vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness ); + float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0; + return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor ); + } +#endif`,xL=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + varying vec2 vNormalMapUv; +#endif +#ifdef USE_EMISSIVEMAP + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_SPECULARMAP + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,wL=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + varying vec2 vUv; +#endif +#ifdef USE_MAP + uniform mat3 mapTransform; + varying vec2 vMapUv; +#endif +#ifdef USE_ALPHAMAP + uniform mat3 alphaMapTransform; + varying vec2 vAlphaMapUv; +#endif +#ifdef USE_LIGHTMAP + uniform mat3 lightMapTransform; + varying vec2 vLightMapUv; +#endif +#ifdef USE_AOMAP + uniform mat3 aoMapTransform; + varying vec2 vAoMapUv; +#endif +#ifdef USE_BUMPMAP + uniform mat3 bumpMapTransform; + varying vec2 vBumpMapUv; +#endif +#ifdef USE_NORMALMAP + uniform mat3 normalMapTransform; + varying vec2 vNormalMapUv; +#endif +#ifdef USE_DISPLACEMENTMAP + uniform mat3 displacementMapTransform; + varying vec2 vDisplacementMapUv; +#endif +#ifdef USE_EMISSIVEMAP + uniform mat3 emissiveMapTransform; + varying vec2 vEmissiveMapUv; +#endif +#ifdef USE_METALNESSMAP + uniform mat3 metalnessMapTransform; + varying vec2 vMetalnessMapUv; +#endif +#ifdef USE_ROUGHNESSMAP + uniform mat3 roughnessMapTransform; + varying vec2 vRoughnessMapUv; +#endif +#ifdef USE_ANISOTROPYMAP + uniform mat3 anisotropyMapTransform; + varying vec2 vAnisotropyMapUv; +#endif +#ifdef USE_CLEARCOATMAP + uniform mat3 clearcoatMapTransform; + varying vec2 vClearcoatMapUv; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + uniform mat3 clearcoatNormalMapTransform; + varying vec2 vClearcoatNormalMapUv; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + uniform mat3 clearcoatRoughnessMapTransform; + varying vec2 vClearcoatRoughnessMapUv; +#endif +#ifdef USE_SHEEN_COLORMAP + uniform mat3 sheenColorMapTransform; + varying vec2 vSheenColorMapUv; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + uniform mat3 sheenRoughnessMapTransform; + varying vec2 vSheenRoughnessMapUv; +#endif +#ifdef USE_IRIDESCENCEMAP + uniform mat3 iridescenceMapTransform; + varying vec2 vIridescenceMapUv; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + uniform mat3 iridescenceThicknessMapTransform; + varying vec2 vIridescenceThicknessMapUv; +#endif +#ifdef USE_SPECULARMAP + uniform mat3 specularMapTransform; + varying vec2 vSpecularMapUv; +#endif +#ifdef USE_SPECULAR_COLORMAP + uniform mat3 specularColorMapTransform; + varying vec2 vSpecularColorMapUv; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + uniform mat3 specularIntensityMapTransform; + varying vec2 vSpecularIntensityMapUv; +#endif +#ifdef USE_TRANSMISSIONMAP + uniform mat3 transmissionMapTransform; + varying vec2 vTransmissionMapUv; +#endif +#ifdef USE_THICKNESSMAP + uniform mat3 thicknessMapTransform; + varying vec2 vThicknessMapUv; +#endif`,SL=`#if defined( USE_UV ) || defined( USE_ANISOTROPY ) + vUv = vec3( uv, 1 ).xy; +#endif +#ifdef USE_MAP + vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ALPHAMAP + vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_LIGHTMAP + vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_AOMAP + vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_BUMPMAP + vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_NORMALMAP + vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_DISPLACEMENTMAP + vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_EMISSIVEMAP + vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_METALNESSMAP + vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ROUGHNESSMAP + vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_ANISOTROPYMAP + vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOATMAP + vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_NORMALMAP + vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_CLEARCOAT_ROUGHNESSMAP + vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCEMAP + vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_IRIDESCENCE_THICKNESSMAP + vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_COLORMAP + vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SHEEN_ROUGHNESSMAP + vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULARMAP + vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_COLORMAP + vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_SPECULAR_INTENSITYMAP + vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_TRANSMISSIONMAP + vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy; +#endif +#ifdef USE_THICKNESSMAP + vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy; +#endif`,EL=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0 + vec4 worldPosition = vec4( transformed, 1.0 ); + #ifdef USE_INSTANCING + worldPosition = instanceMatrix * worldPosition; + #endif + worldPosition = modelMatrix * worldPosition; +#endif`;const bL=`varying vec2 vUv; +uniform mat3 uvTransform; +void main() { + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + gl_Position = vec4( position.xy, 1.0, 1.0 ); +}`,ML=`uniform sampler2D t2D; +uniform float backgroundIntensity; +varying vec2 vUv; +void main() { + vec4 texColor = texture2D( t2D, vUv ); + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,TL=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,AL=`#ifdef ENVMAP_TYPE_CUBE + uniform samplerCube envMap; +#elif defined( ENVMAP_TYPE_CUBE_UV ) + uniform sampler2D envMap; +#endif +uniform float flipEnvMap; +uniform float backgroundBlurriness; +uniform float backgroundIntensity; +varying vec3 vWorldDirection; +#include +void main() { + #ifdef ENVMAP_TYPE_CUBE + vec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) ); + #elif defined( ENVMAP_TYPE_CUBE_UV ) + vec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness ); + #else + vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + #endif + texColor.rgb *= backgroundIntensity; + gl_FragColor = texColor; + #include + #include +}`,CL=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include + gl_Position.z = gl_Position.w; +}`,RL=`uniform samplerCube tCube; +uniform float tFlip; +uniform float opacity; +varying vec3 vWorldDirection; +void main() { + vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) ); + gl_FragColor = texColor; + gl_FragColor.a *= opacity; + #include + #include +}`,PL=`#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vHighPrecisionZW = gl_Position.zw; +}`,LL=`#if DEPTH_PACKING == 3200 + uniform float opacity; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +varying vec2 vHighPrecisionZW; +void main() { + #include + vec4 diffuseColor = vec4( 1.0 ); + #if DEPTH_PACKING == 3200 + diffuseColor.a = opacity; + #endif + #include + #include + #include + #include + #include + float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5; + #if DEPTH_PACKING == 3200 + gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity ); + #elif DEPTH_PACKING == 3201 + gl_FragColor = packDepthToRGBA( fragCoordZ ); + #endif +}`,IL=`#define DISTANCE +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #ifdef USE_DISPLACEMENTMAP + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + vWorldPosition = worldPosition.xyz; +}`,DL=`#define DISTANCE +uniform vec3 referencePosition; +uniform float nearDistance; +uniform float farDistance; +varying vec3 vWorldPosition; +#include +#include +#include +#include +#include +#include +#include +#include +void main () { + #include + vec4 diffuseColor = vec4( 1.0 ); + #include + #include + #include + #include + float dist = length( vWorldPosition - referencePosition ); + dist = ( dist - nearDistance ) / ( farDistance - nearDistance ); + dist = saturate( dist ); + gl_FragColor = packDepthToRGBA( dist ); +}`,UL=`varying vec3 vWorldDirection; +#include +void main() { + vWorldDirection = transformDirection( position, modelMatrix ); + #include + #include +}`,OL=`uniform sampler2D tEquirect; +varying vec3 vWorldDirection; +#include +void main() { + vec3 direction = normalize( vWorldDirection ); + vec2 sampleUV = equirectUv( direction ); + gl_FragColor = texture2D( tEquirect, sampleUV ); + #include + #include +}`,NL=`uniform float scale; +attribute float lineDistance; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + vLineDistance = scale * lineDistance; + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,FL=`uniform vec3 diffuse; +uniform float opacity; +uniform float dashSize; +uniform float totalSize; +varying float vLineDistance; +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + if ( mod( vLineDistance, totalSize ) > dashSize ) { + discard; + } + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,kL=`#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #if defined ( USE_ENVMAP ) || defined ( USE_SKINNING ) + #include + #include + #include + #include + #include + #endif + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,zL=`uniform vec3 diffuse; +uniform float opacity; +#ifndef FLAT_SHADED + varying vec3 vNormal; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + #ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); + reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI; + #else + reflectedLight.indirectDiffuse += vec3( 1.0 ); + #endif + #include + reflectedLight.indirectDiffuse *= diffuseColor.rgb; + vec3 outgoingLight = reflectedLight.indirectDiffuse; + #include + #include + #include + #include + #include + #include + #include +}`,BL=`#define LAMBERT +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,GL=`#define LAMBERT +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,HL=`#define MATCAP +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; +}`,VL=`#define MATCAP +uniform vec3 diffuse; +uniform float opacity; +uniform sampler2D matcap; +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + #include + #include + #include + vec3 viewDir = normalize( vViewPosition ); + vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) ); + vec3 y = cross( viewDir, x ); + vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5; + #ifdef USE_MATCAP + vec4 matcapColor = texture2D( matcap, uv ); + #else + vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 ); + #endif + vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb; + #include + #include + #include + #include + #include + #include +}`,WL=`#define NORMAL +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + vViewPosition = - mvPosition.xyz; +#endif +}`,XL=`#define NORMAL +uniform float opacity; +#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE ) + varying vec3 vViewPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + gl_FragColor = vec4( packNormalToRGB( normal ), opacity ); + #ifdef OPAQUE + gl_FragColor.a = 1.0; + #endif +}`,jL=`#define PHONG +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include + #include +}`,YL=`#define PHONG +uniform vec3 diffuse; +uniform vec3 emissive; +uniform vec3 specular; +uniform float shininess; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include + #include +}`,qL=`#define STANDARD +varying vec3 vViewPosition; +#ifdef USE_TRANSMISSION + varying vec3 vWorldPosition; +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +#ifdef USE_TRANSMISSION + vWorldPosition = worldPosition.xyz; +#endif +}`,ZL=`#define STANDARD +#ifdef PHYSICAL + #define IOR + #define USE_SPECULAR +#endif +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float roughness; +uniform float metalness; +uniform float opacity; +#ifdef IOR + uniform float ior; +#endif +#ifdef USE_SPECULAR + uniform float specularIntensity; + uniform vec3 specularColor; + #ifdef USE_SPECULAR_COLORMAP + uniform sampler2D specularColorMap; + #endif + #ifdef USE_SPECULAR_INTENSITYMAP + uniform sampler2D specularIntensityMap; + #endif +#endif +#ifdef USE_CLEARCOAT + uniform float clearcoat; + uniform float clearcoatRoughness; +#endif +#ifdef USE_IRIDESCENCE + uniform float iridescence; + uniform float iridescenceIOR; + uniform float iridescenceThicknessMinimum; + uniform float iridescenceThicknessMaximum; +#endif +#ifdef USE_SHEEN + uniform vec3 sheenColor; + uniform float sheenRoughness; + #ifdef USE_SHEEN_COLORMAP + uniform sampler2D sheenColorMap; + #endif + #ifdef USE_SHEEN_ROUGHNESSMAP + uniform sampler2D sheenRoughnessMap; + #endif +#endif +#ifdef USE_ANISOTROPY + uniform vec2 anisotropyVector; + #ifdef USE_ANISOTROPYMAP + uniform sampler2D anisotropyMap; + #endif +#endif +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular; + #include + vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance; + #ifdef USE_SHEEN + float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor ); + outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular; + #endif + #ifdef USE_CLEARCOAT + float dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) ); + vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc ); + outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat; + #endif + #include + #include + #include + #include + #include + #include +}`,KL=`#define TOON +varying vec3 vViewPosition; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vViewPosition = - mvPosition.xyz; + #include + #include + #include +}`,$L=`#define TOON +uniform vec3 diffuse; +uniform vec3 emissive; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec4 diffuseColor = vec4( diffuse, opacity ); + ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) ); + vec3 totalEmissiveRadiance = emissive; + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance; + #include + #include + #include + #include + #include + #include +}`,JL=`uniform float size; +uniform float scale; +#include +#include +#include +#include +#include +#include +#ifdef USE_POINTS_UV + varying vec2 vUv; + uniform mat3 uvTransform; +#endif +void main() { + #ifdef USE_POINTS_UV + vUv = ( uvTransform * vec3( uv, 1 ) ).xy; + #endif + #include + #include + #include + #include + #include + gl_PointSize = size; + #ifdef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z ); + #endif + #include + #include + #include + #include +}`,QL=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include + #include +}`,eI=`#include +#include +#include +#include +#include +#include +void main() { + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +}`,tI=`uniform vec3 color; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) ); + #include + #include + #include +}`,nI=`uniform float rotation; +uniform vec2 center; +#include +#include +#include +#include +#include +void main() { + #include + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + #ifndef USE_SIZEATTENUATION + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + #endif + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + gl_Position = projectionMatrix * mvPosition; + #include + #include + #include +}`,iI=`uniform vec3 diffuse; +uniform float opacity; +#include +#include +#include +#include +#include +#include +#include +#include +#include +void main() { + #include + vec3 outgoingLight = vec3( 0.0 ); + vec4 diffuseColor = vec4( diffuse, opacity ); + #include + #include + #include + #include + #include + outgoingLight = diffuseColor.rgb; + #include + #include + #include + #include +}`,bt={alphahash_fragment:AR,alphahash_pars_fragment:CR,alphamap_fragment:RR,alphamap_pars_fragment:PR,alphatest_fragment:LR,alphatest_pars_fragment:IR,aomap_fragment:DR,aomap_pars_fragment:UR,begin_vertex:OR,beginnormal_vertex:NR,bsdfs:FR,iridescence_fragment:kR,bumpmap_pars_fragment:zR,clipping_planes_fragment:BR,clipping_planes_pars_fragment:GR,clipping_planes_pars_vertex:HR,clipping_planes_vertex:VR,color_fragment:WR,color_pars_fragment:XR,color_pars_vertex:jR,color_vertex:YR,common:qR,cube_uv_reflection_fragment:ZR,defaultnormal_vertex:KR,displacementmap_pars_vertex:$R,displacementmap_vertex:JR,emissivemap_fragment:QR,emissivemap_pars_fragment:eP,colorspace_fragment:tP,colorspace_pars_fragment:nP,envmap_fragment:iP,envmap_common_pars_fragment:rP,envmap_pars_fragment:sP,envmap_pars_vertex:oP,envmap_physical_pars_fragment:yP,envmap_vertex:aP,fog_vertex:lP,fog_pars_vertex:cP,fog_fragment:uP,fog_pars_fragment:hP,gradientmap_pars_fragment:fP,lightmap_fragment:dP,lightmap_pars_fragment:pP,lights_lambert_fragment:mP,lights_lambert_pars_fragment:gP,lights_pars_begin:vP,lights_toon_fragment:_P,lights_toon_pars_fragment:xP,lights_phong_fragment:wP,lights_phong_pars_fragment:SP,lights_physical_fragment:EP,lights_physical_pars_fragment:bP,lights_fragment_begin:MP,lights_fragment_maps:TP,lights_fragment_end:AP,logdepthbuf_fragment:CP,logdepthbuf_pars_fragment:RP,logdepthbuf_pars_vertex:PP,logdepthbuf_vertex:LP,map_fragment:IP,map_pars_fragment:DP,map_particle_fragment:UP,map_particle_pars_fragment:OP,metalnessmap_fragment:NP,metalnessmap_pars_fragment:FP,morphcolor_vertex:kP,morphnormal_vertex:zP,morphtarget_pars_vertex:BP,morphtarget_vertex:GP,normal_fragment_begin:HP,normal_fragment_maps:VP,normal_pars_fragment:WP,normal_pars_vertex:XP,normal_vertex:jP,normalmap_pars_fragment:YP,clearcoat_normal_fragment_begin:qP,clearcoat_normal_fragment_maps:ZP,clearcoat_pars_fragment:KP,iridescence_pars_fragment:$P,opaque_fragment:JP,packing:QP,premultiplied_alpha_fragment:eL,project_vertex:tL,dithering_fragment:nL,dithering_pars_fragment:iL,roughnessmap_fragment:rL,roughnessmap_pars_fragment:sL,shadowmap_pars_fragment:oL,shadowmap_pars_vertex:aL,shadowmap_vertex:lL,shadowmask_pars_fragment:cL,skinbase_vertex:uL,skinning_pars_vertex:hL,skinning_vertex:fL,skinnormal_vertex:dL,specularmap_fragment:pL,specularmap_pars_fragment:mL,tonemapping_fragment:gL,tonemapping_pars_fragment:vL,transmission_fragment:yL,transmission_pars_fragment:_L,uv_pars_fragment:xL,uv_pars_vertex:wL,uv_vertex:SL,worldpos_vertex:EL,background_vert:bL,background_frag:ML,backgroundCube_vert:TL,backgroundCube_frag:AL,cube_vert:CL,cube_frag:RL,depth_vert:PL,depth_frag:LL,distanceRGBA_vert:IL,distanceRGBA_frag:DL,equirect_vert:UL,equirect_frag:OL,linedashed_vert:NL,linedashed_frag:FL,meshbasic_vert:kL,meshbasic_frag:zL,meshlambert_vert:BL,meshlambert_frag:GL,meshmatcap_vert:HL,meshmatcap_frag:VL,meshnormal_vert:WL,meshnormal_frag:XL,meshphong_vert:jL,meshphong_frag:YL,meshphysical_vert:qL,meshphysical_frag:ZL,meshtoon_vert:KL,meshtoon_frag:$L,points_vert:JL,points_frag:QL,shadow_vert:eI,shadow_frag:tI,sprite_vert:nI,sprite_frag:iI},Je={common:{diffuse:{value:new Ke(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Ct},alphaMap:{value:null},alphaMapTransform:{value:new Ct},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Ct}},envmap:{envMap:{value:null},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Ct}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Ct}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Ct},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Ct},normalScale:{value:new De(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Ct},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Ct}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Ct}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Ct}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Ke(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Ke(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Ct},alphaTest:{value:0},uvTransform:{value:new Ct}},sprite:{diffuse:{value:new Ke(16777215)},opacity:{value:1},center:{value:new De(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Ct},alphaMap:{value:null},alphaMapTransform:{value:new Ct},alphaTest:{value:0}}},Nr={basic:{uniforms:Ci([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.fog]),vertexShader:bt.meshbasic_vert,fragmentShader:bt.meshbasic_frag},lambert:{uniforms:Ci([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new Ke(0)}}]),vertexShader:bt.meshlambert_vert,fragmentShader:bt.meshlambert_frag},phong:{uniforms:Ci([Je.common,Je.specularmap,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,Je.lights,{emissive:{value:new Ke(0)},specular:{value:new Ke(1118481)},shininess:{value:30}}]),vertexShader:bt.meshphong_vert,fragmentShader:bt.meshphong_frag},standard:{uniforms:Ci([Je.common,Je.envmap,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.roughnessmap,Je.metalnessmap,Je.fog,Je.lights,{emissive:{value:new Ke(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:bt.meshphysical_vert,fragmentShader:bt.meshphysical_frag},toon:{uniforms:Ci([Je.common,Je.aomap,Je.lightmap,Je.emissivemap,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.gradientmap,Je.fog,Je.lights,{emissive:{value:new Ke(0)}}]),vertexShader:bt.meshtoon_vert,fragmentShader:bt.meshtoon_frag},matcap:{uniforms:Ci([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,Je.fog,{matcap:{value:null}}]),vertexShader:bt.meshmatcap_vert,fragmentShader:bt.meshmatcap_frag},points:{uniforms:Ci([Je.points,Je.fog]),vertexShader:bt.points_vert,fragmentShader:bt.points_frag},dashed:{uniforms:Ci([Je.common,Je.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:bt.linedashed_vert,fragmentShader:bt.linedashed_frag},depth:{uniforms:Ci([Je.common,Je.displacementmap]),vertexShader:bt.depth_vert,fragmentShader:bt.depth_frag},normal:{uniforms:Ci([Je.common,Je.bumpmap,Je.normalmap,Je.displacementmap,{opacity:{value:1}}]),vertexShader:bt.meshnormal_vert,fragmentShader:bt.meshnormal_frag},sprite:{uniforms:Ci([Je.sprite,Je.fog]),vertexShader:bt.sprite_vert,fragmentShader:bt.sprite_frag},background:{uniforms:{uvTransform:{value:new Ct},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:bt.background_vert,fragmentShader:bt.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1}},vertexShader:bt.backgroundCube_vert,fragmentShader:bt.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:bt.cube_vert,fragmentShader:bt.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:bt.equirect_vert,fragmentShader:bt.equirect_frag},distanceRGBA:{uniforms:Ci([Je.common,Je.displacementmap,{referencePosition:{value:new Y},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:bt.distanceRGBA_vert,fragmentShader:bt.distanceRGBA_frag},shadow:{uniforms:Ci([Je.lights,Je.fog,{color:{value:new Ke(0)},opacity:{value:1}}]),vertexShader:bt.shadow_vert,fragmentShader:bt.shadow_frag}};Nr.physical={uniforms:Ci([Nr.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Ct},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Ct},clearcoatNormalScale:{value:new De(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Ct},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Ct},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Ct},sheen:{value:0},sheenColor:{value:new Ke(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Ct},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Ct},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Ct},transmissionSamplerSize:{value:new De},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Ct},attenuationDistance:{value:0},attenuationColor:{value:new Ke(0)},specularColor:{value:new Ke(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Ct},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Ct},anisotropyVector:{value:new De},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Ct}}]),vertexShader:bt.meshphysical_vert,fragmentShader:bt.meshphysical_frag};const Rf={r:0,b:0,g:0};function rI(r,e,t,n,i,s,o){const a=new Ke(0);let l=s===!0?0:1,c,u,h=null,p=0,m=null;function v(y,g){let x=!1,w=g.isScene===!0?g.background:null;switch(w&&w.isTexture&&(w=(g.backgroundBlurriness>0?t:e).get(w)),w===null?_(a,l):w&&w.isColor&&(_(w,1),x=!0),r.xr.getEnvironmentBlendMode()){case"opaque":x=!0;break;case"additive":n.buffers.color.setClear(0,0,0,1,o),x=!0;break;case"alpha-blend":n.buffers.color.setClear(0,0,0,0,o),x=!0;break}(r.autoClear||x)&&r.clear(r.autoClearColor,r.autoClearDepth,r.autoClearStencil),w&&(w.isCubeTexture||w.mapping===Jl)?(u===void 0&&(u=new _n(new Ws(1,1,1),new cs({name:"BackgroundCubeMaterial",uniforms:Xl(Nr.backgroundCube.uniforms),vertexShader:Nr.backgroundCube.vertexShader,fragmentShader:Nr.backgroundCube.fragmentShader,side:yi,depthTest:!1,depthWrite:!1,fog:!1})),u.geometry.deleteAttribute("normal"),u.geometry.deleteAttribute("uv"),u.onBeforeRender=function(M,A,P){this.matrixWorld.copyPosition(P.matrixWorld)},Object.defineProperty(u.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),i.update(u)),u.material.uniforms.envMap.value=w,u.material.uniforms.flipEnvMap.value=w.isCubeTexture&&w.isRenderTargetTexture===!1?-1:1,u.material.uniforms.backgroundBlurriness.value=g.backgroundBlurriness,u.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,u.material.toneMapped=w.colorSpace!==Mt,(h!==w||p!==w.version||m!==r.toneMapping)&&(u.material.needsUpdate=!0,h=w,p=w.version,m=r.toneMapping),u.layers.enableAll(),y.unshift(u,u.geometry,u.material,0,0,null)):w&&w.isTexture&&(c===void 0&&(c=new _n(new To(2,2),new cs({name:"BackgroundMaterial",uniforms:Xl(Nr.background.uniforms),vertexShader:Nr.background.vertexShader,fragmentShader:Nr.background.fragmentShader,side:ls,depthTest:!1,depthWrite:!1,fog:!1})),c.geometry.deleteAttribute("normal"),Object.defineProperty(c.material,"map",{get:function(){return this.uniforms.t2D.value}}),i.update(c)),c.material.uniforms.t2D.value=w,c.material.uniforms.backgroundIntensity.value=g.backgroundIntensity,c.material.toneMapped=w.colorSpace!==Mt,w.matrixAutoUpdate===!0&&w.updateMatrix(),c.material.uniforms.uvTransform.value.copy(w.matrix),(h!==w||p!==w.version||m!==r.toneMapping)&&(c.material.needsUpdate=!0,h=w,p=w.version,m=r.toneMapping),c.layers.enableAll(),y.unshift(c,c.geometry,c.material,0,0,null))}function _(y,g){y.getRGB(Rf,lM(r)),n.buffers.color.setClear(Rf.r,Rf.g,Rf.b,g,o)}return{getClearColor:function(){return a},setClearColor:function(y,g=1){a.set(y),l=g,_(a,l)},getClearAlpha:function(){return l},setClearAlpha:function(y){l=y,_(a,l)},render:v}}function sI(r,e,t,n){const i=r.getParameter(r.MAX_VERTEX_ATTRIBS),s=n.isWebGL2?null:e.get("OES_vertex_array_object"),o=n.isWebGL2||s!==null,a={},l=y(null);let c=l,u=!1;function h(X,q,W,O,k){let G=!1;if(o){const B=_(O,W,q);c!==B&&(c=B,m(c.object)),G=g(X,O,W,k),G&&x(X,O,W,k)}else{const B=q.wireframe===!0;(c.geometry!==O.id||c.program!==W.id||c.wireframe!==B)&&(c.geometry=O.id,c.program=W.id,c.wireframe=B,G=!0)}k!==null&&t.update(k,r.ELEMENT_ARRAY_BUFFER),(G||u)&&(u=!1,P(X,q,W,O),k!==null&&r.bindBuffer(r.ELEMENT_ARRAY_BUFFER,t.get(k).buffer))}function p(){return n.isWebGL2?r.createVertexArray():s.createVertexArrayOES()}function m(X){return n.isWebGL2?r.bindVertexArray(X):s.bindVertexArrayOES(X)}function v(X){return n.isWebGL2?r.deleteVertexArray(X):s.deleteVertexArrayOES(X)}function _(X,q,W){const O=W.wireframe===!0;let k=a[X.id];k===void 0&&(k={},a[X.id]=k);let G=k[q.id];G===void 0&&(G={},k[q.id]=G);let B=G[O];return B===void 0&&(B=y(p()),G[O]=B),B}function y(X){const q=[],W=[],O=[];for(let k=0;k=0){const ee=k[V];let ie=G[V];if(ie===void 0&&(V==="instanceMatrix"&&X.instanceMatrix&&(ie=X.instanceMatrix),V==="instanceColor"&&X.instanceColor&&(ie=X.instanceColor)),ee===void 0||ee.attribute!==ie||ie&&ee.data!==ie.data)return!0;B++}return c.attributesNum!==B||c.index!==O}function x(X,q,W,O){const k={},G=q.attributes;let B=0;const D=W.getAttributes();for(const V in D)if(D[V].location>=0){let ee=G[V];ee===void 0&&(V==="instanceMatrix"&&X.instanceMatrix&&(ee=X.instanceMatrix),V==="instanceColor"&&X.instanceColor&&(ee=X.instanceColor));const ie={};ie.attribute=ee,ee&&ee.data&&(ie.data=ee.data),k[V]=ie,B++}c.attributes=k,c.attributesNum=B,c.index=O}function w(){const X=c.newAttributes;for(let q=0,W=X.length;q=0){let Z=k[D];if(Z===void 0&&(D==="instanceMatrix"&&X.instanceMatrix&&(Z=X.instanceMatrix),D==="instanceColor"&&X.instanceColor&&(Z=X.instanceColor)),Z!==void 0){const ee=Z.normalized,ie=Z.itemSize,ue=t.get(Z);if(ue===void 0)continue;const ce=ue.buffer,le=ue.type,Ae=ue.bytesPerElement,Ee=n.isWebGL2===!0&&(le===r.INT||le===r.UNSIGNED_INT||Z.gpuType===Yv);if(Z.isInterleavedBufferAttribute){const ae=Z.data,z=ae.stride,oe=Z.offset;if(ae.isInstancedInterleavedBuffer){for(let te=0;te0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.HIGH_FLOAT).precision>0)return"highp";A="mediump"}return A==="mediump"&&r.getShaderPrecisionFormat(r.VERTEX_SHADER,r.MEDIUM_FLOAT).precision>0&&r.getShaderPrecisionFormat(r.FRAGMENT_SHADER,r.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}const o=typeof WebGL2RenderingContext<"u"&&r.constructor.name==="WebGL2RenderingContext";let a=t.precision!==void 0?t.precision:"highp";const l=s(a);l!==a&&(console.warn("THREE.WebGLRenderer:",a,"not supported, using",l,"instead."),a=l);const c=o||e.has("WEBGL_draw_buffers"),u=t.logarithmicDepthBuffer===!0,h=r.getParameter(r.MAX_TEXTURE_IMAGE_UNITS),p=r.getParameter(r.MAX_VERTEX_TEXTURE_IMAGE_UNITS),m=r.getParameter(r.MAX_TEXTURE_SIZE),v=r.getParameter(r.MAX_CUBE_MAP_TEXTURE_SIZE),_=r.getParameter(r.MAX_VERTEX_ATTRIBS),y=r.getParameter(r.MAX_VERTEX_UNIFORM_VECTORS),g=r.getParameter(r.MAX_VARYING_VECTORS),x=r.getParameter(r.MAX_FRAGMENT_UNIFORM_VECTORS),w=p>0,E=o||e.has("OES_texture_float"),b=w&&E,M=o?r.getParameter(r.MAX_SAMPLES):0;return{isWebGL2:o,drawBuffers:c,getMaxAnisotropy:i,getMaxPrecision:s,precision:a,logarithmicDepthBuffer:u,maxTextures:h,maxVertexTextures:p,maxTextureSize:m,maxCubemapSize:v,maxAttributes:_,maxVertexUniforms:y,maxVaryings:g,maxFragmentUniforms:x,vertexTextures:w,floatFragmentTextures:E,floatVertexTextures:b,maxSamples:M}}function lI(r){const e=this;let t=null,n=0,i=!1,s=!1;const o=new Us,a=new Ct,l={value:null,needsUpdate:!1};this.uniform=l,this.numPlanes=0,this.numIntersection=0,this.init=function(h,p){const m=h.length!==0||p||n!==0||i;return i=p,n=h.length,m},this.beginShadows=function(){s=!0,u(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(h,p){t=u(h,p,0)},this.setState=function(h,p,m){const v=h.clippingPlanes,_=h.clipIntersection,y=h.clipShadows,g=r.get(h);if(!i||v===null||v.length===0||s&&!y)s?u(null):c();else{const x=s?0:n,w=x*4;let E=g.clippingState||null;l.value=E,E=u(v,p,w,m);for(let b=0;b!==w;++b)E[b]=t[b];g.clippingState=E,this.numIntersection=_?this.numPlanes:0,this.numPlanes+=x}};function c(){l.value!==t&&(l.value=t,l.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function u(h,p,m,v){const _=h!==null?h.length:0;let y=null;if(_!==0){if(y=l.value,v!==!0||y===null){const g=m+_*4,x=p.matrixWorldInverse;a.getNormalMatrix(x),(y===null||y.length0){const c=new uM(l.height/2);return c.fromEquirectangularTexture(r,o),e.set(o,c),o.addEventListener("dispose",i),t(c.texture,o.mapping)}else return null}}return o}function i(o){const a=o.target;a.removeEventListener("dispose",i);const l=e.get(a);l!==void 0&&(e.delete(a),l.dispose())}function s(){e=new WeakMap}return{get:n,dispose:s}}class Pa extends rh{constructor(e=-1,t=1,n=1,i=-1,s=.1,o=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=i,this.near=s,this.far=o,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,i,s,o){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=i,this.view.width=s,this.view.height=o,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,a=i+t,l=i-t;if(this.view!==null&&this.view.enabled){const c=(this.right-this.left)/this.view.fullWidth/this.zoom,u=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=c*this.view.offsetX,o=s+c*this.view.width,a-=u*this.view.offsetY,l=a-u*this.view.height}this.projectionMatrix.makeOrthographic(s,o,a,l,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}const Ul=4,o1=[.125,.215,.35,.446,.526,.582],la=20,Jm=new Pa,a1=new Ke;let Qm=null;const sa=(1+Math.sqrt(5))/2,hl=1/sa,l1=[new Y(1,1,1),new Y(-1,1,1),new Y(1,1,-1),new Y(-1,1,-1),new Y(0,sa,hl),new Y(0,sa,-hl),new Y(hl,0,sa),new Y(-hl,0,sa),new Y(sa,hl,0),new Y(-sa,hl,0)];class lv{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,i=100){Qm=this._renderer.getRenderTarget(),this._setSize(256);const s=this._allocateTargets();return s.depthBuffer=!0,this._sceneToCubeUV(e,n,i,s),t>0&&this._blur(s,0,0,t),this._applyPMREM(s),this._cleanup(s),s}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=h1(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=u1(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e2?w:0,w,w),u.setRenderTarget(i),_&&u.render(v,a),u.render(e,a)}v.geometry.dispose(),v.material.dispose(),u.toneMapping=p,u.autoClear=h,e.background=y}_textureToCubeUV(e,t){const n=this._renderer,i=e.mapping===xo||e.mapping===wo;i?(this._cubemapMaterial===null&&(this._cubemapMaterial=h1()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=u1());const s=i?this._cubemapMaterial:this._equirectMaterial,o=new _n(this._lodPlanes[0],s),a=s.uniforms;a.envMap.value=e;const l=this._cubeSize;Pf(t,0,0,3*l,2*l),n.setRenderTarget(t),n.render(o,Jm)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;for(let i=1;ila&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${y} samples when the maximum is set to ${la}`);const g=[];let x=0;for(let A=0;Aw-Ul?i-w+Ul:0),M=4*(this._cubeSize-E);Pf(t,b,M,3*E,2*E),l.setRenderTarget(t),l.render(h,Jm)}}function uI(r){const e=[],t=[],n=[];let i=r;const s=r-Ul+1+o1.length;for(let o=0;or-Ul?l=o1[o-r+Ul-1]:o===0&&(l=0),n.push(l);const c=1/(a-2),u=-c,h=1+c,p=[u,u,h,u,h,h,u,u,h,h,u,h],m=6,v=6,_=3,y=2,g=1,x=new Float32Array(_*v*m),w=new Float32Array(y*v*m),E=new Float32Array(g*v*m);for(let M=0;M2?0:-1,C=[A,P,0,A+2/3,P,0,A+2/3,P+1,0,A,P,0,A+2/3,P+1,0,A,P+1,0];x.set(C,_*v*M),w.set(p,y*v*M);const L=[M,M,M,M,M,M];E.set(L,g*v*M)}const b=new Tt;b.setAttribute("position",new $t(x,_)),b.setAttribute("uv",new $t(w,y)),b.setAttribute("faceIndex",new $t(E,g)),e.push(b),i>Ul&&i--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function c1(r,e,t){const n=new Gr(r,e,t);return n.texture.mapping=Jl,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function Pf(r,e,t,n,i){r.viewport.set(e,t,n,i),r.scissor.set(e,t,n,i)}function hI(r,e,t){const n=new Float32Array(la),i=new Y(0,1,0);return new cs({name:"SphericalGaussianBlur",defines:{n:la,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${r}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:i}},vertexShader:cy(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + uniform int samples; + uniform float weights[ n ]; + uniform bool latitudinal; + uniform float dTheta; + uniform float mipInt; + uniform vec3 poleAxis; + + #define ENVMAP_TYPE_CUBE_UV + #include + + vec3 getSample( float theta, vec3 axis ) { + + float cosTheta = cos( theta ); + // Rodrigues' axis-angle rotation + vec3 sampleDirection = vOutputDirection * cosTheta + + cross( axis, vOutputDirection ) * sin( theta ) + + axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta ); + + return bilinearCubeUV( envMap, sampleDirection, mipInt ); + + } + + void main() { + + vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection ); + + if ( all( equal( axis, vec3( 0.0 ) ) ) ) { + + axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x ); + + } + + axis = normalize( axis ); + + gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 ); + gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis ); + + for ( int i = 1; i < n; i++ ) { + + if ( i >= samples ) { + + break; + + } + + float theta = dTheta * float( i ); + gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis ); + gl_FragColor.rgb += weights[ i ] * getSample( theta, axis ); + + } + + } + `,blending:Fs,depthTest:!1,depthWrite:!1})}function u1(){return new cs({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:cy(),fragmentShader:` + + precision mediump float; + precision mediump int; + + varying vec3 vOutputDirection; + + uniform sampler2D envMap; + + #include + + void main() { + + vec3 outputDirection = normalize( vOutputDirection ); + vec2 uv = equirectUv( outputDirection ); + + gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 ); + + } + `,blending:Fs,depthTest:!1,depthWrite:!1})}function h1(){return new cs({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:cy(),fragmentShader:` + + precision mediump float; + precision mediump int; + + uniform float flipEnvMap; + + varying vec3 vOutputDirection; + + uniform samplerCube envMap; + + void main() { + + gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); + + } + `,blending:Fs,depthTest:!1,depthWrite:!1})}function cy(){return` + + precision mediump float; + precision mediump int; + + attribute float faceIndex; + + varying vec3 vOutputDirection; + + // RH coordinate system; PMREM face-indexing convention + vec3 getDirection( vec2 uv, float face ) { + + uv = 2.0 * uv - 1.0; + + vec3 direction = vec3( uv, 1.0 ); + + if ( face == 0.0 ) { + + direction = direction.zyx; // ( 1, v, u ) pos x + + } else if ( face == 1.0 ) { + + direction = direction.xzy; + direction.xz *= -1.0; // ( -u, 1, -v ) pos y + + } else if ( face == 2.0 ) { + + direction.x *= -1.0; // ( -u, v, 1 ) pos z + + } else if ( face == 3.0 ) { + + direction = direction.zyx; + direction.xz *= -1.0; // ( -1, v, -u ) neg x + + } else if ( face == 4.0 ) { + + direction = direction.xzy; + direction.xy *= -1.0; // ( -u, -1, v ) neg y + + } else if ( face == 5.0 ) { + + direction.z *= -1.0; // ( u, v, -1 ) neg z + + } + + return direction; + + } + + void main() { + + vOutputDirection = getDirection( uv, faceIndex ); + gl_Position = vec4( position, 1.0 ); + + } + `}function fI(r){let e=new WeakMap,t=null;function n(a){if(a&&a.isTexture){const l=a.mapping,c=l===Cu||l===Ru,u=l===xo||l===wo;if(c||u)if(a.isRenderTargetTexture&&a.needsPMREMUpdate===!0){a.needsPMREMUpdate=!1;let h=e.get(a);return t===null&&(t=new lv(r)),h=c?t.fromEquirectangular(a,h):t.fromCubemap(a,h),e.set(a,h),h.texture}else{if(e.has(a))return e.get(a).texture;{const h=a.image;if(c&&h&&h.height>0||u&&h&&i(h)){t===null&&(t=new lv(r));const p=c?t.fromEquirectangular(a):t.fromCubemap(a);return e.set(a,p),a.addEventListener("dispose",s),p.texture}else return null}}}return a}function i(a){let l=0;const c=6;for(let u=0;ue.maxTextureSize&&(L=Math.ceil(C/e.maxTextureSize),C=e.maxTextureSize);const F=new Float32Array(C*L*4*v),N=new Jd(F,C,L,v);N.type=rs,N.needsUpdate=!0;const I=P*4;for(let q=0;q0)return r;const i=e*t;let s=f1[i];if(s===void 0&&(s=new Float32Array(i),f1[i]=s),e!==0){n.toArray(s,0);for(let o=1,a=0;o!==e;++o)a+=t,r[o].toArray(s,a)}return s}function Wn(r,e){if(r.length!==e.length)return!1;for(let t=0,n=r.length;t":" "} ${a}: ${t[o]}`)}return n.join(` +`)}function dD(r){switch(r){case Br:return["Linear","( value )"];case Mt:return["sRGB","( value )"];default:return console.warn("THREE.WebGLProgram: Unsupported color space:",r),["Linear","( value )"]}}function _1(r,e,t){const n=r.getShaderParameter(e,r.COMPILE_STATUS),i=r.getShaderInfoLog(e).trim();if(n&&i==="")return"";const s=/ERROR: 0:(\d+)/.exec(i);if(s){const o=parseInt(s[1]);return t.toUpperCase()+` + +`+i+` + +`+fD(r.getShaderSource(e),o)}else return i}function pD(r,e){const t=dD(e);return"vec4 "+r+"( vec4 value ) { return LinearTo"+t[0]+t[1]+"; }"}function mD(r,e){let t;switch(e){case Ib:t="Linear";break;case Db:t="Reinhard";break;case Ub:t="OptimizedCineon";break;case Xv:t="ACESFilmic";break;case Ob:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+r+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}function gD(r){return[r.extensionDerivatives||r.envMapCubeUVHeight||r.bumpMap||r.normalMapTangentSpace||r.clearcoatNormalMap||r.flatShading||r.shaderID==="physical"?"#extension GL_OES_standard_derivatives : enable":"",(r.extensionFragDepth||r.logarithmicDepthBuffer)&&r.rendererExtensionFragDepth?"#extension GL_EXT_frag_depth : enable":"",r.extensionDrawBuffers&&r.rendererExtensionDrawBuffers?"#extension GL_EXT_draw_buffers : require":"",(r.extensionShaderTextureLOD||r.envMap||r.transmission)&&r.rendererExtensionShaderTextureLod?"#extension GL_EXT_shader_texture_lod : enable":""].filter(fu).join(` +`)}function vD(r){const e=[];for(const t in r){const n=r[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(` +`)}function yD(r,e){const t={},n=r.getProgramParameter(e,r.ACTIVE_ATTRIBUTES);for(let i=0;i/gm;function cv(r){return r.replace(_D,wD)}const xD=new Map([["encodings_fragment","colorspace_fragment"],["encodings_pars_fragment","colorspace_pars_fragment"],["output_fragment","opaque_fragment"]]);function wD(r,e){let t=bt[e];if(t===void 0){const n=xD.get(e);if(n!==void 0)t=bt[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return cv(t)}const SD=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function S1(r){return r.replace(SD,ED)}function ED(r,e,t,n){let i="";for(let s=parseInt(e);s0&&(y+=` +`),g=[m,"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v].filter(fu).join(` +`),g.length>0&&(g+=` +`)):(y=[E1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+u:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors&&t.isWebGL2?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE":"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0&&t.isWebGL2?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#if ( defined( USE_MORPHTARGETS ) && ! defined( MORPHTARGETS_TEXTURE ) )"," attribute vec3 morphTarget0;"," attribute vec3 morphTarget1;"," attribute vec3 morphTarget2;"," attribute vec3 morphTarget3;"," #ifdef USE_MORPHNORMALS"," attribute vec3 morphNormal0;"," attribute vec3 morphNormal1;"," attribute vec3 morphNormal2;"," attribute vec3 morphNormal3;"," #else"," attribute vec3 morphTarget4;"," attribute vec3 morphTarget5;"," attribute vec3 morphTarget6;"," attribute vec3 morphTarget7;"," #endif","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",` +`].filter(fu).join(` +`),g=[m,E1(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,v,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+c:"",t.envMap?"#define "+u:"",t.envMap?"#define "+h:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescence?"#define USE_IRIDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+l:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.useLegacyLights?"#define LEGACY_LIGHTS":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.logarithmicDepthBuffer&&t.rendererExtensionFragDepth?"#define USE_LOGDEPTHBUF_EXT":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==zr?"#define TONE_MAPPING":"",t.toneMapping!==zr?bt.tonemapping_pars_fragment:"",t.toneMapping!==zr?mD("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",bt.colorspace_pars_fragment,pD("linearToOutputTexel",t.outputColorSpace),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",` +`].filter(fu).join(` +`)),o=cv(o),o=x1(o,t),o=w1(o,t),a=cv(a),a=x1(a,t),a=w1(a,t),o=S1(o),a=S1(a),t.isWebGL2&&t.isRawShaderMaterial!==!0&&(x=`#version 300 es +`,y=["precision mediump sampler2DArray;","#define attribute in","#define varying out","#define texture2D texture"].join(` +`)+` +`+y,g=["#define varying in",t.glslVersion===ov?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===ov?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(` +`)+` +`+g);const w=x+y+o,E=x+g+a,b=y1(i,i.VERTEX_SHADER,w),M=y1(i,i.FRAGMENT_SHADER,E);if(i.attachShader(_,b),i.attachShader(_,M),t.index0AttributeName!==void 0?i.bindAttribLocation(_,0,t.index0AttributeName):t.morphTargets===!0&&i.bindAttribLocation(_,0,"position"),i.linkProgram(_),r.debug.checkShaderErrors){const C=i.getProgramInfoLog(_).trim(),L=i.getShaderInfoLog(b).trim(),F=i.getShaderInfoLog(M).trim();let N=!0,I=!0;if(i.getProgramParameter(_,i.LINK_STATUS)===!1)if(N=!1,typeof r.debug.onShaderError=="function")r.debug.onShaderError(i,_,b,M);else{const X=_1(i,b,"vertex"),q=_1(i,M,"fragment");console.error("THREE.WebGLProgram: Shader Error "+i.getError()+" - VALIDATE_STATUS "+i.getProgramParameter(_,i.VALIDATE_STATUS)+` + +Program Info Log: `+C+` +`+X+` +`+q)}else C!==""?console.warn("THREE.WebGLProgram: Program Info Log:",C):(L===""||F==="")&&(I=!1);I&&(this.diagnostics={runnable:N,programLog:C,vertexShader:{log:L,prefix:y},fragmentShader:{log:F,prefix:g}})}i.deleteShader(b),i.deleteShader(M);let A;this.getUniforms=function(){return A===void 0&&(A=new bd(i,_)),A};let P;return this.getAttributes=function(){return P===void 0&&(P=yD(i,_)),P},this.destroy=function(){n.releaseStatesOfProgram(this),i.deleteProgram(_),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=hD++,this.cacheKey=e,this.usedTimes=1,this.program=_,this.vertexShader=b,this.fragmentShader=M,this}let PD=0;class LD{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,i=this._getShaderStage(t),s=this._getShaderStage(n),o=this._getShaderCacheForMaterial(e);return o.has(i)===!1&&(o.add(i),i.usedTimes++),o.has(s)===!1&&(o.add(s),s.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new ID(e),t.set(e,n)),n}}class ID{constructor(e){this.id=PD++,this.code=e,this.usedTimes=0}}function DD(r,e,t,n,i,s,o){const a=new ga,l=new LD,c=[],u=i.isWebGL2,h=i.logarithmicDepthBuffer,p=i.vertexTextures;let m=i.precision;const v={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function _(C){return C===0?"uv":`uv${C}`}function y(C,L,F,N,I){const X=N.fog,q=I.geometry,W=C.isMeshStandardMaterial?N.environment:null,O=(C.isMeshStandardMaterial?t:e).get(C.envMap||W),k=O&&O.mapping===Jl?O.image.height:null,G=v[C.type];C.precision!==null&&(m=i.getMaxPrecision(C.precision),m!==C.precision&&console.warn("THREE.WebGLProgram.getParameters:",C.precision,"not supported, using",m,"instead."));const B=q.morphAttributes.position||q.morphAttributes.normal||q.morphAttributes.color,D=B!==void 0?B.length:0;let V=0;q.morphAttributes.position!==void 0&&(V=1),q.morphAttributes.normal!==void 0&&(V=2),q.morphAttributes.color!==void 0&&(V=3);let Z,ee,ie,ue;if(G){const Ot=Nr[G];Z=Ot.vertexShader,ee=Ot.fragmentShader}else Z=C.vertexShader,ee=C.fragmentShader,l.update(C),ie=l.getVertexShaderID(C),ue=l.getFragmentShaderID(C);const ce=r.getRenderTarget(),le=I.isInstancedMesh===!0,Ae=!!C.map,Ee=!!C.matcap,ae=!!O,z=!!C.aoMap,oe=!!C.lightMap,te=!!C.bumpMap,se=!!C.normalMap,$=!!C.displacementMap,Ie=!!C.emissiveMap,de=!!C.metalnessMap,Se=!!C.roughnessMap,Le=C.anisotropy>0,ge=C.clearcoat>0,He=C.iridescence>0,j=C.sheen>0,H=C.transmission>0,ne=Le&&!!C.anisotropyMap,we=ge&&!!C.clearcoatMap,be=ge&&!!C.clearcoatNormalMap,Me=ge&&!!C.clearcoatRoughnessMap,Fe=He&&!!C.iridescenceMap,Ue=He&&!!C.iridescenceThicknessMap,xe=j&&!!C.sheenColorMap,Be=j&&!!C.sheenRoughnessMap,$e=!!C.specularMap,Ve=!!C.specularColorMap,Oe=!!C.specularIntensityMap,We=H&&!!C.transmissionMap,nt=H&&!!C.thicknessMap,pt=!!C.gradientMap,re=!!C.alphaMap,ze=C.alphaTest>0,ve=!!C.alphaHash,Ge=!!C.extensions,Ye=!!q.attributes.uv1,_t=!!q.attributes.uv2,It=!!q.attributes.uv3;return{isWebGL2:u,shaderID:G,shaderType:C.type,shaderName:C.name,vertexShader:Z,fragmentShader:ee,defines:C.defines,customVertexShaderID:ie,customFragmentShaderID:ue,isRawShaderMaterial:C.isRawShaderMaterial===!0,glslVersion:C.glslVersion,precision:m,instancing:le,instancingColor:le&&I.instanceColor!==null,supportsVertexTextures:p,outputColorSpace:ce===null?r.outputColorSpace:ce.isXRRenderTarget===!0?ce.texture.colorSpace:Br,map:Ae,matcap:Ee,envMap:ae,envMapMode:ae&&O.mapping,envMapCubeUVHeight:k,aoMap:z,lightMap:oe,bumpMap:te,normalMap:se,displacementMap:p&&$,emissiveMap:Ie,normalMapObjectSpace:se&&C.normalMapType===Zb,normalMapTangentSpace:se&&C.normalMapType===Mo,metalnessMap:de,roughnessMap:Se,anisotropy:Le,anisotropyMap:ne,clearcoat:ge,clearcoatMap:we,clearcoatNormalMap:be,clearcoatRoughnessMap:Me,iridescence:He,iridescenceMap:Fe,iridescenceThicknessMap:Ue,sheen:j,sheenColorMap:xe,sheenRoughnessMap:Be,specularMap:$e,specularColorMap:Ve,specularIntensityMap:Oe,transmission:H,transmissionMap:We,thicknessMap:nt,gradientMap:pt,opaque:C.transparent===!1&&C.blending===pa,alphaMap:re,alphaTest:ze,alphaHash:ve,combine:C.combine,mapUv:Ae&&_(C.map.channel),aoMapUv:z&&_(C.aoMap.channel),lightMapUv:oe&&_(C.lightMap.channel),bumpMapUv:te&&_(C.bumpMap.channel),normalMapUv:se&&_(C.normalMap.channel),displacementMapUv:$&&_(C.displacementMap.channel),emissiveMapUv:Ie&&_(C.emissiveMap.channel),metalnessMapUv:de&&_(C.metalnessMap.channel),roughnessMapUv:Se&&_(C.roughnessMap.channel),anisotropyMapUv:ne&&_(C.anisotropyMap.channel),clearcoatMapUv:we&&_(C.clearcoatMap.channel),clearcoatNormalMapUv:be&&_(C.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:Me&&_(C.clearcoatRoughnessMap.channel),iridescenceMapUv:Fe&&_(C.iridescenceMap.channel),iridescenceThicknessMapUv:Ue&&_(C.iridescenceThicknessMap.channel),sheenColorMapUv:xe&&_(C.sheenColorMap.channel),sheenRoughnessMapUv:Be&&_(C.sheenRoughnessMap.channel),specularMapUv:$e&&_(C.specularMap.channel),specularColorMapUv:Ve&&_(C.specularColorMap.channel),specularIntensityMapUv:Oe&&_(C.specularIntensityMap.channel),transmissionMapUv:We&&_(C.transmissionMap.channel),thicknessMapUv:nt&&_(C.thicknessMap.channel),alphaMapUv:re&&_(C.alphaMap.channel),vertexTangents:!!q.attributes.tangent&&(se||Le),vertexColors:C.vertexColors,vertexAlphas:C.vertexColors===!0&&!!q.attributes.color&&q.attributes.color.itemSize===4,vertexUv1s:Ye,vertexUv2s:_t,vertexUv3s:It,pointsUvs:I.isPoints===!0&&!!q.attributes.uv&&(Ae||re),fog:!!X,useFog:C.fog===!0,fogExp2:X&&X.isFogExp2,flatShading:C.flatShading===!0,sizeAttenuation:C.sizeAttenuation===!0,logarithmicDepthBuffer:h,skinning:I.isSkinnedMesh===!0,morphTargets:q.morphAttributes.position!==void 0,morphNormals:q.morphAttributes.normal!==void 0,morphColors:q.morphAttributes.color!==void 0,morphTargetsCount:D,morphTextureStride:V,numDirLights:L.directional.length,numPointLights:L.point.length,numSpotLights:L.spot.length,numSpotLightMaps:L.spotLightMap.length,numRectAreaLights:L.rectArea.length,numHemiLights:L.hemi.length,numDirLightShadows:L.directionalShadowMap.length,numPointLightShadows:L.pointShadowMap.length,numSpotLightShadows:L.spotShadowMap.length,numSpotLightShadowsWithMaps:L.numSpotLightShadowsWithMaps,numClippingPlanes:o.numPlanes,numClipIntersection:o.numIntersection,dithering:C.dithering,shadowMapEnabled:r.shadowMap.enabled&&F.length>0,shadowMapType:r.shadowMap.type,toneMapping:C.toneMapped?r.toneMapping:zr,useLegacyLights:r.useLegacyLights,premultipliedAlpha:C.premultipliedAlpha,doubleSided:C.side===vn,flipSided:C.side===yi,useDepthPacking:C.depthPacking>=0,depthPacking:C.depthPacking||0,index0AttributeName:C.index0AttributeName,extensionDerivatives:Ge&&C.extensions.derivatives===!0,extensionFragDepth:Ge&&C.extensions.fragDepth===!0,extensionDrawBuffers:Ge&&C.extensions.drawBuffers===!0,extensionShaderTextureLOD:Ge&&C.extensions.shaderTextureLOD===!0,rendererExtensionFragDepth:u||n.has("EXT_frag_depth"),rendererExtensionDrawBuffers:u||n.has("WEBGL_draw_buffers"),rendererExtensionShaderTextureLod:u||n.has("EXT_shader_texture_lod"),customProgramCacheKey:C.customProgramCacheKey()}}function g(C){const L=[];if(C.shaderID?L.push(C.shaderID):(L.push(C.customVertexShaderID),L.push(C.customFragmentShaderID)),C.defines!==void 0)for(const F in C.defines)L.push(F),L.push(C.defines[F]);return C.isRawShaderMaterial===!1&&(x(L,C),w(L,C),L.push(r.outputColorSpace)),L.push(C.customProgramCacheKey),L.join()}function x(C,L){C.push(L.precision),C.push(L.outputColorSpace),C.push(L.envMapMode),C.push(L.envMapCubeUVHeight),C.push(L.mapUv),C.push(L.alphaMapUv),C.push(L.lightMapUv),C.push(L.aoMapUv),C.push(L.bumpMapUv),C.push(L.normalMapUv),C.push(L.displacementMapUv),C.push(L.emissiveMapUv),C.push(L.metalnessMapUv),C.push(L.roughnessMapUv),C.push(L.anisotropyMapUv),C.push(L.clearcoatMapUv),C.push(L.clearcoatNormalMapUv),C.push(L.clearcoatRoughnessMapUv),C.push(L.iridescenceMapUv),C.push(L.iridescenceThicknessMapUv),C.push(L.sheenColorMapUv),C.push(L.sheenRoughnessMapUv),C.push(L.specularMapUv),C.push(L.specularColorMapUv),C.push(L.specularIntensityMapUv),C.push(L.transmissionMapUv),C.push(L.thicknessMapUv),C.push(L.combine),C.push(L.fogExp2),C.push(L.sizeAttenuation),C.push(L.morphTargetsCount),C.push(L.morphAttributeCount),C.push(L.numDirLights),C.push(L.numPointLights),C.push(L.numSpotLights),C.push(L.numSpotLightMaps),C.push(L.numHemiLights),C.push(L.numRectAreaLights),C.push(L.numDirLightShadows),C.push(L.numPointLightShadows),C.push(L.numSpotLightShadows),C.push(L.numSpotLightShadowsWithMaps),C.push(L.shadowMapType),C.push(L.toneMapping),C.push(L.numClippingPlanes),C.push(L.numClipIntersection),C.push(L.depthPacking)}function w(C,L){a.disableAll(),L.isWebGL2&&a.enable(0),L.supportsVertexTextures&&a.enable(1),L.instancing&&a.enable(2),L.instancingColor&&a.enable(3),L.matcap&&a.enable(4),L.envMap&&a.enable(5),L.normalMapObjectSpace&&a.enable(6),L.normalMapTangentSpace&&a.enable(7),L.clearcoat&&a.enable(8),L.iridescence&&a.enable(9),L.alphaTest&&a.enable(10),L.vertexColors&&a.enable(11),L.vertexAlphas&&a.enable(12),L.vertexUv1s&&a.enable(13),L.vertexUv2s&&a.enable(14),L.vertexUv3s&&a.enable(15),L.vertexTangents&&a.enable(16),L.anisotropy&&a.enable(17),C.push(a.mask),a.disableAll(),L.fog&&a.enable(0),L.useFog&&a.enable(1),L.flatShading&&a.enable(2),L.logarithmicDepthBuffer&&a.enable(3),L.skinning&&a.enable(4),L.morphTargets&&a.enable(5),L.morphNormals&&a.enable(6),L.morphColors&&a.enable(7),L.premultipliedAlpha&&a.enable(8),L.shadowMapEnabled&&a.enable(9),L.useLegacyLights&&a.enable(10),L.doubleSided&&a.enable(11),L.flipSided&&a.enable(12),L.useDepthPacking&&a.enable(13),L.dithering&&a.enable(14),L.transmission&&a.enable(15),L.sheen&&a.enable(16),L.opaque&&a.enable(17),L.pointsUvs&&a.enable(18),C.push(a.mask)}function E(C){const L=v[C.type];let F;if(L){const N=Nr[L];F=ly.clone(N.uniforms)}else F=C.uniforms;return F}function b(C,L){let F;for(let N=0,I=c.length;N0?n.push(g):m.transparent===!0?i.push(g):t.push(g)}function l(h,p,m,v,_,y){const g=o(h,p,m,v,_,y);m.transmission>0?n.unshift(g):m.transparent===!0?i.unshift(g):t.unshift(g)}function c(h,p){t.length>1&&t.sort(h||OD),n.length>1&&n.sort(p||b1),i.length>1&&i.sort(p||b1)}function u(){for(let h=e,p=r.length;h=s.length?(o=new M1,s.push(o)):o=s[i],o}function t(){r=new WeakMap}return{get:e,dispose:t}}function FD(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new Y,color:new Ke};break;case"SpotLight":t={position:new Y,direction:new Y,color:new Ke,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new Y,color:new Ke,distance:0,decay:0};break;case"HemisphereLight":t={direction:new Y,skyColor:new Ke,groundColor:new Ke};break;case"RectAreaLight":t={color:new Ke,position:new Y,halfWidth:new Y,halfHeight:new Y};break}return r[e.id]=t,t}}}function kD(){const r={};return{get:function(e){if(r[e.id]!==void 0)return r[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De};break;case"SpotLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De};break;case"PointLight":t={shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new De,shadowCameraNear:1,shadowCameraFar:1e3};break}return r[e.id]=t,t}}}let zD=0;function BD(r,e){return(e.castShadow?2:0)-(r.castShadow?2:0)+(e.map?1:0)-(r.map?1:0)}function GD(r,e){const t=new FD,n=kD(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0};for(let u=0;u<9;u++)i.probe.push(new Y);const s=new Y,o=new yt,a=new yt;function l(u,h){let p=0,m=0,v=0;for(let F=0;F<9;F++)i.probe[F].set(0,0,0);let _=0,y=0,g=0,x=0,w=0,E=0,b=0,M=0,A=0,P=0;u.sort(BD);const C=h===!0?Math.PI:1;for(let F=0,N=u.length;F0&&(e.isWebGL2||r.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_FLOAT_1,i.rectAreaLTC2=Je.LTC_FLOAT_2):r.has("OES_texture_half_float_linear")===!0?(i.rectAreaLTC1=Je.LTC_HALF_1,i.rectAreaLTC2=Je.LTC_HALF_2):console.error("THREE.WebGLRenderer: Unable to use RectAreaLight. Missing WebGL extensions.")),i.ambient[0]=p,i.ambient[1]=m,i.ambient[2]=v;const L=i.hash;(L.directionalLength!==_||L.pointLength!==y||L.spotLength!==g||L.rectAreaLength!==x||L.hemiLength!==w||L.numDirectionalShadows!==E||L.numPointShadows!==b||L.numSpotShadows!==M||L.numSpotMaps!==A)&&(i.directional.length=_,i.spot.length=g,i.rectArea.length=x,i.point.length=y,i.hemi.length=w,i.directionalShadow.length=E,i.directionalShadowMap.length=E,i.pointShadow.length=b,i.pointShadowMap.length=b,i.spotShadow.length=M,i.spotShadowMap.length=M,i.directionalShadowMatrix.length=E,i.pointShadowMatrix.length=b,i.spotLightMatrix.length=M+A-P,i.spotLightMap.length=A,i.numSpotLightShadowsWithMaps=P,L.directionalLength=_,L.pointLength=y,L.spotLength=g,L.rectAreaLength=x,L.hemiLength=w,L.numDirectionalShadows=E,L.numPointShadows=b,L.numSpotShadows=M,L.numSpotMaps=A,i.version=zD++)}function c(u,h){let p=0,m=0,v=0,_=0,y=0;const g=h.matrixWorldInverse;for(let x=0,w=u.length;x=a.length?(l=new T1(r,e),a.push(l)):l=a[o],l}function i(){t=new WeakMap}return{get:n,dispose:i}}class ep extends oi{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=qb,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class tp extends oi{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}const VD=`void main() { + gl_Position = vec4( position, 1.0 ); +}`,WD=`uniform sampler2D shadow_pass; +uniform vec2 resolution; +uniform float radius; +#include +void main() { + const float samples = float( VSM_SAMPLES ); + float mean = 0.0; + float squared_mean = 0.0; + float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 ); + float uvStart = samples <= 1.0 ? 0.0 : - 1.0; + for ( float i = 0.0; i < samples; i ++ ) { + float uvOffset = uvStart + i * uvStride; + #ifdef HORIZONTAL_PASS + vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) ); + mean += distribution.x; + squared_mean += distribution.y * distribution.y + distribution.x * distribution.x; + #else + float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) ); + mean += depth; + squared_mean += depth * depth; + #endif + } + mean = mean / samples; + squared_mean = squared_mean / samples; + float std_dev = sqrt( squared_mean - mean * mean ); + gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) ); +}`;function XD(r,e,t){let n=new oh;const i=new De,s=new De,o=new Xt,a=new ep({depthPacking:ty}),l=new tp,c={},u=t.maxTextureSize,h={[ls]:yi,[yi]:ls,[vn]:vn},p=new cs({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new De},radius:{value:4}},vertexShader:VD,fragmentShader:WD}),m=p.clone();m.defines.HORIZONTAL_PASS=1;const v=new Tt;v.setAttribute("position",new $t(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const _=new _n(v,p),y=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=qd;let g=this.type;this.render=function(b,M,A){if(y.enabled===!1||y.autoUpdate===!1&&y.needsUpdate===!1||b.length===0)return;const P=r.getRenderTarget(),C=r.getActiveCubeFace(),L=r.getActiveMipmapLevel(),F=r.state;F.setBlending(Fs),F.buffers.color.setClear(1,1,1,1),F.buffers.depth.setTest(!0),F.setScissorTest(!1);const N=g!==Or&&this.type===Or,I=g===Or&&this.type!==Or;for(let X=0,q=b.length;Xu||i.y>u)&&(i.x>u&&(s.x=Math.floor(u/k.x),i.x=s.x*k.x,O.mapSize.x=s.x),i.y>u&&(s.y=Math.floor(u/k.y),i.y=s.y*k.y,O.mapSize.y=s.y)),O.map===null||N===!0||I===!0){const B=this.type!==Or?{minFilter:Dn,magFilter:Dn}:{};O.map!==null&&O.map.dispose(),O.map=new Gr(i.x,i.y,B),O.map.texture.name=W.name+".shadowMap",O.camera.updateProjectionMatrix()}r.setRenderTarget(O.map),r.clear();const G=O.getViewportCount();for(let B=0;B0||M.map&&M.alphaTest>0){const F=C.uuid,N=M.uuid;let I=c[F];I===void 0&&(I={},c[F]=I);let X=I[N];X===void 0&&(X=C.clone(),I[N]=X),C=X}if(C.visible=M.visible,C.wireframe=M.wireframe,P===Or?C.side=M.shadowSide!==null?M.shadowSide:M.side:C.side=M.shadowSide!==null?M.shadowSide:h[M.side],C.alphaMap=M.alphaMap,C.alphaTest=M.alphaTest,C.map=M.map,C.clipShadows=M.clipShadows,C.clippingPlanes=M.clippingPlanes,C.clipIntersection=M.clipIntersection,C.displacementMap=M.displacementMap,C.displacementScale=M.displacementScale,C.displacementBias=M.displacementBias,C.wireframeLinewidth=M.wireframeLinewidth,C.linewidth=M.linewidth,A.isPointLight===!0&&C.isMeshDistanceMaterial===!0){const F=r.properties.get(C);F.light=A}return C}function E(b,M,A,P,C){if(b.visible===!1)return;if(b.layers.test(M.layers)&&(b.isMesh||b.isLine||b.isPoints)&&(b.castShadow||b.receiveShadow&&C===Or)&&(!b.frustumCulled||n.intersectsObject(b))){b.modelViewMatrix.multiplyMatrices(A.matrixWorldInverse,b.matrixWorld);const N=e.update(b),I=b.material;if(Array.isArray(I)){const X=N.groups;for(let q=0,W=X.length;q=1):k.indexOf("OpenGL ES")!==-1&&(O=parseFloat(/^OpenGL ES (\d)/.exec(k)[1]),W=O>=2);let G=null,B={};const D=r.getParameter(r.SCISSOR_BOX),V=r.getParameter(r.VIEWPORT),Z=new Xt().fromArray(D),ee=new Xt().fromArray(V);function ie(re,ze,ve,Ge){const Ye=new Uint8Array(4),_t=r.createTexture();r.bindTexture(re,_t),r.texParameteri(re,r.TEXTURE_MIN_FILTER,r.NEAREST),r.texParameteri(re,r.TEXTURE_MAG_FILTER,r.NEAREST);for(let It=0;It"u"?!1:/OculusBrowser/g.test(navigator.userAgent),v=new WeakMap;let _;const y=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function x(j,H){return g?new OffscreenCanvas(j,H):Fu("canvas")}function w(j,H,ne,we){let be=1;if((j.width>we||j.height>we)&&(be=we/Math.max(j.width,j.height)),be<1||H===!0)if(typeof HTMLImageElement<"u"&&j instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&j instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&j instanceof ImageBitmap){const Me=H?Ud:Math.floor,Fe=Me(be*j.width),Ue=Me(be*j.height);_===void 0&&(_=x(Fe,Ue));const xe=ne?x(Fe,Ue):_;return xe.width=Fe,xe.height=Ue,xe.getContext("2d").drawImage(j,0,0,Fe,Ue),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+j.width+"x"+j.height+") to ("+Fe+"x"+Ue+")."),xe}else return"data"in j&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+j.width+"x"+j.height+")."),j;return j}function E(j){return av(j.width)&&av(j.height)}function b(j){return a?!1:j.wrapS!==vi||j.wrapT!==vi||j.minFilter!==Dn&&j.minFilter!==fn}function M(j,H){return j.generateMipmaps&&H&&j.minFilter!==Dn&&j.minFilter!==fn}function A(j){r.generateMipmap(j)}function P(j,H,ne,we,be=!1){if(a===!1)return H;if(j!==null){if(r[j]!==void 0)return r[j];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+j+"'")}let Me=H;return H===r.RED&&(ne===r.FLOAT&&(Me=r.R32F),ne===r.HALF_FLOAT&&(Me=r.R16F),ne===r.UNSIGNED_BYTE&&(Me=r.R8)),H===r.RG&&(ne===r.FLOAT&&(Me=r.RG32F),ne===r.HALF_FLOAT&&(Me=r.RG16F),ne===r.UNSIGNED_BYTE&&(Me=r.RG8)),H===r.RGBA&&(ne===r.FLOAT&&(Me=r.RGBA32F),ne===r.HALF_FLOAT&&(Me=r.RGBA16F),ne===r.UNSIGNED_BYTE&&(Me=we===Mt&&be===!1?r.SRGB8_ALPHA8:r.RGBA8),ne===r.UNSIGNED_SHORT_4_4_4_4&&(Me=r.RGBA4),ne===r.UNSIGNED_SHORT_5_5_5_1&&(Me=r.RGB5_A1)),(Me===r.R16F||Me===r.R32F||Me===r.RG16F||Me===r.RG32F||Me===r.RGBA16F||Me===r.RGBA32F)&&e.get("EXT_color_buffer_float"),Me}function C(j,H,ne){return M(j,ne)===!0||j.isFramebufferTexture&&j.minFilter!==Dn&&j.minFilter!==fn?Math.log2(Math.max(H.width,H.height))+1:j.mipmaps!==void 0&&j.mipmaps.length>0?j.mipmaps.length:j.isCompressedTexture&&Array.isArray(j.image)?H.mipmaps.length:1}function L(j){return j===Dn||j===Id||j===vu?r.NEAREST:r.LINEAR}function F(j){const H=j.target;H.removeEventListener("dispose",F),I(H),H.isVideoTexture&&v.delete(H)}function N(j){const H=j.target;H.removeEventListener("dispose",N),q(H)}function I(j){const H=n.get(j);if(H.__webglInit===void 0)return;const ne=j.source,we=y.get(ne);if(we){const be=we[H.__cacheKey];be.usedTimes--,be.usedTimes===0&&X(j),Object.keys(we).length===0&&y.delete(ne)}n.remove(j)}function X(j){const H=n.get(j);r.deleteTexture(H.__webglTexture);const ne=j.source,we=y.get(ne);delete we[H.__cacheKey],o.memory.textures--}function q(j){const H=j.texture,ne=n.get(j),we=n.get(H);if(we.__webglTexture!==void 0&&(r.deleteTexture(we.__webglTexture),o.memory.textures--),j.depthTexture&&j.depthTexture.dispose(),j.isWebGLCubeRenderTarget)for(let be=0;be<6;be++)r.deleteFramebuffer(ne.__webglFramebuffer[be]),ne.__webglDepthbuffer&&r.deleteRenderbuffer(ne.__webglDepthbuffer[be]);else{if(r.deleteFramebuffer(ne.__webglFramebuffer),ne.__webglDepthbuffer&&r.deleteRenderbuffer(ne.__webglDepthbuffer),ne.__webglMultisampledFramebuffer&&r.deleteFramebuffer(ne.__webglMultisampledFramebuffer),ne.__webglColorRenderbuffer)for(let be=0;be=l&&console.warn("THREE.WebGLTextures: Trying to use "+j+" texture units while this GPU supports only "+l),W+=1,j}function G(j){const H=[];return H.push(j.wrapS),H.push(j.wrapT),H.push(j.wrapR||0),H.push(j.magFilter),H.push(j.minFilter),H.push(j.anisotropy),H.push(j.internalFormat),H.push(j.format),H.push(j.type),H.push(j.generateMipmaps),H.push(j.premultiplyAlpha),H.push(j.flipY),H.push(j.unpackAlignment),H.push(j.colorSpace),H.join()}function B(j,H){const ne=n.get(j);if(j.isVideoTexture&&ge(j),j.isRenderTargetTexture===!1&&j.version>0&&ne.__version!==j.version){const we=j.image;if(we===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(we.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{Ae(ne,j,H);return}}t.bindTexture(r.TEXTURE_2D,ne.__webglTexture,r.TEXTURE0+H)}function D(j,H){const ne=n.get(j);if(j.version>0&&ne.__version!==j.version){Ae(ne,j,H);return}t.bindTexture(r.TEXTURE_2D_ARRAY,ne.__webglTexture,r.TEXTURE0+H)}function V(j,H){const ne=n.get(j);if(j.version>0&&ne.__version!==j.version){Ae(ne,j,H);return}t.bindTexture(r.TEXTURE_3D,ne.__webglTexture,r.TEXTURE0+H)}function Z(j,H){const ne=n.get(j);if(j.version>0&&ne.__version!==j.version){Ee(ne,j,H);return}t.bindTexture(r.TEXTURE_CUBE_MAP,ne.__webglTexture,r.TEXTURE0+H)}const ee={[Pu]:r.REPEAT,[vi]:r.CLAMP_TO_EDGE,[Lu]:r.MIRRORED_REPEAT},ie={[Dn]:r.NEAREST,[Id]:r.NEAREST_MIPMAP_NEAREST,[vu]:r.NEAREST_MIPMAP_LINEAR,[fn]:r.LINEAR,[jv]:r.LINEAR_MIPMAP_NEAREST,[So]:r.LINEAR_MIPMAP_LINEAR},ue={[$b]:r.NEVER,[rM]:r.ALWAYS,[Jb]:r.LESS,[eM]:r.LEQUAL,[Qb]:r.EQUAL,[iM]:r.GEQUAL,[tM]:r.GREATER,[nM]:r.NOTEQUAL};function ce(j,H,ne){if(ne?(r.texParameteri(j,r.TEXTURE_WRAP_S,ee[H.wrapS]),r.texParameteri(j,r.TEXTURE_WRAP_T,ee[H.wrapT]),(j===r.TEXTURE_3D||j===r.TEXTURE_2D_ARRAY)&&r.texParameteri(j,r.TEXTURE_WRAP_R,ee[H.wrapR]),r.texParameteri(j,r.TEXTURE_MAG_FILTER,ie[H.magFilter]),r.texParameteri(j,r.TEXTURE_MIN_FILTER,ie[H.minFilter])):(r.texParameteri(j,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(j,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE),(j===r.TEXTURE_3D||j===r.TEXTURE_2D_ARRAY)&&r.texParameteri(j,r.TEXTURE_WRAP_R,r.CLAMP_TO_EDGE),(H.wrapS!==vi||H.wrapT!==vi)&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping."),r.texParameteri(j,r.TEXTURE_MAG_FILTER,L(H.magFilter)),r.texParameteri(j,r.TEXTURE_MIN_FILTER,L(H.minFilter)),H.minFilter!==Dn&&H.minFilter!==fn&&console.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter.")),H.compareFunction&&(r.texParameteri(j,r.TEXTURE_COMPARE_MODE,r.COMPARE_REF_TO_TEXTURE),r.texParameteri(j,r.TEXTURE_COMPARE_FUNC,ue[H.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){const we=e.get("EXT_texture_filter_anisotropic");if(H.magFilter===Dn||H.minFilter!==vu&&H.minFilter!==So||H.type===rs&&e.has("OES_texture_float_linear")===!1||a===!1&&H.type===Vl&&e.has("OES_texture_half_float_linear")===!1)return;(H.anisotropy>1||n.get(H).__currentAnisotropy)&&(r.texParameterf(j,we.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(H.anisotropy,i.getMaxAnisotropy())),n.get(H).__currentAnisotropy=H.anisotropy)}}function le(j,H){let ne=!1;j.__webglInit===void 0&&(j.__webglInit=!0,H.addEventListener("dispose",F));const we=H.source;let be=y.get(we);be===void 0&&(be={},y.set(we,be));const Me=G(H);if(Me!==j.__cacheKey){be[Me]===void 0&&(be[Me]={texture:r.createTexture(),usedTimes:0},o.memory.textures++,ne=!0),be[Me].usedTimes++;const Fe=be[j.__cacheKey];Fe!==void 0&&(be[j.__cacheKey].usedTimes--,Fe.usedTimes===0&&X(H)),j.__cacheKey=Me,j.__webglTexture=be[Me].texture}return ne}function Ae(j,H,ne){let we=r.TEXTURE_2D;(H.isDataArrayTexture||H.isCompressedArrayTexture)&&(we=r.TEXTURE_2D_ARRAY),H.isData3DTexture&&(we=r.TEXTURE_3D);const be=le(j,H),Me=H.source;t.bindTexture(we,j.__webglTexture,r.TEXTURE0+ne);const Fe=n.get(Me);if(Me.version!==Fe.__version||be===!0){t.activeTexture(r.TEXTURE0+ne),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,H.flipY),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,H.premultiplyAlpha),r.pixelStorei(r.UNPACK_ALIGNMENT,H.unpackAlignment),r.pixelStorei(r.UNPACK_COLORSPACE_CONVERSION_WEBGL,r.NONE);const Ue=b(H)&&E(H.image)===!1;let xe=w(H.image,Ue,!1,u);xe=He(H,xe);const Be=E(xe)||a,$e=s.convert(H.format,H.colorSpace);let Ve=s.convert(H.type),Oe=P(H.internalFormat,$e,Ve,H.colorSpace);ce(we,H,Be);let We;const nt=H.mipmaps,pt=a&&H.isVideoTexture!==!0,re=Fe.__version===void 0||be===!0,ze=C(H,xe,Be);if(H.isDepthTexture)Oe=r.DEPTH_COMPONENT,a?H.type===rs?Oe=r.DEPTH_COMPONENT32F:H.type===Ns?Oe=r.DEPTH_COMPONENT24:H.type===mo?Oe=r.DEPTH24_STENCIL8:Oe=r.DEPTH_COMPONENT16:H.type===rs&&console.error("WebGLRenderer: Floating point depth texture requires WebGL2."),H.format===go&&Oe===r.DEPTH_COMPONENT&&H.type!==Kd&&H.type!==Ns&&(console.warn("THREE.WebGLRenderer: Use UnsignedShortType or UnsignedIntType for DepthFormat DepthTexture."),H.type=Ns,Ve=s.convert(H.type)),H.format===xa&&Oe===r.DEPTH_COMPONENT&&(Oe=r.DEPTH_STENCIL,H.type!==mo&&(console.warn("THREE.WebGLRenderer: Use UnsignedInt248Type for DepthStencilFormat DepthTexture."),H.type=mo,Ve=s.convert(H.type))),re&&(pt?t.texStorage2D(r.TEXTURE_2D,1,Oe,xe.width,xe.height):t.texImage2D(r.TEXTURE_2D,0,Oe,xe.width,xe.height,0,$e,Ve,null));else if(H.isDataTexture)if(nt.length>0&&Be){pt&&re&&t.texStorage2D(r.TEXTURE_2D,ze,Oe,nt[0].width,nt[0].height);for(let ve=0,Ge=nt.length;ve>=1,Ge>>=1}}else if(nt.length>0&&Be){pt&&re&&t.texStorage2D(r.TEXTURE_2D,ze,Oe,nt[0].width,nt[0].height);for(let ve=0,Ge=nt.length;ve0&&re++,t.texStorage2D(r.TEXTURE_CUBE_MAP,re,We,xe[0].width,xe[0].height));for(let ve=0;ve<6;ve++)if(Ue){nt?t.texSubImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,0,0,xe[ve].width,xe[ve].height,Ve,Oe,xe[ve].data):t.texImage2D(r.TEXTURE_CUBE_MAP_POSITIVE_X+ve,0,We,xe[ve].width,xe[ve].height,0,Ve,Oe,xe[ve].data);for(let Ge=0;Ge=r.TEXTURE_CUBE_MAP_POSITIVE_X&&be<=r.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&r.framebufferTexture2D(r.FRAMEBUFFER,we,be,n.get(ne).__webglTexture,0),t.bindFramebuffer(r.FRAMEBUFFER,null)}function z(j,H,ne){if(r.bindRenderbuffer(r.RENDERBUFFER,j),H.depthBuffer&&!H.stencilBuffer){let we=r.DEPTH_COMPONENT16;if(ne||Le(H)){const be=H.depthTexture;be&&be.isDepthTexture&&(be.type===rs?we=r.DEPTH_COMPONENT32F:be.type===Ns&&(we=r.DEPTH_COMPONENT24));const Me=Se(H);Le(H)?p.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,Me,we,H.width,H.height):r.renderbufferStorageMultisample(r.RENDERBUFFER,Me,we,H.width,H.height)}else r.renderbufferStorage(r.RENDERBUFFER,we,H.width,H.height);r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_ATTACHMENT,r.RENDERBUFFER,j)}else if(H.depthBuffer&&H.stencilBuffer){const we=Se(H);ne&&Le(H)===!1?r.renderbufferStorageMultisample(r.RENDERBUFFER,we,r.DEPTH24_STENCIL8,H.width,H.height):Le(H)?p.renderbufferStorageMultisampleEXT(r.RENDERBUFFER,we,r.DEPTH24_STENCIL8,H.width,H.height):r.renderbufferStorage(r.RENDERBUFFER,r.DEPTH_STENCIL,H.width,H.height),r.framebufferRenderbuffer(r.FRAMEBUFFER,r.DEPTH_STENCIL_ATTACHMENT,r.RENDERBUFFER,j)}else{const we=H.isWebGLMultipleRenderTargets===!0?H.texture:[H.texture];for(let be=0;be0&&Le(j)===!1){const Ue=Me?H:[H];ne.__webglMultisampledFramebuffer=r.createFramebuffer(),ne.__webglColorRenderbuffer=[],t.bindFramebuffer(r.FRAMEBUFFER,ne.__webglMultisampledFramebuffer);for(let xe=0;xe0&&Le(j)===!1){const H=j.isWebGLMultipleRenderTargets?j.texture:[j.texture],ne=j.width,we=j.height;let be=r.COLOR_BUFFER_BIT;const Me=[],Fe=j.stencilBuffer?r.DEPTH_STENCIL_ATTACHMENT:r.DEPTH_ATTACHMENT,Ue=n.get(j),xe=j.isWebGLMultipleRenderTargets===!0;if(xe)for(let Be=0;Be0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&H.__useRenderToTexture!==!1}function ge(j){const H=o.render.frame;v.get(j)!==H&&(v.set(j,H),j.update())}function He(j,H){const ne=j.colorSpace,we=j.format,be=j.type;return j.isCompressedTexture===!0||j.format===Dd||ne!==Br&&ne!==yo&&(ne===Mt?a===!1?e.has("EXT_sRGB")===!0&&we===Bi?(j.format=Dd,j.minFilter=fn,j.generateMipmaps=!1):H=ry.sRGBToLinear(H):(we!==Bi||be!==os)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",ne)),H}this.allocateTextureUnit=k,this.resetTextureUnits=O,this.setTexture2D=B,this.setTexture2DArray=D,this.setTexture3D=V,this.setTextureCube=Z,this.rebindTextures=se,this.setupRenderTarget=$,this.updateRenderTargetMipmap=Ie,this.updateMultisampleRenderTarget=de,this.setupDepthRenderbuffer=te,this.setupFrameBufferTexture=ae,this.useMultisampledRTT=Le}function gM(r,e,t){const n=t.isWebGL2;function i(s,o=yo){let a;if(s===os)return r.UNSIGNED_BYTE;if(s===qv)return r.UNSIGNED_SHORT_4_4_4_4;if(s===Zv)return r.UNSIGNED_SHORT_5_5_5_1;if(s===Nb)return r.BYTE;if(s===Fb)return r.SHORT;if(s===Kd)return r.UNSIGNED_SHORT;if(s===Yv)return r.INT;if(s===Ns)return r.UNSIGNED_INT;if(s===rs)return r.FLOAT;if(s===Vl)return n?r.HALF_FLOAT:(a=e.get("OES_texture_half_float"),a!==null?a.HALF_FLOAT_OES:null);if(s===kb)return r.ALPHA;if(s===Bi)return r.RGBA;if(s===zb)return r.LUMINANCE;if(s===Bb)return r.LUMINANCE_ALPHA;if(s===go)return r.DEPTH_COMPONENT;if(s===xa)return r.DEPTH_STENCIL;if(s===Dd)return a=e.get("EXT_sRGB"),a!==null?a.SRGB_ALPHA_EXT:null;if(s===Gb)return r.RED;if(s===Kv)return r.RED_INTEGER;if(s===Hb)return r.RG;if(s===$v)return r.RG_INTEGER;if(s===Jv)return r.RGBA_INTEGER;if(s===vd||s===yd||s===_d||s===xd)if(o===Mt)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(s===vd)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(s===yd)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(s===_d)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(s===xd)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(s===vd)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(s===yd)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(s===_d)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(s===xd)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(s===F0||s===k0||s===z0||s===B0)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(s===F0)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(s===k0)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(s===z0)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(s===B0)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(s===Vb)return a=e.get("WEBGL_compressed_texture_etc1"),a!==null?a.COMPRESSED_RGB_ETC1_WEBGL:null;if(s===G0||s===H0)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(s===G0)return o===Mt?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(s===H0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(s===V0||s===W0||s===X0||s===j0||s===Y0||s===q0||s===Z0||s===K0||s===$0||s===J0||s===Q0||s===ev||s===tv||s===nv)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(s===V0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(s===W0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(s===X0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(s===j0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(s===Y0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(s===q0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(s===Z0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(s===K0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(s===$0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(s===J0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(s===Q0)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(s===ev)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(s===tv)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(s===nv)return o===Mt?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(s===wd)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(s===wd)return o===Mt?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT}else return null;if(s===Wb||s===iv||s===rv||s===sv)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(s===wd)return a.COMPRESSED_RED_RGTC1_EXT;if(s===iv)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(s===rv)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(s===sv)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return s===mo?n?r.UNSIGNED_INT_24_8:(a=e.get("WEBGL_depth_texture"),a!==null?a.UNSIGNED_INT_24_8_WEBGL:null):r[s]!==void 0?r[s]:null}return{convert:i}}class vM extends zn{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e}}class Ol extends jt{constructor(){super(),this.isGroup=!0,this.type="Group"}}const qD={type:"move"};class tg{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Ol,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Ol,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new Y,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new Y),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Ol,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new Y,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new Y),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let i=null,s=null,o=null;const a=this._targetRay,l=this._grip,c=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(c&&e.hand){o=!0;for(const _ of e.hand.values()){const y=t.getJointPose(_,n),g=this._getHandJoint(c,_);y!==null&&(g.matrix.fromArray(y.transform.matrix),g.matrix.decompose(g.position,g.rotation,g.scale),g.matrixWorldNeedsUpdate=!0,g.jointRadius=y.radius),g.visible=y!==null}const u=c.joints["index-finger-tip"],h=c.joints["thumb-tip"],p=u.position.distanceTo(h.position),m=.02,v=.005;c.inputState.pinching&&p>m+v?(c.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!c.inputState.pinching&&p<=m-v&&(c.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else l!==null&&e.gripSpace&&(s=t.getPose(e.gripSpace,n),s!==null&&(l.matrix.fromArray(s.transform.matrix),l.matrix.decompose(l.position,l.rotation,l.scale),l.matrixWorldNeedsUpdate=!0,s.linearVelocity?(l.hasLinearVelocity=!0,l.linearVelocity.copy(s.linearVelocity)):l.hasLinearVelocity=!1,s.angularVelocity?(l.hasAngularVelocity=!0,l.angularVelocity.copy(s.angularVelocity)):l.hasAngularVelocity=!1));a!==null&&(i=t.getPose(e.targetRaySpace,n),i===null&&s!==null&&(i=s),i!==null&&(a.matrix.fromArray(i.transform.matrix),a.matrix.decompose(a.position,a.rotation,a.scale),a.matrixWorldNeedsUpdate=!0,i.linearVelocity?(a.hasLinearVelocity=!0,a.linearVelocity.copy(i.linearVelocity)):a.hasLinearVelocity=!1,i.angularVelocity?(a.hasAngularVelocity=!0,a.angularVelocity.copy(i.angularVelocity)):a.hasAngularVelocity=!1,this.dispatchEvent(qD)))}return a!==null&&(a.visible=i!==null),l!==null&&(l.visible=s!==null),c!==null&&(c.visible=o!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Ol;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class yM extends Sn{constructor(e,t,n,i,s,o,a,l,c,u){if(u=u!==void 0?u:go,u!==go&&u!==xa)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");n===void 0&&u===go&&(n=Ns),n===void 0&&u===xa&&(n=mo),super(null,i,s,o,a,l,u,n,c),this.isDepthTexture=!0,this.image={width:e,height:t},this.magFilter=a!==void 0?a:Dn,this.minFilter=l!==void 0?l:Dn,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class ZD extends Hs{constructor(e,t){super();const n=this;let i=null,s=1,o=null,a="local-floor",l=1,c=null,u=null,h=null,p=null,m=null,v=null;const _=t.getContextAttributes();let y=null,g=null;const x=[],w=[],E=new zn;E.layers.enable(1),E.viewport=new Xt;const b=new zn;b.layers.enable(2),b.viewport=new Xt;const M=[E,b],A=new vM;A.layers.enable(1),A.layers.enable(2);let P=null,C=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(D){let V=x[D];return V===void 0&&(V=new tg,x[D]=V),V.getTargetRaySpace()},this.getControllerGrip=function(D){let V=x[D];return V===void 0&&(V=new tg,x[D]=V),V.getGripSpace()},this.getHand=function(D){let V=x[D];return V===void 0&&(V=new tg,x[D]=V),V.getHandSpace()};function L(D){const V=w.indexOf(D.inputSource);if(V===-1)return;const Z=x[V];Z!==void 0&&(Z.update(D.inputSource,D.frame,c||o),Z.dispatchEvent({type:D.type,data:D.inputSource}))}function F(){i.removeEventListener("select",L),i.removeEventListener("selectstart",L),i.removeEventListener("selectend",L),i.removeEventListener("squeeze",L),i.removeEventListener("squeezestart",L),i.removeEventListener("squeezeend",L),i.removeEventListener("end",F),i.removeEventListener("inputsourceschange",N);for(let D=0;D=0&&(w[ee]=null,x[ee].disconnect(Z))}for(let V=0;V=w.length){w.push(Z),ee=ue;break}else if(w[ue]===null){w[ue]=Z,ee=ue;break}if(ee===-1)break}const ie=x[ee];ie&&ie.connect(Z)}}const I=new Y,X=new Y;function q(D,V,Z){I.setFromMatrixPosition(V.matrixWorld),X.setFromMatrixPosition(Z.matrixWorld);const ee=I.distanceTo(X),ie=V.projectionMatrix.elements,ue=Z.projectionMatrix.elements,ce=ie[14]/(ie[10]-1),le=ie[14]/(ie[10]+1),Ae=(ie[9]+1)/ie[5],Ee=(ie[9]-1)/ie[5],ae=(ie[8]-1)/ie[0],z=(ue[8]+1)/ue[0],oe=ce*ae,te=ce*z,se=ee/(-ae+z),$=se*-ae;V.matrixWorld.decompose(D.position,D.quaternion,D.scale),D.translateX($),D.translateZ(se),D.matrixWorld.compose(D.position,D.quaternion,D.scale),D.matrixWorldInverse.copy(D.matrixWorld).invert();const Ie=ce+se,de=le+se,Se=oe-$,Le=te+(ee-$),ge=Ae*le/de*Ie,He=Ee*le/de*Ie;D.projectionMatrix.makePerspective(Se,Le,ge,He,Ie,de),D.projectionMatrixInverse.copy(D.projectionMatrix).invert()}function W(D,V){V===null?D.matrixWorld.copy(D.matrix):D.matrixWorld.multiplyMatrices(V.matrixWorld,D.matrix),D.matrixWorldInverse.copy(D.matrixWorld).invert()}this.updateCamera=function(D){if(i===null)return;A.near=b.near=E.near=D.near,A.far=b.far=E.far=D.far,(P!==A.near||C!==A.far)&&(i.updateRenderState({depthNear:A.near,depthFar:A.far}),P=A.near,C=A.far);const V=D.parent,Z=A.cameras;W(A,V);for(let ee=0;ee0&&(y.alphaTest.value=g.alphaTest);const x=e.get(g).envMap;if(x&&(y.envMap.value=x,y.flipEnvMap.value=x.isCubeTexture&&x.isRenderTargetTexture===!1?-1:1,y.reflectivity.value=g.reflectivity,y.ior.value=g.ior,y.refractionRatio.value=g.refractionRatio),g.lightMap){y.lightMap.value=g.lightMap;const w=r.useLegacyLights===!0?Math.PI:1;y.lightMapIntensity.value=g.lightMapIntensity*w,t(g.lightMap,y.lightMapTransform)}g.aoMap&&(y.aoMap.value=g.aoMap,y.aoMapIntensity.value=g.aoMapIntensity,t(g.aoMap,y.aoMapTransform))}function o(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform))}function a(y,g){y.dashSize.value=g.dashSize,y.totalSize.value=g.dashSize+g.gapSize,y.scale.value=g.scale}function l(y,g,x,w){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.size.value=g.size*x,y.scale.value=w*.5,g.map&&(y.map.value=g.map,t(g.map,y.uvTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function c(y,g){y.diffuse.value.copy(g.color),y.opacity.value=g.opacity,y.rotation.value=g.rotation,g.map&&(y.map.value=g.map,t(g.map,y.mapTransform)),g.alphaMap&&(y.alphaMap.value=g.alphaMap,t(g.alphaMap,y.alphaMapTransform)),g.alphaTest>0&&(y.alphaTest.value=g.alphaTest)}function u(y,g){y.specular.value.copy(g.specular),y.shininess.value=Math.max(g.shininess,1e-4)}function h(y,g){g.gradientMap&&(y.gradientMap.value=g.gradientMap)}function p(y,g){y.metalness.value=g.metalness,g.metalnessMap&&(y.metalnessMap.value=g.metalnessMap,t(g.metalnessMap,y.metalnessMapTransform)),y.roughness.value=g.roughness,g.roughnessMap&&(y.roughnessMap.value=g.roughnessMap,t(g.roughnessMap,y.roughnessMapTransform)),e.get(g).envMap&&(y.envMapIntensity.value=g.envMapIntensity)}function m(y,g,x){y.ior.value=g.ior,g.sheen>0&&(y.sheenColor.value.copy(g.sheenColor).multiplyScalar(g.sheen),y.sheenRoughness.value=g.sheenRoughness,g.sheenColorMap&&(y.sheenColorMap.value=g.sheenColorMap,t(g.sheenColorMap,y.sheenColorMapTransform)),g.sheenRoughnessMap&&(y.sheenRoughnessMap.value=g.sheenRoughnessMap,t(g.sheenRoughnessMap,y.sheenRoughnessMapTransform))),g.clearcoat>0&&(y.clearcoat.value=g.clearcoat,y.clearcoatRoughness.value=g.clearcoatRoughness,g.clearcoatMap&&(y.clearcoatMap.value=g.clearcoatMap,t(g.clearcoatMap,y.clearcoatMapTransform)),g.clearcoatRoughnessMap&&(y.clearcoatRoughnessMap.value=g.clearcoatRoughnessMap,t(g.clearcoatRoughnessMap,y.clearcoatRoughnessMapTransform)),g.clearcoatNormalMap&&(y.clearcoatNormalMap.value=g.clearcoatNormalMap,t(g.clearcoatNormalMap,y.clearcoatNormalMapTransform),y.clearcoatNormalScale.value.copy(g.clearcoatNormalScale),g.side===yi&&y.clearcoatNormalScale.value.negate())),g.iridescence>0&&(y.iridescence.value=g.iridescence,y.iridescenceIOR.value=g.iridescenceIOR,y.iridescenceThicknessMinimum.value=g.iridescenceThicknessRange[0],y.iridescenceThicknessMaximum.value=g.iridescenceThicknessRange[1],g.iridescenceMap&&(y.iridescenceMap.value=g.iridescenceMap,t(g.iridescenceMap,y.iridescenceMapTransform)),g.iridescenceThicknessMap&&(y.iridescenceThicknessMap.value=g.iridescenceThicknessMap,t(g.iridescenceThicknessMap,y.iridescenceThicknessMapTransform))),g.transmission>0&&(y.transmission.value=g.transmission,y.transmissionSamplerMap.value=x.texture,y.transmissionSamplerSize.value.set(x.width,x.height),g.transmissionMap&&(y.transmissionMap.value=g.transmissionMap,t(g.transmissionMap,y.transmissionMapTransform)),y.thickness.value=g.thickness,g.thicknessMap&&(y.thicknessMap.value=g.thicknessMap,t(g.thicknessMap,y.thicknessMapTransform)),y.attenuationDistance.value=g.attenuationDistance,y.attenuationColor.value.copy(g.attenuationColor)),g.anisotropy>0&&(y.anisotropyVector.value.set(g.anisotropy*Math.cos(g.anisotropyRotation),g.anisotropy*Math.sin(g.anisotropyRotation)),g.anisotropyMap&&(y.anisotropyMap.value=g.anisotropyMap,t(g.anisotropyMap,y.anisotropyMapTransform))),y.specularIntensity.value=g.specularIntensity,y.specularColor.value.copy(g.specularColor),g.specularColorMap&&(y.specularColorMap.value=g.specularColorMap,t(g.specularColorMap,y.specularColorMapTransform)),g.specularIntensityMap&&(y.specularIntensityMap.value=g.specularIntensityMap,t(g.specularIntensityMap,y.specularIntensityMapTransform))}function v(y,g){g.matcap&&(y.matcap.value=g.matcap)}function _(y,g){const x=e.get(g).light;y.referencePosition.value.setFromMatrixPosition(x.matrixWorld),y.nearDistance.value=x.shadow.camera.near,y.farDistance.value=x.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:i}}function $D(r,e,t,n){let i={},s={},o=[];const a=t.isWebGL2?r.getParameter(r.MAX_UNIFORM_BUFFER_BINDINGS):0;function l(x,w){const E=w.program;n.uniformBlockBinding(x,E)}function c(x,w){let E=i[x.id];E===void 0&&(v(x),E=u(x),i[x.id]=E,x.addEventListener("dispose",y));const b=w.program;n.updateUBOMapping(x,b);const M=e.render.frame;s[x.id]!==M&&(p(x),s[x.id]=M)}function u(x){const w=h();x.__bindingPointIndex=w;const E=r.createBuffer(),b=x.__size,M=x.usage;return r.bindBuffer(r.UNIFORM_BUFFER,E),r.bufferData(r.UNIFORM_BUFFER,b,M),r.bindBuffer(r.UNIFORM_BUFFER,null),r.bindBufferBase(r.UNIFORM_BUFFER,w,E),E}function h(){for(let x=0;x0){M=E%b;const N=b-M;M!==0&&N-L.boundary<0&&(E+=b-M,C.__offset=E)}E+=L.storage}return M=E%b,M>0&&(E+=b-M),x.__size=E,x.__cache={},this}function _(x){const w={boundary:0,storage:0};return typeof x=="number"?(w.boundary=4,w.storage=4):x.isVector2?(w.boundary=8,w.storage=8):x.isVector3||x.isColor?(w.boundary=16,w.storage=12):x.isVector4?(w.boundary=16,w.storage=16):x.isMatrix3?(w.boundary=48,w.storage=48):x.isMatrix4?(w.boundary=64,w.storage=64):x.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",x),w}function y(x){const w=x.target;w.removeEventListener("dispose",y);const E=o.indexOf(w.__bindingPointIndex);o.splice(E,1),r.deleteBuffer(i[w.id]),delete i[w.id],delete s[w.id]}function g(){for(const x in i)r.deleteBuffer(i[x]);o=[],i={},s={}}return{bind:l,update:c,dispose:g}}function JD(){const r=Fu("canvas");return r.style.display="block",r}class uy{constructor(e={}){const{canvas:t=JD(),context:n=null,depth:i=!0,stencil:s=!0,alpha:o=!1,antialias:a=!1,premultipliedAlpha:l=!0,preserveDrawingBuffer:c=!1,powerPreference:u="default",failIfMajorPerformanceCaveat:h=!1}=e;this.isWebGLRenderer=!0;let p;n!==null?p=n.getContextAttributes().alpha:p=o;const m=new Uint32Array(4),v=new Int32Array(4);let _=null,y=null;const g=[],x=[];this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.outputColorSpace=Mt,this.useLegacyLights=!0,this.toneMapping=zr,this.toneMappingExposure=1;const w=this;let E=!1,b=0,M=0,A=null,P=-1,C=null;const L=new Xt,F=new Xt;let N=null;const I=new Ke(0);let X=0,q=t.width,W=t.height,O=1,k=null,G=null;const B=new Xt(0,0,q,W),D=new Xt(0,0,q,W);let V=!1;const Z=new oh;let ee=!1,ie=!1,ue=null;const ce=new yt,le=new De,Ae=new Y,Ee={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};function ae(){return A===null?O:1}let z=n;function oe(J,me){for(let Re=0;Re0?y=x[x.length-1]:y=null,g.pop(),g.length>0?_=g[g.length-1]:_=null};function li(J,me,Re,pe){if(J.visible===!1)return;if(J.layers.test(me.layers)){if(J.isGroup)Re=J.renderOrder;else if(J.isLOD)J.autoUpdate===!0&&J.update(me);else if(J.isLight)y.pushLight(J),J.castShadow&&y.pushShadow(J);else if(J.isSprite){if(!J.frustumCulled||Z.intersectsSprite(J)){pe&&Ae.setFromMatrixPosition(J.matrixWorld).applyMatrix4(ce);const lt=H.update(J),ct=J.material;ct.visible&&_.push(J,lt,ct,Re,Ae.z,null)}}else if((J.isMesh||J.isLine||J.isPoints)&&(!J.frustumCulled||Z.intersectsObject(J))){const lt=H.update(J),ct=J.material;if(pe&&(J.boundingSphere!==void 0?(J.boundingSphere===null&&J.computeBoundingSphere(),Ae.copy(J.boundingSphere.center)):(lt.boundingSphere===null&<.computeBoundingSphere(),Ae.copy(lt.boundingSphere.center)),Ae.applyMatrix4(J.matrixWorld).applyMatrix4(ce)),Array.isArray(ct)){const dt=lt.groups;for(let wt=0,ke=dt.length;wt0&&Bt(Pe,it,me,Re),pe&&$.viewport(L.copy(pe)),Pe.length>0&&sn(Pe,me,Re),it.length>0&&sn(it,me,Re),lt.length>0&&sn(lt,me,Re),$.buffers.depth.setTest(!0),$.buffers.depth.setMask(!0),$.buffers.color.setMask(!0),$.setPolygonOffset(!1)}function Bt(J,me,Re,pe){const Pe=se.isWebGL2;ue===null&&(ue=new Gr(1,1,{generateMipmaps:!0,type:te.has("EXT_color_buffer_half_float")?Vl:os,minFilter:So,samples:Pe?4:0})),w.getDrawingBufferSize(le),Pe?ue.setSize(le.x,le.y):ue.setSize(Ud(le.x),Ud(le.y));const it=w.getRenderTarget();w.setRenderTarget(ue),w.getClearColor(I),X=w.getClearAlpha(),X<1&&w.setClearColor(16777215,.5),w.clear();const lt=w.toneMapping;w.toneMapping=zr,sn(J,Re,pe),Se.updateMultisampleRenderTarget(ue),Se.updateRenderTargetMipmap(ue);let ct=!1;for(let dt=0,wt=me.length;dt0),ut=!!Re.morphAttributes.position,Jt=!!Re.morphAttributes.normal,Gt=!!Re.morphAttributes.color,Yn=pe.toneMapped?w.toneMapping:zr,ci=Re.morphAttributes.position||Re.morphAttributes.normal||Re.morphAttributes.color,qt=ci!==void 0?ci.length:0,mt=de.get(pe),kt=y.state.lights;if(ee===!0&&(ie===!0||J!==C)){const Un=J===C&&pe.id===P;Fe.setState(pe,J,Un)}let gt=!1;pe.version===mt.__version?(mt.needsLights&&mt.lightsStateVersion!==kt.state.version||mt.outputColorSpace!==ct||Pe.isInstancedMesh&&mt.instancing===!1||!Pe.isInstancedMesh&&mt.instancing===!0||Pe.isSkinnedMesh&&mt.skinning===!1||!Pe.isSkinnedMesh&&mt.skinning===!0||mt.envMap!==dt||pe.fog===!0&&mt.fog!==it||mt.numClippingPlanes!==void 0&&(mt.numClippingPlanes!==Fe.numPlanes||mt.numIntersection!==Fe.numIntersection)||mt.vertexAlphas!==wt||mt.vertexTangents!==ke||mt.morphTargets!==ut||mt.morphNormals!==Jt||mt.morphColors!==Gt||mt.toneMapping!==Yn||se.isWebGL2===!0&&mt.morphTargetsCount!==qt)&&(gt=!0):(gt=!0,mt.__version=pe.version);let Cn=mt.currentProgram;gt===!0&&(Cn=tn(pe,me,Pe));let En=!1,cn=!1,Ii=!1;const Qt=Cn.getUniforms(),on=mt.uniforms;if($.useProgram(Cn.program)&&(En=!0,cn=!0,Ii=!0),pe.id!==P&&(P=pe.id,cn=!0),En||C!==J){if(Qt.setValue(z,"projectionMatrix",J.projectionMatrix),se.logarithmicDepthBuffer&&Qt.setValue(z,"logDepthBufFC",2/(Math.log(J.far+1)/Math.LN2)),C!==J&&(C=J,cn=!0,Ii=!0),pe.isShaderMaterial||pe.isMeshPhongMaterial||pe.isMeshToonMaterial||pe.isMeshStandardMaterial||pe.envMap){const Un=Qt.map.cameraPosition;Un!==void 0&&Un.setValue(z,Ae.setFromMatrixPosition(J.matrixWorld))}(pe.isMeshPhongMaterial||pe.isMeshToonMaterial||pe.isMeshLambertMaterial||pe.isMeshBasicMaterial||pe.isMeshStandardMaterial||pe.isShaderMaterial)&&Qt.setValue(z,"isOrthographic",J.isOrthographicCamera===!0),(pe.isMeshPhongMaterial||pe.isMeshToonMaterial||pe.isMeshLambertMaterial||pe.isMeshBasicMaterial||pe.isMeshStandardMaterial||pe.isShaderMaterial||pe.isShadowMaterial||Pe.isSkinnedMesh)&&Qt.setValue(z,"viewMatrix",J.matrixWorldInverse)}if(Pe.isSkinnedMesh){Qt.setOptional(z,Pe,"bindMatrix"),Qt.setOptional(z,Pe,"bindMatrixInverse");const Un=Pe.skeleton;Un&&(se.floatVertexTextures?(Un.boneTexture===null&&Un.computeBoneTexture(),Qt.setValue(z,"boneTexture",Un.boneTexture,Se),Qt.setValue(z,"boneTextureSize",Un.boneTextureSize)):console.warn("THREE.WebGLRenderer: SkinnedMesh can only be used with WebGL 2. With WebGL 1 OES_texture_float and vertex textures support is required."))}const xi=Re.morphAttributes;if((xi.position!==void 0||xi.normal!==void 0||xi.color!==void 0&&se.isWebGL2===!0)&&Be.update(Pe,Re,Cn),(cn||mt.receiveShadow!==Pe.receiveShadow)&&(mt.receiveShadow=Pe.receiveShadow,Qt.setValue(z,"receiveShadow",Pe.receiveShadow)),pe.isMeshGouraudMaterial&&pe.envMap!==null&&(on.envMap.value=dt,on.flipEnvMap.value=dt.isCubeTexture&&dt.isRenderTargetTexture===!1?-1:1),cn&&(Qt.setValue(z,"toneMappingExposure",w.toneMappingExposure),mt.needsLights&&sr(on,Ii),it&&pe.fog===!0&&we.refreshFogUniforms(on,it),we.refreshMaterialUniforms(on,pe,O,W,ue),bd.upload(z,mt.uniformsList,on,Se)),pe.isShaderMaterial&&pe.uniformsNeedUpdate===!0&&(bd.upload(z,mt.uniformsList,on,Se),pe.uniformsNeedUpdate=!1),pe.isSpriteMaterial&&Qt.setValue(z,"center",Pe.center),Qt.setValue(z,"modelViewMatrix",Pe.modelViewMatrix),Qt.setValue(z,"normalMatrix",Pe.normalMatrix),Qt.setValue(z,"modelMatrix",Pe.matrixWorld),pe.isShaderMaterial||pe.isRawShaderMaterial){const Un=pe.uniformsGroups;for(let Xr=0,jr=Un.length;Xr0&&Se.useMultisampledRTT(J)===!1?Pe=de.get(J).__webglMultisampledFramebuffer:Pe=ke,L.copy(J.viewport),F.copy(J.scissor),N=J.scissorTest}else L.copy(B).multiplyScalar(O).floor(),F.copy(D).multiplyScalar(O).floor(),N=V;if($.bindFramebuffer(z.FRAMEBUFFER,Pe)&&se.drawBuffers&&pe&&$.drawBuffers(J,Pe),$.viewport(L),$.scissor(F),$.setScissorTest(N),it){const dt=de.get(J.texture);z.framebufferTexture2D(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,z.TEXTURE_CUBE_MAP_POSITIVE_X+me,dt.__webglTexture,Re)}else if(lt){const dt=de.get(J.texture),wt=me||0;z.framebufferTextureLayer(z.FRAMEBUFFER,z.COLOR_ATTACHMENT0,dt.__webglTexture,Re||0,wt)}P=-1},this.readRenderTargetPixels=function(J,me,Re,pe,Pe,it,lt){if(!(J&&J.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let ct=de.get(J).__webglFramebuffer;if(J.isWebGLCubeRenderTarget&<!==void 0&&(ct=ct[lt]),ct){$.bindFramebuffer(z.FRAMEBUFFER,ct);try{const dt=J.texture,wt=dt.format,ke=dt.type;if(wt!==Bi&&Oe.convert(wt)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_FORMAT)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}const ut=ke===Vl&&(te.has("EXT_color_buffer_half_float")||se.isWebGL2&&te.has("EXT_color_buffer_float"));if(ke!==os&&Oe.convert(ke)!==z.getParameter(z.IMPLEMENTATION_COLOR_READ_TYPE)&&!(ke===rs&&(se.isWebGL2||te.has("OES_texture_float")||te.has("WEBGL_color_buffer_float")))&&!ut){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}me>=0&&me<=J.width-pe&&Re>=0&&Re<=J.height-Pe&&z.readPixels(me,Re,pe,Pe,Oe.convert(wt),Oe.convert(ke),it)}finally{const dt=A!==null?de.get(A).__webglFramebuffer:null;$.bindFramebuffer(z.FRAMEBUFFER,dt)}}},this.copyFramebufferToTexture=function(J,me,Re=0){const pe=Math.pow(2,-Re),Pe=Math.floor(me.image.width*pe),it=Math.floor(me.image.height*pe);Se.setTexture2D(me,0),z.copyTexSubImage2D(z.TEXTURE_2D,Re,0,0,J.x,J.y,Pe,it),$.unbindTexture()},this.copyTextureToTexture=function(J,me,Re,pe=0){const Pe=me.image.width,it=me.image.height,lt=Oe.convert(Re.format),ct=Oe.convert(Re.type);Se.setTexture2D(Re,0),z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,Re.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Re.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,Re.unpackAlignment),me.isDataTexture?z.texSubImage2D(z.TEXTURE_2D,pe,J.x,J.y,Pe,it,lt,ct,me.image.data):me.isCompressedTexture?z.compressedTexSubImage2D(z.TEXTURE_2D,pe,J.x,J.y,me.mipmaps[0].width,me.mipmaps[0].height,lt,me.mipmaps[0].data):z.texSubImage2D(z.TEXTURE_2D,pe,J.x,J.y,lt,ct,me.image),pe===0&&Re.generateMipmaps&&z.generateMipmap(z.TEXTURE_2D),$.unbindTexture()},this.copyTextureToTexture3D=function(J,me,Re,pe,Pe=0){if(w.isWebGL1Renderer){console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: can only be used with WebGL2.");return}const it=J.max.x-J.min.x+1,lt=J.max.y-J.min.y+1,ct=J.max.z-J.min.z+1,dt=Oe.convert(pe.format),wt=Oe.convert(pe.type);let ke;if(pe.isData3DTexture)Se.setTexture3D(pe,0),ke=z.TEXTURE_3D;else if(pe.isDataArrayTexture)Se.setTexture2DArray(pe,0),ke=z.TEXTURE_2D_ARRAY;else{console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: only supports THREE.DataTexture3D and THREE.DataTexture2DArray.");return}z.pixelStorei(z.UNPACK_FLIP_Y_WEBGL,pe.flipY),z.pixelStorei(z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,pe.premultiplyAlpha),z.pixelStorei(z.UNPACK_ALIGNMENT,pe.unpackAlignment);const ut=z.getParameter(z.UNPACK_ROW_LENGTH),Jt=z.getParameter(z.UNPACK_IMAGE_HEIGHT),Gt=z.getParameter(z.UNPACK_SKIP_PIXELS),Yn=z.getParameter(z.UNPACK_SKIP_ROWS),ci=z.getParameter(z.UNPACK_SKIP_IMAGES),qt=Re.isCompressedTexture?Re.mipmaps[0]:Re.image;z.pixelStorei(z.UNPACK_ROW_LENGTH,qt.width),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,qt.height),z.pixelStorei(z.UNPACK_SKIP_PIXELS,J.min.x),z.pixelStorei(z.UNPACK_SKIP_ROWS,J.min.y),z.pixelStorei(z.UNPACK_SKIP_IMAGES,J.min.z),Re.isDataTexture||Re.isData3DTexture?z.texSubImage3D(ke,Pe,me.x,me.y,me.z,it,lt,ct,dt,wt,qt.data):Re.isCompressedArrayTexture?(console.warn("THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture."),z.compressedTexSubImage3D(ke,Pe,me.x,me.y,me.z,it,lt,ct,dt,qt.data)):z.texSubImage3D(ke,Pe,me.x,me.y,me.z,it,lt,ct,dt,wt,qt),z.pixelStorei(z.UNPACK_ROW_LENGTH,ut),z.pixelStorei(z.UNPACK_IMAGE_HEIGHT,Jt),z.pixelStorei(z.UNPACK_SKIP_PIXELS,Gt),z.pixelStorei(z.UNPACK_SKIP_ROWS,Yn),z.pixelStorei(z.UNPACK_SKIP_IMAGES,ci),Pe===0&&pe.generateMipmaps&&z.generateMipmap(ke),$.unbindTexture()},this.initTexture=function(J){J.isCubeTexture?Se.setTextureCube(J,0):J.isData3DTexture?Se.setTexture3D(J,0):J.isDataArrayTexture||J.isCompressedArrayTexture?Se.setTexture2DArray(J,0):Se.setTexture2D(J,0),$.unbindTexture()},this.resetState=function(){b=0,M=0,A=null,$.reset(),We.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ss}get physicallyCorrectLights(){return console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),!this.useLegacyLights}set physicallyCorrectLights(e){console.warn("THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead."),this.useLegacyLights=!e}get outputEncoding(){return console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace===Mt?vo:ey}set outputEncoding(e){console.warn("THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead."),this.outputColorSpace=e===vo?Mt:Br}}class _M extends uy{}_M.prototype.isWebGL1Renderer=!0;class np{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Ke(e),this.density=t}clone(){return new np(this.color,this.density)}toJSON(){return{type:"FogExp2",color:this.color.getHex(),density:this.density}}}class ip{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Ke(e),this.near=t,this.far=n}clone(){return new ip(this.color,this.near,this.far)}toJSON(){return{type:"Fog",color:this.color.getHex(),near:this.near,far:this.far}}}class ku extends jt{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t}}class rp{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=Ou,this.updateRange={offset:0,count:-1},this.version=0,this.uuid=er()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let i=0,s=this.stride;ie.far||t.push({distance:l,point:Dc.clone(),uv:zi.getInterpolation(Dc,Lf,Oc,If,A1,ng,C1,new De),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Df(r,e,t,n,i,s){ml.subVectors(r,t).addScalar(.5).multiply(n),i!==void 0?(Uc.x=s*ml.x-i*ml.y,Uc.y=i*ml.x+s*ml.y):Uc.copy(ml),r.copy(e),r.x+=Uc.x,r.y+=Uc.y,r.applyMatrix4(xM)}const Uf=new Y,R1=new Y;class SM extends jt{constructor(){super(),this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]},isLOD:{value:!0}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,i=t.length;n0){let n,i;for(n=1,i=t.length;n0){Uf.setFromMatrixPosition(this.matrixWorld);const i=e.ray.origin.distanceTo(Uf);this.getObjectForDistance(i).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Uf.setFromMatrixPosition(e.matrixWorld),R1.setFromMatrixPosition(this.matrixWorld);const n=Uf.distanceTo(R1)/e.zoom;t[0].object.visible=!0;let i,s;for(i=1,s=t.length;i=o)t[i-1].object.visible=!1,t[i].object.visible=!0;else break}for(this._currentLevel=i-1;il)continue;p.applyMatrix4(this.matrixWorld);const P=e.ray.origin.distanceTo(p);Pe.far||t.push({distance:P,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}else{const g=Math.max(0,o.start),x=Math.min(y.count,o.start+o.count);for(let w=g,E=x-1;wl)continue;p.applyMatrix4(this.matrixWorld);const M=e.ray.origin.distanceTo(p);Me.far||t.push({distance:M,point:h.clone().applyMatrix4(this.matrixWorld),index:w,face:null,faceIndex:null,object:this})}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;s0){const i=t[n[0]];if(i!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,o=i.length;si.far)return;s.push({distance:c,distanceToRay:Math.sqrt(a),point:l,index:e,face:null,object:o})}}class nU extends Sn{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c),this.isVideoTexture=!0,this.minFilter=o!==void 0?o:fn,this.magFilter=s!==void 0?s:fn,this.generateMipmaps=!1;const u=this;function h(){u.needsUpdate=!0,e.requestVideoFrameCallback(h)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(h)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class iU extends Sn{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Dn,this.minFilter=Dn,this.generateMipmaps=!1,this.needsUpdate=!0}}class py extends Sn{constructor(e,t,n,i,s,o,a,l,c,u,h,p){super(null,o,a,l,c,u,i,s,h,p),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class rU extends py{constructor(e,t,n,i,s,o){super(e,t,n,s,o),this.isCompressedArrayTexture=!0,this.image.depth=i,this.wrapR=vi}}class sU extends Sn{constructor(e,t,n,i,s,o,a,l,c){super(e,t,n,i,s,o,a,l,c),this.isCanvasTexture=!0,this.needsUpdate=!0}}class Vr{constructor(){this.type="Curve",this.arcLengthDivisions=200}getPoint(){return console.warn("THREE.Curve: .getPoint() not implemented."),null}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,i=this.getPoint(0),s=0;t.push(0);for(let o=1;o<=e;o++)n=this.getPoint(o/e),s+=n.distanceTo(i),t.push(s),i=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t){const n=this.getLengths();let i=0;const s=n.length;let o;t?o=t:o=e*n[s-1];let a=0,l=s-1,c;for(;a<=l;)if(i=Math.floor(a+(l-a)/2),c=n[i]-o,c<0)a=i+1;else if(c>0)l=i-1;else{l=i;break}if(i=l,n[i]===o)return i/(s-1);const u=n[i],p=n[i+1]-u,m=(o-u)/p;return(i+m)/(s-1)}getTangent(e,t){let i=e-1e-4,s=e+1e-4;i<0&&(i=0),s>1&&(s=1);const o=this.getPoint(i),a=this.getPoint(s),l=t||(o.isVector2?new De:new Y);return l.copy(a).sub(o).normalize(),l}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t){const n=new Y,i=[],s=[],o=[],a=new Y,l=new yt;for(let m=0;m<=e;m++){const v=m/e;i[m]=this.getTangentAt(v,new Y)}s[0]=new Y,o[0]=new Y;let c=Number.MAX_VALUE;const u=Math.abs(i[0].x),h=Math.abs(i[0].y),p=Math.abs(i[0].z);u<=c&&(c=u,n.set(1,0,0)),h<=c&&(c=h,n.set(0,1,0)),p<=c&&n.set(0,0,1),a.crossVectors(i[0],n).normalize(),s[0].crossVectors(i[0],a),o[0].crossVectors(i[0],s[0]);for(let m=1;m<=e;m++){if(s[m]=s[m-1].clone(),o[m]=o[m-1].clone(),a.crossVectors(i[m-1],i[m]),a.length()>Number.EPSILON){a.normalize();const v=Math.acos(Tn(i[m-1].dot(i[m]),-1,1));s[m].applyMatrix4(l.makeRotationAxis(a,v))}o[m].crossVectors(i[m],s[m])}if(t===!0){let m=Math.acos(Tn(s[0].dot(s[e]),-1,1));m/=e,i[0].dot(a.crossVectors(s[0],s[e]))>0&&(m=-m);for(let v=1;v<=e;v++)s[v].applyMatrix4(l.makeRotationAxis(i[v],m*v)),o[v].crossVectors(i[v],s[v])}return{tangents:i,normals:s,binormals:o}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class op extends Vr{constructor(e=0,t=0,n=1,i=1,s=0,o=Math.PI*2,a=!1,l=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=i,this.aStartAngle=s,this.aEndAngle=o,this.aClockwise=a,this.aRotation=l}getPoint(e,t){const n=t||new De,i=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const o=Math.abs(s)i;)s-=i;s0?0:(Math.floor(Math.abs(a)/s)+1)*s:l===0&&a===s-1&&(a=s-2,l=1);let c,u;this.closed||a>0?c=i[(a-1)%s]:(zf.subVectors(i[0],i[1]).add(i[0]),c=zf);const h=i[a%s],p=i[(a+1)%s];if(this.closed||a+2i.length-2?i.length-1:o+1],h=i[o>i.length-3?i.length-1:o+2];return n.set(X1(a,l.x,c.x,u.x,h.x),X1(a,l.y,c.y,u.y,h.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t=n){const o=i[s]-n,a=this.curves[s],l=a.getLength(),c=l===0?0:1-o/l;return a.getPointAt(c,t)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,i=this.curves.length;n1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t0){const h=c.getPoint(0);h.equals(this.currentPoint)||this.lineTo(h.x,h.y)}this.curves.push(c);const u=c.getPoint(1);return this.currentPoint.copy(u),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class ah extends Tt{constructor(e=[new De(0,-.5),new De(.5,0),new De(0,.5)],t=12,n=0,i=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:i},t=Math.floor(t),i=Tn(i,0,Math.PI*2);const s=[],o=[],a=[],l=[],c=[],u=1/t,h=new Y,p=new De,m=new Y,v=new Y,_=new Y;let y=0,g=0;for(let x=0;x<=e.length-1;x++)switch(x){case 0:y=e[x+1].x-e[x].x,g=e[x+1].y-e[x].y,m.x=g*1,m.y=-y,m.z=g*0,_.copy(m),m.normalize(),l.push(m.x,m.y,m.z);break;case e.length-1:l.push(_.x,_.y,_.z);break;default:y=e[x+1].x-e[x].x,g=e[x+1].y-e[x].y,m.x=g*1,m.y=-y,m.z=g*0,v.copy(m),m.x+=_.x,m.y+=_.y,m.z+=_.z,m.normalize(),l.push(m.x,m.y,m.z),_.copy(v)}for(let x=0;x<=t;x++){const w=n+x*u*i,E=Math.sin(w),b=Math.cos(w);for(let M=0;M<=e.length-1;M++){h.x=e[M].x*E,h.y=e[M].y,h.z=e[M].x*b,o.push(h.x,h.y,h.z),p.x=x/t,p.y=M/(e.length-1),a.push(p.x,p.y);const A=l[3*M+0]*E,P=l[3*M+1],C=l[3*M+0]*b;c.push(A,P,C)}}for(let x=0;x0&&w(!0),t>0&&w(!1)),this.setIndex(u),this.setAttribute("position",new st(h,3)),this.setAttribute("normal",new st(p,3)),this.setAttribute("uv",new st(m,2));function x(){const E=new Y,b=new Y;let M=0;const A=(t-e)/n;for(let P=0;P<=s;P++){const C=[],L=P/s,F=L*(t-e)+e;for(let N=0;N<=i;N++){const I=N/i,X=I*l+a,q=Math.sin(X),W=Math.cos(X);b.x=F*q,b.y=-L*n+y,b.z=F*W,h.push(b.x,b.y,b.z),E.set(q,A,W).normalize(),p.push(E.x,E.y,E.z),m.push(I,1-L),C.push(v++)}_.push(C)}for(let P=0;P.9&&A<.1&&(w<.2&&(o[x+0]+=1),E<.2&&(o[x+2]+=1),b<.2&&(o[x+4]+=1))}}function p(x){s.push(x.x,x.y,x.z)}function m(x,w){const E=x*3;w.x=e[E+0],w.y=e[E+1],w.z=e[E+2]}function v(){const x=new Y,w=new Y,E=new Y,b=new Y,M=new De,A=new De,P=new De;for(let C=0,L=0;C80*t){a=c=r[0],l=u=r[1];for(let v=t;vc&&(c=h),p>u&&(u=p);m=Math.max(c-a,u-l),m=m!==0?32767/m:0}return Bu(s,o,t,a,l,m,0),o}};function IM(r,e,t,n,i){let s,o;if(i===RU(r,e,t,n)>0)for(s=e;s=e;s-=n)o=j1(s,r[s],r[s+1],o);return o&&dp(o,o.next)&&(Hu(o),o=o.next),o}function Ea(r,e){if(!r)return r;e||(e=r);let t=r,n;do if(n=!1,!t.steiner&&(dp(t,t.next)||yn(t.prev,t,t.next)===0)){if(Hu(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Bu(r,e,t,n,i,s,o){if(!r)return;!o&&s&&EU(r,n,i,s);let a=r,l,c;for(;r.prev!==r.next;){if(l=r.prev,c=r.next,s?mU(r,n,i,s):pU(r)){e.push(l.i/t|0),e.push(r.i/t|0),e.push(c.i/t|0),Hu(r),r=c.next,a=c.next;continue}if(r=c,r===a){o?o===1?(r=gU(Ea(r),e,t),Bu(r,e,t,n,i,s,2)):o===2&&vU(r,e,t,n,i,s):Bu(Ea(r),e,t,n,i,s,1);break}}}function pU(r){const e=r.prev,t=r,n=r.next;if(yn(e,t,n)>=0)return!1;const i=e.x,s=t.x,o=n.x,a=e.y,l=t.y,c=n.y,u=is?i>o?i:o:s>o?s:o,m=a>l?a>c?a:c:l>c?l:c;let v=n.next;for(;v!==e;){if(v.x>=u&&v.x<=p&&v.y>=h&&v.y<=m&&Nl(i,a,s,l,o,c,v.x,v.y)&&yn(v.prev,v,v.next)>=0)return!1;v=v.next}return!0}function mU(r,e,t,n){const i=r.prev,s=r,o=r.next;if(yn(i,s,o)>=0)return!1;const a=i.x,l=s.x,c=o.x,u=i.y,h=s.y,p=o.y,m=al?a>c?a:c:l>c?l:c,y=u>h?u>p?u:p:h>p?h:p,g=hv(m,v,e,t,n),x=hv(_,y,e,t,n);let w=r.prevZ,E=r.nextZ;for(;w&&w.z>=g&&E&&E.z<=x;){if(w.x>=m&&w.x<=_&&w.y>=v&&w.y<=y&&w!==i&&w!==o&&Nl(a,u,l,h,c,p,w.x,w.y)&&yn(w.prev,w,w.next)>=0||(w=w.prevZ,E.x>=m&&E.x<=_&&E.y>=v&&E.y<=y&&E!==i&&E!==o&&Nl(a,u,l,h,c,p,E.x,E.y)&&yn(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;w&&w.z>=g;){if(w.x>=m&&w.x<=_&&w.y>=v&&w.y<=y&&w!==i&&w!==o&&Nl(a,u,l,h,c,p,w.x,w.y)&&yn(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;E&&E.z<=x;){if(E.x>=m&&E.x<=_&&E.y>=v&&E.y<=y&&E!==i&&E!==o&&Nl(a,u,l,h,c,p,E.x,E.y)&&yn(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function gU(r,e,t){let n=r;do{const i=n.prev,s=n.next.next;!dp(i,s)&&DM(i,n,n.next,s)&&Gu(i,s)&&Gu(s,i)&&(e.push(i.i/t|0),e.push(n.i/t|0),e.push(s.i/t|0),Hu(n),Hu(n.next),n=r=s),n=n.next}while(n!==r);return Ea(n)}function vU(r,e,t,n,i,s){let o=r;do{let a=o.next.next;for(;a!==o.prev;){if(o.i!==a.i&&TU(o,a)){let l=UM(o,a);o=Ea(o,o.next),l=Ea(l,l.next),Bu(o,e,t,n,i,s,0),Bu(l,e,t,n,i,s,0);return}a=a.next}o=o.next}while(o!==r)}function yU(r,e,t,n){const i=[];let s,o,a,l,c;for(s=0,o=e.length;s=t.next.y&&t.next.y!==t.y){const p=t.x+(o-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(p<=s&&p>n&&(n=p,i=t.x=t.x&&t.x>=l&&s!==t.x&&Nl(oi.x||t.x===i.x&&SU(i,t)))&&(i=t,u=h)),t=t.next;while(t!==a);return i}function SU(r,e){return yn(r.prev,r,e.prev)<0&&yn(e.next,r,r.next)<0}function EU(r,e,t,n){let i=r;do i.z===0&&(i.z=hv(i.x,i.y,e,t,n)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next;while(i!==r);i.prevZ.nextZ=null,i.prevZ=null,bU(i)}function bU(r){let e,t,n,i,s,o,a,l,c=1;do{for(t=r,r=null,s=null,o=0;t;){for(o++,n=t,a=0,e=0;e0||l>0&&n;)a!==0&&(l===0||!n||t.z<=n.z)?(i=t,t=t.nextZ,a--):(i=n,n=n.nextZ,l--),s?s.nextZ=i:r=i,i.prevZ=s,s=i;t=n}s.nextZ=null,c*=2}while(o>1);return r}function hv(r,e,t,n,i){return r=(r-t)*i|0,e=(e-n)*i|0,r=(r|r<<8)&16711935,r=(r|r<<4)&252645135,r=(r|r<<2)&858993459,r=(r|r<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,r|e<<1}function MU(r){let e=r,t=r;do(e.x=(r-o)*(s-a)&&(r-o)*(n-a)>=(t-o)*(e-a)&&(t-o)*(s-a)>=(i-o)*(n-a)}function TU(r,e){return r.next.i!==e.i&&r.prev.i!==e.i&&!AU(r,e)&&(Gu(r,e)&&Gu(e,r)&&CU(r,e)&&(yn(r.prev,r,e.prev)||yn(r,e.prev,e))||dp(r,e)&&yn(r.prev,r,r.next)>0&&yn(e.prev,e,e.next)>0)}function yn(r,e,t){return(e.y-r.y)*(t.x-e.x)-(e.x-r.x)*(t.y-e.y)}function dp(r,e){return r.x===e.x&&r.y===e.y}function DM(r,e,t,n){const i=Wf(yn(r,e,t)),s=Wf(yn(r,e,n)),o=Wf(yn(t,n,r)),a=Wf(yn(t,n,e));return!!(i!==s&&o!==a||i===0&&Vf(r,t,e)||s===0&&Vf(r,n,e)||o===0&&Vf(t,r,n)||a===0&&Vf(t,e,n))}function Vf(r,e,t){return e.x<=Math.max(r.x,t.x)&&e.x>=Math.min(r.x,t.x)&&e.y<=Math.max(r.y,t.y)&&e.y>=Math.min(r.y,t.y)}function Wf(r){return r>0?1:r<0?-1:0}function AU(r,e){let t=r;do{if(t.i!==r.i&&t.next.i!==r.i&&t.i!==e.i&&t.next.i!==e.i&&DM(t,t.next,r,e))return!0;t=t.next}while(t!==r);return!1}function Gu(r,e){return yn(r.prev,r,r.next)<0?yn(r,e,r.next)>=0&&yn(r,r.prev,e)>=0:yn(r,e,r.prev)<0||yn(r,r.next,e)<0}function CU(r,e){let t=r,n=!1;const i=(r.x+e.x)/2,s=(r.y+e.y)/2;do t.y>s!=t.next.y>s&&t.next.y!==t.y&&i<(t.next.x-t.x)*(s-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==r);return n}function UM(r,e){const t=new fv(r.i,r.x,r.y),n=new fv(e.i,e.x,e.y),i=r.next,s=e.prev;return r.next=e,e.prev=r,t.next=i,i.prev=t,n.next=t,t.prev=n,s.next=n,n.prev=s,n}function j1(r,e,t,n){const i=new fv(r,e,t);return n?(i.next=n.next,i.prev=n,n.next.prev=i,n.next=i):(i.prev=i,i.next=i),i}function Hu(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function fv(r,e,t){this.i=r,this.x=e,this.y=t,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function RU(r,e,t,n){let i=0;for(let s=e,o=t-n;s2&&r[e-1].equals(r[0])&&r.pop()}function q1(r,e){for(let t=0;tNumber.EPSILON){const H=Math.sqrt(He),ne=Math.sqrt(Le*Le+ge*ge),we=oe.x-Se/H,be=oe.y+de/H,Me=te.x-ge/ne,Fe=te.y+Le/ne,Ue=((Me-we)*ge-(Fe-be)*Le)/(de*ge-Se*Le);se=we+de*Ue-z.x,$=be+Se*Ue-z.y;const xe=se*se+$*$;if(xe<=2)return new De(se,$);Ie=Math.sqrt(xe/2)}else{let H=!1;de>Number.EPSILON?Le>Number.EPSILON&&(H=!0):de<-Number.EPSILON?Le<-Number.EPSILON&&(H=!0):Math.sign(Se)===Math.sign(ge)&&(H=!0),H?(se=-Se,$=de,Ie=Math.sqrt(He)):(se=de,$=Se,Ie=Math.sqrt(He/2))}return new De(se/Ie,$/Ie)}const G=[];for(let z=0,oe=X.length,te=oe-1,se=z+1;z=0;z--){const oe=z/y,te=m*Math.cos(oe*Math.PI/2),se=v*Math.sin(oe*Math.PI/2)+_;for(let $=0,Ie=X.length;$=0;){const se=te;let $=te-1;$<0&&($=z.length-1);for(let Ie=0,de=u+y*2;Ie0)&&m.push(w,E,M),(g!==n-1||l0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class zM extends oi{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Ke(16777215),this.specular=new Ke(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mo,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ih,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class BM extends oi{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Ke(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mo,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class GM extends oi{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mo,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class HM extends oi{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Ke(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Ke(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mo,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.combine=ih,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class VM extends oi{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Ke(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=Mo,this.normalScale=new De(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class WM extends Pi{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function yr(r,e,t){return Sy(r)?new r.constructor(r.subarray(e,t!==void 0?t:r.length)):r.slice(e,t)}function da(r,e,t){return!r||!t&&r.constructor===e?r:typeof e.BYTES_PER_ELEMENT=="number"?new e(r):Array.prototype.slice.call(r)}function Sy(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}function XM(r){function e(i,s){return r[i]-r[s]}const t=r.length,n=new Array(t);for(let i=0;i!==t;++i)n[i]=i;return n.sort(e),n}function dv(r,e,t){const n=r.length,i=new r.constructor(n);for(let s=0,o=0;o!==n;++s){const a=t[s]*e;for(let l=0;l!==e;++l)i[o++]=r[a+l]}return i}function Ey(r,e,t,n){let i=1,s=r[0];for(;s!==void 0&&s[n]===void 0;)s=r[i++];if(s===void 0)return;let o=s[n];if(o!==void 0)if(Array.isArray(o))do o=s[n],o!==void 0&&(e.push(s.time),t.push.apply(t,o)),s=r[i++];while(s!==void 0);else if(o.toArray!==void 0)do o=s[n],o!==void 0&&(e.push(s.time),o.toArray(t,t.length)),s=r[i++];while(s!==void 0);else do o=s[n],o!==void 0&&(e.push(s.time),t.push(o)),s=r[i++];while(s!==void 0)}function DU(r,e,t,n,i=30){const s=r.clone();s.name=e;const o=[];for(let l=0;l=n)){h.push(c.times[m]);for(let _=0;_s.tracks[l].times[0]&&(a=s.tracks[l].times[0]);for(let l=0;l=a.times[v]){const g=v*h+u,x=g+h-u;_=yr(a.values,g,x)}else{const g=a.createInterpolant(),x=u,w=h-u;g.evaluate(s),_=yr(g.resultBuffer,x,w)}l==="quaternion"&&new si().fromArray(_).normalize().conjugate().toArray(_);const y=c.times.length;for(let g=0;g=s)){const a=t[1];e=s)break t}o=n,n=0;break n}break e}for(;n>>1;et;)--o;if(++o,s!==0||o!==i){s>=o&&(o=Math.max(o,1),s=o-1);const a=this.getValueSize();this.times=yr(n,s,o),this.values=yr(this.values,s*a,o*a)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,i=this.values,s=n.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let o=null;for(let a=0;a!==s;a++){const l=n[a];if(typeof l=="number"&&isNaN(l)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,a,l),e=!1;break}if(o!==null&&o>l){console.error("THREE.KeyframeTrack: Out of order keys.",this,a,l,o),e=!1;break}o=l}if(i!==void 0&&Sy(i))for(let a=0,l=i.length;a!==l;++a){const c=i[a];if(isNaN(c)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,a,c),e=!1;break}}return e}optimize(){const e=yr(this.times),t=yr(this.values),n=this.getValueSize(),i=this.getInterpolation()===Sd,s=e.length-1;let o=1;for(let a=1;a0){e[o]=e[s];for(let a=s*n,l=o*n,c=0;c!==n;++c)t[l+c]=t[a+c];++o}return o!==e.length?(this.times=yr(e,0,o),this.values=yr(t,0,o*n)):(this.times=e,this.values=t),this}clone(){const e=yr(this.times,0),t=yr(this.values,0),n=this.constructor,i=new n(this.name,e,t);return i.createInterpolant=this.createInterpolant,i}}Wr.prototype.TimeBufferType=Float32Array;Wr.prototype.ValueBufferType=Float32Array;Wr.prototype.DefaultInterpolation=Du;class Ia extends Wr{}Ia.prototype.ValueTypeName="bool";Ia.prototype.ValueBufferType=Array;Ia.prototype.DefaultInterpolation=Iu;Ia.prototype.InterpolantFactoryMethodLinear=void 0;Ia.prototype.InterpolantFactoryMethodSmooth=void 0;class My extends Wr{}My.prototype.ValueTypeName="color";class Vu extends Wr{}Vu.prototype.ValueTypeName="number";class qM extends uh{constructor(e,t,n,i){super(e,t,n,i)}interpolate_(e,t,n,i){const s=this.resultBuffer,o=this.sampleValues,a=this.valueSize,l=(n-t)/(i-t);let c=e*a;for(let u=c+a;c!==u;c+=4)si.slerpFlat(s,0,o,c-a,o,c,l);return s}}class tc extends Wr{InterpolantFactoryMethodLinear(e){return new qM(this.times,this.values,this.getValueSize(),e)}}tc.prototype.ValueTypeName="quaternion";tc.prototype.DefaultInterpolation=Du;tc.prototype.InterpolantFactoryMethodSmooth=void 0;class Da extends Wr{}Da.prototype.ValueTypeName="string";Da.prototype.ValueBufferType=Array;Da.prototype.DefaultInterpolation=Iu;Da.prototype.InterpolantFactoryMethodLinear=void 0;Da.prototype.InterpolantFactoryMethodSmooth=void 0;class Wu extends Wr{}Wu.prototype.ValueTypeName="vector";class Xu{constructor(e,t=-1,n,i=$d){this.name=e,this.tracks=n,this.duration=t,this.blendMode=i,this.uuid=er(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,i=1/(e.fps||1);for(let o=0,a=n.length;o!==a;++o)t.push(FU(n[o]).scale(i));const s=new this(e.name,e.duration,t,e.blendMode);return s.uuid=e.uuid,s}static toJSON(e){const t=[],n=e.tracks,i={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let s=0,o=n.length;s!==o;++s)t.push(Wr.toJSON(n[s]));return i}static CreateFromMorphTargetSequence(e,t,n,i){const s=t.length,o=[];for(let a=0;a1){const h=u[1];let p=i[h];p||(i[h]=p=[]),p.push(c)}}const o=[];for(const a in i)o.push(this.CreateFromMorphTargetSequence(a,i[a],t,n));return o}static parseAnimation(e,t){if(!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(h,p,m,v,_){if(m.length!==0){const y=[],g=[];Ey(m,y,g,v),y.length!==0&&_.push(new h(p,y,g))}},i=[],s=e.name||"default",o=e.fps||30,a=e.blendMode;let l=e.length||-1;const c=e.hierarchy||[];for(let h=0;h{t&&t(s),this.manager.itemEnd(e)},0),s;if(Cs[e]!==void 0){Cs[e].push({onLoad:t,onProgress:n,onError:i});return}Cs[e]=[],Cs[e].push({onLoad:t,onProgress:n,onError:i});const o=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),a=this.mimeType,l=this.responseType;fetch(o).then(c=>{if(c.status===200||c.status===0){if(c.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||c.body===void 0||c.body.getReader===void 0)return c;const u=Cs[e],h=c.body.getReader(),p=c.headers.get("Content-Length")||c.headers.get("X-File-Size"),m=p?parseInt(p):0,v=m!==0;let _=0;const y=new ReadableStream({start(g){x();function x(){h.read().then(({done:w,value:E})=>{if(w)g.close();else{_+=E.byteLength;const b=new ProgressEvent("progress",{lengthComputable:v,loaded:_,total:m});for(let M=0,A=u.length;M{switch(l){case"arraybuffer":return c.arrayBuffer();case"blob":return c.blob();case"document":return c.text().then(u=>new DOMParser().parseFromString(u,a));case"json":return c.json();default:if(a===void 0)return c.text();{const h=/charset="?([^;"\s]*)"?/i.exec(a),p=h&&h[1]?h[1].toLowerCase():void 0,m=new TextDecoder(p);return c.arrayBuffer().then(v=>m.decode(v))}}}).then(c=>{Ma.add(e,c);const u=Cs[e];delete Cs[e];for(let h=0,p=u.length;h{const u=Cs[e];if(u===void 0)throw this.manager.itemError(e),c;delete Cs[e];for(let h=0,p=u.length;h{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class zU extends Gi{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Bs(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(a){try{t(s.parse(JSON.parse(a)))}catch(l){i?i(l):console.error(l),s.manager.itemError(e)}},n,i)}parse(e){const t=[];for(let n=0;n0:i.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const o=e.uniforms[s];switch(i.uniforms[s]={},o.type){case"t":i.uniforms[s].value=n(o.value);break;case"c":i.uniforms[s].value=new Ke().setHex(o.value);break;case"v2":i.uniforms[s].value=new De().fromArray(o.value);break;case"v3":i.uniforms[s].value=new Y().fromArray(o.value);break;case"v4":i.uniforms[s].value=new Xt().fromArray(o.value);break;case"m3":i.uniforms[s].value=new Ct().fromArray(o.value);break;case"m4":i.uniforms[s].value=new yt().fromArray(o.value);break;default:i.uniforms[s].value=o.value}}if(e.defines!==void 0&&(i.defines=e.defines),e.vertexShader!==void 0&&(i.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(i.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(i.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)i.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(i.lights=e.lights),e.clipping!==void 0&&(i.clipping=e.clipping),e.size!==void 0&&(i.size=e.size),e.sizeAttenuation!==void 0&&(i.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(i.map=n(e.map)),e.matcap!==void 0&&(i.matcap=n(e.matcap)),e.alphaMap!==void 0&&(i.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(i.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(i.bumpScale=e.bumpScale),e.normalMap!==void 0&&(i.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(i.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),i.normalScale=new De().fromArray(s)}return e.displacementMap!==void 0&&(i.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(i.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(i.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(i.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(i.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(i.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(i.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(i.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(i.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(i.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(i.envMap=n(e.envMap)),e.envMapIntensity!==void 0&&(i.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(i.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(i.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(i.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(i.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(i.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(i.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(i.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(i.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(i.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(i.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(i.clearcoatNormalScale=new De().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(i.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(i.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(i.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(i.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(i.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(i.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(i.sheenRoughnessMap=n(e.sheenRoughnessMap)),i}setTextures(e){return this.textures=e,this}static createMaterialFromType(e){const t={ShadowMaterial:NM,SpriteMaterial:hy,RawShaderMaterial:FM,ShaderMaterial:cs,PointsMaterial:dy,MeshPhysicalMaterial:kM,MeshStandardMaterial:wy,MeshPhongMaterial:zM,MeshToonMaterial:BM,MeshNormalMaterial:GM,MeshLambertMaterial:HM,MeshDepthMaterial:ep,MeshDistanceMaterial:tp,MeshBasicMaterial:Vs,MeshMatcapMaterial:VM,LineDashedMaterial:WM,LineBasicMaterial:Pi,Material:oi};return new t[e]}}class pv{static decodeText(e){if(typeof TextDecoder<"u")return new TextDecoder().decode(e);let t="";for(let n=0,i=e.length;n0){const l=new Ty(t);s=new ju(l),s.setCrossOrigin(this.crossOrigin);for(let c=0,u=e.length;c0){i=new ju(this.manager),i.setCrossOrigin(this.crossOrigin);for(let o=0,a=e.length;o"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,i){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,o=Ma.get(e);if(o!==void 0)return s.manager.itemStart(e),setTimeout(function(){t&&t(o),s.manager.itemEnd(e)},0),o;const a={};a.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",a.headers=this.requestHeader,fetch(e,a).then(function(l){return l.blob()}).then(function(l){return createImageBitmap(l,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(l){Ma.add(e,l),t&&t(l),s.manager.itemEnd(e)}).catch(function(l){i&&i(l),s.manager.itemError(e),s.manager.itemEnd(e)}),s.manager.itemStart(e)}}let Xf;class Ry{static getContext(){return Xf===void 0&&(Xf=new(window.AudioContext||window.webkitAudioContext)),Xf}static setContext(e){Xf=e}}class ZU extends Gi{constructor(e){super(e)}load(e,t,n,i){const s=this,o=new Bs(this.manager);o.setResponseType("arraybuffer"),o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(l){try{const c=l.slice(0);Ry.getContext().decodeAudioData(c,function(h){t(h)},a)}catch(c){a(c)}},n,i);function a(l){i?i(l):console.error(l),s.manager.itemError(e)}}}class KU extends wp{constructor(e,t,n=1){super(void 0,n),this.isHemisphereLightProbe=!0;const i=new Ke().set(e),s=new Ke().set(t),o=new Y(i.r,i.g,i.b),a=new Y(s.r,s.g,s.b),l=Math.sqrt(Math.PI),c=l*Math.sqrt(.75);this.sh.coefficients[0].copy(o).add(a).multiplyScalar(l),this.sh.coefficients[1].copy(o).sub(a).multiplyScalar(c)}}class $U extends wp{constructor(e,t=1){super(void 0,t),this.isAmbientLightProbe=!0;const n=new Ke().set(e);this.sh.coefficients[0].set(n.r,n.g,n.b).multiplyScalar(2*Math.sqrt(Math.PI))}}const nw=new yt,iw=new yt,Zo=new yt;class JU{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new zn,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new zn,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Zo.copy(e.projectionMatrix);const i=t.eyeSep/2,s=i*t.near/t.focus,o=t.near*Math.tan(ma*t.fov*.5)/t.zoom;let a,l;iw.elements[12]=-i,nw.elements[12]=i,a=-o*t.aspect+s,l=o*t.aspect+s,Zo.elements[0]=2*t.near/(l-a),Zo.elements[8]=(l+a)/(l-a),this.cameraL.projectionMatrix.copy(Zo),a=-o*t.aspect-s,l=o*t.aspect-s,Zo.elements[0]=2*t.near/(l-a),Zo.elements[8]=(l+a)/(l-a),this.cameraR.projectionMatrix.copy(Zo)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(iw),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(nw)}}class Py{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=rw(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=rw();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function rw(){return(typeof performance>"u"?Date:performance).now()}const Ko=new Y,sw=new si,QU=new Y,$o=new Y;class e3 extends jt{constructor(){super(),this.type="AudioListener",this.context=Ry.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new Py}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Ko,sw,QU),$o.set(0,0,-1).applyQuaternion(sw),t.positionX){const i=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Ko.x,i),t.positionY.linearRampToValueAtTime(Ko.y,i),t.positionZ.linearRampToValueAtTime(Ko.z,i),t.forwardX.linearRampToValueAtTime($o.x,i),t.forwardY.linearRampToValueAtTime($o.y,i),t.forwardZ.linearRampToValueAtTime($o.z,i),t.upX.linearRampToValueAtTime(n.x,i),t.upY.linearRampToValueAtTime(n.y,i),t.upZ.linearRampToValueAtTime(n.z,i)}else t.setPosition(Ko.x,Ko.y,Ko.z),t.setOrientation($o.x,$o.y,$o.z,n.x,n.y,n.z)}}class sT extends jt{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e0&&this._mixBufferRegionAdditive(n,i,this._addIndex*t,1,t);for(let l=t,c=t+t;l!==c;++l)if(n[l]!==n[l+t]){a.setValue(n,i);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,i=n*this._origIndex;e.getValue(t,i);for(let s=n,o=i;s!==o;++s)t[s]=t[i+s%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n=.5)for(let o=0;o!==s;++o)e[t+o]=e[n+o]}_slerp(e,t,n,i){si.slerpFlat(e,t,e,t,e,n,i)}_slerpAdditive(e,t,n,i,s){const o=this._workIndex*s;si.multiplyQuaternionsFlat(e,o,e,t,e,n),si.slerpFlat(e,t,e,t,e,o,i)}_lerp(e,t,n,i,s){const o=1-i;for(let a=0;a!==s;++a){const l=t+a;e[l]=e[l]*o+e[n+a]*i}}_lerpAdditive(e,t,n,i,s){for(let o=0;o!==s;++o){const a=t+o;e[a]=e[a]+e[n+o]*i}}}const Ly="\\[\\]\\.:\\/",r3=new RegExp("["+Ly+"]","g"),Iy="[^"+Ly+"]",s3="[^"+Ly.replace("\\.","")+"]",o3=/((?:WC+[\/:])*)/.source.replace("WC",Iy),a3=/(WCOD+)?/.source.replace("WCOD",s3),l3=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",Iy),c3=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",Iy),u3=new RegExp("^"+o3+a3+l3+c3+"$"),h3=["material","materials","bones","map"];class f3{constructor(e,t,n){const i=n||zt.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,i)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,i=this._bindings[n];i!==void 0&&i.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let i=this._targetGroup.nCachedObjects_,s=n.length;i!==s;++i)n[i].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class zt{constructor(e,t,n){this.path=t,this.parsedPath=n||zt.parseTrackName(t),this.node=zt.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new zt.Composite(e,t,n):new zt(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(r3,"")}static parseTrackName(e){const t=u3.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},i=n.nodeName&&n.nodeName.lastIndexOf(".");if(i!==void 0&&i!==-1){const s=n.nodeName.substring(i+1);h3.indexOf(s)!==-1&&(n.nodeName=n.nodeName.substring(0,i),n.objectName=s)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(s){for(let o=0;o=s){const h=s++,p=e[h];t[p.uuid]=u,e[u]=p,t[c]=h,e[h]=l;for(let m=0,v=i;m!==v;++m){const _=n[m],y=_[h],g=_[u];_[u]=y,_[h]=g}}}this.nCachedObjects_=s}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,i=n.length;let s=this.nCachedObjects_,o=e.length;for(let a=0,l=arguments.length;a!==l;++a){const c=arguments[a],u=c.uuid,h=t[u];if(h!==void 0)if(delete t[u],h0&&(t[m.uuid]=h),e[h]=m,e.pop();for(let v=0,_=i;v!==_;++v){const y=n[v];y[h]=y[p],y.pop()}}}this.nCachedObjects_=s}subscribe_(e,t){const n=this._bindingsIndicesByPath;let i=n[e];const s=this._bindings;if(i!==void 0)return s[i];const o=this._paths,a=this._parsedPaths,l=this._objects,c=l.length,u=this.nCachedObjects_,h=new Array(c);i=s.length,n[e]=i,o.push(e),a.push(t),s.push(h);for(let p=u,m=l.length;p!==m;++p){const v=l[p];h[p]=new zt(v,e,t)}return h}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const i=this._paths,s=this._parsedPaths,o=this._bindings,a=o.length-1,l=o[a],c=e[a];t[c]=n,o[n]=l,o.pop(),s[n]=s[a],s.pop(),i[n]=i[a],i.pop()}}}class aT{constructor(e,t,n=null,i=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=i;const s=t.tracks,o=s.length,a=new Array(o),l={endingStart:ua,endingEnd:ua};for(let c=0;c!==o;++c){const u=s[c].createInterpolant(null);a[c]=u,u.settings=l}this._interpolantSettings=l,this._interpolants=a,this._propertyBindings=new Array(o),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=jb,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n){if(e.fadeOut(t),this.fadeIn(t),n){const i=this._clip.duration,s=e._clip.duration,o=s/i,a=i/s;e.warp(1,o,t),this.warp(a,1,t)}return this}crossFadeTo(e,t,n){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const i=this._mixer,s=i.time,o=this.timeScale;let a=this._timeScaleInterpolant;a===null&&(a=i._lendControlInterpolant(),this._timeScaleInterpolant=a);const l=a.parameterPositions,c=a.sampleValues;return l[0]=s,l[1]=s+n,c[0]=e/o,c[1]=t/o,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,i){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const l=(e-s)*n;l<0||n===0?t=0:(this._startTime=null,t=n*l)}t*=this._updateTimeScale(e);const o=this._updateTime(t),a=this._updateWeight(e);if(a>0){const l=this._interpolants,c=this._propertyBindings;switch(this.blendMode){case Qv:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulateAdditive(a);break;case $d:default:for(let u=0,h=l.length;u!==h;++u)l[u].evaluate(o),c[u].accumulate(i,a)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopFading(),i===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const i=n.evaluate(e)[0];t*=i,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let i=this.time+e,s=this._loopCount;const o=n===Yb;if(e===0)return s===-1?i:o&&(s&1)===1?t-i:i;if(n===Xb){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(i>=t)i=t;else if(i<0)i=0;else{this.time=i;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,o)):this._setEndings(this.repetitions===0,!0,o)),i>=t||i<0){const a=Math.floor(i/t);i-=t*a,s+=Math.abs(a);const l=this.repetitions-s;if(l<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,i=e>0?t:0,this.time=i,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(l===1){const c=e<0;this._setEndings(c,!c,o)}else this._setEndings(!1,!1,o);this._loopCount=s,this.time=i,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:a})}}else this.time=i;if(o&&(s&1)===1)return t-i}return i}_setEndings(e,t,n){const i=this._interpolantSettings;n?(i.endingStart=ha,i.endingEnd=ha):(e?i.endingStart=this.zeroSlopeAtStart?ha:ua:i.endingStart=Uu,t?i.endingEnd=this.zeroSlopeAtEnd?ha:ua:i.endingEnd=Uu)}_scheduleFading(e,t,n){const i=this._mixer,s=i.time;let o=this._weightInterpolant;o===null&&(o=i._lendControlInterpolant(),this._weightInterpolant=o);const a=o.parameterPositions,l=o.sampleValues;return a[0]=s,l[0]=t,a[1]=s+e,l[1]=n,this}}const p3=new Float32Array(1);class m3 extends Hs{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,i=e._clip.tracks,s=i.length,o=e._propertyBindings,a=e._interpolants,l=n.uuid,c=this._bindingsByRootAndName;let u=c[l];u===void 0&&(u={},c[l]=u);for(let h=0;h!==s;++h){const p=i[h],m=p.name;let v=u[m];if(v!==void 0)++v.referenceCount,o[h]=v;else{if(v=o[h],v!==void 0){v._cacheIndex===null&&(++v.referenceCount,this._addInactiveBinding(v,l,m));continue}const _=t&&t._propertyBindings[h].binding.parsedPath;v=new oT(zt.create(n,m,_),p.ValueTypeName,p.getValueSize()),++v.referenceCount,this._addInactiveBinding(v,l,m),o[h]=v}a[h].resultBuffer=v.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,i=e._clip.uuid,s=this._actionsByClip[i];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,i,n)}const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,i=t.length;n!==i;++n){const s=t[n];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,i=this.time+=e,s=Math.sign(e),o=this._accuIndex^=1;for(let c=0;c!==n;++c)t[c]._update(i,e,s,o);const a=this._bindings,l=this._nActiveBindings;for(let c=0;c!==l;++c)a[c].apply(o);return this}setTime(e){this.time=0;for(let t=0;tthis.max.x||e.ythis.max.y)}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return!(e.max.xthis.max.x||e.max.ythis.max.y)}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,lw).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const cw=new Y,jf=new Y;class S3{constructor(e=new Y,t=new Y){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){cw.subVectors(e,this.start),jf.subVectors(this.end,this.start);const n=jf.dot(jf);let s=jf.dot(cw)/n;return t&&(s=Tn(s,0,1)),s}closestPointToPoint(e,t,n){const i=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(i).add(this.start)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const uw=new Y;class E3 extends jt{constructor(e,t){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new Tt,i=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let o=0,a=1,l=32;o1)for(let h=0;h.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{mw.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(mw,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class N3 extends hs{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],i=new Tt;i.setAttribute("position",new st(t,3)),i.setAttribute("color",new st(n,3));const s=new Pi({vertexColors:!0,toneMapped:!1});super(i,s),this.type="AxesHelper"}setColors(e,t,n){const i=new Ke,s=this.geometry.attributes.color.array;return i.set(e),i.toArray(s,0),i.toArray(s,3),i.set(t),i.toArray(s,6),i.toArray(s,9),i.set(n),i.toArray(s,12),i.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class F3{constructor(){this.type="ShapePath",this.color=new Ke,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new zu,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,i){return this.currentPath.quadraticCurveTo(e,t,n,i),this}bezierCurveTo(e,t,n,i,s,o){return this.currentPath.bezierCurveTo(e,t,n,i,s,o),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(g){const x=[];for(let w=0,E=g.length;wNumber.EPSILON){if(L<0&&(A=x[M],C=-C,P=x[b],L=-L),g.yP.y)continue;if(g.y===A.y){if(g.x===A.x)return!0}else{const F=L*(g.x-A.x)-C*(g.y-A.y);if(F===0)return!0;if(F<0)continue;E=!E}}else{if(g.y!==A.y)continue;if(P.x<=g.x&&g.x<=A.x||A.x<=g.x&&g.x<=P.x)return!0}}return E}const i=as.isClockWise,s=this.subPaths;if(s.length===0)return[];let o,a,l;const c=[];if(s.length===1)return a=s[0],l=new va,l.curves=a.curves,c.push(l),c;let u=!i(s[0].getPoints());u=e?!u:u;const h=[],p=[];let m=[],v=0,_;p[v]=void 0,m[v]=[];for(let g=0,x=s.length;g1){let g=!1,x=0;for(let w=0,E=p.length;w0&&g===!1&&(m=h)}let y;for(let g=0,x=p.length;g{const h=typeof c=="function"?c(e):c;if(h!==e){const p=e;e=u?h:Object.assign({},e,h),t.forEach(m=>m(e,p))}},i=()=>e,s=(c,u=i,h=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=u(e);function m(){const v=u(e);if(!h(p,v)){const _=p;c(p=v,_)}}return t.add(m),()=>t.delete(m)},l={setState:n,getState:i,subscribe:(c,u,h)=>u||h?s(c,u,h):(t.add(c),()=>t.delete(c)),destroy:()=>t.clear()};return e=r(n,i,l),l}const G3=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),yw=G3?K.useEffect:K.useLayoutEffect;function H3(r){const e=typeof r=="function"?B3(r):r,t=(n=e.getState,i=Object.is)=>{const[,s]=K.useReducer(y=>y+1,0),o=e.getState(),a=K.useRef(o),l=K.useRef(n),c=K.useRef(i),u=K.useRef(!1),h=K.useRef();h.current===void 0&&(h.current=n(o));let p,m=!1;(a.current!==o||l.current!==n||c.current!==i||u.current)&&(p=n(o),m=!i(h.current,p)),yw(()=>{m&&(h.current=p),a.current=o,l.current=n,c.current=i,u.current=!1});const v=K.useRef(o);yw(()=>{const y=()=>{try{const x=e.getState(),w=l.current(x);c.current(h.current,w)||(a.current=x,h.current=w,s())}catch{u.current=!0,s()}},g=e.subscribe(y);return e.getState()!==v.current&&y(),g},[]);const _=m?p:h.current;return K.useDebugValue(_),_};return Object.assign(t,e),t[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const n=[t,e];return{next(){const i=n.length<=0;return{value:n.shift(),done:i}}}},t}var mg={exports:{}},gg={exports:{}},vg={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var _w;function V3(){return _w||(_w=1,(function(r){function e(k,G){var B=k.length;k.push(G);e:for(;0>>1,V=k[D];if(0>>1;Di(ie,B))uei(ce,ie)?(k[D]=ce,k[ue]=B,D=ue):(k[D]=ie,k[ee]=B,D=ee);else if(uei(ce,B))k[D]=ce,k[ue]=B,D=ue;else break e}}return G}function i(k,G){var B=k.sortIndex-G.sortIndex;return B!==0?B:k.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();r.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,p=3,m=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=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(k){for(var G=t(c);G!==null;){if(G.callback===null)n(c);else if(G.startTime<=k)n(c),G.sortIndex=G.expirationTime,e(l,G);else break;G=t(c)}}function E(k){if(_=!1,w(k),!v)if(t(l)!==null)v=!0,W(b);else{var G=t(c);G!==null&&O(E,G.startTime-k)}}function b(k,G){v=!1,_&&(_=!1,g(P),P=-1),m=!0;var B=p;try{for(w(G),h=t(l);h!==null&&(!(h.expirationTime>G)||k&&!F());){var D=h.callback;if(typeof D=="function"){h.callback=null,p=h.priorityLevel;var V=D(h.expirationTime<=G);G=r.unstable_now(),typeof V=="function"?h.callback=V:h===t(l)&&n(l),w(G)}else n(l);h=t(l)}if(h!==null)var Z=!0;else{var ee=t(c);ee!==null&&O(E,ee.startTime-G),Z=!1}return Z}finally{h=null,p=B,m=!1}}var M=!1,A=null,P=-1,C=5,L=-1;function F(){return!(r.unstable_now()-Lk||125D?(k.sortIndex=B,e(c,k),t(l)===null&&k===t(c)&&(_?(g(P),P=-1):_=!0,O(E,B-D))):(k.sortIndex=V,e(l,k),v||m||(v=!0,W(b))),k},r.unstable_shouldYield=F,r.unstable_wrapCallback=function(k){var G=p;return function(){var B=p;p=G;try{return k.apply(this,arguments)}finally{p=B}}}})(vg)),vg}var xw;function W3(){return xw||(xw=1,gg.exports=V3()),gg.exports}/** + * @license React + * react-reconciler.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 yg,ww;function X3(){return ww||(ww=1,yg=function(e){var t={},n=Hv(),i=W3(),s=Object.assign;function o(f){for(var d="https://reactjs.org/docs/error-decoder.html?invariant="+f,S=1;She||R[Q]!==U[he]){var Ce=` +`+R[Q].replace(" at new "," at ");return f.displayName&&Ce.includes("")&&(Ce=Ce.replace("",f.displayName)),Ce}while(1<=Q&&0<=he);break}}}finally{Jt=!1,Error.prepareStackTrace=S}return(f=f?f.displayName||f.name:"")?ut(f):""}var Yn=Object.prototype.hasOwnProperty,ci=[],qt=-1;function mt(f){return{current:f}}function kt(f){0>qt||(f.current=ci[qt],ci[qt]=null,qt--)}function gt(f,d){qt++,ci[qt]=f.current,f.current=d}var Cn={},En=mt(Cn),cn=mt(!1),Ii=Cn;function Qt(f,d){var S=f.type.contextTypes;if(!S)return Cn;var T=f.stateNode;if(T&&T.__reactInternalMemoizedUnmaskedChildContext===d)return T.__reactInternalMemoizedMaskedChildContext;var R={},U;for(U in S)R[U]=d[U];return T&&(f=f.stateNode,f.__reactInternalMemoizedUnmaskedChildContext=d,f.__reactInternalMemoizedMaskedChildContext=R),R}function on(f){return f=f.childContextTypes,f!=null}function xi(){kt(cn),kt(En)}function Un(f,d,S){if(En.current!==Cn)throw Error(o(168));gt(En,d),gt(cn,S)}function Xr(f,d,S){var T=f.stateNode;if(d=d.childContextTypes,typeof T.getChildContext!="function")return S;T=T.getChildContext();for(var R in T)if(!(R in d))throw Error(o(108,P(f)||"Unknown",R));return s({},S,T)}function jr(f){return f=(f=f.stateNode)&&f.__reactInternalMemoizedMergedChildContext||Cn,Ii=En.current,gt(En,f),gt(cn,cn.current),!0}function ui(f,d,S){var T=f.stateNode;if(!T)throw Error(o(169));S?(f=Xr(f,d,Ii),T.__reactInternalMemoizedMergedChildContext=f,kt(cn),kt(En),gt(En,f)):kt(cn),gt(cn,S)}var Vi=Math.clz32?Math.clz32:xh,Oa=Math.log,Ro=Math.LN2;function xh(f){return f>>>=0,f===0?32:31-(Oa(f)/Ro|0)|0}var fs=64,ds=4194304;function ps(f){switch(f&-f){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 f&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return f&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return f}}function Po(f,d){var S=f.pendingLanes;if(S===0)return 0;var T=0,R=f.suspendedLanes,U=f.pingedLanes,Q=S&268435455;if(Q!==0){var he=Q&~R;he!==0?T=ps(he):(U&=Q,U!==0&&(T=ps(U)))}else Q=S&~R,Q!==0?T=ps(Q):U!==0&&(T=ps(U));if(T===0)return 0;if(d!==0&&d!==T&&(d&R)===0&&(R=T&-T,U=d&-d,R>=U||R===16&&(U&4194240)!==0))return d;if((T&4)!==0&&(T|=S&16),d=f.entangledLanes,d!==0)for(f=f.entanglements,d&=T;0S;S++)d.push(f);return d}function Yr(f,d,S){f.pendingLanes|=d,d!==536870912&&(f.suspendedLanes=0,f.pingedLanes=0),f=f.eventTimes,d=31-Vi(d),f[d]=S}function Ys(f,d){var S=f.pendingLanes&~d;f.pendingLanes=d,f.suspendedLanes=0,f.pingedLanes=0,f.expiredLanes&=d,f.mutableReadLanes&=d,f.entangledLanes&=d,d=f.entanglements;var T=f.eventTimes;for(f=f.expirationTimes;0>=Q,R-=Q,ys=1<<32-Vi(d)+R|S<Ht?($n=Et,Et=null):$n=Et.sibling;var Vt=ht(ye,Et,Te[Ht],et);if(Vt===null){Et===null&&(Et=$n);break}f&&Et&&Vt.alternate===null&&d(ye,Et),fe=U(Vt,fe,Ht),Pt===null?ot=Vt:Pt.sibling=Vt,Pt=Vt,Et=$n}if(Ht===Te.length)return S(ye,Et),un&&Fo(ye,Ht),ot;if(Et===null){for(;HtHt?($n=Et,Et=null):$n=Et.sibling;var no=ht(ye,Et,Vt.value,et);if(no===null){Et===null&&(Et=$n);break}f&&Et&&no.alternate===null&&d(ye,Et),fe=U(no,fe,Ht),Pt===null?ot=no:Pt.sibling=no,Pt=no,Et=$n}if(Vt.done)return S(ye,Et),un&&Fo(ye,Ht),ot;if(Et===null){for(;!Vt.done;Ht++,Vt=Te.next())Vt=St(ye,Vt.value,et),Vt!==null&&(fe=U(Vt,fe,Ht),Pt===null?ot=Vt:Pt.sibling=Vt,Pt=Vt);return un&&Fo(ye,Ht),ot}for(Et=T(ye,Et);!Vt.done;Ht++,Vt=Te.next())Vt=nn(Et,ye,Ht,Vt.value,et),Vt!==null&&(f&&Vt.alternate!==null&&Et.delete(Vt.key===null?Ht:Vt.key),fe=U(Vt,fe,Ht),Pt===null?ot=Vt:Pt.sibling=Vt,Pt=Vt);return f&&Et.forEach(function(Y2){return d(ye,Y2)}),un&&Fo(ye,Ht),ot}function dr(ye,fe,Te,et){if(typeof Te=="object"&&Te!==null&&Te.type===u&&Te.key===null&&(Te=Te.props.children),typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case l:e:{for(var ot=Te.key,Pt=fe;Pt!==null;){if(Pt.key===ot){if(ot=Te.type,ot===u){if(Pt.tag===7){S(ye,Pt.sibling),fe=R(Pt,Te.props.children),fe.return=ye,ye=fe;break e}}else if(Pt.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===w&&A_(ot)===Pt.type){S(ye,Pt.sibling),fe=R(Pt,Te.props),fe.ref=pc(ye,Pt,Te),fe.return=ye,ye=fe;break e}S(ye,Pt);break}else d(ye,Pt);Pt=Pt.sibling}Te.type===u?(fe=Wo(Te.props.children,ye.mode,et,Te.key),fe.return=ye,ye=fe):(et=cf(Te.type,Te.key,Te.props,null,ye.mode,et),et.ref=pc(ye,fe,Te),et.return=ye,ye=et)}return Q(ye);case c:e:{for(Pt=Te.key;fe!==null;){if(fe.key===Pt)if(fe.tag===4&&fe.stateNode.containerInfo===Te.containerInfo&&fe.stateNode.implementation===Te.implementation){S(ye,fe.sibling),fe=R(fe,Te.children||[]),fe.return=ye,ye=fe;break e}else{S(ye,fe);break}else d(ye,fe);fe=fe.sibling}fe=Im(Te,ye.mode,et),fe.return=ye,ye=fe}return Q(ye);case w:return Pt=Te._init,dr(ye,fe,Pt(Te._payload),et)}if(q(Te))return at(ye,fe,Te,et);if(M(Te))return pi(ye,fe,Te,et);Lh(ye,Te)}return typeof Te=="string"&&Te!==""||typeof Te=="number"?(Te=""+Te,fe!==null&&fe.tag===6?(S(ye,fe.sibling),fe=R(fe,Te),fe.return=ye,ye=fe):(S(ye,fe),fe=Lm(Te,ye.mode,et),fe.return=ye,ye=fe),Q(ye)):S(ye,fe)}return dr}var Va=C_(!0),R_=C_(!1),mc={},cr=mt(mc),gc=mt(mc),Wa=mt(mc);function Kr(f){if(f===mc)throw Error(o(174));return f}function Zp(f,d){gt(Wa,d),gt(gc,f),gt(cr,mc),f=O(d),kt(cr),gt(cr,f)}function Xa(){kt(cr),kt(gc),kt(Wa)}function P_(f){var d=Kr(Wa.current),S=Kr(cr.current);d=k(S,f.type,d),S!==d&&(gt(gc,f),gt(cr,d))}function Kp(f){gc.current===f&&(kt(cr),kt(gc))}var mn=mt(0);function Ih(f){for(var d=f;d!==null;){if(d.tag===13){var S=d.memoizedState;if(S!==null&&(S=S.dehydrated,S===null||Bt(S)||sn(S)))return d}else if(d.tag===19&&d.memoizedProps.revealOrder!==void 0){if((d.flags&128)!==0)return d}else if(d.child!==null){d.child.return=d,d=d.child;continue}if(d===f)break;for(;d.sibling===null;){if(d.return===null||d.return===f)return null;d=d.return}d.sibling.return=d.return,d=d.sibling}return null}var $p=[];function Jp(){for(var f=0;f<$p.length;f++){var d=$p[f];Ee?d._workInProgressVersionPrimary=null:d._workInProgressVersionSecondary=null}$p.length=0}var Dh=a.ReactCurrentDispatcher,ur=a.ReactCurrentBatchConfig,ja=0,bn=null,hi=null,Kn=null,Uh=!1,vc=!1,yc=0,y2=0;function fi(){throw Error(o(321))}function Qp(f,d){if(d===null)return!1;for(var S=0;SS?S:4,f(!0);var T=ur.transition;ur.transition={};try{f(!1),d()}finally{Ut=S,ur.transition=T}}function W_(){return $r().memoizedState}function x2(f,d,S){var T=Qs(f);S={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null},X_(f)?j_(d,S):(Y_(f,d,S),S=Ti(),f=hr(f,T,S),f!==null&&q_(f,d,T))}function w2(f,d,S){var T=Qs(f),R={lane:T,action:S,hasEagerState:!1,eagerState:null,next:null};if(X_(f))j_(d,R);else{Y_(f,d,R);var U=f.alternate;if(f.lanes===0&&(U===null||U.lanes===0)&&(U=d.lastRenderedReducer,U!==null))try{var Q=d.lastRenderedState,he=U(Q,S);if(R.hasEagerState=!0,R.eagerState=he,Xi(he,Q))return}catch{}finally{}S=Ti(),f=hr(f,T,S),f!==null&&q_(f,d,T)}}function X_(f){var d=f.alternate;return f===bn||d!==null&&d===bn}function j_(f,d){vc=Uh=!0;var S=f.pending;S===null?d.next=d:(d.next=S.next,S.next=d),f.pending=d}function Y_(f,d,S){On!==null&&(f.mode&1)!==0&&(Dt&2)===0?(f=d.interleaved,f===null?(S.next=S,ji===null?ji=[d]:ji.push(d)):(S.next=f.next,f.next=S),d.interleaved=S):(f=d.pending,f===null?S.next=S:(S.next=f.next,f.next=S),d.pending=S)}function q_(f,d,S){if((S&4194240)!==0){var T=d.lanes;T&=f.pendingLanes,S|=T,d.lanes=S,qr(f,S)}}var zh={readContext:Pn,useCallback:fi,useContext:fi,useEffect:fi,useImperativeHandle:fi,useInsertionEffect:fi,useLayoutEffect:fi,useMemo:fi,useReducer:fi,useRef:fi,useState:fi,useDebugValue:fi,useDeferredValue:fi,useTransition:fi,useMutableSource:fi,useSyncExternalStore:fi,useId:fi,unstable_isNewReconciler:!1},S2={readContext:Pn,useCallback:function(f,d){return xs().memoizedState=[f,d===void 0?null:d],f},useContext:Pn,useEffect:im,useImperativeHandle:function(f,d,S){return S=S!=null?S.concat([f]):null,Fh(4194308,4,B_.bind(null,d,f),S)},useLayoutEffect:function(f,d){return Fh(4194308,4,f,d)},useInsertionEffect:function(f,d){return Fh(4,2,f,d)},useMemo:function(f,d){var S=xs();return d=d===void 0?null:d,f=f(),S.memoizedState=[f,d],f},useReducer:function(f,d,S){var T=xs();return d=S!==void 0?S(d):d,T.memoizedState=T.baseState=d,f={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:f,lastRenderedState:d},T.queue=f,f=f.dispatch=x2.bind(null,bn,f),[T.memoizedState,f]},useRef:function(f){var d=xs();return f={current:f},d.memoizedState=f},useState:nm,useDebugValue:rm,useDeferredValue:function(f){var d=nm(f),S=d[0],T=d[1];return im(function(){var R=ur.transition;ur.transition={};try{T(f)}finally{ur.transition=R}},[f]),S},useTransition:function(){var f=nm(!1),d=f[0];return f=_2.bind(null,f[1]),xs().memoizedState=f,[d,f]},useMutableSource:function(){},useSyncExternalStore:function(f,d,S){var T=bn,R=xs();if(un){if(S===void 0)throw Error(o(407));S=S()}else{if(S=d(),On===null)throw Error(o(349));(ja&30)!==0||D_(T,d,S)}R.memoizedState=S;var U={value:S,getSnapshot:d};return R.queue=U,im(O_.bind(null,T,U,f),[f]),T.flags|=2048,_c(9,U_.bind(null,T,U,S,d),void 0,null),S},useId:function(){var f=xs(),d=On.identifierPrefix;if(un){var S=_s,T=ys;S=(T&~(1<<32-Vi(T)-1)).toString(32)+S,d=":"+d+"R"+S,S=yc++,0Em&&(d.flags|=128,T=!0,Ec(R,!1),d.lanes=4194304)}else{if(!T)if(f=Ih(U),f!==null){if(d.flags|=128,T=!0,f=f.updateQueue,f!==null&&(d.updateQueue=f,d.flags|=4),Ec(R,!0),R.tail===null&&R.tailMode==="hidden"&&!U.alternate&&!un)return di(d),null}else 2*pn()-R.renderingStartTime>Em&&S!==1073741824&&(d.flags|=128,T=!0,Ec(R,!1),d.lanes=4194304);R.isBackwards?(U.sibling=d.child,d.child=U):(f=R.last,f!==null?f.sibling=U:d.child=U,R.last=U)}return R.tail!==null?(d=R.tail,R.rendering=d,R.tail=d.sibling,R.renderingStartTime=pn(),d.sibling=null,f=mn.current,gt(mn,T?f&1|2:f&1),d):(di(d),null);case 22:case 23:return Cm(),T=d.memoizedState!==null,f!==null&&f.memoizedState!==null!==T&&(d.flags|=8192),T&&(d.mode&1)!==0?(Ki&1073741824)!==0&&(di(d),ae&&d.subtreeFlags&6&&(d.flags|=8192)):di(d),null;case 24:return null;case 25:return null}throw Error(o(156,d.tag))}var A2=a.ReactCurrentOwner,Zi=!1;function Mi(f,d,S,T){d.child=f===null?R_(d,null,S,T):Va(d,f.child,S,T)}function nx(f,d,S,T,R){S=S.render;var U=d.ref;return Rn(d,R),T=em(f,d,S,T,U,R),S=tm(),f!==null&&!Zi?(d.updateQueue=f.updateQueue,d.flags&=-2053,f.lanes&=~R,ws(f,d,R)):(un&&S&&Wp(d),d.flags|=1,Mi(f,d,T,R),d.child)}function ix(f,d,S,T,R){if(f===null){var U=S.type;return typeof U=="function"&&!Pm(U)&&U.defaultProps===void 0&&S.compare===null&&S.defaultProps===void 0?(d.tag=15,d.type=U,rx(f,d,U,T,R)):(f=cf(S.type,null,T,d,d.mode,R),f.ref=d.ref,f.return=d,d.child=f)}if(U=f.child,(f.lanes&R)===0){var Q=U.memoizedProps;if(S=S.compare,S=S!==null?S:Uo,S(Q,T)&&f.ref===d.ref)return ws(f,d,R)}return d.flags|=1,f=to(U,T),f.ref=d.ref,f.return=d,d.child=f}function rx(f,d,S,T,R){if(f!==null&&Uo(f.memoizedProps,T)&&f.ref===d.ref)if(Zi=!1,(f.lanes&R)!==0)(f.flags&131072)!==0&&(Zi=!0);else return d.lanes=f.lanes,ws(f,d,R);return am(f,d,S,T,R)}function sx(f,d,S){var T=d.pendingProps,R=T.children,U=f!==null?f.memoizedState:null;if(T.mode==="hidden")if((d.mode&1)===0)d.memoizedState={baseLanes:0,cachePool:null},gt(Ya,Ki),Ki|=S;else if((S&1073741824)!==0)d.memoizedState={baseLanes:0,cachePool:null},T=U!==null?U.baseLanes:S,gt(Ya,Ki),Ki|=T;else return f=U!==null?U.baseLanes|S:S,d.lanes=d.childLanes=1073741824,d.memoizedState={baseLanes:f,cachePool:null},d.updateQueue=null,gt(Ya,Ki),Ki|=f,null;else U!==null?(T=U.baseLanes|S,d.memoizedState=null):T=S,gt(Ya,Ki),Ki|=T;return Mi(f,d,R,S),d.child}function ox(f,d){var S=d.ref;(f===null&&S!==null||f!==null&&f.ref!==S)&&(d.flags|=512,d.flags|=2097152)}function am(f,d,S,T,R){var U=on(S)?Ii:En.current;return U=Qt(d,U),Rn(d,R),S=em(f,d,S,T,U,R),T=tm(),f!==null&&!Zi?(d.updateQueue=f.updateQueue,d.flags&=-2053,f.lanes&=~R,ws(f,d,R)):(un&&T&&Wp(d),d.flags|=1,Mi(f,d,S,R),d.child)}function ax(f,d,S,T,R){if(on(S)){var U=!0;jr(d)}else U=!1;if(Rn(d,R),d.stateNode===null)f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),w_(d,S,T),Vp(d,S,T,R),T=!0;else if(f===null){var Q=d.stateNode,he=d.memoizedProps;Q.props=he;var Ce=Q.context,Xe=S.contextType;typeof Xe=="object"&&Xe!==null?Xe=Pn(Xe):(Xe=on(S)?Ii:En.current,Xe=Qt(d,Xe));var rt=S.getDerivedStateFromProps,St=typeof rt=="function"||typeof Q.getSnapshotBeforeUpdate=="function";St||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(he!==T||Ce!==Xe)&&S_(d,Q,T,Xe),Zs=!1;var ht=d.memoizedState;Q.state=ht,Ah(d,T,Q,R),Ce=d.memoizedState,he!==T||ht!==Ce||cn.current||Zs?(typeof rt=="function"&&(Hp(d,S,rt,T),Ce=d.memoizedState),(he=Zs||x_(d,S,he,T,ht,Ce,Xe))?(St||typeof Q.UNSAFE_componentWillMount!="function"&&typeof Q.componentWillMount!="function"||(typeof Q.componentWillMount=="function"&&Q.componentWillMount(),typeof Q.UNSAFE_componentWillMount=="function"&&Q.UNSAFE_componentWillMount()),typeof Q.componentDidMount=="function"&&(d.flags|=4194308)):(typeof Q.componentDidMount=="function"&&(d.flags|=4194308),d.memoizedProps=T,d.memoizedState=Ce),Q.props=T,Q.state=Ce,Q.context=Xe,T=he):(typeof Q.componentDidMount=="function"&&(d.flags|=4194308),T=!1)}else{Q=d.stateNode,g_(f,d),he=d.memoizedProps,Xe=d.type===d.elementType?he:Ei(d.type,he),Q.props=Xe,St=d.pendingProps,ht=Q.context,Ce=S.contextType,typeof Ce=="object"&&Ce!==null?Ce=Pn(Ce):(Ce=on(S)?Ii:En.current,Ce=Qt(d,Ce));var nn=S.getDerivedStateFromProps;(rt=typeof nn=="function"||typeof Q.getSnapshotBeforeUpdate=="function")||typeof Q.UNSAFE_componentWillReceiveProps!="function"&&typeof Q.componentWillReceiveProps!="function"||(he!==St||ht!==Ce)&&S_(d,Q,T,Ce),Zs=!1,ht=d.memoizedState,Q.state=ht,Ah(d,T,Q,R);var at=d.memoizedState;he!==St||ht!==at||cn.current||Zs?(typeof nn=="function"&&(Hp(d,S,nn,T),at=d.memoizedState),(Xe=Zs||x_(d,S,Xe,T,ht,at,Ce)||!1)?(rt||typeof Q.UNSAFE_componentWillUpdate!="function"&&typeof Q.componentWillUpdate!="function"||(typeof Q.componentWillUpdate=="function"&&Q.componentWillUpdate(T,at,Ce),typeof Q.UNSAFE_componentWillUpdate=="function"&&Q.UNSAFE_componentWillUpdate(T,at,Ce)),typeof Q.componentDidUpdate=="function"&&(d.flags|=4),typeof Q.getSnapshotBeforeUpdate=="function"&&(d.flags|=1024)):(typeof Q.componentDidUpdate!="function"||he===f.memoizedProps&&ht===f.memoizedState||(d.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||he===f.memoizedProps&&ht===f.memoizedState||(d.flags|=1024),d.memoizedProps=T,d.memoizedState=at),Q.props=T,Q.state=at,Q.context=Ce,T=Xe):(typeof Q.componentDidUpdate!="function"||he===f.memoizedProps&&ht===f.memoizedState||(d.flags|=4),typeof Q.getSnapshotBeforeUpdate!="function"||he===f.memoizedProps&&ht===f.memoizedState||(d.flags|=1024),T=!1)}return lm(f,d,S,T,U,R)}function lm(f,d,S,T,R,U){ox(f,d);var Q=(d.flags&128)!==0;if(!T&&!Q)return R&&ui(d,S,!1),ws(f,d,U);T=d.stateNode,A2.current=d;var he=Q&&typeof S.getDerivedStateFromError!="function"?null:T.render();return d.flags|=1,f!==null&&Q?(d.child=Va(d,f.child,null,U),d.child=Va(d,null,he,U)):Mi(f,d,he,U),d.memoizedState=T.state,R&&ui(d,S,!0),d.child}function lx(f){var d=f.stateNode;d.pendingContext?Un(f,d.pendingContext,d.pendingContext!==d.context):d.context&&Un(f,d.context,!1),Zp(f,d.containerInfo)}function cx(f,d,S,T,R){return Ha(),qp(R),d.flags|=256,Mi(f,d,S,T),d.child}var Hh={dehydrated:null,treeContext:null,retryLane:0};function Vh(f){return{baseLanes:f,cachePool:null}}function ux(f,d,S){var T=d.pendingProps,R=mn.current,U=!1,Q=(d.flags&128)!==0,he;if((he=Q)||(he=f!==null&&f.memoizedState===null?!1:(R&2)!==0),he?(U=!0,d.flags&=-129):(f===null||f.memoizedState!==null)&&(R|=1),gt(mn,R&1),f===null)return Yp(d),f=d.memoizedState,f!==null&&(f=f.dehydrated,f!==null)?((d.mode&1)===0?d.lanes=1:sn(f)?d.lanes=8:d.lanes=1073741824,null):(R=T.children,f=T.fallback,U?(T=d.mode,U=d.child,R={mode:"hidden",children:R},(T&1)===0&&U!==null?(U.childLanes=0,U.pendingProps=R):U=uf(R,T,0,null),f=Wo(f,T,S,null),U.return=d,f.return=d,U.sibling=f,d.child=U,d.child.memoizedState=Vh(S),d.memoizedState=Hh,f):cm(d,R));if(R=f.memoizedState,R!==null){if(he=R.dehydrated,he!==null){if(Q)return d.flags&256?(d.flags&=-257,Wh(f,d,S,Error(o(422)))):d.memoizedState!==null?(d.child=f.child,d.flags|=128,null):(U=T.fallback,R=d.mode,T=uf({mode:"visible",children:T.children},R,0,null),U=Wo(U,R,S,null),U.flags|=2,T.return=d,U.return=d,T.sibling=U,d.child=T,(d.mode&1)!==0&&Va(d,f.child,null,S),d.child.memoizedState=Vh(S),d.memoizedState=Hh,U);if((d.mode&1)===0)d=Wh(f,d,S,null);else if(sn(he))d=Wh(f,d,S,Error(o(419)));else if(T=(S&f.childLanes)!==0,Zi||T){if(T=On,T!==null){switch(S&-S){case 4:U=2;break;case 16:U=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:U=32;break;case 536870912:U=268435456;break;default:U=0}T=(U&(T.suspendedLanes|S))!==0?0:U,T!==0&&T!==R.retryLane&&(R.retryLane=T,hr(f,T,-1))}Rm(),d=Wh(f,d,S,Error(o(421)))}else Bt(he)?(d.flags|=128,d.child=f.child,d=B2.bind(null,f),ti(he,d),d=null):(S=R.treeContext,oe&&(qi=sr(he),Yi=d,un=!0,Ar=null,fc=!1,S!==null&&(ar[lr++]=ys,ar[lr++]=_s,ar[lr++]=No,ys=S.id,_s=S.overflow,No=d)),d=cm(d,d.pendingProps.children),d.flags|=4096);return d}return U?(T=fx(f,d,T.children,T.fallback,S),U=d.child,R=f.child.memoizedState,U.memoizedState=R===null?Vh(S):{baseLanes:R.baseLanes|S,cachePool:null},U.childLanes=f.childLanes&~S,d.memoizedState=Hh,T):(S=hx(f,d,T.children,S),d.memoizedState=null,S)}return U?(T=fx(f,d,T.children,T.fallback,S),U=d.child,R=f.child.memoizedState,U.memoizedState=R===null?Vh(S):{baseLanes:R.baseLanes|S,cachePool:null},U.childLanes=f.childLanes&~S,d.memoizedState=Hh,T):(S=hx(f,d,T.children,S),d.memoizedState=null,S)}function cm(f,d){return d=uf({mode:"visible",children:d},f.mode,0,null),d.return=f,f.child=d}function hx(f,d,S,T){var R=f.child;return f=R.sibling,S=to(R,{mode:"visible",children:S}),(d.mode&1)===0&&(S.lanes=T),S.return=d,S.sibling=null,f!==null&&(T=d.deletions,T===null?(d.deletions=[f],d.flags|=16):T.push(f)),d.child=S}function fx(f,d,S,T,R){var U=d.mode;f=f.child;var Q=f.sibling,he={mode:"hidden",children:S};return(U&1)===0&&d.child!==f?(S=d.child,S.childLanes=0,S.pendingProps=he,d.deletions=null):(S=to(f,he),S.subtreeFlags=f.subtreeFlags&14680064),Q!==null?T=to(Q,T):(T=Wo(T,U,R,null),T.flags|=2),T.return=d,S.return=d,S.sibling=T,d.child=S,T}function Wh(f,d,S,T){return T!==null&&qp(T),Va(d,f.child,null,S),f=cm(d,d.pendingProps.children),f.flags|=2,d.memoizedState=null,f}function dx(f,d,S){f.lanes|=d;var T=f.alternate;T!==null&&(T.lanes|=d),bi(f.return,d,S)}function um(f,d,S,T,R){var U=f.memoizedState;U===null?f.memoizedState={isBackwards:d,rendering:null,renderingStartTime:0,last:T,tail:S,tailMode:R}:(U.isBackwards=d,U.rendering=null,U.renderingStartTime=0,U.last=T,U.tail=S,U.tailMode=R)}function px(f,d,S){var T=d.pendingProps,R=T.revealOrder,U=T.tail;if(Mi(f,d,T.children,S),T=mn.current,(T&2)!==0)T=T&1|2,d.flags|=128;else{if(f!==null&&(f.flags&128)!==0)e:for(f=d.child;f!==null;){if(f.tag===13)f.memoizedState!==null&&dx(f,S,d);else if(f.tag===19)dx(f,S,d);else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===d)break e;for(;f.sibling===null;){if(f.return===null||f.return===d)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}T&=1}if(gt(mn,T),(d.mode&1)===0)d.memoizedState=null;else switch(R){case"forwards":for(S=d.child,R=null;S!==null;)f=S.alternate,f!==null&&Ih(f)===null&&(R=S),S=S.sibling;S=R,S===null?(R=d.child,d.child=null):(R=S.sibling,S.sibling=null),um(d,!1,R,S,U);break;case"backwards":for(S=null,R=d.child,d.child=null;R!==null;){if(f=R.alternate,f!==null&&Ih(f)===null){d.child=R;break}f=R.sibling,R.sibling=S,S=R,R=f}um(d,!0,S,null,U);break;case"together":um(d,!1,null,null,void 0);break;default:d.memoizedState=null}return d.child}function ws(f,d,S){if(f!==null&&(d.dependencies=f.dependencies),qa|=d.lanes,(S&d.childLanes)===0)return null;if(f!==null&&d.child!==f.child)throw Error(o(153));if(d.child!==null){for(f=d.child,S=to(f,f.pendingProps),d.child=S,S.return=d;f.sibling!==null;)f=f.sibling,S=S.sibling=to(f,f.pendingProps),S.return=d;S.sibling=null}return d.child}function C2(f,d,S){switch(d.tag){case 3:lx(d),Ha();break;case 5:P_(d);break;case 1:on(d.type)&&jr(d);break;case 4:Zp(d,d.stateNode.containerInfo);break;case 10:Mh(d,d.type._context,d.memoizedProps.value);break;case 13:var T=d.memoizedState;if(T!==null)return T.dehydrated!==null?(gt(mn,mn.current&1),d.flags|=128,null):(S&d.child.childLanes)!==0?ux(f,d,S):(gt(mn,mn.current&1),f=ws(f,d,S),f!==null?f.sibling:null);gt(mn,mn.current&1);break;case 19:if(T=(S&d.childLanes)!==0,(f.flags&128)!==0){if(T)return px(f,d,S);d.flags|=128}var R=d.memoizedState;if(R!==null&&(R.rendering=null,R.tail=null,R.lastEffect=null),gt(mn,mn.current),T)break;return null;case 22:case 23:return d.lanes=0,sx(f,d,S)}return ws(f,d,S)}function R2(f,d){switch(Xp(d),d.tag){case 1:return on(d.type)&&xi(),f=d.flags,f&65536?(d.flags=f&-65537|128,d):null;case 3:return Xa(),kt(cn),kt(En),Jp(),f=d.flags,(f&65536)!==0&&(f&128)===0?(d.flags=f&-65537|128,d):null;case 5:return Kp(d),null;case 13:if(kt(mn),f=d.memoizedState,f!==null&&f.dehydrated!==null){if(d.alternate===null)throw Error(o(340));Ha()}return f=d.flags,f&65536?(d.flags=f&-65537|128,d):null;case 19:return kt(mn),null;case 4:return Xa(),null;case 10:return Zn(d.type._context),null;case 22:case 23:return Cm(),null;case 24:return null;default:return null}}var Xh=!1,zo=!1,P2=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function jh(f,d){var S=f.ref;if(S!==null)if(typeof S=="function")try{S(null)}catch(T){Ni(f,d,T)}else S.current=null}function hm(f,d,S){try{S()}catch(T){Ni(f,d,T)}}var mx=!1;function L2(f,d){for(G(f.containerInfo),Qe=d;Qe!==null;)if(f=Qe,d=f.child,(f.subtreeFlags&1028)!==0&&d!==null)d.return=f,Qe=d;else for(;Qe!==null;){f=Qe;try{var S=f.alternate;if((f.flags&1024)!==0)switch(f.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var T=S.memoizedProps,R=S.memoizedState,U=f.stateNode,Q=U.getSnapshotBeforeUpdate(f.elementType===f.type?T:Ei(f.type,T),R);U.__reactInternalSnapshotBeforeUpdate=Q}break;case 3:ae&&Ge(f.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(o(163))}}catch(he){Ni(f,f.return,he)}if(d=f.sibling,d!==null){d.return=f.return,Qe=d;break}Qe=f.return}return S=mx,mx=!1,S}function Bo(f,d,S){var T=d.updateQueue;if(T=T!==null?T.lastEffect:null,T!==null){var R=T=T.next;do{if((R.tag&f)===f){var U=R.destroy;R.destroy=void 0,U!==void 0&&hm(d,S,U)}R=R.next}while(R!==T)}}function bc(f,d){if(d=d.updateQueue,d=d!==null?d.lastEffect:null,d!==null){var S=d=d.next;do{if((S.tag&f)===f){var T=S.create;S.destroy=T()}S=S.next}while(S!==d)}}function fm(f){var d=f.ref;if(d!==null){var S=f.stateNode;switch(f.tag){case 5:f=W(S);break;default:f=S}typeof d=="function"?d(f):d.current=f}}function gx(f,d,S){if(Wi&&typeof Wi.onCommitFiberUnmount=="function")try{Wi.onCommitFiberUnmount(Io,d)}catch{}switch(d.tag){case 0:case 11:case 14:case 15:if(f=d.updateQueue,f!==null&&(f=f.lastEffect,f!==null)){var T=f=f.next;do{var R=T,U=R.destroy;R=R.tag,U!==void 0&&((R&2)!==0||(R&4)!==0)&&hm(d,S,U),T=T.next}while(T!==f)}break;case 1:if(jh(d,S),f=d.stateNode,typeof f.componentWillUnmount=="function")try{f.props=d.memoizedProps,f.state=d.memoizedState,f.componentWillUnmount()}catch(Q){Ni(d,S,Q)}break;case 5:jh(d,S);break;case 4:ae?Sx(f,d,S):z&&z&&(d=d.stateNode.containerInfo,S=_t(d),Ot(d,S))}}function vx(f,d,S){for(var T=d;;)if(gx(f,T,S),T.child===null||ae&&T.tag===4){if(T===d)break;for(;T.sibling===null;){if(T.return===null||T.return===d)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else T.child.return=T,T=T.child}function yx(f){var d=f.alternate;d!==null&&(f.alternate=null,yx(d)),f.child=null,f.deletions=null,f.sibling=null,f.tag===5&&(d=f.stateNode,d!==null&&Ie(d)),f.stateNode=null,f.return=null,f.dependencies=null,f.memoizedProps=null,f.memoizedState=null,f.pendingProps=null,f.stateNode=null,f.updateQueue=null}function _x(f){return f.tag===5||f.tag===3||f.tag===4}function xx(f){e:for(;;){for(;f.sibling===null;){if(f.return===null||_x(f.return))return null;f=f.return}for(f.sibling.return=f.return,f=f.sibling;f.tag!==5&&f.tag!==6&&f.tag!==18;){if(f.flags&2||f.child===null||f.tag===4)continue e;f.child.return=f,f=f.child}if(!(f.flags&2))return f.stateNode}}function wx(f){if(ae){e:{for(var d=f.return;d!==null;){if(_x(d))break e;d=d.return}throw Error(o(160))}var S=d;switch(S.tag){case 5:d=S.stateNode,S.flags&32&&(nt(d),S.flags&=-33),S=xx(f),pm(f,S,d);break;case 3:case 4:d=S.stateNode.containerInfo,S=xx(f),dm(f,S,d);break;default:throw Error(o(161))}}}function dm(f,d,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,d?Ve(S,f,d):Fe(S,f);else if(T!==4&&(f=f.child,f!==null))for(dm(f,d,S),f=f.sibling;f!==null;)dm(f,d,S),f=f.sibling}function pm(f,d,S){var T=f.tag;if(T===5||T===6)f=f.stateNode,d?$e(S,f,d):Me(S,f);else if(T!==4&&(f=f.child,f!==null))for(pm(f,d,S),f=f.sibling;f!==null;)pm(f,d,S),f=f.sibling}function Sx(f,d,S){for(var T=d,R=!1,U,Q;;){if(!R){R=T.return;e:for(;;){if(R===null)throw Error(o(160));switch(U=R.stateNode,R.tag){case 5:Q=!1;break e;case 3:U=U.containerInfo,Q=!0;break e;case 4:U=U.containerInfo,Q=!0;break e}R=R.return}R=!0}if(T.tag===5||T.tag===6)vx(f,T,S),Q?We(U,T.stateNode):Oe(U,T.stateNode);else if(T.tag===18)Q?lt(U,T.stateNode):it(U,T.stateNode);else if(T.tag===4){if(T.child!==null){U=T.stateNode.containerInfo,Q=!0,T.child.return=T,T=T.child;continue}}else if(gx(f,T,S),T.child!==null){T.child.return=T,T=T.child;continue}if(T===d)break;for(;T.sibling===null;){if(T.return===null||T.return===d)return;T=T.return,T.tag===4&&(R=!1)}T.sibling.return=T.return,T=T.sibling}}function mm(f,d){if(ae){switch(d.tag){case 0:case 11:case 14:case 15:Bo(3,d,d.return),bc(3,d),Bo(5,d,d.return);return;case 1:return;case 5:var S=d.stateNode;if(S!=null){var T=d.memoizedProps;f=f!==null?f.memoizedProps:T;var R=d.type,U=d.updateQueue;d.updateQueue=null,U!==null&&Be(S,U,R,f,T,d)}return;case 6:if(d.stateNode===null)throw Error(o(162));S=d.memoizedProps,Ue(d.stateNode,f!==null?f.memoizedProps:S,S);return;case 3:oe&&f!==null&&f.memoizedState.isDehydrated&&pe(d.stateNode.containerInfo);return;case 12:return;case 13:Yh(d);return;case 19:Yh(d);return;case 17:return}throw Error(o(163))}switch(d.tag){case 0:case 11:case 14:case 15:Bo(3,d,d.return),bc(3,d),Bo(5,d,d.return);return;case 12:return;case 13:Yh(d);return;case 19:Yh(d);return;case 3:oe&&f!==null&&f.memoizedState.isDehydrated&&pe(d.stateNode.containerInfo);break;case 22:case 23:return}e:if(z){switch(d.tag){case 1:case 5:case 6:break e;case 3:case 4:d=d.stateNode,Ot(d.containerInfo,d.pendingChildren);break e}throw Error(o(163))}}function Yh(f){var d=f.updateQueue;if(d!==null){f.updateQueue=null;var S=f.stateNode;S===null&&(S=f.stateNode=new P2),d.forEach(function(T){var R=G2.bind(null,f,T);S.has(T)||(S.add(T),T.then(R,R))})}}function I2(f,d){for(Qe=d;Qe!==null;){d=Qe;var S=d.deletions;if(S!==null)for(var T=0;T";case Zh:return":has("+(ym(f)||"")+")";case Kh:return'[role="'+f.value+'"]';case Jh:return'"'+f.value+'"';case $h:return'[data-testname="'+f.value+'"]';default:throw Error(o(365))}}function Ax(f,d){var S=[];f=[f,0];for(var T=0;TR&&(R=Q),T&=~U}if(T=R,T=pn()-T,T=(120>T?120:480>T?480:1080>T?1080:1920>T?1920:3e3>T?3e3:4320>T?4320:1960*U2(T/1960))-T,10f?16:f,Js===null)var T=!1;else{if(f=Js,Js=null,rf=0,(Dt&6)!==0)throw Error(o(331));var R=Dt;for(Dt|=4,Qe=f.current;Qe!==null;){var U=Qe,Q=U.child;if((Qe.flags&16)!==0){var he=U.deletions;if(he!==null){for(var Ce=0;Cepn()-Sm?Go(f,0):wm|=S),Oi(f,d)}function Nx(f,d){d===0&&((f.mode&1)===0?d=1:(d=ds,ds<<=1,(ds&130023424)===0&&(ds=4194304)));var S=Ti();f=af(f,d),f!==null&&(Yr(f,d,S),Oi(f,S))}function B2(f){var d=f.memoizedState,S=0;d!==null&&(S=d.retryLane),Nx(f,S)}function G2(f,d){var S=0;switch(f.tag){case 13:var T=f.stateNode,R=f.memoizedState;R!==null&&(S=R.retryLane);break;case 19:T=f.stateNode;break;default:throw Error(o(314))}T!==null&&T.delete(d),Nx(f,S)}var Fx;Fx=function(f,d,S){if(f!==null)if(f.memoizedProps!==d.pendingProps||cn.current)Zi=!0;else{if((f.lanes&S)===0&&(d.flags&128)===0)return Zi=!1,C2(f,d,S);Zi=(f.flags&131072)!==0}else Zi=!1,un&&(d.flags&1048576)!==0&&E_(d,Ph,d.index);switch(d.lanes=0,d.tag){case 2:var T=d.type;f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),f=d.pendingProps;var R=Qt(d,En.current);Rn(d,S),R=em(null,d,T,f,R,S);var U=tm();return d.flags|=1,typeof R=="object"&&R!==null&&typeof R.render=="function"&&R.$$typeof===void 0?(d.tag=1,d.memoizedState=null,d.updateQueue=null,on(T)?(U=!0,jr(d)):U=!1,d.memoizedState=R.state!==null&&R.state!==void 0?R.state:null,Gp(d),R.updater=Ch,d.stateNode=R,R._reactInternals=d,Vp(d,T,f,S),d=lm(null,d,T,!0,U,S)):(d.tag=0,un&&U&&Wp(d),Mi(null,d,R,S),d=d.child),d;case 16:T=d.elementType;e:{switch(f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),f=d.pendingProps,R=T._init,T=R(T._payload),d.type=T,R=d.tag=V2(T),f=Ei(T,f),R){case 0:d=am(null,d,T,f,S);break e;case 1:d=ax(null,d,T,f,S);break e;case 11:d=nx(null,d,T,f,S);break e;case 14:d=ix(null,d,T,Ei(T.type,f),S);break e}throw Error(o(306,T,""))}return d;case 0:return T=d.type,R=d.pendingProps,R=d.elementType===T?R:Ei(T,R),am(f,d,T,R,S);case 1:return T=d.type,R=d.pendingProps,R=d.elementType===T?R:Ei(T,R),ax(f,d,T,R,S);case 3:e:{if(lx(d),f===null)throw Error(o(387));T=d.pendingProps,U=d.memoizedState,R=U.element,g_(f,d),Ah(d,T,null,S);var Q=d.memoizedState;if(T=Q.element,oe&&U.isDehydrated)if(U={element:T,isDehydrated:!1,cache:Q.cache,transitions:Q.transitions},d.updateQueue.baseState=U,d.memoizedState=U,d.flags&256){R=Error(o(423)),d=cx(f,d,T,S,R);break e}else if(T!==R){R=Error(o(424)),d=cx(f,d,T,S,R);break e}else for(oe&&(qi=Gn(d.stateNode.containerInfo),Yi=d,un=!0,Ar=null,fc=!1),S=R_(d,null,T,S),d.child=S;S;)S.flags=S.flags&-3|4096,S=S.sibling;else{if(Ha(),T===R){d=ws(f,d,S);break e}Mi(f,d,T,S)}d=d.child}return d;case 5:return P_(d),f===null&&Yp(d),T=d.type,R=d.pendingProps,U=f!==null?f.memoizedProps:null,Q=R.children,ie(T,R)?Q=null:U!==null&&ie(T,U)&&(d.flags|=32),ox(f,d),Mi(f,d,Q,S),d.child;case 6:return f===null&&Yp(d),null;case 13:return ux(f,d,S);case 4:return Zp(d,d.stateNode.containerInfo),T=d.pendingProps,f===null?d.child=Va(d,null,T,S):Mi(f,d,T,S),d.child;case 11:return T=d.type,R=d.pendingProps,R=d.elementType===T?R:Ei(T,R),nx(f,d,T,R,S);case 7:return Mi(f,d,d.pendingProps,S),d.child;case 8:return Mi(f,d,d.pendingProps.children,S),d.child;case 12:return Mi(f,d,d.pendingProps.children,S),d.child;case 10:e:{if(T=d.type._context,R=d.pendingProps,U=d.memoizedProps,Q=R.value,Mh(d,T,Q),U!==null)if(Xi(U.value,Q)){if(U.children===R.children&&!cn.current){d=ws(f,d,S);break e}}else for(U=d.child,U!==null&&(U.return=d);U!==null;){var he=U.dependencies;if(he!==null){Q=U.child;for(var Ce=he.firstContext;Ce!==null;){if(Ce.context===T){if(U.tag===1){Ce=vs(-1,S&-S),Ce.tag=2;var Xe=U.updateQueue;if(Xe!==null){Xe=Xe.shared;var rt=Xe.pending;rt===null?Ce.next=Ce:(Ce.next=rt.next,rt.next=Ce),Xe.pending=Ce}}U.lanes|=S,Ce=U.alternate,Ce!==null&&(Ce.lanes|=S),bi(U.return,S,d),he.lanes|=S;break}Ce=Ce.next}}else if(U.tag===10)Q=U.type===d.type?null:U.child;else if(U.tag===18){if(Q=U.return,Q===null)throw Error(o(341));Q.lanes|=S,he=Q.alternate,he!==null&&(he.lanes|=S),bi(Q,S,d),Q=U.sibling}else Q=U.child;if(Q!==null)Q.return=U;else for(Q=U;Q!==null;){if(Q===d){Q=null;break}if(U=Q.sibling,U!==null){U.return=Q.return,Q=U;break}Q=Q.return}U=Q}Mi(f,d,R.children,S),d=d.child}return d;case 9:return R=d.type,T=d.pendingProps.children,Rn(d,S),R=Pn(R),T=T(R),d.flags|=1,Mi(f,d,T,S),d.child;case 14:return T=d.type,R=Ei(T,d.pendingProps),R=Ei(T.type,R),ix(f,d,T,R,S);case 15:return rx(f,d,d.type,d.pendingProps,S);case 17:return T=d.type,R=d.pendingProps,R=d.elementType===T?R:Ei(T,R),f!==null&&(f.alternate=null,d.alternate=null,d.flags|=2),d.tag=1,on(T)?(f=!0,jr(d)):f=!1,Rn(d,S),w_(d,T,R),Vp(d,T,R,S),lm(null,d,T,!0,f,S);case 19:return px(f,d,S);case 22:return sx(f,d,S)}throw Error(o(156,d.tag))};function kx(f,d){return gs(f,d)}function H2(f,d,S,T){this.tag=f,this.key=S,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=d,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=T,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fr(f,d,S,T){return new H2(f,d,S,T)}function Pm(f){return f=f.prototype,!(!f||!f.isReactComponent)}function V2(f){if(typeof f=="function")return Pm(f)?1:0;if(f!=null){if(f=f.$$typeof,f===_)return 11;if(f===x)return 14}return 2}function to(f,d){var S=f.alternate;return S===null?(S=fr(f.tag,d,f.key,f.mode),S.elementType=f.elementType,S.type=f.type,S.stateNode=f.stateNode,S.alternate=f,f.alternate=S):(S.pendingProps=d,S.type=f.type,S.flags=0,S.subtreeFlags=0,S.deletions=null),S.flags=f.flags&14680064,S.childLanes=f.childLanes,S.lanes=f.lanes,S.child=f.child,S.memoizedProps=f.memoizedProps,S.memoizedState=f.memoizedState,S.updateQueue=f.updateQueue,d=f.dependencies,S.dependencies=d===null?null:{lanes:d.lanes,firstContext:d.firstContext},S.sibling=f.sibling,S.index=f.index,S.ref=f.ref,S}function cf(f,d,S,T,R,U){var Q=2;if(T=f,typeof f=="function")Pm(f)&&(Q=1);else if(typeof f=="string")Q=5;else e:switch(f){case u:return Wo(S.children,R,U,d);case h:Q=8,R|=8;break;case p:return f=fr(12,S,d,R|2),f.elementType=p,f.lanes=U,f;case y:return f=fr(13,S,d,R),f.elementType=y,f.lanes=U,f;case g:return f=fr(19,S,d,R),f.elementType=g,f.lanes=U,f;case E:return uf(S,R,U,d);default:if(typeof f=="object"&&f!==null)switch(f.$$typeof){case m:Q=10;break e;case v:Q=9;break e;case _:Q=11;break e;case x:Q=14;break e;case w:Q=16,T=null;break e}throw Error(o(130,f==null?f:typeof f,""))}return d=fr(Q,S,d,R),d.elementType=f,d.type=T,d.lanes=U,d}function Wo(f,d,S,T){return f=fr(7,f,T,d),f.lanes=S,f}function uf(f,d,S,T){return f=fr(22,f,T,d),f.elementType=E,f.lanes=S,f.stateNode={},f}function Lm(f,d,S){return f=fr(6,f,null,d),f.lanes=S,f}function Im(f,d,S){return d=fr(4,f.children!==null?f.children:[],f.key,d),d.lanes=S,d.stateNode={containerInfo:f.containerInfo,pendingChildren:null,implementation:f.implementation},d}function W2(f,d,S,T,R){this.tag=d,this.containerInfo=f,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Ae,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Na(0),this.expirationTimes=Na(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Na(0),this.identifierPrefix=T,this.onRecoverableError=R,oe&&(this.mutableSourceEagerHydrationData=null)}function zx(f,d,S,T,R,U,Q,he,Ce){return f=new W2(f,d,S,he,Ce),d===1?(d=1,U===!0&&(d|=8)):d=0,U=fr(3,null,null,d),f.current=U,U.stateNode=f,U.memoizedState={element:T,isDehydrated:S,cache:null,transitions:null},Gp(U),f}function Bx(f){if(!f)return Cn;f=f._reactInternals;e:{if(C(f)!==f||f.tag!==1)throw Error(o(170));var d=f;do{switch(d.tag){case 3:d=d.stateNode.context;break e;case 1:if(on(d.type)){d=d.stateNode.__reactInternalMemoizedMergedChildContext;break e}}d=d.return}while(d!==null);throw Error(o(171))}if(f.tag===1){var S=f.type;if(on(S))return Xr(f,S,d)}return d}function Gx(f){var d=f._reactInternals;if(d===void 0)throw typeof f.render=="function"?Error(o(188)):(f=Object.keys(f).join(","),Error(o(268,f)));return f=N(d),f===null?null:f.stateNode}function Hx(f,d){if(f=f.memoizedState,f!==null&&f.dehydrated!==null){var S=f.retryLane;f.retryLane=S!==0&&S=Xe&&U>=St&&R<=rt&&Q<=ht){f.splice(d,1);break}else if(T!==Xe||S.width!==Ce.width||htQ){if(!(U!==St||S.height!==Ce.height||rtR)){Xe>T&&(Ce.width+=Xe-T,Ce.x=T),rtU&&(Ce.height+=St-U,Ce.y=U),htS&&(S=Q)),Q ")+` + +No matching component was found for: + `)+f.join(" > ")}return null},t.getPublicRootInstance=function(f){if(f=f.current,!f.child)return null;switch(f.child.tag){case 5:return W(f.child.stateNode);default:return f.child.stateNode}},t.injectIntoDevTools=function(f){if(f={bundleType:f.bundleType,version:f.version,rendererPackageName:f.rendererPackageName,rendererConfig:f.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:a.ReactCurrentDispatcher,findHostInstanceByFiber:X2,findFiberByHostInstance:f.findFiberByHostInstance||j2,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.0.0-fc46dba67-20220329"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")f=!1;else{var d=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(d.isDisabled||!d.supportsFiber)f=!0;else{try{Io=d.inject(f),Wi=d}catch{}f=!!d.checkDCE}}return f},t.isAlreadyRendering=function(){return!1},t.observeVisibleRects=function(f,d,S,T){if(!Le)throw Error(o(363));f=_m(f,d);var R=be(f,S,T).disconnect;return{disconnect:function(){R()}}},t.registerMutableSourceForHydration=function(f,d){var S=d._getVersion;S=S(d._source),f.mutableSourceEagerHydrationData==null?f.mutableSourceEagerHydrationData=[d,S]:f.mutableSourceEagerHydrationData.push(d,S)},t.runWithPriority=function(f,d){var S=Ut;try{return Ut=f,d()}finally{Ut=S}},t.shouldError=function(){return null},t.shouldSuspend=function(){return!1},t.updateContainer=function(f,d,S,T){var R=d.current,U=Ti(),Q=Qs(R);return S=Bx(S),d.context===null?d.context=S:d.pendingContext=S,d=vs(U,Q),d.payload={element:f},T=T===void 0?null:T,T!==null&&(d.callback=T),Ks(R,d),f=hr(R,Q,U),f!==null&&Th(f,R,Q),Q},t}),yg}var Sw;function j3(){return Sw||(Sw=1,mg.exports=X3()),mg.exports}var Y3=j3();const q3=Hr(Y3);var _g={exports:{}},xg={};/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ew;function Z3(){return Ew||(Ew=1,(function(r){function e(k,G){var B=k.length;k.push(G);e:for(;0>>1,V=k[D];if(0>>1;Di(ie,B))uei(ce,ie)?(k[D]=ce,k[ue]=B,D=ue):(k[D]=ie,k[ee]=B,D=ee);else if(uei(ce,B))k[D]=ce,k[ue]=B,D=ue;else break e}}return G}function i(k,G){var B=k.sortIndex-G.sortIndex;return B!==0?B:k.id-G.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;r.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();r.unstable_now=function(){return o.now()-a}}var l=[],c=[],u=1,h=null,p=3,m=!1,v=!1,_=!1,y=typeof setTimeout=="function"?setTimeout:null,g=typeof clearTimeout=="function"?clearTimeout:null,x=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(k){for(var G=t(c);G!==null;){if(G.callback===null)n(c);else if(G.startTime<=k)n(c),G.sortIndex=G.expirationTime,e(l,G);else break;G=t(c)}}function E(k){if(_=!1,w(k),!v)if(t(l)!==null)v=!0,W(b);else{var G=t(c);G!==null&&O(E,G.startTime-k)}}function b(k,G){v=!1,_&&(_=!1,g(P),P=-1),m=!0;var B=p;try{for(w(G),h=t(l);h!==null&&(!(h.expirationTime>G)||k&&!F());){var D=h.callback;if(typeof D=="function"){h.callback=null,p=h.priorityLevel;var V=D(h.expirationTime<=G);G=r.unstable_now(),typeof V=="function"?h.callback=V:h===t(l)&&n(l),w(G)}else n(l);h=t(l)}if(h!==null)var Z=!0;else{var ee=t(c);ee!==null&&O(E,ee.startTime-G),Z=!1}return Z}finally{h=null,p=B,m=!1}}var M=!1,A=null,P=-1,C=5,L=-1;function F(){return!(r.unstable_now()-Lk||125D?(k.sortIndex=B,e(c,k),t(l)===null&&k===t(c)&&(_?(g(P),P=-1):_=!0,O(E,B-D))):(k.sortIndex=V,e(l,k),v||m||(v=!0,W(b))),k},r.unstable_shouldYield=F,r.unstable_wrapCallback=function(k){var G=p;return function(){var B=p;p=G;try{return k.apply(this,arguments)}finally{p=B}}}})(xg)),xg}var bw;function K3(){return bw||(bw=1,_g.exports=Z3()),_g.exports}var Mw=K3();const $3=r=>typeof r=="object"&&typeof r.then=="function",Jf=[];function J3(r,e,t=(n,i)=>n===i){if(r===e)return!0;if(!r||!e)return!1;const n=r.length;if(e.length!==n)return!1;for(let i=0;i0&&(s.timeout&&clearTimeout(s.timeout),s.timeout=setTimeout(s.remove,n.lifespan)),s.response;if(!t)throw s.promise}const i={keys:e,equal:n.equal,remove:()=>{const s=Jf.indexOf(i);s!==-1&&Jf.splice(s,1)},promise:($3(r)?r:r(...e)).then(s=>{i.response=s,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(s=>i.error=s)};if(Jf.push(i),!t)throw i.promise}const eO=(r,e,t)=>Q3(r,e,!1,t),Oy={},hT=r=>void Object.assign(Oy,r);function tO(r,e){function t(u,{args:h=[],attach:p,...m},v){let _=`${u[0].toUpperCase()}${u.slice(1)}`,y;if(u==="primitive"){if(m.object===void 0)throw new Error("R3F: Primitives without 'object' are invalid!");const g=m.object;y=Ll(g,{type:u,root:v,attach:p,primitive:!0})}else{const g=Oy[_];if(!g)throw new Error(`R3F: ${_} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(!Array.isArray(h))throw new Error("R3F: The args prop must be an array!");y=Ll(new g(...h),{type:u,root:v,attach:p,memoizedProps:{args:h}})}return y.__r3f.attach===void 0&&(y instanceof Tt?y.__r3f.attach="geometry":y instanceof oi&&(y.__r3f.attach="material")),_!=="inject"&&Eg(y,m),y}function n(u,h){let p=!1;if(h){var m,v;(m=h.__r3f)!=null&&m.attach?Sg(u,h,h.__r3f.attach):h.isObject3D&&u.isObject3D&&(u.add(h),p=!0),p||(v=u.__r3f)==null||v.objects.push(h),h.__r3f||Ll(h,{}),h.__r3f.parent=u,vv(h),Il(h)}}function i(u,h,p){let m=!1;if(h){var v,_;if((v=h.__r3f)!=null&&v.attach)Sg(u,h,h.__r3f.attach);else if(h.isObject3D&&u.isObject3D){h.parent=u,h.dispatchEvent({type:"added"});const y=u.children.filter(x=>x!==h),g=y.indexOf(p);u.children=[...y.slice(0,g),h,...y.slice(g)],m=!0}m||(_=u.__r3f)==null||_.objects.push(h),h.__r3f||Ll(h,{}),h.__r3f.parent=u,vv(h),Il(h)}}function s(u,h,p=!1){u&&[...u].forEach(m=>o(h,m,p))}function o(u,h,p){if(h){var m,v,_;if(h.__r3f&&(h.__r3f.parent=null),(m=u.__r3f)!=null&&m.objects&&(u.__r3f.objects=u.__r3f.objects.filter(E=>E!==h)),(v=h.__r3f)!=null&&v.attach)Pw(u,h,h.__r3f.attach);else if(h.isObject3D&&u.isObject3D){var y;u.remove(h),(y=h.__r3f)!=null&&y.root&&lO(h.__r3f.root,h)}const x=(_=h.__r3f)==null?void 0:_.primitive,w=p===void 0?h.dispose!==null&&!x:p;if(!x){var g;s((g=h.__r3f)==null?void 0:g.objects,h,w),s(h.children,h,w)}delete h.__r3f,w&&h.dispose&&h.type!=="Scene"&&Mw.unstable_scheduleCallback(Mw.unstable_IdlePriority,()=>{try{h.dispose()}catch{}}),Il(u)}}function a(u,h,p,m){var v;const _=(v=u.__r3f)==null?void 0:v.parent;if(!_)return;const y=t(h,p,u.__r3f.root);if(u.children){for(const g of u.children)g.__r3f&&n(y,g);u.children=u.children.filter(g=>!g.__r3f)}u.__r3f.objects.forEach(g=>n(y,g)),u.__r3f.objects=[],u.__r3f.autoRemovedBeforeAppend||o(_,u),y.parent&&(y.__r3f.autoRemovedBeforeAppend=!0),n(_,y),y.raycast&&y.__r3f.eventCount&&y.__r3f.root.getState().internal.interaction.push(y),[m,m.alternate].forEach(g=>{g!==null&&(g.stateNode=y,g.ref&&(typeof g.ref=="function"?g.ref(y):g.ref.current=y))})}const l=()=>console.warn("Text is not allowed in the R3F tree! This could be stray whitespace or characters.");return{reconciler:q3({createInstance:t,removeChild:o,appendChild:n,appendInitialChild:n,insertBefore:i,supportsMutation:!0,isPrimaryRenderer:!1,supportsPersistence:!1,supportsHydration:!1,noTimeout:-1,appendChildToContainer:(u,h)=>{if(!h)return;const p=u.getState().scene;p.__r3f&&(p.__r3f.root=u,n(p,h))},removeChildFromContainer:(u,h)=>{h&&o(u.getState().scene,h)},insertInContainerBefore:(u,h,p)=>{if(!h||!p)return;const m=u.getState().scene;m.__r3f&&i(m,h,p)},getRootHostContext:()=>null,getChildHostContext:u=>u,finalizeInitialChildren(u){var h;return!!((h=u==null?void 0:u.__r3f)!=null?h:{}).handlers},prepareUpdate(u,h,p,m){var v;if(((v=u==null?void 0:u.__r3f)!=null?v:{}).primitive&&m.object&&m.object!==u)return[!0];{const{args:y=[],children:g,...x}=m,{args:w=[],children:E,...b}=p;if(!Array.isArray(y))throw new Error("R3F: the args prop must be an array!");if(y.some((A,P)=>A!==w[P]))return[!0];const M=yT(u,x,b,!0);return M.changes.length?[!1,M]:null}},commitUpdate(u,[h,p],m,v,_,y){h?a(u,m,_,y):Eg(u,p)},commitMount(u,h,p,m){var v;const _=(v=u.__r3f)!=null?v:{};u.raycast&&_.handlers&&_.eventCount&&u.__r3f.root.getState().internal.interaction.push(u)},getPublicInstance:u=>u,prepareForCommit:()=>null,preparePortalMount:u=>Ll(u.getState().scene),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance(u){var h;const{attach:p,parent:m}=(h=u.__r3f)!=null?h:{};p&&m&&Pw(m,u,p),u.isObject3D&&(u.visible=!1),Il(u)},unhideInstance(u,h){var p;const{attach:m,parent:v}=(p=u.__r3f)!=null?p:{};m&&v&&Sg(v,u,m),(u.isObject3D&&h.visible==null||h.visible)&&(u.visible=!0),Il(u)},createTextInstance:l,hideTextInstance:l,unhideTextInstance:l,getCurrentEventPriority:()=>e?e():Fl.DefaultEventPriority,beforeActiveInstanceBlur:()=>{},afterActiveInstanceBlur:()=>{},detachDeletedInstance:()=>{},now:typeof performance<"u"&&hn.fun(performance.now)?performance.now:hn.fun(Date.now)?Date.now:()=>0,scheduleTimeout:hn.fun(setTimeout)?setTimeout:void 0,cancelTimeout:hn.fun(clearTimeout)?clearTimeout:void 0}),applyProps:Eg}}var Tw,Aw;const wg=r=>"colorSpace"in r||"outputColorSpace"in r,fT=()=>{var r;return(r=Oy.ColorManagement)!=null?r:null},dT=r=>r&&r.isOrthographicCamera,nO=r=>r&&r.hasOwnProperty("current"),hh=typeof window<"u"&&((Tw=window.document)!=null&&Tw.createElement||((Aw=window.navigator)==null?void 0:Aw.product)==="ReactNative")?K.useLayoutEffect:K.useEffect;function pT(r){const e=K.useRef(r);return hh(()=>void(e.current=r),[r]),e}function iO({set:r}){return hh(()=>(r(new Promise(()=>null)),()=>r(!1)),[r]),null}class mT extends K.Component{constructor(...e){super(...e),this.state={error:!1}}componentDidCatch(e){this.props.set(e)}render(){return this.state.error?null:this.props.children}}mT.getDerivedStateFromError=()=>({error:!0});const gT="__default",Cw=new Map,rO=r=>r&&!!r.memoized&&!!r.changes;function vT(r){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(r)?Math.min(Math.max(r[0],t),r[1]):r}const zc=r=>{var e;return(e=r.__r3f)==null?void 0:e.root.getState()},hn={obj:r=>r===Object(r)&&!hn.arr(r)&&typeof r!="function",fun:r=>typeof r=="function",str:r=>typeof r=="string",num:r=>typeof r=="number",boo:r=>typeof r=="boolean",und:r=>r===void 0,arr:r=>Array.isArray(r),equ(r,e,{arrays:t="shallow",objects:n="reference",strict:i=!0}={}){if(typeof r!=typeof e||!!r!=!!e)return!1;if(hn.str(r)||hn.num(r))return r===e;const s=hn.obj(r);if(s&&n==="reference")return r===e;const o=hn.arr(r);if(o&&t==="reference")return r===e;if((o||s)&&r===e)return!0;let a;for(a in r)if(!(a in e))return!1;if(s&&t==="shallow"&&n==="shallow"){for(a in i?e:r)if(!hn.equ(r[a],e[a],{strict:i,objects:"reference"}))return!1}else for(a in i?e:r)if(r[a]!==e[a])return!1;if(hn.und(a)){if(o&&r.length===0&&e.length===0||s&&Object.keys(r).length===0&&Object.keys(e).length===0)return!0;if(r!==e)return!1}return!0}};function sO(r){r.dispose&&r.type!=="Scene"&&r.dispose();for(const e in r)e.dispose==null||e.dispose(),delete r[e]}function Ll(r,e){const t=r;return t.__r3f={type:"",root:null,previousAttach:null,memoizedProps:{},eventCount:0,handlers:{},objects:[],parent:null,...e},r}function gv(r,e){let t=r;if(e.includes("-")){const n=e.split("-"),i=n.pop();return t=n.reduce((s,o)=>s[o],r),{target:t,key:i}}else return{target:t,key:e}}const Rw=/-\d+$/;function Sg(r,e,t){if(hn.str(t)){if(Rw.test(t)){const s=t.replace(Rw,""),{target:o,key:a}=gv(r,s);Array.isArray(o[a])||(o[a]=[])}const{target:n,key:i}=gv(r,t);e.__r3f.previousAttach=n[i],n[i]=e}else e.__r3f.previousAttach=t(r,e)}function Pw(r,e,t){var n,i;if(hn.str(t)){const{target:s,key:o}=gv(r,t),a=e.__r3f.previousAttach;a===void 0?delete s[o]:s[o]=a}else(n=e.__r3f)==null||n.previousAttach==null||n.previousAttach(r,e);(i=e.__r3f)==null||delete i.previousAttach}function yT(r,{children:e,key:t,ref:n,...i},{children:s,key:o,ref:a,...l}={},c=!1){var u;const h=(u=r==null?void 0:r.__r3f)!=null?u:{},p=Object.entries(i),m=[];if(c){const _=Object.keys(l);for(let y=0;y<_.length;y++)i.hasOwnProperty(_[y])||p.unshift([_[y],gT+"remove"])}p.forEach(([_,y])=>{var g;if((g=r.__r3f)!=null&&g.primitive&&_==="object"||hn.equ(y,l[_]))return;if(/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/.test(_))return m.push([_,y,!0,[]]);let x=[];_.includes("-")&&(x=_.split("-")),m.push([_,y,!1,x]);for(const w in i){const E=i[w];w.startsWith(`${_}-`)&&m.push([w,E,!1,w.split("-")])}});const v={...i};return h.memoizedProps&&h.memoizedProps.args&&(v.args=h.memoizedProps.args),h.memoizedProps&&h.memoizedProps.attach&&(v.attach=h.memoizedProps.attach),{memoized:v,changes:m}}function Eg(r,e){var t,n,i;const s=(t=r.__r3f)!=null?t:{},o=s.root,a=(n=o==null||o.getState==null?void 0:o.getState())!=null?n:{},{memoized:l,changes:c}=rO(e)?e:yT(r,e),u=s.eventCount;r.__r3f&&(r.__r3f.memoizedProps=l);for(let p=0;pw[E],r),!(x&&x.set))){const[w,...E]=y.reverse();g=E.reverse().reduce((b,M)=>b[M],r),m=w}if(v===gT+"remove")if(g.constructor){let w=Cw.get(g.constructor);w||(w=new g.constructor,Cw.set(g.constructor,w)),v=w[m]}else v=0;if(_)v?s.handlers[m]=v:delete s.handlers[m],s.eventCount=Object.keys(s.handlers).length;else if(x&&x.set&&(x.copy||x instanceof ga)){if(Array.isArray(v))x.fromArray?x.fromArray(v):x.set(...v);else if(x.copy&&v&&v.constructor&&x.constructor===v.constructor)x.copy(v);else if(v!==void 0){const w=x instanceof Ke;!w&&x.setScalar?x.setScalar(v):x instanceof ga&&v instanceof ga?x.mask=v.mask:x.set(v),!fT()&&!a.linear&&w&&x.convertSRGBToLinear()}}else if(g[m]=v,g[m]instanceof Sn&&g[m].format===Bi&&g[m].type===os){const w=g[m];wg(w)&&wg(a.gl)?w.colorSpace=a.gl.outputColorSpace:w.encoding=a.gl.outputEncoding}Il(r)}if(s.parent&&a.internal&&r.raycast&&u!==s.eventCount){const p=a.internal.interaction.indexOf(r);p>-1&&a.internal.interaction.splice(p,1),s.eventCount&&a.internal.interaction.push(r)}return!(c.length===1&&c[0][0]==="onUpdate")&&c.length&&(i=r.__r3f)!=null&&i.parent&&vv(r),r}function Il(r){var e,t;const n=(e=r.__r3f)==null||(t=e.root)==null||t.getState==null?void 0:t.getState();n&&n.internal.frames===0&&n.invalidate()}function vv(r){r.onUpdate==null||r.onUpdate(r)}function oO(r,e){r.manual||(dT(r)?(r.left=e.width/-2,r.right=e.width/2,r.top=e.height/2,r.bottom=e.height/-2):r.aspect=e.width/e.height,r.updateProjectionMatrix(),r.updateMatrixWorld())}function Qf(r){return(r.eventObject||r.object).uuid+"/"+r.index+r.instanceId}function aO(){var r;const e=typeof self<"u"&&self||typeof window<"u"&&window;if(!e)return Fl.DefaultEventPriority;switch((r=e.event)==null?void 0:r.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Fl.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Fl.ContinuousEventPriority;default:return Fl.DefaultEventPriority}}function _T(r,e,t,n){const i=t.get(e);i&&(t.delete(e),t.size===0&&(r.delete(n),i.target.releasePointerCapture(n)))}function lO(r,e){const{internal:t}=r.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,i)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(i)}),t.capturedMap.forEach((n,i)=>{_T(t.capturedMap,e,n,i)})}function cO(r){function e(l){const{internal:c}=r.getState(),u=l.offsetX-c.initialClick[0],h=l.offsetY-c.initialClick[1];return Math.round(Math.sqrt(u*u+h*h))}function t(l){return l.filter(c=>["Move","Over","Enter","Out","Leave"].some(u=>{var h;return(h=c.__r3f)==null?void 0:h.handlers["onPointer"+u]}))}function n(l,c){const u=r.getState(),h=new Set,p=[],m=c?c(u.internal.interaction):u.internal.interaction;for(let g=0;g{const w=zc(g.object),E=zc(x.object);return!w||!E?g.distance-x.distance:E.events.priority-w.events.priority||g.distance-x.distance}).filter(g=>{const x=Qf(g);return h.has(x)?!1:(h.add(x),!0)});u.events.filter&&(_=u.events.filter(_,u));for(const g of _){let x=g.object;for(;x;){var y;(y=x.__r3f)!=null&&y.eventCount&&p.push({...g,eventObject:x}),x=x.parent}}if("pointerId"in l&&u.internal.capturedMap.has(l.pointerId))for(let g of u.internal.capturedMap.get(l.pointerId).values())h.has(Qf(g.intersection))||p.push(g.intersection);return p}function i(l,c,u,h){const p=r.getState();if(l.length){const m={stopped:!1};for(const v of l){const _=zc(v.object)||p,{raycaster:y,pointer:g,camera:x,internal:w}=_,E=new Y(g.x,g.y,0).unproject(x),b=L=>{var F,N;return(F=(N=w.capturedMap.get(L))==null?void 0:N.has(v.eventObject))!=null?F:!1},M=L=>{const F={intersection:v,target:c.target};w.capturedMap.has(L)?w.capturedMap.get(L).set(v.eventObject,F):w.capturedMap.set(L,new Map([[v.eventObject,F]])),c.target.setPointerCapture(L)},A=L=>{const F=w.capturedMap.get(L);F&&_T(w.capturedMap,v.eventObject,F,L)};let P={};for(let L in c){let F=c[L];typeof F!="function"&&(P[L]=F)}let C={...v,...P,pointer:g,intersections:l,stopped:m.stopped,delta:u,unprojectedPoint:E,ray:y.ray,camera:x,stopPropagation(){const L="pointerId"in c&&w.capturedMap.get(c.pointerId);if((!L||L.has(v.eventObject))&&(C.stopped=m.stopped=!0,w.hovered.size&&Array.from(w.hovered.values()).find(F=>F.eventObject===v.eventObject))){const F=l.slice(0,l.indexOf(v));s([...F,v])}},target:{hasPointerCapture:b,setPointerCapture:M,releasePointerCapture:A},currentTarget:{hasPointerCapture:b,setPointerCapture:M,releasePointerCapture:A},nativeEvent:c};if(h(C),m.stopped===!0)break}}return l}function s(l){const{internal:c}=r.getState();for(const u of c.hovered.values())if(!l.length||!l.find(h=>h.object===u.object&&h.index===u.index&&h.instanceId===u.instanceId)){const p=u.eventObject.__r3f,m=p==null?void 0:p.handlers;if(c.hovered.delete(Qf(u)),p!=null&&p.eventCount){const v={...u,intersections:l};m.onPointerOut==null||m.onPointerOut(v),m.onPointerLeave==null||m.onPointerLeave(v)}}}function o(l,c){for(let u=0;us([]);case"onLostPointerCapture":return c=>{const{internal:u}=r.getState();"pointerId"in c&&u.capturedMap.has(c.pointerId)&&requestAnimationFrame(()=>{u.capturedMap.has(c.pointerId)&&(u.capturedMap.delete(c.pointerId),s([]))})}}return function(u){const{onPointerMissed:h,internal:p}=r.getState();p.lastEvent.current=u;const m=l==="onPointerMove",v=l==="onClick"||l==="onContextMenu"||l==="onDoubleClick",y=n(u,m?t:void 0),g=v?e(u):0;l==="onPointerDown"&&(p.initialClick=[u.offsetX,u.offsetY],p.initialHits=y.map(w=>w.eventObject)),v&&!y.length&&g<=2&&(o(u,p.interaction),h&&h(u)),m&&s(y);function x(w){const E=w.eventObject,b=E.__r3f,M=b==null?void 0:b.handlers;if(b!=null&&b.eventCount)if(m){if(M.onPointerOver||M.onPointerEnter||M.onPointerOut||M.onPointerLeave){const A=Qf(w),P=p.hovered.get(A);P?P.stopped&&w.stopPropagation():(p.hovered.set(A,w),M.onPointerOver==null||M.onPointerOver(w),M.onPointerEnter==null||M.onPointerEnter(w))}M.onPointerMove==null||M.onPointerMove(w)}else{const A=M[l];A?(!v||p.initialHits.includes(E))&&(o(u,p.interaction.filter(P=>!p.initialHits.includes(P))),A(w)):v&&p.initialHits.includes(E)&&o(u,p.interaction.filter(P=>!p.initialHits.includes(P)))}}i(y,u,g,x)}}return{handlePointer:a}}const xT=r=>!!(r!=null&&r.render),wT=K.createContext(null),uO=(r,e)=>{const t=H3((a,l)=>{const c=new Y,u=new Y,h=new Y;function p(g=l().camera,x=u,w=l().size){const{width:E,height:b,top:M,left:A}=w,P=E/b;x instanceof Y?h.copy(x):h.set(...x);const C=g.getWorldPosition(c).distanceTo(h);if(dT(g))return{width:E/g.zoom,height:b/g.zoom,top:M,left:A,factor:1,distance:C,aspect:P};{const L=g.fov*Math.PI/180,F=2*Math.tan(L/2)*C,N=F*(E/b);return{width:N,height:F,top:M,left:A,factor:E/N,distance:C,aspect:P}}}let m;const v=g=>a(x=>({performance:{...x.performance,current:g}})),_=new De;return{set:a,get:l,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},xr:null,scene:null,invalidate:(g=1)=>r(l(),g),advance:(g,x)=>e(g,x,l()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new Py,pointer:_,mouse:_,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const g=l();m&&clearTimeout(m),g.performance.current!==g.performance.min&&v(g.performance.min),m=setTimeout(()=>v(l().performance.max),g.performance.debounce)}},size:{width:0,height:0,top:0,left:0,updateStyle:!1},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:g=>a(x=>({...x,events:{...x.events,...g}})),setSize:(g,x,w,E,b)=>{const M=l().camera,A={width:g,height:x,top:E||0,left:b||0,updateStyle:w};a(P=>({size:A,viewport:{...P.viewport,...p(M,u,A)}}))},setDpr:g=>a(x=>{const w=vT(g);return{viewport:{...x.viewport,dpr:w,initialDpr:x.viewport.initialDpr||w}}}),setFrameloop:(g="always")=>{const x=l().clock;x.stop(),x.elapsedTime=0,g!=="never"&&(x.start(),x.elapsedTime=0),a(()=>({frameloop:g}))},previousRoot:void 0,internal:{active:!1,priority:0,frames:0,lastEvent:K.createRef(),interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,subscribe:(g,x,w)=>{const E=l().internal;return E.priority=E.priority+(x>0?1:0),E.subscribers.push({ref:g,priority:x,store:w}),E.subscribers=E.subscribers.sort((b,M)=>b.priority-M.priority),()=>{const b=l().internal;b!=null&&b.subscribers&&(b.priority=b.priority-(x>0?1:0),b.subscribers=b.subscribers.filter(M=>M.ref!==g))}}}}}),n=t.getState();let i=n.size,s=n.viewport.dpr,o=n.camera;return t.subscribe(()=>{const{camera:a,size:l,viewport:c,gl:u,set:h}=t.getState();if(l!==i||c.dpr!==s){var p;i=l,s=c.dpr,oO(a,l),u.setPixelRatio(c.dpr);const m=(p=l.updateStyle)!=null?p:typeof HTMLCanvasElement<"u"&&u.domElement instanceof HTMLCanvasElement;u.setSize(l.width,l.height,m)}a!==o&&(o=a,h(m=>({viewport:{...m.viewport,...m.viewport.getCurrentViewport(a)}})))}),t.subscribe(a=>r(a)),t};function hO(r,e){const t={callback:r};return e.add(t),()=>void e.delete(t)}let ed,ST=new Set,fO=new Set,dO=new Set;const pO=r=>hO(r,ST);function bg(r,e){if(r.size)for(const{callback:t}of r.values())t(e)}function Bc(r,e){switch(r){case"before":return bg(ST,e);case"after":return bg(fO,e);case"tail":return bg(dO,e)}}let Mg,Tg;function Ag(r,e,t){let n=e.clock.getDelta();for(e.frameloop==="never"&&typeof r=="number"&&(n=r-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=r),Mg=e.internal.subscribers,ed=0;ed0)&&!((c=i.gl.xr)!=null&&c.isPresenting)&&(t+=Ag(l,i))}if(Bc("after",l),t===0)return Bc("tail",l),e=!1,cancelAnimationFrame(n)}function o(l,c=1){var u;if(!l)return r.forEach(h=>o(h.store.getState()),c);(u=l.gl.xr)!=null&&u.isPresenting||!l.internal.active||l.frameloop==="never"||(l.internal.frames=Math.min(60,l.internal.frames+c),e||(e=!0,requestAnimationFrame(s)))}function a(l,c=!0,u,h){if(c&&Bc("before",l),u)Ag(l,u,h);else for(const p of r.values())Ag(l,p.store.getState());c&&Bc("after",l)}return{loop:s,invalidate:o,advance:a}}function ET(){const r=K.useContext(wT);if(!r)throw new Error("R3F: Hooks can only be used within the Canvas component!");return r}function Bn(r=t=>t,e){return ET()(r,e)}function Ep(r,e=0){const t=ET(),n=t.getState().internal.subscribe,i=pT(r);return hh(()=>n(i,e,t),[e,n,t]),null}const jl=new Map,{invalidate:Lw,advance:Iw}=mO(jl),{reconciler:Nd,applyProps:oa}=tO(jl,aO),yl={objects:"shallow",strict:!1},gO=(r,e)=>{const t=typeof r=="function"?r(e):r;return xT(t)?t:new uy({powerPreference:"high-performance",canvas:e,antialias:!0,alpha:!0,...r})};function vO(r,e){if(e)return e;if(typeof HTMLCanvasElement<"u"&&r instanceof HTMLCanvasElement&&r.parentElement){const{width:t,height:n,top:i,left:s}=r.parentElement.getBoundingClientRect();return{width:t,height:n,top:i,left:s}}else if(typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas)return{width:r.width,height:r.height,top:0,left:0};return{width:0,height:0,top:0,left:0}}function yO(r){const e=jl.get(r),t=e==null?void 0:e.fiber,n=e==null?void 0:e.store;e&&console.warn("R3F.createRoot should only be called once!");const i=typeof reportError=="function"?reportError:console.error,s=n||uO(Lw,Iw),o=t||Nd.createContainer(s,Fl.ConcurrentRoot,null,!1,null,"",i,null);e||jl.set(r,{fiber:o,store:s});let a,l=!1,c;return{configure(u={}){let{gl:h,size:p,scene:m,events:v,onCreated:_,shadows:y=!1,linear:g=!1,flat:x=!1,legacy:w=!1,orthographic:E=!1,frameloop:b="always",dpr:M=[1,2],performance:A,raycaster:P,camera:C,onPointerMissed:L}=u,F=s.getState(),N=F.gl;F.gl||F.set({gl:N=gO(h,r)});let I=F.raycaster;I||F.set({raycaster:I=new Uy});const{params:X,...q}=P||{};if(hn.equ(q,I,yl)||oa(I,{...q}),hn.equ(X,I.params,yl)||oa(I,{params:{...I.params,...X}}),!F.camera||F.camera===c&&!hn.equ(c,C,yl)){c=C;const D=C instanceof rh,V=D?C:E?new Pa(0,0,0,0,.1,1e3):new zn(75,0,.1,1e3);D||(V.position.z=5,C&&oa(V,C),!F.camera&&!(C!=null&&C.rotation)&&V.lookAt(0,0,0)),F.set({camera:V})}if(!F.scene){let D;m instanceof ku?D=m:(D=new ku,m&&oa(D,m)),F.set({scene:Ll(D)})}if(!F.xr){const D=(ee,ie)=>{const ue=s.getState();ue.frameloop!=="never"&&Iw(ee,!0,ue,ie)},V=()=>{const ee=s.getState();ee.gl.xr.enabled=ee.gl.xr.isPresenting,ee.gl.xr.setAnimationLoop(ee.gl.xr.isPresenting?D:null),ee.gl.xr.isPresenting||Lw(ee)},Z={connect(){const ee=s.getState().gl;ee.xr.addEventListener("sessionstart",V),ee.xr.addEventListener("sessionend",V)},disconnect(){const ee=s.getState().gl;ee.xr.removeEventListener("sessionstart",V),ee.xr.removeEventListener("sessionend",V)}};N.xr&&Z.connect(),F.set({xr:Z})}if(N.shadowMap){const D=N.shadowMap.enabled,V=N.shadowMap.type;if(N.shadowMap.enabled=!!y,hn.boo(y))N.shadowMap.type=gu;else if(hn.str(y)){var W;const Z={basic:ub,percentage:qd,soft:gu,variance:Or};N.shadowMap.type=(W=Z[y])!=null?W:gu}else hn.obj(y)&&Object.assign(N.shadowMap,y);(D!==N.shadowMap.enabled||V!==N.shadowMap.type)&&(N.shadowMap.needsUpdate=!0)}const O=fT();O&&("enabled"in O?O.enabled=!w:"legacyMode"in O&&(O.legacyMode=w)),oa(N,{outputEncoding:g?3e3:3001,toneMapping:x?zr:Xv}),F.legacy!==w&&F.set(()=>({legacy:w})),F.linear!==g&&F.set(()=>({linear:g})),F.flat!==x&&F.set(()=>({flat:x})),h&&!hn.fun(h)&&!xT(h)&&!hn.equ(h,N,yl)&&oa(N,h),v&&!F.events.handlers&&F.set({events:v(s)});const B=vO(r,p);return hn.equ(B,F.size,yl)||F.setSize(B.width,B.height,B.updateStyle,B.top,B.left),M&&F.viewport.dpr!==vT(M)&&F.setDpr(M),F.frameloop!==b&&F.setFrameloop(b),F.onPointerMissed||F.set({onPointerMissed:L}),A&&!hn.equ(A,F.performance,yl)&&F.set(D=>({performance:{...D.performance,...A}})),a=_,l=!0,this},render(u){return l||this.configure(),Nd.updateContainer(K.createElement(_O,{store:s,children:u,onCreated:a,rootElement:r}),o,null,()=>{}),s},unmount(){bT(r)}}}function _O({store:r,children:e,onCreated:t,rootElement:n}){return hh(()=>{const i=r.getState();i.set(s=>({internal:{...s.internal,active:!0}})),t&&t(i),r.getState().events.connected||i.events.connect==null||i.events.connect(n)},[]),K.createElement(wT.Provider,{value:r},e)}function bT(r,e){const t=jl.get(r),n=t==null?void 0:t.fiber;if(n){const i=t==null?void 0:t.store.getState();i&&(i.internal.active=!1),Nd.updateContainer(null,n,null,()=>{i&&setTimeout(()=>{try{var s,o,a,l;i.events.disconnect==null||i.events.disconnect(),(s=i.gl)==null||(o=s.renderLists)==null||o.dispose==null||o.dispose(),(a=i.gl)==null||a.forceContextLoss==null||a.forceContextLoss(),(l=i.gl)!=null&&l.xr&&i.xr.disconnect(),sO(i),jl.delete(r)}catch{}},500)})}}Nd.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:K.version});function Ta(){return Ta=Object.assign?Object.assign.bind():function(r){for(var e=1;e{window.clearTimeout(t),t=window.setTimeout(()=>r(...n),e)}}function xO({debounce:r,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const i=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!i)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,o]=K.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),a=K.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),l=r?typeof r=="number"?r:r.scroll:null,c=r?typeof r=="number"?r:r.resize:null,u=K.useRef(!1);K.useEffect(()=>(u.current=!0,()=>void(u.current=!1)));const[h,p,m]=K.useMemo(()=>{const g=()=>{if(!a.current.element)return;const{left:x,top:w,width:E,height:b,bottom:M,right:A,x:P,y:C}=a.current.element.getBoundingClientRect(),L={left:x,top:w,width:E,height:b,bottom:M,right:A,x:P,y:C};a.current.element instanceof HTMLElement&&n&&(L.height=a.current.element.offsetHeight,L.width=a.current.element.offsetWidth),Object.freeze(L),u.current&&!bO(a.current.lastBounds,L)&&o(a.current.lastBounds=L)};return[g,c?Dw(g,c):g,l?Dw(g,l):g]},[o,n,l,c]);function v(){a.current.scrollContainers&&(a.current.scrollContainers.forEach(g=>g.removeEventListener("scroll",m,!0)),a.current.scrollContainers=null),a.current.resizeObserver&&(a.current.resizeObserver.disconnect(),a.current.resizeObserver=null),a.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",a.current.orientationHandler))}function _(){a.current.element&&(a.current.resizeObserver=new i(m),a.current.resizeObserver.observe(a.current.element),e&&a.current.scrollContainers&&a.current.scrollContainers.forEach(g=>g.addEventListener("scroll",m,{capture:!0,passive:!0})),a.current.orientationHandler=()=>{m()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",a.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",a.current.orientationHandler))}const y=g=>{!g||g===a.current.element||(v(),a.current.element=g,a.current.scrollContainers=MT(g),_())};return SO(m,!!e),wO(p),K.useEffect(()=>{v(),_()},[e,m,p]),K.useEffect(()=>v,[]),[y,s,h]}function wO(r){K.useEffect(()=>{const e=r;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[r])}function SO(r,e){K.useEffect(()=>{if(e){const t=r;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[r,e])}function MT(r){const e=[];if(!r||r===document.body)return e;const{overflow:t,overflowX:n,overflowY:i}=window.getComputedStyle(r);return[t,n,i].some(s=>s==="auto"||s==="scroll")&&e.push(r),[...e,...MT(r.parentElement)]}const EO=["x","y","top","bottom","left","right","width","height"],bO=(r,e)=>EO.every(t=>r[t]===e[t]);var MO=Object.defineProperty,TO=Object.defineProperties,AO=Object.getOwnPropertyDescriptors,Uw=Object.getOwnPropertySymbols,CO=Object.prototype.hasOwnProperty,RO=Object.prototype.propertyIsEnumerable,Ow=(r,e,t)=>e in r?MO(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Nw=(r,e)=>{for(var t in e||(e={}))CO.call(e,t)&&Ow(r,t,e[t]);if(Uw)for(var t of Uw(e))RO.call(e,t)&&Ow(r,t,e[t]);return r},PO=(r,e)=>TO(r,AO(e)),Fw,kw;typeof window<"u"&&((Fw=window.document)!=null&&Fw.createElement||((kw=window.navigator)==null?void 0:kw.product)==="ReactNative")?K.useLayoutEffect:K.useEffect;function TT(r,e,t){if(!r)return;if(t(r)===!0)return r;let n=r.child;for(;n;){const i=TT(n,e,t);if(i)return i;n=n.sibling}}function AT(r){try{return Object.defineProperties(r,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return r}}const zw=console.error;console.error=function(){const r=[...arguments].join("");if(r!=null&&r.startsWith("Warning:")&&r.includes("useContext")){console.error=zw;return}return zw.apply(this,arguments)};const Ny=AT(K.createContext(null));class CT extends K.Component{render(){return K.createElement(Ny.Provider,{value:this._reactInternals},this.props.children)}}function LO(){const r=K.useContext(Ny);if(r===null)throw new Error("its-fine: useFiber must be called within a !");const e=K.useId();return K.useMemo(()=>{for(const n of[r,r==null?void 0:r.alternate]){if(!n)continue;const i=TT(n,!1,s=>{let o=s.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(i)return i}},[r,e])}function IO(){const r=LO(),[e]=K.useState(()=>new Map);e.clear();let t=r;for(;t;){if(t.type&&typeof t.type=="object"){const i=t.type._context===void 0&&t.type.Provider===t.type?t.type:t.type._context;i&&i!==Ny&&!e.has(i)&&e.set(i,K.useContext(AT(i)))}t=t.return}return e}function DO(){const r=IO();return K.useMemo(()=>Array.from(r.keys()).reduce((e,t)=>n=>K.createElement(e,null,K.createElement(t.Provider,PO(Nw({},n),{value:r.get(t)}))),e=>K.createElement(CT,Nw({},e))),[r])}const Cg={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function UO(r){const{handlePointer:e}=cO(r);return{priority:1,enabled:!0,compute(t,n,i){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(Cg).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:i}=r.getState();(t=i.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(i.lastEvent.current)},connect:t=>{var n;const{set:i,events:s}=r.getState();s.disconnect==null||s.disconnect(),i(o=>({events:{...o.events,connected:t}})),Object.entries((n=s.handlers)!=null?n:[]).forEach(([o,a])=>{const[l,c]=Cg[o];t.addEventListener(l,a,{passive:c})})},disconnect:()=>{const{set:t,events:n}=r.getState();if(n.connected){var i;Object.entries((i=n.handlers)!=null?i:[]).forEach(([s,o])=>{if(n&&n.connected instanceof HTMLElement){const[a]=Cg[s];n.connected.removeEventListener(a,o)}}),t(s=>({events:{...s.events,connected:void 0}}))}}}}const OO=K.forwardRef(function({children:e,fallback:t,resize:n,style:i,gl:s,events:o=UO,eventSource:a,eventPrefix:l,shadows:c,linear:u,flat:h,legacy:p,orthographic:m,frameloop:v,dpr:_,performance:y,raycaster:g,camera:x,onPointerMissed:w,onCreated:E,...b},M){K.useMemo(()=>hT(uT),[]);const A=DO(),[P,C]=xO({scroll:!0,debounce:{scroll:50,resize:0},...n}),L=K.useRef(null),F=K.useRef(null);K.useImperativeHandle(M,()=>L.current);const N=pT(w),[I,X]=K.useState(!1),[q,W]=K.useState(!1);if(I)throw I;if(q)throw q;const O=K.useRef(null);hh(()=>{const G=L.current;C.width>0&&C.height>0&&G&&(O.current||(O.current=yO(G)),O.current.configure({gl:s,events:o,shadows:c,linear:u,flat:h,legacy:p,orthographic:m,frameloop:v,dpr:_,performance:y,raycaster:g,camera:x,size:C,onPointerMissed:(...B)=>N.current==null?void 0:N.current(...B),onCreated:B=>{B.events.connect==null||B.events.connect(a?nO(a)?a.current:a:F.current),l&&B.setEvents({compute:(D,V)=>{const Z=D[l+"X"],ee=D[l+"Y"];V.pointer.set(Z/V.size.width*2-1,-(ee/V.size.height)*2+1),V.raycaster.setFromCamera(V.pointer,V.camera)}}),E==null||E(B)}}),O.current.render(K.createElement(A,null,K.createElement(mT,{set:W},K.createElement(K.Suspense,{fallback:K.createElement(iO,{set:X})},e)))))}),K.useEffect(()=>{const G=L.current;if(G)return()=>bT(G)},[]);const k=a?"none":"auto";return K.createElement("div",Ta({ref:F,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:k,...i}},b),K.createElement("div",{ref:P,style:{width:"100%",height:"100%"}},K.createElement("canvas",{ref:L,style:{display:"block"}},t)))}),NO=K.forwardRef(function(e,t){return K.createElement(CT,null,K.createElement(OO,Ta({},e,{ref:t})))});function FO(r,e,t){var n,i=1;r==null&&(r=0),e==null&&(e=0),t==null&&(t=0);function s(){var o,a=n.length,l,c=0,u=0,h=0;for(o=0;o=(l=(o+a)/2))?o=l:a=l,n=i,!(i=i[h=+u]))return n[h]=s,r;if(c=+r._x.call(null,i.data),e===c)return s.next=i,n?n[h]=s:r._root=s,r;do n=n?n[h]=new Array(2):r._root=new Array(2),(u=e>=(l=(o+a)/2))?o=l:a=l;while((h=+u)==(p=+(c>=l)));return n[p]=i,n[h]=s,r}function zO(r){Array.isArray(r)||(r=Array.from(r));const e=r.length,t=new Float64Array(e);let n=1/0,i=-1/0;for(let s=0,o;si&&(i=o));if(n>i)return this;this.cover(n).cover(i);for(let s=0;sr||r>=t;)switch(o=+(ro||(s=c.x1)=h))&&(c=a[a.length-1],a[a.length-1]=a[a.length-1-u],a[a.length-1-u]=c)}else{var p=Math.abs(r-+this._x.call(null,l.data));p=(c=(o+a)/2))?o=c:a=c,e=t,!(t=t[h=+u]))return this;if(!t.length)break;e[h+1&1]&&(n=e,p=h)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,i?(s?i.next=s:delete i.next,this):e?(s?e[h]=s:delete e[h],(t=e[0]||e[1])&&t===(e[1]||e[0])&&!t.length&&(n?n[p]=t:this._root=t),this):(this._root=s,this)}function XO(r){for(var e=0,t=r.length;e=(h=(a+c)/2))?a=h:c=h,(y=t>=(p=(l+u)/2))?l=p:u=p,i=s,!(s=s[g=y<<1|_]))return i[g]=o,r;if(m=+r._x.call(null,s.data),v=+r._y.call(null,s.data),e===m&&t===v)return o.next=s,i?i[g]=o:r._root=o,r;do i=i?i[g]=new Array(4):r._root=new Array(4),(_=e>=(h=(a+c)/2))?a=h:c=h,(y=t>=(p=(l+u)/2))?l=p:u=p;while((g=y<<1|_)===(x=(v>=p)<<1|m>=h));return i[x]=s,i[g]=o,r}function QO(r){var e,t,n=r.length,i,s,o=new Array(n),a=new Array(n),l=1/0,c=1/0,u=-1/0,h=-1/0;for(t=0;tu&&(u=i),sh&&(h=s));if(l>u||c>h)return this;for(this.cover(l,c).cover(u,h),t=0;tr||r>=i||n>e||e>=s;)switch(c=(eu||(a=v.y0)>h||(l=v.x1)=g)<<1|r>=y)&&(v=p[p.length-1],p[p.length-1]=p[p.length-1-_],p[p.length-1-_]=v)}else{var x=r-+this._x.call(null,m.data),w=e-+this._y.call(null,m.data),E=x*x+w*w;if(E=(p=(o+l)/2))?o=p:l=p,(_=h>=(m=(a+c)/2))?a=m:c=m,e=t,!(t=t[y=_<<1|v]))return this;if(!t.length)break;(e[y+1&3]||e[y+2&3]||e[y+3&3])&&(n=e,g=y)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,i?(s?i.next=s:delete i.next,this):e?(s?e[y]=s:delete e[y],(t=e[0]||e[1]||e[2]||e[3])&&t===(e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[g]=t:this._root=t),this):(this._root=s,this)}function sN(r){for(var e=0,t=r.length;e=(v=(l+h)/2))?l=v:h=v,(b=t>=(_=(c+p)/2))?c=_:p=_,(M=n>=(y=(u+m)/2))?u=y:m=y,s=o,!(o=o[A=M<<2|b<<1|E]))return s[A]=a,r;if(g=+r._x.call(null,o.data),x=+r._y.call(null,o.data),w=+r._z.call(null,o.data),e===g&&t===x&&n===w)return a.next=o,s?s[A]=a:r._root=a,r;do s=s?s[A]=new Array(8):r._root=new Array(8),(E=e>=(v=(l+h)/2))?l=v:h=v,(b=t>=(_=(c+p)/2))?c=_:p=_,(M=n>=(y=(u+m)/2))?u=y:m=y;while((A=M<<2|b<<1|E)===(P=(w>=y)<<2|(x>=_)<<1|g>=v));return s[P]=o,s[A]=a,r}function mN(r){Array.isArray(r)||(r=Array.from(r));const e=r.length,t=new Float64Array(e),n=new Float64Array(e),i=new Float64Array(e);let s=1/0,o=1/0,a=1/0,l=-1/0,c=-1/0,u=-1/0;for(let h=0,p,m,v,_;hl&&(l=m),vc&&(c=v),_u&&(u=_));if(s>l||o>c||a>u)return this;this.cover(s,o,a).cover(l,c,u);for(let h=0;hr||r>=o||i>e||e>=a||s>t||t>=l;)switch(p=(tv||(c=w.y0)>_||(u=w.z0)>y||(h=w.x1)=A)<<2|(e>=M)<<1|r>=b)&&(w=g[g.length-1],g[g.length-1]=g[g.length-1-E],g[g.length-1-E]=w)}else{var P=r-+this._x.call(null,x.data),C=e-+this._y.call(null,x.data),L=t-+this._z.call(null,x.data),F=P*P+C*C+L*L;if(FMath.sqrt((r-n)**2+(e-i)**2+(t-s)**2);function wN(r,e,t,n){const i=[],s=r-n,o=e-n,a=t-n,l=r+n,c=e+n,u=t+n;return this.visit((h,p,m,v,_,y,g)=>{if(!h.length)do{const x=h.data;xN(r,e,t,this._x(x),this._y(x),this._z(x))<=n&&i.push(x)}while(h=h.next);return p>l||m>c||v>u||_=(_=(o+c)/2))?o=_:c=_,(w=m>=(y=(a+u)/2))?a=y:u=y,(E=v>=(g=(l+h)/2))?l=g:h=g,e=t,!(t=t[b=E<<2|w<<1|x]))return this;if(!t.length)break;(e[b+1&7]||e[b+2&7]||e[b+3&7]||e[b+4&7]||e[b+5&7]||e[b+6&7]||e[b+7&7])&&(n=e,M=b)}for(;t.data!==r;)if(i=t,!(t=t.next))return this;return(s=t.next)&&delete t.next,i?(s?i.next=s:delete i.next,this):e?(s?e[b]=s:delete e[b],(t=e[0]||e[1]||e[2]||e[3]||e[4]||e[5]||e[6]||e[7])&&t===(e[7]||e[6]||e[5]||e[4]||e[3]||e[2]||e[1]||e[0])&&!t.length&&(n?n[M]=t:this._root=t),this):(this._root=s,this)}function EN(r){for(var e=0,t=r.length;e1&&(_=m.y+m.vy),t>2&&(y=m.z+m.vz),p.visit(E);function E(b,M,A,P,C,L,F){var N=[M,A,P,C,L,F],I=N[0],X=N[1],q=N[2],W=N[t],O=N[t+1],k=N[t+2],G=b.data,B=b.r,D=g+B;if(G){if(G.index>m.index){var V=v-G.x-G.vx,Z=t>1?_-G.y-G.vy:0,ee=t>2?y-G.z-G.vz:0,ie=V*V+Z*Z+ee*ee;ie1&&Z===0&&(Z=xr(i),ie+=Z*Z),t>2&&ee===0&&(ee=xr(i),ie+=ee*ee),ie=(D-(ie=Math.sqrt(ie)))/ie*s,m.vx+=(V*=ie)*(D=(B*=B)/(x+B)),t>1&&(m.vy+=(Z*=ie)*D),t>2&&(m.vz+=(ee*=ie)*D),G.vx-=V*(D=1-D),t>1&&(G.vy-=Z*D),t>2&&(G.vz-=ee*D))}return}return I>v+D||W1&&(X>_+D||O<_-D)||t>2&&(q>y+D||ku.r&&(u.r=u[h].r)}function c(){if(e){var u,h=e.length,p;for(n=new Array(h),u=0;utypeof p=="function")||Math.random,t=h.find(p=>[1,2,3].includes(p))||2,c()},a.iterations=function(u){return arguments.length?(o=+u,a):o},a.strength=function(u){return arguments.length?(s=+u,a):s},a.radius=function(u){return arguments.length?(r=typeof u=="function"?u:xn(+u),c(),a):r},a}function ON(r){return r.index}function Ww(r,e){var t=r.get(e);if(!t)throw new Error("node not found: "+e);return t}function DT(r){var e=ON,t=p,n,i=xn(30),s,o,a,l,c,u,h=1;r==null&&(r=[]);function p(g){return 1/Math.min(l[g.source.index],l[g.target.index])}function m(g){for(var x=0,w=r.length;x1&&(C=A.y+A.vy-M.y-M.vy||xr(u)),a>2&&(L=A.z+A.vz-M.z-M.vz||xr(u)),F=Math.sqrt(P*P+C*C+L*L),F=(F-s[E])/F*g*n[E],P*=F,C*=F,L*=F,A.vx-=P*(N=c[E]),a>1&&(A.vy-=C*N),a>2&&(A.vz-=L*N),M.vx+=P*(N=1-N),a>1&&(M.vy+=C*N),a>2&&(M.vz+=L*N)}function v(){if(o){var g,x=o.length,w=r.length,E=new Map(o.map((M,A)=>[e(M,A,o),M])),b;for(g=0,l=new Array(x);gtypeof w=="function")||Math.random,a=x.find(w=>[1,2,3].includes(w))||2,v()},m.links=function(g){return arguments.length?(r=g,v(),m):r},m.id=function(g){return arguments.length?(e=g,m):e},m.iterations=function(g){return arguments.length?(h=+g,m):h},m.strength=function(g){return arguments.length?(t=typeof g=="function"?g:xn(+g),_(),m):t},m.distance=function(g){return arguments.length?(i=typeof g=="function"?g:xn(+g),y(),m):i},m}var NN={value:()=>{}};function UT(){for(var r=0,e=arguments.length,t={},n;r=0&&(n=t.slice(i+1),t=t.slice(0,i)),t&&!e.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:n}})}Md.prototype=UT.prototype={constructor:Md,on:function(r,e){var t=this._,n=FN(r+"",t),i,s=-1,o=n.length;if(arguments.length<2){for(;++s0)for(var t=new Array(i),n=0,i,s;n=0&&r._call.call(void 0,e),r=r._next;--Yl}function jw(){Aa=(kd=Yu.now())+bp,Yl=du=0;try{BN()}finally{Yl=0,HN(),Aa=0}}function GN(){var r=Yu.now(),e=r-kd;e>OT&&(bp-=e,kd=r)}function HN(){for(var r,e=Fd,t,n=1/0;e;)e._call?(n>e._time&&(n=e._time),r=e,e=e._next):(t=e._next,e._next=null,e=r?r._next=t:Fd=t);pu=r,_v(n)}function _v(r){if(!Yl){du&&(du=clearTimeout(du));var e=r-Aa;e>24?(r<1/0&&(du=setTimeout(jw,r-Yu.now()-bp)),Gc&&(Gc=clearInterval(Gc))):(Gc||(kd=Yu.now(),Gc=setInterval(GN,OT)),Yl=1,NT(jw))}}const VN=1664525,WN=1013904223,Yw=4294967296;function XN(){let r=1;return()=>(r=(VN*r+WN)%Yw)/Yw}var qw=3;function Pg(r){return r.x}function Zw(r){return r.y}function jN(r){return r.z}var YN=10,qN=Math.PI*(3-Math.sqrt(5)),ZN=Math.PI*20/(9+Math.sqrt(221));function zT(r,e){e=e||2;var t=Math.min(qw,Math.max(1,Math.round(e))),n,i=1,s=.001,o=1-Math.pow(s,1/300),a=0,l=.6,c=new Map,u=kT(m),h=UT("tick","end"),p=XN();r==null&&(r=[]);function m(){v(),h.call("tick",n),i1&&(E.fy==null?E.y+=E.vy*=l:(E.y=E.fy,E.vy=0)),t>2&&(E.fz==null?E.z+=E.vz*=l:(E.z=E.fz,E.vz=0));return n}function _(){for(var g=0,x=r.length,w;g1&&isNaN(w.y)||t>2&&isNaN(w.z)){var E=YN*(t>2?Math.cbrt(.5+g):t>1?Math.sqrt(.5+g):g),b=g*qN,M=g*ZN;t===1?w.x=E:t===2?(w.x=E*Math.cos(b),w.y=E*Math.sin(b)):(w.x=E*Math.sin(b)*Math.cos(M),w.y=E*Math.cos(b),w.z=E*Math.sin(b)*Math.sin(M))}(isNaN(w.vx)||t>1&&isNaN(w.vy)||t>2&&isNaN(w.vz))&&(w.vx=0,t>1&&(w.vy=0),t>2&&(w.vz=0))}}function y(g){return g.initialize&&g.initialize(r,p,t),g}return _(),n={tick:v,restart:function(){return u.restart(m),n},stop:function(){return u.stop(),n},numDimensions:function(g){return arguments.length?(t=Math.min(qw,Math.max(1,Math.round(g))),c.forEach(y),n):t},nodes:function(g){return arguments.length?(r=g,_(),c.forEach(y),n):r},alpha:function(g){return arguments.length?(i=+g,n):i},alphaMin:function(g){return arguments.length?(s=+g,n):s},alphaDecay:function(g){return arguments.length?(o=+g,n):+o},alphaTarget:function(g){return arguments.length?(a=+g,n):a},velocityDecay:function(g){return arguments.length?(l=1-g,n):1-l},randomSource:function(g){return arguments.length?(p=g,c.forEach(y),n):p},force:function(g,x){return arguments.length>1?(x==null?c.delete(g):c.set(g,y(x)),n):c.get(g)},find:function(){var g=Array.prototype.slice.call(arguments),x=g.shift()||0,w=(t>1?g.shift():null)||0,E=(t>2?g.shift():null)||0,b=g.shift()||1/0,M=0,A=r.length,P,C,L,F,N,I;for(b*=b,M=0;M1?(h.on(g,x),n):h.on(g)}}}function BT(){var r,e,t,n,i,s=xn(-30),o,a=1,l=1/0,c=.81;function u(v){var _,y=r.length,g=(e===1?Fy(r,Pg):e===2?zy(r,Pg,Zw):e===3?Gy(r,Pg,Zw,jN):null).visitAfter(p);for(i=v,_=0;_1&&(v.y=E/x),e>2&&(v.z=b/x)}else{y=v,y.x=y.data.x,e>1&&(y.y=y.data.y),e>2&&(y.z=y.data.z);do _+=o[y.data.index];while(y=y.next)}v.value=_}function m(v,_,y,g,x){if(!v.value)return!0;var w=[y,g,x][e-1],E=v.x-t.x,b=e>1?v.y-t.y:0,M=e>2?v.z-t.z:0,A=w-_,P=E*E+b*b+M*M;if(A*A/c1&&b===0&&(b=xr(n),P+=b*b),e>2&&M===0&&(M=xr(n),P+=M*M),P1&&(t.vy+=b*v.value*i/P),e>2&&(t.vz+=M*v.value*i/P)),!0;if(v.length||P>=l)return;(v.data!==t||v.next)&&(E===0&&(E=xr(n),P+=E*E),e>1&&b===0&&(b=xr(n),P+=b*b),e>2&&M===0&&(M=xr(n),P+=M*M),P1&&(t.vy+=b*A),e>2&&(t.vz+=M*A));while(v=v.next)}return u.initialize=function(v,..._){r=v,n=_.find(y=>typeof y=="function")||Math.random,e=_.find(y=>[1,2,3].includes(y))||2,h()},u.strength=function(v){return arguments.length?(s=typeof v=="function"?v:xn(+v),h(),u):s},u.distanceMin=function(v){return arguments.length?(a=v*v,u):Math.sqrt(a)},u.distanceMax=function(v){return arguments.length?(l=v*v,u):Math.sqrt(l)},u.theta=function(v){return arguments.length?(c=v*v,u):Math.sqrt(c)},u}function KN(r,e,t,n){var i,s,o=xn(.1),a,l;typeof r!="function"&&(r=xn(+r)),e==null&&(e=0),t==null&&(t=0),n==null&&(n=0);function c(h){for(var p=0,m=i.length;p1&&(v.vy+=y*w),s>2&&(v.vz+=g*w)}}function u(){if(i){var h,p=i.length;for(a=new Array(p),l=new Array(p),h=0;h[1,2,3].includes(m))||2,u()},c.strength=function(h){return arguments.length?(o=typeof h=="function"?h:xn(+h),u(),c):o},c.radius=function(h){return arguments.length?(r=typeof h=="function"?h:xn(+h),u(),c):r},c.x=function(h){return arguments.length?(e=+h,c):e},c.y=function(h){return arguments.length?(t=+h,c):t},c.z=function(h){return arguments.length?(n=+h,c):n},c}function xv(r){var e=xn(.1),t,n,i;typeof r!="function"&&(r=xn(r==null?0:+r));function s(a){for(var l=0,c=t.length,u;l=0;)e+=t[n].value;r.value=e}function QN(){return this.eachAfter(JN)}function eF(r,e){let t=-1;for(const n of this)r.call(e,n,++t,this);return this}function tF(r,e){for(var t=this,n=[t],i,s,o=-1;t=n.pop();)if(r.call(e,t,++o,this),i=t.children)for(s=i.length-1;s>=0;--s)n.push(i[s]);return this}function nF(r,e){for(var t=this,n=[t],i=[],s,o,a,l=-1;t=n.pop();)if(i.push(t),s=t.children)for(o=0,a=s.length;o=0;)t+=n[i].value;e.value=t})}function sF(r){return this.eachBefore(function(e){e.children&&e.children.sort(r)})}function oF(r){for(var e=this,t=aF(e,r),n=[e];e!==t;)e=e.parent,n.push(e);for(var i=n.length;r!==t;)n.splice(i,0,r),r=r.parent;return n}function aF(r,e){if(r===e)return r;var t=r.ancestors(),n=e.ancestors(),i=null;for(r=t.pop(),e=n.pop();r===e;)i=r,r=t.pop(),e=n.pop();return i}function lF(){for(var r=this,e=[r];r=r.parent;)e.push(r);return e}function cF(){return Array.from(this)}function uF(){var r=[];return this.eachBefore(function(e){e.children||r.push(e)}),r}function hF(){var r=this,e=[];return r.each(function(t){t!==r&&e.push({source:t.parent,target:t})}),e}function*fF(){var r=this,e,t=[r],n,i,s;do for(e=t.reverse(),t=[];r=e.pop();)if(yield r,n=r.children)for(i=0,s=n.length;i=0;--a)i.push(s=o[a]=new ql(o[a])),s.parent=n,s.depth=n.depth+1;return t.eachBefore(GT)}function dF(){return Mp(this).eachBefore(gF)}function pF(r){return r.children}function mF(r){return Array.isArray(r)?r[1]:null}function gF(r){r.data.value!==void 0&&(r.value=r.data.value),r.data=r.data.data}function GT(r){var e=0;do r.height=e;while((r=r.parent)&&r.height<++e)}function ql(r){this.data=r,this.depth=this.height=0,this.parent=null}ql.prototype=Mp.prototype={constructor:ql,count:QN,each:eF,eachAfter:nF,eachBefore:tF,find:iF,sum:rF,sort:sF,path:oF,ancestors:lF,descendants:cF,leaves:uF,links:hF,copy:dF,[Symbol.iterator]:fF};function Lg(r){return r==null?null:HT(r)}function HT(r){if(typeof r!="function")throw new Error;return r}function Hc(){return 0}function Vc(r){return function(){return r}}function vF(r){r.x0=Math.round(r.x0),r.y0=Math.round(r.y0),r.x1=Math.round(r.x1),r.y1=Math.round(r.y1)}function yF(r,e,t,n,i){for(var s=r.children,o,a=-1,l=s.length,c=r.value&&(n-e)/r.value;++aEF(t(E,b,i))),x=g.map($w),w=new Set(g).add("");for(const E of x)w.has(E)||(w.add(E),g.push(E),x.push($w(E)),s.push(Ig));o=(E,b)=>g[b],a=(E,b)=>x[b]}for(u=0,l=s.length;u=0&&(m=s[g],m.data===Ig);--g)m.data=null}if(h.parent=_F,h.eachBefore(function(g){g.depth=g.parent.depth+1,--l}).eachBefore(GT),h.parent=null,l>0)throw new Error("cycle");return h}return n.id=function(i){return arguments.length?(r=Lg(i),n):r},n.parentId=function(i){return arguments.length?(e=Lg(i),n):e},n.path=function(i){return arguments.length?(t=Lg(i),n):t},n}function EF(r){r=`${r}`;let e=r.length;return Sv(r,e-1)&&!Sv(r,e-2)&&(r=r.slice(0,-1)),r[0]==="/"?r:`/${r}`}function $w(r){let e=r.length;if(e<2)return"";for(;--e>1&&!Sv(r,e););return r.slice(0,e)}function Sv(r,e){if(r[e]==="/"){let t=0;for(;e>0&&r[--e]==="\\";)++t;if((t&1)===0)return!0}return!1}function bF(r,e){return r.parent===e.parent?1:2}function Dg(r){var e=r.children;return e?e[0]:r.t}function Ug(r){var e=r.children;return e?e[e.length-1]:r.t}function MF(r,e,t){var n=t/(e.i-r.i);e.c-=n,e.s+=t,r.c+=n,e.z+=t,e.m+=t}function TF(r){for(var e=0,t=0,n=r.children,i=n.length,s;--i>=0;)s=n[i],s.z+=e,s.m+=e,e+=s.s+(t+=s.c)}function AF(r,e,t){return r.a.parent===e.parent?r.a:t}function Td(r,e){this._=r,this.parent=null,this.children=null,this.A=null,this.a=this,this.z=0,this.m=0,this.c=0,this.s=0,this.t=null,this.i=e}Td.prototype=Object.create(ql.prototype);function CF(r){for(var e=new Td(r,0),t,n=[e],i,s,o,a;t=n.pop();)if(s=t._.children)for(t.children=new Array(a=s.length),o=a-1;o>=0;--o)n.push(i=t.children[o]=new Td(s[o],o)),i.parent=t;return(e.parent=new Td(null,0)).children=[e],e}function RF(){var r=bF,e=1,t=1,n=null;function i(c){var u=CF(c);if(u.eachAfter(s),u.parent.m=-u.z,u.eachBefore(o),n)c.eachBefore(l);else{var h=c,p=c,m=c;c.eachBefore(function(x){x.xp.x&&(p=x),x.depth>m.depth&&(m=x)});var v=h===p?1:r(h,p)/2,_=v-h.x,y=e/(p.x+v+_),g=t/(m.depth||1);c.eachBefore(function(x){x.x=(x.x+_)*y,x.y=x.depth*g})}return c}function s(c){var u=c.children,h=c.parent.children,p=c.i?h[c.i-1]:null;if(u){TF(c);var m=(u[0].z+u[u.length-1].z)/2;p?(c.z=p.z+r(c._,p._),c.m=c.z-m):c.z=m}else p&&(c.z=p.z+r(c._,p._));c.parent.A=a(c,p,c.parent.A||h[0])}function o(c){c._.x=c.z+c.parent.m,c.m+=c.parent.m}function a(c,u,h){if(u){for(var p=c,m=c,v=u,_=p.parent.children[0],y=p.m,g=m.m,x=v.m,w=_.m,E;v=Ug(v),p=Dg(p),v&&p;)_=Dg(_),m=Ug(m),m.a=c,E=v.z+x-p.z-y+r(v._,p._),E>0&&(MF(AF(v,c,h),c,E),y+=E,g+=E),x+=v.m,y+=p.m,w+=_.m,g+=m.m;v&&!Ug(m)&&(m.t=v,m.m+=x-g),p&&!Dg(_)&&(_.t=p,_.m+=y-w,h=c)}return h}function l(c){c.x*=e,c.y=c.depth*t}return i.separation=function(c){return arguments.length?(r=c,i):r},i.size=function(c){return arguments.length?(n=!1,e=+c[0],t=+c[1],i):n?null:[e,t]},i.nodeSize=function(c){return arguments.length?(n=!0,e=+c[0],t=+c[1],i):n?[e,t]:null},i}function PF(r,e,t,n,i){for(var s=r.children,o,a=-1,l=s.length,c=r.value&&(i-t)/r.value;++ax&&(x=c),M=y*y*b,w=Math.max(x/M,M/g),w>E){y-=c;break}E=w}o.push(l={value:y,dice:m1?n:1)},t})(LF);function UF(){var r=DF,e=!1,t=1,n=1,i=[0],s=Hc,o=Hc,a=Hc,l=Hc,c=Hc;function u(p){return p.x0=p.y0=0,p.x1=t,p.y1=n,p.eachBefore(h),i=[0],e&&p.eachBefore(vF),p}function h(p){var m=i[p.depth],v=p.x0+m,_=p.y0+m,y=p.x1-m,g=p.y1-m;y1&&ae.has(Le))&&(k>1&&ae.add(Le),se=l[oe+r],Ie=l[oe+e],Se=l[oe+t],ge=se-te,He=Ie-$,j=Math.sqrt(ge*ge+He*He),H=j0?(A[oe]+=ge/j*(1+de),P[oe]+=He/j*(1+de)):(A[oe]+=I*s(),P[oe]+=X*s())));for(v=0,_=0;v"u"?i:c};typeof i=="function"&&(o=i);var a=function(c){return o(c[n])},l=function(){return o(void 0)};return typeof n=="string"?(s.fromAttributes=a,s.fromGraph=function(c,u){return a(c.getNodeAttributes(u))},s.fromEntry=function(c,u){return a(u)}):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createNodeValueGetter: irrelevant usage.")},s.fromGraph=function(c,u){return o(n(u,c.getNodeAttributes(u)))},s.fromEntry=function(c,u){return o(n(c,u))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l),s}function t(n,i){var s={},o=function(c){return typeof c>"u"?i:c};typeof i=="function"&&(o=i);var a=function(c){return o(c[n])},l=function(){return o(void 0)};return typeof n=="string"?(s.fromAttributes=a,s.fromGraph=function(c,u){return a(c.getEdgeAttributes(u))},s.fromEntry=function(c,u){return a(u)},s.fromPartialEntry=s.fromEntry,s.fromMinimalEntry=s.fromEntry):typeof n=="function"?(s.fromAttributes=function(){throw new Error("graphology-utils/getters/createEdgeValueGetter: irrelevant usage.")},s.fromGraph=function(c,u){var h=c.extremities(u);return o(n(u,c.getEdgeAttributes(u),h[0],h[1],c.getNodeAttributes(h[0]),c.getNodeAttributes(h[1]),c.isUndirected(u)))},s.fromEntry=function(c,u,h,p,m,v,_){return o(n(c,u,h,p,m,v,_))},s.fromPartialEntry=function(c,u,h,p){return o(n(c,u,h,p))},s.fromMinimalEntry=function(c,u){return o(n(c,u))}):(s.fromAttributes=l,s.fromGraph=l,s.fromEntry=l,s.fromMinimalEntry=l),s}return Wc.createNodeValueGetter=e,Wc.createEdgeValueGetter=t,Wc.createEdgeWeightGetter=function(n){return t(n,r)},Wc}var Gg,oS;function WF(){if(oS)return Gg;oS=1;var r=0,e=1,t=2,n=3,i=4,s=5,o=6,a=7,l=8,c=9,u=0,h=1,p=2,m=0,v=1,_=2,y=3,g=4,x=5,w=6,E=7,b=8,M=3,A=10,P=3,C=9,L=10;return Gg=function(N,I,X){var q,W,O,k,G,B,D,V,Z,ee,ie=I.length,ue=X.length,ce=N.adjustSizes,le=N.barnesHutTheta*N.barnesHutTheta,Ae,Ee,ae,z,oe,te,se,$=[];for(O=0;One?(Se-=(H-ne)/2,Le=Se+H):(Ie-=(ne-H)/2,de=Ie+ne),$[0+m]=-1,$[0+v]=(Ie+de)/2,$[0+_]=(Se+Le)/2,$[0+y]=Math.max(de-Ie,Le-Se),$[0+g]=-1,$[0+x]=-1,$[0+w]=0,$[0+E]=0,$[0+b]=0,q=1,O=0;O=0){I[O+r]<$[W+v]?I[O+e]<$[W+_]?ge=$[W+x]:ge=$[W+x]+C:I[O+e]<$[W+_]?ge=$[W+x]+C*2:ge=$[W+x]+C*3,$[W+E]=($[W+E]*$[W+w]+I[O+r]*I[O+o])/($[W+w]+I[O+o]),$[W+b]=($[W+b]*$[W+w]+I[O+e]*I[O+o])/($[W+w]+I[O+o]),$[W+w]+=I[O+o],W=ge;continue}else if($[W+m]<0){$[W+m]=O;break}else{if($[W+x]=q*C,V=$[W+y]/2,Z=$[W+x],$[Z+m]=-1,$[Z+v]=$[W+v]-V,$[Z+_]=$[W+_]-V,$[Z+y]=V,$[Z+g]=Z+C,$[Z+x]=-1,$[Z+w]=0,$[Z+E]=0,$[Z+b]=0,Z+=C,$[Z+m]=-1,$[Z+v]=$[W+v]-V,$[Z+_]=$[W+_]+V,$[Z+y]=V,$[Z+g]=Z+C,$[Z+x]=-1,$[Z+w]=0,$[Z+E]=0,$[Z+b]=0,Z+=C,$[Z+m]=-1,$[Z+v]=$[W+v]+V,$[Z+_]=$[W+_]-V,$[Z+y]=V,$[Z+g]=Z+C,$[Z+x]=-1,$[Z+w]=0,$[Z+E]=0,$[Z+b]=0,Z+=C,$[Z+m]=-1,$[Z+v]=$[W+v]+V,$[Z+_]=$[W+_]+V,$[Z+y]=V,$[Z+g]=$[W+g],$[Z+x]=-1,$[Z+w]=0,$[Z+E]=0,$[Z+b]=0,q+=4,I[$[W+m]+r]<$[W+v]?I[$[W+m]+e]<$[W+_]?ge=$[W+x]:ge=$[W+x]+C:I[$[W+m]+e]<$[W+_]?ge=$[W+x]+C*2:ge=$[W+x]+C*3,$[W+w]=I[$[W+m]+o],$[W+E]=I[$[W+m]+r],$[W+b]=I[$[W+m]+e],$[ge+m]=$[W+m],$[W+m]=-1,I[O+r]<$[W+v]?I[O+e]<$[W+_]?He=$[W+x]:He=$[W+x]+C:I[O+e]<$[W+_]?He=$[W+x]+C*2:He=$[W+x]+C*3,ge===He)if(j--){W=ge;continue}else{j=M;break}$[He+m]=O;break}}if(N.barnesHutOptimize)for(Ee=N.scalingRatio,O=0;O=0)if(te=Math.pow(I[O+r]-$[W+E],2)+Math.pow(I[O+e]-$[W+b],2),ee=$[W+y],4*ee*ee/te0?(se=Ee*I[O+o]*$[W+w]/te,I[O+t]+=ae*se,I[O+n]+=z*se):te<0&&(se=-Ee*I[O+o]*$[W+w]/Math.sqrt(te),I[O+t]+=ae*se,I[O+n]+=z*se):te>0&&(se=Ee*I[O+o]*$[W+w]/te,I[O+t]+=ae*se,I[O+n]+=z*se),W=$[W+g],W<0)break;continue}else{W=$[W+x];continue}else{if(B=$[W+m],B>=0&&B!==O&&(ae=I[O+r]-I[B+r],z=I[O+e]-I[B+e],te=ae*ae+z*z,ce===!0?te>0?(se=Ee*I[O+o]*I[B+o]/te,I[O+t]+=ae*se,I[O+n]+=z*se):te<0&&(se=-Ee*I[O+o]*I[B+o]/Math.sqrt(te),I[O+t]+=ae*se,I[O+n]+=z*se):te>0&&(se=Ee*I[O+o]*I[B+o]/te,I[O+t]+=ae*se,I[O+n]+=z*se)),W=$[W+g],W<0)break;continue}else for(Ee=N.scalingRatio,k=0;k0?(se=Ee*I[k+o]*I[G+o]/te/te,I[k+t]+=ae*se,I[k+n]+=z*se,I[G+t]-=ae*se,I[G+n]-=z*se):te<0&&(se=100*Ee*I[k+o]*I[G+o],I[k+t]+=ae*se,I[k+n]+=z*se,I[G+t]-=ae*se,I[G+n]-=z*se)):(te=Math.sqrt(ae*ae+z*z),te>0&&(se=Ee*I[k+o]*I[G+o]/te/te,I[k+t]+=ae*se,I[k+n]+=z*se,I[G+t]-=ae*se,I[G+n]-=z*se));for(Z=N.gravity/N.scalingRatio,Ee=N.scalingRatio,O=0;O0&&(se=Ee*I[O+o]*Z):te>0&&(se=Ee*I[O+o]*Z/te),I[O+t]-=ae*se,I[O+n]-=z*se;for(Ee=1*(N.outboundAttractionDistribution?Ae:1),D=0;D0&&(se=-Ee*oe*Math.log(1+te)/te/I[k+o]):te>0&&(se=-Ee*oe*Math.log(1+te)/te):N.outboundAttractionDistribution?te>0&&(se=-Ee*oe/I[k+o]):te>0&&(se=-Ee*oe)):(te=Math.sqrt(Math.pow(ae,2)+Math.pow(z,2)),N.linLogMode?N.outboundAttractionDistribution?te>0&&(se=-Ee*oe*Math.log(1+te)/te/I[k+o]):te>0&&(se=-Ee*oe*Math.log(1+te)/te):N.outboundAttractionDistribution?(te=1,se=-Ee*oe/I[k+o]):(te=1,se=-Ee*oe)),te>0&&(I[k+t]+=ae*se,I[k+n]+=z*se,I[G+t]-=ae*se,I[G+n]-=z*se);var we,be,Me,Fe,Ue,xe;if(ce===!0)for(O=0;OL&&(I[O+t]=I[O+t]*L/we,I[O+n]=I[O+n]*L/we),be=I[O+o]*Math.sqrt((I[O+i]-I[O+t])*(I[O+i]-I[O+t])+(I[O+s]-I[O+n])*(I[O+s]-I[O+n])),Me=Math.sqrt((I[O+i]+I[O+t])*(I[O+i]+I[O+t])+(I[O+s]+I[O+n])*(I[O+s]+I[O+n]))/2,Fe=.1*Math.log(1+Me)/(1+Math.sqrt(be)),Ue=I[O+r]+I[O+t]*(Fe/N.slowDown),I[O+r]=Ue,xe=I[O+e]+I[O+n]*(Fe/N.slowDown),I[O+e]=xe);else for(O=0;O=0)?{message:"the `scalingRatio` setting should be a number >= 0."}:"strongGravityMode"in t&&typeof t.strongGravityMode!="boolean"?{message:"the `strongGravityMode` setting should be a boolean."}:"gravity"in t&&!(typeof t.gravity=="number"&&t.gravity>=0)?{message:"the `gravity` setting should be a number >= 0."}:"slowDown"in t&&!(typeof t.slowDown=="number"||t.slowDown>=0)?{message:"the `slowDown` setting should be a number >= 0."}:"barnesHutOptimize"in t&&typeof t.barnesHutOptimize!="boolean"?{message:"the `barnesHutOptimize` setting should be a boolean."}:"barnesHutTheta"in t&&!(typeof t.barnesHutTheta=="number"&&t.barnesHutTheta>=0)?{message:"the `barnesHutTheta` setting should be a number >= 0."}:null},Rs.graphToByteArrays=function(t,n){var i=t.order,s=t.size,o={},a,l=new Float32Array(i*r),c=new Float32Array(s*e);return a=0,t.forEachNode(function(u,h){o[u]=a,l[a]=h.x,l[a+1]=h.y,l[a+2]=0,l[a+3]=0,l[a+4]=0,l[a+5]=0,l[a+6]=1,l[a+7]=1,l[a+8]=h.size||1,l[a+9]=h.fixed?1:0,a+=r}),a=0,t.forEachEdge(function(u,h,p,m,v,_,y){var g=o[p],x=o[m],w=n(u,h,p,m,v,_,y);l[g+6]+=w,l[x+6]+=w,c[a]=g,c[a+1]=x,c[a+2]=w,a+=e}),{nodes:l,edges:c}},Rs.assignLayoutChanges=function(t,n,i){var s=0;t.updateEachNodeAttributes(function(o,a){return a.x=n[s],a.y=n[s+1],s+=r,i?i(o,a):a})},Rs.readGraphPositions=function(t,n){var i=0;t.forEachNode(function(s,o){n[i]=o.x,n[i+1]=o.y,i+=r})},Rs.collectLayoutChanges=function(t,n,i){for(var s=t.nodes(),o={},a=0,l=0,c=n.length;a2e3,strongGravityMode:!0,gravity:.05,scalingRatio:10,slowDown:1+Math.log(c)}}var a=s.bind(null,!1);return a.assign=s.bind(null,!0),a.inferSettings=o,Vg=a,Vg}var qF=YF();const ZF=Hr(qF);var Wg,uS;function KF(){if(uS)return Wg;uS=1;var r=Vy(),e=Xs(),t={dimensions:["x","y"],center:.5,rng:Math.random,scale:1};function n(s,o,a){if(!e(o))throw new Error("graphology-layout/random: the given graph is not a valid graphology instance.");a=r(a,t);var l=a.dimensions;if(!Array.isArray(l)||l.length<1)throw new Error("graphology-layout/random: given dimensions are invalid.");var c=l.length,u=a.center,h=a.rng,p=a.scale,m=(u-.5)*p;function v(y){for(var g=0;g 4294967295 is not supported.")},r.getSignedPointerArray=function(l){var c=l-1;return c<=i?Int8Array:c<=s?Int16Array:c<=o?Int32Array:Float64Array},r.getNumberType=function(l){return l===(l|0)?Math.sign(l)===-1?l<=127&&l>=-128?Int8Array:l<=32767&&l>=-32768?Int16Array:Int32Array:l<=255?Uint8Array:l<=65535?Uint16Array:Uint32Array:Float64Array};var a={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};r.getMinimalRepresentation=function(l,c){var u=null,h=0,p,m,v,_,y;for(_=0,y=l.length;_h&&(h=p,u=m);return u},r.isTypedArray=function(l){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(l)},r.concat=function(){var l=0,c,u,h;for(c=0,h=arguments.length;c{let e;const t=new Set,n=(l,c)=>{const u=typeof l=="function"?l(e):l;if(!Object.is(u,e)){const h=e;e=c??typeof u!="object"?u:Object.assign({},e,u),t.forEach(p=>p(e,h))}},i=()=>e,a={setState:n,getState:i,subscribe:l=>(t.add(l),()=>t.delete(l)),destroy:()=>{(sk?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),t.clear()}};return e=r(n,i,a),a},ok=r=>r?mS(r):mS;var Yg={exports:{}},qg={},Zg={exports:{}},Kg={};/** + * @license React + * use-sync-external-store-shim.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var gS;function ak(){if(gS)return Kg;gS=1;var r=Hv();function e(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var t=typeof Object.is=="function"?Object.is:e,n=r.useState,i=r.useEffect,s=r.useLayoutEffect,o=r.useDebugValue;function a(h,p){var m=p(),v=n({inst:{value:m,getSnapshot:p}}),_=v[0].inst,y=v[1];return s(function(){_.value=m,_.getSnapshot=p,l(_)&&y({inst:_})},[h,m,p]),i(function(){return l(_)&&y({inst:_}),h(function(){l(_)&&y({inst:_})})},[h]),o(m),m}function l(h){var p=h.getSnapshot;h=h.value;try{var m=p();return!t(h,m)}catch{return!0}}function c(h,p){return p()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return Kg.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:u,Kg}var vS;function lk(){return vS||(vS=1,Zg.exports=ak()),Zg.exports}/** + * @license React + * use-sync-external-store-shim/with-selector.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 yS;function ck(){if(yS)return qg;yS=1;var r=Hv(),e=lk();function t(c,u){return c===u&&(c!==0||1/c===1/u)||c!==c&&u!==u}var n=typeof Object.is=="function"?Object.is:t,i=e.useSyncExternalStore,s=r.useRef,o=r.useEffect,a=r.useMemo,l=r.useDebugValue;return qg.useSyncExternalStoreWithSelector=function(c,u,h,p,m){var v=s(null);if(v.current===null){var _={hasValue:!1,value:null};v.current=_}else _=v.current;v=a(function(){function g(M){if(!x){if(x=!0,w=M,M=p(M),m!==void 0&&_.hasValue){var A=_.value;if(m(A,M))return E=A}return E=M}if(A=E,n(w,M))return A;var P=p(M);return m!==void 0&&m(A,P)?A:(w=M,E=P)}var x=!1,w,E,b=h===void 0?null:h;return[function(){return g(u())},b===null?void 0:function(){return g(b())}]},[u,h,p,m]);var y=i(c,v[0],v[1]);return o(function(){_.hasValue=!0,_.value=y},[y]),l(y),y},qg}var _S;function uk(){return _S||(_S=1,Yg.exports=ck()),Yg.exports}var hk=uk();const fk=Hr(hk),dk={},{useSyncExternalStoreWithSelector:pk}=fk;function WT(r,e=r.getState,t){const n=pk(r.subscribe,r.getState,r.getServerState||r.getState,e,t);return K.useDebugValue(n),n}const xS=r=>{(dk?"production":void 0)!=="production"&&typeof r!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof r=="function"?ok(r):r,t=(n,i)=>WT(e,n,i);return Object.assign(t,e),t},mk=r=>r?xS(r):xS,gk={};function vk(){(gk?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `context` will be removed in a future version. Instead use `import { createStore, useStore } from 'zustand'`. See: https://github.com/pmndrs/zustand/discussions/1180.");const r=K.createContext(void 0);return{Provider:({createStore:i,children:s})=>{const o=K.useRef();return o.current||(o.current=i()),K.createElement(r.Provider,{value:o.current},s)},useStore:(i,s)=>{const o=K.useContext(r);if(!o)throw new Error("Seems like you have not used zustand provider as an ancestor.");return WT(o,i,s)},useStoreApi:()=>{const i=K.useContext(r);if(!i)throw new Error("Seems like you have not used zustand provider as an ancestor.");return K.useMemo(()=>({...i}),[i])}}}function yk(r,e,t){return Math.max(e,Math.min(r,t))}const ln={toVector(r,e){return r===void 0&&(r=e),Array.isArray(r)?r:[r,r]},add(r,e){return[r[0]+e[0],r[1]+e[1]]},sub(r,e){return[r[0]-e[0],r[1]-e[1]]},addTo(r,e){r[0]+=e[0],r[1]+=e[1]},subTo(r,e){r[0]-=e[0],r[1]-=e[1]}};function wS(r,e,t){return e===0||Math.abs(e)===1/0?Math.pow(r,t*5):r*e*t/(e+t*r)}function SS(r,e,t,n=.15){return n===0?yk(r,e,t):rt?+wS(r-t,t-e,n)+t:r}function _k(r,[e,t],[n,i]){const[[s,o],[a,l]]=r;return[SS(e,s,o,n),SS(t,a,l,i)]}function xk(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function wk(r){var e=xk(r,"string");return typeof e=="symbol"?e:String(e)}function kn(r,e,t){return e=wk(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ES(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function wn(r){for(var e=1;e{var t,n;return e.target===r.currentTarget||((t=r.currentTarget)===null||t===void 0||(n=t.contains)===null||n===void 0?void 0:n.call(t,e.target))})}function Rk(r){return r.type==="touchend"||r.type==="touchcancel"?r.changedTouches:r.targetTouches}function YT(r){return Ap(r)?Rk(r)[0]:r}function Ev(r,e){try{const t=e.clientX-r.clientX,n=e.clientY-r.clientY,i=(e.clientX+r.clientX)/2,s=(e.clientY+r.clientY)/2,o=Math.hypot(t,n);return{angle:-(Math.atan2(t,n)*180)/Math.PI,distance:o,origin:[i,s]}}catch{}return null}function Pk(r){return Ck(r).map(e=>e.identifier)}function MS(r,e){const[t,n]=Array.from(r.touches).filter(i=>e.includes(i.identifier));return Ev(t,n)}function $g(r){const e=YT(r);return Ap(r)?e.identifier:e.pointerId}function Zl(r){const e=YT(r);return[e.clientX,e.clientY]}const TS=40,AS=800;function qT(r){let{deltaX:e,deltaY:t,deltaMode:n}=r;return n===1?(e*=TS,t*=TS):n===2&&(e*=AS,t*=AS),[e,t]}function Lk(r){var e,t;const{scrollX:n,scrollY:i,scrollLeft:s,scrollTop:o}=r.currentTarget;return[(e=n??s)!==null&&e!==void 0?e:0,(t=i??o)!==null&&t!==void 0?t:0]}function Ik(r){const e={};if("buttons"in r&&(e.buttons=r.buttons),"shiftKey"in r){const{shiftKey:t,altKey:n,metaKey:i,ctrlKey:s}=r;Object.assign(e,{shiftKey:t,altKey:n,metaKey:i,ctrlKey:s})}return e}function zd(r,...e){return typeof r=="function"?r(...e):r}function Dk(){}function Uk(...r){return r.length===0?Dk:r.length===1?r[0]:function(){let e;for(const t of r)e=t.apply(this,arguments)||e;return e}}function CS(r,e){return Object.assign({},e,r||{})}const Ok=32;class ZT{constructor(e,t,n){this.ctrl=e,this.args=t,this.key=n,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(e){this.ctrl.state[this.key]=e}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:e,shared:t,ingKey:n,args:i}=this;t[n]=e._active=e.active=e._blocked=e._force=!1,e._step=[!1,!1],e.intentional=!1,e._movement=[0,0],e._distance=[0,0],e._direction=[0,0],e._delta=[0,0],e._bounds=[[-1/0,1/0],[-1/0,1/0]],e.args=i,e.axis=void 0,e.memo=void 0,e.elapsedTime=e.timeDelta=0,e.direction=[0,0],e.distance=[0,0],e.overflow=[0,0],e._movementBound=[!1,!1],e.velocity=[0,0],e.movement=[0,0],e.delta=[0,0],e.timeStamp=0}start(e){const t=this.state,n=this.config;t._active||(this.reset(),this.computeInitial(),t._active=!0,t.target=e.target,t.currentTarget=e.currentTarget,t.lastOffset=n.from?zd(n.from,t):t.offset,t.offset=t.lastOffset,t.startTime=t.timeStamp=e.timeStamp)}computeValues(e){const t=this.state;t._values=e,t.values=this.config.transform(e)}computeInitial(){const e=this.state;e._initial=e._values,e.initial=e.values}compute(e){const{state:t,config:n,shared:i}=this;t.args=this.args;let s=0;if(e&&(t.event=e,n.preventDefault&&e.cancelable&&t.event.preventDefault(),t.type=e.type,i.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,i.locked=!!document.pointerLockElement,Object.assign(i,Ik(e)),i.down=i.pressed=i.buttons%2===1||i.touches>0,s=e.timeStamp-t.timeStamp,t.timeStamp=e.timeStamp,t.elapsedTime=t.timeStamp-t.startTime),t._active){const M=t._delta.map(Math.abs);ln.addTo(t._distance,M)}this.axisIntent&&this.axisIntent(e);const[o,a]=t._movement,[l,c]=n.threshold,{_step:u,values:h}=t;if(n.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(o)>=l&&h[0]),u[1]===!1&&(u[1]=Math.abs(a)>=c&&h[1])):(u[0]===!1&&(u[0]=Math.abs(o)>=l&&Math.sign(o)*l),u[1]===!1&&(u[1]=Math.abs(a)>=c&&Math.sign(a)*c)),t.intentional=u[0]!==!1||u[1]!==!1,!t.intentional)return;const p=[0,0];if(n.hasCustomTransform){const[M,A]=h;p[0]=u[0]!==!1?M-u[0]:0,p[1]=u[1]!==!1?A-u[1]:0}else p[0]=u[0]!==!1?o-u[0]:0,p[1]=u[1]!==!1?a-u[1]:0;this.restrictToAxis&&!t._blocked&&this.restrictToAxis(p);const m=t.offset,v=t._active&&!t._blocked||t.active;v&&(t.first=t._active&&!t.active,t.last=!t._active&&t.active,t.active=i[this.ingKey]=t._active,e&&(t.first&&("bounds"in n&&(t._bounds=zd(n.bounds,t)),this.setup&&this.setup()),t.movement=p,this.computeOffset()));const[_,y]=t.offset,[[g,x],[w,E]]=t._bounds;t.overflow=[_x?1:0,yE?1:0],t._movementBound[0]=t.overflow[0]?t._movementBound[0]===!1?t._movement[0]:t._movementBound[0]:!1,t._movementBound[1]=t.overflow[1]?t._movementBound[1]===!1?t._movement[1]:t._movementBound[1]:!1;const b=t._active?n.rubberband||[0,0]:[0,0];if(t.offset=_k(t._bounds,t.offset,b),t.delta=ln.sub(t.offset,m),this.computeMovement(),v&&(!t.last||s>Ok)){t.delta=ln.sub(t.offset,m);const M=t.delta.map(Math.abs);ln.addTo(t.distance,M),t.direction=t.delta.map(Math.sign),t._direction=t._delta.map(Math.sign),!t.first&&s>0&&(t.velocity=[M[0]/s,M[1]/s],t.timeDelta=s)}}emit(){const e=this.state,t=this.shared,n=this.config;if(e._active||this.clean(),(e._blocked||!e.intentional)&&!e._force&&!n.triggerAllEvents)return;const i=this.handler(wn(wn(wn({},t),e),{},{[this.aliasKey]:e.values}));i!==void 0&&(e.memo=i)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Nk([r,e],t){const n=Math.abs(r),i=Math.abs(e);if(n>i&&n>t)return"x";if(i>n&&i>t)return"y"}class fh extends ZT{constructor(...e){super(...e),kn(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ln.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ln.sub(this.state.offset,this.state.lastOffset)}axisIntent(e){const t=this.state,n=this.config;if(!t.axis&&e){const i=typeof n.axisThreshold=="object"?n.axisThreshold[jT(e)]:n.axisThreshold;t.axis=Nk(t._movement,i)}t._blocked=(n.lockDirection||!!n.axis)&&!t.axis||!!n.axis&&n.axis!==t.axis}restrictToAxis(e){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":e[1]=0;break;case"y":e[0]=0;break}}}const Fk=r=>r,RS=.15,KT={enabled(r=!0){return r},eventOptions(r,e,t){return wn(wn({},t.shared.eventOptions),r)},preventDefault(r=!1){return r},triggerAllEvents(r=!1){return r},rubberband(r=0){switch(r){case!0:return[RS,RS];case!1:return[0,0];default:return ln.toVector(r)}},from(r){if(typeof r=="function")return r;if(r!=null)return ln.toVector(r)},transform(r,e,t){const n=r||t.shared.transform;return this.hasCustomTransform=!!n,n||Fk},threshold(r){return ln.toVector(r,0)}},kk=0,Ua=wn(wn({},KT),{},{axis(r,e,{axis:t}){if(this.lockDirection=t==="lock",!this.lockDirection)return t},axisThreshold(r=kk){return r},bounds(r={}){if(typeof r=="function")return s=>Ua.bounds(r(s));if("current"in r)return()=>r.current;if(typeof HTMLElement=="function"&&r instanceof HTMLElement)return r;const{left:e=-1/0,right:t=1/0,top:n=-1/0,bottom:i=1/0}=r;return[[e,t],[n,i]]}}),PS={ArrowRight:(r,e=1)=>[r*e,0],ArrowLeft:(r,e=1)=>[-1*r*e,0],ArrowUp:(r,e=1)=>[0,-1*r*e],ArrowDown:(r,e=1)=>[0,r*e]};class zk extends fh{constructor(...e){super(...e),kn(this,"ingKey","dragging")}reset(){super.reset();const e=this.state;e._pointerId=void 0,e._pointerActive=!1,e._keyboardActive=!1,e._preventScroll=!1,e._delayed=!1,e.swipe=[0,0],e.tap=!1,e.canceled=!1,e.cancel=this.cancel.bind(this)}setup(){const e=this.state;if(e._bounds instanceof HTMLElement){const t=e._bounds.getBoundingClientRect(),n=e.currentTarget.getBoundingClientRect(),i={left:t.left-n.left+e.offset[0],right:t.right-n.right+e.offset[0],top:t.top-n.top+e.offset[1],bottom:t.bottom-n.bottom+e.offset[1]};e._bounds=Ua.bounds(i)}}cancel(){const e=this.state;e.canceled||(e.canceled=!0,e._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(e){const t=this.config,n=this.state;if(e.buttons!=null&&(Array.isArray(t.pointerButtons)?!t.pointerButtons.includes(e.buttons):t.pointerButtons!==-1&&t.pointerButtons!==e.buttons))return;const i=this.ctrl.setEventIds(e);t.pointerCapture&&e.target.setPointerCapture(e.pointerId),!(i&&i.size>1&&n._pointerActive)&&(this.start(e),this.setupPointer(e),n._pointerId=$g(e),n._pointerActive=!0,this.computeValues(Zl(e)),this.computeInitial(),t.preventScrollAxis&&jT(e)!=="mouse"?(n._active=!1,this.setupScrollPrevention(e)):t.delay>0?(this.setupDelayTrigger(e),t.triggerAllEvents&&(this.compute(e),this.emit())):this.startPointerDrag(e))}startPointerDrag(e){const t=this.state;t._active=!0,t._preventScroll=!0,t._delayed=!1,this.compute(e),this.emit()}pointerMove(e){const t=this.state,n=this.config;if(!t._pointerActive)return;const i=$g(e);if(t._pointerId!==void 0&&i!==t._pointerId)return;const s=Zl(e);if(document.pointerLockElement===e.target?t._delta=[e.movementX,e.movementY]:(t._delta=ln.sub(s,t._values),this.computeValues(s)),ln.addTo(t._movement,t._delta),this.compute(e),t._delayed&&t.intentional){this.timeoutStore.remove("dragDelay"),t.active=!1,this.startPointerDrag(e);return}if(n.preventScrollAxis&&!t._preventScroll)if(t.axis)if(t.axis===n.preventScrollAxis||n.preventScrollAxis==="xy"){t._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(e);return}else return;this.emit()}pointerUp(e){this.ctrl.setEventIds(e);try{this.config.pointerCapture&&e.target.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId)}catch{}const t=this.state,n=this.config;if(!t._active||!t._pointerActive)return;const i=$g(e);if(t._pointerId!==void 0&&i!==t._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(e);const[s,o]=t._distance;if(t.tap=s<=n.tapsThreshold&&o<=n.tapsThreshold,t.tap&&n.filterTaps)t._force=!0;else{const[a,l]=t._delta,[c,u]=t._movement,[h,p]=n.swipe.velocity,[m,v]=n.swipe.distance,_=n.swipe.duration;if(t.elapsedTime<_){const y=Math.abs(a/t.timeDelta),g=Math.abs(l/t.timeDelta);y>h&&Math.abs(c)>m&&(t.swipe[0]=Math.sign(a)),g>p&&Math.abs(u)>v&&(t.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(e){!this.state.tap&&e.detail>0&&(e.preventDefault(),e.stopPropagation())}setupPointer(e){const t=this.config,n=t.device;t.pointerLock&&e.currentTarget.requestPointerLock(),t.pointerCapture||(this.eventStore.add(this.sharedConfig.window,n,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,n,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(e){this.state._preventScroll&&e.cancelable&&e.preventDefault()}setupScrollPrevention(e){this.state._preventScroll=!1,Bk(e);const t=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",t),this.eventStore.add(this.sharedConfig.window,"touch","cancel",t),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,e)}setupDelayTrigger(e){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(e)},this.config.delay)}keyDown(e){const t=PS[e.key];if(t){const n=this.state,i=e.shiftKey?10:e.altKey?.1:1;this.start(e),n._delta=t(this.config.keyboardDisplacement,i),n._keyboardActive=!0,ln.addTo(n._movement,n._delta),this.compute(e),this.emit()}}keyUp(e){e.key in PS&&(this.state._keyboardActive=!1,this.setActive(),this.compute(e),this.emit())}bind(e){const t=this.config.device;e(t,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(e(t,"change",this.pointerMove.bind(this)),e(t,"end",this.pointerUp.bind(this)),e(t,"cancel",this.pointerUp.bind(this)),e("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(e("key","down",this.keyDown.bind(this)),e("key","up",this.keyUp.bind(this))),this.config.filterTaps&&e("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Bk(r){"persist"in r&&typeof r.persist=="function"&&r.persist()}const dh=typeof window<"u"&&window.document&&window.document.createElement;function $T(){return dh&&"ontouchstart"in window}function Gk(){return $T()||dh&&window.navigator.maxTouchPoints>1}function Hk(){return dh&&"onpointerdown"in window}function Vk(){return dh&&"exitPointerLock"in window.document}function Wk(){try{return"constructor"in GestureEvent}catch{return!1}}const wr={isBrowser:dh,gesture:Wk(),touch:$T(),touchscreen:Gk(),pointer:Hk(),pointerLock:Vk()},Xk=250,jk=180,Yk=.5,qk=50,Zk=250,Kk=10,LS={mouse:0,touch:0,pen:8},$k=wn(wn({},Ua),{},{device(r,e,{pointer:{touch:t=!1,lock:n=!1,mouse:i=!1}={}}){return this.pointerLock=n&&wr.pointerLock,wr.touch&&t?"touch":this.pointerLock?"mouse":wr.pointer&&!i?"pointer":wr.touch?"touch":"mouse"},preventScrollAxis(r,e,{preventScroll:t}){if(this.preventScrollDelay=typeof t=="number"?t:t||t===void 0&&r?Xk:void 0,!(!wr.touchscreen||t===!1))return r||(t!==void 0?"y":void 0)},pointerCapture(r,e,{pointer:{capture:t=!0,buttons:n=1,keys:i=!0}={}}){return this.pointerButtons=n,this.keys=i,!this.pointerLock&&this.device==="pointer"&&t},threshold(r,e,{filterTaps:t=!1,tapsThreshold:n=3,axis:i=void 0}){const s=ln.toVector(r,t?n:i?1:0);return this.filterTaps=t,this.tapsThreshold=n,s},swipe({velocity:r=Yk,distance:e=qk,duration:t=Zk}={}){return{velocity:this.transform(ln.toVector(r)),distance:this.transform(ln.toVector(e)),duration:t}},delay(r=0){switch(r){case!0:return jk;case!1:return 0;default:return r}},axisThreshold(r){return r?wn(wn({},LS),r):LS},keyboardDisplacement(r=Kk){return r}});function JT(r){const[e,t]=r.overflow,[n,i]=r._delta,[s,o]=r._direction;(e<0&&n>0&&s<0||e>0&&n<0&&s>0)&&(r._movement[0]=r._movementBound[0]),(t<0&&i>0&&o<0||t>0&&i<0&&o>0)&&(r._movement[1]=r._movementBound[1])}const Jk=30,Qk=100;class ez extends ZT{constructor(...e){super(...e),kn(this,"ingKey","pinching"),kn(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const e=this.state;e._touchIds=[],e.canceled=!1,e.cancel=this.cancel.bind(this),e.turns=0}computeOffset(){const{type:e,movement:t,lastOffset:n}=this.state;e==="wheel"?this.state.offset=ln.add(t,n):this.state.offset=[(1+t[0])*n[0],t[1]+n[1]]}computeMovement(){const{offset:e,lastOffset:t}=this.state;this.state.movement=[e[0]/t[0],e[1]-t[1]]}axisIntent(){const e=this.state,[t,n]=e._movement;if(!e.axis){const i=Math.abs(t)*Jk-Math.abs(n);i<0?e.axis="angle":i>0&&(e.axis="scale")}}restrictToAxis(e){this.config.lockDirection&&(this.state.axis==="scale"?e[1]=0:this.state.axis==="angle"&&(e[0]=0))}cancel(){const e=this.state;e.canceled||setTimeout(()=>{e.canceled=!0,e._active=!1,this.compute(),this.emit()},0)}touchStart(e){this.ctrl.setEventIds(e);const t=this.state,n=this.ctrl.touchIds;if(t._active&&t._touchIds.every(s=>n.has(s))||n.size<2)return;this.start(e),t._touchIds=Array.from(n).slice(0,2);const i=MS(e,t._touchIds);i&&this.pinchStart(e,i)}pointerStart(e){if(e.buttons!=null&&e.buttons%2!==1)return;this.ctrl.setEventIds(e),e.target.setPointerCapture(e.pointerId);const t=this.state,n=t._pointerEvents,i=this.ctrl.pointerIds;if(t._active&&Array.from(n.keys()).every(o=>i.has(o))||(n.size<2&&n.set(e.pointerId,e),t._pointerEvents.size<2))return;this.start(e);const s=Ev(...Array.from(n.values()));s&&this.pinchStart(e,s)}pinchStart(e,t){const n=this.state;n.origin=t.origin,this.computeValues([t.distance,t.angle]),this.computeInitial(),this.compute(e),this.emit()}touchMove(e){if(!this.state._active)return;const t=MS(e,this.state._touchIds);t&&this.pinchMove(e,t)}pointerMove(e){const t=this.state._pointerEvents;if(t.has(e.pointerId)&&t.set(e.pointerId,e),!this.state._active)return;const n=Ev(...Array.from(t.values()));n&&this.pinchMove(e,n)}pinchMove(e,t){const n=this.state,i=n._values[1],s=t.angle-i;let o=0;Math.abs(s)>270&&(o+=Math.sign(s)),this.computeValues([t.distance,t.angle-360*o]),n.origin=t.origin,n.turns=o,n._movement=[n._values[0]/n._initial[0]-1,n._values[1]-n._initial[1]],this.compute(e),this.emit()}touchEnd(e){this.ctrl.setEventIds(e),this.state._active&&this.state._touchIds.some(t=>!this.ctrl.touchIds.has(t))&&(this.state._active=!1,this.compute(e),this.emit())}pointerEnd(e){const t=this.state;this.ctrl.setEventIds(e);try{e.target.releasePointerCapture(e.pointerId)}catch{}t._pointerEvents.has(e.pointerId)&&t._pointerEvents.delete(e.pointerId),t._active&&t._pointerEvents.size<2&&(t._active=!1,this.compute(e),this.emit())}gestureStart(e){e.cancelable&&e.preventDefault();const t=this.state;t._active||(this.start(e),this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY],this.compute(e),this.emit())}gestureMove(e){if(e.cancelable&&e.preventDefault(),!this.state._active)return;const t=this.state;this.computeValues([e.scale,e.rotation]),t.origin=[e.clientX,e.clientY];const n=t._movement;t._movement=[e.scale-1,e.rotation],t._delta=ln.sub(t._movement,n),this.compute(e),this.emit()}gestureEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}wheel(e){const t=this.config.modifierKey;t&&(Array.isArray(t)?!t.find(n=>e[n]):!e[t])||(this.state._active?this.wheelChange(e):this.wheelStart(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(e){this.start(e),this.wheelChange(e)}wheelChange(e){"uv"in e||e.cancelable&&e.preventDefault();const n=this.state;n._delta=[-qT(e)[1]/Qk*n.offset[0],0],ln.addTo(n._movement,n._delta),JT(n),this.state.origin=[e.clientX,e.clientY],this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){const t=this.config.device;t&&(e(t,"start",this[t+"Start"].bind(this)),e(t,"change",this[t+"Move"].bind(this)),e(t,"end",this[t+"End"].bind(this)),e(t,"cancel",this[t+"End"].bind(this)),e("lostPointerCapture","",this[t+"End"].bind(this))),this.config.pinchOnWheel&&e("wheel","",this.wheel.bind(this),{passive:!1})}}const tz=wn(wn({},KT),{},{device(r,e,{shared:t,pointer:{touch:n=!1}={}}){if(t.target&&!wr.touch&&wr.gesture)return"gesture";if(wr.touch&&n)return"touch";if(wr.touchscreen){if(wr.pointer)return"pointer";if(wr.touch)return"touch"}},bounds(r,e,{scaleBounds:t={},angleBounds:n={}}){const i=o=>{const a=CS(zd(t,o),{min:-1/0,max:1/0});return[a.min,a.max]},s=o=>{const a=CS(zd(n,o),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof t!="function"&&typeof n!="function"?[i(),s()]:o=>[i(o),s(o)]},threshold(r,e,t){return this.lockDirection=t.axis==="lock",ln.toVector(r,this.lockDirection?[.1,3]:0)},modifierKey(r){return r===void 0?"ctrlKey":r},pinchOnWheel(r=!0){return r}});class nz extends fh{constructor(...e){super(...e),kn(this,"ingKey","moving")}move(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.state._active?this.moveChange(e):this.moveStart(e),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(e){this.start(e),this.computeValues(Zl(e)),this.compute(e),this.computeInitial(),this.emit()}moveChange(e){if(!this.state._active)return;const t=Zl(e),n=this.state;n._delta=ln.sub(t,n._values),ln.addTo(n._movement,n._delta),this.computeValues(t),this.compute(e),this.emit()}moveEnd(e){this.state._active&&(this.state._active=!1,this.compute(e),this.emit())}bind(e){e("pointer","change",this.move.bind(this)),e("pointer","leave",this.moveEnd.bind(this))}}const iz=wn(wn({},Ua),{},{mouseOnly:(r=!0)=>r});class rz extends fh{constructor(...e){super(...e),kn(this,"ingKey","scrolling")}scroll(e){this.state._active||this.start(e),this.scrollChange(e),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(e){e.cancelable&&e.preventDefault();const t=this.state,n=Lk(e);t._delta=ln.sub(n,t._values),ln.addTo(t._movement,t._delta),this.computeValues(n),this.compute(e),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("scroll","",this.scroll.bind(this))}}const sz=Ua;class oz extends fh{constructor(...e){super(...e),kn(this,"ingKey","wheeling")}wheel(e){this.state._active||this.start(e),this.wheelChange(e),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(e){const t=this.state;t._delta=qT(e),ln.addTo(t._movement,t._delta),JT(t),this.compute(e),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(e){e("wheel","",this.wheel.bind(this))}}const az=Ua;class lz extends fh{constructor(...e){super(...e),kn(this,"ingKey","hovering")}enter(e){this.config.mouseOnly&&e.pointerType!=="mouse"||(this.start(e),this.computeValues(Zl(e)),this.compute(e),this.emit())}leave(e){if(this.config.mouseOnly&&e.pointerType!=="mouse")return;const t=this.state;if(!t._active)return;t._active=!1;const n=Zl(e);t._movement=t._delta=ln.sub(n,t._values),this.computeValues(n),this.compute(e),t.delta=t.movement,this.emit()}bind(e){e("pointer","enter",this.enter.bind(this)),e("pointer","leave",this.leave.bind(this))}}const cz=wn(wn({},Ua),{},{mouseOnly:(r=!0)=>r}),Wy=new Map,bv=new Map;function uz(r){Wy.set(r.key,r.engine),bv.set(r.key,r.resolver)}const hz={key:"drag",engine:zk,resolver:$k},fz={key:"hover",engine:lz,resolver:cz},dz={key:"move",engine:nz,resolver:iz},pz={key:"pinch",engine:ez,resolver:tz},mz={key:"scroll",engine:rz,resolver:sz},gz={key:"wheel",engine:oz,resolver:az};function vz(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s=0)&&(t[i]=r[i]);return t}function yz(r,e){if(r==null)return{};var t=vz(r,e),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(r);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}const _z={target(r){if(r)return()=>"current"in r?r.current:r},enabled(r=!0){return r},window(r=wr.isBrowser?window:void 0){return r},eventOptions({passive:r=!0,capture:e=!1}={}){return{passive:r,capture:e}},transform(r){return r}},xz=["target","eventOptions","window","enabled","transform"];function Ad(r={},e){const t={};for(const[n,i]of Object.entries(e))switch(typeof i){case"function":t[n]=i.call(t,r[n],n,r);break;case"object":t[n]=Ad(r[n],i);break;case"boolean":i&&(t[n]=r[n]);break}return t}function wz(r,e,t={}){const n=r,{target:i,eventOptions:s,window:o,enabled:a,transform:l}=n,c=yz(n,xz);if(t.shared=Ad({target:i,eventOptions:s,window:o,enabled:a,transform:l},_z),e){const u=bv.get(e);t[e]=Ad(wn({shared:t.shared},c),u)}else for(const u in c){const h=bv.get(u);h&&(t[u]=Ad(wn({shared:t.shared},c[u]),h))}return t}class QT{constructor(e,t){kn(this,"_listeners",new Set),this._ctrl=e,this._gestureKey=t}add(e,t,n,i,s){const o=this._listeners,a=Ak(t,n),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=wn(wn({},l),s);e.addEventListener(a,i,c);const u=()=>{e.removeEventListener(a,i,c),o.delete(u)};return o.add(u),u}clean(){this._listeners.forEach(e=>e()),this._listeners.clear()}}class Sz{constructor(){kn(this,"_timeouts",new Map)}add(e,t,n=140,...i){this.remove(e),this._timeouts.set(e,window.setTimeout(t,n,...i))}remove(e){const t=this._timeouts.get(e);t&&window.clearTimeout(t)}clean(){this._timeouts.forEach(e=>void window.clearTimeout(e)),this._timeouts.clear()}}let Ez=class{constructor(e){kn(this,"gestures",new Set),kn(this,"_targetEventStore",new QT(this)),kn(this,"gestureEventStores",{}),kn(this,"gestureTimeoutStores",{}),kn(this,"handlers",{}),kn(this,"config",{}),kn(this,"pointerIds",new Set),kn(this,"touchIds",new Set),kn(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),bz(this,e)}setEventIds(e){if(Ap(e))return this.touchIds=new Set(Pk(e)),this.touchIds;if("pointerId"in e)return e.type==="pointerup"||e.type==="pointercancel"?this.pointerIds.delete(e.pointerId):e.type==="pointerdown"&&this.pointerIds.add(e.pointerId),this.pointerIds}applyHandlers(e,t){this.handlers=e,this.nativeHandlers=t}applyConfig(e,t){this.config=wz(e,t,this.config)}clean(){this._targetEventStore.clean();for(const e of this.gestures)this.gestureEventStores[e].clean(),this.gestureTimeoutStores[e].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...e){const t=this.config.shared,n={};let i;if(!(t.target&&(i=t.target(),!i))){if(t.enabled){for(const o of this.gestures){const a=this.config[o],l=IS(n,a.eventOptions,!!i);if(a.enabled){const c=Wy.get(o);new c(this,e,o).bind(l)}}const s=IS(n,t.eventOptions,!!i);for(const o in this.nativeHandlers)s(o,"",a=>this.nativeHandlers[o](wn(wn({},this.state.shared),{},{event:a,args:e})),void 0,!0)}for(const s in n)n[s]=Uk(...n[s]);if(!i)return n;for(const s in n){const{device:o,capture:a,passive:l}=Tk(s);this._targetEventStore.add(i,o,"",n[s],{capture:a,passive:l})}}}};function _l(r,e){r.gestures.add(e),r.gestureEventStores[e]=new QT(r,e),r.gestureTimeoutStores[e]=new Sz}function bz(r,e){e.drag&&_l(r,"drag"),e.wheel&&_l(r,"wheel"),e.scroll&&_l(r,"scroll"),e.move&&_l(r,"move"),e.pinch&&_l(r,"pinch"),e.hover&&_l(r,"hover")}const IS=(r,e,t)=>(n,i,s,o={},a=!1)=>{var l,c;const u=(l=o.capture)!==null&&l!==void 0?l:e.capture,h=(c=o.passive)!==null&&c!==void 0?c:e.passive;let p=a?n:bk(n,i,u);t&&h&&(p+="Passive"),r[p]=r[p]||[],r[p].push(s)},Mz=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function Tz(r){const e={},t={},n=new Set;for(let i in r)Mz.test(i)?(n.add(RegExp.lastMatch),t[i]=r[i]):e[i]=r[i];return[t,e,n]}function xl(r,e,t,n,i,s){if(!r.has(t)||!Wy.has(n))return;const o=t+"Start",a=t+"End",l=c=>{let u;return c.first&&o in e&&e[o](c),t in e&&(u=e[t](c)),c.last&&a in e&&e[a](c),u};i[n]=l,s[n]=s[n]||{}}function Az(r,e){const[t,n,i]=Tz(r),s={};return xl(i,t,"onDrag","drag",s,e),xl(i,t,"onWheel","wheel",s,e),xl(i,t,"onScroll","scroll",s,e),xl(i,t,"onPinch","pinch",s,e),xl(i,t,"onMove","move",s,e),xl(i,t,"onHover","hover",s,e),{handlers:s,config:e,nativeHandlers:n}}function Cz(r,e={},t,n){const i=Um.useMemo(()=>new Ez(r),[]);if(i.applyHandlers(r,n),i.applyConfig(e,t),Um.useEffect(i.effect.bind(i)),Um.useEffect(()=>i.clean.bind(i),[]),e.target===void 0)return i.bind.bind(i)}function Rz(r){return r.forEach(uz),function(t,n){const{handlers:i,nativeHandlers:s,config:o}=Az(t,n||{});return Cz(i,o,void 0,s)}}function Pz(r,e){return Rz([hz,pz,mz,gz,dz,fz])(r,e||{})}var Lr={},ta={},Jg,DS;function Cp(){if(DS)return Jg;DS=1;function r(e){if(typeof e!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=e}return typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var e=arguments,t=e.length,n=0;return new r(function(){return n>=t?{done:!0}:{done:!1,value:e[n++]}})},r.empty=function(){var e=new r(function(){return{done:!0}});return e},r.fromSequence=function(e){var t=0,n=e.length;return new r(function(){return t>=n?{done:!0}:{done:!1,value:e[t++]}})},r.is=function(e){return e instanceof r?!0:typeof e=="object"&&e!==null&&typeof e.next=="function"},Jg=r,Jg}var nd={},US;function eA(){return US||(US=1,nd.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",nd.SYMBOL_SUPPORT=typeof Symbol<"u"),nd}var Qg,OS;function Xy(){if(OS)return Qg;OS=1;var r=eA(),e=r.ARRAY_BUFFER_SUPPORT,t=r.SYMBOL_SUPPORT;return Qg=function(i,s){var o,a,l,c,u;if(!i)throw new Error("obliterator/forEach: invalid iterable.");if(typeof s!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(i)||e&&ArrayBuffer.isView(i)||typeof i=="string"||i.toString()==="[object Arguments]"){for(l=0,c=i.length;l=this.items.length&&(this.items=this.items.slice(this.offset),this.offset=0),this.size--,n}},t.prototype.peek=function(){if(this.size)return this.items[this.offset]},t.prototype.forEach=function(n,i){i=arguments.length>1?i:this;for(var s=this.offset,o=0,a=this.items.length;s=n.length)return{done:!0};var s=n[i];return i++,{value:s,done:!1}})},t.prototype.entries=function(){var n=this.items,i=this.offset,s=0;return new r(function(){if(i>=n.length)return{done:!0};var o=n[i];return i++,{value:[s++,o],done:!1}})},typeof Symbol<"u"&&(t.prototype[Symbol.iterator]=t.prototype.values),t.prototype.toString=function(){return this.toArray().join(",")},t.prototype.toJSON=function(){return this.toArray()},t.prototype.inspect=function(){var n=this.toArray();return Object.defineProperty(n,"constructor",{value:t,enumerable:!1}),n},typeof Symbol<"u"&&(t.prototype[Symbol.for("nodejs.util.inspect.custom")]=t.prototype.inspect),t.from=function(n){var i=new t;return e(n,function(s){i.enqueue(s)}),i},t.of=function(){return t.from(arguments)},e0=t,e0}var t0,FS;function Iz(){return FS||(FS=1,t0=function(e,t){var n=t.length;if(n!==0){var i=e.length;e.length+=n;for(var s=0;ss?1:0},e=function(i,s){return is?-1:0};function t(i){return function(s,o){return i(o,s)}}function n(i){return i===2?function(s,o){return s[0]o[0]?1:s[1]o[1]?1:0}:function(s,o){for(var a=0;ao[a])return 1;a++}return 0}}return wl.DEFAULT_COMPARATOR=r,wl.DEFAULT_REVERSE_COMPARATOR=e,wl.reverseComparator=t,wl.createTupleComparator=n,wl}var Sl={},GS;function Nz(){if(GS)return Sl;GS=1;var r=Xy(),e=VT();function t(o){return Array.isArray(o)||e.isTypedArray(o)}function n(o){if(typeof o.length=="number")return o.length;if(typeof o.size=="number")return o.size}function i(o){var a=n(o),l=typeof a=="number"?new Array(a):[],c=0;return r(o,function(u){l[c++]=u}),l}function s(o){var a=n(o),l=typeof a=="number"?e.getPointerArray(a):Array,c=typeof a=="number"?new Array(a):[],u=typeof a=="number"?new l(a):[],h=0;return r(o,function(p){c[h]=p,u[h]=h++}),[c,u]}return Sl.isArrayLike=t,Sl.guessLength=n,Sl.toArray=i,Sl.toArrayWithIndices=s,Sl}var i0,HS;function tA(){if(HS)return i0;HS=1;var r=Xy(),e=Oz(),t=Nz(),n=e.DEFAULT_COMPARATOR,i=e.reverseComparator;function s(g,x,w,E){for(var b=x[E],M,A;E>w;){if(M=E-1>>1,A=x[M],g(b,A)<0){x[E]=A,E=M;continue}break}x[E]=b}function o(g,x,w){for(var E=x.length,b=w,M=x[w],A=2*w+1,P;A=0&&(A=P),x[w]=x[A],w=A,A=2*w+1;x[w]=M,s(g,x,b,w)}function a(g,x,w){x.push(w),s(g,x,0,x.length-1)}function l(g,x){var w=x.pop();if(x.length!==0){var E=x[0];return x[0]=w,o(g,x,0),E}return w}function c(g,x,w){if(x.length===0)throw new Error("mnemonist/heap.replace: cannot pop an empty heap.");var E=x[0];return x[0]=w,o(g,x,0),E}function u(g,x,w){var E;return x.length!==0&&g(x[0],w)<0&&(E=x[0],x[0]=w,w=E,o(g,x,0)),w}function h(g,x){for(var w=x.length,E=w>>1,b=E;--b>=0;)o(g,x,b)}function p(g,x){for(var w=x.length,E=0,b=new Array(w);E=w.length)return w.slice().sort(g);for(C=w.slice(0,x),h(E,C),b=x,M=w.length;b0&&c(E,C,w[b]);return C.sort(g)}var L=t.guessLength(w);return L!==null&&L0&&c(E,C,F)),b++}),C.length>b&&(C.length=b),C.sort(g)}function v(g,x,w){arguments.length===2&&(w=x,x=g,g=n);var E=i(g),b,M,A,P=-1/0,C;if(x===1){if(t.isArrayLike(w)){for(b=0,M=w.length;b0)&&(P=A);return C=new w.constructor(1),C[0]=P,C}return r(w,function(F){(P===-1/0||g(F,P)>0)&&(P=F)}),[P]}if(t.isArrayLike(w)){if(x>=w.length)return w.slice().sort(E);for(C=w.slice(0,x),h(g,C),b=x,M=w.length;b0&&c(g,C,w[b]);return C.sort(E)}var L=t.guessLength(w);return L!==null&&L0&&c(g,C,F)),b++}),C.length>b&&(C.length=b),C.sort(E)}function _(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/Heap.constructor: given comparator should be a function.")}_.prototype.clear=function(){this.items=[],this.size=0},_.prototype.push=function(g){return a(this.comparator,this.items,g),++this.size},_.prototype.peek=function(){return this.items[0]},_.prototype.pop=function(){return this.size!==0&&this.size--,l(this.comparator,this.items)},_.prototype.replace=function(g){return c(this.comparator,this.items,g)},_.prototype.pushpop=function(g){return u(this.comparator,this.items,g)},_.prototype.consume=function(){return this.size=0,p(this.comparator,this.items)},_.prototype.toArray=function(){return p(this.comparator,this.items.slice())},_.prototype.inspect=function(){var g=this.toArray();return Object.defineProperty(g,"constructor",{value:_,enumerable:!1}),g},typeof Symbol<"u"&&(_.prototype[Symbol.for("nodejs.util.inspect.custom")]=_.prototype.inspect);function y(g){if(this.clear(),this.comparator=g||n,typeof this.comparator!="function")throw new Error("mnemonist/MaxHeap.constructor: given comparator should be a function.");this.comparator=i(this.comparator)}return y.prototype=_.prototype,_.from=function(g,x){var w=new _(x),E;return t.isArrayLike(g)?E=g.slice():E=t.toArray(g),h(w.comparator,E),w.items=E,w.size=E.length,w},y.from=function(g,x){var w=new y(x),E;return t.isArrayLike(g)?E=g.slice():E=t.toArray(g),h(w.comparator,E),w.items=E,w.size=E.length,w},_.siftUp=o,_.siftDown=s,_.push=a,_.pop=l,_.replace=c,_.pushpop=u,_.heapify=h,_.consume=p,_.nsmallest=m,_.nlargest=v,_.MinHeap=_,_.MaxHeap=y,i0=_,i0}var VS;function Fz(){if(VS)return jc;VS=1;var r=Xs(),e=Tp().createEdgeWeightGetter,t=tA(),n="weight";function i(h,p){return h[0]>p[0]?1:h[0]p[1]?1:h[1]p[2]?1:h[2]p[0]?1:h[0]p[1]?1:h[1]p[2]?1:h[2]p[3]?1:h[3]L)&&(E=L,w=y[0][N].concat(y[1][N].slice(0,-1).reverse()))))}}return[1/0,null]}function a(h,p,m,v,_,y){if(!r(h))throw new Error("graphology-shortest-path/dijkstra: invalid graphology instance.");m=e(m||n).fromMinimalEntry;var g={},x={},w=new t(i),E=0,b,M,A,P,C,L,F,N,I,X,q;for(N=0,X=p.length;Na[0]?1:o[0]a[1]?1:o[1]h.cutoff||(v[F]=[L,P],m.push([L+P,p++,F,L,g]))}}for(;m.size!==0;){if(y=m.pop(),g=y[2],w=y[3],E=y[4],g===l){for(b=[g],M=E;M!==null;)b.push(M),M=_[M];return b.reverse(),b}_.hasOwnProperty(g)&&(_[g]===null||(A=v[g][0],A0&&(L=M[0]),L instanceof Error)throw L;var F=new Error("Unhandled error."+(L?" ("+L.message+")":""));throw F.context=L,F}var N=C[b];if(N===void 0)return!1;if(typeof N=="function")e(N,this,M);else for(var I=N.length,X=v(N,I),A=0;A0&&L.length>P&&!L.warned){L.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+L.length+" "+String(b)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=E,F.type=b,F.count=L.length,n(F)}return E}s.prototype.addListener=function(b,M){return c(this,b,M,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(b,M){return c(this,b,M,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(E,b,M){var A={fired:!1,wrapFn:void 0,target:E,type:b,listener:M},P=u.bind(A);return P.listener=M,A.wrapFn=P,P}s.prototype.once=function(b,M){return a(M),this.on(b,h(this,b,M)),this},s.prototype.prependOnceListener=function(b,M){return a(M),this.prependListener(b,h(this,b,M)),this},s.prototype.removeListener=function(b,M){var A,P,C,L,F;if(a(M),P=this._events,P===void 0)return this;if(A=P[b],A===void 0)return this;if(A===M||A.listener===M)--this._eventsCount===0?this._events=Object.create(null):(delete P[b],P.removeListener&&this.emit("removeListener",b,A.listener||M));else if(typeof A!="function"){for(C=-1,L=A.length-1;L>=0;L--)if(A[L]===M||A[L].listener===M){F=A[L].listener,C=L;break}if(C<0)return this;C===0?A.shift():_(A,C),A.length===1&&(P[b]=A[0]),P.removeListener!==void 0&&this.emit("removeListener",b,F||M)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(b){var M,A,P;if(A=this._events,A===void 0)return this;if(A.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):A[b]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete A[b]),this;if(arguments.length===0){var C=Object.keys(A),L;for(P=0;P=0;P--)this.removeListener(b,M[P]);return this};function p(E,b,M){var A=E._events;if(A===void 0)return[];var P=A[b];return P===void 0?[]:typeof P=="function"?M?[P.listener||P]:[P]:M?y(P):v(P,P.length)}s.prototype.listeners=function(b){return p(this,b,!0)},s.prototype.rawListeners=function(b){return p(this,b,!1)},s.listenerCount=function(E,b){return typeof E.listenerCount=="function"?E.listenerCount(b):m.call(E,b)},s.prototype.listenerCount=m;function m(E){var b=this._events;if(b!==void 0){var M=b[E];if(typeof M=="function")return 1;if(M!==void 0)return M.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function v(E,b){for(var M=new Array(b),A=0;A1?n:1/0,s=i!==1/0?new Array(i):[],o,a=0,l=r(t);;){if(a===i)return s;if(o=l.next(),o.done)return a!==n&&(s.length=a),s;s[a++]=o.value}},o0}var Wz=Vz();const iA=Hr(Wz);var a0,ZS;function Xz(){if(ZS)return a0;ZS=1;var r=Cp(),e=nA();return a0=function(){var n=arguments,i=null,s=-1;return new r(function(){var a=null;do{if(i===null){if(s++,s>=n.length)return{done:!0};i=e(n[s])}if(a=i.next(),a.done===!0){i=null;continue}break}while(!0);return a})},a0}var jz=Xz();const zs=Hr(jz);function Yz(){const r=arguments[0];for(let e=1,t=arguments.length;er++}class jy extends Error{constructor(e){super(),this.name="GraphError",this.message=e}}class tt extends jy{constructor(e){super(e),this.name="InvalidArgumentsGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,tt.prototype.constructor)}}class je extends jy{constructor(e){super(e),this.name="NotFoundGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,je.prototype.constructor)}}class ft extends jy{constructor(e){super(e),this.name="UsageGraphError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,ft.prototype.constructor)}}function sA(r,e){this.key=r,this.attributes=e,this.clear()}sA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.undirectedDegree=0,this.undirectedLoops=0,this.directedLoops=0,this.in={},this.out={},this.undirected={}};function oA(r,e){this.key=r,this.attributes=e,this.clear()}oA.prototype.clear=function(){this.inDegree=0,this.outDegree=0,this.directedLoops=0,this.in={},this.out={}};function aA(r,e){this.key=r,this.attributes=e,this.clear()}aA.prototype.clear=function(){this.undirectedDegree=0,this.undirectedLoops=0,this.undirected={}};function nc(r,e,t,n,i){this.key=e,this.attributes=i,this.undirected=r,this.source=t,this.target=n}nc.prototype.attach=function(){let r="out",e="in";this.undirected&&(r=e="undirected");const t=this.source.key,n=this.target.key;this.source[r][n]=this,!(this.undirected&&t===n)&&(this.target[e][t]=this)};nc.prototype.attachMulti=function(){let r="out",e="in";const t=this.source.key,n=this.target.key;this.undirected&&(r=e="undirected");const i=this.source[r],s=i[n];if(typeof s>"u"){i[n]=this,this.undirected&&t===n||(this.target[e][t]=this);return}s.previous=this,this.next=s,i[n]=this,this.target[e][t]=this};nc.prototype.detach=function(){const r=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),delete this.source[t][e],delete this.target[n][r]};nc.prototype.detachMulti=function(){const r=this.source.key,e=this.target.key;let t="out",n="in";this.undirected&&(t=n="undirected"),this.previous===void 0?this.next===void 0?(delete this.source[t][e],delete this.target[n][r]):(this.next.previous=void 0,this.source[t][e]=this.next,this.target[n][r]=this.next):(this.previous.next=this.next,this.next!==void 0&&(this.next.previous=this.previous))};const lA=0,cA=1,Zz=2,uA=3;function js(r,e,t,n,i,s,o){let a,l,c,u;if(n=""+n,t===lA){if(a=r._nodes.get(n),!a)throw new je(`Graph.${e}: could not find the "${n}" node in the graph.`);c=i,u=s}else if(t===uA){if(i=""+i,l=r._edges.get(i),!l)throw new je(`Graph.${e}: could not find the "${i}" edge in the graph.`);const h=l.source.key,p=l.target.key;if(n===h)a=l.target;else if(n===p)a=l.source;else throw new je(`Graph.${e}: the "${n}" node is not attached to the "${i}" edge (${h}, ${p}).`);c=s,u=o}else{if(l=r._edges.get(n),!l)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`);t===cA?a=l.source:a=l.target,c=i,u=s}return[a,c,u]}function Kz(r,e,t){r.prototype[e]=function(n,i,s){const[o,a]=js(this,e,t,n,i,s);return o.attributes[a]}}function $z(r,e,t){r.prototype[e]=function(n,i){const[s]=js(this,e,t,n,i);return s.attributes}}function Jz(r,e,t){r.prototype[e]=function(n,i,s){const[o,a]=js(this,e,t,n,i,s);return o.attributes.hasOwnProperty(a)}}function Qz(r,e,t){r.prototype[e]=function(n,i,s,o){const[a,l,c]=js(this,e,t,n,i,s,o);return a.attributes[l]=c,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:l}),this}}function eB(r,e,t){r.prototype[e]=function(n,i,s,o){const[a,l,c]=js(this,e,t,n,i,s,o);if(typeof c!="function")throw new tt(`Graph.${e}: updater should be a function.`);const u=a.attributes,h=c(u[l]);return u[l]=h,this.emit("nodeAttributesUpdated",{key:a.key,type:"set",attributes:a.attributes,name:l}),this}}function tB(r,e,t){r.prototype[e]=function(n,i,s){const[o,a]=js(this,e,t,n,i,s);return delete o.attributes[a],this.emit("nodeAttributesUpdated",{key:o.key,type:"remove",attributes:o.attributes,name:a}),this}}function nB(r,e,t){r.prototype[e]=function(n,i,s){const[o,a]=js(this,e,t,n,i,s);if(!ri(a))throw new tt(`Graph.${e}: provided attributes are not a plain object.`);return o.attributes=a,this.emit("nodeAttributesUpdated",{key:o.key,type:"replace",attributes:o.attributes}),this}}function iB(r,e,t){r.prototype[e]=function(n,i,s){const[o,a]=js(this,e,t,n,i,s);if(!ri(a))throw new tt(`Graph.${e}: provided attributes are not a plain object.`);return Vn(o.attributes,a),this.emit("nodeAttributesUpdated",{key:o.key,type:"merge",attributes:o.attributes,data:a}),this}}function rB(r,e,t){r.prototype[e]=function(n,i,s){const[o,a]=js(this,e,t,n,i,s);if(typeof a!="function")throw new tt(`Graph.${e}: provided updater is not a function.`);return o.attributes=a(o.attributes),this.emit("nodeAttributesUpdated",{key:o.key,type:"update",attributes:o.attributes}),this}}const sB=[{name:r=>`get${r}Attribute`,attacher:Kz},{name:r=>`get${r}Attributes`,attacher:$z},{name:r=>`has${r}Attribute`,attacher:Jz},{name:r=>`set${r}Attribute`,attacher:Qz},{name:r=>`update${r}Attribute`,attacher:eB},{name:r=>`remove${r}Attribute`,attacher:tB},{name:r=>`replace${r}Attributes`,attacher:nB},{name:r=>`merge${r}Attributes`,attacher:iB},{name:r=>`update${r}Attributes`,attacher:rB}];function oB(r){sB.forEach(function({name:e,attacher:t}){t(r,e("Node"),lA),t(r,e("Source"),cA),t(r,e("Target"),Zz),t(r,e("Opposite"),uA)})}function aB(r,e,t){r.prototype[e]=function(n,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,a=""+i;if(i=arguments[2],s=br(this,o,a,t),!s)throw new je(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes[i]}}function lB(r,e,t){r.prototype[e]=function(n){let i;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>1){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const s=""+n,o=""+arguments[1];if(i=br(this,s,o,t),!i)throw new je(`Graph.${e}: could not find an edge for the given path ("${s}" - "${o}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,i=this._edges.get(n),!i)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return i.attributes}}function cB(r,e,t){r.prototype[e]=function(n,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,a=""+i;if(i=arguments[2],s=br(this,o,a,t),!s)throw new je(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return s.attributes.hasOwnProperty(i)}}function uB(r,e,t){r.prototype[e]=function(n,i,s){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,l=""+i;if(i=arguments[2],s=arguments[3],o=br(this,a,l,t),!o)throw new je(`Graph.${e}: could not find an edge for the given path ("${a}" - "${l}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,o=this._edges.get(n),!o)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return o.attributes[i]=s,this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function hB(r,e,t){r.prototype[e]=function(n,i,s){let o;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>3){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const a=""+n,l=""+i;if(i=arguments[2],s=arguments[3],o=br(this,a,l,t),!o)throw new je(`Graph.${e}: could not find an edge for the given path ("${a}" - "${l}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,o=this._edges.get(n),!o)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof s!="function")throw new tt(`Graph.${e}: updater should be a function.`);return o.attributes[i]=s(o.attributes[i]),this.emit("edgeAttributesUpdated",{key:o.key,type:"set",attributes:o.attributes,name:i}),this}}function fB(r,e,t){r.prototype[e]=function(n,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,a=""+i;if(i=arguments[2],s=br(this,o,a,t),!s)throw new je(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}return delete s.attributes[i],this.emit("edgeAttributesUpdated",{key:s.key,type:"remove",attributes:s.attributes,name:i}),this}}function dB(r,e,t){r.prototype[e]=function(n,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,a=""+i;if(i=arguments[2],s=br(this,o,a,t),!s)throw new je(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!ri(i))throw new tt(`Graph.${e}: provided attributes are not a plain object.`);return s.attributes=i,this.emit("edgeAttributesUpdated",{key:s.key,type:"replace",attributes:s.attributes}),this}}function pB(r,e,t){r.prototype[e]=function(n,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,a=""+i;if(i=arguments[2],s=br(this,o,a,t),!s)throw new je(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(!ri(i))throw new tt(`Graph.${e}: provided attributes are not a plain object.`);return Vn(s.attributes,i),this.emit("edgeAttributesUpdated",{key:s.key,type:"merge",attributes:s.attributes,data:i}),this}}function mB(r,e,t){r.prototype[e]=function(n,i){let s;if(this.type!=="mixed"&&t!=="mixed"&&t!==this.type)throw new ft(`Graph.${e}: cannot find this type of edges in your ${this.type} graph.`);if(arguments.length>2){if(this.multi)throw new ft(`Graph.${e}: cannot use a {source,target} combo when asking about an edge's attributes in a MultiGraph since we cannot infer the one you want information about.`);const o=""+n,a=""+i;if(i=arguments[2],s=br(this,o,a,t),!s)throw new je(`Graph.${e}: could not find an edge for the given path ("${o}" - "${a}").`)}else{if(t!=="mixed")throw new ft(`Graph.${e}: calling this method with only a key (vs. a source and target) does not make sense since an edge with this key could have the other type.`);if(n=""+n,s=this._edges.get(n),!s)throw new je(`Graph.${e}: could not find the "${n}" edge in the graph.`)}if(typeof i!="function")throw new tt(`Graph.${e}: provided updater is not a function.`);return s.attributes=i(s.attributes),this.emit("edgeAttributesUpdated",{key:s.key,type:"update",attributes:s.attributes}),this}}const gB=[{name:r=>`get${r}Attribute`,attacher:aB},{name:r=>`get${r}Attributes`,attacher:lB},{name:r=>`has${r}Attribute`,attacher:cB},{name:r=>`set${r}Attribute`,attacher:uB},{name:r=>`update${r}Attribute`,attacher:hB},{name:r=>`remove${r}Attribute`,attacher:fB},{name:r=>`replace${r}Attributes`,attacher:dB},{name:r=>`merge${r}Attributes`,attacher:pB},{name:r=>`update${r}Attributes`,attacher:mB}];function vB(r){gB.forEach(function({name:e,attacher:t}){t(r,e("Edge"),"mixed"),t(r,e("DirectedEdge"),"directed"),t(r,e("UndirectedEdge"),"undirected")})}const yB=[{name:"edges",type:"mixed"},{name:"inEdges",type:"directed",direction:"in"},{name:"outEdges",type:"directed",direction:"out"},{name:"inboundEdges",type:"mixed",direction:"in"},{name:"outboundEdges",type:"mixed",direction:"out"},{name:"directedEdges",type:"directed"},{name:"undirectedEdges",type:"undirected"}];function _B(r,e,t,n){let i=!1;for(const s in e){if(s===n)continue;const o=e[s];if(i=t(o.key,o.attributes,o.source.key,o.target.key,o.source.attributes,o.target.attributes,o.undirected),r&&i)return o.key}}function xB(r,e,t,n){let i,s,o,a=!1;for(const l in e)if(l!==n){i=e[l];do{if(s=i.source,o=i.target,a=t(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected),r&&a)return i.key;i=i.next}while(i!==void 0)}}function l0(r,e){const t=Object.keys(r),n=t.length;let i,s=0;return new Mr(function(){do if(i)i=i.next;else{if(s>=n)return{done:!0};const a=t[s++];if(a===e){i=void 0;continue}i=r[a]}while(!i);return{done:!1,value:{edge:i.key,attributes:i.attributes,source:i.source.key,target:i.target.key,sourceAttributes:i.source.attributes,targetAttributes:i.target.attributes,undirected:i.undirected}}})}function wB(r,e,t,n){const i=e[t];if(!i)return;const s=i.source,o=i.target;if(n(i.key,i.attributes,s.key,o.key,s.attributes,o.attributes,i.undirected)&&r)return i.key}function SB(r,e,t,n){let i=e[t];if(!i)return;let s=!1;do{if(s=n(i.key,i.attributes,i.source.key,i.target.key,i.source.attributes,i.target.attributes,i.undirected),r&&s)return i.key;i=i.next}while(i!==void 0)}function c0(r,e){let t=r[e];return t.next!==void 0?new Mr(function(){if(!t)return{done:!0};const n={edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected};return t=t.next,{done:!1,value:n}}):Mr.of({edge:t.key,attributes:t.attributes,source:t.source.key,target:t.target.key,sourceAttributes:t.source.attributes,targetAttributes:t.target.attributes,undirected:t.undirected})}function EB(r,e){if(r.size===0)return[];if(e==="mixed"||e===r.type)return typeof Array.from=="function"?Array.from(r._edges.keys()):iA(r._edges.keys(),r._edges.size);const t=e==="undirected"?r.undirectedSize:r.directedSize,n=new Array(t),i=e==="undirected",s=r._edges.values();let o=0,a,l;for(;a=s.next(),a.done!==!0;)l=a.value,l.undirected===i&&(n[o++]=l.key);return n}function hA(r,e,t,n){if(e.size===0)return;const i=t!=="mixed"&&t!==e.type,s=t==="undirected";let o,a,l=!1;const c=e._edges.values();for(;o=c.next(),o.done!==!0;){if(a=o.value,i&&a.undirected!==s)continue;const{key:u,attributes:h,source:p,target:m}=a;if(l=n(u,h,p.key,m.key,p.attributes,m.attributes,a.undirected),r&&l)return u}}function bB(r,e){if(r.size===0)return Mr.empty();const t=e!=="mixed"&&e!==r.type,n=e==="undirected",i=r._edges.values();return new Mr(function(){let o,a;for(;;){if(o=i.next(),o.done)return o;if(a=o.value,!(t&&a.undirected!==n))break}return{value:{edge:a.key,attributes:a.attributes,source:a.source.key,target:a.target.key,sourceAttributes:a.source.attributes,targetAttributes:a.target.attributes,undirected:a.undirected},done:!1}})}function Yy(r,e,t,n,i,s){const o=e?xB:_B;let a;if(t!=="undirected"&&(n!=="out"&&(a=o(r,i.in,s),r&&a)||n!=="in"&&(a=o(r,i.out,s,n?void 0:i.key),r&&a))||t!=="directed"&&(a=o(r,i.undirected,s),r&&a))return a}function MB(r,e,t,n){const i=[];return Yy(!1,r,e,t,n,function(s){i.push(s)}),i}function TB(r,e,t){let n=Mr.empty();return r!=="undirected"&&(e!=="out"&&typeof t.in<"u"&&(n=zs(n,l0(t.in))),e!=="in"&&typeof t.out<"u"&&(n=zs(n,l0(t.out,e?void 0:t.key)))),r!=="directed"&&typeof t.undirected<"u"&&(n=zs(n,l0(t.undirected))),n}function qy(r,e,t,n,i,s,o){const a=t?SB:wB;let l;if(e!=="undirected"&&(typeof i.in<"u"&&n!=="out"&&(l=a(r,i.in,s,o),r&&l)||typeof i.out<"u"&&n!=="in"&&(n||i.key!==s)&&(l=a(r,i.out,s,o),r&&l))||e!=="directed"&&typeof i.undirected<"u"&&(l=a(r,i.undirected,s,o),r&&l))return l}function AB(r,e,t,n,i){const s=[];return qy(!1,r,e,t,n,i,function(o){s.push(o)}),s}function CB(r,e,t,n){let i=Mr.empty();return r!=="undirected"&&(typeof t.in<"u"&&e!=="out"&&n in t.in&&(i=zs(i,c0(t.in,n))),typeof t.out<"u"&&e!=="in"&&n in t.out&&(e||t.key!==n)&&(i=zs(i,c0(t.out,n)))),r!=="directed"&&typeof t.undirected<"u"&&n in t.undirected&&(i=zs(i,c0(t.undirected,n))),i}function RB(r,e){const{name:t,type:n,direction:i}=e;r.prototype[t]=function(s,o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];if(!arguments.length)return EB(this,n);if(arguments.length===1){s=""+s;const a=this._nodes.get(s);if(typeof a>"u")throw new je(`Graph.${t}: could not find the "${s}" node in the graph.`);return MB(this.multi,n==="mixed"?this.type:n,i,a)}if(arguments.length===2){s=""+s,o=""+o;const a=this._nodes.get(s);if(!a)throw new je(`Graph.${t}: could not find the "${s}" source node in the graph.`);if(!this._nodes.has(o))throw new je(`Graph.${t}: could not find the "${o}" target node in the graph.`);return AB(n,this.multi,i,a,o)}throw new tt(`Graph.${t}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function PB(r,e){const{name:t,type:n,direction:i}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[s]=function(c,u,h){if(!(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)){if(arguments.length===1)return h=c,hA(!1,this,n,h);if(arguments.length===2){c=""+c,h=u;const p=this._nodes.get(c);if(typeof p>"u")throw new je(`Graph.${s}: could not find the "${c}" node in the graph.`);return Yy(!1,this.multi,n==="mixed"?this.type:n,i,p,h)}if(arguments.length===3){c=""+c,u=""+u;const p=this._nodes.get(c);if(!p)throw new je(`Graph.${s}: could not find the "${c}" source node in the graph.`);if(!this._nodes.has(u))throw new je(`Graph.${s}: could not find the "${u}" target node in the graph.`);return qy(!1,n,this.multi,i,p,u,h)}throw new tt(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)}};const o="map"+t[0].toUpperCase()+t.slice(1);r.prototype[o]=function(){const c=Array.prototype.slice.call(arguments),u=c.pop();let h;if(c.length===0){let p=0;n!=="directed"&&(p+=this.undirectedSize),n!=="undirected"&&(p+=this.directedSize),h=new Array(p);let m=0;c.push((v,_,y,g,x,w,E)=>{h[m++]=u(v,_,y,g,x,w,E)})}else h=[],c.push((p,m,v,_,y,g,x)=>{h.push(u(p,m,v,_,y,g,x))});return this[s].apply(this,c),h};const a="filter"+t[0].toUpperCase()+t.slice(1);r.prototype[a]=function(){const c=Array.prototype.slice.call(arguments),u=c.pop(),h=[];return c.push((p,m,v,_,y,g,x)=>{u(p,m,v,_,y,g,x)&&h.push(p)}),this[s].apply(this,c),h};const l="reduce"+t[0].toUpperCase()+t.slice(1);r.prototype[l]=function(){let c=Array.prototype.slice.call(arguments);if(c.length<2||c.length>4)throw new tt(`Graph.${l}: invalid number of arguments (expecting 2, 3 or 4 and got ${c.length}).`);if(typeof c[c.length-1]=="function"&&typeof c[c.length-2]!="function")throw new tt(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let u,h;c.length===2?(u=c[0],h=c[1],c=[]):c.length===3?(u=c[1],h=c[2],c=[c[0]]):c.length===4&&(u=c[2],h=c[3],c=[c[0],c[1]]);let p=h;return c.push((m,v,_,y,g,x,w)=>{p=u(p,m,v,_,y,g,x,w)}),this[s].apply(this,c),p}}function LB(r,e){const{name:t,type:n,direction:i}=e,s="find"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[s]=function(l,c,u){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return!1;if(arguments.length===1)return u=l,hA(!0,this,n,u);if(arguments.length===2){l=""+l,u=c;const h=this._nodes.get(l);if(typeof h>"u")throw new je(`Graph.${s}: could not find the "${l}" node in the graph.`);return Yy(!0,this.multi,n==="mixed"?this.type:n,i,h,u)}if(arguments.length===3){l=""+l,c=""+c;const h=this._nodes.get(l);if(!h)throw new je(`Graph.${s}: could not find the "${l}" source node in the graph.`);if(!this._nodes.has(c))throw new je(`Graph.${s}: could not find the "${c}" target node in the graph.`);return qy(!0,n,this.multi,i,h,c,u)}throw new tt(`Graph.${s}: too many arguments (expecting 1, 2 or 3 and got ${arguments.length}).`)};const o="some"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[o]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((h,p,m,v,_,y,g)=>c(h,p,m,v,_,y,g)),!!this[s].apply(this,l)};const a="every"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[a]=function(){const l=Array.prototype.slice.call(arguments),c=l.pop();return l.push((h,p,m,v,_,y,g)=>!c(h,p,m,v,_,y,g)),!this[s].apply(this,l)}}function IB(r,e){const{name:t,type:n,direction:i}=e,s=t.slice(0,-1)+"Entries";r.prototype[s]=function(o,a){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Mr.empty();if(!arguments.length)return bB(this,n);if(arguments.length===1){o=""+o;const l=this._nodes.get(o);if(!l)throw new je(`Graph.${s}: could not find the "${o}" node in the graph.`);return TB(n,i,l)}if(arguments.length===2){o=""+o,a=""+a;const l=this._nodes.get(o);if(!l)throw new je(`Graph.${s}: could not find the "${o}" source node in the graph.`);if(!this._nodes.has(a))throw new je(`Graph.${s}: could not find the "${a}" target node in the graph.`);return CB(n,i,l,a)}throw new tt(`Graph.${s}: too many arguments (expecting 0, 1 or 2 and got ${arguments.length}).`)}}function DB(r){yB.forEach(e=>{RB(r,e),PB(r,e),LB(r,e),IB(r,e)})}const UB=[{name:"neighbors",type:"mixed"},{name:"inNeighbors",type:"directed",direction:"in"},{name:"outNeighbors",type:"directed",direction:"out"},{name:"inboundNeighbors",type:"mixed",direction:"in"},{name:"outboundNeighbors",type:"mixed",direction:"out"},{name:"directedNeighbors",type:"directed"},{name:"undirectedNeighbors",type:"undirected"}];function Rp(){this.A=null,this.B=null}Rp.prototype.wrap=function(r){this.A===null?this.A=r:this.B===null&&(this.B=r)};Rp.prototype.has=function(r){return this.A!==null&&r in this.A||this.B!==null&&r in this.B};function Yc(r,e,t,n,i){for(const s in n){const o=n[s],a=o.source,l=o.target,c=a===t?l:a;if(e&&e.has(c.key))continue;const u=i(c.key,c.attributes);if(r&&u)return c.key}}function Zy(r,e,t,n,i){if(e!=="mixed"){if(e==="undirected")return Yc(r,null,n,n.undirected,i);if(typeof t=="string")return Yc(r,null,n,n[t],i)}const s=new Rp;let o;if(e!=="undirected"){if(t!=="out"){if(o=Yc(r,null,n,n.in,i),r&&o)return o;s.wrap(n.in)}if(t!=="in"){if(o=Yc(r,s,n,n.out,i),r&&o)return o;s.wrap(n.out)}}if(e!=="directed"&&(o=Yc(r,s,n,n.undirected,i),r&&o))return o}function OB(r,e,t){if(r!=="mixed"){if(r==="undirected")return Object.keys(t.undirected);if(typeof e=="string")return Object.keys(t[e])}const n=[];return Zy(!1,r,e,t,function(i){n.push(i)}),n}function qc(r,e,t){const n=Object.keys(t),i=n.length;let s=0;return new Mr(function(){let a=null;do{if(s>=i)return r&&r.wrap(t),{done:!0};const l=t[n[s++]],c=l.source,u=l.target;if(a=c===e?u:c,r&&r.has(a.key)){a=null;continue}}while(a===null);return{done:!1,value:{neighbor:a.key,attributes:a.attributes}}})}function NB(r,e,t){if(r!=="mixed"){if(r==="undirected")return qc(null,t,t.undirected);if(typeof e=="string")return qc(null,t,t[e])}let n=Mr.empty();const i=new Rp;return r!=="undirected"&&(e!=="out"&&(n=zs(n,qc(i,t,t.in))),e!=="in"&&(n=zs(n,qc(i,t,t.out)))),r!=="directed"&&(n=zs(n,qc(i,t,t.undirected))),n}function FB(r,e){const{name:t,type:n,direction:i}=e;r.prototype[t]=function(s){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return[];s=""+s;const o=this._nodes.get(s);if(typeof o>"u")throw new je(`Graph.${t}: could not find the "${s}" node in the graph.`);return OB(n==="mixed"?this.type:n,i,o)}}function kB(r,e){const{name:t,type:n,direction:i}=e,s="forEach"+t[0].toUpperCase()+t.slice(1,-1);r.prototype[s]=function(c,u){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const h=this._nodes.get(c);if(typeof h>"u")throw new je(`Graph.${s}: could not find the "${c}" node in the graph.`);Zy(!1,n==="mixed"?this.type:n,i,h,u)};const o="map"+t[0].toUpperCase()+t.slice(1);r.prototype[o]=function(c,u){const h=[];return this[s](c,(p,m)=>{h.push(u(p,m))}),h};const a="filter"+t[0].toUpperCase()+t.slice(1);r.prototype[a]=function(c,u){const h=[];return this[s](c,(p,m)=>{u(p,m)&&h.push(p)}),h};const l="reduce"+t[0].toUpperCase()+t.slice(1);r.prototype[l]=function(c,u,h){if(arguments.length<3)throw new tt(`Graph.${l}: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.`);let p=h;return this[s](c,(m,v)=>{p=u(p,m,v)}),p}}function zB(r,e){const{name:t,type:n,direction:i}=e,s=t[0].toUpperCase()+t.slice(1,-1),o="find"+s;r.prototype[o]=function(c,u){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return;c=""+c;const h=this._nodes.get(c);if(typeof h>"u")throw new je(`Graph.${o}: could not find the "${c}" node in the graph.`);return Zy(!0,n==="mixed"?this.type:n,i,h,u)};const a="some"+s;r.prototype[a]=function(c,u){return!!this[o](c,u)};const l="every"+s;r.prototype[l]=function(c,u){return!this[o](c,(p,m)=>!u(p,m))}}function BB(r,e){const{name:t,type:n,direction:i}=e,s=t.slice(0,-1)+"Entries";r.prototype[s]=function(o){if(n!=="mixed"&&this.type!=="mixed"&&n!==this.type)return Mr.empty();o=""+o;const a=this._nodes.get(o);if(typeof a>"u")throw new je(`Graph.${s}: could not find the "${o}" node in the graph.`);return NB(n==="mixed"?this.type:n,i,a)}}function GB(r){UB.forEach(e=>{FB(r,e),kB(r,e),zB(r,e),BB(r,e)})}function rd(r,e,t,n,i){const s=n._nodes.values(),o=n.type;let a,l,c,u,h,p;for(;a=s.next(),a.done!==!0;){let m=!1;if(l=a.value,o!=="undirected"){u=l.out;for(c in u){h=u[c];do p=h.target,m=!0,i(l.key,p.key,l.attributes,p.attributes,h.key,h.attributes,h.undirected),h=h.next;while(h)}}if(o!=="directed"){u=l.undirected;for(c in u)if(!(e&&l.key>c)){h=u[c];do p=h.target,p.key!==c&&(p=h.source),m=!0,i(l.key,p.key,l.attributes,p.attributes,h.key,h.attributes,h.undirected),h=h.next;while(h)}}t&&!m&&i(l.key,null,l.attributes,null,null,null,null)}}function HB(r,e){const t={key:r};return rA(e.attributes)||(t.attributes=Vn({},e.attributes)),t}function VB(r,e,t){const n={key:e,source:t.source.key,target:t.target.key};return rA(t.attributes)||(n.attributes=Vn({},t.attributes)),r==="mixed"&&t.undirected&&(n.undirected=!0),n}function WB(r){if(!ri(r))throw new tt('Graph.import: invalid serialized node. A serialized node should be a plain object with at least a "key" property.');if(!("key"in r))throw new tt("Graph.import: serialized node is missing its key.");if("attributes"in r&&(!ri(r.attributes)||r.attributes===null))throw new tt("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.")}function XB(r){if(!ri(r))throw new tt('Graph.import: invalid serialized edge. A serialized edge should be a plain object with at least a "source" & "target" property.');if(!("source"in r))throw new tt("Graph.import: serialized edge is missing its source.");if(!("target"in r))throw new tt("Graph.import: serialized edge is missing its target.");if("attributes"in r&&(!ri(r.attributes)||r.attributes===null))throw new tt("Graph.import: invalid attributes. Attributes should be a plain object, null or omitted.");if("undirected"in r&&typeof r.undirected!="boolean")throw new tt("Graph.import: invalid undirectedness information. Undirected should be boolean or omitted.")}const jB=qz(),YB=new Set(["directed","undirected","mixed"]),$S=new Set(["domain","_events","_eventsCount","_maxListeners"]),qB=[{name:r=>`${r}Edge`,generateKey:!0},{name:r=>`${r}DirectedEdge`,generateKey:!0,type:"directed"},{name:r=>`${r}UndirectedEdge`,generateKey:!0,type:"undirected"},{name:r=>`${r}EdgeWithKey`},{name:r=>`${r}DirectedEdgeWithKey`,type:"directed"},{name:r=>`${r}UndirectedEdgeWithKey`,type:"undirected"}],ZB={allowSelfLoops:!0,multi:!1,type:"mixed"};function KB(r,e,t){if(t&&!ri(t))throw new tt(`Graph.addNode: invalid attributes. Expecting an object but got "${t}"`);if(e=""+e,t=t||{},r._nodes.has(e))throw new ft(`Graph.addNode: the "${e}" node already exist in the graph.`);const n=new r.NodeDataClass(e,t);return r._nodes.set(e,n),r.emit("nodeAdded",{key:e,attributes:t}),n}function JS(r,e,t){const n=new r.NodeDataClass(e,t);return r._nodes.set(e,n),r.emit("nodeAdded",{key:e,attributes:t}),n}function fA(r,e,t,n,i,s,o,a){if(!n&&r.type==="undirected")throw new ft(`Graph.${e}: you cannot add a directed edge to an undirected graph. Use the #.addEdge or #.addUndirectedEdge instead.`);if(n&&r.type==="directed")throw new ft(`Graph.${e}: you cannot add an undirected edge to a directed graph. Use the #.addEdge or #.addDirectedEdge instead.`);if(a&&!ri(a))throw new tt(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`);if(s=""+s,o=""+o,a=a||{},!r.allowSelfLoops&&s===o)throw new ft(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);const l=r._nodes.get(s),c=r._nodes.get(o);if(!l)throw new je(`Graph.${e}: source node "${s}" not found.`);if(!c)throw new je(`Graph.${e}: target node "${o}" not found.`);const u={key:null,undirected:n,source:s,target:o,attributes:a};if(t)i=r._edgeKeyGenerator();else if(i=""+i,r._edges.has(i))throw new ft(`Graph.${e}: the "${i}" edge already exists in the graph.`);if(!r.multi&&(n?typeof l.undirected[o]<"u":typeof l.out[o]<"u"))throw new ft(`Graph.${e}: an edge linking "${s}" to "${o}" already exists. If you really want to add multiple edges linking those nodes, you should create a multi graph by using the 'multi' option.`);const h=new nc(n,i,l,c,a);r._edges.set(i,h);const p=s===o;return n?(l.undirectedDegree++,c.undirectedDegree++,p&&(l.undirectedLoops++,r._undirectedSelfLoopCount++)):(l.outDegree++,c.inDegree++,p&&(l.directedLoops++,r._directedSelfLoopCount++)),r.multi?h.attachMulti():h.attach(),n?r._undirectedSize++:r._directedSize++,u.key=i,r.emit("edgeAdded",u),i}function $B(r,e,t,n,i,s,o,a,l){if(!n&&r.type==="undirected")throw new ft(`Graph.${e}: you cannot merge/update a directed edge to an undirected graph. Use the #.mergeEdge/#.updateEdge or #.addUndirectedEdge instead.`);if(n&&r.type==="directed")throw new ft(`Graph.${e}: you cannot merge/update an undirected edge to a directed graph. Use the #.mergeEdge/#.updateEdge or #.addDirectedEdge instead.`);if(a){if(l){if(typeof a!="function")throw new tt(`Graph.${e}: invalid updater function. Expecting a function but got "${a}"`)}else if(!ri(a))throw new tt(`Graph.${e}: invalid attributes. Expecting an object but got "${a}"`)}s=""+s,o=""+o;let c;if(l&&(c=a,a=void 0),!r.allowSelfLoops&&s===o)throw new ft(`Graph.${e}: source & target are the same ("${s}"), thus creating a loop explicitly forbidden by this graph 'allowSelfLoops' option set to false.`);let u=r._nodes.get(s),h=r._nodes.get(o),p,m;if(!t&&(p=r._edges.get(i),p)){if((p.source.key!==s||p.target.key!==o)&&(!n||p.source.key!==o||p.target.key!==s))throw new ft(`Graph.${e}: inconsistency detected when attempting to merge the "${i}" edge with "${s}" source & "${o}" target vs. ("${p.source.key}", "${p.target.key}").`);m=p}if(!m&&!r.multi&&u&&(m=n?u.undirected[o]:u.out[o]),m){const x=[m.key,!1,!1,!1];if(l?!c:!a)return x;if(l){const w=m.attributes;m.attributes=c(w),r.emit("edgeAttributesUpdated",{type:"replace",key:m.key,attributes:m.attributes})}else Vn(m.attributes,a),r.emit("edgeAttributesUpdated",{type:"merge",key:m.key,attributes:m.attributes,data:a});return x}a=a||{},l&&c&&(a=c(a));const v={key:null,undirected:n,source:s,target:o,attributes:a};if(t)i=r._edgeKeyGenerator();else if(i=""+i,r._edges.has(i))throw new ft(`Graph.${e}: the "${i}" edge already exists in the graph.`);let _=!1,y=!1;u||(u=JS(r,s,{}),_=!0,s===o&&(h=u,y=!0)),h||(h=JS(r,o,{}),y=!0),p=new nc(n,i,u,h,a),r._edges.set(i,p);const g=s===o;return n?(u.undirectedDegree++,h.undirectedDegree++,g&&(u.undirectedLoops++,r._undirectedSelfLoopCount++)):(u.outDegree++,h.inDegree++,g&&(u.directedLoops++,r._directedSelfLoopCount++)),r.multi?p.attachMulti():p.attach(),n?r._undirectedSize++:r._directedSize++,v.key=i,r.emit("edgeAdded",v),[i,!0,_,y]}function El(r,e){r._edges.delete(e.key);const{source:t,target:n,attributes:i}=e,s=e.undirected,o=t===n;s?(t.undirectedDegree--,n.undirectedDegree--,o&&(t.undirectedLoops--,r._undirectedSelfLoopCount--)):(t.outDegree--,n.inDegree--,o&&(t.directedLoops--,r._directedSelfLoopCount--)),r.multi?e.detachMulti():e.detach(),s?r._undirectedSize--:r._directedSize--,r.emit("edgeDropped",{key:e.key,attributes:i,source:t.key,target:n.key,undirected:s})}class en extends Gz.EventEmitter{constructor(e){if(super(),e=Vn({},ZB,e),typeof e.multi!="boolean")throw new tt(`Graph.constructor: invalid 'multi' option. Expecting a boolean but got "${e.multi}".`);if(!YB.has(e.type))throw new tt(`Graph.constructor: invalid 'type' option. Should be one of "mixed", "directed" or "undirected" but got "${e.type}".`);if(typeof e.allowSelfLoops!="boolean")throw new tt(`Graph.constructor: invalid 'allowSelfLoops' option. Expecting a boolean but got "${e.allowSelfLoops}".`);const t=e.type==="mixed"?sA:e.type==="directed"?oA:aA;mr(this,"NodeDataClass",t);const n="geid_"+jB()+"_";let i=0;const s=()=>{let o;do o=n+i++;while(this._edges.has(o));return o};mr(this,"_attributes",{}),mr(this,"_nodes",new Map),mr(this,"_edges",new Map),mr(this,"_directedSize",0),mr(this,"_undirectedSize",0),mr(this,"_directedSelfLoopCount",0),mr(this,"_undirectedSelfLoopCount",0),mr(this,"_edgeKeyGenerator",s),mr(this,"_options",e),$S.forEach(o=>mr(this,o,this[o])),Ir(this,"order",()=>this._nodes.size),Ir(this,"size",()=>this._edges.size),Ir(this,"directedSize",()=>this._directedSize),Ir(this,"undirectedSize",()=>this._undirectedSize),Ir(this,"selfLoopCount",()=>this._directedSelfLoopCount+this._undirectedSelfLoopCount),Ir(this,"directedSelfLoopCount",()=>this._directedSelfLoopCount),Ir(this,"undirectedSelfLoopCount",()=>this._undirectedSelfLoopCount),Ir(this,"multi",this._options.multi),Ir(this,"type",this._options.type),Ir(this,"allowSelfLoops",this._options.allowSelfLoops),Ir(this,"implementation",()=>"graphology")}_resetInstanceCounters(){this._directedSize=0,this._undirectedSize=0,this._directedSelfLoopCount=0,this._undirectedSelfLoopCount=0}hasNode(e){return this._nodes.has(""+e)}hasDirectedEdge(e,t){if(this.type==="undirected")return!1;if(arguments.length===1){const n=""+e,i=this._edges.get(n);return!!i&&!i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.out.hasOwnProperty(t):!1}throw new tt(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasUndirectedEdge(e,t){if(this.type==="directed")return!1;if(arguments.length===1){const n=""+e,i=this._edges.get(n);return!!i&&i.undirected}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?n.undirected.hasOwnProperty(t):!1}throw new tt(`Graph.hasDirectedEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}hasEdge(e,t){if(arguments.length===1){const n=""+e;return this._edges.has(n)}else if(arguments.length===2){e=""+e,t=""+t;const n=this._nodes.get(e);return n?typeof n.out<"u"&&n.out.hasOwnProperty(t)||typeof n.undirected<"u"&&n.undirected.hasOwnProperty(t):!1}throw new tt(`Graph.hasEdge: invalid arity (${arguments.length}, instead of 1 or 2). You can either ask for an edge id or for the existence of an edge between a source & a target.`)}directedEdge(e,t){if(this.type==="undirected")return;if(e=""+e,t=""+t,this.multi)throw new ft("Graph.directedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.directedEdges instead.");const n=this._nodes.get(e);if(!n)throw new je(`Graph.directedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new je(`Graph.directedEdge: could not find the "${t}" target node in the graph.`);const i=n.out&&n.out[t]||void 0;if(i)return i.key}undirectedEdge(e,t){if(this.type==="directed")return;if(e=""+e,t=""+t,this.multi)throw new ft("Graph.undirectedEdge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.undirectedEdges instead.");const n=this._nodes.get(e);if(!n)throw new je(`Graph.undirectedEdge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new je(`Graph.undirectedEdge: could not find the "${t}" target node in the graph.`);const i=n.undirected&&n.undirected[t]||void 0;if(i)return i.key}edge(e,t){if(this.multi)throw new ft("Graph.edge: this method is irrelevant with multigraphs since there might be multiple edges between source & target. See #.edges instead.");e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.edge: could not find the "${e}" source node in the graph.`);if(!this._nodes.has(t))throw new je(`Graph.edge: could not find the "${t}" target node in the graph.`);const i=n.out&&n.out[t]||n.undirected&&n.undirected[t]||void 0;if(i)return i.key}areDirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areDirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in||t in n.out}areOutNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areOutNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.out}areInNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areInNeighbors: could not find the "${e}" node in the graph.`);return this.type==="undirected"?!1:t in n.in}areUndirectedNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areUndirectedNeighbors: could not find the "${e}" node in the graph.`);return this.type==="directed"?!1:t in n.undirected}areNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&(t in n.in||t in n.out)||this.type!=="directed"&&t in n.undirected}areInboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areInboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.in||this.type!=="directed"&&t in n.undirected}areOutboundNeighbors(e,t){e=""+e,t=""+t;const n=this._nodes.get(e);if(!n)throw new je(`Graph.areOutboundNeighbors: could not find the "${e}" node in the graph.`);return this.type!=="undirected"&&t in n.out||this.type!=="directed"&&t in n.undirected}inDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.inDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree}outDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.outDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree}directedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.directedDegree: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree}undirectedDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.undirectedDegree: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree}inboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.inboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree),n}outboundDegree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.outboundDegree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.outDegree),n}degree(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.degree: could not find the "${e}" node in the graph.`);let n=0;return this.type!=="directed"&&(n+=t.undirectedDegree),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree),n}inDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.inDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree-t.directedLoops}outDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.outDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.outDegree-t.directedLoops}directedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.directedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="undirected"?0:t.inDegree+t.outDegree-t.directedLoops*2}undirectedDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.undirectedDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);return this.type==="directed"?0:t.undirectedDegree-t.undirectedLoops*2}inboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.inboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!=="directed"&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree,i+=t.directedLoops),n-i}outboundDegreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.outboundDegreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!=="directed"&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.outDegree,i+=t.directedLoops),n-i}degreeWithoutSelfLoops(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.degreeWithoutSelfLoops: could not find the "${e}" node in the graph.`);let n=0,i=0;return this.type!=="directed"&&(n+=t.undirectedDegree,i+=t.undirectedLoops*2),this.type!=="undirected"&&(n+=t.inDegree+t.outDegree,i+=t.directedLoops*2),n-i}source(e){e=""+e;const t=this._edges.get(e);if(!t)throw new je(`Graph.source: could not find the "${e}" edge in the graph.`);return t.source.key}target(e){e=""+e;const t=this._edges.get(e);if(!t)throw new je(`Graph.target: could not find the "${e}" edge in the graph.`);return t.target.key}extremities(e){e=""+e;const t=this._edges.get(e);if(!t)throw new je(`Graph.extremities: could not find the "${e}" edge in the graph.`);return[t.source.key,t.target.key]}opposite(e,t){e=""+e,t=""+t;const n=this._edges.get(t);if(!n)throw new je(`Graph.opposite: could not find the "${t}" edge in the graph.`);const i=n.source.key,s=n.target.key;if(e===i)return s;if(e===s)return i;throw new je(`Graph.opposite: the "${e}" node is not attached to the "${t}" edge (${i}, ${s}).`)}hasExtremity(e,t){e=""+e,t=""+t;const n=this._edges.get(e);if(!n)throw new je(`Graph.hasExtremity: could not find the "${e}" edge in the graph.`);return n.source.key===t||n.target.key===t}isUndirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new je(`Graph.isUndirected: could not find the "${e}" edge in the graph.`);return t.undirected}isDirected(e){e=""+e;const t=this._edges.get(e);if(!t)throw new je(`Graph.isDirected: could not find the "${e}" edge in the graph.`);return!t.undirected}isSelfLoop(e){e=""+e;const t=this._edges.get(e);if(!t)throw new je(`Graph.isSelfLoop: could not find the "${e}" edge in the graph.`);return t.source===t.target}addNode(e,t){return KB(this,e,t).key}mergeNode(e,t){if(t&&!ri(t))throw new tt(`Graph.mergeNode: invalid attributes. Expecting an object but got "${t}"`);e=""+e,t=t||{};let n=this._nodes.get(e);return n?(t&&(Vn(n.attributes,t),this.emit("nodeAttributesUpdated",{type:"merge",key:e,attributes:n.attributes,data:t})),[e,!1]):(n=new this.NodeDataClass(e,t),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:t}),[e,!0])}updateNode(e,t){if(t&&typeof t!="function")throw new tt(`Graph.updateNode: invalid updater function. Expecting a function but got "${t}"`);e=""+e;let n=this._nodes.get(e);if(n){if(t){const s=n.attributes;n.attributes=t(s),this.emit("nodeAttributesUpdated",{type:"replace",key:e,attributes:n.attributes})}return[e,!1]}const i=t?t({}):{};return n=new this.NodeDataClass(e,i),this._nodes.set(e,n),this.emit("nodeAdded",{key:e,attributes:i}),[e,!0]}dropNode(e){e=""+e;const t=this._nodes.get(e);if(!t)throw new je(`Graph.dropNode: could not find the "${e}" node in the graph.`);let n;if(this.type!=="undirected"){for(const i in t.out){n=t.out[i];do El(this,n),n=n.next;while(n)}for(const i in t.in){n=t.in[i];do El(this,n),n=n.next;while(n)}}if(this.type!=="directed")for(const i in t.undirected){n=t.undirected[i];do El(this,n),n=n.next;while(n)}this._nodes.delete(e),this.emit("nodeDropped",{key:e,attributes:t.attributes})}dropEdge(e){let t;if(arguments.length>1){const n=""+arguments[0],i=""+arguments[1];if(t=br(this,n,i,this.type),!t)throw new je(`Graph.dropEdge: could not find the "${n}" -> "${i}" edge in the graph.`)}else if(e=""+e,t=this._edges.get(e),!t)throw new je(`Graph.dropEdge: could not find the "${e}" edge in the graph.`);return El(this,t),this}dropDirectedEdge(e,t){if(arguments.length<2)throw new ft("Graph.dropDirectedEdge: it does not make sense to try and drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ft("Graph.dropDirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");e=""+e,t=""+t;const n=br(this,e,t,"directed");if(!n)throw new je(`Graph.dropDirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return El(this,n),this}dropUndirectedEdge(e,t){if(arguments.length<2)throw new ft("Graph.dropUndirectedEdge: it does not make sense to drop a directed edge by key. What if the edge with this key is undirected? Use #.dropEdge for this purpose instead.");if(this.multi)throw new ft("Graph.dropUndirectedEdge: cannot use a {source,target} combo when dropping an edge in a MultiGraph since we cannot infer the one you want to delete as there could be multiple ones.");const n=br(this,e,t,"undirected");if(!n)throw new je(`Graph.dropUndirectedEdge: could not find a "${e}" -> "${t}" edge in the graph.`);return El(this,n),this}clear(){this._edges.clear(),this._nodes.clear(),this._resetInstanceCounters(),this.emit("cleared")}clearEdges(){const e=this._nodes.values();let t;for(;t=e.next(),t.done!==!0;)t.value.clear();this._edges.clear(),this._resetInstanceCounters(),this.emit("edgesCleared")}getAttribute(e){return this._attributes[e]}getAttributes(){return this._attributes}hasAttribute(e){return this._attributes.hasOwnProperty(e)}setAttribute(e,t){return this._attributes[e]=t,this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}updateAttribute(e,t){if(typeof t!="function")throw new tt("Graph.updateAttribute: updater should be a function.");const n=this._attributes[e];return this._attributes[e]=t(n),this.emit("attributesUpdated",{type:"set",attributes:this._attributes,name:e}),this}removeAttribute(e){return delete this._attributes[e],this.emit("attributesUpdated",{type:"remove",attributes:this._attributes,name:e}),this}replaceAttributes(e){if(!ri(e))throw new tt("Graph.replaceAttributes: provided attributes are not a plain object.");return this._attributes=e,this.emit("attributesUpdated",{type:"replace",attributes:this._attributes}),this}mergeAttributes(e){if(!ri(e))throw new tt("Graph.mergeAttributes: provided attributes are not a plain object.");return Vn(this._attributes,e),this.emit("attributesUpdated",{type:"merge",attributes:this._attributes,data:e}),this}updateAttributes(e){if(typeof e!="function")throw new tt("Graph.updateAttributes: provided updater is not a function.");return this._attributes=e(this._attributes),this.emit("attributesUpdated",{type:"update",attributes:this._attributes}),this}updateEachNodeAttributes(e,t){if(typeof e!="function")throw new tt("Graph.updateEachNodeAttributes: expecting an updater function.");if(t&&!KS(t))throw new tt("Graph.updateEachNodeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._nodes.values();let i,s;for(;i=n.next(),i.done!==!0;)s=i.value,s.attributes=e(s.key,s.attributes);this.emit("eachNodeAttributesUpdated",{hints:t||null})}updateEachEdgeAttributes(e,t){if(typeof e!="function")throw new tt("Graph.updateEachEdgeAttributes: expecting an updater function.");if(t&&!KS(t))throw new tt("Graph.updateEachEdgeAttributes: invalid hints. Expecting an object having the following shape: {attributes?: [string]}");const n=this._edges.values();let i,s,o,a;for(;i=n.next(),i.done!==!0;)s=i.value,o=s.source,a=s.target,s.attributes=e(s.key,s.attributes,o.key,a.key,o.attributes,a.attributes,s.undirected);this.emit("eachEdgeAttributesUpdated",{hints:t||null})}forEachAdjacencyEntry(e){if(typeof e!="function")throw new tt("Graph.forEachAdjacencyEntry: expecting a callback.");rd(!1,!1,!1,this,e)}forEachAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new tt("Graph.forEachAdjacencyEntryWithOrphans: expecting a callback.");rd(!1,!1,!0,this,e)}forEachAssymetricAdjacencyEntry(e){if(typeof e!="function")throw new tt("Graph.forEachAssymetricAdjacencyEntry: expecting a callback.");rd(!1,!0,!1,this,e)}forEachAssymetricAdjacencyEntryWithOrphans(e){if(typeof e!="function")throw new tt("Graph.forEachAssymetricAdjacencyEntryWithOrphans: expecting a callback.");rd(!1,!0,!0,this,e)}nodes(){return typeof Array.from=="function"?Array.from(this._nodes.keys()):iA(this._nodes.keys(),this._nodes.size)}forEachNode(e){if(typeof e!="function")throw new tt("Graph.forEachNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)i=n.value,e(i.key,i.attributes)}findNode(e){if(typeof e!="function")throw new tt("Graph.findNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)if(i=n.value,e(i.key,i.attributes))return i.key}mapNodes(e){if(typeof e!="function")throw new tt("Graph.mapNode: expecting a callback.");const t=this._nodes.values();let n,i;const s=new Array(this.order);let o=0;for(;n=t.next(),n.done!==!0;)i=n.value,s[o++]=e(i.key,i.attributes);return s}someNode(e){if(typeof e!="function")throw new tt("Graph.someNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)if(i=n.value,e(i.key,i.attributes))return!0;return!1}everyNode(e){if(typeof e!="function")throw new tt("Graph.everyNode: expecting a callback.");const t=this._nodes.values();let n,i;for(;n=t.next(),n.done!==!0;)if(i=n.value,!e(i.key,i.attributes))return!1;return!0}filterNodes(e){if(typeof e!="function")throw new tt("Graph.filterNodes: expecting a callback.");const t=this._nodes.values();let n,i;const s=[];for(;n=t.next(),n.done!==!0;)i=n.value,e(i.key,i.attributes)&&s.push(i.key);return s}reduceNodes(e,t){if(typeof e!="function")throw new tt("Graph.reduceNodes: expecting a callback.");if(arguments.length<2)throw new tt("Graph.reduceNodes: missing initial value. You must provide it because the callback takes more than one argument and we cannot infer the initial value from the first iteration, as you could with a simple array.");let n=t;const i=this._nodes.values();let s,o;for(;s=i.next(),s.done!==!0;)o=s.value,n=e(n,o.key,o.attributes);return n}nodeEntries(){const e=this._nodes.values();return new Mr(()=>{const t=e.next();if(t.done)return t;const n=t.value;return{value:{node:n.key,attributes:n.attributes},done:!1}})}export(){const e=new Array(this._nodes.size);let t=0;this._nodes.forEach((i,s)=>{e[t++]=HB(s,i)});const n=new Array(this._edges.size);return t=0,this._edges.forEach((i,s)=>{n[t++]=VB(this.type,s,i)}),{options:{type:this.type,multi:this.multi,allowSelfLoops:this.allowSelfLoops},attributes:this.getAttributes(),nodes:e,edges:n}}import(e,t=!1){if(e instanceof en)return e.forEachNode((l,c)=>{t?this.mergeNode(l,c):this.addNode(l,c)}),e.forEachEdge((l,c,u,h,p,m,v)=>{t?v?this.mergeUndirectedEdgeWithKey(l,u,h,c):this.mergeDirectedEdgeWithKey(l,u,h,c):v?this.addUndirectedEdgeWithKey(l,u,h,c):this.addDirectedEdgeWithKey(l,u,h,c)}),this;if(!ri(e))throw new tt("Graph.import: invalid argument. Expecting a serialized graph or, alternatively, a Graph instance.");if(e.attributes){if(!ri(e.attributes))throw new tt("Graph.import: invalid attributes. Expecting a plain object.");t?this.mergeAttributes(e.attributes):this.replaceAttributes(e.attributes)}let n,i,s,o,a;if(e.nodes){if(s=e.nodes,!Array.isArray(s))throw new tt("Graph.import: invalid nodes. Expecting an array.");for(n=0,i=s.length;n{const s=Vn({},n.attributes);n=new t.NodeDataClass(i,s),t._nodes.set(i,n)}),t}copy(e){if(e=e||{},typeof e.type=="string"&&e.type!==this.type&&e.type!=="mixed")throw new ft(`Graph.copy: cannot create an incompatible copy from "${this.type}" type to "${e.type}" because this would mean losing information about the current graph.`);if(typeof e.multi=="boolean"&&e.multi!==this.multi&&e.multi!==!0)throw new ft("Graph.copy: cannot create an incompatible copy by downgrading a multi graph to a simple one because this would mean losing information about the current graph.");if(typeof e.allowSelfLoops=="boolean"&&e.allowSelfLoops!==this.allowSelfLoops&&e.allowSelfLoops!==!0)throw new ft("Graph.copy: cannot create an incompatible copy from a graph allowing self loops to one that does not because this would mean losing information about the current graph.");const t=this.emptyCopy(e),n=this._edges.values();let i,s;for(;i=n.next(),i.done!==!0;)s=i.value,fA(t,"copy",!1,s.undirected,s.key,s.source.key,s.target.key,Vn({},s.attributes));return t}toJSON(){return this.export()}toString(){return"[object Graph]"}inspect(){const e={};this._nodes.forEach((s,o)=>{e[o]=s.attributes});const t={},n={};this._edges.forEach((s,o)=>{const a=s.undirected?"--":"->";let l="",c=s.source.key,u=s.target.key,h;s.undirected&&c>u&&(h=c,c=u,u=h);const p=`(${c})${a}(${u})`;o.startsWith("geid_")?this.multi&&(typeof n[p]>"u"?n[p]=0:n[p]++,l+=`${n[p]}. `):l+=`[${o}]: `,l+=p,t[l]=s.attributes});const i={};for(const s in this)this.hasOwnProperty(s)&&!$S.has(s)&&typeof this[s]!="function"&&typeof s!="symbol"&&(i[s]=this[s]);return i.attributes=this._attributes,i.nodes=e,i.edges=t,mr(i,"constructor",this.constructor),i}}typeof Symbol<"u"&&(en.prototype[Symbol.for("nodejs.util.inspect.custom")]=en.prototype.inspect);qB.forEach(r=>{["add","merge","update"].forEach(e=>{const t=r.name(e),n=e==="add"?fA:$B;r.generateKey?en.prototype[t]=function(i,s,o){return n(this,t,!0,(r.type||this.type)==="undirected",null,i,s,o,e==="update")}:en.prototype[t]=function(i,s,o,a){return n(this,t,!1,(r.type||this.type)==="undirected",i,s,o,a,e==="update")}})});oB(en);vB(en);DB(en);GB(en);class dA extends en{constructor(e){const t=Vn({type:"directed"},e);if("multi"in t&&t.multi!==!1)throw new tt("DirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="directed")throw new tt('DirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class pA extends en{constructor(e){const t=Vn({type:"undirected"},e);if("multi"in t&&t.multi!==!1)throw new tt("UndirectedGraph.from: inconsistent indication that the graph should be multi in given options!");if(t.type!=="undirected")throw new tt('UndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class mA extends en{constructor(e){const t=Vn({multi:!0},e);if("multi"in t&&t.multi!==!0)throw new tt("MultiGraph.from: inconsistent indication that the graph should be simple in given options!");super(t)}}class gA extends en{constructor(e){const t=Vn({type:"directed",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new tt("MultiDirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="directed")throw new tt('MultiDirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}class vA extends en{constructor(e){const t=Vn({type:"undirected",multi:!0},e);if("multi"in t&&t.multi!==!0)throw new tt("MultiUndirectedGraph.from: inconsistent indication that the graph should be simple in given options!");if(t.type!=="undirected")throw new tt('MultiUndirectedGraph.from: inconsistent "'+t.type+'" type in given options!');super(t)}}function ic(r){r.from=function(e,t){const n=Vn({},e.options,t),i=new r(n);return i.import(e),i}}ic(en);ic(dA);ic(pA);ic(mA);ic(gA);ic(vA);en.Graph=en;en.DirectedGraph=dA;en.UndirectedGraph=pA;en.MultiGraph=mA;en.MultiDirectedGraph=gA;en.MultiUndirectedGraph=vA;en.InvalidArgumentsGraphError=tt;en.NotFoundGraphError=je;en.UsageGraphError=ft;const ph=new Y,Ky=new Y,JB=new Y;function QB(r,e,t){const n=ph.setFromMatrixPosition(r.matrixWorld);n.project(e);const i=t.width/2,s=t.height/2;return[n.x*i+i,-(n.y*s)+s]}function e4(r,e){const t=ph.setFromMatrixPosition(r.matrixWorld),n=Ky.setFromMatrixPosition(e.matrixWorld),i=t.sub(n),s=e.getWorldDirection(JB);return i.angleTo(s)>Math.PI/2}function t4(r,e,t,n){const i=ph.setFromMatrixPosition(r.matrixWorld),s=i.clone();s.project(e),t.setFromCamera(s,e);const o=t.intersectObjects(n,!0);if(o.length){const a=o[0].distance;return i.distanceTo(t.ray.origin)Math.abs(r)<1e-10?0:r;function yA(r,e,t=""){let n="matrix3d(";for(let i=0;i!==16;i++)n+=Mv(e[i]*r.elements[i])+(i!==15?",":")");return t+n}const r4=(r=>e=>yA(e,r))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),s4=(r=>(e,t)=>yA(e,r(t),"translate(-50%,-50%)"))(r=>[1/r,1/r,1/r,1,-1/r,-1/r,-1/r,-1,1/r,1/r,1/r,1,1,1,1,1]);function o4(r){return r&&typeof r=="object"&&"current"in r}const $y=K.forwardRef(({children:r,eps:e=.001,style:t,className:n,prepend:i,center:s,fullscreen:o,portal:a,distanceFactor:l,sprite:c=!1,transform:u=!1,occlude:h,onOcclude:p,castShadow:m,receiveShadow:v,material:_,geometry:y,zIndexRange:g=[16777271,0],calculatePosition:x=QB,as:w="div",wrapperClass:E,pointerEvents:b="auto",...M},A)=>{const{gl:P,camera:C,scene:L,size:F,raycaster:N,events:I,viewport:X}=Bn(),[q]=K.useState(()=>document.createElement(w)),W=K.useRef(),O=K.useRef(null),k=K.useRef(0),G=K.useRef([0,0]),B=K.useRef(null),D=K.useRef(null),V=(a==null?void 0:a.current)||I.connected||P.domElement.parentNode,Z=K.useRef(null),ee=K.useRef(!1),ie=K.useMemo(()=>h&&h!=="blending"||Array.isArray(h)&&h.length&&o4(h[0]),[h]);K.useLayoutEffect(()=>{const Ee=P.domElement;h&&h==="blending"?(Ee.style.zIndex=`${Math.floor(g[0]/2)}`,Ee.style.position="absolute",Ee.style.pointerEvents="none"):(Ee.style.zIndex=null,Ee.style.position=null,Ee.style.pointerEvents=null)},[h]),K.useLayoutEffect(()=>{if(O.current){const Ee=W.current=q2.createRoot(q);if(L.updateMatrixWorld(),u)q.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const ae=x(O.current,C,F);q.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${ae[0]}px,${ae[1]}px,0);transform-origin:0 0;`}return V&&(i?V.prepend(q):V.appendChild(q)),()=>{V&&V.removeChild(q),Ee.unmount()}}},[V,u]),K.useLayoutEffect(()=>{E&&(q.className=E)},[E]);const ue=K.useMemo(()=>u?{position:"absolute",top:0,left:0,width:F.width,height:F.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:s?"translate3d(-50%,-50%,0)":"none",...o&&{top:-F.height/2,left:-F.width/2,width:F.width,height:F.height},...t},[t,s,o,F,u]),ce=K.useMemo(()=>({position:"absolute",pointerEvents:b}),[b]);K.useLayoutEffect(()=>{if(ee.current=!1,u){var Ee;(Ee=W.current)==null||Ee.render(K.createElement("div",{ref:B,style:ue},K.createElement("div",{ref:D,style:ce},K.createElement("div",{ref:A,className:n,style:t,children:r}))))}else{var ae;(ae=W.current)==null||ae.render(K.createElement("div",{ref:A,style:ue,className:n,children:r}))}});const le=K.useRef(!0);Ep(Ee=>{if(O.current){C.updateMatrixWorld(),O.current.updateWorldMatrix(!0,!1);const ae=u?G.current:x(O.current,C,F);if(u||Math.abs(k.current-C.zoom)>e||Math.abs(G.current[0]-ae[0])>e||Math.abs(G.current[1]-ae[1])>e){const z=e4(O.current,C);let oe=!1;ie&&(Array.isArray(h)?oe=h.map(Ie=>Ie.current):h!=="blending"&&(oe=[L]));const te=le.current;if(oe){const Ie=t4(O.current,C,N,oe);le.current=Ie&&!z}else le.current=!z;te!==le.current&&(p?p(!le.current):q.style.display=le.current?"block":"none");const se=Math.floor(g[0]/2),$=h?ie?[g[0],se]:[se-1,0]:g;if(q.style.zIndex=`${i4(O.current,C,$)}`,u){const[Ie,de]=[F.width/2,F.height/2],Se=C.projectionMatrix.elements[5]*de,{isOrthographicCamera:Le,top:ge,left:He,bottom:j,right:H}=C,ne=r4(C.matrixWorldInverse),we=Le?`scale(${Se})translate(${Mv(-(H+He)/2)}px,${Mv((ge+j)/2)}px)`:`translateZ(${Se}px)`;let be=O.current.matrixWorld;c&&(be=C.matrixWorldInverse.clone().transpose().copyPosition(be).scale(O.current.scale),be.elements[3]=be.elements[7]=be.elements[11]=0,be.elements[15]=1),q.style.width=F.width+"px",q.style.height=F.height+"px",q.style.perspective=Le?"":`${Se}px`,B.current&&D.current&&(B.current.style.transform=`${we}${ne}translate(${Ie}px,${de}px)`,D.current.style.transform=s4(be,1/((l||10)/400)))}else{const Ie=l===void 0?1:n4(O.current,C)*l;q.style.transform=`translate3d(${ae[0]}px,${ae[1]}px,0) scale(${Ie})`}G.current=ae,k.current=C.zoom}}if(!ie&&Z.current&&!ee.current)if(u){if(B.current){const ae=B.current.children[0];if(ae!=null&&ae.clientWidth&&ae!=null&&ae.clientHeight){const{isOrthographicCamera:z}=C;if(z||y)M.scale&&(Array.isArray(M.scale)?M.scale instanceof Y?Z.current.scale.copy(M.scale.clone().divideScalar(1)):Z.current.scale.set(1/M.scale[0],1/M.scale[1],1/M.scale[2]):Z.current.scale.setScalar(1/M.scale));else{const oe=(l||10)/400,te=ae.clientWidth*oe,se=ae.clientHeight*oe;Z.current.scale.set(te,se,1)}ee.current=!0}}}else{const ae=q.children[0];if(ae!=null&&ae.clientWidth&&ae!=null&&ae.clientHeight){const z=1/X.factor,oe=ae.clientWidth*z,te=ae.clientHeight*z;Z.current.scale.set(oe,te,1),ee.current=!0}Z.current.lookAt(Ee.camera.position)}});const Ae=K.useMemo(()=>({vertexShader:u?void 0:` + /* + This shader is from the THREE's SpriteMaterial. + We need to turn the backing plane into a Sprite + (make it always face the camera) if "transfrom" + is false. + */ + #include + + void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + // This is somewhat arbitrary, but it seems to work well + // Need to figure out how to derive this dynamically if it even matters + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; + } + `,fragmentShader:` + void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + `}),[u]);return K.createElement("group",Ta({},M,{ref:O}),h&&!ie&&K.createElement("mesh",{castShadow:m,receiveShadow:v,ref:Z},y||K.createElement("planeGeometry",null),_||K.createElement("shaderMaterial",{side:vn,vertexShader:Ae.vertexShader,fragmentShader:Ae.fragmentShader})))});function ya(r,e="pointer",t="auto",n=document.body){K.useEffect(()=>{if(r)return n.style.cursor=e,()=>void(n.style.cursor=t)},[r])}let Jy=gh();const xt=r=>mh(r,Jy);let Qy=gh();xt.write=r=>mh(r,Qy);let Pp=gh();xt.onStart=r=>mh(r,Pp);let e_=gh();xt.onFrame=r=>mh(r,e_);let t_=gh();xt.onFinish=r=>mh(r,t_);let Gl=[];xt.setTimeout=(r,e)=>{let t=xt.now()+e,n=()=>{let s=Gl.findIndex(o=>o.cancel==n);~s&&Gl.splice(s,1),po-=~s?1:0},i={time:t,handler:r,cancel:n};return Gl.splice(_A(t),0,i),po+=1,xA(),i};let _A=r=>~(~Gl.findIndex(e=>e.time>r)||~Gl.length);xt.cancel=r=>{Pp.delete(r),e_.delete(r),t_.delete(r),Jy.delete(r),Qy.delete(r)};xt.sync=r=>{Tv=!0,xt.batchedUpdates(r),Tv=!1};xt.throttle=r=>{let e;function t(){try{r(...e)}finally{e=null}}function n(...i){e=i,xt.onStart(t)}return n.handler=r,n.cancel=()=>{Pp.delete(t),e=null},n};let n_=typeof window<"u"?window.requestAnimationFrame:()=>{};xt.use=r=>n_=r;xt.now=typeof performance<"u"?()=>performance.now():Date.now;xt.batchedUpdates=r=>r();xt.catch=console.error;xt.frameLoop="always";xt.advance=()=>{xt.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):SA()};let fo=-1,po=0,Tv=!1;function mh(r,e){Tv?(e.delete(r),r(0)):(e.add(r),xA())}function xA(){fo<0&&(fo=0,xt.frameLoop!=="demand"&&n_(wA))}function a4(){fo=-1}function wA(){~fo&&(n_(wA),xt.batchedUpdates(SA))}function SA(){let r=fo;fo=xt.now();let e=_A(fo);if(e&&(EA(Gl.splice(0,e),t=>t.handler()),po-=e),!po){a4();return}Pp.flush(),Jy.flush(r?Math.min(64,fo-r):16.667),e_.flush(),Qy.flush(),t_.flush()}function gh(){let r=new Set,e=r;return{add(t){po+=e==r&&!r.has(t)?1:0,r.add(t)},delete(t){return po-=e==r&&r.has(t)?1:0,r.delete(t)},flush(t){e.size&&(r=new Set,po-=e.size,EA(e,n=>n(t)&&r.add(n)),po+=r.size,e=r)}}}function EA(r,e){r.forEach(t=>{try{e(t)}catch(n){xt.catch(n)}})}function Av(){}const l4=(r,e,t)=>Object.defineProperty(r,e,{value:t,writable:!0,configurable:!0}),Ze={arr:Array.isArray,obj:r=>!!r&&r.constructor.name==="Object",fun:r=>typeof r=="function",str:r=>typeof r=="string",num:r=>typeof r=="number",und:r=>r===void 0};function Ds(r,e){if(Ze.arr(r)){if(!Ze.arr(e)||r.length!==e.length)return!1;for(let t=0;tr.forEach(e);function Gs(r,e,t){if(Ze.arr(r)){for(let n=0;nZe.und(r)?[]:Ze.arr(r)?r:[r];function Su(r,e){if(r.size){const t=Array.from(r);r.clear(),Kt(t,e)}}const mu=(r,...e)=>Su(r,t=>t(...e)),i_=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let r_,bA,_o=null,MA=!1,s_=Av;const c4=r=>{r.to&&(bA=r.to),r.now&&(xt.now=r.now),r.colors!==void 0&&(_o=r.colors),r.skipAnimation!=null&&(MA=r.skipAnimation),r.createStringInterpolator&&(r_=r.createStringInterpolator),r.requestAnimationFrame&&xt.use(r.requestAnimationFrame),r.batchedUpdates&&(xt.batchedUpdates=r.batchedUpdates),r.willAdvance&&(s_=r.willAdvance),r.frameLoop&&(xt.frameLoop=r.frameLoop)};var us=Object.freeze({__proto__:null,get createStringInterpolator(){return r_},get to(){return bA},get colors(){return _o},get skipAnimation(){return MA},get willAdvance(){return s_},assign:c4});const Eu=new Set;let Sr=[],u0=[],Bd=0;const Lp={get idle(){return!Eu.size&&!Sr.length},start(r){Bd>r.priority?(Eu.add(r),xt.onStart(u4)):(TA(r),xt(Cv))},advance:Cv,sort(r){if(Bd)xt.onFrame(()=>Lp.sort(r));else{const e=Sr.indexOf(r);~e&&(Sr.splice(e,1),AA(r))}},clear(){Sr=[],Eu.clear()}};function u4(){Eu.forEach(TA),Eu.clear(),xt(Cv)}function TA(r){Sr.includes(r)||AA(r)}function AA(r){Sr.splice(h4(Sr,e=>e.priority>r.priority),0,r)}function Cv(r){const e=u0;for(let t=0;t0}function h4(r,e){const t=r.findIndex(e);return t<0?r.length:t}const f4={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},kr="[-+]?\\d*\\.?\\d+",Gd=kr+"%";function Ip(...r){return"\\(\\s*("+r.join(")\\s*,\\s*(")+")\\s*\\)"}const d4=new RegExp("rgb"+Ip(kr,kr,kr)),p4=new RegExp("rgba"+Ip(kr,kr,kr,kr)),m4=new RegExp("hsl"+Ip(kr,Gd,Gd)),g4=new RegExp("hsla"+Ip(kr,Gd,Gd,kr)),v4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,y4=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,_4=/^#([0-9a-fA-F]{6})$/,x4=/^#([0-9a-fA-F]{8})$/;function w4(r){let e;return typeof r=="number"?r>>>0===r&&r>=0&&r<=4294967295?r:null:(e=_4.exec(r))?parseInt(e[1]+"ff",16)>>>0:_o&&_o[r]!==void 0?_o[r]:(e=d4.exec(r))?(bl(e[1])<<24|bl(e[2])<<16|bl(e[3])<<8|255)>>>0:(e=p4.exec(r))?(bl(e[1])<<24|bl(e[2])<<16|bl(e[3])<<8|tE(e[4]))>>>0:(e=v4.exec(r))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=x4.exec(r))?parseInt(e[1],16)>>>0:(e=y4.exec(r))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=m4.exec(r))?(QS(eE(e[1]),sd(e[2]),sd(e[3]))|255)>>>0:(e=g4.exec(r))?(QS(eE(e[1]),sd(e[2]),sd(e[3]))|tE(e[4]))>>>0:null}function h0(r,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?r+(e-r)*6*t:t<1/2?e:t<2/3?r+(e-r)*(2/3-t)*6:r}function QS(r,e,t){const n=t<.5?t*(1+e):t+e-t*e,i=2*t-n,s=h0(i,n,r+1/3),o=h0(i,n,r),a=h0(i,n,r-1/3);return Math.round(s*255)<<24|Math.round(o*255)<<16|Math.round(a*255)<<8}function bl(r){const e=parseInt(r,10);return e<0?0:e>255?255:e}function eE(r){return(parseFloat(r)%360+360)%360/360}function tE(r){const e=parseFloat(r);return e<0?0:e>1?255:Math.round(e*255)}function sd(r){const e=parseFloat(r);return e<0?0:e>100?1:e/100}function nE(r){let e=w4(r);if(e===null)return r;e=e||0;let t=(e&4278190080)>>>24,n=(e&16711680)>>>16,i=(e&65280)>>>8,s=(e&255)/255;return`rgba(${t}, ${n}, ${i}, ${s})`}const qu=(r,e,t)=>{if(Ze.fun(r))return r;if(Ze.arr(r))return qu({range:r,output:e,extrapolate:t});if(Ze.str(r.output[0]))return r_(r);const n=r,i=n.output,s=n.range||[0,1],o=n.extrapolateLeft||n.extrapolate||"extend",a=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(c=>c);return c=>{const u=E4(c,s);return S4(c,s[u],s[u+1],i[u],i[u+1],l,o,a,n.map)}};function S4(r,e,t,n,i,s,o,a,l){let c=l?l(r):r;if(ct){if(a==="identity")return c;a==="clamp"&&(c=t)}return n===i?n:e===t?r<=e?n:i:(e===-1/0?c=-c:t===1/0?c=c-e:c=(c-e)/(t-e),c=s(c),n===-1/0?c=-c:i===1/0?c=c+n:c=c*(i-n)+n,c)}function E4(r,e){for(var t=1;t=r);++t);return t-1}const b4={linear:r=>r};function Rv(){return Rv=Object.assign?Object.assign.bind():function(r){for(var e=1;e!!(r&&r[Kl]),_r=r=>r&&r[Kl]?r[Kl]():r,iE=r=>r[Ca]||null;function M4(r,e){r.eventObserved?r.eventObserved(e):r(e)}function Hd(r,e){let t=r[Ca];t&&t.forEach(n=>{M4(n,e)})}class T4{constructor(e){if(this[Kl]=void 0,this[Ca]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");A4(this,e)}}const A4=(r,e)=>CA(r,Kl,e);function vh(r,e){if(r[Kl]){let t=r[Ca];t||CA(r,Ca,t=new Set),t.has(e)||(t.add(e),r.observerAdded&&r.observerAdded(t.size,e))}return e}function Vd(r,e){let t=r[Ca];if(t&&t.has(e)){const n=t.size-1;n?t.delete(e):r[Ca]=null,r.observerRemoved&&r.observerRemoved(n,e)}}const CA=(r,e,t)=>Object.defineProperty(r,e,{value:t,writable:!0,configurable:!0}),Cd=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,C4=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,rE=new RegExp(`(${Cd.source})(%|[a-z]+)`,"i"),R4=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Dp=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,RA=r=>{const[e,t]=P4(r);if(!e||i_())return r;const n=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(n)return n.trim();if(t&&t.startsWith("--")){const i=window.getComputedStyle(document.documentElement).getPropertyValue(t);return i||r}else{if(t&&Dp.test(t))return RA(t);if(t)return t}return r},P4=r=>{const e=Dp.exec(r);if(!e)return[,];const[,t,n]=e;return[t,n]};let f0;const L4=(r,e,t,n,i)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(n)}, ${i})`,PA=r=>{f0||(f0=_o?new RegExp(`(${Object.keys(_o).join("|")})(?!\\w)`,"g"):/^\b$/);const e=r.output.map(s=>_r(s).replace(Dp,RA).replace(C4,nE).replace(f0,nE)),t=e.map(s=>s.match(Cd).map(Number)),i=t[0].map((s,o)=>t.map(a=>{if(!(o in a))throw Error('The arity of each "output" value must be equal');return a[o]})).map(s=>qu(Rv({},r,{output:s})));return s=>{var o;const a=!rE.test(e[0])&&((o=e.find(c=>rE.test(c)))==null?void 0:o.replace(Cd,""));let l=0;return e[0].replace(Cd,()=>`${i[l++](s)}${a||""}`).replace(R4,L4)}},o_="react-spring: ",LA=r=>{const e=r;let t=!1;if(typeof e!="function")throw new TypeError(`${o_}once requires a function parameter`);return(...n)=>{t||(e(...n),t=!0)}},I4=LA(console.warn);function D4(){I4(`${o_}The "interpolate" function is deprecated in v9 (use "to" instead)`)}const U4=LA(console.warn);function O4(){U4(`${o_}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Up(r){return Ze.str(r)&&(r[0]=="#"||/\d/.test(r)||!i_()&&Dp.test(r)||r in(_o||{}))}const a_=i_()?K.useEffect:K.useLayoutEffect,N4=()=>{const r=K.useRef(!1);return a_(()=>(r.current=!0,()=>{r.current=!1}),[]),r};function IA(){const r=K.useState()[1],e=N4();return()=>{e.current&&r(Math.random())}}function F4(r,e){const[t]=K.useState(()=>({inputs:e,result:r()})),n=K.useRef(),i=n.current;let s=i;return s?e&&s.inputs&&k4(e,s.inputs)||(s={inputs:e,result:r()}):s=t,K.useEffect(()=>{n.current=s,i==t&&(t.inputs=t.result=void 0)},[s]),s.result}function k4(r,e){if(r.length!==e.length)return!1;for(let t=0;tK.useEffect(r,z4),z4=[];function sE(r){const e=K.useRef();return K.useEffect(()=>{e.current=r}),e.current}const Zu=Symbol.for("Animated:node"),B4=r=>!!r&&r[Zu]===r,ns=r=>r&&r[Zu],l_=(r,e)=>l4(r,Zu,e),Op=r=>r&&r[Zu]&&r[Zu].getPayload();class UA{constructor(){this.payload=void 0,l_(this,this)}getPayload(){return this.payload||[]}}class rc extends UA{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Ze.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new rc(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Ze.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Ze.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class $l extends rc{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=qu({output:[e,e]})}static create(e){return new $l(e)}getValue(){let e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(Ze.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=qu({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Wd={dependencies:null};class c_ extends UA{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Gs(this.source,(n,i)=>{B4(n)?t[i]=n.getValue(e):is(n)?t[i]=_r(n):e||(t[i]=n)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Kt(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return Gs(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Wd.dependencies&&is(e)&&Wd.dependencies.add(e);const t=Op(e);t&&Kt(t,n=>this.add(n))}}class u_ extends c_{constructor(e){super(e)}static create(e){return new u_(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((n,i)=>n.setValue(e[i])).some(Boolean):(super.setValue(e.map(G4)),!0)}}function G4(r){return(Up(r)?$l:rc).create(r)}function Pv(r){const e=ns(r);return e?e.constructor:Ze.arr(r)?u_:Up(r)?$l:rc}function Xd(){return Xd=Object.assign?Object.assign.bind():function(r){for(var e=1;e{const t=!Ze.fun(r)||r.prototype&&r.prototype.isReactComponent;return K.forwardRef((n,i)=>{const s=K.useRef(null),o=t&&K.useCallback(v=>{s.current=W4(i,v)},[i]),[a,l]=V4(n,e),c=IA(),u=()=>{const v=s.current;if(t&&!v)return;(v?e.applyAnimatedValues(v,a.getValue(!0)):!1)===!1&&c()},h=new H4(u,l),p=K.useRef();a_(()=>(p.current=h,Kt(l,v=>vh(v,h)),()=>{p.current&&(Kt(p.current.deps,v=>Vd(v,p.current)),xt.cancel(p.current.update))})),K.useEffect(u,[]),DA(()=>()=>{const v=p.current;Kt(v.deps,_=>Vd(_,v))});const m=e.getComponentProps(a.getValue());return K.createElement(r,Xd({},m,{ref:o}))})};class H4{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&xt.write(this.update)}}function V4(r,e){const t=new Set;return Wd.dependencies=t,r.style&&(r=Xd({},r,{style:e.createAnimatedStyle(r.style)})),r=new c_(r),Wd.dependencies=null,[r,t]}function W4(r,e){return r&&(Ze.fun(r)?r(e):r.current=e),e}const aE=Symbol.for("AnimatedComponent"),X4=(r,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=i=>new c_(i),getComponentProps:n=i=>i}={})=>{const i={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:n},s=o=>{const a=lE(o)||"Anonymous";return Ze.str(o)?o=s[o]||(s[o]=oE(o,i)):o=o[aE]||(o[aE]=oE(o,i)),o.displayName=`Animated(${a})`,o};return Gs(r,(o,a)=>{Ze.arr(r)&&(a=lE(o)),s[a]=s(o)}),{animated:s}},lE=r=>Ze.str(r)?r:r&&Ze.str(r.displayName)?r.displayName:Ze.fun(r)&&r.name||null;function ei(){return ei=Object.assign?Object.assign.bind():function(r){for(var e=1;er===!0||!!(e&&r&&(Ze.fun(r)?r(e):Er(r).includes(e))),OA=(r,e)=>Ze.obj(r)?e&&r[e]:r,NA=(r,e)=>r.default===!0?r[e]:r.default?r.default[e]:void 0,j4=r=>r,h_=(r,e=j4)=>{let t=Y4;r.default&&r.default!==!0&&(r=r.default,t=Object.keys(r));const n={};for(const i of t){const s=e(r[i],i);Ze.und(s)||(n[i]=s)}return n},Y4=["config","onProps","onStart","onChange","onPause","onResume","onRest"],q4={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function Z4(r){const e={};let t=0;if(Gs(r,(n,i)=>{q4[i]||(e[i]=n,t++)}),t)return e}function FA(r){const e=Z4(r);if(e){const t={to:e};return Gs(r,(n,i)=>i in e||(t[i]=n)),t}return ei({},r)}function Ku(r){return r=_r(r),Ze.arr(r)?r.map(Ku):Up(r)?us.createStringInterpolator({range:[0,1],output:[r,r]})(1):r}function K4(r){for(const e in r)return!0;return!1}function Lv(r){return Ze.fun(r)||Ze.arr(r)&&Ze.obj(r[0])}function $4(r,e){var t;(t=r.ref)==null||t.delete(r),e==null||e.delete(r)}function J4(r,e){if(e&&r.ref!==e){var t;(t=r.ref)==null||t.delete(r),e.add(r),r.ref=e}}const Q4={default:{tension:170,friction:26}},Iv=ei({},Q4.default,{mass:1,damping:1,easing:b4.linear,clamp:!1});class eG{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Iv)}}function tG(r,e,t){t&&(t=ei({},t),cE(t,e),e=ei({},t,e)),cE(r,e),Object.assign(r,e);for(const o in Iv)r[o]==null&&(r[o]=Iv[o]);let{mass:n,frequency:i,damping:s}=r;return Ze.und(i)||(i<.01&&(i=.01),s<0&&(s=0),r.tension=Math.pow(2*Math.PI/i,2)*n,r.friction=4*Math.PI*s*n/i),r}function cE(r,e){if(!Ze.und(e.decay))r.duration=void 0;else{const t=!Ze.und(e.tension)||!Ze.und(e.friction);(t||!Ze.und(e.frequency)||!Ze.und(e.damping)||!Ze.und(e.mass))&&(r.duration=void 0,r.decay=void 0),t&&(r.frequency=void 0)}}const uE=[];class nG{constructor(){this.changed=!1,this.values=uE,this.toValues=null,this.fromValues=uE,this.to=void 0,this.from=void 0,this.config=new eG,this.immediate=!1}}function kA(r,{key:e,props:t,defaultProps:n,state:i,actions:s}){return new Promise((o,a)=>{var l;let c,u,h=bu((l=t.cancel)!=null?l:n==null?void 0:n.cancel,e);if(h)v();else{Ze.und(t.pause)||(i.paused=bu(t.pause,e));let _=n==null?void 0:n.pause;_!==!0&&(_=i.paused||bu(_,e)),c=ca(t.delay||0,e),_?(i.resumeQueue.add(m),s.pause()):(s.resume(),m())}function p(){i.resumeQueue.add(m),i.timeouts.delete(u),u.cancel(),c=u.time-xt.now()}function m(){c>0&&!us.skipAnimation?(i.delayed=!0,u=xt.setTimeout(v,c),i.pauseQueue.add(p),i.timeouts.add(u)):v()}function v(){i.delayed&&(i.delayed=!1),i.pauseQueue.delete(p),i.timeouts.delete(u),r<=(i.cancelId||0)&&(h=!0);try{s.start(ei({},t,{callId:r,cancel:h}),o)}catch(_){a(_)}}})}const f_=(r,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?Hl(r.get()):e.every(t=>t.noop)?zA(r.get()):Fr(r.get(),e.every(t=>t.finished)),zA=r=>({value:r,noop:!0,finished:!0,cancelled:!1}),Fr=(r,e,t=!1)=>({value:r,finished:e,cancelled:t}),Hl=r=>({value:r,cancelled:!0,finished:!1});function BA(r,e,t,n){const{callId:i,parentId:s,onRest:o}=e,{asyncTo:a,promise:l}=t;return!s&&r===a&&!e.reset?l:t.promise=(async()=>{t.asyncId=i,t.asyncTo=r;const c=h_(e,(y,g)=>g==="onRest"?void 0:y);let u,h;const p=new Promise((y,g)=>(u=y,h=g)),m=y=>{const g=i<=(t.cancelId||0)&&Hl(n)||i!==t.asyncId&&Fr(n,!1);if(g)throw y.result=g,h(y),y},v=(y,g)=>{const x=new hE,w=new fE;return(async()=>{if(us.skipAnimation)throw $u(t),w.result=Fr(n,!1),h(w),w;m(x);const E=Ze.obj(y)?ei({},y):ei({},g,{to:y});E.parentId=i,Gs(c,(M,A)=>{Ze.und(E[A])&&(E[A]=M)});const b=await n.start(E);return m(x),t.paused&&await new Promise(M=>{t.resumeQueue.add(M)}),b})()};let _;if(us.skipAnimation)return $u(t),Fr(n,!1);try{let y;Ze.arr(r)?y=(async g=>{for(const x of g)await v(x)})(r):y=Promise.resolve(r(v,n.stop.bind(n))),await Promise.all([y.then(u),p]),_=Fr(n.get(),!0,!1)}catch(y){if(y instanceof hE)_=y.result;else if(y instanceof fE)_=y.result;else throw y}finally{i==t.asyncId&&(t.asyncId=s,t.asyncTo=s?a:void 0,t.promise=s?l:void 0)}return Ze.fun(o)&&xt.batchedUpdates(()=>{o(_,n,n.item)}),_})()}function $u(r,e){Su(r.timeouts,t=>t.cancel()),r.pauseQueue.clear(),r.resumeQueue.clear(),r.asyncId=r.asyncTo=r.promise=void 0,e&&(r.cancelId=e)}class hE extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class fE extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Dv=r=>r instanceof d_;let iG=1;class d_ extends T4{constructor(...e){super(...e),this.id=iG++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=ns(this);return e&&e.getValue()}to(...e){return us.to(this,e)}interpolate(...e){return D4(),us.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Hd(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Lp.sort(this),Hd(this,{type:"priority",parent:this,priority:e})}}const Ra=Symbol.for("SpringPhase"),GA=1,Uv=2,Ov=4,d0=r=>(r[Ra]&GA)>0,co=r=>(r[Ra]&Uv)>0,Zc=r=>(r[Ra]&Ov)>0,dE=(r,e)=>e?r[Ra]|=Uv|GA:r[Ra]&=~Uv,pE=(r,e)=>e?r[Ra]|=Ov:r[Ra]&=~Ov;class rG extends d_{constructor(e,t){if(super(),this.key=void 0,this.animation=new nG,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ze.und(e)||!Ze.und(t)){const n=Ze.obj(e)?ei({},e):ei({},t,{from:e});Ze.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(co(this)||this._state.asyncTo)||Zc(this)}get goal(){return _r(this.animation.to)}get velocity(){const e=ns(this);return e instanceof rc?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return d0(this)}get isAnimating(){return co(this)}get isPaused(){return Zc(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const i=this.animation;let{config:s,toValues:o}=i;const a=Op(i.to);!a&&is(i.to)&&(o=Er(_r(i.to))),i.values.forEach((u,h)=>{if(u.done)return;const p=u.constructor==$l?1:a?a[h].lastPosition:o[h];let m=i.immediate,v=p;if(!m){if(v=u.lastPosition,s.tension<=0){u.done=!0;return}let _=u.elapsedTime+=e;const y=i.fromValues[h],g=u.v0!=null?u.v0:u.v0=Ze.arr(s.velocity)?s.velocity[h]:s.velocity;let x;const w=s.precision||(y==p?.005:Math.min(1,Math.abs(p-y)*.001));if(Ze.und(s.duration))if(s.decay){const E=s.decay===!0?.998:s.decay,b=Math.exp(-(1-E)*_);v=y+g/(1-E)*(1-b),m=Math.abs(u.lastPosition-v)<=w,x=g*b}else{x=u.lastVelocity==null?g:u.lastVelocity;const E=s.restVelocity||w/10,b=s.clamp?0:s.bounce,M=!Ze.und(b),A=y==p?u.v0>0:yE,!(!P&&(m=Math.abs(p-v)<=w,m)));++N){M&&(C=v==p||v>p==A,C&&(x=-x*b,v=p));const I=-s.tension*1e-6*(v-p),X=-s.friction*.001*x,q=(I+X)/s.mass;x=x+q*L,v=v+x*L}}else{let E=1;s.duration>0&&(this._memoizedDuration!==s.duration&&(this._memoizedDuration=s.duration,u.durationProgress>0&&(u.elapsedTime=s.duration*u.durationProgress,_=u.elapsedTime+=e)),E=(s.progress||0)+_/this._memoizedDuration,E=E>1?1:E<0?0:E,u.durationProgress=E),v=y+s.easing(E)*(p-y),x=(v-u.lastPosition)/e,m=E==1}u.lastVelocity=x,Number.isNaN(v)&&(console.warn("Got NaN while animating:",this),m=!0)}a&&!a[h].done&&(m=!1),m?u.done=!0:t=!1,u.setValue(v,s.round)&&(n=!0)});const l=ns(this),c=l.getValue();if(t){const u=_r(i.to);(c!==u||n)&&!s.decay?(l.setValue(u),this._onChange(u)):n&&s.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(e){return xt.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(co(this)){const{to:e,config:t}=this.animation;xt.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Ze.und(e)?(n=this.queue||[],this.queue=[]):n=[Ze.obj(e)?e:ei({},t,{to:e})],Promise.all(n.map(i=>this._update(i))).then(i=>f_(this,i))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),$u(this._state,e&&this._lastCallId),xt.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:i}=e;n=Ze.obj(n)?n[t]:n,(n==null||Lv(n))&&(n=void 0),i=Ze.obj(i)?i[t]:i,i==null&&(i=void 0);const s={to:n,from:i};return d0(this)||(e.reverse&&([n,i]=[i,n]),i=_r(i),Ze.und(i)?ns(this)||this._set(n):this._set(i)),s}_update(e,t){let n=ei({},e);const{key:i,defaultProps:s}=this;n.default&&Object.assign(s,h_(n,(l,c)=>/^on/.test(c)?OA(l,i):l)),gE(this,n,"onProps"),$c(this,"onProps",n,this);const o=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const a=this._state;return kA(++this._lastCallId,{key:i,props:n,defaultProps:s,state:a,actions:{pause:()=>{Zc(this)||(pE(this,!0),mu(a.pauseQueue),$c(this,"onPause",Fr(this,Kc(this,this.animation.to)),this))},resume:()=>{Zc(this)&&(pE(this,!1),co(this)&&this._resume(),mu(a.resumeQueue),$c(this,"onResume",Fr(this,Kc(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(l=>{if(n.loop&&l.finished&&!(t&&l.noop)){const c=HA(n);if(c)return this._update(c,!0)}return l})}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Hl(this));const i=!Ze.und(e.to),s=!Ze.und(e.from);if(i||s)if(t.callId>this._lastToId)this._lastToId=t.callId;else return n(Hl(this));const{key:o,defaultProps:a,animation:l}=this,{to:c,from:u}=l;let{to:h=c,from:p=u}=e;s&&!i&&(!t.default||Ze.und(h))&&(h=p),t.reverse&&([h,p]=[p,h]);const m=!Ds(p,u);m&&(l.from=p),p=_r(p);const v=!Ds(h,c);v&&this._focus(h);const _=Lv(t.to),{config:y}=l,{decay:g,velocity:x}=y;(i||s)&&(y.velocity=0),t.config&&!_&&tG(y,ca(t.config,o),t.config!==a.config?ca(a.config,o):void 0);let w=ns(this);if(!w||Ze.und(h))return n(Fr(this,!0));const E=Ze.und(t.reset)?s&&!t.default:!Ze.und(p)&&bu(t.reset,o),b=E?p:this.get(),M=Ku(h),A=Ze.num(M)||Ze.arr(M)||Up(M),P=!_&&(!A||bu(a.immediate||t.immediate,o));if(v){const N=Pv(h);if(N!==w.constructor)if(P)w=this._set(M);else throw Error(`Cannot animate between ${w.constructor.name} and ${N.name}, as the "to" prop suggests`)}const C=w.constructor;let L=is(h),F=!1;if(!L){const N=E||!d0(this)&&m;(v||N)&&(F=Ds(Ku(b),M),L=!F),(!Ds(l.immediate,P)&&!P||!Ds(y.decay,g)||!Ds(y.velocity,x))&&(L=!0)}if(F&&co(this)&&(l.changed&&!E?L=!0:L||this._stop(c)),!_&&((L||is(c))&&(l.values=w.getPayload(),l.toValues=is(h)?null:C==$l?[1]:Er(M)),l.immediate!=P&&(l.immediate=P,!P&&!E&&this._set(c)),L)){const{onRest:N}=l;Kt(oG,X=>gE(this,t,X));const I=Fr(this,Kc(this,c));mu(this._pendingCalls,I),this._pendingCalls.add(n),l.changed&&xt.batchedUpdates(()=>{l.changed=!E,N==null||N(I,this),E?ca(a.onRest,I):l.onStart==null||l.onStart(I,this)})}E&&this._set(b),_?n(BA(t.to,t,this._state,this)):L?this._start():co(this)&&!v?this._pendingCalls.add(n):n(zA(b))}_focus(e){const t=this.animation;e!==t.to&&(iE(this)&&this._detach(),t.to=e,iE(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;is(t)&&(vh(t,this),Dv(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;is(e)&&Vd(e,this)}_set(e,t=!0){const n=_r(e);if(!Ze.und(n)){const i=ns(this);if(!i||!Ds(n,i.getValue())){const s=Pv(n);!i||i.constructor!=s?l_(this,s.create(n)):i.setValue(n),i&&xt.batchedUpdates(()=>{this._onChange(n,t)})}}return ns(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,$c(this,"onStart",Fr(this,Kc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ca(this.animation.onChange,e,this)),ca(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;ns(this).reset(_r(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),co(this)||(dE(this,!0),Zc(this)||this._resume())}_resume(){us.skipAnimation?this.finish():Lp.start(this)}_stop(e,t){if(co(this)){dE(this,!1);const n=this.animation;Kt(n.values,s=>{s.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Hd(this,{type:"idle",parent:this});const i=t?Hl(this.get()):Fr(this.get(),Kc(this,e??n.to));mu(this._pendingCalls,i),n.changed&&(n.changed=!1,$c(this,"onRest",i,this))}}}function Kc(r,e){const t=Ku(e),n=Ku(r.get());return Ds(n,t)}function HA(r,e=r.loop,t=r.to){let n=ca(e);if(n){const i=n!==!0&&FA(n),s=(i||r).reverse,o=!i||i.reset;return Ju(ei({},r,{loop:e,default:!1,pause:void 0,to:!s||Lv(t)?t:void 0,from:o?r.from:void 0,reset:o},i))}}function Ju(r){const{to:e,from:t}=r=FA(r),n=new Set;return Ze.obj(e)&&mE(e,n),Ze.obj(t)&&mE(t,n),r.keys=n.size?Array.from(n):null,r}function sG(r){const e=Ju(r);return Ze.und(e.default)&&(e.default=h_(e)),e}function mE(r,e){Gs(r,(t,n)=>t!=null&&e.add(n))}const oG=["onStart","onRest","onChange","onPause","onResume"];function gE(r,e,t){r.animation[t]=e[t]!==NA(e,t)?OA(e[t],r.key):void 0}function $c(r,e,...t){var n,i,s,o;(n=(i=r.animation)[e])==null||n.call(i,...t),(s=(o=r.defaultProps)[e])==null||s.call(o,...t)}const aG=["onStart","onChange","onRest"];let lG=1;class cG{constructor(e,t){this.id=lG++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(ei({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,n)=>e[n]=t.get()),e}set(e){for(const t in e){const n=e[t];Ze.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Ju(e)),this}start(e){let{queue:t}=this;return e?t=Er(e).map(Ju):this.queue=[],this._flush?this._flush(this,t):(YA(this,t),Nv(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Kt(Er(t),i=>n[i].stop(!!e))}else $u(this._state,this._lastAsyncId),this.each(n=>n.stop(!!e));return this}pause(e){if(Ze.und(e))this.start({pause:!0});else{const t=this.springs;Kt(Er(e),n=>t[n].pause())}return this}resume(e){if(Ze.und(e))this.start({pause:!1});else{const t=this.springs;Kt(Er(e),n=>t[n].resume())}return this}each(e){Gs(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,i=this._active.size>0,s=this._changed.size>0;(i&&!this._started||s&&!this._started)&&(this._started=!0,Su(e,([l,c])=>{c.value=this.get(),l(c,this,this._item)}));const o=!i&&this._started,a=s||o&&n.size?this.get():null;s&&t.size&&Su(t,([l,c])=>{c.value=a,l(c,this,this._item)}),o&&(this._started=!1,Su(n,([l,c])=>{c.value=a,l(c,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;xt.onFrame(this._onFrame)}}function Nv(r,e){return Promise.all(e.map(t=>VA(r,t))).then(t=>f_(r,t))}async function VA(r,e,t){const{keys:n,to:i,from:s,loop:o,onRest:a,onResolve:l}=e,c=Ze.obj(e.default)&&e.default;o&&(e.loop=!1),i===!1&&(e.to=null),s===!1&&(e.from=null);const u=Ze.arr(i)||Ze.fun(i)?i:void 0;u?(e.to=void 0,e.onRest=void 0,c&&(c.onRest=void 0)):Kt(aG,_=>{const y=e[_];if(Ze.fun(y)){const g=r._events[_];e[_]=({finished:x,cancelled:w})=>{const E=g.get(y);E?(x||(E.finished=!1),w&&(E.cancelled=!0)):g.set(y,{value:null,finished:x||!1,cancelled:w||!1})},c&&(c[_]=e[_])}});const h=r._state;e.pause===!h.paused?(h.paused=e.pause,mu(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const p=(n||Object.keys(r.springs)).map(_=>r.springs[_].start(e)),m=e.cancel===!0||NA(e,"cancel")===!0;(u||m&&h.asyncId)&&p.push(kA(++r._lastAsyncId,{props:e,state:h,actions:{pause:Av,resume:Av,start(_,y){m?($u(h,r._lastAsyncId),y(Hl(r))):(_.onRest=a,y(BA(u,_,h,r)))}}})),h.paused&&await new Promise(_=>{h.resumeQueue.add(_)});const v=f_(r,await Promise.all(p));if(o&&v.finished&&!(t&&v.noop)){const _=HA(e,o,i);if(_)return YA(r,[_]),VA(r,_,!0)}return l&&xt.batchedUpdates(()=>l(v,r,r.item)),v}function vE(r,e){const t=ei({},r.springs);return e&&Kt(Er(e),n=>{Ze.und(n.keys)&&(n=Ju(n)),Ze.obj(n.to)||(n=ei({},n,{to:void 0})),jA(t,n,i=>XA(i))}),WA(r,t),t}function WA(r,e){Gs(e,(t,n)=>{r.springs[n]||(r.springs[n]=t,vh(t,r))})}function XA(r,e){const t=new rG;return t.key=r,e&&vh(t,e),t}function jA(r,e,t){e.keys&&Kt(e.keys,n=>{(r[n]||(r[n]=t(n)))._prepareNode(e)})}function YA(r,e){Kt(e,t=>{jA(r.springs,t,n=>XA(n,r))})}function uG(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,s;for(s=0;s=0)&&(t[i]=r[i]);return t}const hG=["children"],Np=r=>{let{children:e}=r,t=uG(r,hG);const n=K.useContext(jd),i=t.pause||!!n.pause,s=t.immediate||!!n.immediate;t=F4(()=>({pause:i,immediate:s}),[i,s]);const{Provider:o}=jd;return K.createElement(o,{value:t},e)},jd=fG(Np,{});Np.Provider=jd.Provider;Np.Consumer=jd.Consumer;function fG(r,e){return Object.assign(r,K.createContext(e)),r.Provider._context=r,r.Consumer._context=r,r}const dG=()=>{const r=[],e=function(i){O4();const s=[];return Kt(r,(o,a)=>{if(Ze.und(i))s.push(o.start());else{const l=t(i,o,a);l&&s.push(o.start(l))}}),s};e.current=r,e.add=function(n){r.includes(n)||r.push(n)},e.delete=function(n){const i=r.indexOf(n);~i&&r.splice(i,1)},e.pause=function(){return Kt(r,n=>n.pause(...arguments)),this},e.resume=function(){return Kt(r,n=>n.resume(...arguments)),this},e.set=function(n){Kt(r,i=>i.set(n))},e.start=function(n){const i=[];return Kt(r,(s,o)=>{if(Ze.und(n))i.push(s.start());else{const a=this._getProps(n,s,o);a&&i.push(s.start(a))}}),i},e.stop=function(){return Kt(r,n=>n.stop(...arguments)),this},e.update=function(n){return Kt(r,(i,s)=>i.update(this._getProps(n,i,s))),this};const t=function(i,s,o){return Ze.fun(i)?i(o,s):i};return e._getProps=t,e};function pG(r,e,t){const n=Ze.fun(e)&&e;n&&!t&&(t=[]);const i=K.useMemo(()=>n||arguments.length==3?dG():void 0,[]),s=K.useRef(0),o=IA(),a=K.useMemo(()=>({ctrls:[],queue:[],flush(g,x){const w=vE(g,x);return s.current>0&&!a.queue.length&&!Object.keys(w).some(b=>!g.springs[b])?Nv(g,x):new Promise(b=>{WA(g,w),a.queue.push(()=>{b(Nv(g,x))}),o()})}}),[]),l=K.useRef([...a.ctrls]),c=[],u=sE(r)||0;K.useMemo(()=>{Kt(l.current.slice(r,u),g=>{$4(g,i),g.stop(!0)}),l.current.length=r,h(u,r)},[r]),K.useMemo(()=>{h(0,Math.min(u,r))},t);function h(g,x){for(let w=g;wvE(g,c[x])),m=K.useContext(Np),v=sE(m),_=m!==v&&K4(m);a_(()=>{s.current++,a.ctrls=l.current;const{queue:g}=a;g.length&&(a.queue=[],Kt(g,x=>x())),Kt(l.current,(x,w)=>{i==null||i.add(x),_&&x.start({default:m});const E=c[w];E&&(J4(x,E.ref),x.ref?x.queue.push(E):x.start(E))})}),DA(()=>()=>{Kt(a.ctrls,g=>g.stop(!0))});const y=p.map(g=>ei({},g));return i?[y,i]:y}function tr(r,e){const t=Ze.fun(r),[[n],i]=pG(1,t?r:[r],t?e||[]:e);return t||arguments.length==2?[n,i]:n}let yE;(function(r){r.MOUNT="mount",r.ENTER="enter",r.UPDATE="update",r.LEAVE="leave"})(yE||(yE={}));class mG extends d_{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=qu(...t);const n=this._get(),i=Pv(n);l_(this,i.create(n))}advance(e){const t=this._get(),n=this.get();Ds(t,n)||(ns(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&_E(this._active)&&p0(this)}_get(){const e=Ze.arr(this.source)?this.source.map(_r):Er(_r(this.source));return this.calc(...e)}_start(){this.idle&&!_E(this._active)&&(this.idle=!1,Kt(Op(this),e=>{e.done=!1}),us.skipAnimation?(xt.batchedUpdates(()=>this.advance()),p0(this)):Lp.start(this))}_attach(){let e=1;Kt(Er(this.source),t=>{is(t)&&vh(t,this),Dv(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){Kt(Er(this.source),e=>{is(e)&&Vd(e,this)}),this._active.clear(),p0(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=Er(this.source).reduce((t,n)=>Math.max(t,(Dv(n)?n.priority:0)+1),0))}}function gG(r){return r.idle!==!1}function _E(r){return!r.size||Array.from(r).every(gG)}function p0(r){r.idle||(r.idle=!0,Kt(Op(r),e=>{e.done=!0}),Hd(r,{type:"idle",parent:r}))}us.assign({createStringInterpolator:PA,to:(r,e)=>new mG(r,e)});const vG=["primitive"].concat(Object.keys(uT).filter(r=>/^[A-Z]/.test(r)).map(r=>r[0].toLowerCase()+r.slice(1)));us.assign({createStringInterpolator:PA,colors:f4,frameLoop:"demand"});pO(()=>{xt.advance()});const yG=X4(vG,{applyAnimatedValues:oa}),An=yG.animated,od=(r,e)=>{const t=r[0].index!==null,n=new Set(Object.keys(r[0].attributes)),i=new Set(Object.keys(r[0].morphAttributes)),s={},o={},a=r[0].morphTargetsRelative,l=new Tt;let c=0;if(r.forEach((u,h)=>{let p=0;if(t!==(u.index!==null))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."),null;for(let m in u.attributes){if(!n.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+'. All geometries must have compatible attributes; make sure "'+m+'" attribute exists among all geometries, or in none of them.'),null;s[m]===void 0&&(s[m]=[]),s[m].push(u.attributes[m]),p++}if(p!==n.size)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". Make sure all geometries have the same number of attributes."),null;if(a!==u.morphTargetsRelative)return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphTargetsRelative must be consistent throughout all geometries."),null;for(let m in u.morphAttributes){if(!i.has(m))return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". .morphAttributes must be consistent throughout all geometries."),null;o[m]===void 0&&(o[m]=[]),o[m].push(u.morphAttributes[m])}if(l.userData.mergedUserData=l.userData.mergedUserData||[],l.userData.mergedUserData.push(u.userData),e){let m;if(u.index)m=u.index.count;else if(u.attributes.position!==void 0)m=u.attributes.position.count;else return console.error("THREE.BufferGeometryUtils: .mergeBufferGeometries() failed with geometry at index "+h+". The geometry must have either an index or a position attribute"),null;l.addGroup(c,m,h),c+=m}}),t){let u=0;const h=[];r.forEach(p=>{const m=p.index;for(let v=0;v{let e,t,n,i=0;if(r.forEach(s=>{if(e===void 0&&(e=s.array.constructor),e!==s.array.constructor)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."),null;if(t===void 0&&(t=s.itemSize),t!==s.itemSize)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."),null;if(n===void 0&&(n=s.normalized),n!==s.normalized)return console.error("THREE.BufferGeometryUtils: .mergeBufferAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."),null;i+=s.array.length}),e&&t){const s=new e(i);let o=0;return r.forEach(a=>{s.set(a.array,o),o+=a.array.length}),new $t(s,t,n)}},m0=new oh,g0=new Y,Ml=new Y,Dr=new Y,Ps=new Y,Qr=new Y,Ls=new Y,Is=new Y,Jc=new Y,Qc=new Y,eu=new Y,ad=new Y,tu=new Y,nu=new Y,iu=new Y;class wE{constructor(e,t,n){this.camera=e,this.scene=t,this.startPoint=new Y,this.endPoint=new Y,this.collection=[],this.deep=n||Number.MAX_VALUE}select(e,t){return this.startPoint=e||this.startPoint,this.endPoint=t||this.endPoint,this.collection=[],this.updateFrustum(this.startPoint,this.endPoint),this.searchChildInFrustum(m0,this.scene),this.collection}updateFrustum(e,t){if(e=e||this.startPoint,t=t||this.endPoint,e.x===t.x&&(t.x+=Number.EPSILON),e.y===t.y&&(t.y+=Number.EPSILON),this.camera.updateProjectionMatrix(),this.camera.updateMatrixWorld(),this.camera.isPerspectiveCamera){Ml.copy(e),Ml.x=Math.min(e.x,t.x),Ml.y=Math.max(e.y,t.y),t.x=Math.max(e.x,t.x),t.y=Math.min(e.y,t.y),Dr.setFromMatrixPosition(this.camera.matrixWorld),Ps.copy(Ml),Qr.set(t.x,Ml.y,0),Ls.copy(t),Is.set(Ml.x,t.y,0),Ps.unproject(this.camera),Qr.unproject(this.camera),Ls.unproject(this.camera),Is.unproject(this.camera),tu.copy(Ps).sub(Dr),nu.copy(Qr).sub(Dr),iu.copy(Ls).sub(Dr),tu.normalize(),nu.normalize(),iu.normalize(),tu.multiplyScalar(this.deep),nu.multiplyScalar(this.deep),iu.multiplyScalar(this.deep),tu.add(Dr),nu.add(Dr),iu.add(Dr);var n=m0.planes;n[0].setFromCoplanarPoints(Dr,Ps,Qr),n[1].setFromCoplanarPoints(Dr,Qr,Ls),n[2].setFromCoplanarPoints(Ls,Is,Dr),n[3].setFromCoplanarPoints(Is,Ps,Dr),n[4].setFromCoplanarPoints(Qr,Ls,Is),n[5].setFromCoplanarPoints(iu,nu,tu),n[5].normal.multiplyScalar(-1)}else if(this.camera.isOrthographicCamera){const i=Math.min(e.x,t.x),s=Math.max(e.y,t.y),o=Math.max(e.x,t.x),a=Math.min(e.y,t.y);Ps.set(i,s,-1),Qr.set(o,s,-1),Ls.set(o,a,-1),Is.set(i,a,-1),Jc.set(i,s,1),Qc.set(o,s,1),eu.set(o,a,1),ad.set(i,a,1),Ps.unproject(this.camera),Qr.unproject(this.camera),Ls.unproject(this.camera),Is.unproject(this.camera),Jc.unproject(this.camera),Qc.unproject(this.camera),eu.unproject(this.camera),ad.unproject(this.camera);var n=m0.planes;n[0].setFromCoplanarPoints(Ps,Jc,Qc),n[1].setFromCoplanarPoints(Qr,Qc,eu),n[2].setFromCoplanarPoints(eu,ad,Is),n[3].setFromCoplanarPoints(ad,Jc,Ps),n[4].setFromCoplanarPoints(Qr,Ls,Is),n[5].setFromCoplanarPoints(eu,Qc,Jc),n[5].normal.multiplyScalar(-1)}else console.error("THREE.SelectionBox: Unsupported camera type.")}searchChildInFrustum(e,t){if((t.isMesh||t.isLine||t.isPoints)&&t.material!==void 0&&(t.geometry.boundingSphere===null&&t.geometry.computeBoundingSphere(),g0.copy(t.geometry.boundingSphere.center),g0.applyMatrix4(t.matrixWorld),e.containsPoint(g0)&&this.collection.push(t)),t.children.length>0)for(let n=0;n{if(!t||!c.current)return;const p=c.current.rotation.clone();c.current.updateMatrix(),c.current.updateWorldMatrix(!1,!1),c.current.getWorldQuaternion(u),h.getWorldQuaternion(l.current.quaternion).premultiply(u.invert()),n&&(c.current.rotation.x=p.x),i&&(c.current.rotation.y=p.y),s&&(c.current.rotation.z=p.z)}),K.useImperativeHandle(a,()=>c.current,[]),K.createElement("group",Ta({ref:c,matrixAutoUpdate:!1,matrixWorldAutoUpdate:!1},o),K.createElement("group",{ref:l},e))});function _G(){var r=Object.create(null);function e(i,s){var o=i.id,a=i.name,l=i.dependencies;l===void 0&&(l=[]);var c=i.init;c===void 0&&(c=function(){});var u=i.getTransferables;if(u===void 0&&(u=null),!r[o])try{l=l.map(function(p){return p&&p.isWorkerModule&&(e(p,function(m){if(m instanceof Error)throw m}),p=r[p.id].value),p}),c=n("<"+a+">.init",c),u&&(u=n("<"+a+">.getTransferables",u));var h=null;typeof c=="function"?h=c.apply(void 0,l):console.error("worker module init function failed to rehydrate"),r[o]={id:o,value:h,getTransferables:u},s(h)}catch(p){p&&p.noLog||console.error(p),s(p)}}function t(i,s){var o,a=i.id,l=i.args;(!r[a]||typeof r[a].value!="function")&&s(new Error("Worker module "+a+": not found or its 'init' did not return a function"));try{var c=(o=r[a]).value.apply(o,l);c&&typeof c.then=="function"?c.then(u,function(h){return s(h instanceof Error?h:new Error(""+h))}):u(c)}catch(h){s(h)}function u(h){try{var p=r[a].getTransferables&&r[a].getTransferables(h);(!p||!Array.isArray(p)||!p.length)&&(p=void 0),s(h,p)}catch(m){console.error(m),s(m)}}}function n(i,s){var o=void 0;self.troikaDefine=function(l){return o=l};var a=URL.createObjectURL(new Blob(["/** "+i.replace(/\*/g,"")+` **/ + +troikaDefine( +`+s+` +)`],{type:"application/javascript"}));try{importScripts(a)}catch(l){console.error(l)}return URL.revokeObjectURL(a),delete self.troikaDefine,o}self.addEventListener("message",function(i){var s=i.data,o=s.messageId,a=s.action,l=s.data;try{a==="registerModule"&&e(l,function(c){c instanceof Error?postMessage({messageId:o,success:!1,error:c.message}):postMessage({messageId:o,success:!0,result:{isCallable:typeof c=="function"}})}),a==="callModule"&&t(l,function(c,u){c instanceof Error?postMessage({messageId:o,success:!1,error:c.message}):postMessage({messageId:o,success:!0,result:c},u||void 0)})}catch(c){postMessage({messageId:o,success:!1,error:c.stack})}})}function xG(r){var e=function(){for(var t=[],n=arguments.length;n--;)t[n]=arguments[n];return e._getInitResult().then(function(i){if(typeof i=="function")return i.apply(void 0,t);throw new Error("Worker module function was called but `init` did not return a callable function")})};return e._getInitResult=function(){var t=r.dependencies,n=r.init;t=Array.isArray(t)?t.map(function(s){return s&&s._getInitResult?s._getInitResult():s}):[];var i=Promise.all(t).then(function(s){return n.apply(null,s)});return e._getInitResult=function(){return i},i},e}var ZA=function(){var r=!1;if(typeof window<"u"&&typeof window.document<"u")try{var e=new Worker(URL.createObjectURL(new Blob([""],{type:"application/javascript"})));e.terminate(),r=!0}catch(t){console.log("Troika createWorkerModule: web workers not allowed; falling back to main thread execution. Cause: ["+t.message+"]")}return ZA=function(){return r},r},wG=0,SG=0,v0=!1,Mu=Object.create(null),Tu=Object.create(null),Fv=Object.create(null);function yh(r){if((!r||typeof r.init!="function")&&!v0)throw new Error("requires `options.init` function");var e=r.dependencies,t=r.init,n=r.getTransferables,i=r.workerId;if(!ZA())return xG(r);i==null&&(i="#default");var s="workerModule"+ ++wG,o=r.name||s,a=null;e=e&&e.map(function(c){return typeof c=="function"&&!c.workerModuleData&&(v0=!0,c=yh({workerId:i,name:"<"+o+"> function dependency: "+c.name,init:`function(){return ( +`+Rd(c)+` +)}`}),v0=!1),c&&c.workerModuleData&&(c=c.workerModuleData),c});function l(){for(var c=[],u=arguments.length;u--;)c[u]=arguments[u];if(!a){a=SE(i,"registerModule",l.workerModuleData);var h=function(){a=null,Tu[i].delete(h)};(Tu[i]||(Tu[i]=new Set)).add(h)}return a.then(function(p){var m=p.isCallable;if(m)return SE(i,"callModule",{id:s,args:c});throw new Error("Worker module function was called but `init` did not return a callable function")})}return l.workerModuleData={isWorkerModule:!0,id:s,name:o,dependencies:e,init:Rd(t),getTransferables:n&&Rd(n)},l}function EG(r){Tu[r]&&Tu[r].forEach(function(e){e()}),Mu[r]&&(Mu[r].terminate(),delete Mu[r])}function Rd(r){var e=r.toString();return!/^function/.test(e)&&/^\w+\s*\(/.test(e)&&(e="function "+e),e}function bG(r){var e=Mu[r];if(!e){var t=Rd(_G);e=Mu[r]=new Worker(URL.createObjectURL(new Blob(["/** Worker Module Bootstrap: "+r.replace(/\*/g,"")+` **/ + +;(`+t+")()"],{type:"application/javascript"}))),e.onmessage=function(n){var i=n.data,s=i.messageId,o=Fv[s];if(!o)throw new Error("WorkerModule response with empty or unknown messageId");delete Fv[s],o(i)}}return e}function SE(r,e,t){return new Promise(function(n,i){var s=++SG;Fv[s]=function(o){o.success?n(o.result):i(new Error("Error in worker "+e+" call: "+o.error))},bG(r).postMessage({messageId:s,action:e,data:t})})}function KA(){var r=(function(e){function t(G,B,D,V,Z,ee,ie,ue){var ce=1-ie;ue.x=ce*ce*G+2*ce*ie*D+ie*ie*Z,ue.y=ce*ce*B+2*ce*ie*V+ie*ie*ee}function n(G,B,D,V,Z,ee,ie,ue,ce,le){var Ae=1-ce;le.x=Ae*Ae*Ae*G+3*Ae*Ae*ce*D+3*Ae*ce*ce*Z+ce*ce*ce*ie,le.y=Ae*Ae*Ae*B+3*Ae*Ae*ce*V+3*Ae*ce*ce*ee+ce*ce*ce*ue}function i(G,B){for(var D=/([MLQCZ])([^MLQCZ]*)/g,V,Z,ee,ie,ue;V=D.exec(G);){var ce=V[2].replace(/^\s*|\s*$/g,"").split(/[,\s]+/).map(function(le){return parseFloat(le)});switch(V[1]){case"M":ie=Z=ce[0],ue=ee=ce[1];break;case"L":(ce[0]!==ie||ce[1]!==ue)&&B("L",ie,ue,ie=ce[0],ue=ce[1]);break;case"Q":{B("Q",ie,ue,ie=ce[2],ue=ce[3],ce[0],ce[1]);break}case"C":{B("C",ie,ue,ie=ce[4],ue=ce[5],ce[0],ce[1],ce[2],ce[3]);break}case"Z":(ie!==Z||ue!==ee)&&B("L",ie,ue,Z,ee);break}}}function s(G,B,D){D===void 0&&(D=16);var V={x:0,y:0};i(G,function(Z,ee,ie,ue,ce,le,Ae,Ee,ae){switch(Z){case"L":B(ee,ie,ue,ce);break;case"Q":{for(var z=ee,oe=ie,te=1;te0;)be[Me]=arguments[Me+2];var Fe=Le[we]||(Le[we]=D.getUniformLocation(ge,we));D["uniform"+ne].apply(D,[Fe].concat(be))},setAttribute:function(ne,we,be,Me,Fe){var Ue=Se[ne];Ue||(Ue=Se[ne]={buf:D.createBuffer(),loc:D.getAttribLocation(ge,ne),data:null}),D.bindBuffer(D.ARRAY_BUFFER,Ue.buf),D.vertexAttribPointer(Ue.loc,we,D.FLOAT,!1,0,0),D.enableVertexAttribArray(Ue.loc),Z?D.vertexAttribDivisor(Ue.loc,Me):Ae("ANGLE_instanced_arrays").vertexAttribDivisorANGLE(Ue.loc,Me),Fe!==Ue.data&&(D.bufferData(D.ARRAY_BUFFER,Fe,be),Ue.data=Fe)}})}}}ie[se].transaction(de)},z=function(se,$){ce++;try{D.activeTexture(D.TEXTURE0+ce);var Ie=ue[se];Ie||(Ie=ue[se]=D.createTexture(),D.bindTexture(D.TEXTURE_2D,Ie),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,D.NEAREST),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,D.NEAREST)),D.bindTexture(D.TEXTURE_2D,Ie),$(Ie,ce)}finally{ce--}},oe=function(se,$,Ie){var de=D.createFramebuffer();le.push(de),D.bindFramebuffer(D.FRAMEBUFFER,de),D.activeTexture(D.TEXTURE0+$),D.bindTexture(D.TEXTURE_2D,se),D.framebufferTexture2D(D.FRAMEBUFFER,D.COLOR_ATTACHMENT0,D.TEXTURE_2D,se,0);try{Ie(de)}finally{D.deleteFramebuffer(de),D.bindFramebuffer(D.FRAMEBUFFER,le[--le.length-1]||null)}},te=function(){ee={},ie={},ue={},ce=-1,le.length=0};var Z=typeof WebGL2RenderingContext<"u"&&D instanceof WebGL2RenderingContext,ee={},ie={},ue={},ce=-1,le=[];D.canvas.addEventListener("webglcontextlost",function(se){te(),se.preventDefault()},!1),l.set(D,V={gl:D,isWebGL2:Z,getExtension:Ae,withProgram:ae,withTexture:z,withTextureFramebuffer:oe,handleContextLoss:te})}B(V)}function h(G,B,D,V,Z,ee,ie,ue){ie===void 0&&(ie=15),ue===void 0&&(ue=null),u(G,function(ce){var le=ce.gl,Ae=ce.withProgram,Ee=ce.withTexture;Ee("copy",function(ae,z){le.texImage2D(le.TEXTURE_2D,0,le.RGBA,Z,ee,0,le.RGBA,le.UNSIGNED_BYTE,B),Ae("copy",o,a,function(oe){var te=oe.setUniform,se=oe.setAttribute;se("aUV",2,le.STATIC_DRAW,0,new Float32Array([0,0,2,0,0,2])),te("1i","image",z),le.bindFramebuffer(le.FRAMEBUFFER,ue||null),le.disable(le.BLEND),le.colorMask(ie&8,ie&4,ie&2,ie&1),le.viewport(D,V,Z,ee),le.scissor(D,V,Z,ee),le.drawArrays(le.TRIANGLES,0,3)})})})}function p(G,B,D){var V=G.width,Z=G.height;u(G,function(ee){var ie=ee.gl,ue=new Uint8Array(V*Z*4);ie.readPixels(0,0,V,Z,ie.RGBA,ie.UNSIGNED_BYTE,ue),G.width=B,G.height=D,h(ie,ue,0,0,V,Z)})}var m=Object.freeze({__proto__:null,withWebGLContext:u,renderImageData:h,resizeWebGLCanvasWithoutClearing:p});function v(G,B,D,V,Z,ee){ee===void 0&&(ee=1);var ie=new Uint8Array(G*B),ue=V[2]-V[0],ce=V[3]-V[1],le=[];s(D,function(se,$,Ie,de){le.push({x1:se,y1:$,x2:Ie,y2:de,minX:Math.min(se,Ie),minY:Math.min($,de),maxX:Math.max(se,Ie),maxY:Math.max($,de)})}),le.sort(function(se,$){return se.maxX-$.maxX});for(var Ae=0;AeLe.minX&&$-deLe.minY){var ge=g(se,$,Le.x1,Le.y1,Le.x2,Le.y2);ge$!=Se.y2>$&&se<(Se.x2-Se.x1)*($-Se.y1)/(Se.y2-Se.y1)+Se.x1;Le&&(Ie+=Se.y1p.y!=seg.w>p.y)&&(p.x<(seg.z-seg.x)*(p.y-seg.y)/(seg.w-seg.y)+seg.x);bool crossingUp=crossing&&vLineSegment.y1,1e>2,u>2,2wt>1,1>1,1ge>1,1wp>1,1j>1,f>1,hm>1,1>1,u>1,u6>1,1>1,+5,28>1,w>1,1>1,+3,b8>1,1>1,+3,1>3,-1>-1,3>1,1>1,+2,1s>1,1>1,x>1,th>1,1>1,+2,db>1,1>1,+3,3>1,1>1,+2,14qm>1,1>1,+1,4q>1,1e>2,u>2,2>1,+1",canonical:"6f1>-6dx,6dy>-6dx,6ec>-6ed,6ee>-6ed,6ww>2jj,-2ji>2jj,14r4>-1e7l,1e7m>-1e7l,1e7m>-1e5c,1e5d>-1e5b,1e5c>-14qx,14qy>-14qx,14vn>-1ecg,1ech>-1ecg,1edu>-1ecg,1eci>-1ecg,1eda>-1ecg,1eci>-1ecg,1eci>-168q,168r>-168q,168s>-14ye,14yf>-14ye"};function _(de,Se){var Le=36,ge=0,He=new Map,j=Se&&new Map,H;return de.split(",").forEach(function ne(we){if(we.indexOf("+")!==-1)for(var be=+we;be--;)ne(H);else{H=we;var Me=we.split(">"),Fe=Me[0],Ue=Me[1];Fe=String.fromCodePoint(ge+=parseInt(Fe,Le)),Ue=String.fromCodePoint(ge+=parseInt(Ue,Le)),He.set(Fe,Ue),Se&&j.set(Ue,Fe)}}),{map:He,reverseMap:j}}var y,g,x;function w(){if(!y){var de=_(v.pairs,!0),Se=de.map,Le=de.reverseMap;y=Se,g=Le,x=_(v.canonical,!1).map}}function E(de){return w(),y.get(de)||null}function b(de){return w(),g.get(de)||null}function M(de){return w(),x.get(de)||null}var A=n.L,P=n.R,C=n.EN,L=n.ES,F=n.ET,N=n.AN,I=n.CS,X=n.B,q=n.S,W=n.ON,O=n.BN,k=n.NSM,G=n.AL,B=n.LRO,D=n.RLO,V=n.LRE,Z=n.RLE,ee=n.PDF,ie=n.LRI,ue=n.RLI,ce=n.FSI,le=n.PDI;function Ae(de,Se){for(var Le=125,ge=new Uint32Array(de.length),He=0;He0)We--;else if(pt>0){for(nt=0;!Ve[Ve.length-1]._isolate;)Ve.pop();var _t=Ve[Ve.length-1]._isolInitIndex;_t!=null&&(we.set(_t,re),we.set(re,_t)),Ve.pop(),pt--}Oe=Ve[Ve.length-1],ne[re]=Oe._level,Oe._override&&H(re,Oe._override)}else ze&ee?(We===0&&(nt>0?nt--:!Oe._isolate&&Ve.length>1&&(Ve.pop(),Oe=Ve[Ve.length-1])),ne[re]=Oe._level):ze&X&&(ne[re]=Me.level);else ne[re]=Oe._level,Oe._override&&ze!==O&&H(re,Oe._override)}for(var It=[],Ft=null,Ot=Me.start;Ot<=Me.end;Ot++){var Yt=ge[Ot];if(!(Yt&l)){var Nt=ne[Ot],Rt=Yt&s,li=Yt===le;Ft&&Nt===Ft._level?(Ft._end=Ot,Ft._endsWithIsolInit=Rt):It.push(Ft={_start:Ot,_end:Ot,_level:Nt,_startsWithPDI:li,_endsWithIsolInit:Rt})}}for(var jn=[],Bt=0;Bt=0;pe--)if(!(ge[pe]&l)){Re=ne[pe];break}var Pe=Gn[Gn.length-1],it=ne[Pe],lt=Me.level;if(!(ge[Pe]&s)){for(var ct=Pe+1;ct<=Me.end;ct++)if(!(ge[ct]&l)){lt=ne[ct];break}}jn.push({_seqIndices:Gn,_sosType:Math.max(Re,me)%2?P:A,_eosType:Math.max(lt,it)%2?P:A})}}for(var dt=0;dt=0;mt--)if(!(ge[ke[mt]]&l)){qt=ge[ke[mt]];break}H(ci,qt&(s|le)?W:qt)}}if(j.get(C))for(var kt=0;kt=-1;Cn--){var En=Cn===-1?ut:ge[ke[Cn]];if(En&o){En===G&&H(gt,N);break}}}if(j.get(G))for(var cn=0;cn=0&&(xi=ge[ke[Xr]],!!(xi&l));Xr--);for(var jr=Qt+1;jr=0&&ge[ke[Oa]]&(F|l);Oa--)H(ke[Oa],C);for(ui++;ui=0&&ge[ke[fs]]&l;fs--)H(ke[fs],W);for(var ds=Ro+1;ds=0;gs--){var Fa=Ys[gs].char;if(Fa===oc||Fa===b(M(Ut))||E(M(Fa))===Ut){Yr.push([Ys[gs].seqIndex,qr]),Ys.length=gs;break}}}Yr.sort(function(Zn,bi){return Zn[0]-bi[0]})}for(var ac=0;ac=0;cc--){var bh=ke[cc];if(ge[bh]&Na){var Xi=ge[bh]&ms?P:A;Xi!==Gt?wi=Xi:wi=Gt;break}}}if(wi){if(ge[ke[pn]]=ge[ke[Lo]]=wi,wi!==Gt){for(var Si=pn+1;Si=0;Do--)if(ge[ke[Do]]&l)uc=Do;else{Di=ge[ke[Do]]&ms?P:A;break}for(var Uo=Jt,Oo=or+1;Oo=0&&p(de[qs])&c;qs--)ne[qs]=Me.level}}return{levels:ne,paragraphs:be};function za(Zn,bi){for(var Rn=Zn;Rn=ne&&p(de[Me])&c;Me--)be[Me]=H.level;for(var Fe=H.level,Ue=1/0,xe=0;xeFe&&(Fe=Be),Be=Ue;$e--)for(var Ve=0;Ve=$e){for(var Oe=Ve;Ve+1=$e;)Ve++;Ve>Oe&&j.push([Oe+ne,Ve+ne])}}}),j}function $(de,Se,Le,ge){var He=Ie(de,Se,Le,ge),j=[].concat(de);return He.forEach(function(H,ne){j[ne]=(Se.levels[H]&1?oe(de[H]):null)||de[H]}),j.join("")}function Ie(de,Se,Le,ge){for(var He=se(de,Se,Le,ge),j=[],H=0;H/gm;function t(n,i){let s=bt[i];return s?kv(s):n}return r.replace(e,t)}const ii=[];for(let r=0;r<256;r++)ii[r]=(r<16?"0":"")+r.toString(16);function TG(){const r=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(ii[r&255]+ii[r>>8&255]+ii[r>>16&255]+ii[r>>24&255]+"-"+ii[e&255]+ii[e>>8&255]+"-"+ii[e>>16&15|64]+ii[e>>24&255]+"-"+ii[t&63|128]+ii[t>>8&255]+"-"+ii[t>>16&255]+ii[t>>24&255]+ii[n&255]+ii[n>>8&255]+ii[n>>16&255]+ii[n>>24&255]).toUpperCase()}const na=Object.assign||function(){let r=arguments[0];for(let e=1,t=arguments.length;e/gm,` +//!BEGIN_POST_CHUNK $1 +$& +//!END_POST_CHUNK +`),t=kv(t)),m){let _=m({vertexShader:e,fragmentShader:t});e=_.vertexShader,t=_.fragmentShader}if(p){let _=[];t=t.replace(/^\/\/!BEGIN_POST_CHUNK[^]+?^\/\/!END_POST_CHUNK/gm,y=>(_.push(y),"")),h=`${p} +${_.join(` +`)} +${h}`}if(v){const _=` +uniform float ${v}; +`;s=_+s,c=_+c}return l&&(e=`vec3 troika_position_${i}; +vec3 troika_normal_${i}; +vec2 troika_uv_${i}; +${e} +`,s=`${s} +void troikaVertexTransform${i}(inout vec3 position, inout vec3 normal, inout vec2 uv) { + ${l} +} +`,o=` +troika_position_${i} = vec3(position); +troika_normal_${i} = vec3(normal); +troika_uv_${i} = vec2(uv); +troikaVertexTransform${i}(troika_position_${i}, troika_normal_${i}, troika_uv_${i}); +${o} +`,e=e.replace(/\b(position|normal|uv)\b/g,(_,y,g,x)=>/\battribute\s+vec[23]\s+$/.test(x.substr(0,g))?y:`troika_${y}_${i}`),r.map&&r.map.channel>0||(e=e.replace(/\bMAP_UV\b/g,`troika_uv_${i}`))),e=ME(e,i,s,o,a),t=ME(t,i,c,u,h),{vertexShader:e,fragmentShader:t}}function ME(r,e,t,n,i){return(n||i||t)&&(r=r.replace($A,` +${t} +void troikaOrigMain${e}() {`),r+=` +void main() { + ${n} + troikaOrigMain${e}(); + ${i} +}`),r}function PG(r,e){return r==="uniforms"?void 0:typeof e=="function"?e.toString():e}let LG=0;const TE=new Map;function IG(r){const e=JSON.stringify(r,PG);let t=TE.get(e);return t==null&&TE.set(e,t=++LG),t}function DG(r,e,t){const{defaultFontURL:n}=t,i=Object.create(null),s=1/0,o=/[\u00AD\u034F\u061C\u115F-\u1160\u17B4-\u17B5\u180B-\u180E\u200B-\u200F\u202A-\u202E\u2060-\u206F\u3164\uFE00-\uFE0F\uFEFF\uFFA0\uFFF0-\uFFF8]/,a="[^\\S\\u00A0]",l=new RegExp(`${a}|[\\-\\u007C\\u00AD\\u2010\\u2012-\\u2014\\u2027\\u2056\\u2E17\\u2E40]`);function c(x,w){function E(){const b=M=>{console.error(`Failure loading font ${x}${x===n?"":"; trying fallback"}`,M),x!==n&&(x=n,E())};try{const M=new XMLHttpRequest;M.open("get",x,!0),M.responseType="arraybuffer",M.onload=function(){if(M.status>=400)b(new Error(M.statusText));else if(M.status>0)try{const A=r(M.response);w(A)}catch(A){b(A)}},M.onerror=b,M.send()}catch(M){b(M)}}E()}function u(x,w){x||(x=n);let E=i[x];E?E.pending?E.pending.push(w):w(E):(i[x]={pending:[w]},c(x,b=>{let M=i[x].pending;i[x]=b,M.forEach(A=>A(b))}))}function h({text:x="",font:w=n,sdfGlyphSize:E=64,fontSize:b=1,letterSpacing:M=0,lineHeight:A="normal",maxWidth:P=s,direction:C,textAlign:L="left",textIndent:F=0,whiteSpace:N="normal",overflowWrap:I="normal",anchorX:X=0,anchorY:q=0,includeCaretPositions:W=!1,chunkedBoundsSize:O=8192,colorRanges:k=null},G,B=!1){const D=_(),V={fontLoad:0,typesetting:0};x.indexOf("\r")>-1&&(console.info("Typesetter: got text with \\r chars; normalizing to \\n"),x=x.replace(/\r\n/g,` +`).replace(/\r/g,` +`)),b=+b,M=+M,P=+P,A=A||"normal",F=+F,u(w,Z=>{const ee=isFinite(P);let ie=null,ue=null,ce=null,le=null,Ae=null,Ee=null,ae=null,z=0,oe=0,te=N!=="nowrap";const{ascender:se,descender:$,unitsPerEm:Ie,lineGap:de,capHeight:Se,xHeight:Le}=Z;V.fontLoad=_()-D;const ge=_(),He=b/Ie;A==="normal"&&(A=(se-$+de)/Ie),A=A*b;const j=(A-(se-$)*He)/2,H=-(se*He+j),ne=Math.min(A,(se-$)*He),we=(se+$)/2*He-ne/2;let be=F,Me=new y;const Fe=[Me];Z.forEachGlyph(x,b,M,(Be,$e,Ve)=>{const Oe=x.charAt(Ve),We=Be.advanceWidth*He,nt=Me.count;let pt;if("isEmpty"in Be||(Be.isWhitespace=!!Oe&&new RegExp(a).test(Oe),Be.canBreakAfter=!!Oe&&l.test(Oe),Be.isEmpty=Be.xMin===Be.xMax||Be.yMin===Be.yMax||o.test(Oe)),!Be.isWhitespace&&!Be.isEmpty&&oe++,te&&ee&&!Be.isWhitespace&&$e+We+be>P&&nt){if(Me.glyphAt(nt-1).glyphObj.canBreakAfter)pt=new y,be=-$e;else for(let ze=nt;ze--;)if(ze===0&&I==="break-word"){pt=new y,be=-$e;break}else if(Me.glyphAt(ze).glyphObj.canBreakAfter){pt=Me.splitAt(ze+1);const ve=pt.glyphAt(0).x;be-=ve;for(let Ge=pt.count;Ge--;)pt.glyphAt(Ge).x-=ve;break}pt&&(Me.isSoftWrapped=!0,Me=pt,Fe.push(Me),z=P)}let re=Me.glyphAt(Me.count);re.glyphObj=Be,re.x=$e+be,re.width=We,re.charIndex=Ve,Oe===` +`&&(Me=new y,Fe.push(Me),be=-($e+We+M*b)+F)}),Fe.forEach(Be=>{for(let $e=Be.count;$e--;){let{glyphObj:Ve,x:Oe,width:We}=Be.glyphAt($e);if(!Ve.isWhitespace){Be.width=Oe+We,Be.width>z&&(z=Be.width);return}}});let Ue=0,xe=0;if(X&&(typeof X=="number"?Ue=-X:typeof X=="string"&&(Ue=-z*(X==="left"?0:X==="center"?.5:X==="right"?1:m(X)))),q){if(typeof q=="number")xe=-q;else if(typeof q=="string"){let Be=Fe.length*A;xe=q==="top"?0:q==="top-baseline"?-H:q==="top-cap"?-H-Se*He:q==="top-ex"?-H-Le*He:q==="middle"?Be/2:q==="bottom"?Be:q==="bottom-baseline"?Be-j+$*He:m(q)*Be}}if(!B){const Be=e.getEmbeddingLevels(x,C);ie=new Uint16Array(oe),ue=new Float32Array(oe*2),ce={},Ee=[s,s,-s,-s],ae=[];let $e=H;W&&(Ae=new Float32Array(x.length*3)),k&&(le=new Uint8Array(oe*3));let Ve=0,Oe=-1,We=-1,nt,pt;if(Fe.forEach((re,ze)=>{let{count:ve,width:Ge}=re;if(ve>0){let Ye=0;for(let Nt=ve;Nt--&&re.glyphAt(Nt).glyphObj.isWhitespace;)Ye++;let _t=0,It=0;if(L==="center")_t=(z-Ge)/2;else if(L==="right")_t=z-Ge;else if(L==="justify"&&re.isSoftWrapped){let Nt=0;for(let Rt=ve-Ye;Rt--;)re.glyphAt(Rt).glyphObj.isWhitespace&&Nt++;It=(z-Ge)/Nt}if(It||_t){let Nt=0;for(let Rt=0;Rt=Rt){let ti=sn,tn=sn;for(;tnli)break;tnOt=Nt;for(let Nt=0;Nt1&&v(Ae,Oe,tn),Oe=Bt}if(k){const{charIndex:Bt}=Rt;for(;Bt>We;)We++,k.hasOwnProperty(We)&&(pt=k[We])}if(!Ot.isWhitespace&&!Ot.isEmpty){const Bt=Ve++;ce[li]||(ce[li]={path:Ot.path,pathBounds:[Ot.xMin,Ot.yMin,Ot.xMax,Ot.yMax]});const sn=Rt.x+Ue,ti=$e+xe;ue[Bt*2]=sn,ue[Bt*2+1]=ti;const tn=sn+Ot.xMin*He,dn=ti+Ot.yMin*He,Gn=sn+Ot.xMax*He,sr=ti+Ot.yMax*He;tnEe[2]&&(Ee[2]=Gn),sr>Ee[3]&&(Ee[3]=sr),Bt%O===0&&(nt={start:Bt,end:Bt,rect:[s,s,-s,-s]},ae.push(nt)),nt.end++;const _i=nt.rect;if(tn<_i[0]&&(_i[0]=tn),dn<_i[1]&&(_i[1]=dn),Gn>_i[2]&&(_i[2]=Gn),sr>_i[3]&&(_i[3]=sr),ie[Bt]=li,k){const J=Bt*3;le[J]=pt>>16&255,le[J+1]=pt>>8&255,le[J+2]=pt&255}}}}$e-=A}),Ae){const re=x.length-Oe;re>1&&v(Ae,Oe,re)}}V.typesetting=_()-ge,G({glyphIds:ie,glyphPositions:ue,glyphData:ce,caretPositions:Ae,caretHeight:ne,glyphColors:le,chunkedBounds:ae,fontSize:b,unitsPerEm:Ie,ascender:se*He,descender:$*He,capHeight:Se*He,xHeight:Le*He,lineHeight:A,topBaseline:H,blockBounds:[Ue,xe-Fe.length*A,Ue+z,xe],visibleBounds:Ee,timings:V})})}function p(x,w){h(x,E=>{const[b,M,A,P]=E.blockBounds;w({width:A-b,height:P-M})},{})}function m(x){let w=x.match(/^([\d.]+)%$/),E=w?parseFloat(w[1]):NaN;return isNaN(E)?0:E/100}function v(x,w,E){const b=x[w*3],M=x[w*3+1],A=x[w*3+2],P=(M-b)/E;for(let C=0;C(Object.defineProperty(x,w,{get(){return this.data[this.index*g.length+E]},set(M){this.data[this.index*g.length+E]=M}}),x),{data:null,index:0}),{typeset:h,measure:p,loadFont:u}}const _a=()=>(self.performance||Date).now(),Fp=KA();let AE;function UG(r,e,t,n,i,s,o,a,l,c,u=!0){return u?NG(r,e,t,n,i,s,o,a,l,c).then(null,h=>(AE||(console.warn("WebGL SDF generation failed, falling back to JS",h),AE=!0),RE(r,e,t,n,i,s,o,a,l,c))):RE(r,e,t,n,i,s,o,a,l,c)}const Pd=[],OG=5;let Bv=0;function JA(){const r=_a();for(;Pd.length&&_a()-rnew Promise((e,t)=>{Pd.push(()=>{const n=_a();try{Fp.webgl.generateIntoCanvas(...r),e({timing:_a()-n})}catch(i){t(i)}}),Bv||(Bv=setTimeout(JA,0))}),FG=4,kG=2e3,CE={};let zG=0;function RE(r,e,t,n,i,s,o,a,l,c){const u="TroikaTextSDFGenerator_JS_"+zG++%FG;let h=CE[u];return h||(h=CE[u]={workerModule:yh({name:u,workerId:u,dependencies:[KA,_a],init(p,m){const v=p().javascript.generate;return function(..._){const y=m();return{textureData:v(..._),timing:m()-y}}},getTransferables(p){return[p.textureData.buffer]}}),requests:0,idleTimer:null}),h.requests++,clearTimeout(h.idleTimer),h.workerModule(r,e,t,n,i,s).then(({textureData:p,timing:m})=>{const v=_a(),_=new Uint8Array(p.length*4);for(let y=0;y{EG(u)},kG)),{timing:m}})}function BG(r){r._warm||(Fp.webgl.isSupported(r),r._warm=!0)}const GG=Fp.webglUtils.resizeWebGLCanvasWithoutClearing;/*! +Custom build of Typr.ts (https://github.com/fredli74/Typr.ts) for use in Troika text rendering. +Original MIT license applies: https://github.com/fredli74/Typr.ts/blob/master/LICENSE +*/function HG(){return typeof window>"u"&&(self.window=self),(function(r){var e={parse:function(i){var s=e._bin,o=new Uint8Array(i);if(s.readASCII(o,0,4)=="ttcf"){var a=4;s.readUshort(o,a),a+=2,s.readUshort(o,a),a+=2;var l=s.readUint(o,a);a+=4;for(var c=[],u=0;u>>o&1)!=0&&s++;return s},e._lctf.readClassDef=function(i,s){var o=e._bin,a=[],l=o.readUshort(i,s);if(s+=2,l==1){var c=o.readUshort(i,s);s+=2;var u=o.readUshort(i,s);s+=2;for(var h=0;h0&&(l.featureParams=a+c);var u=o.readUshort(i,s);s+=2,l.tab=[];for(var h=0;h255?-1:e.CFF.glyphByUnicode(i,e.CFF.tableSE[s])},e.CFF.readEncoding=function(i,s,o){e._bin;var a=[".notdef"],l=i[s];if(s++,l!=0)throw"error: unknown encoding format: "+l;var c=i[s];s++;for(var u=0;u>4,x=15&y;if(g!=15&&_.push(g),x!=15&&_.push(x),x==15)break}for(var w="",E=[0,1,2,3,4,5,6,7,8,9,".","e","e-","reserved","-","endOfNumber"],b=0;b<_.length;b++)w+=E[_[b]];v=parseFloat(w)}u<=21&&(m=["version","Notice","FullName","FamilyName","Weight","FontBBox","BlueValues","OtherBlues","FamilyBlues","FamilyOtherBlues","StdHW","StdVW","escape","UniqueID","XUID","charset","Encoding","CharStrings","Private","Subrs","defaultWidthX","nominalWidthX"][u],p=1,u==12&&(m=["Copyright","isFixedPitch","ItalicAngle","UnderlinePosition","UnderlineThickness","PaintType","CharstringType","FontMatrix","StrokeWidth","BlueScale","BlueShift","BlueFuzz","StemSnapH","StemSnapV","ForceBold",0,0,"LanguageGroup","ExpansionFactor","initialRandomSeed","SyntheticBase","PostScript","BaseFontName","BaseFontBlend",0,0,0,0,0,0,"ROS","CIDFontVersion","CIDFontRevision","CIDFontType","CIDCount","UIDBase","FDArray","FDSelect","FontName"][h],p=2)),m!=null?(l[m]=c.length==1?c[0]:c,c=[]):c.push(v),s+=p}return l},e.cmap={},e.cmap.parse=function(i,s,o){i=new Uint8Array(i.buffer,s,o),s=0;var a=e._bin,l={};a.readUshort(i,s),s+=2;var c=a.readUshort(i,s);s+=2;var u=[];l.tables=[];for(var h=0;h=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var u=0;u=1&&u.fmt<=2){p=l.readUshort(i,o),o+=2;var v=l.readUshort(i,o);o+=2,m=e._lctf.numOfOnes(p);var _=e._lctf.numOfOnes(v);if(u.fmt==1){u.pairsets=[];var y=l.readUshort(i,o);o+=2;for(var g=0;g=1&&u.fmt<=2){if(u.fmt==1)u.delta=l.readShort(i,o),o+=2;else if(u.fmt==2){var p=l.readUshort(i,o);o+=2,u.newg=l.readUshorts(i,o,p),o+=2*u.newg.length}}else if(s==4){u.vals=[],p=l.readUshort(i,o),o+=2;for(var m=0;m>>8;if((v&=15)!=0)throw"unknown kern table format: "+v;s=e.kern.readFormat0(i,s,h)}return h},e.kern.parseV1=function(i,s,o,a){var l=e._bin;l.readFixed(i,s),s+=4;var c=l.readUint(i,s);s+=4;for(var u={glyph1:[],rval:[]},h=0;h>>8;if((m&=15)!=0)throw"unknown kern table format: "+m;s=e.kern.readFormat0(i,s,u)}return u},e.kern.readFormat0=function(i,s,o){var a=e._bin,l=-1,c=a.readUshort(i,s);s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2,a.readUshort(i,s),s+=2;for(var u=0;u=l.map.length?0:l.map[s];if(l.format==4){for(var c=-1,u=0;us?0:65535&(l.idRangeOffset[c]!=0?l.glyphIdArray[s-l.startCount[c]+(l.idRangeOffset[c]>>1)-(l.idRangeOffset.length-c)]:s+l.idDelta[c])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(u=0;u-1?e.U._simpleGlyph(a,o):e.U._compoGlyph(a,s,o))},e.U._simpleGlyph=function(i,s){for(var o=0;ol)){for(var y=!0,g=0,x=0;x<_;x++){for(;i[s+g+(1+x)]==-1;)g++;v.chain[x]!=i[s+g+(1+x)]&&(y=!1)}if(y){for(i[s]=v.nglyph,x=0;x<_+g;x++)i[s+x+1]=-1;break}}}else if(o.ltype==5&&h.fmt==2)for(var w=e._lctf.getInterval(h.cDef,i[s]),E=h.cDef[w+2],b=h.scset[E],M=0;Ml)){for(y=!0,x=0;x>1,c.length=0,h=!0;else if(N=="o3"||N=="o23")c.length%2!=0&&!h&&(p=c.shift()+a.nominalWidthX),u+=c.length>>1,c.length=0,h=!0;else if(N=="o4")c.length>1&&!h&&(p=c.shift()+a.nominalWidthX,h=!0),m&&e.U.P.closePath(l),y+=c.pop(),e.U.P.moveTo(l,_,y),m=!0;else if(N=="o5")for(;c.length>0;)_+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,_,y);else if(N=="o6"||N=="o7")for(var I=c.length,X=N=="o6",q=0;qMath.abs(P-y)?_=A+c.shift():y=P+c.shift(),e.U.P.curveTo(l,g,x,w,E,C,L),e.U.P.curveTo(l,b,M,A,P,_,y));else if(N=="o14"){if(c.length>0&&!h&&(p=c.shift()+o.nominalWidthX,h=!0),c.length==4){var k=c.shift(),G=c.shift(),B=c.shift(),D=c.shift(),V=e.CFF.glyphBySE(o,B),Z=e.CFF.glyphBySE(o,D);e.U._drawCFF(o.CharStrings[V],s,o,a,l),s.x=k,s.y=G,e.U._drawCFF(o.CharStrings[Z],s,o,a,l)}m&&(e.U.P.closePath(l),m=!1)}else if(N=="o19"||N=="o20")c.length%2!=0&&!h&&(p=c.shift()+a.nominalWidthX),u+=c.length>>1,c.length=0,h=!0,v+=u+7>>3;else if(N=="o21")c.length>2&&!h&&(p=c.shift()+a.nominalWidthX,h=!0),y+=c.pop(),_+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,_,y),m=!0;else if(N=="o22")c.length>1&&!h&&(p=c.shift()+a.nominalWidthX,h=!0),_+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,_,y),m=!0;else if(N=="o25"){for(;c.length>6;)_+=c.shift(),y+=c.shift(),e.U.P.lineTo(l,_,y);g=_+c.shift(),x=y+c.shift(),w=g+c.shift(),E=x+c.shift(),_=w+c.shift(),y=E+c.shift(),e.U.P.curveTo(l,g,x,w,E,_,y)}else if(N=="o26")for(c.length%2&&(_+=c.shift());c.length>0;)g=_,x=y+c.shift(),_=w=g+c.shift(),y=(E=x+c.shift())+c.shift(),e.U.P.curveTo(l,g,x,w,E,_,y);else if(N=="o27")for(c.length%2&&(y+=c.shift());c.length>0;)x=y,w=(g=_+c.shift())+c.shift(),E=x+c.shift(),_=w+c.shift(),y=E,e.U.P.curveTo(l,g,x,w,E,_,y);else if(N=="o10"||N=="o29"){var ee=N=="o10"?a:o;if(c.length==0)console.debug("error: empty stack");else{var ie=c.pop(),ue=ee.Subrs[ie+ee.Bias];s.x=_,s.y=y,s.nStems=u,s.haveWidth=h,s.width=p,s.open=m,e.U._drawCFF(ue,s,o,a,l),_=s.x,y=s.y,u=s.nStems,h=s.haveWidth,p=s.width,m=s.open}}else if(N=="o30"||N=="o31"){var ce=c.length,le=(O=0,N=="o31");for(O+=ce-(I=-3&ce);O>>1|(21845&m)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,p[m]=((65280&v)>>>8|(255&v)<<8)>>>1}var _=function(N,I,X){for(var q=N.length,W=0,O=new t(I);W>>B]=D}return k},y=new e(288);for(m=0;m<144;++m)y[m]=8;for(m=144;m<256;++m)y[m]=9;for(m=256;m<280;++m)y[m]=7;for(m=280;m<288;++m)y[m]=8;var g=new e(32);for(m=0;m<32;++m)g[m]=5;var x=_(y,9),w=_(g,5),E=function(N){for(var I=N[0],X=1;XI&&(I=N[X]);return I},b=function(N,I,X){var q=I/8|0;return(N[q]|N[q+1]<<8)>>(7&I)&X},M=function(N,I){var X=I/8|0;return(N[X]|N[X+1]<<8|N[X+2]<<16)>>(7&I)},A=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],P=function(N,I,X){var q=new Error(I||A[N]);if(q.code=N,Error.captureStackTrace&&Error.captureStackTrace(q,P),!X)throw q;return q},C=function(N,I,X){var q=N.length;if(!q||X&&!X.l&&q<5)return I||new e(0);var W=!I||X,O=!X||X.i;X||(X={}),I||(I=new e(3*q));var k,G=function(Oe){var We=I.length;if(Oe>We){var nt=new e(Math.max(2*We,Oe));nt.set(I),I=nt}},B=X.f||0,D=X.p||0,V=X.b||0,Z=X.l,ee=X.d,ie=X.m,ue=X.n,ce=8*q;do{if(!Z){X.f=B=b(N,D,1);var le=b(N,D+1,3);if(D+=3,!le){var Ae=N[(Le=((k=D)/8|0)+(7&k&&1)+4)-4]|N[Le-3]<<8,Ee=Le+Ae;if(Ee>q){O&&P(0);break}W&&G(V+Ae),I.set(N.subarray(Le,Ee),V),X.b=V+=Ae,X.p=D=8*Ee;continue}if(le==1)Z=x,ee=w,ie=9,ue=5;else if(le==2){var ae=b(N,D,31)+257,z=b(N,D+10,15)+4,oe=ae+b(N,D+5,31)+1;D+=14;for(var te=new e(oe),se=new e(19),$=0;$>>4)<16)te[$++]=Le;else{var He=0,j=0;for(Le==16?(j=3+b(N,D,3),D+=2,He=te[$-1]):Le==17?(j=3+b(N,D,7),D+=3):Le==18&&(j=11+b(N,D,127),D+=7);j--;)te[$++]=He}}var H=te.subarray(0,ae),ne=te.subarray(ae);ie=E(H),ue=E(ne),Z=_(H,ie),ee=_(ne,ue)}else P(1);if(D>ce){O&&P(0);break}}W&&G(V+131072);for(var we=(1<>>4;if((D+=15&He)>ce){O&&P(0);break}if(He||P(2),Fe<256)I[V++]=Fe;else{if(Fe==256){Me=D,Z=null;break}var Ue=Fe-254;if(Fe>264){var xe=i[$=Fe-257];Ue=b(N,D,(1<>>4;if(Be||P(3),D+=15&Be,ne=h[$e],$e>3&&(xe=s[$e],ne+=M(N,D)&(1<ce){O&&P(0);break}W&&G(V+131072);for(var Ve=V+Ue;VOe.length)&&(nt=Oe.length);var pt=new(Oe instanceof t?t:Oe instanceof n?n:e)(nt-We);return pt.set(Oe.subarray(We,nt)),pt})(I,0,V)},L=new e(0),F=typeof TextDecoder<"u"&&new TextDecoder;try{F.decode(L,{stream:!0})}catch{}return r.convert_streams=function(N){var I=new DataView(N),X=0;function q(){var ae=I.getUint16(X);return X+=2,ae}function W(){var ae=I.getUint32(X);return X+=4,ae}function O(ae){Ae.setUint16(Ee,ae),Ee+=2}function k(ae){Ae.setUint32(Ee,ae),Ee+=4}for(var G={signature:W(),flavor:W(),length:W(),numTables:q(),reserved:q(),totalSfntSize:W(),majorVersion:q(),minorVersion:q(),metaOffset:W(),metaLength:W(),metaOrigLength:W(),privOffset:W(),privLength:W()},B=0;Math.pow(2,B)<=G.numTables;)B++;B--;for(var D=16*Math.pow(2,B),V=16*G.numTables-D,Z=12,ee=[],ie=0;ie{let[L,F]=C.split("+");L=parseInt(L,36),F=F?parseInt(F,36):0,u.set(P+=L,M[A]);for(let N=F;N--;)u.set(++P,M[A])})}}return u.get(b)||c}const p=1,m=2,v=3,_=4,y=[null,"isol","init","fina","medi"];function g(b){const M=new Uint8Array(b.length);let A=c,P=p,C=-1;for(let L=0;L65535&&L++)}return M}function x(b,M){const A=[];for(let C=0;C65535&&C++,A.push(r.U.codeToGlyph(b,L))}const P=b.GSUB;if(P){const{lookupList:C,featureList:L}=P;let F;const N=/^(rlig|liga|mset|isol|init|fina|medi|half|pres|blws)$/,I=[];L.forEach(X=>{if(N.test(X.tag))for(let q=0;q{if(D!==-1){let Z=M[D];if(!Z){const{cmds:ee,crds:ie}=r.U.glyphToPath(b,D);let ue="",ce=0;for(let z=0,oe=ee.length;z1?",":"")+ie[ce++]}let le,Ae,Ee,ae;if(ie.length){le=Ae=1/0,Ee=ae=-1/0;for(let z=0,oe=ie.length;zEe&&(Ee=te),se>ae&&(ae=se)}}else le=Ee=Ae=ae=0;Z=M[D]={index:D,advanceWidth:b.hmtx.aWidth[D],xMin:le,yMin:Ae,xMax:Ee,yMax:ae,path:ue,pathCommandCount:ee.length}}B!==-1&&(W+=r.U.getPairAdjustment(b,B,D)*O),q.call(null,Z,W,G),Z.advanceWidth&&(W+=Z.advanceWidth*O),X&&(W+=X*I),B=D}G+=N.codePointAt(G)>65535?2:1}),W}};return F}return function(M){const A=new Uint8Array(M,0,4),P=r._bin.readASCII(A,0,4);if(P==="wOFF")M=e(M);else if(P==="wOF2")throw new Error("woff2 fonts not supported");return E(r.parse(M)[0])}}const XG=yh({name:"Typr Font Parser",dependencies:[HG,VG,WG],init(r,e,t){const n=r(),i=e();return t(n,i)}}),kl={defaultFontURL:"https://fonts.gstatic.com/s/roboto/v18/KFOmCnqEu92Fr1Mu4mxM.woff",sdfGlyphSize:64,sdfMargin:1/16,sdfExponent:9,textureWidth:2048},jG=new Ke;function Tl(){return(self.performance||Date).now()}const PE=Object.create(null);function QA(r,e){r=ZG({},r);const t=Tl();if(r.font=KG(r.font||kl.defaultFontURL),r.text=""+r.text,r.sdfGlyphSize=r.sdfGlyphSize||kl.sdfGlyphSize,r.colorRanges!=null){let h={};for(let p in r.colorRanges)if(r.colorRanges.hasOwnProperty(p)){let m=r.colorRanges[p];typeof m!="number"&&(m=jG.set(m).getHex()),h[p]=m}r.colorRanges=h}Object.freeze(r);const{textureWidth:n,sdfExponent:i}=kl,{sdfGlyphSize:s}=r,o=n/s*4;let a=PE[s];if(!a){const h=document.createElement("canvas");h.width=n,h.height=s*256/o,a=PE[s]={glyphCount:0,sdfGlyphSize:s,sdfCanvas:h,sdfTexture:new Sn(h,void 0,void 0,void 0,fn,fn),contextLost:!1,glyphsByFont:new Map},a.sdfTexture.generateMipmaps=!1,YG(a)}const{sdfTexture:l,sdfCanvas:c}=a;let u=a.glyphsByFont.get(r.font);u||a.glyphsByFont.set(r.font,u=new Map),JG(r).then(h=>{const{glyphIds:p,glyphPositions:m,fontSize:v,unitsPerEm:_,timings:y}=h,g=[],x=new Float32Array(p.length*4),w=v/_;let E=0,b=0;const M=Tl();p.forEach((F,N)=>{let I=u.get(F);if(!I){const{path:O,pathBounds:k}=h.glyphData[F],G=Math.max(k[2]-k[0],k[3]-k[1])/s*(kl.sdfMargin*s+.5),B=a.glyphCount++,D=[k[0]-G,k[1]-G,k[2]+G,k[3]+G];u.set(F,I={path:O,atlasIndex:B,sdfViewBox:D}),g.push(I)}const{sdfViewBox:X}=I,q=m[b++],W=m[b++];x[E++]=q+X[0]*w,x[E++]=W+X[1]*w,x[E++]=q+X[2]*w,x[E++]=W+X[3]*w,p[N]=I.atlasIndex}),y.quads=(y.quads||0)+(Tl()-M);const A=Tl();y.sdf={};const P=c.height,C=Math.ceil(a.glyphCount/o),L=Math.pow(2,Math.ceil(Math.log2(C*s)));L>P&&(console.info(`Increasing SDF texture size ${P}->${L}`),GG(c,n,L),l.dispose()),Promise.all(g.map(F=>e2(F,a,r.gpuAccelerateSDF).then(({timing:N})=>{y.sdf[F.atlasIndex]=N}))).then(()=>{g.length&&!a.contextLost&&(t2(a),l.needsUpdate=!0),y.sdfTotal=Tl()-A,y.total=Tl()-t,e(Object.freeze({parameters:r,sdfTexture:l,sdfGlyphSize:s,sdfExponent:i,glyphBounds:x,glyphAtlasIndices:p,glyphColors:h.glyphColors,caretPositions:h.caretPositions,caretHeight:h.caretHeight,chunkedBounds:h.chunkedBounds,ascender:h.ascender,descender:h.descender,lineHeight:h.lineHeight,capHeight:h.capHeight,xHeight:h.xHeight,topBaseline:h.topBaseline,blockBounds:h.blockBounds,visibleBounds:h.visibleBounds,timings:h.timings}))})}),Promise.resolve().then(()=>{a.contextLost||BG(c)})}function e2({path:r,atlasIndex:e,sdfViewBox:t},{sdfGlyphSize:n,sdfCanvas:i,contextLost:s},o){if(s)return Promise.resolve({timing:-1});const{textureWidth:a,sdfExponent:l}=kl,c=Math.max(t[2]-t[0],t[3]-t[1]),u=Math.floor(e/4),h=u%(a/n)*n,p=Math.floor(u/(a/n))*n,m=e%4;return UG(n,n,r,t,c,l,i,h,p,m,o)}function YG(r){const e=r.sdfCanvas;e.addEventListener("webglcontextlost",t=>{console.log("Context Lost",t),t.preventDefault(),r.contextLost=!0}),e.addEventListener("webglcontextrestored",t=>{console.log("Context Restored",t),r.contextLost=!1;const n=[];r.glyphsByFont.forEach(i=>{i.forEach(s=>{n.push(e2(s,r,!0))})}),Promise.all(n).then(()=>{t2(r),r.sdfTexture.needsUpdate=!0})})}function qG({font:r,characters:e,sdfGlyphSize:t},n){let i=Array.isArray(e)?e.join(` +`):""+e;QA({font:r,sdfGlyphSize:t,text:i},n)}function ZG(r,e){for(let t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);return r}let ld;function KG(r){return ld||(ld=typeof document>"u"?{}:document.createElement("a")),ld.href=r,ld.href}function t2(r){if(typeof createImageBitmap!="function"){console.info("Safari<15: applying SDF canvas workaround");const{sdfCanvas:e,sdfTexture:t}=r,{width:n,height:i}=e,s=r.sdfCanvas.getContext("webgl");let o=t.image.data;(!o||o.length!==n*i*4)&&(o=new Uint8Array(n*i*4),t.image={width:n,height:i,data:o},t.flipY=!1,t.isDataTexture=!0),s.readPixels(0,0,n,i,s.RGBA,s.UNSIGNED_BYTE,o)}}const $G=yh({name:"Typesetter",dependencies:[kl,XG,DG,MG],init(r,e,t,n){const{defaultFontURL:i}=r;return t(e,n(),{defaultFontURL:i})}}),JG=yh({name:"Typesetter",dependencies:[$G],init(r){return function(e){return new Promise(t=>{r.typeset(e,t)})}},getTransferables(r){const e=[r.glyphPositions.buffer,r.glyphIds.buffer];return r.caretPositions&&e.push(r.caretPositions.buffer),r.glyphColors&&e.push(r.glyphColors.buffer),e}}),LE={};function QG(r){let e=LE[r];if(!e){const t=new To(1,1,r,r),n=t.clone(),i=t.attributes,s=n.attributes,o=new Tt,a=i.uv.count;for(let l=0;l{o.setAttribute(l,new st([...i[l].array,...s[l].array],i[l].itemSize))}),o.setIndex([...t.index.array,...n.index.array.map(l=>l+a)]),o.translate(.5,.5,0),e=LE[r]=o}return e}const e5="aTroikaGlyphBounds",IE="aTroikaGlyphIndex",t5="aTroikaGlyphColor";class n5 extends Cy{constructor(){super(),this.detail=1,this.curveRadius=0,this.groups=[{start:0,count:1/0,materialIndex:0},{start:0,count:1/0,materialIndex:1}],this.boundingSphere=new rr,this.boundingBox=new ir}computeBoundingSphere(){}computeBoundingBox(){}setSide(e){const t=this.getIndex().count;this.setDrawRange(e===yi?t/2:0,e===vn?t:t/2)}set detail(e){if(e!==this._detail){this._detail=e,(typeof e!="number"||e<1)&&(e=1);let t=QG(e);["position","normal","uv"].forEach(n=>{this.attributes[n]=t.attributes[n].clone()}),this.setIndex(t.getIndex().clone())}}get detail(){return this._detail}set curveRadius(e){e!==this._curveRadius&&(this._curveRadius=e,this._updateBounds())}get curveRadius(){return this._curveRadius}updateGlyphs(e,t,n,i,s){y0(this,e5,e,4),y0(this,IE,t,1),y0(this,t5,s,3),this._blockBounds=n,this._chunkedBounds=i,this.instanceCount=t.length,this._updateBounds()}_updateBounds(){const e=this._blockBounds;if(e){const{curveRadius:t,boundingBox:n}=this;if(t){const{PI:i,floor:s,min:o,max:a,sin:l,cos:c}=Math,u=i/2,h=i*2,p=Math.abs(t),m=e[0]/p,v=e[2]/p,_=s((m+u)/h)!==s((v+u)/h)?-p:o(l(m)*p,l(v)*p),y=s((m-u)/h)!==s((v-u)/h)?p:a(l(m)*p,l(v)*p),g=s((m+i)/h)!==s((v+i)/h)?p*2:a(p-c(m)*p,p-c(v)*p);n.min.set(_,e[1],t<0?-g:0),n.max.set(y,e[3],t<0?0:g)}else n.min.set(e[0],e[1],0),n.max.set(e[2],e[3],0);n.getBoundingSphere(this.boundingSphere)}}applyClipRect(e){let t=this.getAttribute(IE).count,n=this._chunkedBounds;if(n)for(let i=n.length;i--;){t=n[i].end;let s=n[i].rect;if(s[1]e.y&&s[0]e.x)break}this.instanceCount=t}}function y0(r,e,t,n){const i=r.getAttribute(e);t?i&&i.array.length===t.length?(i.array.set(t),i.needsUpdate=!0):(r.setAttribute(e,new Sa(t,n)),delete r._maxInstanceCount,r.dispose()):i&&r.deleteAttribute(e)}const i5=` +uniform vec2 uTroikaSDFTextureSize; +uniform float uTroikaSDFGlyphSize; +uniform vec4 uTroikaTotalBounds; +uniform vec4 uTroikaClipRect; +uniform mat3 uTroikaOrient; +uniform bool uTroikaUseGlyphColors; +uniform float uTroikaDistanceOffset; +uniform float uTroikaBlurRadius; +uniform vec2 uTroikaPositionOffset; +uniform float uTroikaCurveRadius; +attribute vec4 aTroikaGlyphBounds; +attribute float aTroikaGlyphIndex; +attribute vec3 aTroikaGlyphColor; +varying vec2 vTroikaGlyphUV; +varying vec4 vTroikaTextureUVBounds; +varying float vTroikaTextureChannel; +varying vec3 vTroikaGlyphColor; +varying vec2 vTroikaGlyphDimensions; +`,r5=` +vec4 bounds = aTroikaGlyphBounds; +bounds.xz += uTroikaPositionOffset.x; +bounds.yw -= uTroikaPositionOffset.y; + +vec4 outlineBounds = vec4( + bounds.xy - uTroikaDistanceOffset - uTroikaBlurRadius, + bounds.zw + uTroikaDistanceOffset + uTroikaBlurRadius +); +vec4 clippedBounds = vec4( + clamp(outlineBounds.xy, uTroikaClipRect.xy, uTroikaClipRect.zw), + clamp(outlineBounds.zw, uTroikaClipRect.xy, uTroikaClipRect.zw) +); + +vec2 clippedXY = (mix(clippedBounds.xy, clippedBounds.zw, position.xy) - bounds.xy) / (bounds.zw - bounds.xy); + +position.xy = mix(bounds.xy, bounds.zw, clippedXY); + +uv = (position.xy - uTroikaTotalBounds.xy) / (uTroikaTotalBounds.zw - uTroikaTotalBounds.xy); + +float rad = uTroikaCurveRadius; +if (rad != 0.0) { + float angle = position.x / rad; + position.xz = vec2(sin(angle) * rad, rad - cos(angle) * rad); + normal.xz = vec2(sin(angle), cos(angle)); +} + +position = uTroikaOrient * position; +normal = uTroikaOrient * normal; + +vTroikaGlyphUV = clippedXY.xy; +vTroikaGlyphDimensions = vec2(bounds[2] - bounds[0], bounds[3] - bounds[1]); + + +float txCols = uTroikaSDFTextureSize.x / uTroikaSDFGlyphSize; +vec2 txUvPerSquare = uTroikaSDFGlyphSize / uTroikaSDFTextureSize; +vec2 txStartUV = txUvPerSquare * vec2( + mod(floor(aTroikaGlyphIndex / 4.0), txCols), + floor(floor(aTroikaGlyphIndex / 4.0) / txCols) +); +vTroikaTextureUVBounds = vec4(txStartUV, vec2(txStartUV) + txUvPerSquare); +vTroikaTextureChannel = mod(aTroikaGlyphIndex, 4.0); +`,s5=` +uniform sampler2D uTroikaSDFTexture; +uniform vec2 uTroikaSDFTextureSize; +uniform float uTroikaSDFGlyphSize; +uniform float uTroikaSDFExponent; +uniform float uTroikaDistanceOffset; +uniform float uTroikaFillOpacity; +uniform float uTroikaOutlineOpacity; +uniform float uTroikaBlurRadius; +uniform vec3 uTroikaStrokeColor; +uniform float uTroikaStrokeWidth; +uniform float uTroikaStrokeOpacity; +uniform bool uTroikaSDFDebug; +varying vec2 vTroikaGlyphUV; +varying vec4 vTroikaTextureUVBounds; +varying float vTroikaTextureChannel; +varying vec2 vTroikaGlyphDimensions; + +float troikaSdfValueToSignedDistance(float alpha) { + // Inverse of exponential encoding in webgl-sdf-generator + + float maxDimension = max(vTroikaGlyphDimensions.x, vTroikaGlyphDimensions.y); + float absDist = (1.0 - pow(2.0 * (alpha > 0.5 ? 1.0 - alpha : alpha), 1.0 / uTroikaSDFExponent)) * maxDimension; + float signedDist = absDist * (alpha > 0.5 ? -1.0 : 1.0); + return signedDist; +} + +float troikaGlyphUvToSdfValue(vec2 glyphUV) { + vec2 textureUV = mix(vTroikaTextureUVBounds.xy, vTroikaTextureUVBounds.zw, glyphUV); + vec4 rgba = texture2D(uTroikaSDFTexture, textureUV); + float ch = floor(vTroikaTextureChannel + 0.5); //NOTE: can't use round() in WebGL1 + return ch == 0.0 ? rgba.r : ch == 1.0 ? rgba.g : ch == 2.0 ? rgba.b : rgba.a; +} + +float troikaGlyphUvToDistance(vec2 uv) { + return troikaSdfValueToSignedDistance(troikaGlyphUvToSdfValue(uv)); +} + +float troikaGetAADist() { + + #if defined(GL_OES_standard_derivatives) || __VERSION__ >= 300 + return length(fwidth(vTroikaGlyphUV * vTroikaGlyphDimensions)) * 0.5; + #else + return vTroikaGlyphDimensions.x / 64.0; + #endif +} + +float troikaGetFragDistValue() { + vec2 clampedGlyphUV = clamp(vTroikaGlyphUV, 0.5 / uTroikaSDFGlyphSize, 1.0 - 0.5 / uTroikaSDFGlyphSize); + float distance = troikaGlyphUvToDistance(clampedGlyphUV); + + // Extrapolate distance when outside bounds: + distance += clampedGlyphUV == vTroikaGlyphUV ? 0.0 : + length((vTroikaGlyphUV - clampedGlyphUV) * vTroikaGlyphDimensions); + + + + return distance; +} + +float troikaGetEdgeAlpha(float distance, float distanceOffset, float aaDist) { + #if defined(IS_DEPTH_MATERIAL) || defined(IS_DISTANCE_MATERIAL) + float alpha = step(-distanceOffset, -distance); + #else + + float alpha = smoothstep( + distanceOffset + aaDist, + distanceOffset - aaDist, + distance + ); + #endif + + return alpha; +} +`,o5=` +float aaDist = troikaGetAADist(); +float fragDistance = troikaGetFragDistValue(); +float edgeAlpha = uTroikaSDFDebug ? + troikaGlyphUvToSdfValue(vTroikaGlyphUV) : + troikaGetEdgeAlpha(fragDistance, uTroikaDistanceOffset, max(aaDist, uTroikaBlurRadius)); + +#if !defined(IS_DEPTH_MATERIAL) && !defined(IS_DISTANCE_MATERIAL) +vec4 fillRGBA = gl_FragColor; +fillRGBA.a *= uTroikaFillOpacity; +vec4 strokeRGBA = uTroikaStrokeWidth == 0.0 ? fillRGBA : vec4(uTroikaStrokeColor, uTroikaStrokeOpacity); +if (fillRGBA.a == 0.0) fillRGBA.rgb = strokeRGBA.rgb; +gl_FragColor = mix(fillRGBA, strokeRGBA, smoothstep( + -uTroikaStrokeWidth - aaDist, + -uTroikaStrokeWidth + aaDist, + fragDistance +)); +gl_FragColor.a *= edgeAlpha; +#endif + +if (edgeAlpha == 0.0) { + discard; +} +`;function a5(r){const e=zv(r,{chained:!0,extensions:{derivatives:!0},uniforms:{uTroikaSDFTexture:{value:null},uTroikaSDFTextureSize:{value:new De},uTroikaSDFGlyphSize:{value:0},uTroikaSDFExponent:{value:0},uTroikaTotalBounds:{value:new Xt(0,0,0,0)},uTroikaClipRect:{value:new Xt(0,0,0,0)},uTroikaDistanceOffset:{value:0},uTroikaOutlineOpacity:{value:0},uTroikaFillOpacity:{value:1},uTroikaPositionOffset:{value:new De},uTroikaCurveRadius:{value:0},uTroikaBlurRadius:{value:0},uTroikaStrokeWidth:{value:0},uTroikaStrokeColor:{value:new Ke},uTroikaStrokeOpacity:{value:1},uTroikaOrient:{value:new Ct},uTroikaUseGlyphColors:{value:!0},uTroikaSDFDebug:{value:!1}},vertexDefs:i5,vertexTransform:r5,fragmentDefs:s5,fragmentColorTransform:o5,customRewriter({vertexShader:t,fragmentShader:n}){let i=/\buniform\s+vec3\s+diffuse\b/;return i.test(n)&&(n=n.replace(i,"varying vec3 vTroikaGlyphColor").replace(/\bdiffuse\b/g,"vTroikaGlyphColor"),i.test(t)||(t=t.replace($A,`uniform vec3 diffuse; +$& +vTroikaGlyphColor = uTroikaUseGlyphColors ? aTroikaGlyphColor / 255.0 : diffuse; +`))),{vertexShader:t,fragmentShader:n}}});return e.transparent=!0,Object.defineProperties(e,{isTroikaTextMaterial:{value:!0},shadowSide:{get(){return this.side},set(){}}}),e}const p_=new Vs({color:16777215,side:vn,transparent:!0}),DE=8421504,UE=new yt,cd=new Y,_0=new Y,ru=[],l5=new Y,x0="+x+y";function OE(r){return Array.isArray(r)?r[0]:r}let n2=()=>{const r=new _n(new To(1,1),p_);return n2=()=>r,r},i2=()=>{const r=new _n(new To(1,1,32,1),p_);return i2=()=>r,r};const c5={type:"syncstart"},u5={type:"synccomplete"},r2=["font","fontSize","letterSpacing","lineHeight","maxWidth","overflowWrap","text","direction","textAlign","textIndent","whiteSpace","anchorX","anchorY","colorRanges","sdfGlyphSize"],h5=r2.concat("material","color","depthOffset","clipRect","curveRadius","orientation","glyphGeometryDetail");let s2=class extends _n{constructor(){const e=new n5;super(e,null),this.text="",this.anchorX=0,this.anchorY=0,this.curveRadius=0,this.direction="auto",this.font=null,this.fontSize=.1,this.letterSpacing=0,this.lineHeight="normal",this.maxWidth=1/0,this.overflowWrap="normal",this.textAlign="left",this.textIndent=0,this.whiteSpace="normal",this.material=null,this.color=null,this.colorRanges=null,this.outlineWidth=0,this.outlineColor=0,this.outlineOpacity=1,this.outlineBlur=0,this.outlineOffsetX=0,this.outlineOffsetY=0,this.strokeWidth=0,this.strokeColor=DE,this.strokeOpacity=1,this.fillOpacity=1,this.depthOffset=0,this.clipRect=null,this.orientation=x0,this.glyphGeometryDetail=1,this.sdfGlyphSize=null,this.gpuAccelerateSDF=!0,this.debugSDF=!1}sync(e){this._needsSync&&(this._needsSync=!1,this._isSyncing?(this._queuedSyncs||(this._queuedSyncs=[])).push(e):(this._isSyncing=!0,this.dispatchEvent(c5),QA({text:this.text,font:this.font,fontSize:this.fontSize||.1,letterSpacing:this.letterSpacing||0,lineHeight:this.lineHeight||"normal",maxWidth:this.maxWidth,direction:this.direction||"auto",textAlign:this.textAlign,textIndent:this.textIndent,whiteSpace:this.whiteSpace,overflowWrap:this.overflowWrap,anchorX:this.anchorX,anchorY:this.anchorY,colorRanges:this.colorRanges,includeCaretPositions:!0,sdfGlyphSize:this.sdfGlyphSize,gpuAccelerateSDF:this.gpuAccelerateSDF},t=>{this._isSyncing=!1,this._textRenderInfo=t,this.geometry.updateGlyphs(t.glyphBounds,t.glyphAtlasIndices,t.blockBounds,t.chunkedBounds,t.glyphColors);const n=this._queuedSyncs;n&&(this._queuedSyncs=null,this._needsSync=!0,this.sync(()=>{n.forEach(i=>i&&i())})),this.dispatchEvent(u5),e&&e()})))}onBeforeRender(e,t,n,i,s,o){this.sync(),s.isTroikaTextMaterial&&this._prepareForRender(s),s._hadOwnSide=s.hasOwnProperty("side"),this.geometry.setSide(s._actualSide=s.side),s.side=ls}onAfterRender(e,t,n,i,s,o){s._hadOwnSide?s.side=s._actualSide:delete s.side}dispose(){this.geometry.dispose()}get textRenderInfo(){return this._textRenderInfo||null}get material(){let e=this._derivedMaterial;const t=this._baseMaterial||this._defaultMaterial||(this._defaultMaterial=p_.clone());if((!e||e.baseMaterial!==t)&&(e=this._derivedMaterial=a5(t),t.addEventListener("dispose",function n(){t.removeEventListener("dispose",n),e.dispose()})),this.outlineWidth||this.outlineBlur||this.outlineOffsetX||this.outlineOffsetY){let n=e._outlineMtl;return n||(n=e._outlineMtl=Object.create(e,{id:{value:e.id+.1}}),n.isTextOutlineMaterial=!0,n.depthWrite=!1,n.map=null,e.addEventListener("dispose",function i(){e.removeEventListener("dispose",i),n.dispose()})),[n,e]}else return e}set material(e){e&&e.isTroikaTextMaterial?(this._derivedMaterial=e,this._baseMaterial=e.baseMaterial):this._baseMaterial=e}get glyphGeometryDetail(){return this.geometry.detail}set glyphGeometryDetail(e){this.geometry.detail=e}get curveRadius(){return this.geometry.curveRadius}set curveRadius(e){this.geometry.curveRadius=e}get customDepthMaterial(){return OE(this.material).getDepthMaterial()}get customDistanceMaterial(){return OE(this.material).getDistanceMaterial()}_prepareForRender(e){const t=e.isTextOutlineMaterial,n=e.uniforms,i=this.textRenderInfo;if(i){const{sdfTexture:a,blockBounds:l}=i;n.uTroikaSDFTexture.value=a,n.uTroikaSDFTextureSize.value.set(a.image.width,a.image.height),n.uTroikaSDFGlyphSize.value=i.sdfGlyphSize,n.uTroikaSDFExponent.value=i.sdfExponent,n.uTroikaTotalBounds.value.fromArray(l),n.uTroikaUseGlyphColors.value=!t&&!!i.glyphColors;let c=0,u=0,h=0,p,m,v,_=0,y=0;if(t){let{outlineWidth:x,outlineOffsetX:w,outlineOffsetY:E,outlineBlur:b,outlineOpacity:M}=this;c=this._parsePercent(x)||0,u=Math.max(0,this._parsePercent(b)||0),p=M,_=this._parsePercent(w)||0,y=this._parsePercent(E)||0}else h=Math.max(0,this._parsePercent(this.strokeWidth)||0),h&&(v=this.strokeColor,n.uTroikaStrokeColor.value.set(v??DE),m=this.strokeOpacity,m==null&&(m=1)),p=this.fillOpacity;n.uTroikaDistanceOffset.value=c,n.uTroikaPositionOffset.value.set(_,y),n.uTroikaBlurRadius.value=u,n.uTroikaStrokeWidth.value=h,n.uTroikaStrokeOpacity.value=m,n.uTroikaFillOpacity.value=p??1,n.uTroikaCurveRadius.value=this.curveRadius||0;let g=this.clipRect;if(g&&Array.isArray(g)&&g.length===4)n.uTroikaClipRect.value.fromArray(g);else{const x=(this.fontSize||.1)*100;n.uTroikaClipRect.value.set(l[0]-x,l[1]-x,l[2]+x,l[3]+x)}this.geometry.applyClipRect(n.uTroikaClipRect.value)}n.uTroikaSDFDebug.value=!!this.debugSDF,e.polygonOffset=!!this.depthOffset,e.polygonOffsetFactor=e.polygonOffsetUnits=this.depthOffset||0;const s=t?this.outlineColor||0:this.color;if(s==null)delete e.color;else{const a=e.hasOwnProperty("color")?e.color:e.color=new Ke;(s!==a._input||typeof s=="object")&&a.set(a._input=s)}let o=this.orientation||x0;if(o!==e._orientation){let a=n.uTroikaOrient.value;o=o.replace(/[^-+xyz]/g,"");let l=o!==x0&&o.match(/^([-+])([xyz])([-+])([xyz])$/);if(l){let[,c,u,h,p]=l;cd.set(0,0,0)[u]=c==="-"?1:-1,_0.set(0,0,0)[p]=h==="-"?-1:1,UE.lookAt(l5,cd.cross(_0),_0),a.setFromMatrix4(UE)}else a.identity();e._orientation=o}}_parsePercent(e){if(typeof e=="string"){let t=e.match(/^(-?[\d.]+)%$/),n=t?parseFloat(t[1]):NaN;e=(isNaN(n)?0:n/100)*this.fontSize}return e}localPositionToTextCoords(e,t=new De){t.copy(e);const n=this.curveRadius;return n&&(t.x=Math.atan2(e.x,Math.abs(n)-Math.abs(e.z))*Math.abs(n)),t}worldPositionToTextCoords(e,t=new De){return cd.copy(e),this.localPositionToTextCoords(this.worldToLocal(cd),t)}raycast(e,t){const{textRenderInfo:n,curveRadius:i}=this;if(n){const s=n.blockBounds,o=i?i2():n2(),a=o.geometry,{position:l,uv:c}=a.attributes;for(let u=0;u{this[n]=e[n]}),this}clone(){return new this.constructor().copy(this)}};r2.forEach(r=>{const e="_private_"+r;Object.defineProperty(s2.prototype,r,{get(){return this[e]},set(t){t!==this[e]&&(this[e]=t,this._needsSync=!0)}})});const f5=K.forwardRef(({sdfGlyphSize:r=64,anchorX:e="center",anchorY:t="middle",font:n,fontSize:i=1,children:s,characters:o,onSync:a,...l},c)=>{const u=Bn(({invalidate:v})=>v),[h]=K.useState(()=>new s2),[p,m]=K.useMemo(()=>{const v=[];let _="";return K.Children.forEach(s,y=>{typeof y=="string"||typeof y=="number"?_+=y:v.push(y)}),[v,_]},[s]);return eO(()=>new Promise(v=>qG({font:n,characters:o},v)),["troika-text",n,o]),K.useLayoutEffect(()=>void h.sync(()=>{u(),a&&a(h)})),K.useEffect(()=>()=>h.dispose(),[h]),K.createElement("primitive",Ta({object:h,ref:c,font:n,text:m,anchorX:e,anchorY:t,fontSize:i,sdfGlyphSize:r},l),p)});/*! + * camera-controls + * https://github.com/yomotsu/camera-controls + * (c) 2017 @yomotsu + * Released under the MIT License. + */const gn={LEFT:1,RIGHT:2,MIDDLE:4},_e=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,SCREEN_PAN:4,OFFSET:8,DOLLY:16,ZOOM:32,TOUCH_ROTATE:64,TOUCH_TRUCK:128,TOUCH_SCREEN_PAN:256,TOUCH_OFFSET:512,TOUCH_DOLLY:1024,TOUCH_ZOOM:2048,TOUCH_DOLLY_TRUCK:4096,TOUCH_DOLLY_SCREEN_PAN:8192,TOUCH_DOLLY_OFFSET:16384,TOUCH_DOLLY_ROTATE:32768,TOUCH_ZOOM_TRUCK:65536,TOUCH_ZOOM_OFFSET:131072,TOUCH_ZOOM_SCREEN_PAN:262144,TOUCH_ZOOM_ROTATE:524288}),Al={NONE:0,IN:1,OUT:-1};function ia(r){return r.isPerspectiveCamera}function ho(r){return r.isOrthographicCamera}const Cl=Math.PI*2,NE=Math.PI/2,o2=1e-5,su=Math.PI/180;function Ur(r,e,t){return Math.max(e,Math.min(t,r))}function an(r,e=o2){return Math.abs(r)0==m>u&&(m=u,t.value=(m-u)/s),m}function kE(r,e,t,n,i=1/0,s,o){n=Math.max(1e-4,n);const a=2/n,l=a*s,c=1/(1+l+.48*l*l+.235*l*l*l);let u=e.x,h=e.y,p=e.z,m=r.x-u,v=r.y-h,_=r.z-p;const y=u,g=h,x=p,w=i*n,E=w*w,b=m*m+v*v+_*_;if(b>E){const q=Math.sqrt(b);m=m/q*w,v=v/q*w,_=_/q*w}u=r.x-m,h=r.y-v,p=r.z-_;const M=(t.x+a*m)*s,A=(t.y+a*v)*s,P=(t.z+a*_)*s;t.x=(t.x-a*M)*c,t.y=(t.y-a*A)*c,t.z=(t.z-a*P)*c,o.x=u+(m+M)*c,o.y=h+(v+A)*c,o.z=p+(_+P)*c;const C=y-r.x,L=g-r.y,F=x-r.z,N=o.x-y,I=o.y-g,X=o.z-x;return C*N+L*I+F*X>0&&(o.x=y,o.y=g,o.z=x,t.x=(o.x-y)/s,t.y=(o.y-g)/s,t.z=(o.z-x)/s),o}function w0(r,e){e.set(0,0),r.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=r.length,e.y/=r.length}function S0(r,e){return ho(r)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}let d5=class{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,o=i.length;s{},this._enabled=!0,this._state=_e.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Al.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new vt.Vector3,this._focalOffsetVelocity=new vt.Vector3,this._zoomVelocity={value:0},this._truckInternal=(g,x,w,E)=>{let b,M;if(ia(this._camera)){const A=At.copy(this._camera.position).sub(this._target),P=this._camera.getEffectiveFOV()*su,C=A.length()*Math.tan(P*.5);b=this.truckSpeed*g*C/this._elementRect.height,M=this.truckSpeed*x*C/this._elementRect.height}else if(ho(this._camera)){const A=this._camera;b=this.truckSpeed*g*(A.right-A.left)/A.zoom/this._elementRect.width,M=this.truckSpeed*x*(A.top-A.bottom)/A.zoom/this._elementRect.height}else return;E?(w?this.setFocalOffset(this._focalOffsetEnd.x+b,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(b,0,!0),this.forward(-M,!0)):w?this.setFocalOffset(this._focalOffsetEnd.x+b,this._focalOffsetEnd.y+M,this._focalOffsetEnd.z,!0):this.truck(b,M,!0)},this._rotateInternal=(g,x)=>{const w=Cl*this.azimuthRotateSpeed*g/this._elementRect.height,E=Cl*this.polarRotateSpeed*x/this._elementRect.height;this.rotate(w,E,!0)},this._dollyInternal=(g,x,w)=>{const E=Math.pow(.95,-g*this.dollySpeed),b=this._sphericalEnd.radius,M=this._sphericalEnd.radius*E,A=Ur(M,this.minDistance,this.maxDistance),P=A-M;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(M,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(P,!0),this._dollyToNoClamp(A,!0)):this._dollyToNoClamp(A,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?M:A)-b,this._dollyControlCoord.set(x,w)),this._lastDollyDirection=Math.sign(-g)},this._zoomInternal=(g,x,w)=>{const E=Math.pow(.95,g*this.dollySpeed),b=this._zoom,M=this._zoom*E;this.zoomTo(M,!0),this.dollyToCursor&&(this._changedZoom+=M-b,this._dollyControlCoord.set(x,w))},typeof vt>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new vt.Quaternion().setFromUnitVectors(this._camera.up,fd),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=_e.NONE,this._target=new vt.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new vt.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new vt.Spherical().setFromVector3(At.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new vt.Vector3,new vt.Vector3,new vt.Vector3,new vt.Vector3],this._updateNearPlaneCorners(),this._boundary=new vt.Box3(new vt.Vector3(-1/0,-1/0,-1/0),new vt.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new vt.Vector2,this.mouseButtons={left:_e.ROTATE,middle:_e.DOLLY,right:_e.TRUCK,wheel:ia(this._camera)?_e.DOLLY:ho(this._camera)?_e.ZOOM:_e.NONE},this.touches={one:_e.TOUCH_ROTATE,two:ia(this._camera)?_e.TOUCH_DOLLY_TRUCK:ho(this._camera)?_e.TOUCH_ZOOM_TRUCK:_e.NONE,three:_e.TOUCH_TRUCK};const n=new vt.Vector2,i=new vt.Vector2,s=new vt.Vector2,o=g=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const E=this._domElement.getBoundingClientRect(),b=g.clientX/E.width,M=g.clientY/E.height;if(bthis._interactiveArea.right||Mthis._interactiveArea.bottom)return}const x=g.pointerType!=="mouse"?null:(g.buttons&gn.LEFT)===gn.LEFT?gn.LEFT:(g.buttons&gn.MIDDLE)===gn.MIDDLE?gn.MIDDLE:(g.buttons&gn.RIGHT)===gn.RIGHT?gn.RIGHT:null;if(x!==null){const E=this._findPointerByMouseButton(x);E&&this._disposePointer(E)}if((g.buttons&gn.LEFT)===gn.LEFT&&this._lockedPointer)return;const w={pointerId:g.pointerId,clientX:g.clientX,clientY:g.clientY,deltaX:0,deltaY:0,mouseButton:x};this._activePointers.push(w),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),this._isDragging=!0,p(g)},a=g=>{g.cancelable&&g.preventDefault();const x=g.pointerId,w=this._lockedPointer||this._findPointerById(x);if(w){if(w.clientX=g.clientX,w.clientY=g.clientY,w.deltaX=g.movementX,w.deltaY=g.movementY,this._state=0,g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(g.buttons&gn.LEFT)===gn.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(g.buttons&gn.MIDDLE)===gn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(g.buttons&gn.RIGHT)===gn.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=g=>{const x=this._findPointerById(g.pointerId);if(!(x&&x===this._lockedPointer)){if(x&&this._disposePointer(x),g.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=_e.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=_e.NONE;v()}};let c=-1;const u=g=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===_e.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const M=this._domElement.getBoundingClientRect(),A=g.clientX/M.width,P=g.clientY/M.height;if(Athis._interactiveArea.right||Pthis._interactiveArea.bottom)return}if(g.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===_e.ROTATE||this.mouseButtons.wheel===_e.TRUCK){const M=performance.now();c-M<1e3&&this._getClientRect(this._elementRect),c=M}const x=m5?-1:-3,w=g.deltaMode===1||g.ctrlKey?g.deltaY/x:g.deltaY/(x*10),E=this.dollyToCursor?(g.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,b=this.dollyToCursor?(g.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case _e.ROTATE:{this._rotateInternal(g.deltaX,g.deltaY),this._isUserControllingRotate=!0;break}case _e.TRUCK:{this._truckInternal(g.deltaX,g.deltaY,!1,!1),this._isUserControllingTruck=!0;break}case _e.SCREEN_PAN:{this._truckInternal(g.deltaX,g.deltaY,!1,!0),this._isUserControllingTruck=!0;break}case _e.OFFSET:{this._truckInternal(g.deltaX,g.deltaY,!0,!1),this._isUserControllingOffset=!0;break}case _e.DOLLY:{this._dollyInternal(-w,E,b),this._isUserControllingDolly=!0;break}case _e.ZOOM:{this._zoomInternal(-w,E,b),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},h=g=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===Gv.ACTION.NONE){const x=g instanceof PointerEvent?g.pointerId:0,w=this._findPointerById(x);w&&this._disposePointer(w),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l);return}g.preventDefault()}},p=g=>{if(!this._enabled)return;if(w0(this._activePointers,Fi),this._getClientRect(this._elementRect),n.copy(Fi),i.copy(Fi),this._activePointers.length>=2){const w=Fi.x-this._activePointers[1].clientX,E=Fi.y-this._activePointers[1].clientY,b=Math.sqrt(w*w+E*E);s.set(0,b);const M=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,A=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(M,A)}if(this._state=0,!g)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in g&&g.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(g.buttons&gn.LEFT)===gn.LEFT&&(this._state=this._state|this.mouseButtons.left),(g.buttons&gn.MIDDLE)===gn.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(g.buttons&gn.RIGHT)===gn.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&_e.ZOOM)===_e.ZOOM||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,w0(this._activePointers,Fi);const x=this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,w=x?-x.deltaX:i.x-Fi.x,E=x?-x.deltaY:i.y-Fi.y;if(i.copy(Fi),((this._state&_e.ROTATE)===_e.ROTATE||(this._state&_e.TOUCH_ROTATE)===_e.TOUCH_ROTATE||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(w,E),this._isUserControllingRotate=!0),(this._state&_e.DOLLY)===_e.DOLLY||(this._state&_e.ZOOM)===_e.ZOOM){const b=this.dollyToCursor?(n.x-this._elementRect.x)/this._elementRect.width*2-1:0,M=this.dollyToCursor?(n.y-this._elementRect.y)/this._elementRect.height*-2+1:0,A=this.dollyDragInverted?-1:1;(this._state&_e.DOLLY)===_e.DOLLY?(this._dollyInternal(A*E*hd,b,M),this._isUserControllingDolly=!0):(this._zoomInternal(A*E*hd,b,M),this._isUserControllingZoom=!0)}if((this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_ZOOM)===_e.TOUCH_ZOOM||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_ZOOM_ROTATE)===_e.TOUCH_ZOOM_ROTATE){const b=Fi.x-this._activePointers[1].clientX,M=Fi.y-this._activePointers[1].clientY,A=Math.sqrt(b*b+M*M),P=s.y-A;s.set(0,A);const C=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&_e.TOUCH_DOLLY)===_e.TOUCH_DOLLY||(this._state&_e.TOUCH_DOLLY_ROTATE)===_e.TOUCH_DOLLY_ROTATE||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET?(this._dollyInternal(P*hd,C,L),this._isUserControllingDolly=!0):(this._zoomInternal(P*hd,C,L),this._isUserControllingZoom=!0)}((this._state&_e.TRUCK)===_e.TRUCK||(this._state&_e.TOUCH_TRUCK)===_e.TOUCH_TRUCK||(this._state&_e.TOUCH_DOLLY_TRUCK)===_e.TOUCH_DOLLY_TRUCK||(this._state&_e.TOUCH_ZOOM_TRUCK)===_e.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(w,E,!1,!1),this._isUserControllingTruck=!0),((this._state&_e.SCREEN_PAN)===_e.SCREEN_PAN||(this._state&_e.TOUCH_SCREEN_PAN)===_e.TOUCH_SCREEN_PAN||(this._state&_e.TOUCH_DOLLY_SCREEN_PAN)===_e.TOUCH_DOLLY_SCREEN_PAN||(this._state&_e.TOUCH_ZOOM_SCREEN_PAN)===_e.TOUCH_ZOOM_SCREEN_PAN)&&(this._truckInternal(w,E,!1,!0),this._isUserControllingTruck=!0),((this._state&_e.OFFSET)===_e.OFFSET||(this._state&_e.TOUCH_OFFSET)===_e.TOUCH_OFFSET||(this._state&_e.TOUCH_DOLLY_OFFSET)===_e.TOUCH_DOLLY_OFFSET||(this._state&_e.TOUCH_ZOOM_OFFSET)===_e.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(w,E,!0,!1),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},v=()=>{w0(this._activePointers,Fi),i.copy(Fi),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",_),this._domElement.ownerDocument.addEventListener("pointerlockerror",y),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",l),p())},this.unlockPointer=()=>{var g,x,w;this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),(g=this._domElement)===null||g===void 0||g.ownerDocument.exitPointerLock(),(x=this._domElement)===null||x===void 0||x.ownerDocument.removeEventListener("pointerlockchange",_),(w=this._domElement)===null||w===void 0||w.ownerDocument.removeEventListener("pointerlockerror",y),this.cancel()};const _=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},y=()=>{this.unlockPointer()};this._addAllEventListeners=g=>{this._domElement=g,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),this._domElement.addEventListener("pointercancel",l),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",h)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("pointercancel",l),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",h),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",l),this._domElement.ownerDocument.removeEventListener("pointerlockchange",_),this._domElement.ownerDocument.removeEventListener("pointerlockerror",y))},this.cancel=()=>{this._state!==_e.NONE&&(this._state=_e.NONE,this._activePointers.length=0,v())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Ur(e.width,0,1),this._interactiveArea.height=Ur(e.height,0,1),this._interactiveArea.x=Ur(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Ur(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,n=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,n)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,n=!1){this._isUserControllingRotate=!1;const i=Ur(e,this.minAzimuthAngle,this.maxAzimuthAngle),s=Ur(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=s,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,n||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const o=!n||Zt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Zt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Al.NONE,this._changedDolly=0,this._dollyToNoClamp(Ur(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const n=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const o=this._collisionTest(),a=Zt(o,this._spherical.radius);if(!(n>e)&&a)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,o)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const s=!t||Zt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(s)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(lu).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const n=!t||Zt(this._target.x,this._targetEnd.x,this.restThreshold)&&Zt(this._target.y,this._targetEnd.y,this.restThreshold)&&Zt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=Ur(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const n=!t||Zt(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(n)}pan(e,t,n=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,n)}truck(e,t,n=!1){this._camera.updateMatrix(),es.setFromMatrixColumn(this._camera.matrix,0),ts.setFromMatrixColumn(this._camera.matrix,1),es.multiplyScalar(e),ts.multiplyScalar(-t);const i=At.copy(es).add(ts),s=Wt.copy(this._targetEnd).add(i);return this.moveTo(s.x,s.y,s.z,n)}forward(e,t=!1){At.setFromMatrixColumn(this._camera.matrix,0),At.crossVectors(this._camera.up,At),At.multiplyScalar(e);const n=Wt.copy(this._targetEnd).add(At);return this.moveTo(n.x,n.y,n.z,t)}elevate(e,t=!1){return At.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+At.x,this._targetEnd.y+At.y,this._targetEnd.z+At.z,t)}moveTo(e,t,n,i=!1){this._isUserControllingTruck=!1;const s=At.set(e,t,n).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,s,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||Zt(this._target.x,this._targetEnd.x,this.restThreshold)&&Zt(this._target.y,this._targetEnd.y,this.restThreshold)&&Zt(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(e,t,n,i=!1){const a=At.set(e,t,n).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius).add(this._targetEnd);return this.setPosition(a.x,a.y,a.z,i)}fitToBox(e,t,{cover:n=!1,paddingLeft:i=0,paddingRight:s=0,paddingBottom:o=0,paddingTop:a=0}={}){const l=[],c=e.isBox3?Pl.copy(e):Pl.setFromObject(e);c.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const u=FE(this._sphericalEnd.theta,NE),h=FE(this._sphericalEnd.phi,NE);l.push(this.rotateTo(u,h,t));const p=At.setFromSpherical(this._sphericalEnd).normalize(),m=VE.setFromUnitVectors(p,b0),v=Zt(Math.abs(p.y),1);v&&m.multiply(T0.setFromAxisAngle(fd,u)),m.multiply(this._yAxisUpSpaceInverse);const _=HE.makeEmpty();Wt.copy(c.min).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.min).setX(c.max.x).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.min).setY(c.max.y).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.max).setZ(c.min.z).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.min).setZ(c.max.z).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.max).setY(c.min.y).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.max).setX(c.min.x).applyQuaternion(m),_.expandByPoint(Wt),Wt.copy(c.max).applyQuaternion(m),_.expandByPoint(Wt),_.min.x-=i,_.min.y-=o,_.max.x+=s,_.max.y+=a,m.setFromUnitVectors(b0,p),v&&m.premultiply(T0.invert()),m.premultiply(this._yAxisUpSpace);const y=_.getSize(At),g=_.getCenter(Wt).applyQuaternion(m);if(ia(this._camera)){const x=this.getDistanceToFitBox(y.x,y.y,y.z,n);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.dollyTo(x,t)),l.push(this.setFocalOffset(0,0,0,t))}else if(ho(this._camera)){const x=this._camera,w=x.right-x.left,E=x.top-x.bottom,b=n?Math.max(w/y.x,E/y.y):Math.min(w/y.x,E/y.y);l.push(this.moveTo(g.x,g.y,g.z,t)),l.push(this.zoomTo(b,t)),l.push(this.setFocalOffset(0,0,0,t))}return Promise.all(l)}fitToSphere(e,t){const n=[],s="isObject3D"in e?Gv.createBoundingSphere(e,M0):M0.copy(e);if(n.push(this.moveTo(s.center.x,s.center.y,s.center.z,t)),ia(this._camera)){const o=this.getDistanceToFitSphere(s.radius);n.push(this.dollyTo(o,t))}else if(ho(this._camera)){const o=this._camera.right-this._camera.left,a=this._camera.top-this._camera.bottom,l=2*s.radius,c=Math.min(o/l,a/l);n.push(this.zoomTo(c,t))}return n.push(this.setFocalOffset(0,0,0,t)),Promise.all(n)}setLookAt(e,t,n,i,s,o,a=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Al.NONE,this._changedDolly=0;const l=Wt.set(i,s,o),c=At.set(e,t,n);this._targetEnd.copy(l),this._sphericalEnd.setFromVector3(c.sub(l).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,a||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const u=!a||Zt(this._target.x,this._targetEnd.x,this.restThreshold)&&Zt(this._target.y,this._targetEnd.y,this.restThreshold)&&Zt(this._target.z,this._targetEnd.z,this.restThreshold)&&Zt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Zt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Zt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(u)}lerpLookAt(e,t,n,i,s,o,a,l,c,u,h,p,m,v=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Al.NONE,this._changedDolly=0;const _=At.set(i,s,o),y=Wt.set(e,t,n);gr.setFromVector3(y.sub(_).applyQuaternion(this._yAxisUpSpace));const g=Rl.set(u,h,p),x=Wt.set(a,l,c);cu.setFromVector3(x.sub(g).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(_.lerp(g,m));const w=cu.theta-gr.theta,E=cu.phi-gr.phi,b=cu.radius-gr.radius;this._sphericalEnd.set(gr.radius+b*m,gr.phi+E*m,gr.theta+w*m),this.normalizeRotations(),this._needsUpdate=!0,v||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const M=!v||Zt(this._target.x,this._targetEnd.x,this.restThreshold)&&Zt(this._target.y,this._targetEnd.y,this.restThreshold)&&Zt(this._target.z,this._targetEnd.z,this.restThreshold)&&Zt(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&Zt(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&Zt(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(M)}setPosition(e,t,n,i=!1){return this.setLookAt(e,t,n,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,n,i=!1){const s=this.getPosition(At),o=this.setLookAt(s.x,s.y,s.z,e,t,n,i);return this._sphericalEnd.phi=Ur(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(e,t,n,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,n),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const s=!i||Zt(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&Zt(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&Zt(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}setOrbitPoint(e,t,n){this._camera.updateMatrixWorld(),es.setFromMatrixColumn(this._camera.matrixWorldInverse,0),ts.setFromMatrixColumn(this._camera.matrixWorldInverse,1),ra.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=At.set(e,t,n),s=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);es.multiplyScalar(o.x),ts.multiplyScalar(o.y),ra.multiplyScalar(o.z),At.copy(es).add(ts).add(ra),At.z=At.z+s,this.dollyTo(s,!1),this.setFocalOffset(-At.x,At.y,-At.z,!1),this.moveTo(e,t,n,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,n,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new vt.Vector4,typeof e=="number"?this._viewport.set(e,t,n,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,n,i=!1){if(S0(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const s=e/t,o=this._camera.getEffectiveFOV()*su,a=this._camera.aspect;return((i?s>a:st.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,n){const i=t.lengthSq();if(i===0)return e;const s=Wt.copy(t).add(e),a=this._boundary.clampPoint(s,Rl).sub(s),l=a.lengthSq();if(l===0)return e.add(t);if(l===i)return e;if(n===0)return e.add(t).add(a);{const c=1+n*l/t.dot(a);return e.add(Wt.copy(t).multiplyScalar(c)).add(a.multiplyScalar(1-n))}}_updateNearPlaneCorners(){if(ia(this._camera)){const e=this._camera,t=e.near,n=e.getEffectiveFOV()*su,i=Math.tan(n*.5)*t,s=i*e.aspect;this._nearPlaneCorners[0].set(-s,-i,0),this._nearPlaneCorners[1].set(s,-i,0),this._nearPlaneCorners[2].set(s,i,0),this._nearPlaneCorners[3].set(-s,i,0)}else if(ho(this._camera)){const e=this._camera,t=1/e.zoom,n=e.left*t,i=e.right*t,s=e.top*t,o=e.bottom*t;this._nearPlaneCorners[0].set(n,s,0),this._nearPlaneCorners[1].set(i,s,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(n,o,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||S0(this._camera,"_collisionTest"))return e;const n=this._getTargetDirection(lu);A0.lookAt(zE,n,this._camera.up);for(let i=0;i<4;i++){const s=Wt.copy(this._nearPlaneCorners[i]);s.applyMatrix4(A0);const o=Rl.addVectors(this._target,s);dd.set(o,n),dd.far=this._spherical.radius+1;const a=dd.intersectObjects(this.colliderMeshes);a.length!==0&&a[0].distance{const n=()=>{this.removeEventListener("rest",n),t()};this.addEventListener("rest",n)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new vt.Sphere){const n=t,i=n.center;Pl.makeEmpty(),e.traverseVisible(o=>{o.isMesh&&Pl.expandByObject(o)}),Pl.getCenter(i);let s=0;return e.traverseVisible(o=>{if(!o.isMesh)return;const a=o;if(!a.geometry)return;const l=a.geometry.clone();l.applyMatrix4(a.matrixWorld);const u=l.attributes.position;for(let h=0,p=u.count;h"u")&&(s[o]=r[o]);return s.max=i||s.max,s.truncate=="middle"?e(n,s.max,s.ellipse,s.chars):t(n,s.max,s.ellipse,s.chars,s.truncate)},uu.exports.ellipsizeMiddle=e,uu.exports.ellipsize=t,uu.exports}var v5=g5();const y5=Hr(v5);/*! + * hold-event + * https://github.com/yomotsu/hold-event + * (c) 2020 @yomotsu + * Released under the MIT License. + */var Au;(function(r){r.HOLD_START="holdStart",r.HOLD_END="holdEnd",r.HOLDING="holding"})(Au||(Au={}));class _5{constructor(){this._listeners={}}addEventListener(e,t){const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const s=i.indexOf(t);s!==-1&&i.splice(s,1)}}dispatchEvent(e){const n=this._listeners[e.type];if(n!==void 0){e.target=this;const i=n.slice(0);for(let s=0,o=i.length;s{if(!this._enabled||this._holding)return;this._deltaTime=0,this._elapsedTime=0,this._lastTime=performance.now(),this.dispatchEvent({type:Au.HOLD_START,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),this._holding=!0;const n=()=>{this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n);const i=performance.now();this._deltaTime=i-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:Au.HOLDING,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t})};this._intervalId=this.holdIntervalDelay?window.setTimeout(n,this.holdIntervalDelay):window.requestAnimationFrame(n)},this._holdEnd=t=>{if(!this._enabled||!this._holding)return;const n=performance.now();this._deltaTime=n-this._lastTime,this._elapsedTime+=this._deltaTime,this._lastTime=performance.now(),this.dispatchEvent({type:Au.HOLD_END,deltaTime:this._deltaTime,elapsedTime:this._elapsedTime,originalEvent:t}),window.clearTimeout(this._intervalId),window.cancelAnimationFrame(this._intervalId),this._holding=!1},this.holdIntervalDelay=e}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,this._enabled||this._holdEnd())}}class kp extends x5{constructor(e,t){super(t),this._holdStart=this._holdStart.bind(this),this._holdEnd=this._holdEnd.bind(this);const n=s=>{w5(s)||s.keyCode===e&&this._holdStart(s)},i=s=>{s.keyCode===e&&this._holdEnd(s)};document.addEventListener("keydown",n),document.addEventListener("keyup",i),window.addEventListener("blur",this._holdEnd)}}function w5(r){const e=r.target;return e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"||e.isContentEditable}var C0={exports:{}};/*! + Copyright (c) 2018 Jed Watson. + Licensed under the MIT License (MIT), see + http://jedwatson.github.io/classnames +*/var XE;function S5(){return XE||(XE=1,(function(r){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o-1){const s=[...e.slice(i),n].map(o=>o.data.id);throw new Error(`Invalid Graph: Circular node path detected: ${s.join(" -> ")}.`)}t>n.depth&&(n.depth=t,a2(n.out,[...e,n]))}}function l2(r,e){let t=!1;const n=r.reduce((o,a)=>({...o,[a.id]:{data:a,out:[],depth:-1,ins:[]}}),{});try{for(const o of e){const a=o.source,l=o.target;if(!n.hasOwnProperty(a))throw new Error(`Missing source Node ${a}`);if(!n.hasOwnProperty(l))throw new Error(`Missing target Node ${l}`);const c=n[a],u=n[l];u.ins.push(c),c.out.push(u)}a2(Object.values(n))}catch{t=!0}const i=Object.keys(n).map(o=>n[o].depth),s=Math.max(...i);return{invalid:t,depths:n,maxDepth:s||1}}const qE=["radialin","radialout"];function E5({nodes:r,edges:e,mode:t="lr",nodeLevelRatio:n=2}){const{depths:i,maxDepth:s,invalid:o}=l2(r,e);if(o)return null;const a=qE.includes(t)?1:5,l=r.length/s*n*a;if(t){const c=(m,v)=>_=>m?(i[_.id].depth-s/2)*l*(v?-1:1):void 0,u=c(["lr","rl"].includes(t),t==="rl"),h=c(["td","bu"].includes(t),t==="td"),p=c(["zin","zout"].includes(t),t==="zout");r.forEach(m=>{m.fx=u(m),m.fy=h(m),m.fz=p(m)})}return qE.includes(t)?KN(c=>{const u=i[c.id];return(t==="radialin"?s-u.depth:u.depth)*l}).strength(1):null}function b5(r){return new Promise((e,t)=>{let n;function i(){n?e(n):(n=r.step(),i())}i()})}function _h(r){const e=[],t=[];return r.forEachNode((n,i)=>{e.push({...i,id:n,radius:i.size||1})}),r.forEachEdge((n,i)=>{t.push({...i,id:n})}),{nodes:e,edges:t}}function M5(){const r=O=>()=>O;let t=O=>O.index,n=[],i=[],s,o,a=[100,100],l=r(1),c=r(-1),u=r(100),h=r(.1),p={},m=.1,v=.001,_=[],y=[0,0],g,x=O=>O.cluster,w="treemap",E=!0,b=.1;function M(O){if(!E)return M;w==="force"&&(g.tick(),I());for(let k=0,G=n.length,B,D=O*b;kk.radius).sort(function(k,G){return G.height-k.height||G.value-k.value}),_=O(o).leaves(),I()}function q(){let O=0;n.length!==0&&i.forEach(function(k){let G,B;if(n){if(G=k.source,B=k.target,typeof k.source!="object"&&(G=n.find(D=>D.id===k.source)),typeof k.target!="object"&&(B=n.find(D=>D.id===k.target)),G===void 0||B===void 0)throw Error("Error setting links, couldnt find nodes for a link (see it on the console)");k.source=G,k.target=B,k.index=O++}})}function W(){let O;!n||!n.length||(q(),O=F(),s.size>0&&O.nodes.forEach(k=>{var G,B,D,V;k.fx=(B=(G=s.get(k.id))==null?void 0:G.position)==null?void 0:B.x,k.fy=(V=(D=s.get(k.id))==null?void 0:D.position)==null?void 0:V.y}),g=zT(O.nodes).force("x",xv(a[0]/2).strength(.1)).force("y",wv(a[1]/2).strength(.1)).force("collide",IT(k=>k.r).iterations(4)).force("charge",BT().strength(c)).force("links",DT(O.nodes.length?O.links:[]).distance(u).strength(h)),_=g.nodes(),I())}return M.template=function(O){return arguments.length?(w=O,A(),M):w},M.groupBy=function(O){return arguments.length?typeof O=="string"?(x=function(k){return k[O]},M):(x=O,M):x},M.enableGrouping=function(O){return arguments.length?(E=O,M):E},M.strength=function(O){return arguments.length?(b=O,M):b},M.getLinkStrength=function(O){return E?x(O.source)===x(O.target)?typeof m=="function"?m(O):m:typeof v=="function"?v(O):v:typeof m=="function"?m(O):m},M.id=function(O){return arguments.length?(t=O,M):t},M.size=function(O){return arguments.length?(a=O,M):a},M.linkStrengthInterCluster=function(O){return arguments.length?(v=O,M):v},M.linkStrengthIntraCluster=function(O){return arguments.length?(m=O,M):m},M.nodes=function(O){return arguments.length?(n=O,M):n},M.links=function(O){return arguments.length?(O===null?i=[]:i=O,A(),M):i},M.template=function(O){return arguments.length?(w=O,A(),M):w},M.forceNodeSize=function(O){return arguments.length?(l=typeof O=="function"?O:r(+O),A(),M):l},M.nodeSize=M.forceNodeSize,M.forceCharge=function(O){return arguments.length?(c=typeof O=="function"?O:r(+O),A(),M):c},M.forceLinkDistance=function(O){return arguments.length?(u=typeof O=="function"?O:r(+O),A(),M):u},M.forceLinkStrength=function(O){return arguments.length?(h=typeof O=="function"?O:r(+O),A(),M):h},M.offset=function(O){return arguments.length?(y=typeof O=="function"?O:r(+O),M):y},M.getFocis=I,M.setClusters=function(O){return s=O,M},M}function uo({graph:r,nodeLevelRatio:e=2,mode:t=null,dimensions:n=2,nodeStrength:i=-250,linkDistance:s=50,clusterStrength:o=.5,linkStrengthInterCluster:a=.01,linkStrengthIntraCluster:l=.5,forceLinkDistance:c=100,forceLinkStrength:u=.1,clusterType:h="force",forceCharge:p=-700,getNodePosition:m,drags:v,clusters:_,clusterAttribute:y,forceLayout:g}){const{nodes:x,edges:w}=_h(r),b=n===2&&w.length>25?i*2:i;let M,A;g==="forceDirected2d"?(M=xv(),A=wv()):(M=xv(600).strength(.05),A=wv(600).strength(.05));const P=zT().force("center",FO(0,0)).force("link",DT()).force("charge",BT().strength(b)).force("x",M).force("y",A).force("z",$N()).force("collide",IT(N=>N.radius+10)).force("dagRadial",E5({nodes:x,edges:w,mode:t,nodeLevelRatio:e})).stop();let C;if(y){let N=p;if(x!=null&&x.length){const I=Math.ceil(x.length/200);N=p*I}C=M5().setClusters(_).strength(o).template(h).groupBy(I=>I.data[y]).links(w).size([100,100]).linkStrengthInterCluster(a).linkStrengthIntraCluster(l).forceLinkDistance(c).forceLinkStrength(u).forceCharge(N).forceNodeSize(I=>I.radius)}let L=P.numDimensions(n).nodes(x);if(C&&(L=L.force("group",C)),s){let N=L.force("link");N&&(N.id(I=>I.id).links(w).distance(s),C&&(N=N.strength((C==null?void 0:C.getLinkStrength)??.1)))}const F=new Map(x.map(N=>[N.id,N]));return{step(){for(;P.alpha()>.01;)P.tick();return!0},getNodePosition(N){var I,X;if(m){const q=m(N,{graph:r,drags:v,nodes:x,edges:w});if(q)return q}return(I=v==null?void 0:v[N])!=null&&I.position?(X=v==null?void 0:v[N])==null?void 0:X.position:F.get(N)}}}function T5({graph:r,radius:e,drags:t,getNodePosition:n}){const i=FF(r,{scale:e}),{nodes:s,edges:o}=_h(r);return{step(){return!0},getNodePosition(a){var l,c;if(n){const u=n(a,{graph:r,drags:t,nodes:s,edges:o});if(u)return u}return(l=t==null?void 0:t[a])!=null&&l.position?(c=t==null?void 0:t[a])==null?void 0:c.position:i==null?void 0:i[a]}}}const A5={td:{x:"x",y:"y",factor:-1},lr:{x:"y",y:"x",factor:1}};function ZE({graph:r,drags:e,mode:t="td",nodeSeparation:n=1,nodeSize:i=[50,50],getNodePosition:s}){const{nodes:o,edges:a}=_h(r),{depths:l}=l2(o,a),c=Object.keys(l).map(_=>l[_]),u=SF().id(_=>_.data.id).parentId(_=>{var y,g,x;return(x=(g=(y=_.ins)==null?void 0:y[0])==null?void 0:g.data)==null?void 0:x.id})(c),p=RF().separation(()=>n).nodeSize(i)(Mp(u)).descendants(),m=A5[t],v=new Map(o.map(_=>{const{x:y,y:g}=p.find(x=>x.data.id===_.id);return[_.id,{..._,[m.x]:y*m.factor,[m.y]:g*m.factor,z:0}]}));return{step(){return!0},getNodePosition(_){var y,g;if(s){const x=s(_,{graph:r,drags:e,nodes:o,edges:a});if(x)return x}return(y=e==null?void 0:e[_])!=null&&y.position?(g=e==null?void 0:e[_])==null?void 0:g.position:v.get(_)}}}function C5({graph:r,margin:e,drags:t,getNodePosition:n,ratio:i,gridSize:s,maxIterations:o}){const{nodes:a,edges:l}=_h(r),c=VF(r,{maxIterations:o,inputReducer:(u,h)=>({...h,x:h.x||0,y:h.y||0}),settings:{ratio:i,margin:e,gridSize:s}});return{step(){return!0},getNodePosition(u){var h,p;if(n){const m=n(u,{graph:r,drags:t,nodes:a,edges:l});if(m)return m}return(h=t==null?void 0:t[u])!=null&&h.position?(p=t==null?void 0:t[u])==null?void 0:p.position:c==null?void 0:c[u]}}}function R5({graph:r,drags:e,iterations:t,...n}){JF.assign(r);const i=ZF(r,{iterations:t,settings:n});return{step(){return!0},getNodePosition(s){var o;return((o=e==null?void 0:e[s])==null?void 0:o.position)||(i==null?void 0:i[s])}}}function P5({graph:r,drags:e,getNodePosition:t}){const{nodes:n,edges:i}=_h(r);return{step(){return!0},getNodePosition(s){return t(s,{graph:r,drags:e,nodes:n,edges:i})}}}const L5=["forceDirected2d","treeTd2d","treeLr2d","radialOut2d","treeTd3d","treeLr3d","radialOut3d","forceDirected3d"];function I5({type:r,...e}){if(L5.includes(r)){const{nodeStrength:t,linkDistance:n,nodeLevelRatio:i}=e;if(r==="forceDirected2d")return uo({...e,dimensions:2,nodeLevelRatio:i||2,nodeStrength:t||-250,linkDistance:n,forceLayout:r});if(r==="treeTd2d")return uo({...e,mode:"td",dimensions:2,nodeLevelRatio:i||5,nodeStrength:t||-250,linkDistance:n||50,forceLayout:r});if(r==="treeLr2d")return uo({...e,mode:"lr",dimensions:2,nodeLevelRatio:i||5,nodeStrength:t||-250,linkDistance:n||50,forceLayout:r});if(r==="radialOut2d")return uo({...e,mode:"radialout",dimensions:2,nodeLevelRatio:i||5,nodeStrength:t||-500,linkDistance:n||100,forceLayout:r});if(r==="treeTd3d")return uo({...e,mode:"td",dimensions:3,nodeLevelRatio:i||2,nodeStrength:t||-500,linkDistance:n||50});if(r==="treeLr3d")return uo({...e,mode:"lr",dimensions:3,nodeLevelRatio:i||2,nodeStrength:t||-500,linkDistance:n||50,forceLayout:r});if(r==="radialOut3d")return uo({...e,mode:"radialout",dimensions:3,nodeLevelRatio:i||2,nodeStrength:t||-500,linkDistance:n||100,forceLayout:r});if(r==="forceDirected3d")return uo({...e,dimensions:3,nodeLevelRatio:i||2,nodeStrength:t||-250,linkDistance:n,forceLayout:r})}else if(r==="circular2d"){const{radius:t}=e;return T5({...e,radius:t||300})}else{if(r==="hierarchicalTd")return ZE({...e,mode:"td"});if(r==="hierarchicalLr")return ZE({...e,mode:"lr"});if(r==="nooverlap"){const{graph:t,maxIterations:n,ratio:i,margin:s,gridSize:o,...a}=e;return C5({graph:t,margin:s||10,maxIterations:n||50,ratio:i||10,gridSize:o||20,...a})}else if(r==="forceatlas2"){const{graph:t,iterations:n,gravity:i,scalingRatio:s,...o}=e;return R5({type:"forceatlas2",graph:t,...o,scalingRatio:s||100,gravity:i||10,iterations:n||50})}else if(r==="custom")return P5({...e})}throw new Error(`Layout ${r} not found.`)}function c2({nodeCount:r,nodePosition:e,labelType:t,camera:n}){return(i,s)=>{var o;if(n&&e&&((o=n==null?void 0:n.position)==null?void 0:o.z)/(n==null?void 0:n.zoom)-(e==null?void 0:e.z)>6e3)return!1;if(t==="all")return!0;if(t==="nodes"&&i==="node")return!0;if(t==="edges"&&i==="edge")return!0;if(t==="auto"&&i==="node"){if(s>7)return!0;if(n&&e&&n.position.z/n.zoom-e.z<3e3)return!0}return!1}}function u2(r,e){switch(e){case"above":return r;case"below":return-r;case"inline":case"natural":default:return 0}}function D5({graph:r}){const e=nk(r);return{ranks:e,getSizeForNode:t=>e[t]*80}}function U5({graph:r}){const e=rk.degreeCentrality(r);return{ranks:e,getSizeForNode:t=>e[t]*20}}function O5({graph:r,attribute:e,defaultSize:t}){const n=new Map;return e?r.forEachNode((i,s)=>{var o;const a=(o=s.data)==null?void 0:o[e];isNaN(a)&&console.warn(`Attribute ${a} is not a number for node ${s.id}`),n.set(i,a||0)}):console.warn("Attribute sizing configured but no attribute provided"),{getSizeForNode:i=>!e||!n?t:n.get(i)}}const KE={pagerank:D5,centrality:U5,attribute:O5,none:({defaultSize:r})=>({getSizeForNode:e=>r})};function N5({type:r,...e}){var t;const n=(t=KE[r])==null?void 0:t.call(KE,e);if(!n&&r!=="default")throw new Error(`Unknown sizing strategy: ${r}`);const{graph:i,minSize:s,maxSize:o}=e,a=new Map;let l,c;if(i.forEachNode((u,h)=>{let p;r==="default"?p=h.size||e.defaultSize:p=n.getSizeForNode(u),(l===void 0||pc)&&(c=p),a.set(u,p)}),r!=="none"){const u=Z2().domain([l,c]).rangeRound([s,o]);for(const[h,p]of a)a.set(h,u(p))}return a}function F5(r,e,t){r.clear();const n=new Set;for(const i of e)try{n.has(i.id)||(r.addNode(i.id,i),n.add(i.id))}catch(s){console.error(`[Graph] Error adding node '${i.id}`,s)}for(const i of t)if(!(!n.has(i.source)||!n.has(i.target)))try{r.addEdge(i.source,i.target,i)}catch(s){console.error(`[Graph] Error adding edge '${i.source} -> ${i.target}`,s)}return r}function k5({graph:r,layout:e,sizingType:t,labelType:n,sizingAttribute:i,defaultNodeSize:s,minNodeSize:o,maxNodeSize:a,clusterAttribute:l}){const c=[],u=[],h=new Map,p=N5({graph:r,type:t,attribute:i,minSize:o,maxSize:a,defaultSize:s}),m=r.nodes().length,v=c2({nodeCount:m,labelType:n});return r.forEachNode((_,y)=>{const g=e.getNodePosition(_),{data:x,fill:w,icon:E,label:b,size:M,...A}=y,P=p.get(y.id),C=v("node",P),F=(r.inboundNeighbors(y.id)||[]).map(I=>r.getNodeAttributes(I)),N={...y,size:P,labelVisible:C,label:b,icon:E,fill:w,cluster:l?x[l]:void 0,parents:F,data:{...A,...x??{}},position:{...g,x:g.x||0,y:g.y||0,z:g.z||1}};h.set(y.id,N),c.push(N)}),r.forEachEdge((_,y)=>{const g=h.get(y.source),x=h.get(y.target);if(g&&x){const{data:w,id:E,label:b,size:M,...A}=y,P=v("edge",M);u.push({...y,id:E,label:b,labelVisible:P,size:M,data:{...A,id:E,...w||{}}})}}),{nodes:c,edges:u}}const nr={mass:10,tension:1e3,friction:300,precision:.1};function h2(r,e,t){const n=e.getLength(),i=r==="end"?n:n/2,s=r==="end"?t/2:0,o=(i-s)/n,a=e.getPointAt(o),l=e.getTangentAt(o);return[a,l]}function f2(r){return[r+6,2+r/1.5]}const R0=.7;function d2(r,e,t=0){const n=new Y(r.x,r.y||0,r.z||0),i=new Y(e.x,e.y||0,e.z||0),s=new Y().addVectors(n,i).divideScalar(2);return s.setLength(s.length()+t)}function z5(r,e,t=-1){const n=r.clone(),i=e.clone(),s=new Y().subVectors(i,n),o=s.length(),a=s.clone().normalize(),l=new Y().subVectors(i,n).divideScalar(2),c=Math.abs(a.x)%1,u=new Y(-a.y,a.x-c*a.z,c*a.y).normalize(),h=new Y().add(n).add(l).add(u.multiplyScalar(o/4).multiplyScalar(t));return[r,h,e]}function Qu(r,e,t,n,i,s){const o=$E(r,t,e),a=$E(t,r,n);return i?new lp(...z5(o,a,s)):new vy(o,a)}function eh(r){return new Y(r.position.x,r.position.y,r.position.z||0)}function $E(r,e,t){const n=r.distanceTo(e);return r.clone().add(e.clone().sub(r).multiplyScalar(t/n))}function JE(r,e){return{...r,position:{...r.position,x:r.position.x+e.x,y:r.position.y+e.y,z:r.position.z+e.z}}}function B5({edge:r,edges:e,curved:t}){let n=t,i;const s=e.filter(o=>o.target===r.target&&o.source===r.source).map(o=>o.id);if(s.length>1){n=!0;const o=s.indexOf(r.id);s.length===2?i=o===0?R0:-R0:i=(o-Math.floor(s.length/2))*R0}return{curved:n,curveOffset:i}}function th(r){let e=Number.POSITIVE_INFINITY,t=Number.NEGATIVE_INFINITY,n=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;for(let a of r)e=Math.min(e,a.position.x),t=Math.max(t,a.position.x),n=Math.min(n,a.position.y),i=Math.max(i,a.position.y),s=Math.min(s,a.position.z),o=Math.max(o,a.position.z);return{height:i-n,width:t-e,minX:e,maxX:t,minY:n,maxY:i,minZ:s,maxZ:o,x:(t+e)/2,y:(i+n)/2,z:(o+s)/2}}function G5(r,e){return e?r.reduce((t,n)=>{const i=n.data[e];return i&&t.set(i,[...t.get(i)||[],n]),t},new Map):new Map}function H5({nodes:r,clusterAttribute:e}){const t=new Map;if(e){const n=G5(r,e);for(const[i,s]of n){const o=th(s);t.set(i,{label:i,nodes:s,position:o})}}return t}const m_=({sensitivity:r=7,interval:e=50,timeout:t=0,disabled:n,onPointerOver:i,onPointerOut:s})=>{const o=K.useRef(!1),a=K.useRef(null),l=K.useRef(0),c=K.useRef({x:null,y:null,px:null,py:null}),u=K.useCallback(y=>{c.current.x=y.clientX,c.current.y=y.clientY},[]),h=K.useCallback(y=>{a.current=clearTimeout(a.current);const{px:g,x,py:w,y:E}=c.current;Math.abs(g-x)+Math.abs(w-E)h(y),e))},[e,i,r]),p=K.useCallback(()=>{clearTimeout(a.current),typeof window<"u"&&document.removeEventListener("mousemove",u,!1)},[u]),m=K.useCallback(y=>{n||(o.current=!0,p(),l.current!==1&&(c.current.px=y.pointer.x,c.current.py=y.pointer.y,typeof window<"u"&&document.addEventListener("mousemove",u,!1),a.current=setTimeout(()=>h(y),t)))},[p,h,n,u,t]),v=K.useCallback(y=>{a.current=clearTimeout(a.current),l.current=0,s(y)},[s]),_=K.useCallback(y=>{o.current=!1,p(),l.current===1&&(a.current=setTimeout(()=>v(y),t))},[p,v,t]);return{pointerOver:m,pointerOut:_}},p2=({draggable:r,set:e,position:t,bounds:n,onDragStart:i,onDragEnd:s})=>{const o=Bn(y=>y.camera),a=Bn(y=>y.raycaster),l=Bn(y=>y.size),c=Bn(y=>y.gl),{mouse2D:u,mouse3D:h,offset:p,normal:m,plane:v}=K.useMemo(()=>({mouse2D:new De,mouse3D:new Y,offset:new Y,normal:new Y,plane:new Us}),[]),_=K.useMemo(()=>c.domElement.getBoundingClientRect(),[c.domElement]);return Pz({onDragStart:({event:y})=>{const{eventObject:g,point:x}=y;g.getWorldPosition(p).sub(x),h.copy(x),i()},onDrag:({xy:y,buttons:g,cancel:x})=>{if(g!==1){x();return}const w=(y[0]-((_==null?void 0:_.left)??0))/l.width*2-1,E=-((y[1]-((_==null?void 0:_.top)??0))/l.height)*2+1;u.set(w,E),a.setFromCamera(u,o),o.getWorldDirection(m).negate(),v.setFromNormalAndCoplanarPoint(m,h),a.ray.intersectPlane(v,h);const b=new Y(t.x,t.y,t.z).copy(h).add(p);if(n){const M=new Y((n.minX+n.maxX)/2,(n.minY+n.maxY)/2,(n.minZ+n.maxZ)/2),A=(n.maxX-n.minX)/2,P=b.clone().sub(M);P.length()>A&&(P.normalize().multiplyScalar(A),b.copy(M).add(P))}return e(b)},onDragEnd:s},{drag:{enabled:r,threshold:10}})},{Provider:V5,useStore:qe}=vk(),W5=({actives:r=[],selections:e=[],collapsedNodeIds:t=[],theme:n})=>mk(i=>({theme:{...n,edge:{...n.edge,label:{...n.edge.label,fontSize:n.edge.label.fontSize??6}}},edges:[],nodes:[],collapsedNodeIds:t,clusters:new Map,panning:!1,draggingIds:[],actives:r,edgeContextMenus:new Set,edgeMeshes:[],selections:e,hoveredNodeId:null,drags:{},graph:new en({multi:!0}),setTheme:s=>i(o=>({...o,theme:s})),setClusters:s=>i(o=>({...o,clusters:s})),setEdgeContextMenus:s=>i(o=>({...o,edgeContextMenus:s})),setEdgeMeshes:s=>i(o=>({...o,edgeMeshes:s})),setPanning:s=>i(o=>({...o,panning:s})),setDrags:s=>i(o=>({...o,drags:s})),addDraggingId:s=>i(o=>({...o,draggingIds:[...o.draggingIds,s]})),removeDraggingId:s=>i(o=>({...o,draggingIds:o.draggingIds.filter(a=>a!==s)})),setActives:s=>i(o=>({...o,actives:s})),setSelections:s=>i(o=>({...o,selections:s})),setHoveredNodeId:s=>i(o=>({...o,hoveredNodeId:s})),setNodes:s=>i(o=>({...o,nodes:s,centerPosition:th(s)})),setEdges:s=>i(o=>({...o,edges:s})),setNodePosition:(s,o)=>i(a=>{var l,c;const u=a.nodes.find(_=>_.id===s),h=eh(u),m=new Y(o.x,o.y,o.z).sub(h),v=[...a.nodes];if((l=a.selections)!=null&&l.includes(s))(c=a.selections)==null||c.forEach(_=>{const y=a.nodes.find(g=>g.id===_);if(y){const g=a.nodes.indexOf(y);v[g]=JE(y,m)}});else{const _=a.nodes.indexOf(u);v[_]=JE(u,m)}return{...a,drags:{...a.drags,[s]:u},nodes:v}}),setCollapsedNodeIds:(s=[])=>i(o=>({...o,collapsedNodeIds:s})),setClusterPosition:(s,o)=>i(a=>{const l=new Map(a.clusters),c=l.get(s);if(c){const u=c.position,h=new Y(o.x-u.x,o.y-u.y,o.z-(u.z??0)),p=[...a.nodes],m={...a.drags};p.forEach((y,g)=>{y.cluster===s&&(p[g]={...y,position:{...y.position,x:y.position.x+h.x,y:y.position.y+h.y,z:y.position.z+(h.z??0)}},m[y.id]=y)});const v=p.filter(y=>y.cluster===s),_=th(v);return l.set(s,{...c,position:_}),{...a,drags:{...m,[s]:c},clusters:l,nodes:p}}return a})}));function m2({nodeId:r,nodes:e,edges:t,currentHiddenNodes:n,currentHiddenEdges:i}){const s=[],o=[],a=n.map(m=>m.id),l=i.map(m=>m.id),c=t.filter(m=>m.source===r),u=c.map(m=>m.target);o.push(...c);for(const m of u){const v=t.filter(y=>y.target===m&&y.source!==r);let _=!1;if((v.length===0||v.length>0&&!a.includes(m)&&v.map(g=>g.id).every(g=>l.includes(g)))&&(_=!0),_){const y=e.find(x=>x.id===m);y&&s.push(y);const g=m2({nodeId:m,nodes:e,edges:t,currentHiddenEdges:o,currentHiddenNodes:s});o.push(...g.hiddenEdges),s.push(...g.hiddenNodes)}}const h=Object.values(o.reduce((m,v)=>({...m,[v.id]:v}),{})),p=Object.values(s.reduce((m,v)=>({...m,[v.id]:v}),{}));return{hiddenEdges:h,hiddenNodes:p}}const X5=({collapsedIds:r,nodes:e,edges:t})=>{const n=[],i=[];for(const c of r){const{hiddenEdges:u,hiddenNodes:h}=m2({nodeId:c,nodes:e,edges:t,currentHiddenEdges:i,currentHiddenNodes:n});n.push(...h),i.push(...u)}const s=n.map(c=>c.id),o=i.map(c=>c.id),a=e.filter(c=>!s.includes(c.id)),l=t.filter(c=>!o.includes(c.id));return{visibleNodes:a,visibleEdges:l}},j5=({layoutType:r,sizingType:e,labelType:t,sizingAttribute:n,clusterAttribute:i,selections:s,nodes:o,edges:a,actives:l,collapsedNodeIds:c,defaultNodeSize:u,maxNodeSize:h,minNodeSize:p,layoutOverrides:m,constrainDragging:v})=>{const _=qe(D=>D.graph),y=qe(D=>D.clusters),g=qe(D=>D.nodes),x=qe(D=>D.setClusters),w=qe(D=>D.collapsedNodeIds),E=qe(D=>D.setEdges),b=qe(D=>D.nodes),M=qe(D=>D.setNodes),A=qe(D=>D.setSelections),P=qe(D=>D.setActives),C=qe(D=>D.drags),L=qe(D=>D.setDrags),F=qe(D=>D.setCollapsedNodeIds),N=K.useRef(!1),I=K.useRef(null),X=Bn(D=>D.camera),q=K.useRef(C),W=K.useRef([]);K.useEffect(()=>{var D;if(!i)return;const V=g.map(ee=>ee.id),Z=o.find(ee=>!V.includes(ee.id));if(Z){const ee=Z.data[i],ie=y.get(ee),ue={...q.current};(D=ie==null?void 0:ie.nodes)==null||D.forEach(ce=>ue[ce.id]=void 0),q.current=ue,L(ue)}},[g,o,i,y,L]);const{visibleEdges:O,visibleNodes:k}=K.useMemo(()=>X5({collapsedIds:w,nodes:o,edges:a}),[w,o,a]),G=K.useCallback(D=>{const V={...q.current};D.forEach(Z=>V[Z.id]=Z),q.current=V,L(V)},[L]),B=K.useCallback(async D=>{I.current=D||I5({...m,type:r,graph:_,drags:q.current,clusters:W==null?void 0:W.current,clusterAttribute:i}),await b5(I.current);const V=k5({graph:_,layout:I.current,sizingType:e,labelType:t,sizingAttribute:n,maxNodeSize:h,minNodeSize:p,defaultNodeSize:u,clusterAttribute:i}),Z=H5({nodes:V.nodes,clusterAttribute:i});v&&Z.forEach(ee=>{var ie,ue;const ce=W.current.get(ee.label);(ce==null?void 0:ce.nodes.length)===ee.nodes.length&&(ee.position=((ue=(ie=W.current)==null?void 0:ie.get(ee.label))==null?void 0:ue.position)??ee.position)}),E(V.edges),M(V.nodes),x(Z),i&&G(V.nodes)},[m,r,i,e,t,n,h,p,u,E,M,x]);return K.useEffect(()=>{q.current=C},[C,i,B]),K.useEffect(()=>{W.current=y},[y]),K.useEffect(()=>{const D=b.map(Z=>({...Z,labelVisible:c2({nodeCount:b==null?void 0:b.length,labelType:t,camera:X,nodePosition:Z==null?void 0:Z.position})("node",Z==null?void 0:Z.size)}));D.some((Z,ee)=>Z.labelVisible!==b[ee].labelVisible)&&M(D)},[X,X.zoom,X.position.z,M,b,t]),K.useEffect(()=>{N.current&&A(s)},[s,A]),K.useEffect(()=>{N.current&&P(l)},[l,P]),K.useEffect(()=>{async function D(){N.current=!1,F5(_,k,O),await B(),requestAnimationFrame(()=>N.current=!0)}D()},[k,O]),K.useEffect(()=>{N.current&&F(c)},[c,F]),K.useEffect(()=>{N.current&&(q.current={},L({}),B())},[r,B,L]),K.useEffect(()=>{N.current&&B(I.current)},[e,n,t,B]),{updateLayout:B}},nh=({text:r,fontSize:e=7,fontUrl:t,color:n="#2A6475",opacity:i=1,stroke:s,active:o,ellipsis:a=75,rotation:l})=>{const c=a&&!o?y5(r,a):r,u=K.useMemo(()=>new Ke(n),[n]),h=K.useMemo(()=>s?new Ke(s):void 0,[s]);return Ne.jsx(qA,{position:[0,0,1],children:Ne.jsx(f5,{font:t,fontSize:e,color:u,fillOpacity:i,textAlign:"center",outlineWidth:s?1:0,outlineColor:h,depthOffset:0,maxWidth:100,overflowWrap:"break-word",rotation:l,children:c})})},Y5=({color:r="#D8E6EA",size:e=1,opacity:t=.5,animated:n,strokeWidth:i=5,innerRadius:s=4,segments:o=25})=>{const a=K.useMemo(()=>new Ke(r),[r]),{ringSize:l,ringOpacity:c}=tr({from:{ringOpacity:0,ringSize:[1e-5,1e-5,1e-5]},to:{ringOpacity:t,ringSize:[e/2,e/2,1]},config:{...nr,duration:n?void 0:0}}),u=i/10,h=s+u;return Ne.jsx(qA,{position:[0,0,1],children:Ne.jsxs(An.mesh,{scale:l,children:[Ne.jsx("ringGeometry",{attach:"geometry",args:[s,h,o]}),Ne.jsx(An.meshBasicMaterial,{attach:"material",color:a,transparent:!0,depthTest:!1,opacity:c,side:vn,fog:!0})]})})},q5=({color:r,id:e,size:t,selected:n,opacity:i=1,animated:s})=>{const{scale:o,nodeOpacity:a}=tr({from:{scale:[1e-5,1e-5,1e-5],nodeOpacity:0},to:{scale:[t,t,t],nodeOpacity:i},config:{...nr,duration:s?void 0:0}}),l=K.useMemo(()=>new Ke(r),[r]),c=qe(u=>u.theme);return Ne.jsxs(Ne.Fragment,{children:[Ne.jsxs(An.mesh,{userData:{id:e,type:"node"},scale:o,children:[Ne.jsx("sphereGeometry",{attach:"geometry",args:[1,25,25]}),Ne.jsx(An.meshPhongMaterial,{attach:"material",side:vn,transparent:!0,fog:!0,opacity:a,color:l})]}),Ne.jsx(Y5,{opacity:n?.5:0,size:t,animated:s,color:n?c.ring.activeFill:c.ring.fill})]})},g2=K.createContext({controls:null,resetControls:()=>{},zoomIn:()=>{},zoomOut:()=>{},dollyIn:()=>{},dollyOut:()=>{},panLeft:()=>{},panRight:()=>{},panUp:()=>{},panDown:()=>{},freeze:()=>{},unFreeze:()=>{}}),zp=()=>{const r=K.useContext(g2);if(r===void 0)throw new Error("`useCameraControls` hook must be used within a `ControlsProvider` component");return r};Qn.install({THREE:{MOUSE:ab,Vector2:De,Vector3:Y,Vector4:Xt,Quaternion:si,Matrix4:yt,Spherical:lT,Box3:ir,Sphere:rr,Raycaster:Uy,MathUtils:{DEG2RAD:(jE=Od)==null?void 0:jE.DEG2RAD,clamp:(YE=Od)==null?void 0:YE.clamp}}});hT({ThreeCameraControls:Qn});const Bp={ARROW_LEFT:37,ARROW_UP:38,ARROW_RIGHT:39,ARROW_DOWN:40},QE=new kp(Bp.ARROW_LEFT,100),eb=new kp(Bp.ARROW_RIGHT,100),tb=new kp(Bp.ARROW_UP,100),nb=new kp(Bp.ARROW_DOWN,100),Z5=K.forwardRef(({mode:r="rotate",children:e,animated:t,disabled:n,minDistance:i=1e3,maxDistance:s=5e4},o)=>{const a=K.useRef(null),l=Bn(F=>F.camera),c=Bn(F=>F.gl),u=r==="orbit",h=qe(F=>F.setPanning),p=qe(F=>F.draggingIds.length>0),m=K.useRef(0),[v,_]=K.useState(!1);Ep((F,N)=>{var I,X;(I=a.current)!=null&&I.enabled&&((X=a.current)==null||X.update(N)),u&&(a.current.azimuthAngle+=20*N*Od.DEG2RAD)},-1),K.useEffect(()=>()=>{var F;return(F=a.current)==null?void 0:F.dispose()},[]);const y=K.useCallback(()=>{var F;(F=a.current)==null||F.zoom(l.zoom/2,t)},[t,l.zoom]),g=K.useCallback(()=>{var F;(F=a.current)==null||F.zoom(-l.zoom/2,t)},[t,l.zoom]),x=K.useCallback(F=>{var N;(N=a.current)==null||N.dolly(F,t)},[t]),w=K.useCallback(F=>{var N;(N=a.current)==null||N.dolly(F,t)},[t]),E=K.useCallback(F=>{var N;u||(N=a.current)==null||N.truck(-.03*F.deltaTime,0,t)},[t,u]),b=K.useCallback(F=>{var N;u||(N=a.current)==null||N.truck(.03*F.deltaTime,0,t)},[t,u]),M=K.useCallback(F=>{var N;u||(N=a.current)==null||N.truck(0,.03*F.deltaTime,t)},[t,u]),A=K.useCallback(F=>{var N;u||(N=a.current)==null||N.truck(0,-.03*F.deltaTime,t)},[t,u]),P=K.useCallback(F=>{F.code==="Space"&&(r==="rotate"?a.current.mouseButtons.left=Qn.ACTION.TRUCK:a.current.mouseButtons.left=Qn.ACTION.ROTATE)},[r]),C=K.useCallback(F=>{F.code==="Space"&&(r==="rotate"?a.current.mouseButtons.left=Qn.ACTION.ROTATE:a.current.mouseButtons.left=Qn.ACTION.TRUCK)},[r]);K.useEffect(()=>(n||(QE.addEventListener("holding",b),eb.addEventListener("holding",E),tb.addEventListener("holding",M),nb.addEventListener("holding",A),typeof window<"u"&&(window.addEventListener("keydown",P),window.addEventListener("keyup",C))),()=>{QE.removeEventListener("holding",b),eb.removeEventListener("holding",E),tb.removeEventListener("holding",M),nb.removeEventListener("holding",A),typeof window<"u"&&(window.removeEventListener("keydown",P),window.removeEventListener("keyup",C))}),[n,P,C,A,b,E,M]),K.useEffect(()=>{n?(a.current.mouseButtons.left=Qn.ACTION.NONE,a.current.mouseButtons.middle=Qn.ACTION.NONE,a.current.mouseButtons.wheel=Qn.ACTION.NONE):(a.current.mouseButtons.left=Qn.ACTION.TRUCK,a.current.mouseButtons.middle=Qn.ACTION.TRUCK,a.current.mouseButtons.wheel=Qn.ACTION.DOLLY)},[n]),K.useEffect(()=>{const F=()=>h(!0),N=()=>h(!1),I=a.current;return I&&(I.addEventListener("control",F),I.addEventListener("controlend",N)),()=>{I&&(I.removeEventListener("control",F),I.removeEventListener("controlend",N))}},[a,h]),K.useEffect(()=>{p?(a.current.mouseButtons.left=Qn.ACTION.NONE,a.current.touches.one=Qn.ACTION.NONE):r==="rotate"?(a.current.mouseButtons.left=Qn.ACTION.ROTATE,a.current.touches.one=Qn.ACTION.TOUCH_ROTATE):(a.current.touches.one=Qn.ACTION.TOUCH_TRUCK,a.current.mouseButtons.left=Qn.ACTION.TRUCK)},[p,r]);const L=K.useMemo(()=>({controls:a.current,zoomIn:()=>y(),zoomOut:()=>g(),dollyIn:(F=1e3)=>x(F),dollyOut:(F=-1e3)=>w(F),panLeft:(F=100)=>b({deltaTime:F}),panRight:(F=100)=>E({deltaTime:F}),panDown:(F=100)=>A({deltaTime:F}),panUp:(F=100)=>M({deltaTime:F}),resetControls:F=>{var N;return(N=a.current)==null?void 0:N.reset(F)},freeze:()=>{a.current.truckSpeed&&(m.current=a.current.truckSpeed),a.current.truckSpeed=0},unFreeze:()=>a.current.truckSpeed=m.current}),[y,g,b,E,A,M,a.current]);return K.useImperativeHandle(o,()=>L),Ne.jsxs(g2.Provider,{value:L,children:[Ne.jsx("threeCameraControls",{ref:F=>{a.current=F,v||_(!0)},args:[l,c.domElement],smoothTime:.1,minDistance:i,dollyToCursor:!0,maxDistance:s}),e]})});function v2(r,e){const t=e.position.z;rl.x0&&(e==null?void 0:e.x)l.y0&&(e==null?void 0:e.y)Math.abs(n-r%Math.PI){const n=qe(_=>_.nodes),[i,s]=K.useState(!1),o=Bn(_=>_.invalidate),{controls:a}=zp(),l=Bn(_=>_.camera),c=K.useRef(!1),u=K.useCallback(async(_,y)=>{const g=(y==null?void 0:y.animated)!==void 0?y==null?void 0:y.animated:!0,x=(y==null?void 0:y.centerOnlyIfNodesNotInView)!==void 0?y==null?void 0:y.centerOnlyIfNodesNotInView:!1;if(!c.current||!x||x&&(_!=null&&_.some(w=>!ib(l,w.position)))){const{x:w,y:E,z:b}=th(_);await a.setTarget(w,E,b,g),i||s(!0),o()}},[o,a,n]),h=K.useCallback(async(_,y={animated:!0,fitOnlyIfNodesNotInView:!1})=>{const{fitOnlyIfNodesNotInView:g}=y;if(!g||g&&(_!=null&&_.some(x=>!ib(l,x.position)))){const{minX:x,maxX:w,minY:E,maxY:b,minZ:M,maxZ:A}=th(_);if(!t.includes("3d")){const{horizontalRotation:P,verticalRotation:C}=$5(a==null?void 0:a.azimuthAngle,a==null?void 0:a.polarAngle);a==null||a.rotate(P,C,!0)}await(a==null?void 0:a.zoomTo(1,y==null?void 0:y.animated)),await(a==null?void 0:a.fitToBox(new ir(new Y(x,E,M),new Y(w,b,A)),y==null?void 0:y.animated,{cover:!1,paddingLeft:pd,paddingRight:pd,paddingBottom:pd,paddingTop:pd}))}},[l,a,t]),p=K.useCallback(_=>{let y=null;return _!=null&&_.length&&(y=_.reduce((g,x)=>{const w=n.find(E=>E.id===x);if(w)g.push(w);else throw new Error(`Attempted to center ${x} but it was not found in the nodes`);return g},[])),y},[n]),m=K.useCallback((_,y)=>{const g=p(_);u(g||n,{animated:r,centerOnlyIfNodesNotInView:y==null?void 0:y.centerOnlyIfNodesNotInView})},[r,u,p,n]),v=K.useCallback(async(_,y)=>{const g=p(_);await h(g||n,{animated:r,...y})},[r,h,p,n]);return K.useLayoutEffect(()=>{async function _(){a&&(n!=null&&n.length)&&(c.current||(await u(n,{animated:!1}),await h(n,{animated:!1}),c.current=!0))}_()},[a,u,n,r,l,h]),{centerNodes:u,centerNodesById:m,fitNodesInViewById:v,isCentered:i}},Q5=({image:r,id:e,size:t,opacity:n=1,animated:i})=>{const s=K.useMemo(()=>new KM().load(r),[r]),{scale:o,spriteOpacity:a}=tr({from:{scale:[1e-5,1e-5,1e-5],spriteOpacity:0},to:{scale:[t,t,t],spriteOpacity:n},config:{...nr,duration:i?void 0:0}});return Ne.jsx(An.sprite,{userData:{id:e,type:"node"},scale:o,children:Ne.jsx(An.spriteMaterial,{attach:"material",opacity:a,fog:!0,depthTest:!1,transparent:!0,side:vn,children:Ne.jsx("primitive",{attach:"map",object:s,minFilter:fn})})})},eH=({animated:r,disabled:e,id:t,draggable:n=!1,labelFontUrl:i,contextMenu:s,onClick:o,onDoubleClick:a,onPointerOver:l,onDragged:c,onPointerOut:u,onContextMenu:h,renderNode:p,constrainDragging:m})=>{var v,_,y;const g=zp(),x=qe(ne=>ne.theme),w=qe(ne=>ne.nodes.find(we=>we.id===t)),E=qe(ne=>ne.edges),b=qe(ne=>ne.draggingIds),M=qe(ne=>ne.collapsedNodeIds),A=qe(ne=>ne.addDraggingId),P=qe(ne=>ne.removeDraggingId),C=qe(ne=>ne.setHoveredNodeId),L=qe(ne=>ne.setNodePosition),F=qe(ne=>ne.setCollapsedNodeIds),N=qe(ne=>ne.collapsedNodeIds.includes(t)),I=qe(ne=>{var we;return(we=ne.actives)==null?void 0:we.includes(t)}),X=qe(ne=>{var we;return(we=ne.selections)==null?void 0:we.includes(t)}),q=qe(ne=>{var we;return((we=ne.selections)==null?void 0:we.length)>0}),W=qe(ne=>ne.centerPosition),O=qe(ne=>ne.clusters.get(w.cluster)),k=b.includes(t),G=b.length>0,{position:B,label:D,subLabel:V,size:Z=7,labelVisible:ee=!0}=w,ie=K.useRef(null),[ue,ce]=K.useState(!1),[le,Ae]=K.useState(!1),Ee=ue||X||I,ae=q?Ee?x.node.selectedOpacity:x.node.inactiveOpacity:x.node.opacity,z=K.useMemo(()=>E.filter(we=>we.source===t).length>0||N,[E,t,N]),oe=K.useCallback(()=>{z&&F(N?M.filter(ne=>ne!==t):[...M,t])},[z,M,t,N,F]),[{nodePosition:te,labelPosition:se,subLabelPosition:$}]=tr(()=>({from:{nodePosition:W?[W.x,W.y,0]:[0,0,0],labelPosition:[0,-(Z+7),2],subLabelPosition:[0,-(Z+14),2]},to:{nodePosition:B?[B.x,B.y,Ee?B.z+1:B.z]:[0,0,0],labelPosition:[0,-(Z+7),2],subLabelPosition:[0,-(Z+14),2]},config:{...nr,duration:r&&!G?void 0:0}}),[k,B,r,Z,Ee]),Ie=p2({draggable:n,position:B,bounds:m?O==null?void 0:O.position:void 0,set:ne=>L(t,ne),onDragStart:()=>{A(t),ce(!0)},onDragEnd:()=>{P(t),c==null||c(w)}});ya(ue&&!G&&o!==void 0,"pointer"),ya(ue&&n&&!k&&o===void 0,"grab"),ya(k,"grabbing");const de=Ee||k,Se=de?x.node.activeFill:w.fill||x.node.fill,{pointerOver:Le,pointerOut:ge}=m_({disabled:e||k,onPointerOver:ne=>{g.freeze(),ce(!0),l==null||l(w,ne),C(t)},onPointerOut:ne=>{g.unFreeze(),ce(!1),u==null||u(w,ne),C(null)}}),He=K.useMemo(()=>p?p({id:t,color:Se,size:Z,active:de,opacity:ae,animated:r,selected:X,node:w}):Ne.jsx(Ne.Fragment,{children:w.icon?Ne.jsx(Q5,{id:t,image:w.icon||"",size:Z+8,opacity:ae,animated:r,color:Se,node:w,active:de,selected:X}):Ne.jsx(q5,{id:t,size:Z,opacity:ae,animated:r,color:Se,node:w,active:de,selected:X})}),[p,t,Se,Z,de,ae,r,X,w]),j=K.useMemo(()=>{var ne,we,be;return ee&&(ee||X||ue)&&D&&Ne.jsxs(Ne.Fragment,{children:[Ne.jsx(An.group,{position:se,children:Ne.jsx(nh,{text:D,fontUrl:i,opacity:ae,stroke:x.node.label.stroke,active:X||ue||k||I,color:X||ue||k||I?x.node.label.activeColor:x.node.label.color})}),V&&Ne.jsx(An.group,{position:$,children:Ne.jsx(nh,{text:V,fontUrl:i,fontSize:5,opacity:ae,stroke:(ne=x.node.subLabel)==null?void 0:ne.stroke,active:X||ue||k||I,color:X||ue||k||I?(we=x.node.subLabel)==null?void 0:we.activeColor:(be=x.node.subLabel)==null?void 0:be.color})})]})},[ue,I,k,X,D,i,se,ee,ae,V,$,x.node.label.activeColor,x.node.label.color,x.node.label.stroke,(v=x.node.subLabel)==null?void 0:v.activeColor,(_=x.node.subLabel)==null?void 0:_.color,(y=x.node.subLabel)==null?void 0:y.stroke]),H=K.useMemo(()=>le&&s&&Ne.jsx($y,{prepend:!0,center:!0,children:s({data:w,canCollapse:z,isCollapsed:N,onCollapse:oe,onClose:()=>Ae(!1)})}),[le,s,w,z,N,oe]);return Ne.jsxs(An.group,{renderOrder:1,userData:{id:t,type:"node"},ref:ie,position:te,onPointerOver:Le,onPointerOut:ge,onClick:ne=>{!e&&!k&&(o==null||o(w,{canCollapse:z,isCollapsed:N},ne))},onDoubleClick:ne=>{!e&&!k&&(a==null||a(w,ne))},onContextMenu:()=>{e||(Ae(!0),h==null||h(w,{canCollapse:z,isCollapsed:N,onCollapse:oe}))},...Ie(),children:[He,H,j]})},tH=({animated:r,color:e="#D8E6EA",length:t,opacity:n=.5,position:i,rotation:s,size:o=1,onActive:a,onContextMenu:l})=>{const c=K.useMemo(()=>new Ke(e),[e]),u=K.useRef(null),h=qe(y=>y.draggingIds.length>0),p=qe(y=>y.centerPosition),[{pos:m,arrowOpacity:v}]=tr(()=>({from:{pos:p?[p.x,p.y,p.z]:[0,0,0],arrowOpacity:0},to:{pos:[i.x,i.y,i.z],arrowOpacity:n},config:{...nr,duration:r&&!h?void 0:0}}),[r,h,n,i]),_=K.useCallback(()=>{var y;const g=new Y(0,1,0);(y=u.current)==null||y.quaternion.setFromUnitVectors(g,s)},[s,u]);return K.useEffect(()=>_(),[_]),Ne.jsxs(An.mesh,{position:m,ref:u,scale:[1,1,1],onPointerOver:()=>a(!0),onPointerOut:()=>a(!1),onPointerDown:y=>{y.nativeEvent.buttons===2&&(y.stopPropagation(),l())},children:[Ne.jsx("cylinderGeometry",{args:[0,o,t,20,1,!0],attach:"geometry"}),Ne.jsx(An.meshBasicMaterial,{attach:"material",color:c,depthTest:!1,opacity:v,transparent:!0,side:vn,fog:!0})]})},nH=({curveOffset:r,animated:e,color:t="#000",curve:n,curved:i=!1,id:s,opacity:o=1,size:a=1,onContextMenu:l,onClick:c,onPointerOver:u,onPointerOut:h})=>{const p=K.useRef(null),m=qe(x=>x.draggingIds.length>0),v=K.useMemo(()=>new Ke(t),[t]),_=qe(x=>x.centerPosition),y=K.useRef(!1),{lineOpacity:g}=tr({from:{lineOpacity:0},to:{lineOpacity:o},config:{...nr,duration:e?void 0:0}});return tr(()=>{const x=n.getPoint(0),w=n.getPoint(1);return{from:{fromVertices:y.current?[w==null?void 0:w.x,w==null?void 0:w.y,(w==null?void 0:w.z)||0]:[_==null?void 0:_.x,_==null?void 0:_.y,(_==null?void 0:_.z)||0],toVertices:[x==null?void 0:x.x,x==null?void 0:x.y,(x==null?void 0:x.z)||0]},to:{fromVertices:[x==null?void 0:x.x,x==null?void 0:x.y,(x==null?void 0:x.z)||0],toVertices:[w==null?void 0:w.x,w==null?void 0:w.y,(w==null?void 0:w.z)||0]},onChange:E=>{const{fromVertices:b,toVertices:M}=E.value,A=new Y(...b),P=new Y(...M),C=Qu(A,0,P,0,i,r);p.current.copy(new ba(C,20,a/2,5,!1))},config:{...nr,duration:e&&!m?void 0:0}}},[e,m,n,a]),K.useEffect(()=>{y.current=!0},[]),Ne.jsxs("mesh",{userData:{id:s,type:"edge"},onPointerOver:u,onPointerOut:h,onClick:c,onPointerDown:x=>{x.nativeEvent.buttons===2&&(x.stopPropagation(),l())},children:[Ne.jsx("tubeGeometry",{attach:"geometry",ref:p}),Ne.jsx(An.meshBasicMaterial,{attach:"material",opacity:g,fog:!0,transparent:!0,depthTest:!1,color:v})]})},sb=3,iH=({animated:r,arrowPlacement:e="end",contextMenu:t,disabled:n,labelPlacement:i="inline",id:s,interpolation:o,labelFontUrl:a,onContextMenu:l,onClick:c,onPointerOver:u,onPointerOut:h})=>{const p=qe(oe=>oe.theme),m=qe(oe=>oe.draggingIds.length>0),[v,_]=K.useState(!1),[y,g]=K.useState(!1),x=qe(oe=>oe.edges),w=x.find(oe=>oe.id===s),{target:E,source:b,label:M,labelVisible:A=!1,size:P=1,fill:C}=w,L=qe(oe=>oe.nodes.find(te=>te.id===b)),F=qe(oe=>oe.nodes.find(te=>te.id===E)),N=(P+p.edge.label.fontSize)/2,[I,X]=K.useMemo(()=>f2(P),[P]),{curveOffset:q,curved:W}=K.useMemo(()=>B5({edge:w,edges:x,curved:o==="curved"}),[w,x,o]),[O,k,G]=K.useMemo(()=>{const oe=eh(L),te=L.size,se=eh(F),$=F.size;let Ie=Qu(oe,te,se,$,W,q);const[de,Se]=h2(e,Ie,I);return e==="end"&&(Ie=Qu(oe,te,de,0,W,q)),[Ie,de,Se]},[L,F,W,q,e,I]),B=K.useMemo(()=>{let oe=d2(L.position,F.position,u2(N,i));if(W){const te=new Y().subVectors(oe,O.getPoint(.5));switch(i){case"above":te.y=te.y-sb;break;case"below":te.y=te.y+sb;break}oe=oe.sub(te)}return oe},[L.position,F.position,N,i,W,O]),D=qe(oe=>{var te;return(te=oe.selections)==null?void 0:te.includes(s)}),V=qe(oe=>{var te;return(te=oe.selections)==null?void 0:te.length}),Z=qe(oe=>{var te;return(te=oe.actives)==null?void 0:te.includes(s)}),ee=qe(oe=>oe.centerPosition),ie=V?D||Z?p.edge.selectedOpacity:p.edge.inactiveOpacity:p.edge.opacity,[{labelPosition:ue}]=tr(()=>({from:{labelPosition:ee?[ee.x,ee.y,ee.z]:[0,0,0]},to:{labelPosition:[B.x,B.y,B.z]},config:{...nr,duration:r&&!m?void 0:0}}),[B,r,m]),ce=K.useMemo(()=>new Eo(0,0,i==="natural"?0:Math.atan((F.position.y-L.position.y)/(F.position.x-L.position.x))),[F.position.x,F.position.y,L.position.x,L.position.y,i]);ya(v&&!m&&c!==void 0,"pointer");const{pointerOver:le,pointerOut:Ae}=m_({disabled:n,onPointerOver:oe=>{_(!0),u==null||u(w,oe)},onPointerOut:oe=>{_(!1),h==null||h(w,oe)}}),Ee=K.useMemo(()=>e!=="none"&&Ne.jsx(tH,{animated:r,color:D||v||Z?p.arrow.activeFill:C||p.arrow.fill,length:I,opacity:ie,position:k,rotation:G,size:X,onActive:_,onContextMenu:()=>{n||(g(!0),l==null||l(w))}}),[C,v,r,I,e,k,G,X,n,w,Z,D,l,ie,p.arrow.activeFill,p.arrow.fill]),ae=K.useMemo(()=>A&&M&&Ne.jsx(An.group,{position:ue,onContextMenu:()=>{n||(g(!0),l==null||l(w))},onPointerOver:le,onPointerOut:Ae,children:Ne.jsx(nh,{text:M,ellipsis:15,fontUrl:a,stroke:p.edge.label.stroke,color:D||v||Z?p.edge.label.activeColor:p.edge.label.color,opacity:ie,fontSize:p.edge.label.fontSize,rotation:ce})}),[v,n,w,Z,D,M,a,ue,ce,A,l,Ae,le,ie,p.edge.label.activeColor,p.edge.label.color,p.edge.label.fontSize,p.edge.label.stroke]),z=K.useMemo(()=>y&&t&&Ne.jsx($y,{prepend:!0,center:!0,position:B,children:t({data:w,onClose:()=>g(!1)})}),[y,t,B,w]);return Ne.jsxs("group",{children:[Ne.jsx(nH,{curveOffset:q,animated:r,color:D||v||Z?p.edge.activeFill:C||p.edge.fill,curve:O,curved:W,id:s,opacity:ie,size:P,onClick:oe=>{n||c==null||c(w,oe)},onPointerOver:le,onPointerOut:Ae,onContextMenu:()=>{n||(g(!0),l==null||l(w))}}),Ee,ae,z]})},ob=new Ws(0,0,0);function rH(r,e){const t=K.useRef(),n=qe(c=>c.theme);qe(c=>{t.current=c});const i=K.useRef(new Map);K.useRef(new Ws(0,0,0));const s=K.useRef(),o=e==="curved",a=K.useCallback(c=>{const u=[],h=i.current,{nodes:p}=t.current,m=new Map(p.map(_=>[_.id,_])),v=n.edge.label.fontSize;return r!=="none"&&!s.current&&(s.current=new La(0,1,1,20,1,!0)),c.forEach(_=>{const{target:y,source:g,size:x=1}=_,w=m.get(g),E=m.get(y);if(!w||!E)return;const b=`${w.position.x},${w.position.y},${E.position.x},${E.position.y},${x}`;if(h.has(b)){u.push(h.get(b));return}const M=eh(w),A=w.size+v,P=eh(E),C=E.size+v;let L=Qu(M,A,P,C,o),F=new ba(L,20,x/2,5,!1);if(r==="none"){u.push(F),h.set(b,F);return}const[N,I]=f2(x),X=s.current.clone();X.scale(I,N,I);const[q,W]=h2(r,L,N),O=new si;if(O.setFromUnitVectors(new Y(0,1,0),W),X.applyQuaternion(O),X.translate(q.x,q.y,q.z),r&&r==="end"){const G=Qu(M,A,q,0,o);F=new ba(G,20,x/2,5,!1)}const k=od([F,X]);u.push(k),h.set(b,k)}),u},[r,o,n.edge.label.fontSize]),l=K.useCallback((c,u)=>{const h=a(c),p=a(u);return od([p.length?od(p):ob,h.length?od(h):ob],!0)},[a]);return{getGeometries:a,getGeometry:l}}function sH(r,e,t){const n=K.useRef(r);K.useEffect(()=>{n.current=r},[r]);const i=qe(h=>h.edgeContextMenus),s=qe(K.useCallback(h=>h.setEdgeContextMenus,[])),o=K.useRef(!1),a=K.useCallback(()=>{o.current=!0},[]),l=K.useRef(!1),c=K.useCallback(()=>{l.current=!0},[]),u=K.useCallback((h,p)=>{const{onClick:m,onContextMenu:v,onPointerOver:_,onPointerOut:y}=n.current;if(m&&o.current&&!t){o.current=!1;for(const g of p)m(g)}if((e||v)&&l.current&&!t){l.current=!1;const g=new Set(i);let x=!1;for(const w of p)i.has(w.id)||(g.add(w.id),x=!0,v==null||v(w));x&&s(g)}_&&p.filter(x=>!h.includes(x)).forEach(x=>{_(x)}),y&&h.filter(x=>!p.includes(x)).forEach(x=>{y(x)})},[e,t,i,s]);return{handleClick:a,handleContextMenu:c,handleIntersections:u}}function oH(r,e){const t=K.useRef(r),n=K.useRef();K.useEffect(()=>{t.current=r;const o=r.getAttribute("position");n.current=new Float32Array(o.array.length)},[r]);const i=K.useCallback(()=>{const o=t.current.getAttribute("position");return{from:new Float32Array(o.array.length),to:o.array}},[]),s=K.useCallback(o=>{const a=n.current;a.set(o);const l=new $t(a,3,!1);t.current.setAttribute("position",l),l.needsUpdate=!0},[]);tr(()=>{if(!e)return null;const o=i();return{from:{positions:o.from},to:{positions:o.to},onChange:a=>{s(a.value.positions)},config:{...nr,duration:e?void 0:0}}},[e,i,s])}function aH(r,e,t){const[{activeOpacity:n,inactiveOpacity:i}]=tr(()=>({from:{activeOpacity:0,inactiveOpacity:0},to:{activeOpacity:e?t.edge.selectedOpacity:t.edge.opacity,inactiveOpacity:e?t.edge.inactiveOpacity:t.edge.opacity},config:{...nr,duration:r?void 0:0}}),[r,e,t]);return{activeOpacity:n,inactiveOpacity:i}}const lH=({animated:r,color:e,contextMenu:t,edge:n,labelFontUrl:i,labelPlacement:s="inline",opacity:o})=>{const a=qe(L=>L.theme),{target:l,source:c,label:u,labelVisible:h=!1,size:p=1}=n,m=qe(L=>L.nodes),[v,_]=K.useMemo(()=>[m.find(L=>L.id===c),m.find(L=>L.id===l)],[m,c,l]),y=qe(L=>L.draggingIds.length>0),g=K.useMemo(()=>(p+a.edge.label.fontSize)/2,[p,a.edge.label.fontSize]),x=K.useMemo(()=>d2(v.position,_.position,u2(g,s)),[v.position,_.position,g,s]),w=qe(L=>L.edgeContextMenus),E=qe(L=>L.setEdgeContextMenus),[{labelPosition:b}]=tr(()=>({from:{labelPosition:[0,0,0]},to:{labelPosition:[x.x,x.y,x.z]},config:{...nr,duration:r&&!y?void 0:0}}),[x,r,y]),M=K.useCallback(L=>{w.delete(L),E(new Set(w))},[w,E]),A=K.useMemo(()=>s==="natural"?new Eo(0,0,0):new Eo(0,0,Math.atan2(_.position.y-v.position.y,_.position.x-v.position.x)),[s,_.position.y,_.position.x,v.position.y,v.position.x]),P=K.useMemo(()=>({prepend:!0,center:!0,position:x}),[x]),C=K.useMemo(()=>({text:u,ellipsis:15,fontUrl:i,stroke:a.edge.label.stroke,color:e,opacity:o,fontSize:a.edge.label.fontSize,rotation:A}),[u,i,a.edge.label.stroke,e,o,a.edge.label.fontSize,A]);return Ne.jsxs("group",{children:[h&&u&&Ne.jsx(An.group,{position:b,children:Ne.jsx(nh,{...C})}),t&&w.has(n.id)&&Ne.jsx($y,{...P,children:t({data:n,onClose:()=>M(n.id)})})]})},cH=({interpolation:r="linear",arrowPlacement:e="end",labelPlacement:t="inline",animated:n,contextMenu:i,disabled:s,edges:o,labelFontUrl:a,onClick:l,onContextMenu:c,onPointerOut:u,onPointerOver:h})=>{const p=qe(B=>B.theme),{getGeometries:m,getGeometry:v}=rH(e,r),_=qe(B=>B.draggingIds),y=qe(B=>B.edgeMeshes),g=qe(B=>B.setEdgeMeshes),x=qe(B=>B.actives||[]),w=qe(B=>B.selections||[]),[E,b,M,A]=K.useMemo(()=>{const B=[],D=[],V=[],Z=[];return o.forEach(ee=>{if(_.includes(ee.source)||_.includes(ee.target)){w.includes(ee.id)||x.includes(ee.id)?V.push(ee):Z.push(ee);return}w.includes(ee.id)||x.includes(ee.id)?B.push(ee):D.push(ee)}),[B,D,V,Z]},[o,x,w,_]),P=!!w.length,C=K.useMemo(()=>v(E,b),[v,E,b]),{activeOpacity:L,inactiveOpacity:F}=aH(n,P,p);oH(C,n),K.useEffect(()=>{if(_.length===0){const D=m(o).map(V=>new _n(V));g(D)}},[m,g,o,_.length]);const N=K.useRef(new _n),I=K.useRef(new _n),X=K.useCallback(B=>{if(!B.camera)return[];const D=B.intersectObjects(y);return D.length?D.map(V=>o[y.indexOf(V.object)]):[]},[y,o]),{handleClick:q,handleContextMenu:W,handleIntersections:O}=sH({onClick:l,onContextMenu:c,onPointerOut:u,onPointerOver:h},i,s),k=K.useRef([]),G=K.useRef([]);return Ep(B=>{if(N.current.geometry=C,s)return;const D=k.current;if((_.length||_.length===0&&D!==null)&&(I.current.geometry=v(M,A)),k.current=_,_.length)return;const V=G.current,Z=X(B.raycaster);O(V,Z),Z.join()!==V.join()&&(I.current.geometry=v(Z,[])),G.current=Z}),Ne.jsxs("group",{onClick:q,onContextMenu:W,children:[Ne.jsxs("mesh",{ref:N,children:[Ne.jsx(An.meshBasicMaterial,{attach:"material-0",color:p.edge.fill,depthTest:!1,fog:!0,opacity:F,side:vn,transparent:!0}),Ne.jsx(An.meshBasicMaterial,{attach:"material-1",color:p.edge.activeFill,depthTest:!1,fog:!0,opacity:L,side:vn,transparent:!0})]}),Ne.jsxs("mesh",{ref:I,children:[Ne.jsx(An.meshBasicMaterial,{attach:"material-0",color:p.edge.fill,depthTest:!1,fog:!0,opacity:F,side:vn,transparent:!0}),Ne.jsx(An.meshBasicMaterial,{attach:"material-1",color:p.edge.activeFill,depthTest:!1,fog:!0,opacity:L,side:vn,transparent:!0})]}),o.map(B=>Ne.jsx(lH,{animated:n,contextMenu:i,color:p.edge.label.color,disabled:s,edge:B,labelFontUrl:a,labelPlacement:t},B.id))]})},uH=({outerRadius:r,innerRadius:e,padding:t,normalizedFill:n,normalizedStroke:i,opacity:s,animated:o,theme:a})=>{var l;const{opacity:c}=tr({from:{opacity:0},to:{opacity:s},config:{...nr,duration:o?void 0:0}});return Ne.jsxs(Ne.Fragment,{children:[Ne.jsxs("mesh",{children:[Ne.jsx("ringGeometry",{attach:"geometry",args:[r,0,128]}),Ne.jsx(An.meshBasicMaterial,{attach:"material",color:n,transparent:!0,depthTest:!1,opacity:(l=a.cluster)!=null&&l.fill?c:0,side:vn,fog:!0})]}),Ne.jsxs("mesh",{children:[Ne.jsx("ringGeometry",{attach:"geometry",args:[r,e+t,128]}),Ne.jsx(An.meshBasicMaterial,{attach:"material",color:i,transparent:!0,depthTest:!1,opacity:c,side:vn,fog:!0})]})]})},hH=({animated:r,position:e,padding:t=40,labelFontUrl:n,disabled:i,radius:s=2,nodes:o,label:a,onClick:l,onPointerOver:c,onPointerOut:u,draggable:h=!1,onDragged:p,onRender:m})=>{var v,_,y,g,x,w,E;const b=qe(z=>z.theme),M=Math.max(e.width,e.height)/2,A=M-s+t,[P,C]=K.useState(!1),L=qe(z=>z.centerPosition),F=qe(z=>z.nodes),N=zp(),I=qe(z=>z.draggingIds),X=I.includes(a),q=I.length>0,W=qe(z=>{var oe;return(oe=z.actives)==null?void 0:oe.some(te=>o.some(se=>se.id===te))}),O=qe(z=>z.hoveredNodeId),k=qe(z=>{var oe;return(oe=z.selections)==null?void 0:oe.some(te=>o.some(se=>se.id===te))}),B=qe(z=>{var oe;return((oe=z.selections)==null?void 0:oe.length)>0})?k||P||W?(v=b.cluster)==null?void 0:v.selectedOpacity:(_=b.cluster)==null?void 0:_.inactiveOpacity:(y=b.cluster)==null?void 0:y.opacity,D=K.useMemo(()=>{var z,oe;const te=[0,-A,2],se=(oe=(z=b.cluster)==null?void 0:z.label)==null?void 0:oe.offset;return se?[te[0]-se[0],te[1]-se[1],te[2]-se[2]]:te},[A,(x=(g=b.cluster)==null?void 0:g.label)==null?void 0:x.offset]),{circlePosition:V}=tr({from:{circlePosition:[L.x,L.y,-1]},to:{circlePosition:e?[e.x,e.y,-1]:[0,0,-1]},config:{...nr,duration:r&&!q?void 0:0}}),Z=K.useMemo(()=>{var z;return new Ke((z=b.cluster)==null?void 0:z.stroke)},[(w=b.cluster)==null?void 0:w.stroke]),ee=K.useMemo(()=>{var z;return new Ke((z=b.cluster)==null?void 0:z.fill)},[(E=b.cluster)==null?void 0:E.fill]),ie=qe(z=>z.addDraggingId),ue=qe(z=>z.removeDraggingId),ce=qe(z=>z.setClusterPosition),le=p2({draggable:h&&!O,position:{x:e.x,y:e.y,z:-1},set:z=>ce(a,z),onDragStart:()=>{ie(a),C(!0)},onDragEnd:()=>{ue(a),C(!1);const z=F.filter(oe=>oe.cluster===a);p==null||p({nodes:z,label:a})}});ya(P&&!q&&l!==void 0,"pointer"),ya(P&&h&&!X&&l===void 0,"grab"),ya(X,"grabbing");const{pointerOver:Ae,pointerOut:Ee}=m_({disabled:i,onPointerOver:z=>{C(!0),N.freeze(),c==null||c({nodes:o,label:a},z)},onPointerOut:z=>{C(!1),N.unFreeze(),u==null||u({nodes:o,label:a},z)}});return K.useMemo(()=>{var z,oe,te;return b.cluster&&Ne.jsx(An.group,{userData:{id:a,type:"cluster"},position:V,onPointerOver:Ae,onPointerOut:Ee,onClick:se=>{!i&&!X&&(l==null||l({nodes:o,label:a},se))},...le(),children:m?m({label:{position:D,text:a,opacity:B,fontUrl:n},opacity:B,outerRadius:A,innerRadius:M,padding:t,theme:b}):Ne.jsxs(Ne.Fragment,{children:[Ne.jsx(uH,{outerRadius:A,innerRadius:M,padding:t,normalizedFill:ee,normalizedStroke:Z,opacity:B,animated:r,theme:b}),((z=b.cluster)==null?void 0:z.label)&&Ne.jsx(An.group,{position:D,children:Ne.jsx(nh,{text:a,opacity:B,fontUrl:n,stroke:b.cluster.label.stroke,active:!1,color:(oe=b.cluster)==null?void 0:oe.label.color,fontSize:((te=b.cluster)==null?void 0:te.label.fontSize)??12})})]})})},[b,V,Ae,Ee,A,ee,M,t,Z,D,a,B,n,i,l,o,le,X,m,r])},fH=K.forwardRef(({onNodeClick:r,onNodeDoubleClick:e,onNodeContextMenu:t,onEdgeContextMenu:n,onEdgeClick:i,onEdgePointerOver:s,onEdgePointerOut:o,onNodePointerOver:a,onNodePointerOut:l,onClusterClick:c,onNodeDragged:u,onClusterDragged:h,onClusterPointerOver:p,onClusterPointerOut:m,contextMenu:v,animated:_,disabled:y,draggable:g,constrainDragging:x=!1,edgeLabelPosition:w,edgeArrowPosition:E,edgeInterpolation:b="linear",labelFontUrl:M,renderNode:A,onRenderCluster:P,...C},L)=>{const{layoutType:F,clusterAttribute:N}=C,I=Bn(le=>le.gl),X=Bn(le=>le.scene),q=Bn(le=>le.camera),{updateLayout:W}=j5({...C,constrainDragging:x});if(N&&!(F==="forceDirected2d"||F==="forceDirected3d"))throw new Error("Clustering is only supported for the force directed layouts.");const O=qe(le=>le.graph),k=qe(le=>le.nodes),G=qe(le=>le.edges),B=qe(le=>[...le.clusters.values()]),{centerNodesById:D,fitNodesInViewById:V,isCentered:Z}=J5({animated:_,disabled:y,layoutType:F});K.useImperativeHandle(L,()=>({centerGraph:D,fitNodesInView:V,graph:O,renderScene:()=>I.render(X,q)}),[D,V,O,I,X,q]);const ee=K.useCallback(le=>{u==null||u(le),N&&W()},[N,u,W]),ie=K.useMemo(()=>k.map(le=>Ne.jsx(eH,{id:le==null?void 0:le.id,labelFontUrl:M,draggable:g,constrainDragging:x,disabled:y,animated:_,contextMenu:v,renderNode:A,onClick:r,onDoubleClick:e,onContextMenu:t,onPointerOver:a,onPointerOut:l,onDragged:ee},le==null?void 0:le.id)),[x,_,v,y,g,M,k,r,t,e,ee,l,a,A]),ue=K.useMemo(()=>_?G.map(le=>Ne.jsx(iH,{id:le.id,disabled:y,animated:_,labelFontUrl:M,labelPlacement:w,arrowPlacement:E,interpolation:b,contextMenu:v,onClick:i,onContextMenu:n,onPointerOver:s,onPointerOut:o},le.id)):Ne.jsx(cH,{edges:G,disabled:y,animated:_,labelFontUrl:M,labelPlacement:w,arrowPlacement:E,interpolation:b,contextMenu:v,onClick:i,onContextMenu:n,onPointerOver:s,onPointerOut:o}),[_,v,y,E,b,w,G,M,i,n,o,s]),ce=K.useMemo(()=>B.map(le=>Ne.jsx(hH,{animated:_,disabled:y,draggable:g,labelFontUrl:M,onClick:c,onPointerOver:p,onPointerOut:m,onDragged:h,onRender:P,...le},le.label)),[_,B,y,g,M,c,m,p,h,P]);return Z&&Ne.jsxs(K.Fragment,{children:[ue,ie,ce]})}),dH={canvas:{background:"#1E2026"},node:{fill:"#7A8C9E",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.2,label:{stroke:"#1E2026",color:"#ACBAC7",activeColor:"#1DE9AC"},subLabel:{stroke:"#1E2026",color:"#ACBAC7",activeColor:"#1DE9AC"}},lasso:{border:"1px solid #55aaff",background:"rgba(75, 160, 255, 0.1)"},ring:{fill:"#54616D",activeFill:"#1DE9AC"},edge:{fill:"#474B56",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#1E2026",color:"#ACBAC7",activeColor:"#1DE9AC",fontSize:6}},arrow:{fill:"#474B56",activeFill:"#1DE9AC"},cluster:{stroke:"#474B56",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#1E2026",color:"#ACBAC7"}}},pH={canvas:{background:"#fff"},node:{fill:"#7CA0AB",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.2,label:{color:"#2A6475",stroke:"#fff",activeColor:"#1DE9AC"},subLabel:{color:"#ddd",stroke:"transparent",activeColor:"#1DE9AC"}},lasso:{border:"1px solid #55aaff",background:"rgba(75, 160, 255, 0.1)"},ring:{fill:"#D8E6EA",activeFill:"#1DE9AC"},edge:{fill:"#D8E6EA",activeFill:"#1DE9AC",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#fff",color:"#2A6475",activeColor:"#1DE9AC",fontSize:6}},arrow:{fill:"#D8E6EA",activeFill:"#1DE9AC"},cluster:{stroke:"#D8E6EA",opacity:1,selectedOpacity:1,inactiveOpacity:.1,label:{stroke:"#fff",color:"#2A6475"}}};function md(r,e,t){const{offsetX:n,offsetY:i}=r,{width:s,height:o}=t;e.set(n/s*2-1,-(i/o)*2+1)}function mH(r){const e=document.createElement("div");return e.style.pointerEvents="none",e.style.border=r.lasso.border,e.style.backgroundColor=r.lasso.background,e.style.position="fixed",e}const gH=({children:r,type:e="none",onLasso:t,onLassoEnd:n,disabled:i})=>{var s;const o=qe(I=>I.theme),a=Bn(I=>I.camera),l=Bn(I=>I.gl),c=Bn(I=>I.setEvents),u=Bn(I=>I.size),h=Bn(I=>I.get),p=Bn(I=>I.scene),m=zp(),v=qe(I=>I.actives),_=qe(I=>I.setActives),y=qe(I=>I.edges),g=qe(I=>I.edgeMeshes),x=K.useRef(!1),w=K.useRef(null),E=K.useRef(null),b=K.useRef(mH(o)),M=K.useRef(null),A=K.useRef(!1),P=K.useRef(h().events.enabled),C=K.useRef((s=m.controls)==null?void 0:s.enabled);K.useEffect(()=>{x.current&&(t==null||t(v)),x.current=!0},[v,t]);const L=K.useCallback(I=>{if(A.current){const[X,q,W]=M.current;W.x=Math.max(X.x,I.clientX),W.y=Math.max(X.y,I.clientY),q.x=Math.min(X.x,I.clientX),q.y=Math.min(X.y,I.clientY),b.current.style.left=`${q.x}px`,b.current.style.top=`${q.y}px`,b.current.style.width=`${W.x-q.x}px`,b.current.style.height=`${W.y-q.y}px`,md(I,w.current.endPoint,u),md(I,E.current.endPoint,u);const O=[],k=E.current.select().sort(B=>B.uuid).map(B=>y[g.indexOf(B)].id);O.push(...k);const G=w.current.select().sort(B=>B.uuid).filter(B=>{var D,V;return B.isMesh&&((D=B.userData)==null?void 0:D.id)&&(((V=B.userData)==null?void 0:V.type)===e||e==="all")}).map(B=>B.userData.id);O.push(...G),requestAnimationFrame(()=>{_(O)}),document.addEventListener("pointermove",L,{passive:!0,capture:!0,once:!0})}},[y,g,_,u,e]),F=K.useCallback(()=>{var I;A.current&&(c({enabled:P.current}),A.current=!1,(I=b.current.parentElement)==null||I.removeChild(b.current),m.controls.enabled=C.current,n==null||n(v),document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",F))},[c,m.controls,n,v,L]),N=K.useCallback(I=>{var X,q;if(I.shiftKey){P.current=h().events.enabled,C.current=(X=m.controls)==null?void 0:X.enabled,w.current=new wE(a,p);const W=new ku;g.length&&W.add(...g),E.current=new wE(a,W),M.current=[new De,new De,new De];const[O]=M.current;m.controls.enabled=!1,c({enabled:!1}),A.current=!0,(q=l.domElement.parentElement)==null||q.appendChild(b.current),b.current.style.left=`${I.clientX}px`,b.current.style.top=`${I.clientY}px`,b.current.style.width="0px",b.current.style.height="0px",O.x=I.clientX,O.y=I.clientY,md(I,w.current.startPoint,u),md(I,E.current.startPoint,u),document.addEventListener("pointermove",L,{passive:!0,capture:!0,once:!0}),document.addEventListener("pointerup",F,{passive:!0})}},[a,m.controls,g,h,l.domElement.parentElement,L,F,p,c,u]);return K.useEffect(()=>{if(!(i||e==="none"))return typeof window<"u"&&(document.addEventListener("pointerdown",N,{passive:!0}),document.addEventListener("pointermove",L,{passive:!0}),document.addEventListener("pointerup",F,{passive:!0})),()=>{typeof window<"u"&&(document.removeEventListener("pointerdown",N),document.removeEventListener("pointermove",L),document.removeEventListener("pointerup",F))}},[e,i,N,L,F]),Ne.jsx("group",{children:r})},vH="_canvas_670zp_1",yH={canvas:vH},_H={alpha:!0,antialias:!0},xH={position:[0,0,1e3],near:5,far:5e4,fov:10},wH=K.forwardRef(({cameraMode:r="pan",layoutType:e="forceDirected2d",sizingType:t="default",labelType:n="auto",theme:i=pH,animated:s=!0,defaultNodeSize:o=7,minNodeSize:a=5,maxNodeSize:l=15,lassoType:c="none",glOptions:u={},edges:h,children:p,nodes:m,minDistance:v,maxDistance:_,onCanvasClick:y,disabled:g,onLasso:x,onLassoEnd:w,...E},b)=>{var M,A;const P=K.useRef(null),C=K.useRef(null),L=K.useRef(null);K.useImperativeHandle(b,()=>({centerGraph:(W,O)=>{var k;return(k=P.current)==null?void 0:k.centerGraph(W,O)},fitNodesInView:(W,O)=>{var k;return(k=P.current)==null?void 0:k.fitNodesInView(W,O)},zoomIn:()=>{var W;return(W=C.current)==null?void 0:W.zoomIn()},zoomOut:()=>{var W;return(W=C.current)==null?void 0:W.zoomOut()},dollyIn:W=>{var O;return(O=C.current)==null?void 0:O.dollyIn(W)},dollyOut:W=>{var O;return(O=C.current)==null?void 0:O.dollyOut(W)},panLeft:()=>{var W;return(W=C.current)==null?void 0:W.panLeft()},panRight:()=>{var W;return(W=C.current)==null?void 0:W.panRight()},panDown:()=>{var W;return(W=C.current)==null?void 0:W.panDown()},panUp:()=>{var W;return(W=C.current)==null?void 0:W.panUp()},resetControls:W=>{var O;return(O=C.current)==null?void 0:O.resetControls(W)},getControls:()=>{var W;return(W=C.current)==null?void 0:W.controls},getGraph:()=>{var W;return(W=P.current)==null?void 0:W.graph},exportCanvas:()=>(P.current.renderScene(),L.current.toDataURL()),freeze:()=>{var W;return(W=C.current)==null?void 0:W.freeze()},unFreeze:()=>{var W;return(W=C.current)==null?void 0:W.unFreeze()}}));const{selections:F,actives:N,collapsedNodeIds:I}=E,X=h.length+m.length>400?!1:s,q=K.useMemo(()=>({...u,..._H}),[u]);return Ne.jsx("div",{className:yH.canvas,children:Ne.jsx(NO,{legacy:!0,linear:!0,ref:L,flat:!0,gl:q,camera:xH,onPointerMissed:y,children:Ne.jsxs(V5,{createStore:()=>W5({selections:F,actives:N,theme:i,collapsedNodeIds:I}),children:[((M=i.canvas)==null?void 0:M.background)&&Ne.jsx("color",{attach:"background",args:[i.canvas.background]}),Ne.jsx("ambientLight",{intensity:1}),p,((A=i.canvas)==null?void 0:A.fog)&&Ne.jsx("fog",{attach:"fog",args:[i.canvas.fog,4e3,9e3]}),Ne.jsx(Z5,{mode:r,ref:C,disabled:g,minDistance:v,maxDistance:_,animated:s,children:Ne.jsx(gH,{disabled:g,type:c,onLasso:x,onLassoEnd:w,children:Ne.jsx(K.Suspense,{children:Ne.jsx(fH,{ref:P,disabled:g,animated:X,edges:h,nodes:m,layoutType:e,sizingType:t,labelType:n,defaultNodeSize:o,minNodeSize:a,maxNodeSize:l,...E})})})})]})})})}),gd={user:"#22d3ee",instruction:"#a78bfa",stable:"#6366f1",versioned:"#fbbf24",ephemeral:"#f472b6"},SH={user:"User",instruction:"Regel",stable:"Fakt",versioned:"Version",ephemeral:"Temporär"},P0=new Set(["auto","agent","hermes"]);function PH({data:r,onDelete:e}){const[t,n]=K.useState(null),i=K.useMemo(()=>{const c={};return r.edges.forEach(u=>{c[u.source]=(c[u.source]||0)+1,c[u.target]=(c[u.target]||0)+1}),c},[r]),s=K.useMemo(()=>r.nodes.map(c=>({id:c.id,label:c.content.length>26?c.content.slice(0,25)+"…":c.content,fill:gd[c.category]||"#64748b",size:6+Math.min(i[c.id]||0,6)*2})),[r,i]),o=K.useMemo(()=>r.edges.map(c=>({id:`${c.source}->${c.target}`,source:c.source,target:c.target,size:.4+c.weight})),[r]),a=t?r.nodes.find(c=>c.id===t)??null:null,l=K.useMemo(()=>{if(!t)return[];const c=new Set;return r.edges.forEach(u=>{u.source===t&&c.add(u.target),u.target===t&&c.add(u.source)}),r.nodes.filter(u=>c.has(u.id))},[t,r]);return r.nodes.length?Ne.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_280px] gap-3",children:[Ne.jsx("div",{className:"relative h-[480px] rounded-2xl border border-border/60 bg-[#070a0f] overflow-hidden",children:Ne.jsx(wH,{nodes:s,edges:o,theme:dH,layoutType:"forceDirected2d",labelType:"nodes",edgeArrowPosition:"none",draggable:!0,onNodeClick:c=>n(c.id),onCanvasClick:()=>n(null)})}),Ne.jsx("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 min-h-[480px]",children:a?Ne.jsxs(Ne.Fragment,{children:[Ne.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[Ne.jsx("span",{className:"w-3 h-3 rounded-full",style:{background:gd[a.category],boxShadow:`0 0 0 2px ${P0.has(a.source)?"#34d399":"#475569"}`}}),Ne.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",style:{color:gd[a.category]},children:SH[a.category]||a.category}),Ne.jsxs("span",{className:`ml-auto text-[10px] font-mono flex items-center gap-1 ${P0.has(a.source)?"text-emerald-400":"text-muted-foreground/70"}`,children:[P0.has(a.source)&&Ne.jsx(K2,{className:"h-2.5 w-2.5"}),a.source]})]}),Ne.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 break-words",children:a.content}),Ne.jsxs("div",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground/70 mb-2 flex items-center gap-1",children:[Ne.jsx(Vx,{className:"h-3 w-3"})," verwandte Fakten"]}),Ne.jsx("div",{className:"flex flex-col gap-1.5 mb-4",children:l.length?l.map(c=>Ne.jsxs("button",{onClick:()=>n(c.id),className:"flex items-center gap-2 text-[11px] text-muted-foreground hover:text-foreground text-left transition-colors",children:[Ne.jsx("span",{className:"w-1.5 h-1.5 rounded-full shrink-0",style:{background:gd[c.category]}}),Ne.jsx("span",{className:"truncate",children:c.content})]},c.id)):Ne.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"—"})}),Ne.jsxs("button",{onClick:()=>{e(a.id),n(null)},className:"flex items-center gap-1.5 text-[11px] text-red-400 border border-red-500/20 rounded-lg px-2.5 py-1.5 hover:bg-red-500/5 transition-all",children:[Ne.jsx($2,{className:"h-3.5 w-3.5"})," vergessen"]})]}):Ne.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center text-muted-foreground/70 gap-2 pt-24",children:[Ne.jsx(Vx,{className:"h-6 w-6"}),Ne.jsx("div",{className:"text-xs max-w-[180px] leading-relaxed",children:"Einen Knoten wählen, um den Fakt und seine semantischen Nachbarn zu sehen."})]})})]}):Ne.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Noch keine Fakten — der Graph füllt sich, sobald Hermes lernt oder du Einträge anlegst."})}export{PH as GraphView}; diff --git a/frontend/dist/assets/index-DEncQp-z.css b/frontend/dist/assets/index-DEncQp-z.css new file mode 100644 index 0000000..f94e8c6 --- /dev/null +++ b/frontend/dist/assets/index-DEncQp-z.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:"JetBrains Mono", ui-monospace, SFMono-Regular, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.visible\!{visibility:visible!important}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.static\!{position:static!important}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-\[-10\%\]{top:-10%}.top-\[30\%\]{top:30%}.right-0{right:0}.right-\[-10\%\]{right:-10%}.right-\[20\%\]{right:20%}.bottom-\[-10\%\]{bottom:-10%}.left-3{left:calc(var(--spacing) * 3)}.left-\[-10\%\]{left:-10%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.-z-50{z-index:-50}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[99\]{z-index:99}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.hidden\!{display:none!important}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-44{height:calc(var(--spacing) * 44)}.h-96{height:calc(var(--spacing) * 96)}.h-\[40\%\]{height:40%}.h-\[50\%\]{height:50%}.h-\[150px\]{height:150px}.h-\[480px\]{height:480px}.h-full{height:100%}.max-h-20{max-height:calc(var(--spacing) * 20)}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-\[68vh\]{min-height:68vh}.min-h-\[90px\]{min-height:90px}.min-h-\[300px\]{min-height:300px}.min-h-\[480px\]{min-height:480px}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-5{width:calc(var(--spacing) * 5)}.w-5\.5{width:calc(var(--spacing) * 5.5)}.w-6{width:calc(var(--spacing) * 6)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-16{width:calc(var(--spacing) * 16)}.w-28{width:calc(var(--spacing) * 28)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-60{width:calc(var(--spacing) * 60)}.w-\[40\%\]{width:40%}.w-\[50\%\]{width:50%}.w-full{width:100%}.max-w-\[120px\]{max-width:120px}.max-w-\[150px\]{max-width:150px}.max-w-\[180px\]{max-width:180px}.max-w-\[200px\]{max-width:200px}.max-w-\[250px\]{max-width:250px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-fit{max-width:fit-content}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.scrollbar-thin{scrollbar-width:thin}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.border-amber-500\/25{border-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/25{border-color:color-mix(in oklab,var(--color-amber-500) 25%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500) 30%,transparent)}}.border-border,.border-border\/10{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/10{border-color:color-mix(in oklab,hsl(var(--border)) 10%,transparent)}}.border-border\/20{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/20{border-color:color-mix(in oklab,hsl(var(--border)) 20%,transparent)}}.border-border\/30{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,hsl(var(--border)) 30%,transparent)}}.border-border\/40{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/40{border-color:color-mix(in oklab,hsl(var(--border)) 40%,transparent)}}.border-border\/50{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,hsl(var(--border)) 50%,transparent)}}.border-border\/60{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/60{border-color:color-mix(in oklab,hsl(var(--border)) 60%,transparent)}}.border-border\/70{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/70{border-color:color-mix(in oklab,hsl(var(--border)) 70%,transparent)}}.border-border\/80{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/80{border-color:color-mix(in oklab,hsl(var(--border)) 80%,transparent)}}.border-cyan-500\/20{border-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/20{border-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.border-cyan-500\/25{border-color:#00b7d740}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/25{border-color:color-mix(in oklab,var(--color-cyan-500) 25%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500) 30%,transparent)}}.border-emerald-500\/10{border-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/10{border-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.border-emerald-500\/15{border-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/15{border-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/40{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-indigo-500\/25{border-color:#625fff40}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/25{border-color:color-mix(in oklab,var(--color-indigo-500) 25%,transparent)}}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.border-indigo-500\/40{border-color:#625fff66}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/40{border-color:color-mix(in oklab,var(--color-indigo-500) 40%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-pink-500\/25{border-color:#f6339a40}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/25{border-color:color-mix(in oklab,var(--color-pink-500) 25%,transparent)}}.border-pink-500\/30{border-color:#f6339a4d}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/30{border-color:color-mix(in oklab,var(--color-pink-500) 30%,transparent)}}.border-primary,.border-primary\/20{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/20{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.border-primary\/30{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/30{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.border-primary\/40{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/40{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.border-primary\/45{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.border-primary\/50{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/50{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.border-red-500\/25{border-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.border-red-500\/25{border-color:color-mix(in oklab,var(--color-red-500) 25%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab,red,red)){.border-red-500\/40{border-color:color-mix(in oklab,var(--color-red-500) 40%,transparent)}}.border-slate-500\/25{border-color:#62748e40}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/25{border-color:color-mix(in oklab,var(--color-slate-500) 25%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-teal-500\/25{border-color:#00baa740}@supports (color:color-mix(in lab,red,red)){.border-teal-500\/25{border-color:color-mix(in oklab,var(--color-teal-500) 25%,transparent)}}.border-transparent{border-color:#0000}.border-violet-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/20{border-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.border-violet-500\/25{border-color:#8d54ff40}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/25{border-color:color-mix(in oklab,var(--color-violet-500) 25%,transparent)}}.border-violet-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/30{border-color:color-mix(in oklab,var(--color-violet-500) 30%,transparent)}}.border-l-amber-500\/80{border-left-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.border-l-amber-500\/80{border-left-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.border-l-cyan-500\/80{border-left-color:#00b7d7cc}@supports (color:color-mix(in lab,red,red)){.border-l-cyan-500\/80{border-left-color:color-mix(in oklab,var(--color-cyan-500) 80%,transparent)}}.border-l-indigo-500\/80{border-left-color:#625fffcc}@supports (color:color-mix(in lab,red,red)){.border-l-indigo-500\/80{border-left-color:color-mix(in oklab,var(--color-indigo-500) 80%,transparent)}}.border-l-muted{border-left-color:hsl(var(--muted))}.border-l-pink-500\/80{border-left-color:#f6339acc}@supports (color:color-mix(in lab,red,red)){.border-l-pink-500\/80{border-left-color:color-mix(in oklab,var(--color-pink-500) 80%,transparent)}}.border-l-violet-500\/80{border-left-color:#8d54ffcc}@supports (color:color-mix(in lab,red,red)){.border-l-violet-500\/80{border-left-color:color-mix(in oklab,var(--color-violet-500) 80%,transparent)}}.bg-\[\#070a0f\]{background-color:#070a0f}.bg-\[hsl\(224\,30\%\,6\%\)\]{background-color:#0b0d14}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500) 5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-500\/80{background-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/80{background-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.bg-background\/10{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/10{background-color:color-mix(in oklab,hsl(var(--background)) 10%,transparent)}}.bg-background\/20{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/20{background-color:color-mix(in oklab,hsl(var(--background)) 20%,transparent)}}.bg-background\/25{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/25{background-color:color-mix(in oklab,hsl(var(--background)) 25%,transparent)}}.bg-background\/30{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/30{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.bg-background\/35{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/35{background-color:color-mix(in oklab,hsl(var(--background)) 35%,transparent)}}.bg-background\/40{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/40{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.bg-background\/50{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/50{background-color:color-mix(in oklab,hsl(var(--background)) 50%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/25{background-color:#00000040}@supports (color:color-mix(in lab,red,red)){.bg-black\/25{background-color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-card,.bg-card\/10{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/10{background-color:color-mix(in oklab,hsl(var(--card)) 10%,transparent)}}.bg-card\/20{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,hsl(var(--card)) 20%,transparent)}}.bg-card\/30{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/30{background-color:color-mix(in oklab,hsl(var(--card)) 30%,transparent)}}.bg-card\/45{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/45{background-color:color-mix(in oklab,hsl(var(--card)) 45%,transparent)}}.bg-card\/50{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,hsl(var(--card)) 50%,transparent)}}.bg-card\/75{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/75{background-color:color-mix(in oklab,hsl(var(--card)) 75%,transparent)}}.bg-card\/85{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/85{background-color:color-mix(in oklab,hsl(var(--card)) 85%,transparent)}}.bg-card\/90{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/90{background-color:color-mix(in oklab,hsl(var(--card)) 90%,transparent)}}.bg-cyan-400{background-color:var(--color-cyan-400)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/10{background-color:color-mix(in oklab,var(--color-cyan-500) 10%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/5{background-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/5{background-color:color-mix(in oklab,var(--color-emerald-500) 5%,transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-500\/80{background-color:#00bb7fcc}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/80{background-color:color-mix(in oklab,var(--color-emerald-500) 80%,transparent)}}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-muted,.bg-muted\/10{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/10{background-color:color-mix(in oklab,hsl(var(--muted)) 10%,transparent)}}.bg-muted\/20{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,hsl(var(--muted)) 20%,transparent)}}.bg-muted\/40{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,hsl(var(--muted)) 40%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-pink-500\/10{background-color:#f6339a1a}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/10{background-color:color-mix(in oklab,var(--color-pink-500) 10%,transparent)}}.bg-pink-500\/15{background-color:#f6339a26}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/15{background-color:color-mix(in oklab,var(--color-pink-500) 15%,transparent)}}.bg-popover,.bg-popover\/95{background-color:hsl(var(--popover))}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,hsl(var(--popover)) 95%,transparent)}}.bg-primary,.bg-primary\/5{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/5{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.bg-primary\/10{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.bg-primary\/15{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/15{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.bg-primary\/20{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.bg-purple-500\/15{background-color:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/15{background-color:color-mix(in oklab,var(--color-purple-500) 15%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/5{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/5{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-red-500\/80{background-color:#fb2c36cc}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/80{background-color:color-mix(in oklab,var(--color-red-500) 80%,transparent)}}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-teal-500\/15{background-color:#00baa726}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/15{background-color:color-mix(in oklab,var(--color-teal-500) 15%,transparent)}}.bg-transparent{background-color:#0000}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-cyan-500{--tw-gradient-from:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-foreground{--tw-gradient-from:hsl(var(--foreground));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500\/20{--tw-gradient-from:#00baa733}@supports (color:color-mix(in lab,red,red)){.from-teal-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-teal-500) 20%, transparent)}}.from-teal-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-foreground{--tw-gradient-via:hsl(var(--foreground));--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500\/15{--tw-gradient-via:#625fff26}@supports (color:color-mix(in lab,red,red)){.via-indigo-500\/15{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-500) 15%, transparent)}}.via-indigo-500\/15{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-blue-500{--tw-gradient-to:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-500{--tw-gradient-to:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary{--tw-gradient-to:hsl(var(--primary));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/20{--tw-gradient-to:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.to-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-sky-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-repeat{background-repeat:repeat}.fill-amber-400\/20{fill:#fcbb0033}@supports (color:color-mix(in lab,red,red)){.fill-amber-400\/20{fill:color-mix(in oklab,var(--color-amber-400) 20%,transparent)}}.fill-primary\/20{fill:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.fill-primary\/20{fill:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-24{padding-top:calc(var(--spacing) * 24)}.pt-\[12vh\]{padding-top:12vh}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-px{padding-bottom:1px}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif}.font-space{font-family:Space Grotesk,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/80{color:#fcbb00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/80{color:color-mix(in oklab,var(--color-amber-400) 80%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400) 90%,transparent)}}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-200\/90{color:#a2f4fde6}@supports (color:color-mix(in lab,red,red)){.text-cyan-200\/90{color:color-mix(in oklab,var(--color-cyan-200) 90%,transparent)}}.text-cyan-300{color:var(--color-cyan-300)}.text-cyan-300\/90{color:#53eafde6}@supports (color:color-mix(in lab,red,red)){.text-cyan-300\/90{color:color-mix(in oklab,var(--color-cyan-300) 90%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-400\/90{color:#00d294e6}@supports (color:color-mix(in lab,red,red)){.text-emerald-400\/90{color:color-mix(in oklab,var(--color-emerald-400) 90%,transparent)}}.text-foreground,.text-foreground\/90{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/90{color:color-mix(in oklab,hsl(var(--foreground)) 90%,transparent)}}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-400{color:var(--color-indigo-400)}.text-muted-foreground,.text-muted-foreground\/50{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.text-muted-foreground\/55{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/55{color:color-mix(in oklab,hsl(var(--muted-foreground)) 55%,transparent)}}.text-muted-foreground\/60{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,hsl(var(--muted-foreground)) 60%,transparent)}}.text-muted-foreground\/70{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,hsl(var(--muted-foreground)) 70%,transparent)}}.text-muted-foreground\/75{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/75{color:color-mix(in oklab,hsl(var(--muted-foreground)) 75%,transparent)}}.text-muted-foreground\/80{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/80{color:color-mix(in oklab,hsl(var(--muted-foreground)) 80%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-pink-400{color:var(--color-pink-400)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/70{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/70{color:color-mix(in oklab,hsl(var(--primary)) 70%,transparent)}}.text-primary\/80{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/80{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.text-purple-300{color:var(--color-purple-300)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-400\/80{color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.text-red-400\/80{color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-slate-300{color:var(--color-slate-300)}.text-teal-400{color:var(--color-teal-400)}.text-transparent{color:#0000}.text-violet-400{color:var(--color-violet-400)}.text-white{color:var(--color-white)}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-amber-500\/10{--tw-shadow-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.shadow-amber-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/5{--tw-shadow-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.shadow-black\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/10{--tw-shadow-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.shadow-black\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/15{--tw-shadow-color:#00000026}@supports (color:color-mix(in lab,red,red)){.shadow-black\/15{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 15%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/20{--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.shadow-black\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/25{--tw-shadow-color:#00000040}@supports (color:color-mix(in lab,red,red)){.shadow-black\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/5{--tw-shadow-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/10{--tw-shadow-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/5{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/10{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/20{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-red-500\/10{--tw-shadow-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.shadow-red-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-red-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-black\/40{--tw-ring-color:#0006}@supports (color:color-mix(in lab,red,red)){.ring-black\/40{--tw-ring-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[130px\]{--tw-blur:blur(130px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.filter\!{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.select-text{-webkit-user-select:text;user-select:text}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:scale-105:is(:where(.group):hover *){--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:text-primary:is(:where(.group):hover *){color:hsl(var(--primary))}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}@media(hover:hover){.hover\:border-primary:hover,.hover\:border-primary\/20:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/20:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:border-primary\/30:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/30:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.hover\:border-primary\/40:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/40:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.hover\:border-primary\/45:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/45:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/50:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.hover\:bg-amber-500\/15:hover{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/15:hover{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.hover\:bg-background\/30:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/30:hover{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.hover\:bg-background\/40:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/40:hover{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.hover\:bg-background\/60:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,hsl(var(--background)) 60%,transparent)}}.hover\:bg-background\/80:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/80:hover{background-color:color-mix(in oklab,hsl(var(--background)) 80%,transparent)}}.hover\:bg-card\/30:hover{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/30:hover{background-color:color-mix(in oklab,hsl(var(--card)) 30%,transparent)}}.hover\:bg-card\/70:hover{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/70:hover{background-color:color-mix(in oklab,hsl(var(--card)) 70%,transparent)}}.hover\:bg-emerald-500\/10:hover{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/10:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.hover\:bg-emerald-500\/15:hover{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/15:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.hover\:bg-indigo-500\/15:hover{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-500\/15:hover{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.hover\:bg-primary\/5:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/10:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.hover\:bg-primary\/15:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/15:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.hover\:bg-primary\/20:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 90%,transparent)}}.hover\:bg-primary\/95:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/95:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 95%,transparent)}}.hover\:bg-red-400:hover{background-color:var(--color-red-400)}.hover\:bg-red-500\/5:hover{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/5:hover{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-emerald-300:hover{color:var(--color-emerald-300)}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary\/80:hover{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-90:hover{opacity:.9}}.focus\:border-primary:focus{border-color:hsl(var(--primary))}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-primary:focus,.focus\:ring-primary\/50:focus{--tw-ring-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/50:focus{--tw-ring-color:color-mix(in oklab, hsl(var(--primary)) 50%, transparent)}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:w-\[500px\]{width:500px}.sm\:max-w-\[400px\]{max-width:400px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:self-auto{align-self:auto}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}.lg\:grid-cols-\[1fr_280px\]{grid-template-columns:1fr 280px}}}:root{--background:224 30% 6%;--foreground:210 20% 92%;--card:224 25% 10%;--card-foreground:210 20% 94%;--popover:224 28% 9%;--popover-foreground:210 20% 94%;--primary:172 72% 50%;--primary-foreground:224 47% 8%;--muted:220 16% 14%;--muted-foreground:215 14% 64%;--accent:220 16% 16%;--accent-foreground:210 20% 94%;--border:222 18% 23%;--input:222 18% 23%;--ring:172 72% 50%;--radius:.75rem}.light{--background:0 0% 100%;--foreground:222 22% 12%;--card:0 0% 100%;--card-foreground:222 22% 12%;--popover:0 0% 100%;--popover-foreground:222 22% 12%;--primary:172 70% 38%;--primary-foreground:0 0% 100%;--muted:220 14% 95%;--muted-foreground:220 9% 42%;--accent:220 14% 94%;--accent-foreground:222 22% 12%;--border:220 13% 88%;--input:220 13% 88%;--ring:172 66% 50%}@keyframes aurora{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}.animate-aurora{background-size:200% 200%;animation:25s infinite aurora}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:9999px}*{border-color:hsl(var(--border) / .85);outline-color:hsl(var(--primary) / .5)}html,body,#root{height:100%;overflow:hidden}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:var(--font-sans);-webkit-font-smoothing:antialiased;margin:0}@keyframes flow-cyan{0%{stroke-dasharray:6 3;stroke-dashoffset:18px}to{stroke-dasharray:6 3;stroke-dashoffset:0}}.animate-flow-cyan{animation:1.2s linear infinite flow-cyan}.rounded-2xl.border.bg-card\/45{position:relative;overflow:hidden;background-color:hsl(var(--card) / .85)!important;border-color:hsl(var(--border) / .95)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;box-shadow:0 10px 30px -15px #00000073,inset 0 1px #ffffff0d!important}.rounded-2xl.border.bg-card\/45:before{content:"";background:linear-gradient(90deg,hsl(var(--primary)),#6366f1,#a855f7);opacity:.75;height:3.5px;position:absolute;top:0;left:0;right:0;transition:opacity .3s!important}.rounded-2xl.border.bg-card\/45:hover{transform:translateY(-3px);background-color:hsl(var(--card) / .92)!important;border-color:hsl(var(--primary) / .35)!important;box-shadow:0 20px 40px -20px #000000a6,0 0 18px 2px hsl(var(--primary) / .05)!important}.rounded-2xl.border.bg-card\/45:hover:before{opacity:1}.rounded-xl.border.bg-card\/45{background-color:hsl(var(--card) / .88)!important;border-color:hsl(var(--border) / .9)!important;transition:all .2s!important}.rounded-xl.border.bg-card\/45:hover{background-color:hsl(var(--card) / .95)!important;border-color:hsl(var(--primary) / .3)!important}aside nav button[class*="bg-primary/15"]:not([class*=justify-center]){background:linear-gradient(90deg,hsl(var(--primary) / .18),#6366f11f)!important;color:hsl(var(--primary))!important;border-left:3.5px solid hsl(var(--primary))!important;border-radius:0 var(--radius) var(--radius) 0!important;padding-left:calc(.75rem - 3.5px)!important;box-shadow:inset 0 1px #ffffff05!important}aside nav button[class*="bg-primary/15"][class*=justify-center]{background:hsl(var(--primary) / .18)!important;color:hsl(var(--primary))!important;box-shadow:0 0 12px 1px hsl(var(--primary) / .1)!important;border:1px solid hsl(var(--primary) / .3)!important}::-webkit-scrollbar-thumb{border-radius:9999px;background:hsl(var(--primary) / .25)!important}::-webkit-scrollbar-thumb:hover{background:hsl(var(--primary) / .5)!important}input:focus,textarea:focus,select:focus{outline:none;border-color:hsl(var(--primary))!important;box-shadow:0 0 0 2px hsl(var(--primary) / .15)!important}@media(min-width:1440px){html{font-size:16.5px}}@media(min-width:1920px){html{font-size:17.5px}}@media(min-width:2560px){html{font-size:19px}}@media(min-width:3440px){html{font-size:20px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} diff --git a/frontend/dist/assets/index-BohGf1r3.js b/frontend/dist/assets/index-DuvhfsJu.js similarity index 59% rename from frontend/dist/assets/index-BohGf1r3.js rename to frontend/dist/assets/index-DuvhfsJu.js index c40297a..8c3b9ff 100644 --- a/frontend/dist/assets/index-BohGf1r3.js +++ b/frontend/dist/assets/index-DuvhfsJu.js @@ -1,4 +1,4 @@ -var eM=Object.defineProperty;var C1=e=>{throw TypeError(e)};var tM=(e,t,r)=>t in e?eM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var yd=(e,t,r)=>tM(e,typeof t!="symbol"?t+"":t,r),Im=(e,t,r)=>t.has(e)||C1("Cannot "+r);var L=(e,t,r)=>(Im(e,t,"read from private field"),r?r.call(e):t.get(e)),Te=(e,t,r)=>t.has(e)?C1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ye=(e,t,r,n)=>(Im(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Fe=(e,t,r)=>(Im(e,t,"access private method"),r);var xd=(e,t,r,n)=>({set _(a){ye(e,t,a,r)},get _(){return L(e,t,n)}});function rM(e,t){for(var r=0;rn[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(a){if(a.ep)return;a.ep=!0;const o=r(a);fetch(a.href,o)}})();function ty(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},Kl={},Dm={exports:{}},Le={};/** +var tM=Object.defineProperty;var C1=e=>{throw TypeError(e)};var rM=(e,t,r)=>t in e?tM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Kl=(e,t,r)=>rM(e,typeof t!="symbol"?t+"":t,r),Im=(e,t,r)=>t.has(e)||C1("Cannot "+r);var z=(e,t,r)=>(Im(e,t,"read from private field"),r?r.call(e):t.get(e)),De=(e,t,r)=>t.has(e)?C1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),ye=(e,t,r,n)=>(Im(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),Fe=(e,t,r)=>(Im(e,t,"access private method"),r);var xd=(e,t,r,n)=>({set _(a){ye(e,t,a,r)},get _(){return z(e,t,n)}});function nM(e,t){for(var r=0;rn[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(a){if(a.ep)return;a.ep=!0;const o=r(a);fetch(a.href,o)}})();function ty(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tm={exports:{}},Gl={},Dm={exports:{}},Le={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var eM=Object.defineProperty;var C1=e=>{throw TypeError(e)};var tM=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var A1;function nM(){if(A1)return Le;A1=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.iterator;function x($){return $===null||typeof $!="object"?null:($=v&&$[v]||$["@@iterator"],typeof $=="function"?$:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,k={};function S($,T,ee){this.props=$,this.context=T,this.refs=k,this.updater=ee||b}S.prototype.isReactComponent={},S.prototype.setState=function($,T){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,T,"setState")},S.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function N(){}N.prototype=S.prototype;function P($,T,ee){this.props=$,this.context=T,this.refs=k,this.updater=ee||b}var O=P.prototype=new N;O.constructor=P,j(O,S.prototype),O.isPureReactComponent=!0;var C=Array.isArray,_=Object.prototype.hasOwnProperty,A={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function U($,T,ee){var ne,te={},ue=null,pe=null;if(T!=null)for(ne in T.ref!==void 0&&(pe=T.ref),T.key!==void 0&&(ue=""+T.key),T)_.call(T,ne)&&!I.hasOwnProperty(ne)&&(te[ne]=T[ne]);var Ae=arguments.length-2;if(Ae===1)te.children=ee;else if(1{throw TypeError(e)};var tM=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var _1;function iM(){if(_1)return Kl;_1=1;var e=Fs(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(l,f,h){var p,v={},x=null,b=null;h!==void 0&&(x=""+h),f.key!==void 0&&(x=""+f.key),f.ref!==void 0&&(b=f.ref);for(p in f)n.call(f,p)&&!o.hasOwnProperty(p)&&(v[p]=f[p]);if(l&&l.defaultProps)for(p in f=l.defaultProps,f)v[p]===void 0&&(v[p]=f[p]);return{$$typeof:t,type:l,key:x,ref:b,props:v,_owner:a.current}}return Kl.Fragment=r,Kl.jsx=u,Kl.jsxs=u,Kl}var M1;function aM(){return M1||(M1=1,Tm.exports=iM()),Tm.exports}var c=aM(),y=Fs();const DN=ty(y),eh=rM({__proto__:null,default:DN},[y]);var bd={},Rm={exports:{}},mr={},$m={exports:{}},Lm={};/** + */var _1;function aM(){if(_1)return Gl;_1=1;var e=Fs(),t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function u(l,f,h){var p,v={},x=null,b=null;h!==void 0&&(x=""+h),f.key!==void 0&&(x=""+f.key),f.ref!==void 0&&(b=f.ref);for(p in f)n.call(f,p)&&!o.hasOwnProperty(p)&&(v[p]=f[p]);if(l&&l.defaultProps)for(p in f=l.defaultProps,f)v[p]===void 0&&(v[p]=f[p]);return{$$typeof:t,type:l,key:x,ref:b,props:v,_owner:a.current}}return Gl.Fragment=r,Gl.jsx=u,Gl.jsxs=u,Gl}var M1;function oM(){return M1||(M1=1,Tm.exports=aM()),Tm.exports}var c=oM(),y=Fs();const RN=ty(y),eh=nM({__proto__:null,default:RN},[y]);var bd={},Rm={exports:{}},vr={},$m={exports:{}},Lm={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var eM=Object.defineProperty;var C1=e=>{throw TypeError(e)};var tM=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var I1;function oM(){return I1||(I1=1,(function(e){function t(Q,oe){var X=Q.length;Q.push(oe);e:for(;0>>1,T=Q[$];if(0>>1;$a(te,X))uea(pe,te)?(Q[$]=pe,Q[ue]=X,$=ue):(Q[$]=te,Q[ne]=X,$=ne);else if(uea(pe,X))Q[$]=pe,Q[ue]=X,$=ue;else break e}}return oe}function a(Q,oe){var X=Q.sortIndex-oe.sortIndex;return X!==0?X:Q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,l=u.now();e.unstable_now=function(){return u.now()-l}}var f=[],h=[],p=1,v=null,x=3,b=!1,j=!1,k=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(Q){for(var oe=r(h);oe!==null;){if(oe.callback===null)n(h);else if(oe.startTime<=Q)n(h),oe.sortIndex=oe.expirationTime,t(f,oe);else break;oe=r(h)}}function C(Q){if(k=!1,O(Q),!j)if(r(f)!==null)j=!0,je(_);else{var oe=r(h);oe!==null&&me(C,oe.startTime-Q)}}function _(Q,oe){j=!1,k&&(k=!1,N(U),U=-1),b=!0;var X=x;try{for(O(oe),v=r(f);v!==null&&(!(v.expirationTime>oe)||Q&&!q());){var $=v.callback;if(typeof $=="function"){v.callback=null,x=v.priorityLevel;var T=$(v.expirationTime<=oe);oe=e.unstable_now(),typeof T=="function"?v.callback=T:v===r(f)&&n(f),O(oe)}else n(f);v=r(f)}if(v!==null)var ee=!0;else{var ne=r(h);ne!==null&&me(C,ne.startTime-oe),ee=!1}return ee}finally{v=null,x=X,b=!1}}var A=!1,I=null,U=-1,B=5,V=-1;function q(){return!(e.unstable_now()-VQ||125$?(Q.sortIndex=X,t(h,Q),r(f)===null&&Q===r(h)&&(k?(N(U),U=-1):k=!0,me(C,X-$))):(Q.sortIndex=T,t(f,Q),j||b||(j=!0,je(_))),Q},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Q){var oe=x;return function(){var X=x;x=oe;try{return Q.apply(this,arguments)}finally{x=X}}}})(Lm)),Lm}var T1;function sM(){return T1||(T1=1,$m.exports=oM()),$m.exports}/** + */var I1;function sM(){return I1||(I1=1,(function(e){function t(Q,oe){var X=Q.length;Q.push(oe);e:for(;0>>1,T=Q[L];if(0>>1;La(te,X))uea(pe,te)?(Q[L]=pe,Q[ue]=X,L=ue):(Q[L]=te,Q[ne]=X,L=ne);else if(uea(pe,X))Q[L]=pe,Q[ue]=X,L=ue;else break e}}return oe}function a(Q,oe){var X=Q.sortIndex-oe.sortIndex;return X!==0?X:Q.id-oe.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,l=u.now();e.unstable_now=function(){return u.now()-l}}var f=[],h=[],p=1,v=null,x=3,b=!1,k=!1,j=!1,S=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(Q){for(var oe=r(h);oe!==null;){if(oe.callback===null)n(h);else if(oe.startTime<=Q)n(h),oe.sortIndex=oe.expirationTime,t(f,oe);else break;oe=r(h)}}function C(Q){if(j=!1,O(Q),!k)if(r(f)!==null)k=!0,ke(_);else{var oe=r(h);oe!==null&&me(C,oe.startTime-Q)}}function _(Q,oe){k=!1,j&&(j=!1,N($),$=-1),b=!0;var X=x;try{for(O(oe),v=r(f);v!==null&&(!(v.expirationTime>oe)||Q&&!q());){var L=v.callback;if(typeof L=="function"){v.callback=null,x=v.priorityLevel;var T=L(v.expirationTime<=oe);oe=e.unstable_now(),typeof T=="function"?v.callback=T:v===r(f)&&n(f),O(oe)}else n(f);v=r(f)}if(v!==null)var ee=!0;else{var ne=r(h);ne!==null&&me(C,ne.startTime-oe),ee=!1}return ee}finally{v=null,x=X,b=!1}}var A=!1,I=null,$=-1,B=5,K=-1;function q(){return!(e.unstable_now()-KQ||125L?(Q.sortIndex=X,t(h,Q),r(f)===null&&Q===r(h)&&(j?(N($),$=-1):j=!0,me(C,X-L))):(Q.sortIndex=T,t(f,Q),k||b||(k=!0,ke(_))),Q},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(Q){var oe=x;return function(){var X=x;x=oe;try{return Q.apply(this,arguments)}finally{x=X}}}})(Lm)),Lm}var T1;function lM(){return T1||(T1=1,$m.exports=sM()),$m.exports}/** * @license React * react-dom.production.min.js * @@ -30,305 +30,315 @@ var eM=Object.defineProperty;var C1=e=>{throw TypeError(e)};var tM=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var D1;function lM(){if(D1)return mr;D1=1;var e=Fs(),t=sM();function r(i){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+i,d=1;d"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},v={};function x(i){return f.call(v,i)?!0:f.call(p,i)?!1:h.test(i)?v[i]=!0:(p[i]=!0,!1)}function b(i,s,d,m){if(d!==null&&d.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return m?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function j(i,s,d,m){if(s===null||typeof s>"u"||b(i,s,d,m))return!0;if(m)return!1;if(d!==null)switch(d.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function k(i,s,d,m,g,w,E){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=m,this.attributeNamespace=g,this.mustUseProperty=d,this.propertyName=i,this.type=s,this.sanitizeURL=w,this.removeEmptyString=E}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){S[i]=new k(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];S[s]=new k(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){S[i]=new k(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){S[i]=new k(i,2,!1,i,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(i){S[i]=new k(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){S[i]=new k(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){S[i]=new k(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){S[i]=new k(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){S[i]=new k(i,5,!1,i.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(i){return i[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(i){var s=i.replace(N,P);S[s]=new k(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(N,P);S[s]=new k(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(N,P);S[s]=new k(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){S[i]=new k(i,1,!1,i.toLowerCase(),null,!1,!1)}),S.xlinkHref=new k("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){S[i]=new k(i,1,!1,i.toLowerCase(),null,!0,!0)});function O(i,s,d,m){var g=S.hasOwnProperty(s)?S[s]:null;(g!==null?g.type!==0:m||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),f=Object.prototype.hasOwnProperty,h=/^[: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]*$/,p={},v={};function x(i){return f.call(v,i)?!0:f.call(p,i)?!1:h.test(i)?v[i]=!0:(p[i]=!0,!1)}function b(i,s,d,m){if(d!==null&&d.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return m?!1:d!==null?!d.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function k(i,s,d,m){if(s===null||typeof s>"u"||b(i,s,d,m))return!0;if(m)return!1;if(d!==null)switch(d.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function j(i,s,d,m,g,w,E){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=m,this.attributeNamespace=g,this.mustUseProperty=d,this.propertyName=i,this.type=s,this.sanitizeURL=w,this.removeEmptyString=E}var S={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){S[i]=new j(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var s=i[0];S[s]=new j(s,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){S[i]=new j(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){S[i]=new j(i,2,!1,i,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(i){S[i]=new j(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){S[i]=new j(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){S[i]=new j(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){S[i]=new j(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){S[i]=new j(i,5,!1,i.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function P(i){return i[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(i){var s=i.replace(N,P);S[s]=new j(s,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var s=i.replace(N,P);S[s]=new j(s,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var s=i.replace(N,P);S[s]=new j(s,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){S[i]=new j(i,1,!1,i.toLowerCase(),null,!1,!1)}),S.xlinkHref=new j("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){S[i]=new j(i,1,!1,i.toLowerCase(),null,!0,!0)});function O(i,s,d,m){var g=S.hasOwnProperty(s)?S[s]:null;(g!==null?g.type!==0:m||!(2M||g[E]!==w[M]){var D=` -`+g[E].replace(" at new "," at ");return i.displayName&&D.includes("")&&(D=D.replace("",i.displayName)),D}while(1<=E&&0<=M);break}}}finally{ee=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?T(i):""}function te(i){switch(i.tag){case 5:return T(i.type);case 16:return T("Lazy");case 13:return T("Suspense");case 19:return T("SuspenseList");case 0:case 2:case 15:return i=ne(i.type,!1),i;case 11:return i=ne(i.type.render,!1),i;case 1:return i=ne(i.type,!0),i;default:return""}}function ue(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case I:return"Fragment";case A:return"Portal";case B:return"Profiler";case U:return"StrictMode";case de:return"Suspense";case Z:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case q:return(i.displayName||"Context")+".Consumer";case V:return(i._context.displayName||"Context")+".Provider";case R:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ge:return s=i.displayName||null,s!==null?s:ue(i.type)||"Memo";case je:s=i._payload,i=i._init;try{return ue(i(s))}catch{}}return null}function pe(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(s);case 8:return s===U?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Ae(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function J(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function ke(i){var s=J(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),m=""+i[s];if(!i.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,w=d.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(E){m=""+E,w.call(this,E)}}),Object.defineProperty(i,s,{enumerable:d.enumerable}),{getValue:function(){return m},setValue:function(E){m=""+E},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Oe(i){i._valueTracker||(i._valueTracker=ke(i))}function ae(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var d=s.getValue(),m="";return i&&(m=J(i)?i.checked?"true":"false":i.value),i=m,i!==d?(s.setValue(i),!0):!1}function Xe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Y(i,s){var d=s.checked;return X({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function ce(i,s){var d=s.defaultValue==null?"":s.defaultValue,m=s.checked!=null?s.checked:s.defaultChecked;d=Ae(s.value!=null?s.value:d),i._wrapperState={initialChecked:m,initialValue:d,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(i,s){s=s.checked,s!=null&&O(i,"checked",s,!1)}function jr(i,s){tt(i,s);var d=Ae(s.value),m=s.type;if(d!=null)m==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(m==="submit"||m==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?ma(i,s.type,d):s.hasOwnProperty("defaultValue")&&ma(i,s.type,Ae(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function pa(i,s,d){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var m=s.type;if(!(m!=="submit"&&m!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,d||s===i.value||(i.value=s),i.defaultValue=s}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function ma(i,s,d){(s!=="number"||Xe(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var Bn=Array.isArray;function Un(i,s,d,m){if(i=i.options,s){s={};for(var g=0;g"+s.valueOf().toString()+"",s=va.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function wi(i,s){if(s){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=s;return}}i.textContent=s}var ji={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},uc=["Webkit","ms","Moz","O"];Object.keys(ji).forEach(function(i){uc.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),ji[s]=ji[i]})});function al(i,s,d){return s==null||typeof s=="boolean"||s===""?"":d||typeof s!="number"||s===0||ji.hasOwnProperty(i)&&ji[i]?(""+s).trim():s+"px"}function ol(i,s){i=i.style;for(var d in s)if(s.hasOwnProperty(d)){var m=d.indexOf("--")===0,g=al(d,s[d],m);d==="float"&&(d="cssFloat"),m?i.setProperty(d,g):i[d]=g}}var F=X({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 fe(i,s){if(s){if(F[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function Pe(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){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 ze=null;function Ge(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var qt=null,Ze=null,vt=null;function ga(i){if(i=Ol(i)){if(typeof qt!="function")throw Error(r(280));var s=i.stateNode;s&&(s=Ic(s),qt(i.stateNode,i.type,s))}}function sl(i){Ze?vt?vt.push(i):vt=[i]:Ze=i}function cc(){if(Ze){var i=Ze,s=vt;if(vt=Ze=null,ga(i),s)for(i=0;i>>=0,i===0?32:31-(v_(i)/g_|0)|0}var mc=64,vc=4194304;function fl(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function gc(i,s){var d=i.pendingLanes;if(d===0)return 0;var m=0,g=i.suspendedLanes,w=i.pingedLanes,E=d&268435455;if(E!==0){var M=E&~g;M!==0?m=fl(M):(w&=E,w!==0&&(m=fl(w)))}else E=d&~g,E!==0?m=fl(E):w!==0&&(m=fl(w));if(m===0)return 0;if(s!==0&&s!==m&&(s&g)===0&&(g=m&-m,w=s&-s,g>=w||g===16&&(w&4194240)!==0))return s;if((m&4)!==0&&(m|=d&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=m;0d;d++)s.push(i);return s}function hl(i,s,d){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-Zr(s),i[s]=d}function w_(i,s){var d=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0=wl),wx=" ",jx=!1;function kx(i,s){switch(i){case"keyup":return Q_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sx(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var No=!1;function X_(i,s){switch(i){case"compositionend":return Sx(s);case"keypress":return s.which!==32?null:(jx=!0,wx);case"textInput":return i=s.data,i===wx&&jx?null:i;default:return null}}function Z_(i,s){if(No)return i==="compositionend"||!hp&&kx(i,s)?(i=mx(),jc=sp=Pi=null,No=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-i};i=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=_x(d)}}function Ix(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Ix(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Tx(){for(var i=window,s=Xe();s instanceof i.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)i=s.contentWindow;else break;s=Xe(i.document)}return s}function vp(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function s5(i){var s=Tx(),d=i.focusedElem,m=i.selectionRange;if(s!==d&&d&&d.ownerDocument&&Ix(d.ownerDocument.documentElement,d)){if(m!==null&&vp(d)){if(s=m.start,i=m.end,i===void 0&&(i=s),"selectionStart"in d)d.selectionStart=s,d.selectionEnd=Math.min(i,d.value.length);else if(i=(s=d.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var g=d.textContent.length,w=Math.min(m.start,g);m=m.end===void 0?w:Math.min(m.end,g),!i.extend&&w>m&&(g=m,m=w,w=g),g=Mx(d,w);var E=Mx(d,m);g&&E&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==E.node||i.focusOffset!==E.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),i.removeAllRanges(),w>m?(i.addRange(s),i.extend(E.node,E.offset)):(s.setEnd(E.node,E.offset),i.addRange(s)))}}for(s=[],i=d;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Eo=null,gp=null,Nl=null,yp=!1;function Dx(i,s,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;yp||Eo==null||Eo!==Xe(m)||(m=Eo,"selectionStart"in m&&vp(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Nl&&Sl(Nl,m)||(Nl=m,m=Oc(gp,"onSelect"),0_o||(i.current=Op[_o],Op[_o]=null,_o--)}function Je(i,s){_o++,Op[_o]=i.current,i.current=s}var _i={},Qt=Oi(_i),cr=Oi(!1),ba=_i;function Mo(i,s){var d=i.type.contextTypes;if(!d)return _i;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===s)return m.__reactInternalMemoizedMaskedChildContext;var g={},w;for(w in d)g[w]=s[w];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=g),g}function dr(i){return i=i.childContextTypes,i!=null}function Tc(){nt(cr),nt(Qt)}function Yx(i,s,d){if(Qt.current!==_i)throw Error(r(168));Je(Qt,s),Je(cr,d)}function Xx(i,s,d){var m=i.stateNode;if(s=s.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var g in m)if(!(g in s))throw Error(r(108,pe(i)||"Unknown",g));return X({},d,m)}function Dc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||_i,ba=Qt.current,Je(Qt,i),Je(cr,cr.current),!0}function Zx(i,s,d){var m=i.stateNode;if(!m)throw Error(r(169));d?(i=Xx(i,s,ba),m.__reactInternalMemoizedMergedChildContext=i,nt(cr),nt(Qt),Je(Qt,i)):nt(cr),Je(cr,d)}var Hn=null,Rc=!1,_p=!1;function Jx(i){Hn===null?Hn=[i]:Hn.push(i)}function x5(i){Rc=!0,Jx(i)}function Mi(){if(!_p&&Hn!==null){_p=!0;var i=0,s=Qe;try{var d=Hn;for(Qe=1;i>=E,g-=E,Kn=1<<32-Zr(s)+g|d<Re?(_t=Ie,Ie=null):_t=Ie.sibling;var Ke=re(W,Ie,H[Re],le);if(Ke===null){Ie===null&&(Ie=_t);break}i&&Ie&&Ke.alternate===null&&s(W,Ie),z=w(Ke,z,Re),Me===null?Ee=Ke:Me.sibling=Ke,Me=Ke,Ie=_t}if(Re===H.length)return d(W,Ie),st&&ja(W,Re),Ee;if(Ie===null){for(;ReRe?(_t=Ie,Ie=null):_t=Ie.sibling;var Bi=re(W,Ie,Ke.value,le);if(Bi===null){Ie===null&&(Ie=_t);break}i&&Ie&&Bi.alternate===null&&s(W,Ie),z=w(Bi,z,Re),Me===null?Ee=Bi:Me.sibling=Bi,Me=Bi,Ie=_t}if(Ke.done)return d(W,Ie),st&&ja(W,Re),Ee;if(Ie===null){for(;!Ke.done;Re++,Ke=H.next())Ke=se(W,Ke.value,le),Ke!==null&&(z=w(Ke,z,Re),Me===null?Ee=Ke:Me.sibling=Ke,Me=Ke);return st&&ja(W,Re),Ee}for(Ie=m(W,Ie);!Ke.done;Re++,Ke=H.next())Ke=ve(Ie,W,Re,Ke.value,le),Ke!==null&&(i&&Ke.alternate!==null&&Ie.delete(Ke.key===null?Re:Ke.key),z=w(Ke,z,Re),Me===null?Ee=Ke:Me.sibling=Ke,Me=Ke);return i&&Ie.forEach(function(J5){return s(W,J5)}),st&&ja(W,Re),Ee}function yt(W,z,H,le){if(typeof H=="object"&&H!==null&&H.type===I&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case _:e:{for(var Ee=H.key,Me=z;Me!==null;){if(Me.key===Ee){if(Ee=H.type,Ee===I){if(Me.tag===7){d(W,Me.sibling),z=g(Me,H.props.children),z.return=W,W=z;break e}}else if(Me.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===je&&ab(Ee)===Me.type){d(W,Me.sibling),z=g(Me,H.props),z.ref=_l(W,Me,H),z.return=W,W=z;break e}d(W,Me);break}else s(W,Me);Me=Me.sibling}H.type===I?(z=Oa(H.props.children,W.mode,le,H.key),z.return=W,W=z):(le=cd(H.type,H.key,H.props,null,W.mode,le),le.ref=_l(W,z,H),le.return=W,W=le)}return E(W);case A:e:{for(Me=H.key;z!==null;){if(z.key===Me)if(z.tag===4&&z.stateNode.containerInfo===H.containerInfo&&z.stateNode.implementation===H.implementation){d(W,z.sibling),z=g(z,H.children||[]),z.return=W,W=z;break e}else{d(W,z);break}else s(W,z);z=z.sibling}z=Cm(H,W.mode,le),z.return=W,W=z}return E(W);case je:return Me=H._init,yt(W,z,Me(H._payload),le)}if(Bn(H))return we(W,z,H,le);if(oe(H))return Se(W,z,H,le);Fc(W,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,z!==null&&z.tag===6?(d(W,z.sibling),z=g(z,H),z.return=W,W=z):(d(W,z),z=Pm(H,W.mode,le),z.return=W,W=z),E(W)):d(W,z)}return yt}var Ro=ob(!0),sb=ob(!1),Bc=Oi(null),Uc=null,$o=null,$p=null;function Lp(){$p=$o=Uc=null}function zp(i){var s=Bc.current;nt(Bc),i._currentValue=s}function Fp(i,s,d){for(;i!==null;){var m=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,m!==null&&(m.childLanes|=s)):m!==null&&(m.childLanes&s)!==s&&(m.childLanes|=s),i===d)break;i=i.return}}function Lo(i,s){Uc=i,$p=$o=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(fr=!0),i.firstContext=null)}function Rr(i){var s=i._currentValue;if($p!==i)if(i={context:i,memoizedValue:s,next:null},$o===null){if(Uc===null)throw Error(r(308));$o=i,Uc.dependencies={lanes:0,firstContext:i}}else $o=$o.next=i;return s}var ka=null;function Bp(i){ka===null?ka=[i]:ka.push(i)}function lb(i,s,d,m){var g=s.interleaved;return g===null?(d.next=d,Bp(s)):(d.next=g.next,g.next=d),s.interleaved=d,Gn(i,m)}function Gn(i,s){i.lanes|=s;var d=i.alternate;for(d!==null&&(d.lanes|=s),d=i,i=i.return;i!==null;)i.childLanes|=s,d=i.alternate,d!==null&&(d.childLanes|=s),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Ii=!1;function Up(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ub(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qn(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function Ti(i,s,d){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(He&2)!==0){var g=m.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),m.pending=s,Gn(i,d)}return g=m.interleaved,g===null?(s.next=s,Bp(m)):(s.next=g.next,g.next=s),m.interleaved=s,Gn(i,d)}function Wc(i,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194240)!==0)){var m=s.lanes;m&=i.pendingLanes,d|=m,s.lanes=d,rp(i,d)}}function cb(i,s){var d=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var g=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var E={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};w===null?g=w=E:w=w.next=E,d=d.next}while(d!==null);w===null?g=w=s:w=w.next=s}else g=w=s;d={baseState:m.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:m.shared,effects:m.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=s:i.next=s,d.lastBaseUpdate=s}function Hc(i,s,d,m){var g=i.updateQueue;Ii=!1;var w=g.firstBaseUpdate,E=g.lastBaseUpdate,M=g.shared.pending;if(M!==null){g.shared.pending=null;var D=M,G=D.next;D.next=null,E===null?w=G:E.next=G,E=D;var ie=i.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==E&&(M===null?ie.firstBaseUpdate=G:M.next=G,ie.lastBaseUpdate=D))}if(w!==null){var se=g.baseState;E=0,ie=G=D=null,M=w;do{var re=M.lane,ve=M.eventTime;if((m&re)===re){ie!==null&&(ie=ie.next={eventTime:ve,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var we=i,Se=M;switch(re=s,ve=d,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){se=we.call(ve,se,re);break e}se=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,re=typeof we=="function"?we.call(ve,se,re):we,re==null)break e;se=X({},se,re);break e;case 2:Ii=!0}}M.callback!==null&&M.lane!==0&&(i.flags|=64,re=g.effects,re===null?g.effects=[M]:re.push(M))}else ve={eventTime:ve,lane:re,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(G=ie=ve,D=se):ie=ie.next=ve,E|=re;if(M=M.next,M===null){if(M=g.shared.pending,M===null)break;re=M,M=re.next,re.next=null,g.lastBaseUpdate=re,g.shared.pending=null}}while(!0);if(ie===null&&(D=se),g.baseState=D,g.firstBaseUpdate=G,g.lastBaseUpdate=ie,s=g.shared.interleaved,s!==null){g=s;do E|=g.lane,g=g.next;while(g!==s)}else w===null&&(g.shared.lanes=0);Ea|=E,i.lanes=E,i.memoizedState=se}}function db(i,s,d){if(i=s.effects,s.effects=null,i!==null)for(s=0;sd?d:4,i(!0);var m=Gp.transition;Gp.transition={};try{i(!1),s()}finally{Qe=d,Gp.transition=m}}function Ob(){return $r().memoizedState}function k5(i,s,d){var m=Li(i);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},_b(i))Mb(s,d);else if(d=lb(i,s,d,m),d!==null){var g=ir();an(d,i,m,g),Ib(d,s,m)}}function S5(i,s,d){var m=Li(i),g={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(_b(i))Mb(s,g);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var E=s.lastRenderedState,M=w(E,d);if(g.hasEagerState=!0,g.eagerState=M,Jr(M,E)){var D=s.interleaved;D===null?(g.next=g,Bp(s)):(g.next=D.next,D.next=g),s.interleaved=g;return}}catch{}finally{}d=lb(i,s,g,m),d!==null&&(g=ir(),an(d,i,m,g),Ib(d,s,m))}}function _b(i){var s=i.alternate;return i===dt||s!==null&&s===dt}function Mb(i,s){Dl=Gc=!0;var d=i.pending;d===null?s.next=s:(s.next=d.next,d.next=s),i.pending=s}function Ib(i,s,d){if((d&4194240)!==0){var m=s.lanes;m&=i.pendingLanes,d|=m,s.lanes=d,rp(i,d)}}var Yc={readContext:Rr,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},N5={readContext:Rr,useCallback:function(i,s){return yn().memoizedState=[i,s===void 0?null:s],i},useContext:Rr,useEffect:jb,useImperativeHandle:function(i,s,d){return d=d!=null?d.concat([i]):null,qc(4194308,4,Nb.bind(null,s,i),d)},useLayoutEffect:function(i,s){return qc(4194308,4,i,s)},useInsertionEffect:function(i,s){return qc(4,2,i,s)},useMemo:function(i,s){var d=yn();return s=s===void 0?null:s,i=i(),d.memoizedState=[i,s],i},useReducer:function(i,s,d){var m=yn();return s=d!==void 0?d(s):s,m.memoizedState=m.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},m.queue=i,i=i.dispatch=k5.bind(null,dt,i),[m.memoizedState,i]},useRef:function(i){var s=yn();return i={current:i},s.memoizedState=i},useState:bb,useDebugValue:em,useDeferredValue:function(i){return yn().memoizedState=i},useTransition:function(){var i=bb(!1),s=i[0];return i=j5.bind(null,i[1]),yn().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,d){var m=dt,g=yn();if(st){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));(Na&30)!==0||mb(m,s,d)}g.memoizedState=d;var w={value:d,getSnapshot:s};return g.queue=w,jb(gb.bind(null,m,w,i),[i]),m.flags|=2048,Ll(9,vb.bind(null,m,w,d,s),void 0,null),d},useId:function(){var i=yn(),s=Ot.identifierPrefix;if(st){var d=Vn,m=Kn;d=(m&~(1<<32-Zr(m)-1)).toString(32)+d,s=":"+s+"R"+d,d=Rl++,0")&&(D=D.replace("",i.displayName)),D}while(1<=E&&0<=M);break}}}finally{ee=!1,Error.prepareStackTrace=d}return(i=i?i.displayName||i.name:"")?T(i):""}function te(i){switch(i.tag){case 5:return T(i.type);case 16:return T("Lazy");case 13:return T("Suspense");case 19:return T("SuspenseList");case 0:case 2:case 15:return i=ne(i.type,!1),i;case 11:return i=ne(i.type.render,!1),i;case 1:return i=ne(i.type,!0),i;default:return""}}function ue(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case I:return"Fragment";case A:return"Portal";case B:return"Profiler";case $:return"StrictMode";case de:return"Suspense";case Z:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case q:return(i.displayName||"Context")+".Consumer";case K:return(i._context.displayName||"Context")+".Provider";case R:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ge:return s=i.displayName||null,s!==null?s:ue(i.type)||"Memo";case ke:s=i._payload,i=i._init;try{return ue(i(s))}catch{}}return null}function pe(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ue(s);case 8:return s===$?"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 s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function Oe(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function J(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function je(i){var s=J(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),m=""+i[s];if(!i.hasOwnProperty(s)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var g=d.get,w=d.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return g.call(this)},set:function(E){m=""+E,w.call(this,E)}}),Object.defineProperty(i,s,{enumerable:d.enumerable}),{getValue:function(){return m},setValue:function(E){m=""+E},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function _e(i){i._valueTracker||(i._valueTracker=je(i))}function ae(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var d=s.getValue(),m="";return i&&(m=J(i)?i.checked?"true":"false":i.value),i=m,i!==d?(s.setValue(i),!0):!1}function Xe(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Y(i,s){var d=s.checked;return X({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:d??i._wrapperState.initialChecked})}function ce(i,s){var d=s.defaultValue==null?"":s.defaultValue,m=s.checked!=null?s.checked:s.defaultChecked;d=Oe(s.value!=null?s.value:d),i._wrapperState={initialChecked:m,initialValue:d,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function tt(i,s){s=s.checked,s!=null&&O(i,"checked",s,!1)}function kr(i,s){tt(i,s);var d=Oe(s.value),m=s.type;if(d!=null)m==="number"?(d===0&&i.value===""||i.value!=d)&&(i.value=""+d):i.value!==""+d&&(i.value=""+d);else if(m==="submit"||m==="reset"){i.removeAttribute("value");return}s.hasOwnProperty("value")?ma(i,s.type,d):s.hasOwnProperty("defaultValue")&&ma(i,s.type,Oe(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(i.defaultChecked=!!s.defaultChecked)}function pa(i,s,d){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var m=s.type;if(!(m!=="submit"&&m!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+i._wrapperState.initialValue,d||s===i.value||(i.value=s),i.defaultValue=s}d=i.name,d!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,d!==""&&(i.name=d)}function ma(i,s,d){(s!=="number"||Xe(i.ownerDocument)!==i)&&(d==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+d&&(i.defaultValue=""+d))}var Bn=Array.isArray;function Un(i,s,d,m){if(i=i.options,s){s={};for(var g=0;g"+s.valueOf().toString()+"",s=va.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;s.firstChild;)i.appendChild(s.firstChild)}});function wi(i,s){if(s){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=s;return}}i.textContent=s}var ki={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},cc=["Webkit","ms","Moz","O"];Object.keys(ki).forEach(function(i){cc.forEach(function(s){s=s+i.charAt(0).toUpperCase()+i.substring(1),ki[s]=ki[i]})});function al(i,s,d){return s==null||typeof s=="boolean"||s===""?"":d||typeof s!="number"||s===0||ki.hasOwnProperty(i)&&ki[i]?(""+s).trim():s+"px"}function ol(i,s){i=i.style;for(var d in s)if(s.hasOwnProperty(d)){var m=d.indexOf("--")===0,g=al(d,s[d],m);d==="float"&&(d="cssFloat"),m?i.setProperty(d,g):i[d]=g}}var U=X({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 he(i,s){if(s){if(U[i]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(r(137,i));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(r(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(r(61))}if(s.style!=null&&typeof s.style!="object")throw Error(r(62))}}function Pe(i,s){if(i.indexOf("-")===-1)return typeof s.is=="string";switch(i){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 ze=null;function Ve(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var qt=null,Ze=null,vt=null;function ga(i){if(i=Ol(i)){if(typeof qt!="function")throw Error(r(280));var s=i.stateNode;s&&(s=Tc(s),qt(i.stateNode,i.type,s))}}function sl(i){Ze?vt?vt.push(i):vt=[i]:Ze=i}function dc(){if(Ze){var i=Ze,s=vt;if(vt=Ze=null,ga(i),s)for(i=0;i>>=0,i===0?32:31-(g_(i)/y_|0)|0}var vc=64,gc=4194304;function fl(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function yc(i,s){var d=i.pendingLanes;if(d===0)return 0;var m=0,g=i.suspendedLanes,w=i.pingedLanes,E=d&268435455;if(E!==0){var M=E&~g;M!==0?m=fl(M):(w&=E,w!==0&&(m=fl(w)))}else E=d&~g,E!==0?m=fl(E):w!==0&&(m=fl(w));if(m===0)return 0;if(s!==0&&s!==m&&(s&g)===0&&(g=m&-m,w=s&-s,g>=w||g===16&&(w&4194240)!==0))return s;if((m&4)!==0&&(m|=d&16),s=i.entangledLanes,s!==0)for(i=i.entanglements,s&=m;0d;d++)s.push(i);return s}function hl(i,s,d){i.pendingLanes|=s,s!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,s=31-Zr(s),i[s]=d}function k_(i,s){var d=i.pendingLanes&~s;i.pendingLanes=s,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=s,i.mutableReadLanes&=s,i.entangledLanes&=s,s=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0=wl),wx=" ",kx=!1;function jx(i,s){switch(i){case"keyup":return Y_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sx(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var No=!1;function Z_(i,s){switch(i){case"compositionend":return Sx(s);case"keypress":return s.which!==32?null:(kx=!0,wx);case"textInput":return i=s.data,i===wx&&kx?null:i;default:return null}}function J_(i,s){if(No)return i==="compositionend"||!hp&&jx(i,s)?(i=mx(),jc=sp=Pi=null,No=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:d,offset:s-i};i=m}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=_x(d)}}function Ix(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?Ix(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Tx(){for(var i=window,s=Xe();s instanceof i.HTMLIFrameElement;){try{var d=typeof s.contentWindow.location.href=="string"}catch{d=!1}if(d)i=s.contentWindow;else break;s=Xe(i.document)}return s}function vp(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}function l5(i){var s=Tx(),d=i.focusedElem,m=i.selectionRange;if(s!==d&&d&&d.ownerDocument&&Ix(d.ownerDocument.documentElement,d)){if(m!==null&&vp(d)){if(s=m.start,i=m.end,i===void 0&&(i=s),"selectionStart"in d)d.selectionStart=s,d.selectionEnd=Math.min(i,d.value.length);else if(i=(s=d.ownerDocument||document)&&s.defaultView||window,i.getSelection){i=i.getSelection();var g=d.textContent.length,w=Math.min(m.start,g);m=m.end===void 0?w:Math.min(m.end,g),!i.extend&&w>m&&(g=m,m=w,w=g),g=Mx(d,w);var E=Mx(d,m);g&&E&&(i.rangeCount!==1||i.anchorNode!==g.node||i.anchorOffset!==g.offset||i.focusNode!==E.node||i.focusOffset!==E.offset)&&(s=s.createRange(),s.setStart(g.node,g.offset),i.removeAllRanges(),w>m?(i.addRange(s),i.extend(E.node,E.offset)):(s.setEnd(E.node,E.offset),i.addRange(s)))}}for(s=[],i=d;i=i.parentNode;)i.nodeType===1&&s.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof d.focus=="function"&&d.focus(),d=0;d=document.documentMode,Eo=null,gp=null,Nl=null,yp=!1;function Dx(i,s,d){var m=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;yp||Eo==null||Eo!==Xe(m)||(m=Eo,"selectionStart"in m&&vp(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Nl&&Sl(Nl,m)||(Nl=m,m=_c(gp,"onSelect"),0_o||(i.current=Op[_o],Op[_o]=null,_o--)}function Je(i,s){_o++,Op[_o]=i.current,i.current=s}var _i={},Qt=Oi(_i),dr=Oi(!1),ba=_i;function Mo(i,s){var d=i.type.contextTypes;if(!d)return _i;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===s)return m.__reactInternalMemoizedMaskedChildContext;var g={},w;for(w in d)g[w]=s[w];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=s,i.__reactInternalMemoizedMaskedChildContext=g),g}function fr(i){return i=i.childContextTypes,i!=null}function Dc(){nt(dr),nt(Qt)}function Yx(i,s,d){if(Qt.current!==_i)throw Error(r(168));Je(Qt,s),Je(dr,d)}function Xx(i,s,d){var m=i.stateNode;if(s=s.childContextTypes,typeof m.getChildContext!="function")return d;m=m.getChildContext();for(var g in m)if(!(g in s))throw Error(r(108,pe(i)||"Unknown",g));return X({},d,m)}function Rc(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||_i,ba=Qt.current,Je(Qt,i),Je(dr,dr.current),!0}function Zx(i,s,d){var m=i.stateNode;if(!m)throw Error(r(169));d?(i=Xx(i,s,ba),m.__reactInternalMemoizedMergedChildContext=i,nt(dr),nt(Qt),Je(Qt,i)):nt(dr),Je(dr,d)}var Hn=null,$c=!1,_p=!1;function Jx(i){Hn===null?Hn=[i]:Hn.push(i)}function b5(i){$c=!0,Jx(i)}function Mi(){if(!_p&&Hn!==null){_p=!0;var i=0,s=Qe;try{var d=Hn;for(Qe=1;i>=E,g-=E,Kn=1<<32-Zr(s)+g|d<Re?(_t=Te,Te=null):_t=Te.sibling;var Ke=re(W,Te,H[Re],le);if(Ke===null){Te===null&&(Te=_t);break}i&&Te&&Ke.alternate===null&&s(W,Te),F=w(Ke,F,Re),Ie===null?Ee=Ke:Ie.sibling=Ke,Ie=Ke,Te=_t}if(Re===H.length)return d(W,Te),st&&ka(W,Re),Ee;if(Te===null){for(;ReRe?(_t=Te,Te=null):_t=Te.sibling;var Bi=re(W,Te,Ke.value,le);if(Bi===null){Te===null&&(Te=_t);break}i&&Te&&Bi.alternate===null&&s(W,Te),F=w(Bi,F,Re),Ie===null?Ee=Bi:Ie.sibling=Bi,Ie=Bi,Te=_t}if(Ke.done)return d(W,Te),st&&ka(W,Re),Ee;if(Te===null){for(;!Ke.done;Re++,Ke=H.next())Ke=se(W,Ke.value,le),Ke!==null&&(F=w(Ke,F,Re),Ie===null?Ee=Ke:Ie.sibling=Ke,Ie=Ke);return st&&ka(W,Re),Ee}for(Te=m(W,Te);!Ke.done;Re++,Ke=H.next())Ke=ve(Te,W,Re,Ke.value,le),Ke!==null&&(i&&Ke.alternate!==null&&Te.delete(Ke.key===null?Re:Ke.key),F=w(Ke,F,Re),Ie===null?Ee=Ke:Ie.sibling=Ke,Ie=Ke);return i&&Te.forEach(function(eM){return s(W,eM)}),st&&ka(W,Re),Ee}function yt(W,F,H,le){if(typeof H=="object"&&H!==null&&H.type===I&&H.key===null&&(H=H.props.children),typeof H=="object"&&H!==null){switch(H.$$typeof){case _:e:{for(var Ee=H.key,Ie=F;Ie!==null;){if(Ie.key===Ee){if(Ee=H.type,Ee===I){if(Ie.tag===7){d(W,Ie.sibling),F=g(Ie,H.props.children),F.return=W,W=F;break e}}else if(Ie.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===ke&&ab(Ee)===Ie.type){d(W,Ie.sibling),F=g(Ie,H.props),F.ref=_l(W,Ie,H),F.return=W,W=F;break e}d(W,Ie);break}else s(W,Ie);Ie=Ie.sibling}H.type===I?(F=Oa(H.props.children,W.mode,le,H.key),F.return=W,W=F):(le=dd(H.type,H.key,H.props,null,W.mode,le),le.ref=_l(W,F,H),le.return=W,W=le)}return E(W);case A:e:{for(Ie=H.key;F!==null;){if(F.key===Ie)if(F.tag===4&&F.stateNode.containerInfo===H.containerInfo&&F.stateNode.implementation===H.implementation){d(W,F.sibling),F=g(F,H.children||[]),F.return=W,W=F;break e}else{d(W,F);break}else s(W,F);F=F.sibling}F=Cm(H,W.mode,le),F.return=W,W=F}return E(W);case ke:return Ie=H._init,yt(W,F,Ie(H._payload),le)}if(Bn(H))return we(W,F,H,le);if(oe(H))return Se(W,F,H,le);Bc(W,H)}return typeof H=="string"&&H!==""||typeof H=="number"?(H=""+H,F!==null&&F.tag===6?(d(W,F.sibling),F=g(F,H),F.return=W,W=F):(d(W,F),F=Pm(H,W.mode,le),F.return=W,W=F),E(W)):d(W,F)}return yt}var Ro=ob(!0),sb=ob(!1),Uc=Oi(null),Wc=null,$o=null,$p=null;function Lp(){$p=$o=Wc=null}function zp(i){var s=Uc.current;nt(Uc),i._currentValue=s}function Fp(i,s,d){for(;i!==null;){var m=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,m!==null&&(m.childLanes|=s)):m!==null&&(m.childLanes&s)!==s&&(m.childLanes|=s),i===d)break;i=i.return}}function Lo(i,s){Wc=i,$p=$o=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&s)!==0&&(hr=!0),i.firstContext=null)}function Rr(i){var s=i._currentValue;if($p!==i)if(i={context:i,memoizedValue:s,next:null},$o===null){if(Wc===null)throw Error(r(308));$o=i,Wc.dependencies={lanes:0,firstContext:i}}else $o=$o.next=i;return s}var ja=null;function Bp(i){ja===null?ja=[i]:ja.push(i)}function lb(i,s,d,m){var g=s.interleaved;return g===null?(d.next=d,Bp(s)):(d.next=g.next,g.next=d),s.interleaved=d,Vn(i,m)}function Vn(i,s){i.lanes|=s;var d=i.alternate;for(d!==null&&(d.lanes|=s),d=i,i=i.return;i!==null;)i.childLanes|=s,d=i.alternate,d!==null&&(d.childLanes|=s),d=i,i=i.return;return d.tag===3?d.stateNode:null}var Ii=!1;function Up(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ub(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function qn(i,s){return{eventTime:i,lane:s,tag:0,payload:null,callback:null,next:null}}function Ti(i,s,d){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(He&2)!==0){var g=m.pending;return g===null?s.next=s:(s.next=g.next,g.next=s),m.pending=s,Vn(i,d)}return g=m.interleaved,g===null?(s.next=s,Bp(m)):(s.next=g.next,g.next=s),m.interleaved=s,Vn(i,d)}function Hc(i,s,d){if(s=s.updateQueue,s!==null&&(s=s.shared,(d&4194240)!==0)){var m=s.lanes;m&=i.pendingLanes,d|=m,s.lanes=d,rp(i,d)}}function cb(i,s){var d=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,d===m)){var g=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var E={eventTime:d.eventTime,lane:d.lane,tag:d.tag,payload:d.payload,callback:d.callback,next:null};w===null?g=w=E:w=w.next=E,d=d.next}while(d!==null);w===null?g=w=s:w=w.next=s}else g=w=s;d={baseState:m.baseState,firstBaseUpdate:g,lastBaseUpdate:w,shared:m.shared,effects:m.effects},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=s:i.next=s,d.lastBaseUpdate=s}function Kc(i,s,d,m){var g=i.updateQueue;Ii=!1;var w=g.firstBaseUpdate,E=g.lastBaseUpdate,M=g.shared.pending;if(M!==null){g.shared.pending=null;var D=M,V=D.next;D.next=null,E===null?w=V:E.next=V,E=D;var ie=i.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==E&&(M===null?ie.firstBaseUpdate=V:M.next=V,ie.lastBaseUpdate=D))}if(w!==null){var se=g.baseState;E=0,ie=V=D=null,M=w;do{var re=M.lane,ve=M.eventTime;if((m&re)===re){ie!==null&&(ie=ie.next={eventTime:ve,lane:0,tag:M.tag,payload:M.payload,callback:M.callback,next:null});e:{var we=i,Se=M;switch(re=s,ve=d,Se.tag){case 1:if(we=Se.payload,typeof we=="function"){se=we.call(ve,se,re);break e}se=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Se.payload,re=typeof we=="function"?we.call(ve,se,re):we,re==null)break e;se=X({},se,re);break e;case 2:Ii=!0}}M.callback!==null&&M.lane!==0&&(i.flags|=64,re=g.effects,re===null?g.effects=[M]:re.push(M))}else ve={eventTime:ve,lane:re,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(V=ie=ve,D=se):ie=ie.next=ve,E|=re;if(M=M.next,M===null){if(M=g.shared.pending,M===null)break;re=M,M=re.next,re.next=null,g.lastBaseUpdate=re,g.shared.pending=null}}while(!0);if(ie===null&&(D=se),g.baseState=D,g.firstBaseUpdate=V,g.lastBaseUpdate=ie,s=g.shared.interleaved,s!==null){g=s;do E|=g.lane,g=g.next;while(g!==s)}else w===null&&(g.shared.lanes=0);Ea|=E,i.lanes=E,i.memoizedState=se}}function db(i,s,d){if(i=s.effects,s.effects=null,i!==null)for(s=0;sd?d:4,i(!0);var m=Vp.transition;Vp.transition={};try{i(!1),s()}finally{Qe=d,Vp.transition=m}}function Ob(){return $r().memoizedState}function S5(i,s,d){var m=Li(i);if(d={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null},_b(i))Mb(s,d);else if(d=lb(i,s,d,m),d!==null){var g=ir();an(d,i,m,g),Ib(d,s,m)}}function N5(i,s,d){var m=Li(i),g={lane:m,action:d,hasEagerState:!1,eagerState:null,next:null};if(_b(i))Mb(s,g);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var E=s.lastRenderedState,M=w(E,d);if(g.hasEagerState=!0,g.eagerState=M,Jr(M,E)){var D=s.interleaved;D===null?(g.next=g,Bp(s)):(g.next=D.next,D.next=g),s.interleaved=g;return}}catch{}finally{}d=lb(i,s,g,m),d!==null&&(g=ir(),an(d,i,m,g),Ib(d,s,m))}}function _b(i){var s=i.alternate;return i===dt||s!==null&&s===dt}function Mb(i,s){Dl=qc=!0;var d=i.pending;d===null?s.next=s:(s.next=d.next,d.next=s),i.pending=s}function Ib(i,s,d){if((d&4194240)!==0){var m=s.lanes;m&=i.pendingLanes,d|=m,s.lanes=d,rp(i,d)}}var Xc={readContext:Rr,useCallback:Yt,useContext:Yt,useEffect:Yt,useImperativeHandle:Yt,useInsertionEffect:Yt,useLayoutEffect:Yt,useMemo:Yt,useReducer:Yt,useRef:Yt,useState:Yt,useDebugValue:Yt,useDeferredValue:Yt,useTransition:Yt,useMutableSource:Yt,useSyncExternalStore:Yt,useId:Yt,unstable_isNewReconciler:!1},E5={readContext:Rr,useCallback:function(i,s){return yn().memoizedState=[i,s===void 0?null:s],i},useContext:Rr,useEffect:kb,useImperativeHandle:function(i,s,d){return d=d!=null?d.concat([i]):null,Qc(4194308,4,Nb.bind(null,s,i),d)},useLayoutEffect:function(i,s){return Qc(4194308,4,i,s)},useInsertionEffect:function(i,s){return Qc(4,2,i,s)},useMemo:function(i,s){var d=yn();return s=s===void 0?null:s,i=i(),d.memoizedState=[i,s],i},useReducer:function(i,s,d){var m=yn();return s=d!==void 0?d(s):s,m.memoizedState=m.baseState=s,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:s},m.queue=i,i=i.dispatch=S5.bind(null,dt,i),[m.memoizedState,i]},useRef:function(i){var s=yn();return i={current:i},s.memoizedState=i},useState:bb,useDebugValue:em,useDeferredValue:function(i){return yn().memoizedState=i},useTransition:function(){var i=bb(!1),s=i[0];return i=j5.bind(null,i[1]),yn().memoizedState=i,[s,i]},useMutableSource:function(){},useSyncExternalStore:function(i,s,d){var m=dt,g=yn();if(st){if(d===void 0)throw Error(r(407));d=d()}else{if(d=s(),Ot===null)throw Error(r(349));(Na&30)!==0||mb(m,s,d)}g.memoizedState=d;var w={value:d,getSnapshot:s};return g.queue=w,kb(gb.bind(null,m,w,i),[i]),m.flags|=2048,Ll(9,vb.bind(null,m,w,d,s),void 0,null),d},useId:function(){var i=yn(),s=Ot.identifierPrefix;if(st){var d=Gn,m=Kn;d=(m&~(1<<32-Zr(m)-1)).toString(32)+d,s=":"+s+"R"+d,d=Rl++,0<\/script>",i=i.removeChild(i.firstChild)):typeof m.is=="string"?i=E.createElement(d,{is:m.is}):(i=E.createElement(d),d==="select"&&(E=i,m.multiple?E.multiple=!0:m.size&&(E.size=m.size))):i=E.createElementNS(i,d),i[vn]=s,i[Al]=m,Jb(i,s,!1,!1),s.stateNode=i;e:{switch(E=Pe(d,m),d){case"dialog":rt("cancel",i),rt("close",i),g=m;break;case"iframe":case"object":case"embed":rt("load",i),g=m;break;case"video":case"audio":for(g=0;gWo&&(s.flags|=128,m=!0,zl(w,!1),s.lanes=4194304)}else{if(!m)if(i=Kc(E),i!==null){if(s.flags|=128,m=!0,d=i.updateQueue,d!==null&&(s.updateQueue=d,s.flags|=4),zl(w,!0),w.tail===null&&w.tailMode==="hidden"&&!E.alternate&&!st)return Xt(s),null}else 2*gt()-w.renderingStartTime>Wo&&d!==1073741824&&(s.flags|=128,m=!0,zl(w,!1),s.lanes=4194304);w.isBackwards?(E.sibling=s.child,s.child=E):(d=w.last,d!==null?d.sibling=E:s.child=E,w.last=E)}return w.tail!==null?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=gt(),s.sibling=null,d=ct.current,Je(ct,m?d&1|2:d&1),s):(Xt(s),null);case 22:case 23:return Sm(),m=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==m&&(s.flags|=8192),m&&(s.mode&1)!==0?(Er&1073741824)!==0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function I5(i,s){switch(Ip(s),s.tag){case 1:return dr(s.type)&&Tc(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return zo(),nt(cr),nt(Qt),Vp(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return Hp(s),null;case 13:if(nt(ct),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Do()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return nt(ct),null;case 4:return zo(),null;case 10:return zp(s.type._context),null;case 22:case 23:return Sm(),null;case 24:return null;default:return null}}var ed=!1,Zt=!1,T5=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Bo(i,s){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){ft(i,s,m)}else d.current=null}function fm(i,s,d){try{d()}catch(m){ft(i,s,m)}}var r1=!1;function D5(i,s){if(Sp=bc,i=Tx(),vp(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var g=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var E=0,M=-1,D=-1,G=0,ie=0,se=i,re=null;t:for(;;){for(var ve;se!==d||g!==0&&se.nodeType!==3||(M=E+g),se!==w||m!==0&&se.nodeType!==3||(D=E+m),se.nodeType===3&&(E+=se.nodeValue.length),(ve=se.firstChild)!==null;)re=se,se=ve;for(;;){if(se===i)break t;if(re===d&&++G===g&&(M=E),re===w&&++ie===m&&(D=E),(ve=se.nextSibling)!==null)break;se=re,re=se.parentNode}se=ve}d=M===-1||D===-1?null:{start:M,end:D}}else d=null}d=d||{start:0,end:0}}else d=null;for(Np={focusedElem:i,selectionRange:d},bc=!1,xe=s;xe!==null;)if(s=xe,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,xe=i;else for(;xe!==null;){s=xe;try{var we=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,yt=we.memoizedState,W=s.stateNode,z=W.getSnapshotBeforeUpdate(s.elementType===s.type?Se:tn(s.type,Se),yt);W.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var H=s.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(le){ft(s,s.return,le)}if(i=s.sibling,i!==null){i.return=s.return,xe=i;break}xe=s.return}return we=r1,r1=!1,we}function Fl(i,s,d){var m=s.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var g=m=m.next;do{if((g.tag&i)===i){var w=g.destroy;g.destroy=void 0,w!==void 0&&fm(s,d,w)}g=g.next}while(g!==m)}}function td(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var d=s=s.next;do{if((d.tag&i)===i){var m=d.create;d.destroy=m()}d=d.next}while(d!==s)}}function hm(i){var s=i.ref;if(s!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof s=="function"?s(i):s.current=i}}function n1(i){var s=i.alternate;s!==null&&(i.alternate=null,n1(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[vn],delete s[Al],delete s[Ap],delete s[g5],delete s[y5])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function i1(i){return i.tag===5||i.tag===3||i.tag===4}function a1(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||i1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function pm(i,s,d){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?d.nodeType===8?d.parentNode.insertBefore(i,s):d.insertBefore(i,s):(d.nodeType===8?(s=d.parentNode,s.insertBefore(i,d)):(s=d,s.appendChild(i)),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=Mc));else if(m!==4&&(i=i.child,i!==null))for(pm(i,s,d),i=i.sibling;i!==null;)pm(i,s,d),i=i.sibling}function mm(i,s,d){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?d.insertBefore(i,s):d.appendChild(i);else if(m!==4&&(i=i.child,i!==null))for(mm(i,s,d),i=i.sibling;i!==null;)mm(i,s,d),i=i.sibling}var Lt=null,rn=!1;function Di(i,s,d){for(d=d.child;d!==null;)o1(i,s,d),d=d.sibling}function o1(i,s,d){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(pc,d)}catch{}switch(d.tag){case 5:Zt||Bo(d,s);case 6:var m=Lt,g=rn;Lt=null,Di(i,s,d),Lt=m,rn=g,Lt!==null&&(rn?(i=Lt,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):Lt.removeChild(d.stateNode));break;case 18:Lt!==null&&(rn?(i=Lt,d=d.stateNode,i.nodeType===8?Cp(i.parentNode,d):i.nodeType===1&&Cp(i,d),yl(i)):Cp(Lt,d.stateNode));break;case 4:m=Lt,g=rn,Lt=d.stateNode.containerInfo,rn=!0,Di(i,s,d),Lt=m,rn=g;break;case 0:case 11:case 14:case 15:if(!Zt&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){g=m=m.next;do{var w=g,E=w.destroy;w=w.tag,E!==void 0&&((w&2)!==0||(w&4)!==0)&&fm(d,s,E),g=g.next}while(g!==m)}Di(i,s,d);break;case 1:if(!Zt&&(Bo(d,s),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(M){ft(d,s,M)}Di(i,s,d);break;case 21:Di(i,s,d);break;case 22:d.mode&1?(Zt=(m=Zt)||d.memoizedState!==null,Di(i,s,d),Zt=m):Di(i,s,d);break;default:Di(i,s,d)}}function s1(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new T5),s.forEach(function(m){var g=H5.bind(null,i,m);d.has(m)||(d.add(m),m.then(g,g))})}}function nn(i,s){var d=s.deletions;if(d!==null)for(var m=0;mg&&(g=E),m&=~w}if(m=g,m=gt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*$5(m/1960))-m,10i?16:i,$i===null)var m=!1;else{if(i=$i,$i=null,od=0,(He&6)!==0)throw Error(r(331));var g=He;for(He|=4,xe=i.current;xe!==null;){var w=xe,E=w.child;if((xe.flags&16)!==0){var M=w.deletions;if(M!==null){for(var D=0;Dgt()-ym?Ca(i,0):gm|=d),pr(i,s)}function b1(i,s){s===0&&((i.mode&1)===0?s=1:(s=vc,vc<<=1,(vc&130023424)===0&&(vc=4194304)));var d=ir();i=Gn(i,s),i!==null&&(hl(i,s,d),pr(i,d))}function W5(i){var s=i.memoizedState,d=0;s!==null&&(d=s.retryLane),b1(i,d)}function H5(i,s){var d=0;switch(i.tag){case 13:var m=i.stateNode,g=i.memoizedState;g!==null&&(d=g.retryLane);break;case 19:m=i.stateNode;break;default:throw Error(r(314))}m!==null&&m.delete(s),b1(i,d)}var w1;w1=function(i,s,d){if(i!==null)if(i.memoizedProps!==s.pendingProps||cr.current)fr=!0;else{if((i.lanes&d)===0&&(s.flags&128)===0)return fr=!1,_5(i,s,d);fr=(i.flags&131072)!==0}else fr=!1,st&&(s.flags&1048576)!==0&&eb(s,Lc,s.index);switch(s.lanes=0,s.tag){case 2:var m=s.type;Jc(i,s),i=s.pendingProps;var g=Mo(s,Qt.current);Lo(s,d),g=Qp(null,s,m,i,g,d);var w=Yp();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,dr(m)?(w=!0,Dc(s)):w=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Up(s),g.updater=Xc,s.stateNode=g,g._reactInternals=s,rm(s,m,i,d),s=om(null,s,m,!0,w,d)):(s.tag=0,st&&w&&Mp(s),nr(null,s,g,d),s=s.child),s;case 16:m=s.elementType;e:{switch(Jc(i,s),i=s.pendingProps,g=m._init,m=g(m._payload),s.type=m,g=s.tag=V5(m),i=tn(m,i),g){case 0:s=am(null,s,m,i,d);break e;case 1:s=Gb(null,s,m,i,d);break e;case 11:s=Ub(null,s,m,i,d);break e;case 14:s=Wb(null,s,m,tn(m.type,i),d);break e}throw Error(r(306,m,""))}return s;case 0:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),am(i,s,m,g,d);case 1:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),Gb(i,s,m,g,d);case 3:e:{if(qb(s),i===null)throw Error(r(387));m=s.pendingProps,w=s.memoizedState,g=w.element,ub(i,s),Hc(s,m,null,d);var E=s.memoizedState;if(m=E.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){g=Fo(Error(r(423)),s),s=Qb(i,s,m,d,g);break e}else if(m!==g){g=Fo(Error(r(424)),s),s=Qb(i,s,m,d,g);break e}else for(Nr=Ai(s.stateNode.containerInfo.firstChild),Sr=s,st=!0,en=null,d=sb(s,null,m,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Do(),m===g){s=Qn(i,s,d);break e}nr(i,s,m,d)}s=s.child}return s;case 5:return fb(s),i===null&&Dp(s),m=s.type,g=s.pendingProps,w=i!==null?i.memoizedProps:null,E=g.children,Ep(m,g)?E=null:w!==null&&Ep(m,w)&&(s.flags|=32),Vb(i,s),nr(i,s,E,d),s.child;case 6:return i===null&&Dp(s),null;case 13:return Yb(i,s,d);case 4:return Wp(s,s.stateNode.containerInfo),m=s.pendingProps,i===null?s.child=Ro(s,null,m,d):nr(i,s,m,d),s.child;case 11:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),Ub(i,s,m,g,d);case 7:return nr(i,s,s.pendingProps,d),s.child;case 8:return nr(i,s,s.pendingProps.children,d),s.child;case 12:return nr(i,s,s.pendingProps.children,d),s.child;case 10:e:{if(m=s.type._context,g=s.pendingProps,w=s.memoizedProps,E=g.value,Je(Bc,m._currentValue),m._currentValue=E,w!==null)if(Jr(w.value,E)){if(w.children===g.children&&!cr.current){s=Qn(i,s,d);break e}}else for(w=s.child,w!==null&&(w.return=s);w!==null;){var M=w.dependencies;if(M!==null){E=w.child;for(var D=M.firstContext;D!==null;){if(D.context===m){if(w.tag===1){D=qn(-1,d&-d),D.tag=2;var G=w.updateQueue;if(G!==null){G=G.shared;var ie=G.pending;ie===null?D.next=D:(D.next=ie.next,ie.next=D),G.pending=D}}w.lanes|=d,D=w.alternate,D!==null&&(D.lanes|=d),Fp(w.return,d,s),M.lanes|=d;break}D=D.next}}else if(w.tag===10)E=w.type===s.type?null:w.child;else if(w.tag===18){if(E=w.return,E===null)throw Error(r(341));E.lanes|=d,M=E.alternate,M!==null&&(M.lanes|=d),Fp(E,d,s),E=w.sibling}else E=w.child;if(E!==null)E.return=w;else for(E=w;E!==null;){if(E===s){E=null;break}if(w=E.sibling,w!==null){w.return=E.return,E=w;break}E=E.return}w=E}nr(i,s,g.children,d),s=s.child}return s;case 9:return g=s.type,m=s.pendingProps.children,Lo(s,d),g=Rr(g),m=m(g),s.flags|=1,nr(i,s,m,d),s.child;case 14:return m=s.type,g=tn(m,s.pendingProps),g=tn(m.type,g),Wb(i,s,m,g,d);case 15:return Hb(i,s,s.type,s.pendingProps,d);case 17:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),Jc(i,s),s.tag=1,dr(m)?(i=!0,Dc(s)):i=!1,Lo(s,d),Db(s,m,g),rm(s,m,g,d),om(null,s,m,!0,i,d);case 19:return Zb(i,s,d);case 22:return Kb(i,s,d)}throw Error(r(156,s.tag))};function j1(i,s){return tx(i,s)}function K5(i,s,d,m){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zr(i,s,d,m){return new K5(i,s,d,m)}function Em(i){return i=i.prototype,!(!i||!i.isReactComponent)}function V5(i){if(typeof i=="function")return Em(i)?1:0;if(i!=null){if(i=i.$$typeof,i===R)return 11;if(i===ge)return 14}return 2}function Fi(i,s){var d=i.alternate;return d===null?(d=zr(i.tag,s,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=s,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,s=i.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function cd(i,s,d,m,g,w){var E=2;if(m=i,typeof i=="function")Em(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case I:return Oa(d.children,g,w,s);case U:E=8,g|=8;break;case B:return i=zr(12,d,s,g|2),i.elementType=B,i.lanes=w,i;case de:return i=zr(13,d,s,g),i.elementType=de,i.lanes=w,i;case Z:return i=zr(19,d,s,g),i.elementType=Z,i.lanes=w,i;case me:return dd(d,g,w,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case V:E=10;break e;case q:E=9;break e;case R:E=11;break e;case ge:E=14;break e;case je:E=16,m=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return s=zr(E,d,s,g),s.elementType=i,s.type=m,s.lanes=w,s}function Oa(i,s,d,m){return i=zr(7,i,m,s),i.lanes=d,i}function dd(i,s,d,m){return i=zr(22,i,m,s),i.elementType=me,i.lanes=d,i.stateNode={isHidden:!1},i}function Pm(i,s,d){return i=zr(6,i,null,s),i.lanes=d,i}function Cm(i,s,d){return s=zr(4,i.children!==null?i.children:[],i.key,s),s.lanes=d,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function G5(i,s,d,m,g){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tp(0),this.expirationTimes=tp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tp(0),this.identifierPrefix=m,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Am(i,s,d,m,g,w,E,M,D){return i=new G5(i,s,d,M,D),s===1?(s=1,w===!0&&(s|=8)):s=0,w=zr(3,null,null,s),i.current=w,w.stateNode=i,w.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Up(w),i}function q5(i,s,d){var m=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Rm.exports=lM(),Rm.exports}var $1;function uM(){if($1)return bd;$1=1;var e=RN();return bd.createRoot=e.createRoot,bd.hydrateRoot=e.hydrateRoot,bd}var cM=uM();const dM=ty(cM);var Ku=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ka,Yi,ps,NN,fM=(NN=class extends Ku{constructor(){super();Te(this,Ka);Te(this,Yi);Te(this,ps);ye(this,ps,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){L(this,Yi)||this.setEventListener(L(this,ps))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,Yi))==null||t.call(this),ye(this,Yi,void 0))}setEventListener(t){var r;ye(this,ps,t),(r=L(this,Yi))==null||r.call(this),ye(this,Yi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){L(this,Ka)!==t&&(ye(this,Ka,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof L(this,Ka)=="boolean"?L(this,Ka):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ka=new WeakMap,Yi=new WeakMap,ps=new WeakMap,NN),ry=new fM,hM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xi,ey,EN,pM=(EN=class{constructor(){Te(this,Xi,hM);Te(this,ey,!1)}setTimeoutProvider(e){ye(this,Xi,e)}setTimeout(e,t){return L(this,Xi).setTimeout(e,t)}clearTimeout(e){L(this,Xi).clearTimeout(e)}setInterval(e,t){return L(this,Xi).setInterval(e,t)}clearInterval(e){L(this,Xi).clearInterval(e)}},Xi=new WeakMap,ey=new WeakMap,EN),za=new pM;function mM(e){setTimeout(e,0)}var vM=typeof window>"u"||"Deno"in globalThis;function gr(){}function gM(e,t){return typeof e=="function"?e(t):e}function Mv(e){return typeof e=="number"&&e>=0&&e!==1/0}function $N(e,t){return Math.max(e+(t||0)-Date.now(),0)}function aa(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function L1(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:o,queryKey:u,stale:l}=e;if(u){if(n){if(t.queryHash!==ny(u,t.options))return!1}else if(!pu(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||o&&!o(t))}function z1(e,t){const{exact:r,status:n,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(hu(t.options.mutationKey)!==hu(o))return!1}else if(!pu(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function ny(e,t){return((t==null?void 0:t.queryKeyHashFn)||hu)(e)}function hu(e){return JSON.stringify(e,(t,r)=>Tv(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function pu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>pu(e[r],t[r])):!1}var yM=Object.prototype.hasOwnProperty;function LN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=F1(e)&&F1(t);if(!n&&!(Tv(e)&&Tv(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),l=u.length,f=n?new Array(l):{};let h=0;for(let p=0;p{za.setTimeout(t,e)})}function Dv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?LN(e,t):t}function bM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function wM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var iy=Symbol();function zN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===iy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function FN(e,t){return typeof e=="function"?e(...t):!!e}function jM(e,t,r){let n=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),n||(n=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),e}var mu=(()=>{let e=()=>vM;return{isServer(){return e()},setIsServer(t){e=t}}})();function Rv(){let e,t;const r=new Promise((a,o)=>{e=a,t=o});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}var kM=mM;function SM(){let e=[],t=0,r=l=>{l()},n=l=>{l()},a=kM;const o=l=>{t?e.push(l):a(()=>{r(l)})},u=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(f=>{r(f)})})})};return{batch:l=>{let f;t++;try{f=l()}finally{t--,t||u()}return f},batchCalls:l=>(...f)=>{o(()=>{l(...f)})},schedule:o,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var Wt=SM(),ms,Zi,vs,PN,NM=(PN=class extends Ku{constructor(){super();Te(this,ms,!0);Te(this,Zi);Te(this,vs);ye(this,vs,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){L(this,Zi)||this.setEventListener(L(this,vs))}onUnsubscribe(){var t;this.hasListeners()||((t=L(this,Zi))==null||t.call(this),ye(this,Zi,void 0))}setEventListener(t){var r;ye(this,vs,t),(r=L(this,Zi))==null||r.call(this),ye(this,Zi,t(this.setOnline.bind(this)))}setOnline(t){L(this,ms)!==t&&(ye(this,ms,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return L(this,ms)}},ms=new WeakMap,Zi=new WeakMap,vs=new WeakMap,PN),rf=new NM;function EM(e){return Math.min(1e3*2**e,3e4)}function BN(e){return(e??"online")==="online"?rf.isOnline():!0}var $v=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function UN(e){let t=!1,r=0,n;const a=Rv(),o=()=>a.status!=="pending",u=k=>{var S;if(!o()){const N=new $v(k);x(N),(S=e.onCancel)==null||S.call(e,N)}},l=()=>{t=!0},f=()=>{t=!1},h=()=>ry.isFocused()&&(e.networkMode==="always"||rf.isOnline())&&e.canRun(),p=()=>BN(e.networkMode)&&e.canRun(),v=k=>{o()||(n==null||n(),a.resolve(k))},x=k=>{o()||(n==null||n(),a.reject(k))},b=()=>new Promise(k=>{var S;n=N=>{(o()||h())&&k(N)},(S=e.onPause)==null||S.call(e)}).then(()=>{var k;n=void 0,o()||(k=e.onContinue)==null||k.call(e)}),j=()=>{if(o())return;let k;const S=r===0?e.initialPromise:void 0;try{k=S??e.fn()}catch(N){k=Promise.reject(N)}Promise.resolve(k).then(v).catch(N=>{var A;if(o())return;const P=e.retry??(mu.isServer()?0:3),O=e.retryDelay??EM,C=typeof O=="function"?O(r,N):O,_=P===!0||typeof P=="number"&&rh()?void 0:b()).then(()=>{t?x(N):j()})})};return{promise:a,status:()=>a.status,cancel:u,continue:()=>(n==null||n(),a),cancelRetry:l,continueRetry:f,canStart:p,start:()=>(p()?j():b().then(j),a)}}var Va,CN,WN=(CN=class{constructor(){Te(this,Va)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mv(this.gcTime)&&ye(this,Va,za.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(mu.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,Va)!==void 0&&(za.clearTimeout(L(this,Va)),ye(this,Va,void 0))}},Va=new WeakMap,CN);function PM(e){return{onFetch:(t,r)=>{var p,v,x,b,j;const n=t.options,a=(x=(v=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],u=((j=t.state.data)==null?void 0:j.pageParams)||[];let l={pages:[],pageParams:[]},f=0;const h=async()=>{let k=!1;const S=O=>{jM(O,()=>t.signal,()=>k=!0)},N=zN(t.options,t.fetchOptions),P=async(O,C,_)=>{if(k)return Promise.reject(t.signal.reason);if(C==null&&O.pages.length)return Promise.resolve(O);const I=(()=>{const q={client:t.client,queryKey:t.queryKey,pageParam:C,direction:_?"backward":"forward",meta:t.options.meta};return S(q),q})(),U=await N(I),{maxPages:B}=t.options,V=_?wM:bM;return{pages:V(O.pages,U,B),pageParams:V(O.pageParams,C,B)}};if(a&&o.length){const O=a==="backward",C=O?CM:U1,_={pages:o,pageParams:u},A=C(n,_);l=await P(_,A,O)}else{const O=e??o.length;do{const C=f===0?u[0]??n.initialPageParam:U1(n,l);if(f>0&&C==null)break;l=await P(l,C),f++}while(f{var k,S;return(S=(k=t.options).persister)==null?void 0:S.call(k,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function U1(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function CM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var gs,Ga,ys,Ur,qa,Mt,Fu,Qa,Pr,HN,Zn,AN,AM=(AN=class extends WN{constructor(t){super();Te(this,Pr);Te(this,gs);Te(this,Ga);Te(this,ys);Te(this,Ur);Te(this,qa);Te(this,Mt);Te(this,Fu);Te(this,Qa);ye(this,Qa,!1),ye(this,Fu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,qa,t.client),ye(this,Ur,L(this,qa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,Ga,H1(this.options)),this.state=t.state??L(this,Ga),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,gs)}get promise(){var t;return(t=L(this,Mt))==null?void 0:t.promise}setOptions(t){if(this.options={...L(this,Fu),...t},t!=null&&t._type&&ye(this,gs,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=H1(this.options);r.data!==void 0&&(this.setState(W1(r.data,r.dataUpdatedAt)),ye(this,Ga,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,Ur).remove(this)}setData(t,r){const n=Dv(this.state.data,t,this.options);return Fe(this,Pr,Zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Fe(this,Pr,Zn).call(this,{type:"setState",state:t})}cancel(t){var n,a;const r=(n=L(this,Mt))==null?void 0:n.promise;return(a=L(this,Mt))==null||a.cancel(t),r?r.then(gr).catch(gr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,Ga)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===iy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>aa(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!$N(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Mt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=L(this,Mt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),L(this,Ur).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(L(this,Mt)&&(L(this,Qa)||Fe(this,Pr,HN).call(this)?L(this,Mt).cancel({revert:!0}):L(this,Mt).cancelRetry()),this.scheduleGc()),L(this,Ur).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fe(this,Pr,Zn).call(this,{type:"invalidate"})}async fetch(t,r){var h,p,v,x,b,j,k,S,N,P,O;if(this.state.fetchStatus!=="idle"&&((h=L(this,Mt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(L(this,Mt))return L(this,Mt).continueRetry(),L(this,Mt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(_=>_.options.queryFn);C&&this.setOptions(C.options)}const n=new AbortController,a=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(ye(this,Qa,!0),n.signal)})},o=()=>{const C=zN(this.options,r),A=(()=>{const I={client:L(this,qa),queryKey:this.queryKey,meta:this.meta};return a(I),I})();return ye(this,Qa,!1),this.options.persister?this.options.persister(C,A,this):C(A)},l=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:L(this,qa),state:this.state,fetchFn:o};return a(C),C})(),f=L(this,gs)==="infinite"?PM(this.options.pages):this.options.behavior;f==null||f.onFetch(l,this),ye(this,ys,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&Fe(this,Pr,Zn).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta}),ye(this,Mt,UN({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:C=>{C instanceof $v&&C.revert&&this.setState({...L(this,ys),fetchStatus:"idle"}),n.abort()},onFail:(C,_)=>{Fe(this,Pr,Zn).call(this,{type:"failed",failureCount:C,error:_})},onPause:()=>{Fe(this,Pr,Zn).call(this,{type:"pause"})},onContinue:()=>{Fe(this,Pr,Zn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const C=await L(this,Mt).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(b=(x=L(this,Ur).config).onSuccess)==null||b.call(x,C,this),(k=(j=L(this,Ur).config).onSettled)==null||k.call(j,C,this.state.error,this),C}catch(C){if(C instanceof $v){if(C.silent)return L(this,Mt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Fe(this,Pr,Zn).call(this,{type:"error",error:C}),(N=(S=L(this,Ur).config).onError)==null||N.call(S,C,this),(O=(P=L(this,Ur).config).onSettled)==null||O.call(P,this.state.data,C,this),C}finally{this.scheduleGc()}}},gs=new WeakMap,Ga=new WeakMap,ys=new WeakMap,Ur=new WeakMap,qa=new WeakMap,Mt=new WeakMap,Fu=new WeakMap,Qa=new WeakMap,Pr=new WeakSet,HN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...KN(n.data,this.options),fetchMeta:t.meta??null};case"success":const a={...n,...W1(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,ys,t.manual?a:void 0),a;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),L(this,Ur).notify({query:this,type:"updated",action:t})})},AN);function KN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:BN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function W1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function H1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var vr,Ue,Bu,ar,Ya,xs,ei,Ji,Uu,bs,ws,Xa,Za,ea,js,qe,au,Lv,zv,Fv,Bv,Uv,Wv,Hv,VN,ON,OM=(ON=class extends Ku{constructor(t,r){super();Te(this,qe);Te(this,vr);Te(this,Ue);Te(this,Bu);Te(this,ar);Te(this,Ya);Te(this,xs);Te(this,ei);Te(this,Ji);Te(this,Uu);Te(this,bs);Te(this,ws);Te(this,Xa);Te(this,Za);Te(this,ea);Te(this,js,new Set);this.options=r,ye(this,vr,t),ye(this,Ji,null),ye(this,ei,Rv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,Ue).addObserver(this),K1(L(this,Ue),this.options)?Fe(this,qe,au).call(this):this.updateResult(),Fe(this,qe,Bv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kv(L(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kv(L(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fe(this,qe,Uv).call(this),Fe(this,qe,Wv).call(this),L(this,Ue).removeObserver(this)}setOptions(t){const r=this.options,n=L(this,Ue);if(this.options=L(this,vr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,L(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fe(this,qe,Hv).call(this),L(this,Ue).setOptions(this.options),r._defaulted&&!Iv(this.options,r)&&L(this,vr).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,Ue),observer:this});const a=this.hasListeners();a&&V1(L(this,Ue),n,this.options,r)&&Fe(this,qe,au).call(this),this.updateResult(),a&&(L(this,Ue)!==n||Cr(this.options.enabled,L(this,Ue))!==Cr(r.enabled,L(this,Ue))||aa(this.options.staleTime,L(this,Ue))!==aa(r.staleTime,L(this,Ue)))&&Fe(this,qe,Lv).call(this);const o=Fe(this,qe,zv).call(this);a&&(L(this,Ue)!==n||Cr(this.options.enabled,L(this,Ue))!==Cr(r.enabled,L(this,Ue))||o!==L(this,ea))&&Fe(this,qe,Fv).call(this,o)}getOptimisticResult(t){const r=L(this,vr).getQueryCache().build(L(this,vr),t),n=this.createResult(r,t);return MM(this,n)&&(ye(this,ar,n),ye(this,xs,this.options),ye(this,Ya,L(this,Ue).state)),n}getCurrentResult(){return L(this,ar)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,ei).status==="pending"&&L(this,ei).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(t){L(this,js).add(t)}getCurrentQuery(){return L(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=L(this,vr).defaultQueryOptions(t),n=L(this,vr).getQueryCache().build(L(this,vr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Fe(this,qe,au).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,ar)))}createResult(t,r){var B;const n=L(this,Ue),a=this.options,o=L(this,ar),u=L(this,Ya),l=L(this,xs),h=t!==n?t.state:L(this,Bu),{state:p}=t;let v={...p},x=!1,b;if(r._optimisticResults){const V=this.hasListeners(),q=!V&&K1(t,r),R=V&&V1(t,n,r,a);(q||R)&&(v={...v,...KN(p.data,t.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:j,errorUpdatedAt:k,status:S}=v;b=v.data;let N=!1;if(r.placeholderData!==void 0&&b===void 0&&S==="pending"){let V;o!=null&&o.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(V=o.data,N=!0):V=typeof r.placeholderData=="function"?r.placeholderData((B=L(this,ws))==null?void 0:B.state.data,L(this,ws)):r.placeholderData,V!==void 0&&(S="success",b=Dv(o==null?void 0:o.data,V,r),x=!0)}if(r.select&&b!==void 0&&!N)if(o&&b===(u==null?void 0:u.data)&&r.select===L(this,Uu))b=L(this,bs);else try{ye(this,Uu,r.select),b=r.select(b),b=Dv(o==null?void 0:o.data,b,r),ye(this,bs,b),ye(this,Ji,null)}catch(V){ye(this,Ji,V)}L(this,Ji)&&(j=L(this,Ji),b=L(this,bs),k=Date.now(),S="error");const P=v.fetchStatus==="fetching",O=S==="pending",C=S==="error",_=O&&P,A=b!==void 0,U={status:S,fetchStatus:v.fetchStatus,isPending:O,isSuccess:S==="success",isError:C,isInitialLoading:_,isLoading:_,data:b,dataUpdatedAt:v.dataUpdatedAt,error:j,errorUpdatedAt:k,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>h.dataUpdateCount||v.errorUpdateCount>h.errorUpdateCount,isFetching:P,isRefetching:P&&!O,isLoadingError:C&&!A,isPaused:v.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:C&&A,isStale:ay(t,r),refetch:this.refetch,promise:L(this,ei),isEnabled:Cr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const V=U.data!==void 0,q=U.status==="error"&&!V,R=ge=>{q?ge.reject(U.error):V&&ge.resolve(U.data)},de=()=>{const ge=ye(this,ei,U.promise=Rv());R(ge)},Z=L(this,ei);switch(Z.status){case"pending":t.queryHash===n.queryHash&&R(Z);break;case"fulfilled":(q||U.data!==Z.value)&&de();break;case"rejected":(!q||U.error!==Z.reason)&&de();break}}return U}updateResult(){const t=L(this,ar),r=this.createResult(L(this,Ue),this.options);if(ye(this,Ya,L(this,Ue).state),ye(this,xs,this.options),L(this,Ya).data!==void 0&&ye(this,ws,L(this,Ue)),Iv(r,t))return;ye(this,ar,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!L(this,js).size)return!0;const u=new Set(o??L(this,js));return this.options.throwOnError&&u.add("error"),Object.keys(L(this,ar)).some(l=>{const f=l;return L(this,ar)[f]!==t[f]&&u.has(f)})};Fe(this,qe,VN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fe(this,qe,Bv).call(this)}},vr=new WeakMap,Ue=new WeakMap,Bu=new WeakMap,ar=new WeakMap,Ya=new WeakMap,xs=new WeakMap,ei=new WeakMap,Ji=new WeakMap,Uu=new WeakMap,bs=new WeakMap,ws=new WeakMap,Xa=new WeakMap,Za=new WeakMap,ea=new WeakMap,js=new WeakMap,qe=new WeakSet,au=function(t){Fe(this,qe,Hv).call(this);let r=L(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(gr)),r},Lv=function(){Fe(this,qe,Uv).call(this);const t=aa(this.options.staleTime,L(this,Ue));if(mu.isServer()||L(this,ar).isStale||!Mv(t))return;const n=$N(L(this,ar).dataUpdatedAt,t)+1;ye(this,Xa,za.setTimeout(()=>{L(this,ar).isStale||this.updateResult()},n))},zv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,Ue)):this.options.refetchInterval)??!1},Fv=function(t){Fe(this,qe,Wv).call(this),ye(this,ea,t),!(mu.isServer()||Cr(this.options.enabled,L(this,Ue))===!1||!Mv(L(this,ea))||L(this,ea)===0)&&ye(this,Za,za.setInterval(()=>{(this.options.refetchIntervalInBackground||ry.isFocused())&&Fe(this,qe,au).call(this)},L(this,ea)))},Bv=function(){Fe(this,qe,Lv).call(this),Fe(this,qe,Fv).call(this,Fe(this,qe,zv).call(this))},Uv=function(){L(this,Xa)!==void 0&&(za.clearTimeout(L(this,Xa)),ye(this,Xa,void 0))},Wv=function(){L(this,Za)!==void 0&&(za.clearInterval(L(this,Za)),ye(this,Za,void 0))},Hv=function(){const t=L(this,vr).getQueryCache().build(L(this,vr),this.options);if(t===L(this,Ue))return;const r=L(this,Ue);ye(this,Ue,t),ye(this,Bu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},VN=function(t){Wt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(L(this,ar))}),L(this,vr).getQueryCache().notify({query:L(this,Ue),type:"observerResultsUpdated"})})},ON);function _M(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Cr(t.retryOnMount,e)===!1)}function K1(e,t){return _M(e,t)||e.state.data!==void 0&&Kv(e,t,t.refetchOnMount)}function Kv(e,t,r){if(Cr(t.enabled,e)!==!1&&aa(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&ay(e,t)}return!1}function V1(e,t,r,n){return(e!==t||Cr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ay(e,r)}function ay(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(aa(t.staleTime,e))}function MM(e,t){return!Iv(e.getCurrentResult(),t)}var Wu,Sn,Jt,Ja,Nn,Ki,_N,IM=(_N=class extends WN{constructor(t){super();Te(this,Nn);Te(this,Wu);Te(this,Sn);Te(this,Jt);Te(this,Ja);ye(this,Wu,t.client),this.mutationId=t.mutationId,ye(this,Jt,t.mutationCache),ye(this,Sn,[]),this.state=t.state||TM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){L(this,Sn).includes(t)||(L(this,Sn).push(t),this.clearGcTimeout(),L(this,Jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Sn,L(this,Sn).filter(r=>r!==t)),this.scheduleGc(),L(this,Jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){L(this,Sn).length||(this.state.status==="pending"?this.scheduleGc():L(this,Jt).remove(this))}continue(){var t;return((t=L(this,Ja))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,l,f,h,p,v,x,b,j,k,S,N,P,O,C,_,A,I;const r=()=>{Fe(this,Nn,Ki).call(this,{type:"continue"})},n={client:L(this,Wu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Ja,UN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(U,B)=>{Fe(this,Nn,Ki).call(this,{type:"failed",failureCount:U,error:B})},onPause:()=>{Fe(this,Nn,Ki).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,Jt).canRun(this)}));const a=this.state.status==="pending",o=!L(this,Ja).canStart();try{if(a)r();else{Fe(this,Nn,Ki).call(this,{type:"pending",variables:t,isPaused:o}),L(this,Jt).config.onMutate&&await L(this,Jt).config.onMutate(t,this,n);const B=await((l=(u=this.options).onMutate)==null?void 0:l.call(u,t,n));B!==this.state.context&&Fe(this,Nn,Ki).call(this,{type:"pending",context:B,variables:t,isPaused:o})}const U=await L(this,Ja).start();return await((h=(f=L(this,Jt).config).onSuccess)==null?void 0:h.call(f,U,t,this.state.context,this,n)),await((v=(p=this.options).onSuccess)==null?void 0:v.call(p,U,t,this.state.context,n)),await((b=(x=L(this,Jt).config).onSettled)==null?void 0:b.call(x,U,null,this.state.variables,this.state.context,this,n)),await((k=(j=this.options).onSettled)==null?void 0:k.call(j,U,null,t,this.state.context,n)),Fe(this,Nn,Ki).call(this,{type:"success",data:U}),U}catch(U){try{await((N=(S=L(this,Jt).config).onError)==null?void 0:N.call(S,U,t,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((O=(P=this.options).onError)==null?void 0:O.call(P,U,t,this.state.context,n))}catch(B){Promise.reject(B)}try{await((_=(C=L(this,Jt).config).onSettled)==null?void 0:_.call(C,void 0,U,this.state.variables,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((I=(A=this.options).onSettled)==null?void 0:I.call(A,void 0,U,t,this.state.context,n))}catch(B){Promise.reject(B)}throw Fe(this,Nn,Ki).call(this,{type:"error",error:U}),U}finally{L(this,Jt).runNext(this)}}},Wu=new WeakMap,Sn=new WeakMap,Jt=new WeakMap,Ja=new WeakMap,Nn=new WeakSet,Ki=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Wt.batch(()=>{L(this,Sn).forEach(n=>{n.onMutationUpdate(t)}),L(this,Jt).notify({mutation:this,type:"updated",action:t})})},_N);function TM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ti,sn,Hu,MN,DM=(MN=class extends Ku{constructor(t={}){super();Te(this,ti);Te(this,sn);Te(this,Hu);this.config=t,ye(this,ti,new Set),ye(this,sn,new Map),ye(this,Hu,0)}build(t,r,n){const a=new IM({client:t,mutationCache:this,mutationId:++xd(this,Hu)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){L(this,ti).add(t);const r=wd(t);if(typeof r=="string"){const n=L(this,sn).get(r);n?n.push(t):L(this,sn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(L(this,ti).delete(t)){const r=wd(t);if(typeof r=="string"){const n=L(this,sn).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&L(this,sn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=wd(t);if(typeof r=="string"){const n=L(this,sn).get(r),a=n==null?void 0:n.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=wd(t);if(typeof r=="string"){const a=(n=L(this,sn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Wt.batch(()=>{L(this,ti).forEach(t=>{this.notify({type:"removed",mutation:t})}),L(this,ti).clear(),L(this,sn).clear()})}getAll(){return Array.from(L(this,ti))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>z1(r,n))}findAll(t={}){return this.getAll().filter(r=>z1(t,r))}notify(t){Wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Wt.batch(()=>Promise.all(t.map(r=>r.continue().catch(gr))))}},ti=new WeakMap,sn=new WeakMap,Hu=new WeakMap,MN);function wd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var En,IN,RM=(IN=class extends Ku{constructor(t={}){super();Te(this,En);this.config=t,ye(this,En,new Map)}build(t,r,n){const a=r.queryKey,o=r.queryHash??ny(a,r);let u=this.get(o);return u||(u=new AM({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){L(this,En).has(t.queryHash)||(L(this,En).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=L(this,En).get(t.queryHash);r&&(t.destroy(),r===t&&L(this,En).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Wt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return L(this,En).get(t)}getAll(){return[...L(this,En).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>L1(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>L1(t,n)):r}notify(t){Wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},En=new WeakMap,IN),ht,ta,ra,ks,Ss,na,Ns,Es,TN,$M=(TN=class{constructor(e={}){Te(this,ht);Te(this,ta);Te(this,ra);Te(this,ks);Te(this,Ss);Te(this,na);Te(this,Ns);Te(this,Es);ye(this,ht,e.queryCache||new RM),ye(this,ta,e.mutationCache||new DM),ye(this,ra,e.defaultOptions||{}),ye(this,ks,new Map),ye(this,Ss,new Map),ye(this,na,0)}mount(){xd(this,na)._++,L(this,na)===1&&(ye(this,Ns,ry.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,ht).onFocus())})),ye(this,Es,rf.subscribe(async e=>{e&&(await this.resumePausedMutations(),L(this,ht).onOnline())})))}unmount(){var e,t;xd(this,na)._--,L(this,na)===0&&((e=L(this,Ns))==null||e.call(this),ye(this,Ns,void 0),(t=L(this,Es))==null||t.call(this),ye(this,Es,void 0))}isFetching(e){return L(this,ht).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return L(this,ta).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,ht).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=L(this,ht).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(aa(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return L(this,ht).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=L(this,ht).get(n.queryHash),o=a==null?void 0:a.state.data,u=gM(t,o);if(u!==void 0)return L(this,ht).build(this,n).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Wt.batch(()=>L(this,ht).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=L(this,ht).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=L(this,ht);Wt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=L(this,ht);return Wt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Wt.batch(()=>L(this,ht).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(gr).catch(gr)}invalidateQueries(e,t={}){return Wt.batch(()=>(L(this,ht).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Wt.batch(()=>L(this,ht).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,r);return r.throwOnError||(o=o.catch(gr)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(gr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=L(this,ht).build(this,t);return r.isStaleByTime(aa(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(gr).catch(gr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(gr).catch(gr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return rf.isOnline()?L(this,ta).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,ht)}getMutationCache(){return L(this,ta)}getDefaultOptions(){return L(this,ra)}setDefaultOptions(e){ye(this,ra,e)}setQueryDefaults(e,t){L(this,ks).set(hu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...L(this,ks).values()],r={};return t.forEach(n=>{pu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){L(this,Ss).set(hu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...L(this,Ss).values()],r={};return t.forEach(n=>{pu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...L(this,ra).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ny(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===iy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...L(this,ra).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){L(this,ht).clear(),L(this,ta).clear()}},ht=new WeakMap,ta=new WeakMap,ra=new WeakMap,ks=new WeakMap,Ss=new WeakMap,na=new WeakMap,Ns=new WeakMap,Es=new WeakMap,TN),GN=y.createContext(void 0),po=e=>{const t=y.useContext(GN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},LM=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(GN.Provider,{value:e,children:t})),qN=y.createContext(!1),zM=()=>y.useContext(qN);qN.Provider;function FM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var BM=y.createContext(FM()),UM=()=>y.useContext(BM),WM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?FN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},HM=e=>{y.useEffect(()=>{e.clearReset()},[e])},KM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||FN(r,[e.error,n])),VM=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...a)=>r(n(...a)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},GM=(e,t)=>e.isLoading&&e.isFetching&&!t,qM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,G1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function QM(e,t,r){var b,j,k,S;const n=zM(),a=UM(),o=po(),u=o.defaultQueryOptions(e);(j=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||j.call(b,u);const l=o.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=n?"isRestoring":f?"optimistic":void 0,VM(u),WM(u,a,l),HM(a);const h=!o.getQueryCache().get(u.queryHash),[p]=y.useState(()=>new t(o,u)),v=p.getOptimisticResult(u),x=!n&&f;if(y.useSyncExternalStore(y.useCallback(N=>{const P=x?p.subscribe(Wt.batchCalls(N)):gr;return p.updateResult(),P},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setOptions(u)},[u,p]),qM(u,v))throw G1(u,p,a);if(KM({result:v,errorResetBoundary:a,throwOnError:u.throwOnError,query:l,suspense:u.suspense}))throw v.error;if((S=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||S.call(k,u,v),u.experimental_prefetchInRender&&!mu.isServer()&&GM(v,n)){const N=h?G1(u,p,a):l==null?void 0:l.promise;N==null||N.catch(gr).finally(()=>{p.updateResult()})}return u.notifyOnChangeProps?v:p.trackResult(v)}function br(e,t){return QM(e,OM)}/** +`+w.stack}return{value:i,source:s,stack:g,digest:null}}function nm(i,s,d){return{value:i,source:null,stack:d??null,digest:s??null}}function im(i,s){try{console.error(s.value)}catch(d){setTimeout(function(){throw d})}}var A5=typeof WeakMap=="function"?WeakMap:Map;function $b(i,s,d){d=qn(-1,d),d.tag=3,d.payload={element:null};var m=s.value;return d.callback=function(){ad||(ad=!0,xm=m),im(i,s)},d}function Lb(i,s,d){d=qn(-1,d),d.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var g=s.value;d.payload=function(){return m(g)},d.callback=function(){im(i,s)}}var w=i.stateNode;return w!==null&&typeof w.componentDidCatch=="function"&&(d.callback=function(){im(i,s),typeof m!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var E=s.stack;this.componentDidCatch(s.value,{componentStack:E!==null?E:""})}),d}function zb(i,s,d){var m=i.pingCache;if(m===null){m=i.pingCache=new A5;var g=new Set;m.set(s,g)}else g=m.get(s),g===void 0&&(g=new Set,m.set(s,g));g.has(d)||(g.add(d),i=W5.bind(null,i,s,d),s.then(i,i))}function Fb(i){do{var s;if((s=i.tag===13)&&(s=i.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return i;i=i.return}while(i!==null);return null}function Bb(i,s,d,m,g){return(i.mode&1)===0?(i===s?i.flags|=65536:(i.flags|=128,d.flags|=131072,d.flags&=-52805,d.tag===1&&(d.alternate===null?d.tag=17:(s=qn(-1,1),s.tag=2,Ti(d,s,1))),d.lanes|=1),i):(i.flags|=65536,i.lanes=g,i)}var O5=C.ReactCurrentOwner,hr=!1;function nr(i,s,d,m){s.child=i===null?sb(s,null,d,m):Ro(s,i.child,d,m)}function Ub(i,s,d,m,g){d=d.render;var w=s.ref;return Lo(s,g),m=Qp(i,s,d,m,w,g),d=Yp(),i!==null&&!hr?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Qn(i,s,g)):(st&&d&&Mp(s),s.flags|=1,nr(i,s,m,g),s.child)}function Wb(i,s,d,m,g){if(i===null){var w=d.type;return typeof w=="function"&&!Em(w)&&w.defaultProps===void 0&&d.compare===null&&d.defaultProps===void 0?(s.tag=15,s.type=w,Hb(i,s,w,m,g)):(i=dd(d.type,null,m,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(w=i.child,(i.lanes&g)===0){var E=w.memoizedProps;if(d=d.compare,d=d!==null?d:Sl,d(E,m)&&i.ref===s.ref)return Qn(i,s,g)}return s.flags|=1,i=Fi(w,m),i.ref=s.ref,i.return=s,s.child=i}function Hb(i,s,d,m,g){if(i!==null){var w=i.memoizedProps;if(Sl(w,m)&&i.ref===s.ref)if(hr=!1,s.pendingProps=m=w,(i.lanes&g)!==0)(i.flags&131072)!==0&&(hr=!0);else return s.lanes=i.lanes,Qn(i,s,g)}return am(i,s,d,m,g)}function Kb(i,s,d){var m=s.pendingProps,g=m.children,w=i!==null?i.memoizedState:null;if(m.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(Uo,Er),Er|=d;else{if((d&1073741824)===0)return i=w!==null?w.baseLanes|d:d,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:i,cachePool:null,transitions:null},s.updateQueue=null,Je(Uo,Er),Er|=i,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=w!==null?w.baseLanes:d,Je(Uo,Er),Er|=m}else w!==null?(m=w.baseLanes|d,s.memoizedState=null):m=d,Je(Uo,Er),Er|=m;return nr(i,s,g,d),s.child}function Gb(i,s){var d=s.ref;(i===null&&d!==null||i!==null&&i.ref!==d)&&(s.flags|=512,s.flags|=2097152)}function am(i,s,d,m,g){var w=fr(d)?ba:Qt.current;return w=Mo(s,w),Lo(s,g),d=Qp(i,s,d,m,w,g),m=Yp(),i!==null&&!hr?(s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~g,Qn(i,s,g)):(st&&m&&Mp(s),s.flags|=1,nr(i,s,d,g),s.child)}function Vb(i,s,d,m,g){if(fr(d)){var w=!0;Rc(s)}else w=!1;if(Lo(s,g),s.stateNode===null)ed(i,s),Db(s,d,m),rm(s,d,m,g),m=!0;else if(i===null){var E=s.stateNode,M=s.memoizedProps;E.props=M;var D=E.context,V=d.contextType;typeof V=="object"&&V!==null?V=Rr(V):(V=fr(d)?ba:Qt.current,V=Mo(s,V));var ie=d.getDerivedStateFromProps,se=typeof ie=="function"||typeof E.getSnapshotBeforeUpdate=="function";se||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==m||D!==V)&&Rb(s,E,m,V),Ii=!1;var re=s.memoizedState;E.state=re,Kc(s,m,E,g),D=s.memoizedState,M!==m||re!==D||dr.current||Ii?(typeof ie=="function"&&(tm(s,d,ie,m),D=s.memoizedState),(M=Ii||Tb(s,d,M,m,re,D,V))?(se||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(s.flags|=4194308)):(typeof E.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=m,s.memoizedState=D),E.props=m,E.state=D,E.context=V,m=M):(typeof E.componentDidMount=="function"&&(s.flags|=4194308),m=!1)}else{E=s.stateNode,ub(i,s),M=s.memoizedProps,V=s.type===s.elementType?M:tn(s.type,M),E.props=V,se=s.pendingProps,re=E.context,D=d.contextType,typeof D=="object"&&D!==null?D=Rr(D):(D=fr(d)?ba:Qt.current,D=Mo(s,D));var ve=d.getDerivedStateFromProps;(ie=typeof ve=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(M!==se||re!==D)&&Rb(s,E,m,D),Ii=!1,re=s.memoizedState,E.state=re,Kc(s,m,E,g);var we=s.memoizedState;M!==se||re!==we||dr.current||Ii?(typeof ve=="function"&&(tm(s,d,ve,m),we=s.memoizedState),(V=Ii||Tb(s,d,V,m,re,we,D)||!1)?(ie||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(m,we,D),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(m,we,D)),typeof E.componentDidUpdate=="function"&&(s.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof E.componentDidUpdate!="function"||M===i.memoizedProps&&re===i.memoizedState||(s.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&re===i.memoizedState||(s.flags|=1024),s.memoizedProps=m,s.memoizedState=we),E.props=m,E.state=we,E.context=D,m=V):(typeof E.componentDidUpdate!="function"||M===i.memoizedProps&&re===i.memoizedState||(s.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&re===i.memoizedState||(s.flags|=1024),m=!1)}return om(i,s,d,m,w,g)}function om(i,s,d,m,g,w){Gb(i,s);var E=(s.flags&128)!==0;if(!m&&!E)return g&&Zx(s,d,!1),Qn(i,s,w);m=s.stateNode,O5.current=s;var M=E&&typeof d.getDerivedStateFromError!="function"?null:m.render();return s.flags|=1,i!==null&&E?(s.child=Ro(s,i.child,null,w),s.child=Ro(s,null,M,w)):nr(i,s,M,w),s.memoizedState=m.state,g&&Zx(s,d,!0),s.child}function qb(i){var s=i.stateNode;s.pendingContext?Yx(i,s.pendingContext,s.pendingContext!==s.context):s.context&&Yx(i,s.context,!1),Wp(i,s.containerInfo)}function Qb(i,s,d,m,g){return Do(),Rp(g),s.flags|=256,nr(i,s,d,m),s.child}var sm={dehydrated:null,treeContext:null,retryLane:0};function lm(i){return{baseLanes:i,cachePool:null,transitions:null}}function Yb(i,s,d){var m=s.pendingProps,g=ct.current,w=!1,E=(s.flags&128)!==0,M;if((M=E)||(M=i!==null&&i.memoizedState===null?!1:(g&2)!==0),M?(w=!0,s.flags&=-129):(i===null||i.memoizedState!==null)&&(g|=1),Je(ct,g&1),i===null)return Dp(s),i=s.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((s.mode&1)===0?s.lanes=1:i.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(E=m.children,i=m.fallback,w?(m=s.mode,w=s.child,E={mode:"hidden",children:E},(m&1)===0&&w!==null?(w.childLanes=0,w.pendingProps=E):w=fd(E,m,0,null),i=Oa(i,m,d,null),w.return=s,i.return=s,w.sibling=i,s.child=w,s.child.memoizedState=lm(d),s.memoizedState=sm,i):um(s,E));if(g=i.memoizedState,g!==null&&(M=g.dehydrated,M!==null))return _5(i,s,E,m,M,g,d);if(w){w=m.fallback,E=s.mode,g=i.child,M=g.sibling;var D={mode:"hidden",children:m.children};return(E&1)===0&&s.child!==g?(m=s.child,m.childLanes=0,m.pendingProps=D,s.deletions=null):(m=Fi(g,D),m.subtreeFlags=g.subtreeFlags&14680064),M!==null?w=Fi(M,w):(w=Oa(w,E,d,null),w.flags|=2),w.return=s,m.return=s,m.sibling=w,s.child=m,m=w,w=s.child,E=i.child.memoizedState,E=E===null?lm(d):{baseLanes:E.baseLanes|d,cachePool:null,transitions:E.transitions},w.memoizedState=E,w.childLanes=i.childLanes&~d,s.memoizedState=sm,m}return w=i.child,i=w.sibling,m=Fi(w,{mode:"visible",children:m.children}),(s.mode&1)===0&&(m.lanes=d),m.return=s,m.sibling=null,i!==null&&(d=s.deletions,d===null?(s.deletions=[i],s.flags|=16):d.push(i)),s.child=m,s.memoizedState=null,m}function um(i,s){return s=fd({mode:"visible",children:s},i.mode,0,null),s.return=i,i.child=s}function Jc(i,s,d,m){return m!==null&&Rp(m),Ro(s,i.child,null,d),i=um(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function _5(i,s,d,m,g,w,E){if(d)return s.flags&256?(s.flags&=-257,m=nm(Error(r(422))),Jc(i,s,E,m)):s.memoizedState!==null?(s.child=i.child,s.flags|=128,null):(w=m.fallback,g=s.mode,m=fd({mode:"visible",children:m.children},g,0,null),w=Oa(w,g,E,null),w.flags|=2,m.return=s,w.return=s,m.sibling=w,s.child=m,(s.mode&1)!==0&&Ro(s,i.child,null,E),s.child.memoizedState=lm(E),s.memoizedState=sm,w);if((s.mode&1)===0)return Jc(i,s,E,null);if(g.data==="$!"){if(m=g.nextSibling&&g.nextSibling.dataset,m)var M=m.dgst;return m=M,w=Error(r(419)),m=nm(w,m,void 0),Jc(i,s,E,m)}if(M=(E&i.childLanes)!==0,hr||M){if(m=Ot,m!==null){switch(E&-E){case 4:g=2;break;case 16:g=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:g=32;break;case 536870912:g=268435456;break;default:g=0}g=(g&(m.suspendedLanes|E))!==0?0:g,g!==0&&g!==w.retryLane&&(w.retryLane=g,Vn(i,g),an(m,i,g,-1))}return Nm(),m=nm(Error(r(421))),Jc(i,s,E,m)}return g.data==="$?"?(s.flags|=128,s.child=i.child,s=H5.bind(null,i),g._reactRetry=s,null):(i=w.treeContext,Nr=Ai(g.nextSibling),Sr=s,st=!0,en=null,i!==null&&(Tr[Dr++]=Kn,Tr[Dr++]=Gn,Tr[Dr++]=wa,Kn=i.id,Gn=i.overflow,wa=s),s=um(s,m.children),s.flags|=4096,s)}function Xb(i,s,d){i.lanes|=s;var m=i.alternate;m!==null&&(m.lanes|=s),Fp(i.return,s,d)}function cm(i,s,d,m,g){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:m,tail:d,tailMode:g}:(w.isBackwards=s,w.rendering=null,w.renderingStartTime=0,w.last=m,w.tail=d,w.tailMode=g)}function Zb(i,s,d){var m=s.pendingProps,g=m.revealOrder,w=m.tail;if(nr(i,s,m.children,d),m=ct.current,(m&2)!==0)m=m&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Xb(i,d,s);else if(i.tag===19)Xb(i,d,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}m&=1}if(Je(ct,m),(s.mode&1)===0)s.memoizedState=null;else switch(g){case"forwards":for(d=s.child,g=null;d!==null;)i=d.alternate,i!==null&&Gc(i)===null&&(g=d),d=d.sibling;d=g,d===null?(g=s.child,s.child=null):(g=d.sibling,d.sibling=null),cm(s,!1,g,d,w);break;case"backwards":for(d=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&Gc(i)===null){s.child=g;break}i=g.sibling,g.sibling=d,d=g,g=i}cm(s,!0,d,null,w);break;case"together":cm(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function ed(i,s){(s.mode&1)===0&&i!==null&&(i.alternate=null,s.alternate=null,s.flags|=2)}function Qn(i,s,d){if(i!==null&&(s.dependencies=i.dependencies),Ea|=s.lanes,(d&s.childLanes)===0)return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,d=Fi(i,i.pendingProps),s.child=d,d.return=s;i.sibling!==null;)i=i.sibling,d=d.sibling=Fi(i,i.pendingProps),d.return=s;d.sibling=null}return s.child}function M5(i,s,d){switch(s.tag){case 3:qb(s),Do();break;case 5:fb(s);break;case 1:fr(s.type)&&Rc(s);break;case 4:Wp(s,s.stateNode.containerInfo);break;case 10:var m=s.type._context,g=s.memoizedProps.value;Je(Uc,m._currentValue),m._currentValue=g;break;case 13:if(m=s.memoizedState,m!==null)return m.dehydrated!==null?(Je(ct,ct.current&1),s.flags|=128,null):(d&s.child.childLanes)!==0?Yb(i,s,d):(Je(ct,ct.current&1),i=Qn(i,s,d),i!==null?i.sibling:null);Je(ct,ct.current&1);break;case 19:if(m=(d&s.childLanes)!==0,(i.flags&128)!==0){if(m)return Zb(i,s,d);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Je(ct,ct.current),m)break;return null;case 22:case 23:return s.lanes=0,Kb(i,s,d)}return Qn(i,s,d)}var Jb,dm,e1,t1;Jb=function(i,s){for(var d=s.child;d!==null;){if(d.tag===5||d.tag===6)i.appendChild(d.stateNode);else if(d.tag!==4&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===s)break;for(;d.sibling===null;){if(d.return===null||d.return===s)return;d=d.return}d.sibling.return=d.return,d=d.sibling}},dm=function(){},e1=function(i,s,d,m){var g=i.memoizedProps;if(g!==m){i=s.stateNode,Sa(gn.current);var w=null;switch(d){case"input":g=Y(i,g),m=Y(i,m),w=[];break;case"select":g=X({},g,{value:void 0}),m=X({},m,{value:void 0}),w=[];break;case"textarea":g=wo(i,g),m=wo(i,m),w=[];break;default:typeof g.onClick!="function"&&typeof m.onClick=="function"&&(i.onclick=Ic)}he(d,m);var E;d=null;for(V in g)if(!m.hasOwnProperty(V)&&g.hasOwnProperty(V)&&g[V]!=null)if(V==="style"){var M=g[V];for(E in M)M.hasOwnProperty(E)&&(d||(d={}),d[E]="")}else V!=="dangerouslySetInnerHTML"&&V!=="children"&&V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&V!=="autoFocus"&&(a.hasOwnProperty(V)?w||(w=[]):(w=w||[]).push(V,null));for(V in m){var D=m[V];if(M=g!=null?g[V]:void 0,m.hasOwnProperty(V)&&D!==M&&(D!=null||M!=null))if(V==="style")if(M){for(E in M)!M.hasOwnProperty(E)||D&&D.hasOwnProperty(E)||(d||(d={}),d[E]="");for(E in D)D.hasOwnProperty(E)&&M[E]!==D[E]&&(d||(d={}),d[E]=D[E])}else d||(w||(w=[]),w.push(V,d)),d=D;else V==="dangerouslySetInnerHTML"?(D=D?D.__html:void 0,M=M?M.__html:void 0,D!=null&&M!==D&&(w=w||[]).push(V,D)):V==="children"?typeof D!="string"&&typeof D!="number"||(w=w||[]).push(V,""+D):V!=="suppressContentEditableWarning"&&V!=="suppressHydrationWarning"&&(a.hasOwnProperty(V)?(D!=null&&V==="onScroll"&&rt("scroll",i),w||M===D||(w=[])):(w=w||[]).push(V,D))}d&&(w=w||[]).push("style",d);var V=w;(s.updateQueue=V)&&(s.flags|=4)}},t1=function(i,s,d,m){d!==m&&(s.flags|=4)};function zl(i,s){if(!st)switch(i.tailMode){case"hidden":s=i.tail;for(var d=null;s!==null;)s.alternate!==null&&(d=s),s=s.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var m=null;d!==null;)d.alternate!==null&&(m=d),d=d.sibling;m===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function Xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,d=0,m=0;if(s)for(var g=i.child;g!==null;)d|=g.lanes|g.childLanes,m|=g.subtreeFlags&14680064,m|=g.flags&14680064,g.return=i,g=g.sibling;else for(g=i.child;g!==null;)d|=g.lanes|g.childLanes,m|=g.subtreeFlags,m|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=m,i.childLanes=d,s}function I5(i,s,d){var m=s.pendingProps;switch(Ip(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return fr(s.type)&&Dc(),Xt(s),null;case 3:return m=s.stateNode,zo(),nt(dr),nt(Qt),Gp(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(i===null||i.child===null)&&(Fc(s)?s.flags|=4:i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,en!==null&&(km(en),en=null))),dm(i,s),Xt(s),null;case 5:Hp(s);var g=Sa(Tl.current);if(d=s.type,i!==null&&s.stateNode!=null)e1(i,s,d,m,g),i.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!m){if(s.stateNode===null)throw Error(r(166));return Xt(s),null}if(i=Sa(gn.current),Fc(s)){m=s.stateNode,d=s.type;var w=s.memoizedProps;switch(m[vn]=s,m[Al]=w,i=(s.mode&1)!==0,d){case"dialog":rt("cancel",m),rt("close",m);break;case"iframe":case"object":case"embed":rt("load",m);break;case"video":case"audio":for(g=0;g<\/script>",i=i.removeChild(i.firstChild)):typeof m.is=="string"?i=E.createElement(d,{is:m.is}):(i=E.createElement(d),d==="select"&&(E=i,m.multiple?E.multiple=!0:m.size&&(E.size=m.size))):i=E.createElementNS(i,d),i[vn]=s,i[Al]=m,Jb(i,s,!1,!1),s.stateNode=i;e:{switch(E=Pe(d,m),d){case"dialog":rt("cancel",i),rt("close",i),g=m;break;case"iframe":case"object":case"embed":rt("load",i),g=m;break;case"video":case"audio":for(g=0;gWo&&(s.flags|=128,m=!0,zl(w,!1),s.lanes=4194304)}else{if(!m)if(i=Gc(E),i!==null){if(s.flags|=128,m=!0,d=i.updateQueue,d!==null&&(s.updateQueue=d,s.flags|=4),zl(w,!0),w.tail===null&&w.tailMode==="hidden"&&!E.alternate&&!st)return Xt(s),null}else 2*gt()-w.renderingStartTime>Wo&&d!==1073741824&&(s.flags|=128,m=!0,zl(w,!1),s.lanes=4194304);w.isBackwards?(E.sibling=s.child,s.child=E):(d=w.last,d!==null?d.sibling=E:s.child=E,w.last=E)}return w.tail!==null?(s=w.tail,w.rendering=s,w.tail=s.sibling,w.renderingStartTime=gt(),s.sibling=null,d=ct.current,Je(ct,m?d&1|2:d&1),s):(Xt(s),null);case 22:case 23:return Sm(),m=s.memoizedState!==null,i!==null&&i.memoizedState!==null!==m&&(s.flags|=8192),m&&(s.mode&1)!==0?(Er&1073741824)!==0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),null;case 24:return null;case 25:return null}throw Error(r(156,s.tag))}function T5(i,s){switch(Ip(s),s.tag){case 1:return fr(s.type)&&Dc(),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return zo(),nt(dr),nt(Qt),Gp(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 5:return Hp(s),null;case 13:if(nt(ct),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Do()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return nt(ct),null;case 4:return zo(),null;case 10:return zp(s.type._context),null;case 22:case 23:return Sm(),null;case 24:return null;default:return null}}var td=!1,Zt=!1,D5=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Bo(i,s){var d=i.ref;if(d!==null)if(typeof d=="function")try{d(null)}catch(m){ft(i,s,m)}else d.current=null}function fm(i,s,d){try{d()}catch(m){ft(i,s,m)}}var r1=!1;function R5(i,s){if(Sp=wc,i=Tx(),vp(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var m=d.getSelection&&d.getSelection();if(m&&m.rangeCount!==0){d=m.anchorNode;var g=m.anchorOffset,w=m.focusNode;m=m.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var E=0,M=-1,D=-1,V=0,ie=0,se=i,re=null;t:for(;;){for(var ve;se!==d||g!==0&&se.nodeType!==3||(M=E+g),se!==w||m!==0&&se.nodeType!==3||(D=E+m),se.nodeType===3&&(E+=se.nodeValue.length),(ve=se.firstChild)!==null;)re=se,se=ve;for(;;){if(se===i)break t;if(re===d&&++V===g&&(M=E),re===w&&++ie===m&&(D=E),(ve=se.nextSibling)!==null)break;se=re,re=se.parentNode}se=ve}d=M===-1||D===-1?null:{start:M,end:D}}else d=null}d=d||{start:0,end:0}}else d=null;for(Np={focusedElem:i,selectionRange:d},wc=!1,xe=s;xe!==null;)if(s=xe,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,xe=i;else for(;xe!==null;){s=xe;try{var we=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(we!==null){var Se=we.memoizedProps,yt=we.memoizedState,W=s.stateNode,F=W.getSnapshotBeforeUpdate(s.elementType===s.type?Se:tn(s.type,Se),yt);W.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var H=s.stateNode.containerInfo;H.nodeType===1?H.textContent="":H.nodeType===9&&H.documentElement&&H.removeChild(H.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(le){ft(s,s.return,le)}if(i=s.sibling,i!==null){i.return=s.return,xe=i;break}xe=s.return}return we=r1,r1=!1,we}function Fl(i,s,d){var m=s.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var g=m=m.next;do{if((g.tag&i)===i){var w=g.destroy;g.destroy=void 0,w!==void 0&&fm(s,d,w)}g=g.next}while(g!==m)}}function rd(i,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var d=s=s.next;do{if((d.tag&i)===i){var m=d.create;d.destroy=m()}d=d.next}while(d!==s)}}function hm(i){var s=i.ref;if(s!==null){var d=i.stateNode;switch(i.tag){case 5:i=d;break;default:i=d}typeof s=="function"?s(i):s.current=i}}function n1(i){var s=i.alternate;s!==null&&(i.alternate=null,n1(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&(delete s[vn],delete s[Al],delete s[Ap],delete s[y5],delete s[x5])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function i1(i){return i.tag===5||i.tag===3||i.tag===4}function a1(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||i1(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function pm(i,s,d){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?d.nodeType===8?d.parentNode.insertBefore(i,s):d.insertBefore(i,s):(d.nodeType===8?(s=d.parentNode,s.insertBefore(i,d)):(s=d,s.appendChild(i)),d=d._reactRootContainer,d!=null||s.onclick!==null||(s.onclick=Ic));else if(m!==4&&(i=i.child,i!==null))for(pm(i,s,d),i=i.sibling;i!==null;)pm(i,s,d),i=i.sibling}function mm(i,s,d){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?d.insertBefore(i,s):d.appendChild(i);else if(m!==4&&(i=i.child,i!==null))for(mm(i,s,d),i=i.sibling;i!==null;)mm(i,s,d),i=i.sibling}var Lt=null,rn=!1;function Di(i,s,d){for(d=d.child;d!==null;)o1(i,s,d),d=d.sibling}function o1(i,s,d){if(mn&&typeof mn.onCommitFiberUnmount=="function")try{mn.onCommitFiberUnmount(mc,d)}catch{}switch(d.tag){case 5:Zt||Bo(d,s);case 6:var m=Lt,g=rn;Lt=null,Di(i,s,d),Lt=m,rn=g,Lt!==null&&(rn?(i=Lt,d=d.stateNode,i.nodeType===8?i.parentNode.removeChild(d):i.removeChild(d)):Lt.removeChild(d.stateNode));break;case 18:Lt!==null&&(rn?(i=Lt,d=d.stateNode,i.nodeType===8?Cp(i.parentNode,d):i.nodeType===1&&Cp(i,d),yl(i)):Cp(Lt,d.stateNode));break;case 4:m=Lt,g=rn,Lt=d.stateNode.containerInfo,rn=!0,Di(i,s,d),Lt=m,rn=g;break;case 0:case 11:case 14:case 15:if(!Zt&&(m=d.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){g=m=m.next;do{var w=g,E=w.destroy;w=w.tag,E!==void 0&&((w&2)!==0||(w&4)!==0)&&fm(d,s,E),g=g.next}while(g!==m)}Di(i,s,d);break;case 1:if(!Zt&&(Bo(d,s),m=d.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=d.memoizedProps,m.state=d.memoizedState,m.componentWillUnmount()}catch(M){ft(d,s,M)}Di(i,s,d);break;case 21:Di(i,s,d);break;case 22:d.mode&1?(Zt=(m=Zt)||d.memoizedState!==null,Di(i,s,d),Zt=m):Di(i,s,d);break;default:Di(i,s,d)}}function s1(i){var s=i.updateQueue;if(s!==null){i.updateQueue=null;var d=i.stateNode;d===null&&(d=i.stateNode=new D5),s.forEach(function(m){var g=K5.bind(null,i,m);d.has(m)||(d.add(m),m.then(g,g))})}}function nn(i,s){var d=s.deletions;if(d!==null)for(var m=0;mg&&(g=E),m&=~w}if(m=g,m=gt()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*L5(m/1960))-m,10i?16:i,$i===null)var m=!1;else{if(i=$i,$i=null,sd=0,(He&6)!==0)throw Error(r(331));var g=He;for(He|=4,xe=i.current;xe!==null;){var w=xe,E=w.child;if((xe.flags&16)!==0){var M=w.deletions;if(M!==null){for(var D=0;Dgt()-ym?Ca(i,0):gm|=d),mr(i,s)}function b1(i,s){s===0&&((i.mode&1)===0?s=1:(s=gc,gc<<=1,(gc&130023424)===0&&(gc=4194304)));var d=ir();i=Vn(i,s),i!==null&&(hl(i,s,d),mr(i,d))}function H5(i){var s=i.memoizedState,d=0;s!==null&&(d=s.retryLane),b1(i,d)}function K5(i,s){var d=0;switch(i.tag){case 13:var m=i.stateNode,g=i.memoizedState;g!==null&&(d=g.retryLane);break;case 19:m=i.stateNode;break;default:throw Error(r(314))}m!==null&&m.delete(s),b1(i,d)}var w1;w1=function(i,s,d){if(i!==null)if(i.memoizedProps!==s.pendingProps||dr.current)hr=!0;else{if((i.lanes&d)===0&&(s.flags&128)===0)return hr=!1,M5(i,s,d);hr=(i.flags&131072)!==0}else hr=!1,st&&(s.flags&1048576)!==0&&eb(s,zc,s.index);switch(s.lanes=0,s.tag){case 2:var m=s.type;ed(i,s),i=s.pendingProps;var g=Mo(s,Qt.current);Lo(s,d),g=Qp(null,s,m,i,g,d);var w=Yp();return s.flags|=1,typeof g=="object"&&g!==null&&typeof g.render=="function"&&g.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,fr(m)?(w=!0,Rc(s)):w=!1,s.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,Up(s),g.updater=Zc,s.stateNode=g,g._reactInternals=s,rm(s,m,i,d),s=om(null,s,m,!0,w,d)):(s.tag=0,st&&w&&Mp(s),nr(null,s,g,d),s=s.child),s;case 16:m=s.elementType;e:{switch(ed(i,s),i=s.pendingProps,g=m._init,m=g(m._payload),s.type=m,g=s.tag=V5(m),i=tn(m,i),g){case 0:s=am(null,s,m,i,d);break e;case 1:s=Vb(null,s,m,i,d);break e;case 11:s=Ub(null,s,m,i,d);break e;case 14:s=Wb(null,s,m,tn(m.type,i),d);break e}throw Error(r(306,m,""))}return s;case 0:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),am(i,s,m,g,d);case 1:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),Vb(i,s,m,g,d);case 3:e:{if(qb(s),i===null)throw Error(r(387));m=s.pendingProps,w=s.memoizedState,g=w.element,ub(i,s),Kc(s,m,null,d);var E=s.memoizedState;if(m=E.element,w.isDehydrated)if(w={element:m,isDehydrated:!1,cache:E.cache,pendingSuspenseBoundaries:E.pendingSuspenseBoundaries,transitions:E.transitions},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){g=Fo(Error(r(423)),s),s=Qb(i,s,m,d,g);break e}else if(m!==g){g=Fo(Error(r(424)),s),s=Qb(i,s,m,d,g);break e}else for(Nr=Ai(s.stateNode.containerInfo.firstChild),Sr=s,st=!0,en=null,d=sb(s,null,m,d),s.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Do(),m===g){s=Qn(i,s,d);break e}nr(i,s,m,d)}s=s.child}return s;case 5:return fb(s),i===null&&Dp(s),m=s.type,g=s.pendingProps,w=i!==null?i.memoizedProps:null,E=g.children,Ep(m,g)?E=null:w!==null&&Ep(m,w)&&(s.flags|=32),Gb(i,s),nr(i,s,E,d),s.child;case 6:return i===null&&Dp(s),null;case 13:return Yb(i,s,d);case 4:return Wp(s,s.stateNode.containerInfo),m=s.pendingProps,i===null?s.child=Ro(s,null,m,d):nr(i,s,m,d),s.child;case 11:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),Ub(i,s,m,g,d);case 7:return nr(i,s,s.pendingProps,d),s.child;case 8:return nr(i,s,s.pendingProps.children,d),s.child;case 12:return nr(i,s,s.pendingProps.children,d),s.child;case 10:e:{if(m=s.type._context,g=s.pendingProps,w=s.memoizedProps,E=g.value,Je(Uc,m._currentValue),m._currentValue=E,w!==null)if(Jr(w.value,E)){if(w.children===g.children&&!dr.current){s=Qn(i,s,d);break e}}else for(w=s.child,w!==null&&(w.return=s);w!==null;){var M=w.dependencies;if(M!==null){E=w.child;for(var D=M.firstContext;D!==null;){if(D.context===m){if(w.tag===1){D=qn(-1,d&-d),D.tag=2;var V=w.updateQueue;if(V!==null){V=V.shared;var ie=V.pending;ie===null?D.next=D:(D.next=ie.next,ie.next=D),V.pending=D}}w.lanes|=d,D=w.alternate,D!==null&&(D.lanes|=d),Fp(w.return,d,s),M.lanes|=d;break}D=D.next}}else if(w.tag===10)E=w.type===s.type?null:w.child;else if(w.tag===18){if(E=w.return,E===null)throw Error(r(341));E.lanes|=d,M=E.alternate,M!==null&&(M.lanes|=d),Fp(E,d,s),E=w.sibling}else E=w.child;if(E!==null)E.return=w;else for(E=w;E!==null;){if(E===s){E=null;break}if(w=E.sibling,w!==null){w.return=E.return,E=w;break}E=E.return}w=E}nr(i,s,g.children,d),s=s.child}return s;case 9:return g=s.type,m=s.pendingProps.children,Lo(s,d),g=Rr(g),m=m(g),s.flags|=1,nr(i,s,m,d),s.child;case 14:return m=s.type,g=tn(m,s.pendingProps),g=tn(m.type,g),Wb(i,s,m,g,d);case 15:return Hb(i,s,s.type,s.pendingProps,d);case 17:return m=s.type,g=s.pendingProps,g=s.elementType===m?g:tn(m,g),ed(i,s),s.tag=1,fr(m)?(i=!0,Rc(s)):i=!1,Lo(s,d),Db(s,m,g),rm(s,m,g,d),om(null,s,m,!0,i,d);case 19:return Zb(i,s,d);case 22:return Kb(i,s,d)}throw Error(r(156,s.tag))};function k1(i,s){return tx(i,s)}function G5(i,s,d,m){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function zr(i,s,d,m){return new G5(i,s,d,m)}function Em(i){return i=i.prototype,!(!i||!i.isReactComponent)}function V5(i){if(typeof i=="function")return Em(i)?1:0;if(i!=null){if(i=i.$$typeof,i===R)return 11;if(i===ge)return 14}return 2}function Fi(i,s){var d=i.alternate;return d===null?(d=zr(i.tag,s,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=s,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&14680064,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,s=i.dependencies,d.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d}function dd(i,s,d,m,g,w){var E=2;if(m=i,typeof i=="function")Em(i)&&(E=1);else if(typeof i=="string")E=5;else e:switch(i){case I:return Oa(d.children,g,w,s);case $:E=8,g|=8;break;case B:return i=zr(12,d,s,g|2),i.elementType=B,i.lanes=w,i;case de:return i=zr(13,d,s,g),i.elementType=de,i.lanes=w,i;case Z:return i=zr(19,d,s,g),i.elementType=Z,i.lanes=w,i;case me:return fd(d,g,w,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case K:E=10;break e;case q:E=9;break e;case R:E=11;break e;case ge:E=14;break e;case ke:E=16,m=null;break e}throw Error(r(130,i==null?i:typeof i,""))}return s=zr(E,d,s,g),s.elementType=i,s.type=m,s.lanes=w,s}function Oa(i,s,d,m){return i=zr(7,i,m,s),i.lanes=d,i}function fd(i,s,d,m){return i=zr(22,i,m,s),i.elementType=me,i.lanes=d,i.stateNode={isHidden:!1},i}function Pm(i,s,d){return i=zr(6,i,null,s),i.lanes=d,i}function Cm(i,s,d){return s=zr(4,i.children!==null?i.children:[],i.key,s),s.lanes=d,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function q5(i,s,d,m,g){this.tag=s,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=tp(0),this.expirationTimes=tp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tp(0),this.identifierPrefix=m,this.onRecoverableError=g,this.mutableSourceEagerHydrationData=null}function Am(i,s,d,m,g,w,E,M,D){return i=new q5(i,s,d,M,D),s===1?(s=1,w===!0&&(s|=8)):s=0,w=zr(3,null,null,s),i.current=w,w.stateNode=i,w.memoizedState={element:m,isDehydrated:d,cache:null,transitions:null,pendingSuspenseBoundaries:null},Up(w),i}function Q5(i,s,d){var m=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Rm.exports=uM(),Rm.exports}var $1;function cM(){if($1)return bd;$1=1;var e=$N();return bd.createRoot=e.createRoot,bd.hydrateRoot=e.hydrateRoot,bd}var dM=cM();const fM=ty(dM);var Gu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Ka,Yi,ps,EN,hM=(EN=class extends Gu{constructor(){super();De(this,Ka);De(this,Yi);De(this,ps);ye(this,ps,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){z(this,Yi)||this.setEventListener(z(this,ps))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,Yi))==null||t.call(this),ye(this,Yi,void 0))}setEventListener(t){var r;ye(this,ps,t),(r=z(this,Yi))==null||r.call(this),ye(this,Yi,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){z(this,Ka)!==t&&(ye(this,Ka,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof z(this,Ka)=="boolean"?z(this,Ka):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ka=new WeakMap,Yi=new WeakMap,ps=new WeakMap,EN),ry=new hM,pM={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Xi,ey,PN,mM=(PN=class{constructor(){De(this,Xi,pM);De(this,ey,!1)}setTimeoutProvider(e){ye(this,Xi,e)}setTimeout(e,t){return z(this,Xi).setTimeout(e,t)}clearTimeout(e){z(this,Xi).clearTimeout(e)}setInterval(e,t){return z(this,Xi).setInterval(e,t)}clearInterval(e){z(this,Xi).clearInterval(e)}},Xi=new WeakMap,ey=new WeakMap,PN),za=new mM;function vM(e){setTimeout(e,0)}var gM=typeof window>"u"||"Deno"in globalThis;function yr(){}function yM(e,t){return typeof e=="function"?e(t):e}function Mv(e){return typeof e=="number"&&e>=0&&e!==1/0}function LN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function aa(e,t){return typeof e=="function"?e(t):e}function Cr(e,t){return typeof e=="function"?e(t):e}function L1(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:o,queryKey:u,stale:l}=e;if(u){if(n){if(t.queryHash!==ny(u,t.options))return!1}else if(!mu(t.queryKey,u))return!1}if(r!=="all"){const f=t.isActive();if(r==="active"&&!f||r==="inactive"&&f)return!1}return!(typeof l=="boolean"&&t.isStale()!==l||a&&a!==t.state.fetchStatus||o&&!o(t))}function z1(e,t){const{exact:r,status:n,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(pu(t.options.mutationKey)!==pu(o))return!1}else if(!mu(t.options.mutationKey,o))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function ny(e,t){return((t==null?void 0:t.queryKeyHashFn)||pu)(e)}function pu(e){return JSON.stringify(e,(t,r)=>Tv(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function mu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>mu(e[r],t[r])):!1}var xM=Object.prototype.hasOwnProperty;function zN(e,t,r=0){if(e===t)return e;if(r>500)return t;const n=F1(e)&&F1(t);if(!n&&!(Tv(e)&&Tv(t)))return t;const o=(n?e:Object.keys(e)).length,u=n?t:Object.keys(t),l=u.length,f=n?new Array(l):{};let h=0;for(let p=0;p{za.setTimeout(t,e)})}function Dv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?zN(e,t):t}function wM(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function kM(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var iy=Symbol();function FN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===iy?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function BN(e,t){return typeof e=="function"?e(...t):!!e}function jM(e,t,r){let n=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),n||(n=!0,a.aborted?r():a.addEventListener("abort",r,{once:!0})),a)}),e}var vu=(()=>{let e=()=>gM;return{isServer(){return e()},setIsServer(t){e=t}}})();function Rv(){let e,t;const r=new Promise((a,o)=>{e=a,t=o});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}var SM=vM;function NM(){let e=[],t=0,r=l=>{l()},n=l=>{l()},a=SM;const o=l=>{t?e.push(l):a(()=>{r(l)})},u=()=>{const l=e;e=[],l.length&&a(()=>{n(()=>{l.forEach(f=>{r(f)})})})};return{batch:l=>{let f;t++;try{f=l()}finally{t--,t||u()}return f},batchCalls:l=>(...f)=>{o(()=>{l(...f)})},schedule:o,setNotifyFunction:l=>{r=l},setBatchNotifyFunction:l=>{n=l},setScheduler:l=>{a=l}}}var Wt=NM(),ms,Zi,vs,CN,EM=(CN=class extends Gu{constructor(){super();De(this,ms,!0);De(this,Zi);De(this,vs);ye(this,vs,t=>{if(typeof window<"u"&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){z(this,Zi)||this.setEventListener(z(this,vs))}onUnsubscribe(){var t;this.hasListeners()||((t=z(this,Zi))==null||t.call(this),ye(this,Zi,void 0))}setEventListener(t){var r;ye(this,vs,t),(r=z(this,Zi))==null||r.call(this),ye(this,Zi,t(this.setOnline.bind(this)))}setOnline(t){z(this,ms)!==t&&(ye(this,ms,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return z(this,ms)}},ms=new WeakMap,Zi=new WeakMap,vs=new WeakMap,CN),rf=new EM;function PM(e){return Math.min(1e3*2**e,3e4)}function UN(e){return(e??"online")==="online"?rf.isOnline():!0}var $v=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function WN(e){let t=!1,r=0,n;const a=Rv(),o=()=>a.status!=="pending",u=j=>{var S;if(!o()){const N=new $v(j);x(N),(S=e.onCancel)==null||S.call(e,N)}},l=()=>{t=!0},f=()=>{t=!1},h=()=>ry.isFocused()&&(e.networkMode==="always"||rf.isOnline())&&e.canRun(),p=()=>UN(e.networkMode)&&e.canRun(),v=j=>{o()||(n==null||n(),a.resolve(j))},x=j=>{o()||(n==null||n(),a.reject(j))},b=()=>new Promise(j=>{var S;n=N=>{(o()||h())&&j(N)},(S=e.onPause)==null||S.call(e)}).then(()=>{var j;n=void 0,o()||(j=e.onContinue)==null||j.call(e)}),k=()=>{if(o())return;let j;const S=r===0?e.initialPromise:void 0;try{j=S??e.fn()}catch(N){j=Promise.reject(N)}Promise.resolve(j).then(v).catch(N=>{var A;if(o())return;const P=e.retry??(vu.isServer()?0:3),O=e.retryDelay??PM,C=typeof O=="function"?O(r,N):O,_=P===!0||typeof P=="number"&&rh()?void 0:b()).then(()=>{t?x(N):k()})})};return{promise:a,status:()=>a.status,cancel:u,continue:()=>(n==null||n(),a),cancelRetry:l,continueRetry:f,canStart:p,start:()=>(p()?k():b().then(k),a)}}var Ga,AN,HN=(AN=class{constructor(){De(this,Ga)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Mv(this.gcTime)&&ye(this,Ga,za.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vu.isServer()?1/0:300*1e3))}clearGcTimeout(){z(this,Ga)!==void 0&&(za.clearTimeout(z(this,Ga)),ye(this,Ga,void 0))}},Ga=new WeakMap,AN);function CM(e){return{onFetch:(t,r)=>{var p,v,x,b,k;const n=t.options,a=(x=(v=(p=t.fetchOptions)==null?void 0:p.meta)==null?void 0:v.fetchMore)==null?void 0:x.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],u=((k=t.state.data)==null?void 0:k.pageParams)||[];let l={pages:[],pageParams:[]},f=0;const h=async()=>{let j=!1;const S=O=>{jM(O,()=>t.signal,()=>j=!0)},N=FN(t.options,t.fetchOptions),P=async(O,C,_)=>{if(j)return Promise.reject(t.signal.reason);if(C==null&&O.pages.length)return Promise.resolve(O);const I=(()=>{const q={client:t.client,queryKey:t.queryKey,pageParam:C,direction:_?"backward":"forward",meta:t.options.meta};return S(q),q})(),$=await N(I),{maxPages:B}=t.options,K=_?kM:wM;return{pages:K(O.pages,$,B),pageParams:K(O.pageParams,C,B)}};if(a&&o.length){const O=a==="backward",C=O?AM:U1,_={pages:o,pageParams:u},A=C(n,_);l=await P(_,A,O)}else{const O=e??o.length;do{const C=f===0?u[0]??n.initialPageParam:U1(n,l);if(f>0&&C==null)break;l=await P(l,C),f++}while(f{var j,S;return(S=(j=t.options).persister)==null?void 0:S.call(j,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=h}}}function U1(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function AM(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var gs,Va,ys,Ur,qa,Mt,Bu,Qa,Pr,KN,Zn,ON,OM=(ON=class extends HN{constructor(t){super();De(this,Pr);De(this,gs);De(this,Va);De(this,ys);De(this,Ur);De(this,qa);De(this,Mt);De(this,Bu);De(this,Qa);ye(this,Qa,!1),ye(this,Bu,t.defaultOptions),this.setOptions(t.options),this.observers=[],ye(this,qa,t.client),ye(this,Ur,z(this,qa).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ye(this,Va,H1(this.options)),this.state=t.state??z(this,Va),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return z(this,gs)}get promise(){var t;return(t=z(this,Mt))==null?void 0:t.promise}setOptions(t){if(this.options={...z(this,Bu),...t},t!=null&&t._type&&ye(this,gs,t._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=H1(this.options);r.data!==void 0&&(this.setState(W1(r.data,r.dataUpdatedAt)),ye(this,Va,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&z(this,Ur).remove(this)}setData(t,r){const n=Dv(this.state.data,t,this.options);return Fe(this,Pr,Zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t){Fe(this,Pr,Zn).call(this,{type:"setState",state:t})}cancel(t){var n,a;const r=(n=z(this,Mt))==null?void 0:n.promise;return(a=z(this,Mt))==null||a.cancel(t),r?r.then(yr).catch(yr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return z(this,Va)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>Cr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===iy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>aa(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!LN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=z(this,Mt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=z(this,Mt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),z(this,Ur).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(z(this,Mt)&&(z(this,Qa)||Fe(this,Pr,KN).call(this)?z(this,Mt).cancel({revert:!0}):z(this,Mt).cancelRetry()),this.scheduleGc()),z(this,Ur).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fe(this,Pr,Zn).call(this,{type:"invalidate"})}async fetch(t,r){var h,p,v,x,b,k,j,S,N,P,O;if(this.state.fetchStatus!=="idle"&&((h=z(this,Mt))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(z(this,Mt))return z(this,Mt).continueRetry(),z(this,Mt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const C=this.observers.find(_=>_.options.queryFn);C&&this.setOptions(C.options)}const n=new AbortController,a=C=>{Object.defineProperty(C,"signal",{enumerable:!0,get:()=>(ye(this,Qa,!0),n.signal)})},o=()=>{const C=FN(this.options,r),A=(()=>{const I={client:z(this,qa),queryKey:this.queryKey,meta:this.meta};return a(I),I})();return ye(this,Qa,!1),this.options.persister?this.options.persister(C,A,this):C(A)},l=(()=>{const C={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:z(this,qa),state:this.state,fetchFn:o};return a(C),C})(),f=z(this,gs)==="infinite"?CM(this.options.pages):this.options.behavior;f==null||f.onFetch(l,this),ye(this,ys,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((p=l.fetchOptions)==null?void 0:p.meta))&&Fe(this,Pr,Zn).call(this,{type:"fetch",meta:(v=l.fetchOptions)==null?void 0:v.meta}),ye(this,Mt,WN({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:C=>{C instanceof $v&&C.revert&&this.setState({...z(this,ys),fetchStatus:"idle"}),n.abort()},onFail:(C,_)=>{Fe(this,Pr,Zn).call(this,{type:"failed",failureCount:C,error:_})},onPause:()=>{Fe(this,Pr,Zn).call(this,{type:"pause"})},onContinue:()=>{Fe(this,Pr,Zn).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const C=await z(this,Mt).start();if(C===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(C),(b=(x=z(this,Ur).config).onSuccess)==null||b.call(x,C,this),(j=(k=z(this,Ur).config).onSettled)==null||j.call(k,C,this.state.error,this),C}catch(C){if(C instanceof $v){if(C.silent)return z(this,Mt).promise;if(C.revert){if(this.state.data===void 0)throw C;return this.state.data}}throw Fe(this,Pr,Zn).call(this,{type:"error",error:C}),(N=(S=z(this,Ur).config).onError)==null||N.call(S,C,this),(O=(P=z(this,Ur).config).onSettled)==null||O.call(P,this.state.data,C,this),C}finally{this.scheduleGc()}}},gs=new WeakMap,Va=new WeakMap,ys=new WeakMap,Ur=new WeakMap,qa=new WeakMap,Mt=new WeakMap,Bu=new WeakMap,Qa=new WeakMap,Pr=new WeakSet,KN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...GN(n.data,this.options),fetchMeta:t.meta??null};case"success":const a={...n,...W1(t.data,t.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ye(this,ys,t.manual?a:void 0),a;case"error":const o=t.error;return{...n,error:o,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),Wt.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),z(this,Ur).notify({query:this,type:"updated",action:t})})},ON);function GN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:UN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function W1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function H1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var gr,Ue,Uu,ar,Ya,xs,ei,Ji,Wu,bs,ws,Xa,Za,ea,ks,qe,ou,Lv,zv,Fv,Bv,Uv,Wv,Hv,VN,_N,_M=(_N=class extends Gu{constructor(t,r){super();De(this,qe);De(this,gr);De(this,Ue);De(this,Uu);De(this,ar);De(this,Ya);De(this,xs);De(this,ei);De(this,Ji);De(this,Wu);De(this,bs);De(this,ws);De(this,Xa);De(this,Za);De(this,ea);De(this,ks,new Set);this.options=r,ye(this,gr,t),ye(this,Ji,null),ye(this,ei,Rv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(z(this,Ue).addObserver(this),K1(z(this,Ue),this.options)?Fe(this,qe,ou).call(this):this.updateResult(),Fe(this,qe,Bv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Kv(z(this,Ue),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Kv(z(this,Ue),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fe(this,qe,Uv).call(this),Fe(this,qe,Wv).call(this),z(this,Ue).removeObserver(this)}setOptions(t){const r=this.options,n=z(this,Ue);if(this.options=z(this,gr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Cr(this.options.enabled,z(this,Ue))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fe(this,qe,Hv).call(this),z(this,Ue).setOptions(this.options),r._defaulted&&!Iv(this.options,r)&&z(this,gr).getQueryCache().notify({type:"observerOptionsUpdated",query:z(this,Ue),observer:this});const a=this.hasListeners();a&&G1(z(this,Ue),n,this.options,r)&&Fe(this,qe,ou).call(this),this.updateResult(),a&&(z(this,Ue)!==n||Cr(this.options.enabled,z(this,Ue))!==Cr(r.enabled,z(this,Ue))||aa(this.options.staleTime,z(this,Ue))!==aa(r.staleTime,z(this,Ue)))&&Fe(this,qe,Lv).call(this);const o=Fe(this,qe,zv).call(this);a&&(z(this,Ue)!==n||Cr(this.options.enabled,z(this,Ue))!==Cr(r.enabled,z(this,Ue))||o!==z(this,ea))&&Fe(this,qe,Fv).call(this,o)}getOptimisticResult(t){const r=z(this,gr).getQueryCache().build(z(this,gr),t),n=this.createResult(r,t);return IM(this,n)&&(ye(this,ar,n),ye(this,xs,this.options),ye(this,Ya,z(this,Ue).state)),n}getCurrentResult(){return z(this,ar)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&z(this,ei).status==="pending"&&z(this,ei).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,a))})}trackProp(t){z(this,ks).add(t)}getCurrentQuery(){return z(this,Ue)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=z(this,gr).defaultQueryOptions(t),n=z(this,gr).getQueryCache().build(z(this,gr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return Fe(this,qe,ou).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),z(this,ar)))}createResult(t,r){var B;const n=z(this,Ue),a=this.options,o=z(this,ar),u=z(this,Ya),l=z(this,xs),h=t!==n?t.state:z(this,Uu),{state:p}=t;let v={...p},x=!1,b;if(r._optimisticResults){const K=this.hasListeners(),q=!K&&K1(t,r),R=K&&G1(t,n,r,a);(q||R)&&(v={...v,...GN(p.data,t.options)}),r._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:k,errorUpdatedAt:j,status:S}=v;b=v.data;let N=!1;if(r.placeholderData!==void 0&&b===void 0&&S==="pending"){let K;o!=null&&o.isPlaceholderData&&r.placeholderData===(l==null?void 0:l.placeholderData)?(K=o.data,N=!0):K=typeof r.placeholderData=="function"?r.placeholderData((B=z(this,ws))==null?void 0:B.state.data,z(this,ws)):r.placeholderData,K!==void 0&&(S="success",b=Dv(o==null?void 0:o.data,K,r),x=!0)}if(r.select&&b!==void 0&&!N)if(o&&b===(u==null?void 0:u.data)&&r.select===z(this,Wu))b=z(this,bs);else try{ye(this,Wu,r.select),b=r.select(b),b=Dv(o==null?void 0:o.data,b,r),ye(this,bs,b),ye(this,Ji,null)}catch(K){ye(this,Ji,K)}z(this,Ji)&&(k=z(this,Ji),b=z(this,bs),j=Date.now(),S="error");const P=v.fetchStatus==="fetching",O=S==="pending",C=S==="error",_=O&&P,A=b!==void 0,$={status:S,fetchStatus:v.fetchStatus,isPending:O,isSuccess:S==="success",isError:C,isInitialLoading:_,isLoading:_,data:b,dataUpdatedAt:v.dataUpdatedAt,error:k,errorUpdatedAt:j,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:v.dataUpdateCount>h.dataUpdateCount||v.errorUpdateCount>h.errorUpdateCount,isFetching:P,isRefetching:P&&!O,isLoadingError:C&&!A,isPaused:v.fetchStatus==="paused",isPlaceholderData:x,isRefetchError:C&&A,isStale:ay(t,r),refetch:this.refetch,promise:z(this,ei),isEnabled:Cr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const K=$.data!==void 0,q=$.status==="error"&&!K,R=ge=>{q?ge.reject($.error):K&&ge.resolve($.data)},de=()=>{const ge=ye(this,ei,$.promise=Rv());R(ge)},Z=z(this,ei);switch(Z.status){case"pending":t.queryHash===n.queryHash&&R(Z);break;case"fulfilled":(q||$.data!==Z.value)&&de();break;case"rejected":(!q||$.error!==Z.reason)&&de();break}}return $}updateResult(){const t=z(this,ar),r=this.createResult(z(this,Ue),this.options);if(ye(this,Ya,z(this,Ue).state),ye(this,xs,this.options),z(this,Ya).data!==void 0&&ye(this,ws,z(this,Ue)),Iv(r,t))return;ye(this,ar,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!z(this,ks).size)return!0;const u=new Set(o??z(this,ks));return this.options.throwOnError&&u.add("error"),Object.keys(z(this,ar)).some(l=>{const f=l;return z(this,ar)[f]!==t[f]&&u.has(f)})};Fe(this,qe,VN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fe(this,qe,Bv).call(this)}},gr=new WeakMap,Ue=new WeakMap,Uu=new WeakMap,ar=new WeakMap,Ya=new WeakMap,xs=new WeakMap,ei=new WeakMap,Ji=new WeakMap,Wu=new WeakMap,bs=new WeakMap,ws=new WeakMap,Xa=new WeakMap,Za=new WeakMap,ea=new WeakMap,ks=new WeakMap,qe=new WeakSet,ou=function(t){Fe(this,qe,Hv).call(this);let r=z(this,Ue).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(yr)),r},Lv=function(){Fe(this,qe,Uv).call(this);const t=aa(this.options.staleTime,z(this,Ue));if(vu.isServer()||z(this,ar).isStale||!Mv(t))return;const n=LN(z(this,ar).dataUpdatedAt,t)+1;ye(this,Xa,za.setTimeout(()=>{z(this,ar).isStale||this.updateResult()},n))},zv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(z(this,Ue)):this.options.refetchInterval)??!1},Fv=function(t){Fe(this,qe,Wv).call(this),ye(this,ea,t),!(vu.isServer()||Cr(this.options.enabled,z(this,Ue))===!1||!Mv(z(this,ea))||z(this,ea)===0)&&ye(this,Za,za.setInterval(()=>{(this.options.refetchIntervalInBackground||ry.isFocused())&&Fe(this,qe,ou).call(this)},z(this,ea)))},Bv=function(){Fe(this,qe,Lv).call(this),Fe(this,qe,Fv).call(this,Fe(this,qe,zv).call(this))},Uv=function(){z(this,Xa)!==void 0&&(za.clearTimeout(z(this,Xa)),ye(this,Xa,void 0))},Wv=function(){z(this,Za)!==void 0&&(za.clearInterval(z(this,Za)),ye(this,Za,void 0))},Hv=function(){const t=z(this,gr).getQueryCache().build(z(this,gr),this.options);if(t===z(this,Ue))return;const r=z(this,Ue);ye(this,Ue,t),ye(this,Uu,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},VN=function(t){Wt.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(z(this,ar))}),z(this,gr).getQueryCache().notify({query:z(this,Ue),type:"observerResultsUpdated"})})},_N);function MM(e,t){return Cr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&Cr(t.retryOnMount,e)===!1)}function K1(e,t){return MM(e,t)||e.state.data!==void 0&&Kv(e,t,t.refetchOnMount)}function Kv(e,t,r){if(Cr(t.enabled,e)!==!1&&aa(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&ay(e,t)}return!1}function G1(e,t,r,n){return(e!==t||Cr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&ay(e,r)}function ay(e,t){return Cr(t.enabled,e)!==!1&&e.isStaleByTime(aa(t.staleTime,e))}function IM(e,t){return!Iv(e.getCurrentResult(),t)}var Hu,Sn,Jt,Ja,Nn,Ki,MN,TM=(MN=class extends HN{constructor(t){super();De(this,Nn);De(this,Hu);De(this,Sn);De(this,Jt);De(this,Ja);ye(this,Hu,t.client),this.mutationId=t.mutationId,ye(this,Jt,t.mutationCache),ye(this,Sn,[]),this.state=t.state||DM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){z(this,Sn).includes(t)||(z(this,Sn).push(t),this.clearGcTimeout(),z(this,Jt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ye(this,Sn,z(this,Sn).filter(r=>r!==t)),this.scheduleGc(),z(this,Jt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){z(this,Sn).length||(this.state.status==="pending"?this.scheduleGc():z(this,Jt).remove(this))}continue(){var t;return((t=z(this,Ja))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var u,l,f,h,p,v,x,b,k,j,S,N,P,O,C,_,A,I;const r=()=>{Fe(this,Nn,Ki).call(this,{type:"continue"})},n={client:z(this,Hu),meta:this.options.meta,mutationKey:this.options.mutationKey};ye(this,Ja,WN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:($,B)=>{Fe(this,Nn,Ki).call(this,{type:"failed",failureCount:$,error:B})},onPause:()=>{Fe(this,Nn,Ki).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>z(this,Jt).canRun(this)}));const a=this.state.status==="pending",o=!z(this,Ja).canStart();try{if(a)r();else{Fe(this,Nn,Ki).call(this,{type:"pending",variables:t,isPaused:o}),z(this,Jt).config.onMutate&&await z(this,Jt).config.onMutate(t,this,n);const B=await((l=(u=this.options).onMutate)==null?void 0:l.call(u,t,n));B!==this.state.context&&Fe(this,Nn,Ki).call(this,{type:"pending",context:B,variables:t,isPaused:o})}const $=await z(this,Ja).start();return await((h=(f=z(this,Jt).config).onSuccess)==null?void 0:h.call(f,$,t,this.state.context,this,n)),await((v=(p=this.options).onSuccess)==null?void 0:v.call(p,$,t,this.state.context,n)),await((b=(x=z(this,Jt).config).onSettled)==null?void 0:b.call(x,$,null,this.state.variables,this.state.context,this,n)),await((j=(k=this.options).onSettled)==null?void 0:j.call(k,$,null,t,this.state.context,n)),Fe(this,Nn,Ki).call(this,{type:"success",data:$}),$}catch($){try{await((N=(S=z(this,Jt).config).onError)==null?void 0:N.call(S,$,t,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((O=(P=this.options).onError)==null?void 0:O.call(P,$,t,this.state.context,n))}catch(B){Promise.reject(B)}try{await((_=(C=z(this,Jt).config).onSettled)==null?void 0:_.call(C,void 0,$,this.state.variables,this.state.context,this,n))}catch(B){Promise.reject(B)}try{await((I=(A=this.options).onSettled)==null?void 0:I.call(A,void 0,$,t,this.state.context,n))}catch(B){Promise.reject(B)}throw Fe(this,Nn,Ki).call(this,{type:"error",error:$}),$}finally{z(this,Jt).runNext(this)}}},Hu=new WeakMap,Sn=new WeakMap,Jt=new WeakMap,Ja=new WeakMap,Nn=new WeakSet,Ki=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),Wt.batch(()=>{z(this,Sn).forEach(n=>{n.onMutationUpdate(t)}),z(this,Jt).notify({mutation:this,type:"updated",action:t})})},MN);function DM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ti,sn,Ku,IN,RM=(IN=class extends Gu{constructor(t={}){super();De(this,ti);De(this,sn);De(this,Ku);this.config=t,ye(this,ti,new Set),ye(this,sn,new Map),ye(this,Ku,0)}build(t,r,n){const a=new TM({client:t,mutationCache:this,mutationId:++xd(this,Ku)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){z(this,ti).add(t);const r=wd(t);if(typeof r=="string"){const n=z(this,sn).get(r);n?n.push(t):z(this,sn).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(z(this,ti).delete(t)){const r=wd(t);if(typeof r=="string"){const n=z(this,sn).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&z(this,sn).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=wd(t);if(typeof r=="string"){const n=z(this,sn).get(r),a=n==null?void 0:n.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=wd(t);if(typeof r=="string"){const a=(n=z(this,sn).get(r))==null?void 0:n.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Wt.batch(()=>{z(this,ti).forEach(t=>{this.notify({type:"removed",mutation:t})}),z(this,ti).clear(),z(this,sn).clear()})}getAll(){return Array.from(z(this,ti))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>z1(r,n))}findAll(t={}){return this.getAll().filter(r=>z1(t,r))}notify(t){Wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return Wt.batch(()=>Promise.all(t.map(r=>r.continue().catch(yr))))}},ti=new WeakMap,sn=new WeakMap,Ku=new WeakMap,IN);function wd(e){var t;return(t=e.options.scope)==null?void 0:t.id}var En,TN,$M=(TN=class extends Gu{constructor(t={}){super();De(this,En);this.config=t,ye(this,En,new Map)}build(t,r,n){const a=r.queryKey,o=r.queryHash??ny(a,r);let u=this.get(o);return u||(u=new OM({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(u)),u}add(t){z(this,En).has(t.queryHash)||(z(this,En).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=z(this,En).get(t.queryHash);r&&(t.destroy(),r===t&&z(this,En).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Wt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return z(this,En).get(t)}getAll(){return[...z(this,En).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>L1(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>L1(t,n)):r}notify(t){Wt.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){Wt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Wt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},En=new WeakMap,TN),ht,ta,ra,js,Ss,na,Ns,Es,DN,LM=(DN=class{constructor(e={}){De(this,ht);De(this,ta);De(this,ra);De(this,js);De(this,Ss);De(this,na);De(this,Ns);De(this,Es);ye(this,ht,e.queryCache||new $M),ye(this,ta,e.mutationCache||new RM),ye(this,ra,e.defaultOptions||{}),ye(this,js,new Map),ye(this,Ss,new Map),ye(this,na,0)}mount(){xd(this,na)._++,z(this,na)===1&&(ye(this,Ns,ry.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,ht).onFocus())})),ye(this,Es,rf.subscribe(async e=>{e&&(await this.resumePausedMutations(),z(this,ht).onOnline())})))}unmount(){var e,t;xd(this,na)._--,z(this,na)===0&&((e=z(this,Ns))==null||e.call(this),ye(this,Ns,void 0),(t=z(this,Es))==null||t.call(this),ye(this,Es,void 0))}isFetching(e){return z(this,ht).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return z(this,ta).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=z(this,ht).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=z(this,ht).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(aa(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return z(this,ht).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=z(this,ht).get(n.queryHash),o=a==null?void 0:a.state.data,u=yM(t,o);if(u!==void 0)return z(this,ht).build(this,n).setData(u,{...r,manual:!0})}setQueriesData(e,t,r){return Wt.batch(()=>z(this,ht).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=z(this,ht).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=z(this,ht);Wt.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=z(this,ht);return Wt.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=Wt.batch(()=>z(this,ht).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(yr).catch(yr)}invalidateQueries(e,t={}){return Wt.batch(()=>(z(this,ht).findAll(e).forEach(r=>{r.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const r={...t,cancelRefetch:t.cancelRefetch??!0},n=Wt.batch(()=>z(this,ht).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,r);return r.throwOnError||(o=o.catch(yr)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(n).then(yr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=z(this,ht).build(this,t);return r.isStaleByTime(aa(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(yr).catch(yr)}fetchInfiniteQuery(e){return e._type="infinite",this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(yr).catch(yr)}ensureInfiniteQueryData(e){return e._type="infinite",this.ensureQueryData(e)}resumePausedMutations(){return rf.isOnline()?z(this,ta).resumePausedMutations():Promise.resolve()}getQueryCache(){return z(this,ht)}getMutationCache(){return z(this,ta)}getDefaultOptions(){return z(this,ra)}setDefaultOptions(e){ye(this,ra,e)}setQueryDefaults(e,t){z(this,js).set(pu(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...z(this,js).values()],r={};return t.forEach(n=>{mu(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){z(this,Ss).set(pu(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...z(this,Ss).values()],r={};return t.forEach(n=>{mu(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...z(this,ra).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=ny(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===iy&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...z(this,ra).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){z(this,ht).clear(),z(this,ta).clear()}},ht=new WeakMap,ta=new WeakMap,ra=new WeakMap,js=new WeakMap,Ss=new WeakMap,na=new WeakMap,Ns=new WeakMap,Es=new WeakMap,DN),qN=y.createContext(void 0),po=e=>{const t=y.useContext(qN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},zM=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(qN.Provider,{value:e,children:t})),QN=y.createContext(!1),FM=()=>y.useContext(QN);QN.Provider;function BM(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var UM=y.createContext(BM()),WM=()=>y.useContext(UM),HM=(e,t,r)=>{const n=r!=null&&r.state.error&&typeof e.throwOnError=="function"?BN(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||n)&&(t.isReset()||(e.retryOnMount=!1))},KM=e=>{y.useEffect(()=>{e.clearReset()},[e])},GM=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||BN(r,[e.error,n])),VM=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...a)=>r(n(...a)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},qM=(e,t)=>e.isLoading&&e.isFetching&&!t,QM=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,V1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function YM(e,t,r){var b,k,j,S;const n=FM(),a=WM(),o=po(),u=o.defaultQueryOptions(e);(k=(b=o.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||k.call(b,u);const l=o.getQueryCache().get(u.queryHash),f=e.subscribed!==!1;u._optimisticResults=n?"isRestoring":f?"optimistic":void 0,VM(u),HM(u,a,l),KM(a);const h=!o.getQueryCache().get(u.queryHash),[p]=y.useState(()=>new t(o,u)),v=p.getOptimisticResult(u),x=!n&&f;if(y.useSyncExternalStore(y.useCallback(N=>{const P=x?p.subscribe(Wt.batchCalls(N)):yr;return p.updateResult(),P},[p,x]),()=>p.getCurrentResult(),()=>p.getCurrentResult()),y.useEffect(()=>{p.setOptions(u)},[u,p]),QM(u,v))throw V1(u,p,a);if(GM({result:v,errorResetBoundary:a,throwOnError:u.throwOnError,query:l,suspense:u.suspense}))throw v.error;if((S=(j=o.getDefaultOptions().queries)==null?void 0:j._experimental_afterQuery)==null||S.call(j,u,v),u.experimental_prefetchInRender&&!vu.isServer()&&qM(v,n)){const N=h?V1(u,p,a):l==null?void 0:l.promise;N==null||N.catch(yr).finally(()=>{p.updateResult()})}return u.notifyOnChangeProps?v:p.trackResult(v)}function ur(e,t){return YM(e,_M)}/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),QN=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** + */const XM=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),YN=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim();/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */var XM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** + */var ZM={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZM=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:u,...l},f)=>y.createElement("svg",{ref:f,...XM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:QN("lucide",a),...l},[...u.map(([h,p])=>y.createElement(h,p)),...Array.isArray(o)?o:[o]]));/** + */const JM=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:a="",children:o,iconNode:u,...l},f)=>y.createElement("svg",{ref:f,...ZM,width:t,height:t,stroke:e,strokeWidth:n?Number(r)*24/Number(t):r,className:YN("lucide",a),...l},[...u.map(([h,p])=>y.createElement(h,p)),...Array.isArray(o)?o:[o]]));/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _e=(e,t)=>{const r=y.forwardRef(({className:n,...a},o)=>y.createElement(ZM,{ref:o,iconNode:t,className:QN(`lucide-${YM(e)}`,n),...a}));return r.displayName=`${e}`,r};/** + */const Ce=(e,t)=>{const r=y.forwardRef(({className:n,...a},o)=>y.createElement(JM,{ref:o,iconNode:t,className:YN(`lucide-${XM(e)}`,n),...a}));return r.displayName=`${e}`,r};/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vu=_e("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + */const gu=Ce("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const q1=_e("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** + */const q1=Ce("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const YN=_e("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** + */const XN=Ce("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ps=_e("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** + */const Ps=Ce("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JM=_e("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** + */const eI=Ce("Boxes",[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gu=_e("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** + */const yu=Ce("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cn=_e("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** + */const Cn=Ce("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const eI=_e("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const tI=Ce("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tI=_e("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** + */const rI=Ce("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const XN=_e("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const ZN=Ce("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const rI=_e("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** + */const nI=Ce("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nI=_e("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const iI=Ce("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iI=_e("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** + */const aI=Ce("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Vv=_e("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** + */const Gv=Ce("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const aI=_e("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** + */const oI=Ce("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Gv=_e("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** + */const Vv=Ce("Compass",[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oI=_e("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** + */const sI=Ce("Construction",[["rect",{x:"2",y:"6",width:"20",height:"8",rx:"1",key:"1estib"}],["path",{d:"M17 14v7",key:"7m2elx"}],["path",{d:"M7 14v7",key:"1cm7wv"}],["path",{d:"M17 3v3",key:"1v4jwn"}],["path",{d:"M7 3v3",key:"7o6guu"}],["path",{d:"M10 14 2.3 6.3",key:"1023jk"}],["path",{d:"m14 6 7.7 7.7",key:"1s8pl2"}],["path",{d:"m8 6 8 8",key:"hl96qh"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ZN=_e("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** + */const JN=Ce("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const _n=_e("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** + */const _n=Ce("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const no=_e("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** + */const no=Ce("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yu=_e("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** + */const xu=Ce("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Q1=_e("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + */const Q1=Ce("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const qv=_e("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + */const qv=Ce("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const sI=_e("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const lI=Ce("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const lI=_e("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** + */const uI=Ce("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const zm=_e("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** + */const zm=Ce("HardDrive",[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uI=_e("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** + */const cI=Ce("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const cI=_e("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** + */const dI=Ce("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xu=_e("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** + */const bu=Ce("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const dI=_e("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** + */const fI=Ce("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const fI=_e("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** + */const hI=Ce("List",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const hI=_e("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** + */const pI=Ce("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const pI=_e("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** + */const mI=Ce("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const mI=_e("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** + */const vI=Ce("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const JN=_e("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + */const gI=Ce("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const vI=_e("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** + */const e2=Ce("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const uu=_e("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** + */const yI=Ce("Power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const gI=_e("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** + */const cu=Ce("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const yI=_e("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** + */const xI=Ce("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oy=_e("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** + */const bI=Ce("Scroll",[["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const e2=_e("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + */const oy=Ce("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const xI=_e("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** + */const t2=Ce("Server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bu=_e("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** + */const wI=Ce("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Y1=_e("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** + */const kI=Ce("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const t2=_e("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/** + */const wu=Ce("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const r2=_e("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** + */const Y1=Ce("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const bI=_e("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** + */const r2=Ce("SquareTerminal",[["path",{d:"m7 11 2-2-2-2",key:"1lz0vl"}],["path",{d:"M11 13h4",key:"1p7l4v"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nf=_e("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** + */const n2=Ce("Star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qv=_e("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** + */const jI=Ce("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Cs=_e("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** + */const nf=Ce("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wI=_e("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** + */const Qv=Ce("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const wu=_e("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + */const Cs=Ce("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const oa=_e("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + */const SI=Ce("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** * @license lucide-react v0.460.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ls=_e("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Yv=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:dI},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:JM},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:gu},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:mI},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:Ps},{id:"terminal",label:"Terminal",hint:"Interaktives Hermes-Agent-Terminal",icon:t2},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:nI}];var X1=1,jI=.9,kI=.8,SI=.17,Fm=.1,Bm=.999,NI=.9999,EI=.99,PI=/[\\\/_+.#"@\[\(\{&]/,CI=/[\\\/_+.#"@\[\(\{&]/g,AI=/[\s-]/,n2=/[\s-]/g;function Xv(e,t,r,n,a,o,u){if(o===t.length)return a===e.length?X1:EI;var l=`${a},${o}`;if(u[l]!==void 0)return u[l];for(var f=n.charAt(o),h=r.indexOf(f,a),p=0,v,x,b,j;h>=0;)v=Xv(e,t,r,n,h+1,o+1,u),v>p&&(h===a?v*=X1:PI.test(e.charAt(h-1))?(v*=kI,b=e.slice(a,h-1).match(CI),b&&a>0&&(v*=Math.pow(Bm,b.length))):AI.test(e.charAt(h-1))?(v*=jI,j=e.slice(a,h-1).match(n2),j&&a>0&&(v*=Math.pow(Bm,j.length))):(v*=SI,a>0&&(v*=Math.pow(Bm,h-a))),e.charAt(h)!==t.charAt(o)&&(v*=NI)),(vv&&(v=x*Fm)),v>p&&(p=v),h=r.indexOf(f,h+1);return u[l]=p,p}function Z1(e){return e.toLowerCase().replace(n2," ")}function OI(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Xv(e,t,Z1(e),Z1(t),0,0,{})}function sa(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function J1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function As(...e){return t=>{let r=!1;const n=e.map(a=>{const o=J1(a,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let a=0;a{var N;const{scope:x,children:b,...j}=v,k=((N=x==null?void 0:x[e])==null?void 0:N[f])||l,S=y.useMemo(()=>j,Object.values(j));return c.jsx(k.Provider,{value:S,children:b})};h.displayName=o+"Provider";function p(v,x){var k;const b=((k=x==null?void 0:x[e])==null?void 0:k[f])||l,j=y.useContext(b);if(j)return j;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${o}\``)}return[h,p]}const a=()=>{const o=r.map(u=>y.createContext(u));return function(l){const f=(l==null?void 0:l[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:f}}),[l,f])}};return a.scopeName=e,[n,MI(a,...t)]}function MI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const u=n.reduce((l,{useScope:f,scopeName:h})=>{const v=f(o)[`__scope${h}`];return{...l,...v}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var ju=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},II=eh[" useId ".trim().toString()]||(()=>{}),TI=0;function oi(e){const[t,r]=y.useState(II());return ju(()=>{r(n=>n??String(TI++))},[e]),t?`radix-${t}`:""}var DI=eh[" useInsertionEffect ".trim().toString()]||ju;function RI({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,o,u]=$I({defaultProp:t,onChange:r}),l=e!==void 0,f=l?e:a;{const p=y.useRef(e!==void 0);y.useEffect(()=>{const v=p.current;v!==l&&console.warn(`${n} is changing from ${v?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,n])}const h=y.useCallback(p=>{var v;if(l){const x=LI(p)?p(e):p;x!==e&&((v=u.current)==null||v.call(u,x))}else o(p)},[l,e,o,u]);return[f,h]}function $I({defaultProp:e,onChange:t}){const[r,n]=y.useState(e),a=y.useRef(r),o=y.useRef(t);return DI(()=>{o.current=t},[t]),y.useEffect(()=>{var u;a.current!==r&&((u=o.current)==null||u.call(o,r),a.current=r)},[r,a]),[r,n,o]}function LI(e){return typeof e=="function"}var th=RN();function i2(e){const t=y.forwardRef((r,n)=>{let{children:a,...o}=r,u=null,l=!1;const f=[];ew(a)&&typeof jd=="function"&&(a=jd(a._payload)),y.Children.forEach(a,x=>{var b;if(WI(x)){l=!0;const j=x;let k="child"in j.props?j.props.child:j.props.children;ew(k)&&typeof jd=="function"&&(k=jd(k._payload)),u=FI(j,k),f.push((b=u==null?void 0:u.props)==null?void 0:b.children)}else f.push(x)}),u?u=y.cloneElement(u,void 0,f):!l&&y.Children.count(a)===1&&y.isValidElement(a)&&(u=a);const h=u?UI(u):void 0,p=mo(n,h);if(!u){if(a||a===0)throw new Error(l?GI(e):VI(e));return a}const v=BI(o,u.props??{});return u.type!==y.Fragment&&(v.ref=n?p:h),y.cloneElement(u,v)});return t.displayName=`${e}.Slot`,t}var zI=Symbol.for("radix.slottable"),FI=(e,t)=>{if("child"in e.props){const r=e.props.child;return y.isValidElement(r)?y.cloneElement(r,void 0,e.props.children(r.props.children)):null}return y.isValidElement(t)?t:null};function BI(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...l)=>{const f=o(...l);return a(...l),f}:a&&(r[n]=a):n==="style"?r[n]={...a,...o}:n==="className"&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}function UI(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function WI(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zI}var HI=Symbol.for("react.lazy");function ew(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===HI&&"_payload"in e&&KI(e._payload)}function KI(e){return typeof e=="object"&&e!==null&&"then"in e}var VI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,GI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,jd=eh[" use ".trim().toString()],qI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Vt=qI.reduce((e,t)=>{const r=i2(`Primitive.${t}`),n=y.forwardRef((a,o)=>{const{asChild:u,...l}=a,f=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function QI(e,t){e&&th.flushSync(()=>e.dispatchEvent(t))}function ku(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}function YI(e,t=globalThis==null?void 0:globalThis.document){const r=ku(e);y.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var XI="DismissableLayer",Zv="dismissableLayer.update",ZI="dismissableLayer.pointerDownOutside",JI="dismissableLayer.focusOutside",tw,sy=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),a2=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:l,onDismiss:f,...h}=e,p=y.useContext(sy),[v,x]=y.useState(null),b=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,j]=y.useState({}),k=mo(t,B=>x(B)),S=Array.from(p.layers),[N]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),P=S.indexOf(N),O=v?S.indexOf(v):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,_=O>=P,A=y.useRef(!1),I=nT(B=>{const V=B.target;if(!(V instanceof Node))return;const q=[...p.branches].some(R=>R.contains(V));!_||q||(o==null||o(B),l==null||l(B),B.defaultPrevented||f==null||f())},{ownerDocument:b,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:A,dismissableSurfaces:p.dismissableSurfaces}),U=iT(B=>{if(n&&A.current)return;const V=B.target;[...p.branches].some(R=>R.contains(V))||(u==null||u(B),l==null||l(B),B.defaultPrevented||f==null||f())},b);return YI(B=>{O===p.layers.size-1&&(a==null||a(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))},b),y.useEffect(()=>{if(v)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(tw=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),rw(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(v),p.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=tw))}},[v,b,r,p]),y.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),rw())},[v,p]),y.useEffect(()=>{const B=()=>j({});return document.addEventListener(Zv,B),()=>document.removeEventListener(Zv,B)},[]),c.jsx(Vt.div,{...h,ref:k,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:sa(e.onFocusCapture,U.onFocusCapture),onBlurCapture:sa(e.onBlurCapture,U.onBlurCapture),onPointerDownCapture:sa(e.onPointerDownCapture,I.onPointerDownCapture)})});a2.displayName=XI;var eT="DismissableLayerBranch",tT=y.forwardRef((e,t)=>{const r=y.useContext(sy),n=y.useRef(null),a=mo(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),c.jsx(Vt.div,{...e,ref:a})});tT.displayName=eT;function rT(){const e=y.useContext(sy),[t,r]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function nT(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o}=t,u=ku(e),l=y.useRef(!1),f=y.useRef(!1),h=y.useRef(new Map),p=y.useRef(()=>{});return y.useEffect(()=>{function v(){f.current=!1,a.current=!1,h.current.clear()}function x(){return Array.from(h.current.values()).some(Boolean)}function b(P){if(!f.current)return;const O=P.target;O instanceof Node&&[...o].some(_=>_.contains(O))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}function j(P){f.current&&h.current.set(P.type,!1)}const k=P=>{if(P.target&&!l.current){let O=function(){r.removeEventListener("click",p.current);const _=x();v(),_||o2(ZI,u,C,{discrete:!0})};const C={originalEvent:P};f.current=!0,a.current=n&&P.button===0,h.current.clear(),!n||P.button!==0?O():(r.removeEventListener("click",p.current),p.current=O,r.addEventListener("click",p.current,{once:!0}))}else r.removeEventListener("click",p.current),v();l.current=!1},S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of S)r.addEventListener(P,b,!0),r.addEventListener(P,j);const N=window.setTimeout(()=>{r.addEventListener("pointerdown",k)},0);return()=>{window.clearTimeout(N),r.removeEventListener("pointerdown",k),r.removeEventListener("click",p.current);for(const P of S)r.removeEventListener(P,b,!0),r.removeEventListener(P,j)}},[r,u,n,a,o]),{onPointerDownCapture:()=>l.current=!0}}function iT(e,t=globalThis==null?void 0:globalThis.document){const r=ku(e),n=y.useRef(!1);return y.useEffect(()=>{const a=o=>{o.target&&!n.current&&o2(JI,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rw(){const e=new CustomEvent(Zv);document.dispatchEvent(e)}function o2(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?QI(a,o):a.dispatchEvent(o)}var Um="focusScope.autoFocusOnMount",Wm="focusScope.autoFocusOnUnmount",nw={bubbles:!1,cancelable:!0},aT="FocusScope",s2=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...u}=e,[l,f]=y.useState(null),h=ku(a),p=ku(o),v=y.useRef(null),x=mo(t,k=>f(k)),b=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let k=function(O){if(b.paused||!l)return;const C=O.target;l.contains(C)?v.current=C:Vi(v.current,{select:!0})},S=function(O){if(b.paused||!l)return;const C=O.relatedTarget;C!==null&&(l.contains(C)||Vi(v.current,{select:!0}))},N=function(O){if(document.activeElement===document.body)for(const _ of O)_.removedNodes.length>0&&Vi(l)};document.addEventListener("focusin",k),document.addEventListener("focusout",S);const P=new MutationObserver(N);return l&&P.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",k),document.removeEventListener("focusout",S),P.disconnect()}}},[n,l,b.paused]),y.useEffect(()=>{if(l){aw.add(b);const k=document.activeElement;if(!l.contains(k)){const N=new CustomEvent(Um,nw);l.addEventListener(Um,h),l.dispatchEvent(N),N.defaultPrevented||(oT(dT(l2(l)),{select:!0}),document.activeElement===k&&Vi(l))}return()=>{l.removeEventListener(Um,h),setTimeout(()=>{const N=new CustomEvent(Wm,nw);l.addEventListener(Wm,p),l.dispatchEvent(N),N.defaultPrevented||Vi(k??document.body,{select:!0}),l.removeEventListener(Wm,p),aw.remove(b)},0)}}},[l,h,p,b]);const j=y.useCallback(k=>{if(!r&&!n||b.paused)return;const S=k.key==="Tab"&&!k.altKey&&!k.ctrlKey&&!k.metaKey,N=document.activeElement;if(S&&N){const P=k.currentTarget,[O,C]=sT(P);O&&C?!k.shiftKey&&N===C?(k.preventDefault(),r&&Vi(O,{select:!0})):k.shiftKey&&N===O&&(k.preventDefault(),r&&Vi(C,{select:!0})):N===P&&k.preventDefault()}},[r,n,b.paused]);return c.jsx(Vt.div,{tabIndex:-1,...u,ref:x,onKeyDown:j})});s2.displayName=aT;function oT(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Vi(n,{select:t}),document.activeElement!==r)return}function sT(e){const t=l2(e),r=iw(t,e),n=iw(t.reverse(),e);return[r,n]}function l2(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function iw(e,t){for(const r of e)if(!lT(r,{upTo:t}))return r}function lT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function uT(e){return e instanceof HTMLInputElement&&"select"in e}function Vi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&uT(e)&&t&&e.select()}}var aw=cT();function cT(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ow(e,t),e.unshift(t)},remove(t){var r;e=ow(e,t),(r=e[0])==null||r.resume()}}}function ow(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function dT(e){return e.filter(t=>t.tagName!=="A")}var fT="Portal",u2=y.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,o]=y.useState(!1);ju(()=>o(!0),[]);const u=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return u?th.createPortal(c.jsx(Vt.div,{...n,ref:t}),u):null});u2.displayName=fT;function hT(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var rh=e=>{const{present:t,children:r}=e,n=pT(t),a=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=mT(n.ref,vT(a));return typeof r=="function"||n.isPresent?y.cloneElement(a,{ref:o}):null};rh.displayName="Presence";function pT(e){const[t,r]=y.useState(),n=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),u=e?"mounted":"unmounted",[l,f]=hT(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const h=kd(n.current);o.current=l==="mounted"?h:"none"},[l]),ju(()=>{const h=n.current,p=a.current;if(p!==e){const x=o.current,b=kd(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&x!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),ju(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,v=b=>{const k=kd(n.current).includes(CSS.escape(b.animationName));if(b.target===t&&k&&(f("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},x=b=>{b.target===t&&(o.current=kd(n.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(h=>{n.current=h?getComputedStyle(h):null,r(h)},[])}}function sw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function mT(...e){const t=y.useRef(e);return t.current=e,y.useCallback(r=>{const n=t.current;let a=!1;const o=n.map(u=>{const l=sw(u,r);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let u=0;u{bn||(bn={start:lw(),end:lw()});const{start:e,end:t}=bn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Sd++,()=>{Sd===1&&(bn==null||bn.start.remove(),bn==null||bn.end.remove(),bn=null),Sd=Math.max(0,Sd-1)}},[])}function lw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Pn=function(){return Pn=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return TT;var t=DT(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},$T=h2(),us="data-scroll-locked",LT=function(e,t,r,n){var a=e.left,o=e.top,u=e.right,l=e.gap;return r===void 0&&(r="margin"),` - .`.concat(xT,` { + */const ku=Ce("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const oa=Ce("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-react v0.460.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ls=Ce("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Yv=[{id:"dashboard",label:"Zentrale",hint:"System- & Stack-Status",icon:fI},{id:"models",label:"Modell-Manager",hint:"Verwalten, laden & Gateway-Routing",icon:eI},{id:"memory",label:"Gedächtnis",hint:"Geteiltes Memory verwalten",icon:yu},{id:"connect",label:"Verbinden",hint:"IDE-/Agent-Configs erzeugen",icon:gI},{id:"agent",label:"Hermes",hint:"Agent-Status & Verdrahtung",icon:Ps},{id:"terminal",label:"Terminal",hint:"Interaktives Hermes-Agent-Terminal",icon:r2},{id:"guide",label:"Anleitung",hint:"Einrichten & Vibe-Coding",icon:iI}];var X1=1,NI=.9,EI=.8,PI=.17,Fm=.1,Bm=.999,CI=.9999,AI=.99,OI=/[\\\/_+.#"@\[\(\{&]/,_I=/[\\\/_+.#"@\[\(\{&]/g,MI=/[\s-]/,i2=/[\s-]/g;function Xv(e,t,r,n,a,o,u){if(o===t.length)return a===e.length?X1:AI;var l=`${a},${o}`;if(u[l]!==void 0)return u[l];for(var f=n.charAt(o),h=r.indexOf(f,a),p=0,v,x,b,k;h>=0;)v=Xv(e,t,r,n,h+1,o+1,u),v>p&&(h===a?v*=X1:OI.test(e.charAt(h-1))?(v*=EI,b=e.slice(a,h-1).match(_I),b&&a>0&&(v*=Math.pow(Bm,b.length))):MI.test(e.charAt(h-1))?(v*=NI,k=e.slice(a,h-1).match(i2),k&&a>0&&(v*=Math.pow(Bm,k.length))):(v*=PI,a>0&&(v*=Math.pow(Bm,h-a))),e.charAt(h)!==t.charAt(o)&&(v*=CI)),(vv&&(v=x*Fm)),v>p&&(p=v),h=r.indexOf(f,h+1);return u[l]=p,p}function Z1(e){return e.toLowerCase().replace(i2," ")}function II(e,t,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,Xv(e,t,Z1(e),Z1(t),0,0,{})}function sa(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function J1(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function As(...e){return t=>{let r=!1;const n=e.map(a=>{const o=J1(a,t);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let a=0;a{var N;const{scope:x,children:b,...k}=v,j=((N=x==null?void 0:x[e])==null?void 0:N[f])||l,S=y.useMemo(()=>k,Object.values(k));return c.jsx(j.Provider,{value:S,children:b})};h.displayName=o+"Provider";function p(v,x){var j;const b=((j=x==null?void 0:x[e])==null?void 0:j[f])||l,k=y.useContext(b);if(k)return k;if(u!==void 0)return u;throw new Error(`\`${v}\` must be used within \`${o}\``)}return[h,p]}const a=()=>{const o=r.map(u=>y.createContext(u));return function(l){const f=(l==null?void 0:l[e])||o;return y.useMemo(()=>({[`__scope${e}`]:{...l,[e]:f}}),[l,f])}};return a.scopeName=e,[n,DI(a,...t)]}function DI(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const u=n.reduce((l,{useScope:f,scopeName:h})=>{const v=f(o)[`__scope${h}`];return{...l,...v}},{});return y.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return r.scopeName=t.scopeName,r}var ju=globalThis!=null&&globalThis.document?y.useLayoutEffect:()=>{},RI=eh[" useId ".trim().toString()]||(()=>{}),$I=0;function oi(e){const[t,r]=y.useState(RI());return ju(()=>{r(n=>n??String($I++))},[e]),t?`radix-${t}`:""}var LI=eh[" useInsertionEffect ".trim().toString()]||ju;function zI({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,o,u]=FI({defaultProp:t,onChange:r}),l=e!==void 0,f=l?e:a;{const p=y.useRef(e!==void 0);y.useEffect(()=>{const v=p.current;v!==l&&console.warn(`${n} is changing from ${v?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=l},[l,n])}const h=y.useCallback(p=>{var v;if(l){const x=BI(p)?p(e):p;x!==e&&((v=u.current)==null||v.call(u,x))}else o(p)},[l,e,o,u]);return[f,h]}function FI({defaultProp:e,onChange:t}){const[r,n]=y.useState(e),a=y.useRef(r),o=y.useRef(t);return LI(()=>{o.current=t},[t]),y.useEffect(()=>{var u;a.current!==r&&((u=o.current)==null||u.call(o,r),a.current=r)},[r,a]),[r,n,o]}function BI(e){return typeof e=="function"}var th=$N();function a2(e){const t=y.forwardRef((r,n)=>{let{children:a,...o}=r,u=null,l=!1;const f=[];ew(a)&&typeof kd=="function"&&(a=kd(a._payload)),y.Children.forEach(a,x=>{var b;if(GI(x)){l=!0;const k=x;let j="child"in k.props?k.props.child:k.props.children;ew(j)&&typeof kd=="function"&&(j=kd(j._payload)),u=WI(k,j),f.push((b=u==null?void 0:u.props)==null?void 0:b.children)}else f.push(x)}),u?u=y.cloneElement(u,void 0,f):!l&&y.Children.count(a)===1&&y.isValidElement(a)&&(u=a);const h=u?KI(u):void 0,p=mo(n,h);if(!u){if(a||a===0)throw new Error(l?YI(e):QI(e));return a}const v=HI(o,u.props??{});return u.type!==y.Fragment&&(v.ref=n?p:h),y.cloneElement(u,v)});return t.displayName=`${e}.Slot`,t}var UI=Symbol.for("radix.slottable"),WI=(e,t)=>{if("child"in e.props){const r=e.props.child;return y.isValidElement(r)?y.cloneElement(r,void 0,e.props.children(r.props.children)):null}return y.isValidElement(t)?t:null};function HI(e,t){const r={...t};for(const n in t){const a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...l)=>{const f=o(...l);return a(...l),f}:a&&(r[n]=a):n==="style"?r[n]={...a,...o}:n==="className"&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}function KI(e){var n,a;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(a=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function GI(e){return y.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===UI}var VI=Symbol.for("react.lazy");function ew(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===VI&&"_payload"in e&&qI(e._payload)}function qI(e){return typeof e=="object"&&e!==null&&"then"in e}var QI=e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,YI=e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,kd=eh[" use ".trim().toString()],XI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Gt=XI.reduce((e,t)=>{const r=a2(`Primitive.${t}`),n=y.forwardRef((a,o)=>{const{asChild:u,...l}=a,f=u?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(f,{...l,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ZI(e,t){e&&th.flushSync(()=>e.dispatchEvent(t))}function Su(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>((...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)}),[])}function JI(e,t=globalThis==null?void 0:globalThis.document){const r=Su(e);y.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var eT="DismissableLayer",Zv="dismissableLayer.update",tT="dismissableLayer.pointerDownOutside",rT="dismissableLayer.focusOutside",tw,sy=y.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),o2=y.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:n=!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:u,onInteractOutside:l,onDismiss:f,...h}=e,p=y.useContext(sy),[v,x]=y.useState(null),b=(v==null?void 0:v.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,k]=y.useState({}),j=mo(t,B=>x(B)),S=Array.from(p.layers),[N]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),P=S.indexOf(N),O=v?S.indexOf(v):-1,C=p.layersWithOutsidePointerEventsDisabled.size>0,_=O>=P,A=y.useRef(!1),I=oT(B=>{const K=B.target;if(!(K instanceof Node))return;const q=[...p.branches].some(R=>R.contains(K));!_||q||(o==null||o(B),l==null||l(B),B.defaultPrevented||f==null||f())},{ownerDocument:b,deferPointerDownOutside:n,isDeferredPointerDownOutsideRef:A,dismissableSurfaces:p.dismissableSurfaces}),$=sT(B=>{if(n&&A.current)return;const K=B.target;[...p.branches].some(R=>R.contains(K))||(u==null||u(B),l==null||l(B),B.defaultPrevented||f==null||f())},b);return JI(B=>{O===p.layers.size-1&&(a==null||a(B),!B.defaultPrevented&&f&&(B.preventDefault(),f()))},b),y.useEffect(()=>{if(v)return r&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(tw=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(v)),p.layers.add(v),rw(),()=>{r&&(p.layersWithOutsidePointerEventsDisabled.delete(v),p.layersWithOutsidePointerEventsDisabled.size===0&&(b.body.style.pointerEvents=tw))}},[v,b,r,p]),y.useEffect(()=>()=>{v&&(p.layers.delete(v),p.layersWithOutsidePointerEventsDisabled.delete(v),rw())},[v,p]),y.useEffect(()=>{const B=()=>k({});return document.addEventListener(Zv,B),()=>document.removeEventListener(Zv,B)},[]),c.jsx(Gt.div,{...h,ref:j,style:{pointerEvents:C?_?"auto":"none":void 0,...e.style},onFocusCapture:sa(e.onFocusCapture,$.onFocusCapture),onBlurCapture:sa(e.onBlurCapture,$.onBlurCapture),onPointerDownCapture:sa(e.onPointerDownCapture,I.onPointerDownCapture)})});o2.displayName=eT;var nT="DismissableLayerBranch",iT=y.forwardRef((e,t)=>{const r=y.useContext(sy),n=y.useRef(null),a=mo(t,n);return y.useEffect(()=>{const o=n.current;if(o)return r.branches.add(o),()=>{r.branches.delete(o)}},[r.branches]),c.jsx(Gt.div,{...e,ref:a})});iT.displayName=nT;function aT(){const e=y.useContext(sy),[t,r]=y.useState(null);return y.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),r}function oT(e,t){const{ownerDocument:r=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:n=!1,isDeferredPointerDownOutsideRef:a,dismissableSurfaces:o}=t,u=Su(e),l=y.useRef(!1),f=y.useRef(!1),h=y.useRef(new Map),p=y.useRef(()=>{});return y.useEffect(()=>{function v(){f.current=!1,a.current=!1,h.current.clear()}function x(){return Array.from(h.current.values()).some(Boolean)}function b(P){if(!f.current)return;const O=P.target;O instanceof Node&&[...o].some(_=>_.contains(O))||h.current.set(P.type,!0),P.type==="click"&&window.setTimeout(()=>{f.current&&p.current()},0)}function k(P){f.current&&h.current.set(P.type,!1)}const j=P=>{if(P.target&&!l.current){let O=function(){r.removeEventListener("click",p.current);const _=x();v(),_||s2(tT,u,C,{discrete:!0})};const C={originalEvent:P};f.current=!0,a.current=n&&P.button===0,h.current.clear(),!n||P.button!==0?O():(r.removeEventListener("click",p.current),p.current=O,r.addEventListener("click",p.current,{once:!0}))}else r.removeEventListener("click",p.current),v();l.current=!1},S=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const P of S)r.addEventListener(P,b,!0),r.addEventListener(P,k);const N=window.setTimeout(()=>{r.addEventListener("pointerdown",j)},0);return()=>{window.clearTimeout(N),r.removeEventListener("pointerdown",j),r.removeEventListener("click",p.current);for(const P of S)r.removeEventListener(P,b,!0),r.removeEventListener(P,k)}},[r,u,n,a,o]),{onPointerDownCapture:()=>l.current=!0}}function sT(e,t=globalThis==null?void 0:globalThis.document){const r=Su(e),n=y.useRef(!1);return y.useEffect(()=>{const a=o=>{o.target&&!n.current&&s2(rT,r,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function rw(){const e=new CustomEvent(Zv);document.dispatchEvent(e)}function s2(e,t,r,{discrete:n}){const a=r.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?ZI(a,o):a.dispatchEvent(o)}var Um="focusScope.autoFocusOnMount",Wm="focusScope.autoFocusOnUnmount",nw={bubbles:!1,cancelable:!0},lT="FocusScope",l2=y.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...u}=e,[l,f]=y.useState(null),h=Su(a),p=Su(o),v=y.useRef(null),x=mo(t,j=>f(j)),b=y.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;y.useEffect(()=>{if(n){let j=function(O){if(b.paused||!l)return;const C=O.target;l.contains(C)?v.current=C:Gi(v.current,{select:!0})},S=function(O){if(b.paused||!l)return;const C=O.relatedTarget;C!==null&&(l.contains(C)||Gi(v.current,{select:!0}))},N=function(O){if(document.activeElement===document.body)for(const _ of O)_.removedNodes.length>0&&Gi(l)};document.addEventListener("focusin",j),document.addEventListener("focusout",S);const P=new MutationObserver(N);return l&&P.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",j),document.removeEventListener("focusout",S),P.disconnect()}}},[n,l,b.paused]),y.useEffect(()=>{if(l){aw.add(b);const j=document.activeElement;if(!l.contains(j)){const N=new CustomEvent(Um,nw);l.addEventListener(Um,h),l.dispatchEvent(N),N.defaultPrevented||(uT(pT(u2(l)),{select:!0}),document.activeElement===j&&Gi(l))}return()=>{l.removeEventListener(Um,h),setTimeout(()=>{const N=new CustomEvent(Wm,nw);l.addEventListener(Wm,p),l.dispatchEvent(N),N.defaultPrevented||Gi(j??document.body,{select:!0}),l.removeEventListener(Wm,p),aw.remove(b)},0)}}},[l,h,p,b]);const k=y.useCallback(j=>{if(!r&&!n||b.paused)return;const S=j.key==="Tab"&&!j.altKey&&!j.ctrlKey&&!j.metaKey,N=document.activeElement;if(S&&N){const P=j.currentTarget,[O,C]=cT(P);O&&C?!j.shiftKey&&N===C?(j.preventDefault(),r&&Gi(O,{select:!0})):j.shiftKey&&N===O&&(j.preventDefault(),r&&Gi(C,{select:!0})):N===P&&j.preventDefault()}},[r,n,b.paused]);return c.jsx(Gt.div,{tabIndex:-1,...u,ref:x,onKeyDown:k})});l2.displayName=lT;function uT(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Gi(n,{select:t}),document.activeElement!==r)return}function cT(e){const t=u2(e),r=iw(t,e),n=iw(t.reverse(),e);return[r,n]}function u2(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function iw(e,t){for(const r of e)if(!dT(r,{upTo:t}))return r}function dT(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function fT(e){return e instanceof HTMLInputElement&&"select"in e}function Gi(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&fT(e)&&t&&e.select()}}var aw=hT();function hT(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=ow(e,t),e.unshift(t)},remove(t){var r;e=ow(e,t),(r=e[0])==null||r.resume()}}}function ow(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function pT(e){return e.filter(t=>t.tagName!=="A")}var mT="Portal",c2=y.forwardRef((e,t)=>{var l;const{container:r,...n}=e,[a,o]=y.useState(!1);ju(()=>o(!0),[]);const u=r||a&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return u?th.createPortal(c.jsx(Gt.div,{...n,ref:t}),u):null});c2.displayName=mT;function vT(e,t){return y.useReducer((r,n)=>t[r][n]??r,e)}var rh=e=>{const{present:t,children:r}=e,n=gT(t),a=typeof r=="function"?r({present:n.isPresent}):y.Children.only(r),o=yT(n.ref,xT(a));return typeof r=="function"||n.isPresent?y.cloneElement(a,{ref:o}):null};rh.displayName="Presence";function gT(e){const[t,r]=y.useState(),n=y.useRef(null),a=y.useRef(e),o=y.useRef("none"),u=e?"mounted":"unmounted",[l,f]=vT(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return y.useEffect(()=>{const h=jd(n.current);o.current=l==="mounted"?h:"none"},[l]),ju(()=>{const h=n.current,p=a.current;if(p!==e){const x=o.current,b=jd(h);e?f("MOUNT"):b==="none"||(h==null?void 0:h.display)==="none"?f("UNMOUNT"):f(p&&x!==b?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,f]),ju(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,v=b=>{const j=jd(n.current).includes(CSS.escape(b.animationName));if(b.target===t&&j&&(f("ANIMATION_END"),!a.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},x=b=>{b.target===t&&(o.current=jd(n.current))};return t.addEventListener("animationstart",x),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",x),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:y.useCallback(h=>{n.current=h?getComputedStyle(h):null,r(h)},[])}}function sw(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function yT(...e){const t=y.useRef(e);return t.current=e,y.useCallback(r=>{const n=t.current;let a=!1;const o=n.map(u=>{const l=sw(u,r);return!a&&typeof l=="function"&&(a=!0),l});if(a)return()=>{for(let u=0;u{bn||(bn={start:lw(),end:lw()});const{start:e,end:t}=bn;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement("afterbegin",e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement("beforeend",t),Sd++,()=>{Sd===1&&(bn==null||bn.start.remove(),bn==null||bn.end.remove(),bn=null),Sd=Math.max(0,Sd-1)}},[])}function lw(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Pn=function(){return Pn=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return $T;var t=LT(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},FT=p2(),us="data-scroll-locked",BT=function(e,t,r,n){var a=e.left,o=e.top,u=e.right,l=e.gap;return r===void 0&&(r="margin"),` + .`.concat(kT,` { overflow: hidden `).concat(n,`; padding-right: `).concat(l,"px ").concat(n,`; } @@ -345,7 +355,7 @@ Error generating stack: `+w.message+` `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),` } - .`).concat(Gd,` { + .`).concat(Vd,` { right: `).concat(l,"px ").concat(n,`; } @@ -353,7 +363,7 @@ Error generating stack: `+w.message+` margin-right: `).concat(l,"px ").concat(n,`; } - .`).concat(Gd," .").concat(Gd,` { + .`).concat(Vd," .").concat(Vd,` { right: 0 `).concat(n,`; } @@ -362,12 +372,12 @@ Error generating stack: `+w.message+` } body[`).concat(us,`] { - `).concat(bT,": ").concat(l,`px; + `).concat(jT,": ").concat(l,`px; } -`)},cw=function(){var e=parseInt(document.body.getAttribute(us)||"0",10);return isFinite(e)?e:0},zT=function(){y.useEffect(function(){return document.body.setAttribute(us,(cw()+1).toString()),function(){var e=cw()-1;e<=0?document.body.removeAttribute(us):document.body.setAttribute(us,e.toString())}},[])},FT=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;zT();var o=y.useMemo(function(){return RT(a)},[a]);return y.createElement($T,{styles:LT(o,!t,a,r?"":"!important")})},Jv=!1;if(typeof window<"u")try{var Nd=Object.defineProperty({},"passive",{get:function(){return Jv=!0,!0}});window.addEventListener("test",Nd,Nd),window.removeEventListener("test",Nd,Nd)}catch{Jv=!1}var Ko=Jv?{passive:!1}:!1,BT=function(e){return e.tagName==="TEXTAREA"},p2=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!BT(e)&&r[t]==="visible")},UT=function(e){return p2(e,"overflowY")},WT=function(e){return p2(e,"overflowX")},dw=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=m2(e,n);if(a){var o=v2(e,n),u=o[1],l=o[2];if(u>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},HT=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},KT=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},m2=function(e,t){return e==="v"?UT(t):WT(t)},v2=function(e,t){return e==="v"?HT(t):KT(t)},VT=function(e,t){return e==="h"&&t==="rtl"?-1:1},GT=function(e,t,r,n,a){var o=VT(e,window.getComputedStyle(t).direction),u=o*n,l=r.target,f=t.contains(l),h=!1,p=u>0,v=0,x=0;do{if(!l)break;var b=v2(e,l),j=b[0],k=b[1],S=b[2],N=k-S-o*j;(j||N)&&m2(e,l)&&(v+=N,x+=j);var P=l.parentNode;l=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!f&&l!==document.body||f&&(t.contains(l)||t===l));return(p&&Math.abs(v)<1||!p&&Math.abs(x)<1)&&(h=!0),h},Ed=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fw=function(e){return[e.deltaX,e.deltaY]},hw=function(e){return e&&"current"in e?e.current:e},qT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},QT=function(e){return` +`)},cw=function(){var e=parseInt(document.body.getAttribute(us)||"0",10);return isFinite(e)?e:0},UT=function(){y.useEffect(function(){return document.body.setAttribute(us,(cw()+1).toString()),function(){var e=cw()-1;e<=0?document.body.removeAttribute(us):document.body.setAttribute(us,e.toString())}},[])},WT=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,a=n===void 0?"margin":n;UT();var o=y.useMemo(function(){return zT(a)},[a]);return y.createElement(FT,{styles:BT(o,!t,a,r?"":"!important")})},Jv=!1;if(typeof window<"u")try{var Nd=Object.defineProperty({},"passive",{get:function(){return Jv=!0,!0}});window.addEventListener("test",Nd,Nd),window.removeEventListener("test",Nd,Nd)}catch{Jv=!1}var Ko=Jv?{passive:!1}:!1,HT=function(e){return e.tagName==="TEXTAREA"},m2=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!HT(e)&&r[t]==="visible")},KT=function(e){return m2(e,"overflowY")},GT=function(e){return m2(e,"overflowX")},dw=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var a=v2(e,n);if(a){var o=g2(e,n),u=o[1],l=o[2];if(u>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},VT=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},qT=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},v2=function(e,t){return e==="v"?KT(t):GT(t)},g2=function(e,t){return e==="v"?VT(t):qT(t)},QT=function(e,t){return e==="h"&&t==="rtl"?-1:1},YT=function(e,t,r,n,a){var o=QT(e,window.getComputedStyle(t).direction),u=o*n,l=r.target,f=t.contains(l),h=!1,p=u>0,v=0,x=0;do{if(!l)break;var b=g2(e,l),k=b[0],j=b[1],S=b[2],N=j-S-o*k;(k||N)&&v2(e,l)&&(v+=N,x+=k);var P=l.parentNode;l=P&&P.nodeType===Node.DOCUMENT_FRAGMENT_NODE?P.host:P}while(!f&&l!==document.body||f&&(t.contains(l)||t===l));return(p&&Math.abs(v)<1||!p&&Math.abs(x)<1)&&(h=!0),h},Ed=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},fw=function(e){return[e.deltaX,e.deltaY]},hw=function(e){return e&&"current"in e?e.current:e},XT=function(e,t){return e[0]===t[0]&&e[1]===t[1]},ZT=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},YT=0,Vo=[];function XT(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),a=y.useState(YT++)[0],o=y.useState(h2)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var k=yT([e.lockRef.current],(e.shards||[]).map(hw),!0).filter(Boolean);return k.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),k.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(k,S){if("touches"in k&&k.touches.length===2||k.type==="wheel"&&k.ctrlKey)return!u.current.allowPinchZoom;var N=Ed(k),P=r.current,O="deltaX"in k?k.deltaX:P[0]-N[0],C="deltaY"in k?k.deltaY:P[1]-N[1],_,A=k.target,I=Math.abs(O)>Math.abs(C)?"h":"v";if("touches"in k&&I==="h"&&A.type==="range")return!1;var U=window.getSelection(),B=U&&U.anchorNode,V=B?B===A||B.contains(A):!1;if(V)return!1;var q=dw(I,A);if(!q)return!0;if(q?_=I:(_=I==="v"?"h":"v",q=dw(I,A)),!q)return!1;if(!n.current&&"changedTouches"in k&&(O||C)&&(n.current=_),!_)return!0;var R=n.current||_;return GT(R,S,k,R==="h"?O:C)},[]),f=y.useCallback(function(k){var S=k;if(!(!Vo.length||Vo[Vo.length-1]!==o)){var N="deltaY"in S?fw(S):Ed(S),P=t.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&qT(_.delta,N)})[0];if(P&&P.should){S.cancelable&&S.preventDefault();return}if(!P){var O=(u.current.shards||[]).map(hw).filter(Boolean).filter(function(_){return _.contains(S.target)}),C=O.length>0?l(S,O[0]):!u.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),h=y.useCallback(function(k,S,N,P){var O={name:k,delta:S,target:N,should:P,shadowParent:ZT(N)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(C){return C!==O})},1)},[]),p=y.useCallback(function(k){r.current=Ed(k),n.current=void 0},[]),v=y.useCallback(function(k){h(k.type,fw(k),k.target,l(k,e.lockRef.current))},[]),x=y.useCallback(function(k){h(k.type,Ed(k),k.target,l(k,e.lockRef.current))},[]);y.useEffect(function(){return Vo.push(o),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ko),document.addEventListener("touchmove",f,Ko),document.addEventListener("touchstart",p,Ko),function(){Vo=Vo.filter(function(k){return k!==o}),document.removeEventListener("wheel",f,Ko),document.removeEventListener("touchmove",f,Ko),document.removeEventListener("touchstart",p,Ko)}},[]);var b=e.removeScrollBar,j=e.inert;return y.createElement(y.Fragment,null,j?y.createElement(o,{styles:QT(a)}):null,b?y.createElement(FT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZT(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const JT=PT(f2,XT);var g2=y.forwardRef(function(e,t){return y.createElement(nh,Pn({},e,{ref:t,sideCar:JT}))});g2.classNames=nh.classNames;var e3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Go=new WeakMap,Pd=new WeakMap,Cd={},Gm=0,y2=function(e){return e&&(e.host||y2(e.parentNode))},t3=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=y2(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},r3=function(e,t,r,n){var a=t3(t,Array.isArray(e)?e:[e]);Cd[r]||(Cd[r]=new WeakMap);var o=Cd[r],u=[],l=new Set,f=new Set(a),h=function(v){!v||l.has(v)||(l.add(v),h(v.parentNode))};a.forEach(h);var p=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(x){if(l.has(x))p(x);else try{var b=x.getAttribute(n),j=b!==null&&b!=="false",k=(Go.get(x)||0)+1,S=(o.get(x)||0)+1;Go.set(x,k),o.set(x,S),u.push(x),k===1&&j&&Pd.set(x,!0),S===1&&x.setAttribute(r,"true"),j||x.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return p(t),l.clear(),Gm++,function(){u.forEach(function(v){var x=Go.get(v)-1,b=o.get(v)-1;Go.set(v,x),o.set(v,b),x||(Pd.has(v)||v.removeAttribute(n),Pd.delete(v)),b||v.removeAttribute(r)}),Gm--,Gm||(Go=new WeakMap,Go=new WeakMap,Pd=new WeakMap,Cd={})}},n3=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=e3(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),r3(n,a,r,"aria-hidden")):function(){return null}},ih="Dialog",[x2]=_I(ih),[i3,hn]=x2(ih),b2=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:u=!0}=e,l=y.useRef(null),f=y.useRef(null),[h,p]=RI({prop:n,defaultProp:a??!1,onChange:o,caller:ih});return c.jsx(i3,{scope:t,triggerRef:l,contentRef:f,contentId:oi(),titleId:oi(),descriptionId:oi(),open:h,onOpenChange:p,onOpenToggle:y.useCallback(()=>p(v=>!v),[p]),modal:u,children:r})};b2.displayName=ih;var w2="DialogTrigger",a3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(w2,r),o=mo(t,a.triggerRef);return c.jsx(Vt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":uy(a.open),...n,ref:o,onClick:sa(e.onClick,a.onOpenToggle)})});a3.displayName=w2;var ly="DialogPortal",[o3,j2]=x2(ly,{forceMount:void 0}),k2=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=hn(ly,t);return c.jsx(o3,{scope:t,forceMount:r,children:y.Children.map(n,u=>c.jsx(rh,{present:r||o.open,children:c.jsx(u2,{asChild:!0,container:a,children:u})}))})};k2.displayName=ly;var af="DialogOverlay",S2=y.forwardRef((e,t)=>{const r=j2(af,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=hn(af,e.__scopeDialog);return o.modal?c.jsx(rh,{present:n||o.open,children:c.jsx(l3,{...a,ref:t})}):null});S2.displayName=af;var s3=i2("DialogOverlay.RemoveScroll"),l3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(af,r),o=rT(),u=mo(t,o);return c.jsx(g2,{as:s3,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(Vt.div,{"data-state":uy(a.open),...n,ref:u,style:{pointerEvents:"auto",...n.style}})})}),Os="DialogContent",N2=y.forwardRef((e,t)=>{const r=j2(Os,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=hn(Os,e.__scopeDialog);return c.jsx(rh,{present:n||o.open,children:o.modal?c.jsx(u3,{...a,ref:t}):c.jsx(c3,{...a,ref:t})})});N2.displayName=Os;var u3=y.forwardRef((e,t)=>{const r=hn(Os,e.__scopeDialog),n=y.useRef(null),a=mo(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return n3(o)},[]),c.jsx(E2,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:sa(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:sa(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0;(u.button===2||l)&&o.preventDefault()}),onFocusOutside:sa(e.onFocusOutside,o=>o.preventDefault())})}),c3=y.forwardRef((e,t)=>{const r=hn(Os,e.__scopeDialog),n=y.useRef(!1),a=y.useRef(!1);return c.jsx(E2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,l;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),E2=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...u}=e,l=hn(Os,r);return gT(),c.jsx(c.Fragment,{children:c.jsx(s2,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:c.jsx(a2,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":uy(l.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),P2="DialogTitle",d3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(P2,r);return c.jsx(Vt.h2,{id:a.titleId,...n,ref:t})});d3.displayName=P2;var C2="DialogDescription",f3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(C2,r);return c.jsx(Vt.p,{id:a.descriptionId,...n,ref:t})});f3.displayName=C2;var A2="DialogClose",h3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(A2,r);return c.jsx(Vt.button,{type:"button",...n,ref:t,onClick:sa(e.onClick,()=>a.onOpenChange(!1))})});h3.displayName=A2;function uy(e){return e?"open":"closed"}var Vl='[cmdk-group=""]',qm='[cmdk-group-items=""]',p3='[cmdk-group-heading=""]',O2='[cmdk-item=""]',pw=`${O2}:not([aria-disabled="true"])`,eg="cmdk-item-select",ns="data-value",m3=(e,t,r)=>OI(e,t,r),_2=y.createContext(void 0),Vu=()=>y.useContext(_2),M2=y.createContext(void 0),cy=()=>y.useContext(M2),I2=y.createContext(void 0),T2=y.forwardRef((e,t)=>{let r=is(()=>{var T,ee;return{search:"",value:(ee=(T=e.value)!=null?T:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=is(()=>new Set),a=is(()=>new Map),o=is(()=>new Map),u=is(()=>new Set),l=D2(e),{label:f,children:h,value:p,onValueChange:v,filter:x,shouldFilter:b,loop:j,disablePointerSelection:k=!1,vimBindings:S=!0,...N}=e,P=oi(),O=oi(),C=oi(),_=y.useRef(null),A=E3();io(()=>{if(p!==void 0){let T=p.trim();r.current.value=T,I.emit()}},[p]),io(()=>{A(6,de)},[]);let I=y.useMemo(()=>({subscribe:T=>(u.current.add(T),()=>u.current.delete(T)),snapshot:()=>r.current,setState:(T,ee,ne)=>{var te,ue,pe,Ae;if(!Object.is(r.current[T],ee)){if(r.current[T]=ee,T==="search")R(),V(),A(1,q);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(C);J?J.focus():(te=document.getElementById(P))==null||te.focus()}if(A(7,()=>{var J;r.current.selectedItemId=(J=Z())==null?void 0:J.id,I.emit()}),ne||A(5,de),((ue=l.current)==null?void 0:ue.value)!==void 0){let J=ee??"";(Ae=(pe=l.current).onValueChange)==null||Ae.call(pe,J);return}}I.emit()}},emit:()=>{u.current.forEach(T=>T())}}),[]),U=y.useMemo(()=>({value:(T,ee,ne)=>{var te;ee!==((te=o.current.get(T))==null?void 0:te.value)&&(o.current.set(T,{value:ee,keywords:ne}),r.current.filtered.items.set(T,B(ee,ne)),A(2,()=>{V(),I.emit()}))},item:(T,ee)=>(n.current.add(T),ee&&(a.current.has(ee)?a.current.get(ee).add(T):a.current.set(ee,new Set([T]))),A(3,()=>{R(),V(),r.current.value||q(),I.emit()}),()=>{o.current.delete(T),n.current.delete(T),r.current.filtered.items.delete(T);let ne=Z();A(4,()=>{R(),(ne==null?void 0:ne.getAttribute("id"))===T&&q(),I.emit()})}),group:T=>(a.current.has(T)||a.current.set(T,new Set),()=>{o.current.delete(T),a.current.delete(T)}),filter:()=>l.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:P,inputId:C,labelId:O,listInnerRef:_}),[]);function B(T,ee){var ne,te;let ue=(te=(ne=l.current)==null?void 0:ne.filter)!=null?te:m3;return T?ue(T,r.current.search,ee):0}function V(){if(!r.current.search||l.current.shouldFilter===!1)return;let T=r.current.filtered.items,ee=[];r.current.filtered.groups.forEach(te=>{let ue=a.current.get(te),pe=0;ue.forEach(Ae=>{let J=T.get(Ae);pe=Math.max(J,pe)}),ee.push([te,pe])});let ne=_.current;ge().sort((te,ue)=>{var pe,Ae;let J=te.getAttribute("id"),ke=ue.getAttribute("id");return((pe=T.get(ke))!=null?pe:0)-((Ae=T.get(J))!=null?Ae:0)}).forEach(te=>{let ue=te.closest(qm);ue?ue.appendChild(te.parentElement===ue?te:te.closest(`${qm} > *`)):ne.appendChild(te.parentElement===ne?te:te.closest(`${qm} > *`))}),ee.sort((te,ue)=>ue[1]-te[1]).forEach(te=>{var ue;let pe=(ue=_.current)==null?void 0:ue.querySelector(`${Vl}[${ns}="${encodeURIComponent(te[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function q(){let T=ge().find(ne=>ne.getAttribute("aria-disabled")!=="true"),ee=T==null?void 0:T.getAttribute(ns);I.setState("value",ee||void 0)}function R(){var T,ee,ne,te;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ue=0;for(let pe of n.current){let Ae=(ee=(T=o.current.get(pe))==null?void 0:T.value)!=null?ee:"",J=(te=(ne=o.current.get(pe))==null?void 0:ne.keywords)!=null?te:[],ke=B(Ae,J);r.current.filtered.items.set(pe,ke),ke>0&&ue++}for(let[pe,Ae]of a.current)for(let J of Ae)if(r.current.filtered.items.get(J)>0){r.current.filtered.groups.add(pe);break}r.current.filtered.count=ue}function de(){var T,ee,ne;let te=Z();te&&(((T=te.parentElement)==null?void 0:T.firstChild)===te&&((ne=(ee=te.closest(Vl))==null?void 0:ee.querySelector(p3))==null||ne.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function Z(){var T;return(T=_.current)==null?void 0:T.querySelector(`${O2}[aria-selected="true"]`)}function ge(){var T;return Array.from(((T=_.current)==null?void 0:T.querySelectorAll(pw))||[])}function je(T){let ee=ge()[T];ee&&I.setState("value",ee.getAttribute(ns))}function me(T){var ee;let ne=Z(),te=ge(),ue=te.findIndex(Ae=>Ae===ne),pe=te[ue+T];(ee=l.current)!=null&&ee.loop&&(pe=ue+T<0?te[te.length-1]:ue+T===te.length?te[0]:te[ue+T]),pe&&I.setState("value",pe.getAttribute(ns))}function Q(T){let ee=Z(),ne=ee==null?void 0:ee.closest(Vl),te;for(;ne&&!te;)ne=T>0?S3(ne,Vl):N3(ne,Vl),te=ne==null?void 0:ne.querySelector(pw);te?I.setState("value",te.getAttribute(ns)):me(T)}let oe=()=>je(ge().length-1),X=T=>{T.preventDefault(),T.metaKey?oe():T.altKey?Q(1):me(1)},$=T=>{T.preventDefault(),T.metaKey?je(0):T.altKey?Q(-1):me(-1)};return y.createElement(Vt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:T=>{var ee;(ee=N.onKeyDown)==null||ee.call(N,T);let ne=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||ne))switch(T.key){case"n":case"j":{S&&T.ctrlKey&&X(T);break}case"ArrowDown":{X(T);break}case"p":case"k":{S&&T.ctrlKey&&$(T);break}case"ArrowUp":{$(T);break}case"Home":{T.preventDefault(),je(0);break}case"End":{T.preventDefault(),oe();break}case"Enter":{T.preventDefault();let te=Z();if(te){let ue=new Event(eg);te.dispatchEvent(ue)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:U.inputId,id:U.labelId,style:C3},f),ah(e,T=>y.createElement(M2.Provider,{value:I},y.createElement(_2.Provider,{value:U},T))))}),v3=y.forwardRef((e,t)=>{var r,n;let a=oi(),o=y.useRef(null),u=y.useContext(I2),l=Vu(),f=D2(e),h=(n=(r=f.current)==null?void 0:r.forceMount)!=null?n:u==null?void 0:u.forceMount;io(()=>{if(!h)return l.item(a,u==null?void 0:u.id)},[h]);let p=R2(a,o,[e.value,e.children,o],e.keywords),v=cy(),x=ca(A=>A.value&&A.value===p.current),b=ca(A=>h||l.filter()===!1?!0:A.search?A.filtered.items.get(a)>0:!0);y.useEffect(()=>{let A=o.current;if(!(!A||e.disabled))return A.addEventListener(eg,j),()=>A.removeEventListener(eg,j)},[b,e.onSelect,e.disabled]);function j(){var A,I;k(),(I=(A=f.current).onSelect)==null||I.call(A,p.current)}function k(){v.setState("value",p.current,!0)}if(!b)return null;let{disabled:S,value:N,onSelect:P,forceMount:O,keywords:C,..._}=e;return y.createElement(Vt.div,{ref:As(o,t),..._,id:a,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!x,"data-disabled":!!S,"data-selected":!!x,onPointerMove:S||l.getDisablePointerSelection()?void 0:k,onClick:S?void 0:j},e.children)}),g3=y.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,u=oi(),l=y.useRef(null),f=y.useRef(null),h=oi(),p=Vu(),v=ca(b=>a||p.filter()===!1?!0:b.search?b.filtered.groups.has(u):!0);io(()=>p.group(u),[]),R2(u,l,[e.value,e.heading,f]);let x=y.useMemo(()=>({id:u,forceMount:a}),[a]);return y.createElement(Vt.div,{ref:As(l,t),...o,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&y.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),ah(e,b=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},y.createElement(I2.Provider,{value:x},b))))}),y3=y.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=y.useRef(null),o=ca(u=>!u.search);return!r&&!o?null:y.createElement(Vt.div,{ref:As(a,t),...n,"cmdk-separator":"",role:"separator"})}),x3=y.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=e.value!=null,o=cy(),u=ca(h=>h.search),l=ca(h=>h.selectedItemId),f=Vu();return y.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),y.createElement(Vt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":l,id:f.inputId,type:"text",value:a?e.value:u,onChange:h=>{a||o.setState("search",h.target.value),r==null||r(h.target.value)}})}),b3=y.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=y.useRef(null),u=y.useRef(null),l=ca(h=>h.selectedItemId),f=Vu();return y.useEffect(()=>{if(u.current&&o.current){let h=u.current,p=o.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let b=h.offsetHeight;p.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(v),x.unobserve(h)}}},[]),y.createElement(Vt.div,{ref:As(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:f.listId},ah(e,h=>y.createElement("div",{ref:As(u,f.listInnerRef),"cmdk-list-sizer":""},h)))}),w3=y.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:u,...l}=e;return y.createElement(b2,{open:r,onOpenChange:n},y.createElement(k2,{container:u},y.createElement(S2,{"cmdk-overlay":"",className:a}),y.createElement(N2,{"aria-label":e.label,"cmdk-dialog":"",className:o},y.createElement(T2,{ref:t,...l}))))}),j3=y.forwardRef((e,t)=>ca(r=>r.filtered.count===0)?y.createElement(Vt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),k3=y.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return y.createElement(Vt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ah(e,u=>y.createElement("div",{"aria-hidden":!0},u)))}),qo=Object.assign(T2,{List:b3,Item:v3,Input:x3,Group:g3,Separator:y3,Dialog:w3,Empty:j3,Loading:k3});function S3(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function N3(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function D2(e){let t=y.useRef(e);return io(()=>{t.current=e}),t}var io=typeof window>"u"?y.useEffect:y.useLayoutEffect;function is(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function ca(e){let t=cy(),r=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,r,r)}function R2(e,t,r,n=[]){let a=y.useRef(),o=Vu();return io(()=>{var u;let l=(()=>{var h;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(h=p.current.textContent)==null?void 0:h.trim():a.current}})(),f=n.map(h=>h.trim());o.value(e,l,f),(u=t.current)==null||u.setAttribute(ns,l),a.current=l}),a}var E3=()=>{let[e,t]=y.useState(),r=is(()=>new Map);return io(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,a)=>{r.current.set(n,a),t({})}};function P3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ah({asChild:e,children:t},r){return e&&y.isValidElement(t)?y.cloneElement(P3(t),{ref:t.ref},r(t.props.children)):r(t)}var C3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function A3({onNavigate:e}){const[t,r]=y.useState(!1);return y.useEffect(()=>{const n=a=>{(a.metaKey||a.ctrlKey)&&a.key.toLowerCase()==="k"&&(a.preventDefault(),r(o=>!o))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),c.jsx(qo.Dialog,{open:t,onOpenChange:r,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>r(!1),children:c.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:n=>n.stopPropagation(),children:[c.jsx(qo.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),c.jsxs(qo.List,{className:"max-h-80 overflow-y-auto p-2",children:[c.jsx(qo.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),c.jsx(qo.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Yv.map(n=>c.jsxs(qo.Item,{value:`${n.label} ${n.hint}`,onSelect:()=>{e(n.id),r(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[c.jsx(n.icon,{className:"h-4 w-4 text-primary"}),c.jsx("span",{children:n.label}),c.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:n.hint})]},n.id))})]})]})})}async function De(e,t){var f;const r={"Content-Type":"application/json",...t==null?void 0:t.headers},n=localStorage.getItem("mc_sudo_password"),a=localStorage.getItem("mc_hf_token");n&&(r["X-Sudo-Password"]=n);let o=t==null?void 0:t.body;if((((f=t==null?void 0:t.method)==null?void 0:f.toUpperCase())||"GET")==="POST"){if(typeof o=="string")try{const h=JSON.parse(o);let p=!1;n&&!("sudo_password"in h)&&(h.sudo_password=n,p=!0),a&&!("hf_token"in h)&&(h.hf_token=a,p=!0),p&&(o=JSON.stringify(h))}catch{}else if(!o){const h={};n&&(h.sudo_password=n),a&&(h.hf_token=a),Object.keys(h).length>0&&(o=JSON.stringify(h))}}const l=await fetch(e,{...t,headers:r,body:o});if(!l.ok)throw new Error(`${l.status} ${l.statusText}`);return l.json()}const Et={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],routing:["routing"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:e=>["drafts",e??""],connect:e=>["connect",e??""],memory:(e,t)=>["memory",e??"",t??""]},O3=()=>br({queryKey:Et.health,queryFn:()=>De("/api/health"),refetchInterval:1e4}),oh=(e=5e3)=>br({queryKey:Et.systemStatus,queryFn:()=>De("/api/system/status"),refetchInterval:e}),_3=(e=3e3)=>br({queryKey:Et.services,queryFn:()=>De("/api/system/services"),refetchInterval:e}),vo=(e=4e3)=>br({queryKey:Et.models,queryFn:()=>De("/api/models"),refetchInterval:e}),M3=(e=4e3)=>br({queryKey:Et.routing,queryFn:()=>De("/api/routing"),refetchInterval:e}),I3=(e=2e3)=>br({queryKey:Et.jobs,queryFn:()=>De("/api/jobs"),refetchInterval:e,select:t=>t.jobs??[]}),dy=(e=3e3)=>br({queryKey:Et.tokenStats,queryFn:()=>De("/api/system/token-stats"),refetchInterval:e}),fy=(e=5e3)=>br({queryKey:Et.agentStatus,queryFn:()=>De("/api/agent/status"),refetchInterval:e}),T3=(e=6e4)=>br({queryKey:Et.hermesBrain,queryFn:()=>De("/api/agent/brain"),refetchInterval:e}),hy=e=>br({queryKey:Et.updates,queryFn:()=>De("/api/maintenance/updates"),refetchInterval:e}),D3=()=>br({queryKey:Et.discover,queryFn:()=>De("/api/discover")}),R3=e=>br({queryKey:Et.drafts(e),queryFn:()=>De(`/api/models/drafts?target=${encodeURIComponent(e??"")}`),enabled:!!e}),$2=e=>br({queryKey:Et.connect(e),queryFn:()=>De(e?`/api/connect?${e}`:"/api/connect")}),L2=e=>br({queryKey:Et.memory(e==null?void 0:e.q,e==null?void 0:e.category),queryFn:()=>{const t=new URLSearchParams;return e!=null&&e.q&&t.set("q",e.q),e!=null&&e.category&&t.set("category",e.category),De(`/api/memory?${t}`)},select:t=>e!=null&&e.limit?t.slice(0,e.limit):t});function Qo(e){return(e/1024**3).toFixed(1)}function tg(e){return e?e>1024**3?`${(e/1024**3).toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`:""}function Br(e){if(!e)return"—";const t=e/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`}function $3(e){if(!e)return"";const t=Math.floor(e/60);return t>0?`${t} min`:`${e} s`}function mw(e){return e?`${Math.round(e/1024)}k`:"—"}function z2(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=F3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{const l=u.split(py);return l[0]===""&&l.length!==1&&l.shift(),F2(l,t)||z3(u)},getConflictingClassGroupIds:(u,l)=>{const f=r[u]||[];return l&&n[u]?[...f,...n[u]]:f}}},F2=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?F2(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const o=e.join(py);return(u=t.validators.find(({validator:l})=>l(o)))==null?void 0:u.classGroupId},vw=/^\[(.+)\]$/,z3=e=>{if(vw.test(e)){const t=vw.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},F3=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return U3(Object.entries(e.classGroups),r).forEach(([o,u])=>{rg(u,n,o,t)}),n},rg=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const o=a===""?t:gw(t,a);o.classGroupId=r;return}if(typeof a=="function"){if(B3(a)){rg(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([o,u])=>{rg(u,gw(t,o),r,n)})})},gw=(e,t)=>{let r=e;return t.split(py).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},B3=e=>e.isThemeGetter,U3=(e,t)=>t?e.map(([r,n])=>{const a=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([u,l])=>[t+u,l])):o);return[r,a]}):e,W3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(o,u)=>{r.set(o,u),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let u=r.get(o);if(u!==void 0)return u;if((u=n.get(o))!==void 0)return a(o,u),u},set(o,u){r.has(o)?r.set(o,u):a(o,u)}}},B2="!",H3=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],o=t.length,u=l=>{const f=[];let h=0,p=0,v;for(let S=0;Sp?v-p:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:j,maybePostfixModifierPosition:k}};return r?l=>r({className:l,parseClassName:u}):u},K3=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},V3=e=>({cache:W3(e.cacheSize),parseClassName:H3(e),...L3(e)}),G3=/\s+/,q3=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,o=[],u=e.trim().split(G3);let l="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{modifiers:p,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:b}=r(h);let j=!!b,k=n(j?x.substring(0,b):x);if(!k){if(!j){l=h+(l.length>0?" "+l:l);continue}if(k=n(x),!k){l=h+(l.length>0?" "+l:l);continue}j=!1}const S=K3(p).join(":"),N=v?S+B2:S,P=N+k;if(o.includes(P))continue;o.push(P);const O=a(k,j);for(let C=0;C0?" "+l:l)}return l};function Q3(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nv(p),e());return r=V3(h),n=r.cache.get,a=r.cache.set,o=l,l(f)}function l(f){const h=n(f);if(h)return h;const p=q3(f,r);return a(f,p),p}return function(){return o(Q3.apply(null,arguments))}}const it=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},W2=/^\[(?:([a-z-]+):)?(.+)\]$/i,X3=/^\d+\/\d+$/,Z3=new Set(["px","full","screen"]),J3=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,e4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,t4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,r4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,n4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xn=e=>cs(e)||Z3.has(e)||X3.test(e),Ui=e=>Bs(e,"length",d4),cs=e=>!!e&&!Number.isNaN(Number(e)),Qm=e=>Bs(e,"number",cs),Gl=e=>!!e&&Number.isInteger(Number(e)),i4=e=>e.endsWith("%")&&cs(e.slice(0,-1)),$e=e=>W2.test(e),Wi=e=>J3.test(e),a4=new Set(["length","size","percentage"]),o4=e=>Bs(e,a4,H2),s4=e=>Bs(e,"position",H2),l4=new Set(["image","url"]),u4=e=>Bs(e,l4,h4),c4=e=>Bs(e,"",f4),ql=()=>!0,Bs=(e,t,r)=>{const n=W2.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},d4=e=>e4.test(e)&&!t4.test(e),H2=()=>!1,f4=e=>r4.test(e),h4=e=>n4.test(e),p4=()=>{const e=it("colors"),t=it("spacing"),r=it("blur"),n=it("brightness"),a=it("borderColor"),o=it("borderRadius"),u=it("borderSpacing"),l=it("borderWidth"),f=it("contrast"),h=it("grayscale"),p=it("hueRotate"),v=it("invert"),x=it("gap"),b=it("gradientColorStops"),j=it("gradientColorStopPositions"),k=it("inset"),S=it("margin"),N=it("opacity"),P=it("padding"),O=it("saturate"),C=it("scale"),_=it("sepia"),A=it("skew"),I=it("space"),U=it("translate"),B=()=>["auto","contain","none"],V=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",$e,t],R=()=>[$e,t],de=()=>["",Xn,Ui],Z=()=>["auto",cs,$e],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],je=()=>["solid","dashed","dotted","double","none"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],oe=()=>["","0",$e],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>[cs,$e];return{cacheSize:500,separator:":",theme:{colors:[ql],spacing:[Xn,Ui],blur:["none","",Wi,$e],brightness:$(),borderColor:[e],borderRadius:["none","","full",Wi,$e],borderSpacing:R(),borderWidth:de(),contrast:$(),grayscale:oe(),hueRotate:$(),invert:oe(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[i4,Ui],inset:q(),margin:q(),opacity:$(),padding:R(),saturate:$(),scale:$(),sepia:oe(),skew:$(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Wi]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ge(),$e]}],overflow:[{overflow:V()}],"overflow-x":[{"overflow-x":V()}],"overflow-y":[{"overflow-y":V()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[k]}],"inset-x":[{"inset-x":[k]}],"inset-y":[{"inset-y":[k]}],start:[{start:[k]}],end:[{end:[k]}],top:[{top:[k]}],right:[{right:[k]}],bottom:[{bottom:[k]}],left:[{left:[k]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Gl,$e]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:oe()}],shrink:[{shrink:oe()}],order:[{order:["first","last","none",Gl,$e]}],"grid-cols":[{"grid-cols":[ql]}],"col-start-end":[{col:["auto",{span:["full",Gl,$e]},$e]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[ql]}],"row-start-end":[{row:["auto",{span:[Gl,$e]},$e]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Wi]},Wi]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Wi,Ui]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qm]}],"font-family":[{font:[ql]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",cs,Qm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xn,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...je(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xn,Ui]}],"underline-offset":[{"underline-offset":["auto",Xn,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),s4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",o4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},u4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[j]}],"gradient-via-pos":[{via:[j]}],"gradient-to-pos":[{to:[j]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...je(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:je()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...je()]}],"outline-offset":[{"outline-offset":[Xn,$e]}],"outline-w":[{outline:[Xn,Ui]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Xn,Ui]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wi,c4]}],"shadow-color":[{shadow:[ql]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":me()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Wi,$e]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[v]}],saturate:[{saturate:[O]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[O]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:$()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:$()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[Gl,$e]}],"translate-x":[{"translate-x":[U]}],"translate-y":[{"translate-y":[U]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xn,Ui,Qm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},m4=Y3(p4);function he(...e){return m4(et(e))}function _s(e){return e?e.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}const K2=["fast","heavy","coder","vision","scout"],v4={fast:"bg-cyan-500/15 text-cyan-400 border-cyan-500/25",heavy:"bg-amber-500/15 text-amber-400 border-amber-500/25",coder:"bg-violet-500/15 text-violet-400 border-violet-500/25",vision:"bg-pink-500/15 text-pink-400 border-pink-500/25",scout:"bg-teal-500/15 text-teal-400 border-teal-500/25",hermes:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25"},my=e=>e&&v4[e]||"bg-slate-500/15 text-slate-300 border-slate-500/25";function g4({fit:e}){const t={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[e.level];return c.jsxs("span",{className:he("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",t),children:[e.text," • ",e.req_gb," GB RAM"]})}function yw(e){const t=e.toLowerCase();return t.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:t.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:t.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:t.includes("mistral")||t.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:t.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:t.includes("hermes")||t.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:t.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function y4(){const{data:e}=vo(2e3),{data:t}=dy(2e3),r=(e==null?void 0:e.models)??[],n=(e==null?void 0:e.running)??[],a=r.filter(f=>n.includes(f.name)),o=y.useRef(null),[u,l]=y.useState(!1);return y.useEffect(()=>{if(!t)return;const f=t.total_tokens;if(o.current!==null&&f>o.current){l(!0);const h=setTimeout(()=>l(!1),4e3);return o.current=f,()=>clearTimeout(h)}o.current=f},[t==null?void 0:t.total_tokens]),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Modelle (Live)"})]}),c.jsxs("span",{className:he("flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider font-mono px-2 py-0.5 rounded-full border transition-colors",u?"bg-emerald-500/10 text-emerald-400 border-emerald-500/30":"bg-background/30 text-muted-foreground/70 border-border/40"),children:[u?c.jsx(ls,{className:"h-3 w-3 animate-pulse"}):c.jsx(hI,{className:"h-3 w-3"}),u?"Inferenz aktiv":"Idle"]})]}),a.length===0?c.jsx("div",{className:"flex items-center justify-center gap-2 h-20 text-xs text-muted-foreground/70 italic",children:"Kein Modell geladen — Auto-Swap lädt bei Anfrage."}):c.jsx("div",{className:"grid gap-2",children:a.map(f=>{var h;return c.jsxs("div",{className:"flex items-center justify-between gap-2 p-3 rounded-xl bg-emerald-500/5 border border-emerald-500/20",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[f.role&&c.jsx("span",{className:he("text-[8px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",my(f.role)),children:f.role}),c.jsx("span",{className:"text-xs font-semibold font-mono text-foreground truncate",children:(h=f.name.split("/").pop())==null?void 0:h.replace(/\.gguf$/i,"")})]}),c.jsxs("div",{className:"text-[9px] font-mono text-muted-foreground/70 mt-0.5",children:[Br(f.size_bytes)," im Unified-RAM"]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono shrink-0",children:[c.jsx("span",{className:he("h-1.5 w-1.5 rounded-full bg-emerald-500",u&&"animate-pulse")})," warm"]})]},f.name)})})]})}let ng=[],ig=[];const ag=new Set,V2=()=>ag.forEach(e=>e());function G2(e){return ag.add(e),()=>{ag.delete(e)}}function x4(e){ng=[...ng,e].slice(-40),V2()}function b4(e){ig=[...ig,e].slice(-40),V2()}const w4=()=>y.useSyncExternalStore(G2,()=>ng),j4=()=>y.useSyncExternalStore(G2,()=>ig);function k4(){const{data:e,dataUpdatedAt:t}=oh(3e3),{data:r,dataUpdatedAt:n}=dy(3e3),a=y.useRef(null);y.useEffect(()=>{var o,u,l,f;e&&x4({t:Date.now(),cpu:((o=e.cpu)==null?void 0:o.percent)??0,ram:((u=e.ram)==null?void 0:u.percent)??0,gpu:((l=e.gpu)==null?void 0:l.busy_percent)??null,disk:((f=e.disk)==null?void 0:f.percent)??null})},[t]),y.useEffect(()=>{if(!r)return;const o=Date.now(),u=r.prompt_tokens,l=r.completion_tokens;if(a.current){const f=Math.max((o-a.current.t)/1e3,.001);b4({t:o,prompt:Math.max(0,(u-a.current.p)/f),completion:Math.max(0,(l-a.current.c)/f)})}a.current={p:u,c:l,t:o}},[n])}function S4(){const{data:e,error:t}=oh(3e3),r=w4();return{sys:e,hist:r,error:t}}var N4=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function vy(e){if(typeof e!="string")return!1;var t=N4;return t.includes(e)}var E4=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],P4=new Set(E4);function q2(e){return typeof e!="string"?!1:P4.has(e)}function Q2(e){return typeof e=="string"&&e.startsWith("data-")}function dn(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(q2(r)||Q2(r))&&(t[r]=e[r]);return t}function sh(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return dn(t)}return typeof e=="object"&&!Array.isArray(e)?dn(e):null}function Vr(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(q2(r)||Q2(r)||vy(r))&&(t[r]=e[r]);return t}function C4(e){return e==null?null:y.isValidElement(e)?Vr(e.props):typeof e=="object"&&!Array.isArray(e)?Vr(e):null}var A4=["children","width","height","viewBox","className","style","title","desc"];function og(){return og=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,a=e.height,o=e.viewBox,u=e.className,l=e.style,f=e.title,h=e.desc,p=O4(e,A4),v=o||{width:n,height:a,x:0,y:0},x=et("recharts-surface",u);return y.createElement("svg",og({},Vr(p),{className:x,width:n,height:a,style:l,viewBox:"".concat(v.x," ").concat(v.y," ").concat(v.width," ").concat(v.height),ref:t}),y.createElement("title",null,f),y.createElement("desc",null,h),r)}),M4=["children","className"];function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,a=I4(e,M4),o=et("recharts-layer",n);return y.createElement("g",sg({className:o},Vr(a),{ref:t}),r)}),D4=y.createContext(null);function pt(e){return function(){return e}}const lg=Math.PI,ug=2*lg,Ra=1e-6,R4=ug-Ra;function X2(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return X2;const r=10**t;return function(n){this._+=n[0];for(let a=1,o=n.length;aRa)if(!(Math.abs(v*f-h*p)>Ra)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let b=n-u,j=a-l,k=f*f+h*h,S=b*b+j*j,N=Math.sqrt(k),P=Math.sqrt(x),O=o*Math.tan((lg-Math.acos((k+x-S)/(2*N*P)))/2),C=O/P,_=O/N;Math.abs(C-1)>Ra&&this._append`L${t+C*p},${r+C*v}`,this._append`A${o},${o},0,0,${+(v*b>p*j)},${this._x1=t+_*f},${this._y1=r+_*h}`}}arc(t,r,n,a,o,u){if(t=+t,r=+r,n=+n,u=!!u,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),f=n*Math.sin(a),h=t+l,p=r+f,v=1^u,x=u?a-o:o-a;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Ra||Math.abs(this._y1-p)>Ra)&&this._append`L${h},${p}`,n&&(x<0&&(x=x%ug+ug),x>R4?this._append`A${n},${n},0,1,${v},${t-l},${r-f}A${n},${n},0,1,${v},${this._x1=h},${this._y1=p}`:x>Ra&&this._append`A${n},${n},0,${+(x>=lg)},${v},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function Z2(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new L4(t)}function gy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function J2(e){this._context=e}J2.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 lh(e){return new J2(e)}function eE(e){return e[0]}function tE(e){return e[1]}function rE(e,t){var r=pt(!0),n=null,a=lh,o=null,u=Z2(l);e=typeof e=="function"?e:e===void 0?eE:pt(e),t=typeof t=="function"?t:t===void 0?tE:pt(t);function l(f){var h,p=(f=gy(f)).length,v,x=!1,b;for(n==null&&(o=a(b=u())),h=0;h<=p;++h)!(h=b;--j)l.point(O[j],C[j]);l.lineEnd(),l.areaEnd()}N&&(O[x]=+e(S,x,v),C[x]=+t(S,x,v),l.point(n?+n(S,x,v):O[x],r?+r(S,x,v):C[x]))}if(P)return l=null,P+""||null}function p(){return rE().defined(a).curve(u).context(o)}return h.x=function(v){return arguments.length?(e=typeof v=="function"?v:pt(+v),n=null,h):e},h.x0=function(v){return arguments.length?(e=typeof v=="function"?v:pt(+v),h):e},h.x1=function(v){return arguments.length?(n=v==null?null:typeof v=="function"?v:pt(+v),h):n},h.y=function(v){return arguments.length?(t=typeof v=="function"?v:pt(+v),r=null,h):t},h.y0=function(v){return arguments.length?(t=typeof v=="function"?v:pt(+v),h):t},h.y1=function(v){return arguments.length?(r=v==null?null:typeof v=="function"?v:pt(+v),h):r},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(r)},h.lineX1=function(){return p().x(n).y(t)},h.defined=function(v){return arguments.length?(a=typeof v=="function"?v:pt(!!v),h):a},h.curve=function(v){return arguments.length?(u=v,o!=null&&(l=u(o)),h):u},h.context=function(v){return arguments.length?(v==null?o=l=null:l=u(o=v),h):o},h}class nE{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function z4(e){return new nE(e,!0)}function F4(e){return new nE(e,!1)}function of(){}function sf(e,t,r){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+r)/6)}function iE(e){this._context=e}iE.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:sf(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:sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function B4(e){return new iE(e)}function aE(e){this._context=e}aE.prototype={areaStart:of,areaEnd:of,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:sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function U4(e){return new aE(e)}function oE(e){this._context=e}oE.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function W4(e){return new oE(e)}function sE(e){this._context=e}sE.prototype={areaStart:of,areaEnd:of,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 H4(e){return new sE(e)}function xw(e){return e<0?-1:1}function bw(e,t,r){var n=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(n||a<0&&-0),u=(r-e._y1)/(a||n<0&&-0),l=(o*a+u*n)/(n+a);return(xw(o)+xw(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(l))||0}function ww(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ym(e,t,r){var n=e._x0,a=e._y0,o=e._x1,u=e._y1,l=(o-n)/3;e._context.bezierCurveTo(n+l,a+l*t,o-l,u-l*r,o,u)}function lf(e){this._context=e}lf.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:Ym(this,this._t0,ww(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 r=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,Ym(this,ww(this,r=bw(this,e,t)),r);break;default:Ym(this,this._t0,r=bw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function lE(e){this._context=new uE(e)}(lE.prototype=Object.create(lf.prototype)).point=function(e,t){lf.prototype.point.call(this,t,e)};function uE(e){this._context=e}uE.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,r,n,a,o){this._context.bezierCurveTo(t,e,n,r,o,a)}};function K4(e){return new lf(e)}function V4(e){return new lE(e)}function cE(e){this._context=e}cE.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=jw(e),a=jw(t),o=0,u=1;u=0;--t)a[t]=(u[t]-a[t+1])/o[t];for(o[r-1]=(e[r]+a[r-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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function q4(e){return new uh(e,.5)}function Q4(e){return new uh(e,0)}function Y4(e){return new uh(e,1)}function ao(e,t){if((u=e.length)>1)for(var r=1,n,a,o=e[t[0]],u,l=o.length;r=0;)r[t]=t;return r}function X4(e,t){return e[t]}function Z4(e){const t=[];return t.key=e,t}function J4(){var e=pt([]),t=cg,r=ao,n=X4;function a(o){var u=Array.from(e.apply(this,arguments),Z4),l,f=u.length,h=-1,p;for(const v of o)for(l=0,++h;l0){for(var r,n,a=0,o=e[0].length,u;a0){for(var r=0,n=e[t[0]],a,o=n.length;r0)||!((o=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,o,u;n1&&arguments[1]!==void 0?arguments[1]:iD,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Bt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var l=r[u-1];return typeof l=="string"?a+l+o:l!==void 0?a+ia(l)+o:a+o},"")}var Wr=e=>e===0?0:e>0?1:-1,Tn=e=>typeof e=="number"&&e!=+e,oo=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ne=e=>(typeof e=="number"||e instanceof Number)&&!Tn(e),Dn=e=>Ne(e)||typeof e=="string",aD=0,Su=e=>{var t=++aD;return"".concat(e||"").concat(t)},da=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ne(t)&&typeof t!="string")return n;var o;if(oo(t)){if(r==null)return n;var u=t.indexOf("%");o=r*parseFloat(t.slice(0,u))/100}else o=+t;return Tn(o)&&(o=n),a&&r!=null&&o>r&&(o=r),o},hE=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):go(n,t))===r)}var Kt=e=>e===null||typeof e>"u",by=e=>Kt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function yr(e){return e!=null}function Us(){}var mE=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,wy=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(y.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(a=>{vy(a)&&typeof r[a]=="function"&&(n[a]=(o=>r[a](r,o)))}),n},oD=(e,t,r)=>n=>(e(t,r,n),null),sD=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(a=>{var o=e[a];vy(a)&&typeof o=="function"&&(n||(n={}),n[a]=oD(o,t,r))}),n};function kw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function lD(e){for(var t=1;t(u[l]===void 0&&n[l]!==void 0&&(u[l]=n[l]),u),r);return o}function fD(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function jy(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const gD="[object RegExp]",gE="[object String]",yE="[object Number]",xE="[object Boolean]",bE="[object Arguments]",yD="[object Symbol]",xD="[object Date]",bD="[object Map]",wD="[object Set]",jD="[object Array]",kD="[object ArrayBuffer]",SD="[object Object]",ND="[object DataView]",ED="[object Uint8Array]",PD="[object Uint8ClampedArray]",CD="[object Uint16Array]",AD="[object Uint32Array]",OD="[object Int8Array]",_D="[object Int16Array]",MD="[object Int32Array]",ID="[object Float32Array]",TD="[object Float64Array]",Sw=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function DD(e){return typeof Sw.Buffer<"u"&&Sw.Buffer.isBuffer(e)}function RD(e,t){return Fa(e,void 0,e,new Map,t)}function Fa(e,t,r,n=new Map,a=void 0){const o=a==null?void 0:a(e,t,r,n);if(o!==void 0)return o;if(fg(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const u=new Array(e.length);n.set(e,u);for(let l=0;l{}):hg(e,t,function n(a,o,u,l,f,h){const p=r(a,o,u,l,f,h);return p!==void 0?!!p:hg(a,o,n,h,!1)},new Map,!0)}function hg(e,t,r,n,a=!1){if(t===e)return!0;switch(typeof t){case"object":return zD(e,t,r,n);case"function":return Object.keys(t).length>0?hg(e,{...t},r,n,a):Qd(e,t);default:return wE(e)&&a?typeof t=="string"?t==="":!0:Qd(e,t)}}function zD(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return kE(e,t,r,n);if(t instanceof Map)return FD(e,t,r,n);if(t instanceof Set)return BD(e,t,r,n);const a=Object.keys(t);if(e==null||fg(e))return a.length===0;if(a.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o{})}function UD(e){return e=LD(e),t=>SE(t,e)}function WD(e,t){return RD(e,(r,n,a,o)=>{if(typeof e=="object"){if(jy(e)==="[object Object]"&&typeof e.constructor!="function"){const u={};return o.set(e,u),on(u,e,a,o),u}switch(Object.prototype.toString.call(e)){case yE:case gE:case xE:{const u=new e.constructor(e==null?void 0:e.valueOf());return on(u,e),u}case bE:{const u={};return on(u,e),u.length=e.length,u[Symbol.iterator]=e[Symbol.iterator],u}default:return}}})}function HD(e){return WD(e)}const KD=/^(?:0|[1-9]\d*)$/;function NE(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function EE(e){return e!=null&&typeof e!="function"&&YD(e.length)}function XD(e){return typeof e=="object"&&e!==null}function ZD(e){return XD(e)&&EE(e)}function Nw(e,t=vE){return ZD(e)?fD(Array.from(e),hD(QD(t),1)):[]}function JD(e,t,r){return t===!0?Nw(e,r):typeof t=="function"?Nw(e,t):e}var Xm={exports:{}},Zm={},Jm={exports:{}},ev={};/** +`)},JT=0,Go=[];function e3(e){var t=y.useRef([]),r=y.useRef([0,0]),n=y.useRef(),a=y.useState(JT++)[0],o=y.useState(p2)[0],u=y.useRef(e);y.useEffect(function(){u.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=wT([e.lockRef.current],(e.shards||[]).map(hw),!0).filter(Boolean);return j.forEach(function(S){return S.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var l=y.useCallback(function(j,S){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!u.current.allowPinchZoom;var N=Ed(j),P=r.current,O="deltaX"in j?j.deltaX:P[0]-N[0],C="deltaY"in j?j.deltaY:P[1]-N[1],_,A=j.target,I=Math.abs(O)>Math.abs(C)?"h":"v";if("touches"in j&&I==="h"&&A.type==="range")return!1;var $=window.getSelection(),B=$&&$.anchorNode,K=B?B===A||B.contains(A):!1;if(K)return!1;var q=dw(I,A);if(!q)return!0;if(q?_=I:(_=I==="v"?"h":"v",q=dw(I,A)),!q)return!1;if(!n.current&&"changedTouches"in j&&(O||C)&&(n.current=_),!_)return!0;var R=n.current||_;return YT(R,S,j,R==="h"?O:C)},[]),f=y.useCallback(function(j){var S=j;if(!(!Go.length||Go[Go.length-1]!==o)){var N="deltaY"in S?fw(S):Ed(S),P=t.current.filter(function(_){return _.name===S.type&&(_.target===S.target||S.target===_.shadowParent)&&XT(_.delta,N)})[0];if(P&&P.should){S.cancelable&&S.preventDefault();return}if(!P){var O=(u.current.shards||[]).map(hw).filter(Boolean).filter(function(_){return _.contains(S.target)}),C=O.length>0?l(S,O[0]):!u.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),h=y.useCallback(function(j,S,N,P){var O={name:j,delta:S,target:N,should:P,shadowParent:t3(N)};t.current.push(O),setTimeout(function(){t.current=t.current.filter(function(C){return C!==O})},1)},[]),p=y.useCallback(function(j){r.current=Ed(j),n.current=void 0},[]),v=y.useCallback(function(j){h(j.type,fw(j),j.target,l(j,e.lockRef.current))},[]),x=y.useCallback(function(j){h(j.type,Ed(j),j.target,l(j,e.lockRef.current))},[]);y.useEffect(function(){return Go.push(o),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Ko),document.addEventListener("touchmove",f,Ko),document.addEventListener("touchstart",p,Ko),function(){Go=Go.filter(function(j){return j!==o}),document.removeEventListener("wheel",f,Ko),document.removeEventListener("touchmove",f,Ko),document.removeEventListener("touchstart",p,Ko)}},[]);var b=e.removeScrollBar,k=e.inert;return y.createElement(y.Fragment,null,k?y.createElement(o,{styles:ZT(a)}):null,b?y.createElement(WT,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function t3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const r3=OT(h2,e3);var y2=y.forwardRef(function(e,t){return y.createElement(nh,Pn({},e,{ref:t,sideCar:r3}))});y2.classNames=nh.classNames;var n3=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vo=new WeakMap,Pd=new WeakMap,Cd={},Vm=0,x2=function(e){return e&&(e.host||x2(e.parentNode))},i3=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=x2(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},a3=function(e,t,r,n){var a=i3(t,Array.isArray(e)?e:[e]);Cd[r]||(Cd[r]=new WeakMap);var o=Cd[r],u=[],l=new Set,f=new Set(a),h=function(v){!v||l.has(v)||(l.add(v),h(v.parentNode))};a.forEach(h);var p=function(v){!v||f.has(v)||Array.prototype.forEach.call(v.children,function(x){if(l.has(x))p(x);else try{var b=x.getAttribute(n),k=b!==null&&b!=="false",j=(Vo.get(x)||0)+1,S=(o.get(x)||0)+1;Vo.set(x,j),o.set(x,S),u.push(x),j===1&&k&&Pd.set(x,!0),S===1&&x.setAttribute(r,"true"),k||x.setAttribute(n,"true")}catch(N){console.error("aria-hidden: cannot operate on ",x,N)}})};return p(t),l.clear(),Vm++,function(){u.forEach(function(v){var x=Vo.get(v)-1,b=o.get(v)-1;Vo.set(v,x),o.set(v,b),x||(Pd.has(v)||v.removeAttribute(n),Pd.delete(v)),b||v.removeAttribute(r)}),Vm--,Vm||(Vo=new WeakMap,Vo=new WeakMap,Pd=new WeakMap,Cd={})}},o3=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=n3(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),a3(n,a,r,"aria-hidden")):function(){return null}},ih="Dialog",[b2]=TI(ih),[s3,hn]=b2(ih),w2=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:o,modal:u=!0}=e,l=y.useRef(null),f=y.useRef(null),[h,p]=zI({prop:n,defaultProp:a??!1,onChange:o,caller:ih});return c.jsx(s3,{scope:t,triggerRef:l,contentRef:f,contentId:oi(),titleId:oi(),descriptionId:oi(),open:h,onOpenChange:p,onOpenToggle:y.useCallback(()=>p(v=>!v),[p]),modal:u,children:r})};w2.displayName=ih;var k2="DialogTrigger",l3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(k2,r),o=mo(t,a.triggerRef);return c.jsx(Gt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":uy(a.open),...n,ref:o,onClick:sa(e.onClick,a.onOpenToggle)})});l3.displayName=k2;var ly="DialogPortal",[u3,j2]=b2(ly,{forceMount:void 0}),S2=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,o=hn(ly,t);return c.jsx(u3,{scope:t,forceMount:r,children:y.Children.map(n,u=>c.jsx(rh,{present:r||o.open,children:c.jsx(c2,{asChild:!0,container:a,children:u})}))})};S2.displayName=ly;var af="DialogOverlay",N2=y.forwardRef((e,t)=>{const r=j2(af,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=hn(af,e.__scopeDialog);return o.modal?c.jsx(rh,{present:n||o.open,children:c.jsx(d3,{...a,ref:t})}):null});N2.displayName=af;var c3=a2("DialogOverlay.RemoveScroll"),d3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(af,r),o=aT(),u=mo(t,o);return c.jsx(y2,{as:c3,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(Gt.div,{"data-state":uy(a.open),...n,ref:u,style:{pointerEvents:"auto",...n.style}})})}),Os="DialogContent",E2=y.forwardRef((e,t)=>{const r=j2(Os,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,o=hn(Os,e.__scopeDialog);return c.jsx(rh,{present:n||o.open,children:o.modal?c.jsx(f3,{...a,ref:t}):c.jsx(h3,{...a,ref:t})})});E2.displayName=Os;var f3=y.forwardRef((e,t)=>{const r=hn(Os,e.__scopeDialog),n=y.useRef(null),a=mo(t,r.contentRef,n);return y.useEffect(()=>{const o=n.current;if(o)return o3(o)},[]),c.jsx(P2,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:r.open,onCloseAutoFocus:sa(e.onCloseAutoFocus,o=>{var u;o.preventDefault(),(u=r.triggerRef.current)==null||u.focus()}),onPointerDownOutside:sa(e.onPointerDownOutside,o=>{const u=o.detail.originalEvent,l=u.button===0&&u.ctrlKey===!0;(u.button===2||l)&&o.preventDefault()}),onFocusOutside:sa(e.onFocusOutside,o=>o.preventDefault())})}),h3=y.forwardRef((e,t)=>{const r=hn(Os,e.__scopeDialog),n=y.useRef(!1),a=y.useRef(!1);return c.jsx(P2,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var u,l;(u=e.onCloseAutoFocus)==null||u.call(e,o),o.defaultPrevented||(n.current||(l=r.triggerRef.current)==null||l.focus(),o.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:o=>{var f,h;(f=e.onInteractOutside)==null||f.call(e,o),o.defaultPrevented||(n.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const u=o.target;((h=r.triggerRef.current)==null?void 0:h.contains(u))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),P2=y.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:o,...u}=e,l=hn(Os,r);return bT(),c.jsx(c.Fragment,{children:c.jsx(l2,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:o,children:c.jsx(o2,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":uy(l.open),...u,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1)})})})}),C2="DialogTitle",p3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(C2,r);return c.jsx(Gt.h2,{id:a.titleId,...n,ref:t})});p3.displayName=C2;var A2="DialogDescription",m3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(A2,r);return c.jsx(Gt.p,{id:a.descriptionId,...n,ref:t})});m3.displayName=A2;var O2="DialogClose",v3=y.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=hn(O2,r);return c.jsx(Gt.button,{type:"button",...n,ref:t,onClick:sa(e.onClick,()=>a.onOpenChange(!1))})});v3.displayName=O2;function uy(e){return e?"open":"closed"}var Vl='[cmdk-group=""]',qm='[cmdk-group-items=""]',g3='[cmdk-group-heading=""]',_2='[cmdk-item=""]',pw=`${_2}:not([aria-disabled="true"])`,eg="cmdk-item-select",ns="data-value",y3=(e,t,r)=>II(e,t,r),M2=y.createContext(void 0),Vu=()=>y.useContext(M2),I2=y.createContext(void 0),cy=()=>y.useContext(I2),T2=y.createContext(void 0),D2=y.forwardRef((e,t)=>{let r=is(()=>{var T,ee;return{search:"",value:(ee=(T=e.value)!=null?T:e.defaultValue)!=null?ee:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),n=is(()=>new Set),a=is(()=>new Map),o=is(()=>new Map),u=is(()=>new Set),l=R2(e),{label:f,children:h,value:p,onValueChange:v,filter:x,shouldFilter:b,loop:k,disablePointerSelection:j=!1,vimBindings:S=!0,...N}=e,P=oi(),O=oi(),C=oi(),_=y.useRef(null),A=A3();io(()=>{if(p!==void 0){let T=p.trim();r.current.value=T,I.emit()}},[p]),io(()=>{A(6,de)},[]);let I=y.useMemo(()=>({subscribe:T=>(u.current.add(T),()=>u.current.delete(T)),snapshot:()=>r.current,setState:(T,ee,ne)=>{var te,ue,pe,Oe;if(!Object.is(r.current[T],ee)){if(r.current[T]=ee,T==="search")R(),K(),A(1,q);else if(T==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let J=document.getElementById(C);J?J.focus():(te=document.getElementById(P))==null||te.focus()}if(A(7,()=>{var J;r.current.selectedItemId=(J=Z())==null?void 0:J.id,I.emit()}),ne||A(5,de),((ue=l.current)==null?void 0:ue.value)!==void 0){let J=ee??"";(Oe=(pe=l.current).onValueChange)==null||Oe.call(pe,J);return}}I.emit()}},emit:()=>{u.current.forEach(T=>T())}}),[]),$=y.useMemo(()=>({value:(T,ee,ne)=>{var te;ee!==((te=o.current.get(T))==null?void 0:te.value)&&(o.current.set(T,{value:ee,keywords:ne}),r.current.filtered.items.set(T,B(ee,ne)),A(2,()=>{K(),I.emit()}))},item:(T,ee)=>(n.current.add(T),ee&&(a.current.has(ee)?a.current.get(ee).add(T):a.current.set(ee,new Set([T]))),A(3,()=>{R(),K(),r.current.value||q(),I.emit()}),()=>{o.current.delete(T),n.current.delete(T),r.current.filtered.items.delete(T);let ne=Z();A(4,()=>{R(),(ne==null?void 0:ne.getAttribute("id"))===T&&q(),I.emit()})}),group:T=>(a.current.has(T)||a.current.set(T,new Set),()=>{o.current.delete(T),a.current.delete(T)}),filter:()=>l.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:P,inputId:C,labelId:O,listInnerRef:_}),[]);function B(T,ee){var ne,te;let ue=(te=(ne=l.current)==null?void 0:ne.filter)!=null?te:y3;return T?ue(T,r.current.search,ee):0}function K(){if(!r.current.search||l.current.shouldFilter===!1)return;let T=r.current.filtered.items,ee=[];r.current.filtered.groups.forEach(te=>{let ue=a.current.get(te),pe=0;ue.forEach(Oe=>{let J=T.get(Oe);pe=Math.max(J,pe)}),ee.push([te,pe])});let ne=_.current;ge().sort((te,ue)=>{var pe,Oe;let J=te.getAttribute("id"),je=ue.getAttribute("id");return((pe=T.get(je))!=null?pe:0)-((Oe=T.get(J))!=null?Oe:0)}).forEach(te=>{let ue=te.closest(qm);ue?ue.appendChild(te.parentElement===ue?te:te.closest(`${qm} > *`)):ne.appendChild(te.parentElement===ne?te:te.closest(`${qm} > *`))}),ee.sort((te,ue)=>ue[1]-te[1]).forEach(te=>{var ue;let pe=(ue=_.current)==null?void 0:ue.querySelector(`${Vl}[${ns}="${encodeURIComponent(te[0])}"]`);pe==null||pe.parentElement.appendChild(pe)})}function q(){let T=ge().find(ne=>ne.getAttribute("aria-disabled")!=="true"),ee=T==null?void 0:T.getAttribute(ns);I.setState("value",ee||void 0)}function R(){var T,ee,ne,te;if(!r.current.search||l.current.shouldFilter===!1){r.current.filtered.count=n.current.size;return}r.current.filtered.groups=new Set;let ue=0;for(let pe of n.current){let Oe=(ee=(T=o.current.get(pe))==null?void 0:T.value)!=null?ee:"",J=(te=(ne=o.current.get(pe))==null?void 0:ne.keywords)!=null?te:[],je=B(Oe,J);r.current.filtered.items.set(pe,je),je>0&&ue++}for(let[pe,Oe]of a.current)for(let J of Oe)if(r.current.filtered.items.get(J)>0){r.current.filtered.groups.add(pe);break}r.current.filtered.count=ue}function de(){var T,ee,ne;let te=Z();te&&(((T=te.parentElement)==null?void 0:T.firstChild)===te&&((ne=(ee=te.closest(Vl))==null?void 0:ee.querySelector(g3))==null||ne.scrollIntoView({block:"nearest"})),te.scrollIntoView({block:"nearest"}))}function Z(){var T;return(T=_.current)==null?void 0:T.querySelector(`${_2}[aria-selected="true"]`)}function ge(){var T;return Array.from(((T=_.current)==null?void 0:T.querySelectorAll(pw))||[])}function ke(T){let ee=ge()[T];ee&&I.setState("value",ee.getAttribute(ns))}function me(T){var ee;let ne=Z(),te=ge(),ue=te.findIndex(Oe=>Oe===ne),pe=te[ue+T];(ee=l.current)!=null&&ee.loop&&(pe=ue+T<0?te[te.length-1]:ue+T===te.length?te[0]:te[ue+T]),pe&&I.setState("value",pe.getAttribute(ns))}function Q(T){let ee=Z(),ne=ee==null?void 0:ee.closest(Vl),te;for(;ne&&!te;)ne=T>0?P3(ne,Vl):C3(ne,Vl),te=ne==null?void 0:ne.querySelector(pw);te?I.setState("value",te.getAttribute(ns)):me(T)}let oe=()=>ke(ge().length-1),X=T=>{T.preventDefault(),T.metaKey?oe():T.altKey?Q(1):me(1)},L=T=>{T.preventDefault(),T.metaKey?ke(0):T.altKey?Q(-1):me(-1)};return y.createElement(Gt.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:T=>{var ee;(ee=N.onKeyDown)==null||ee.call(N,T);let ne=T.nativeEvent.isComposing||T.keyCode===229;if(!(T.defaultPrevented||ne))switch(T.key){case"n":case"j":{S&&T.ctrlKey&&X(T);break}case"ArrowDown":{X(T);break}case"p":case"k":{S&&T.ctrlKey&&L(T);break}case"ArrowUp":{L(T);break}case"Home":{T.preventDefault(),ke(0);break}case"End":{T.preventDefault(),oe();break}case"Enter":{T.preventDefault();let te=Z();if(te){let ue=new Event(eg);te.dispatchEvent(ue)}}}}},y.createElement("label",{"cmdk-label":"",htmlFor:$.inputId,id:$.labelId,style:_3},f),ah(e,T=>y.createElement(I2.Provider,{value:I},y.createElement(M2.Provider,{value:$},T))))}),x3=y.forwardRef((e,t)=>{var r,n;let a=oi(),o=y.useRef(null),u=y.useContext(T2),l=Vu(),f=R2(e),h=(n=(r=f.current)==null?void 0:r.forceMount)!=null?n:u==null?void 0:u.forceMount;io(()=>{if(!h)return l.item(a,u==null?void 0:u.id)},[h]);let p=$2(a,o,[e.value,e.children,o],e.keywords),v=cy(),x=ca(A=>A.value&&A.value===p.current),b=ca(A=>h||l.filter()===!1?!0:A.search?A.filtered.items.get(a)>0:!0);y.useEffect(()=>{let A=o.current;if(!(!A||e.disabled))return A.addEventListener(eg,k),()=>A.removeEventListener(eg,k)},[b,e.onSelect,e.disabled]);function k(){var A,I;j(),(I=(A=f.current).onSelect)==null||I.call(A,p.current)}function j(){v.setState("value",p.current,!0)}if(!b)return null;let{disabled:S,value:N,onSelect:P,forceMount:O,keywords:C,..._}=e;return y.createElement(Gt.div,{ref:As(o,t),..._,id:a,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!x,"data-disabled":!!S,"data-selected":!!x,onPointerMove:S||l.getDisablePointerSelection()?void 0:j,onClick:S?void 0:k},e.children)}),b3=y.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:a,...o}=e,u=oi(),l=y.useRef(null),f=y.useRef(null),h=oi(),p=Vu(),v=ca(b=>a||p.filter()===!1?!0:b.search?b.filtered.groups.has(u):!0);io(()=>p.group(u),[]),$2(u,l,[e.value,e.heading,f]);let x=y.useMemo(()=>({id:u,forceMount:a}),[a]);return y.createElement(Gt.div,{ref:As(l,t),...o,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},r&&y.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:h},r),ah(e,b=>y.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?h:void 0},y.createElement(T2.Provider,{value:x},b))))}),w3=y.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,a=y.useRef(null),o=ca(u=>!u.search);return!r&&!o?null:y.createElement(Gt.div,{ref:As(a,t),...n,"cmdk-separator":"",role:"separator"})}),k3=y.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,a=e.value!=null,o=cy(),u=ca(h=>h.search),l=ca(h=>h.selectedItemId),f=Vu();return y.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),y.createElement(Gt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":l,id:f.inputId,type:"text",value:a?e.value:u,onChange:h=>{a||o.setState("search",h.target.value),r==null||r(h.target.value)}})}),j3=y.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...a}=e,o=y.useRef(null),u=y.useRef(null),l=ca(h=>h.selectedItemId),f=Vu();return y.useEffect(()=>{if(u.current&&o.current){let h=u.current,p=o.current,v,x=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let b=h.offsetHeight;p.style.setProperty("--cmdk-list-height",b.toFixed(1)+"px")})});return x.observe(h),()=>{cancelAnimationFrame(v),x.unobserve(h)}}},[]),y.createElement(Gt.div,{ref:As(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":l,"aria-label":n,id:f.listId},ah(e,h=>y.createElement("div",{ref:As(u,f.listInnerRef),"cmdk-list-sizer":""},h)))}),S3=y.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:a,contentClassName:o,container:u,...l}=e;return y.createElement(w2,{open:r,onOpenChange:n},y.createElement(S2,{container:u},y.createElement(N2,{"cmdk-overlay":"",className:a}),y.createElement(E2,{"aria-label":e.label,"cmdk-dialog":"",className:o},y.createElement(D2,{ref:t,...l}))))}),N3=y.forwardRef((e,t)=>ca(r=>r.filtered.count===0)?y.createElement(Gt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),E3=y.forwardRef((e,t)=>{let{progress:r,children:n,label:a="Loading...",...o}=e;return y.createElement(Gt.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},ah(e,u=>y.createElement("div",{"aria-hidden":!0},u)))}),qo=Object.assign(D2,{List:j3,Item:x3,Input:k3,Group:b3,Separator:w3,Dialog:S3,Empty:N3,Loading:E3});function P3(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function C3(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function R2(e){let t=y.useRef(e);return io(()=>{t.current=e}),t}var io=typeof window>"u"?y.useEffect:y.useLayoutEffect;function is(e){let t=y.useRef();return t.current===void 0&&(t.current=e()),t}function ca(e){let t=cy(),r=()=>e(t.snapshot());return y.useSyncExternalStore(t.subscribe,r,r)}function $2(e,t,r,n=[]){let a=y.useRef(),o=Vu();return io(()=>{var u;let l=(()=>{var h;for(let p of r){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(h=p.current.textContent)==null?void 0:h.trim():a.current}})(),f=n.map(h=>h.trim());o.value(e,l,f),(u=t.current)==null||u.setAttribute(ns,l),a.current=l}),a}var A3=()=>{let[e,t]=y.useState(),r=is(()=>new Map);return io(()=>{r.current.forEach(n=>n()),r.current=new Map},[e]),(n,a)=>{r.current.set(n,a),t({})}};function O3(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function ah({asChild:e,children:t},r){return e&&y.isValidElement(t)?y.cloneElement(O3(t),{ref:t.ref},r(t.props.children)):r(t)}var _3={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function M3({onNavigate:e}){const[t,r]=y.useState(!1);return y.useEffect(()=>{const n=a=>{(a.metaKey||a.ctrlKey)&&a.key.toLowerCase()==="k"&&(a.preventDefault(),r(o=>!o))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),c.jsx(qo.Dialog,{open:t,onOpenChange:r,label:"Befehlspalette",className:"fixed inset-0 z-50 flex items-start justify-center bg-black/50 p-4 pt-[12vh]",onClick:()=>r(!1),children:c.jsxs("div",{className:"w-full max-w-lg overflow-hidden rounded-xl border border-border bg-popover text-popover-foreground shadow-2xl",onClick:n=>n.stopPropagation(),children:[c.jsx(qo.Input,{autoFocus:!0,placeholder:"Springe zu… (Modelle, Routing, System …)",className:"w-full border-b border-border bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted-foreground"}),c.jsxs(qo.List,{className:"max-h-80 overflow-y-auto p-2",children:[c.jsx(qo.Empty,{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:"Nichts gefunden."}),c.jsx(qo.Group,{heading:"Bereiche",className:"px-1 py-1 text-xs text-muted-foreground",children:Yv.map(n=>c.jsxs(qo.Item,{value:`${n.label} ${n.hint}`,onSelect:()=>{e(n.id),r(!1)},className:"flex cursor-pointer items-center gap-3 rounded-md px-3 py-2 text-sm text-foreground aria-selected:bg-accent aria-selected:text-accent-foreground",children:[c.jsx(n.icon,{className:"h-4 w-4 text-primary"}),c.jsx("span",{children:n.label}),c.jsx("span",{className:"ml-auto truncate text-xs text-muted-foreground",children:n.hint})]},n.id))})]})]})})}async function Me(e,t){var f;const r={"Content-Type":"application/json",...t==null?void 0:t.headers},n=localStorage.getItem("mc_sudo_password"),a=localStorage.getItem("mc_hf_token");n&&(r["X-Sudo-Password"]=n);let o=t==null?void 0:t.body;if((((f=t==null?void 0:t.method)==null?void 0:f.toUpperCase())||"GET")==="POST"){if(typeof o=="string")try{const h=JSON.parse(o);let p=!1;n&&!("sudo_password"in h)&&(h.sudo_password=n,p=!0),a&&!("hf_token"in h)&&(h.hf_token=a,p=!0),p&&(o=JSON.stringify(h))}catch{}else if(!o){const h={};n&&(h.sudo_password=n),a&&(h.hf_token=a),Object.keys(h).length>0&&(o=JSON.stringify(h))}}const l=await fetch(e,{...t,headers:r,body:o});if(!l.ok)throw new Error(`${l.status} ${l.statusText}`);return l.json()}const wt={health:["health"],systemStatus:["system-status"],services:["services"],models:["models"],routing:["routing"],jobs:["jobs"],tokenStats:["token-stats"],agentStatus:["agent-status"],hermesBrain:["hermes-brain"],updates:["updates"],discover:["discover"],drafts:e=>["drafts",e??""],connect:e=>["connect",e??""],memory:(e,t)=>["memory",e??"",t??""],memoryGraph:["memory-graph"]},I3=(e=!0)=>ur({queryKey:wt.memoryGraph,queryFn:()=>Me("/api/memory/graph"),enabled:e}),T3=()=>ur({queryKey:wt.health,queryFn:()=>Me("/api/health"),refetchInterval:1e4}),oh=(e=5e3)=>ur({queryKey:wt.systemStatus,queryFn:()=>Me("/api/system/status"),refetchInterval:e}),D3=(e=3e3)=>ur({queryKey:wt.services,queryFn:()=>Me("/api/system/services"),refetchInterval:e}),vo=(e=4e3)=>ur({queryKey:wt.models,queryFn:()=>Me("/api/models"),refetchInterval:e}),R3=(e=4e3)=>ur({queryKey:wt.routing,queryFn:()=>Me("/api/routing"),refetchInterval:e}),$3=(e=2e3)=>ur({queryKey:wt.jobs,queryFn:()=>Me("/api/jobs"),refetchInterval:e,select:t=>t.jobs??[]}),dy=(e=3e3)=>ur({queryKey:wt.tokenStats,queryFn:()=>Me("/api/system/token-stats"),refetchInterval:e}),fy=(e=5e3)=>ur({queryKey:wt.agentStatus,queryFn:()=>Me("/api/agent/status"),refetchInterval:e}),L3=(e=6e4)=>ur({queryKey:wt.hermesBrain,queryFn:()=>Me("/api/agent/brain"),refetchInterval:e}),hy=e=>ur({queryKey:wt.updates,queryFn:()=>Me("/api/maintenance/updates"),refetchInterval:e}),z3=()=>ur({queryKey:wt.discover,queryFn:()=>Me("/api/discover")}),F3=e=>ur({queryKey:wt.drafts(e),queryFn:()=>Me(`/api/models/drafts?target=${encodeURIComponent(e??"")}`),enabled:!!e}),L2=e=>ur({queryKey:wt.connect(e),queryFn:()=>Me(e?`/api/connect?${e}`:"/api/connect")}),z2=e=>ur({queryKey:wt.memory(e==null?void 0:e.q,e==null?void 0:e.category),queryFn:()=>{const t=new URLSearchParams;return e!=null&&e.q&&t.set("q",e.q),e!=null&&e.category&&t.set("category",e.category),Me(`/api/memory?${t}`)},select:t=>e!=null&&e.limit?t.slice(0,e.limit):t});function Qo(e){return(e/1024**3).toFixed(1)}function tg(e){return e?e>1024**3?`${(e/1024**3).toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`:""}function Br(e){if(!e)return"—";const t=e/1024**3;return t>=1?`${t.toFixed(1)} GB`:`${(e/1024**2).toFixed(0)} MB`}function B3(e){if(!e)return"";const t=Math.floor(e/60);return t>0?`${t} min`:`${e} s`}function mw(e){return e?`${Math.round(e/1024)}k`:"—"}function F2(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const t=H3(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:u=>{const l=u.split(py);return l[0]===""&&l.length!==1&&l.shift(),B2(l,t)||W3(u)},getConflictingClassGroupIds:(u,l)=>{const f=r[u]||[];return l&&n[u]?[...f,...n[u]]:f}}},B2=(e,t)=>{var u;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?B2(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const o=e.join(py);return(u=t.validators.find(({validator:l})=>l(o)))==null?void 0:u.classGroupId},vw=/^\[(.+)\]$/,W3=e=>{if(vw.test(e)){const t=vw.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},H3=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return G3(Object.entries(e.classGroups),r).forEach(([o,u])=>{rg(u,n,o,t)}),n},rg=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const o=a===""?t:gw(t,a);o.classGroupId=r;return}if(typeof a=="function"){if(K3(a)){rg(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([o,u])=>{rg(u,gw(t,o),r,n)})})},gw=(e,t)=>{let r=e;return t.split(py).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},K3=e=>e.isThemeGetter,G3=(e,t)=>t?e.map(([r,n])=>{const a=n.map(o=>typeof o=="string"?t+o:typeof o=="object"?Object.fromEntries(Object.entries(o).map(([u,l])=>[t+u,l])):o);return[r,a]}):e,V3=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(o,u)=>{r.set(o,u),t++,t>e&&(t=0,n=r,r=new Map)};return{get(o){let u=r.get(o);if(u!==void 0)return u;if((u=n.get(o))!==void 0)return a(o,u),u},set(o,u){r.has(o)?r.set(o,u):a(o,u)}}},U2="!",q3=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,a=t[0],o=t.length,u=l=>{const f=[];let h=0,p=0,v;for(let S=0;Sp?v-p:void 0;return{modifiers:f,hasImportantModifier:b,baseClassName:k,maybePostfixModifierPosition:j}};return r?l=>r({className:l,parseClassName:u}):u},Q3=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Y3=e=>({cache:V3(e.cacheSize),parseClassName:q3(e),...U3(e)}),X3=/\s+/,Z3=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a}=t,o=[],u=e.trim().split(X3);let l="";for(let f=u.length-1;f>=0;f-=1){const h=u[f],{modifiers:p,hasImportantModifier:v,baseClassName:x,maybePostfixModifierPosition:b}=r(h);let k=!!b,j=n(k?x.substring(0,b):x);if(!j){if(!k){l=h+(l.length>0?" "+l:l);continue}if(j=n(x),!j){l=h+(l.length>0?" "+l:l);continue}k=!1}const S=Q3(p).join(":"),N=v?S+U2:S,P=N+j;if(o.includes(P))continue;o.push(P);const O=a(j,k);for(let C=0;C0?" "+l:l)}return l};function J3(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nv(p),e());return r=Y3(h),n=r.cache.get,a=r.cache.set,o=l,l(f)}function l(f){const h=n(f);if(h)return h;const p=Z3(f,r);return a(f,p),p}return function(){return o(J3.apply(null,arguments))}}const it=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},H2=/^\[(?:([a-z-]+):)?(.+)\]$/i,t4=/^\d+\/\d+$/,r4=new Set(["px","full","screen"]),n4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,a4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,o4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,s4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xn=e=>cs(e)||r4.has(e)||t4.test(e),Ui=e=>Bs(e,"length",m4),cs=e=>!!e&&!Number.isNaN(Number(e)),Qm=e=>Bs(e,"number",cs),ql=e=>!!e&&Number.isInteger(Number(e)),l4=e=>e.endsWith("%")&&cs(e.slice(0,-1)),$e=e=>H2.test(e),Wi=e=>n4.test(e),u4=new Set(["length","size","percentage"]),c4=e=>Bs(e,u4,K2),d4=e=>Bs(e,"position",K2),f4=new Set(["image","url"]),h4=e=>Bs(e,f4,g4),p4=e=>Bs(e,"",v4),Ql=()=>!0,Bs=(e,t,r)=>{const n=H2.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},m4=e=>i4.test(e)&&!a4.test(e),K2=()=>!1,v4=e=>o4.test(e),g4=e=>s4.test(e),y4=()=>{const e=it("colors"),t=it("spacing"),r=it("blur"),n=it("brightness"),a=it("borderColor"),o=it("borderRadius"),u=it("borderSpacing"),l=it("borderWidth"),f=it("contrast"),h=it("grayscale"),p=it("hueRotate"),v=it("invert"),x=it("gap"),b=it("gradientColorStops"),k=it("gradientColorStopPositions"),j=it("inset"),S=it("margin"),N=it("opacity"),P=it("padding"),O=it("saturate"),C=it("scale"),_=it("sepia"),A=it("skew"),I=it("space"),$=it("translate"),B=()=>["auto","contain","none"],K=()=>["auto","hidden","clip","visible","scroll"],q=()=>["auto",$e,t],R=()=>[$e,t],de=()=>["",Xn,Ui],Z=()=>["auto",cs,$e],ge=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ke=()=>["solid","dashed","dotted","double","none"],me=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>["start","end","center","between","around","evenly","stretch"],oe=()=>["","0",$e],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],L=()=>[cs,$e];return{cacheSize:500,separator:":",theme:{colors:[Ql],spacing:[Xn,Ui],blur:["none","",Wi,$e],brightness:L(),borderColor:[e],borderRadius:["none","","full",Wi,$e],borderSpacing:R(),borderWidth:de(),contrast:L(),grayscale:oe(),hueRotate:L(),invert:oe(),gap:R(),gradientColorStops:[e],gradientColorStopPositions:[l4,Ui],inset:q(),margin:q(),opacity:L(),padding:R(),saturate:L(),scale:L(),sepia:oe(),skew:L(),space:R(),translate:R()},classGroups:{aspect:[{aspect:["auto","square","video",$e]}],container:["container"],columns:[{columns:[Wi]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ge(),$e]}],overflow:[{overflow:K()}],"overflow-x":[{"overflow-x":K()}],"overflow-y":[{"overflow-y":K()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[j]}],"inset-x":[{"inset-x":[j]}],"inset-y":[{"inset-y":[j]}],start:[{start:[j]}],end:[{end:[j]}],top:[{top:[j]}],right:[{right:[j]}],bottom:[{bottom:[j]}],left:[{left:[j]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ql,$e]}],basis:[{basis:q()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",$e]}],grow:[{grow:oe()}],shrink:[{shrink:oe()}],order:[{order:["first","last","none",ql,$e]}],"grid-cols":[{"grid-cols":[Ql]}],"col-start-end":[{col:["auto",{span:["full",ql,$e]},$e]}],"col-start":[{"col-start":Z()}],"col-end":[{"col-end":Z()}],"grid-rows":[{"grid-rows":[Ql]}],"row-start-end":[{row:["auto",{span:[ql,$e]},$e]}],"row-start":[{"row-start":Z()}],"row-end":[{"row-end":Z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",$e]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",$e]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...Q()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Q(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Q(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[P]}],px:[{px:[P]}],py:[{py:[P]}],ps:[{ps:[P]}],pe:[{pe:[P]}],pt:[{pt:[P]}],pr:[{pr:[P]}],pb:[{pb:[P]}],pl:[{pl:[P]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[I]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[I]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",$e,t]}],"min-w":[{"min-w":[$e,t,"min","max","fit"]}],"max-w":[{"max-w":[$e,t,"none","full","min","max","fit","prose",{screen:[Wi]},Wi]}],h:[{h:[$e,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[$e,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[$e,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Wi,Ui]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Qm]}],"font-family":[{font:[Ql]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",$e]}],"line-clamp":[{"line-clamp":["none",cs,Qm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Xn,$e]}],"list-image":[{"list-image":["none",$e]}],"list-style-type":[{list:["none","disc","decimal",$e]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[N]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[N]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ke(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Xn,Ui]}],"underline-offset":[{"underline-offset":["auto",Xn,$e]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",$e]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",$e]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[N]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ge(),d4]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",c4]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},h4]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[k]}],"gradient-via-pos":[{via:[k]}],"gradient-to-pos":[{to:[k]}],"gradient-from":[{from:[b]}],"gradient-via":[{via:[b]}],"gradient-to":[{to:[b]}],rounded:[{rounded:[o]}],"rounded-s":[{"rounded-s":[o]}],"rounded-e":[{"rounded-e":[o]}],"rounded-t":[{"rounded-t":[o]}],"rounded-r":[{"rounded-r":[o]}],"rounded-b":[{"rounded-b":[o]}],"rounded-l":[{"rounded-l":[o]}],"rounded-ss":[{"rounded-ss":[o]}],"rounded-se":[{"rounded-se":[o]}],"rounded-ee":[{"rounded-ee":[o]}],"rounded-es":[{"rounded-es":[o]}],"rounded-tl":[{"rounded-tl":[o]}],"rounded-tr":[{"rounded-tr":[o]}],"rounded-br":[{"rounded-br":[o]}],"rounded-bl":[{"rounded-bl":[o]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[N]}],"border-style":[{border:[...ke(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[N]}],"divide-style":[{divide:ke()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...ke()]}],"outline-offset":[{"outline-offset":[Xn,$e]}],"outline-w":[{outline:[Xn,Ui]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:de()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[N]}],"ring-offset-w":[{"ring-offset":[Xn,Ui]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Wi,p4]}],"shadow-color":[{shadow:[Ql]}],opacity:[{opacity:[N]}],"mix-blend":[{"mix-blend":[...me(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":me()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",Wi,$e]}],grayscale:[{grayscale:[h]}],"hue-rotate":[{"hue-rotate":[p]}],invert:[{invert:[v]}],saturate:[{saturate:[O]}],sepia:[{sepia:[_]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[h]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[p]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[N]}],"backdrop-saturate":[{"backdrop-saturate":[O]}],"backdrop-sepia":[{"backdrop-sepia":[_]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[u]}],"border-spacing-x":[{"border-spacing-x":[u]}],"border-spacing-y":[{"border-spacing-y":[u]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",$e]}],duration:[{duration:L()}],ease:[{ease:["linear","in","out","in-out",$e]}],delay:[{delay:L()}],animate:[{animate:["none","spin","ping","pulse","bounce",$e]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[ql,$e]}],"translate-x":[{"translate-x":[$]}],"translate-y":[{"translate-y":[$]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",$e]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",$e]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",$e]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Xn,Ui,Qm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},x4=e4(y4);function fe(...e){return x4(et(e))}function _s(e){return e?e.replace(/127\.0\.0\.1|localhost/g,"192.168.178.151"):""}const G2=["fast","heavy","coder","vision","scout"],b4={fast:"bg-cyan-500/15 text-cyan-400 border-cyan-500/25",heavy:"bg-amber-500/15 text-amber-400 border-amber-500/25",coder:"bg-violet-500/15 text-violet-400 border-violet-500/25",vision:"bg-pink-500/15 text-pink-400 border-pink-500/25",scout:"bg-teal-500/15 text-teal-400 border-teal-500/25",hermes:"bg-indigo-500/15 text-indigo-400 border-indigo-500/25"},my=e=>e&&b4[e]||"bg-slate-500/15 text-slate-300 border-slate-500/25";function w4({fit:e}){const t={perfect:"bg-emerald-500/15 text-emerald-400 border border-emerald-500/20",marginal:"bg-amber-500/15 text-amber-400 border border-amber-500/20",too_tight:"bg-red-500/15 text-red-400 border border-red-500/20"}[e.level];return c.jsxs("span",{className:fe("rounded px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wider font-mono",t),children:[e.text," • ",e.req_gb," GB RAM"]})}function yw(e){const t=e.toLowerCase();return t.includes("qwen")?{name:"Qwen",color:"bg-purple-500/20 text-purple-300 border-purple-500/30",initial:"Q"}:t.includes("gemma")?{name:"Gemma",color:"bg-blue-500/20 text-blue-300 border-blue-500/30",initial:"G"}:t.includes("llama")?{name:"Llama",color:"bg-red-500/20 text-red-300 border-red-500/30",initial:"🦙"}:t.includes("mistral")||t.includes("mixtral")?{name:"Mistral",color:"bg-orange-500/20 text-orange-300 border-orange-500/30",initial:"M"}:t.includes("deepseek")?{name:"DeepSeek",color:"bg-cyan-500/20 text-cyan-300 border-cyan-500/30",initial:"D"}:t.includes("hermes")||t.includes("nous")?{name:"Hermes",color:"bg-amber-500/20 text-amber-300 border-amber-500/30",initial:"H"}:t.includes("phi")?{name:"Phi",color:"bg-emerald-500/20 text-emerald-300 border-emerald-500/30",initial:"Φ"}:{name:"Other",color:"bg-slate-500/20 text-slate-300 border-slate-500/30",initial:"AI"}}function k4(){const{data:e}=vo(2e3),{data:t}=dy(2e3),r=(e==null?void 0:e.models)??[],n=(e==null?void 0:e.running)??[],a=r.filter(f=>n.includes(f.name)),o=y.useRef(null),[u,l]=y.useState(!1);return y.useEffect(()=>{if(!t)return;const f=t.total_tokens;if(o.current!==null&&f>o.current){l(!0);const h=setTimeout(()=>l(!1),4e3);return o.current=f,()=>clearTimeout(h)}o.current=f},[t==null?void 0:t.total_tokens]),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Aktive Modelle (Live)"})]}),c.jsxs("span",{className:fe("flex items-center gap-1.5 text-[10px] font-bold uppercase tracking-wider font-mono px-2 py-0.5 rounded-full border transition-colors",u?"bg-emerald-500/10 text-emerald-400 border-emerald-500/30":"bg-background/30 text-muted-foreground/70 border-border/40"),children:[u?c.jsx(ls,{className:"h-3 w-3 animate-pulse"}):c.jsx(mI,{className:"h-3 w-3"}),u?"Inferenz aktiv":"Idle"]})]}),a.length===0?c.jsx("div",{className:"flex items-center justify-center gap-2 h-20 text-xs text-muted-foreground/70 italic",children:"Kein Modell geladen — Auto-Swap lädt bei Anfrage."}):c.jsx("div",{className:"grid gap-2",children:a.map(f=>{var h;return c.jsxs("div",{className:"flex items-center justify-between gap-2 p-3 rounded-xl bg-emerald-500/5 border border-emerald-500/20",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[f.role&&c.jsx("span",{className:fe("text-[8px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",my(f.role)),children:f.role}),c.jsx("span",{className:"text-xs font-semibold font-mono text-foreground truncate",children:(h=f.name.split("/").pop())==null?void 0:h.replace(/\.gguf$/i,"")})]}),c.jsxs("div",{className:"text-[9px] font-mono text-muted-foreground/70 mt-0.5",children:[Br(f.size_bytes)," im Unified-RAM"]})]}),c.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono shrink-0",children:[c.jsx("span",{className:fe("h-1.5 w-1.5 rounded-full bg-emerald-500",u&&"animate-pulse")})," warm"]})]},f.name)})})]})}let ng=[],ig=[];const ag=new Set,V2=()=>ag.forEach(e=>e());function q2(e){return ag.add(e),()=>{ag.delete(e)}}function j4(e){ng=[...ng,e].slice(-40),V2()}function S4(e){ig=[...ig,e].slice(-40),V2()}const N4=()=>y.useSyncExternalStore(q2,()=>ng),E4=()=>y.useSyncExternalStore(q2,()=>ig);function P4(){const{data:e,dataUpdatedAt:t}=oh(3e3),{data:r,dataUpdatedAt:n}=dy(3e3),a=y.useRef(null);y.useEffect(()=>{var o,u,l,f;e&&j4({t:Date.now(),cpu:((o=e.cpu)==null?void 0:o.percent)??0,ram:((u=e.ram)==null?void 0:u.percent)??0,gpu:((l=e.gpu)==null?void 0:l.busy_percent)??null,disk:((f=e.disk)==null?void 0:f.percent)??null})},[t]),y.useEffect(()=>{if(!r)return;const o=Date.now(),u=r.prompt_tokens,l=r.completion_tokens;if(a.current){const f=Math.max((o-a.current.t)/1e3,.001);S4({t:o,prompt:Math.max(0,(u-a.current.p)/f),completion:Math.max(0,(l-a.current.c)/f)})}a.current={p:u,c:l,t:o}},[n])}function C4(){const{data:e,error:t}=oh(3e3),r=N4();return{sys:e,hist:r,error:t}}var A4=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function vy(e){if(typeof e!="string")return!1;var t=A4;return t.includes(e)}var O4=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],_4=new Set(O4);function Q2(e){return typeof e!="string"?!1:_4.has(e)}function Y2(e){return typeof e=="string"&&e.startsWith("data-")}function dn(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Q2(r)||Y2(r))&&(t[r]=e[r]);return t}function sh(e){if(e==null)return null;if(y.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return dn(t)}return typeof e=="object"&&!Array.isArray(e)?dn(e):null}function Gr(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(Q2(r)||Y2(r)||vy(r))&&(t[r]=e[r]);return t}function M4(e){return e==null?null:y.isValidElement(e)?Gr(e.props):typeof e=="object"&&!Array.isArray(e)?Gr(e):null}var I4=["children","width","height","viewBox","className","style","title","desc"];function og(){return og=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.width,a=e.height,o=e.viewBox,u=e.className,l=e.style,f=e.title,h=e.desc,p=T4(e,I4),v=o||{width:n,height:a,x:0,y:0},x=et("recharts-surface",u);return y.createElement("svg",og({},Gr(p),{className:x,width:n,height:a,style:l,viewBox:"".concat(v.x," ").concat(v.y," ").concat(v.width," ").concat(v.height),ref:t}),y.createElement("title",null,f),y.createElement("desc",null,h),r)}),R4=["children","className"];function sg(){return sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=e.children,n=e.className,a=$4(e,R4),o=et("recharts-layer",n);return y.createElement("g",sg({className:o},Gr(a),{ref:t}),r)}),z4=y.createContext(null);function pt(e){return function(){return e}}const lg=Math.PI,ug=2*lg,Ra=1e-6,F4=ug-Ra;function Z2(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return Z2;const r=10**t;return function(n){this._+=n[0];for(let a=1,o=n.length;aRa)if(!(Math.abs(v*f-h*p)>Ra)||!o)this._append`L${this._x1=t},${this._y1=r}`;else{let b=n-u,k=a-l,j=f*f+h*h,S=b*b+k*k,N=Math.sqrt(j),P=Math.sqrt(x),O=o*Math.tan((lg-Math.acos((j+x-S)/(2*N*P)))/2),C=O/P,_=O/N;Math.abs(C-1)>Ra&&this._append`L${t+C*p},${r+C*v}`,this._append`A${o},${o},0,0,${+(v*b>p*k)},${this._x1=t+_*f},${this._y1=r+_*h}`}}arc(t,r,n,a,o,u){if(t=+t,r=+r,n=+n,u=!!u,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(a),f=n*Math.sin(a),h=t+l,p=r+f,v=1^u,x=u?a-o:o-a;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Ra||Math.abs(this._y1-p)>Ra)&&this._append`L${h},${p}`,n&&(x<0&&(x=x%ug+ug),x>F4?this._append`A${n},${n},0,1,${v},${t-l},${r-f}A${n},${n},0,1,${v},${this._x1=h},${this._y1=p}`:x>Ra&&this._append`A${n},${n},0,${+(x>=lg)},${v},${this._x1=t+n*Math.cos(o)},${this._y1=r+n*Math.sin(o)}`)}rect(t,r,n,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+a}h${-n}Z`}toString(){return this._}}function J2(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new U4(t)}function gy(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function eE(e){this._context=e}eE.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 lh(e){return new eE(e)}function tE(e){return e[0]}function rE(e){return e[1]}function nE(e,t){var r=pt(!0),n=null,a=lh,o=null,u=J2(l);e=typeof e=="function"?e:e===void 0?tE:pt(e),t=typeof t=="function"?t:t===void 0?rE:pt(t);function l(f){var h,p=(f=gy(f)).length,v,x=!1,b;for(n==null&&(o=a(b=u())),h=0;h<=p;++h)!(h=b;--k)l.point(O[k],C[k]);l.lineEnd(),l.areaEnd()}N&&(O[x]=+e(S,x,v),C[x]=+t(S,x,v),l.point(n?+n(S,x,v):O[x],r?+r(S,x,v):C[x]))}if(P)return l=null,P+""||null}function p(){return nE().defined(a).curve(u).context(o)}return h.x=function(v){return arguments.length?(e=typeof v=="function"?v:pt(+v),n=null,h):e},h.x0=function(v){return arguments.length?(e=typeof v=="function"?v:pt(+v),h):e},h.x1=function(v){return arguments.length?(n=v==null?null:typeof v=="function"?v:pt(+v),h):n},h.y=function(v){return arguments.length?(t=typeof v=="function"?v:pt(+v),r=null,h):t},h.y0=function(v){return arguments.length?(t=typeof v=="function"?v:pt(+v),h):t},h.y1=function(v){return arguments.length?(r=v==null?null:typeof v=="function"?v:pt(+v),h):r},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(r)},h.lineX1=function(){return p().x(n).y(t)},h.defined=function(v){return arguments.length?(a=typeof v=="function"?v:pt(!!v),h):a},h.curve=function(v){return arguments.length?(u=v,o!=null&&(l=u(o)),h):u},h.context=function(v){return arguments.length?(v==null?o=l=null:l=u(o=v),h):o},h}class iE{constructor(t,r){this._context=t,this._x=r}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,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function W4(e){return new iE(e,!0)}function H4(e){return new iE(e,!1)}function of(){}function sf(e,t,r){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+r)/6)}function aE(e){this._context=e}aE.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:sf(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:sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function K4(e){return new aE(e)}function oE(e){this._context=e}oE.prototype={areaStart:of,areaEnd:of,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:sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function G4(e){return new oE(e)}function sE(e){this._context=e}sE.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 r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:sf(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function V4(e){return new sE(e)}function lE(e){this._context=e}lE.prototype={areaStart:of,areaEnd:of,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 q4(e){return new lE(e)}function xw(e){return e<0?-1:1}function bw(e,t,r){var n=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(n||a<0&&-0),u=(r-e._y1)/(a||n<0&&-0),l=(o*a+u*n)/(n+a);return(xw(o)+xw(u))*Math.min(Math.abs(o),Math.abs(u),.5*Math.abs(l))||0}function ww(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function Ym(e,t,r){var n=e._x0,a=e._y0,o=e._x1,u=e._y1,l=(o-n)/3;e._context.bezierCurveTo(n+l,a+l*t,o-l,u-l*r,o,u)}function lf(e){this._context=e}lf.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:Ym(this,this._t0,ww(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 r=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,Ym(this,ww(this,r=bw(this,e,t)),r);break;default:Ym(this,this._t0,r=bw(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function uE(e){this._context=new cE(e)}(uE.prototype=Object.create(lf.prototype)).point=function(e,t){lf.prototype.point.call(this,t,e)};function cE(e){this._context=e}cE.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,r,n,a,o){this._context.bezierCurveTo(t,e,n,r,o,a)}};function Q4(e){return new lf(e)}function Y4(e){return new uE(e)}function dE(e){this._context=e}dE.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,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=kw(e),a=kw(t),o=0,u=1;u=0;--t)a[t]=(u[t]-a[t+1])/o[t];for(o[r-1]=(e[r]+a[r-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 r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Z4(e){return new uh(e,.5)}function J4(e){return new uh(e,0)}function eD(e){return new uh(e,1)}function ao(e,t){if((u=e.length)>1)for(var r=1,n,a,o=e[t[0]],u,l=o.length;r=0;)r[t]=t;return r}function tD(e,t){return e[t]}function rD(e){const t=[];return t.key=e,t}function nD(){var e=pt([]),t=cg,r=ao,n=tD;function a(o){var u=Array.from(e.apply(this,arguments),rD),l,f=u.length,h=-1,p;for(const v of o)for(l=0,++h;l0){for(var r,n,a=0,o=e[0].length,u;a0){for(var r=0,n=e[t[0]],a,o=n.length;r0)||!((o=(a=e[t[0]]).length)>0))){for(var r=0,n=1,a,o,u;n1&&arguments[1]!==void 0?arguments[1]:lD,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Bt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var l=r[u-1];return typeof l=="string"?a+l+o:l!==void 0?a+ia(l)+o:a+o},"")}var Wr=e=>e===0?0:e>0?1:-1,Tn=e=>typeof e=="number"&&e!=+e,oo=e=>typeof e=="string"&&e.length>1&&e.indexOf("%")===e.length-1,Ne=e=>(typeof e=="number"||e instanceof Number)&&!Tn(e),Dn=e=>Ne(e)||typeof e=="string",uD=0,Nu=e=>{var t=++uD;return"".concat(e||"").concat(t)},da=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ne(t)&&typeof t!="string")return n;var o;if(oo(t)){if(r==null)return n;var u=t.indexOf("%");o=r*parseFloat(t.slice(0,u))/100}else o=+t;return Tn(o)&&(o=n),a&&r!=null&&o>r&&(o=r),o},pE=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):go(n,t))===r)}var Kt=e=>e===null||typeof e>"u",by=e=>Kt(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function xr(e){return e!=null}function Us(){}var vE=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,wy=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(y.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(a=>{vy(a)&&typeof r[a]=="function"&&(n[a]=(o=>r[a](r,o)))}),n},cD=(e,t,r)=>n=>(e(t,r,n),null),dD=(e,t,r)=>{if(e===null||typeof e!="object"&&typeof e!="function")return null;var n=null;return Object.keys(e).forEach(a=>{var o=e[a];vy(a)&&typeof o=="function"&&(n||(n={}),n[a]=cD(o,t,r))}),n};function jw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fD(e){for(var t=1;t(u[l]===void 0&&n[l]!==void 0&&(u[l]=n[l]),u),r);return o}function vD(e,t){const r=new Map;for(let n=0;nObject.prototype.propertyIsEnumerable.call(e,t))}function ky(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const wD="[object RegExp]",yE="[object String]",xE="[object Number]",bE="[object Boolean]",wE="[object Arguments]",kD="[object Symbol]",jD="[object Date]",SD="[object Map]",ND="[object Set]",ED="[object Array]",PD="[object ArrayBuffer]",CD="[object Object]",AD="[object DataView]",OD="[object Uint8Array]",_D="[object Uint8ClampedArray]",MD="[object Uint16Array]",ID="[object Uint32Array]",TD="[object Int8Array]",DD="[object Int16Array]",RD="[object Int32Array]",$D="[object Float32Array]",LD="[object Float64Array]",Sw=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function zD(e){return typeof Sw.Buffer<"u"&&Sw.Buffer.isBuffer(e)}function FD(e,t){return Fa(e,void 0,e,new Map,t)}function Fa(e,t,r,n=new Map,a=void 0){const o=a==null?void 0:a(e,t,r,n);if(o!==void 0)return o;if(fg(e))return e;if(n.has(e))return n.get(e);if(Array.isArray(e)){const u=new Array(e.length);n.set(e,u);for(let l=0;l{}):hg(e,t,function n(a,o,u,l,f,h){const p=r(a,o,u,l,f,h);return p!==void 0?!!p:hg(a,o,n,h,!1)},new Map,!0)}function hg(e,t,r,n,a=!1){if(t===e)return!0;switch(typeof t){case"object":return WD(e,t,r,n);case"function":return Object.keys(t).length>0?hg(e,{...t},r,n,a):Qd(e,t);default:return kE(e)&&a?typeof t=="string"?t==="":!0:Qd(e,t)}}function WD(e,t,r,n){if(t==null)return!0;if(Array.isArray(t))return SE(e,t,r,n);if(t instanceof Map)return HD(e,t,r,n);if(t instanceof Set)return KD(e,t,r,n);const a=Object.keys(t);if(e==null||fg(e))return a.length===0;if(a.length===0)return!0;if(n!=null&&n.has(t))return n.get(t)===e;n==null||n.set(t,e);try{for(let o=0;o{})}function GD(e){return e=UD(e),t=>NE(t,e)}function VD(e,t){return FD(e,(r,n,a,o)=>{if(typeof e=="object"){if(ky(e)==="[object Object]"&&typeof e.constructor!="function"){const u={};return o.set(e,u),on(u,e,a,o),u}switch(Object.prototype.toString.call(e)){case xE:case yE:case bE:{const u=new e.constructor(e==null?void 0:e.valueOf());return on(u,e),u}case wE:{const u={};return on(u,e),u.length=e.length,u[Symbol.iterator]=e[Symbol.iterator],u}default:return}}})}function qD(e){return VD(e)}const QD=/^(?:0|[1-9]\d*)$/;function EE(e,t=Number.MAX_SAFE_INTEGER){switch(typeof e){case"number":return Number.isInteger(e)&&e>=0&&e=0}function PE(e){return e!=null&&typeof e!="function"&&eR(e.length)}function tR(e){return typeof e=="object"&&e!==null}function rR(e){return tR(e)&&PE(e)}function Nw(e,t=gE){return rR(e)?vD(Array.from(e),gD(JD(t),1)):[]}function nR(e,t,r){return t===!0?Nw(e,r):typeof t=="function"?Nw(e,t):e}var Xm={exports:{}},Zm={},Jm={exports:{}},ev={};/** * @license React * use-sync-external-store-shim.production.js * @@ -375,7 +385,7 @@ Error generating stack: `+w.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Ew;function eR(){if(Ew)return ev;Ew=1;var e=Fs();function t(v,x){return v===x&&(v!==0||1/v===1/x)||v!==v&&x!==x}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function l(v,x){var b=x(),j=n({inst:{value:b,getSnapshot:x}}),k=j[0].inst,S=j[1];return o(function(){k.value=b,k.getSnapshot=x,f(k)&&S({inst:k})},[v,b,x]),a(function(){return f(k)&&S({inst:k}),v(function(){f(k)&&S({inst:k})})},[v]),u(b),b}function f(v){var x=v.getSnapshot;v=v.value;try{var b=x();return!r(v,b)}catch{return!0}}function h(v,x){return x()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:l;return ev.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,ev}var Pw;function tR(){return Pw||(Pw=1,Jm.exports=eR()),Jm.exports}/** + */var Ew;function iR(){if(Ew)return ev;Ew=1;var e=Fs();function t(v,x){return v===x&&(v!==0||1/v===1/x)||v!==v&&x!==x}var r=typeof Object.is=="function"?Object.is:t,n=e.useState,a=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function l(v,x){var b=x(),k=n({inst:{value:b,getSnapshot:x}}),j=k[0].inst,S=k[1];return o(function(){j.value=b,j.getSnapshot=x,f(j)&&S({inst:j})},[v,b,x]),a(function(){return f(j)&&S({inst:j}),v(function(){f(j)&&S({inst:j})})},[v]),u(b),b}function f(v){var x=v.getSnapshot;v=v.value;try{var b=x();return!r(v,b)}catch{return!0}}function h(v,x){return x()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:l;return ev.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,ev}var Pw;function aR(){return Pw||(Pw=1,Jm.exports=iR()),Jm.exports}/** * @license React * use-sync-external-store-shim/with-selector.production.js * @@ -383,12 +393,12 @@ Error generating stack: `+w.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Cw;function rR(){if(Cw)return Zm;Cw=1;var e=Fs(),t=tR();function r(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:r,a=t.useSyncExternalStore,o=e.useRef,u=e.useEffect,l=e.useMemo,f=e.useDebugValue;return Zm.useSyncExternalStoreWithSelector=function(h,p,v,x,b){var j=o(null);if(j.current===null){var k={hasValue:!1,value:null};j.current=k}else k=j.current;j=l(function(){function N(A){if(!P){if(P=!0,O=A,A=x(A),b!==void 0&&k.hasValue){var I=k.value;if(b(I,A))return C=I}return C=A}if(I=C,n(O,A))return I;var U=x(A);return b!==void 0&&b(I,U)?(O=A,I):(O=A,C=U)}var P=!1,O,C,_=v===void 0?null:v;return[function(){return N(p())},_===null?void 0:function(){return N(_())}]},[p,v,x,b]);var S=a(h,j[0],j[1]);return u(function(){k.hasValue=!0,k.value=S},[S]),f(S),S},Zm}var Aw;function nR(){return Aw||(Aw=1,Xm.exports=rR()),Xm.exports}var iR=nR(),ky=y.createContext(null),aR=e=>e,wt=()=>{var e=y.useContext(ky);return e?e.store.dispatch:aR},Yd=()=>{},oR=()=>Yd,sR=(e,t)=>e===t;function Ce(e){var t=y.useContext(ky),r=y.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Yd,[t,e]);return iR.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:oR,t?t.store.getState:Yd,t?t.store.getState:Yd,r,sR)}function lR(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function uR(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Ow=e=>Array.isArray(e)?e:[e];function cR(e){const t=Array.isArray(e[0])?e[0]:e;return uR(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function dR(e,t){const r=[],{length:n}=e;for(let a=0;atypeof WeakRef>"u"?fR:WeakRef,PE=hR(),pR=0,_w=1;function Od(){return{s:pR,v:void 0,o:null,p:null}}function mR(e){return e instanceof PE?e.deref():e}function CE(e,t={}){let r=Od();const{resultEqualityCheck:n}=t;let a,o=0;function u(){let l=r;const{length:f}=arguments;for(let v=0,x=f;v{r=Od(),u.resetResultsCount()},u.resultsCount=()=>o,u.resetResultsCount=()=>{o=0},u}function vR(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let o=0,u=0,l,f={},h=a.pop();typeof h=="object"&&(f=h,h=a.pop()),lR(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...r,...f},{memoize:v,memoizeOptions:x=[],argsMemoize:b=CE,argsMemoizeOptions:j=[]}=p,k=Ow(x),S=Ow(j),N=cR(a),P=v(function(){return o++,h.apply(null,arguments)},...k),O=b(function(){u++;const _=dR(N,arguments);return l=P.apply(null,_),l},...S);return Object.assign(O,{resultFunc:h,memoizedResultFunc:P,dependencies:N,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>l,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:v,argsMemoize:b})};return Object.assign(n,{withTypes:()=>n}),n}var K=vR(CE);function gR(e,t=1){const r=[],n=Math.floor(t),a=(o,u)=>{for(let l=0;l{if(e!==t){const n=Mw(e),a=Mw(t);if(n===a&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?a-n:n-a}return 0};function AE(e){return typeof e=="symbol"||e instanceof Symbol}const xR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,bR=/^\w*$/;function wR(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||AE(e)?!0:typeof e=="string"&&(bR.test(e)||!xR.test(e))||t!=null}function jR(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(l=>String(l));const a=(l,f)=>{let h=l;for(let p=0;pf==null||l==null?f:typeof l=="object"&&"key"in l?Object.hasOwn(f,l.key)?f[l.key]:a(f,l.path):typeof l=="function"?l(f):Array.isArray(l)?a(f,l):typeof f=="object"?f[l]:f,u=t.map(l=>(Array.isArray(l)&&l.length===1&&(l=l[0]),l==null||typeof l=="function"||Array.isArray(l)||wR(l)?l:{key:l,path:xy(l)}));return e.map(l=>({original:l,criteria:u.map(f=>o(f,l))})).slice().sort((l,f)=>{for(let h=0;hl.original)}function ch(e,...t){const r=t.length;return r>1&&pg(e,t[0],t[1])?t=[]:r>2&&pg(t[0],t[1],t[2])&&(t=[t[0]]),jR(e,gR(t),["asc"])}var OE=e=>e.legend.settings,kR=e=>e.legend.size,SR=e=>e.legend.payload;K([SR,OE],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?ch(n,r):n});function NR(e,t){return AR(e)||CR(e,t)||PR(e,t)||ER()}function ER(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function PR(e,t){if(e){if(typeof e=="string")return Iw(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Iw(e,t):void 0}}function Iw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r_d||Math.abs(e.left-t.left)>_d||Math.abs(e.top-t.top)>_d||Math.abs(e.width-t.width)>_d}function Dw(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function OR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=y.useState({height:0,left:0,top:0,width:0}),r=NR(t,2),n=r[0],a=r[1],o=y.useRef(null),u=y.useRef(n);u.current=n;var l=y.useCallback(f=>{if(o.current!=null&&(o.current.disconnect(),o.current=null),f!=null){var h=Dw(f);if(Tw(h,u.current)&&a(h),typeof ResizeObserver<"u"){var p=new ResizeObserver(()=>{var v=Dw(f);Tw(v,u.current)&&a(v)});p.observe(f),o.current=p}}},[...e]);return y.useEffect(()=>()=>{var f;(f=o.current)===null||f===void 0||f.disconnect()},[]),[n,l]}function Ft(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 _R=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rw=_R,tv=()=>Math.random().toString(36).substring(7).split("").join("."),MR={INIT:`@@redux/INIT${tv()}`,REPLACE:`@@redux/REPLACE${tv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tv()}`},uf=MR;function Sy(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 _E(e,t,r){if(typeof e!="function")throw new Error(Ft(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ft(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ft(1));return r(_E)(e,t)}let n=e,a=t,o=new Map,u=o,l=0,f=!1;function h(){u===o&&(u=new Map,o.forEach((S,N)=>{u.set(N,S)}))}function p(){if(f)throw new Error(Ft(3));return a}function v(S){if(typeof S!="function")throw new Error(Ft(4));if(f)throw new Error(Ft(5));let N=!0;h();const P=l++;return u.set(P,S),function(){if(N){if(f)throw new Error(Ft(6));N=!1,h(),u.delete(P),o=null}}}function x(S){if(!Sy(S))throw new Error(Ft(7));if(typeof S.type>"u")throw new Error(Ft(8));if(typeof S.type!="string")throw new Error(Ft(17));if(f)throw new Error(Ft(9));try{f=!0,a=n(a,S)}finally{f=!1}return(o=u).forEach(P=>{P()}),S}function b(S){if(typeof S!="function")throw new Error(Ft(10));n=S,x({type:uf.REPLACE})}function j(){const S=v;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Ft(11));function P(){const C=N;C.next&&C.next(p())}return P(),{unsubscribe:S(P)}},[Rw](){return this}}}return x({type:uf.INIT}),{dispatch:x,subscribe:v,getState:p,replaceReducer:b,[Rw]:j}}function IR(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:uf.INIT})>"u")throw new Error(Ft(12));if(typeof r(void 0,{type:uf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ft(13))})}function ME(e){const t=Object.keys(e),r={};for(let o=0;o"u")throw l&&l.type,new Error(Ft(14));h[v]=j,f=f||j!==b}return f=f||n.length!==Object.keys(u).length,f?h:u}}function cf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function TR(...e){return t=>(r,n)=>{const a=t(r,n);let o=()=>{throw new Error(Ft(15))};const u={getState:a.getState,dispatch:(f,...h)=>o(f,...h)},l=e.map(f=>f(u));return o=cf(...l)(a.dispatch),{...a,dispatch:o}}}function IE(e){return Sy(e)&&"type"in e&&typeof e.type=="string"}var TE=Symbol.for("immer-nothing"),$w=Symbol.for("immer-draftable"),lr=Symbol.for("immer-state");function ln(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Or=Object,Ms=Or.getPrototypeOf,df="constructor",dh="prototype",mg="configurable",ff="enumerable",Xd="writable",Nu="value",ui=e=>!!e&&!!e[lr];function fn(e){var t;return e?DE(e)||hh(e)||!!e[$w]||!!((t=e[df])!=null&&t[$w])||ph(e)||mh(e):!1}var DR=Or[dh][df].toString(),Lw=new WeakMap;function DE(e){if(!e||!Ny(e))return!1;const t=Ms(e);if(t===null||t===Or[dh])return!0;const r=Or.hasOwnProperty.call(t,df)&&t[df];if(r===Object)return!0;if(!as(r))return!1;let n=Lw.get(r);return n===void 0&&(n=Function.toString.call(r),Lw.set(r,n)),n===DR}function fh(e,t,r=!0){Gu(e)===0?(r?Reflect.ownKeys(e):Or.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function Gu(e){const t=e[lr];return t?t.type_:hh(e)?1:ph(e)?2:mh(e)?3:0}var zw=(e,t,r=Gu(e))=>r===2?e.has(t):Or[dh].hasOwnProperty.call(e,t),vg=(e,t,r=Gu(e))=>r===2?e.get(t):e[t],hf=(e,t,r,n=Gu(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function RR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var hh=Array.isArray,ph=e=>e instanceof Map,mh=e=>e instanceof Set,Ny=e=>typeof e=="object",as=e=>typeof e=="function",rv=e=>typeof e=="boolean";function $R(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Jn=e=>e.copy_||e.base_,Ey=e=>e.modified_?e.copy_:e.base_;function gg(e,t){if(ph(e))return new Map(e);if(mh(e))return new Set(e);if(hh(e))return Array[dh].slice.call(e);const r=DE(e);if(t===!0||t==="class_only"&&!r){const n=Or.getOwnPropertyDescriptors(e);delete n[lr];let a=Reflect.ownKeys(n);for(let o=0;o1&&Or.defineProperties(e,{set:Md,add:Md,clear:Md,delete:Md}),Or.freeze(e),t&&fh(e,(r,n)=>{Py(n,!0)},!1)),e}function LR(){ln(2)}var Md={[Nu]:LR};function vh(e){return e===null||!Ny(e)?!0:Or.isFrozen(e)}var pf="MapSet",yg="Patches",Fw="ArrayMethods",RE={};function so(e){const t=RE[e];return t||ln(0,e),t}var Bw=e=>!!RE[e],Eu,$E=()=>Eu,zR=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Bw(pf)?so(pf):void 0,arrayMethodsPlugin_:Bw(Fw)?so(Fw):void 0});function Uw(e,t){t&&(e.patchPlugin_=so(yg),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function xg(e){bg(e),e.drafts_.forEach(FR),e.drafts_=null}function bg(e){e===Eu&&(Eu=e.parent_)}var Ww=e=>Eu=zR(Eu,e);function FR(e){const t=e[lr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Hw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[lr].modified_&&(xg(t),ln(4)),fn(e)&&(e=Kw(t,e));const{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(r[lr].base_,e,t)}else e=Kw(t,r);return BR(t,e,!0),xg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==TE?e:void 0}function Kw(e,t){if(vh(t))return t;const r=t[lr];if(!r)return mf(t,e.handledSet_,e);if(!gh(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);FE(r,e)}return r.copy_}function BR(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Py(t,r)}function LE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gh=(e,t)=>e.scope_===t,UR=[];function zE(e,t,r,n){const a=Jn(e),o=e.type_;if(n!==void 0&&vg(a,n,o)===t){hf(a,n,r,o);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;fh(a,(f,h)=>{if(ui(h)){const p=l.get(h)||[];p.push(f),l.set(h,p)}})}const u=e.draftLocations_.get(t)??UR;for(const l of u)hf(a,l,r,o)}function WR(e,t,r){e.callbacks_.push(function(a){var l;const o=t;if(!o||!gh(o,a))return;(l=a.mapSetPlugin_)==null||l.fixSetContents(o);const u=Ey(o);zE(e,o.draft_??o,u,r),FE(o,a)})}function FE(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:a}=t;if(a){const o=a.getPath(e);o&&a.generatePatches_(e,o,t)}LE(e)}}function HR(e,t,r){const{scope_:n}=e;if(ui(r)){const a=r[lr];gh(a,n)&&a.callbacks_.push(function(){Zd(e);const u=Ey(a);zE(e,r,u,t)})}else fn(r)&&e.callbacks_.push(function(){const o=Jn(e);e.type_===3?o.has(r)&&mf(r,n.handledSet_,n):vg(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&mf(vg(e.copy_,t,e.type_),n.handledSet_,n)})}function mf(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ui(e)||t.has(e)||!fn(e)||vh(e)||(t.add(e),fh(e,(n,a)=>{if(ui(a)){const o=a[lr];if(gh(o,r)){const u=Ey(o);hf(e,n,u,e.type_),LE(o)}}else fn(a)&&mf(a,t,r)})),e}function KR(e,t){const r=hh(e),n={type_:r?1:0,scope_:t?t.scope_:$E(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=n,o=vf;r&&(a=[n],o=Pu);const{revoke:u,proxy:l}=Proxy.revocable(a,o);return n.draft_=l,n.revoke_=u,[l,n]}var vf={get(e,t){if(t===lr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const a=Jn(e);if(!zw(a,t,e.type_))return VR(e,a,t);const o=a[t];if(e.finalized_||!fn(o)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&$R(t))return o;if(o===nv(e.base_,t)){Zd(e);const u=e.type_===1?+t:t,l=jg(e.scope_,o,e,u);return e.copy_[u]=l}return o},has(e,t){return t in Jn(e)},ownKeys(e){return Reflect.ownKeys(Jn(e))},set(e,t,r){const n=BE(Jn(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=nv(Jn(e),t),o=a==null?void 0:a[lr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(RR(r,a)&&(r!==void 0||zw(e.base_,t,e.type_)))return!0;Zd(e),wg(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),HR(e,t,r)),!0},deleteProperty(e,t){return Zd(e),nv(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),wg(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Jn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Xd]:!0,[mg]:e.type_!==1||t!=="length",[ff]:n[ff],[Nu]:r[t]}},defineProperty(){ln(11)},getPrototypeOf(e){return Ms(e.base_)},setPrototypeOf(){ln(12)}},Pu={};for(let e in vf){let t=vf[e];Pu[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Pu.deleteProperty=function(e,t){return Pu.set.call(this,e,t,void 0)};Pu.set=function(e,t,r){return vf.set.call(this,e[0],t,r,e[0])};function nv(e,t){const r=e[lr];return(r?Jn(r):e)[t]}function VR(e,t,r){var a;const n=BE(t,r);return n?Nu in n?n[Nu]:(a=n.get)==null?void 0:a.call(e.draft_):void 0}function BE(e,t){if(!(t in e))return;let r=Ms(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ms(r)}}function wg(e){e.modified_||(e.modified_=!0,e.parent_&&wg(e.parent_))}function Zd(e){e.copy_||(e.assigned_=new Map,e.copy_=gg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var GR=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,a)=>{if(as(r)&&!as(n)){const u=n;n=r;const l=this;return function(h=u,...p){return l.produce(h,v=>n.call(this,v,...p))}}as(n)||ln(6),a!==void 0&&!as(a)&&ln(7);let o;if(fn(r)){const u=Ww(this),l=jg(u,r,void 0);let f=!0;try{o=n(l),f=!1}finally{f?xg(u):bg(u)}return Uw(u,a),Hw(o,u)}else if(!r||!Ny(r)){if(o=n(r),o===void 0&&(o=r),o===TE&&(o=void 0),this.autoFreeze_&&Py(o,!0),a){const u=[],l=[];so(yg).generateReplacementPatches_(r,o,{patches_:u,inversePatches_:l}),a(u,l)}return o}else ln(1,r)},this.produceWithPatches=(r,n)=>{if(as(r))return(l,...f)=>this.produceWithPatches(l,h=>r(h,...f));let a,o;return[this.produce(r,n,(l,f)=>{a=l,o=f}),a,o]},rv(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),rv(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),rv(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){fn(t)||ln(8),ui(t)&&(t=Hr(t));const r=Ww(this),n=jg(r,t,void 0);return n[lr].isManual_=!0,bg(r),n}finishDraft(t,r){const n=t&&t[lr];(!n||!n.isManual_)&&ln(9);const{scope_:a}=n;return Uw(a,r),Hw(void 0,a)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const a=so(yg).applyPatches_;return ui(t)?a(t,r):this.produce(t,o=>a(o,r))}};function jg(e,t,r,n){const[a,o]=ph(t)?so(pf).proxyMap_(t,r):mh(t)?so(pf).proxySet_(t,r):KR(t,r);return((r==null?void 0:r.scope_)??$E()).drafts_.push(a),o.callbacks_=(r==null?void 0:r.callbacks_)??[],o.key_=n,r&&n!==void 0?WR(r,o,n):o.callbacks_.push(function(f){var p;(p=f.mapSetPlugin_)==null||p.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),a}function Hr(e){return ui(e)||ln(10,e),UE(e)}function UE(e){if(!fn(e)||vh(e))return e;const t=e[lr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=gg(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=gg(e,!0);return fh(r,(a,o)=>{hf(r,a,UE(o))},n),t&&(t.finalized_=!1),r}var qR=new GR,WE=qR.produce;function HE(e){return({dispatch:r,getState:n})=>a=>o=>typeof o=="function"?o(r,n,e):a(o)}var QR=HE(),YR=HE,XR=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?cf:cf.apply(null,arguments)};function Mr(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(_r(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>IE(n)&&n.type===e,r}var KE=class ou extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,ou.prototype)}static get[Symbol.species](){return ou}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new ou(...t[0].concat(this)):new ou(...t.concat(this))}};function Vw(e){return fn(e)?WE(e,()=>{}):e}function Id(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function ZR(e){return typeof e=="boolean"}var JR=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=t??{};let u=new KE;return r&&(ZR(r)?u.push(QR):u.push(YR(r.extraArgument))),u},VE="RTK_autoBatch",at=()=>e=>({payload:e,meta:{[VE]:!0}}),Gw=e=>t=>{setTimeout(t,e)},e$=(e,t)=>r=>{let n=!1;const a=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(u),r())},o=e(a),u=setTimeout(a,t)},GE=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let a=!0,o=!1,u=!1;const l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?e$(window.requestAnimationFrame,100):Gw(10):e.type==="callback"?e.queueNotification:Gw(e.timeout),h=()=>{u=!1,o&&(o=!1,l.forEach(p=>p()))};return Object.assign({},n,{subscribe(p){const v=()=>a&&p(),x=n.subscribe(v);return l.add(p),()=>{x(),l.delete(p)}},dispatch(p){var v;try{return a=!((v=p==null?void 0:p.meta)!=null&&v[VE]),o=!a,o&&(u||(u=!0,f(h))),n.dispatch(p)}finally{a=!0}}})},t$=e=>function(r){const{autoBatch:n=!0}=r??{};let a=new KE(e);return n&&a.push(GE(typeof n=="object"?n:void 0)),a};function r$(e){const t=JR(),{reducer:r=void 0,middleware:n,devTools:a=!0,preloadedState:o=void 0,enhancers:u=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Sy(r))l=ME(r);else throw new Error(_r(1));let f;typeof n=="function"?f=n(t):f=t();let h=cf;a&&(h=XR({trace:!1,...typeof a=="object"&&a}));const p=TR(...f),v=t$(p);let x=typeof u=="function"?u(v):v();const b=h(...x);return _E(l,o,b)}function qE(e){const t={},r=[];let n;const a={addCase(o,u){const l=typeof o=="string"?o:o.type;if(!l)throw new Error(_r(28));if(l in t)throw new Error(_r(29));return t[l]=u,a},addAsyncThunk(o,u){return u.pending&&(t[o.pending.type]=u.pending),u.rejected&&(t[o.rejected.type]=u.rejected),u.fulfilled&&(t[o.fulfilled.type]=u.fulfilled),u.settled&&r.push({matcher:o.settled,reducer:u.settled}),a},addMatcher(o,u){return r.push({matcher:o,reducer:u}),a},addDefaultCase(o){return n=o,a}};return e(a),[t,r,n]}function n$(e){return typeof e=="function"}function i$(e,t){let[r,n,a]=qE(t),o;if(n$(e))o=()=>Vw(e());else{const l=Vw(e);o=()=>l}function u(l=o(),f){let h=[r[f.type],...n.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[a]),h.reduce((p,v)=>{if(v)if(ui(p)){const b=v(p,f);return b===void 0?p:b}else{if(fn(p))return WE(p,x=>v(x,f));{const x=v(p,f);if(x===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return p},l)}return u.getInitialState=o,u}var a$="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",o$=(e=21)=>{let t="",r=e;for(;r--;)t+=a$[Math.random()*64|0];return t},s$=Symbol.for("rtk-slice-createasyncthunk");function l$(e,t){return`${e}/${t}`}function u$({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[s$];return function(a){const{name:o,reducerPath:u=o}=a;if(!o)throw new Error(_r(11));const l=(typeof a.reducers=="function"?a.reducers(d$()):a.reducers)||{},f=Object.keys(l),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(C,_){const A=typeof C=="string"?C:C.type;if(!A)throw new Error(_r(12));if(A in h.sliceCaseReducersByType)throw new Error(_r(13));return h.sliceCaseReducersByType[A]=_,p},addMatcher(C,_){return h.sliceMatchers.push({matcher:C,reducer:_}),p},exposeAction(C,_){return h.actionCreators[C]=_,p},exposeCaseReducer(C,_){return h.sliceCaseReducersByName[C]=_,p}};f.forEach(C=>{const _=l[C],A={reducerName:C,type:l$(o,C),createNotation:typeof a.reducers=="function"};h$(_)?m$(A,_,p,t):f$(A,_,p)});function v(){const[C={},_=[],A=void 0]=typeof a.extraReducers=="function"?qE(a.extraReducers):[a.extraReducers],I={...C,...h.sliceCaseReducersByType};return i$(a.initialState,U=>{for(let B in I)U.addCase(B,I[B]);for(let B of h.sliceMatchers)U.addMatcher(B.matcher,B.reducer);for(let B of _)U.addMatcher(B.matcher,B.reducer);A&&U.addDefaultCase(A)})}const x=C=>C,b=new Map,j=new WeakMap;let k;function S(C,_){return k||(k=v()),k(C,_)}function N(){return k||(k=v()),k.getInitialState()}function P(C,_=!1){function A(U){let B=U[C];return typeof B>"u"&&_&&(B=Id(j,A,N)),B}function I(U=x){const B=Id(b,_,()=>new WeakMap);return Id(B,U,()=>{const V={};for(const[q,R]of Object.entries(a.selectors??{}))V[q]=c$(R,U,()=>Id(j,U,N),_);return V})}return{reducerPath:C,getSelectors:I,get selectors(){return I(A)},selectSlice:A}}const O={name:o,reducer:S,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:N,...P(u),injectInto(C,{reducerPath:_,...A}={}){const I=_??u;return C.inject({reducerPath:I,reducer:S},A),{...O,...P(I,!0)}}};return O}}function c$(e,t,r,n){function a(o,...u){let l=t(o);return typeof l>"u"&&n&&(l=r()),e(l,...u)}return a.unwrapped=e,a}var rr=u$();function d$(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function f$({type:e,reducerName:t,createNotation:r},n,a){let o,u;if("reducer"in n){if(r&&!p$(n))throw new Error(_r(17));o=n.reducer,u=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,u?Mr(e,u):Mr(e))}function h$(e){return e._reducerDefinitionType==="asyncThunk"}function p$(e){return e._reducerDefinitionType==="reducerWithPrepare"}function m$({type:e,reducerName:t},r,n,a){if(!a)throw new Error(_r(18));const{payloadCreator:o,fulfilled:u,pending:l,rejected:f,settled:h,options:p}=r,v=a(e,o,p);n.exposeAction(t,v),u&&n.addCase(v.fulfilled,u),l&&n.addCase(v.pending,l),f&&n.addCase(v.rejected,f),h&&n.addMatcher(v.settled,h),n.exposeCaseReducer(t,{fulfilled:u||Td,pending:l||Td,rejected:f||Td,settled:h||Td})}function Td(){}var v$="task",QE="listener",YE="completed",Cy="cancelled",g$=`task-${Cy}`,y$=`task-${YE}`,kg=`${QE}-${Cy}`,x$=`${QE}-${YE}`,yh=class{constructor(e){yd(this,"code");yd(this,"name","TaskAbortError");yd(this,"message");this.code=e,this.message=`${v$} ${Cy} (reason: ${e})`}},Ay=(e,t)=>{if(typeof e!="function")throw new TypeError(_r(32))},gf=()=>{},XE=(e,t=gf)=>(e.catch(t),e),ZE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),eo=e=>{if(e.aborted)throw new yh(e.reason)};function JE(e,t){let r=gf;return new Promise((n,a)=>{const o=()=>a(new yh(e.reason));if(e.aborted){o();return}r=ZE(e,o),t.finally(()=>r()).then(n,a)}).finally(()=>{r=gf})}var b$=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof yh?"cancelled":"rejected",error:r}}finally{t==null||t()}},yf=e=>t=>XE(JE(e,t).then(r=>(eo(e),r))),eP=e=>{const t=yf(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ds}=Object,qw={},xh="listenerMiddleware",w$=(e,t)=>{const r=n=>ZE(e,()=>n.abort(e.reason));return(n,a)=>{Ay(n);const o=new AbortController;r(o);const u=b$(async()=>{eo(e),eo(o.signal);const l=await n({pause:yf(o.signal),delay:eP(o.signal),signal:o.signal});return eo(o.signal),l},()=>o.abort(y$));return a!=null&&a.autoJoin&&t.push(u.catch(gf)),{result:yf(e)(u),cancel(){o.abort(g$)}}}},j$=(e,t)=>{const r=async(n,a)=>{eo(t);let o=()=>{};const l=[new Promise((f,h)=>{let p=e({predicate:n,effect:(v,x)=>{x.unsubscribe(),f([v,x.getState(),x.getOriginalState()])}});o=()=>{p(),h()}})];a!=null&&l.push(new Promise(f=>setTimeout(f,a,null)));try{const f=await JE(t,Promise.race(l));return eo(t),f}finally{o()}};return((n,a)=>XE(r(n,a)))},tP=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:o}=e;if(t)a=Mr(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(_r(21));return Ay(o),{predicate:a,type:t,effect:o}},rP=ds(e=>{const{type:t,predicate:r,effect:n}=tP(e);return{id:o$(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(_r(22))}}},{withTypes:()=>rP}),Qw=(e,t)=>{const{type:r,effect:n,predicate:a}=tP(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===a)&&o.effect===n)},Sg=e=>{e.pending.forEach(t=>{t.abort(kg)})},k$=(e,t)=>()=>{for(const r of t.keys())Sg(r);e.clear()},Yw=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},nP=ds(Mr(`${xh}/add`),{withTypes:()=>nP}),S$=Mr(`${xh}/removeAll`),iP=ds(Mr(`${xh}/remove`),{withTypes:()=>iP}),N$=(...e)=>{console.error(`${xh}/error`,...e)},qu=(e={})=>{const t=new Map,r=new Map,n=b=>{const j=r.get(b)??0;r.set(b,j+1)},a=b=>{const j=r.get(b)??1;j===1?r.delete(b):r.set(b,j-1)},{extra:o,onError:u=N$}=e;Ay(u);const l=b=>(b.unsubscribe=()=>t.delete(b.id),t.set(b.id,b),j=>{b.unsubscribe(),j!=null&&j.cancelActive&&Sg(b)}),f=(b=>{const j=Qw(t,b)??rP(b);return l(j)});ds(f,{withTypes:()=>f});const h=b=>{const j=Qw(t,b);return j&&(j.unsubscribe(),b.cancelActive&&Sg(j)),!!j};ds(h,{withTypes:()=>h});const p=async(b,j,k,S)=>{const N=new AbortController,P=j$(f,N.signal),O=[];try{b.pending.add(N),n(b),await Promise.resolve(b.effect(j,ds({},k,{getOriginalState:S,condition:(C,_)=>P(C,_).then(Boolean),take:P,delay:eP(N.signal),pause:yf(N.signal),extra:o,signal:N.signal,fork:w$(N.signal,O),unsubscribe:b.unsubscribe,subscribe:()=>{t.set(b.id,b)},cancelActiveListeners:()=>{b.pending.forEach((C,_,A)=>{C!==N&&(C.abort(kg),A.delete(C))})},cancel:()=>{N.abort(kg),b.pending.delete(N)},throwIfCancelled:()=>{eo(N.signal)}})))}catch(C){C instanceof yh||Yw(u,C,{raisedBy:"effect"})}finally{await Promise.all(O),N.abort(x$),a(b),b.pending.delete(N)}},v=k$(t,r);return{middleware:b=>j=>k=>{if(!IE(k))return j(k);if(nP.match(k))return f(k.payload);if(S$.match(k)){v();return}if(iP.match(k))return h(k.payload);let S=b.getState();const N=()=>{if(S===qw)throw new Error(_r(23));return S};let P;try{if(P=j(k),t.size>0){const O=b.getState(),C=Array.from(t.values());for(const _ of C){let A=!1;try{A=_.predicate(k,O,S)}catch(I){A=!1,Yw(u,I,{raisedBy:"predicate"})}A&&p(_,k,b,N)}}}finally{S=qw}return P},startListening:f,stopListening:h,clearListeners:v}};function _r(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 E$={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},aP=rr({name:"chartLayout",initialState:E$,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 r,n,a,o;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(a=t.payload.bottom)!==null&&a!==void 0?a:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),bh=aP.actions,P$=bh.setMargin,C$=bh.setLayout,A$=bh.setChartSize,O$=bh.setScale,_$=aP.reducer;function oP(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Be(e){return Number.isFinite(e)}function Rn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Xw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function os(e){for(var t=1;t{if(t&&r){var n=r.width,a=r.height,o=t.align,u=t.verticalAlign,l=t.layout;if((l==="vertical"||l==="horizontal"&&u==="middle")&&o!=="center"&&Ne(e[o]))return os(os({},e),{},{[o]:e[o]+(n||0)});if((l==="horizontal"||l==="vertical"&&o==="center")&&u!=="middle"&&Ne(e[u]))return os(os({},e),{},{[u]:e[u]+(a||0)})}return e},zn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",sP=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var a,o,u=e.map(l=>(l.coordinate===t&&(a=!0),l.coordinate===r&&(o=!0),l.coordinate));return a||u.push(t),o||u.push(r),u},lP=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,a=e.type,o=e.range,u=e.scale,l=e.realScaleType,f=e.isCategorical,h=e.categoricalDomain,p=e.tickCount,v=e.ticks,x=e.niceTicks,b=e.axisType;if(!u)return null;var j=l==="scaleBand"&&u.bandwidth?u.bandwidth()/2:2,k=a==="category"&&u.bandwidth?u.bandwidth()/j:0;if(k=b==="angleAxis"&&o&&o.length>=2?Wr(o[0]-o[1])*2*k:k,v||x){var S=(v||x||[]).map((N,P)=>{var O=n?n.indexOf(N):N,C=u.map(O);return Be(C)?{coordinate:C+k,value:N,offset:k,index:P}:null}).filter(yr);return S}return f&&h?h.map((N,P)=>{var O=u.map(N);return Be(O)?{coordinate:O+k,value:N,index:P,offset:k}:null}).filter(yr):u.ticks&&p!=null?u.ticks(p).map((N,P)=>{var O=u.map(N);return Be(O)?{coordinate:O+k,value:N,index:P,offset:k}:null}).filter(yr):u.domain().map((N,P)=>{var O=u.map(N);return Be(O)?{coordinate:O+k,value:n?n[N]:N,index:P,offset:k}:null}).filter(yr)},R$=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var a=0;a=0?(h[0]=o,o+=x,h[1]=o):(h[0]=u,u+=x,h[1]=u)}}}},$$=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var a=0;a=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},L$={sign:R$,expand:eD,none:ao,silhouette:tD,wiggle:rD,positive:$$},z$=(e,t,r)=>{var n,a=(n=L$[r])!==null&&n!==void 0?n:ao,o=J4().keys(t).value((l,f)=>Number(Tt(l,f,0))).order(cg).offset(a),u=o(e);return u.forEach((l,f)=>{l.forEach((h,p)=>{var v=Tt(e[p],t[f],0);Array.isArray(v)&&v.length===2&&Ne(v[0])&&Ne(v[1])&&(h[0]=v[0],h[1]=v[1])})}),u};function F$(e){return e==null?void 0:String(e)}function Zw(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,o=e.index,u=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Kt(a[t.dataKey])){var l=pE(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r!=null&&r[o]?r[o].coordinate+n/2:null}var f=Tt(a,Kt(u)?t.dataKey:u),h=t.scale.map(f);return Ne(h)?h:null}var B$=e=>{var t=e.flat(2).filter(Ne);return[Math.min(...t),Math.max(...t)]},U$=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],W$=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return U$(Object.keys(e).reduce((n,a)=>{var o=e[a];if(!o)return n;var u=o.stackedData,l=u.reduce((f,h)=>{var p=oP(h,t,r),v=B$(p);return!Be(v[0])||!Be(v[1])?f:[Math.min(f[0],v[0]),Math.max(f[1],v[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},Jw=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ej=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xf=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var a=ch(t,p=>p.coordinate),o=1/0,u=1,l=a.length;u{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},K$=(e,t)=>t==="centric"?e.angle:e.radius,hi=e=>e.layout.width,pi=e=>e.layout.height,V$=e=>e.layout.scale,cP=e=>e.layout.margin,wh=K(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),jh=K(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),G$="data-recharts-item-index",q$="data-recharts-item-id",Qu=60;function rj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Dd(e){for(var t=1;te.brush.height;function J$(e){var t=jh(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var a=typeof n.width=="number"?n.width:Qu;return r+a}return r},0)}function eL(e){var t=jh(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var a=typeof n.width=="number"?n.width:Qu;return r+a}return r},0)}function tL(e){var t=wh(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function rL(e){var t=wh(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Gt=K([hi,pi,cP,Z$,J$,eL,tL,rL,OE,kR],(e,t,r,n,a,o,u,l,f,h)=>{var p={left:(r.left||0)+a,right:(r.right||0)+o},v={top:(r.top||0)+u,bottom:(r.bottom||0)+l},x=Dd(Dd({},v),p),b=x.bottom;x.bottom+=n,x=D$(x,f,h);var j=e-x.left-x.right,k=t-x.top-x.bottom;return Dd(Dd({brushBottom:b},x),{},{width:Math.max(j,0),height:Math.max(k,0)})}),nL=K(Gt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),dP=K(hi,pi,(e,t)=>({x:0,y:0,width:e,height:t})),iL=y.createContext(null),wr=()=>y.useContext(iL)!=null,kh=e=>e.brush,Sh=K([kh,Gt,cP],(e,t,r)=>({height:e.height,x:Ne(e.x)?e.x:t.left,y:Ne(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ne(e.width)?e.width:t.width}));function aL(e,t,{signal:r,edges:n}={}){let a,o=null;const u=n!=null&&n.includes("leading"),l=n==null||n.includes("trailing"),f=()=>{o!==null&&(e.apply(a,o),a=void 0,o=null)},h=()=>{l&&f(),b()};let p=null;const v=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,h()},t)},x=()=>{p!==null&&(clearTimeout(p),p=null)},b=()=>{x(),a=void 0,o=null},j=()=>{f()},k=function(...S){if(r!=null&&r.aborted)return;a=this,o=S;const N=p==null;v(),u&&N&&f()};return k.schedule=v,k.cancel=b,k.flush=j,r==null||r.addEventListener("abort",b,{once:!0}),k}function oL(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:a=!0,maxWait:o}=r,u=Array(2);n&&(u[0]="leading"),a&&(u[1]="trailing");let l,f=null;const h=aL(function(...x){l=e.apply(this,x),f=null},t,{edges:u}),p=function(...x){return o!=null&&(f===null&&(f=Date.now()),Date.now()-f>=o)?(l=e.apply(this,x),f=Date.now(),h.cancel(),h.schedule(),l):(h.apply(this,x),l)},v=()=>(h.flush(),l);return p.cancel=h.cancel,p.flush=v,p}function sL(e,t=0,r={}){const{leading:n=!0,trailing:a=!0}=r;return oL(e,t,{leading:n,maxWait:t,trailing:a})}var bf=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),o=2;oa[u++]))}},An={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},fP=(e,t,r)=>{var n=r.width,a=n===void 0?An.width:n,o=r.height,u=o===void 0?An.height:o,l=r.aspect,f=r.maxHeight,h=oo(a)?e:Number(a),p=oo(u)?t:Number(u);return l&&l>0&&(h?p=h/l:p&&(h=p*l),f&&p!=null&&p>f&&(p=f)),{calculatedWidth:h,calculatedHeight:p}},lL={width:0,height:0,overflow:"visible"},uL={width:0,overflowX:"visible"},cL={height:0,overflowY:"visible"},dL={},fL=e=>{var t=e.width,r=e.height,n=oo(t),a=oo(r);return n&&a?lL:n?uL:a?cL:dL};function hL(e){var t=e.width,r=e.height,n=e.aspect,a=t,o=r;return a===void 0&&o===void 0?(a=An.width,o=An.height):a===void 0?a=n&&n>0?void 0:An.width:o===void 0&&(o=n&&n>0?void 0:An.height),{width:a,height:o}}var pL=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return NL(a)?y.createElement(hP.Provider,{value:a},t):null}var Oy=()=>y.useContext(hP),EL=y.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,a=n===void 0?An.initialDimension:n,o=e.width,u=e.height,l=e.minWidth,f=l===void 0?An.minWidth:l,h=e.minHeight,p=e.maxHeight,v=e.children,x=e.debounce,b=x===void 0?An.debounce:x,j=e.id,k=e.className,S=e.onResize,N=e.style,P=N===void 0?{}:N,O=kL(e,pL),C=y.useRef(null),_=y.useRef();_.current=S,y.useImperativeHandle(t,()=>C.current);var A=y.useState({containerWidth:a.width,containerHeight:a.height}),I=yL(A,2),U=I[0],B=I[1],V=y.useCallback((je,me)=>{B(Q=>{var oe=Math.round(je),X=Math.round(me);return Q.containerWidth===oe&&Q.containerHeight===X?Q:{containerWidth:oe,containerHeight:X}})},[]);y.useEffect(()=>{if(C.current==null||typeof ResizeObserver>"u")return Us;var je=$=>{var T,ee=$[0];if(ee!=null){var ne=ee.contentRect,te=ne.width,ue=ne.height;V(te,ue),(T=_.current)===null||T===void 0||T.call(_,te,ue)}};b>0&&(je=sL(je,b,{trailing:!0,leading:!1}));var me=new ResizeObserver(je),Q=C.current.getBoundingClientRect(),oe=Q.width,X=Q.height;return V(oe,X),me.observe(C.current),()=>{me.disconnect()}},[V,b]);var q=U.containerWidth,R=U.containerHeight;bf(!r||r>0,"The aspect(%s) must be greater than zero.",r);var de=fP(q,R,{width:o,height:u,aspect:r,maxHeight:p}),Z=de.calculatedWidth,ge=de.calculatedHeight;return bf(q<0||R<0||Z!=null&&Z>0||ge!=null&&ge>0,`The width(%s) and height(%s) of chart should be greater than 0, + */var Cw;function oR(){if(Cw)return Zm;Cw=1;var e=Fs(),t=aR();function r(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var n=typeof Object.is=="function"?Object.is:r,a=t.useSyncExternalStore,o=e.useRef,u=e.useEffect,l=e.useMemo,f=e.useDebugValue;return Zm.useSyncExternalStoreWithSelector=function(h,p,v,x,b){var k=o(null);if(k.current===null){var j={hasValue:!1,value:null};k.current=j}else j=k.current;k=l(function(){function N(A){if(!P){if(P=!0,O=A,A=x(A),b!==void 0&&j.hasValue){var I=j.value;if(b(I,A))return C=I}return C=A}if(I=C,n(O,A))return I;var $=x(A);return b!==void 0&&b(I,$)?(O=A,I):(O=A,C=$)}var P=!1,O,C,_=v===void 0?null:v;return[function(){return N(p())},_===null?void 0:function(){return N(_())}]},[p,v,x,b]);var S=a(h,k[0],k[1]);return u(function(){j.hasValue=!0,j.value=S},[S]),f(S),S},Zm}var Aw;function sR(){return Aw||(Aw=1,Xm.exports=oR()),Xm.exports}var lR=sR(),jy=y.createContext(null),uR=e=>e,kt=()=>{var e=y.useContext(jy);return e?e.store.dispatch:uR},Yd=()=>{},cR=()=>Yd,dR=(e,t)=>e===t;function Ae(e){var t=y.useContext(jy),r=y.useMemo(()=>t?n=>{if(n!=null)return e(n)}:Yd,[t,e]);return lR.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:cR,t?t.store.getState:Yd,t?t.store.getState:Yd,r,dR)}function fR(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hR(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var Ow=e=>Array.isArray(e)?e:[e];function pR(e){const t=Array.isArray(e[0])?e[0]:e;return hR(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function mR(e,t){const r=[],{length:n}=e;for(let a=0;atypeof WeakRef>"u"?vR:WeakRef,CE=gR(),yR=0,_w=1;function Od(){return{s:yR,v:void 0,o:null,p:null}}function xR(e){return e instanceof CE?e.deref():e}function AE(e,t={}){let r=Od();const{resultEqualityCheck:n}=t;let a,o=0;function u(){let l=r;const{length:f}=arguments;for(let v=0,x=f;v{r=Od(),u.resetResultsCount()},u.resultsCount=()=>o,u.resetResultsCount=()=>{o=0},u}function bR(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...a)=>{let o=0,u=0,l,f={},h=a.pop();typeof h=="object"&&(f=h,h=a.pop()),fR(h,`createSelector expects an output function after the inputs, but received: [${typeof h}]`);const p={...r,...f},{memoize:v,memoizeOptions:x=[],argsMemoize:b=AE,argsMemoizeOptions:k=[]}=p,j=Ow(x),S=Ow(k),N=pR(a),P=v(function(){return o++,h.apply(null,arguments)},...j),O=b(function(){u++;const _=mR(N,arguments);return l=P.apply(null,_),l},...S);return Object.assign(O,{resultFunc:h,memoizedResultFunc:P,dependencies:N,dependencyRecomputations:()=>u,resetDependencyRecomputations:()=>{u=0},lastResult:()=>l,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:v,argsMemoize:b})};return Object.assign(n,{withTypes:()=>n}),n}var G=bR(AE);function wR(e,t=1){const r=[],n=Math.floor(t),a=(o,u)=>{for(let l=0;l{if(e!==t){const n=Mw(e),a=Mw(t);if(n===a&&n===0){if(et)return r==="desc"?-1:1}return r==="desc"?a-n:n-a}return 0};function OE(e){return typeof e=="symbol"||e instanceof Symbol}const jR=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SR=/^\w*$/;function NR(e,t){return Array.isArray(e)?!1:typeof e=="number"||typeof e=="boolean"||e==null||OE(e)?!0:typeof e=="string"&&(SR.test(e)||!jR.test(e))||t!=null}function ER(e,t,r,n){if(e==null)return[];r=r,Array.isArray(e)||(e=Object.values(e)),Array.isArray(t)||(t=t==null?[null]:[t]),t.length===0&&(t=[null]),Array.isArray(r)||(r=r==null?[]:[r]),r=r.map(l=>String(l));const a=(l,f)=>{let h=l;for(let p=0;pf==null||l==null?f:typeof l=="object"&&"key"in l?Object.hasOwn(f,l.key)?f[l.key]:a(f,l.path):typeof l=="function"?l(f):Array.isArray(l)?a(f,l):typeof f=="object"?f[l]:f,u=t.map(l=>(Array.isArray(l)&&l.length===1&&(l=l[0]),l==null||typeof l=="function"||Array.isArray(l)||NR(l)?l:{key:l,path:xy(l)}));return e.map(l=>({original:l,criteria:u.map(f=>o(f,l))})).slice().sort((l,f)=>{for(let h=0;hl.original)}function ch(e,...t){const r=t.length;return r>1&&pg(e,t[0],t[1])?t=[]:r>2&&pg(t[0],t[1],t[2])&&(t=[t[0]]),ER(e,wR(t),["asc"])}var _E=e=>e.legend.settings,PR=e=>e.legend.size,CR=e=>e.legend.payload;G([CR,_E],(e,t)=>{var r=t.itemSorter,n=e.flat(1);return r?ch(n,r):n});function AR(e,t){return IR(e)||MR(e,t)||_R(e,t)||OR()}function OR(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _R(e,t){if(e){if(typeof e=="string")return Iw(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Iw(e,t):void 0}}function Iw(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r_d||Math.abs(e.left-t.left)>_d||Math.abs(e.top-t.top)>_d||Math.abs(e.width-t.width)>_d}function Dw(e){var t=e.getBoundingClientRect();return{height:t.height,left:t.left,top:t.top,width:t.width}}function TR(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=y.useState({height:0,left:0,top:0,width:0}),r=AR(t,2),n=r[0],a=r[1],o=y.useRef(null),u=y.useRef(n);u.current=n;var l=y.useCallback(f=>{if(o.current!=null&&(o.current.disconnect(),o.current=null),f!=null){var h=Dw(f);if(Tw(h,u.current)&&a(h),typeof ResizeObserver<"u"){var p=new ResizeObserver(()=>{var v=Dw(f);Tw(v,u.current)&&a(v)});p.observe(f),o.current=p}}},[...e]);return y.useEffect(()=>()=>{var f;(f=o.current)===null||f===void 0||f.disconnect()},[]),[n,l]}function Ft(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 DR=typeof Symbol=="function"&&Symbol.observable||"@@observable",Rw=DR,tv=()=>Math.random().toString(36).substring(7).split("").join("."),RR={INIT:`@@redux/INIT${tv()}`,REPLACE:`@@redux/REPLACE${tv()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${tv()}`},uf=RR;function Sy(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 ME(e,t,r){if(typeof e!="function")throw new Error(Ft(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Ft(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Ft(1));return r(ME)(e,t)}let n=e,a=t,o=new Map,u=o,l=0,f=!1;function h(){u===o&&(u=new Map,o.forEach((S,N)=>{u.set(N,S)}))}function p(){if(f)throw new Error(Ft(3));return a}function v(S){if(typeof S!="function")throw new Error(Ft(4));if(f)throw new Error(Ft(5));let N=!0;h();const P=l++;return u.set(P,S),function(){if(N){if(f)throw new Error(Ft(6));N=!1,h(),u.delete(P),o=null}}}function x(S){if(!Sy(S))throw new Error(Ft(7));if(typeof S.type>"u")throw new Error(Ft(8));if(typeof S.type!="string")throw new Error(Ft(17));if(f)throw new Error(Ft(9));try{f=!0,a=n(a,S)}finally{f=!1}return(o=u).forEach(P=>{P()}),S}function b(S){if(typeof S!="function")throw new Error(Ft(10));n=S,x({type:uf.REPLACE})}function k(){const S=v;return{subscribe(N){if(typeof N!="object"||N===null)throw new Error(Ft(11));function P(){const C=N;C.next&&C.next(p())}return P(),{unsubscribe:S(P)}},[Rw](){return this}}}return x({type:uf.INIT}),{dispatch:x,subscribe:v,getState:p,replaceReducer:b,[Rw]:k}}function $R(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:uf.INIT})>"u")throw new Error(Ft(12));if(typeof r(void 0,{type:uf.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Ft(13))})}function IE(e){const t=Object.keys(e),r={};for(let o=0;o"u")throw l&&l.type,new Error(Ft(14));h[v]=k,f=f||k!==b}return f=f||n.length!==Object.keys(u).length,f?h:u}}function cf(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function LR(...e){return t=>(r,n)=>{const a=t(r,n);let o=()=>{throw new Error(Ft(15))};const u={getState:a.getState,dispatch:(f,...h)=>o(f,...h)},l=e.map(f=>f(u));return o=cf(...l)(a.dispatch),{...a,dispatch:o}}}function TE(e){return Sy(e)&&"type"in e&&typeof e.type=="string"}var DE=Symbol.for("immer-nothing"),$w=Symbol.for("immer-draftable"),lr=Symbol.for("immer-state");function ln(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Or=Object,Ms=Or.getPrototypeOf,df="constructor",dh="prototype",mg="configurable",ff="enumerable",Xd="writable",Eu="value",ui=e=>!!e&&!!e[lr];function fn(e){var t;return e?RE(e)||hh(e)||!!e[$w]||!!((t=e[df])!=null&&t[$w])||ph(e)||mh(e):!1}var zR=Or[dh][df].toString(),Lw=new WeakMap;function RE(e){if(!e||!Ny(e))return!1;const t=Ms(e);if(t===null||t===Or[dh])return!0;const r=Or.hasOwnProperty.call(t,df)&&t[df];if(r===Object)return!0;if(!as(r))return!1;let n=Lw.get(r);return n===void 0&&(n=Function.toString.call(r),Lw.set(r,n)),n===zR}function fh(e,t,r=!0){qu(e)===0?(r?Reflect.ownKeys(e):Or.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function qu(e){const t=e[lr];return t?t.type_:hh(e)?1:ph(e)?2:mh(e)?3:0}var zw=(e,t,r=qu(e))=>r===2?e.has(t):Or[dh].hasOwnProperty.call(e,t),vg=(e,t,r=qu(e))=>r===2?e.get(t):e[t],hf=(e,t,r,n=qu(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function FR(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var hh=Array.isArray,ph=e=>e instanceof Map,mh=e=>e instanceof Set,Ny=e=>typeof e=="object",as=e=>typeof e=="function",rv=e=>typeof e=="boolean";function BR(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Jn=e=>e.copy_||e.base_,Ey=e=>e.modified_?e.copy_:e.base_;function gg(e,t){if(ph(e))return new Map(e);if(mh(e))return new Set(e);if(hh(e))return Array[dh].slice.call(e);const r=RE(e);if(t===!0||t==="class_only"&&!r){const n=Or.getOwnPropertyDescriptors(e);delete n[lr];let a=Reflect.ownKeys(n);for(let o=0;o1&&Or.defineProperties(e,{set:Md,add:Md,clear:Md,delete:Md}),Or.freeze(e),t&&fh(e,(r,n)=>{Py(n,!0)},!1)),e}function UR(){ln(2)}var Md={[Eu]:UR};function vh(e){return e===null||!Ny(e)?!0:Or.isFrozen(e)}var pf="MapSet",yg="Patches",Fw="ArrayMethods",$E={};function so(e){const t=$E[e];return t||ln(0,e),t}var Bw=e=>!!$E[e],Pu,LE=()=>Pu,WR=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:Bw(pf)?so(pf):void 0,arrayMethodsPlugin_:Bw(Fw)?so(Fw):void 0});function Uw(e,t){t&&(e.patchPlugin_=so(yg),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function xg(e){bg(e),e.drafts_.forEach(HR),e.drafts_=null}function bg(e){e===Pu&&(Pu=e.parent_)}var Ww=e=>Pu=WR(Pu,e);function HR(e){const t=e[lr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function Hw(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[lr].modified_&&(xg(t),ln(4)),fn(e)&&(e=Kw(t,e));const{patchPlugin_:a}=t;a&&a.generateReplacementPatches_(r[lr].base_,e,t)}else e=Kw(t,r);return KR(t,e,!0),xg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==DE?e:void 0}function Kw(e,t){if(vh(t))return t;const r=t[lr];if(!r)return mf(t,e.handledSet_,e);if(!gh(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);BE(r,e)}return r.copy_}function KR(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Py(t,r)}function zE(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var gh=(e,t)=>e.scope_===t,GR=[];function FE(e,t,r,n){const a=Jn(e),o=e.type_;if(n!==void 0&&vg(a,n,o)===t){hf(a,n,r,o);return}if(!e.draftLocations_){const l=e.draftLocations_=new Map;fh(a,(f,h)=>{if(ui(h)){const p=l.get(h)||[];p.push(f),l.set(h,p)}})}const u=e.draftLocations_.get(t)??GR;for(const l of u)hf(a,l,r,o)}function VR(e,t,r){e.callbacks_.push(function(a){var l;const o=t;if(!o||!gh(o,a))return;(l=a.mapSetPlugin_)==null||l.fixSetContents(o);const u=Ey(o);FE(e,o.draft_??o,u,r),BE(o,a)})}function BE(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:a}=t;if(a){const o=a.getPath(e);o&&a.generatePatches_(e,o,t)}zE(e)}}function qR(e,t,r){const{scope_:n}=e;if(ui(r)){const a=r[lr];gh(a,n)&&a.callbacks_.push(function(){Zd(e);const u=Ey(a);FE(e,r,u,t)})}else fn(r)&&e.callbacks_.push(function(){const o=Jn(e);e.type_===3?o.has(r)&&mf(r,n.handledSet_,n):vg(o,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&mf(vg(e.copy_,t,e.type_),n.handledSet_,n)})}function mf(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||ui(e)||t.has(e)||!fn(e)||vh(e)||(t.add(e),fh(e,(n,a)=>{if(ui(a)){const o=a[lr];if(gh(o,r)){const u=Ey(o);hf(e,n,u,e.type_),zE(o)}}else fn(a)&&mf(a,t,r)})),e}function QR(e,t){const r=hh(e),n={type_:r?1:0,scope_:t?t.scope_:LE(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=n,o=vf;r&&(a=[n],o=Cu);const{revoke:u,proxy:l}=Proxy.revocable(a,o);return n.draft_=l,n.revoke_=u,[l,n]}var vf={get(e,t){if(t===lr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const a=Jn(e);if(!zw(a,t,e.type_))return YR(e,a,t);const o=a[t];if(e.finalized_||!fn(o)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&BR(t))return o;if(o===nv(e.base_,t)){Zd(e);const u=e.type_===1?+t:t,l=kg(e.scope_,o,e,u);return e.copy_[u]=l}return o},has(e,t){return t in Jn(e)},ownKeys(e){return Reflect.ownKeys(Jn(e))},set(e,t,r){const n=UE(Jn(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=nv(Jn(e),t),o=a==null?void 0:a[lr];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(FR(r,a)&&(r!==void 0||zw(e.base_,t,e.type_)))return!0;Zd(e),wg(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),qR(e,t,r)),!0},deleteProperty(e,t){return Zd(e),nv(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),wg(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Jn(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Xd]:!0,[mg]:e.type_!==1||t!=="length",[ff]:n[ff],[Eu]:r[t]}},defineProperty(){ln(11)},getPrototypeOf(e){return Ms(e.base_)},setPrototypeOf(){ln(12)}},Cu={};for(let e in vf){let t=vf[e];Cu[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}Cu.deleteProperty=function(e,t){return Cu.set.call(this,e,t,void 0)};Cu.set=function(e,t,r){return vf.set.call(this,e[0],t,r,e[0])};function nv(e,t){const r=e[lr];return(r?Jn(r):e)[t]}function YR(e,t,r){var a;const n=UE(t,r);return n?Eu in n?n[Eu]:(a=n.get)==null?void 0:a.call(e.draft_):void 0}function UE(e,t){if(!(t in e))return;let r=Ms(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Ms(r)}}function wg(e){e.modified_||(e.modified_=!0,e.parent_&&wg(e.parent_))}function Zd(e){e.copy_||(e.assigned_=new Map,e.copy_=gg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var XR=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,a)=>{if(as(r)&&!as(n)){const u=n;n=r;const l=this;return function(h=u,...p){return l.produce(h,v=>n.call(this,v,...p))}}as(n)||ln(6),a!==void 0&&!as(a)&&ln(7);let o;if(fn(r)){const u=Ww(this),l=kg(u,r,void 0);let f=!0;try{o=n(l),f=!1}finally{f?xg(u):bg(u)}return Uw(u,a),Hw(o,u)}else if(!r||!Ny(r)){if(o=n(r),o===void 0&&(o=r),o===DE&&(o=void 0),this.autoFreeze_&&Py(o,!0),a){const u=[],l=[];so(yg).generateReplacementPatches_(r,o,{patches_:u,inversePatches_:l}),a(u,l)}return o}else ln(1,r)},this.produceWithPatches=(r,n)=>{if(as(r))return(l,...f)=>this.produceWithPatches(l,h=>r(h,...f));let a,o;return[this.produce(r,n,(l,f)=>{a=l,o=f}),a,o]},rv(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),rv(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),rv(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){fn(t)||ln(8),ui(t)&&(t=Hr(t));const r=Ww(this),n=kg(r,t,void 0);return n[lr].isManual_=!0,bg(r),n}finishDraft(t,r){const n=t&&t[lr];(!n||!n.isManual_)&&ln(9);const{scope_:a}=n;return Uw(a,r),Hw(void 0,a)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const o=r[n];if(o.path.length===0&&o.op==="replace"){t=o.value;break}}n>-1&&(r=r.slice(n+1));const a=so(yg).applyPatches_;return ui(t)?a(t,r):this.produce(t,o=>a(o,r))}};function kg(e,t,r,n){const[a,o]=ph(t)?so(pf).proxyMap_(t,r):mh(t)?so(pf).proxySet_(t,r):QR(t,r);return((r==null?void 0:r.scope_)??LE()).drafts_.push(a),o.callbacks_=(r==null?void 0:r.callbacks_)??[],o.key_=n,r&&n!==void 0?VR(r,o,n):o.callbacks_.push(function(f){var p;(p=f.mapSetPlugin_)==null||p.fixSetContents(o);const{patchPlugin_:h}=f;o.modified_&&h&&h.generatePatches_(o,[],f)}),a}function Hr(e){return ui(e)||ln(10,e),WE(e)}function WE(e){if(!fn(e)||vh(e))return e;const t=e[lr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=gg(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=gg(e,!0);return fh(r,(a,o)=>{hf(r,a,WE(o))},n),t&&(t.finalized_=!1),r}var ZR=new XR,HE=ZR.produce;function KE(e){return({dispatch:r,getState:n})=>a=>o=>typeof o=="function"?o(r,n,e):a(o)}var JR=KE(),e$=KE,t$=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?cf:cf.apply(null,arguments)};function Mr(e,t){function r(...n){if(t){let a=t(...n);if(!a)throw new Error(_r(0));return{type:e,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>TE(n)&&n.type===e,r}var GE=class su extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,su.prototype)}static get[Symbol.species](){return su}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new su(...t[0].concat(this)):new su(...t.concat(this))}};function Gw(e){return fn(e)?HE(e,()=>{}):e}function Id(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function r$(e){return typeof e=="boolean"}var n$=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:a=!0,actionCreatorCheck:o=!0}=t??{};let u=new GE;return r&&(r$(r)?u.push(JR):u.push(e$(r.extraArgument))),u},VE="RTK_autoBatch",at=()=>e=>({payload:e,meta:{[VE]:!0}}),Vw=e=>t=>{setTimeout(t,e)},i$=(e,t)=>r=>{let n=!1;const a=()=>{n||(n=!0,cancelAnimationFrame(o),clearTimeout(u),r())},o=e(a),u=setTimeout(a,t)},qE=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let a=!0,o=!1,u=!1;const l=new Set,f=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?i$(window.requestAnimationFrame,100):Vw(10):e.type==="callback"?e.queueNotification:Vw(e.timeout),h=()=>{u=!1,o&&(o=!1,l.forEach(p=>p()))};return Object.assign({},n,{subscribe(p){const v=()=>a&&p(),x=n.subscribe(v);return l.add(p),()=>{x(),l.delete(p)}},dispatch(p){var v;try{return a=!((v=p==null?void 0:p.meta)!=null&&v[VE]),o=!a,o&&(u||(u=!0,f(h))),n.dispatch(p)}finally{a=!0}}})},a$=e=>function(r){const{autoBatch:n=!0}=r??{};let a=new GE(e);return n&&a.push(qE(typeof n=="object"?n:void 0)),a};function o$(e){const t=n$(),{reducer:r=void 0,middleware:n,devTools:a=!0,preloadedState:o=void 0,enhancers:u=void 0}=e||{};let l;if(typeof r=="function")l=r;else if(Sy(r))l=IE(r);else throw new Error(_r(1));let f;typeof n=="function"?f=n(t):f=t();let h=cf;a&&(h=t$({trace:!1,...typeof a=="object"&&a}));const p=LR(...f),v=a$(p);let x=typeof u=="function"?u(v):v();const b=h(...x);return ME(l,o,b)}function QE(e){const t={},r=[];let n;const a={addCase(o,u){const l=typeof o=="string"?o:o.type;if(!l)throw new Error(_r(28));if(l in t)throw new Error(_r(29));return t[l]=u,a},addAsyncThunk(o,u){return u.pending&&(t[o.pending.type]=u.pending),u.rejected&&(t[o.rejected.type]=u.rejected),u.fulfilled&&(t[o.fulfilled.type]=u.fulfilled),u.settled&&r.push({matcher:o.settled,reducer:u.settled}),a},addMatcher(o,u){return r.push({matcher:o,reducer:u}),a},addDefaultCase(o){return n=o,a}};return e(a),[t,r,n]}function s$(e){return typeof e=="function"}function l$(e,t){let[r,n,a]=QE(t),o;if(s$(e))o=()=>Gw(e());else{const l=Gw(e);o=()=>l}function u(l=o(),f){let h=[r[f.type],...n.filter(({matcher:p})=>p(f)).map(({reducer:p})=>p)];return h.filter(p=>!!p).length===0&&(h=[a]),h.reduce((p,v)=>{if(v)if(ui(p)){const b=v(p,f);return b===void 0?p:b}else{if(fn(p))return HE(p,x=>v(x,f));{const x=v(p,f);if(x===void 0){if(p===null)return p;throw Error("A case reducer on a non-draftable value must not return undefined")}return x}}return p},l)}return u.getInitialState=o,u}var u$="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",c$=(e=21)=>{let t="",r=e;for(;r--;)t+=u$[Math.random()*64|0];return t},d$=Symbol.for("rtk-slice-createasyncthunk");function f$(e,t){return`${e}/${t}`}function h$({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[d$];return function(a){const{name:o,reducerPath:u=o}=a;if(!o)throw new Error(_r(11));const l=(typeof a.reducers=="function"?a.reducers(m$()):a.reducers)||{},f=Object.keys(l),h={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},p={addCase(C,_){const A=typeof C=="string"?C:C.type;if(!A)throw new Error(_r(12));if(A in h.sliceCaseReducersByType)throw new Error(_r(13));return h.sliceCaseReducersByType[A]=_,p},addMatcher(C,_){return h.sliceMatchers.push({matcher:C,reducer:_}),p},exposeAction(C,_){return h.actionCreators[C]=_,p},exposeCaseReducer(C,_){return h.sliceCaseReducersByName[C]=_,p}};f.forEach(C=>{const _=l[C],A={reducerName:C,type:f$(o,C),createNotation:typeof a.reducers=="function"};g$(_)?x$(A,_,p,t):v$(A,_,p)});function v(){const[C={},_=[],A=void 0]=typeof a.extraReducers=="function"?QE(a.extraReducers):[a.extraReducers],I={...C,...h.sliceCaseReducersByType};return l$(a.initialState,$=>{for(let B in I)$.addCase(B,I[B]);for(let B of h.sliceMatchers)$.addMatcher(B.matcher,B.reducer);for(let B of _)$.addMatcher(B.matcher,B.reducer);A&&$.addDefaultCase(A)})}const x=C=>C,b=new Map,k=new WeakMap;let j;function S(C,_){return j||(j=v()),j(C,_)}function N(){return j||(j=v()),j.getInitialState()}function P(C,_=!1){function A($){let B=$[C];return typeof B>"u"&&_&&(B=Id(k,A,N)),B}function I($=x){const B=Id(b,_,()=>new WeakMap);return Id(B,$,()=>{const K={};for(const[q,R]of Object.entries(a.selectors??{}))K[q]=p$(R,$,()=>Id(k,$,N),_);return K})}return{reducerPath:C,getSelectors:I,get selectors(){return I(A)},selectSlice:A}}const O={name:o,reducer:S,actions:h.actionCreators,caseReducers:h.sliceCaseReducersByName,getInitialState:N,...P(u),injectInto(C,{reducerPath:_,...A}={}){const I=_??u;return C.inject({reducerPath:I,reducer:S},A),{...O,...P(I,!0)}}};return O}}function p$(e,t,r,n){function a(o,...u){let l=t(o);return typeof l>"u"&&n&&(l=r()),e(l,...u)}return a.unwrapped=e,a}var rr=h$();function m$(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function v$({type:e,reducerName:t,createNotation:r},n,a){let o,u;if("reducer"in n){if(r&&!y$(n))throw new Error(_r(17));o=n.reducer,u=n.prepare}else o=n;a.addCase(e,o).exposeCaseReducer(t,o).exposeAction(t,u?Mr(e,u):Mr(e))}function g$(e){return e._reducerDefinitionType==="asyncThunk"}function y$(e){return e._reducerDefinitionType==="reducerWithPrepare"}function x$({type:e,reducerName:t},r,n,a){if(!a)throw new Error(_r(18));const{payloadCreator:o,fulfilled:u,pending:l,rejected:f,settled:h,options:p}=r,v=a(e,o,p);n.exposeAction(t,v),u&&n.addCase(v.fulfilled,u),l&&n.addCase(v.pending,l),f&&n.addCase(v.rejected,f),h&&n.addMatcher(v.settled,h),n.exposeCaseReducer(t,{fulfilled:u||Td,pending:l||Td,rejected:f||Td,settled:h||Td})}function Td(){}var b$="task",YE="listener",XE="completed",Cy="cancelled",w$=`task-${Cy}`,k$=`task-${XE}`,jg=`${YE}-${Cy}`,j$=`${YE}-${XE}`,yh=class{constructor(e){Kl(this,"code");Kl(this,"name","TaskAbortError");Kl(this,"message");this.code=e,this.message=`${b$} ${Cy} (reason: ${e})`}},Ay=(e,t)=>{if(typeof e!="function")throw new TypeError(_r(32))},gf=()=>{},ZE=(e,t=gf)=>(e.catch(t),e),JE=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),eo=e=>{if(e.aborted)throw new yh(e.reason)};function eP(e,t){let r=gf;return new Promise((n,a)=>{const o=()=>a(new yh(e.reason));if(e.aborted){o();return}r=JE(e,o),t.finally(()=>r()).then(n,a)}).finally(()=>{r=gf})}var S$=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof yh?"cancelled":"rejected",error:r}}finally{t==null||t()}},yf=e=>t=>ZE(eP(e,t).then(r=>(eo(e),r))),tP=e=>{const t=yf(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:ds}=Object,qw={},xh="listenerMiddleware",N$=(e,t)=>{const r=n=>JE(e,()=>n.abort(e.reason));return(n,a)=>{Ay(n);const o=new AbortController;r(o);const u=S$(async()=>{eo(e),eo(o.signal);const l=await n({pause:yf(o.signal),delay:tP(o.signal),signal:o.signal});return eo(o.signal),l},()=>o.abort(k$));return a!=null&&a.autoJoin&&t.push(u.catch(gf)),{result:yf(e)(u),cancel(){o.abort(w$)}}}},E$=(e,t)=>{const r=async(n,a)=>{eo(t);let o=()=>{};const l=[new Promise((f,h)=>{let p=e({predicate:n,effect:(v,x)=>{x.unsubscribe(),f([v,x.getState(),x.getOriginalState()])}});o=()=>{p(),h()}})];a!=null&&l.push(new Promise(f=>setTimeout(f,a,null)));try{const f=await eP(t,Promise.race(l));return eo(t),f}finally{o()}};return((n,a)=>ZE(r(n,a)))},rP=e=>{let{type:t,actionCreator:r,matcher:n,predicate:a,effect:o}=e;if(t)a=Mr(t).match;else if(r)t=r.type,a=r.match;else if(n)a=n;else if(!a)throw new Error(_r(21));return Ay(o),{predicate:a,type:t,effect:o}},nP=ds(e=>{const{type:t,predicate:r,effect:n}=rP(e);return{id:c$(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(_r(22))}}},{withTypes:()=>nP}),Qw=(e,t)=>{const{type:r,effect:n,predicate:a}=rP(t);return Array.from(e.values()).find(o=>(typeof r=="string"?o.type===r:o.predicate===a)&&o.effect===n)},Sg=e=>{e.pending.forEach(t=>{t.abort(jg)})},P$=(e,t)=>()=>{for(const r of t.keys())Sg(r);e.clear()},Yw=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},iP=ds(Mr(`${xh}/add`),{withTypes:()=>iP}),C$=Mr(`${xh}/removeAll`),aP=ds(Mr(`${xh}/remove`),{withTypes:()=>aP}),A$=(...e)=>{console.error(`${xh}/error`,...e)},Qu=(e={})=>{const t=new Map,r=new Map,n=b=>{const k=r.get(b)??0;r.set(b,k+1)},a=b=>{const k=r.get(b)??1;k===1?r.delete(b):r.set(b,k-1)},{extra:o,onError:u=A$}=e;Ay(u);const l=b=>(b.unsubscribe=()=>t.delete(b.id),t.set(b.id,b),k=>{b.unsubscribe(),k!=null&&k.cancelActive&&Sg(b)}),f=(b=>{const k=Qw(t,b)??nP(b);return l(k)});ds(f,{withTypes:()=>f});const h=b=>{const k=Qw(t,b);return k&&(k.unsubscribe(),b.cancelActive&&Sg(k)),!!k};ds(h,{withTypes:()=>h});const p=async(b,k,j,S)=>{const N=new AbortController,P=E$(f,N.signal),O=[];try{b.pending.add(N),n(b),await Promise.resolve(b.effect(k,ds({},j,{getOriginalState:S,condition:(C,_)=>P(C,_).then(Boolean),take:P,delay:tP(N.signal),pause:yf(N.signal),extra:o,signal:N.signal,fork:N$(N.signal,O),unsubscribe:b.unsubscribe,subscribe:()=>{t.set(b.id,b)},cancelActiveListeners:()=>{b.pending.forEach((C,_,A)=>{C!==N&&(C.abort(jg),A.delete(C))})},cancel:()=>{N.abort(jg),b.pending.delete(N)},throwIfCancelled:()=>{eo(N.signal)}})))}catch(C){C instanceof yh||Yw(u,C,{raisedBy:"effect"})}finally{await Promise.all(O),N.abort(j$),a(b),b.pending.delete(N)}},v=P$(t,r);return{middleware:b=>k=>j=>{if(!TE(j))return k(j);if(iP.match(j))return f(j.payload);if(C$.match(j)){v();return}if(aP.match(j))return h(j.payload);let S=b.getState();const N=()=>{if(S===qw)throw new Error(_r(23));return S};let P;try{if(P=k(j),t.size>0){const O=b.getState(),C=Array.from(t.values());for(const _ of C){let A=!1;try{A=_.predicate(j,O,S)}catch(I){A=!1,Yw(u,I,{raisedBy:"predicate"})}A&&p(_,j,b,N)}}}finally{S=qw}return P},startListening:f,stopListening:h,clearListeners:v}};function _r(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 O$={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},oP=rr({name:"chartLayout",initialState:O$,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 r,n,a,o;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(a=t.payload.bottom)!==null&&a!==void 0?a:0,e.margin.left=(o=t.payload.left)!==null&&o!==void 0?o:0},setScale(e,t){e.scale=t.payload}}}),bh=oP.actions,_$=bh.setMargin,M$=bh.setLayout,I$=bh.setChartSize,T$=bh.setScale,D$=oP.reducer;function sP(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function Be(e){return Number.isFinite(e)}function Rn(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function Xw(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function os(e){for(var t=1;t{if(t&&r){var n=r.width,a=r.height,o=t.align,u=t.verticalAlign,l=t.layout;if((l==="vertical"||l==="horizontal"&&u==="middle")&&o!=="center"&&Ne(e[o]))return os(os({},e),{},{[o]:e[o]+(n||0)});if((l==="horizontal"||l==="vertical"&&o==="center")&&u!=="middle"&&Ne(e[u]))return os(os({},e),{},{[u]:e[u]+(a||0)})}return e},zn=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",lP=(e,t,r,n)=>{if(n)return e.map(l=>l.coordinate);var a,o,u=e.map(l=>(l.coordinate===t&&(a=!0),l.coordinate===r&&(o=!0),l.coordinate));return a||u.push(t),o||u.push(r),u},uP=(e,t,r)=>{if(!e)return null;var n=e.duplicateDomain,a=e.type,o=e.range,u=e.scale,l=e.realScaleType,f=e.isCategorical,h=e.categoricalDomain,p=e.tickCount,v=e.ticks,x=e.niceTicks,b=e.axisType;if(!u)return null;var k=l==="scaleBand"&&u.bandwidth?u.bandwidth()/2:2,j=a==="category"&&u.bandwidth?u.bandwidth()/k:0;if(j=b==="angleAxis"&&o&&o.length>=2?Wr(o[0]-o[1])*2*j:j,v||x){var S=(v||x||[]).map((N,P)=>{var O=n?n.indexOf(N):N,C=u.map(O);return Be(C)?{coordinate:C+j,value:N,offset:j,index:P}:null}).filter(xr);return S}return f&&h?h.map((N,P)=>{var O=u.map(N);return Be(O)?{coordinate:O+j,value:N,index:P,offset:j}:null}).filter(xr):u.ticks&&p!=null?u.ticks(p).map((N,P)=>{var O=u.map(N);return Be(O)?{coordinate:O+j,value:N,index:P,offset:j}:null}).filter(xr):u.domain().map((N,P)=>{var O=u.map(N);return Be(O)?{coordinate:O+j,value:n?n[N]:N,index:P,offset:j}:null}).filter(xr)},F$=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var a=0;a=0?(h[0]=o,o+=x,h[1]=o):(h[0]=u,u+=x,h[1]=u)}}}},B$=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var a=0;a=0?(f[0]=o,o+=h,f[1]=o):(f[0]=0,f[1]=0)}}}},U$={sign:F$,expand:iD,none:ao,silhouette:aD,wiggle:oD,positive:B$},W$=(e,t,r)=>{var n,a=(n=U$[r])!==null&&n!==void 0?n:ao,o=nD().keys(t).value((l,f)=>Number(Tt(l,f,0))).order(cg).offset(a),u=o(e);return u.forEach((l,f)=>{l.forEach((h,p)=>{var v=Tt(e[p],t[f],0);Array.isArray(v)&&v.length===2&&Ne(v[0])&&Ne(v[1])&&(h[0]=v[0],h[1]=v[1])})}),u};function H$(e){return e==null?void 0:String(e)}function Zw(e){var t=e.axis,r=e.ticks,n=e.bandSize,a=e.entry,o=e.index,u=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Kt(a[t.dataKey])){var l=mE(r,"value",a[t.dataKey]);if(l)return l.coordinate+n/2}return r!=null&&r[o]?r[o].coordinate+n/2:null}var f=Tt(a,Kt(u)?t.dataKey:u),h=t.scale.map(f);return Ne(h)?h:null}var K$=e=>{var t=e.flat(2).filter(Ne);return[Math.min(...t),Math.max(...t)]},G$=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],V$=(e,t,r)=>{if(!(e==null||Object.keys(e).length===0))return G$(Object.keys(e).reduce((n,a)=>{var o=e[a];if(!o)return n;var u=o.stackedData,l=u.reduce((f,h)=>{var p=sP(h,t,r),v=K$(p);return!Be(v[0])||!Be(v[1])?f:[Math.min(f[0],v[0]),Math.max(f[1],v[1])]},[1/0,-1/0]);return[Math.min(l[0],n[0]),Math.max(l[1],n[1])]},[1/0,-1/0]))},Jw=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,ek=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,xf=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var a=ch(t,p=>p.coordinate),o=1/0,u=1,l=a.length;u{if(t==="horizontal")return e.relativeX;if(t==="vertical")return e.relativeY},Q$=(e,t)=>t==="centric"?e.angle:e.radius,hi=e=>e.layout.width,pi=e=>e.layout.height,Y$=e=>e.layout.scale,dP=e=>e.layout.margin,wh=G(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),kh=G(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),X$="data-recharts-item-index",Z$="data-recharts-item-id",Yu=60;function rk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Dd(e){for(var t=1;te.brush.height;function nL(e){var t=kh(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var a=typeof n.width=="number"?n.width:Yu;return r+a}return r},0)}function iL(e){var t=kh(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var a=typeof n.width=="number"?n.width:Yu;return r+a}return r},0)}function aL(e){var t=wh(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function oL(e){var t=wh(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Vt=G([hi,pi,dP,rL,nL,iL,aL,oL,_E,PR],(e,t,r,n,a,o,u,l,f,h)=>{var p={left:(r.left||0)+a,right:(r.right||0)+o},v={top:(r.top||0)+u,bottom:(r.bottom||0)+l},x=Dd(Dd({},v),p),b=x.bottom;x.bottom+=n,x=z$(x,f,h);var k=e-x.left-x.right,j=t-x.top-x.bottom;return Dd(Dd({brushBottom:b},x),{},{width:Math.max(k,0),height:Math.max(j,0)})}),sL=G(Vt,e=>({x:e.left,y:e.top,width:e.width,height:e.height})),fP=G(hi,pi,(e,t)=>({x:0,y:0,width:e,height:t})),lL=y.createContext(null),wr=()=>y.useContext(lL)!=null,jh=e=>e.brush,Sh=G([jh,Vt,dP],(e,t,r)=>({height:e.height,x:Ne(e.x)?e.x:t.left,y:Ne(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Ne(e.width)?e.width:t.width}));function uL(e,t,{signal:r,edges:n}={}){let a,o=null;const u=n!=null&&n.includes("leading"),l=n==null||n.includes("trailing"),f=()=>{o!==null&&(e.apply(a,o),a=void 0,o=null)},h=()=>{l&&f(),b()};let p=null;const v=()=>{p!=null&&clearTimeout(p),p=setTimeout(()=>{p=null,h()},t)},x=()=>{p!==null&&(clearTimeout(p),p=null)},b=()=>{x(),a=void 0,o=null},k=()=>{f()},j=function(...S){if(r!=null&&r.aborted)return;a=this,o=S;const N=p==null;v(),u&&N&&f()};return j.schedule=v,j.cancel=b,j.flush=k,r==null||r.addEventListener("abort",b,{once:!0}),j}function cL(e,t=0,r={}){typeof r!="object"&&(r={});const{leading:n=!1,trailing:a=!0,maxWait:o}=r,u=Array(2);n&&(u[0]="leading"),a&&(u[1]="trailing");let l,f=null;const h=uL(function(...x){l=e.apply(this,x),f=null},t,{edges:u}),p=function(...x){return o!=null&&(f===null&&(f=Date.now()),Date.now()-f>=o)?(l=e.apply(this,x),f=Date.now(),h.cancel(),h.schedule(),l):(h.apply(this,x),l)},v=()=>(h.flush(),l);return p.cancel=h.cancel,p.flush=v,p}function dL(e,t=0,r={}){const{leading:n=!0,trailing:a=!0}=r;return cL(e,t,{leading:n,maxWait:t,trailing:a})}var bf=function(t,r){for(var n=arguments.length,a=new Array(n>2?n-2:0),o=2;oa[u++]))}},An={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},hP=(e,t,r)=>{var n=r.width,a=n===void 0?An.width:n,o=r.height,u=o===void 0?An.height:o,l=r.aspect,f=r.maxHeight,h=oo(a)?e:Number(a),p=oo(u)?t:Number(u);return l&&l>0&&(h?p=h/l:p&&(h=p*l),f&&p!=null&&p>f&&(p=f)),{calculatedWidth:h,calculatedHeight:p}},fL={width:0,height:0,overflow:"visible"},hL={width:0,overflowX:"visible"},pL={height:0,overflowY:"visible"},mL={},vL=e=>{var t=e.width,r=e.height,n=oo(t),a=oo(r);return n&&a?fL:n?hL:a?pL:mL};function gL(e){var t=e.width,r=e.height,n=e.aspect,a=t,o=r;return a===void 0&&o===void 0?(a=An.width,o=An.height):a===void 0?a=n&&n>0?void 0:An.width:o===void 0&&(o=n&&n>0?void 0:An.height),{width:a,height:o}}var yL=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function wf(){return wf=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({width:r,height:n}),[r,n]);return AL(a)?y.createElement(pP.Provider,{value:a},t):null}var Oy=()=>y.useContext(pP),OL=y.forwardRef((e,t)=>{var r=e.aspect,n=e.initialDimension,a=n===void 0?An.initialDimension:n,o=e.width,u=e.height,l=e.minWidth,f=l===void 0?An.minWidth:l,h=e.minHeight,p=e.maxHeight,v=e.children,x=e.debounce,b=x===void 0?An.debounce:x,k=e.id,j=e.className,S=e.onResize,N=e.style,P=N===void 0?{}:N,O=PL(e,yL),C=y.useRef(null),_=y.useRef();_.current=S,y.useImperativeHandle(t,()=>C.current);var A=y.useState({containerWidth:a.width,containerHeight:a.height}),I=kL(A,2),$=I[0],B=I[1],K=y.useCallback((ke,me)=>{B(Q=>{var oe=Math.round(ke),X=Math.round(me);return Q.containerWidth===oe&&Q.containerHeight===X?Q:{containerWidth:oe,containerHeight:X}})},[]);y.useEffect(()=>{if(C.current==null||typeof ResizeObserver>"u")return Us;var ke=L=>{var T,ee=L[0];if(ee!=null){var ne=ee.contentRect,te=ne.width,ue=ne.height;K(te,ue),(T=_.current)===null||T===void 0||T.call(_,te,ue)}};b>0&&(ke=dL(ke,b,{trailing:!0,leading:!1}));var me=new ResizeObserver(ke),Q=C.current.getBoundingClientRect(),oe=Q.width,X=Q.height;return K(oe,X),me.observe(C.current),()=>{me.disconnect()}},[K,b]);var q=$.containerWidth,R=$.containerHeight;bf(!r||r>0,"The aspect(%s) must be greater than zero.",r);var de=hP(q,R,{width:o,height:u,aspect:r,maxHeight:p}),Z=de.calculatedWidth,ge=de.calculatedHeight;return bf(q<0||R<0||Z!=null&&Z>0||ge!=null&&ge>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.`,Z,ge,o,u,f,h,r),y.createElement("div",wf({id:j?"".concat(j):void 0,className:et("recharts-responsive-container",k),style:ij(ij({},P),{},{width:o,height:u,minWidth:f,minHeight:h,maxHeight:p}),ref:C},O),y.createElement("div",{style:fL({width:o,height:u})},y.createElement(pP,{width:Z,height:ge},v)))}),PL=y.forwardRef((e,t)=>{var r=Oy();if(Rn(r.width)&&Rn(r.height))return e.children;var n=hL({width:e.width,height:e.height,aspect:e.aspect}),a=n.width,o=n.height,u=fP(void 0,void 0,{width:a,height:o,aspect:e.aspect,maxHeight:e.maxHeight}),l=u.calculatedWidth,f=u.calculatedHeight;return Ne(l)&&Ne(f)?y.createElement(pP,{width:l,height:f},e.children):y.createElement(EL,wf({},e,{width:a,height:o,ref:t}))});function _y(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 Nh=()=>{var e,t=wr(),r=Ce(nL),n=Ce(Sh),a=(e=Ce(kh))===null||e===void 0?void 0:e.padding;return!t||!n||!a?r:{width:n.width-a.left-a.right,height:n.height-a.top-a.bottom,x:a.left,y:a.top}},CL={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},mP=()=>{var e;return(e=Ce(Gt))!==null&&e!==void 0?e:CL},vP=()=>Ce(hi),gP=()=>Ce(pi),ut=e=>e.layout.layoutType,Ws=()=>Ce(ut),My=()=>{var e=Ws();if(e==="horizontal"||e==="vertical")return e},yP=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},AL=()=>{var e=Ws();return e!==void 0},Yu=e=>{var t=wt(),r=wr(),n=e.width,a=e.height,o=Oy(),u=n,l=a;return o&&(u=o.width>0?o.width:n,l=o.height>0?o.height:a),y.useEffect(()=>{!r&&Rn(u)&&Rn(l)&&t(A$({width:u,height:l}))},[t,r,u,l]),null},xP=Symbol.for("immer-nothing"),oj=Symbol.for("immer-draftable"),Ir=Symbol.for("immer-state");function un(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Cu=Object.getPrototypeOf;function Is(e){return!!e&&!!e[Ir]}function lo(e){var t;return e?bP(e)||Array.isArray(e)||!!e[oj]||!!((t=e.constructor)!=null&&t[oj])||Xu(e)||Ph(e):!1}var OL=Object.prototype.constructor.toString(),sj=new WeakMap;function bP(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=sj.get(r);return n===void 0&&(n=Function.toString.call(r),sj.set(r,n)),n===OL}function jf(e,t,r=!0){Eh(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function Eh(e){const t=e[Ir];return t?t.type_:Array.isArray(e)?1:Xu(e)?2:Ph(e)?3:0}function Ng(e,t){return Eh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function wP(e,t,r){const n=Eh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function _L(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Xu(e){return e instanceof Map}function Ph(e){return e instanceof Set}function $a(e){return e.copy_||e.base_}function Eg(e,t){if(Xu(e))return new Map(e);if(Ph(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=bP(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ir];let a=Reflect.ownKeys(n);for(let o=0;o1&&Object.defineProperties(e,{set:Rd,add:Rd,clear:Rd,delete:Rd}),Object.freeze(e),t&&Object.values(e).forEach(r=>Iy(r,!0))),e}function ML(){un(2)}var Rd={value:ML};function Ch(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var IL={};function uo(e){const t=IL[e];return t||un(0,e),t}var Au;function jP(){return Au}function TL(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function lj(e,t){t&&(uo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pg(e){Cg(e),e.drafts_.forEach(DL),e.drafts_=null}function Cg(e){e===Au&&(Au=e.parent_)}function uj(e){return Au=TL(Au,e)}function DL(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function cj(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ir].modified_&&(Pg(t),un(4)),lo(e)&&(e=kf(t,e),t.parent_||Sf(t,e)),t.patches_&&uo("Patches").generateReplacementPatches_(r[Ir].base_,e,t.patches_,t.inversePatches_)):e=kf(t,r,[]),Pg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==xP?e:void 0}function kf(e,t,r){if(Ch(t))return t;const n=e.immer_.shouldUseStrictIteration(),a=t[Ir];if(!a)return jf(t,(o,u)=>dj(e,a,t,o,u,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return Sf(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const o=a.copy_;let u=o,l=!1;a.type_===3&&(u=new Set(o),o.clear(),l=!0),jf(u,(f,h)=>dj(e,a,o,f,h,r,l),n),Sf(e,o,!1),r&&e.patches_&&uo("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function dj(e,t,r,n,a,o,u){if(a==null||typeof a!="object"&&!u)return;const l=Ch(a);if(!(l&&!u)){if(Is(a)){const f=o&&t&&t.type_!==3&&!Ng(t.assigned_,n)?o.concat(n):void 0,h=kf(e,a,f);if(wP(r,n,h),Is(h))e.canAutoFreeze_=!1;else return}else u&&r.add(a);if(lo(a)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&l)return;kf(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Xu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Sf(e,a)}}}function Sf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Iy(t,r)}function RL(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:jP(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,o=Ty;r&&(a=[n],o=Ou);const{revoke:u,proxy:l}=Proxy.revocable(a,o);return n.draft_=l,n.revoke_=u,l}var Ty={get(e,t){if(t===Ir)return e;const r=$a(e);if(!Ng(r,t))return $L(e,r,t);const n=r[t];return e.finalized_||!lo(n)?n:n===iv(e.base_,t)?(av(e),e.copy_[t]=Og(n,e)):n},has(e,t){return t in $a(e)},ownKeys(e){return Reflect.ownKeys($a(e))},set(e,t,r){const n=kP($a(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=iv($a(e),t),o=a==null?void 0:a[Ir];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(_L(r,a)&&(r!==void 0||Ng(e.base_,t)))return!0;av(e),Ag(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return iv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,av(e),Ag(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=$a(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){un(11)},getPrototypeOf(e){return Cu(e.base_)},setPrototypeOf(){un(12)}},Ou={};jf(Ty,(e,t)=>{Ou[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ou.deleteProperty=function(e,t){return Ou.set.call(this,e,t,void 0)};Ou.set=function(e,t,r){return Ty.set.call(this,e[0],t,r,e[0])};function iv(e,t){const r=e[Ir];return(r?$a(r):e)[t]}function $L(e,t,r){var a;const n=kP(t,r);return n?"value"in n?n.value:(a=n.get)==null?void 0:a.call(e.draft_):void 0}function kP(e,t){if(!(t in e))return;let r=Cu(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Cu(r)}}function Ag(e){e.modified_||(e.modified_=!0,e.parent_&&Ag(e.parent_))}function av(e){e.copy_||(e.copy_=Eg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var LL=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const u=this;return function(f=o,...h){return u.produce(f,p=>r.call(this,p,...h))}}typeof r!="function"&&un(6),n!==void 0&&typeof n!="function"&&un(7);let a;if(lo(t)){const o=uj(this),u=Og(t,void 0);let l=!0;try{a=r(u),l=!1}finally{l?Pg(o):Cg(o)}return lj(o,n),cj(a,o)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===xP&&(a=void 0),this.autoFreeze_&&Iy(a,!0),n){const o=[],u=[];uo("Patches").generateReplacementPatches_(t,a,o,u),n(o,u)}return a}else un(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(u,...l)=>this.produceWithPatches(u,f=>t(f,...l));let n,a;return[this.produce(t,r,(u,l)=>{n=u,a=l}),n,a]},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){lo(e)||un(8),Is(e)&&(e=zL(e));const t=uj(this),r=Og(e,void 0);return r[Ir].isManual_=!0,Cg(t),r}finishDraft(e,t){const r=e&&e[Ir];(!r||!r.isManual_)&&un(9);const{scope_:n}=r;return lj(n,t),cj(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=uo("Patches").applyPatches_;return Is(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Og(e,t){const r=Xu(e)?uo("MapSet").proxyMap_(e,t):Ph(e)?uo("MapSet").proxySet_(e,t):RL(e,t);return(t?t.scope_:jP()).drafts_.push(r),r}function zL(e){return Is(e)||un(10,e),SP(e)}function SP(e){if(!lo(e)||Ch(e))return e;const t=e[Ir];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Eg(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Eg(e,!0);return jf(r,(a,o)=>{wP(r,a,SP(o))},n),t&&(t.finalized_=!1),r}var FL=new LL;FL.produce;var BL={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},NP=rr({name:"legend",initialState:BL,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:at()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).payload.indexOf(n);o>-1&&(e.payload[o]=a)},prepare:at()},removeLegendPayload:{reducer(e,t){var r=Hr(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:at()}}}),Zu=NP.actions;Zu.setLegendSize;Zu.setLegendSettings;var UL=Zu.addLegendPayload,WL=Zu.replaceLegendPayload,HL=Zu.removeLegendPayload,KL=NP.reducer,ov={exports:{}},sv={};/** + height and width.`,Z,ge,o,u,f,h,r),y.createElement("div",wf({id:k?"".concat(k):void 0,className:et("recharts-responsive-container",j),style:ik(ik({},P),{},{width:o,height:u,minWidth:f,minHeight:h,maxHeight:p}),ref:C},O),y.createElement("div",{style:vL({width:o,height:u})},y.createElement(mP,{width:Z,height:ge},v)))}),_L=y.forwardRef((e,t)=>{var r=Oy();if(Rn(r.width)&&Rn(r.height))return e.children;var n=gL({width:e.width,height:e.height,aspect:e.aspect}),a=n.width,o=n.height,u=hP(void 0,void 0,{width:a,height:o,aspect:e.aspect,maxHeight:e.maxHeight}),l=u.calculatedWidth,f=u.calculatedHeight;return Ne(l)&&Ne(f)?y.createElement(mP,{width:l,height:f},e.children):y.createElement(OL,wf({},e,{width:a,height:o,ref:t}))});function _y(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 Nh=()=>{var e,t=wr(),r=Ae(sL),n=Ae(Sh),a=(e=Ae(jh))===null||e===void 0?void 0:e.padding;return!t||!n||!a?r:{width:n.width-a.left-a.right,height:n.height-a.top-a.bottom,x:a.left,y:a.top}},ML={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},vP=()=>{var e;return(e=Ae(Vt))!==null&&e!==void 0?e:ML},gP=()=>Ae(hi),yP=()=>Ae(pi),ut=e=>e.layout.layoutType,Ws=()=>Ae(ut),My=()=>{var e=Ws();if(e==="horizontal"||e==="vertical")return e},xP=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},IL=()=>{var e=Ws();return e!==void 0},Xu=e=>{var t=kt(),r=wr(),n=e.width,a=e.height,o=Oy(),u=n,l=a;return o&&(u=o.width>0?o.width:n,l=o.height>0?o.height:a),y.useEffect(()=>{!r&&Rn(u)&&Rn(l)&&t(I$({width:u,height:l}))},[t,r,u,l]),null},bP=Symbol.for("immer-nothing"),ok=Symbol.for("immer-draftable"),Ir=Symbol.for("immer-state");function un(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Au=Object.getPrototypeOf;function Is(e){return!!e&&!!e[Ir]}function lo(e){var t;return e?wP(e)||Array.isArray(e)||!!e[ok]||!!((t=e.constructor)!=null&&t[ok])||Zu(e)||Ph(e):!1}var TL=Object.prototype.constructor.toString(),sk=new WeakMap;function wP(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=sk.get(r);return n===void 0&&(n=Function.toString.call(r),sk.set(r,n)),n===TL}function kf(e,t,r=!0){Eh(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(a=>{t(a,e[a],e)}):e.forEach((n,a)=>t(a,n,e))}function Eh(e){const t=e[Ir];return t?t.type_:Array.isArray(e)?1:Zu(e)?2:Ph(e)?3:0}function Ng(e,t){return Eh(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function kP(e,t,r){const n=Eh(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function DL(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Zu(e){return e instanceof Map}function Ph(e){return e instanceof Set}function $a(e){return e.copy_||e.base_}function Eg(e,t){if(Zu(e))return new Map(e);if(Ph(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=wP(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Ir];let a=Reflect.ownKeys(n);for(let o=0;o1&&Object.defineProperties(e,{set:Rd,add:Rd,clear:Rd,delete:Rd}),Object.freeze(e),t&&Object.values(e).forEach(r=>Iy(r,!0))),e}function RL(){un(2)}var Rd={value:RL};function Ch(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var $L={};function uo(e){const t=$L[e];return t||un(0,e),t}var Ou;function jP(){return Ou}function LL(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function lk(e,t){t&&(uo("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Pg(e){Cg(e),e.drafts_.forEach(zL),e.drafts_=null}function Cg(e){e===Ou&&(Ou=e.parent_)}function uk(e){return Ou=LL(Ou,e)}function zL(e){const t=e[Ir];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function ck(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Ir].modified_&&(Pg(t),un(4)),lo(e)&&(e=jf(t,e),t.parent_||Sf(t,e)),t.patches_&&uo("Patches").generateReplacementPatches_(r[Ir].base_,e,t.patches_,t.inversePatches_)):e=jf(t,r,[]),Pg(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==bP?e:void 0}function jf(e,t,r){if(Ch(t))return t;const n=e.immer_.shouldUseStrictIteration(),a=t[Ir];if(!a)return kf(t,(o,u)=>dk(e,a,t,o,u,r),n),t;if(a.scope_!==e)return t;if(!a.modified_)return Sf(e,a.base_,!0),a.base_;if(!a.finalized_){a.finalized_=!0,a.scope_.unfinalizedDrafts_--;const o=a.copy_;let u=o,l=!1;a.type_===3&&(u=new Set(o),o.clear(),l=!0),kf(u,(f,h)=>dk(e,a,o,f,h,r,l),n),Sf(e,o,!1),r&&e.patches_&&uo("Patches").generatePatches_(a,r,e.patches_,e.inversePatches_)}return a.copy_}function dk(e,t,r,n,a,o,u){if(a==null||typeof a!="object"&&!u)return;const l=Ch(a);if(!(l&&!u)){if(Is(a)){const f=o&&t&&t.type_!==3&&!Ng(t.assigned_,n)?o.concat(n):void 0,h=jf(e,a,f);if(kP(r,n,h),Is(h))e.canAutoFreeze_=!1;else return}else u&&r.add(a);if(lo(a)&&!l){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===a&&l)return;jf(e,a),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(Zu(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&Sf(e,a)}}}function Sf(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Iy(t,r)}function FL(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:jP(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let a=n,o=Ty;r&&(a=[n],o=_u);const{revoke:u,proxy:l}=Proxy.revocable(a,o);return n.draft_=l,n.revoke_=u,l}var Ty={get(e,t){if(t===Ir)return e;const r=$a(e);if(!Ng(r,t))return BL(e,r,t);const n=r[t];return e.finalized_||!lo(n)?n:n===iv(e.base_,t)?(av(e),e.copy_[t]=Og(n,e)):n},has(e,t){return t in $a(e)},ownKeys(e){return Reflect.ownKeys($a(e))},set(e,t,r){const n=SP($a(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const a=iv($a(e),t),o=a==null?void 0:a[Ir];if(o&&o.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(DL(r,a)&&(r!==void 0||Ng(e.base_,t)))return!0;av(e),Ag(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return iv(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,av(e),Ag(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=$a(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){un(11)},getPrototypeOf(e){return Au(e.base_)},setPrototypeOf(){un(12)}},_u={};kf(Ty,(e,t)=>{_u[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});_u.deleteProperty=function(e,t){return _u.set.call(this,e,t,void 0)};_u.set=function(e,t,r){return Ty.set.call(this,e[0],t,r,e[0])};function iv(e,t){const r=e[Ir];return(r?$a(r):e)[t]}function BL(e,t,r){var a;const n=SP(t,r);return n?"value"in n?n.value:(a=n.get)==null?void 0:a.call(e.draft_):void 0}function SP(e,t){if(!(t in e))return;let r=Au(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Au(r)}}function Ag(e){e.modified_||(e.modified_=!0,e.parent_&&Ag(e.parent_))}function av(e){e.copy_||(e.copy_=Eg(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var UL=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const o=r;r=t;const u=this;return function(f=o,...h){return u.produce(f,p=>r.call(this,p,...h))}}typeof r!="function"&&un(6),n!==void 0&&typeof n!="function"&&un(7);let a;if(lo(t)){const o=uk(this),u=Og(t,void 0);let l=!0;try{a=r(u),l=!1}finally{l?Pg(o):Cg(o)}return lk(o,n),ck(a,o)}else if(!t||typeof t!="object"){if(a=r(t),a===void 0&&(a=t),a===bP&&(a=void 0),this.autoFreeze_&&Iy(a,!0),n){const o=[],u=[];uo("Patches").generateReplacementPatches_(t,a,o,u),n(o,u)}return a}else un(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(u,...l)=>this.produceWithPatches(u,f=>t(f,...l));let n,a;return[this.produce(t,r,(u,l)=>{n=u,a=l}),n,a]},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){lo(e)||un(8),Is(e)&&(e=WL(e));const t=uk(this),r=Og(e,void 0);return r[Ir].isManual_=!0,Cg(t),r}finishDraft(e,t){const r=e&&e[Ir];(!r||!r.isManual_)&&un(9);const{scope_:n}=r;return lk(n,t),ck(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const a=t[r];if(a.path.length===0&&a.op==="replace"){e=a.value;break}}r>-1&&(t=t.slice(r+1));const n=uo("Patches").applyPatches_;return Is(e)?n(e,t):this.produce(e,a=>n(a,t))}};function Og(e,t){const r=Zu(e)?uo("MapSet").proxyMap_(e,t):Ph(e)?uo("MapSet").proxySet_(e,t):FL(e,t);return(t?t.scope_:jP()).drafts_.push(r),r}function WL(e){return Is(e)||un(10,e),NP(e)}function NP(e){if(!lo(e)||Ch(e))return e;const t=e[Ir];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=Eg(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=Eg(e,!0);return kf(r,(a,o)=>{kP(r,a,NP(o))},n),t&&(t.finalized_=!1),r}var HL=new UL;HL.produce;var KL={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value"},size:{width:0,height:0},payload:[]},EP=rr({name:"legend",initialState:KL,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:at()},replaceLegendPayload:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).payload.indexOf(n);o>-1&&(e.payload[o]=a)},prepare:at()},removeLegendPayload:{reducer(e,t){var r=Hr(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:at()}}}),Ju=EP.actions;Ju.setLegendSize;Ju.setLegendSettings;var GL=Ju.addLegendPayload,VL=Ju.replaceLegendPayload,qL=Ju.removeLegendPayload,QL=EP.reducer,ov={exports:{}},sv={};/** * @license React * use-sync-external-store-with-selector.production.js * @@ -396,56 +406,56 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var fj;function VL(){if(fj)return sv;fj=1;var e=Fs();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,l=e.useDebugValue;return sv.useSyncExternalStoreWithSelector=function(f,h,p,v,x){var b=a(null);if(b.current===null){var j={hasValue:!1,value:null};b.current=j}else j=b.current;b=u(function(){function S(_){if(!N){if(N=!0,P=_,_=v(_),x!==void 0&&j.hasValue){var A=j.value;if(x(A,_))return O=A}return O=_}if(A=O,r(P,_))return A;var I=v(_);return x!==void 0&&x(A,I)?(P=_,A):(P=_,O=I)}var N=!1,P,O,C=p===void 0?null:p;return[function(){return S(h())},C===null?void 0:function(){return S(C())}]},[h,p,v,x]);var k=n(f,b[0],b[1]);return o(function(){j.hasValue=!0,j.value=k},[k]),l(k),k},sv}var hj;function GL(){return hj||(hj=1,ov.exports=VL()),ov.exports}GL();function qL(e){e()}function QL(){let e=null,t=null;return{clear(){e=null,t=null},notify(){qL(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const a=t={callback:r,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){!n||e===null||(n=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var pj={notify(){},get:()=>[]};function YL(e,t){let r,n=pj,a=0,o=!1;function u(k){p();const S=n.subscribe(k);let N=!1;return()=>{N||(N=!0,S(),v())}}function l(){n.notify()}function f(){j.onStateChange&&j.onStateChange()}function h(){return o}function p(){a++,r||(r=e.subscribe(f),n=QL())}function v(){a--,r&&a===0&&(r(),r=void 0,n.clear(),n=pj)}function x(){o||(o=!0,p())}function b(){o&&(o=!1,v())}const j={addNestedSub:u,notifyNestedSubs:l,handleChangeWrapper:f,isSubscribed:h,trySubscribe:x,tryUnsubscribe:b,getListeners:()=>n};return j}var XL=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ZL=XL(),JL=()=>typeof navigator<"u"&&navigator.product==="ReactNative",ez=JL(),tz=()=>ZL||ez?y.useLayoutEffect:y.useEffect,rz=tz();function mj(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function nz(e,t){if(mj(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let a=0;a{const f=YL(a);return{store:a,subscription:f,getServerState:n?()=>n:void 0}},[a,n]),u=y.useMemo(()=>a.getState(),[a]);rz(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),u!==a.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,u]);const l=r||az;return y.createElement(l.Provider,{value:o},t)}var sz=oz,lz=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function uz(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ah(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(lz.has(n)){if(e[n]==null&&t[n]==null)continue;if(!nz(e[n],t[n]))return!1}else if(!uz(e[n],t[n]))return!1;return!0}function _g(){return _g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?Yo.separator:t,n=e.contentStyle,a=e.itemStyle,o=e.labelStyle,u=o===void 0?Yo.labelStyle:o,l=e.payload,f=e.formatter,h=e.itemSorter,p=e.wrapperClassName,v=e.labelClassName,x=e.label,b=e.labelFormatter,j=e.accessibilityLayer,k=j===void 0?Yo.accessibilityLayer:j,S=()=>{if(l&&l.length){var U={padding:0,margin:0},B=xz(l,h),V=B.map((q,R)=>{if(!q||q.type==="none")return null;var de=q.formatter||f||yz,Z=q.value,ge=q.name,je=Z,me=ge;if(de){var Q=de(Z,ge,q,R,l);if(Array.isArray(Q)){var oe=hz(Q,2);je=oe[0],me=oe[1]}else if(Q!=null)je=Q;else return null}var X=Ql(Ql({},Yo.itemStyle),{},{color:q.color||Yo.itemStyle.color},a);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:X},Dn(me)?y.createElement("span",{className:"recharts-tooltip-item-name"},me):null,Dn(me)?y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,y.createElement("span",{className:"recharts-tooltip-item-value"},je),y.createElement("span",{className:"recharts-tooltip-item-unit"},q.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:U},V)}return null},N=Ql(Ql({},Yo.contentStyle),n),P=Ql({margin:0},u),O=!Kt(x),C=O?x:"",_=et("recharts-default-tooltip",p),A=et("recharts-tooltip-label",v);O&&b&&l!==void 0&&l!==null&&(C=b(x,l));var I=k?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",_g({className:_,style:N},I),y.createElement("p",{className:A,style:P},y.isValidElement(C)?C:"".concat(C)),S())},Yl="recharts-tooltip-wrapper",wz={visibility:"hidden"};function jz(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return et(Yl,{["".concat(Yl,"-right")]:Ne(r)&&t&&Ne(t.x)&&r>=t.x,["".concat(Yl,"-left")]:Ne(r)&&t&&Ne(t.x)&&r=t.y,["".concat(Yl,"-top")]:Ne(n)&&t&&Ne(t.y)&&n0?a:0),v=r[n]+a;if(t[n])return u[n]?p:v;var x=f[n];if(x==null)return 0;if(u[n]){var b=p,j=x;return bS?Math.max(p,x):Math.max(v,x)}function kz(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function Sz(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,a=e.offsetLeft,o=e.position,u=e.reverseDirection,l=e.tooltipBox,f=e.useTranslate3d,h=e.viewBox,p,v,x;return l.height>0&&l.width>0&&r?(v=yj({allowEscapeViewBox:t,coordinate:r,key:"x",offset:a,position:o,reverseDirection:u,tooltipDimension:l.width,viewBox:h,viewBoxDimension:h.width}),x=yj({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:o,reverseDirection:u,tooltipDimension:l.height,viewBox:h,viewBoxDimension:h.height}),p=kz({translateX:v,translateY:x,useTranslate3d:f})):p=wz,{cssProperties:p,cssClasses:jz({translateX:v,translateY:x,coordinate:r})}}var Nz=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Ju={isSsr:Nz()};function Ez(e,t){return Oz(e)||Az(e,t)||Cz(e,t)||Pz()}function Pz(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Cz(e,t){if(e){if(typeof e=="string")return xj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xj(e,t):void 0}}function xj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rJu.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Ez(e,2),r=t[0],n=t[1];return y.useEffect(()=>{if(window.matchMedia){var a=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{n(a.matches)};return a.addEventListener("change",o),()=>{a.removeEventListener("change",o)}}},[]),r}function bj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xo(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),h=Tz(f,2),p=h[0],v=h[1];y.useEffect(()=>{var N=P=>{if(P.key==="Escape"){var O,C,_,A;v({dismissed:!0,dismissedAtCoordinate:{x:(O=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&O!==void 0?O:0,y:(_=(A=e.coordinate)===null||A===void 0?void 0:A.y)!==null&&_!==void 0?_:0}})}};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),p.dismissed&&(((n=(a=e.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0)!==p.dismissedAtCoordinate.x||((o=(u=e.coordinate)===null||u===void 0?void 0:u.y)!==null&&o!==void 0?o:0)!==p.dismissedAtCoordinate.y)&&v(Xo(Xo({},p),{},{dismissed:!1}));var x=Sz({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),b=x.cssClasses,j=x.cssProperties,k=e.hasPortalFromProps?{}:Xo(Xo({transition:zz({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},j),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),S=Xo(Xo({},k),{},{visibility:!p.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:b,style:S,ref:e.innerRef},e.children)}var Bz=y.memo(Fz),PP=()=>{var e;return(e=Ce(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Mg(){return Mg=Object.assign?Object.assign.bind():function(e){for(var t=1;tBe(e.x)&&Be(e.y),Nj=e=>e.base!=null&&Nf(e.base)&&Nf(e),Xl=e=>e.x,Zl=e=>e.y,Kz=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(by(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Sj["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Sj[r]||lh},Ej={connectNulls:!1,type:"linear"},Vz=e=>{var t=e.type,r=t===void 0?Ej.type:t,n=e.points,a=n===void 0?[]:n,o=e.baseLine,u=e.layout,l=e.connectNulls,f=l===void 0?Ej.connectNulls:l,h=Kz(r,u),p=f?a.filter(Nf):a;if(Array.isArray(o)){var v,x=a.map((N,P)=>kj(kj({},N),{},{base:o[P]}));u==="vertical"?v=Ad().y(Zl).x1(Xl).x0(N=>N.base.x):v=Ad().x(Xl).y1(Zl).y0(N=>N.base.y);var b=v.defined(Nj).curve(h),j=f?x.filter(Nj):x;return b(j)}var k;u==="vertical"&&Ne(o)?k=Ad().y(Zl).x1(Xl).x0(o):Ne(o)?k=Ad().x(Xl).y1(Zl).y0(o):k=rE().x(Xl).y(Zl);var S=k.defined(Nf).curve(h);return S(p)},Jd=e=>{var t=e.className,r=e.points,n=e.path,a=e.pathRef,o=Ws();if((!r||!r.length)&&!n)return null;var u={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},l=r&&r.length?Vz(u):n;return y.createElement("path",Mg({},dn(e),wy(e),{className:et("recharts-curve",t),d:l===null?void 0:l,ref:a}))},Gz=["x","y","top","left","width","height","className"];function Ig(){return Ig=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(a,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r),t6=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,a=n===void 0?0:n,o=e.top,u=o===void 0?0:o,l=e.left,f=l===void 0?0:l,h=e.width,p=h===void 0?0:h,v=e.height,x=v===void 0?0:v,b=e.className,j=Zz(e,Gz),k=qz({x:r,y:a,top:u,left:f,width:p,height:x},j);return!Ne(r)||!Ne(a)||!Ne(p)||!Ne(x)||!Ne(u)||!Ne(f)?null:y.createElement("path",Ig({},Vr(k),{className:et("recharts-cross",b),d:e6(r,a,p,x,u,f)}))};function r6(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var Ef=1e-4,CP=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],AP=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),Cj=(e,t)=>r=>{var n=CP(e,t);return AP(n,r)},n6=(e,t)=>r=>{var n=CP(e,t),a=[...n.map((o,u)=>o*u).slice(1),0];return AP(a,r)},i6=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var a=n.map(o=>parseFloat(o));return[a[0],a[1],a[2],a[3]]},a6=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var a=Cj(e,r),o=Cj(t,n),u=n6(e,r),l=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,v=p,x=0;x<8;++x){var b=a(v)-p,j=u(v);if(Math.abs(b-p)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,o=a===void 0?8:a,u=t.dt,l=u===void 0?16.67:u,f=1,h=[0],p=0,v=0,x=1e4,b=0;b{var P,O,C;if(N<=0)return 0;if(N>=1)return f;var _=N*S,A=Math.floor(_),I=_-A;return((P=h[A])!==null&&P!==void 0?P:0)+(((O=h[A+1])!==null&&O!==void 0?O:0)-((C=h[A])!==null&&C!==void 0?C:0))*I}},l6=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Aj(e);case"spring":return s6();default:if(e.split("(")[0]==="cubic-bezier")return Aj(e)}return typeof e=="function"?e:null},u6=(e,t,r)=>{var n,a=o=>{var u=t.tick(o);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(a,u);return}n=e.setTimeout(a,u)};return n=e.setTimeout(a,0),()=>{var o;return(o=n)===null||o===void 0?void 0:o()}},OP=y.createContext(u6);OP.Provider;function c6(e){var t=y.useContext(OP);return y.useMemo(()=>e??t,[e,t])}function d6(e,t,r){return(t=f6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f6(e){var t=h6(e,"string");return typeof t=="symbol"?t:t+""}function h6(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Oj="init",_j="pending",Mj="active",p6="completed";function cv(e){return Math.max(0,e)}class m6{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;d6(this,"state",Oj),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=cv(t.animationDuration),this.animationBegin=cv(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===Oj)return this.state=_j,this.beginStartedTime=t,this.animationBegin;if(this.getState()===_j){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=Mj,this.animationStartedTime=t,this.nextAnimationUpdate(0)):cv(this.animationBegin-r)}if(this.getState()===Mj){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=p6}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class v6 extends m6{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ni(this.getFrom(),this.getTo(),this.getProgress()))}}class g6{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),a=null,o=u=>{u-n>=r?t(u):a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!=null&&cancelAnimationFrame(a)}}}function y6(e,t){return j6(e)||w6(e,t)||b6(e,t)||x6()}function x6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function b6(e,t){if(e){if(typeof e=="string")return Ij(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ij(e,t):void 0}}function Ij(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},Tj=0,dv=1;function _P(e){var t=Qr(e,k6),r=t.animationId,n=t.isActive,a=t.canBegin,o=t.duration,u=t.easing,l=t.begin,f=t.onAnimationEnd,h=t.onAnimationStart,p=t.children,v=EP(),x=n==="auto"?!Ju.isSsr&&!v:n,b=c6(t.animationController),j=y.useState(x?Tj:dv),k=y6(j,2),S=k[0],N=k[1];return y.useEffect(()=>{x||N(dv)},[x]),y.useEffect(()=>{var P=l6(u);if(!x||!a||P==null)return Us;var O=new g6,C=new v6({animationId:r,easing:P,animationDuration:o,animationBegin:l,onAnimationStart:h,onAnimationEnd:f,from:Tj,to:dv});return b(O,C,N)},[b,r,x,a,o,u,l,h,f]),p(Number(S))}function MP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=y.useRef(Su(t)),n=y.useRef(e);return n.current!==e&&(r.current=Su(t),n.current=e),r.current}var S6=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),N6=(e,t,r)=>e.map(n=>"".concat(S6(n)," ").concat(t,"ms ").concat(r)).join(","),E6=["radius"],P6=["radius"],Dj,Rj,$j,Lj,zj,Fj,Bj,Uj,Wj,Hj;function Kj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Vj(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var o=ia(r),u=ia(n),l=Math.min(Math.abs(o)/2,Math.abs(u)/2),f=u>=0?1:-1,h=o>=0?1:-1,p=u>=0&&o>=0||u<0&&o<0?1:0,v;if(l>0&&Array.isArray(a)){for(var x=[0,0,0,0],b=0,j=4;bl?l:S}v=Bt(Dj||(Dj=wn(["M",",",""])),e,t+f*x[0]),x[0]>0&&(v+=Bt(Rj||(Rj=wn(["A ",",",",0,0,",",",",",""])),x[0],x[0],p,e+h*x[0],t)),v+=Bt($j||($j=wn(["L ",",",""])),e+r-h*x[1],t),x[1]>0&&(v+=Bt(Lj||(Lj=wn(["A ",",",",0,0,",`, - `,",",""])),x[1],x[1],p,e+r,t+f*x[1])),v+=Bt(zj||(zj=wn(["L ",",",""])),e+r,t+n-f*x[2]),x[2]>0&&(v+=Bt(Fj||(Fj=wn(["A ",",",",0,0,",`, - `,",",""])),x[2],x[2],p,e+r-h*x[2],t+n)),v+=Bt(Bj||(Bj=wn(["L ",",",""])),e+h*x[3],t+n),x[3]>0&&(v+=Bt(Uj||(Uj=wn(["A ",",",",0,0,",`, - `,",",""])),x[3],x[3],p,e,t+n-f*x[3])),v+="Z"}else if(l>0&&a===+a&&a>0){var N=Math.min(l,a);v=Bt(Wj||(Wj=wn(["M ",",",` + */var fk;function YL(){if(fk)return sv;fk=1;var e=Fs();function t(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var r=typeof Object.is=="function"?Object.is:t,n=e.useSyncExternalStore,a=e.useRef,o=e.useEffect,u=e.useMemo,l=e.useDebugValue;return sv.useSyncExternalStoreWithSelector=function(f,h,p,v,x){var b=a(null);if(b.current===null){var k={hasValue:!1,value:null};b.current=k}else k=b.current;b=u(function(){function S(_){if(!N){if(N=!0,P=_,_=v(_),x!==void 0&&k.hasValue){var A=k.value;if(x(A,_))return O=A}return O=_}if(A=O,r(P,_))return A;var I=v(_);return x!==void 0&&x(A,I)?(P=_,A):(P=_,O=I)}var N=!1,P,O,C=p===void 0?null:p;return[function(){return S(h())},C===null?void 0:function(){return S(C())}]},[h,p,v,x]);var j=n(f,b[0],b[1]);return o(function(){k.hasValue=!0,k.value=j},[j]),l(j),j},sv}var hk;function XL(){return hk||(hk=1,ov.exports=YL()),ov.exports}XL();function ZL(e){e()}function JL(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ZL(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const a=t={callback:r,next:null,prev:t};return a.prev?a.prev.next=a:e=a,function(){!n||e===null||(n=!1,a.next?a.next.prev=a.prev:t=a.prev,a.prev?a.prev.next=a.next:e=a.next)}}}}var pk={notify(){},get:()=>[]};function ez(e,t){let r,n=pk,a=0,o=!1;function u(j){p();const S=n.subscribe(j);let N=!1;return()=>{N||(N=!0,S(),v())}}function l(){n.notify()}function f(){k.onStateChange&&k.onStateChange()}function h(){return o}function p(){a++,r||(r=e.subscribe(f),n=JL())}function v(){a--,r&&a===0&&(r(),r=void 0,n.clear(),n=pk)}function x(){o||(o=!0,p())}function b(){o&&(o=!1,v())}const k={addNestedSub:u,notifyNestedSubs:l,handleChangeWrapper:f,isSubscribed:h,trySubscribe:x,tryUnsubscribe:b,getListeners:()=>n};return k}var tz=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",rz=tz(),nz=()=>typeof navigator<"u"&&navigator.product==="ReactNative",iz=nz(),az=()=>rz||iz?y.useLayoutEffect:y.useEffect,oz=az();function mk(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function sz(e,t){if(mk(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let a=0;a{const f=ez(a);return{store:a,subscription:f,getServerState:n?()=>n:void 0}},[a,n]),u=y.useMemo(()=>a.getState(),[a]);oz(()=>{const{subscription:f}=o;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),u!==a.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[o,u]);const l=r||uz;return y.createElement(l.Provider,{value:o},t)}var dz=cz,fz=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function hz(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function Ah(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(fz.has(n)){if(e[n]==null&&t[n]==null)continue;if(!sz(e[n],t[n]))return!1}else if(!hz(e[n],t[n]))return!1;return!0}function _g(){return _g=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.separator,r=t===void 0?Yo.separator:t,n=e.contentStyle,a=e.itemStyle,o=e.labelStyle,u=o===void 0?Yo.labelStyle:o,l=e.payload,f=e.formatter,h=e.itemSorter,p=e.wrapperClassName,v=e.labelClassName,x=e.label,b=e.labelFormatter,k=e.accessibilityLayer,j=k===void 0?Yo.accessibilityLayer:k,S=()=>{if(l&&l.length){var $={padding:0,margin:0},B=jz(l,h),K=B.map((q,R)=>{if(!q||q.type==="none")return null;var de=q.formatter||f||kz,Z=q.value,ge=q.name,ke=Z,me=ge;if(de){var Q=de(Z,ge,q,R,l);if(Array.isArray(Q)){var oe=gz(Q,2);ke=oe[0],me=oe[1]}else if(Q!=null)ke=Q;else return null}var X=Yl(Yl({},Yo.itemStyle),{},{color:q.color||Yo.itemStyle.color},a);return y.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(R),style:X},Dn(me)?y.createElement("span",{className:"recharts-tooltip-item-name"},me):null,Dn(me)?y.createElement("span",{className:"recharts-tooltip-item-separator"},r):null,y.createElement("span",{className:"recharts-tooltip-item-value"},ke),y.createElement("span",{className:"recharts-tooltip-item-unit"},q.unit||""))});return y.createElement("ul",{className:"recharts-tooltip-item-list",style:$},K)}return null},N=Yl(Yl({},Yo.contentStyle),n),P=Yl({margin:0},u),O=!Kt(x),C=O?x:"",_=et("recharts-default-tooltip",p),A=et("recharts-tooltip-label",v);O&&b&&l!==void 0&&l!==null&&(C=b(x,l));var I=j?{role:"status","aria-live":"assertive"}:{};return y.createElement("div",_g({className:_,style:N},I),y.createElement("p",{className:A,style:P},y.isValidElement(C)?C:"".concat(C)),S())},Xl="recharts-tooltip-wrapper",Nz={visibility:"hidden"};function Ez(e){var t=e.coordinate,r=e.translateX,n=e.translateY;return et(Xl,{["".concat(Xl,"-right")]:Ne(r)&&t&&Ne(t.x)&&r>=t.x,["".concat(Xl,"-left")]:Ne(r)&&t&&Ne(t.x)&&r=t.y,["".concat(Xl,"-top")]:Ne(n)&&t&&Ne(t.y)&&n0?a:0),v=r[n]+a;if(t[n])return u[n]?p:v;var x=f[n];if(x==null)return 0;if(u[n]){var b=p,k=x;return bS?Math.max(p,x):Math.max(v,x)}function Pz(e){var t=e.translateX,r=e.translateY,n=e.useTranslate3d;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function Cz(e){var t=e.allowEscapeViewBox,r=e.coordinate,n=e.offsetTop,a=e.offsetLeft,o=e.position,u=e.reverseDirection,l=e.tooltipBox,f=e.useTranslate3d,h=e.viewBox,p,v,x;return l.height>0&&l.width>0&&r?(v=yk({allowEscapeViewBox:t,coordinate:r,key:"x",offset:a,position:o,reverseDirection:u,tooltipDimension:l.width,viewBox:h,viewBoxDimension:h.width}),x=yk({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:o,reverseDirection:u,tooltipDimension:l.height,viewBox:h,viewBoxDimension:h.height}),p=Pz({translateX:v,translateY:x,useTranslate3d:f})):p=Nz,{cssProperties:p,cssClasses:Ez({translateX:v,translateY:x,coordinate:r})}}var Az=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),ec={isSsr:Az()};function Oz(e,t){return Tz(e)||Iz(e,t)||Mz(e,t)||_z()}function _z(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Mz(e,t){if(e){if(typeof e=="string")return xk(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?xk(e,t):void 0}}function xk(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rec.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),t=Oz(e,2),r=t[0],n=t[1];return y.useEffect(()=>{if(window.matchMedia){var a=window.matchMedia("(prefers-reduced-motion: reduce)"),o=()=>{n(a.matches)};return a.addEventListener("change",o),()=>{a.removeEventListener("change",o)}}},[]),r}function bk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Xo(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),h=Lz(f,2),p=h[0],v=h[1];y.useEffect(()=>{var N=P=>{if(P.key==="Escape"){var O,C,_,A;v({dismissed:!0,dismissedAtCoordinate:{x:(O=(C=e.coordinate)===null||C===void 0?void 0:C.x)!==null&&O!==void 0?O:0,y:(_=(A=e.coordinate)===null||A===void 0?void 0:A.y)!==null&&_!==void 0?_:0}})}};return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[(t=e.coordinate)===null||t===void 0?void 0:t.x,(r=e.coordinate)===null||r===void 0?void 0:r.y]),p.dismissed&&(((n=(a=e.coordinate)===null||a===void 0?void 0:a.x)!==null&&n!==void 0?n:0)!==p.dismissedAtCoordinate.x||((o=(u=e.coordinate)===null||u===void 0?void 0:u.y)!==null&&o!==void 0?o:0)!==p.dismissedAtCoordinate.y)&&v(Xo(Xo({},p),{},{dismissed:!1}));var x=Cz({allowEscapeViewBox:e.allowEscapeViewBox,coordinate:e.coordinate,offsetLeft:typeof e.offset=="number"?e.offset:e.offset.x,offsetTop:typeof e.offset=="number"?e.offset:e.offset.y,position:e.position,reverseDirection:e.reverseDirection,tooltipBox:{height:e.lastBoundingBox.height,width:e.lastBoundingBox.width},useTranslate3d:e.useTranslate3d,viewBox:e.viewBox}),b=x.cssClasses,k=x.cssProperties,j=e.hasPortalFromProps?{}:Xo(Xo({transition:Wz({prefersReducedMotion:l,isAnimationActive:e.isAnimationActive,active:e.active,animationDuration:e.animationDuration,animationEasing:e.animationEasing})},k),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),S=Xo(Xo({},j),{},{visibility:!p.dismissed&&e.active&&e.hasPayload?"visible":"hidden"},e.wrapperStyle);return y.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:b,style:S,ref:e.innerRef},e.children)}var Kz=y.memo(Hz),CP=()=>{var e;return(e=Ae(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function Mg(){return Mg=Object.assign?Object.assign.bind():function(e){for(var t=1;tBe(e.x)&&Be(e.y),Nk=e=>e.base!=null&&Nf(e.base)&&Nf(e),Zl=e=>e.x,Jl=e=>e.y,Qz=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(by(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=Sk["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return Sk[r]||lh},Ek={connectNulls:!1,type:"linear"},Yz=e=>{var t=e.type,r=t===void 0?Ek.type:t,n=e.points,a=n===void 0?[]:n,o=e.baseLine,u=e.layout,l=e.connectNulls,f=l===void 0?Ek.connectNulls:l,h=Qz(r,u),p=f?a.filter(Nf):a;if(Array.isArray(o)){var v,x=a.map((N,P)=>jk(jk({},N),{},{base:o[P]}));u==="vertical"?v=Ad().y(Jl).x1(Zl).x0(N=>N.base.x):v=Ad().x(Zl).y1(Jl).y0(N=>N.base.y);var b=v.defined(Nk).curve(h),k=f?x.filter(Nk):x;return b(k)}var j;u==="vertical"&&Ne(o)?j=Ad().y(Jl).x1(Zl).x0(o):Ne(o)?j=Ad().x(Zl).y1(Jl).y0(o):j=nE().x(Zl).y(Jl);var S=j.defined(Nf).curve(h);return S(p)},Jd=e=>{var t=e.className,r=e.points,n=e.path,a=e.pathRef,o=Ws();if((!r||!r.length)&&!n)return null;var u={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||o,connectNulls:e.connectNulls},l=r&&r.length?Yz(u):n;return y.createElement("path",Mg({},dn(e),wy(e),{className:et("recharts-curve",t),d:l===null?void 0:l,ref:a}))},Xz=["x","y","top","left","width","height","className"];function Ig(){return Ig=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(a,"v").concat(n,"M").concat(o,",").concat(t,"h").concat(r),a6=e=>{var t=e.x,r=t===void 0?0:t,n=e.y,a=n===void 0?0:n,o=e.top,u=o===void 0?0:o,l=e.left,f=l===void 0?0:l,h=e.width,p=h===void 0?0:h,v=e.height,x=v===void 0?0:v,b=e.className,k=r6(e,Xz),j=Zz({x:r,y:a,top:u,left:f,width:p,height:x},k);return!Ne(r)||!Ne(a)||!Ne(p)||!Ne(x)||!Ne(u)||!Ne(f)?null:y.createElement("path",Ig({},Gr(j),{className:et("recharts-cross",b),d:i6(r,a,p,x,u,f)}))};function o6(e,t,r,n){var a=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-a:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-a,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}var Ef=1e-4,AP=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],OP=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),Ck=(e,t)=>r=>{var n=AP(e,t);return OP(n,r)},s6=(e,t)=>r=>{var n=AP(e,t),a=[...n.map((o,u)=>o*u).slice(1),0];return OP(a,r)},l6=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var a=n.map(o=>parseFloat(o));return[a[0],a[1],a[2],a[3]]},u6=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var a=Ck(e,r),o=Ck(t,n),u=s6(e,r),l=h=>h>1?1:h<0?0:h,f=h=>{for(var p=h>1?1:h,v=p,x=0;x<8;++x){var b=a(v)-p,k=u(v);if(Math.abs(b-p)0&&arguments[0]!==void 0?arguments[0]:{},r=t.stiff,n=r===void 0?100:r,a=t.damping,o=a===void 0?8:a,u=t.dt,l=u===void 0?16.67:u,f=1,h=[0],p=0,v=0,x=1e4,b=0;b{var P,O,C;if(N<=0)return 0;if(N>=1)return f;var _=N*S,A=Math.floor(_),I=_-A;return((P=h[A])!==null&&P!==void 0?P:0)+(((O=h[A+1])!==null&&O!==void 0?O:0)-((C=h[A])!==null&&C!==void 0?C:0))*I}},f6=e=>{if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return Ak(e);case"spring":return d6();default:if(e.split("(")[0]==="cubic-bezier")return Ak(e)}return typeof e=="function"?e:null},h6=(e,t,r)=>{var n,a=o=>{var u=t.tick(o);if(t.getState()==="active"){if(r(t.getInterpolated()),t.getProgress()===1){t.complete(),n=void 0;return}n=e.setTimeout(a,u);return}n=e.setTimeout(a,u)};return n=e.setTimeout(a,0),()=>{var o;return(o=n)===null||o===void 0?void 0:o()}},_P=y.createContext(h6);_P.Provider;function p6(e){var t=y.useContext(_P);return y.useMemo(()=>e??t,[e,t])}function m6(e,t,r){return(t=v6(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function v6(e){var t=g6(e,"string");return typeof t=="symbol"?t:t+""}function g6(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ok="init",_k="pending",Mk="active",y6="completed";function cv(e){return Math.max(0,e)}class x6{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(t){var r;m6(this,"state",Ok),this.animationId=t.animationId,this.onAnimationEnd=t.onAnimationEnd,this.animationDuration=cv(t.animationDuration),this.animationBegin=cv(t.animationBegin),this.progress=0,this.from=t.from,this.to=t.to,this.easing=t.easing,(r=t.onAnimationStart)===null||r===void 0||r.call(t)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(t){if(this.getState()===Ok)return this.state=_k,this.beginStartedTime=t,this.animationBegin;if(this.getState()===_k){if(this.beginStartedTime==null)throw new Error;var r=t-this.beginStartedTime;return r>=this.animationBegin?(this.state=Mk,this.animationStartedTime=t,this.nextAnimationUpdate(0)):cv(this.animationBegin-r)}if(this.getState()===Mk){if(this.animationStartedTime==null)throw new Error;var n=t-this.animationStartedTime;return this.setProgress(n/this.animationDuration),this.nextAnimationUpdate(n)}return 0}setProgress(t){this.progress=Math.min(1,Math.max(0,t))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var t;(t=this.onAnimationEnd)===null||t===void 0||t.call(this)}this.state=y6}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class b6 extends x6{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(ni(this.getFrom(),this.getTo(),this.getProgress()))}}class w6{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),a=null,o=u=>{u-n>=r?t(u):a=requestAnimationFrame(o)};return a=requestAnimationFrame(o),()=>{a!=null&&cancelAnimationFrame(a)}}}function k6(e,t){return E6(e)||N6(e,t)||S6(e,t)||j6()}function j6(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S6(e,t){if(e){if(typeof e=="string")return Ik(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ik(e,t):void 0}}function Ik(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{},onAnimationStart:()=>{}},Tk=0,dv=1;function MP(e){var t=Qr(e,P6),r=t.animationId,n=t.isActive,a=t.canBegin,o=t.duration,u=t.easing,l=t.begin,f=t.onAnimationEnd,h=t.onAnimationStart,p=t.children,v=PP(),x=n==="auto"?!ec.isSsr&&!v:n,b=p6(t.animationController),k=y.useState(x?Tk:dv),j=k6(k,2),S=j[0],N=j[1];return y.useEffect(()=>{x||N(dv)},[x]),y.useEffect(()=>{var P=f6(u);if(!x||!a||P==null)return Us;var O=new w6,C=new b6({animationId:r,easing:P,animationDuration:o,animationBegin:l,onAnimationStart:h,onAnimationEnd:f,from:Tk,to:dv});return b(O,C,N)},[b,r,x,a,o,u,l,h,f]),p(Number(S))}function IP(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=y.useRef(Nu(t)),n=y.useRef(e);return n.current!==e&&(r.current=Nu(t),n.current=e),r.current}var C6=e=>e.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),A6=(e,t,r)=>e.map(n=>"".concat(C6(n)," ").concat(t,"ms ").concat(r)).join(","),O6=["radius"],_6=["radius"],Dk,Rk,$k,Lk,zk,Fk,Bk,Uk,Wk,Hk;function Kk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Gk(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{var o=ia(r),u=ia(n),l=Math.min(Math.abs(o)/2,Math.abs(u)/2),f=u>=0?1:-1,h=o>=0?1:-1,p=u>=0&&o>=0||u<0&&o<0?1:0,v;if(l>0&&Array.isArray(a)){for(var x=[0,0,0,0],b=0,k=4;bl?l:S}v=Bt(Dk||(Dk=wn(["M",",",""])),e,t+f*x[0]),x[0]>0&&(v+=Bt(Rk||(Rk=wn(["A ",",",",0,0,",",",",",""])),x[0],x[0],p,e+h*x[0],t)),v+=Bt($k||($k=wn(["L ",",",""])),e+r-h*x[1],t),x[1]>0&&(v+=Bt(Lk||(Lk=wn(["A ",",",",0,0,",`, + `,",",""])),x[1],x[1],p,e+r,t+f*x[1])),v+=Bt(zk||(zk=wn(["L ",",",""])),e+r,t+n-f*x[2]),x[2]>0&&(v+=Bt(Fk||(Fk=wn(["A ",",",",0,0,",`, + `,",",""])),x[2],x[2],p,e+r-h*x[2],t+n)),v+=Bt(Bk||(Bk=wn(["L ",",",""])),e+h*x[3],t+n),x[3]>0&&(v+=Bt(Uk||(Uk=wn(["A ",",",",0,0,",`, + `,",",""])),x[3],x[3],p,e,t+n-f*x[3])),v+="Z"}else if(l>0&&a===+a&&a>0){var N=Math.min(l,a);v=Bt(Wk||(Wk=wn(["M ",",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` A `,",",",0,0,",",",",",` L `,",",` - A `,",",",0,0,",",",","," Z"])),e,t+f*N,N,N,p,e+h*N,t,e+r-h*N,t,N,N,p,e+r,t+f*N,e+r,t+n-f*N,N,N,p,e+r-h*N,t+n,e+h*N,t+n,N,N,p,e,t+n-f*N)}else v=Bt(Hj||(Hj=wn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return v},Yj={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},$6=e=>{var t=Qr(e,Yj),r=y.useRef(null),n=y.useState(-1),a=M6(n,2),o=a[0],u=a[1];y.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var Q=r.current.getTotalLength();Q&&u(Q)}catch{}},[]);var l=t.x,f=t.y,h=t.width,p=t.height,v=t.radius,x=t.className,b=t.animationEasing,j=t.animationDuration,k=t.animationBegin,S=t.isAnimationActive,N=t.isUpdateAnimationActive,P=y.useRef(h),O=y.useRef(p),C=y.useRef(l),_=y.useRef(f),A=y.useMemo(()=>({x:l,y:f,width:h,height:p,radius:v}),[l,f,h,p,v]),I=MP(A,"rectangle-");if(l!==+l||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var U=et("recharts-rectangle",x);if(!N){var B=Vr(t);B.radius;var V=Gj(B,E6);return y.createElement("path",Pf({},V,{x:ia(l),y:ia(f),width:ia(h),height:ia(p),radius:typeof v=="number"?v:void 0,className:U,d:Qj(l,f,h,p,v)}))}var q=P.current,R=O.current,de=C.current,Z=_.current,ge="0px ".concat(o===-1?1:o,"px"),je="".concat(o,"px ").concat(o,"px"),me=N6(["strokeDasharray"],j,typeof b=="string"?b:Yj.animationEasing);return y.createElement(_P,{animationId:I,key:I,canBegin:o>0,duration:j,easing:b,isActive:N,begin:k},Q=>{var oe=ni(q,h,Q),X=ni(R,p,Q),$=ni(de,l,Q),T=ni(Z,f,Q);r.current&&(P.current=oe,O.current=X,C.current=$,_.current=T);var ee;S?Q>0?ee={transition:me,strokeDasharray:je}:ee={strokeDasharray:ge}:ee={strokeDasharray:je};var ne=Vr(t);ne.radius;var te=Gj(ne,P6);return y.createElement("path",Pf({},te,{radius:typeof v=="number"?v:void 0,className:U,d:Qj($,T,oe,X,v),ref:r,style:Vj(Vj({},ee),t.style)}))})};function Xj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Zj(e){for(var t=1;te*180/Math.PI,Ht=(e,t,r,n)=>({x:e+Math.cos(-Cf*n)*r,y:t+Math.sin(-Cf*n)*r}),U6=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},W6=(e,t)=>{var r=e.x,n=e.y,a=t.x,o=t.y;return Math.sqrt((r-a)**2+(n-o)**2)},H6=(e,t)=>{var r=e.x,n=e.y,a=t.cx,o=t.cy,u=W6({x:r,y:n},{x:a,y:o});if(u<=0)return{radius:u,angle:0};var l=(r-a)/u,f=Math.acos(l);return n>o&&(f=2*Math.PI-f),{radius:u,angle:B6(f),angleInRadian:f}},K6=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),a=Math.floor(r/360),o=Math.min(n,a);return{startAngle:t-o*360,endAngle:r-o*360}},V6=(e,t)=>{var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),o=Math.floor(n/360),u=Math.min(a,o);return e+u*360},G6=(e,t)=>{var r=e.relativeX,n=e.relativeY,a=H6({x:r,y:n},t),o=a.radius,u=a.angle,l=t.innerRadius,f=t.outerRadius;if(of||o===0)return null;var h=K6(t),p=h.startAngle,v=h.endAngle,x=u,b;if(p<=v){for(;x>v;)x-=360;for(;x=p&&x<=v}else{for(;x>p;)x-=360;for(;x=v&&x<=p}return b?Zj(Zj({},t),{},{radius:o,angle:V6(x,t)}):null};function IP(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,o=e.endAngle,u=Ht(t,r,n,a),l=Ht(t,r,n,o);return{points:[u,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:o}}var Jj,ek,tk,rk,nk,ik,ak;function Tg(){return Tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=Wr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},$d=e=>{var t=e.cx,r=e.cy,n=e.radius,a=e.angle,o=e.sign,u=e.isExternal,l=e.cornerRadius,f=e.cornerIsExternal,h=l*(u?1:-1)+n,p=Math.asin(l/h)/Cf,v=f?a:a+o*p,x=Ht(t,r,h,v),b=Ht(t,r,n,v),j=f?a-o*p:a,k=Ht(t,r,h*Math.cos(p*Cf),j);return{center:x,circleTangency:b,lineTangency:k,theta:p}},TP=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,a=e.outerRadius,o=e.startAngle,u=e.endAngle,l=q6(o,u),f=o+l,h=Ht(t,r,a,o),p=Ht(t,r,a,f),v=Bt(Jj||(Jj=Ba(["M ",",",` + A `,",",",0,0,",",",","," Z"])),e,t+f*N,N,N,p,e+h*N,t,e+r-h*N,t,N,N,p,e+r,t+f*N,e+r,t+n-f*N,N,N,p,e+r-h*N,t+n,e+h*N,t+n,N,N,p,e,t+n-f*N)}else v=Bt(Hk||(Hk=wn(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return v},Yk={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},B6=e=>{var t=Qr(e,Yk),r=y.useRef(null),n=y.useState(-1),a=R6(n,2),o=a[0],u=a[1];y.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var Q=r.current.getTotalLength();Q&&u(Q)}catch{}},[]);var l=t.x,f=t.y,h=t.width,p=t.height,v=t.radius,x=t.className,b=t.animationEasing,k=t.animationDuration,j=t.animationBegin,S=t.isAnimationActive,N=t.isUpdateAnimationActive,P=y.useRef(h),O=y.useRef(p),C=y.useRef(l),_=y.useRef(f),A=y.useMemo(()=>({x:l,y:f,width:h,height:p,radius:v}),[l,f,h,p,v]),I=IP(A,"rectangle-");if(l!==+l||f!==+f||h!==+h||p!==+p||h===0||p===0)return null;var $=et("recharts-rectangle",x);if(!N){var B=Gr(t);B.radius;var K=Vk(B,O6);return y.createElement("path",Pf({},K,{x:ia(l),y:ia(f),width:ia(h),height:ia(p),radius:typeof v=="number"?v:void 0,className:$,d:Qk(l,f,h,p,v)}))}var q=P.current,R=O.current,de=C.current,Z=_.current,ge="0px ".concat(o===-1?1:o,"px"),ke="".concat(o,"px ").concat(o,"px"),me=A6(["strokeDasharray"],k,typeof b=="string"?b:Yk.animationEasing);return y.createElement(MP,{animationId:I,key:I,canBegin:o>0,duration:k,easing:b,isActive:N,begin:j},Q=>{var oe=ni(q,h,Q),X=ni(R,p,Q),L=ni(de,l,Q),T=ni(Z,f,Q);r.current&&(P.current=oe,O.current=X,C.current=L,_.current=T);var ee;S?Q>0?ee={transition:me,strokeDasharray:ke}:ee={strokeDasharray:ge}:ee={strokeDasharray:ke};var ne=Gr(t);ne.radius;var te=Vk(ne,_6);return y.createElement("path",Pf({},te,{radius:typeof v=="number"?v:void 0,className:$,d:Qk(L,T,oe,X,v),ref:r,style:Gk(Gk({},ee),t.style)}))})};function Xk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Zk(e){for(var t=1;te*180/Math.PI,Ht=(e,t,r,n)=>({x:e+Math.cos(-Cf*n)*r,y:t+Math.sin(-Cf*n)*r}),G6=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},V6=(e,t)=>{var r=e.x,n=e.y,a=t.x,o=t.y;return Math.sqrt((r-a)**2+(n-o)**2)},q6=(e,t)=>{var r=e.x,n=e.y,a=t.cx,o=t.cy,u=V6({x:r,y:n},{x:a,y:o});if(u<=0)return{radius:u,angle:0};var l=(r-a)/u,f=Math.acos(l);return n>o&&(f=2*Math.PI-f),{radius:u,angle:K6(f),angleInRadian:f}},Q6=e=>{var t=e.startAngle,r=e.endAngle,n=Math.floor(t/360),a=Math.floor(r/360),o=Math.min(n,a);return{startAngle:t-o*360,endAngle:r-o*360}},Y6=(e,t)=>{var r=t.startAngle,n=t.endAngle,a=Math.floor(r/360),o=Math.floor(n/360),u=Math.min(a,o);return e+u*360},X6=(e,t)=>{var r=e.relativeX,n=e.relativeY,a=q6({x:r,y:n},t),o=a.radius,u=a.angle,l=t.innerRadius,f=t.outerRadius;if(of||o===0)return null;var h=Q6(t),p=h.startAngle,v=h.endAngle,x=u,b;if(p<=v){for(;x>v;)x-=360;for(;x=p&&x<=v}else{for(;x>p;)x-=360;for(;x=v&&x<=p}return b?Zk(Zk({},t),{},{radius:o,angle:Y6(x,t)}):null};function TP(e){var t=e.cx,r=e.cy,n=e.radius,a=e.startAngle,o=e.endAngle,u=Ht(t,r,n,a),l=Ht(t,r,n,o);return{points:[u,l],cx:t,cy:r,radius:n,startAngle:a,endAngle:o}}var Jk,ej,tj,rj,nj,ij,aj;function Tg(){return Tg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=Wr(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},$d=e=>{var t=e.cx,r=e.cy,n=e.radius,a=e.angle,o=e.sign,u=e.isExternal,l=e.cornerRadius,f=e.cornerIsExternal,h=l*(u?1:-1)+n,p=Math.asin(l/h)/Cf,v=f?a:a+o*p,x=Ht(t,r,h,v),b=Ht(t,r,n,v),k=f?a-o*p:a,j=Ht(t,r,h*Math.cos(p*Cf),k);return{center:x,circleTangency:b,lineTangency:j,theta:p}},DP=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,a=e.outerRadius,o=e.startAngle,u=e.endAngle,l=Z6(o,u),f=o+l,h=Ht(t,r,a,o),p=Ht(t,r,a,f),v=Bt(Jk||(Jk=Ba(["M ",",",` A `,",",`,0, `,",",`, `,",",` - `])),h.x,h.y,a,a,+(Math.abs(l)>180),+(o>f),p.x,p.y);if(n>0){var x=Ht(t,r,n,o),b=Ht(t,r,n,f);v+=Bt(ek||(ek=Ba(["L ",",",` + `])),h.x,h.y,a,a,+(Math.abs(l)>180),+(o>f),p.x,p.y);if(n>0){var x=Ht(t,r,n,o),b=Ht(t,r,n,f);v+=Bt(ej||(ej=Ba(["L ",",",` A `,",",`,0, `,",",`, - `,","," Z"])),b.x,b.y,n,n,+(Math.abs(l)>180),+(o<=f),x.x,x.y)}else v+=Bt(tk||(tk=Ba(["L ",","," Z"])),t,r);return v},Q6=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,u=e.forceCornerRadius,l=e.cornerIsExternal,f=e.startAngle,h=e.endAngle,p=Wr(h-f),v=$d({cx:t,cy:r,radius:a,angle:f,sign:p,cornerRadius:o,cornerIsExternal:l}),x=v.circleTangency,b=v.lineTangency,j=v.theta,k=$d({cx:t,cy:r,radius:a,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:l}),S=k.circleTangency,N=k.lineTangency,P=k.theta,O=l?Math.abs(f-h):Math.abs(f-h)-j-P;if(O<0)return u?Bt(rk||(rk=Ba(["M ",",",` + `,","," Z"])),b.x,b.y,n,n,+(Math.abs(l)>180),+(o<=f),x.x,x.y)}else v+=Bt(tj||(tj=Ba(["L ",","," Z"])),t,r);return v},J6=e=>{var t=e.cx,r=e.cy,n=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,u=e.forceCornerRadius,l=e.cornerIsExternal,f=e.startAngle,h=e.endAngle,p=Wr(h-f),v=$d({cx:t,cy:r,radius:a,angle:f,sign:p,cornerRadius:o,cornerIsExternal:l}),x=v.circleTangency,b=v.lineTangency,k=v.theta,j=$d({cx:t,cy:r,radius:a,angle:h,sign:-p,cornerRadius:o,cornerIsExternal:l}),S=j.circleTangency,N=j.lineTangency,P=j.theta,O=l?Math.abs(f-h):Math.abs(f-h)-k-P;if(O<0)return u?Bt(rj||(rj=Ba(["M ",",",` a`,",",",0,0,1,",`,0 a`,",",",0,0,1,",`,0 - `])),b.x,b.y,o,o,o*2,o,o,-o*2):TP({cx:t,cy:r,innerRadius:n,outerRadius:a,startAngle:f,endAngle:h});var C=Bt(nk||(nk=Ba(["M ",",",` + `])),b.x,b.y,o,o,o*2,o,o,-o*2):DP({cx:t,cy:r,innerRadius:n,outerRadius:a,startAngle:f,endAngle:h});var C=Bt(nj||(nj=Ba(["M ",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` A`,",",",0,0,",",",",",` - `])),b.x,b.y,o,o,+(p<0),x.x,x.y,a,a,+(O>180),+(p<0),S.x,S.y,o,o,+(p<0),N.x,N.y);if(n>0){var _=$d({cx:t,cy:r,radius:n,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=_.circleTangency,I=_.lineTangency,U=_.theta,B=$d({cx:t,cy:r,radius:n,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),V=B.circleTangency,q=B.lineTangency,R=B.theta,de=l?Math.abs(f-h):Math.abs(f-h)-U-R;if(de<0&&o===0)return"".concat(C,"L").concat(t,",").concat(r,"Z");C+=Bt(ik||(ik=Ba(["L",",",` + `])),b.x,b.y,o,o,+(p<0),x.x,x.y,a,a,+(O>180),+(p<0),S.x,S.y,o,o,+(p<0),N.x,N.y);if(n>0){var _=$d({cx:t,cy:r,radius:n,angle:f,sign:p,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),A=_.circleTangency,I=_.lineTangency,$=_.theta,B=$d({cx:t,cy:r,radius:n,angle:h,sign:-p,isExternal:!0,cornerRadius:o,cornerIsExternal:l}),K=B.circleTangency,q=B.lineTangency,R=B.theta,de=l?Math.abs(f-h):Math.abs(f-h)-$-R;if(de<0&&o===0)return"".concat(C,"L").concat(t,",").concat(r,"Z");C+=Bt(ij||(ij=Ba(["L",",",` A`,",",",0,0,",",",",",` A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),q.x,q.y,o,o,+(p<0),V.x,V.y,n,n,+(de>180),+(p>0),A.x,A.y,o,o,+(p<0),I.x,I.y)}else C+=Bt(ak||(ak=Ba(["L",",","Z"])),t,r);return C},Y6={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},X6=e=>{var t=Qr(e,Y6),r=t.cx,n=t.cy,a=t.innerRadius,o=t.outerRadius,u=t.cornerRadius,l=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,p=t.endAngle,v=t.className;if(o0&&Math.abs(h-p)<360?k=Q6({cx:r,cy:n,innerRadius:a,outerRadius:o,cornerRadius:Math.min(j,b/2),forceCornerRadius:l,cornerIsExternal:f,startAngle:h,endAngle:p}):k=TP({cx:r,cy:n,innerRadius:a,outerRadius:o,startAngle:h,endAngle:p}),y.createElement("path",Tg({},Vr(t),{className:x,d:k}))};function Z6(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(mE(t)){if(e==="centric"){var n=t.cx,a=t.cy,o=t.innerRadius,u=t.outerRadius,l=t.angle,f=Ht(n,a,o,l),h=Ht(n,a,u,l);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return IP(t)}}function J6(e){return AE(e)?NaN:Number(e)}function fv(e){return e?(e=J6(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function DP(e,t,r){r&&typeof r!="number"&&pg(e,t,r)&&(t=r=void 0),e=fv(e),t===void 0?(t=e,e=0):t=fv(t),r=r===void 0?ee.chartData,Dy=K([pn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Oh=(e,t,r,n)=>n?Dy(e):pn(e),eF=(e,t,r)=>r?Dy(e):pn(e),tF=K([Oh],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});K([Dy],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var rF=K([pn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function Ry(e,t){return oF(e)||aF(e,t)||iF(e,t)||nF()}function nF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iF(e,t){if(e){if(typeof e=="string")return ok(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ok(e,t):void 0}}function ok(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^o.s<0?1:-1;for(n=o.d.length,a=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===a?0:n>a^o.s<0?1:-1};be.decimalPlaces=be.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ot;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};be.dividedBy=be.div=function(e){return si(this,new this.constructor(e))};be.dividedToIntegerBy=be.idiv=function(e){var t=this,r=t.constructor;return Ye(si(t,new r(e),0,1),r.precision)};be.equals=be.eq=function(e){return!this.cmp(e)};be.exponent=function(){return bt(this)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){return this.cmp(e)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,r=this,n=r.constructor,a=n.precision,o=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ar))throw Error(qr+"NaN");if(r.s<1)throw Error(qr+(r.s?"NaN":"-Infinity"));return r.eq(Ar)?new n(0):(lt=!1,t=si(_u(r,o),_u(e,o),o),lt=!0,Ye(t,a))};be.minus=be.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?FP(t,e):LP(t,(e.s=-e.s,e))};be.modulo=be.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(qr+"NaN");return r.s?(lt=!1,t=si(r,e,0,1).times(e),lt=!0,r.minus(t)):Ye(new n(r),a)};be.naturalExponential=be.exp=function(){return zP(this)};be.naturalLogarithm=be.ln=function(){return _u(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};be.plus=be.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?LP(t,e):FP(t,(e.s=-e.s,e))};be.precision=be.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(to+e);if(t=bt(a)+1,n=a.d.length-1,r=n*ot+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};be.squareRoot=be.sqrt=function(){var e,t,r,n,a,o,u,l=this,f=l.constructor;if(l.s<1){if(!l.s)return new f(0);throw Error(qr+"NaN")}for(e=bt(l),lt=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=On(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Ks((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(a.toString()),r=f.precision,a=u=r+3;;)if(o=n,n=o.plus(si(l,o,u+2)).times(.5),On(o.d).slice(0,u)===(t=On(n.d)).slice(0,u)){if(t=t.slice(u-3,u+1),a==u&&t=="4999"){if(Ye(o,r+1,0),o.times(o).eq(l)){n=o;break}}else if(t!="9999")break;u+=4}return lt=!0,Ye(n,r)};be.times=be.mul=function(e){var t,r,n,a,o,u,l,f,h,p=this,v=p.constructor,x=p.d,b=(e=new v(e)).d;if(!p.s||!e.s)return new v(0);for(e.s*=p.s,r=p.e+e.e,f=x.length,h=b.length,f=0;){for(t=0,a=f+n;a>n;)l=o[a]+b[n]*x[a-n-1]+t,o[a--]=l%It|0,t=l/It|0;o[a]=(o[a]+t)%It|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,lt?Ye(e,v.precision):e};be.toDecimalPlaces=be.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:($n(e,0,Hs),t===void 0?t=n.rounding:$n(t,0,8),Ye(r,e+bt(r)+1,t))};be.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=co(n,!0):($n(e,0,Hs),t===void 0?t=a.rounding:$n(t,0,8),n=Ye(new a(n),e+1,t),r=co(n,!0,e+1)),r};be.toFixed=function(e,t){var r,n,a=this,o=a.constructor;return e===void 0?co(a):($n(e,0,Hs),t===void 0?t=o.rounding:$n(t,0,8),n=Ye(new o(a),e+bt(a)+1,t),r=co(n.abs(),!1,e+bt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};be.toInteger=be.toint=function(){var e=this,t=e.constructor;return Ye(new t(e),bt(e)+1,t.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(e){var t,r,n,a,o,u,l=this,f=l.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Ar);if(l=new f(l),!l.s){if(e.s<1)throw Error(qr+"Infinity");return l}if(l.eq(Ar))return l;if(n=f.precision,e.eq(Ar))return Ye(l,n);if(t=e.e,r=e.d.length-1,u=t>=r,o=l.s,u){if((r=p<0?-p:p)<=$P){for(a=new f(Ar),t=Math.ceil(n/ot+4),lt=!1;r%2&&(a=a.times(l),uk(a.d,t)),r=Ks(r/2),r!==0;)l=l.times(l),uk(l.d,t);return lt=!0,e.s<0?new f(Ar).div(a):Ye(a,n)}}else if(o<0)throw Error(qr+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,lt=!1,a=e.times(_u(l,n+h)),lt=!0,a=zP(a),a.s=o,a};be.toPrecision=function(e,t){var r,n,a=this,o=a.constructor;return e===void 0?(r=bt(a),n=co(a,r<=o.toExpNeg||r>=o.toExpPos)):($n(e,1,Hs),t===void 0?t=o.rounding:$n(t,0,8),a=Ye(new o(a),e,t),r=bt(a),n=co(a,e<=r||r<=o.toExpNeg,e)),n};be.toSignificantDigits=be.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):($n(e,1,Hs),t===void 0?t=n.rounding:$n(t,0,8)),Ye(new n(r),e,t)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=bt(e),r=e.constructor;return co(e,t<=r.toExpNeg||t>=r.toExpPos)};function LP(e,t){var r,n,a,o,u,l,f,h,p=e.constructor,v=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),lt?Ye(t,v):t;if(f=e.d,h=t.d,u=e.e,a=t.e,f=f.slice(),o=u-a,o){for(o<0?(n=f,o=-o,l=h.length):(n=h,a=u,l=f.length),u=Math.ceil(v/ot),l=u>l?u+1:l+1,o>l&&(o=l,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(l=f.length,o=h.length,l-o<0&&(o=l,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/It|0,f[o]%=It;for(r&&(f.unshift(r),++a),l=f.length;f[--l]==0;)f.pop();return t.d=f,t.e=a,lt?Ye(t,v):t}function $n(e,t,r){if(e!==~~e||er)throw Error(to+e)}function On(e){var t,r,n,a=e.length-1,o="",u=e[0];if(a>0){for(o+=u,t=1;tu?1:-1;else for(l=f=0;la[l]?1:-1;break}return f}function r(n,a,o){for(var u=0;o--;)n[o]-=u,u=n[o]1;)n.shift()}return function(n,a,o,u){var l,f,h,p,v,x,b,j,k,S,N,P,O,C,_,A,I,U,B=n.constructor,V=n.s==a.s?1:-1,q=n.d,R=a.d;if(!n.s)return new B(n);if(!a.s)throw Error(qr+"Division by zero");for(f=n.e-a.e,I=R.length,_=q.length,b=new B(V),j=b.d=[],h=0;R[h]==(q[h]||0);)++h;if(R[h]>(q[h]||0)&&--f,o==null?P=o=B.precision:u?P=o+(bt(n)-bt(a))+1:P=o,P<0)return new B(0);if(P=P/ot+2|0,h=0,I==1)for(p=0,R=R[0],P++;(h<_||p)&&P--;h++)O=p*It+(q[h]||0),j[h]=O/R|0,p=O%R|0;else{for(p=It/(R[0]+1)|0,p>1&&(R=e(R,p),q=e(q,p),I=R.length,_=q.length),C=I,k=q.slice(0,I),S=k.length;S=It/2&&++A;do p=0,l=t(R,k,I,S),l<0?(N=k[0],I!=S&&(N=N*It+(k[1]||0)),p=N/A|0,p>1?(p>=It&&(p=It-1),v=e(R,p),x=v.length,S=k.length,l=t(v,k,x,S),l==1&&(p--,r(v,I16)throw Error($y+bt(e));if(!e.s)return new p(Ar);for(lt=!1,l=v,u=new p(.03125);e.abs().gte(.1);)e=e.times(u),h+=5;for(n=Math.log(La(2,h))/Math.LN10*2+5|0,l+=n,r=a=o=new p(Ar),p.precision=l;;){if(a=Ye(a.times(e),l),r=r.times(++f),u=o.plus(si(a,r,l)),On(u.d).slice(0,l)===On(o.d).slice(0,l)){for(;h--;)o=Ye(o.times(o),l);return p.precision=v,t==null?(lt=!0,Ye(o,v)):o}o=u}}function bt(e){for(var t=e.e*ot,r=e.d[0];r>=10;r/=10)t++;return t}function hv(e,t,r){if(t>e.LN10.sd())throw lt=!0,r&&(e.precision=r),Error(qr+"LN10 precision limit exceeded");return Ye(new e(e.LN10),t)}function Gi(e){for(var t="";e--;)t+="0";return t}function _u(e,t){var r,n,a,o,u,l,f,h,p,v=1,x=10,b=e,j=b.d,k=b.constructor,S=k.precision;if(b.s<1)throw Error(qr+(b.s?"NaN":"-Infinity"));if(b.eq(Ar))return new k(0);if(t==null?(lt=!1,h=S):h=t,b.eq(10))return t==null&&(lt=!0),hv(k,h);if(h+=x,k.precision=h,r=On(j),n=r.charAt(0),o=bt(b),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=On(b.d),n=r.charAt(0),v++;o=bt(b),n>1?(b=new k("0."+r),o++):b=new k(n+"."+r.slice(1))}else return f=hv(k,h+2,S).times(o+""),b=_u(new k(n+"."+r.slice(1)),h-x).plus(f),k.precision=S,t==null?(lt=!0,Ye(b,S)):b;for(l=u=b=si(b.minus(Ar),b.plus(Ar),h),p=Ye(b.times(b),h),a=3;;){if(u=Ye(u.times(p),h),f=l.plus(si(u,new k(a),h)),On(f.d).slice(0,h)===On(l.d).slice(0,h))return l=l.times(2),o!==0&&(l=l.plus(hv(k,h+2,S).times(o+""))),l=si(l,new k(v),h),k.precision=S,t==null?(lt=!0,Ye(l,S)):l;l=f,a+=2}}function lk(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Ks(r/ot),e.d=[],n=(r+1)%ot,r<0&&(n+=ot),nAf||e.e<-Af))throw Error($y+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ye(e,t,r){var n,a,o,u,l,f,h,p,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(n=t-u,n<0)n+=ot,a=t,h=v[p=0];else{if(p=Math.ceil((n+1)/ot),o=v.length,p>=o)return e;for(h=o=v[p],u=1;o>=10;o/=10)u++;n%=ot,a=n-ot+u}if(r!==void 0&&(o=La(10,u-a-1),l=h/o%10|0,f=t<0||v[p+1]!==void 0||h%o,f=r<4?(l||f)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||f||r==6&&(n>0?a>0?h/La(10,u-a):0:v[p-1])%10&1||r==(e.s<0?8:7))),t<1||!v[0])return f?(o=bt(e),v.length=1,t=t-o-1,v[0]=La(10,(ot-t%ot)%ot),e.e=Ks(-t/ot)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(n==0?(v.length=p,o=1,p--):(v.length=p+1,o=La(10,ot-n),v[p]=a>0?(h/La(10,u-a)%La(10,a)|0)*o:0),f)for(;;)if(p==0){(v[0]+=o)==It&&(v[0]=1,++e.e);break}else{if(v[p]+=o,v[p]!=It)break;v[p--]=0,o=1}for(n=v.length;v[--n]===0;)v.pop();if(lt&&(e.e>Af||e.e<-Af))throw Error($y+bt(e));return e}function FP(e,t){var r,n,a,o,u,l,f,h,p,v,x=e.constructor,b=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),lt?Ye(t,b):t;if(f=e.d,v=t.d,n=t.e,h=e.e,f=f.slice(),u=h-n,u){for(p=u<0,p?(r=f,u=-u,l=v.length):(r=v,n=h,l=f.length),a=Math.max(Math.ceil(b/ot),l)+2,u>a&&(u=a,r.length=1),r.reverse(),a=u;a--;)r.push(0);r.reverse()}else{for(a=f.length,l=v.length,p=a0;--a)f[l++]=0;for(a=v.length;a>u;){if(f[--a]0?o=o.charAt(0)+"."+o.slice(1)+Gi(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+Gi(-a-1)+o,r&&(n=r-u)>0&&(o+=Gi(n))):a>=u?(o+=Gi(a+1-u),r&&(n=r-a-1)>0&&(o=o+"."+Gi(n))):((n=a+1)0&&(a+1===u&&(o+="."),o+=Gi(n))),e.s<0?"-"+o:o}function uk(e,t){if(e.length>t)return e.length=t,!0}function BP(e){var t,r,n;function a(o){var u=this;if(!(u instanceof a))return new a(o);if(u.constructor=a,o instanceof a){u.s=o.s,u.e=o.e,u.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(to+o);if(o>0)u.s=1;else if(o<0)o=-o,u.s=-1;else{u.s=0,u.e=0,u.d=[0];return}if(o===~~o&&o<1e7){u.e=0,u.d=[o];return}return lk(u,o.toString())}else if(typeof o!="string")throw Error(to+o);if(o.charCodeAt(0)===45?(o=o.slice(1),u.s=-1):u.s=1,uF.test(o))lk(u,o);else throw Error(to+o)}if(a.prototype=be,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=BP,a.config=a.set=cF,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(to+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(to+r+": "+n);return this}var Ly=BP(lF);Ar=new Ly(1);const We=Ly;function UP(e){var t;return e===0?t=1:t=Math.floor(new We(e).abs().log(10).toNumber())+1,t}function WP(e,t,r){for(var n=new We(e),a=0,o=[];n.lt(t)&&a<1e5;)o.push(n.toNumber()),n=n.add(r),a++;return o}function Mu(e,t){return pF(e)||hF(e,t)||fF(e,t)||dF()}function dF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fF(e,t){if(e){if(typeof e=="string")return ck(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ck(e,t):void 0}}function ck(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Mu(e,2),r=t[0],n=t[1],a=r,o=n;return r>n&&(a=n,o=r),[a,o]},zy=(e,t,r)=>{if(e.lte(0))return new We(0);var n=UP(e.toNumber()),a=new We(10).pow(n),o=e.div(a),u=n!==1?.05:.1,l=new We(Math.ceil(o.div(u).toNumber())).add(r).mul(u),f=l.mul(a);return t?new We(f.toNumber()):new We(Math.ceil(f.toNumber()))},KP=(e,t,r)=>{var n;if(e.lte(0))return new We(0);var a=[1,2,2.5,5],o=e.toNumber(),u=Math.floor(new We(o).abs().log(10).toNumber()),l=new We(10).pow(u),f=e.div(l).toNumber(),h=a.findIndex(b=>b>=f-1e-10);if(h===-1&&(l=l.mul(10),h=0),h+=r,h>=a.length){var p=Math.floor(h/a.length);h%=a.length,l=l.mul(new We(10).pow(p))}var v=(n=a[h])!==null&&n!==void 0?n:1,x=new We(v).mul(l);return t?x:new We(Math.ceil(x.toNumber()))},mF=(e,t,r)=>{var n=new We(1),a=new We(e);if(!a.isint()&&r){var o=Math.abs(e);o<1?(n=new We(10).pow(UP(e)-1),a=new We(Math.floor(a.div(n).toNumber())).mul(n)):o>1&&(a=new We(Math.floor(e)))}else e===0?a=new We(Math.floor((t-1)/2)):r||(a=new We(Math.floor(e)));for(var u=Math.floor((t-1)/2),l=[],f=0;f4&&arguments[4]!==void 0?arguments[4]:0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:zy;if(!Number.isFinite((r-t)/(n-1)))return{step:new We(0),tickMin:new We(0),tickMax:new We(0)};var l=u(new We(r).sub(t).div(n-1),a,o),f;t<=0&&r>=0?f=new We(0):(f=new We(t).add(r).div(2),f=f.sub(new We(f).mod(l)));var h=Math.ceil(f.sub(t).div(l).toNumber()),p=Math.ceil(new We(r).sub(f).div(l).toNumber()),v=h+p+1;return v>n?VP(t,r,n,a,o+1,u):(v0?p+(n-v):p,h=r>0?h:h+(n-v)),{step:l,tickMin:f.sub(new We(h).mul(l)),tickMax:f.add(new We(p).mul(l))})},dk=function(t){var r=Mu(t,2),n=r[0],a=r[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=Math.max(o,2),h=HP([n,a]),p=Mu(h,2),v=p[0],x=p[1];if(v===-1/0||x===1/0){var b=x===1/0?[v,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),x];return n>a?b.reverse():b}if(v===x)return mF(v,o,u);var j=l==="snap125"?KP:zy,k=VP(v,x,f,u,0,j),S=k.step,N=k.tickMin,P=k.tickMax,O=WP(N,P.add(new We(.1).mul(S)),S);return n>a?O.reverse():O},fk=function(t,r){var n=Mu(t,2),a=n[0],o=n[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=HP([a,o]),h=Mu(f,2),p=h[0],v=h[1];if(p===-1/0||v===1/0)return[a,o];if(p===v)return[p];var x=l==="snap125"?KP:zy,b=Math.max(r,2),j=x(new We(v).sub(p).div(b-1),u,0),k=[...WP(new We(p),new We(v),j),v];return u===!1&&(k=k.map(S=>Math.round(S))),a>o?k.reverse():k},vF=e=>e.rootProps.barCategoryGap,_h=e=>e.rootProps.stackOffset,GP=e=>e.rootProps.reverseStackOrder,Fy=e=>e.options.chartName,By=e=>e.rootProps.syncId,qP=e=>e.rootProps.syncMethod,Uy=e=>e.options.eventEmitter,gF=e=>e.rootProps.baseValue,or={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},_a={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},jn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Mh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ih(e,t,r){if(r!=="auto")return r;if(e!=null)return zn(e,t)?"category":"number"}function hk(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Of(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Wy=K([wF,yP],(e,t)=>{var r;if(e!=null)return e;var n=(r=Ih(t,"angleAxis",pk.type))!==null&&r!==void 0?r:"category";return Of(Of({},pk),{},{type:n})}),jF=(e,t)=>e.polarAxis.radiusAxis[t],Hy=K([jF,yP],(e,t)=>{var r;if(e!=null)return e;var n=(r=Ih(t,"radiusAxis",mk.type))!==null&&r!==void 0?r:"category";return Of(Of({},mk),{},{type:n})}),Th=e=>e.polarOptions,Ky=K([hi,pi,Gt],U6),QP=K([Th,Ky],(e,t)=>{if(e!=null)return da(e.innerRadius,t,0)}),YP=K([Th,Ky],(e,t)=>{if(e!=null)return da(e.outerRadius,t,t*.8)}),kF=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},XP=K([Th],kF);K([Wy,XP],Mh);var ZP=K([Ky,QP,YP],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});K([Hy,ZP],Mh);var JP=K([ut,Th,QP,YP,hi,pi],(e,t,r,n,a,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var u=t.cx,l=t.cy,f=t.startAngle,h=t.endAngle;return{cx:da(u,a,a/2),cy:da(l,o,o/2),innerRadius:r,outerRadius:n,startAngle:f,endAngle:h,clockWise:!1}}}),Dt=(e,t)=>t,Dh=(e,t,r)=>r;function Vy(e){return e==null?void 0:e.id}function eC(e,t,r){var n=t.chartData,a=n===void 0?[]:n,o=r.allowDuplicatedCategory,u=r.dataKey,l=new Map;return e.forEach(f=>{var h,p=(h=f.data)!==null&&h!==void 0?h:a;if(!(p==null||p.length===0)){var v=Vy(f);p.forEach((x,b)=>{var j=u==null||o?b:String(Tt(x,u,null)),k=Tt(x,f.dataKey,0),S;l.has(j)?S=l.get(j):S={},Object.assign(S,{[v]:k}),l.set(j,S)})}}),Array.from(l.values())}function Gy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Rh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function $h(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function SF(e,t){if(e.length===t.length){for(var r=0;r{var t=ut(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Vs=e=>e.tooltip.settings.axisId;function qy(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),a=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(o){function u(){return o.apply(this,arguments)}return u.toString=function(){return o.toString()},u})(()=>a),rangeMin:()=>a[0],rangeMax:()=>a[1],isInRange(o){var u=a[0],l=a[1];return u<=l?o>=u&&o<=l:o>=l&&o<=u},bandwidth:r?()=>r.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,u)=>{var l=e(o);if(l!=null){if(e.bandwidth&&u!==null&&u!==void 0&&u.position){var f=e.bandwidth();switch(u.position){case"middle":l+=f/2;break;case"end":l+=f;break}}return l}}}}}var NF=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Mn(t)){for(var r,n,a=0;an)&&(n=o))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function la(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function EF(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Qy(e){let t,r,n;e.length!==2?(t=la,r=(l,f)=>la(e(l),f),n=(l,f)=>e(l)-f):(t=e===la||e===EF?e:PF,r=e,n=e);function a(l,f,h=0,p=l.length){if(h>>1;r(l[v],f)<0?h=v+1:p=v}while(h>>1;r(l[v],f)<=0?h=v+1:p=v}while(hh&&n(l[v-1],f)>-n(l[v],f)?v-1:v}return{left:a,center:u,right:o}}function PF(){return 0}function tC(e){return e===null?NaN:+e}function*CF(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const AF=Qy(la),ec=AF.right;Qy(tC).center;class vk extends Map{constructor(t,r=MF){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(gk(this,t))}has(t){return super.has(gk(this,t))}set(t,r){return super.set(OF(this,t),r)}delete(t){return super.delete(_F(this,t))}}function gk({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function OF({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function _F({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function MF(e){return e!==null&&typeof e=="object"?e.valueOf():e}function IF(e=la){if(e===la)return rC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function rC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const TF=Math.sqrt(50),DF=Math.sqrt(10),RF=Math.sqrt(2);function _f(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),o=n/Math.pow(10,a),u=o>=TF?10:o>=DF?5:o>=RF?2:1;let l,f,h;return a<0?(h=Math.pow(10,-a)/u,l=Math.round(e*h),f=Math.round(t*h),l/ht&&--f,h=-h):(h=Math.pow(10,a)*u,l=Math.round(e/h),f=Math.round(t/h),l*ht&&--f),f0))return[];if(e===t)return[e];const n=t=a))return[];const l=o-a+1,f=new Array(l);if(n)if(u<0)for(let h=0;h=n)&&(r=n);return r}function xk(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function nC(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?rC:IF(a);n>r;){if(n-r>600){const f=n-r+1,h=t-r+1,p=Math.log(f),v=.5*Math.exp(2*p/3),x=.5*Math.sqrt(p*v*(f-v)/f)*(h-f/2<0?-1:1),b=Math.max(r,Math.floor(t-h*v/f+x)),j=Math.min(n,Math.floor(t+(f-h)*v/f+x));nC(e,t,b,j,a)}const o=e[t];let u=r,l=n;for(Jl(e,r,t),a(e[n],o)>0&&Jl(e,r,n);u0;)--l}a(e[r],o)===0?Jl(e,r,l):(++l,Jl(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function Jl(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function $F(e,t,r){if(e=Float64Array.from(CF(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return xk(e);if(t>=1)return yk(e);var n,a=(n-1)*t,o=Math.floor(a),u=yk(nC(e,o).subarray(0,o+1)),l=xk(e.subarray(o+1));return u+(l-u)*(a-o)}}function LF(e,t,r=tC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,o=Math.floor(a),u=+r(e[o],o,e),l=+r(e[o+1],o+1,e);return u+(l-u)*(a-o)}}function zF(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ld(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ld(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=UF.exec(e))?new xr(t[1],t[2],t[3],1):(t=WF.exec(e))?new xr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=HF.exec(e))?Ld(t[1],t[2],t[3],t[4]):(t=KF.exec(e))?Ld(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=VF.exec(e))?Ek(t[1],t[2]/100,t[3]/100,1):(t=GF.exec(e))?Ek(t[1],t[2]/100,t[3]/100,t[4]):bk.hasOwnProperty(e)?kk(bk[e]):e==="transparent"?new xr(NaN,NaN,NaN,0):null}function kk(e){return new xr(e>>16&255,e>>8&255,e&255,1)}function Ld(e,t,r,n){return n<=0&&(e=t=r=NaN),new xr(e,t,r,n)}function YF(e){return e instanceof tc||(e=Du(e)),e?(e=e.rgb(),new xr(e.r,e.g,e.b,e.opacity)):new xr}function zg(e,t,r,n){return arguments.length===1?YF(e):new xr(e,t,r,n??1)}function xr(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Zy(xr,zg,aC(tc,{brighter(e){return e=e==null?Mf:Math.pow(Mf,e),new xr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Iu:Math.pow(Iu,e),new xr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new xr(ro(this.r),ro(this.g),ro(this.b),If(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:Sk,formatHex:Sk,formatHex8:XF,formatRgb:Nk,toString:Nk}));function Sk(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}`}function XF(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}${Ua((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nk(){const e=If(this.opacity);return`${e===1?"rgb(":"rgba("}${ro(this.r)}, ${ro(this.g)}, ${ro(this.b)}${e===1?")":`, ${e})`}`}function If(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ro(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ua(e){return e=ro(e),(e<16?"0":"")+e.toString(16)}function Ek(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new cn(e,t,r,n)}function oC(e){if(e instanceof cn)return new cn(e.h,e.s,e.l,e.opacity);if(e instanceof tc||(e=Du(e)),!e)return new cn;if(e instanceof cn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),u=NaN,l=o-a,f=(o+a)/2;return l?(t===o?u=(r-n)/l+(r0&&f<1?0:u,new cn(u,l,f,e.opacity)}function ZF(e,t,r,n){return arguments.length===1?oC(e):new cn(e,t,r,n??1)}function cn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Zy(cn,ZF,aC(tc,{brighter(e){return e=e==null?Mf:Math.pow(Mf,e),new cn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Iu:Math.pow(Iu,e),new cn(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new xr(pv(e>=240?e-240:e+120,a,n),pv(e,a,n),pv(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new cn(Pk(this.h),zd(this.s),zd(this.l),If(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=If(this.opacity);return`${e===1?"hsl(":"hsla("}${Pk(this.h)}, ${zd(this.s)*100}%, ${zd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Pk(e){return e=(e||0)%360,e<0?e+360:e}function zd(e){return Math.max(0,Math.min(1,e||0))}function pv(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Jy=e=>()=>e;function JF(e,t){return function(r){return e+r*t}}function e8(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function t8(e){return(e=+e)==1?sC:function(t,r){return r-t?e8(t,r,e):Jy(isNaN(t)?r:t)}}function sC(e,t){var r=t-e;return r?JF(e,r):Jy(isNaN(e)?t:e)}const Ck=(function e(t){var r=t8(t);function n(a,o){var u=r((a=zg(a)).r,(o=zg(o)).r),l=r(a.g,o.g),f=r(a.b,o.b),h=sC(a.opacity,o.opacity);return function(p){return a.r=u(p),a.g=l(p),a.b=f(p),a.opacity=h(p),a+""}}return n.gamma=e,n})(1);function r8(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(o){for(a=0;ar&&(o=t.slice(r,o),l[u]?l[u]+=o:l[++u]=o),(n=n[0])===(a=a[0])?l[u]?l[u]+=a:l[++u]=a:(l[++u]=null,f.push({i:u,x:Tf(n,a)})),r=mv.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function h8(e,t,r){var n=e[0],a=e[1],o=t[0],u=t[1];return a2?p8:h8,f=h=null,v}function v(x){return x==null||isNaN(x=+x)?o:(f||(f=l(e.map(n),t,r)))(n(u(x)))}return v.invert=function(x){return u(a((h||(h=l(t,e.map(n),Tf)))(x)))},v.domain=function(x){return arguments.length?(e=Array.from(x,Df),p()):e.slice()},v.range=function(x){return arguments.length?(t=Array.from(x),p()):t.slice()},v.rangeRound=function(x){return t=Array.from(x),r=e0,p()},v.clamp=function(x){return arguments.length?(u=x?!0:sr,p()):u!==sr},v.interpolate=function(x){return arguments.length?(r=x,p()):r},v.unknown=function(x){return arguments.length?(o=x,v):o},function(x,b){return n=x,a=b,p()}}function t0(){return Lh()(sr,sr)}function m8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Rf(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ts(e){return e=Rf(Math.abs(e)),e?e[1]:NaN}function v8(e,t){return function(r,n){for(var a=r.length,o=[],u=0,l=e[0],f=0;a>0&&l>0&&(f+l+1>n&&(l=Math.max(1,n-f)),o.push(r.substring(a-=l,a+l)),!((f+=l+1)>n));)l=e[u=(u+1)%e.length];return o.reverse().join(t)}}function g8(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var y8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ru(e){if(!(t=y8.exec(e)))throw new Error("invalid format: "+e);var t;return new r0({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]})}Ru.prototype=r0.prototype;function r0(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+""}r0.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 x8(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var $f;function b8(e,t){var r=Rf(e,t);if(!r)return $f=void 0,e.toPrecision(t);var n=r[0],a=r[1],o=a-($f=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,u=n.length;return o===u?n:o>u?n+new Array(o-u+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Rf(e,Math.max(0,t+o-1))[0]}function Ok(e,t){var r=Rf(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const _k={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:m8,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)=>Ok(e*100,t),r:Ok,s:b8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Mk(e){return e}var Ik=Array.prototype.map,Tk=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function w8(e){var t=e.grouping===void 0||e.thousands===void 0?Mk:v8(Ik.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Mk:g8(Ik.call(e.numerals,String)),u=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(v,x){v=Ru(v);var b=v.fill,j=v.align,k=v.sign,S=v.symbol,N=v.zero,P=v.width,O=v.comma,C=v.precision,_=v.trim,A=v.type;A==="n"?(O=!0,A="g"):_k[A]||(C===void 0&&(C=12),_=!0,A="g"),(N||b==="0"&&j==="=")&&(N=!0,b="0",j="=");var I=(x&&x.prefix!==void 0?x.prefix:"")+(S==="$"?r:S==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),U=(S==="$"?n:/[%p]/.test(A)?u:"")+(x&&x.suffix!==void 0?x.suffix:""),B=_k[A],V=/[defgprs%]/.test(A);C=C===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function q(R){var de=I,Z=U,ge,je,me;if(A==="c")Z=B(R)+Z,R="";else{R=+R;var Q=R<0||1/R<0;if(R=isNaN(R)?f:B(Math.abs(R),C),_&&(R=x8(R)),Q&&+R==0&&k!=="+"&&(Q=!1),de=(Q?k==="("?k:l:k==="-"||k==="("?"":k)+de,Z=(A==="s"&&!isNaN(R)&&$f!==void 0?Tk[8+$f/3]:"")+Z+(Q&&k==="("?")":""),V){for(ge=-1,je=R.length;++geme||me>57){Z=(me===46?a+R.slice(ge+1):R.slice(ge))+Z,R=R.slice(0,ge);break}}}O&&!N&&(R=t(R,1/0));var oe=de.length+R.length+Z.length,X=oe>1)+de+R+Z+X.slice(oe);break;default:R=X+de+R+Z;break}return o(R)}return q.toString=function(){return v+""},q}function p(v,x){var b=Math.max(-8,Math.min(8,Math.floor(Ts(x)/3)))*3,j=Math.pow(10,-b),k=h((v=Ru(v),v.type="f",v),{suffix:Tk[8+b/3]});return function(S){return k(j*S)}}return{format:h,formatPrefix:p}}var Fd,n0,lC;j8({thousands:",",grouping:[3],currency:["$",""]});function j8(e){return Fd=w8(e),n0=Fd.format,lC=Fd.formatPrefix,Fd}function k8(e){return Math.max(0,-Ts(Math.abs(e)))}function S8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ts(t)/3)))*3-Ts(Math.abs(e)))}function N8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ts(t)-Ts(e))+1}function uC(e,t,r,n){var a=$g(e,t,r),o;switch(n=Ru(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=S8(a,u))&&(n.precision=o),lC(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=N8(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=k8(a))&&(n.precision=o-(n.type==="%")*2);break}}return n0(n)}function fa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Dg(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return uC(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,o=n.length-1,u=n[a],l=n[o],f,h,p=10;for(l0;){if(h=Rg(u,l,r),h===f)return n[a]=u,n[o]=l,t(n);if(h>0)u=Math.floor(u/h)*h,l=Math.ceil(l/h)*h;else if(h<0)u=Math.ceil(u*h)/h,l=Math.floor(l*h)/h;else break;f=h}return e},e}function cC(){var e=t0();return e.copy=function(){return rc(e,cC())},Yr.apply(e,arguments),fa(e)}function dC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Df),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return dC(e).unknown(t)},e=arguments.length?Array.from(e,Df):[0,1],fa(r)}function fC(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],o=e[n],u;return oMath.pow(e,t)}function O8(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 $k(e){return(t,r)=>-e(-t,r)}function i0(e){const t=e(Dk,Rk),r=t.domain;let n=10,a,o;function u(){return a=O8(n),o=A8(n),r()[0]<0?(a=$k(a),o=$k(o),e(E8,P8)):e(Dk,Rk),t}return t.base=function(l){return arguments.length?(n=+l,u()):n},t.domain=function(l){return arguments.length?(r(l),u()):r()},t.ticks=l=>{const f=r();let h=f[0],p=f[f.length-1];const v=p0){for(;x<=b;++x)for(j=1;jp)break;N.push(k)}}else for(;x<=b;++x)for(j=n-1;j>=1;--j)if(k=x>0?j/o(-x):j*o(x),!(kp)break;N.push(k)}N.length*2{if(l==null&&(l=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=Ru(f)).precision==null&&(f.trim=!0),f=n0(f)),l===1/0)return f;const h=Math.max(1,n*l/t.ticks().length);return p=>{let v=p/o(Math.round(a(p)));return v*nr(fC(r(),{floor:l=>o(Math.floor(a(l))),ceil:l=>o(Math.ceil(a(l)))})),t}function hC(){const e=i0(Lh()).domain([1,10]);return e.copy=()=>rc(e,hC()).base(e.base()),Yr.apply(e,arguments),e}function Lk(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zk(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function a0(e){var t=1,r=e(Lk(t),zk(t));return r.constant=function(n){return arguments.length?e(Lk(t=+n),zk(t)):t},fa(r)}function pC(){var e=a0(Lh());return e.copy=function(){return rc(e,pC()).constant(e.constant())},Yr.apply(e,arguments)}function Fk(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function _8(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function M8(e){return e<0?-e*e:e*e}function o0(e){var t=e(sr,sr),r=1;function n(){return r===1?e(sr,sr):r===.5?e(_8,M8):e(Fk(r),Fk(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},fa(t)}function s0(){var e=o0(Lh());return e.copy=function(){return rc(e,s0()).exponent(e.exponent())},Yr.apply(e,arguments),e}function I8(){return s0.apply(null,arguments).exponent(.5)}function Bk(e){return Math.sign(e)*e*e}function T8(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function mC(){var e=t0(),t=[0,1],r=!1,n;function a(o){var u=T8(e(o));return isNaN(u)?n:r?Math.round(u):u}return a.invert=function(o){return e.invert(Bk(o))},a.domain=function(o){return arguments.length?(e.domain(o),a):e.domain()},a.range=function(o){return arguments.length?(e.range((t=Array.from(o,Df)).map(Bk)),a):t.slice()},a.rangeRound=function(o){return a.range(o).round(!0)},a.round=function(o){return arguments.length?(r=!!o,a):r},a.clamp=function(o){return arguments.length?(e.clamp(o),a):e.clamp()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return mC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Yr.apply(a,arguments),fa(a)}function vC(){var e=[],t=[],r=[],n;function a(){var u=0,l=Math.max(1,t.length);for(r=new Array(l-1);++u0?r[l-1]:e[0],l=r?[n[r-1],t]:[n[h-1],n[h]]},u.unknown=function(f){return arguments.length&&(o=f),u},u.thresholds=function(){return n.slice()},u.copy=function(){return gC().domain([e,t]).range(a).unknown(o)},Yr.apply(fa(u),arguments)}function yC(){var e=[.5],t=[0,1],r,n=1;function a(o){return o!=null&&o<=o?t[ec(e,o,0,n)]:r}return a.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(o){var u=t.indexOf(o);return[e[u-1],e[u]]},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return yC().domain(e).range(t).unknown(r)},Yr.apply(a,arguments)}const vv=new Date,gv=new Date;function Pt(e,t,r,n){function a(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return a.floor=o=>(e(o=new Date(+o)),o),a.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),a.round=o=>{const u=a(o),l=a.ceil(o);return o-u(t(o=new Date(+o),u==null?1:Math.floor(u)),o),a.range=(o,u,l)=>{const f=[];if(o=a.ceil(o),l=l==null?1:Math.floor(l),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,l),e(o);while(hPt(u=>{if(u>=u)for(;e(u),!o(u);)u.setTime(u-1)},(u,l)=>{if(u>=u)if(l<0)for(;++l<=0;)for(;t(u,-1),!o(u););else for(;--l>=0;)for(;t(u,1),!o(u););}),r&&(a.count=(o,u)=>(vv.setTime(+o),gv.setTime(+u),e(vv),e(gv),Math.floor(r(vv,gv))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(n?u=>n(u)%o===0:u=>a.count(0,u)%o===0):a)),a}const Lf=Pt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Lf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Lf);Lf.range;const ii=1e3,Kr=ii*60,ai=Kr*60,ci=ai*24,l0=ci*7,Uk=ci*30,yv=ci*365,Wa=Pt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getUTCSeconds());Wa.range;const u0=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ii)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getMinutes());u0.range;const c0=Pt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCMinutes());c0.range;const d0=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ii-e.getMinutes()*Kr)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getHours());d0.range;const f0=Pt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getUTCHours());f0.range;const nc=Pt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kr)/ci,e=>e.getDate()-1);nc.range;const zh=Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ci,e=>e.getUTCDate()-1);zh.range;const xC=Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ci,e=>Math.floor(e/ci));xC.range;function yo(e){return Pt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Kr)/l0)}const Fh=yo(0),zf=yo(1),D8=yo(2),R8=yo(3),Ds=yo(4),$8=yo(5),L8=yo(6);Fh.range;zf.range;D8.range;R8.range;Ds.range;$8.range;L8.range;function xo(e){return Pt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/l0)}const Bh=xo(0),Ff=xo(1),z8=xo(2),F8=xo(3),Rs=xo(4),B8=xo(5),U8=xo(6);Bh.range;Ff.range;z8.range;F8.range;Rs.range;B8.range;U8.range;const h0=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());h0.range;const p0=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());p0.range;const di=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());di.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,r)=>{t.setFullYear(t.getFullYear()+r*e)});di.range;const fi=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());fi.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,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});fi.range;function bC(e,t,r,n,a,o){const u=[[Wa,1,ii],[Wa,5,5*ii],[Wa,15,15*ii],[Wa,30,30*ii],[o,1,Kr],[o,5,5*Kr],[o,15,15*Kr],[o,30,30*Kr],[a,1,ai],[a,3,3*ai],[a,6,6*ai],[a,12,12*ai],[n,1,ci],[n,2,2*ci],[r,1,l0],[t,1,Uk],[t,3,3*Uk],[e,1,yv]];function l(h,p,v){const x=pS).right(u,x);if(b===u.length)return e.every($g(h/yv,p/yv,v));if(b===0)return Lf.every(Math.max($g(h,p,v),1));const[j,k]=u[x/u[b-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Y=bv(eu(ae.y,0,1)),ce=Y.getUTCDay(),Y=ce>4||ce===0?Ff.ceil(Y):Ff(Y),Y=zh.offset(Y,(ae.V-1)*7),ae.y=Y.getUTCFullYear(),ae.m=Y.getUTCMonth(),ae.d=Y.getUTCDate()+(ae.w+6)%7):(Y=xv(eu(ae.y,0,1)),ce=Y.getDay(),Y=ce>4||ce===0?zf.ceil(Y):zf(Y),Y=nc.offset(Y,(ae.V-1)*7),ae.y=Y.getFullYear(),ae.m=Y.getMonth(),ae.d=Y.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),ce="Z"in ae?bv(eu(ae.y,0,1)).getUTCDay():xv(eu(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(ce+5)%7:ae.w+ae.U*7-(ce+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,bv(ae)):xv(ae)}}function U(J,ke,Oe,ae){for(var Xe=0,Y=ke.length,ce=Oe.length,tt,jr;Xe=ce)return-1;if(tt=ke.charCodeAt(Xe++),tt===37){if(tt=ke.charAt(Xe++),jr=_[tt in Wk?ke.charAt(Xe++):tt],!jr||(ae=jr(J,Oe,ae))<0)return-1}else if(tt!=Oe.charCodeAt(ae++))return-1}return ae}function B(J,ke,Oe){var ae=h.exec(ke.slice(Oe));return ae?(J.p=p.get(ae[0].toLowerCase()),Oe+ae[0].length):-1}function V(J,ke,Oe){var ae=b.exec(ke.slice(Oe));return ae?(J.w=j.get(ae[0].toLowerCase()),Oe+ae[0].length):-1}function q(J,ke,Oe){var ae=v.exec(ke.slice(Oe));return ae?(J.w=x.get(ae[0].toLowerCase()),Oe+ae[0].length):-1}function R(J,ke,Oe){var ae=N.exec(ke.slice(Oe));return ae?(J.m=P.get(ae[0].toLowerCase()),Oe+ae[0].length):-1}function de(J,ke,Oe){var ae=k.exec(ke.slice(Oe));return ae?(J.m=S.get(ae[0].toLowerCase()),Oe+ae[0].length):-1}function Z(J,ke,Oe){return U(J,t,ke,Oe)}function ge(J,ke,Oe){return U(J,r,ke,Oe)}function je(J,ke,Oe){return U(J,n,ke,Oe)}function me(J){return u[J.getDay()]}function Q(J){return o[J.getDay()]}function oe(J){return f[J.getMonth()]}function X(J){return l[J.getMonth()]}function $(J){return a[+(J.getHours()>=12)]}function T(J){return 1+~~(J.getMonth()/3)}function ee(J){return u[J.getUTCDay()]}function ne(J){return o[J.getUTCDay()]}function te(J){return f[J.getUTCMonth()]}function ue(J){return l[J.getUTCMonth()]}function pe(J){return a[+(J.getUTCHours()>=12)]}function Ae(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var ke=A(J+="",O);return ke.toString=function(){return J},ke},parse:function(J){var ke=I(J+="",!1);return ke.toString=function(){return J},ke},utcFormat:function(J){var ke=A(J+="",C);return ke.toString=function(){return J},ke},utcParse:function(J){var ke=I(J+="",!0);return ke.toString=function(){return J},ke}}}var Wk={"-":"",_:" ",0:"0"},$t=/^\s*\d+/,q8=/^%/,Q8=/[\\^$*+?|[\]().{}]/g;function Ve(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",o=a.length;return n+(o[t.toLowerCase(),r]))}function X8(e,t,r){var n=$t.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function Z8(e,t,r){var n=$t.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function J8(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function eB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function tB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Hk(e,t,r){var n=$t.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Kk(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function rB(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function nB(e,t,r){var n=$t.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function iB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Vk(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function aB(e,t,r){var n=$t.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Gk(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function oB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function sB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function lB(e,t,r){var n=$t.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function uB(e,t,r){var n=$t.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function cB(e,t,r){var n=q8.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function dB(e,t,r){var n=$t.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function fB(e,t,r){var n=$t.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function qk(e,t){return Ve(e.getDate(),t,2)}function hB(e,t){return Ve(e.getHours(),t,2)}function pB(e,t){return Ve(e.getHours()%12||12,t,2)}function mB(e,t){return Ve(1+nc.count(di(e),e),t,3)}function wC(e,t){return Ve(e.getMilliseconds(),t,3)}function vB(e,t){return wC(e,t)+"000"}function gB(e,t){return Ve(e.getMonth()+1,t,2)}function yB(e,t){return Ve(e.getMinutes(),t,2)}function xB(e,t){return Ve(e.getSeconds(),t,2)}function bB(e){var t=e.getDay();return t===0?7:t}function wB(e,t){return Ve(Fh.count(di(e)-1,e),t,2)}function jC(e){var t=e.getDay();return t>=4||t===0?Ds(e):Ds.ceil(e)}function jB(e,t){return e=jC(e),Ve(Ds.count(di(e),e)+(di(e).getDay()===4),t,2)}function kB(e){return e.getDay()}function SB(e,t){return Ve(zf.count(di(e)-1,e),t,2)}function NB(e,t){return Ve(e.getFullYear()%100,t,2)}function EB(e,t){return e=jC(e),Ve(e.getFullYear()%100,t,2)}function PB(e,t){return Ve(e.getFullYear()%1e4,t,4)}function CB(e,t){var r=e.getDay();return e=r>=4||r===0?Ds(e):Ds.ceil(e),Ve(e.getFullYear()%1e4,t,4)}function AB(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ve(t/60|0,"0",2)+Ve(t%60,"0",2)}function Qk(e,t){return Ve(e.getUTCDate(),t,2)}function OB(e,t){return Ve(e.getUTCHours(),t,2)}function _B(e,t){return Ve(e.getUTCHours()%12||12,t,2)}function MB(e,t){return Ve(1+zh.count(fi(e),e),t,3)}function kC(e,t){return Ve(e.getUTCMilliseconds(),t,3)}function IB(e,t){return kC(e,t)+"000"}function TB(e,t){return Ve(e.getUTCMonth()+1,t,2)}function DB(e,t){return Ve(e.getUTCMinutes(),t,2)}function RB(e,t){return Ve(e.getUTCSeconds(),t,2)}function $B(e){var t=e.getUTCDay();return t===0?7:t}function LB(e,t){return Ve(Bh.count(fi(e)-1,e),t,2)}function SC(e){var t=e.getUTCDay();return t>=4||t===0?Rs(e):Rs.ceil(e)}function zB(e,t){return e=SC(e),Ve(Rs.count(fi(e),e)+(fi(e).getUTCDay()===4),t,2)}function FB(e){return e.getUTCDay()}function BB(e,t){return Ve(Ff.count(fi(e)-1,e),t,2)}function UB(e,t){return Ve(e.getUTCFullYear()%100,t,2)}function WB(e,t){return e=SC(e),Ve(e.getUTCFullYear()%100,t,2)}function HB(e,t){return Ve(e.getUTCFullYear()%1e4,t,4)}function KB(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Rs(e):Rs.ceil(e),Ve(e.getUTCFullYear()%1e4,t,4)}function VB(){return"+0000"}function Yk(){return"%"}function Xk(e){return+e}function Zk(e){return Math.floor(+e/1e3)}var Zo,NC,EC;GB({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 GB(e){return Zo=G8(e),NC=Zo.format,Zo.parse,EC=Zo.utcFormat,Zo.utcParse,Zo}function qB(e){return new Date(e)}function QB(e){return e instanceof Date?+e:+new Date(+e)}function m0(e,t,r,n,a,o,u,l,f,h){var p=t0(),v=p.invert,x=p.domain,b=h(".%L"),j=h(":%S"),k=h("%I:%M"),S=h("%I %p"),N=h("%a %d"),P=h("%b %d"),O=h("%B"),C=h("%Y");function _(A){return(f(A)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,o)=>$F(e,o/n))},r.copy=function(){return OC(t).domain(e)},mi.apply(r,arguments)}function Wh(){var e=0,t=.5,r=1,n=1,a,o,u,l,f,h=sr,p,v=!1,x;function b(k){return isNaN(k=+k)?x:(k=.5+((k=+p(k))-o)*(n*k{if(e!=null){var n=e.scale,a=e.type;if(n==="auto")return a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":a==="category"?"band":"linear";if(typeof n=="string")return r9(n)?n:"point"}};function n9(e,t){for(var r=0,n=e.length,a=e[0]t)?r=o+1:n=o}return r}function RC(e,t){if(e){var r=t??e.domain(),n=r.map(o=>{var u;return(u=e(o))!==null&&u!==void 0?u:0}),a=e.range();if(!(r.length===0||a.length<2))return o=>{var u,l,f=n9(n,o);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var h=(u=n[f-1])!==null&&u!==void 0?u:0,p=(l=n[f])!==null&&l!==void 0?l:0;return Math.abs(o-h)<=Math.abs(o-p)?r[f-1]:r[f]}}}function i9(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):RC(e,void 0)}function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],vi=(e,t)=>{var r=LC(e,t);return r??St},Nt={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Ug,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,niceTicks:"auto",width:Qu},zC=(e,t)=>e.cartesianAxis.yAxis[t],gi=(e,t)=>{var r=zC(e,t);return r??Nt},f9={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:""},x0=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??f9},ur=(e,t,r)=>{switch(t){case"xAxis":return vi(e,r);case"yAxis":return gi(e,r);case"zAxis":return x0(e,r);case"angleAxis":return Wy(e,r);case"radiusAxis":return Hy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},h9=(e,t,r)=>{switch(t){case"xAxis":return vi(e,r);case"yAxis":return gi(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},ic=(e,t,r)=>{switch(t){case"xAxis":return vi(e,r);case"yAxis":return gi(e,r);case"angleAxis":return Wy(e,r);case"radiusAxis":return Hy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},FC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function BC(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var UC=e=>e.graphicalItems.cartesianItems,p9=K([Dt,Dh],BC),WC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),qs=K([UC,ur,p9],WC,{memoizeOptions:{resultEqualityCheck:$h}}),HC=K([qs],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Gy)),KC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),m9=K([qs],KC),VC=e=>e.map(t=>t.data).filter(Boolean).flat(1),v9=K([qs],e=>e.some(t=>!t.data)),GC=K([qs],VC,{memoizeOptions:{resultEqualityCheck:$h}}),qC=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,a=t.dataStartIndex,o=t.dataEndIndex;return e.length>0?e:n.slice(a,o+1)},b0=K([GC,Oh],qC),g9=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Tt(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(a=>({value:Tt(a,n)}))):e.map(n=>({value:n})),QC=(e,t,r,n,a,o)=>{var u=n.chartData,l=u===void 0?[]:u,f=n.dataStartIndex,h=n.dataEndIndex,p=g9(e,t,r);if(a&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var v=l.slice(f,h+1),x=v.map(b=>({value:Tt(b,t.dataKey)})).filter(b=>b.value!=null);return[...x,...p]}return p},ac=K([b0,ur,qs,Oh,v9,GC],QC);function hs(e){if(Dn(e)||e instanceof Date){var t=Number(e);if(Be(t))return t}}function rS(e){if(Array.isArray(e)){var t=[hs(e[0]),hs(e[1])];return Mn(t)?t:void 0}var r=hs(e);if(r!=null)return[r,r]}function Ln(e){return e.map(hs).filter(yr)}function y9(e,t){var r=hs(e),n=hs(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var x9=K([ac],e=>e==null?void 0:e.map(t=>t.value).sort(y9));function YC(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function b9(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Tn(t))n=t;else if(Array.isArray(t)){var a=Ln(t);a.length>0&&(n=Math.max(...a))}return n==null?[]:Ln(r.flatMap(o=>{var u=Tt(e,o.dataKey),l,f;if(Array.isArray(u)){var h=$C(u,2);l=h[0],f=h[1]}else l=f=u;if(!(!Be(l)||!Be(f)))return[n-l,n+f]}))}var Ct=e=>{var t=Rt(e),r=Vs(e);return ic(e,t,r)},$s=K([Ct],e=>e==null?void 0:e.dataKey),w9=K([HC,Oh,Ct],eC),XC=(e,t,r,n)=>{var a={},o=t.reduce((u,l)=>{if(l.stackId==null)return u;var f=u[l.stackId];return f==null&&(f=[]),f.push(l),u[l.stackId]=f,u},a);return Object.fromEntries(Object.entries(o).map(u=>{var l=$C(u,2),f=l[0],h=l[1],p=n?[...h].reverse():h,v=p.map(Vy);return[f,{stackedData:z$(e,v,r),graphicalItems:p}]}))},ZC=K([w9,HC,_h,GP],XC),JC=(e,t,r,n)=>{var a=t.dataStartIndex,o=t.dataEndIndex;if(n==null&&r!=="zAxis")return W$(e,a,o)},j9=K([ur],e=>e.allowDataOverflow),w0=e=>{var t;if(e==null||!("domain"in e))return Ug;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Ln(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Ug},eA=K([ur],w0),tA=K([eA,j9],RP),k9=K([ZC,pn,Dt,tA],JC,{memoizeOptions:{resultEqualityCheck:Rh}}),j0=e=>e.errorBars,S9=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>YC(r,n)),Uf=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],l,f;if(n.length>0&&n.forEach(h=>{var p,v=h.data!=null?[...h.data]:u,x=(p=a[h.id])===null||p===void 0?void 0:p.filter(b=>YC(o,b));v.forEach(b=>{var j,k=Tt(b,(j=r.dataKey)!==null&&j!==void 0?j:h.dataKey),S=b9(b,k,x);if(S.length>=2){var N=Math.min(...S),P=Math.max(...S);(l==null||Nf)&&(f=P)}var O=rS(k);O!=null&&(l=l==null?O[0]:Math.min(l,O[0]),f=f==null?O[1]:Math.max(f,O[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(h=>{var p=rS(Tt(h,r.dataKey));p!=null&&(l=l==null?p[0]:Math.min(l,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),Be(l)&&Be(f))return[l,f]},N9=K([b0,ur,m9,j0,Dt,tF],rA,{memoizeOptions:{resultEqualityCheck:Rh}});function E9(e){var t=e.value;if(Dn(t)||t instanceof Date)return t}var P9=(e,t,r)=>{var n=e.map(E9).filter(a=>a!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&hE(n))?DP(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},nA=e=>e.referenceElements.dots,Qs=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),C9=K([nA,Dt,Dh],Qs),iA=e=>e.referenceElements.areas,A9=K([iA,Dt,Dh],Qs),aA=e=>e.referenceElements.lines,O9=K([aA,Dt,Dh],Qs),oA=(e,t)=>{if(e!=null){var r=Ln(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},_9=K(C9,Dt,oA),sA=(e,t)=>{if(e!=null){var r=Ln(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},M9=K([A9,Dt],sA);function I9(e){var t;if(e.x!=null)return Ln([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Ln(r)}function T9(e){var t;if(e.y!=null)return Ln([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Ln(r)}var lA=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?I9(n):T9(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},D9=K([O9,Dt],lA),R9=K(_9,D9,M9,(e,t,r)=>Uf(e,r,t)),uA=(e,t,r,n,a,o,u,l)=>{if(r!=null)return r;var f=u==="vertical"&&l==="xAxis"||u==="horizontal"&&l==="yAxis",h=f?Uf(n,o,a):Uf(o,a);return sF(t,h,e.allowDataOverflow)},$9=K([ur,eA,tA,k9,N9,R9,ut,Dt],uA,{memoizeOptions:{resultEqualityCheck:Rh}}),L9=[0,1],cA=(e,t,r,n,a,o,u)=>{if(!((e==null||r==null||r.length===0)&&u===void 0)){var l=e.dataKey,f=e.type,h=zn(t,o);if(h&&l==null){var p;return DP(0,(p=r==null?void 0:r.length)!==null&&p!==void 0?p:0)}return f==="category"?P9(n,e,h):a==="expand"&&!h?L9:u}},k0=K([ur,ut,b0,ac,_h,Dt,$9],cA),Ys=K([ur,FC,Fy],DC),dA=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var a=w0(t),o=Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Mn(e)){if(o)return dk(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return fk(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(o&&Mn(e))return dk(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Mn(e))return fk(e,t.tickCount,t.allowDecimals,"adaptive")}}},S0=K([k0,ic,Ys],dA),fA=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Mn(t)&&Array.isArray(r)&&r.length>0){var a,o,u=t[0],l=(a=r[0])!==null&&a!==void 0?a:0,f=t[1],h=(o=r[r.length-1])!==null&&o!==void 0?o:0;return[Math.min(u,l),Math.max(f,h)]}return t},z9=K([ur,k0,S0,Dt],fA),F9=K(ac,ur,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Ln(e.map(v=>v.value))).sort((v,x)=>v-x),a=n[0],o=n[n.length-1];if(a==null||o==null)return 1/0;var u=o-a;if(u===0)return 1/0;for(var l=0;la,(e,t,r,n,a)=>{if(!Be(e))return 0;var o=t==="vertical"?n.height:n.width;if(a==="gap")return e*o/2;if(a==="no-gap"){var u=da(r,e*o),l=e*o/2;return l-u-(l-u)/o*u}return 0}),B9=(e,t,r)=>{var n=vi(e,t);return n==null||typeof n.padding!="string"?0:hA(e,"xAxis",t,r,n.padding)},U9=(e,t,r)=>{var n=gi(e,t);return n==null||typeof n.padding!="string"?0:hA(e,"yAxis",t,r,n.padding)},W9=K(vi,B9,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var a=e.padding;return typeof a=="string"?{left:t,right:t}:{left:((r=a.left)!==null&&r!==void 0?r:0)+t,right:((n=a.right)!==null&&n!==void 0?n:0)+t}}),H9=K(gi,U9,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var a=e.padding;return typeof a=="string"?{top:t,bottom:t}:{top:((r=a.top)!==null&&r!==void 0?r:0)+t,bottom:((n=a.bottom)!==null&&n!==void 0?n:0)+t}}),pA=K([Gt,W9,Sh,kh,(e,t,r)=>r],(e,t,r,n,a)=>{var o=n.padding;return a?[o.left,r.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),mA=K([Gt,ut,H9,Sh,kh,(e,t,r)=>r],(e,t,r,n,a,o)=>{var u=a.padding;return o?[n.height-u.bottom,u.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),oc=(e,t,r,n)=>{var a;switch(t){case"xAxis":return pA(e,r,n);case"yAxis":return mA(e,r,n);case"zAxis":return(a=x0(e,r))===null||a===void 0?void 0:a.range;case"angleAxis":return XP(e);case"radiusAxis":return ZP(e,r);default:return}},vA=K([ur,oc],Mh),K9=K([Ys,z9],NF),N0=K([ur,Ys,K9,vA],y0),gA=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var a=r.type,o=r.scale,u=zn(e,n);if(u&&(a==="number"||o!=="auto"))return t.map(l=>l.value)}},E0=K([ut,ac,ic,Dt],gA),Hh=K([N0],qy);K([N0],i9);K([N0,x9],RC);K([qs,j0,Dt],S9);function yA(e,t){return e.idt.id?1:0}var Kh=(e,t)=>t,Vh=(e,t,r)=>r,V9=K(wh,Kh,Vh,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(yA)),G9=K(jh,Kh,Vh,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(yA)),xA=(e,t)=>({width:e.width,height:t.height}),q9=(e,t)=>{var r=typeof t.width=="number"?t.width:Qu;return{width:r,height:e.height}},Q9=K(Gt,vi,xA),Y9=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},X9=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},Z9=K(pi,Gt,V9,Kh,Vh,(e,t,r,n,a)=>{var o={},u;return r.forEach(l=>{var f=xA(t,l);u==null&&(u=Y9(t,n,e));var h=n==="top"&&!a||n==="bottom"&&a;o[l.id]=u-Number(h)*f.height,u+=(h?-1:1)*f.height}),o}),J9=K(hi,Gt,G9,Kh,Vh,(e,t,r,n,a)=>{var o={},u;return r.forEach(l=>{var f=q9(t,l);u==null&&(u=X9(t,n,e));var h=n==="left"&&!a||n==="right"&&a;o[l.id]=u-Number(h)*f.width,u+=(h?-1:1)*f.width}),o}),eU=(e,t)=>{var r=vi(e,t);if(r!=null)return Z9(e,r.orientation,r.mirror)},tU=K([Gt,vi,eU,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var a=r==null?void 0:r[n];return a==null?{x:e.left,y:0}:{x:e.left,y:a}}}),rU=(e,t)=>{var r=gi(e,t);if(r!=null)return J9(e,r.orientation,r.mirror)},nU=K([Gt,gi,rU,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var a=r==null?void 0:r[n];return a==null?{x:0,y:e.top}:{x:a,y:e.top}}}),iU=K(Gt,gi,(e,t)=>{var r=typeof t.width=="number"?t.width:Qu;return{width:r,height:e.height}}),bA=(e,t,r,n)=>{if(r!=null){var a=r.allowDuplicatedCategory,o=r.type,u=r.dataKey,l=zn(e,n),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(u&&l&&o==="category"&&a&&hE(h))return f}},P0=K([ut,ac,ur,Dt],bA),nS=K([ut,h9,Ys,Hh,P0,E0,oc,S0,Dt],(e,t,r,n,a,o,u,l,f)=>{if(t!=null){var h=zn(e,f);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:f,categoricalDomain:o,duplicateDomain:a,isCategorical:h,niceTicks:l,range:u,realScaleType:r,scale:n}}}),aU=(e,t,r,n,a,o,u,l,f)=>{if(!(t==null||n==null)){var h=zn(e,f),p=t.type,v=t.ticks,x=t.tickCount,b=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,j=p==="category"&&n.bandwidth?n.bandwidth()/b:0;j=f==="angleAxis"&&o!=null&&o.length>=2?Wr(o[0]-o[1])*2*j:j;var k=v||a;return k?k.map((S,N)=>{var P=u?u.indexOf(S):S,O=n.map(P);return Be(O)?{index:N,coordinate:O+j,value:S,offset:j}:null}).filter(yr):h&&l?l.map((S,N)=>{var P=n.map(S);return Be(P)?{coordinate:P+j,value:S,index:N,offset:j}:null}).filter(yr):n.ticks?n.ticks(x).map((S,N)=>{var P=n.map(S);return Be(P)?{coordinate:P+j,value:S,index:N,offset:j}:null}).filter(yr):n.domain().map((S,N)=>{var P=n.map(S);return Be(P)?{coordinate:P+j,value:u?u[S]:S,index:N,offset:j}:null}).filter(yr)}},wA=K([ut,ic,Ys,Hh,S0,oc,P0,E0,Dt],aU),oU=(e,t,r,n,a,o,u)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=zn(e,u),f=t.tickCount,h=0;return h=u==="angleAxis"&&(n==null?void 0:n.length)>=2?Wr(n[0]-n[1])*2*h:h,l&&o?o.map((p,v)=>{var x=r.map(p);return Be(x)?{coordinate:x+h,value:p,index:v,offset:h}:null}).filter(yr):r.ticks?r.ticks(f).map((p,v)=>{var x=r.map(p);return Be(x)?{coordinate:x+h,value:p,index:v,offset:h}:null}).filter(yr):r.domain().map((p,v)=>{var x=r.map(p);return Be(x)?{coordinate:x+h,value:a?a[p]:p,index:v,offset:h}:null}).filter(yr)}},jA=K([ut,ic,Hh,oc,P0,E0,Dt],oU),kA=K(ur,Hh,(e,t)=>{if(!(e==null||t==null))return Bf(Bf({},e),{},{scale:t})}),sU=K([ur,Ys,k0,vA],y0),lU=K([sU],qy);K((e,t,r)=>x0(e,r),lU,(e,t)=>{if(!(e==null||t==null))return Bf(Bf({},e),{},{scale:t})});var uU=K([ut,wh,jh],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),cU=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};K([cU],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,a=e[0];for(var o of e){var u=Math.abs(o.coordinate-t);ue.options.defaultTooltipEventType,NA=e=>e.options.validateTooltipEventTypes;function EA(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function sc(e,t){var r=SA(e),n=NA(e);return EA(t,r,n)}function dU(e){return Ce(t=>sc(t,e))}var PA=(e,t)=>{var r,n=Number(t);if(!(Tn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},fU=e=>e.tooltip.settings,Qi={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},hU={itemInteraction:{click:Qi,hover:Qi},axisInteraction:{click:Qi,hover:Qi},keyboardInteraction:Qi,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}},CA=rr({name:"tooltip",initialState:hU,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:at()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=a)},prepare:at()},removeTooltipEntrySettings:{reducer(e,t){var r=Hr(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:at()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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}}}),Xr=CA.actions,pU=Xr.addTooltipEntrySettings,mU=Xr.replaceTooltipEntrySettings,vU=Xr.removeTooltipEntrySettings,gU=Xr.setTooltipSettingsState,yU=Xr.setActiveMouseOverItemIndex;Xr.mouseLeaveItem;var AA=Xr.mouseLeaveChart;Xr.setActiveClickItemIndex;var OA=Xr.setMouseOverAxisIndex,xU=Xr.setMouseClickAxisIndex,su=Xr.setSyncInteraction,Wf=Xr.setKeyboardInteraction,bU=CA.reducer;function iS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bd(e){for(var t=1;t{if(t==null)return Qi;var a=SU(e,t,r);if(a==null)return Qi;if(a.active)return a;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(NU(a)){if(o)return Bd(Bd({},a),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Bd(Bd({},Qi),{},{coordinate:a.coordinate})};function EU(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 r=Number(e);return Number.isFinite(r)?r:void 0}function PU(e,t){var r=EU(e),n=t[0],a=t[1];if(r===void 0)return!1;var o=Math.min(n,a),u=Math.max(n,a);return r>=o&&r<=u}function CU(e,t,r){if(r==null||t==null)return!0;var n=Tt(e,t);return n==null||!Mn(r)?!0:PU(n,r)}var cu=(e,t,r,n)=>{var a=e==null?void 0:e.index;if(a==null)return null;var o=Number(a);if(!Be(o))return a;var u=0,l=1/0;t.length>0&&(l=t.length-1);var f=Math.max(u,Math.min(o,l)),h=t[f];return h==null||CU(h,r,n)?String(f):null},MA=(e,t,r,n,a,o,u)=>{if(o!=null){var l=u[0],f=l==null?void 0:l.getPosition(o);if(f!=null)return f;var h=a==null?void 0:a[Number(o)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},IA=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var a;if(r==="hover"?a=e.itemInteraction.hover.graphicalItemId:a=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&a==null)return e.tooltipItemPayloads;if(a==null&&(n!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(u=>{var l;return((l=u.settings)===null||l===void 0?void 0:l.graphicalItemId)===a})},TA=e=>e.options.tooltipPayloadSearcher,Xs=e=>e.tooltip;function aS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oS(e){for(var t=1;te(t)}function sS(e){if(typeof e=="string")return e}function DU(e){if(!(e==null||typeof e!="object")){var t="name"in e?MU(e.name):void 0,r="unit"in e?IU(e.unit):void 0,n="dataKey"in e?TU(e.dataKey):void 0,a="payload"in e?e.payload:void 0,o="color"in e?sS(e.color):void 0,u="fill"in e?sS(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:a,color:o,fill:u}}}function RU(e,t){return e??t}var DA=(e,t,r,n,a,o,u)=>{if(!(t==null||o==null)){var l=r.chartData,f=r.computedData,h=r.dataStartIndex,p=r.dataEndIndex,v=[];return e.reduce((x,b)=>{var j,k=b.dataDefinedOnItem,S=b.settings,N=RU(k,l),P=Array.isArray(N)?oP(N,h,p):N,O=(j=S==null?void 0:S.dataKey)!==null&&j!==void 0?j:n,C=S==null?void 0:S.nameKey,_;if(n&&Array.isArray(P)&&!Array.isArray(P[0])&&u==="axis"?_=pE(P,n,a):_=o(P,t,f,C),Array.isArray(_))_.forEach(I=>{var U,B,V=DU(I),q=V==null?void 0:V.name,R=V==null?void 0:V.dataKey,de=V==null?void 0:V.payload,Z=oS(oS({},S),{},{name:q,unit:V==null?void 0:V.unit,color:(U=V==null?void 0:V.color)!==null&&U!==void 0?U:S==null?void 0:S.color,fill:(B=V==null?void 0:V.fill)!==null&&B!==void 0?B:S==null?void 0:S.fill});x.push(tj({tooltipEntrySettings:Z,dataKey:R,payload:de,value:Tt(de,R),name:q==null?void 0:String(q)}))});else{var A;x.push(tj({tooltipEntrySettings:S,dataKey:O,payload:_,value:Tt(_,O),name:(A=Tt(_,C))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return x},v)}},C0=K([Ct,FC,Fy],DC),$U=K([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),LU=K([Rt,Vs],BC),bo=K([$U,Ct,LU],WC,{memoizeOptions:{resultEqualityCheck:$h}}),zU=K([bo],e=>e.filter(Gy)),RA=K([bo],VC,{memoizeOptions:{resultEqualityCheck:$h}}),FU=K([bo],e=>e.some(t=>!t.data)),fo=K([RA,pn],qC),BU=K([zU,pn,Ct],eC),A0=K([fo,Ct,bo,pn,FU,RA],QC),$A=K([Ct],w0),UU=K([Ct],e=>e.allowDataOverflow),LA=K([$A,UU],RP),WU=K([bo],e=>e.filter(Gy)),HU=K([BU,WU,_h,GP],XC),KU=K([HU,pn,Rt,LA],JC),VU=K([bo],KC),GU=K([fo,Ct,VU,j0,Rt,rF],rA,{memoizeOptions:{resultEqualityCheck:Rh}}),qU=K([nA,Rt,Vs],Qs),QU=K([qU,Rt],oA),YU=K([iA,Rt,Vs],Qs),XU=K([YU,Rt],sA),ZU=K([aA,Rt,Vs],Qs),JU=K([ZU,Rt],lA),e7=K([QU,JU,XU],Uf),t7=K([Ct,$A,LA,KU,GU,e7,ut,Rt],uA),Ls=K([Ct,ut,fo,A0,_h,Rt,t7],cA),r7=K([Ls,Ct,C0],dA),n7=K([Ct,Ls,r7,Rt],fA),zA=e=>{var t=Rt(e),r=Vs(e),n=!1;return oc(e,t,r,n)},FA=K([Ct,zA],Mh),i7=K([Ct,C0,n7,FA],y0),BA=K([i7],qy),a7=K([ut,A0,Ct,Rt],bA),o7=K([ut,A0,Ct,Rt],gA),s7=(e,t,r,n,a,o,u,l)=>{if(t){var f=t.type,h=zn(e,l);if(n){var p=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,v=f==="category"&&n.bandwidth?n.bandwidth()/p:0;return v=l==="angleAxis"&&a!=null&&(a==null?void 0:a.length)>=2?Wr(a[0]-a[1])*2*v:v,h&&u?u.map((x,b)=>{var j=n.map(x);return Be(j)?{coordinate:j+v,value:x,index:b,offset:v}:null}).filter(yr):n.domain().map((x,b)=>{var j=n.map(x);return Be(j)?{coordinate:j+v,value:o?o[x]:x,index:b,offset:v}:null}).filter(yr)}}},yi=K([ut,Ct,C0,BA,zA,a7,o7,Rt],s7),O0=K([SA,NA,fU],(e,t,r)=>EA(r.shared,e,t)),UA=e=>e.tooltip.settings.trigger,_0=e=>e.tooltip.settings.defaultIndex,lc=K([Xs,O0,UA,_0],_A),$u=K([lc,fo,$s,Ls],cu),WA=K([yi,$u],PA),l7=K([lc],e=>{if(e)return e.dataKey}),u7=K([lc],e=>{if(e)return e.graphicalItemId}),HA=K([Xs,O0,UA,_0],IA),c7=K([hi,pi,ut,Gt,yi,_0,HA],MA),d7=K([lc,c7],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),f7=K([lc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),h7=K([HA,$u,pn,$s,WA,TA,O0],DA),p7=K([h7],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function lS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function uS(e){for(var t=1;tCe(Ct),x7=()=>{var e=y7(),t=Ce(yi),r=Ce(BA);return xf(!e||!r?void 0:uS(uS({},e),{},{scale:r}),t)};function cS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Jo(e){for(var t=1;t{var a=t.find(o=>o&&o.index===r);if(a){if(e==="horizontal")return{x:a.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:a.coordinate}}return{x:0,y:0}},S7=(e,t,r,n)=>{var a=t.find(h=>h&&h.index===r);if(a){if(e==="centric"){var o=a.coordinate,u=n.radius;return Jo(Jo(Jo({},n),Ht(n.cx,n.cy,u,o)),{},{angle:o,radius:u})}var l=a.coordinate,f=n.angle;return Jo(Jo(Jo({},n),Ht(n.cx,n.cy,l,f)),{},{angle:f,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 N7(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var KA=(e,t,r,n,a)=>{var o,u=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(u<=1||e==null)return 0;if(n==="angleAxis"&&a!=null&&Math.abs(Math.abs(a[1]-a[0])-360)<=1e-6)for(var l=0;l0?(f=r[l-1])===null||f===void 0?void 0:f.coordinate:(h=r[u-1])===null||h===void 0?void 0:h.coordinate,j=(p=r[l])===null||p===void 0?void 0:p.coordinate,k=l>=u-1?(v=r[0])===null||v===void 0?void 0:v.coordinate:(x=r[l+1])===null||x===void 0?void 0:x.coordinate,S=void 0;if(!(b==null||j==null||k==null))if(Wr(j-b)!==Wr(k-j)){var N=[];if(Wr(k-j)===Wr(a[1]-a[0])){S=k;var P=j+a[1]-a[0];N[0]=Math.min(P,(P+b)/2),N[1]=Math.max(P,(P+b)/2)}else{S=b;var O=k+a[1]-a[0];N[0]=Math.min(j,(O+j)/2),N[1]=Math.max(j,(O+j)/2)}var C=[Math.min(j,(S+j)/2),Math.max(j,(S+j)/2)];if(e>C[0]&&e<=C[1]||e>=N[0]&&e<=N[1]){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}else{var A=Math.min(b,k),I=Math.max(b,k);if(e>(A+j)/2&&e<=(I+j)/2){var U;return(U=r[l])===null||U===void 0?void 0:U.index}}}else if(t)for(var B=0;B(V.coordinate+R.coordinate)/2||B>0&&B(V.coordinate+R.coordinate)/2&&e<=(V.coordinate+q.coordinate)/2)return V.index}}return-1},VA=()=>Ce(Fy),M0=(e,t)=>t,GA=(e,t,r)=>r,I0=(e,t,r,n)=>n,E7=K(yi,e=>ch(e,t=>t.coordinate)),T0=K([Xs,M0,GA,I0],_A),D0=K([T0,fo,$s,Ls],cu),P7=(e,t,r)=>{if(t!=null){var n=Xs(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},qA=K([Xs,M0,GA,I0],IA),Hf=K([hi,pi,ut,Gt,yi,I0,qA],MA),C7=K([T0,Hf],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),QA=K([yi,D0],PA),A7=K([qA,D0,pn,$s,QA,TA,M0],DA),O7=K([T0,D0],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),_7=(e,t,r,n,a,o,u)=>{if(!(!e||!r||!n||!a)&&N7(e,u)){var l=H$(e,t),f=KA(l,o,a,r,n),h=k7(t,a,f,e);return{activeIndex:String(f),activeCoordinate:h}}},M7=(e,t,r,n,a,o,u)=>{if(!(!e||!n||!a||!o||!r)){var l=G6(e,r);if(l){var f=K$(l,t),h=KA(f,u,o,n,a),p=S7(t,o,h,l);return{activeIndex:String(h),activeCoordinate:p}}}},I7=(e,t,r,n,a,o,u,l)=>{if(!(!e||!t||!n||!a||!o))return t==="horizontal"||t==="vertical"?_7(e,t,n,a,o,u,l):M7(e,t,r,n,a,o,u)},T7=K(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),D7=K(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(or)),r=Array.from(new Set(t));return r.sort((n,a)=>n-a)},{memoizeOptions:{resultEqualityCheck:SF}});function dS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fS(e){for(var t=1;tfS(fS({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),z7)},B7=new Set(Object.values(or));function U7(e){return B7.has(e)}var YA=rr({name:"zIndex",initialState:F7,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:at()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!U7(r)&&delete e.zIndexMap[r])},prepare:at()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,a=r.element,o=r.isPanorama;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=a:e.zIndexMap[n].element=a:e.zIndexMap[n]={consumers:0,element:o?void 0:a,panoramaElement:o?a:void 0}},prepare:at()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:at()}}}),Gh=YA.actions,W7=Gh.registerZIndexPortal,wv=Gh.unregisterZIndexPortal,H7=Gh.registerZIndexPortalElement,K7=Gh.unregisterZIndexPortalElement,V7=YA.reducer;function xi(e){var t=e.zIndex,r=e.children,n=AL(),a=n&&t!==void 0&&t!==0,o=wr(),u=y.useRef(void 0),l=y.useRef(new Set),f=wt(),h=Ce(v=>T7(v,t,o));if(y.useLayoutEffect(()=>{if(!a){var v=l.current;v.forEach(b=>{f(wv({zIndex:b}))}),v.clear(),u.current=void 0;return}if(l.current.has(t)||(f(W7({zIndex:t})),l.current.add(t)),h){u.current=h;var x=l.current;x.forEach(b=>{b!==t&&(f(wv({zIndex:b})),x.delete(b))})}},[f,t,a,h]),y.useLayoutEffect(()=>{var v=l.current;return()=>{v.forEach(x=>{f(wv({zIndex:x}))}),v.clear()}},[f]),!a)return r;var p=h??u.current;return p?th.createPortal(r,p):null}function Wg(){return Wg=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.useContext(XA),jv={exports:{}},pS;function eW(){return pS||(pS=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function o(f,h,p,v,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new a(p,v||f,x),j=r?r+h:h;return f._events[j]?f._events[j].fn?f._events[j]=[f._events[j],b]:f._events[j].push(b):(f._events[j]=b,f._eventsCount++),f}function u(f,h){--f._eventsCount===0?f._events=new n:delete f._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)t.call(p,v)&&h.push(r?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},l.prototype.listeners=function(h){var p=r?r+h:h,v=this._events[p];if(!v)return[];if(v.fn)return[v.fn];for(var x=0,b=v.length,j=new Array(b);x{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Tn(r))return e[r]}},iW={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},ZA=rr({name:"options",initialState:iW,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),aW=ZA.reducer,oW=ZA.actions.createEventEmitter;function sW(e){return e.tooltip.syncInteraction}var lW={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},JA=rr({name:"chartData",initialState:lW,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 r=t.payload,n=r.startIndex,a=r.endIndex;n!=null&&(e.dataStartIndex=n),a!=null&&(e.dataEndIndex=a)}}}),R0=JA.actions,vS=R0.setChartData,uW=R0.setDataStartEndIndexes;R0.setComputedData;var cW=JA.reducer,dW=["x","y"];function gS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function es(e){for(var t=1;tf.rootProps.className);y.useEffect(()=>{if(e==null)return Us;var f=(h,p,v)=>{if(t!==v&&e===h){if(p.payload.active===!1){r(su({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var x;if(u&&p!==null&&p!==void 0&&(x=p.payload)!==null&&x!==void 0&&x.coordinate&&p.payload.sourceViewBox){var b=p.payload.coordinate,j=b.x,k=b.y,S=mW(b,dW),N=p.payload.sourceViewBox,P=N.x,O=N.y,C=N.width,_=N.height,A=es(es({},S),{},{x:u.x+(C?(j-P)/C:0)*u.width,y:u.y+(_?(k-O)/_:0)*u.height});r(es(es({},p),{},{payload:es(es({},p.payload),{},{coordinate:A})}))}else r(p);return}if(a!=null){var I;if(typeof n=="function"){var U={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},B=n(a,U);I=a[B]}else n==="value"&&(I=a.find(me=>String(me.value)===p.payload.label));var V=p.payload.coordinate;if(V==null||u==null){r(su({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(I==null){r(su({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var q=V.x,R=V.y,de=Math.min(q,u.x+u.width),Z=Math.min(R,u.y+u.height),ge={x:o==="horizontal"?I.coordinate:de,y:o==="horizontal"?Z:I.coordinate},je=su({active:p.payload.active,coordinate:ge,dataKey:p.payload.dataKey,index:String(I.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});r(je)}}};return Lu.on(Hg,f),()=>{Lu.off(Hg,f)}},[l,r,t,e,n,a,o,u])}function yW(){var e=Ce(By),t=Ce(Uy),r=wt();y.useEffect(()=>{if(e==null)return Us;var n=(a,o,u)=>{t!==u&&e===a&&r(uW(o))};return Lu.on(mS,n),()=>{Lu.off(mS,n)}},[r,t,e])}function xW(){var e=wt();y.useEffect(()=>{e(oW())},[e]),gW(),yW()}function bW(e,t,r,n,a,o){var u=Ce(j=>P7(j,e,t)),l=Ce(u7),f=Ce(Uy),h=Ce(By),p=Ce(qP),v=Ce(sW),x=(v==null?void 0:v.sourceViewBox)!=null,b=Nh();y.useEffect(()=>{if(!x&&h!=null&&f!=null){var j=su({active:o,coordinate:r,dataKey:u,index:a,label:typeof n=="number"?String(n):n,sourceViewBox:b,graphicalItemId:l});Lu.emit(Hg,h,j,f)}},[x,r,u,l,a,n,f,h,p,o,b])}function yS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xS(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{I(gU({shared:P,trigger:O,axisId:A,active:a,defaultIndex:U}))},[I,P,O,A,a,U]);var B=Nh(),V=PP(),q=dU(P),R=(t=Ce(Oe=>O7(Oe,q,O,U)))!==null&&t!==void 0?t:{},de=R.activeIndex,Z=R.isActive,ge=Ce(Oe=>A7(Oe,q,O,U)),je=Ce(Oe=>QA(Oe,q,O,U)),me=Ce(Oe=>C7(Oe,q,O,U)),Q=ge,oe=J7(),X=(r=a??Z)!==null&&r!==void 0?r:!1,$=OR([Q,X]),T=SW($,2),ee=T[0],ne=T[1],te=q==="axis"?je:void 0;bW(q,O,me,te,de,X);var ue=_??oe;if(ue==null||B==null||q==null)return null;var pe=Q??wS;X||(pe=wS),h&&pe.length&&(pe=JD(pe.filter(Oe=>Oe.value!=null&&(Oe.hide!==!0||n.includeHidden)),x,AW));var Ae=pe.length>0,J=xS(xS({},n),{},{payload:pe,label:te,active:X,activeIndex:de,coordinate:me,accessibilityLayer:V}),ke=y.createElement(Bz,{allowEscapeViewBox:o,animationDuration:u,animationEasing:l,isAnimationActive:p,active:X,coordinate:me,hasPayload:Ae,offset:v,position:b,reverseDirection:j,useTranslate3d:k,viewBox:B,wrapperStyle:S,lastBoundingBox:ee,innerRef:ne,hasPortalFromProps:!!_},OW(f,J));return y.createElement(y.Fragment,null,th.createPortal(ke,ue),X&&y.createElement(Z7,{cursor:N,tooltipEventType:q,coordinate:me,payload:pe,index:de}))}function IW(e,t,r){return(t=TW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function TW(e){var t=DW(e,"string");return typeof t=="symbol"?t:t+""}function DW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class RW{constructor(t){IW(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function jS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function $W(e){for(var t=1;t{try{var r=document.getElementById(SS);r||(r=document.createElement("span"),r.setAttribute("id",SS),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,UW,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},du=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Ju.isSsr)return{width:0,height:0};if(!eO.enableCache)return NS(t,r);var n=WW(t,r),a=kS.get(n);if(a)return a;var o=NS(t,r);return kS.set(n,o),o},tO;function Kf(e,t){return GW(e)||VW(e,t)||KW(e,t)||HW()}function HW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function KW(e,t){if(e){if(typeof e=="string")return ES(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ES(e,t):void 0}}function ES(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var a=[];Kt(t)||(r?a=t.toString().split(""):a=t.toString().split(nO));var o=a.map(l=>({word:l,width:du(l,n).width})),u=r?0:du(" ",n).width;return{wordsWithComputedWidth:o,spaceWidth:u}}catch{return null}};function aO(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function hH(e){return Kt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var oO=(e,t,r,n)=>e.reduce((a,o)=>{var u=o.word,l=o.width,f=a[a.length-1];if(f&&l!=null&&(t==null||n||f.width+l+re.reduce((t,r)=>t.width>r.width?t:r),pH="…",IS=(e,t,r,n,a,o,u,l)=>{var f=e.slice(0,t),h=iO({breakAll:r,style:n,children:f+pH});if(!h)return[!1,[]];var p=oO(h.wordsWithComputedWidth,o,u,l),v=p.length>a||sO(p).width>Number(o);return[v,p]},mH=(e,t,r,n,a)=>{var o=e.maxLines,u=e.children,l=e.style,f=e.breakAll,h=Ne(o),p=String(u),v=oO(t,n,r,a);if(!h||a)return v;var x=v.length>o||sO(v).width>Number(n);if(!x)return v;for(var b=0,j=p.length-1,k=0,S;b<=j&&k<=p.length-1;){var N=Math.floor((b+j)/2),P=N-1,O=IS(p,P,f,l,o,n,r,a),C=_S(O,2),_=C[0],A=C[1],I=IS(p,N,f,l,o,n,r,a),U=_S(I,1),B=U[0];if(!_&&!B&&(b=N+1),_&&B&&(j=N-1),!_&&B){S=A;break}k++}return S||v},TS=e=>{var t=Kt(e)?[]:e.toString().split(nO);return[{words:t,width:void 0}]},vH=e=>{var t=e.width,r=e.scaleToFit,n=e.children,a=e.style,o=e.breakAll,u=e.maxLines;if((t||r)&&!Ju.isSsr){var l,f,h=iO({breakAll:o,children:n,style:a});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;l=p,f=v}else return TS(n);return mH({breakAll:o,children:n,maxLines:u,style:a},l,f,t,!!r)}return TS(n)},lO="#808080",gH={angle:0,breakAll:!1,capHeight:"0.71em",fill:lO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},$0=y.forwardRef((e,t)=>{var r=Qr(e,gH),n=r.x,a=r.y,o=r.lineHeight,u=r.capHeight,l=r.fill,f=r.scaleToFit,h=r.textAnchor,p=r.verticalAnchor,v=OS(r,oH),x=y.useMemo(()=>vH({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:f,style:v.style,width:v.width}),[v.breakAll,v.children,v.maxLines,f,v.style,v.width]),b=v.dx,j=v.dy,k=v.angle,S=v.className,N=v.breakAll,P=OS(v,sH);if(!Dn(n)||!Dn(a)||x.length===0)return null;var O=Number(n)+(Ne(b)?b:0),C=Number(a)+(Ne(j)?j:0);if(!Be(O)||!Be(C))return null;var _;switch(p){case"start":_=kv("calc(".concat(u,")"));break;case"middle":_=kv("calc(".concat((x.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:_=kv("calc(".concat(x.length-1," * -").concat(o,")"));break}var A=[],I=x[0];if(f&&I!=null){var U=I.width,B=v.width;A.push("scale(".concat(Ne(B)&&Ne(U)?B/U:1,")"))}return k&&A.push("rotate(".concat(k,", ").concat(O,", ").concat(C,")")),A.length&&(P.transform=A.join(" ")),y.createElement("text",Kg({},Vr(P),{ref:t,x:O,y:C,className:et("recharts-text",S),textAnchor:h,fill:l.includes("url")?lO:l}),x.map((V,q)=>{var R=V.words.join(N?"":" ");return y.createElement("tspan",{x:O,dy:q===0?_:o,key:"".concat(R,"-").concat(q)},R)}))});$0.displayName="Text";function DS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function kn(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,a=n===void 0?0:n,o=e.parentViewBox,u=_y(t),l=u.x,f=u.y,h=u.height,p=u.upperWidth,v=u.lowerWidth,x=l,b=l+(p-v)/2,j=(x+b)/2,k=(p+v)/2,S=x+p/2,N=h>=0?1:-1,P=N*a,O=N>0?"end":"start",C=N>0?"start":"end",_=p>=0?1:-1,A=_*a,I=_>0?"end":"start",U=_>0?"start":"end",B=o;if(r==="top"){var V={x:x+p/2,y:f-P,horizontalAnchor:"middle",verticalAnchor:O};return B&&(V.height=Math.max(f-B.y,0),V.width=p),V}if(r==="bottom"){var q={x:b+v/2,y:f+h+P,horizontalAnchor:"middle",verticalAnchor:C};return B&&(q.height=Math.max(B.y+B.height-(f+h),0),q.width=v),q}if(r==="left"){var R={x:j-A,y:f+h/2,horizontalAnchor:I,verticalAnchor:"middle"};return B&&(R.width=Math.max(R.x-B.x,0),R.height=h),R}if(r==="right"){var de={x:j+k+A,y:f+h/2,horizontalAnchor:U,verticalAnchor:"middle"};return B&&(de.width=Math.max(B.x+B.width-de.x,0),de.height=h),de}var Z=B?{width:k,height:h}:{};return r==="insideLeft"?kn({x:j+A,y:f+h/2,horizontalAnchor:U,verticalAnchor:"middle"},Z):r==="insideRight"?kn({x:j+k-A,y:f+h/2,horizontalAnchor:I,verticalAnchor:"middle"},Z):r==="insideTop"?kn({x:x+p/2,y:f+P,horizontalAnchor:"middle",verticalAnchor:C},Z):r==="insideBottom"?kn({x:b+v/2,y:f+h-P,horizontalAnchor:"middle",verticalAnchor:O},Z):r==="insideTopLeft"?kn({x:x+A,y:f+P,horizontalAnchor:U,verticalAnchor:C},Z):r==="insideTopRight"?kn({x:x+p-A,y:f+P,horizontalAnchor:I,verticalAnchor:C},Z):r==="insideBottomLeft"?kn({x:b+A,y:f+h-P,horizontalAnchor:U,verticalAnchor:O},Z):r==="insideBottomRight"?kn({x:b+v-A,y:f+h-P,horizontalAnchor:I,verticalAnchor:O},Z):r&&typeof r=="object"&&(Ne(r.x)||oo(r.x))&&(Ne(r.y)||oo(r.y))?kn({x:l+da(r.x,k),y:f+da(r.y,h),horizontalAnchor:"end",verticalAnchor:"end"},Z):kn({x:S,y:f+h/2,horizontalAnchor:"middle",verticalAnchor:"middle"},Z)},jH=["labelRef"],kH=["content"];function RS(e,t){if(e==null)return{};var r,n,a=SH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,a=e.lowerWidth,o=e.width,u=e.height,l=e.children,f=y.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:a,width:o,height:u}),[t,r,n,a,o,u]);return y.createElement(uO.Provider,{value:f},l)},cO=()=>{var e=y.useContext(uO),t=Nh();return e||(t?_y(t):void 0)},AH=y.createContext(null),OH=()=>{var e=y.useContext(AH),t=Ce(JP);return e||t},_H=e=>{var t=e.value,r=e.formatter,n=Kt(e.children)?t:e.children;return typeof r=="function"?r(n):n},L0=e=>e!=null&&typeof e=="function",MH=(e,t)=>{var r=Wr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},IH=(e,t,r,n,a)=>{var o=e.offset,u=e.className,l=a.cx,f=a.cy,h=a.innerRadius,p=a.outerRadius,v=a.startAngle,x=a.endAngle,b=a.clockWise,j=(h+p)/2,k=MH(v,x),S=k>=0?1:-1,N,P;switch(t){case"insideStart":N=v+S*o,P=b;break;case"insideEnd":N=x-S*o,P=!b;break;case"end":N=x+S*o,P=b;break;default:throw new Error("Unsupported position ".concat(t))}P=k<=0?P:!P;var O=Ht(l,f,j,N),C=Ht(l,f,j,N+(P?1:-1)*359),_="M".concat(O.x,",").concat(O.y,` - A`).concat(j,",").concat(j,",0,1,").concat(P?0:1,`, - `).concat(C.x,",").concat(C.y),A=Kt(e.id)?Su("recharts-radial-line-"):e.id;return y.createElement("text",ri({},n,{dominantBaseline:"central",className:et("recharts-radial-bar-label",u)}),y.createElement("defs",null,y.createElement("path",{id:A,d:_})),y.createElement("textPath",{xlinkHref:"#".concat(A)},r))},TH=(e,t,r)=>{var n=e.cx,a=e.cy,o=e.innerRadius,u=e.outerRadius,l=e.startAngle,f=e.endAngle,h=(l+f)/2;if(r==="outside"){var p=Ht(n,a,u+t,h),v=p.x,x=p.y;return{x:v,y:x,textAnchor:v>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"end"};var b=(o+u)/2,j=Ht(n,a,b,h),k=j.x,S=j.y;return{x:k,y:S,textAnchor:"middle",verticalAnchor:"middle"}},ef=e=>e!=null&&"cx"in e&&Ne(e.cx),DH={angle:0,offset:5,zIndex:or.label,position:"middle",textBreakAll:!1};function RH(e){if(!ef(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,a=n*2;return{x:t-n,y:r-n,width:a,upperWidth:a,lowerWidth:a,height:a}}function qi(e){var t=Qr(e,DH),r=t.viewBox,n=t.parentViewBox,a=t.position,o=t.value,u=t.children,l=t.content,f=t.className,h=f===void 0?"":f,p=t.textBreakAll,v=t.labelRef,x=OH(),b=cO(),j=a==="center"?b:x??b,k,S,N;r==null?k=j:ef(r)?k=r:k=_y(r);var P=RH(k);if(!k||Kt(o)&&Kt(u)&&!y.isValidElement(l)&&typeof l!="function")return null;var O=lu(lu({},t),{},{viewBox:k});if(y.isValidElement(l)){O.labelRef;var C=RS(O,jH);return y.cloneElement(l,C)}if(typeof l=="function"){O.content;var _=RS(O,kH);if(S=y.createElement(l,_),y.isValidElement(S))return S}else S=_H(t);var A=Vr(t);if(ef(k)){if(a==="insideStart"||a==="insideEnd"||a==="end")return IH(t,a,S,A,k);N=TH(k,t.offset,t.position)}else{if(!P)return null;var I=wH({viewBox:P,position:a,offset:t.offset,parentViewBox:ef(n)?void 0:n});N=lu(lu({x:I.x,y:I.y,textAnchor:I.horizontalAnchor,verticalAnchor:I.verticalAnchor},I.width!==void 0?{width:I.width}:{}),I.height!==void 0?{height:I.height}:{})}return y.createElement(xi,{zIndex:t.zIndex},y.createElement($0,ri({ref:v,className:et("recharts-label",h)},A,N,{textAnchor:aO(A.textAnchor)?A.textAnchor:N.textAnchor,breakAll:p}),S))}qi.displayName="Label";var $H=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?y.createElement(qi,ri({key:"label-implicit"},n)):Dn(e)?y.createElement(qi,ri({key:"label-implicit",value:e},n)):y.isValidElement(e)?e.type===qi?y.cloneElement(e,lu({key:"label-implicit"},n)):y.createElement(qi,ri({key:"label-implicit",content:e},n)):L0(e)?y.createElement(qi,ri({key:"label-implicit",content:e},n)):e&&typeof e=="object"?y.createElement(qi,ri({},e,{key:"label-implicit"},n)):null};function LH(e){var t=e.label,r=e.labelRef,n=cO();return $H(t,n,r)||null}var zH=["valueAccessor"],FH=["dataKey","clockWise","id","textBreakAll","zIndex"];function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(hH(t))return t},dO=y.createContext(void 0),WH=dO.Provider,fO=y.createContext(void 0);fO.Provider;function HH(){return y.useContext(dO)}function KH(){return y.useContext(fO)}function tf(e){var t=e.valueAccessor,r=t===void 0?UH:t,n=LS(e,zH),a=n.dataKey;n.clockWise;var o=n.id,u=n.textBreakAll,l=n.zIndex,f=LS(n,FH),h=HH(),p=KH(),v=h||p;return!v||!v.length?null:y.createElement(xi,{zIndex:l??or.label},y.createElement(Gr,{className:"recharts-label-list"},v.map((x,b)=>{var j,k=Kt(a)?r(x,b):Tt(x.payload,a),S=Kt(o)?{}:{id:"".concat(o,"-").concat(b)};return y.createElement(qi,Vf({key:"label-".concat(b)},Vr(x),f,S,{fill:(j=n.fill)!==null&&j!==void 0?j:x.fill,parentViewBox:x.parentViewBox,value:k,textBreakAll:u,viewBox:x.viewBox,index:b,zIndex:0}))})))}tf.displayName="LabelList";function VH(e){var t=e.label;return t?t===!0?y.createElement(tf,{key:"labelList-implicit"}):y.isValidElement(t)||L0(t)?y.createElement(tf,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(tf,Vf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,a=e.className,o=et("recharts-dot",a);return Ne(t)&&Ne(r)&&Ne(n)?y.createElement("circle",Vg({},dn(e),wy(e),{className:o,cx:t,cy:r,r:n})):null},GH={radiusAxis:{},angleAxis:{}},pO=rr({name:"polarAxis",initialState:GH,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]}}}),qh=pO.actions;qh.addRadiusAxis;qh.removeRadiusAxis;qh.addAngleAxis;qh.removeAngleAxis;var qH=pO.reducer;function QH(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var mO=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function zS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function FS(e){for(var t=1;t{n||(a.current===null?r(pU(t)):a.current!==t&&r(mU({prev:a.current,next:t})),a.current=t)},[t,r,n]),y.useLayoutEffect(()=>()=>{a.current&&(r(vU(a.current)),a.current=null)},[r]),null}function aK(e){var t=e.legendPayload,r=wt(),n=wr(),a=y.useRef(null);return y.useLayoutEffect(()=>{n||(a.current===null?r(UL(t)):a.current!==t&&r(WL({prev:a.current,next:t})),a.current=t)},[r,n,t]),y.useLayoutEffect(()=>()=>{a.current&&(r(HL(a.current)),a.current=null)},[r]),null}function oK(e,t){return cK(e)||uK(e,t)||lK(e,t)||sK()}function sK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lK(e,t){if(e){if(typeof e=="string")return BS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?BS(e,t):void 0}}function BS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var a of r)n.push({status:"removed",prev:a});for(var o=0;oe[Math.floor(o*r)]);return F0(n,t)}function hK(e,t){var r=t.map((n,a)=>e[a]);return F0(r,t)}function pK(e,t){for(var r=new Map,n=0;n{var b=r(v,x);if(b!=null){var j=n.get(b);if(j!==void 0)return a.add(b),j}}),u=[];for(var l of n){var f=oK(l,2),h=f[0],p=f[1];a.has(h)||u.push(p)}return F0(o,t,u)}function Gg(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===z0?fK(e,t):r===dK?hK(e,t):mK(e,t,r)}function gO(e,t){var r=y.useRef(e),n=y.useRef(t.current),a=y.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,a.current=!1);var o=y.useCallback(function(u,l){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(l===0){a.current=!0;return}l===1&&(n.current=u),l>0&&a.current&&f&&(t.current=u)},[t]);return{startValue:n.current,syncStepValue:o}}function vK(e,t){return bK(e)||xK(e,t)||yK(e,t)||gK()}function gK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yK(e,t){if(e){if(typeof e=="string")return US(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?US(e,t):void 0}}function US(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),o(!0)},[e]),l=y.useCallback(()=>{typeof t=="function"&&t(),o(!1)},[t]);return{isAnimating:a,handleAnimationStart:u,handleAnimationEnd:l}}function jK(e){var t,r=e.animationInput,n=e.animationIdPrefix,a=e.items,o=e.previousItemsRef,u=e.isAnimationActive,l=e.animationBegin,f=e.animationDuration,h=e.animationEasing,p=e.onAnimationStart,v=e.onAnimationEnd,x=e.animationInterpolateFn,b=e.animationMatchBy,j=e.shouldUpdatePreviousRef,k=e.children,S=e.layout,N=MP(r,n),P=gO(N,o),O=(t=P.startValue)!==null&&t!==void 0?t:null,C=Gg(O,a,b??z0);return y.createElement(_P,{animationId:N,begin:l,duration:f,isActive:u,easing:h,onAnimationEnd:v,onAnimationStart:p,key:N},_=>{var A=O==null,I=a==null?a:x(C,_,S),U=j?j(_):_>0;return P.syncStepValue(I,_,U),I==null?null:k(I,_,A)})}var Sv;function kK(e,t){return PK(e)||EK(e,t)||NK(e,t)||SK()}function SK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NK(e,t){if(e){if(typeof e=="string")return WS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?WS(e,t):void 0}}function WS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=y.useState(()=>Su("uid-")),t=kK(e,1),r=t[0];return r},yO=(Sv=eh.useId)!==null&&Sv!==void 0?Sv:CK;function AK(e,t){var r=yO();return t||(e?"".concat(e,"-").concat(r):r)}var OK=y.createContext(void 0),_K=e=>{var t=e.id,r=e.type,n=e.children,a=AK("recharts-".concat(r),t);return y.createElement(OK.Provider,{value:a},n(a))},MK={cartesianItems:[],polarItems:[]},xO=rr({name:"graphicalItems",initialState:MK,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:at()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=a)},prepare:at()},removeCartesianGraphicalItem:{reducer(e,t){var r=Hr(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:at()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:at()},removePolarGraphicalItem:{reducer(e,t){var r=Hr(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:at()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).polarItems.indexOf(n);o>-1&&(e.polarItems[o]=a)},prepare:at()}}}),Zs=xO.actions,IK=Zs.addCartesianGraphicalItem,TK=Zs.replaceCartesianGraphicalItem,DK=Zs.removeCartesianGraphicalItem;Zs.addPolarGraphicalItem;Zs.removePolarGraphicalItem;Zs.replacePolarGraphicalItem;var RK=xO.reducer,$K=e=>{var t=wt(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t(IK(e)):r.current!==e&&t(TK({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(DK(r.current)),r.current=null)},[t]),null},LK=y.memo($K),zK=["points"];function HS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nv(e){for(var t=1;t{var N,P,O=Nv(Nv(Nv({r:3},u),x),{},{index:S,cx:(N=k.x)!==null&&N!==void 0?N:void 0,cy:(P=k.y)!==null&&P!==void 0?P:void 0,dataKey:o,value:k.value,payload:k.payload,points:t});return y.createElement(KK,{key:"dot-".concat(S),option:r,dotProps:O,className:a})}),j={};return l&&f!=null&&(j.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(f,")")),y.createElement(xi,{zIndex:p},y.createElement(Gr,Gf({className:n},j),b))}function KS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function VS(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),sV=K([oV,hi,pi],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),B0=()=>Ce(sV),lV=()=>Ce(p7);function GS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ev(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,a=e.activeDot,o=e.dataKey,u=e.clipPath;if(a===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:o,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Ev(Ev(Ev({},l),sh(a)),wy(a)),h;return y.isValidElement(a)?h=y.cloneElement(a,f):typeof a=="function"?h=a(f):h=y.createElement(hO,f),y.createElement(Gr,{className:"recharts-active-dot",clipPath:u},h)};function qS(e){var t=e.points,r=e.mainColor,n=e.activeDot,a=e.itemDataKey,o=e.clipPath,u=e.zIndex,l=u===void 0?or.activeDot:u,f=Ce($u),h=lV();if(t==null||h==null)return null;var p=t.find(v=>h.includes(v.payload));return Kt(p)?null:y.createElement(xi,{zIndex:l},y.createElement(fV,{point:p,childIndex:Number(f),mainColor:r,dataKey:a,activeDot:n,clipPath:o}))}var hV=e=>{var t=e.chartData,r=wt(),n=wr();return y.useEffect(()=>n?()=>{}:(r(vS(t)),()=>{r(vS(void 0))}),[t,r,n]),null},QS={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},jO=rr({name:"brush",initialState:QS,reducers:{setBrushSettings(e,t){return t.payload==null?QS:t.payload}}});jO.actions.setBrushSettings;var pV=jO.reducer;function mV(e){return(e%180+180)%180}var vV=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=mV(a),u=o*Math.PI/180,l=Math.atan(n/r),f=u>l&&u{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Hr(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Hr(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Hr(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),Js=kO.actions;Js.addDot;Js.removeDot;Js.addArea;Js.removeArea;Js.addLine;Js.removeLine;var yV=kO.reducer;function xV(e,t){return kV(e)||jV(e,t)||wV(e,t)||bV()}function bV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wV(e,t){if(e){if(typeof e=="string")return YS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?YS(e,t):void 0}}function YS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=y.useState("".concat(Su("recharts"),"-clip")),n=xV(r,1),a=n[0],o=B0();if(o==null)return null;var u=o.x,l=o.y,f=o.width,h=o.height;return y.createElement(SV.Provider,{value:a},y.createElement("defs",null,y.createElement("clipPath",{id:a},y.createElement("rect",{x:u,y:l,height:h,width:f}))),t)};function SO(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*a)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-a)<=0}function CV(e,t){return SO(e,t+1)}function AV(e,t,r,n,a){for(var o=(n||[]).slice(),u=t.start,l=t.end,f=0,h=1,p=u,v=function(){var j=n==null?void 0:n[f];if(j===void 0)return{v:SO(n,h)};var k=f,S,N=()=>(S===void 0&&(S=r(j,k)),S),P=j.coordinate,O=f===0||zu(e,P,N,p,l);O||(f=0,p=u,h+=1),O&&(p=P+e*(N()/2+a),f+=h)},x;h<=o.length;)if(x=v(),x)return x.v;return[]}function OV(e,t,r,n,a){var o=(n||[]).slice(),u=o.length;if(u===0)return[];for(var l=t.start,f=t.end,h=1;h<=u;h++){for(var p=(u-1)%h,v=l,x=!0,b=function(){var C=n[k];if(C==null)return 0;var _=k,A,I=()=>(A===void 0&&(A=r(C,_)),A),U=C.coordinate,B=k===p||zu(e,U,I,v,f);if(!B)return x=!1,1;B&&(v=U+e*(I()/2+a))},j,k=p;k(k===void 0&&(k=r(b,x)),k);if(x===u-1){var N=e*(j.coordinate+e*S()/2-f);o[x]=j=er(er({},j),{},{tickCoord:N>0?j.coordinate-N*e:j.coordinate})}else o[x]=j=er(er({},j),{},{tickCoord:j.coordinate});if(j.tickCoord!=null){var P=zu(e,j.tickCoord,S,l,f);P&&(f=j.tickCoord-e*(S()/2+a),o[x]=er(er({},j),{},{isShow:!0}))}},p=u-1;p>=0;p--)h(p);return o}function DV(e,t,r,n,a,o){var u=(n||[]).slice(),l=u.length,f=t.start,h=t.end;if(o){var p=n[l-1];if(p!=null){var v=r(p,l-1),x=e*(p.coordinate+e*v/2-h);if(u[l-1]=p=er(er({},p),{},{tickCoord:x>0?p.coordinate-x*e:p.coordinate}),p.tickCoord!=null){var b=zu(e,p.tickCoord,()=>v,f,h);b&&(h=p.tickCoord-e*(v/2+a),u[l-1]=er(er({},p),{},{isShow:!0}))}}}for(var j=o?l-1:l,k=function(P){var O=u[P];if(O==null)return 1;var C=O,_,A=()=>(_===void 0&&(_=r(O,P)),_);if(P===0){var I=e*(C.coordinate-e*A()/2-f);u[P]=C=er(er({},C),{},{tickCoord:I<0?C.coordinate-I*e:C.coordinate})}else u[P]=C=er(er({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var U=zu(e,C.tickCoord,A,f,h);U&&(f=C.tickCoord+e*(A()/2+a),u[P]=er(er({},C),{},{isShow:!0}))}},S=0;S{var I=typeof h=="function"?h(_.value,A):_.value;return j==="width"?EV(du(I,{fontSize:t,letterSpacing:r}),k,v):du(I,{fontSize:t,letterSpacing:r})[j]},N=a[0],P=a[1],O=a.length>=2&&N!=null&&P!=null?Wr(P.coordinate-N.coordinate):1,C=PV(o,O,j);return f==="equidistantPreserveStart"?AV(O,C,S,a,u):f==="equidistantPreserveEnd"?OV(O,C,S,a,u):(f==="preserveStart"||f==="preserveStartEnd"?b=DV(O,C,S,a,u,f==="preserveStartEnd"):b=TV(O,C,S,a,u),b.filter(_=>_.isShow))}var RV=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,a=n,o=e.tickSize,u=o===void 0?0:o,l=e.tickMargin,f=l===void 0?0:l,h=0;if(t){Array.from(t).forEach(b=>{if(b){var j=b.getBoundingClientRect();j.width>h&&(h=j.width)}});var p=r?r.getBoundingClientRect().width:0,v=u+f,x=h+v+p+(r?a:0);return Math.round(x)}return 0},$V={xAxis:{},yAxis:{}},NO=rr({name:"renderedTicks",initialState:$V,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,a=r.axisId,o=r.ticks;e[n][a]=o},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,a=r.axisId;delete e[n][a]}}}),EO=NO.actions,LV=EO.setRenderedTicks,zV=EO.removeRenderedTicks,FV=NO.reducer,BV=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ZS(e,t){return KV(e)||HV(e,t)||WV(e,t)||UV()}function UV(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WV(e,t){if(e){if(typeof e=="string")return JS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?JS(e,t):void 0}}function JS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return Us;var o=t.map(u=>({value:u.value,coordinate:u.coordinate,offset:u.offset,index:u.index}));return a(LV({ticks:o,axisId:n,axisType:r})),()=>{a(zV({axisId:n,axisType:r}))}},[a,t,n,r]),null}var nG=y.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,a=e.tick,o=e.tickLine,u=e.stroke,l=e.tickFormatter,f=e.unit,h=e.padding,p=e.tickTextProps,v=e.orientation,x=e.mirror,b=e.x,j=e.y,k=e.width,S=e.height,N=e.tickSize,P=e.tickMargin,O=e.fontSize,C=e.letterSpacing,_=e.getTicksConfig,A=e.events,I=e.axisType,U=e.axisId,B=U0(mt(mt({},_),{},{ticks:n}),O,C),V=dn(_),q=sh(a),R=aO(V.textAnchor)?V.textAnchor:JV(v,x),de=eG(v,x),Z={};typeof o=="object"&&(Z=o);var ge=mt(mt({},V),{},{fill:"none"},Z),je=B.map(oe=>mt({entry:oe},ZV(oe,b,j,k,S,v,N,x,P))),me=je.map(oe=>{var X=oe.entry,$=oe.line;return y.createElement(Gr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(X.value,"-").concat(X.coordinate,"-").concat(X.tickCoord)},o&&y.createElement("line",ho({},ge,$,{className:et("recharts-cartesian-axis-tick-line",go(o,"className"))})))}),Q=je.map((oe,X)=>{var $,T,ee=oe.entry,ne=oe.tick,te=mt(mt(mt(mt({verticalAnchor:de},V),{},{textAnchor:R,stroke:"none",fill:u},ne),{},{index:X,payload:ee,visibleTicksCount:B.length,tickFormatter:l,padding:h},p),{},{angle:($=(T=p==null?void 0:p.angle)!==null&&T!==void 0?T:V.angle)!==null&&$!==void 0?$:0}),ue=mt(mt({},te),q);return y.createElement(Gr,ho({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},sD(A,ee,X)),a&&y.createElement(tG,{option:a,tickProps:ue,value:"".concat(typeof l=="function"?l(ee.value,X):ee.value).concat(f||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(I,"-ticks")},y.createElement(rG,{ticks:B,axisId:U,axisType:I}),Q.length>0&&y.createElement(xi,{zIndex:or.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(I,"-tick-labels"),ref:t},Q)),me.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(I,"-tick-lines")},me))}),iG=y.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,a=e.height,o=e.className,u=e.hide,l=e.ticks,f=e.axisType,h=e.axisId,p=VV(e,BV),v=y.useState(""),x=ZS(v,2),b=x[0],j=x[1],k=y.useState(""),S=ZS(k,2),N=S[0],P=S[1],O=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return RV({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var C=y.useCallback(_=>{if(_){var A=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=A;var I=A[0];if(I){var U=window.getComputedStyle(I),B=U.fontSize,V=U.letterSpacing;(B!==b||V!==N)&&(j(B),P(V))}}},[b,N]);return u||n!=null&&n<=0||a!=null&&a<=0?null:y.createElement(xi,{zIndex:e.zIndex},y.createElement(Gr,{className:et("recharts-cartesian-axis",o)},y.createElement(XV,{x:e.x,y:e.y,width:n,height:a,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:dn(e)}),y.createElement(nG,{ref:C,axisType:f,events:p,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:N,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),y.createElement(CH,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(LH,{label:e.label,labelRef:e.labelRef}),e.children)))}),W0=y.forwardRef((e,t)=>{var r=Qr(e,li);return y.createElement(iG,ho({},r,{ref:t}))});W0.displayName="CartesianAxis";var aG=["x1","y1","x2","y2","key"],oG=["offset"],sG=["xAxisId","yAxisId"],lG=["xAxisId","yAxisId"];function tN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t{var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,a=e.y,o=e.width,u=e.height,l=e.ry;return y.createElement("rect",{x:n,y:a,ry:l,width:o,height:u,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function PO(e){var t=e.option,r=e.lineItemProps,n;if(y.isValidElement(t))n=y.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var a,o=r.x1,u=r.y1,l=r.x2,f=r.y2,h=r.key,p=qf(r,aG),v=(a=dn(p))!==null&&a!==void 0?a:{};v.offset;var x=qf(v,oG);n=y.createElement("line",Ha({},x,{x1:o,y1:u,x2:l,y2:f,fill:"none",key:h}))}return n}function pG(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,o=e.horizontalPoints;if(!a||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=qf(e,sG),l=o.map((f,h)=>{var p=tr(tr({},u),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return y.createElement(PO,{key:"line-".concat(h),option:a,lineItemProps:p})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function mG(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,o=e.verticalPoints;if(!a||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=qf(e,lG),l=o.map((f,h)=>{var p=tr(tr({},u),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return y.createElement(PO,{option:a,lineItemProps:p,key:"line-".concat(h)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function vG(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,o=e.width,u=e.height,l=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length||l==null)return null;var p=l.map(x=>Math.round(x+a-a)).sort((x,b)=>x-b);a!==p[0]&&p.unshift(0);var v=p.map((x,b)=>{var j=p[b+1],k=j==null,S=k?a+u-x:j-x;if(S<=0)return null;var N=b%t.length;return y.createElement("rect",{key:"react-".concat(b),y:x,x:n,height:S,width:o,stroke:"none",fill:t[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function gG(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,o=e.x,u=e.y,l=e.width,f=e.height,h=e.verticalPoints;if(!r||!n||!n.length)return null;var p=h.map(x=>Math.round(x+o-o)).sort((x,b)=>x-b);o!==p[0]&&p.unshift(0);var v=p.map((x,b)=>{var j=p[b+1],k=j==null,S=k?o+l-x:j-x;if(S<=0)return null;var N=b%n.length;return y.createElement("rect",{key:"react-".concat(b),x,y:u,width:S,height:f,stroke:"none",fill:n[N],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var yG=(e,t)=>{var r=e.xAxis,n=e.width,a=e.height,o=e.offset;return sP(U0(tr(tr(tr({},li),r),{},{ticks:lP(r),viewBox:{x:0,y:0,width:n,height:a}})),o.left,o.left+o.width,t)},xG=(e,t)=>{var r=e.yAxis,n=e.width,a=e.height,o=e.offset;return sP(U0(tr(tr(tr({},li),r),{},{ticks:lP(r),viewBox:{x:0,y:0,width:n,height:a}})),o.top,o.top+o.height,t)},bG={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:or.grid};function CO(e){var t=vP(),r=gP(),n=mP(),a=tr(tr({},Qr(e,bG)),{},{x:Ne(e.x)?e.x:n.left,y:Ne(e.y)?e.y:n.top,width:Ne(e.width)?e.width:n.width,height:Ne(e.height)?e.height:n.height}),o=a.xAxisId,u=a.yAxisId,l=a.x,f=a.y,h=a.width,p=a.height,v=a.syncWithTicks,x=a.horizontalValues,b=a.verticalValues,j=wr(),k=Ce(B=>nS(B,"xAxis",o,j)),S=Ce(B=>nS(B,"yAxis",u,j));if(!Rn(h)||!Rn(p)||!Ne(l)||!Ne(f))return null;var N=a.verticalCoordinatesGenerator||yG,P=a.horizontalCoordinatesGenerator||xG,O=a.horizontalPoints,C=a.verticalPoints;if((!O||!O.length)&&typeof P=="function"){var _=x&&x.length,A=P({yAxis:S?tr(tr({},S),{},{ticks:_?x:S.ticks}):void 0,width:t??h,height:r??p,offset:n},_?!0:v);bf(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(O=A)}if((!C||!C.length)&&typeof N=="function"){var I=b&&b.length,U=N({xAxis:k?tr(tr({},k),{},{ticks:I?b:k.ticks}):void 0,width:t??h,height:r??p,offset:n},I?!0:v);bf(Array.isArray(U),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof U,"]")),Array.isArray(U)&&(C=U)}return y.createElement(xi,{zIndex:a.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(hG,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),y.createElement(vG,Ha({},a,{horizontalPoints:O})),y.createElement(gG,Ha({},a,{verticalPoints:C})),y.createElement(pG,Ha({},a,{offset:n,horizontalPoints:O,xAxis:k,yAxis:S})),y.createElement(mG,Ha({},a,{offset:n,verticalPoints:C,xAxis:k,yAxis:S}))))}CO.displayName="CartesianGrid";var wG={},AO=rr({name:"errorBars",initialState:wG,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,a=r.errorBar;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,a=r.prev,o=r.next;e[n]&&(e[n]=e[n].map(u=>u.dataKey===a.dataKey&&u.direction===a.direction?o:u))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,a=r.errorBar;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==a.dataKey||o.direction!==a.direction))}}}),H0=AO.actions;H0.addErrorBar;H0.replaceErrorBar;H0.removeErrorBar;var jG=AO.reducer;function OO(e,t){var r,n,a=Ce(h=>vi(h,e)),o=Ce(h=>gi(h,t)),u=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:St.allowDataOverflow,l=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:Nt.allowDataOverflow,f=u||l;return{needClip:f,needClipX:u,needClipY:l}}function kG(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,a=B0(),o=OO(t,r),u=o.needClipX,l=o.needClipY,f=o.needClip,h=Ce(O=>pA(O,t,!1)),p=Ce(O=>mA(O,r,!1));if(!f||!a)return null;var v=a.x,x=a.y,b=a.width,j=a.height,k=u&&h?Math.min(h[0],h[1]):v-b/2,S=l&&p?Math.min(p[0],p[1]):x-j/2,N=u&&h?Math.abs(h[1]-h[0]):b*2,P=l&&p?Math.abs(p[1]-p[0]):j*2;return y.createElement("clipPath",{id:"clipPath-".concat(n)},y.createElement("rect",{x:k,y:S,width:N,height:P}))}function SG(e){var t=sh(e),r=3,n=2;if(t!=null){var a=t.r,o=t.strokeWidth,u=Number(a),l=Number(o);return(Number.isNaN(u)||u<0)&&(u=r),(Number.isNaN(l)||l<0)&&(l=n),{r:u,strokeWidth:l}}return{r,strokeWidth:n}}function K0(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:bO}function V0(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:bO}var _O=(e,t,r)=>kA(e,"xAxis",K0(e,t),r),MO=(e,t,r)=>jA(e,"xAxis",K0(e,t),r),IO=(e,t,r)=>kA(e,"yAxis",V0(e,t),r),TO=(e,t,r)=>jA(e,"yAxis",V0(e,t),r),NG=K([ut,_O,IO,MO,TO],(e,t,r,n,a)=>zn(e,"xAxis")?xf(t,n,!1):xf(r,a,!1)),EG=(e,t)=>t,DO=K([UC,EG],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),RO=e=>{var t=ut(e),r=zn(t,"xAxis");return r?"yAxis":"xAxis"},PG=(e,t)=>{var r=RO(e);return r==="yAxis"?V0(e,t):K0(e,t)},CG=(e,t,r)=>ZC(e,RO(e),PG(e,t),r),AG=K([DO,CG],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,a=Vy(e);if(!(n==null||a==null)){var o=(r=t[n])===null||r===void 0?void 0:r.stackedData,u=o==null?void 0:o.find(l=>l.key===a);if(u!=null)return u.map(l=>[l[0],l[1]])}}}),OG=K([ut,_O,IO,MO,TO,AG,eF,NG,DO,gF],(e,t,r,n,a,o,u,l,f,h)=>{var p=u.chartData,v=u.dataStartIndex,x=u.dataEndIndex;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||a==null||n.length===0||a.length===0||l==null)){var b=f.data,j;if(b&&b.length>0?j=b:j=p==null?void 0:p.slice(v,x+1),j!=null)return rq({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:a,dataStartIndex:v,areaSettings:f,stackedData:o,displayedData:j,chartBaseValue:h,bandSize:l})}}),_G=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],MG=["id","baseLine"];function fu(){return fu=Object.assign?Object.assign.bind():function(e){for(var t=1;tv.y||0));return Ne(a)?p=Math.max(a,p):a&&Array.isArray(a)&&a.length&&(p=Math.max(...a.map(v=>v.y||0),p)),Ne(p)?y.createElement("rect",{x:lv.x||0));return Ne(a)?p=Math.max(a,p):a&&Array.isArray(a)&&a.length&&(p=Math.max(...a.map(v=>v.x||0),p)),Ne(p)?y.createElement("rect",{x:0,y:le==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[zs(zs({},r.next),{},{x:ni(r.prev.x,r.next.x,t),y:ni(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),LO={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:z0,animationInterpolateFn:HG,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:$G,xAxisId:0,yAxisId:0,zIndex:or.area};function Yf(e,t){return e&&e!=="none"?e:t}var KG=e=>{var t=e.dataKey,r=e.name,n=e.stroke,a=e.fill,o=e.legendType,u=e.hide;return[{inactive:u,dataKey:t,type:o,color:Yf(n,a),value:uP(r,t),payload:e}]},VG=y.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,a=e.strokeWidth,o=e.fill,u=e.name,l=e.hide,f=e.unit,h=e.tooltipType,p=e.id,v={dataDefinedOnItem:r,getPosition:Us,settings:{stroke:n,strokeWidth:a,fill:o,dataKey:t,nameKey:void 0,name:uP(u,t),hide:l,type:h,color:Yf(n,o),unit:f,graphicalItemId:p}};return y.createElement(iK,{tooltipEntrySettings:v})});function GG(e){var t=e.clipPathId,r=e.points,n=e.props,a=n.needClip,o=n.dot,u=n.dataKey,l=dn(n);return y.createElement(GK,{points:r,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:u,baseProps:l,needClip:a,clipPathId:t})}function qG(e){var t=e.showLabels,r=e.children,n=e.points,a=n.map(o=>{var u,l,f={x:(u=o.x)!==null&&u!==void 0?u:0,y:(l=o.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return zs(zs({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return y.createElement(WH,{value:t?a:void 0},r)}function QG(e){var t=e.points,r=e.baseLine,n=e.needClip,a=e.clipPathId,o=e.props,u=e.animationElapsedTime,l=e.isAnimating,f=e.isEntrance,h=o.layout,p=o.type,v=o.stroke,x=o.connectNulls,b=o.isRange,j=o.shape,k=o.id,S=$O(o,LG),N=Vr(S),P=zs(zs({},N),{},{id:k,points:t,connectNulls:x,type:p,baseLine:r,layout:h,stroke:v,isRange:b,animationElapsedTime:u,isAnimating:l,isEntrance:f});return y.createElement(y.Fragment,null,(t==null?void 0:t.length)>1&&y.createElement(Gr,{clipPath:n?"url(#clipPath-".concat(a,")"):void 0},y.createElement(nK,{option:j,DefaultShape:LO.shape,shapeProps:P})),y.createElement(GG,{points:t,props:S,clipPathId:a}))}function YG(e,t,r){if(Ne(e)){var n=Ne(t)?t:void 0;return ni(n,e,r)}if(Kt(e)||Tn(e)){var a=Ne(t)?t:void 0;return ni(a,0,r)}return e}function XG(e){var t=e.needClip,r=e.clipPathId,n=e.props,a=e.previousPointsRef,o=e.previousBaselineRef,u=n.points,l=n.baseLine,f=n.isAnimationActive,h=n.animationBegin,p=n.animationDuration,v=n.animationEasing,x=n.animationMatchBy,b=n.animationInterpolateFn,j=y.useMemo(()=>({points:u,baseLine:l}),[u,l]),k=gO(j,o),S=My(),N=wK(n.onAnimationStart,n.onAnimationEnd),P=N.isAnimating,O=N.handleAnimationStart,C=N.handleAnimationEnd,_=k.startValue;if(S==null)return null;var A;return Array.isArray(l)&&Array.isArray(_)?A=Gg(_,l,x):Array.isArray(l)?A=Gg(null,l,x):A=null,y.createElement(jK,{animationInput:j,animationIdPrefix:"recharts-area-",items:u,previousItemsRef:a,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:v,onAnimationStart:O,onAnimationEnd:C,animationInterpolateFn:b,animationMatchBy:x,layout:S},(I,U,B)=>{var V;return U===1?V=l:Array.isArray(l)?V=b(A,U,S):V=B?l:YG(l,_,U),k.syncStepValue(V,U),y.createElement(qG,{showLabels:!P,points:u},n.children,y.createElement(QG,{points:I,baseLine:V,needClip:t,clipPathId:r,props:n,animationElapsedTime:U,isAnimating:P||U<1,isEntrance:B}),y.createElement(VH,{label:n.label}))})}function ZG(e){var t=e.needClip,r=e.clipPathId,n=e.props,a=y.useRef(null),o=y.useRef();return y.createElement(XG,{needClip:t,clipPathId:r,props:n,previousPointsRef:a,previousBaselineRef:o})}class JG extends y.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,a=t.points,o=t.className,u=t.top,l=t.left,f=t.needClip,h=t.xAxisId,p=t.yAxisId,v=t.width,x=t.height,b=t.id,j=t.baseLine,k=t.zIndex;if(r)return null;var S=et("recharts-area",o),N=b,P=SG(n),O=P.r,C=P.strokeWidth,_=mO(n),A=O*2+C,I=f?"url(#clipPath-".concat(_?"":"dots-").concat(N,")"):void 0;return y.createElement(xi,{zIndex:k},y.createElement(Gr,{className:S},f&&y.createElement("defs",null,y.createElement(kG,{clipPathId:N,xAxisId:h,yAxisId:p}),!_&&y.createElement("clipPath",{id:"clipPath-dots-".concat(N)},y.createElement("rect",{x:l-A/2,y:u-A/2,width:v+A,height:x+A}))),y.createElement(ZG,{needClip:f,clipPathId:N,props:this.props})),y.createElement(qS,{points:a,mainColor:Yf(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:I}),this.props.isRange&&Array.isArray(j)&&y.createElement(qS,{points:j,mainColor:Yf(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:I}))}}function eq(e){var t,r=e.activeDot,n=e.animationBegin,a=e.animationDuration,o=e.animationEasing,u=e.connectNulls,l=e.dot,f=e.fill,h=e.fillOpacity,p=e.hide,v=e.isAnimationActive,x=e.legendType,b=e.stroke,j=e.xAxisId,k=e.yAxisId,S=$O(e,zG),N=Ws(),P=VA(),O=OO(j,k),C=O.needClip,_=wr(),A=(t=Ce(ge=>OG(ge,e.id,_)))!==null&&t!==void 0?t:{},I=A.points,U=A.isRange,B=A.baseLine,V=B0();if(N!=="horizontal"&&N!=="vertical"||V==null||P!=="AreaChart"&&P!=="ComposedChart")return null;var q=V.height,R=V.width,de=V.x,Z=V.y;return!I||!I.length?null:y.createElement(JG,Qf({},S,{activeDot:r,animationBegin:n,animationDuration:a,animationEasing:o,baseLine:B,connectNulls:u,dot:l,fill:f,fillOpacity:h,height:q,hide:p,layout:N,isAnimationActive:v,isRange:U,legendType:x,needClip:C,points:I,stroke:b,width:R,left:de,top:Z,xAxisId:j,yAxisId:k}))}var tq=(e,t,r,n,a)=>{var o=r??t;if(Ne(o))return o;var u=e==="horizontal"?a:n,l=u.scale.domain();if(u.type==="number"){var f=Math.max(l[0],l[1]),h=Math.min(l[0],l[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(l[0],l[1]),0)}return o==="dataMin"?l[0]:o==="dataMax"?l[1]:l[0]};function rq(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,a=t.dataKey,o=e.stackedData,u=e.layout,l=e.chartBaseValue,f=e.xAxis,h=e.yAxis,p=e.displayedData,v=e.dataStartIndex,x=e.xAxisTicks,b=e.yAxisTicks,j=e.bandSize,k=o&&o.length,S=tq(u,l,n,f,h),N=u==="horizontal",P=!1,O=p.map((_,A)=>{var I,U,B,V;if(k)V=o[v+A];else{var q=Tt(_,a);Array.isArray(q)?(V=q,P=!0):V=[S,q]}var R=(I=(U=V)===null||U===void 0?void 0:U[1])!==null&&I!==void 0?I:null,de=R==null||k&&!r&&Tt(_,a)==null;if(N){var Z;return{x:Zw({axis:f,ticks:x,bandSize:j,entry:_,index:A}),y:de?null:(Z=h.scale.map(R))!==null&&Z!==void 0?Z:null,value:V,payload:_}}return{x:de?null:(B=f.scale.map(R))!==null&&B!==void 0?B:null,y:Zw({axis:h,ticks:b,bandSize:j,entry:_,index:A}),value:V,payload:_}}),C;return k||P?C=O.map(_=>{var A,I=Array.isArray(_.value)?_.value[0]:null;if(N){var U;return{x:_.x,y:I!=null&&_.y!=null&&(U=h.scale.map(I))!==null&&U!==void 0?U:null,payload:_.payload}}return{x:I!=null&&(A=f.scale.map(I))!==null&&A!==void 0?A:null,y:_.y,payload:_.payload}}):C=N?h.scale.map(S):f.scale.map(S),{points:O,baseLine:C??0,isRange:P}}function nq(e){var t=Qr(e,LO),r=wr();return y.createElement(_K,{id:t.id,type:"area"},n=>y.createElement(y.Fragment,null,y.createElement(aK,{legendPayload:KG(t)}),y.createElement(VG,{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:n}),y.createElement(LK,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:F$(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),y.createElement(eq,Qf({},t,{id:n}))))}var zO=y.memo(nq,Ah);zO.displayName="Area";var iq=["domain","range"],aq=["domain","range"];function iN(e,t){if(e==null)return{};var r,n,a=oq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{if(u!=null)return sN(sN({},o),{},{type:u})},[o,u]);return y.useLayoutEffect(()=>{l!=null&&(r.current===null?t(ZK(l)):r.current!==l&&t(JK({prev:r.current,next:l})),r.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(eV(r.current)),r.current=null)},[t]),null}var mq=e=>{var t=e.xAxisId,r=e.className,n=Ce(dP),a=wr(),o="xAxis",u=Ce(x=>wA(x,o,t,a)),l=Ce(x=>Q9(x,t)),f=Ce(x=>tU(x,t)),h=Ce(x=>LC(x,t));if(l==null||f==null||h==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var p=Qg(e,lq);h.id,h.scale;var v=Qg(h,uq);return y.createElement(W0,qg({},p,v,{x:f.x,y:f.y,width:l.width,height:l.height,className:et("recharts-".concat(o," ").concat(o),r),viewBox:n,ticks:u,axisType:o,axisId:t}))},vq={allowDataOverflow:St.allowDataOverflow,allowDecimals:St.allowDecimals,allowDuplicatedCategory:St.allowDuplicatedCategory,angle:St.angle,axisLine:li.axisLine,height:St.height,hide:!1,includeHidden:St.includeHidden,interval:St.interval,label:!1,minTickGap:St.minTickGap,mirror:St.mirror,orientation:St.orientation,padding:St.padding,reversed:St.reversed,scale:St.scale,tick:St.tick,tickCount:St.tickCount,tickLine:li.tickLine,tickSize:li.tickSize,type:St.type,niceTicks:St.niceTicks,xAxisId:0},gq=e=>{var t=Qr(e,vq);return y.createElement(y.Fragment,null,y.createElement(pq,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),y.createElement(mq,t))},BO=y.memo(gq,FO);BO.displayName="XAxis";var yq=["type"],xq=["dangerouslySetInnerHTML","ticks","scale"],bq=["id","scale"];function Yg(){return Yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(u!=null)return uN(uN({},o),{},{type:u})},[u,o]);return y.useLayoutEffect(()=>{l!=null&&(r.current===null?t(tV(l)):r.current!==l&&t(rV({prev:r.current,next:l})),r.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(nV(r.current)),r.current=null)},[t]),null}function Eq(e){var t=e.yAxisId,r=e.className,n=e.width,a=e.label,o=y.useRef(null),u=y.useRef(null),l=Ce(dP),f=wr(),h=wt(),p="yAxis",v=Ce(N=>iU(N,t)),x=Ce(N=>nU(N,t)),b=Ce(N=>wA(N,p,t,f)),j=Ce(N=>zC(N,t));if(y.useLayoutEffect(()=>{if(!(n!=="auto"||!v||L0(a)||y.isValidElement(a)||j==null)){var N=o.current;if(N){var P=N.getCalculatedWidth();Math.round(v.width)!==Math.round(P)&&h(iV({id:t,width:P}))}}},[b,v,h,a,t,n,j]),v==null||x==null||j==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var k=Xg(e,xq);j.id,j.scale;var S=Xg(j,bq);return y.createElement(W0,Yg({},k,S,{ref:o,labelRef:u,x:x.x,y:x.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:v.width,height:v.height,className:et("recharts-".concat(p," ").concat(p),r),viewBox:l,ticks:b,axisType:p,axisId:t}))}var Pq={allowDataOverflow:Nt.allowDataOverflow,allowDecimals:Nt.allowDecimals,allowDuplicatedCategory:Nt.allowDuplicatedCategory,angle:Nt.angle,axisLine:li.axisLine,hide:!1,includeHidden:Nt.includeHidden,interval:Nt.interval,label:!1,minTickGap:Nt.minTickGap,mirror:Nt.mirror,orientation:Nt.orientation,padding:Nt.padding,reversed:Nt.reversed,scale:Nt.scale,tick:Nt.tick,tickCount:Nt.tickCount,tickLine:li.tickLine,tickSize:li.tickSize,type:Nt.type,niceTicks:Nt.niceTicks,width:Nt.width,yAxisId:0},Cq=e=>{var t=Qr(e,Pq);return y.createElement(y.Fragment,null,y.createElement(Nq,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),y.createElement(Eq,t))},UO=y.memo(Cq,FO);UO.displayName="YAxis";var Aq=(e,t)=>t,G0=K([Aq,ut,JP,Rt,FA,yi,E7,Gt],I7);function Oq(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function q0(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(Oq(e)){var a=e.currentTarget.getBBox();r=a.width>0?t.width/a.width:1,n=a.height>0?t.height/a.height:1}else{var o=e.currentTarget;r=o.offsetWidth>0?t.width/o.offsetWidth:1,n=o.offsetHeight>0?t.height/o.offsetHeight:1}var u=(l,f)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((f-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>u(l.clientX,l.clientY)):u(e.clientX,e.clientY)}var WO=Mr("mouseClick"),HO=qu();HO.startListening({actionCreator:WO,effect:(e,t)=>{var r=e.payload,n=G0(t.getState(),q0(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(xU({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Zg=Mr("mouseMove"),KO=qu(),ts=null,Ma=null,Pv=null;KO.startListening({actionCreator:Zg,effect:(e,t)=>{var r=e.payload,n=t.getState(),a=n.eventSettings,o=a.throttleDelay,u=a.throttledEvents,l=u==="all"||(u==null?void 0:u.includes("mousemove"));ts!==null&&(cancelAnimationFrame(ts),ts=null),Ma!==null&&(typeof o!="number"||!l)&&(clearTimeout(Ma),Ma=null),Pv=q0(r);var f=()=>{var h=t.getState(),p=sc(h,h.tooltip.settings.shared);if(!Pv){ts=null,Ma=null;return}if(p==="axis"){var v=G0(h,Pv);(v==null?void 0:v.activeIndex)!=null?t.dispatch(OA({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate})):t.dispatch(AA())}ts=null,Ma=null};if(!l){f();return}o==="raf"?ts=requestAnimationFrame(f):typeof o=="number"&&Ma===null&&(Ma=setTimeout(f,o))}});function _q(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 cN={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},VO=rr({name:"rootProps",initialState:cN,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:cN.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}}}),Mq=VO.reducer,Iq=VO.actions.updateOptions,Tq=null,Dq={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},GO=rr({name:"polarOptions",initialState:Tq,reducers:Dq});GO.actions.updatePolarOptions;var Rq=GO.reducer,qO=Mr("keyDown"),QO=Mr("focus"),YO=Mr("blur"),Qh=qu(),rs=null,Ia=null,Wd=null;Qh.startListening({actionCreator:qO,effect:(e,t)=>{Wd=e.payload,rs!==null&&(cancelAnimationFrame(rs),rs=null);var r=t.getState(),n=r.eventSettings,a=n.throttleDelay,o=n.throttledEvents,u=o==="all"||o.includes("keydown");Ia!==null&&(typeof a!="number"||!u)&&(clearTimeout(Ia),Ia=null);var l=()=>{try{var f=t.getState(),h=f.rootProps.accessibilityLayer!==!1;if(!h)return;var p=f.tooltip.keyboardInteraction,v=Wd;if(v!=="ArrowRight"&&v!=="ArrowLeft"&&v!=="Enter")return;var x=cu(p,fo(f),$s(f),Ls(f)),b=x==null?-1:Number(x),j=!Number.isFinite(b)||b<0,k=yi(f),S=fo(f),N=sc(f,f.tooltip.settings.shared);if(v==="Enter"){if(j)return;var P=Hf(f,N,"hover",String(p.index));t.dispatch(Wf({active:!p.active,activeIndex:p.index,activeCoordinate:P}));return}var O=uU(f),C=O==="left-to-right"?1:-1,_=v==="ArrowRight"?1:-1,A;if(j){var I=$s(f),U=Ls(f),B=_*C,V=ge=>({active:!1,index:String(ge),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(A=-1,B>0){for(var q=0;q=0;R--)if(cu(V(R),S,I,U)!=null){A=R;break}if(A<0)return}else{A=b+_*C;var de=(k==null?void 0:k.length)||S.length;if(de===0||A>=de||A<0)return}var Z=Hf(f,N,"hover",String(A));t.dispatch(Wf({active:!0,activeIndex:A.toString(),activeCoordinate:Z}))}finally{rs=null,Ia=null}};if(!u){l();return}a==="raf"?rs=requestAnimationFrame(l):typeof a=="number"&&Ia===null&&(l(),Wd=null,Ia=setTimeout(()=>{Wd?l():(Ia=null,rs=null)},a))}});Qh.startListening({actionCreator:QO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var a=r.tooltip.keyboardInteraction;if(!a.active&&a.index==null){var o="0",u=sc(r,r.tooltip.settings.shared),l=Hf(r,u,"hover",String(o));t.dispatch(Wf({active:!0,activeIndex:o,activeCoordinate:l}))}}}});Qh.startListening({actionCreator:YO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var a=r.tooltip.keyboardInteraction;a.active&&t.dispatch(Wf({active:!1,activeIndex:a.index,activeCoordinate:a.coordinate}))}}});function XO(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var a=Reflect.get(r,n);return typeof a=="function"?a.bind(r):a}})}var Fr=Mr("externalEvent"),ZO=qu(),Hd=new Map,nu=new Map,Cv=new Map;ZO.startListening({actionCreator:Fr,effect:(e,t)=>{var r=e.payload,n=r.handler,a=r.reactEvent;if(n!=null){var o=a.type,u=XO(a);Cv.set(o,{handler:n,reactEvent:u});var l=Hd.get(o);l!==void 0&&(cancelAnimationFrame(l),Hd.delete(o));var f=t.getState(),h=f.eventSettings,p=h.throttleDelay,v=h.throttledEvents,x=v,b=x==="all"||(x==null?void 0:x.includes(o)),j=nu.get(o);j!==void 0&&(typeof p!="number"||!b)&&(clearTimeout(j),nu.delete(o));var k=()=>{var P=Cv.get(o);try{if(!P)return;var O=P.handler,C=P.reactEvent,_=t.getState(),A={activeCoordinate:d7(_),activeDataKey:l7(_),activeIndex:$u(_),activeLabel:WA(_),activeTooltipIndex:$u(_),isTooltipActive:f7(_)};O&&O(A,C)}finally{Hd.delete(o),nu.delete(o),Cv.delete(o)}};if(!b){k();return}if(p==="raf"){var S=requestAnimationFrame(k);Hd.set(o,S)}else if(typeof p=="number"){if(!nu.has(o)){k();var N=setTimeout(k,p);nu.set(o,N)}}else k()}}});var $q=K([Xs],e=>e.tooltipItemPayloads),Lq=K([$q,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(o=>o.settings.graphicalItemId===r);if(n!=null){var a=n.getPosition;if(a!=null)return a(t)}}}),JO=Mr("touchMove"),e_=qu(),Ta=null,Hi=null,dN=null,iu=null;e_.startListening({actionCreator:JO,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){iu=XO(r);var n=t.getState(),a=n.eventSettings,o=a.throttleDelay,u=a.throttledEvents,l=u==="all"||u.includes("touchmove");Ta!==null&&(cancelAnimationFrame(Ta),Ta=null),Hi!==null&&(typeof o!="number"||!l)&&(clearTimeout(Hi),Hi=null),dN=Array.from(r.touches).map(h=>q0({clientX:h.clientX,clientY:h.clientY,currentTarget:r.currentTarget}));var f=()=>{if(iu!=null){var h=t.getState(),p=sc(h,h.tooltip.settings.shared);if(p==="axis"){var v,x=(v=dN)===null||v===void 0?void 0:v[0];if(x==null){Ta=null,Hi=null;return}var b=G0(h,x);(b==null?void 0:b.activeIndex)!=null&&t.dispatch(OA({activeIndex:b.activeIndex,activeDataKey:void 0,activeCoordinate:b.activeCoordinate}))}else if(p==="item"){var j,k=iu.touches[0];if(document.elementFromPoint==null||k==null)return;var S=document.elementFromPoint(k.clientX,k.clientY);if(!S||!S.getAttribute)return;var N=S.getAttribute(G$),P=(j=S.getAttribute(q$))!==null&&j!==void 0?j:void 0,O=bo(h).find(A=>A.id===P);if(N==null||O==null||P==null)return;var C=O.dataKey,_=Lq(h,N,P);t.dispatch(yU({activeDataKey:C,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:P}))}Ta=null,Hi=null}};if(!l){f();return}o==="raf"?Ta=requestAnimationFrame(f):typeof o=="number"&&Hi===null&&(f(),iu=null,Hi=setTimeout(()=>{iu?f():(Hi=null,Ta=null)},o))}}});var t_={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},r_=rr({name:"eventSettings",initialState:t_,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),zq=r_.actions.setEventSettings,Fq=r_.reducer,Bq=ME({brush:pV,cartesianAxis:aV,chartData:cW,errorBars:jG,eventSettings:Fq,graphicalItems:RK,layout:_$,legend:KL,options:aW,polarAxis:qH,polarOptions:Rq,referenceElements:yV,renderedTicks:FV,rootProps:Mq,tooltip:bU,zIndex:V7}),Uq=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return r$({reducer:Bq,preloadedState:t,middleware:n=>{var a;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((a="es6")!==null&&a!==void 0?a:"")}).concat([HO.middleware,KO.middleware,Qh.middleware,ZO.middleware,e_.middleware])},enhancers:n=>{var a=n;return typeof n=="function"&&(a=n()),a.concat(GE({type:"raf"}))},devTools:{serialize:{replacer:_q},name:"recharts-".concat(r)}})};function Wq(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,a=wr(),o=y.useRef(null);if(a)return r;o.current==null&&(o.current=Uq(t,n));var u=ky;return y.createElement(sz,{context:u,store:o.current},r)}function Hq(e){var t=e.layout,r=e.margin,n=wt(),a=wr();return y.useEffect(()=>{a||(n(C$(t)),n(P$(r)))},[n,a,t,r]),null}var Kq=y.memo(Hq,Ah);function Vq(e){var t=wt();return y.useEffect(()=>{t(Iq(e))},[t,e]),null}var Gq=e=>{var t=wt();return y.useEffect(()=>{t(zq(e))},[t,e]),null},qq=y.memo(Gq,Ah);function fN(e){var t=e.zIndex,r=e.isPanorama,n=y.useRef(null),a=wt();return y.useLayoutEffect(()=>(n.current&&a(H7({zIndex:t,element:n.current,isPanorama:r})),()=>{a(K7({zIndex:t,isPanorama:r}))}),[a,t,r]),y.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function hN(e){var t=e.children,r=e.isPanorama,n=Ce(D7);if(!n||n.length===0)return t;var a=n.filter(u=>u<0),o=n.filter(u=>u>0);return y.createElement(y.Fragment,null,a.map(u=>y.createElement(fN,{key:u,zIndex:u,isPanorama:r})),t,o.map(u=>y.createElement(fN,{key:u,zIndex:u,isPanorama:r})))}var Qq=["children"];function Yq(e,t){if(e==null)return{};var r,n,a=Xq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=vP(),n=gP(),a=PP();if(!Rn(r)||!Rn(n))return null;var o=e.children,u=e.otherAttributes,l=e.title,f=e.desc,h,p;return u!=null&&(typeof u.tabIndex=="number"?h=u.tabIndex:h=a?0:void 0,typeof u.role=="string"?p=u.role:p=a?"application":void 0),y.createElement(Y2,Xf({},u,{title:l,desc:f,role:p,tabIndex:h,width:r,height:n,style:Zq,ref:t}),o)}),eQ=e=>{var t=e.children,r=Ce(Sh);if(!r)return null;var n=r.width,a=r.height,o=r.y,u=r.x;return y.createElement(Y2,{width:n,height:a,x:u,y:o},t)},pN=y.forwardRef((e,t)=>{var r=e.children,n=Yq(e,Qq),a=wr();return a?y.createElement(eQ,null,y.createElement(hN,{isPanorama:!0},r)):y.createElement(Jq,Xf({ref:t},n),y.createElement(hN,{isPanorama:!1},r))});function tQ(e,t){return aQ(e)||iQ(e,t)||nQ(e,t)||rQ()}function rQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nQ(e,t){if(e){if(typeof e=="string")return mN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mN(e,t):void 0}}function mN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var u=n.getBoundingClientRect(),l=u.width/n.offsetWidth;Be(l)&&l!==o&&e(O$(l))}},[n,e,o]),a}function vN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function sQ(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(xW(),null);function Jf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var vQ=y.forwardRef((e,t)=>{var r,n,a=y.useRef(null),o=y.useState({containerWidth:Jf((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Jf((n=e.style)===null||n===void 0?void 0:n.height)}),u=Zf(o,2),l=u[0],f=u[1],h=y.useCallback((v,x)=>{f(b=>{var j=Math.round(v),k=Math.round(x);return b.containerWidth===j&&b.containerHeight===k?b:{containerWidth:j,containerHeight:k}})},[]),p=y.useCallback(v=>{if(typeof t=="function"&&t(v),a.current!=null&&(a.current.disconnect(),a.current=null),v!=null&&typeof ResizeObserver<"u"){var x=v.getBoundingClientRect(),b=x.width,j=x.height;h(b,j);var k=N=>{var P=N[0];if(P!=null){var O=P.contentRect,C=O.width,_=O.height;h(C,_)}},S=new ResizeObserver(k);S.observe(v),a.current=S}},[t,h]);return y.useEffect(()=>()=>{var v=a.current;v!=null&&v.disconnect()},[h]),y.createElement(y.Fragment,null,y.createElement(Yu,{width:l.containerWidth,height:l.containerHeight}),y.createElement("div",ua({ref:p},e)))}),gQ=y.forwardRef((e,t)=>{var r=e.width,n=e.height,a=y.useState({containerWidth:Jf(r),containerHeight:Jf(n)}),o=Zf(a,2),u=o[0],l=o[1],f=y.useCallback((p,v)=>{l(x=>{var b=Math.round(p),j=Math.round(v);return x.containerWidth===b&&x.containerHeight===j?x:{containerWidth:b,containerHeight:j}})},[]),h=y.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null){var v=p.getBoundingClientRect(),x=v.width,b=v.height;f(x,b)}},[t,f]);return y.createElement(y.Fragment,null,y.createElement(Yu,{width:u.containerWidth,height:u.containerHeight}),y.createElement("div",ua({ref:h},e)))}),yQ=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return y.createElement(y.Fragment,null,y.createElement(Yu,{width:r,height:n}),y.createElement("div",ua({ref:t},e)))}),xQ=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?y.createElement(gQ,ua({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?y.createElement(yQ,ua({},e,{width:r,height:n,ref:t})):y.createElement(y.Fragment,null,y.createElement(Yu,{width:r,height:n}),y.createElement("div",ua({ref:t},e)))});function bQ(e){return e?vQ:xQ}var wQ=y.forwardRef((e,t)=>{var r=e.children,n=e.className,a=e.height,o=e.onClick,u=e.onContextMenu,l=e.onDoubleClick,f=e.onMouseDown,h=e.onMouseEnter,p=e.onMouseLeave,v=e.onMouseMove,x=e.onMouseUp,b=e.onTouchEnd,j=e.onTouchMove,k=e.onTouchStart,S=e.style,N=e.width,P=e.responsive,O=e.dispatchTouchEvents,C=O===void 0?!0:O,_=y.useRef(null),A=wt(),I=y.useState(null),U=Zf(I,2),B=U[0],V=U[1],q=y.useState(null),R=Zf(q,2),de=R[0],Z=R[1],ge=oQ(),je=Oy(),me=(je==null?void 0:je.width)>0?je.width:N,Q=(je==null?void 0:je.height)>0?je.height:a,oe=y.useCallback(ce=>{ge(ce),typeof t=="function"&&t(ce),V(ce),Z(ce),ce!=null&&(_.current=ce)},[ge,t,V,Z]),X=y.useCallback(ce=>{A(WO(ce)),A(Fr({handler:o,reactEvent:ce}))},[A,o]),$=y.useCallback(ce=>{A(Zg(ce)),A(Fr({handler:h,reactEvent:ce}))},[A,h]),T=y.useCallback(ce=>{A(AA()),A(Fr({handler:p,reactEvent:ce}))},[A,p]),ee=y.useCallback(ce=>{A(Zg(ce)),A(Fr({handler:v,reactEvent:ce}))},[A,v]),ne=y.useCallback(()=>{A(QO())},[A]),te=y.useCallback(()=>{A(YO())},[A]),ue=y.useCallback(ce=>{A(qO(ce.key))},[A]),pe=y.useCallback(ce=>{A(Fr({handler:u,reactEvent:ce}))},[A,u]),Ae=y.useCallback(ce=>{A(Fr({handler:l,reactEvent:ce}))},[A,l]),J=y.useCallback(ce=>{A(Fr({handler:f,reactEvent:ce}))},[A,f]),ke=y.useCallback(ce=>{A(Fr({handler:x,reactEvent:ce}))},[A,x]),Oe=y.useCallback(ce=>{A(Fr({handler:k,reactEvent:ce}))},[A,k]),ae=y.useCallback(ce=>{C&&A(JO(ce)),A(Fr({handler:j,reactEvent:ce}))},[A,C,j]),Xe=y.useCallback(ce=>{A(Fr({handler:b,reactEvent:ce}))},[A,b]),Y=bQ(P);return y.createElement(XA.Provider,{value:B},y.createElement(D4.Provider,{value:de},y.createElement(Y,{width:me??(S==null?void 0:S.width),height:Q??(S==null?void 0:S.height),className:et("recharts-wrapper",n),style:sQ({position:"relative",cursor:"default",width:me,height:Q},S),onClick:X,onContextMenu:pe,onDoubleClick:Ae,onFocus:ne,onBlur:te,onKeyDown:ue,onMouseDown:J,onMouseEnter:$,onMouseLeave:T,onMouseMove:ee,onMouseUp:ke,onTouchEnd:Xe,onTouchMove:ae,onTouchStart:Oe,ref:oe},y.createElement(mQ,null),r)))}),jQ=["width","height","responsive","children","className","style","compact","title","desc"];function kQ(e,t){if(e==null)return{};var r,n,a=SQ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,a=e.responsive,o=e.children,u=e.className,l=e.style,f=e.compact,h=e.title,p=e.desc,v=kQ(e,jQ),x=dn(v);return f?y.createElement(y.Fragment,null,y.createElement(Yu,{width:r,height:n}),y.createElement(pN,{otherAttributes:x,title:h,desc:p},o)):y.createElement(wQ,{className:u,style:l,width:r,height:n,responsive:a??!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},y.createElement(pN,{otherAttributes:x,title:h,desc:p,ref:t},y.createElement(NV,null,o)))});function Jg(){return Jg=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.createElement(MQ,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:IQ,tooltipPayloadSearcher:nW,categoricalChartProps:e,ref:t}));const DQ="rgba(130,130,150,0.14)",xN="rgba(130,130,150,0.85)";function RQ(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function n_(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function $Q({active:e,payload:t,unit:r}){return!e||!(t!=null&&t.length)?null:c.jsx("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:c.jsx("div",{className:"space-y-1",children:t.map(n=>c.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[c.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.color}}),c.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:n.name}),c.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:n_(n.value,r)})]},n.dataKey))})})}function i_({data:e,series:t,unit:r="%",yMode:n="percent",height:a=176}){const o=e.reduce((l,f)=>t.reduce((h,p)=>Math.max(h,Number(f[p.key])||0),l),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(RQ(o*1.15),10);return c.jsx("div",{style:{height:a},className:"w-full",children:c.jsx(PL,{width:"100%",height:"100%",children:c.jsxs(TQ,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[c.jsx("defs",{children:t.map(l=>c.jsxs("linearGradient",{id:`grad-${l.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:l.color,stopOpacity:.22}),c.jsx("stop",{offset:"100%",stopColor:l.color,stopOpacity:0})]},l.key))}),c.jsx(CO,{vertical:!1,stroke:DQ}),c.jsx(BO,{dataKey:"t",hide:!0}),c.jsx(UO,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:l=>n_(l,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:xN}}),c.jsx(MW,{content:c.jsx($Q,{unit:r}),cursor:{stroke:xN,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(l=>c.jsx(zO,{type:"monotone",dataKey:l.key,name:l.label,stroke:l.color,strokeWidth:2,fill:`url(#grad-${l.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},l.key))]})})})}const LQ=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function zQ(){var u,l,f,h;const{sys:e,hist:t}=S4(),r=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),n=LQ.filter(p=>p.key!=="gpu"||r),a={cpu:(u=e==null?void 0:e.cpu)==null?void 0:u.percent,ram:(l=e==null?void 0:e.ram)==null?void 0:l.percent,gpu:r?e.gpu.busy_percent:null,disk:(f=e==null?void 0:e.disk)==null?void 0:f.percent},o={cpu:(h=e==null?void 0:e.cpu)!=null&&h.cores?`${e.cpu.cores} Cores`:"",ram:e?`${Qo(e.ram.used)}/${Qo(e.ram.total)} GB`:"",gpu:r?`${Qo(e.gpu.gtt_used)}/${Qo(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${Qo(e.disk.used)}/${Qo(e.disk.total)} GB`:""};return c.jsxs("div",{className:"flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(_n,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),c.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:n.map(p=>c.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:p.color}}),c.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:p.label}),c.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(a[p.key]??0),"%"]}),o[p.key]&&c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:o[p.key]})]},p.key))}),c.jsx(i_,{data:t,series:n,unit:"%",yMode:"percent",height:176})]}):c.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&c.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&c.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&c.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}function Kd({label:e,value:t,tone:r}){return c.jsxs("div",{className:he("flex items-center justify-between rounded-lg border px-3 py-1.5 text-xs",r==="alert"?"border-amber-500/30 bg-amber-500/5 font-semibold text-amber-400":r==="accent"?"border-primary/30 bg-primary/5 font-semibold text-primary":"border-border/30 bg-background/25 text-muted-foreground"),children:[c.jsx("span",{className:"flex items-center gap-1.5",children:e}),c.jsx("span",{className:"font-mono text-[10px]",children:t})]})}function FQ(){var r;const{data:e}=hy(3e3),t=()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}}));return c.jsxs("div",{className:"flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border/20 pb-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(xI,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Updates & Pflege"})]}),(e==null?void 0:e.last_check)&&c.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground/80",children:["Zuletzt gesucht: ",new Date(e.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),e?c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Kd,{label:"OS-Pakete",tone:e.os>0?"alert":"muted",value:e.os>0?`${e.os} verfügbar`:"aktuell"}),c.jsx(Kd,{label:"Engine (llama.cpp)",tone:e.engine>0?"alert":"muted",value:e.engine>0?"Update verfügbar":"aktuell"}),c.jsx(Kd,{label:"Modell-Upgrades",tone:e.models>0?"accent":"muted",value:e.models>0?`${e.models} verfügbar`:"aktuell"}),(r=e.components)==null?void 0:r.map(n=>c.jsx(Kd,{tone:n.update===!0?"alert":"muted",label:c.jsxs(c.Fragment,{children:[n.name,n.reachable===!1&&c.jsx("span",{className:"text-[8px] font-bold uppercase text-red-400/80",children:"offline"})]}),value:n.update===!0?`Update: ${n.latest}`:n.update===!1?"aktuell":n.latest?`neueste: ${n.latest}`:"—"},n.key))]}):c.jsx("div",{className:"flex h-24 items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."})]}),c.jsxs("button",{onClick:t,className:"mt-4 flex h-9 w-full items-center justify-center gap-1.5 rounded-lg bg-primary text-xs font-semibold text-primary-foreground shadow-md shadow-primary/10 transition-all hover:opacity-90 cursor-pointer",children:["Updates verwalten & Pflege ",c.jsx(XN,{className:"h-3.5 w-3.5"})]})]})}function a_({type:e,title:t,message:r,defaultValue:n,autoValue:a,autoLabel:o,onConfirm:u,onCancel:l}){const f=y.useRef(null);return c.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:t}),c.jsx("button",{onClick:l||(()=>u()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r}),e==="prompt"&&c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{ref:f,type:"text",defaultValue:n,className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var p;h.key==="Enter"&&u((p=f.current)==null?void 0:p.value)}}),a!==void 0&&c.jsx("button",{type:"button",onClick:()=>{f.current&&(f.current.value=a)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:o||"Auto"})]}),c.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(e==="confirm"||e==="prompt")&&c.jsx("button",{onClick:l,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),c.jsx("button",{onClick:()=>{var p;const h=e==="prompt"?(p=f.current)==null?void 0:p.value:void 0;u(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:e==="confirm"?"Ja, fortfahren":e==="prompt"?"Übernehmen":"OK"})]})]})})}function el(){const[e,t]=y.useState(null),r=y.useCallback(()=>t(null),[]),n=y.useCallback((l,f,h)=>{t({type:"alert",title:l,message:f,onConfirm:()=>{t(null),h==null||h()}})},[]),a=y.useCallback((l,f,h,p)=>{t({type:"confirm",title:l,message:f,onConfirm:()=>{t(null),h()},onCancel:()=>{t(null),p==null||p()}})},[]),o=y.useCallback((l,f,h,p,v,x)=>{t({type:"prompt",title:l,message:f,defaultValue:h,autoValue:x==null?void 0:x.autoValue,autoLabel:x==null?void 0:x.autoLabel,onConfirm:b=>{t(null),p(b)},onCancel:()=>{t(null),v==null||v()}})},[]),u=e?c.jsx(a_,{...e}):null;return{showAlert:n,showConfirm:a,showPrompt:o,close:r,dialogElement:u}}function BQ(){const e=po(),{data:t}=fy(3e3),{data:r}=vo(),{showAlert:n,dialogElement:a}=el(),[o,u]=y.useState(!1),l=(r==null?void 0:r.models)??[];async function f(h){try{await De("/api/agent/brain",{method:"POST",body:JSON.stringify({model:h})}),n("Erfolgreich",`Hermes-Gehirn wurde auf '${h}' geändert. Der Gateway-Dienst wurde neu gestartet.`),e.invalidateQueries({queryKey:Et.agentStatus}),u(!1)}catch(p){n("Fehler",`Fehler beim Wechseln des Gehirns: ${p.message}`)}}return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ps,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(t==null?void 0:t.terminal_url)&&c.jsxs("a",{href:_s(t.terminal_url),target:"_blank",rel:"noopener",className:he("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",t.terminal_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[c.jsx(yu,{className:"h-3 w-3"})," Terminal öffnen"]})]}),t?c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[c.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("span",{className:he("h-2 w-2 rounded-full",t.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-medium",children:t.gateway_reachable?"Online":"Offline"})]})]}),c.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[c.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Terminal"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("span",{className:he("h-2 w-2 rounded-full",t.terminal_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-medium",children:t.terminal_reachable?"Online":"Offline"})]})]}),c.jsxs("div",{onClick:()=>u(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gehirn"}),c.jsx(_n,{className:"h-3 w-3 text-primary"})]}),c.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary truncate flex items-center gap-1",children:[c.jsx(xu,{className:"h-3 w-3 shrink-0"}),t.brain_model||"auto"]})]}),c.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Verdrahtung"}),c.jsx(wu,{className:"h-3 w-3 text-primary"})]}),c.jsxs("div",{className:"text-[10px] font-mono mt-1 space-y-0.5 text-muted-foreground",children:[c.jsxs("div",{children:["Config: ",t.has_config?c.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]}),c.jsxs("div",{children:["Skills: ",t.has_skills?c.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]}),c.jsxs("div",{children:["Memory: ",t.has_memories?c.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]})]})]})]}):c.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),t&&c.jsxs("div",{className:"mt-3 border-t border-border/30 pt-3 space-y-1.5",children:[c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"Telegram"}),c.jsx("span",{className:he("font-semibold",t.telegram_enabled?"text-emerald-400":""),children:t.telegram_enabled?"aktiv":"nicht konfiguriert"})]}),c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"MCP-Server"}),c.jsxs("span",{className:"font-semibold text-foreground",children:[t.mcp_server_count??0," verbunden"]})]}),c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"PC Executor"}),c.jsx("span",{className:he("font-semibold",t.pc_executor_reachable?"text-emerald-400":""),children:t.pc_executor_reachable?"erreichbar":"nicht verbunden"})]})]}),t&&o&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[c.jsx(_n,{className:"h-4 w-4"}),c.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),c.jsx("button",{onClick:()=>u(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',c.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),c.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...l.map(h=>{var p;return((p=h.name.split("/").pop())==null?void 0:p.replace(".gguf",""))||h.name})].map(h=>{const p=["auto","fast","heavy"].includes(h);return c.jsxs("button",{onClick:()=>f(h),className:he("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",t.brain_model===h||!t.brain_model&&h==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[c.jsxs("div",{className:"flex flex-col text-left",children:[c.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:h}),c.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:p?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(t.brain_model===h||!t.brain_model&&h==="auto")&&c.jsx(Cn,{className:"h-4 w-4 shrink-0 text-primary"})]},h)})})]})}),a]})}function UQ(){const{data:e}=vo(3e3),t=(e==null?void 0:e.models)??[],r=(e==null?void 0:e.running)??[];return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(xu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),c.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:K2.map(n=>{var u;const a=t.find(l=>l.role===n),o=a?r.includes(a.name):!1;return c.jsxs("div",{className:he("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",o?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":a?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[c.jsx("div",{className:"min-w-0 flex-1 mr-2",children:c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:he("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",my(n)),children:n}),c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:a?(u=a.name.split("/").pop())==null?void 0:u.replace(/\.gguf$/i,""):"nicht zugewiesen"}),a&&c.jsxs("div",{className:"flex gap-1 items-center mt-0.5 flex-wrap",children:[a.prompt_cache&&c.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 px-1 py-0.5 rounded",title:"Prompt Caching aktiv",children:"PC"}),a.spec_active&&c.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-1 py-0.5 rounded",title:`Speculative Decoding aktiv (Draft: ${a.spec_draft_model})`,children:"SPEC"}),a.parallel_slots>1&&c.jsxs("span",{className:"text-[7px] leading-none font-mono font-bold bg-violet-500/10 text-violet-400 border border-violet-500/20 px-1 py-0.5 rounded",title:`${a.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",a.parallel_slots]}),a.incomplete&&c.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-amber-500/10 text-amber-400 border border-amber-500/20 px-1 py-0.5 rounded",title:"GGUF-Datei fehlt",children:"⚠ fehlt"})]})]})]})}),c.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:a?o?c.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):c.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):c.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},n)})})]}),c.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Laden erfolgt automatisch per Auto-Swap."})]})}function WQ(){const e=po(),{data:t=[]}=L2({limit:3}),[r,n]=y.useState(""),[a,o]=y.useState("stable"),[u,l]=y.useState(!1);async function f(){if(!(!r.trim()||u)){l(!0);try{await De("/api/memory",{method:"POST",body:JSON.stringify({content:r,category:a,source:"dashboard"})}),n(""),e.invalidateQueries({queryKey:["memory"]})}catch(h){console.error(h)}finally{l(!1)}}}return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(gu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("textarea",{value:r,onChange:h=>n(h.target.value),placeholder:"Fakt / Regel im Pool speichern...",rows:2,className:"w-full resize-none rounded-xl border border-border/50 bg-background/30 p-2 text-[10px] outline-none focus:ring-1 focus:ring-primary transition-all leading-normal"}),c.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[c.jsxs("select",{value:a,onChange:h=>o(h.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[c.jsx("option",{value:"stable",children:"🔵 Fakt"}),c.jsx("option",{value:"instruction",children:"📋 Regel"}),c.jsx("option",{value:"user",children:"👤 User"}),c.jsx("option",{value:"versioned",children:"🟡 Version"})]}),c.jsxs("button",{onClick:f,disabled:!r.trim()||u,className:"flex h-7 items-center gap-1 rounded-lg bg-primary px-3 text-[10px] font-semibold text-primary-foreground hover:opacity-90 disabled:opacity-50 transition-all cursor-pointer",children:[c.jsx(JN,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),c.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[c.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),c.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:t.length===0?c.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):t.map(h=>c.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[c.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:h.category}),c.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:h.content,children:h.content})]},h.id))})]})]}),c.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Steht allen Clients per MCP zur Verfügung."})]})}const bN=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function HQ(){const{data:e}=dy(3e3),t=j4(),r=t[t.length-1],n=r?Math.round(r.prompt+r.completion):0;return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(vu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Token-Durchsatz"}),c.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e&&c.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[c.jsx("span",{className:"font-space text-3xl font-bold tracking-tight text-foreground tabular-nums",children:n.toLocaleString("de-DE")}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"tok/s aktuell"})]}),e&&c.jsxs("div",{className:"mt-0.5 space-y-0.5 font-mono text-[11px] text-muted-foreground/70",children:[c.jsxs("div",{children:[e.total_tokens.toLocaleString("de-DE")," Tokens gesamt · ",c.jsxs("span",{className:"text-emerald-400/90",children:[e.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," € gespart"]})]}),c.jsxs("div",{className:"text-muted-foreground/55",children:["Input ",e.prompt_tokens.toLocaleString("de-DE")," · Output ",e.completion_tokens.toLocaleString("de-DE")]})]})]}),c.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1.5 pt-1",children:bN.map(a=>c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:a.color}}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:a.label}),c.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((r==null?void 0:r[a.key])??0)})]},a.key))})]}),e?c.jsx(i_,{data:t,series:bN,unit:" tok/s",yMode:"auto",height:150}):c.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),c.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}function KQ(){const{data:e}=_3(3e3),{showAlert:t,dialogElement:r}=el(),[n,a]=y.useState({});async function o(u){a(l=>({...l,[u]:!0}));try{const l=await De("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:u})});l.ok||t("Fehler",`Neustart fehlgeschlagen: ${l.err||"Unbekannt"}`)}catch(l){t("Fehler",`Fehler: ${l.message}`)}finally{a(l=>({...l,[u]:!1}))}}return c.jsxs("div",{className:"flex flex-col rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(e2,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Dienste"})]}),c.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground transition-colors hover:text-primary cursor-pointer",children:"Logs / Pflege"})]}),e?c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsx("div",{className:"space-y-1.5",children:e.services.map(u=>c.jsxs("div",{className:"group flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:he("h-2.5 w-2.5 shrink-0 rounded-full ring-2 ring-black/40",u.ok?"bg-emerald-500":"bg-amber-500")}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-xs font-bold text-foreground",children:u.name}),c.jsx("div",{className:"truncate font-mono text-[9px] text-muted-foreground/60",children:u.url})]})]}),c.jsx("button",{onClick:()=>o(u.name),disabled:n[u.name],className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground opacity-0 transition-all hover:bg-primary/5 hover:text-primary group-hover:opacity-100",title:"Dienst neu starten",children:c.jsx(uu,{className:he("h-3.5 w-3.5",n[u.name]&&"animate-spin")})})]},u.name))}),c.jsxs("div",{className:"mt-auto flex flex-wrap gap-3 border-t border-border/20 pt-2.5 text-[10px] font-semibold text-muted-foreground",children:[c.jsxs("a",{href:_s(e.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-primary transition-colors hover:bg-primary/10",children:[c.jsx(yu,{className:"h-3 w-3"})," Engine"]}),c.jsxs("a",{href:_s(e.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-primary transition-colors hover:bg-primary/10",children:[c.jsx(yu,{className:"h-3 w-3"})," Gateway"]})]})]}):c.jsx("div",{className:"flex h-24 items-center justify-center text-xs text-muted-foreground",children:"Lade Dienste…"}),r]})}function wN({children:e}){return c.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function VQ(){return c.jsxs("div",{className:"space-y-7",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Zentrale"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),c.jsxs("div",{className:"grid items-stretch gap-6 lg:grid-cols-3",children:[c.jsx(zQ,{}),c.jsx(HQ,{}),c.jsx(y4,{})]}),c.jsxs("section",{children:[c.jsx(wN,{children:"Stack-Status"}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[c.jsx(UQ,{}),c.jsx(KQ,{})]})]}),c.jsxs("section",{children:[c.jsx(wN,{children:"Betrieb & Wissen"}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[c.jsx(FQ,{}),c.jsx(BQ,{}),c.jsx(WQ,{})]})]})]})}function GQ(){const e=po(),{data:t=[]}=I3(2e3),{showAlert:r,dialogElement:n}=el();async function a(l){try{await De(`/api/jobs/${l}/cancel`,{method:"POST"}),e.invalidateQueries({queryKey:Et.jobs})}catch(f){r("Fehler",f.message)}}const o=t.filter(l=>l.state==="running"||l.state==="queued"),u=t.filter(l=>l.state!=="running"&&l.state!=="queued").slice(-3);return o.length===0&&u.length===0?null:c.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[c.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),o.map(l=>c.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[c.jsxs("div",{className:"flex justify-between items-center text-xs",children:[c.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:l.label}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"text-muted-foreground font-mono",children:[l.progress??0,"% • ",tg(l.done_bytes),"/",tg(l.total_bytes),l.eta_s?` • ETA ${$3(l.eta_s)}`:""]}),c.jsx("button",{onClick:()=>a(l.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),c.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${l.progress??0}%`}})})]},l.id)),u.map(l=>c.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[c.jsx("span",{className:"truncate",children:l.label}),c.jsx("span",{className:he("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",l.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:l.state})]},l.id)),n]})}function Da({children:e,tone:t="muted"}){const r={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return c.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${r[t]}`,children:e})}function jN({caps:e}){return e?c.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[e.coder&&c.jsx(Da,{children:"💻 Code"}),e.vision&&c.jsx(Da,{children:"👁 Bild"}),e.reasoning&&c.jsx(Da,{children:"🧠 Reason"}),e.moe&&c.jsxs(Da,{tone:"primary",children:["🧩 MoE",e.active_b?`·${e.active_b}b`:""]}),e.tools==="yes"&&c.jsx(Da,{tone:"primary",children:"🛠 Tools"}),e.tools==="likely"&&c.jsx(Da,{tone:"warn",children:"🛠 Tools?"}),e.embedding&&c.jsx(Da,{children:"🔢 Embed"})]}):null}function qQ({model:e,onClose:t,onChanged:r}){var k,S;const{data:n,isLoading:a}=R3(e.gguf_path),[o,u]=y.useState(null),[l,f]=y.useState(""),h=n==null?void 0:n.target_vocab,p=(n==null?void 0:n.drafts)??[],v=p.filter(N=>N.compatible===!0),x=e.spec_draft_model;async function b(N){u(N??"__clear__"),f("");try{await De(`/api/models/${encodeURIComponent(e.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:N})}),r(),t()}catch(P){f(String((P==null?void 0:P.message)||P)),u(null)}}const j=N=>{var P;return N?`${N.pre??"?"} · ${((P=N.n_vocab)==null?void 0:P.toLocaleString())??"?"} Tokens`:"—"};return c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[c.jsx(ls,{className:"h-4 w-4"})," Speculative Draft"]}),c.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',c.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),c.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:(k=e.name.split("/").pop())==null?void 0:k.replace(/\.gguf$/i,"")}),c.jsxs("span",{className:"text-foreground",children:["Vocab: ",j(h)]})]}),e.spec_active&&x&&c.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[c.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[c.jsx(Cn,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",x]}),c.jsx("button",{onClick:()=>b(null),disabled:o!==null,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(n!=null&&n.target_exists)&&c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[c.jsx(Cs,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),c.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:a?c.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):p.length===0?c.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",c.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):p.map(N=>{var C,_;const P=N.filename===x,O=N.compatible===!0;return c.jsxs("div",{className:he("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",O?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",P&&"border-primary/40 bg-primary/10"),children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate",children:N.filename}),c.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[Br(N.size_bytes)," · Vocab: ",j(N.vocab)]})]}),O?P?c.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[c.jsx(Cn,{className:"h-3.5 w-3.5"})," Aktiv"]}):c.jsx("button",{onClick:()=>b(N.path),disabled:o!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):c.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:N.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(C=N.vocab)==null?void 0:C.pre}/${(_=N.vocab)==null?void 0:_.n_vocab} ≠ Modell ${h==null?void 0:h.pre}/${h==null?void 0:h.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[c.jsx(Cs,{className:"h-3.5 w-3.5"})," ",N.compatible===!1?"Vocab ≠":"n/a"]})]},N.path)})}),!a&&(n==null?void 0:n.target_exists)&&p.length>0&&v.length===0&&c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",c.jsx("span",{className:"font-mono",children:h==null?void 0:h.pre}),", n_vocab=",c.jsx("span",{className:"font-mono",children:(S=h==null?void 0:h.n_vocab)==null?void 0:S.toLocaleString()}),")."]}),l&&c.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:l})]})})}function QQ(){var jo,va,il,wi,ji,uc,al,ol;const e=po(),{data:t,isLoading:r,error:n}=vo(4e3),{data:a}=M3(4e3),{data:o}=$2(),{data:u}=hy(4e3),{data:l}=T3(),{data:f}=oh(),{showAlert:h,showConfirm:p,showPrompt:v,dialogElement:x}=el(),b=(t==null?void 0:t.models)??[],j=(t==null?void 0:t.running)??[],k=n?String(n):"",S=()=>{e.invalidateQueries({queryKey:Et.models}),e.invalidateQueries({queryKey:Et.routing})},[N,P]=y.useState(null),[O,C]=y.useState(null),[_,A]=y.useState(null),[I,U]=y.useState(null),[B,V]=y.useState(!1),[q,R]=y.useState(!1),[de,Z]=y.useState(null),[ge,je]=y.useState("grid"),[me,Q]=y.useState("all"),oe=b.filter(F=>me==="in_use"?!!F.role||j.includes(F.name):!0),[X,$]=y.useState({width:800,height:360}),T=y.useRef(null),ee=y.useCallback(F=>{if(T.current&&(T.current.disconnect(),T.current=null),F){const fe=new ResizeObserver(Pe=>{if(!Pe||Pe.length===0)return;const ze=Pe[0].contentRect;$({width:ze.width,height:ze.height})});fe.observe(F),T.current=fe}},[]),ne=X.width,te=X.height,ue=F=>{const fe=ne*.1,Pe=te*F,ze=ne*.5,Ge=te*.5,qt=ne*.3,Ze=Pe,vt=ne*.3;return`M ${fe} ${Pe} C ${qt} ${Ze}, ${vt} ${Ge}, ${ze} ${Ge}`},pe=F=>{const fe=ne*.5,Pe=te*.5,ze=ne*.9,Ge=te*F,qt=ne*.7,Ze=Pe,vt=ne*.7;return`M ${fe} ${Pe} C ${qt} ${Ze}, ${vt} ${Ge}, ${ze} ${Ge}`};async function Ae(F){try{await De(`/api/models/${encodeURIComponent(F)}/load`,{method:"POST"}),S()}catch(fe){h("Fehler",`Fehler beim Laden des Modells: ${fe.message}`)}}async function J(F){try{await De(`/api/models/${encodeURIComponent(F)}/unload`,{method:"POST"}),S()}catch(fe){h("Fehler",`Fehler beim Entladen des Modells: ${fe.message}`)}}async function ke(){try{await De("/api/models/unload",{method:"POST"}),S()}catch(F){h("Fehler",`Fehler beim Entladen aller Modelle: ${F.message}`)}}async function Oe(F,fe){try{await De(`/api/models/${encodeURIComponent(fe)}/role`,{method:"POST",body:JSON.stringify({role:F||null})}),S()}catch(Pe){h("Fehler",`Fehler beim Zuweisen der Rolle: ${Pe.message||Pe}`)}}function ae(F){C(F),A(null),De(`/api/roles/${encodeURIComponent(F)}/recommend`).then(fe=>A(fe)).catch(()=>{})}async function Xe(F,fe){let Pe=null;try{Pe=await De(`/api/models/${encodeURIComponent(F)}/ctx/auto`)}catch{}const ze=Pe?`Optimal für dein Setup: ${(Pe.ctx/1024).toFixed(0)}k (${Pe.ctx}) — GTT ${Pe.gtt_gb} GB − reserviert ${Pe.reserved_gb} GB (${Pe.mode}) → ${Pe.budget_gb} GB frei. »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";v("Kontextlänge anpassen",ze,String(fe||32768),async Ge=>{if(Ge)try{await De(`/api/models/${encodeURIComponent(F)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(Ge,10)})}),S()}catch(qt){h("Fehler",`Fehler beim Setzen des Kontexts: ${qt.message||qt}`)}},void 0,Pe?{autoValue:String(Pe.ctx),autoLabel:`Auto (${(Pe.ctx/1024).toFixed(0)}k)`}:void 0)}async function Y(F){p("Modell löschen?",`Modell '${F}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await De(`/api/models/${encodeURIComponent(F)}`,{method:"DELETE"}),S()}catch(fe){h("Fehler",`Fehler beim Löschen: ${fe.message||fe}`)}})}async function ce(F,fe,Pe,ze){try{await De("/api/models/install",{method:"POST",body:JSON.stringify({repo:F,role:fe,quant:Pe,jinja:ze})}),h("Herunterladen gestartet",`Download für '${F}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(Ge){h("Fehler",`Fehler beim Starten des Upgrades: ${Ge.message||Ge}`)}}async function tt(F){const fe=l==null?void 0:l.budget,Pe=fe&&!fe.fits?` + A`,",",",0,0,",",",",","Z"])),q.x,q.y,o,o,+(p<0),K.x,K.y,n,n,+(de>180),+(p>0),A.x,A.y,o,o,+(p<0),I.x,I.y)}else C+=Bt(aj||(aj=Ba(["L",",","Z"])),t,r);return C},eF={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},tF=e=>{var t=Qr(e,eF),r=t.cx,n=t.cy,a=t.innerRadius,o=t.outerRadius,u=t.cornerRadius,l=t.forceCornerRadius,f=t.cornerIsExternal,h=t.startAngle,p=t.endAngle,v=t.className;if(o0&&Math.abs(h-p)<360?j=J6({cx:r,cy:n,innerRadius:a,outerRadius:o,cornerRadius:Math.min(k,b/2),forceCornerRadius:l,cornerIsExternal:f,startAngle:h,endAngle:p}):j=DP({cx:r,cy:n,innerRadius:a,outerRadius:o,startAngle:h,endAngle:p}),y.createElement("path",Tg({},Gr(t),{className:x,d:j}))};function rF(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(vE(t)){if(e==="centric"){var n=t.cx,a=t.cy,o=t.innerRadius,u=t.outerRadius,l=t.angle,f=Ht(n,a,o,l),h=Ht(n,a,u,l);return[{x:f.x,y:f.y},{x:h.x,y:h.y}]}return TP(t)}}function nF(e){return OE(e)?NaN:Number(e)}function fv(e){return e?(e=nF(e),e===1/0||e===-1/0?(e<0?-1:1)*Number.MAX_VALUE:e===e?e:0):e===0?e:0}function RP(e,t,r){r&&typeof r!="number"&&pg(e,t,r)&&(t=r=void 0),e=fv(e),t===void 0?(t=e,e=0):t=fv(t),r=r===void 0?ee.chartData,Dy=G([pn],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),Oh=(e,t,r,n)=>n?Dy(e):pn(e),iF=(e,t,r)=>r?Dy(e):pn(e),aF=G([Oh],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});G([Dy],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});var oF=G([pn],e=>{var t=e.chartData,r=e.dataStartIndex,n=e.dataEndIndex;return t!=null?t.slice(r,n+1):[]});function Ry(e,t){return cF(e)||uF(e,t)||lF(e,t)||sF()}function sF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lF(e,t){if(e){if(typeof e=="string")return oj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oj(e,t):void 0}}function oj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.e^o.s<0?1:-1;for(n=o.d.length,a=e.d.length,t=0,r=ne.d[t]^o.s<0?1:-1;return n===a?0:n>a^o.s<0?1:-1};be.decimalPlaces=be.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*ot;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};be.dividedBy=be.div=function(e){return si(this,new this.constructor(e))};be.dividedToIntegerBy=be.idiv=function(e){var t=this,r=t.constructor;return Ye(si(t,new r(e),0,1),r.precision)};be.equals=be.eq=function(e){return!this.cmp(e)};be.exponent=function(){return bt(this)};be.greaterThan=be.gt=function(e){return this.cmp(e)>0};be.greaterThanOrEqualTo=be.gte=function(e){return this.cmp(e)>=0};be.isInteger=be.isint=function(){return this.e>this.d.length-2};be.isNegative=be.isneg=function(){return this.s<0};be.isPositive=be.ispos=function(){return this.s>0};be.isZero=function(){return this.s===0};be.lessThan=be.lt=function(e){return this.cmp(e)<0};be.lessThanOrEqualTo=be.lte=function(e){return this.cmp(e)<1};be.logarithm=be.log=function(e){var t,r=this,n=r.constructor,a=n.precision,o=a+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Ar))throw Error(qr+"NaN");if(r.s<1)throw Error(qr+(r.s?"NaN":"-Infinity"));return r.eq(Ar)?new n(0):(lt=!1,t=si(Mu(r,o),Mu(e,o),o),lt=!0,Ye(t,a))};be.minus=be.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?BP(t,e):zP(t,(e.s=-e.s,e))};be.modulo=be.mod=function(e){var t,r=this,n=r.constructor,a=n.precision;if(e=new n(e),!e.s)throw Error(qr+"NaN");return r.s?(lt=!1,t=si(r,e,0,1).times(e),lt=!0,r.minus(t)):Ye(new n(r),a)};be.naturalExponential=be.exp=function(){return FP(this)};be.naturalLogarithm=be.ln=function(){return Mu(this)};be.negated=be.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};be.plus=be.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?zP(t,e):BP(t,(e.s=-e.s,e))};be.precision=be.sd=function(e){var t,r,n,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(to+e);if(t=bt(a)+1,n=a.d.length-1,r=n*ot+1,n=a.d[n],n){for(;n%10==0;n/=10)r--;for(n=a.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};be.squareRoot=be.sqrt=function(){var e,t,r,n,a,o,u,l=this,f=l.constructor;if(l.s<1){if(!l.s)return new f(0);throw Error(qr+"NaN")}for(e=bt(l),lt=!1,a=Math.sqrt(+l),a==0||a==1/0?(t=On(l.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=Ks((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t)):n=new f(a.toString()),r=f.precision,a=u=r+3;;)if(o=n,n=o.plus(si(l,o,u+2)).times(.5),On(o.d).slice(0,u)===(t=On(n.d)).slice(0,u)){if(t=t.slice(u-3,u+1),a==u&&t=="4999"){if(Ye(o,r+1,0),o.times(o).eq(l)){n=o;break}}else if(t!="9999")break;u+=4}return lt=!0,Ye(n,r)};be.times=be.mul=function(e){var t,r,n,a,o,u,l,f,h,p=this,v=p.constructor,x=p.d,b=(e=new v(e)).d;if(!p.s||!e.s)return new v(0);for(e.s*=p.s,r=p.e+e.e,f=x.length,h=b.length,f=0;){for(t=0,a=f+n;a>n;)l=o[a]+b[n]*x[a-n-1]+t,o[a--]=l%It|0,t=l/It|0;o[a]=(o[a]+t)%It|0}for(;!o[--u];)o.pop();return t?++r:o.shift(),e.d=o,e.e=r,lt?Ye(e,v.precision):e};be.toDecimalPlaces=be.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:($n(e,0,Hs),t===void 0?t=n.rounding:$n(t,0,8),Ye(r,e+bt(r)+1,t))};be.toExponential=function(e,t){var r,n=this,a=n.constructor;return e===void 0?r=co(n,!0):($n(e,0,Hs),t===void 0?t=a.rounding:$n(t,0,8),n=Ye(new a(n),e+1,t),r=co(n,!0,e+1)),r};be.toFixed=function(e,t){var r,n,a=this,o=a.constructor;return e===void 0?co(a):($n(e,0,Hs),t===void 0?t=o.rounding:$n(t,0,8),n=Ye(new o(a),e+bt(a)+1,t),r=co(n.abs(),!1,e+bt(n)+1),a.isneg()&&!a.isZero()?"-"+r:r)};be.toInteger=be.toint=function(){var e=this,t=e.constructor;return Ye(new t(e),bt(e)+1,t.rounding)};be.toNumber=function(){return+this};be.toPower=be.pow=function(e){var t,r,n,a,o,u,l=this,f=l.constructor,h=12,p=+(e=new f(e));if(!e.s)return new f(Ar);if(l=new f(l),!l.s){if(e.s<1)throw Error(qr+"Infinity");return l}if(l.eq(Ar))return l;if(n=f.precision,e.eq(Ar))return Ye(l,n);if(t=e.e,r=e.d.length-1,u=t>=r,o=l.s,u){if((r=p<0?-p:p)<=LP){for(a=new f(Ar),t=Math.ceil(n/ot+4),lt=!1;r%2&&(a=a.times(l),uj(a.d,t)),r=Ks(r/2),r!==0;)l=l.times(l),uj(l.d,t);return lt=!0,e.s<0?new f(Ar).div(a):Ye(a,n)}}else if(o<0)throw Error(qr+"NaN");return o=o<0&&e.d[Math.max(t,r)]&1?-1:1,l.s=1,lt=!1,a=e.times(Mu(l,n+h)),lt=!0,a=FP(a),a.s=o,a};be.toPrecision=function(e,t){var r,n,a=this,o=a.constructor;return e===void 0?(r=bt(a),n=co(a,r<=o.toExpNeg||r>=o.toExpPos)):($n(e,1,Hs),t===void 0?t=o.rounding:$n(t,0,8),a=Ye(new o(a),e,t),r=bt(a),n=co(a,e<=r||r<=o.toExpNeg,e)),n};be.toSignificantDigits=be.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):($n(e,1,Hs),t===void 0?t=n.rounding:$n(t,0,8)),Ye(new n(r),e,t)};be.toString=be.valueOf=be.val=be.toJSON=be[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=bt(e),r=e.constructor;return co(e,t<=r.toExpNeg||t>=r.toExpPos)};function zP(e,t){var r,n,a,o,u,l,f,h,p=e.constructor,v=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),lt?Ye(t,v):t;if(f=e.d,h=t.d,u=e.e,a=t.e,f=f.slice(),o=u-a,o){for(o<0?(n=f,o=-o,l=h.length):(n=h,a=u,l=f.length),u=Math.ceil(v/ot),l=u>l?u+1:l+1,o>l&&(o=l,n.length=1),n.reverse();o--;)n.push(0);n.reverse()}for(l=f.length,o=h.length,l-o<0&&(o=l,n=h,h=f,f=n),r=0;o;)r=(f[--o]=f[o]+h[o]+r)/It|0,f[o]%=It;for(r&&(f.unshift(r),++a),l=f.length;f[--l]==0;)f.pop();return t.d=f,t.e=a,lt?Ye(t,v):t}function $n(e,t,r){if(e!==~~e||er)throw Error(to+e)}function On(e){var t,r,n,a=e.length-1,o="",u=e[0];if(a>0){for(o+=u,t=1;tu?1:-1;else for(l=f=0;la[l]?1:-1;break}return f}function r(n,a,o){for(var u=0;o--;)n[o]-=u,u=n[o]1;)n.shift()}return function(n,a,o,u){var l,f,h,p,v,x,b,k,j,S,N,P,O,C,_,A,I,$,B=n.constructor,K=n.s==a.s?1:-1,q=n.d,R=a.d;if(!n.s)return new B(n);if(!a.s)throw Error(qr+"Division by zero");for(f=n.e-a.e,I=R.length,_=q.length,b=new B(K),k=b.d=[],h=0;R[h]==(q[h]||0);)++h;if(R[h]>(q[h]||0)&&--f,o==null?P=o=B.precision:u?P=o+(bt(n)-bt(a))+1:P=o,P<0)return new B(0);if(P=P/ot+2|0,h=0,I==1)for(p=0,R=R[0],P++;(h<_||p)&&P--;h++)O=p*It+(q[h]||0),k[h]=O/R|0,p=O%R|0;else{for(p=It/(R[0]+1)|0,p>1&&(R=e(R,p),q=e(q,p),I=R.length,_=q.length),C=I,j=q.slice(0,I),S=j.length;S=It/2&&++A;do p=0,l=t(R,j,I,S),l<0?(N=j[0],I!=S&&(N=N*It+(j[1]||0)),p=N/A|0,p>1?(p>=It&&(p=It-1),v=e(R,p),x=v.length,S=j.length,l=t(v,j,x,S),l==1&&(p--,r(v,I16)throw Error($y+bt(e));if(!e.s)return new p(Ar);for(lt=!1,l=v,u=new p(.03125);e.abs().gte(.1);)e=e.times(u),h+=5;for(n=Math.log(La(2,h))/Math.LN10*2+5|0,l+=n,r=a=o=new p(Ar),p.precision=l;;){if(a=Ye(a.times(e),l),r=r.times(++f),u=o.plus(si(a,r,l)),On(u.d).slice(0,l)===On(o.d).slice(0,l)){for(;h--;)o=Ye(o.times(o),l);return p.precision=v,t==null?(lt=!0,Ye(o,v)):o}o=u}}function bt(e){for(var t=e.e*ot,r=e.d[0];r>=10;r/=10)t++;return t}function hv(e,t,r){if(t>e.LN10.sd())throw lt=!0,r&&(e.precision=r),Error(qr+"LN10 precision limit exceeded");return Ye(new e(e.LN10),t)}function Vi(e){for(var t="";e--;)t+="0";return t}function Mu(e,t){var r,n,a,o,u,l,f,h,p,v=1,x=10,b=e,k=b.d,j=b.constructor,S=j.precision;if(b.s<1)throw Error(qr+(b.s?"NaN":"-Infinity"));if(b.eq(Ar))return new j(0);if(t==null?(lt=!1,h=S):h=t,b.eq(10))return t==null&&(lt=!0),hv(j,h);if(h+=x,j.precision=h,r=On(k),n=r.charAt(0),o=bt(b),Math.abs(o)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)b=b.times(e),r=On(b.d),n=r.charAt(0),v++;o=bt(b),n>1?(b=new j("0."+r),o++):b=new j(n+"."+r.slice(1))}else return f=hv(j,h+2,S).times(o+""),b=Mu(new j(n+"."+r.slice(1)),h-x).plus(f),j.precision=S,t==null?(lt=!0,Ye(b,S)):b;for(l=u=b=si(b.minus(Ar),b.plus(Ar),h),p=Ye(b.times(b),h),a=3;;){if(u=Ye(u.times(p),h),f=l.plus(si(u,new j(a),h)),On(f.d).slice(0,h)===On(l.d).slice(0,h))return l=l.times(2),o!==0&&(l=l.plus(hv(j,h+2,S).times(o+""))),l=si(l,new j(v),h),j.precision=S,t==null?(lt=!0,Ye(l,S)):l;l=f,a+=2}}function lj(e,t){var r,n,a;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(n,a),t){if(a-=n,r=r-n-1,e.e=Ks(r/ot),e.d=[],n=(r+1)%ot,r<0&&(n+=ot),nAf||e.e<-Af))throw Error($y+r)}else e.s=0,e.e=0,e.d=[0];return e}function Ye(e,t,r){var n,a,o,u,l,f,h,p,v=e.d;for(u=1,o=v[0];o>=10;o/=10)u++;if(n=t-u,n<0)n+=ot,a=t,h=v[p=0];else{if(p=Math.ceil((n+1)/ot),o=v.length,p>=o)return e;for(h=o=v[p],u=1;o>=10;o/=10)u++;n%=ot,a=n-ot+u}if(r!==void 0&&(o=La(10,u-a-1),l=h/o%10|0,f=t<0||v[p+1]!==void 0||h%o,f=r<4?(l||f)&&(r==0||r==(e.s<0?3:2)):l>5||l==5&&(r==4||f||r==6&&(n>0?a>0?h/La(10,u-a):0:v[p-1])%10&1||r==(e.s<0?8:7))),t<1||!v[0])return f?(o=bt(e),v.length=1,t=t-o-1,v[0]=La(10,(ot-t%ot)%ot),e.e=Ks(-t/ot)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(n==0?(v.length=p,o=1,p--):(v.length=p+1,o=La(10,ot-n),v[p]=a>0?(h/La(10,u-a)%La(10,a)|0)*o:0),f)for(;;)if(p==0){(v[0]+=o)==It&&(v[0]=1,++e.e);break}else{if(v[p]+=o,v[p]!=It)break;v[p--]=0,o=1}for(n=v.length;v[--n]===0;)v.pop();if(lt&&(e.e>Af||e.e<-Af))throw Error($y+bt(e));return e}function BP(e,t){var r,n,a,o,u,l,f,h,p,v,x=e.constructor,b=x.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new x(e),lt?Ye(t,b):t;if(f=e.d,v=t.d,n=t.e,h=e.e,f=f.slice(),u=h-n,u){for(p=u<0,p?(r=f,u=-u,l=v.length):(r=v,n=h,l=f.length),a=Math.max(Math.ceil(b/ot),l)+2,u>a&&(u=a,r.length=1),r.reverse(),a=u;a--;)r.push(0);r.reverse()}else{for(a=f.length,l=v.length,p=a0;--a)f[l++]=0;for(a=v.length;a>u;){if(f[--a]0?o=o.charAt(0)+"."+o.slice(1)+Vi(n):u>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+Vi(-a-1)+o,r&&(n=r-u)>0&&(o+=Vi(n))):a>=u?(o+=Vi(a+1-u),r&&(n=r-a-1)>0&&(o=o+"."+Vi(n))):((n=a+1)0&&(a+1===u&&(o+="."),o+=Vi(n))),e.s<0?"-"+o:o}function uj(e,t){if(e.length>t)return e.length=t,!0}function UP(e){var t,r,n;function a(o){var u=this;if(!(u instanceof a))return new a(o);if(u.constructor=a,o instanceof a){u.s=o.s,u.e=o.e,u.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(to+o);if(o>0)u.s=1;else if(o<0)o=-o,u.s=-1;else{u.s=0,u.e=0,u.d=[0];return}if(o===~~o&&o<1e7){u.e=0,u.d=[o];return}return lj(u,o.toString())}else if(typeof o!="string")throw Error(to+o);if(o.charCodeAt(0)===45?(o=o.slice(1),u.s=-1):u.s=1,hF.test(o))lj(u,o);else throw Error(to+o)}if(a.prototype=be,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=UP,a.config=a.set=pF,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&n<=a[t+2])this[r]=n;else throw Error(to+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(to+r+": "+n);return this}var Ly=UP(fF);Ar=new Ly(1);const We=Ly;function WP(e){var t;return e===0?t=1:t=Math.floor(new We(e).abs().log(10).toNumber())+1,t}function HP(e,t,r){for(var n=new We(e),a=0,o=[];n.lt(t)&&a<1e5;)o.push(n.toNumber()),n=n.add(r),a++;return o}function Iu(e,t){return yF(e)||gF(e,t)||vF(e,t)||mF()}function mF(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vF(e,t){if(e){if(typeof e=="string")return cj(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cj(e,t):void 0}}function cj(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=Iu(e,2),r=t[0],n=t[1],a=r,o=n;return r>n&&(a=n,o=r),[a,o]},zy=(e,t,r)=>{if(e.lte(0))return new We(0);var n=WP(e.toNumber()),a=new We(10).pow(n),o=e.div(a),u=n!==1?.05:.1,l=new We(Math.ceil(o.div(u).toNumber())).add(r).mul(u),f=l.mul(a);return t?new We(f.toNumber()):new We(Math.ceil(f.toNumber()))},GP=(e,t,r)=>{var n;if(e.lte(0))return new We(0);var a=[1,2,2.5,5],o=e.toNumber(),u=Math.floor(new We(o).abs().log(10).toNumber()),l=new We(10).pow(u),f=e.div(l).toNumber(),h=a.findIndex(b=>b>=f-1e-10);if(h===-1&&(l=l.mul(10),h=0),h+=r,h>=a.length){var p=Math.floor(h/a.length);h%=a.length,l=l.mul(new We(10).pow(p))}var v=(n=a[h])!==null&&n!==void 0?n:1,x=new We(v).mul(l);return t?x:new We(Math.ceil(x.toNumber()))},xF=(e,t,r)=>{var n=new We(1),a=new We(e);if(!a.isint()&&r){var o=Math.abs(e);o<1?(n=new We(10).pow(WP(e)-1),a=new We(Math.floor(a.div(n).toNumber())).mul(n)):o>1&&(a=new We(Math.floor(e)))}else e===0?a=new We(Math.floor((t-1)/2)):r||(a=new We(Math.floor(e)));for(var u=Math.floor((t-1)/2),l=[],f=0;f4&&arguments[4]!==void 0?arguments[4]:0,u=arguments.length>5&&arguments[5]!==void 0?arguments[5]:zy;if(!Number.isFinite((r-t)/(n-1)))return{step:new We(0),tickMin:new We(0),tickMax:new We(0)};var l=u(new We(r).sub(t).div(n-1),a,o),f;t<=0&&r>=0?f=new We(0):(f=new We(t).add(r).div(2),f=f.sub(new We(f).mod(l)));var h=Math.ceil(f.sub(t).div(l).toNumber()),p=Math.ceil(new We(r).sub(f).div(l).toNumber()),v=h+p+1;return v>n?VP(t,r,n,a,o+1,u):(v0?p+(n-v):p,h=r>0?h:h+(n-v)),{step:l,tickMin:f.sub(new We(h).mul(l)),tickMax:f.add(new We(p).mul(l))})},dj=function(t){var r=Iu(t,2),n=r[0],a=r[1],o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=Math.max(o,2),h=KP([n,a]),p=Iu(h,2),v=p[0],x=p[1];if(v===-1/0||x===1/0){var b=x===1/0?[v,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),x];return n>a?b.reverse():b}if(v===x)return xF(v,o,u);var k=l==="snap125"?GP:zy,j=VP(v,x,f,u,0,k),S=j.step,N=j.tickMin,P=j.tickMax,O=HP(N,P.add(new We(.1).mul(S)),S);return n>a?O.reverse():O},fj=function(t,r){var n=Iu(t,2),a=n[0],o=n[1],u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",f=KP([a,o]),h=Iu(f,2),p=h[0],v=h[1];if(p===-1/0||v===1/0)return[a,o];if(p===v)return[p];var x=l==="snap125"?GP:zy,b=Math.max(r,2),k=x(new We(v).sub(p).div(b-1),u,0),j=[...HP(new We(p),new We(v),k),v];return u===!1&&(j=j.map(S=>Math.round(S))),a>o?j.reverse():j},bF=e=>e.rootProps.barCategoryGap,_h=e=>e.rootProps.stackOffset,qP=e=>e.rootProps.reverseStackOrder,Fy=e=>e.options.chartName,By=e=>e.rootProps.syncId,QP=e=>e.rootProps.syncMethod,Uy=e=>e.options.eventEmitter,wF=e=>e.rootProps.baseValue,or={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},_a={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},kn={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},Mh=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function Ih(e,t,r){if(r!=="auto")return r;if(e!=null)return zn(e,t)?"category":"number"}function hj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Of(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},Wy=G([NF,xP],(e,t)=>{var r;if(e!=null)return e;var n=(r=Ih(t,"angleAxis",pj.type))!==null&&r!==void 0?r:"category";return Of(Of({},pj),{},{type:n})}),EF=(e,t)=>e.polarAxis.radiusAxis[t],Hy=G([EF,xP],(e,t)=>{var r;if(e!=null)return e;var n=(r=Ih(t,"radiusAxis",mj.type))!==null&&r!==void 0?r:"category";return Of(Of({},mj),{},{type:n})}),Th=e=>e.polarOptions,Ky=G([hi,pi,Vt],G6),YP=G([Th,Ky],(e,t)=>{if(e!=null)return da(e.innerRadius,t,0)}),XP=G([Th,Ky],(e,t)=>{if(e!=null)return da(e.outerRadius,t,t*.8)}),PF=e=>{if(e==null)return[0,0];var t=e.startAngle,r=e.endAngle;return[t,r]},ZP=G([Th],PF);G([Wy,ZP],Mh);var JP=G([Ky,YP,XP],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});G([Hy,JP],Mh);var eC=G([ut,Th,YP,XP,hi,pi],(e,t,r,n,a,o)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var u=t.cx,l=t.cy,f=t.startAngle,h=t.endAngle;return{cx:da(u,a,a/2),cy:da(l,o,o/2),innerRadius:r,outerRadius:n,startAngle:f,endAngle:h,clockWise:!1}}}),Dt=(e,t)=>t,Dh=(e,t,r)=>r;function Gy(e){return e==null?void 0:e.id}function tC(e,t,r){var n=t.chartData,a=n===void 0?[]:n,o=r.allowDuplicatedCategory,u=r.dataKey,l=new Map;return e.forEach(f=>{var h,p=(h=f.data)!==null&&h!==void 0?h:a;if(!(p==null||p.length===0)){var v=Gy(f);p.forEach((x,b)=>{var k=u==null||o?b:String(Tt(x,u,null)),j=Tt(x,f.dataKey,0),S;l.has(k)?S=l.get(k):S={},Object.assign(S,{[v]:j}),l.set(k,S)})}}),Array.from(l.values())}function Vy(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var Rh=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function $h(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function CF(e,t){if(e.length===t.length){for(var r=0;r{var t=ut(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},Gs=e=>e.tooltip.settings.axisId;function qy(e){if(e!=null){var t=e.ticks,r=e.bandwidth,n=e.range(),a=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:(function(o){function u(){return o.apply(this,arguments)}return u.toString=function(){return o.toString()},u})(()=>a),rangeMin:()=>a[0],rangeMax:()=>a[1],isInRange(o){var u=a[0],l=a[1];return u<=l?o>=u&&o<=l:o>=l&&o<=u},bandwidth:r?()=>r.call(e):void 0,ticks:t?o=>t.call(e,o):void 0,map:(o,u)=>{var l=e(o);if(l!=null){if(e.bandwidth&&u!==null&&u!==void 0&&u.position){var f=e.bandwidth();switch(u.position){case"middle":l+=f/2;break;case"end":l+=f;break}}return l}}}}}var AF=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!Mn(t)){for(var r,n,a=0;an)&&(n=o))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function la(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function OF(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function Qy(e){let t,r,n;e.length!==2?(t=la,r=(l,f)=>la(e(l),f),n=(l,f)=>e(l)-f):(t=e===la||e===OF?e:_F,r=e,n=e);function a(l,f,h=0,p=l.length){if(h>>1;r(l[v],f)<0?h=v+1:p=v}while(h>>1;r(l[v],f)<=0?h=v+1:p=v}while(hh&&n(l[v-1],f)>-n(l[v],f)?v-1:v}return{left:a,center:u,right:o}}function _F(){return 0}function rC(e){return e===null?NaN:+e}function*MF(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const IF=Qy(la),tc=IF.right;Qy(rC).center;class vj extends Map{constructor(t,r=RF){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,a]of t)this.set(n,a)}get(t){return super.get(gj(this,t))}has(t){return super.has(gj(this,t))}set(t,r){return super.set(TF(this,t),r)}delete(t){return super.delete(DF(this,t))}}function gj({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function TF({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function DF({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function RF(e){return e!==null&&typeof e=="object"?e.valueOf():e}function $F(e=la){if(e===la)return nC;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function nC(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const LF=Math.sqrt(50),zF=Math.sqrt(10),FF=Math.sqrt(2);function _f(e,t,r){const n=(t-e)/Math.max(0,r),a=Math.floor(Math.log10(n)),o=n/Math.pow(10,a),u=o>=LF?10:o>=zF?5:o>=FF?2:1;let l,f,h;return a<0?(h=Math.pow(10,-a)/u,l=Math.round(e*h),f=Math.round(t*h),l/ht&&--f,h=-h):(h=Math.pow(10,a)*u,l=Math.round(e/h),f=Math.round(t/h),l*ht&&--f),f0))return[];if(e===t)return[e];const n=t=a))return[];const l=o-a+1,f=new Array(l);if(n)if(u<0)for(let h=0;h=n)&&(r=n);return r}function xj(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function iC(e,t,r=0,n=1/0,a){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(a=a===void 0?nC:$F(a);n>r;){if(n-r>600){const f=n-r+1,h=t-r+1,p=Math.log(f),v=.5*Math.exp(2*p/3),x=.5*Math.sqrt(p*v*(f-v)/f)*(h-f/2<0?-1:1),b=Math.max(r,Math.floor(t-h*v/f+x)),k=Math.min(n,Math.floor(t+(f-h)*v/f+x));iC(e,t,b,k,a)}const o=e[t];let u=r,l=n;for(eu(e,r,t),a(e[n],o)>0&&eu(e,r,n);u0;)--l}a(e[r],o)===0?eu(e,r,l):(++l,eu(e,l,n)),l<=t&&(r=l+1),t<=l&&(n=l-1)}return e}function eu(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function BF(e,t,r){if(e=Float64Array.from(MF(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return xj(e);if(t>=1)return yj(e);var n,a=(n-1)*t,o=Math.floor(a),u=yj(iC(e,o).subarray(0,o+1)),l=xj(e.subarray(o+1));return u+(l-u)*(a-o)}}function UF(e,t,r=rC){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,a=(n-1)*t,o=Math.floor(a),u=+r(e[o],o,e),l=+r(e[o+1],o+1,e);return u+(l-u)*(a-o)}}function WF(e,t,r){e=+e,t=+t,r=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+r;for(var n=-1,a=Math.max(0,Math.ceil((t-e)/r))|0,o=new Array(a);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?Ld(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?Ld(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=GF.exec(e))?new br(t[1],t[2],t[3],1):(t=VF.exec(e))?new br(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=qF.exec(e))?Ld(t[1],t[2],t[3],t[4]):(t=QF.exec(e))?Ld(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=YF.exec(e))?Ej(t[1],t[2]/100,t[3]/100,1):(t=XF.exec(e))?Ej(t[1],t[2]/100,t[3]/100,t[4]):bj.hasOwnProperty(e)?jj(bj[e]):e==="transparent"?new br(NaN,NaN,NaN,0):null}function jj(e){return new br(e>>16&255,e>>8&255,e&255,1)}function Ld(e,t,r,n){return n<=0&&(e=t=r=NaN),new br(e,t,r,n)}function e8(e){return e instanceof rc||(e=Ru(e)),e?(e=e.rgb(),new br(e.r,e.g,e.b,e.opacity)):new br}function zg(e,t,r,n){return arguments.length===1?e8(e):new br(e,t,r,n??1)}function br(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}Zy(br,zg,oC(rc,{brighter(e){return e=e==null?Mf:Math.pow(Mf,e),new br(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new br(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new br(ro(this.r),ro(this.g),ro(this.b),If(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:Sj,formatHex:Sj,formatHex8:t8,formatRgb:Nj,toString:Nj}));function Sj(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}`}function t8(){return`#${Ua(this.r)}${Ua(this.g)}${Ua(this.b)}${Ua((isNaN(this.opacity)?1:this.opacity)*255)}`}function Nj(){const e=If(this.opacity);return`${e===1?"rgb(":"rgba("}${ro(this.r)}, ${ro(this.g)}, ${ro(this.b)}${e===1?")":`, ${e})`}`}function If(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function ro(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ua(e){return e=ro(e),(e<16?"0":"")+e.toString(16)}function Ej(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new cn(e,t,r,n)}function sC(e){if(e instanceof cn)return new cn(e.h,e.s,e.l,e.opacity);if(e instanceof rc||(e=Ru(e)),!e)return new cn;if(e instanceof cn)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,a=Math.min(t,r,n),o=Math.max(t,r,n),u=NaN,l=o-a,f=(o+a)/2;return l?(t===o?u=(r-n)/l+(r0&&f<1?0:u,new cn(u,l,f,e.opacity)}function r8(e,t,r,n){return arguments.length===1?sC(e):new cn(e,t,r,n??1)}function cn(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}Zy(cn,r8,oC(rc,{brighter(e){return e=e==null?Mf:Math.pow(Mf,e),new cn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new cn(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,r=this.l,n=r+(r<.5?r:1-r)*t,a=2*r-n;return new br(pv(e>=240?e-240:e+120,a,n),pv(e,a,n),pv(e<120?e+240:e-120,a,n),this.opacity)},clamp(){return new cn(Pj(this.h),zd(this.s),zd(this.l),If(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=If(this.opacity);return`${e===1?"hsl(":"hsla("}${Pj(this.h)}, ${zd(this.s)*100}%, ${zd(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Pj(e){return e=(e||0)%360,e<0?e+360:e}function zd(e){return Math.max(0,Math.min(1,e||0))}function pv(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const Jy=e=>()=>e;function n8(e,t){return function(r){return e+r*t}}function i8(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function a8(e){return(e=+e)==1?lC:function(t,r){return r-t?i8(t,r,e):Jy(isNaN(t)?r:t)}}function lC(e,t){var r=t-e;return r?n8(e,r):Jy(isNaN(e)?t:e)}const Cj=(function e(t){var r=a8(t);function n(a,o){var u=r((a=zg(a)).r,(o=zg(o)).r),l=r(a.g,o.g),f=r(a.b,o.b),h=lC(a.opacity,o.opacity);return function(p){return a.r=u(p),a.g=l(p),a.b=f(p),a.opacity=h(p),a+""}}return n.gamma=e,n})(1);function o8(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),a;return function(o){for(a=0;ar&&(o=t.slice(r,o),l[u]?l[u]+=o:l[++u]=o),(n=n[0])===(a=a[0])?l[u]?l[u]+=a:l[++u]=a:(l[++u]=null,f.push({i:u,x:Tf(n,a)})),r=mv.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function g8(e,t,r){var n=e[0],a=e[1],o=t[0],u=t[1];return a2?y8:g8,f=h=null,v}function v(x){return x==null||isNaN(x=+x)?o:(f||(f=l(e.map(n),t,r)))(n(u(x)))}return v.invert=function(x){return u(a((h||(h=l(t,e.map(n),Tf)))(x)))},v.domain=function(x){return arguments.length?(e=Array.from(x,Df),p()):e.slice()},v.range=function(x){return arguments.length?(t=Array.from(x),p()):t.slice()},v.rangeRound=function(x){return t=Array.from(x),r=e0,p()},v.clamp=function(x){return arguments.length?(u=x?!0:sr,p()):u!==sr},v.interpolate=function(x){return arguments.length?(r=x,p()):r},v.unknown=function(x){return arguments.length?(o=x,v):o},function(x,b){return n=x,a=b,p()}}function t0(){return Lh()(sr,sr)}function x8(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Rf(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function Ts(e){return e=Rf(Math.abs(e)),e?e[1]:NaN}function b8(e,t){return function(r,n){for(var a=r.length,o=[],u=0,l=e[0],f=0;a>0&&l>0&&(f+l+1>n&&(l=Math.max(1,n-f)),o.push(r.substring(a-=l,a+l)),!((f+=l+1)>n));)l=e[u=(u+1)%e.length];return o.reverse().join(t)}}function w8(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var k8=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function $u(e){if(!(t=k8.exec(e)))throw new Error("invalid format: "+e);var t;return new r0({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]})}$u.prototype=r0.prototype;function r0(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+""}r0.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 j8(e){e:for(var t=e.length,r=1,n=-1,a;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(a+1):e}var $f;function S8(e,t){var r=Rf(e,t);if(!r)return $f=void 0,e.toPrecision(t);var n=r[0],a=r[1],o=a-($f=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,u=n.length;return o===u?n:o>u?n+new Array(o-u+1).join("0"):o>0?n.slice(0,o)+"."+n.slice(o):"0."+new Array(1-o).join("0")+Rf(e,Math.max(0,t+o-1))[0]}function Oj(e,t){var r=Rf(e,t);if(!r)return e+"";var n=r[0],a=r[1];return a<0?"0."+new Array(-a).join("0")+n:n.length>a+1?n.slice(0,a+1)+"."+n.slice(a+1):n+new Array(a-n.length+2).join("0")}const _j={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:x8,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)=>Oj(e*100,t),r:Oj,s:S8,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function Mj(e){return e}var Ij=Array.prototype.map,Tj=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function N8(e){var t=e.grouping===void 0||e.thousands===void 0?Mj:b8(Ij.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?Mj:w8(Ij.call(e.numerals,String)),u=e.percent===void 0?"%":e.percent+"",l=e.minus===void 0?"−":e.minus+"",f=e.nan===void 0?"NaN":e.nan+"";function h(v,x){v=$u(v);var b=v.fill,k=v.align,j=v.sign,S=v.symbol,N=v.zero,P=v.width,O=v.comma,C=v.precision,_=v.trim,A=v.type;A==="n"?(O=!0,A="g"):_j[A]||(C===void 0&&(C=12),_=!0,A="g"),(N||b==="0"&&k==="=")&&(N=!0,b="0",k="=");var I=(x&&x.prefix!==void 0?x.prefix:"")+(S==="$"?r:S==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),$=(S==="$"?n:/[%p]/.test(A)?u:"")+(x&&x.suffix!==void 0?x.suffix:""),B=_j[A],K=/[defgprs%]/.test(A);C=C===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,C)):Math.max(0,Math.min(20,C));function q(R){var de=I,Z=$,ge,ke,me;if(A==="c")Z=B(R)+Z,R="";else{R=+R;var Q=R<0||1/R<0;if(R=isNaN(R)?f:B(Math.abs(R),C),_&&(R=j8(R)),Q&&+R==0&&j!=="+"&&(Q=!1),de=(Q?j==="("?j:l:j==="-"||j==="("?"":j)+de,Z=(A==="s"&&!isNaN(R)&&$f!==void 0?Tj[8+$f/3]:"")+Z+(Q&&j==="("?")":""),K){for(ge=-1,ke=R.length;++geme||me>57){Z=(me===46?a+R.slice(ge+1):R.slice(ge))+Z,R=R.slice(0,ge);break}}}O&&!N&&(R=t(R,1/0));var oe=de.length+R.length+Z.length,X=oe>1)+de+R+Z+X.slice(oe);break;default:R=X+de+R+Z;break}return o(R)}return q.toString=function(){return v+""},q}function p(v,x){var b=Math.max(-8,Math.min(8,Math.floor(Ts(x)/3)))*3,k=Math.pow(10,-b),j=h((v=$u(v),v.type="f",v),{suffix:Tj[8+b/3]});return function(S){return j(k*S)}}return{format:h,formatPrefix:p}}var Fd,n0,uC;E8({thousands:",",grouping:[3],currency:["$",""]});function E8(e){return Fd=N8(e),n0=Fd.format,uC=Fd.formatPrefix,Fd}function P8(e){return Math.max(0,-Ts(Math.abs(e)))}function C8(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Ts(t)/3)))*3-Ts(Math.abs(e)))}function A8(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,Ts(t)-Ts(e))+1}function cC(e,t,r,n){var a=$g(e,t,r),o;switch(n=$u(n??",f"),n.type){case"s":{var u=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(o=C8(a,u))&&(n.precision=o),uC(n,u)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(o=A8(a,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=o-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(o=P8(a))&&(n.precision=o-(n.type==="%")*2);break}}return n0(n)}function fa(e){var t=e.domain;return e.ticks=function(r){var n=t();return Dg(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var a=t();return cC(a[0],a[a.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),a=0,o=n.length-1,u=n[a],l=n[o],f,h,p=10;for(l0;){if(h=Rg(u,l,r),h===f)return n[a]=u,n[o]=l,t(n);if(h>0)u=Math.floor(u/h)*h,l=Math.ceil(l/h)*h;else if(h<0)u=Math.ceil(u*h)/h,l=Math.floor(l*h)/h;else break;f=h}return e},e}function dC(){var e=t0();return e.copy=function(){return nc(e,dC())},Yr.apply(e,arguments),fa(e)}function fC(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,Df),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return fC(e).unknown(t)},e=arguments.length?Array.from(e,Df):[0,1],fa(r)}function hC(e,t){e=e.slice();var r=0,n=e.length-1,a=e[r],o=e[n],u;return oMath.pow(e,t)}function T8(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 $j(e){return(t,r)=>-e(-t,r)}function i0(e){const t=e(Dj,Rj),r=t.domain;let n=10,a,o;function u(){return a=T8(n),o=I8(n),r()[0]<0?(a=$j(a),o=$j(o),e(O8,_8)):e(Dj,Rj),t}return t.base=function(l){return arguments.length?(n=+l,u()):n},t.domain=function(l){return arguments.length?(r(l),u()):r()},t.ticks=l=>{const f=r();let h=f[0],p=f[f.length-1];const v=p0){for(;x<=b;++x)for(k=1;kp)break;N.push(j)}}else for(;x<=b;++x)for(k=n-1;k>=1;--k)if(j=x>0?k/o(-x):k*o(x),!(jp)break;N.push(j)}N.length*2{if(l==null&&(l=10),f==null&&(f=n===10?"s":","),typeof f!="function"&&(!(n%1)&&(f=$u(f)).precision==null&&(f.trim=!0),f=n0(f)),l===1/0)return f;const h=Math.max(1,n*l/t.ticks().length);return p=>{let v=p/o(Math.round(a(p)));return v*nr(hC(r(),{floor:l=>o(Math.floor(a(l))),ceil:l=>o(Math.ceil(a(l)))})),t}function pC(){const e=i0(Lh()).domain([1,10]);return e.copy=()=>nc(e,pC()).base(e.base()),Yr.apply(e,arguments),e}function Lj(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function zj(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function a0(e){var t=1,r=e(Lj(t),zj(t));return r.constant=function(n){return arguments.length?e(Lj(t=+n),zj(t)):t},fa(r)}function mC(){var e=a0(Lh());return e.copy=function(){return nc(e,mC()).constant(e.constant())},Yr.apply(e,arguments)}function Fj(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function D8(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function R8(e){return e<0?-e*e:e*e}function o0(e){var t=e(sr,sr),r=1;function n(){return r===1?e(sr,sr):r===.5?e(D8,R8):e(Fj(r),Fj(1/r))}return t.exponent=function(a){return arguments.length?(r=+a,n()):r},fa(t)}function s0(){var e=o0(Lh());return e.copy=function(){return nc(e,s0()).exponent(e.exponent())},Yr.apply(e,arguments),e}function $8(){return s0.apply(null,arguments).exponent(.5)}function Bj(e){return Math.sign(e)*e*e}function L8(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function vC(){var e=t0(),t=[0,1],r=!1,n;function a(o){var u=L8(e(o));return isNaN(u)?n:r?Math.round(u):u}return a.invert=function(o){return e.invert(Bj(o))},a.domain=function(o){return arguments.length?(e.domain(o),a):e.domain()},a.range=function(o){return arguments.length?(e.range((t=Array.from(o,Df)).map(Bj)),a):t.slice()},a.rangeRound=function(o){return a.range(o).round(!0)},a.round=function(o){return arguments.length?(r=!!o,a):r},a.clamp=function(o){return arguments.length?(e.clamp(o),a):e.clamp()},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return vC(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},Yr.apply(a,arguments),fa(a)}function gC(){var e=[],t=[],r=[],n;function a(){var u=0,l=Math.max(1,t.length);for(r=new Array(l-1);++u0?r[l-1]:e[0],l=r?[n[r-1],t]:[n[h-1],n[h]]},u.unknown=function(f){return arguments.length&&(o=f),u},u.thresholds=function(){return n.slice()},u.copy=function(){return yC().domain([e,t]).range(a).unknown(o)},Yr.apply(fa(u),arguments)}function xC(){var e=[.5],t=[0,1],r,n=1;function a(o){return o!=null&&o<=o?t[tc(e,o,0,n)]:r}return a.domain=function(o){return arguments.length?(e=Array.from(o),n=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(o){return arguments.length?(t=Array.from(o),n=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(o){var u=t.indexOf(o);return[e[u-1],e[u]]},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return xC().domain(e).range(t).unknown(r)},Yr.apply(a,arguments)}const vv=new Date,gv=new Date;function Pt(e,t,r,n){function a(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return a.floor=o=>(e(o=new Date(+o)),o),a.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),a.round=o=>{const u=a(o),l=a.ceil(o);return o-u(t(o=new Date(+o),u==null?1:Math.floor(u)),o),a.range=(o,u,l)=>{const f=[];if(o=a.ceil(o),l=l==null?1:Math.floor(l),!(o0))return f;let h;do f.push(h=new Date(+o)),t(o,l),e(o);while(hPt(u=>{if(u>=u)for(;e(u),!o(u);)u.setTime(u-1)},(u,l)=>{if(u>=u)if(l<0)for(;++l<=0;)for(;t(u,-1),!o(u););else for(;--l>=0;)for(;t(u,1),!o(u););}),r&&(a.count=(o,u)=>(vv.setTime(+o),gv.setTime(+u),e(vv),e(gv),Math.floor(r(vv,gv))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(n?u=>n(u)%o===0:u=>a.count(0,u)%o===0):a)),a}const Lf=Pt(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Lf.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?Pt(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Lf);Lf.range;const ii=1e3,Kr=ii*60,ai=Kr*60,ci=ai*24,l0=ci*7,Uj=ci*30,yv=ci*365,Wa=Pt(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*ii)},(e,t)=>(t-e)/ii,e=>e.getUTCSeconds());Wa.range;const u0=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ii)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getMinutes());u0.range;const c0=Pt(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Kr)},(e,t)=>(t-e)/Kr,e=>e.getUTCMinutes());c0.range;const d0=Pt(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*ii-e.getMinutes()*Kr)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getHours());d0.range;const f0=Pt(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*ai)},(e,t)=>(t-e)/ai,e=>e.getUTCHours());f0.range;const ic=Pt(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Kr)/ci,e=>e.getDate()-1);ic.range;const zh=Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ci,e=>e.getUTCDate()-1);zh.range;const bC=Pt(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ci,e=>Math.floor(e/ci));bC.range;function yo(e){return Pt(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*Kr)/l0)}const Fh=yo(0),zf=yo(1),z8=yo(2),F8=yo(3),Ds=yo(4),B8=yo(5),U8=yo(6);Fh.range;zf.range;z8.range;F8.range;Ds.range;B8.range;U8.range;function xo(e){return Pt(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/l0)}const Bh=xo(0),Ff=xo(1),W8=xo(2),H8=xo(3),Rs=xo(4),K8=xo(5),G8=xo(6);Bh.range;Ff.range;W8.range;H8.range;Rs.range;K8.range;G8.range;const h0=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());h0.range;const p0=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());p0.range;const di=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());di.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,r)=>{t.setFullYear(t.getFullYear()+r*e)});di.range;const fi=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());fi.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,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});fi.range;function wC(e,t,r,n,a,o){const u=[[Wa,1,ii],[Wa,5,5*ii],[Wa,15,15*ii],[Wa,30,30*ii],[o,1,Kr],[o,5,5*Kr],[o,15,15*Kr],[o,30,30*Kr],[a,1,ai],[a,3,3*ai],[a,6,6*ai],[a,12,12*ai],[n,1,ci],[n,2,2*ci],[r,1,l0],[t,1,Uj],[t,3,3*Uj],[e,1,yv]];function l(h,p,v){const x=pS).right(u,x);if(b===u.length)return e.every($g(h/yv,p/yv,v));if(b===0)return Lf.every(Math.max($g(h,p,v),1));const[k,j]=u[x/u[b-1][2]53)return null;"w"in ae||(ae.w=1),"Z"in ae?(Y=bv(tu(ae.y,0,1)),ce=Y.getUTCDay(),Y=ce>4||ce===0?Ff.ceil(Y):Ff(Y),Y=zh.offset(Y,(ae.V-1)*7),ae.y=Y.getUTCFullYear(),ae.m=Y.getUTCMonth(),ae.d=Y.getUTCDate()+(ae.w+6)%7):(Y=xv(tu(ae.y,0,1)),ce=Y.getDay(),Y=ce>4||ce===0?zf.ceil(Y):zf(Y),Y=ic.offset(Y,(ae.V-1)*7),ae.y=Y.getFullYear(),ae.m=Y.getMonth(),ae.d=Y.getDate()+(ae.w+6)%7)}else("W"in ae||"U"in ae)&&("w"in ae||(ae.w="u"in ae?ae.u%7:"W"in ae?1:0),ce="Z"in ae?bv(tu(ae.y,0,1)).getUTCDay():xv(tu(ae.y,0,1)).getDay(),ae.m=0,ae.d="W"in ae?(ae.w+6)%7+ae.W*7-(ce+5)%7:ae.w+ae.U*7-(ce+6)%7);return"Z"in ae?(ae.H+=ae.Z/100|0,ae.M+=ae.Z%100,bv(ae)):xv(ae)}}function $(J,je,_e,ae){for(var Xe=0,Y=je.length,ce=_e.length,tt,kr;Xe=ce)return-1;if(tt=je.charCodeAt(Xe++),tt===37){if(tt=je.charAt(Xe++),kr=_[tt in Wj?je.charAt(Xe++):tt],!kr||(ae=kr(J,_e,ae))<0)return-1}else if(tt!=_e.charCodeAt(ae++))return-1}return ae}function B(J,je,_e){var ae=h.exec(je.slice(_e));return ae?(J.p=p.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function K(J,je,_e){var ae=b.exec(je.slice(_e));return ae?(J.w=k.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function q(J,je,_e){var ae=v.exec(je.slice(_e));return ae?(J.w=x.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function R(J,je,_e){var ae=N.exec(je.slice(_e));return ae?(J.m=P.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function de(J,je,_e){var ae=j.exec(je.slice(_e));return ae?(J.m=S.get(ae[0].toLowerCase()),_e+ae[0].length):-1}function Z(J,je,_e){return $(J,t,je,_e)}function ge(J,je,_e){return $(J,r,je,_e)}function ke(J,je,_e){return $(J,n,je,_e)}function me(J){return u[J.getDay()]}function Q(J){return o[J.getDay()]}function oe(J){return f[J.getMonth()]}function X(J){return l[J.getMonth()]}function L(J){return a[+(J.getHours()>=12)]}function T(J){return 1+~~(J.getMonth()/3)}function ee(J){return u[J.getUTCDay()]}function ne(J){return o[J.getUTCDay()]}function te(J){return f[J.getUTCMonth()]}function ue(J){return l[J.getUTCMonth()]}function pe(J){return a[+(J.getUTCHours()>=12)]}function Oe(J){return 1+~~(J.getUTCMonth()/3)}return{format:function(J){var je=A(J+="",O);return je.toString=function(){return J},je},parse:function(J){var je=I(J+="",!1);return je.toString=function(){return J},je},utcFormat:function(J){var je=A(J+="",C);return je.toString=function(){return J},je},utcParse:function(J){var je=I(J+="",!0);return je.toString=function(){return J},je}}}var Wj={"-":"",_:" ",0:"0"},$t=/^\s*\d+/,Z8=/^%/,J8=/[\\^$*+?|[\]().{}]/g;function Ge(e,t,r){var n=e<0?"-":"",a=(n?-e:e)+"",o=a.length;return n+(o[t.toLowerCase(),r]))}function tB(e,t,r){var n=$t.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function rB(e,t,r){var n=$t.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function nB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function iB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function aB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function Hj(e,t,r){var n=$t.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function Kj(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function oB(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function sB(e,t,r){var n=$t.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function lB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function Gj(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function uB(e,t,r){var n=$t.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function Vj(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function cB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function dB(e,t,r){var n=$t.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function fB(e,t,r){var n=$t.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function hB(e,t,r){var n=$t.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function pB(e,t,r){var n=Z8.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function mB(e,t,r){var n=$t.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function vB(e,t,r){var n=$t.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function qj(e,t){return Ge(e.getDate(),t,2)}function gB(e,t){return Ge(e.getHours(),t,2)}function yB(e,t){return Ge(e.getHours()%12||12,t,2)}function xB(e,t){return Ge(1+ic.count(di(e),e),t,3)}function kC(e,t){return Ge(e.getMilliseconds(),t,3)}function bB(e,t){return kC(e,t)+"000"}function wB(e,t){return Ge(e.getMonth()+1,t,2)}function kB(e,t){return Ge(e.getMinutes(),t,2)}function jB(e,t){return Ge(e.getSeconds(),t,2)}function SB(e){var t=e.getDay();return t===0?7:t}function NB(e,t){return Ge(Fh.count(di(e)-1,e),t,2)}function jC(e){var t=e.getDay();return t>=4||t===0?Ds(e):Ds.ceil(e)}function EB(e,t){return e=jC(e),Ge(Ds.count(di(e),e)+(di(e).getDay()===4),t,2)}function PB(e){return e.getDay()}function CB(e,t){return Ge(zf.count(di(e)-1,e),t,2)}function AB(e,t){return Ge(e.getFullYear()%100,t,2)}function OB(e,t){return e=jC(e),Ge(e.getFullYear()%100,t,2)}function _B(e,t){return Ge(e.getFullYear()%1e4,t,4)}function MB(e,t){var r=e.getDay();return e=r>=4||r===0?Ds(e):Ds.ceil(e),Ge(e.getFullYear()%1e4,t,4)}function IB(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+Ge(t/60|0,"0",2)+Ge(t%60,"0",2)}function Qj(e,t){return Ge(e.getUTCDate(),t,2)}function TB(e,t){return Ge(e.getUTCHours(),t,2)}function DB(e,t){return Ge(e.getUTCHours()%12||12,t,2)}function RB(e,t){return Ge(1+zh.count(fi(e),e),t,3)}function SC(e,t){return Ge(e.getUTCMilliseconds(),t,3)}function $B(e,t){return SC(e,t)+"000"}function LB(e,t){return Ge(e.getUTCMonth()+1,t,2)}function zB(e,t){return Ge(e.getUTCMinutes(),t,2)}function FB(e,t){return Ge(e.getUTCSeconds(),t,2)}function BB(e){var t=e.getUTCDay();return t===0?7:t}function UB(e,t){return Ge(Bh.count(fi(e)-1,e),t,2)}function NC(e){var t=e.getUTCDay();return t>=4||t===0?Rs(e):Rs.ceil(e)}function WB(e,t){return e=NC(e),Ge(Rs.count(fi(e),e)+(fi(e).getUTCDay()===4),t,2)}function HB(e){return e.getUTCDay()}function KB(e,t){return Ge(Ff.count(fi(e)-1,e),t,2)}function GB(e,t){return Ge(e.getUTCFullYear()%100,t,2)}function VB(e,t){return e=NC(e),Ge(e.getUTCFullYear()%100,t,2)}function qB(e,t){return Ge(e.getUTCFullYear()%1e4,t,4)}function QB(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Rs(e):Rs.ceil(e),Ge(e.getUTCFullYear()%1e4,t,4)}function YB(){return"+0000"}function Yj(){return"%"}function Xj(e){return+e}function Zj(e){return Math.floor(+e/1e3)}var Zo,EC,PC;XB({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 XB(e){return Zo=X8(e),EC=Zo.format,Zo.parse,PC=Zo.utcFormat,Zo.utcParse,Zo}function ZB(e){return new Date(e)}function JB(e){return e instanceof Date?+e:+new Date(+e)}function m0(e,t,r,n,a,o,u,l,f,h){var p=t0(),v=p.invert,x=p.domain,b=h(".%L"),k=h(":%S"),j=h("%I:%M"),S=h("%I %p"),N=h("%a %d"),P=h("%b %d"),O=h("%B"),C=h("%Y");function _(A){return(f(A)t(a/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(a,o)=>BF(e,o/n))},r.copy=function(){return _C(t).domain(e)},mi.apply(r,arguments)}function Wh(){var e=0,t=.5,r=1,n=1,a,o,u,l,f,h=sr,p,v=!1,x;function b(j){return isNaN(j=+j)?x:(j=.5+((j=+p(j))-o)*(n*j{if(e!=null){var n=e.scale,a=e.type;if(n==="auto")return a==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":a==="category"?"band":"linear";if(typeof n=="string")return o9(n)?n:"point"}};function s9(e,t){for(var r=0,n=e.length,a=e[0]t)?r=o+1:n=o}return r}function $C(e,t){if(e){var r=t??e.domain(),n=r.map(o=>{var u;return(u=e(o))!==null&&u!==void 0?u:0}),a=e.range();if(!(r.length===0||a.length<2))return o=>{var u,l,f=s9(n,o);if(f<=0)return r[0];if(f>=r.length)return r[r.length-1];var h=(u=n[f-1])!==null&&u!==void 0?u:0,p=(l=n[f])!==null&&l!==void 0?l:0;return Math.abs(o-h)<=Math.abs(o-p)?r[f-1]:r[f]}}}function l9(e){if(e!=null)return"invert"in e&&typeof e.invert=="function"?e.invert.bind(e):$C(e,void 0)}function eS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bf(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);re.cartesianAxis.xAxis[t],vi=(e,t)=>{var r=zC(e,t);return r??Nt},Et={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:Ug,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,niceTicks:"auto",width:Yu},FC=(e,t)=>e.cartesianAxis.yAxis[t],gi=(e,t)=>{var r=FC(e,t);return r??Et},v9={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:""},x0=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??v9},cr=(e,t,r)=>{switch(t){case"xAxis":return vi(e,r);case"yAxis":return gi(e,r);case"zAxis":return x0(e,r);case"angleAxis":return Wy(e,r);case"radiusAxis":return Hy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},g9=(e,t,r)=>{switch(t){case"xAxis":return vi(e,r);case"yAxis":return gi(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},ac=(e,t,r)=>{switch(t){case"xAxis":return vi(e,r);case"yAxis":return gi(e,r);case"angleAxis":return Wy(e,r);case"radiusAxis":return Hy(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},BC=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function UC(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var WC=e=>e.graphicalItems.cartesianItems,y9=G([Dt,Dh],UC),HC=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),qs=G([WC,cr,y9],HC,{memoizeOptions:{resultEqualityCheck:$h}}),KC=G([qs],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(Vy)),GC=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),x9=G([qs],GC),VC=e=>e.map(t=>t.data).filter(Boolean).flat(1),b9=G([qs],e=>e.some(t=>!t.data)),qC=G([qs],VC,{memoizeOptions:{resultEqualityCheck:$h}}),QC=(e,t)=>{var r=t.chartData,n=r===void 0?[]:r,a=t.dataStartIndex,o=t.dataEndIndex;return e.length>0?e:n.slice(a,o+1)},b0=G([qC,Oh],QC),w9=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Tt(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(a=>({value:Tt(a,n)}))):e.map(n=>({value:n})),YC=(e,t,r,n,a,o)=>{var u=n.chartData,l=u===void 0?[]:u,f=n.dataStartIndex,h=n.dataEndIndex,p=w9(e,t,r);if(a&&(t==null?void 0:t.dataKey)!=null&&o.length>0){var v=l.slice(f,h+1),x=v.map(b=>({value:Tt(b,t.dataKey)})).filter(b=>b.value!=null);return[...x,...p]}return p},oc=G([b0,cr,qs,Oh,b9,qC],YC);function hs(e){if(Dn(e)||e instanceof Date){var t=Number(e);if(Be(t))return t}}function rS(e){if(Array.isArray(e)){var t=[hs(e[0]),hs(e[1])];return Mn(t)?t:void 0}var r=hs(e);if(r!=null)return[r,r]}function Ln(e){return e.map(hs).filter(xr)}function k9(e,t){var r=hs(e),n=hs(t);return r==null&&n==null?0:r==null?-1:n==null?1:r-n}var j9=G([oc],e=>e==null?void 0:e.map(t=>t.value).sort(k9));function XC(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function S9(e,t,r){if(!r)return[];if(!r.length)return[];var n;if(typeof t=="number"&&!Tn(t))n=t;else if(Array.isArray(t)){var a=Ln(t);a.length>0&&(n=Math.max(...a))}return n==null?[]:Ln(r.flatMap(o=>{var u=Tt(e,o.dataKey),l,f;if(Array.isArray(u)){var h=LC(u,2);l=h[0],f=h[1]}else l=f=u;if(!(!Be(l)||!Be(f)))return[n-l,n+f]}))}var Ct=e=>{var t=Rt(e),r=Gs(e);return ac(e,t,r)},$s=G([Ct],e=>e==null?void 0:e.dataKey),N9=G([KC,Oh,Ct],tC),ZC=(e,t,r,n)=>{var a={},o=t.reduce((u,l)=>{if(l.stackId==null)return u;var f=u[l.stackId];return f==null&&(f=[]),f.push(l),u[l.stackId]=f,u},a);return Object.fromEntries(Object.entries(o).map(u=>{var l=LC(u,2),f=l[0],h=l[1],p=n?[...h].reverse():h,v=p.map(Gy);return[f,{stackedData:W$(e,v,r),graphicalItems:p}]}))},JC=G([N9,KC,_h,qP],ZC),eA=(e,t,r,n)=>{var a=t.dataStartIndex,o=t.dataEndIndex;if(n==null&&r!=="zAxis")return V$(e,a,o)},E9=G([cr],e=>e.allowDataOverflow),w0=e=>{var t;if(e==null||!("domain"in e))return Ug;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=Ln(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:Ug},tA=G([cr],w0),rA=G([tA,E9],$P),P9=G([JC,pn,Dt,rA],eA,{memoizeOptions:{resultEqualityCheck:Rh}}),k0=e=>e.errorBars,C9=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>XC(r,n)),Uf=function(){for(var t=arguments.length,r=new Array(t),n=0;n5&&arguments[5]!==void 0?arguments[5]:[],l,f;if(n.length>0&&n.forEach(h=>{var p,v=h.data!=null?[...h.data]:u,x=(p=a[h.id])===null||p===void 0?void 0:p.filter(b=>XC(o,b));v.forEach(b=>{var k,j=Tt(b,(k=r.dataKey)!==null&&k!==void 0?k:h.dataKey),S=S9(b,j,x);if(S.length>=2){var N=Math.min(...S),P=Math.max(...S);(l==null||Nf)&&(f=P)}var O=rS(j);O!=null&&(l=l==null?O[0]:Math.min(l,O[0]),f=f==null?O[1]:Math.max(f,O[1]))})}),(r==null?void 0:r.dataKey)!=null&&n.length===0&&t.forEach(h=>{var p=rS(Tt(h,r.dataKey));p!=null&&(l=l==null?p[0]:Math.min(l,p[0]),f=f==null?p[1]:Math.max(f,p[1]))}),Be(l)&&Be(f))return[l,f]},A9=G([b0,cr,x9,k0,Dt,aF],nA,{memoizeOptions:{resultEqualityCheck:Rh}});function O9(e){var t=e.value;if(Dn(t)||t instanceof Date)return t}var _9=(e,t,r)=>{var n=e.map(O9).filter(a=>a!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&pE(n))?RP(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},iA=e=>e.referenceElements.dots,Qs=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),M9=G([iA,Dt,Dh],Qs),aA=e=>e.referenceElements.areas,I9=G([aA,Dt,Dh],Qs),oA=e=>e.referenceElements.lines,T9=G([oA,Dt,Dh],Qs),sA=(e,t)=>{if(e!=null){var r=Ln(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},D9=G(M9,Dt,sA),lA=(e,t)=>{if(e!=null){var r=Ln(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},R9=G([I9,Dt],lA);function $9(e){var t;if(e.x!=null)return Ln([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:Ln(r)}function L9(e){var t;if(e.y!=null)return Ln([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:Ln(r)}var uA=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?$9(n):L9(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},z9=G([T9,Dt],uA),F9=G(D9,z9,R9,(e,t,r)=>Uf(e,r,t)),cA=(e,t,r,n,a,o,u,l)=>{if(r!=null)return r;var f=u==="vertical"&&l==="xAxis"||u==="horizontal"&&l==="yAxis",h=f?Uf(n,o,a):Uf(o,a);return dF(t,h,e.allowDataOverflow)},B9=G([cr,tA,rA,P9,A9,F9,ut,Dt],cA,{memoizeOptions:{resultEqualityCheck:Rh}}),U9=[0,1],dA=(e,t,r,n,a,o,u)=>{if(!((e==null||r==null||r.length===0)&&u===void 0)){var l=e.dataKey,f=e.type,h=zn(t,o);if(h&&l==null){var p;return RP(0,(p=r==null?void 0:r.length)!==null&&p!==void 0?p:0)}return f==="category"?_9(n,e,h):a==="expand"&&!h?U9:u}},j0=G([cr,ut,b0,oc,_h,Dt,B9],dA),Ys=G([cr,BC,Fy],RC),fA=(e,t,r)=>{var n=t.niceTicks;if(n!=="none"){var a=w0(t),o=Array.isArray(a)&&(a[0]==="auto"||a[1]==="auto");if((n==="snap125"||n==="adaptive")&&t!=null&&t.tickCount&&Mn(e)){if(o)return dj(e,t.tickCount,t.allowDecimals,n);if(t.type==="number")return fj(e,t.tickCount,t.allowDecimals,n)}if(n==="auto"&&r==="linear"&&t!=null&&t.tickCount){if(o&&Mn(e))return dj(e,t.tickCount,t.allowDecimals,"adaptive");if(t.type==="number"&&Mn(e))return fj(e,t.tickCount,t.allowDecimals,"adaptive")}}},S0=G([j0,ac,Ys],fA),hA=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&Mn(t)&&Array.isArray(r)&&r.length>0){var a,o,u=t[0],l=(a=r[0])!==null&&a!==void 0?a:0,f=t[1],h=(o=r[r.length-1])!==null&&o!==void 0?o:0;return[Math.min(u,l),Math.max(f,h)]}return t},W9=G([cr,j0,S0,Dt],hA),H9=G(oc,cr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(Ln(e.map(v=>v.value))).sort((v,x)=>v-x),a=n[0],o=n[n.length-1];if(a==null||o==null)return 1/0;var u=o-a;if(u===0)return 1/0;for(var l=0;la,(e,t,r,n,a)=>{if(!Be(e))return 0;var o=t==="vertical"?n.height:n.width;if(a==="gap")return e*o/2;if(a==="no-gap"){var u=da(r,e*o),l=e*o/2;return l-u-(l-u)/o*u}return 0}),K9=(e,t,r)=>{var n=vi(e,t);return n==null||typeof n.padding!="string"?0:pA(e,"xAxis",t,r,n.padding)},G9=(e,t,r)=>{var n=gi(e,t);return n==null||typeof n.padding!="string"?0:pA(e,"yAxis",t,r,n.padding)},V9=G(vi,K9,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var a=e.padding;return typeof a=="string"?{left:t,right:t}:{left:((r=a.left)!==null&&r!==void 0?r:0)+t,right:((n=a.right)!==null&&n!==void 0?n:0)+t}}),q9=G(gi,G9,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var a=e.padding;return typeof a=="string"?{top:t,bottom:t}:{top:((r=a.top)!==null&&r!==void 0?r:0)+t,bottom:((n=a.bottom)!==null&&n!==void 0?n:0)+t}}),mA=G([Vt,V9,Sh,jh,(e,t,r)=>r],(e,t,r,n,a)=>{var o=n.padding;return a?[o.left,r.width-o.right]:[e.left+t.left,e.left+e.width-t.right]}),vA=G([Vt,ut,q9,Sh,jh,(e,t,r)=>r],(e,t,r,n,a,o)=>{var u=a.padding;return o?[n.height-u.bottom,u.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),sc=(e,t,r,n)=>{var a;switch(t){case"xAxis":return mA(e,r,n);case"yAxis":return vA(e,r,n);case"zAxis":return(a=x0(e,r))===null||a===void 0?void 0:a.range;case"angleAxis":return ZP(e);case"radiusAxis":return JP(e,r);default:return}},gA=G([cr,sc],Mh),Q9=G([Ys,W9],AF),N0=G([cr,Ys,Q9,gA],y0),yA=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var a=r.type,o=r.scale,u=zn(e,n);if(u&&(a==="number"||o!=="auto"))return t.map(l=>l.value)}},E0=G([ut,oc,ac,Dt],yA),Hh=G([N0],qy);G([N0],l9);G([N0,j9],$C);G([qs,k0,Dt],C9);function xA(e,t){return e.idt.id?1:0}var Kh=(e,t)=>t,Gh=(e,t,r)=>r,Y9=G(wh,Kh,Gh,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(xA)),X9=G(kh,Kh,Gh,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(xA)),bA=(e,t)=>({width:e.width,height:t.height}),Z9=(e,t)=>{var r=typeof t.width=="number"?t.width:Yu;return{width:r,height:e.height}},J9=G(Vt,vi,bA),eU=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},tU=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},rU=G(pi,Vt,Y9,Kh,Gh,(e,t,r,n,a)=>{var o={},u;return r.forEach(l=>{var f=bA(t,l);u==null&&(u=eU(t,n,e));var h=n==="top"&&!a||n==="bottom"&&a;o[l.id]=u-Number(h)*f.height,u+=(h?-1:1)*f.height}),o}),nU=G(hi,Vt,X9,Kh,Gh,(e,t,r,n,a)=>{var o={},u;return r.forEach(l=>{var f=Z9(t,l);u==null&&(u=tU(t,n,e));var h=n==="left"&&!a||n==="right"&&a;o[l.id]=u-Number(h)*f.width,u+=(h?-1:1)*f.width}),o}),iU=(e,t)=>{var r=vi(e,t);if(r!=null)return rU(e,r.orientation,r.mirror)},aU=G([Vt,vi,iU,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var a=r==null?void 0:r[n];return a==null?{x:e.left,y:0}:{x:e.left,y:a}}}),oU=(e,t)=>{var r=gi(e,t);if(r!=null)return nU(e,r.orientation,r.mirror)},sU=G([Vt,gi,oU,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var a=r==null?void 0:r[n];return a==null?{x:0,y:e.top}:{x:a,y:e.top}}}),lU=G(Vt,gi,(e,t)=>{var r=typeof t.width=="number"?t.width:Yu;return{width:r,height:e.height}}),wA=(e,t,r,n)=>{if(r!=null){var a=r.allowDuplicatedCategory,o=r.type,u=r.dataKey,l=zn(e,n),f=t.map(p=>p.value),h=f.filter(p=>p!=null);if(u&&l&&o==="category"&&a&&pE(h))return f}},P0=G([ut,oc,cr,Dt],wA),nS=G([ut,g9,Ys,Hh,P0,E0,sc,S0,Dt],(e,t,r,n,a,o,u,l,f)=>{if(t!=null){var h=zn(e,f);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:f,categoricalDomain:o,duplicateDomain:a,isCategorical:h,niceTicks:l,range:u,realScaleType:r,scale:n}}}),uU=(e,t,r,n,a,o,u,l,f)=>{if(!(t==null||n==null)){var h=zn(e,f),p=t.type,v=t.ticks,x=t.tickCount,b=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,k=p==="category"&&n.bandwidth?n.bandwidth()/b:0;k=f==="angleAxis"&&o!=null&&o.length>=2?Wr(o[0]-o[1])*2*k:k;var j=v||a;return j?j.map((S,N)=>{var P=u?u.indexOf(S):S,O=n.map(P);return Be(O)?{index:N,coordinate:O+k,value:S,offset:k}:null}).filter(xr):h&&l?l.map((S,N)=>{var P=n.map(S);return Be(P)?{coordinate:P+k,value:S,index:N,offset:k}:null}).filter(xr):n.ticks?n.ticks(x).map((S,N)=>{var P=n.map(S);return Be(P)?{coordinate:P+k,value:S,index:N,offset:k}:null}).filter(xr):n.domain().map((S,N)=>{var P=n.map(S);return Be(P)?{coordinate:P+k,value:u?u[S]:S,index:N,offset:k}:null}).filter(xr)}},kA=G([ut,ac,Ys,Hh,S0,sc,P0,E0,Dt],uU),cU=(e,t,r,n,a,o,u)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var l=zn(e,u),f=t.tickCount,h=0;return h=u==="angleAxis"&&(n==null?void 0:n.length)>=2?Wr(n[0]-n[1])*2*h:h,l&&o?o.map((p,v)=>{var x=r.map(p);return Be(x)?{coordinate:x+h,value:p,index:v,offset:h}:null}).filter(xr):r.ticks?r.ticks(f).map((p,v)=>{var x=r.map(p);return Be(x)?{coordinate:x+h,value:p,index:v,offset:h}:null}).filter(xr):r.domain().map((p,v)=>{var x=r.map(p);return Be(x)?{coordinate:x+h,value:a?a[p]:p,index:v,offset:h}:null}).filter(xr)}},jA=G([ut,ac,Hh,sc,P0,E0,Dt],cU),SA=G(cr,Hh,(e,t)=>{if(!(e==null||t==null))return Bf(Bf({},e),{},{scale:t})}),dU=G([cr,Ys,j0,gA],y0),fU=G([dU],qy);G((e,t,r)=>x0(e,r),fU,(e,t)=>{if(!(e==null||t==null))return Bf(Bf({},e),{},{scale:t})});var hU=G([ut,wh,kh],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),pU=(e,t,r)=>{var n;return(n=e.renderedTicks[t])===null||n===void 0?void 0:n[r]};G([pU],e=>{if(!(!e||e.length===0))return t=>{var r,n=1/0,a=e[0];for(var o of e){var u=Math.abs(o.coordinate-t);ue.options.defaultTooltipEventType,EA=e=>e.options.validateTooltipEventTypes;function PA(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function lc(e,t){var r=NA(e),n=EA(e);return PA(t,r,n)}function mU(e){return Ae(t=>lc(t,e))}var CA=(e,t)=>{var r,n=Number(t);if(!(Tn(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},vU=e=>e.tooltip.settings,Qi={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},gU={itemInteraction:{click:Qi,hover:Qi},axisInteraction:{click:Qi,hover:Qi},keyboardInteraction:Qi,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}},AA=rr({name:"tooltip",initialState:gU,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:at()},replaceTooltipEntrySettings:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).tooltipItemPayloads.indexOf(n);o>-1&&(e.tooltipItemPayloads[o]=a)},prepare:at()},removeTooltipEntrySettings:{reducer(e,t){var r=Hr(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:at()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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.syncInteraction.sourceViewBox=void 0,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}}}),Xr=AA.actions,yU=Xr.addTooltipEntrySettings,xU=Xr.replaceTooltipEntrySettings,bU=Xr.removeTooltipEntrySettings,wU=Xr.setTooltipSettingsState,kU=Xr.setActiveMouseOverItemIndex;Xr.mouseLeaveItem;var OA=Xr.mouseLeaveChart;Xr.setActiveClickItemIndex;var _A=Xr.setMouseOverAxisIndex,jU=Xr.setMouseClickAxisIndex,lu=Xr.setSyncInteraction,Wf=Xr.setKeyboardInteraction,SU=AA.reducer;function iS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Bd(e){for(var t=1;t{if(t==null)return Qi;var a=CU(e,t,r);if(a==null)return Qi;if(a.active)return a;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var o=e.settings.active===!0;if(AU(a)){if(o)return Bd(Bd({},a),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return Bd(Bd({},Qi),{},{coordinate:a.coordinate})};function OU(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 r=Number(e);return Number.isFinite(r)?r:void 0}function _U(e,t){var r=OU(e),n=t[0],a=t[1];if(r===void 0)return!1;var o=Math.min(n,a),u=Math.max(n,a);return r>=o&&r<=u}function MU(e,t,r){if(r==null||t==null)return!0;var n=Tt(e,t);return n==null||!Mn(r)?!0:_U(n,r)}var du=(e,t,r,n)=>{var a=e==null?void 0:e.index;if(a==null)return null;var o=Number(a);if(!Be(o))return a;var u=0,l=1/0;t.length>0&&(l=t.length-1);var f=Math.max(u,Math.min(o,l)),h=t[f];return h==null||MU(h,r,n)?String(f):null},IA=(e,t,r,n,a,o,u)=>{if(o!=null){var l=u[0],f=l==null?void 0:l.getPosition(o);if(f!=null)return f;var h=a==null?void 0:a[Number(o)];if(h)switch(r){case"horizontal":return{x:h.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:h.coordinate}}}},TA=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var a;if(r==="hover"?a=e.itemInteraction.hover.graphicalItemId:a=e.itemInteraction.click.graphicalItemId,e.syncInteraction.active&&a==null)return e.tooltipItemPayloads;if(a==null&&(n!=null||e.keyboardInteraction.active)){var o=e.tooltipItemPayloads[0];return o!=null?[o]:[]}return e.tooltipItemPayloads.filter(u=>{var l;return((l=u.settings)===null||l===void 0?void 0:l.graphicalItemId)===a})},DA=e=>e.options.tooltipPayloadSearcher,Xs=e=>e.tooltip;function aS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function oS(e){for(var t=1;te(t)}function sS(e){if(typeof e=="string")return e}function zU(e){if(!(e==null||typeof e!="object")){var t="name"in e?RU(e.name):void 0,r="unit"in e?$U(e.unit):void 0,n="dataKey"in e?LU(e.dataKey):void 0,a="payload"in e?e.payload:void 0,o="color"in e?sS(e.color):void 0,u="fill"in e?sS(e.fill):void 0;return{name:t,unit:r,dataKey:n,payload:a,color:o,fill:u}}}function FU(e,t){return e??t}var RA=(e,t,r,n,a,o,u)=>{if(!(t==null||o==null)){var l=r.chartData,f=r.computedData,h=r.dataStartIndex,p=r.dataEndIndex,v=[];return e.reduce((x,b)=>{var k,j=b.dataDefinedOnItem,S=b.settings,N=FU(j,l),P=Array.isArray(N)?sP(N,h,p):N,O=(k=S==null?void 0:S.dataKey)!==null&&k!==void 0?k:n,C=S==null?void 0:S.nameKey,_;if(n&&Array.isArray(P)&&!Array.isArray(P[0])&&u==="axis"?_=mE(P,n,a):_=o(P,t,f,C),Array.isArray(_))_.forEach(I=>{var $,B,K=zU(I),q=K==null?void 0:K.name,R=K==null?void 0:K.dataKey,de=K==null?void 0:K.payload,Z=oS(oS({},S),{},{name:q,unit:K==null?void 0:K.unit,color:($=K==null?void 0:K.color)!==null&&$!==void 0?$:S==null?void 0:S.color,fill:(B=K==null?void 0:K.fill)!==null&&B!==void 0?B:S==null?void 0:S.fill});x.push(tk({tooltipEntrySettings:Z,dataKey:R,payload:de,value:Tt(de,R),name:q==null?void 0:String(q)}))});else{var A;x.push(tk({tooltipEntrySettings:S,dataKey:O,payload:_,value:Tt(_,O),name:(A=Tt(_,C))!==null&&A!==void 0?A:S==null?void 0:S.name}))}return x},v)}},C0=G([Ct,BC,Fy],RC),BU=G([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),UU=G([Rt,Gs],UC),bo=G([BU,Ct,UU],HC,{memoizeOptions:{resultEqualityCheck:$h}}),WU=G([bo],e=>e.filter(Vy)),$A=G([bo],VC,{memoizeOptions:{resultEqualityCheck:$h}}),HU=G([bo],e=>e.some(t=>!t.data)),fo=G([$A,pn],QC),KU=G([WU,pn,Ct],tC),A0=G([fo,Ct,bo,pn,HU,$A],YC),LA=G([Ct],w0),GU=G([Ct],e=>e.allowDataOverflow),zA=G([LA,GU],$P),VU=G([bo],e=>e.filter(Vy)),qU=G([KU,VU,_h,qP],ZC),QU=G([qU,pn,Rt,zA],eA),YU=G([bo],GC),XU=G([fo,Ct,YU,k0,Rt,oF],nA,{memoizeOptions:{resultEqualityCheck:Rh}}),ZU=G([iA,Rt,Gs],Qs),JU=G([ZU,Rt],sA),e7=G([aA,Rt,Gs],Qs),t7=G([e7,Rt],lA),r7=G([oA,Rt,Gs],Qs),n7=G([r7,Rt],uA),i7=G([JU,n7,t7],Uf),a7=G([Ct,LA,zA,QU,XU,i7,ut,Rt],cA),Ls=G([Ct,ut,fo,A0,_h,Rt,a7],dA),o7=G([Ls,Ct,C0],fA),s7=G([Ct,Ls,o7,Rt],hA),FA=e=>{var t=Rt(e),r=Gs(e),n=!1;return sc(e,t,r,n)},BA=G([Ct,FA],Mh),l7=G([Ct,C0,s7,BA],y0),UA=G([l7],qy),u7=G([ut,A0,Ct,Rt],wA),c7=G([ut,A0,Ct,Rt],yA),d7=(e,t,r,n,a,o,u,l)=>{if(t){var f=t.type,h=zn(e,l);if(n){var p=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,v=f==="category"&&n.bandwidth?n.bandwidth()/p:0;return v=l==="angleAxis"&&a!=null&&(a==null?void 0:a.length)>=2?Wr(a[0]-a[1])*2*v:v,h&&u?u.map((x,b)=>{var k=n.map(x);return Be(k)?{coordinate:k+v,value:x,index:b,offset:v}:null}).filter(xr):n.domain().map((x,b)=>{var k=n.map(x);return Be(k)?{coordinate:k+v,value:o?o[x]:x,index:b,offset:v}:null}).filter(xr)}}},yi=G([ut,Ct,C0,UA,FA,u7,c7,Rt],d7),O0=G([NA,EA,vU],(e,t,r)=>PA(r.shared,e,t)),WA=e=>e.tooltip.settings.trigger,_0=e=>e.tooltip.settings.defaultIndex,uc=G([Xs,O0,WA,_0],MA),Lu=G([uc,fo,$s,Ls],du),HA=G([yi,Lu],CA),f7=G([uc],e=>{if(e)return e.dataKey}),h7=G([uc],e=>{if(e)return e.graphicalItemId}),KA=G([Xs,O0,WA,_0],TA),p7=G([hi,pi,ut,Vt,yi,_0,KA],IA),m7=G([uc,p7],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),v7=G([uc],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),g7=G([KA,Lu,pn,$s,HA,DA,O0],RA),y7=G([g7],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function lS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function uS(e){for(var t=1;tAe(Ct),j7=()=>{var e=k7(),t=Ae(yi),r=Ae(UA);return xf(!e||!r?void 0:uS(uS({},e),{},{scale:r}),t)};function cS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Jo(e){for(var t=1;t{var a=t.find(o=>o&&o.index===r);if(a){if(e==="horizontal")return{x:a.coordinate,y:n.relativeY};if(e==="vertical")return{x:n.relativeX,y:a.coordinate}}return{x:0,y:0}},C7=(e,t,r,n)=>{var a=t.find(h=>h&&h.index===r);if(a){if(e==="centric"){var o=a.coordinate,u=n.radius;return Jo(Jo(Jo({},n),Ht(n.cx,n.cy,u,o)),{},{angle:o,radius:u})}var l=a.coordinate,f=n.angle;return Jo(Jo(Jo({},n),Ht(n.cx,n.cy,l,f)),{},{angle:f,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 A7(e,t){var r=e.relativeX,n=e.relativeY;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var GA=(e,t,r,n,a)=>{var o,u=(o=t==null?void 0:t.length)!==null&&o!==void 0?o:0;if(u<=1||e==null)return 0;if(n==="angleAxis"&&a!=null&&Math.abs(Math.abs(a[1]-a[0])-360)<=1e-6)for(var l=0;l0?(f=r[l-1])===null||f===void 0?void 0:f.coordinate:(h=r[u-1])===null||h===void 0?void 0:h.coordinate,k=(p=r[l])===null||p===void 0?void 0:p.coordinate,j=l>=u-1?(v=r[0])===null||v===void 0?void 0:v.coordinate:(x=r[l+1])===null||x===void 0?void 0:x.coordinate,S=void 0;if(!(b==null||k==null||j==null))if(Wr(k-b)!==Wr(j-k)){var N=[];if(Wr(j-k)===Wr(a[1]-a[0])){S=j;var P=k+a[1]-a[0];N[0]=Math.min(P,(P+b)/2),N[1]=Math.max(P,(P+b)/2)}else{S=b;var O=j+a[1]-a[0];N[0]=Math.min(k,(O+k)/2),N[1]=Math.max(k,(O+k)/2)}var C=[Math.min(k,(S+k)/2),Math.max(k,(S+k)/2)];if(e>C[0]&&e<=C[1]||e>=N[0]&&e<=N[1]){var _;return(_=r[l])===null||_===void 0?void 0:_.index}}else{var A=Math.min(b,j),I=Math.max(b,j);if(e>(A+k)/2&&e<=(I+k)/2){var $;return($=r[l])===null||$===void 0?void 0:$.index}}}else if(t)for(var B=0;B(K.coordinate+R.coordinate)/2||B>0&&B(K.coordinate+R.coordinate)/2&&e<=(K.coordinate+q.coordinate)/2)return K.index}}return-1},VA=()=>Ae(Fy),M0=(e,t)=>t,qA=(e,t,r)=>r,I0=(e,t,r,n)=>n,O7=G(yi,e=>ch(e,t=>t.coordinate)),T0=G([Xs,M0,qA,I0],MA),D0=G([T0,fo,$s,Ls],du),_7=(e,t,r)=>{if(t!=null){var n=Xs(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},QA=G([Xs,M0,qA,I0],TA),Hf=G([hi,pi,ut,Vt,yi,I0,QA],IA),M7=G([T0,Hf],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),YA=G([yi,D0],CA),I7=G([QA,D0,pn,$s,YA,DA,M0],RA),T7=G([T0,D0],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),D7=(e,t,r,n,a,o,u)=>{if(!(!e||!r||!n||!a)&&A7(e,u)){var l=q$(e,t),f=GA(l,o,a,r,n),h=P7(t,a,f,e);return{activeIndex:String(f),activeCoordinate:h}}},R7=(e,t,r,n,a,o,u)=>{if(!(!e||!n||!a||!o||!r)){var l=X6(e,r);if(l){var f=Q$(l,t),h=GA(f,u,o,n,a),p=C7(t,o,h,l);return{activeIndex:String(h),activeCoordinate:p}}}},$7=(e,t,r,n,a,o,u,l)=>{if(!(!e||!t||!n||!a||!o))return t==="horizontal"||t==="vertical"?D7(e,t,n,a,o,u,l):R7(e,t,r,n,a,o,u)},L7=G(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),z7=G(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(or)),r=Array.from(new Set(t));return r.sort((n,a)=>n-a)},{memoizeOptions:{resultEqualityCheck:CF}});function dS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function fS(e){for(var t=1;tfS(fS({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),W7)},K7=new Set(Object.values(or));function G7(e){return K7.has(e)}var XA=rr({name:"zIndex",initialState:H7,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:at()},unregisterZIndexPortal:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!G7(r)&&delete e.zIndexMap[r])},prepare:at()},registerZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload,n=r.zIndex,a=r.element,o=r.isPanorama;e.zIndexMap[n]?o?e.zIndexMap[n].panoramaElement=a:e.zIndexMap[n].element=a:e.zIndexMap[n]={consumers:0,element:o?void 0:a,panoramaElement:o?a:void 0}},prepare:at()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var r=t.payload.zIndex;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:at()}}}),Vh=XA.actions,V7=Vh.registerZIndexPortal,wv=Vh.unregisterZIndexPortal,q7=Vh.registerZIndexPortalElement,Q7=Vh.unregisterZIndexPortalElement,Y7=XA.reducer;function xi(e){var t=e.zIndex,r=e.children,n=IL(),a=n&&t!==void 0&&t!==0,o=wr(),u=y.useRef(void 0),l=y.useRef(new Set),f=kt(),h=Ae(v=>L7(v,t,o));if(y.useLayoutEffect(()=>{if(!a){var v=l.current;v.forEach(b=>{f(wv({zIndex:b}))}),v.clear(),u.current=void 0;return}if(l.current.has(t)||(f(V7({zIndex:t})),l.current.add(t)),h){u.current=h;var x=l.current;x.forEach(b=>{b!==t&&(f(wv({zIndex:b})),x.delete(b))})}},[f,t,a,h]),y.useLayoutEffect(()=>{var v=l.current;return()=>{v.forEach(x=>{f(wv({zIndex:x}))}),v.clear()}},[f]),!a)return r;var p=h??u.current;return p?th.createPortal(r,p):null}function Wg(){return Wg=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.useContext(ZA),kv={exports:{}},pS;function iW(){return pS||(pS=1,(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(f,h,p){this.fn=f,this.context=h,this.once=p||!1}function o(f,h,p,v,x){if(typeof p!="function")throw new TypeError("The listener must be a function");var b=new a(p,v||f,x),k=r?r+h:h;return f._events[k]?f._events[k].fn?f._events[k]=[f._events[k],b]:f._events[k].push(b):(f._events[k]=b,f._eventsCount++),f}function u(f,h){--f._eventsCount===0?f._events=new n:delete f._events[h]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var h=[],p,v;if(this._eventsCount===0)return h;for(v in p=this._events)t.call(p,v)&&h.push(r?v.slice(1):v);return Object.getOwnPropertySymbols?h.concat(Object.getOwnPropertySymbols(p)):h},l.prototype.listeners=function(h){var p=r?r+h:h,v=this._events[p];if(!v)return[];if(v.fn)return[v.fn];for(var x=0,b=v.length,k=new Array(b);x{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!Tn(r))return e[r]}},lW={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},JA=rr({name:"options",initialState:lW,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),uW=JA.reducer,cW=JA.actions.createEventEmitter;function dW(e){return e.tooltip.syncInteraction}var fW={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},eO=rr({name:"chartData",initialState:fW,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 r=t.payload,n=r.startIndex,a=r.endIndex;n!=null&&(e.dataStartIndex=n),a!=null&&(e.dataEndIndex=a)}}}),R0=eO.actions,vS=R0.setChartData,hW=R0.setDataStartEndIndexes;R0.setComputedData;var pW=eO.reducer,mW=["x","y"];function gS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function es(e){for(var t=1;tf.rootProps.className);y.useEffect(()=>{if(e==null)return Us;var f=(h,p,v)=>{if(t!==v&&e===h){if(p.payload.active===!1){r(lu({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(n==="index"){var x;if(u&&p!==null&&p!==void 0&&(x=p.payload)!==null&&x!==void 0&&x.coordinate&&p.payload.sourceViewBox){var b=p.payload.coordinate,k=b.x,j=b.y,S=xW(b,mW),N=p.payload.sourceViewBox,P=N.x,O=N.y,C=N.width,_=N.height,A=es(es({},S),{},{x:u.x+(C?(k-P)/C:0)*u.width,y:u.y+(_?(j-O)/_:0)*u.height});r(es(es({},p),{},{payload:es(es({},p.payload),{},{coordinate:A})}))}else r(p);return}if(a!=null){var I;if(typeof n=="function"){var $={activeTooltipIndex:p.payload.index==null?void 0:Number(p.payload.index),isTooltipActive:p.payload.active,activeIndex:p.payload.index==null?void 0:Number(p.payload.index),activeLabel:p.payload.label,activeDataKey:p.payload.dataKey,activeCoordinate:p.payload.coordinate},B=n(a,$);I=a[B]}else n==="value"&&(I=a.find(me=>String(me.value)===p.payload.label));var K=p.payload.coordinate;if(K==null||u==null){r(lu({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(I==null){r(lu({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:void 0}));return}var q=K.x,R=K.y,de=Math.min(q,u.x+u.width),Z=Math.min(R,u.y+u.height),ge={x:o==="horizontal"?I.coordinate:de,y:o==="horizontal"?Z:I.coordinate},ke=lu({active:p.payload.active,coordinate:ge,dataKey:p.payload.dataKey,index:String(I.index),label:p.payload.label,sourceViewBox:p.payload.sourceViewBox,graphicalItemId:p.payload.graphicalItemId});r(ke)}}};return zu.on(Hg,f),()=>{zu.off(Hg,f)}},[l,r,t,e,n,a,o,u])}function kW(){var e=Ae(By),t=Ae(Uy),r=kt();y.useEffect(()=>{if(e==null)return Us;var n=(a,o,u)=>{t!==u&&e===a&&r(hW(o))};return zu.on(mS,n),()=>{zu.off(mS,n)}},[r,t,e])}function jW(){var e=kt();y.useEffect(()=>{e(cW())},[e]),wW(),kW()}function SW(e,t,r,n,a,o){var u=Ae(k=>_7(k,e,t)),l=Ae(h7),f=Ae(Uy),h=Ae(By),p=Ae(QP),v=Ae(dW),x=(v==null?void 0:v.sourceViewBox)!=null,b=Nh();y.useEffect(()=>{if(!x&&h!=null&&f!=null){var k=lu({active:o,coordinate:r,dataKey:u,index:a,label:typeof n=="number"?String(n):n,sourceViewBox:b,graphicalItemId:l});zu.emit(Hg,h,k,f)}},[x,r,u,l,a,n,f,h,p,o,b])}function yS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function xS(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r{I(wU({shared:P,trigger:O,axisId:A,active:a,defaultIndex:$}))},[I,P,O,A,a,$]);var B=Nh(),K=CP(),q=mU(P),R=(t=Ae(_e=>T7(_e,q,O,$)))!==null&&t!==void 0?t:{},de=R.activeIndex,Z=R.isActive,ge=Ae(_e=>I7(_e,q,O,$)),ke=Ae(_e=>YA(_e,q,O,$)),me=Ae(_e=>M7(_e,q,O,$)),Q=ge,oe=nW(),X=(r=a??Z)!==null&&r!==void 0?r:!1,L=TR([Q,X]),T=CW(L,2),ee=T[0],ne=T[1],te=q==="axis"?ke:void 0;SW(q,O,me,te,de,X);var ue=_??oe;if(ue==null||B==null||q==null)return null;var pe=Q??wS;X||(pe=wS),h&&pe.length&&(pe=nR(pe.filter(_e=>_e.value!=null&&(_e.hide!==!0||n.includeHidden)),x,IW));var Oe=pe.length>0,J=xS(xS({},n),{},{payload:pe,label:te,active:X,activeIndex:de,coordinate:me,accessibilityLayer:K}),je=y.createElement(Kz,{allowEscapeViewBox:o,animationDuration:u,animationEasing:l,isAnimationActive:p,active:X,coordinate:me,hasPayload:Oe,offset:v,position:b,reverseDirection:k,useTranslate3d:j,viewBox:B,wrapperStyle:S,lastBoundingBox:ee,innerRef:ne,hasPortalFromProps:!!_},TW(f,J));return y.createElement(y.Fragment,null,th.createPortal(je,ue),X&&y.createElement(rW,{cursor:N,tooltipEventType:q,coordinate:me,payload:pe,index:de}))}function $W(e,t,r){return(t=LW(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function LW(e){var t=zW(e,"string");return typeof t=="symbol"?t:t+""}function zW(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class FW{constructor(t){$W(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function kS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function BW(e){for(var t=1;t{try{var r=document.getElementById(SS);r||(r=document.createElement("span"),r.setAttribute("id",SS),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,GW,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},fu=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||ec.isSsr)return{width:0,height:0};if(!tO.enableCache)return NS(t,r);var n=VW(t,r),a=jS.get(n);if(a)return a;var o=NS(t,r);return jS.set(n,o),o},rO;function Kf(e,t){return XW(e)||YW(e,t)||QW(e,t)||qW()}function qW(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function QW(e,t){if(e){if(typeof e=="string")return ES(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ES(e,t):void 0}}function ES(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=e.breakAll,n=e.style;try{var a=[];Kt(t)||(r?a=t.toString().split(""):a=t.toString().split(iO));var o=a.map(l=>({word:l,width:fu(l,n).width})),u=r?0:fu(" ",n).width;return{wordsWithComputedWidth:o,spaceWidth:u}}catch{return null}};function oO(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}function gH(e){return Kt(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean"}var sO=(e,t,r,n)=>e.reduce((a,o)=>{var u=o.word,l=o.width,f=a[a.length-1];if(f&&l!=null&&(t==null||n||f.width+l+re.reduce((t,r)=>t.width>r.width?t:r),yH="…",IS=(e,t,r,n,a,o,u,l)=>{var f=e.slice(0,t),h=aO({breakAll:r,style:n,children:f+yH});if(!h)return[!1,[]];var p=sO(h.wordsWithComputedWidth,o,u,l),v=p.length>a||lO(p).width>Number(o);return[v,p]},xH=(e,t,r,n,a)=>{var o=e.maxLines,u=e.children,l=e.style,f=e.breakAll,h=Ne(o),p=String(u),v=sO(t,n,r,a);if(!h||a)return v;var x=v.length>o||lO(v).width>Number(n);if(!x)return v;for(var b=0,k=p.length-1,j=0,S;b<=k&&j<=p.length-1;){var N=Math.floor((b+k)/2),P=N-1,O=IS(p,P,f,l,o,n,r,a),C=_S(O,2),_=C[0],A=C[1],I=IS(p,N,f,l,o,n,r,a),$=_S(I,1),B=$[0];if(!_&&!B&&(b=N+1),_&&B&&(k=N-1),!_&&B){S=A;break}j++}return S||v},TS=e=>{var t=Kt(e)?[]:e.toString().split(iO);return[{words:t,width:void 0}]},bH=e=>{var t=e.width,r=e.scaleToFit,n=e.children,a=e.style,o=e.breakAll,u=e.maxLines;if((t||r)&&!ec.isSsr){var l,f,h=aO({breakAll:o,children:n,style:a});if(h){var p=h.wordsWithComputedWidth,v=h.spaceWidth;l=p,f=v}else return TS(n);return xH({breakAll:o,children:n,maxLines:u,style:a},l,f,t,!!r)}return TS(n)},uO="#808080",wH={angle:0,breakAll:!1,capHeight:"0.71em",fill:uO,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},$0=y.forwardRef((e,t)=>{var r=Qr(e,wH),n=r.x,a=r.y,o=r.lineHeight,u=r.capHeight,l=r.fill,f=r.scaleToFit,h=r.textAnchor,p=r.verticalAnchor,v=OS(r,cH),x=y.useMemo(()=>bH({breakAll:v.breakAll,children:v.children,maxLines:v.maxLines,scaleToFit:f,style:v.style,width:v.width}),[v.breakAll,v.children,v.maxLines,f,v.style,v.width]),b=v.dx,k=v.dy,j=v.angle,S=v.className,N=v.breakAll,P=OS(v,dH);if(!Dn(n)||!Dn(a)||x.length===0)return null;var O=Number(n)+(Ne(b)?b:0),C=Number(a)+(Ne(k)?k:0);if(!Be(O)||!Be(C))return null;var _;switch(p){case"start":_=jv("calc(".concat(u,")"));break;case"middle":_=jv("calc(".concat((x.length-1)/2," * -").concat(o," + (").concat(u," / 2))"));break;default:_=jv("calc(".concat(x.length-1," * -").concat(o,")"));break}var A=[],I=x[0];if(f&&I!=null){var $=I.width,B=v.width;A.push("scale(".concat(Ne(B)&&Ne($)?B/$:1,")"))}return j&&A.push("rotate(".concat(j,", ").concat(O,", ").concat(C,")")),A.length&&(P.transform=A.join(" ")),y.createElement("text",Kg({},Gr(P),{ref:t,x:O,y:C,className:et("recharts-text",S),textAnchor:h,fill:l.includes("url")?uO:l}),x.map((K,q)=>{var R=K.words.join(N?"":" ");return y.createElement("tspan",{x:O,dy:q===0?_:o,key:"".concat(R,"-").concat(q)},R)}))});$0.displayName="Text";function DS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function jn(e){for(var t=1;t{var t=e.viewBox,r=e.position,n=e.offset,a=n===void 0?0:n,o=e.parentViewBox,u=_y(t),l=u.x,f=u.y,h=u.height,p=u.upperWidth,v=u.lowerWidth,x=l,b=l+(p-v)/2,k=(x+b)/2,j=(p+v)/2,S=x+p/2,N=h>=0?1:-1,P=N*a,O=N>0?"end":"start",C=N>0?"start":"end",_=p>=0?1:-1,A=_*a,I=_>0?"end":"start",$=_>0?"start":"end",B=o;if(r==="top"){var K={x:x+p/2,y:f-P,horizontalAnchor:"middle",verticalAnchor:O};return B&&(K.height=Math.max(f-B.y,0),K.width=p),K}if(r==="bottom"){var q={x:b+v/2,y:f+h+P,horizontalAnchor:"middle",verticalAnchor:C};return B&&(q.height=Math.max(B.y+B.height-(f+h),0),q.width=v),q}if(r==="left"){var R={x:k-A,y:f+h/2,horizontalAnchor:I,verticalAnchor:"middle"};return B&&(R.width=Math.max(R.x-B.x,0),R.height=h),R}if(r==="right"){var de={x:k+j+A,y:f+h/2,horizontalAnchor:$,verticalAnchor:"middle"};return B&&(de.width=Math.max(B.x+B.width-de.x,0),de.height=h),de}var Z=B?{width:j,height:h}:{};return r==="insideLeft"?jn({x:k+A,y:f+h/2,horizontalAnchor:$,verticalAnchor:"middle"},Z):r==="insideRight"?jn({x:k+j-A,y:f+h/2,horizontalAnchor:I,verticalAnchor:"middle"},Z):r==="insideTop"?jn({x:x+p/2,y:f+P,horizontalAnchor:"middle",verticalAnchor:C},Z):r==="insideBottom"?jn({x:b+v/2,y:f+h-P,horizontalAnchor:"middle",verticalAnchor:O},Z):r==="insideTopLeft"?jn({x:x+A,y:f+P,horizontalAnchor:$,verticalAnchor:C},Z):r==="insideTopRight"?jn({x:x+p-A,y:f+P,horizontalAnchor:I,verticalAnchor:C},Z):r==="insideBottomLeft"?jn({x:b+A,y:f+h-P,horizontalAnchor:$,verticalAnchor:O},Z):r==="insideBottomRight"?jn({x:b+v-A,y:f+h-P,horizontalAnchor:I,verticalAnchor:O},Z):r&&typeof r=="object"&&(Ne(r.x)||oo(r.x))&&(Ne(r.y)||oo(r.y))?jn({x:l+da(r.x,j),y:f+da(r.y,h),horizontalAnchor:"end",verticalAnchor:"end"},Z):jn({x:S,y:f+h/2,horizontalAnchor:"middle",verticalAnchor:"middle"},Z)},EH=["labelRef"],PH=["content"];function RS(e,t){if(e==null)return{};var r,n,a=CH(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var t=e.x,r=e.y,n=e.upperWidth,a=e.lowerWidth,o=e.width,u=e.height,l=e.children,f=y.useMemo(()=>({x:t,y:r,upperWidth:n,lowerWidth:a,width:o,height:u}),[t,r,n,a,o,u]);return y.createElement(cO.Provider,{value:f},l)},dO=()=>{var e=y.useContext(cO),t=Nh();return e||(t?_y(t):void 0)},IH=y.createContext(null),TH=()=>{var e=y.useContext(IH),t=Ae(eC);return e||t},DH=e=>{var t=e.value,r=e.formatter,n=Kt(e.children)?t:e.children;return typeof r=="function"?r(n):n},L0=e=>e!=null&&typeof e=="function",RH=(e,t)=>{var r=Wr(t-e),n=Math.min(Math.abs(t-e),360);return r*n},$H=(e,t,r,n,a)=>{var o=e.offset,u=e.className,l=a.cx,f=a.cy,h=a.innerRadius,p=a.outerRadius,v=a.startAngle,x=a.endAngle,b=a.clockWise,k=(h+p)/2,j=RH(v,x),S=j>=0?1:-1,N,P;switch(t){case"insideStart":N=v+S*o,P=b;break;case"insideEnd":N=x-S*o,P=!b;break;case"end":N=x+S*o,P=b;break;default:throw new Error("Unsupported position ".concat(t))}P=j<=0?P:!P;var O=Ht(l,f,k,N),C=Ht(l,f,k,N+(P?1:-1)*359),_="M".concat(O.x,",").concat(O.y,` + A`).concat(k,",").concat(k,",0,1,").concat(P?0:1,`, + `).concat(C.x,",").concat(C.y),A=Kt(e.id)?Nu("recharts-radial-line-"):e.id;return y.createElement("text",ri({},n,{dominantBaseline:"central",className:et("recharts-radial-bar-label",u)}),y.createElement("defs",null,y.createElement("path",{id:A,d:_})),y.createElement("textPath",{xlinkHref:"#".concat(A)},r))},LH=(e,t,r)=>{var n=e.cx,a=e.cy,o=e.innerRadius,u=e.outerRadius,l=e.startAngle,f=e.endAngle,h=(l+f)/2;if(r==="outside"){var p=Ht(n,a,u+t,h),v=p.x,x=p.y;return{x:v,y:x,textAnchor:v>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:a,textAnchor:"middle",verticalAnchor:"end"};var b=(o+u)/2,k=Ht(n,a,b,h),j=k.x,S=k.y;return{x:j,y:S,textAnchor:"middle",verticalAnchor:"middle"}},ef=e=>e!=null&&"cx"in e&&Ne(e.cx),zH={angle:0,offset:5,zIndex:or.label,position:"middle",textBreakAll:!1};function FH(e){if(!ef(e))return e;var t=e.cx,r=e.cy,n=e.outerRadius,a=n*2;return{x:t-n,y:r-n,width:a,upperWidth:a,lowerWidth:a,height:a}}function qi(e){var t=Qr(e,zH),r=t.viewBox,n=t.parentViewBox,a=t.position,o=t.value,u=t.children,l=t.content,f=t.className,h=f===void 0?"":f,p=t.textBreakAll,v=t.labelRef,x=TH(),b=dO(),k=a==="center"?b:x??b,j,S,N;r==null?j=k:ef(r)?j=r:j=_y(r);var P=FH(j);if(!j||Kt(o)&&Kt(u)&&!y.isValidElement(l)&&typeof l!="function")return null;var O=uu(uu({},t),{},{viewBox:j});if(y.isValidElement(l)){O.labelRef;var C=RS(O,EH);return y.cloneElement(l,C)}if(typeof l=="function"){O.content;var _=RS(O,PH);if(S=y.createElement(l,_),y.isValidElement(S))return S}else S=DH(t);var A=Gr(t);if(ef(j)){if(a==="insideStart"||a==="insideEnd"||a==="end")return $H(t,a,S,A,j);N=LH(j,t.offset,t.position)}else{if(!P)return null;var I=NH({viewBox:P,position:a,offset:t.offset,parentViewBox:ef(n)?void 0:n});N=uu(uu({x:I.x,y:I.y,textAnchor:I.horizontalAnchor,verticalAnchor:I.verticalAnchor},I.width!==void 0?{width:I.width}:{}),I.height!==void 0?{height:I.height}:{})}return y.createElement(xi,{zIndex:t.zIndex},y.createElement($0,ri({ref:v,className:et("recharts-label",h)},A,N,{textAnchor:oO(A.textAnchor)?A.textAnchor:N.textAnchor,breakAll:p}),S))}qi.displayName="Label";var BH=(e,t,r)=>{if(!e)return null;var n={viewBox:t,labelRef:r};return e===!0?y.createElement(qi,ri({key:"label-implicit"},n)):Dn(e)?y.createElement(qi,ri({key:"label-implicit",value:e},n)):y.isValidElement(e)?e.type===qi?y.cloneElement(e,uu({key:"label-implicit"},n)):y.createElement(qi,ri({key:"label-implicit",content:e},n)):L0(e)?y.createElement(qi,ri({key:"label-implicit",content:e},n)):e&&typeof e=="object"?y.createElement(qi,ri({},e,{key:"label-implicit"},n)):null};function UH(e){var t=e.label,r=e.labelRef,n=dO();return BH(t,n,r)||null}var WH=["valueAccessor"],HH=["dataKey","clockWise","id","textBreakAll","zIndex"];function Gf(){return Gf=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=Array.isArray(e.value)?e.value[e.value.length-1]:e.value;if(gH(t))return t},fO=y.createContext(void 0),VH=fO.Provider,hO=y.createContext(void 0);hO.Provider;function qH(){return y.useContext(fO)}function QH(){return y.useContext(hO)}function tf(e){var t=e.valueAccessor,r=t===void 0?GH:t,n=LS(e,WH),a=n.dataKey;n.clockWise;var o=n.id,u=n.textBreakAll,l=n.zIndex,f=LS(n,HH),h=qH(),p=QH(),v=h||p;return!v||!v.length?null:y.createElement(xi,{zIndex:l??or.label},y.createElement(Vr,{className:"recharts-label-list"},v.map((x,b)=>{var k,j=Kt(a)?r(x,b):Tt(x.payload,a),S=Kt(o)?{}:{id:"".concat(o,"-").concat(b)};return y.createElement(qi,Gf({key:"label-".concat(b)},Gr(x),f,S,{fill:(k=n.fill)!==null&&k!==void 0?k:x.fill,parentViewBox:x.parentViewBox,value:j,textBreakAll:u,viewBox:x.viewBox,index:b,zIndex:0}))})))}tf.displayName="LabelList";function YH(e){var t=e.label;return t?t===!0?y.createElement(tf,{key:"labelList-implicit"}):y.isValidElement(t)||L0(t)?y.createElement(tf,{key:"labelList-implicit",content:t}):typeof t=="object"?y.createElement(tf,Gf({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function Gg(){return Gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t=e.cx,r=e.cy,n=e.r,a=e.className,o=et("recharts-dot",a);return Ne(t)&&Ne(r)&&Ne(n)?y.createElement("circle",Gg({},dn(e),wy(e),{className:o,cx:t,cy:r,r:n})):null},XH={radiusAxis:{},angleAxis:{}},mO=rr({name:"polarAxis",initialState:XH,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]}}}),qh=mO.actions;qh.addRadiusAxis;qh.removeRadiusAxis;qh.addAngleAxis;qh.removeAngleAxis;var ZH=mO.reducer;function JH(e){return e&&typeof e=="object"&&"className"in e&&typeof e.className=="string"?e.className:""}var vO=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0;function zS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function FS(e){for(var t=1;t{n||(a.current===null?r(yU(t)):a.current!==t&&r(xU({prev:a.current,next:t})),a.current=t)},[t,r,n]),y.useLayoutEffect(()=>()=>{a.current&&(r(bU(a.current)),a.current=null)},[r]),null}function uK(e){var t=e.legendPayload,r=kt(),n=wr(),a=y.useRef(null);return y.useLayoutEffect(()=>{n||(a.current===null?r(GL(t)):a.current!==t&&r(VL({prev:a.current,next:t})),a.current=t)},[r,n,t]),y.useLayoutEffect(()=>()=>{a.current&&(r(qL(a.current)),a.current=null)},[r]),null}function cK(e,t){return pK(e)||hK(e,t)||fK(e,t)||dK()}function dK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fK(e,t){if(e){if(typeof e=="string")return BS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?BS(e,t):void 0}}function BS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r2&&arguments[2]!==void 0?arguments[2]:[],n=[];for(var a of r)n.push({status:"removed",prev:a});for(var o=0;oe[Math.floor(o*r)]);return F0(n,t)}function gK(e,t){var r=t.map((n,a)=>e[a]);return F0(r,t)}function yK(e,t){for(var r=new Map,n=0;n{var b=r(v,x);if(b!=null){var k=n.get(b);if(k!==void 0)return a.add(b),k}}),u=[];for(var l of n){var f=cK(l,2),h=f[0],p=f[1];a.has(h)||u.push(p)}return F0(o,t,u)}function Vg(e,t,r){return t==null?null:e==null?t.map(n=>({status:"added",next:n})):r===z0?vK(e,t):r===mK?gK(e,t):xK(e,t,r)}function yO(e,t){var r=y.useRef(e),n=y.useRef(t.current),a=y.useRef(!0);r.current!==e&&(r.current=e,n.current=t.current,a.current=!1);var o=y.useCallback(function(u,l){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(l===0){a.current=!0;return}l===1&&(n.current=u),l>0&&a.current&&f&&(t.current=u)},[t]);return{startValue:n.current,syncStepValue:o}}function bK(e,t){return SK(e)||jK(e,t)||kK(e,t)||wK()}function wK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kK(e,t){if(e){if(typeof e=="string")return US(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?US(e,t):void 0}}function US(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{typeof e=="function"&&e(),o(!0)},[e]),l=y.useCallback(()=>{typeof t=="function"&&t(),o(!1)},[t]);return{isAnimating:a,handleAnimationStart:u,handleAnimationEnd:l}}function EK(e){var t,r=e.animationInput,n=e.animationIdPrefix,a=e.items,o=e.previousItemsRef,u=e.isAnimationActive,l=e.animationBegin,f=e.animationDuration,h=e.animationEasing,p=e.onAnimationStart,v=e.onAnimationEnd,x=e.animationInterpolateFn,b=e.animationMatchBy,k=e.shouldUpdatePreviousRef,j=e.children,S=e.layout,N=IP(r,n),P=yO(N,o),O=(t=P.startValue)!==null&&t!==void 0?t:null,C=Vg(O,a,b??z0);return y.createElement(MP,{animationId:N,begin:l,duration:f,isActive:u,easing:h,onAnimationEnd:v,onAnimationStart:p,key:N},_=>{var A=O==null,I=a==null?a:x(C,_,S),$=k?k(_):_>0;return P.syncStepValue(I,_,$),I==null?null:j(I,_,A)})}var Sv;function PK(e,t){return _K(e)||OK(e,t)||AK(e,t)||CK()}function CK(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function AK(e,t){if(e){if(typeof e=="string")return WS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?WS(e,t):void 0}}function WS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var e=y.useState(()=>Nu("uid-")),t=PK(e,1),r=t[0];return r},xO=(Sv=eh.useId)!==null&&Sv!==void 0?Sv:MK;function IK(e,t){var r=xO();return t||(e?"".concat(e,"-").concat(r):r)}var TK=y.createContext(void 0),DK=e=>{var t=e.id,r=e.type,n=e.children,a=IK("recharts-".concat(r),t);return y.createElement(TK.Provider,{value:a},n(a))},RK={cartesianItems:[],polarItems:[]},bO=rr({name:"graphicalItems",initialState:RK,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:at()},replaceCartesianGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).cartesianItems.indexOf(n);o>-1&&(e.cartesianItems[o]=a)},prepare:at()},removeCartesianGraphicalItem:{reducer(e,t){var r=Hr(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:at()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:at()},removePolarGraphicalItem:{reducer(e,t){var r=Hr(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:at()},replacePolarGraphicalItem:{reducer(e,t){var r=t.payload,n=r.prev,a=r.next,o=Hr(e).polarItems.indexOf(n);o>-1&&(e.polarItems[o]=a)},prepare:at()}}}),Zs=bO.actions,$K=Zs.addCartesianGraphicalItem,LK=Zs.replaceCartesianGraphicalItem,zK=Zs.removeCartesianGraphicalItem;Zs.addPolarGraphicalItem;Zs.removePolarGraphicalItem;Zs.replacePolarGraphicalItem;var FK=bO.reducer,BK=e=>{var t=kt(),r=y.useRef(null);return y.useLayoutEffect(()=>{r.current===null?t($K(e)):r.current!==e&&t(LK({prev:r.current,next:e})),r.current=e},[t,e]),y.useLayoutEffect(()=>()=>{r.current&&(t(zK(r.current)),r.current=null)},[t]),null},UK=y.memo(BK),WK=["points"];function HS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Nv(e){for(var t=1;t{var N,P,O=Nv(Nv(Nv({r:3},u),x),{},{index:S,cx:(N=j.x)!==null&&N!==void 0?N:void 0,cy:(P=j.y)!==null&&P!==void 0?P:void 0,dataKey:o,value:j.value,payload:j.payload,points:t});return y.createElement(QK,{key:"dot-".concat(S),option:r,dotProps:O,className:a})}),k={};return l&&f!=null&&(k.clipPath="url(#clipPath-".concat(v?"":"dots-").concat(f,")")),y.createElement(xi,{zIndex:p},y.createElement(Vr,Vf({className:n},k),b))}function KS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function GS(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),dG=G([cG,hi,pi],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),B0=()=>Ae(dG),fG=()=>Ae(y7);function VS(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function Ev(e){for(var t=1;t{var t=e.point,r=e.childIndex,n=e.mainColor,a=e.activeDot,o=e.dataKey,u=e.clipPath;if(a===!1||t.x==null||t.y==null)return null;var l={index:r,dataKey:o,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},f=Ev(Ev(Ev({},l),sh(a)),wy(a)),h;return y.isValidElement(a)?h=y.cloneElement(a,f):typeof a=="function"?h=a(f):h=y.createElement(pO,f),y.createElement(Vr,{className:"recharts-active-dot",clipPath:u},h)};function qS(e){var t=e.points,r=e.mainColor,n=e.activeDot,a=e.itemDataKey,o=e.clipPath,u=e.zIndex,l=u===void 0?or.activeDot:u,f=Ae(Lu),h=fG();if(t==null||h==null)return null;var p=t.find(v=>h.includes(v.payload));return Kt(p)?null:y.createElement(xi,{zIndex:l},y.createElement(vG,{point:p,childIndex:Number(f),mainColor:r,dataKey:a,activeDot:n,clipPath:o}))}var gG=e=>{var t=e.chartData,r=kt(),n=wr();return y.useEffect(()=>n?()=>{}:(r(vS(t)),()=>{r(vS(void 0))}),[t,r,n]),null},QS={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},jO=rr({name:"brush",initialState:QS,reducers:{setBrushSettings(e,t){return t.payload==null?QS:t.payload}}});jO.actions.setBrushSettings;var yG=jO.reducer;function xG(e){return(e%180+180)%180}var bG=function(t){var r=t.width,n=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=xG(a),u=o*Math.PI/180,l=Math.atan(n/r),f=u>l&&u{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Hr(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Hr(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Hr(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),Js=SO.actions;Js.addDot;Js.removeDot;Js.addArea;Js.removeArea;Js.addLine;Js.removeLine;var kG=SO.reducer;function jG(e,t){return PG(e)||EG(e,t)||NG(e,t)||SG()}function SG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function NG(e,t){if(e){if(typeof e=="string")return YS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?YS(e,t):void 0}}function YS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{var t=e.children,r=y.useState("".concat(Nu("recharts"),"-clip")),n=jG(r,1),a=n[0],o=B0();if(o==null)return null;var u=o.x,l=o.y,f=o.width,h=o.height;return y.createElement(CG.Provider,{value:a},y.createElement("defs",null,y.createElement("clipPath",{id:a},y.createElement("rect",{x:u,y:l,height:h,width:f}))),t)};function NO(e,t){if(t<1)return[];if(t===1)return e;for(var r=[],n=0;ne*a)return!1;var o=r();return e*(t-e*o/2-n)>=0&&e*(t+e*o/2-a)<=0}function MG(e,t){return NO(e,t+1)}function IG(e,t,r,n,a){for(var o=(n||[]).slice(),u=t.start,l=t.end,f=0,h=1,p=u,v=function(){var k=n==null?void 0:n[f];if(k===void 0)return{v:NO(n,h)};var j=f,S,N=()=>(S===void 0&&(S=r(k,j)),S),P=k.coordinate,O=f===0||Fu(e,P,N,p,l);O||(f=0,p=u,h+=1),O&&(p=P+e*(N()/2+a),f+=h)},x;h<=o.length;)if(x=v(),x)return x.v;return[]}function TG(e,t,r,n,a){var o=(n||[]).slice(),u=o.length;if(u===0)return[];for(var l=t.start,f=t.end,h=1;h<=u;h++){for(var p=(u-1)%h,v=l,x=!0,b=function(){var C=n[j];if(C==null)return 0;var _=j,A,I=()=>(A===void 0&&(A=r(C,_)),A),$=C.coordinate,B=j===p||Fu(e,$,I,v,f);if(!B)return x=!1,1;B&&(v=$+e*(I()/2+a))},k,j=p;j(j===void 0&&(j=r(b,x)),j);if(x===u-1){var N=e*(k.coordinate+e*S()/2-f);o[x]=k=er(er({},k),{},{tickCoord:N>0?k.coordinate-N*e:k.coordinate})}else o[x]=k=er(er({},k),{},{tickCoord:k.coordinate});if(k.tickCoord!=null){var P=Fu(e,k.tickCoord,S,l,f);P&&(f=k.tickCoord-e*(S()/2+a),o[x]=er(er({},k),{},{isShow:!0}))}},p=u-1;p>=0;p--)h(p);return o}function zG(e,t,r,n,a,o){var u=(n||[]).slice(),l=u.length,f=t.start,h=t.end;if(o){var p=n[l-1];if(p!=null){var v=r(p,l-1),x=e*(p.coordinate+e*v/2-h);if(u[l-1]=p=er(er({},p),{},{tickCoord:x>0?p.coordinate-x*e:p.coordinate}),p.tickCoord!=null){var b=Fu(e,p.tickCoord,()=>v,f,h);b&&(h=p.tickCoord-e*(v/2+a),u[l-1]=er(er({},p),{},{isShow:!0}))}}}for(var k=o?l-1:l,j=function(P){var O=u[P];if(O==null)return 1;var C=O,_,A=()=>(_===void 0&&(_=r(O,P)),_);if(P===0){var I=e*(C.coordinate-e*A()/2-f);u[P]=C=er(er({},C),{},{tickCoord:I<0?C.coordinate-I*e:C.coordinate})}else u[P]=C=er(er({},C),{},{tickCoord:C.coordinate});if(C.tickCoord!=null){var $=Fu(e,C.tickCoord,A,f,h);$&&(f=C.tickCoord+e*(A()/2+a),u[P]=er(er({},C),{},{isShow:!0}))}},S=0;S{var I=typeof h=="function"?h(_.value,A):_.value;return k==="width"?OG(fu(I,{fontSize:t,letterSpacing:r}),j,v):fu(I,{fontSize:t,letterSpacing:r})[k]},N=a[0],P=a[1],O=a.length>=2&&N!=null&&P!=null?Wr(P.coordinate-N.coordinate):1,C=_G(o,O,k);return f==="equidistantPreserveStart"?IG(O,C,S,a,u):f==="equidistantPreserveEnd"?TG(O,C,S,a,u):(f==="preserveStart"||f==="preserveStartEnd"?b=zG(O,C,S,a,u,f==="preserveStartEnd"):b=LG(O,C,S,a,u),b.filter(_=>_.isShow))}var FG=e=>{var t=e.ticks,r=e.label,n=e.labelGapWithTick,a=n,o=e.tickSize,u=o===void 0?0:o,l=e.tickMargin,f=l===void 0?0:l,h=0;if(t){Array.from(t).forEach(b=>{if(b){var k=b.getBoundingClientRect();k.width>h&&(h=k.width)}});var p=r?r.getBoundingClientRect().width:0,v=u+f,x=h+v+p+(r?a:0);return Math.round(x)}return 0},BG={xAxis:{},yAxis:{}},EO=rr({name:"renderedTicks",initialState:BG,reducers:{setRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,a=r.axisId,o=r.ticks;e[n][a]=o},removeRenderedTicks:(e,t)=>{var r=t.payload,n=r.axisType,a=r.axisId;delete e[n][a]}}}),PO=EO.actions,UG=PO.setRenderedTicks,WG=PO.removeRenderedTicks,HG=EO.reducer,KG=["axisLine","width","height","className","hide","ticks","axisType","axisId"];function ZS(e,t){return QG(e)||qG(e,t)||VG(e,t)||GG()}function GG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VG(e,t){if(e){if(typeof e=="string")return JS(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?JS(e,t):void 0}}function JS(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n==null||r==null)return Us;var o=t.map(u=>({value:u.value,coordinate:u.coordinate,offset:u.offset,index:u.index}));return a(UG({ticks:o,axisId:n,axisType:r})),()=>{a(WG({axisId:n,axisType:r}))}},[a,t,n,r]),null}var sV=y.forwardRef((e,t)=>{var r=e.ticks,n=r===void 0?[]:r,a=e.tick,o=e.tickLine,u=e.stroke,l=e.tickFormatter,f=e.unit,h=e.padding,p=e.tickTextProps,v=e.orientation,x=e.mirror,b=e.x,k=e.y,j=e.width,S=e.height,N=e.tickSize,P=e.tickMargin,O=e.fontSize,C=e.letterSpacing,_=e.getTicksConfig,A=e.events,I=e.axisType,$=e.axisId,B=U0(mt(mt({},_),{},{ticks:n}),O,C),K=dn(_),q=sh(a),R=oO(K.textAnchor)?K.textAnchor:nV(v,x),de=iV(v,x),Z={};typeof o=="object"&&(Z=o);var ge=mt(mt({},K),{},{fill:"none"},Z),ke=B.map(oe=>mt({entry:oe},rV(oe,b,k,j,S,v,N,x,P))),me=ke.map(oe=>{var X=oe.entry,L=oe.line;return y.createElement(Vr,{className:"recharts-cartesian-axis-tick",key:"tick-".concat(X.value,"-").concat(X.coordinate,"-").concat(X.tickCoord)},o&&y.createElement("line",ho({},ge,L,{className:et("recharts-cartesian-axis-tick-line",go(o,"className"))})))}),Q=ke.map((oe,X)=>{var L,T,ee=oe.entry,ne=oe.tick,te=mt(mt(mt(mt({verticalAnchor:de},K),{},{textAnchor:R,stroke:"none",fill:u},ne),{},{index:X,payload:ee,visibleTicksCount:B.length,tickFormatter:l,padding:h},p),{},{angle:(L=(T=p==null?void 0:p.angle)!==null&&T!==void 0?T:K.angle)!==null&&L!==void 0?L:0}),ue=mt(mt({},te),q);return y.createElement(Vr,ho({className:"recharts-cartesian-axis-tick-label",key:"tick-label-".concat(ee.value,"-").concat(ee.coordinate,"-").concat(ee.tickCoord)},dD(A,ee,X)),a&&y.createElement(aV,{option:a,tickProps:ue,value:"".concat(typeof l=="function"?l(ee.value,X):ee.value).concat(f||"")}))});return y.createElement("g",{className:"recharts-cartesian-axis-ticks recharts-".concat(I,"-ticks")},y.createElement(oV,{ticks:B,axisId:$,axisType:I}),Q.length>0&&y.createElement(xi,{zIndex:or.label},y.createElement("g",{className:"recharts-cartesian-axis-tick-labels recharts-".concat(I,"-tick-labels"),ref:t},Q)),me.length>0&&y.createElement("g",{className:"recharts-cartesian-axis-tick-lines recharts-".concat(I,"-tick-lines")},me))}),lV=y.forwardRef((e,t)=>{var r=e.axisLine,n=e.width,a=e.height,o=e.className,u=e.hide,l=e.ticks,f=e.axisType,h=e.axisId,p=YG(e,KG),v=y.useState(""),x=ZS(v,2),b=x[0],k=x[1],j=y.useState(""),S=ZS(j,2),N=S[0],P=S[1],O=y.useRef(null);y.useImperativeHandle(t,()=>({getCalculatedWidth:()=>{var _;return FG({ticks:O.current,label:(_=e.labelRef)===null||_===void 0?void 0:_.current,labelGapWithTick:5,tickSize:e.tickSize,tickMargin:e.tickMargin})}}));var C=y.useCallback(_=>{if(_){var A=_.getElementsByClassName("recharts-cartesian-axis-tick-value");O.current=A;var I=A[0];if(I){var $=window.getComputedStyle(I),B=$.fontSize,K=$.letterSpacing;(B!==b||K!==N)&&(k(B),P(K))}}},[b,N]);return u||n!=null&&n<=0||a!=null&&a<=0?null:y.createElement(xi,{zIndex:e.zIndex},y.createElement(Vr,{className:et("recharts-cartesian-axis",o)},y.createElement(tV,{x:e.x,y:e.y,width:n,height:a,orientation:e.orientation,mirror:e.mirror,axisLine:r,otherSvgProps:dn(e)}),y.createElement(sV,{ref:C,axisType:f,events:p,fontSize:b,getTicksConfig:e,height:e.height,letterSpacing:N,mirror:e.mirror,orientation:e.orientation,padding:e.padding,stroke:e.stroke,tick:e.tick,tickFormatter:e.tickFormatter,tickLine:e.tickLine,tickMargin:e.tickMargin,tickSize:e.tickSize,tickTextProps:e.tickTextProps,ticks:l,unit:e.unit,width:e.width,x:e.x,y:e.y,axisId:h}),y.createElement(MH,{x:e.x,y:e.y,width:e.width,height:e.height,lowerWidth:e.width,upperWidth:e.width},y.createElement(UH,{label:e.label,labelRef:e.labelRef}),e.children)))}),W0=y.forwardRef((e,t)=>{var r=Qr(e,li);return y.createElement(lV,ho({},r,{ref:t}))});W0.displayName="CartesianAxis";var uV=["x1","y1","x2","y2","key"],cV=["offset"],dV=["xAxisId","yAxisId"],fV=["xAxisId","yAxisId"];function tN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function tr(e){for(var t=1;t{var t=e.fill;if(!t||t==="none")return null;var r=e.fillOpacity,n=e.x,a=e.y,o=e.width,u=e.height,l=e.ry;return y.createElement("rect",{x:n,y:a,ry:l,width:o,height:u,stroke:"none",fill:t,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function CO(e){var t=e.option,r=e.lineItemProps,n;if(y.isValidElement(t))n=y.cloneElement(t,r);else if(typeof t=="function")n=t(r);else{var a,o=r.x1,u=r.y1,l=r.x2,f=r.y2,h=r.key,p=qf(r,uV),v=(a=dn(p))!==null&&a!==void 0?a:{};v.offset;var x=qf(v,cV);n=y.createElement("line",Ha({},x,{x1:o,y1:u,x2:l,y2:f,fill:"none",key:h}))}return n}function yV(e){var t=e.x,r=e.width,n=e.horizontal,a=n===void 0?!0:n,o=e.horizontalPoints;if(!a||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=qf(e,dV),l=o.map((f,h)=>{var p=tr(tr({},u),{},{x1:t,y1:f,x2:t+r,y2:f,key:"line-".concat(h),index:h});return y.createElement(CO,{key:"line-".concat(h),option:a,lineItemProps:p})});return y.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function xV(e){var t=e.y,r=e.height,n=e.vertical,a=n===void 0?!0:n,o=e.verticalPoints;if(!a||!o||!o.length)return null;e.xAxisId,e.yAxisId;var u=qf(e,fV),l=o.map((f,h)=>{var p=tr(tr({},u),{},{x1:f,y1:t,x2:f,y2:t+r,key:"line-".concat(h),index:h});return y.createElement(CO,{option:a,lineItemProps:p,key:"line-".concat(h)})});return y.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function bV(e){var t=e.horizontalFill,r=e.fillOpacity,n=e.x,a=e.y,o=e.width,u=e.height,l=e.horizontalPoints,f=e.horizontal,h=f===void 0?!0:f;if(!h||!t||!t.length||l==null)return null;var p=l.map(x=>Math.round(x+a-a)).sort((x,b)=>x-b);a!==p[0]&&p.unshift(0);var v=p.map((x,b)=>{var k=p[b+1],j=k==null,S=j?a+u-x:k-x;if(S<=0)return null;var N=b%t.length;return y.createElement("rect",{key:"react-".concat(b),y:x,x:n,height:S,width:o,stroke:"none",fill:t[N],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function wV(e){var t=e.vertical,r=t===void 0?!0:t,n=e.verticalFill,a=e.fillOpacity,o=e.x,u=e.y,l=e.width,f=e.height,h=e.verticalPoints;if(!r||!n||!n.length)return null;var p=h.map(x=>Math.round(x+o-o)).sort((x,b)=>x-b);o!==p[0]&&p.unshift(0);var v=p.map((x,b)=>{var k=p[b+1],j=k==null,S=j?o+l-x:k-x;if(S<=0)return null;var N=b%n.length;return y.createElement("rect",{key:"react-".concat(b),x,y:u,width:S,height:f,stroke:"none",fill:n[N],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return y.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var kV=(e,t)=>{var r=e.xAxis,n=e.width,a=e.height,o=e.offset;return lP(U0(tr(tr(tr({},li),r),{},{ticks:uP(r),viewBox:{x:0,y:0,width:n,height:a}})),o.left,o.left+o.width,t)},jV=(e,t)=>{var r=e.yAxis,n=e.width,a=e.height,o=e.offset;return lP(U0(tr(tr(tr({},li),r),{},{ticks:uP(r),viewBox:{x:0,y:0,width:n,height:a}})),o.top,o.top+o.height,t)},SV={horizontal:!0,vertical:!0,horizontalPoints:[],verticalPoints:[],stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[],xAxisId:0,yAxisId:0,syncWithTicks:!1,zIndex:or.grid};function AO(e){var t=gP(),r=yP(),n=vP(),a=tr(tr({},Qr(e,SV)),{},{x:Ne(e.x)?e.x:n.left,y:Ne(e.y)?e.y:n.top,width:Ne(e.width)?e.width:n.width,height:Ne(e.height)?e.height:n.height}),o=a.xAxisId,u=a.yAxisId,l=a.x,f=a.y,h=a.width,p=a.height,v=a.syncWithTicks,x=a.horizontalValues,b=a.verticalValues,k=wr(),j=Ae(B=>nS(B,"xAxis",o,k)),S=Ae(B=>nS(B,"yAxis",u,k));if(!Rn(h)||!Rn(p)||!Ne(l)||!Ne(f))return null;var N=a.verticalCoordinatesGenerator||kV,P=a.horizontalCoordinatesGenerator||jV,O=a.horizontalPoints,C=a.verticalPoints;if((!O||!O.length)&&typeof P=="function"){var _=x&&x.length,A=P({yAxis:S?tr(tr({},S),{},{ticks:_?x:S.ticks}):void 0,width:t??h,height:r??p,offset:n},_?!0:v);bf(Array.isArray(A),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(typeof A,"]")),Array.isArray(A)&&(O=A)}if((!C||!C.length)&&typeof N=="function"){var I=b&&b.length,$=N({xAxis:j?tr(tr({},j),{},{ticks:I?b:j.ticks}):void 0,width:t??h,height:r??p,offset:n},I?!0:v);bf(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(typeof $,"]")),Array.isArray($)&&(C=$)}return y.createElement(xi,{zIndex:a.zIndex},y.createElement("g",{className:"recharts-cartesian-grid"},y.createElement(gV,{fill:a.fill,fillOpacity:a.fillOpacity,x:a.x,y:a.y,width:a.width,height:a.height,ry:a.ry}),y.createElement(bV,Ha({},a,{horizontalPoints:O})),y.createElement(wV,Ha({},a,{verticalPoints:C})),y.createElement(yV,Ha({},a,{offset:n,horizontalPoints:O,xAxis:j,yAxis:S})),y.createElement(xV,Ha({},a,{offset:n,verticalPoints:C,xAxis:j,yAxis:S}))))}AO.displayName="CartesianGrid";var NV={},OO=rr({name:"errorBars",initialState:NV,reducers:{addErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,a=r.errorBar;e[n]||(e[n]=[]),e[n].push(a)},replaceErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,a=r.prev,o=r.next;e[n]&&(e[n]=e[n].map(u=>u.dataKey===a.dataKey&&u.direction===a.direction?o:u))},removeErrorBar:(e,t)=>{var r=t.payload,n=r.itemId,a=r.errorBar;e[n]&&(e[n]=e[n].filter(o=>o.dataKey!==a.dataKey||o.direction!==a.direction))}}}),H0=OO.actions;H0.addErrorBar;H0.replaceErrorBar;H0.removeErrorBar;var EV=OO.reducer;function _O(e,t){var r,n,a=Ae(h=>vi(h,e)),o=Ae(h=>gi(h,t)),u=(r=a==null?void 0:a.allowDataOverflow)!==null&&r!==void 0?r:Nt.allowDataOverflow,l=(n=o==null?void 0:o.allowDataOverflow)!==null&&n!==void 0?n:Et.allowDataOverflow,f=u||l;return{needClip:f,needClipX:u,needClipY:l}}function PV(e){var t=e.xAxisId,r=e.yAxisId,n=e.clipPathId,a=B0(),o=_O(t,r),u=o.needClipX,l=o.needClipY,f=o.needClip,h=Ae(O=>mA(O,t,!1)),p=Ae(O=>vA(O,r,!1));if(!f||!a)return null;var v=a.x,x=a.y,b=a.width,k=a.height,j=u&&h?Math.min(h[0],h[1]):v-b/2,S=l&&p?Math.min(p[0],p[1]):x-k/2,N=u&&h?Math.abs(h[1]-h[0]):b*2,P=l&&p?Math.abs(p[1]-p[0]):k*2;return y.createElement("clipPath",{id:"clipPath-".concat(n)},y.createElement("rect",{x:j,y:S,width:N,height:P}))}function CV(e){var t=sh(e),r=3,n=2;if(t!=null){var a=t.r,o=t.strokeWidth,u=Number(a),l=Number(o);return(Number.isNaN(u)||u<0)&&(u=r),(Number.isNaN(l)||l<0)&&(l=n),{r:u,strokeWidth:l}}return{r,strokeWidth:n}}function K0(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||n===void 0?void 0:n.xAxisId)!==null&&r!==void 0?r:wO}function G0(e,t){var r,n;return(r=(n=e.graphicalItems.cartesianItems.find(a=>a.id===t))===null||n===void 0?void 0:n.yAxisId)!==null&&r!==void 0?r:wO}var MO=(e,t,r)=>SA(e,"xAxis",K0(e,t),r),IO=(e,t,r)=>jA(e,"xAxis",K0(e,t),r),TO=(e,t,r)=>SA(e,"yAxis",G0(e,t),r),DO=(e,t,r)=>jA(e,"yAxis",G0(e,t),r),AV=G([ut,MO,TO,IO,DO],(e,t,r,n,a)=>zn(e,"xAxis")?xf(t,n,!1):xf(r,a,!1)),OV=(e,t)=>t,RO=G([WC,OV],(e,t)=>e.filter(r=>r.type==="area").find(r=>r.id===t)),$O=e=>{var t=ut(e),r=zn(t,"xAxis");return r?"yAxis":"xAxis"},_V=(e,t)=>{var r=$O(e);return r==="yAxis"?G0(e,t):K0(e,t)},MV=(e,t,r)=>JC(e,$O(e),_V(e,t),r),IV=G([RO,MV],(e,t)=>{var r;if(!(e==null||t==null)){var n=e.stackId,a=Gy(e);if(!(n==null||a==null)){var o=(r=t[n])===null||r===void 0?void 0:r.stackedData,u=o==null?void 0:o.find(l=>l.key===a);if(u!=null)return u.map(l=>[l[0],l[1]])}}}),TV=G([ut,MO,TO,IO,DO,IV,iF,AV,RO,wF],(e,t,r,n,a,o,u,l,f,h)=>{var p=u.chartData,v=u.dataStartIndex,x=u.dataEndIndex;if(!(f==null||e!=="horizontal"&&e!=="vertical"||t==null||r==null||n==null||a==null||n.length===0||a.length===0||l==null)){var b=f.data,k;if(b&&b.length>0?k=b:k=p==null?void 0:p.slice(v,x+1),k!=null)return oq({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:a,dataStartIndex:v,areaSettings:f,stackedData:o,displayedData:k,chartBaseValue:h,bandSize:l})}}),DV=["animationElapsedTime","isAnimating","isEntrance","layout","isRange","stroke","connectNulls"],RV=["id","baseLine"];function hu(){return hu=Object.assign?Object.assign.bind():function(e){for(var t=1;tv.y||0));return Ne(a)?p=Math.max(a,p):a&&Array.isArray(a)&&a.length&&(p=Math.max(...a.map(v=>v.y||0),p)),Ne(p)?y.createElement("rect",{x:lv.x||0));return Ne(a)?p=Math.max(a,p):a&&Array.isArray(a)&&a.length&&(p=Math.max(...a.map(v=>v.x||0),p)),Ne(p)?y.createElement("rect",{x:0,y:le==null?[]:t===1?e.flatMap(r=>r.status==="removed"?[]:[r.next]):e.flatMap(r=>r.status==="matched"?[zs(zs({},r.next),{},{x:ni(r.prev.x,r.next.x,t),y:ni(r.prev.y,r.next.y,t)})]:r.status==="added"?[r.next]:[]),zO={activeDot:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:z0,animationInterpolateFn:qV,connectNulls:!1,dot:!1,fill:"#3182bd",fillOpacity:.6,hide:!1,isAnimationActive:"auto",legendType:"line",stroke:"#3182bd",strokeWidth:1,type:"linear",label:!1,shape:BV,xAxisId:0,yAxisId:0,zIndex:or.area};function Yf(e,t){return e&&e!=="none"?e:t}var QV=e=>{var t=e.dataKey,r=e.name,n=e.stroke,a=e.fill,o=e.legendType,u=e.hide;return[{inactive:u,dataKey:t,type:o,color:Yf(n,a),value:cP(r,t),payload:e}]},YV=y.memo(e=>{var t=e.dataKey,r=e.data,n=e.stroke,a=e.strokeWidth,o=e.fill,u=e.name,l=e.hide,f=e.unit,h=e.tooltipType,p=e.id,v={dataDefinedOnItem:r,getPosition:Us,settings:{stroke:n,strokeWidth:a,fill:o,dataKey:t,nameKey:void 0,name:cP(u,t),hide:l,type:h,color:Yf(n,o),unit:f,graphicalItemId:p}};return y.createElement(lK,{tooltipEntrySettings:v})});function XV(e){var t=e.clipPathId,r=e.points,n=e.props,a=n.needClip,o=n.dot,u=n.dataKey,l=dn(n);return y.createElement(XK,{points:r,dot:o,className:"recharts-area-dots",dotClassName:"recharts-area-dot",dataKey:u,baseProps:l,needClip:a,clipPathId:t})}function ZV(e){var t=e.showLabels,r=e.children,n=e.points,a=n.map(o=>{var u,l,f={x:(u=o.x)!==null&&u!==void 0?u:0,y:(l=o.y)!==null&&l!==void 0?l:0,width:0,lowerWidth:0,upperWidth:0,height:0};return zs(zs({},f),{},{value:o.value,payload:o.payload,parentViewBox:void 0,viewBox:f,fill:void 0})});return y.createElement(VH,{value:t?a:void 0},r)}function JV(e){var t=e.points,r=e.baseLine,n=e.needClip,a=e.clipPathId,o=e.props,u=e.animationElapsedTime,l=e.isAnimating,f=e.isEntrance,h=o.layout,p=o.type,v=o.stroke,x=o.connectNulls,b=o.isRange,k=o.shape,j=o.id,S=LO(o,UV),N=Gr(S),P=zs(zs({},N),{},{id:j,points:t,connectNulls:x,type:p,baseLine:r,layout:h,stroke:v,isRange:b,animationElapsedTime:u,isAnimating:l,isEntrance:f});return y.createElement(y.Fragment,null,(t==null?void 0:t.length)>1&&y.createElement(Vr,{clipPath:n?"url(#clipPath-".concat(a,")"):void 0},y.createElement(sK,{option:k,DefaultShape:zO.shape,shapeProps:P})),y.createElement(XV,{points:t,props:S,clipPathId:a}))}function eq(e,t,r){if(Ne(e)){var n=Ne(t)?t:void 0;return ni(n,e,r)}if(Kt(e)||Tn(e)){var a=Ne(t)?t:void 0;return ni(a,0,r)}return e}function tq(e){var t=e.needClip,r=e.clipPathId,n=e.props,a=e.previousPointsRef,o=e.previousBaselineRef,u=n.points,l=n.baseLine,f=n.isAnimationActive,h=n.animationBegin,p=n.animationDuration,v=n.animationEasing,x=n.animationMatchBy,b=n.animationInterpolateFn,k=y.useMemo(()=>({points:u,baseLine:l}),[u,l]),j=yO(k,o),S=My(),N=NK(n.onAnimationStart,n.onAnimationEnd),P=N.isAnimating,O=N.handleAnimationStart,C=N.handleAnimationEnd,_=j.startValue;if(S==null)return null;var A;return Array.isArray(l)&&Array.isArray(_)?A=Vg(_,l,x):Array.isArray(l)?A=Vg(null,l,x):A=null,y.createElement(EK,{animationInput:k,animationIdPrefix:"recharts-area-",items:u,previousItemsRef:a,isAnimationActive:f,animationBegin:h,animationDuration:p,animationEasing:v,onAnimationStart:O,onAnimationEnd:C,animationInterpolateFn:b,animationMatchBy:x,layout:S},(I,$,B)=>{var K;return $===1?K=l:Array.isArray(l)?K=b(A,$,S):K=B?l:eq(l,_,$),j.syncStepValue(K,$),y.createElement(ZV,{showLabels:!P,points:u},n.children,y.createElement(JV,{points:I,baseLine:K,needClip:t,clipPathId:r,props:n,animationElapsedTime:$,isAnimating:P||$<1,isEntrance:B}),y.createElement(YH,{label:n.label}))})}function rq(e){var t=e.needClip,r=e.clipPathId,n=e.props,a=y.useRef(null),o=y.useRef();return y.createElement(tq,{needClip:t,clipPathId:r,props:n,previousPointsRef:a,previousBaselineRef:o})}class nq extends y.PureComponent{render(){var t=this.props,r=t.hide,n=t.dot,a=t.points,o=t.className,u=t.top,l=t.left,f=t.needClip,h=t.xAxisId,p=t.yAxisId,v=t.width,x=t.height,b=t.id,k=t.baseLine,j=t.zIndex;if(r)return null;var S=et("recharts-area",o),N=b,P=CV(n),O=P.r,C=P.strokeWidth,_=vO(n),A=O*2+C,I=f?"url(#clipPath-".concat(_?"":"dots-").concat(N,")"):void 0;return y.createElement(xi,{zIndex:j},y.createElement(Vr,{className:S},f&&y.createElement("defs",null,y.createElement(PV,{clipPathId:N,xAxisId:h,yAxisId:p}),!_&&y.createElement("clipPath",{id:"clipPath-dots-".concat(N)},y.createElement("rect",{x:l-A/2,y:u-A/2,width:v+A,height:x+A}))),y.createElement(rq,{needClip:f,clipPathId:N,props:this.props})),y.createElement(qS,{points:a,mainColor:Yf(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:I}),this.props.isRange&&Array.isArray(k)&&y.createElement(qS,{points:k,mainColor:Yf(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot,clipPath:I}))}}function iq(e){var t,r=e.activeDot,n=e.animationBegin,a=e.animationDuration,o=e.animationEasing,u=e.connectNulls,l=e.dot,f=e.fill,h=e.fillOpacity,p=e.hide,v=e.isAnimationActive,x=e.legendType,b=e.stroke,k=e.xAxisId,j=e.yAxisId,S=LO(e,WV),N=Ws(),P=VA(),O=_O(k,j),C=O.needClip,_=wr(),A=(t=Ae(ge=>TV(ge,e.id,_)))!==null&&t!==void 0?t:{},I=A.points,$=A.isRange,B=A.baseLine,K=B0();if(N!=="horizontal"&&N!=="vertical"||K==null||P!=="AreaChart"&&P!=="ComposedChart")return null;var q=K.height,R=K.width,de=K.x,Z=K.y;return!I||!I.length?null:y.createElement(nq,Qf({},S,{activeDot:r,animationBegin:n,animationDuration:a,animationEasing:o,baseLine:B,connectNulls:u,dot:l,fill:f,fillOpacity:h,height:q,hide:p,layout:N,isAnimationActive:v,isRange:$,legendType:x,needClip:C,points:I,stroke:b,width:R,left:de,top:Z,xAxisId:k,yAxisId:j}))}var aq=(e,t,r,n,a)=>{var o=r??t;if(Ne(o))return o;var u=e==="horizontal"?a:n,l=u.scale.domain();if(u.type==="number"){var f=Math.max(l[0],l[1]),h=Math.min(l[0],l[1]);return o==="dataMin"?h:o==="dataMax"||f<0?f:Math.max(Math.min(l[0],l[1]),0)}return o==="dataMin"?l[0]:o==="dataMax"?l[1]:l[0]};function oq(e){var t=e.areaSettings,r=t.connectNulls,n=t.baseValue,a=t.dataKey,o=e.stackedData,u=e.layout,l=e.chartBaseValue,f=e.xAxis,h=e.yAxis,p=e.displayedData,v=e.dataStartIndex,x=e.xAxisTicks,b=e.yAxisTicks,k=e.bandSize,j=o&&o.length,S=aq(u,l,n,f,h),N=u==="horizontal",P=!1,O=p.map((_,A)=>{var I,$,B,K;if(j)K=o[v+A];else{var q=Tt(_,a);Array.isArray(q)?(K=q,P=!0):K=[S,q]}var R=(I=($=K)===null||$===void 0?void 0:$[1])!==null&&I!==void 0?I:null,de=R==null||j&&!r&&Tt(_,a)==null;if(N){var Z;return{x:Zw({axis:f,ticks:x,bandSize:k,entry:_,index:A}),y:de?null:(Z=h.scale.map(R))!==null&&Z!==void 0?Z:null,value:K,payload:_}}return{x:de?null:(B=f.scale.map(R))!==null&&B!==void 0?B:null,y:Zw({axis:h,ticks:b,bandSize:k,entry:_,index:A}),value:K,payload:_}}),C;return j||P?C=O.map(_=>{var A,I=Array.isArray(_.value)?_.value[0]:null;if(N){var $;return{x:_.x,y:I!=null&&_.y!=null&&($=h.scale.map(I))!==null&&$!==void 0?$:null,payload:_.payload}}return{x:I!=null&&(A=f.scale.map(I))!==null&&A!==void 0?A:null,y:_.y,payload:_.payload}}):C=N?h.scale.map(S):f.scale.map(S),{points:O,baseLine:C??0,isRange:P}}function sq(e){var t=Qr(e,zO),r=wr();return y.createElement(DK,{id:t.id,type:"area"},n=>y.createElement(y.Fragment,null,y.createElement(uK,{legendPayload:QV(t)}),y.createElement(YV,{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:n}),y.createElement(UK,{type:"area",id:n,data:t.data,dataKey:t.dataKey,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,stackId:H$(t.stackId),hide:t.hide,barSize:void 0,baseValue:t.baseValue,isPanorama:r,connectNulls:t.connectNulls}),y.createElement(iq,Qf({},t,{id:n}))))}var FO=y.memo(sq,Ah);FO.displayName="Area";var lq=["domain","range"],uq=["domain","range"];function iN(e,t){if(e==null)return{};var r,n,a=cq(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{if(u!=null)return sN(sN({},o),{},{type:u})},[o,u]);return y.useLayoutEffect(()=>{l!=null&&(r.current===null?t(rG(l)):r.current!==l&&t(nG({prev:r.current,next:l})),r.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(iG(r.current)),r.current=null)},[t]),null}var xq=e=>{var t=e.xAxisId,r=e.className,n=Ae(fP),a=wr(),o="xAxis",u=Ae(x=>kA(x,o,t,a)),l=Ae(x=>J9(x,t)),f=Ae(x=>aU(x,t)),h=Ae(x=>zC(x,t));if(l==null||f==null||h==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var p=Qg(e,fq);h.id,h.scale;var v=Qg(h,hq);return y.createElement(W0,qg({},p,v,{x:f.x,y:f.y,width:l.width,height:l.height,className:et("recharts-".concat(o," ").concat(o),r),viewBox:n,ticks:u,axisType:o,axisId:t}))},bq={allowDataOverflow:Nt.allowDataOverflow,allowDecimals:Nt.allowDecimals,allowDuplicatedCategory:Nt.allowDuplicatedCategory,angle:Nt.angle,axisLine:li.axisLine,height:Nt.height,hide:!1,includeHidden:Nt.includeHidden,interval:Nt.interval,label:!1,minTickGap:Nt.minTickGap,mirror:Nt.mirror,orientation:Nt.orientation,padding:Nt.padding,reversed:Nt.reversed,scale:Nt.scale,tick:Nt.tick,tickCount:Nt.tickCount,tickLine:li.tickLine,tickSize:li.tickSize,type:Nt.type,niceTicks:Nt.niceTicks,xAxisId:0},wq=e=>{var t=Qr(e,bq);return y.createElement(y.Fragment,null,y.createElement(yq,{allowDataOverflow:t.allowDataOverflow,allowDecimals:t.allowDecimals,allowDuplicatedCategory:t.allowDuplicatedCategory,angle:t.angle,dataKey:t.dataKey,domain:t.domain,height:t.height,hide:t.hide,id:t.xAxisId,includeHidden:t.includeHidden,interval:t.interval,minTickGap:t.minTickGap,mirror:t.mirror,name:t.name,orientation:t.orientation,padding:t.padding,reversed:t.reversed,scale:t.scale,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,niceTicks:t.niceTicks}),y.createElement(xq,t))},UO=y.memo(wq,BO);UO.displayName="XAxis";var kq=["type"],jq=["dangerouslySetInnerHTML","ticks","scale"],Sq=["id","scale"];function Yg(){return Yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t{if(u!=null)return uN(uN({},o),{},{type:u})},[u,o]);return y.useLayoutEffect(()=>{l!=null&&(r.current===null?t(aG(l)):r.current!==l&&t(oG({prev:r.current,next:l})),r.current=l)},[l,t]),y.useLayoutEffect(()=>()=>{r.current&&(t(sG(r.current)),r.current=null)},[t]),null}function Oq(e){var t=e.yAxisId,r=e.className,n=e.width,a=e.label,o=y.useRef(null),u=y.useRef(null),l=Ae(fP),f=wr(),h=kt(),p="yAxis",v=Ae(N=>lU(N,t)),x=Ae(N=>sU(N,t)),b=Ae(N=>kA(N,p,t,f)),k=Ae(N=>FC(N,t));if(y.useLayoutEffect(()=>{if(!(n!=="auto"||!v||L0(a)||y.isValidElement(a)||k==null)){var N=o.current;if(N){var P=N.getCalculatedWidth();Math.round(v.width)!==Math.round(P)&&h(lG({id:t,width:P}))}}},[b,v,h,a,t,n,k]),v==null||x==null||k==null)return null;e.dangerouslySetInnerHTML,e.ticks,e.scale;var j=Xg(e,jq);k.id,k.scale;var S=Xg(k,Sq);return y.createElement(W0,Yg({},j,S,{ref:o,labelRef:u,x:x.x,y:x.y,tickTextProps:n==="auto"?{width:void 0}:{width:n},width:v.width,height:v.height,className:et("recharts-".concat(p," ").concat(p),r),viewBox:l,ticks:b,axisType:p,axisId:t}))}var _q={allowDataOverflow:Et.allowDataOverflow,allowDecimals:Et.allowDecimals,allowDuplicatedCategory:Et.allowDuplicatedCategory,angle:Et.angle,axisLine:li.axisLine,hide:!1,includeHidden:Et.includeHidden,interval:Et.interval,label:!1,minTickGap:Et.minTickGap,mirror:Et.mirror,orientation:Et.orientation,padding:Et.padding,reversed:Et.reversed,scale:Et.scale,tick:Et.tick,tickCount:Et.tickCount,tickLine:li.tickLine,tickSize:li.tickSize,type:Et.type,niceTicks:Et.niceTicks,width:Et.width,yAxisId:0},Mq=e=>{var t=Qr(e,_q);return y.createElement(y.Fragment,null,y.createElement(Aq,{interval:t.interval,id:t.yAxisId,scale:t.scale,type:t.type,domain:t.domain,allowDataOverflow:t.allowDataOverflow,dataKey:t.dataKey,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDecimals:t.allowDecimals,tickCount:t.tickCount,padding:t.padding,includeHidden:t.includeHidden,reversed:t.reversed,ticks:t.ticks,width:t.width,orientation:t.orientation,mirror:t.mirror,hide:t.hide,unit:t.unit,name:t.name,angle:t.angle,minTickGap:t.minTickGap,tick:t.tick,tickFormatter:t.tickFormatter,niceTicks:t.niceTicks}),y.createElement(Oq,t))},WO=y.memo(Mq,BO);WO.displayName="YAxis";var Iq=(e,t)=>t,V0=G([Iq,ut,eC,Rt,BA,yi,O7,Vt],$7);function Tq(e){return"getBBox"in e.currentTarget&&typeof e.currentTarget.getBBox=="function"}function q0(e){var t=e.currentTarget.getBoundingClientRect(),r,n;if(Tq(e)){var a=e.currentTarget.getBBox();r=a.width>0?t.width/a.width:1,n=a.height>0?t.height/a.height:1}else{var o=e.currentTarget;r=o.offsetWidth>0?t.width/o.offsetWidth:1,n=o.offsetHeight>0?t.height/o.offsetHeight:1}var u=(l,f)=>({relativeX:Math.round((l-t.left)/r),relativeY:Math.round((f-t.top)/n)});return"touches"in e?Array.from(e.touches).map(l=>u(l.clientX,l.clientY)):u(e.clientX,e.clientY)}var HO=Mr("mouseClick"),KO=Qu();KO.startListening({actionCreator:HO,effect:(e,t)=>{var r=e.payload,n=V0(t.getState(),q0(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(jU({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var Zg=Mr("mouseMove"),GO=Qu(),ts=null,Ma=null,Pv=null;GO.startListening({actionCreator:Zg,effect:(e,t)=>{var r=e.payload,n=t.getState(),a=n.eventSettings,o=a.throttleDelay,u=a.throttledEvents,l=u==="all"||(u==null?void 0:u.includes("mousemove"));ts!==null&&(cancelAnimationFrame(ts),ts=null),Ma!==null&&(typeof o!="number"||!l)&&(clearTimeout(Ma),Ma=null),Pv=q0(r);var f=()=>{var h=t.getState(),p=lc(h,h.tooltip.settings.shared);if(!Pv){ts=null,Ma=null;return}if(p==="axis"){var v=V0(h,Pv);(v==null?void 0:v.activeIndex)!=null?t.dispatch(_A({activeIndex:v.activeIndex,activeDataKey:void 0,activeCoordinate:v.activeCoordinate})):t.dispatch(OA())}ts=null,Ma=null};if(!l){f();return}o==="raf"?ts=requestAnimationFrame(f):typeof o=="number"&&Ma===null&&(Ma=setTimeout(f,o))}});function Dq(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 cN={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},VO=rr({name:"rootProps",initialState:cN,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:cN.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}}}),Rq=VO.reducer,$q=VO.actions.updateOptions,Lq=null,zq={updatePolarOptions:(e,t)=>e===null?t.payload:(e.startAngle=t.payload.startAngle,e.endAngle=t.payload.endAngle,e.cx=t.payload.cx,e.cy=t.payload.cy,e.innerRadius=t.payload.innerRadius,e.outerRadius=t.payload.outerRadius,e)},qO=rr({name:"polarOptions",initialState:Lq,reducers:zq});qO.actions.updatePolarOptions;var Fq=qO.reducer,QO=Mr("keyDown"),YO=Mr("focus"),XO=Mr("blur"),Qh=Qu(),rs=null,Ia=null,Wd=null;Qh.startListening({actionCreator:QO,effect:(e,t)=>{Wd=e.payload,rs!==null&&(cancelAnimationFrame(rs),rs=null);var r=t.getState(),n=r.eventSettings,a=n.throttleDelay,o=n.throttledEvents,u=o==="all"||o.includes("keydown");Ia!==null&&(typeof a!="number"||!u)&&(clearTimeout(Ia),Ia=null);var l=()=>{try{var f=t.getState(),h=f.rootProps.accessibilityLayer!==!1;if(!h)return;var p=f.tooltip.keyboardInteraction,v=Wd;if(v!=="ArrowRight"&&v!=="ArrowLeft"&&v!=="Enter")return;var x=du(p,fo(f),$s(f),Ls(f)),b=x==null?-1:Number(x),k=!Number.isFinite(b)||b<0,j=yi(f),S=fo(f),N=lc(f,f.tooltip.settings.shared);if(v==="Enter"){if(k)return;var P=Hf(f,N,"hover",String(p.index));t.dispatch(Wf({active:!p.active,activeIndex:p.index,activeCoordinate:P}));return}var O=hU(f),C=O==="left-to-right"?1:-1,_=v==="ArrowRight"?1:-1,A;if(k){var I=$s(f),$=Ls(f),B=_*C,K=ge=>({active:!1,index:String(ge),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(A=-1,B>0){for(var q=0;q=0;R--)if(du(K(R),S,I,$)!=null){A=R;break}if(A<0)return}else{A=b+_*C;var de=(j==null?void 0:j.length)||S.length;if(de===0||A>=de||A<0)return}var Z=Hf(f,N,"hover",String(A));t.dispatch(Wf({active:!0,activeIndex:A.toString(),activeCoordinate:Z}))}finally{rs=null,Ia=null}};if(!u){l();return}a==="raf"?rs=requestAnimationFrame(l):typeof a=="number"&&Ia===null&&(l(),Wd=null,Ia=setTimeout(()=>{Wd?l():(Ia=null,rs=null)},a))}});Qh.startListening({actionCreator:YO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var a=r.tooltip.keyboardInteraction;if(!a.active&&a.index==null){var o="0",u=lc(r,r.tooltip.settings.shared),l=Hf(r,u,"hover",String(o));t.dispatch(Wf({active:!0,activeIndex:o,activeCoordinate:l}))}}}});Qh.startListening({actionCreator:XO,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var a=r.tooltip.keyboardInteraction;a.active&&t.dispatch(Wf({active:!1,activeIndex:a.index,activeCoordinate:a.coordinate}))}}});function ZO(e){e.persist();var t=e.currentTarget;return new Proxy(e,{get:(r,n)=>{if(n==="currentTarget")return t;var a=Reflect.get(r,n);return typeof a=="function"?a.bind(r):a}})}var Fr=Mr("externalEvent"),JO=Qu(),Hd=new Map,iu=new Map,Cv=new Map;JO.startListening({actionCreator:Fr,effect:(e,t)=>{var r=e.payload,n=r.handler,a=r.reactEvent;if(n!=null){var o=a.type,u=ZO(a);Cv.set(o,{handler:n,reactEvent:u});var l=Hd.get(o);l!==void 0&&(cancelAnimationFrame(l),Hd.delete(o));var f=t.getState(),h=f.eventSettings,p=h.throttleDelay,v=h.throttledEvents,x=v,b=x==="all"||(x==null?void 0:x.includes(o)),k=iu.get(o);k!==void 0&&(typeof p!="number"||!b)&&(clearTimeout(k),iu.delete(o));var j=()=>{var P=Cv.get(o);try{if(!P)return;var O=P.handler,C=P.reactEvent,_=t.getState(),A={activeCoordinate:m7(_),activeDataKey:f7(_),activeIndex:Lu(_),activeLabel:HA(_),activeTooltipIndex:Lu(_),isTooltipActive:v7(_)};O&&O(A,C)}finally{Hd.delete(o),iu.delete(o),Cv.delete(o)}};if(!b){j();return}if(p==="raf"){var S=requestAnimationFrame(j);Hd.set(o,S)}else if(typeof p=="number"){if(!iu.has(o)){j();var N=setTimeout(j,p);iu.set(o,N)}}else j()}}});var Bq=G([Xs],e=>e.tooltipItemPayloads),Uq=G([Bq,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(o=>o.settings.graphicalItemId===r);if(n!=null){var a=n.getPosition;if(a!=null)return a(t)}}}),e_=Mr("touchMove"),t_=Qu(),Ta=null,Hi=null,dN=null,au=null;t_.startListening({actionCreator:e_,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){au=ZO(r);var n=t.getState(),a=n.eventSettings,o=a.throttleDelay,u=a.throttledEvents,l=u==="all"||u.includes("touchmove");Ta!==null&&(cancelAnimationFrame(Ta),Ta=null),Hi!==null&&(typeof o!="number"||!l)&&(clearTimeout(Hi),Hi=null),dN=Array.from(r.touches).map(h=>q0({clientX:h.clientX,clientY:h.clientY,currentTarget:r.currentTarget}));var f=()=>{if(au!=null){var h=t.getState(),p=lc(h,h.tooltip.settings.shared);if(p==="axis"){var v,x=(v=dN)===null||v===void 0?void 0:v[0];if(x==null){Ta=null,Hi=null;return}var b=V0(h,x);(b==null?void 0:b.activeIndex)!=null&&t.dispatch(_A({activeIndex:b.activeIndex,activeDataKey:void 0,activeCoordinate:b.activeCoordinate}))}else if(p==="item"){var k,j=au.touches[0];if(document.elementFromPoint==null||j==null)return;var S=document.elementFromPoint(j.clientX,j.clientY);if(!S||!S.getAttribute)return;var N=S.getAttribute(X$),P=(k=S.getAttribute(Z$))!==null&&k!==void 0?k:void 0,O=bo(h).find(A=>A.id===P);if(N==null||O==null||P==null)return;var C=O.dataKey,_=Uq(h,N,P);t.dispatch(kU({activeDataKey:C,activeIndex:N,activeCoordinate:_,activeGraphicalItemId:P}))}Ta=null,Hi=null}};if(!l){f();return}o==="raf"?Ta=requestAnimationFrame(f):typeof o=="number"&&Hi===null&&(f(),au=null,Hi=setTimeout(()=>{au?f():(Hi=null,Ta=null)},o))}}});var r_={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},n_=rr({name:"eventSettings",initialState:r_,reducers:{setEventSettings:(e,t)=>{t.payload.throttleDelay!=null&&(e.throttleDelay=t.payload.throttleDelay),t.payload.throttledEvents!=null&&(e.throttledEvents=t.payload.throttledEvents)}}}),Wq=n_.actions.setEventSettings,Hq=n_.reducer,Kq=IE({brush:yG,cartesianAxis:uG,chartData:pW,errorBars:EV,eventSettings:Hq,graphicalItems:FK,layout:D$,legend:QL,options:uW,polarAxis:ZH,polarOptions:Fq,referenceElements:kG,renderedTicks:HG,rootProps:Rq,tooltip:SU,zIndex:Y7}),Gq=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return o$({reducer:Kq,preloadedState:t,middleware:n=>{var a;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((a="es6")!==null&&a!==void 0?a:"")}).concat([KO.middleware,GO.middleware,Qh.middleware,JO.middleware,t_.middleware])},enhancers:n=>{var a=n;return typeof n=="function"&&(a=n()),a.concat(qE({type:"raf"}))},devTools:{serialize:{replacer:Dq},name:"recharts-".concat(r)}})};function Vq(e){var t=e.preloadedState,r=e.children,n=e.reduxStoreName,a=wr(),o=y.useRef(null);if(a)return r;o.current==null&&(o.current=Gq(t,n));var u=jy;return y.createElement(dz,{context:u,store:o.current},r)}function qq(e){var t=e.layout,r=e.margin,n=kt(),a=wr();return y.useEffect(()=>{a||(n(M$(t)),n(_$(r)))},[n,a,t,r]),null}var Qq=y.memo(qq,Ah);function Yq(e){var t=kt();return y.useEffect(()=>{t($q(e))},[t,e]),null}var Xq=e=>{var t=kt();return y.useEffect(()=>{t(Wq(e))},[t,e]),null},Zq=y.memo(Xq,Ah);function fN(e){var t=e.zIndex,r=e.isPanorama,n=y.useRef(null),a=kt();return y.useLayoutEffect(()=>(n.current&&a(q7({zIndex:t,element:n.current,isPanorama:r})),()=>{a(Q7({zIndex:t,isPanorama:r}))}),[a,t,r]),y.createElement("g",{tabIndex:-1,ref:n,className:"recharts-zIndex-layer_".concat(t)})}function hN(e){var t=e.children,r=e.isPanorama,n=Ae(z7);if(!n||n.length===0)return t;var a=n.filter(u=>u<0),o=n.filter(u=>u>0);return y.createElement(y.Fragment,null,a.map(u=>y.createElement(fN,{key:u,zIndex:u,isPanorama:r})),t,o.map(u=>y.createElement(fN,{key:u,zIndex:u,isPanorama:r})))}var Jq=["children"];function eQ(e,t){if(e==null)return{};var r,n,a=tQ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=gP(),n=yP(),a=CP();if(!Rn(r)||!Rn(n))return null;var o=e.children,u=e.otherAttributes,l=e.title,f=e.desc,h,p;return u!=null&&(typeof u.tabIndex=="number"?h=u.tabIndex:h=a?0:void 0,typeof u.role=="string"?p=u.role:p=a?"application":void 0),y.createElement(X2,Xf({},u,{title:l,desc:f,role:p,tabIndex:h,width:r,height:n,style:rQ,ref:t}),o)}),iQ=e=>{var t=e.children,r=Ae(Sh);if(!r)return null;var n=r.width,a=r.height,o=r.y,u=r.x;return y.createElement(X2,{width:n,height:a,x:u,y:o},t)},pN=y.forwardRef((e,t)=>{var r=e.children,n=eQ(e,Jq),a=wr();return a?y.createElement(iQ,null,y.createElement(hN,{isPanorama:!0},r)):y.createElement(nQ,Xf({ref:t},n),y.createElement(hN,{isPanorama:!1},r))});function aQ(e,t){return uQ(e)||lQ(e,t)||sQ(e,t)||oQ()}function oQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sQ(e,t){if(e){if(typeof e=="string")return mN(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?mN(e,t):void 0}}function mN(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r{if(n!=null){var u=n.getBoundingClientRect(),l=u.width/n.offsetWidth;Be(l)&&l!==o&&e(T$(l))}},[n,e,o]),a}function vN(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),r.push.apply(r,n)}return r}function dQ(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r(jW(),null);function Jf(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var bQ=y.forwardRef((e,t)=>{var r,n,a=y.useRef(null),o=y.useState({containerWidth:Jf((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Jf((n=e.style)===null||n===void 0?void 0:n.height)}),u=Zf(o,2),l=u[0],f=u[1],h=y.useCallback((v,x)=>{f(b=>{var k=Math.round(v),j=Math.round(x);return b.containerWidth===k&&b.containerHeight===j?b:{containerWidth:k,containerHeight:j}})},[]),p=y.useCallback(v=>{if(typeof t=="function"&&t(v),a.current!=null&&(a.current.disconnect(),a.current=null),v!=null&&typeof ResizeObserver<"u"){var x=v.getBoundingClientRect(),b=x.width,k=x.height;h(b,k);var j=N=>{var P=N[0];if(P!=null){var O=P.contentRect,C=O.width,_=O.height;h(C,_)}},S=new ResizeObserver(j);S.observe(v),a.current=S}},[t,h]);return y.useEffect(()=>()=>{var v=a.current;v!=null&&v.disconnect()},[h]),y.createElement(y.Fragment,null,y.createElement(Xu,{width:l.containerWidth,height:l.containerHeight}),y.createElement("div",ua({ref:p},e)))}),wQ=y.forwardRef((e,t)=>{var r=e.width,n=e.height,a=y.useState({containerWidth:Jf(r),containerHeight:Jf(n)}),o=Zf(a,2),u=o[0],l=o[1],f=y.useCallback((p,v)=>{l(x=>{var b=Math.round(p),k=Math.round(v);return x.containerWidth===b&&x.containerHeight===k?x:{containerWidth:b,containerHeight:k}})},[]),h=y.useCallback(p=>{if(typeof t=="function"&&t(p),p!=null){var v=p.getBoundingClientRect(),x=v.width,b=v.height;f(x,b)}},[t,f]);return y.createElement(y.Fragment,null,y.createElement(Xu,{width:u.containerWidth,height:u.containerHeight}),y.createElement("div",ua({ref:h},e)))}),kQ=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return y.createElement(y.Fragment,null,y.createElement(Xu,{width:r,height:n}),y.createElement("div",ua({ref:t},e)))}),jQ=y.forwardRef((e,t)=>{var r=e.width,n=e.height;return typeof r=="string"||typeof n=="string"?y.createElement(wQ,ua({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?y.createElement(kQ,ua({},e,{width:r,height:n,ref:t})):y.createElement(y.Fragment,null,y.createElement(Xu,{width:r,height:n}),y.createElement("div",ua({ref:t},e)))});function SQ(e){return e?bQ:jQ}var NQ=y.forwardRef((e,t)=>{var r=e.children,n=e.className,a=e.height,o=e.onClick,u=e.onContextMenu,l=e.onDoubleClick,f=e.onMouseDown,h=e.onMouseEnter,p=e.onMouseLeave,v=e.onMouseMove,x=e.onMouseUp,b=e.onTouchEnd,k=e.onTouchMove,j=e.onTouchStart,S=e.style,N=e.width,P=e.responsive,O=e.dispatchTouchEvents,C=O===void 0?!0:O,_=y.useRef(null),A=kt(),I=y.useState(null),$=Zf(I,2),B=$[0],K=$[1],q=y.useState(null),R=Zf(q,2),de=R[0],Z=R[1],ge=cQ(),ke=Oy(),me=(ke==null?void 0:ke.width)>0?ke.width:N,Q=(ke==null?void 0:ke.height)>0?ke.height:a,oe=y.useCallback(ce=>{ge(ce),typeof t=="function"&&t(ce),K(ce),Z(ce),ce!=null&&(_.current=ce)},[ge,t,K,Z]),X=y.useCallback(ce=>{A(HO(ce)),A(Fr({handler:o,reactEvent:ce}))},[A,o]),L=y.useCallback(ce=>{A(Zg(ce)),A(Fr({handler:h,reactEvent:ce}))},[A,h]),T=y.useCallback(ce=>{A(OA()),A(Fr({handler:p,reactEvent:ce}))},[A,p]),ee=y.useCallback(ce=>{A(Zg(ce)),A(Fr({handler:v,reactEvent:ce}))},[A,v]),ne=y.useCallback(()=>{A(YO())},[A]),te=y.useCallback(()=>{A(XO())},[A]),ue=y.useCallback(ce=>{A(QO(ce.key))},[A]),pe=y.useCallback(ce=>{A(Fr({handler:u,reactEvent:ce}))},[A,u]),Oe=y.useCallback(ce=>{A(Fr({handler:l,reactEvent:ce}))},[A,l]),J=y.useCallback(ce=>{A(Fr({handler:f,reactEvent:ce}))},[A,f]),je=y.useCallback(ce=>{A(Fr({handler:x,reactEvent:ce}))},[A,x]),_e=y.useCallback(ce=>{A(Fr({handler:j,reactEvent:ce}))},[A,j]),ae=y.useCallback(ce=>{C&&A(e_(ce)),A(Fr({handler:k,reactEvent:ce}))},[A,C,k]),Xe=y.useCallback(ce=>{A(Fr({handler:b,reactEvent:ce}))},[A,b]),Y=SQ(P);return y.createElement(ZA.Provider,{value:B},y.createElement(z4.Provider,{value:de},y.createElement(Y,{width:me??(S==null?void 0:S.width),height:Q??(S==null?void 0:S.height),className:et("recharts-wrapper",n),style:dQ({position:"relative",cursor:"default",width:me,height:Q},S),onClick:X,onContextMenu:pe,onDoubleClick:Oe,onFocus:ne,onBlur:te,onKeyDown:ue,onMouseDown:J,onMouseEnter:L,onMouseLeave:T,onMouseMove:ee,onMouseUp:je,onTouchEnd:Xe,onTouchMove:ae,onTouchStart:_e,ref:oe},y.createElement(xQ,null),r)))}),EQ=["width","height","responsive","children","className","style","compact","title","desc"];function PQ(e,t){if(e==null)return{};var r,n,a=CQ(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n{var r=e.width,n=e.height,a=e.responsive,o=e.children,u=e.className,l=e.style,f=e.compact,h=e.title,p=e.desc,v=PQ(e,EQ),x=dn(v);return f?y.createElement(y.Fragment,null,y.createElement(Xu,{width:r,height:n}),y.createElement(pN,{otherAttributes:x,title:h,desc:p},o)):y.createElement(NQ,{className:u,style:l,width:r,height:n,responsive:a??!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},y.createElement(pN,{otherAttributes:x,title:h,desc:p,ref:t},y.createElement(AG,null,o)))});function Jg(){return Jg=Object.assign?Object.assign.bind():function(e){for(var t=1;ty.createElement(RQ,{chartName:"AreaChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:$Q,tooltipPayloadSearcher:sW,categoricalChartProps:e,ref:t}));const zQ="rgba(130,130,150,0.14)",xN="rgba(130,130,150,0.85)";function FQ(e){if(e<=0)return 10;const t=Math.pow(10,Math.floor(Math.log10(e))),r=e/t;return(r<=1?1:r<=2?2:r<=5?5:10)*t}function i_(e,t){return`${t==="%"?Math.round(e):e>=1e3?`${(e/1e3).toFixed(1)}k`:Math.round(e).toString()}${t}`}function BQ({active:e,payload:t,unit:r}){return!e||!(t!=null&&t.length)?null:c.jsx("div",{className:"rounded-lg border border-border/70 bg-popover/95 px-3 py-2 shadow-xl backdrop-blur",children:c.jsx("div",{className:"space-y-1",children:t.map(n=>c.jsxs("div",{className:"flex items-center gap-2 text-[11px] font-mono",children:[c.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:n.color}}),c.jsx("span",{className:"uppercase tracking-wider text-muted-foreground",children:n.name}),c.jsx("span",{className:"ml-auto pl-3 font-bold tabular-nums text-foreground",children:i_(n.value,r)})]},n.dataKey))})})}function a_({data:e,series:t,unit:r="%",yMode:n="percent",height:a=176}){const o=e.reduce((l,f)=>t.reduce((h,p)=>Math.max(h,Number(f[p.key])||0),l),0),u=n==="percent"?Math.min(100,Math.max(25,Math.ceil(o*1.2/25)*25)):Math.max(FQ(o*1.15),10);return c.jsx("div",{style:{height:a},className:"w-full",children:c.jsx(_L,{width:"100%",height:"100%",children:c.jsxs(LQ,{data:e,margin:{top:8,right:6,bottom:0,left:-12},children:[c.jsx("defs",{children:t.map(l=>c.jsxs("linearGradient",{id:`grad-${l.key}`,x1:"0",y1:"0",x2:"0",y2:"1",children:[c.jsx("stop",{offset:"0%",stopColor:l.color,stopOpacity:.22}),c.jsx("stop",{offset:"100%",stopColor:l.color,stopOpacity:0})]},l.key))}),c.jsx(AO,{vertical:!1,stroke:zQ}),c.jsx(UO,{dataKey:"t",hide:!0}),c.jsx(WO,{domain:[0,u],ticks:[0,u/2,u],tickFormatter:l=>i_(l,r),width:42,axisLine:!1,tickLine:!1,tick:{fontSize:10,fill:xN}}),c.jsx(RW,{content:c.jsx(BQ,{unit:r}),cursor:{stroke:xN,strokeOpacity:.4,strokeDasharray:"3 3"}}),t.map(l=>c.jsx(FO,{type:"monotone",dataKey:l.key,name:l.label,stroke:l.color,strokeWidth:2,fill:`url(#grad-${l.key})`,dot:!1,activeDot:{r:3,strokeWidth:0},isAnimationActive:!1,connectNulls:!0},l.key))]})})})}const UQ=[{key:"cpu",label:"CPU",color:"#2dd4bf"},{key:"ram",label:"RAM",color:"#38bdf8"},{key:"gpu",label:"GPU",color:"#a78bfa"},{key:"disk",label:"Disk",color:"#fbbf24"}];function WQ(){var u,l,f,h;const{sys:e,hist:t}=C4(),r=!!(e!=null&&e.gpu&&e.gpu.busy_percent!=null&&e.gpu.gtt_used!=null&&e.gpu.gtt_total!=null),n=UQ.filter(p=>p.key!=="gpu"||r),a={cpu:(u=e==null?void 0:e.cpu)==null?void 0:u.percent,ram:(l=e==null?void 0:e.ram)==null?void 0:l.percent,gpu:r?e.gpu.busy_percent:null,disk:(f=e==null?void 0:e.disk)==null?void 0:f.percent},o={cpu:(h=e==null?void 0:e.cpu)!=null&&h.cores?`${e.cpu.cores} Cores`:"",ram:e?`${Qo(e.ram.used)}/${Qo(e.ram.total)} GB`:"",gpu:r?`${Qo(e.gpu.gtt_used)}/${Qo(e.gpu.gtt_total)} GB`:"",disk:e!=null&&e.disk?`${Qo(e.disk.used)}/${Qo(e.disk.total)} GB`:""};return c.jsxs("div",{className:"flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[c.jsx(_n,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"System-Status"}),c.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mb-2 grid grid-cols-2 gap-x-4 gap-y-1.5",children:n.map(p=>c.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 shrink-0 rounded-full",style:{background:p.color}}),c.jsx("span",{className:"shrink-0 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:p.label}),c.jsxs("span",{className:"shrink-0 font-mono text-xs font-bold tabular-nums text-foreground",children:[Math.round(a[p.key]??0),"%"]}),o[p.key]&&c.jsx("span",{className:"truncate font-mono text-[10px] text-muted-foreground/60",children:o[p.key]})]},p.key))}),c.jsx(a_,{data:t,series:n,unit:"%",yMode:"percent",height:176})]}):c.jsx("div",{className:"flex h-44 items-center justify-center text-xs text-muted-foreground",children:"Lade Systemdaten…"})]}),(e==null?void 0:e.temp)&&(e.temp.cpu||e.temp.gpu)&&c.jsxs("div",{className:"mt-3 flex gap-4 border-t border-border/30 pt-3 font-mono text-xs text-muted-foreground/80",children:[e.temp.cpu!=null&&c.jsxs("span",{children:["CPU Temp: ",e.temp.cpu," °C"]}),e.temp.gpu!=null&&c.jsxs("span",{children:["GPU Temp: ",e.temp.gpu," °C"]})]})]})}function Kd({label:e,value:t,tone:r}){return c.jsxs("div",{className:fe("flex items-center justify-between rounded-lg border px-3 py-1.5 text-xs",r==="alert"?"border-amber-500/30 bg-amber-500/5 font-semibold text-amber-400":r==="accent"?"border-primary/30 bg-primary/5 font-semibold text-primary":"border-border/30 bg-background/25 text-muted-foreground"),children:[c.jsx("span",{className:"flex items-center gap-1.5",children:e}),c.jsx("span",{className:"font-mono text-[10px]",children:t})]})}function HQ(){var r;const{data:e}=hy(3e3),t=()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"maintenance"}}));return c.jsxs("div",{className:"flex flex-col justify-between rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border/20 pb-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(kI,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Updates & Pflege"})]}),(e==null?void 0:e.last_check)&&c.jsxs("span",{className:"font-mono text-[9px] text-muted-foreground/80",children:["Zuletzt gesucht: ",new Date(e.last_check*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit"})]})]}),e?c.jsxs("div",{className:"space-y-1.5",children:[c.jsx(Kd,{label:"OS-Pakete",tone:e.os>0?"alert":"muted",value:e.os>0?`${e.os} verfügbar`:"aktuell"}),c.jsx(Kd,{label:"Engine (llama.cpp)",tone:e.engine>0?"alert":"muted",value:e.engine>0?"Update verfügbar":"aktuell"}),c.jsx(Kd,{label:"Modell-Upgrades",tone:e.models>0?"accent":"muted",value:e.models>0?`${e.models} verfügbar`:"aktuell"}),(r=e.components)==null?void 0:r.map(n=>c.jsx(Kd,{tone:n.update===!0?"alert":"muted",label:c.jsxs(c.Fragment,{children:[n.name,n.reachable===!1&&c.jsx("span",{className:"text-[8px] font-bold uppercase text-red-400/80",children:"offline"})]}),value:n.update===!0?`Update: ${n.latest}`:n.update===!1?"aktuell":n.latest?`neueste: ${n.latest}`:"—"},n.key))]}):c.jsx("div",{className:"flex h-24 items-center justify-center text-xs text-muted-foreground",children:"Lade Updates..."})]}),c.jsxs("button",{onClick:t,className:"mt-4 flex h-9 w-full items-center justify-center gap-1.5 rounded-lg bg-primary text-xs font-semibold text-primary-foreground shadow-md shadow-primary/10 transition-all hover:opacity-90 cursor-pointer",children:["Updates verwalten & Pflege ",c.jsx(ZN,{className:"h-3.5 w-3.5"})]})]})}function o_({type:e,title:t,message:r,defaultValue:n,autoValue:a,autoLabel:o,onConfirm:u,onCancel:l}){const f=y.useRef(null);return c.jsx("div",{className:"fixed inset-0 z-[99] bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:t}),c.jsx("button",{onClick:l||(()=>u()),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:r}),e==="prompt"&&c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{ref:f,type:"text",defaultValue:n,className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground",autoFocus:!0,onKeyDown:h=>{var p;h.key==="Enter"&&u((p=f.current)==null?void 0:p.value)}}),a!==void 0&&c.jsx("button",{type:"button",onClick:()=>{f.current&&(f.current.value=a)},title:"Setup-bewussten Optimalwert eintragen",className:"h-9 px-3 shrink-0 text-xs font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg transition-colors cursor-pointer",children:o||"Auto"})]}),c.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[(e==="confirm"||e==="prompt")&&c.jsx("button",{onClick:l,className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Abbrechen"}),c.jsx("button",{onClick:()=>{var p;const h=e==="prompt"?(p=f.current)==null?void 0:p.value:void 0;u(h)},className:"h-8 px-4 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-lg transition-colors cursor-pointer",children:e==="confirm"?"Ja, fortfahren":e==="prompt"?"Übernehmen":"OK"})]})]})})}function el(){const[e,t]=y.useState(null),r=y.useCallback(()=>t(null),[]),n=y.useCallback((l,f,h)=>{t({type:"alert",title:l,message:f,onConfirm:()=>{t(null),h==null||h()}})},[]),a=y.useCallback((l,f,h,p)=>{t({type:"confirm",title:l,message:f,onConfirm:()=>{t(null),h()},onCancel:()=>{t(null),p==null||p()}})},[]),o=y.useCallback((l,f,h,p,v,x)=>{t({type:"prompt",title:l,message:f,defaultValue:h,autoValue:x==null?void 0:x.autoValue,autoLabel:x==null?void 0:x.autoLabel,onConfirm:b=>{t(null),p(b)},onCancel:()=>{t(null),v==null||v()}})},[]),u=e?c.jsx(o_,{...e}):null;return{showAlert:n,showConfirm:a,showPrompt:o,close:r,dialogElement:u}}function KQ(){const e=po(),{data:t}=fy(3e3),{data:r}=vo(),{showAlert:n,dialogElement:a}=el(),[o,u]=y.useState(!1),l=(r==null?void 0:r.models)??[];async function f(h){try{await Me("/api/agent/brain",{method:"POST",body:JSON.stringify({model:h})}),n("Erfolgreich",`Hermes-Gehirn wurde auf '${h}' geändert. Der Gateway-Dienst wurde neu gestartet.`),e.invalidateQueries({queryKey:wt.agentStatus}),u(!1)}catch(p){n("Fehler",`Fehler beim Wechseln des Gehirns: ${p.message}`)}}return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ps,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Hermes Agent"})]}),(t==null?void 0:t.terminal_url)&&c.jsxs("a",{href:_s(t.terminal_url),target:"_blank",rel:"noopener",className:fe("flex items-center gap-1 px-3 py-1 rounded-lg text-xs font-medium transition-all",t.terminal_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/20":"border border-border text-muted-foreground"),children:[c.jsx(xu,{className:"h-3 w-3"})," Terminal öffnen"]})]}),t?c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[c.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gateway"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("span",{className:fe("h-2 w-2 rounded-full",t.gateway_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-medium",children:t.gateway_reachable?"Online":"Offline"})]})]}),c.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[c.jsx("div",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Terminal"}),c.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[c.jsx("span",{className:fe("h-2 w-2 rounded-full",t.terminal_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-medium",children:t.terminal_reachable?"Online":"Offline"})]})]}),c.jsxs("div",{onClick:()=>u(!0),className:"p-3 bg-background/20 rounded-xl border border-border/40 hover:border-primary/45 hover:bg-background/30 transition-all duration-300 cursor-pointer",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Gehirn"}),c.jsx(_n,{className:"h-3 w-3 text-primary"})]}),c.jsxs("div",{className:"text-xs font-medium mt-1 font-mono text-primary truncate flex items-center gap-1",children:[c.jsx(bu,{className:"h-3 w-3 shrink-0"}),t.brain_model||"auto"]})]}),c.jsxs("div",{className:"p-3 bg-background/20 rounded-xl border border-border/40",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsx("span",{className:"text-[10px] text-muted-foreground uppercase font-semibold",children:"Verdrahtung"}),c.jsx(ku,{className:"h-3 w-3 text-primary"})]}),c.jsxs("div",{className:"text-[10px] font-mono mt-1 space-y-0.5 text-muted-foreground",children:[c.jsxs("div",{children:["Config: ",t.has_config?c.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]}),c.jsxs("div",{children:["Skills: ",t.has_skills?c.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]}),c.jsxs("div",{children:["Memory: ",t.has_memories?c.jsx("span",{className:"text-emerald-400",children:"✓"}):"—"]})]})]})]}):c.jsx("div",{className:"h-28 flex items-center justify-center text-xs text-muted-foreground",children:"Lade Agenten-Status…"})]}),t&&c.jsxs("div",{className:"mt-3 border-t border-border/30 pt-3 space-y-1.5",children:[c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"Telegram"}),c.jsx("span",{className:fe("font-semibold",t.telegram_enabled?"text-emerald-400":""),children:t.telegram_enabled?"aktiv":"nicht konfiguriert"})]}),c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"MCP-Server"}),c.jsxs("span",{className:"font-semibold text-foreground",children:[t.mcp_server_count??0," verbunden"]})]}),c.jsxs("div",{className:"flex items-center justify-between text-[10px] text-muted-foreground",children:[c.jsx("span",{children:"PC Executor"}),c.jsx("span",{className:fe("font-semibold",t.pc_executor_reachable?"text-emerald-400":""),children:t.pc_executor_reachable?"erreichbar":"nicht verbunden"})]})]}),t&&o&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[c.jsx(_n,{className:"h-4 w-4"}),c.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),c.jsx("button",{onClick:()=>u(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',c.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),c.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:["auto","fast","heavy",...l.map(h=>{var p;return((p=h.name.split("/").pop())==null?void 0:p.replace(".gguf",""))||h.name})].map(h=>{const p=["auto","fast","heavy"].includes(h);return c.jsxs("button",{onClick:()=>f(h),className:fe("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",t.brain_model===h||!t.brain_model&&h==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[c.jsxs("div",{className:"flex flex-col text-left",children:[c.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:h}),c.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:p?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(t.brain_model===h||!t.brain_model&&h==="auto")&&c.jsx(Cn,{className:"h-4 w-4 shrink-0 text-primary"})]},h)})})]})}),a]})}function GQ(){const{data:e}=vo(3e3),t=(e==null?void 0:e.models)??[],r=(e==null?void 0:e.running)??[];return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(bu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Rollen-Belegung"})]}),c.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto pr-1 scrollbar-thin",children:G2.map(n=>{var u;const a=t.find(l=>l.role===n),o=a?r.includes(a.name):!1;return c.jsxs("div",{className:fe("flex items-center justify-between p-2 rounded-xl border transition-all duration-300",o?"border-emerald-500/30 bg-emerald-500/5 shadow-sm shadow-emerald-500/5":a?"border-primary/20 bg-primary/5":"border-border/30 bg-background/10 opacity-60"),children:[c.jsx("div",{className:"min-w-0 flex-1 mr-2",children:c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx("span",{className:fe("text-[9px] font-semibold uppercase px-1.5 py-0.5 rounded font-mono border tracking-wider shrink-0",my(n)),children:n}),c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"text-xs font-semibold truncate font-mono text-foreground",children:a?(u=a.name.split("/").pop())==null?void 0:u.replace(/\.gguf$/i,""):"nicht zugewiesen"}),a&&c.jsxs("div",{className:"flex gap-1 items-center mt-0.5 flex-wrap",children:[a.prompt_cache&&c.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-cyan-500/10 text-cyan-400 border border-cyan-500/20 px-1 py-0.5 rounded",title:"Prompt Caching aktiv",children:"PC"}),a.spec_active&&c.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 px-1 py-0.5 rounded",title:`Speculative Decoding aktiv (Draft: ${a.spec_draft_model})`,children:"SPEC"}),a.parallel_slots>1&&c.jsxs("span",{className:"text-[7px] leading-none font-mono font-bold bg-violet-500/10 text-violet-400 border border-violet-500/20 px-1 py-0.5 rounded",title:`${a.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",a.parallel_slots]}),a.incomplete&&c.jsx("span",{className:"text-[7px] leading-none font-mono font-bold bg-amber-500/10 text-amber-400 border border-amber-500/20 px-1 py-0.5 rounded",title:"GGUF-Datei fehlt",children:"⚠ fehlt"})]})]})]})}),c.jsx("div",{className:"flex items-center gap-1.5 shrink-0",children:a?o?c.jsxs("span",{className:"flex items-center gap-1 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider font-mono",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]}):c.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground uppercase tracking-wider font-mono",children:"bereit"}):c.jsx("span",{className:"text-[8px] font-semibold text-muted-foreground/60 uppercase tracking-wider font-mono",children:"—"})})]},n)})})]}),c.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Laden erfolgt automatisch per Auto-Swap."})]})}function VQ(){const e=po(),{data:t=[]}=z2({limit:3}),[r,n]=y.useState(""),[a,o]=y.useState("stable"),[u,l]=y.useState(!1);async function f(){if(!(!r.trim()||u)){l(!0);try{await Me("/api/memory",{method:"POST",body:JSON.stringify({content:r,category:a,source:"dashboard"})}),n(""),e.invalidateQueries({queryKey:["memory"]})}catch(h){console.error(h)}finally{l(!1)}}}return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15 flex flex-col justify-between",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[c.jsx(yu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase text-foreground",children:"Gedächtnis"})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("textarea",{value:r,onChange:h=>n(h.target.value),placeholder:"Fakt / Regel im Pool speichern...",rows:2,className:"w-full resize-none rounded-xl border border-border/50 bg-background/30 p-2 text-[10px] outline-none focus:ring-1 focus:ring-primary transition-all leading-normal"}),c.jsxs("div",{className:"flex items-center gap-2 justify-between",children:[c.jsxs("select",{value:a,onChange:h=>o(h.target.value),className:"h-7 rounded-lg border border-border/50 bg-background/50 px-2 text-[10px] outline-none cursor-pointer",children:[c.jsx("option",{value:"stable",children:"🔵 Fakt"}),c.jsx("option",{value:"instruction",children:"📋 Regel"}),c.jsx("option",{value:"user",children:"👤 User"}),c.jsx("option",{value:"versioned",children:"🟡 Version"})]}),c.jsxs("button",{onClick:f,disabled:!r.trim()||u,className:"flex h-7 items-center gap-1 rounded-lg bg-primary px-3 text-[10px] font-semibold text-primary-foreground hover:opacity-90 disabled:opacity-50 transition-all cursor-pointer",children:[c.jsx(e2,{className:"h-3.5 w-3.5"})," Speichern"]})]})]}),c.jsxs("div",{className:"mt-3.5 space-y-1.5",children:[c.jsx("div",{className:"text-[9px] text-muted-foreground uppercase font-bold tracking-wider",children:"Zuletzt gespeichert:"}),c.jsx("div",{className:"max-h-20 overflow-y-auto space-y-1 pr-1 scrollbar-thin",children:t.length===0?c.jsx("div",{className:"text-[10px] text-muted-foreground/75 py-1",children:"Keine Einträge vorhanden."}):t.map(h=>c.jsxs("div",{className:"text-[10px] bg-background/10 border border-border/30 rounded p-1.5 flex items-start gap-1.5",children:[c.jsx("span",{className:"shrink-0 text-[8px] font-mono text-muted-foreground/80 px-1 py-0.5 rounded bg-muted/20",children:h.category}),c.jsx("span",{className:"truncate flex-1 text-muted-foreground hover:text-foreground transition-colors",title:h.content,children:h.content})]},h.id))})]})]}),c.jsx("div",{className:"mt-4 text-[10px] text-muted-foreground/80 border-t border-border/30 pt-3",children:"Steht allen Clients per MCP zur Verfügung."})]})}const bN=[{key:"prompt",label:"Prompt",color:"#f59e0b"},{key:"completion",label:"Antwort",color:"#2dd4bf"}];function qQ(){const{data:e}=dy(3e3),t=E4(),r=t[t.length-1],n=r?Math.round(r.prompt+r.completion):0;return c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(gu,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Token-Durchsatz"}),c.jsxs("span",{className:"ml-1 inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground/70",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," live"]})]}),e&&c.jsxs("div",{className:"mt-2 flex items-baseline gap-2",children:[c.jsx("span",{className:"font-space text-3xl font-bold tracking-tight text-foreground tabular-nums",children:n.toLocaleString("de-DE")}),c.jsx("span",{className:"text-xs text-muted-foreground",children:"tok/s aktuell"})]}),e&&c.jsxs("div",{className:"mt-0.5 space-y-0.5 font-mono text-[11px] text-muted-foreground/70",children:[c.jsxs("div",{children:[e.total_tokens.toLocaleString("de-DE")," Tokens gesamt · ",c.jsxs("span",{className:"text-emerald-400/90",children:[e.saved_eur.toLocaleString("de-DE",{minimumFractionDigits:2})," € gespart"]})]}),c.jsxs("div",{className:"text-muted-foreground/55",children:["Input ",e.prompt_tokens.toLocaleString("de-DE")," · Output ",e.completion_tokens.toLocaleString("de-DE")]})]})]}),c.jsx("div",{className:"flex shrink-0 flex-col items-end gap-1.5 pt-1",children:bN.map(a=>c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full",style:{background:a.color}}),c.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:a.label}),c.jsx("span",{className:"font-mono text-xs font-bold tabular-nums text-foreground",children:Math.round((r==null?void 0:r[a.key])??0)})]},a.key))})]}),e?c.jsx(a_,{data:t,series:bN,unit:" tok/s",yMode:"auto",height:150}):c.jsx("div",{className:"flex h-[150px] items-center justify-center text-xs text-muted-foreground",children:"Lade Durchsatz…"}),c.jsx("div",{className:"mt-2 border-t border-border/30 pt-2 text-[10px] text-muted-foreground/70",children:"Durchsatz aus dem Gateway abgeleitet (Prefill vs. Generierung). Flach bei Leerlauf."})]})}function QQ(){const{data:e}=D3(3e3),{showAlert:t,dialogElement:r}=el(),[n,a]=y.useState({});async function o(u){a(l=>({...l,[u]:!0}));try{const l=await Me("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:u})});l.ok||t("Fehler",`Neustart fehlgeschlagen: ${l.err||"Unbekannt"}`)}catch(l){t("Fehler",`Fehler: ${l.message}`)}finally{a(l=>({...l,[u]:!1}))}}return c.jsxs("div",{className:"flex flex-col rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/15",children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(t2,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold uppercase tracking-wide text-foreground",children:"Dienste"})]}),c.jsx("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-system-drawer",{detail:{tab:"logs"}})),className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground transition-colors hover:text-primary cursor-pointer",children:"Logs / Pflege"})]}),e?c.jsxs("div",{className:"flex flex-1 flex-col",children:[c.jsx("div",{className:"space-y-1.5",children:e.services.map(u=>c.jsxs("div",{className:"group flex items-center justify-between gap-2 rounded-xl border border-border/30 bg-background/20 p-2.5",children:[c.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[c.jsx("span",{className:fe("h-2.5 w-2.5 shrink-0 rounded-full ring-2 ring-black/40",u.ok?"bg-emerald-500":"bg-amber-500")}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"truncate text-xs font-bold text-foreground",children:u.name}),c.jsx("div",{className:"truncate font-mono text-[9px] text-muted-foreground/60",children:u.url})]})]}),c.jsx("button",{onClick:()=>o(u.name),disabled:n[u.name],className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-lg border border-border/40 text-muted-foreground opacity-0 transition-all hover:bg-primary/5 hover:text-primary group-hover:opacity-100",title:"Dienst neu starten",children:c.jsx(cu,{className:fe("h-3.5 w-3.5",n[u.name]&&"animate-spin")})})]},u.name))}),c.jsxs("div",{className:"mt-auto flex flex-wrap gap-3 border-t border-border/20 pt-2.5 text-[10px] font-semibold text-muted-foreground",children:[c.jsxs("a",{href:_s(e.links.engine_ui),target:"_blank",rel:"noopener",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-primary transition-colors hover:bg-primary/10",children:[c.jsx(xu,{className:"h-3 w-3"})," Engine"]}),c.jsxs("a",{href:_s(e.links.gateway),target:"_blank",rel:"noopener",className:"flex items-center gap-1 rounded px-1.5 py-0.5 text-primary transition-colors hover:bg-primary/10",children:[c.jsx(xu,{className:"h-3 w-3"})," Gateway"]})]})]}):c.jsx("div",{className:"flex h-24 items-center justify-center text-xs text-muted-foreground",children:"Lade Dienste…"}),r]})}function wN({children:e}){return c.jsx("p",{className:"mb-2 ml-0.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground/60",children:e})}function YQ(){return c.jsxs("div",{className:"space-y-7",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Zentrale"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Aktueller Status von System, Modellen und Agent."})]}),c.jsxs("div",{className:"grid items-stretch gap-6 lg:grid-cols-3",children:[c.jsx(WQ,{}),c.jsx(qQ,{}),c.jsx(k4,{})]}),c.jsxs("section",{children:[c.jsx(wN,{children:"Stack-Status"}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[c.jsx(GQ,{}),c.jsx(QQ,{})]})]}),c.jsxs("section",{children:[c.jsx(wN,{children:"Betrieb & Wissen"}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-3",children:[c.jsx(HQ,{}),c.jsx(KQ,{}),c.jsx(VQ,{})]})]})]})}function XQ(){const e=po(),{data:t=[]}=$3(2e3),{showAlert:r,dialogElement:n}=el();async function a(l){try{await Me(`/api/jobs/${l}/cancel`,{method:"POST"}),e.invalidateQueries({queryKey:wt.jobs})}catch(f){r("Fehler",f.message)}}const o=t.filter(l=>l.state==="running"||l.state==="queued"),u=t.filter(l=>l.state!=="running"&&l.state!=="queued").slice(-3);return o.length===0&&u.length===0?null:c.jsxs("div",{className:"space-y-3 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-4 shadow-lg shadow-black/10",children:[c.jsx("div",{className:"text-[11px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Aktive Downloads"}),o.map(l=>c.jsxs("div",{className:"space-y-1.5 p-3 rounded-xl bg-background/20 border border-border/40",children:[c.jsxs("div",{className:"flex justify-between items-center text-xs",children:[c.jsx("span",{className:"font-semibold truncate max-w-[250px]",children:l.label}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"text-muted-foreground font-mono",children:[l.progress??0,"% • ",tg(l.done_bytes),"/",tg(l.total_bytes),l.eta_s?` • ETA ${B3(l.eta_s)}`:""]}),c.jsx("button",{onClick:()=>a(l.id),className:"text-[10px] text-red-400 hover:text-red-300 font-semibold border border-red-500/25 bg-red-500/5 px-2 py-0.5 rounded transition-all cursor-pointer",children:"Abbrechen"})]})]}),c.jsx("div",{className:"h-1.5 overflow-hidden rounded-full bg-muted",children:c.jsx("div",{className:"h-full rounded-full bg-primary transition-all duration-500",style:{width:`${l.progress??0}%`}})})]},l.id)),u.map(l=>c.jsxs("div",{className:"flex justify-between items-center text-xs text-muted-foreground px-1",children:[c.jsx("span",{className:"truncate",children:l.label}),c.jsx("span",{className:fe("font-semibold text-[10px] px-1.5 py-0.5 rounded uppercase font-mono",l.state==="done"?"bg-emerald-500/10 text-emerald-400":"bg-amber-500/10 text-amber-400"),children:l.state})]},l.id)),n]})}function Da({children:e,tone:t="muted"}){const r={muted:"bg-muted text-muted-foreground",primary:"bg-primary/15 text-primary",warn:"bg-amber-500/15 text-amber-500"};return c.jsx("span",{className:`rounded px-1.5 py-0.5 text-[11px] font-medium ${r[t]}`,children:e})}function kN({caps:e}){return e?c.jsxs("span",{className:"inline-flex flex-wrap gap-1",children:[e.coder&&c.jsx(Da,{children:"💻 Code"}),e.vision&&c.jsx(Da,{children:"👁 Bild"}),e.reasoning&&c.jsx(Da,{children:"🧠 Reason"}),e.moe&&c.jsxs(Da,{tone:"primary",children:["🧩 MoE",e.active_b?`·${e.active_b}b`:""]}),e.tools==="yes"&&c.jsx(Da,{tone:"primary",children:"🛠 Tools"}),e.tools==="likely"&&c.jsx(Da,{tone:"warn",children:"🛠 Tools?"}),e.embedding&&c.jsx(Da,{children:"🔢 Embed"})]}):null}function ZQ({model:e,onClose:t,onChanged:r}){var j,S;const{data:n,isLoading:a}=F3(e.gguf_path),[o,u]=y.useState(null),[l,f]=y.useState(""),h=n==null?void 0:n.target_vocab,p=(n==null?void 0:n.drafts)??[],v=p.filter(N=>N.compatible===!0),x=e.spec_draft_model;async function b(N){u(N??"__clear__"),f("");try{await Me(`/api/models/${encodeURIComponent(e.name)}/draft`,{method:"POST",body:JSON.stringify({draft_path:N})}),r(),t()}catch(P){f(String((P==null?void 0:P.message)||P)),u(null)}}const k=N=>{var P;return N?`${N.pre??"?"} · ${((P=N.n_vocab)==null?void 0:P.toLocaleString())??"?"} Tokens`:"—"};return c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-lg rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-2",children:[c.jsx(ls,{className:"h-4 w-4"})," Speculative Draft"]}),c.jsx("button",{onClick:t,className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed",children:['Beschleunigt die Token-Generierung mit einem kleinen "Draft"-Modell. Voraussetzung: der Draft muss den ',c.jsx("strong",{className:"text-foreground",children:"exakt gleichen Tokenizer (Vocab)"})," haben wie das Modell — sonst lehnt llama.cpp es ab."]}),c.jsxs("div",{className:"rounded-lg border border-border/40 bg-background/30 px-3 py-2 text-[11px] font-mono flex items-center justify-between",children:[c.jsx("span",{className:"text-muted-foreground",children:(j=e.name.split("/").pop())==null?void 0:j.replace(/\.gguf$/i,"")}),c.jsxs("span",{className:"text-foreground",children:["Vocab: ",k(h)]})]}),e.spec_active&&x&&c.jsxs("div",{className:"rounded-lg border border-emerald-500/30 bg-emerald-500/5 px-3 py-2 flex items-center justify-between gap-2",children:[c.jsxs("span",{className:"text-[11px] text-emerald-400 font-mono flex items-center gap-1.5 truncate",children:[c.jsx(Cn,{className:"h-3.5 w-3.5 shrink-0"})," Aktiv: ",x]}),c.jsx("button",{onClick:()=>b(null),disabled:o!==null,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Deaktivieren"})]}),!(n!=null&&n.target_exists)&&c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 flex items-center gap-2",children:[c.jsx(Cs,{className:"h-3.5 w-3.5 shrink-0"}),"Modell-GGUF noch nicht vorhanden — Spec-Draft ist nach dem Download konfigurierbar."]}),c.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto pr-1",children:a?c.jsx("div",{className:"text-xs text-muted-foreground py-6 text-center",children:"Prüfe Vocab-Kompatibilität…"}):p.length===0?c.jsxs("div",{className:"text-[11px] text-muted-foreground border border-dashed border-border/50 rounded-lg p-4 text-center",children:["Keine Draft-Modelle in ",c.jsx("code",{className:"font-mono",children:"/srv/models/drafts"}),". Lade ein kleines same-family-Modell (z.B. Qwen3-0.6B) und lege es dort ab."]}):p.map(N=>{var C,_;const P=N.filename===x,O=N.compatible===!0;return c.jsxs("div",{className:fe("rounded-lg border px-3 py-2 flex items-center justify-between gap-2 text-left",O?"border-border/40 bg-background/20":"border-border/20 bg-background/10 opacity-60",P&&"border-primary/40 bg-primary/10"),children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-[11px] font-mono font-semibold text-foreground truncate",children:N.filename}),c.jsxs("div",{className:"text-[9px] text-muted-foreground font-mono",children:[Br(N.size_bytes)," · Vocab: ",k(N.vocab)]})]}),O?P?c.jsxs("span",{className:"text-[9px] font-bold uppercase text-primary flex items-center gap-1 shrink-0",children:[c.jsx(Cn,{className:"h-3.5 w-3.5"})," Aktiv"]}):c.jsx("button",{onClick:()=>b(N.path),disabled:o!==null,className:"h-7 px-3 rounded-lg border border-emerald-500/30 bg-emerald-500/5 hover:bg-emerald-500/15 text-emerald-400 text-[9px] font-bold uppercase shrink-0 cursor-pointer disabled:opacity-50",children:"Aktivieren"}):c.jsxs("span",{className:"text-[9px] font-bold uppercase text-amber-400/80 flex items-center gap-1 shrink-0",title:N.compatible===!1?`Inkompatibel: Tokenizer/Vocab weicht ab (Draft ${(C=N.vocab)==null?void 0:C.pre}/${(_=N.vocab)==null?void 0:_.n_vocab} ≠ Modell ${h==null?void 0:h.pre}/${h==null?void 0:h.n_vocab}).`:"Kompatibilität nicht prüfbar (Datei fehlt).",children:[c.jsx(Cs,{className:"h-3.5 w-3.5"})," ",N.compatible===!1?"Vocab ≠":"n/a"]})]},N.path)})}),!a&&(n==null?void 0:n.target_exists)&&p.length>0&&v.length===0&&c.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 px-3 py-2 text-[11px] text-amber-400 leading-relaxed",children:["Kein vocab-kompatibler Draft verfügbar — Speculative Decoding ist für dieses Modell nicht möglich. Es braucht einen Draft mit identischem Tokenizer (pre=",c.jsx("span",{className:"font-mono",children:h==null?void 0:h.pre}),", n_vocab=",c.jsx("span",{className:"font-mono",children:(S=h==null?void 0:h.n_vocab)==null?void 0:S.toLocaleString()}),")."]}),l&&c.jsx("div",{className:"text-[10px] text-red-400 font-mono",children:l})]})})}function JQ(){var ko,va,il,wi,ki,cc,al,ol;const e=po(),{data:t,isLoading:r,error:n}=vo(4e3),{data:a}=R3(4e3),{data:o}=L2(),{data:u}=hy(4e3),{data:l}=L3(),{data:f}=oh(),{showAlert:h,showConfirm:p,showPrompt:v,dialogElement:x}=el(),b=(t==null?void 0:t.models)??[],k=(t==null?void 0:t.running)??[],j=n?String(n):"",S=()=>{e.invalidateQueries({queryKey:wt.models}),e.invalidateQueries({queryKey:wt.routing})},[N,P]=y.useState(null),[O,C]=y.useState(null),[_,A]=y.useState(null),[I,$]=y.useState(null),[B,K]=y.useState(!1),[q,R]=y.useState(!1),[de,Z]=y.useState(null),[ge,ke]=y.useState("grid"),[me,Q]=y.useState("all"),oe=b.filter(U=>me==="in_use"?!!U.role||k.includes(U.name):!0),[X,L]=y.useState({width:800,height:360}),T=y.useRef(null),ee=y.useCallback(U=>{if(T.current&&(T.current.disconnect(),T.current=null),U){const he=new ResizeObserver(Pe=>{if(!Pe||Pe.length===0)return;const ze=Pe[0].contentRect;L({width:ze.width,height:ze.height})});he.observe(U),T.current=he}},[]),ne=X.width,te=X.height,ue=U=>{const he=ne*.1,Pe=te*U,ze=ne*.5,Ve=te*.5,qt=ne*.3,Ze=Pe,vt=ne*.3;return`M ${he} ${Pe} C ${qt} ${Ze}, ${vt} ${Ve}, ${ze} ${Ve}`},pe=U=>{const he=ne*.5,Pe=te*.5,ze=ne*.9,Ve=te*U,qt=ne*.7,Ze=Pe,vt=ne*.7;return`M ${he} ${Pe} C ${qt} ${Ze}, ${vt} ${Ve}, ${ze} ${Ve}`};async function Oe(U){try{await Me(`/api/models/${encodeURIComponent(U)}/load`,{method:"POST"}),S()}catch(he){h("Fehler",`Fehler beim Laden des Modells: ${he.message}`)}}async function J(U){try{await Me(`/api/models/${encodeURIComponent(U)}/unload`,{method:"POST"}),S()}catch(he){h("Fehler",`Fehler beim Entladen des Modells: ${he.message}`)}}async function je(){try{await Me("/api/models/unload",{method:"POST"}),S()}catch(U){h("Fehler",`Fehler beim Entladen aller Modelle: ${U.message}`)}}async function _e(U,he){try{await Me(`/api/models/${encodeURIComponent(he)}/role`,{method:"POST",body:JSON.stringify({role:U||null})}),S()}catch(Pe){h("Fehler",`Fehler beim Zuweisen der Rolle: ${Pe.message||Pe}`)}}function ae(U){C(U),A(null),Me(`/api/roles/${encodeURIComponent(U)}/recommend`).then(he=>A(he)).catch(()=>{})}async function Xe(U,he){let Pe=null;try{Pe=await Me(`/api/models/${encodeURIComponent(U)}/ctx/auto`)}catch{}const ze=Pe?`Optimal für dein Setup: ${(Pe.ctx/1024).toFixed(0)}k (${Pe.ctx}) — GTT ${Pe.gtt_gb} GB − reserviert ${Pe.reserved_gb} GB (${Pe.mode}) → ${Pe.budget_gb} GB frei. »Auto« trägt diesen Wert ein.`:"Gib die gewünschte Kontextlänge in Tokens an:";v("Kontextlänge anpassen",ze,String(he||32768),async Ve=>{if(Ve)try{await Me(`/api/models/${encodeURIComponent(U)}/ctx`,{method:"POST",body:JSON.stringify({ctx:parseInt(Ve,10)})}),S()}catch(qt){h("Fehler",`Fehler beim Setzen des Kontexts: ${qt.message||qt}`)}},void 0,Pe?{autoValue:String(Pe.ctx),autoLabel:`Auto (${(Pe.ctx/1024).toFixed(0)}k)`}:void 0)}async function Y(U){p("Modell löschen?",`Modell '${U}' und alle zugehörigen GGUF-Dateien unwiderruflich von der Box löschen?`,async()=>{try{await Me(`/api/models/${encodeURIComponent(U)}`,{method:"DELETE"}),S()}catch(he){h("Fehler",`Fehler beim Löschen: ${he.message||he}`)}})}async function ce(U,he,Pe,ze){try{await Me("/api/models/install",{method:"POST",body:JSON.stringify({repo:U,role:he,quant:Pe,jinja:ze})}),h("Herunterladen gestartet",`Download für '${U}' gestartet! Der Fortschritt wird oben angezeigt.`)}catch(Ve){h("Fehler",`Fehler beim Starten des Upgrades: ${Ve.message||Ve}`)}}async function tt(U){const he=l==null?void 0:l.budget,Pe=he&&!he.fits?` -⚠ Speicher-Warnung: Dieses Brain (~${fe.brain_gb} GB) muss immer resident sein. Zusammen mit dem größten on-demand-Modell (~${fe.largest_ondemand_gb} GB) sprengt das das Budget (${fe.gtt_gb} GB) → heavy/coder würden das Brain verdrängen. Erwäge ein kleineres Brain oder weniger Kontext.`:"";p("Agent-Hirn aktualisieren?",`Neues Hermes-Modell '${F.split("/").pop()}' herunterladen und als Agent-Hirn (Rolle hermes) setzen? Hermes nutzt danach automatisch das neue Modell.${Pe}`,async()=>{try{await De("/api/models/install",{method:"POST",body:JSON.stringify({repo:F,role:"hermes",quant:"Q4_K_M",jinja:!0})}),h("Download gestartet","Das neue Agent-Hirn wird geladen. Fortschritt oben."),S()}catch(ze){h("Fehler",`Update fehlgeschlagen: ${ze.message||ze}`)}})}async function jr(F){p("Agent-Hirn wechseln?",`'${F.split("/").pop()}' als Agent-Hirn (Alias hermes) setzen? Es wird warm gehalten (brains-Gruppe); Hermes nutzt es nach einem kurzen Gateway-Restart.`,async()=>{try{await De("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:F})}),h("Erledigt","Agent-Hirn gewechselt. Gateway wurde neugestartet."),V(!1),S()}catch(fe){h("Fehler",`Wechsel fehlgeschlagen: ${fe.message||fe}`)}})}async function pa(F){F&&(await navigator.clipboard.writeText(F),R(!0),setTimeout(()=>R(!1),1500))}if(r)return c.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(k)return c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",k,")."]});const ma=b.filter(F=>j.includes(F.name)),Bn=ma.reduce((F,fe)=>F+(fe.size_bytes||0),0),Un=((jo=f==null?void 0:f.gpu)==null?void 0:jo.gtt_total)||((va=f==null?void 0:f.gpu)==null?void 0:va.vram_total)||0,wo=((il=f==null?void 0:f.gpu)==null?void 0:il.gtt_used)||0,tl=16*1024**3,rl=Un>2*1024**3?Un:Bn>tl?Bn*1.2:tl,nl=F=>b.find(fe=>fe.role===F),bi=F=>{const fe=nl(F);return fe?j.includes(fe.name):!1};return c.jsxs("div",{className:"space-y-8",children:[c.jsx("style",{children:` +⚠ Speicher-Warnung: Dieses Brain (~${he.brain_gb} GB) muss immer resident sein. Zusammen mit dem größten on-demand-Modell (~${he.largest_ondemand_gb} GB) sprengt das das Budget (${he.gtt_gb} GB) → heavy/coder würden das Brain verdrängen. Erwäge ein kleineres Brain oder weniger Kontext.`:"";p("Agent-Hirn aktualisieren?",`Neues Hermes-Modell '${U.split("/").pop()}' herunterladen und als Agent-Hirn (Rolle hermes) setzen? Hermes nutzt danach automatisch das neue Modell.${Pe}`,async()=>{try{await Me("/api/models/install",{method:"POST",body:JSON.stringify({repo:U,role:"hermes",quant:"Q4_K_M",jinja:!0})}),h("Download gestartet","Das neue Agent-Hirn wird geladen. Fortschritt oben."),S()}catch(ze){h("Fehler",`Update fehlgeschlagen: ${ze.message||ze}`)}})}async function kr(U){p("Agent-Hirn wechseln?",`'${U.split("/").pop()}' als Agent-Hirn (Alias hermes) setzen? Es wird warm gehalten (brains-Gruppe); Hermes nutzt es nach einem kurzen Gateway-Restart.`,async()=>{try{await Me("/api/agent/brain/set",{method:"POST",body:JSON.stringify({model_id:U})}),h("Erledigt","Agent-Hirn gewechselt. Gateway wurde neugestartet."),K(!1),S()}catch(he){h("Fehler",`Wechsel fehlgeschlagen: ${he.message||he}`)}})}async function pa(U){U&&(await navigator.clipboard.writeText(U),R(!0),setTimeout(()=>R(!1),1500))}if(r)return c.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Initialisiere HUD Cockpit…"});if(j)return c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Gateway oder Engine nicht erreichbar (",j,")."]});const ma=b.filter(U=>k.includes(U.name)),Bn=ma.reduce((U,he)=>U+(he.size_bytes||0),0),Un=((ko=f==null?void 0:f.gpu)==null?void 0:ko.gtt_total)||((va=f==null?void 0:f.gpu)==null?void 0:va.vram_total)||0,wo=((il=f==null?void 0:f.gpu)==null?void 0:il.gtt_used)||0,tl=16*1024**3,rl=Un>2*1024**3?Un:Bn>tl?Bn*1.2:tl,nl=U=>b.find(he=>he.role===U),bi=U=>{const he=nl(U);return he?k.includes(he.name):!1};return c.jsxs("div",{className:"space-y-8",children:[c.jsx("style",{children:` @keyframes flow-dash { to { stroke-dashoffset: -20; @@ -455,7 +465,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho stroke-dasharray: 4 6; animation: flow-dash 1s linear infinite; } - `}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zm,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Speicher-Pool: ",Br(Bn)," Gewichte",wo>0?` · ${Br(wo)} real belegt (inkl. KV)`:""," / ",Br(rl)]}),j.length>0&&c.jsx("button",{onClick:ke,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),c.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:ma.length===0?c.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):ma.map((F,fe)=>{var Ge;const Pe=(F.size_bytes||0)/rl*100,ze=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][fe%4];return c.jsxs("div",{style:{width:`${Pe}%`},className:he("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",ze),title:`${F.name} (${Br(F.size_bytes)})`,children:[c.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[F.role?`[${F.role}] `:"",(Ge=F.name.split("/").pop())==null?void 0:Ge.replace(".gguf","")]}),c.jsx("span",{className:"text-[8px] font-mono opacity-80",children:Br(F.size_bytes)})]},F.name)})})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),c.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),c.jsxs("div",{ref:ee,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[c.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),c.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),c.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),c.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),c.jsx("path",{d:ue(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="roocode"||N==="roocode")&&c.jsx("path",{d:ue(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="cursor"||N==="cursor")&&c.jsx("path",{d:ue(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="opencode"||N==="opencode")&&c.jsx("path",{d:ue(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="zed"||N==="zed")&&c.jsx("path",{d:ue(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="continue"||N==="continue")&&c.jsx("path",{d:ue(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("fast")&&c.jsx("path",{d:pe(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("heavy")&&c.jsx("path",{d:pe(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("coder")&&c.jsx("path",{d:pe(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("vision")&&c.jsx("path",{d:pe(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("scout")&&c.jsx("path",{d:pe(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>Z("roocode"),onMouseLeave:()=>Z(null),onClick:()=>P(F=>F==="roocode"?null:"roocode"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Roo Code"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>Z("cursor"),onMouseLeave:()=>Z(null),onClick:()=>P(F=>F==="cursor"?null:"cursor"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Cursor IDE"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>Z("opencode"),onMouseLeave:()=>Z(null),onClick:()=>P(F=>F==="opencode"?null:"opencode"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"OpenCode"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>Z("zed"),onMouseLeave:()=>Z(null),onClick:()=>P(F=>F==="zed"?null:"zed"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Zed"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>Z("continue"),onMouseLeave:()=>Z(null),onClick:()=>P(F=>F==="continue"?null:"continue"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Continue"})]}),c.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[c.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),c.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",a!=null&&a.heavy_threshold_chars?a.heavy_threshold_chars/1e3:"4","k Zeichen"]}),c.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),K2.map(F=>{var qt;const fe=["12%","31%","50%","69%","88%"],Pe=nl(F),ze=Pe?j.includes(Pe.name):!1;if(F==="agent")return null;const Ge={fast:0,heavy:1,coder:2,vision:3,scout:4}[F];return c.jsxs("div",{className:he("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",ze?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":Pe?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:fe[Ge]},onClick:()=>ae(F),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:F}),ze&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:Pe?(qt=Pe.name.split("/").pop())==null?void 0:qt.replace(".gguf",""):"Keine Zuweisung"})]},F)}),N&&o&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200 flex flex-col justify-between",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:[N==="roocode"&&"Roo Code Setup",N==="cursor"&&"Cursor Setup",N==="opencode"&&"OpenCode Setup",N==="zed"&&"Zed Setup",N==="continue"&&"Continue Setup"]}),c.jsx("button",{onClick:()=>P(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[N==="roocode"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",c.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),c.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",c.jsx("strong",{children:"OpenAI Compatible"}),"."]}),c.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",c.jsx("code",{children:"settings.json"})," ein."]})]}),N==="cursor"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Öffne Cursor Settings ➔ ",c.jsx("strong",{children:"Models"}),"."]}),c.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",c.jsx("strong",{children:"OpenAI API"})," auf."]}),c.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",c.jsx("strong",{children:"auto"}),"."]})]}),N==="opencode"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Öffne die ",c.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),c.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",c.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),N==="zed"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Öffne die Zed Settings (",c.jsx("code",{children:"ctrl+,"}),")."]}),c.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",c.jsx("code",{children:"language_models"})," ein."]})]}),N==="continue"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),c.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",c.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),o.tools&&c.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[c.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"JSON Config"}),c.jsxs("button",{onClick:()=>{var F,fe,Pe,ze,Ge;return pa(N==="roocode"?(F=o.tools.cline)==null?void 0:F.snippet:N==="cursor"?(fe=o.tools.cursor)==null?void 0:fe.snippet:N==="opencode"?(Pe=o.tools.opencode)==null?void 0:Pe.snippet:N==="zed"?(ze=o.tools.zed)==null?void 0:ze.snippet:(Ge=o.tools.continue)==null?void 0:Ge.snippet)},className:"text-xs font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[q?c.jsx(Cn,{className:"h-3.5 w-3.5 text-emerald-400"}):c.jsx(ZN,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:q?"Kopiert":"Kopieren"})]})]}),c.jsx("pre",{className:"p-3 max-h-48 overflow-y-auto text-xs font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:c.jsxs("code",{children:[N==="roocode"&&((wi=o.tools.cline)==null?void 0:wi.snippet),N==="cursor"&&((ji=o.tools.cursor)==null?void 0:ji.snippet),N==="opencode"&&((uc=o.tools.opencode)==null?void 0:uc.snippet),N==="zed"&&((al=o.tools.zed)==null?void 0:al.snippet),N==="continue"&&((ol=o.tools.continue)==null?void 0:ol.snippet)]})})]}),c.jsx("button",{onClick:()=>P(null),className:"w-full h-9 rounded-lg bg-primary text-primary-foreground hover:opacity-90 font-semibold text-xs transition-opacity cursor-pointer mt-2",children:"Schließen"})]})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),c.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),c.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),c.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Gateway Steckplatz-Belegung (Slot-Zuweisung)"}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:["fast","heavy","coder","vision","scout"].map(F=>{var ze;const fe=b.find(Ge=>Ge.role===F),Pe=fe?j.includes(fe.name):!1;return c.jsxs("div",{onClick:()=>ae(F),className:he("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",Pe?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":fe?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:he("text-[9px] font-bold uppercase tracking-wider font-mono px-1.5 py-0.5 rounded border",my(F)),children:F}),Pe&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:fe==null?void 0:fe.name,children:fe?(ze=fe.name.split("/").pop())==null?void 0:ze.replace(/\.gguf$/i,""):"nicht zugewiesen"}),c.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},F)})})]}),(l==null?void 0:l.current)&&c.jsxs("div",{className:"rounded-2xl border border-indigo-500/30 bg-indigo-500/5 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ps,{className:"h-4.5 w-4.5 text-indigo-400"}),c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Hirn (Hermes)"}),l.current.version!=null&&c.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-indigo-500/15 text-indigo-300 border border-indigo-500/25",children:["v",l.current.version]})]}),c.jsx("button",{onClick:()=>V(!0),className:"h-7 px-3 rounded-lg border border-indigo-500/30 bg-indigo-500/5 text-indigo-300 text-[9px] font-bold uppercase hover:bg-indigo-500/15 transition-all cursor-pointer",children:"Hirn wechseln"})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-background/30 border border-border/30 p-3.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:l.current.name,children:l.current.name.split("/").pop()}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[c.jsx("span",{children:l.current.params_b?`${l.current.params_b}B`:"—"}),c.jsx("span",{children:"•"}),c.jsx("span",{children:l.current.quant||"GGUF"}),c.jsx("span",{children:"•"}),c.jsx("span",{children:Br(l.current.size_bytes||0)})]})]}),l.update_available&&l.recommended?c.jsxs("button",{onClick:()=>tt(l.recommended.repo),className:he("h-8 px-3 shrink-0 flex items-center justify-center gap-1.5 rounded-lg text-[10px] font-bold uppercase transition-all cursor-pointer shadow-md",l.budget&&!l.budget.fits?"bg-red-500 text-white hover:bg-red-400 shadow-red-500/10":"bg-amber-500 text-black hover:bg-amber-400 shadow-amber-500/10"),children:[c.jsx(no,{className:"h-3.5 w-3.5"})," Aktualisieren"]}):c.jsxs("span",{className:"h-8 px-3 shrink-0 flex items-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/15 rounded-lg select-none",children:[c.jsx(Cn,{className:"h-4 w-4"})," Neueste Generation"]})]}),l.update_available&&l.recommended&&c.jsxs("div",{className:"text-[10px] text-amber-400/90 flex items-center gap-1.5",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),"Neuere Generation verfügbar: ",c.jsx("span",{className:"font-mono font-bold",children:l.recommended.name.replace(/-GGUF$/i,"")}),"(v",l.recommended.version,", ",l.recommended.params_b,"B) — von NousResearch."]}),l.budget&&c.jsxs("div",{className:he("text-[10px] flex items-start gap-1.5 leading-relaxed",l.budget.fits?"text-muted-foreground/80":"text-red-400 font-semibold"),children:[c.jsx(zm,{className:"h-3 w-3 shrink-0 mt-0.5"}),c.jsxs("span",{children:["Always-On-Brain ~",l.budget.brain_gb," GB + größtes on-demand (~",l.budget.largest_ondemand_gb," GB) = ",(l.budget.brain_gb+l.budget.largest_ondemand_gb).toFixed(1)," / ",l.budget.gtt_gb," GB",l.budget.fits?" · passt gleichzeitig ✓":" · passt NICHT gleichzeitig ⚠ — heavy/coder würden das Brain verdrängen. Kleineres Brain oder weniger Kontext."]})]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[c.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",oe.length," von ",b.length,")"]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[c.jsx("button",{onClick:()=>Q("all"),className:he("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",me==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),c.jsx("button",{onClick:()=>Q("in_use"),className:he("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",me==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),c.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[c.jsx("button",{onClick:()=>je("grid"),className:he("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ge==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),c.jsx("button",{onClick:()=>je("list"),className:he("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ge==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ge==="grid"?c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:oe.length===0?c.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:me==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):oe.map(F=>{const fe=j.includes(F.name),Pe=u==null?void 0:u.model_list.find(Ge=>Ge.role===F.role),ze=yw(F.name);return c.jsxs("div",{className:he("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",fe?"border-primary/45 shadow-primary/5":F.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"flex items-start justify-between gap-3",children:c.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[c.jsx("div",{className:he("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",ze.color),title:ze.name,children:ze.initial}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:F.name,children:F.name.split("/").pop()}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[c.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:F.quant||"GGUF"}),fe&&c.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[c.jsx(vu,{className:"h-3 w-3 animate-pulse"})," Warm"]}),F.role&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:F.role}),F.prompt_cache&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),F.spec_active?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${F.spec_draft_model})`,children:"SPEC"}):F.spec_draft_model?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${F.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null,F.parallel_slots>1&&c.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${F.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",F.parallel_slots]}),F.incomplete&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),c.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:c.jsx(jN,{caps:F.capabilities})})]}),c.jsxs("div",{className:"space-y-3 pt-1",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[c.jsx(zm,{className:"h-3.5 w-3.5 text-primary/80"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),c.jsx("div",{className:"text-foreground font-semibold",children:Br(F.size_bytes)})]})]}),c.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[c.jsx(pI,{className:"h-3.5 w-3.5 text-primary/80"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),c.jsx("div",{className:"text-foreground font-semibold",children:mw(F.ctx)})]})]})]}),Pe&&c.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[c.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),c.jsxs("span",{children:["Upgrade verfügbar: ",Pe.repo.split("/").pop()]})]}),c.jsxs("button",{onClick:()=>ce(Pe.repo,F.role,F.quant||"Q4_K_M",F.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[c.jsx(no,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),c.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[c.jsx("button",{onClick:()=>fe?J(F.name):Ae(F.name),disabled:F.incomplete&&!fe,className:he("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",F.incomplete&&!fe?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":fe?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:fe?"Entladen":"Laden"}),c.jsx("button",{onClick:()=>Xe(F.name,F.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),c.jsxs("button",{onClick:()=>U(F),className:he("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",F.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":F.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[c.jsx(ls,{className:"h-3 w-3"})," Spec"]}),c.jsx("button",{onClick:()=>Y(F.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:c.jsx(Qv,{className:"h-3.5 w-3.5"})})]})]})]},F.name)})}):c.jsx("div",{className:"space-y-2",children:oe.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:me==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):oe.map(F=>{const fe=j.includes(F.name),Pe=yw(F.name);return c.jsxs("div",{className:he("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",fe?"border-primary/45":F.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("div",{className:he("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Pe.color),title:Pe.name,children:Pe.initial}),c.jsxs("div",{className:"min-w-0 text-left",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:F.name,children:F.name.split("/").pop()}),F.role&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:F.role}),F.prompt_cache&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),F.spec_active?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${F.spec_draft_model})`,children:"SPEC"}):F.spec_draft_model?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${F.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null,F.parallel_slots>1&&c.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${F.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",F.parallel_slots]}),F.incomplete&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),fe&&c.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[c.jsxs("span",{children:["Größe: ",Br(F.size_bytes)]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["Kontext: ",mw(F.ctx)]}),c.jsx("span",{children:"•"}),c.jsx("span",{className:"font-mono text-[9px]",children:F.quant||"GGUF"})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[c.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:c.jsx(jN,{caps:F.capabilities})}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{onClick:()=>fe?J(F.name):Ae(F.name),disabled:F.incomplete&&!fe,className:he("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",F.incomplete&&!fe?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":fe?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:fe?"Entladen":"Laden"}),c.jsx("button",{onClick:()=>Xe(F.name,F.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),c.jsxs("button",{onClick:()=>U(F),className:he("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",F.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":F.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[c.jsx(ls,{className:"h-3 w-3"})," Spec"]}),c.jsx("button",{onClick:()=>Y(F.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:c.jsx(Qv,{className:"h-3.5 w-3.5"})})]})]})]},F.name)})})]}),O&&(()=>{var Ge,qt;const F=_&&_.role===O?_:null,fe={};F==null||F.models.forEach(Ze=>{fe[Ze.name]=Ze});const Pe=F?F.models.map(Ze=>b.find(vt=>vt.name===Ze.name)).filter(Boolean):b,ze=Ze=>{Oe(O,Ze),C(null)};return c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:["Rolle '",O,"' konfigurieren"]}),c.jsx("button",{onClick:()=>C(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell für die Rolle ",c.jsx("strong",{className:"text-foreground",children:O}),":"]}),(F==null?void 0:F.recommended)&&c.jsxs("button",{onClick:()=>ze(F.recommended),title:(Ge=fe[F.recommended])==null?void 0:Ge.reason,className:"shrink-0 h-7 px-3 text-[11px] font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg cursor-pointer flex items-center gap-1",children:[c.jsx(ls,{className:"h-3 w-3"})," Auto: ",(qt=F.recommended.split("/").pop())==null?void 0:qt.replace(/\.gguf$/i,"")]})]}),c.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[c.jsx("button",{onClick:()=>ze(""),className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:c.jsx("span",{children:"Zuweisung entfernen"})}),Pe.map(Ze=>{var ll;const vt=fe[Ze.name],ga=Ze.role===O,sl=!!(vt!=null&&vt.recommended),cc=!!vt&&!vt.suitable;return c.jsxs("button",{onClick:()=>ze(Ze.name),className:he("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border",sl?"border-primary/50 bg-primary/10":ga?"text-primary font-bold bg-primary/5 border-primary/30":cc?"border-border/20 bg-background/10 opacity-60":"text-foreground bg-background/20 border-border/30"),children:[c.jsxs("div",{className:"flex flex-col text-left min-w-0",children:[c.jsxs("span",{className:"truncate max-w-[260px] font-semibold flex items-center gap-1.5",children:[(ll=Ze.name.split("/").pop())==null?void 0:ll.replace(/\.gguf$/i,""),sl&&c.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wide text-primary bg-primary/15 px-1.5 py-0.5 rounded",children:"Empfohlen"})]}),c.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:vt?`${vt.params_b}B · ${Ze.quant} · ${vt.reason}`:`${Br(Ze.size_bytes)} · ${Ze.quant}`})]}),ga&&c.jsx(Cn,{className:"h-4 w-4 shrink-0 text-primary"})]},Ze.name)})]})]})})})(),I&&c.jsx(qQ,{model:I,onClose:()=>U(null),onChanged:S}),B&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[c.jsx(Ps,{className:"h-4 w-4"})," Agent-Hirn wechseln"]}),c.jsx("button",{onClick:()=>V(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Wähle ein ",c.jsx("strong",{className:"text-foreground",children:"installiertes"})," Modell als Agent-Hirn. Es bekommt den",c.jsx("code",{className:"text-primary",children:" hermes"}),'-Alias, wird warm gehalten (brains-Gruppe), und Hermes nutzt es nach einem kurzen Gateway-Restart. Neues Modell (z.B. Hermes-4.3 oder Gemma-4)? Erst über „Modelle finden" laden.']}),c.jsx("div",{className:"space-y-1.5 max-h-72 overflow-y-auto pr-1",children:b.map(F=>{var Pe;const fe=F.role==="hermes";return c.jsxs("button",{onClick:()=>!fe&&jr(F.name),disabled:fe||F.incomplete,className:he("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",fe?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":F.incomplete?"border-border/20 bg-background/10 text-muted-foreground/50 cursor-not-allowed":"border-border/30 bg-background/20 text-foreground hover:bg-accent cursor-pointer"),children:[c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(Pe=F.name.split("/").pop())==null?void 0:Pe.replace(/\.gguf$/i,"")}),c.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[F.capabilities.params_b?`${F.capabilities.params_b}B`:"?"," · ",Br(F.size_bytes),F.role&&` · Rolle: ${F.role}`,F.capabilities.tools!=="no"?" · Tools ✓":" · ohne Tools"]})]}),fe?c.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[c.jsx(Cn,{className:"h-3.5 w-3.5"})," Aktiv"]}):c.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Als Hirn setzen →"})]},F.name)})}),c.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[c.jsx("span",{children:"💡"}),c.jsxs("span",{children:["Für einen ",c.jsx("strong",{children:"Agenten"})," sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl als allgemeine Modelle."]})]})]})}),x]})}function YQ(){const[e,t]=y.useState(""),[r,n]=y.useState([]),[a,o]=y.useState("Q4_K_M"),[u,l]=y.useState(""),[f,h]=y.useState(""),[p,v]=y.useState(""),[x,b]=y.useState([]),[j,k]=y.useState(null),[S,N]=y.useState(!1),P=["fast","heavy","coder","vision","scout"],{data:O}=vo(),C=f?O==null?void 0:O.models.find(R=>(R.role||"").toLowerCase()===f):void 0;async function _(R,de,Z){if(N(!1),!R.trim()){k(null);return}try{const ge=await De(`/api/fit?params_b=0&quant=${encodeURIComponent(de)}&ctx=8192&name=${encodeURIComponent(R)}&role=${encodeURIComponent(Z)}`);k(ge)}catch{k(null)}}async function A(R){const de=R??e;if(de.trim()){l("Analysiere HuggingFace Repository..."),k(null);try{const Z=await De(`/api/hf/quants?repo=${encodeURIComponent(de)}`);t(Z.repo),n(Z.quants);const ge=Z.quants.length?Z.quants.includes("Q4_K_M")?"Q4_K_M":Z.quants[0]:a;Z.quants.length&&o(ge),l(Z.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden."),Z.quants.length&&_(Z.repo,ge,f)}catch(Z){l(`Fehler: ${Z}`)}}}function I(R){o(R),_(e,R,f)}function U(R){h(R),r.length&&_(e,a,R)}async function B(){if(p.trim()){l("Durchsuche HuggingFace...");try{const R=await De(`/api/hf/search?q=${encodeURIComponent(p)}`);b(R.results),l(R.results.length?"":"Keine Ergebnisse gefunden.")}catch(R){l(`Suche fehlgeschlagen: ${R}`)}}}async function V(){if(e.trim()){if((j==null?void 0:j.fit.level)==="too_tight"&&!S){N(!0);return}l("Download-Job wird initiiert...");try{await De("/api/models/install",{method:"POST",body:JSON.stringify({repo:e,quant:a,role:f||void 0,jinja:!0})}),N(!1),l(`Download gestartet: ${e} (${a})${f?`, Rolle: ${f}`:""}. Fortschritt oben.`+(C?` „${f}" wurde von ${C.name} übernommen.`:"")+(f==="fast"||f==="coder"?" Speculative Draft (Vocab-geprüft) kannst du nach dem Download an der Modellkarte (»Spec«) setzen.":""))}catch(R){l(`Download-Fehler: ${R}`)}}}const q=(j==null?void 0:j.fit.level)==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":(j==null?void 0:j.fit.level)==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return c.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[c.jsx("input",{value:e,onChange:R=>{t(R.target.value),k(null),N(!1)},placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:()=>A(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),r.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("select",{value:a,onChange:R=>I(R.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:r.map(R=>c.jsx("option",{value:R,className:"bg-popover text-foreground",children:R},R))}),c.jsxs("select",{value:f,onChange:R=>U(R.target.value),title:"Rolle (optional) — bestimmt Auto-Konfiguration + setup-bewussten Kontext",className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:[c.jsx("option",{value:"",className:"bg-popover text-foreground",children:"Rolle…"}),P.map(R=>c.jsx("option",{value:R,className:"bg-popover text-foreground",children:R},R))]}),c.jsx("button",{onClick:V,className:`h-9 px-4 rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5 ${S?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"}`,children:S?c.jsxs(c.Fragment,{children:[c.jsx(Cs,{className:"h-3.5 w-3.5"})," OOM-Risiko — trotzdem laden"]}):c.jsxs(c.Fragment,{children:[c.jsx(no,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]})]})]}),j&&c.jsxs("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium ${q}`,children:[c.jsx("span",{className:"font-bold uppercase tracking-wide",children:j.fit.text}),c.jsxs("span",{className:"font-mono opacity-90",children:["~",j.params_b,"B · ~",j.fit.req_gb," GB / ",j.sys_ram_gb," GB RAM · ~",j.fit.tps," t/s"]}),j.fit.level!=="too_tight"&&c.jsxs("span",{className:"font-mono opacity-80",title:`Setup-bewusst: GTT ${j.budget.gtt_gb} GB − reserviert ${j.budget.reserved_gb} GB (${j.budget.mode}) → ${j.budget.budget_gb} GB frei`,children:["ctx → ",(j.assigned_ctx/1024).toFixed(0),"k"]}),j.fit.level==="too_tight"&&c.jsx("span",{className:"opacity-90",children:"— passt nicht in den Speicher, würde beim Laden abstürzen (OOM)."})]}),C&&c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[11px] font-medium text-amber-400",children:[c.jsx(Cs,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),c.jsxs("span",{children:["Rolle ",c.jsxs("strong",{children:["„",f,'"']})," ist aktuell ",c.jsx("strong",{children:C.name})," zugewiesen. Beim Download übernimmt das neue Modell diese Rolle — ",C.name," bleibt installiert, verliert sie aber."]})]}),c.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{value:p,onChange:R=>v(R.target.value),onKeyDown:R=>R.key==="Enter"&&B(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),c.jsx(oy,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),c.jsx("button",{onClick:B,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),x.length>0&&c.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:x.map(R=>c.jsxs("button",{onClick:()=>{t(R.repo),b([]),v(""),A(R.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[c.jsx("span",{className:"font-semibold truncate",children:R.repo}),c.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[c.jsx(no,{className:"h-3 w-3"})," ",R.downloads.toLocaleString()]})]},R.repo))}),u&&c.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:u})]})}const XQ={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ls},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:gu},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Vv},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:qv},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:Gv}};function ZQ(){const{data:e,isLoading:t,error:r}=D3(),{data:n}=vo(),{data:a}=hy(),o=(n==null?void 0:n.models)??[],u=r?String(r):"",[l,f]=y.useState({}),[h,p]=y.useState({}),[v,x]=y.useState(!1);async function b(j,k,S,N){f(P=>({...P,[j]:"Starte..."}));try{await De("/api/models/install",{method:"POST",body:JSON.stringify({repo:j,role:k,quant:S,jinja:N})}),f(P=>({...P,[j]:"Download läuft"}))}catch{f(O=>({...O,[j]:"Fehler"}))}}return t?c.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):u||!e?c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",u,")."]}):c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[c.jsxs("div",{children:["Modell-Registry geladen für ",c.jsxs("span",{className:"text-foreground font-bold",children:[e.sys_ram_gb," GB"]})," System-RAM."]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(r2,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),c.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),c.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:e.categories.map(j=>{const k=XQ[j.role]||{title:j.title||j.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:xu},S=k.icon,N=o.find(I=>I.role===j.role),P=a==null?void 0:a.model_list.find(I=>I.role===j.role),O=j.models.find(I=>I.repo===j.recommended)||j.models[0];if(!O)return null;const C=l[O.repo],_=j.models.filter(I=>I.repo!==j.recommended),A=!!h[j.role];return c.jsxs("div",{className:he("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",N?"border-border/60":"border-primary/20 shadow-primary/5"),children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:c.jsx(S,{className:"h-5.5 w-5.5"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:k.title}),c.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",j.role]})]})]}),N?c.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):c.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),c.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:k.desc}),c.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:N?c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),c.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:N.name,children:N.name.split("/").pop()}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[c.jsxs("span",{children:["Größe: ",tg(N.size_bytes||0)]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["Quant: ",N.quant||"GGUF"]})]})]}):c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),c.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:O.name,children:O.name}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[c.jsxs("span",{children:["Ersteller: ",O.author]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["Quant: ",O.quant]})]}),c.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:c.jsx(g4,{fit:O.fit})})]})}),c.jsx("div",{className:"pt-1",children:N?P?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),c.jsxs("span",{children:["Bessere Version in der Registry: ",P.repo.split("/").pop()]})]}),c.jsxs("button",{onClick:()=>b(P.repo,j.role,O.quant||"Q4_K_M",O.caps.tools!=="no"),disabled:!!l[P.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[c.jsx(no,{className:"h-3.5 w-3.5"}),l[P.repo]||"Auf neue Version aktualisieren"]})]}):c.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[c.jsx(Cn,{className:"h-4 w-4"})," Auf neuestem Stand"]}):c.jsxs("button",{onClick:()=>b(O.repo,j.role,O.quant||"Q4_K_M",O.caps.tools!=="no"),disabled:!!C,className:he("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",C?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[c.jsx(no,{className:"h-3.5 w-3.5"}),C||"Optimales Modell einsetzen"]})})]}),_.length>0&&c.jsxs("div",{className:"border-t border-border/20 pt-3",children:[c.jsxs("button",{onClick:()=>p(I=>({...I,[j.role]:!A})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[A?c.jsx(rI,{className:"h-3 w-3"}):c.jsx(eI,{className:"h-3 w-3"}),c.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",_.length,")"]})]}),A&&c.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:_.map(I=>c.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:I.name,children:I.name}),c.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[c.jsxs("span",{children:["Quant: ",I.quant]}),c.jsx("span",{children:"•"}),c.jsx("span",{children:I.fit.text})]})]}),c.jsx("button",{onClick:()=>b(I.repo,j.role,I.quant||"Q4_K_M",I.caps.tools!=="no"),disabled:!!l[I.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:l[I.repo]||"Installieren"})]},I.repo))})]})]},j.role)})}),c.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[c.jsxs("button",{onClick:()=>x(!v),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(oy,{className:"h-4 w-4 text-primary"}),c.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),c.jsx("span",{className:"text-[10px] text-primary hover:underline",children:v?"Ausblenden ▲":"Anzeigen ▼"})]}),v&&c.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:c.jsx(YQ,{})})]})]})}function JQ(){const[e,t]=y.useState("cockpit");return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),c.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(r=>c.jsx("button",{onClick:()=>t(r),className:he("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:r==="cockpit"?"Cockpit":"Modelle finden"},r))})]}),c.jsx(GQ,{}),c.jsx("div",{className:"transition-all duration-300",children:e==="cockpit"?c.jsx(QQ,{}):c.jsx(ZQ,{})})]})}function eY(){const[e,t]=y.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[r,n]=y.useState(localStorage.getItem("mc_mcp_path")||""),[a,o]=y.useState("cline"),[u,l]=y.useState(!1),f=new URLSearchParams({host:e});r&&f.set("mcp_path",r);const{data:h,error:p}=$2(f.toString()),v=p?String(p):"";function x(S){t(S),S&&localStorage.setItem("mc_host",S)}function b(S){n(S),localStorage.setItem("mc_mcp_path",S)}const j=h==null?void 0:h.tools[a];async function k(){j&&(await navigator.clipboard.writeText(j.snippet),l(!0),setTimeout(()=>l(!1),1500))}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[c.jsx(lI,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),c.jsx("input",{value:e,onChange:S=>x(S.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[c.jsx(sI,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),c.jsx("input",{value:r,onChange:S=>b(S.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),v&&c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",v]}),h&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(h.tools).map(([S,N])=>c.jsx("button",{onClick:()=>o(S),className:he("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",a===S?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:N.label},S))}),j&&c.jsxs("div",{className:"space-y-3",children:[j.note&&c.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[c.jsx(uI,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),c.jsx("span",{children:j.note})]}),c.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[c.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),c.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[c.jsx(nf,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{children:a==="cline"||a==="cursor"?"config.json":"settings.json"})]}),c.jsxs("button",{onClick:k,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[u?c.jsx(Cn,{className:"h-3.5 w-3.5 text-emerald-400"}):c.jsx(ZN,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:u?"Kopiert":"Kopieren"})]})]}),c.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:c.jsx("code",{children:j.snippet})})]})]})]})]})}const kN=["user","instruction","stable","versioned","ephemeral"],Av=new Set(["auto","agent"]),Ov={user:{label:"User",icon:wI,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:yI,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:bu,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:bI,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:iI,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},SN={label:"Gedächtnis",icon:YN,bg:"bg-muted/10",text:"text-muted-foreground"},tY={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function rY(){const[e,t]=y.useState(""),[r,n]=y.useState(""),[a,o]=y.useState(""),[u,l]=y.useState("stable"),[f,h]=y.useState(!1),p=po(),{showAlert:v,showConfirm:x,dialogElement:b}=el(),{data:j=[],error:k}=L2({q:r,category:e}),S=k?String(k):"",N=()=>p.invalidateQueries({queryKey:["memory"]});async function P(){a.trim()&&(await De("/api/memory",{method:"POST",body:JSON.stringify({content:a,category:u,source:"ui"})}),o(""),N())}async function O(_){await De(`/api/memory/${_}`,{method:"DELETE"}),N()}async function C(){h(!0);try{const _=await De("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if(_.duplicate_count===0){v("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}x("Deduplizierung bestätigen",`${_.duplicate_count} Dublette(n) in ${_.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await De("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),N()}catch(A){v("Fehler",`Fehler beim Löschen: ${A.message}`)}})}catch(_){v("Fehler",`Fehler bei der Deduplizierung: ${_.message}`)}finally{h(!1)}}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool (Memory)"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),c.jsxs("button",{onClick:C,disabled:f,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50 shrink-0 self-start",children:[c.jsx(Y1,{className:"h-4 w-4 text-primary animate-pulse"}),c.jsx("span",{children:"Deduplizieren"})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),c.jsx("textarea",{value:a,onChange:_=>o(_.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),c.jsx("select",{value:u,onChange:_=>l(_.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:kN.map(_=>{var A;return c.jsx("option",{value:_,className:"bg-popover text-foreground",children:((A=Ov[_])==null?void 0:A.label)||_},_)})})]}),c.jsxs("button",{onClick:P,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[c.jsx(JN,{className:"h-4 w-4"})," Speichern"]})]})]}),c.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{value:r,onChange:_=>n(_.target.value),placeholder:"Semantisch durchsuchen (nach Bedeutung, nicht nur Stichwort)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),c.jsx(oy,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[c.jsx("button",{onClick:()=>t(""),className:he("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",e?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),kN.map(_=>{const A=Ov[_]||SN,I=A.icon;return c.jsxs("button",{onClick:()=>t(_),className:he("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",e===_?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[c.jsx(I,{className:"h-3 w-3"}),c.jsx("span",{children:A.label})]},_)})]})]}),S&&c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",S]}),c.jsx("div",{className:"space-y-3",children:j.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):j.map(_=>{const A=Ov[_.category]||SN,I=A.icon;return c.jsxs("div",{className:he("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",tY[_.category]||"border-l-muted"),children:[c.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[c.jsxs("span",{className:he("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",A.bg,A.text),children:[c.jsx(I,{className:"h-3 w-3"}),c.jsx("span",{className:"hidden sm:inline",children:A.label})]}),c.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:_.content})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[typeof _.score=="number"&&c.jsxs("span",{className:"text-[9px] font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded uppercase tracking-wider",title:"Relevanz der semantischen Suche",children:[Math.round(_.score*100),"%"]}),c.jsxs("span",{className:he("flex items-center gap-1 text-[9px] font-mono px-1.5 py-0.5 rounded uppercase tracking-wider",Av.has(_.source)?"text-emerald-400 bg-emerald-500/10":"text-muted-foreground/60 bg-background/20"),title:Av.has(_.source)?"Automatisch gelernt":"Manuell angelegt",children:[Av.has(_.source)&&c.jsx(Y1,{className:"h-2.5 w-2.5"}),_.source]}),c.jsx("button",{onClick:()=>O(_.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:c.jsx(Qv,{className:"h-3.5 w-3.5"})})]})]},_.id)})}),b]})}function Vd({label:e,ok:t,detail:r,icon:n,onClick:a}){return c.jsxs("div",{onClick:a,className:he("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",t?"border-border/60":"border-amber-500/30",a&&"cursor-pointer hover:bg-card/70"),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:e}),c.jsx(n,{className:he("h-4.5 w-4.5",t?"text-primary":"text-amber-500")})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:he("h-2 w-2 rounded-full ring-2 ring-black/40",t?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-semibold text-foreground",children:t?"Bereit / Online":"Offline / Inaktiv"})]}),r&&c.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:r,children:r})]}),a&&c.jsxs("button",{onClick:o=>{o.stopPropagation(),a()},className:"mt-2 flex items-center justify-center gap-1.5 w-full py-1.5 px-3 rounded-lg border border-primary/30 bg-primary/10 hover:bg-primary/20 text-primary text-[10px] font-bold uppercase tracking-wider transition-all cursor-pointer font-space",children:[c.jsx(_n,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Gehirn wechseln"})]})]})}function nY(){const{data:e,error:t}=fy(5e3),{data:r}=vo(),{showAlert:n,dialogElement:a}=el(),o=po(),u=t?String(t):"",l=y.useMemo(()=>["auto","fast","heavy",...((r==null?void 0:r.models)??[]).map(_=>{var A;return((A=_.name.split("/").pop())==null?void 0:A.replace(".gguf",""))||_.name})],[r]),[f,h]=y.useState(null),[p,v]=y.useState(!1),[x,b]=y.useState({width:800,height:360}),j=y.useRef(null),k=y.useCallback(C=>{if(j.current&&(j.current.disconnect(),j.current=null),C){const _=new ResizeObserver(A=>{if(!A||A.length===0)return;const I=A[0].contentRect;b({width:I.width,height:I.height})});_.observe(C),j.current=_}},[]),S=x.width,N=x.height,P=(C,_,A,I)=>{const U=(C+A)/2;return`M ${C} ${_} C ${U} ${_}, ${U} ${I}, ${A} ${I}`};async function O(C){try{await De("/api/agent/brain",{method:"POST",body:JSON.stringify({model:C})}),n("Erfolgreich",`Hermes-Gehirn wurde auf '${C}' geändert. Der Gateway-Dienst wurde neu gestartet.`),o.invalidateQueries({queryKey:Et.agentStatus}),v(!1)}catch(_){n("Fehler",`Fehler beim Wechseln des Gehirns: ${_.message}`)}}return c.jsxs("div",{className:"space-y-6",children:[c.jsx("style",{children:` + `}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(zm,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"VRAM / Memory Belegung"})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground",children:["Speicher-Pool: ",Br(Bn)," Gewichte",wo>0?` · ${Br(wo)} real belegt (inkl. KV)`:""," / ",Br(rl)]}),k.length>0&&c.jsx("button",{onClick:je,className:"h-6 px-2.5 rounded border border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/10 text-amber-400 text-[9px] font-bold uppercase transition-all cursor-pointer",children:"Alle entladen"})]})]}),c.jsx("div",{className:"h-7 w-full rounded-xl bg-background/50 border border-border/40 overflow-hidden flex p-0.5 relative group",children:ma.length===0?c.jsx("div",{className:"w-full h-full flex items-center justify-center text-[10px] text-muted-foreground/60 italic font-mono select-none",children:"VRAM Leer — Auto-Swap lädt Modelle bei Anfrage"}):ma.map((U,he)=>{var Ve;const Pe=(U.size_bytes||0)/rl*100,ze=["from-teal-500 to-emerald-500","from-indigo-500 to-blue-500","from-purple-500 to-pink-500","from-cyan-500 to-sky-500"][he%4];return c.jsxs("div",{style:{width:`${Pe}%`},className:fe("h-full rounded bg-gradient-to-r flex items-center justify-between px-2.5 transition-all text-white/95 shrink-0 shadow-inner select-none",ze),title:`${U.name} (${Br(U.size_bytes)})`,children:[c.jsxs("span",{className:"text-[9px] font-bold truncate max-w-[120px] font-space tracking-wide",children:[U.role?`[${U.role}] `:"",(Ve=U.name.split("/").pop())==null?void 0:Ve.replace(".gguf","")]}),c.jsx("span",{className:"text-[8px] font-mono opacity-80",children:Br(U.size_bytes)})]},U.name)})})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Gateway Graph"}),c.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Klicke links auf Editoren, um Configs zu kopieren. Klicke rechts auf Rollen, um GGUF-Zuweisungen live zu ändern."})]}),c.jsxs("div",{ref:ee,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[c.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),c.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),c.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),c.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),c.jsx("path",{d:ue(.1),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="roocode"||N==="roocode")&&c.jsx("path",{d:ue(.1),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="cursor"||N==="cursor")&&c.jsx("path",{d:ue(.3),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="opencode"||N==="opencode")&&c.jsx("path",{d:ue(.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="zed"||N==="zed")&&c.jsx("path",{d:ue(.7),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:ue(.9),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(de==="continue"||N==="continue")&&c.jsx("path",{d:ue(.9),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.12),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("fast")&&c.jsx("path",{d:pe(.12),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.31),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("heavy")&&c.jsx("path",{d:pe(.31),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("coder")&&c.jsx("path",{d:pe(.5),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.69),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("vision")&&c.jsx("path",{d:pe(.69),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:pe(.88),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),bi("scout")&&c.jsx("path",{d:pe(.88),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"10%"},onMouseEnter:()=>Z("roocode"),onMouseLeave:()=>Z(null),onClick:()=>P(U=>U==="roocode"?null:"roocode"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Roo Code"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"30%"},onMouseEnter:()=>Z("cursor"),onMouseLeave:()=>Z(null),onClick:()=>P(U=>U==="cursor"?null:"cursor"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Cursor IDE"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"50%"},onMouseEnter:()=>Z("opencode"),onMouseLeave:()=>Z(null),onClick:()=>P(U=>U==="opencode"?null:"opencode"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"OpenCode"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"70%"},onMouseEnter:()=>Z("zed"),onMouseLeave:()=>Z(null),onClick:()=>P(U=>U==="zed"?null:"zed"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Zed"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-28 h-8 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"10%",top:"90%"},onMouseEnter:()=>Z("continue"),onMouseLeave:()=>Z(null),onClick:()=>P(U=>U==="continue"?null:"continue"),children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-cyan-400 animate-pulse"}),c.jsx("span",{children:"Continue"})]}),c.jsxs("div",{className:"absolute select-none z-10 w-36 py-3 px-4 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5",style:{left:"50%",top:"50%"},children:[c.jsx("div",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Gateway Auto"}),c.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground mt-0.5",children:["Schwelle: > ",a!=null&&a.heavy_threshold_chars?a.heavy_threshold_chars/1e3:"4","k Zeichen"]}),c.jsx("div",{className:"mt-1 px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-semibold text-primary uppercase font-mono",children:"Auto-Swap"})]}),G2.map(U=>{var qt;const he=["12%","31%","50%","69%","88%"],Pe=nl(U),ze=Pe?k.includes(Pe.name):!1;if(U==="agent")return null;const Ve={fast:0,heavy:1,coder:2,vision:3,scout:4}[U];return c.jsxs("div",{className:fe("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",ze?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":Pe?"border-border/60 bg-card/75":"border-dashed border-border/40 bg-background/20"),style:{left:"90%",top:he[Ve]},onClick:()=>ae(U),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:U}),ze&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground max-w-[150px]",children:Pe?(qt=Pe.name.split("/").pop())==null?void 0:qt.replace(".gguf",""):"Keine Zuweisung"})]},U)}),N&&o&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200 flex flex-col justify-between",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("span",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:[N==="roocode"&&"Roo Code Setup",N==="cursor"&&"Cursor Setup",N==="opencode"&&"OpenCode Setup",N==="zed"&&"Zed Setup",N==="continue"&&"Continue Setup"]}),c.jsx("button",{onClick:()=>P(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"text-xs text-muted-foreground leading-relaxed space-y-2",children:[N==="roocode"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Suche in VS Code nach der Erweiterung ",c.jsx("strong",{children:"Roo Code"})," und installiere sie."]}),c.jsxs("li",{children:["Wähle in den Roo Code Einstellungen: Provider: ",c.jsx("strong",{children:"OpenAI Compatible"}),"."]}),c.jsxs("li",{children:["Füge das untenstehende JSON-Snippet in die ",c.jsx("code",{children:"settings.json"})," ein."]})]}),N==="cursor"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Öffne Cursor Settings ➔ ",c.jsx("strong",{children:"Models"}),"."]}),c.jsxs("li",{children:["Deaktiviere Cloud-Modelle, klappe ",c.jsx("strong",{children:"OpenAI API"})," auf."]}),c.jsxs("li",{children:["Trage die Base URL unten ein und aktiviere das Modell ",c.jsx("strong",{children:"auto"}),"."]})]}),N==="opencode"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Öffne die ",c.jsx("code",{children:"opencode.jsonc"})," Konfigurationsdatei."]}),c.jsxs("li",{children:["Ersetze den Provider-Eintrag unter ",c.jsx("code",{children:"provider"})," mit dem Snippet unten."]})]}),N==="zed"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsxs("li",{children:["Öffne die Zed Settings (",c.jsx("code",{children:"ctrl+,"}),")."]}),c.jsxs("li",{children:["Füge das untenstehende JSON-Segment unter ",c.jsx("code",{children:"language_models"})," ein."]})]}),N==="continue"&&c.jsxs("ul",{className:"list-decimal pl-4 space-y-1",children:[c.jsx("li",{children:"Klicke auf das Zahnrad-Symbol in der Continue-Erweiterung."}),c.jsxs("li",{children:["Füge den Gateway-Eintrag zum ",c.jsx("code",{children:"models"}),"-Array hinzu."]})]})]}),o.tools&&c.jsxs("div",{className:"relative rounded-xl border border-border/40 bg-black/40 overflow-hidden mt-1 shrink-0",children:[c.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 border-b border-border/20 bg-black/20",children:[c.jsx("span",{className:"text-[10px] font-mono text-muted-foreground",children:"JSON Config"}),c.jsxs("button",{onClick:()=>{var U,he,Pe,ze,Ve;return pa(N==="roocode"?(U=o.tools.cline)==null?void 0:U.snippet:N==="cursor"?(he=o.tools.cursor)==null?void 0:he.snippet:N==="opencode"?(Pe=o.tools.opencode)==null?void 0:Pe.snippet:N==="zed"?(ze=o.tools.zed)==null?void 0:ze.snippet:(Ve=o.tools.continue)==null?void 0:Ve.snippet)},className:"text-xs font-semibold text-primary hover:text-primary-foreground flex items-center gap-1 cursor-pointer",children:[q?c.jsx(Cn,{className:"h-3.5 w-3.5 text-emerald-400"}):c.jsx(JN,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:q?"Kopiert":"Kopieren"})]})]}),c.jsx("pre",{className:"p-3 max-h-48 overflow-y-auto text-xs font-mono text-cyan-200/90 whitespace-pre scrollbar-thin select-text",children:c.jsxs("code",{children:[N==="roocode"&&((wi=o.tools.cline)==null?void 0:wi.snippet),N==="cursor"&&((ki=o.tools.cursor)==null?void 0:ki.snippet),N==="opencode"&&((cc=o.tools.opencode)==null?void 0:cc.snippet),N==="zed"&&((al=o.tools.zed)==null?void 0:al.snippet),N==="continue"&&((ol=o.tools.continue)==null?void 0:ol.snippet)]})})]}),c.jsx("button",{onClick:()=>P(null),className:"w-full h-9 rounded-lg bg-primary text-primary-foreground hover:opacity-90 font-semibold text-xs transition-opacity cursor-pointer mt-2",children:"Schließen"})]})})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),c.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Gateway"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),c.jsx("span",{children:"Grüner Puls: Aktive Verbindung / Warmes Modell geladen"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded bg-gradient-to-r from-teal-500 to-emerald-500"}),c.jsx("span",{children:"VRAM-Verlauf: Modellspezifischer Speicheranteil"})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground px-1",children:"Gateway Steckplatz-Belegung (Slot-Zuweisung)"}),c.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3",children:["fast","heavy","coder","vision","scout"].map(U=>{var ze;const he=b.find(Ve=>Ve.role===U),Pe=he?k.includes(he.name):!1;return c.jsxs("div",{onClick:()=>ae(U),className:fe("rounded-xl border p-3 flex flex-col justify-between gap-2.5 transition-all cursor-pointer select-none text-left bg-background/25 hover:border-primary/45 hover:bg-background/40 group min-h-[90px]",Pe?"border-emerald-500/40 shadow-sm shadow-emerald-500/5":he?"border-primary/20 bg-primary/5":"border-border/30 border-dashed opacity-75"),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:fe("text-[9px] font-bold uppercase tracking-wider font-mono px-1.5 py-0.5 rounded border",my(U)),children:U}),Pe&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsx("div",{className:"text-[10px] font-mono font-medium truncate text-foreground/90 pr-1 font-space",title:he==null?void 0:he.name,children:he?(ze=he.name.split("/").pop())==null?void 0:ze.replace(/\.gguf$/i,""):"nicht zugewiesen"}),c.jsx("div",{className:"text-[8px] text-primary/70 group-hover:text-primary font-bold uppercase tracking-wider transition-colors font-space",children:"Ändern ➔"})]},U)})})]}),(l==null?void 0:l.current)&&c.jsxs("div",{className:"rounded-2xl border border-indigo-500/30 bg-indigo-500/5 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-3.5",children:[c.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-2",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ps,{className:"h-4.5 w-4.5 text-indigo-400"}),c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Agent-Hirn (Hermes)"}),l.current.version!=null&&c.jsxs("span",{className:"text-[9px] font-mono px-1.5 py-0.5 rounded bg-indigo-500/15 text-indigo-300 border border-indigo-500/25",children:["v",l.current.version]})]}),c.jsx("button",{onClick:()=>K(!0),className:"h-7 px-3 rounded-lg border border-indigo-500/30 bg-indigo-500/5 text-indigo-300 text-[9px] font-bold uppercase hover:bg-indigo-500/15 transition-all cursor-pointer",children:"Hirn wechseln"})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 rounded-xl bg-background/30 border border-border/30 p-3.5",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:l.current.name,children:l.current.name.split("/").pop()}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[c.jsx("span",{children:l.current.params_b?`${l.current.params_b}B`:"—"}),c.jsx("span",{children:"•"}),c.jsx("span",{children:l.current.quant||"GGUF"}),c.jsx("span",{children:"•"}),c.jsx("span",{children:Br(l.current.size_bytes||0)})]})]}),l.update_available&&l.recommended?c.jsxs("button",{onClick:()=>tt(l.recommended.repo),className:fe("h-8 px-3 shrink-0 flex items-center justify-center gap-1.5 rounded-lg text-[10px] font-bold uppercase transition-all cursor-pointer shadow-md",l.budget&&!l.budget.fits?"bg-red-500 text-white hover:bg-red-400 shadow-red-500/10":"bg-amber-500 text-black hover:bg-amber-400 shadow-amber-500/10"),children:[c.jsx(no,{className:"h-3.5 w-3.5"})," Aktualisieren"]}):c.jsxs("span",{className:"h-8 px-3 shrink-0 flex items-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/15 rounded-lg select-none",children:[c.jsx(Cn,{className:"h-4 w-4"})," Neueste Generation"]})]}),l.update_available&&l.recommended&&c.jsxs("div",{className:"text-[10px] text-amber-400/90 flex items-center gap-1.5",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),"Neuere Generation verfügbar: ",c.jsx("span",{className:"font-mono font-bold",children:l.recommended.name.replace(/-GGUF$/i,"")}),"(v",l.recommended.version,", ",l.recommended.params_b,"B) — von NousResearch."]}),l.budget&&c.jsxs("div",{className:fe("text-[10px] flex items-start gap-1.5 leading-relaxed",l.budget.fits?"text-muted-foreground/80":"text-red-400 font-semibold"),children:[c.jsx(zm,{className:"h-3 w-3 shrink-0 mt-0.5"}),c.jsxs("span",{children:["Always-On-Brain ~",l.budget.brain_gb," GB + größtes on-demand (~",l.budget.largest_ondemand_gb," GB) = ",(l.budget.brain_gb+l.budget.largest_ondemand_gb).toFixed(1)," / ",l.budget.gtt_gb," GB",l.budget.fits?" · passt gleichzeitig ✓":" · passt NICHT gleichzeitig ⚠ — heavy/coder würden das Brain verdrängen. Kleineres Brain oder weniger Kontext."]})]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 px-1",children:[c.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:["Installierte Modell-Bibliothek (",oe.length," von ",b.length,")"]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[c.jsx("button",{onClick:()=>Q("all"),className:fe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",me==="all"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Vorhanden"}),c.jsx("button",{onClick:()=>Q("in_use"),className:fe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",me==="in_use"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"In Benutzung"})]}),c.jsxs("div",{className:"flex rounded-lg border border-border/40 bg-card/45 p-0.5",children:[c.jsx("button",{onClick:()=>ke("grid"),className:fe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ge==="grid"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"Grid"}),c.jsx("button",{onClick:()=>ke("list"),className:fe("px-2.5 py-1 rounded-md text-[9px] font-bold uppercase transition-all cursor-pointer",ge==="list"?"bg-primary text-primary-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:"List"})]})]})]}),ge==="grid"?c.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:oe.length===0?c.jsx("div",{className:"col-span-full text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:me==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):oe.map(U=>{const he=k.includes(U.name),Pe=u==null?void 0:u.model_list.find(Ve=>Ve.role===U.role),ze=yw(U.name);return c.jsxs("div",{className:fe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-4 transition-all duration-300 hover:border-primary/40 group relative overflow-hidden",he?"border-primary/45 shadow-primary/5":U.role?"border-primary/30 bg-primary/5 shadow-inner":"border-border/60"),children:[c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"flex items-start justify-between gap-3",children:c.jsxs("div",{className:"flex gap-2.5 min-w-0",children:[c.jsx("div",{className:fe("w-7 h-7 rounded-lg border flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",ze.color),title:ze.name,children:ze.initial}),c.jsxs("div",{className:"min-w-0",children:[c.jsx("h3",{className:"text-xs font-bold tracking-tight text-foreground line-clamp-2 break-all font-mono",title:U.name,children:U.name.split("/").pop()}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap mt-1",children:[c.jsx("span",{className:"text-[9px] font-mono text-muted-foreground bg-background/40 px-1.5 py-0.5 rounded border border-border/30",children:U.quant||"GGUF"}),he&&c.jsxs("span",{className:"flex items-center gap-1 text-[9px] font-semibold text-emerald-400 uppercase tracking-wider",children:[c.jsx(gu,{className:"h-3 w-3 animate-pulse"})," Warm"]}),U.role&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[9px] font-mono text-primary font-bold uppercase",children:U.role}),U.prompt_cache&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[9px] font-mono text-cyan-400 font-bold uppercase",title:"Prompt Caching aktiv",children:"PC"}),U.spec_active?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[9px] font-mono text-emerald-400 font-bold uppercase",title:`Speculative Decoding aktiv (Draft: ${U.spec_draft_model})`,children:"SPEC"}):U.spec_draft_model?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:`Draft gesetzt (${U.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel. Über 'Spec' neu konfigurieren.`,children:"SPEC?"}):null,U.parallel_slots>1&&c.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[9px] font-mono text-violet-400 font-bold uppercase",title:`${U.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",U.parallel_slots]}),U.incomplete&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[9px] font-mono text-amber-400 font-bold uppercase",title:"GGUF-Datei fehlt — Modell kann nicht geladen werden",children:"⚠ Datei fehlt"})]})]})]})}),c.jsx("div",{className:"border-t border-border/30 pt-3 flex flex-wrap gap-1",children:c.jsx(kN,{caps:U.capabilities})})]}),c.jsxs("div",{className:"space-y-3 pt-1",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-[10px] font-mono text-muted-foreground",children:[c.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[c.jsx(zm,{className:"h-3.5 w-3.5 text-primary/80"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Größe"}),c.jsx("div",{className:"text-foreground font-semibold",children:Br(U.size_bytes)})]})]}),c.jsxs("div",{className:"flex items-center gap-1.5 p-2 bg-background/20 rounded-lg border border-border/20",children:[c.jsx(vI,{className:"h-3.5 w-3.5 text-primary/80"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-[8px] uppercase tracking-wider font-semibold text-muted-foreground/60",children:"Kontext"}),c.jsx("div",{className:"text-foreground font-semibold",children:mw(U.ctx)})]})]})]}),Pe&&c.jsxs("div",{className:"p-3 bg-amber-500/5 border border-amber-500/30 rounded-xl space-y-2 flex flex-col justify-between shrink-0",children:[c.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),c.jsxs("span",{children:["Upgrade verfügbar: ",Pe.repo.split("/").pop()]})]}),c.jsxs("button",{onClick:()=>ce(Pe.repo,U.role,U.quant||"Q4_K_M",U.capabilities.tools!=="no"),className:"h-7 w-full flex items-center justify-center gap-1 rounded-lg bg-amber-500 text-black text-[10px] font-bold hover:bg-amber-400 transition-colors cursor-pointer",children:[c.jsx(no,{className:"h-3 w-3"})," Smart-Swap starten"]})]}),c.jsxs("div",{className:"flex items-center gap-1.5 border-t border-border/20 pt-3 mt-auto",children:[c.jsx("button",{onClick:()=>he?J(U.name):Oe(U.name),disabled:U.incomplete&&!he,className:fe("flex-1 h-7 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center justify-center gap-1",U.incomplete&&!he?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":he?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:he?"Entladen":"Laden"}),c.jsx("button",{onClick:()=>Xe(U.name,U.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),c.jsxs("button",{onClick:()=>$(U),className:fe("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-colors cursor-pointer flex items-center gap-1",U.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":U.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[c.jsx(ls,{className:"h-3 w-3"})," Spec"]}),c.jsx("button",{onClick:()=>Y(U.name),className:"h-7 w-7 rounded-lg border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 flex items-center justify-center transition-colors cursor-pointer",title:"Modell löschen",children:c.jsx(Qv,{className:"h-3.5 w-3.5"})})]})]})]},U.name)})}):c.jsx("div",{className:"space-y-2",children:oe.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center select-none",children:me==="in_use"?"Keine Modelle in Benutzung (keine Zuweisung oder warm geladene Modelle).":'Keine Modelle konfiguriert. Verwende den Tab "Modelle finden" zum Herunterladen.'}):oe.map(U=>{const he=k.includes(U.name),Pe=yw(U.name);return c.jsxs("div",{className:fe("rounded-xl border bg-card/45 backdrop-blur-md p-3.5 shadow-lg shadow-black/5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:border-primary/40 transition-all",he?"border-primary/45":U.role?"border-primary/30 bg-primary/5":"border-border/60"),children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("div",{className:fe("w-8 h-8 rounded-lg border border-border/40 flex items-center justify-center font-bold text-xs shrink-0 shadow-sm",Pe.color),title:Pe.name,children:Pe.initial}),c.jsxs("div",{className:"min-w-0 text-left",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("h4",{className:"text-xs font-bold text-foreground truncate max-w-[250px] sm:max-w-[400px] break-all font-mono",title:U.name,children:U.name.split("/").pop()}),U.role&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/10 border border-primary/20 text-[8px] font-mono text-primary font-bold uppercase shrink-0",children:U.role}),U.prompt_cache&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-cyan-500/10 border border-cyan-500/20 text-[8px] font-mono text-cyan-400 font-bold uppercase shrink-0",title:"Prompt Caching aktiv",children:"PC"}),U.spec_active?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20 text-[8px] font-mono text-emerald-400 font-bold uppercase shrink-0",title:`Speculative Decoding aktiv (Draft: ${U.spec_draft_model})`,children:"SPEC"}):U.spec_draft_model?c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:`Draft gesetzt (${U.spec_draft_model}), aber INAKTIV — --spec-type fehlt oder Vocab inkompatibel.`,children:"SPEC?"}):null,U.parallel_slots>1&&c.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-violet-500/10 border border-violet-500/20 text-[8px] font-mono text-violet-400 font-bold uppercase shrink-0",title:`${U.parallel_slots} parallele Slots aktiv`,children:["SLOTS: ",U.parallel_slots]}),U.incomplete&&c.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-500/10 border border-amber-500/20 text-[8px] font-mono text-amber-400 font-bold uppercase shrink-0",title:"GGUF-Datei fehlt",children:"⚠ Datei fehlt"}),he&&c.jsxs("span",{className:"flex items-center gap-0.5 text-[8px] font-semibold text-emerald-400 uppercase tracking-wider shrink-0",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"})," warm"]})]}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 mt-0.5",children:[c.jsxs("span",{children:["Größe: ",Br(U.size_bytes)]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["Kontext: ",mw(U.ctx)]}),c.jsx("span",{children:"•"}),c.jsx("span",{className:"font-mono text-[9px]",children:U.quant||"GGUF"})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0 self-end sm:self-auto",children:[c.jsx("div",{className:"hidden lg:flex flex-wrap gap-1",children:c.jsx(kN,{caps:U.capabilities})}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{onClick:()=>he?J(U.name):Oe(U.name),disabled:U.incomplete&&!he,className:fe("h-7 px-3 rounded-lg text-[9px] font-bold uppercase transition-all border flex items-center gap-1",U.incomplete&&!he?"border-border/30 bg-background/10 text-muted-foreground/50 cursor-not-allowed":he?"border-amber-500/30 bg-amber-500/5 hover:bg-amber-500/15 text-amber-400 cursor-pointer":"border-primary/30 bg-primary/5 hover:bg-primary/15 text-primary cursor-pointer"),children:he?"Entladen":"Laden"}),c.jsx("button",{onClick:()=>Xe(U.name,U.ctx),className:"h-7 px-2.5 rounded-lg border border-border/40 text-[9px] font-bold uppercase hover:bg-accent text-muted-foreground transition-all cursor-pointer",title:"Kontextlänge anpassen",children:"Ctx"}),c.jsxs("button",{onClick:()=>$(U),className:fe("h-7 px-2.5 rounded-lg border text-[9px] font-bold uppercase transition-all cursor-pointer flex items-center gap-1",U.spec_active?"border-emerald-500/30 text-emerald-400 hover:bg-emerald-500/10":U.spec_draft_model?"border-amber-500/30 text-amber-400 hover:bg-amber-500/10":"border-border/40 text-muted-foreground hover:bg-accent"),title:"Speculative Draft konfigurieren (Vocab-geprüft)",children:[c.jsx(ls,{className:"h-3 w-3"})," Spec"]}),c.jsx("button",{onClick:()=>Y(U.name),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all cursor-pointer",title:"Modell löschen",children:c.jsx(Qv,{className:"h-3.5 w-3.5"})})]})]})]},U.name)})})]}),O&&(()=>{var Ve,qt;const U=_&&_.role===O?_:null,he={};U==null||U.models.forEach(Ze=>{he[Ze.name]=Ze});const Pe=U?U.models.map(Ze=>b.find(vt=>vt.name===Ze.name)).filter(Boolean):b,ze=Ze=>{_e(O,Ze),C(null)};return c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary",children:["Rolle '",O,"' konfigurieren"]}),c.jsx("button",{onClick:()=>C(null),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("p",{className:"text-xs text-muted-foreground",children:["Wähle ein Modell für die Rolle ",c.jsx("strong",{className:"text-foreground",children:O}),":"]}),(U==null?void 0:U.recommended)&&c.jsxs("button",{onClick:()=>ze(U.recommended),title:(Ve=he[U.recommended])==null?void 0:Ve.reason,className:"shrink-0 h-7 px-3 text-[11px] font-semibold text-primary border border-primary/50 bg-primary/10 hover:bg-primary/20 rounded-lg cursor-pointer flex items-center gap-1",children:[c.jsx(ls,{className:"h-3 w-3"})," Auto: ",(qt=U.recommended.split("/").pop())==null?void 0:qt.replace(/\.gguf$/i,"")]})]}),c.jsxs("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:[c.jsx("button",{onClick:()=>ze(""),className:"w-full text-left px-3 py-2 rounded-lg text-xs hover:bg-accent text-red-400 font-semibold cursor-pointer border border-red-500/20 bg-red-500/5 flex items-center justify-between",children:c.jsx("span",{children:"Zuweisung entfernen"})}),Pe.map(Ze=>{var ll;const vt=he[Ze.name],ga=Ze.role===O,sl=!!(vt!=null&&vt.recommended),dc=!!vt&&!vt.suitable;return c.jsxs("button",{onClick:()=>ze(Ze.name),className:fe("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border",sl?"border-primary/50 bg-primary/10":ga?"text-primary font-bold bg-primary/5 border-primary/30":dc?"border-border/20 bg-background/10 opacity-60":"text-foreground bg-background/20 border-border/30"),children:[c.jsxs("div",{className:"flex flex-col text-left min-w-0",children:[c.jsxs("span",{className:"truncate max-w-[260px] font-semibold flex items-center gap-1.5",children:[(ll=Ze.name.split("/").pop())==null?void 0:ll.replace(/\.gguf$/i,""),sl&&c.jsx("span",{className:"text-[8px] font-bold uppercase tracking-wide text-primary bg-primary/15 px-1.5 py-0.5 rounded",children:"Empfohlen"})]}),c.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:vt?`${vt.params_b}B · ${Ze.quant} · ${vt.reason}`:`${Br(Ze.size_bytes)} · ${Ze.quant}`})]}),ga&&c.jsx(Cn,{className:"h-4 w-4 shrink-0 text-primary"})]},Ze.name)})]})]})})})(),I&&c.jsx(ZQ,{model:I,onClose:()=>$(null),onChanged:S}),B&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[c.jsx(Ps,{className:"h-4 w-4"})," Agent-Hirn wechseln"]}),c.jsx("button",{onClick:()=>K(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Wähle ein ",c.jsx("strong",{className:"text-foreground",children:"installiertes"})," Modell als Agent-Hirn. Es bekommt den",c.jsx("code",{className:"text-primary",children:" hermes"}),'-Alias, wird warm gehalten (brains-Gruppe), und Hermes nutzt es nach einem kurzen Gateway-Restart. Neues Modell (z.B. Hermes-4.3 oder Gemma-4)? Erst über „Modelle finden" laden.']}),c.jsx("div",{className:"space-y-1.5 max-h-72 overflow-y-auto pr-1",children:b.map(U=>{var Pe;const he=U.role==="hermes";return c.jsxs("button",{onClick:()=>!he&&kr(U.name),disabled:he||U.incomplete,className:fe("w-full text-left px-3 py-2.5 rounded-lg text-xs flex items-center justify-between font-mono border transition-all",he?"border-indigo-500/40 bg-indigo-500/10 text-indigo-300":U.incomplete?"border-border/20 bg-background/10 text-muted-foreground/50 cursor-not-allowed":"border-border/30 bg-background/20 text-foreground hover:bg-accent cursor-pointer"),children:[c.jsxs("div",{className:"flex flex-col min-w-0",children:[c.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:(Pe=U.name.split("/").pop())==null?void 0:Pe.replace(/\.gguf$/i,"")}),c.jsxs("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:[U.capabilities.params_b?`${U.capabilities.params_b}B`:"?"," · ",Br(U.size_bytes),U.role&&` · Rolle: ${U.role}`,U.capabilities.tools!=="no"?" · Tools ✓":" · ohne Tools"]})]}),he?c.jsxs("span",{className:"text-[9px] font-bold uppercase text-indigo-300 shrink-0 flex items-center gap-1",children:[c.jsx(Cn,{className:"h-3.5 w-3.5"})," Aktiv"]}):c.jsx("span",{className:"text-[9px] font-bold uppercase text-primary/70 shrink-0",children:"Als Hirn setzen →"})]},U.name)})}),c.jsxs("div",{className:"text-[10px] text-amber-400/80 flex items-start gap-1.5 border-t border-border/20 pt-2.5",children:[c.jsx("span",{children:"💡"}),c.jsxs("span",{children:["Für einen ",c.jsx("strong",{children:"Agenten"})," sind Hermes-Modelle (natives Tool-Calling) meist die robustere Wahl als allgemeine Modelle."]})]})]})}),x]})}function eY(){const[e,t]=y.useState(""),[r,n]=y.useState([]),[a,o]=y.useState("Q4_K_M"),[u,l]=y.useState(""),[f,h]=y.useState(""),[p,v]=y.useState(""),[x,b]=y.useState([]),[k,j]=y.useState(null),[S,N]=y.useState(!1),P=["fast","heavy","coder","vision","scout"],{data:O}=vo(),C=f?O==null?void 0:O.models.find(R=>(R.role||"").toLowerCase()===f):void 0;async function _(R,de,Z){if(N(!1),!R.trim()){j(null);return}try{const ge=await Me(`/api/fit?params_b=0&quant=${encodeURIComponent(de)}&ctx=8192&name=${encodeURIComponent(R)}&role=${encodeURIComponent(Z)}`);j(ge)}catch{j(null)}}async function A(R){const de=R??e;if(de.trim()){l("Analysiere HuggingFace Repository..."),j(null);try{const Z=await Me(`/api/hf/quants?repo=${encodeURIComponent(de)}`);t(Z.repo),n(Z.quants);const ge=Z.quants.length?Z.quants.includes("Q4_K_M")?"Q4_K_M":Z.quants[0]:a;Z.quants.length&&o(ge),l(Z.quants.length?"":"Keine GGUF-Dateien in diesem Repository gefunden."),Z.quants.length&&_(Z.repo,ge,f)}catch(Z){l(`Fehler: ${Z}`)}}}function I(R){o(R),_(e,R,f)}function $(R){h(R),r.length&&_(e,a,R)}async function B(){if(p.trim()){l("Durchsuche HuggingFace...");try{const R=await Me(`/api/hf/search?q=${encodeURIComponent(p)}`);b(R.results),l(R.results.length?"":"Keine Ergebnisse gefunden.")}catch(R){l(`Suche fehlgeschlagen: ${R}`)}}}async function K(){if(e.trim()){if((k==null?void 0:k.fit.level)==="too_tight"&&!S){N(!0);return}l("Download-Job wird initiiert...");try{await Me("/api/models/install",{method:"POST",body:JSON.stringify({repo:e,quant:a,role:f||void 0,jinja:!0})}),N(!1),l(`Download gestartet: ${e} (${a})${f?`, Rolle: ${f}`:""}. Fortschritt oben.`+(C?` „${f}" wurde von ${C.name} übernommen.`:"")+(f==="fast"||f==="coder"?" Speculative Draft (Vocab-geprüft) kannst du nach dem Download an der Modellkarte (»Spec«) setzen.":""))}catch(R){l(`Download-Fehler: ${R}`)}}}const q=(k==null?void 0:k.fit.level)==="perfect"?"text-emerald-400 border-emerald-500/40 bg-emerald-500/10":(k==null?void 0:k.fit.level)==="marginal"?"text-amber-400 border-amber-500/40 bg-amber-500/10":"text-red-400 border-red-500/40 bg-red-500/10";return c.jsxs("div",{className:"space-y-4 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"HF Download & Suche"}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[c.jsx("input",{value:e,onChange:R=>{t(R.target.value),j(null),N(!1)},placeholder:"HF-URL oder org/repo (z.B. unsloth/Qwen2.5-Coder-7B-Instruct-GGUF)",className:"flex-1 h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{onClick:()=>A(),className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer whitespace-nowrap",children:"Quants laden"}),r.length>0&&c.jsxs(c.Fragment,{children:[c.jsx("select",{value:a,onChange:R=>I(R.target.value),className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:r.map(R=>c.jsx("option",{value:R,className:"bg-popover text-foreground",children:R},R))}),c.jsxs("select",{value:f,onChange:R=>$(R.target.value),title:"Rolle (optional) — bestimmt Auto-Konfiguration + setup-bewussten Kontext",className:"h-9 rounded-lg border border-border/60 bg-background/40 px-3 text-xs outline-none text-foreground font-semibold",children:[c.jsx("option",{value:"",className:"bg-popover text-foreground",children:"Rolle…"}),P.map(R=>c.jsx("option",{value:R,className:"bg-popover text-foreground",children:R},R))]}),c.jsx("button",{onClick:K,className:`h-9 px-4 rounded-lg text-xs font-semibold transition-all cursor-pointer flex items-center gap-1.5 ${S?"bg-red-500 text-white hover:opacity-90":"bg-primary text-primary-foreground hover:opacity-90"}`,children:S?c.jsxs(c.Fragment,{children:[c.jsx(Cs,{className:"h-3.5 w-3.5"})," OOM-Risiko — trotzdem laden"]}):c.jsxs(c.Fragment,{children:[c.jsx(no,{className:"h-3.5 w-3.5"})," Herunterladen"]})})]})]})]}),k&&c.jsxs("div",{className:`flex flex-wrap items-center gap-x-3 gap-y-1 rounded-lg border px-3 py-2 text-[11px] font-medium ${q}`,children:[c.jsx("span",{className:"font-bold uppercase tracking-wide",children:k.fit.text}),c.jsxs("span",{className:"font-mono opacity-90",children:["~",k.params_b,"B · ~",k.fit.req_gb," GB / ",k.sys_ram_gb," GB RAM · ~",k.fit.tps," t/s"]}),k.fit.level!=="too_tight"&&c.jsxs("span",{className:"font-mono opacity-80",title:`Setup-bewusst: GTT ${k.budget.gtt_gb} GB − reserviert ${k.budget.reserved_gb} GB (${k.budget.mode}) → ${k.budget.budget_gb} GB frei`,children:["ctx → ",(k.assigned_ctx/1024).toFixed(0),"k"]}),k.fit.level==="too_tight"&&c.jsx("span",{className:"opacity-90",children:"— passt nicht in den Speicher, würde beim Laden abstürzen (OOM)."})]}),C&&c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-[11px] font-medium text-amber-400",children:[c.jsx(Cs,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),c.jsxs("span",{children:["Rolle ",c.jsxs("strong",{children:["„",f,'"']})," ist aktuell ",c.jsx("strong",{children:C.name})," zugewiesen. Beim Download übernimmt das neue Modell diese Rolle — ",C.name," bleibt installiert, verliert sie aber."]})]}),c.jsxs("div",{className:"flex gap-2 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{value:p,onChange:R=>v(R.target.value),onKeyDown:R=>R.key==="Enter"&&B(),placeholder:"HuggingFace durchsuchen (z.B. Llama-3.1)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-background/40 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),c.jsx(oy,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),c.jsx("button",{onClick:B,className:"h-9 px-4 rounded-lg border border-border/60 bg-background/20 text-xs font-semibold hover:border-primary/50 hover:bg-background/40 transition-all cursor-pointer",children:"Suchen"})]}),x.length>0&&c.jsx("div",{className:"max-h-48 space-y-1.5 overflow-y-auto border border-border/40 bg-background/20 p-2 rounded-xl scrollbar-thin",children:x.map(R=>c.jsxs("button",{onClick:()=>{t(R.repo),b([]),v(""),A(R.repo)},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left text-xs bg-background/10 border border-border/10 hover:border-primary/30 hover:bg-background/30 transition-all",children:[c.jsx("span",{className:"font-semibold truncate",children:R.repo}),c.jsxs("span",{className:"text-[10px] font-mono text-muted-foreground flex items-center gap-1 shrink-0",children:[c.jsx(no,{className:"h-3 w-3"})," ",R.downloads.toLocaleString()]})]},R.repo))}),u&&c.jsx("div",{className:"text-[10px] font-medium text-primary font-mono",children:u})]})}const tY={fast:{title:"Schnelles Alltags-Hirn",desc:"Schnelle MoE-Antworten für Chat, Zusammenfassungen und alltägliche Aufgaben.",icon:ls},heavy:{title:"Schweres Reasoning",desc:"Große Modelle für komplexe Logik, Mathematik und tiefgründiges Planen.",icon:yu},coder:{title:"Coden & Entwicklung",desc:"Autovervollständigung, Refactoring und Codegenerierung direkt in deiner IDE.",icon:Gv},vision:{title:"Bilder & Vision",desc:"Verarbeitet Bilder, Screenshots und visuelle Diagramme in multimodalen Chats.",icon:qv},scout:{title:"Multimodal-Allrounder",desc:"Multimodaler Allrounder für schnelle Antworten, Übersetzungen und Alltag.",icon:Vv}};function rY(){const{data:e,isLoading:t,error:r}=z3(),{data:n}=vo(),{data:a}=hy(),o=(n==null?void 0:n.models)??[],u=r?String(r):"",[l,f]=y.useState({}),[h,p]=y.useState({}),[v,x]=y.useState(!1);async function b(k,j,S,N){f(P=>({...P,[k]:"Starte..."}));try{await Me("/api/models/install",{method:"POST",body:JSON.stringify({repo:k,role:j,quant:S,jinja:N})}),f(P=>({...P,[k]:"Download läuft"}))}catch{f(O=>({...O,[k]:"Fehler"}))}}return t?c.jsx("div",{className:"text-xs text-muted-foreground py-12 text-center",children:"Analysiere Hardware und suche passende GGUF-Empfehlungen…"}):u||!e?c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Empfehlungsdienst temporär nicht erreichbar (",u,")."]}):c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground bg-background/25 border border-border/40 p-4 rounded-xl flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-sm",children:[c.jsxs("div",{children:["Modell-Registry geladen für ",c.jsxs("span",{className:"text-foreground font-bold",children:[e.sys_ram_gb," GB"]})," System-RAM."]}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(n2,{className:"h-3.5 w-3.5 text-primary fill-primary/20"}),c.jsx("span",{children:"Empfehlungen sind automatisch auf deine Box-Hardware optimiert."})]})]}),c.jsx("div",{className:"grid gap-6 md:grid-cols-2",children:e.categories.map(k=>{const j=tY[k.role]||{title:k.title||k.role,desc:"Spezifisches Modell für diese Systemrolle.",icon:bu},S=j.icon,N=o.find(I=>I.role===k.role),P=a==null?void 0:a.model_list.find(I=>I.role===k.role),O=k.models.find(I=>I.repo===k.recommended)||k.models[0];if(!O)return null;const C=l[O.repo],_=k.models.filter(I=>I.repo!==k.recommended),A=!!h[k.role];return c.jsxs("div",{className:fe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-5 transition-all duration-300 hover:border-primary/40",N?"border-border/60":"border-primary/20 shadow-primary/5"),children:[c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/10 border border-primary/20 flex items-center justify-center text-primary shadow-sm shrink-0",children:c.jsx(S,{className:"h-5.5 w-5.5"})}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-bold tracking-tight text-foreground",children:j.title}),c.jsxs("span",{className:"text-[9px] font-mono text-muted-foreground uppercase bg-background/50 px-1.5 py-0.5 rounded border border-border/30 inline-block mt-0.5",children:["Rolle: ",k.role]})]})]}),N?c.jsxs("span",{className:"flex items-center gap-1.5 text-[9px] font-bold text-emerald-400 uppercase tracking-wider bg-emerald-500/10 border border-emerald-500/20 px-2.5 py-1 rounded-lg",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"Aktiviert"]}):c.jsx("span",{className:"text-[9px] font-bold text-primary/70 uppercase tracking-wider bg-primary/10 border border-primary/20 px-2.5 py-1 rounded-lg",children:"Frei"})]}),c.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:j.desc}),c.jsx("div",{className:"p-3.5 rounded-xl bg-background/35 border border-border/30 space-y-2.5",children:N?c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-muted-foreground/60",children:"Aktive GGUF-Belegung"}),c.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:N.name,children:N.name.split("/").pop()}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2",children:[c.jsxs("span",{children:["Größe: ",tg(N.size_bytes||0)]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["Quant: ",N.quant||"GGUF"]})]})]}):c.jsxs("div",{className:"space-y-1.5",children:[c.jsx("div",{className:"text-[9px] font-bold uppercase tracking-wider text-primary/80",children:"Empfohlenes Modell"}),c.jsx("div",{className:"text-xs font-mono font-bold text-foreground truncate",title:O.name,children:O.name}),c.jsxs("div",{className:"text-[10px] text-muted-foreground/80 flex items-center gap-2 flex-wrap",children:[c.jsxs("span",{children:["Ersteller: ",O.author]}),c.jsx("span",{children:"•"}),c.jsxs("span",{children:["Quant: ",O.quant]})]}),c.jsx("div",{className:"flex items-center gap-1.5 pt-0.5",children:c.jsx(w4,{fit:O.fit})})]})}),c.jsx("div",{className:"pt-1",children:N?P?c.jsxs("div",{className:"space-y-2",children:[c.jsxs("div",{className:"text-[9px] font-semibold text-amber-400 flex items-center gap-1.5",children:[c.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping shrink-0"}),c.jsxs("span",{children:["Bessere Version in der Registry: ",P.repo.split("/").pop()]})]}),c.jsxs("button",{onClick:()=>b(P.repo,k.role,O.quant||"Q4_K_M",O.caps.tools!=="no"),disabled:!!l[P.repo],className:"h-8 w-full flex items-center justify-center gap-1.5 rounded-lg bg-amber-500 text-black text-xs font-bold hover:bg-amber-400 disabled:opacity-50 transition-all cursor-pointer shadow-md shadow-amber-500/10",children:[c.jsx(no,{className:"h-3.5 w-3.5"}),l[P.repo]||"Auf neue Version aktualisieren"]})]}):c.jsxs("div",{className:"h-8 flex items-center justify-center gap-1.5 text-[10px] font-bold text-emerald-400 uppercase tracking-wide bg-emerald-500/5 border border-emerald-500/10 rounded-lg select-none",children:[c.jsx(Cn,{className:"h-4 w-4"})," Auf neuestem Stand"]}):c.jsxs("button",{onClick:()=>b(O.repo,k.role,O.quant||"Q4_K_M",O.caps.tools!=="no"),disabled:!!C,className:fe("h-8 w-full flex items-center justify-center gap-1.5 rounded-lg text-xs font-bold transition-all cursor-pointer border",C?"border-primary/40 bg-primary/5 text-primary":"bg-primary text-primary-foreground hover:opacity-90 shadow-md shadow-primary/10"),children:[c.jsx(no,{className:"h-3.5 w-3.5"}),C||"Optimales Modell einsetzen"]})})]}),_.length>0&&c.jsxs("div",{className:"border-t border-border/20 pt-3",children:[c.jsxs("button",{onClick:()=>p(I=>({...I,[k.role]:!A})),className:"flex items-center gap-1.5 text-[10px] text-muted-foreground/80 hover:text-foreground transition-colors cursor-pointer",children:[A?c.jsx(nI,{className:"h-3 w-3"}):c.jsx(tI,{className:"h-3 w-3"}),c.jsxs("span",{children:["Alternative Empfehlungen anzeigen (",_.length,")"]})]}),A&&c.jsx("div",{className:"mt-2.5 space-y-2 max-h-36 overflow-y-auto pr-1 scrollbar-thin",children:_.map(I=>c.jsxs("div",{className:"p-2 rounded-lg bg-background/25 border border-border/20 flex items-center justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("div",{className:"text-[10px] font-mono font-bold text-foreground truncate",title:I.name,children:I.name}),c.jsxs("div",{className:"text-[9px] text-muted-foreground flex items-center gap-1.5 mt-0.5",children:[c.jsxs("span",{children:["Quant: ",I.quant]}),c.jsx("span",{children:"•"}),c.jsx("span",{children:I.fit.text})]})]}),c.jsx("button",{onClick:()=>b(I.repo,k.role,I.quant||"Q4_K_M",I.caps.tools!=="no"),disabled:!!l[I.repo],className:"h-6 px-2.5 rounded bg-background/40 hover:bg-background/80 border border-border/40 text-[9px] font-bold text-foreground transition-all cursor-pointer shrink-0 disabled:opacity-50",children:l[I.repo]||"Installieren"})]},I.repo))})]})]},k.role)})}),c.jsxs("div",{className:"border border-border/50 bg-card/20 rounded-2xl overflow-hidden shadow-md mt-4",children:[c.jsxs("button",{onClick:()=>x(!v),className:"w-full px-5 py-4 flex items-center justify-between text-xs font-bold uppercase tracking-wider text-muted-foreground hover:bg-card/30 transition-colors cursor-pointer",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(oy,{className:"h-4 w-4 text-primary"}),c.jsx("span",{children:"Eigenes Modell von Hugging Face laden (Erweiterte Ansicht)"})]}),c.jsx("span",{className:"text-[10px] text-primary hover:underline",children:v?"Ausblenden ▲":"Anzeigen ▼"})]}),v&&c.jsx("div",{className:"p-5 border-t border-border/20 bg-card/10",children:c.jsx(eY,{})})]})]})}function nY(){const[e,t]=y.useState("cockpit");return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Modell-Manager"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwalte deine Modelle und passe das Gateway-Routing live über das interaktive Cockpit an."})]}),c.jsx("div",{className:"flex rounded-xl border border-border/60 bg-card/45 backdrop-blur-md p-1 self-start",children:["cockpit","discover"].map(r=>c.jsx("button",{onClick:()=>t(r),className:fe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",e===r?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:r==="cockpit"?"Cockpit":"Modelle finden"},r))})]}),c.jsx(XQ,{}),c.jsx("div",{className:"transition-all duration-300",children:e==="cockpit"?c.jsx(JQ,{}):c.jsx(rY,{})})]})}function iY(){const[e,t]=y.useState(localStorage.getItem("mc_host")||"192.168.178.151"),[r,n]=y.useState(localStorage.getItem("mc_mcp_path")||""),[a,o]=y.useState("cline"),[u,l]=y.useState(!1),f=new URLSearchParams({host:e});r&&f.set("mcp_path",r);const{data:h,error:p}=L2(f.toString()),v=p?String(p):"";function x(S){t(S),S&&localStorage.setItem("mc_host",S)}function b(S){n(S),localStorage.setItem("mc_mcp_path",S)}const k=h==null?void 0:h.tools[a];async function j(){k&&(await navigator.clipboard.writeText(k.snippet),l(!0),setTimeout(()=>l(!1),1500))}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Verbindung & Integration"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Kopiere vorgefertigte Konfigurationsdateien für deinen lokalen PC (IDEs, Cline, Roo Code, Cursor), um direkt auf das geteilte Gedächtnis und den Auto-Swap-Gateway der Box zuzugreifen."})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2 p-5 rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md shadow-lg shadow-black/10",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[c.jsx(uI,{className:"h-3.5 w-3.5 text-primary"})," Box LAN IP-Adresse"]}),c.jsx("input",{value:e,onChange:S=>x(S.target.value),placeholder:"z.B. 192.168.178.151",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("label",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground flex items-center gap-1.5",children:[c.jsx(lI,{className:"h-3.5 w-3.5 text-primary"})," Lokaler MCP-Scriptpfad"]}),c.jsx("input",{value:r,onChange:S=>b(S.target.value),placeholder:"z.B. F:\\Coding Stuff\\mission-control-2\\mcp\\mcp_memory.py",className:"w-full h-9 rounded-lg border border-border/60 bg-background/40 px-3 font-mono text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"})]})]}),v&&c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Generieren der Snippets: ",v]}),h&&c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"flex flex-wrap gap-1 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:Object.entries(h.tools).map(([S,N])=>c.jsx("button",{onClick:()=>o(S),className:fe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",a===S?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:N.label},S))}),k&&c.jsxs("div",{className:"space-y-3",children:[k.note&&c.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-xl bg-primary/5 border border-primary/20 text-xs text-muted-foreground leading-relaxed",children:[c.jsx(cI,{className:"h-4.5 w-4.5 text-primary shrink-0 mt-0.5"}),c.jsx("span",{children:k.note})]}),c.jsxs("div",{className:"flex flex-col border border-border/60 bg-black/60 rounded-2xl overflow-hidden shadow-2xl",children:[c.jsxs("div",{className:"flex h-11 items-center justify-between px-4 border-b border-border/40 bg-black/40 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-3 w-3 rounded-full bg-red-500/80 shadow-md shadow-red-500/10"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-amber-500/80 shadow-md shadow-amber-500/10"}),c.jsx("span",{className:"h-3 w-3 rounded-full bg-emerald-500/80 shadow-md shadow-emerald-500/10"})]}),c.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground/75 bg-background/30 px-3 py-1 rounded-md border border-border/20",children:[c.jsx(nf,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{children:a==="cline"||a==="cursor"?"config.json":"settings.json"})]}),c.jsxs("button",{onClick:j,className:"flex h-7 px-2.5 items-center gap-1.5 rounded-lg border border-border/40 bg-background/30 text-[10px] font-semibold text-muted-foreground hover:text-foreground hover:bg-background/60 transition-all cursor-pointer",children:[u?c.jsx(Cn,{className:"h-3.5 w-3.5 text-emerald-400"}):c.jsx(JN,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:u?"Kopiert":"Kopieren"})]})]}),c.jsx("pre",{className:"p-5 overflow-x-auto text-xs font-mono text-cyan-200/90 whitespace-pre leading-relaxed scrollbar-thin select-text bg-black/10",children:c.jsx("code",{children:k.snippet})})]})]})]})]})}const aY="modulepreload",oY=function(e){return"/"+e},jN={},sY=function(t,r,n){let a=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(p=>Promise.resolve(p).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),f=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));a=u(r.map(h=>{if(h=oY(h),h in jN)return;jN[h]=!0;const p=h.endsWith(".css"),v=p?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${v}`))return;const x=document.createElement("link");if(x.rel=p?"stylesheet":aY,p||(x.as="script"),x.crossOrigin="",x.href=h,f&&x.setAttribute("nonce",f),document.head.appendChild(x),p)return new Promise((b,k)=>{x.addEventListener("load",b),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${h}`)))})}))}function o(u){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=u,window.dispatchEvent(l),!l.defaultPrevented)throw u}return a.then(u=>{for(const l of u||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};class lY extends y.Component{constructor(){super(...arguments);Kl(this,"state",{error:null})}static getDerivedStateFromError(r){return{error:r}}render(){return this.state.error?c.jsxs("div",{className:"h-[480px] rounded-2xl border border-red-500/20 bg-red-500/5 p-6 text-xs text-red-400 overflow-auto",children:[c.jsx("div",{className:"font-semibold mb-2",children:"Graph konnte nicht gerendert werden"}),c.jsx("pre",{className:"whitespace-pre-wrap break-words text-[11px] leading-relaxed",children:this.state.error.message})]}):this.props.children}}const uY=y.lazy(()=>sY(()=>import("./GraphView-C2Rr5maK.js"),[]).then(e=>({default:e.GraphView}))),SN=["user","instruction","stable","versioned","ephemeral"],Av=new Set(["auto","agent"]),Ov={user:{label:"User",icon:SI,color:"text-cyan-400",border:"border-cyan-500/30",bg:"bg-cyan-500/10",text:"text-cyan-400"},instruction:{label:"Regel",icon:bI,color:"text-violet-400",border:"border-violet-500/30",bg:"bg-violet-500/10",text:"text-violet-400"},stable:{label:"Fakt",icon:wu,color:"text-indigo-400",border:"border-indigo-500/30",bg:"bg-indigo-500/10",text:"text-indigo-400"},versioned:{label:"Version",icon:jI,color:"text-amber-400",border:"border-amber-500/30",bg:"bg-amber-500/10",text:"text-amber-400"},ephemeral:{label:"Temporär",icon:aI,color:"text-pink-400",border:"border-pink-500/30",bg:"bg-pink-500/10",text:"text-pink-400"}},NN={label:"Gedächtnis",icon:XN,bg:"bg-muted/10",text:"text-muted-foreground"},cY={user:"border-l-cyan-500/80",instruction:"border-l-violet-500/80",stable:"border-l-indigo-500/80",versioned:"border-l-amber-500/80",ephemeral:"border-l-pink-500/80"};function dY(){const[e,t]=y.useState(""),[r,n]=y.useState(""),[a,o]=y.useState(""),[u,l]=y.useState("stable"),[f,h]=y.useState(!1),[p,v]=y.useState("liste"),x=po(),{showAlert:b,showConfirm:k,dialogElement:j}=el(),{data:S=[],error:N}=z2({q:r,category:e}),{data:P}=I3(p==="graph"),O=N?String(N):"",C=()=>{x.invalidateQueries({queryKey:["memory"]}),x.invalidateQueries({queryKey:["memory-graph"]})};async function _(){a.trim()&&(await Me("/api/memory",{method:"POST",body:JSON.stringify({content:a,category:u,source:"ui"})}),o(""),C())}async function A($){await Me(`/api/memory/${$}`,{method:"DELETE"}),C()}async function I(){h(!0);try{const $=await Me("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!1})});if($.duplicate_count===0){b("Ergebnis","Keine Dubletten gefunden — alles sauber.");return}k("Deduplizierung bestätigen",`${$.duplicate_count} Dublette(n) in ${$.groups.length} Gruppe(n) gefunden. Entfernen?`,async()=>{try{await Me("/api/memory/dedupe",{method:"POST",body:JSON.stringify({apply:!0})}),C()}catch(B){b("Fehler",`Fehler beim Löschen: ${B.message}`)}})}catch($){b("Fehler",`Fehler bei der Deduplizierung: ${$.message}`)}finally{h(!1)}}return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Gedächtnis-Pool (Memory)"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Die geteilte Konstitution des Systems. Alle Instanzen (Hermes, IDEs, Gateway) lesen und schreiben hierauf per MCP-Protokoll."})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0 self-start",children:[c.jsxs("div",{className:"flex items-center gap-1 p-1 bg-card/30 border border-border/40 rounded-lg",children:[c.jsxs("button",{onClick:()=>v("liste"),className:fe("flex h-7 px-2.5 items-center gap-1.5 text-[11px] font-semibold rounded-md transition-all cursor-pointer",p==="liste"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[c.jsx(hI,{className:"h-3.5 w-3.5"})," Liste"]}),c.jsxs("button",{onClick:()=>v("graph"),className:fe("flex h-7 px-2.5 items-center gap-1.5 text-[11px] font-semibold rounded-md transition-all cursor-pointer",p==="graph"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[c.jsx(wI,{className:"h-3.5 w-3.5"})," Graph"]})]}),c.jsxs("button",{onClick:I,disabled:f,className:"flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-card hover:border-primary/50 transition-all cursor-pointer shadow-md disabled:opacity-50",children:[c.jsx(Y1,{className:"h-4 w-4 text-primary animate-pulse"}),c.jsx("span",{children:"Deduplizieren"})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 space-y-4",children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Neuen Eintrag anlegen"}),c.jsx("textarea",{value:a,onChange:$=>o($.target.value),placeholder:"Füge eine neue Regel, eine Vorliebe oder einen stabilen Fakt über das Projekt oder dich hinzu...",rows:3,className:"w-full resize-none rounded-xl border border-border/60 bg-background/30 p-3.5 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground transition-all leading-relaxed"}),c.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-[10px] font-semibold text-muted-foreground uppercase tracking-wider",children:"Kategorie"}),c.jsx("select",{value:u,onChange:$=>l($.target.value),className:"h-8 rounded-lg border border-border/60 bg-background/50 px-2 py-1 text-xs outline-none font-semibold text-foreground cursor-pointer",children:SN.map($=>{var B;return c.jsx("option",{value:$,className:"bg-popover text-foreground",children:((B=Ov[$])==null?void 0:B.label)||$},$)})})]}),c.jsxs("button",{onClick:_,className:"h-9 px-4 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all flex items-center gap-1.5 cursor-pointer shadow-md shadow-primary/10",children:[c.jsx(e2,{className:"h-4 w-4"})," Speichern"]})]})]}),p==="graph"?c.jsx(lY,{children:c.jsx(y.Suspense,{fallback:c.jsx("div",{className:"h-[480px] rounded-2xl border border-border/60 bg-card/30 flex items-center justify-center text-xs text-muted-foreground",children:"Graph wird geladen…"}),children:c.jsx(uY,{data:P??{nodes:[],edges:[]},onDelete:A})})}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col md:flex-row items-stretch md:items-center gap-3",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx("input",{value:r,onChange:$=>n($.target.value),placeholder:"Semantisch durchsuchen (nach Bedeutung, nicht nur Stichwort)...",className:"w-full h-9 pl-9 pr-3 rounded-lg border border-border/60 bg-card/45 text-xs outline-none focus:ring-1 focus:ring-primary/50 text-foreground"}),c.jsx(oy,{className:"absolute left-3 top-2.5 h-3.5 w-3.5 text-muted-foreground"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 p-1 bg-card/30 border border-border/40 rounded-xl overflow-x-auto max-w-full",children:[c.jsx("button",{onClick:()=>t(""),className:fe("h-7 px-3 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer whitespace-nowrap",e?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),children:"Alle"}),SN.map($=>{const B=Ov[$]||NN,K=B.icon;return c.jsxs("button",{onClick:()=>t($),className:fe("h-7 px-2.5 rounded-lg text-[10px] font-semibold uppercase tracking-wider transition-all cursor-pointer flex items-center gap-1 whitespace-nowrap",e===$?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),children:[c.jsx(K,{className:"h-3 w-3"}),c.jsx("span",{children:B.label})]},$)})]})]}),O&&c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400",children:["Fehler beim Laden des Gedächtnisses: ",O]}),c.jsx("div",{className:"space-y-3",children:S.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-2xl p-12 text-center",children:"Keine Einträge für die aktuellen Filterkriterien gefunden."}):S.map($=>{const B=Ov[$.category]||NN,K=B.icon;return c.jsxs("div",{className:fe("flex items-start justify-between gap-4 p-4 rounded-xl border border-l-4 bg-card/45 backdrop-blur-md border-border/60 shadow-md shadow-black/5 hover:border-primary/20 transition-all group",cY[$.category]||"border-l-muted"),children:[c.jsxs("div",{className:"flex items-start gap-3 flex-1 min-w-0",children:[c.jsxs("span",{className:fe("flex items-center gap-1 px-2 py-0.5 rounded text-[9px] font-bold uppercase tracking-wider font-mono shrink-0",B.bg,B.text),children:[c.jsx(K,{className:"h-3 w-3"}),c.jsx("span",{className:"hidden sm:inline",children:B.label})]}),c.jsx("span",{className:"text-xs text-foreground leading-relaxed break-words whitespace-pre-wrap flex-1",children:$.content})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[typeof $.score=="number"&&c.jsxs("span",{className:"text-[9px] font-mono text-primary bg-primary/10 px-1.5 py-0.5 rounded uppercase tracking-wider",title:"Relevanz der semantischen Suche",children:[Math.round($.score*100),"%"]}),c.jsxs("span",{className:fe("flex items-center gap-1 text-[9px] font-mono px-1.5 py-0.5 rounded uppercase tracking-wider",Av.has($.source)?"text-emerald-400 bg-emerald-500/10":"text-muted-foreground/60 bg-background/20"),title:Av.has($.source)?"Automatisch gelernt":"Manuell angelegt",children:[Av.has($.source)&&c.jsx(Y1,{className:"h-2.5 w-2.5"}),$.source]}),c.jsx("button",{onClick:()=>A($.id),className:"h-7 w-7 rounded-lg flex items-center justify-center border border-border/40 text-muted-foreground hover:text-red-400 hover:bg-red-500/5 transition-all opacity-0 group-hover:opacity-100",title:"Eintrag löschen",children:c.jsx(Qv,{className:"h-3.5 w-3.5"})})]})]},$.id)})})]}),j]})}function Gd({label:e,ok:t,detail:r,icon:n,onClick:a}){return c.jsxs("div",{onClick:a,className:fe("rounded-2xl border bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col justify-between gap-3 hover:border-primary/40 transition-all duration-300",t?"border-border/60":"border-amber-500/30",a&&"cursor-pointer hover:bg-card/70"),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-muted-foreground",children:e}),c.jsx(n,{className:fe("h-4.5 w-4.5",t?"text-primary":"text-amber-500")})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:fe("h-2 w-2 rounded-full ring-2 ring-black/40",t?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-semibold text-foreground",children:t?"Bereit / Online":"Offline / Inaktiv"})]}),r&&c.jsx("div",{className:"text-[10px] font-mono text-muted-foreground truncate max-w-[200px]",title:r,children:r})]}),a&&c.jsxs("button",{onClick:o=>{o.stopPropagation(),a()},className:"mt-2 flex items-center justify-center gap-1.5 w-full py-1.5 px-3 rounded-lg border border-primary/30 bg-primary/10 hover:bg-primary/20 text-primary text-[10px] font-bold uppercase tracking-wider transition-all cursor-pointer font-space",children:[c.jsx(_n,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Gehirn wechseln"})]})]})}function fY(){const{data:e,error:t}=fy(5e3),{data:r}=vo(),{showAlert:n,dialogElement:a}=el(),o=po(),u=t?String(t):"",l=y.useMemo(()=>["auto","fast","heavy",...((r==null?void 0:r.models)??[]).map(_=>{var A;return((A=_.name.split("/").pop())==null?void 0:A.replace(".gguf",""))||_.name})],[r]),[f,h]=y.useState(null),[p,v]=y.useState(!1),[x,b]=y.useState({width:800,height:360}),k=y.useRef(null),j=y.useCallback(C=>{if(k.current&&(k.current.disconnect(),k.current=null),C){const _=new ResizeObserver(A=>{if(!A||A.length===0)return;const I=A[0].contentRect;b({width:I.width,height:I.height})});_.observe(C),k.current=_}},[]),S=x.width,N=x.height,P=(C,_,A,I)=>{const $=(C+A)/2;return`M ${C} ${_} C ${$} ${_}, ${$} ${I}, ${A} ${I}`};async function O(C){try{await Me("/api/agent/brain",{method:"POST",body:JSON.stringify({model:C})}),n("Erfolgreich",`Hermes-Gehirn wurde auf '${C}' geändert. Der Gateway-Dienst wurde neu gestartet.`),o.invalidateQueries({queryKey:wt.agentStatus}),v(!1)}catch(_){n("Fehler",`Fehler beim Wechseln des Gehirns: ${_.message}`)}}return c.jsxs("div",{className:"space-y-6",children:[c.jsx("style",{children:` @keyframes flow-dash { to { stroke-dashoffset: -20; @@ -465,9 +475,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho stroke-dasharray: 4 6; animation: flow-dash 1s linear infinite; } - `}),c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Hermes Agenten-Cockpit"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",c.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(e==null?void 0:e.terminal_url)&&c.jsxs("a",{href:_s(e.terminal_url),target:"_blank",rel:"noopener",className:he("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",e.terminal_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[c.jsx(yu,{className:"h-4 w-4"}),c.jsx("span",{children:"Terminal öffnen"})]})]}),u&&c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",u,")."]}),e&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[c.jsx(Vd,{label:"Agent Gateway",ok:e.gateway_reachable,detail:"Port :8642 (REST API)",icon:Ps}),c.jsx(Vd,{label:"Terminal",ok:e.terminal_reachable,detail:"Web-Terminal (hermes chat)",icon:vu}),c.jsx(Vd,{label:"Aktives Gehirn",ok:e.gateway_reachable,detail:e.brain_model?`Model: ${e.brain_model}`:"Model: auto",icon:_n,onClick:()=>v(!0)}),c.jsx(Vd,{label:"Verdrahtung",ok:e.has_config,detail:`Config: ${e.has_config?"✓":"—"} · Skills: ${e.has_skills?"✓":"—"} · Memory: ${e.has_memories?"✓":"—"}`,icon:wu})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Agent Flow Graph"}),c.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert das Zusammenspiel und die Verbindungspfade zwischen den Hermes-Systemkomponenten."})]}),c.jsxs("div",{ref:k,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[c.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),c.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),c.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),c.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),c.jsx("path",{d:P(S*.15,N*.5,S*.5,N*.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="terminal"||e.terminal_reachable)&&c.jsx("path",{d:P(S*.15,N*.5,S*.5,N*.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="gateway"||f==="brain"||e.gateway_reachable)&&c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.3),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="gateway"||f==="wiring"||e.gateway_reachable)&&c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.7),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-36 h-9 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2.5 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"15%",top:"50%"},onMouseEnter:()=>h("terminal"),onMouseLeave:()=>h(null),onClick:()=>e.terminal_reachable&&window.open(_s(e.terminal_url),"_blank"),title:e.terminal_reachable?"Klicken um das Hermes-Terminal zu öffnen":"Terminal offline",children:[c.jsx(vu,{className:he("h-3.5 w-3.5",e.terminal_reachable?"text-emerald-400":"text-amber-500")}),c.jsx("span",{children:"Terminal"}),c.jsx("span",{className:he("w-1.5 h-1.5 rounded-full animate-pulse ml-auto",e.terminal_reachable?"bg-emerald-500":"bg-amber-500")})]}),c.jsxs("div",{className:"absolute select-none z-10 w-40 py-2.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5 cursor-pointer",style:{left:"50%",top:"50%"},onMouseEnter:()=>h("gateway"),onMouseLeave:()=>h(null),children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Ps,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Agent Gateway"})]}),c.jsx("div",{className:"text-[9px] font-mono text-muted-foreground mt-0.5",children:"Port :8642"}),c.jsx("div",{className:he("mt-1 px-1.5 py-0.5 rounded text-[8px] font-semibold uppercase font-mono border",e.gateway_reachable?"bg-emerald-500/10 border-emerald-500/20 text-emerald-400":"bg-red-500/10 border-red-500/20 text-red-400"),children:e.gateway_reachable?"Online":"Offline"})]}),c.jsxs("div",{className:he("absolute z-20 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",e.gateway_reachable?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"30%"},onMouseEnter:()=>h("brain"),onMouseLeave:()=>h(null),onClick:()=>v(!0),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[c.jsx(_n,{className:"h-3 w-3 text-primary"}),c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Aktives Gehirn"})]}),e.gateway_reachable&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground font-space",title:e.brain_model,children:e.brain_model||"auto"})]}),c.jsxs("div",{className:he("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none",e.has_config?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"70%"},onMouseEnter:()=>h("wiring"),onMouseLeave:()=>h(null),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[c.jsx(wu,{className:"h-3 w-3 text-primary"}),c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),e.has_config&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsxs("div",{className:"text-[9px] font-mono mt-0.5 text-muted-foreground flex gap-1 justify-between",children:[c.jsxs("span",{children:["Config: ",e.has_config?"✓":"—"]}),c.jsxs("span",{children:["Skills: ",e.has_skills?"✓":"—"]}),c.jsxs("span",{children:["Memory: ",e.has_memories?"✓":"—"]})]})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),c.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Agenten"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),c.jsx("span",{children:"Grüner Puls: Verbindung hergestellt / Modul online"})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(fI,{className:"h-5 w-5 text-primary"}),c.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:he("h-2 w-2 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{children:["Der ",c.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",c.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),c.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",c.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),c.jsx("div",{className:"space-y-3",children:e.pc_executor_reachable?c.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[c.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),c.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",c.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",c.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",c.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),c.jsxs("p",{children:["Starte ",c.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",c.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),c.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!e.gateway_reachable&&c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(bu,{className:"h-5 w-5 text-amber-500"}),c.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[c.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),c.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",c.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),c.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[c.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),c.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),c.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-terminal"})]}),c.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",c.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),e&&p&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[c.jsx(_n,{className:"h-4 w-4"}),c.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),c.jsx("button",{onClick:()=>v(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',c.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),c.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:l.map(C=>{const _=["auto","fast","heavy"].includes(C);return c.jsxs("button",{onClick:()=>O(C),className:he("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",e.brain_model===C||!e.brain_model&&C==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[c.jsxs("div",{className:"flex flex-col text-left",children:[c.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:C}),c.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:_?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(e.brain_model===C||!e.brain_model&&C==="auto")&&c.jsx(Cn,{className:"h-4 w-4 shrink-0 text-primary"})]},C)})})]})}),a]})}function iY(){const{data:e}=fy(5e3),t=e!=null&&e.terminal_url?_s(e.terminal_url):void 0,r=e==null?void 0:e.terminal_reachable;return c.jsxs("div",{className:"flex h-full flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Hermes Terminal"}),c.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Interaktiver Agent (",c.jsx("code",{className:"rounded bg-background/40 px-1 font-mono text-[11px] text-primary",children:"hermes chat"}),') mit Tools & PC-Steuerung — „mehr als Chatten".']})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[c.jsx("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500 animate-pulse":"bg-amber-500"}`}),r?"online":"offline"]}),t&&c.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[c.jsx(yu,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?c.jsxs("div",{className:"relative min-h-[68vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&c.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[c.jsx(Cs,{className:"h-8 w-8 text-amber-400"}),c.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Terminal nicht erreichbar"}),c.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",c.jsx("code",{className:"font-mono text-primary",children:"hermes-terminal"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",c.jsx("code",{className:"font-mono",children:"systemctl --user restart hermes-terminal"}),"."]})]}),c.jsx("iframe",{src:t,title:"Hermes Terminal",className:"h-full w-full border-0",style:{minHeight:"68vh"}})]}):c.jsxs("div",{className:"flex min-h-[68vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[c.jsx(t2,{className:"mr-2 h-4 w-4"})," Lade Terminal…"]})]})}function aY(){const[e,t]=y.useState("connect"),[r,n]=y.useState("roocode"),[a,o]=y.useState(null),u="192.168.178.151",[l,f]=y.useState(!1),[h,p]=y.useState(null);function v(){f(!0),De("/api/health").then(x=>{o(x),p(x.engine_reachable?"success":"partial")}).catch(()=>{o(null),p("fail")}).finally(()=>f(!1))}return y.useEffect(()=>{v()},[]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Stack-Anleitung & Vibe-Coding-Guide"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Einsteigerfreundliche Erklärungen zu deinem Stack und Schritt-für-Schritt-Anleitungen zur Anbindung deiner Editoren."})]}),c.jsxs("div",{className:"flex gap-4 border-b border-border/40 pb-px",children:[c.jsx("button",{onClick:()=>t("connect"),className:he("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",e==="connect"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Editor-Anbindung"}),c.jsx("button",{onClick:()=>t("concepts"),className:he("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",e==="concepts"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"KI-Wissensdatenbank (Juni 2026)"})]}),e==="connect"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:he("h-3 w-3 rounded-full ring-2 ring-black/40",h==="success"&&"bg-emerald-500 animate-pulse",h==="partial"&&"bg-amber-500",h==="fail"&&"bg-red-500",!h&&"bg-muted")}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),c.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[h==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(a==null?void 0:a.version)||""}).`,h==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",h==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!h&&"Verbindung wird geprüft..."]})]})]}),c.jsxs("button",{onClick:v,disabled:l,className:"h-8 px-3 flex items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50 cursor-pointer self-start sm:self-auto shrink-0",children:[c.jsx(uu,{className:he("h-3.5 w-3.5",l&&"animate-spin")}),c.jsx("span",{children:"Testen"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2 px-1",children:[c.jsx(YN,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(_n,{className:"h-4 w-4 text-cyan-400"}),c.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),c.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein Dashboard. Hier siehst du die CPU-/RAM- und GPU-Last der Box und siehst sofort, ob Updates anstehen."})]}),c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(xu,{className:"h-4 w-4 text-violet-400"}),c.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",c.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(gu,{className:"h-4 w-4 text-indigo-400"}),c.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),c.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein geteiltes Langzeitgedächtnis (Memory-Pool). Hier merkt sich dein Agent Regeln, Projekt-Details und Vorlieben."})]})]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 px-1",children:[c.jsx(Vv,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),c.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[c.jsxs("button",{onClick:()=>n("roocode"),className:he("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",r==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[c.jsx(r2,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),c.jsx("button",{onClick:()=>n("cursor"),className:he("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",r==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),c.jsx("button",{onClick:()=>n("opencode"),className:he("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",r==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[r==="roocode"&&c.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),c.jsx("p",{children:"Roo Code ist die beliebteste und flexibelste Vibe-Coding-Erweiterung für VS Code im Jahr 2026. Sie ermöglicht vollen Zugriff auf das Terminal und das MCP-Gedächtnis."})]}),c.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Roo Code installieren"]}),c.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",c.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"API-Anbindung konfigurieren"]}),c.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),c.jsx("div",{className:"pl-6 pt-1",children:c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",u,":9001/v1"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",c.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"MCP Gedächtnis verknüpfen (Optional, aber empfohlen)"]}),c.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",c.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",c.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),r==="cursor"&&c.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),c.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),c.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Einstellungen öffnen"]}),c.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",c.jsx("strong",{children:"Models"}),"."]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"OpenAI API überschreiben"]}),c.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",c.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),c.jsx("div",{className:"pl-6 pt-1",children:c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",u,":9001/v1"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",c.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Modell hinzufügen"]}),c.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",c.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),r==="opencode"&&c.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),c.jsx("p",{children:"OpenCode ist eine standalone Desktop-App für ein ablenkungsfreies Coden über natürliche Sprache. Es trennt den KI-Prozess von deinem Editor."})]}),c.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"OpenCode Desktop herunterladen"]}),c.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"Endpunkt auf Box-Gateway setzen"]}),c.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),c.jsx("div",{className:"pl-6 pt-1",children:c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",u,":9001/v1"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Erster Vibe-Coding Test"]}),c.jsx("p",{className:"pl-6",children:'Starte eine neue Session und teste die Verbindung mit einem einfachen Prompt, z. B. *"Erstelle ein einfaches Skript, das die Fibonaccizahlen berechnet"*. Das Box-Gateway tauscht das Modell im Hintergrund vollautomatisch aus.'})]})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 space-y-3 shadow-lg shadow-black/10",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nf,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),c.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Keine Verbindung?"})," Überprüfe im Live-Verbindungsprüfer oben, ob die Box-IP erreichbar ist. Stelle sicher, dass dein lokaler PC im selben WLAN/LAN-Netzwerk wie die Box eingeloggt ist."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue in der ",c.jsx("strong",{children:"Zentrale"})," unter ",c.jsx("strong",{children:"Dienste"}),", ob `llama-swap` aktiv (grün) ist. Wenn nicht, klicke daneben auf ",c.jsx("strong",{children:"Restart"}),"."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Hermes Agent reagiert merkwürdig?"})," Starte im ",c.jsx("strong",{children:"Terminal"})," eine frische Session (neuer `hermes chat`). Ältere Sessions sammeln Kontext-Müll an."]})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex items-start gap-4",children:[c.jsx(Gv,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Entwickler-Guide: Modernes Agentic Coding (2026)"}),c.jsx("p",{className:"text-xs text-muted-foreground leading-normal",children:"Willkommen im Wissenszentrum für dein Mission Control 2 Setup. Hier erfährst du, wie die verschiedenen Technologien (MoE, MCP, Skills, Hermes) zusammenarbeiten und wie du das Maximum aus deinen AI-Prozessabläufen herausholst."})]})]}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(xu,{className:"h-5 w-5 text-cyan-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"1. Mixture of Experts (MoE)"}),c.jsx("span",{className:"text-[9px] text-cyan-400 font-mono",children:"Effizienz durch Spezialisierung"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," Bei traditionellen LLMs wird für jedes Wort das gesamte neuronale Netz aktiviert. Bei MoE besteht das Modell aus mehreren spezialisierten Teilnetzwerken (den ",c.jsx("em",{children:"Experts"}),"). Ein intelligenter ",c.jsx("em",{children:"Router"})," entscheidet pro Token (Wortteil), welche Experten zur Berechnung herangezogen werden."]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Warum in MC2?"})," So können extrem leistungsstarke Modelle (wie DeepSeek-V3, Mixtral oder Command R+) mit wesentlich geringeren Hardwarekosten ausgeführt werden. Es wird nur ein Bruchteil der Parameter geladen und aktiv berechnet, was Speicherplatz spart und die Inferenz beschleunigt."]}),c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] text-foreground",children:[c.jsx("span",{className:"text-cyan-400",children:"Vorteil:"})," GPT-4-Klasse Performance bei einem Bruchteil der aktiven VRAM-Last auf deinem Homelab!"]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(Gv,{className:"h-5 w-5 text-violet-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"2. Model Context Protocol (MCP)"}),c.jsx("span",{className:"text-[9px] text-violet-400 font-mono",children:"Standardisierte Agenten-Tools"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," MCP ist ein offenes Protokoll (initiiert von Anthropic), das festlegt, wie ein KI-Client (z.B. Roo Code auf deinem PC) mit externen Datenquellen und Tools kommuniziert. Es funktioniert wie ein USB-Standard für KI."]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Warum in MC2?"})," MCP trennt den AI-Kern von der Umgebung. Statt für jeden Editor eigene Tools zu schreiben, binden deine Agenten (Roo Code, Hermes) einfach MCP-Server an. Diese Server können Dateien lesen, Websuchen durchführen, Git bedienen oder mit deiner App interagieren."]}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[c.jsx("div",{className:"font-bold text-foreground",children:"Gute Quellen für MCP Server:"}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-muted-foreground",children:[c.jsxs("li",{children:[c.jsx("a",{href:"https://smithery.ai/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Smithery Registry"})," — Ein Portal zum Suchen und automatischen Installieren von MCP Servern."]}),c.jsxs("li",{children:[c.jsx("a",{href:"https://glama.ai/mcp/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Glama MCP Registry"})," — Eine kuratierte, umfangreiche Community-Datenbank von MCP Servern."]}),c.jsxs("li",{children:[c.jsx("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Offizielles Anthropic Repo"})," — Das offizielle Repository mit Standards wie filesystem, postgres, sqlite, brave-search und puppeteer."]})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(gu,{className:"h-5 w-5 text-emerald-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"3. Agent Skills"}),c.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Modulbasierte Fähigkeiten"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," Ein Skill ist ein Verzeichnis mit standardisierten Anweisungen, Scripten und Beispielen, das deine Agenten für spezifische Aufgaben trainiert (z.B. Test-Driven Development, Code-Vereinfachung, API-Design)."]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Wie benutzt man sie?"})," Lege einen Skill-Ordner unter ",c.jsx("code",{children:".agents/skills/"})," in deinem Projekt an. Das Herzstück ist die Datei ",c.jsx("code",{children:"SKILL.md"})," mit folgendem Aufbau:"]}),c.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`--- + `}),c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Hermes Agenten-Cockpit"}),c.jsxs("p",{className:"text-sm text-muted-foreground",children:["Hermes ist ein autonomer Agent, der im Hintergrund der Box läuft (Port ",c.jsx("code",{children:":8642"}),") und seine eigene UI besitzt."]})]}),(e==null?void 0:e.terminal_url)&&c.jsxs("a",{href:_s(e.terminal_url),target:"_blank",rel:"noopener",className:fe("flex h-9 px-4 items-center gap-1.5 text-xs font-semibold rounded-lg transition-all cursor-pointer shadow-md shrink-0 self-start",e.terminal_reachable?"bg-primary text-primary-foreground hover:opacity-90 shadow-primary/10":"border border-border/60 text-muted-foreground bg-background/20"),children:[c.jsx(xu,{className:"h-4 w-4"}),c.jsx("span",{children:"Terminal öffnen"})]})]}),u&&c.jsxs("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-4 text-xs text-red-400 font-mono",children:["Status nicht lesbar (",u,")."]}),e&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[c.jsx(Gd,{label:"Agent Gateway",ok:e.gateway_reachable,detail:"Port :8642 (REST API)",icon:Ps}),c.jsx(Gd,{label:"Terminal",ok:e.terminal_reachable,detail:"Web-Terminal (hermes chat)",icon:gu}),c.jsx(Gd,{label:"Aktives Gehirn",ok:e.gateway_reachable,detail:e.brain_model?`Model: ${e.brain_model}`:"Model: auto",icon:_n,onClick:()=>v(!0)}),c.jsx(Gd,{label:"Verdrahtung",ok:e.has_config,detail:`Config: ${e.has_config?"✓":"—"} · Skills: ${e.has_skills?"✓":"—"} · Memory: ${e.has_memories?"✓":"—"}`,icon:ku})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Interactive Agent Flow Graph"}),c.jsx("p",{className:"text-[10px] text-muted-foreground mt-0.5 leading-relaxed",children:"Visualisiert das Zusammenspiel und die Verbindungspfade zwischen den Hermes-Systemkomponenten."})]}),c.jsxs("div",{ref:j,className:"relative w-full h-96 border border-border/30 rounded-xl bg-black/25 overflow-hidden flex",children:[c.jsxs("svg",{className:"absolute inset-0 pointer-events-none w-full h-full",children:[c.jsxs("defs",{children:[c.jsxs("linearGradient",{id:"cyan-to-teal",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#06b6d4",stopOpacity:"0.45"}),c.jsx("stop",{offset:"100%",stopColor:"#0d9488",stopOpacity:"0.45"})]}),c.jsxs("linearGradient",{id:"active-glow",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[c.jsx("stop",{offset:"0%",stopColor:"#3b82f6",stopOpacity:"0.8"}),c.jsx("stop",{offset:"100%",stopColor:"#10b981",stopOpacity:"0.8"})]})]}),c.jsx("path",{d:P(S*.15,N*.5,S*.5,N*.5),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="terminal"||e.terminal_reachable)&&c.jsx("path",{d:P(S*.15,N*.5,S*.5,N*.5),stroke:"#06b6d4",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.3),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="gateway"||f==="brain"||e.gateway_reachable)&&c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.3),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"}),c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.7),stroke:"url(#cyan-to-teal)",strokeWidth:"1.5",fill:"none"}),(f==="gateway"||f==="wiring"||e.gateway_reachable)&&c.jsx("path",{d:P(S*.5,N*.5,S*.85,N*.7),stroke:"url(#active-glow)",strokeWidth:"2.5",fill:"none",className:"svg-flow-path"})]}),c.jsxs("div",{className:"absolute cursor-pointer select-none z-10 w-36 h-9 -translate-y-1/2 -translate-x-1/2 rounded-xl border border-border/60 bg-card/75 backdrop-blur-md flex items-center justify-center gap-1.5 px-2.5 hover:border-primary transition-all text-[10px] font-semibold text-foreground shadow shadow-black/20",style:{left:"15%",top:"50%"},onMouseEnter:()=>h("terminal"),onMouseLeave:()=>h(null),onClick:()=>e.terminal_reachable&&window.open(_s(e.terminal_url),"_blank"),title:e.terminal_reachable?"Klicken um das Hermes-Terminal zu öffnen":"Terminal offline",children:[c.jsx(gu,{className:fe("h-3.5 w-3.5",e.terminal_reachable?"text-emerald-400":"text-amber-500")}),c.jsx("span",{children:"Terminal"}),c.jsx("span",{className:fe("w-1.5 h-1.5 rounded-full animate-pulse ml-auto",e.terminal_reachable?"bg-emerald-500":"bg-amber-500")})]}),c.jsxs("div",{className:"absolute select-none z-10 w-40 py-2.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-2xl border border-primary/50 bg-card/90 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-lg shadow-primary/5 cursor-pointer",style:{left:"50%",top:"50%"},onMouseEnter:()=>h("gateway"),onMouseLeave:()=>h(null),children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(Ps,{className:"h-3.5 w-3.5 text-primary"}),c.jsx("span",{className:"text-[10px] uppercase font-bold text-primary font-space tracking-wide",children:"Agent Gateway"})]}),c.jsx("div",{className:"text-[9px] font-mono text-muted-foreground mt-0.5",children:"Port :8642"}),c.jsx("div",{className:fe("mt-1 px-1.5 py-0.5 rounded text-[8px] font-semibold uppercase font-mono border",e.gateway_reachable?"bg-emerald-500/10 border-emerald-500/20 text-emerald-400":"bg-red-500/10 border-red-500/20 text-red-400"),children:e.gateway_reachable?"Online":"Offline"})]}),c.jsxs("div",{className:fe("absolute z-20 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none cursor-pointer",e.gateway_reachable?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"30%"},onMouseEnter:()=>h("brain"),onMouseLeave:()=>h(null),onClick:()=>v(!0),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[c.jsx(_n,{className:"h-3 w-3 text-primary"}),c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Aktives Gehirn"})]}),e.gateway_reachable&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsx("div",{className:"text-[10px] font-mono font-medium truncate mt-0.5 text-foreground font-space",title:e.brain_model,children:e.brain_model||"auto"})]}),c.jsxs("div",{className:fe("absolute z-10 w-44 py-1.5 px-3 -translate-y-1/2 -translate-x-1/2 rounded-xl border flex flex-col justify-center hover:border-primary/50 transition-all text-left shadow select-none",e.has_config?"border-emerald-500/50 bg-emerald-500/5 shadow-emerald-500/5":"border-border/60 bg-card/75"),style:{left:"85%",top:"70%"},onMouseEnter:()=>h("wiring"),onMouseLeave:()=>h(null),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-1 text-muted-foreground",children:[c.jsx(ku,{className:"h-3 w-3 text-primary"}),c.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider",children:"Verdrahtung"})]}),e.has_config&&c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"})]}),c.jsxs("div",{className:"text-[9px] font-mono mt-0.5 text-muted-foreground flex gap-1 justify-between",children:[c.jsxs("span",{children:["Config: ",e.has_config?"✓":"—"]}),c.jsxs("span",{children:["Skills: ",e.has_skills?"✓":"—"]}),c.jsxs("span",{children:["Memory: ",e.has_memories?"✓":"—"]})]})]})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-6 mt-3 text-[10px] text-muted-foreground border-t border-border/20 pt-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-cyan-400"}),c.jsx("span",{children:"Cyan-Fluss: Client-Anfrage an Agenten"})]}),c.jsxs("span",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-emerald-500 animate-pulse"}),c.jsx("span",{children:"Grüner Puls: Verbindung hergestellt / Modul online"})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(pI,{className:"h-5 w-5 text-primary"}),c.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"PC Verbindung"})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:fe("h-2 w-2 rounded-full",e.pc_executor_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500")}),c.jsx("span",{className:"text-xs font-semibold text-foreground",children:e.pc_executor_reachable?"Erreichbar":"Nicht verbunden"})]})]}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-2 text-xs text-muted-foreground leading-relaxed text-left",children:[c.jsxs("div",{className:"space-y-3",children:[c.jsxs("p",{children:["Der ",c.jsx("strong",{className:"text-foreground",children:"Hermes PC Executor"})," läuft auf ",c.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"192.168.178.98:7777"})," und ermöglicht Hermes den direkten Zugriff auf deinen Windows-PC — Shell-Befehle, Screenshots, Tastatureingaben."]}),c.jsxs("p",{children:["Hermes erreicht den PC über den MCP-Server ",c.jsx("code",{className:"text-foreground font-mono px-1 py-0.5 rounded bg-muted/40 border border-border/30",children:"hermes-pc-control"}),", der automatisch beim Gateway-Start verbunden wird."]})]}),c.jsx("div",{className:"space-y-3",children:e.pc_executor_reachable?c.jsxs("div",{className:"p-3.5 bg-emerald-500/5 border border-emerald-500/20 rounded-xl space-y-1",children:[c.jsxs("div",{className:"text-emerald-400 font-semibold text-xs flex items-center gap-1.5",children:[c.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 animate-pulse"}),"PC Executor verbunden"]}),c.jsxs("p",{className:"text-[10px]",children:["Hermes kann jetzt per Telegram oder Terminal Befehle auf TobisNicerPC ausführen. Nutze ",c.jsx("code",{className:"text-foreground",children:"pc_shell"}),", ",c.jsx("code",{className:"text-foreground",children:"pc_screenshot"})," oder ",c.jsx("code",{className:"text-foreground",children:"pc_open"}),"."]})]}):c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"text-xs font-bold text-foreground",children:"PC Executor starten"}),c.jsxs("p",{children:["Starte ",c.jsx("code",{className:"text-foreground font-mono",children:"start.bat"})," im Ordner ",c.jsx("code",{className:"text-foreground font-mono",children:"client\\hermes-pc\\"})," auf dem Windows-PC und lasse das Fenster offen."]}),c.jsx("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[9px] text-cyan-300",children:"client\\hermes-pc\\start.bat"})]})})]})]}),!e.gateway_reachable&&c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10 text-left",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(wu,{className:"h-5 w-5 text-amber-500"}),c.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-foreground",children:"Hermes-Agent Diagnostics"})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-relaxed",children:[c.jsx("p",{children:"Der Hermes-Dienst ist auf der Box derzeit offline oder kann sich nicht mit dem lokalen llama-swap verbinden."}),c.jsxs("p",{children:["Stelle sicher, dass die systemd-Dienste auf der Box laufen. Du kannst den Status im ",c.jsx("strong",{children:"OS & Updates Drawer"})," prüfen und die Dienste bei Bedarf neu starten."]}),c.jsxs("div",{className:"p-3.5 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1",children:[c.jsx("div",{className:"text-muted-foreground/60",children:"# Dienste manuell auf der Box prüfen:"}),c.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-gateway"}),c.jsx("div",{className:"text-primary",children:"systemctl --user status hermes-terminal"})]}),c.jsxs("p",{children:["Weitere Einrichtungsdetails (Brain-Konfiguration, MCP-Kopplungen, SSH-Tunneling und Such-Engines) findest du in der Dokumentationsdatei:",c.jsx("code",{className:"ml-1 px-1.5 py-0.5 rounded bg-muted/40 text-foreground border border-border/30",children:"docs/HERMES_SETUP.md"}),"."]})]})]})]}),e&&p&&c.jsx("div",{className:"fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-border/80 bg-card p-6 shadow-2xl space-y-4 animate-in fade-in zoom-in-95 duration-200",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-border/20 pb-2",children:[c.jsxs("h3",{className:"text-xs font-bold uppercase tracking-wider text-primary flex items-center gap-1.5",children:[c.jsx(_n,{className:"h-4 w-4"}),c.jsx("span",{children:"Hermes-Gehirn konfigurieren"})]}),c.jsx("button",{onClick:()=>v(!1),className:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground cursor-pointer",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("p",{className:"text-xs text-muted-foreground leading-relaxed",children:['Das „Gehirn" ist das primäre LLM für Hermes. Wähle ein Modell aus deiner Bibliothek oder nutze ein Gateway-Alias (',c.jsx("code",{className:"text-primary font-semibold",children:"auto"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"fast"})," / ",c.jsx("code",{className:"text-primary font-semibold",children:"heavy"}),"):"]}),c.jsx("div",{className:"space-y-1.5 max-h-60 overflow-y-auto pr-1",children:l.map(C=>{const _=["auto","fast","heavy"].includes(C);return c.jsxs("button",{onClick:()=>O(C),className:fe("w-full text-left px-3 py-2.5 rounded-lg text-xs hover:bg-accent flex items-center justify-between font-mono cursor-pointer border border-border/30",e.brain_model===C||!e.brain_model&&C==="auto"?"text-primary font-bold bg-primary/10 border-primary/30":"text-foreground bg-background/20"),children:[c.jsxs("div",{className:"flex flex-col text-left",children:[c.jsx("span",{className:"font-semibold truncate max-w-[280px]",children:C}),c.jsx("span",{className:"text-[9px] text-muted-foreground mt-0.5",children:_?"Gateway Routing Alias":"Installiertes GGUF Modell"})]}),(e.brain_model===C||!e.brain_model&&C==="auto")&&c.jsx(Cn,{className:"h-4 w-4 shrink-0 text-primary"})]},C)})})]})}),a]})}function hY(){const{data:e}=fy(5e3),t=e!=null&&e.terminal_url?_s(e.terminal_url):void 0,r=e==null?void 0:e.terminal_reachable;return c.jsxs("div",{className:"flex h-full flex-col gap-4",children:[c.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text font-space text-2xl font-bold tracking-tight text-transparent",children:"Hermes Terminal"}),c.jsxs("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:["Interaktiver Agent (",c.jsx("code",{className:"rounded bg-background/40 px-1 font-mono text-[11px] text-primary",children:"hermes chat"}),') mit Tools & PC-Steuerung — „mehr als Chatten".']})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("span",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground",children:[c.jsx("span",{className:`h-2 w-2 rounded-full ${r?"bg-emerald-500 animate-pulse":"bg-amber-500"}`}),r?"online":"offline"]}),t&&c.jsxs("a",{href:t,target:"_blank",rel:"noopener",className:"flex h-8 items-center gap-1.5 rounded-lg border border-border/60 bg-background/20 px-3 text-xs font-semibold text-muted-foreground transition-all hover:border-primary/50 hover:text-foreground",children:[c.jsx(xu,{className:"h-3.5 w-3.5"})," In neuem Tab"]})]})]}),t?c.jsxs("div",{className:"relative min-h-[68vh] flex-1 overflow-hidden rounded-2xl border border-border/60 bg-black/50 shadow-lg shadow-black/25",children:[r===!1&&c.jsxs("div",{className:"absolute inset-0 z-10 flex flex-col items-center justify-center gap-3 bg-black/70 text-center",children:[c.jsx(Cs,{className:"h-8 w-8 text-amber-400"}),c.jsx("div",{className:"text-sm font-semibold text-amber-300",children:"Terminal nicht erreichbar"}),c.jsxs("p",{className:"max-w-sm text-[11px] leading-normal text-muted-foreground",children:["Der ",c.jsx("code",{className:"font-mono text-primary",children:"hermes-terminal"}),"-Dienst (ttyd) läuft nicht. Auf der Box: ",c.jsx("code",{className:"font-mono",children:"systemctl --user restart hermes-terminal"}),"."]})]}),c.jsx("iframe",{src:t,title:"Hermes Terminal",className:"h-full w-full border-0",style:{minHeight:"68vh"}})]}):c.jsxs("div",{className:"flex min-h-[68vh] flex-1 items-center justify-center rounded-2xl border border-border/60 bg-background/20 text-xs text-muted-foreground",children:[c.jsx(r2,{className:"mr-2 h-4 w-4"})," Lade Terminal…"]})]})}function pY(){const[e,t]=y.useState("connect"),[r,n]=y.useState("roocode"),[a,o]=y.useState(null),u="192.168.178.151",[l,f]=y.useState(!1),[h,p]=y.useState(null);function v(){f(!0),Me("/api/health").then(x=>{o(x),p(x.engine_reachable?"success":"partial")}).catch(()=>{o(null),p("fail")}).finally(()=>f(!1))}return y.useEffect(()=>{v()},[]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-space font-bold tracking-tight bg-gradient-to-r from-foreground via-foreground to-primary bg-clip-text text-transparent",children:"Stack-Anleitung & Vibe-Coding-Guide"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Einsteigerfreundliche Erklärungen zu deinem Stack und Schritt-für-Schritt-Anleitungen zur Anbindung deiner Editoren."})]}),c.jsxs("div",{className:"flex gap-4 border-b border-border/40 pb-px",children:[c.jsx("button",{onClick:()=>t("connect"),className:fe("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",e==="connect"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Editor-Anbindung"}),c.jsx("button",{onClick:()=>t("concepts"),className:fe("pb-3 text-xs font-bold uppercase tracking-wider border-b-2 px-1 transition-all",e==="concepts"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"KI-Wissensdatenbank (Juni 2026)"})]}),e==="connect"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex flex-col sm:flex-row justify-between sm:items-center gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:fe("h-3 w-3 rounded-full ring-2 ring-black/40",h==="success"&&"bg-emerald-500 animate-pulse",h==="partial"&&"bg-amber-500",h==="fail"&&"bg-red-500",!h&&"bg-muted")}),c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Lokaler Verbindungs-Check"}),c.jsxs("div",{className:"text-[10px] text-muted-foreground mt-0.5 font-mono",children:[h==="success"&&`Erfolgreich! Dein PC hat Zugriff auf das Box-Gateway (v${(a==null?void 0:a.version)||""}).`,h==="partial"&&"Gateway erreichbar, aber die llama-cpp-Engine ist offline.",h==="fail"&&"Verbindung fehlgeschlagen. Ist die Box im selben LAN-Netzwerk?",!h&&"Verbindung wird geprüft..."]})]})]}),c.jsxs("button",{onClick:v,disabled:l,className:"h-8 px-3 flex items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50 cursor-pointer self-start sm:self-auto shrink-0",children:[c.jsx(cu,{className:fe("h-3.5 w-3.5",l&&"animate-spin")}),c.jsx("span",{children:"Testen"})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center gap-2 px-1",children:[c.jsx(XN,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie funktioniert mein Stack?"})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(_n,{className:"h-4 w-4 text-cyan-400"}),c.jsx("h3",{className:"text-xs font-bold text-foreground",children:"1. Die Zentrale"})]}),c.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein Dashboard. Hier siehst du die CPU-/RAM- und GPU-Last der Box und siehst sofort, ob Updates anstehen."})]}),c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(bu,{className:"h-4 w-4 text-violet-400"}),c.jsx("h3",{className:"text-xs font-bold text-foreground",children:"2. Modell-Zentrale"})]}),c.jsxs("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:["Deine GGUF-Datenbank. Gesteuert von ",c.jsx("strong",{children:"llama-swap"}),". Lädt dein schnelles Alltags-Hirn (`fast`) oder dein schweres Logik-Hirn (`heavy`) vollautomatisch im VRAM."]})]}),c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-card/20 space-y-2",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx(yu,{className:"h-4 w-4 text-indigo-400"}),c.jsx("h3",{className:"text-xs font-bold text-foreground",children:"3. Das Gedächtnis"})]}),c.jsx("p",{className:"text-[11px] text-muted-foreground leading-relaxed",children:"Dein geteiltes Langzeitgedächtnis (Memory-Pool). Hier merkt sich dein Agent Regeln, Projekt-Details und Vorlieben."})]})]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 px-1",children:[c.jsx(Gv,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Vibe Coding auf dem PC einrichten"})]}),c.jsxs("div",{className:"flex gap-1.5 bg-card/20 p-1 border border-border/40 rounded-xl max-w-fit",children:[c.jsxs("button",{onClick:()=>n("roocode"),className:fe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer flex items-center gap-1.5",r==="roocode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:[c.jsx(n2,{className:"h-3.5 w-3.5 fill-amber-400/20"}),"Roo Code (VS Code)"]}),c.jsx("button",{onClick:()=>n("cursor"),className:fe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",r==="cursor"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"Cursor IDE"}),c.jsx("button",{onClick:()=>n("opencode"),className:fe("rounded-lg px-4 py-1.5 text-xs font-semibold tracking-wide uppercase transition-all cursor-pointer",r==="opencode"?"bg-primary text-primary-foreground shadow-md shadow-primary/10":"text-muted-foreground hover:text-foreground"),children:"OpenCode Desktop"})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-6 space-y-4 shadow-lg shadow-black/10",children:[r==="roocode"&&c.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Roo Code Kopplung (Empfohlene Open-Source-Erweiterung)"}),c.jsx("p",{children:"Roo Code ist die beliebteste und flexibelste Vibe-Coding-Erweiterung für VS Code im Jahr 2026. Sie ermöglicht vollen Zugriff auf das Terminal und das MCP-Gedächtnis."})]}),c.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Roo Code installieren"]}),c.jsxs("p",{className:"pl-6",children:["Suche in VS Code nach der Erweiterung ",c.jsx("strong",{children:"Roo Code"})," und installiere sie."]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"API-Anbindung konfigurieren"]}),c.jsx("p",{className:"pl-6",children:"Klicke auf das Roo-Code-Symbol in der Sidebar, öffne die Einstellungen (Zahnrad) und stelle folgendes ein:"}),c.jsx("div",{className:"pl-6 pt-1",children:c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"API Provider:"})," OpenAI Compatible"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",u,":9001/v1"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",c.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Model ID:"})," auto"]})]})})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"MCP Gedächtnis verknüpfen (Optional, aber empfohlen)"]}),c.jsxs("p",{className:"pl-6",children:["Damit Roo Code auf deinen ",c.jsx("strong",{children:"Gedächtnis-Pool"})," zugreifen kann, kopiere die MCP-Konfiguration aus dem Reiter ",c.jsx("strong",{children:"Verbinden"})," und füge sie in deine lokale Roo-Code-Konfigurationsdatei ein."]})]})]})]}),r==="cursor"&&c.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-bold text-foreground",children:"Cursor IDE Kopplung (Proprietäre All-in-One IDE)"}),c.jsx("p",{children:"Cursor ist ein polierter, extrem schneller VS-Code-Fork mit hervorragenden, tief integrierten Autovervollständigungen (Tab-Completions)."})]}),c.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"Einstellungen öffnen"]}),c.jsxs("p",{className:"pl-6",children:["Öffne Cursor, klicke oben rechts auf das Zahnrad (Settings) und navigiere zu ",c.jsx("strong",{children:"Models"}),"."]})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"OpenAI API überschreiben"]}),c.jsxs("p",{className:"pl-6",children:["Deaktiviere die Standard-Cloudmodelle, klappe den Bereich ",c.jsx("strong",{children:"OpenAI API"})," auf und konfiguriere:"]}),c.jsx("div",{className:"pl-6 pt-1",children:c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Override Base URL:"})," http://",u,":9001/v1"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"API Key:"})," ",c.jsx("span",{className:"italic text-muted-foreground/50",children:'beliebig (z.B. "local")'})]})]})})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Modell hinzufügen"]}),c.jsxs("p",{className:"pl-6",children:["Trage in der Modell-Liste ein neues Modell mit dem Namen ",c.jsx("strong",{children:"auto"})," ein und wähle es als aktives Modell aus. Cursor leitet ab jetzt alle deine Anfragen an die Box weiter."]})]})]})]}),r==="opencode"&&c.jsxs("div",{className:"space-y-4 text-xs leading-relaxed text-muted-foreground",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-sm font-bold text-foreground",children:"OpenCode Desktop Kopplung (Open-Source Vibe-Coding-App)"}),c.jsx("p",{children:"OpenCode ist eine standalone Desktop-App für ein ablenkungsfreies Coden über natürliche Sprache. Es trennt den KI-Prozess von deinem Editor."})]}),c.jsxs("div",{className:"space-y-3.5 border-t border-border/20 pt-4",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"1"}),"OpenCode Desktop herunterladen"]}),c.jsx("p",{className:"pl-6",children:"Lade die Desktop-Anwendung von der offiziellen Website (opencode.ai) herunter und starte sie."})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"2"}),"Endpunkt auf Box-Gateway setzen"]}),c.jsx("p",{className:"pl-6",children:"Gehe in den Bereich Einstellungen ➔ Provider, deaktiviere die Cloud-Voreinstellungen und trage deinen lokalen Server ein:"}),c.jsx("div",{className:"pl-6 pt-1",children:c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] space-y-1 text-foreground",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Base URL:"})," http://",u,":9001/v1"]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground/60",children:"Model:"})," auto"]})]})})]}),c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"font-semibold text-foreground flex items-center gap-1.5",children:[c.jsx("span",{className:"h-4.5 w-4.5 rounded-full bg-primary/20 text-primary flex items-center justify-center font-mono text-[10px]",children:"3"}),"Erster Vibe-Coding Test"]}),c.jsx("p",{className:"pl-6",children:'Starte eine neue Session und teste die Verbindung mit einem einfachen Prompt, z. B. *"Erstelle ein einfaches Skript, das die Fibonaccizahlen berechnet"*. Das Box-Gateway tauscht das Modell im Hintergrund vollautomatisch aus.'})]})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 space-y-3 shadow-lg shadow-black/10",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(nf,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Was tun, wenn das Coden hakt?"})]}),c.jsxs("ul",{className:"text-[11px] text-muted-foreground space-y-2 list-disc pl-4 leading-relaxed",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Keine Verbindung?"})," Überprüfe im Live-Verbindungsprüfer oben, ob die Box-IP erreichbar ist. Stelle sicher, dass dein lokaler PC im selben WLAN/LAN-Netzwerk wie die Box eingeloggt ist."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Modell antwortet nicht?"})," Schaue in der ",c.jsx("strong",{children:"Zentrale"})," unter ",c.jsx("strong",{children:"Dienste"}),", ob `llama-swap` aktiv (grün) ist. Wenn nicht, klicke daneben auf ",c.jsx("strong",{children:"Restart"}),"."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Hermes Agent reagiert merkwürdig?"})," Starte im ",c.jsx("strong",{children:"Terminal"})," eine frische Session (neuer `hermes chat`). Ältere Sessions sammeln Kontext-Müll an."]})]})]})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 backdrop-blur-md p-5 shadow-lg shadow-black/10 flex items-start gap-4",children:[c.jsx(Vv,{className:"h-8 w-8 text-primary shrink-0 mt-0.5"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Entwickler-Guide: Modernes Agentic Coding (2026)"}),c.jsx("p",{className:"text-xs text-muted-foreground leading-normal",children:"Willkommen im Wissenszentrum für dein Mission Control 2 Setup. Hier erfährst du, wie die verschiedenen Technologien (MoE, MCP, Skills, Hermes) zusammenarbeiten und wie du das Maximum aus deinen AI-Prozessabläufen herausholst."})]})]}),c.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(bu,{className:"h-5 w-5 text-cyan-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"1. Mixture of Experts (MoE)"}),c.jsx("span",{className:"text-[9px] text-cyan-400 font-mono",children:"Effizienz durch Spezialisierung"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," Bei traditionellen LLMs wird für jedes Wort das gesamte neuronale Netz aktiviert. Bei MoE besteht das Modell aus mehreren spezialisierten Teilnetzwerken (den ",c.jsx("em",{children:"Experts"}),"). Ein intelligenter ",c.jsx("em",{children:"Router"})," entscheidet pro Token (Wortteil), welche Experten zur Berechnung herangezogen werden."]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Warum in MC2?"})," So können extrem leistungsstarke Modelle (wie DeepSeek-V3, Mixtral oder Command R+) mit wesentlich geringeren Hardwarekosten ausgeführt werden. Es wird nur ein Bruchteil der Parameter geladen und aktiv berechnet, was Speicherplatz spart und die Inferenz beschleunigt."]}),c.jsxs("div",{className:"p-3 bg-background/25 rounded-xl border border-border/30 font-mono text-[10px] text-foreground",children:[c.jsx("span",{className:"text-cyan-400",children:"Vorteil:"})," GPT-4-Klasse Performance bei einem Bruchteil der aktiven VRAM-Last auf deinem Homelab!"]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(Vv,{className:"h-5 w-5 text-violet-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"2. Model Context Protocol (MCP)"}),c.jsx("span",{className:"text-[9px] text-violet-400 font-mono",children:"Standardisierte Agenten-Tools"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," MCP ist ein offenes Protokoll (initiiert von Anthropic), das festlegt, wie ein KI-Client (z.B. Roo Code auf deinem PC) mit externen Datenquellen und Tools kommuniziert. Es funktioniert wie ein USB-Standard für KI."]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Warum in MC2?"})," MCP trennt den AI-Kern von der Umgebung. Statt für jeden Editor eigene Tools zu schreiben, binden deine Agenten (Roo Code, Hermes) einfach MCP-Server an. Diese Server können Dateien lesen, Websuchen durchführen, Git bedienen oder mit deiner App interagieren."]}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[c.jsx("div",{className:"font-bold text-foreground",children:"Gute Quellen für MCP Server:"}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-muted-foreground",children:[c.jsxs("li",{children:[c.jsx("a",{href:"https://smithery.ai/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Smithery Registry"})," — Ein Portal zum Suchen und automatischen Installieren von MCP Servern."]}),c.jsxs("li",{children:[c.jsx("a",{href:"https://glama.ai/mcp/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Glama MCP Registry"})," — Eine kuratierte, umfangreiche Community-Datenbank von MCP Servern."]}),c.jsxs("li",{children:[c.jsx("a",{href:"https://github.com/modelcontextprotocol/servers",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"Offizielles Anthropic Repo"})," — Das offizielle Repository mit Standards wie filesystem, postgres, sqlite, brave-search und puppeteer."]})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(yu,{className:"h-5 w-5 text-emerald-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"3. Agent Skills"}),c.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Modulbasierte Fähigkeiten"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," Ein Skill ist ein Verzeichnis mit standardisierten Anweisungen, Scripten und Beispielen, das deine Agenten für spezifische Aufgaben trainiert (z.B. Test-Driven Development, Code-Vereinfachung, API-Design)."]}),c.jsxs("p",{children:[c.jsx("strong",{children:"Wie benutzt man sie?"})," Lege einen Skill-Ordner unter ",c.jsx("code",{children:".agents/skills/"})," in deinem Projekt an. Das Herzstück ist die Datei ",c.jsx("code",{children:"SKILL.md"})," mit folgendem Aufbau:"]}),c.jsx("pre",{className:"p-2.5 bg-background/25 rounded-lg border border-border/30 font-mono text-[9px] text-foreground overflow-x-auto whitespace-pre",children:`--- name: tdd-pro description: Drive development with strict TDD practices --- # Instructions -...`}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[c.jsx("div",{className:"font-bold text-foreground",children:"Wo gibt es Skills & wo liegen sie?"}),c.jsxs("ul",{className:"list-disc pl-4 space-y-2.5 text-muted-foreground",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"skills.sh Registry & CLI:"})," Das offizielle offene Portal für Agent-Skills (",c.jsx("a",{href:"https://skills.sh/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"skills.sh"}),"). Du kannst Skills direkt über das Terminal suchen und in deinem Projekt installieren:",c.jsxs("div",{className:"mt-1 font-mono text-[9px] bg-background/40 p-2 rounded border border-border/30 text-cyan-300",children:["# Nach Skills suchen:",c.jsx("br",{}),c.jsx("span",{className:"text-foreground",children:"npx skills find"}),c.jsx("br",{}),"# Skill zum aktuellen Projekt hinzufügen:",c.jsx("br",{}),c.jsx("span",{className:"text-foreground",children:"npx skills add [owner/repo]"})]})]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Globaler Pfad:"})," ",c.jsx("code",{className:"text-foreground select-all",children:"C:\\Users\\TobisPC\\.gemini\\config\\plugins\\agent-skills\\skills\\"}),". Hier sind deine vorinstallierten, global verfügbaren Skills (wie ",c.jsx("i",{children:"code-simplification"}),", ",c.jsx("i",{children:"api-and-interface-design"}),", etc.) abgelegt."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Projekt-Pfad:"})," ",c.jsx("code",{className:"text-foreground select-all",children:".agents/skills/"}),". Lege diesen Ordner im Root eines beliebigen Projekts an. Dein lokaler Editor-Agent (z.B. Roo Code) liest ihn beim Starten automatisch ein."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Vorlagen / Beispiele:"})," Kopiere einfach bestehende Skills aus dem globalen Verzeichnis oder erstelle deine eigenen, indem du eine ",c.jsx("code",{children:"SKILL.md"})," mit YAML-Header (name, description) anlegst."]})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(_n,{className:"h-5 w-5 text-indigo-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"4. Arbeiten mit Hermes"}),c.jsx("span",{className:"text-[9px] text-indigo-400 font-mono",children:"Autonomer Box-Agent"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," Hermes ist der auf der Box installierte, autonome Hintergrund-Agent. Er verwaltet das Dateisystem und kann über REST (Port 8642) oder eine interaktive ChatUI (Port 8787) gesteuert werden."]}),c.jsx("p",{children:c.jsx("strong",{children:"Best Practices für Hermes:"})}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Chat-Kontext sauber halten:"})," Starte regelmäßig neue Chats. Zu große Historien verlangsamen den Agenten und führen zu Halluzinationen."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Gehirn festlegen:"})," Konfiguriere im Gateway die Modell-Rolle ",c.jsx("code",{children:"brain"})," für Hermes, damit er automatisch das passende Modell per Llama Swap lädt."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Sandbox umgehen:"})," Erweitere Hermes' System-Prompt (`~/.hermes/SOUL.md` / Config), um Befehle über SSH an deinen Windows-PC zu leiten."]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(wu,{className:"h-5 w-5 text-amber-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"5. Richtiges Arbeiten mit Tools (Dateien, Terminal, DevTools)"}),c.jsx("span",{className:"text-[9px] text-amber-400 font-mono",children:"Fehler vermeiden & Kosten senken"})]})]}),c.jsxs("div",{className:"grid md:grid-cols-3 gap-4 text-xs text-muted-foreground leading-normal",children:[c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[c.jsx(nf,{className:"h-3.5 w-3.5 text-primary"})," Terminal"]}),c.jsxs("p",{className:"text-[11px]",children:["Verwende nur non-interaktive Befehle. Hänge bei langen Tasks (wie dev-Servern) ein ",c.jsx("code",{children:"&"})," an oder nutze die integrierte Job-Verwaltung. Verwende niemals interaktive Eingabeaufforderungen."]})]}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[c.jsx(Vv,{className:"h-3.5 w-3.5 text-cyan-400"})," Dateimanager"]}),c.jsxs("p",{className:"text-[11px]",children:["Überschreibe keine ganzen Dateien, wenn du nur eine Zeile ändern willst. Verwende gezielte Ersetzungs-Tools (wie ",c.jsx("code",{children:"replace_file_content"}),"). Das spart massiv Token-Kosten und beugt Fehlern vor."]})]}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[c.jsx(wu,{className:"h-3.5 w-3.5 text-violet-400"})," Browser DevTools"]}),c.jsx("p",{className:"text-[11px]",children:"Koppele deine Debug-Dienste mit dem Chrome-DevTools-Plugin. So kann der Agent Fehler in der Konsole live analysieren und das DOM verifizieren, anstatt blind zu raten."})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(bu,{className:"h-5 w-5 text-emerald-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie autonom ist Mission Control 2 wirklich?"}),c.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Die Grenze zwischen Automatisierung und Kontrolle"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-normal",children:[c.jsxs("p",{children:["Mission Control 2 ist als ",c.jsx("strong",{children:"semi-autonomes Gateway"})," konzipiert. Es besitzt die Fähigkeit, komplexe Workflows komplett selbstständig durchzuführen, unterliegt jedoch strikten Sicherheitsplanken:"]}),c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 pt-1",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[c.jsx(q1,{className:"h-3 w-3 text-emerald-400"})," Was läuft vollautomatisch?"]}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[c.jsx("li",{children:"Modellaustausch (Routing) per llama-swap je nach Anfragetyp (z.B. Code vs. Reasoning)."}),c.jsx("li",{children:"Hintergrund-Synchronisation und Speicherung von Gedächtniseinträgen (Memory)."}),c.jsx("li",{children:"Modell-Installation und API-Key-Injektionen in Gateway-Verbindungen."})]})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[c.jsx(q1,{className:"h-3 w-3 text-amber-400"})," Wo ist menschliche Freigabe nötig?"]}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Systembefehle:"})," Das Ausführen von Terminal-Kommandos auf deinem PC erfordert standardmäßig deine Bestätigung."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Kritische Systemeingriffe:"})," OS-Updates, Engine-Rebuilds und Host-Reboots müssen manuell über das Dashboard ausgelöst werden."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Gedächtnis-Löschung:"})," Permanentes Verwerfen von gesammelten Memorys wird von dir freigegeben."]})]})]})]}),c.jsxs("p",{className:"text-[11px] bg-background/25 p-3 rounded-xl border border-border/30 mt-2",children:[c.jsx("strong",{children:"Fazit:"})," Der Stack erledigt die Kärrnerarbeit (Modelle tauschen, API-Adapter bereitstellen, Sandbox-Verbindungen herstellen) komplett im Hintergrund. Er agiert als dein persönlicher, treuer Copilot, ohne jemals ungefragt schädliche Operationen auf deinem Hauptsystem auszuführen."]})]})]})]})]})]})}function oY({title:e,hint:t}){return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-xl font-semibold",children:e}),c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),c.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[c.jsx(oI,{className:"h-8 w-8 text-muted-foreground"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const sY=[{id:"llama-swap",label:"Llama Swap",type:"system"},{id:"mission-control-2",label:"Mission Control 2",type:"user"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user"},{id:"hermes-terminal",label:"Hermes Terminal",type:"user"}];function _v(e){return e==null?"":e>1024**3?`${(e/1024**3).toFixed(2)} GB`:`${(e/1024**2).toFixed(1)} MB`}function lY({open:e,onClose:t,defaultTab:r="maintenance"}){const[n,a]=y.useState(null),[o,u]=y.useState([]),[l,f]=y.useState("llama-swap"),[h,p]=y.useState(""),[v,x]=y.useState(!1),[b,j]=y.useState(null),[k,S]=y.useState({}),[N,P]=y.useState("maintenance"),[O,C]=y.useState(!1),[_,A]=y.useState(""),[I,U]=y.useState(!1),[B,V]=y.useState(null);function q(Y,ce,tt){V({type:"alert",title:Y,message:ce,onConfirm:()=>{V(null),tt&&tt()}})}function R(Y,ce,tt){V({type:"confirm",title:Y,message:ce,onConfirm:()=>{V(null),tt()},onCancel:()=>V(null)})}function de(Y){return Y?new Date(Y*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}const[Z,ge]=y.useState(""),[je,me]=y.useState(""),[Q,oe]=y.useState(!1),[X,$]=y.useState(!1);y.useEffect(()=>{e&&(ge(localStorage.getItem("mc_sudo_password")||""),me(localStorage.getItem("mc_hf_token")||""))},[e]),y.useEffect(()=>{e&&r&&P(r)},[e,r]);const T=y.useRef(null);function ee(){De("/api/maintenance/updates").then(a).catch(Y=>console.error("Error loading updates",Y))}function ne(){De("/api/jobs").then(Y=>u(Y.jobs||[])).catch(Y=>console.error("Error loading jobs",Y))}function te(Y){x(!0),j(null),De(`/api/maintenance/logs?service=${Y}&lines=150`).then(ce=>{ce.ok?p(ce.text):(p(`Fehler beim Laden der Logs: ${ce.err||"Unbekannter Fehler"}`),(ce.status==="incorrect_password"||ce.status==="password_required")&&j(ce.status))}).catch(ce=>p(`Fehler: ${ce.message}`)).finally(()=>{x(!1),setTimeout(()=>{T.current&&(T.current.scrollTop=T.current.scrollHeight)},50)})}y.useEffect(()=>{if(!e)return;ee(),ne();const Y=setInterval(()=>{ne(),ee()},3e3);return()=>clearInterval(Y)},[e]),y.useEffect(()=>{!e||N!=="logs"||te(l)},[e,N,l]);async function ue(){try{await De("/api/maintenance/os-update",{method:"POST"}),ne(),P("maintenance")}catch(Y){q("Fehler",`Fehler beim Starten des OS-Updates: ${Y.message}`)}}async function pe(){try{await De("/api/maintenance/engine-update",{method:"POST"}),ne(),P("maintenance")}catch(Y){q("Fehler",`Fehler beim Engine-Update: ${Y.message}`)}}async function Ae(){C(!0);try{await De("/api/maintenance/check-updates",{method:"POST"}),ne(),P("maintenance")}catch(Y){q("Fehler",`Fehler bei der Update-Suche: ${Y.message}`)}finally{C(!1)}}async function J(Y,ce){try{await De("/api/models/install",{method:"POST",body:JSON.stringify({repo:Y,role:ce})}),q("Gestartet",`Modell-Upgrade für '${ce}' (${Y}) gestartet.`),ne(),P("maintenance")}catch(tt){q("Fehler",`Fehler beim Starten des Modell-Upgrades: ${tt.message}`)}}async function ke(){R("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await De("/api/maintenance/reboot",{method:"POST"}),q("Reboot","Reboot ausgelöst. System startet neu...",()=>{t()})}catch(Y){q("Fehler",`Fehler beim Reboot: ${Y.message}`)}})}async function Oe(){U(!0),A("Snapshot wird erzeugt...");try{const Y=await De("/api/system/backup",{method:"POST"});A(Y.ok?`Snapshot erzeugt: ${Y.snapshot} (${Y.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(Y){A(`Fehler: ${Y.message}`)}finally{U(!1)}}async function ae(Y){S(ce=>({...ce,[Y]:!0}));try{const ce=await De("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:Y})});ce.ok?q("Dienst neu gestartet",`Dienst ${Y} wurde erfolgreich neu gestartet.`,()=>{N==="logs"&&l===Y&&te(Y)}):q("Fehler",`Fehler beim Neustart: ${ce.err||"Unbekannter Fehler"}`)}catch(ce){q("Fehler",`Fehler beim Neustart: ${ce.message}`)}finally{S(ce=>({...ce,[Y]:!1}))}}async function Xe(Y){try{await De(`/api/jobs/${Y}/cancel`,{method:"POST"}),ne()}catch(ce){q("Fehler",`Fehler beim Abbrechen: ${ce.message}`)}}return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:he("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:t}),c.jsxs("div",{className:he("fixed inset-y-0 right-0 w-full sm:w-[500px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",e?"translate-x-0":"translate-x-full"),children:[c.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_n,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),c.jsx("button",{onClick:t,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[c.jsx("button",{onClick:()=>P("maintenance"),className:he("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),c.jsx("button",{onClick:()=>P("logs"),className:he("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),c.jsx("button",{onClick:()=>P("settings"),className:he("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[N==="maintenance"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),c.jsxs("div",{className:"flex items-center gap-2",children:[(n==null?void 0:n.last_check)&&c.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Zuletzt gesucht: ",de(n.last_check)]}),c.jsxs("button",{onClick:Ae,disabled:O,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[c.jsx(uu,{className:he("h-3 w-3",O&&"animate-spin")}),"Nach Updates suchen"]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("button",{onClick:ue,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[c.jsx(bu,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),c.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),c.jsx("span",{className:"text-[10px] text-muted-foreground",children:n!=null&&n.os?`${n.os} Updates verfügbar`:"Auf neuestem Stand"})]}),c.jsxs("button",{onClick:pe,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[c.jsx(e2,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),c.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),c.jsx("span",{className:"text-[10px] text-muted-foreground",children:n!=null&&n.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),c.jsxs("button",{onClick:ke,className:"flex w-full items-center gap-3 p-3 rounded-xl border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[c.jsx(vI,{className:"h-4.5 w-4.5"}),c.jsxs("div",{children:[c.jsx("div",{children:"Host-System neu starten (Reboot)"}),c.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"System-Backup & Snapshot"}),c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-background/20 space-y-3",children:[c.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Git-Snapshot der aktuellen Konfigurationen und des System-Zustands erzeugen."}),c.jsxs("button",{onClick:Oe,disabled:I,className:"w-full h-9 flex items-center justify-center gap-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shadow-md shadow-primary/10",children:[c.jsx(gI,{className:he("h-4 w-4",I&&"animate-pulse")})," Snapshot erstellen"]}),_&&c.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:_})]})]}),(n==null?void 0:n.model_list)&&n.model_list.length>0&&c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Upgrades"}),(n==null?void 0:n.last_check)&&c.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Gesucht: ",de(n.last_check)]})]}),c.jsx("div",{className:"space-y-2",children:n.model_list.map(Y=>c.jsx("div",{className:"p-3 rounded-xl border border-border/60 bg-background/20 flex flex-col gap-2",children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold",children:Y.title}),c.jsx("div",{className:"text-[10px] font-mono text-muted-foreground",children:Y.repo}),c.jsxs("div",{className:"text-[10px] text-primary font-semibold uppercase mt-0.5",children:["Rolle: ",Y.role]})]}),c.jsxs("button",{onClick:()=>J(Y.repo,Y.role),className:"flex items-center gap-1.5 text-[10px] font-semibold text-emerald-400 hover:text-emerald-300 border border-emerald-500/20 bg-emerald-500/5 hover:bg-emerald-500/10 px-2 py-1 rounded-lg transition-colors shrink-0",children:[c.jsx(no,{className:"h-3.5 w-3.5"}),"Upgrade"]})]})},Y.role))})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),c.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[o.filter(Y=>Y.state==="running"||Y.state==="queued").length," Aktiv"]})]}),c.jsx("div",{className:"space-y-3",children:o.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):o.map(Y=>{const ce=Y.state==="running"||Y.state==="queued";return c.jsxs("div",{className:he("p-3 rounded-xl border transition-all duration-300",ce?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[ce&&c.jsxs("span",{className:"flex h-2 w-2 relative",children:[c.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),c.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),Y.label]}),c.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[c.jsxs("span",{children:["ID: ",Y.id]}),c.jsx("span",{children:"•"}),c.jsx("span",{className:he(Y.state==="done"&&"text-emerald-400",Y.state==="failed"&&"text-red-400",Y.state==="running"&&"text-primary",Y.state==="queued"&&"text-amber-400",Y.state==="canceled"&&"text-muted-foreground"),children:Y.state})]})]}),ce&&c.jsx("button",{onClick:()=>Xe(Y.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),Y.state==="running"&&c.jsxs("div",{className:"mt-3 space-y-1",children:[c.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${Y.progress??0}%`}})}),c.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[c.jsxs("span",{children:[Y.progress??0,"%"]}),Y.done_bytes!=null&&Y.total_bytes!=null&&c.jsxs("span",{children:[_v(Y.done_bytes)," / ",_v(Y.total_bytes),Y.rate_bps!=null&&` (${_v(Y.rate_bps)}/s)`]}),Y.eta_s!=null&&c.jsxs("span",{children:["ETA: ",Y.eta_s,"s"]})]})]})]},Y.id)})})]})]}),N==="logs"&&c.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("select",{value:l,onChange:Y=>f(Y.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:sY.map(Y=>c.jsxs("option",{value:Y.id,children:[Y.label," (",Y.type==="system"?"systemd-root":"user",")"]},Y.id))}),c.jsxs("button",{onClick:()=>ae(l),disabled:k[l],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[c.jsx(uu,{className:he("h-3.5 w-3.5",k[l]&&"animate-spin")}),"Restart"]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[c.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[c.jsx(nf,{className:"h-3 w-3 text-primary"}),c.jsxs("span",{children:["stdout/stderr - ",l]})]}),c.jsx("button",{onClick:()=>te(l),disabled:v,className:"text-muted-foreground hover:text-foreground transition-colors",children:c.jsx(uu,{className:he("h-3 w-3",v&&"animate-spin")})})]}),c.jsx("pre",{ref:T,className:"flex-1 p-4 overflow-y-auto text-[10px] font-mono text-cyan-300/90 whitespace-pre-wrap select-text leading-relaxed scrollbar-thin",children:b==="password_required"||b==="incorrect_password"?c.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full space-y-3",children:[c.jsx(Cs,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),c.jsx("div",{className:"text-xs font-semibold text-amber-300",children:b==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),c.jsxs("p",{className:"text-[10px] text-muted-foreground max-w-xs leading-normal",children:["Für das Auslesen der systemd-Logs von ",l," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),c.jsx("button",{onClick:()=>P("settings"),className:"px-3 py-1.5 text-[10px] font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-md transition-colors mt-2",children:"Sudo-Passwort eintragen"})]}):v&&!h?c.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):h||c.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]}),N==="settings"&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),c.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[c.jsx(bu,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:Q?"text":"password",value:Z,onChange:Y=>ge(Y.target.value),placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),c.jsx("button",{type:"button",onClick:()=>oe(!Q),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Q?c.jsx(Q1,{className:"h-4 w-4"}):c.jsx(qv,{className:"h-4 w-4"})})]}),c.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[c.jsx(cI,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:X?"text":"password",value:je,onChange:Y=>me(Y.target.value),placeholder:"hf_...",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),c.jsx("button",{type:"button",onClick:()=>$(!X),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:X?c.jsx(Q1,{className:"h-4 w-4"}):c.jsx(qv,{className:"h-4 w-4"})})]}),c.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),c.jsxs("div",{className:"flex gap-3 pt-2",children:[c.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",Z),localStorage.setItem("mc_hf_token",je),q("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),c.jsx("button",{onClick:()=>{ge(""),me(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),q("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})]})]}),B&&c.jsx(a_,{type:B.type,title:B.title,message:B.message,onConfirm:B.onConfirm,onCancel:B.onCancel})]})}function uY(){var v,x,b,j,k;k4();const[e,t]=y.useState("dashboard"),[r,n]=y.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[a,o]=y.useState(!1),[u,l]=y.useState("maintenance"),{data:f}=O3(),{data:h}=oh(2e4);y.useEffect(()=>{document.documentElement.classList.add("dark")},[]),y.useEffect(()=>{const S=N=>{var O;l(((O=N.detail)==null?void 0:O.tab)||"maintenance"),o(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]);const p=Yv.find(S=>S.id===e);return c.jsxs("div",{className:"flex h-full relative",children:[c.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[c.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),c.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),c.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),c.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),c.jsx(A3,{onNavigate:t}),c.jsx(lY,{open:a,onClose:()=>o(!1),defaultTab:u}),c.jsxs("aside",{className:he("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",r?"w-16":"w-60"),children:[c.jsxs("div",{className:he("flex items-center py-4 border-b border-border/40 shrink-0",r?"flex-col gap-3 px-2":"justify-between px-5"),children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[c.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!r&&c.jsxs("div",{className:"leading-tight",children:[c.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),c.jsx("button",{onClick:()=>{n(S=>{const N=!S;return localStorage.setItem("mc_sidebar_collapsed",N.toString()),N})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:r?"Maximieren":"Minimieren",children:r?c.jsx(XN,{className:"h-4 w-4"}):c.jsx(tI,{className:"h-4 w-4"})})]}),c.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Yv.map(S=>c.jsxs("button",{onClick:()=>t(S.id),className:he("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",r?"justify-center p-2.5":"gap-3 px-3 py-2",e===S.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:r?S.label:void 0,children:[c.jsx(S.icon,{className:"h-4.5 w-4.5 shrink-0"}),!r&&c.jsx("span",{className:"truncate",children:S.label})]},S.id))}),c.jsx("div",{className:he("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",r?"px-2 text-center":"px-5"),children:r?c.jsx("div",{className:"flex justify-center",children:c.jsx("span",{className:he("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",f?f.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:f?`Engine ${f.engine_reachable?"online":"offline"}`:"Backend offline"})}):c.jsxs("div",{className:"space-y-2 text-left",children:[f?c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:he("h-2 w-2 rounded-full animate-pulse",f.engine_reachable?"bg-emerald-500":"bg-amber-500")}),c.jsxs("span",{className:"truncate",children:["Engine ",f.engine_reachable?"online":"offline"]})]}):c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",c.jsx("span",{className:"truncate",children:"Backend offline"})]}),(h==null?void 0:h.versions)&&c.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[c.jsxs("div",{className:"truncate",title:h.versions.mc2?`${h.versions.mc2.branch}-${h.versions.mc2.hash}${h.versions.mc2.dirty?"*":""} (${h.versions.mc2.date})`:"nicht gefunden",children:[c.jsx("strong",{children:"MC2:"})," ",h.versions.mc2?`${h.versions.mc2.hash}${h.versions.mc2.dirty?"*":""}`:"—"]}),c.jsxs("div",{className:"truncate",title:((v=h.versions.engine)==null?void 0:v.type)==="git"?`${h.versions.engine.branch}-${h.versions.engine.hash}${h.versions.engine.dirty?"*":""} (${h.versions.engine.date})`:((x=h.versions.engine)==null?void 0:x.version_text)||"unbekannt",children:[c.jsx("strong",{children:"Engine:"})," ",((b=h.versions.engine)==null?void 0:b.type)==="git"?`${h.versions.engine.hash}${h.versions.engine.dirty?"*":""}`:((k=(j=h.versions.engine)==null?void 0:j.version_text)==null?void 0:k.split(" ").pop())||"—"]}),c.jsxs("div",{className:"truncate",title:h.versions.hermes_ui?`${h.versions.hermes_ui.branch}-${h.versions.hermes_ui.hash}${h.versions.hermes_ui.dirty?"*":""} (${h.versions.hermes_ui.date})`:"nicht gefunden",children:[c.jsx("strong",{children:"Hermes UI:"})," ",h.versions.hermes_ui?`${h.versions.hermes_ui.hash}${h.versions.hermes_ui.dirty?"*":""}`:"—"]}),c.jsxs("div",{className:"truncate",title:h.versions.hermes_agent?`${h.versions.hermes_agent.branch}-${h.versions.hermes_agent.hash}${h.versions.hermes_agent.dirty?"*":""} (${h.versions.hermes_agent.date})`:"nicht gefunden",children:[c.jsx("strong",{children:"Hermes Agent:"})," ",h.versions.hermes_agent?`${h.versions.hermes_agent.hash}${h.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[c.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:p.hint}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),c.jsxs("button",{onClick:()=>{const S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[c.jsx(aI,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Suchen"}),c.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),c.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[e==="dashboard"&&c.jsx(VQ,{}),e==="models"&&c.jsx(JQ,{}),e==="connect"&&c.jsx(eY,{}),e==="memory"&&c.jsx(rY,{}),e==="agent"&&c.jsx(nY,{}),e==="terminal"&&c.jsx(iY,{}),e==="guide"&&c.jsx(aY,{}),!["dashboard","models","connect","memory","agent","terminal","guide"].includes(e)&&c.jsx(oY,{title:p.label,hint:p.hint})]})]})]})}const cY=new $M({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});dM.createRoot(document.getElementById("root")).render(c.jsx(DN.StrictMode,{children:c.jsx(LM,{client:cY,children:c.jsx(uY,{})})})); +...`}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/25 rounded-xl border border-border/30 text-[10px]",children:[c.jsx("div",{className:"font-bold text-foreground",children:"Wo gibt es Skills & wo liegen sie?"}),c.jsxs("ul",{className:"list-disc pl-4 space-y-2.5 text-muted-foreground",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"skills.sh Registry & CLI:"})," Das offizielle offene Portal für Agent-Skills (",c.jsx("a",{href:"https://skills.sh/",target:"_blank",rel:"noopener",className:"text-primary hover:underline font-semibold",children:"skills.sh"}),"). Du kannst Skills direkt über das Terminal suchen und in deinem Projekt installieren:",c.jsxs("div",{className:"mt-1 font-mono text-[9px] bg-background/40 p-2 rounded border border-border/30 text-cyan-300",children:["# Nach Skills suchen:",c.jsx("br",{}),c.jsx("span",{className:"text-foreground",children:"npx skills find"}),c.jsx("br",{}),"# Skill zum aktuellen Projekt hinzufügen:",c.jsx("br",{}),c.jsx("span",{className:"text-foreground",children:"npx skills add [owner/repo]"})]})]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Globaler Pfad:"})," ",c.jsx("code",{className:"text-foreground select-all",children:"C:\\Users\\TobisPC\\.gemini\\config\\plugins\\agent-skills\\skills\\"}),". Hier sind deine vorinstallierten, global verfügbaren Skills (wie ",c.jsx("i",{children:"code-simplification"}),", ",c.jsx("i",{children:"api-and-interface-design"}),", etc.) abgelegt."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Projekt-Pfad:"})," ",c.jsx("code",{className:"text-foreground select-all",children:".agents/skills/"}),". Lege diesen Ordner im Root eines beliebigen Projekts an. Dein lokaler Editor-Agent (z.B. Roo Code) liest ihn beim Starten automatisch ein."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Vorlagen / Beispiele:"})," Kopiere einfach bestehende Skills aus dem globalen Verzeichnis oder erstelle deine eigenen, indem du eine ",c.jsx("code",{children:"SKILL.md"})," mit YAML-Header (name, description) anlegst."]})]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(_n,{className:"h-5 w-5 text-indigo-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"4. Arbeiten mit Hermes"}),c.jsx("span",{className:"text-[9px] text-indigo-400 font-mono",children:"Autonomer Box-Agent"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-2 leading-normal",children:[c.jsxs("p",{children:[c.jsx("strong",{children:"Was ist das?"})," Hermes ist der auf der Box installierte, autonome Hintergrund-Agent. Er verwaltet das Dateisystem und kann über REST (Port 8642) oder eine interaktive ChatUI (Port 8787) gesteuert werden."]}),c.jsx("p",{children:c.jsx("strong",{children:"Best Practices für Hermes:"})}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Chat-Kontext sauber halten:"})," Starte regelmäßig neue Chats. Zu große Historien verlangsamen den Agenten und führen zu Halluzinationen."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Gehirn festlegen:"})," Konfiguriere im Gateway die Modell-Rolle ",c.jsx("code",{children:"brain"})," für Hermes, damit er automatisch das passende Modell per Llama Swap lädt."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Sandbox umgehen:"})," Erweitere Hermes' System-Prompt (`~/.hermes/SOUL.md` / Config), um Befehle über SSH an deinen Windows-PC zu leiten."]})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(ku,{className:"h-5 w-5 text-amber-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"5. Richtiges Arbeiten mit Tools (Dateien, Terminal, DevTools)"}),c.jsx("span",{className:"text-[9px] text-amber-400 font-mono",children:"Fehler vermeiden & Kosten senken"})]})]}),c.jsxs("div",{className:"grid md:grid-cols-3 gap-4 text-xs text-muted-foreground leading-normal",children:[c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[c.jsx(nf,{className:"h-3.5 w-3.5 text-primary"})," Terminal"]}),c.jsxs("p",{className:"text-[11px]",children:["Verwende nur non-interaktive Befehle. Hänge bei langen Tasks (wie dev-Servern) ein ",c.jsx("code",{children:"&"})," an oder nutze die integrierte Job-Verwaltung. Verwende niemals interaktive Eingabeaufforderungen."]})]}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[c.jsx(Gv,{className:"h-3.5 w-3.5 text-cyan-400"})," Dateimanager"]}),c.jsxs("p",{className:"text-[11px]",children:["Überschreibe keine ganzen Dateien, wenn du nur eine Zeile ändern willst. Verwende gezielte Ersetzungs-Tools (wie ",c.jsx("code",{children:"replace_file_content"}),"). Das spart massiv Token-Kosten und beugt Fehlern vor."]})]}),c.jsxs("div",{className:"space-y-1.5 p-3 bg-background/10 rounded-xl border border-border/30",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1",children:[c.jsx(ku,{className:"h-3.5 w-3.5 text-violet-400"})," Browser DevTools"]}),c.jsx("p",{className:"text-[11px]",children:"Koppele deine Debug-Dienste mit dem Chrome-DevTools-Plugin. So kann der Agent Fehler in der Konsole live analysieren und das DOM verifizieren, anstatt blind zu raten."})]})]})]}),c.jsxs("div",{className:"rounded-2xl border border-border/60 bg-card/45 p-6 shadow-lg shadow-black/10 space-y-4 md:col-span-2",children:[c.jsxs("div",{className:"flex items-center gap-2 border-b border-border/20 pb-3",children:[c.jsx(wu,{className:"h-5 w-5 text-emerald-400"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-foreground",children:"Wie autonom ist Mission Control 2 wirklich?"}),c.jsx("span",{className:"text-[9px] text-emerald-400 font-mono",children:"Die Grenze zwischen Automatisierung und Kontrolle"})]})]}),c.jsxs("div",{className:"text-xs text-muted-foreground space-y-3 leading-normal",children:[c.jsxs("p",{children:["Mission Control 2 ist als ",c.jsx("strong",{children:"semi-autonomes Gateway"})," konzipiert. Es besitzt die Fähigkeit, komplexe Workflows komplett selbstständig durchzuführen, unterliegt jedoch strikten Sicherheitsplanken:"]}),c.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 pt-1",children:[c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[c.jsx(q1,{className:"h-3 w-3 text-emerald-400"})," Was läuft vollautomatisch?"]}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[c.jsx("li",{children:"Modellaustausch (Routing) per llama-swap je nach Anfragetyp (z.B. Code vs. Reasoning)."}),c.jsx("li",{children:"Hintergrund-Synchronisation und Speicherung von Gedächtniseinträgen (Memory)."}),c.jsx("li",{children:"Modell-Installation und API-Key-Injektionen in Gateway-Verbindungen."})]})]}),c.jsxs("div",{className:"space-y-1.5",children:[c.jsxs("h4",{className:"font-bold text-foreground flex items-center gap-1 text-[11px]",children:[c.jsx(q1,{className:"h-3 w-3 text-amber-400"})," Wo ist menschliche Freigabe nötig?"]}),c.jsxs("ul",{className:"list-disc pl-4 space-y-1 text-[11px]",children:[c.jsxs("li",{children:[c.jsx("strong",{children:"Systembefehle:"})," Das Ausführen von Terminal-Kommandos auf deinem PC erfordert standardmäßig deine Bestätigung."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Kritische Systemeingriffe:"})," OS-Updates, Engine-Rebuilds und Host-Reboots müssen manuell über das Dashboard ausgelöst werden."]}),c.jsxs("li",{children:[c.jsx("strong",{children:"Gedächtnis-Löschung:"})," Permanentes Verwerfen von gesammelten Memorys wird von dir freigegeben."]})]})]})]}),c.jsxs("p",{className:"text-[11px] bg-background/25 p-3 rounded-xl border border-border/30 mt-2",children:[c.jsx("strong",{children:"Fazit:"})," Der Stack erledigt die Kärrnerarbeit (Modelle tauschen, API-Adapter bereitstellen, Sandbox-Verbindungen herstellen) komplett im Hintergrund. Er agiert als dein persönlicher, treuer Copilot, ohne jemals ungefragt schädliche Operationen auf deinem Hauptsystem auszuführen."]})]})]})]})]})]})}function mY({title:e,hint:t}){return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-xl font-semibold",children:e}),c.jsx("p",{className:"text-sm text-muted-foreground",children:t})]}),c.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border border-dashed border-border bg-card/50 py-20 text-center",children:[c.jsx(sI,{className:"h-8 w-8 text-muted-foreground"}),c.jsx("div",{className:"text-sm text-muted-foreground",children:"Kommt in einer späteren Phase."})]})]})}const vY=[{id:"llama-swap",label:"Llama Swap",type:"system"},{id:"mission-control-2",label:"Mission Control 2",type:"user"},{id:"hermes-gateway",label:"Hermes Gateway",type:"user"},{id:"hermes-terminal",label:"Hermes Terminal",type:"user"}];function _v(e){return e==null?"":e>1024**3?`${(e/1024**3).toFixed(2)} GB`:`${(e/1024**2).toFixed(1)} MB`}function gY({open:e,onClose:t,defaultTab:r="maintenance"}){const[n,a]=y.useState(null),[o,u]=y.useState([]),[l,f]=y.useState("llama-swap"),[h,p]=y.useState(""),[v,x]=y.useState(!1),[b,k]=y.useState(null),[j,S]=y.useState({}),[N,P]=y.useState("maintenance"),[O,C]=y.useState(!1),[_,A]=y.useState(""),[I,$]=y.useState(!1),[B,K]=y.useState(null);function q(Y,ce,tt){K({type:"alert",title:Y,message:ce,onConfirm:()=>{K(null),tt&&tt()}})}function R(Y,ce,tt){K({type:"confirm",title:Y,message:ce,onConfirm:()=>{K(null),tt()},onCancel:()=>K(null)})}function de(Y){return Y?new Date(Y*1e3).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):"Nie"}const[Z,ge]=y.useState(""),[ke,me]=y.useState(""),[Q,oe]=y.useState(!1),[X,L]=y.useState(!1);y.useEffect(()=>{e&&(ge(localStorage.getItem("mc_sudo_password")||""),me(localStorage.getItem("mc_hf_token")||""))},[e]),y.useEffect(()=>{e&&r&&P(r)},[e,r]);const T=y.useRef(null);function ee(){Me("/api/maintenance/updates").then(a).catch(Y=>console.error("Error loading updates",Y))}function ne(){Me("/api/jobs").then(Y=>u(Y.jobs||[])).catch(Y=>console.error("Error loading jobs",Y))}function te(Y){x(!0),k(null),Me(`/api/maintenance/logs?service=${Y}&lines=150`).then(ce=>{ce.ok?p(ce.text):(p(`Fehler beim Laden der Logs: ${ce.err||"Unbekannter Fehler"}`),(ce.status==="incorrect_password"||ce.status==="password_required")&&k(ce.status))}).catch(ce=>p(`Fehler: ${ce.message}`)).finally(()=>{x(!1),setTimeout(()=>{T.current&&(T.current.scrollTop=T.current.scrollHeight)},50)})}y.useEffect(()=>{if(!e)return;ee(),ne();const Y=setInterval(()=>{ne(),ee()},3e3);return()=>clearInterval(Y)},[e]),y.useEffect(()=>{!e||N!=="logs"||te(l)},[e,N,l]);async function ue(){try{await Me("/api/maintenance/os-update",{method:"POST"}),ne(),P("maintenance")}catch(Y){q("Fehler",`Fehler beim Starten des OS-Updates: ${Y.message}`)}}async function pe(){try{await Me("/api/maintenance/engine-update",{method:"POST"}),ne(),P("maintenance")}catch(Y){q("Fehler",`Fehler beim Engine-Update: ${Y.message}`)}}async function Oe(){C(!0);try{await Me("/api/maintenance/check-updates",{method:"POST"}),ne(),P("maintenance")}catch(Y){q("Fehler",`Fehler bei der Update-Suche: ${Y.message}`)}finally{C(!1)}}async function J(Y,ce){try{await Me("/api/models/install",{method:"POST",body:JSON.stringify({repo:Y,role:ce})}),q("Gestartet",`Modell-Upgrade für '${ce}' (${Y}) gestartet.`),ne(),P("maintenance")}catch(tt){q("Fehler",`Fehler beim Starten des Modell-Upgrades: ${tt.message}`)}}async function je(){R("Reboot bestätigen","Bist du sicher, dass du das gesamte Host-System neu starten willst?",async()=>{try{await Me("/api/maintenance/reboot",{method:"POST"}),q("Reboot","Reboot ausgelöst. System startet neu...",()=>{t()})}catch(Y){q("Fehler",`Fehler beim Reboot: ${Y.message}`)}})}async function _e(){$(!0),A("Snapshot wird erzeugt...");try{const Y=await Me("/api/system/backup",{method:"POST"});A(Y.ok?`Snapshot erzeugt: ${Y.snapshot} (${Y.files.length} Dateien)`:"Keine Änderungen zu sichern.")}catch(Y){A(`Fehler: ${Y.message}`)}finally{$(!1)}}async function ae(Y){S(ce=>({...ce,[Y]:!0}));try{const ce=await Me("/api/maintenance/restart",{method:"POST",body:JSON.stringify({service:Y})});ce.ok?q("Dienst neu gestartet",`Dienst ${Y} wurde erfolgreich neu gestartet.`,()=>{N==="logs"&&l===Y&&te(Y)}):q("Fehler",`Fehler beim Neustart: ${ce.err||"Unbekannter Fehler"}`)}catch(ce){q("Fehler",`Fehler beim Neustart: ${ce.message}`)}finally{S(ce=>({...ce,[Y]:!1}))}}async function Xe(Y){try{await Me(`/api/jobs/${Y}/cancel`,{method:"POST"}),ne()}catch(ce){q("Fehler",`Fehler beim Abbrechen: ${ce.message}`)}}return c.jsxs(c.Fragment,{children:[c.jsx("div",{className:fe("fixed inset-0 bg-black/60 backdrop-blur-sm z-50 transition-opacity duration-300",e?"opacity-100 pointer-events-auto":"opacity-0 pointer-events-none"),onClick:t}),c.jsxs("div",{className:fe("fixed inset-y-0 right-0 w-full sm:w-[500px] bg-card/85 backdrop-blur-xl border-l border-border/60 shadow-2xl z-50 flex flex-col transform transition-transform duration-300 ease-in-out font-sans text-foreground",e?"translate-x-0":"translate-x-full"),children:[c.jsxs("div",{className:"flex h-16 shrink-0 items-center justify-between border-b border-border/40 px-6",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(_n,{className:"h-4.5 w-4.5 text-primary"}),c.jsx("h2",{className:"text-sm font-semibold tracking-wide uppercase font-space",children:"OS-Zentrale & Pflege"})]}),c.jsx("button",{onClick:t,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-border/40 text-muted-foreground hover:bg-accent transition-colors",children:c.jsx(oa,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex border-b border-border/40 px-6",children:[c.jsx("button",{onClick:()=>P("maintenance"),className:fe("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="maintenance"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Wartung"}),c.jsx("button",{onClick:()=>P("logs"),className:fe("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="logs"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"System-Logs"}),c.jsx("button",{onClick:()=>P("settings"),className:fe("flex-1 py-3 text-xs font-semibold uppercase tracking-wider border-b-2 text-center transition-all",N==="settings"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"),children:"Einstellungen"})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto p-6 space-y-6",children:[N==="maintenance"&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Wartungsaktionen"}),c.jsxs("div",{className:"flex items-center gap-2",children:[(n==null?void 0:n.last_check)&&c.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Zuletzt gesucht: ",de(n.last_check)]}),c.jsxs("button",{onClick:Oe,disabled:O,className:"flex items-center gap-1 text-[10px] font-semibold text-primary hover:text-primary/80 transition-colors disabled:opacity-50",children:[c.jsx(cu,{className:fe("h-3 w-3",O&&"animate-spin")}),"Nach Updates suchen"]})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[c.jsxs("button",{onClick:ue,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[c.jsx(wu,{className:"h-5 w-5 text-cyan-400 mb-1 group-hover:scale-105 transition-transform"}),c.jsx("span",{className:"text-xs font-semibold",children:"OS Update (apt)"}),c.jsx("span",{className:"text-[10px] text-muted-foreground",children:n!=null&&n.os?`${n.os} Updates verfügbar`:"Auf neuestem Stand"})]}),c.jsxs("button",{onClick:pe,className:"flex flex-col items-start gap-1 p-4 rounded-xl border border-border/60 bg-background/20 hover:border-primary/50 transition-all text-left group",children:[c.jsx(t2,{className:"h-5 w-5 text-violet-400 mb-1 group-hover:scale-105 transition-transform"}),c.jsx("span",{className:"text-xs font-semibold",children:"Engine Update"}),c.jsx("span",{className:"text-[10px] text-muted-foreground",children:n!=null&&n.engine?"Update verfügbar":"Auf neuestem Stand"})]})]}),c.jsxs("button",{onClick:je,className:"flex w-full items-center gap-3 p-3 rounded-xl border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 text-red-400 transition-all text-left text-xs font-semibold",children:[c.jsx(yI,{className:"h-4.5 w-4.5"}),c.jsxs("div",{children:[c.jsx("div",{children:"Host-System neu starten (Reboot)"}),c.jsx("div",{className:"text-[10px] text-red-400/80 font-normal",children:"Startet das gesamte Betriebssystem des Homelabs neu"})]})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"System-Backup & Snapshot"}),c.jsxs("div",{className:"p-4 rounded-xl border border-border/60 bg-background/20 space-y-3",children:[c.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Git-Snapshot der aktuellen Konfigurationen und des System-Zustands erzeugen."}),c.jsxs("button",{onClick:_e,disabled:I,className:"w-full h-9 flex items-center justify-center gap-1.5 rounded-lg bg-primary text-primary-foreground text-xs font-semibold hover:opacity-90 transition-all cursor-pointer disabled:opacity-50 shadow-md shadow-primary/10",children:[c.jsx(xI,{className:fe("h-4 w-4",I&&"animate-pulse")})," Snapshot erstellen"]}),_&&c.jsx("div",{className:"text-[10px] font-mono text-primary bg-primary/5 p-2 rounded-lg border border-primary/20 break-all leading-normal",children:_})]})]}),(n==null?void 0:n.model_list)&&n.model_list.length>0&&c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Verfügbare Modell-Upgrades"}),(n==null?void 0:n.last_check)&&c.jsxs("span",{className:"text-[9px] text-muted-foreground",children:["Gesucht: ",de(n.last_check)]})]}),c.jsx("div",{className:"space-y-2",children:n.model_list.map(Y=>c.jsx("div",{className:"p-3 rounded-xl border border-border/60 bg-background/20 flex flex-col gap-2",children:c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-semibold",children:Y.title}),c.jsx("div",{className:"text-[10px] font-mono text-muted-foreground",children:Y.repo}),c.jsxs("div",{className:"text-[10px] text-primary font-semibold uppercase mt-0.5",children:["Rolle: ",Y.role]})]}),c.jsxs("button",{onClick:()=>J(Y.repo,Y.role),className:"flex items-center gap-1.5 text-[10px] font-semibold text-emerald-400 hover:text-emerald-300 border border-emerald-500/20 bg-emerald-500/5 hover:bg-emerald-500/10 px-2 py-1 rounded-lg transition-colors shrink-0",children:[c.jsx(no,{className:"h-3.5 w-3.5"}),"Upgrade"]})]})},Y.role))})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Hintergrund-Aufgaben"}),c.jsxs("span",{className:"text-[10px] font-mono bg-primary/10 text-primary px-1.5 py-0.5 rounded-full",children:[o.filter(Y=>Y.state==="running"||Y.state==="queued").length," Aktiv"]})]}),c.jsx("div",{className:"space-y-3",children:o.length===0?c.jsx("div",{className:"text-xs text-muted-foreground border border-dashed border-border/60 rounded-xl p-6 text-center",children:"Aktuell keine aktiven Hintergrund-Jobs."}):o.map(Y=>{const ce=Y.state==="running"||Y.state==="queued";return c.jsxs("div",{className:fe("p-3 rounded-xl border transition-all duration-300",ce?"border-primary/40 bg-primary/5 shadow-md shadow-primary/5":"border-border/40 bg-background/20 opacity-80"),children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"space-y-1",children:[c.jsxs("div",{className:"text-xs font-semibold flex items-center gap-1.5",children:[ce&&c.jsxs("span",{className:"flex h-2 w-2 relative",children:[c.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),c.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]}),Y.label]}),c.jsxs("div",{className:"text-[10px] font-mono text-muted-foreground uppercase flex items-center gap-2",children:[c.jsxs("span",{children:["ID: ",Y.id]}),c.jsx("span",{children:"•"}),c.jsx("span",{className:fe(Y.state==="done"&&"text-emerald-400",Y.state==="failed"&&"text-red-400",Y.state==="running"&&"text-primary",Y.state==="queued"&&"text-amber-400",Y.state==="canceled"&&"text-muted-foreground"),children:Y.state})]})]}),ce&&c.jsx("button",{onClick:()=>Xe(Y.id),className:"text-[10px] font-semibold text-red-400 hover:text-red-300 border border-red-500/20 bg-red-500/5 hover:bg-red-500/10 px-2 py-0.5 rounded transition-colors",children:"Abbrechen"})]}),Y.state==="running"&&c.jsxs("div",{className:"mt-3 space-y-1",children:[c.jsx("div",{className:"w-full h-1.5 bg-muted rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-primary transition-all duration-500",style:{width:`${Y.progress??0}%`}})}),c.jsxs("div",{className:"flex justify-between items-center text-[9px] font-mono text-muted-foreground",children:[c.jsxs("span",{children:[Y.progress??0,"%"]}),Y.done_bytes!=null&&Y.total_bytes!=null&&c.jsxs("span",{children:[_v(Y.done_bytes)," / ",_v(Y.total_bytes),Y.rate_bps!=null&&` (${_v(Y.rate_bps)}/s)`]}),Y.eta_s!=null&&c.jsxs("span",{children:["ETA: ",Y.eta_s,"s"]})]})]})]},Y.id)})})]})]}),N==="logs"&&c.jsxs("div",{className:"flex flex-col h-full space-y-4",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("select",{value:l,onChange:Y=>f(Y.target.value),className:"flex-1 h-9 px-3 text-xs bg-background/40 border border-border/60 rounded-lg outline-none text-foreground font-semibold",children:vY.map(Y=>c.jsxs("option",{value:Y.id,children:[Y.label," (",Y.type==="system"?"systemd-root":"user",")"]},Y.id))}),c.jsxs("button",{onClick:()=>ae(l),disabled:j[l],className:"flex h-9 px-3 items-center gap-1.5 text-xs font-semibold rounded-lg border border-border/60 bg-background/20 hover:border-primary/50 transition-colors disabled:opacity-50",title:"Dienst neu starten",children:[c.jsx(cu,{className:fe("h-3.5 w-3.5",j[l]&&"animate-spin")}),"Restart"]})]}),c.jsxs("div",{className:"flex-1 flex flex-col min-h-[300px] border border-border/60 bg-black/50 rounded-xl overflow-hidden shadow-inner",children:[c.jsxs("div",{className:"flex h-9 items-center justify-between px-4 border-b border-border/40 bg-black/30 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono text-muted-foreground",children:[c.jsx(nf,{className:"h-3 w-3 text-primary"}),c.jsxs("span",{children:["stdout/stderr - ",l]})]}),c.jsx("button",{onClick:()=>te(l),disabled:v,className:"text-muted-foreground hover:text-foreground transition-colors",children:c.jsx(cu,{className:fe("h-3 w-3",v&&"animate-spin")})})]}),c.jsx("pre",{ref:T,className:"flex-1 p-4 overflow-y-auto text-[10px] font-mono text-cyan-300/90 whitespace-pre-wrap select-text leading-relaxed scrollbar-thin",children:b==="password_required"||b==="incorrect_password"?c.jsxs("div",{className:"flex flex-col items-center justify-center p-6 text-center h-full space-y-3",children:[c.jsx(Cs,{className:"h-8 w-8 text-amber-400 animate-pulse animate-duration-1000"}),c.jsx("div",{className:"text-xs font-semibold text-amber-300",children:b==="incorrect_password"?"Falsches Sudo-Passwort hinterlegt.":"Sudo-Passwort für systemd-Dienste erforderlich."}),c.jsxs("p",{className:"text-[10px] text-muted-foreground max-w-xs leading-normal",children:["Für das Auslesen der systemd-Logs von ",l," werden Root-Rechte benötigt. Hinterlege dein Passwort in den Einstellungen."]}),c.jsx("button",{onClick:()=>P("settings"),className:"px-3 py-1.5 text-[10px] font-semibold text-primary-foreground bg-primary hover:bg-primary/95 rounded-md transition-colors mt-2",children:"Sudo-Passwort eintragen"})]}):v&&!h?c.jsx("span",{className:"text-muted-foreground",children:"Lade Logs..."}):h||c.jsx("span",{className:"text-muted-foreground",children:"Keine Logeinträge vorhanden."})})]})]}),N==="settings"&&c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx("h3",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Zugangsdaten & Schlüssel"}),c.jsx("p",{className:"text-[10px] text-muted-foreground leading-normal",children:"Diese Daten werden ausschließlich lokal in deinem Browser (localStorage) gespeichert und bei Bedarf an das Backend übertragen."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[c.jsx(wu,{className:"h-4 w-4 text-amber-400"}),"Host Sudo-Passwort"]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:Q?"text":"password",value:Z,onChange:Y=>ge(Y.target.value),placeholder:"Sudo-Passwort für System-Operationen",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),c.jsx("button",{type:"button",onClick:()=>oe(!Q),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:Q?c.jsx(Q1,{className:"h-4 w-4"}):c.jsx(qv,{className:"h-4 w-4"})})]}),c.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Wird benötigt für systemd-Dienste (Llama Swap logs/restart), OS-Update (apt) und Reboot."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs("label",{className:"text-xs font-semibold flex items-center gap-1.5",children:[c.jsx(dI,{className:"h-4 w-4 text-violet-400"}),"HuggingFace API Token"]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:X?"text":"password",value:ke,onChange:Y=>me(Y.target.value),placeholder:"hf_...",className:"w-full h-10 pl-3 pr-10 text-xs bg-background/40 border border-border/60 rounded-lg outline-none focus:border-primary transition-colors text-foreground"}),c.jsx("button",{type:"button",onClick:()=>L(!X),className:"absolute inset-y-0 right-0 flex items-center pr-3 text-muted-foreground hover:text-foreground transition-colors",children:X?c.jsx(Q1,{className:"h-4 w-4"}):c.jsx(qv,{className:"h-4 w-4"})})]}),c.jsx("p",{className:"text-[9px] text-muted-foreground leading-normal",children:"Erlaubt das Herunterladen von geschützten oder Gate-restricted Modellen direkt über Mission Control."})]}),c.jsxs("div",{className:"flex gap-3 pt-2",children:[c.jsx("button",{onClick:()=>{localStorage.setItem("mc_sudo_password",Z),localStorage.setItem("mc_hf_token",ke),q("Erfolgreich","Einstellungen erfolgreich lokal gespeichert.")},className:"flex-1 h-9 flex items-center justify-center text-xs font-semibold text-primary-foreground bg-primary hover:bg-primary/90 rounded-lg transition-colors shadow shadow-primary/10 cursor-pointer",children:"Speichern"}),c.jsx("button",{onClick:()=>{ge(""),me(""),localStorage.removeItem("mc_sudo_password"),localStorage.removeItem("mc_hf_token"),q("Gelöscht","Zugangsdaten gelöscht.")},className:"h-9 px-4 flex items-center justify-center text-xs font-semibold text-muted-foreground border border-border/60 bg-background/20 hover:bg-accent rounded-lg transition-colors cursor-pointer",children:"Zurücksetzen"})]})]})]})]}),B&&c.jsx(o_,{type:B.type,title:B.title,message:B.message,onConfirm:B.onConfirm,onCancel:B.onCancel})]})}function yY(){var v,x,b,k,j;P4();const[e,t]=y.useState("dashboard"),[r,n]=y.useState(()=>localStorage.getItem("mc_sidebar_collapsed")==="true"),[a,o]=y.useState(!1),[u,l]=y.useState("maintenance"),{data:f}=T3(),{data:h}=oh(2e4);y.useEffect(()=>{document.documentElement.classList.add("dark")},[]),y.useEffect(()=>{const S=N=>{var O;l(((O=N.detail)==null?void 0:O.tab)||"maintenance"),o(!0)};return window.addEventListener("open-system-drawer",S),()=>window.removeEventListener("open-system-drawer",S)},[]);const p=Yv.find(S=>S.id===e);return c.jsxs("div",{className:"flex h-full relative",children:[c.jsxs("div",{className:"fixed inset-0 -z-50 pointer-events-none overflow-hidden bg-[hsl(224,30%,6%)]",children:[c.jsx("div",{className:"absolute inset-0 opacity-35 animate-aurora bg-gradient-to-tr from-teal-500/20 via-indigo-500/15 to-purple-500/20 blur-[130px]"}),c.jsx("div",{className:"absolute top-[-10%] left-[-10%] h-[50%] w-[50%] rounded-full bg-teal-500/15 blur-[160px]"}),c.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-[50%] w-[50%] rounded-full bg-purple-500/15 blur-[160px]"}),c.jsx("div",{className:"absolute top-[30%] right-[20%] h-[40%] w-[40%] rounded-full bg-indigo-500/10 blur-[140px]"})]}),c.jsx(M3,{onNavigate:t}),c.jsx(gY,{open:a,onClose:()=>o(!1),defaultTab:u}),c.jsxs("aside",{className:fe("flex shrink-0 flex-col border-r border-border/40 bg-card/45 backdrop-blur-md transition-all duration-300 ease-in-out",r?"w-16":"w-60"),children:[c.jsxs("div",{className:fe("flex items-center py-4 border-b border-border/40 shrink-0",r?"flex-col gap-3 px-2":"justify-between px-5"),children:[c.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[c.jsx("div",{className:"h-7 w-7 rounded-lg bg-primary shadow-md shadow-primary/20 shrink-0"}),!r&&c.jsxs("div",{className:"leading-tight",children:[c.jsx("div",{className:"text-sm font-semibold tracking-wide font-space",children:"Mission Control"}),c.jsx("div",{className:"text-xs text-muted-foreground",children:"2.0"})]})]}),c.jsx("button",{onClick:()=>{n(S=>{const N=!S;return localStorage.setItem("mc_sidebar_collapsed",N.toString()),N})},className:"p-1 rounded-md hover:bg-accent text-muted-foreground transition-colors cursor-pointer",title:r?"Maximieren":"Minimieren",children:r?c.jsx(ZN,{className:"h-4 w-4"}):c.jsx(rI,{className:"h-4 w-4"})})]}),c.jsx("nav",{className:"flex-1 space-y-1 px-3 py-4 overflow-y-auto",children:Yv.map(S=>c.jsxs("button",{onClick:()=>t(S.id),className:fe("flex w-full items-center rounded-md text-sm transition-all cursor-pointer",r?"justify-center p-2.5":"gap-3 px-3 py-2",e===S.id?"bg-primary/15 text-primary shadow-sm shadow-primary/5":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),title:r?S.label:void 0,children:[c.jsx(S.icon,{className:"h-4.5 w-4.5 shrink-0"}),!r&&c.jsx("span",{className:"truncate",children:S.label})]},S.id))}),c.jsx("div",{className:fe("py-3 text-xs text-muted-foreground border-t border-border/40 shrink-0",r?"px-2 text-center":"px-5"),children:r?c.jsx("div",{className:"flex justify-center",children:c.jsx("span",{className:fe("h-2.5 w-2.5 rounded-full ring-2 ring-black/40",f?f.engine_reachable?"bg-emerald-500 animate-pulse":"bg-amber-500":"bg-red-500"),title:f?`Engine ${f.engine_reachable?"online":"offline"}`:"Backend offline"})}):c.jsxs("div",{className:"space-y-2 text-left",children:[f?c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:fe("h-2 w-2 rounded-full animate-pulse",f.engine_reachable?"bg-emerald-500":"bg-amber-500")}),c.jsxs("span",{className:"truncate",children:["Engine ",f.engine_reachable?"online":"offline"]})]}):c.jsxs("span",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"h-2 w-2 rounded-full bg-red-500"})," ",c.jsx("span",{className:"truncate",children:"Backend offline"})]}),(h==null?void 0:h.versions)&&c.jsxs("div",{className:"space-y-1 text-[9px] text-muted-foreground/60 mt-2 pt-2 border-t border-border/30",children:[c.jsxs("div",{className:"truncate",title:h.versions.mc2?`${h.versions.mc2.branch}-${h.versions.mc2.hash}${h.versions.mc2.dirty?"*":""} (${h.versions.mc2.date})`:"nicht gefunden",children:[c.jsx("strong",{children:"MC2:"})," ",h.versions.mc2?`${h.versions.mc2.hash}${h.versions.mc2.dirty?"*":""}`:"—"]}),c.jsxs("div",{className:"truncate",title:((v=h.versions.engine)==null?void 0:v.type)==="git"?`${h.versions.engine.branch}-${h.versions.engine.hash}${h.versions.engine.dirty?"*":""} (${h.versions.engine.date})`:((x=h.versions.engine)==null?void 0:x.version_text)||"unbekannt",children:[c.jsx("strong",{children:"Engine:"})," ",((b=h.versions.engine)==null?void 0:b.type)==="git"?`${h.versions.engine.hash}${h.versions.engine.dirty?"*":""}`:((j=(k=h.versions.engine)==null?void 0:k.version_text)==null?void 0:j.split(" ").pop())||"—"]}),c.jsxs("div",{className:"truncate",title:h.versions.hermes_ui?`${h.versions.hermes_ui.branch}-${h.versions.hermes_ui.hash}${h.versions.hermes_ui.dirty?"*":""} (${h.versions.hermes_ui.date})`:"nicht gefunden",children:[c.jsx("strong",{children:"Hermes UI:"})," ",h.versions.hermes_ui?`${h.versions.hermes_ui.hash}${h.versions.hermes_ui.dirty?"*":""}`:"—"]}),c.jsxs("div",{className:"truncate",title:h.versions.hermes_agent?`${h.versions.hermes_agent.branch}-${h.versions.hermes_agent.hash}${h.versions.hermes_agent.dirty?"*":""} (${h.versions.hermes_agent.date})`:"nicht gefunden",children:[c.jsx("strong",{children:"Hermes Agent:"})," ",h.versions.hermes_agent?`${h.versions.hermes_agent.hash}${h.versions.hermes_agent.dirty?"*":""}`:"—"]})]})]})})]}),c.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[c.jsxs("header",{className:"flex h-14 shrink-0 items-center justify-between border-b border-border/40 px-6 bg-card/20 backdrop-blur-sm",children:[c.jsx("div",{className:"text-xs font-medium text-muted-foreground tracking-wide uppercase font-sans",children:p.hint}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("a",{href:"https://git.tobisniceshomelab.ddnsfree.com/Hitonabi/mission-control-v2/src/branch/main/docs/BEDIENUNG.md",target:"_blank",rel:"noopener",className:"flex h-8 items-center rounded-md border border-border/40 bg-background/40 px-2.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer font-semibold",title:"Bedien-Anleitung",children:"Hilfe"}),c.jsxs("button",{onClick:()=>{const S=new KeyboardEvent("keydown",{key:"k",metaKey:!0});document.dispatchEvent(S)},className:"flex items-center gap-2 rounded-md border border-border/40 bg-background/40 px-2.5 py-1.5 text-xs text-muted-foreground hover:bg-accent hover:text-accent-foreground transition-all cursor-pointer",children:[c.jsx(oI,{className:"h-3.5 w-3.5"}),c.jsx("span",{children:"Suchen"}),c.jsx("kbd",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-[9px]",children:"⌘K"})]})]})]}),c.jsxs("main",{className:"flex-1 overflow-y-auto p-6 scrollbar-thin",children:[e==="dashboard"&&c.jsx(YQ,{}),e==="models"&&c.jsx(nY,{}),e==="connect"&&c.jsx(iY,{}),e==="memory"&&c.jsx(dY,{}),e==="agent"&&c.jsx(fY,{}),e==="terminal"&&c.jsx(hY,{}),e==="guide"&&c.jsx(pY,{}),!["dashboard","models","connect","memory","agent","terminal","guide"].includes(e)&&c.jsx(mY,{title:p.label,hint:p.hint})]})]})]})}const xY=new LM({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5e3}}});fM.createRoot(document.getElementById("root")).render(c.jsx(RN.StrictMode,{children:c.jsx(zM,{client:xY,children:c.jsx(yY,{})})}));export{RN as R,Y1 as S,Qv as T,Fs as a,wI as b,dM as c,ty as g,c as j,dC as l,y as r}; diff --git a/frontend/dist/assets/index-SuFuJOVE.css b/frontend/dist/assets/index-SuFuJOVE.css deleted file mode 100644 index c6e1530..0000000 --- a/frontend/dist/assets/index-SuFuJOVE.css +++ /dev/null @@ -1 +0,0 @@ -@import"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Space+Grotesk:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap";/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-pan-x:initial;--tw-pan-y:initial;--tw-pinch-zoom:initial;--tw-space-y-reverse:0;--tw-space-x-reverse:0;--tw-divide-x-reverse:0;--tw-border-style:solid;--tw-divide-y-reverse:0;--tw-gradient-position:initial;--tw-gradient-from:#0000;--tw-gradient-via:#0000;--tw-gradient-to:#0000;--tw-gradient-stops:initial;--tw-gradient-via-stops:initial;--tw-gradient-from-position:0%;--tw-gradient-via-position:50%;--tw-gradient-to-position:100%;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-ease:initial;--tw-scale-x:1;--tw-scale-y:1;--tw-scale-z:1}}}@layer theme{:root,:host{--font-sans:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--color-red-300:oklch(80.8% .114 19.571);--color-red-400:oklch(70.4% .191 22.216);--color-red-500:oklch(63.7% .237 25.331);--color-orange-300:oklch(83.7% .128 66.29);--color-orange-500:oklch(70.5% .213 47.604);--color-amber-300:oklch(87.9% .169 91.605);--color-amber-400:oklch(82.8% .189 84.429);--color-amber-500:oklch(76.9% .188 70.08);--color-emerald-300:oklch(84.5% .143 164.978);--color-emerald-400:oklch(76.5% .177 163.223);--color-emerald-500:oklch(69.6% .17 162.48);--color-teal-400:oklch(77.7% .152 181.912);--color-teal-500:oklch(70.4% .14 182.503);--color-cyan-200:oklch(91.7% .08 205.041);--color-cyan-300:oklch(86.5% .127 207.078);--color-cyan-400:oklch(78.9% .154 211.53);--color-cyan-500:oklch(71.5% .143 215.221);--color-sky-500:oklch(68.5% .169 237.323);--color-blue-300:oklch(80.9% .105 251.813);--color-blue-500:oklch(62.3% .214 259.815);--color-indigo-300:oklch(78.5% .115 274.713);--color-indigo-400:oklch(67.3% .182 276.935);--color-indigo-500:oklch(58.5% .233 277.117);--color-violet-400:oklch(70.2% .183 293.541);--color-violet-500:oklch(60.6% .25 292.717);--color-purple-300:oklch(82.7% .119 306.383);--color-purple-500:oklch(62.7% .265 303.9);--color-pink-400:oklch(71.8% .202 349.761);--color-pink-500:oklch(65.6% .241 354.308);--color-slate-300:oklch(86.9% .022 252.894);--color-slate-500:oklch(55.4% .046 257.417);--color-black:#000;--color-white:#fff;--spacing:.25rem;--container-xs:20rem;--container-sm:24rem;--container-md:28rem;--container-lg:32rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--text-3xl:1.875rem;--text-3xl--line-height: 1.2 ;--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--tracking-tight:-.025em;--tracking-wide:.025em;--tracking-wider:.05em;--leading-tight:1.25;--leading-normal:1.5;--leading-relaxed:1.625;--radius-xl:.75rem;--radius-2xl:1rem;--ease-in:cubic-bezier(.4, 0, 1, 1);--ease-out:cubic-bezier(0, 0, .2, 1);--ease-in-out:cubic-bezier(.4, 0, .2, 1);--animate-spin:spin 1s linear infinite;--animate-ping:ping 1s cubic-bezier(0, 0, .2, 1) infinite;--animate-pulse:pulse 2s cubic-bezier(.4, 0, .6, 1) infinite;--blur-sm:8px;--blur-md:12px;--blur-xl:24px;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:"Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;--default-mono-font-family:"JetBrains Mono", ui-monospace, SFMono-Regular, monospace}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.not-sr-only{clip-path:none;white-space:normal;width:auto;height:auto;margin:0;padding:0;position:static;overflow:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{inset-block:0}.top-2\.5{top:calc(var(--spacing) * 2.5)}.top-\[-10\%\]{top:-10%}.top-\[30\%\]{top:30%}.right-0{right:0}.right-\[-10\%\]{right:-10%}.right-\[20\%\]{right:20%}.bottom-\[-10\%\]{bottom:-10%}.left-3{left:calc(var(--spacing) * 3)}.left-\[-10\%\]{left:-10%}.isolate{isolation:isolate}.isolation-auto{isolation:auto}.-z-50{z-index:-50}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[99\]{z-index:99}.col-span-full{grid-column:1/-1}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mt-0\.5{margin-top:calc(var(--spacing) * .5)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-2\.5{margin-top:calc(var(--spacing) * 2.5)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-3\.5{margin-top:calc(var(--spacing) * 3.5)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-1{margin-bottom:var(--spacing)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-0\.5{margin-left:calc(var(--spacing) * .5)}.ml-1{margin-left:var(--spacing)}.ml-auto{margin-left:auto}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.block{display:block}.contents{display:contents}.flex{display:flex}.flow-root{display:flow-root}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.inline-grid{display:inline-grid}.inline-table{display:inline-table}.list-item{display:list-item}.table{display:table}.table-caption{display:table-caption}.table-cell{display:table-cell}.table-column{display:table-column}.table-column-group{display:table-column-group}.table-footer-group{display:table-footer-group}.table-header-group{display:table-header-group}.table-row{display:table-row}.table-row-group{display:table-row-group}.h-1\.5{height:calc(var(--spacing) * 1.5)}.h-2{height:calc(var(--spacing) * 2)}.h-2\.5{height:calc(var(--spacing) * 2.5)}.h-3{height:calc(var(--spacing) * 3)}.h-3\.5{height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-4\.5{height:calc(var(--spacing) * 4.5)}.h-5{height:calc(var(--spacing) * 5)}.h-5\.5{height:calc(var(--spacing) * 5.5)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-9{height:calc(var(--spacing) * 9)}.h-10{height:calc(var(--spacing) * 10)}.h-11{height:calc(var(--spacing) * 11)}.h-14{height:calc(var(--spacing) * 14)}.h-16{height:calc(var(--spacing) * 16)}.h-20{height:calc(var(--spacing) * 20)}.h-24{height:calc(var(--spacing) * 24)}.h-28{height:calc(var(--spacing) * 28)}.h-44{height:calc(var(--spacing) * 44)}.h-96{height:calc(var(--spacing) * 96)}.h-\[40\%\]{height:40%}.h-\[50\%\]{height:50%}.h-\[150px\]{height:150px}.h-full{height:100%}.max-h-20{max-height:calc(var(--spacing) * 20)}.max-h-36{max-height:calc(var(--spacing) * 36)}.max-h-48{max-height:calc(var(--spacing) * 48)}.max-h-60{max-height:calc(var(--spacing) * 60)}.max-h-64{max-height:calc(var(--spacing) * 64)}.max-h-72{max-height:calc(var(--spacing) * 72)}.max-h-80{max-height:calc(var(--spacing) * 80)}.min-h-\[68vh\]{min-height:68vh}.min-h-\[90px\]{min-height:90px}.min-h-\[300px\]{min-height:300px}.w-1\.5{width:calc(var(--spacing) * 1.5)}.w-2{width:calc(var(--spacing) * 2)}.w-2\.5{width:calc(var(--spacing) * 2.5)}.w-3{width:calc(var(--spacing) * 3)}.w-3\.5{width:calc(var(--spacing) * 3.5)}.w-4{width:calc(var(--spacing) * 4)}.w-4\.5{width:calc(var(--spacing) * 4.5)}.w-5{width:calc(var(--spacing) * 5)}.w-5\.5{width:calc(var(--spacing) * 5.5)}.w-7{width:calc(var(--spacing) * 7)}.w-8{width:calc(var(--spacing) * 8)}.w-9{width:calc(var(--spacing) * 9)}.w-10{width:calc(var(--spacing) * 10)}.w-16{width:calc(var(--spacing) * 16)}.w-28{width:calc(var(--spacing) * 28)}.w-36{width:calc(var(--spacing) * 36)}.w-40{width:calc(var(--spacing) * 40)}.w-44{width:calc(var(--spacing) * 44)}.w-60{width:calc(var(--spacing) * 60)}.w-\[40\%\]{width:40%}.w-\[50\%\]{width:50%}.w-full{width:100%}.max-w-\[120px\]{max-width:120px}.max-w-\[150px\]{max-width:150px}.max-w-\[200px\]{max-width:200px}.max-w-\[250px\]{max-width:250px}.max-w-\[260px\]{max-width:260px}.max-w-\[280px\]{max-width:280px}.max-w-fit{max-width:fit-content}.max-w-full{max-width:100%}.max-w-lg{max-width:var(--container-lg)}.max-w-md{max-width:var(--container-md)}.max-w-sm{max-width:var(--container-sm)}.max-w-xs{max-width:var(--container-xs)}.min-w-0{min-width:0}.flex-1{flex:1}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.grow{flex-grow:1}.border-collapse{border-collapse:collapse}.-translate-x-1\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-0{--tw-translate-x:0;translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-full{--tw-translate-x:100%;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-ping{animation:var(--animate-ping)}.animate-pulse{animation:var(--animate-pulse)}.animate-spin{animation:var(--animate-spin)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.touch-pinch-zoom{--tw-pinch-zoom:pinch-zoom;touch-action:var(--tw-pan-x,) var(--tw-pan-y,) var(--tw-pinch-zoom,)}.resize{resize:both}.resize-none{resize:none}.scrollbar-thin{scrollbar-width:thin}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-baseline{align-items:baseline}.items-center{align-items:center}.items-end{align-items:flex-end}.items-start{align-items:flex-start}.items-stretch{align-items:stretch}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-0\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}:where(.space-y-0\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * .5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * .5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(var(--spacing) * var(--tw-space-y-reverse));margin-block-end:calc(var(--spacing) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-1\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-2\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 2.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-3\.5>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 3.5) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 3.5) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-7>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 7) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 7) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-8>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}:where(.space-y-reverse>:not(:last-child)){--tw-space-y-reverse:1}.gap-x-3{column-gap:calc(var(--spacing) * 3)}.gap-x-4{column-gap:calc(var(--spacing) * 4)}:where(.space-x-reverse>:not(:last-child)){--tw-space-x-reverse:1}.gap-y-1{row-gap:var(--spacing)}.gap-y-1\.5{row-gap:calc(var(--spacing) * 1.5)}:where(.divide-x>:not(:last-child)){--tw-divide-x-reverse:0;border-inline-style:var(--tw-border-style);border-inline-start-width:calc(1px * var(--tw-divide-x-reverse));border-inline-end-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))}:where(.divide-y>:not(:last-child)){--tw-divide-y-reverse:0;border-bottom-style:var(--tw-border-style);border-top-style:var(--tw-border-style);border-top-width:calc(1px * var(--tw-divide-y-reverse));border-bottom-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))}:where(.divide-y-reverse>:not(:last-child)){--tw-divide-y-reverse:1}.self-end{align-self:flex-end}.self-start{align-self:flex-start}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-ss{border-start-start-radius:.25rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-se{border-start-end-radius:.25rem}.rounded-ee{border-end-end-radius:.25rem}.rounded-es{border-end-start-radius:.25rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-tl{border-top-left-radius:.25rem}.rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.rounded-tr{border-top-right-radius:.25rem}.rounded-b{border-bottom-right-radius:.25rem;border-bottom-left-radius:.25rem}.rounded-br{border-bottom-right-radius:.25rem}.rounded-bl{border-bottom-left-radius:.25rem}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-x{border-inline-style:var(--tw-border-style);border-inline-width:1px}.border-y{border-block-style:var(--tw-border-style);border-block-width:1px}.border-s{border-inline-start-style:var(--tw-border-style);border-inline-start-width:1px}.border-e{border-inline-end-style:var(--tw-border-style);border-inline-end-width:1px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-b-2{border-bottom-style:var(--tw-border-style);border-bottom-width:2px}.border-l{border-left-style:var(--tw-border-style);border-left-width:1px}.border-l-4{border-left-style:var(--tw-border-style);border-left-width:4px}.border-dashed{--tw-border-style:dashed;border-style:dashed}.border-amber-500\/20{border-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/20{border-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.border-amber-500\/25{border-color:#f99c0040}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/25{border-color:color-mix(in oklab,var(--color-amber-500) 25%,transparent)}}.border-amber-500\/30{border-color:#f99c004d}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/30{border-color:color-mix(in oklab,var(--color-amber-500) 30%,transparent)}}.border-amber-500\/40{border-color:#f99c0066}@supports (color:color-mix(in lab,red,red)){.border-amber-500\/40{border-color:color-mix(in oklab,var(--color-amber-500) 40%,transparent)}}.border-blue-500\/30{border-color:#3080ff4d}@supports (color:color-mix(in lab,red,red)){.border-blue-500\/30{border-color:color-mix(in oklab,var(--color-blue-500) 30%,transparent)}}.border-border,.border-border\/10{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/10{border-color:color-mix(in oklab,hsl(var(--border)) 10%,transparent)}}.border-border\/20{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/20{border-color:color-mix(in oklab,hsl(var(--border)) 20%,transparent)}}.border-border\/30{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/30{border-color:color-mix(in oklab,hsl(var(--border)) 30%,transparent)}}.border-border\/40{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/40{border-color:color-mix(in oklab,hsl(var(--border)) 40%,transparent)}}.border-border\/50{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/50{border-color:color-mix(in oklab,hsl(var(--border)) 50%,transparent)}}.border-border\/60{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/60{border-color:color-mix(in oklab,hsl(var(--border)) 60%,transparent)}}.border-border\/70{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/70{border-color:color-mix(in oklab,hsl(var(--border)) 70%,transparent)}}.border-border\/80{border-color:hsl(var(--border))}@supports (color:color-mix(in lab,red,red)){.border-border\/80{border-color:color-mix(in oklab,hsl(var(--border)) 80%,transparent)}}.border-cyan-500\/20{border-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/20{border-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.border-cyan-500\/25{border-color:#00b7d740}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/25{border-color:color-mix(in oklab,var(--color-cyan-500) 25%,transparent)}}.border-cyan-500\/30{border-color:#00b7d74d}@supports (color:color-mix(in lab,red,red)){.border-cyan-500\/30{border-color:color-mix(in oklab,var(--color-cyan-500) 30%,transparent)}}.border-emerald-500\/10{border-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/10{border-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.border-emerald-500\/15{border-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/15{border-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.border-emerald-500\/20{border-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/20{border-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.border-emerald-500\/30{border-color:#00bb7f4d}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/30{border-color:color-mix(in oklab,var(--color-emerald-500) 30%,transparent)}}.border-emerald-500\/40{border-color:#00bb7f66}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/40{border-color:color-mix(in oklab,var(--color-emerald-500) 40%,transparent)}}.border-emerald-500\/50{border-color:#00bb7f80}@supports (color:color-mix(in lab,red,red)){.border-emerald-500\/50{border-color:color-mix(in oklab,var(--color-emerald-500) 50%,transparent)}}.border-indigo-500\/25{border-color:#625fff40}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/25{border-color:color-mix(in oklab,var(--color-indigo-500) 25%,transparent)}}.border-indigo-500\/30{border-color:#625fff4d}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/30{border-color:color-mix(in oklab,var(--color-indigo-500) 30%,transparent)}}.border-indigo-500\/40{border-color:#625fff66}@supports (color:color-mix(in lab,red,red)){.border-indigo-500\/40{border-color:color-mix(in oklab,var(--color-indigo-500) 40%,transparent)}}.border-orange-500\/30{border-color:#fe6e004d}@supports (color:color-mix(in lab,red,red)){.border-orange-500\/30{border-color:color-mix(in oklab,var(--color-orange-500) 30%,transparent)}}.border-pink-500\/25{border-color:#f6339a40}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/25{border-color:color-mix(in oklab,var(--color-pink-500) 25%,transparent)}}.border-pink-500\/30{border-color:#f6339a4d}@supports (color:color-mix(in lab,red,red)){.border-pink-500\/30{border-color:color-mix(in oklab,var(--color-pink-500) 30%,transparent)}}.border-primary,.border-primary\/20{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/20{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.border-primary\/30{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/30{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.border-primary\/40{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/40{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.border-primary\/45{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/45{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.border-primary\/50{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.border-primary\/50{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.border-purple-500\/30{border-color:#ac4bff4d}@supports (color:color-mix(in lab,red,red)){.border-purple-500\/30{border-color:color-mix(in oklab,var(--color-purple-500) 30%,transparent)}}.border-red-500\/20{border-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.border-red-500\/20{border-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.border-red-500\/25{border-color:#fb2c3640}@supports (color:color-mix(in lab,red,red)){.border-red-500\/25{border-color:color-mix(in oklab,var(--color-red-500) 25%,transparent)}}.border-red-500\/30{border-color:#fb2c364d}@supports (color:color-mix(in lab,red,red)){.border-red-500\/30{border-color:color-mix(in oklab,var(--color-red-500) 30%,transparent)}}.border-red-500\/40{border-color:#fb2c3666}@supports (color:color-mix(in lab,red,red)){.border-red-500\/40{border-color:color-mix(in oklab,var(--color-red-500) 40%,transparent)}}.border-slate-500\/25{border-color:#62748e40}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/25{border-color:color-mix(in oklab,var(--color-slate-500) 25%,transparent)}}.border-slate-500\/30{border-color:#62748e4d}@supports (color:color-mix(in lab,red,red)){.border-slate-500\/30{border-color:color-mix(in oklab,var(--color-slate-500) 30%,transparent)}}.border-teal-500\/25{border-color:#00baa740}@supports (color:color-mix(in lab,red,red)){.border-teal-500\/25{border-color:color-mix(in oklab,var(--color-teal-500) 25%,transparent)}}.border-transparent{border-color:#0000}.border-violet-500\/20{border-color:#8d54ff33}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/20{border-color:color-mix(in oklab,var(--color-violet-500) 20%,transparent)}}.border-violet-500\/25{border-color:#8d54ff40}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/25{border-color:color-mix(in oklab,var(--color-violet-500) 25%,transparent)}}.border-violet-500\/30{border-color:#8d54ff4d}@supports (color:color-mix(in lab,red,red)){.border-violet-500\/30{border-color:color-mix(in oklab,var(--color-violet-500) 30%,transparent)}}.border-l-amber-500\/80{border-left-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.border-l-amber-500\/80{border-left-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.border-l-cyan-500\/80{border-left-color:#00b7d7cc}@supports (color:color-mix(in lab,red,red)){.border-l-cyan-500\/80{border-left-color:color-mix(in oklab,var(--color-cyan-500) 80%,transparent)}}.border-l-indigo-500\/80{border-left-color:#625fffcc}@supports (color:color-mix(in lab,red,red)){.border-l-indigo-500\/80{border-left-color:color-mix(in oklab,var(--color-indigo-500) 80%,transparent)}}.border-l-muted{border-left-color:hsl(var(--muted))}.border-l-pink-500\/80{border-left-color:#f6339acc}@supports (color:color-mix(in lab,red,red)){.border-l-pink-500\/80{border-left-color:color-mix(in oklab,var(--color-pink-500) 80%,transparent)}}.border-l-violet-500\/80{border-left-color:#8d54ffcc}@supports (color:color-mix(in lab,red,red)){.border-l-violet-500\/80{border-left-color:color-mix(in oklab,var(--color-violet-500) 80%,transparent)}}.bg-\[hsl\(224\,30\%\,6\%\)\]{background-color:#0b0d14}.bg-amber-400{background-color:var(--color-amber-400)}.bg-amber-500{background-color:var(--color-amber-500)}.bg-amber-500\/5{background-color:#f99c000d}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/5{background-color:color-mix(in oklab,var(--color-amber-500) 5%,transparent)}}.bg-amber-500\/10{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/10{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.bg-amber-500\/15{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/15{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.bg-amber-500\/20{background-color:#f99c0033}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/20{background-color:color-mix(in oklab,var(--color-amber-500) 20%,transparent)}}.bg-amber-500\/80{background-color:#f99c00cc}@supports (color:color-mix(in lab,red,red)){.bg-amber-500\/80{background-color:color-mix(in oklab,var(--color-amber-500) 80%,transparent)}}.bg-background\/10{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/10{background-color:color-mix(in oklab,hsl(var(--background)) 10%,transparent)}}.bg-background\/20{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/20{background-color:color-mix(in oklab,hsl(var(--background)) 20%,transparent)}}.bg-background\/25{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/25{background-color:color-mix(in oklab,hsl(var(--background)) 25%,transparent)}}.bg-background\/30{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/30{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.bg-background\/35{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/35{background-color:color-mix(in oklab,hsl(var(--background)) 35%,transparent)}}.bg-background\/40{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/40{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.bg-background\/50{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.bg-background\/50{background-color:color-mix(in oklab,hsl(var(--background)) 50%,transparent)}}.bg-black\/10{background-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.bg-black\/10{background-color:color-mix(in oklab,var(--color-black) 10%,transparent)}}.bg-black\/20{background-color:#0003}@supports (color:color-mix(in lab,red,red)){.bg-black\/20{background-color:color-mix(in oklab,var(--color-black) 20%,transparent)}}.bg-black\/25{background-color:#00000040}@supports (color:color-mix(in lab,red,red)){.bg-black\/25{background-color:color-mix(in oklab,var(--color-black) 25%,transparent)}}.bg-black\/30{background-color:#0000004d}@supports (color:color-mix(in lab,red,red)){.bg-black\/30{background-color:color-mix(in oklab,var(--color-black) 30%,transparent)}}.bg-black\/40{background-color:#0006}@supports (color:color-mix(in lab,red,red)){.bg-black\/40{background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab,red,red)){.bg-black\/50{background-color:color-mix(in oklab,var(--color-black) 50%,transparent)}}.bg-black\/60{background-color:#0009}@supports (color:color-mix(in lab,red,red)){.bg-black\/60{background-color:color-mix(in oklab,var(--color-black) 60%,transparent)}}.bg-black\/70{background-color:#000000b3}@supports (color:color-mix(in lab,red,red)){.bg-black\/70{background-color:color-mix(in oklab,var(--color-black) 70%,transparent)}}.bg-blue-500\/20{background-color:#3080ff33}@supports (color:color-mix(in lab,red,red)){.bg-blue-500\/20{background-color:color-mix(in oklab,var(--color-blue-500) 20%,transparent)}}.bg-card,.bg-card\/10{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/10{background-color:color-mix(in oklab,hsl(var(--card)) 10%,transparent)}}.bg-card\/20{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/20{background-color:color-mix(in oklab,hsl(var(--card)) 20%,transparent)}}.bg-card\/30{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/30{background-color:color-mix(in oklab,hsl(var(--card)) 30%,transparent)}}.bg-card\/45{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/45{background-color:color-mix(in oklab,hsl(var(--card)) 45%,transparent)}}.bg-card\/50{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/50{background-color:color-mix(in oklab,hsl(var(--card)) 50%,transparent)}}.bg-card\/75{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/75{background-color:color-mix(in oklab,hsl(var(--card)) 75%,transparent)}}.bg-card\/85{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/85{background-color:color-mix(in oklab,hsl(var(--card)) 85%,transparent)}}.bg-card\/90{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.bg-card\/90{background-color:color-mix(in oklab,hsl(var(--card)) 90%,transparent)}}.bg-cyan-400{background-color:var(--color-cyan-400)}.bg-cyan-500\/10{background-color:#00b7d71a}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/10{background-color:color-mix(in oklab,var(--color-cyan-500) 10%,transparent)}}.bg-cyan-500\/15{background-color:#00b7d726}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/15{background-color:color-mix(in oklab,var(--color-cyan-500) 15%,transparent)}}.bg-cyan-500\/20{background-color:#00b7d733}@supports (color:color-mix(in lab,red,red)){.bg-cyan-500\/20{background-color:color-mix(in oklab,var(--color-cyan-500) 20%,transparent)}}.bg-emerald-400{background-color:var(--color-emerald-400)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-emerald-500\/5{background-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/5{background-color:color-mix(in oklab,var(--color-emerald-500) 5%,transparent)}}.bg-emerald-500\/10{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/10{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.bg-emerald-500\/15{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/15{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.bg-emerald-500\/20{background-color:#00bb7f33}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/20{background-color:color-mix(in oklab,var(--color-emerald-500) 20%,transparent)}}.bg-emerald-500\/80{background-color:#00bb7fcc}@supports (color:color-mix(in lab,red,red)){.bg-emerald-500\/80{background-color:color-mix(in oklab,var(--color-emerald-500) 80%,transparent)}}.bg-indigo-500\/5{background-color:#625fff0d}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/5{background-color:color-mix(in oklab,var(--color-indigo-500) 5%,transparent)}}.bg-indigo-500\/10{background-color:#625fff1a}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/10{background-color:color-mix(in oklab,var(--color-indigo-500) 10%,transparent)}}.bg-indigo-500\/15{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.bg-indigo-500\/15{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.bg-muted,.bg-muted\/10{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/10{background-color:color-mix(in oklab,hsl(var(--muted)) 10%,transparent)}}.bg-muted\/20{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/20{background-color:color-mix(in oklab,hsl(var(--muted)) 20%,transparent)}}.bg-muted\/40{background-color:hsl(var(--muted))}@supports (color:color-mix(in lab,red,red)){.bg-muted\/40{background-color:color-mix(in oklab,hsl(var(--muted)) 40%,transparent)}}.bg-orange-500\/20{background-color:#fe6e0033}@supports (color:color-mix(in lab,red,red)){.bg-orange-500\/20{background-color:color-mix(in oklab,var(--color-orange-500) 20%,transparent)}}.bg-pink-500\/10{background-color:#f6339a1a}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/10{background-color:color-mix(in oklab,var(--color-pink-500) 10%,transparent)}}.bg-pink-500\/15{background-color:#f6339a26}@supports (color:color-mix(in lab,red,red)){.bg-pink-500\/15{background-color:color-mix(in oklab,var(--color-pink-500) 15%,transparent)}}.bg-popover,.bg-popover\/95{background-color:hsl(var(--popover))}@supports (color:color-mix(in lab,red,red)){.bg-popover\/95{background-color:color-mix(in oklab,hsl(var(--popover)) 95%,transparent)}}.bg-primary,.bg-primary\/5{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/5{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.bg-primary\/10{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/10{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.bg-primary\/15{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/15{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.bg-primary\/20{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.bg-primary\/20{background-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.bg-purple-500\/15{background-color:#ac4bff26}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/15{background-color:color-mix(in oklab,var(--color-purple-500) 15%,transparent)}}.bg-purple-500\/20{background-color:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.bg-purple-500\/20{background-color:color-mix(in oklab,var(--color-purple-500) 20%,transparent)}}.bg-red-500{background-color:var(--color-red-500)}.bg-red-500\/5{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/5{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.bg-red-500\/10{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/10{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.bg-red-500\/15{background-color:#fb2c3626}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/15{background-color:color-mix(in oklab,var(--color-red-500) 15%,transparent)}}.bg-red-500\/20{background-color:#fb2c3633}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/20{background-color:color-mix(in oklab,var(--color-red-500) 20%,transparent)}}.bg-red-500\/80{background-color:#fb2c36cc}@supports (color:color-mix(in lab,red,red)){.bg-red-500\/80{background-color:color-mix(in oklab,var(--color-red-500) 80%,transparent)}}.bg-slate-500\/15{background-color:#62748e26}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/15{background-color:color-mix(in oklab,var(--color-slate-500) 15%,transparent)}}.bg-slate-500\/20{background-color:#62748e33}@supports (color:color-mix(in lab,red,red)){.bg-slate-500\/20{background-color:color-mix(in oklab,var(--color-slate-500) 20%,transparent)}}.bg-teal-500\/15{background-color:#00baa726}@supports (color:color-mix(in lab,red,red)){.bg-teal-500\/15{background-color:color-mix(in oklab,var(--color-teal-500) 15%,transparent)}}.bg-transparent{background-color:#0000}.bg-violet-500\/10{background-color:#8d54ff1a}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/10{background-color:color-mix(in oklab,var(--color-violet-500) 10%,transparent)}}.bg-violet-500\/15{background-color:#8d54ff26}@supports (color:color-mix(in lab,red,red)){.bg-violet-500\/15{background-color:color-mix(in oklab,var(--color-violet-500) 15%,transparent)}}.bg-gradient-to-r{--tw-gradient-position:to right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.bg-gradient-to-tr{--tw-gradient-position:to top right in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-cyan-500{--tw-gradient-from:var(--color-cyan-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-foreground{--tw-gradient-from:hsl(var(--foreground));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-indigo-500{--tw-gradient-from:var(--color-indigo-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-purple-500{--tw-gradient-from:var(--color-purple-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500{--tw-gradient-from:var(--color-teal-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-teal-500\/20{--tw-gradient-from:#00baa733}@supports (color:color-mix(in lab,red,red)){.from-teal-500\/20{--tw-gradient-from:color-mix(in oklab, var(--color-teal-500) 20%, transparent)}}.from-teal-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.via-foreground{--tw-gradient-via:hsl(var(--foreground));--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.via-indigo-500\/15{--tw-gradient-via:#625fff26}@supports (color:color-mix(in lab,red,red)){.via-indigo-500\/15{--tw-gradient-via:color-mix(in oklab, var(--color-indigo-500) 15%, transparent)}}.via-indigo-500\/15{--tw-gradient-via-stops:var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-via) var(--tw-gradient-via-position), var(--tw-gradient-to) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-via-stops)}.to-blue-500{--tw-gradient-to:var(--color-blue-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-emerald-500{--tw-gradient-to:var(--color-emerald-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-pink-500{--tw-gradient-to:var(--color-pink-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-primary{--tw-gradient-to:hsl(var(--primary));--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-purple-500\/20{--tw-gradient-to:#ac4bff33}@supports (color:color-mix(in lab,red,red)){.to-purple-500\/20{--tw-gradient-to:color-mix(in oklab, var(--color-purple-500) 20%, transparent)}}.to-purple-500\/20{--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-sky-500{--tw-gradient-to:var(--color-sky-500);--tw-gradient-stops:var(--tw-gradient-via-stops,var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.bg-clip-text{-webkit-background-clip:text;background-clip:text}.bg-repeat{background-repeat:repeat}.fill-amber-400\/20{fill:#fcbb0033}@supports (color:color-mix(in lab,red,red)){.fill-amber-400\/20{fill:color-mix(in oklab,var(--color-amber-400) 20%,transparent)}}.fill-primary\/20{fill:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.fill-primary\/20{fill:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.p-0\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:var(--spacing)}.p-1\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-2\.5{padding:calc(var(--spacing) * 2.5)}.p-3{padding:calc(var(--spacing) * 3)}.p-3\.5{padding:calc(var(--spacing) * 3.5)}.p-4{padding:calc(var(--spacing) * 4)}.p-5{padding:calc(var(--spacing) * 5)}.p-6{padding:calc(var(--spacing) * 6)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:var(--spacing)}.px-1\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.py-0\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:var(--spacing)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-6{padding-block:calc(var(--spacing) * 6)}.py-12{padding-block:calc(var(--spacing) * 12)}.py-20{padding-block:calc(var(--spacing) * 20)}.pt-0\.5{padding-top:calc(var(--spacing) * .5)}.pt-1{padding-top:var(--spacing)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pt-2\.5{padding-top:calc(var(--spacing) * 2.5)}.pt-3{padding-top:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pt-\[12vh\]{padding-top:12vh}.pr-1{padding-right:var(--spacing)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-10{padding-right:calc(var(--spacing) * 10)}.pb-2{padding-bottom:calc(var(--spacing) * 2)}.pb-3{padding-bottom:calc(var(--spacing) * 3)}.pb-px{padding-bottom:1px}.pl-3{padding-left:calc(var(--spacing) * 3)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-6{padding-left:calc(var(--spacing) * 6)}.pl-9{padding-left:calc(var(--spacing) * 9)}.text-center{text-align:center}.text-left{text-align:left}.font-mono{font-family:JetBrains Mono,ui-monospace,SFMono-Regular,monospace}.font-sans{font-family:Inter,ui-sans-serif,system-ui,-apple-system,sans-serif}.font-space{font-family:Space Grotesk,sans-serif}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-3xl{font-size:var(--text-3xl);line-height:var(--tw-leading,var(--text-3xl--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\[7px\]{font-size:7px}.text-\[8px\]{font-size:8px}.text-\[9px\]{font-size:9px}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading:var(--leading-tight);line-height:var(--leading-tight)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-wide{--tw-tracking:var(--tracking-wide);letter-spacing:var(--tracking-wide)}.tracking-wider{--tw-tracking:var(--tracking-wider);letter-spacing:var(--tracking-wider)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.text-clip{text-overflow:clip}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.text-amber-300{color:var(--color-amber-300)}.text-amber-400{color:var(--color-amber-400)}.text-amber-400\/80{color:#fcbb00cc}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/80{color:color-mix(in oklab,var(--color-amber-400) 80%,transparent)}}.text-amber-400\/90{color:#fcbb00e6}@supports (color:color-mix(in lab,red,red)){.text-amber-400\/90{color:color-mix(in oklab,var(--color-amber-400) 90%,transparent)}}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-300{color:var(--color-blue-300)}.text-cyan-200\/90{color:#a2f4fde6}@supports (color:color-mix(in lab,red,red)){.text-cyan-200\/90{color:color-mix(in oklab,var(--color-cyan-200) 90%,transparent)}}.text-cyan-300{color:var(--color-cyan-300)}.text-cyan-300\/90{color:#53eafde6}@supports (color:color-mix(in lab,red,red)){.text-cyan-300\/90{color:color-mix(in oklab,var(--color-cyan-300) 90%,transparent)}}.text-cyan-400{color:var(--color-cyan-400)}.text-emerald-300{color:var(--color-emerald-300)}.text-emerald-400{color:var(--color-emerald-400)}.text-emerald-400\/90{color:#00d294e6}@supports (color:color-mix(in lab,red,red)){.text-emerald-400\/90{color:color-mix(in oklab,var(--color-emerald-400) 90%,transparent)}}.text-foreground,.text-foreground\/90{color:hsl(var(--foreground))}@supports (color:color-mix(in lab,red,red)){.text-foreground\/90{color:color-mix(in oklab,hsl(var(--foreground)) 90%,transparent)}}.text-indigo-300{color:var(--color-indigo-300)}.text-indigo-400{color:var(--color-indigo-400)}.text-muted-foreground,.text-muted-foreground\/50{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/50{color:color-mix(in oklab,hsl(var(--muted-foreground)) 50%,transparent)}}.text-muted-foreground\/55{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/55{color:color-mix(in oklab,hsl(var(--muted-foreground)) 55%,transparent)}}.text-muted-foreground\/60{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/60{color:color-mix(in oklab,hsl(var(--muted-foreground)) 60%,transparent)}}.text-muted-foreground\/70{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/70{color:color-mix(in oklab,hsl(var(--muted-foreground)) 70%,transparent)}}.text-muted-foreground\/75{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/75{color:color-mix(in oklab,hsl(var(--muted-foreground)) 75%,transparent)}}.text-muted-foreground\/80{color:hsl(var(--muted-foreground))}@supports (color:color-mix(in lab,red,red)){.text-muted-foreground\/80{color:color-mix(in oklab,hsl(var(--muted-foreground)) 80%,transparent)}}.text-orange-300{color:var(--color-orange-300)}.text-pink-400{color:var(--color-pink-400)}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/70{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/70{color:color-mix(in oklab,hsl(var(--primary)) 70%,transparent)}}.text-primary\/80{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.text-primary\/80{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.text-purple-300{color:var(--color-purple-300)}.text-red-300{color:var(--color-red-300)}.text-red-400{color:var(--color-red-400)}.text-red-400\/80{color:#ff6568cc}@supports (color:color-mix(in lab,red,red)){.text-red-400\/80{color:color-mix(in oklab,var(--color-red-400) 80%,transparent)}}.text-slate-300{color:var(--color-slate-300)}.text-teal-400{color:var(--color-teal-400)}.text-transparent{color:#0000}.text-violet-400{color:var(--color-violet-400)}.text-white{color:var(--color-white)}.text-white\/95{color:#fffffff2}@supports (color:color-mix(in lab,red,red)){.text-white\/95{color:color-mix(in oklab,var(--color-white) 95%,transparent)}}.capitalize{text-transform:capitalize}.lowercase{text-transform:lowercase}.normal-case{text-transform:none}.uppercase{text-transform:uppercase}.italic{font-style:italic}.not-italic{font-style:normal}.diagonal-fractions{--tw-numeric-fraction:diagonal-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.lining-nums{--tw-numeric-figure:lining-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.oldstyle-nums{--tw-numeric-figure:oldstyle-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.ordinal{--tw-ordinal:ordinal;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.proportional-nums{--tw-numeric-spacing:proportional-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.slashed-zero{--tw-slashed-zero:slashed-zero;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.stacked-fractions{--tw-numeric-fraction:stacked-fractions;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.normal-nums{font-variant-numeric:normal}.line-through{text-decoration-line:line-through}.no-underline{text-decoration-line:none}.overline{text-decoration-line:overline}.underline{text-decoration-line:underline}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.opacity-0{opacity:0}.opacity-35{opacity:.35}.opacity-60{opacity:.6}.opacity-75{opacity:.75}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-2xl{--tw-shadow:0 25px 50px -12px var(--tw-shadow-color,#00000040);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-inner{--tw-shadow:inset 0 2px 4px 0 var(--tw-shadow-color,#0000000d);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px var(--tw-shadow-color,#0000001a), 0 2px 4px -2px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-2{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-amber-500\/10{--tw-shadow-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.shadow-amber-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-amber-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/5{--tw-shadow-color:#0000000d}@supports (color:color-mix(in lab,red,red)){.shadow-black\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/10{--tw-shadow-color:#0000001a}@supports (color:color-mix(in lab,red,red)){.shadow-black\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/15{--tw-shadow-color:#00000026}@supports (color:color-mix(in lab,red,red)){.shadow-black\/15{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 15%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/20{--tw-shadow-color:#0003}@supports (color:color-mix(in lab,red,red)){.shadow-black\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-black\/25{--tw-shadow-color:#00000040}@supports (color:color-mix(in lab,red,red)){.shadow-black\/25{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-black) 25%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/5{--tw-shadow-color:#00bb7f0d}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-emerald-500\/10{--tw-shadow-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.shadow-emerald-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-emerald-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/5{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/5{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 5%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/10{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-primary\/20{--tw-shadow-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.shadow-primary\/20{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, hsl(var(--primary)) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-red-500\/10{--tw-shadow-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.shadow-red-500\/10{--tw-shadow-color:color-mix(in oklab, color-mix(in oklab, var(--color-red-500) 10%, transparent) var(--tw-shadow-alpha), transparent)}}.ring-black\/40{--tw-ring-color:#0006}@supports (color:color-mix(in lab,red,red)){.ring-black\/40{--tw-ring-color:color-mix(in oklab, var(--color-black) 40%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[130px\]{--tw-blur:blur(130px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[140px\]{--tw-blur:blur(140px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.blur-\[160px\]{--tw-blur:blur(160px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.drop-shadow{--tw-drop-shadow-size:drop-shadow(0 1px 2px var(--tw-drop-shadow-color,#0000001a)) drop-shadow(0 1px 1px var(--tw-drop-shadow-color,#0000000f));--tw-drop-shadow:drop-shadow(0 1px 2px #0000001a) drop-shadow(0 1px 1px #0000000f);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.invert{--tw-invert:invert(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.sepia{--tw-sepia:sepia(100%);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.\!filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)!important}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-blur{--tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur:blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur:blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-xl{--tw-backdrop-blur:blur(var(--blur-xl));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-grayscale{--tw-backdrop-grayscale:grayscale(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-invert{--tw-backdrop-invert:invert(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-sepia{--tw-backdrop-sepia:sepia(100%);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition\!{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events!important;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function))!important;transition-duration:var(--tw-duration,var(--default-transition-duration))!important}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-200{--tw-duration:.2s;transition-duration:.2s}.duration-300{--tw-duration:.3s;transition-duration:.3s}.duration-500{--tw-duration:.5s;transition-duration:.5s}.ease-in{--tw-ease:var(--ease-in);transition-timing-function:var(--ease-in)}.ease-in-out{--tw-ease:var(--ease-in-out);transition-timing-function:var(--ease-in-out)}.ease-out{--tw-ease:var(--ease-out);transition-timing-function:var(--ease-out)}.outline-none{--tw-outline-style:none;outline-style:none}.select-all{-webkit-user-select:all;user-select:all}.select-none{-webkit-user-select:none;user-select:none}.select-text{-webkit-user-select:text;user-select:text}:where(.divide-x-reverse>:not(:last-child)){--tw-divide-x-reverse:1}.ring-inset{--tw-ring-inset:inset}@media(hover:hover){.group-hover\:scale-105:is(:where(.group):hover *){--tw-scale-x:105%;--tw-scale-y:105%;--tw-scale-z:105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.group-hover\:text-primary:is(:where(.group):hover *){color:hsl(var(--primary))}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}@media(hover:hover){.hover\:border-primary:hover,.hover\:border-primary\/20:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/20:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:border-primary\/30:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/30:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 30%,transparent)}}.hover\:border-primary\/40:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/40:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 40%,transparent)}}.hover\:border-primary\/45:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/45:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 45%,transparent)}}.hover\:border-primary\/50:hover{border-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:border-primary\/50:hover{border-color:color-mix(in oklab,hsl(var(--primary)) 50%,transparent)}}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-amber-400:hover{background-color:var(--color-amber-400)}.hover\:bg-amber-500\/10:hover{background-color:#f99c001a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/10:hover{background-color:color-mix(in oklab,var(--color-amber-500) 10%,transparent)}}.hover\:bg-amber-500\/15:hover{background-color:#f99c0026}@supports (color:color-mix(in lab,red,red)){.hover\:bg-amber-500\/15:hover{background-color:color-mix(in oklab,var(--color-amber-500) 15%,transparent)}}.hover\:bg-background\/30:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/30:hover{background-color:color-mix(in oklab,hsl(var(--background)) 30%,transparent)}}.hover\:bg-background\/40:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/40:hover{background-color:color-mix(in oklab,hsl(var(--background)) 40%,transparent)}}.hover\:bg-background\/60:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/60:hover{background-color:color-mix(in oklab,hsl(var(--background)) 60%,transparent)}}.hover\:bg-background\/80:hover{background-color:hsl(var(--background))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-background\/80:hover{background-color:color-mix(in oklab,hsl(var(--background)) 80%,transparent)}}.hover\:bg-card\/30:hover{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/30:hover{background-color:color-mix(in oklab,hsl(var(--card)) 30%,transparent)}}.hover\:bg-card\/70:hover{background-color:hsl(var(--card))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-card\/70:hover{background-color:color-mix(in oklab,hsl(var(--card)) 70%,transparent)}}.hover\:bg-emerald-500\/10:hover{background-color:#00bb7f1a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/10:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 10%,transparent)}}.hover\:bg-emerald-500\/15:hover{background-color:#00bb7f26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-emerald-500\/15:hover{background-color:color-mix(in oklab,var(--color-emerald-500) 15%,transparent)}}.hover\:bg-indigo-500\/15:hover{background-color:#625fff26}@supports (color:color-mix(in lab,red,red)){.hover\:bg-indigo-500\/15:hover{background-color:color-mix(in oklab,var(--color-indigo-500) 15%,transparent)}}.hover\:bg-primary\/5:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/5:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 5%,transparent)}}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/10:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 10%,transparent)}}.hover\:bg-primary\/15:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/15:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 15%,transparent)}}.hover\:bg-primary\/20:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/20:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 20%,transparent)}}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/90:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 90%,transparent)}}.hover\:bg-primary\/95:hover{background-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:bg-primary\/95:hover{background-color:color-mix(in oklab,hsl(var(--primary)) 95%,transparent)}}.hover\:bg-red-400:hover{background-color:var(--color-red-400)}.hover\:bg-red-500\/5:hover{background-color:#fb2c360d}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/5:hover{background-color:color-mix(in oklab,var(--color-red-500) 5%,transparent)}}.hover\:bg-red-500\/10:hover{background-color:#fb2c361a}@supports (color:color-mix(in lab,red,red)){.hover\:bg-red-500\/10:hover{background-color:color-mix(in oklab,var(--color-red-500) 10%,transparent)}}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-emerald-300:hover{color:var(--color-emerald-300)}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.hover\:text-primary\/80:hover{color:color-mix(in oklab,hsl(var(--primary)) 80%,transparent)}}.hover\:text-red-300:hover{color:var(--color-red-300)}.hover\:text-red-400:hover{color:var(--color-red-400)}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-90:hover{opacity:.9}}.focus\:border-primary:focus{border-color:hsl(var(--primary))}.focus\:ring-1:focus{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus\:ring-primary:focus,.focus\:ring-primary\/50:focus{--tw-ring-color:hsl(var(--primary))}@supports (color:color-mix(in lab,red,red)){.focus\:ring-primary\/50:focus{--tw-ring-color:color-mix(in oklab, hsl(var(--primary)) 50%, transparent)}}.focus-visible\:ring-2:focus-visible{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\:outline-none:focus-visible{--tw-outline-style:none;outline-style:none}.disabled\:opacity-50:disabled{opacity:.5}.aria-selected\:bg-accent[aria-selected=true]{background-color:hsl(var(--accent))}.aria-selected\:text-accent-foreground[aria-selected=true]{color:hsl(var(--accent-foreground))}@media(min-width:40rem){.sm\:inline{display:inline}.sm\:w-\[500px\]{width:500px}.sm\:max-w-\[400px\]{max-width:400px}.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:self-auto{align-self:auto}}@media(min-width:48rem){.md\:col-span-2{grid-column:span 2/span 2}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-center{align-items:center}}@media(min-width:64rem){.lg\:flex{display:flex}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.lg\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}}}:root{--background:224 30% 6%;--foreground:210 20% 92%;--card:224 25% 10%;--card-foreground:210 20% 94%;--popover:224 28% 9%;--popover-foreground:210 20% 94%;--primary:172 72% 50%;--primary-foreground:224 47% 8%;--muted:220 16% 14%;--muted-foreground:215 14% 64%;--accent:220 16% 16%;--accent-foreground:210 20% 94%;--border:222 18% 23%;--input:222 18% 23%;--ring:172 72% 50%;--radius:.75rem}.light{--background:0 0% 100%;--foreground:222 22% 12%;--card:0 0% 100%;--card-foreground:222 22% 12%;--popover:0 0% 100%;--popover-foreground:222 22% 12%;--primary:172 70% 38%;--primary-foreground:0 0% 100%;--muted:220 14% 95%;--muted-foreground:220 9% 42%;--accent:220 14% 94%;--accent-foreground:222 22% 12%;--border:220 13% 88%;--input:220 13% 88%;--ring:172 66% 50%}@keyframes aurora{0%{background-position:0%}50%{background-position:100%}to{background-position:0%}}.animate-aurora{background-size:200% 200%;animation:25s infinite aurora}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:hsl(var(--border));border-radius:9999px}*{border-color:hsl(var(--border) / .85);outline-color:hsl(var(--primary) / .5)}html,body,#root{height:100%;overflow:hidden}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:var(--font-sans);-webkit-font-smoothing:antialiased;margin:0}@keyframes flow-cyan{0%{stroke-dasharray:6 3;stroke-dashoffset:18px}to{stroke-dasharray:6 3;stroke-dashoffset:0}}.animate-flow-cyan{animation:1.2s linear infinite flow-cyan}.rounded-2xl.border.bg-card\/45{position:relative;overflow:hidden;background-color:hsl(var(--card) / .85)!important;border-color:hsl(var(--border) / .95)!important;transition:all .3s cubic-bezier(.4,0,.2,1)!important;box-shadow:0 10px 30px -15px #00000073,inset 0 1px #ffffff0d!important}.rounded-2xl.border.bg-card\/45:before{content:"";background:linear-gradient(90deg,hsl(var(--primary)),#6366f1,#a855f7);opacity:.75;height:3.5px;position:absolute;top:0;left:0;right:0;transition:opacity .3s!important}.rounded-2xl.border.bg-card\/45:hover{transform:translateY(-3px);background-color:hsl(var(--card) / .92)!important;border-color:hsl(var(--primary) / .35)!important;box-shadow:0 20px 40px -20px #000000a6,0 0 18px 2px hsl(var(--primary) / .05)!important}.rounded-2xl.border.bg-card\/45:hover:before{opacity:1}.rounded-xl.border.bg-card\/45{background-color:hsl(var(--card) / .88)!important;border-color:hsl(var(--border) / .9)!important;transition:all .2s!important}.rounded-xl.border.bg-card\/45:hover{background-color:hsl(var(--card) / .95)!important;border-color:hsl(var(--primary) / .3)!important}aside nav button[class*="bg-primary/15"]:not([class*=justify-center]){background:linear-gradient(90deg,hsl(var(--primary) / .18),#6366f11f)!important;color:hsl(var(--primary))!important;border-left:3.5px solid hsl(var(--primary))!important;border-radius:0 var(--radius) var(--radius) 0!important;padding-left:calc(.75rem - 3.5px)!important;box-shadow:inset 0 1px #ffffff05!important}aside nav button[class*="bg-primary/15"][class*=justify-center]{background:hsl(var(--primary) / .18)!important;color:hsl(var(--primary))!important;box-shadow:0 0 12px 1px hsl(var(--primary) / .1)!important;border:1px solid hsl(var(--primary) / .3)!important}::-webkit-scrollbar-thumb{border-radius:9999px;background:hsl(var(--primary) / .25)!important}::-webkit-scrollbar-thumb:hover{background:hsl(var(--primary) / .5)!important}input:focus,textarea:focus,select:focus{outline:none;border-color:hsl(var(--primary))!important;box-shadow:0 0 0 2px hsl(var(--primary) / .15)!important}@media(min-width:1440px){html{font-size:16.5px}}@media(min-width:1920px){html{font-size:17.5px}}@media(min-width:2560px){html{font-size:19px}}@media(min-width:3440px){html{font-size:20px}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-pan-x{syntax:"*";inherits:false}@property --tw-pan-y{syntax:"*";inherits:false}@property --tw-pinch-zoom{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-space-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-divide-x-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-divide-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-gradient-position{syntax:"*";inherits:false}@property --tw-gradient-from{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-via{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-to{syntax:"";inherits:false;initial-value:#0000}@property --tw-gradient-stops{syntax:"*";inherits:false}@property --tw-gradient-via-stops{syntax:"*";inherits:false}@property --tw-gradient-from-position{syntax:"";inherits:false;initial-value:0%}@property --tw-gradient-via-position{syntax:"";inherits:false;initial-value:50%}@property --tw-gradient-to-position{syntax:"";inherits:false;initial-value:100%}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-ease{syntax:"*";inherits:false}@property --tw-scale-x{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-y{syntax:"*";inherits:false;initial-value:1}@property --tw-scale-z{syntax:"*";inherits:false;initial-value:1}@keyframes spin{to{transform:rotate(360deg)}}@keyframes ping{75%,to{opacity:0;transform:scale(2)}}@keyframes pulse{50%{opacity:.5}} diff --git a/frontend/dist/index.html b/frontend/dist/index.html index 1adfe16..5f15240 100644 --- a/frontend/dist/index.html +++ b/frontend/dist/index.html @@ -7,8 +7,8 @@ Mission Control 2.0 - - + +
diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0e34a25..9d2deb2 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -14,6 +14,7 @@ "lucide-react": "^0.460.0", "react": "^18.3.1", "react-dom": "^18.3.1", + "reagraph": "^4.22.0", "recharts": "^3.9.0", "tailwind-merge": "^2.5.5" }, @@ -262,6 +263,15 @@ "@babel/core": "^7.0.0-0" } }, + "node_modules/@babel/runtime": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz", + "integrity": "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/template": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", @@ -310,6 +320,12 @@ "node": ">=6.9.0" } }, + "node_modules/@dimforge/rapier3d-compat": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/@dimforge/rapier3d-compat/-/rapier3d-compat-0.12.0.tgz", + "integrity": "sha512-uekIGetywIgopfD97oDL5PfeezkFpNhwlzlaEYNOA0N6ghdsOvh/HYjSMek5Q2O1PYvRSDFcqFVJl4r4ZBwOow==", + "license": "Apache-2.0" + }, "node_modules/@esbuild/aix-ppc64": { "version": "0.25.12", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", @@ -802,6 +818,12 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@mediapipe/tasks-vision": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.8.tgz", + "integrity": "sha512-Rp7ll8BHrKB3wXaRFKhrltwZl1CiXGdibPxuWXvqGnKTnv8fqa/nvftYNuSbf+pbJWKYCXdBtYTITdAUTGGh0Q==", + "license": "Apache-2.0" + }, "node_modules/@radix-ui/primitive": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.4.tgz", @@ -1132,6 +1154,63 @@ } } }, + "node_modules/@react-spring/animated": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.6.1.tgz", + "integrity": "sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==", + "license": "MIT", + "dependencies": { + "@react-spring/shared": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/core": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.6.1.tgz", + "integrity": "sha512-3HAAinAyCPessyQNNXe5W0OHzRfa8Yo5P748paPcmMowZ/4sMfaZ2ZB6e5x5khQI8NusOHj8nquoutd6FRY5WQ==", + "license": "MIT", + "dependencies": { + "@react-spring/animated": "~9.6.1", + "@react-spring/rafz": "~9.6.1", + "@react-spring/shared": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-spring/donate" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/rafz": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.6.1.tgz", + "integrity": "sha512-v6qbgNRpztJFFfSE3e2W1Uz+g8KnIBs6SmzCzcVVF61GdGfGOuBrbjIcp+nUz301awVmREKi4eMQb2Ab2gGgyQ==", + "license": "MIT" + }, + "node_modules/@react-spring/shared": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.6.1.tgz", + "integrity": "sha512-PBFBXabxFEuF8enNLkVqMC9h5uLRBo6GQhRMQT/nRTnemVENimgRd+0ZT4yFnAQ0AxWNiJfX3qux+bW2LbG6Bw==", + "license": "MIT", + "dependencies": { + "@react-spring/rafz": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/types": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.6.1.tgz", + "integrity": "sha512-POu8Mk0hIU3lRXB3bGIGe4VHIwwDsQyoD1F394OK7STTiX9w4dG3cTLljjYswkQN+hDSHRrj4O36kuVa7KPU8Q==", + "license": "MIT" + }, "node_modules/@reduxjs/toolkit": { "version": "2.12.0", "resolved": "https://registry.npmjs.org/@reduxjs/toolkit/-/toolkit-2.12.0.tgz", @@ -1886,6 +1965,12 @@ "react": "^18 || ^19" } }, + "node_modules/@tweenjs/tween.js": { + "version": "23.1.3", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-23.1.3.tgz", + "integrity": "sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==", + "license": "MIT" + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -1994,6 +2079,12 @@ "integrity": "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==", "license": "MIT" }, + "node_modules/@types/draco3d": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@types/draco3d/-/draco3d-1.4.10.tgz", + "integrity": "sha512-AX22jp8Y7wwaBgAixaSvkoG4M/+PlAcm3Qs4OW8yT9DM4xUpWKeFhLueTAyZF39pviAdcDdeJoACapiAceqNcw==", + "license": "MIT" + }, "node_modules/@types/estree": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", @@ -2011,18 +2102,22 @@ "undici-types": "~6.21.0" } }, + "node_modules/@types/offscreencanvas": { + "version": "2019.7.3", + "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz", + "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==", + "license": "MIT" + }, "node_modules/@types/prop-types": { "version": "15.7.15", "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.15.tgz", "integrity": "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==", - "devOptional": true, "license": "MIT" }, "node_modules/@types/react": { "version": "18.3.31", "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.31.tgz", "integrity": "sha512-vfEqpXTvwT91yhmwdfouStN2hSKwTvyRs8qpLfADyrq/kxDw0hZM7Wk9Ug1FELj8hIby+S/+kQCSRFF32nv2Qw==", - "devOptional": true, "license": "MIT", "dependencies": { "@types/prop-types": "*", @@ -2039,12 +2134,71 @@ "@types/react": "^18.0.0" } }, + "node_modules/@types/react-reconciler": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.26.7.tgz", + "integrity": "sha512-mBDYl8x+oyPX/VBb3E638N0B7xG+SPk/EAMcVPeexqus/5aTpTphQi0curhhshOqRrc9t6OPoJfEUkbymse/lQ==", + "license": "MIT", + "dependencies": { + "@types/react": "*" + } + }, + "node_modules/@types/stats.js": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.4.tgz", + "integrity": "sha512-jIBvWWShCvlBqBNIZt0KAshWpvSjhkwkEu4ZUcASoAvhmrgAUI2t1dXrjSL4xXVLB4FznPrIsX3nKXFl/Dt4vA==", + "license": "MIT" + }, + "node_modules/@types/three": { + "version": "0.185.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.185.0.tgz", + "integrity": "sha512-O2Uy8Cj4Nonr8dWUUbifMdPe8B0Mq7EdOHb89S4+kjUw/KhbjTZrUuYlrQ1bpUKG+EP9QJnN7qNxbHGlGoLHMA==", + "license": "MIT", + "dependencies": { + "@dimforge/rapier3d-compat": "~0.12.0", + "@tweenjs/tween.js": "~23.1.3", + "@types/stats.js": "*", + "@types/webxr": ">=0.5.17", + "fflate": "~0.8.2", + "meshoptimizer": "~1.1.1" + } + }, + "node_modules/@types/three/node_modules/fflate": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.8.3.tgz", + "integrity": "sha512-tbZNuJrLwGUp3zshBtdy4W+ORxZuIh8a5ilyIEQDC5rY1f3U20JMry0Ll3WBzU58EZKsEuJFXhb5gwv8CsPvgA==", + "license": "MIT" + }, "node_modules/@types/use-sync-external-store": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", "license": "MIT" }, + "node_modules/@types/webxr": { + "version": "0.5.24", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.24.tgz", + "integrity": "sha512-h8fgEd/DpoS9CBrjEQXR+dIDraopAEfu4wYVNY2tEPwk60stPWhvZMf4Foo5FakuQ7HFZoa8WceaWFervK2Ovg==", + "license": "MIT" + }, + "node_modules/@use-gesture/core": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@use-gesture/core/-/core-10.3.1.tgz", + "integrity": "sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw==", + "license": "MIT" + }, + "node_modules/@use-gesture/react": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@use-gesture/react/-/react-10.3.1.tgz", + "integrity": "sha512-Yy19y6O2GJq8f7CHf7L0nxL8bf4PZCPaVOCgJrusOeFHY1LvHgYXnmnXg6N5iwAnbgbZCDjo60SiM6IPJi9C5g==", + "license": "MIT", + "dependencies": { + "@use-gesture/core": "10.3.1" + }, + "peerDependencies": { + "react": ">= 16.8.0" + } + }, "node_modules/@vitejs/plugin-react": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.7.0.tgz", @@ -2066,6 +2220,12 @@ "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" } }, + "node_modules/@yomguithereal/helpers": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@yomguithereal/helpers/-/helpers-1.1.1.tgz", + "integrity": "sha512-UYvAq/XCA7xoh1juWDYsq3W0WywOB+pz8cgVnE1b45ZfdMhBvHDrgmSFG3jXeZSr2tMTYLGHFHON+ekG05Jebg==", + "license": "MIT" + }, "node_modules/aria-hidden": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/aria-hidden/-/aria-hidden-1.2.6.tgz", @@ -2091,6 +2251,15 @@ "node": ">=6.0.0" } }, + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "license": "MIT", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/browserslist": { "version": "4.28.4", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.4.tgz", @@ -2125,6 +2294,15 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/camera-controls": { + "version": "2.10.1", + "resolved": "https://registry.npmjs.org/camera-controls/-/camera-controls-2.10.1.tgz", + "integrity": "sha512-KnaKdcvkBJ1Irbrzl8XD6WtZltkRjp869Jx8c0ujs9K+9WD+1D7ryBsCiVqJYUqt6i/HR5FxT7RLASieUD+Q5w==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.126.1" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001799", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz", @@ -2146,6 +2324,12 @@ ], "license": "CC-BY-4.0" }, + "node_modules/classnames": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==", + "license": "MIT" + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -2178,11 +2362,42 @@ "dev": true, "license": "MIT" }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/csstype": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", - "devOptional": true, "license": "MIT" }, "node_modules/d3-array": { @@ -2197,6 +2412,12 @@ "node": ">=12" } }, + "node_modules/d3-binarytree": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/d3-binarytree/-/d3-binarytree-1.0.2.tgz", + "integrity": "sha512-cElUNH+sHu95L04m92pG73t2MEJXKu+GeKUN1TJkFsu93E5W8E9Sc3kHEGJKgenGvj19m6upSn2EunvMgMD2Yw==", + "license": "MIT" + }, "node_modules/d3-color": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/d3-color/-/d3-color-3.1.0.tgz", @@ -2206,6 +2427,15 @@ "node": ">=12" } }, + "node_modules/d3-dispatch": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-3.0.1.tgz", + "integrity": "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-ease": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-3.0.1.tgz", @@ -2215,6 +2445,22 @@ "node": ">=12" } }, + "node_modules/d3-force-3d": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/d3-force-3d/-/d3-force-3d-3.0.6.tgz", + "integrity": "sha512-4tsKHUPLOVkyfEffZo1v6sFHvGFwAIIjt/W8IThbp08DYAsXZck+2pSHEG5W1+gQgEvFLdZkYvmJAbRM2EzMnA==", + "license": "MIT", + "dependencies": { + "d3-binarytree": "1", + "d3-dispatch": "1 - 3", + "d3-octree": "1", + "d3-quadtree": "1 - 3", + "d3-timer": "1 - 3" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/d3-format": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/d3-format/-/d3-format-3.1.2.tgz", @@ -2224,6 +2470,15 @@ "node": ">=12" } }, + "node_modules/d3-hierarchy": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/d3-hierarchy/-/d3-hierarchy-3.1.2.tgz", + "integrity": "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-interpolate": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-3.0.1.tgz", @@ -2236,6 +2491,12 @@ "node": ">=12" } }, + "node_modules/d3-octree": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/d3-octree/-/d3-octree-1.1.0.tgz", + "integrity": "sha512-F8gPlqpP+HwRPMO/8uOu5wjH110+6q4cgJvgJT6vlpy3BEaDIKlTZrgHKZSp/i1InRpVfh4puY/kvL6MxK930A==", + "license": "MIT" + }, "node_modules/d3-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/d3-path/-/d3-path-3.1.0.tgz", @@ -2245,6 +2506,15 @@ "node": ">=12" } }, + "node_modules/d3-quadtree": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/d3-quadtree/-/d3-quadtree-3.0.1.tgz", + "integrity": "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, "node_modules/d3-scale": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/d3-scale/-/d3-scale-4.0.2.tgz", @@ -2330,6 +2600,15 @@ "integrity": "sha512-qIMFpTMZmny+MMIitAB6D7iVPEorVw6YQRWkvarTkT4tBeSLLiHzcwj6q0MmYSFCiVpiqPJTJEYIrpcPzVEIvg==", "license": "MIT" }, + "node_modules/detect-gpu": { + "version": "5.0.70", + "resolved": "https://registry.npmjs.org/detect-gpu/-/detect-gpu-5.0.70.tgz", + "integrity": "sha512-bqerEP1Ese6nt3rFkwPnGbsUF9a4q+gMmpTVVOEzoCyeCc+y7/RvJnQZJx1JwhgQI5Ntg0Kgat8Uu7XpBqnz1w==", + "license": "MIT", + "dependencies": { + "webgl-constants": "^1.1.1" + } + }, "node_modules/detect-libc": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", @@ -2346,6 +2625,12 @@ "integrity": "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ==", "license": "MIT" }, + "node_modules/draco3d": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.7.tgz", + "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==", + "license": "Apache-2.0" + }, "node_modules/electron-to-chromium": { "version": "1.5.378", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.378.tgz", @@ -2353,6 +2638,12 @@ "dev": true, "license": "ISC" }, + "node_modules/ellipsize": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/ellipsize/-/ellipsize-0.5.1.tgz", + "integrity": "sha512-0jEAyuIRU6U8MN0S5yUqIrkK/AQWkChh642N3zQuGV57s9bsUWYLc0jJOoDIUkZ2sbEL3ySq8xfq71BvG4q3hw==", + "license": "MIT" + }, "node_modules/enhanced-resolve": { "version": "5.21.6", "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.21.6.tgz", @@ -2435,6 +2726,15 @@ "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", "license": "MIT" }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, "node_modules/fdir": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", @@ -2453,6 +2753,12 @@ } } }, + "node_modules/fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==", + "license": "MIT" + }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -2487,6 +2793,12 @@ "node": ">=6" } }, + "node_modules/glsl-noise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/glsl-noise/-/glsl-noise-0.0.0.tgz", + "integrity": "sha512-b/ZCF6amfAUb7dJM/MxRs7AetQEahYzJ8PtgfrmEdtw6uyGOr+ZSGtgjFm6mfsBkxJ4d2W7kg+Nlqzqvn3Bc0w==", + "license": "MIT" + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -2494,6 +2806,122 @@ "dev": true, "license": "ISC" }, + "node_modules/graphology": { + "version": "0.25.4", + "resolved": "https://registry.npmjs.org/graphology/-/graphology-0.25.4.tgz", + "integrity": "sha512-33g0Ol9nkWdD6ulw687viS8YJQBxqG5LWII6FI6nul0pq6iM2t5EKquOTFDbyTblRB3O9I+7KX4xI8u5ffekAQ==", + "license": "MIT", + "dependencies": { + "events": "^3.3.0", + "obliterator": "^2.0.2" + }, + "peerDependencies": { + "graphology-types": ">=0.24.0" + } + }, + "node_modules/graphology-indices": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/graphology-indices/-/graphology-indices-0.17.0.tgz", + "integrity": "sha512-A7RXuKQvdqSWOpn7ZVQo4S33O0vCfPBnUSf7FwE0zNCasqwZVUaCXePuWo5HBpWw68KJcwObZDHpFk6HKH6MYQ==", + "license": "MIT", + "dependencies": { + "graphology-utils": "^2.4.2", + "mnemonist": "^0.39.0" + }, + "peerDependencies": { + "graphology-types": ">=0.20.0" + } + }, + "node_modules/graphology-layout": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/graphology-layout/-/graphology-layout-0.6.1.tgz", + "integrity": "sha512-m9aMvbd0uDPffUCFPng5ibRkb2pmfNvdKjQWeZrf71RS1aOoat5874+DcyNfMeCT4aQguKC7Lj9eCbqZj/h8Ag==", + "license": "MIT", + "dependencies": { + "graphology-utils": "^2.3.0", + "pandemonium": "^2.4.0" + }, + "peerDependencies": { + "graphology-types": ">=0.19.0" + } + }, + "node_modules/graphology-layout-forceatlas2": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/graphology-layout-forceatlas2/-/graphology-layout-forceatlas2-0.10.1.tgz", + "integrity": "sha512-ogzBeF1FvWzjkikrIFwxhlZXvD2+wlY54lqhsrWprcdPjopM2J9HoMweUmIgwaTvY4bUYVimpSsOdvDv1gPRFQ==", + "license": "MIT", + "dependencies": { + "graphology-utils": "^2.1.0" + }, + "peerDependencies": { + "graphology-types": ">=0.19.0" + } + }, + "node_modules/graphology-layout-noverlap": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/graphology-layout-noverlap/-/graphology-layout-noverlap-0.4.2.tgz", + "integrity": "sha512-13WwZSx96zim6l1dfZONcqLh3oqyRcjIBsqz2c2iJ3ohgs3605IDWjldH41Gnhh462xGB1j6VGmuGhZ2FKISXA==", + "license": "MIT", + "dependencies": { + "graphology-utils": "^2.3.0" + }, + "peerDependencies": { + "graphology-types": ">=0.19.0" + } + }, + "node_modules/graphology-metrics": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/graphology-metrics/-/graphology-metrics-2.4.0.tgz", + "integrity": "sha512-7WOfOP+mFLCaTJx55Qg4eY+211vr1/b3D/R3biz3SXGhAaCVcWYkfabnmO4O4WBNWANEHtVnFrGgJ0kj6MM6xw==", + "license": "MIT", + "dependencies": { + "graphology-indices": "^0.17.0", + "graphology-shortest-path": "^2.0.0", + "graphology-utils": "^2.4.4", + "mnemonist": "^0.39.0", + "pandemonium": "2.4.1" + }, + "peerDependencies": { + "graphology-types": ">=0.20.0" + } + }, + "node_modules/graphology-shortest-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/graphology-shortest-path/-/graphology-shortest-path-2.1.0.tgz", + "integrity": "sha512-KbT9CTkP/u72vGEJzyRr24xFC7usI9Es3LMmCPHGwQ1KTsoZjxwA9lMKxfU0syvT/w+7fZUdB/Hu2wWYcJBm6Q==", + "license": "MIT", + "dependencies": { + "@yomguithereal/helpers": "^1.1.1", + "graphology-indices": "^0.17.0", + "graphology-utils": "^2.4.3", + "mnemonist": "^0.39.0" + }, + "peerDependencies": { + "graphology-types": ">=0.20.0" + } + }, + "node_modules/graphology-types": { + "version": "0.24.8", + "resolved": "https://registry.npmjs.org/graphology-types/-/graphology-types-0.24.8.tgz", + "integrity": "sha512-hDRKYXa8TsoZHjgEaysSRyPdT6uB78Ci8WnjgbStlQysz7xR52PInxNsmnB7IBOM1BhikxkNyCVEFgmPKnpx3Q==", + "license": "MIT", + "peer": true + }, + "node_modules/graphology-utils": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/graphology-utils/-/graphology-utils-2.5.2.tgz", + "integrity": "sha512-ckHg8MXrXJkOARk56ZaSCM1g1Wihe2d6iTmz1enGOz4W/l831MBCKSayeFQfowgF8wd+PQ4rlch/56Vs/VZLDQ==", + "license": "MIT", + "peerDependencies": { + "graphology-types": ">=0.23.0" + } + }, + "node_modules/hold-event": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/hold-event/-/hold-event-0.2.0.tgz", + "integrity": "sha512-rko5P1XgHzy4B0NR0xVHEpWPgj0i23f8Mf8qsOugd1CHvfLR0PyIyy+8TAQQA9v8qAa1OZ4XuCKk04rxmPGHNQ==", + "license": "MIT" + }, "node_modules/immer": { "version": "10.2.0", "resolved": "https://registry.npmjs.org/immer/-/immer-10.2.0.tgz", @@ -2513,6 +2941,33 @@ "node": ">=12" } }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC" + }, + "node_modules/its-fine": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-1.2.5.tgz", + "integrity": "sha512-fXtDA0X0t0eBYAGLVM5YsgJGsJ5jEmqZEPrGbzdf5awjv0xE7nqv3TVnvtUF060Tkes15DbDAKW/I48vsb6SyA==", + "license": "MIT", + "dependencies": { + "@types/react-reconciler": "^0.28.0" + }, + "peerDependencies": { + "react": ">=18.0" + } + }, + "node_modules/its-fine/node_modules/@types/react-reconciler": { + "version": "0.28.9", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.28.9.tgz", + "integrity": "sha512-HHM3nxyUZ3zAylX8ZEyrDNd2XZOnQ0D5XfunJF5FLQnZbHHYq4UWvW1QfelQNXv1ICNkwYhfxjwfnqivYB6bFg==", + "license": "MIT", + "peerDependencies": { + "@types/react": "*" + } + }, "node_modules/jiti": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", @@ -2869,6 +3324,21 @@ "@jridgewell/sourcemap-codec": "^1.5.5" } }, + "node_modules/meshoptimizer": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-1.1.1.tgz", + "integrity": "sha512-oRFNWJRDA/WTrVj7NWvqa5HqE1t9MYDj2VaWirQCzCCrAd2GHrqR/sQezCxiWATPNlKTcRaPRHPJwIRoPBAp5g==", + "license": "MIT" + }, + "node_modules/mnemonist": { + "version": "0.39.8", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.39.8.tgz", + "integrity": "sha512-vyWo2K3fjrUw8YeeZ1zF0fy6Mu59RHokURlld8ymdUPjMlD9EC9ov1/YPqTgqRvUN9nTr3Gqfz29LYAmu0PHPQ==", + "license": "MIT", + "dependencies": { + "obliterator": "^2.0.1" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2905,6 +3375,39 @@ "node": ">=18" } }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/obliterator": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.5.tgz", + "integrity": "sha512-42CPE9AhahZRsMNslczq0ctAEtqk8Eka26QofnqC346BZdHDySk3LWka23LI7ULIw11NmltpiLagIq8gBozxTw==", + "license": "MIT" + }, + "node_modules/pandemonium": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/pandemonium/-/pandemonium-2.4.1.tgz", + "integrity": "sha512-wRqjisUyiUfXowgm7MFH2rwJzKIr20rca5FsHXCMNm1W5YPP1hCtrZfgmQ62kP7OZ7Xt+cR858aB28lu5NX55g==", + "license": "MIT", + "dependencies": { + "mnemonist": "^0.39.2" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -2954,6 +3457,29 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/potpack": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", + "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==", + "license": "ISC" + }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, + "node_modules/prop-types/node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "license": "MIT" + }, "node_modules/react": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", @@ -2966,6 +3492,18 @@ "node": ">=0.10.0" } }, + "node_modules/react-composer": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/react-composer/-/react-composer-5.0.3.tgz", + "integrity": "sha512-1uWd07EME6XZvMfapwZmc7NgCZqDemcvicRi3wMJzXsQLvZ3L7fTHVyPy1bZdnWXM4iPjYuNE+uJ41MLKeTtnA==", + "license": "MIT", + "dependencies": { + "prop-types": "^15.6.0" + }, + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -2986,6 +3524,41 @@ "license": "MIT", "peer": true }, + "node_modules/react-merge-refs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/react-merge-refs/-/react-merge-refs-1.1.0.tgz", + "integrity": "sha512-alTKsjEL0dKH/ru1Iyn7vliS2QRcBp9zZPGoWxUOvRGWPUYgjo+V01is7p04It6KhgrzhJGnIj9GgX8W4bZoCQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + } + }, + "node_modules/react-reconciler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.27.0.tgz", + "integrity": "sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.21.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "react": "^18.0.0" + } + }, + "node_modules/react-reconciler/node_modules/scheduler": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", + "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/react-redux": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-9.3.0.tgz", @@ -3088,6 +3661,249 @@ } } }, + "node_modules/react-use-measure": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/react-use-measure/-/react-use-measure-2.1.7.tgz", + "integrity": "sha512-KrvcAo13I/60HpwGO5jpW7E9DfusKyLPLvuHlUyP5zqnmAPhNc6qTRjUQrdTADl0lpPpDVU2/Gg51UlOGHXbdg==", + "license": "MIT", + "peerDependencies": { + "react": ">=16.13", + "react-dom": ">=16.13" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/reagraph": { + "version": "4.22.0", + "resolved": "https://registry.npmjs.org/reagraph/-/reagraph-4.22.0.tgz", + "integrity": "sha512-opEQdl/xkaKJFIywkQTamNFzByd78szB8dZa57F3Yj69MwVgh7q7AGzv9S5sYlorqYrKA8O+Xm9rTpWXsFiQKg==", + "license": "Apache-2.0", + "dependencies": { + "@react-spring/three": "9.6.1", + "@react-three/fiber": "8.13.5", + "@use-gesture/react": "^10.3.1", + "camera-controls": "^2.8.3", + "classnames": "^2.5.1", + "d3-array": "^3.2.4", + "d3-force-3d": "^3.0.3", + "d3-hierarchy": "^3.1.2", + "d3-scale": "^4.0.2", + "ellipsize": "^0.5.1", + "glodrei": "^0.0.1", + "graphology": "^0.25.4", + "graphology-layout": "^0.6.1", + "graphology-layout-forceatlas2": "^0.10.1", + "graphology-layout-noverlap": "^0.4.2", + "graphology-metrics": "^2.1.0", + "graphology-shortest-path": "^2.0.2", + "hold-event": "^0.2.0", + "three": "^0.154.0", + "three-stdlib": "^2.23.13", + "zustand": "4.3.9" + }, + "peerDependencies": { + "react": ">=16", + "react-dom": ">=16" + } + }, + "node_modules/reagraph/node_modules/@react-spring/three": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/three/-/three-9.6.1.tgz", + "integrity": "sha512-Tyw2YhZPKJAX3t2FcqvpLRb71CyTe1GvT3V+i+xJzfALgpk10uPGdGaQQ5Xrzmok1340DAeg2pR/MCfaW7b8AA==", + "license": "MIT", + "dependencies": { + "@react-spring/animated": "~9.6.1", + "@react-spring/core": "~9.6.1", + "@react-spring/shared": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "peerDependencies": { + "@react-three/fiber": ">=6.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "three": ">=0.126" + } + }, + "node_modules/reagraph/node_modules/@react-three/fiber": { + "version": "8.13.5", + "resolved": "https://registry.npmjs.org/@react-three/fiber/-/fiber-8.13.5.tgz", + "integrity": "sha512-x9QdsaB/Wm/6NGvRXQahPPWfn2dQce7Fg3C2r00NNzyDdqRKw32YavL+WEqjZOOd0nvFpzv7FtaKc+VCOTR59w==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.17.8", + "@types/react-reconciler": "^0.26.7", + "its-fine": "^1.0.6", + "react-reconciler": "^0.27.0", + "react-use-measure": "^2.1.1", + "scheduler": "^0.21.0", + "suspend-react": "^0.1.3", + "zustand": "^3.7.1" + }, + "peerDependencies": { + "expo": ">=43.0", + "expo-asset": ">=8.4", + "expo-gl": ">=11.0", + "react": ">=18.0", + "react-dom": ">=18.0", + "react-native": ">=0.64", + "three": ">=0.133" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + }, + "expo-asset": { + "optional": true + }, + "expo-gl": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/reagraph/node_modules/@react-three/fiber/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "license": "MIT", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/reagraph/node_modules/glodrei": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/glodrei/-/glodrei-0.0.1.tgz", + "integrity": "sha512-DMx6ElCSwh1pR4IyDS3LvyFwZHSCCKCqdqo8P1G7klQtqH6PcOjleduCDsHehDtyYQ1E4dzVeoEzHIL1DIxjag==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@mediapipe/tasks-vision": "0.10.8", + "@react-spring/three": "~9.6.1", + "@use-gesture/react": "^10.2.24", + "camera-controls": "^2.4.2", + "cross-env": "^7.0.3", + "detect-gpu": "^5.0.28", + "glsl-noise": "^0.0.0", + "maath": "^0.10.7", + "meshline": "^3.1.6", + "react-composer": "^5.0.3", + "react-merge-refs": "^1.1.0", + "stats-gl": "^2.0.0", + "stats.js": "^0.17.0", + "suspend-react": "^0.1.3", + "three-mesh-bvh": "^0.7.0", + "three-stdlib": "^2.29.4", + "troika-three-text": "^0.47.2", + "tunnel-rat": "^0.1.2", + "utility-types": "^3.10.0", + "uuid": "^9.0.1", + "zustand": "^3.7.1" + }, + "peerDependencies": { + "@react-three/fiber": ">=8.0", + "react": ">=18.0", + "react-dom": ">=18.0", + "three": ">=0.137" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/reagraph/node_modules/glodrei/node_modules/maath": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/maath/-/maath-0.10.8.tgz", + "integrity": "sha512-tRvbDF0Pgqz+9XUa4jjfgAQ8/aPKmQdWXilFu2tMy4GWj4NOsx99HlULO4IeREfbO3a0sA145DZYyvXPkybm0g==", + "license": "MIT", + "peerDependencies": { + "@types/three": ">=0.134.0", + "three": ">=0.134.0" + } + }, + "node_modules/reagraph/node_modules/glodrei/node_modules/meshline": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/meshline/-/meshline-3.3.1.tgz", + "integrity": "sha512-/TQj+JdZkeSUOl5Mk2J7eLcYTLiQm2IDzmlSvYm7ov15anEcDJ92GHqqazxTSreeNgfnYu24kiEvvv0WlbCdFQ==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.137" + } + }, + "node_modules/reagraph/node_modules/glodrei/node_modules/three-mesh-bvh": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/three-mesh-bvh/-/three-mesh-bvh-0.7.6.tgz", + "integrity": "sha512-rCjsnxEqR9r1/C/lCqzGLS67NDty/S/eT6rAJfDvsanrIctTWdNoR4ZOGWewCB13h1QkVo2BpmC0wakj1+0m8A==", + "license": "MIT", + "peerDependencies": { + "three": ">= 0.151.0" + } + }, + "node_modules/reagraph/node_modules/glodrei/node_modules/troika-three-text": { + "version": "0.47.2", + "resolved": "https://registry.npmjs.org/troika-three-text/-/troika-three-text-0.47.2.tgz", + "integrity": "sha512-qylT0F+U7xGs+/PEf3ujBdJMYWbn0Qci0kLqI5BJG2kW1wdg4T1XSxneypnF05DxFqJhEzuaOR9S2SjiyknMng==", + "license": "MIT", + "dependencies": { + "bidi-js": "^1.0.2", + "troika-three-utils": "^0.47.2", + "troika-worker-utils": "^0.47.2", + "webgl-sdf-generator": "1.1.1" + }, + "peerDependencies": { + "three": ">=0.125.0" + } + }, + "node_modules/reagraph/node_modules/glodrei/node_modules/troika-three-text/node_modules/troika-three-utils": { + "version": "0.47.2", + "resolved": "https://registry.npmjs.org/troika-three-utils/-/troika-three-utils-0.47.2.tgz", + "integrity": "sha512-/28plhCxfKtH7MSxEGx8e3b/OXU5A0xlwl+Sbdp0H8FXUHKZDoksduEKmjQayXYtxAyuUiCRunYIv/8Vi7aiyg==", + "license": "MIT", + "peerDependencies": { + "three": ">=0.125.0" + } + }, + "node_modules/reagraph/node_modules/glodrei/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "license": "MIT", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/reagraph/node_modules/scheduler": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", + "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/recharts": { "version": "3.9.0", "resolved": "https://registry.npmjs.org/recharts/-/recharts-3.9.0.tgz", @@ -3133,6 +3949,15 @@ "redux": "^5.0.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/reselect": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/reselect/-/reselect-5.2.0.tgz", @@ -3203,6 +4028,27 @@ "semver": "bin/semver.js" } }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/source-map-js": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", @@ -3213,6 +4059,41 @@ "node": ">=0.10.0" } }, + "node_modules/stats-gl": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/stats-gl/-/stats-gl-2.4.2.tgz", + "integrity": "sha512-g5O9B0hm9CvnM36+v7SFl39T7hmAlv541tU81ME8YeSb3i1CIP5/QdDeSB3A0la0bKNHpxpwxOVRo2wFTYEosQ==", + "license": "MIT", + "dependencies": { + "@types/three": "*", + "three": "^0.170.0" + }, + "peerDependencies": { + "@types/three": "*", + "three": "*" + } + }, + "node_modules/stats-gl/node_modules/three": { + "version": "0.170.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.170.0.tgz", + "integrity": "sha512-FQK+LEpYc0fBD+J8g6oSEyyNzjp+Q7Ks1C568WWaoMRLW+TkNNWmenWeGgJjV105Gd+p/2ql1ZcjYvNiPZBhuQ==", + "license": "MIT" + }, + "node_modules/stats.js": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/stats.js/-/stats.js-0.17.0.tgz", + "integrity": "sha512-hNKz8phvYLPEcRkeG1rsGmV5ChMjKDAWU7/OJJdDErPBNChQXxCo3WZurGpnWc6gZhAzEPFad1aVgyOANH1sMw==", + "license": "MIT" + }, + "node_modules/suspend-react": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/suspend-react/-/suspend-react-0.1.3.tgz", + "integrity": "sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ==", + "license": "MIT", + "peerDependencies": { + "react": ">=17.0" + } + }, "node_modules/tailwind-merge": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-2.6.1.tgz", @@ -3244,6 +4125,29 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/three": { + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/three/-/three-0.154.0.tgz", + "integrity": "sha512-Uzz8C/5GesJzv8i+Y2prEMYUwodwZySPcNhuJUdsVMH2Yn4Nm8qlbQe6qRN5fOhg55XB0WiLfTPBxVHxpE60ug==", + "license": "MIT" + }, + "node_modules/three-stdlib": { + "version": "2.36.1", + "resolved": "https://registry.npmjs.org/three-stdlib/-/three-stdlib-2.36.1.tgz", + "integrity": "sha512-XyGQrFmNQ5O/IoKm556ftwKsBg11TIb301MB5dWNicziQBEs2g3gtOYIf7pFiLa0zI2gUwhtCjv9fmjnxKZ1Cg==", + "license": "MIT", + "dependencies": { + "@types/draco3d": "^1.4.0", + "@types/offscreencanvas": "^2019.6.4", + "@types/webxr": "^0.5.2", + "draco3d": "^1.4.1", + "fflate": "^0.6.9", + "potpack": "^1.0.1" + }, + "peerDependencies": { + "three": ">=0.128.0" + } + }, "node_modules/tiny-invariant": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", @@ -3267,12 +4171,27 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/troika-worker-utils": { + "version": "0.47.2", + "resolved": "https://registry.npmjs.org/troika-worker-utils/-/troika-worker-utils-0.47.2.tgz", + "integrity": "sha512-mzss4MeyzUkYBppn4x5cdAqrhBHFEuVmMMgLMTyFV23x6GvQMyo+/R5E5Lsbrt7WSt5RfvewjcwD1DChRTA9lA==", + "license": "MIT" + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", "license": "0BSD" }, + "node_modules/tunnel-rat": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tunnel-rat/-/tunnel-rat-0.1.2.tgz", + "integrity": "sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ==", + "license": "MIT", + "dependencies": { + "zustand": "^4.3.2" + } + }, "node_modules/typescript": { "version": "5.9.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", @@ -3377,6 +4296,29 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/utility-types": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", + "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "deprecated": "uuid@10 and below is no longer supported. For ESM codebases, update to uuid@latest. For CommonJS codebases, use uuid@11 (but be aware this version will likely be deprecated in 2028).", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/victory-vendor": { "version": "37.3.6", "resolved": "https://registry.npmjs.org/victory-vendor/-/victory-vendor-37.3.6.tgz", @@ -3474,12 +4416,71 @@ } } }, + "node_modules/webgl-constants": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webgl-constants/-/webgl-constants-1.1.1.tgz", + "integrity": "sha512-LkBXKjU5r9vAW7Gcu3T5u+5cvSvh5WwINdr0C+9jpzVB41cjQAP5ePArDtk/WHYdVj0GefCgM73BA7FlIiNtdg==" + }, + "node_modules/webgl-sdf-generator": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webgl-sdf-generator/-/webgl-sdf-generator-1.1.1.tgz", + "integrity": "sha512-9Z0JcMTFxeE+b2x1LJTdnaT8rT8aEp7MVxkNwoycNmJWwPdzoXzMh0BjJSh/AEFP+KPYZUli814h8bJZFIZ2jA==", + "license": "MIT" + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true, "license": "ISC" + }, + "node_modules/zustand": { + "version": "4.3.9", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-4.3.9.tgz", + "integrity": "sha512-Tat5r8jOMG1Vcsj8uldMyqYKC5IZvQif8zetmLHs9WoZlntTHmIoNM8TpLRY31ExncuUvUOXehd0kvahkuHjDw==", + "license": "MIT", + "dependencies": { + "use-sync-external-store": "1.2.0" + }, + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "immer": ">=9.0", + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "immer": { + "optional": true + }, + "react": { + "optional": true + } + } + }, + "node_modules/zustand/node_modules/use-sync-external-store": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz", + "integrity": "sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==", + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } } } } diff --git a/frontend/package.json b/frontend/package.json index c1d5208..1be38ad 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -15,6 +15,7 @@ "lucide-react": "^0.460.0", "react": "^18.3.1", "react-dom": "^18.3.1", + "reagraph": "^4.22.0", "recharts": "^3.9.0", "tailwind-merge": "^2.5.5" }, diff --git a/frontend/src/lib/api.ts b/frontend/src/lib/api.ts index 1d31cdf..656e9ee 100644 --- a/frontend/src/lib/api.ts +++ b/frontend/src/lib/api.ts @@ -270,6 +270,17 @@ export interface Memory { score?: number // Relevanz bei semantischer Suche (q gesetzt); sonst undefined } +export interface MemoryGraphNode { + id: string + content: string + category: string + source: string +} +export interface MemoryGraph { + nodes: MemoryGraphNode[] + edges: { source: string; target: string; weight: number }[] +} + export interface DedupeResult { groups: { keep: { id: string; content: string; category: string }; remove: { id: string; content: string }[] }[] duplicate_count: number diff --git a/frontend/src/lib/queries.ts b/frontend/src/lib/queries.ts index 5027a88..b341feb 100644 --- a/frontend/src/lib/queries.ts +++ b/frontend/src/lib/queries.ts @@ -13,6 +13,7 @@ import { type Health, type Job, type Memory, + type MemoryGraph, type ModelsResp, type RoutingResp, type ServicesResp, @@ -37,8 +38,16 @@ export const qk = { drafts: (target?: string) => ["drafts", target ?? ""] as const, connect: (params?: string) => ["connect", params ?? ""] as const, memory: (q?: string, category?: string) => ["memory", q ?? "", category ?? ""] as const, + memoryGraph: ["memory-graph"] as const, } +export const useMemoryGraph = (enabled = true) => + useQuery({ + queryKey: qk.memoryGraph, + queryFn: () => api("/api/memory/graph"), + enabled, + }) + export const useHealth = () => useQuery({ queryKey: qk.health, queryFn: () => api("/api/health"), refetchInterval: 10_000 }) diff --git a/frontend/src/views/GraphErrorBoundary.tsx b/frontend/src/views/GraphErrorBoundary.tsx new file mode 100644 index 0000000..65fd8ad --- /dev/null +++ b/frontend/src/views/GraphErrorBoundary.tsx @@ -0,0 +1,21 @@ +import { Component, type ReactNode } from "react" + +export class GraphErrorBoundary extends Component<{ children: ReactNode }, { error: Error | null }> { + state = { error: null as Error | null } + + static getDerivedStateFromError(error: Error) { + return { error } + } + + render() { + if (this.state.error) { + return ( +
+
Graph konnte nicht gerendert werden
+
{this.state.error.message}
+
+ ) + } + return this.props.children + } +} diff --git a/frontend/src/views/GraphView.tsx b/frontend/src/views/GraphView.tsx new file mode 100644 index 0000000..912b53d --- /dev/null +++ b/frontend/src/views/GraphView.tsx @@ -0,0 +1,118 @@ +import { useMemo, useState } from "react" +import { GraphCanvas, darkTheme } from "reagraph" +import { Trash2, Sparkles, Share2 } from "lucide-react" +import { type MemoryGraph } from "@/lib/api" + +const CAT_COLOR: Record = { + user: "#22d3ee", instruction: "#a78bfa", stable: "#6366f1", versioned: "#fbbf24", ephemeral: "#f472b6", +} +const CAT_LABEL: Record = { + user: "User", instruction: "Regel", stable: "Fakt", versioned: "Version", ephemeral: "Temporär", +} +const AUTO = new Set(["auto", "agent", "hermes"]) + +export function GraphView({ data, onDelete }: { data: MemoryGraph; onDelete: (id: string) => void }) { + const [selected, setSelected] = useState(null) + + const degree = useMemo(() => { + const d: Record = {} + data.edges.forEach((e) => { d[e.source] = (d[e.source] || 0) + 1; d[e.target] = (d[e.target] || 0) + 1 }) + return d + }, [data]) + + const nodes = useMemo(() => data.nodes.map((n) => ({ + id: n.id, + label: n.content.length > 26 ? n.content.slice(0, 25) + "…" : n.content, + fill: CAT_COLOR[n.category] || "#64748b", + size: 6 + Math.min(degree[n.id] || 0, 6) * 2, + })), [data, degree]) + + const edges = useMemo(() => data.edges.map((e) => ({ + id: `${e.source}->${e.target}`, + source: e.source, + target: e.target, + size: 0.4 + e.weight, + })), [data]) + + const sel = selected ? data.nodes.find((n) => n.id === selected) ?? null : null + const neighbors = useMemo(() => { + if (!selected) return [] + const ids = new Set() + data.edges.forEach((e) => { + if (e.source === selected) ids.add(e.target) + if (e.target === selected) ids.add(e.source) + }) + return data.nodes.filter((n) => ids.has(n.id)) + }, [selected, data]) + + if (!data.nodes.length) { + return ( +
+ Noch keine Fakten — der Graph füllt sich, sobald Hermes lernt oder du Einträge anlegst. +
+ ) + } + + return ( +
+
+ setSelected(n.id)} + onCanvasClick={() => setSelected(null)} + /> +
+ +
+ {sel ? ( + <> +
+ + + {CAT_LABEL[sel.category] || sel.category} + + + {AUTO.has(sel.source) && }{sel.source} + +
+
{sel.content}
+
+ verwandte Fakten +
+
+ {neighbors.length ? neighbors.map((n) => ( + + )) : } +
+ + + ) : ( +
+ +
+ Einen Knoten wählen, um den Fakt und seine semantischen Nachbarn zu sehen. +
+
+ )} +
+
+ ) +} diff --git a/frontend/src/views/MemoryView.tsx b/frontend/src/views/MemoryView.tsx index cabe212..d3d8638 100644 --- a/frontend/src/views/MemoryView.tsx +++ b/frontend/src/views/MemoryView.tsx @@ -1,10 +1,15 @@ -import { useState } from "react" -import { Trash2, Sparkles, User, Scroll, Shield, Tag, Clock, Search, Plus, BookOpen } from "lucide-react" +import { useState, lazy, Suspense } from "react" +import { Trash2, Sparkles, User, Scroll, Shield, Tag, Clock, Search, Plus, BookOpen, Share2, List } from "lucide-react" import { api, type DedupeResult } from "@/lib/api" -import { useMemory, useQueryClient } from "@/lib/queries" +import { useMemory, useMemoryGraph, useQueryClient } from "@/lib/queries" import { useDialog } from "@/lib/useDialog" import { cn } from "@/lib/utils" +import { GraphErrorBoundary } from "./GraphErrorBoundary" + +// reagraph + three.js sind schwer → erst laden, wenn der Graph-Tab geöffnet wird. +const GraphView = lazy(() => import("./GraphView").then((m) => ({ default: m.GraphView }))) + const CATEGORIES = ["user", "instruction", "stable", "versioned", "ephemeral"] @@ -35,13 +40,18 @@ export function MemoryView() { const [content, setContent] = useState("") const [category, setCategory] = useState("stable") const [deduping, setDeduping] = useState(false) + const [view, setView] = useState<"liste" | "graph">("liste") const qc = useQueryClient() const { showAlert, showConfirm, dialogElement } = useDialog() const { data: items = [], error: itemsErr } = useMemory({ q, category: filter }) + const { data: graph } = useMemoryGraph(view === "graph") const error = itemsErr ? String(itemsErr) : "" - const reloadMemory = () => qc.invalidateQueries({ queryKey: ["memory"] }) + const reloadMemory = () => { + qc.invalidateQueries({ queryKey: ["memory"] }) + qc.invalidateQueries({ queryKey: ["memory-graph"] }) + } async function add() { if (!content.trim()) return @@ -104,14 +114,32 @@ export function MemoryView() {

- +
+
+ + +
+ +
{/* Add New Fact Box */} @@ -151,6 +179,14 @@ export function MemoryView() { + {view === "graph" ? ( + + Graph wird geladen…}> + + + + ) : ( + <> {/* Filter / Search HUD */}
@@ -264,6 +300,8 @@ export function MemoryView() { }) )}
+ + )} {dialogElement}
diff --git a/mem0_service/app.py b/mem0_service/app.py index 9cbf576..d444026 100644 --- a/mem0_service/app.py +++ b/mem0_service/app.py @@ -223,6 +223,60 @@ def delete_memory(mid: str) -> dict: return {"ok": True} +@app.get("/graph") +def graph(min_score: float = 0.45, top_k: int = 3) -> dict: + """Fakten als Graph: Knoten = Fakten, Kanten = semantische Ähnlichkeit (Kosinus + der gespeicherten Embeddings, je Knoten die top_k Nachbarn ≥ min_score). Für die + Obsidian-artige Gedächtnis-Visualisierung im UI.""" + items = mem().get_all(filters={"user_id": USER_ID}, top_k=2000).get("results", []) + nodes = [_to_item(r) for r in items] + node_ids = [n["id"] for n in nodes] + idx = {nid: i for i, nid in enumerate(node_ids)} + + # Embeddings direkt aus der Chroma-Collection ziehen (kein Re-Embedding). + col = mem().vector_store.collection + raw = col.get(include=["embeddings"]) + raw_ids = raw.get("ids") or [] + raw_embs = raw.get("embeddings") + edges: list[dict] = [] + vecs = [None] * len(node_ids) + have = 0 + if raw_embs is not None: + for rid, emb in zip(raw_ids, raw_embs): + if rid in idx and emb is not None: + vecs[idx[rid]] = emb + have += 1 + + if have >= 2: + import numpy as np + present = [i for i, v in enumerate(vecs) if v is not None] + M = np.array([vecs[i] for i in present], dtype=float) + norms = np.linalg.norm(M, axis=1, keepdims=True) + norms[norms == 0] = 1.0 + Mn = M / norms + sim = Mn @ Mn.T + seen: set[tuple[int, int]] = set() + for a in range(len(present)): + order = np.argsort(-sim[a]) + cnt = 0 + for b in order: + if b == a: + continue + s = float(sim[a][b]) + if s < min_score: + break + i, j = present[a], present[b] + key = (min(i, j), max(i, j)) + if key not in seen: + seen.add(key) + edges.append({"source": node_ids[i], "target": node_ids[j], + "weight": round(s, 3)}) + cnt += 1 + if cnt >= top_k: + break + return {"nodes": nodes, "edges": edges} + + @app.post("/learn") def learn(body: LearnIn) -> dict: """Auto-Lernen: Gesprächs-Turns/Text durchreichen → Mem0 EXTRAHIERT Fakten selbst