Files
doormilebuild/build/_next/static/chunks/0lr8xk62out3u.js
2026-06-04 15:19:49 +05:30

57 lines
31 KiB
JavaScript

(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,69986,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(75056),i=e.i(25234),s=e.i(79877),o=e.i(33623),a=e.i(90072),l=e.i(92695);function c(e){return e<0?0:e>1?1:e}function u(e,t,r){let n=c((r-e)/(t-e||1));return n*n*(3-2*n)}function d(e,t,r,n){return e+(t-e)*(1-Math.exp(-r*n))}function p(e){let t=43758.5453*Math.sin(127.1*e+311.7);return t-Math.floor(t)}function h(e,t=0){let r=new Float32Array(3*e),n=Math.PI*(3-Math.sqrt(5));for(let i=0;i<e;i++){let s=1-i/(e-1)*2,o=Math.sqrt(1-s*s),a=n*i,l=1+(p(1.7*i)-.5)*t;r[3*i]=Math.cos(a)*o*l,r[3*i+1]=s*l,r[3*i+2]=Math.sin(a)*o*l}return r}let m=r.default.memo(function({progress:e,isMobile:n=!1}){let s=(0,r.useRef)(null),o=(0,r.useRef)(null),p=(0,r.useRef)(null),m=(0,r.useRef)(null),f=(0,r.useRef)(null),x=(0,r.useRef)(null),g=(0,r.useRef)(null),y=(0,r.useRef)(null),M=(0,r.useRef)(0),b=n?700:1500,v=n?900:2200,j=(0,r.useMemo)(()=>h(b,.18),[b]),w=(0,r.useMemo)(()=>h(v,.55),[v]),A=(0,r.useMemo)(()=>h(Math.floor(.6*v),.7),[v]);return(0,i.useFrame)((t,r)=>{let n=e.current??0;M.current=d(M.current,n,3,r);let i=M.current,a=t.clock.elapsedTime,h=s.current;if(!h)return;let b=u(0,l.P.routes,i),v=u(l.P.network,l.P.network+.06,i)*(1-u(l.P.ecosystem,l.P.finale,i)),j=u(l.P.finale,1,i),w=.5*(.001+.999*b)*(1-.32*v)*(1+.18*j)*(1+.03*Math.sin(.9*a));if(h.scale.setScalar(w),h.position.y=l.BRAIN_Y+.18*Math.sin(.6*a),h.rotation.y=.12*a,o.current&&o.current.rotation.set(.18*a,.24*a,0),p.current&&p.current.rotation.set(-(.22*a),.16*a,.1*a),x.current&&(x.current.rotation.y=.06*a),g.current&&(g.current.rotation.y=.35*a,g.current.rotation.x=.3*Math.sin(.2*a)),y.current&&(y.current.rotation.y=-(.28*a),y.current.rotation.z=.18*a),m.current){let e=1+.06*Math.sin(1.6*a)+.4*j;m.current.scale.setScalar(e)}f.current&&(f.current.opacity=c(.22+.05*Math.sin(1.6*a)+.25*j)*b)}),(0,t.jsxs)("group",{ref:s,position:[0,l.BRAIN_Y,0],children:[(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.95,24,24]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.blue,transparent:!0,opacity:.18,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.42,24,24]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.white,transparent:!0,opacity:.9,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{ref:o,children:[(0,t.jsx)("icosahedronGeometry",{args:[1.35,1]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.cyan,wireframe:!0,transparent:!0,opacity:.55,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{ref:p,children:[(0,t.jsx)("icosahedronGeometry",{args:[1.7,2]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.violet,wireframe:!0,transparent:!0,opacity:.32,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("points",{ref:x,children:[(0,t.jsx)("bufferGeometry",{children:(0,t.jsx)("bufferAttribute",{attach:"attributes-position",args:[j,3]})}),(0,t.jsx)("pointsMaterial",{size:n?.05:.045,color:l.C.sky,transparent:!0,opacity:.85,sizeAttenuation:!0,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("points",{ref:g,scale:1.6,children:[(0,t.jsx)("bufferGeometry",{children:(0,t.jsx)("bufferAttribute",{attach:"attributes-position",args:[w,3]})}),(0,t.jsx)("pointsMaterial",{size:.04,color:l.C.cyan,transparent:!0,opacity:.6,sizeAttenuation:!0,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("points",{ref:y,scale:2,children:[(0,t.jsx)("bufferGeometry",{children:(0,t.jsx)("bufferAttribute",{attach:"attributes-position",args:[A,3]})}),(0,t.jsx)("pointsMaterial",{size:.035,color:l.C.purple,transparent:!0,opacity:.45,sizeAttenuation:!0,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{ref:m,rotation:[Math.PI/2,0,0],children:[(0,t.jsx)("ringGeometry",{args:[2.1,2.25,64]}),(0,t.jsx)("meshBasicMaterial",{ref:f,color:l.C.cyan,transparent:!0,opacity:.22,side:a.DoubleSide,blending:a.AdditiveBlending,depthWrite:!1})]})]})}),f=new a.Object3D,x=new a.Color,g=`
attribute vec3 aSize;
attribute float aSeed;
varying vec2 vWinUv;
varying vec3 vWinNrm;
varying vec3 vWinSize;
varying float vWinSeed;
`,y=`
vWinUv = uv;
vWinNrm = normal;
vWinSize = aSize;
vWinSeed = aSeed;
`,M=`
uniform float uTime;
varying vec2 vWinUv;
varying vec3 vWinNrm;
varying vec3 vWinSize;
varying float vWinSeed;
float h11(float p){ p = fract(p*0.1031); p *= p+33.33; p *= p+p; return fract(p); }
float h21(vec2 p){ vec3 p3 = fract(vec3(p.xyx)*0.1031); p3 += dot(p3, p3.yzx+33.33); return fract((p3.x+p3.y)*p3.z); }
`,b=`
// facade tint varies per building — dark neutral charcoal (brand: near-black)
vec3 baseA = vec3(0.040, 0.040, 0.048);
vec3 baseB = vec3(0.065, 0.058, 0.066);
diffuseColor.rgb = mix(baseA, baseB, h11(vWinSeed*1.7));
// windows only on the four vertical faces (skip roof/floor)
float isVert = 1.0 - step(0.5, abs(vWinNrm.y));
vec2 faceDim = abs(vWinNrm.x) > 0.5 ? vec2(vWinSize.z, vWinSize.y) : vec2(vWinSize.x, vWinSize.y);
vec2 cells = max(vec2(1.0), floor(faceDim / 0.52));
vec2 g = vWinUv * cells;
vec2 id = floor(g);
vec2 f = fract(g);
float m = 0.16; // mullion margin
float pane = step(m, f.x) * step(f.x, 1.0 - m) * step(m, f.y) * step(f.y, 1.0 - m);
float rnd = h21(id + vWinSeed * 37.0);
float lit = step(0.68, rnd); // ~32% of windows lit (dimmer skyline backdrop)
float toggle = step(0.97, h21(id * 1.31 + vWinSeed * 5.0 + floor(uTime * 0.5)));
lit = clamp(lit + toggle, 0.0, 1.0); // a few flick on/off over time
float flick = 0.9 + 0.1 * sin(uTime * 2.0 + rnd * 30.0);
// Brand-tinted windows: mostly warm white with occasional brand-red panes.
vec3 warmWhite = vec3(1.0, 0.88, 0.80);
vec3 brandRed = vec3(0.82, 0.18, 0.24);
vec3 wcol = mix(warmWhite, brandRed, step(0.7, h21(id * 0.7 + vWinSeed)));
float glow = isVert * pane * lit * flick;
totalEmissiveRadiance += wcol * glow * 0.85;
// dark mullion grid + dimmer unlit glass
diffuseColor.rgb *= (0.42 + 0.58 * pane);
`,v=r.default.memo(function({progress:e,isMobile:n=!1}){let s=(0,r.useRef)(null),o=(0,r.useRef)(null),c=(0,r.useRef)(null),h=(0,r.useRef)(null),m=(0,r.useRef)(null),v=(0,r.useRef)(null),j=(0,r.useRef)(null),w=(0,r.useRef)(null),A=(0,r.useRef)(null),C=(0,r.useRef)(null),B=(0,r.useRef)(0),R=n?20:34,P=(0,r.useMemo)(()=>{let e=[];for(let t=0;t<R;t++){let r=p(3.1*t+.5)*Math.PI*2,n=12.5+p(1.7*t+2.2)*(l.CITY_RADIUS-12.5),i=Math.cos(r)*n,s=Math.sin(r)*n,o=.8+1.7*p(5.3*t),a=.8+1.7*p(2.9*t+9),c=1.6+3.2*p(7.7*t+4),u=Math.floor(p(11.1*t)*l.ROUTE_COLORS.length),d=c>3.4&&p(13.3*t)>.42,h=d?.62*c:c,m=Math.floor(4*p(17.7*t))*Math.PI/8+.12*p(4.1*t),f=c>5;e.push({x:i,z:s,w:o,d:a,h:c,bodyH:h,rot:m,ci:u,tier:d,tall:f})}let t=e.filter(e=>e.tier),r=e.filter(e=>e.tall),n=new a.BoxGeometry(1,1,1),i=new Float32Array(3*R),s=new Float32Array(R);e.forEach((e,t)=>{i[3*t]=e.w,i[3*t+1]=e.bodyH,i[3*t+2]=e.d,s[t]=10*p(23.1*t)}),n.setAttribute("aSize",new a.InstancedBufferAttribute(i,3)),n.setAttribute("aSeed",new a.InstancedBufferAttribute(s,1));let o=new a.BoxGeometry(1,1,1),c=new Float32Array(3*Math.max(1,t.length)),u=new Float32Array(Math.max(1,t.length));return t.forEach((e,t)=>{let r=.64*e.w,n=.64*e.d,i=e.h-e.bodyH;c[3*t]=r,c[3*t+1]=i,c[3*t+2]=n,u[t]=10*p(29.7*t)}),o.setAttribute("aSize",new a.InstancedBufferAttribute(c,3)),o.setAttribute("aSeed",new a.InstancedBufferAttribute(u,1)),{buildings:e,tierList:t,tallList:r,bodyGeom:n,tierGeom:o}},[R]),S=(0,r.useMemo)(()=>{let e=new a.MeshStandardMaterial({color:"#0c1226",emissive:"#000000",metalness:.35,roughness:.62});return e.onBeforeCompile=e=>{e.uniforms.uTime={value:0},C.current=e,e.vertexShader=e.vertexShader.replace("#include <common>",`#include <common>
${g}`).replace("#include <begin_vertex>",`#include <begin_vertex>
${y}`),e.fragmentShader=e.fragmentShader.replace("#include <common>",`#include <common>
${M}`).replace("#include <emissivemap_fragment>",`#include <emissivemap_fragment>
${b}`)},e},[]),W=(0,r.useMemo)(()=>{let e=[];for(let t=0;t<12;t++){let r=t/12*Math.PI*2,n=l.CITY_RADIUS*(.72+.26*p(4.4*t));e.push(+Math.cos(r),.04,+Math.sin(r)),e.push(Math.cos(r)*n,.04,Math.sin(r)*n)}for(let t of[3.5,7,11,15])for(let r=0;r<64;r++){let n=r/64*Math.PI*2,i=(r+1)/64*Math.PI*2;e.push(Math.cos(n)*t,.04,Math.sin(n)*t),e.push(Math.cos(i)*t,.04,Math.sin(i)*t)}let t=new a.BufferGeometry;return t.setAttribute("position",new a.Float32BufferAttribute(e,3)),t},[]);return(0,r.useLayoutEffect)(()=>{let{buildings:e,tierList:t,tallList:r}=P;o.current&&(e.forEach((e,t)=>{f.position.set(e.x,e.bodyH/2,e.z),f.rotation.set(0,e.rot,0),f.scale.set(e.w,e.bodyH,e.d),f.updateMatrix(),o.current.setMatrixAt(t,f.matrix)}),o.current.instanceMatrix.needsUpdate=!0),c.current&&(t.forEach((e,t)=>{let r=e.h-e.bodyH;f.position.set(e.x,e.bodyH+r/2,e.z),f.rotation.set(0,e.rot,0),f.scale.set(.64*e.w,r,.64*e.d),f.updateMatrix(),c.current.setMatrixAt(t,f.matrix)}),c.current.instanceMatrix.needsUpdate=!0),h.current&&(e.forEach((e,t)=>{let r=e.h,n=e.tier?.64*e.w:e.w,i=e.tier?.64*e.d:e.d;f.position.set(e.x,r+.03,e.z),f.rotation.set(0,e.rot,0),f.scale.set(1.02*n,.07,1.02*i),f.updateMatrix(),h.current.setMatrixAt(t,f.matrix),h.current.setColorAt(t,x.set(l.ROUTE_COLORS[e.ci]))}),h.current.instanceMatrix.needsUpdate=!0,h.current.instanceColor&&(h.current.instanceColor.needsUpdate=!0)),m.current&&v.current&&(r.forEach((e,t)=>{f.position.set(e.x,e.h+.34,e.z),f.rotation.set(0,0,0),f.scale.set(.05,.68,.05),f.updateMatrix(),m.current.setMatrixAt(t,f.matrix),f.position.set(e.x,e.h+.7,e.z),f.scale.set(1,1,1),f.updateMatrix(),v.current.setMatrixAt(t,f.matrix)}),m.current.instanceMatrix.needsUpdate=!0,v.current.instanceMatrix.needsUpdate=!0)},[P]),(0,i.useFrame)((t,r)=>{let n=e.current??0;B.current=d(B.current,n,3,r);let i=B.current,o=t.clock.elapsedTime;C.current&&(C.current.uniforms.uTime.value=o);let a=u(.01,l.P.routes+.02,i);s.current&&(s.current.scale.y=.001+.999*a),v.current&&(v.current.material.opacity=(.5+.3*Math.sin(2.2*o))*a),j.current&&(j.current.opacity=(0+.6*u(.02,l.P.routes,i))*(.78+.22*Math.sin(2.2*o)));let c=u(0,l.P.routes,i);if(w.current){let e=1+.35*o%1*6;w.current.scale.set(e,e,e),w.current.material.opacity=(1-.35*o%1)*.28*c}if(A.current){let e=1+(.35*o+.5)%1*6;A.current.scale.set(e,e,e),A.current.material.opacity=(1-(.35*o+.5)%1)*.28*c}}),(0,t.jsxs)("group",{children:[(0,t.jsx)("gridHelper",{args:[2.6*l.CITY_RADIUS,60,l.C.blue,l.C.blue],position:[0,0,0],children:(0,t.jsx)("lineBasicMaterial",{attach:"material",color:l.C.blue,transparent:!0,opacity:.11,depthWrite:!1})}),(0,t.jsx)("lineSegments",{geometry:W,children:(0,t.jsx)("lineBasicMaterial",{ref:j,color:l.C.cyan,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsxs)("mesh",{ref:w,rotation:[-Math.PI/2,0,0],position:[0,.03,0],children:[(0,t.jsx)("ringGeometry",{args:[1,1.12,48]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.cyan,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{ref:A,rotation:[-Math.PI/2,0,0],position:[0,.03,0],children:[(0,t.jsx)("ringGeometry",{args:[1,1.12,48]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.violet,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("group",{ref:s,children:[(0,t.jsx)("instancedMesh",{ref:o,args:[P.bodyGeom,S,P.buildings.length]}),P.tierList.length>0&&(0,t.jsx)("instancedMesh",{ref:c,args:[P.tierGeom,S,P.tierList.length]}),(0,t.jsxs)("instancedMesh",{ref:h,args:[void 0,void 0,P.buildings.length],children:[(0,t.jsx)("boxGeometry",{args:[1,1,1]}),(0,t.jsx)("meshBasicMaterial",{toneMapped:!1,transparent:!0,opacity:.9,blending:a.AdditiveBlending})]}),P.tallList.length>0&&(0,t.jsxs)("instancedMesh",{ref:m,args:[void 0,void 0,P.tallList.length],children:[(0,t.jsx)("boxGeometry",{args:[1,1,1]}),(0,t.jsx)("meshStandardMaterial",{color:"#11182c",metalness:.7,roughness:.4})]}),P.tallList.length>0&&(0,t.jsxs)("instancedMesh",{ref:v,args:[void 0,void 0,P.tallList.length],children:[(0,t.jsx)("sphereGeometry",{args:[.07,8,8]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.red,toneMapped:!1,transparent:!0,opacity:.8,blending:a.AdditiveBlending,depthWrite:!1})]})]})]})});var j=e.i(60099);let w=[98,76,84,68,58,90],A={display:"flex",alignItems:"center",gap:"6px",padding:"4px 11px",borderRadius:"999px",background:"rgba(7,11,22,0.72)",border:"1px solid rgba(255,255,255,0.16)",color:"#eaf2ff",fontSize:"11px",fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",backdropFilter:"blur(6px)",WebkitBackdropFilter:"blur(6px)",fontFamily:"var(--font-space-grotesk), system-ui, sans-serif",opacity:0,pointerEvents:"none",willChange:"opacity"},C=l.WINNER_INDEX,B=(l.P.ev+l.P.network)/2,R=new a.Color(l.C.green),P=new a.Color(l.C.amber),S=new a.Color(l.C.red),W=new a.Color,z=r.default.memo(function({progress:e}){let n=(0,r.useRef)(0),s=(0,r.useRef)([]),o=(0,r.useRef)([]),h=(0,r.useRef)(null),m=(0,r.useRef)(null),f=(0,r.useRef)(null),x=(0,r.useRef)(null),g=(0,r.useRef)(null),y=(0,r.useRef)(null),M=(0,r.useMemo)(()=>l.ROUTE_COLORS.map((e,t)=>{let r,n,i,s,o,c;return r=t/l.ROUTE_COLORS.length*Math.PI*2+.4,n=9+4*p(6.1*t),i=new a.Vector3(Math.cos(r)*n,.16,Math.sin(r)*n),s=(p(3.7*t)-.5)*5,o=new a.Vector3(Math.cos(r)*n*.4+Math.cos(r+Math.PI/2)*s,.18,Math.sin(r)*n*.4+Math.sin(r+Math.PI/2)*s),c=new a.Vector3(0,.2,0),new a.CatmullRomCurve3([c,o,i])}),[]),b=(0,r.useMemo)(()=>M.map(e=>new a.TubeGeometry(e,60,.05,8,!1)),[M]),v=(0,r.useMemo)(()=>new a.CatmullRomCurve3([new a.Vector3(-11,.3,7),new a.Vector3(-4,.3,3),new a.Vector3(2.6,.3,-1.2),new a.Vector3(9.5,.3,-6.5)]),[]),z=(0,r.useMemo)(()=>new a.TubeGeometry(v,70,.07,8,!1),[v]),I=(0,r.useMemo)(()=>{let e=new a.CatmullRomCurve3([new a.Vector3(-11,.3,7),new a.Vector3(-3.5,.3,1.5),new a.Vector3(2.6,.6,-1.2),new a.Vector3(6.5,.3,-3),new a.Vector3(9.5,.3,-6.5)]);return new a.TubeGeometry(e,80,.08,8,!1)},[]),k=(0,r.useMemo)(()=>new a.Vector3(2.6,0,-1.2),[]),G=(0,r.useMemo)(()=>new a.Vector3,[]),T=(0,r.useMemo)(()=>l.ROUTE_COLORS.map(e=>new a.Color(e)),[]),O=(0,r.useMemo)(()=>new a.Color(l.C.red),[]),U=(0,r.useRef)([]),E=(0,r.useRef)([]),V=(0,r.useRef)(null),F=(0,r.useMemo)(()=>M.map(e=>{let t=e.getPointAt(.82).clone();return t.y+=1,t}),[M]);return(0,i.useFrame)((t,r)=>{let i=e.current??0;n.current=d(n.current,i,3.2,r);let a=n.current,b=t.clock.elapsedTime,j=u(l.P.routes-.03,l.P.routes+.05,a),w=u(l.P.routes,l.P.routes+.05,a),A=u(l.P.ev,l.P.ev+.05,a),z=u(l.P.sla,l.P.ecosystem,a),k=u(l.P.ecosystem,l.P.ecosystem+.06,a),F=c((a-l.P.ecosystem)/(1-l.P.ecosystem)),L=u(.97,1,a);for(let e=0;e<M.length;e++){let t=e===C,r=4===e,n=r?Math.max(z,.55*A):z,i=s.current[e];if(i){r&&i.color.copy(T[e]).lerp(O,A);let s=.55*j;t?s*=(.72+.28*Math.sin(3*b))*(1+.9*k):s*=1-n,i.opacity=c(s)*(1-L)}let a=o.current[e];if(a){let r=((b*(.16+.02*e)+p(9*e))%1+1)%1;M[e].getPointAt(r,G),a.position.copy(G);let i=(t?1:1-n)*w*(1-L);a.scale.setScalar(1e-4+i*(t?.18:.1))}}for(let e=0;e<E.current.length;e++){let t=E.current[e];if(!t)continue;let r=e===C,n=4===e,i=(n?u(l.P.ev,l.P.ev+.04,a):u(l.P.network,l.P.network+.04,a))*(1-(r?L:n?Math.max(z,0):z));t.style.opacity=i.toFixed(3),t.style.display=i<.02?"none":"flex"}if(U.current.length){let e=M[C];for(let t=0;t<U.current.length;t++){let r=U.current[t];if(!r)continue;let n=F>.02;if(r.visible=n,!n)continue;let i=((.14*b+.34*t)%1+1)%1;e.getPointAt(i,G),r.position.set(G.x,.3,G.z),e.getPointAt(Math.min(.999,i+.02),G),r.lookAt(G.x,.3,G.z),r.scale.setScalar(1e-4+u(0,.12,F)*(1-L))}}let N=u(l.P.ev-.02,l.P.ev+.03,a),_=1-u(l.P.network+.02,l.P.network+.1,a),Y=u(B-.015,B+.03,a),D=N*_,H=c((a-l.P.ev)/(l.P.network-l.P.ev));if(h.current){let e=Y>.5?I.parameters.path:v;e.getPointAt(c(H),G),h.current.position.set(G.x,.32,G.z),e.getPointAt(c(H+.01),G),h.current.lookAt(G.x,.32,G.z),h.current.visible=D>.02,h.current.scale.setScalar(1e-4+D)}let $=c((a-l.P.ev)/(B-l.P.ev)),q=Y>0?.14+.86*Y:c(1-.92*$);if(m.current&&(m.current.scale.x=.02+.98*q,m.current.position.x=-.18*(1-q)),f.current&&(q>.5?W.copy(P).lerp(R,(q-.5)*2):W.copy(S).lerp(P,2*q),f.current.color.copy(W)),g.current){let e=u(B-.06,B,a);g.current.opacity=.55*Math.max(.4*N,e)*D*(1-Y)*(.7+.3*Math.sin(5*b))}if(y.current&&(y.current.opacity=D*Y*(.65+.25*Math.sin(3*b))),x.current&&(x.current.scale.y=1e-4+Y,x.current.visible=Y>.01&&_>.02),V.current){let e=Y*_;V.current.style.opacity=e.toFixed(3),V.current.style.display=e<.02?"none":"flex"}}),(0,t.jsxs)("group",{children:[b.map((e,r)=>(0,t.jsxs)("group",{children:[(0,t.jsx)("mesh",{geometry:e,children:(0,t.jsx)("meshBasicMaterial",{ref:e=>{s.current[r]=e},color:l.ROUTE_COLORS[r],toneMapped:!1,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsxs)("mesh",{ref:e=>{o.current[r]=e},children:[(0,t.jsx)("sphereGeometry",{args:[1,12,12]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.white,toneMapped:!1,transparent:!0,opacity:.95,blending:a.AdditiveBlending,depthWrite:!1})]})]},r)),F.map((e,r)=>{let n=r===C,i=4===r,s=n||i?l.C.red:l.ROUTE_COLORS[r];return(0,t.jsx)(j.Html,{position:[e.x,e.y,e.z],center:!0,zIndexRange:[30,0],style:{pointerEvents:"none"},children:(0,t.jsxs)("div",{ref:e=>{E.current[r]=e},style:{...A,border:n?"1px solid rgba(226,53,66,0.85)":i?"1px solid rgba(239,68,68,0.7)":A.border,background:n?"rgba(28,8,11,0.85)":A.background,boxShadow:n?"0 0 22px rgba(192,18,39,0.6)":"none"},children:[(0,t.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:s,boxShadow:`0 0 8px ${s}`}}),l.STRATEGIES[r],(0,t.jsx)("span",{style:{fontWeight:800,color:i?"#fca5a5":"#fff",marginLeft:2},children:w[r]}),n?(0,t.jsx)("span",{style:{color:"#4ade80",fontWeight:700},children:" ✓ Best"}):null,i?(0,t.jsx)("span",{style:{color:"#fca5a5",fontWeight:700},children:" ✕ Over range"}):null]})},`lbl${r}`)}),(0,t.jsx)("mesh",{geometry:z,children:(0,t.jsx)("meshBasicMaterial",{ref:g,color:l.C.red,toneMapped:!1,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsx)("mesh",{geometry:I,children:(0,t.jsx)("meshBasicMaterial",{ref:y,color:l.C.green,toneMapped:!1,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsxs)("group",{ref:x,position:k,visible:!1,children:[(0,t.jsxs)("mesh",{position:[0,.55,0],children:[(0,t.jsx)("boxGeometry",{args:[.32,1.1,.32]}),(0,t.jsx)("meshStandardMaterial",{color:"#0e1b14",emissive:l.C.green,emissiveIntensity:.6,metalness:.4,roughness:.5})]}),(0,t.jsxs)("mesh",{position:[0,1.18,0],children:[(0,t.jsx)("boxGeometry",{args:[.5,.18,.42]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.green,toneMapped:!1,transparent:!0,opacity:.9,blending:a.AdditiveBlending})]}),(0,t.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.03,0],children:[(0,t.jsx)("ringGeometry",{args:[.5,.62,40]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.green,toneMapped:!1,transparent:!0,opacity:.7,side:a.DoubleSide,blending:a.AdditiveBlending,depthWrite:!1})]})]}),(0,t.jsx)(j.Html,{position:[k.x,1.7,k.z],center:!0,zIndexRange:[30,0],style:{pointerEvents:"none"},children:(0,t.jsxs)("div",{ref:V,style:{...A,border:"1px solid rgba(34,197,94,0.65)",boxShadow:"0 0 18px rgba(34,197,94,0.45)"},children:[(0,t.jsx)("span",{style:{width:7,height:7,borderRadius:"50%",background:l.C.green,boxShadow:`0 0 8px ${l.C.green}`}}),"Recharge Hub"]})}),(0,t.jsxs)("group",{ref:h,visible:!1,children:[(0,t.jsxs)("mesh",{position:[0,.12,0],children:[(0,t.jsx)("boxGeometry",{args:[.5,.16,.22]}),(0,t.jsx)("meshStandardMaterial",{color:"#11203a",emissive:l.C.cyan,emissiveIntensity:.5,metalness:.5,roughness:.4})]}),(0,t.jsxs)("mesh",{position:[.18,.26,0],children:[(0,t.jsx)("boxGeometry",{args:[.06,.28,.12]}),(0,t.jsx)("meshStandardMaterial",{color:"#0d1830",emissive:l.C.cyan,emissiveIntensity:.4,metalness:.5,roughness:.4})]}),(0,t.jsxs)("mesh",{position:[.3,.14,0],children:[(0,t.jsx)("sphereGeometry",{args:[.06,10,10]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.white,toneMapped:!1})]}),[-.16,.16].map((e,r)=>(0,t.jsxs)("mesh",{position:[e,.05,0],rotation:[Math.PI/2,0,0],children:[(0,t.jsx)("cylinderGeometry",{args:[.09,.09,.05,14]}),(0,t.jsx)("meshStandardMaterial",{color:"#05070d",metalness:.6,roughness:.5})]},r)),(0,t.jsxs)("group",{position:[0,.62,0],children:[(0,t.jsxs)("mesh",{children:[(0,t.jsx)("boxGeometry",{args:[.42,.12,.02]}),(0,t.jsx)("meshBasicMaterial",{color:"#0a0f1c",toneMapped:!1,transparent:!0,opacity:.85})]}),(0,t.jsxs)("mesh",{ref:m,position:[0,0,.012],children:[(0,t.jsx)("boxGeometry",{args:[.38,.08,.02]}),(0,t.jsx)("meshBasicMaterial",{ref:f,color:l.C.green,toneMapped:!1,blending:a.AdditiveBlending})]})]})]}),[{w:.34,h:.16,d:.2,col:l.C.sky},{w:.46,h:.22,d:.26,col:l.C.white},{w:.6,h:.3,d:.32,col:l.C.red}].map((e,r)=>(0,t.jsxs)("mesh",{ref:e=>{U.current[r]=e},visible:!1,children:[(0,t.jsx)("boxGeometry",{args:[e.w,e.h,e.d]}),(0,t.jsx)("meshStandardMaterial",{color:"#12060a",emissive:e.col,emissiveIntensity:.7,metalness:.5,roughness:.4})]},`disp${r}`))]})}),I=new a.Object3D,k=new a.Color(l.C.blue),G=new a.Color(l.C.green),T=new a.Color,O=new a.Vector3,U=r.default.memo(function({progress:e,isMobile:n=!1}){let s=(0,r.useRef)(0),o=(0,r.useRef)(null),h=(0,r.useRef)([]),m=(0,r.useRef)(null),f=(0,r.useRef)(null),x=(0,r.useRef)(null),g=(0,r.useRef)(null),y=n?40:70,M=n?70:150,b=n?12:24,v=(0,r.useMemo)(()=>Array.from({length:5},(e,t)=>{let r=t/5*Math.PI*2+.6;return new a.Vector3(6.5*Math.cos(r),0,6.5*Math.sin(r))}),[]),j=(0,r.useMemo)(()=>Array.from({length:y},(e,t)=>{let r=p(3.3*t+1)*Math.PI*2,n=3+p(1.9*t+5)*(l.CITY_RADIUS-2);return new a.Vector3(Math.cos(r)*n,.12,Math.sin(r)*n)}),[y]),w=(0,r.useMemo)(()=>j.map(e=>{let t=v[0],r=1/0;for(let n of v){let i=e.distanceToSquared(n);i<r&&(r=i,t=n)}return{a:new a.Vector3(t.x,.2,t.z),b:e.clone()}}),[j,v]),A=(0,r.useMemo)(()=>{let e=[];for(let t of w)e.push(t.a.x,t.a.y,t.a.z,t.b.x,t.b.y,t.b.z);let t=new a.BufferGeometry;return t.setAttribute("position",new a.Float32BufferAttribute(e,3)),t},[w]),C=(0,r.useMemo)(()=>{let e=new Float32Array(3*j.length);j.forEach((t,r)=>{e[3*r]=t.x,e[3*r+1]=t.y,e[3*r+2]=t.z});let t=new a.BufferGeometry;return t.setAttribute("position",new a.BufferAttribute(e,3)),t},[j]),B=(0,r.useMemo)(()=>Array.from({length:M},(e,t)=>({seg:Math.floor(p(4.7*t)*w.length),speed:.12+.25*p(2.1*t),phase:p(8.3*t)})),[M,w.length]),R=(0,r.useMemo)(()=>{let e=new a.BufferGeometry;return e.setAttribute("position",new a.BufferAttribute(new Float32Array(3*M),3)),e},[M]),P=(0,r.useMemo)(()=>Array.from({length:b},(e,t)=>({seg:Math.floor(p(5.9*t+3)*w.length),speed:.06+.08*p(3.7*t),phase:p(6.6*t),kind:Math.floor(3*p(9.2*t))})),[b,w.length]);return(0,r.useLayoutEffect)(()=>{g.current&&(j.forEach((e,t)=>{I.position.set(e.x,.18,e.z),I.scale.set(.06,.36,.06),I.rotation.set(0,0,0),I.updateMatrix(),g.current.setMatrixAt(t,I.matrix),g.current.setColorAt(t,k)}),g.current.instanceMatrix.needsUpdate=!0,g.current.instanceColor&&(g.current.instanceColor.needsUpdate=!0)),x.current&&(P.forEach((e,t)=>{I.position.set(0,-50,0),I.updateMatrix(),x.current.setMatrixAt(t,I.matrix);let r=0===e.kind?l.C.cyan:1===e.kind?l.C.violet:l.C.sky;x.current.setColorAt(t,T.set(r))}),x.current.instanceMatrix.needsUpdate=!0,x.current.instanceColor&&(x.current.instanceColor.needsUpdate=!0))},[j,P]),(0,i.useFrame)((t,r)=>{let n=e.current??0;s.current=d(s.current,n,3,r);let i=s.current,a=t.clock.elapsedTime,p=u(l.P.routes-.02,l.P.routes+.06,i),y=u(l.P.ecosystem-.03,l.P.ecosystem+.06,i),M=u(l.P.finale,1,i);if(h.current.forEach((e,t)=>{e&&(e.emissiveIntensity=(.3+1.5*y)*(.85+.15*Math.sin(2*a+t)))}),o.current&&(o.current.visible=p>.02),m.current&&(m.current.opacity=(.05+.16*p+.1*M)*(.8+.2*Math.sin(1.5*a))),f.current){let e=f.current.geometry.getAttribute("position");for(let t=0;t<B.length;t++){let r=B[t],n=w[r.seg],i=((a*r.speed+r.phase)%1+1)%1;O.copy(n.a).lerp(n.b,i),e.setXYZ(t,O.x,O.y+.05,O.z)}e.needsUpdate=!0,f.current.material.opacity=c(.2+.8*p)}if(x.current){for(let e=0;e<P.length;e++){let t=P[e],r=w[t.seg],n=((a*t.speed+t.phase)%1+1)%1;O.copy(r.a).lerp(r.b,n);let i=y*(2===t.kind?1.4:1===t.kind?1.1:.85);I.position.set(O.x,.16,O.z);let s=Math.atan2(r.b.z-r.a.z,r.b.x-r.a.x);I.rotation.set(0,-s,0),I.scale.set(.34*i+1e-4,.16*i+1e-4,.2*i+1e-4),I.updateMatrix(),x.current.setMatrixAt(e,I.matrix)}x.current.instanceMatrix.needsUpdate=!0,x.current.visible=y>.02}if(g.current){for(let e=0;e<j.length;e++){let t=e/j.length*.9,r=u(t,t+.08,y)*(.6+.4*Math.sin(3*a+e));T.copy(k).lerp(G,u(t,t+.08,y)),g.current.setColorAt(e,T.multiplyScalar(.3+r))}g.current.instanceColor&&(g.current.instanceColor.needsUpdate=!0),g.current.material.opacity=c(.15+.5*p+.4*y)}}),(0,t.jsxs)("group",{children:[(0,t.jsx)("lineSegments",{geometry:A,children:(0,t.jsx)("lineBasicMaterial",{ref:m,color:l.C.blue,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsx)("points",{geometry:C,children:(0,t.jsx)("pointsMaterial",{size:n?.12:.1,color:l.C.sky,transparent:!0,opacity:.6,sizeAttenuation:!0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsx)("points",{ref:f,geometry:R,children:(0,t.jsx)("pointsMaterial",{size:n?.11:.09,color:l.C.cyan,transparent:!0,opacity:0,sizeAttenuation:!0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsxs)("instancedMesh",{ref:g,args:[void 0,void 0,y],children:[(0,t.jsx)("boxGeometry",{args:[1,1,1]}),(0,t.jsx)("meshBasicMaterial",{toneMapped:!1,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("instancedMesh",{ref:x,args:[void 0,void 0,b],visible:!1,children:[(0,t.jsx)("boxGeometry",{args:[1,1,1]}),(0,t.jsx)("meshBasicMaterial",{toneMapped:!1,blending:a.AdditiveBlending})]}),(0,t.jsx)("group",{ref:o,visible:!1,children:v.map((e,r)=>(0,t.jsxs)("group",{position:[e.x,0,e.z],children:[(0,t.jsxs)("mesh",{position:[0,.5,0],children:[(0,t.jsx)("boxGeometry",{args:[1.6,1,1.3]}),(0,t.jsx)("meshStandardMaterial",{ref:e=>{h.current[r]=e},color:"#0b1426",emissive:l.C.blue,emissiveIntensity:.3,metalness:.4,roughness:.5})]}),(0,t.jsxs)("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.03,0],children:[(0,t.jsx)("ringGeometry",{args:[1.2,1.4,36]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.cyan,toneMapped:!1,transparent:!0,opacity:.4,side:a.DoubleSide,blending:a.AdditiveBlending,depthWrite:!1})]})]},r))})]})}),E=r.default.memo(function({progress:e,isMobile:n=!1}){let s=(0,r.useRef)(0),o=(0,r.useRef)(null),h=(0,r.useRef)(null),m=(0,r.useRef)(null),f=(0,r.useRef)([]),x=(0,r.useRef)(null),g=(0,r.useRef)(null),y=n?90:180,M=(0,r.useMemo)(()=>{let e=[];for(let t=0;t<y;t++){let r=p(2.7*t)*Math.PI*2,n=.3+1.4*p(5.1*t),i=.4+ +p(3.3*t);e.push(new a.Vector3(Math.cos(r)*i,n,Math.sin(r)*i))}return e},[y]),b=(0,r.useMemo)(()=>{let e=new a.BufferGeometry;return e.setAttribute("position",new a.BufferAttribute(new Float32Array(3*y),3)),e},[y]),v=(0,r.useMemo)(()=>{let e=new a.CatmullRomCurve3([new a.Vector3(-6,.3,5),new a.Vector3(-2,1.6,1),new a.Vector3(3,.3,-4)]);return new a.TubeGeometry(e,50,.07,8,!1)},[]),j=(0,r.useMemo)(()=>new a.Vector3(-2,.6,1),[]);return(0,i.useFrame)((t,r)=>{let n=e.current??0;s.current=d(s.current,n,3,r);let i=s.current,a=t.clock.elapsedTime,p=u(l.P.sla-.03,l.P.sla+.05,i),y=p*(1-u(l.P.ecosystem,l.P.ecosystem+.08,i));o.current&&(o.current.visible=y>.02,o.current.position.y=2.6+1.9999999999999996*p,o.current.scale.setScalar(1e-4+1.5*y),o.current.rotation.z=.02*Math.sin(.3*a)),h.current&&(h.current.rotation.z=-(1.4*a)),m.current&&(m.current.opacity=y*(.6+.2*Math.sin(4*a))),f.current.forEach(e=>{e&&(e.opacity=.8*y)});let b=u(l.P.sla+.02,l.P.sla+.08,i),v=.45*a%1;if(g.current&&(g.current.opacity=y*b*(1-v)*(.6+.4*Math.sin(6*a))),x.current){let e=x.current.geometry.getAttribute("position"),t=3.4*v;for(let r=0;r<M.length;r++){let n=M[r];e.setXYZ(r,j.x+n.x*t,j.y+n.y*t-v*v*1.2,j.z+n.z*t)}e.needsUpdate=!0,x.current.material.opacity=c(y*b*(1-v))}}),(0,t.jsxs)("group",{children:[(0,t.jsxs)("group",{ref:o,position:[0,7,0],visible:!1,children:[(0,t.jsxs)("mesh",{children:[(0,t.jsx)("torusGeometry",{args:[1,.03,12,64]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.cyan,toneMapped:!1,transparent:!0,opacity:.8,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{children:[(0,t.jsx)("torusGeometry",{args:[.78,.012,10,64]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.blue,toneMapped:!1,transparent:!0,opacity:.5,blending:a.AdditiveBlending,depthWrite:!1})]}),Array.from({length:12}).map((e,r)=>{let n=r/12*Math.PI*2;return(0,t.jsxs)("mesh",{position:[.88*Math.cos(n),.88*Math.sin(n),0],rotation:[0,0,n],children:[(0,t.jsx)("boxGeometry",{args:[.1,.02,.02]}),(0,t.jsx)("meshBasicMaterial",{ref:e=>{e&&(f.current[r]=e)},color:r%3==0?l.C.white:l.C.cyan,toneMapped:!1,transparent:!0,opacity:.8,blending:a.AdditiveBlending,depthWrite:!1})]},r)}),(0,t.jsxs)("mesh",{ref:h,position:[0,0,.02],children:[(0,t.jsx)("boxGeometry",{args:[.04,1.5,.02]}),(0,t.jsx)("meshBasicMaterial",{ref:m,color:l.C.green,toneMapped:!1,transparent:!0,opacity:.7,blending:a.AdditiveBlending,depthWrite:!1})]}),(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.07,16,16]}),(0,t.jsx)("meshBasicMaterial",{color:l.C.white,toneMapped:!1})]})]}),(0,t.jsx)("mesh",{geometry:v,children:(0,t.jsx)("meshBasicMaterial",{ref:g,color:l.C.red,toneMapped:!1,transparent:!0,opacity:0,blending:a.AdditiveBlending,depthWrite:!1})}),(0,t.jsx)("points",{ref:x,geometry:b,children:(0,t.jsx)("pointsMaterial",{size:n?.12:.1,color:l.C.red,transparent:!0,opacity:0,sizeAttenuation:!0,blending:a.AdditiveBlending,depthWrite:!1})})]})}),V=new a.Vector3,F=new a.Vector3;function L({progress:e}){let t=(0,r.useRef)(new a.Vector3(0,6,0)),n=(0,r.useRef)(!1);return(0,i.useFrame)((r,i)=>{var s,o,a,p,h,m;let f=c(e.current??0),x=0;for(let e=0;e<l.WAYPOINTS.length-1;e++){if(f>=l.WAYPOINTS[e].at&&f<=l.WAYPOINTS[e+1].at){x=e;break}f>l.WAYPOINTS[l.WAYPOINTS.length-1].at&&(x=l.WAYPOINTS.length-2)}let g=l.WAYPOINTS[x],y=l.WAYPOINTS[x+1],M=y.at-g.at||1,b=u(0,1,c((f-g.at)/M));V.set((s=g.pos[0],s+(y.pos[0]-s)*b),(o=g.pos[1],o+(y.pos[1]-o)*b),(a=g.pos[2],a+(y.pos[2]-a)*b)),F.set((p=g.look[0],p+(y.look[0]-p)*b),(h=g.look[1],h+(y.look[1]-h)*b),(m=g.look[2],m+(y.look[2]-m)*b));let v=r.clock.elapsedTime;V.x+=.14*Math.sin(.16*v),V.y+=.07*Math.sin(.21*v);let j=r.camera;n.current?(j.position.x=d(j.position.x,V.x,2.6,i),j.position.y=d(j.position.y,V.y,2.6,i),j.position.z=d(j.position.z,V.z,2.6,i),t.current.x=d(t.current.x,F.x,3,i),t.current.y=d(t.current.y,F.y,3,i),t.current.z=d(t.current.z,F.z,3,i)):(j.position.copy(V),t.current.copy(F),n.current=!0),j.lookAt(t.current)}),null}let N=r.default.memo(function({progress:e,reduced:r=!1,isMobile:i=!1,active:a=!0}){return(0,t.jsxs)(n.Canvas,{flat:!0,dpr:[1,i||r?1.25:1.5],camera:{position:l.WAYPOINTS[0].pos,fov:52,near:.1,far:200},gl:{antialias:!i,powerPreference:"high-performance",alpha:!1},frameloop:a?"always":"never",children:[(0,t.jsx)("color",{attach:"background",args:[l.C.bg]}),(0,t.jsx)("fog",{attach:"fog",args:[l.C.bg,40,100]}),(0,t.jsx)("ambientLight",{intensity:.55}),(0,t.jsx)("directionalLight",{position:[8,18,10],intensity:.7,color:l.C.sky}),(0,t.jsx)("pointLight",{position:[-10,8,-8],intensity:40,distance:60,color:l.C.purple}),(0,t.jsx)("pointLight",{position:[0,9,0],intensity:30,distance:40,color:l.C.cyan}),(0,t.jsx)(L,{progress:e}),(0,t.jsx)(v,{progress:e,reduced:r,isMobile:i}),(0,t.jsx)(z,{progress:e,reduced:r,isMobile:i}),(0,t.jsx)(U,{progress:e,reduced:r,isMobile:i}),(0,t.jsx)(E,{progress:e,reduced:r,isMobile:i}),(0,t.jsx)(m,{progress:e,reduced:r,isMobile:i}),!r&&(0,t.jsx)(s.EffectComposer,{multisampling:2*!i,children:(0,t.jsx)(s.Bloom,{mipmapBlur:!0,intensity:i?.9:1.25,luminanceThreshold:.12,luminanceSmoothing:.045,radius:i?.65:.82,kernelSize:o.KernelSize.MEDIUM})})]})});e.s(["default",0,N],69986)},39184,e=>{e.n(e.i(69986))}]);