"use strict";var Perfecto=Perfecto||{};Perfecto.App=function(e,t){function n(){TWEEN.update(),o.render(),a.render(),s.render(),requestAnimationFrame(n)}var r=document.getElementById(e);if(null==r)return this;r.style.overflow="hidden";var i=Perfecto.MoveListener.getInstance(),o=new Perfecto.BackgroundRender(r,"back-renderer"),a=new Perfecto.GridRender(r,"middle-renderer",t),s=new Perfecto.PageRender(r,"front-renderer"),c=new Perfecto.PolicyPage;n(),window.addEventListener("resize",function(){i.resize(),o.resize(),a.resize(),s.resize(),c.resize()}),this.setLinks=function(e){a.setLinks(e)},this.setLogo=function(e,t,n,r){a.setLogo(e,t,n)}},Perfecto.addClassMethods=function(e){e.hasClass=function(t){for(var n=e.className.split(/\s+/),r=t.trim().split(/\s+/),i=n.length-1;i>=0;i--)if(r.indexOf(n[i])!=-1)return!0;return!1},e.hasClassString=function(t){return e.className.indexOf(t)!=-1},e.addClass=function(t){var n=e.className,r=t.trim().split(/\s+/);return r.forEach(function(e){n.indexOf(e)==-1&&(n+=""==n?e:" "+e)}),e.className=n,e},e.removeClass=function(t){var n=e.className,r=t.trim().split(/\s+/);return r.forEach(function(e){n=n.replace(e,"")}),e.className=n.trim(),e}},Perfecto.arrayFill=function(e,t){var n=[];if(void 0!=t)for(var r=0;r=1?(n.x=e,n.y=e/t):(n.x=e/t,n.y=e),n},Perfecto.createElement=function(e){var t=e.tag||"div",n=document.createElement(t);if(Perfecto.addClassMethods(n),e.class&&n.addClass(e.class),e.text&&n.appendChild(document.createTextNode(e.text)),e.atts){var r=e.atts;Object.keys(r).forEach(function(e){n[e]=r[e]})}return n},Perfecto.createElements=function(e){function t(e,t){var n=Perfecto.createElement(e);return t.appendChild(n),e.alias&&(t[e.alias]=n),n}if(!e||!e.length)return null;for(var n=Perfecto.createElement(e[0]),r=n,i=1,o=e.length;i=669?669:t},Perfecto.preferredWidth=function(e){var t=.9*e;return t>=681?681:t},Perfecto.shuffleArray=function(e,t){t=t||3*e.length;for(var n=e.length-1,r=0,i=e[r],o=0;o0,E=p?e[0][i]:null;this.from=function(t,r){return p&&(o=n(t),void 0!=r&&(i=r,E=e[0][i])),this},this.to=function(e,t){return p&&(a=n(e),void 0!=t&&(s=t)),this},this.duration=function(e){return s=e,this},this.delay=function(e,t){if(!p)return this;if(1==arguments.length)if(Array.isArray(e)){for(var n=Math.min(g,e.length),r=0;r0,a=null,s=null,c=null,u=0;this.add=function(e){var n=new Perfecto.Tween(e);return i.push(n),t++,o=!0,n},this.from=function(){var e=arguments;return i.forEach(function(t){t.from.apply(t,e)}),this},this.to=function(e,t){return i.forEach(function(n){n.to(e,t)}),this},this.duration=function(e){return i.forEach(function(t){t.duration(e)}),this},this.delay=function(e,n){if(!o)return this;if(1==arguments.length)if(Array.isArray(e)){for(var r=Math.min(t,e.length),a=0;a=i?Math.min(r,i):Math.max(r,i);var t=e/2,n=a.fov/2,o=t*Perfecto.ctg(n);return a.position.z=o,o},this.getScene=function(){return o},this.getCamera=function(){return a},this.getRenderer=function(){return s},this.getWidth=function(){return r},this.getHeight=function(){return i},this.getLessSide=function(){return Math.min(r,i)},this.getBiggerSide=function(){return Math.max(r,i)},this.dispatchEvent=function(t,n){try{var r=new CustomEvent(t,{detail:n})}catch(e){var r=document.createEvent("CustomEvent");r.initCustomEvent(t,!1,!1,n)}e.dispatchEvent(r)}},Perfecto.BackgroundRender=function(e,t){function n(){var e=a*(1+u),t=Perfecto.buildProportionalSize(e,g.aspect);t.x*=-1;var n=o/2,i=(.7+u)*a,s=r(n,t,i,0,-90),c=r(n,t,i,0,-90);c.forEach(function(e){e.position.multiplyScalar(-1)});var l=s.concat(c);Perfecto.shuffleArray(l),l.forEach(function(e){v.add(e)});var f=a;f/=g.aspect>=1?g.aspect:1/g.aspect;var d=g.fov/2;return g.position.z=f*Perfecto.ctg(d),l}function r(e,t,n,r,i){r=void 0!=r?THREE.Math.degToRad(r):0,i=void 0!=i?THREE.Math.degToRad(i):Math.PI/2;for(var o={color:12632256,transparent:!0,opacity:.5,program:function(e){e.beginPath(),e.arc(0,0,1,0,2*Math.PI,!1),e.fill()}},a=Object.keys(THREE.ColorKeywords),u=a.length,l=[],f=0;ft)){var i=y[n].element;i.hasOwnProperty("hoverNode")?i.removeChild(i.hoverNode):i.hasOwnProperty("logoNode")&&i.removeChild(i.logoNode);var o=Perfecto.createElements([{tag:"div",class:"item-mask"},{tag:"span",class:"link-text",text:r.text.trim(),alias:"linkText"}]);i.appendChild(o),i.hoverNode=o,i.setAttribute("data-url",r.url),i.addClass("navigation-item")}}),v.resize()},this.setLogo=function(e,t,n,r){if(t=t||"",n=n||"",r=r||"#",y.length>e){w=Perfecto.createElements([{tag:"a",class:"logo-mask hidden",atts:{href:r}},[{tag:"div",class:"logo-title",text:t,alias:"logoTitle"},{tag:"div",class:"logo-subtitle",text:n,alias:"logoSubtitle"}]]);var i=y[e].element;i.hasOwnProperty("hoverNode")&&i.removeChild(i.hoverNode),i.appendChild(w),i.logoNode=w}}},Perfecto.PageRender=function(e,t){function n(e){return e&&"#"!==e?T?void v.dispatchEvent("statechange",{state:"paused"}):(p.domElement.style.display="block",T=!0,C=!1,M=!1,v.dispatchEvent("statechange",{state:"paused"}),s(),v.resizeCamera(),y.pageFrame.src=e,!0):void v.dispatchEvent("statechange",{state:"active"})}function r(){M||(w.show(),M=!0),setTimeout(function(){y.addClass("loaded")},u)} function i(){C||(C=!0,y.removeClass("loaded"),w.hide(),setTimeout(function(){p.domElement.style.display="none",v.dispatchEvent("statechange",{state:"active"}),T=!1},u+l))}function o(){var e=[];c();for(var t=0;t=1&&(s=!1)):(h=f,v=d),e.forEach(function(e,n){var r=u+n/l*t,i=e.basePosition.clone();i.x+=h*r,i.y+=v*r,e.position.copy(i)}))}},Perfecto.ParticlesAnimation=function(e,t,n){function r(e){for(var t=e.length,n=e[0].length,r=Math.floor(n/2),i=r-1;i>=0;i--)for(var o=0;o255&&(s=255),s=s.toString(16);var c="#"+s+s+s,f=Math.cos(i);a(l[t],n,o,c,f),t