1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3664],{13664:(n,o,e)=>{e.r(o),e.d(o,{default:()=>c});var t=e(65392),r=e(24252),l=e(64576),i=e(87415),u=e(59984),a=e(62969),s=e(39419);function c(n){let{colorStops:o=["#5227FF","#7cff67","#5227FF"],amplitude:e=1,blend:c=.5}=n,v=(0,r.useRef)(n);v.current=n;let f=(0,r.useRef)(null);return(0,r.useEffect)(()=>{let n,t=f.current;if(!t)return;let r=new l.A({alpha:!0,premultipliedAlpha:!0,antialias:!0}),x=r.gl;function m(){if(!t)return;let o=t.offsetWidth,e=t.offsetHeight;r.setSize(o,e),n&&(n.uniforms.uResolution.value=[o,e])}x.clearColor(0,0,0,0),x.enable(x.BLEND),x.blendFunc(x.ONE,x.ONE_MINUS_SRC_ALPHA),x.canvas.style.backgroundColor="transparent",window.addEventListener("resize",m);let p=new i.l(x);p.attributes.uv&&delete p.attributes.uv;let d=o.map(n=>{let o=new u.Q(n);return[o.r,o.g,o.b]});n=new a.B(x,{vertex:"#version 300 es\nin vec2 position;\nvoid main() {\n gl_Position = vec4(position, 0.0, 1.0);\n}\n",fragment:"#version 300 es\nprecision highp float;\n\nuniform float uTime;\nuniform float uAmplitude;\nuniform vec3 uColorStops[3];\nuniform vec2 uResolution;\nuniform float uBlend;\n\nout vec4 fragColor;\n\nvec3 permute(vec3 x) {\n return mod(((x * 34.0) + 1.0) * x, 289.0);\n}\n\nfloat snoise(vec2 v){\n const vec4 C = vec4(\n 0.211324865405187, 0.366025403784439,\n -0.577350269189626, 0.024390243902439\n );\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n vec2 i1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n vec4 x12 = x0.xyxy + C.xxzz;\n x12.xy -= i1;\n i = mod(i, 289.0);\n\n vec3 p = permute(\n permute(i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0)\n );\n\n vec3 m = max(\n 0.5 - vec3(\n dot(x0, x0),\n dot(x12.xy, x12.xy),\n dot(x12.zw, x12.zw)\n ), \n 0.0\n );\n m = m * m;\n m = m * m;\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\n vec3 g;\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * x12.xz + h.yz * x12.yw;\n return 130.0 * dot(m, g);\n}\n\nstruct ColorStop {\n vec3 color;\n float position;\n};\n\n#define COLOR_RAMP(colors, factor, finalColor) { int index = 0; for (int i = 0; i < 2; i++) { ColorStop currentColor = colors[i]; bool isInBetween = currentColor.position <= factor; index = int(mix(float(index), float(i), float(isInBetween))); } ColorStop currentColor = colors[index]; ColorStop nextColor = colors[index + 1]; float range = nextColor.position - currentColor.position; float lerpFactor = (factor - currentColor.position) / range; finalColor = mix(currentColor.color, nextColor.color, lerpFactor); }\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy / uResolution;\n \n ColorStop colors[3];\n colors[0] = ColorStop(uColorStops[0], 0.0);\n colors[1] = ColorStop(uColorStops[1], 0.5);\n colors[2] = ColorStop(uColorStops[2], 1.0);\n \n vec3 rampColor;\n COLOR_RAMP(colors, uv.x, rampColor);\n \n float height = snoise(vec2(uv.x * 2.0 + uTime * 0.1, uTime * 0.25)) * 0.5 * uAmplitude;\n height = exp(height);\n height = (uv.y * 2.0 - height + 0.2);\n float intensity = 0.6 * height;\n \n float midPoint = 0.20;\n float auroraAlpha = smoothstep(midPoint - uBlend * 0.5, midPoint + uBlend * 0.5, intensity);\n \n vec3 auroraColor = intensity * rampColor;\n \n fragColor = vec4(auroraColor * auroraAlpha, auroraAlpha);\n}\n",uniforms:{uTime:{value:0},uAmplitude:{value:e},uColorStops:{value:d},uResolution:{value:[t.offsetWidth,t.offsetHeight]},uBlend:{value:c}}});let C=new s.e(x,{geometry:p,program:n});t.appendChild(x.canvas);let h=0,g=e=>{h=requestAnimationFrame(g);let{time:t=.01*e,speed:l=1}=v.current;if(n){var i,a,s;n.uniforms.uTime.value=t*l*.1,n.uniforms.uAmplitude.value=null!=(i=v.current.amplitude)?i:1,n.uniforms.uBlend.value=null!=(a=v.current.blend)?a:c;let e=null!=(s=v.current.colorStops)?s:o;n.uniforms.uColorStops.value=e.map(n=>{let o=new u.Q(n);return[o.r,o.g,o.b]}),r.render({scene:C})}};
1return h=requestAnimationFrame(g),m(),()=>{var n;cancelAnimationFrame(h),window.removeEventListener("resize",m),t&&x.canvas.parentNode===t&&t.removeChild(x.canvas),null==(n=x.getExtension("WEBGL_lose_context"))||n.loseContext()}},[]),(0,t.jsx)("div",{ref:f,className:"w-full h-full"})}}}]);
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.