PageSourceSearch

https://quantpad.ai/_next/static/chunks/7146.3a658ae85ed48c18.js

js quantpad.ai collected 2026-10-05 14:31:49 UTC 22,572 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7146],{37146:function(e,t,r){r.r(t),r.d(t,{Scatter3DCanvas:function(){return w}});var n=r(57437),i=r(45476),l=r(85903),a=r(21276),o=r(36496),s=r(25922),u=r(2265),c=r(72079),d=r(94550);function h(e){let t=(0,d.t5)(null,e),r=(e,t)=>{if("undefined"==typeof document)return t;let r=getComputedStyle(document.documentElement).getPropertyValue(e).trim();return r?"rgb(".concat(r.split(/\s+/).join(", "),")"):t};return{gain:t.gain,loss:t.loss,warning:t.chartWarning,accent:t.chart5,textPrimary:r("--color-text-primary",t.chart1),textTertiary:r("--color-text-tertiary",t.chart3)}}function x(e,t){let r=e.length,n=function(e,t){let r=[],n=Math.floor(1.5);for(let e=-n;e<=n;e++){let i=[];for(let r=-n;r<=n;r++){let n=Math.exp(-(r*r+e*e)/(2*t*t));i.push(n)}r.push(i)}return r}(0,t),i=Array(r).fill(null).map(()=>Array(r).fill(0)),l=Math.floor(n.length/2);for(let t=0;t<r;t++)for(let a=0;a<r;a++){let o=0,s=0;for(let i=-l;i<=l;i++)for(let u=-l;u<=l;u++){let c=t+i,d=a+u;if(c>=0&&c<r&&d>=0&&d<r){let t=n[i+l][u+l];o+=e[c][d]*t,s+=t}}i[t][a]=s>0?o/s:0}return i}function m(e){let t=new c.Ilk;if(e<.25){let r=e/.25;t.setRGB(.1,.2+.6*r,.8+.2*r)}else if(e<.5){let r=(e-.25)/.25;t.setRGB(.1+.3*r,.8,1-.5*r)}else if(e<.75){let r=(e-.5)/.25;t.setRGB(.4+.6*r,.8,.5-.4*r)}else t.setRGB(1,.8-(e-.75)/.25*.5,.1);return t}function f(e){let{hoverX:t,hoverY:r,grid:i,maxDensity:l,minZ:o,zMode:s="density",isDarkMode:c=!0}=e,d=(0,u.useRef)(null),x=(0,u.useRef)(null),m=(0,u.useRef)(null),f=(0,u.useRef)(null),p=(0,u.useRef)(null),y=(0,u.useRef)(null),g=(0,u.useRef)(null),j=(0,u.useRef)(null),b=(0,u.useRef)(null),v=(0,u.useRef)(null),M=i.length,z="metric"===s&&void 0!==o?o:0,A=h(c).warning,w=e=>"metric"===s?(l>0?(e-z)/l:0)*1.5:l>0?e/l*1.5:0,F=(0,u.useMemo)(()=>new Float32Array(3*M),[M]),S=(0,u.useMemo)(()=>new Float32Array(3*M),[M]),D=(0,u.useMemo)(()=>new Float32Array(3*M),[M]),B=(0,u.useMemo)(()=>new Float32Array(3*M),[M]),G=(0,u.useMemo)(()=>new Float32Array(6),[]),R=(0,u.useMemo)(()=>new Float32Array(6),[]),Z=(0,u.useMemo)(()=>new Float32Array(6),[]),N=(0,u.useMemo)(()=>new Float32Array(6),[]),k=(0,u.useMemo)(()=>new Float32Array(6),[]);return(0,a.F)(()=>{var e,n,l,a,o,s,u,c,h,z;if(!d.current)return;if(null===t||null===r){d.current.visible=!1;return}d.current.visible=!0;let A=Math.floor((t+2)/4*M),X=Math.floor((r+2)/4*M),Y=Math.max(0,Math.min(M-1,A)),P=Math.max(0,Math.min(M-1,X)),O=w(null!==(n=null===(e=i[P])||void 0===e?void 0:e[Y])&&void 0!==n?n:0);for(let e=0;e<M;e++){let t=(e/(M-1)-.5)*4,n=w(null!==(a=null===(l=i[P])||void 0===l?void 0:l[e])&&void 0!==a?a:0);F[3*e]=t,F[3*e+1]=r,F[3*e+2]=n+.02}for(let e=0;e<M;e++){let r=(e/(M-1)-.5)*4,n=w(null!==(s=null===(o=i[e])||void 0===o?void 0:o[Y])&&void 0!==s?s:0);S[3*e]=t,S[3*e+1]=r,S[3*e+2]=n+.02}for(let e=0;e<M;e++){let t=(e/(M-1)-.5)*4,r=w(null!==(c=null===(u=i[P])||void 0===u?void 0:u[e])&&void 0!==c?c:0);D[3*e]=t,D[3*e+1]=2.3,D[3*e+2]=r}for(let e=0;e<M;e++){let t=(e/(M-1)-.5)*4,r=w(null!==(z=null===(h=i[e])||void 0===h?void 0:h[Y])&&void 0!==z?z:0);B[3*e]=2.3,B[3*e+1]=t,B[3*e+2]=r}G[0]=t,G[1]=r,G[2]=O+.02,G[3]=t,G[4]=r,G[5]=0,R[0]=t,R[1]=2.3,R[2]=0,R[3]=t,R[4]=2.3,R[5]=O,Z[0]=2.3,Z[1]=r,Z[2]=0,Z[3]=2.3,Z[4]=r,Z[5]=O,N[0]=t,N[1]=-2,N[2]=.002,N[3]=t,N[4]=2,N[5]=.002,k[0]=-2,k[1]=r,k[2]=.002,k[3]=2,k[4]=r,k[5]=.002,x.current&&(x.current.attributes.position.needsUpdate=!0),m.current&&(m.current.attributes.position.needsUpdate=!0),f.current&&(f.current.attributes.position.needsUpdate=!0),p.current&&(p.current.attributes.position.needsUpdate=!0),y.current&&(y.current.attributes.position.needsUpdate=!0),g.current&&(g.current.attributes.position.needsUpdate=!0),j.current&&(j.current.attributes.position.needsUpdate=!0),b.current&&(b.current.attributes.position.needsUpdate=!0),v.current&&(v.current.attributes.position.needsUpdate=!0)}),(0,n.jsxs)("group",{ref:d,visible:!1,children:[(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:x,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:M,array:F,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:m,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:M,array:S,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:y,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:G,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.6})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:f,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:M,array:D,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.7})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:g,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:R,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.5})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:p,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:M,array:B,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.7})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:j,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:Z,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.5})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:b,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:N,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.4})]}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{ref:v,children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:k,itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:A,transparent:!0,opacity:.4})]})]})}function p(e){let{isDarkMode:t=!0}=e,r=h(t),i=r.accent,l=r.accent;return(0,n.jsxs)("group",{renderOrder:0,children:[(0,n.jsxs)("mesh",{position:[0,0,-.02],rotation:[0,0,0],renderOrder:0,children:[(0,n.jsx)("planeGeometry",{args:[4,4]}),(0,n.jsx)("meshBasicMaterial",{color:i,transparent:!0,opacity:t?.1:.15,side:c.ehD,depthWrite:!1})]}),(0,n.jsx)("gridHelper",{args:[4,8,l,l],rotation:[Math.PI/2,0,0],position:[0,0,-.019],renderOrder:1}),(0,n.jsxs)("mesh",{position:[0,2.3,.75],rotation:[-Math.PI/2,0,0],renderOrder:0,children:[(0,n.jsx)("planeGeometry",{args:[4,1.5]}),(0,n.jsx)("meshBasicMaterial",{color:i,transparent:!0,opacity:t?.08:.1,side:c.ehD,depthWrite:!1})]}),Array.from({length:5}).map((e,t)=>{let r=t/4*1.5;return(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:new Float32Array([-2,2.3,r,2,2.3,r]),itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:l,transparent:!0,opacity:.4})]},"back-h-".concat(t))}),Array.from({length:5}).map((e,t)=>{let r=-2+t/4*4;return(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:new Float32Array([r,2.3,0,r,2.3,1.5]),itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:l,transparent:!0,opacity:.4})]},"back-v-".concat(t))}),(0,n.jsxs)("mesh",{position:[2.3,0,.75],rotation:[-Math.PI/2,Math.PI/2,0],renderOrder:0,children:[(0,n.jsx)("planeGeometry",{args:[4,1.5]}),(0,n.jsx)("meshBasicMaterial",{color:i,transparent:!0,opacity:t?.08:.1,side:c.ehD,depthWrite:!1})]}),Array.from({length:5}).map((e,t)=>{let r=t/4*1.5;return(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:new Float32Array([2.3,-2,r,2.3,2,r]),itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:l,transparent:!0,opacity:.4})]},"right-h-".concat(t))}),Array.from({length:5}).map((e,t)=>{let r=-2+t/4*4;return(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:new Float32Array([2.3,r,0,2.3,r,1.5]),itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:l,transparent:!0,opacity:.4})]},"right-v-".concat(t))})]})}function y(e){let{minZ:t,maxZ:r,isDarkMode:l=!0}=e;if(t>=0||r<=0)return null;let a=(0-t)/(r-t||1)*1.5,o=h(l).textPrimary,s=l?.12:.15,u=l?.3:.4;return(0,n.jsxs)("group",{renderOrder:2,children:[(0,n.jsxs)("mesh",{position:[0,0,a],rotation:[0,0,0],renderOrder:2,children:[(0,n.jsx)("planeGeometry",{args:[4,4]}),(0,n.jsx)("meshBasicMaterial",{color:o,transparent:!0,opacity:s,side:c.ehD,depthWrite:!1})]}),(0,n.jsxs)("lineSegments",{position:[0,0,a],children:[(0,n.jsx)("edgesGeometry",{args:[new c._12(4,4)]}),(0,n.jsx)("lineBasicMaterial",{color:o,transparent:!0,opacity:u})]}),(0,n.jsx)(i.x,{position:[2.42,2.3,a],fontSize:.14,color:h(l).textTertiary,anchorX:"left",anchorY:"middle",fontWeight:"bold",children:"0"}),(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:new Float32Array([2.3,2.3,a,2.38,2.3,a]),itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:o,transparent:!0,opacity:u})]})]})}function g(e){let{grid:t,maxDensity:r,minZ:i,maxZ:l,zMode:o="density",mouseNDC:s,onHoverChange:d,isDarkMode:x=!0}=e,f=(0,u.useRef)(null),p=(0,u.useRef)(null),{camera:y}=(0,a.D)(),g=(0,u.useRef)(new c.iMs),j=(0,u.useRef)({x:null,y:null}),b=(0,u.useMemo)(()=>{let e=t.length,n=e-1,a=new c._12(4,4,n,n),s=a.attributes.position,u=new Float32Array(3*s.count),d="metric"===o&&void 0!==i?i:0,h=("metric"===o&&void 0!==l?l:r)-d||1;for(let n=0;n<s.count;n++){let a=s.getX(n),x=s.getY(n),f=Math.floor((a+2)/4*e),p=Math.floor((x+2)/4*e),y=Math.max(0,Math.min(e-1,f)),g=t[Math.max(0,Math.min(e-1,p))][y],j="metric"===o?(g-d)/h:r>0?g/r:0,b=1.5*j;s.setZ(n,b);let v="metric"===o&&void 0!==i&&void 0!==l?function(e,t,r){let n;let i=new c.Ilk;if(t>=0||r<=0||0===t&&0===r)return m((e-t)/(r-t||1));if((n=Math.max(-1,Math.min(1,n=e>=0?r>0?e/r:0:t<0?e/Math.abs(t):0)))>=0){let e=n;i.setRGB(.3-.1*e,.5+.35*e,.8-.5*e)}else{let e=Math.abs(n);i.setRGB(.3+.6*e,.5-.3*e,.8-.6*e)}return i}(g,i,l):m(Math.max(0,Math.min(1,j)));u[3*n]=v.r,u[3*n+1]=v.g,u[3*n+2]=v.b}return a.setAttribute("color",new c.TlE(u,3)),a.computeVertexNormals(),a},[t,r,i,l,o]);return(0,a.F)(()=>
1{if(p.current&&s){let e=new c.FM8(s.x,s.y);g.current.setFromCamera(e,y);let t=g.current.intersectObject(p.current);if(t.length>0){let e=t[0].point,r=Math.max(-2,Math.min(2,e.x)),n=Math.max(-2,Math.min(2,e.y));(j.current.x!==r||j.current.y!==n)&&(j.current={x:r,y:n},d(r,n))}else(null!==j.current.x||null!==j.current.y)&&(j.current={x:null,y:null},d(null,null))}else s||null===j.current.x&&null===j.current.y||(j.current={x:null,y:null},d(null,null))}),(0,n.jsxs)("group",{ref:f,children:[(0,n.jsx)("mesh",{ref:p,geometry:b,children:(0,n.jsx)("meshStandardMaterial",{vertexColors:!0,side:c.ehD,flatShading:!1,metalness:.05,roughness:.85,transparent:!x,opacity:x?1:.75})}),(0,n.jsx)("mesh",{geometry:b,children:(0,n.jsx)("meshBasicMaterial",{wireframe:!0,color:h(x).textPrimary,transparent:!0,opacity:x?.04:.08,side:c.ehD})})]})}function j(e){let{xs:t,ys:r,zs:i,minX:l,maxX:a,minY:o,maxY:s,minZ:d,maxZ:h,color:x,useZPosition:m=!1}=e,f=(0,u.useRef)(null),p=Math.min(t.length,3e3);return((0,u.useEffect)(()=>{if(!f.current||0===p)return;let e=a-l||1,n=s-o||1,u=void 0!==h&&void 0!==d&&h-d||1,x=new c.Tme;for(let a=0;a<p;a++){let s=((t[a]-l)/e-.5)*4,c=((r[a]-o)/n-.5)*4,p=.1;m&&i&&void 0!==i[a]&&void 0!==d&&void 0!==h&&(p=(i[a]-d)/u*1.5+.05),x.position.set(s,c,p),x.updateMatrix(),f.current.setMatrixAt(a,x.matrix)}f.current.instanceMatrix.needsUpdate=!0},[t,r,i,l,a,o,s,d,h,p,m]),0===p)?null:(0,n.jsxs)("instancedMesh",{ref:f,args:[void 0,void 0,p],renderOrder:100,frustumCulled:!1,children:[(0,n.jsx)("sphereGeometry",{args:[.03,8,6]}),(0,n.jsx)("meshBasicMaterial",{color:x,toneMapped:!1,transparent:!0,opacity:.6})]})}function b(e){let{xs:t,ys:r,zs:i,minX:l,maxX:a,minY:o,maxY:s,minZ:h,maxZ:x,color:m=(0,d.t5)().chartWarning}=e,f=(0,u.useMemo)(()=>{let e=[];for(let l=0;l<t.length;l++){var n;let a=null!==(n=null==i?void 0:i[l])&&void 0!==n?n:0;Number.isFinite(t[l])&&Number.isFinite(r[l])&&Number.isFinite(a)&&e.push({x:t[l],y:r[l],z:a})}if(e.length<2)return null;let u=a-l||1,d=s-o||1,m=null!=h?h:0,f=(null!=x?x:1)-m||1,p=e.length,y=0,g=0,j=0;for(let t of e)y+=t.x,g+=t.y,j+=t.z;y/=p,g/=p,j/=p;let b=0,v=0,M=0,z=0,A=0,w=0;for(let t of e){let e=t.x-y,r=t.y-g,n=t.z-j;b+=e*e,v+=r*r,M+=n*n,z+=e*r,A+=e*n,w+=r*n}b/=p,v/=p,M/=p,z/=p,A/=p,w/=p;let F=1,S=1,D=1;for(let e=0;e<50;e++){let e=b*F+z*S+A*D,t=z*F+v*S+w*D,r=A*F+w*S+M*D,n=Math.sqrt(e*e+t*t+r*r);if(n<1e-10)break;F=e/n,S=t/n,D=r/n}let B=1/0,G=-1/0;for(let t of e){let e=(t.x-y)*F+(t.y-g)*S+(t.z-j)*D;B=Math.min(B,e),G=Math.max(G,e)}let R=(G-B)*.1;B-=R,G+=R;let Z=[];for(let e=0;e<=2;e++){let t=B+e/2*(G-B),r=((y+t*F-l)/u-.5)*4,n=((g+t*S-o)/d-.5)*4,i=(j+t*D-m)/f*1.5+.02;Z.push(new c.Pa4(r,n,i))}return new c.u9r().setFromPoints(Z)},[t,r,i,l,a,o,s,h,x]),p=(0,u.useMemo)(()=>f?new c.x12(f,new c.nls({color:m,linewidth:3,transparent:!0,opacity:.9})):null,[f,m]);return p?(0,n.jsx)("primitive",{object:p,renderOrder:150}):null}function v(e){let t=Math.abs(e);return 0===t?"0":t>=1e3?e.toFixed(0):t>=100?e.toFixed(1):t>=10||t>=1?e.toFixed(2):t>=.1?e.toFixed(3):e.toFixed(4)}function M(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,n=t-e;if(0===n)return[e];let i=n/(r-1),l=[];for(let t=0;t<r;t++)l.push(e+i*t);return l}function z(e){let{xLabel:t,yLabel:r,zLabel:l,minX:a,maxX:o,minY:s,maxY:c,minZ:d,maxZ:x,zMode:m="density",isDarkMode:f=!0}=e,p=(0,u.useMemo)(()=>M(a,o,3),[a,o]),y=(0,u.useMemo)(()=>M(s,c,3),[s,c]),g=(0,u.useMemo)(()=>"metric"!==m||void 0===d||void 0===x?[]:M(d,x,3),[m,d,x]),j=e=>((e-a)/(o-a||1)-.5)*4,b=e=>((e-s)/(c-s||1)-.5)*4,z=e=>{if(void 0===d||void 0===x)return 0;let t=x-d||1;return(e-d)/t*1.5},A=h(f),w=A.textPrimary,F=A.textPrimary,S=A.accent;return(0,n.jsxs)("group",{children:[p.map((e,t)=>(0,n.jsx)(i.x,{position:[j(e),-2.15,0],fontSize:.14,color:w,anchorX:"center",anchorY:"middle",characters:"0123456789.-",children:v(e)},"x-tick-".concat(t,"-").concat(f))),t&&(0,n.jsx)(i.x,{position:[0,-2.45,0],fontSize:.16,color:F,anchorX:"center",anchorY:"middle",maxWidth:3.5,children:t},"x-label-".concat(f)),y.map((e,t)=>(0,n.jsx)(i.x,{position:[-2.15,b(e),0],fontSize:.14,color:w,anchorX:"right",anchorY:"middle",characters:"0123456789.-",children:v(e)},"y-tick-".concat(t,"-").concat(f))),r&&(0,n.jsx)(i.x,{position:[-2.55,0,0],fontSize:.16,color:F,rotation:[0,0,Math.PI/2],anchorX:"center",anchorY:"middle",maxWidth:3.5,children:r},"y-label-".concat(f)),"metric"===m&&g.map((e,t)=>(0,n.jsxs)("group",{children:[(0,n.jsxs)("line",{children:[(0,n.jsx)("bufferGeometry",{children:(0,n.jsx)("bufferAttribute",{attach:"attributes-position",count:2,array:new Float32Array([2.3,2.3,z(e),2.38,2.3,z(e)]),itemSize:3})}),(0,n.jsx)("lineBasicMaterial",{color:S,transparent:!0,opacity:.8})]}),(0,n.jsx)(i.x,{position:[2.42,2.3,z(e)],fontSize:.12,color:S,anchorX:"left",anchorY:"middle",characters:"0123456789.-%",children:v(e)})]},"z-tick-group-".concat(t,"-").concat(f))),(0,n.jsx)(i.x,{position:[2.4499999999999997,2.3,1.65],fontSize:.14,color:S,anchorX:"center",anchorY:"middle",maxWidth:2,children:l||"DENSITY"},"z-label-".concat(f,"-").concat(l||"density"))]},"axis-labels-".concat(f?"dark":"light","-").concat(m))}function A(e){var t,r,i,a,o,s,c,d,m,v,M,A;let{sample:w,sideSamples:F,xLabel:S,yLabel:D,zLabel:B,zMode:G="density",mouseNDC:R,isDarkMode:Z=!0,showPoints:N=!0,showSurface:k=!0,showRegression:X=!1}=e,[Y,P]=(0,u.useState)(null),[O,C]=(0,u.useState)(null),L=h(Z),{allXs:I,allYs:W,allZs:E}=(0,u.useMemo)(()=>{var e,t;let r=[],n=[],i=[];return(null==F?void 0:null===(e=F.long)||void 0===e?void 0:e.x)&&F.long.y&&(r.push(...F.long.x),n.push(...F.long.y),F.long.z&&i.push(...F.long.z)),(null==F?void 0:null===(t=F.short)||void 0===t?void 0:t.x)&&F.short.y&&(r.push(...F.short.x),n.push(...F.short.y),F.short.z&&i.push(...F.short.z)),0===r.length&&(r.push(...w.x),n.push(...w.y),w.z&&i.push(...w.z)),{allXs:r,allYs:n,allZs:i}},[w.x,w.y,w.z,null==F?void 0:null===(t=F.long)||void 0===t?void 0:t.x,null==F?void 0:null===(r=F.long)||void 0===r?void 0:r.y,null==F?void 0:null===(i=F.long)||void 0===i?void 0:i.z,null==F?void 0:null===(a=F.short)||void 0===a?void 0:a.x,null==F?void 0:null===(o=F.short)||void 0===o?void 0:o.y,null==F?void 0:null===(s=F.short)||void 0===s?void 0:s.z]),{grid:U,minX:T,maxX:_,minY:H,maxY:V,maxDensity:q,minZ:J,maxZ:K}=(0,u.useMemo)(()=>
1{if("metric"===G&&E.length>0){let e=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:80;if(0===e.length||0===t.length||0===r.length)return{grid:Array(n).fill(null).map(()=>Array(n).fill(0)),minX:0,maxX:1,minY:0,maxY:1,minZ:0,maxZ:1};let i=Math.min(...e),l=Math.max(...e),a=Math.min(...t),o=Math.max(...t),s=Math.min(...r),u=Math.max(...r),c=l-i||1,d=o-a||1,h=[];for(let n=0;n<e.length&&n<r.length;n++)Number.isFinite(e[n])&&Number.isFinite(t[n])&&Number.isFinite(r[n])&&h.push({x:e[n],y:t[n],z:r[n]});if(0===h.length)return{grid:Array(n).fill(null).map(()=>Array(n).fill(0)),minX:i,maxX:l,minY:a,maxY:o,minZ:s,maxZ:u};let m=Array(n).fill(null).map(()=>Array(n).fill(0));for(let e=0;e<n;e++)for(let t=0;t<n;t++){let r=i+(t+.5)/n*c,l=a+(e+.5)/n*d,o=0,u=0;for(let e of h){let t=(e.x-r)/c,n=(e.y-l)/d,i=1/(Math.pow(Math.sqrt(t*t+n*n),2)+1e-4);o+=i,u+=i*e.z}m[e][t]=o>0?u/o:s}return{grid:x(m,.8),minX:i,maxX:l,minY:a,maxY:o,minZ:s,maxZ:u}}(I,W,E),t=e.maxZ-e.minZ;return{...e,maxDensity:t||1}}let e=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:80;if(0===e.length||0===t.length)return{grid:Array(r).fill(null).map(()=>Array(r).fill(0)),minX:0,maxX:1,minY:0,maxY:1,maxDensity:0};let n=Math.min(...e),i=Math.max(...e),l=Math.min(...t),a=Math.max(...t),o=i-n||1,s=a-l||1,u=[];for(let r=0;r<e.length;r++)Number.isFinite(e[r])&&Number.isFinite(t[r])&&u.push({x:e[r],y:t[r]});if(0===u.length)return{grid:Array(r).fill(null).map(()=>Array(r).fill(0)),minX:n,maxX:i,minY:l,maxY:a,maxDensity:0};let c=2.5/r,d=Array(r).fill(null).map(()=>Array(r).fill(0));for(let e=0;e<r;e++)for(let t=0;t<r;t++){let i=(t+.5)/r,a=(e+.5)/r,h=0;for(let e of u){let t=(e.x-n)/o,r=(e.y-l)/s,u=(t-i)/c,d=(r-a)/c,x=u*u+d*d;x<9&&(h+=Math.exp(-.5*x))}d[e][t]=h}let h=x(d,.6),m=Math.max(...h.flat());return{grid:h,minX:n,maxX:i,minY:l,maxY:a,maxDensity:m}}(I,W);return{...e,minZ:0,maxZ:e.maxDensity}},[I,W,E,G]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("ambientLight",{intensity:.4}),(0,n.jsx)("directionalLight",{position:[5,5,5],intensity:.7}),(0,n.jsx)("directionalLight",{position:[-3,-3,2],intensity:.25}),(0,n.jsx)("pointLight",{position:[0,0,4],intensity:.3}),(0,n.jsx)(p,{isDarkMode:Z}),"metric"===G&&void 0!==J&&void 0!==K&&(0,n.jsx)(y,{minZ:J,maxZ:K,isDarkMode:Z}),k&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(g,{grid:U,maxDensity:q,minZ:J,maxZ:K,zMode:G,mouseNDC:R,onHoverChange:(e,t)=>
1{P(e),C(t)},isDarkMode:Z}),(0,n.jsx)(f,{hoverX:Y,hoverY:O,grid:U,maxDensity:q,minZ:J,zMode:G,isDarkMode:Z})]}),N&&(0,n.jsxs)(n.Fragment,{children:[(null==F?void 0:null===(c=F.long)||void 0===c?void 0:c.x)&&F.long.x.length>0&&(0,n.jsx)(j,{xs:F.long.x,ys:F.long.y,zs:F.long.z,minX:T,maxX:_,minY:H,maxY:V,minZ:J,maxZ:K,color:L.gain,useZPosition:"metric"===G}),(null==F?void 0:null===(d=F.short)||void 0===d?void 0:d.x)&&F.short.x.length>0&&(0,n.jsx)(j,{xs:F.short.x,ys:F.short.y,zs:F.short.z,minX:T,maxX:_,minY:H,maxY:V,minZ:J,maxZ:K,color:L.loss,useZPosition:"metric"===G}),!(null==F?void 0:null===(v=F.long)||void 0===v?void 0:null===(m=v.x)||void 0===m?void 0:m.length)&&!(null==F?void 0:null===(A=F.short)||void 0===A?void 0:null===(M=A.x)||void 0===M?void 0:M.length)&&w.x.length>0&&(0,n.jsx)(j,{xs:w.x,ys:w.y,zs:w.z,minX:T,maxX:_,minY:H,maxY:V,minZ:J,maxZ:K,color:L.accent,useZPosition:"metric"===G})]}),X&&I.length>1&&(0,n.jsx)(b,{xs:I,ys:W,zs:"metric"===G?E:void 0,minX:T,maxX:_,minY:H,maxY:V,minZ:J,maxZ:K,color:L.warning}),(0,n.jsx)(z,{xLabel:S,yLabel:D,zLabel:B,minX:T,maxX:_,minY:H,maxY:V,minZ:J,maxZ:K,zMode:G,isDarkMode:Z}),(0,n.jsx)(l.z,{enablePan:!0,enableZoom:!0,enableRotate:!0,minDistance:3,maxDistance:12,rotateSpeed:.8,enableDamping:!0,dampingFactor:.05,minPolarAngle:.2,maxPolarAngle:Math.PI/2+.2,zoomSpeed:.7,panSpeed:.4,makeDefault:!0})]})}function w(e){var t,r,i,l;let{size:a,sample:c,sideSamples:d,xLabel:h,yLabel:x,zLabel:m,zMode:f="density",isDarkMode:p,showPoints:y=!0,showSurface:g=!0,showRegression:j=!1}=e,b=(0,u.useRef)(null),[v,M]=(0,u.useState)(null),{resolvedTheme:z}=(0,s.F)();return c.x.length>0||(null==d?void 0:null===(r=d.long)||void 0===r?void 0:null===(t=r.x)||void 0===t?void 0:t.length)||(null==d?void 0:null===(l=d.short)||void 0===l?void 0:null===(i=l.x)||void 0===i?void 0:i.length)?(0,n.jsxs)("div",{ref:b,style:{width:"100%",height:"100%"},className:"relative",onMouseMove:e=>{if(!b.current)return;let t=b.current.getBoundingClientRect();M({x:(e.clientX-t.left)/t.width*2-1,y:-((e.clientY-t.top)/t.height*2)+1})},onMouseLeave:()=>{M(null)},children:[(0,n.jsx)(o.Xz,{camera:{position:[4.5,-4.5,2.5],fov:40,up:[0,0,1]},style:{background:"transparent"},gl:{antialias:!0,alpha:!0},onCreated:e=>{let{camera:t}=e;t.up.set(0,0,1)},children:(0,n.jsx)(A,{sample:c,sideSamples:d,xLabel:h,yLabel:x,zLabel:m,zMode:f,mouseNDC:v,isDarkMode:z?"dark"===z:null==p||p,showPoints:y,showSurface:g,showRegression:j})}),(0,n.jsxs)("div",{className:"pointer-events-none absolute bottom-2 left-2 right-2 flex items-center justify-between font-mono text-micro text-text-tertiary",children:[(0,n.jsx)("span",{className:"opacity-70",children:"DRAG: ROTATE | SCROLL: ZOOM | HOVER: INSPECT"}),(0,n.jsxs)("div",{className:"flex items-center gap-3 rounded bg-bg-primary/60 px-2 py-1",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-5"}),(0,n.jsx)("span",{children:"LOW"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm bg-gain"}),(0,n.jsx)("span",{children:"MED"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{className:"inline-block h-2 w-2 rounded-sm bg-chart-warning"}),(0,n.jsx)("span",{children:"HIGH"})]})]})]})]}):(0,n.jsx)("div",{className:"flex items-center justify-center font-mono text-xs text-text-tertiary",style:{width:a.width,height:a.height},children:"No data available for 3D visualization."})}t.default=w}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.