define("domReady",[],function(){"use strict";function t(){var t=c;h&&t.length&&(c=[],function(t){var e;for(e=0;e<t.length;e+=1)t[e](l)}(t))}function e(){h||(h=!0,a&&clearInterval(a),t())}function n(t){return h?t(l):c.push(t),n}var i,r,a,o,s="undefined"!=typeof window&&window.document,h=!s,l=s?document:null,c=[],u=(o=999,-1!=navigator.appVersion.indexOf("MSIE")&&(o=parseFloat(navigator.appVersion.split("MSIE")[1])),o);if(s){if(document.addEventListener)document.addEventListener("DOMContentLoaded",e,!1),window.addEventListener("load",e,!1);else if(window.attachEvent){window.attachEvent("onload",e),r=document.createElement("div");try{i=null===window.frameElement}catch(t){}r.doScroll&&i&&window.external&&(a=setInterval(function(){try{r.doScroll(),e()}catch(t){}},30))}9<u?"complete"!==document.readyState&&"interactive"!==document.readyState||e():"complete"===document.readyState&&e()}return n.version="2.0.1",n.load=function(t,e,i,r){r.isBuild?i(null):n(i)},n}),define("dispatcher",[],function(){var i=[];return{dispatch:function(t){for(var e=0;e<=i.length-1;e++)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}}}),define("resize/resize.store",["dispatcher"],function(t){"use strict";var i,r,e=!1,n={width:0,height:0},a=!1,o=function(){var t=0,e=0;return document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):"number"==typeof window.innerWidth?(console.dir(window),t=window.innerWidth,e=window.innerHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(t=document.body.clientWidth,e=document.body.clientHeight),{height:e,width:t}},s=function(t){"fire-resize"===t.type&&(n=o(),l.dispatch({type:"change"}),h.dispatch({type:"change"})),"resize-disable"===t.type&&(a=!0),"resize-enable"===t.type&&(a=!1)},h=(r=[],{dispatch:function(t){for(var e=r.length-1;0<=e;e--)r[e](t)},subscribe:function(t){r.push(t)},unsubscribe:function(t){for(var e=0;e<=r.length-1;e++)r[e]==t&&r.splice(e--,1)}}),l=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,n=o(),window.addEventListener("resize",function(){n=o(),l.dispatch({type:"change"}),a||h.dispatch({type:"change"})},!1),window.addEventListener("orientationchange",function(){n=o(),l.dispatch({type:"change"}),a||h.dispatch({type:"change"})},!1),window.addEventListener("load",function(){n=o(),l.dispatch({type:"change"}),a||h.dispatch({type:"change"})},!1),t.subscribe(s)),{eventEmitter:h,forcedEventEmitter:l,getData:function(){return{height:n.height,width:n.width}}}}),define("resize/vhUnits.view",["dispatcher","resize/resize.store"],function(t,i){"use strict";var r={},s=1,e=function(){var t=i.getData();for(var e in t.height,r)r.hasOwnProperty(e)&&(r[e].element.style.height=t.height+"px")},n=function(){var t;t=document.getElementsByClassName("vh-height");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="vh-units-id-"+s,s++),i[n]={id:n,element:r})}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){Modernizr.cssvhunit||(n(),e(),i.eventEmitter.subscribe(e),t.subscribe(function(t){"mutate"===t.type&&(n(),e())}))}}}),define("resize/vhMinUnits.view",["dispatcher","resize/resize.store"],function(t,i){"use strict";var r={},s=1,e=function(){var t=i.getData().height;for(var e in r)r.hasOwnProperty(e)&&(r[e].element.style.minHeight=t+"px")},n=function(){var t;t=document.getElementsByClassName("vh-min-height");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="vh-min-units-id-"+s,s++),i[n]={id:n,element:r})}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){n(),e(),i.eventEmitter.subscribe(e),t.subscribe(function(t){"mutate"===t.type&&(n(),e())})}}}),define("resize/breakpoint.store",["dispatcher"],function(t){var i,e=!1,r=[{size:0,name:"mobile"},{size:640,name:"tablet"},{size:1e3,name:"desktop"}],n=!1,a={width:0,height:0},o=function(){var t=0,e=0;return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(t=document.body.clientWidth,e=document.body.clientHeight),{height:e,width:t}},s=function(){a=o(),function(){for(var t=r.length-1;0<=t;t--)if(a.width>=r[t].size){if(n===r[t])return;return n=r[t],h.dispatch({type:"change"})}}()},h=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,a=o(),s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1),window.addEventListener("load",s,!1)),{eventEmitter:h,getData:function(){return{breakpoint:n}}}}),define("touch/touch.store",["dispatcher","resize/breakpoint.store"],function(t,e){"use strict";var i,r,n,a,o,s,h=!1,l=function(){var t=e.getData();(n=r?"desktop"!==t.breakpoint.name:!!i||"desktop"!==t.breakpoint.name)!==a&&((a=n)?(o.classList.add("touch-detected"),o.classList.remove("touch-undetected")):(o.classList.remove("touch-detected"),o.classList.add("touch-undetected")),c.dispatch())},c=(s=[],{dispatch:function(t){for(var e=s.length-1;0<=e;e--)s[e](t)},subscribe:function(t){s.push(t)},unsubscribe:function(t){for(var e=0;e<=s.length-1;e++)s[e]==t&&s.splice(e--,1)}});return h||(h=!0,o=document.getElementsByTagName("html")[0],i="ontouchstart"in window,r=-1<navigator.userAgent.toLowerCase().indexOf("firefox"),l(),e.eventEmitter.subscribe(l)),{eventEmitter:c,getData:function(){return{isTouchDevice:a}}}}),define("images/images.view",["dispatcher","resize/breakpoint.store","touch/touch.store"],function(c,r,n){"use strict";var a={},u=1,e=function(){var e=r.getData().breakpoint.name,t=n.getData();for(var i in"desktop"===e&&t.isTouchDevice&&(e="tablet"),a)a.hasOwnProperty(i)&&function(t){if(t.current!==e){if(!t.sources.hasOwnProperty(e))return console.warn("no source image for breakpoint "+e);t.current=e,"img"===t.element.tagName.toLowerCase()&&(t.listener||(t.listener=!0,t.element.addEventListener("load",function(){c.dispatch({type:"adaptive-image-load",id:t.id})}),t.element.src=t.sources[e])),"img"!==t.element.tagName.toLowerCase()&&(t.img||(t.img=document.createElement("img")),t.listener||(t.listener=!0,t.img.addEventListener("load",function(){c.dispatch({type:"adaptive-image-load",id:t.id}),t.element.style.backgroundImage="url("+t.sources[e]+")"}),t.img.src=t.sources[e]))}}(a[i])},i=function(){var t;t=document.getElementsByClassName("adaptive-image");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s,h=!1;for(var l in t)if(t.hasOwnProperty(l)&&t[l].element===e){h=!0;break}h||(i=t,n=(r=e).getAttribute("data-preload-id"),a=r.getAttribute("data-desktop-src"),o=r.getAttribute("data-tablet-src"),s=r.getAttribute("data-mobile-src"),o||(o=a),s||(s=o),n||(n="adaptive-image-id-"+u,u++,r.setAttribute("data-preload-id",n)),c.dispatch({type:"adaptive-image-add",id:n}),i[n]={id:n,element:r,listener:!1,fakeImg:!1,sources:{desktop:a,tablet:o,mobile:s},current:!1})}(a,t[e]);for(var i in a)a.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}var a,o;r||(a=t,o=i,c.dispatch({type:"adaptive-image-remove",id:o.id}),delete a[o.id])}(a,t,a[i])};return{init:function(){i(),e(),r.eventEmitter.subscribe(e),c.subscribe(function(t){"mutate"===t.type&&(i(),e())})}}}),define("resize/element-resize.view",["dispatcher","resize/resize.store"],function(t,e){"use strict";var s={},l=1,i=function(){for(var t in s)s.hasOwnProperty(t)&&(e=s[t],o=a=n=r=i=void 0,"none"!==e.resize&&(n=(i=e.container.clientWidth)/(r=e.container.clientHeight),a=e.element.width/e.element.height,"width"===e.resize||a<=n&&"all"===e.resize?(o=Math.floor(i/a),e.element.style.width=i+"px",e.element.style.height="auto",e.element.style.left="auto",e.element.style.top=Math.floor((r-o)/2)+"px"):("height"===e.resize||n<a&&"all"===e.resize)&&(o=Math.floor(r*a),e.element.style.width="auto",e.element.style.height=r+"px",e.element.style.top="0px",e.element.style.left=Math.floor((i-o)/2)+"px")));var e,i,r,n,a,o},r=function(){var t;t=document.getElementsByClassName("resize-element");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s=!1;for(var h in t)if(t.hasOwnProperty(h)&&t[h].element===e){s=!0;break}s||(i=t,n=(r=e).getAttribute("data-id"),a=r.parentNode,(o=r.getAttribute("data-resize"))||(o="all"),n||(n="resize-element-id-"+l,l++),i[n]={id:n,resize:o,element:r,container:a})}(s,t[e]);for(var i in s)s.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(s,t,s[i])};return{init:function(){r(),i(),e.eventEmitter.subscribe(i),t.subscribe(function(t){"mutate"===t.type&&(r(),i())})}}}),define("resize/ios-fix.view",["dispatcher","resize/resize.store"],function(t,e){"use strict";var i=!1,r=function(){document.documentElement.style.height=window.innerHeight+"px",document.body.style.height=window.innerHeight+"px"};return{init:function(){var t=navigator.userAgent;(t.match(/iPad/i)||t.match(/iPhone/i))&&-1!==t.indexOf("Safari")&&(i=!0),i&&(e.eventEmitter.subscribe(r),r())}}}),function(){"use strict";function o(n,t){var e;if(t=t||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=t.touchBoundary||10,this.layer=n,this.tapDelay=t.tapDelay||200,!o.notNeeded(n)){for(var i=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],r=0,a=i.length;r<a;r++)this[i[r]]=function(t,e){return function(){return t.apply(e,arguments)}}(this[i[r]],this);s&&(n.addEventListener("mouseover",this.onMouse,!0),n.addEventListener("mousedown",this.onMouse,!0),n.addEventListener("mouseup",this.onMouse,!0)),n.addEventListener("click",this.onClick,!0),n.addEventListener("touchstart",this.onTouchStart,!1),n.addEventListener("touchmove",this.onTouchMove,!1),n.addEventListener("touchend",this.onTouchEnd,!1),n.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(n.removeEventListener=function(t,e,i){var r=Node.prototype.removeEventListener;"click"===t?r.call(n,t,e.hijacked||e,i):r.call(n,t,e,i)},n.addEventListener=function(t,e,i){var r=Node.prototype.addEventListener;"click"===t?r.call(n,t,e.hijacked||(e.hijacked=function(t){t.propagationStopped||e(t)}),i):r.call(n,t,e,i)}),"function"==typeof n.onclick&&(e=n.onclick,n.addEventListener("click",function(t){e(t)},!1),n.onclick=null)}}var s=0<navigator.userAgent.indexOf("Android"),h=/iP(ad|hone|od)/.test(navigator.userAgent),l=h&&/OS 4_\d(_\d)?/.test(navigator.userAgent),c=h&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),n=0<navigator.userAgent.indexOf("BB10");o.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(h&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},o.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!s;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},o.prototype.sendClick=function(t,e){var i,r;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),r=e.changedTouches[0],(i=document.createEvent("MouseEvents")).initMouseEvent(this.determineEventType(t),!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),i.forwardedTouchEvent=!0,t.dispatchEvent(i)},o.prototype.determineEventType=function(t){return s&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},o.prototype.focus=function(t){var e;h&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},o.prototype.updateScrollParent=function(t){var e,i;if(!(e=t.fastClickScrollParent)||!e.contains(t)){i=t;do{if(i.scrollHeight>i.offsetHeight){e=i,t.fastClickScrollParent=i;break}i=i.parentElement}while(i)}e&&(e.fastClickLastScrollTop=e.scrollTop)},o.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},o.prototype.onTouchStart=function(t){var e,i,r;if(1<t.targetTouches.length)return!0;if(e=this.getTargetElementFromEventTarget(t.target),i=t.targetTouches[0],h){if((r=window.getSelection()).rangeCount&&!r.isCollapsed)return!0;if(!l){if(i.identifier&&i.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=i.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=i.pageX,this.touchStartY=i.pageY,t.timeStamp-this.lastClickTime<this.tapDelay&&t.preventDefault(),!0},o.prototype.touchHasMoved=function(t){var e=t.changedTouches[0],i=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>i||Math.abs(e.pageY-this.touchStartY)>i},o.prototype.onTouchMove=function(t){return!this.trackingClick||((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0)},o.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},o.prototype.onTouchEnd=function(t){var e,i,r,n,a,o=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,i=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,c&&(a=t.changedTouches[0],(o=document.elementFromPoint(a.pageX-window.pageXOffset,a.pageY-window.pageYOffset)||o).fastClickScrollParent=this.targetElement.fastClickScrollParent),"label"===(r=o.tagName.toLowerCase())){if(e=this.findControl(o)){if(this.focus(o),s)return!1;o=e}}else if(this.needsFocus(o))return 100<t.timeStamp-i||h&&window.top!==window&&"input"===r?this.targetElement=null:(this.focus(o),this.sendClick(o,t),h&&"select"===r||(this.targetElement=null,t.preventDefault())),!1;return!(!h||l||!(n=o.fastClickScrollParent)||n.fastClickLastScrollTop===n.scrollTop)||(this.needsClick(o)||(t.preventDefault(),this.sendClick(o,t)),!1)},o.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},o.prototype.onMouse=function(t){return!(this.targetElement&&!t.forwardedTouchEvent&&t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)&&(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),1))},o.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,!(this.trackingClick=!1)):"submit"===t.target.type&&0===t.detail||((e=this.onMouse(t))||(this.targetElement=null),e)},o.prototype.destroy=function(){var t=this.layer;s&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},o.notNeeded=function(t){var e,i,r;if(void 0===window.ontouchstart)return!0;if(i=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!s)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(31<i&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(n&&(10<=(r=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/))[1]&&3<=r[2]&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction},o.attach=function(t,e){return new o(t,e)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("fastClick",[],function(){return o}):"undefined"!=typeof module&&module.exports?(module.exports=o.attach,module.exports.FastClick=o):window.FastClick=o}(),define("touch/touch.view",["dispatcher","touch/touch.store","fastClick"],function(t,e,i){"use strict";return{init:function(){e.getData().isTouchDevice&&i.attach(document.body)}}}),define("router/router.store",["dispatcher"],function(t){"use strict";var i,e=!1,r=!1,n=function(t){"route-change"===t.type&&(r=t.href,a.dispatch())},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,r=location.href,t.subscribe(n)),{eventEmitter:a,getData:function(){return{href:r}}}}),define("router/links.view",["dispatcher","router/router.store"],function(l,n){"use strict";var a={},c=1,e=function(t){var e,i;for(var r in t=n.getData(),e=t.href,a)a.hasOwnProperty(r)&&(i=a[r],e===i.element.href?i.element.classList.add("link-active"):i.element.classList.remove("link-active"))},i=function(){var t;t=document.getElementsByClassName("inner-link");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s=!1;for(var h in t)if(t.hasOwnProperty(h)&&t[h].element===e){s=!0;break}s||(i=t,n=(r=e).getAttribute("data-id"),a=r.getAttribute("data-animation"),r.getAttribute("href"),o=r.getAttribute("data-scroll"),n||(n="processed-link-id-"+c,c++),a||(a="simple"),o=!(!o||"false"===o),r.addEventListener("click",function(t){var e=r.href;t.preventDefault(),e!==location.href&&(l.dispatch({type:"link-animation-start",id:n,animation:a,scroll:o,me:"links-view"}),l.dispatch({type:"route-change",href:e,me:"links-view"}))}),i[n]={id:n,element:r,animation:a})}(a,t[e]);for(var i in a)a.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(a,t,a[i])};return{init:function(){i(),e(),l.subscribe(function(t){"mutate"===t.type&&(i(),e())})}}}),define("page-transition/page-transition.store",["dispatcher"],function(t){"use strict";var i,e=!1,r=0,n=0,a=!1,o=!1,s=!1,h="light",l=!1,c="",u="",d="ffffff",p=function(t){if("transition-step-1"===t.type&&(r++,t.hasOwnProperty("animation")&&!1!==t.animation&&(s=t.animation),t.hasOwnProperty("id")&&!1!==t.id&&t.id,2<=r&&(a=!0,f.dispatch())),"transition-step-2"===t.type){if(r<2)return;n++,t.hasOwnProperty("animation")&&!1!==t.animation&&(s=t.animation),t.hasOwnProperty("scheme")&&!1!==t.scheme&&(h=t.scheme),t.hasOwnProperty("pageNameId")&&!1!==t.pageNameId&&(l=t.pageNameId),t.hasOwnProperty("text")&&t.pageNameId!==c&&(c=t.text),t.hasOwnProperty("color")&&!1!==t.color&&(d=t.color),t.hasOwnProperty("projectText")&&!1!==t.projectText&&(u=t.projectText),t.hasOwnProperty("id")&&!1!==t.id&&t.id,3<=n&&(o=!0,f.dispatch())}"transition-step-reset"===t.type&&(n=r=0,s=o=a=!1,h="light",u=c="",l=!(d="ffffff"))},f=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,t.subscribe(p)),{eventEmitter:f,getData:function(){return{step1ready:a,step2ready:o,animation:s,scheme:h,pageNameId:l,text:c,color:d,projectText:u}}}}),define("utils",[],function(){var s=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t,e){window.setTimeout(t,1e3/60)},o={x:function(){try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){return new XMLHttpRequest}}},send:function(t,e,i,r,n){var a=o.x();a.open(i,t,n),a.onreadystatechange=function(){4==a.readyState&&e(a.responseText)},a.send(r)},get:function(t,e,i,r){var n=[];for(var a in e)n.push(encodeURIComponent(a)+"="+encodeURIComponent(e[a]));o.send(t+"?"+n.join("&"),i,"GET",null,r)},post:function(t,e,i,r){var n=[];for(var a in e)n.push(encodeURIComponent(a)+"="+encodeURIComponent(e[a]));n.push(encodeURIComponent("action")+"="+encodeURIComponent("send")),o.send(t,i,"POST",n.join("&"),r)}};return{offset:function(t){return t.getBoundingClientRect?(e=t.getBoundingClientRect(),i=document.body,r=document.documentElement,n=window.pageYOffset||r.scrollTop||i.scrollTop,a=window.pageXOffset||r.scrollLeft||i.scrollLeft,o=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,h=e.top+n-o,l=e.left+a-s,{top:Math.round(h),left:Math.round(l)}):function(t){for(var e=0,i=0;t;)e+=parseInt(t.offsetTop),i+=parseInt(t.offsetLeft),t=t.offsetParent;return{top:e,left:i}}(t);var e,i,r,n,a,o,s,h,l},Tween:function(n,a,t,o,e){this.i=0,this.duration=60*t,this.current=n,this.func=e,this.to=a,this.halt=!1,this.stop=function(){this.halt=!0,this.i=0,this.current=n},this.animate=function(){var i=this;this.halt=!1,this.func(this.current);var r=function(){var t,e;i.halt||(i.i++,1<(t=i.i/i.duration)&&(t=1),e=o?o(t):t,i.current=n+(a-n)*e,i.func(i.current),0!==Math.floor(i.current-i.to)&&s(r))};r()}},getRequestAnimationFrame:function(){return s},ajax:o,queryParse:function(t){return"string"!=typeof t?{}:(t=t.trim().replace(/^(\?|#|&)/,""))?t.split("&").reduce(function(t,e){var i=e.replace(/\+/g," ").split("="),r=i[0],n=i[1];return r=decodeURIComponent(r),n=void 0===n?null:decodeURIComponent(n),t.hasOwnProperty(r)?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n,t},{}):{}}}}),define("router/fetch.view",["dispatcher","router/router.store","page-transition/page-transition.store","utils"],function(m,e,i,r){"use strict";var n=1,E={},g=!1,t=function(t){(t=e.getData()).href&&r.ajax.get(t.href,{},function(t){g=t,m.dispatch({type:"transition-step-1"})},!0)},a=function(){var t=i.getData();!0===t.step1ready&&!1===t.step2ready&&function(){var t,e,i,r,n,a,o,s,h=[],l="ffffff",c="",u="light",d="",p=!1;if(g){(t=document.createElement("div")).innerHTML=g,h=t.getElementsByClassName("replaceable"),e=t.getElementsByTagName("header")[0],r=t.getElementsByClassName("page-name"),i=t.getElementsByClassName("home")[0],n=t.getElementsByClassName("project-preview"),a=t.getElementsByTagName("title")[0].innerHTML,document.title=a,n&&n.length?(n=n[0],d=n.getAttribute("data-text")):d="",e||console.warn("header element is missing"),r&&r.length||console.warn("page-names elements are missing"),i||console.warn("home element is missing");for(var f=0;f<r.length;f++)r[f].classList.contains("active")&&(p=r[f].getAttribute("data-id"));for(e.classList.contains("light")?u="light":e.classList.contains("dark")&&(u="dark"),l=i.getAttribute("data-color"),c=i.getAttribute("data-text"),f=0;f<h.length;f++)o=h[f],(s=o.getAttribute("data-id"))?E.hasOwnProperty(s)?E[s].conatainer.innerHTML=o.innerHTML:console.warn("container with id "+s+" is missing"):console.warn("data-id attribute is missing");setTimeout(function(){m.dispatch({type:"transition-step-2",scheme:u,pageNameId:p,text:c,projectText:d,color:l}),m.dispatch({type:"mutate"})},20)}}(),!0===t.step1ready&&!0===t.step2ready&&(g=!1)};return{init:function(){(function(){for(var t=document.getElementsByClassName("replaceable"),e=0;e<t.length;e++)i=t[e],r=void 0,(r=i.getAttribute("data-id"))||(r="replaceable-id-"+n,n++,i.setAttribute("data-id",r)),E[r]={id:r,conatainer:i};var i,r})(),i.eventEmitter.subscribe(a),e.eventEmitter.subscribe(t)}}}),define("scroll/scroll.store",["dispatcher","utils"],function(t,e){"use strict";var i,r,n=!1,a=0,o=0,s=!1,h=function(){var t=(window.pageYOffset||window.document.scrollTop)-(window.document.clientTop||0);return isNaN(t)&&(t=0),t},l=function(){var t=(window.pageXOffset||window.document.scrollLeft)-(window.document.clientLeft||0);return isNaN(t)&&(t=0),t},c=function(t){"fire-scroll"===t.type&&(a=h(),o=l(),d.dispatch({type:"change"}),u.dispatch({type:"change"})),"scroll-disable"===t.type&&(s=!0),"scroll-enable"===t.type&&(s=!1)},u=(r=[],{dispatch:function(t){for(var e=r.length-1;0<=e;e--)r[e](t)},subscribe:function(t){r.push(t)},unsubscribe:function(t){for(var e=0;e<=r.length-1;e++)r[e]==t&&r.splice(e--,1)}}),d=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return n||(n=!0,function(){e.getRequestAnimationFrame(),a=h(),o=l();window.addEventListener("scroll",function(){a=h(),o=l(),d.dispatch({type:"change"}),s||u.dispatch({type:"change"})},!1),t.subscribe(c)}()),{eventEmitter:u,forcedEventEmitter:d,getData:function(){return{top:a,left:o}}}}),define("router/history.view",["dispatcher","router/router.store","scroll/scroll.store","page-transition/page-transition.store"],function(n,e,a,o){"use strict";var i=!1,s="normal",t=function(t){return t=e.getData(),console.log(s),"history"===s?void(s="normal"):i?(i=t.href,void(Modernizr.history&&history.pushState({href:i},!1,i))):(i=t.href,void history.replaceState({href:i},!1,i))},r=function(t){var e=a.getData().top,i=o.getData(),r=t.state;t.state&&(r=r.href,window.scrollTo(0,e),setTimeout(function(){window.scrollTo(0,e)},0),void 0===r&&location.reload(),!1===i.step1ready&&!1===i.step2ready&&(s="history",n.dispatch({type:"link-animation-start",animation:"simple",scroll:0,me:"history-view"}),n.dispatch({type:"route-change",href:r,me:"history-view"})))};return{init:function(){t(),e.eventEmitter.subscribe(t),window.onpopstate=r}}}),define("images/images.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=function(t){if("adaptive-image-add"===t.type){if(r.hasOwnProperty(t.id))return;r[t.id]={id:t.id,loaded:!1}}if("adaptive-image-remove"===t.type){if(!r.hasOwnProperty(t.id))return;delete r[t.id]}if("adaptive-image-load"===t.type){if(!r.hasOwnProperty(t.id))return;r[t.id].loaded=!0,a.dispatch()}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,t.subscribe(n)),{eventEmitter:a,getData:function(){return{items:r}}}}),define("router/scroll-load.view",["dispatcher","scroll/scroll.store","resize/resize.store","utils","images/images.store"],function(e,i,t,r,n){"use strict";var a,o,s,h,l,c=!1,u=!1,d=function(){var t=i.getData().top;c||o&&(u||(u=t),a-s/5<t&&u<t&&(c=!0,e.dispatch({type:"link-animation-start",id:h,animation:"project",scroll:!1,me:"links-view"}),e.dispatch({type:"route-change",href:l,me:"links-view"})),u=t)},p=function(){o&&(s=t.getData().height,a=r.offset(o).top)},f=function(){var t;o=document.getElementsByClassName("scroll-route")[0],l=h=!1,setTimeout(function(){c=!1},2e3),o&&(t=o.getElementsByTagName("a")[0])&&(h=t.getAttribute("data-id"),l=t.href)};return{init:function(){setTimeout(function(){f(),p(),d(),i.eventEmitter.subscribe(d),t.eventEmitter.subscribe(p),n.eventEmitter.subscribe(p),e.subscribe(function(t){"mutate"===t.type&&(f(),p(),d()),"link-animation-start"===t.type&&(c=!0)})},100)}}});var _gsScope="undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window;(_gsScope._gsQueue||(_gsScope._gsQueue=[])).push(function(){"use strict";var t,h,e,x,R,_,b,g,i,v,w,y,T,p,f,E,r;_gsScope._gsDefine("TweenMax",["core.Animation","core.SimpleTimeline","TweenLite"],function(r,c,E){var g=function(t){var e,i=[],r=t.length;for(e=0;e!==r;i.push(t[e++]));return i},v=function(t,e,i){var r,n,a=t.cycle;for(r in a)n=a[r],t[r]="function"==typeof n?n.call(e[i],i):n[i%n.length];delete t.cycle},y=function(t,e,i){E.call(this,t,e,i),this._cycle=0,this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._dirty=!0,this.render=y.prototype.render},T=E._internals,R=T.isSelector,_=T.isArray,t=y.prototype=E.to({},.1,{}),x=[];y.version="1.18.0",t.constructor=y,t.kill()._gc=!1,y.killTweensOf=y.killDelayedCallsTo=E.killTweensOf,y.getTweensOf=E.getTweensOf,y.lagSmoothing=E.lagSmoothing,y.ticker=E.ticker,y.render=E.render,t.invalidate=function(){return this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),E.prototype.invalidate.call(this)},t.updateTo=function(t,e){var i,r=this.ratio,n=this.vars.immediateRender||t.immediateRender;for(i in e&&this._startTime<this._timeline._time&&(this._startTime=this._timeline._time,this._uncache(!1),this._gc?this._enabled(!0,!1):this._timeline.insert(this,this._startTime-this._delay)),t)this.vars[i]=t[i];if(this._initted||n)if(e)this._initted=!1,n&&this.render(0,!0,!0);else if(this._gc&&this._enabled(!0,!1),this._notifyPluginsOfEnabled&&this._firstPT&&E._onPluginEvent("_onDisable",this),.998<this._time/this._duration){var a=this._time;this.render(0,!0,!1),this._initted=!1,this.render(a,!0,!1)}else if(0<this._time||n){this._initted=!1,this._init();for(var o,s=1/(1-r),h=this._firstPT;h;)o=h.s+h.c,h.c*=s,h.s=o-h.c,h=h._next}return this},t.render=function(t,e,i){this._initted||0===this._duration&&this.vars.repeat&&this.invalidate();var r,n,a,o,s,h,l,c,u=this._dirty?this.totalDuration():this._totalDuration,d=this._time,p=this._totalTime,f=this._cycle,m=this._duration,E=this._rawPrevTime;if(u<=t?(this._totalTime=u,this._cycle=this._repeat,this._yoyo&&0!=(1&this._cycle)?(this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0):(this._time=m,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1),this._reversed||(r=!0,n="onComplete",i=i||this._timeline.autoRemoveChildren),0===m&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||E<0||1e-10===E)&&E!==t&&(i=!0,1e-10<E&&(n="onReverseComplete")),this._rawPrevTime=c=!e||t||E===t?t:1e-10)):t<1e-7?(this._totalTime=this._time=this._cycle=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==p||0===m&&0<E)&&(n="onReverseComplete",r=this._reversed),t<0&&(this._active=!1,0===m&&(this._initted||!this.vars.lazy||i)&&(0<=E&&(i=!0),this._rawPrevTime=c=!e||t||E===t?t:1e-10)),this._initted||(i=!0)):(this._totalTime=this._time=t,0!==this._repeat&&(o=m+this._repeatDelay,this._cycle=this._totalTime/o>>0,0!==this._cycle&&this._cycle===this._totalTime/o&&this._cycle--,this._time=this._totalTime-this._cycle*o,this._yoyo&&0!=(1&this._cycle)&&(this._time=m-this._time),this._time>m?this._time=m:this._time<0&&(this._time=0)),this._easeType?(s=this._time/m,(1===(h=this._easeType)||3===h&&.5<=s)&&(s=1-s),3===h&&(s*=2),1===(l=this._easePower)?s*=s:2===l?s*=s*s:3===l?s*=s*s*s:4===l&&(s*=s*s*s*s),1===h?this.ratio=1-s:2===h?this.ratio=s:this._time/m<.5?this.ratio=s/2:this.ratio=1-s/2):this.ratio=this._ease.getRatio(this._time/m)),d!==this._time||i||f!==this._cycle){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=d,this._totalTime=p,this._rawPrevTime=E,this._cycle=f,T.lazyTweens.push(this),void(this._lazy=[t,e]);this._time&&!r?this.ratio=this._ease.getRatio(this._time/m):r&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==d&&0<=t&&(this._active=!0),0===p&&(2===this._initted&&0<t&&this._init(),this._startAt&&(0<=t?this._startAt.render(t,e,i):n||(n="_dummyGS")),this.vars.onStart&&(0===this._totalTime&&0!==m||e||this._callback("onStart"))),a=this._firstPT;a;)a.f?a.t[a.p](a.c*this.ratio+a.s):a.t[a.p]=a.c*this.ratio+a.s,a=a._next;this._onUpdate&&(t<0&&this._startAt&&this._startTime&&this._startAt.render(t,e,i),e||(this._totalTime!==p||r)&&this._callback("onUpdate")),this._cycle!==f&&(e||this._gc||this.vars.onRepeat&&this._callback("onRepeat")),n&&(this._gc&&!i||(t<0&&this._startAt&&!this._onUpdate&&this._startTime&&this._startAt.render(t,e,i),r&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[n]&&this._callback(n),0===m&&1e-10===this._rawPrevTime&&1e-10!==c&&(this._rawPrevTime=0)))}else p!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate"))},y.to=function(t,e,i){return new y(t,e,i)},y.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new y(t,e,i)},y.fromTo=function(t,e,i,r){return r.startAt=i,r.immediateRender=0!=r.immediateRender&&0!=i.immediateRender,new y(t,e,r)},y.staggerTo=y.allTo=function(t,e,i,r,n,a,o){r=r||0;var s,h,l,c,u=i.delay||0,d=[],p=function(){i.onComplete&&i.onComplete.apply(i.onCompleteScope||this,arguments),n.apply(o||i.callbackScope||this,a||x)},f=i.cycle,m=i.startAt&&i.startAt.cycle;for(_(t)||("string"==typeof t&&(t=E.selector(t)||t),R(t)&&(t=g(t))),t=t||[],r<0&&((t=g(t)).reverse(),r*=-1),s=t.length-1,l=0;l<=s;l++){for(c in h={},i)h[c]=i[c];if(f&&v(h,t,l),m){for(c in m=h.startAt={},i.startAt)m[c]=i.startAt[c];v(h.startAt,t,l)}h.delay=u,l===s&&n&&(h.onComplete=p),d[l]=new y(t[l],e,h),u+=r}return d},y.staggerFrom=y.allFrom=function(t,e,i,r,n,a,o){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,y.staggerTo(t,e,i,r,n,a,o)},y.staggerFromTo=y.allFromTo=function(t,e,i,r,n,a,o,s){return r.startAt=i,r.immediateRender=0!=r.immediateRender&&0!=i.immediateRender,y.staggerTo(t,e,r,n,a,o,s)},y.delayedCall=function(t,e,i,r,n){return new y(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:r,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,useFrames:n,overwrite:0})},y.set=function(t,e){return new y(t,0,e)},y.isTweening=function(t){return 0<E.getTweensOf(t,!0).length};var a=function(t,e){for(var i=[],r=0,n=t._first;n;)n instanceof E?i[r++]=n:(e&&(i[r++]=n),r=(i=i.concat(a(n,e))).length),n=n._next;return i},u=y.getAllTweens=function(t){return a(r._rootTimeline,t).concat(a(r._rootFramesTimeline,t))};y.killAll=function(t,e,i,r){null==e&&(e=!0),null==i&&(i=!0);var n,a,o,s=u(0!=r),h=s.length,l=e&&i&&r;for(o=0;o<h;o++)a=s[o],(l||a instanceof c||(n=a.target===a.vars.onComplete)&&i||e&&!n)&&(t?a.totalTime(a._reversed?0:a.totalDuration()):a._enabled(!1,!1))},y.killChildTweensOf=function(t,e){if(null!=t){var i,r,n,a,o,s=T.tweenLookup;if("string"==typeof t&&(t=E.selector(t)||t),R(t)&&(t=g(t)),_(t))for(a=t.length;-1<--a;)y.killChildTweensOf(t[a],e);else{for(n in i=[],s)for(r=s[n].target.parentNode;r;)r===t&&(i=i.concat(s[n].tweens)),r=r.parentNode;for(o=i.length,a=0;a<o;a++)e&&i[a].totalTime(i[a].totalDuration()),i[a]._enabled(!1,!1)}}};var n=function(t,e,i,r){e=!1!==e,i=!1!==i;for(var n,a,o=u(r=!1!==r),s=e&&i&&r,h=o.length;-1<--h;)a=o[h],(s||a instanceof c||(n=a.target===a.vars.onComplete)&&i||e&&!n)&&a.paused(t)};return y.pauseAll=function(t,e,i){n(!0,t,e,i)},y.resumeAll=function(t,e,i){n(!1,t,e,i)},y.globalTimeScale=function(t){var e=r._rootTimeline,i=E.ticker.time;return arguments.length?(t=t||1e-10,e._startTime=i-(i-e._startTime)*e._timeScale/t,e=r._rootFramesTimeline,i=E.ticker.frame,e._startTime=i-(i-e._startTime)*e._timeScale/t,e._timeScale=r._rootTimeline._timeScale=t,t):e._timeScale},t.progress=function(t){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),!1):this._time/this.duration()},t.totalProgress=function(t){return arguments.length?this.totalTime(this.totalDuration()*t,!1):this._totalTime/this.totalDuration()},t.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!=(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},t.duration=function(t){return arguments.length?r.prototype.duration.call(this,t):this._duration},t.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat,this._dirty=!1),this._totalDuration)},t.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},t.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},t.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},y},!0),_gsScope._gsDefine("TimelineLite",["core.Animation","core.SimpleTimeline","TweenLite"],function(c,u,d){var p=function(t){u.call(this,t),this._labels={},this.autoRemoveChildren=!0===this.vars.autoRemoveChildren,this.smoothChildTiming=!0===this.vars.smoothChildTiming,this._sortChildren=!0,this._onUpdate=this.vars.onUpdate;var e,i,r=this.vars;for(i in r)e=r[i],m(e)&&-1!==e.join("").indexOf("{self}")&&(r[i]=this._swapSelfInParams(e));m(r.tweens)&&this.add(r.tweens,0,r.align,r.stagger)},t=d._internals,e=p._internals={},f=t.isSelector,m=t.isArray,E=t.lazyTweens,g=t.lazyRender,o=_gsScope._gsDefine.globals,v=function(t){var e,i={};for(e in t)i[e]=t[e];return i},y=function(t,e,i){var r,n,a=t.cycle;for(r in a)n=a[r],t[r]="function"==typeof n?n.call(e[i],i):n[i%n.length];delete t.cycle},a=e.pauseCallback=function(){},T=function(t){var e,i=[],r=t.length;for(e=0;e!==r;i.push(t[e++]));return i},i=p.prototype=new u;return p.version="1.18.0",i.constructor=p,i.kill()._gc=i._forcingPlayhead=i._hasPause=!1,i.to=function(t,e,i,r){var n=i.repeat&&o.TweenMax||d;return e?this.add(new n(t,e,i),r):this.set(t,i,r)},i.from=function(t,e,i,r){return this.add((i.repeat&&o.TweenMax||d).from(t,e,i),r)},i.fromTo=function(t,e,i,r,n){var a=r.repeat&&o.TweenMax||d;return e?this.add(a.fromTo(t,e,i,r),n):this.set(t,r,n)},i.staggerTo=function(t,e,i,r,n,a,o,s){var h,l,c=new p({onComplete:a,onCompleteParams:o,callbackScope:s,smoothChildTiming:this.smoothChildTiming}),u=i.cycle;for("string"==typeof t&&(t=d.selector(t)||t),f(t=t||[])&&(t=T(t)),(r=r||0)<0&&((t=T(t)).reverse(),r*=-1),l=0;l<t.length;l++)(h=v(i)).startAt&&(h.startAt=v(h.startAt),h.startAt.cycle&&y(h.startAt,t,l)),u&&y(h,t,l),c.to(t[l],e,h,l*r);return this.add(c,n)},i.staggerFrom=function(t,e,i,r,n,a,o,s){return i.immediateRender=0!=i.immediateRender,i.runBackwards=!0,this.staggerTo(t,e,i,r,n,a,o,s)},i.staggerFromTo=function(t,e,i,r,n,a,o,s,h){return r.startAt=i,r.immediateRender=0!=r.immediateRender&&0!=i.immediateRender,this.staggerTo(t,e,r,n,a,o,s,h)},i.call=function(t,e,i,r){return this.add(d.delayedCall(0,t,e,i),r)},i.set=function(t,e,i){return i=this._parseTimeOrLabel(i,0,!0),null==e.immediateRender&&(e.immediateRender=i===this._time&&!this._paused),this.add(new d(t,0,e),i)},p.exportRoot=function(t,e){null==(t=t||{}).smoothChildTiming&&(t.smoothChildTiming=!0);var i,r,n=new p(t),a=n._timeline;for(null==e&&(e=!0),a._remove(n,!0),n._startTime=0,n._rawPrevTime=n._time=n._totalTime=a._time,i=a._first;i;)r=i._next,e&&i instanceof d&&i.target===i.vars.onComplete||n.add(i,i._startTime-i._delay),i=r;return a.add(n,0),n},i.add=function(t,e,i,r){var n,a,o,s,h,l;if("number"!=typeof e&&(e=this._parseTimeOrLabel(e,0,!0,t)),!(t instanceof c)){if(t instanceof Array||t&&t.push&&m(t)){for(i=i||"normal",r=r||0,n=e,a=t.length,o=0;o<a;o++)m(s=t[o])&&(s=new p({tweens:s})),this.add(s,n),"string"!=typeof s&&"function"!=typeof s&&("sequence"===i?n=s._startTime+s.totalDuration()/s._timeScale:"start"===i&&(s._startTime-=s.delay())),n+=r;return this._uncache(!0)}if("string"==typeof t)return this.addLabel(t,e);if("function"!=typeof t)throw"Cannot add "+t+" into the timeline; it is not a tween, timeline, function, or string.";t=d.delayedCall(0,t)}if(u.prototype.add.call(this,t,e),(this._gc||this._time===this._duration)&&!this._paused&&this._duration<this.duration())for(l=(h=this).rawTime()>t._startTime;h._timeline;)l&&h._timeline.smoothChildTiming?h.totalTime(h._totalTime,!0):h._gc&&h._enabled(!0,!1),h=h._timeline;return this},i.remove=function(t){if(t instanceof c){this._remove(t,!1);var e=t._timeline=t.vars.useFrames?c._rootFramesTimeline:c._rootTimeline;return t._startTime=(t._paused?t._pauseTime:e._time)-(t._reversed?t.totalDuration()-t._totalTime:t._totalTime)/t._timeScale,this}if(t instanceof Array||t&&t.push&&m(t)){for(var i=t.length;-1<--i;)this.remove(t[i]);return this}return"string"==typeof t?this.removeLabel(t):this.kill(null,t)},i._remove=function(t,e){u.prototype._remove.call(this,t,e);var i=this._last;return i?this._time>i._startTime+i._totalDuration/i._timeScale&&(this._time=this.duration(),this._totalTime=this._totalDuration):this._time=this._totalTime=this._duration=this._totalDuration=0,this},i.append=function(t,e){return this.add(t,this._parseTimeOrLabel(null,e,!0,t))},i.insert=i.insertMultiple=function(t,e,i,r){return this.add(t,e||0,i,r)},i.appendMultiple=function(t,e,i,r){return this.add(t,this._parseTimeOrLabel(null,e,!0,t),i,r)},i.addLabel=function(t,e){return this._labels[t]=this._parseTimeOrLabel(e),this},i.addPause=function(t,e,i,r){var n=d.delayedCall(0,a,i,r||this);return n.vars.onComplete=n.vars.onReverseComplete=e,n.data="isPause",this._hasPause=!0,this.add(n,t)},i.removeLabel=function(t){return delete this._labels[t],this},i.getLabelTime=function(t){return null!=this._labels[t]?this._labels[t]:-1},i._parseTimeOrLabel=function(t,e,i,r){var n;if(r instanceof c&&r.timeline===this)this.remove(r);else if(r&&(r instanceof Array||r.push&&m(r)))for(n=r.length;-1<--n;)r[n]instanceof c&&r[n].timeline===this&&this.remove(r[n]);if("string"==typeof e)return this._parseTimeOrLabel(e,i&&"number"==typeof t&&null==this._labels[e]?t-this.duration():0,i);if(e=e||0,"string"!=typeof t||!isNaN(t)&&null==this._labels[t])null==t&&(t=this.duration());else{if(-1===(n=t.indexOf("=")))return null==this._labels[t]?i?this._labels[t]=this.duration()+e:e:this._labels[t]+e;e=parseInt(t.charAt(n-1)+"1",10)*Number(t.substr(n+1)),t=1<n?this._parseTimeOrLabel(t.substr(0,n-1),0,i):this.duration()}return Number(t)+e},i.seek=function(t,e){return this.totalTime("number"==typeof t?t:this._parseTimeOrLabel(t),!1!==e)},i.stop=function(){return this.paused(!0)},i.gotoAndPlay=function(t,e){return this.play(t,e)},i.gotoAndStop=function(t,e){return this.pause(t,e)},i.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var r,n,a,o,s,h,l=this._dirty?this.totalDuration():this._totalDuration,c=this._time,u=this._startTime,d=this._timeScale,p=this._paused;if(l<=t)this._totalTime=this._time=l,this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",s=!!this._timeline.autoRemoveChildren,0===this._duration&&(0===t||this._rawPrevTime<0||1e-10===this._rawPrevTime)&&this._rawPrevTime!==t&&this._first&&(s=!0,1e-10<this._rawPrevTime&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:1e-10,t=l+1e-4;else if(t<1e-7)if(this._totalTime=this._time=0,(0!==c||0===this._duration&&1e-10!==this._rawPrevTime&&(0<this._rawPrevTime||t<0&&0<=this._rawPrevTime))&&(o="onReverseComplete",n=this._reversed),t<0)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(s=n=!0,o="onReverseComplete"):0<=this._rawPrevTime&&this._first&&(s=!0),this._rawPrevTime=t;else{if(this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:1e-10,0===t&&n)for(r=this._first;r&&0===r._startTime;)r._duration||(n=!1),r=r._next;t=0,this._initted||(s=!0)}else{if(this._hasPause&&!this._forcingPlayhead&&!e){if(c<=t)for(r=this._first;r&&r._startTime<=t&&!h;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===this._rawPrevTime||(h=r),r=r._next;else for(r=this._last;r&&r._startTime>=t&&!h;)r._duration||"isPause"===r.data&&0<r._rawPrevTime&&(h=r),r=r._prev;h&&(this._time=t=h._startTime,this._totalTime=t+this._cycle*(this._totalDuration+this._repeatDelay))}this._totalTime=this._time=this._rawPrevTime=t}if(this._time!==c&&this._first||i||s||h){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._time!==c&&0<t&&(this._active=!0),0===c&&this.vars.onStart&&0!==this._time&&(e||this._callback("onStart")),this._time>=c)for(r=this._first;r&&(a=r._next,!this._paused||p);)(r._active||r._startTime<=this._time&&!r._paused&&!r._gc)&&(h===r&&this.pause(),r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=a;else for(r=this._last;r&&(a=r._prev,!this._paused||p);){if(r._active||r._startTime<=c&&!r._paused&&!r._gc){if(h===r){for(h=r._prev;h&&h.endTime()>this._time;)h.render(h._reversed?h.totalDuration()-(t-h._startTime)*h._timeScale:(t-h._startTime)*h._timeScale,e,i),h=h._prev;h=null,this.pause()}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=a}this._onUpdate&&(e||(E.length&&g(),this._callback("onUpdate"))),o&&(this._gc||u!==this._startTime&&d===this._timeScale||(0===this._time||l>=this.totalDuration())&&(n&&(E.length&&g(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this._callback(o)))}},i._hasPausedChild=function(){for(var t=this._first;t;){if(t._paused||t instanceof p&&t._hasPausedChild())return!0;t=t._next}return!1},i.getChildren=function(t,e,i,r){r=r||-9999999999;for(var n=[],a=this._first,o=0;a;)a._startTime<r||(a instanceof d?!1!==e&&(n[o++]=a):(!1!==i&&(n[o++]=a),!1!==t&&(o=(n=n.concat(a.getChildren(!0,e,i))).length))),a=a._next;return n},i.getTweensOf=function(t,e){var i,r,n=this._gc,a=[],o=0;for(n&&this._enabled(!0,!0),r=(i=d.getTweensOf(t)).length;-1<--r;)(i[r].timeline===this||e&&this._contains(i[r]))&&(a[o++]=i[r]);return n&&this._enabled(!1,!0),a},i.recent=function(){return this._recent},i._contains=function(t){for(var e=t.timeline;e;){if(e===this)return!0;e=e.timeline}return!1},i.shiftChildren=function(t,e,i){i=i||0;for(var r,n=this._first,a=this._labels;n;)n._startTime>=i&&(n._startTime+=t),n=n._next;if(e)for(r in a)a[r]>=i&&(a[r]+=t);return this._uncache(!0)},i._kill=function(t,e){if(!t&&!e)return this._enabled(!1,!1);for(var i=e?this.getTweensOf(e):this.getChildren(!0,!0,!1),r=i.length,n=!1;-1<--r;)i[r]._kill(t,e)&&(n=!0);return n},i.clear=function(t){var e=this.getChildren(!1,!0,!0),i=e.length;for(this._time=this._totalTime=0;-1<--i;)e[i]._enabled(!1,!1);return!1!==t&&(this._labels={}),this._uncache(!0)},i.invalidate=function(){for(var t=this._first;t;)t.invalidate(),t=t._next;return c.prototype.invalidate.call(this)},i._enabled=function(t,e){if(t===this._gc)for(var i=this._first;i;)i._enabled(t,!0),i=i._next;return u.prototype._enabled.call(this,t,e)},i.totalTime=function(t,e,i){this._forcingPlayhead=!0;var r=c.prototype.totalTime.apply(this,arguments);return this._forcingPlayhead=!1,r},i.duration=function(t){return arguments.length?(0!==this.duration()&&0!==t&&this.timeScale(this._duration/t),this):(this._dirty&&this.totalDuration(),this._duration)},i.totalDuration=function(t){if(!arguments.length){if(this._dirty){for(var e,i,r=0,n=this._last,a=999999999999;n;)e=n._prev,n._dirty&&n.totalDuration(),n._startTime>a&&this._sortChildren&&!n._paused?this.add(n,n._startTime-n._delay):a=n._startTime,n._startTime<0&&!n._paused&&(r-=n._startTime,this._timeline.smoothChildTiming&&(this._startTime+=n._startTime/this._timeScale),this.shiftChildren(-n._startTime,!1,-9999999999),a=0),r<(i=n._startTime+n._totalDuration/n._timeScale)&&(r=i),n=e;this._duration=this._totalDuration=r,this._dirty=!1}return this._totalDuration}return 0!==this.totalDuration()&&0!==t&&this.timeScale(this._totalDuration/t),this},i.paused=function(t){if(!t)for(var e=this._first,i=this._time;e;)e._startTime===i&&"isPause"===e.data&&(e._rawPrevTime=0),e=e._next;return c.prototype.paused.apply(this,arguments)},i.usesFrames=function(){for(var t=this._timeline;t._timeline;)t=t._timeline;return t===c._rootFramesTimeline},i.rawTime=function(){return this._paused?this._totalTime:(this._timeline.rawTime()-this._startTime)*this._timeScale},p},!0),_gsScope._gsDefine("TimelineMax",["TimelineLite","TweenLite","easing.Ease"],function(e,o,t){var i=function(t){e.call(this,t),this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._cycle=0,this._yoyo=!0===this.vars.yoyo,this._dirty=!0},r=o._internals,w=r.lazyTweens,H=r.lazyRender,s=new t(null,null,1,0),n=i.prototype=new e;return n.constructor=i,n.kill()._gc=!1,i.version="1.18.0",n.invalidate=function(){return this._yoyo=!0===this.vars.yoyo,this._repeat=this.vars.repeat||0,this._repeatDelay=this.vars.repeatDelay||0,this._uncache(!0),e.prototype.invalidate.call(this)},n.addCallback=function(t,e,i,r){return this.add(o.delayedCall(0,t,i,r),e)},n.removeCallback=function(t,e){if(t)if(null==e)this._kill(null,t);else for(var i=this.getTweensOf(t,!1),r=i.length,n=this._parseTimeOrLabel(e);-1<--r;)i[r]._startTime===n&&i[r]._enabled(!1,!1);return this},n.removePause=function(t){return this.removeCallback(e._internals.pauseCallback,t)},n.tweenTo=function(t,e){e=e||{};var i,r,n,a={ease:s,useFrames:this.usesFrames(),immediateRender:!1};for(r in e)a[r]=e[r];return a.time=this._parseTimeOrLabel(t),i=Math.abs(Number(a.time)-this._time)/this._timeScale||.001,n=new o(this,i,a),a.onStart=function(){n.target.paused(!0),n.vars.time!==n.target.time()&&i===n.duration()&&n.duration(Math.abs(n.vars.time-n.target.time())/n.target._timeScale),e.onStart&&n._callback("onStart")},n},n.tweenFromTo=function(t,e,i){i=i||{},t=this._parseTimeOrLabel(t),i.startAt={onComplete:this.seek,onCompleteParams:[t],callbackScope:this},i.immediateRender=!1!==i.immediateRender;var r=this.tweenTo(e,i);return r.duration(Math.abs(r.vars.time-t)/this._timeScale||.001)},n.render=function(t,e,i){this._gc&&this._enabled(!0,!1);var r,n,a,o,s,h,l,c=this._dirty?this.totalDuration():this._totalDuration,u=this._duration,d=this._time,p=this._totalTime,f=this._startTime,m=this._timeScale,E=this._rawPrevTime,g=this._paused,v=this._cycle;if(c<=t)this._locked||(this._totalTime=c,this._cycle=this._repeat),this._reversed||this._hasPausedChild()||(n=!0,o="onComplete",s=!!this._timeline.autoRemoveChildren,0===this._duration&&(0===t||E<0||1e-10===E)&&E!==t&&this._first&&(s=!0,1e-10<E&&(o="onReverseComplete"))),this._rawPrevTime=this._duration||!e||t||this._rawPrevTime===t?t:1e-10,this._yoyo&&0!=(1&this._cycle)?this._time=t=0:t=(this._time=u)+1e-4;else if(t<1e-7)if(this._locked||(this._totalTime=this._cycle=0),((this._time=0)!==d||0===u&&1e-10!==E&&(0<E||t<0&&0<=E)&&!this._locked)&&(o="onReverseComplete",n=this._reversed),t<0)this._active=!1,this._timeline.autoRemoveChildren&&this._reversed?(s=n=!0,o="onReverseComplete"):0<=E&&this._first&&(s=!0),this._rawPrevTime=t;else{if(this._rawPrevTime=u||!e||t||this._rawPrevTime===t?t:1e-10,0===t&&n)for(r=this._first;r&&0===r._startTime;)r._duration||(n=!1),r=r._next;t=0,this._initted||(s=!0)}else if(0===u&&E<0&&(s=!0),this._time=this._rawPrevTime=t,this._locked||(this._totalTime=t,0!==this._repeat&&(h=u+this._repeatDelay,this._cycle=this._totalTime/h>>0,0!==this._cycle&&this._cycle===this._totalTime/h&&this._cycle--,this._time=this._totalTime-this._cycle*h,this._yoyo&&0!=(1&this._cycle)&&(this._time=u-this._time),this._time>u?t=(this._time=u)+1e-4:this._time<0?this._time=t=0:t=this._time)),this._hasPause&&!this._forcingPlayhead&&!e){if((t=this._time)>=d)for(r=this._first;r&&r._startTime<=t&&!l;)r._duration||"isPause"!==r.data||r.ratio||0===r._startTime&&0===this._rawPrevTime||(l=r),r=r._next;else for(r=this._last;r&&r._startTime>=t&&!l;)r._duration||"isPause"===r.data&&0<r._rawPrevTime&&(l=r),r=r._prev;l&&(this._time=t=l._startTime,this._totalTime=t+this._cycle*(this._totalDuration+this._repeatDelay))}if(this._cycle!==v&&!this._locked){var y=this._yoyo&&0!=(1&v),T=y===(this._yoyo&&0!=(1&this._cycle)),R=this._totalTime,_=this._cycle,x=this._rawPrevTime,b=this._time;if(this._totalTime=v*u,this._cycle<v?y=!y:this._totalTime+=u,this._time=d,this._rawPrevTime=0===u?E-1e-4:E,this._cycle=v,this._locked=!0,d=y?0:u,this.render(d,e,0===u),e||this._gc||this.vars.onRepeat&&this._callback("onRepeat"),T&&(d=y?u+1e-4:-1e-4,this.render(d,!0,!1)),this._locked=!1,this._paused&&!g)return;this._time=b,this._totalTime=R,this._cycle=_,this._rawPrevTime=x}if(this._time!==d&&this._first||i||s||l){if(this._initted||(this._initted=!0),this._active||!this._paused&&this._totalTime!==p&&0<t&&(this._active=!0),0===p&&this.vars.onStart&&0!==this._totalTime&&(e||this._callback("onStart")),this._time>=d)for(r=this._first;r&&(a=r._next,!this._paused||g);)(r._active||r._startTime<=this._time&&!r._paused&&!r._gc)&&(l===r&&this.pause(),r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)),r=a;else for(r=this._last;r&&(a=r._prev,!this._paused||g);){if(r._active||r._startTime<=d&&!r._paused&&!r._gc){if(l===r){for(l=r._prev;l&&l.endTime()>this._time;)l.render(l._reversed?l.totalDuration()-(t-l._startTime)*l._timeScale:(t-l._startTime)*l._timeScale,e,i),l=l._prev;l=null,this.pause()}r._reversed?r.render((r._dirty?r.totalDuration():r._totalDuration)-(t-r._startTime)*r._timeScale,e,i):r.render((t-r._startTime)*r._timeScale,e,i)}r=a}this._onUpdate&&(e||(w.length&&H(),this._callback("onUpdate"))),o&&(this._locked||this._gc||f!==this._startTime&&m===this._timeScale||(0===this._time||c>=this.totalDuration())&&(n&&(w.length&&H(),this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[o]&&this._callback(o)))}else p!==this._totalTime&&this._onUpdate&&(e||this._callback("onUpdate"))},n.getActive=function(t,e,i){null==t&&(t=!0),null==e&&(e=!0),null==i&&(i=!1);var r,n,a=[],o=this.getChildren(t,e,i),s=0,h=o.length;for(r=0;r<h;r++)(n=o[r]).isActive()&&(a[s++]=n);return a},n.getLabelAfter=function(t){t||0!==t&&(t=this._time);var e,i=this.getLabelsArray(),r=i.length;for(e=0;e<r;e++)if(i[e].time>t)return i[e].name;return null},n.getLabelBefore=function(t){null==t&&(t=this._time);for(var e=this.getLabelsArray(),i=e.length;-1<--i;)if(e[i].time<t)return e[i].name;return null},n.getLabelsArray=function(){var t,e=[],i=0;for(t in this._labels)e[i++]={time:this._labels[t],name:t};return e.sort(function(t,e){return t.time-e.time}),e},n.progress=function(t,e){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&0!=(1&this._cycle)?1-t:t)+this._cycle*(this._duration+this._repeatDelay),e):this._time/this.duration()},n.totalProgress=function(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this._totalTime/this.totalDuration()},n.totalDuration=function(t){return arguments.length?-1===this._repeat?this:this.duration((t-this._repeat*this._repeatDelay)/(this._repeat+1)):(this._dirty&&(e.prototype.totalDuration.call(this),this._totalDuration=-1===this._repeat?999999999999:this._duration*(this._repeat+1)+this._repeatDelay*this._repeat),this._totalDuration)},n.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),t>this._duration&&(t=this._duration),this._yoyo&&0!=(1&this._cycle)?t=this._duration-t+this._cycle*(this._duration+this._repeatDelay):0!==this._repeat&&(t+=this._cycle*(this._duration+this._repeatDelay)),this.totalTime(t,e)):this._time},n.repeat=function(t){return arguments.length?(this._repeat=t,this._uncache(!0)):this._repeat},n.repeatDelay=function(t){return arguments.length?(this._repeatDelay=t,this._uncache(!0)):this._repeatDelay},n.yoyo=function(t){return arguments.length?(this._yoyo=t,this):this._yoyo},n.currentLabel=function(t){return arguments.length?this.seek(t,!0):this.getLabelBefore(this._time+1e-8)},i},!0),x=180/Math.PI,R=[],_=[],b=[],g={},i=_gsScope._gsDefine.globals,v=function(t,e,i,r){this.a=t,this.b=e,this.c=i,this.d=r,this.da=r-t,this.ca=i-t,this.ba=e-t},w=function(t,e,i,r){var n={a:t},a={},o={},s={c:r},h=(t+e)/2,l=(e+i)/2,c=(i+r)/2,u=(h+l)/2,d=(l+c)/2,p=(d-u)/8;return n.b=h+(t-h)/4,a.b=u+p,n.c=a.a=(n.b+a.b)/2,a.c=o.a=(u+d)/2,o.b=d-p,s.b=c+(r-c)/4,o.c=s.a=(o.b+s.b)/2,[n,a,o,s]},y=function(t,e,i,r,n){var a,o,s,h,l,c,u,d,p,f,m,E,g,v=t.length-1,y=0,T=t[0].a;for(a=0;a<v;a++)o=(l=t[y]).a,s=l.d,h=t[y+1].d,n?(m=R[a],g=((E=_[a])+m)*e*.25/(r?.5:b[a]||.5),d=s-((c=s-(s-o)*(r?.5*e:0!==m?g/m:0))+(((u=s+(h-s)*(r?.5*e:0!==E?g/E:0))-c)*(3*m/(m+E)+.5)/4||0))):d=s-((c=s-(s-o)*e*.5)+(u=s+(h-s)*e*.5))/2,c+=d,u+=d,l.c=p=c,l.b=0!==a?T:T=l.a+.6*(l.c-l.a),l.da=s-o,l.ca=p-o,l.ba=T-o,i?(f=w(o,T,p,s),t.splice(y,1,f[0],f[1],f[2],f[3]),y+=4):y++,T=u;(l=t[y]).b=T,l.c=T+.4*(l.d-T),l.da=l.d-l.a,l.ca=l.c-l.a,l.ba=T-l.a,i&&(f=w(l.a,T,l.c,l.d),t.splice(y,1,f[0],f[1],f[2],f[3]))},T=function(t,e,i,r){var n,a,o,s,h,l,c=[];if(r)for(a=(t=[r].concat(t)).length;-1<--a;)"string"==typeof(l=t[a][e])&&"="===l.charAt(1)&&(t[a][e]=r[e]+Number(l.charAt(0)+l.substr(2)));if((n=t.length-2)<0)return c[0]=new v(t[0][e],0,0,t[n<-1?0:1][e]),c;for(a=0;a<n;a++)o=t[a][e],s=t[a+1][e],c[a]=new v(o,0,0,s),i&&(h=t[a+2][e],R[a]=(R[a]||0)+(s-o)*(s-o),_[a]=(_[a]||0)+(h-s)*(h-s));return c[a]=new v(t[a][e],0,0,t[a+1][e]),c},p=function(t,e,i,r,n,a){var o,s,h,l,c,u,d,p,f={},m=[],E=a||t[0];for(s in n="string"==typeof n?","+n+",":",x,y,z,left,top,right,bottom,marginTop,marginLeft,marginRight,marginBottom,paddingLeft,paddingTop,paddingRight,paddingBottom,backgroundPosition,backgroundPosition_y,",null==e&&(e=1),t[0])m.push(s);if(1<t.length){for(p=t[t.length-1],d=!0,o=m.length;-1<--o;)if(s=m[o],.05<Math.abs(E[s]-p[s])){d=!1;break}d&&(t=t.concat(),a&&t.unshift(a),t.push(t[1]),a=t[t.length-3])}for(R.length=_.length=b.length=0,o=m.length;-1<--o;)s=m[o],g[s]=-1!==n.indexOf(","+s+","),f[s]=T(t,s,g[s],a);for(o=R.length;-1<--o;)R[o]=Math.sqrt(R[o]),_[o]=Math.sqrt(_[o]);if(!r){for(o=m.length;-1<--o;)if(g[s])for(u=(h=f[m[o]]).length-1,l=0;l<u;l++)c=h[l+1].da/_[l]+h[l].da/R[l],b[l]=(b[l]||0)+c*c;for(o=b.length;-1<--o;)b[o]=Math.sqrt(b[o])}for(o=m.length,l=i?4:1;-1<--o;)h=f[s=m[o]],y(h,e,i,r,g[s]),d&&(h.splice(0,l),h.splice(h.length-l,l));return f},f=function(t,e,i){for(var r,n,a,o,s,h,l,c,u,d,p,f=1/i,m=t.length;-1<--m;)for(a=(d=t[m]).a,o=d.d-a,s=d.c-a,h=d.b-a,r=n=0,c=1;c<=i;c++)r=n-(n=((l=f*c)*l*o+3*(u=1-l)*(l*s+u*h))*l),e[p=m*i+c-1]=(e[p]||0)+r*r},E=_gsScope._gsDefine.plugin({propName:"bezier",priority:-1,version:"1.3.4",API:2,global:!0,init:function(t,e,i){this._target=t,e instanceof Array&&(e={values:e}),this._func={},this._round={},this._props=[],this._timeRes=null==e.timeResolution?6:parseInt(e.timeResolution,10);var r,n,a,o,s,h=e.values||[],l={},c=h[0],u=e.autoRotate||i.vars.orientToBezier;for(r in this._autoRotate=u?u instanceof Array?u:[["x","y","rotation",!0===u?0:Number(u)||0]]:null,c)this._props.push(r);for(a=this._props.length;-1<--a;)r=this._props[a],this._overwriteProps.push(r),n=this._func[r]="function"==typeof t[r],l[r]=n?t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)]():parseFloat(t[r]),s||l[r]!==h[0][r]&&(s=l);if(this._beziers="cubic"!==e.type&&"quadratic"!==e.type&&"soft"!==e.type?p(h,isNaN(e.curviness)?1:e.curviness,!1,"thruBasic"===e.type,e.correlate,s):function(t,e,i){var r,n,a,o,s,h,l,c,u,d,p,f={},m="cubic"===(e=e||"soft")?3:2,E="soft"===e,g=[];if(E&&i&&(t=[i].concat(t)),null==t||t.length<m+1)throw"invalid Bezier data";for(u in t[0])g.push(u);for(h=g.length;-1<--h;){for(f[u=g[h]]=s=[],d=0,c=t.length,l=0;l<c;l++)r=null==i?t[l][u]:"string"==typeof(p=t[l][u])&&"="===p.charAt(1)?i[u]+Number(p.charAt(0)+p.substr(2)):Number(p),E&&1<l&&l<c-1&&(s[d++]=(r+s[d-2])/2),s[d++]=r;for(c=d-m+1,l=d=0;l<c;l+=m)r=s[l],n=s[l+1],a=s[l+2],o=2===m?0:s[l+3],s[d++]=p=3===m?new v(r,n,a,o):new v(r,(2*n+r)/3,(2*n+a)/3,a);s.length=d}return f}(h,e.type,l),this._segCount=this._beziers[r].length,this._timeRes){var d=function(t,e){var i,r,n,a,o=[],s=[],h=0,l=0,c=(e=e>>0||6)-1,u=[],d=[];for(i in t)f(t[i],o,e);for(n=o.length,r=0;r<n;r++)h+=Math.sqrt(o[r]),d[a=r%e]=h,a===c&&(l+=h,u[a=r/e>>0]=d,s[a]=l,h=0,d=[]);return{length:l,lengths:s,segments:u}}(this._beziers,this._timeRes);this._length=d.length,this._lengths=d.lengths,this._segments=d.segments,this._l1=this._li=this._s1=this._si=0,this._l2=this._lengths[0],this._curSeg=this._segments[0],this._s2=this._curSeg[0],this._prec=1/this._curSeg.length}if(u=this._autoRotate)for(this._initialRotations=[],u[0]instanceof Array||(this._autoRotate=u=[u]),a=u.length;-1<--a;){for(o=0;o<3;o++)r=u[a][o],this._func[r]="function"==typeof t[r]&&t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)];r=u[a][2],this._initialRotations[a]=this._func[r]?this._func[r].call(this._target):this._target[r]}return this._startRatio=i.vars.runBackwards?1:0,!0},set:function(t){var e,i,r,n,a,o,s,h,l,c,u=this._segCount,d=this._func,p=this._target,f=t!==this._startRatio;if(this._timeRes){if(l=this._lengths,c=this._curSeg,t*=this._length,r=this._li,t>this._l2&&r<u-1){for(h=u-1;r<h&&(this._l2=l[++r])<=t;);this._l1=l[r-1],this._li=r,this._curSeg=c=this._segments[r],this._s2=c[this._s1=this._si=0]}else if(t<this._l1&&0<r){for(;0<r&&(this._l1=l[--r])>=t;);0===r&&t<this._l1?this._l1=0:r++,this._l2=l[r],this._li=r,this._curSeg=c=this._segments[r],this._s1=c[(this._si=c.length-1)-1]||0,this._s2=c[this._si]}if(e=r,t-=this._l1,r=this._si,t>this._s2&&r<c.length-1){for(h=c.length-1;r<h&&(this._s2=c[++r])<=t;);this._s1=c[r-1],this._si=r}else if(t<this._s1&&0<r){for(;0<r&&(this._s1=c[--r])>=t;);0===r&&t<this._s1?this._s1=0:r++,this._s2=c[r],this._si=r}o=(r+(t-this._s1)/(this._s2-this._s1))*this._prec}else o=(t-(e=t<0?0:1<=t?u-1:u*t>>0)*(1/u))*u;for(i=1-o,r=this._props.length;-1<--r;)n=this._props[r],s=(o*o*(a=this._beziers[n][e]).da+3*i*(o*a.ca+i*a.ba))*o+a.a,this._round[n]&&(s=Math.round(s)),d[n]?p[n](s):p[n]=s;if(this._autoRotate){var m,E,g,v,y,T,R,_=this._autoRotate;for(r=_.length;-1<--r;)n=_[r][2],T=_[r][3]||0,R=!0===_[r][4]?1:x,a=this._beziers[_[r][0]],m=this._beziers[_[r][1]],a&&m&&(a=a[e],m=m[e],E=a.a+(a.b-a.a)*o,E+=((v=a.b+(a.c-a.b)*o)-E)*o,v+=(a.c+(a.d-a.c)*o-v)*o,g=m.a+(m.b-m.a)*o,g+=((y=m.b+(m.c-m.b)*o)-g)*o,y+=(m.c+(m.d-m.c)*o-y)*o,s=f?Math.atan2(y-g,v-E)*R+T:this._initialRotations[r],d[n]?p[n](s):p[n]=s)}}}),r=E.prototype,E.bezierThrough=p,E.cubicToQuadratic=w,E._autoCSS=!0,E.quadraticToCubic=function(t,e,i){return new v(t,(2*e+t)/3,(2*e+i)/3,i)},E._cssRegister=function(){var t=i.CSSPlugin;if(t){var e=t._internals,p=e._parseToProxy,f=e._setPluginRatio,m=e.CSSPropTween;e._registerComplexSpecialProp("bezier",{parser:function(t,e,i,r,n,a){e instanceof Array&&(e={values:e}),a=new E;var o,s,h,l=e.values,c=l.length-1,u=[],d={};if(c<0)return n;for(o=0;o<=c;o++)h=p(t,l[o],r,n,a,c!==o),u[o]=h.end;for(s in e)d[s]=e[s];return d.values=u,(n=new m(t,"bezier",0,0,h.pt,2)).data=h,n.plugin=a,n.setRatio=f,0===d.autoRotate&&(d.autoRotate=!0),!d.autoRotate||d.autoRotate instanceof Array||(o=!0===d.autoRotate?0:Number(d.autoRotate),d.autoRotate=null!=h.end.left?[["left","top","rotation",o,!1]]:null!=h.end.x&&[["x","y","rotation",o,!1]]),d.autoRotate&&(r._transform||r._enableTransforms(!1),h.autoRotate=r._target._gsTransform),a._onInitTween(h.proxy,d,r._tween),n}})}},r._roundProps=function(t,e){for(var i=this._overwriteProps,r=i.length;-1<--r;)(t[i[r]]||t.bezier||t.bezierThrough)&&(this._round[i[r]]=e)},r._kill=function(t){var e,i,r=this._props;for(e in this._beziers)if(e in t)for(delete this._beziers[e],delete this._func[e],i=r.length;-1<--i;)r[i]===e&&r.splice(i,1);return this._super._kill.call(this,t)},_gsScope._gsDefine("plugins.CSSPlugin",["plugins.TweenPlugin","TweenLite"],function(a,U){var f,b,V,p,I=function(){a.call(this,"css"),this._overwriteProps.length=0,this.setRatio=I.prototype.setRatio},l=_gsScope._gsDefine.globals,m={},t=I.prototype=new a("css");(t.constructor=I).version="1.18.0",I.API=2,I.defaultTransformPerspective=0,I.defaultSkewType="compensated",I.defaultSmoothOrigin=!0,t="px",I.suffixMap={top:t,right:t,bottom:t,left:t,width:t,height:t,fontSize:t,padding:t,margin:t,perspective:t,lineHeight:""};var M,E,g,O,v,w,e,i,S=/(?:\d|\-\d|\.\d|\-\.\d)+/g,C=/(?:\d|\-\d|\.\d|\-\.\d|\+=\d|\-=\d|\+=.\d|\-=\.\d)+/g,y=/(?:\+=|\-=|\-|\b)[\d\-\.]+[a-zA-Z0-9]*(?:%|\b)/gi,c=/(?![+-]?\d*\.?\d+|[+-]|e[+-]\d+)[^0-9]/g,H=/(?:\d|\-|\+|=|#|\.)*/g,A=/opacity *= *([^)]*)/i,T=/opacity:([^;]*)/i,o=/alpha\(opacity *=.+?\)/i,R=/^(rgb|hsl)/,s=/([A-Z])/g,h=/-([a-z])/gi,_=/(^(?:url\(\"|url\())|(?:(\"\))$|\)$)/gi,u=function(t,e){return e.toUpperCase()},d=/(?:Left|Right|Width)/i,x=/(M11|M12|M21|M22)=[\d\-\.e]+/gi,P=/progid\:DXImageTransform\.Microsoft\.Matrix\(.+?\)/i,L=/,(?=[^\)]*(?:\(|$))/gi,N=Math.PI/180,G=180/Math.PI,k={},D=document,r=function(t){return D.createElementNS?D.createElementNS("http://www.w3.org/1999/xhtml",t):D.createElement(t)},F=r("div"),z=r("img"),n=I._internals={_specialProps:m},B=navigator.userAgent,W=(e=B.indexOf("Android"),i=r("a"),g=-1!==B.indexOf("Safari")&&-1===B.indexOf("Chrome")&&(-1===e||3<Number(B.substr(e+8,1))),v=g&&Number(B.substr(B.indexOf("Version/")+8,1))<6,O=-1!==B.indexOf("Firefox"),(/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(B)||/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(B))&&(w=parseFloat(RegExp.$1)),!!i&&(i.style.cssText="top:1px;opacity:.55;",/^0.55/.test(i.style.opacity))),j=function(t){return A.test("string"==typeof t?t:(t.currentStyle?t.currentStyle.filter:t.style.filter)||"")?parseFloat(RegExp.$1)/100:1},q=function(t){window.console&&console.log(t)},X="",Y="",K=function(t,e){var i,r,n=(e=e||F).style;if(void 0!==n[t])return t;for(t=t.charAt(0).toUpperCase()+t.substr(1),i=["O","Moz","ms","Ms","Webkit"],r=5;-1<--r&&void 0===n[i[r]+t];);return 0<=r?(X="-"+(Y=3===r?"ms":i[r]).toLowerCase()+"-",Y+t):null},Q=D.defaultView?D.defaultView.getComputedStyle:function(){},Z=I.getStyle=function(t,e,i,r,n){var a;return W||"opacity"!==e?(!r&&t.style[e]?a=t.style[e]:(i=i||Q(t))?a=i[e]||i.getPropertyValue(e)||i.getPropertyValue(e.replace(s,"-$1").toLowerCase()):t.currentStyle&&(a=t.currentStyle[e]),null==n||a&&"none"!==a&&"auto"!==a&&"auto auto"!==a?a:n):j(t)},J=n.convertToPixels=function(t,e,i,r,n){if("px"===r||!r)return i;if("auto"===r||!i)return 0;var a,o,s,h=d.test(e),l=t,c=F.style,u=i<0;if(u&&(i=-i),"%"===r&&-1!==e.indexOf("border"))a=i/100*(h?t.clientWidth:t.clientHeight);else{if(c.cssText="border:0 solid red;position:"+Z(t,"position")+";line-height:0;","%"!==r&&l.appendChild&&"v"!==r.charAt(0)&&"rem"!==r)c[h?"borderLeftWidth":"borderTopWidth"]=i+r;else{if(o=(l=t.parentNode||D.body)._gsCache,s=U.ticker.frame,o&&h&&o.time===s)return o.width*i/100;c[h?"width":"height"]=i+r}l.appendChild(F),a=parseFloat(F[h?"offsetWidth":"offsetHeight"]),l.removeChild(F),h&&"%"===r&&!1!==I.cacheWidths&&((o=l._gsCache=l._gsCache||{}).time=s,o.width=a/i*100),0!==a||n||(a=J(t,e,i,r,!0))}return u?-a:a},$=n.calculateOffset=function(t,e,i){if("absolute"!==Z(t,"position",i))return 0;var r="left"===e?"Left":"Top",n=Z(t,"margin"+r,i);return t["offset"+r]-(J(t,e,parseFloat(n),n.replace(H,""))||0)},tt=function(t,e){var i,r,n,a={};if(e=e||Q(t,null))if(i=e.length)for(;-1<--i;)-1!==(n=e[i]).indexOf("-transform")&&At!==n||(a[n.replace(h,u)]=e.getPropertyValue(n));else for(i in e)-1!==i.indexOf("Transform")&&Ct!==i||(a[i]=e[i]);else if(e=t.currentStyle||t.style)for(i in e)"string"==typeof i&&void 0===a[i]&&(a[i.replace(h,u)]=e[i]);return W||(a.opacity=j(t)),r=It(t,e,!1),a.rotation=r.rotation,a.skewX=r.skewX,a.scaleX=r.scaleX,a.scaleY=r.scaleY,a.x=r.x,a.y=r.y,Lt&&(a.z=r.z,a.rotationX=r.rotationX,a.rotationY=r.rotationY,a.scaleZ=r.scaleZ),a.filters&&delete a.filters,a},et=function(t,e,i,r,n){var a,o,s,h={},l=t.style;for(o in i)"cssText"!==o&&"length"!==o&&isNaN(o)&&(e[o]!==(a=i[o])||n&&n[o])&&-1===o.indexOf("Origin")&&("number"!=typeof a&&"string"!=typeof a||(h[o]="auto"!==a||"left"!==o&&"top"!==o?""!==a&&"auto"!==a&&"none"!==a||"string"!=typeof e[o]||""===e[o].replace(c,"")?a:0:$(t,o),void 0!==l[o]&&(s=new Et(l,o,l[o],s))));if(r)for(o in r)"className"!==o&&(h[o]=r[o]);return{difs:h,firstMPT:s}},it={width:["Left","Right"],height:["Top","Bottom"]},rt=["marginLeft","marginRight","marginTop","marginBottom"],nt=function(t,e,i){var r=parseFloat("width"===e?t.offsetWidth:t.offsetHeight),n=it[e],a=n.length;for(i=i||Q(t,null);-1<--a;)r-=parseFloat(Z(t,"padding"+n[a],i,!0))||0,r-=parseFloat(Z(t,"border"+n[a]+"Width",i,!0))||0;return r},at=function(t,e){if("contain"===t||"auto"===t||"auto auto"===t)return t+" ";null!=t&&""!==t||(t="0 0");var i=t.split(" "),r=-1!==t.indexOf("left")?"0%":-1!==t.indexOf("right")?"100%":i[0],n=-1!==t.indexOf("top")?"0%":-1!==t.indexOf("bottom")?"100%":i[1];return null==n?n="center"===r?"50%":"0":"center"===n&&(n="50%"),("center"===r||isNaN(parseFloat(r))&&-1===(r+"").indexOf("="))&&(r="50%"),t=r+" "+n+(2<i.length?" "+i[2]:""),e&&(e.oxp=-1!==r.indexOf("%"),e.oyp=-1!==n.indexOf("%"),e.oxr="="===r.charAt(1),e.oyr="="===n.charAt(1),e.ox=parseFloat(r.replace(c,"")),e.oy=parseFloat(n.replace(c,"")),e.v=t),e||t},ot=function(t,e){return"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2)):parseFloat(t)-parseFloat(e)},st=function(t,e){return null==t?e:"string"==typeof t&&"="===t.charAt(1)?parseInt(t.charAt(0)+"1",10)*parseFloat(t.substr(2))+e:parseFloat(t)},ht=function(t,e,i,r){var n,a,o,s,h;return null==t?s=e:"number"==typeof t?s=t:(n=360,a=t.split("_"),o=((h="="===t.charAt(1))?parseInt(t.charAt(0)+"1",10)*parseFloat(a[0].substr(2)):parseFloat(a[0]))*(-1===t.indexOf("rad")?1:G)-(h?0:e),a.length&&(r&&(r[i]=e+o),-1!==t.indexOf("short")&&(o%=n)!=o%180&&(o=o<0?o+n:o-n),-1!==t.indexOf("_cw")&&o<0?o=(o+3599999999640)%n-(o/n|0)*n:-1!==t.indexOf("ccw")&&0<o&&(o=(o-3599999999640)%n-(o/n|0)*n)),s=e+o),s<1e-6&&-1e-6<s&&(s=0),s},lt={aqua:[0,255,255],lime:[0,255,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,255],navy:[0,0,128],white:[255,255,255],fuchsia:[255,0,255],olive:[128,128,0],yellow:[255,255,0],orange:[255,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[255,0,0],pink:[255,192,203],cyan:[0,255,255],transparent:[255,255,255,0]},ct=function(t,e,i){return 255*(6*(t=t<0?t+1:1<t?t-1:t)<1?e+(i-e)*t*6:t<.5?i:3*t<2?e+(i-e)*(2/3-t)*6:e)+.5|0},ut=I.parseColor=function(t,e){var i,r,n,a,o,s,h,l,c,u,d;if(t)if("number"==typeof t)i=[t>>16,t>>8&255,255&t];else{if(","===t.charAt(t.length-1)&&(t=t.substr(0,t.length-1)),lt[t])i=lt[t];else if("#"===t.charAt(0))4===t.length&&(t="#"+(r=t.charAt(1))+r+(n=t.charAt(2))+n+(a=t.charAt(3))+a),i=[(t=parseInt(t.substr(1),16))>>16,t>>8&255,255&t];else if("hsl"===t.substr(0,3))if(i=d=t.match(S),e){if(-1!==t.indexOf("="))return t.match(C)}else o=Number(i[0])%360/360,s=Number(i[1])/100,r=2*(h=Number(i[2])/100)-(n=h<=.5?h*(s+1):h+s-h*s),3<i.length&&(i[3]=Number(t[3])),i[0]=ct(o+1/3,r,n),i[1]=ct(o,r,n),i[2]=ct(o-1/3,r,n);else i=t.match(S)||lt.transparent;i[0]=Number(i[0]),i[1]=Number(i[1]),i[2]=Number(i[2]),3<i.length&&(i[3]=Number(i[3]))}else i=lt.black;return e&&!d&&(r=i[0]/255,n=i[1]/255,a=i[2]/255,h=((l=Math.max(r,n,a))+(c=Math.min(r,n,a)))/2,l===c?o=s=0:(u=l-c,s=.5<h?u/(2-l-c):u/(l+c),o=l===r?(n-a)/u+(n<a?6:0):l===n?(a-r)/u+2:(r-n)/u+4,o*=60),i[0]=o+.5|0,i[1]=100*s+.5|0,i[2]=100*h+.5|0),i},dt=function(t,e){var i,r,n,a=t.match(pt)||[],o=0,s=a.length?"":t;for(i=0;i<a.length;i++)r=a[i],o+=(n=t.substr(o,t.indexOf(r,o)-o)).length+r.length,3===(r=ut(r,e)).length&&r.push(1),s+=n+(e?"hsla("+r[0]+","+r[1]+"%,"+r[2]+"%,"+r[3]:"rgba("+r.join(","))+")";return s},pt="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#.+?\\b";for(t in lt)pt+="|"+t+"\\b";pt=new RegExp(pt+")","gi"),I.colorStringFilter=function(t){var e,i=t[0]+t[1];pt.lastIndex=0,pt.test(i)&&(e=-1!==i.indexOf("hsl(")||-1!==i.indexOf("hsla("),t[0]=dt(t[0],e),t[1]=dt(t[1],e))},U.defaultStringFilter||(U.defaultStringFilter=I.colorStringFilter);var ft=function(t,e,a,o){if(null==t)return function(t){return t};var s,h=e?(t.match(pt)||[""])[0]:"",l=t.split(h).join("").match(y)||[],c=t.substr(0,t.indexOf(l[0])),u=")"===t.charAt(t.length-1)?")":"",d=-1!==t.indexOf(" ")?" ":",",p=l.length,f=0<p?l[0].replace(S,""):"";return p?s=e?function(t){var e,i,r,n;if("number"==typeof t)t+=f;else if(o&&L.test(t)){for(n=t.replace(L,"|").split("|"),r=0;r<n.length;r++)n[r]=s(n[r]);return n.join(",")}if(e=(t.match(pt)||[h])[0],r=(i=t.split(e).join("").match(y)||[]).length,p>r--)for(;++r<p;)i[r]=a?i[(r-1)/2|0]:l[r];return c+i.join(d)+d+e+u+(-1!==t.indexOf("inset")?" inset":"")}:function(t){var e,i,r;if("number"==typeof t)t+=f;else if(o&&L.test(t)){for(i=t.replace(L,"|").split("|"),r=0;r<i.length;r++)i[r]=s(i[r]);return i.join(",")}if(r=(e=t.match(y)||[]).length,p>r--)for(;++r<p;)e[r]=a?e[(r-1)/2|0]:l[r];return c+e.join(d)+u}:function(t){return t}},mt=function(l){return l=l.split(","),function(t,e,i,r,n,a,o){var s,h=(e+"").split(" ");for(o={},s=0;s<4;s++)o[l[s]]=h[s]=h[s]||h[(s-1)/2>>0];return r.parse(t,o,n,a)}},Et=(n._setPluginRatio=function(t){this.plugin.setRatio(t);for(var e,i,r,n,a=this.data,o=a.proxy,s=a.firstMPT;s;)e=o[s.v],s.r?e=Math.round(e):e<1e-6&&-1e-6<e&&(e=0),s.t[s.p]=e,s=s._next;if(a.autoRotate&&(a.autoRotate.rotation=o.rotation),1===t)for(s=a.firstMPT;s;){if((i=s.t).type){if(1===i.type){for(n=i.xs0+i.s+i.xs1,r=1;r<i.l;r++)n+=i["xn"+r]+i["xs"+(r+1)];i.e=n}}else i.e=i.s+i.xs0;s=s._next}},function(t,e,i,r,n){this.t=t,this.p=e,this.v=i,this.r=n,r&&((r._prev=this)._next=r)}),gt=(n._parseToProxy=function(t,e,i,r,n,a){var o,s,h,l,c,u=r,d={},p={},f=i._transform,m=k;for(i._transform=null,k=e,r=c=i.parse(t,e,r,n),k=m,a&&(i._transform=f,u&&(u._prev=null,u._prev&&(u._prev._next=null)));r&&r!==u;){if(r.type<=1&&(p[s=r.p]=r.s+r.c,d[s]=r.s,a||(l=new Et(r,"s",s,l,r.r),r.c=0),1===r.type))for(o=r.l;0<--o;)h="xn"+o,p[s=r.p+"_"+h]=r.data[h],d[s]=r[h],a||(l=new Et(r,h,s,l,r.rxp[h]));r=r._next}return{proxy:d,end:p,firstMPT:l,pt:c}},n.CSSPropTween=function(t,e,i,r,n,a,o,s,h,l,c){this.t=t,this.p=e,this.s=i,this.c=r,this.n=o||e,t instanceof gt||p.push(this.n),this.r=s,this.type=a||0,h&&(this.pr=h,f=!0),this.b=void 0===l?i:l,this.e=void 0===c?i+r:c,n&&((this._next=n)._prev=this)}),vt=function(t,e,i,r,n,a){var o=new gt(t,e,i,r-i,n,-1,a);return o.b=i,o.e=o.xs0=r,o},yt=I.parseComplex=function(t,e,i,r,n,a,o,s,h,l){o=new gt(t,e,0,0,o,l?2:1,null,!1,s,i=i||a||"",r),r+="";var c,u,d,p,f,m,E,g,v,y,T,R,_,x=i.split(", ").join(",").split(" "),b=r.split(", ").join(",").split(" "),w=x.length,H=!1!==M;for(-1===r.indexOf(",")&&-1===i.indexOf(",")||(x=x.join(" ").replace(L,", ").split(" "),b=b.join(" ").replace(L,", ").split(" "),w=x.length),w!==b.length&&(w=(x=(a||"").split(" ")).length),o.plugin=h,o.setRatio=l,c=pt.lastIndex=0;c<w;c++)if(p=x[c],f=b[c],(g=parseFloat(p))||0===g)o.appendXtra("",g,ot(f,g),f.replace(C,""),H&&-1!==f.indexOf("px"),!0);else if(n&&pt.test(p))R=","===f.charAt(f.length-1)?"),":")",_=-1!==f.indexOf("hsl")&&W,p=ut(p,_),f=ut(f,_),(v=6<p.length+f.length)&&!W&&0===f[3]?(o["xs"+o.l]+=o.l?" transparent":"transparent",o.e=o.e.split(b[c]).join("transparent")):(W||(v=!1),_?o.appendXtra(v?"hsla(":"hsl(",p[0],ot(f[0],p[0]),",",!1,!0).appendXtra("",p[1],ot(f[1],p[1]),"%,",!1).appendXtra("",p[2],ot(f[2],p[2]),v?"%,":"%"+R,!1):o.appendXtra(v?"rgba(":"rgb(",p[0],f[0]-p[0],",",!0,!0).appendXtra("",p[1],f[1]-p[1],",",!0).appendXtra("",p[2],f[2]-p[2],v?",":R,!0),v&&(p=p.length<4?1:p[3],o.appendXtra("",p,(f.length<4?1:f[3])-p,R,!1))),pt.lastIndex=0;else if(m=p.match(S)){if(!(E=f.match(C))||E.length!==m.length)return o;for(u=d=0;u<m.length;u++)T=m[u],y=p.indexOf(T,d),o.appendXtra(p.substr(d,y-d),Number(T),ot(E[u],T),"",H&&"px"===p.substr(y+T.length,2),0===u),d=y+T.length;o["xs"+o.l]+=p.substr(d)}else o["xs"+o.l]+=o.l?" "+p:p;if(-1!==r.indexOf("=")&&o.data){for(R=o.xs0+o.data.s,c=1;c<o.l;c++)R+=o["xs"+c]+o.data["xn"+c];o.e=R+o["xs"+c]}return o.l||(o.type=-1,o.xs0=o.e),o.xfirst||o},Tt=9;for((t=gt.prototype).l=t.pr=0;0<--Tt;)t["xn"+Tt]=0,t["xs"+Tt]="";t.xs0="",t._next=t._prev=t.xfirst=t.data=t.plugin=t.setRatio=t.rxp=null,t.appendXtra=function(t,e,i,r,n,a){var o=this,s=o.l;return o["xs"+s]+=a&&s?" "+t:t||"",i||0===s||o.plugin?(o.l++,o.type=o.setRatio?2:1,o["xs"+o.l]=r||"",0<s?(o.data["xn"+s]=e+i,o.rxp["xn"+s]=n,o["xn"+s]=e,o.plugin||(o.xfirst=new gt(o,"xn"+s,e,i,o.xfirst||o,0,o.n,n,o.pr),o.xfirst.xs0=0)):(o.data={s:e+i},o.rxp={},o.s=e,o.c=i,o.r=n)):o["xs"+s]+=e+(r||""),o};var Rt=function(t,e){e=e||{},this.p=e.prefix&&K(t)||t,m[t]=m[this.p]=this,this.format=e.formatter||ft(e.defaultValue,e.color,e.collapsible,e.multi),e.parser&&(this.parse=e.parser),this.clrs=e.color,this.multi=e.multi,this.keyword=e.keyword,this.dflt=e.defaultValue,this.pr=e.priority||0},_t=n._registerComplexSpecialProp=function(t,e,i){"object"!=typeof e&&(e={parser:i});var r,n=t.split(","),a=e.defaultValue;for(i=i||[a],r=0;r<n.length;r++)e.prefix=0===r&&e.prefix,e.defaultValue=i[r]||a,new Rt(n[r],e)};(t=Rt.prototype).parseComplex=function(t,e,i,r,n,a){var o,s,h,l,c,u,d=this.keyword;if(this.multi&&(L.test(i)||L.test(e)?(s=e.replace(L,"|").split("|"),h=i.replace(L,"|").split("|")):d&&(s=[e],h=[i])),h){for(l=h.length>s.length?h.length:s.length,o=0;o<l;o++)e=s[o]=s[o]||this.dflt,i=h[o]=h[o]||this.dflt,d&&((c=e.indexOf(d))!==(u=i.indexOf(d))&&(-1===u?s[o]=s[o].split(d).join(""):-1===c&&(s[o]+=" "+d)));e=s.join(", "),i=h.join(", ")}return yt(t,this.p,e,i,this.clrs,this.dflt,r,this.pr,n,a)},t.parse=function(t,e,i,r,n,a,o){return this.parseComplex(t.style,this.format(Z(t,this.p,V,!1,this.dflt)),this.format(e),n,a)},I.registerSpecialProp=function(t,h,l){_t(t,{parser:function(t,e,i,r,n,a,o){var s=new gt(t,i,0,0,n,2,i,!1,l);return s.plugin=a,s.setRatio=h(t,e,r._tween,i),s},priority:l})},I.useSVGTransformAttr=g||O;var xt,bt,wt,Ht,Mt,St="scaleX,scaleY,scaleZ,x,y,z,skewX,skewY,rotation,rotationX,rotationY,perspective,xPercent,yPercent".split(","),Ct=K("transform"),At=X+"transform",Pt=K("transformOrigin"),Lt=null!==K("perspective"),kt=n.Transform=function(){this.perspective=parseFloat(I.defaultTransformPerspective)||0,this.force3D=!(!1===I.defaultForce3D||!Lt)&&(I.defaultForce3D||"auto")},Dt=window.SVGElement,Ft=function(t,e,i){var r,n=D.createElementNS("http://www.w3.org/2000/svg",t),a=/([a-z])([A-Z])/g;for(r in i)n.setAttributeNS(null,r.replace(a,"$1-$2").toLowerCase(),i[r]);return e.appendChild(n),n},zt=D.documentElement,Bt=(Mt=w||/Android/i.test(B)&&!window.chrome,D.createElementNS&&!Mt&&(bt=Ft("svg",zt),Ht=(wt=Ft("rect",bt,{width:100,height:50,x:100})).getBoundingClientRect().width,wt.style[Pt]="50% 50%",wt.style[Ct]="scaleX(0.5)",Mt=Ht===wt.getBoundingClientRect().width&&!(O&&Lt),zt.removeChild(bt)),Mt),Ot=function(t,e,i,r,n){var a,o,s,h,l,c,u,d,p,f,m,E,g,v,y=t._gsTransform,T=Vt(t,!0);y&&(g=y.xOrigin,v=y.yOrigin),(!r||(a=r.split(" ")).length<2)&&(u=t.getBBox(),a=[(-1!==(e=at(e).split(" "))[0].indexOf("%")?parseFloat(e[0])/100*u.width:parseFloat(e[0]))+u.x,(-1!==e[1].indexOf("%")?parseFloat(e[1])/100*u.height:parseFloat(e[1]))+u.y]),i.xOrigin=h=parseFloat(a[0]),i.yOrigin=l=parseFloat(a[1]),r&&T!==Ut&&(c=T[0],u=T[1],d=T[2],p=T[3],f=T[4],o=h*(p/(E=c*p-u*d))+l*(-d/E)+(d*(m=T[5])-p*f)/E,s=h*(-u/E)+l*(c/E)-(c*m-u*f)/E,h=i.xOrigin=a[0]=o,l=i.yOrigin=a[1]=s),y&&(n||!1!==n&&!1!==I.defaultSmoothOrigin?(o=h-g,s=l-v,y.xOffset+=o*T[0]+s*T[2]-o,y.yOffset+=o*T[1]+s*T[3]-s):y.xOffset=y.yOffset=0),t.setAttribute("data-svg-origin",a.join(" "))},Nt=function(t){return!!(Dt&&"function"==typeof t.getBBox&&t.getCTM&&(!t.parentNode||t.parentNode.getBBox&&t.parentNode.getCTM))},Ut=[1,0,0,1,0,0],Vt=function(t,e){var i,r,n,a,o,s=t._gsTransform||new kt;if(Ct?r=Z(t,At,null,!0):t.currentStyle&&(r=(r=t.currentStyle.filter.match(x))&&4===r.length?[r[0].substr(4),Number(r[2].substr(4)),Number(r[1].substr(4)),r[3].substr(4),s.x||0,s.y||0].join(","):""),i=!r||"none"===r||"matrix(1, 0, 0, 1, 0, 0)"===r,(s.svg||t.getBBox&&Nt(t))&&(i&&-1!==(t.style[Ct]+"").indexOf("matrix")&&(r=t.style[Ct],i=0),n=t.getAttribute("transform"),i&&n&&(-1!==n.indexOf("matrix")?(r=n,i=0):-1!==n.indexOf("translate")&&(r="matrix(1,0,0,1,"+n.match(/(?:\-|\b)[\d\-\.e]+\b/gi).join(",")+")",i=0))),i)return Ut;for(n=(r||"").match(/(?:\-|\b)[\d\-\.e]+\b/gi)||[],Tt=n.length;-1<--Tt;)a=Number(n[Tt]),n[Tt]=(o=a-(a|=0))?(1e5*o+(o<0?-.5:.5)|0)/1e5+a:a;return e&&6<n.length?[n[0],n[1],n[4],n[5],n[12],n[13]]:n},It=n.getTransform=function(t,e,i,r){if(t._gsTransform&&i&&!r)return t._gsTransform;var n,a,o,s,h,l,c=i&&t._gsTransform||new kt,u=c.scaleX<0,d=Lt&&(parseFloat(Z(t,Pt,e,!1,"0 0 0").split(" ")[2])||c.zOrigin)||0,p=parseFloat(I.defaultTransformPerspective)||0;if(c.svg=!(!t.getBBox||!Nt(t)),c.svg&&(Ot(t,Z(t,Pt,V,!1,"50% 50%")+"",c,t.getAttribute("data-svg-origin")),xt=I.useSVGTransformAttr||Bt),(n=Vt(t))!==Ut){if(16===n.length){var f,m,E,g,v,y=n[0],T=n[1],R=n[2],_=n[3],x=n[4],b=n[5],w=n[6],H=n[7],M=n[8],S=n[9],C=n[10],A=n[12],P=n[13],L=n[14],k=n[11],D=Math.atan2(w,C);c.zOrigin&&(A=M*(L=-c.zOrigin)-n[12],P=S*L-n[13],L=C*L+c.zOrigin-n[14]),c.rotationX=D*G,D&&(f=x*(g=Math.cos(-D))+M*(v=Math.sin(-D)),m=b*g+S*v,E=w*g+C*v,M=x*-v+M*g,S=b*-v+S*g,C=w*-v+C*g,k=H*-v+k*g,x=f,b=m,w=E),D=Math.atan2(M,C),c.rotationY=D*G,D&&(m=T*(g=Math.cos(-D))-S*(v=Math.sin(-D)),E=R*g-C*v,S=T*v+S*g,C=R*v+C*g,k=_*v+k*g,y=f=y*g-M*v,T=m,R=E),D=Math.atan2(T,y),c.rotation=D*G,D&&(y=y*(g=Math.cos(-D))+x*(v=Math.sin(-D)),m=T*g+b*v,b=T*-v+b*g,w=R*-v+w*g,T=m),c.rotationX&&359.9<Math.abs(c.rotationX)+Math.abs(c.rotation)&&(c.rotationX=c.rotation=0,c.rotationY+=180),c.scaleX=(1e5*Math.sqrt(y*y+T*T)+.5|0)/1e5,c.scaleY=(1e5*Math.sqrt(b*b+S*S)+.5|0)/1e5,c.scaleZ=(1e5*Math.sqrt(w*w+C*C)+.5|0)/1e5,c.skewX=0,c.perspective=k?1/(k<0?-k:k):0,c.x=A,c.y=P,c.z=L,c.svg&&(c.x-=c.xOrigin-(c.xOrigin*y-c.yOrigin*x),c.y-=c.yOrigin-(c.yOrigin*T-c.xOrigin*b))}else if((!Lt||r||!n.length||c.x!==n[4]||c.y!==n[5]||!c.rotationX&&!c.rotationY)&&(void 0===c.x||"none"!==Z(t,"display",e))){var F=6<=n.length,z=F?n[0]:1,B=n[1]||0,O=n[2]||0,N=F?n[3]:1;c.x=n[4]||0,c.y=n[5]||0,o=Math.sqrt(z*z+B*B),s=Math.sqrt(N*N+O*O),h=z||B?Math.atan2(B,z)*G:c.rotation||0,l=O||N?Math.atan2(O,N)*G+h:c.skewX||0,90<Math.abs(l)&&Math.abs(l)<270&&(u?(o*=-1,l+=h<=0?180:-180,h+=h<=0?180:-180):(s*=-1,l+=l<=0?180:-180)),c.scaleX=o,c.scaleY=s,c.rotation=h,c.skewX=l,Lt&&(c.rotationX=c.rotationY=c.z=0,c.perspective=p,c.scaleZ=1),c.svg&&(c.x-=c.xOrigin-(c.xOrigin*z+c.yOrigin*O),c.y-=c.yOrigin-(c.xOrigin*B+c.yOrigin*N))}for(a in c.zOrigin=d,c)c[a]<2e-5&&-2e-5<c[a]&&(c[a]=0)}return i&&((t._gsTransform=c).svg&&(xt&&t.style[Ct]?U.delayedCall(.001,function(){qt(t.style,Ct)}):!xt&&t.getAttribute("transform")&&U.delayedCall(.001,function(){t.removeAttribute("transform")}))),c},Gt=function(t){var e,i,r=this.data,n=-r.rotation*N,a=n+r.skewX*N,o=(Math.cos(n)*r.scaleX*1e5|0)/1e5,s=(Math.sin(n)*r.scaleX*1e5|0)/1e5,h=(Math.sin(a)*-r.scaleY*1e5|0)/1e5,l=(Math.cos(a)*r.scaleY*1e5|0)/1e5,c=this.t.style,u=this.t.currentStyle;if(u){i=s,s=-h,h=-i,e=u.filter,c.filter="";var d,p,f=this.t.offsetWidth,m=this.t.offsetHeight,E="absolute"!==u.position,g="progid:DXImageTransform.Microsoft.Matrix(M11="+o+", M12="+s+", M21="+h+", M22="+l,v=r.x+f*r.xPercent/100,y=r.y+m*r.yPercent/100;if(null!=r.ox&&(v+=(d=(r.oxp?f*r.ox*.01:r.ox)-f/2)-(d*o+(p=(r.oyp?m*r.oy*.01:r.oy)-m/2)*s),y+=p-(d*h+p*l)),E?g+=", Dx="+((d=f/2)-(d*o+(p=m/2)*s)+v)+", Dy="+(p-(d*h+p*l)+y)+")":g+=", sizingMethod='auto expand')",-1!==e.indexOf("DXImageTransform.Microsoft.Matrix(")?c.filter=e.replace(P,g):c.filter=g+" "+e,0!==t&&1!==t||1===o&&0===s&&0===h&&1===l&&(E&&-1===g.indexOf("Dx=0, Dy=0")||A.test(e)&&100!==parseFloat(RegExp.$1)||-1===e.indexOf(e.indexOf("Alpha"))&&c.removeAttribute("filter")),!E){var T,R,_,x=w<8?1:-1;for(d=r.ieOffsetX||0,p=r.ieOffsetY||0,r.ieOffsetX=Math.round((f-((o<0?-o:o)*f+(s<0?-s:s)*m))/2+v),r.ieOffsetY=Math.round((m-((l<0?-l:l)*m+(h<0?-h:h)*f))/2+y),Tt=0;Tt<4;Tt++)_=(i=-1!==(T=u[R=rt[Tt]]).indexOf("px")?parseFloat(T):J(this.t,R,parseFloat(T),T.replace(H,""))||0)!==r[R]?Tt<2?-r.ieOffsetX:-r.ieOffsetY:Tt<2?d-r.ieOffsetX:p-r.ieOffsetY,c[R]=(r[R]=Math.round(i-_*(0===Tt||2===Tt?1:x)))+"px"}}},Wt=n.set3DTransformRatio=n.setTransformRatio=function(t){var e,i,r,n,a,o,s,h,l,c,u,d,p,f,m,E,g,v,y,T,R,_,x,b=this.data,w=this.t.style,H=b.rotation,M=b.rotationX,S=b.rotationY,C=b.scaleX,A=b.scaleY,P=b.scaleZ,L=b.x,k=b.y,D=b.z,F=b.svg,z=b.perspective,B=b.force3D;if(!((1!==t&&0!==t||"auto"!==B||this.tween._totalTime!==this.tween._totalDuration&&this.tween._totalTime)&&B||D||z||S||M)||xt&&F||!Lt)H||b.skewX||F?(H*=N,_=b.skewX*N,x=1e5,e=Math.cos(H)*C,n=Math.sin(H)*C,i=Math.sin(H-_)*-A,a=Math.cos(H-_)*A,_&&"simple"===b.skewType&&(g=Math.tan(_),i*=g=Math.sqrt(1+g*g),a*=g,b.skewY&&(e*=g,n*=g)),F&&(L+=b.xOrigin-(b.xOrigin*e+b.yOrigin*i)+b.xOffset,k+=b.yOrigin-(b.xOrigin*n+b.yOrigin*a)+b.yOffset,xt&&(b.xPercent||b.yPercent)&&(f=this.t.getBBox(),L+=.01*b.xPercent*f.width,k+=.01*b.yPercent*f.height),L<(f=1e-6)&&-f<L&&(L=0),k<f&&-f<k&&(k=0)),y=(e*x|0)/x+","+(n*x|0)/x+","+(i*x|0)/x+","+(a*x|0)/x+","+L+","+k+")",F&&xt?this.t.setAttribute("transform","matrix("+y):w[Ct]=(b.xPercent||b.yPercent?"translate("+b.xPercent+"%,"+b.yPercent+"%) matrix(":"matrix(")+y):w[Ct]=(b.xPercent||b.yPercent?"translate("+b.xPercent+"%,"+b.yPercent+"%) matrix(":"matrix(")+C+",0,0,"+A+","+L+","+k+")";else{if(O&&(C<(f=1e-4)&&-f<C&&(C=P=2e-5),A<f&&-f<A&&(A=P=2e-5),!z||b.z||b.rotationX||b.rotationY||(z=0)),H||b.skewX)H*=N,m=e=Math.cos(H),E=n=Math.sin(H),b.skewX&&(H-=b.skewX*N,m=Math.cos(H),E=Math.sin(H),"simple"===b.skewType&&(g=Math.tan(b.skewX*N),m*=g=Math.sqrt(1+g*g),E*=g,b.skewY&&(e*=g,n*=g))),i=-E,a=m;else{if(!(S||M||1!==P||z||F))return void(w[Ct]=(b.xPercent||b.yPercent?"translate("+b.xPercent+"%,"+b.yPercent+"%) translate3d(":"translate3d(")+L+"px,"+k+"px,"+D+"px)"+(1!==C||1!==A?" scale("+C+","+A+")":""));e=a=1,i=n=0}l=1,r=o=s=h=c=u=0,d=z?-1/z:0,p=b.zOrigin,f=1e-6,T=",",R="0",(H=S*N)&&(m=Math.cos(H),c=d*(s=-(E=Math.sin(H))),r=e*E,o=n*E,d*=l=m,e*=m,n*=m),(H=M*N)&&(g=i*(m=Math.cos(H))+r*(E=Math.sin(H)),v=a*m+o*E,h=l*E,u=d*E,r=i*-E+r*m,o=a*-E+o*m,l*=m,d*=m,i=g,a=v),1!==P&&(r*=P,o*=P,l*=P,d*=P),1!==A&&(i*=A,a*=A,h*=A,u*=A),1!==C&&(e*=C,n*=C,s*=C,c*=C),(p||F)&&(p&&(L+=r*-p,k+=o*-p,D+=l*-p+p),F&&(L+=b.xOrigin-(b.xOrigin*e+b.yOrigin*i)+b.xOffset,k+=b.yOrigin-(b.xOrigin*n+b.yOrigin*a)+b.yOffset),L<f&&-f<L&&(L=R),k<f&&-f<k&&(k=R),D<f&&-f<D&&(D=0)),y=b.xPercent||b.yPercent?"translate("+b.xPercent+"%,"+b.yPercent+"%) matrix3d(":"matrix3d(",y+=(e<f&&-f<e?R:e)+T+(n<f&&-f<n?R:n)+T+(s<f&&-f<s?R:s),y+=T+(c<f&&-f<c?R:c)+T+(i<f&&-f<i?R:i)+T+(a<f&&-f<a?R:a),M||S?(y+=T+(h<f&&-f<h?R:h)+T+(u<f&&-f<u?R:u)+T+(r<f&&-f<r?R:r),y+=T+(o<f&&-f<o?R:o)+T+(l<f&&-f<l?R:l)+T+(d<f&&-f<d?R:d)+T):y+=",0,0,0,0,1,0,",y+=L+T+k+T+D+T+(z?1+-D/z:1)+")",w[Ct]=y}};(t=kt.prototype).x=t.y=t.z=t.skewX=t.skewY=t.rotation=t.rotationX=t.rotationY=t.zOrigin=t.xPercent=t.yPercent=t.xOffset=t.yOffset=0,t.scaleX=t.scaleY=t.scaleZ=1,_t("transform,scale,scaleX,scaleY,scaleZ,x,y,z,rotation,rotationX,rotationY,rotationZ,skewX,skewY,shortRotation,shortRotationX,shortRotationY,shortRotationZ,transformOrigin,svgOrigin,transformPerspective,directionalRotation,parseTransform,force3D,skewType,xPercent,yPercent,smoothOrigin",{parser:function(t,e,i,r,n,a,o){if(r._lastParsedTransform===o)return n;r._lastParsedTransform=o;var s,h,l,c,u,d,p,f,m,E,g=t._gsTransform,v=t.style,y=St.length,T=o,R={};if(o.display?(c=Z(t,"display"),v.display="block",s=It(t,V,!0,o.parseTransform),v.display=c):s=It(t,V,!0,o.parseTransform),r._transform=s,"string"==typeof T.transform&&Ct)(c=F.style)[Ct]=T.transform,c.display="block",c.position="absolute",D.body.appendChild(F),h=It(F,null,!1),D.body.removeChild(F),h.perspective||(h.perspective=s.perspective),null!=T.xPercent&&(h.xPercent=st(T.xPercent,s.xPercent)),null!=T.yPercent&&(h.yPercent=st(T.yPercent,s.yPercent));else if("object"==typeof T){if(h={scaleX:st(null!=T.scaleX?T.scaleX:T.scale,s.scaleX),scaleY:st(null!=T.scaleY?T.scaleY:T.scale,s.scaleY),scaleZ:st(T.scaleZ,s.scaleZ),x:st(T.x,s.x),y:st(T.y,s.y),z:st(T.z,s.z),xPercent:st(T.xPercent,s.xPercent),yPercent:st(T.yPercent,s.yPercent),perspective:st(T.transformPerspective,s.perspective)},null!=(f=T.directionalRotation))if("object"==typeof f)for(c in f)T[c]=f[c];else T.rotation=f;"string"==typeof T.x&&-1!==T.x.indexOf("%")&&(h.x=0,h.xPercent=st(T.x,s.xPercent)),"string"==typeof T.y&&-1!==T.y.indexOf("%")&&(h.y=0,h.yPercent=st(T.y,s.yPercent)),h.rotation=ht("rotation"in T?T.rotation:"shortRotation"in T?T.shortRotation+"_short":"rotationZ"in T?T.rotationZ:s.rotation,s.rotation,"rotation",R),Lt&&(h.rotationX=ht("rotationX"in T?T.rotationX:"shortRotationX"in T?T.shortRotationX+"_short":s.rotationX||0,s.rotationX,"rotationX",R),h.rotationY=ht("rotationY"in T?T.rotationY:"shortRotationY"in T?T.shortRotationY+"_short":s.rotationY||0,s.rotationY,"rotationY",R)),h.skewX=null==T.skewX?s.skewX:ht(T.skewX,s.skewX),h.skewY=null==T.skewY?s.skewY:ht(T.skewY,s.skewY),(l=h.skewY-s.skewY)&&(h.skewX+=l,h.rotation+=l)}for(Lt&&null!=T.force3D&&(s.force3D=T.force3D,p=!0),s.skewType=T.skewType||s.skewType||I.defaultSkewType,(d=s.force3D||s.z||s.rotationX||s.rotationY||h.z||h.rotationX||h.rotationY||h.perspective)||null==T.scale||(h.scaleZ=1);-1<--y;)(1e-6<(u=h[i=St[y]]-s[i])||u<-1e-6||null!=T[i]||null!=k[i])&&(p=!0,n=new gt(s,i,s[i],u,n),i in R&&(n.e=R[i]),n.xs0=0,n.plugin=a,r._overwriteProps.push(n.n));return u=T.transformOrigin,s.svg&&(u||T.svgOrigin)&&(m=s.xOffset,E=s.yOffset,Ot(t,at(u),h,T.svgOrigin,T.smoothOrigin),n=vt(s,"xOrigin",(g?s:h).xOrigin,h.xOrigin,n,"transformOrigin"),n=vt(s,"yOrigin",(g?s:h).yOrigin,h.yOrigin,n,"transformOrigin"),m===s.xOffset&&E===s.yOffset||(n=vt(s,"xOffset",g?m:s.xOffset,s.xOffset,n,"transformOrigin"),n=vt(s,"yOffset",g?E:s.yOffset,s.yOffset,n,"transformOrigin")),u=xt?null:"0px 0px"),(u||Lt&&d&&s.zOrigin)&&(Ct?(p=!0,i=Pt,u=(u||Z(t,i,V,!1,"50% 50%"))+"",(n=new gt(v,i,0,0,n,-1,"transformOrigin")).b=v[i],n.plugin=a,Lt?(c=s.zOrigin,u=u.split(" "),s.zOrigin=(2<u.length&&(0===c||"0px"!==u[2])?parseFloat(u[2]):c)||0,n.xs0=n.e=u[0]+" "+(u[1]||"50%")+" 0px",(n=new gt(s,"zOrigin",0,0,n,-1,n.n)).b=c,n.xs0=n.e=s.zOrigin):n.xs0=n.e=u):at(u+"",s)),p&&(r._transformType=s.svg&&xt||!d&&3!==this._transformType?2:3),n},prefix:!0}),_t("boxShadow",{defaultValue:"0px 0px 0px 0px #999",prefix:!0,color:!0,multi:!0,keyword:"inset"}),_t("borderRadius",{defaultValue:"0px",parser:function(t,e,i,r,n,a){e=this.format(e);var o,s,h,l,c,u,d,p,f,m,E,g,v,y,T,R,_=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"],x=t.style;for(f=parseFloat(t.offsetWidth),m=parseFloat(t.offsetHeight),o=e.split(" "),s=0;s<_.length;s++)this.p.indexOf("border")&&(_[s]=K(_[s])),-1!==(c=l=Z(t,_[s],V,!1,"0px")).indexOf(" ")&&(c=(l=c.split(" "))[0],l=l[1]),u=h=o[s],d=parseFloat(c),g=c.substr((d+"").length),(v="="===u.charAt(1))?(p=parseInt(u.charAt(0)+"1",10),u=u.substr(2),p*=parseFloat(u),E=u.substr((p+"").length-(p<0?1:0))||""):(p=parseFloat(u),E=u.substr((p+"").length)),""===E&&(E=b[i]||g),E!==g&&(y=J(t,"borderLeft",d,g),T=J(t,"borderTop",d,g),"%"===E?(c=y/f*100+"%",l=T/m*100+"%"):"em"===E?(c=y/(R=J(t,"borderLeft",1,"em"))+"em",l=T/R+"em"):(c=y+"px",l=T+"px"),v&&(u=parseFloat(c)+p+E,h=parseFloat(l)+p+E)),n=yt(x,_[s],c+" "+l,u+" "+h,!1,"0px",n);return n},prefix:!0,formatter:ft("0px 0px 0px 0px",!1,!0)}),_t("backgroundPosition",{defaultValue:"0 0",parser:function(t,e,i,r,n,a){var o,s,h,l,c,u,d="background-position",p=V||Q(t,null),f=this.format((p?w?p.getPropertyValue(d+"-x")+" "+p.getPropertyValue(d+"-y"):p.getPropertyValue(d):t.currentStyle.backgroundPositionX+" "+t.currentStyle.backgroundPositionY)||"0 0"),m=this.format(e);if(-1!==f.indexOf("%")!=(-1!==m.indexOf("%"))&&(u=Z(t,"backgroundImage").replace(_,""))&&"none"!==u){for(o=f.split(" "),s=m.split(" "),z.setAttribute("src",u),h=2;-1<--h;)(l=-1!==(f=o[h]).indexOf("%"))!=(-1!==s[h].indexOf("%"))&&(c=0===h?t.offsetWidth-z.width:t.offsetHeight-z.height,o[h]=l?parseFloat(f)/100*c+"px":parseFloat(f)/c*100+"%");f=o.join(" ")}return this.parseComplex(t.style,f,m,n,a)},formatter:at}),_t("backgroundSize",{defaultValue:"0 0",formatter:at}),_t("perspective",{defaultValue:"0px",prefix:!0}),_t("perspectiveOrigin",{defaultValue:"50% 50%",prefix:!0}),_t("transformStyle",{prefix:!0}),_t("backfaceVisibility",{prefix:!0}),_t("userSelect",{prefix:!0}),_t("margin",{parser:mt("marginTop,marginRight,marginBottom,marginLeft")}),_t("padding",{parser:mt("paddingTop,paddingRight,paddingBottom,paddingLeft")}),_t("clip",{defaultValue:"rect(0px,0px,0px,0px)",parser:function(t,e,i,r,n,a){var o,s,h;return w<9?(s=t.currentStyle,h=w<8?" ":",",o="rect("+s.clipTop+h+s.clipRight+h+s.clipBottom+h+s.clipLeft+")",e=this.format(e).split(",").join(h)):(o=this.format(Z(t,this.p,V,!1,this.dflt)),e=this.format(e)),this.parseComplex(t.style,o,e,n,a)}}),_t("textShadow",{defaultValue:"0px 0px 0px #999",color:!0,multi:!0}),_t("autoRound,strictUnits",{parser:function(t,e,i,r,n){return n}}),_t("border",{defaultValue:"0px solid #000",parser:function(t,e,i,r,n,a){return this.parseComplex(t.style,this.format(Z(t,"borderTopWidth",V,!1,"0px")+" "+Z(t,"borderTopStyle",V,!1,"solid")+" "+Z(t,"borderTopColor",V,!1,"#000")),this.format(e),n,a)},color:!0,formatter:function(t){var e=t.split(" ");return e[0]+" "+(e[1]||"solid")+" "+(t.match(pt)||["#000"])[0]}}),_t("borderWidth",{parser:mt("borderTopWidth,borderRightWidth,borderBottomWidth,borderLeftWidth")}),_t("float,cssFloat,styleFloat",{parser:function(t,e,i,r,n,a){var o=t.style,s="cssFloat"in o?"cssFloat":"styleFloat";return new gt(o,s,0,0,n,-1,i,!1,0,o[s],e)}});var jt=function(t){var e,i=this.t,r=i.filter||Z(this.data,"filter")||"",n=this.s+this.c*t|0;100===n&&(-1===r.indexOf("atrix(")&&-1===r.indexOf("radient(")&&-1===r.indexOf("oader(")?(i.removeAttribute("filter"),e=!Z(this.data,"filter")):(i.filter=r.replace(o,""),e=!0)),e||(this.xn1&&(i.filter=r=r||"alpha(opacity="+n+")"),-1===r.indexOf("pacity")?0===n&&this.xn1||(i.filter=r+" alpha(opacity="+n+")"):i.filter=r.replace(A,"opacity="+n))};_t("opacity,alpha,autoAlpha",{defaultValue:"1",parser:function(t,e,i,r,n,a){var o=parseFloat(Z(t,"opacity",V,!1,"1")),s=t.style,h="autoAlpha"===i;return"string"==typeof e&&"="===e.charAt(1)&&(e=("-"===e.charAt(0)?-1:1)*parseFloat(e.substr(2))+o),h&&1===o&&"hidden"===Z(t,"visibility",V)&&0!==e&&(o=0),W?n=new gt(s,"opacity",o,e-o,n):((n=new gt(s,"opacity",100*o,100*(e-o),n)).xn1=h?1:0,s.zoom=1,n.type=2,n.b="alpha(opacity="+n.s+")",n.e="alpha(opacity="+(n.s+n.c)+")",n.data=t,n.plugin=a,n.setRatio=jt),h&&((n=new gt(s,"visibility",0,0,n,-1,null,!1,0,0!==o?"inherit":"hidden",0===e?"hidden":"inherit")).xs0="inherit",r._overwriteProps.push(n.n),r._overwriteProps.push(i)),n}});var qt=function(t,e){e&&(t.removeProperty?("ms"!==e.substr(0,2)&&"webkit"!==e.substr(0,6)||(e="-"+e),t.removeProperty(e.replace(s,"-$1").toLowerCase())):t.removeAttribute(e))},Xt=function(t){if(this.t._gsClassPT=this,1===t||0===t){this.t.setAttribute("class",0===t?this.b:this.e);for(var e=this.data,i=this.t.style;e;)e.v?i[e.p]=e.v:qt(i,e.p),e=e._next;1===t&&this.t._gsClassPT===this&&(this.t._gsClassPT=null)}else this.t.getAttribute("class")!==this.e&&this.t.setAttribute("class",this.e)};_t("className",{parser:function(t,e,i,r,n,a,o){var s,h,l,c,u,d=t.getAttribute("class")||"",p=t.style.cssText;if((n=r._classNamePT=new gt(t,i,0,0,n,2)).setRatio=Xt,n.pr=-11,f=!0,n.b=d,h=tt(t,V),l=t._gsClassPT){for(c={},u=l.data;u;)c[u.p]=1,u=u._next;l.setRatio(1)}return(t._gsClassPT=n).e="="!==e.charAt(1)?e:d.replace(new RegExp("\\s*\\b"+e.substr(2)+"\\b"),"")+("+"===e.charAt(0)?" "+e.substr(2):""),t.setAttribute("class",n.e),s=et(t,h,tt(t),o,c),t.setAttribute("class",d),n.data=s.firstMPT,t.style.cssText=p,n.xfirst=r.parse(t,s.difs,n,a)}});var Yt=function(t){if((1===t||0===t)&&this.data._totalTime===this.data._totalDuration&&"isFromStart"!==this.data.data){var e,i,r,n,a,o=this.t.style,s=m.transform.parse;if("all"===this.e)n=!(o.cssText="");else for(r=(e=this.e.split(" ").join("").split(",")).length;-1<--r;)i=e[r],m[i]&&(m[i].parse===s?n=!0:i="transformOrigin"===i?Pt:m[i].p),qt(o,i);n&&(qt(o,Ct),(a=this.t._gsTransform)&&(a.svg&&this.t.removeAttribute("data-svg-origin"),delete this.t._gsTransform))}};for(_t("clearProps",{parser:function(t,e,i,r,n){return(n=new gt(t,i,0,0,n,2)).setRatio=Yt,n.e=e,n.pr=-10,n.data=r._tween,f=!0,n}}),t="bezier,throwProps,physicsProps,physics2D".split(","),Tt=t.length;Tt--;)!function(t){if(!m[t]){var h=t.charAt(0).toUpperCase()+t.substr(1)+"Plugin";_t(t,{parser:function(t,e,i,r,n,a,o){var s=l.com.greensock.plugins[h];return s?(s._cssRegister(),m[i].parse(t,e,i,r,n,a,o)):(q("Error: "+h+" js file not loaded."),n)}})}}(t[Tt]);(t=I.prototype)._firstPT=t._lastParsedTransform=t._transform=null,t._onInitTween=function(t,e,i){if(!t.nodeType)return!1;this._target=t,this._tween=i,this._vars=e,M=e.autoRound,f=!1,b=e.suffixMap||I.suffixMap,V=Q(t,""),p=this._overwriteProps;var r,n,a,o,s,h,l,c,u,d=t.style;if(E&&""===d.zIndex&&("auto"!==(r=Z(t,"zIndex",V))&&""!==r||this._addLazySet(d,"zIndex",0)),"string"==typeof e&&(o=d.cssText,r=tt(t,V),d.cssText=o+";"+e,r=et(t,r,tt(t)).difs,!W&&T.test(e)&&(r.opacity=parseFloat(RegExp.$1)),e=r,d.cssText=o),e.className?this._firstPT=n=m.className.parse(t,e.className,"className",this,null,null,e):this._firstPT=n=this.parse(t,e,null),this._transformType){for(u=3===this._transformType,Ct?g&&(E=!0,""===d.zIndex&&("auto"!==(l=Z(t,"zIndex",V))&&""!==l||this._addLazySet(d,"zIndex",0)),v&&this._addLazySet(d,"WebkitBackfaceVisibility",this._vars.WebkitBackfaceVisibility||(u?"visible":"hidden"))):d.zoom=1,a=n;a&&a._next;)a=a._next;c=new gt(t,"transform",0,0,null,2),this._linkCSSP(c,null,a),c.setRatio=Ct?Wt:Gt,c.data=this._transform||It(t,V,!0),c.tween=i,c.pr=-1,p.pop()}if(f){for(;n;){for(h=n._next,a=o;a&&a.pr>n.pr;)a=a._next;(n._prev=a?a._prev:s)?n._prev._next=n:o=n,(n._next=a)?a._prev=n:s=n,n=h}this._firstPT=o}return!0},t.parse=function(t,e,i,r){var n,a,o,s,h,l,c,u,d,p,f=t.style;for(n in e)l=e[n],(a=m[n])?i=a.parse(t,l,n,this,i,r,e):(h=Z(t,n,V)+"",d="string"==typeof l,"color"===n||"fill"===n||"stroke"===n||-1!==n.indexOf("Color")||d&&R.test(l)?(d||(l=(3<(l=ut(l)).length?"rgba(":"rgb(")+l.join(",")+")"),i=yt(f,n,h,l,!0,"transparent",i,0,r)):!d||-1===l.indexOf(" ")&&-1===l.indexOf(",")?(c=(o=parseFloat(h))||0===o?h.substr((o+"").length):"",""!==h&&"auto"!==h||("width"===n||"height"===n?(o=nt(t,n,V),c="px"):"left"===n||"top"===n?(o=$(t,n,V),c="px"):(o="opacity"!==n?0:1,c="")),(p=d&&"="===l.charAt(1))?(s=parseInt(l.charAt(0)+"1",10),l=l.substr(2),s*=parseFloat(l),u=l.replace(H,"")):(s=parseFloat(l),u=d?l.replace(H,""):""),""===u&&(u=n in b?b[n]:c),l=s||0===s?(p?s+o:s)+u:e[n],c!==u&&""!==u&&(s||0===s)&&o&&(o=J(t,n,o,c),"%"===u?(o/=J(t,n,100,"%")/100,!0!==e.strictUnits&&(h=o+"%")):"em"===u||"rem"===u?o/=J(t,n,1,u):"px"!==u&&(s=J(t,n,s,u),u="px"),p&&(s||0===s)&&(l=s+o+u)),p&&(s+=o),!o&&0!==o||!s&&0!==s?void 0!==f[n]&&(l||l+""!="NaN"&&null!=l)?(i=new gt(f,n,s||o||0,0,i,-1,n,!1,0,h,l)).xs0="none"!==l||"display"!==n&&-1===n.indexOf("Style")?l:h:q("invalid "+n+" tween value: "+e[n]):(i=new gt(f,n,o,s-o,i,0,n,!1!==M&&("px"===u||"zIndex"===n),0,h,l)).xs0=u):i=yt(f,n,h,l,!0,null,i,0,r)),r&&i&&!i.plugin&&(i.plugin=r);return i},t.setRatio=function(t){var e,i,r,n=this._firstPT;if(1!==t||this._tween._time!==this._tween._duration&&0!==this._tween._time)if(t||this._tween._time!==this._tween._duration&&0!==this._tween._time||-1e-6===this._tween._rawPrevTime)for(;n;){if(e=n.c*t+n.s,n.r?e=Math.round(e):e<1e-6&&-1e-6<e&&(e=0),n.type)if(1===n.type)if(2===(r=n.l))n.t[n.p]=n.xs0+e+n.xs1+n.xn1+n.xs2;else if(3===r)n.t[n.p]=n.xs0+e+n.xs1+n.xn1+n.xs2+n.xn2+n.xs3;else if(4===r)n.t[n.p]=n.xs0+e+n.xs1+n.xn1+n.xs2+n.xn2+n.xs3+n.xn3+n.xs4;else if(5===r)n.t[n.p]=n.xs0+e+n.xs1+n.xn1+n.xs2+n.xn2+n.xs3+n.xn3+n.xs4+n.xn4+n.xs5;else{for(i=n.xs0+e+n.xs1,r=1;r<n.l;r++)i+=n["xn"+r]+n["xs"+(r+1)];n.t[n.p]=i}else-1===n.type?n.t[n.p]=n.xs0:n.setRatio&&n.setRatio(t);else n.t[n.p]=e+n.xs0;n=n._next}else for(;n;)2!==n.type?n.t[n.p]=n.b:n.setRatio(t),n=n._next;else for(;n;){if(2!==n.type)if(n.r&&-1!==n.type)if(e=Math.round(n.s+n.c),n.type){if(1===n.type){for(r=n.l,i=n.xs0+e+n.xs1,r=1;r<n.l;r++)i+=n["xn"+r]+n["xs"+(r+1)];n.t[n.p]=i}}else n.t[n.p]=e+n.xs0;else n.t[n.p]=n.e;else n.setRatio(t);n=n._next}},t._enableTransforms=function(t){this._transform=this._transform||It(this._target,V,!0),this._transformType=this._transform.svg&&xt||!t&&3!==this._transformType?2:3};var Kt=function(t){this.t[this.p]=this.e,this.data._linkCSSP(this,this._next,null,!0)};t._addLazySet=function(t,e,i){var r=this._firstPT=new gt(t,e,0,0,this._firstPT,2);r.e=i,r.setRatio=Kt,r.data=this},t._linkCSSP=function(t,e,i,r){return t&&(e&&(e._prev=t),t._next&&(t._next._prev=t._prev),t._prev?t._prev._next=t._next:this._firstPT===t&&(this._firstPT=t._next,r=!0),i?i._next=t:r||null!==this._firstPT||(this._firstPT=t),t._next=e,t._prev=i),t},t._kill=function(t){var e,i,r,n=t;if(t.autoAlpha||t.alpha){for(i in n={},t)n[i]=t[i];n.opacity=1,n.autoAlpha&&(n.visibility=1)}return t.className&&(e=this._classNamePT)&&((r=e.xfirst)&&r._prev?this._linkCSSP(r._prev,e._next,r._prev._prev):r===this._firstPT&&(this._firstPT=e._next),e._next&&this._linkCSSP(e._next,e._next._next,r._prev),this._classNamePT=null),a.prototype._kill.call(this,n)};var Qt=function(t,e,i){var r,n,a,o;if(t.slice)for(n=t.length;-1<--n;)Qt(t[n],e,i);else for(n=(r=t.childNodes).length;-1<--n;)o=(a=r[n]).type,a.style&&(e.push(tt(a)),i&&i.push(a)),1!==o&&9!==o&&11!==o||!a.childNodes.length||Qt(a,e,i)};return I.cascadeTo=function(t,e,i){var r,n,a,o,s=U.to(t,e,i),h=[s],l=[],c=[],u=[],d=U._internals.reservedProps;for(t=s._targets||s.target,Qt(t,l,u),s.render(e,!0,!0),Qt(t,c),s.render(0,!0,!0),s._enabled(!0),r=u.length;-1<--r;)if((n=et(u[r],l[r],c[r])).firstMPT){for(a in n=n.difs,i)d[a]&&(n[a]=i[a]);for(a in o={},n)o[a]=l[r][a];h.push(U.fromTo(u[r],e,o,n))}return h},a.activate([I]),I},!0),t=_gsScope._gsDefine.plugin({propName:"roundProps",version:"1.5",priority:-1,API:2,init:function(t,e,i){return this._tween=i,!0}}),h=function(t){for(;t;)t.f||t.blob||(t.r=1),t=t._next},(e=t.prototype)._onInitAllProps=function(){for(var t,e,i,r=this._tween,n=r.vars.roundProps.join?r.vars.roundProps:r.vars.roundProps.split(","),a=n.length,o={},s=r._propLookup.roundProps;-1<--a;)o[n[a]]=1;for(a=n.length;-1<--a;)for(t=n[a],e=r._firstPT;e;)i=e._next,e.pg?e.t._roundProps(o,!0):e.n===t&&(2===e.f&&e.t?h(e.t._firstPT):(this._add(e.t,t,e.s,e.c),i&&(i._prev=e._prev),e._prev?e._prev._next=i:r._firstPT===e&&(r._firstPT=i),e._next=e._prev=null,r._propLookup[t]=s)),e=i;return!1},e._add=function(t,e,i,r){this._addTween(t,e,i,i+r,e,!0),this._overwriteProps.push(e)},_gsScope._gsDefine.plugin({propName:"attr",API:2,version:"0.5.0",init:function(t,e,i){var r;if("function"!=typeof t.setAttribute)return!1;for(r in e)this._addTween(t,"setAttribute",t.getAttribute(r)+"",e[r]+"",r,!1,r),this._overwriteProps.push(r);return!0}}),_gsScope._gsDefine.plugin({propName:"directionalRotation",version:"0.2.1",API:2,init:function(t,e,i){"object"!=typeof e&&(e={rotation:e}),this.finals={};var r,n,a,o,s,h=!0===e.useRadians?2*Math.PI:360;for(r in e)"useRadians"!==r&&(n=(s=(e[r]+"").split("_"))[0],a=parseFloat("function"!=typeof t[r]?t[r]:t[r.indexOf("set")||"function"!=typeof t["get"+r.substr(3)]?r:"get"+r.substr(3)]()),o=(this.finals[r]="string"==typeof n&&"="===n.charAt(1)?a+parseInt(n.charAt(0)+"1",10)*Number(n.substr(2)):Number(n)||0)-a,s.length&&(-1!==(n=s.join("_")).indexOf("short")&&(o%=h)!=o%(h/2)&&(o=o<0?o+h:o-h),-1!==n.indexOf("_cw")&&o<0?o=(o+9999999999*h)%h-(o/h|0)*h:-1!==n.indexOf("ccw")&&0<o&&(o=(o-9999999999*h)%h-(o/h|0)*h)),(1e-6<o||o<-1e-6)&&(this._addTween(t,r,a,a+o,r),this._overwriteProps.push(r)));return!0},set:function(t){var e;if(1!==t)this._super.setRatio.call(this,t);else for(e=this._firstPT;e;)e.f?e.t[e.p](this.finals[e.p]):e.t[e.p]=this.finals[e.p],e=e._next}})._autoCSS=!0,_gsScope._gsDefine("easing.Back",["easing.Ease"],function(E){var e,i,t,r=_gsScope.GreenSockGlobals||_gsScope,n=r.com.greensock,a=2*Math.PI,o=Math.PI/2,s=n._class,h=function(t,e){var i=s("easing."+t,function(){},!0),r=i.prototype=new E;return r.constructor=i,r.getRatio=e,i},l=E.register||function(){},c=function(t,e,i,r,n){var a=s("easing."+t,{easeOut:new e,easeIn:new i,easeInOut:new r},!0);return l(a,t),a},g=function(t,e,i){this.t=t,this.v=e,i&&(((this.next=i).prev=this).c=i.v-e,this.gap=i.t-t)},u=function(t,e){var i=s("easing."+t,function(t){this._p1=t||0===t?t:1.70158,this._p2=1.525*this._p1},!0),r=i.prototype=new E;return r.constructor=i,r.getRatio=e,r.config=function(t){return new i(t)},i},d=c("Back",u("BackOut",function(t){return(t-=1)*t*((this._p1+1)*t+this._p1)+1}),u("BackIn",function(t){return t*t*((this._p1+1)*t-this._p1)}),u("BackInOut",function(t){return(t*=2)<1?.5*t*t*((this._p2+1)*t-this._p2):.5*((t-=2)*t*((this._p2+1)*t+this._p2)+2)})),p=s("easing.SlowMo",function(t,e,i){e=e||0===e?e:.7,null==t?t=.7:1<t&&(t=1),this._p=1!==t?e:0,this._p1=(1-t)/2,this._p2=t,this._p3=this._p1+this._p2,this._calcEnd=!0===i},!0),f=p.prototype=new E;return f.constructor=p,f.getRatio=function(t){var e=t+(.5-t)*this._p;return t<this._p1?this._calcEnd?1-(t=1-t/this._p1)*t:e-(t=1-t/this._p1)*t*t*t*e:t>this._p3?this._calcEnd?1-(t=(t-this._p3)/this._p1)*t:e+(t-e)*(t=(t-this._p3)/this._p1)*t*t*t:this._calcEnd?1:e},p.ease=new p(.7,.7),f.config=p.config=function(t,e,i){return new p(t,e,i)},(f=(e=s("easing.SteppedEase",function(t){t=t||1,this._p1=1/t,this._p2=t+1},!0)).prototype=new E).constructor=e,f.getRatio=function(t){return t<0?t=0:1<=t&&(t=.999999999),(this._p2*t>>0)*this._p1},f.config=e.config=function(t){return new e(t)},(f=(i=s("easing.RoughEase",function(t){for(var e,i,r,n,a,o,s=(t=t||{}).taper||"none",h=[],l=0,c=0|(t.points||20),u=c,d=!1!==t.randomize,p=!0===t.clamp,f=t.template instanceof E?t.template:null,m="number"==typeof t.strength?.4*t.strength:.4;-1<--u;)e=d?Math.random():1/c*u,i=f?f.getRatio(e):e,"none"===s?r=m:"out"===s?r=(n=1-e)*n*m:"in"===s?r=e*e*m:r=(n=e<.5?2*e:2*(1-e))*n*.5*m,d?i+=Math.random()*r-.5*r:u%2?i+=.5*r:i-=.5*r,p&&(1<i?i=1:i<0&&(i=0)),h[l++]={x:e,y:i};for(h.sort(function(t,e){return t.x-e.x}),o=new g(1,1,null),u=c;-1<--u;)a=h[u],o=new g(a.x,a.y,o);this._prev=new g(0,0,0!==o.t?o:o.next)},!0)).prototype=new E).constructor=i,f.getRatio=function(t){var e=this._prev;if(t>e.t){for(;e.next&&t>=e.t;)e=e.next;e=e.prev}else for(;e.prev&&t<=e.t;)e=e.prev;return(this._prev=e).v+(t-e.t)/e.gap*e.c},f.config=function(t){return new i(t)},i.ease=new i,c("Bounce",h("BounceOut",function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}),h("BounceIn",function(t){return(t=1-t)<1/2.75?1-7.5625*t*t:t<2/2.75?1-(7.5625*(t-=1.5/2.75)*t+.75):t<2.5/2.75?1-(7.5625*(t-=2.25/2.75)*t+.9375):1-(7.5625*(t-=2.625/2.75)*t+.984375)}),h("BounceInOut",function(t){var e=t<.5;return(t=e?1-2*t:2*t-1)<1/2.75?t*=7.5625*t:t=t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,e?.5*(1-t):.5*t+.5})),c("Circ",h("CircOut",function(t){return Math.sqrt(1-(t-=1)*t)}),h("CircIn",function(t){return-(Math.sqrt(1-t*t)-1)}),h("CircInOut",function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)})),c("Elastic",(t=function(t,e,i){var r=s("easing."+t,function(t,e){this._p1=1<=t?t:1,this._p2=(e||i)/(t<1?t:1),this._p3=this._p2/a*(Math.asin(1/this._p1)||0),this._p2=a/this._p2},!0),n=r.prototype=new E;return n.constructor=r,n.getRatio=e,n.config=function(t,e){return new r(t,e)},r})("ElasticOut",function(t){return this._p1*Math.pow(2,-10*t)*Math.sin((t-this._p3)*this._p2)+1},.3),t("ElasticIn",function(t){return-this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)},.3),t("ElasticInOut",function(t){return(t*=2)<1?this._p1*Math.pow(2,10*(t-=1))*Math.sin((t-this._p3)*this._p2)*-.5:this._p1*Math.pow(2,-10*(t-=1))*Math.sin((t-this._p3)*this._p2)*.5+1},.45)),c("Expo",h("ExpoOut",function(t){return 1-Math.pow(2,-10*t)}),h("ExpoIn",function(t){return Math.pow(2,10*(t-1))-.001}),h("ExpoInOut",function(t){return(t*=2)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*(t-1)))})),c("Sine",h("SineOut",function(t){return Math.sin(t*o)}),h("SineIn",function(t){return 1-Math.cos(t*o)}),h("SineInOut",function(t){return-.5*(Math.cos(Math.PI*t)-1)})),s("easing.EaseLookup",{find:function(t){return E.map[t]}},!0),l(r.SlowMo,"SlowMo","ease,"),l(i,"RoughEase","ease,"),l(e,"SteppedEase","ease,"),d},!0)}),_gsScope._gsDefine&&_gsScope._gsQueue.pop()(),function(p,t){"use strict";var e,i,f=p.GreenSockGlobals=p.GreenSockGlobals||p;if(!f.TweenLite){var r,n,a,m,E,g=function(t){var e,i=t.split("."),r=f;for(e=0;e<i.length;e++)r[i[e]]=r=r[i[e]]||{};return r},u=g("com.greensock"),h=function(t){var e,i=[],r=t.length;for(e=0;e!==r;i.push(t[e++]));return i},v=function(){},y=(e=Object.prototype.toString,i=e.call([]),function(t){return null!=t&&(t instanceof Array||"object"==typeof t&&!!t.push&&e.call(t)===i)}),T={},R=function(h,l,c,u){this.sc=T[h]?T[h].sc:[],(T[h]=this).gsClass=null,this.func=c;var d=[];this.check=function(t){for(var e,i,r,n,a,o=l.length,s=o;-1<--o;)(e=T[l[o]]||new R(l[o],[])).gsClass?(d[o]=e.gsClass,s--):t&&e.sc.push(this);if(0===s&&c)for(r=(i=("com.greensock."+h).split(".")).pop(),n=g(i.join("."))[r]=this.gsClass=c.apply(c,d),u&&(f[r]=n,!(a="undefined"!=typeof module&&module.exports)&&"function"==typeof define&&define.amd?define((p.GreenSockAMDPath?p.GreenSockAMDPath+"/":"")+h.split(".").pop(),[],function(){return n}):"TweenMax"===h&&a&&(module.exports=n)),o=0;o<this.sc.length;o++)this.sc[o].check()},this.check(!0)},o=p._gsDefine=function(t,e,i,r){return new R(t,e,i,r)},d=u._class=function(t,e,i){return e=e||function(){},o(t,[],function(){return e},i),e};o.globals=f;var s=[0,0,1,1],l=[],c=d("easing.Ease",function(t,e,i,r){this._func=t,this._type=i||0,this._power=r||0,this._params=e?s.concat(e):s},!0),_=c.map={},x=c.register=function(t,e,i,r){for(var n,a,o,s,h=e.split(","),l=h.length,c=(i||"easeIn,easeOut,easeInOut").split(",");-1<--l;)for(a=h[l],n=r?d("easing."+a,null,!0):u.easing[a]||{},o=c.length;-1<--o;)s=c[o],_[a+"."+s]=_[s+a]=n[s]=t.getRatio?t:t[s]||new t};for((a=c.prototype)._calcEnd=!1,a.getRatio=function(t){if(this._func)return this._params[0]=t,this._func.apply(null,this._params);var e=this._type,i=this._power,r=1===e?1-t:2===e?t:t<.5?2*t:2*(1-t);return 1===i?r*=r:2===i?r*=r*r:3===i?r*=r*r*r:4===i&&(r*=r*r*r*r),1===e?1-r:2===e?r:t<.5?r/2:1-r/2},n=(r=["Linear","Quad","Cubic","Quart","Quint,Strong"]).length;-1<--n;)a=r[n]+",Power"+n,x(new c(null,null,1,n),a,"easeOut",!0),x(new c(null,null,2,n),a,"easeIn"+(0===n?",easeNone":"")),x(new c(null,null,3,n),a,"easeInOut");_.linear=u.easing.Linear.easeIn,_.swing=u.easing.Quad.easeInOut;var b=d("events.EventDispatcher",function(t){this._listeners={},this._eventTarget=t||this});(a=b.prototype).addEventListener=function(t,e,i,r,n){n=n||0;var a,o,s=this._listeners[t],h=0;for(null==s&&(this._listeners[t]=s=[]),o=s.length;-1<--o;)(a=s[o]).c===e&&a.s===i?s.splice(o,1):0===h&&a.pr<n&&(h=o+1);s.splice(h,0,{c:e,s:i,up:r,pr:n}),this!==m||E||m.wake()},a.removeEventListener=function(t,e){var i,r=this._listeners[t];if(r)for(i=r.length;-1<--i;)if(r[i].c===e)return void r.splice(i,1)},a.dispatchEvent=function(t){var e,i,r,n=this._listeners[t];if(n)for(e=n.length,i=this._eventTarget;-1<--e;)(r=n[e])&&(r.up?r.c.call(r.s||i,{type:t,target:i}):r.c.call(r.s||i))};var w=p.requestAnimationFrame,H=p.cancelAnimationFrame,M=Date.now||function(){return(new Date).getTime()},S=M();for(n=(r=["ms","moz","webkit","o"]).length;-1<--n&&!w;)w=p[r[n]+"RequestAnimationFrame"],H=p[r[n]+"CancelAnimationFrame"]||p[r[n]+"CancelRequestAnimationFrame"];d("Ticker",function(t,e){var n,a,o,s,h,l=this,c=M(),i=!1!==e&&w,u=500,d=33,p=function(t){var e,i,r=M()-S;u<r&&(c+=r-d),S+=r,l.time=(S-c)/1e3,e=l.time-h,(!n||0<e||!0===t)&&(l.frame++,h+=e+(s<=e?.004:s-e),i=!0),!0!==t&&(o=a(p)),i&&l.dispatchEvent("tick")};b.call(l),l.time=l.frame=0,l.tick=function(){p(!0)},l.lagSmoothing=function(t,e){u=t||1e10,d=Math.min(e,u,0)},l.sleep=function(){null!=o&&(i&&H?H(o):clearTimeout(o),a=v,o=null,l===m&&(E=!1))},l.wake=function(){null!==o?l.sleep():10<l.frame&&(S=M()-u+5),a=0===n?v:i&&w?w:function(t){return setTimeout(t,1e3*(h-l.time)+1|0)},l===m&&(E=!0),p(2)},l.fps=function(t){if(!arguments.length)return n;s=1/((n=t)||60),h=this.time+s,l.wake()},l.useRAF=function(t){if(!arguments.length)return i;l.sleep(),i=t,l.fps(n)},l.fps(t),setTimeout(function(){i&&l.frame<5&&l.useRAF(!1)},1500)}),(a=u.Ticker.prototype=new u.events.EventDispatcher).constructor=u.Ticker;var C=d("core.Animation",function(t,e){if(this.vars=e=e||{},this._duration=this._totalDuration=t||0,this._delay=Number(e.delay)||0,this._timeScale=1,this._active=!0===e.immediateRender,this.data=e.data,this._reversed=!0===e.reversed,X){E||m.wake();var i=this.vars.useFrames?q:X;i.add(this,i._time),this.vars.paused&&this.paused(!0)}});m=C.ticker=new u.Ticker,(a=C.prototype)._dirty=a._gc=a._initted=a._paused=!1,a._totalTime=a._time=0,a._rawPrevTime=-1,a._next=a._last=a._onUpdate=a._timeline=a.timeline=null,a._paused=!1;var A=function(){E&&2e3<M()-S&&m.wake(),setTimeout(A,2e3)};A(),a.play=function(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},a.pause=function(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},a.resume=function(t,e){return null!=t&&this.seek(t,e),this.paused(!1)},a.seek=function(t,e){return this.totalTime(Number(t),!1!==e)},a.restart=function(t,e){return this.reversed(!1).paused(!1).totalTime(t?-this._delay:0,!1!==e,!0)},a.reverse=function(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},a.render=function(t,e,i){},a.invalidate=function(){return this._time=this._totalTime=0,this._initted=this._gc=!1,this._rawPrevTime=-1,!this._gc&&this.timeline||this._enabled(!0),this},a.isActive=function(){var t,e=this._timeline,i=this._startTime;return!e||!this._gc&&!this._paused&&e.isActive()&&(t=e.rawTime())>=i&&t<i+this.totalDuration()/this._timeScale},a._enabled=function(t,e){return E||m.wake(),this._gc=!t,this._active=this.isActive(),!0!==e&&(t&&!this.timeline?this._timeline.add(this,this._startTime-this._delay):!t&&this.timeline&&this._timeline._remove(this,!0)),!1},a._kill=function(t,e){return this._enabled(!1,!1)},a.kill=function(t,e){return this._kill(t,e),this},a._uncache=function(t){for(var e=t?this:this.timeline;e;)e._dirty=!0,e=e.timeline;return this},a._swapSelfInParams=function(t){for(var e=t.length,i=t.concat();-1<--e;)"{self}"===t[e]&&(i[e]=this);return i},a._callback=function(t){var e=this.vars;e[t].apply(e[t+"Scope"]||e.callbackScope||this,e[t+"Params"]||l)},a.eventCallback=function(t,e,i,r){if("on"===(t||"").substr(0,2)){var n=this.vars;if(1===arguments.length)return n[t];null==e?delete n[t]:(n[t]=e,n[t+"Params"]=y(i)&&-1!==i.join("").indexOf("{self}")?this._swapSelfInParams(i):i,n[t+"Scope"]=r),"onUpdate"===t&&(this._onUpdate=e)}return this},a.delay=function(t){return arguments.length?(this._timeline.smoothChildTiming&&this.startTime(this._startTime+t-this._delay),this._delay=t,this):this._delay},a.duration=function(t){return arguments.length?(this._duration=this._totalDuration=t,this._uncache(!0),this._timeline.smoothChildTiming&&0<this._time&&this._time<this._duration&&0!==t&&this.totalTime(this._totalTime*(t/this._duration),!0),this):(this._dirty=!1,this._duration)},a.totalDuration=function(t){return this._dirty=!1,arguments.length?this.duration(t):this._totalDuration},a.time=function(t,e){return arguments.length?(this._dirty&&this.totalDuration(),this.totalTime(t>this._duration?this._duration:t,e)):this._time},a.totalTime=function(t,e,i){if(E||m.wake(),!arguments.length)return this._totalTime;if(this._timeline){if(t<0&&!i&&(t+=this.totalDuration()),this._timeline.smoothChildTiming){this._dirty&&this.totalDuration();var r=this._totalDuration,n=this._timeline;if(r<t&&!i&&(t=r),this._startTime=(this._paused?this._pauseTime:n._time)-(this._reversed?r-t:t)/this._timeScale,n._dirty||this._uncache(!1),n._timeline)for(;n._timeline;)n._timeline._time!==(n._startTime+n._totalTime)/n._timeScale&&n.totalTime(n._totalTime,!0),n=n._timeline}this._gc&&this._enabled(!0,!1),this._totalTime===t&&0!==this._duration||(D.length&&K(),this.render(t,e,!1),D.length&&K())}return this},a.progress=a.totalProgress=function(t,e){var i=this.duration();return arguments.length?this.totalTime(i*t,e):i?this._time/i:this.ratio},a.startTime=function(t){return arguments.length?(t!==this._startTime&&(this._startTime=t,this.timeline&&this.timeline._sortChildren&&this.timeline.add(this,t-this._delay)),this):this._startTime},a.endTime=function(t){return this._startTime+(0!=t?this.totalDuration():this.duration())/this._timeScale},a.timeScale=function(t){if(!arguments.length)return this._timeScale;if(t=t||1e-10,this._timeline&&this._timeline.smoothChildTiming){var e=this._pauseTime,i=e||0===e?e:this._timeline.totalTime();this._startTime=i-(i-this._startTime)*this._timeScale/t}return this._timeScale=t,this._uncache(!1)},a.reversed=function(t){return arguments.length?(t!=this._reversed&&(this._reversed=t,this.totalTime(this._timeline&&!this._timeline.smoothChildTiming?this.totalDuration()-this._totalTime:this._totalTime,!0)),this):this._reversed},a.paused=function(t){if(!arguments.length)return this._paused;var e,i,r=this._timeline;return t!=this._paused&&r&&(E||t||m.wake(),i=(e=r.rawTime())-this._pauseTime,!t&&r.smoothChildTiming&&(this._startTime+=i,this._uncache(!1)),this._pauseTime=t?e:null,this._paused=t,this._active=this.isActive(),!t&&0!==i&&this._initted&&this.duration()&&(e=r.smoothChildTiming?this._totalTime:(e-this._startTime)/this._timeScale,this.render(e,e===this._totalTime,!0))),this._gc&&!t&&this._enabled(!0,!1),this};var P=d("core.SimpleTimeline",function(t){C.call(this,0,t),this.autoRemoveChildren=this.smoothChildTiming=!0});(a=P.prototype=new C).constructor=P,a.kill()._gc=!1,a._first=a._last=a._recent=null,a._sortChildren=!1,a.add=a.insert=function(t,e,i,r){var n,a;if(t._startTime=Number(e||0)+t._delay,t._paused&&this!==t._timeline&&(t._pauseTime=t._startTime+(this.rawTime()-t._startTime)/t._timeScale),t.timeline&&t.timeline._remove(t,!0),t.timeline=t._timeline=this,t._gc&&t._enabled(!0,!0),n=this._last,this._sortChildren)for(a=t._startTime;n&&n._startTime>a;)n=n._prev;return n?(t._next=n._next,n._next=t):(t._next=this._first,this._first=t),t._next?t._next._prev=t:this._last=t,t._prev=n,this._recent=t,this._timeline&&this._uncache(!0),this},a._remove=function(t,e){return t.timeline===this&&(e||t._enabled(!1,!0),t._prev?t._prev._next=t._next:this._first===t&&(this._first=t._next),t._next?t._next._prev=t._prev:this._last===t&&(this._last=t._prev),t._next=t._prev=t.timeline=null,t===this._recent&&(this._recent=this._last),this._timeline&&this._uncache(!0)),this},a.render=function(t,e,i){var r,n=this._first;for(this._totalTime=this._time=this._rawPrevTime=t;n;)r=n._next,(n._active||t>=n._startTime&&!n._paused)&&(n._reversed?n.render((n._dirty?n.totalDuration():n._totalDuration)-(t-n._startTime)*n._timeScale,e,i):n.render((t-n._startTime)*n._timeScale,e,i)),n=r},a.rawTime=function(){return E||m.wake(),this._totalTime};var L=d("TweenLite",function(t,e,i){if(C.call(this,e,i),this.render=L.prototype.render,null==t)throw"Cannot tween a null target.";this.target=t="string"!=typeof t?t:L.selector(t)||t;var r,n,a,o=t.jquery||t.length&&t!==p&&t[0]&&(t[0]===p||t[0].nodeType&&t[0].style&&!t.nodeType),s=this.vars.overwrite;if(this._overwrite=s=null==s?j[L.defaultOverwrite]:"number"==typeof s?s>>0:j[s],(o||t instanceof Array||t.push&&y(t))&&"number"!=typeof t[0])for(this._targets=a=h(t),this._propLookup=[],this._siblings=[],r=0;r<a.length;r++)(n=a[r])?"string"!=typeof n?n.length&&n!==p&&n[0]&&(n[0]===p||n[0].nodeType&&n[0].style&&!n.nodeType)?(a.splice(r--,1),this._targets=a=a.concat(h(n))):(this._siblings[r]=Q(n,this,!1),1===s&&1<this._siblings[r].length&&J(n,this,null,1,this._siblings[r])):"string"==typeof(n=a[r--]=L.selector(n))&&a.splice(r+1,1):a.splice(r--,1);else this._propLookup={},this._siblings=Q(t,this,!1),1===s&&1<this._siblings.length&&J(t,this,null,1,this._siblings);(this.vars.immediateRender||0===e&&0===this._delay&&!1!==this.vars.immediateRender)&&(this._time=-1e-10,this.render(-this._delay))},!0),k=function(t){return t&&t.length&&t!==p&&t[0]&&(t[0]===p||t[0].nodeType&&t[0].style&&!t.nodeType)};(a=L.prototype=new C).constructor=L,a.kill()._gc=!1,a.ratio=0,a._firstPT=a._targets=a._overwrittenProps=a._startAt=null,a._notifyPluginsOfEnabled=a._lazy=!1,L.version="1.18.0",L.defaultEase=a._ease=new c(null,null,1,1),L.defaultOverwrite="auto",L.ticker=m,L.autoSleep=120,L.lagSmoothing=function(t,e){m.lagSmoothing(t,e)},L.selector=p.$||p.jQuery||function(t){var e=p.$||p.jQuery;return e?(L.selector=e)(t):"undefined"==typeof document?t:document.querySelectorAll?document.querySelectorAll(t):document.getElementById("#"===t.charAt(0)?t.substr(1):t)};var D=[],F={},z=/(?:(-|-=|\+=)?\d*\.?\d*(?:e[\-+]?\d+)?)[0-9]/gi,B=function(t){for(var e,i=this._firstPT;i;)e=i.blob?t?this.join(""):this.start:i.c*t+i.s,i.r?e=Math.round(e):e<1e-6&&-1e-6<e&&(e=0),i.f?i.fp?i.t[i.p](i.fp,e):i.t[i.p](e):i.t[i.p]=e,i=i._next},O=function(t,e,i,r){var n,a,o,s,h,l,c,u=[t,e],d=0,p="",f=0;for(u.start=t,i&&(i(u),t=u[0],e=u[1]),u.length=0,n=t.match(z)||[],a=e.match(z)||[],r&&(r._next=null,r.blob=1,u._firstPT=r),h=a.length,s=0;s<h;s++)c=a[s],p+=(l=e.substr(d,e.indexOf(c,d)-d))||!s?l:",",d+=l.length,f?f=(f+1)%5:"rgba("===l.substr(-5)&&(f=1),c===n[s]||n.length<=s?p+=c:(p&&(u.push(p),p=""),o=parseFloat(n[s]),u.push(o),u._firstPT={_next:u._firstPT,t:u,p:u.length-1,s:o,c:("="===c.charAt(1)?parseInt(c.charAt(0)+"1",10)*parseFloat(c.substr(2)):parseFloat(c)-o)||0,f:0,r:f&&f<4}),d+=c.length;return(p+=e.substr(d))&&u.push(p),u.setRatio=B,u},N=function(t,e,i,r,n,a,o,s){var h,l="get"===i?t[e]:i,c=typeof t[e],u="string"==typeof r&&"="===r.charAt(1),d={t:t,p:e,s:l,f:"function"===c,pg:0,n:n||e,r:a,pr:0,c:u?parseInt(r.charAt(0)+"1",10)*parseFloat(r.substr(2)):parseFloat(r)-l||0};if("number"!==c&&("function"===c&&"get"===i&&(h=e.indexOf("set")||"function"!=typeof t["get"+e.substr(3)]?e:"get"+e.substr(3),d.s=l=o?t[h](o):t[h]()),"string"==typeof l&&(o||isNaN(l))?(d.fp=o,d={t:O(l,r,s||L.defaultStringFilter,d),p:"setRatio",s:0,c:1,f:2,pg:0,n:n||e,pr:0}):u||(d.c=parseFloat(r)-parseFloat(l)||0)),d.c)return(d._next=this._firstPT)&&(d._next._prev=d),this._firstPT=d},U=L._internals={isArray:y,isSelector:k,lazyTweens:D,blobDif:O},V=L._plugins={},I=U.tweenLookup={},G=0,W=U.reservedProps={ease:1,delay:1,overwrite:1,onComplete:1,onCompleteParams:1,onCompleteScope:1,useFrames:1,runBackwards:1,startAt:1,onUpdate:1,onUpdateParams:1,onUpdateScope:1,onStart:1,onStartParams:1,onStartScope:1,onReverseComplete:1,onReverseCompleteParams:1,onReverseCompleteScope:1,onRepeat:1,onRepeatParams:1,onRepeatScope:1,easeParams:1,yoyo:1,immediateRender:1,repeat:1,repeatDelay:1,data:1,paused:1,reversed:1,autoCSS:1,lazy:1,onOverwrite:1,callbackScope:1,stringFilter:1},j={none:0,all:1,auto:2,concurrent:3,allOnStart:4,preexisting:5,true:1,false:0},q=C._rootFramesTimeline=new P,X=C._rootTimeline=new P,Y=30,K=U.lazyRender=function(){var t,e=D.length;for(F={};-1<--e;)(t=D[e])&&!1!==t._lazy&&(t.render(t._lazy[0],t._lazy[1],!0),t._lazy=!1);D.length=0};X._startTime=m.time,q._startTime=m.frame,X._active=q._active=!0,setTimeout(K,1),C._updateRoot=L.render=function(){var t,e,i;if(D.length&&K(),X.render((m.time-X._startTime)*X._timeScale,!1,!1),q.render((m.frame-q._startTime)*q._timeScale,!1,!1),D.length&&K(),m.frame>=Y){for(i in Y=m.frame+(parseInt(L.autoSleep,10)||120),I){for(t=(e=I[i].tweens).length;-1<--t;)e[t]._gc&&e.splice(t,1);0===e.length&&delete I[i]}if((!(i=X._first)||i._paused)&&L.autoSleep&&!q._first&&1===m._listeners.tick.length){for(;i&&i._paused;)i=i._next;i||m.sleep()}}},m.addEventListener("tick",C._updateRoot);var Q=function(t,e,i){var r,n,a=t._gsTweenID;if(I[a||(t._gsTweenID=a="t"+G++)]||(I[a]={target:t,tweens:[]}),e&&((r=I[a].tweens)[n=r.length]=e,i))for(;-1<--n;)r[n]===e&&r.splice(n,1);return I[a].tweens},Z=function(t,e,i,r){var n,a,o=t.vars.onOverwrite;return o&&(n=o(t,e,i,r)),(o=L.onOverwrite)&&(a=o(t,e,i,r)),!1!==n&&!1!==a},J=function(t,e,i,r,n){var a,o,s,h;if(1===r||4<=r){for(h=n.length,a=0;a<h;a++)if((s=n[a])!==e)s._gc||s._kill(null,t,e)&&(o=!0);else if(5===r)break;return o}var l,c=e._startTime+1e-10,u=[],d=0,p=0===e._duration;for(a=n.length;-1<--a;)(s=n[a])===e||s._gc||s._paused||(s._timeline!==e._timeline?(l=l||$(e,0,p),0===$(s,l,p)&&(u[d++]=s)):s._startTime<=c&&s._startTime+s.totalDuration()/s._timeScale>c&&((p||!s._initted)&&c-s._startTime<=2e-10||(u[d++]=s)));for(a=d;-1<--a;)if(s=u[a],2===r&&s._kill(i,t,e)&&(o=!0),2!==r||!s._firstPT&&s._initted){if(2!==r&&!Z(s,e))continue;s._enabled(!1,!1)&&(o=!0)}return o},$=function(t,e,i){for(var r=t._timeline,n=r._timeScale,a=t._startTime;r._timeline;){if(a+=r._startTime,n*=r._timeScale,r._paused)return-100;r=r._timeline}return e<(a/=n)?a-e:i&&a===e||!t._initted&&a-e<2e-10?1e-10:(a+=t.totalDuration()/t._timeScale/n)>e+1e-10?0:a-e-1e-10};a._init=function(){var t,e,i,r,n,a=this.vars,o=this._overwrittenProps,s=this._duration,h=!!a.immediateRender,l=a.ease;if(a.startAt){for(r in this._startAt&&(this._startAt.render(-1,!0),this._startAt.kill()),n={},a.startAt)n[r]=a.startAt[r];if(n.overwrite=!1,n.immediateRender=!0,n.lazy=h&&!1!==a.lazy,n.startAt=n.delay=null,this._startAt=L.to(this.target,0,n),h)if(0<this._time)this._startAt=null;else if(0!==s)return}else if(a.runBackwards&&0!==s)if(this._startAt)this._startAt.render(-1,!0),this._startAt.kill(),this._startAt=null;else{for(r in 0!==this._time&&(h=!1),i={},a)W[r]&&"autoCSS"!==r||(i[r]=a[r]);if(i.overwrite=0,i.data="isFromStart",i.lazy=h&&!1!==a.lazy,i.immediateRender=h,this._startAt=L.to(this.target,0,i),h){if(0===this._time)return}else this._startAt._init(),this._startAt._enabled(!1),this.vars.immediateRender&&(this._startAt=null)}if(this._ease=l=l?l instanceof c?l:"function"==typeof l?new c(l,a.easeParams):_[l]||L.defaultEase:L.defaultEase,a.easeParams instanceof Array&&l.config&&(this._ease=l.config.apply(l,a.easeParams)),this._easeType=this._ease._type,this._easePower=this._ease._power,this._firstPT=null,this._targets)for(t=this._targets.length;-1<--t;)this._initProps(this._targets[t],this._propLookup[t]={},this._siblings[t],o?o[t]:null)&&(e=!0);else e=this._initProps(this.target,this._propLookup,this._siblings,o);if(e&&L._onPluginEvent("_onInitAllProps",this),o&&(this._firstPT||"function"!=typeof this.target&&this._enabled(!1,!1)),a.runBackwards)for(i=this._firstPT;i;)i.s+=i.c,i.c=-i.c,i=i._next;this._onUpdate=a.onUpdate,this._initted=!0},a._initProps=function(t,e,i,r){var n,a,o,s,h,l;if(null==t)return!1;for(n in F[t._gsTweenID]&&K(),this.vars.css||t.style&&t!==p&&t.nodeType&&V.css&&!1!==this.vars.autoCSS&&function(t,e){var i,r={};for(i in t)W[i]||i in e&&"transform"!==i&&"x"!==i&&"y"!==i&&"width"!==i&&"height"!==i&&"className"!==i&&"border"!==i||!(!V[i]||V[i]&&V[i]._autoCSS)||(r[i]=t[i],delete t[i]);t.css=r}(this.vars,t),this.vars)if(l=this.vars[n],W[n])l&&(l instanceof Array||l.push&&y(l))&&-1!==l.join("").indexOf("{self}")&&(this.vars[n]=l=this._swapSelfInParams(l,this));else if(V[n]&&(s=new V[n])._onInitTween(t,this.vars[n],this)){for(this._firstPT=h={_next:this._firstPT,t:s,p:"setRatio",s:0,c:1,f:1,n:n,pg:1,pr:s._priority},a=s._overwriteProps.length;-1<--a;)e[s._overwriteProps[a]]=this._firstPT;(s._priority||s._onInitAllProps)&&(o=!0),(s._onDisable||s._onEnable)&&(this._notifyPluginsOfEnabled=!0),h._next&&(h._next._prev=h)}else e[n]=N.call(this,t,n,"get",l,n,0,null,this.vars.stringFilter);return r&&this._kill(r,t)?this._initProps(t,e,i,r):1<this._overwrite&&this._firstPT&&1<i.length&&J(t,this,e,this._overwrite,i)?(this._kill(e,t),this._initProps(t,e,i,r)):(this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration)&&(F[t._gsTweenID]=!0),o)},a.render=function(t,e,i){var r,n,a,o,s=this._time,h=this._duration,l=this._rawPrevTime;if(h<=t)this._totalTime=this._time=h,this.ratio=this._ease._calcEnd?this._ease.getRatio(1):1,this._reversed||(r=!0,n="onComplete",i=i||this._timeline.autoRemoveChildren),0===h&&(this._initted||!this.vars.lazy||i)&&(this._startTime===this._timeline._duration&&(t=0),(0===t||l<0||1e-10===l&&"isPause"!==this.data)&&l!==t&&(i=!0,1e-10<l&&(n="onReverseComplete")),this._rawPrevTime=o=!e||t||l===t?t:1e-10);else if(t<1e-7)this._totalTime=this._time=0,this.ratio=this._ease._calcEnd?this._ease.getRatio(0):0,(0!==s||0===h&&0<l)&&(n="onReverseComplete",r=this._reversed),t<0&&(this._active=!1,0===h&&(this._initted||!this.vars.lazy||i)&&(0<=l&&(1e-10!==l||"isPause"!==this.data)&&(i=!0),this._rawPrevTime=o=!e||t||l===t?t:1e-10)),this._initted||(i=!0);else if(this._totalTime=this._time=t,this._easeType){var c=t/h,u=this._easeType,d=this._easePower;(1===u||3===u&&.5<=c)&&(c=1-c),3===u&&(c*=2),1===d?c*=c:2===d?c*=c*c:3===d?c*=c*c*c:4===d&&(c*=c*c*c*c),this.ratio=1===u?1-c:2===u?c:t/h<.5?c/2:1-c/2}else this.ratio=this._ease.getRatio(t/h);if(this._time!==s||i){if(!this._initted){if(this._init(),!this._initted||this._gc)return;if(!i&&this._firstPT&&(!1!==this.vars.lazy&&this._duration||this.vars.lazy&&!this._duration))return this._time=this._totalTime=s,this._rawPrevTime=l,D.push(this),void(this._lazy=[t,e]);this._time&&!r?this.ratio=this._ease.getRatio(this._time/h):r&&this._ease._calcEnd&&(this.ratio=this._ease.getRatio(0===this._time?0:1))}for(!1!==this._lazy&&(this._lazy=!1),this._active||!this._paused&&this._time!==s&&0<=t&&(this._active=!0),0===s&&(this._startAt&&(0<=t?this._startAt.render(t,e,i):n||(n="_dummyGS")),this.vars.onStart&&(0===this._time&&0!==h||e||this._callback("onStart"))),a=this._firstPT;a;)a.f?a.t[a.p](a.c*this.ratio+a.s):a.t[a.p]=a.c*this.ratio+a.s,a=a._next;this._onUpdate&&(t<0&&this._startAt&&-1e-4!==t&&this._startAt.render(t,e,i),e||(this._time!==s||r)&&this._callback("onUpdate")),n&&(this._gc&&!i||(t<0&&this._startAt&&!this._onUpdate&&-1e-4!==t&&this._startAt.render(t,e,i),r&&(this._timeline.autoRemoveChildren&&this._enabled(!1,!1),this._active=!1),!e&&this.vars[n]&&this._callback(n),0===h&&1e-10===this._rawPrevTime&&1e-10!==o&&(this._rawPrevTime=0)))}},a._kill=function(t,e,i){if("all"===t&&(t=null),null==t&&(null==e||e===this.target))return this._lazy=!1,this._enabled(!1,!1);e="string"!=typeof e?e||this._targets||this.target:L.selector(e)||e;var r,n,a,o,s,h,l,c,u,d=i&&this._time&&i._startTime===this._startTime&&this._timeline===i._timeline;if((y(e)||k(e))&&"number"!=typeof e[0])for(r=e.length;-1<--r;)this._kill(t,e[r],i)&&(h=!0);else{if(this._targets){for(r=this._targets.length;-1<--r;)if(e===this._targets[r]){s=this._propLookup[r]||{},this._overwrittenProps=this._overwrittenProps||[],n=this._overwrittenProps[r]=t?this._overwrittenProps[r]||{}:"all";break}}else{if(e!==this.target)return!1;s=this._propLookup,n=this._overwrittenProps=t?this._overwrittenProps||{}:"all"}if(s){if(l=t||s,c=t!==n&&"all"!==n&&t!==s&&("object"!=typeof t||!t._tempKill),i&&(L.onOverwrite||this.vars.onOverwrite)){for(a in l)s[a]&&(u||(u=[]),u.push(a));if((u||!t)&&!Z(this,i,e,u))return!1}for(a in l)(o=s[a])&&(d&&(o.f?o.t[o.p](o.s):o.t[o.p]=o.s,h=!0),o.pg&&o.t._kill(l)&&(h=!0),o.pg&&0!==o.t._overwriteProps.length||(o._prev?o._prev._next=o._next:o===this._firstPT&&(this._firstPT=o._next),o._next&&(o._next._prev=o._prev),o._next=o._prev=null),delete s[a]),c&&(n[a]=1);!this._firstPT&&this._initted&&this._enabled(!1,!1)}}return h},a.invalidate=function(){return this._notifyPluginsOfEnabled&&L._onPluginEvent("_onDisable",this),this._firstPT=this._overwrittenProps=this._startAt=this._onUpdate=null,this._notifyPluginsOfEnabled=this._active=this._lazy=!1,this._propLookup=this._targets?{}:[],C.prototype.invalidate.call(this),this.vars.immediateRender&&(this._time=-1e-10,this.render(-this._delay)),this},a._enabled=function(t,e){if(E||m.wake(),t&&this._gc){var i,r=this._targets;if(r)for(i=r.length;-1<--i;)this._siblings[i]=Q(r[i],this,!0);else this._siblings=Q(this.target,this,!0)}return C.prototype._enabled.call(this,t,e),!(!this._notifyPluginsOfEnabled||!this._firstPT)&&L._onPluginEvent(t?"_onEnable":"_onDisable",this)},L.to=function(t,e,i){return new L(t,e,i)},L.from=function(t,e,i){return i.runBackwards=!0,i.immediateRender=0!=i.immediateRender,new L(t,e,i)},L.fromTo=function(t,e,i,r){return r.startAt=i,r.immediateRender=0!=r.immediateRender&&0!=i.immediateRender,new L(t,e,r)},L.delayedCall=function(t,e,i,r,n){return new L(e,0,{delay:t,onComplete:e,onCompleteParams:i,callbackScope:r,onReverseComplete:e,onReverseCompleteParams:i,immediateRender:!1,lazy:!1,useFrames:n,overwrite:0})},L.set=function(t,e){return new L(t,0,e)},L.getTweensOf=function(t,e){if(null==t)return[];var i,r,n,a;if(t="string"!=typeof t?t:L.selector(t)||t,(y(t)||k(t))&&"number"!=typeof t[0]){for(i=t.length,r=[];-1<--i;)r=r.concat(L.getTweensOf(t[i],e));for(i=r.length;-1<--i;)for(a=r[i],n=i;-1<--n;)a===r[n]&&r.splice(i,1)}else for(i=(r=Q(t).concat()).length;-1<--i;)(r[i]._gc||e&&!r[i].isActive())&&r.splice(i,1);return r},L.killTweensOf=L.killDelayedCallsTo=function(t,e,i){"object"==typeof e&&(i=e,e=!1);for(var r=L.getTweensOf(t,e),n=r.length;-1<--n;)r[n]._kill(i,t)};var tt=d("plugins.TweenPlugin",function(t,e){this._overwriteProps=(t||"").split(","),this._propName=this._overwriteProps[0],this._priority=e||0,this._super=tt.prototype},!0);if(a=tt.prototype,tt.version="1.18.0",tt.API=2,a._firstPT=null,a._addTween=N,a.setRatio=B,a._kill=function(t){var e,i=this._overwriteProps,r=this._firstPT;if(null!=t[this._propName])this._overwriteProps=[];else for(e=i.length;-1<--e;)null!=t[i[e]]&&i.splice(e,1);for(;r;)null!=t[r.n]&&(r._next&&(r._next._prev=r._prev),r._prev?(r._prev._next=r._next,r._prev=null):this._firstPT===r&&(this._firstPT=r._next)),r=r._next;return!1},a._roundProps=function(t,e){for(var i=this._firstPT;i;)(t[this._propName]||null!=i.n&&t[i.n.split(this._propName+"_").join("")])&&(i.r=e),i=i._next},L._onPluginEvent=function(t,e){var i,r,n,a,o,s=e._firstPT;if("_onInitAllProps"===t){for(;s;){for(o=s._next,r=n;r&&r.pr>s.pr;)r=r._next;(s._prev=r?r._prev:a)?s._prev._next=s:n=s,(s._next=r)?r._prev=s:a=s,s=o}s=e._firstPT=n}for(;s;)s.pg&&"function"==typeof s.t[t]&&s.t[t]()&&(i=!0),s=s._next;return i},tt.activate=function(t){for(var e=t.length;-1<--e;)t[e].API===tt.API&&(V[(new t[e])._propName]=t[e]);return!0},o.plugin=function(t){if(!(t&&t.propName&&t.init&&t.API))throw"illegal plugin definition.";var e,i=t.propName,r=t.priority||0,n=t.overwriteProps,a={init:"_onInitTween",set:"setRatio",kill:"_kill",round:"_roundProps",initAll:"_onInitAllProps"},o=d("plugins."+i.charAt(0).toUpperCase()+i.substr(1)+"Plugin",function(){tt.call(this,i,r),this._overwriteProps=n||[]},!0===t.global),s=o.prototype=new tt(i);for(e in(s.constructor=o).API=t.API,a)"function"==typeof t[e]&&(s[a[e]]=t[e]);return o.version=t.version,tt.activate([o]),o},r=p._gsQueue){for(n=0;n<r.length;n++)r[n]();for(a in T)T[a].func||p.console.log("GSAP encountered missing dependency: com.greensock."+a)}E=!1}}("undefined"!=typeof module&&module.exports&&"undefined"!=typeof global?global:this||window),define("TweenMax",function(){}),define("page-transition/project-transition.view",["dispatcher","TweenMax","page-transition/page-transition.store"],function(h,t,l){"use strict";var c,o,u,d,p,f={},m={},E=!1,g=1,v=!1,y=!1,T=function(t){t.preventDefault()},e=function(){var t,e,i=function(t,e){var i,r,n,a,o,s=!1;for(var h in t)if(t.hasOwnProperty(h)&&t[h].element===e){s=!0;break}s||(i=t,n=(r=e).getAttribute("data-id"),a=r.getAttribute("data-color")||!1,o=r.getAttribute("data-text")||!1,n||(n="project-section-id-"+g,g++),i[n]={id:n,color:a,text:o,element:r})},r=function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]};if(u=document.getElementById("project-preloader-img"),c=document.getElementById("project-preloader"))if(o=c.getElementsByClassName("bg")[0],u){t=document.getElementsByClassName("project-preview");for(var n=0;n<t.length;n++)i(f,t[n]);for(var a in f)f.hasOwnProperty(a)&&r(f,t,f[a]);e=document.getElementsByClassName("project-preload-img");for(n=0;n<e.length;n++)i(m,e[n]);for(var a in m)m.hasOwnProperty(a)&&r(m,e,m[a])}else console.warn("project-preloader-img is missing");else console.warn("project-overlay elemeni is missing!")},i=function(){var t,e,i,r,n,a,o,s=l.getData();!0===s.step1ready&&!1===s.step2ready&&(o=document.getElementsByClassName("page-wrapper")[0],"project"===y&&((a=new TimelineLite).to(window,1.3,{onStart:function(){var t,e,i=document.getElementById("project-preloader-text-pl");if(i){window.scrollTo(0,0),e=1/(t=i.getElementsByTagName("path")).length;for(var r=t.length-1;0<=r;r--)t[r].style[p]=r*e+"s",t[r].style.opacity=1}else console.warn("project-preloader-text-pl is missing")}}),a.to(window,.6,{onStart:function(){u.classList.add("fs"),o.classList.remove("transition-animation-complete")},onComplete:function(){f.hasOwnProperty(v)&&f[v].element.classList.remove("project-loading"),h.dispatch({type:"transition-step-2",animation:"project"}),h.dispatch({type:"words-scroll-enable"})}},"-=0.8"))),!0===s.step1ready&&!0===s.step2ready&&(e=l.getData(),i=e.scheme,r=e.pageNameId,n=document.getElementsByClassName("page-wrapper")[0],"project"===y&&(t=new TimelineLite,h.dispatch({type:"page-name-change",id:r}),h.dispatch({type:"page-color-change",color:i}),t.to(c,.6,{opacity:0,onStart:function(){n.classList.add("transition-animation-complete")},onComplete:function(){var t,e,i=document.getElementById("project-preloader-text-fg");if(i){t=i.getElementsByTagName("path"),c.style.display="block";for(var r=0;r<t.length;r++)e=t[r].getTotalLength(),t[r].setAttribute("stroke-dashoffset",0),t[r].setAttribute("stroke-dasharray","0,"+e/2+",0,"+e/2);if(t=(i=document.getElementById("project-preloader-text-pl")).getElementsByTagName("path"),i){for(r=t.length-1;0<=r;r--)t[r].style[p]="0s",t[r].style.opacity=0;c.style.display="none",d.classList.remove("prevent-scroll"),d.removeEventListener("touchmove",T),u.classList.remove("fs"),E&&m.hasOwnProperty(E)&&(m[E].element.classList.remove("active"),E=!1),y=!1,h.dispatch({type:"transition-step-reset",animation:!1})}else console.warn("project-preloader-text-pl is missing")}else console.warn("project-preloader-text-fg is missing")}})))};return{init:function(){e(),d=document.getElementsByTagName("body")[0],p=Modernizr.prefixed("transition-delay"),i(),l.eventEmitter.subscribe(i),h.subscribe(function(t){"mutate"===t.type&&e(),"link-animation-start"===t.type&&function(t){var e,i;if(v=t.id,"project"===(y=t.animation)){if(h.dispatch({type:"words-scroll-disable"}),i=new TimelineLite,!f.hasOwnProperty(v))return console.warn("project-section with id "+v+" is missing");h.dispatch({type:"project-open",id:v}),e=f[v],i.to(e.element,.5,{onStart:function(){o.style.background=e.color,d.classList.add("prevent-scroll"),d.addEventListener("touchmove",T),h.dispatch({type:"page-name-change",id:!1}),E&&m.hasOwnProperty(E)&&m[E].element.classList.remove("active"),(E=e.id)&&m.hasOwnProperty(E)&&m[E].element.classList.add("active"),h.dispatch({type:"svg-text-change",id:"project-preloader-text-bg",text:e.text}),h.dispatch({type:"svg-text-change",id:"project-preloader-text-fg",text:e.text}),h.dispatch({type:"svg-text-change",id:"project-preloader-text-pl",text:e.text}),h.dispatch({type:"scroll-to",element:e.element,speed:.5}),e.element.classList.add("project-loading")}}),i.to(c,1,{onStart:function(){var e,i,t=document.getElementById("project-preloader-text-fg");t?(e=t.getElementsByTagName("path"),c.style.display="block",setTimeout(function(){for(var t=0;t<e.length;t++)i=e[t].getTotalLength(),e[t].setAttribute("stroke-dashoffset",i/1.5),e[t].setAttribute("stroke-dasharray",i/2+",0,"+i/2+",0")},0)):console.warn("project-preloader-text-fg is missing")},onComplete:function(){h.dispatch({type:"transition-step-1",animation:"project"})},opacity:1})}}(t)})}}}),define("page-transition/close-transition.view",["dispatcher","TweenMax","page-transition/page-transition.store","utils"],function(s,t,h,l){"use strict";var c,a,u,d,p,f={},m=!1,E=1,g=!1,v=!1,y=function(t){t.preventDefault()},e=function(){var t;if(u=document.getElementById("project-preloader-img"),c=document.getElementById("project-preloader"))if(a=c.getElementsByClassName("bg")[0],u){t=document.getElementsByClassName("project-preload-img");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="project-close-id-"+E,E++),i[n]={id:n,element:r})}(f,t[e]);for(var i in f)f.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(f,t,f[i])}else console.warn("project-preloader-img is missing");else console.warn("project-overlay element is missing!")},i=function(){var t,e,i,r,n,a,o=h.getData();!0===o.step1ready&&!1===o.step2ready&&(a=document.getElementsByClassName("page-wrapper")[0],"close"===v&&(new TimelineLite).to({},.6,{onStart:function(){a.classList.remove("transition-animation-complete"),u.classList.remove("fs-back"),u.classList.add("emulate-project")},onComplete:function(){s.dispatch({type:"transition-step-2",animation:"close"})}})),!0===o.step1ready&&!0===o.step2ready&&(e=h.getData(),i=e.scheme,r=e.pageNameId,n=document.getElementsByClassName("page-wrapper")[0],"close"===v&&(t=new TimelineLite,s.dispatch({type:"page-name-change",id:r}),s.dispatch({type:"page-color-change",color:i}),t.to({},1.2,{onStart:function(){for(var t=document.getElementsByClassName("project-preview"),e=!1,i=0;i<t.length;i++)t[i].getAttribute("data-id")===g&&(e=l.offset(t[i]).top);e?(window.scrollTo(0,e),s.dispatch({type:"words-scroll-enable"})):console.warn("project with id "+g+" is missing")}}),t.to(c,.6,{opacity:0,onStart:function(){n.classList.add("transition-animation-complete")},onComplete:function(){for(var t=document.getElementById("project-preloader-text-pl").getElementsByTagName("path"),e=t.length-1;0<=e;e--)t[e].style[p]="0s",t[e].style.opacity=0;c.style.display="none",d.classList.remove("prevent-scroll"),d.removeEventListener("touchmove",y),u.classList.remove("emulate-project"),m&&f.hasOwnProperty(m)&&(f[m].element.classList.remove("active"),m=!1),v=!1,s.dispatch({type:"transition-step-reset",animation:!1})}})))};return{init:function(){e(),d=document.getElementsByTagName("body")[0],p=Modernizr.prefixed("transition-delay"),i(),h.eventEmitter.subscribe(i),s.subscribe(function(t){"mutate"===t.type&&e(),"link-animation-start"===t.type&&function(t){var e,i,r,n;if("close"===(v=t.animation)){if(e=new TimelineLite,i=document.getElementsByClassName("home")[0],g=i.getAttribute("data-id"),r=i.getAttribute("data-color"),n=i.getAttribute("data-text"),!g)return console.warn("data-id attribute is missing");if(!f.hasOwnProperty(g))return console.warn("prelod-image with id "+g+" is missing");e.to({},.5,{onStart:function(){a.style.background=r,d.classList.add("prevent-scroll"),d.addEventListener("touchmove",y),s.dispatch({type:"words-scroll-disable"}),s.dispatch({type:"page-name-change",id:!1}),s.dispatch({type:"svg-text-change",id:"project-preloader-text-pl",text:n}),s.dispatch({type:"scroll-to",speed:.5,position:0}),m&&f.hasOwnProperty(m)&&f[m].element.classList.remove("active"),(m=g)&&f.hasOwnProperty(m)&&f[m].element.classList.add("active"),u.classList.add("fs-back")}}),e.to(c,.5,{onStart:function(){var t=document.getElementById("project-preloader-text-pl").getElementsByTagName("path");c.style.display="block";for(var e=t.length-1;0<=e;e--)t[e].style[p]="0s",t[e].style.opacity=1},opacity:1,onComplete:function(){s.dispatch({type:"transition-step-1",animation:"close"})}})}}(t)})}}}),define("page-transition/menu-transition.view",["dispatcher","TweenMax","page-transition/page-transition.store","resize/resize.store","utils"],function(l,t,c,a,e){"use strict";var u,d,i,p,r,f=!1,m=!1,n=[],o=0,s=0,E=function(t){t.preventDefault()},h=function(t){var e,i=document.getElementById("preload-imgs");p=t.scroll,i?"menu"===(f=t.animation)&&(e=new TimelineLite,l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:"menu"}),e.to(d,0,{opacity:0}),e.to(d,.6,{onStart:function(){m=!0,function(){for(var t=0;t<n.length;t++)n[t].style.opacity=0;var e=function(){m&&(++s%8==0&&(n[o].style.opacity=0,++o>=n.length&&(o=0),n[o].style.opacity=1),r(e))};e()}(),u.classList.add("prevent-scroll"),u.addEventListener("touchmove",E),d.style.display="block"},opacity:1,onComplete:function(){l.dispatch({type:"transition-step-1",animation:"menu"})}}),e.to(i,0,{opacity:1},"-=0.3")):console.warn("imgs elemeny is missing")},g=function(){var t,e,i,r,n=c.getData();!0===n.step1ready&&!1===n.step2ready&&(e=document.getElementById("simple-preloader-text"),i=a.getData().height,r=document.getElementsByClassName("page-wrapper")[0],t=new TimelineLite,"menu"===f&&(l.dispatch({type:"menu-close"}),p?window.scrollTo(0,i):window.scrollTo(0,0),t.to(e,.6,{onStart:function(){r.classList.remove("transition-animation-complete")},onComplete:function(){l.dispatch({type:"transition-step-2",animation:"menu"})},opacity:0}))),!0===n.step1ready&&!0===n.step2ready&&function(){var t,e=document.getElementById("simple-preloader-text"),i=document.getElementById("preload-imgs"),r=document.getElementsByClassName("page-wrapper")[0];if(t=new TimelineLite,"menu"===f){var n=c.getData(),a=n.scheme,o=n.pageNameId,s=n.text,h=(n.color,n.projectText);p?l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:h}):l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:s}),l.dispatch({type:"page-name-change",id:!1}),l.dispatch({type:"page-color-change",color:a}),t.to(e,.2,{}),t.to(e,.6,{opacity:1}),t.to(i,0,{opacity:0,onComplete:function(){m=!1}}),t.to(d,.6,{opacity:0,onStart:function(){r.classList.add("transition-animation-complete")},onComplete:function(){u.classList.remove("prevent-scroll"),u.removeEventListener("touchmove",E),d.style.display="none",f=!1,p?l.dispatch({type:"page-name-change",id:"projects"}):l.dispatch({type:"page-name-change",id:o}),l.dispatch({type:"transition-step-reset",animation:!1})}})}}()};return{init:function(){u=document.getElementsByTagName("body")[0],Modernizr.prefixed("transform"),r=e.getRequestAnimationFrame(),d=document.getElementById("simple-preloader"),n=document.getElementsByClassName("loop-img"),d&&(i=d.getElementsByClassName("bg"))&&i.length?i=i[0]:console.warn("simple-preloader is missing"),g(),c.eventEmitter.subscribe(g),l.subscribe(function(t){"link-animation-start"===t.type&&h(t)})}}}),define("svg-text/svg-text.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=("ABCDEFGHIJKLMNOPQRSTUVWXYZ ,.-АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ".split(""),{}),a=function(t){if("svg-text-change"===t.type){if(n.hasOwnProperty(t.id)&&n[t.id].text===t.text)return;n[t.id]={id:t.id,text:t.text},o.dispatch()}"svg-text-delete"===t.type&&n.hasOwnProperty(t.id)&&delete n[t.id]},o=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,r={A:{char:"A",width:73,spacing:173,w:800,h:700,bezier:"M267 261h182l-90 209zM303 700h115l307 -700h-162l-57 130h-293l-57 -130h-160z"},B:{char:"B",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-128h145q47 0 70.5 16t23.5 43q0 17 -5 30t-17 21.5t-32.5 13t-52.5 4.5h-132zM220 287v-142h134q70 0 98.5 17t28.5 55q0 37 -26.5 53.5t-92.5 16.5h-142zM65 700h313q69 0 115 -13t74.5 -37t40.5 -57t12 -72q0 -52 -19.5 -88t-48.5 -62q43 -20 67 -58.5 t24 -104.5q0 -55 -20.5 -94.5t-57 -64.5t-86.5 -37t-109 -12h-305v700z"},C:{char:"C",width:70,spacing:170,w:800,h:700,bezier:"M686 132q-48 -69 -126 -106.5t-172 -37.5q-82 0 -148 26t-112.5 73.5t-72 114.5t-25.5 148q0 75 26 141t73.5 115t114.5 77.5t148 28.5q97 0 171 -36.5t112 -96.5l-105 -96q-32 39 -78 59t-89 20q-47 0 -86 -15t-67 -42.5t-43.5 -66.5t-15.5 -88q0 -47 16 -86t44 -67 t66.5 -43.5t83.5 -15.5q59 0 108 24t85 69z"},D:{char:"D",width:72,spacing:172,w:800,h:700,bezier:"M220 555v-410h65q66 0 112.5 15t76 43t43 67.5t13.5 88.5q0 44 -12.5 80.5t-41.5 62t-76 39.5t-115 14h-65zM65 700h222q112 0 189.5 -27.5t124.5 -74.5t68 -108.5t21 -130.5q0 -75 -24 -140.5t-75 -114t-130 -76.5t-189 -28h-207v700z"},E:{char:"E",width:65,spacing:165,w:800,h:700,bezier:"M65 700h535v-145h-380v-130h355v-140h-355v-140h389v-145h-544v700z"},F:{char:"F",width:62,spacing:162,w:800,h:700,bezier:"M65 700h530v-145h-375v-153h350v-145h-350v-257h-155v700z"},G:{char:"G",width:74,spacing:174,w:800,h:700,bezier:"M365 392h326v-283q-51 -57 -124 -89t-158 -32q-83 0 -152.5 26t-119.5 73.5t-78.5 114.5t-28.5 148q0 75 26 141t74 115t114.5 77.5t147.5 28.5q45 0 88 -9t80 -25.5t67 -40t48 -51.5l-107 -96q-30 34 -73 53t-97 19q-96 0 -151.5 -56t-55.5 -156q0 -51 16.5 -90.5 t45.5 -66.5t69 -41t88 -14q35 0 69.5 10t62.5 30v74h-177v140z"},H:{char:"H",width:76,spacing:176,w:800,h:700,bezier:"M531 280h-311v-280h-155v700h155v-275h311v275h155v-700h-155v280z"},I:{char:"I",width:30,spacing:130,w:800,h:700,bezier:"M70 700h155v-700h-155v700z"},J:{char:"J",width:49,spacing:149,w:800,h:700,bezier:"M426 219q0 -113 -58 -172t-154 -59q-46 0 -82 11t-63 29.5t-46.5 43t-32.5 50.5l113 87q37 -76 97 -76q39 0 55 29t16 87v451h155v-481z"},K:{char:"K",width:71,spacing:171,w:800,h:700,bezier:"M65 700h155v-273l269 273h202l-304 -310l324 -390h-204l-237 286l-50 -51v-235h-155v700z"},L:{char:"L",width:61,spacing:161,w:800,h:700,bezier:"M65 700h155v-555h378v-145h-533v700z"},M:{char:"M",width:86,spacing:186,w:800,h:700,bezier:"M65 700h144l224 -335l213 335h140v-700h-155v420l-182 -279h-41l-188 282v-423h-155v700z"},N:{char:"N",width:74,spacing:174,w:800,h:700,bezier:"M555 0l-339 415v-415h-151v700h119l340 -416v416h151v-700h-120z"},O:{char:"O",width:79,spacing:179,w:800,h:700,bezier:"M191 350q0 -49 16.5 -88t44 -66.5t63.5 -42.5t76 -15q41 0 77.5 15t63.5 42.5t42.5 66.5t15.5 88t-17 88t-44.5 66.5t-63.5 42.5t-74 15q-40 0 -76 -15t-63.5 -42.5t-44 -66.5t-16.5 -88zM30 350q0 76 28 142t76.5 115t114.5 77t142 28q75 0 140.5 -27.5t114.5 -75.5 t77 -114.5t28 -144.5q0 -77 -28 -143.5t-77 -115t-114.5 -76t-140.5 -27.5t-141 27.5t-114.5 75.5t-77 114.5t-28.5 144.5z"},P:{char:"P",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-190h133q73 0 105.5 25t32.5 70q0 21 -7 38t-22.5 30t-40.5 20t-62 7h-139zM65 0v700h290q89 0 146.5 -21.5t91 -56t46.5 -77.5t13 -86q0 -44 -15.5 -87t-50.5 -77t-91.5 -54.5t-139.5 -20.5h-135v-220h-155z"},Q:{char:"Q",width:79,spacing:179,w:800,h:700,bezier:"M191 350q0 -49 15 -88t42 -66.5t63.5 -42.5t79.5 -15q27 0 41 3.5t29 9.5l-56 64l98 83l56 -68q16 23 23.5 53.5t7.5 66.5q0 49 -15 88t-41.5 66.5t-63 42.5t-79.5 15t-79.5 -15t-63.5 -42.5t-42 -66.5t-15 -88zM30 350q0 76 27 142t75.5 115t114.5 77t144 28 q80 0 146 -27.5t113.5 -75.5t74 -114.5t26.5 -144.5q0 -69 -22 -130t-70 -112l60 -74l-108 -87l-64 78q-35 -17 -74 -27t-82 -10q-80 0 -146.5 26t-114 73t-74 114t-26.5 149z"},R:{char:"R",width:69,spacing:169,w:800,h:700,bezier:"M220 555v-171h131q57 0 88 23t31 65q0 19 -5.5 34t-20 26t-38.5 17t-61 6h-125zM65 0v700h283q84 0 138.5 -19.5t86.5 -51t45 -73t13 -84.5q0 -68 -37 -124t-100 -81l195 -267h-187l-171 239h-111v-239h-155z"},S:{char:"S",width:62,spacing:162,w:800,h:700,bezier:"M429 194q0 31 -29 48t-72 30t-94 27t-94 38t-72 63t-29 103q0 42 19 80.5t54 68t85.5 47t112.5 17.5q90 0 159.5 -34.5t114.5 -94.5l-104 -100q-30 33 -73.5 58.5t-102.5 25.5q-54 0 -79.5 -18t-25.5 -48q0 -27 29 -42t72 -27t94 -26t94 -38t72 -63.5t29 -102.5 q0 -48 -20 -88.5t-55.5 -70t-84 -46.5t-105.5 -17q-63 0 -115 14t-92.5 37.5t-69.5 54.5t-47 65l113 94q35 -56 88.5 -88t118.5 -32q59 0 84 19.5t25 45.5z"},T:{char:"T",width:61,spacing:161,w:800,h:700,bezier:"M0 700h604v-145h-225v-555h-155v555h-224v145z"},U:{char:"U",width:72,spacing:172,w:800,h:700,bezier:"M665 300q0 -82 -25.5 -140.5t-67.5 -95.5t-95.5 -54t-108.5 -17q-63 0 -119.5 19.5t-99.5 59t-68.5 98t-25.5 136.5v394h155v-376q0 -41 10 -75.5t30 -59t49.5 -38t68.5 -13.5q76 0 109 49t33 133v380h155v-400z"},V:{char:"V",width:73,spacing:173,w:800,h:700,bezier:"M427 0h-108l-329 700h171l213 -464l199 464h167z"},W:{char:"W",width:98,spacing:198,w:800,h:700,bezier:"M764 0h-126l-149 424l-145 -424h-126l-218 700h160l128 -422l140 422h124l143 -419l122 419h154z"},X:{char:"X",width:71,spacing:171,w:800,h:700,bezier:"M446 355l261 -355h-189l-164 229l-165 -229h-189l262 355l-251 345h187l157 -217l156 217h188z"},Y:{char:"Y",width:70,spacing:170,w:800,h:700,bezier:"M426 251v-251h-155v251l-281 449h185l176 -280l180 280h179z"},Z:{char:"Z",width:64,spacing:164,w:800,h:700,bezier:"M27 700h579v-103l-373 -452h382v-145h-605v103l371 452h-354v145z"},"А":{char:"А",width:73,spacing:173,w:800,h:700,bezier:"M267 261h182l-90 209zM303 700h115l307 -700h-162l-57 130h-293l-57 -130h-160z"},"Б":{char:"Б",width:67,spacing:167,w:800,h:700,bezier:"M220 296v-151h135q64 0 94 18t30 61q0 39 -27 55.5t-91 16.5h-141zM592 555h-372v-114h176q124 0 184 -57t60 -159q0 -117 -75.5 -171t-215.5 -54h-284v700h527v-145z"},"В":{char:"В",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-128h145q47 0 70.5 16t23.5 43q0 17 -5 30t-17 21.5t-32.5 13t-52.5 4.5h-132zM220 287v-142h134q70 0 98.5 17t28.5 55q0 37 -26.5 53.5t-92.5 16.5h-142zM65 700h313q69 0 115 -13t74.5 -37t40.5 -57t12 -72q0 -52 -19.5 -88t-48.5 -62q43 -20 67 -58.5 t24 -104.5q0 -55 -20.5 -94.5t-57 -64.5t-86.5 -37t-109 -12h-305v700z"},"Г":{char:"Г",width:59,spacing:159,w:800,h:700,bezier:"M65 700h525v-145h-370v-555h-155v700zM298 516q-3 -126 -20 -222t-40 -149h267v410h-206zM2 145h76q10 21 22.5 57.5t23.5 93.5t19 136t8 184v84h509v-555h81v-262h-145v117h-449v-117h-145v262z"},"Д":{char:"Д",width:76,spacing:176,w:800,h:700,bezier:"M298 516q-3 -126 -20 -222t-40 -149h267v410h-206zM2 145h76q10 21 22.5 57.5t23.5 93.5t19 136t8 184v84h509v-555h81v-262h-145v117h-449v-117h-145v262z"},"Е":{char:"Е",width:65,spacing:165,w:800,h:700,bezier:"M65 700h535v-145h-380v-130h355v-140h-355v-140h389v-145h-544v700z"},"Ё":{char:"Ё",width:65,spacing:165,w:800,h:700,bezier:"M65 700h535v-145h-380v-130h355v-140h-355v-140h389v-145h-544v700zM364 831q0 33 25.5 54.5t59.5 21.5q31 0 56.5 -20.5t25.5 -55.5t-25.5 -56t-56.5 -21q-34 0 -59.5 21t-25.5 56zM115 831q0 33 24.5 54.5t60.5 21.5q15 0 30 -5.5t27 -16t19 -24.5t7 -30q0 -35 -26 -56 t-57 -21q-36 0 -60.5 21t-24.5 56z"},"Ж":{char:"Ж",width:99,spacing:199,w:800,h:700,bezier:"M-4 700h190l232 -277v277h155v-279l229 279h192l-280 -325l278 -375h-184l-215 286l-20 -30v-256h-155l1 255l-19 27l-225 -282h-176l277 360z"},"З":{char:"З",width:66,spacing:166,w:800,h:700,bezier:"M338 -12q-109 0 -194.5 35.5t-143.5 121.5l123 83q36 -48 87 -71.5t124 -23.5q39 0 64.5 5.5t41.5 16t22.5 24t6.5 30.5q0 40 -37 57.5t-109 17.5h-110v145h104q63 0 96 18t33 47q0 22 -12 36t-30 22t-39.5 11.5t-41.5 3.5q-61 0 -102 -19t-76 -58l-120 81 q47 64 120 102.5t187 38.5q133 0 201.5 -54t68.5 -150q0 -44 -16 -77t-56 -56q31 -12 49.5 -30.5t28.5 -39.5t13.5 -43.5t3.5 -43.5q0 -54 -21 -96.5t-59 -72.5t-90.5 -45.5t-116.5 -15.5z"},"И":{char:"И",width:76,spacing:176,w:800,h:700,bezier:"M65 0v700h155v-429l339 429h129v-700h-155v427l-341 -427h-127z"},"Й":{char:"Й",width:76,spacing:176,w:800,h:700,bezier:"M65 0v700h155v-429l339 429h129v-700h-155v427l-341 -427h-127zM323 893q7 -29 22.5 -40t37.5 -11q21 0 39.5 12t22.5 39h130q-2 -35 -19.5 -65t-43.5 -52t-58.5 -34.5t-64.5 -12.5q-46 0 -80.5 12.5t-58.5 34.5t-38 52t-19 65h130z"},"К":{char:"К",width:71,spacing:171,w:800,h:700,bezier:"M65 700h155v-273l269 273h202l-304 -310l324 -390h-204l-237 286l-50 -51v-235h-155v700z"},"Л":{char:"Л",width:73,spacing:173,w:800,h:700,bezier:"M507 550h-219l-4 -81q-5 -108 -16 -185.5t-27.5 -130t-37.5 -83.5t-47.5 -47t-57.5 -21t-66 -5q-9 0 -19.5 0.5t-20.5 2.5v144q14 -2 25 -2q12 0 27.5 2.5t31 18.5t26.5 48t18 86t10.5 133.5t5.5 190.5l1 79h525v-700h-155v550z"},"М":{char:"М",width:86,spacing:186,w:800,h:700,bezier:"M65 700h144l224 -335l213 335h140v-700h-155v420l-182 -279h-41l-188 282v-423h-155v700z"},"Н":{char:"Н",width:76,spacing:176,w:800,h:700,bezier:"M531 280h-311v-280h-155v700h155v-275h311v275h155v-700h-155v280z"},"О":{char:"О",width:79,spacing:179,w:800,h:700,bezier:"M191 350q0 -49 16.5 -88t44 -66.5t63.5 -42.5t76 -15q41 0 77.5 15t63.5 42.5t42.5 66.5t15.5 88t-17 88t-44.5 66.5t-63.5 42.5t-74 15q-40 0 -76 -15t-63.5 -42.5t-44 -66.5t-16.5 -88zM30 350q0 76 28 142t76.5 115t114.5 77t142 28q75 0 140.5 -27.5t114.5 -75.5 t77 -114.5t28 -144.5q0 -77 -28 -143.5t-77 -115t-114.5 -76t-140.5 -27.5t-141 27.5t-114.5 75.5t-77 114.5t-28.5 144.5z"},"П":{char:"П",width:75,spacing:175,w:800,h:700,bezier:"M530 555h-310v-555h-155v700h620v-700h-155v555z"},"Р":{char:"Р",width:68,spacing:168,w:800,h:700,bezier:"M220 555v-190h133q73 0 105.5 25t32.5 70q0 21 -7 38t-22.5 30t-40.5 20t-62 7h-139zM65 0v700h290q89 0 146.5 -21.5t91 -56t46.5 -77.5t13 -86q0 -44 -15.5 -87t-50.5 -77t-91.5 -54.5t-139.5 -20.5h-135v-220h-155z"},"С":{char:"С",width:70,spacing:170,w:800,h:700,bezier:"M686 132q-48 -69 -126 -106.5t-172 -37.5q-82 0 -148 26t-112.5 73.5t-72 114.5t-25.5 148q0 75 26 141t73.5 115t114.5 77.5t148 28.5q97 0 171 -36.5t112 -96.5l-105 -96q-32 39 -78 59t-89 20q-47 0 -86 -15t-67 -42.5t-43.5 -66.5t-15.5 -88q0 -47 16 -86t44 -67 t66.5 -43.5t83.5 -15.5q59 0 108 24t85 69z"},"Т":{char:"Т",width:61,spacing:161,w:800,h:700,bezier:"M0 700h604v-145h-225v-555h-155v555h-224v145z"},"У":{char:"У",width:73,spacing:173,w:800,h:700,bezier:"M728 700l-254 -536q-19 -39 -38.5 -69.5t-43.5 -51.5t-52.5 -32t-65.5 -11q-34 0 -71.5 16.5t-69.5 63.5l100 91q17 -26 43 -26q12 0 25 8t25 34l-326 513h192l213 -348l161 348h162z"},"Ф":{char:"Ф",width:90,spacing:190,w:800,h:700,bezier:"M185 360q0 -29 10.5 -56t33 -47.5t57.5 -33t83 -12.5h3v298q-102 0 -144.5 -36.5t-42.5 -112.5zM527 509v-298h6q89 0 135 36.5t46 112.5q0 72 -41.5 110.5t-143.5 38.5h-2zM372 66h-4q-78 0 -141.5 21t-108.5 59.5t-69 93t-24 120.5q0 71 23.5 125.5t68.5 92t109.5 57 t145.5 19.5v61h155v-61q75 0 138.5 -18t110 -54.5t72.5 -92t26 -129.5q0 -66 -24 -120t-68 -93t-107 -60t-142 -21h-6v-81h-155v81z"},"Х":{char:"Х",width:71,spacing:171,w:800,h:700,bezier:"M446 355l261 -355h-189l-164 229l-165 -229h-189l262 355l-251 345h187l157 -217l156 217h188z"},"Ц":{char:"Ц",width:75,spacing:175,w:800,h:700,bezier:"M65 700h155v-555h283v555h155v-555h81v-262h-144v117h-530v700z"},"Ч":{char:"Ч",width:71,spacing:171,w:800,h:700,bezier:"M644 0h-155v263q-29 -15 -75 -27t-96 -12q-59 0 -109.5 13.5t-88 42t-59 74t-21.5 110.5v236h156v-138q0 -54 8.5 -91t25.5 -59.5t44 -32.5t65 -10t79 11t71 31v289h155v-700z"},"Ш":{char:"Ш",width:95,spacing:195,w:800,h:700,bezier:"M65 700h155v-555h177v555h155v-555h177v555h155v-700h-819v700z"},"Щ":{char:"Щ",width:98,spacing:198,w:800,h:700,bezier:"M65 700h155v-555h178v555h155v-555h178v555h155v-555h81v-262h-145v117h-757v700z"},"Ъ":{char:"Ъ",width:75,spacing:175,w:800,h:700,bezier:"M308 323v-178h124q69 0 103.5 19t34.5 72q0 45 -33.5 66t-101.5 21h-127zM0 700h308v-232h129q294 0 294 -232q0 -61 -20.5 -105.5t-59.5 -73.5t-95.5 -43t-127.5 -14h-275v555h-153v145z"},"Ы":{char:"Ы",width:90,spacing:190,w:800,h:700,bezier:"M220 468h104q74 0 129 -16.5t92 -47t55 -73.5t18 -95q0 -118 -80 -177t-223 -59h-250v700h155v-232zM220 323v-178h99q69 0 103.5 19t34.5 72q0 45 -33.5 66t-102.5 21h-101zM680 700h155v-700h-155v700z"},"Ь":{char:"Ь",width:66,spacing:166,w:800,h:700,bezier:"M221 468h132q149 0 221.5 -58.5t72.5 -173.5q0 -117 -80 -176.5t-222 -59.5h-280v700h156v-232zM221 323v-178h127q138 0 138 91q0 45 -33.5 66t-101.5 21h-130z"},"Э":{char:"Э",width:71,spacing:171,w:800,h:700,bezier:"M207 430h308q-17 61 -68.5 97t-132.5 36q-23 0 -50 -4.5t-54 -14.5t-52.5 -27.5t-46.5 -42.5l-102 100q26 35 61 60t75.5 41.5t85 24.5t89.5 8q82 0 148.5 -25t112.5 -71t71 -112t25 -147q0 -78 -24.5 -144t-71 -114.5t-114.5 -75.5t-155 -27q-38 0 -79.5 6.5t-83 23.5 t-80 46t-69.5 74l103 88q19 -27 44.5 -45t53.5 -28.5t57.5 -15t57.5 -4.5q82 0 136 40t65 108h-310v145z"},"Ю":{char:"Ю",width:102,spacing:202,w:800,h:700,bezier:"M443 350q0 -49 14.5 -88.5t40.5 -67t61 -42.5t76 -15q87 0 137.5 57.5t50.5 155.5q0 49 -13.5 88t-38.5 67t-59.5 43t-76.5 15q-41 0 -76.5 -15t-61 -43t-40 -67t-14.5 -88zM65 700h155v-278h71q11 62 41 114.5t75 90.5t103 59.5t125 21.5q80 0 144.5 -26.5t110 -74.5 t70 -113.5t24.5 -143.5q0 -77 -26.5 -142.5t-73 -113.5t-110.5 -75t-139 -27q-69 0 -128 20t-104 58t-74.5 93.5t-38.5 126.5h-70v-290h-155v700z"},"Я":{char:"Я",width:71,spacing:171,w:800,h:700,bezier:"M481 376v179h-147q-67 0 -95 -23t-28 -67q0 -37 31.5 -63t85.5 -26h153zM481 231h-119l-179 -231h-183l206 260q-75 23 -115.5 74.5t-40.5 129.5q0 50 18 93t55 75t91.5 50t128.5 18h293v-700h-155v231z"},space:{char:" ",width:24,spacing:124,w:800,h:700,bezier:""},comma:{char:",",width:27,spacing:127,w:800,h:700,bezier:"M96 -5q-25 9 -43 32t-18 53q0 40 25 61.5t71 21.5q45 0 69 -29t24 -75q0 -44 -14.5 -80t-38 -62.5t-52.5 -43t-59 -22.5l-40 87q10 2 22.5 6.5t23.5 11t19 16.5t11 23z"},period:{char:".",width:29,spacing:129,w:800,h:700,bezier:"M50 81q0 15 6.5 30.5t19 27.5t30 19.5t38.5 7.5q19 0 36 -7.5t29.5 -19.5t19.5 -27.5t7 -30.5q0 -17 -7 -32.5t-19.5 -27.5t-29.5 -19.5t-36 -7.5q-43 0 -68.5 26.5t-25.5 60.5z"},hyphen:{char:"-",width:43,spacing:143,w:800,h:700,bezier:"M60 347h304v-130h-304v130z"}},t.subscribe(a)),{eventEmitter:o,getData:function(){return{lettersData:r,items:n}}}}),define("page-transition/simple-transition.view",["dispatcher","TweenMax","page-transition/page-transition.store","resize/resize.store","utils","svg-text/svg-text.store"],function(l,t,c,a,e,o){"use strict";var u,d,i,p,s,f=!1,m=!1,h=[],E=0,g=0,v=function(t){t.preventDefault()},r=function(t){var e,i,r=document.getElementById("preload-imgs"),n=o.getData();n.hasOwnProperty("stage-svg-text")?i=n.items["stage-svg-text"].text:i=document.getElementsByClassName("home")[0].getAttribute("data-text"),p=t.scroll,r?"simple"===(f=t.animation)&&(e=new TimelineLite,l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:i}),e.to(d,0,{opacity:0}),e.to(d,.6,{onStart:function(){m=!0,function(){for(var t=0;t<h.length;t++)h[t].style.opacity=0;var e=function(){m&&(++g%8==0&&(h[E].style.opacity=0,++E>=h.length&&(E=0),h[E].style.opacity=1),s(e))};e()}(),u.classList.add("prevent-scroll"),u.addEventListener("touchmove",v),d.style.display="block"},opacity:1,onComplete:function(){l.dispatch({type:"transition-step-1",animation:"menu"})}}),e.to(r,0,{opacity:1},"-=0.3")):console.warn("imgs elemeny is missing")},n=function(){var t,e,i,r,n=c.getData();!0===n.step1ready&&!1===n.step2ready&&(e=document.getElementById("simple-preloader-text"),i=a.getData().height,r=document.getElementsByClassName("page-wrapper")[0],t=new TimelineLite,"simple"===f&&(l.dispatch({type:"menu-close"}),p?window.scrollTo(0,i):window.scrollTo(0,0),t.to(e,.6,{onStart:function(){r.classList.remove("transition-animation-complete")},onComplete:function(){l.dispatch({type:"transition-step-2",animation:"menu"})},opacity:0}))),!0===n.step1ready&&!0===n.step2ready&&function(){var t,e=document.getElementById("simple-preloader-text"),i=document.getElementById("preload-imgs"),r=document.getElementsByClassName("page-wrapper")[0];if(t=new TimelineLite,"simple"===f){var n=c.getData(),a=n.scheme,o=n.pageNameId,s=n.text,h=(n.color,n.projectText);p?l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:h}):l.dispatch({type:"svg-text-change",id:"simple-preloader-text",text:s}),p?window.scrollTo(0,wh):window.scrollTo(0,0),l.dispatch({type:"page-name-change",id:!1}),l.dispatch({type:"page-color-change",color:a}),t.to(e,.2,{}),t.to(e,.6,{opacity:1}),t.to(i,0,{opacity:0,onComplete:function(){m=!1}}),t.to(d,.6,{onStart:function(){r.classList.add("transition-animation-complete")},opacity:0,onComplete:function(){u.classList.remove("prevent-scroll"),u.removeEventListener("touchmove",v),d.style.display="none",f=!1,p?l.dispatch({type:"page-name-change",id:"projects"}):l.dispatch({type:"page-name-change",id:o}),l.dispatch({type:"transition-step-reset",animation:!1})}})}}()};return{init:function(){u=document.getElementsByTagName("body")[0],Modernizr.prefixed("transform"),s=e.getRequestAnimationFrame(),d=document.getElementById("simple-preloader"),h=document.getElementsByClassName("loop-img"),d&&(i=d.getElementsByClassName("bg"))&&i.length?i=i[0]:console.warn("simple-preloader is missing"),n(),c.eventEmitter.subscribe(n),l.subscribe(function(t){"link-animation-start"===t.type&&r(t)})}}}),define("preload/preload.store",["dispatcher"],function(t){"use strict";var i,e=!1,r=!1,n=function(t){if("preload-complete"===t.type){if(r)return;r=!0,a.dispatch()}if("preload-reset"===t.type){if(!r)return;r=!1}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e||(e=!0,t.subscribe(n))),{eventEmitter:a,getData:function(){return{complete:r}}}}),define("video/video.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=function(t){if("video-add"===t.type){if(r.hasOwnProperty(t.id))return;r[t.id]={id:t.id,status:"not-ready"}}if("video-remove"===t.type){if(!r.hasOwnProperty(t.id))return;delete r[t.id]}"video-ready"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="ready",a.dispatch({type:"change"})),"video-play"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="play",a.dispatch({type:"change"})),"video-stop"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="stop",a.dispatch({type:"change"})),"video-reset"===t.type&&r.hasOwnProperty(t.id)&&(r[t.id].status="not-ready",a.dispatch({type:"change"}))},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(r={},e||(e=!0,t.subscribe(n))),{eventEmitter:a,getData:function(){return{items:r}}}}),define("preload/preload.view",["dispatcher","preload/preload.store","images/images.store","video/video.store"],function(e,i,n,a){"use strict";var r,o,s,h={},l={},c=0,u=!1,d=1,p=function(){var t=i.getData();u!==t.complete&&(u=t.complete,r.classList.add("load-complete"),r.classList.add("load-complete-once"),e.dispatch({type:"transition-step-2"}))},f=function(){var t;(t=Date.now()-s+0)<0&&(t=0),setTimeout(function(){e.dispatch({type:"preload-complete"})},t+500)},m=function(){var t,e=n.getData(),i=0;for(var r in h)h.hasOwnProperty(r)&&(t=h[r],e.items.hasOwnProperty(t.id)&&(t.loaded||e.items[t.id].loaded&&(i++,t.loaded=!0)));c<=i&&f()},E=function(){var t,e=a.getData(),i=0;for(var r in l)l.hasOwnProperty(r)&&(t=l[r],e.items.hasOwnProperty(t.id)&&(t.loaded||"not-ready"!==e.items[t.id].status&&(i++,t.loaded=!0)));c<=i&&f()},g=function(t,e){var i=t.getAttribute("data-preload-id");i||(i="preload-image-id-"+d,d++,t.setAttribute("data-preload-id",i)),e[i]={id:i,element:t,loaded:!1}},v=function(){r=document.querySelector(".page-wrapper"),o=document.querySelectorAll(".wait-load-image"),h={},c=0,u=!(l={}),r.classList.remove("load-complete"),e.dispatch({type:"preload-reset"}),c=o.length,s=Date.now();for(var t=0;t<o.length;t++)g(o[t],h);o=document.querySelectorAll(".wait-load-video"),c+=o.length;for(t=0;t<o.length;t++)g(o[t],l);0===c&&f()};return{init:function(){v(),p(),m(),E(),i.eventEmitter.subscribe(p),n.eventEmitter.subscribe(m),a.eventEmitter.subscribe(E),e.subscribe(function(t){"mutate"===t.type&&(v(),p(),m(),E())})}}}),define("trigger/trigger.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=function(t){if("trigger-element-add"===t.type&&(r[t.id]={id:t.id,triggered:!1}),"trigger-element-remove"===t.type&&delete r[t.id],"trigger-element"===t.type){if(!r.hasOwnProperty(t.id))return;if(!0===r[t.id].triggered)return;r[t.id].triggered=!0,a.dispatch()}if("untrigger-element"===t.type){if(!r.hasOwnProperty(t.id))return;if(!1===r[t.id].triggered)return;r[t.id].triggered=!1,a.dispatch()}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,t.subscribe(n)),{eventEmitter:a,getData:function(){return{items:r}}}}),define("trigger/trigger.view",["dispatcher","trigger/trigger.store"],function(t,r){"use strict";var n={},s=1,e=function(){var t,e=r.getData();for(var i in n)n.hasOwnProperty(i)&&(t=n[i],e.items.hasOwnProperty(t.id)&&t.triggered!==e.items[t.id].triggered&&(t.triggered=e.items[t.id].triggered,t.triggered?(t.element.classList.add("triggered"),t.element.classList.add("triggered-once")):t.element.classList.remove("triggered")))},i=function(){var t;t=document.getElementsByClassName("triggerable");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-trigger-id"))||(n="trigger-id-"+s,s++,r.setAttribute("data-trigger-id",n)),i[n]={id:n,element:r,triggered:!1})}(n,t[e]);for(var i in n)n.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(n,t,n[i])};return{init:function(){i(),e(),r.eventEmitter.subscribe(e),t.subscribe(function(t){"mutate"===t.type&&(i(),e())})}}}),define("trigger/scroll-trigger.view",["dispatcher","scroll/scroll.store","resize/resize.store","utils","trigger/trigger.store","preload/preload.store","images/images.store"],function(u,e,n,d,t,i,r){"use strict";var a,o,s,h,l,c={},p=1,f=0,m=!1,E=function(){var t=e.getData();s=t.top,h=s+a},g=function(){m&&(f!==h&&(h=Math.floor(h),f=Math.floor(f),f+=(h-f)/20,function(){for(var t in l&&(l.style.top=f+"px"),c)c.hasOwnProperty(t)&&(e=c[t],i=d.offset(e.element).top,e.offset=i,"bottom"===e.pos&&(f-50>e.offset&&(e.triggered||(e.triggered=!0,u.dispatch({type:"trigger-element",id:e.id,me:"scroll-trigger"}))),f-50<=e.offset&&e.triggered&&(e.triggered=!1,u.dispatch({type:"untrigger-element",me:"scroll-trigger",id:e.id}))));var e,i}()),o(g))},v=function(){for(var t in a=n.getData().height,h=s+a,c)c.hasOwnProperty(t)&&(e=c[t],void 0,i=d.offset(e.element).top,r=e.element.clientHeight,e.height=r,e.offset=i);var e,i,r},y=function(){var t;t=document.getElementsByClassName("scroll-trigger");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s,h,l=!1;for(var c in t)if(t.hasOwnProperty(c)&&t[c].element===e){l=!0;break}l||(i=t,n=(r=e).getAttribute("data-trigger-id"),a=d.offset(r).top,o=r.clientHeight,s=r.getAttribute("data-pos")||"bottom",(h=r.getAttribute("data-shift"))||(h=0),h=parseInt(h),n||(n="scroll-trigger-id-"+p,p++,r.setAttribute("data-trigger-id",n)),u.dispatch({type:"trigger-element-add",id:n}),i[n]={id:n,element:r,height:o,offset:a,pos:s,shift:h,triggered:!1})}(c,t[e]);for(var i in c)c.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}var a,o;r||(a=t,o=i,u.dispatch({type:"trigger-element-remove",id:o.id}),delete a[o.id])}(c,t,c[i]);m=!0,setTimeout(function(){g()},0)};return{init:function(){y(),l=document.getElementById("scroll-helper"),f=0,o=d.getRequestAnimationFrame(),v(),E(),r.eventEmitter.subscribe(v),n.eventEmitter.subscribe(v),e.eventEmitter.subscribe(E),u.subscribe(function(t){"link-animation-start"===t.type&&(f=0,m=!1),"mutate"===t.type&&(y(),v(),E())})}}}),define("form/form.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=function(t){if("ajax-form-add"===t.type&&(r[t.id]={id:t.id,status:"waiting"}),"ajax-form-remove"===t.type){if(!r.hasOwnProperty(t.id))return;delete r[t.id]}if("ajax-form-send"===t.type){if(!r.hasOwnProperty(t.id))return;if("sending"===r[t.id].status)return;r[t.id].status="sending",a.dispatch()}if("ajax-form-submit"===t.type){if(!r.hasOwnProperty(t.id))return;if("submitted"===r[t.id].status)return;r[t.id].status="submitted",a.dispatch()}if("ajax-form-reset"===t.type){if(!r.hasOwnProperty(t.id))return;if("waiting"===r[t.id].status)return;r[t.id].status="waiting",a.dispatch()}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,t.subscribe(n)),{eventEmitter:a,getData:function(){return{items:r}}}}),define("form/form.view",["dispatcher","form/form.store","utils"],function(o,n,a){"use strict";var s={},h=1,e=function(){var t,e,i=n.getData();for(var r in s)s.hasOwnProperty(r)&&(t=s[r],void 0,e=t.id,i.items.hasOwnProperty(e)&&i.items[e].status!==s[e].status&&(s[e].status=i.items[e].status,t.element.classList.remove("waiting"),t.element.classList.remove("sending"),t.element.classList.remove("submitted"),t.element.classList.add(s[e].status)))},l=function(t,e){var r,n,i=e.getAttribute("data-id");i||(i="form-id-"+h,h++),o.dispatch({type:"ajax-form-add",id:i}),t[i]={id:i,element:e,status:!1},r=t[i],n=r.element,r.element.addEventListener("submit",function(t){var e,i=n.action;!function(t){for(var e=!0,i=t.getElementsByTagName("input"),r=t.getElementsByTagName("textarea"),n=!1,a=function(t){t.getAttribute("data-required")&&(t.value&&""!==t.value||(t.parentNode.classList.add("error"),e=!1))},o=function(t){t.getAttribute("data-binded")&&t.value&&""!==t.value&&(n?t.value!==n&&(t.parentNode.classList.add("error"),e=!1):n=t.value)},s=0;s<i.length;s++)a(i[s]),o(i[s]);for(s=0;s<r.length;s++)a(r[s]),o(r[s]);return e}(n)||"waiting"!==r.status?t.preventDefault():FormData&&(t.preventDefault(),(e=new FormData(n)).append("test","test"),console.dir(e),o.dispatch({type:"ajax-form-send",id:r.id}),a.ajax.send(i,function(t){var e=JSON.parse(t);o.dispatch({type:"ajax-form-submit",id:r.id,response:e}),o.dispatch({type:"ajax-server-responce",response:e}),e.hasOwnProperty("status")&&"error"!==e.status&&"success-reset"!==e.status||setTimeout(function(){o.dispatch({type:"ajax-form-reset",id:r.id})},3e3)},"POST",e,!0))},!1)},i=function(){var t;t=document.getElementsByClassName("view-form");for(var e=0;e<t.length;e++)!function(t,e){var i=!1;for(var r in t)if(t.hasOwnProperty(r)&&t[r].element===e){i=!0;break}i||l(t,e)}(s,t[e]);for(var i in s)s.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}var a;r||(delete t[(a=i).id],o.dispatch({type:"ajax-form-remove",id:a.id}))}(s,t,s[i])};return{init:function(){i(),e(),n.eventEmitter.subscribe(e),o.subscribe(function(t){"mutate"===t.type&&(i(),e())})}}}),define("form/form-focus.view",["dispatcher"],function(t){"use strict";var a={},s=1,e=function(){var t,e=Array.prototype.slice.call(document.getElementsByTagName("input")),i=Array.prototype.slice.call(document.getElementsByTagName("textarea"));t=e.concat(i);for(var r=0;r<t.length;r++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,n=(r=e).getAttribute("data-id"),r.addEventListener("focus",function(){r.parentNode.classList.remove("error"),r.parentNode.classList.add("focus")},!1),r.addEventListener("blur",function(){r.parentNode.classList.remove("focus")},!1),r.addEventListener("keyup",function(){r.value?r.parentNode.classList.add("not-empty"):r.parentNode.classList.remove("not-empty")},!1),n||(n="input-id-"+s,s++),i[n]={id:n,element:r})}(a,t[r]);for(var n in a)a.hasOwnProperty(n)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(a,t,a[n])};return{init:function(){e(),t.subscribe(function(t){"mutate"===t.type&&e()})}}}),define("form/form-responce.view",["dispatcher"],function(t){"use strict";var r={},s=1,e=function(){var t;t=document.getElementsByClassName("view-form-response");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="responce-id-"+s,s++),i[n]={id:n,element:r})}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){e(),t.subscribe(function(t){"mutate"===t.type&&e(),"ajax-form-submit"===t.type&&function(t){var e;if(t.response.hasOwnProperty("response")&&""!==t.response.response){if(!r.hasOwnProperty(t.id))return;e=r[t.id].element.getElementsByClassName("responce-inner"),"success"===t.response.status&&(e.innerHTML=t.response.response,r[t.id].element.classList.remove("status-error"),r[t.id].element.classList.add("status-success"),r[t.id].element.classList.add("active")),"error"===t.response.status&&(e.innerHTML=t.response.response,r[t.id].element.classList.add("status-error"),r[t.id].element.classList.remove("status-success"),r[t.id].element.classList.add("active"))}else{if(!r.hasOwnProperty(t.id))return;e.innerHTML="",r[t.id].element.classList.remove("active")}if("ajax-form-reset"===t.type){if(!r.hasOwnProperty(t.id))return;e.innerHTML="",r[t.id].element.classList.remove("active")}}(t)})}}}),define("sidenav/sidenav.view",["dispatcher","scroll/scroll.store","resize/resize.store"],function(r,n,t){"use strict";var a,o,s,h,l,c=[],u=!1,d=!0,e=function(){var t=n.getData().top,e=Math.floor((t+o/2)/o);if(s<=t+o+10&&d&&(d=!1,h&&h.classList.add("hidden")),t+o+10<s&&!d&&(d=!0,h&&h.classList.remove("hidden")),e!==u){u=e;for(var i=0;i<e-1;i++)c[i]&&(c[i].classList.add("viewed"),c[i].classList.remove("active"));c[u-1]&&(c[u-1].classList.add("active"),c[u-1].classList.remove("viewed"));for(i=u;i<c.length;i++)c[i]&&(c[i].classList.remove("viewed"),c[i].classList.remove("active"))}},i=function(){o=t.getData().height,s=o*(l+1)},p=function(t,e){t.addEventListener("click",function(t){r.dispatch({type:"scroll-to",position:o*(e+1)})})},f=function(){var i,t=document.getElementsByClassName("sidenav")[0];if(t!==a&&(h=!(d=!(u=!(c=[]))),a=t)){c=a.getElementsByClassName("item"),l=c.length,h=a.getElementsByClassName("scroll-link")[0],(i=h).addEventListener("click",function(){var t=n.getData().top,e=Math.floor(t/o);i.classList.contains("hidden")||(e++,r.dispatch({type:"scroll-to",position:e*o}))});for(var e=0;e<c.length;e++)c[e].style.height=100/l+"%";for(e=0;e<c.length;e++)p(c[e],e)}};return{init:function(){f(),i(),e(),n.eventEmitter.subscribe(e),t.eventEmitter.subscribe(i),t.eventEmitter.subscribe(e),r.subscribe(function(t){"mutate"===t.type&&(f(),i(),e())})}}}),define("page-name/page-name.store",["dispatcher"],function(t){"use strict";var i,e=!1,r=!1,n=!1,a=function(t){if("page-name-change"===t.type){if(t.id===r)return;r=t.id,n=!!r,o.dispatch()}},o=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,t.subscribe(a)),{eventEmitter:o,getData:function(){return{active:r,containerActive:n}}}}),define("sidenav/sidenav-hide.view",["dispatcher","page-name/page-name.store"],function(t,e){"use strict";var i,r=!1,n=function(){var t=e.getData().active;i&&("projects"!==t||r||(r=!0,i.classList.add("visible")),"projects"!==t&&r&&(r=!1,i.classList.remove("visible")))},a=function(){var t=document.getElementsByClassName("sidenav")[0];t!==i&&(r=!1,i=t)};return{init:function(){a(),n(),e.eventEmitter.subscribe(n),t.subscribe(function(t){"mutate"===t.type&&(a(),n())})}}}),define("slider/slider.store",["dispatcher"],function(t){"use strict";var i,e={},r=!1,n=function(t){if("slider-add"===t.type&&(e[t.id]={id:t.id,total:t.total||0,index:t.index||0,continious:t.continious||!1}),"slider-remove"===t.type&&delete e[t.id],"slider-change-next"===t.type){if(!e.hasOwnProperty(t.id))return;e[t.id].index++,e[t.id].continious?e[t.id].index>e[t.id].total&&(e[t.id].index=0):e[t.id].index>e[t.id].total&&(e[t.id].index=e[t.id].total),a.dispatch()}if("slider-change-prev"===t.type){if(!e.hasOwnProperty(t.id))return;e[t.id].index--,e[t.id].continious?e[t.id].index<0&&(e[t.id].index=e[t.id].total):e[t.id].index<0&&(e[t.id].index=0),a.dispatch()}if("slider-change-to"===t.type){if(!e.hasOwnProperty(t.id))return;if(e[t.id].index!==t.index){if(t.index>(e[t.id].total||t.index<0))return void console.warn("no slide width index "+t.index+" for slider width id "+t.id);e[t.id].index=t.index,a.dispatch()}}},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return r||(r=!0,t.subscribe(n)),{eventEmitter:a,getData:function(){return{items:e}}}}),define("swipe",[],function(){return{Swipe:function(i,o){"use strict";function e(){p=g.children,E=p.length,p.length<2&&(o.continuous=!1),d.transitions&&o.continuous&&p.length<3&&(g.appendChild(p[0].cloneNode(!0)),g.appendChild(g.children[1].cloneNode(!0)),p=g.children),f=new Array(p.length),m=i.getBoundingClientRect().width||i.offsetWidth,g.style.width=p.length*m+"px";for(var t=p.length;t--;){var e=p[t];e.style.width=m+"px",e.setAttribute("data-index",t),d.transitions&&(e.style.left=t*-m+"px",s(t,t<v?-m:v<t?m:0,0))}o.continuous&&d.transitions&&(s(a(v-1),-m,0),s(a(v+1),m,0)),d.transitions||(g.style.left=v*-m+"px"),i.style.visibility="visible"}function t(){o.continuous?r(v+1):v<p.length-1&&r(v+1)}function a(t){return(p.length+t%p.length)%p.length}function r(t,e){if(v!=t){if(d.transitions){var i=Math.abs(v-t)/(v-t);if(o.continuous){var r=i;(i=-f[a(t)]/m)!==r&&(t=-i*p.length+t)}for(var n=Math.abs(v-t)-1;n--;)s(a((v<t?t:v)-n-1),m*i,0);t=a(t),s(v,m*i,e||y),s(t,0,e||y),o.continuous&&s(a(t-i),-m*i,0)}else t=a(t),function(e,i,r){if(!r)return g.style.left=i+"px";var n=+new Date,a=setInterval(function(){var t=+new Date-n;if(r<t)return g.style.left=i+"px",_&&h(),o.transitionEnd&&o.transitionEnd.call(event,v,p[v]),void clearInterval(a);g.style.left=(i-e)*(Math.floor(t/r*100)/100)+e+"px"},4)}(v*-m,t*-m,e||y);v=t,u(o.callback&&o.callback(v,p[v]))}}function s(t,e,i){n(t,e,i),f[t]=e}function n(t,e,i){var r=p[t],n=r&&r.style;n&&(n.webkitTransitionDuration=n.MozTransitionDuration=n.msTransitionDuration=n.OTransitionDuration=n.transitionDuration=i+"ms",n.webkitTransform="translate("+e+"px,0)translateZ(0)",n.msTransform=n.MozTransform=n.OTransform="translateX("+e+"px)")}function h(){T=setTimeout(t,_)}function l(){_=0,clearTimeout(T)}var c=function(){},u=function(t){setTimeout(t||c,0)},d={addEventListener:!!window.addEventListener,touch:"ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,transitions:function(t){var e=["transitionProperty","WebkitTransition","MozTransition","OTransition","msTransition"];for(var i in e)if(void 0!==t.style[e[i]])return!0;return!1}(document.createElement("swipe"))};if(i){var p,f,m,E,g=i.children[0];o=o||{};var v=parseInt(o.startSlide,10)||0,y=o.speed||300;o.continuous=void 0===o.continuous||o.continuous;var T,R,_=o.auto||0,x={},b={},w={handleEvent:function(t){switch(t.type){case"touchstart":this.start(t);break;case"touchmove":this.move(t);break;case"touchend":u(this.end(t));break;case"webkitTransitionEnd":case"msTransitionEnd":case"oTransitionEnd":case"otransitionend":case"transitionend":u(this.transitionEnd(t));break;case"resize":u(e)}o.stopPropagation&&t.stopPropagation()},start:function(t){var e=t.touches[0];x={x:e.pageX,y:e.pageY,time:+new Date},R=void 0,b={},g.addEventListener("touchmove",this,!1),g.addEventListener("touchend",this,!1)},move:function(t){if(!(1<t.touches.length||t.scale&&1!==t.scale)){o.disableScroll&&t.preventDefault();var e=t.touches[0];b={x:e.pageX-x.x,y:e.pageY-x.y},void 0===R&&(R=!!(R||Math.abs(b.x)<Math.abs(b.y))),R||(t.preventDefault(),l(),o.continuous?(n(a(v-1),b.x+f[a(v-1)],0),n(v,b.x+f[v],0),n(a(v+1),b.x+f[a(v+1)],0)):(b.x=b.x/(!v&&0<b.x||v==p.length-1&&b.x<0?Math.abs(b.x)/m+1:1),n(v-1,b.x+f[v-1],0),n(v,b.x+f[v],0),n(v+1,b.x+f[v+1],0)))}},end:function(t){var e=+new Date-x.time,i=Number(e)<250&&20<Math.abs(b.x)||Math.abs(b.x)>m/2,r=!v&&0<b.x||v==p.length-1&&b.x<0;o.continuous&&(r=!1);var n=b.x<0;R||(i&&!r?(n?(o.continuous?(s(a(v-1),-m,0),s(a(v+2),m,0)):s(v-1,-m,0),s(v,f[v]-m,y),s(a(v+1),f[a(v+1)]-m,y),v=a(v+1)):(o.continuous?(s(a(v+1),m,0),s(a(v-2),-m,0)):s(v+1,m,0),s(v,f[v]+m,y),s(a(v-1),f[a(v-1)]+m,y),v=a(v-1)),o.callback&&o.callback(v,p[v])):o.continuous?(s(a(v-1),-m,y),s(v,0,y),s(a(v+1),m,y)):(s(v-1,-m,y),s(v,0,y),s(v+1,m,y))),g.removeEventListener("touchmove",w,!1),g.removeEventListener("touchend",w,!1)},transitionEnd:function(t){parseInt(t.target.getAttribute("data-index"),10)==v&&(_&&h(),o.transitionEnd&&o.transitionEnd.call(t,v,p[v]))}};return e(),_&&h(),d.addEventListener?(d.touch&&g.addEventListener("touchstart",w,!1),d.transitions&&(g.addEventListener("webkitTransitionEnd",w,!1),g.addEventListener("msTransitionEnd",w,!1),g.addEventListener("oTransitionEnd",w,!1),g.addEventListener("otransitionend",w,!1),g.addEventListener("transitionend",w,!1)),window.addEventListener("resize",w,!1)):window.onresize=function(){e()},{setup:function(){e()},slide:function(t,e){l(),r(t,e)},prev:function(){l(),o.continuous?r(v-1):v&&r(v-1)},next:function(){l(),t()},stop:function(){l()},getPos:function(){return v},getNumSlides:function(){return E},kill:function(){l(),g.style.width="",g.style.left="";for(var t=p.length;t--;){var e=p[t];e.style.width="",e.style.left="",d.transitions&&n(t,0,0)}d.addEventListener?(g.removeEventListener("touchstart",w,!1),g.removeEventListener("webkitTransitionEnd",w,!1),g.removeEventListener("msTransitionEnd",w,!1),g.removeEventListener("oTransitionEnd",w,!1),g.removeEventListener("otransitionend",w,!1),g.removeEventListener("transitionend",w,!1),window.removeEventListener("resize",w,!1)):window.onresize=null}}}}}}),define("slider/slider.view",["dispatcher","slider/slider.store","swipe"],function(p,n,f){"use strict";var a={},m=1,e=function(){var t,e,i=n.getData();for(var r in a)a.hasOwnProperty(r)&&(t=a[r],e=void 0,i&&i.items.hasOwnProperty(t.id)?(e=i.items[t.id],t.initialized||(t.initialized=!0,e.index!==t.current&&(t.current=e.index,t.slider.slide(t.current,0))),e.index!==t.current&&(t.current=e.index,t.slider.slide(t.current,t.speed),t.bind&&p.dispatch({type:"slider-change-to",id:t.bind,index:t.current}))):console.warn("error. no data in store for slider with id "+t.id))},i=function(){var t;t=document.getElementsByClassName("view-slider");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s,h,l,c,u=!1;for(var d in t)if(t.hasOwnProperty(d)&&t[d].element===e){u=!0;break}u||(i=t,a=(r=e).getAttribute("data-id"),o=r.getAttribute("data-speed"),s=r.classList.contains("update-query"),h=r.getAttribute("data-continuous"),l=r.getAttribute("data-slider-bind")||!1,c=r.getElementsByClassName("slide").length-1,a||(a="slider-id-"+m,m++),h=!(!h||"true"!==h),o=o?parseInt(o):700,n=new f.Swipe(r,{speed:o,startSlide:0,continuous:h,callback:function(t,e){p.dispatch({type:"slider-change-to",id:a,index:t})}}),r.parentNode.classList.add("slider-initialized"),i[a]={id:a,element:r,initialized:!1,index:0,slider:n,speed:o,updateQuery:s,bind:l},p.dispatch({type:"slider-add",id:a,continuous:h,total:c,index:0}))}(a,t[e]);for(var i in a)a.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}var a;r||(delete t[(a=i).id],p.dispatch({type:"slider-remove",id:a.id}))}(a,t,a[i])};return{init:function(){i(),e(),n.eventEmitter.subscribe(e),p.subscribe(function(t){"mutate"===t.type&&(i(),e())})}}}),define("slider/slider-arrows.view",["dispatcher","slider/slider.store"],function(c,a){"use strict";var o={},u=1,e=function(){var t,e,i,r=a.getData();for(var n in o)o.hasOwnProperty(n)&&(t=o[n],i=e=void 0,e=t.sliders[0],r.items.hasOwnProperty(e)&&(i=r.items[e],t.hidden||"prev"!==t.slide||0!==i.index?t.hidden&&"prev"===t.slide&&0!==i.index&&(t.hidden=!1,t.element.classList.remove("hidden")):(t.hidden=!0,t.element.classList.add("hidden")),t.hidden||"next"!==t.slide||i.index!==i.total?t.hidden&&"next"===t.slide&&i.index!==i.total&&(t.hidden=!1,t.element.classList.remove("hidden")):(t.hidden=!0,t.element.classList.add("hidden"))))},i=function(){var t;t=document.getElementsByClassName("view-slider-arrow");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s,h=!1;for(var l in t)if(t.hasOwnProperty(l)&&t[l].element===e){h=!0;break}h||(i=t,a=(r=e).getAttribute("data-id"),o=r.getAttribute("data-sliders"),s=r.getAttribute("data-slide"),a||(a="slider-arrow-id-"+u,u++),o?s?(n=o.split("||"),r.addEventListener("click",function(){for(var t=n.length-1;0<=t;t--)c.dispatch({type:"slider-change-"+s,id:n[t]})},!1),i[a]={id:a,sliders:n,slide:s,hidden:!1,element:r}):console.warn("data-slide attribute is missing"):console.warn("data-sliders attribute is missing"))}(o,t[e]);for(var i in o)o.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(o,t,o[i])};return{init:function(){i(),e(),a.eventEmitter.subscribe(e),c.subscribe(function(t){"mutate"===t.type&&setTimeout(function(){i(),e()},0)})}}}),define("slider/slider-slides.view",["dispatcher","slider/slider.store"],function(t,e){"use strict";var r={},h=1,i=function(){var n=e.getData();for(var t in r)r.hasOwnProperty(t)&&function(t){var e=t.id,i=n.items[e];if(i){if(t.current!==i.index){t.current=i.index;for(var r=0;r<t.slides.length;r++)r<t.current&&(t.slides[r].classList.remove("to-right"),t.slides[r].classList.remove("to-center"),t.slides[r].classList.add("to-left")),r===t.current&&(t.slides[r].classList.remove("to-right"),t.slides[r].classList.add("to-center"),t.slides[r].classList.remove("to-left")),r>t.current&&(t.slides[r].classList.add("to-right"),t.slides[r].classList.remove("to-center"),t.slides[r].classList.remove("to-left"))}}else console.warn("slider with id "+e+" is missing")}(r[t])},n=function(){var t;t=document.getElementsByClassName("view-slider");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o=!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s].element===e){o=!0;break}o||(i=t,n=(r=e).getAttribute("data-id"),a=r.getElementsByClassName("slide"),n||(n="slider-slides-id-"+h,h++),i[n]={id:n,element:r,current:!1,slides:a})}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){n(),i(),e.eventEmitter.subscribe(i),t.subscribe(function(t){"mutate"===t.type&&setTimeout(function(){n(),i()},0)})}}}),define("slider/slider-controls.view",["dispatcher","slider/slider.store"],function(c,a){"use strict";var o={},u=1,e=function(){var t,e,i,r=a.getData();for(var n in o)o.hasOwnProperty(n)&&(t=o[n],void 0,e=t.sliders[0],(i=r.items[e])&&(t.active&&i.index!==t.slide&&(t.active=!1,t.element.classList.remove("active"),t.element.classList.remove("viewed")),t.active||i.index!==t.slide||(t.active=!0,t.element.classList.remove("viewed"),t.element.classList.add("active")),i.index>t.slide&&(t.element.classList.add("viewed"),t.element.classList.remove("active"))))},i=function(){var t;t=document.getElementsByClassName("view-slider-control");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s,h=!1;for(var l in t)if(t.hasOwnProperty(l)&&t[l].element===e){h=!0;break}h||(i=t,a=(r=e).getAttribute("data-id"),o=r.getAttribute("data-sliders"),s=r.getAttribute("data-slide"),o?s?(n=o.split("||"),s=parseInt(s),a||(a="slider-control-id-"+u,u++),r.addEventListener("click",function(t){for(var e=n.length-1;0<=e;e--)c.dispatch({type:"slider-change-to",id:n[e],index:s})}),i[a]={id:a,element:r,sliders:n,slide:s,active:!1}):console.warn("data-slide attribute is missing"):console.warn("data-sliders attribute is missing"))}(o,t[e]);for(var i in o)o.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(o,t,o[i])};return{init:function(){i(),e(),a.eventEmitter.subscribe(e),c.subscribe(function(t){"mutate"===t.type&&setTimeout(function(){i(),e()},0)})}}}),define("slider/slider-dashes.view",["dispatcher"],function(t){"use strict";var i=function(t){for(var e=t.getElementsByClassName("item"),i=100/e.length,r=0;r<e.length;r++)e[r].style.height=i+"%"},e=function(){var t;t=document.getElementsByClassName("slider-dashes");for(var e=0;e<t.length;e++)i(t[e])};return{init:function(){e(),t.subscribe(function(t){"mutate"===t.type&&e()})}}}),define("synthetic-scroll/btn-scroll.view",["dispatcher","resize/resize.store"],function(s,h){"use strict";var r={},l=1,e=function(){var t;t=document.getElementsByClassName("vh-scroll");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="btn-scroll-id-"+l,l++),i[n]={id:n,element:r},r.addEventListener("click",function(t){var e=h.getData().height;s.dispatch({type:"scroll-to",position:e})}))}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){e(),s.subscribe(function(t){"mutate"===t.type&&e()})}}}),function(l,x,t){"use strict";function e(t){if(R=x.documentElement,r=x.body,T(),I=this,X=(t=t||{}).constants||{},t.easing)for(var e in t.easing)P[e]=t.easing[e];tt=t.edgeStrategy||"set",j={beforerender:t.beforerender,render:t.render,keyframe:t.keyframe},(q=!1!==t.forceHeight)&&(gt=t.scale||1),Y=t.mobileDeceleration||c,Q=!1!==t.smoothScrolling,Z=t.smoothScrollingDuration||u,J={targetTop:I.getScrollTop()},(wt=(t.mobileCheck||function(){return/Android|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent||navigator.vendor||l.opera)})())?((W=x.getElementById("skrollr-body"))&&V(),L(),ut(R,[a,h],[o])):ut(R,[a,s],[o]),I.refresh(),rt(l,"resize orientationchange",function(){var t=R.clientWidth,e=R.clientHeight;e===_t&&t===Rt||(_t=e,Rt=t,xt=!0)});var i=A();return function t(){k(),it=i(t)}(),I}var R,r,M={get:function(){return I},init:function(t){return I||new e(t)},VERSION:"0.6.26"},S=Object.prototype.hasOwnProperty,C=l.Math,n=l.getComputedStyle,a="skrollr",o="no-"+a,s=a+"-desktop",h=a+"-mobile",c=.004,u=200,_=/^(?:input|textarea|button|select)$/i,i=/^\s+|\s+$/g,b=/^data(?:-(_\w+))?(?:-?(-?\d*\.?\d+p?))?(?:-?(start|end|top|center|bottom))?(?:-?(top|center|bottom))?$/,d=/\s*(@?[\w\-\[\]]+)\s*:\s*(.+?)\s*(?:;|$)/gi,p=/^(@?[a-z\-]+)\[(\w+)\]$/,w=/-([a-z0-9_])/g,H=function(t,e){return e.toUpperCase()},f=/[\-+]?[\d]*\.?[\d]+/g,m=/\{\?\}/g,E=/rgba?\(\s*-?\d+\s*,\s*-?\d+\s*,\s*-?\d+/g,g=/[a-z\-]+-gradient/g,v="",y="",T=function(){var t=/^(?:O|Moz|webkit|ms)|(?:-(?:o|moz|webkit|ms)-)/;if(n){var e=n(r,null);for(var i in e)if(v=i.match(t)||+i==i&&e[i].match(t))break;if(!v)return void(v=y="");"-"===(v=v[0]).slice(0,1)?v={"-webkit-":"webkit","-moz-":"Moz","-ms-":"ms","-o-":"O"}[y=v]:y="-"+v.toLowerCase()+"-"}},A=function(){var t=l.requestAnimationFrame||l[v.toLowerCase()+"RequestAnimationFrame"],r=ft();return!wt&&t||(t=function(t){var e=ft()-r,i=C.max(0,1e3/60-e);return l.setTimeout(function(){r=ft(),t()},i)}),t},P={begin:function(){return 0},end:function(){return 1},linear:function(t){return t},quadratic:function(t){return t*t},cubic:function(t){return t*t*t},swing:function(t){return-C.cos(t*C.PI)/2+.5},sqrt:function(t){return C.sqrt(t)},outCubic:function(t){return C.pow(t-1,3)+1},bounce:function(t){var e;if(t<=.5083)e=3;else if(t<=.8489)e=9;else if(t<=.96208)e=27;else{if(!(t<=.99981))return 1;e=91}return 1-C.abs(3*C.cos(t*e*1.028)/e)}};e.prototype.refresh=function(t){var e,i,r=!1;for(void 0===t?(r=!0,G=[],bt=0,t=x.getElementsByTagName("*")):void 0===t.length&&(t=[t]),e=0,i=t.length;e<i;e++){var n=t[e],a=n,o=[],s=Q,h=tt,l=!1;if(r&&"___skrollable_id"in n&&delete n.___skrollable_id,n.attributes){for(var c=0,u=n.attributes.length;c<u;c++){var d=n.attributes[c];if("data-anchor-target"!==d.name)if("data-smooth-scrolling"!==d.name)if("data-edge-strategy"!==d.name)if("data-emit-events"!==d.name){var p=d.name.match(b);if(null!==p){var f={props:d.value,element:n,eventType:d.name.replace(w,H)};o.push(f);var m=p[1];m&&(f.constant=m.substr(1));var E=p[2];/p$/.test(E)?(f.isPercentage=!0,f.offset=(0|E.slice(0,-1))/100):f.offset=0|E;var g=p[3],v=p[4]||g;g&&"start"!==g&&"end"!==g?(f.mode="relative",f.anchors=[g,v]):(f.mode="absolute","end"===g?f.isEnd=!0:f.isPercentage||(f.offset=f.offset*gt))}}else l=!0;else h=d.value;else s="off"!==d.value;else if(null===(a=x.querySelector(d.value)))throw'Unable to find anchor target "'+d.value+'"'}var y,T,R;if(o.length)!r&&"___skrollable_id"in n?(R=n.___skrollable_id,y=G[R].styleAttr,T=G[R].classAttr):(R=n.___skrollable_id=bt++,y=n.style.cssText,T=ct(n)),G[R]={element:n,styleAttr:y,classAttr:T,anchorTarget:a,keyFrames:o,smoothScrolling:s,edgeStrategy:h,emitEvents:l,lastFrameIndex:-1},ut(n,["skrollable"],[])}}for(st(),e=0,i=t.length;e<i;e++){var _=G[t[e].___skrollable_id];void 0!==_&&(D(_),z(_))}return I},e.prototype.relativeToAbsolute=function(t,e,i){var r=R.clientHeight,n=t.getBoundingClientRect(),a=n.top,o=n.bottom-n.top;return"bottom"===e?a-=r:"center"===e&&(a-=r/2),"bottom"===i?a+=o:"center"===i&&(a+=o/2),(a+=I.getScrollTop())+.5|0},e.prototype.animateTo=function(t,e){e=e||{};var i=ft(),r=I.getScrollTop();return(K={startTop:r,topDiff:t-r,targetTop:t,duration:e.duration||1e3,startTime:i,endTime:i+(e.duration||1e3),easing:P[e.easing||"linear"],done:e.done}).topDiff||(K.done&&K.done.call(I,!1),K=void 0),I},e.prototype.stopAnimateTo=function(){K&&K.done&&K.done.call(I,!0),K=void 0},e.prototype.isAnimatingTo=function(){return!!K},e.prototype.isMobile=function(){return wt},e.prototype.setScrollTop=function(t,e){return $=!0===e,wt?Ht=C.min(C.max(t,0),Et):l.scrollTo(0,t),I},e.prototype.getScrollTop=function(){return wt?Ht:l.pageYOffset||R.scrollTop||r.scrollTop||0},e.prototype.getMaxScrollTop=function(){return Et},e.prototype.on=function(t,e){return j[t]=e,I},e.prototype.off=function(t){return delete j[t],I},e.prototype.destroy=function(){var t;t=l.cancelAnimationFrame||l[v.toLowerCase()+"CancelAnimationFrame"],!wt&&t||(t=function(t){return l.clearTimeout(t)}),t(it),at(),ut(R,[o],[a,s,h]);for(var e=0,i=G.length;e<i;e++)U(G[e].element);R.style.overflow=r.style.overflow="",R.style.height=r.style.height="",W&&M.setStyle(W,"transform","none"),q=j=W=I=void 0,Y=X=void(Et=0),vt="down",$=J=Z=Q=K=void(_t=Rt=0),tt=void(bt=0),wt=xt=!(yt=-(gt=1)),et=void(Ht=0)};var L=function(){var c,u,d,p,f,m,E,g,v,y,T;rt(R,["touchstart","touchmove","touchcancel","touchend"].join(" "),function(t){var e=t.changedTouches[0];for(p=t.target;3===p.nodeType;)p=p.parentNode;switch(f=e.clientY,m=e.clientX,v=t.timeStamp,_.test(p.tagName)||t.preventDefault(),console.log(1),t.type){case"touchstart":c&&c.blur(),I.stopAnimateTo(),c=p,u=E=f,d=m,v;break;case"touchmove":_.test(p.tagName)&&x.activeElement!==p&&t.preventDefault(),g=f-E,T=v-y,I.setScrollTop(Ht-g,!0),E=f,y=v;break;default:case"touchcancel":case"touchend":var i=u-f,r=d-m;if(r*r+i*i<49){if(!_.test(c.tagName)){c.focus();var n=x.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,t.view,1,e.screenX,e.screenY,e.clientX,e.clientY,t.ctrlKey,t.altKey,t.shiftKey,t.metaKey,0,null),c.dispatchEvent(n)}return}c=void 0;var a=g/T;a=C.max(C.min(a,3),-3);var o=C.abs(a/Y),s=a*o+.5*Y*o*o,h=I.getScrollTop()-s,l=0;Et<h?(l=(Et-h)/s,h=Et):h<0&&(l=-h/s,h=0),o*=1-l,I.animateTo(h+.5|0,{easing:"outCubic",duration:o})}}),l.scrollTo(0,0),R.style.overflow=r.style.overflow="hidden"},k=function(){xt&&(xt=!1,st());var t,e,i=I.getScrollTop(),r=ft();if(K)r>=K.endTime?(i=K.targetTop,t=K.done,K=void 0):(e=K.easing((r-K.startTime)/K.duration),i=K.startTop+e*K.topDiff|0),I.setScrollTop(i,!0);else if(!$){J.targetTop-i&&(J={startTop:yt,topDiff:i-yt,targetTop:i,startTime:Tt,endTime:Tt+Z}),r<=J.endTime&&(e=P.sqrt((r-J.startTime)/Z),i=J.startTop+e*J.topDiff|0)}if(wt&&W&&M.setStyle(W,"transform","translate(0, "+-Ht+"px) "+et),$||yt!==i){var n={curTop:i,lastTop:yt,maxTop:Et,direction:vt=yt<i?"down":i<yt?"up":vt};($=!1)!==(j.beforerender&&j.beforerender.call(I,n))&&(function(t,e,i,r){for(var n=0,a=G.length;n<a;n++){var o,s,h=G[n],l=h.element,c=h.smoothScrolling?t:e,u=h.keyFrames,d=u.length,p=u[0],f=u[u.length-1],m=c<p.frame,E=c>f.frame,g=m?p:f,v=h.emitEvents,y=h.lastFrameIndex;if(m||E){if(m&&-1===h.edge||E&&1===h.edge)continue;switch(m?(ut(l,["skrollable-before"],["skrollable-after","skrollable-between"]),v&&-1<y&&(ot(l,p.eventType,vt),h.lastFrameIndex=-1)):(ut(l,["skrollable-after"],["skrollable-before","skrollable-between"]),v&&y<d&&(ot(l,f.eventType,vt),h.lastFrameIndex=d)),h.edge=m?-1:1,h.edgeStrategy){case"reset":U(l);continue;case"ease":c=g.frame;break;default:case"set":var T=g.props;for(o in T)S.call(T,o)&&(s=N(T[o].value),0===o.indexOf("@")?l.setAttribute(o.substr(1),s):M.setStyle(l,o,s));continue}}else 0!==h.edge&&(ut(l,["skrollable","skrollable-between"],["skrollable-before","skrollable-after"]),h.edge=0);for(var R=0;R<d-1;R++)if(c>=u[R].frame&&c<=u[R+1].frame){var _,x=u[R],b=u[R+1];for(o in x.props)if(S.call(x.props,o)){var w=(c-x.frame)/(b.frame-x.frame);if(w=x.props[o].easing(w),s=O(x.props[o].value,b.props[o].value,w),"transform"===o&&r-400<=i)for(var H=s.length-1;0<=H;H--)_=C.round(s[H]),C.abs(_-s[H])<1&&(s[H]=C.round(s[H]));s=N(s),0===o.indexOf("@")?l.setAttribute(o.substr(1),s):M.setStyle(l,o,s)}v&&y!==R&&(ot(l,"down"===vt?x.eventType:b.eventType,vt),h.lastFrameIndex=R);break}}}(i,I.getScrollTop(),r,J.endTime),yt=i,j.render&&j.render.call(I,n)),t&&t.call(I,!1)}Tt=r},D=function(t){for(var e=0,i=t.keyFrames.length;e<i;e++){for(var r,n,a,o,s=t.keyFrames[e],h={};null!==(o=d.exec(s.props));)a=o[1],n=o[2],null!==(r=a.match(p))?(a=r[1],r=r[2]):r="linear",n=n.indexOf("!")?F(n):[n.slice(1)],h[a]={value:n,easing:P[r]};s.props=h}},F=function(t){var e=[];return E.lastIndex=0,t=t.replace(E,function(t){return t.replace(f,function(t){return t/255*100+"%"})}),y&&(g.lastIndex=0,t=t.replace(g,function(t){return y+t})),t=t.replace(f,function(t){return e.push(+t),"{?}"}),e.unshift(t),e},z=function(t){var e,i,r={};for(e=0,i=t.keyFrames.length;e<i;e++)B(t.keyFrames[e],r);for(r={},e=t.keyFrames.length-1;0<=e;e--)B(t.keyFrames[e],r)},B=function(t,e){var i;for(i in e)S.call(t.props,i)||(t.props[i]=e[i]);for(i in t.props)e[i]=t.props[i]},O=function(t,e,i){var r,n=t.length;if(n!==e.length)throw"Can't interpolate between \""+t[0]+'" and "'+e[0]+'"';var a=[t[0]];for(r=1;r<n;r++)a[r]=t[r]+(e[r]-t[r])*i;return a},N=function(t){var e=1;return m.lastIndex=0,t[0].replace(m,function(){return t[e++]})},U=function(t,e){for(var i,r,n=0,a=(t=[].concat(t)).length;n<a;n++)r=t[n],(i=G[r.___skrollable_id])&&(e?(r.style.cssText=i.dirtyStyleAttr,ut(r,i.dirtyClassAttr)):(i.dirtyStyleAttr=r.style.cssText,i.dirtyClassAttr=ct(r),r.style.cssText=i.styleAttr,ut(r,i.classAttr)))},V=function(){et="translateZ(0)",M.setStyle(W,"transform",et);var t=n(W),e=t.getPropertyValue("transform"),i=t.getPropertyValue(y+"transform");e&&"none"!==e||i&&"none"!==i||(et="")};M.setStyle=function(t,e,i){var r=t.style;if("zIndex"===(e=e.replace(w,H).replace("-","")))isNaN(i)?r[e]=i:r[e]=""+(0|i);else if("float"===e)r.styleFloat=r.cssFloat=i;else try{v&&(r[v+e.slice(0,1).toUpperCase()+e.slice(1)]=i),r[e]=i}catch(t){}};var I,G,W,j,q,X,Y,K,Q,Z,J,$,tt,et,it,rt=M.addEvent=function(t,e,i){for(var r,n=function(t){return(t=t||l.event).target||(t.target=t.srcElement),t.preventDefault||(t.preventDefault=function(){t.returnValue=!1,t.defaultPrevented=!0}),i.call(this,t)},a=0,o=(e=e.split(" ")).length;a<o;a++)r=e[a],t.addEventListener?t.addEventListener(r,i,!1):t.attachEvent("on"+r,n),Mt.push({element:t,name:r,listener:i})},nt=M.removeEvent=function(t,e,i){for(var r=0,n=(e=e.split(" ")).length;r<n;r++)t.removeEventListener?t.removeEventListener(e[r],i,!1):t.detachEvent("on"+e[r],i)},at=function(){for(var t,e=0,i=Mt.length;e<i;e++)t=Mt[e],nt(t.element,t.name,t.listener);Mt=[]},ot=function(t,e,i){j.keyframe&&j.keyframe.call(I,t,e,i)},st=function(){var t=I.getScrollTop();Et=0,q&&!wt&&(r.style.height=""),function(){var t,e,i,r,n,a,o,s,h,l,c,u=R.clientHeight,d=ht();for(s=0,h=G.length;s<h;s++)for(e=(t=G[s]).element,i=t.anchorTarget,n=0,a=(r=t.keyFrames).length;n<a;n++)l=(o=r[n]).offset,c=d[o.constant]||0,o.frame=l,o.isPercentage&&(l*=u,o.frame=l),"relative"===o.mode&&(U(e),o.frame=I.relativeToAbsolute(i,o.anchors[0],o.anchors[1])-l,U(e,!0)),o.frame+=c,q&&!o.isEnd&&o.frame>Et&&(Et=o.frame);for(Et=C.max(Et,lt()),s=0,h=G.length;s<h;s++){for(n=0,a=(r=(t=G[s]).keyFrames).length;n<a;n++)c=d[(o=r[n]).constant]||0,o.isEnd&&(o.frame=Et-o.offset+c);t.keyFrames.sort(mt)}}(),q&&!wt&&(r.style.height=Et+R.clientHeight+"px"),wt?I.setScrollTop(C.min(I.getScrollTop(),Et)):I.setScrollTop(t,!0),$=!0},ht=function(){var t,e,i=R.clientHeight,r={};for(t in X)"function"==typeof(e=X[t])?e=e.call(I):/p$/.test(e)&&(e=e.slice(0,-1)/100*i),r[t]=e;return r},lt=function(){var t=W&&W.offsetHeight||0;return C.max(t,r.scrollHeight,r.offsetHeight,R.scrollHeight,R.offsetHeight,R.clientHeight)-R.clientHeight},ct=function(t){var e="className";return l.SVGElement&&t instanceof l.SVGElement&&(t=t[e],e="baseVal"),t[e]},ut=function(t,e,i){var r="className";if(l.SVGElement&&t instanceof l.SVGElement&&(t=t[r],r="baseVal"),void 0!==i){for(var n=t[r],a=0,o=i.length;a<o;a++)n=pt(n).replace(pt(i[a])," ");n=dt(n);for(var s=0,h=e.length;s<h;s++)-1===pt(n).indexOf(pt(e[s]))&&(n+=" "+e[s]);t[r]=dt(n)}else t[r]=e},dt=function(t){return t.replace(i,"")},pt=function(t){return" "+t+" "},ft=Date.now||function(){return+new Date},mt=function(t,e){return t.frame-e.frame},Et=0,gt=1,vt="down",yt=-1,Tt=ft(),Rt=0,_t=0,xt=!1,bt=0,wt=!1,Ht=0,Mt=[];"function"==typeof define&&define.amd?define("skrollr",[],function(){return M}):"undefined"!=typeof module&&module.exports?module.exports=M:l.skrollr=M}(window,document),define("parallax/parallax.view",["dispatcher","skrollr","utils"],function(t,e,r){"use strict";var n;return{init:function(){n=e.init({forceHeight:!1,smoothScrolling:!0,smoothScrollingDuration:1200,mobileCheck:function(){return!1}}),t.subscribe(function(t){var e,i=500;"scroll-to"===t.type&&(t.hasOwnProperty("speed")&&"number"==typeof t.speed&&(i=1e3*t.speed),t.hasOwnProperty("position")&&"number"==typeof t.position?(e=t.position,n.animateTo(e,{duration:i,easing:"outCubic"})):t.hasOwnProperty("element")&&(e=r.offset(t.element).top,n.animateTo(e,{duration:i,easing:"outCubic"}))),"mutate"===t.type&&(n.refresh(),setTimeout(function(){var t=document.createEvent("UIEvents");t.initUIEvent("scroll",!0,!1,window,0),window.dispatchEvent(t),n.refresh()},1500))})}}}),define("parallax/simple-parallax.view",["dispatcher","scroll/scroll.store","resize/resize.store"],function(t,r,e){"use strict";var n,a,o={},h=1,i=function(){var t,e=r.getData().top;for(var i in n<e&&(e=n),o)o.hasOwnProperty(i)&&("type-1"===(t=o[i]).type&&(o[i].element.style.opacity=(n-e)/n),"type-2"===t.type&&(o[i].element.style.opacity=(n-e)/n,o[i].element.style[a]="translateY("+-e/2+"px)"),"type-3"===t.type&&(o[i].element.style[a]="scaleY("+(1+15*(1-(n-e)/n))+")",o[i].element.style.opacity=(n-2*e)/n))},s=function(){n=e.getData().height/1.2},l=function(){var t;t=document.getElementsByClassName("simple-parallax");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o=!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s].element===e){o=!0;break}o||(i=t,n=(r=e).getAttribute("data-id"),a=r.getAttribute("data-parallax-type"),n||(n="simple-parallax-id-"+h,h++),i[n]={id:n,element:r,type:a})}(o,t[e]);for(var i in o)o.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(o,t,o[i])};return{init:function(){a=Modernizr.prefixed("transform"),l(),s(),i(),r.eventEmitter.subscribe(i),e.eventEmitter.subscribe(s),t.subscribe(function(t){"mutate"===t.type&&(l(),s(),i())})}}}),define("menu/menu.store",["dispatcher"],function(t){"use strict";var i,e=!1,r=!1,n=function(t){if("menu-open"===t.type){if(r)return;r=!0,a.dispatch()}if("menu-close"===t.type){if(!r)return;r=!1,a.dispatch()}"menu-toggle"===t.type&&(r=!r,a.dispatch())},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,t.subscribe(n)),{eventEmitter:a,getData:function(){return{active:r}}}}),define("menu/menu.view",["dispatcher","menu/menu.store","page-name/page-name.store"],function(t,e,i){"use strict";var r,n,a,o=!1,s=function(t){t.preventDefault()},h=function(t){t=e.getData(),r&&(t.active?((o=i.getData().containerActive)&&n.classList.remove("page-name-active"),r.classList.add("active"),a.classList.add("prevent-scroll"),a.addEventListener("touchmove",s)):(o&&n.classList.add("page-name-active"),r.classList.remove("active"),a.classList.remove("prevent-scroll"),a.removeEventListener("touchmove",s)))};return{init:function(){r=document.getElementById("menu-container"),n=document.getElementsByTagName("header"),a=document.getElementsByTagName("body")[0],r?n?n=n[0]:console.warn("header element is missing"):console.warn("menu-container element is missing"),h(),e.eventEmitter.subscribe(h)}}}),define("menu/menu-hover.view",["dispatcher"],function(t){"use strict";var h,l={},c={},i=!1,r=!1,n=function(){if(c.hasOwnProperty(i)&&!r){for(var t=0;t<c[i].length;t++)c[i][t].element.classList.remove("active");h.classList.remove("hide-decor")}},u=function(e){e.element.addEventListener("mouseenter",function(t){!function(t){if(c.hasOwnProperty(t)&&!r){i=t;for(var e=0;e<c[i].length;e++)c[i][e].element.classList.add("active");h.classList.add("hide-decor")}}(e.id)}),e.element.addEventListener("mouseleave",function(t){n()})};return{init:function(){(function(){var t,e,i,r,n=document.getElementsByClassName("menu-link"),a=document.getElementsByClassName("menu-img");if(h=document.getElementById("menu-container")){for(var o=0;o<n.length;o++)i=n[o],(r=i.getAttribute("data-id"))?l[r]={id:r,element:i}:console.warn("data-id attribute is missing");for(o=0;o<a.length;o++)t=a[o],(e=t.getAttribute("data-id"))?(c.hasOwnProperty(e)||(c[e]=[]),c[e].push({id:e,element:t})):console.warn("data-id attribute is missing");for(var s in l)l.hasOwnProperty(s)&&u(l[s])}})(),t.subscribe(function(t){"menu-hover-lock"===t.type&&(r=!0),"menu-hover-unlock"===t.type&&(r=!1,n())})}}}),define("menu/menu-btn.view",["dispatcher","menu/menu.store","page-name/page-name.store","TweenMax"],function(e,i,r,n){"use strict";var a,o,s,h,t=function(t){var e=r.getData().containerActive;t=i.getData(),a&&(t.active?(a.classList.add("active"),o.classList.add("rotated"),h.classList.add("rotated"),e||n.to(s,.2,{opacity:0})):(a.classList.remove("active"),o.classList.remove("rotated"),h.classList.remove("rotated"),e||n.to(s,.2,{opacity:1})))};return{init:function(){(a=document.getElementById("menu-btn"))?(o=a.getElementsByClassName("b1")[0],s=a.getElementsByClassName("b2")[0],h=a.getElementsByClassName("b3")[0],a.addEventListener("click",function(t){e.dispatch({type:"menu-toggle"})})):console.warn("menu-btn element is missing"),t(),i.eventEmitter.subscribe(t)}}}),define("header/header-color.view",["dispatcher","menu/menu.store"],function(t,e){"use strict";var i,r,n=!1,a=!1,o=!1,s=!1,h=function(){i&&(s=n?"dark":a)!==o&&("dark"===(o=s)?(i.classList.remove("light"),i.classList.add("dark")):"light"===s&&(i.classList.remove("dark"),i.classList.add("light")))},l=function(t){t=e.getData(),n=t.active,h()};return{init:function(){i=document.getElementsByTagName("header")[0],r=document.getElementsByTagName("body")[0],i?(i.classList.contains("dark")&&(a="dark"),i.classList.contains("light")&&(a="light")):console.warn("header is missing. somehow.."),l(),e.eventEmitter.subscribe(l),t.subscribe(function(t){var e;"page-color-change"===t.type&&("dark"===(e=t).color?(a="dark",r.style.background="#1c2227"):"light"===e.color&&(a="light",r.style.background="#ffffff"),h())})}}}),define("svg-text/svg-text-init.view",["dispatcher"],function(h){"use strict";var r={},l=1,e=function(){var t;t=document.getElementsByClassName("svg-text");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o=!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s].element===e){o=!0;break}o||(i=t,n=(r=e).getAttribute("data-id"),(a=r.getAttribute("data-default"))||(a=""),n||(n="svg-text-i-"+l,l++,r.setAttribute("data-id",n)),h.dispatch({type:"svg-text-change",id:n,text:a}),i[n]={id:n,text:a,element:r})}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){e(),h.subscribe(function(t){"mutate"===t.type&&e()})}}}),define("resize/breakpoint-main-text.store",["dispatcher"],function(t){var i,e=!1,r=[{size:0,name:"mobile"},{size:640,name:"tablet1"},{size:1e3,name:"tablet2"},{size:1300,name:"desktop"}],n=!1,a={width:0,height:0},o=function(){var t=0,e=0;return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(t=document.body.clientWidth,e=document.body.clientHeight),{height:e,width:t}},s=function(){a=o(),function(){for(var t=r.length-1;0<=t;t--)if(a.width>=r[t].size){if(n===r[t])return;return n=r[t],h.dispatch({type:"change"})}}()},h=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,a=o(),s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1),window.addEventListener("load",s,!1)),{eventEmitter:h,getData:function(){return{breakpoint:n}}}}),define("svg-text/svg-text-reposition.view",["dispatcher","svg-text/svg-text.store","resize/resize.store","resize/breakpoint-main-text.store"],function(o,i,r,n){"use strict";var a,s=1,h={},E=!1,l={mobile:10,tablet1:15,tablet2:15,desktop:20},c={mobile:36,tablet1:60,tablet2:120,desktop:150},u=function(){var a,p,f=r.getData().width,t=n.getData(),m=i.getData();for(var e in a=c[t.breakpoint.name]/100,p=l[t.breakpoint.name],h)h.hasOwnProperty(e)&&function(t){var e,i,s,h,l,c,u,d=[],r=a;if(m.items.hasOwnProperty(t.id)&&(t.text!==m.items[t.id].text||E!==f)){t.text=m.items[t.id].text,t.text||(t.text=""),t.text=t.text.toUpperCase(),e=t.text.split("");for(var n=0;n<e.length;n++)d.push({char:e[n],x:0});if(0!==d.length){i=function(t){var e,i,r=p,n=!1,a=.8*f;for(i=(i=.1*f)-(e=m.lettersData[d[0].char].width*t)/2+1,a=a+e/2+m.lettersData[d[d.length-1].char].width*t/2;r<=1e3;){for(var o=s=0;o<=d.length-1;o++)h=m.lettersData[d[o].char].width*t,l=m.lettersData[d[o].char].spacing*t/2,u=0,d[o+1]&&(u=m.lettersData[d[o+1].char].spacing*t/2),0,a<=(s+=h)&&(n=!0),s+=c=(l=(u+l)/2)*r/100;if(n)break;r+=.1}return{spacing:parseFloat(r.toFixed(1)),cw:a,cl:i}}(r);for(n=s=0;n<=d.length-1;n++)d[n].x=s+i.cl,h=m.lettersData[d[n].char].width*r,l=m.lettersData[d[n].char].spacing*r/2,u=0,d[n+1]&&(u=m.lettersData[d[n+1].char].spacing*r/2),c=(l=(u+l)/2)*i.spacing/100,s+=h+c;o.dispatch({type:"svg-text-reposition",me:"svg-text-reposition.view",id:t.id,letters:d,spacing:i.spacing,left:i.cl,text:t.text})}}}(h[e]);E=f},t=function(){var t=this,e=arguments;clearTimeout(a),a=setTimeout(function(){(function(t){u()}).apply(t,e)},100)},e=function(){var t;t=document.getElementsByClassName("svg-text");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="svg-text-p-"+s,s++,r.setAttribute("data-id",n)),i[n]={id:n,text:"",letters:[],element:r})}(h,t[e]);for(var i in h)h.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(h,t,h[i])};return{init:function(){e(),u(),r.eventEmitter.subscribe(t),i.eventEmitter.subscribe(t),o.subscribe(function(t){"mutate"===t.type&&(e(),u())})}}}),define("svg-text/svg-text-positions.store",["dispatcher"],function(t){"use strict";var i,e=!1,r={},n=function(t){"svg-text-reposition"===t.type&&(r[t.id]={id:t.id,letters:t.letters,spacing:t.spacing,left:t.left,text:t.text},a.dispatch()),"svg-text-delete"===t.type&&r.hasOwnProperty(t.id)&&delete r[t.id]},a=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e||(e=!0,t.subscribe(n))),{eventEmitter:a,getData:function(){return{items:r}}}}),define("svg-text/svg-text.view",["dispatcher","svg-text/svg-text-positions.store","resize/resize.store","resize/breakpoint-main-text.store","svg-text/svg-text.store"],function(s,r,n,a,o){"use strict";var u,d={},l=1,p={mobile:47,tablet1:78,tablet2:155,desktop:193},e=function(){var t,e=a.getData();for(var i in u=n.getData().width,d)d.hasOwnProperty(i)&&((t=d[i]).svg&&(t.svg.setAttribute("width",u),t.svg.setAttribute("height",p[e.breakpoint.name]),t.svg.setAttribute("viewBox","0 0 "+u+" "+p[e.breakpoint.name])),t.element&&(t.element.style.height=p[e.breakpoint.name]+"px"))},i=function(){var t,h,l=r.getData(),e=a.getData(),c=o.getData();for(var i in u=n.getData().width,t=p[e.breakpoint.name],h=t/1300,d)d.hasOwnProperty(i)&&(function(t){var e,i,r,n,a,o;if(l.items.hasOwnProperty(t.id)&&t.text!==l.items[t.id].text){e=l.items[t.id].letters,t.lastText=t.text,t.text=l.items[t.id].text;for(var s=0;s<t.letters.length;s++)o=t.letters[s],t.g.removeChild(o.svgPath);t.letters=[],e.length;for(s=0;s<e.length;s++)i=e[s],a=n=r=void 0,a=document.createElementNS("http://www.w3.org/2000/svg","path"),c.lettersData.hasOwnProperty(i.char)?(r=c.lettersData[i.char].bezier,a.setAttribute("d",r),t.g.appendChild(a),a.setAttribute("transform","scale("+h+", -"+h+") translate("+i.x/h+", -1000)"),"project-preloader-text-fg"===t.id&&(n=a.getTotalLength(),a.setAttribute("stroke-dashoffset",0),a.setAttribute("stroke-dasharray","0,"+n/2+",0,"+n/2)),t.letters.push({svgPath:a,char:i.char,x:i.x})):console.warn("invalid letter "+i.char)}}(d[i]),function(t){var e;if(l.items.hasOwnProperty(t.id)){e=l.items[t.id].letters;for(var i=0;i<t.letters.length;i++)t.letters[i].x=e[i].x,t.letters[i].svgPath.setAttribute("transform","scale("+h+", -"+h+") translate("+t.letters[i].x/h+", -1000)")}}(d[i]))},h=function(){var t;t=document.getElementsByClassName("svg-text");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o,s=!1;for(var h in t)if(t.hasOwnProperty(h)&&t[h].element===e){s=!0;break}s||(i=t,o=(r=e).getAttribute("data-id"),"canvas"!==r.getAttribute("data-render")&&(o||(o="svg-text-v-"+l,l++,r.setAttribute("data-id",o)),n=r.getElementsByTagName("svg")[0],a=r.getElementsByTagName("g")[0],i[o]={id:o,element:r,svg:n,g:a,letters:[],lastText:"",text:""}))}(d,t[e]);for(var i in d)d.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}var a,o;r||(a=t,o=i,s.dispatch({type:"svg-text-delete",id:o.id}),delete a[o.id])}(d,t,d[i])};return{init:function(){Modernizr.prefixed("transition-delay"),h(),e(),i(),r.eventEmitter.subscribe(i),n.eventEmitter.subscribe(e),a.eventEmitter.subscribe(e),s.subscribe(function(t){"mutate"===t.type&&(h(),e(),i())})}}}),define("svg-text/svg-text-fallback.view",["dispatcher","svg-text/svg-text-positions.store","resize/resize.store","resize/breakpoint-main-text.store","svg-text/svg-text.store"],function(t,d,a,p,f){"use strict";var o,s,h={},l=1,m={mobile:47,tablet1:78,tablet2:155,desktop:193},e=function(){var t,e=p.getData();for(var i in o=a.getData().width,h)h.hasOwnProperty(i)&&((t=h[i]).svg&&(t.svg.setAttribute("width",o),t.svg.setAttribute("height",m[e.breakpoint.name]),t.svg.setAttribute("viewBox","0 0 "+o+" "+m[e.breakpoint.name])),t.element&&(t.element.style.height=m[e.breakpoint.name]+"px"))},i=function(){var t,e,i=d.getData(),r=!1;for(var n in o=a.getData().width,h)h.hasOwnProperty(n)&&(e=h[n],i.items.hasOwnProperty(e.id)&&e.text!==i.items[e.id].text&&(r=!0),t=h[n],i.items.hasOwnProperty(t.id)&&(i.items[t.id].letters,r=!0));r&&(clearTimeout(s),h[n].svg.classList.add("hidden"),s=setTimeout(function(){h.hasOwnProperty(n)&&(function(t){var e,i,r,n,a,o,s,h,l=f.getData(),c=p.getData();if(t&&t){(e=d.getData()).items[t.id],r=e.items[t.id].letters,i=m[c.breakpoint.name],n=i/1300,t.lastText=t.text,t.text=e.items[t.id].text;for(var u=0;u<t.letters.length;u++)h=t.letters[u],t.g.removeChild(h.svgPath);for(t.letters=[],r.length,u=0;u<r.length;u++)a=r[u],s=o=void 0,s=document.createElementNS("http://www.w3.org/2000/svg","path"),l.lettersData.hasOwnProperty(a.char)?(o=l.lettersData[a.char].bezier,s.setAttribute("d",o),t.g.appendChild(s),s.setAttribute("transform","scale("+n+", -"+n+") translate("+a.x/n+", -1000)"),t.letters.push({svgPath:s,char:a.char,x:a.x})):console.warn("invalid letter "+a.char)}}(h[n]),h[n].svg.classList.remove("hidden"))},600))},r=function(){var t,e,i,r,n=document.getElementById("stage-svg-text");n?(r="stage-svg-text","canvas"===(t=n).getAttribute("data-render")&&(r||(r="svg-text-v-"+l,l++,t.setAttribute("data-id",r)),e=t.getElementsByTagName("svg")[0],i=t.getElementsByTagName("g")[0],h[r]={id:r,element:t,svg:e,g:i,letters:[],lastText:"",text:""})):delete h["stage-svg-text"]};return{init:function(){Modernizr.prefixed("transition-delay"),r(),e(),i(),d.eventEmitter.subscribe(i),a.eventEmitter.subscribe(e),p.eventEmitter.subscribe(e),t.subscribe(function(t){"mutate"===t.type&&(r(),e(),i())})}}}),define("stage-text/stage-text-scroll.view",["dispatcher","resize/resize.store","scroll/scroll.store","utils"],function(n,i,a,r){"use strict";var o={},h=1,s=!1,e=function(){var t=i.getData().height;for(var e in o)o.hasOwnProperty(e)&&(o[e].offset=r.offset(o[e].element).top-t/2)},l=function(){var t=a.getData(),e=!1;if(!s)for(var i in o)if(e=!1,o.hasOwnProperty(i)){if(t.top<o[i].offset)continue;for(var r in e=!0,o)if(o.hasOwnProperty(r)){if(r===i||o[r].offset<o[i].offset)continue;t.top>o[r].offset&&(e=!1)}if(!0===e){n.dispatch({type:"svg-text-change",id:"stage-svg-text",text:o[i].text}),n.dispatch({type:"svg-text-change",id:"stage-svg-text-2",text:o[i].text});break}}},c=function(){var t;t=document.getElementsByClassName("text-bg-control");for(var e=0;e<t.length;e++)!function(t,e){var i,r,n,a,o=!1;for(var s in t)if(t.hasOwnProperty(s)&&t[s].element===e){o=!0;break}o||(i=t,n=(r=e).getAttribute("data-id"),a=r.getAttribute("data-text"),n||(n="text-bg-"+h,h++),i[n]={id:n,element:r,text:a,offset:!1})}(o,t[e]);for(var i in o)o.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(o,t,o[i])};return{init:function(){c(),e(),l(),a.eventEmitter.subscribe(l),n.subscribe(function(t){"mutate"===t.type&&(c(),e(),l()),"words-scroll-disable"===t.type&&(s=!0),"words-scroll-enable"===t.type&&(s=!1,l())})}}}),define("stage-text/stage-text-timer.view",["dispatcher","svg-text/svg-text.store","scroll/scroll.store","resize/resize.store"],function(t,e,i,r){"use strict";var n,a=[],o=0,s=!1,h=!1,l=function(){a&&a.length&&(h||(t.dispatch({type:"svg-text-change",id:"stage-svg-text",text:a[o].text}),++o>=a.length&&(o=0)))},c=function(){var t=i.getData().top,e=r.getData().height;t<e/2&&!s&&(s=!0,l(),clearInterval(n),n=setInterval(l,3e3)),e/2<=t&&s&&(s=!1,clearInterval(n))},u=function(){var t,e,i=document.getElementsByClassName("main-word-item");if(!i||!i.length)return clearInterval(n),void(a=[]);s=!1;for(var r=o=0;r<i.length;r++)t=i[r],void 0,e=t.innerHTML,a.push({element:t,text:e})};return{init:function(){u(),i.eventEmitter.subscribe(c),c(),t.subscribe(function(t){"mutate"===t.type&&setTimeout(function(){u(),c()},0),"words-scroll-disable"===t.type&&(h=!0),"words-scroll-enable"===t.type&&(h=!1)})}}}),define("stage-color/stage-color.view",["dispatcher","resize/resize.store","scroll/scroll.store"],function(t,e,i){"use strict";var r,n,a=0,o=[],s=Modernizr.prefixed("transform"),h=function(){var t=i.getData().top;n&&(n.style[s]="translateY("+2*-t+"px) translateZ(0px)")},l=function(){e.getData().height},c=function(){(r=document.getElementById("stage-color-bg"))&&(n=r.getElementsByClassName("l1")[0],function(){var t,e,i=document.getElementsByClassName("color-bg-control");o=[];for(var r=0;r<i.length;r++)e=i[r].getAttribute("data-color"),o.push(e);a=i.length,n.style.height=100*(2*a-1)+"%",t="linear-gradient(to bottom";for(r=0;r<o.length;r++)t+=", "+o[r]+", "+o[r];t+=")",n.style.background=t}())};return{init:function(){c(),l(),h(),e.eventEmitter.subscribe(l),e.eventEmitter.subscribe(h),i.eventEmitter.subscribe(h),t.subscribe(function(t){"mutate"===t.type&&(c(),l(),h())})}}}),define("decor/group-hover.view",["dispatcher"],function(t){"use strict";var r={},o=1,n=function(t,e){var i,r,n=e.getAttribute("data-id");n||(n="group-hover-id-"+o,o++),i=e.getElementsByClassName("group-hover-inner");for(var a=0;a<i.length;a++)(r=i[a]).addEventListener("mouseenter",function(){e.classList.add("group-hover-active");for(var t=0;t<i.length;t++)i[t].classList.add("hover")}),r.addEventListener("mouseleave",function(){e.classList.remove("group-hover-active");for(var t=0;t<i.length;t++)i[t].classList.remove("hover")});t[n]={id:n,element:e}},e=function(){var t;t=document.getElementsByClassName("group-hover");for(var e=0;e<t.length;e++)!function(t,e){var i=!1;for(var r in t)if(t.hasOwnProperty(r)&&t[r].element===e){i=!0;break}i||n(t,e)}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){e(),t.subscribe(function(t){"mutate"===t.type&&e()})}}}),define("decor/project-hover.view",["dispatcher","resize/resize.store","scroll/scroll.store"],function(t,n,e){"use strict";var a,i,r={},o=1,s=!1,h=0,l=0,c=function(){e.getData().top,u()},u=function(){a&&(a.style[i]="translateX("+h+"px) translateY("+l+"px) translateZ(0px)")},d=function(t,e){n.getData().height,a&&(s=!1,a.classList.add("hidden"),e&&(h=e.clientX,l=e.clientY,u()))},p=function(i,t){var e=t.getElementsByClassName("img")[0],r=t.getAttribute("data-id");r||(r="project-hover-"+o,o++),i[r]={id:r,cursor:a,element:t},e.addEventListener("mouseenter",function(t){var e;i[r],e=t,n.getData().height,a&&(s=!0,a.classList.remove("hidden"),h=e.clientX,l=e.clientY,u())}),e.addEventListener("mousemove",function(t){var e;i[r],e=t,n.getData().height,a&&s&&(a.classList.remove("hidden"),h=e.clientX,l=e.clientY,u())}),e.addEventListener("mouseleave",function(t){d(i[r],t)})},f=function(){var t;a=document.getElementById("cursor"),t=document.getElementsByClassName("project-preview");for(var e=0;e<t.length;e++)!function(t,e){var i=!1;for(var r in t)if(t.hasOwnProperty(r)&&t[r].element===e){i=!0;break}i||p(t,e)}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){i=Modernizr.prefixed("transform"),f(),c(),e.eventEmitter.subscribe(c),t.subscribe(function(t){"mutate"===t.type&&(f(),d(0,!1)),"project-open"===t.type&&r.hasOwnProperty(t.id)&&d(r[t.id])})}}}),define("resize/breakpoint-team.store",["dispatcher"],function(t){var i,e=!1,r=[{size:0,name:"mobile"},{size:640,name:"tablet1"},{size:1e3,name:"tablet2"},{size:1200,name:"desktop"}],n=!1,a={width:0,height:0},o=function(){var t=0,e=0;return"number"==typeof window.innerWidth?(t=window.innerWidth,e=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(t=document.documentElement.clientWidth,e=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(t=document.body.clientWidth,e=document.body.clientHeight),{height:e,width:t}},s=function(){a=o(),function(){for(var t=r.length-1;0<=t;t--)if(a.width>=r[t].size){if(n===r[t])return;return n=r[t],h.dispatch({type:"change"})}}()},h=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return e||(e=!0,a=o(),s(),window.addEventListener("resize",s,!1),window.addEventListener("orientationchange",s,!1),window.addEventListener("load",s,!1)),{eventEmitter:h,getData:function(){return{breakpoint:n}}}}),define("decor/team-align.view",["dispatcher","resize/breakpoint-team.store"],function(t,n){"use strict";var a,o,s,h,e=function(){var t,e,i=n.getData().breakpoint.name;if(a)for(var r=0;r<o.length;r++)t=o[r],e=r,"desktop"===i&&(s-(h=s%5)-1<e?(2===h&&(e%5==0&&(t.style.top="50px"),e%5==1&&(t.style.top="0px")),3===h&&(e%5==0&&(t.style.top="50px"),e%5==1&&(t.style.top="0px"),e%5==2&&(t.style.top="25px")),4===h&&(e%5==0&&(t.style.top="0px"),e%5==1&&(t.style.top="50px"),e%5==2&&(t.style.top="0px"),e%5==3&&(t.style.top="25px"))):e%5==0?t.style.top="0px":e%5==1?t.style.top="50px":e%5==2?t.style.top="0px":e%5==3?t.style.top="25px":e%5==4&&(t.style.top="0px")),"tablet2"===i&&(s-(h=s%4)-1<e?(3===h&&(e%4==0&&(t.style.top="50px"),e%4==1&&(t.style.top="0px"),e%4==2&&(t.style.top="25px")),2===h&&(e%4==0&&(t.style.top="25px"),e%4==1&&(t.style.top="0px"))):e%4==0?t.style.top="0px":e%4==1?t.style.top="50px":e%4==2?t.style.top="0px":e%4==3&&(t.style.top="25px")),"tablet1"===i&&(s-(h=s%3)-1<e?2===h&&(e%3==0&&(t.style.top="25px"),e%3==1&&(t.style.top="0px")):e%3==0?t.style.top="0px":e%3==1?t.style.top="50px":e%3==2&&(t.style.top="0px")),"mobile"===i&&(s-(h=s%2)-1<e?1===h&&e%2==0&&(t.style.top="0px"):e%4==0?t.style.top="0px":e%4==1?t.style.top="50px":e%4==2?t.style.top="0px":e%4==3&&(t.style.top="25px"))},i=function(){(a=document.getElementById("team-align"))&&(o=a.getElementsByClassName("item"),s=o.length,e())};return{init:function(){i(),n.eventEmitter.subscribe(e),t.subscribe(function(t){"mutate"===t.type&&i()})}}}),define("page-name/page-name.view",["dispatcher","page-name/page-name.store","TweenMax"],function(a,i,r){"use strict";var o,n,s,h,l={},c=1,u=!1,t=function(t){var e;e=(t=i.getData()).containerActive,o&&(l.hasOwnProperty(n)&&l[n].element.classList.remove("active"),n=t.active,l.hasOwnProperty(n)&&l[n].element.classList.add("active"),!u&&e?(u=!0,o.classList.add("page-name-active"),r.to(h,.3,{x:"-140px",width:"75px",opacity:"0"})):u&&!e&&(u=!1,o.classList.remove("page-name-active"),r.to(h,.3,{x:"0px",width:"27px",opacity:"1"})))};return{init:function(){(function(){var t;if(t=document.getElementsByClassName("page-name"),o=document.getElementsByTagName("header")[0],s=document.getElementById("menu-btn"),o&&s){h=s.getElementsByClassName("b2")[0];for(var e=0;e<t.length;e++)i=l,r=t[e],n=void 0,(n=r.getAttribute("data-id"))||(n="page-id-"+c,c++,r.setAttribute("data-id",n)),r.classList.contains("active")&&a.dispatch({type:"page-name-change",id:n}),i[n]={id:n,element:r};var i,r,n}else console.warn("don't fuck with my code!")})(),t(),i.eventEmitter.subscribe(t)}}}),define("page-name/page-name-scroll.view",["dispatcher","scroll/scroll.store","resize/resize.store","utils"],function(e,i,t,r){"use strict";var n,a,o,s=!1,h=function(){n&&(o=t.getData().height,a=r.offset(n).top)},l=function(){var t=i.getData();n&&(t.top>a-o/2&&!s&&(s=!0,e.dispatch({type:"page-name-change",id:"projects"})),t.top<=a-o/2&&s&&(s=!1,e.dispatch({type:"page-name-change",id:!1})))},c=function(){var t=document.getElementsByClassName("project-name-scroll");s=!1,n=!(!t||!t.length)&&t[0]};return{init:function(){c(),h(),l(),t.eventEmitter.subscribe(h),i.eventEmitter.subscribe(l),e.subscribe(function(t){"mutate"===t.type&&(setTimeout(function(){c(),h(),l()},0),setTimeout(function(){l()},1e3))})}}}),define("timer/timer.view",["dispatcher"],function(t){"use strict";var s,h,o=1,l={},c=!1,e=function(){var t=new Date,e=new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),t.getUTCHours()+3,t.getUTCMinutes(),t.getUTCSeconds()),i=new Date(e),r=i.getHours(),n=i.getMinutes(),a=r,o=12<=r?"pm":"am";s&&h&&((r=(r%=12)||12)<10&&(r="0"+r),n<10&&(n="0"+n),h.innerHTML=r+":"+n+" "+o,function(t){for(var e in l)if(l.hasOwnProperty(e)&&t>=l[e].start&&t<l[e].stop){if(c===e)return;c=e,s.innerHTML=l[e].text}}(a))},i=function(){var t,e,i,r,n=document.getElementsByClassName("timer-item");if(s=document.getElementById("timer-view"),h=document.getElementById("timer-time"),s&&h)for(var a=0;a<n.length;a++)t=n[a],r=i=e=void 0,e=t.getAttribute("data-id"),i=t.getAttribute("data-start"),r=t.getAttribute("data-stop"),i&&r?(i=parseInt(i),r=parseInt(r),e||(e="timer-id-"+o,o++),l[e]={id:e,element:t,text:t.innerHTML,start:i,stop:r}):console.warn("data-stop or data-start attributes are missing")};return{init:function(){i(),setInterval(e,100),t.subscribe(function(t){"mutate"===t.type&&i()})}}}),define("team/team.view",["dispatcher","utils"],function(t,e){"use strict";var n,a,s=[],h={},l=1,c=0,o=0,u=function(){var e=Math.floor(1*Math.random())+3,i=(Math.floor(500*Math.random()),this.getElementsByClassName("img")[0]),r=function(t){++o%8==0&&(s[t].img.style.opacity=1,s[t-1]&&(s[t-1].img.style.opacity=0),t++),t<e?a(function(){r(t)},60):s[t-1]&&(s[t-1].img.style.opacity=0)};clearTimeout(n),function(t){for(var e=t.length-1;0<e;e--){var i=Math.floor(Math.random()*(e+1)),r=t[e];t[e]=t[i],t[i]=r}}(s),e>s.length&&(e=s.length),function(){for(var t=0;t<e;t++)i.appendChild(s[t].img);for(t=0;t<s.length;t++)s[t].img.style.opacity=0}(),n=setTimeout(function(){r(0)},Math.floor(500*Math.random()))},d=function(){clearTimeout(n)},i=function(){var t,e,i,r=document.getElementsByClassName("team-view"),n=document.getElementsByClassName("dynamic-img");if(s=[],r&&r.length&&n&&n.length){for(var a=0;a<n.length;a++)t=n[a],e=void 0,(i=t.getAttribute("data-src"))?((e=document.createElement("img")).src=i,e.classList.add("hover-img"),s.push({testNum:c,element:t,img:e}),c++):console.warn("data-src attribute is missing");for(a=0;a<r.length;a++)!function(t,e){var i,r,n,a=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){a=!0;break}a||(i=t,(n=(r=e).getAttribute("data-id"))||(n="team-id-"+l,l++),i[n]={id:n,element:r},r.addEventListener("mouseenter",u),r.addEventListener("mouseleave",d))}(h,r[a]);for(var o in h)h.hasOwnProperty(o)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(h,r,h[o])}};return{init:function(){i(),a=e.getRequestAnimationFrame(),t.subscribe(function(t){"mutate"===t.type&&i()})}}}),define("share/share.view",["dispatcher","resize/resize.store"],function(t,s){"use strict";var r={},h=1,e=function(){var t;t=document.getElementsByClassName("view-share");for(var e=0;e<t.length;e++)!function(t,e){var i,a,r,n=!1;for(var o in t)if(t.hasOwnProperty(o)&&t[o].element===e){n=!0;break}n||(i=t,(r=(a=e).getAttribute("data-id"))||(r="share-id-"+h,h++),i[r]={id:r,element:a},a.addEventListener("click",function(t){var e,i,r=s.getData().height,n=s.getData().width;t.preventDefault(),e=(r-400)/2,i=(n-600)/2,window.open(a.href,"Share","top="+e+",left="+i+",width=600,height=400")}))}(r,t[e]);for(var i in r)r.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}r||delete t[i.id]}(r,t,r[i])};return{init:function(){e(),t.subscribe(function(t){"mutate"===t.type&&e()})}}}),define("video/video.view",["dispatcher","video/video.store","utils","touch/touch.store"],function(o,n,t,e){"use strict";var a={},s=1,i=function(){var t,e,i=n.getData();for(var r in a)t=a[r],void 0,(e=i.items[t.id])?e.status!==t.status&&(t.status=e.status,"ready"===t.status&&o.dispatch({type:"video-play",me:"video.view",id:r}),"play"===t.status&&t.element.play(),"stop"===t.status&&(t.element.currentTime=0,t.element.pause())):console.warn("item with id "+t.id+" is missing in store")},h=function(t,e){var i,r,n,a=e.getAttribute("data-id");if(a||(a="video-id-"+s,s++),i=e.getAttribute("data-src")){if(-1===(n=i.lastIndexOf(".")))return void console.warn("invalid video source");if(i=i.substring(0,n),console.log(i),r=document.createElement("source"),e.appendChild(r),e.canPlayType('video/webm; codecs="vp8, vorbis"'))r.src=i+".webm",r.type="video/webm";else if(e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'))r.src=i+".mp4",r.type="video/mp4";else{if(!e.canPlayType('video/ogg; codecs="theora, vorbis"'))return;r.src=i+".ogv",r.type="video/ogg"}t[a]={id:a,element:e,status:"not-ready"},o.dispatch({type:"video-add",id:a}),e.addEventListener("canplaythrough",function(){e.style.opacity=1,o.dispatch({type:"video-ready",id:a,me:"video.view"})},!1),e.load()}},r=function(){var t;t=document.getElementsByTagName("video");for(var e=0;e<t.length;e++)!function(t,e){var i=!1;for(var r in t)if(t.hasOwnProperty(r)&&t[r].element===e){i=!0;break}i||h(t,e)}(a,t[e]);for(var i in a)a.hasOwnProperty(i)&&function(t,e,i){for(var r=(i.element,!1),n=0;n<e.length;n++)if(e[n]===i.element){r=!0;break}var a;r||(delete t[(a=i).id],o.dispatch({type:"video-remove",id:a.id}))}(a,t,a[i])};return{init:function(){r(),i(),n.eventEmitter.subscribe(i),o.subscribe(function(t){"mutate"===t.type&&(r(),i())})}}});var THREE={REVISION:"71"};"object"==typeof module&&(module.exports=THREE),void 0===Math.sign&&(Math.sign=function(t){return t<0?-1:0<t?1:+t}),THREE.log=function(){console.log.apply(console,arguments)},THREE.warn=function(){console.warn.apply(console,arguments)},THREE.error=function(){console.error.apply(console,arguments)},THREE.MOUSE={LEFT:0,MIDDLE:1,RIGHT:2},THREE.CullFaceNone=0,THREE.CullFaceBack=1,THREE.CullFaceFront=2,THREE.CullFaceFrontBack=3,THREE.FrontFaceDirectionCW=0,THREE.FrontFaceDirectionCCW=1,THREE.BasicShadowMap=0,THREE.PCFShadowMap=1,THREE.PCFSoftShadowMap=2,THREE.FrontSide=0,THREE.BackSide=1,THREE.DoubleSide=2,THREE.NoShading=0,THREE.FlatShading=1,THREE.SmoothShading=2,THREE.NoColors=0,THREE.FaceColors=1,THREE.VertexColors=2,THREE.NoBlending=0,THREE.NormalBlending=1,THREE.AdditiveBlending=2,THREE.SubtractiveBlending=3,THREE.MultiplyBlending=4,THREE.CustomBlending=5,THREE.AddEquation=100,THREE.SubtractEquation=101,THREE.ReverseSubtractEquation=102,THREE.MinEquation=103,THREE.MaxEquation=104,THREE.ZeroFactor=200,THREE.OneFactor=201,THREE.SrcColorFactor=202,THREE.OneMinusSrcColorFactor=203,THREE.SrcAlphaFactor=204,THREE.OneMinusSrcAlphaFactor=205,THREE.DstAlphaFactor=206,THREE.OneMinusDstAlphaFactor=207,THREE.DstColorFactor=208,THREE.OneMinusDstColorFactor=209,THREE.SrcAlphaSaturateFactor=210,THREE.MultiplyOperation=0,THREE.MixOperation=1,THREE.AddOperation=2,THREE.UVMapping=300,THREE.CubeReflectionMapping=301,THREE.CubeRefractionMapping=302,THREE.EquirectangularReflectionMapping=303,THREE.EquirectangularRefractionMapping=304,THREE.SphericalReflectionMapping=305,THREE.RepeatWrapping=1e3,THREE.ClampToEdgeWrapping=1001,THREE.MirroredRepeatWrapping=1002,THREE.NearestFilter=1003,THREE.NearestMipMapNearestFilter=1004,THREE.NearestMipMapLinearFilter=1005,THREE.LinearFilter=1006,THREE.LinearMipMapNearestFilter=1007,THREE.LinearMipMapLinearFilter=1008,THREE.UnsignedByteType=1009,THREE.ByteType=1010,THREE.ShortType=1011,THREE.UnsignedShortType=1012,THREE.IntType=1013,THREE.UnsignedIntType=1014,THREE.FloatType=1015,THREE.HalfFloatType=1025,THREE.UnsignedShort4444Type=1016,THREE.UnsignedShort5551Type=1017,THREE.UnsignedShort565Type=1018,THREE.AlphaFormat=1019,THREE.RGBFormat=1020,THREE.RGBAFormat=1021,THREE.LuminanceFormat=1022,THREE.LuminanceAlphaFormat=1023,THREE.RGBEFormat=THREE.RGBAFormat,THREE.RGB_S3TC_DXT1_Format=2001,THREE.RGBA_S3TC_DXT1_Format=2002,THREE.RGBA_S3TC_DXT3_Format=2003,THREE.RGBA_S3TC_DXT5_Format=2004,THREE.RGB_PVRTC_4BPPV1_Format=2100,THREE.RGB_PVRTC_2BPPV1_Format=2101,THREE.RGBA_PVRTC_4BPPV1_Format=2102,THREE.RGBA_PVRTC_2BPPV1_Format=2103,THREE.Projector=function(){THREE.error("THREE.Projector has been moved to /examples/js/renderers/Projector.js."),this.projectVector=function(t,e){THREE.warn("THREE.Projector: .projectVector() is now vector.project()."),t.project(e)},this.unprojectVector=function(t,e){THREE.warn("THREE.Projector: .unprojectVector() is now vector.unproject()."),t.unproject(e)},this.pickingRay=function(t,e){THREE.error("THREE.Projector: .pickingRay() is now raycaster.setFromCamera().")}},THREE.CanvasRenderer=function(){THREE.error("THREE.CanvasRenderer has been moved to /examples/js/renderers/CanvasRenderer.js"),this.domElement=document.createElement("canvas"),this.clear=function(){},this.render=function(){},this.setClearColor=function(){},this.setSize=function(){}},THREE.Color=function(t){return 3===arguments.length?this.setRGB(t,arguments[1],arguments[2]):this.set(t)},THREE.Color.prototype={constructor:THREE.Color,r:1,g:1,b:1,set:function(t){return t instanceof THREE.Color?this.copy(t):"number"==typeof t?this.setHex(t):"string"==typeof t&&this.setStyle(t),this},setHex:function(t){return t=Math.floor(t),this.r=(t>>16&255)/255,this.g=(t>>8&255)/255,this.b=(255&t)/255,this},setRGB:function(t,e,i){return this.r=t,this.g=e,this.b=i,this},setHSL:function(t,e,i){if(0===e)this.r=this.g=this.b=i;else{var r=function(t,e,i){return i<0&&(i+=1),1<i&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+6*(e-t)*(2/3-i):t};i=2*i-(e=i<=.5?i*(1+e):i+e-i*e),this.r=r(i,e,t+1/3),this.g=r(i,e,t),this.b=r(i,e,t-1/3)}return this},setStyle:function(t){return/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.test(t)?(t=/^rgb\((\d+), ?(\d+), ?(\d+)\)$/i.exec(t),this.r=Math.min(255,parseInt(t[1],10))/255,this.g=Math.min(255,parseInt(t[2],10))/255,this.b=Math.min(255,parseInt(t[3],10))/255,this):/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.test(t)?(t=/^rgb\((\d+)\%, ?(\d+)\%, ?(\d+)\%\)$/i.exec(t),this.r=Math.min(100,parseInt(t[1],10))/100,this.g=Math.min(100,parseInt(t[2],10))/100,this.b=Math.min(100,parseInt(t[3],10))/100,this):/^\#([0-9a-f]{6})$/i.test(t)?(t=/^\#([0-9a-f]{6})$/i.exec(t),this.setHex(parseInt(t[1],16)),this):/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.test(t)?(t=/^\#([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(t),this.setHex(parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3],16)),this):/^(\w+)$/i.test(t)?(this.setHex(THREE.ColorKeywords[t]),this):void 0},copy:function(t){return this.r=t.r,this.g=t.g,this.b=t.b,this},copyGammaToLinear:function(t,e){return void 0===e&&(e=2),this.r=Math.pow(t.r,e),this.g=Math.pow(t.g,e),this.b=Math.pow(t.b,e),this},copyLinearToGamma:function(t,e){void 0===e&&(e=2);var i=0<e?1/e:1;return this.r=Math.pow(t.r,i),this.g=Math.pow(t.g,i),this.b=Math.pow(t.b,i),this},convertGammaToLinear:function(){var t=this.r,e=this.g,i=this.b;return this.r=t*t,this.g=e*e,this.b=i*i,this},convertLinearToGamma:function(){return this.r=Math.sqrt(this.r),this.g=Math.sqrt(this.g),this.b=Math.sqrt(this.b),this},getHex:function(){return 255*this.r<<16^255*this.g<<8^255*this.b<<0},getHexString:function(){return("000000"+this.getHex().toString(16)).slice(-6)},getHSL:function(t){t=t||{h:0,s:0,l:0};var e,i=this.r,r=this.g,n=this.b,a=Math.max(i,r,n),o=((h=Math.min(i,r,n))+a)/2;if(h===a)h=e=0;else{var s=a-h,h=o<=.5?s/(a+h):s/(2-a-h);switch(a){case i:e=(r-n)/s+(r<n?6:0);break;case r:e=(n-i)/s+2;break;case n:e=(i-r)/s+4}e/=6}return t.h=e,t.s=h,t.l=o,t},getStyle:function(){return"rgb("+(255*this.r|0)+","+(255*this.g|0)+","+(255*this.b|0)+")"},offsetHSL:function(t,e,i){var r=this.getHSL();return r.h+=t,r.s+=e,r.l+=i,this.setHSL(r.h,r.s,r.l),this},add:function(t){return this.r+=t.r,this.g+=t.g,this.b+=t.b,this},addColors:function(t,e){return this.r=t.r+e.r,this.g=t.g+e.g,this.b=t.b+e.b,this},addScalar:function(t){return this.r+=t,this.g+=t,this.b+=t,this},multiply:function(t){return this.r*=t.r,this.g*=t.g,this.b*=t.b,this},multiplyScalar:function(t){return this.r*=t,this.g*=t,this.b*=t,this},lerp:function(t,e){return this.r+=(t.r-this.r)*e,this.g+=(t.g-this.g)*e,this.b+=(t.b-this.b)*e,this},equals:function(t){return t.r===this.r&&t.g===this.g&&t.b===this.b},fromArray:function(t){return this.r=t[0],this.g=t[1],this.b=t[2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.r,t[e+1]=this.g,t[e+2]=this.b,t},clone:function(){return(new THREE.Color).setRGB(this.r,this.g,this.b)}},THREE.ColorKeywords={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},THREE.Quaternion=function(t,e,i,r){this._x=t||0,this._y=e||0,this._z=i||0,this._w=void 0!==r?r:1},THREE.Quaternion.prototype={constructor:THREE.Quaternion,_x:0,_y:0,_z:0,_w:0,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get w(){return this._w},set w(t){this._w=t,this.onChangeCallback()},set:function(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._w=r,this.onChangeCallback(),this},copy:function(t){return this._x=t.x,this._y=t.y,this._z=t.z,this._w=t.w,this.onChangeCallback(),this},setFromEuler:function(t,e){if(0==t instanceof THREE.Euler)throw Error("THREE.Quaternion: .setFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var i=Math.cos(t._x/2),r=Math.cos(t._y/2),n=Math.cos(t._z/2),a=Math.sin(t._x/2),o=Math.sin(t._y/2),s=Math.sin(t._z/2);return"XYZ"===t.order?(this._x=a*r*n+i*o*s,this._y=i*o*n-a*r*s,this._z=i*r*s+a*o*n,this._w=i*r*n-a*o*s):"YXZ"===t.order?(this._x=a*r*n+i*o*s,this._y=i*o*n-a*r*s,this._z=i*r*s-a*o*n,this._w=i*r*n+a*o*s):"ZXY"===t.order?(this._x=a*r*n-i*o*s,this._y=i*o*n+a*r*s,this._z=i*r*s+a*o*n,this._w=i*r*n-a*o*s):"ZYX"===t.order?(this._x=a*r*n-i*o*s,this._y=i*o*n+a*r*s,this._z=i*r*s-a*o*n,this._w=i*r*n+a*o*s):"YZX"===t.order?(this._x=a*r*n+i*o*s,this._y=i*o*n+a*r*s,this._z=i*r*s-a*o*n,this._w=i*r*n-a*o*s):"XZY"===t.order&&(this._x=a*r*n-i*o*s,this._y=i*o*n-a*r*s,this._z=i*r*s+a*o*n,this._w=i*r*n+a*o*s),!1!==e&&this.onChangeCallback(),this},setFromAxisAngle:function(t,e){var i=e/2,r=Math.sin(i);return this._x=t.x*r,this._y=t.y*r,this._z=t.z*r,this._w=Math.cos(i),this.onChangeCallback(),this},setFromRotationMatrix:function(t){var e=(i=t.elements)[0];t=i[4];var i,r=i[8],n=i[1],a=i[5],o=i[9],s=i[2],h=i[6],l=e+a+(i=i[10]);return 0<l?(e=.5/Math.sqrt(l+1),this._w=.25/e,this._x=(h-o)*e,this._y=(r-s)*e,this._z=(n-t)*e):a<e&&i<e?(e=2*Math.sqrt(1+e-a-i),this._w=(h-o)/e,this._x=.25*e,this._y=(t+n)/e,this._z=(r+s)/e):i<a?(e=2*Math.sqrt(1+a-e-i),this._w=(r-s)/e,this._x=(t+n)/e,this._y=.25*e,this._z=(o+h)/e):(e=2*Math.sqrt(1+i-e-a),this._w=(n-t)/e,this._x=(r+s)/e,this._y=(o+h)/e,this._z=.25*e),this.onChangeCallback(),this},setFromUnitVectors:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector3),(r=t.dot(e)+1)<1e-6?(r=0,Math.abs(t.x)>Math.abs(t.z)?i.set(-t.y,t.x,0):i.set(0,-t.z,t.y)):i.crossVectors(t,e),this._x=i.x,this._y=i.y,this._z=i.z,this._w=r,this.normalize(),this}}(),inverse:function(){return this.conjugate().normalize(),this},conjugate:function(){return this._x*=-1,this._y*=-1,this._z*=-1,this.onChangeCallback(),this},dot:function(t){return this._x*t._x+this._y*t._y+this._z*t._z+this._w*t._w},lengthSq:function(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w},length:function(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)},normalize:function(){var t=this.length();return 0===t?(this._z=this._y=this._x=0,this._w=1):(t=1/t,this._x*=t,this._y*=t,this._z*=t,this._w*=t),this.onChangeCallback(),this},multiply:function(t,e){return void 0!==e?(THREE.warn("THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead."),this.multiplyQuaternions(t,e)):this.multiplyQuaternions(this,t)},multiplyQuaternions:function(t,e){var i=t._x,r=t._y,n=t._z,a=t._w,o=e._x,s=e._y,h=e._z,l=e._w;return this._x=i*l+a*o+r*h-n*s,this._y=r*l+a*s+n*o-i*h,this._z=n*l+a*h+i*s-r*o,this._w=a*l-i*o-r*s-n*h,this.onChangeCallback(),this},multiplyVector3:function(t){return THREE.warn("THREE.Quaternion: .multiplyVector3() has been removed. Use is now vector.applyQuaternion( quaternion ) instead."),t.applyQuaternion(this)},slerp:function(t,e){if(0===e)return this;if(1===e)return this.copy(t);var i=this._x,r=this._y,n=this._z,a=this._w,o=a*t._w+i*t._x+r*t._y+n*t._z;if(o<0?(this._w=-t._w,this._x=-t._x,this._y=-t._y,this._z=-t._z,o=-o):this.copy(t),1<=o)return this._w=a,this._x=i,this._y=r,this._z=n,this;var s=Math.acos(o),h=Math.sqrt(1-o*o);return Math.abs(h)<.001?(this._w=.5*(a+this._w),this._x=.5*(i+this._x),this._y=.5*(r+this._y),this._z=.5*(n+this._z)):(o=Math.sin((1-e)*s)/h,s=Math.sin(e*s)/h,this._w=a*o+this._w*s,this._x=i*o+this._x*s,this._y=r*o+this._y*s,this._z=n*o+this._z*s,this.onChangeCallback()),this},equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._w===this._w},fromArray:function(t,e){return void 0===e&&(e=0),this._x=t[e],this._y=t[e+1],this._z=t[e+2],this._w=t[e+3],this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._w,t},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){},clone:function(){return new THREE.Quaternion(this._x,this._y,this._z,this._w)}},THREE.Quaternion.slerp=function(t,e,i,r){return i.copy(t).slerp(e,r)},THREE.Vector2=function(t,e){this.x=t||0,this.y=e||0},THREE.Vector2.prototype={constructor:THREE.Vector2,set:function(t,e){return this.x=t,this.y=e,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;default:throw Error("index is out of range: "+t)}},copy:function(t){return this.x=t.x,this.y=t.y,this},add:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this)},addScalar:function(t){return this.x+=t,this.y+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this},sub:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this)},subScalar:function(t){return this.x-=t,this.y-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this},multiply:function(t){return this.x*=t.x,this.y*=t.y,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this},divide:function(t){return this.x/=t.x,this.y/=t.y,this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t):this.y=this.x=0,this},min:function(t){return this.x>t.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this},max:function(t){return this.x<t.x&&(this.x=t.x),this.y<t.y&&(this.y=t.y),this},clamp:function(t,e){return this.x<t.x?this.x=t.x:this.x>e.x&&(this.x=e.x),this.y<t.y?this.y=t.y:this.y>e.y&&(this.y=e.y),this},clampScalar:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector2,r=new THREE.Vector2),i.set(t,t),r.set(e,e),this.clamp(i,r)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this},negate:function(){return this.x=-this.x,this.y=-this.y,this},dot:function(t){return this.x*t.x+this.y*t.y},lengthSq:function(){return this.x*this.x+this.y*this.y},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},normalize:function(){return this.divideScalar(this.length())},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x;return e*e+(t=this.y-t.y)*t},setLength:function(t){var e=this.length();return 0!==e&&t!==e&&this.multiplyScalar(t/e),this},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this},clone:function(){return new THREE.Vector2(this.x,this.y)}},THREE.Vector3=function(t,e,i){this.x=t||0,this.y=e||0,this.z=i||0},THREE.Vector3.prototype={constructor:THREE.Vector3,set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw Error("index is out of range: "+t)}},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},add:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this},sub:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this},multiply:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead."),this.multiplyVectors(t,e)):(this.x*=t.x,this.y*=t.y,this.z*=t.z,this)},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multiplyVectors:function(t,e){return this.x=t.x*e.x,this.y=t.y*e.y,this.z=t.z*e.z,this},applyEuler:function(){var e;return function(t){return 0==t instanceof THREE.Euler&&THREE.error("THREE.Vector3: .applyEuler() now expects a Euler rotation rather than a Vector3 and order."),void 0===e&&(e=new THREE.Quaternion),this.applyQuaternion(e.setFromEuler(t)),this}}(),applyAxisAngle:function(){var i;return function(t,e){return void 0===i&&(i=new THREE.Quaternion),this.applyQuaternion(i.setFromAxisAngle(t,e)),this}}(),applyMatrix3:function(t){var e=this.x,i=this.y,r=this.z;return t=t.elements,this.x=t[0]*e+t[3]*i+t[6]*r,this.y=t[1]*e+t[4]*i+t[7]*r,this.z=t[2]*e+t[5]*i+t[8]*r,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*r+t[12],this.y=t[1]*e+t[5]*i+t[9]*r+t[13],this.z=t[2]*e+t[6]*i+t[10]*r+t[14],this},applyProjection:function(t){var e=this.x,i=this.y,r=this.z,n=1/((t=t.elements)[3]*e+t[7]*i+t[11]*r+t[15]);return this.x=(t[0]*e+t[4]*i+t[8]*r+t[12])*n,this.y=(t[1]*e+t[5]*i+t[9]*r+t[13])*n,this.z=(t[2]*e+t[6]*i+t[10]*r+t[14])*n,this},applyQuaternion:function(t){var e=this.x,i=this.y,r=this.z,n=t.x,a=t.y,o=t.z,s=(t=t.w)*e+a*r-o*i,h=t*i+o*e-n*r,l=t*r+n*i-a*e;e=-n*e-a*i-o*r;return this.x=s*t+e*-n+h*-o-l*-a,this.y=h*t+e*-a+l*-n-s*-o,this.z=l*t+e*-o+s*-a-h*-n,this},project:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.projectionMatrix,e.getInverse(t.matrixWorld)),this.applyProjection(e)}}(),unproject:function(){var e;return function(t){return void 0===e&&(e=new THREE.Matrix4),e.multiplyMatrices(t.matrixWorld,e.getInverse(t.projectionMatrix)),this.applyProjection(e)}}(),transformDirection:function(t){var e=this.x,i=this.y,r=this.z;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*r,this.y=t[1]*e+t[5]*i+t[9]*r,this.z=t[2]*e+t[6]*i+t[10]*r,this.normalize(),this},divide:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t,this.z*=t):this.z=this.y=this.x=0,this},min:function(t){return this.x>t.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this.z>t.z&&(this.z=t.z),this},max:function(t){return this.x<t.x&&(this.x=t.x),this.y<t.y&&(this.y=t.y),this.z<t.z&&(this.z=t.z),this},clamp:function(t,e){return this.x<t.x?this.x=t.x:this.x>e.x&&(this.x=e.x),this.y<t.y?this.y=t.y:this.y>e.y&&(this.y=e.y),this.z<t.z?this.z=t.z:this.z>e.z&&(this.z=e.z),this},clampScalar:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector3,r=new THREE.Vector3),i.set(t,t,t),r.set(e,e,e),this.clamp(i,r)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){var e=this.length();return 0!==e&&t!==e&&this.multiplyScalar(t/e),this},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t),this},cross:function(t,e){if(void 0!==e)return THREE.warn("THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead."),this.crossVectors(t,e);var i=this.x,r=this.y,n=this.z;return this.x=r*t.z-n*t.y,this.y=n*t.x-i*t.z,this.z=i*t.y-r*t.x,this},crossVectors:function(t,e){var i=t.x,r=t.y,n=t.z,a=e.x,o=e.y,s=e.z;return this.x=r*s-n*o,this.y=n*a-i*s,this.z=i*o-r*a,this},projectOnVector:function(){var e,i;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(t).normalize(),i=this.dot(e),this.copy(e).multiplyScalar(i)}}(),projectOnPlane:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),e.copy(this).projectOnVector(t),this.sub(e)}}(),reflect:function(){var e;return function(t){return void 0===e&&(e=new THREE.Vector3),this.sub(e.copy(t).multiplyScalar(2*this.dot(t)))}}(),angleTo:function(t){return t=this.dot(t)/(this.length()*t.length()),Math.acos(THREE.Math.clamp(t,-1,1))},distanceTo:function(t){return Math.sqrt(this.distanceToSquared(t))},distanceToSquared:function(t){var e=this.x-t.x,i=this.y-t.y;return e*e+i*i+(t=this.z-t.z)*t},setEulerFromRotationMatrix:function(t,e){THREE.error("THREE.Vector3: .setEulerFromRotationMatrix() has been removed. Use Euler.setFromRotationMatrix() instead.")},setEulerFromQuaternion:function(t,e){THREE.error("THREE.Vector3: .setEulerFromQuaternion() has been removed. Use Euler.setFromQuaternion() instead.")},getPositionFromMatrix:function(t){return THREE.warn("THREE.Vector3: .getPositionFromMatrix() has been renamed to .setFromMatrixPosition()."),this.setFromMatrixPosition(t)},getScaleFromMatrix:function(t){return THREE.warn("THREE.Vector3: .getScaleFromMatrix() has been renamed to .setFromMatrixScale()."),this.setFromMatrixScale(t)},getColumnFromMatrix:function(t,e){return THREE.warn("THREE.Vector3: .getColumnFromMatrix() has been renamed to .setFromMatrixColumn()."),this.setFromMatrixColumn(t,e)},setFromMatrixPosition:function(t){return this.x=t.elements[12],this.y=t.elements[13],this.z=t.elements[14],this},setFromMatrixScale:function(t){var e=this.set(t.elements[0],t.elements[1],t.elements[2]).length(),i=this.set(t.elements[4],t.elements[5],t.elements[6]).length();return t=this.set(t.elements[8],t.elements[9],t.elements[10]).length(),this.x=e,this.y=i,this.z=t,this},setFromMatrixColumn:function(t,e){var i=4*t,r=e.elements;return this.x=r[i],this.y=r[i+1],this.z=r[i+2],this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this},clone:function(){return new THREE.Vector3(this.x,this.y,this.z)}},THREE.Vector4=function(t,e,i,r){this.x=t||0,this.y=e||0,this.z=i||0,this.w=void 0!==r?r:1},THREE.Vector4.prototype={constructor:THREE.Vector4,set:function(t,e,i,r){return this.x=t,this.y=e,this.z=i,this.w=r,this},setX:function(t){return this.x=t,this},setY:function(t){return this.y=t,this},setZ:function(t){return this.z=t,this},setW:function(t){return this.w=t,this},setComponent:function(t,e){switch(t){case 0:this.x=e;break;case 1:this.y=e;break;case 2:this.z=e;break;case 3:this.w=e;break;default:throw Error("index is out of range: "+t)}},getComponent:function(t){switch(t){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw Error("index is out of range: "+t)}},copy:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=void 0!==t.w?t.w:1,this},add:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead."),this.addVectors(t,e)):(this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this)},addScalar:function(t){return this.x+=t,this.y+=t,this.z+=t,this.w+=t,this},addVectors:function(t,e){return this.x=t.x+e.x,this.y=t.y+e.y,this.z=t.z+e.z,this.w=t.w+e.w,this},sub:function(t,e){return void 0!==e?(THREE.warn("THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead."),this.subVectors(t,e)):(this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this)},subScalar:function(t){return this.x-=t,this.y-=t,this.z-=t,this.w-=t,this},subVectors:function(t,e){return this.x=t.x-e.x,this.y=t.y-e.y,this.z=t.z-e.z,this.w=t.w-e.w,this},multiplyScalar:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},applyMatrix4:function(t){var e=this.x,i=this.y,r=this.z,n=this.w;return t=t.elements,this.x=t[0]*e+t[4]*i+t[8]*r+t[12]*n,this.y=t[1]*e+t[5]*i+t[9]*r+t[13]*n,this.z=t[2]*e+t[6]*i+t[10]*r+t[14]*n,this.w=t[3]*e+t[7]*i+t[11]*r+t[15]*n,this},divideScalar:function(t){return 0!==t?(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t):(this.z=this.y=this.x=0,this.w=1),this},setAxisAngleFromQuaternion:function(t){this.w=2*Math.acos(t.w);var e=Math.sqrt(1-t.w*t.w);return e<1e-4?(this.x=1,this.z=this.y=0):(this.x=t.x/e,this.y=t.y/e,this.z=t.z/e),this},setAxisAngleFromRotationMatrix:function(t){var e,i,r,n=(t=t.elements)[0];r=t[4];var a=t[8],o=t[1],s=t[5],h=t[9];i=t[2],e=t[6];var l=t[10];return Math.abs(r-o)<.01&&Math.abs(a-i)<.01&&Math.abs(h-e)<.01?Math.abs(r+o)<.1&&Math.abs(a+i)<.1&&Math.abs(h+e)<.1&&Math.abs(n+s+l-3)<.1?this.set(1,0,0,0):(t=Math.PI,l=(l+1)/2,r=(r+o)/4,a=(a+i)/4,h=(h+e)/4,(s=(s+1)/2)<(n=(n+1)/2)&&l<n?n<.01?(e=0,r=i=.707106781):(i=r/(e=Math.sqrt(n)),r=a/e):l<s?s<.01?(i=0,r=e=.707106781):(e=r/(i=Math.sqrt(s)),r=h/i):l<.01?(i=e=.707106781,r=0):(e=a/(r=Math.sqrt(l)),i=h/r),this.set(e,i,r,t)):(t=Math.sqrt((e-h)*(e-h)+(a-i)*(a-i)+(o-r)*(o-r)),Math.abs(t)<.001&&(t=1),this.x=(e-h)/t,this.y=(a-i)/t,this.z=(o-r)/t,this.w=Math.acos((n+s+l-1)/2)),this},min:function(t){return this.x>t.x&&(this.x=t.x),this.y>t.y&&(this.y=t.y),this.z>t.z&&(this.z=t.z),this.w>t.w&&(this.w=t.w),this},max:function(t){return this.x<t.x&&(this.x=t.x),this.y<t.y&&(this.y=t.y),this.z<t.z&&(this.z=t.z),this.w<t.w&&(this.w=t.w),this},clamp:function(t,e){return this.x<t.x?this.x=t.x:this.x>e.x&&(this.x=e.x),this.y<t.y?this.y=t.y:this.y>e.y&&(this.y=e.y),this.z<t.z?this.z=t.z:this.z>e.z&&(this.z=e.z),this.w<t.w?this.w=t.w:this.w>e.w&&(this.w=e.w),this},clampScalar:function(){var i,r;return function(t,e){return void 0===i&&(i=new THREE.Vector4,r=new THREE.Vector4),i.set(t,t,t,t),r.set(e,e,e,e),this.clamp(i,r)}}(),floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this},ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this},round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this},roundToZero:function(){return this.x=this.x<0?Math.ceil(this.x):Math.floor(this.x),this.y=this.y<0?Math.ceil(this.y):Math.floor(this.y),this.z=this.z<0?Math.ceil(this.z):Math.floor(this.z),this.w=this.w<0?Math.ceil(this.w):Math.floor(this.w),this},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},lengthSq:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},length:function(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)},lengthManhattan:function(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)},normalize:function(){return this.divideScalar(this.length())},setLength:function(t){var e=this.length();return 0!==e&&t!==e&&this.multiplyScalar(t/e),this},lerp:function(t,e){return this.x+=(t.x-this.x)*e,this.y+=(t.y-this.y)*e,this.z+=(t.z-this.z)*e,this.w+=(t.w-this.w)*e,this},lerpVectors:function(t,e,i){return this.subVectors(e,t).multiplyScalar(i).add(t),this},equals:function(t){return t.x===this.x&&t.y===this.y&&t.z===this.z&&t.w===this.w},fromArray:function(t,e){return void 0===e&&(e=0),this.x=t[e],this.y=t[e+1],this.z=t[e+2],this.w=t[e+3],this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this.x,t[e+1]=this.y,t[e+2]=this.z,t[e+3]=this.w,t},fromAttribute:function(t,e,i){return void 0===i&&(i=0),e=e*t.itemSize+i,this.x=t.array[e],this.y=t.array[e+1],this.z=t.array[e+2],this.w=t.array[e+3],this},clone:function(){return new THREE.Vector4(this.x,this.y,this.z,this.w)}},THREE.Euler=function(t,e,i,r){this._x=t||0,this._y=e||0,this._z=i||0,this._order=r||THREE.Euler.DefaultOrder},THREE.Euler.RotationOrders="XYZ YZX ZXY XZY YXZ ZYX".split(" "),THREE.Euler.DefaultOrder="XYZ",THREE.Euler.prototype={constructor:THREE.Euler,_x:0,_y:0,_z:0,_order:THREE.Euler.DefaultOrder,get x(){return this._x},set x(t){this._x=t,this.onChangeCallback()},get y(){return this._y},set y(t){this._y=t,this.onChangeCallback()},get z(){return this._z},set z(t){this._z=t,this.onChangeCallback()},get order(){return this._order},set order(t){this._order=t,this.onChangeCallback()},set:function(t,e,i,r){return this._x=t,this._y=e,this._z=i,this._order=r||this._order,this.onChangeCallback(),this},copy:function(t){return this._x=t._x,this._y=t._y,this._z=t._z,this._order=t._order,this.onChangeCallback(),this},setFromRotationMatrix:function(t,e,i){var r=THREE.Math.clamp;t=(u=t.elements)[0];var n=u[4],a=u[8],o=u[1],s=u[5],h=u[9],l=u[2],c=u[6],u=u[10];return"XYZ"===(e=e||this._order)?(this._y=Math.asin(r(a,-1,1)),Math.abs(a)<.99999?(this._x=Math.atan2(-h,u),this._z=Math.atan2(-n,t)):(this._x=Math.atan2(c,s),this._z=0)):"YXZ"===e?(this._x=Math.asin(-r(h,-1,1)),Math.abs(h)<.99999?(this._y=Math.atan2(a,u),this._z=Math.atan2(o,s)):(this._y=Math.atan2(-l,t),this._z=0)):"ZXY"===e?(this._x=Math.asin(r(c,-1,1)),Math.abs(c)<.99999?(this._y=Math.atan2(-l,u),this._z=Math.atan2(-n,s)):(this._y=0,this._z=Math.atan2(o,t))):"ZYX"===e?(this._y=Math.asin(-r(l,-1,1)),Math.abs(l)<.99999?(this._x=Math.atan2(c,u),this._z=Math.atan2(o,t)):(this._x=0,this._z=Math.atan2(-n,s))):"YZX"===e?(this._z=Math.asin(r(o,-1,1)),Math.abs(o)<.99999?(this._x=Math.atan2(-h,s),this._y=Math.atan2(-l,t)):(this._x=0,this._y=Math.atan2(a,u))):"XZY"===e?(this._z=Math.asin(-r(n,-1,1)),Math.abs(n)<.99999?(this._x=Math.atan2(c,s),this._y=Math.atan2(a,t)):(this._x=Math.atan2(-h,u),this._y=0)):THREE.warn("THREE.Euler: .setFromRotationMatrix() given unsupported order: "+e),this._order=e,!1!==i&&this.onChangeCallback(),this},setFromQuaternion:function(){var r;return function(t,e,i){return void 0===r&&(r=new THREE.Matrix4),r.makeRotationFromQuaternion(t),this.setFromRotationMatrix(r,e,i),this}}(),setFromVector3:function(t,e){return this.set(t.x,t.y,t.z,e||this._order)},reorder:function(){var e=new THREE.Quaternion;return function(t){e.setFromEuler(this),this.setFromQuaternion(e,t)}}(),equals:function(t){return t._x===this._x&&t._y===this._y&&t._z===this._z&&t._order===this._order},fromArray:function(t){return this._x=t[0],this._y=t[1],this._z=t[2],void 0!==t[3]&&(this._order=t[3]),this.onChangeCallback(),this},toArray:function(t,e){return void 0===t&&(t=[]),void 0===e&&(e=0),t[e]=this._x,t[e+1]=this._y,t[e+2]=this._z,t[e+3]=this._order,t},toVector3:function(t){return t?t.set(this._x,this._y,this._z):new THREE.Vector3(this._x,this._y,this._z)},onChange:function(t){return this.onChangeCallback=t,this},onChangeCallback:function(){},clone:function(){return new THREE.Euler(this._x,this._y,this._z,this._order)}},THREE.Line3=function(t,e){this.start=void 0!==t?t:new THREE.Vector3,this.end=void 0!==e?e:new THREE.Vector3},THREE.Line3.prototype={constructor:THREE.Line3,set:function(t,e){return this.start.copy(t),this.end.copy(e),this},copy:function(t){return this.start.copy(t.start),this.end.copy(t.end),this},center:function(t){return(t||new THREE.Vector3).addVectors(this.start,this.end).multiplyScalar(.5)},delta:function(t){return(t||new THREE.Vector3).subVectors(this.end,this.start)},distanceSq:function(){return this.start.distanceToSquared(this.end)},distance:function(){return this.start.distanceTo(this.end)},at:function(t,e){var i=e||new THREE.Vector3;return this.delta(i).multiplyScalar(t).add(this.start)},closestPointToPointParameter:function(){var r=new THREE.Vector3,n=new THREE.Vector3;return function(t,e){r.subVectors(t,this.start),n.subVectors(this.end,this.start);var i=n.dot(n);i=n.dot(r)/i;return e&&(i=THREE.Math.clamp(i,0,1)),i}}(),closestPointToPoint:function(t,e,i){return t=this.closestPointToPointParameter(t,e),i=i||new THREE.Vector3,this.delta(i).multiplyScalar(t).add(this.start)},applyMatrix4:function(t){return this.start.applyMatrix4(t),this.end.applyMatrix4(t),this},equals:function(t){return t.start.equals(this.start)&&t.end.equals(this.end)},clone:function(){return(new THREE.Line3).copy(this)}},THREE.Box2=function(t,e){this.min=void 0!==t?t:new THREE.Vector2(1/0,1/0),this.max=void 0!==e?e:new THREE.Vector2(-1/0,-1/0)},THREE.Box2.prototype={constructor:THREE.Box2,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var r=new THREE.Vector2;return function(t,e){var i=r.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}}(),copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y},center:function(t){return(t||new THREE.Vector2).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){return(t||new THREE.Vector2).subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y},getParameter:function(t,e){return(e||new THREE.Vector2).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y))},isIntersectionBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y)},clampPoint:function(t,e){return(e||new THREE.Vector2).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector2;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},clone:function(){return(new THREE.Box2).copy(this)}},THREE.Box3=function(t,e){this.min=void 0!==t?t:new THREE.Vector3(1/0,1/0,1/0),this.max=void 0!==e?e:new THREE.Vector3(-1/0,-1/0,-1/0)},THREE.Box3.prototype={constructor:THREE.Box3,set:function(t,e){return this.min.copy(t),this.max.copy(e),this},setFromPoints:function(t){this.makeEmpty();for(var e=0,i=t.length;e<i;e++)this.expandByPoint(t[e]);return this},setFromCenterAndSize:function(){var r=new THREE.Vector3;return function(t,e){var i=r.copy(e).multiplyScalar(.5);return this.min.copy(t).sub(i),this.max.copy(t).add(i),this}}(),setFromObject:function(){var a=new THREE.Vector3;return function(t){var n=this;return t.updateMatrixWorld(!0),this.makeEmpty(),t.traverse(function(t){if(void 0!==(i=t.geometry))if(i instanceof THREE.Geometry)for(var e=i.vertices,i=0,r=e.length;i<r;i++)a.copy(e[i]),a.applyMatrix4(t.matrixWorld),n.expandByPoint(a);else if(i instanceof THREE.BufferGeometry&&void 0!==i.attributes.position)for(e=i.attributes.position.array,i=0,r=e.length;i<r;i+=3)a.set(e[i],e[i+1],e[i+2]),a.applyMatrix4(t.matrixWorld),n.expandByPoint(a)}),this}}(),copy:function(t){return this.min.copy(t.min),this.max.copy(t.max),this},makeEmpty:function(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this},empty:function(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z},center:function(t){return(t||new THREE.Vector3).addVectors(this.min,this.max).multiplyScalar(.5)},size:function(t){return(t||new THREE.Vector3).subVectors(this.max,this.min)},expandByPoint:function(t){return this.min.min(t),this.max.max(t),this},expandByVector:function(t){return this.min.sub(t),this.max.add(t),this},expandByScalar:function(t){return this.min.addScalar(-t),this.max.addScalar(t),this},containsPoint:function(t){return!(t.x<this.min.x||t.x>this.max.x||t.y<this.min.y||t.y>this.max.y||t.z<this.min.z||t.z>this.max.z)},containsBox:function(t){return this.min.x<=t.min.x&&t.max.x<=this.max.x&&this.min.y<=t.min.y&&t.max.y<=this.max.y&&this.min.z<=t.min.z&&t.max.z<=this.max.z},getParameter:function(t,e){return(e||new THREE.Vector3).set((t.x-this.min.x)/(this.max.x-this.min.x),(t.y-this.min.y)/(this.max.y-this.min.y),(t.z-this.min.z)/(this.max.z-this.min.z))},isIntersectionBox:function(t){return!(t.max.x<this.min.x||t.min.x>this.max.x||t.max.y<this.min.y||t.min.y>this.max.y||t.max.z<this.min.z||t.min.z>this.max.z)},clampPoint:function(t,e){return(e||new THREE.Vector3).copy(t).clamp(this.min,this.max)},distanceToPoint:function(){var e=new THREE.Vector3;return function(t){return e.copy(t).clamp(this.min,this.max).sub(t).length()}}(),getBoundingSphere:function(){var e=new THREE.Vector3;return function(t){return(t=t||new THREE.Sphere).center=this.center(),t.radius=.5*this.size(e).length(),t}}(),intersect:function(t){return this.min.max(t.min),this.max.min(t.max),this},union:function(t){return this.min.min(t.min),this.max.max(t.max),this},applyMatrix4:function(){var e=[new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3,new THREE.Vector3];return function(t){return e[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(t),e[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(t),e[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(t),e[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(t),e[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(t),e[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(t),e[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(t),e[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(t),this.makeEmpty(),this.setFromPoints(e),this}}(),translate:function(t){return this.min.add(t),this.max.add(t),this},equals:function(t){return t.min.equals(this.min)&&t.max.equals(this.max)},clone:function(){return(new THREE.Box3).copy(this)}},THREE.Matrix3=function(){this.elements=new Float32Array([1,0,0,0,1,0,0,0,1]),0<arguments.length&&THREE.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix3.prototype={constructor:THREE.Matrix3,set:function(t,e,i,r,n,a,o,s,h){var l=this.elements;return l[0]=t,l[3]=e,l[6]=i,l[1]=r,l[4]=n,l[7]=a,l[2]=o,l[5]=s,l[8]=h,this},identity:function(){return this.set(1,0,0,0,1,0,0,0,1),this},copy:function(t){return t=t.elements,this.set(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8]),this},multiplyVector3:function(t){return THREE.warn("THREE.Matrix3: .multiplyVector3() has been removed. Use vector.applyMatrix3( matrix ) instead."),t.applyMatrix3(this)},multiplyVector3Array:function(t){return THREE.warn("THREE.Matrix3: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},applyToVector3Array:function(){var n=new THREE.Vector3;return function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);for(var r=0;r<i;r+=3,e+=3)n.x=t[e],n.y=t[e+1],n.z=t[e+2],n.applyMatrix3(this),t[e]=n.x,t[e+1]=n.y,t[e+2]=n.z;return t}}(),multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[3]*=t,e[6]*=t,e[1]*=t,e[4]*=t,e[7]*=t,e[2]*=t,e[5]*=t,e[8]*=t,this},determinant:function(){var t,e=(t=this.elements)[0],i=t[1],r=t[2],n=t[3],a=t[4],o=t[5],s=t[6],h=t[7];return e*a*(t=t[8])-e*o*h-i*n*t+i*o*s+r*n*h-r*a*s},getInverse:function(t,e){var i=t.elements,r=this.elements;if(r[0]=i[10]*i[5]-i[6]*i[9],r[1]=-i[10]*i[1]+i[2]*i[9],r[2]=i[6]*i[1]-i[2]*i[5],r[3]=-i[10]*i[4]+i[6]*i[8],r[4]=i[10]*i[0]-i[2]*i[8],r[5]=-i[6]*i[0]+i[2]*i[4],r[6]=i[9]*i[4]-i[5]*i[8],r[7]=-i[9]*i[0]+i[1]*i[8],r[8]=i[5]*i[0]-i[1]*i[4],0==(i=i[0]*r[0]+i[1]*r[3]+i[2]*r[6])){if(e)throw Error("Matrix3.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("Matrix3.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/i),this},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[3],e[3]=t,t=e[2],e[2]=e[6],e[6]=t,t=e[5],e[5]=e[7],e[7]=t,this},flattenToArrayOffset:function(t,e){var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t},getNormalMatrix:function(t){return this.getInverse(t).transpose(),this},transposeIntoArray:function(t){var e=this.elements;return t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8],this},fromArray:function(t){return this.elements.set(t),this},toArray:function(){var t=this.elements;return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]},clone:function(){return(new THREE.Matrix3).fromArray(this.elements)}},THREE.Matrix4=function(){this.elements=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),0<arguments.length&&THREE.error("THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.")},THREE.Matrix4.prototype={constructor:THREE.Matrix4,set:function(t,e,i,r,n,a,o,s,h,l,c,u,d,p,f,m){var E=this.elements;return E[0]=t,E[4]=e,E[8]=i,E[12]=r,E[1]=n,E[5]=a,E[9]=o,E[13]=s,E[2]=h,E[6]=l,E[10]=c,E[14]=u,E[3]=d,E[7]=p,E[11]=f,E[15]=m,this},identity:function(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this},copy:function(t){return this.elements.set(t.elements),this},extractPosition:function(t){return THREE.warn("THREE.Matrix4: .extractPosition() has been renamed to .copyPosition()."),this.copyPosition(t)},copyPosition:function(t){var e=this.elements;return t=t.elements,e[12]=t[12],e[13]=t[13],e[14]=t[14],this},extractBasis:function(t,e,i){var r=this.elements;return t.set(r[0],r[1],r[2]),e.set(r[4],r[5],r[6]),i.set(r[8],r[9],r[10]),this},makeBasis:function(t,e,i){return this.set(t.x,e.x,i.x,0,t.y,e.y,i.y,0,t.z,e.z,i.z,0,0,0,0,1),this},extractRotation:function(){var a=new THREE.Vector3;return function(t){var e=this.elements;t=t.elements;var i=1/a.set(t[0],t[1],t[2]).length(),r=1/a.set(t[4],t[5],t[6]).length(),n=1/a.set(t[8],t[9],t[10]).length();return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[8]=t[8]*n,e[9]=t[9]*n,e[10]=t[10]*n,this}}(),makeRotationFromEuler:function(t){0==t instanceof THREE.Euler&&THREE.error("THREE.Matrix: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.");var e=this.elements,i=t.x,r=t.y,n=t.z,a=Math.cos(i),o=(i=Math.sin(i),Math.cos(r)),s=(r=Math.sin(r),Math.cos(n));n=Math.sin(n);if("XYZ"===t.order){t=a*s;var h=a*n,l=i*s,c=i*n;e[0]=o*s,e[4]=-o*n,e[8]=r,e[1]=h+l*r,e[5]=t-c*r,e[9]=-i*o,e[2]=c-t*r,e[6]=l+h*r,e[10]=a*o}else"YXZ"===t.order?(t=o*s,h=o*n,l=r*s,c=r*n,e[0]=t+c*i,e[4]=l*i-h,e[8]=a*r,e[1]=a*n,e[5]=a*s,e[9]=-i,e[2]=h*i-l,e[6]=c+t*i,e[10]=a*o):"ZXY"===t.order?(t=o*s,h=o*n,l=r*s,c=r*n,e[0]=t-c*i,e[4]=-a*n,e[8]=l+h*i,e[1]=h+l*i,e[5]=a*s,e[9]=c-t*i,e[2]=-a*r,e[6]=i,e[10]=a*o):"ZYX"===t.order?(t=a*s,h=a*n,l=i*s,c=i*n,e[0]=o*s,e[4]=l*r-h,e[8]=t*r+c,e[1]=o*n,e[5]=c*r+t,e[9]=h*r-l,e[2]=-r,e[6]=i*o,e[10]=a*o):"YZX"===t.order?(t=a*o,h=a*r,l=i*o,c=i*r,e[0]=o*s,e[4]=c-t*n,e[8]=l*n+h,e[1]=n,e[5]=a*s,e[9]=-i*s,e[2]=-r*s,e[6]=h*n+l,e[10]=t-c*n):"XZY"===t.order&&(t=a*o,h=a*r,l=i*o,c=i*r,e[0]=o*s,e[4]=-n,e[8]=r*s,e[1]=t*n+c,e[5]=a*s,e[9]=h*n-l,e[2]=l*n-h,e[6]=i*s,e[10]=c*n+t);return e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},setRotationFromQuaternion:function(t){return THREE.warn("THREE.Matrix4: .setRotationFromQuaternion() has been renamed to .makeRotationFromQuaternion()."),this.makeRotationFromQuaternion(t)},makeRotationFromQuaternion:function(t){var e=this.elements,i=t.x,r=t.y,n=t.z,a=t.w,o=n+n;t=i*(l=i+i);var s=i*(c=r+r),h=(i=i*o,r*c),l=(r=r*o,n=n*o,a*l),c=a*c;a*=o;return e[0]=1-(h+n),e[4]=s-a,e[8]=i+c,e[1]=s+a,e[5]=1-(t+n),e[9]=r-l,e[2]=i-c,e[6]=r+l,e[10]=1-(t+h),e[3]=0,e[7]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,this},lookAt:function(){var n=new THREE.Vector3,a=new THREE.Vector3,o=new THREE.Vector3;return function(t,e,i){var r=this.elements;return o.subVectors(t,e).normalize(),0===o.length()&&(o.z=1),n.crossVectors(i,o).normalize(),0===n.length()&&(o.x+=1e-4,n.crossVectors(i,o).normalize()),a.crossVectors(o,n),r[0]=n.x,r[4]=a.x,r[8]=o.x,r[1]=n.y,r[5]=a.y,r[9]=o.y,r[2]=n.z,r[6]=a.z,r[10]=o.z,this}}(),multiply:function(t,e){return void 0!==e?(THREE.warn("THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead."),this.multiplyMatrices(t,e)):this.multiplyMatrices(this,t)},multiplyMatrices:function(t,e){var i=t.elements,r=e.elements,n=this.elements,a=i[0],o=i[4],s=i[8],h=i[12],l=i[1],c=i[5],u=i[9],d=i[13],p=i[2],f=i[6],m=i[10],E=i[14],g=i[3],v=i[7],y=i[11],T=(i=i[15],r[0]),R=r[4],_=r[8],x=r[12],b=r[1],w=r[5],H=r[9],M=r[13],S=r[2],C=r[6],A=r[10],P=r[14],L=r[3],k=r[7],D=r[11];r=r[15];return n[0]=a*T+o*b+s*S+h*L,n[4]=a*R+o*w+s*C+h*k,n[8]=a*_+o*H+s*A+h*D,n[12]=a*x+o*M+s*P+h*r,n[1]=l*T+c*b+u*S+d*L,n[5]=l*R+c*w+u*C+d*k,n[9]=l*_+c*H+u*A+d*D,n[13]=l*x+c*M+u*P+d*r,n[2]=p*T+f*b+m*S+E*L,n[6]=p*R+f*w+m*C+E*k,n[10]=p*_+f*H+m*A+E*D,n[14]=p*x+f*M+m*P+E*r,n[3]=g*T+v*b+y*S+i*L,n[7]=g*R+v*w+y*C+i*k,n[11]=g*_+v*H+y*A+i*D,n[15]=g*x+v*M+y*P+i*r,this},multiplyToArray:function(t,e,i){var r=this.elements;return this.multiplyMatrices(t,e),i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[8]=r[8],i[9]=r[9],i[10]=r[10],i[11]=r[11],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],this},multiplyScalar:function(t){var e=this.elements;return e[0]*=t,e[4]*=t,e[8]*=t,e[12]*=t,e[1]*=t,e[5]*=t,e[9]*=t,e[13]*=t,e[2]*=t,e[6]*=t,e[10]*=t,e[14]*=t,e[3]*=t,e[7]*=t,e[11]*=t,e[15]*=t,this},multiplyVector3:function(t){return THREE.warn("THREE.Matrix4: .multiplyVector3() has been removed. Use vector.applyMatrix4( matrix ) or vector.applyProjection( matrix ) instead."),t.applyProjection(this)},multiplyVector4:function(t){return THREE.warn("THREE.Matrix4: .multiplyVector4() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},multiplyVector3Array:function(t){return THREE.warn("THREE.Matrix4: .multiplyVector3Array() has been renamed. Use matrix.applyToVector3Array( array ) instead."),this.applyToVector3Array(t)},applyToVector3Array:function(){var n=new THREE.Vector3;return function(t,e,i){void 0===e&&(e=0),void 0===i&&(i=t.length);for(var r=0;r<i;r+=3,e+=3)n.x=t[e],n.y=t[e+1],n.z=t[e+2],n.applyMatrix4(this),t[e]=n.x,t[e+1]=n.y,t[e+2]=n.z;return t}}(),rotateAxis:function(t){THREE.warn("THREE.Matrix4: .rotateAxis() has been removed. Use Vector3.transformDirection( matrix ) instead."),t.transformDirection(this)},crossVector:function(t){return THREE.warn("THREE.Matrix4: .crossVector() has been removed. Use vector.applyMatrix4( matrix ) instead."),t.applyMatrix4(this)},determinant:function(){var t=this.elements,e=t[0],i=t[4],r=t[8],n=t[12],a=t[1],o=t[5],s=t[9],h=t[13],l=t[2],c=t[6],u=t[10],d=t[14];return t[3]*(+n*s*c-r*h*c-n*o*u+i*h*u+r*o*d-i*s*d)+t[7]*(+e*s*d-e*h*u+n*a*u-r*a*d+r*h*l-n*s*l)+t[11]*(+e*h*c-e*o*d-n*a*c+i*a*d+n*o*l-i*h*l)+t[15]*(-r*o*l-e*s*c+e*o*u+r*a*c-i*a*u+i*s*l)},transpose:function(){var t,e=this.elements;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this},flattenToArrayOffset:function(t,e){var i=this.elements;return t[e]=i[0],t[e+1]=i[1],t[e+2]=i[2],t[e+3]=i[3],t[e+4]=i[4],t[e+5]=i[5],t[e+6]=i[6],t[e+7]=i[7],t[e+8]=i[8],t[e+9]=i[9],t[e+10]=i[10],t[e+11]=i[11],t[e+12]=i[12],t[e+13]=i[13],t[e+14]=i[14],t[e+15]=i[15],t},getPosition:function(){var e=new THREE.Vector3;return function(){THREE.warn("THREE.Matrix4: .getPosition() has been removed. Use Vector3.setFromMatrixPosition( matrix ) instead.");var t=this.elements;return e.set(t[12],t[13],t[14])}}(),setPosition:function(t){var e=this.elements;return e[12]=t.x,e[13]=t.y,e[14]=t.z,this},getInverse:function(t,e){var i=this.elements,r=(v=t.elements)[0],n=v[4],a=v[8],o=v[12],s=v[1],h=v[5],l=v[9],c=v[13],u=v[2],d=v[6],p=v[10],f=v[14],m=v[3],E=v[7],g=v[11],v=v[15];if(i[0]=l*f*E-c*p*E+c*d*g-h*f*g-l*d*v+h*p*v,i[4]=o*p*E-a*f*E-o*d*g+n*f*g+a*d*v-n*p*v,i[8]=a*c*E-o*l*E+o*h*g-n*c*g-a*h*v+n*l*v,i[12]=o*l*d-a*c*d-o*h*p+n*c*p+a*h*f-n*l*f,i[1]=c*p*m-l*f*m-c*u*g+s*f*g+l*u*v-s*p*v,i[5]=a*f*m-o*p*m+o*u*g-r*f*g-a*u*v+r*p*v,i[9]=o*l*m-a*c*m-o*s*g+r*c*g+a*s*v-r*l*v,i[13]=a*c*u-o*l*u+o*s*p-r*c*p-a*s*f+r*l*f,i[2]=h*f*m-c*d*m+c*u*E-s*f*E-h*u*v+s*d*v,i[6]=o*d*m-n*f*m-o*u*E+r*f*E+n*u*v-r*d*v,i[10]=n*c*m-o*h*m+o*s*E-r*c*E-n*s*v+r*h*v,i[14]=o*h*u-n*c*u-o*s*d+r*c*d+n*s*f-r*h*f,i[3]=l*d*m-h*p*m-l*u*E+s*p*E+h*u*g-s*d*g,i[7]=n*p*m-a*d*m+a*u*E-r*p*E-n*u*g+r*d*g,i[11]=a*h*m-n*l*m-a*s*E+r*l*E+n*s*g-r*h*g,i[15]=n*l*u-a*h*u+a*s*d-r*l*d-n*s*p+r*h*p,0==(i=r*i[0]+s*i[4]+u*i[8]+m*i[12])){if(e)throw Error("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0");return THREE.warn("THREE.Matrix4.getInverse(): can't invert matrix, determinant is 0"),this.identity(),this}return this.multiplyScalar(1/i),this},translate:function(t){THREE.error("THREE.Matrix4: .translate() has been removed.")},rotateX:function(t){THREE.error("THREE.Matrix4: .rotateX() has been removed.")},rotateY:function(t){THREE.error("THREE.Matrix4: .rotateY() has been removed.")},rotateZ:function(t){THREE.error("THREE.Matrix4: .rotateZ() has been removed.")},rotateByAxis:function(t,e){THREE.error("THREE.Matrix4: .rotateByAxis() has been removed.")},scale:function(t){var e=this.elements,i=t.x,r=t.y;return t=t.z,e[0]*=i,e[4]*=r,e[8]*=t,e[1]*=i,e[5]*=r,e[9]*=t,e[2]*=i,e[6]*=r,e[10]*=t,e[3]*=i,e[7]*=r,e[11]*=t,this},getMaxScaleOnAxis:function(){var t=this.elements;return Math.sqrt(Math.max(t[0]*t[0]+t[1]*t[1]+t[2]*t[2],Math.max(t[4]*t[4]+t[5]*t[5]+t[6]*t[6],t[8]*t[8]+t[9]*t[9]+t[10]*t[10])))},makeTranslation:function(t,e,i){return this.set(1,0,0,t,0,1,0,e,0,0,1,i,0,0,0,1),this},makeRotationX:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(1,0,0,0,0,e,-t,0,0,t,e,0,0,0,0,1),this},makeRotationY:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,0,t,0,0,1,0,0,-t,0,e,0,0,0,0,1),this},makeRotationZ:function(t){var e=Math.cos(t);return t=Math.sin(t),this.set(e,-t,0,0,t,e,0,0,0,0,1,0,0,0,0,1),this},makeRotationAxis:function(t,e){var i=Math.cos(e),r=Math.sin(e),n=1-i,a=t.x,o=t.y,s=t.z,h=n*a,l=n*o;return this.set(h*a+i,h*o-r*s,h*s+r*o,0,h*o+r*s,l*o+i,l*s-r*a,0,h*s-r*o,l*s+r*a,n*s*s+i,0,0,0,0,1),this},makeScale:function(t,e,i){return this.set(t,0,0,0,0,e,0,0,0,0,i,0,0,0,0,1),this},compose:function(t,e,i){return this.makeRotationFromQuaternion(e),this.scale(i),this.setPosition(t),this},decompose:function(){var h=new THREE.Vector3,l=new THREE.Matrix4;return function(t,e,i){var r=this.elements,n=h.set(r[0],r[1],r[2]).length(),a=h.set(r[4],r[5],r[6]).length(),o=h.set(r[8],r[9],r[10]).length();this.determinant()<0&&(n=-n),t.x=r[12],t.y=r[13],t.z=r[14],l.elements.set(this.elements),t=1/n;r=1/a;var s=1/o;return l.elements[0]*=t,l.elements[1]*=t,l.elements[2]*=t,l.elements[4]*=r,l.elements[5]*=r,l.elements[6]*=r,l.elements[8]*=s,l.elements[9]*=s,l.elements[10]*=s,e.setFromRotationMatrix(l),i.x=n,i.y=a,i.z=o,this}}(),makeFrustum:function(t,e,i,r,n,a){var o=this.elements;return o[0]=2*n/(e-t),o[4]=0,o[8]=(e+t)/(e-t),o[12]=0,o[1]=0,o[5]=2*n/(r-i),o[9]=(r+i)/(r-i),o[13]=0,o[2]=0,o[6]=0,o[10]=-(a+n)/(a-n),o[14]=-2*a*n/(a-n),o[3]=0,o[7]=0,o[11]=-1,o[15]=0,this},makePerspective:function(t,e,i,r){var n=-(t=i*Math.tan(THREE.Math.degToRad(.5*t)));return this.makeFrustum(n*e,t*e,n,t,i,r)},makeOrthographic:function(t,e,i,r,n,a){var o=this.elements,s=e-t,h=i-r,l=a-n;return o[0]=2/s,o[4]=0,o[8]=0,o[12]=-(e+t)/s,o[1]=0,o[5]=2/h,o[9]=0,o[13]=-(i+r)/h,o[2]=0,o[6]=0,o[10]=-2/l,o[14]=-(a+n)/l,o[3]=0,o[7]=0,o[11]=0,o[15]=1,this},fromArray:function(t){return this.elements.set(t),this},toArray:function(){var t=this.elements;return[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]},clone:function(){return(new THREE.Matrix4).fromArray(this.elements)}},THREE.Ray=function(t,e){this.origin=void 0!==t?t:new THREE.Vector3,this.direction=void 0!==e?e:new THREE.Vector3},THREE.Ray.prototype={constructor:THREE.Ray,set:function(t,e){return this.origin.copy(t),this.direction.copy(e),this},copy:function(t){return this.origin.copy(t.origin),this.direction.copy(t.direction),this},at:function(t,e){return(e||new THREE.Vector3).copy(this.direction).multiplyScalar(t).add(this.origin)},recast:function(){var e=new THREE.Vector3;return function(t){return this.origin.copy(this.at(t,e)),this}}(),closestPointToPoint:function(t,e){var i=e||new THREE.Vector3;i.subVectors(t,this.origin);var r=i.dot(this.direction);return r<0?i.copy(this.origin):i.copy(this.direction).multiplyScalar(r).add(this.origin)},distanceToPoint:function(){var i=new THREE.Vector3;return function(t){var e=i.subVectors(t,this.origin).dot(this.direction);return e<0?this.origin.distanceTo(t):(i.copy(this.direction).multiplyScalar(e).add(this.origin),i.distanceTo(t))}}(),distanceSqToSegment:function(){var u=new THREE.Vector3,d=new THREE.Vector3,p=new THREE.Vector3;return function(t,e,i,r){u.copy(t).add(e).multiplyScalar(.5),d.copy(e).sub(t).normalize(),p.copy(this.origin).sub(u);var n,a=.5*t.distanceTo(e),o=-this.direction.dot(d),s=p.dot(this.direction),h=-p.dot(d),l=p.lengthSq(),c=Math.abs(1-o*o);return 0<c?(e=o*s-h,n=a*c,0<=(t=o*h-s)?-n<=e?e<=n?o=(t*=a=1/c)*(t+o*(e*=a)+2*s)+e*(o*t+e+2*h)+l:(e=a,o=-(t=Math.max(0,-(o*e+s)))*t+e*(e+2*h)+l):(e=-a,o=-(t=Math.max(0,-(o*e+s)))*t+e*(e+2*h)+l):e<=-n?o=-(t=Math.max(0,-(-o*a+s)))*t+(e=0<t?-a:Math.min(Math.max(-a,-h),a))*(e+2*h)+l:e<=n?(t=0,o=(e=Math.min(Math.max(-a,-h),a))*(e+2*h)+l):o=-(t=Math.max(0,-(o*a+s)))*t+(e=0<t?a:Math.min(Math.max(-a,-h),a))*(e+2*h)+l):(e=0<o?-a:a,o=-(t=Math.max(0,-(o*e+s)))*t+e*(e+2*h)+l),i&&i.copy(this.direction).multiplyScalar(t).add(this.origin),r&&r.copy(d).multiplyScalar(e).add(u),o}}(),isIntersectionSphere:function(t){return this.distanceToPoint(t.center)<=t.radius},intersectSphere:function(){var a=new THREE.Vector3;return function(t,e){a.subVectors(t.center,this.origin);var i=a.dot(this.direction),r=a.dot(a)-i*i,n=t.radius*t.radius;return n<r?null:(r=i-(n=Math.sqrt(n-r)),i+=n,r<0&&i<0?null:r<0?this.at(i,e):this.at(r,e))}}(),isIntersectionPlane:function(t){var e=t.distanceToPoint(this.origin);return 0===e||t.normal.dot(this.direction)*e<0},distanceToPlane:function(t){var e=t.normal.dot(this.direction);return 0==e?0==t.distanceToPoint(this.origin)?0:null:0<=(t=-(this.origin.dot(t.normal)+t.constant)/e)?t:null},intersectPlane:function(t,e){var i=this.distanceToPlane(t);return null===i?null:this.at(i,e)},isIntersectionBox:function(){var e=new THREE.Vector3;return function(t){return null!==this.intersectBox(t,e)}}(),intersectBox:function(t,e){var i,r,n,a,o;r=1/this.direction.x,a=1/this.direction.y,o=1/this.direction.z;var s=this.origin;return 0<=r?(i=(t.min.x-s.x)*r,r*=t.max.x-s.x):(i=(t.max.x-s.x)*r,r*=t.min.x-s.x),0<=a?(n=(t.min.y-s.y)*a,a*=t.max.y-s.y):(n=(t.max.y-s.y)*a,a*=t.min.y-s.y),a<i||r<n?null:((i<n||i!=i)&&(i=n),(a<r||r!=r)&&(r=a),0<=o?(n=(t.min.z-s.z)*o,o*=t.max.z-s.z):(n=(t.max.z-s.z)*o,o*=t.min.z-s.z),o<i||r<n?null:((i<n||i!=i)&&(i=n),(o<r||r!=r)&&(r=o),r<0?null:this.at(0<=i?i:r,e)))},intersectTriangle:function(){var a=new THREE.Vector3,o=new THREE.Vector3,s=new THREE.Vector3,h=new THREE.Vector3;return function(t,e,i,r,n){if(o.subVectors(e,t),s.subVectors(i,t),h.crossVectors(o,s),0<(e=this.direction.dot(h))){if(r)return null;r=1}else{if(!(e<0))return null;r=-1,e=-e}return a.subVectors(this.origin,t),(t=r*this.direction.dot(s.crossVectors(a,s)))<0?null:(i=r*this.direction.dot(o.cross(a)))<0||e<t+i?null:(t=-r*a.dot(h))<0?null:this.at(t/e,n)}}(),applyMatrix4:function(t){return this.direction.add(this.origin).applyMatrix4(t),this.origin.applyMatrix4(t),this.direction.sub(this.origin),this.direction.normalize(),this},equals:function(t){return t.origin.equals(this.origin)&&t.direction.equals(this.direction)},clone:function(){return(new THREE.Ray).copy(this)}},THREE.Sphere=function(t,e){this.center=void 0!==t?t:new THREE.Vector3,this.radius=void 0!==e?e:0},THREE.Sphere.prototype={constructor:THREE.Sphere,set:function(t,e){return this.center.copy(t),this.radius=e,this},setFromPoints:function(){var o=new THREE.Box3;return function(t,e){var i=this.center;void 0!==e?i.copy(e):o.setFromPoints(t).center(i);for(var r=0,n=0,a=t.length;n<a;n++)r=Math.max(r,i.distanceToSquared(t[n]));return this.radius=Math.sqrt(r),this}}(),copy:function(t){return this.center.copy(t.center),this.radius=t.radius,this},empty:function(){return this.radius<=0},containsPoint:function(t){return t.distanceToSquared(this.center)<=this.radius*this.radius},distanceToPoint:function(t){return t.distanceTo(this.center)-this.radius},intersectsSphere:function(t){var e=this.radius+t.radius;return t.center.distanceToSquared(this.center)<=e*e},clampPoint:function(t,e){var i=this.center.distanceToSquared(t),r=e||new THREE.Vector3;return r.copy(t),i>this.radius*this.radius&&(r.sub(this.center).normalize(),r.multiplyScalar(this.radius).add(this.center)),r},getBoundingBox:function(t){return(t=t||new THREE.Box3).set(this.center,this.center),t.expandByScalar(this.radius),t},applyMatrix4:function(t){return this.center.applyMatrix4(t),this.radius*=t.getMaxScaleOnAxis(),this},translate:function(t){return this.center.add(t),this},equals:function(t){return t.center.equals(this.center)&&t.radius===this.radius},clone:function(){return(new THREE.Sphere).copy(this)}},THREE.Frustum=function(t,e,i,r,n,a){this.planes=[void 0!==t?t:new THREE.Plane,void 0!==e?e:new THREE.Plane,void 0!==i?i:new THREE.Plane,void 0!==r?r:new THREE.Plane,void 0!==n?n:new THREE.Plane,void 0!==a?a:new THREE.Plane]},THREE.Frustum.prototype={constructor:THREE.Frustum,set:function(t,e,i,r,n,a){var o=this.planes;return o[0].copy(t),o[1].copy(e),o[2].copy(i),o[3].copy(r),o[4].copy(n),o[5].copy(a),this},copy:function(t){for(var e=this.planes,i=0;i<6;i++)e[i].copy(t.planes[i]);return this},setFromMatrix:function(t){var e=this.planes;t=(E=t.elements)[0];var i=E[1],r=E[2],n=E[3],a=E[4],o=E[5],s=E[6],h=E[7],l=E[8],c=E[9],u=E[10],d=E[11],p=E[12],f=E[13],m=E[14],E=E[15];return e[0].setComponents(n-t,h-a,d-l,E-p).normalize(),e[1].setComponents(n+t,h+a,d+l,E+p).normalize(),e[2].setComponents(n+i,h+o,d+c,E+f).normalize(),e[3].setComponents(n-i,h-o,d-c,E-f).normalize(),e[4].setComponents(n-r,h-s,d-u,E-m).normalize(),e[5].setComponents(n+r,h+s,d+u,E+m).normalize(),this},intersectsObject:function(){var i=new THREE.Sphere;return function(t){var e=t.geometry;return null===e.boundingSphere&&e.computeBoundingSphere(),i.copy(e.boundingSphere),i.applyMatrix4(t.matrixWorld),this.intersectsSphere(i)}}(),intersectsSphere:function(t){var e=this.planes,i=t.center;t=-t.radius;for(var r=0;r<6;r++)if(e[r].distanceToPoint(i)<t)return!1;return!0},intersectsBox:function(){var a=new THREE.Vector3,o=new THREE.Vector3;return function(t){for(var e=this.planes,i=0;i<6;i++){var r=e[i];a.x=0<r.normal.x?t.min.x:t.max.x,o.x=0<r.normal.x?t.max.x:t.min.x,a.y=0<r.normal.y?t.min.y:t.max.y,o.y=0<r.normal.y?t.max.y:t.min.y,a.z=0<r.normal.z?t.min.z:t.max.z,o.z=0<r.normal.z?t.max.z:t.min.z;var n=r.distanceToPoint(a);r=r.distanceToPoint(o);if(n<0&&r<0)return!1}return!0}}(),containsPoint:function(t){for(var e=this.planes,i=0;i<6;i++)if(e[i].distanceToPoint(t)<0)return!1;return!0},clone:function(){return(new THREE.Frustum).copy(this)}},THREE.Plane=function(t,e){this.normal=void 0!==t?t:new THREE.Vector3(1,0,0),this.constant=void 0!==e?e:0},THREE.Plane.prototype={constructor:THREE.Plane,set:function(t,e){return this.normal.copy(t),this.constant=e,this},setComponents:function(t,e,i,r){return this.normal.set(t,e,i),this.constant=r,this},setFromNormalAndCoplanarPoint:function(t,e){return this.normal.copy(t),this.constant=-e.dot(this.normal),this},setFromCoplanarPoints:function(){var r=new THREE.Vector3,n=new THREE.Vector3;return function(t,e,i){return e=r.subVectors(i,e).cross(n.subVectors(t,e)).normalize(),this.setFromNormalAndCoplanarPoint(e,t),this}}(),copy:function(t){return this.normal.copy(t.normal),this.constant=t.constant,this},normalize:function(){var t=1/this.normal.length();return this.normal.multiplyScalar(t),this.constant*=t,this},negate:function(){return this.constant*=-1,this.normal.negate(),this},distanceToPoint:function(t){return this.normal.dot(t)+this.constant},distanceToSphere:function(t){return this.distanceToPoint(t.center)-t.radius},projectPoint:function(t,e){return this.orthoPoint(t,e).sub(t).negate()},orthoPoint:function(t,e){var i=this.distanceToPoint(t);return(e||new THREE.Vector3).copy(this.normal).multiplyScalar(i)},isIntersectionLine:function(t){var e=this.distanceToPoint(t.start);return t=this.distanceToPoint(t.end),e<0&&0<t||t<0&&0<e},intersectLine:function(){var a=new THREE.Vector3;return function(t,e){var i=e||new THREE.Vector3,r=t.delta(a),n=this.normal.dot(r);return 0!=n?(n=-(t.start.dot(this.normal)+this.constant)/n)<0||1<n?void 0:i.copy(r).multiplyScalar(n).add(t.start):0==this.distanceToPoint(t.start)?i.copy(t.start):void 0}}(),coplanarPoint:function(t){return(t||new THREE.Vector3).copy(this.normal).multiplyScalar(-this.constant)},applyMatrix4:function(){var n=new THREE.Vector3,a=new THREE.Vector3,o=new THREE.Matrix3;return function(t,e){var i=e||o.getNormalMatrix(t),r=(i=n.copy(this.normal).applyMatrix3(i),this.coplanarPoint(a));return r.applyMatrix4(t),this.setFromNormalAndCoplanarPoint(i,r),this}}(),translate:function(t){return this.constant-=t.dot(this.normal),this},equals:function(t){return t.normal.equals(this.normal)&&t.constant==this.constant},clone:function(){return(new THREE.Plane).copy(this)}},THREE.Math={generateUUID:function(){var e,i="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),r=Array(36),n=0;return function(){for(var t=0;t<36;t++)8==t||13==t||18==t||23==t?r[t]="-":14==t?r[t]="4":(n<=2&&(n=33554432+16777216*Math.random()|0),e=15&n,n>>=4,r[t]=i[19==t?3&e|8:e]);return r.join("")}}(),clamp:function(t,e,i){return t<e?e:i<t?i:t},clampBottom:function(t,e){return t<e?e:t},mapLinear:function(t,e,i,r,n){return r+(t-e)*(n-r)/(i-e)},smoothstep:function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*(3-2*t)},smootherstep:function(t,e,i){return t<=e?0:i<=t?1:(t=(t-e)/(i-e))*t*t*(t*(6*t-15)+10)},random16:function(){return(65280*Math.random()+255*Math.random())/65535},randInt:function(t,e){return Math.floor(this.randFloat(t,e))},randFloat:function(t,e){return t+Math.random()*(e-t)},randFloatSpread:function(t){return t*(.5-Math.random())},degToRad:function(){var e=Math.PI/180;return function(t){return t*e}}(),radToDeg:function(){var e=180/Math.PI;return function(t){return t*e}}(),isPowerOfTwo:function(t){return 0==(t&t-1)&&0!==t},nextPowerOfTwo:function(t){return t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,++t}},THREE.Spline=function(t){function e(t,e,i,r,n,a,o){return(2*(e-i)+(t=.5*(i-t))+(r=.5*(r-e)))*o+(-3*(e-i)-2*t-r)*a+t*n+e}this.points=t;var i,r,n,a,o,s,h,l,c,u=[],d={x:0,y:0,z:0};this.initFromArray=function(t){this.points=[];for(var e=0;e<t.length;e++)this.points[e]={x:t[e][0],y:t[e][1],z:t[e][2]}},this.getPoint=function(t){return i=(this.points.length-1)*t,r=Math.floor(i),n=i-r,u[0]=0===r?r:r-1,u[1]=r,u[2]=r>this.points.length-2?this.points.length-1:r+1,u[3]=r>this.points.length-3?this.points.length-1:r+2,s=this.points[u[0]],h=this.points[u[1]],l=this.points[u[2]],c=this.points[u[3]],o=n*(a=n*n),d.x=e(s.x,h.x,l.x,c.x,n,a,o),d.y=e(s.y,h.y,l.y,c.y,n,a,o),d.z=e(s.z,h.z,l.z,c.z,n,a,o),d},this.getControlPointsArray=function(){var t,e,i=this.points.length,r=[];for(t=0;t<i;t++)e=this.points[t],r[t]=[e.x,e.y,e.z];return r},this.getLength=function(t){var e,i,r,n=e=e=0,a=new THREE.Vector3,o=new THREE.Vector3,s=[],h=0;for(s[0]=0,t||(t=100),i=this.points.length*t,a.copy(this.points[0]),t=1;t<i;t++)e=t/i,r=this.getPoint(e),o.copy(r),h+=o.distanceTo(a),a.copy(r),e*=this.points.length-1,(e=Math.floor(e))!=n&&(s[e]=h,n=e);return s[s.length]=h,{chunks:s,total:h}},this.reparametrizeByArcLength=function(t){var e,i,r,n,a,o,s=[],h=new THREE.Vector3,l=this.getLength();for(s.push(h.copy(this.points[0]).clone()),e=1;e<this.points.length;e++){for(i=l.chunks[e]-l.chunks[e-1],o=Math.ceil(t*i/l.total),n=(e-1)/(this.points.length-1),a=e/(this.points.length-1),i=1;i<o-1;i++)r=n+1/o*i*(a-n),r=this.getPoint(r),s.push(h.copy(r).clone());s.push(h.copy(this.points[e]).clone())}this.points=s}},THREE.Triangle=function(t,e,i){this.a=void 0!==t?t:new THREE.Vector3,this.b=void 0!==e?e:new THREE.Vector3,this.c=void 0!==i?i:new THREE.Vector3},THREE.Triangle.normal=function(){var n=new THREE.Vector3;return function(t,e,i,r){return(r=r||new THREE.Vector3).subVectors(i,e),n.subVectors(t,e),r.cross(n),0<(t=r.lengthSq())?r.multiplyScalar(1/Math.sqrt(t)):r.set(0,0,0)}}(),THREE.Triangle.barycoordFromPoint=function(){var s=new THREE.Vector3,h=new THREE.Vector3,l=new THREE.Vector3;return function(t,e,i,r,n){s.subVectors(r,e),h.subVectors(i,e),l.subVectors(t,e),t=s.dot(s),e=s.dot(h),i=s.dot(l);var a=h.dot(h);r=h.dot(l);var o=t*a-e*e;return n=n||new THREE.Vector3,0==o?n.set(-2,-1,-1):(a=(a*i-e*r)*(o=1/o),t=(t*r-e*i)*o,n.set(1-a-t,t,a))}}(),THREE.Triangle.containsPoint=function(){var n=new THREE.Vector3;return function(t,e,i,r){return 0<=(t=THREE.Triangle.barycoordFromPoint(t,e,i,r,n)).x&&0<=t.y&&t.x+t.y<=1}}(),THREE.Triangle.prototype={constructor:THREE.Triangle,set:function(t,e,i){return this.a.copy(t),this.b.copy(e),this.c.copy(i),this},setFromPointsAndIndices:function(t,e,i,r){return this.a.copy(t[e]),this.b.copy(t[i]),this.c.copy(t[r]),this},copy:function(t){return this.a.copy(t.a),this.b.copy(t.b),this.c.copy(t.c),this},area:function(){var t=new THREE.Vector3,e=new THREE.Vector3;return function(){return t.subVectors(this.c,this.b),e.subVectors(this.a,this.b),.5*t.cross(e).length()}}(),midpoint:function(t){return(t||new THREE.Vector3).addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)},normal:function(t){return THREE.Triangle.normal(this.a,this.b,this.c,t)},plane:function(t){return(t||new THREE.Plane).setFromCoplanarPoints(this.a,this.b,this.c)},barycoordFromPoint:function(t,e){return THREE.Triangle.barycoordFromPoint(t,this.a,this.b,this.c,e)},containsPoint:function(t){return THREE.Triangle.containsPoint(t,this.a,this.b,this.c)},equals:function(t){return t.a.equals(this.a)&&t.b.equals(this.b)&&t.c.equals(this.c)},clone:function(){return(new THREE.Triangle).copy(this)}},THREE.Clock=function(t){this.autoStart=void 0===t||t,this.elapsedTime=this.oldTime=this.startTime=0,this.running=!1},THREE.Clock.prototype={constructor:THREE.Clock,start:function(){this.oldTime=this.startTime=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now(),this.running=!0},stop:function(){this.getElapsedTime(),this.running=!1},getElapsedTime:function(){return this.getDelta(),this.elapsedTime},getDelta:function(){var t=0;if(this.autoStart&&!this.running&&this.start(),this.running){var e=void 0!==self.performance&&void 0!==self.performance.now?self.performance.now():Date.now();t=.001*(e-this.oldTime);this.oldTime=e,this.elapsedTime+=t}return t}},THREE.EventDispatcher=function(){},THREE.EventDispatcher.prototype={constructor:THREE.EventDispatcher,apply:function(t){t.addEventListener=THREE.EventDispatcher.prototype.addEventListener,t.hasEventListener=THREE.EventDispatcher.prototype.hasEventListener,t.removeEventListener=THREE.EventDispatcher.prototype.removeEventListener,t.dispatchEvent=THREE.EventDispatcher.prototype.dispatchEvent},addEventListener:function(t,e){void 0===this._listeners&&(this._listeners={});var i=this._listeners;void 0===i[t]&&(i[t]=[]),-1===i[t].indexOf(e)&&i[t].push(e)},hasEventListener:function(t,e){if(void 0===this._listeners)return!1;var i=this._listeners;return void 0!==i[t]&&-1!==i[t].indexOf(e)},removeEventListener:function(t,e){if(void 0!==this._listeners){var i=this._listeners[t];if(void 0!==i){var r=i.indexOf(e);-1!==r&&i.splice(r,1)}}},dispatchEvent:function(t){if(void 0!==this._listeners){var e=this._listeners[t.type];if(void 0!==e){t.target=this;for(var i=[],r=e.length,n=0;n<r;n++)i[n]=e[n];for(n=0;n<r;n++)i[n].call(this,t)}}}},function(a){a.Raycaster=function(t,e,i,r){this.ray=new a.Ray(t,e),this.near=i||0,this.far=r||1/0,this.params={Sprite:{},Mesh:{},PointCloud:{threshold:1},LOD:{},Line:{}}};var o=function(t,e){return t.distance-e.distance},s=function(t,e,i,r){if(t.raycast(e,i),!0===r){r=0;for(var n=(t=t.children).length;r<n;r++)s(t[r],e,i,!0)}};a.Raycaster.prototype={constructor:a.Raycaster,precision:1e-4,linePrecision:1,set:function(t,e){this.ray.set(t,e)},setFromCamera:function(t,e){e instanceof a.PerspectiveCamera?(this.ray.origin.copy(e.position),this.ray.direction.set(t.x,t.y,.5).unproject(e).sub(e.position).normalize()):e instanceof a.OrthographicCamera?(this.ray.origin.set(t.x,t.y,-1).unproject(e),this.ray.direction.set(0,0,-1).transformDirection(e.matrixWorld)):a.error("THREE.Raycaster: Unsupported camera type.")},intersectObject:function(t,e){var i=[];return s(t,this,i,e),i.sort(o),i},intersectObjects:function(t,e){var i=[];if(0==t instanceof Array)return a.warn("THREE.Raycaster.intersectObjects: objects is not an Array."),i;for(var r=0,n=t.length;r<n;r++)s(t[r],this,i,e);return i.sort(o),i}}}(THREE),THREE.Object3D=function(){Object.defineProperty(this,"id",{value:THREE.Object3DIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Object3D",this.parent=void 0,this.children=[],this.up=THREE.Object3D.DefaultUp.clone();var t=new THREE.Vector3,e=new THREE.Euler,i=new THREE.Quaternion,r=new THREE.Vector3(1,1,1);e.onChange(function(){i.setFromEuler(e,!1)}),i.onChange(function(){e.setFromQuaternion(i,void 0,!1)}),Object.defineProperties(this,{position:{enumerable:!0,value:t},rotation:{enumerable:!0,value:e},quaternion:{enumerable:!0,value:i},scale:{enumerable:!0,value:r}}),this.rotationAutoUpdate=!0,this.matrix=new THREE.Matrix4,this.matrixWorld=new THREE.Matrix4,this.matrixAutoUpdate=!0,this.matrixWorldNeedsUpdate=!1,this.visible=!0,this.receiveShadow=this.castShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.userData={}},THREE.Object3D.DefaultUp=new THREE.Vector3(0,1,0),THREE.Object3D.prototype={constructor:THREE.Object3D,get eulerOrder(){return THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order},set eulerOrder(t){THREE.warn("THREE.Object3D: .eulerOrder has been moved to .rotation.order."),this.rotation.order=t},get useQuaternion(){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},set useQuaternion(t){THREE.warn("THREE.Object3D: .useQuaternion has been removed. The library now uses quaternions by default.")},applyMatrix:function(t){this.matrix.multiplyMatrices(t,this.matrix),this.matrix.decompose(this.position,this.quaternion,this.scale)},setRotationFromAxisAngle:function(t,e){this.quaternion.setFromAxisAngle(t,e)},setRotationFromEuler:function(t){this.quaternion.setFromEuler(t,!0)},setRotationFromMatrix:function(t){this.quaternion.setFromRotationMatrix(t)},setRotationFromQuaternion:function(t){this.quaternion.copy(t)},rotateOnAxis:function(){var i=new THREE.Quaternion;return function(t,e){return i.setFromAxisAngle(t,e),this.quaternion.multiply(i),this}}(),rotateX:function(){var e=new THREE.Vector3(1,0,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateY:function(){var e=new THREE.Vector3(0,1,0);return function(t){return this.rotateOnAxis(e,t)}}(),rotateZ:function(){var e=new THREE.Vector3(0,0,1);return function(t){return this.rotateOnAxis(e,t)}}(),translateOnAxis:function(){var i=new THREE.Vector3;return function(t,e){return i.copy(t).applyQuaternion(this.quaternion),this.position.add(i.multiplyScalar(e)),this}}(),translate:function(t,e){return THREE.warn("THREE.Object3D: .translate() has been removed. Use .translateOnAxis( axis, distance ) instead."),this.translateOnAxis(e,t)},translateX:function(){var e=new THREE.Vector3(1,0,0);return function(t){return this.translateOnAxis(e,t)}}(),translateY:function(){var e=new THREE.Vector3(0,1,0);return function(t){return this.translateOnAxis(e,t)}}(),translateZ:function(){var e=new THREE.Vector3(0,0,1);return function(t){return this.translateOnAxis(e,t)}}(),localToWorld:function(t){return t.applyMatrix4(this.matrixWorld)},worldToLocal:function(){var e=new THREE.Matrix4;return function(t){return t.applyMatrix4(e.getInverse(this.matrixWorld))}}(),lookAt:function(){var e=new THREE.Matrix4;return function(t){e.lookAt(t,this.position,this.up),this.quaternion.setFromRotationMatrix(e)}}(),add:function(t){if(1<arguments.length){for(var e=0;e<arguments.length;e++)this.add(arguments[e]);return this}return t===this?THREE.error("THREE.Object3D.add: object can't be added as a child of itself.",t):t instanceof THREE.Object3D?(void 0!==t.parent&&t.parent.remove(t),t.parent=this,t.dispatchEvent({type:"added"}),this.children.push(t)):THREE.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",t),this},remove:function(t){if(1<arguments.length)for(var e=0;e<arguments.length;e++)this.remove(arguments[e]);-1!==(e=this.children.indexOf(t))&&(t.parent=void 0,t.dispatchEvent({type:"removed"}),this.children.splice(e,1))},getChildByName:function(t){return THREE.warn("THREE.Object3D: .getChildByName() has been renamed to .getObjectByName()."),this.getObjectByName(t)},getObjectById:function(t){return this.getObjectByProperty("id",t)},getObjectByName:function(t){return this.getObjectByProperty("name",t)},getObjectByProperty:function(t,e){if(this[t]===e)return this;for(var i=0,r=this.children.length;i<r;i++){var n=this.children[i].getObjectByProperty(t,e);if(void 0!==n)return n}},getWorldPosition:function(t){return t=t||new THREE.Vector3,this.updateMatrixWorld(!0),t.setFromMatrixPosition(this.matrixWorld)},getWorldQuaternion:function(){var e=new THREE.Vector3,i=new THREE.Vector3;return function(t){return t=t||new THREE.Quaternion,this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,t,i),t}}(),getWorldRotation:function(){var e=new THREE.Quaternion;return function(t){return t=t||new THREE.Euler,this.getWorldQuaternion(e),t.setFromQuaternion(e,this.rotation.order,!1)}}(),getWorldScale:function(){var e=new THREE.Vector3,i=new THREE.Quaternion;return function(t){return t=t||new THREE.Vector3,this.updateMatrixWorld(!0),this.matrixWorld.decompose(e,i,t),t}}(),getWorldDirection:function(){var e=new THREE.Quaternion;return function(t){return t=t||new THREE.Vector3,this.getWorldQuaternion(e),t.set(0,0,1).applyQuaternion(e)}}(),raycast:function(){},traverse:function(t){t(this);for(var e=0,i=this.children.length;e<i;e++)this.children[e].traverse(t)},traverseVisible:function(t){if(!1!==this.visible){t(this);for(var e=0,i=this.children.length;e<i;e++)this.children[e].traverseVisible(t)}},traverseAncestors:function(t){this.parent&&(t(this.parent),this.parent.traverseAncestors(t))},updateMatrix:function(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0},updateMatrixWorld:function(t){!0===this.matrixAutoUpdate&&this.updateMatrix(),!0!==this.matrixWorldNeedsUpdate&&!0!==t||(void 0===this.parent?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=0,i=this.children.length;e<i;e++)this.children[e].updateMatrixWorld(t)},toJSON:function(){var n={metadata:{version:4.3,type:"Object",generator:"ObjectExporter"}},a={},i={},o=function(t){if(void 0===n.materials&&(n.materials=[]),void 0===i[t.uuid]){var e=t.toJSON();delete e.metadata,i[t.uuid]=e,n.materials.push(e)}return t.uuid},s=function(t){var e={};if(e.uuid=t.uuid,e.type=t.type,""!==t.name&&(e.name=t.name),"{}"!==JSON.stringify(t.userData)&&(e.userData=t.userData),!0!==t.visible&&(e.visible=t.visible),t instanceof THREE.PerspectiveCamera)e.fov=t.fov,e.aspect=t.aspect,e.near=t.near,e.far=t.far;else if(t instanceof THREE.OrthographicCamera)e.left=t.left,e.right=t.right,e.top=t.top,e.bottom=t.bottom,e.near=t.near,e.far=t.far;else if(t instanceof THREE.AmbientLight)e.color=t.color.getHex();else if(t instanceof THREE.DirectionalLight)e.color=t.color.getHex(),e.intensity=t.intensity;else if(t instanceof THREE.PointLight)e.color=t.color.getHex(),e.intensity=t.intensity,e.distance=t.distance,e.decay=t.decay;else if(t instanceof THREE.SpotLight)e.color=t.color.getHex(),e.intensity=t.intensity,e.distance=t.distance,e.angle=t.angle,e.exponent=t.exponent,e.decay=t.decay;else if(t instanceof THREE.HemisphereLight)e.color=t.color.getHex(),e.groundColor=t.groundColor.getHex();else if(t instanceof THREE.Mesh||t instanceof THREE.Line||t instanceof THREE.PointCloud){var i=t.geometry;if(void 0===n.geometries&&(n.geometries=[]),void 0===a[i.uuid]){var r=i.toJSON();delete r.metadata,a[i.uuid]=r,n.geometries.push(r)}e.geometry=i.uuid,e.material=o(t.material),t instanceof THREE.Line&&(e.mode=t.mode)}else t instanceof THREE.Sprite&&(e.material=o(t.material));if(e.matrix=t.matrix.toArray(),0<t.children.length)for(e.children=[],i=0;i<t.children.length;i++)e.children.push(s(t.children[i]));return e};return n.object=s(this),n},clone:function(t,e){if(void 0===t&&(t=new THREE.Object3D),void 0===e&&(e=!0),t.name=this.name,t.up.copy(this.up),t.position.copy(this.position),t.quaternion.copy(this.quaternion),t.scale.copy(this.scale),t.rotationAutoUpdate=this.rotationAutoUpdate,t.matrix.copy(this.matrix),t.matrixWorld.copy(this.matrixWorld),t.matrixAutoUpdate=this.matrixAutoUpdate,t.matrixWorldNeedsUpdate=this.matrixWorldNeedsUpdate,t.visible=this.visible,t.castShadow=this.castShadow,t.receiveShadow=this.receiveShadow,t.frustumCulled=this.frustumCulled,t.userData=JSON.parse(JSON.stringify(this.userData)),!0===e)for(var i=0;i<this.children.length;i++)t.add(this.children[i].clone());return t}},THREE.EventDispatcher.prototype.apply(THREE.Object3D.prototype),THREE.Object3DIdCount=0,THREE.Face3=function(t,e,i,r,n,a){this.a=t,this.b=e,this.c=i,this.normal=r instanceof THREE.Vector3?r:new THREE.Vector3,this.vertexNormals=r instanceof Array?r:[],this.color=n instanceof THREE.Color?n:new THREE.Color,this.vertexColors=n instanceof Array?n:[],this.vertexTangents=[],this.materialIndex=void 0!==a?a:0},THREE.Face3.prototype={constructor:THREE.Face3,clone:function(){var t=new THREE.Face3(this.a,this.b,this.c);t.normal.copy(this.normal),t.color.copy(this.color),t.materialIndex=this.materialIndex;for(var e=0,i=this.vertexNormals.length;e<i;e++)t.vertexNormals[e]=this.vertexNormals[e].clone();for(e=0,i=this.vertexColors.length;e<i;e++)t.vertexColors[e]=this.vertexColors[e].clone();for(e=0,i=this.vertexTangents.length;e<i;e++)t.vertexTangents[e]=this.vertexTangents[e].clone();return t}},THREE.Face4=function(t,e,i,r,n,a,o){return THREE.warn("THREE.Face4 has been removed. A THREE.Face3 will be created instead."),new THREE.Face3(t,e,i,n,a,o)},THREE.BufferAttribute=function(t,e){this.array=t,this.itemSize=e,this.needsUpdate=!1},THREE.BufferAttribute.prototype={constructor:THREE.BufferAttribute,get length(){return this.array.length},copyAt:function(t,e,i){t*=this.itemSize,i*=e.itemSize;for(var r=0,n=this.itemSize;r<n;r++)this.array[t+r]=e.array[i+r];return this},set:function(t,e){return void 0===e&&(e=0),this.array.set(t,e),this},setX:function(t,e){return this.array[t*this.itemSize]=e,this},setY:function(t,e){return this.array[t*this.itemSize+1]=e,this},setZ:function(t,e){return this.array[t*this.itemSize+2]=e,this},setXY:function(t,e,i){return t*=this.itemSize,this.array[t]=e,this.array[t+1]=i,this},setXYZ:function(t,e,i,r){return t*=this.itemSize,this.array[t]=e,this.array[t+1]=i,this.array[t+2]=r,this},setXYZW:function(t,e,i,r,n){return t*=this.itemSize,this.array[t]=e,this.array[t+1]=i,this.array[t+2]=r,this.array[t+3]=n,this},clone:function(){return new THREE.BufferAttribute(new this.array.constructor(this.array),this.itemSize)}},THREE.Int8Attribute=function(t,e){return THREE.warn("THREE.Int8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Uint8Attribute=function(t,e){return THREE.warn("THREE.Uint8Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Uint8ClampedAttribute=function(t,e){return THREE.warn("THREE.Uint8ClampedAttribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Int16Attribute=function(t,e){return THREE.warn("THREE.Int16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Uint16Attribute=function(t,e){return THREE.warn("THREE.Uint16Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Int32Attribute=function(t,e){return THREE.warn("THREE.Int32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Uint32Attribute=function(t,e){return THREE.warn("THREE.Uint32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Float32Attribute=function(t,e){return THREE.warn("THREE.Float32Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.Float64Attribute=function(t,e){return THREE.warn("THREE.Float64Attribute has been removed. Use THREE.BufferAttribute( array, itemSize ) instead."),new THREE.BufferAttribute(t,e)},THREE.DynamicBufferAttribute=function(t,e){THREE.BufferAttribute.call(this,t,e),this.updateRange={offset:0,count:-1}},THREE.DynamicBufferAttribute.prototype=Object.create(THREE.BufferAttribute.prototype),THREE.DynamicBufferAttribute.prototype.constructor=THREE.DynamicBufferAttribute,THREE.DynamicBufferAttribute.prototype.clone=function(){return new THREE.DynamicBufferAttribute(new this.array.constructor(this.array),this.itemSize)},THREE.BufferGeometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="BufferGeometry",this.attributes={},this.attributesKeys=[],this.offsets=this.drawcalls=[],this.boundingSphere=this.boundingBox=null},THREE.BufferGeometry.prototype={constructor:THREE.BufferGeometry,addAttribute:function(t,e,i){0==e instanceof THREE.BufferAttribute?(THREE.warn("THREE.BufferGeometry: .addAttribute() now expects ( name, attribute )."),this.attributes[t]={array:e,itemSize:i}):(this.attributes[t]=e,this.attributesKeys=Object.keys(this.attributes))},getAttribute:function(t){return this.attributes[t]},addDrawCall:function(t,e,i){this.drawcalls.push({start:t,count:e,index:void 0!==i?i:0})},applyMatrix:function(t){var e=this.attributes.position;void 0!==e&&(t.applyToVector3Array(e.array),e.needsUpdate=!0),void 0!==(e=this.attributes.normal)&&((new THREE.Matrix3).getNormalMatrix(t).applyToVector3Array(e.array),e.needsUpdate=!0),null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere()},center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(t)),t},fromGeometry:function(t,e){e=e||{vertexColors:THREE.NoColors};var i=t.vertices,r=t.faces,n=t.faceVertexUvs,a=e.vertexColors,o=0<n[0].length,s=3==r[0].vertexNormals.length,h=new Float32Array(9*r.length);this.addAttribute("position",new THREE.BufferAttribute(h,3));var l=new Float32Array(9*r.length);if(this.addAttribute("normal",new THREE.BufferAttribute(l,3)),a!==THREE.NoColors){var c=new Float32Array(9*r.length);this.addAttribute("color",new THREE.BufferAttribute(c,3))}if(!0===o){var u=new Float32Array(6*r.length);this.addAttribute("uv",new THREE.BufferAttribute(u,2))}for(var d=0,p=0,f=0;d<r.length;d++,p+=6,f+=9){var m=r[d],E=i[m.a],g=i[m.b],v=i[m.c];h[f]=E.x,h[f+1]=E.y,h[f+2]=E.z,h[f+3]=g.x,h[f+4]=g.y,h[f+5]=g.z,h[f+6]=v.x,h[f+7]=v.y,h[f+8]=v.z,!0===s?(E=m.vertexNormals[0],g=m.vertexNormals[1],v=m.vertexNormals[2],l[f]=E.x,l[f+1]=E.y,l[f+2]=E.z,l[f+3]=g.x,l[f+4]=g.y,l[f+5]=g.z,l[f+6]=v.x,l[f+7]=v.y,l[f+8]=v.z):(E=m.normal,l[f]=E.x,l[f+1]=E.y,l[f+2]=E.z,l[f+3]=E.x,l[f+4]=E.y,l[f+5]=E.z,l[f+6]=E.x,l[f+7]=E.y,l[f+8]=E.z),a===THREE.FaceColors?(m=m.color,c[f]=m.r,c[f+1]=m.g,c[f+2]=m.b,c[f+3]=m.r,c[f+4]=m.g,c[f+5]=m.b,c[f+6]=m.r,c[f+7]=m.g,c[f+8]=m.b):a===THREE.VertexColors&&(E=m.vertexColors[0],g=m.vertexColors[1],m=m.vertexColors[2],c[f]=E.r,c[f+1]=E.g,c[f+2]=E.b,c[f+3]=g.r,c[f+4]=g.g,c[f+5]=g.b,c[f+6]=m.r,c[f+7]=m.g,c[f+8]=m.b),!0===o&&(m=n[0][d][0],E=n[0][d][1],g=n[0][d][2],u[p]=m.x,u[p+1]=m.y,u[p+2]=E.x,u[p+3]=E.y,u[p+4]=g.x,u[p+5]=g.y)}return this.computeBoundingSphere(),this},computeBoundingBox:function(){var n=new THREE.Vector3;return function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3);var t=this.attributes.position.array;if(t){var e=this.boundingBox;e.makeEmpty();for(var i=0,r=t.length;i<r;i+=3)n.set(t[i],t[i+1],t[i+2]),e.expandByPoint(n)}void 0!==t&&0!==t.length||(this.boundingBox.min.set(0,0,0),this.boundingBox.max.set(0,0,0)),(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&THREE.error('THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.')}}(),computeBoundingSphere:function(){var a=new THREE.Box3,o=new THREE.Vector3;return function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere);var t=this.attributes.position.array;if(t){a.makeEmpty();for(var e=this.boundingSphere.center,i=0,r=t.length;i<r;i+=3)o.set(t[i],t[i+1],t[i+2]),a.expandByPoint(o);a.center(e);var n=0;for(i=0,r=t.length;i<r;i+=3)o.set(t[i],t[i+1],t[i+2]),n=Math.max(n,e.distanceToSquared(o));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&THREE.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.')}}}(),computeFaceNormals:function(){},computeVertexNormals:function(){var t=this.attributes;if(t.position){var e=t.position.array;if(void 0===t.normal)this.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(e.length),3));else for(var i=0,r=(s=t.normal.array).length;i<r;i++)s[i]=0;var n,a,o,s=t.normal.array,h=new THREE.Vector3,l=new THREE.Vector3,c=new THREE.Vector3,u=new THREE.Vector3,d=new THREE.Vector3;if(t.index)for(var p=t.index.array,f=0<this.offsets.length?this.offsets:[{start:0,count:p.length,index:0}],m=0,E=f.length;m<E;++m){r=f[m].start,n=f[m].count;var g=f[m].index;for(i=r,r=r+n;i<r;i+=3)n=3*(g+p[i]),a=3*(g+p[i+1]),o=3*(g+p[i+2]),h.fromArray(e,n),l.fromArray(e,a),c.fromArray(e,o),u.subVectors(c,l),d.subVectors(h,l),u.cross(d),s[n]+=u.x,s[n+1]+=u.y,s[n+2]+=u.z,s[a]+=u.x,s[a+1]+=u.y,s[a+2]+=u.z,s[o]+=u.x,s[o+1]+=u.y,s[o+2]+=u.z}else for(i=0,r=e.length;i<r;i+=9)h.fromArray(e,i),l.fromArray(e,i+3),c.fromArray(e,i+6),u.subVectors(c,l),d.subVectors(h,l),u.cross(d),s[i]=u.x,s[i+1]=u.y,s[i+2]=u.z,s[i+3]=u.x,s[i+4]=u.y,s[i+5]=u.z,s[i+6]=u.x,s[i+7]=u.y,s[i+8]=u.z;this.normalizeNormals(),t.normal.needsUpdate=!0}},computeTangents:function(){function t(t){V.fromArray(r,3*t),I.copy(V),B=s[t],N.copy(B),N.sub(V.multiplyScalar(V.dot(B))).normalize(),U.crossVectors(I,B),O=U.dot(h[t]),z=O<0?-1:1,o[4*t]=N.x,o[4*t+1]=N.y,o[4*t+2]=N.z,o[4*t+3]=z}if(void 0===this.attributes.index||void 0===this.attributes.position||void 0===this.attributes.normal||void 0===this.attributes.uv)THREE.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");else{var e=this.attributes.index.array,i=this.attributes.position.array,r=this.attributes.normal.array,n=this.attributes.uv.array,a=i.length/3;void 0===this.attributes.tangent&&this.addAttribute("tangent",new THREE.BufferAttribute(new Float32Array(4*a),4));for(var o=this.attributes.tangent.array,s=[],h=[],l=0;l<a;l++)s[l]=new THREE.Vector3,h[l]=new THREE.Vector3;var c,u,d,p,f,m,E,g,v,y,T,R,_,x,b,w,H=new THREE.Vector3,M=new THREE.Vector3,S=new THREE.Vector3,C=new THREE.Vector2,A=new THREE.Vector2,P=new THREE.Vector2,L=new THREE.Vector3,k=new THREE.Vector3;0===this.drawcalls.length&&this.addDrawCall(0,e.length,0);var D=this.drawcalls;l=0;for(_=D.length;l<_;++l){R=D[l].start,x=D[l].count;var F=D[l].index;a=R;for(R+=x;a<R;a+=3)x=F+e[a],b=F+e[a+1],w=F+e[a+2],G=x,W=b,j=w,H.fromArray(i,3*G),M.fromArray(i,3*W),S.fromArray(i,3*j),C.fromArray(n,2*G),A.fromArray(n,2*W),P.fromArray(n,2*j),c=M.x-H.x,u=S.x-H.x,d=M.y-H.y,p=S.y-H.y,f=M.z-H.z,m=S.z-H.z,E=A.x-C.x,g=P.x-C.x,v=A.y-C.y,y=P.y-C.y,T=1/(E*y-g*v),L.set((y*c-v*u)*T,(y*d-v*p)*T,(y*f-v*m)*T),k.set((E*u-g*c)*T,(E*p-g*d)*T,(E*m-g*f)*T),s[G].add(L),s[W].add(L),s[j].add(L),h[G].add(k),h[W].add(k),h[j].add(k)}var z,B,O,N=new THREE.Vector3,U=new THREE.Vector3,V=new THREE.Vector3,I=new THREE.Vector3;l=0;for(_=D.length;l<_;++l)for(R=D[l].start,x=D[l].count,F=D[l].index,a=R,R+=x;a<R;a+=3)x=F+e[a],b=F+e[a+1],w=F+e[a+2],t(x),t(b),t(w)}var G,W,j},computeOffsets:function(t){void 0===t&&(t=65535);for(var e=this.attributes.index.array,i=this.attributes.position.array,r=e.length/3,n=new Uint16Array(e.length),a=0,o=0,s=[{start:0,count:0,index:0}],h=s[0],l=0,c=new Int32Array(6),u=new Int32Array(i.length),d=new Int32Array(i.length),p=0;p<i.length;p++)u[p]=-1,d[p]=-1;for(i=0;i<r;i++){for(var f=l=0;f<3;f++)-1==u[p=e[3*i+f]]?(c[2*f]=p,c[2*f+1]=-1,l++):u[p]<h.index?(c[2*f]=p,c[2*f+1]=-1,0):(c[2*f]=p,c[2*f+1]=u[p]);if(o+l>h.index+t)for(h={start:a,count:0,index:o},s.push(h),l=0;l<6;l+=2)-1<(f=c[l+1])&&f<h.index&&(c[l+1]=-1);for(l=0;l<6;l+=2)p=c[l],-1===(f=c[l+1])&&(f=o++),d[u[p]=f]=p,n[a++]=f-h.index,h.count++}return this.reorderBuffers(n,d,o),this.drawcalls=this.offsets=s},merge:function(t,e){if(0!=t instanceof THREE.BufferGeometry){void 0===e&&(e=0);var i,r=this.attributes;for(i in r)if(void 0!==t.attributes[i])for(var n=r[i].array,a=(s=t.attributes[i]).array,o=0,s=s.itemSize*e;o<a.length;o++,s++)n[s]=a[o];return this}THREE.error("THREE.BufferGeometry.merge(): geometry not an instance of THREE.BufferGeometry.",t)},normalizeNormals:function(){for(var t,e,i,r=this.attributes.normal.array,n=0,a=r.length;n<a;n+=3)t=r[n],e=r[n+1],i=r[n+2],t=1/Math.sqrt(t*t+e*e+i*i),r[n]*=t,r[n+1]*=t,r[n+2]*=t},reorderBuffers:function(t,e,i){var r,n={};for(r in this.attributes)"index"!=r&&(n[r]=new this.attributes[r].array.constructor(this.attributes[r].itemSize*i));for(var a=0;a<i;a++){var o=e[a];for(r in this.attributes)if("index"!=r)for(var s=this.attributes[r].array,h=this.attributes[r].itemSize,l=n[r],c=0;c<h;c++)l[a*h+c]=s[o*h+c]}for(r in this.attributes.index.array=t,this.attributes)"index"!=r&&(this.attributes[r].array=n[r],this.attributes[r].numItems=this.attributes[r].itemSize*i)},toJSON:function(){var t,e={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type,data:{attributes:{}}},i=this.attributes,r=this.offsets,n=this.boundingSphere;for(t in i){var a=i[t],o=Array.prototype.slice.call(a.array);e.data.attributes[t]={itemSize:a.itemSize,type:a.array.constructor.name,array:o}}return 0<r.length&&(e.data.offsets=JSON.parse(JSON.stringify(r))),null!==n&&(e.data.boundingSphere={center:n.center.toArray(),radius:n.radius}),e},clone:function(){var t,e=new THREE.BufferGeometry;for(t in this.attributes)e.addAttribute(t,this.attributes[t].clone());t=0;for(var i=this.offsets.length;t<i;t++){var r=this.offsets[t];e.offsets.push({start:r.start,index:r.index,count:r.count})}return e},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.BufferGeometry.prototype),THREE.Geometry=function(){Object.defineProperty(this,"id",{value:THREE.GeometryIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Geometry",this.vertices=[],this.colors=[],this.faces=[],this.faceVertexUvs=[[]],this.morphTargets=[],this.morphColors=[],this.morphNormals=[],this.skinWeights=[],this.skinIndices=[],this.lineDistances=[],this.boundingSphere=this.boundingBox=null,this.hasTangents=!1,this.dynamic=!0,this.groupsNeedUpdate=this.lineDistancesNeedUpdate=this.colorsNeedUpdate=this.tangentsNeedUpdate=this.normalsNeedUpdate=this.uvsNeedUpdate=this.elementsNeedUpdate=this.verticesNeedUpdate=!1},THREE.Geometry.prototype={constructor:THREE.Geometry,applyMatrix:function(t){for(var e=(new THREE.Matrix3).getNormalMatrix(t),i=0,r=this.vertices.length;i<r;i++)this.vertices[i].applyMatrix4(t);for(i=0,r=this.faces.length;i<r;i++){(t=this.faces[i]).normal.applyMatrix3(e).normalize();for(var n=0,a=t.vertexNormals.length;n<a;n++)t.vertexNormals[n].applyMatrix3(e).normalize()}null!==this.boundingBox&&this.computeBoundingBox(),null!==this.boundingSphere&&this.computeBoundingSphere(),this.normalsNeedUpdate=this.verticesNeedUpdate=!0},fromBufferGeometry:function(t){for(var a=this,e=t.attributes,i=e.position.array,r=void 0!==e.index?e.index.array:void 0,o=void 0!==e.normal?e.normal.array:void 0,s=void 0!==e.color?e.color.array:void 0,h=void 0!==e.uv?e.uv.array:void 0,l=[],c=[],n=e=0;e<i.length;e+=3,n+=2)a.vertices.push(new THREE.Vector3(i[e],i[e+1],i[e+2])),void 0!==o&&l.push(new THREE.Vector3(o[e],o[e+1],o[e+2])),void 0!==s&&a.colors.push(new THREE.Color(s[e],s[e+1],s[e+2])),void 0!==h&&c.push(new THREE.Vector2(h[n],h[n+1]));var u=function(t,e,i){var r=void 0!==o?[l[t].clone(),l[e].clone(),l[i].clone()]:[],n=void 0!==s?[a.colors[t].clone(),a.colors[e].clone(),a.colors[i].clone()]:[];a.faces.push(new THREE.Face3(t,e,i,r,n)),void 0!==h&&a.faceVertexUvs[0].push([c[t].clone(),c[e].clone(),c[i].clone()])};if(void 0!==r)if(0<(i=t.drawcalls).length)for(e=0;e<i.length;e++){var d=(n=i[e]).start,p=n.count,f=n.index;for(n=d,d=d+p;n<d;n+=3)u(f+r[n],f+r[n+1],f+r[n+2])}else for(e=0;e<r.length;e+=3)u(r[e],r[e+1],r[e+2]);else for(e=0;e<i.length/3;e+=3)u(e,e+1,e+2);return this.computeFaceNormals(),null!==t.boundingBox&&(this.boundingBox=t.boundingBox.clone()),null!==t.boundingSphere&&(this.boundingSphere=t.boundingSphere.clone()),this},center:function(){this.computeBoundingBox();var t=this.boundingBox.center().negate();return this.applyMatrix((new THREE.Matrix4).setPosition(t)),t},computeFaceNormals:function(){for(var t=new THREE.Vector3,e=new THREE.Vector3,i=0,r=this.faces.length;i<r;i++){var n=this.faces[i],a=this.vertices[n.a],o=this.vertices[n.b];t.subVectors(this.vertices[n.c],o),e.subVectors(a,o),t.cross(e),t.normalize(),n.normal.copy(t)}},computeVertexNormals:function(t){var e,i,r;for(r=Array(this.vertices.length),e=0,i=this.vertices.length;e<i;e++)r[e]=new THREE.Vector3;if(t){var n,a,o,s=new THREE.Vector3,h=new THREE.Vector3;for(t=0,e=this.faces.length;t<e;t++)i=this.faces[t],n=this.vertices[i.a],a=this.vertices[i.b],o=this.vertices[i.c],s.subVectors(o,a),h.subVectors(n,a),s.cross(h),r[i.a].add(s),r[i.b].add(s),r[i.c].add(s)}else for(t=0,e=this.faces.length;t<e;t++)r[(i=this.faces[t]).a].add(i.normal),r[i.b].add(i.normal),r[i.c].add(i.normal);for(e=0,i=this.vertices.length;e<i;e++)r[e].normalize();for(t=0,e=this.faces.length;t<e;t++)(i=this.faces[t]).vertexNormals[0]=r[i.a].clone(),i.vertexNormals[1]=r[i.b].clone(),i.vertexNormals[2]=r[i.c].clone()},computeMorphNormals:function(){var t,e,i,r,n;for(i=0,r=this.faces.length;i<r;i++)for((n=this.faces[i]).__originalFaceNormal?n.__originalFaceNormal.copy(n.normal):n.__originalFaceNormal=n.normal.clone(),n.__originalVertexNormals||(n.__originalVertexNormals=[]),t=0,e=n.vertexNormals.length;t<e;t++)n.__originalVertexNormals[t]?n.__originalVertexNormals[t].copy(n.vertexNormals[t]):n.__originalVertexNormals[t]=n.vertexNormals[t].clone();var a=new THREE.Geometry;for(a.faces=this.faces,t=0,e=this.morphTargets.length;t<e;t++){if(!this.morphNormals[t]){this.morphNormals[t]={},this.morphNormals[t].faceNormals=[],this.morphNormals[t].vertexNormals=[],n=this.morphNormals[t].faceNormals;var o,s,h=this.morphNormals[t].vertexNormals;for(i=0,r=this.faces.length;i<r;i++)o=new THREE.Vector3,s={a:new THREE.Vector3,b:new THREE.Vector3,c:new THREE.Vector3},n.push(o),h.push(s)}for(h=this.morphNormals[t],a.vertices=this.morphTargets[t].vertices,a.computeFaceNormals(),a.computeVertexNormals(),i=0,r=this.faces.length;i<r;i++)n=this.faces[i],o=h.faceNormals[i],s=h.vertexNormals[i],o.copy(n.normal),s.a.copy(n.vertexNormals[0]),s.b.copy(n.vertexNormals[1]),s.c.copy(n.vertexNormals[2])}for(i=0,r=this.faces.length;i<r;i++)(n=this.faces[i]).normal=n.__originalFaceNormal,n.vertexNormals=n.__originalVertexNormals},computeTangents:function(){var t,e,i,r,n,a,o,s,h,l,c,u,d,p,f,m,E,g=[],v=[];i=new THREE.Vector3;var y=new THREE.Vector3,T=new THREE.Vector3,R=new THREE.Vector3,_=new THREE.Vector3;for(t=0,e=this.vertices.length;t<e;t++)g[t]=new THREE.Vector3,v[t]=new THREE.Vector3;for(t=0,e=this.faces.length;t<e;t++)n=this.faces[t],a=this.faceVertexUvs[0][t],r=n.a,E=n.b,n=n.c,o=this.vertices[r],s=this.vertices[E],h=this.vertices[n],l=a[0],c=a[1],u=a[2],a=s.x-o.x,d=h.x-o.x,p=s.y-o.y,f=h.y-o.y,s=s.z-o.z,o=h.z-o.z,h=c.x-l.x,m=u.x-l.x,c=c.y-l.y,u=1/(h*(l=u.y-l.y)-m*c),i.set((l*a-c*d)*u,(l*p-c*f)*u,(l*s-c*o)*u),y.set((h*d-m*a)*u,(h*f-m*p)*u,(h*o-m*s)*u),g[r].add(i),g[E].add(i),g[n].add(i),v[r].add(y),v[E].add(y),v[n].add(y);for(y=["a","b","c","d"],t=0,e=this.faces.length;t<e;t++)for(n=this.faces[t],i=0;i<Math.min(n.vertexNormals.length,3);i++)_.copy(n.vertexNormals[i]),E=g[r=n[y[i]]],T.copy(E),T.sub(_.multiplyScalar(_.dot(E))).normalize(),R.crossVectors(n.vertexNormals[i],E),r=(r=R.dot(v[r]))<0?-1:1,n.vertexTangents[i]=new THREE.Vector4(T.x,T.y,T.z,r);this.hasTangents=!0},computeLineDistances:function(){for(var t=0,e=this.vertices,i=0,r=e.length;i<r;i++)0<i&&(t+=e[i].distanceTo(e[i-1])),this.lineDistances[i]=t},computeBoundingBox:function(){null===this.boundingBox&&(this.boundingBox=new THREE.Box3),this.boundingBox.setFromPoints(this.vertices)},computeBoundingSphere:function(){null===this.boundingSphere&&(this.boundingSphere=new THREE.Sphere),this.boundingSphere.setFromPoints(this.vertices)},merge:function(t,e,i){if(0==t instanceof THREE.Geometry)THREE.error("THREE.Geometry.merge(): geometry not an instance of THREE.Geometry.",t);else{var r,n=this.vertices.length,a=this.vertices,o=t.vertices,s=this.faces,h=t.faces,l=this.faceVertexUvs[0];t=t.faceVertexUvs[0],void 0===i&&(i=0),void 0!==e&&(r=(new THREE.Matrix3).getNormalMatrix(e));for(var c=0,u=o.length;c<u;c++){var d=o[c].clone();void 0!==e&&d.applyMatrix4(e),a.push(d)}for(c=0,u=h.length;c<u;c++){var p,f=(o=h[c]).vertexNormals,m=o.vertexColors;for((d=new THREE.Face3(o.a+n,o.b+n,o.c+n)).normal.copy(o.normal),void 0!==r&&d.normal.applyMatrix3(r).normalize(),e=0,a=f.length;e<a;e++)p=f[e].clone(),void 0!==r&&p.applyMatrix3(r).normalize(),d.vertexNormals.push(p);for(d.color.copy(o.color),e=0,a=m.length;e<a;e++)p=m[e],d.vertexColors.push(p.clone());d.materialIndex=o.materialIndex+i,s.push(d)}for(c=0,u=t.length;c<u;c++)if(r=[],void 0!==(i=t[c])){for(e=0,a=i.length;e<a;e++)r.push(i[e].clone());l.push(r)}}},mergeMesh:function(t){0==t instanceof THREE.Mesh?THREE.error("THREE.Geometry.mergeMesh(): mesh not an instance of THREE.Mesh.",t):(t.matrixAutoUpdate&&t.updateMatrix(),this.merge(t.geometry,t.matrix))},mergeVertices:function(){var t,e,i,r={},n=[],a=[],o=Math.pow(10,4);for(e=0,i=this.vertices.length;e<i;e++)t=this.vertices[e],void 0===r[t=Math.round(t.x*o)+"_"+Math.round(t.y*o)+"_"+Math.round(t.z*o)]?(r[t]=e,n.push(this.vertices[e]),a[e]=n.length-1):a[e]=a[r[t]];for(r=[],e=0,i=this.faces.length;e<i;e++)for((o=this.faces[e]).a=a[o.a],o.b=a[o.b],o.c=a[o.c],o=[o.a,o.b,o.c],t=0;t<3;t++)if(o[t]==o[(t+1)%3]){r.push(e);break}for(e=r.length-1;0<=e;e--)for(o=r[e],this.faces.splice(o,1),a=0,i=this.faceVertexUvs.length;a<i;a++)this.faceVertexUvs[a].splice(o,1);return e=this.vertices.length-n.length,this.vertices=n,e},toJSON:function(){function t(t,e,i){return i?t|1<<e:t&~(1<<e)}function e(t){var e=t.x.toString()+t.y.toString()+t.z.toString();return void 0!==l[e]||(l[e]=h.length/3,h.push(t.x,t.y,t.z)),l[e]}function i(t){var e=t.r.toString()+t.g.toString()+t.b.toString();return void 0!==u[e]||(u[e]=c.length,c.push(t.getHex())),u[e]}function r(t){var e=t.x.toString()+t.y.toString();return void 0!==p[e]||(p[e]=d.length/2,d.push(t.x,t.y)),p[e]}var n={metadata:{version:4,type:"BufferGeometry",generator:"BufferGeometryExporter"},uuid:this.uuid,type:this.type};if(""!==this.name&&(n.name=this.name),void 0!==this.parameters){var a,o=this.parameters;for(a in o)void 0!==o[a]&&(n[a]=o[a]);return n}for(o=[],a=0;a<this.vertices.length;a++){var s=this.vertices[a];o.push(s.x,s.y,s.z)}s=[];var h=[],l={},c=[],u={},d=[],p={};for(a=0;a<this.faces.length;a++){var f=this.faces[a],m=void 0!==this.faceVertexUvs[0][a],E=0<f.normal.length(),g=0<f.vertexNormals.length,v=1!==f.color.r||1!==f.color.g||1!==f.color.b,y=0<f.vertexColors.length,T=t(T=t(T=t(T=t(T=t(T=t(T=t(T=t(T=0,0,0),1,!1),2,!1),3,m),4,E),5,g),6,v),7,y);s.push(T),s.push(f.a,f.b,f.c),m&&(m=this.faceVertexUvs[0][a],s.push(r(m[0]),r(m[1]),r(m[2]))),E&&s.push(e(f.normal)),g&&(E=f.vertexNormals,s.push(e(E[0]),e(E[1]),e(E[2]))),v&&s.push(i(f.color)),y&&(f=f.vertexColors,s.push(i(f[0]),i(f[1]),i(f[2])))}return n.data={},n.data.vertices=o,n.data.normals=h,0<c.length&&(n.data.colors=c),0<d.length&&(n.data.uvs=[d]),n.data.faces=s,n},clone:function(){for(var t=new THREE.Geometry,e=this.vertices,i=0,r=e.length;i<r;i++)t.vertices.push(e[i].clone());for(i=0,r=(e=this.faces).length;i<r;i++)t.faces.push(e[i].clone());for(i=0,r=this.faceVertexUvs.length;i<r;i++){e=this.faceVertexUvs[i],void 0===t.faceVertexUvs[i]&&(t.faceVertexUvs[i]=[]);for(var n=0,a=e.length;n<a;n++){for(var o=e[n],s=[],h=0,l=o.length;h<l;h++)s.push(o[h].clone());t.faceVertexUvs[i].push(s)}}return t},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Geometry.prototype),THREE.GeometryIdCount=0,THREE.Camera=function(){THREE.Object3D.call(this),this.type="Camera",this.matrixWorldInverse=new THREE.Matrix4,this.projectionMatrix=new THREE.Matrix4},THREE.Camera.prototype=Object.create(THREE.Object3D.prototype),THREE.Camera.prototype.constructor=THREE.Camera,THREE.Camera.prototype.getWorldDirection=function(){var e=new THREE.Quaternion;return function(t){return t=t||new THREE.Vector3,this.getWorldQuaternion(e),t.set(0,0,-1).applyQuaternion(e)}}(),THREE.Camera.prototype.lookAt=function(){var e=new THREE.Matrix4;return function(t){e.lookAt(this.position,t,this.up),this.quaternion.setFromRotationMatrix(e)}}(),THREE.Camera.prototype.clone=function(t){return void 0===t&&(t=new THREE.Camera),THREE.Object3D.prototype.clone.call(this,t),t.matrixWorldInverse.copy(this.matrixWorldInverse),t.projectionMatrix.copy(this.projectionMatrix),t},THREE.CubeCamera=function(t,e,i){THREE.Object3D.call(this),this.type="CubeCamera";var n=new THREE.PerspectiveCamera(90,1,t,e);n.up.set(0,-1,0),n.lookAt(new THREE.Vector3(1,0,0)),this.add(n);var a=new THREE.PerspectiveCamera(90,1,t,e);a.up.set(0,-1,0),a.lookAt(new THREE.Vector3(-1,0,0)),this.add(a);var o=new THREE.PerspectiveCamera(90,1,t,e);o.up.set(0,0,1),o.lookAt(new THREE.Vector3(0,1,0)),this.add(o);var s=new THREE.PerspectiveCamera(90,1,t,e);s.up.set(0,0,-1),s.lookAt(new THREE.Vector3(0,-1,0)),this.add(s);var h=new THREE.PerspectiveCamera(90,1,t,e);h.up.set(0,-1,0),h.lookAt(new THREE.Vector3(0,0,1)),this.add(h);var l=new THREE.PerspectiveCamera(90,1,t,e);l.up.set(0,-1,0),l.lookAt(new THREE.Vector3(0,0,-1)),this.add(l),this.renderTarget=new THREE.WebGLRenderTargetCube(i,i,{format:THREE.RGBFormat,magFilter:THREE.LinearFilter,minFilter:THREE.LinearFilter}),this.updateCubeMap=function(t,e){var i=this.renderTarget,r=i.generateMipmaps;i.generateMipmaps=!1,i.activeCubeFace=0,t.render(e,n,i),i.activeCubeFace=1,t.render(e,a,i),i.activeCubeFace=2,t.render(e,o,i),i.activeCubeFace=3,t.render(e,s,i),i.activeCubeFace=4,t.render(e,h,i),i.generateMipmaps=r,i.activeCubeFace=5,t.render(e,l,i)}},THREE.CubeCamera.prototype=Object.create(THREE.Object3D.prototype),THREE.CubeCamera.prototype.constructor=THREE.CubeCamera,THREE.OrthographicCamera=function(t,e,i,r,n,a){THREE.Camera.call(this),this.type="OrthographicCamera",this.zoom=1,this.left=t,this.right=e,this.top=i,this.bottom=r,this.near=void 0!==n?n:.1,this.far=void 0!==a?a:2e3,this.updateProjectionMatrix()},THREE.OrthographicCamera.prototype=Object.create(THREE.Camera.prototype),THREE.OrthographicCamera.prototype.constructor=THREE.OrthographicCamera,THREE.OrthographicCamera.prototype.updateProjectionMatrix=function(){var t=(this.right-this.left)/(2*this.zoom),e=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,r=(this.top+this.bottom)/2;this.projectionMatrix.makeOrthographic(i-t,i+t,r+e,r-e,this.near,this.far)},THREE.OrthographicCamera.prototype.clone=function(){var t=new THREE.OrthographicCamera;return THREE.Camera.prototype.clone.call(this,t),t.zoom=this.zoom,t.left=this.left,t.right=this.right,t.top=this.top,t.bottom=this.bottom,t.near=this.near,t.far=this.far,t.projectionMatrix.copy(this.projectionMatrix),t},THREE.PerspectiveCamera=function(t,e,i,r){THREE.Camera.call(this),this.type="PerspectiveCamera",this.zoom=1,this.fov=void 0!==t?t:50,this.aspect=void 0!==e?e:1,this.near=void 0!==i?i:.1,this.far=void 0!==r?r:2e3,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype=Object.create(THREE.Camera.prototype),THREE.PerspectiveCamera.prototype.constructor=THREE.PerspectiveCamera,THREE.PerspectiveCamera.prototype.setLens=function(t,e){void 0===e&&(e=24),this.fov=2*THREE.Math.radToDeg(Math.atan(e/(2*t))),this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.setViewOffset=function(t,e,i,r,n,a){this.fullWidth=t,this.fullHeight=e,this.x=i,this.y=r,this.width=n,this.height=a,this.updateProjectionMatrix()},THREE.PerspectiveCamera.prototype.updateProjectionMatrix=function(){var t=THREE.Math.radToDeg(2*Math.atan(Math.tan(.5*THREE.Math.degToRad(this.fov))/this.zoom));if(this.fullWidth){var e=(i=this.fullWidth/this.fullHeight)*(r=-(t=Math.tan(THREE.Math.degToRad(.5*t))*this.near)),i=Math.abs(i*t-e),r=Math.abs(t-r);this.projectionMatrix.makeFrustum(e+this.x*i/this.fullWidth,e+(this.x+this.width)*i/this.fullWidth,t-(this.y+this.height)*r/this.fullHeight,t-this.y*r/this.fullHeight,this.near,this.far)}else this.projectionMatrix.makePerspective(t,this.aspect,this.near,this.far)},THREE.PerspectiveCamera.prototype.clone=function(){var t=new THREE.PerspectiveCamera;return THREE.Camera.prototype.clone.call(this,t),t.zoom=this.zoom,t.fov=this.fov,t.aspect=this.aspect,t.near=this.near,t.far=this.far,t.projectionMatrix.copy(this.projectionMatrix),t},THREE.Light=function(t){THREE.Object3D.call(this),this.type="Light",this.color=new THREE.Color(t)},THREE.Light.prototype=Object.create(THREE.Object3D.prototype),THREE.Light.prototype.constructor=THREE.Light,THREE.Light.prototype.clone=function(t){return void 0===t&&(t=new THREE.Light),THREE.Object3D.prototype.clone.call(this,t),t.color.copy(this.color),t},THREE.AmbientLight=function(t){THREE.Light.call(this,t),this.type="AmbientLight"},THREE.AmbientLight.prototype=Object.create(THREE.Light.prototype),THREE.AmbientLight.prototype.constructor=THREE.AmbientLight,THREE.AmbientLight.prototype.clone=function(){var t=new THREE.AmbientLight;return THREE.Light.prototype.clone.call(this,t),t},THREE.AreaLight=function(t,e){THREE.Light.call(this,t),this.type="AreaLight",this.normal=new THREE.Vector3(0,-1,0),this.right=new THREE.Vector3(1,0,0),this.intensity=void 0!==e?e:1,this.height=this.width=1,this.constantAttenuation=1.5,this.linearAttenuation=.5,this.quadraticAttenuation=.1},THREE.AreaLight.prototype=Object.create(THREE.Light.prototype),THREE.AreaLight.prototype.constructor=THREE.AreaLight,THREE.DirectionalLight=function(t,e){THREE.Light.call(this,t),this.type="DirectionalLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==e?e:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraLeft=-500,this.shadowCameraTop=this.shadowCameraRight=500,this.shadowCameraBottom=-500,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowCascade=!1,this.shadowCascadeOffset=new THREE.Vector3(0,0,-1e3),this.shadowCascadeCount=2,this.shadowCascadeBias=[0,0,0],this.shadowCascadeWidth=[512,512,512],this.shadowCascadeHeight=[512,512,512],this.shadowCascadeNearZ=[-1,.99,.998],this.shadowCascadeFarZ=[.99,.998,1],this.shadowCascadeArray=[],this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.DirectionalLight.prototype=Object.create(THREE.Light.prototype),THREE.DirectionalLight.prototype.constructor=THREE.DirectionalLight,THREE.DirectionalLight.prototype.clone=function(){var t=new THREE.DirectionalLight;return THREE.Light.prototype.clone.call(this,t),t.target=this.target.clone(),t.intensity=this.intensity,t.castShadow=this.castShadow,t.onlyShadow=this.onlyShadow,t.shadowCameraNear=this.shadowCameraNear,t.shadowCameraFar=this.shadowCameraFar,t.shadowCameraLeft=this.shadowCameraLeft,t.shadowCameraRight=this.shadowCameraRight,t.shadowCameraTop=this.shadowCameraTop,t.shadowCameraBottom=this.shadowCameraBottom,t.shadowCameraVisible=this.shadowCameraVisible,t.shadowBias=this.shadowBias,t.shadowDarkness=this.shadowDarkness,t.shadowMapWidth=this.shadowMapWidth,t.shadowMapHeight=this.shadowMapHeight,t.shadowCascade=this.shadowCascade,t.shadowCascadeOffset.copy(this.shadowCascadeOffset),t.shadowCascadeCount=this.shadowCascadeCount,t.shadowCascadeBias=this.shadowCascadeBias.slice(0),t.shadowCascadeWidth=this.shadowCascadeWidth.slice(0),t.shadowCascadeHeight=this.shadowCascadeHeight.slice(0),t.shadowCascadeNearZ=this.shadowCascadeNearZ.slice(0),t.shadowCascadeFarZ=this.shadowCascadeFarZ.slice(0),t},THREE.HemisphereLight=function(t,e,i){THREE.Light.call(this,t),this.type="HemisphereLight",this.position.set(0,100,0),this.groundColor=new THREE.Color(e),this.intensity=void 0!==i?i:1},THREE.HemisphereLight.prototype=Object.create(THREE.Light.prototype),THREE.HemisphereLight.prototype.constructor=THREE.HemisphereLight,THREE.HemisphereLight.prototype.clone=function(){var t=new THREE.HemisphereLight;return THREE.Light.prototype.clone.call(this,t),t.groundColor.copy(this.groundColor),t.intensity=this.intensity,t},THREE.PointLight=function(t,e,i,r){THREE.Light.call(this,t),this.type="PointLight",this.intensity=void 0!==e?e:1,this.distance=void 0!==i?i:0,this.decay=void 0!==r?r:1},THREE.PointLight.prototype=Object.create(THREE.Light.prototype),THREE.PointLight.prototype.constructor=THREE.PointLight,THREE.PointLight.prototype.clone=function(){var t=new THREE.PointLight;return THREE.Light.prototype.clone.call(this,t),t.intensity=this.intensity,t.distance=this.distance,t.decay=this.decay,t},THREE.SpotLight=function(t,e,i,r,n,a){THREE.Light.call(this,t),this.type="SpotLight",this.position.set(0,1,0),this.target=new THREE.Object3D,this.intensity=void 0!==e?e:1,this.distance=void 0!==i?i:0,this.angle=void 0!==r?r:Math.PI/3,this.exponent=void 0!==n?n:10,this.decay=void 0!==a?a:1,this.onlyShadow=this.castShadow=!1,this.shadowCameraNear=50,this.shadowCameraFar=5e3,this.shadowCameraFov=50,this.shadowCameraVisible=!1,this.shadowBias=0,this.shadowDarkness=.5,this.shadowMapHeight=this.shadowMapWidth=512,this.shadowMatrix=this.shadowCamera=this.shadowMapSize=this.shadowMap=null},THREE.SpotLight.prototype=Object.create(THREE.Light.prototype),THREE.SpotLight.prototype.constructor=THREE.SpotLight,THREE.SpotLight.prototype.clone=function(){var t=new THREE.SpotLight;return THREE.Light.prototype.clone.call(this,t),t.target=this.target.clone(),t.intensity=this.intensity,t.distance=this.distance,t.angle=this.angle,t.exponent=this.exponent,t.decay=this.decay,t.castShadow=this.castShadow,t.onlyShadow=this.onlyShadow,t.shadowCameraNear=this.shadowCameraNear,t.shadowCameraFar=this.shadowCameraFar,t.shadowCameraFov=this.shadowCameraFov,t.shadowCameraVisible=this.shadowCameraVisible,t.shadowBias=this.shadowBias,t.shadowDarkness=this.shadowDarkness,t.shadowMapWidth=this.shadowMapWidth,t.shadowMapHeight=this.shadowMapHeight,t},THREE.Cache={files:{},add:function(t,e){this.files[t]=e},get:function(t){return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}},THREE.Loader=function(t){this.statusDomElement=(this.showStatus=t)?THREE.Loader.prototype.addStatusElement():null,this.imageLoader=new THREE.ImageLoader,this.onLoadStart=function(){},this.onLoadProgress=function(){},this.onLoadComplete=function(){}},THREE.Loader.prototype={constructor:THREE.Loader,crossOrigin:void 0,addStatusElement:function(){var t=document.createElement("div");return t.style.position="absolute",t.style.right="0px",t.style.top="0px",t.style.fontSize="0.8em",t.style.textAlign="left",t.style.background="rgba(0,0,0,0.25)",t.style.color="#fff",t.style.width="120px",t.style.padding="0.5em 0.5em 0.5em 0.5em",t.style.zIndex=1e3,t.innerHTML="Loading ...",t},updateProgress:function(t){var e="Loaded ";e=t.total?e+((100*t.loaded/t.total).toFixed(0)+"%"):e+((t.loaded/1024).toFixed(2)+" KB");this.statusDomElement.innerHTML=e},extractUrlBase:function(t){return 1===(t=t.split("/")).length?"./":(t.pop(),t.join("/")+"/")},initMaterials:function(t,e){for(var i=[],r=0;r<t.length;++r)i[r]=this.createMaterial(t[r],e);return i},needsTangents:function(t){for(var e=0,i=t.length;e<i;e++)if(t[e]instanceof THREE.ShaderMaterial)return!0;return!1},createMaterial:function(t,c){function u(t){return t=Math.log(t)/Math.LN2,Math.pow(2,Math.round(t))}function e(t,e,i,r,n,a,o){var s,h=c+i,l=THREE.Loader.Handlers.get(h);null!==l?s=l.load(h):(s=new THREE.Texture,(l=d.imageLoader).crossOrigin=d.crossOrigin,l.load(h,function(t){if(!1===THREE.Math.isPowerOfTwo(t.width)||!1===THREE.Math.isPowerOfTwo(t.height)){var e=u(t.width),i=u(t.height),r=document.createElement("canvas");r.width=e,r.height=i,r.getContext("2d").drawImage(t,0,0,e,i),s.image=r}else s.image=t;s.needsUpdate=!0})),s.sourceFile=i,r&&(s.repeat.set(r[0],r[1]),1!==r[0]&&(s.wrapS=THREE.RepeatWrapping),1!==r[1]&&(s.wrapT=THREE.RepeatWrapping)),n&&s.offset.set(n[0],n[1]),a&&(void 0!==(i={repeat:THREE.RepeatWrapping,mirror:THREE.MirroredRepeatWrapping})[a[0]]&&(s.wrapS=i[a[0]]),void 0!==i[a[1]]&&(s.wrapT=i[a[1]])),o&&(s.anisotropy=o),t[e]=s}function i(t){return(255*t[0]<<16)+(255*t[1]<<8)+255*t[2]}var d=this,r="MeshLambertMaterial",n={color:15658734,opacity:1,map:null,lightMap:null,normalMap:null,bumpMap:null,wireframe:!1};if(t.shading){var a=t.shading.toLowerCase();"phong"===a?r="MeshPhongMaterial":"basic"===a&&(r="MeshBasicMaterial")}return void 0!==t.blending&&void 0!==THREE[t.blending]&&(n.blending=THREE[t.blending]),void 0!==t.transparent&&(n.transparent=t.transparent),void 0!==t.opacity&&t.opacity<1&&(n.transparent=!0),void 0!==t.depthTest&&(n.depthTest=t.depthTest),void 0!==t.depthWrite&&(n.depthWrite=t.depthWrite),void 0!==t.visible&&(n.visible=t.visible),void 0!==t.flipSided&&(n.side=THREE.BackSide),void 0!==t.doubleSided&&(n.side=THREE.DoubleSide),void 0!==t.wireframe&&(n.wireframe=t.wireframe),void 0!==t.vertexColors&&("face"===t.vertexColors?n.vertexColors=THREE.FaceColors:t.vertexColors&&(n.vertexColors=THREE.VertexColors)),t.colorDiffuse?n.color=i(t.colorDiffuse):t.DbgColor&&(n.color=t.DbgColor),t.colorSpecular&&(n.specular=i(t.colorSpecular)),t.colorEmissive&&(n.emissive=i(t.colorEmissive)),void 0!==t.transparency&&(console.warn("THREE.Loader: transparency has been renamed to opacity"),t.opacity=t.transparency),void 0!==t.opacity&&(n.opacity=t.opacity),t.specularCoef&&(n.shininess=t.specularCoef),t.mapDiffuse&&c&&e(n,"map",t.mapDiffuse,t.mapDiffuseRepeat,t.mapDiffuseOffset,t.mapDiffuseWrap,t.mapDiffuseAnisotropy),t.mapLight&&c&&e(n,"lightMap",t.mapLight,t.mapLightRepeat,t.mapLightOffset,t.mapLightWrap,t.mapLightAnisotropy),t.mapBump&&c&&e(n,"bumpMap",t.mapBump,t.mapBumpRepeat,t.mapBumpOffset,t.mapBumpWrap,t.mapBumpAnisotropy),t.mapNormal&&c&&e(n,"normalMap",t.mapNormal,t.mapNormalRepeat,t.mapNormalOffset,t.mapNormalWrap,t.mapNormalAnisotropy),t.mapSpecular&&c&&e(n,"specularMap",t.mapSpecular,t.mapSpecularRepeat,t.mapSpecularOffset,t.mapSpecularWrap,t.mapSpecularAnisotropy),t.mapAlpha&&c&&e(n,"alphaMap",t.mapAlpha,t.mapAlphaRepeat,t.mapAlphaOffset,t.mapAlphaWrap,t.mapAlphaAnisotropy),t.mapBumpScale&&(n.bumpScale=t.mapBumpScale),t.mapNormalFactor&&(n.normalScale=new THREE.Vector2(t.mapNormalFactor,t.mapNormalFactor)),r=new THREE[r](n),void 0!==t.DbgName&&(r.name=t.DbgName),r}},THREE.Loader.Handlers={handlers:[],add:function(t,e){this.handlers.push(t,e)},get:function(t){for(var e=0,i=this.handlers.length;e<i;e+=2){var r=this.handlers[e+1];if(this.handlers[e].test(t))return r}return null}},THREE.XHRLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.XHRLoader.prototype={constructor:THREE.XHRLoader,load:function(e,i,r,n){var a=this,t=THREE.Cache.get(e);void 0!==t?i&&i(t):((t=new XMLHttpRequest).open("GET",e,!0),t.addEventListener("load",function(t){THREE.Cache.add(e,this.response),i&&i(this.response),a.manager.itemEnd(e)},!1),void 0!==r&&t.addEventListener("progress",function(t){r(t)},!1),void 0!==n&&t.addEventListener("error",function(t){n(t)},!1),void 0!==this.crossOrigin&&(t.crossOrigin=this.crossOrigin),void 0!==this.responseType&&(t.responseType=this.responseType),t.send(null),a.manager.itemStart(e))},setResponseType:function(t){this.responseType=t},setCrossOrigin:function(t){this.crossOrigin=t}},THREE.ImageLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.ImageLoader.prototype={constructor:THREE.ImageLoader,load:function(e,i,r,n){var a=this,t=THREE.Cache.get(e);if(void 0===t)return(t=document.createElement("img")).addEventListener("load",function(t){THREE.Cache.add(e,this),i&&i(this),a.manager.itemEnd(e)},!1),void 0!==r&&t.addEventListener("progress",function(t){r(t)},!1),void 0!==n&&t.addEventListener("error",function(t){n(t)},!1),void 0!==this.crossOrigin&&(t.crossOrigin=this.crossOrigin),t.src=e,a.manager.itemStart(e),t;i(t)},setCrossOrigin:function(t){this.crossOrigin=t}},THREE.JSONLoader=function(t){THREE.Loader.call(this,t),this.withCredentials=!1},THREE.JSONLoader.prototype=Object.create(THREE.Loader.prototype),THREE.JSONLoader.prototype.constructor=THREE.JSONLoader,THREE.JSONLoader.prototype.load=function(t,e,i){i=i&&"string"==typeof i?i:this.extractUrlBase(t),this.onLoadStart(),this.loadAjaxJSON(this,t,e,i)},THREE.JSONLoader.prototype.loadAjaxJSON=function(i,r,n,a,o){var s=new XMLHttpRequest,h=0;s.onreadystatechange=function(){if(s.readyState===s.DONE)if(200===s.status||0===s.status){if(s.responseText){var t=JSON.parse(s.responseText),e=t.metadata;if(void 0!==e){if("object"===e.type)return void THREE.error("THREE.JSONLoader: "+r+" should be loaded with THREE.ObjectLoader instead.");if("scene"===e.type)return void THREE.error("THREE.JSONLoader: "+r+" seems to be a Scene. Use THREE.SceneLoader instead.")}t=i.parse(t,a),n(t.geometry,t.materials)}else THREE.error("THREE.JSONLoader: "+r+" seems to be unreachable or the file is empty.");i.onLoadComplete()}else THREE.error("THREE.JSONLoader: Couldn't load "+r+" ("+s.status+")");else s.readyState===s.LOADING?o&&(0===h&&(h=s.getResponseHeader("Content-Length")),o({total:h,loaded:s.responseText.length})):s.readyState===s.HEADERS_RECEIVED&&void 0!==o&&(h=s.getResponseHeader("Content-Length"))},s.open("GET",r,!0),s.withCredentials=this.withCredentials,s.send(null)},THREE.JSONLoader.prototype.parse=function(v,t){var y=new THREE.Geometry,e=void 0!==v.scale?1/v.scale:1;return function(t){var e,i,r,n,a,o,s,h,l,c,u,d,p,f=v.faces;o=v.vertices;var m=v.normals,E=v.colors,g=0;if(void 0!==v.uvs){for(e=0;e<v.uvs.length;e++)v.uvs[e].length&&g++;for(e=0;e<g;e++)y.faceVertexUvs[e]=[]}for(n=0,a=o.length;n<a;)(e=new THREE.Vector3).x=o[n++]*t,e.y=o[n++]*t,e.z=o[n++]*t,y.vertices.push(e);for(n=0,a=f.length;n<a;)if(l=1&(t=f[n++]),r=2&t,e=8&t,s=16&t,c=32&t,o=64&t,t&=128,l){if((l=new THREE.Face3).a=f[n],l.b=f[n+1],l.c=f[n+3],(u=new THREE.Face3).a=f[n+1],u.b=f[n+2],u.c=f[n+3],n+=4,r&&(r=f[n++],l.materialIndex=r,u.materialIndex=r),r=y.faces.length,e)for(e=0;e<g;e++)for(d=v.uvs[e],y.faceVertexUvs[e][r]=[],y.faceVertexUvs[e][r+1]=[],i=0;i<4;i++)p=d[2*(h=f[n++])],h=d[2*h+1],p=new THREE.Vector2(p,h),2!==i&&y.faceVertexUvs[e][r].push(p),0!==i&&y.faceVertexUvs[e][r+1].push(p);if(s&&(s=3*f[n++],l.normal.set(m[s++],m[s++],m[s]),u.normal.copy(l.normal)),c)for(e=0;e<4;e++)s=3*f[n++],c=new THREE.Vector3(m[s++],m[s++],m[s]),2!==e&&l.vertexNormals.push(c),0!==e&&u.vertexNormals.push(c);if(o&&(o=E[o=f[n++]],l.color.setHex(o),u.color.setHex(o)),t)for(e=0;e<4;e++)o=E[o=f[n++]],2!==e&&l.vertexColors.push(new THREE.Color(o)),0!==e&&u.vertexColors.push(new THREE.Color(o));y.faces.push(l),y.faces.push(u)}else{if((l=new THREE.Face3).a=f[n++],l.b=f[n++],l.c=f[n++],r&&(r=f[n++],l.materialIndex=r),r=y.faces.length,e)for(e=0;e<g;e++)for(d=v.uvs[e],y.faceVertexUvs[e][r]=[],i=0;i<3;i++)p=d[2*(h=f[n++])],h=d[2*h+1],p=new THREE.Vector2(p,h),y.faceVertexUvs[e][r].push(p);if(s&&(s=3*f[n++],l.normal.set(m[s++],m[s++],m[s])),c)for(e=0;e<3;e++)s=3*f[n++],c=new THREE.Vector3(m[s++],m[s++],m[s]),l.vertexNormals.push(c);if(o&&(o=f[n++],l.color.setHex(E[o])),t)for(e=0;e<3;e++)o=f[n++],l.vertexColors.push(new THREE.Color(E[o]));y.faces.push(l)}}(e),function(){var t=void 0!==v.influencesPerVertex?v.influencesPerVertex:2;if(v.skinWeights)for(var e=0,i=v.skinWeights.length;e<i;e+=t)y.skinWeights.push(new THREE.Vector4(v.skinWeights[e],1<t?v.skinWeights[e+1]:0,2<t?v.skinWeights[e+2]:0,3<t?v.skinWeights[e+3]:0));if(v.skinIndices)for(e=0,i=v.skinIndices.length;e<i;e+=t)y.skinIndices.push(new THREE.Vector4(v.skinIndices[e],1<t?v.skinIndices[e+1]:0,2<t?v.skinIndices[e+2]:0,3<t?v.skinIndices[e+3]:0));y.bones=v.bones,y.bones&&0<y.bones.length&&(y.skinWeights.length!==y.skinIndices.length||y.skinIndices.length!==y.vertices.length)&&THREE.warn("THREE.JSONLoader: When skinning, number of vertices ("+y.vertices.length+"), skinIndices ("+y.skinIndices.length+"), and skinWeights ("+y.skinWeights.length+") should match."),y.animation=v.animation,y.animations=v.animations}(),function(t){var e,i,r,n,a,o;if(void 0!==v.morphTargets)for(e=0,i=v.morphTargets.length;e<i;e++)for(y.morphTargets[e]={},y.morphTargets[e].name=v.morphTargets[e].name,y.morphTargets[e].vertices=[],a=y.morphTargets[e].vertices,r=0,n=(o=v.morphTargets[e].vertices).length;r<n;r+=3){var s=new THREE.Vector3;s.x=o[r]*t,s.y=o[r+1]*t,s.z=o[r+2]*t,a.push(s)}if(void 0!==v.morphColors)for(e=0,i=v.morphColors.length;e<i;e++)for(y.morphColors[e]={},y.morphColors[e].name=v.morphColors[e].name,y.morphColors[e].colors=[],n=y.morphColors[e].colors,t=0,r=(a=v.morphColors[e].colors).length;t<r;t+=3)(o=new THREE.Color(16755200)).setRGB(a[t],a[t+1],a[t+2]),n.push(o)}(e),y.computeFaceNormals(),y.computeBoundingSphere(),void 0===v.materials||0===v.materials.length?{geometry:y}:(e=this.initMaterials(v.materials,t),this.needsTangents(e)&&y.computeTangents(),{geometry:y,materials:e})},THREE.LoadingManager=function(t,e,i){var r=this,n=0,a=0;this.onLoad=t,this.onProgress=e,this.onError=i,this.itemStart=function(t){a++},this.itemEnd=function(t){n++,void 0!==r.onProgress&&r.onProgress(t,n,a),n===a&&void 0!==r.onLoad&&r.onLoad()}},THREE.DefaultLoadingManager=new THREE.LoadingManager,THREE.BufferGeometryLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.BufferGeometryLoader.prototype={constructor:THREE.BufferGeometryLoader,load:function(t,e,i,r){var n=this,a=new THREE.XHRLoader(n.manager);a.setCrossOrigin(this.crossOrigin),a.load(t,function(t){e(n.parse(JSON.parse(t)))},i,r)},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t){var e,i=new THREE.BufferGeometry,r=t.data.attributes;for(e in r){var n=r[e],a=new self[n.type](n.array);i.addAttribute(e,new THREE.BufferAttribute(a,n.itemSize))}return void 0!==(r=t.data.offsets)&&(i.offsets=JSON.parse(JSON.stringify(r))),void 0!==(t=t.data.boundingSphere)&&(r=new THREE.Vector3,void 0!==t.center&&r.fromArray(t.center),i.boundingSphere=new THREE.Sphere(r,t.radius)),i}},THREE.MaterialLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.MaterialLoader.prototype={constructor:THREE.MaterialLoader,load:function(t,e,i,r){var n=this,a=new THREE.XHRLoader(n.manager);a.setCrossOrigin(this.crossOrigin),a.load(t,function(t){e(n.parse(JSON.parse(t)))},i,r)},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t){var e=new THREE[t.type];if(void 0!==t.color&&e.color.setHex(t.color),void 0!==t.emissive&&e.emissive.setHex(t.emissive),void 0!==t.specular&&e.specular.setHex(t.specular),void 0!==t.shininess&&(e.shininess=t.shininess),void 0!==t.uniforms&&(e.uniforms=t.uniforms),void 0!==t.vertexShader&&(e.vertexShader=t.vertexShader),void 0!==t.fragmentShader&&(e.fragmentShader=t.fragmentShader),void 0!==t.vertexColors&&(e.vertexColors=t.vertexColors),void 0!==t.shading&&(e.shading=t.shading),void 0!==t.blending&&(e.blending=t.blending),void 0!==t.side&&(e.side=t.side),void 0!==t.opacity&&(e.opacity=t.opacity),void 0!==t.transparent&&(e.transparent=t.transparent),void 0!==t.wireframe&&(e.wireframe=t.wireframe),void 0!==t.size&&(e.size=t.size),void 0!==t.sizeAttenuation&&(e.sizeAttenuation=t.sizeAttenuation),void 0!==t.materials)for(var i=0,r=t.materials.length;i<r;i++)e.materials.push(this.parse(t.materials[i]));return e}},THREE.ObjectLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager,this.texturePath=""},THREE.ObjectLoader.prototype={constructor:THREE.ObjectLoader,load:function(t,e,i,r){""===this.texturePath&&(this.texturePath=t.substring(0,t.lastIndexOf("/")+1));var n=this,a=new THREE.XHRLoader(n.manager);a.setCrossOrigin(this.crossOrigin),a.load(t,function(t){n.parse(JSON.parse(t),e)},i,r)},setTexturePath:function(t){this.texturePath=t},setCrossOrigin:function(t){this.crossOrigin=t},parse:function(t,e){var i=this.parseGeometries(t.geometries),r=this.parseImages(t.images,function(){void 0!==e&&e(n)}),n=(r=this.parseTextures(t.textures,r),r=this.parseMaterials(t.materials,r),this.parseObject(t.object,i,r));return void 0!==t.images&&0!==t.images.length||void 0===e||e(n),n},parseGeometries:function(t){var e={};if(void 0!==t)for(var i=new THREE.JSONLoader,r=new THREE.BufferGeometryLoader,n=0,a=t.length;n<a;n++){var o,s=t[n];switch(s.type){case"PlaneGeometry":case"PlaneBufferGeometry":o=new THREE[s.type](s.width,s.height,s.widthSegments,s.heightSegments);break;case"BoxGeometry":case"CubeGeometry":o=new THREE.BoxGeometry(s.width,s.height,s.depth,s.widthSegments,s.heightSegments,s.depthSegments);break;case"CircleGeometry":o=new THREE.CircleGeometry(s.radius,s.segments);break;case"CylinderGeometry":o=new THREE.CylinderGeometry(s.radiusTop,s.radiusBottom,s.height,s.radialSegments,s.heightSegments,s.openEnded);break;case"SphereGeometry":o=new THREE.SphereGeometry(s.radius,s.widthSegments,s.heightSegments,s.phiStart,s.phiLength,s.thetaStart,s.thetaLength);break;case"IcosahedronGeometry":o=new THREE.IcosahedronGeometry(s.radius,s.detail);break;case"TorusGeometry":o=new THREE.TorusGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.arc);break;case"TorusKnotGeometry":o=new THREE.TorusKnotGeometry(s.radius,s.tube,s.radialSegments,s.tubularSegments,s.p,s.q,s.heightScale);break;case"BufferGeometry":o=r.parse(s);break;case"Geometry":o=i.parse(s.data).geometry}o.uuid=s.uuid,void 0!==s.name&&(o.name=s.name),e[s.uuid]=o}return e},parseMaterials:function(t,e){var i={};if(void 0!==t)for(var r=function(t){return void 0===e[t]&&THREE.warn("THREE.ObjectLoader: Undefined texture",t),e[t]},n=new THREE.MaterialLoader,a=0,o=t.length;a<o;a++){var s=t[a],h=n.parse(s);h.uuid=s.uuid,void 0!==s.name&&(h.name=s.name),void 0!==s.map&&(h.map=r(s.map)),void 0!==s.bumpMap&&(h.bumpMap=r(s.bumpMap),s.bumpScale&&(h.bumpScale=new THREE.Vector2(s.bumpScale,s.bumpScale))),void 0!==s.alphaMap&&(h.alphaMap=r(s.alphaMap)),void 0!==s.envMap&&(h.envMap=r(s.envMap)),void 0!==s.normalMap&&(h.normalMap=r(s.normalMap),s.normalScale&&(h.normalScale=new THREE.Vector2(s.normalScale,s.normalScale))),void 0!==s.lightMap&&(h.lightMap=r(s.lightMap)),void 0!==s.specularMap&&(h.specularMap=r(s.specularMap)),i[s.uuid]=h}return i},parseImages:function(t,e){var i=this,r={};if(void 0!==t&&0<t.length){var n=new THREE.LoadingManager(e),a=new THREE.ImageLoader(n);a.setCrossOrigin(this.crossOrigin);n=function(t){return i.manager.itemStart(t),a.load(t,function(){i.manager.itemEnd(t)})};for(var o=0,s=t.length;o<s;o++){var h=t[o],l=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(h.url)?h.url:i.texturePath+h.url;r[h.uuid]=n(l)}}return r},parseTextures:function(t,e){var i={};if(void 0!==t)for(var r=0,n=t.length;r<n;r++){var a=t[r];void 0===a.image&&THREE.warn('THREE.ObjectLoader: No "image" speficied for',a.uuid),void 0===e[a.image]&&THREE.warn("THREE.ObjectLoader: Undefined image",a.image);var o=new THREE.Texture(e[a.image]);o.needsUpdate=!0,o.uuid=a.uuid,void 0!==a.name&&(o.name=a.name),void 0!==a.repeat&&(o.repeat=new THREE.Vector2(a.repeat[0],a.repeat[1])),void 0!==a.minFilter&&(o.minFilter=THREE[a.minFilter]),void 0!==a.magFilter&&(o.magFilter=THREE[a.magFilter]),void 0!==a.anisotropy&&(o.anisotropy=a.anisotropy),a.wrap instanceof Array&&(o.wrapS=THREE[a.wrap[0]],o.wrapT=THREE[a.wrap[1]]),i[a.uuid]=o}return i},parseObject:function(){var o=new THREE.Matrix4;return function(t,e,i){var r;r=function(t){return void 0===e[t]&&THREE.warn("THREE.ObjectLoader: Undefined geometry",t),e[t]};var n=function(t){return void 0===i[t]&&THREE.warn("THREE.ObjectLoader: Undefined material",t),i[t]};switch(t.type){case"Scene":r=new THREE.Scene;break;case"PerspectiveCamera":r=new THREE.PerspectiveCamera(t.fov,t.aspect,t.near,t.far);break;case"OrthographicCamera":r=new THREE.OrthographicCamera(t.left,t.right,t.top,t.bottom,t.near,t.far);break;case"AmbientLight":r=new THREE.AmbientLight(t.color);break;case"DirectionalLight":r=new THREE.DirectionalLight(t.color,t.intensity);break;case"PointLight":r=new THREE.PointLight(t.color,t.intensity,t.distance,t.decay);break;case"SpotLight":r=new THREE.SpotLight(t.color,t.intensity,t.distance,t.angle,t.exponent,t.decay);break;case"HemisphereLight":r=new THREE.HemisphereLight(t.color,t.groundColor,t.intensity);break;case"Mesh":r=new THREE.Mesh(r(t.geometry),n(t.material));break;case"Line":r=new THREE.Line(r(t.geometry),n(t.material),t.mode);break;case"PointCloud":r=new THREE.PointCloud(r(t.geometry),n(t.material));break;case"Sprite":r=new THREE.Sprite(n(t.material));break;case"Group":r=new THREE.Group;break;default:r=new THREE.Object3D}if(r.uuid=t.uuid,void 0!==t.name&&(r.name=t.name),void 0!==t.matrix?(o.fromArray(t.matrix),o.decompose(r.position,r.quaternion,r.scale)):(void 0!==t.position&&r.position.fromArray(t.position),void 0!==t.rotation&&r.rotation.fromArray(t.rotation),void 0!==t.scale&&r.scale.fromArray(t.scale)),void 0!==t.visible&&(r.visible=t.visible),void 0!==t.userData&&(r.userData=t.userData),void 0!==t.children)for(var a in t.children)r.add(this.parseObject(t.children[a],e,i));return r}}()},THREE.TextureLoader=function(t){this.manager=void 0!==t?t:THREE.DefaultLoadingManager},THREE.TextureLoader.prototype={constructor:THREE.TextureLoader,load:function(t,e,i,r){var n=new THREE.ImageLoader(this.manager);n.setCrossOrigin(this.crossOrigin),n.load(t,function(t){(t=new THREE.Texture(t)).needsUpdate=!0,void 0!==e&&e(t)},i,r)},setCrossOrigin:function(t){this.crossOrigin=t}},THREE.DataTextureLoader=THREE.BinaryTextureLoader=function(){this._parser=null},THREE.BinaryTextureLoader.prototype={constructor:THREE.BinaryTextureLoader,load:function(t,e,i,r){var n=this,a=new THREE.DataTexture,o=new THREE.XHRLoader;return o.setResponseType("arraybuffer"),o.load(t,function(t){(t=n._parser(t))&&(void 0!==t.image?a.image=t.image:void 0!==t.data&&(a.image.width=t.width,a.image.height=t.height,a.image.data=t.data),a.wrapS=void 0!==t.wrapS?t.wrapS:THREE.ClampToEdgeWrapping,a.wrapT=void 0!==t.wrapT?t.wrapT:THREE.ClampToEdgeWrapping,a.magFilter=void 0!==t.magFilter?t.magFilter:THREE.LinearFilter,a.minFilter=void 0!==t.minFilter?t.minFilter:THREE.LinearMipMapLinearFilter,a.anisotropy=void 0!==t.anisotropy?t.anisotropy:1,void 0!==t.format&&(a.format=t.format),void 0!==t.type&&(a.type=t.type),void 0!==t.mipmaps&&(a.mipmaps=t.mipmaps),1===t.mipmapCount&&(a.minFilter=THREE.LinearFilter),a.needsUpdate=!0,e&&e(a,t))},i,r),a}},THREE.CompressedTextureLoader=function(){this._parser=null},THREE.CompressedTextureLoader.prototype={constructor:THREE.CompressedTextureLoader,load:function(t,n,e){var a=this,o=[],s=new THREE.CompressedTexture;s.image=o;var i=new THREE.XHRLoader;if(i.setResponseType("arraybuffer"),t instanceof Array){var r=0;e=function(e){i.load(t[e],function(t){t=a._parser(t,!0),o[e]={width:t.width,height:t.height,format:t.format,mipmaps:t.mipmaps},6===(r+=1)&&(1==t.mipmapCount&&(s.minFilter=THREE.LinearFilter),s.format=t.format,s.needsUpdate=!0,n&&n(s))})};for(var h=0,l=t.length;h<l;++h)e(h)}else i.load(t,function(t){if((t=a._parser(t,!0)).isCubemap)for(var e=t.mipmaps.length/t.mipmapCount,i=0;i<e;i++){o[i]={mipmaps:[]};for(var r=0;r<t.mipmapCount;r++)o[i].mipmaps.push(t.mipmaps[i*t.mipmapCount+r]),o[i].format=t.format,o[i].width=t.width,o[i].height=t.height}else s.image.width=t.width,s.image.height=t.height,s.mipmaps=t.mipmaps;1===t.mipmapCount&&(s.minFilter=THREE.LinearFilter),s.format=t.format,s.needsUpdate=!0,n&&n(s)});return s}},THREE.Material=function(){Object.defineProperty(this,"id",{value:THREE.MaterialIdCount++}),this.uuid=THREE.Math.generateUUID(),this.name="",this.type="Material",this.side=THREE.FrontSide,this.opacity=1,this.transparent=!1,this.blending=THREE.NormalBlending,this.blendSrc=THREE.SrcAlphaFactor,this.blendDst=THREE.OneMinusSrcAlphaFactor,this.blendEquation=THREE.AddEquation,this.blendEquationAlpha=this.blendDstAlpha=this.blendSrcAlpha=null,this.colorWrite=this.depthWrite=this.depthTest=!0,this.polygonOffset=!1,this.overdraw=this.alphaTest=this.polygonOffsetUnits=this.polygonOffsetFactor=0,this._needsUpdate=this.visible=!0},THREE.Material.prototype={constructor:THREE.Material,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){!0===t&&this.update(),this._needsUpdate=t},setValues:function(t){if(void 0!==t)for(var e in t){var i=t[e];if(void 0===i)THREE.warn("THREE.Material: '"+e+"' parameter is undefined.");else if(e in this){var r=this[e];r instanceof THREE.Color?r.set(i):r instanceof THREE.Vector3&&i instanceof THREE.Vector3?r.copy(i):this[e]="overdraw"==e?Number(i):i}}},toJSON:function(){var t={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type};return""!==this.name&&(t.name=this.name),this instanceof THREE.MeshBasicMaterial?(t.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(t.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(t.blending=this.blending),this.side!==THREE.FrontSide&&(t.side=this.side)):this instanceof THREE.MeshLambertMaterial?(t.color=this.color.getHex(),t.emissive=this.emissive.getHex(),this.vertexColors!==THREE.NoColors&&(t.vertexColors=this.vertexColors),this.shading!==THREE.SmoothShading&&(t.shading=this.shading),this.blending!==THREE.NormalBlending&&(t.blending=this.blending),this.side!==THREE.FrontSide&&(t.side=this.side)):this instanceof THREE.MeshPhongMaterial?(t.color=this.color.getHex(),t.emissive=this.emissive.getHex(),t.specular=this.specular.getHex(),t.shininess=this.shininess,this.vertexColors!==THREE.NoColors&&(t.vertexColors=this.vertexColors),this.shading!==THREE.SmoothShading&&(t.shading=this.shading),this.blending!==THREE.NormalBlending&&(t.blending=this.blending),this.side!==THREE.FrontSide&&(t.side=this.side)):this instanceof THREE.MeshNormalMaterial?(this.blending!==THREE.NormalBlending&&(t.blending=this.blending),this.side!==THREE.FrontSide&&(t.side=this.side)):this instanceof THREE.MeshDepthMaterial?(this.blending!==THREE.NormalBlending&&(t.blending=this.blending),this.side!==THREE.FrontSide&&(t.side=this.side)):this instanceof THREE.PointCloudMaterial?(t.size=this.size,t.sizeAttenuation=this.sizeAttenuation,t.color=this.color.getHex(),this.vertexColors!==THREE.NoColors&&(t.vertexColors=this.vertexColors),this.blending!==THREE.NormalBlending&&(t.blending=this.blending)):this instanceof THREE.ShaderMaterial?(t.uniforms=this.uniforms,t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader):this instanceof THREE.SpriteMaterial&&(t.color=this.color.getHex()),this.opacity<1&&(t.opacity=this.opacity),!1!==this.transparent&&(t.transparent=this.transparent),!1!==this.wireframe&&(t.wireframe=this.wireframe),t},clone:function(t){return void 0===t&&(t=new THREE.Material),t.name=this.name,t.side=this.side,t.opacity=this.opacity,t.transparent=this.transparent,t.blending=this.blending,t.blendSrc=this.blendSrc,t.blendDst=this.blendDst,t.blendEquation=this.blendEquation,t.blendSrcAlpha=this.blendSrcAlpha,t.blendDstAlpha=this.blendDstAlpha,t.blendEquationAlpha=this.blendEquationAlpha,t.depthTest=this.depthTest,t.depthWrite=this.depthWrite,t.polygonOffset=this.polygonOffset,t.polygonOffsetFactor=this.polygonOffsetFactor,t.polygonOffsetUnits=this.polygonOffsetUnits,t.alphaTest=this.alphaTest,t.overdraw=this.overdraw,t.visible=this.visible,t},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Material.prototype),THREE.MaterialIdCount=0,THREE.LineBasicMaterial=function(t){THREE.Material.call(this),this.type="LineBasicMaterial",this.color=new THREE.Color(16777215),this.linewidth=1,this.linejoin=this.linecap="round",this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.LineBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineBasicMaterial.prototype.constructor=THREE.LineBasicMaterial,THREE.LineBasicMaterial.prototype.clone=function(){var t=new THREE.LineBasicMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.linewidth=this.linewidth,t.linecap=this.linecap,t.linejoin=this.linejoin,t.vertexColors=this.vertexColors,t.fog=this.fog,t},THREE.LineDashedMaterial=function(t){THREE.Material.call(this),this.type="LineDashedMaterial",this.color=new THREE.Color(16777215),this.scale=this.linewidth=1,this.dashSize=3,this.gapSize=1,this.vertexColors=!1,this.fog=!0,this.setValues(t)},THREE.LineDashedMaterial.prototype=Object.create(THREE.Material.prototype),THREE.LineDashedMaterial.prototype.constructor=THREE.LineDashedMaterial,THREE.LineDashedMaterial.prototype.clone=function(){var t=new THREE.LineDashedMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.linewidth=this.linewidth,t.scale=this.scale,t.dashSize=this.dashSize,t.gapSize=this.gapSize,t.vertexColors=this.vertexColors,t.fog=this.fog,t},THREE.MeshBasicMaterial=function(t){THREE.Material.call(this),this.type="MeshBasicMaterial",this.color=new THREE.Color(16777215),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshBasicMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshBasicMaterial.prototype.constructor=THREE.MeshBasicMaterial,THREE.MeshBasicMaterial.prototype.clone=function(){var t=new THREE.MeshBasicMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.map=this.map,t.lightMap=this.lightMap,t.specularMap=this.specularMap,t.alphaMap=this.alphaMap,t.envMap=this.envMap,t.combine=this.combine,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,t.fog=this.fog,t.shading=this.shading,t.wireframe=this.wireframe,t.wireframeLinewidth=this.wireframeLinewidth,t.wireframeLinecap=this.wireframeLinecap,t.wireframeLinejoin=this.wireframeLinejoin,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t},THREE.MeshLambertMaterial=function(t){THREE.Material.call(this),this.type="MeshLambertMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.wrapAround=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.envMap=this.alphaMap=this.specularMap=this.lightMap=this.map=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshLambertMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshLambertMaterial.prototype.constructor=THREE.MeshLambertMaterial,THREE.MeshLambertMaterial.prototype.clone=function(){var t=new THREE.MeshLambertMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.emissive.copy(this.emissive),t.wrapAround=this.wrapAround,t.wrapRGB.copy(this.wrapRGB),t.map=this.map,t.lightMap=this.lightMap,t.specularMap=this.specularMap,t.alphaMap=this.alphaMap,t.envMap=this.envMap,t.combine=this.combine,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,t.fog=this.fog,t.shading=this.shading,t.wireframe=this.wireframe,t.wireframeLinewidth=this.wireframeLinewidth,t.wireframeLinecap=this.wireframeLinecap,t.wireframeLinejoin=this.wireframeLinejoin,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.morphNormals=this.morphNormals,t},THREE.MeshPhongMaterial=function(t){THREE.Material.call(this),this.type="MeshPhongMaterial",this.color=new THREE.Color(16777215),this.emissive=new THREE.Color(0),this.specular=new THREE.Color(1118481),this.shininess=30,this.wrapAround=this.metal=!1,this.wrapRGB=new THREE.Vector3(1,1,1),this.bumpMap=this.lightMap=this.map=null,this.bumpScale=1,this.normalMap=null,this.normalScale=new THREE.Vector2(1,1),this.envMap=this.alphaMap=this.specularMap=null,this.combine=THREE.MultiplyOperation,this.reflectivity=1,this.refractionRatio=.98,this.fog=!0,this.shading=THREE.SmoothShading,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinejoin=this.wireframeLinecap="round",this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.setValues(t)},THREE.MeshPhongMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshPhongMaterial.prototype.constructor=THREE.MeshPhongMaterial,THREE.MeshPhongMaterial.prototype.clone=function(){var t=new THREE.MeshPhongMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.emissive.copy(this.emissive),t.specular.copy(this.specular),t.shininess=this.shininess,t.metal=this.metal,t.wrapAround=this.wrapAround,t.wrapRGB.copy(this.wrapRGB),t.map=this.map,t.lightMap=this.lightMap,t.bumpMap=this.bumpMap,t.bumpScale=this.bumpScale,t.normalMap=this.normalMap,t.normalScale.copy(this.normalScale),t.specularMap=this.specularMap,t.alphaMap=this.alphaMap,t.envMap=this.envMap,t.combine=this.combine,t.reflectivity=this.reflectivity,t.refractionRatio=this.refractionRatio,t.fog=this.fog,t.shading=this.shading,t.wireframe=this.wireframe,t.wireframeLinewidth=this.wireframeLinewidth,t.wireframeLinecap=this.wireframeLinecap,t.wireframeLinejoin=this.wireframeLinejoin,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.morphNormals=this.morphNormals,t},THREE.MeshDepthMaterial=function(t){THREE.Material.call(this),this.type="MeshDepthMaterial",this.wireframe=this.morphTargets=!1,this.wireframeLinewidth=1,this.setValues(t)},THREE.MeshDepthMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshDepthMaterial.prototype.constructor=THREE.MeshDepthMaterial,THREE.MeshDepthMaterial.prototype.clone=function(){var t=new THREE.MeshDepthMaterial;return THREE.Material.prototype.clone.call(this,t),t.wireframe=this.wireframe,t.wireframeLinewidth=this.wireframeLinewidth,t},THREE.MeshNormalMaterial=function(t){THREE.Material.call(this,t),this.type="MeshNormalMaterial",this.wireframe=!1,this.wireframeLinewidth=1,this.morphTargets=!1,this.setValues(t)},THREE.MeshNormalMaterial.prototype=Object.create(THREE.Material.prototype),THREE.MeshNormalMaterial.prototype.constructor=THREE.MeshNormalMaterial,THREE.MeshNormalMaterial.prototype.clone=function(){var t=new THREE.MeshNormalMaterial;return THREE.Material.prototype.clone.call(this,t),t.wireframe=this.wireframe,t.wireframeLinewidth=this.wireframeLinewidth,t},THREE.MeshFaceMaterial=function(t){this.uuid=THREE.Math.generateUUID(),this.type="MeshFaceMaterial",this.materials=t instanceof Array?t:[]},THREE.MeshFaceMaterial.prototype={constructor:THREE.MeshFaceMaterial,toJSON:function(){for(var t={metadata:{version:4.2,type:"material",generator:"MaterialExporter"},uuid:this.uuid,type:this.type,materials:[]},e=0,i=this.materials.length;e<i;e++)t.materials.push(this.materials[e].toJSON());return t},clone:function(){for(var t=new THREE.MeshFaceMaterial,e=0;e<this.materials.length;e++)t.materials.push(this.materials[e].clone());return t}},THREE.PointCloudMaterial=function(t){THREE.Material.call(this),this.type="PointCloudMaterial",this.color=new THREE.Color(16777215),this.map=null,this.size=1,this.sizeAttenuation=!0,this.vertexColors=THREE.NoColors,this.fog=!0,this.setValues(t)},THREE.PointCloudMaterial.prototype=Object.create(THREE.Material.prototype),THREE.PointCloudMaterial.prototype.constructor=THREE.PointCloudMaterial,THREE.PointCloudMaterial.prototype.clone=function(){var t=new THREE.PointCloudMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.map=this.map,t.size=this.size,t.sizeAttenuation=this.sizeAttenuation,t.vertexColors=this.vertexColors,t.fog=this.fog,t},THREE.ParticleBasicMaterial=function(t){return THREE.warn("THREE.ParticleBasicMaterial has been renamed to THREE.PointCloudMaterial."),new THREE.PointCloudMaterial(t)},THREE.ParticleSystemMaterial=function(t){return THREE.warn("THREE.ParticleSystemMaterial has been renamed to THREE.PointCloudMaterial."),new THREE.PointCloudMaterial(t)},THREE.ShaderMaterial=function(t){THREE.Material.call(this),this.type="ShaderMaterial",this.defines={},this.uniforms={},this.attributes=null,this.vertexShader="void main() {\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",this.fragmentShader="void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n}",this.shading=THREE.SmoothShading,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.lights=this.fog=!1,this.vertexColors=THREE.NoColors,this.morphNormals=this.morphTargets=this.skinning=!1,this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv2:[0,0]},this.index0AttributeName=void 0,this.setValues(t)},THREE.ShaderMaterial.prototype=Object.create(THREE.Material.prototype),THREE.ShaderMaterial.prototype.constructor=THREE.ShaderMaterial,THREE.ShaderMaterial.prototype.clone=function(){var t=new THREE.ShaderMaterial;return THREE.Material.prototype.clone.call(this,t),t.fragmentShader=this.fragmentShader,t.vertexShader=this.vertexShader,t.uniforms=THREE.UniformsUtils.clone(this.uniforms),t.attributes=this.attributes,t.defines=this.defines,t.shading=this.shading,t.wireframe=this.wireframe,t.wireframeLinewidth=this.wireframeLinewidth,t.fog=this.fog,t.lights=this.lights,t.vertexColors=this.vertexColors,t.skinning=this.skinning,t.morphTargets=this.morphTargets,t.morphNormals=this.morphNormals,t},THREE.RawShaderMaterial=function(t){THREE.ShaderMaterial.call(this,t),this.type="RawShaderMaterial"},THREE.RawShaderMaterial.prototype=Object.create(THREE.ShaderMaterial.prototype),THREE.RawShaderMaterial.prototype.constructor=THREE.RawShaderMaterial,THREE.RawShaderMaterial.prototype.clone=function(){var t=new THREE.RawShaderMaterial;return THREE.ShaderMaterial.prototype.clone.call(this,t),t},THREE.SpriteMaterial=function(t){THREE.Material.call(this),this.type="SpriteMaterial",this.color=new THREE.Color(16777215),this.map=null,this.rotation=0,this.fog=!1,this.setValues(t)},THREE.SpriteMaterial.prototype=Object.create(THREE.Material.prototype),THREE.SpriteMaterial.prototype.constructor=THREE.SpriteMaterial,THREE.SpriteMaterial.prototype.clone=function(){var t=new THREE.SpriteMaterial;return THREE.Material.prototype.clone.call(this,t),t.color.copy(this.color),t.map=this.map,t.rotation=this.rotation,t.fog=this.fog,t},THREE.Texture=function(t,e,i,r,n,a,o,s,h){Object.defineProperty(this,"id",{value:THREE.TextureIdCount++}),this.uuid=THREE.Math.generateUUID(),this.sourceFile=this.name="",this.image=void 0!==t?t:THREE.Texture.DEFAULT_IMAGE,this.mipmaps=[],this.mapping=void 0!==e?e:THREE.Texture.DEFAULT_MAPPING,this.wrapS=void 0!==i?i:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==r?r:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==n?n:THREE.LinearFilter,this.minFilter=void 0!==a?a:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==h?h:1,this.format=void 0!==o?o:THREE.RGBAFormat,this.type=void 0!==s?s:THREE.UnsignedByteType,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this._needsUpdate=!1,this.onUpdate=null},THREE.Texture.DEFAULT_IMAGE=void 0,THREE.Texture.DEFAULT_MAPPING=THREE.UVMapping,THREE.Texture.prototype={constructor:THREE.Texture,get needsUpdate(){return this._needsUpdate},set needsUpdate(t){!0===t&&this.update(),this._needsUpdate=t},clone:function(t){return void 0===t&&(t=new THREE.Texture),t.image=this.image,t.mipmaps=this.mipmaps.slice(0),t.mapping=this.mapping,t.wrapS=this.wrapS,t.wrapT=this.wrapT,t.magFilter=this.magFilter,t.minFilter=this.minFilter,t.anisotropy=this.anisotropy,t.format=this.format,t.type=this.type,t.offset.copy(this.offset),t.repeat.copy(this.repeat),t.generateMipmaps=this.generateMipmaps,t.premultiplyAlpha=this.premultiplyAlpha,t.flipY=this.flipY,t.unpackAlignment=this.unpackAlignment,t},update:function(){this.dispatchEvent({type:"update"})},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.Texture.prototype),THREE.TextureIdCount=0,THREE.CubeTexture=function(t,e,i,r,n,a,o,s,h){e=void 0!==e?e:THREE.CubeReflectionMapping,THREE.Texture.call(this,t,e,i,r,n,a,o,s,h),this.images=t},THREE.CubeTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CubeTexture.prototype.constructor=THREE.CubeTexture,THREE.CubeTexture.clone=function(t){return void 0===t&&(t=new THREE.CubeTexture),THREE.Texture.prototype.clone.call(this,t),t.images=this.images,t},THREE.CompressedTexture=function(t,e,i,r,n,a,o,s,h,l,c){THREE.Texture.call(this,null,a,o,s,h,l,r,n,c),this.image={width:e,height:i},this.mipmaps=t,this.generateMipmaps=this.flipY=!1},THREE.CompressedTexture.prototype=Object.create(THREE.Texture.prototype),THREE.CompressedTexture.prototype.constructor=THREE.CompressedTexture,THREE.CompressedTexture.prototype.clone=function(){var t=new THREE.CompressedTexture;return THREE.Texture.prototype.clone.call(this,t),t},THREE.DataTexture=function(t,e,i,r,n,a,o,s,h,l,c){THREE.Texture.call(this,null,a,o,s,h,l,r,n,c),this.image={data:t,width:e,height:i}},THREE.DataTexture.prototype=Object.create(THREE.Texture.prototype),THREE.DataTexture.prototype.constructor=THREE.DataTexture,THREE.DataTexture.prototype.clone=function(){var t=new THREE.DataTexture;return THREE.Texture.prototype.clone.call(this,t),t},THREE.VideoTexture=function(t,e,i,r,n,a,o,s,h){THREE.Texture.call(this,t,e,i,r,n,a,o,s,h),this.generateMipmaps=!1;var l=this,c=function(){requestAnimationFrame(c),t.readyState===t.HAVE_ENOUGH_DATA&&(l.needsUpdate=!0)};c()},THREE.VideoTexture.prototype=Object.create(THREE.Texture.prototype),THREE.VideoTexture.prototype.constructor=THREE.VideoTexture,THREE.Group=function(){THREE.Object3D.call(this),this.type="Group"},THREE.Group.prototype=Object.create(THREE.Object3D.prototype),THREE.Group.prototype.constructor=THREE.Group,THREE.PointCloud=function(t,e){THREE.Object3D.call(this),this.type="PointCloud",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.PointCloudMaterial({color:16777215*Math.random()})},THREE.PointCloud.prototype=Object.create(THREE.Object3D.prototype),THREE.PointCloud.prototype.constructor=THREE.PointCloud,THREE.PointCloud.prototype.raycast=function(){var m=new THREE.Matrix4,E=new THREE.Ray;return function(a,o){var s=this,t=s.geometry,e=a.params.PointCloud.threshold;if(m.getInverse(this.matrixWorld),E.copy(a.ray).applyMatrix4(m),null===t.boundingBox||!1!==E.isIntersectionBox(t.boundingBox)){var h=e/((this.scale.x+this.scale.y+this.scale.z)/3),i=new THREE.Vector3;e=function(t,e){var i=E.distanceToPoint(t);if(i<h){var r=E.closestPointToPoint(t);r.applyMatrix4(s.matrixWorld);var n=a.ray.origin.distanceTo(r);o.push({distance:n,distanceToRay:i,point:r.clone(),index:e,face:null,object:s})}};if(t instanceof THREE.BufferGeometry){var r=(n=t.attributes).position.array;if(void 0!==n.index){var n=n.index.array,l=t.offsets;0===l.length&&(l=[{start:0,count:n.length,index:0}]);for(var c=0,u=l.length;c<u;++c){var d=l[c].start,p=l[c].index;for(t=d,d=d+l[c].count;t<d;t++){var f=p+n[t];i.fromArray(r,3*f),e(i,f)}}}else for(n=r.length/3,t=0;t<n;t++)i.set(r[3*t],r[3*t+1],r[3*t+2]),e(i,t)}else for(i=this.geometry.vertices,t=0;t<i.length;t++)e(i[t],t)}}}(),THREE.PointCloud.prototype.clone=function(t){return void 0===t&&(t=new THREE.PointCloud(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,t),t},THREE.ParticleSystem=function(t,e){return THREE.warn("THREE.ParticleSystem has been renamed to THREE.PointCloud."),new THREE.PointCloud(t,e)},THREE.Line=function(t,e,i){THREE.Object3D.call(this),this.type="Line",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.LineBasicMaterial({color:16777215*Math.random()}),this.mode=void 0!==i?i:THREE.LineStrip},THREE.LineStrip=0,THREE.LinePieces=1,THREE.Line.prototype=Object.create(THREE.Object3D.prototype),THREE.Line.prototype.constructor=THREE.Line,THREE.Line.prototype.raycast=function(){var g=new THREE.Matrix4,v=new THREE.Ray,y=new THREE.Sphere;return function(t,e){var i=(i=t.linePrecision)*i;if(null===(m=this.geometry).boundingSphere&&m.computeBoundingSphere(),y.copy(m.boundingSphere),y.applyMatrix4(this.matrixWorld),!1!==t.ray.isIntersectionSphere(y)){g.getInverse(this.matrixWorld),v.copy(t.ray).applyMatrix4(g);var r=new THREE.Vector3,n=new THREE.Vector3,a=new THREE.Vector3,o=new THREE.Vector3,s=this.mode===THREE.LineStrip?1:2;if(m instanceof THREE.BufferGeometry)if(void 0!==(l=m.attributes).index){var h=l.index.array,l=l.position.array,c=m.offsets;0===c.length&&(c=[{start:0,count:h.length,index:0}]);for(var u=0;u<c.length;u++)for(var d=c[u].start,p=c[u].count,f=c[u].index,m=d;m<d+p-1;m+=s){var E=f+h[m+1];r.fromArray(l,3*(f+h[m])),n.fromArray(l,3*E),i<(E=v.distanceSqToSegment(r,n,o,a))||(E=v.origin.distanceTo(o))<t.near||E>t.far||e.push({distance:E,point:a.clone().applyMatrix4(this.matrixWorld),index:m,offsetIndex:u,face:null,faceIndex:null,object:this})}}else for(l=l.position.array,m=0;m<l.length/3-1;m+=s)r.fromArray(l,3*m),n.fromArray(l,3*m+3),(E=v.distanceSqToSegment(r,n,o,a))>i||(E=v.origin.distanceTo(o))<t.near||E>t.far||e.push({distance:E,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this});else if(m instanceof THREE.Geometry)for(n=(r=m.vertices).length,m=0;m<n-1;m+=s)(E=v.distanceSqToSegment(r[m],r[m+1],o,a))>i||(E=v.origin.distanceTo(o))<t.near||E>t.far||e.push({distance:E,point:a.clone().applyMatrix4(this.matrixWorld),index:m,face:null,faceIndex:null,object:this})}}}(),THREE.Line.prototype.clone=function(t){return void 0===t&&(t=new THREE.Line(this.geometry,this.material,this.mode)),THREE.Object3D.prototype.clone.call(this,t),t},THREE.Mesh=function(t,e){THREE.Object3D.call(this),this.type="Mesh",this.geometry=void 0!==t?t:new THREE.Geometry,this.material=void 0!==e?e:new THREE.MeshBasicMaterial({color:16777215*Math.random()}),this.updateMorphTargets()},THREE.Mesh.prototype=Object.create(THREE.Object3D.prototype),THREE.Mesh.prototype.constructor=THREE.Mesh,THREE.Mesh.prototype.updateMorphTargets=function(){if(void 0!==this.geometry.morphTargets&&0<this.geometry.morphTargets.length){this.morphTargetBase=-1,this.morphTargetForcedOrder=[],this.morphTargetInfluences=[],this.morphTargetDictionary={};for(var t=0,e=this.geometry.morphTargets.length;t<e;t++)this.morphTargetInfluences.push(0),this.morphTargetDictionary[this.geometry.morphTargets[t].name]=t}},THREE.Mesh.prototype.getMorphTargetIndexByName=function(t){return void 0!==this.morphTargetDictionary[t]?this.morphTargetDictionary[t]:(THREE.warn("THREE.Mesh.getMorphTargetIndexByName: morph target "+t+" does not exist. Returning 0."),0)},THREE.Mesh.prototype.raycast=function(){var T=new THREE.Matrix4,R=new THREE.Ray,_=new THREE.Sphere,x=new THREE.Vector3,b=new THREE.Vector3,w=new THREE.Vector3;return function(t,e){if(null===(p=this.geometry).boundingSphere&&p.computeBoundingSphere(),_.copy(p.boundingSphere),_.applyMatrix4(this.matrixWorld),!1!==t.ray.isIntersectionSphere(_)&&(T.getInverse(this.matrixWorld),R.copy(t.ray).applyMatrix4(T),null===p.boundingBox||!1!==R.isIntersectionBox(p.boundingBox)))if(p instanceof THREE.BufferGeometry){var i=this.material;if(void 0!==i){var r,n,a=p.attributes,o=t.precision;if(void 0!==a.index){var s=a.index.array,h=a.position.array,l=p.offsets;0===l.length&&(l=[{start:0,count:s.length,index:0}]);for(var c=0,u=l.length;c<u;++c){a=l[c].start;for(var d=l[c].index,p=a,f=a+l[c].count;p<f;p+=3){a=d+s[p],r=d+s[p+1],n=d+s[p+2],x.fromArray(h,3*a),b.fromArray(h,3*r),w.fromArray(h,3*n);var m=i.side===THREE.BackSide?R.intersectTriangle(w,b,x,!0):R.intersectTriangle(x,b,w,i.side!==THREE.DoubleSide);if(null!==m){m.applyMatrix4(this.matrixWorld);var E=t.ray.origin.distanceTo(m);E<o||E<t.near||E>t.far||e.push({distance:E,point:m,face:new THREE.Face3(a,r,n,THREE.Triangle.normal(x,b,w)),faceIndex:null,object:this})}}}}else for(s=p=0,f=(h=a.position.array).length;p<f;p+=3,s+=9)r=(a=p)+1,n=p+2,x.fromArray(h,s),b.fromArray(h,s+3),w.fromArray(h,s+6),null!==(m=i.side===THREE.BackSide?R.intersectTriangle(w,b,x,!0):R.intersectTriangle(x,b,w,i.side!==THREE.DoubleSide))&&(m.applyMatrix4(this.matrixWorld),(E=t.ray.origin.distanceTo(m))<o||E<t.near||E>t.far||e.push({distance:E,point:m,face:new THREE.Face3(a,r,n,THREE.Triangle.normal(x,b,w)),faceIndex:null,object:this}))}}else if(p instanceof THREE.Geometry)for(h=!0===(s=this.material instanceof THREE.MeshFaceMaterial)?this.material.materials:null,o=t.precision,l=p.vertices,c=0,u=p.faces.length;c<u;c++)if(d=p.faces[c],void 0!==(i=!0===s?h[d.materialIndex]:this.material)){if(a=l[d.a],r=l[d.b],n=l[d.c],!0===i.morphTargets){m=p.morphTargets,E=this.morphTargetInfluences,x.set(0,0,0),b.set(0,0,0),w.set(0,0,0);f=0;for(var g=m.length;f<g;f++){var v=E[f];if(0!==v){var y=m[f].vertices;x.x+=(y[d.a].x-a.x)*v,x.y+=(y[d.a].y-a.y)*v,x.z+=(y[d.a].z-a.z)*v,b.x+=(y[d.b].x-r.x)*v,b.y+=(y[d.b].y-r.y)*v,b.z+=(y[d.b].z-r.z)*v,w.x+=(y[d.c].x-n.x)*v,w.y+=(y[d.c].y-n.y)*v,w.z+=(y[d.c].z-n.z)*v}}x.add(a),b.add(r),w.add(n),a=x,r=b,n=w}null!==(m=i.side===THREE.BackSide?R.intersectTriangle(n,r,a,!0):R.intersectTriangle(a,r,n,i.side!==THREE.DoubleSide))&&(m.applyMatrix4(this.matrixWorld),(E=t.ray.origin.distanceTo(m))<o||E<t.near||E>t.far||e.push({distance:E,point:m,face:d,faceIndex:c,object:this}))}}}(),THREE.Mesh.prototype.clone=function(t,e){return void 0===t&&(t=new THREE.Mesh(this.geometry,this.material)),THREE.Object3D.prototype.clone.call(this,t,e),t},THREE.Bone=function(t){THREE.Object3D.call(this),this.type="Bone",this.skin=t},THREE.Bone.prototype=Object.create(THREE.Object3D.prototype),THREE.Bone.prototype.constructor=THREE.Bone,THREE.Skeleton=function(t,e,i){if(this.useVertexTexture=void 0===i||i,this.identityMatrix=new THREE.Matrix4,t=t||[],this.bones=t.slice(0),this.useVertexTexture?(this.boneTextureHeight=this.boneTextureWidth=t=256<this.bones.length?64:64<this.bones.length?32:16<this.bones.length?16:8,this.boneMatrices=new Float32Array(this.boneTextureWidth*this.boneTextureHeight*4),this.boneTexture=new THREE.DataTexture(this.boneMatrices,this.boneTextureWidth,this.boneTextureHeight,THREE.RGBAFormat,THREE.FloatType),this.boneTexture.minFilter=THREE.NearestFilter,this.boneTexture.magFilter=THREE.NearestFilter,this.boneTexture.generateMipmaps=!1,this.boneTexture.flipY=!1):this.boneMatrices=new Float32Array(16*this.bones.length),void 0===e)this.calculateInverses();else if(this.bones.length===e.length)this.boneInverses=e.slice(0);else for(THREE.warn("THREE.Skeleton bonInverses is the wrong length."),this.boneInverses=[],e=0,t=this.bones.length;e<t;e++)this.boneInverses.push(new THREE.Matrix4)},THREE.Skeleton.prototype.calculateInverses=function(){this.boneInverses=[];for(var t=0,e=this.bones.length;t<e;t++){var i=new THREE.Matrix4;this.bones[t]&&i.getInverse(this.bones[t].matrixWorld),this.boneInverses.push(i)}},THREE.Skeleton.prototype.pose=function(){for(var t,e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&t.matrixWorld.getInverse(this.boneInverses[e]);for(e=0,i=this.bones.length;e<i;e++)(t=this.bones[e])&&(t.parent?(t.matrix.getInverse(t.parent.matrixWorld),t.matrix.multiply(t.matrixWorld)):t.matrix.copy(t.matrixWorld),t.matrix.decompose(t.position,t.quaternion,t.scale))},THREE.Skeleton.prototype.update=function(){var i=new THREE.Matrix4;return function(){for(var t=0,e=this.bones.length;t<e;t++)i.multiplyMatrices(this.bones[t]?this.bones[t].matrixWorld:this.identityMatrix,this.boneInverses[t]),i.flattenToArrayOffset(this.boneMatrices,16*t);this.useVertexTexture&&(this.boneTexture.needsUpdate=!0)}}(),THREE.SkinnedMesh=function(t,e,i){if(THREE.Mesh.call(this,t,e),this.type="SkinnedMesh",this.bindMode="attached",this.bindMatrix=new THREE.Matrix4,this.bindMatrixInverse=new THREE.Matrix4,t=[],this.geometry&&void 0!==this.geometry.bones){for(var r,n,a,o,s=0,h=this.geometry.bones.length;s<h;++s)n=(r=this.geometry.bones[s]).pos,a=r.rotq,o=r.scl,e=new THREE.Bone(this),t.push(e),e.name=r.name,e.position.set(n[0],n[1],n[2]),e.quaternion.set(a[0],a[1],a[2],a[3]),void 0!==o?e.scale.set(o[0],o[1],o[2]):e.scale.set(1,1,1);for(s=0,h=this.geometry.bones.length;s<h;++s)-1!==(r=this.geometry.bones[s]).parent?t[r.parent].add(t[s]):this.add(t[s])}this.normalizeSkinWeights(),this.updateMatrixWorld(!0),this.bind(new THREE.Skeleton(t,void 0,i))},THREE.SkinnedMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.SkinnedMesh.prototype.constructor=THREE.SkinnedMesh,THREE.SkinnedMesh.prototype.bind=function(t,e){this.skeleton=t,void 0===e&&(this.updateMatrixWorld(!0),e=this.matrixWorld),this.bindMatrix.copy(e),this.bindMatrixInverse.getInverse(e)},THREE.SkinnedMesh.prototype.pose=function(){this.skeleton.pose()},THREE.SkinnedMesh.prototype.normalizeSkinWeights=function(){if(this.geometry instanceof THREE.Geometry)for(var t=0;t<this.geometry.skinIndices.length;t++){var e=this.geometry.skinWeights[t],i=1/e.lengthManhattan();1/0!==i?e.multiplyScalar(i):e.set(1)}},THREE.SkinnedMesh.prototype.updateMatrixWorld=function(t){THREE.Mesh.prototype.updateMatrixWorld.call(this,!0),"attached"===this.bindMode?this.bindMatrixInverse.getInverse(this.matrixWorld):"detached"===this.bindMode?this.bindMatrixInverse.getInverse(this.bindMatrix):THREE.warn("THREE.SkinnedMesh unreckognized bindMode: "+this.bindMode)},THREE.SkinnedMesh.prototype.clone=function(t){return void 0===t&&(t=new THREE.SkinnedMesh(this.geometry,this.material,this.useVertexTexture)),THREE.Mesh.prototype.clone.call(this,t),t},THREE.MorphAnimMesh=function(t,e){THREE.Mesh.call(this,t,e),this.type="MorphAnimMesh",this.duration=1e3,this.mirroredLoop=!1,this.currentKeyframe=this.lastKeyframe=this.time=0,this.direction=1,this.directionBackwards=!1,this.setFrameRange(0,this.geometry.morphTargets.length-1)},THREE.MorphAnimMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphAnimMesh.prototype.constructor=THREE.MorphAnimMesh,THREE.MorphAnimMesh.prototype.setFrameRange=function(t,e){this.startKeyframe=t,this.endKeyframe=e,this.length=this.endKeyframe-this.startKeyframe+1},THREE.MorphAnimMesh.prototype.setDirectionForward=function(){this.direction=1,this.directionBackwards=!1},THREE.MorphAnimMesh.prototype.setDirectionBackward=function(){this.direction=-1,this.directionBackwards=!0},THREE.MorphAnimMesh.prototype.parseAnimations=function(){var t=this.geometry;t.animations||(t.animations={});for(var e,i=t.animations,r=/([a-z]+)_?(\d+)/,n=0,a=t.morphTargets.length;n<a;n++){var o=t.morphTargets[n].name.match(r);if(o&&1<o.length){i[o=o[1]]||(i[o]={start:1/0,end:-1/0});var s=i[o];n<s.start&&(s.start=n),n>s.end&&(s.end=n),e||(e=o)}}t.firstAnimation=e},THREE.MorphAnimMesh.prototype.setAnimationLabel=function(t,e,i){this.geometry.animations||(this.geometry.animations={}),this.geometry.animations[t]={start:e,end:i}},THREE.MorphAnimMesh.prototype.playAnimation=function(t,e){var i=this.geometry.animations[t];i?(this.setFrameRange(i.start,i.end),this.duration=(i.end-i.start)/e*1e3,this.time=0):THREE.warn("THREE.MorphAnimMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphAnimMesh.prototype.updateAnimation=function(t){var e=this.duration/this.length;this.time+=this.direction*t,this.mirroredLoop?(this.time>this.duration||this.time<0)&&(this.direction*=-1,this.time>this.duration&&(this.time=this.duration,this.directionBackwards=!0),this.time<0&&(this.time=0,this.directionBackwards=!1)):(this.time%=this.duration,this.time<0&&(this.time+=this.duration)),(t=this.startKeyframe+THREE.Math.clamp(Math.floor(this.time/e),0,this.length-1))!==this.currentKeyframe&&(this.morphTargetInfluences[this.lastKeyframe]=0,this.morphTargetInfluences[this.currentKeyframe]=1,this.morphTargetInfluences[t]=0,this.lastKeyframe=this.currentKeyframe,this.currentKeyframe=t),e=this.time%e/e,this.directionBackwards&&(e=1-e),this.morphTargetInfluences[this.currentKeyframe]=e,this.morphTargetInfluences[this.lastKeyframe]=1-e},THREE.MorphAnimMesh.prototype.interpolateTargets=function(t,e,i){for(var r=this.morphTargetInfluences,n=0,a=r.length;n<a;n++)r[n]=0;-1<t&&(r[t]=1-i),-1<e&&(r[e]=i)},THREE.MorphAnimMesh.prototype.clone=function(t){return void 0===t&&(t=new THREE.MorphAnimMesh(this.geometry,this.material)),t.duration=this.duration,t.mirroredLoop=this.mirroredLoop,t.time=this.time,t.lastKeyframe=this.lastKeyframe,t.currentKeyframe=this.currentKeyframe,t.direction=this.direction,t.directionBackwards=this.directionBackwards,THREE.Mesh.prototype.clone.call(this,t),t},THREE.LOD=function(){THREE.Object3D.call(this),this.objects=[]},THREE.LOD.prototype=Object.create(THREE.Object3D.prototype),THREE.LOD.prototype.constructor=THREE.LOD,THREE.LOD.prototype.addLevel=function(t,e){void 0===e&&(e=0),e=Math.abs(e);for(var i=0;i<this.objects.length&&!(e<this.objects[i].distance);i++);this.objects.splice(i,0,{distance:e,object:t}),this.add(t)},THREE.LOD.prototype.getObjectForDistance=function(t){for(var e=1,i=this.objects.length;e<i&&!(t<this.objects[e].distance);e++);return this.objects[e-1].object},THREE.LOD.prototype.raycast=function(){var r=new THREE.Vector3;return function(t,e){r.setFromMatrixPosition(this.matrixWorld);var i=t.ray.origin.distanceTo(r);this.getObjectForDistance(i).raycast(t,e)}}(),THREE.LOD.prototype.update=function(){var r=new THREE.Vector3,n=new THREE.Vector3;return function(t){if(1<this.objects.length){r.setFromMatrixPosition(t.matrixWorld),n.setFromMatrixPosition(this.matrixWorld),t=r.distanceTo(n),this.objects[0].object.visible=!0;for(var e=1,i=this.objects.length;e<i&&t>=this.objects[e].distance;e++)this.objects[e-1].object.visible=!1,this.objects[e].object.visible=!0;for(;e<i;e++)this.objects[e].object.visible=!1}}}(),THREE.LOD.prototype.clone=function(t){void 0===t&&(t=new THREE.LOD),THREE.Object3D.prototype.clone.call(this,t);for(var e=0,i=this.objects.length;e<i;e++){var r=this.objects[e].object.clone();r.visible=0===e,t.addLevel(r,this.objects[e].distance)}return t},THREE.Sprite=function(){var t=new Uint16Array([0,1,2,0,2,3]),e=new Float32Array([-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0]),i=new Float32Array([0,0,1,0,1,1,0,1]),r=new THREE.BufferGeometry;return r.addAttribute("index",new THREE.BufferAttribute(t,1)),r.addAttribute("position",new THREE.BufferAttribute(e,3)),r.addAttribute("uv",new THREE.BufferAttribute(i,2)),function(t){THREE.Object3D.call(this),this.type="Sprite",this.geometry=r,this.material=void 0!==t?t:new THREE.SpriteMaterial}}(),THREE.Sprite.prototype=Object.create(THREE.Object3D.prototype),THREE.Sprite.prototype.constructor=THREE.Sprite,THREE.Sprite.prototype.raycast=function(){var r=new THREE.Vector3;return function(t,e){r.setFromMatrixPosition(this.matrixWorld);var i=t.ray.distanceToPoint(r);i>this.scale.x||e.push({distance:i,point:this.position,face:null,object:this})}}(),THREE.Sprite.prototype.clone=function(t){return void 0===t&&(t=new THREE.Sprite(this.material)),THREE.Object3D.prototype.clone.call(this,t),t},THREE.Particle=THREE.Sprite,THREE.LensFlare=function(t,e,i,r,n){THREE.Object3D.call(this),this.lensFlares=[],this.positionScreen=new THREE.Vector3,(this.customUpdateCallback=void 0)!==t&&this.add(t,e,i,r,n)},THREE.LensFlare.prototype=Object.create(THREE.Object3D.prototype),THREE.LensFlare.prototype.constructor=THREE.LensFlare,THREE.LensFlare.prototype.add=function(t,e,i,r,n,a){void 0===e&&(e=-1),void 0===i&&(i=0),void 0===a&&(a=1),void 0===n&&(n=new THREE.Color(16777215)),void 0===r&&(r=THREE.NormalBlending),i=Math.min(i,Math.max(0,i)),this.lensFlares.push({texture:t,size:e,distance:i,x:0,y:0,z:0,scale:1,rotation:1,opacity:a,color:n,blending:r})},THREE.LensFlare.prototype.updateLensFlares=function(){var t,e,i=this.lensFlares.length,r=2*-this.positionScreen.x,n=2*-this.positionScreen.y;for(t=0;t<i;t++)(e=this.lensFlares[t]).x=this.positionScreen.x+r*e.distance,e.y=this.positionScreen.y+n*e.distance,e.wantedRotation=e.x*Math.PI*.25,e.rotation+=.25*(e.wantedRotation-e.rotation)},THREE.Scene=function(){THREE.Object3D.call(this),this.type="Scene",this.overrideMaterial=this.fog=null,this.autoUpdate=!0},THREE.Scene.prototype=Object.create(THREE.Object3D.prototype),THREE.Scene.prototype.constructor=THREE.Scene,THREE.Scene.prototype.clone=function(t){return void 0===t&&(t=new THREE.Scene),THREE.Object3D.prototype.clone.call(this,t),null!==this.fog&&(t.fog=this.fog.clone()),null!==this.overrideMaterial&&(t.overrideMaterial=this.overrideMaterial.clone()),t.autoUpdate=this.autoUpdate,t.matrixAutoUpdate=this.matrixAutoUpdate,t},THREE.Fog=function(t,e,i){this.name="",this.color=new THREE.Color(t),this.near=void 0!==e?e:1,this.far=void 0!==i?i:1e3},THREE.Fog.prototype.clone=function(){return new THREE.Fog(this.color.getHex(),this.near,this.far)},THREE.FogExp2=function(t,e){this.name="",this.color=new THREE.Color(t),this.density=void 0!==e?e:25e-5},THREE.FogExp2.prototype.clone=function(){return new THREE.FogExp2(this.color.getHex(),this.density)},THREE.ShaderChunk={},THREE.ShaderChunk.common="#define PI 3.14159\n#define PI2 6.28318\n#define RECIPROCAL_PI2 0.15915494\n#define LOG2 1.442695\n#define EPSILON 1e-6\n\nfloat square( in float a ) { return a*a; }\nvec2  square( in vec2 a )  { return vec2( a.x*a.x, a.y*a.y ); }\nvec3  square( in vec3 a )  { return vec3( a.x*a.x, a.y*a.y, a.z*a.z ); }\nvec4  square( in vec4 a )  { return vec4( a.x*a.x, a.y*a.y, a.z*a.z, a.w*a.w ); }\nfloat saturate( in float a ) { return clamp( a, 0.0, 1.0 ); }\nvec2  saturate( in vec2 a )  { return clamp( a, 0.0, 1.0 ); }\nvec3  saturate( in vec3 a )  { return clamp( a, 0.0, 1.0 ); }\nvec4  saturate( in vec4 a )  { return clamp( a, 0.0, 1.0 ); }\nfloat average( in float a ) { return a; }\nfloat average( in vec2 a )  { return ( a.x + a.y) * 0.5; }\nfloat average( in vec3 a )  { return ( a.x + a.y + a.z) / 3.0; }\nfloat average( in vec4 a )  { return ( a.x + a.y + a.z + a.w) * 0.25; }\nfloat whiteCompliment( in float a ) { return saturate( 1.0 - a ); }\nvec2  whiteCompliment( in vec2 a )  { return saturate( vec2(1.0) - a ); }\nvec3  whiteCompliment( in vec3 a )  { return saturate( vec3(1.0) - a ); }\nvec4  whiteCompliment( in vec4 a )  { return saturate( vec4(1.0) - a ); }\nvec3 transformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( normal, 0.0 ) ).xyz );\n}\n// http://en.wikibooks.org/wiki/GLSL_Programming/Applying_Matrix_Transformations\nvec3 inverseTransformDirection( in vec3 normal, in mat4 matrix ) {\n\treturn normalize( ( vec4( normal, 0.0 ) * matrix ).xyz );\n}\nvec3 projectOnPlane(in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal) {\n\tfloat distance = dot( planeNormal, point-pointOnPlane );\n\treturn point - distance * planeNormal;\n}\nfloat sideOfPlane( in vec3 point, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn sign( dot( point - pointOnPlane, planeNormal ) );\n}\nvec3 linePlaneIntersect( in vec3 pointOnLine, in vec3 lineDirection, in vec3 pointOnPlane, in vec3 planeNormal ) {\n\treturn pointOnLine + lineDirection * ( dot( planeNormal, pointOnPlane - pointOnLine ) / dot( planeNormal, lineDirection ) );\n}\nfloat calcLightAttenuation( float lightDistance, float cutoffDistance, float decayExponent ) {\n\tif ( decayExponent > 0.0 ) {\n\t  return pow( saturate( 1.0 - lightDistance / cutoffDistance ), decayExponent );\n\t}\n\treturn 1.0;\n}\n\nvec3 inputToLinear( in vec3 a ) {\n#ifdef GAMMA_INPUT\n\treturn pow( a, vec3( float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\nvec3 linearToOutput( in vec3 a ) {\n#ifdef GAMMA_OUTPUT\n\treturn pow( a, vec3( 1.0 / float( GAMMA_FACTOR ) ) );\n#else\n\treturn a;\n#endif\n}\n",THREE.ShaderChunk.alphatest_fragment="#ifdef ALPHATEST\n\n\tif ( diffuseColor.a < ALPHATEST ) discard;\n\n#endif\n",THREE.ShaderChunk.lights_lambert_vertex="vLightFront = vec3( 0.0 );\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack = vec3( 0.0 );\n\n#endif\n\ntransformedNormal = normalize( transformedNormal );\n\n#if MAX_DIR_LIGHTS > 0\n\nfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\tfloat dotProduct = dot( transformedNormal, dirVector );\n\tvec3 directionalLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvec3 directionalLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 directionalLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t#endif\n\n\t#endif\n\n\t#ifdef WRAP_AROUND\n\n\t\tvec3 directionalLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\tdirectionalLightWeighting = mix( directionalLightWeighting, directionalLightWeightingHalf, wrapRGB );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tdirectionalLightWeightingBack = mix( directionalLightWeightingBack, directionalLightWeightingHalfBack, wrapRGB );\n\n\t\t#endif\n\n\t#endif\n\n\tvLightFront += directionalLightColor[ i ] * directionalLightWeighting;\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tvLightBack += directionalLightColor[ i ] * directionalLightWeightingBack;\n\n\t#endif\n\n}\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tvec3 pointLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvec3 pointLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 pointLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tvec3 pointLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\tpointLightWeighting = mix( pointLightWeighting, pointLightWeightingHalf, wrapRGB );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tpointLightWeightingBack = mix( pointLightWeightingBack, pointLightWeightingHalfBack, wrapRGB );\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t\tvLightFront += pointLightColor[ i ] * pointLightWeighting * attenuation;\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += pointLightColor[ i ] * pointLightWeightingBack * attenuation;\n\n\t\t#endif\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz - mvPosition.xyz;\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - worldPosition.xyz ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\t\tlVector = normalize( lVector );\n\n\t\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\t\t\tvec3 spotLightWeighting = vec3( max( dotProduct, 0.0 ) );\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvec3 spotLightWeightingBack = vec3( max( -dotProduct, 0.0 ) );\n\n\t\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\t\tvec3 spotLightWeightingHalfBack = vec3( max( -0.5 * dotProduct + 0.5, 0.0 ) );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tvec3 spotLightWeightingHalf = vec3( max( 0.5 * dotProduct + 0.5, 0.0 ) );\n\t\t\t\tspotLightWeighting = mix( spotLightWeighting, spotLightWeightingHalf, wrapRGB );\n\n\t\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\t\tspotLightWeightingBack = mix( spotLightWeightingBack, spotLightWeightingHalfBack, wrapRGB );\n\n\t\t\t\t#endif\n\n\t\t\t#endif\n\n\t\t\tvLightFront += spotLightColor[ i ] * spotLightWeighting * attenuation * spotEffect;\n\n\t\t\t#ifdef DOUBLE_SIDED\n\n\t\t\t\tvLightBack += spotLightColor[ i ] * spotLightWeightingBack * attenuation * spotEffect;\n\n\t\t\t#endif\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\tfloat dotProduct = dot( transformedNormal, lVector );\n\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\t\tfloat hemiDiffuseWeightBack = -0.5 * dotProduct + 0.5;\n\n\t\tvLightFront += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\t#ifdef DOUBLE_SIDED\n\n\t\t\tvLightBack += mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeightBack );\n\n\t\t#endif\n\n\t}\n\n#endif\n\nvLightFront += ambientLightColor;\n\n#ifdef DOUBLE_SIDED\n\n\tvLightBack += ambientLightColor;\n\n#endif\n",THREE.ShaderChunk.map_particle_pars_fragment="#ifdef USE_MAP\n\n\tuniform vec4 offsetRepeat;\n\tuniform sampler2D map;\n\n#endif\n",THREE.ShaderChunk.default_vertex="#ifdef USE_SKINNING\n\n\tvec4 mvPosition = modelViewMatrix * skinned;\n\n#elif defined( USE_MORPHTARGETS )\n\n\tvec4 mvPosition = modelViewMatrix * vec4( morphed, 1.0 );\n\n#else\n\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\n#endif\n\ngl_Position = projectionMatrix * mvPosition;\n",THREE.ShaderChunk.map_pars_fragment="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\n#endif\n\n#ifdef USE_MAP\n\n\tuniform sampler2D map;\n\n#endif",THREE.ShaderChunk.skinnormal_vertex="#ifdef USE_SKINNING\n\n\tmat4 skinMatrix = mat4( 0.0 );\n\tskinMatrix += skinWeight.x * boneMatX;\n\tskinMatrix += skinWeight.y * boneMatY;\n\tskinMatrix += skinWeight.z * boneMatZ;\n\tskinMatrix += skinWeight.w * boneMatW;\n\tskinMatrix  = bindMatrixInverse * skinMatrix * bindMatrix;\n\n\t#ifdef USE_MORPHNORMALS\n\n\tvec4 skinnedNormal = skinMatrix * vec4( morphedNormal, 0.0 );\n\n\t#else\n\n\tvec4 skinnedNormal = skinMatrix * vec4( normal, 0.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_vertex="#ifdef USE_LOGDEPTHBUF\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n\tuniform float logDepthBufFC;\n\n#endif",THREE.ShaderChunk.lightmap_pars_vertex="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\n#endif",THREE.ShaderChunk.lights_phong_fragment="#ifndef FLAT_SHADED\n\n\tvec3 normal = normalize( vNormal );\n\n\t#ifdef DOUBLE_SIDED\n\n\t\tnormal = normal * ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\n\t#endif\n\n#else\n\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n\n#endif\n\nvec3 viewPosition = normalize( vViewPosition );\n\n#ifdef USE_NORMALMAP\n\n\tnormal = perturbNormal2Arb( -vViewPosition, normal );\n\n#elif defined( USE_BUMPMAP )\n\n\tnormal = perturbNormalArb( -vViewPosition, normal, dHdxy_fwd() );\n\n#endif\n\nvec3 totalDiffuseLight = vec3( 0.0 );\nvec3 totalSpecularLight = vec3( 0.0 );\n\n#if MAX_POINT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( pointLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), pointLightDistance[ i ], pointLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat pointDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat pointDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 pointDiffuseWeight = mix( vec3( pointDiffuseWeightFull ), vec3( pointDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat pointDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += pointLightColor[ i ] * pointDiffuseWeight * attenuation;\n\n\t\t\t\t// specular\n\n\t\tvec3 pointHalfVector = normalize( lVector + viewPosition );\n\t\tfloat pointDotNormalHalf = max( dot( normal, pointHalfVector ), 0.0 );\n\t\tfloat pointSpecularWeight = specularStrength * max( pow( pointDotNormalHalf, shininess ), 0.0 );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, pointHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * pointLightColor[ i ] * pointSpecularWeight * pointDiffuseWeight * attenuation * specularNormalization;\n\n\t}\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tfor ( int i = 0; i < MAX_SPOT_LIGHTS; i ++ ) {\n\n\t\tvec4 lPosition = viewMatrix * vec4( spotLightPosition[ i ], 1.0 );\n\t\tvec3 lVector = lPosition.xyz + vViewPosition.xyz;\n\n\t\tfloat attenuation = calcLightAttenuation( length( lVector ), spotLightDistance[ i ], spotLightDecay[ i ] );\n\n\t\tlVector = normalize( lVector );\n\n\t\tfloat spotEffect = dot( spotLightDirection[ i ], normalize( spotLightPosition[ i ] - vWorldPosition ) );\n\n\t\tif ( spotEffect > spotLightAngleCos[ i ] ) {\n\n\t\t\tspotEffect = max( pow( max( spotEffect, 0.0 ), spotLightExponent[ i ] ), 0.0 );\n\n\t\t\t// diffuse\n\n\t\t\tfloat dotProduct = dot( normal, lVector );\n\n\t\t\t#ifdef WRAP_AROUND\n\n\t\t\t\tfloat spotDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\t\tfloat spotDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\t\tvec3 spotDiffuseWeight = mix( vec3( spotDiffuseWeightFull ), vec3( spotDiffuseWeightHalf ), wrapRGB );\n\n\t\t\t#else\n\n\t\t\t\tfloat spotDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t\t#endif\n\n\t\t\ttotalDiffuseLight += spotLightColor[ i ] * spotDiffuseWeight * attenuation * spotEffect;\n\n\t\t\t// specular\n\n\t\t\tvec3 spotHalfVector = normalize( lVector + viewPosition );\n\t\t\tfloat spotDotNormalHalf = max( dot( normal, spotHalfVector ), 0.0 );\n\t\t\tfloat spotSpecularWeight = specularStrength * max( pow( spotDotNormalHalf, shininess ), 0.0 );\n\n\t\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, spotHalfVector ), 0.0 ), 5.0 );\n\t\t\ttotalSpecularLight += schlick * spotLightColor[ i ] * spotSpecularWeight * spotDiffuseWeight * attenuation * specularNormalization * spotEffect;\n\n\t\t}\n\n\t}\n\n#endif\n\n#if MAX_DIR_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_DIR_LIGHTS; i ++ ) {\n\n\t\tvec3 dirVector = transformDirection( directionalLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, dirVector );\n\n\t\t#ifdef WRAP_AROUND\n\n\t\t\tfloat dirDiffuseWeightFull = max( dotProduct, 0.0 );\n\t\t\tfloat dirDiffuseWeightHalf = max( 0.5 * dotProduct + 0.5, 0.0 );\n\n\t\t\tvec3 dirDiffuseWeight = mix( vec3( dirDiffuseWeightFull ), vec3( dirDiffuseWeightHalf ), wrapRGB );\n\n\t\t#else\n\n\t\t\tfloat dirDiffuseWeight = max( dotProduct, 0.0 );\n\n\t\t#endif\n\n\t\ttotalDiffuseLight += directionalLightColor[ i ] * dirDiffuseWeight;\n\n\t\t// specular\n\n\t\tvec3 dirHalfVector = normalize( dirVector + viewPosition );\n\t\tfloat dirDotNormalHalf = max( dot( normal, dirHalfVector ), 0.0 );\n\t\tfloat dirSpecularWeight = specularStrength * max( pow( dirDotNormalHalf, shininess ), 0.0 );\n\n\t\t/*\n\t\t// fresnel term from skin shader\n\t\tconst float F0 = 0.128;\n\n\t\tfloat base = 1.0 - dot( viewPosition, dirHalfVector );\n\t\tfloat exponential = pow( base, 5.0 );\n\n\t\tfloat fresnel = exponential + F0 * ( 1.0 - exponential );\n\t\t*/\n\n\t\t/*\n\t\t// fresnel term from fresnel shader\n\t\tconst float mFresnelBias = 0.08;\n\t\tconst float mFresnelScale = 0.3;\n\t\tconst float mFresnelPower = 5.0;\n\n\t\tfloat fresnel = mFresnelBias + mFresnelScale * pow( 1.0 + dot( normalize( -viewPosition ), normal ), mFresnelPower );\n\t\t*/\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\t// \t\tdirSpecular += specular * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization * fresnel;\n\n\t\tvec3 schlick = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( dirVector, dirHalfVector ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += schlick * directionalLightColor[ i ] * dirSpecularWeight * dirDiffuseWeight * specularNormalization;\n\n\n\t}\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tfor( int i = 0; i < MAX_HEMI_LIGHTS; i ++ ) {\n\n\t\tvec3 lVector = transformDirection( hemisphereLightDirection[ i ], viewMatrix );\n\n\t\t// diffuse\n\n\t\tfloat dotProduct = dot( normal, lVector );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotProduct + 0.5;\n\n\t\tvec3 hemiColor = mix( hemisphereLightGroundColor[ i ], hemisphereLightSkyColor[ i ], hemiDiffuseWeight );\n\n\t\ttotalDiffuseLight += hemiColor;\n\n\t\t// specular (sky light)\n\n\t\tvec3 hemiHalfVectorSky = normalize( lVector + viewPosition );\n\t\tfloat hemiDotNormalHalfSky = 0.5 * dot( normal, hemiHalfVectorSky ) + 0.5;\n\t\tfloat hemiSpecularWeightSky = specularStrength * max( pow( max( hemiDotNormalHalfSky, 0.0 ), shininess ), 0.0 );\n\n\t\t// specular (ground light)\n\n\t\tvec3 lVectorGround = -lVector;\n\n\t\tvec3 hemiHalfVectorGround = normalize( lVectorGround + viewPosition );\n\t\tfloat hemiDotNormalHalfGround = 0.5 * dot( normal, hemiHalfVectorGround ) + 0.5;\n\t\tfloat hemiSpecularWeightGround = specularStrength * max( pow( max( hemiDotNormalHalfGround, 0.0 ), shininess ), 0.0 );\n\n\t\tfloat dotProductGround = dot( normal, lVectorGround );\n\n\t\tfloat specularNormalization = ( shininess + 2.0 ) / 8.0;\n\n\t\tvec3 schlickSky = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVector, hemiHalfVectorSky ), 0.0 ), 5.0 );\n\t\tvec3 schlickGround = specular + vec3( 1.0 - specular ) * pow( max( 1.0 - dot( lVectorGround, hemiHalfVectorGround ), 0.0 ), 5.0 );\n\t\ttotalSpecularLight += hemiColor * specularNormalization * ( schlickSky * hemiSpecularWeightSky * max( dotProduct, 0.0 ) + schlickGround * hemiSpecularWeightGround * max( dotProductGround, 0.0 ) );\n\n\t}\n\n#endif\n\n#ifdef METAL\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) * specular + totalSpecularLight + emissive;\n\n#else\n\n\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + ambientLightColor ) + totalSpecularLight + emissive;\n\n#endif\n",THREE.ShaderChunk.fog_pars_fragment="#ifdef USE_FOG\n\n\tuniform vec3 fogColor;\n\n\t#ifdef FOG_EXP2\n\n\t\tuniform float fogDensity;\n\n\t#else\n\n\t\tuniform float fogNear;\n\t\tuniform float fogFar;\n\t#endif\n\n#endif",THREE.ShaderChunk.morphnormal_vertex="#ifdef USE_MORPHNORMALS\n\n\tvec3 morphedNormal = vec3( 0.0 );\n\n\tmorphedNormal += ( morphNormal0 - normal ) * morphTargetInfluences[ 0 ];\n\tmorphedNormal += ( morphNormal1 - normal ) * morphTargetInfluences[ 1 ];\n\tmorphedNormal += ( morphNormal2 - normal ) * morphTargetInfluences[ 2 ];\n\tmorphedNormal += ( morphNormal3 - normal ) * morphTargetInfluences[ 3 ];\n\n\tmorphedNormal += normal;\n\n#endif",THREE.ShaderChunk.envmap_pars_fragment="#ifdef USE_ENVMAP\n\n\tuniform float reflectivity;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\tuniform float flipEnvMap;\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tuniform float refractionRatio;\n\n\t#else\n\n\t\tvarying vec3 vReflect;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_fragment="#if defined(USE_LOGDEPTHBUF) && defined(USE_LOGDEPTHBUF_EXT)\n\n\tgl_FragDepthEXT = log2(vFragDepth) * logDepthBufFC * 0.5;\n\n#endif",THREE.ShaderChunk.normalmap_pars_fragment="#ifdef USE_NORMALMAP\n\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n\n\t// Per-Pixel Tangent Space Normal Mapping\n\t// http://hacksoflife.blogspot.ch/2009/11/per-pixel-tangent-space-normal-mapping.html\n\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm ) {\n\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\n\t\tvec3 S = normalize( q0 * st1.t - q1 * st0.t );\n\t\tvec3 T = normalize( -q0 * st1.s + q1 * st0.s );\n\t\tvec3 N = normalize( surf_norm );\n\n\t\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t\tmapN.xy = normalScale * mapN.xy;\n\t\tmat3 tsn = mat3( S, T, N );\n\t\treturn normalize( tsn * mapN );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.lights_phong_pars_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n",THREE.ShaderChunk.lightmap_pars_fragment="#ifdef USE_LIGHTMAP\n\n\tvarying vec2 vUv2;\n\tuniform sampler2D lightMap;\n\n#endif",THREE.ShaderChunk.shadowmap_vertex="#ifdef USE_SHADOWMAP\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvShadowCoord[ i ] = shadowMatrix[ i ] * worldPosition;\n\n\t}\n\n#endif",THREE.ShaderChunk.lights_phong_vertex="#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvWorldPosition = worldPosition.xyz;\n\n#endif",THREE.ShaderChunk.map_fragment="#ifdef USE_MAP\n\n\tvec4 texelColor = texture2D( map, vUv );\n\n\ttexelColor.xyz = inputToLinear( texelColor.xyz );\n\n\tdiffuseColor *= texelColor;\n\n#endif",THREE.ShaderChunk.lightmap_vertex="#ifdef USE_LIGHTMAP\n\n\tvUv2 = uv2;\n\n#endif",THREE.ShaderChunk.map_particle_fragment="#ifdef USE_MAP\n\n\tdiffuseColor *= texture2D( map, vec2( gl_PointCoord.x, 1.0 - gl_PointCoord.y ) * offsetRepeat.zw + offsetRepeat.xy );\n\n#endif\n",THREE.ShaderChunk.color_pars_fragment="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif\n",THREE.ShaderChunk.color_vertex="#ifdef USE_COLOR\n\n\tvColor.xyz = inputToLinear( color.xyz );\n\n#endif",THREE.ShaderChunk.skinning_vertex="#ifdef USE_SKINNING\n\n\t#ifdef USE_MORPHTARGETS\n\n\tvec4 skinVertex = bindMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\tvec4 skinVertex = bindMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n\tvec4 skinned = vec4( 0.0 );\n\tskinned += boneMatX * skinVertex * skinWeight.x;\n\tskinned += boneMatY * skinVertex * skinWeight.y;\n\tskinned += boneMatZ * skinVertex * skinWeight.z;\n\tskinned += boneMatW * skinVertex * skinWeight.w;\n\tskinned  = bindMatrixInverse * skinned;\n\n#endif\n",THREE.ShaderChunk.envmap_pars_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvarying vec3 vReflect;\n\n\tuniform float refractionRatio;\n\n#endif\n",THREE.ShaderChunk.linear_to_gamma_fragment="\n\toutgoingLight = linearToOutput( outgoingLight );\n",THREE.ShaderChunk.color_pars_vertex="#ifdef USE_COLOR\n\n\tvarying vec3 vColor;\n\n#endif",THREE.ShaderChunk.lights_lambert_pars_vertex="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n",THREE.ShaderChunk.map_pars_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvarying vec2 vUv;\n\tuniform vec4 offsetRepeat;\n\n#endif\n",THREE.ShaderChunk.envmap_fragment="#ifdef USE_ENVMAP\n\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG )\n\n\t\tvec3 cameraToVertex = normalize( vWorldPosition - cameraPosition );\n\n\t\t// Transforming Normal Vectors with the Inverse Transformation\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\t\tvec3 reflectVec = reflect( cameraToVertex, worldNormal );\n\n\t\t#else\n\n\t\t\tvec3 reflectVec = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t\t#endif\n\n\t#else\n\n\t\tvec3 reflectVec = vReflect;\n\n\t#endif\n\n\t#ifdef DOUBLE_SIDED\n\t\tfloat flipNormal = ( -1.0 + 2.0 * float( gl_FrontFacing ) );\n\t#else\n\t\tfloat flipNormal = 1.0;\n\t#endif\n\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, flipNormal * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\n\t#elif defined( ENVMAP_TYPE_EQUIREC )\n\t\tvec2 sampleUV;\n\t\tsampleUV.y = saturate( flipNormal * reflectVec.y * 0.5 + 0.5 );\n\t\tsampleUV.x = atan( flipNormal * reflectVec.z, flipNormal * reflectVec.x ) * RECIPROCAL_PI2 + 0.5;\n\t\tvec4 envColor = texture2D( envMap, sampleUV );\n\n\t#elif defined( ENVMAP_TYPE_SPHERE )\n\t\tvec3 reflectView = flipNormal * normalize((viewMatrix * vec4( reflectVec, 0.0 )).xyz + vec3(0.0,0.0,1.0));\n\t\tvec4 envColor = texture2D( envMap, reflectView.xy * 0.5 + 0.5 );\n\t#endif\n\n\tenvColor.xyz = inputToLinear( envColor.xyz );\n\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.specularmap_pars_fragment="#ifdef USE_SPECULARMAP\n\n\tuniform sampler2D specularMap;\n\n#endif",THREE.ShaderChunk.logdepthbuf_vertex="#ifdef USE_LOGDEPTHBUF\n\n\tgl_Position.z = log2(max( EPSILON, gl_Position.w + 1.0 )) * logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tvFragDepth = 1.0 + gl_Position.w;\n\n#else\n\n\t\tgl_Position.z = (gl_Position.z - 1.0) * gl_Position.w;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.morphtarget_pars_vertex="#ifdef USE_MORPHTARGETS\n\n\t#ifndef USE_MORPHNORMALS\n\n\tuniform float morphTargetInfluences[ 8 ];\n\n\t#else\n\n\tuniform float morphTargetInfluences[ 4 ];\n\n\t#endif\n\n#endif",THREE.ShaderChunk.specularmap_fragment="float specularStrength;\n\n#ifdef USE_SPECULARMAP\n\n\tvec4 texelSpecular = texture2D( specularMap, vUv );\n\tspecularStrength = texelSpecular.r;\n\n#else\n\n\tspecularStrength = 1.0;\n\n#endif",THREE.ShaderChunk.fog_fragment="#ifdef USE_FOG\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\n\t#else\n\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\n\t#endif\n\n\t#ifdef FOG_EXP2\n\n\t\tfloat fogFactor = exp2( - square( fogDensity ) * square( depth ) * LOG2 );\n\t\tfogFactor = whiteCompliment( fogFactor );\n\n\t#else\n\n\t\tfloat fogFactor = smoothstep( fogNear, fogFar, depth );\n\n\t#endif\n\t\n\toutgoingLight = mix( outgoingLight, fogColor, fogFactor );\n\n#endif",THREE.ShaderChunk.bumpmap_pars_fragment="#ifdef USE_BUMPMAP\n\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\n\t// Derivative maps - bump mapping unparametrized surfaces by Morten Mikkelsen\n\t// http://mmikkelsen3d.blogspot.sk/2011/07/derivative-maps.html\n\n\t// Evaluate the derivative of the height w.r.t. screen-space using forward differencing (listing 2)\n\n\tvec2 dHdxy_fwd() {\n\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\n\t\treturn vec2( dBx, dBy );\n\n\t}\n\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {\n\n\t\tvec3 vSigmaX = dFdx( surf_pos );\n\t\tvec3 vSigmaY = dFdy( surf_pos );\n\t\tvec3 vN = surf_norm;\t\t// normalized\n\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\n\t\tfloat fDet = dot( vSigmaX, R1 );\n\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\n\t}\n\n#endif\n",THREE.ShaderChunk.defaultnormal_vertex="#ifdef USE_SKINNING\n\n\tvec3 objectNormal = skinnedNormal.xyz;\n\n#elif defined( USE_MORPHNORMALS )\n\n\tvec3 objectNormal = morphedNormal;\n\n#else\n\n\tvec3 objectNormal = normal;\n\n#endif\n\n#ifdef FLIP_SIDED\n\n\tobjectNormal = -objectNormal;\n\n#endif\n\nvec3 transformedNormal = normalMatrix * objectNormal;\n",THREE.ShaderChunk.lights_phong_pars_fragment="uniform vec3 ambientLightColor;\n\n#if MAX_DIR_LIGHTS > 0\n\n\tuniform vec3 directionalLightColor[ MAX_DIR_LIGHTS ];\n\tuniform vec3 directionalLightDirection[ MAX_DIR_LIGHTS ];\n\n#endif\n\n#if MAX_HEMI_LIGHTS > 0\n\n\tuniform vec3 hemisphereLightSkyColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightGroundColor[ MAX_HEMI_LIGHTS ];\n\tuniform vec3 hemisphereLightDirection[ MAX_HEMI_LIGHTS ];\n\n#endif\n\n#if MAX_POINT_LIGHTS > 0\n\n\tuniform vec3 pointLightColor[ MAX_POINT_LIGHTS ];\n\n\tuniform vec3 pointLightPosition[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDistance[ MAX_POINT_LIGHTS ];\n\tuniform float pointLightDecay[ MAX_POINT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0\n\n\tuniform vec3 spotLightColor[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightPosition[ MAX_SPOT_LIGHTS ];\n\tuniform vec3 spotLightDirection[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightAngleCos[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightExponent[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDistance[ MAX_SPOT_LIGHTS ];\n\tuniform float spotLightDecay[ MAX_SPOT_LIGHTS ];\n\n#endif\n\n#if MAX_SPOT_LIGHTS > 0 || defined( USE_BUMPMAP ) || defined( USE_ENVMAP )\n\n\tvarying vec3 vWorldPosition;\n\n#endif\n\n#ifdef WRAP_AROUND\n\n\tuniform vec3 wrapRGB;\n\n#endif\n\nvarying vec3 vViewPosition;\n\n#ifndef FLAT_SHADED\n\n\tvarying vec3 vNormal;\n\n#endif\n",THREE.ShaderChunk.skinbase_vertex="#ifdef USE_SKINNING\n\n\tmat4 boneMatX = getBoneMatrix( skinIndex.x );\n\tmat4 boneMatY = getBoneMatrix( skinIndex.y );\n\tmat4 boneMatZ = getBoneMatrix( skinIndex.z );\n\tmat4 boneMatW = getBoneMatrix( skinIndex.w );\n\n#endif",THREE.ShaderChunk.map_vertex="#if defined( USE_MAP ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( USE_SPECULARMAP ) || defined( USE_ALPHAMAP )\n\n\tvUv = uv * offsetRepeat.zw + offsetRepeat.xy;\n\n#endif",THREE.ShaderChunk.lightmap_fragment="#ifdef USE_LIGHTMAP\n\n\toutgoingLight *= diffuseColor.xyz * texture2D( lightMap, vUv2 ).xyz;\n\n#endif",THREE.ShaderChunk.shadowmap_pars_vertex="#ifdef USE_SHADOWMAP\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\tuniform mat4 shadowMatrix[ MAX_SHADOWS ];\n\n#endif",THREE.ShaderChunk.color_fragment="#ifdef USE_COLOR\n\n\tdiffuseColor.rgb *= vColor;\n\n#endif",THREE.ShaderChunk.morphtarget_vertex="#ifdef USE_MORPHTARGETS\n\n\tvec3 morphed = vec3( 0.0 );\n\tmorphed += ( morphTarget0 - position ) * morphTargetInfluences[ 0 ];\n\tmorphed += ( morphTarget1 - position ) * morphTargetInfluences[ 1 ];\n\tmorphed += ( morphTarget2 - position ) * morphTargetInfluences[ 2 ];\n\tmorphed += ( morphTarget3 - position ) * morphTargetInfluences[ 3 ];\n\n\t#ifndef USE_MORPHNORMALS\n\n\tmorphed += ( morphTarget4 - position ) * morphTargetInfluences[ 4 ];\n\tmorphed += ( morphTarget5 - position ) * morphTargetInfluences[ 5 ];\n\tmorphed += ( morphTarget6 - position ) * morphTargetInfluences[ 6 ];\n\tmorphed += ( morphTarget7 - position ) * morphTargetInfluences[ 7 ];\n\n\t#endif\n\n\tmorphed += position;\n\n#endif",THREE.ShaderChunk.envmap_vertex="#if defined( USE_ENVMAP ) && ! defined( USE_BUMPMAP ) && ! defined( USE_NORMALMAP ) && ! defined( PHONG )\n\n\tvec3 worldNormal = transformDirection( objectNormal, modelMatrix );\n\n\tvec3 cameraToVertex = normalize( worldPosition.xyz - cameraPosition );\n\n\t#ifdef ENVMAP_MODE_REFLECTION\n\n\t\tvReflect = reflect( cameraToVertex, worldNormal );\n\n\t#else\n\n\t\tvReflect = refract( cameraToVertex, worldNormal, refractionRatio );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_fragment="#ifdef USE_SHADOWMAP\n\n\t#ifdef SHADOWMAP_DEBUG\n\n\t\tvec3 frustumColors[3];\n\t\tfrustumColors[0] = vec3( 1.0, 0.5, 0.0 );\n\t\tfrustumColors[1] = vec3( 0.0, 1.0, 0.8 );\n\t\tfrustumColors[2] = vec3( 0.0, 0.5, 1.0 );\n\n\t#endif\n\n\t#ifdef SHADOWMAP_CASCADE\n\n\t\tint inFrustumCount = 0;\n\n\t#endif\n\n\tfloat fDepth;\n\tvec3 shadowColor = vec3( 1.0 );\n\n\tfor( int i = 0; i < MAX_SHADOWS; i ++ ) {\n\n\t\tvec3 shadowCoord = vShadowCoord[ i ].xyz / vShadowCoord[ i ].w;\n\n\t\t\t\t// if ( something && something ) breaks ATI OpenGL shader compiler\n\t\t\t\t// if ( all( something, something ) ) using this instead\n\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\n\t\t\t\t// don't shadow pixels outside of light frustum\n\t\t\t\t// use just first frustum (for cascades)\n\t\t\t\t// don't shadow pixels behind far plane of light frustum\n\n\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\tinFrustumCount += int( inFrustum );\n\t\t\tbvec3 frustumTestVec = bvec3( inFrustum, inFrustumCount == 1, shadowCoord.z <= 1.0 );\n\n\t\t#else\n\n\t\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\n\t\t#endif\n\n\t\tbool frustumTest = all( frustumTestVec );\n\n\t\tif ( frustumTest ) {\n\n\t\t\tshadowCoord.z += shadowBias[ i ];\n\n\t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t/*\n\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n\t\t\t\t\t\t// must enroll loop manually\n\n\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {\n\n\t\t\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy );\n\n\t\t\t\t\t\t\t\t// doesn't seem to produce any noticeable visual difference compared to simple texture2D lookup\n\t\t\t\t\t\t\t\t//vec4 rgbaDepth = texture2DProj( shadowMap[ i ], vec4( vShadowCoord[ i ].w * ( vec2( x * xPixelOffset, y * yPixelOffset ) + shadowCoord.xy ), 0.05, vShadowCoord[ i ].w ) );\n\n\t\t\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\t\t\tif ( fDepth < shadowCoord.z )\n\t\t\t\t\t\t\tshadow += 1.0;\n\n\t\t\t\t}\n\n\t\t\t\tshadow /= 9.0;\n\n\t\t*/\n\n\t\t\t\tconst float shadowDelta = 1.0 / 9.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.25 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.25 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.25 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.25 * yPixelOffset;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tfDepth = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\t\t\t\tif ( fDepth < shadowCoord.z ) shadow += shadowDelta;\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\n\t\t\t\t\t\t// Percentage-close filtering\n\t\t\t\t\t\t// (9 pixel kernel)\n\t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n\n\t\t\t\tfloat shadow = 0.0;\n\n\t\t\t\tfloat xPixelOffset = 1.0 / shadowMapSize[ i ].x;\n\t\t\t\tfloat yPixelOffset = 1.0 / shadowMapSize[ i ].y;\n\n\t\t\t\tfloat dx0 = -1.0 * xPixelOffset;\n\t\t\t\tfloat dy0 = -1.0 * yPixelOffset;\n\t\t\t\tfloat dx1 = 1.0 * xPixelOffset;\n\t\t\t\tfloat dy1 = 1.0 * yPixelOffset;\n\n\t\t\t\tmat3 shadowKernel;\n\t\t\t\tmat3 depthKernel;\n\n\t\t\t\tdepthKernel[0][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy0 ) ) );\n\t\t\t\tdepthKernel[0][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, 0.0 ) ) );\n\t\t\t\tdepthKernel[0][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx0, dy1 ) ) );\n\t\t\t\tdepthKernel[1][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy0 ) ) );\n\t\t\t\tdepthKernel[1][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy ) );\n\t\t\t\tdepthKernel[1][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( 0.0, dy1 ) ) );\n\t\t\t\tdepthKernel[2][0] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy0 ) ) );\n\t\t\t\tdepthKernel[2][1] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, 0.0 ) ) );\n\t\t\t\tdepthKernel[2][2] = unpackDepth( texture2D( shadowMap[ i ], shadowCoord.xy + vec2( dx1, dy1 ) ) );\n\n\t\t\t\tvec3 shadowZ = vec3( shadowCoord.z );\n\t\t\t\tshadowKernel[0] = vec3(lessThan(depthKernel[0], shadowZ ));\n\t\t\t\tshadowKernel[0] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[1] = vec3(lessThan(depthKernel[1], shadowZ ));\n\t\t\t\tshadowKernel[1] *= vec3(0.25);\n\n\t\t\t\tshadowKernel[2] = vec3(lessThan(depthKernel[2], shadowZ ));\n\t\t\t\tshadowKernel[2] *= vec3(0.25);\n\n\t\t\t\tvec2 fractionalCoord = 1.0 - fract( shadowCoord.xy * shadowMapSize[i].xy );\n\n\t\t\t\tshadowKernel[0] = mix( shadowKernel[1], shadowKernel[0], fractionalCoord.x );\n\t\t\t\tshadowKernel[1] = mix( shadowKernel[2], shadowKernel[1], fractionalCoord.x );\n\n\t\t\t\tvec4 shadowValues;\n\t\t\t\tshadowValues.x = mix( shadowKernel[0][1], shadowKernel[0][0], fractionalCoord.y );\n\t\t\t\tshadowValues.y = mix( shadowKernel[0][2], shadowKernel[0][1], fractionalCoord.y );\n\t\t\t\tshadowValues.z = mix( shadowKernel[1][1], shadowKernel[1][0], fractionalCoord.y );\n\t\t\t\tshadowValues.w = mix( shadowKernel[1][2], shadowKernel[1][1], fractionalCoord.y );\n\n\t\t\t\tshadow = dot( shadowValues, vec4( 1.0 ) );\n\n\t\t\t\tshadowColor = shadowColor * vec3( ( 1.0 - shadowDarkness[ i ] * shadow ) );\n\n\t\t\t#else\n\n\t\t\t\tvec4 rgbaDepth = texture2D( shadowMap[ i ], shadowCoord.xy );\n\t\t\t\tfloat fDepth = unpackDepth( rgbaDepth );\n\n\t\t\t\tif ( fDepth < shadowCoord.z )\n\n\t\t// spot with multiple shadows is darker\n\n\t\t\t\t\tshadowColor = shadowColor * vec3( 1.0 - shadowDarkness[ i ] );\n\n\t\t// spot with multiple shadows has the same color as single shadow spot\n\n\t\t// \t\t\t\t\tshadowColor = min( shadowColor, vec3( shadowDarkness[ i ] ) );\n\n\t\t\t#endif\n\n\t\t}\n\n\n\t\t#ifdef SHADOWMAP_DEBUG\n\n\t\t\t#ifdef SHADOWMAP_CASCADE\n\n\t\t\t\tif ( inFrustum && inFrustumCount == 1 ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#else\n\n\t\t\t\tif ( inFrustum ) outgoingLight *= frustumColors[ i ];\n\n\t\t\t#endif\n\n\t\t#endif\n\n\t}\n\n\t// NOTE: I am unsure if this is correct in linear space.  -bhouston, Dec 29, 2014\n\tshadowColor = inputToLinear( shadowColor );\n\n\toutgoingLight = outgoingLight * shadowColor;\n\n#endif\n",THREE.ShaderChunk.worldpos_vertex="#if defined( USE_ENVMAP ) || defined( PHONG ) || defined( LAMBERT ) || defined ( USE_SHADOWMAP )\n\n\t#ifdef USE_SKINNING\n\n\t\tvec4 worldPosition = modelMatrix * skinned;\n\n\t#elif defined( USE_MORPHTARGETS )\n\n\t\tvec4 worldPosition = modelMatrix * vec4( morphed, 1.0 );\n\n\t#else\n\n\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.shadowmap_pars_fragment="#ifdef USE_SHADOWMAP\n\n\tuniform sampler2D shadowMap[ MAX_SHADOWS ];\n\tuniform vec2 shadowMapSize[ MAX_SHADOWS ];\n\n\tuniform float shadowDarkness[ MAX_SHADOWS ];\n\tuniform float shadowBias[ MAX_SHADOWS ];\n\n\tvarying vec4 vShadowCoord[ MAX_SHADOWS ];\n\n\tfloat unpackDepth( const in vec4 rgba_depth ) {\n\n\t\tconst vec4 bit_shift = vec4( 1.0 / ( 256.0 * 256.0 * 256.0 ), 1.0 / ( 256.0 * 256.0 ), 1.0 / 256.0, 1.0 );\n\t\tfloat depth = dot( rgba_depth, bit_shift );\n\t\treturn depth;\n\n\t}\n\n#endif",THREE.ShaderChunk.skinning_pars_vertex="#ifdef USE_SKINNING\n\n\tuniform mat4 bindMatrix;\n\tuniform mat4 bindMatrixInverse;\n\n\t#ifdef BONE_TEXTURE\n\n\t\tuniform sampler2D boneTexture;\n\t\tuniform int boneTextureWidth;\n\t\tuniform int boneTextureHeight;\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tfloat j = i * 4.0;\n\t\t\tfloat x = mod( j, float( boneTextureWidth ) );\n\t\t\tfloat y = floor( j / float( boneTextureWidth ) );\n\n\t\t\tfloat dx = 1.0 / float( boneTextureWidth );\n\t\t\tfloat dy = 1.0 / float( boneTextureHeight );\n\n\t\t\ty = dy * ( y + 0.5 );\n\n\t\t\tvec4 v1 = texture2D( boneTexture, vec2( dx * ( x + 0.5 ), y ) );\n\t\t\tvec4 v2 = texture2D( boneTexture, vec2( dx * ( x + 1.5 ), y ) );\n\t\t\tvec4 v3 = texture2D( boneTexture, vec2( dx * ( x + 2.5 ), y ) );\n\t\t\tvec4 v4 = texture2D( boneTexture, vec2( dx * ( x + 3.5 ), y ) );\n\n\t\t\tmat4 bone = mat4( v1, v2, v3, v4 );\n\n\t\t\treturn bone;\n\n\t\t}\n\n\t#else\n\n\t\tuniform mat4 boneGlobalMatrices[ MAX_BONES ];\n\n\t\tmat4 getBoneMatrix( const in float i ) {\n\n\t\t\tmat4 bone = boneGlobalMatrices[ int(i) ];\n\t\t\treturn bone;\n\n\t\t}\n\n\t#endif\n\n#endif\n",THREE.ShaderChunk.logdepthbuf_pars_fragment="#ifdef USE_LOGDEPTHBUF\n\n\tuniform float logDepthBufFC;\n\n\t#ifdef USE_LOGDEPTHBUF_EXT\n\n\t\t#extension GL_EXT_frag_depth : enable\n\t\tvarying float vFragDepth;\n\n\t#endif\n\n#endif",THREE.ShaderChunk.alphamap_fragment="#ifdef USE_ALPHAMAP\n\n\tdiffuseColor.a *= texture2D( alphaMap, vUv ).g;\n\n#endif\n",THREE.ShaderChunk.alphamap_pars_fragment="#ifdef USE_ALPHAMAP\n\n\tuniform sampler2D alphaMap;\n\n#endif\n",THREE.UniformsUtils={merge:function(t){for(var e={},i=0;i<t.length;i++){var r,n=this.clone(t[i]);for(r in n)e[r]=n[r]}return e},clone:function(t){var e,i={};for(e in t)for(var r in i[e]={},t[e]){var n=t[e][r];i[e][r]=n instanceof THREE.Color||n instanceof THREE.Vector2||n instanceof THREE.Vector3||n instanceof THREE.Vector4||n instanceof THREE.Matrix4||n instanceof THREE.Texture?n.clone():n instanceof Array?n.slice():n}return i}},THREE.UniformsLib={common:{diffuse:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},lightMap:{type:"t",value:null},specularMap:{type:"t",value:null},alphaMap:{type:"t",value:null},envMap:{type:"t",value:null},flipEnvMap:{type:"f",value:-1},reflectivity:{type:"f",value:1},refractionRatio:{type:"f",value:.98},morphTargetInfluences:{type:"f",value:0}},bump:{bumpMap:{type:"t",value:null},bumpScale:{type:"f",value:1}},normalmap:{normalMap:{type:"t",value:null},normalScale:{type:"v2",value:new THREE.Vector2(1,1)}},fog:{fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},lights:{ambientLightColor:{type:"fv",value:[]},directionalLightDirection:{type:"fv",value:[]},directionalLightColor:{type:"fv",value:[]},hemisphereLightDirection:{type:"fv",value:[]},hemisphereLightSkyColor:{type:"fv",value:[]},hemisphereLightGroundColor:{type:"fv",value:[]},pointLightColor:{type:"fv",value:[]},pointLightPosition:{type:"fv",value:[]},pointLightDistance:{type:"fv1",value:[]},pointLightDecay:{type:"fv1",value:[]},spotLightColor:{type:"fv",value:[]},spotLightPosition:{type:"fv",value:[]},spotLightDirection:{type:"fv",value:[]},spotLightDistance:{type:"fv1",value:[]},spotLightAngleCos:{type:"fv1",value:[]},spotLightExponent:{type:"fv1",value:[]},spotLightDecay:{type:"fv1",value:[]}},particle:{psColor:{type:"c",value:new THREE.Color(15658734)},opacity:{type:"f",value:1},size:{type:"f",value:1},scale:{type:"f",value:1},map:{type:"t",value:null},offsetRepeat:{type:"v4",value:new THREE.Vector4(0,0,1,1)},fogDensity:{type:"f",value:25e-5},fogNear:{type:"f",value:1},fogFar:{type:"f",value:2e3},fogColor:{type:"c",value:new THREE.Color(16777215)}},shadowmap:{shadowMap:{type:"tv",value:[]},shadowMapSize:{type:"v2v",value:[]},shadowBias:{type:"fv1",value:[]},shadowDarkness:{type:"fv1",value:[]},shadowMatrix:{type:"m4v",value:[]}}},THREE.ShaderLib={basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.shadowmap]),vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.skinbase_vertex,"\t#ifdef USE_ENVMAP",THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"\t#endif",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},lambert:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{emissive:{type:"c",value:new THREE.Color(0)},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["#define LAMBERT\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_lambert_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_lambert_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\nvarying vec3 vLightFront;\n#ifdef DOUBLE_SIDED\n\tvarying vec3 vLightBack;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,"\t#ifdef DOUBLE_SIDED\n\t\tif ( gl_FrontFacing )\n\t\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;\n\t\telse\n\t\t\toutgoingLight += diffuseColor.rgb * vLightBack + emissive;\n\t#else\n\t\toutgoingLight += diffuseColor.rgb * vLightFront + emissive;\n\t#endif",THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},phong:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.bump,THREE.UniformsLib.normalmap,THREE.UniformsLib.fog,THREE.UniformsLib.lights,THREE.UniformsLib.shadowmap,{emissive:{type:"c",value:new THREE.Color(0)},specular:{type:"c",value:new THREE.Color(1118481)},shininess:{type:"f",value:30},wrapRGB:{type:"v3",value:new THREE.Vector3(1,1,1)}}]),vertexShader:["#define PHONG\nvarying vec3 vViewPosition;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif",THREE.ShaderChunk.common,THREE.ShaderChunk.map_pars_vertex,THREE.ShaderChunk.lightmap_pars_vertex,THREE.ShaderChunk.envmap_pars_vertex,THREE.ShaderChunk.lights_phong_pars_vertex,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.map_vertex,THREE.ShaderChunk.lightmap_vertex,THREE.ShaderChunk.color_vertex,THREE.ShaderChunk.morphnormal_vertex,THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.skinnormal_vertex,THREE.ShaderChunk.defaultnormal_vertex,"#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n#endif",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"\tvViewPosition = -mvPosition.xyz;",THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.envmap_vertex,THREE.ShaderChunk.lights_phong_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_pars_fragment,THREE.ShaderChunk.alphamap_pars_fragment,THREE.ShaderChunk.lightmap_pars_fragment,THREE.ShaderChunk.envmap_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.lights_phong_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.bumpmap_pars_fragment,THREE.ShaderChunk.normalmap_pars_fragment,THREE.ShaderChunk.specularmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphamap_fragment,THREE.ShaderChunk.alphatest_fragment,THREE.ShaderChunk.specularmap_fragment,THREE.ShaderChunk.lights_phong_fragment,THREE.ShaderChunk.lightmap_fragment,THREE.ShaderChunk.envmap_fragment,THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.linear_to_gamma_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},particle_basic:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.particle,THREE.UniformsLib.shadowmap]),vertexShader:["uniform float size;\nuniform float scale;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.shadowmap_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\t#ifdef USE_SIZEATTENUATION\n\t\tgl_PointSize = size * ( scale / length( mvPosition.xyz ) );\n\t#else\n\t\tgl_PointSize = size;\n\t#endif\n\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,THREE.ShaderChunk.worldpos_vertex,THREE.ShaderChunk.shadowmap_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 psColor;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.map_particle_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.shadowmap_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( psColor, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.map_particle_fragment,THREE.ShaderChunk.color_fragment,THREE.ShaderChunk.alphatest_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.shadowmap_fragment,THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},dashed:{uniforms:THREE.UniformsUtils.merge([THREE.UniformsLib.common,THREE.UniformsLib.fog,{scale:{type:"f",value:1},dashSize:{type:"f",value:1},totalSize:{type:"f",value:2}}]),vertexShader:["uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.color_vertex,"\tvLineDistance = scale * lineDistance;\n\tvec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n\tgl_Position = projectionMatrix * mvPosition;",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;",THREE.ShaderChunk.common,THREE.ShaderChunk.color_pars_fragment,THREE.ShaderChunk.fog_pars_fragment,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,THREE.ShaderChunk.color_fragment,"\toutgoingLight = diffuseColor.rgb;",THREE.ShaderChunk.fog_fragment,"\tgl_FragColor = vec4( outgoingLight, diffuseColor.a );\n}"].join("\n")},depth:{uniforms:{mNear:{type:"f",value:1},mFar:{type:"f",value:2e3},opacity:{type:"f",value:1}},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float mNear;\nuniform float mFar;\nuniform float opacity;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tfloat depth = gl_FragDepthEXT / gl_FragCoord.w;\n\t#else\n\t\tfloat depth = gl_FragCoord.z / gl_FragCoord.w;\n\t#endif\n\tfloat color = 1.0 - smoothstep( mNear, mFar, depth );\n\tgl_FragColor = vec4( vec3( color ), opacity );\n}"].join("\n")},normal:{uniforms:{opacity:{type:"f",value:1}},vertexShader:["varying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvNormal = normalize( normalMatrix * normal );",THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform float opacity;\nvarying vec3 vNormal;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = vec4( 0.5 * normalize( vNormal ) + 0.5, opacity );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},cube:{uniforms:{tCube:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform samplerCube tCube;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\n\tgl_FragColor = textureCube( tCube, vec3( tFlip * vWorldPosition.x, vWorldPosition.yz ) );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},equirect:{uniforms:{tEquirect:{type:"t",value:null},tFlip:{type:"f",value:-1}},vertexShader:["varying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {\n\tvWorldPosition = transformDirection( position, modelMatrix );\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:["uniform sampler2D tEquirect;\nuniform float tFlip;\nvarying vec3 vWorldPosition;",THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"void main() {\nvec3 direction = normalize( vWorldPosition );\nvec2 sampleUV;\nsampleUV.y = saturate( tFlip * direction.y * -0.5 + 0.5 );\nsampleUV.x = atan( direction.z, direction.x ) * RECIPROCAL_PI2 + 0.5;\ngl_FragColor = texture2D( tEquirect, sampleUV );",THREE.ShaderChunk.logdepthbuf_fragment,"}"].join("\n")},depthRGBA:{uniforms:{},vertexShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.morphtarget_pars_vertex,THREE.ShaderChunk.skinning_pars_vertex,THREE.ShaderChunk.logdepthbuf_pars_vertex,"void main() {",THREE.ShaderChunk.skinbase_vertex,THREE.ShaderChunk.morphtarget_vertex,THREE.ShaderChunk.skinning_vertex,THREE.ShaderChunk.default_vertex,THREE.ShaderChunk.logdepthbuf_vertex,"}"].join("\n"),fragmentShader:[THREE.ShaderChunk.common,THREE.ShaderChunk.logdepthbuf_pars_fragment,"vec4 pack_depth( const in float depth ) {\n\tconst vec4 bit_shift = vec4( 256.0 * 256.0 * 256.0, 256.0 * 256.0, 256.0, 1.0 );\n\tconst vec4 bit_mask = vec4( 0.0, 1.0 / 256.0, 1.0 / 256.0, 1.0 / 256.0 );\n\tvec4 res = mod( depth * bit_shift * vec4( 255 ), vec4( 256 ) ) / vec4( 255 );\n\tres -= res.xxyz * bit_mask;\n\treturn res;\n}\nvoid main() {",THREE.ShaderChunk.logdepthbuf_fragment,"\t#ifdef USE_LOGDEPTHBUF_EXT\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragDepthEXT );\n\t#else\n\t\tgl_FragData[ 0 ] = pack_depth( gl_FragCoord.z );\n\t#endif\n}"].join("\n")}},THREE.WebGLRenderer=function(t){function u(t){var e=t.geometry;t=t.material;var i=e.vertices.length;if(t.attributes)for(var r in void 0===e.__webglCustomAttributesList&&(e.__webglCustomAttributesList=[]),t.attributes){var n=t.attributes[r];if(!n.__webglInitialized||n.createUniqueBuffers){n.__webglInitialized=!0;var a=1;"v2"===n.type?a=2:"v3"===n.type?a=3:"v4"===n.type?a=4:"c"===n.type&&(a=3),n.size=a,n.array=new Float32Array(i*a),n.buffer=We.createBuffer(),n.buffer.belongsToAttribute=r,n.needsUpdate=!0}e.__webglCustomAttributesList.push(n)}}function Ue(t,e){return t.material instanceof THREE.MeshFaceMaterial?t.material.materials[e.materialIndex]:t.material}function d(t,e,i,r){i=i.attributes;for(var n=e.attributes,a=0,o=(e=e.attributesKeys).length;a<o;a++){var s=e[a],h=n[s];if(0<=h){var l=i[s];void 0!==l?(s=l.itemSize,We.bindBuffer(We.ARRAY_BUFFER,l.buffer),G.enableAttribute(h),We.vertexAttribPointer(h,s,We.FLOAT,!1,0,r*s*4)):void 0!==t.defaultAttributeValues&&(2===t.defaultAttributeValues[s].length?We.vertexAttrib2fv(h,t.defaultAttributeValues[s]):3===t.defaultAttributeValues[s].length&&We.vertexAttrib3fv(h,t.defaultAttributeValues[s]))}}G.disableUnusedAttributes()}function p(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function f(t,e){return t.object.renderOrder!==e.object.renderOrder?t.object.renderOrder-e.object.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function m(t,e){return e[0]-t[0]}function E(t,e,i,r,n){for(var a,o=0,s=t.length;o<s;o++){var h=(a=t[o]).object,l=a.buffer;if(_(h,e),n)a=n;else{if(!(a=a.material))continue;T(a)}be.setMaterialFaces(a),l instanceof THREE.BufferGeometry?be.renderBufferDirect(e,i,r,a,l,h):be.renderBuffer(e,i,r,a,l,h)}}function g(t,e,i,r,n,a){for(var o,s=0,h=t.length;s<h;s++){var l=(o=t[s]).object;if(l.visible){if(a)o=a;else{if(!(o=o[e]))continue;T(o)}be.renderImmediateObject(i,r,n,o,l)}}}function Ve(t,e){var i=t.material,r=!1;if(void 0===qe[e.id]||!0===e.groupsNeedUpdate){delete H[t.id];for(var n,a,o=qe,s=e.id,h=(i=i instanceof THREE.MeshFaceMaterial,W.get("OES_element_index_uint")?4294967296:65535),l=(r={},e.morphTargets.length),c=e.morphNormals.length,u={},d=[],p=0,f=e.faces.length;p<f;p++){n=e.faces[p];var m=i?n.materialIndex:0;m in r||(r[m]={hash:m,counter:0}),(n=r[m].hash+"_"+r[m].counter)in u||(a={id:dt++,faces3:[],materialIndex:m,vertices:0,numMorphTargets:l,numMorphNormals:c},u[n]=a,d.push(a)),u[n].vertices+3>h&&(r[m].counter+=1,(n=r[m].hash+"_"+r[m].counter)in u||(a={id:dt++,faces3:[],materialIndex:m,vertices:0,numMorphTargets:l,numMorphNormals:c},u[n]=a,d.push(a))),u[n].faces3.push(p),u[n].vertices+=3}o[s]=d,e.groupsNeedUpdate=!1}for(s=0,i=(o=qe[e.id]).length;s<i;s++){if(void 0===(h=o[s]).__webglVertexBuffer){if((r=h).__webglVertexBuffer=We.createBuffer(),r.__webglNormalBuffer=We.createBuffer(),r.__webglTangentBuffer=We.createBuffer(),r.__webglColorBuffer=We.createBuffer(),r.__webglUVBuffer=We.createBuffer(),r.__webglUV2Buffer=We.createBuffer(),r.__webglSkinIndicesBuffer=We.createBuffer(),r.__webglSkinWeightsBuffer=We.createBuffer(),r.__webglFaceBuffer=We.createBuffer(),r.__webglLineBuffer=We.createBuffer(),c=r.numMorphTargets)for(r.__webglMorphTargetsBuffers=[],l=0;l<c;l++)r.__webglMorphTargetsBuffers.push(We.createBuffer());if(c=r.numMorphNormals)for(r.__webglMorphNormalsBuffers=[],l=0;l<c;l++)r.__webglMorphNormalsBuffers.push(We.createBuffer());if(be.info.memory.geometries++,r=h,f=(p=t).geometry,l=3*(c=r.faces3).length,u=1*c.length,d=3*c.length,c=Ue(p,r),r.__vertexArray=new Float32Array(3*l),r.__normalArray=new Float32Array(3*l),r.__colorArray=new Float32Array(3*l),r.__uvArray=new Float32Array(2*l),1<f.faceVertexUvs.length&&(r.__uv2Array=new Float32Array(2*l)),f.hasTangents&&(r.__tangentArray=new Float32Array(4*l)),p.geometry.skinWeights.length&&p.geometry.skinIndices.length&&(r.__skinIndexArray=new Float32Array(4*l),r.__skinWeightArray=new Float32Array(4*l)),p=null!==W.get("OES_element_index_uint")&&21845<u?Uint32Array:Uint16Array,r.__typeArray=p,r.__faceArray=new p(3*u),r.__lineArray=new p(2*d),f=r.numMorphTargets)for(r.__morphTargetsArrays=[],p=0;p<f;p++)r.__morphTargetsArrays.push(new Float32Array(3*l));if(f=r.numMorphNormals)for(r.__morphNormalsArrays=[],p=0;p<f;p++)r.__morphNormalsArrays.push(new Float32Array(3*l));if(r.__webglFaceCount=3*u,r.__webglLineCount=2*d,c.attributes)for(u in void 0===r.__webglCustomAttributesList&&(r.__webglCustomAttributesList=[]),u=void 0,c.attributes){var E;d=c.attributes[u],p={};for(E in d)p[E]=d[E];p.__webglInitialized&&!p.createUniqueBuffers||(p.__webglInitialized=!0,f=1,"v2"===p.type?f=2:"v3"===p.type?f=3:"v4"===p.type?f=4:"c"===p.type&&(f=3),p.size=f,p.array=new Float32Array(l*f),p.buffer=We.createBuffer(),p.buffer.belongsToAttribute=u,d.needsUpdate=!0,p.__original=d),r.__webglCustomAttributesList.push(p)}r.__inittedArrays=!0,e.verticesNeedUpdate=!0,e.morphTargetsNeedUpdate=!0,e.elementsNeedUpdate=!0,e.uvsNeedUpdate=!0,e.normalsNeedUpdate=!0,e.tangentsNeedUpdate=!0,r=e.colorsNeedUpdate=!0}else r=!1;(r||void 0===t.__webglActive)&&v(H,h,t)}t.__webglActive=!0}function v(t,e,i){var r=i.id;t[r]=t[r]||[],t[r].push({id:r,buffer:e,object:i,material:null,z:0})}function y(t){var e=t.geometry;if(e instanceof THREE.BufferGeometry)for(var i=e.attributes,r=e.attributesKeys,n=0,a=r.length;n<a;n++){var o=r[n],s=i[o],h="index"===o?We.ELEMENT_ARRAY_BUFFER:We.ARRAY_BUFFER;void 0===s.buffer?(s.buffer=We.createBuffer(),We.bindBuffer(h,s.buffer),We.bufferData(h,s.array,s instanceof THREE.DynamicBufferAttribute?We.DYNAMIC_DRAW:We.STATIC_DRAW),s.needsUpdate=!1):!0===s.needsUpdate&&(We.bindBuffer(h,s.buffer),void 0===s.updateRange||-1===s.updateRange.count?We.bufferSubData(h,0,s.array):0===s.updateRange.count?console.error("THREE.WebGLRenderer.updateObject: using updateRange for THREE.DynamicBufferAttribute and marked as needsUpdate but count is 0, ensure you are using set methods or updating manually."):(We.bufferSubData(h,s.updateRange.offset*s.array.BYTES_PER_ELEMENT,s.array.subarray(s.updateRange.offset,s.updateRange.offset+s.updateRange.count)),s.updateRange.count=0),s.needsUpdate=!1)}else if(t instanceof THREE.Mesh){!0===e.groupsNeedUpdate&&Ve(t,e);for(var l=qe[e.id],c=(n=0,l.length);n<c;n++){var u=l[n],d=Ue(t,u),p=d.attributes&&Ie(d);if(e.verticesNeedUpdate||e.morphTargetsNeedUpdate||e.elementsNeedUpdate||e.uvsNeedUpdate||e.normalsNeedUpdate||e.colorsNeedUpdate||e.tangentsNeedUpdate||p){var f=u,m=t,E=We.DYNAMIC_DRAW,g=!e.dynamic,v=d;if(f.__inittedArrays){var y=0==v instanceof THREE.MeshPhongMaterial&&v.shading===THREE.FlatShading,T=void 0,R=void 0,_=void 0,x=void 0,b=void 0,w=void 0,H=void 0,M=void 0,S=void 0,C=void 0,A=void 0,P=void 0,L=void 0,k=void 0,D=void 0,F=void 0,z=void 0,B=void 0,O=void 0,N=void 0,U=void 0,V=void 0,I=void 0,G=void 0,W=void 0,j=void 0,q=void 0,X=void 0,Y=void 0,K=void 0,Q=void 0,Z=void 0,J=void 0,$=void 0,tt=void 0,et=void 0,it=void 0,rt=void 0,nt=void 0,at=0,ot=0,st=0,ht=0,lt=0,ct=0,ut=0,dt=0,pt=0,ft=0,mt=0,Et=0,gt=void 0,vt=f.__vertexArray,yt=f.__uvArray,Tt=f.__uv2Array,Rt=f.__normalArray,_t=f.__tangentArray,xt=f.__colorArray,bt=f.__skinIndexArray,wt=f.__skinWeightArray,Ht=f.__morphTargetsArrays,Mt=f.__morphNormalsArrays,St=f.__webglCustomAttributesList,Ct=void 0,At=f.__faceArray,Pt=f.__lineArray,Lt=m.geometry,kt=Lt.elementsNeedUpdate,Dt=Lt.uvsNeedUpdate,Ft=Lt.normalsNeedUpdate,zt=Lt.tangentsNeedUpdate,Bt=Lt.colorsNeedUpdate,Ot=Lt.morphTargetsNeedUpdate,Nt=Lt.vertices,Ut=f.faces3,Vt=Lt.faces,It=Lt.faceVertexUvs[0],Gt=Lt.faceVertexUvs[1],Wt=Lt.skinIndices,jt=Lt.skinWeights,qt=Lt.morphTargets,Xt=Lt.morphNormals;if(Lt.verticesNeedUpdate){for(T=0,R=Ut.length;T<R;T++)A=Nt[(_=Vt[Ut[T]]).a],P=Nt[_.b],L=Nt[_.c],vt[ot]=A.x,vt[ot+1]=A.y,vt[ot+2]=A.z,vt[ot+3]=P.x,vt[ot+4]=P.y,vt[ot+5]=P.z,vt[ot+6]=L.x,vt[ot+7]=L.y,vt[ot+8]=L.z,ot+=9;We.bindBuffer(We.ARRAY_BUFFER,f.__webglVertexBuffer),We.bufferData(We.ARRAY_BUFFER,vt,E)}if(Ot)for($=0,tt=qt.length;$<tt;$++){for(T=mt=0,R=Ut.length;T<R;T++)_=Vt[rt=Ut[T]],A=qt[$].vertices[_.a],P=qt[$].vertices[_.b],L=qt[$].vertices[_.c],(et=Ht[$])[mt]=A.x,et[mt+1]=A.y,et[mt+2]=A.z,et[mt+3]=P.x,et[mt+4]=P.y,et[mt+5]=P.z,et[mt+6]=L.x,et[mt+7]=L.y,et[mt+8]=L.z,v.morphNormals&&(y?O=B=z=Xt[$].faceNormals[rt]:(z=(nt=Xt[$].vertexNormals[rt]).a,B=nt.b,O=nt.c),(it=Mt[$])[mt]=z.x,it[mt+1]=z.y,it[mt+2]=z.z,it[mt+3]=B.x,it[mt+4]=B.y,it[mt+5]=B.z,it[mt+6]=O.x,it[mt+7]=O.y,it[mt+8]=O.z),mt+=9;We.bindBuffer(We.ARRAY_BUFFER,f.__webglMorphTargetsBuffers[$]),We.bufferData(We.ARRAY_BUFFER,Ht[$],E),v.morphNormals&&(We.bindBuffer(We.ARRAY_BUFFER,f.__webglMorphNormalsBuffers[$]),We.bufferData(We.ARRAY_BUFFER,Mt[$],E))}if(jt.length){for(T=0,R=Ut.length;T<R;T++)I=jt[(_=Vt[Ut[T]]).a],G=jt[_.b],W=jt[_.c],wt[ft]=I.x,wt[ft+1]=I.y,wt[ft+2]=I.z,wt[ft+3]=I.w,wt[ft+4]=G.x,wt[ft+5]=G.y,wt[ft+6]=G.z,wt[ft+7]=G.w,wt[ft+8]=W.x,wt[ft+9]=W.y,wt[ft+10]=W.z,wt[ft+11]=W.w,j=Wt[_.a],q=Wt[_.b],X=Wt[_.c],bt[ft]=j.x,bt[ft+1]=j.y,bt[ft+2]=j.z,bt[ft+3]=j.w,bt[ft+4]=q.x,bt[ft+5]=q.y,bt[ft+6]=q.z,bt[ft+7]=q.w,bt[ft+8]=X.x,bt[ft+9]=X.y,bt[ft+10]=X.z,bt[ft+11]=X.w,ft+=12;0<ft&&(We.bindBuffer(We.ARRAY_BUFFER,f.__webglSkinIndicesBuffer),We.bufferData(We.ARRAY_BUFFER,bt,E),We.bindBuffer(We.ARRAY_BUFFER,f.__webglSkinWeightsBuffer),We.bufferData(We.ARRAY_BUFFER,wt,E))}if(Bt){for(T=0,R=Ut.length;T<R;T++)w=(_=Vt[Ut[T]]).vertexColors,H=_.color,3===w.length&&v.vertexColors===THREE.VertexColors?(N=w[0],U=w[1],V=w[2]):V=U=N=H,xt[pt]=N.r,xt[pt+1]=N.g,xt[pt+2]=N.b,xt[pt+3]=U.r,xt[pt+4]=U.g,xt[pt+5]=U.b,xt[pt+6]=V.r,xt[pt+7]=V.g,xt[pt+8]=V.b,pt+=9;0<pt&&(We.bindBuffer(We.ARRAY_BUFFER,f.__webglColorBuffer),We.bufferData(We.ARRAY_BUFFER,xt,E))}if(zt&&Lt.hasTangents){for(T=0,R=Ut.length;T<R;T++)k=(M=(_=Vt[Ut[T]]).vertexTangents)[0],D=M[1],F=M[2],_t[ut]=k.x,_t[ut+1]=k.y,_t[ut+2]=k.z,_t[ut+3]=k.w,_t[ut+4]=D.x,_t[ut+5]=D.y,_t[ut+6]=D.z,_t[ut+7]=D.w,_t[ut+8]=F.x,_t[ut+9]=F.y,_t[ut+10]=F.z,_t[ut+11]=F.w,ut+=12;We.bindBuffer(We.ARRAY_BUFFER,f.__webglTangentBuffer),We.bufferData(We.ARRAY_BUFFER,_t,E)}if(Ft){for(T=0,R=Ut.length;T<R;T++)if(x=(_=Vt[Ut[T]]).vertexNormals,b=_.normal,3===x.length&&!1===y)for(Y=0;Y<3;Y++)Q=x[Y],Rt[ct]=Q.x,Rt[ct+1]=Q.y,Rt[ct+2]=Q.z,ct+=3;else for(Y=0;Y<3;Y++)Rt[ct]=b.x,Rt[ct+1]=b.y,Rt[ct+2]=b.z,ct+=3;We.bindBuffer(We.ARRAY_BUFFER,f.__webglNormalBuffer),We.bufferData(We.ARRAY_BUFFER,Rt,E)}if(Dt&&It){for(T=0,R=Ut.length;T<R;T++)if(void 0!==(S=It[Ut[T]]))for(Y=0;Y<3;Y++)Z=S[Y],yt[st]=Z.x,yt[st+1]=Z.y,st+=2;0<st&&(We.bindBuffer(We.ARRAY_BUFFER,f.__webglUVBuffer),We.bufferData(We.ARRAY_BUFFER,yt,E))}if(Dt&&Gt){for(T=0,R=Ut.length;T<R;T++)if(void 0!==(C=Gt[Ut[T]]))for(Y=0;Y<3;Y++)J=C[Y],Tt[ht]=J.x,Tt[ht+1]=J.y,ht+=2;0<ht&&(We.bindBuffer(We.ARRAY_BUFFER,f.__webglUV2Buffer),We.bufferData(We.ARRAY_BUFFER,Tt,E))}if(kt){for(T=0,R=Ut.length;T<R;T++)At[lt]=at,At[lt+1]=at+1,At[lt+2]=at+2,lt+=3,Pt[dt]=at,Pt[dt+1]=at+1,Pt[dt+2]=at,Pt[dt+3]=at+2,Pt[dt+4]=at+1,Pt[dt+5]=at+2,dt+=6,at+=3;We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,f.__webglFaceBuffer),We.bufferData(We.ELEMENT_ARRAY_BUFFER,At,E),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,f.__webglLineBuffer),We.bufferData(We.ELEMENT_ARRAY_BUFFER,Pt,E)}if(St)for(Y=0,K=St.length;Y<K;Y++)if((Ct=St[Y]).__original.needsUpdate){if(Et=0,1===Ct.size){if(void 0===Ct.boundTo||"vertices"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)_=Vt[Ut[T]],Ct.array[Et]=Ct.value[_.a],Ct.array[Et+1]=Ct.value[_.b],Ct.array[Et+2]=Ct.value[_.c],Et+=3;else if("faces"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)gt=Ct.value[Ut[T]],Ct.array[Et]=gt,Ct.array[Et+1]=gt,Ct.array[Et+2]=gt,Et+=3}else if(2===Ct.size){if(void 0===Ct.boundTo||"vertices"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)_=Vt[Ut[T]],A=Ct.value[_.a],P=Ct.value[_.b],L=Ct.value[_.c],Ct.array[Et]=A.x,Ct.array[Et+1]=A.y,Ct.array[Et+2]=P.x,Ct.array[Et+3]=P.y,Ct.array[Et+4]=L.x,Ct.array[Et+5]=L.y,Et+=6;else if("faces"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)L=P=A=gt=Ct.value[Ut[T]],Ct.array[Et]=A.x,Ct.array[Et+1]=A.y,Ct.array[Et+2]=P.x,Ct.array[Et+3]=P.y,Ct.array[Et+4]=L.x,Ct.array[Et+5]=L.y,Et+=6}else if(3===Ct.size){var Yt;if(Yt="c"===Ct.type?["r","g","b"]:["x","y","z"],void 0===Ct.boundTo||"vertices"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)_=Vt[Ut[T]],A=Ct.value[_.a],P=Ct.value[_.b],L=Ct.value[_.c],Ct.array[Et]=A[Yt[0]],Ct.array[Et+1]=A[Yt[1]],Ct.array[Et+2]=A[Yt[2]],Ct.array[Et+3]=P[Yt[0]],Ct.array[Et+4]=P[Yt[1]],Ct.array[Et+5]=P[Yt[2]],Ct.array[Et+6]=L[Yt[0]],Ct.array[Et+7]=L[Yt[1]],Ct.array[Et+8]=L[Yt[2]],Et+=9;else if("faces"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)L=P=A=gt=Ct.value[Ut[T]],Ct.array[Et]=A[Yt[0]],Ct.array[Et+1]=A[Yt[1]],Ct.array[Et+2]=A[Yt[2]],Ct.array[Et+3]=P[Yt[0]],Ct.array[Et+4]=P[Yt[1]],Ct.array[Et+5]=P[Yt[2]],Ct.array[Et+6]=L[Yt[0]],Ct.array[Et+7]=L[Yt[1]],Ct.array[Et+8]=L[Yt[2]],Et+=9;else if("faceVertices"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)A=(gt=Ct.value[Ut[T]])[0],P=gt[1],L=gt[2],Ct.array[Et]=A[Yt[0]],Ct.array[Et+1]=A[Yt[1]],Ct.array[Et+2]=A[Yt[2]],Ct.array[Et+3]=P[Yt[0]],Ct.array[Et+4]=P[Yt[1]],Ct.array[Et+5]=P[Yt[2]],Ct.array[Et+6]=L[Yt[0]],Ct.array[Et+7]=L[Yt[1]],Ct.array[Et+8]=L[Yt[2]],Et+=9}else if(4===Ct.size)if(void 0===Ct.boundTo||"vertices"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)_=Vt[Ut[T]],A=Ct.value[_.a],P=Ct.value[_.b],L=Ct.value[_.c],Ct.array[Et]=A.x,Ct.array[Et+1]=A.y,Ct.array[Et+2]=A.z,Ct.array[Et+3]=A.w,Ct.array[Et+4]=P.x,Ct.array[Et+5]=P.y,Ct.array[Et+6]=P.z,Ct.array[Et+7]=P.w,Ct.array[Et+8]=L.x,Ct.array[Et+9]=L.y,Ct.array[Et+10]=L.z,Ct.array[Et+11]=L.w,Et+=12;else if("faces"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)L=P=A=gt=Ct.value[Ut[T]],Ct.array[Et]=A.x,Ct.array[Et+1]=A.y,Ct.array[Et+2]=A.z,Ct.array[Et+3]=A.w,Ct.array[Et+4]=P.x,Ct.array[Et+5]=P.y,Ct.array[Et+6]=P.z,Ct.array[Et+7]=P.w,Ct.array[Et+8]=L.x,Ct.array[Et+9]=L.y,Ct.array[Et+10]=L.z,Ct.array[Et+11]=L.w,Et+=12;else if("faceVertices"===Ct.boundTo)for(T=0,R=Ut.length;T<R;T++)A=(gt=Ct.value[Ut[T]])[0],P=gt[1],L=gt[2],Ct.array[Et]=A.x,Ct.array[Et+1]=A.y,Ct.array[Et+2]=A.z,Ct.array[Et+3]=A.w,Ct.array[Et+4]=P.x,Ct.array[Et+5]=P.y,Ct.array[Et+6]=P.z,Ct.array[Et+7]=P.w,Ct.array[Et+8]=L.x,Ct.array[Et+9]=L.y,Ct.array[Et+10]=L.z,Ct.array[Et+11]=L.w,Et+=12;We.bindBuffer(We.ARRAY_BUFFER,Ct.buffer),We.bufferData(We.ARRAY_BUFFER,Ct.array,E)}g&&(delete f.__inittedArrays,delete f.__colorArray,delete f.__normalArray,delete f.__tangentArray,delete f.__uvArray,delete f.__uv2Array,delete f.__faceArray,delete f.__vertexArray,delete f.__lineArray,delete f.__skinIndexArray,delete f.__skinWeightArray)}}}e.verticesNeedUpdate=!1,e.morphTargetsNeedUpdate=!1,e.elementsNeedUpdate=!1,e.uvsNeedUpdate=!1,e.normalsNeedUpdate=!1,e.colorsNeedUpdate=!1,e.tangentsNeedUpdate=!1,d.attributes&&Ge(d)}else if(t instanceof THREE.Line){if(p=(d=Ue(t,e)).attributes&&Ie(d),e.verticesNeedUpdate||e.colorsNeedUpdate||e.lineDistancesNeedUpdate||p){var Kt,Qt,Zt,Jt,$t,te,ee,ie,re,ne,ae,oe,se=We.DYNAMIC_DRAW,he=e.vertices,le=e.colors,ce=e.lineDistances,ue=he.length,de=le.length,pe=ce.length,fe=e.__vertexArray,me=e.__colorArray,Ee=e.__lineDistanceArray,ge=e.colorsNeedUpdate,ve=e.lineDistancesNeedUpdate,ye=e.__webglCustomAttributesList;if(e.verticesNeedUpdate){for(Kt=0;Kt<ue;Kt++)Jt=he[Kt],fe[$t=3*Kt]=Jt.x,fe[$t+1]=Jt.y,fe[$t+2]=Jt.z;We.bindBuffer(We.ARRAY_BUFFER,e.__webglVertexBuffer),We.bufferData(We.ARRAY_BUFFER,fe,se)}if(ge){for(Qt=0;Qt<de;Qt++)te=le[Qt],me[$t=3*Qt]=te.r,me[$t+1]=te.g,me[$t+2]=te.b;We.bindBuffer(We.ARRAY_BUFFER,e.__webglColorBuffer),We.bufferData(We.ARRAY_BUFFER,me,se)}if(ve){for(Zt=0;Zt<pe;Zt++)Ee[Zt]=ce[Zt];We.bindBuffer(We.ARRAY_BUFFER,e.__webglLineDistanceBuffer),We.bufferData(We.ARRAY_BUFFER,Ee,se)}if(ye)for(ee=0,ie=ye.length;ee<ie;ee++)if((oe=ye[ee]).needsUpdate&&(void 0===oe.boundTo||"vertices"===oe.boundTo)){if($t=0,ne=oe.value.length,1===oe.size)for(re=0;re<ne;re++)oe.array[re]=oe.value[re];else if(2===oe.size)for(re=0;re<ne;re++)ae=oe.value[re],oe.array[$t]=ae.x,oe.array[$t+1]=ae.y,$t+=2;else if(3===oe.size)if("c"===oe.type)for(re=0;re<ne;re++)ae=oe.value[re],oe.array[$t]=ae.r,oe.array[$t+1]=ae.g,oe.array[$t+2]=ae.b,$t+=3;else for(re=0;re<ne;re++)ae=oe.value[re],oe.array[$t]=ae.x,oe.array[$t+1]=ae.y,oe.array[$t+2]=ae.z,$t+=3;else if(4===oe.size)for(re=0;re<ne;re++)ae=oe.value[re],oe.array[$t]=ae.x,oe.array[$t+1]=ae.y,oe.array[$t+2]=ae.z,oe.array[$t+3]=ae.w,$t+=4;We.bindBuffer(We.ARRAY_BUFFER,oe.buffer),We.bufferData(We.ARRAY_BUFFER,oe.array,se),oe.needsUpdate=!1}}e.verticesNeedUpdate=!1,e.colorsNeedUpdate=!1,e.lineDistancesNeedUpdate=!1,d.attributes&&Ge(d)}else if(t instanceof THREE.PointCloud){if(p=(d=Ue(t,e)).attributes&&Ie(d),e.verticesNeedUpdate||e.colorsNeedUpdate||p){var Te,Re,_e,xe,be,we,He,Me,Se,Ce,Ae,Pe=We.DYNAMIC_DRAW,Le=e.vertices,ke=Le.length,De=e.colors,Fe=De.length,ze=e.__vertexArray,Be=e.__colorArray,Oe=e.colorsNeedUpdate,Ne=e.__webglCustomAttributesList;if(e.verticesNeedUpdate){for(Te=0;Te<ke;Te++)_e=Le[Te],ze[xe=3*Te]=_e.x,ze[xe+1]=_e.y,ze[xe+2]=_e.z;We.bindBuffer(We.ARRAY_BUFFER,e.__webglVertexBuffer),We.bufferData(We.ARRAY_BUFFER,ze,Pe)}if(Oe){for(Re=0;Re<Fe;Re++)be=De[Re],Be[xe=3*Re]=be.r,Be[xe+1]=be.g,Be[xe+2]=be.b;We.bindBuffer(We.ARRAY_BUFFER,e.__webglColorBuffer),We.bufferData(We.ARRAY_BUFFER,Be,Pe)}if(Ne)for(we=0,He=Ne.length;we<He;we++){if((Ae=Ne[we]).needsUpdate&&(void 0===Ae.boundTo||"vertices"===Ae.boundTo))if(Se=Ae.value.length,xe=0,1===Ae.size)for(Me=0;Me<Se;Me++)Ae.array[Me]=Ae.value[Me];else if(2===Ae.size)for(Me=0;Me<Se;Me++)Ce=Ae.value[Me],Ae.array[xe]=Ce.x,Ae.array[xe+1]=Ce.y,xe+=2;else if(3===Ae.size)if("c"===Ae.type)for(Me=0;Me<Se;Me++)Ce=Ae.value[Me],Ae.array[xe]=Ce.r,Ae.array[xe+1]=Ce.g,Ae.array[xe+2]=Ce.b,xe+=3;else for(Me=0;Me<Se;Me++)Ce=Ae.value[Me],Ae.array[xe]=Ce.x,Ae.array[xe+1]=Ce.y,Ae.array[xe+2]=Ce.z,xe+=3;else if(4===Ae.size)for(Me=0;Me<Se;Me++)Ce=Ae.value[Me],Ae.array[xe]=Ce.x,Ae.array[xe+1]=Ce.y,Ae.array[xe+2]=Ce.z,Ae.array[xe+3]=Ce.w,xe+=4;We.bindBuffer(We.ARRAY_BUFFER,Ae.buffer),We.bufferData(We.ARRAY_BUFFER,Ae.array,Pe),Ae.needsUpdate=!1}}e.verticesNeedUpdate=!1,e.colorsNeedUpdate=!1,d.attributes&&Ge(d)}}function Ie(t){for(var e in t.attributes)if(t.attributes[e].needsUpdate)return!0;return!1}function Ge(t){for(var e in t.attributes)t.attributes[e].needsUpdate=!1}function T(t){!0===t.transparent?G.setBlending(t.blending,t.blendEquation,t.blendSrc,t.blendDst,t.blendEquationAlpha,t.blendSrcAlpha,t.blendDstAlpha):G.setBlending(THREE.NoBlending),G.setDepthTest(t.depthTest),G.setDepthWrite(t.depthWrite),G.setColorWrite(t.colorWrite),G.setPolygonOffset(t.polygonOffset,t.polygonOffsetFactor,t.polygonOffsetUnits)}function R(t,e,i,r,n){var a,o,s,h;if(Ce=0,r.needsUpdate){r.program&&je(r),r.addEventListener("dispose",Ne);var l,c=Xe[r.type];if(c){var u=THREE.ShaderLib[c];r.__webglShader={uniforms:THREE.UniformsUtils.clone(u.uniforms),vertexShader:u.vertexShader,fragmentShader:u.fragmentShader}}else r.__webglShader={uniforms:r.uniforms,vertexShader:r.vertexShader,fragmentShader:r.fragmentShader};for(var d=0,p=0,f=0,m=0,E=0,g=e.length;E<g;E++){var v=e[E];v.onlyShadow||!1===v.visible||(v instanceof THREE.DirectionalLight&&d++,v instanceof THREE.PointLight&&p++,v instanceof THREE.SpotLight&&f++,v instanceof THREE.HemisphereLight&&m++)}a=d,o=p,s=f,h=m;for(var y,T=0,R=0,_=e.length;R<_;R++){var x=e[R];x.castShadow&&(x instanceof THREE.SpotLight&&T++,x instanceof THREE.DirectionalLight&&!x.shadowCascade&&T++)}if(y=T,ze&&n&&n.skeleton&&n.skeleton.useVertexTexture)l=1024;else{var b=We.getParameter(We.MAX_VERTEX_UNIFORM_VECTORS),w=Math.floor((b-20)/4);void 0!==n&&n instanceof THREE.SkinnedMesh&&(w=Math.min(n.skeleton.bones.length,w))<n.skeleton.bones.length&&THREE.warn("WebGLRenderer: too many bones - "+n.skeleton.bones.length+", this GPU supports just "+w+" (try OpenGL instead of ANGLE)"),l=w}var H={precision:_e,supportsVertexTextures:Fe,map:!!r.map,envMap:!!r.envMap,envMapMode:r.envMap&&r.envMap.mapping,lightMap:!!r.lightMap,bumpMap:!!r.bumpMap,normalMap:!!r.normalMap,specularMap:!!r.specularMap,alphaMap:!!r.alphaMap,combine:r.combine,vertexColors:r.vertexColors,fog:i,useFog:r.fog,fogExp:i instanceof THREE.FogExp2,flatShading:r.shading===THREE.FlatShading,sizeAttenuation:r.sizeAttenuation,logarithmicDepthBuffer:xe,skinning:r.skinning,maxBones:l,useVertexTexture:ze&&n&&n.skeleton&&n.skeleton.useVertexTexture,morphTargets:r.morphTargets,morphNormals:r.morphNormals,maxMorphTargets:be.maxMorphTargets,maxMorphNormals:be.maxMorphNormals,maxDirLights:a,maxPointLights:o,maxSpotLights:s,maxHemiLights:h,maxShadows:y,shadowMapEnabled:be.shadowMapEnabled&&n.receiveShadow&&0<y,shadowMapType:be.shadowMapType,shadowMapDebug:be.shadowMapDebug,shadowMapCascade:be.shadowMapCascade,alphaTest:r.alphaTest,metal:r.metal,wrapAround:r.wrapAround,doubleSided:r.side===THREE.DoubleSide,flipSided:r.side===THREE.BackSide},M=[];if(c?M.push(c):(M.push(r.fragmentShader),M.push(r.vertexShader)),void 0!==r.defines)for(var S in r.defines)M.push(S),M.push(r.defines[S]);for(S in H)M.push(S),M.push(H[S]);for(var C,A=M.join(),P=0,L=we.length;P<L;P++){var k=we[P];if(k.code===A){(C=k).usedTimes++;break}}void 0===C&&(C=new THREE.WebGLProgram(be,A,r,H),we.push(C),be.info.memory.programs=we.length);var D=(r.program=C).attributes;if(r.morphTargets)for(var F="morphTarget",z=r.numSupportedMorphTargets=0;z<be.maxMorphTargets;z++)0<=D[F+z]&&r.numSupportedMorphTargets++;if(r.morphNormals)for(F="morphNormal",z=r.numSupportedMorphNormals=0;z<be.maxMorphNormals;z++)0<=D[F+z]&&r.numSupportedMorphNormals++;for(var B in r.uniformsList=[],r.__webglShader.uniforms){var O=r.program.uniforms[B];O&&r.uniformsList.push([r.__webglShader.uniforms[B],O])}r.needsUpdate=!1}r.morphTargets&&!n.__webglMorphTargetInfluences&&(n.__webglMorphTargetInfluences=new Float32Array(be.maxMorphTargets));var N=!1,U=!1,V=!1,I=r.program,G=I.uniforms,W=r.__webglShader.uniforms;if(I.id!==He&&(We.useProgram(I.program),He=I.id,V=U=N=!0),r.id!==Me&&(-1===Me&&(V=!0),Me=r.id,U=!0),(N||t!==Se)&&(We.uniformMatrix4fv(G.projectionMatrix,!1,t.projectionMatrix.elements),xe&&We.uniform1f(G.logDepthBufFC,2/(Math.log(t.far+1)/Math.LN2)),t!==Se&&(Se=t),(r instanceof THREE.ShaderMaterial||r instanceof THREE.MeshPhongMaterial||r.envMap)&&null!==G.cameraPosition&&(Ae.setFromMatrixPosition(t.matrixWorld),We.uniform3f(G.cameraPosition,Ae.x,Ae.y,Ae.z)),(r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshBasicMaterial||r instanceof THREE.ShaderMaterial||r.skinning)&&null!==G.viewMatrix&&We.uniformMatrix4fv(G.viewMatrix,!1,t.matrixWorldInverse.elements)),r.skinning)if(n.bindMatrix&&null!==G.bindMatrix&&We.uniformMatrix4fv(G.bindMatrix,!1,n.bindMatrix.elements),n.bindMatrixInverse&&null!==G.bindMatrixInverse&&We.uniformMatrix4fv(G.bindMatrixInverse,!1,n.bindMatrixInverse.elements),ze&&n.skeleton&&n.skeleton.useVertexTexture){if(null!==G.boneTexture){var j=Ee();We.uniform1i(G.boneTexture,j),be.setTexture(n.skeleton.boneTexture,j)}null!==G.boneTextureWidth&&We.uniform1i(G.boneTextureWidth,n.skeleton.boneTextureWidth),null!==G.boneTextureHeight&&We.uniform1i(G.boneTextureHeight,n.skeleton.boneTextureHeight)}else n.skeleton&&n.skeleton.boneMatrices&&null!==G.boneGlobalMatrices&&We.uniformMatrix4fv(G.boneGlobalMatrices,!1,n.skeleton.boneMatrices);if(U){if(i&&r.fog&&(W.fogColor.value=i.color,i instanceof THREE.Fog?(W.fogNear.value=i.near,W.fogFar.value=i.far):i instanceof THREE.FogExp2&&(W.fogDensity.value=i.density)),r instanceof THREE.MeshPhongMaterial||r instanceof THREE.MeshLambertMaterial||r.lights){if(Le){V=!0;var q,X,Y,K,Q,Z,J,$,tt=0,et=0,it=0,rt=ke,nt=rt.directional.colors,at=rt.directional.positions,ot=rt.point.colors,st=rt.point.positions,ht=rt.point.distances,lt=rt.point.decays,ct=rt.spot.colors,ut=rt.spot.positions,dt=rt.spot.distances,pt=rt.spot.directions,ft=rt.spot.anglesCos,mt=rt.spot.exponents,Et=rt.spot.decays,gt=rt.hemi.skyColors,vt=rt.hemi.groundColors,yt=rt.hemi.positions,Tt=0,Rt=0,_t=0,xt=0,bt=0,wt=0,Ht=0,Mt=0,St=0,Ct=0,At=0,Pt=0;for(q=0,X=e.length;q<X;q++)(Y=e[q]).onlyShadow||(K=Y.color,J=Y.intensity,$=Y.distance,Y instanceof THREE.AmbientLight?Y.visible&&(tt+=K.r,et+=K.g,it+=K.b):Y instanceof THREE.DirectionalLight?(bt+=1,Y.visible&&(Pe.setFromMatrixPosition(Y.matrixWorld),Ae.setFromMatrixPosition(Y.target.matrixWorld),Pe.sub(Ae),Pe.normalize(),at[St=3*Tt]=Pe.x,at[St+1]=Pe.y,at[St+2]=Pe.z,ge(nt,St,K,J),Tt+=1)):Y instanceof THREE.PointLight?(wt+=1,Y.visible&&(ge(ot,Ct=3*Rt,K,J),Ae.setFromMatrixPosition(Y.matrixWorld),st[Ct]=Ae.x,st[Ct+1]=Ae.y,st[Ct+2]=Ae.z,ht[Rt]=$,lt[Rt]=0===Y.distance?0:Y.decay,Rt+=1)):Y instanceof THREE.SpotLight?(Ht+=1,Y.visible&&(ge(ct,At=3*_t,K,J),Pe.setFromMatrixPosition(Y.matrixWorld),ut[At]=Pe.x,ut[At+1]=Pe.y,ut[At+2]=Pe.z,dt[_t]=$,Ae.setFromMatrixPosition(Y.target.matrixWorld),Pe.sub(Ae),Pe.normalize(),pt[At]=Pe.x,pt[At+1]=Pe.y,pt[At+2]=Pe.z,ft[_t]=Math.cos(Y.angle),mt[_t]=Y.exponent,Et[_t]=0===Y.distance?0:Y.decay,_t+=1)):Y instanceof THREE.HemisphereLight&&(Mt+=1,Y.visible&&(Pe.setFromMatrixPosition(Y.matrixWorld),Pe.normalize(),yt[Pt=3*xt]=Pe.x,yt[Pt+1]=Pe.y,yt[Pt+2]=Pe.z,Q=Y.color,Z=Y.groundColor,ge(gt,Pt,Q,J),ge(vt,Pt,Z,J),xt+=1)));for(q=3*Tt,X=Math.max(nt.length,3*bt);q<X;q++)nt[q]=0;for(q=3*Rt,X=Math.max(ot.length,3*wt);q<X;q++)ot[q]=0;for(q=3*_t,X=Math.max(ct.length,3*Ht);q<X;q++)ct[q]=0;for(q=3*xt,X=Math.max(gt.length,3*Mt);q<X;q++)gt[q]=0;for(q=3*xt,X=Math.max(vt.length,3*Mt);q<X;q++)vt[q]=0;rt.directional.length=Tt,rt.point.length=Rt,rt.spot.length=_t,rt.hemi.length=xt,rt.ambient[0]=tt,rt.ambient[1]=et,rt.ambient[2]=it,Le=!1}if(V){var Lt=ke;W.ambientLightColor.value=Lt.ambient,W.directionalLightColor.value=Lt.directional.colors,W.directionalLightDirection.value=Lt.directional.positions,W.pointLightColor.value=Lt.point.colors,W.pointLightPosition.value=Lt.point.positions,W.pointLightDistance.value=Lt.point.distances,W.pointLightDecay.value=Lt.point.decays,W.spotLightColor.value=Lt.spot.colors,W.spotLightPosition.value=Lt.spot.positions,W.spotLightDistance.value=Lt.spot.distances,W.spotLightDirection.value=Lt.spot.directions,W.spotLightAngleCos.value=Lt.spot.anglesCos,W.spotLightExponent.value=Lt.spot.exponents,W.spotLightDecay.value=Lt.spot.decays,W.hemisphereLightSkyColor.value=Lt.hemi.skyColors,W.hemisphereLightGroundColor.value=Lt.hemi.groundColors,W.hemisphereLightDirection.value=Lt.hemi.positions,me(W,!0)}else me(W,!1)}if(r instanceof THREE.MeshBasicMaterial||r instanceof THREE.MeshLambertMaterial||r instanceof THREE.MeshPhongMaterial){var kt;if(W.opacity.value=r.opacity,W.diffuse.value=r.color,W.map.value=r.map,W.lightMap.value=r.lightMap,W.specularMap.value=r.specularMap,W.alphaMap.value=r.alphaMap,r.bumpMap&&(W.bumpMap.value=r.bumpMap,W.bumpScale.value=r.bumpScale),r.normalMap&&(W.normalMap.value=r.normalMap,W.normalScale.value.copy(r.normalScale)),r.map?kt=r.map:r.specularMap?kt=r.specularMap:r.normalMap?kt=r.normalMap:r.bumpMap?kt=r.bumpMap:r.alphaMap&&(kt=r.alphaMap),void 0!==kt){var Dt=kt.offset,Ft=kt.repeat;W.offsetRepeat.value.set(Dt.x,Dt.y,Ft.x,Ft.y)}W.envMap.value=r.envMap,W.flipEnvMap.value=r.envMap instanceof THREE.WebGLRenderTargetCube?1:-1,W.reflectivity.value=r.reflectivity,W.refractionRatio.value=r.refractionRatio}if(r instanceof THREE.LineBasicMaterial)W.diffuse.value=r.color,W.opacity.value=r.opacity;else if(r instanceof THREE.LineDashedMaterial)W.diffuse.value=r.color,W.opacity.value=r.opacity,W.dashSize.value=r.dashSize,W.totalSize.value=r.dashSize+r.gapSize,W.scale.value=r.scale;else if(r instanceof THREE.PointCloudMaterial){if(W.psColor.value=r.color,W.opacity.value=r.opacity,W.size.value=r.size,W.scale.value=Re.height/2,W.map.value=r.map,null!==r.map){var zt=r.map.offset,Bt=r.map.repeat;W.offsetRepeat.value.set(zt.x,zt.y,Bt.x,Bt.y)}}else r instanceof THREE.MeshPhongMaterial?(W.shininess.value=r.shininess,W.emissive.value=r.emissive,W.specular.value=r.specular,r.wrapAround&&W.wrapRGB.value.copy(r.wrapRGB)):r instanceof THREE.MeshLambertMaterial?(W.emissive.value=r.emissive,r.wrapAround&&W.wrapRGB.value.copy(r.wrapRGB)):r instanceof THREE.MeshDepthMaterial?(W.mNear.value=t.near,W.mFar.value=t.far,W.opacity.value=r.opacity):r instanceof THREE.MeshNormalMaterial&&(W.opacity.value=r.opacity);if(n.receiveShadow&&!r._shadowPass&&W.shadowMatrix)for(var Ot=0,Nt=0,Ut=e.length;Nt<Ut;Nt++){var Vt=e[Nt];Vt.castShadow&&(Vt instanceof THREE.SpotLight||Vt instanceof THREE.DirectionalLight&&!Vt.shadowCascade)&&(W.shadowMap.value[Ot]=Vt.shadowMap,W.shadowMapSize.value[Ot]=Vt.shadowMapSize,W.shadowMatrix.value[Ot]=Vt.shadowMatrix,W.shadowDarkness.value[Ot]=Vt.shadowDarkness,W.shadowBias.value[Ot]=Vt.shadowBias,Ot++)}for(var It,Gt,Wt,jt=r.uniformsList,qt=0,Xt=jt.length;qt<Xt;qt++){var Yt=jt[qt][0];if(!1!==Yt.needsUpdate){var Kt=Yt.type,Qt=Yt.value,Zt=jt[qt][1];switch(Kt){case"1i":We.uniform1i(Zt,Qt);break;case"1f":We.uniform1f(Zt,Qt);break;case"2f":We.uniform2f(Zt,Qt[0],Qt[1]);break;case"3f":We.uniform3f(Zt,Qt[0],Qt[1],Qt[2]);break;case"4f":We.uniform4f(Zt,Qt[0],Qt[1],Qt[2],Qt[3]);break;case"1iv":We.uniform1iv(Zt,Qt);break;case"3iv":We.uniform3iv(Zt,Qt);break;case"1fv":We.uniform1fv(Zt,Qt);break;case"2fv":We.uniform2fv(Zt,Qt);break;case"3fv":We.uniform3fv(Zt,Qt);break;case"4fv":We.uniform4fv(Zt,Qt);break;case"Matrix3fv":We.uniformMatrix3fv(Zt,!1,Qt);break;case"Matrix4fv":We.uniformMatrix4fv(Zt,!1,Qt);break;case"i":We.uniform1i(Zt,Qt);break;case"f":We.uniform1f(Zt,Qt);break;case"v2":We.uniform2f(Zt,Qt.x,Qt.y);break;case"v3":We.uniform3f(Zt,Qt.x,Qt.y,Qt.z);break;case"v4":We.uniform4f(Zt,Qt.x,Qt.y,Qt.z,Qt.w);break;case"c":We.uniform3f(Zt,Qt.r,Qt.g,Qt.b);break;case"iv1":We.uniform1iv(Zt,Qt);break;case"iv":We.uniform3iv(Zt,Qt);break;case"fv1":We.uniform1fv(Zt,Qt);break;case"fv":We.uniform3fv(Zt,Qt);break;case"v2v":void 0===Yt._array&&(Yt._array=new Float32Array(2*Qt.length));for(var Jt=0,$t=Qt.length;Jt<$t;Jt++)Wt=2*Jt,Yt._array[Wt]=Qt[Jt].x,Yt._array[Wt+1]=Qt[Jt].y;We.uniform2fv(Zt,Yt._array);break;case"v3v":for(void 0===Yt._array&&(Yt._array=new Float32Array(3*Qt.length)),Jt=0,$t=Qt.length;Jt<$t;Jt++)Wt=3*Jt,Yt._array[Wt]=Qt[Jt].x,Yt._array[Wt+1]=Qt[Jt].y,Yt._array[Wt+2]=Qt[Jt].z;We.uniform3fv(Zt,Yt._array);break;case"v4v":for(void 0===Yt._array&&(Yt._array=new Float32Array(4*Qt.length)),Jt=0,$t=Qt.length;Jt<$t;Jt++)Wt=4*Jt,Yt._array[Wt]=Qt[Jt].x,Yt._array[Wt+1]=Qt[Jt].y,Yt._array[Wt+2]=Qt[Jt].z,Yt._array[Wt+3]=Qt[Jt].w;We.uniform4fv(Zt,Yt._array);break;case"m3":We.uniformMatrix3fv(Zt,!1,Qt.elements);break;case"m3v":for(void 0===Yt._array&&(Yt._array=new Float32Array(9*Qt.length)),Jt=0,$t=Qt.length;Jt<$t;Jt++)Qt[Jt].flattenToArrayOffset(Yt._array,9*Jt);We.uniformMatrix3fv(Zt,!1,Yt._array);break;case"m4":We.uniformMatrix4fv(Zt,!1,Qt.elements);break;case"m4v":for(void 0===Yt._array&&(Yt._array=new Float32Array(16*Qt.length)),Jt=0,$t=Qt.length;Jt<$t;Jt++)Qt[Jt].flattenToArrayOffset(Yt._array,16*Jt);We.uniformMatrix4fv(Zt,!1,Yt._array);break;case"t":if(It=Qt,Gt=Ee(),We.uniform1i(Zt,Gt),!It)continue;if(It instanceof THREE.CubeTexture||It.image instanceof Array&&6===It.image.length){var te=It,ee=Gt;if(6===te.image.length)if(te.needsUpdate){te.image.__webglTextureCube||(te.addEventListener("dispose",Oe),te.image.__webglTextureCube=We.createTexture(),be.info.memory.textures++),We.activeTexture(We.TEXTURE0+ee),We.bindTexture(We.TEXTURE_CUBE_MAP,te.image.__webglTextureCube),We.pixelStorei(We.UNPACK_FLIP_Y_WEBGL,te.flipY);for(var ie=te instanceof THREE.CompressedTexture,re=te.image[0]instanceof THREE.DataTexture,ne=[],ae=0;ae<6;ae++)ne[ae]=!be.autoScaleCubemaps||ie||re?re?te.image[ae].image:te.image[ae]:ye(te.image[ae],De);var oe=ne[0],se=THREE.Math.isPowerOfTwo(oe.width)&&THREE.Math.isPowerOfTwo(oe.height),he=Te(te.format),le=Te(te.type);for(ve(We.TEXTURE_CUBE_MAP,te,se),ae=0;ae<6;ae++)if(ie)for(var ce,ue=ne[ae].mipmaps,de=0,pe=ue.length;de<pe;de++)ce=ue[de],te.format!==THREE.RGBAFormat&&te.format!==THREE.RGBFormat?-1<Be().indexOf(he)?We.compressedTexImage2D(We.TEXTURE_CUBE_MAP_POSITIVE_X+ae,de,he,ce.width,ce.height,0,ce.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setCubeTexture()"):We.texImage2D(We.TEXTURE_CUBE_MAP_POSITIVE_X+ae,de,he,ce.width,ce.height,0,he,le,ce.data);else re?We.texImage2D(We.TEXTURE_CUBE_MAP_POSITIVE_X+ae,0,he,ne[ae].width,ne[ae].height,0,he,le,ne[ae].data):We.texImage2D(We.TEXTURE_CUBE_MAP_POSITIVE_X+ae,0,he,he,le,ne[ae]);te.generateMipmaps&&se&&We.generateMipmap(We.TEXTURE_CUBE_MAP),te.needsUpdate=!1,te.onUpdate&&te.onUpdate()}else We.activeTexture(We.TEXTURE0+ee),We.bindTexture(We.TEXTURE_CUBE_MAP,te.image.__webglTextureCube)}else if(It instanceof THREE.WebGLRenderTargetCube){var fe=It;We.activeTexture(We.TEXTURE0+Gt),We.bindTexture(We.TEXTURE_CUBE_MAP,fe.__webglTexture)}else be.setTexture(It,Gt);break;case"tv":for(void 0===Yt._array&&(Yt._array=[]),Jt=0,$t=Yt.value.length;Jt<$t;Jt++)Yt._array[Jt]=Ee();for(We.uniform1iv(Zt,Yt._array),Jt=0,$t=Yt.value.length;Jt<$t;Jt++)It=Yt.value[Jt],Gt=Yt._array[Jt],It&&be.setTexture(It,Gt);break;default:THREE.warn("THREE.WebGLRenderer: Unknown uniform type: "+Kt)}}}}return We.uniformMatrix4fv(G.modelViewMatrix,!1,n._modelViewMatrix.elements),G.normalMatrix&&We.uniformMatrix3fv(G.normalMatrix,!1,n._normalMatrix.elements),null!==G.modelMatrix&&We.uniformMatrix4fv(G.modelMatrix,!1,n.matrixWorld.elements),I}function me(t,e){t.ambientLightColor.needsUpdate=e,t.directionalLightColor.needsUpdate=e,t.directionalLightDirection.needsUpdate=e,t.pointLightColor.needsUpdate=e,t.pointLightPosition.needsUpdate=e,t.pointLightDistance.needsUpdate=e,t.pointLightDecay.needsUpdate=e,t.spotLightColor.needsUpdate=e,t.spotLightPosition.needsUpdate=e,t.spotLightDistance.needsUpdate=e,t.spotLightDirection.needsUpdate=e,t.spotLightAngleCos.needsUpdate=e,t.spotLightExponent.needsUpdate=e,t.spotLightDecay.needsUpdate=e,t.hemisphereLightSkyColor.needsUpdate=e,t.hemisphereLightGroundColor.needsUpdate=e,t.hemisphereLightDirection.needsUpdate=e}function Ee(){var t=Ce;return K<=t&&THREE.warn("WebGLRenderer: trying to use "+t+" texture units while this GPU supports only "+K),Ce+=1,t}function _(t,e){t._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,t.matrixWorld),t._normalMatrix.getNormalMatrix(t._modelViewMatrix)}function ge(t,e,i,r){t[e]=i.r*r,t[e+1]=i.g*r,t[e+2]=i.b*r}function ve(t,e,i){i?(We.texParameteri(t,We.TEXTURE_WRAP_S,Te(e.wrapS)),We.texParameteri(t,We.TEXTURE_WRAP_T,Te(e.wrapT)),We.texParameteri(t,We.TEXTURE_MAG_FILTER,Te(e.magFilter)),We.texParameteri(t,We.TEXTURE_MIN_FILTER,Te(e.minFilter))):(We.texParameteri(t,We.TEXTURE_WRAP_S,We.CLAMP_TO_EDGE),We.texParameteri(t,We.TEXTURE_WRAP_T,We.CLAMP_TO_EDGE),e.wrapS===THREE.ClampToEdgeWrapping&&e.wrapT===THREE.ClampToEdgeWrapping||THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.wrapS and Texture.wrapT should be set to THREE.ClampToEdgeWrapping. ( "+e.sourceFile+" )"),We.texParameteri(t,We.TEXTURE_MAG_FILTER,r(e.magFilter)),We.texParameteri(t,We.TEXTURE_MIN_FILTER,r(e.minFilter)),e.minFilter!==THREE.NearestFilter&&e.minFilter!==THREE.LinearFilter&&THREE.warn("THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. ( "+e.sourceFile+" )")),(i=W.get("EXT_texture_filter_anisotropic"))&&e.type!==THREE.FloatType&&e.type!==THREE.HalfFloatType&&(1<e.anisotropy||e.__currentAnisotropy)&&(We.texParameterf(t,i.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(e.anisotropy,be.getMaxAnisotropy())),e.__currentAnisotropy=e.anisotropy)}function ye(t,e){if(t.width>e||t.height>e){var i=e/Math.max(t.width,t.height),r=document.createElement("canvas");return r.width=Math.floor(t.width*i),r.height=Math.floor(t.height*i),r.getContext("2d").drawImage(t,0,0,t.width,t.height,0,0,r.width,r.height),THREE.warn("THREE.WebGLRenderer: image is too big ("+t.width+"x"+t.height+"). Resized to "+r.width+"x"+r.height,t),r}return t}function h(t,e){We.bindRenderbuffer(We.RENDERBUFFER,t),e.depthBuffer&&!e.stencilBuffer?(We.renderbufferStorage(We.RENDERBUFFER,We.DEPTH_COMPONENT16,e.width,e.height),We.framebufferRenderbuffer(We.FRAMEBUFFER,We.DEPTH_ATTACHMENT,We.RENDERBUFFER,t)):e.depthBuffer&&e.stencilBuffer?(We.renderbufferStorage(We.RENDERBUFFER,We.DEPTH_STENCIL,e.width,e.height),We.framebufferRenderbuffer(We.FRAMEBUFFER,We.DEPTH_STENCIL_ATTACHMENT,We.RENDERBUFFER,t)):We.renderbufferStorage(We.RENDERBUFFER,We.RGBA4,e.width,e.height)}function r(t){return t===THREE.NearestFilter||t===THREE.NearestMipMapNearestFilter||t===THREE.NearestMipMapLinearFilter?We.NEAREST:We.LINEAR}function Te(t){var e;if(t===THREE.RepeatWrapping)return We.REPEAT;if(t===THREE.ClampToEdgeWrapping)return We.CLAMP_TO_EDGE;if(t===THREE.MirroredRepeatWrapping)return We.MIRRORED_REPEAT;if(t===THREE.NearestFilter)return We.NEAREST;if(t===THREE.NearestMipMapNearestFilter)return We.NEAREST_MIPMAP_NEAREST;if(t===THREE.NearestMipMapLinearFilter)return We.NEAREST_MIPMAP_LINEAR;if(t===THREE.LinearFilter)return We.LINEAR;if(t===THREE.LinearMipMapNearestFilter)return We.LINEAR_MIPMAP_NEAREST;if(t===THREE.LinearMipMapLinearFilter)return We.LINEAR_MIPMAP_LINEAR;if(t===THREE.UnsignedByteType)return We.UNSIGNED_BYTE;if(t===THREE.UnsignedShort4444Type)return We.UNSIGNED_SHORT_4_4_4_4;if(t===THREE.UnsignedShort5551Type)return We.UNSIGNED_SHORT_5_5_5_1;if(t===THREE.UnsignedShort565Type)return We.UNSIGNED_SHORT_5_6_5;if(t===THREE.ByteType)return We.BYTE;if(t===THREE.ShortType)return We.SHORT;if(t===THREE.UnsignedShortType)return We.UNSIGNED_SHORT;if(t===THREE.IntType)return We.INT;if(t===THREE.UnsignedIntType)return We.UNSIGNED_INT;if(t===THREE.FloatType)return We.FLOAT;if(null!==(e=W.get("OES_texture_half_float"))&&t===THREE.HalfFloatType)return e.HALF_FLOAT_OES;if(t===THREE.AlphaFormat)return We.ALPHA;if(t===THREE.RGBFormat)return We.RGB;if(t===THREE.RGBAFormat)return We.RGBA;if(t===THREE.LuminanceFormat)return We.LUMINANCE;if(t===THREE.LuminanceAlphaFormat)return We.LUMINANCE_ALPHA;if(t===THREE.AddEquation)return We.FUNC_ADD;if(t===THREE.SubtractEquation)return We.FUNC_SUBTRACT;if(t===THREE.ReverseSubtractEquation)return We.FUNC_REVERSE_SUBTRACT;if(t===THREE.ZeroFactor)return We.ZERO;if(t===THREE.OneFactor)return We.ONE;if(t===THREE.SrcColorFactor)return We.SRC_COLOR;if(t===THREE.OneMinusSrcColorFactor)return We.ONE_MINUS_SRC_COLOR;if(t===THREE.SrcAlphaFactor)return We.SRC_ALPHA;if(t===THREE.OneMinusSrcAlphaFactor)return We.ONE_MINUS_SRC_ALPHA;if(t===THREE.DstAlphaFactor)return We.DST_ALPHA;if(t===THREE.OneMinusDstAlphaFactor)return We.ONE_MINUS_DST_ALPHA;if(t===THREE.DstColorFactor)return We.DST_COLOR;if(t===THREE.OneMinusDstColorFactor)return We.ONE_MINUS_DST_COLOR;if(t===THREE.SrcAlphaSaturateFactor)return We.SRC_ALPHA_SATURATE;if(null!==(e=W.get("WEBGL_compressed_texture_s3tc"))){if(t===THREE.RGB_S3TC_DXT1_Format)return e.COMPRESSED_RGB_S3TC_DXT1_EXT;if(t===THREE.RGBA_S3TC_DXT1_Format)return e.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(t===THREE.RGBA_S3TC_DXT3_Format)return e.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(t===THREE.RGBA_S3TC_DXT5_Format)return e.COMPRESSED_RGBA_S3TC_DXT5_EXT}if(null!==(e=W.get("WEBGL_compressed_texture_pvrtc"))){if(t===THREE.RGB_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(t===THREE.RGB_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(t===THREE.RGBA_PVRTC_4BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(t===THREE.RGBA_PVRTC_2BPPV1_Format)return e.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}if(null!==(e=W.get("EXT_blend_minmax"))){if(t===THREE.MinEquation)return e.MIN_EXT;if(t===THREE.MaxEquation)return e.MAX_EXT}return 0}console.log("THREE.WebGLRenderer",THREE.REVISION);var Re=void 0!==(t=t||{}).canvas?t.canvas:document.createElement("canvas"),e=void 0!==t.context?t.context:null,x=1,_e=void 0!==t.precision?t.precision:"highp",i=void 0!==t.alpha&&t.alpha,n=void 0===t.depth||t.depth,a=void 0===t.stencil||t.stencil,o=void 0!==t.antialias&&t.antialias,s=void 0===t.premultipliedAlpha||t.premultipliedAlpha,l=void 0!==t.preserveDrawingBuffer&&t.preserveDrawingBuffer,xe=void 0!==t.logarithmicDepthBuffer&&t.logarithmicDepthBuffer,c=new THREE.Color(0),b=0,w=[],H={},M=[],S=[],C=[],A=[],P=[];this.domElement=Re,this.context=null,this.sortObjects=this.autoClearStencil=this.autoClearDepth=this.autoClearColor=this.autoClear=!0,this.gammaFactor=2,this.shadowMapEnabled=this.gammaOutput=this.gammaInput=!1,this.shadowMapType=THREE.PCFShadowMap,this.shadowMapCullFace=THREE.CullFaceFront,this.shadowMapCascade=this.shadowMapDebug=!1,this.maxMorphTargets=8,this.maxMorphNormals=4,this.autoScaleCubemaps=!0,this.info={memory:{programs:0,geometries:0,textures:0},render:{calls:0,vertices:0,faces:0,points:0}};var We,be=this,we=[],He=null,L=null,Me=-1,k="",Se=null,Ce=0,D=0,F=0,z=Re.width,B=Re.height,O=0,N=0,U=new THREE.Frustum,V=new THREE.Matrix4,Ae=new THREE.Vector3,Pe=new THREE.Vector3,Le=!0,ke={ambient:[0,0,0],directional:{length:0,colors:[],positions:[]},point:{length:0,colors:[],positions:[],distances:[],decays:[]},spot:{length:0,colors:[],positions:[],distances:[],directions:[],anglesCos:[],exponents:[],decays:[]},hemi:{length:0,skyColors:[],groundColors:[],positions:[]}};try{var I={alpha:i,depth:n,stencil:a,antialias:o,premultipliedAlpha:s,preserveDrawingBuffer:l};if(null===(We=e||Re.getContext("webgl",I)||Re.getContext("experimental-webgl",I))){if(null!==Re.getContext("webgl"))throw"Error creating WebGL context with your selected attributes.";throw"Error creating WebGL context."}Re.addEventListener("webglcontextlost",function(t){t.preventDefault(),X(),q(),H={}},!1)}catch(t){THREE.error("THREE.WebGLRenderer: "+t)}var G=new THREE.WebGLState(We,Te);void 0===We.getShaderPrecisionFormat&&(We.getShaderPrecisionFormat=function(){return{rangeMin:1,rangeMax:1,precision:1}});var W=new THREE.WebGLExtensions(We);W.get("OES_texture_float"),W.get("OES_texture_float_linear"),W.get("OES_texture_half_float"),W.get("OES_texture_half_float_linear"),W.get("OES_standard_derivatives"),xe&&W.get("EXT_frag_depth");var j=function(t,e,i,r){!0===s&&(t*=r,e*=r,i*=r),We.clearColor(t,e,i,r)},q=function(){We.clearColor(0,0,0,1),We.clearDepth(1),We.clearStencil(0),We.enable(We.DEPTH_TEST),We.depthFunc(We.LEQUAL),We.frontFace(We.CCW),We.cullFace(We.BACK),We.enable(We.CULL_FACE),We.enable(We.BLEND),We.blendEquation(We.FUNC_ADD),We.blendFunc(We.SRC_ALPHA,We.ONE_MINUS_SRC_ALPHA),We.viewport(D,F,z,B),j(c.r,c.g,c.b,b)},X=function(){Se=He=null,Me=-1,Le=!(k=""),G.reset()};q(),this.context=We,this.state=G;var Y,K=We.getParameter(We.MAX_TEXTURE_IMAGE_UNITS),Q=We.getParameter(We.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Z=We.getParameter(We.MAX_TEXTURE_SIZE),De=We.getParameter(We.MAX_CUBE_MAP_TEXTURE_SIZE),Fe=0<Q,ze=Fe&&W.get("OES_texture_float"),J=We.getShaderPrecisionFormat(We.VERTEX_SHADER,We.HIGH_FLOAT),$=We.getShaderPrecisionFormat(We.VERTEX_SHADER,We.MEDIUM_FLOAT),tt=We.getShaderPrecisionFormat(We.FRAGMENT_SHADER,We.HIGH_FLOAT),et=We.getShaderPrecisionFormat(We.FRAGMENT_SHADER,We.MEDIUM_FLOAT),Be=function(){if(void 0!==Y)return Y;if(Y=[],W.get("WEBGL_compressed_texture_pvrtc")||W.get("WEBGL_compressed_texture_s3tc"))for(var t=We.getParameter(We.COMPRESSED_TEXTURE_FORMATS),e=0;e<t.length;e++)Y.push(t[e]);return Y},it=0<J.precision&&0<tt.precision,rt=0<$.precision&&0<et.precision;"highp"!==_e||it||(rt?(_e="mediump",THREE.warn("THREE.WebGLRenderer: highp not supported, using mediump.")):(_e="lowp",THREE.warn("THREE.WebGLRenderer: highp and mediump not supported, using lowp."))),"mediump"!==_e||rt||(_e="lowp",THREE.warn("THREE.WebGLRenderer: mediump not supported, using lowp."));var nt,at=new THREE.ShadowMapPlugin(this,w,H,M),ot=new THREE.SpritePlugin(this,A),st=new THREE.LensFlarePlugin(this,P);this.getContext=function(){return We},this.forceContextLoss=function(){W.get("WEBGL_lose_context").loseContext()},this.supportsVertexTextures=function(){return Fe},this.supportsFloatTextures=function(){return W.get("OES_texture_float")},this.supportsHalfFloatTextures=function(){return W.get("OES_texture_half_float")},this.supportsStandardDerivatives=function(){return W.get("OES_standard_derivatives")},this.supportsCompressedTextureS3TC=function(){return W.get("WEBGL_compressed_texture_s3tc")},this.supportsCompressedTexturePVRTC=function(){return W.get("WEBGL_compressed_texture_pvrtc")},this.supportsBlendMinMax=function(){return W.get("EXT_blend_minmax")},this.getMaxAnisotropy=function(){if(void 0!==nt)return nt;var t=W.get("EXT_texture_filter_anisotropic");return nt=null!==t?We.getParameter(t.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0},this.getPrecision=function(){return _e},this.getPixelRatio=function(){return x},this.setPixelRatio=function(t){x=t},this.setSize=function(t,e,i){Re.width=t*x,Re.height=e*x,!1!==i&&(Re.style.width=t+"px",Re.style.height=e+"px"),this.setViewport(0,0,t,e)},this.setViewport=function(t,e,i,r){D=t*x,F=e*x,z=i*x,B=r*x,We.viewport(D,F,z,B)},this.setScissor=function(t,e,i,r){We.scissor(t*x,e*x,i*x,r*x)},this.enableScissorTest=function(t){t?We.enable(We.SCISSOR_TEST):We.disable(We.SCISSOR_TEST)},this.getClearColor=function(){return c},this.setClearColor=function(t,e){c.set(t),b=void 0!==e?e:1,j(c.r,c.g,c.b,b)},this.getClearAlpha=function(){return b},this.setClearAlpha=function(t){b=t,j(c.r,c.g,c.b,b)},this.clear=function(t,e,i){var r=0;(void 0===t||t)&&(r|=We.COLOR_BUFFER_BIT),(void 0===e||e)&&(r|=We.DEPTH_BUFFER_BIT),(void 0===i||i)&&(r|=We.STENCIL_BUFFER_BIT),We.clear(r)},this.clearColor=function(){We.clear(We.COLOR_BUFFER_BIT)},this.clearDepth=function(){We.clear(We.DEPTH_BUFFER_BIT)},this.clearStencil=function(){We.clear(We.STENCIL_BUFFER_BIT)},this.clearTarget=function(t,e,i,r){this.setRenderTarget(t),this.clear(e,i,r)},this.resetGLState=X;var ht=function(t){t.target.traverse(function(t){if(t.removeEventListener("remove",ht),t instanceof THREE.Mesh||t instanceof THREE.PointCloud||t instanceof THREE.Line)delete H[t.id];else if(t instanceof THREE.ImmediateRenderObject||t.immediateRenderCallback)for(var e=M,i=e.length-1;0<=i;i--)e[i].object===t&&e.splice(i,1);delete t.__webglInit,delete t._modelViewMatrix,delete t._normalMatrix,delete t.__webglActive})},lt=function(t){if((t=t.target).removeEventListener("dispose",lt),delete t.__webglInit,t instanceof THREE.BufferGeometry){for(var e in t.attributes){void 0!==(i=t.attributes[e]).buffer&&(We.deleteBuffer(i.buffer),delete i.buffer)}be.info.memory.geometries--}else if(void 0!==(e=qe[t.id])){for(var i=0,r=e.length;i<r;i++){var n=e[i];if(void 0!==n.numMorphTargets){for(var a=0,o=n.numMorphTargets;a<o;a++)We.deleteBuffer(n.__webglMorphTargetsBuffers[a]);delete n.__webglMorphTargetsBuffers}if(void 0!==n.numMorphNormals){for(a=0,o=n.numMorphNormals;a<o;a++)We.deleteBuffer(n.__webglMorphNormalsBuffers[a]);delete n.__webglMorphNormalsBuffers}ut(n)}delete qe[t.id]}else ut(t);k=""},Oe=function(t){(t=t.target).removeEventListener("dispose",Oe),t.image&&t.image.__webglTextureCube?(We.deleteTexture(t.image.__webglTextureCube),delete t.image.__webglTextureCube):void 0!==t.__webglInit&&(We.deleteTexture(t.__webglTexture),delete t.__webglTexture,delete t.__webglInit),be.info.memory.textures--},ct=function(t){if((t=t.target).removeEventListener("dispose",ct),t&&void 0!==t.__webglTexture){if(We.deleteTexture(t.__webglTexture),delete t.__webglTexture,t instanceof THREE.WebGLRenderTargetCube)for(var e=0;e<6;e++)We.deleteFramebuffer(t.__webglFramebuffer[e]),We.deleteRenderbuffer(t.__webglRenderbuffer[e]);else We.deleteFramebuffer(t.__webglFramebuffer),We.deleteRenderbuffer(t.__webglRenderbuffer);delete t.__webglFramebuffer,delete t.__webglRenderbuffer}be.info.memory.textures--},Ne=function(t){(t=t.target).removeEventListener("dispose",Ne),je(t)},ut=function(t){for(var e="__webglVertexBuffer __webglNormalBuffer __webglTangentBuffer __webglColorBuffer __webglUVBuffer __webglUV2Buffer __webglSkinIndicesBuffer __webglSkinWeightsBuffer __webglFaceBuffer __webglLineBuffer __webglLineDistanceBuffer".split(" "),i=0,r=e.length;i<r;i++){var n=e[i];void 0!==t[n]&&(We.deleteBuffer(t[n]),delete t[n])}if(void 0!==t.__webglCustomAttributesList){for(n in t.__webglCustomAttributesList)We.deleteBuffer(t.__webglCustomAttributesList[n].buffer);delete t.__webglCustomAttributesList}be.info.memory.geometries--},je=function(t){var e=t.program.program;if(void 0!==e){t.program=void 0;var i,r,n=!1;for(t=0,i=we.length;t<i;t++)if((r=we[t]).program===e){r.usedTimes--,0===r.usedTimes&&(n=!0);break}if(!0===n){for(n=[],t=0,i=we.length;t<i;t++)(r=we[t]).program!==e&&n.push(r);we=n,We.deleteProgram(e),be.info.memory.programs--}}};this.renderBufferImmediate=function(t,e,i){if(G.initAttributes(),t.hasPositions&&!t.__webglVertexBuffer&&(t.__webglVertexBuffer=We.createBuffer()),t.hasNormals&&!t.__webglNormalBuffer&&(t.__webglNormalBuffer=We.createBuffer()),t.hasUvs&&!t.__webglUvBuffer&&(t.__webglUvBuffer=We.createBuffer()),t.hasColors&&!t.__webglColorBuffer&&(t.__webglColorBuffer=We.createBuffer()),t.hasPositions&&(We.bindBuffer(We.ARRAY_BUFFER,t.__webglVertexBuffer),We.bufferData(We.ARRAY_BUFFER,t.positionArray,We.DYNAMIC_DRAW),G.enableAttribute(e.attributes.position),We.vertexAttribPointer(e.attributes.position,3,We.FLOAT,!1,0,0)),t.hasNormals){if(We.bindBuffer(We.ARRAY_BUFFER,t.__webglNormalBuffer),0==i instanceof THREE.MeshPhongMaterial&&i.shading===THREE.FlatShading){var r,n,a,o,s,h,l,c,u=3*t.count;for(c=0;c<u;c+=9)r=(l=t.normalArray)[c],n=l[c+1],a=l[c+2],o=l[c+3],s=l[c+4],h=l[c+5],r=(r+o+l[c+6])/3,n=(n+s+l[c+7])/3,a=(a+h+l[c+8])/3,l[c]=r,l[c+1]=n,l[c+2]=a,l[c+3]=r,l[c+4]=n,l[c+5]=a,l[c+6]=r,l[c+7]=n,l[c+8]=a}We.bufferData(We.ARRAY_BUFFER,t.normalArray,We.DYNAMIC_DRAW),G.enableAttribute(e.attributes.normal),We.vertexAttribPointer(e.attributes.normal,3,We.FLOAT,!1,0,0)}t.hasUvs&&i.map&&(We.bindBuffer(We.ARRAY_BUFFER,t.__webglUvBuffer),We.bufferData(We.ARRAY_BUFFER,t.uvArray,We.DYNAMIC_DRAW),G.enableAttribute(e.attributes.uv),We.vertexAttribPointer(e.attributes.uv,2,We.FLOAT,!1,0,0)),t.hasColors&&i.vertexColors!==THREE.NoColors&&(We.bindBuffer(We.ARRAY_BUFFER,t.__webglColorBuffer),We.bufferData(We.ARRAY_BUFFER,t.colorArray,We.DYNAMIC_DRAW),G.enableAttribute(e.attributes.color),We.vertexAttribPointer(e.attributes.color,3,We.FLOAT,!1,0,0)),G.disableUnusedAttributes(),We.drawArrays(We.TRIANGLES,0,t.count),t.count=0},this.renderBufferDirect=function(t,e,i,r,n,a){if(!1!==r.visible)if(y(a),t=R(t,e,i,r,a),e=!1,(i="direct_"+n.id+"_"+t.id+"_"+(r.wireframe?1:0))!==k&&(k=i,e=!0),e&&G.initAttributes(),a instanceof THREE.Mesh){a=!0===r.wireframe?We.LINES:We.TRIANGLES;var o,s,h=n.attributes.index;if(h)if(h.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(o=We.UNSIGNED_INT,s=4):(o=We.UNSIGNED_SHORT,s=2),0===(i=n.offsets).length)e&&(d(r,t,n,0),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,h.buffer)),We.drawElements(a,h.array.length,o,0),be.info.render.calls++,be.info.render.vertices+=h.array.length,be.info.render.faces+=h.array.length/3;else{e=!0;for(var l=0,c=i.length;l<c;l++){var u=i[l].index;e&&(d(r,t,n,u),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,h.buffer)),We.drawElements(a,i[l].count,o,i[l].start*s),be.info.render.calls++,be.info.render.vertices+=i[l].count,be.info.render.faces+=i[l].count/3}}else e&&d(r,t,n,0),r=n.attributes.position,We.drawArrays(a,0,r.array.length/r.itemSize),be.info.render.calls++,be.info.render.vertices+=r.array.length/r.itemSize,be.info.render.faces+=r.array.length/(3*r.itemSize)}else if(a instanceof THREE.PointCloud)if(a=We.POINTS,h=n.attributes.index)if(h.array instanceof Uint32Array&&W.get("OES_element_index_uint")?(o=We.UNSIGNED_INT,s=4):(o=We.UNSIGNED_SHORT,s=2),0===(i=n.offsets).length)e&&(d(r,t,n,0),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,h.buffer)),We.drawElements(a,h.array.length,o,0),be.info.render.calls++,be.info.render.points+=h.array.length;else for(1<i.length&&(e=!0),l=0,c=i.length;l<c;l++)u=i[l].index,e&&(d(r,t,n,u),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,h.buffer)),We.drawElements(a,i[l].count,o,i[l].start*s),be.info.render.calls++,be.info.render.points+=i[l].count;else if(e&&d(r,t,n,0),r=n.attributes.position,0===(i=n.offsets).length)We.drawArrays(a,0,r.array.length/3),be.info.render.calls++,be.info.render.points+=r.array.length/3;else for(l=0,c=i.length;l<c;l++)We.drawArrays(a,i[l].index,i[l].count),be.info.render.calls++,be.info.render.points+=i[l].count;else if(a instanceof THREE.Line)if(a=a.mode===THREE.LineStrip?We.LINE_STRIP:We.LINES,G.setLineWidth(r.linewidth*x),h=n.attributes.index)if(h.array instanceof Uint32Array?(o=We.UNSIGNED_INT,s=4):(o=We.UNSIGNED_SHORT,s=2),0===(i=n.offsets).length)e&&(d(r,t,n,0),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,h.buffer)),We.drawElements(a,h.array.length,o,0),be.info.render.calls++,be.info.render.vertices+=h.array.length;else for(1<i.length&&(e=!0),l=0,c=i.length;l<c;l++)u=i[l].index,e&&(d(r,t,n,u),We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,h.buffer)),We.drawElements(a,i[l].count,o,i[l].start*s),be.info.render.calls++,be.info.render.vertices+=i[l].count;else if(e&&d(r,t,n,0),r=n.attributes.position,0===(i=n.offsets).length)We.drawArrays(a,0,r.array.length/3),be.info.render.calls++,be.info.render.vertices+=r.array.length/3;else for(l=0,c=i.length;l<c;l++)We.drawArrays(a,i[l].index,i[l].count),be.info.render.calls++,be.info.render.vertices+=i[l].count},this.renderBuffer=function(t,e,i,r,n,a){if(!1!==r.visible){if(y(a),e=(i=R(t,e,i,r,a)).attributes,t=!1,(i=n.id+"_"+i.id+"_"+(r.wireframe?1:0))!==k&&(k=i,t=!0),t&&G.initAttributes(),!r.morphTargets&&0<=e.position)t&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglVertexBuffer),G.enableAttribute(e.position),We.vertexAttribPointer(e.position,3,We.FLOAT,!1,0,0));else if(a.morphTargetBase){if(i=r.program.attributes,-1!==a.morphTargetBase&&0<=i.position?(We.bindBuffer(We.ARRAY_BUFFER,n.__webglMorphTargetsBuffers[a.morphTargetBase]),G.enableAttribute(i.position),We.vertexAttribPointer(i.position,3,We.FLOAT,!1,0,0)):0<=i.position&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglVertexBuffer),G.enableAttribute(i.position),We.vertexAttribPointer(i.position,3,We.FLOAT,!1,0,0)),a.morphTargetForcedOrder.length)for(var o,s=0,h=a.morphTargetForcedOrder,l=a.morphTargetInfluences;s<r.numSupportedMorphTargets&&s<h.length;)0<=(o=i["morphTarget"+s])&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglMorphTargetsBuffers[h[s]]),G.enableAttribute(o),We.vertexAttribPointer(o,3,We.FLOAT,!1,0,0)),0<=(o=i["morphNormal"+s])&&r.morphNormals&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglMorphNormalsBuffers[h[s]]),G.enableAttribute(o),We.vertexAttribPointer(o,3,We.FLOAT,!1,0,0)),a.__webglMorphTargetInfluences[s]=l[h[s]],s++;else{for(h=[],l=a.morphTargetInfluences,s=a.geometry.morphTargets,l.length>s.length&&(console.warn("THREE.WebGLRenderer: Influences array is bigger than morphTargets array."),l.length=s.length),s=0,o=l.length;s<o;s++)h.push([l[s],s]);h.length>r.numSupportedMorphTargets?(h.sort(m),h.length=r.numSupportedMorphTargets):h.length>r.numSupportedMorphNormals?h.sort(m):0===h.length&&h.push([0,0]);s=0;for(var c=r.numSupportedMorphTargets;s<c;s++)if(h[s]){var u=h[s][1];0<=(o=i["morphTarget"+s])&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglMorphTargetsBuffers[u]),G.enableAttribute(o),We.vertexAttribPointer(o,3,We.FLOAT,!1,0,0)),0<=(o=i["morphNormal"+s])&&r.morphNormals&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglMorphNormalsBuffers[u]),G.enableAttribute(o),We.vertexAttribPointer(o,3,We.FLOAT,!1,0,0)),a.__webglMorphTargetInfluences[s]=l[u]}else a.__webglMorphTargetInfluences[s]=0}null!==r.program.uniforms.morphTargetInfluences&&We.uniform1fv(r.program.uniforms.morphTargetInfluences,a.__webglMorphTargetInfluences)}if(t){if(n.__webglCustomAttributesList)for(i=0,l=n.__webglCustomAttributesList.length;i<l;i++)0<=e[(h=n.__webglCustomAttributesList[i]).buffer.belongsToAttribute]&&(We.bindBuffer(We.ARRAY_BUFFER,h.buffer),G.enableAttribute(e[h.buffer.belongsToAttribute]),We.vertexAttribPointer(e[h.buffer.belongsToAttribute],h.size,We.FLOAT,!1,0,0));0<=e.color&&(0<a.geometry.colors.length||0<a.geometry.faces.length?(We.bindBuffer(We.ARRAY_BUFFER,n.__webglColorBuffer),G.enableAttribute(e.color),We.vertexAttribPointer(e.color,3,We.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&We.vertexAttrib3fv(e.color,r.defaultAttributeValues.color)),0<=e.normal&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglNormalBuffer),G.enableAttribute(e.normal),We.vertexAttribPointer(e.normal,3,We.FLOAT,!1,0,0)),0<=e.tangent&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglTangentBuffer),G.enableAttribute(e.tangent),We.vertexAttribPointer(e.tangent,4,We.FLOAT,!1,0,0)),0<=e.uv&&(a.geometry.faceVertexUvs[0]?(We.bindBuffer(We.ARRAY_BUFFER,n.__webglUVBuffer),G.enableAttribute(e.uv),We.vertexAttribPointer(e.uv,2,We.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&We.vertexAttrib2fv(e.uv,r.defaultAttributeValues.uv)),0<=e.uv2&&(a.geometry.faceVertexUvs[1]?(We.bindBuffer(We.ARRAY_BUFFER,n.__webglUV2Buffer),G.enableAttribute(e.uv2),We.vertexAttribPointer(e.uv2,2,We.FLOAT,!1,0,0)):void 0!==r.defaultAttributeValues&&We.vertexAttrib2fv(e.uv2,r.defaultAttributeValues.uv2)),r.skinning&&0<=e.skinIndex&&0<=e.skinWeight&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglSkinIndicesBuffer),G.enableAttribute(e.skinIndex),We.vertexAttribPointer(e.skinIndex,4,We.FLOAT,!1,0,0),We.bindBuffer(We.ARRAY_BUFFER,n.__webglSkinWeightsBuffer),G.enableAttribute(e.skinWeight),We.vertexAttribPointer(e.skinWeight,4,We.FLOAT,!1,0,0)),0<=e.lineDistance&&(We.bindBuffer(We.ARRAY_BUFFER,n.__webglLineDistanceBuffer),G.enableAttribute(e.lineDistance),We.vertexAttribPointer(e.lineDistance,1,We.FLOAT,!1,0,0))}G.disableUnusedAttributes(),a instanceof THREE.Mesh?(a=n.__typeArray===Uint32Array?We.UNSIGNED_INT:We.UNSIGNED_SHORT,r.wireframe?(G.setLineWidth(r.wireframeLinewidth*x),t&&We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,n.__webglLineBuffer),We.drawElements(We.LINES,n.__webglLineCount,a,0)):(t&&We.bindBuffer(We.ELEMENT_ARRAY_BUFFER,n.__webglFaceBuffer),We.drawElements(We.TRIANGLES,n.__webglFaceCount,a,0)),be.info.render.calls++,be.info.render.vertices+=n.__webglFaceCount,be.info.render.faces+=n.__webglFaceCount/3):a instanceof THREE.Line?(a=a.mode===THREE.LineStrip?We.LINE_STRIP:We.LINES,G.setLineWidth(r.linewidth*x),We.drawArrays(a,0,n.__webglLineCount),be.info.render.calls++):a instanceof THREE.PointCloud&&(We.drawArrays(We.POINTS,0,n.__webglParticleCount),be.info.render.calls++,be.info.render.points+=n.__webglParticleCount)}},this.render=function(t,e,i,r){if(0==e instanceof THREE.Camera)THREE.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");else{var n=t.fog;k="",Me=-1,(Le=!(Se=null))===t.autoUpdate&&t.updateMatrixWorld(),void 0===e.parent&&e.updateMatrixWorld(),t.traverse(function(t){t instanceof THREE.SkinnedMesh&&t.skeleton.update()}),e.matrixWorldInverse.getInverse(e.matrixWorld),V.multiplyMatrices(e.projectionMatrix,e.matrixWorldInverse),U.setFromMatrix(V),w.length=0,S.length=0,C.length=0,A.length=0,P.length=0,function t(e){if(!1!==e.visible){if(!(e instanceof THREE.Scene||e instanceof THREE.Group)){if(void 0===e.__webglInit&&(e.__webglInit=!0,e._modelViewMatrix=new THREE.Matrix4,e._normalMatrix=new THREE.Matrix3,e.addEventListener("removed",ht)),void 0!==(r=e.geometry)&&void 0===r.__webglInit)if(r.__webglInit=!0,r.addEventListener("dispose",lt),r instanceof THREE.BufferGeometry)be.info.memory.geometries++;else if(e instanceof THREE.Mesh)Ve(e,r);else if(e instanceof THREE.Line){if(void 0===r.__webglVertexBuffer){r.__webglVertexBuffer=We.createBuffer(),r.__webglColorBuffer=We.createBuffer(),r.__webglLineDistanceBuffer=We.createBuffer(),be.info.memory.geometries++;var i=r.vertices.length;r.__vertexArray=new Float32Array(3*i),r.__colorArray=new Float32Array(3*i),r.__lineDistanceArray=new Float32Array(1*i),r.__webglLineCount=i,u(e),r.verticesNeedUpdate=!0,r.colorsNeedUpdate=!0,r.lineDistancesNeedUpdate=!0}}else e instanceof THREE.PointCloud&&void 0===r.__webglVertexBuffer&&(r.__webglVertexBuffer=We.createBuffer(),r.__webglColorBuffer=We.createBuffer(),be.info.memory.geometries++,i=r.vertices.length,r.__vertexArray=new Float32Array(3*i),r.__colorArray=new Float32Array(3*i),r.__webglParticleCount=i,u(e),r.verticesNeedUpdate=!0,r.colorsNeedUpdate=!0);if(void 0===e.__webglActive)if(e.__webglActive=!0,e instanceof THREE.Mesh){if(r instanceof THREE.BufferGeometry)v(H,r,e);else if(r instanceof THREE.Geometry){i=0;for(var r,n=(r=qe[r.id]).length;i<n;i++)v(H,r[i],e)}}else e instanceof THREE.Line||e instanceof THREE.PointCloud?v(H,r,e):(e instanceof THREE.ImmediateRenderObject||e.immediateRenderCallback)&&M.push({id:null,object:e,opaque:null,transparent:null,z:0});if(e instanceof THREE.Light)w.push(e);else if(e instanceof THREE.Sprite)A.push(e);else if(e instanceof THREE.LensFlare)P.push(e);else if((r=H[e.id])&&(!1===e.frustumCulled||!0===U.intersectsObject(e)))for(i=0,n=r.length;i<n;i++){var a=r[i],o=a,s=o.object,h=o.buffer,l=s.geometry;(s=s.material)instanceof THREE.MeshFaceMaterial?(s=s.materials[l instanceof THREE.BufferGeometry?0:h.materialIndex],(o.material=s).transparent?C.push(o):S.push(o)):s&&((o.material=s).transparent?C.push(o):S.push(o)),(a.render=!0)===be.sortObjects&&(Ae.setFromMatrixPosition(e.matrixWorld),Ae.applyProjection(V),a.z=Ae.z)}}for(i=0,n=e.children.length;i<n;i++)t(e.children[i])}}(t),!0===be.sortObjects&&(S.sort(p),C.sort(f)),at.render(t,e),be.info.render.calls=0,be.info.render.vertices=0,be.info.render.faces=0,be.info.render.points=0,this.setRenderTarget(i),(this.autoClear||r)&&this.clear(this.autoClearColor,this.autoClearDepth,this.autoClearStencil),r=0;for(var a=M.length;r<a;r++){var o=M[r],s=o.object;s.visible&&(_(s,e),void 0,(c=(l=o).object.material).transparent?(l.transparent=c,l.opaque=null):(l.opaque=c,l.transparent=null))}t.overrideMaterial?(T(r=t.overrideMaterial),E(S,e,w,n,r),E(C,e,w,n,r),g(M,"",e,w,n,r)):(G.setBlending(THREE.NoBlending),E(S,e,w,n,null),g(M,"opaque",e,w,n,null),E(C,e,w,n,null),g(M,"transparent",e,w,n,null)),ot.render(t,e),st.render(t,e,O,N),i&&i.generateMipmaps&&i.minFilter!==THREE.NearestFilter&&i.minFilter!==THREE.LinearFilter&&((h=i)instanceof THREE.WebGLRenderTargetCube?(We.bindTexture(We.TEXTURE_CUBE_MAP,h.__webglTexture),We.generateMipmap(We.TEXTURE_CUBE_MAP),We.bindTexture(We.TEXTURE_CUBE_MAP,null)):(We.bindTexture(We.TEXTURE_2D,h.__webglTexture),We.generateMipmap(We.TEXTURE_2D),We.bindTexture(We.TEXTURE_2D,null))),G.setDepthTest(!0),G.setDepthWrite(!0),G.setColorWrite(!0)}var h,l,c},this.renderImmediateObject=function(t,e,i,r,n){var a=R(t,e,i,r,n);k="",be.setMaterialFaces(r),n.immediateRenderCallback?n.immediateRenderCallback(a,We,U):n.render(function(t){be.renderBufferImmediate(t,a,r)})};var qe={},dt=0,Xe={MeshDepthMaterial:"depth",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointCloudMaterial:"particle_basic"};this.setFaceCulling=function(t,e){t===THREE.CullFaceNone?We.disable(We.CULL_FACE):(e===THREE.FrontFaceDirectionCW?We.frontFace(We.CW):We.frontFace(We.CCW),t===THREE.CullFaceBack?We.cullFace(We.BACK):t===THREE.CullFaceFront?We.cullFace(We.FRONT):We.cullFace(We.FRONT_AND_BACK),We.enable(We.CULL_FACE))},this.setMaterialFaces=function(t){G.setDoubleSided(t.side===THREE.DoubleSide),G.setFlipSided(t.side===THREE.BackSide)},this.uploadTexture=function(t){void 0===t.__webglInit&&(t.__webglInit=!0,t.addEventListener("dispose",Oe),t.__webglTexture=We.createTexture(),be.info.memory.textures++),We.bindTexture(We.TEXTURE_2D,t.__webglTexture),We.pixelStorei(We.UNPACK_FLIP_Y_WEBGL,t.flipY),We.pixelStorei(We.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t.premultiplyAlpha),We.pixelStorei(We.UNPACK_ALIGNMENT,t.unpackAlignment),t.image=ye(t.image,Z);var e=t.image,i=THREE.Math.isPowerOfTwo(e.width)&&THREE.Math.isPowerOfTwo(e.height),r=Te(t.format),n=Te(t.type);ve(We.TEXTURE_2D,t,i);var a=t.mipmaps;if(t instanceof THREE.DataTexture)if(0<a.length&&i){for(var o=0,s=a.length;o<s;o++)e=a[o],We.texImage2D(We.TEXTURE_2D,o,r,e.width,e.height,0,r,n,e.data);t.generateMipmaps=!1}else We.texImage2D(We.TEXTURE_2D,0,r,e.width,e.height,0,r,n,e.data);else if(t instanceof THREE.CompressedTexture)for(o=0,s=a.length;o<s;o++)e=a[o],t.format!==THREE.RGBAFormat&&t.format!==THREE.RGBFormat?-1<Be().indexOf(r)?We.compressedTexImage2D(We.TEXTURE_2D,o,r,e.width,e.height,0,e.data):THREE.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):We.texImage2D(We.TEXTURE_2D,o,r,e.width,e.height,0,r,n,e.data);else if(0<a.length&&i){for(o=0,s=a.length;o<s;o++)e=a[o],We.texImage2D(We.TEXTURE_2D,o,r,r,n,e);t.generateMipmaps=!1}else We.texImage2D(We.TEXTURE_2D,0,r,r,n,t.image);t.generateMipmaps&&i&&We.generateMipmap(We.TEXTURE_2D),t.needsUpdate=!1,t.onUpdate&&t.onUpdate()},this.setTexture=function(t,e){We.activeTexture(We.TEXTURE0+e),t.needsUpdate?be.uploadTexture(t):We.bindTexture(We.TEXTURE_2D,t.__webglTexture)},this.setRenderTarget=function(t){var e=t instanceof THREE.WebGLRenderTargetCube;if(t&&void 0===t.__webglFramebuffer){void 0===t.depthBuffer&&(t.depthBuffer=!0),void 0===t.stencilBuffer&&(t.stencilBuffer=!0),t.addEventListener("dispose",ct),t.__webglTexture=We.createTexture(),be.info.memory.textures++;var i=THREE.Math.isPowerOfTwo(t.width)&&THREE.Math.isPowerOfTwo(t.height),r=Te(t.format),n=Te(t.type);if(e){t.__webglFramebuffer=[],t.__webglRenderbuffer=[],We.bindTexture(We.TEXTURE_CUBE_MAP,t.__webglTexture),ve(We.TEXTURE_CUBE_MAP,t,i);for(var a=0;a<6;a++){t.__webglFramebuffer[a]=We.createFramebuffer(),t.__webglRenderbuffer[a]=We.createRenderbuffer(),We.texImage2D(We.TEXTURE_CUBE_MAP_POSITIVE_X+a,0,r,t.width,t.height,0,r,n,null);var o=t,s=We.TEXTURE_CUBE_MAP_POSITIVE_X+a;We.bindFramebuffer(We.FRAMEBUFFER,t.__webglFramebuffer[a]),We.framebufferTexture2D(We.FRAMEBUFFER,We.COLOR_ATTACHMENT0,s,o.__webglTexture,0),h(t.__webglRenderbuffer[a],t)}i&&We.generateMipmap(We.TEXTURE_CUBE_MAP)}else t.__webglFramebuffer=We.createFramebuffer(),t.__webglRenderbuffer=t.shareDepthFrom?t.shareDepthFrom.__webglRenderbuffer:We.createRenderbuffer(),We.bindTexture(We.TEXTURE_2D,t.__webglTexture),ve(We.TEXTURE_2D,t,i),We.texImage2D(We.TEXTURE_2D,0,r,t.width,t.height,0,r,n,null),r=We.TEXTURE_2D,We.bindFramebuffer(We.FRAMEBUFFER,t.__webglFramebuffer),We.framebufferTexture2D(We.FRAMEBUFFER,We.COLOR_ATTACHMENT0,r,t.__webglTexture,0),t.shareDepthFrom?t.depthBuffer&&!t.stencilBuffer?We.framebufferRenderbuffer(We.FRAMEBUFFER,We.DEPTH_ATTACHMENT,We.RENDERBUFFER,t.__webglRenderbuffer):t.depthBuffer&&t.stencilBuffer&&We.framebufferRenderbuffer(We.FRAMEBUFFER,We.DEPTH_STENCIL_ATTACHMENT,We.RENDERBUFFER,t.__webglRenderbuffer):h(t.__webglRenderbuffer,t),i&&We.generateMipmap(We.TEXTURE_2D);e?We.bindTexture(We.TEXTURE_CUBE_MAP,null):We.bindTexture(We.TEXTURE_2D,null),We.bindRenderbuffer(We.RENDERBUFFER,null),We.bindFramebuffer(We.FRAMEBUFFER,null)}t?(e=e?t.__webglFramebuffer[t.activeCubeFace]:t.__webglFramebuffer,i=t.width,t=t.height,n=r=0):(e=null,i=z,t=B,r=D,n=F),e!==L&&(We.bindFramebuffer(We.FRAMEBUFFER,e),We.viewport(r,n,i,t),L=e),O=i,N=t},this.readRenderTargetPixels=function(t,e,i,r,n,a){if(t instanceof THREE.WebGLRenderTarget){if(t.__webglFramebuffer)if(t.format!==THREE.RGBAFormat)console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA format. readPixels can read only RGBA format.");else{var o=!1;t.__webglFramebuffer!==L&&(We.bindFramebuffer(We.FRAMEBUFFER,t.__webglFramebuffer),o=!0),We.checkFramebufferStatus(We.FRAMEBUFFER)===We.FRAMEBUFFER_COMPLETE?We.readPixels(e,i,r,n,We.RGBA,We.UNSIGNED_BYTE,a):console.error("THREE.WebGLRenderer.readRenderTargetPixels: readPixels from renderTarget failed. Framebuffer not complete."),o&&We.bindFramebuffer(We.FRAMEBUFFER,L)}}else console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.")},this.initMaterial=function(){THREE.warn("THREE.WebGLRenderer: .initMaterial() has been removed.")},this.addPrePlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPrePlugin() has been removed.")},this.addPostPlugin=function(){THREE.warn("THREE.WebGLRenderer: .addPostPlugin() has been removed.")},this.updateShadowMap=function(){THREE.warn("THREE.WebGLRenderer: .updateShadowMap() has been removed.")}},THREE.WebGLRenderTarget=function(t,e,i){this.width=t,this.height=e,i=i||{},this.wrapS=void 0!==i.wrapS?i.wrapS:THREE.ClampToEdgeWrapping,this.wrapT=void 0!==i.wrapT?i.wrapT:THREE.ClampToEdgeWrapping,this.magFilter=void 0!==i.magFilter?i.magFilter:THREE.LinearFilter,this.minFilter=void 0!==i.minFilter?i.minFilter:THREE.LinearMipMapLinearFilter,this.anisotropy=void 0!==i.anisotropy?i.anisotropy:1,this.offset=new THREE.Vector2(0,0),this.repeat=new THREE.Vector2(1,1),this.format=void 0!==i.format?i.format:THREE.RGBAFormat,this.type=void 0!==i.type?i.type:THREE.UnsignedByteType,this.depthBuffer=void 0===i.depthBuffer||i.depthBuffer,this.stencilBuffer=void 0===i.stencilBuffer||i.stencilBuffer,this.generateMipmaps=!0,this.shareDepthFrom=void 0!==i.shareDepthFrom?i.shareDepthFrom:null},THREE.WebGLRenderTarget.prototype={constructor:THREE.WebGLRenderTarget,setSize:function(t,e){this.width=t,this.height=e},clone:function(){var t=new THREE.WebGLRenderTarget(this.width,this.height);return t.wrapS=this.wrapS,t.wrapT=this.wrapT,t.magFilter=this.magFilter,t.minFilter=this.minFilter,t.anisotropy=this.anisotropy,t.offset.copy(this.offset),t.repeat.copy(this.repeat),t.format=this.format,t.type=this.type,t.depthBuffer=this.depthBuffer,t.stencilBuffer=this.stencilBuffer,t.generateMipmaps=this.generateMipmaps,t.shareDepthFrom=this.shareDepthFrom,t},dispose:function(){this.dispatchEvent({type:"dispose"})}},THREE.EventDispatcher.prototype.apply(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube=function(t,e,i){THREE.WebGLRenderTarget.call(this,t,e,i),this.activeCubeFace=0},THREE.WebGLRenderTargetCube.prototype=Object.create(THREE.WebGLRenderTarget.prototype),THREE.WebGLRenderTargetCube.prototype.constructor=THREE.WebGLRenderTargetCube,THREE.WebGLExtensions=function(i){var r={};this.get=function(t){if(void 0!==r[t])return r[t];var e;switch(t){case"EXT_texture_filter_anisotropic":e=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":e=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":e=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:e=i.getExtension(t)}return null===e&&THREE.warn("THREE.WebGLRenderer: "+t+" extension not supported."),r[t]=e}},THREE.WebGLProgram=function(){var R=0;return function(t,e,i,r){var n=t.context,a=i.defines,o=i.__webglShader.uniforms,s=i.attributes,h=i.__webglShader.vertexShader,l=i.__webglShader.fragmentShader,c=i.index0AttributeName;void 0===c&&!0===r.morphTargets&&(c="position");var u="SHADOWMAP_TYPE_BASIC";r.shadowMapType===THREE.PCFShadowMap?u="SHADOWMAP_TYPE_PCF":r.shadowMapType===THREE.PCFSoftShadowMap&&(u="SHADOWMAP_TYPE_PCF_SOFT");var d="ENVMAP_TYPE_CUBE",p="ENVMAP_MODE_REFLECTION",f="ENVMAP_BLENDING_MULTIPLY";if(r.envMap){switch(i.envMap.mapping){case THREE.CubeReflectionMapping:case THREE.CubeRefractionMapping:d="ENVMAP_TYPE_CUBE";break;case THREE.EquirectangularReflectionMapping:case THREE.EquirectangularRefractionMapping:d="ENVMAP_TYPE_EQUIREC";break;case THREE.SphericalReflectionMapping:d="ENVMAP_TYPE_SPHERE"}switch(i.envMap.mapping){case THREE.CubeRefractionMapping:case THREE.EquirectangularRefractionMapping:p="ENVMAP_MODE_REFRACTION"}switch(i.combine){case THREE.MultiplyOperation:f="ENVMAP_BLENDING_MULTIPLY";break;case THREE.MixOperation:f="ENVMAP_BLENDING_MIX";break;case THREE.AddOperation:f="ENVMAP_BLENDING_ADD"}}var m,E,g=0<t.gammaFactor?t.gammaFactor:1;for(var v in m=[],a)!1!==(E=a[v])&&(E="#define "+v+" "+E,m.push(E));for(var y in m=m.join("\n"),a=n.createProgram(),i instanceof THREE.RawShaderMaterial?t=i="":(i=["precision "+r.precision+" float;","precision "+r.precision+" int;",m,r.supportsVertexTextures?"#define VERTEX_TEXTURES":"",t.gammaInput?"#define GAMMA_INPUT":"",t.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+g,"#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,"#define MAX_SPOT_LIGHTS "+r.maxSpotLights,"#define MAX_HEMI_LIGHTS "+r.maxHemiLights,"#define MAX_SHADOWS "+r.maxShadows,"#define MAX_BONES "+r.maxBones,r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+p:"",r.lightMap?"#define USE_LIGHTMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.skinning?"#define USE_SKINNING":"",r.useVertexTexture?"#define BONE_TEXTURE":"",r.morphTargets?"#define USE_MORPHTARGETS":"",r.morphNormals?"#define USE_MORPHNORMALS":"",r.wrapAround?"#define WRAP_AROUND":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+u:"",r.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",r.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",r.sizeAttenuation?"#define USE_SIZEATTENUATION":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 modelMatrix;\nuniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform mat4 viewMatrix;\nuniform mat3 normalMatrix;\nuniform vec3 cameraPosition;\nattribute vec3 position;\nattribute vec3 normal;\nattribute vec2 uv;\nattribute vec2 uv2;\n#ifdef USE_COLOR\n\tattribute vec3 color;\n#endif\n#ifdef USE_MORPHTARGETS\n\tattribute vec3 morphTarget0;\n\tattribute vec3 morphTarget1;\n\tattribute vec3 morphTarget2;\n\tattribute vec3 morphTarget3;\n\t#ifdef USE_MORPHNORMALS\n\t\tattribute vec3 morphNormal0;\n\t\tattribute vec3 morphNormal1;\n\t\tattribute vec3 morphNormal2;\n\t\tattribute vec3 morphNormal3;\n\t#else\n\t\tattribute vec3 morphTarget4;\n\t\tattribute vec3 morphTarget5;\n\t\tattribute vec3 morphTarget6;\n\t\tattribute vec3 morphTarget7;\n\t#endif\n#endif\n#ifdef USE_SKINNING\n\tattribute vec4 skinIndex;\n\tattribute vec4 skinWeight;\n#endif\n"].join("\n"),t=["precision "+r.precision+" float;","precision "+r.precision+" int;",r.bumpMap||r.normalMap||r.flatShading?"#extension GL_OES_standard_derivatives : enable":"",m,"#define MAX_DIR_LIGHTS "+r.maxDirLights,"#define MAX_POINT_LIGHTS "+r.maxPointLights,"#define MAX_SPOT_LIGHTS "+r.maxSpotLights,"#define MAX_HEMI_LIGHTS "+r.maxHemiLights,"#define MAX_SHADOWS "+r.maxShadows,r.alphaTest?"#define ALPHATEST "+r.alphaTest:"",t.gammaInput?"#define GAMMA_INPUT":"",t.gammaOutput?"#define GAMMA_OUTPUT":"","#define GAMMA_FACTOR "+g,r.useFog&&r.fog?"#define USE_FOG":"",r.useFog&&r.fogExp?"#define FOG_EXP2":"",r.map?"#define USE_MAP":"",r.envMap?"#define USE_ENVMAP":"",r.envMap?"#define "+d:"",r.envMap?"#define "+p:"",r.envMap?"#define "+f:"",r.lightMap?"#define USE_LIGHTMAP":"",r.bumpMap?"#define USE_BUMPMAP":"",r.normalMap?"#define USE_NORMALMAP":"",r.specularMap?"#define USE_SPECULARMAP":"",r.alphaMap?"#define USE_ALPHAMAP":"",r.vertexColors?"#define USE_COLOR":"",r.flatShading?"#define FLAT_SHADED":"",r.metal?"#define METAL":"",r.wrapAround?"#define WRAP_AROUND":"",r.doubleSided?"#define DOUBLE_SIDED":"",r.flipSided?"#define FLIP_SIDED":"",r.shadowMapEnabled?"#define USE_SHADOWMAP":"",r.shadowMapEnabled?"#define "+u:"",r.shadowMapDebug?"#define SHADOWMAP_DEBUG":"",r.shadowMapCascade?"#define SHADOWMAP_CASCADE":"",r.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"","uniform mat4 viewMatrix;\nuniform vec3 cameraPosition;\n"].join("\n")),h=new THREE.WebGLShader(n,n.VERTEX_SHADER,i+h),l=new THREE.WebGLShader(n,n.FRAGMENT_SHADER,t+l),n.attachShader(a,h),n.attachShader(a,l),void 0!==c&&n.bindAttribLocation(a,0,c),n.linkProgram(a),c=n.getProgramInfoLog(a),!1===n.getProgramParameter(a,n.LINK_STATUS)&&THREE.error("THREE.WebGLProgram: shader error: "+n.getError(),"gl.VALIDATE_STATUS",n.getProgramParameter(a,n.VALIDATE_STATUS),"gl.getPRogramInfoLog",c),""!==c&&THREE.warn("THREE.WebGLProgram: gl.getProgramInfoLog()"+c),n.deleteShader(h),n.deleteShader(l),c="viewMatrix modelViewMatrix projectionMatrix normalMatrix modelMatrix cameraPosition morphTargetInfluences bindMatrix bindMatrixInverse".split(" "),r.useVertexTexture?(c.push("boneTexture"),c.push("boneTextureWidth"),c.push("boneTextureHeight")):c.push("boneGlobalMatrices"),r.logarithmicDepthBuffer&&c.push("logDepthBufFC"),o)c.push(y);for(o=c,y={},c=0,t=o.length;c<t;c++)y[u=o[c]]=n.getUniformLocation(a,u);for(this.uniforms=y,c="position normal uv uv2 tangent color skinIndex skinWeight lineDistance".split(" "),o=0;o<r.maxMorphTargets;o++)c.push("morphTarget"+o);for(o=0;o<r.maxMorphNormals;o++)c.push("morphNormal"+o);for(var T in s)c.push(T);for(s={},T=0,o=(r=c).length;T<o;T++)s[y=r[T]]=n.getAttribLocation(a,y);return this.attributes=s,this.attributesKeys=Object.keys(this.attributes),this.id=R++,this.code=e,this.usedTimes=1,this.program=a,this.vertexShader=h,this.fragmentShader=l,this}}(),THREE.WebGLShader=function(t,e,i){return e=t.createShader(e),t.shaderSource(e,i),t.compileShader(e),!1===t.getShaderParameter(e,t.COMPILE_STATUS)&&THREE.error("THREE.WebGLShader: Shader couldn't compile."),""!==t.getShaderInfoLog(e)&&THREE.warn("THREE.WebGLShader: gl.getShaderInfoLog()",t.getShaderInfoLog(e),function(t){t=t.split("\n");for(var e=0;e<t.length;e++)t[e]=e+1+": "+t[e];return t.join("\n")}(i)),e},THREE.WebGLState=function(s,h){var i=new Uint8Array(16),r=new Uint8Array(16),l=null,c=null,u=null,d=null,p=null,f=null,m=null,e=null,n=null,a=null,o=null,E=null,g=null,v=null,y=null,T=null;this.initAttributes=function(){for(var t=0,e=i.length;t<e;t++)i[t]=0},this.enableAttribute=function(t){i[t]=1,0===r[t]&&(s.enableVertexAttribArray(t),r[t]=1)},this.disableUnusedAttributes=function(){for(var t=0,e=r.length;t<e;t++)r[t]!==i[t]&&(s.disableVertexAttribArray(t),r[t]=0)},this.setBlending=function(t,e,i,r,n,a,o){t!==l&&(t===THREE.NoBlending?s.disable(s.BLEND):t===THREE.AdditiveBlending?(s.enable(s.BLEND),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.SRC_ALPHA,s.ONE)):t===THREE.SubtractiveBlending?(s.enable(s.BLEND),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ZERO,s.ONE_MINUS_SRC_COLOR)):t===THREE.MultiplyBlending?(s.enable(s.BLEND),s.blendEquation(s.FUNC_ADD),s.blendFunc(s.ZERO,s.SRC_COLOR)):t===THREE.CustomBlending?s.enable(s.BLEND):(s.enable(s.BLEND),s.blendEquationSeparate(s.FUNC_ADD,s.FUNC_ADD),s.blendFuncSeparate(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA,s.ONE,s.ONE_MINUS_SRC_ALPHA)),l=t),t===THREE.CustomBlending?(n=n||e,a=a||i,o=o||r,e===c&&n===p||(s.blendEquationSeparate(h(e),h(n)),c=e,p=n),i===u&&r===d&&a===f&&o===m||(s.blendFuncSeparate(h(i),h(r),h(a),h(o)),u=i,d=r,f=a,m=o)):m=f=p=d=u=c=null},this.setDepthTest=function(t){e!==t&&(t?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),e=t)},this.setDepthWrite=function(t){n!==t&&(s.depthMask(t),n=t)},this.setColorWrite=function(t){a!==t&&(s.colorMask(t,t,t,t),a=t)},this.setDoubleSided=function(t){o!==t&&(t?s.disable(s.CULL_FACE):s.enable(s.CULL_FACE),o=t)},this.setFlipSided=function(t){E!==t&&(t?s.frontFace(s.CW):s.frontFace(s.CCW),E=t)},this.setLineWidth=function(t){t!==g&&(s.lineWidth(t),g=t)},this.setPolygonOffset=function(t,e,i){v!==t&&(t?s.enable(s.POLYGON_OFFSET_FILL):s.disable(s.POLYGON_OFFSET_FILL),v=t),!t||y===e&&T===i||(s.polygonOffset(e,i),y=e,T=i)},this.reset=function(){for(var t=0;t<r.length;t++)r[t]=0;E=o=a=n=e=l=null}},THREE.LensFlarePlugin=function(g,v){var y,T,R,_,x,b,w,H,M,S,C,A,P,L,k,D,F=g.context;this.render=function(t,e,i,r){if(0!==v.length){t=new THREE.Vector3;var n=r/i,a=.5*i,o=.5*r,s=16/r,h=new THREE.Vector2(s*n,s),l=new THREE.Vector3(1,1,0),c=new THREE.Vector2(1,1);if(void 0===P){s=new Float32Array([-1,-1,0,0,1,-1,1,0,1,1,1,1,-1,1,0,1]);var u=new Uint16Array([0,1,2,0,2,3]);C=F.createBuffer(),A=F.createBuffer(),F.bindBuffer(F.ARRAY_BUFFER,C),F.bufferData(F.ARRAY_BUFFER,s,F.STATIC_DRAW),F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,A),F.bufferData(F.ELEMENT_ARRAY_BUFFER,u,F.STATIC_DRAW),k=F.createTexture(),D=F.createTexture(),F.bindTexture(F.TEXTURE_2D,k),F.texImage2D(F.TEXTURE_2D,0,F.RGB,16,16,0,F.RGB,F.UNSIGNED_BYTE,null),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.NEAREST),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.NEAREST),F.bindTexture(F.TEXTURE_2D,D),F.texImage2D(F.TEXTURE_2D,0,F.RGBA,16,16,0,F.RGBA,F.UNSIGNED_BYTE,null),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_S,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_WRAP_T,F.CLAMP_TO_EDGE),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MAG_FILTER,F.NEAREST),F.texParameteri(F.TEXTURE_2D,F.TEXTURE_MIN_FILTER,F.NEAREST);s=(L=0<F.getParameter(F.MAX_VERTEX_TEXTURE_IMAGE_UNITS))?{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nuniform sampler2D occlusionMap;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\nvec4 visibility = texture2D( occlusionMap, vec2( 0.1, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.1 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.9 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) );\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.5 ) );\nvVisibility =        visibility.r / 9.0;\nvVisibility *= 1.0 - visibility.g / 9.0;\nvVisibility *=       visibility.b / 9.0;\nvVisibility *= 1.0 - visibility.a / 9.0;\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"uniform lowp int renderType;\nuniform sampler2D map;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvarying float vVisibility;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( 1.0, 0.0, 1.0, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * vVisibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"}:{vertexShader:"uniform lowp int renderType;\nuniform vec3 screenPosition;\nuniform vec2 scale;\nuniform float rotation;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uv;\nvec2 pos = position;\nif( renderType == 2 ) {\npos.x = cos( rotation ) * position.x - sin( rotation ) * position.y;\npos.y = sin( rotation ) * position.x + cos( rotation ) * position.y;\n}\ngl_Position = vec4( ( pos * scale + screenPosition.xy ).xy, screenPosition.z, 1.0 );\n}",fragmentShader:"precision mediump float;\nuniform lowp int renderType;\nuniform sampler2D map;\nuniform sampler2D occlusionMap;\nuniform float opacity;\nuniform vec3 color;\nvarying vec2 vUV;\nvoid main() {\nif( renderType == 0 ) {\ngl_FragColor = vec4( texture2D( map, vUV ).rgb, 0.0 );\n} else if( renderType == 1 ) {\ngl_FragColor = texture2D( map, vUV );\n} else {\nfloat visibility = texture2D( occlusionMap, vec2( 0.5, 0.1 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.9, 0.5 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.5, 0.9 ) ).a;\nvisibility += texture2D( occlusionMap, vec2( 0.1, 0.5 ) ).a;\nvisibility = ( 1.0 - visibility / 4.0 );\nvec4 texture = texture2D( map, vUV );\ntexture.a *= opacity * visibility;\ngl_FragColor = texture;\ngl_FragColor.rgb *= color;\n}\n}"},u=F.createProgram();var d=F.createShader(F.FRAGMENT_SHADER),p=F.createShader(F.VERTEX_SHADER),f="precision "+g.getPrecision()+" float;\n";F.shaderSource(d,f+s.fragmentShader),F.shaderSource(p,f+s.vertexShader),F.compileShader(d),F.compileShader(p),F.attachShader(u,d),F.attachShader(u,p),F.linkProgram(u),P=u,M=F.getAttribLocation(P,"position"),S=F.getAttribLocation(P,"uv"),y=F.getUniformLocation(P,"renderType"),T=F.getUniformLocation(P,"map"),R=F.getUniformLocation(P,"occlusionMap"),_=F.getUniformLocation(P,"opacity"),x=F.getUniformLocation(P,"color"),b=F.getUniformLocation(P,"scale"),w=F.getUniformLocation(P,"rotation"),H=F.getUniformLocation(P,"screenPosition")}for(F.useProgram(P),F.enableVertexAttribArray(M),F.enableVertexAttribArray(S),F.uniform1i(R,0),F.uniform1i(T,1),F.bindBuffer(F.ARRAY_BUFFER,C),F.vertexAttribPointer(M,2,F.FLOAT,!1,16,0),F.vertexAttribPointer(S,2,F.FLOAT,!1,16,8),F.bindBuffer(F.ELEMENT_ARRAY_BUFFER,A),F.disable(F.CULL_FACE),F.depthMask(!1),u=0,d=v.length;u<d;u++)if(s=16/r,h.set(s*n,s),p=v[u],t.set(p.matrixWorld.elements[12],p.matrixWorld.elements[13],p.matrixWorld.elements[14]),t.applyMatrix4(e.matrixWorldInverse),t.applyProjection(e.projectionMatrix),l.copy(t),c.x=l.x*a+a,c.y=l.y*o+o,L||0<c.x&&c.x<i&&0<c.y&&c.y<r){F.activeTexture(F.TEXTURE1),F.bindTexture(F.TEXTURE_2D,k),F.copyTexImage2D(F.TEXTURE_2D,0,F.RGB,c.x-8,c.y-8,16,16,0),F.uniform1i(y,0),F.uniform2f(b,h.x,h.y),F.uniform3f(H,l.x,l.y,l.z),F.disable(F.BLEND),F.enable(F.DEPTH_TEST),F.drawElements(F.TRIANGLES,6,F.UNSIGNED_SHORT,0),F.activeTexture(F.TEXTURE0),F.bindTexture(F.TEXTURE_2D,D),F.copyTexImage2D(F.TEXTURE_2D,0,F.RGBA,c.x-8,c.y-8,16,16,0),F.uniform1i(y,1),F.disable(F.DEPTH_TEST),F.activeTexture(F.TEXTURE1),F.bindTexture(F.TEXTURE_2D,k),F.drawElements(F.TRIANGLES,6,F.UNSIGNED_SHORT,0),p.positionScreen.copy(l),p.customUpdateCallback?p.customUpdateCallback(p):p.updateLensFlares(),F.uniform1i(y,2),F.enable(F.BLEND);f=0;for(var m=p.lensFlares.length;f<m;f++){var E=p.lensFlares[f];.001<E.opacity&&.001<E.scale&&(l.x=E.x,l.y=E.y,l.z=E.z,s=E.size*E.scale/r,h.x=s*n,h.y=s,F.uniform3f(H,l.x,l.y,l.z),F.uniform2f(b,h.x,h.y),F.uniform1f(w,E.rotation),F.uniform1f(_,E.opacity),F.uniform3f(x,E.color.r,E.color.g,E.color.b),g.state.setBlending(E.blending,E.blendEquation,E.blendSrc,E.blendDst),g.setTexture(E.texture,1),F.drawElements(F.TRIANGLES,6,F.UNSIGNED_SHORT,0))}}F.enable(F.CULL_FACE),F.enable(F.DEPTH_TEST),F.depthMask(!0),g.resetGLState()}}},THREE.ShadowMapPlugin=function(f,m,s,E){function g(t,e,i){if(e.visible){var r=s[e.id];if(r&&e.castShadow&&(!1===e.frustumCulled||!0===x.intersectsObject(e)))for(var n=0,a=r.length;n<a;n++){var o=r[n];e._modelViewMatrix.multiplyMatrices(i.matrixWorldInverse,e.matrixWorld),S.push(o)}for(n=0,a=e.children.length;n<a;n++)g(t,e.children[n],i)}}var v,y,T,R,_=f.context,x=new THREE.Frustum,b=new THREE.Matrix4,w=new THREE.Vector3,H=new THREE.Vector3,M=new THREE.Vector3,S=[],t=THREE.ShaderLib.depthRGBA,e=THREE.UniformsUtils.clone(t.uniforms);v=new THREE.ShaderMaterial({uniforms:e,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),y=new THREE.ShaderMaterial({uniforms:e,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,morphTargets:!0}),T=new THREE.ShaderMaterial({uniforms:e,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,skinning:!0}),R=new THREE.ShaderMaterial({uniforms:e,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,morphTargets:!0,skinning:!0}),v._shadowPass=!0,y._shadowPass=!0,T._shadowPass=!0,R._shadowPass=!0,this.render=function(t,e){if(!1!==f.shadowMapEnabled){var i,r,n,a,o,s,h,l,c=[];for(a=0,_.clearColor(1,1,1,1),_.disable(_.BLEND),_.enable(_.CULL_FACE),_.frontFace(_.CCW),f.shadowMapCullFace===THREE.CullFaceFront?_.cullFace(_.FRONT):_.cullFace(_.BACK),f.state.setDepthTest(!0),i=0,r=m.length;i<r;i++)if((n=m[i]).castShadow)if(n instanceof THREE.DirectionalLight&&n.shadowCascade)for(o=0;o<n.shadowCascadeCount;o++){var u;if(n.shadowCascadeArray[o])u=n.shadowCascadeArray[o];else{h=n;var d=o;(u=new THREE.DirectionalLight).isVirtual=!0,u.onlyShadow=!0,u.castShadow=!0,u.shadowCameraNear=h.shadowCameraNear,u.shadowCameraFar=h.shadowCameraFar,u.shadowCameraLeft=h.shadowCameraLeft,u.shadowCameraRight=h.shadowCameraRight,u.shadowCameraBottom=h.shadowCameraBottom,u.shadowCameraTop=h.shadowCameraTop,u.shadowCameraVisible=h.shadowCameraVisible,u.shadowDarkness=h.shadowDarkness,u.shadowBias=h.shadowCascadeBias[d],u.shadowMapWidth=h.shadowCascadeWidth[d],u.shadowMapHeight=h.shadowCascadeHeight[d],u.pointsWorld=[],u.pointsFrustum=[],l=u.pointsWorld,s=u.pointsFrustum;for(var p=0;p<8;p++)l[p]=new THREE.Vector3,s[p]=new THREE.Vector3;l=h.shadowCascadeNearZ[d],h=h.shadowCascadeFarZ[d],s[0].set(-1,-1,l),s[1].set(1,-1,l),s[2].set(-1,1,l),s[3].set(1,1,l),s[4].set(-1,-1,h),s[5].set(1,-1,h),s[6].set(-1,1,h),s[7].set(1,1,h),u.originalCamera=e,(s=new THREE.Gyroscope).position.copy(n.shadowCascadeOffset),s.add(u),s.add(u.target),e.add(s),n.shadowCascadeArray[o]=u}l=o,(h=(d=n).shadowCascadeArray[l]).position.copy(d.position),h.target.position.copy(d.target.position),h.lookAt(h.target),h.shadowCameraVisible=d.shadowCameraVisible,h.shadowDarkness=d.shadowDarkness,h.shadowBias=d.shadowCascadeBias[l],s=d.shadowCascadeNearZ[l],d=d.shadowCascadeFarZ[l],(h=h.pointsFrustum)[0].z=s,h[1].z=s,h[2].z=s,h[3].z=s,h[4].z=d,h[5].z=d,h[6].z=d,h[7].z=d,c[a]=u,a++}else c[a]=n,a++;for(i=0,r=c.length;i<r;i++){if((n=c[i]).shadowMap||(o=THREE.LinearFilter,f.shadowMapType===THREE.PCFSoftShadowMap&&(o=THREE.NearestFilter),n.shadowMap=new THREE.WebGLRenderTarget(n.shadowMapWidth,n.shadowMapHeight,{minFilter:o,magFilter:o,format:THREE.RGBAFormat}),n.shadowMapSize=new THREE.Vector2(n.shadowMapWidth,n.shadowMapHeight),n.shadowMatrix=new THREE.Matrix4),!n.shadowCamera){if(n instanceof THREE.SpotLight)n.shadowCamera=new THREE.PerspectiveCamera(n.shadowCameraFov,n.shadowMapWidth/n.shadowMapHeight,n.shadowCameraNear,n.shadowCameraFar);else{if(!(n instanceof THREE.DirectionalLight)){THREE.error("THREE.ShadowMapPlugin: Unsupported light type for shadow",n);continue}n.shadowCamera=new THREE.OrthographicCamera(n.shadowCameraLeft,n.shadowCameraRight,n.shadowCameraTop,n.shadowCameraBottom,n.shadowCameraNear,n.shadowCameraFar)}t.add(n.shadowCamera),!0===t.autoUpdate&&t.updateMatrixWorld()}if(n.shadowCameraVisible&&!n.cameraHelper&&(n.cameraHelper=new THREE.CameraHelper(n.shadowCamera),t.add(n.cameraHelper)),n.isVirtual&&u.originalCamera==e){for(o=e,a=n.shadowCamera,s=n.pointsFrustum,h=n.pointsWorld,w.set(1/0,1/0,1/0),H.set(-1/0,-1/0,-1/0),d=0;d<8;d++)(l=h[d]).copy(s[d]),l.unproject(o),l.applyMatrix4(a.matrixWorldInverse),l.x<w.x&&(w.x=l.x),l.x>H.x&&(H.x=l.x),l.y<w.y&&(w.y=l.y),l.y>H.y&&(H.y=l.y),l.z<w.z&&(w.z=l.z),l.z>H.z&&(H.z=l.z);a.left=w.x,a.right=H.x,a.top=H.y,a.bottom=w.y,a.updateProjectionMatrix()}for(a=n.shadowMap,s=n.shadowMatrix,(o=n.shadowCamera).position.setFromMatrixPosition(n.matrixWorld),M.setFromMatrixPosition(n.target.matrixWorld),o.lookAt(M),o.updateMatrixWorld(),o.matrixWorldInverse.getInverse(o.matrixWorld),n.cameraHelper&&(n.cameraHelper.visible=n.shadowCameraVisible),n.shadowCameraVisible&&n.cameraHelper.update(),s.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),s.multiply(o.projectionMatrix),s.multiply(o.matrixWorldInverse),b.multiplyMatrices(o.projectionMatrix,o.matrixWorldInverse),x.setFromMatrix(b),f.setRenderTarget(a),f.clear(),S.length=0,g(t,t,o),n=0,a=S.length;n<a;n++)s=(h=S[n]).object,h=h.buffer,d=s.material instanceof THREE.MeshFaceMaterial?s.material.materials[0]:s.material,l=void 0!==s.geometry.morphTargets&&0<s.geometry.morphTargets.length&&d.morphTargets,p=s instanceof THREE.SkinnedMesh&&d.skinning,l=s.customDepthMaterial?s.customDepthMaterial:p?l?R:T:l?y:v,f.setMaterialFaces(d),h instanceof THREE.BufferGeometry?f.renderBufferDirect(o,m,null,l,h,s):f.renderBuffer(o,m,null,l,h,s);for(n=0,a=E.length;n<a;n++)(s=(h=E[n]).object).visible&&s.castShadow&&(s._modelViewMatrix.multiplyMatrices(o.matrixWorldInverse,s.matrixWorld),f.renderImmediateObject(o,m,null,v,s))}i=f.getClearColor(),r=f.getClearAlpha(),_.clearColor(i.r,i.g,i.b,r),_.enable(_.BLEND),f.shadowMapCullFace===THREE.CullFaceFront&&_.cullFace(_.BACK),f.resetGLState()}}},THREE.SpritePlugin=function(l,c){function u(t,e){return t.z!==e.z?e.z-t.z:e.id-t.id}var d,p,f,m,E,g,v,y,T,R,_,x,b,w,H,M,S,C,A,P,L,k=l.context,D=new THREE.Vector3,F=new THREE.Quaternion,z=new THREE.Vector3;this.render=function(t,e){if(0!==c.length){if(void 0===P){var i=new Float32Array([-.5,-.5,0,0,.5,-.5,1,0,.5,.5,1,1,-.5,.5,0,1]),r=new Uint16Array([0,1,2,0,2,3]);C=k.createBuffer(),A=k.createBuffer(),k.bindBuffer(k.ARRAY_BUFFER,C),k.bufferData(k.ARRAY_BUFFER,i,k.STATIC_DRAW),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A),k.bufferData(k.ELEMENT_ARRAY_BUFFER,r,k.STATIC_DRAW);i=k.createProgram(),r=k.createShader(k.VERTEX_SHADER);var n=k.createShader(k.FRAGMENT_SHADER);k.shaderSource(r,["precision "+l.getPrecision()+" float;","uniform mat4 modelViewMatrix;\nuniform mat4 projectionMatrix;\nuniform float rotation;\nuniform vec2 scale;\nuniform vec2 uvOffset;\nuniform vec2 uvScale;\nattribute vec2 position;\nattribute vec2 uv;\nvarying vec2 vUV;\nvoid main() {\nvUV = uvOffset + uv * uvScale;\nvec2 alignedPosition = position * scale;\nvec2 rotatedPosition;\nrotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\nrotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\nvec4 finalPosition;\nfinalPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\nfinalPosition.xy += rotatedPosition;\nfinalPosition = projectionMatrix * finalPosition;\ngl_Position = finalPosition;\n}"].join("\n")),k.shaderSource(n,["precision "+l.getPrecision()+" float;","uniform vec3 color;\nuniform sampler2D map;\nuniform float opacity;\nuniform int fogType;\nuniform vec3 fogColor;\nuniform float fogDensity;\nuniform float fogNear;\nuniform float fogFar;\nuniform float alphaTest;\nvarying vec2 vUV;\nvoid main() {\nvec4 texture = texture2D( map, vUV );\nif ( texture.a < alphaTest ) discard;\ngl_FragColor = vec4( color * texture.xyz, texture.a * opacity );\nif ( fogType > 0 ) {\nfloat depth = gl_FragCoord.z / gl_FragCoord.w;\nfloat fogFactor = 0.0;\nif ( fogType == 1 ) {\nfogFactor = smoothstep( fogNear, fogFar, depth );\n} else {\nconst float LOG2 = 1.442695;\nfloat fogFactor = exp2( - fogDensity * fogDensity * depth * depth * LOG2 );\nfogFactor = 1.0 - clamp( fogFactor, 0.0, 1.0 );\n}\ngl_FragColor = mix( gl_FragColor, vec4( fogColor, gl_FragColor.w ), fogFactor );\n}\n}"].join("\n")),k.compileShader(r),k.compileShader(n),k.attachShader(i,r),k.attachShader(i,n),k.linkProgram(i),P=i,M=k.getAttribLocation(P,"position"),S=k.getAttribLocation(P,"uv"),d=k.getUniformLocation(P,"uvOffset"),p=k.getUniformLocation(P,"uvScale"),f=k.getUniformLocation(P,"rotation"),m=k.getUniformLocation(P,"scale"),E=k.getUniformLocation(P,"color"),g=k.getUniformLocation(P,"map"),v=k.getUniformLocation(P,"opacity"),y=k.getUniformLocation(P,"modelViewMatrix"),T=k.getUniformLocation(P,"projectionMatrix"),R=k.getUniformLocation(P,"fogType"),_=k.getUniformLocation(P,"fogDensity"),x=k.getUniformLocation(P,"fogNear"),b=k.getUniformLocation(P,"fogFar"),w=k.getUniformLocation(P,"fogColor"),H=k.getUniformLocation(P,"alphaTest"),(i=document.createElement("canvas")).width=8,i.height=8,(r=i.getContext("2d")).fillStyle="white",r.fillRect(0,0,8,8),(L=new THREE.Texture(i)).needsUpdate=!0}k.useProgram(P),k.enableVertexAttribArray(M),k.enableVertexAttribArray(S),k.disable(k.CULL_FACE),k.enable(k.BLEND),k.bindBuffer(k.ARRAY_BUFFER,C),k.vertexAttribPointer(M,2,k.FLOAT,!1,16,0),k.vertexAttribPointer(S,2,k.FLOAT,!1,16,8),k.bindBuffer(k.ELEMENT_ARRAY_BUFFER,A),k.uniformMatrix4fv(T,!1,e.projectionMatrix.elements),k.activeTexture(k.TEXTURE0),k.uniform1i(g,0),r=i=0,(n=t.fog)?(k.uniform3f(w,n.color.r,n.color.g,n.color.b),n instanceof THREE.Fog?(k.uniform1f(x,n.near),k.uniform1f(b,n.far),k.uniform1i(R,1),r=i=1):n instanceof THREE.FogExp2&&(k.uniform1f(_,n.density),k.uniform1i(R,2),r=i=2)):(k.uniform1i(R,0),r=i=0);n=0;for(var a=c.length;n<a;n++){(s=c[n])._modelViewMatrix.multiplyMatrices(e.matrixWorldInverse,s.matrixWorld),s.z=-s._modelViewMatrix.elements[14]}c.sort(u);var o=[];for(n=0,a=c.length;n<a;n++){var s,h=(s=c[n]).material;k.uniform1f(H,h.alphaTest),k.uniformMatrix4fv(y,!1,s._modelViewMatrix.elements),s.matrixWorld.decompose(D,F,z),o[0]=z.x,o[1]=z.y,s=0,t.fog&&h.fog&&(s=r),i!==s&&(k.uniform1i(R,s),i=s),null!==h.map?(k.uniform2f(d,h.map.offset.x,h.map.offset.y),k.uniform2f(p,h.map.repeat.x,h.map.repeat.y)):(k.uniform2f(d,0,0),k.uniform2f(p,1,1)),k.uniform1f(v,h.opacity),k.uniform3f(E,h.color.r,h.color.g,h.color.b),k.uniform1f(f,h.rotation),k.uniform2fv(m,o),l.state.setBlending(h.blending,h.blendEquation,h.blendSrc,h.blendDst),l.state.setDepthTest(h.depthTest),l.state.setDepthWrite(h.depthWrite),h.map&&h.map.image&&h.map.image.width?l.setTexture(h.map,0):l.setTexture(L,0),k.drawElements(k.TRIANGLES,6,k.UNSIGNED_SHORT,0)}k.enable(k.CULL_FACE),l.resetGLState()}}},THREE.GeometryUtils={merge:function(t,e,i){var r;THREE.warn("THREE.GeometryUtils: .merge() has been moved to Geometry. Use geometry.merge( geometry2, matrix, materialIndexOffset ) instead."),e instanceof THREE.Mesh&&(e.matrixAutoUpdate&&e.updateMatrix(),r=e.matrix,e=e.geometry),t.merge(e,r,i)},center:function(t){return THREE.warn("THREE.GeometryUtils: .center() has been moved to Geometry. Use geometry.center() instead."),t.center()}},THREE.ImageUtils={crossOrigin:void 0,loadTexture:function(t,e,i,r){var n=new THREE.ImageLoader;n.crossOrigin=this.crossOrigin;var a=new THREE.Texture(void 0,e);return n.load(t,function(t){a.image=t,a.needsUpdate=!0,i&&i(a)},void 0,function(t){r&&r(t)}),a.sourceFile=t,a},loadTextureCube:function(t,e,i,r){var n=new THREE.ImageLoader;n.crossOrigin=this.crossOrigin;var a=new THREE.CubeTexture([],e);a.flipY=!1;var o=0;e=function(e){n.load(t[e],function(t){a.images[e]=t,6===(o+=1)&&(a.needsUpdate=!0,i&&i(a))},void 0,r)};for(var s=0,h=t.length;s<h;++s)e(s);return a},loadCompressedTexture:function(){THREE.error("THREE.ImageUtils.loadCompressedTexture has been removed. Use THREE.DDSLoader instead.")},loadCompressedTextureCube:function(){THREE.error("THREE.ImageUtils.loadCompressedTextureCube has been removed. Use THREE.DDSLoader instead.")},getNormalMap:function(t,e){e|=1;var i=t.width,r=t.height,n=document.createElement("canvas");n.width=i,n.height=r;var a,o,s=n.getContext("2d");s.drawImage(t,0,0);for(var h=s.getImageData(0,0,i,r).data,l=s.createImageData(i,r),c=l.data,u=0;u<i;u++)for(var d=0;d<r;d++){var p=d-1<0?0:d-1,f=r-1<d+1?r-1:d+1,m=u-1<0?0:u-1,E=i-1<u+1?i-1:u+1,g=[],v=[0,0,h[4*(d*i+u)]/255*e];for(g.push([-1,0,h[4*(d*i+m)]/255*e]),g.push([-1,-1,h[4*(p*i+m)]/255*e]),g.push([0,-1,h[4*(p*i+u)]/255*e]),g.push([1,-1,h[4*(p*i+E)]/255*e]),g.push([1,0,h[4*(d*i+E)]/255*e]),g.push([1,1,h[4*(f*i+E)]/255*e]),g.push([0,1,h[4*(f*i+u)]/255*e]),g.push([-1,1,h[4*(f*i+m)]/255*e]),p=[],m=g.length,f=0;f<m;f++){E=g[f];var y=g[(f+1)%m];E=[E[0]-v[0],E[1]-v[1],E[2]-v[2]],y=[y[0]-v[0],y[1]-v[1],y[2]-v[2]];p.push((a=[E[1]*y[2]-E[2]*y[1],E[2]*y[0]-E[0]*y[2],E[0]*y[1]-E[1]*y[0]],void 0,o=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),[a[0]/o,a[1]/o,a[2]/o]))}for(g=[0,0,0],f=0;f<p.length;f++)g[0]+=p[f][0],g[1]+=p[f][1],g[2]+=p[f][2];g[0]/=p.length,g[1]/=p.length,g[2]/=p.length,c[v=4*(d*i+u)]=(g[0]+1)/2*255|0,c[v+1]=(g[1]+1)/2*255|0,c[v+2]=255*g[2]|0,c[v+3]=255}return s.putImageData(l,0,0),n},generateDataTexture:function(t,e,i){var r=t*e,n=new Uint8Array(3*r),a=Math.floor(255*i.r),o=Math.floor(255*i.g);i=Math.floor(255*i.b);for(var s=0;s<r;s++)n[3*s]=a,n[3*s+1]=o,n[3*s+2]=i;return(t=new THREE.DataTexture(n,t,e,THREE.RGBFormat)).needsUpdate=!0,t}},THREE.SceneUtils={createMultiMaterialObject:function(t,e){for(var i=new THREE.Object3D,r=0,n=e.length;r<n;r++)i.add(new THREE.Mesh(t,e[r]));return i},detach:function(t,e,i){t.applyMatrix(e.matrixWorld),e.remove(t),i.add(t)},attach:function(t,e,i){var r=new THREE.Matrix4;r.getInverse(i.matrixWorld),t.applyMatrix(r),e.remove(t),i.add(t)}},THREE.FontUtils={faces:{},face:"helvetiker",weight:"normal",style:"normal",size:150,divisions:10,getFace:function(){try{return this.faces[this.face][this.weight][this.style]}catch(t){throw"The font "+this.face+" with "+this.weight+" weight and "+this.style+" style is missing."}},loadFace:function(t){var e=t.familyName.toLowerCase();return this.faces[e]=this.faces[e]||{},this.faces[e][t.cssFontWeight]=this.faces[e][t.cssFontWeight]||{},this.faces[e][t.cssFontWeight][t.cssFontStyle]=t,this.faces[e][t.cssFontWeight][t.cssFontStyle]=t},drawText:function(t){var e=this.getFace(),i=this.size/e.resolution,r=0,n=String(t).split(""),a=n.length,o=[];for(t=0;t<a;t++){var s=new THREE.Path;r=r+(s=this.extractGlyphPoints(n[t],e,i,r,s)).offset;o.push(s.path)}return{paths:o,offset:r/2}},extractGlyphPoints:function(t,e,i,r,n){var a,o,s,h,l,c,u,d,p,f,m,E=[],g=e.glyphs[t]||e.glyphs["?"];if(g){if(g.o)for(h=(e=g._cachedOutline||(g._cachedOutline=g.o.split(" "))).length,t=0;t<h;)switch(s=e[t++]){case"m":s=e[t++]*i+r,l=e[t++]*i,n.moveTo(s,l);break;case"l":s=e[t++]*i+r,l=e[t++]*i,n.lineTo(s,l);break;case"q":if(s=e[t++]*i+r,l=e[t++]*i,d=e[t++]*i+r,p=e[t++]*i,n.quadraticCurveTo(d,p,s,l),a=E[E.length-1])for(c=a.x,u=a.y,a=1,o=this.divisions;a<=o;a++){var v=a/o;THREE.Shape.Utils.b2(v,c,d,s),THREE.Shape.Utils.b2(v,u,p,l)}break;case"b":if(s=e[t++]*i+r,l=e[t++]*i,d=e[t++]*i+r,p=e[t++]*i,f=e[t++]*i+r,m=e[t++]*i,n.bezierCurveTo(d,p,f,m,s,l),a=E[E.length-1])for(c=a.x,u=a.y,a=1,o=this.divisions;a<=o;a++)v=a/o,THREE.Shape.Utils.b3(v,c,d,f,s),THREE.Shape.Utils.b3(v,u,p,m,l)}return{offset:g.ha*i,path:n}}}},THREE.FontUtils.generateShapes=function(t,e){var i=void 0!==(e=e||{}).curveSegments?e.curveSegments:4,r=void 0!==e.font?e.font:"helvetiker",n=void 0!==e.weight?e.weight:"normal",a=void 0!==e.style?e.style:"normal";for(THREE.FontUtils.size=void 0!==e.size?e.size:100,THREE.FontUtils.divisions=i,THREE.FontUtils.face=r,THREE.FontUtils.weight=n,THREE.FontUtils.style=a,r=[],n=0,a=(i=THREE.FontUtils.drawText(t).paths).length;n<a;n++)Array.prototype.push.apply(r,i[n].toShapes());return r},function(t){var C=function(t){for(var e=t.length,i=0,r=e-1,n=0;n<e;r=n++)i+=t[r].x*t[n].y-t[n].x*t[r].y;return.5*i};t.Triangulate=function(t,e){var i=t.length;if(i<3)return null;var r,n,a,o=[],s=[],h=[];if(0<C(t))for(n=0;n<i;n++)s[n]=n;else for(n=0;n<i;n++)s[n]=i-1-n;var l=2*i;for(n=i-1;2<i;){if(l--<=0){THREE.warn("THREE.FontUtils: Warning, unable to triangulate polygon! in Triangulate.process()");break}var c;i<=(r=n)&&(r=0),i<=(n=r+1)&&(n=0),i<=(a=n+1)&&(a=0);t:{var u=c=void 0,d=void 0,p=void 0,f=void 0,m=(u=t[s[r]].x,t[s[r]].y),E=t[s[n]].x,g=t[s[n]].y,v=t[s[a]].x;if((E-u)*((d=t[s[a]].y)-m)-(g-m)*(v-u)<1e-10)c=!1;else{var y=void 0,T=void 0,R=void 0,_=void 0,x=(R=T=y=f=p=void 0,v-E),b=d-g,w=u-v,H=m-d,M=E-u,S=g-m;for(c=0;c<i;c++)if(p=t[s[c]].x,f=t[s[c]].y,!(p===u&&f===m||p===E&&f===g||p===v&&f===d)&&(R=p-E,_=f-g,y=M*(T=f-m)-S*(y=p-u),T=w*(f-=d)-H*(p-=v),-1e-10<=(R=x*_-b*R)&&-1e-10<=T&&-1e-10<=y)){c=!1;break t}c=!0}}if(c){for(o.push([t[s[r]],t[s[n]],t[s[a]]]),h.push([s[r],s[n],s[a]]),a=(r=n)+1;a<i;r++,a++)s[r]=s[a];l=2*--i}}return e?h:o},t.Triangulate.area=C}(THREE.FontUtils),self._typeface_js={faces:THREE.FontUtils.faces,loadFace:THREE.FontUtils.loadFace},THREE.typeface_js=self._typeface_js,THREE.Audio=function(t){THREE.Object3D.call(this),this.type="Audio",this.context=t.context,this.source=this.context.createBufferSource(),this.source.onended=this.onEnded.bind(this),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.panner=this.context.createPanner(),this.panner.connect(this.gain),this.autoplay=!1,this.startTime=0,this.isPlaying=!1},THREE.Audio.prototype=Object.create(THREE.Object3D.prototype),THREE.Audio.prototype.constructor=THREE.Audio,THREE.Audio.prototype.load=function(t){var e=this,i=new XMLHttpRequest;return i.open("GET",t,!0),i.responseType="arraybuffer",i.onload=function(t){e.context.decodeAudioData(this.response,function(t){e.source.buffer=t,e.autoplay&&e.play()})},i.send(),this},THREE.Audio.prototype.play=function(){if(!0===this.isPlaying)THREE.warn("THREE.Audio: Audio is already playing.");else{var t=this.context.createBufferSource();t.buffer=this.source.buffer,t.loop=this.source.loop,t.onended=this.source.onended,t.connect(this.panner),t.start(0,this.startTime),this.isPlaying=!0,this.source=t}},THREE.Audio.prototype.pause=function(){this.source.stop(),this.startTime=this.context.currentTime},THREE.Audio.prototype.stop=function(){this.source.stop(),this.startTime=0},THREE.Audio.prototype.onEnded=function(){this.isPlaying=!1},THREE.Audio.prototype.setLoop=function(t){this.source.loop=t},THREE.Audio.prototype.setRefDistance=function(t){this.panner.refDistance=t},THREE.Audio.prototype.setRolloffFactor=function(t){this.panner.rolloffFactor=t},THREE.Audio.prototype.setVolume=function(t){this.gain.gain.value=t},THREE.Audio.prototype.updateMatrixWorld=function(){var e=new THREE.Vector3;return function(t){THREE.Object3D.prototype.updateMatrixWorld.call(this,t),e.setFromMatrixPosition(this.matrixWorld),this.panner.setPosition(e.x,e.y,e.z)}}(),THREE.AudioListener=function(){THREE.Object3D.call(this),this.type="AudioListener",this.context=new(window.AudioContext||window.webkitAudioContext)},THREE.AudioListener.prototype=Object.create(THREE.Object3D.prototype),THREE.AudioListener.prototype.constructor=THREE.AudioListener,THREE.AudioListener.prototype.updateMatrixWorld=function(){var i=new THREE.Vector3,r=new THREE.Quaternion,n=new THREE.Vector3,a=new THREE.Vector3,o=new THREE.Vector3,s=new THREE.Vector3;return function(t){THREE.Object3D.prototype.updateMatrixWorld.call(this,t),t=this.context.listener;var e=this.up;this.matrixWorld.decompose(i,r,n),a.set(0,0,-1).applyQuaternion(r),o.subVectors(i,s),t.setPosition(i.x,i.y,i.z),t.setOrientation(a.x,a.y,a.z,e.x,e.y,e.z),t.setVelocity(o.x,o.y,o.z),s.copy(i)}}(),THREE.Curve=function(){},THREE.Curve.prototype.getPoint=function(t){return THREE.warn("THREE.Curve: Warning, getPoint() not implemented!"),null},THREE.Curve.prototype.getPointAt=function(t){return t=this.getUtoTmapping(t),this.getPoint(t)},THREE.Curve.prototype.getPoints=function(t){t||(t=5);var e,i=[];for(e=0;e<=t;e++)i.push(this.getPoint(e/t));return i},THREE.Curve.prototype.getSpacedPoints=function(t){t||(t=5);var e,i=[];for(e=0;e<=t;e++)i.push(this.getPointAt(e/t));return i},THREE.Curve.prototype.getLength=function(){var t=this.getLengths();return t[t.length-1]},THREE.Curve.prototype.getLengths=function(t){if(t||(t=this.__arcLengthDivisions?this.__arcLengthDivisions:200),this.cacheArcLengths&&this.cacheArcLengths.length==t+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;var e,i,r=[],n=this.getPoint(0),a=0;for(r.push(0),i=1;i<=t;i++)a+=(e=this.getPoint(i/t)).distanceTo(n),r.push(a),n=e;return this.cacheArcLengths=r},THREE.Curve.prototype.updateArcLengths=function(){this.needsUpdate=!0,this.getLengths()},THREE.Curve.prototype.getUtoTmapping=function(t,e){var i,r=this.getLengths(),n=0,a=r.length;i=e||t*r[a-1];for(var o,s=0,h=a-1;s<=h;)if((o=r[n=Math.floor(s+(h-s)/2)]-i)<0)s=n+1;else{if(!(0<o)){h=n;break}h=n-1}return r[n=h]==i?n/(a-1):r=(n+(i-(s=r[n]))/(r[n+1]-s))/(a-1)},THREE.Curve.prototype.getTangent=function(t){var e=t-1e-4;return e<0&&(e=0),1<(t+=1e-4)&&(t=1),e=this.getPoint(e),this.getPoint(t).clone().sub(e).normalize()},THREE.Curve.prototype.getTangentAt=function(t){return t=this.getUtoTmapping(t),this.getTangent(t)},THREE.Curve.Utils={tangentQuadraticBezier:function(t,e,i,r){return 2*(1-t)*(i-e)+2*t*(r-i)},tangentCubicBezier:function(t,e,i,r,n){return-3*e*(1-t)*(1-t)+3*i*(1-t)*(1-t)-6*t*i*(1-t)+6*t*r*(1-t)-3*t*t*r+3*t*t*n},tangentSpline:function(t,e,i,r,n){return 6*t*t-6*t+(3*t*t-4*t+1)+(-6*t*t+6*t)+(3*t*t-2*t)},interpolate:function(t,e,i,r,n){var a=n*n;return(2*e-2*i+(t=.5*(i-t))+(r=.5*(r-e)))*n*a+(-3*e+3*i-2*t-r)*a+t*n+e}},THREE.Curve.create=function(t,e){return t.prototype=Object.create(THREE.Curve.prototype),(t.prototype.constructor=t).prototype.getPoint=e,t},THREE.CurvePath=function(){this.curves=[],this.bends=[],this.autoClose=!1},THREE.CurvePath.prototype=Object.create(THREE.Curve.prototype),THREE.CurvePath.prototype.constructor=THREE.CurvePath,THREE.CurvePath.prototype.add=function(t){this.curves.push(t)},THREE.CurvePath.prototype.checkConnection=function(){},THREE.CurvePath.prototype.closePath=function(){var t=this.curves[0].getPoint(0),e=this.curves[this.curves.length-1].getPoint(1);t.equals(e)||this.curves.push(new THREE.LineCurve(e,t))},THREE.CurvePath.prototype.getPoint=function(t){var e=t*this.getLength(),i=this.getCurveLengths();for(t=0;t<i.length;){if(i[t]>=e)return e=1-(e=i[t]-e)/(t=this.curves[t]).getLength(),t.getPointAt(e);t++}return null},THREE.CurvePath.prototype.getLength=function(){var t=this.getCurveLengths();return t[t.length-1]},THREE.CurvePath.prototype.getCurveLengths=function(){if(this.cacheLengths&&this.cacheLengths.length==this.curves.length)return this.cacheLengths;var t,e=[],i=0,r=this.curves.length;for(t=0;t<r;t++)i+=this.curves[t].getLength(),e.push(i);return this.cacheLengths=e},THREE.CurvePath.prototype.getBoundingBox=function(){var t,e,i,r,n,a,o=this.getPoints();t=e=Number.NEGATIVE_INFINITY,r=n=Number.POSITIVE_INFINITY;var s,h,l,c,u=o[0]instanceof THREE.Vector3;for(c=u?new THREE.Vector3:new THREE.Vector2,h=0,l=o.length;h<l;h++)(s=o[h]).x>t?t=s.x:s.x<r&&(r=s.x),s.y>e?e=s.y:s.y<n&&(n=s.y),u&&(s.z>i?i=s.z:s.z<a&&(a=s.z)),c.add(s);return o={minX:r,minY:n,maxX:t,maxY:e},u&&(o.maxZ=i,o.minZ=a),o},THREE.CurvePath.prototype.createPointsGeometry=function(t){return t=this.getPoints(t,!0),this.createGeometry(t)},THREE.CurvePath.prototype.createSpacedPointsGeometry=function(t){return t=this.getSpacedPoints(t,!0),this.createGeometry(t)},THREE.CurvePath.prototype.createGeometry=function(t){for(var e=new THREE.Geometry,i=0;i<t.length;i++)e.vertices.push(new THREE.Vector3(t[i].x,t[i].y,t[i].z||0));return e},THREE.CurvePath.prototype.addWrapPath=function(t){this.bends.push(t)},THREE.CurvePath.prototype.getTransformedPoints=function(t,e){var i,r,n=this.getPoints(t);for(e||(e=this.bends),i=0,r=e.length;i<r;i++)n=this.getWrapPoints(n,e[i]);return n},THREE.CurvePath.prototype.getTransformedSpacedPoints=function(t,e){var i,r,n=this.getSpacedPoints(t);for(e||(e=this.bends),i=0,r=e.length;i<r;i++)n=this.getWrapPoints(n,e[i]);return n},THREE.CurvePath.prototype.getWrapPoints=function(t,e){var i,r,n,a,o,s,h=this.getBoundingBox();for(i=0,r=t.length;i<r;i++)a=(n=t[i]).x,o=n.y,s=a/h.maxX,s=e.getUtoTmapping(s,a),a=e.getPoint(s),(s=e.getTangent(s)).set(-s.y,s.x).multiplyScalar(o),n.x=a.x+s.x,n.y=a.y+s.y;return t},THREE.Gyroscope=function(){THREE.Object3D.call(this)},THREE.Gyroscope.prototype=Object.create(THREE.Object3D.prototype),THREE.Gyroscope.prototype.constructor=THREE.Gyroscope,THREE.Gyroscope.prototype.updateMatrixWorld=function(){var r=new THREE.Vector3,n=new THREE.Quaternion,a=new THREE.Vector3,o=new THREE.Vector3,s=new THREE.Quaternion,h=new THREE.Vector3;return function(t){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||t)&&(this.parent?(this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix),this.matrixWorld.decompose(o,s,h),this.matrix.decompose(r,n,a),this.matrixWorld.compose(o,n,h)):this.matrixWorld.copy(this.matrix),t=!(this.matrixWorldNeedsUpdate=!1));for(var e=0,i=this.children.length;e<i;e++)this.children[e].updateMatrixWorld(t)}}(),THREE.Path=function(t){THREE.CurvePath.call(this),this.actions=[],t&&this.fromPoints(t)},THREE.Path.prototype=Object.create(THREE.CurvePath.prototype),THREE.Path.prototype.constructor=THREE.Path,THREE.PathActions={MOVE_TO:"moveTo",LINE_TO:"lineTo",QUADRATIC_CURVE_TO:"quadraticCurveTo",BEZIER_CURVE_TO:"bezierCurveTo",CSPLINE_THRU:"splineThru",ARC:"arc",ELLIPSE:"ellipse"},THREE.Path.prototype.fromPoints=function(t){this.moveTo(t[0].x,t[0].y);for(var e=1,i=t.length;e<i;e++)this.lineTo(t[e].x,t[e].y)},THREE.Path.prototype.moveTo=function(t,e){var i=Array.prototype.slice.call(arguments);this.actions.push({action:THREE.PathActions.MOVE_TO,args:i})},THREE.Path.prototype.lineTo=function(t,e){var i=Array.prototype.slice.call(arguments),r=this.actions[this.actions.length-1].args;r=new THREE.LineCurve(new THREE.Vector2(r[r.length-2],r[r.length-1]),new THREE.Vector2(t,e));this.curves.push(r),this.actions.push({action:THREE.PathActions.LINE_TO,args:i})},THREE.Path.prototype.quadraticCurveTo=function(t,e,i,r){var n=Array.prototype.slice.call(arguments),a=this.actions[this.actions.length-1].args;a=new THREE.QuadraticBezierCurve(new THREE.Vector2(a[a.length-2],a[a.length-1]),new THREE.Vector2(t,e),new THREE.Vector2(i,r));this.curves.push(a),this.actions.push({action:THREE.PathActions.QUADRATIC_CURVE_TO,args:n})},THREE.Path.prototype.bezierCurveTo=function(t,e,i,r,n,a){var o=Array.prototype.slice.call(arguments),s=this.actions[this.actions.length-1].args;s=new THREE.CubicBezierCurve(new THREE.Vector2(s[s.length-2],s[s.length-1]),new THREE.Vector2(t,e),new THREE.Vector2(i,r),new THREE.Vector2(n,a));this.curves.push(s),this.actions.push({action:THREE.PathActions.BEZIER_CURVE_TO,args:o})},THREE.Path.prototype.splineThru=function(t){var e=Array.prototype.slice.call(arguments),i=this.actions[this.actions.length-1].args;i=[new THREE.Vector2(i[i.length-2],i[i.length-1])];Array.prototype.push.apply(i,t),i=new THREE.SplineCurve(i),this.curves.push(i),this.actions.push({action:THREE.PathActions.CSPLINE_THRU,args:e})},THREE.Path.prototype.arc=function(t,e,i,r,n,a){var o=this.actions[this.actions.length-1].args;this.absarc(t+o[o.length-2],e+o[o.length-1],i,r,n,a)},THREE.Path.prototype.absarc=function(t,e,i,r,n,a){this.absellipse(t,e,i,i,r,n,a)},THREE.Path.prototype.ellipse=function(t,e,i,r,n,a,o){var s=this.actions[this.actions.length-1].args;this.absellipse(t+s[s.length-2],e+s[s.length-1],i,r,n,a,o)},THREE.Path.prototype.absellipse=function(t,e,i,r,n,a,o){var s=Array.prototype.slice.call(arguments),h=new THREE.EllipseCurve(t,e,i,r,n,a,o);this.curves.push(h),h=h.getPoint(1),s.push(h.x),s.push(h.y),this.actions.push({action:THREE.PathActions.ELLIPSE,args:s})},THREE.Path.prototype.getSpacedPoints=function(t,e){t||(t=40);for(var i=[],r=0;r<t;r++)i.push(this.getPoint(r/t));return i},THREE.Path.prototype.getPoints=function(t,e){if(this.useSpacedPoints)return console.log("tata"),this.getSpacedPoints(t,e);t=t||12;var i,r,n,a,o,s,h,l,c,u,d,p,f,m=[];for(i=0,r=this.actions.length;i<r;i++)switch(n=this.actions[i],a=n.action,n=n.args,a){case THREE.PathActions.MOVE_TO:case THREE.PathActions.LINE_TO:m.push(new THREE.Vector2(n[0],n[1]));break;case THREE.PathActions.QUADRATIC_CURVE_TO:for(o=n[2],s=n[3],c=n[0],u=n[1],0<m.length?(d=(a=m[m.length-1]).x,p=a.y):(d=(a=this.actions[i-1].args)[a.length-2],p=a[a.length-1]),n=1;n<=t;n++)f=n/t,a=THREE.Shape.Utils.b2(f,d,c,o),f=THREE.Shape.Utils.b2(f,p,u,s),m.push(new THREE.Vector2(a,f));break;case THREE.PathActions.BEZIER_CURVE_TO:for(o=n[4],s=n[5],c=n[0],u=n[1],h=n[2],l=n[3],0<m.length?(d=(a=m[m.length-1]).x,p=a.y):(d=(a=this.actions[i-1].args)[a.length-2],p=a[a.length-1]),n=1;n<=t;n++)f=n/t,a=THREE.Shape.Utils.b3(f,d,c,h,o),f=THREE.Shape.Utils.b3(f,p,u,l,s),m.push(new THREE.Vector2(a,f));break;case THREE.PathActions.CSPLINE_THRU:for(a=this.actions[i-1].args,f=[new THREE.Vector2(a[a.length-2],a[a.length-1])],a=t*n[0].length,f=f.concat(n[0]),f=new THREE.SplineCurve(f),n=1;n<=a;n++)m.push(f.getPointAt(n/a));break;case THREE.PathActions.ARC:for(o=n[0],s=n[1],u=n[2],h=n[3],a=n[4],c=!!n[5],d=a-h,p=2*t,n=1;n<=p;n++)f=n/p,c||(f=1-f),f=h+f*d,a=o+u*Math.cos(f),f=s+u*Math.sin(f),m.push(new THREE.Vector2(a,f));break;case THREE.PathActions.ELLIPSE:for(o=n[0],s=n[1],u=n[2],l=n[3],h=n[4],a=n[5],c=!!n[6],d=a-h,p=2*t,n=1;n<=p;n++)f=n/p,c||(f=1-f),f=h+f*d,a=o+u*Math.cos(f),f=s+l*Math.sin(f),m.push(new THREE.Vector2(a,f))}return i=m[m.length-1],Math.abs(i.x-m[0].x)<1e-10&&Math.abs(i.y-m[0].y)<1e-10&&m.splice(m.length-1,1),e&&m.push(m[0]),m},THREE.Path.prototype.toShapes=function(t,e){function i(t){for(var e=[],i=0,r=t.length;i<r;i++){var n=t[i],a=new THREE.Shape;a.actions=n.actions,a.curves=n.curves,e.push(a)}return e}var r=function(t){var e,i,r,n,a=[],o=new THREE.Path;for(e=0,i=t.length;e<i;e++)n=(r=t[e]).args,(r=r.action)==THREE.PathActions.MOVE_TO&&0!=o.actions.length&&(a.push(o),o=new THREE.Path),o[r].apply(o,n);return 0!=o.actions.length&&a.push(o),a}(this.actions);if(0==r.length)return[];if(!0===e)return i(r);var n,a,o,s=[];if(1==r.length)return a=r[0],(o=new THREE.Shape).actions=a.actions,o.curves=a.curves,s.push(o),s;var h=!THREE.Shape.Utils.isClockWise(r[0].getPoints());h=t?!h:h;o=[];var l,c,u,d=[],p=[],f=0;for(d[f]=void 0,p[f]=[],c=0,u=r.length;c<u;c++)l=(a=r[c]).getPoints(),n=THREE.Shape.Utils.isClockWise(l),(n=t?!n:n)?(!h&&d[f]&&f++,d[f]={s:new THREE.Shape,p:l},d[f].s.actions=a.actions,d[f].s.curves=a.curves,h&&f++,p[f]=[]):p[f].push({h:a,p:l[0]});if(!d[0])return i(r);if(1<d.length){for(c=!1,u=[],a=0,r=d.length;a<r;a++)o[a]=[];for(a=0,r=d.length;a<r;a++)for(n=p[a],h=0;h<n.length;h++){f=n[h],l=!0;for(var m=0;m<d.length;m++)(function(t,e){for(var i=e.length,r=!1,n=i-1,a=0;a<i;n=a++){var o=e[n],s=e[a],h=s.x-o.x,l=s.y-o.y;if(1e-10<Math.abs(l)){if(l<0&&(o=e[a],h=-h,s=e[n],l=-l),!(t.y<o.y||t.y>s.y))if(t.y==o.y){if(t.x==o.x)return!0}else{if(0==(n=l*(t.x-o.x)-h*(t.y-o.y)))return!0;n<0||(r=!r)}}else if(t.y==o.y&&(s.x<=t.x&&t.x<=o.x||o.x<=t.x&&t.x<=s.x))return!0}return r})(f.p,d[m].p)&&(a!=m&&u.push({froms:a,tos:m,hole:h}),l?(l=!1,o[m].push(f)):c=!0);l&&o[a].push(f)}0<u.length&&(c||(p=o))}for(c=0,u=d.length;c<u;c++)for(o=d[c].s,s.push(o),r=0,n=(a=p[c]).length;r<n;r++)o.holes.push(a[r].h);return s},THREE.Shape=function(){THREE.Path.apply(this,arguments),this.holes=[]},THREE.Shape.prototype=Object.create(THREE.Path.prototype),THREE.Shape.prototype.constructor=THREE.Shape,THREE.Shape.prototype.extrude=function(t){return new THREE.ExtrudeGeometry(this,t)},THREE.Shape.prototype.makeGeometry=function(t){return new THREE.ShapeGeometry(this,t)},THREE.Shape.prototype.getPointsHoles=function(t){var e,i=this.holes.length,r=[];for(e=0;e<i;e++)r[e]=this.holes[e].getTransformedPoints(t,this.bends);return r},THREE.Shape.prototype.getSpacedPointsHoles=function(t){var e,i=this.holes.length,r=[];for(e=0;e<i;e++)r[e]=this.holes[e].getTransformedSpacedPoints(t,this.bends);return r},THREE.Shape.prototype.extractAllPoints=function(t){return{shape:this.getTransformedPoints(t),holes:this.getPointsHoles(t)}},THREE.Shape.prototype.extractPoints=function(t){return this.useSpacedPoints?this.extractAllSpacedPoints(t):this.extractAllPoints(t)},THREE.Shape.prototype.extractAllSpacedPoints=function(t){return{shape:this.getTransformedSpacedPoints(t),holes:this.getSpacedPointsHoles(t)}},THREE.Shape.Utils={triangulateShape:function(E,t){function p(t,e,i){return t.x!=e.x?t.x<e.x?t.x<=i.x&&i.x<=e.x:e.x<=i.x&&i.x<=t.x:t.y<e.y?t.y<=i.y&&i.y<=e.y:e.y<=i.y&&i.y<=t.y}function g(t,e,i,r,n){var a=e.x-t.x,o=e.y-t.y,s=r.x-i.x,h=r.y-i.y,l=t.x-i.x,c=t.y-i.y,u=o*s-a*h,d=o*l-a*c;if(1e-10<Math.abs(u)){if(0<u){if(d<0||u<d)return[];if((s=h*l-s*c)<0||u<s)return[]}else{if(0<d||d<u)return[];if(0<(s=h*l-s*c)||s<u)return[]}return 0==s?!n||0!=d&&d!=u?[t]:[]:s==u?!n||0!=d&&d!=u?[e]:[]:0==d?[i]:d==u?[r]:(n=s/u,[{x:t.x+n*a,y:t.y+n*o}])}return 0!=d||h*l!=s*c?[]:(s=0==s&&0==h,(o=0==a&&0==o)&&s?t.x!=i.x||t.y!=i.y?[]:[t]:o?p(i,r,t)?[t]:[]:s?p(t,e,i)?[i]:[]:(0!=a?(t.x<e.x?(s=(a=t).x,t=(o=e).x):(s=(a=e).x,t=(o=t).x),i.x<r.x?(u=(e=i).x,i=(h=r).x):(u=(e=r).x,i=(h=i).x)):(t.y<e.y?(s=(a=t).y,t=(o=e).y):(s=(a=e).y,t=(o=t).y),i.y<r.y?(u=(e=i).y,i=(h=r).y):(u=(e=r).y,i=(h=i).y)),s<=u?t<u?[]:t==u?n?[]:[e]:t<=i?[e,o]:[e,h]:i<s?[]:s==i?n?[]:[a]:t<=i?[a,o]:[a,h]))}function v(t,e,i,r){var n=e.x-t.x,a=e.y-t.y;e=i.x-t.x,i=i.y-t.y;var o=r.x-t.x;return r=r.y-t.y,t=n*i-a*e,n=n*r-a*o,1e-10<Math.abs(t)?(e=o*i-r*e,0<t?0<=n&&0<=e:0<=n||0<=e):0<n}var e,i,r,n,a,o={};for(r=E.concat(),e=0,i=t.length;e<i;e++)Array.prototype.push.apply(r,t[e]);for(e=0,i=r.length;e<i;e++)void 0!==o[a=r[e].x+":"+r[e].y]&&THREE.warn("THREE.Shape: Duplicate point",a),o[a]=e;e=function(t,o){var a,e,i,r,n,s,h,l,c,u=E.concat(),d=[],p=[],f=0;for(e=o.length;f<e;f++)d.push(f);h=0;for(var m=2*d.length;0<d.length;){if(--m<0){console.log("Infinite Loop! Holes left:"+d.length+", Probably Hole outside Shape!");break}for(i=h;i<u.length;i++){for(r=u[i],e=-1,f=0;f<d.length;f++)if(n=d[f],void 0===p[s=r.x+":"+r.y+":"+n]){for(a=o[n],l=0;l<a.length;l++)if(n=a[l],function(t,e){var i=u.length-1,r=t-1;r<0&&(r=i);var n=t+1;return i<n&&(n=0),!!(i=v(u[t],u[r],u[n],a[e]))&&(i=a.length-1,(r=e-1)<0&&(r=i),i<(n=e+1)&&(n=0),!!(i=v(a[e],a[r],a[n],u[t])))}(i,l)&&!function(t,e){var i,r;for(i=0;i<u.length;i++)if(r=i+1,r%=u.length,0<(r=g(t,e,u[i],u[r],!0)).length)return!0;return!1}(r,n)&&!function(t,e){var i,r,n,a;for(i=0;i<d.length;i++)for(r=o[d[i]],n=0;n<r.length;n++)if(a=n+1,a%=r.length,0<(a=g(t,e,r[n],r[a],!0)).length)return!0;return!1}(r,n)){e=l,d.splice(f,1),h=u.slice(0,i+1),n=u.slice(i),l=a.slice(e),c=a.slice(0,e+1),u=h.concat(l).concat(c).concat(n),h=i;break}if(0<=e)break;p[s]=!0}if(0<=e)break}}return u}(0,t);var s=THREE.FontUtils.Triangulate(e,!1);for(e=0,i=s.length;e<i;e++)for(n=s[e],r=0;r<3;r++)void 0!==(a=o[a=n[r].x+":"+n[r].y])&&(n[r]=a);return s.concat()},isClockWise:function(t){return THREE.FontUtils.Triangulate.area(t)<0},b2p0:function(t,e){var i=1-t;return i*i*e},b2p1:function(t,e){return 2*(1-t)*t*e},b2p2:function(t,e){return t*t*e},b2:function(t,e,i,r){return this.b2p0(t,e)+this.b2p1(t,i)+this.b2p2(t,r)},b3p0:function(t,e){var i=1-t;return i*i*i*e},b3p1:function(t,e){var i=1-t;return 3*i*i*t*e},b3p2:function(t,e){return 3*(1-t)*t*t*e},b3p3:function(t,e){return t*t*t*e},b3:function(t,e,i,r,n){return this.b3p0(t,e)+this.b3p1(t,i)+this.b3p2(t,r)+this.b3p3(t,n)}},THREE.LineCurve=function(t,e){this.v1=t,this.v2=e},THREE.LineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.LineCurve.prototype.constructor=THREE.LineCurve,THREE.LineCurve.prototype.getPoint=function(t){var e=this.v2.clone().sub(this.v1);return e.multiplyScalar(t).add(this.v1),e},THREE.LineCurve.prototype.getPointAt=function(t){return this.getPoint(t)},THREE.LineCurve.prototype.getTangent=function(t){return this.v2.clone().sub(this.v1).normalize()},THREE.QuadraticBezierCurve=function(t,e,i){this.v0=t,this.v1=e,this.v2=i},THREE.QuadraticBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.QuadraticBezierCurve.prototype.constructor=THREE.QuadraticBezierCurve,THREE.QuadraticBezierCurve.prototype.getPoint=function(t){var e=new THREE.Vector2;return e.x=THREE.Shape.Utils.b2(t,this.v0.x,this.v1.x,this.v2.x),e.y=THREE.Shape.Utils.b2(t,this.v0.y,this.v1.y,this.v2.y),e},THREE.QuadraticBezierCurve.prototype.getTangent=function(t){var e=new THREE.Vector2;return e.x=THREE.Curve.Utils.tangentQuadraticBezier(t,this.v0.x,this.v1.x,this.v2.x),e.y=THREE.Curve.Utils.tangentQuadraticBezier(t,this.v0.y,this.v1.y,this.v2.y),e.normalize()},THREE.CubicBezierCurve=function(t,e,i,r){this.v0=t,this.v1=e,this.v2=i,this.v3=r},THREE.CubicBezierCurve.prototype=Object.create(THREE.Curve.prototype),THREE.CubicBezierCurve.prototype.constructor=THREE.CubicBezierCurve,THREE.CubicBezierCurve.prototype.getPoint=function(t){var e;return e=THREE.Shape.Utils.b3(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t=THREE.Shape.Utils.b3(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),new THREE.Vector2(e,t)},THREE.CubicBezierCurve.prototype.getTangent=function(t){var e;return e=THREE.Curve.Utils.tangentCubicBezier(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),t=THREE.Curve.Utils.tangentCubicBezier(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),(e=new THREE.Vector2(e,t)).normalize(),e},THREE.SplineCurve=function(t){this.points=null==t?[]:t},THREE.SplineCurve.prototype=Object.create(THREE.Curve.prototype),THREE.SplineCurve.prototype.constructor=THREE.SplineCurve,THREE.SplineCurve.prototype.getPoint=function(t){t*=(a=this.points).length-1,t-=e=Math.floor(t);var e,i=a[0==e?e:e-1],r=a[e],n=a[e>a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return(e=new THREE.Vector2).x=THREE.Curve.Utils.interpolate(i.x,r.x,n.x,a.x,t),e.y=THREE.Curve.Utils.interpolate(i.y,r.y,n.y,a.y,t),e},THREE.EllipseCurve=function(t,e,i,r,n,a,o){this.aX=t,this.aY=e,this.xRadius=i,this.yRadius=r,this.aStartAngle=n,this.aEndAngle=a,this.aClockwise=o},THREE.EllipseCurve.prototype=Object.create(THREE.Curve.prototype),THREE.EllipseCurve.prototype.constructor=THREE.EllipseCurve,THREE.EllipseCurve.prototype.getPoint=function(t){var e=this.aEndAngle-this.aStartAngle;return e<0&&(e+=2*Math.PI),e>2*Math.PI&&(e-=2*Math.PI),t=!0===this.aClockwise?this.aEndAngle+(1-t)*(2*Math.PI-e):this.aStartAngle+t*e,(e=new THREE.Vector2).x=this.aX+this.xRadius*Math.cos(t),e.y=this.aY+this.yRadius*Math.sin(t),e},THREE.ArcCurve=function(t,e,i,r,n,a){THREE.EllipseCurve.call(this,t,e,i,i,r,n,a)},THREE.ArcCurve.prototype=Object.create(THREE.EllipseCurve.prototype),THREE.ArcCurve.prototype.constructor=THREE.ArcCurve,THREE.LineCurve3=THREE.Curve.create(function(t,e){this.v1=t,this.v2=e},function(t){var e=new THREE.Vector3;return e.subVectors(this.v2,this.v1),e.multiplyScalar(t),e.add(this.v1),e}),THREE.QuadraticBezierCurve3=THREE.Curve.create(function(t,e,i){this.v0=t,this.v1=e,this.v2=i},function(t){var e=new THREE.Vector3;return e.x=THREE.Shape.Utils.b2(t,this.v0.x,this.v1.x,this.v2.x),e.y=THREE.Shape.Utils.b2(t,this.v0.y,this.v1.y,this.v2.y),e.z=THREE.Shape.Utils.b2(t,this.v0.z,this.v1.z,this.v2.z),e}),THREE.CubicBezierCurve3=THREE.Curve.create(function(t,e,i,r){this.v0=t,this.v1=e,this.v2=i,this.v3=r},function(t){var e=new THREE.Vector3;return e.x=THREE.Shape.Utils.b3(t,this.v0.x,this.v1.x,this.v2.x,this.v3.x),e.y=THREE.Shape.Utils.b3(t,this.v0.y,this.v1.y,this.v2.y,this.v3.y),e.z=THREE.Shape.Utils.b3(t,this.v0.z,this.v1.z,this.v2.z,this.v3.z),e}),THREE.SplineCurve3=THREE.Curve.create(function(t){this.points=null==t?[]:t},function(t){t*=(a=this.points).length-1,t-=e=Math.floor(t);var e,i=a[0==e?e:e-1],r=a[e],n=a[e>a.length-2?a.length-1:e+1],a=a[e>a.length-3?a.length-1:e+2];return(e=new THREE.Vector3).x=THREE.Curve.Utils.interpolate(i.x,r.x,n.x,a.x,t),e.y=THREE.Curve.Utils.interpolate(i.y,r.y,n.y,a.y,t),e.z=THREE.Curve.Utils.interpolate(i.z,r.z,n.z,a.z,t),e}),THREE.ClosedSplineCurve3=THREE.Curve.create(function(t){this.points=null==t?[]:t},function(t){t*=(a=this.points).length-0,t-=e=Math.floor(t);var e,i=a[((e=e+(0<e?0:(Math.floor(Math.abs(e)/a.length)+1)*a.length))-1)%a.length],r=a[e%a.length],n=a[(e+1)%a.length],a=a[(e+2)%a.length];return(e=new THREE.Vector3).x=THREE.Curve.Utils.interpolate(i.x,r.x,n.x,a.x,t),e.y=THREE.Curve.Utils.interpolate(i.y,r.y,n.y,a.y,t),e.z=THREE.Curve.Utils.interpolate(i.z,r.z,n.z,a.z,t),e}),THREE.AnimationHandler={LINEAR:0,CATMULLROM:1,CATMULLROM_FORWARD:2,add:function(){THREE.warn("THREE.AnimationHandler.add() has been deprecated.")},get:function(){THREE.warn("THREE.AnimationHandler.get() has been deprecated.")},remove:function(){THREE.warn("THREE.AnimationHandler.remove() has been deprecated.")},animations:[],init:function(t){if(!0===t.initialized)return t;for(var e=0;e<t.hierarchy.length;e++){for(var i=0;i<t.hierarchy[e].keys.length;i++)if(t.hierarchy[e].keys[i].time<0&&(t.hierarchy[e].keys[i].time=0),void 0!==t.hierarchy[e].keys[i].rot&&!(t.hierarchy[e].keys[i].rot instanceof THREE.Quaternion)){var r=t.hierarchy[e].keys[i].rot;t.hierarchy[e].keys[i].rot=(new THREE.Quaternion).fromArray(r)}if(t.hierarchy[e].keys.length&&void 0!==t.hierarchy[e].keys[0].morphTargets){for(r={},i=0;i<t.hierarchy[e].keys.length;i++)for(var n=0;n<t.hierarchy[e].keys[i].morphTargets.length;n++){var a=t.hierarchy[e].keys[i].morphTargets[n];r[a]=-1}for(t.hierarchy[e].usedMorphTargets=r,i=0;i<t.hierarchy[e].keys.length;i++){var o={};for(a in r){for(n=0;n<t.hierarchy[e].keys[i].morphTargets.length;n++)if(t.hierarchy[e].keys[i].morphTargets[n]===a){o[a]=t.hierarchy[e].keys[i].morphTargetsInfluences[n];break}n===t.hierarchy[e].keys[i].morphTargets.length&&(o[a]=0)}t.hierarchy[e].keys[i].morphTargetsInfluences=o}}for(i=1;i<t.hierarchy[e].keys.length;i++)t.hierarchy[e].keys[i].time===t.hierarchy[e].keys[i-1].time&&(t.hierarchy[e].keys.splice(i,1),i--);for(i=0;i<t.hierarchy[e].keys.length;i++)t.hierarchy[e].keys[i].index=i}return t.initialized=!0,t},parse:function(t){var r=function(t,e){e.push(t);for(var i=0;i<t.children.length;i++)r(t.children[i],e)},e=[];if(t instanceof THREE.SkinnedMesh)for(var i=0;i<t.skeleton.bones.length;i++)e.push(t.skeleton.bones[i]);else r(t,e);return e},play:function(t){-1===this.animations.indexOf(t)&&this.animations.push(t)},stop:function(t){-1!==(t=this.animations.indexOf(t))&&this.animations.splice(t,1)},update:function(t){for(var e=0;e<this.animations.length;e++)this.animations[e].resetBlendWeights();for(e=0;e<this.animations.length;e++)this.animations[e].update(t)}},THREE.Animation=function(t,e){this.root=t,this.data=THREE.AnimationHandler.init(e),this.hierarchy=THREE.AnimationHandler.parse(t),this.currentTime=0,this.timeScale=1,this.isPlaying=!1,this.loop=!0,this.weight=0,this.interpolationType=THREE.AnimationHandler.LINEAR},THREE.Animation.prototype={constructor:THREE.Animation,keyTypes:["pos","rot","scl"],play:function(t,e){this.currentTime=void 0!==t?t:0,this.weight=void 0!==e?e:1,this.isPlaying=!0,this.reset(),THREE.AnimationHandler.play(this)},stop:function(){this.isPlaying=!1,THREE.AnimationHandler.stop(this)},reset:function(){for(var t=0,e=this.hierarchy.length;t<e;t++){var i=this.hierarchy[t];void 0===i.animationCache&&(i.animationCache={animations:{},blending:{positionWeight:0,quaternionWeight:0,scaleWeight:0}});var r=this.data.name,n=(a=i.animationCache.animations)[r];for(void 0===n&&(n={prevKey:{pos:0,rot:0,scl:0},nextKey:{pos:0,rot:0,scl:0},originalMatrix:i.matrix},a[r]=n),i=0;i<3;i++){r=this.keyTypes[i];for(var a=this.data.hierarchy[t].keys[0],o=this.getNextKeyWith(r,t,1);o.time<this.currentTime&&o.index>a.index;)a=o,o=this.getNextKeyWith(r,t,o.index+1);n.prevKey[r]=a,n.nextKey[r]=o}}},resetBlendWeights:function(){for(var t=0,e=this.hierarchy.length;t<e;t++){var i=this.hierarchy[t].animationCache;void 0!==i&&((i=i.blending).positionWeight=0,i.quaternionWeight=0,i.scaleWeight=0)}},update:function(){var d=[],p=new THREE.Vector3,f=new THREE.Vector3,m=new THREE.Quaternion,E=function(t,e){var i,r,n,a,o,s,h=[],l=[];return i=(t.length-1)*e,i-=r=Math.floor(i),h[0]=0===r?r:r-1,h[1]=r,h[2]=r>t.length-2?r:r+1,h[3]=r>t.length-3?r:r+2,r=t[h[0]],a=t[h[1]],o=t[h[2]],s=t[h[3]],n=i*(h=i*i),l[0]=c(r[0],a[0],o[0],s[0],i,h,n),l[1]=c(r[1],a[1],o[1],s[1],i,h,n),l[2]=c(r[2],a[2],o[2],s[2],i,h,n),l},c=function(t,e,i,r,n,a,o){return(2*(e-i)+(t=.5*(i-t))+(r=.5*(r-e)))*o+(-3*(e-i)-2*t-r)*a+t*n+e};return function(t){if(!1!==this.isPlaying&&(this.currentTime+=t*this.timeScale,0!==this.weight)){t=this.data.length,(this.currentTime>t||this.currentTime<0)&&(this.loop?(this.currentTime%=t,this.currentTime<0&&(this.currentTime+=t),this.reset()):this.stop()),t=0;for(var e=this.hierarchy.length;t<e;t++)for(var i=this.hierarchy[t],r=i.animationCache.animations[this.data.name],n=i.animationCache.blending,a=0;a<3;a++){var o=this.keyTypes[a],s=r.prevKey[o],h=r.nextKey[o];if(0<this.timeScale&&h.time<=this.currentTime||this.timeScale<0&&s.time>=this.currentTime){for(s=this.data.hierarchy[t].keys[0],h=this.getNextKeyWith(o,t,1);h.time<this.currentTime&&h.index>s.index;)s=h,h=this.getNextKeyWith(o,t,h.index+1);r.prevKey[o]=s,r.nextKey[o]=h}var l=(this.currentTime-s.time)/(h.time-s.time),c=s[o],u=h[o];l<0&&(l=0),1<l&&(l=1),"pos"===o?this.interpolationType===THREE.AnimationHandler.LINEAR?(f.x=c[0]+(u[0]-c[0])*l,f.y=c[1]+(u[1]-c[1])*l,f.z=c[2]+(u[2]-c[2])*l,s=this.weight/(this.weight+n.positionWeight),i.position.lerp(f,s),n.positionWeight+=this.weight):this.interpolationType!==THREE.AnimationHandler.CATMULLROM&&this.interpolationType!==THREE.AnimationHandler.CATMULLROM_FORWARD||(d[0]=this.getPrevKeyWith("pos",t,s.index-1).pos,d[1]=c,d[2]=u,d[3]=this.getNextKeyWith("pos",t,h.index+1).pos,h=E(d,l=.33*l+.33),s=this.weight/(this.weight+n.positionWeight),n.positionWeight+=this.weight,(o=i.position).x+=(h[0]-o.x)*s,o.y+=(h[1]-o.y)*s,o.z+=(h[2]-o.z)*s,this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD&&(l=E(d,1.01*l),p.set(l[0],l[1],l[2]),p.sub(o),p.y=0,p.normalize(),l=Math.atan2(p.x,p.z),i.rotation.set(0,l,0))):"rot"===o?(THREE.Quaternion.slerp(c,u,m,l),0===n.quaternionWeight?(i.quaternion.copy(m),n.quaternionWeight=this.weight):(s=this.weight/(this.weight+n.quaternionWeight),THREE.Quaternion.slerp(i.quaternion,m,i.quaternion,s),n.quaternionWeight+=this.weight)):"scl"===o&&(f.x=c[0]+(u[0]-c[0])*l,f.y=c[1]+(u[1]-c[1])*l,f.z=c[2]+(u[2]-c[2])*l,s=this.weight/(this.weight+n.scaleWeight),i.scale.lerp(f,s),n.scaleWeight+=this.weight)}return!0}}}(),getNextKeyWith:function(t,e,i){var r=this.data.hierarchy[e].keys;for(i=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?i<r.length-1?i:r.length-1:i%r.length;i<r.length;i++)if(void 0!==r[i][t])return r[i];return this.data.hierarchy[e].keys[0]},getPrevKeyWith:function(t,e,i){var r=this.data.hierarchy[e].keys;for(i=this.interpolationType===THREE.AnimationHandler.CATMULLROM||this.interpolationType===THREE.AnimationHandler.CATMULLROM_FORWARD?0<i?i:0:0<=i?i:i+r.length;0<=i;i--)if(void 0!==r[i][t])return r[i];return this.data.hierarchy[e].keys[r.length-1]}},THREE.KeyFrameAnimation=function(t){this.root=t.node,this.data=THREE.AnimationHandler.init(t),this.hierarchy=THREE.AnimationHandler.parse(this.root),this.currentTime=0,this.timeScale=.001,this.isPlaying=!1,this.loop=this.isPaused=!0,t=0;for(var e=this.hierarchy.length;t<e;t++){var i=this.data.hierarchy[t].sids,r=this.hierarchy[t];if(this.data.hierarchy[t].keys.length&&i){for(var n=0;n<i.length;n++){var a=i[n],o=this.getNextKeyWith(a,t,0);o&&o.apply(a)}r.matrixAutoUpdate=!1,this.data.hierarchy[t].node.updateMatrix(),r.matrixWorldNeedsUpdate=!0}}},THREE.KeyFrameAnimation.prototype={constructor:THREE.KeyFrameAnimation,play:function(t){if(this.currentTime=void 0!==t?t:0,!1===this.isPlaying){this.isPlaying=!0;var e,i,r=this.hierarchy.length;for(t=0;t<r;t++)e=this.hierarchy[t],void 0===(i=this.data.hierarchy[t]).animationCache&&(i.animationCache={},i.animationCache.prevKey=null,i.animationCache.nextKey=null,i.animationCache.originalMatrix=e.matrix),(e=this.data.hierarchy[t].keys).length&&(i.animationCache.prevKey=e[0],i.animationCache.nextKey=e[1],this.startTime=Math.min(e[0].time,this.startTime),this.endTime=Math.max(e[e.length-1].time,this.endTime));this.update(0)}this.isPaused=!1,THREE.AnimationHandler.play(this)},stop:function(){this.isPaused=this.isPlaying=!1,THREE.AnimationHandler.stop(this);for(var t=0;t<this.data.hierarchy.length;t++){var e=this.hierarchy[t],i=this.data.hierarchy[t];if(void 0!==i.animationCache){var r=i.animationCache.originalMatrix;r.copy(e.matrix),e.matrix=r,delete i.animationCache}}},update:function(t){if(!1!==this.isPlaying){this.currentTime+=t*this.timeScale,t=this.data.length,!0===this.loop&&this.currentTime>t&&(this.currentTime%=t),this.currentTime=Math.min(this.currentTime,t),t=0;for(var e=this.hierarchy.length;t<e;t++){var i=this.hierarchy[t],r=(n=this.data.hierarchy[t]).keys,n=n.animationCache;if(r.length){var a=n.prevKey,o=n.nextKey;if(o.time<=this.currentTime){for(;o.time<this.currentTime&&o.index>a.index;)o=r[(a=o).index+1];n.prevKey=a,n.nextKey=o}o.time>=this.currentTime?a.interpolate(o,this.currentTime):a.interpolate(o,o.time),this.data.hierarchy[t].node.updateMatrix(),i.matrixWorldNeedsUpdate=!0}}}},getNextKeyWith:function(t,e,i){for(i%=(e=this.data.hierarchy[e].keys).length;i<e.length;i++)if(e[i].hasTarget(t))return e[i];return e[0]},getPrevKeyWith:function(t,e,i){for(e=this.data.hierarchy[e].keys,i=0<=i?i:i+e.length;0<=i;i--)if(e[i].hasTarget(t))return e[i];return e[e.length-1]}},THREE.MorphAnimation=function(t){this.mesh=t,this.frames=t.morphTargetInfluences.length,this.currentTime=0,this.duration=1e3,this.loop=!0,this.currentFrame=this.lastFrame=0,this.isPlaying=!1},THREE.MorphAnimation.prototype={constructor:THREE.MorphAnimation,play:function(){this.isPlaying=!0},pause:function(){this.isPlaying=!1},update:function(t){if(!1!==this.isPlaying){this.currentTime+=t,!0===this.loop&&this.currentTime>this.duration&&(this.currentTime%=this.duration),this.currentTime=Math.min(this.currentTime,this.duration),t=this.duration/this.frames;var e=Math.floor(this.currentTime/t),i=this.mesh.morphTargetInfluences;e!=this.currentFrame&&(i[this.lastFrame]=0,i[this.currentFrame]=1,i[e]=0,this.lastFrame=this.currentFrame,this.currentFrame=e),i[e]=this.currentTime%t/t,i[this.lastFrame]=1-i[e]}}},THREE.BoxGeometry=function(t,e,i,r,n,a){function o(t,e,i,r,n,a,o,s){var h,l=T.widthSegments,c=T.heightSegments,u=n/2,d=a/2,p=T.vertices.length;"x"===t&&"y"===e||"y"===t&&"x"===e?h="z":"x"===t&&"z"===e||"z"===t&&"x"===e?(h="y",c=T.depthSegments):("z"===t&&"y"===e||"y"===t&&"z"===e)&&(h="x",l=T.depthSegments);var f=l+1,m=c+1,E=n/l,g=a/c,v=new THREE.Vector3;for(v[h]=0<o?1:-1,n=0;n<m;n++)for(a=0;a<f;a++){var y=new THREE.Vector3;y[t]=(a*E-u)*i,y[e]=(n*g-d)*r,y[h]=o,T.vertices.push(y)}for(n=0;n<c;n++)for(a=0;a<l;a++)d=a+f*n,t=a+f*(n+1),e=a+1+f*(n+1),i=a+1+f*n,r=new THREE.Vector2(a/l,1-n/c),o=new THREE.Vector2(a/l,1-(n+1)/c),h=new THREE.Vector2((a+1)/l,1-(n+1)/c),u=new THREE.Vector2((a+1)/l,1-n/c),(d=new THREE.Face3(d+p,t+p,i+p)).normal.copy(v),d.vertexNormals.push(v.clone(),v.clone(),v.clone()),d.materialIndex=s,T.faces.push(d),T.faceVertexUvs[0].push([r,o,u]),(d=new THREE.Face3(t+p,e+p,i+p)).normal.copy(v),d.vertexNormals.push(v.clone(),v.clone(),v.clone()),d.materialIndex=s,T.faces.push(d),T.faceVertexUvs[0].push([o.clone(),h,u.clone()])}THREE.Geometry.call(this),this.type="BoxGeometry",this.parameters={width:t,height:e,depth:i,widthSegments:r,heightSegments:n,depthSegments:a},this.widthSegments=r||1,this.heightSegments=n||1,this.depthSegments=a||1;var T=this;n=e/2,a=i/2,o("z","y",-1,-1,i,e,r=t/2,0),o("z","y",1,-1,i,e,-r,1),o("x","z",1,1,t,i,n,2),o("x","z",1,-1,t,i,-n,3),o("x","y",1,-1,t,e,a,4),o("x","y",-1,-1,t,e,-a,5),this.mergeVertices()},THREE.BoxGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.BoxGeometry.prototype.constructor=THREE.BoxGeometry,THREE.CircleGeometry=function(t,e,i,r){THREE.Geometry.call(this),this.type="CircleGeometry",this.parameters={radius:t,segments:e,thetaStart:i,thetaLength:r},t=t||50,e=void 0!==e?Math.max(3,e):8,i=void 0!==i?i:0,r=void 0!==r?r:2*Math.PI;var n,a=[];n=new THREE.Vector3;var o=new THREE.Vector2(.5,.5);for(this.vertices.push(n),a.push(o),n=0;n<=e;n++){var s=new THREE.Vector3,h=i+n/e*r;s.x=t*Math.cos(h),s.y=t*Math.sin(h),this.vertices.push(s),a.push(new THREE.Vector2((s.x/t+1)/2,(s.y/t+1)/2))}for(i=new THREE.Vector3(0,0,1),n=1;n<=e;n++)this.faces.push(new THREE.Face3(n,n+1,0,[i.clone(),i.clone(),i.clone()])),this.faceVertexUvs[0].push([a[n].clone(),a[n+1].clone(),o.clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.CircleGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CircleGeometry.prototype.constructor=THREE.CircleGeometry,THREE.CubeGeometry=function(t,e,i,r,n,a){return THREE.warn("THREE.CubeGeometry has been renamed to THREE.BoxGeometry."),new THREE.BoxGeometry(t,e,i,r,n,a)},THREE.CylinderGeometry=function(t,e,i,r,n,a,o,s){THREE.Geometry.call(this),this.type="CylinderGeometry",this.parameters={radiusTop:t,radiusBottom:e,height:i,radialSegments:r,heightSegments:n,openEnded:a,thetaStart:o,thetaLength:s},t=void 0!==t?t:20,e=void 0!==e?e:20,i=void 0!==i?i:100,r=r||8,n=n||1,a=void 0!==a&&a,o=void 0!==o?o:0,s=void 0!==s?s:2*Math.PI;var h,l,c=i/2,u=[],d=[];for(l=0;l<=n;l++){var p=[],f=[],m=(g=l/n)*(e-t)+t;for(h=0;h<=r;h++){var E=h/r;(v=new THREE.Vector3).x=m*Math.sin(E*s+o),v.y=-g*i+c,v.z=m*Math.cos(E*s+o),this.vertices.push(v),p.push(this.vertices.length-1),f.push(new THREE.Vector2(E,1-g))}u.push(p),d.push(f)}for(i=(e-t)/i,h=0;h<r;h++)for(0!==t?(o=this.vertices[u[0][h]].clone(),s=this.vertices[u[0][h+1]].clone()):(o=this.vertices[u[1][h]].clone(),s=this.vertices[u[1][h+1]].clone()),o.setY(Math.sqrt(o.x*o.x+o.z*o.z)*i).normalize(),s.setY(Math.sqrt(s.x*s.x+s.z*s.z)*i).normalize(),l=0;l<n;l++){p=u[l][h],f=u[l+1][h];var g=u[l+1][h+1],v=(m=u[l][h+1],E=o.clone(),o.clone()),y=s.clone(),T=s.clone(),R=d[l][h].clone(),_=d[l+1][h].clone(),x=d[l+1][h+1].clone(),b=d[l][h+1].clone();this.faces.push(new THREE.Face3(p,f,m,[E,v,T])),this.faceVertexUvs[0].push([R,_,b]),this.faces.push(new THREE.Face3(f,g,m,[v.clone(),y,T.clone()])),this.faceVertexUvs[0].push([_.clone(),x,b.clone()])}if(!1===a&&0<t)for(this.vertices.push(new THREE.Vector3(0,c,0)),h=0;h<r;h++)p=u[0][h],f=u[0][h+1],g=this.vertices.length-1,E=new THREE.Vector3(0,1,0),v=new THREE.Vector3(0,1,0),y=new THREE.Vector3(0,1,0),R=d[0][h].clone(),_=d[0][h+1].clone(),x=new THREE.Vector2(_.x,0),this.faces.push(new THREE.Face3(p,f,g,[E,v,y])),this.faceVertexUvs[0].push([R,_,x]);if(!1===a&&0<e)for(this.vertices.push(new THREE.Vector3(0,-c,0)),h=0;h<r;h++)p=u[n][h+1],f=u[n][h],g=this.vertices.length-1,E=new THREE.Vector3(0,-1,0),v=new THREE.Vector3(0,-1,0),y=new THREE.Vector3(0,-1,0),R=d[n][h+1].clone(),_=d[n][h].clone(),x=new THREE.Vector2(_.x,1),this.faces.push(new THREE.Face3(p,f,g,[E,v,y])),this.faceVertexUvs[0].push([R,_,x]);this.computeFaceNormals()},THREE.CylinderGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.CylinderGeometry.prototype.constructor=THREE.CylinderGeometry,THREE.ExtrudeGeometry=function(t,e){void 0!==t&&(THREE.Geometry.call(this),this.type="ExtrudeGeometry",t=t instanceof Array?t:[t],this.addShapeList(t,e),this.computeFaceNormals())},THREE.ExtrudeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ExtrudeGeometry.prototype.constructor=THREE.ExtrudeGeometry,THREE.ExtrudeGeometry.prototype.addShapeList=function(t,e){for(var i=t.length,r=0;r<i;r++)this.addShape(t[r],e)},THREE.ExtrudeGeometry.prototype.addShape=function(t,e){function i(t,e,i){return e||THREE.error("THREE.ExtrudeGeometry: vec does not exist"),e.clone().multiplyScalar(i).add(t)}function r(t,e,i){var r=1,n=(r=t.x-e.x,t.y-e.y),a=i.x-t.x,o=i.y-t.y,s=r*r+n*n;if(1e-10<Math.abs(r*o-n*a)){var h=Math.sqrt(s),l=Math.sqrt(a*a+o*o);s=e.x-n/h;if(e=e.y+r/h,(r=(i=s+r*(a=((i.x-o/l-s)*o-(i.y+a/l-e)*a)/(r*o-n*a))-t.x)*i+(t=e+n*a-t.y)*t)<=2)return new THREE.Vector2(i,t);r=Math.sqrt(r/2)}else t=!1,1e-10<r?1e-10<a&&(t=!0):r<-1e-10?a<-1e-10&&(t=!0):Math.sign(n)==Math.sign(o)&&(t=!0),t?(i=-n,t=r,r=Math.sqrt(s)):(i=r,t=n,r=Math.sqrt(s/2));return new THREE.Vector2(i/r,t/r)}function n(t,e){var i,r;for(U=t.length;0<=--U;){(r=(i=U)-1)<0&&(r=t.length-1);var n=0,a=v+2*m;for(n=0;n<a;n++){var o=(o=e+i+(s=O*n))+S,s=(s=e+r+s)+S,h=(h=e+r+(l=O*(n+1)))+S,l=(l=e+i+l)+S;M.faces.push(new THREE.Face3(o,s,l,null,null,_)),M.faces.push(new THREE.Face3(s,h,l,null,null,_)),o=x.generateSideWallUV(M,o,s,h,l),M.faceVertexUvs[0].push([o[0],o[1],o[3]]),M.faceVertexUvs[0].push([o[1],o[2],o[3]])}}}function a(t,e,i){M.vertices.push(new THREE.Vector3(t,e,i))}function o(t,e,i){t+=S,e+=S,i+=S,M.faces.push(new THREE.Face3(t,e,i,null,null,R)),t=x.generateTopUV(M,t,e,i),M.faceVertexUvs[0].push(t)}var s,h,l,c,u,d=void 0!==e.amount?e.amount:100,p=void 0!==e.bevelThickness?e.bevelThickness:6,f=void 0!==e.bevelSize?e.bevelSize:p-2,m=void 0!==e.bevelSegments?e.bevelSegments:3,E=void 0===e.bevelEnabled||e.bevelEnabled,g=void 0!==e.curveSegments?e.curveSegments:12,v=void 0!==e.steps?e.steps:1,y=e.extrudePath,T=!1,R=e.material,_=e.extrudeMaterial,x=void 0!==e.UVGenerator?e.UVGenerator:THREE.ExtrudeGeometry.WorldUVGenerator;y&&(s=y.getSpacedPoints(v),E=!(T=!0),h=void 0!==e.frames?e.frames:new THREE.TubeGeometry.FrenetFrames(y,v,!1),l=new THREE.Vector3,c=new THREE.Vector3,u=new THREE.Vector3),E||(f=p=m=0);var b,w,H,M=this,S=this.vertices.length,C=(g=(y=t.extractPoints(g)).shape,y.holes);if(y=!THREE.Shape.Utils.isClockWise(g)){for(g=g.reverse(),w=0,H=C.length;w<H;w++)b=C[w],THREE.Shape.Utils.isClockWise(b)&&(C[w]=b.reverse());y=!1}var A=THREE.Shape.Utils.triangulateShape(g,C),P=g;for(w=0,H=C.length;w<H;w++)b=C[w],g=g.concat(b);var L,k,D,F,z,B,O=g.length,N=A.length,U=(y=[],0);for(L=(D=P.length)-1,k=U+1;U<D;U++,L++,k++)L===D&&(L=0),k===D&&(k=0),y[U]=r(P[U],P[L],P[k]);var V,I=[],G=y.concat();for(w=0,H=C.length;w<H;w++){for(b=C[w],V=[],U=0,L=(D=b.length)-1,k=U+1;U<D;U++,L++,k++)L===D&&(L=0),k===D&&(k=0),V[U]=r(b[U],b[L],b[k]);I.push(V),G=G.concat(V)}for(L=0;L<m;L++){for(F=p*(1-(D=L/m)),k=f*Math.sin(D*Math.PI/2),U=0,D=P.length;U<D;U++)a((z=i(P[U],y[U],k)).x,z.y,-F);for(w=0,H=C.length;w<H;w++)for(b=C[w],V=I[w],U=0,D=b.length;U<D;U++)a((z=i(b[U],V[U],k)).x,z.y,-F)}for(k=f,U=0;U<O;U++)z=E?i(g[U],G[U],k):g[U],T?(c.copy(h.normals[0]).multiplyScalar(z.x),l.copy(h.binormals[0]).multiplyScalar(z.y),u.copy(s[0]).add(c).add(l),a(u.x,u.y,u.z)):a(z.x,z.y,0);for(D=1;D<=v;D++)for(U=0;U<O;U++)z=E?i(g[U],G[U],k):g[U],T?(c.copy(h.normals[D]).multiplyScalar(z.x),l.copy(h.binormals[D]).multiplyScalar(z.y),u.copy(s[D]).add(c).add(l),a(u.x,u.y,u.z)):a(z.x,z.y,d/v*D);for(L=m-1;0<=L;L--){for(F=p*(1-(D=L/m)),k=f*Math.sin(D*Math.PI/2),U=0,D=P.length;U<D;U++)a((z=i(P[U],y[U],k)).x,z.y,d+F);for(w=0,H=C.length;w<H;w++)for(b=C[w],V=I[w],U=0,D=b.length;U<D;U++)z=i(b[U],V[U],k),T?a(z.x,z.y+s[v-1].y,s[v-1].x+F):a(z.x,z.y,d+F)}!function(){if(E){var t;for(t=0*O,U=0;U<N;U++)o((B=A[U])[2]+t,B[1]+t,B[0]+t);for(t=v+2*m,t*=O,U=0;U<N;U++)o((B=A[U])[0]+t,B[1]+t,B[2]+t)}else{for(U=0;U<N;U++)o((B=A[U])[2],B[1],B[0]);for(U=0;U<N;U++)o((B=A[U])[0]+O*v,B[1]+O*v,B[2]+O*v)}}(),function(){var t=0;for(n(P,t),t+=P.length,w=0,H=C.length;w<H;w++)n(b=C[w],t),t+=b.length}()},THREE.ExtrudeGeometry.WorldUVGenerator={generateTopUV:function(t,e,i,r){return e=(t=t.vertices)[e],i=t[i],r=t[r],[new THREE.Vector2(e.x,e.y),new THREE.Vector2(i.x,i.y),new THREE.Vector2(r.x,r.y)]},generateSideWallUV:function(t,e,i,r,n){return e=(t=t.vertices)[e],i=t[i],r=t[r],n=t[n],Math.abs(e.y-i.y)<.01?[new THREE.Vector2(e.x,1-e.z),new THREE.Vector2(i.x,1-i.z),new THREE.Vector2(r.x,1-r.z),new THREE.Vector2(n.x,1-n.z)]:[new THREE.Vector2(e.y,1-e.z),new THREE.Vector2(i.y,1-i.z),new THREE.Vector2(r.y,1-r.z),new THREE.Vector2(n.y,1-n.z)]}},THREE.ShapeGeometry=function(t,e){THREE.Geometry.call(this),this.type="ShapeGeometry",0==t instanceof Array&&(t=[t]),this.addShapeList(t,e),this.computeFaceNormals()},THREE.ShapeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ShapeGeometry.prototype.constructor=THREE.ShapeGeometry,THREE.ShapeGeometry.prototype.addShapeList=function(t,e){for(var i=0,r=t.length;i<r;i++)this.addShape(t[i],e);return this},THREE.ShapeGeometry.prototype.addShape=function(t,e){void 0===e&&(e={});var i,r,n,a=e.material,o=void 0===e.UVGenerator?THREE.ExtrudeGeometry.WorldUVGenerator:e.UVGenerator,s=this.vertices.length,h=(i=t.extractPoints(void 0!==e.curveSegments?e.curveSegments:12)).shape,l=i.holes;if(!THREE.Shape.Utils.isClockWise(h))for(h=h.reverse(),i=0,r=l.length;i<r;i++)n=l[i],THREE.Shape.Utils.isClockWise(n)&&(l[i]=n.reverse());var c=THREE.Shape.Utils.triangulateShape(h,l);for(i=0,r=l.length;i<r;i++)n=l[i],h=h.concat(n);for(l=h.length,r=c.length,i=0;i<l;i++)n=h[i],this.vertices.push(new THREE.Vector3(n.x,n.y,0));for(i=0;i<r;i++)h=(l=c[i])[0]+s,n=l[1]+s,l=l[2]+s,this.faces.push(new THREE.Face3(h,n,l,null,null,a)),this.faceVertexUvs[0].push(o.generateTopUV(this,h,n,l))},THREE.LatheGeometry=function(t,e,i,r){THREE.Geometry.call(this),this.type="LatheGeometry",this.parameters={points:t,segments:e,phiStart:i,phiLength:r},e=e||12,i=i||0,r=r||2*Math.PI;for(var n=1/(t.length-1),a=1/e,o=0,s=e;o<=s;o++)for(var h=i+o*a*r,l=Math.cos(h),c=Math.sin(h),u=(h=0,t.length);h<u;h++){var d=t[h];(p=new THREE.Vector3).x=l*d.x-c*d.y,p.y=c*d.x+l*d.y,p.z=d.z,this.vertices.push(p)}for(i=t.length,o=0,s=e;o<s;o++)for(h=0,u=t.length-1;h<u;h++){e=c=h+i*o,r=c+i;l=c+1+i,c=c+1;var p,f=(d=o*a)+a,m=(p=h*n)+n;this.faces.push(new THREE.Face3(e,r,c)),this.faceVertexUvs[0].push([new THREE.Vector2(d,p),new THREE.Vector2(f,p),new THREE.Vector2(d,m)]),this.faces.push(new THREE.Face3(r,l,c)),this.faceVertexUvs[0].push([new THREE.Vector2(f,p),new THREE.Vector2(f,m),new THREE.Vector2(d,m)])}this.mergeVertices(),this.computeFaceNormals(),this.computeVertexNormals()},THREE.LatheGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.LatheGeometry.prototype.constructor=THREE.LatheGeometry,THREE.PlaneGeometry=function(t,e,i,r){THREE.Geometry.call(this),this.type="PlaneGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r},this.fromBufferGeometry(new THREE.PlaneBufferGeometry(t,e,i,r))},THREE.PlaneGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PlaneGeometry.prototype.constructor=THREE.PlaneGeometry,THREE.PlaneBufferGeometry=function(t,e,i,r){THREE.BufferGeometry.call(this),this.type="PlaneBufferGeometry",this.parameters={width:t,height:e,widthSegments:i,heightSegments:r};var n=t/2,a=e/2,o=(i=i||1)+1,s=(r=r||1)+1,h=t/i,l=e/r;e=new Float32Array(o*s*3),t=new Float32Array(o*s*3);for(var c=new Float32Array(o*s*2),u=0,d=0,p=0;p<s;p++)for(var f=p*l-a,m=0;m<o;m++)e[u]=m*h-n,e[u+1]=-f,t[u+2]=1,c[d]=m/i,c[d+1]=1-p/r,u+=3,d+=2;for(u=0,n=new(65535<e.length/3?Uint32Array:Uint16Array)(i*r*6),p=0;p<r;p++)for(m=0;m<i;m++)a=m+o*(p+1),s=m+1+o*(p+1),h=m+1+o*p,n[u]=m+o*p,n[u+1]=a,n[u+2]=h,n[u+3]=a,n[u+4]=s,n[u+5]=h,u+=6;this.addAttribute("index",new THREE.BufferAttribute(n,1)),this.addAttribute("position",new THREE.BufferAttribute(e,3)),this.addAttribute("normal",new THREE.BufferAttribute(t,3)),this.addAttribute("uv",new THREE.BufferAttribute(c,2))},THREE.PlaneBufferGeometry.prototype=Object.create(THREE.BufferGeometry.prototype),THREE.PlaneBufferGeometry.prototype.constructor=THREE.PlaneBufferGeometry,THREE.RingGeometry=function(t,e,i,r,n,a){THREE.Geometry.call(this),this.type="RingGeometry",this.parameters={innerRadius:t,outerRadius:e,thetaSegments:i,phiSegments:r,thetaStart:n,thetaLength:a},t=t||0,e=e||50,n=void 0!==n?n:0,a=void 0!==a?a:2*Math.PI,i=void 0!==i?Math.max(3,i):8;var o,s=[],h=t,l=(e-t)/(r=void 0!==r?Math.max(1,r):8);for(t=0;t<r+1;t++){for(o=0;o<i+1;o++){var c=new THREE.Vector3,u=n+o/i*a;c.x=h*Math.cos(u),c.y=h*Math.sin(u),this.vertices.push(c),s.push(new THREE.Vector2((c.x/e+1)/2,(c.y/e+1)/2))}h+=l}for(e=new THREE.Vector3(0,0,1),t=0;t<r;t++)for(n=t*(i+1),o=0;o<i;o++)a=u=o+n,l=u+i+1,c=u+i+2,this.faces.push(new THREE.Face3(a,l,c,[e.clone(),e.clone(),e.clone()])),this.faceVertexUvs[0].push([s[a].clone(),s[l].clone(),s[c].clone()]),l=(a=u)+i+2,c=u+1,this.faces.push(new THREE.Face3(a,l,c,[e.clone(),e.clone(),e.clone()])),this.faceVertexUvs[0].push([s[a].clone(),s[l].clone(),s[c].clone()]);this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,h)},THREE.RingGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.RingGeometry.prototype.constructor=THREE.RingGeometry,THREE.SphereGeometry=function(t,e,i,r,n,a,o){THREE.Geometry.call(this),this.type="SphereGeometry",this.parameters={radius:t,widthSegments:e,heightSegments:i,phiStart:r,phiLength:n,thetaStart:a,thetaLength:o},t=t||50,e=Math.max(3,Math.floor(e)||8),i=Math.max(2,Math.floor(i)||6),r=void 0!==r?r:0,n=void 0!==n?n:2*Math.PI,a=void 0!==a?a:0,o=void 0!==o?o:Math.PI;var s,h,l=[],c=[];for(h=0;h<=i;h++){var u=[],d=[];for(s=0;s<=e;s++){var p=s/e,f=h/i;(m=new THREE.Vector3).x=-t*Math.cos(r+p*n)*Math.sin(a+f*o),m.y=t*Math.cos(a+f*o),m.z=t*Math.sin(r+p*n)*Math.sin(a+f*o),this.vertices.push(m),u.push(this.vertices.length-1),d.push(new THREE.Vector2(p,1-f))}l.push(u),c.push(d)}for(h=0;h<i;h++)for(s=0;s<e;s++){r=l[h][s+1],n=l[h][s],a=l[h+1][s],o=l[h+1][s+1];u=this.vertices[r].clone().normalize(),d=this.vertices[n].clone().normalize(),p=this.vertices[a].clone().normalize(),f=this.vertices[o].clone().normalize();var m=c[h][s+1].clone(),E=c[h][s].clone(),g=c[h+1][s].clone(),v=c[h+1][s+1].clone();Math.abs(this.vertices[r].y)===t?(m.x=(m.x+E.x)/2,this.faces.push(new THREE.Face3(r,a,o,[u,p,f])),this.faceVertexUvs[0].push([m,g,v])):Math.abs(this.vertices[a].y)===t?(g.x=(g.x+v.x)/2,this.faces.push(new THREE.Face3(r,n,a,[u,d,p])),this.faceVertexUvs[0].push([m,E,g])):(this.faces.push(new THREE.Face3(r,n,o,[u,d,f])),this.faceVertexUvs[0].push([m,E,v]),this.faces.push(new THREE.Face3(n,a,o,[d.clone(),p,f.clone()])),this.faceVertexUvs[0].push([E.clone(),g,v.clone()]))}this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,t)},THREE.SphereGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.SphereGeometry.prototype.constructor=THREE.SphereGeometry,THREE.TextGeometry=function(t,e){e=e||{};var i=THREE.FontUtils.generateShapes(t,e);e.amount=void 0!==e.height?e.height:50,void 0===e.bevelThickness&&(e.bevelThickness=10),void 0===e.bevelSize&&(e.bevelSize=8),void 0===e.bevelEnabled&&(e.bevelEnabled=!1),THREE.ExtrudeGeometry.call(this,i,e),this.type="TextGeometry"},THREE.TextGeometry.prototype=Object.create(THREE.ExtrudeGeometry.prototype),THREE.TextGeometry.prototype.constructor=THREE.TextGeometry,THREE.TorusGeometry=function(t,e,i,r,n){THREE.Geometry.call(this),this.type="TorusGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:r,arc:n},t=t||100,e=e||40,i=i||8,r=r||6,n=n||2*Math.PI;for(var a=new THREE.Vector3,o=[],s=[],h=0;h<=i;h++)for(var l=0;l<=r;l++){var c=l/r*n,u=h/i*Math.PI*2;a.x=t*Math.cos(c),a.y=t*Math.sin(c);var d=new THREE.Vector3;d.x=(t+e*Math.cos(u))*Math.cos(c),d.y=(t+e*Math.cos(u))*Math.sin(c),d.z=e*Math.sin(u),this.vertices.push(d),o.push(new THREE.Vector2(l/r,h/i)),s.push(d.clone().sub(a).normalize())}for(h=1;h<=i;h++)for(l=1;l<=r;l++)t=(r+1)*h+l-1,e=(r+1)*(h-1)+l-1,n=(r+1)*(h-1)+l,a=(r+1)*h+l,c=new THREE.Face3(t,e,a,[s[t].clone(),s[e].clone(),s[a].clone()]),this.faces.push(c),this.faceVertexUvs[0].push([o[t].clone(),o[e].clone(),o[a].clone()]),c=new THREE.Face3(e,n,a,[s[e].clone(),s[n].clone(),s[a].clone()]),this.faces.push(c),this.faceVertexUvs[0].push([o[e].clone(),o[n].clone(),o[a].clone()]);this.computeFaceNormals()},THREE.TorusGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusGeometry.prototype.constructor=THREE.TorusGeometry,THREE.TorusKnotGeometry=function(t,e,i,r,n,a,o){function s(t,e,i,r,n){var a=Math.cos(t),o=Math.sin(t);return t*=e/i,a*=r*(2+(e=Math.cos(t)))*.5,o=r*(2+e)*o*.5,r=n*r*Math.sin(t)*.5,new THREE.Vector3(a,o,r)}THREE.Geometry.call(this),this.type="TorusKnotGeometry",this.parameters={radius:t,tube:e,radialSegments:i,tubularSegments:r,p:n,q:a,heightScale:o},t=t||100,e=e||40,i=i||64,r=r||8,n=n||2,a=a||3,o=o||1;for(var h=Array(i),l=new THREE.Vector3,c=new THREE.Vector3,u=new THREE.Vector3,d=0;d<i;++d){h[d]=Array(r);var p=s(f=d/i*2*n*Math.PI,a,n,t,o),f=s(f+.01,a,n,t,o);for(l.subVectors(f,p),c.addVectors(f,p),u.crossVectors(l,c),c.crossVectors(u,l),u.normalize(),c.normalize(),f=0;f<r;++f){var m=f/r*2*Math.PI,E=-e*Math.cos(m),g=(m=e*Math.sin(m),new THREE.Vector3);g.x=p.x+E*c.x+m*u.x,g.y=p.y+E*c.y+m*u.y,g.z=p.z+E*c.z+m*u.z,h[d][f]=this.vertices.push(g)-1}}for(d=0;d<i;++d)for(f=0;f<r;++f)n=(d+1)%i,a=(f+1)%r,t=h[d][f],e=h[n][f],n=h[n][a],a=h[d][a],o=new THREE.Vector2(d/i,f/r),l=new THREE.Vector2((d+1)/i,f/r),c=new THREE.Vector2((d+1)/i,(f+1)/r),u=new THREE.Vector2(d/i,(f+1)/r),this.faces.push(new THREE.Face3(t,e,a)),this.faceVertexUvs[0].push([o,l,u]),this.faces.push(new THREE.Face3(e,n,a)),this.faceVertexUvs[0].push([l.clone(),c,u.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TorusKnotGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TorusKnotGeometry.prototype.constructor=THREE.TorusKnotGeometry,THREE.TubeGeometry=function(t,e,i,r,n,a){THREE.Geometry.call(this),this.type="TubeGeometry",this.parameters={path:t,segments:e,radius:i,radialSegments:r,closed:n},e=e||64,i=i||1,r=r||8,n=n||!1,a=a||THREE.TubeGeometry.NoTaper;var o,s,h,l,c,u,d,p,f,m,E=[],g=e+1,v=new THREE.Vector3;for(f=(p=new THREE.TubeGeometry.FrenetFrames(t,e,n)).normals,m=p.binormals,this.tangents=p.tangents,this.normals=f,this.binormals=m,p=0;p<g;p++)for(E[p]=[],h=p/(g-1),d=t.getPointAt(h),o=f[p],s=m[p],c=i*a(h),h=0;h<r;h++)l=h/r*2*Math.PI,u=-c*Math.cos(l),l=c*Math.sin(l),v.copy(d),v.x+=u*o.x+l*s.x,v.y+=u*o.y+l*s.y,v.z+=u*o.z+l*s.z,E[p][h]=this.vertices.push(new THREE.Vector3(v.x,v.y,v.z))-1;for(p=0;p<e;p++)for(h=0;h<r;h++)a=n?(p+1)%e:p+1,g=(h+1)%r,t=E[p][h],i=E[a][h],a=E[a][g],g=E[p][g],v=new THREE.Vector2(p/e,h/r),f=new THREE.Vector2((p+1)/e,h/r),m=new THREE.Vector2((p+1)/e,(h+1)/r),o=new THREE.Vector2(p/e,(h+1)/r),this.faces.push(new THREE.Face3(t,i,g)),this.faceVertexUvs[0].push([v,f,o]),this.faces.push(new THREE.Face3(i,a,g)),this.faceVertexUvs[0].push([f.clone(),m,o.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.TubeGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TubeGeometry.prototype.constructor=THREE.TubeGeometry,THREE.TubeGeometry.NoTaper=function(t){return 1},THREE.TubeGeometry.SinusoidalTaper=function(t){return Math.sin(Math.PI*t)},THREE.TubeGeometry.FrenetFrames=function(t,e,i){var r,n,a,o=new THREE.Vector3,s=[],h=[],l=[],c=new THREE.Vector3,u=new THREE.Matrix4;for(e+=1,this.tangents=s,this.normals=h,this.binormals=l,r=0;r<e;r++)n=r/(e-1),s[r]=t.getTangentAt(n),s[r].normalize();for(h[0]=new THREE.Vector3,l[0]=new THREE.Vector3,t=Number.MAX_VALUE,r=Math.abs(s[0].x),n=Math.abs(s[0].y),a=Math.abs(s[0].z),r<=t&&(t=r,o.set(1,0,0)),n<=t&&(t=n,o.set(0,1,0)),a<=t&&o.set(0,0,1),c.crossVectors(s[0],o).normalize(),h[0].crossVectors(s[0],c),l[0].crossVectors(s[0],h[0]),r=1;r<e;r++)h[r]=h[r-1].clone(),l[r]=l[r-1].clone(),c.crossVectors(s[r-1],s[r]),1e-4<c.length()&&(c.normalize(),o=Math.acos(THREE.Math.clamp(s[r-1].dot(s[r]),-1,1)),h[r].applyMatrix4(u.makeRotationAxis(c,o))),l[r].crossVectors(s[r],h[r]);if(i)for(o=Math.acos(THREE.Math.clamp(h[0].dot(h[e-1]),-1,1)),o/=e-1,0<s[0].dot(c.crossVectors(h[0],h[e-1]))&&(o=-o),r=1;r<e;r++)h[r].applyMatrix4(u.makeRotationAxis(s[r],o*r)),l[r].crossVectors(s[r],h[r])},THREE.PolyhedronGeometry=function(t,e,i,r){function d(t){var e=t.normalize().clone();e.index=f.vertices.push(e)-1;var i=Math.atan2(t.z,-t.x)/2/Math.PI+.5;return t=Math.atan2(-t.y,Math.sqrt(t.x*t.x+t.z*t.z))/Math.PI+.5,e.uv=new THREE.Vector2(i,1-t),e}function p(t,e,i){var r=new THREE.Face3(t.index,e.index,i.index,[t.clone(),e.clone(),i.clone()]);f.faces.push(r),m.copy(t).add(e).add(i).divideScalar(3),r=Math.atan2(m.z,-m.x),f.faceVertexUvs[0].push([n(t.uv,t,r),n(e.uv,e,r),n(i.uv,i,r)])}function n(t,e,i){return i<0&&1===t.x&&(t=new THREE.Vector2(t.x-1,t.y)),0===e.x&&0===e.z&&(t=new THREE.Vector2(i/2/Math.PI+.5,t.y)),t.clone()}THREE.Geometry.call(this),this.type="PolyhedronGeometry",this.parameters={vertices:t,indices:e,radius:i,detail:r},i=i||1,r=r||0;for(var f=this,a=0,o=t.length;a<o;a+=3)d(new THREE.Vector3(t[a],t[a+1],t[a+2]));t=this.vertices;var s=[],h=a=0;for(o=e.length;a<o;a+=3,h++){var l=t[e[a]],c=t[e[a+1]],u=t[e[a+2]];s[h]=new THREE.Face3(l.index,c.index,u.index,[l.clone(),c.clone(),u.clone()])}var m=new THREE.Vector3;for(a=0,o=s.length;a<o;a++)!function(t,e){for(var i=Math.pow(2,e),r=d(f.vertices[t.a]),n=d(f.vertices[t.b]),a=d(f.vertices[t.c]),o=[],s=0;s<=i;s++){o[s]=[];for(var h=d(r.clone().lerp(a,s/i)),l=d(n.clone().lerp(a,s/i)),c=i-s,u=0;u<=c;u++)o[s][u]=0==u&&s==i?h:d(h.clone().lerp(l,u/c))}for(s=0;s<i;s++)for(u=0;u<2*(i-s)-1;u++)r=Math.floor(u/2),0==u%2?p(o[s][r+1],o[s+1][r],o[s][r]):p(o[s][r+1],o[s+1][r+1],o[s+1][r])}(s[a],r);for(a=0,o=this.faceVertexUvs[0].length;a<o;a++)r=(e=this.faceVertexUvs[0][a])[0].x,t=e[1].x,s=e[2].x,h=Math.max(r,Math.max(t,s)),l=Math.min(r,Math.min(t,s)),.9<h&&l<.1&&(r<.2&&(e[0].x+=1),t<.2&&(e[1].x+=1),s<.2&&(e[2].x+=1));for(a=0,o=this.vertices.length;a<o;a++)this.vertices[a].multiplyScalar(i);this.mergeVertices(),this.computeFaceNormals(),this.boundingSphere=new THREE.Sphere(new THREE.Vector3,i)},THREE.PolyhedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.PolyhedronGeometry.prototype.constructor=THREE.PolyhedronGeometry,THREE.DodecahedronGeometry=function(t,e){this.parameters={radius:t,detail:e};var i=(1+Math.sqrt(5))/2,r=1/i;THREE.PolyhedronGeometry.call(this,[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-r,-i,0,-r,i,0,r,-i,0,r,i,-r,-i,0,-r,i,0,r,-i,0,r,i,0,-i,0,-r,i,0,-r,-i,0,r,i,0,r],[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9],t,e)},THREE.DodecahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.DodecahedronGeometry.prototype.constructor=THREE.DodecahedronGeometry,THREE.IcosahedronGeometry=function(t,e){var i=(1+Math.sqrt(5))/2;THREE.PolyhedronGeometry.call(this,[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1],t,e),this.type="IcosahedronGeometry",this.parameters={radius:t,detail:e}},THREE.IcosahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.IcosahedronGeometry.prototype.constructor=THREE.IcosahedronGeometry,THREE.OctahedronGeometry=function(t,e){this.parameters={radius:t,detail:e},THREE.PolyhedronGeometry.call(this,[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2],t,e),this.type="OctahedronGeometry",this.parameters={radius:t,detail:e}},THREE.OctahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.OctahedronGeometry.prototype.constructor=THREE.OctahedronGeometry,THREE.TetrahedronGeometry=function(t,e){THREE.PolyhedronGeometry.call(this,[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],[2,1,0,0,3,2,1,3,0,2,3,1],t,e),this.type="TetrahedronGeometry",this.parameters={radius:t,detail:e}},THREE.TetrahedronGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.TetrahedronGeometry.prototype.constructor=THREE.TetrahedronGeometry,THREE.ParametricGeometry=function(t,e,i){THREE.Geometry.call(this),this.type="ParametricGeometry",this.parameters={func:t,slices:e,stacks:i};var r,n,a,o,s,h,l,c,u=this.vertices,d=this.faces,p=this.faceVertexUvs[0],f=e+1;for(r=0;r<=i;r++)for(o=r/i,n=0;n<=e;n++)a=t(a=n/e,o),u.push(a);for(r=0;r<i;r++)for(n=0;n<e;n++)u=(t=r*f+n)+1,o=(r+1)*f+n+1,a=(r+1)*f+n,s=new THREE.Vector2(n/e,r/i),h=new THREE.Vector2((n+1)/e,r/i),l=new THREE.Vector2((n+1)/e,(r+1)/i),c=new THREE.Vector2(n/e,(r+1)/i),d.push(new THREE.Face3(t,u,a)),p.push([s,h,c]),d.push(new THREE.Face3(u,o,a)),p.push([h.clone(),l,c.clone()]);this.computeFaceNormals(),this.computeVertexNormals()},THREE.ParametricGeometry.prototype=Object.create(THREE.Geometry.prototype),THREE.ParametricGeometry.prototype.constructor=THREE.ParametricGeometry,THREE.AxisHelper=function(t){t=t||1;var e=new Float32Array([0,0,0,t,0,0,0,0,0,0,t,0,0,0,0,0,0,t]),i=new Float32Array([1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1]);(t=new THREE.BufferGeometry).addAttribute("position",new THREE.BufferAttribute(e,3)),t.addAttribute("color",new THREE.BufferAttribute(i,3)),e=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors}),THREE.Line.call(this,t,e,THREE.LinePieces)},THREE.AxisHelper.prototype=Object.create(THREE.Line.prototype),THREE.AxisHelper.prototype.constructor=THREE.AxisHelper,THREE.ArrowHelper=function(){var o=new THREE.Geometry;o.vertices.push(new THREE.Vector3(0,0,0),new THREE.Vector3(0,1,0));var s=new THREE.CylinderGeometry(0,.5,1,5,1);return s.applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),function(t,e,i,r,n,a){THREE.Object3D.call(this),void 0===r&&(r=16776960),void 0===i&&(i=1),void 0===n&&(n=.2*i),void 0===a&&(a=.2*n),this.position.copy(e),this.line=new THREE.Line(o,new THREE.LineBasicMaterial({color:r})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new THREE.Mesh(s,new THREE.MeshBasicMaterial({color:r})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(t),this.setLength(i,n,a)}}(),THREE.ArrowHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.ArrowHelper.prototype.constructor=THREE.ArrowHelper,THREE.ArrowHelper.prototype.setDirection=function(){var e,i=new THREE.Vector3;return function(t){.99999<t.y?this.quaternion.set(0,0,0,1):t.y<-.99999?this.quaternion.set(1,0,0,0):(i.set(t.z,0,-t.x).normalize(),e=Math.acos(t.y),this.quaternion.setFromAxisAngle(i,e))}}(),THREE.ArrowHelper.prototype.setLength=function(t,e,i){void 0===e&&(e=.2*t),void 0===i&&(i=.2*e),this.line.scale.set(1,t-e,1),this.line.updateMatrix(),this.cone.scale.set(i,e,i),this.cone.position.y=t,this.cone.updateMatrix()},THREE.ArrowHelper.prototype.setColor=function(t){this.line.material.color.set(t),this.cone.material.color.set(t)},THREE.BoxHelper=function(t){var e=new THREE.BufferGeometry;e.addAttribute("position",new THREE.BufferAttribute(new Float32Array(72),3)),THREE.Line.call(this,e,new THREE.LineBasicMaterial({color:16776960}),THREE.LinePieces),void 0!==t&&this.update(t)},THREE.BoxHelper.prototype=Object.create(THREE.Line.prototype),THREE.BoxHelper.prototype.constructor=THREE.BoxHelper,THREE.BoxHelper.prototype.update=function(t){null===(i=t.geometry).boundingBox&&i.computeBoundingBox();var e=i.boundingBox.min,i=i.boundingBox.max,r=this.geometry.attributes.position.array;r[0]=i.x,r[1]=i.y,r[2]=i.z,r[3]=e.x,r[4]=i.y,r[5]=i.z,r[6]=e.x,r[7]=i.y,r[8]=i.z,r[9]=e.x,r[10]=e.y,r[11]=i.z,r[12]=e.x,r[13]=e.y,r[14]=i.z,r[15]=i.x,r[16]=e.y,r[17]=i.z,r[18]=i.x,r[19]=e.y,r[20]=i.z,r[21]=i.x,r[22]=i.y,r[23]=i.z,r[24]=i.x,r[25]=i.y,r[26]=e.z,r[27]=e.x,r[28]=i.y,r[29]=e.z,r[30]=e.x,r[31]=i.y,r[32]=e.z,r[33]=e.x,r[34]=e.y,r[35]=e.z,r[36]=e.x,r[37]=e.y,r[38]=e.z,r[39]=i.x,r[40]=e.y,r[41]=e.z,r[42]=i.x,r[43]=e.y,r[44]=e.z,r[45]=i.x,r[46]=i.y,r[47]=e.z,r[48]=i.x,r[49]=i.y,r[50]=i.z,r[51]=i.x,r[52]=i.y,r[53]=e.z,r[54]=e.x,r[55]=i.y,r[56]=i.z,r[57]=e.x,r[58]=i.y,r[59]=e.z,r[60]=e.x,r[61]=e.y,r[62]=i.z,r[63]=e.x,r[64]=e.y,r[65]=e.z,r[66]=i.x,r[67]=e.y,r[68]=i.z,r[69]=i.x,r[70]=e.y,r[71]=e.z,this.geometry.attributes.position.needsUpdate=!0,this.geometry.computeBoundingSphere(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.BoundingBoxHelper=function(t,e){var i=void 0!==e?e:8947848;this.object=t,this.box=new THREE.Box3,THREE.Mesh.call(this,new THREE.BoxGeometry(1,1,1),new THREE.MeshBasicMaterial({color:i,wireframe:!0}))},THREE.BoundingBoxHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.BoundingBoxHelper.prototype.constructor=THREE.BoundingBoxHelper,THREE.BoundingBoxHelper.prototype.update=function(){this.box.setFromObject(this.object),this.box.size(this.scale),this.box.center(this.position)},THREE.CameraHelper=function(t){function e(t,e,i){r(t,i),r(e,i)}function r(t,e){i.vertices.push(new THREE.Vector3),i.colors.push(new THREE.Color(e)),void 0===a[t]&&(a[t]=[]),a[t].push(i.vertices.length-1)}var i=new THREE.Geometry,n=new THREE.LineBasicMaterial({color:16777215,vertexColors:THREE.FaceColors}),a={};e("n1","n2",16755200),e("n2","n4",16755200),e("n4","n3",16755200),e("n3","n1",16755200),e("f1","f2",16755200),e("f2","f4",16755200),e("f4","f3",16755200),e("f3","f1",16755200),e("n1","f1",16755200),e("n2","f2",16755200),e("n3","f3",16755200),e("n4","f4",16755200),e("p","n1",16711680),e("p","n2",16711680),e("p","n3",16711680),e("p","n4",16711680),e("u1","u2",43775),e("u2","u3",43775),e("u3","u1",43775),e("c","t",16777215),e("p","c",3355443),e("cn1","cn2",3355443),e("cn3","cn4",3355443),e("cf1","cf2",3355443),e("cf3","cf4",3355443),THREE.Line.call(this,i,n,THREE.LinePieces),this.camera=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=a,this.update()},THREE.CameraHelper.prototype=Object.create(THREE.Line.prototype),THREE.CameraHelper.prototype.constructor=THREE.CameraHelper,THREE.CameraHelper.prototype.update=function(){var n,a,o=new THREE.Vector3,s=new THREE.Camera,t=function(t,e,i,r){if(o.set(e,i,r).unproject(s),void 0!==(t=a[t]))for(e=0,i=t.length;e<i;e++)n.vertices[t[e]].copy(o)};return function(){n=this.geometry,a=this.pointMap,s.projectionMatrix.copy(this.camera.projectionMatrix),t("c",0,0,-1),t("t",0,0,1),t("n1",-1,-1,-1),t("n2",1,-1,-1),t("n3",-1,1,-1),t("n4",1,1,-1),t("f1",-1,-1,1),t("f2",1,-1,1),t("f3",-1,1,1),t("f4",1,1,1),t("u1",.7,1.1,-1),t("u2",-.7,1.1,-1),t("u3",0,2,-1),t("cf1",-1,0,1),t("cf2",1,0,1),t("cf3",0,-1,1),t("cf4",0,1,1),t("cn1",-1,0,-1),t("cn2",1,0,-1),t("cn3",0,-1,-1),t("cn4",0,1,-1),n.verticesNeedUpdate=!0}}(),THREE.DirectionalLightHelper=function(t,e){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,e=e||1;var i=new THREE.Geometry;i.vertices.push(new THREE.Vector3(-e,e,0),new THREE.Vector3(e,e,0),new THREE.Vector3(e,-e,0),new THREE.Vector3(-e,-e,0),new THREE.Vector3(-e,e,0));var r=new THREE.LineBasicMaterial({fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.lightPlane=new THREE.Line(i,r),this.add(this.lightPlane),(i=new THREE.Geometry).vertices.push(new THREE.Vector3,new THREE.Vector3),(r=new THREE.LineBasicMaterial({fog:!1})).color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine=new THREE.Line(i,r),this.add(this.targetLine),this.update()},THREE.DirectionalLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.DirectionalLightHelper.prototype.constructor=THREE.DirectionalLightHelper,THREE.DirectionalLightHelper.prototype.dispose=function(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()},THREE.DirectionalLightHelper.prototype.update=function(){var t=new THREE.Vector3,e=new THREE.Vector3,i=new THREE.Vector3;return function(){t.setFromMatrixPosition(this.light.matrixWorld),e.setFromMatrixPosition(this.light.target.matrixWorld),i.subVectors(e,t),this.lightPlane.lookAt(i),this.lightPlane.material.color.copy(this.light.color).multiplyScalar(this.light.intensity),this.targetLine.geometry.vertices[1].copy(i),this.targetLine.geometry.verticesNeedUpdate=!0,this.targetLine.material.color.copy(this.lightPlane.material.color)}}(),THREE.EdgesHelper=function(t,e,i){e=void 0!==e?e:16777215,i=Math.cos(THREE.Math.degToRad(void 0!==i?i:1));var r,n=[0,0],a={},o=function(t,e){return t-e},s=["a","b","c"],h=new THREE.BufferGeometry;t.geometry instanceof THREE.BufferGeometry?(r=new THREE.Geometry).fromBufferGeometry(t.geometry):r=t.geometry.clone(),r.mergeVertices(),r.computeFaceNormals();for(var l=r.vertices,c=0,u=0,d=(r=r.faces).length;u<d;u++)for(var p=r[u],f=0;f<3;f++){n[0]=p[s[f]],n[1]=p[s[(f+1)%3]],n.sort(o);var m=n.toString();void 0===a[m]?(a[m]={vert1:n[0],vert2:n[1],face1:u,face2:void 0},c++):a[m].face2=u}for(m in n=new Float32Array(6*c),o=0,a)(void 0===(s=a[m]).face2||r[s.face1].normal.dot(r[s.face2].normal)<=i)&&(c=l[s.vert1],n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,c=l[s.vert2],n[o++]=c.x,n[o++]=c.y,n[o++]=c.z);h.addAttribute("position",new THREE.BufferAttribute(n,3)),THREE.Line.call(this,h,new THREE.LineBasicMaterial({color:e}),THREE.LinePieces),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.EdgesHelper.prototype=Object.create(THREE.Line.prototype),THREE.EdgesHelper.prototype.constructor=THREE.EdgesHelper,THREE.FaceNormalsHelper=function(t,e,i,r){this.object=t,this.size=void 0!==e?e:1,t=void 0!==i?i:16776960,r=void 0!==r?r:1,e=new THREE.Geometry,i=0;for(var n=this.object.geometry.faces.length;i<n;i++)e.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,e,new THREE.LineBasicMaterial({color:t,linewidth:r}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.FaceNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.FaceNormalsHelper.prototype.constructor=THREE.FaceNormalsHelper,THREE.FaceNormalsHelper.prototype.update=function(){var t=this.geometry.vertices,e=this.object,i=e.geometry.vertices,r=e.geometry.faces,n=e.matrixWorld;e.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(n);for(var a=e=0,o=r.length;e<o;e++,a+=2){var s=r[e];t[a].copy(i[s.a]).add(i[s.b]).add(i[s.c]).divideScalar(3).applyMatrix4(n),t[a+1].copy(s.normal).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size).add(t[a])}return this.geometry.verticesNeedUpdate=!0,this},THREE.GridHelper=function(t,e){var i=new THREE.Geometry,r=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors});this.color1=new THREE.Color(4473924),this.color2=new THREE.Color(8947848);for(var n=-t;n<=t;n+=e){i.vertices.push(new THREE.Vector3(-t,0,n),new THREE.Vector3(t,0,n),new THREE.Vector3(n,0,-t),new THREE.Vector3(n,0,t));var a=0===n?this.color1:this.color2;i.colors.push(a,a,a,a)}THREE.Line.call(this,i,r,THREE.LinePieces)},THREE.GridHelper.prototype=Object.create(THREE.Line.prototype),THREE.GridHelper.prototype.constructor=THREE.GridHelper,THREE.GridHelper.prototype.setColors=function(t,e){this.color1.set(t),this.color2.set(e),this.geometry.colorsNeedUpdate=!0},THREE.HemisphereLightHelper=function(t,e){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.colors=[new THREE.Color,new THREE.Color];var i=new THREE.SphereGeometry(e,4,2);i.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));for(var r=0;r<8;r++)i.faces[r].color=this.colors[r<4?0:1];r=new THREE.MeshBasicMaterial({vertexColors:THREE.FaceColors,wireframe:!0}),this.lightSphere=new THREE.Mesh(i,r),this.add(this.lightSphere),this.update()},THREE.HemisphereLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.HemisphereLightHelper.prototype.constructor=THREE.HemisphereLightHelper,THREE.HemisphereLightHelper.prototype.dispose=function(){this.lightSphere.geometry.dispose(),this.lightSphere.material.dispose()},THREE.HemisphereLightHelper.prototype.update=function(){var t=new THREE.Vector3;return function(){this.colors[0].copy(this.light.color).multiplyScalar(this.light.intensity),this.colors[1].copy(this.light.groundColor).multiplyScalar(this.light.intensity),this.lightSphere.lookAt(t.setFromMatrixPosition(this.light.matrixWorld).negate()),this.lightSphere.geometry.colorsNeedUpdate=!0}}(),THREE.PointLightHelper=function(t,e){this.light=t,this.light.updateMatrixWorld();var i=new THREE.SphereGeometry(e,4,2),r=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});r.color.copy(this.light.color).multiplyScalar(this.light.intensity),THREE.Mesh.call(this,i,r),this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1},THREE.PointLightHelper.prototype=Object.create(THREE.Mesh.prototype),THREE.PointLightHelper.prototype.constructor=THREE.PointLightHelper,THREE.PointLightHelper.prototype.dispose=function(){this.geometry.dispose(),this.material.dispose()},THREE.PointLightHelper.prototype.update=function(){this.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)},THREE.SkeletonHelper=function(t){this.bones=this.getBoneList(t);for(var e=new THREE.Geometry,i=0;i<this.bones.length;i++)this.bones[i].parent instanceof THREE.Bone&&(e.vertices.push(new THREE.Vector3),e.vertices.push(new THREE.Vector3),e.colors.push(new THREE.Color(0,0,1)),e.colors.push(new THREE.Color(0,1,0)));i=new THREE.LineBasicMaterial({vertexColors:THREE.VertexColors,depthTest:!1,depthWrite:!1,transparent:!0}),THREE.Line.call(this,e,i,THREE.LinePieces),this.root=t,this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,this.update()},THREE.SkeletonHelper.prototype=Object.create(THREE.Line.prototype),THREE.SkeletonHelper.prototype.constructor=THREE.SkeletonHelper,THREE.SkeletonHelper.prototype.getBoneList=function(t){var e=[];t instanceof THREE.Bone&&e.push(t);for(var i=0;i<t.children.length;i++)e.push.apply(e,this.getBoneList(t.children[i]));return e},THREE.SkeletonHelper.prototype.update=function(){for(var t=this.geometry,e=(new THREE.Matrix4).getInverse(this.root.matrixWorld),i=new THREE.Matrix4,r=0,n=0;n<this.bones.length;n++){var a=this.bones[n];a.parent instanceof THREE.Bone&&(i.multiplyMatrices(e,a.matrixWorld),t.vertices[r].setFromMatrixPosition(i),i.multiplyMatrices(e,a.parent.matrixWorld),t.vertices[r+1].setFromMatrixPosition(i),r+=2)}t.verticesNeedUpdate=!0,t.computeBoundingSphere()},THREE.SpotLightHelper=function(t){THREE.Object3D.call(this),this.light=t,this.light.updateMatrixWorld(),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1,(t=new THREE.CylinderGeometry(0,1,1,8,1,!0)).applyMatrix((new THREE.Matrix4).makeTranslation(0,-.5,0)),t.applyMatrix((new THREE.Matrix4).makeRotationX(-Math.PI/2));var e=new THREE.MeshBasicMaterial({wireframe:!0,fog:!1});this.cone=new THREE.Mesh(t,e),this.add(this.cone),this.update()},THREE.SpotLightHelper.prototype=Object.create(THREE.Object3D.prototype),THREE.SpotLightHelper.prototype.constructor=THREE.SpotLightHelper,THREE.SpotLightHelper.prototype.dispose=function(){this.cone.geometry.dispose(),this.cone.material.dispose()},THREE.SpotLightHelper.prototype.update=function(){var i=new THREE.Vector3,r=new THREE.Vector3;return function(){var t=this.light.distance?this.light.distance:1e4,e=t*Math.tan(this.light.angle);this.cone.scale.set(e,e,t),i.setFromMatrixPosition(this.light.matrixWorld),r.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(r.sub(i)),this.cone.material.color.copy(this.light.color).multiplyScalar(this.light.intensity)}}(),THREE.VertexNormalsHelper=function(t,e,i,r){this.object=t,this.size=void 0!==e?e:1,e=void 0!==i?i:16711680,r=void 0!==r?r:1,i=new THREE.Geometry;for(var n=0,a=(t=t.geometry.faces).length;n<a;n++)for(var o=0,s=t[n].vertexNormals.length;o<s;o++)i.vertices.push(new THREE.Vector3,new THREE.Vector3);THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:e,linewidth:r}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.normalMatrix=new THREE.Matrix3,this.update()},THREE.VertexNormalsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexNormalsHelper.prototype.constructor=THREE.VertexNormalsHelper,THREE.VertexNormalsHelper.prototype.update=function(t){var d=new THREE.Vector3;return function(t){t=["a","b","c","d"],this.object.updateMatrixWorld(!0),this.normalMatrix.getNormalMatrix(this.object.matrixWorld);for(var e=this.geometry.vertices,i=this.object.geometry.vertices,r=this.object.geometry.faces,n=this.object.matrixWorld,a=0,o=0,s=r.length;o<s;o++)for(var h=r[o],l=0,c=h.vertexNormals.length;l<c;l++){var u=h.vertexNormals[l];e[a].copy(i[h[t[l]]]).applyMatrix4(n),d.copy(u).applyMatrix3(this.normalMatrix).normalize().multiplyScalar(this.size),d.add(e[a]),e[a+=1].copy(d),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.VertexTangentsHelper=function(t,e,i,r){this.object=t,this.size=void 0!==e?e:1,e=void 0!==i?i:255,r=void 0!==r?r:1,i=new THREE.Geometry;for(var n=0,a=(t=t.geometry.faces).length;n<a;n++)for(var o=0,s=t[n].vertexTangents.length;o<s;o++)i.vertices.push(new THREE.Vector3),i.vertices.push(new THREE.Vector3);THREE.Line.call(this,i,new THREE.LineBasicMaterial({color:e,linewidth:r}),THREE.LinePieces),this.matrixAutoUpdate=!1,this.update()},THREE.VertexTangentsHelper.prototype=Object.create(THREE.Line.prototype),THREE.VertexTangentsHelper.prototype.constructor=THREE.VertexTangentsHelper,THREE.VertexTangentsHelper.prototype.update=function(t){var d=new THREE.Vector3;return function(t){t=["a","b","c","d"],this.object.updateMatrixWorld(!0);for(var e=this.geometry.vertices,i=this.object.geometry.vertices,r=this.object.geometry.faces,n=this.object.matrixWorld,a=0,o=0,s=r.length;o<s;o++)for(var h=r[o],l=0,c=h.vertexTangents.length;l<c;l++){var u=h.vertexTangents[l];e[a].copy(i[h[t[l]]]).applyMatrix4(n),d.copy(u).transformDirection(n).multiplyScalar(this.size),d.add(e[a]),e[a+=1].copy(d),a+=1}return this.geometry.verticesNeedUpdate=!0,this}}(),THREE.WireframeHelper=function(t,e){var i=void 0!==e?e:16777215,r=[0,0],n={},a=function(t,e){return t-e},o=["a","b","c"],s=new THREE.BufferGeometry;if(t.geometry instanceof THREE.Geometry){for(var h=t.geometry.vertices,l=t.geometry.faces,c=0,u=new Uint32Array(6*l.length),d=0,p=l.length;d<p;d++)for(var f=l[d],m=0;m<3;m++){r[0]=f[o[m]],r[1]=f[o[(m+1)%3]],r.sort(a),void 0===n[g=r.toString()]&&(u[2*c]=r[0],u[2*c+1]=r[1],n[g]=!0,c++)}for(r=new Float32Array(6*c),d=0,p=c;d<p;d++)for(m=0;m<2;m++)c=h[u[2*d+m]],r[(o=6*d+3*m)+0]=c.x,r[o+1]=c.y,r[o+2]=c.z;s.addAttribute("position",new THREE.BufferAttribute(r,3))}else if(t.geometry instanceof THREE.BufferGeometry){if(void 0!==t.geometry.attributes.index){h=t.geometry.attributes.position.array,p=t.geometry.attributes.index.array,(c=0)===(l=t.geometry.drawcalls).length&&(l=[{count:p.length,index:0,start:0}]);u=new Uint32Array(2*p.length),f=0;for(var E=l.length;f<E;++f){m=l[f].start;for(var g=l[f].count,v=(o=l[f].index,d=m,m+g);d<v;d+=3)for(m=0;m<3;m++)r[0]=o+p[d+m],r[1]=o+p[d+(m+1)%3],r.sort(a),void 0===n[g=r.toString()]&&(u[2*c]=r[0],u[2*c+1]=r[1],n[g]=!0,c++)}for(r=new Float32Array(6*c),d=0,p=c;d<p;d++)for(m=0;m<2;m++)o=6*d+3*m,c=3*u[2*d+m],r[o+0]=h[c],r[o+1]=h[c+1],r[o+2]=h[c+2]}else for(u=(c=(h=t.geometry.attributes.position.array).length/3)/3,r=new Float32Array(6*c),d=0,p=u;d<p;d++)for(m=0;m<3;m++)u=9*d+3*m,r[(o=18*d+6*m)+0]=h[u],r[o+1]=h[u+1],r[o+2]=h[u+2],c=9*d+(m+1)%3*3,r[o+3]=h[c],r[o+4]=h[c+1],r[o+5]=h[c+2];s.addAttribute("position",new THREE.BufferAttribute(r,3))}THREE.Line.call(this,s,new THREE.LineBasicMaterial({color:i}),THREE.LinePieces),this.matrix=t.matrixWorld,this.matrixAutoUpdate=!1},THREE.WireframeHelper.prototype=Object.create(THREE.Line.prototype),THREE.WireframeHelper.prototype.constructor=THREE.WireframeHelper,THREE.ImmediateRenderObject=function(){THREE.Object3D.call(this),this.render=function(t){}},THREE.ImmediateRenderObject.prototype=Object.create(THREE.Object3D.prototype),THREE.ImmediateRenderObject.prototype.constructor=THREE.ImmediateRenderObject,THREE.MorphBlendMesh=function(t,e){THREE.Mesh.call(this,t,e),this.animationsMap={},this.animationsList=[];var i=this.geometry.morphTargets.length;this.createAnimation("__default",0,i-1,i/1),this.setAnimationWeight("__default",1)},THREE.MorphBlendMesh.prototype=Object.create(THREE.Mesh.prototype),THREE.MorphBlendMesh.prototype.constructor=THREE.MorphBlendMesh,THREE.MorphBlendMesh.prototype.createAnimation=function(t,e,i,r){e={startFrame:e,endFrame:i,length:i-e+1,fps:r,duration:(i-e)/r,lastFrame:0,currentFrame:0,active:!1,time:0,direction:1,weight:1,directionBackwards:!1,mirroredLoop:!1},this.animationsMap[t]=e,this.animationsList.push(e)},THREE.MorphBlendMesh.prototype.autoCreateAnimations=function(t){for(var e,i=/([a-z]+)_?(\d+)/,r={},n=this.geometry,a=0,o=n.morphTargets.length;a<o;a++){var s=n.morphTargets[a].name.match(i);if(s&&1<s.length){var h=s[1];r[h]||(r[h]={start:1/0,end:-1/0}),a<(s=r[h]).start&&(s.start=a),a>s.end&&(s.end=a),e||(e=h)}}for(h in r)s=r[h],this.createAnimation(h,s.start,s.end,t);this.firstAnimation=e},THREE.MorphBlendMesh.prototype.setAnimationDirectionForward=function(t){(t=this.animationsMap[t])&&(t.direction=1,t.directionBackwards=!1)},THREE.MorphBlendMesh.prototype.setAnimationDirectionBackward=function(t){(t=this.animationsMap[t])&&(t.direction=-1,t.directionBackwards=!0)},THREE.MorphBlendMesh.prototype.setAnimationFPS=function(t,e){var i=this.animationsMap[t];i&&(i.fps=e,i.duration=(i.end-i.start)/i.fps)},THREE.MorphBlendMesh.prototype.setAnimationDuration=function(t,e){var i=this.animationsMap[t];i&&(i.duration=e,i.fps=(i.end-i.start)/i.duration)},THREE.MorphBlendMesh.prototype.setAnimationWeight=function(t,e){var i=this.animationsMap[t];i&&(i.weight=e)},THREE.MorphBlendMesh.prototype.setAnimationTime=function(t,e){var i=this.animationsMap[t];i&&(i.time=e)},THREE.MorphBlendMesh.prototype.getAnimationTime=function(t){var e=0;return(t=this.animationsMap[t])&&(e=t.time),e},THREE.MorphBlendMesh.prototype.getAnimationDuration=function(t){var e=-1;return(t=this.animationsMap[t])&&(e=t.duration),e},THREE.MorphBlendMesh.prototype.playAnimation=function(t){var e=this.animationsMap[t];e?(e.time=0,e.active=!0):THREE.warn("THREE.MorphBlendMesh: animation["+t+"] undefined in .playAnimation()")},THREE.MorphBlendMesh.prototype.stopAnimation=function(t){(t=this.animationsMap[t])&&(t.active=!1)},THREE.MorphBlendMesh.prototype.update=function(t){for(var e=0,i=this.animationsList.length;e<i;e++){var r=this.animationsList[e];if(r.active){var n=r.duration/r.length;r.time+=r.direction*t,r.mirroredLoop?(r.time>r.duration||r.time<0)&&(r.direction*=-1,r.time>r.duration&&(r.time=r.duration,r.directionBackwards=!0),r.time<0&&(r.time=0,r.directionBackwards=!1)):(r.time%=r.duration,r.time<0&&(r.time+=r.duration));var a=r.startFrame+THREE.Math.clamp(Math.floor(r.time/n),0,r.length-1),o=r.weight;a!==r.currentFrame&&(this.morphTargetInfluences[r.lastFrame]=0,this.morphTargetInfluences[r.currentFrame]=1*o,this.morphTargetInfluences[a]=0,r.lastFrame=r.currentFrame,r.currentFrame=a),n=r.time%n/n,r.directionBackwards&&(n=1-n),this.morphTargetInfluences[r.currentFrame]=n*o,this.morphTargetInfluences[r.lastFrame]=(1-n)*o}}},THREE.RenderPass=function(t,e,i,r,n){this.scene=t,this.camera=e,this.overrideMaterial=i,this.clearColor=r,this.clearAlpha=void 0!==n?n:1,this.oldClearColor=new THREE.Color,this.oldClearAlpha=1,this.enabled=!0,this.clear=!0,this.needsSwap=!1},THREE.RenderPass.prototype={render:function(t,e,i,r){this.scene.overrideMaterial=this.overrideMaterial,this.clearColor&&(this.oldClearColor.copy(t.getClearColor()),this.oldClearAlpha=t.getClearAlpha(),t.setClearColor(this.clearColor,this.clearAlpha)),t.render(this.scene,this.camera,i,this.clear),this.clearColor&&t.setClearColor(this.oldClearColor,this.oldClearAlpha),this.scene.overrideMaterial=null}},THREE.ShaderPass=function(t,e){this.textureID=void 0!==e?e:"tDiffuse",this.uniforms=THREE.UniformsUtils.clone(t.uniforms),this.material=new THREE.ShaderMaterial({uniforms:this.uniforms,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader}),this.renderToScreen=!1,this.enabled=!0,this.needsSwap=!0,this.clear=!1,this.camera=new THREE.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new THREE.Scene,this.quad=new THREE.Mesh(new THREE.PlaneGeometry(2,2),null),this.scene.add(this.quad)},THREE.ShaderPass.prototype={render:function(t,e,i,r){this.uniforms[this.textureID]&&(this.uniforms[this.textureID].value=i),this.quad.material=this.material,this.renderToScreen?t.render(this.scene,this.camera):t.render(this.scene,this.camera,e,this.clear)}},THREE.CopyShader={uniforms:{tDiffuse:{type:"t",value:null},opacity:{type:"f",value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")},THREE.MaskPass=function(t,e){this.scene=t,this.camera=e,this.enabled=!0,this.clear=!0,this.needsSwap=!1,this.inverse=!1},THREE.MaskPass.prototype={render:function(t,e,i,r){var n,a,o=t.context;o.colorMask(!1,!1,!1,!1),o.depthMask(!1),this.inverse?(n=0,a=1):(n=1,a=0),o.enable(o.STENCIL_TEST),o.stencilOp(o.REPLACE,o.REPLACE,o.REPLACE),o.stencilFunc(o.ALWAYS,n,4294967295),o.clearStencil(a),t.render(this.scene,this.camera,i,this.clear),t.render(this.scene,this.camera,e,this.clear),o.colorMask(!0,!0,!0,!0),o.depthMask(!0),o.stencilFunc(o.EQUAL,1,4294967295),o.stencilOp(o.KEEP,o.KEEP,o.KEEP)}},THREE.ClearMaskPass=function(){this.enabled=!0},THREE.ClearMaskPass.prototype={render:function(t,e,i,r){var n=t.context;n.disable(n.STENCIL_TEST)}},THREE.EffectComposer=function(t,e){if(this.renderer=t,void 0===e){var i=window.innerWidth||1,r=window.innerHeight||1,n={minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat,stencilBuffer:!1};e=new THREE.WebGLRenderTarget(i,r,n)}this.renderTarget1=e,this.renderTarget2=e.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2,this.passes=[],void 0===THREE.CopyShader&&console.error("THREE.EffectComposer relies on THREE.CopyShader"),this.copyPass=new THREE.ShaderPass(THREE.CopyShader)},THREE.EffectComposer.prototype={swapBuffers:function(){var t=this.readBuffer;this.readBuffer=this.writeBuffer,this.writeBuffer=t},addPass:function(t){this.passes.push(t)},insertPass:function(t,e){this.passes.splice(e,0,t)},render:function(t){this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2;var e,i,r=!1,n=this.passes.length;for(i=0;i<n;i++)if((e=this.passes[i]).enabled){if(e.render(this.renderer,this.writeBuffer,this.readBuffer,t,r),e.needsSwap){if(r){var a=this.renderer.context;a.stencilFunc(a.NOTEQUAL,1,4294967295),this.copyPass.render(this.renderer,this.writeBuffer,this.readBuffer,t),a.stencilFunc(a.EQUAL,1,4294967295)}this.swapBuffers()}e instanceof THREE.MaskPass?r=!0:e instanceof THREE.ClearMaskPass&&(r=!1)}},reset:function(t){void 0===t&&((t=this.renderTarget1.clone()).width=window.innerWidth,t.height=window.innerHeight),this.renderTarget1=t,this.renderTarget2=t.clone(),this.writeBuffer=this.renderTarget1,this.readBuffer=this.renderTarget2},setSize:function(t,e){var i=this.renderTarget1.clone();i.width=t,i.height=e,this.reset(i)}},THREE.FXAAShader={uniforms:{tDiffuse:{type:"t",value:null},resolution:{type:"v2",value:new THREE.Vector2(1/1024,1/512)}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform vec2 resolution;","varying vec2 vUv;","#define FXAA_REDUCE_MIN   (1.0/128.0)","#define FXAA_REDUCE_MUL   (1.0/8.0)","#define FXAA_SPAN_MAX     8.0","void main() {","vec3 rgbNW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbNE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, -1.0 ) ) * resolution ).xyz;","vec3 rgbSW = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( -1.0, 1.0 ) ) * resolution ).xyz;","vec3 rgbSE = texture2D( tDiffuse, ( gl_FragCoord.xy + vec2( 1.0, 1.0 ) ) * resolution ).xyz;","vec4 rgbaM  = texture2D( tDiffuse,  gl_FragCoord.xy  * resolution );","vec3 rgbM  = rgbaM.xyz;","float opacity  = rgbaM.w;","vec3 luma = vec3( 0.299, 0.587, 0.114 );","float lumaNW = dot( rgbNW, luma );","float lumaNE = dot( rgbNE, luma );","float lumaSW = dot( rgbSW, luma );","float lumaSE = dot( rgbSE, luma );","float lumaM  = dot( rgbM,  luma );","float lumaMin = min( lumaM, min( min( lumaNW, lumaNE ), min( lumaSW, lumaSE ) ) );","float lumaMax = max( lumaM, max( max( lumaNW, lumaNE) , max( lumaSW, lumaSE ) ) );","vec2 dir;","dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));","dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));","float dirReduce = max( ( lumaNW + lumaNE + lumaSW + lumaSE ) * ( 0.25 * FXAA_REDUCE_MUL ), FXAA_REDUCE_MIN );","float rcpDirMin = 1.0 / ( min( abs( dir.x ), abs( dir.y ) ) + dirReduce );","dir = min( vec2( FXAA_SPAN_MAX,  FXAA_SPAN_MAX),","max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),","dir * rcpDirMin)) * resolution;","vec3 rgbA = texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * ( 1.0 / 3.0 - 0.5 ) ).xyz;","rgbA += texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * ( 2.0 / 3.0 - 0.5 ) ).xyz;","rgbA *= 0.5;","vec3 rgbB = texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * -0.5 ).xyz;","rgbB += texture2D( tDiffuse, gl_FragCoord.xy  * resolution + dir * 0.5 ).xyz;","rgbB *= 0.25;","rgbB += rgbA * 0.5;","float lumaB = dot( rgbB, luma );","if ( ( lumaB < lumaMin ) || ( lumaB > lumaMax ) ) {","gl_FragColor = vec4( rgbA, opacity );","} else {","gl_FragColor = vec4( rgbB, opacity );","}","}"].join("\n")},define("THREE",function(t){return function(){return t.THREE}}(this)),define("webgl/webgl.store",["dispatcher","TweenMax"],function(t,e){"use strict";var i,r,n,a=!1,o=!1,s=!1,h=!0,l={globalAlpha:1,maskShift:0,alpha:1,displacementX:0,displacementY:0,maskAlpha:0},c=new TimelineLite,u=function(t){if("texture-reset"===t.type&&(o=!1),"texture-needs-update"===t.type)if(o){if(s)return;s=!0,c.to(l,0,{maskShift:.05,maskAlpha:0}),c.to(l,.6,{globalAlpha:0,displacementY:.5,maskShift:.07,alpha:.5,onComplete:function(){d.dispatch({type:"texture-can-update"}),s=!1}}),c.to(l,0,{alpha:0,maskShift:0,displacementX:1,displacementY:2,maskAlpha:0}),c.to(l,.6,{globalAlpha:1,maskAlpha:1}),c.to(l,2,{maskShift:.05,displacementX:0,displacementY:0},"-=0.6"),c.to(l,1,{alpha:1,maskAlpha:0},"-=1.6"),c.to(l,0,{maskShift:0,displacementY:0,onComplete:function(){}})}else o=!0,d.dispatch({type:"texture-can-update"})},d=(i=[],{dispatch:function(t){for(var e=i.length-1;0<=e;e--)i[e](t)},subscribe:function(t){i.push(t)},unsubscribe:function(t){for(var e=0;e<=i.length-1;e++)i[e]==t&&i.splice(e--,1)}});return a||(a=!0,r=document.createElement("canvas").getContext("webgl"),n=document.getElementsByTagName("html")[0],r?h=!0:(h=!1,n.classList.remove("webgl"),n.classList.add("no-webgl")),t.subscribe(u)),{eventEmitter:d,getData:function(){return{shadersData:l,webglSupport:h}}}}),define("webgl/webgl-text.view",["dispatcher","THREE","resize/resize.store","resize/breakpoint-main-text.store","scroll/scroll.store","utils","touch/touch.store","webgl/webgl.store"],function(t,r,n,a,e,i,o,s){"use strict";var h,l,c,u,d,p,f,m,E,g,v,y,T,R,_,x,b,w,H,M,S,C,A,P={mobile:47,tablet1:78,tablet2:155,desktop:193},L={init:function(){var t,e,i=a.getData();m=P[i.breakpoint.name],f=n.getData().width,n.getData().height,c=1,void 0!==window.devicePixelRatio&&(c=window.devicePixelRatio),c=1/c,C=document.getElementById("simpleVertexShader").innerHTML,A=document.getElementById("blurShader").innerHTML,t=.4/f,e=.4/m,"mobile"===i.breakpoint.name&&(t=.2/f,e=.2/m),S={uniforms:{h:{type:"f",value:t},v:{type:"f",value:e}},vertexShader:C,fragmentShader:A},u=new r.OrthographicCamera(f*c/-2,f*c/2,m*c/2,m*c/-2,-100,100),d=new r.Scene,(b=new r.WebGLRenderer({antialias:!0,alpha:!0})).setPixelRatio(window.devicePixelRatio),b.setSize(f,m),b.domElement.style.width="100%",b.domElement.style.height="100%",l.appendChild(b.domElement),w=new r.RenderPass(d,u),M=new r.ShaderPass(S),H=new r.ShaderPass(r.CopyShader),M.renderToScreen=!0,(p=new r.EffectComposer(b)).setSize(f,m),p.addPass(w),p.addPass(H),p.addPass(M)},render:function(){p.render(d,u)},resize:function(){var t=a.getData();m=P[t.breakpoint.name],f=n.getData().width,n.getData().height,u&&b&&(u.left=f*c/-2,u.right=f*c/2,u.top=m*c/2,u.bottom=m*c/-2,u.updateProjectionMatrix(),b.setPixelRatio(window.devicePixelRatio),b.setSize(f,m),b.domElement.style.width="100%",b.domElement.style.height="100%")}},k={init:function(){var t=a.getData();m=P[t.breakpoint.name],T=document.getElementById("text-texture"),f=n.getData().width,n.getData().height,T&&((y=new r.Texture(T)).needsUpdate=!0,y.premultiplyAlpha=!0,y.magFilter=r.NearestFilter,y.minFilter=r.NearestFilter,g=new r.PlaneGeometry(1,1),R=document.getElementById("simpleVertexShader").innerHTML,_=document.getElementById("textShader").innerHTML,x={textTexture:{type:"t",value:y},maskShift:{type:"f",value:0},shiftX:{type:"f",value:0},shiftY:{type:"f",value:0},globalAlpha:{type:"f",value:1},alphaFactor:{type:"f",value:0}},(v=new r.ShaderMaterial({uniforms:x,transparent:!0,vertexShader:R,fragmentShader:_})).blending=r.NormalBlending,(E=new r.Mesh(g,v)).position.x=0,E.position.y=0,E.position.z=0,E.scale.set(f*c,m*c,1),d.add(E))},render:function(){var t=s.getData().shadersData;x.shiftX.value=t.displacementX,x.shiftY.value=t.displacementY,x.maskShift.value=t.maskShift,x.globalAlpha.value=t.globalAlpha,x.alphaFactor.value=t.alpha},resize:function(){var t=a.getData();m=P[t.breakpoint.name],f=n.getData().width,n.getData().height,E&&E.scale.set(f*c,m*c,1)},update:function(){y&&(y.needsUpdate=!0)}},D=function(){l&&(o.getData().isTouchDevice||(L.render(),k.render()),h(D))},F=function(){L.resize(),k.resize()},z=function(){(l=document.getElementById("stage-svg-text"))?s.getData().webglSupport&&Modernizr.webgl&&(L.init(),L.resize(),k.init(),k.resize(),D()):E=p=d=u=l=!1};return{init:function(){h=i.getRequestAnimationFrame(),z(),n.eventEmitter.subscribe(F),t.subscribe(function(t){"mutate"===t.type&&z(),"texture-update"===t.type&&k.update()})}}}),define("webgl/texture.view",["dispatcher","webgl/webgl.store","svg-text/svg-text-positions.store","resize/resize.store","resize/breakpoint-main-text.store","svg-text/svg-text.store","utils"],function(o,t,e,i,s,h,r){"use strict";var l,a,c,u,d,p,f,m,n,E="stage-svg-text",g=!1,v={mobile:47,tablet1:78,tablet2:155,desktop:193},y={mobile:36,tablet1:60,tablet2:120,desktop:150},T=function(){var t,e=s.getData(),i=y[e.breakpoint.name],r=-1<navigator.userAgent.toLowerCase().indexOf("firefox");if(d&&!g){p.font="700 "+i*u+"px Stem Web",p.fillStyle="white",p.strokeStyle="white",p.textBaseline="middle","mobile"===e.breakpoint.name?p.lineWidth=0:p.lineWidth=2,p.clearRect(0,0,a,c);for(var n=0;n<f.length;n++)t=f[n],r?(p.fillText(t.char,t.x*u,v[e.breakpoint.name]/2*u*1.13),p.strokeText(t.char,t.x*u,v[e.breakpoint.name]/2*u*1.13)):(p.fillText(t.char,t.x*u,v[e.breakpoint.name]/2*u),p.strokeText(t.char,t.x*u,v[e.breakpoint.name]/2*u));o.dispatch({type:"texture-update"})}},R=function(t){"texture-can-update"===t.type&&T()},_=function(){var t=s.getData();l=i.getData().width,d&&(a=l*u,c=v[t.breakpoint.name]*u,d.setAttribute("width",a),d.setAttribute("height",c),d.style.height=v[t.breakpoint.name]+"px",d.style.width=l+"px")},x=function(){var r=e.getData(),t=s.getData(),n=h.getData(),a=!1;d&&(l=i.getData().width,v[t.breakpoint.name],function(){var t,e;if(r.items.hasOwnProperty(E)&&m!==r.items[E].text){t=r.items[E].letters,m,m=r.items[E].text,f=[],t.length;for(var i=0;i<t.length;i++)e=t[i],n.lettersData.hasOwnProperty(e.char)?f.push({char:e.char,x:e.x}):console.warn("invalid letter "+e.char);a=!0}}(),function(){var t;if(r.items.hasOwnProperty(E)){t=r.items[E].letters;for(var e=0;e<f.length;e++)f[e].x!==t[e].x&&(f[e].x=t[e].x,a=!0)}}(),a&&o.dispatch({type:"texture-needs-update"}))},b=function(){(n=document.getElementById("stage-svg-text"))?"canvas"===n.getAttribute("data-render")&&(d=document.getElementById("text-texture"))&&(p=d.getContext("2d"),f=[],m="",T()):(p=d=!1,f=[],m="",o.dispatch({type:"texture-reset"}))};return{init:function(){Modernizr.prefixed("transition-delay"),u=1,u*=1,r.getRequestAnimationFrame(),b(),_(),x(),e.eventEmitter.subscribe(x),i.eventEmitter.subscribe(_),s.eventEmitter.subscribe(_),t.eventEmitter.subscribe(R),o.subscribe(function(t){"mutate"===t.type&&(b(),_(),x()),"words-scroll-disable"===t.type&&(g=!0),"words-scroll-enable"===t.type&&(g=!1,T())})}}}),define("webgl/webgl-video.view",["dispatcher","resize/resize.store","scroll/scroll.store","video/video.store","webgl/webgl.store","THREE","touch/touch.store","utils"],function(t,n,i,e,r,a,o,s){"use strict";var h,l,c,u,d,p,f,m,E,g,v,y,T,R,_,x,b,w,H,M,S,C,A,P,L,k,D,F,z,B,O,N=0,U=0,V=0,I=0,G=!1,W=function(){var t=e.getData();d&&t.items.hasOwnProperty("main-video")&&"ready"===t.items["main-video"].status&&setTimeout(function(){d.domElement.style.opacity=1},1e3)},j={init:function(){m=n.getData().width,E=n.getData().height,g=1,void 0!==window.devicePixelRatio&&(g=window.devicePixelRatio),g=1/g,D=document.getElementById("simpleVertexShader").innerHTML,F=document.getElementById("videoPostShader").innerHTML,(A=document.getElementById("text-texture"))&&(P=new a.Texture(A),z=A.height,B=A.width,O=z/(B/m)/E,P.magFilter=a.NearestFilter,P.minFilter=a.NearestFilter,P.needsUpdate=!0,P.premultiplyAlpha=!0,k={uniforms:{tDiffuse:{type:"t",value:0,texture:null},textTexture:{type:"t",value:P},heightCoef:{type:"f",value:O},shift:{type:"f",value:0},maskShift:{type:"f",value:0},maskAlpha:{type:"f",value:0}},vertexShader:D,fragmentShader:F},c=new a.OrthographicCamera(m/-2,m/2,E/2,E/-2,-100,100),u=new a.Scene,(d=new a.WebGLRenderer({antialias:!0,alpha:!0})).setPixelRatio(window.devicePixelRatio),d.setSize(m*g,E*g),d.domElement.classList.add("webgl-renderer"),d.domElement.style.width="100%",d.domElement.style.height="100%",l.appendChild(d.domElement),S=new a.RenderPass(u,c),(C=new a.ShaderPass(a.CopyShader)).renderToScreen=!0,L=new a.ShaderPass(k),(p=new a.EffectComposer(d)).setSize(m*g,E*g),p.addPass(S),p.addPass(L),p.addPass(C),p.render())},render:function(){var t=r.getData().shadersData;I+=(V-I)/10,L.material.uniforms.shift.value=I,L.material.uniforms.maskShift.value=t.maskShift,L.material.uniforms.maskAlpha.value=t.maskAlpha,p.render(u,c)},update:function(){P&&(z=A.height,B=A.width,O=z/(B/m)/E,P.needsUpdate=!0,L.material.uniforms.textTexture.value=P,L.material.uniforms.heightCoef.value=O)},resize:function(){m=n.getData().width,E=n.getData().height,c&&d&&(c.left=m/-2,c.right=m/2,c.top=E/2,c.bottom=E/-2,c.updateProjectionMatrix(),d.setPixelRatio(window.devicePixelRatio),d.setSize(m*g,E*g),d.domElement.style.width="100%",d.domElement.style.height="100%")}},q={init:function(){(M=document.getElementById("text-texture"))&&((w=new a.Texture(M)).magFilter=a.NearestFilter,w.minFilter=a.NearestFilter,w.needsUpdate=!0,w.premultiplyAlpha=!0,(_=new a.VideoTexture(h)).minFilter=a.LinearFilter,_.magFilter=a.LinearFilter,x=document.getElementById("simpleVertexShader").innerHTML,b=document.getElementById("videoShader").innerHTML,H={texture:{type:"t",value:_}},R=new a.ShaderMaterial({uniforms:H,transparent:!0,vertexShader:x,fragmentShader:b}),T=new a.PlaneGeometry(v,y),v,y,(f=new a.Mesh(T,R)).material.depthTest=!1,f.material.depthWrite=!1,u.add(f))},render:function(){},resize:function(){var t,e,i,r=n.getData();m=r.width,E=r.height,t=m/v,e=E/y,i=Math.max(t,e),f&&(f.scale.set(i,i,1),v*i,y*i)},update:function(){}},X=function(){l&&h&&(o.getData().isTouchDevice||G||(j.render(),q.render()),requestAnimationFrame(X))},Y=function(){j.resize(),q.resize()},K=function(){var t=i.getData().top,e=n.getData().height;G=e<t},Q=function(){l=document.getElementById("video-container"),h=document.getElementById("main-video"),l&&h?r.getData().webglSupport&&Modernizr.webgl&&(v=h.width,y=h.height,j.init(),j.resize(),q.init(),q.resize(),X()):f=p=u=c=l=!1};return{init:function(){Q(),n.eventEmitter.subscribe(Y),Y(),document.addEventListener("mousemove",function(t){var e;Math.pow(.5,.5),N=Math.abs(t.clientX/m-.5),U=Math.abs(t.clientY/E-.5),e=Math.max(N,U),V=e/.5,V=Math.pow(V,3)}),W(),K(),e.eventEmitter.subscribe(W),i.eventEmitter.subscribe(K),n.eventEmitter.subscribe(K),t.subscribe(function(t){"mutate"===t.type&&Q(),"texture-update"===t.type&&(j.update(),q.update(),W())})}}});var path,pathElements=document.getElementsByName("resources-path");"/"!==(path=pathElements&&pathElements.length?pathElements[0].content:document.getElementsByTagName("head")[0].getAttribute("data-path")).slice(-1)&&(path+="/"),require.config({baseUrl:path+"js/modules",paths:{skrollr:"../libs/skrollr",THREE:"../libs/three-with-composer",TweenMax:"../libs/TweenMax",swipe:"../libs/swipe",fastClick:"../libs/fstClick"},shim:{THREE:{exports:"THREE"}}}),require(["domReady","resize/vhUnits.view","resize/vhMinUnits.view","images/images.view","resize/element-resize.view","resize/ios-fix.view","touch/touch.view","router/links.view","router/fetch.view","router/history.view","router/scroll-load.view","page-transition/project-transition.view","page-transition/close-transition.view","page-transition/menu-transition.view","page-transition/simple-transition.view","preload/preload.view","trigger/trigger.view","trigger/scroll-trigger.view","form/form.view","form/form-focus.view","form/form-responce.view","sidenav/sidenav.view","sidenav/sidenav-hide.view","slider/slider.view","slider/slider-arrows.view","slider/slider-slides.view","slider/slider-controls.view","slider/slider-dashes.view","synthetic-scroll/btn-scroll.view","parallax/parallax.view","parallax/simple-parallax.view","menu/menu.view","menu/menu-hover.view","menu/menu-btn.view","header/header-color.view","svg-text/svg-text-init.view","svg-text/svg-text-reposition.view","svg-text/svg-text.view","svg-text/svg-text-fallback.view","stage-text/stage-text-scroll.view","stage-text/stage-text-timer.view","stage-color/stage-color.view","decor/group-hover.view","decor/project-hover.view","decor/team-align.view","page-name/page-name.view","page-name/page-name-scroll.view","timer/timer.view","team/team.view","share/share.view","video/video.view","webgl/webgl-text.view","webgl/texture.view","webgl/webgl-video.view"],function(t,e,i,r,n,a,o,s,h,l,c,u,d,p,f,m,E,g,v,y,T,R,_,x,b,w,H,M,S,C,A,P,L,k,D,F,z,B,O,N,U,V,I,G,W,j,q,X,Y,K,Q,Z,J,$){t(function(){e.init(),i.init(),r.init(),n.init(),o.init(),s.init(),h.init(),l.init(),c.init(),u.init(),d.init(),p.init(),f.init(),v.init(),y.init(),T.init(),R.init(),_.init(),x.init(),b.init(),w.init(),H.init(),M.init(),m.init(),E.init(),g.init(),S.init(),C.init(),A.init(),P.init(),L.init(),k.init(),D.init(),F.init(),z.init(),B.init(),O.init(),N.init(),U.init(),V.init(),I.init(),G.init(),W.init(),j.init(),q.init(),X.init(),Y.init(),K.init(),Q.init(),Z.init(),J.init(),$.init()})}),define("../app",function(){});