/**
 * @preserve
 * @author    ThemePunch <info@themepunch.com>
 * @link      http://www.themepunch.com/
 * @copyright 2022 ThemePunch
 * @version 6.7.0
 */
!function(){"use strict";window._R_is_Editor?RVS._R=void 0===RVS._R?{}:RVS._R:window._R_is_Editor=!1,jQuery.fn.revolution=jQuery.fn.revolution||{};var t,e=window._R_is_Editor?RVS._R:jQuery.fn.revolution,a=0;function r(t){var a,r,n;if(-1!==(a=window._R_is_Editor?RSColor.convert(t.wp_color_ori):t.wp_color_ori).indexOf("gradient")&&(r=e.getGradients(a).deg),0==t.wp_color.length)t.numStops=0,t.wp_color=(new THREE.Vector4).fromArray(e.particleWaveUtils.splitColor(t.wp_color_ori));else{t.numStops=t.wp_color.length/2;for(let a=0;a<6;a++)if(a<t.wp_color.length/2){var i=(new THREE.Vector4).fromArray(e.particleWaveUtils.splitColor(t.wp_color[2*a]));t.colorsArray.push(i),t.colorStopsArray.push(t.wp_color[2*a+1])}else{i=new THREE.Vector4;t.colorsArray.push(i),t.colorStopsArray.push(0)}n=function(t,e,a){var r=a*Math.PI/180*-1,n=e/2,i=t/2,o=0,s=0,l=0,c=0,p=0,u=0,d=0,f=0,m=!1,h=!1,_=!1,g=!1;o=i-Math.tan(r)*n,s=n+(t-i)/Math.tan(r),l=i+Math.tan(r)*(e-n),c=n-i/Math.tan(r),0<=o&&o<=t&&(m=!0);0<=s&&s<=e&&(_=!0);0<=l&&l<=t&&(h=!0);0<=c&&c<=e&&(g=!0);1==m&&1==h&&(p=o,u=0,d=l,f=e);1==_&&1==g&&(p=t,u=s,d=0,f=c);1==m&&1==_&&(p=o,u=0,d=t,f=s);1==_&&1==h&&(p=t,u=s,d=l,f=e);1==h&&1==g&&(p=l,u=e,d=0,f=c);1==m&&1==g&&(p=o,u=0,d=0,f=c);return a>90&&a<315?{tx:p,ty:u,bx:d,by:f}:{tx:d,ty:f,bx:p,by:u}}(t.canvas.width,t.canvas.height,r),t.gradientStart.set(n.tx,n.ty),t.gradientEnd.set(n.bx,n.by)}}function n(t,e,a,r,n,o,s){var l=t/e;isNaN(l)||0===l||!isFinite(l)?(t=a,e=a):l>=1?e=(t=a)/l:t=(e=a)*l,s?(r.crossOrigin="Anonymous",r.addEventListener("load",(function(){i(t,e,r,n,o)})),r.src=s):i(t,e,r,n,o)}function i(t,e,a,r,n){var i=Math.max(t,e);i+=4,a.width=t,a.height=e,r.canvas.width=i,r.canvas.height=i,r.webkitImageSmoothingEnabled=!1,r.msImageSmoothingEnabled=!1,r.imageSmoothingEnabled=!1,r.drawImage(a,(i-t)/2+2,(i-e)/2+2,t-4,e-4),n(r.canvas)}function o(t,a){var n=this;this.settings=t;var i,o=t.particles*t.particles,s=t.particles,u=this.w=t.width,d=this.h=t.height;this.camera=new THREE.PerspectiveCamera(70,u/d,1,1e3),this.scene=new THREE.Scene,this.group=new THREE.Group,this.camera.position.z=20,r(t),this.texture=new THREE.CanvasTexture(t.tcanv),this.texture.needsUpdate=!0;var h=new THREE.BufferGeometry,_=this.material=new THREE.PointsMaterial({map:this.texture,side:THREE.DoubleSide,transparent:!0,size:t.size});"off"!==t.blending&&(_.depthTest=!1,"additive"===t.blending?_.blending=THREE.AdditiveBlending:"normal"===t.blending?_.blending=THREE.NormalBlending:"custom"===t.blending&&(_.blending=THREE.CustomBlending)),this.material.userData.u_time={value:0},this.material.userData.u_rp={value:!1},this.material.userData.u_amplitude={value:t.amplitude},this.material.userData.u_speed={value:t.speed},this.material.userData.u_curve={value:t.curve},this.material.userData.u_scale={type:"f",value:t.scale},this.material.userData.u_color={value:t.color_par},this.material.userData.u_color_lines={value:t.color},this.material.userData.u_pointTexture={value:t.backgroundTexture},this.material.userData.u_intensity={value:t.intensity},this.material.userData.u_gradientStart={value:t.gradientStart},this.material.userData.u_gradientEnd={value:t.gradientEnd},this.material.userData.u_colors={value:t.colorsArray},this.material.userData.u_colorstops={value:t.colorStopsArray},this.material.userData.u_numstops={value:t.numStops},this.material.userData.u_windowHeight={value:800},this.material.userData.u_isSVG={value:t.isSVG?1:"keep"==t.particleColor?0:1},this.material.onBeforeCompile=function(e){e.uniforms.u_time=_.userData.u_time,e.uniforms.u_amplitude=_.userData.u_amplitude,e.uniforms.u_speed=_.userData.u_speed,e.uniforms.u_curve=_.userData.u_curve,e.uniforms.u_scale=_.userData.u_scale,e.uniforms.u_color=_.userData.u_color,e.uniforms.u_color_lines=_.userData.u_color_lines,e.uniforms.u_pointTexture=_.userData.u_pointTexture,e.uniforms.u_intensity=_.userData.u_intensity,e.uniforms.u_gradientStart=_.userData.u_gradientStart,e.uniforms.u_gradientEnd=_.userData.u_gradientEnd,e.uniforms.u_colors=_.userData.u_colors,e.uniforms.u_colorstops=_.userData.u_colorstops,e.uniforms.u_numstops=_.userData.u_numstops,e.uniforms.u_windowHeight=_.userData.u_windowHeight,e.uniforms.u_isSVG=_.userData.u_isSVG,e.vertexShader=e.vertexShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\tattribute float a_faceColor;\n\t\t\t\tvarying float v_faceOpacity;\n\t\t\t\tuniform float u_scale;\n\t\t\t").replace("void main() {","\n\t\t\t\tfloat map(float a, float b, float c, float d, float v, float cmin, float cmax) {\n\t\t\t\t\treturn clamp((v - a) * (d - c) / (b - a) + c, cmin, cmax);\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tv_faceOpacity = a_faceColor;\n\t\t\t"),t.dynamicScale?e.vertexShader=e.vertexShader.replace("#include <project_vertex>","\n\t\t\t\t\tvec4 mvPosition = vec4( transformed, increaser );\n\t\t\t\t\t#ifdef USE_INSTANCING\n\t\t\t\t\t\tmvPosition = instanceMatrix * mvPosition;\n\t\t\t\t\t#endif\n\t\t\t\t\tmvPosition = modelViewMatrix * mvPosition;\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\t\t\t\t"):e.vertexShader=e.vertexShader.replace("#include <project_vertex>","\n\t\t\t\t\tvec4 mvPosition = vec4( transformed, 1.0 );\n\t\t\t\t\t#ifdef USE_INSTANCING\n\t\t\t\t\t\tmvPosition = instanceMatrix * mvPosition;\n\t\t\t\t\t#endif\n\t\t\t\t\tmvPosition = modelViewMatrix * mvPosition;\n\t\t\t\t\tgl_Position = projectionMatrix * mvPosition;\n\t\t\t\t").replace("gl_PointSize = size;","gl_PointSize = size * map( 0., 1., 1. - u_scale, 1. + u_scale, offset, 1. - u_scale, 1. + u_scale);"),e.fragmentShader=e.fragmentShader.replace("#include <common>",`\n\t\t\t\t#include <common>\n\t\t\t\tconst int c_numstops = ${t.numStops};\n\t\t\t`),function(t,e,a){switch(t.vertexShader=t.vertexShader.replace("#include <common>","\n\t\t\t#include <common>\n\t\t\tuniform float u_time;\n\t\t\tuniform float u_amplitude;\n\t\t\tuniform float u_speed;\n\t\t\tuniform float u_curve;\n\t\t\tuniform vec4 u_color;\n\t\t\tuniform vec3 u_color_lines;\n\t\t\tuniform sampler2D u_pointTexture;\n\n\t\t\tattribute float wavePosX;\n\t\t\tattribute float wavePosY;\n\t\t\tattribute float random_factor;\n\t\t\tfloat pi = 3.14159265359;\n\n\t\t\tvarying float v_wavePosX;\n\t\t\tvarying float v_wavePosY;\n\t\t\tvarying float v_wavePosZ;\n\t\t"),t.vertexShader=t.vertexShader.replace("void main() {","\n\t\t\t// functions\n\t\t\tvoid main() {\n\t\t\t\tv_wavePosX = wavePosX;\n\t\t\t\tv_wavePosY = wavePosY;\n\n\t\t\t\tfloat increaser = 0.0;\n\t\t"),e.type){case"default":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve) + sin((f_speed + wavePosY) * u_curve);\n\n\t\t\t\t\tincreaser += offset + u_amplitude;\n\t\t\t\t\t\n\t\t\t\t\t#include <morphtarget_vertex>");break;case"plainx":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve);\n\n\t\t\t\t\tincreaser += offset + u_amplitude;\n\n\t\t\t\t\t#include <morphtarget_vertex>");break;case"plainz":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\tfloat offset = sin((f_speed + wavePosY) * u_curve);\n\n\t\t\t\t\tincreaser += offset + u_amplitude;\n\t\t\t\t\t\n\t\t\t\t\t#include <morphtarget_vertex>");break;case"powerful":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\t//float offset = sin(f_speed) + sin(sin(u_curve) * wavePosX) + sin(sin(u_curve) * wavePosY);\n\t\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve) * wavePosX + sin((f_speed + wavePosY) * u_curve) * wavePosY;\n\n\t\t\t\t\tincreaser += offset + u_amplitude;\n\n\t\t\t\t\t#include <morphtarget_vertex>");break;case"funky":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\tfloat f_speed = sin((u_time / u_curve) * u_speed) * 12.5;\n\t\t\t\t\tfloat offset = sin(f_speed * wavePosX+sin(f_speed * wavePosX+sin(f_speed * wavePosX))) + sin(f_speed * wavePosY+sin(f_speed * wavePosY));\n\t\t\t\t\t\n\t\t\t\t\tincreaser += offset + u_amplitude;\n\t\t\t\t\t\n\t\t\t\t\t#include <morphtarget_vertex>")}e.dynamicScale?t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\tincreaser *= u_scale;\n\t\t\t\ttransformed.y += offset * u_amplitude * increaser;\n\n\t\t\t\t#include <morphtarget_vertex>"):t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\ttransformed.y += offset * u_amplitude;\n\t\t\t\tv_wavePosZ = transformed.y;\n\n\t\t\t\t#include <morphtarget_vertex>");e.random_offset&&(t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\ttransformed.y += random_factor;\n\n\t\t\t\t#include <morphtarget_vertex>"));t.fragmentShader=t.fragmentShader.replace("#include <common>","\n\t\t\t#include <common>\n\t\t\tuniform vec4 u_color;\n\t\t\tuniform vec3 u_color_lines;\n\t\t\tuniform sampler2D u_pointTexture;\n\t\t\tvarying float v_wavePosX;\n\t\t\tvarying float v_wavePosY;\n\t\t\tvarying float v_wavePosZ;\n\t\t\tuniform float u_amplitude;\n\t\t\tuniform float u_intensity;\n\t\t\tuniform float u_isSVG;\n\t\t\tvarying float v_faceOpacity;\n\t\t"),0!==e.numStops&&(t.fragmentShader=t.fragmentShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\tuniform vec2 u_gradientStart;\n\t\t\t\tuniform vec2 u_gradientEnd;\n\t\t\t\tuniform vec4 u_colors[6];\n\t\t\t\tuniform float u_colorstops[6];\n\t\t\t\tuniform int u_numstops;\n\t\t\t\tuniform float u_windowHeight;\n\t\t\t"));switch(t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\tfloat opaX = 1.0, opaZ = 1.0;\n\t\t\tfloat intens = u_intensity / 100.0;\n\t\t\t#include <tonemapping_fragment>\n\t\t"),e.fade){case"sides":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaX = -abs((v_wavePosX+0.5)*2.0)+1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"back":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = abs(v_wavePosY / 1.0);\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"front":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = -abs(v_wavePosY / 1.0) + 1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"backfront":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = -abs((v_wavePosY-0.5)*2.0)+1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"all":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = -abs((v_wavePosY-0.5)*2.0)+1.0;\n\t\t\t\t\topaX = -abs((v_wavePosX+0.5)*2.0)+1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t")}"color"==e.particleColor&&(0==e.numStops?t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\tvec4 tempColor = vec4(float(u_color.x) / 255.0, float(u_color.y) / 255.0, float(u_color.z) / 255.0, u_color.a);\n\t\t\t\t\tfloat oCopy = gl_FragColor.a * tempColor.a;\n\t\t\t\t\tgl_FragColor = mix(gl_FragColor, tempColor, u_isSVG);\n\t\t\t\t\tgl_FragColor.a = oCopy;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t"):t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>",'\n\t\t\t\t\t/* float  alpha = atan( -u_gradientEnd.y + u_gradientStart.y, u_gradientEnd.x - u_gradientStart.x );\n\t\t\t\t\tfloat  gradientXRot = u_gradientStart.x*cos(alpha) - u_gradientStart.y*sin(alpha);\n\t\t\t\t\tfloat  gradientXEndRot   = u_gradientEnd.x*cos(alpha) - u_gradientEnd.y*sin(alpha);\n\t\t\t\t\tfloat  span = gradientXEndRot - gradientXRot;\n\t\t\t\t\tfloat y = 1200.0 * v_wavePosY;\n\t\t\t\t\tfloat x = 1600.0 * v_wavePosX;\n\t\t\t\t\tfloat xLocRotated = x*cos( alpha ) - y*sin( alpha );\n\n\t\t\t\t\tc.x = mix(u_colors[0].x / 255.0, u_colors[1].x / 255.0, smoothstep( gradientXRot + float(u_colorstops[0])*span, gradientXRot + float(u_colorstops[1])*span, xLocRotated ));\n\t\t\t\t\tc.y = mix(u_colors[0].y / 255.0, u_colors[1].y / 255.0, smoothstep( gradientXRot + float(u_colorstops[0])*span, gradientXRot + float(u_colorstops[1])*span, xLocRotated ));\n\t\t\t\t\tc.z = mix(u_colors[0].z / 255.0, u_colors[1].z / 255.0, smoothstep( gradientXRot + float(u_colorstops[0])*span, gradientXRot + float(u_colorstops[1])*span, xLocRotated ));\n\t\t\t\t\t\n\t\t\t\t\tfor( int i=1; i<c_numstops-1; i++ ){\n\t\t\t\t\t\tc.x = mix(c.x, u_colors[i+1].x, smoothstep( gradientXRot + float(u_colorstops[i])*span, gradientXRot + float(u_colorstops[i+1])*span, xLocRotated ));\n\t\t\t\t\t\tc.y = mix(c.y, u_colors[i+1].y, smoothstep( gradientXRot + float(u_colorstops[i])*span, gradientXRot + float(u_colorstops[i+1])*span, xLocRotated ));\n\t\t\t\t\t\tc.z = mix(c.z, u_colors[i+1].z, smoothstep( gradientXRot + float(u_colorstops[i])*span, gradientXRot + float(u_colorstops[i+1])*span, xLocRotated ));\n\t\t\t\t\t} */\n\n\t\t\t\t\tvec4 c = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t\t\t\t//float posX = (v_wavePosX + 1.0);\n\t\t\t\t\tfloat alpha = 0.0 * 3.14/180.0;\n\t\t\t\t\tfloat reach = 1.0;\n\t\t\t\t\tfloat posX = ((v_wavePosX + 1.0)*cos( alpha ) +  v_wavePosY*sin( alpha )) / reach;\n\n\t\t\t\t\t//if needed translate to "v_wavePosZ"\n\t\t\t\t\t//If scene is no longer hard coded at 30x30, then the reach value must be calculated differently with that in mind\n\n\t\t\t\t\tfor(int i=0; i<c_numstops; i++){\n\t\t\t\t\t\tif(u_colorstops[i] <= posX && posX <= u_colorstops[i+1]){\n\t\t\t\t\t\t\tc.x = mix(u_colors[i+1].x, u_colors[i].x, smoothstep(u_colorstops[i+1], u_colorstops[i], posX));\n\t\t\t\t\t\t\tc.y = mix(u_colors[i+1].y, u_colors[i].y, smoothstep(u_colorstops[i+1], u_colorstops[i], posX));\n\t\t\t\t\t\t\tc.z = mix(u_colors[i+1].z, u_colors[i].z, smoothstep(u_colorstops[i+1], u_colorstops[i], posX));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tfloat oCopy = gl_FragColor.a;\n\t\t\t\t\tgl_FragColor = c;\n\t\t\t\t\tgl_FragColor.a = oCopy;\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t'));"image"==e.particleColor&&(t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>",`\n\t\t\t\tvec4 color = texture2D(u_pointTexture, ${!1===a?"vec2(abs(v_wavePosX), v_wavePosY)":"vUv"});\n\n\t\t\t\tfloat oCopy = gl_FragColor.a * color.a;\n\t\t\t\tgl_FragColor = mix(color, gl_FragColor, 0.5);\n\t\t\t\tgl_FragColor.a = oCopy;\n\n\t\t\t\t#include <tonemapping_fragment>\n\t\t\t`));"keep"==e.particleColor&&(t.fragmentShader=t.fragmentShader.replace("#include <dithering_fragment>","\n\t\t\t\t#include <dithering_fragment>\n\t\t\t"));t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\tgl_FragColor.a = min(opaX * intens, opaZ * intens) * gl_FragColor.a;\n\t\t\t#include <tonemapping_fragment>\n\t\t")}(e,n.settings,!1)};var g=new THREE.Points(h,this.material,o),v=new Float32Array(o),w=new Float32Array(o),S=new Float32Array(o),b=t.gap/10,y=0,x=-(s*b-1)/2,E=(s*b-1)/2,R=(new THREE.Object3D,new Float32Array(3*o));if("hexa"==t.lines)for(var P=t.hexaShift,C=0;C<s*b;C+=b)for(var M=0,k=C/s,D=0;D>-s*b;D-=b){R[3*y]=(x-D)*t.particleGap,R[3*y+1]=0,R[3*y+2]=(E-C)*t.particleGap+(M%2==0?-P:P);var T=D/s;v[y]=Math.sin(T),w[y]=Math.sin(k),S[y]=(Math.random()*t.random_offset-t.random_offset/2)/10,y++,M++}else for(C=0;C<s*b;C+=b)for(k=C/s,D=0;D>-s*b;D-=b){R[3*y]=(x-D)*t.particleGap,R[3*y+1]=0,R[3*y+2]=(E-C)*t.particleGap;T=D/s;v[y]=Math.sin(T),w[y]=Math.sin(k),S[y]=(Math.random()*t.random_offset-t.random_offset/2)/10,y++}if(h.setAttribute("position",new THREE.Float32BufferAttribute(R,3)),h.setAttribute("wavePosX",new THREE.Float32BufferAttribute(v,1)),h.setAttribute("wavePosY",new THREE.Float32BufferAttribute(w,1)),h.setAttribute("random_factor",new THREE.Float32BufferAttribute(S,1)),"off"!==t.lines&&(t.fill||"hexa"===t.lines)){var z=new THREE.PlaneBufferGeometry(1,1,s-1,s-1);for(y=0;y<z.attributes.position.count;y++){var W=3*y;z.attributes.position.array[W]=R[W],z.attributes.position.array[W+1]=R[W+1],z.attributes.position.array[W+2]=R[W+2],z.attributes.normal.array[W]=0,z.attributes.normal.array[W+1]=1,z.attributes.normal.array[W+2]=0}if("hexa"!=t.lines){var L;L=t.particlesOn&&t.custom_color_on?p(t.color):p(t.color_par);var A=new THREE.MeshStandardMaterial({color:L,side:THREE.DoubleSide,transparent:!0,depthTest:!1})}else if("matte"==t.finish)A=new THREE.MeshLambertMaterial({color:16777215,side:THREE.DoubleSide,transparent:!0});else A=new THREE.MeshPhongMaterial({color:16777215,side:THREE.DoubleSide,transparent:!0,shininess:60});z.setAttribute("wavePosX",new THREE.BufferAttribute(v,1)),z.setAttribute("wavePosY",new THREE.BufferAttribute(w,1)),z.setAttribute("random_factor",new THREE.BufferAttribute(S,1)),function(t,e){var a=t.attributes.position.array,r=t.attributes.uv.array,n=t.attributes.normal.array,i=new Float32Array(3*t.index.count),o=new Float32Array(2*t.index.count),s=new Float32Array(3*t.index.count);t.setAttribute("position",new THREE.BufferAttribute(i,3)),t.setAttribute("uv",new THREE.BufferAttribute(o,2)),t.setAttribute("normal",new THREE.BufferAttribute(s,3));for(var l=0;l<e.length;l++){var c=e[l],p=t.attributes[c.name];c.oArr=p.array,c.nArr=new Float32Array(t.index.count*p.itemSize),t.setAttribute(c.name,new THREE.BufferAttribute(c.nArr,p.itemSize))}var u=0,d=0,f=t.index.array;t.index.count-1>65535&&t.index.count<4294967295&&(f=new Uint32Array(t.index.count));for(var m=0;m<t.index.count;m++){var h=3*t.index.array[m],_=2*t.index.array[m],g=t.index.array[m];f[m]=m,i[u]=a[h],i[u+1]=a[h+1],i[u+2]=a[h+2],o[d]=r[_],o[d+1]=r[_+1],s[u]=n[h],s[u+1]=n[h+1],s[u+2]=n[h+2];for(l=0;l<e.length;l++){c=e[l],p=t.attributes[c.name];for(var v=0;v<p.itemSize;v++)c.nArr[m*p.itemSize+v]=c.oArr[g*p.itemSize+v]}u+=3,d+=2}t.index.array=f,t.attributes.uv.needsUpdate=!0,t.attributes.position.needsUpdate=!0,t.attributes.normal.needsUpdate=!0;for(l=0;l<e.length;l++){c=e[l];t.attributes[c.name].needsUpdate=!0}}(z,[{name:"wavePosX",size:1},{name:"wavePosY",size:1},{name:"random_factor",size:1}]);var F=new Float32Array(z.index.count);if(z.setAttribute("a_faceColor",new THREE.BufferAttribute(F,1)),"triangles"===t.lines)for(y=0;y<z.attributes.position.count;y++)z.attributes.a_faceColor.array[y]=y%6>2?0:1;if("boxes"===t.lines)for(y=0;y<z.attributes.position.count;y+=12){var X=.7*Math.sin(Math.PI*y/z.attributes.position.count)+.3;for(M=0;M<12;M++)z.attributes.a_faceColor.array[y+M]=X}var H=new Float32Array(z.index.count);if(z.setAttribute("a_hexaCount",new THREE.BufferAttribute(H,1)),"hexa"===t.lines)for(y=1;y<t.particles*(t.particles/2);y+=1.5)z.attributes.a_faceColor.array[12*y+3]=1,z.attributes.a_faceColor.array[12*y+4]=1,z.attributes.a_faceColor.array[12*y+5]=1,z.attributes.a_faceColor.array[12*y+6]=1,z.attributes.a_faceColor.array[12*y+7]=1,z.attributes.a_faceColor.array[12*y+8]=1,z.attributes.a_faceColor.array[12*y+9]=1,z.attributes.a_faceColor.array[12*y+10]=1,z.attributes.a_faceColor.array[12*y+11]=1,z.attributes.a_faceColor.array[12*y+174]=1,z.attributes.a_faceColor.array[12*y+174+1]=1,z.attributes.a_faceColor.array[12*y+174+2]=1,z.attributes.a_faceColor.array[12*y+177]=1,z.attributes.a_faceColor.array[12*y+177+1]=1,z.attributes.a_faceColor.array[12*y+177+2]=1,z.attributes.a_faceColor.array[12*y+180]=1,z.attributes.a_faceColor.array[12*y+180+1]=1,z.attributes.a_faceColor.array[12*y+180+2]=1,z.attributes.a_hexaCount.array[12*y]=y,z.attributes.a_hexaCount.array[12*y+4]=y,z.attributes.a_hexaCount.array[12*y+7]=y,z.attributes.a_hexaCount.array[12*y+9]=y,z.attributes.a_hexaCount.array[12*y+177+2]=y,z.attributes.a_hexaCount.array[12*y+174+2]=y;_.userData.u_color={value:t.color_par},A.onBeforeCompile=function(e){e.uniforms.u_time=_.userData.u_time,e.uniforms.u_amplitude=_.userData.u_amplitude,e.uniforms.u_speed=_.userData.u_speed,e.uniforms.u_curve=_.userData.u_curve,e.uniforms.u_color=_.userData.u_color,e.uniforms.u_color_lines=_.userData.u_color_lines,e.uniforms.u_intensity=_.userData.u_intensity,e.uniforms.u_gradientStart=_.userData.u_gradientStart,e.uniforms.u_gradientEnd=_.userData.u_gradientEnd,e.uniforms.u_colors=_.userData.u_colors,e.uniforms.u_colorstops=_.userData.u_colorstops,e.uniforms.u_numstops=_.userData.u_numstops,e.uniforms.u_windowHeight=_.userData.u_windowHeight,e.uniforms.u_isSVG=_.userData.u_isSVG,e.uniforms.u_pointTexture=_.userData.u_pointTexture,e.vertexShader=e.vertexShader.replace("#include <common>","\n\t\t\t\t\t#include <common>\n\t\t\t\t\tattribute float a_faceColor;\n\t\t\t\t\tattribute float a_hexaCount;\n\t\t\t\t\tvarying float v_faceOpacity;\n\t\t\t\t\tuniform float u_scale;\n\t\t\t\t").replace("void main() {","\n\t\t\t\t\t// functions\n\t\t\t\t\tvoid main() {\n\t\t\t\t\t\tv_faceOpacity = a_faceColor;\n\t\t\t\t"),l(e,n.settings),e.fragmentShader=e.fragmentShader.replace("#include <common>",`\n\t\t\t\t\t#include <common>\n\t\t\t\t\tconst int c_numstops = ${t.numStops};\n\t\t\t\t\tvarying float v_faceOpacity;\n\t\t\t\t`),m(e)};var I=new THREE.Mesh(z,A);this.group.add(I)}if("off"!==t.lines&&"hexa"!==t.lines&&!t.fill){for(z=new THREE.PlaneBufferGeometry(1,1,s-1,s-1),y=0;y<z.attributes.position.count;y++){W=3*y;z.attributes.position.array[W]=R[W],z.attributes.position.array[W+1]=R[W+1],z.attributes.position.array[W+2]=R[W+2],z.attributes.normal.array[W]=0,z.attributes.normal.array[W+1]=1,z.attributes.normal.array[W+2]=0}var V,O,Y=z;if("boxes"===t.lines&&function(t){let e=t.parameters,a=("TorusBufferGeometry"==t.type?e.tubularSegments:e.radialSegments)||e.widthSegments||e.thetaSegments||e.points.length-1||1,r=("TorusBufferGeometry"==t.type?e.radialSegments:e.tubularSegments)||e.heightSegments||e.phiSegments||e.segments||1,n=[];for(let t=0;t<r+1;t++){let e=0,i=0;for(let o=0;o<a;o++){e=(a+1)*t+o,i=e+1;let s=e,l=e+(a+1);n.push(e,i),l<(a+1)*(r+1)-1&&n.push(s,l)}i+a+1<=(a+1)*(r+1)-1&&n.push(i,i+a+1)}t.setIndex(n)}(Y),"triangles"===t.lines)O=t.particlesOn&&t.custom_color_on?p(t.color):p(t.color_par),V=new THREE.Mesh(Y,new THREE.MeshBasicMaterial({color:O,wireframe:!0,transparent:!0,opacity:t.linesOpacity}));else"boxes"===t.lines&&(t.custom_color_on?((V=new THREE.LineSegments(Y)).material.color=new THREE.Color(p(t.color)),V.material.transparent=!0,V.material.opacity=t.linesOpacity):0==t.numStops?((V=new THREE.LineSegments(Y)).material.color=new THREE.Color(p(t.color_par)),V.material.transparent=!0,V.material.opacity=t.linesOpacity):((V=new THREE.LineSegments(Y)).material.color=new THREE.Color(p(t.color)),V.material.transparent=!0,V.material.opacity=t.linesOpacity));V.geometry.setAttribute("wavePosX",new THREE.BufferAttribute(v,1)),V.geometry.setAttribute("wavePosY",new THREE.BufferAttribute(w,1)),V.geometry.setAttribute("random_factor",new THREE.BufferAttribute(S,1)),V.material.userData.u_color={value:t.color},V.material.onBeforeCompile=function(e){e.uniforms.u_time=_.userData.u_time,e.uniforms.u_amplitude=_.userData.u_amplitude,e.uniforms.u_speed=_.userData.u_speed,e.uniforms.u_curve=_.userData.u_curve,e.uniforms.u_color=V.material.userData.u_color,e.uniforms.u_color_lines=V.material.userData.u_color_lines,e.uniforms.u_intensity=_.userData.u_intensity,e.uniforms.u_gradientStart=_.userData.u_gradientStart,e.uniforms.u_gradientEnd=_.userData.u_gradientEnd,e.uniforms.u_colors=_.userData.u_colors,e.uniforms.u_colorstops=_.userData.u_colorstops,e.uniforms.u_numstops=_.userData.u_numstops,e.uniforms.u_windowHeight=_.userData.u_windowHeight,e.uniforms.u_pointTexture=_.userData.u_pointTexture,e.fragmentShader=e.fragmentShader.replace("#include <common>",`\n\t\t\t\t\t#include <common>\n\t\t\t\t\tconst int c_numstops = ${t.numStops};\n\t\t\t\t`),l(e,n.settings),m(e)},this.group.add(V)}"hexa"!=t.lines&&1==t.particlesOn&&this.group.add(g),"hexa"!=t.lines&&(this.group.rotation.y=Math.PI),"hexa"==t.lines?(!function(t,e){var a=e.wp_color.length/2,r=12;if(isNaN(a))for(var n=0;n<2;n++)for(let a=0;a<6;a++)(d=new THREE.PointLight(p(e.color_par),.2,100)).position.set(a*r-24,-10,0+-3*n*r),(f=new THREE.PointLight(p(e.color_par),.2,100)).position.set(a*r-24,10,0+-3*n*r),t.add(d,f);else{var i=[];for(let t=0;t<e.numStops;t++){var o=Math.round(5*e.colorStopsArray[t]);i.push(o)}var s=[!1,!1,!1,!1,!1,!1];for(let t=0;t<6;t++)for(let a=0;a<e.numStops;a++)t===(o=Math.round(5*e.colorStopsArray[a]))&&(s[t]=a);for(let t=0;t<s.length;t++)if(!1===s[t]){var l=[],c=[];for(let e=0;e<i.length;e++)l.push(i[e]-t),c.push(Math.abs(i[e]-t));var u=Math.min.apply(Math,c);for(let e=0;e<c.length;e++)c[e]===u&&(s[t]=s[t+l[e]],s[t+l[e]])}for(n=0;n<2;n++)for(let a=0;a<6;a++){var d,f;(d=new THREE.PointLight(new THREE.Color(e.wp_color[2*s[a]]),.2,100)).position.set(a*r-24,-10,0+-3*n*r),(f=new THREE.PointLight(new THREE.Color(e.wp_color[2*s[a]]),.2,100)).position.set(a*r-24,10,0+-3*n*r),t.add(d,f)}}}(this.scene,t),c(this,n.settings)):(i=new THREE.AmbientLight,this.group.add(i),f(this,t)),this.scene.add(this.group),this.renderer=new THREE.WebGLRenderer({antialias:!0,canvas:t.canvas,alpha:!0}),this.renderer.setPixelRatio(Math.min(t.dpr,window.devicePixelRatio)),this.renderer.setSize(t.width,t.height),this.bindedRender=this.render.bind(this),this.initPP(),"mousefollow"!==this.settings.interaction||e.ISM?"mousefollow"===this.settings.interaction&&(this.lerp=.01,this.px=0,this.py=0,this.tx=0,this.ty=0,this.bindedmousefollow=this.mousefollowHandler.bind(this),window.addEventListener("deviceorientation",(function(t){n.pEvent=t,void 0===n.pFrame&&(n.pFrame=this.window.requestAnimationFrame(n.bindedmousefollow))}))):(this.lerp=.001,this.mouseX=.5,this.mouseY=.5,this.targetX=.5,this.targetY=.5,t.canvas.addEventListener("mouseenter",this.mouseenter.bind(this)),t.canvas.addEventListener("mouseleave",this.mouseleave.bind(this)),t.canvas.addEventListener("mousemove",this.pointermove.bind(this)))}function s(t,e){var a=e.particleWave;a.speed=parseFloat(a.speed),a.curve=parseFloat(a.curve),a.amplitude=parseFloat(a.amplitude),t.speed=a.speed/20,"hexa"==a.connectionType?(t.curve=parseFloat(a.curve)/5*2,t.amplitude=parseFloat(a.amplitude)/10):(t.curve=parseFloat(a.curve)/5*a.gap,t.amplitude=parseFloat(a.amplitude)/20*a.gap),a.groShr=parseFloat(a.groShr),a.focus=parseFloat(a.focus),a.aperture=parseFloat(a.aperture),a.maxblur=parseFloat(a.maxblur),a.minblur=parseFloat(a.minblur),t.size=a.particleSize,t.particleAmount=a.particleAmount,t.scale=a.groShr/100,t.color=d(a.fillColor),t.color_par=d(window._R_is_Editor?RSColor.get(e.particleWave.wp_color_ori):e.particleWave.wp_color_ori),t.blending=a.blending,t.angle=a.angle,t.tilt=a.tilt,t.horizontal=a.sx,t.vertical=a.sy,t.zoom=a.sz,t.fade=a.fade,t.animationMovement=a.movement,t.PathDDM=a.animPath,t.PathDDMHexa=a.animPathHexa,t.aniSpeed=a.aniMainSpeed,t.aEnd=a.angleEnd,t.tEnd=a.tiltEnd,t.xEnd=a.offsetxEnd,t.yEnd=a.offsetyEnd,t.zEnd=a.offsetzEnd,t.pendulum_route=a.animRoute,t.rSpeed=a.offsetzSpeed,t.tSpeed=a.tiltSpeed,t.aSpeed=a.angleSpeed,t.particlesOn=a.particlesOn,t.particleColor=a.particleColor,t.wp_color_ori=a.wp_color_ori,t.wp_color=a.wp_color,t.colorsArray=[],t.colorStopsArray=[],t.intensity=a.opacityIntensity,t.pTilt=h(parseFloat(a.pTilt)),t.pRotate=h(parseFloat(a.pRotate)),t.pIntensity=parseFloat(a.pIntensity)/50,t.lerp=parseFloat(a.pSpeed)/200,t.maxblur=.001*a.maxblur,t.minblur=.001*a.minblur}function l(t,e){if(t.vertexShader=t.vertexShader.replace("#include <common>","\n\t\t\t#include <common>\n\t\t\tuniform float u_time;\n\t\t\tuniform float u_amplitude;\n\t\t\tuniform float u_speed;\n\t\t\tuniform float u_curve;\n\t\t\tuniform vec4 u_color;\n\t\t\tuniform vec3 u_color_lines;\n\n\t\t\tattribute float wavePosX;\n\t\t\tattribute float wavePosY;\n\t\t\tattribute float random_factor;\n\t\t\tfloat pi = 3.14159265359;\n\n\t\t\tvarying float v_wavePosX;\n\t\t\tvarying float v_wavePosY;\n\t\t\tvarying float v_hexaLightDiff;\n\t\t"),t.vertexShader=t.vertexShader.replace("void main() {","\n\t\t\t// functions\n\t\t\tvoid main() {\n\t\t\t\tv_wavePosX = wavePosX;\n\t\t\t\tv_wavePosY = wavePosY;\n\t\t"),"hexa"!==e.lines&&"off"!=e.lines&&0==e.fill&&(t.vertexShader=t.vertexShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\tvarying float v_faceOpacity;\n\t\t\t\tattribute float a_faceColor;\n\t\t\t").replace("void main() {","\n\t\t\t\t// functions\n\t\t\t\tvoid main() {\n\t\t\t\t\tv_wavePosX = wavePosX;\n\t\t\t\t\tv_wavePosY = wavePosY;\n\t\t\t\t\tv_faceOpacity = a_faceColor;\n\n\t\t\t")),"hexa"!==e.lines){switch(e.type){case"default":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve) + sin((f_speed + wavePosY) * u_curve);\n\t\t\n\t\t\t\t\t\ttransformed.y += offset * u_amplitude;\n\t\t\n\t\t\t\t\t\t#include <morphtarget_vertex>");break;case"plainx":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve);\n\t\t\n\t\t\t\t\t\ttransformed.y += offset * u_amplitude;\n\t\t\t\t\t\t#include <morphtarget_vertex>");break;case"plainz":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\t\tfloat offset = sin((f_speed + wavePosY) * u_curve);\n\t\t\n\t\t\t\t\t\ttransformed.y += offset * u_amplitude;\n\t\t\t\t\t\t#include <morphtarget_vertex>");break;case"powerful":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\t\t\t//float offset = sin(f_speed) + sin(sin(u_curve) * wavePosX) + sin(sin(u_curve) * wavePosY);\n\t\t\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve) * wavePosX + sin((f_speed + wavePosY) * u_curve) * wavePosY;\n\t\t\n\t\t\t\t\t\ttransformed.y += offset * u_amplitude;\n\t\t\t\t\t\t#include <morphtarget_vertex>");break;case"funky":t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\t\tfloat f_speed = sin((u_time / u_curve) * u_speed) * 12.5;\n\t\t\t\t\t\tfloat offset = sin(f_speed * wavePosX+sin(f_speed * wavePosX+sin(f_speed * wavePosX))) + sin(f_speed * wavePosY+sin(f_speed * wavePosY));\n\t\t\t\t\t\t\n\t\t\t\t\t\ttransformed.y += offset * u_amplitude;\n\t\t\t\t\t\t#include <morphtarget_vertex>")}e.random_offset&&(t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\t\t\t\t\ttransformed.y += random_factor;\n\t\t\n\t\t\t\t\t#include <morphtarget_vertex>"))}else t.vertexShader=t.vertexShader.replace("#include <morphtarget_vertex>","\n\n\t\t\t\tfloat f_speed = (u_time / u_curve) * u_speed;\n\t\t\t\tfloat offset = sin((f_speed + wavePosX) * u_curve) + sin((f_speed + wavePosY) * u_curve) + u_amplitude / 2.0;\n\t\t\t\tfloat maxoffset = 2. + u_amplitude / 2.0;\n\t\t\t\tfloat hexaLightVal = abs(offset/maxoffset/10.);\n\n\t\t\t\tif(a_hexaCount > 0.0){\n\t\t\t\t\ttransformed.y += offset * u_amplitude / 4.0;\n\t\t\t\t\tv_hexaLightDiff = 0.8 + hexaLightVal;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\thexaLightVal = abs(offset/maxoffset/20.);\n\t\t\t\t\tv_hexaLightDiff = 0.8 + hexaLightVal;\n\t\t\t\t\ttransformed.y += offset * u_amplitude / 8.0;\n\t\t\t\t}\n\t\t\t\t#include <morphtarget_vertex>");switch(t.fragmentShader=t.fragmentShader.replace("#include <common>","\n\t\t\t#include <common>\n\t\t\tuniform vec4 u_color;\n\t\t\tuniform vec3 u_color_lines;\n\t\t\tuniform sampler2D u_pointTexture;\n\t\t\tvarying float v_wavePosX;\n\t\t\tvarying float v_wavePosY;\n\t\t\tuniform float u_intensity;\n\t\t\tvarying float v_hexaLightDiff;\n\t\t"),0!==e.numStops&&(t.fragmentShader=t.fragmentShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\tuniform vec2 u_gradientStart;\n\t\t\t\tuniform vec2 u_gradientEnd;\n\t\t\t\tuniform vec4 u_colors[6];\n\t\t\t\tuniform float u_colorstops[6];\n\t\t\t\tuniform int u_numstops;\n\t\t\t\tuniform float u_windowHeight;\n\t\t\t")),"hexa"!==e.lines&&"off"!=e.lines&&0==e.fill&&(t.fragmentShader=t.fragmentShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\tvarying float v_faceOpacity;\n\t\t\t")),t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\tfloat opaX = 1.0, opaZ = 1.0;\n\t\t\t#include <tonemapping_fragment>\n\t\t"),e.fade){case"sides":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaX = -abs((v_wavePosX+0.5)*2.0)+1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"back":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = abs(v_wavePosY / 1.0);\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"front":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = -abs(v_wavePosY / 1.0) + 1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"backfront":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = -abs((v_wavePosY-0.5)*2.0)+1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t");break;case"all":t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\topaZ = -abs((v_wavePosY-0.5)*2.0)+1.0;\n\t\t\t\t\topaX = -abs((v_wavePosX+0.5)*2.0)+1.0;\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t")}"off"!==e.lines?("color"==e.particleColor&&e.numStops>0&&0==e.custom_color_on&&(t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>",'\n\t\t\t\t\t\t\tvec4 c = vec4(0.0, 0.0, 0.0, 0.0);\n\t\t\t\t\t\t\t//float posX = (v_wavePosX + 1.0);\n\t\t\t\t\t\t\tfloat alpha = 0.0 * 3.14/180.0;\n\t\t\t\t\t\t\tfloat reach = 1.0;\n\t\t\t\t\t\t\tfloat posX = ((v_wavePosX + 1.0)*cos( alpha ) +  v_wavePosY*sin( alpha )) / reach;\n\t\n\t\t\t\t\t\t\t//if needed translate to "v_wavePosZ"\n\t\t\t\t\t\t\t//If scene is no longer hard coded at 30x30, then the reach value must be calculated differently with that in mind\n\t\n\t\t\t\t\t\t\tfor(int i=0; i<c_numstops; i++){\n\t\t\t\t\t\t\t\tif(u_colorstops[i] <= posX && posX <= u_colorstops[i+1]){\n\t\t\t\t\t\t\t\t\tc.x = mix(u_colors[i+1].x, u_colors[i].x, smoothstep(u_colorstops[i+1], u_colorstops[i], posX));\n\t\t\t\t\t\t\t\t\tc.y = mix(u_colors[i+1].y, u_colors[i].y, smoothstep(u_colorstops[i+1], u_colorstops[i], posX));\n\t\t\t\t\t\t\t\t\tc.z = mix(u_colors[i+1].z, u_colors[i].z, smoothstep(u_colorstops[i+1], u_colorstops[i], posX));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\t\tfloat oCopy = gl_FragColor.a;\n\t\t\t\t\t\t\tgl_FragColor = c;\n\t\t\t\t\t\t\tgl_FragColor.a = oCopy;\n\t\t\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t')),"image"==e.particleColor&&(e.custom_color_on?t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\t\tvec4 color = texture2D(u_pointTexture, vUv);\n\n\t\t\t\t\t\tgl_FragColor = vec4(float(u_color.x) / 255.0, float(u_color.y) / 255.0, float(u_color.z) / 255.0, u_color.a);\n\n\t\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t"):t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\t\tvec4 color = texture2D(u_pointTexture, vUv);\n\n\t\t\t\t\t\tfloat oCopy = gl_FragColor.a * color.a;\n\t\t\t\t\t\tgl_FragColor = color;\n\t\t\t\t\t\tgl_FragColor.a = oCopy;\n\n\t\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t")),e.fill?("boxes"==e.lines&&(t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\t\tfloat intens = u_intensity / 100.0;\n\t\t\t\t\t\tgl_FragColor.a = min(opaX * intens, opaZ * intens) * gl_FragColor.a * v_faceOpacity;\n\t\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t")),"triangles"==e.lines&&(t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\t\t\tfloat intens = u_intensity / 100.0;\n\t\t\t\t\t\tgl_FragColor.a = min(opaX * intens, opaZ * intens) * gl_FragColor.a * v_faceOpacity;\n\t\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t"))):t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>",`\n\t\t\t\t\tfloat intens = u_intensity / 100.0;\n\t\t\t\t\t${"hexa"===e.lines?"gl_FragColor.rgb *= v_hexaLightDiff;":""}\n\t\t\t\t\tgl_FragColor.a = min(opaX * intens, opaZ * intens) * gl_FragColor.a;\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t`)):!e.numStops&&e.numStops.length<0?t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\tfloat intens = u_intensity / 100.0;\n\t\t\t\tgl_FragColor.a = min(opaX * intens, opaZ * intens) * gl_FragColor.a * u_color.a;\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t"):t.fragmentShader=t.fragmentShader.replace("#include <tonemapping_fragment>","\n\t\t\t\tfloat intens = u_intensity / 100.0;\n\t\t\t\tgl_FragColor.a = min(opaX * intens, opaZ * intens) * gl_FragColor.a;\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t")}function c(t,e){t.scene.rotation.y=180*Math.PI/180,t.scene.rotation.z=e.angle*Math.PI/180,t.scene.rotation.x=(e.tilt+16)*Math.PI/180,t.camera.position.x=e.horizontal,t.camera.position.y=e.vertical,t.camera.position.z=e.zoom+27,e.keepCentered&&t.camera.lookAt(0,"path"===e.animationMovement?-20:0,0)}function p(t){var e="#";return e+=("00"+t[0].toString(16)).slice(-2),e+=("00"+t[1].toString(16)).slice(-2),e+=("00"+t[2].toString(16)).slice(-2)}function u(t,a){var r,n,i,o=t.settings.CanvasTexture,s=_R_is_Editor?RSColor.get(t.settings.wp_color_ori):t.settings.wp_color_ori,l=o.getContext("2d"),c=e.getGradients(s);if(window._R_is_Editor?(r=Math.round(RVS.H[a.lid].c[0].clientWidth),n=Math.round(RVS.H[a.lid].c[0].clientHeight)):(r=Math.round(t.w),n=Math.round(t.h)),void 0!==r&&!isNaN(r)&&0!==r&&void 0!==n&&!isNaN(n)&&0!==n){o.width=r,o.height=n,void 0===c.deg&&"object"==typeof c&&(c.deg=180),i="radialGradient"===c.type?l.createRadialGradient(r/2,n/2,0,r/2,n/2,Math.max(r/2,n/2)):e.calcLinearGradient(l,r,n,c.deg);for(var p=0;p<c.stops.length;p+=2)i.addColorStop(c.stops[p+1],c.stops[p]);l.fillStyle=i,l.fillRect(0,0,r,n),l.scale(-1,1),l.drawImage(l.canvas,-r,0,r,n),l.setTransform(1,0,0,1,0,0),t.settings.backgroundTexture.needsUpdate=!0}}function d(t){return(t=tpGS.gsap.utils.splitColor(t)).length<=3&&(t[3]=1),t}function f(t,e){t.scene.rotation.z=e.angle*Math.PI/180,t.scene.rotation.x=e.tilt*Math.PI/180,t.camera.position.x=e.horizontal,t.camera.position.y=e.vertical,t.camera.position.z=e.zoom+22,e.keepCentered&&t.camera.lookAt(0,0,0)}function m(t){t.vertexShader=t.vertexShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\t#define USE_UV true"),t.fragmentShader=t.fragmentShader.replace("#include <common>","\n\t\t\t\t#include <common>\n\t\t\t\t#define USE_UV true")}function h(t){return t*Math.PI/180}function _(t){return _R_is_Editor?RVS.LIB.RSWP[t.settings.lid]:e[t.settings.sid]._L[t.settings.lid]}jQuery.extend(!0,e,{particleWaveBuild:{getBasics:function(){return{type:"default",speed:40,curve:25,amplitude:35,randomizeValue:0,keepCentered:!0,angle:0,tilt:10,sx:0,sy:0,sz:0,dpr:1,particle:"default",particleSize:20,particleAmount:900,groShr:10,gap:20,fade:"off",opacityIntensity:95,particleColor:"color",parbackground:"default",bgfit:"cover",bgpos:"center center",particlesOn:!0,borderFilled:!1,connectionType:"off",customColorOn:!1,fillColor:"#ffffff",finish:"matte",linesOpacity:20,hexaShift:0,wp_color:"#ffffff",blending:"normal",movement:"off",animPath:"ocean",animPathHexa:"ocean",aniMainSpeed:40,angleEnd:0,tiltEnd:0,offsetxEnd:0,offsetyEnd:0,offsetzEnd:0,animRoute:"rounded",angleSpeed:-13,tiltSpeed:8,offsetzSpeed:5,interaction:"off",pTilt:30,pRotate:30,pIntensity:50,pSpeed:40,sbshifty:20,ppfx:"off",focus:5,aperture:5,maxblur:10,ppbb:!0,minblur:0,ppfn:80,ppfsc:82,ppfsz:256,ppfgs:!1}}},particleWaveInit:function(t,a){e.TWOMPI=e.TWOMPI||2*Math.PI,e.DEGTORAD=e.DEGTORAD||Math.PI/180,e.particleWaveUrl=void 0===a.url?"":a.url,THREE.Cache.enabled=!0,e.particleWaveUtils.observe(t)},particleWaveUtils:{observe:function(t){e[t].c.on("layerinitialised",(function(a,r){void 0!==e[t]._L[r.layer]&&e[t]._L[r.layer].c[0].className.indexOf("tp-particlewave")>=0&&e.particleWaveUtils.initLayer(t,r.layer)})),e[t].c.on("revolution.layeraction",(function(a,r){if(null!=e[t]._L[r.layerid]&&-1!==e[t]._L[r.layerid].c[0].className.indexOf("tp-particlewave"))if("enterstage"===r.eventtype)null==e[t]._L[r.layerid].particleWave&&e.particleWaveUtils.initLayer(t,r.layerid),e.particleWaveUtils.fitCameraToObject(e[t]._L[r.layerid]),e[t]._L[r.layerid].particleWave.pauseTimer&&e[t]._L[r.layerid].particleWave.pauseTimer.kill&&e[t]._L[r.layerid].particleWave.pauseTimer.kill();else if("leavestage"===r.eventtype&&e[t]._L[r.layerid]&&e[t]._L[r.layerid].particleWave&&e[t]._L[r.layerid].particleWave.waves){var n=e[t]._L[r.layerid].particleWave.waves;e[t]._L[r.layerid].particleWave.pauseTimer=tpGS.gsap.delayedCall(e[t]._L[r.layerid].frames.frame_999.timeline.speed/1e3,(function(){n.paused=!0,n.frame=cancelAnimationFrame(n.frame),n.destroy(),e[t]._L[r.layerid].particleWave=void 0}))}})),e[t].c.on("leftviewport",(function(){for(var a in e[t]._L)if(e[t]._L.hasOwnProperty(a)&&e[t]._L[a]&&e[t]._L[a].particleWave&&e[t]._L[a].particleWave.waves){var r=e[t]._L[a].particleWave.waves;r.paused=!0,r.frame=cancelAnimationFrame(r.frame),r.destroy(),e[t]._L[a].particleWave=void 0}})).on("enterviewport",(function(){for(var a in e[t]._L)e[t]._L.hasOwnProperty(a)&&(!e[t]._L[a]||-1===e[t]._L[a].c[0].className.indexOf("tp-particlewave")||e[t].pr_active_key!=e[t]._L[a].slideIndex&&"all"!=(e[t].carousel?.showLayersAllTime??"")||null==e[t]._L[a].particleWave&&e.particleWaveUtils.initLayer(t,a))}))},initLayer:function(t,a){if(null==e[t]._L[a]||void 0===e[t]._L[a].particleWave){var r,n,i=e[t]._L[a];i.particleWave=e.particleWaveUtils.getWebGLCanvas(),i.particleWave=jQuery.extend(!0,i.particleWave,e.particleWaveBuild.getBasics());var o=i.particleWave;if(o.sid=t,o.lid=a,void 0!==i.wpsdata)for(r in i.wpsdata="object"==typeof i.wpsdata?i.wpsdata:i.wpsdata.split(";"),i.wpsdata)if(i.wpsdata.hasOwnProperty(r))if((i.wpsdata[r]+"").indexOf("{")>=0)0==(i.wpsdata[r]+"").indexOf("co:")&&(o.wp_color=(i.wpsdata[r]+"").replace("co:",""));else switch((n=i.wpsdata[r].split(":"))[0]){case"s":o.speed=n[1];break;case"c":o.curve=n[1];break;case"a":o.amplitude=n[1];break;case"an":o.angle=n[1];break;case"t":o.tilt=n[1];break;case"particleSize":o.particleSize=n[1];break;case"particleAmount":o.particleAmount=n[1];break;case"p":o.particle=n[1];break;case"bg":o.parbackground=n[1];break;case"bgf":o.bgfit=n[1];break;case"bgp":o.bgpos=n[1];break;case"sx":o.sx=n[1];break;case"sy":o.sy=n[1];break;case"sz":o.sz=n[1];break;case"dpr":o.dpr=n[1];break;case"gs":o.groShr=n[1];break;case"ddu":o.particleColor=n[1];break;case"ddw":o.type=n[1];break;case"ddfd":o.fade=n[1];break;case"ddl":o.connectionType=n[1];break;case"ddh":o.finish=n[1];break;case"rv":o.randomizeValue=n[1];break;case"lb":o.fillColor=n[1];break;case"bf":o.borderFilled=n[1];break;case"lr":o.customColorOn=n[1];break;case"kc":o.keepCentered=n[1];break;case"po":o.particlesOn=n[1];break;case"tb":o.movement=n[1];break;case"lo":o.linesOpacity=n[1];break;case"hs":o.hexaShift=n[1];break;case"co":o.wp_color=n[1];break;case"g":o.gap=n[1];break;case"oi":o.opacityIntensity=n[1];break;case"e1":o.angleEnd=n[1];break;case"e2":o.tiltEnd=n[1];break;case"e3":o.offsetxEnd=n[1];break;case"e4":o.offsetyEnd=n[1];break;case"e5":o.offsetzEnd=n[1];break;case"e6":o.angleSpeed=n[1];break;case"e7":o.tiltSpeed=n[1];break;case"e0":o.offsetzSpeed=n[1];break;case"a1":o.animPath=n[1];break;case"aph":o.animPathHexa=n[1];break;case"as":o.aniMainSpeed=n[1];break;case"a2":o.animRoute=n[1];break;case"int":o.interaction=n[1];break;case"ptlt":o.pTilt=n[1];break;case"prt":o.pRotate=n[1];break;case"pspd":o.pSpeed=n[1];break;case"pint":o.pIntensity=n[1];break;case"sbsy":o.sbshifty=n[1];break;case"b0":o.blending=n[1];break;case"d3f":o.focus=n[1];break;case"d3a":o.aperture=n[1];break;case"d3m":o.maxblur=n[1];break;case"ppfn":parseFloat(o.ppfn=n[1]);break;case"ppfsc":parseFloat(o.ppfsc=n[1]);break;case"ppfsz":parseFloat(o.ppfsz=n[1]);break;case"ppfgs":o.ppfgs=n[1];break;case"ppbb":o.ppbb=n[1];break;case"ppbm":o.minblur=n[1];break;case"d0":o.ppfx=n[1]}i.c.find("canvas").remove(),i.c[0].appendChild(o.canvas),e.particleWaveUtils.setLayer(i)}},initBackendLayer:function(t){if(_R_is_Editor&&RVS.LIB.RSWP&&RVS.LIB.RSWP[t]&&RVS.LIB.RSWP[t].particleWave){var a=RVS.LIB.RSWP[t].particleWave;a.initCall&&a.initCall.kill(),a&&a.waves&&a.waves.destroy&&a.waves.destroy()}if(e.TWOMPI=e.TWOMPI||2*Math.PI,e.DEGTORAD=e.DEGTORAD||Math.PI/180,void 0!==RVS&&void 0!==RVS.L&&void 0!==RVS.L[t]&&null!=RVS.L[t].addOns["revslider-particlewave-addon"]){var r={};_R_is_Editor&&(void 0===RVS.LIB.RSWP&&(RVS.LIB.RSWP={}),RVS.LIB.RSWP[t]=r),r.particleWave=e.particleWaveUtils.getWebGLCanvas(),r.particleWave=jQuery.extend(!0,RVS._R.particleWaveBuild.getBasics(),r.particleWave),r.particleWave=jQuery.extend(!0,r.particleWave,RVS.L[t].addOns["revslider-particlewave-addon"]),r.lid=t,r.particleWave.lid,r.particleWave.initCall=tpGS.gsap.delayedCall(.3,(function(){RVS.L[t]&&(r.eow=RVS.L[t].size.width[RVS.screen].v.indexOf&&-1!==RVS.L[t].size.width[RVS.screen].v.indexOf("%")?RVS.H[t].c.width():parseInt(RVS.L[t].size.width[RVS.screen].v,0),r.eoh=RVS.L[t].size.height[RVS.screen].v.indexOf&&-1!==RVS.L[t].size.height[RVS.screen].v.indexOf("%")?RVS.H[t].c.height():parseInt(RVS.L[t].size.height[RVS.screen].v,0),RVS.H[t].c[0].appendChild(r.particleWave.canvas),e.particleWaveUtils.layers=void 0===e.particleWaveUtils.layers?{}:e.particleWaveUtils.layers,r.particleWave.id=RVS.S.slideId,r.particleWave.lid=t,e.particleWaveUtils.layers[RVS.S.slideId+"_"+t]=r,e.particleWaveUtils.setLayer(r),e.particleWaveUtils.fitCameraToObject(r))}))}},setLayer:function(a){var r,i,l,c,p,d,f=a.particleWave;f.gap=parseFloat(f.gap)/10,f.particleSize=parseFloat(f.particleSize)/100,f.particleAmount="hexa"===f.connectionType?900:f.particleAmount,f.particleAmount=Math.floor(Math.sqrt(parseFloat(f.particleAmount))),f.angle=parseFloat(f.angle),f.tilt=parseFloat(f.tilt),f.sx=parseFloat(f.sx),f.sy=parseFloat(f.sy),f.sz=parseFloat(f.sz),"path"!==f.movement&&"loop"!==f.movement||(f.angle=0,f.tilt=10,f.sx=0,f.sy=0,f.sz=0,f.keepCentered=!0),"keep"==f.particleColor&&(f.customColorOn=!0),"image"==f.particleColor&&(f.wp_color="#ffffff",f.fillColor="#ffffff",f.customColorOn=!1),f.angle="hexa"===f.connectionType?Math.min(90,Math.max(-90,f.angle)):f.angle,f.randomizeValue=parseFloat(f.randomizeValue)/2,f.linesOpacity=parseFloat(f.linesOpacity)/100,f.hexaShift=parseFloat(f.hexaShift),f.opacityIntensity=parseFloat(f.opacityIntensity),f.aniMainSpeed=parseFloat(f.aniMainSpeed),f.angleEnd=parseFloat(f.angleEnd),f.tiltEnd=parseFloat(f.tiltEnd),f.offsetxEnd=parseFloat(f.offsetxEnd),f.offsetyEnd=parseFloat(f.offsetyEnd),f.offsetzEnd=parseFloat(f.offsetzEnd),f.angleSpeed=parseFloat(f.angleSpeed),f.tiltSpeed=parseFloat(f.tiltSpeed),f.offsetzSpeed=parseFloat(f.offsetzSpeed),_R_is_Editor&&void 0===RVS.ENV.PARTICLEWAVE_URL&&(RVS.ENV.PARTICLEWAVE_URL="//"+window.location.host+"/wp-content/plugins/revslider-particlewave-addon/"),"default"===f.particle&&(f.particle=_R_is_Editor?RVS.ENV.PARTICLEWAVE_URL+"sr6/lib/par.svg":e.particleWaveUrl+"sr6/lib/par.svg"),"default"===f.parbackground&&(f.parbackground=_R_is_Editor?RVS.ENV.PARTICLEWAVE_URL+"/sr6/lib/img.png":e.particleWaveUrl+"/sr6/lib/img.png"),-1!==f.particle.indexOf(".svg")&&(f.svg=!0),f.wp_color_ori=f.wp_color,f.wp_color=window._R_is_Editor?RSColor.get(a.particleWave.wp_color):a.particleWave.wp_color,f.wp_color=e.getGradientColorStopPoints(f.wp_color),void 0===t&&(t=new THREE.Clock),f.settings={},f.settings.type=f.type,f.settings.particles=f.particleAmount,f.settings.gap=10,f.settings.lines=f.connectionType,f.settings.random_offset=f.randomizeValue,f.settings.icon=f.particle,f.settings.fill=f.borderFilled,f.settings.width=a.eow,f.settings.height=a.eoh,f.settings.canvas=f.canvas,f.settings.custom_color_on=f.customColorOn,f.settings.keepCentered=f.keepCentered,f.settings.linesOpacity=f.linesOpacity,f.settings.hexaShift=f.hexaShift,f.settings.numStops=0,f.settings.gradientStart=new THREE.Vector2,f.settings.gradientEnd=new THREE.Vector2,f.settings.particleGap=f.gap,f.settings.bgUrl=f.parbackground,f.settings.bgfit=f.bgfit,f.settings.bgpos=f.bgpos,f.settings.finish=f.finish,f.settings.interaction=f.interaction,f.settings.sbshifty=-parseFloat(f.sbshifty),f.settings.dpr=parseFloat(f.dpr),f.settings.ppbb=f.ppbb,s(f.settings,a),f.settings.isSVG=f.svg,f.settings.lid=f.lid,f.settings.sid=f.sid,f.settings.tcanv=document.createElement("canvas"),(-1!==f.wp_color_ori.indexOf("gradient")||_R_is_Editor&&-1!==RSColor.get(f.wp_color_ori).indexOf("gradient"))&&(f.settings.isGradient=!0,f.settings.CanvasTexture=document.createElement("canvas"),f.settings.backgroundTexture=new THREE.CanvasTexture(f.settings.CanvasTexture)),f.settings.isGradient&&(f.settings.particleColor="image"),"image"===f.particleColor&&(f.settings.bgCanvas=document.createElement("canvas"),f.settings.backgroundTexture=new THREE.CanvasTexture(f.settings.bgCanvas),r=f.settings,f.parbackground,i=r.bgUrl,l=r.bgCanvas,c=r.backgroundTexture,p=l.getContext("2d"),(d=new Image).crossOrigin="Anonymous",d.crossOrigin="Anonymous",d.onload=function(){var t,e,a,n,i=this.naturalWidth,o=this.naturalHeight,s=i/o,u=Math.max(i,o);l.width=i,l.height=o,"cover"===r.bgfit?(l.width=u,l.height=u,p.scale(-1,1),i>o?(t=-(u*s-u)/2,e=0,n=u*s,a=u):(t=0,e=(u-u/s)/2,n=u,a=u/s),-1!==r.bgpos.indexOf("left")?t=0:-1!==r.bgpos.indexOf("right")&&(t=i>o?u-u*s:0),-1!==r.bgpos.indexOf("top")?e=0:-1!==r.bgpos.indexOf("bottom")&&(e=i>o?0:u-u/s),p.drawImage(this,0,0,i,o,-(u-t),e,n,a)):"contain"===r.bgfit?(l.width=u,l.height=u,n=i,a=o,p.scale(-1,1),i>o?(t=0,e=(u-o)/2):(t=(u-i)/2,e=0),p.drawImage(this,0,0,i,o,-(u-t),e,n,a)):(p.scale(-1,1),p.drawImage(this,-i,0,i,o)),c.needsUpdate=!0},d.src=i),function(t,e,a,r,i){a*=100*window.devicePixelRatio*(r+1);var o=e.getContext("2d"),s=new Image;s.crossOrigin="Anonymous",-1==t.indexOf(".svg")?(s.crossOrigin="Anonymous",s.onload=function(){n(this.naturalWidth,this.naturalHeight,a,s,o,i)},s.src=t):jQuery.ajax({url:t,accepts:"image/svg+xml",complete:function(t){for(var e=t.responseText,r=jQuery(e),s=0;s<r.length;s++)if("svg"===r[s].tagName){r=r.eq(s);break}if(e){var l=parseFloat(r.attr("width")),c=parseFloat(r.attr("height"));isNaN(l)&&(l=a),isNaN(c)&&(c=a),r.attr("width",l),r.attr("height",c),e=(e=(new XMLSerializer).serializeToString(r[0])).replace(/<metadata([\s\S]*?)>([\s\S]*?)<\/metadata>/g,"");var p=new Image,u="data:image/svg+xml;base64,"+btoa(e);n(l,c,a,p,o,i,u)}else console.error("Failed to load svg, please make sure used SVG file contains valid SVG code or make sure server delivers SVG file with correct CORS permission headers.")},error:function(){n(0,0,a,s,o,i,t)}})}(f.settings.icon,f.settings.tcanv,f.settings.size,f.settings.scale,(function(){f.waves=new o(f.settings,a),f.waves.resize(a.eow,a.eoh),f.waves.render(),f.settings.isGradient&&u(f.waves,a)}))},updateLayer:function(t,a,r,n,i){void 0!==e.particleWaveUtils.layers[t+"_"+a]&&(e.particleWaveUtils.layers[t+"_"+a].particleWave[r]=n,s(e.particleWaveUtils.layers[t+"_"+a].particleWave.settings,e.particleWaveUtils.layers[t+"_"+a]),e.particleWaveUtils.layers[t+"_"+a].particleWave.waves.update())},splitColor:function(t){return 3==(t=tpGS.gsap.utils.splitColor(t)).length&&(t[3]=1),t[0]/=255,t[1]/=255,t[2]/=255,t},fitCameraToObject:function(t){var e,a;_R_is_Editor&&!RVS.H[t.lid]||t.particleWave.waves&&(window._R_is_Editor?(e=Math.round(RVS.H[t.lid].c[0].clientWidth),a=Math.round(RVS.H[t.lid].c[0].clientHeight)):(e=Math.round(t.eow),a=Math.round(t.eoh)),e=isNaN(e)?0:e,a=isNaN(a)?0:a,t.particleWave.lastDim={width:e,height:a},t.particleWave.waves.resize(e,a),t.particleWave.settings.isGradient&&u(t.particleWave.waves,t),t.particleWave.waves.initPP(),t.particleWave.waves.paused=!1,cancelAnimationFrame(t.particleWave.waves.frame),t.particleWave.waves.frame=requestAnimationFrame(t.particleWave.waves.bindedRender))},getWebGLCanvas:function(){let t=document.createElement("canvas");return t.style.width="100%",t.style.height="100%",t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.zIndex=2,t.width=1600,t.height=1200,{canvas:t}}}}),o.prototype.render=function(r){if(this.destroyed||this.paused||(this.frame=cancelAnimationFrame(this.frame),this.frame=requestAnimationFrame(this.bindedRender)),void 0!==r&&void 0!==this.time){this.tDiff=(r-this.time)/1600,this.time=r;var n=_(this);void 0!==n.particleWave.lastDim&&n.particleWave.lastDim.width===n.eow&&n.particleWave.lastDim.height===n.eoh||e.particleWaveUtils.fitCameraToObject(n);var i,o;if(t.getElapsedTime()>a*(1/60)){if("timelinebased"===this.settings.interaction)n&&n.timeline&&(this.material.userData.u_time.value+=.1*(n.timeline.time()-this.material.userData.u_time.value));else if("scrollbased"===this.settings.interaction&&!_R_is_Editor&&e[this.settings.sid].sbtimeline.set){var s=0-e[this.settings.sid].scrollProgBasics.top,l=e[this.settings.sid].scrollProgBasics.height+e.lastwindowheight-e.lastwindowheight-e[this.settings.sid].module.height,c=Math.min(1,Math.max(0,s/l));this.group.rotation.x+=.1*(this.settings.pTilt*c-this.group.rotation.x),this.group.rotation.z+=.1*(this.settings.pRotate*c-this.group.rotation.z),this.group.position.y+=.1*(this.settings.sbshifty*c-this.group.position.y),this.material.userData.u_time.value+=this.tDiff}else this.material.userData.u_time.value+=this.tDiff;a+=this.tDiff}"off"!=this.settings.animationMovement&&function(t,e){var a=t.material.userData.u_time.value;if("off"==e.animationMovement)return;"path"==e.animationMovement&&"hexa"!=e.lines&&function(t,e,a){switch(a.PathDDM){case"ocean":t.camera.position.z=Math.sin(e*(a.aniSpeed/100))*(a.particles/3)+a.particles/3,t.camera.position.y=a.amplitude/3,t.camera.lookAt(0,0,-a.particles/3);break;case"lost":t.scene.rotation.y+=t.tDiff/1e3*a.aniSpeed,t.camera.position.z=Math.sin(e*(a.aniSpeed/40))*(a.particles/6)+a.particles/6;break;case"round":t.camera.position.set(a.particles/4,a.amplitude,0),t.scene.rotation.y-=t.tDiff/1e3*a.aniSpeed,t.camera.rotation.y=Math.PI/3,t.camera.rotation.x=-1*Math.PI/180,t.camera.rotation.z=1*Math.PI/180;break;case"oceanEdge":t.camera.position.z=Math.sin(e*(a.aniSpeed/100))*(a.particles/3)+a.particles/3,t.scene.rotation.z=Math.PI/2,t.camera.position.y=a.amplitude/3,t.camera.lookAt(0,0,-a.particles/3);break;case"quarterPipe":t.camera.position.z=Math.sin(e*(a.aniSpeed/100))*(a.particles/3)+a.particles/3,t.camera.position.y=a.amplitude/3,t.scene.rotation.x=Math.sin(e*(a.aniSpeed/100))*Math.PI/4+Math.PI/4;break;case"upAnDown":t.camera.position.z=Math.sin(e*(a.aniSpeed/50))*(a.particles/3)+a.particles/3,t.camera.position.y=Math.cos(e*(a.aniSpeed/50))*(a.particles/6),t.camera.lookAt(0,0,-a.particles/3),t.scene.rotation.y+=t.tDiff/1e3*a.aniSpeed;break;case"oceanEdgeSpin":t.camera.position.z=Math.sin(e*(a.aniSpeed/100))*(a.particles/3)+a.particles/3,t.camera.position.y=a.amplitude/3,t.camera.lookAt(0,0,-a.particles/3),t.scene.rotation.z-=t.tDiff/400*a.aniSpeed}}(t,a,e);"path"==e.animationMovement&&"hexa"===e.lines&&function(t,e,a){switch(a.PathDDMHexa){case"ocean":t.scene.rotation.x=(a.tilt+37)*Math.PI/180,t.scene.position.z=2,t.camera.position.x=Math.sin(e*(a.aniSpeed/100))*(a.particles/12),t.camera.position.y=Math.cos(e*(a.aniSpeed/100))*(a.particles/14)+a.particles/12;break;case"round":t.scene.rotation.x=(a.tilt+37)*Math.PI/180,t.camera.position.x=Math.sin(e*(a.aniSpeed/100))*(a.particles/6),t.camera.rotation.z-=t.tDiff/1e3*a.aniSpeed,t.camera.position.z=Math.min(2*Math.sin(e*(a.aniSpeed/100))+20,2*Math.sin(e*(a.aniSpeed/50))+18);break;case"handheld":t.scene.rotation.x=(a.tilt+37)*Math.PI/180,t.camera.position.x=Math.sin(e*(a.aniSpeed/100))*(a.particles/6),t.scene.rotation.z=Math.sin(e*(a.aniSpeed/100))*(10*Math.PI)/180,t.camera.position.z=Math.min(2*Math.sin(e*(a.aniSpeed/50))+4*a.amplitude,2*Math.sin(e*(a.aniSpeed/50))+18);break;case"oldOcean":t.camera.position.z=Math.sin(e*(a.aniSpeed/100))*(a.particles/3)+a.particles/3,t.camera.position.y=a.amplitude-Math.sin(e*(a.aniSpeed/100))*a.amplitude/2,t.camera.lookAt(0,0,-a.particles);break;case"oldLost":t.scene.rotation.y+=t.tDiff/1e3*a.aniSpeed,t.camera.position.y=1.5*a.amplitude,t.camera.position.z=Math.sin(e*(a.aniSpeed/40))*(a.particles/6)+a.particles/6;break;case"oldRound":t.camera.position.set(a.particles/4,1.5*a.amplitude,0),t.scene.rotation.y-=t.tDiff/1e3*a.aniSpeed,t.camera.rotation.y=60*Math.PI/180,t.camera.rotation.x=-1*Math.PI/180,t.camera.rotation.z=1*Math.PI/180}}(t,a,e);"pendulum"==e.animationMovement&&function(t,e,a){var r=Math.max(a.horizontal,a.xEnd),n=Math.min(a.horizontal,a.xEnd),i=Math.max(a.vertical,a.yEnd),o=Math.min(a.vertical,a.yEnd),s=Math.max(a.zoom,a.zEnd),l=Math.min(a.zoom,a.zEnd),c=new THREE.Vector3(Math.sin(e*(a.aniSpeed/100))*(r-n)/2+n+(r-n)/2,Math.sin(e*(a.aniSpeed/100))*(i-o)/2+o+(i-o)/2,Math.sin(e*(a.aniSpeed/100))*(s-l)/2+l+(s-l)/2+a.particles/2);"rounded"==a.pendulum_route&&t.camera.lookAt(-c.x,-c.y,-c.z);t.camera.position.copy(c);var p=Math.max(a.tEnd/180*Math.PI,a.tilt/180*Math.PI),u=Math.min(a.tEnd/180*Math.PI,a.tilt/180*Math.PI);t.scene.rotation.x=Math.sin(e*(a.aniSpeed/100))*(p-u)/2+u+(p-u)/2,t.camera.position.z=c.z+10;var d=Math.max(a.aEnd/180*Math.PI,a.angle/180*Math.PI),f=Math.min(a.aEnd/180*Math.PI,a.angle/180*Math.PI);t.scene.rotation.z=Math.sin(e*(a.aniSpeed/100))*(d-f)/2+f+(d-f)/2}(t,a,e);"loop"==e.animationMovement&&function(t,e){t.scene.rotation.x+=e.tSpeed/5e3*t.tDiff*100,t.scene.rotation.y+=e.rSpeed/5e3*t.tDiff*100,t.scene.rotation.z+=e.aSpeed/5e3*t.tDiff*100}(t,e)}(this,this.settings),"mousefollow"===this.settings.interaction&&(i=this,"mousefollow"!==(o=this.settings).interaction||e.ISM?"mousefollow"===o.interaction&&(i.tx+=(i.px-i.tx)*i.lerp,i.ty+=(i.py-i.ty)*i.lerp,i.group.rotation.x=o.pIntensity*-i.ty*Math.PI/180,i.group.rotation.z=o.pIntensity*i.tx*Math.PI/180):(i.targetX+=(i.mouseX-i.targetX)*i.lerp,i.targetY+=(i.mouseY-i.targetY)*i.lerp,i.group.rotation.z=o.pTilt*(i.targetX-.5),i.group.rotation.x=o.pRotate*(i.targetY-.5))),("glitch"!=n.particleWave.ppfx||"hexa"!=n.particleWave.settings.lines)&&n.pp&&n.pp.composer?("bokeh"===n.particleWave.ppfx&&(n.pp.effectPass.uniforms.maxblur.value=this.settings.ppbb?tpGS.gsap.utils.mapRange(0,1,this.settings.minblur,this.settings.maxblur,Math.abs(Math.sin(Math.PI*(this.material.userData.u_time.value+.5)*.3))):this.settings.maxblur),"glitch"==n.particleWave.ppfx&&(window._R_is_Editor&&RVS.H[n.lid]?(n.pp.effectPass.uniforms.width.value=RVS.H[n.lid].c[0].clientWidth,n.pp.effectPass.uniforms.height.value=RVS.H[n.lid].c[0].clientHeight):(n.pp.effectPass.uniforms.width.value=n.lastknownwidth,n.pp.effectPass.uniforms.height.value=n.lastknownheight),"bokeh"===n.particleWave.ppfx?n.pp.effectPass.uniforms.progress.value=this.material.userData.u_time.value/100%1:n.pp.effectPass.uniforms.progress.value=this.material.userData.u_time.value),n.pp.composer.render()):this.renderer.render(this.scene,this.camera)}else this.time=r},o.prototype.initPP=function(){var t=_(this);if(t.particleWave&&"off"!==t.particleWave.ppfx&&!this.ppEnabled&&void 0!==this.w&&void 0!==this.h&&0!==this.w&&0!==this.h)switch(this.ppEnabled=!0,t.particleWave.ppfx){case"bokeh":t.pp=e.postProcessing.d3.init(this.renderer,this.scene,this.camera,{focus:t.particleWave.focus,aperture:1e-5*t.particleWave.aperture,maxblur:t.particleWave.maxblur,transparent:!0,width:this.w,height:this.h});break;case"glitch":t.pp=e.postProcessing.glitch2.init(this.renderer,this.scene,this.camera,{progress:2,transparent:!0,duration:1,width:this.w,height:this.h})}},o.prototype.update=function(){this.material.userData.u_amplitude.value=this.settings.amplitude,this.material.userData.u_speed.value=this.settings.speed,this.material.userData.u_curve.value=this.settings.curve,this.material.userData.u_scale.value=this.settings.scale,"hexa"==this.settings.lines?c(this,this.settings):f(this,this.settings)},o.prototype.resize=function(t,e){this.w=t,this.h=e,this.camera.aspect=this.w/this.h,this.camera.updateProjectionMatrix(),this.renderer.setSize(this.w,this.h)},o.prototype.mouseenter=function(t){var e=this.settings.canvas.getBoundingClientRect();this.mouseX=(t.pageX-e.top)/e.width,this.mouseY=(t.pageY-e.left)/e.height,tpGS.gsap.to(this,{duration:2,lerp:this.settings.lerp})},o.prototype.mouseleave=function(t){this.mouseX=.5,this.mouseY=.5,tpGS.gsap.to(this,{duration:0,lerp:.001,overwrite:!0})},o.prototype.pointermove=function(t){var e=this.settings.canvas.getBoundingClientRect();this.mouseX=(t.pageX-e.top)/e.width,this.mouseY=(t.pageY-e.left)/e.height},o.prototype.mousefollowHandler=function(){this.pFrame&&(this.pFrame=window.cancelAnimationFrame(this.pFrame));var t,a,r,n=this.pEvent;t=n.beta-60,a=n.gamma,r=t;var i=Math.abs(this.orientationX-a)>1||Math.abs(this.orientationY-r)>1;if(this.orientationX=a,this.orientationY=r,i){if(e.winW>e.getWinH(this.settings.sid)){var o=a;a=r,r=o}this.px=a,this.py=r}},o.prototype.destroy=function(){this.destroyed=!0,this.renderer&&(this.renderer.dispose(),this.renderer.domElement.remove(),this.renderer.domElement=null),this.renderer=null,this.frame=cancelAnimationFrame(this.frame)},window.RS_MODULES=window.RS_MODULES||{},window.RS_MODULES.particlewave={loaded:!0,version:"6.7.0"},window.RS_MODULES.checkMinimal&&window.RS_MODULES.checkMinimal()}();