text: //   _  /._  _  r8 2018-01-22 10:13am
  //  /_|///_'/ /
  var _get=function e(t,n,i){null===t&&(t=Function.prototype);var r=Object.getOwnPropertyDescriptor(t,n);if(void 0===r){var a=Object.getPrototypeOf(t);return null===a?void 0:e(a,n,i)}if("value"in r)return r.value;var s=r.get;return void 0!==s?s.call(i):void 0},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _toConsumableArray(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}"undefined"!=typeof Promise&&(Promise.create=function(){var e=void 0,t=void 0,n=new Promise(function(n,i){e=n,t=i});return n.resolve=e,n.reject=t,n}),Math.sign=function(e){return 0===(e=+e)||isNaN(e)?Number(e):e>0?1:-1},Math.degrees=function(e){return e*(180/Math.PI)},Math.radians=function(e){return e*(Math.PI/180)},Math.clamp=function(e,t,n){return Math.min(Math.max(e,Math.min(t,n)),Math.max(t,n))},Math.range=function(e,t,n,i,r,a){var s=(e-t)*(r-i)/(n-t)+i;return a?Math.clamp(s,i,r):s},Math.mix=function(e,t,n){return e*(1-n)+t*n},Math.step=function(e,t){return t<e?0:1},Math.smoothStep=function(e,t,n){var i=Math.max(0,Math.min(1,(n-e)/(t-e)));return i*i*(3-2*i)},Math.fract=function(e){return e-Math.floor(e)},Math.mod=function(e,t){return(e%t+t)%t},Array.prototype.remove=function(e){var t=this.indexOf(e);if(~t)return this.splice(t,1)},Array.prototype.last=function(){return this[this.length-1]},String.prototype.includes=function(e){if(!Array.isArray(e))return~this.indexOf(e);for(var t=0;t<e.length;t++)if(~this.indexOf(e[t]))return!0;return!1},String.prototype.clip=function(e,t){return this.length>e?this.slice(0,e)+t:this},String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)},String.prototype.replaceAll=function(e,t){return this.split(e).join(t)},window.fetch||(window.fetch=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Promise.create(),i=new XMLHttpRequest;for(var r in i.open(t.method||"GET",e),t.headers)i.setRequestHeader(r,t.headers[r]);function a(){var e=[],t=[],n={},r=void 0;return i.getAllResponseHeaders().replace(/^(.*?):\s*([\s\S]*?)$/gm,function(i,a,s){e.push(a=a.toLowerCase()),t.push([a,s]),r=n[a],n[a]=r?r+","+s:s}),{ok:1==(i.status/200|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:a,text:function(){return Promise.resolve(i.responseText)},json:function(){return Promise.resolve(i.responseText).then(JSON.parse)},xml:function(){return Promise.resolve(i.responseXML)},blob:function(){return Promise.resolve(new Blob([i.response]))},arrayBuffer:function(){return Promise.resolve(new ArrayBuffer([i.response]))},headers:{keys:function(){return e},entries:function(){return t},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}return i.onload=function(){return n.resolve(a())},i.onerror=n.reject,i.send(t.body),n}),window.get=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Promise.create();return t.method="GET",window.fetch(e,t).then(function(e){if(!e.ok)return n.reject(e);e.text().then(function(e){if(e.charAt(0).includes(["[","{"]))try{n.resolve(JSON.parse(e))}catch(t){n.resolve(e)}else n.resolve(e)})}).catch(n.reject),n},window.post=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=Promise.create();return n.method="POST",n.body=JSON.stringify(t),window.fetch(e,n).then(function(e){if(!e.ok)return i.reject(e);e.text().then(function(e){if(e.charAt(0).includes(["[","{"]))try{i.resolve(JSON.parse(e))}catch(t){i.resolve(e)}else i.resolve(e)})}).catch(i.reject),i},window.getURL=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_blank";window.open(e,t)},window.URL||(window.URL=window.webkitURL),window.Config||(window.Config={}),window.Global||(window.Global={});var Utils=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"random",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(void 0===e)return Math.random();if(e===t)return e;e=e||0,t=t||1;var i=Math.pow(10,n);return Math.round((e+Math.random()*(t-e))*i)/i}},{key:"headsTails",value:function(e,t){return this.random(0,1)?t:e}},{key:"queryString",value:function(e){var t=decodeURI(window.location.search.replace(new RegExp("^(?:.*[&\\?]"+encodeURI(e).replace(/[.+*]/g,"\\$&")+"(?:\\=([^&]*))?)?.*$","i"),"$1"));return!(!t.length||"0"===t||"false"===t)&&t}},{key:"getConstructorName",value:function(e){return e.constructor.name||e.constructor.toString().match(/function ([^(]+)/)[1]}},{key:"nullObject",value:function(e){for(var t in e)void 0!==e[t]&&(e[t]=null);return null}},{key:"cloneObject",value:function(e){return JSON.parse(JSON.stringify(e))}},{key:"mergeObject",value:function(){for(var e={},t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];var r=!0,a=!1,s=void 0;try{for(var o,u=n[Symbol.iterator]();!(r=(o=u.next()).done);r=!0){var l=o.value;for(var c in l)e[c]=l[c]}}catch(e){a=!0,s=e}finally{try{!r&&u.return&&u.return()}finally{if(a)throw s}}return e}},{key:"toArray",value:function(e){return Object.keys(e).map(function(t){return e[t]})}},{key:"cloneArray",value:function(e){return e.slice(0)}},{key:"basename",value:function(e,t){var n=e.split("/").last();return t?n:n.split(".")[0]}},{key:"extension",value:function(e){return e.split(".").last().split("?")[0].toLowerCase()}},{key:"base64",value:function(e){return window.btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}},{key:"timestamp",value:function(){return(Date.now()+this.random(0,99999)).toString()}},{key:"pad",value:function(e){return e<10?"0"+e:e}}]),e}();window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(){var e=Date.now();return function(t){return setTimeout(function(){return t(Date.now()-e)},1e3/60)}}());var Render=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this,t=this,n=[],i=200,r=performance.now();function a(e){var s=Math.min(i,e-r);r=e,t.TIME=e,t.DELTA=s;for(var o=n.length-1;o>=0;o--){var u=n[o];if(u)if(u.fps){if(e-u.last<1e3/u.fps)continue;u(++u.frame),u.last=e}else u(e,s);else n.remove(u)}t.paused||requestAnimationFrame(a)}window.addEventListener("load",function(){return requestAnimationFrame(a)},!0),this.start=function(e,t){t&&(e.fps=t,e.last=-1/0,e.frame=-1),~n.indexOf(e)||n.unshift(e)},this.stop=function(e){n.remove(e)},this.pause=function(){e.paused=!0},this.resume=function(){e.paused&&(e.paused=!1,requestAnimationFrame(a))}}}]),e}();Render.init();var Timer=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=[],t=[];Render.start(function(n,i){for(var r=0;r<t.length;r++){var a=t[r];a.callback=null,e.remove(a)}t.length&&(t.length=0);for(var s=0;s<e.length;s++){var o=e[s];o?(o.current+=i)>=o.time&&(o.callback&&o.callback.apply(o,_toConsumableArray(o.args)),t.push(o)):e.remove(o)}}),this.clearTimeout=function(t){var n=function(t){for(var n=0;n<e.length;n++)if(e[n].ref===t)return e[n];return null}(t);return!!n&&(n.callback=null,e.remove(n),!0)},this.create=function(t,n){for(var i=arguments.length,r=Array(i>2?i-2:0),a=2;a<i;a++)r[a-2]=arguments[a];var s={time:Math.max(1,n||1),current:0,ref:Utils.timestamp(),callback:t,args:r};return e.push(s),s.ref}}}]),e}();Timer.init();var Events=function e(){var t=this;_classCallCheck(this,e);var n=function(){function e(){_classCallCheck(this,e),this.events=[],this.links=[]}return _createClass(e,[{key:"add",value:function(e,t,n){this.events.push({event:e,callback:t,object:n})}},{key:"remove",value:function(e,t){for(var n=this.events.length-1;n>=0;n--)this.events[n].event===e&&this.events[n].callback===t&&(this.events[n].removed=!0,this.events.splice(n,1)[0]=null)}},{key:"fire",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=!1,i=0;i<this.events.length;i++)this.events[i].event!==e||this.events[i].removed||(this.events[i].callback(t),n=!0);return n}},{key:"destroy",value:function(e){for(var t=this.events.length-1;t>=0;t--)this.events[t].object===e&&(this.events.splice(t,1)[0]=null)}},{key:"link",value:function(e){~this.links.indexOf(e)||this.links.push(e)}}]),e}();e.initialized||(e.emitter=new n,e.VISIBILITY="visibility",e.KEYBOARD_PRESS="keyboard_press",e.KEYBOARD_DOWN="keyboard_down",e.KEYBOARD_UP="keyboard_up",e.RESIZE="resize",e.COMPLETE="complete",e.PROGRESS="progress",e.UPDATE="update",e.LOADED="loaded",e.ERROR="error",e.READY="ready",e.HOVER="hover",e.CLICK="click",e.initialized=!0),this.emitter=new n;var i=[];this.add=function(n,r,a){if("object"!==(void 0===n?"undefined":_typeof(n))&&(a=r,r=n,n=null),n){var s=n.events.emitter;s.add(r,a,t),s.link(t),i.push(s)}else e.emitter.add(r,a,t)},this.remove=function(t,n,i){"object"!==(void 0===t?"undefined":_typeof(t))&&(i=n,n=t,t=null),t?t.events.emitter.remove(n,i):e.emitter.remove(n,i)},this.fire=function(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];t.emitter.fire(n,i)||r||e.emitter.fire(n,i)},this.destroy=function(){return e.emitter.destroy(t),i.forEach(function(e){return e.destroy(t)}),t.emitter.links.forEach(function(e){return e.unlink(t.emitter)}),Utils.nullObject(t)},this.unlink=function(e){i.remove(e)}},Device=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e,t,n=this;this.agent=navigator.userAgent.toLowerCase(),this.prefix=(e=window.getComputedStyle(document.documentElement,""),{lowercase:t=(Array.prototype.slice.call(e).join("").match(/-(webkit|moz|ms)-/)||""===e.OLink&&["","o"])[1],js:t[0].toUpperCase()+t.substr(1)}),this.transformProperty=function(){var e=void 0;switch(n.prefix.lowercase){case"webkit":e="-webkit-transform";break;case"moz":e="-moz-transform";break;case"ms":e="-ms-transform";break;case"o":e="-o-transform";break;default:e="transform"}return e}(),this.pixelRatio=window.devicePixelRatio,this.os=n.detect(["iphone","ipad"])?"ios":n.detect(["android"])?"android":n.detect(["blackberry"])?"blackberry":n.detect(["mac os"])?"mac":n.detect(["windows"])?"windows":n.detect(["linux"])?"linux":"unknown",this.browser="ios"===n.os?n.detect(["safari"])?"safari":"unknown":"android"===n.os?n.detect(["chrome"])?"chrome":n.detect(["firefox"])?"firefox":"browser":n.detect(["msie"])?"ie":n.detect(["trident"])&&n.detect(["rv:"])?"ie":n.detect(["windows"])&&n.detect(["edge"])?"ie":n.detect(["chrome"])?"chrome":n.detect(["safari"])?"safari":n.detect(["firefox"])?"firefox":"unknown",this.mobile="ontouchstart"in window&&this.detect(["iphone","ipad","android","blackberry"]),this.tablet=Math.max(screen.width,screen.height)>800,this.phone=!this.tablet,this.webgl=function(){try{for(var e=["webgl","experimental-webgl","webkit-3d","moz-webgl"],t=document.createElement("canvas"),n=void 0,i=0;i<e.length&&!(n=t.getContext(e[i]));i++);var r=n.getExtension("WEBGL_debug_renderer_info"),a={};if(r){var s=r.UNMASKED_RENDERER_WEBGL;a.gpu=n.getParameter(s).toLowerCase()}return a.renderer=n.getParameter(n.RENDERER).toLowerCase(),a.version=n.getParameter(n.VERSION).toLowerCase(),a.glsl=n.getParameter(n.SHADING_LANGUAGE_VERSION).toLowerCase(),a.extensions=n.getSupportedExtensions(),a.detect=function(e){if(a.gpu&&a.gpu.includes(e))return!0;if(a.version&&a.version.includes(e))return!0;for(var t=0;t<a.extensions.length;t++)if(a.extensions[t].toLowerCase().includes(e))return!0;return!1},a}catch(e){return!1}}()}},{key:"detect",value:function(e){return this.agent.includes(e)}},{key:"vendor",value:function(e){return this.prefix.js+e}},{key:"vibrate",value:function(e){navigator.vibrate&&navigator.vibrate(e)}}]),e}();Device.init();var Component=function(){function e(){_classCallCheck(this,e),this.events=new Events,this.classes=[],this.timers=[],this.loops=[]}return _createClass(e,[{key:"initClass",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=new(Function.prototype.bind.apply(e,[null].concat(n)));return this.add(r),r}},{key:"add",value:function(e){return e.destroy&&(this.classes.push(e),e.parent=this),this}},{key:"delayedCall",value:function(e){for(var t=arguments.length,n=Array(t>2?t-2:0),i=2;i<t;i++)n[i-2]=arguments[i];var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=Timer.create(function(){e&&e.apply(void 0,n)},r);return this.timers.push(a),this.timers.length>50&&this.timers.shift(),a}},{key:"clearTimers",value:function(){for(var e=this.timers.length-1;e>=0;e--)Timer.clearTimeout(this.timers[e]);this.timers.length=0}},{key:"startRender",value:function(e,t){this.loops.push(e),Render.start(e,t)}},{key:"stopRender",value:function(e){this.loops.remove(e),Render.stop(e)}},{key:"clearRenders",value:function(){for(var e=this.loops.length-1;e>=0;e--)this.stopRender(this.loops[e]);this.loops.length=0}},{key:"destroy",value:function(){this.removed=!0;var e=this.parent;e&&!e.removed&&e.remove&&e.remove(this);for(var t=this.classes.length-1;t>=0;t--){var n=this.classes[t];n&&n.destroy&&n.destroy()}return this.classes.length=0,this.clearRenders(),this.clearTimers(),this.events.destroy(),Utils.nullObject(this)}},{key:"remove",value:function(e){this.classes.remove(e)}}]),e}(),Interpolation=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this;this.convertEase=function(t){return function(){var n=void 0;switch(t){case"easeInQuad":n=e.Quad.In;break;case"easeInCubic":n=e.Cubic.In;break;case"easeInQuart":n=e.Quart.In;break;case"easeInQuint":n=e.Quint.In;break;case"easeInSine":n=e.Sine.In;break;case"easeInExpo":n=e.Expo.In;break;case"easeInCirc":n=e.Circ.In;break;case"easeInElastic":n=e.Elastic.In;break;case"easeInBack":n=e.Back.In;break;case"easeInBounce":n=e.Bounce.In;break;case"easeOutQuad":n=e.Quad.Out;break;case"easeOutCubic":n=e.Cubic.Out;break;case"easeOutQuart":n=e.Quart.Out;break;case"easeOutQuint":n=e.Quint.Out;break;case"easeOutSine":n=e.Sine.Out;break;case"easeOutExpo":n=e.Expo.Out;break;case"easeOutCirc":n=e.Circ.Out;break;case"easeOutElastic":n=e.Elastic.Out;break;case"easeOutBack":n=e.Back.Out;break;case"easeOutBounce":n=e.Bounce.Out;break;case"easeInOutQuad":n=e.Quad.InOut;break;case"easeInOutCubic":n=e.Cubic.InOut;break;case"easeInOutQuart":n=e.Quart.InOut;break;case"easeInOutQuint":n=e.Quint.InOut;break;case"easeInOutSine":n=e.Sine.InOut;break;case"easeInOutExpo":n=e.Expo.InOut;break;case"easeInOutCirc":n=e.Circ.InOut;break;case"easeInOutElastic":n=e.Elastic.InOut;break;case"easeInOutBack":n=e.Back.InOut;break;case"easeInOutBounce":n=e.Bounce.InOut;break;case"linear":n=e.Linear.None}return n}()||e.Cubic.Out},this.Linear={None:function(e){return e}},this.Quad={In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},this.Cubic={In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}},this.Quart={In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}},this.Quint={In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}},this.Sine={In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return.5*(1-Math.cos(Math.PI*e))}},this.Expo={In:function(e){return 0===e?0:Math.pow(1024,e-1)},Out:function(e){return 1===e?1:1-Math.pow(2,-10*e)},InOut:function(e){return 0===e?0:1===e?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(2-Math.pow(2,-10*(e-1)))}},this.Circ={In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}},this.Elastic={In:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,i=void 0;return 0===e?0:1===e?1:(!t||t<1?(t=1,i=n/4):i=n*Math.asin(1/t)/(2*Math.PI),-t*Math.pow(2,10*(e-=1))*Math.sin((e-i)*(2*Math.PI)/n))},Out:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,i=void 0;return 0===e?0:1===e?1:(!t||t<1?(t=1,i=n/4):i=n*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*e)*Math.sin((e-i)*(2*Math.PI)/n)+1)},InOut:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.4,i=void 0;return 0===e?0:1===e?1:(!t||t<1?(t=1,i=n/4):i=n*Math.asin(1/t)/(2*Math.PI),(e*=2)<1?t*Math.pow(2,10*(e-=1))*Math.sin((e-i)*(2*Math.PI)/n)*-.5:t*Math.pow(2,-10*(e-=1))*Math.sin((e-i)*(2*Math.PI)/n)*.5+1)}},this.Back={In:function(e){var t=1.70158;return e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}},this.Bounce={In:function(e){return 1-this.Bounce.Out(1-e)},Out:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},InOut:function(e){return e<.5?.5*this.Bounce.In(2*e):.5*this.Bounce.Out(2*e-1)+.5}}}}]),e}();Interpolation.init();var MathTween=function e(t,n,i,r,a,s,o){var u=this;_classCallCheck(this,e);var l=this,c=void 0,h=void 0,f=void 0,d=void 0,v=void 0,m=void 0,p=void 0;function y(){if(!t&&!n)return!1;t.mathTween=null,TweenManager.removeMathTween(l),Utils.nullObject(l),t.mathTweens&&t.mathTweens.remove(l)}!function(){!t.multiTween&&t.mathTween&&TweenManager.clearTween(t);TweenManager.addMathTween(l),t.mathTween=l,t.multiTween&&(t.mathTweens||(t.mathTweens=[]),t.mathTweens.push(l));r=Interpolation.convertEase(r),c=performance.now(),c+=a,f=n,h={},n.spring&&(v=n.spring);n.damping&&(m=n.damping);for(var e in f)"number"==typeof t[e]&&(h[e]=t[e])}(),this.update=function(e){if(!(d||e<c)){p=(p=(e-c)/i)>1?1:p;var t=u.interpolate(p);s&&s(t),1===p&&(o&&o(),y())}},this.stop=function(){y()},this.pause=function(){d=!0},this.resume=function(){d=!1,c=performance.now()-p*i},this.interpolate=function(e){var n=r(e,v,m);for(var i in h)if("number"==typeof h[i]&&"number"==typeof f[i]){var a=h[i],s=f[i];t[i]=a+(s-a)*n}return n}},TweenManager=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this;this.TRANSFORMS=["x","y","z","scale","scaleX","scaleY","rotation","rotationX","rotationY","rotationZ","skewX","skewY","perspective"],this.CSS_EASES={easeOutCubic:"cubic-bezier(0.215, 0.610, 0.355, 1.000)",easeOutQuad:"cubic-bezier(0.250, 0.460, 0.450, 0.940)",easeOutQuart:"cubic-bezier(0.165, 0.840, 0.440, 1.000)",easeOutQuint:"cubic-bezier(0.230, 1.000, 0.320, 1.000)",easeOutSine:"cubic-bezier(0.390, 0.575, 0.565, 1.000)",easeOutExpo:"cubic-bezier(0.190, 1.000, 0.220, 1.000)",easeOutCirc:"cubic-bezier(0.075, 0.820, 0.165, 1.000)",easeOutBack:"cubic-bezier(0.175, 0.885, 0.320, 1.275)",easeInCubic:"cubic-bezier(0.550, 0.055, 0.675, 0.190)",easeInQuad:"cubic-bezier(0.550, 0.085, 0.680, 0.530)",easeInQuart:"cubic-bezier(0.895, 0.030, 0.685, 0.220)",easeInQuint:"cubic-bezier(0.755, 0.050, 0.855, 0.060)",easeInSine:"cubic-bezier(0.470, 0.000, 0.745, 0.715)",easeInCirc:"cubic-bezier(0.600, 0.040, 0.980, 0.335)",easeInBack:"cubic-bezier(0.600, -0.280, 0.735, 0.045)",easeInOutCubic:"cubic-bezier(0.645, 0.045, 0.355, 1.000)",easeInOutQuad:"cubic-bezier(0.455, 0.030, 0.515, 0.955)",easeInOutQuart:"cubic-bezier(0.770, 0.000, 0.175, 1.000)",easeInOutQuint:"cubic-bezier(0.860, 0.000, 0.070, 1.000)",easeInOutSine:"cubic-bezier(0.445, 0.050, 0.550, 0.950)",easeInOutExpo:"cubic-bezier(1.000, 0.000, 0.000, 1.000)",easeInOutCirc:"cubic-bezier(0.785, 0.135, 0.150, 0.860)",easeInOutBack:"cubic-bezier(0.680, -0.550, 0.265, 1.550)",easeInOut:"cubic-bezier(0.420, 0.000, 0.580, 1.000)",linear:"linear"};var t=[];Render.start(function(n){for(var i=t.length-1;i>=0;i--){var r=t[i];r.update?r.update(n):e.removeMathTween(r)}}),this.addMathTween=function(e){t.push(e)},this.removeMathTween=function(e){t.remove(e)}}},{key:"tween",value:function(e,t,n,i,r,a,s){"number"!=typeof r&&(s=a,a=r,r=0);var o=null;"undefined"!=typeof Promise&&(o=Promise.create(),a&&o.then(a),a=o.resolve);var u=new MathTween(e,t,n,i,r,s,a);return o||u}},{key:"clearTween",value:function(e){if(e.mathTween&&e.mathTween.stop(),e.mathTweens){for(var t=e.mathTweens,n=t.length-1;n>=0;n--){var i=t[n];i&&i.stop()}e.mathTweens=null}}},{key:"parseTransform",value:function(e){var t="";if(void 0!==e.x||void 0!==e.y||void 0!==e.z){var n="";n+=(e.x||0)+"px, ",n+=(e.y||0)+"px, ",t+="translate3d("+(n+=(e.z||0)+"px")+")"}return void 0!==e.scale?t+="scale("+e.scale+")":(void 0!==e.scaleX&&(t+="scaleX("+e.scaleX+")"),void 0!==e.scaleY&&(t+="scaleY("+e.scaleY+")")),void 0!==e.rotation&&(t+="rotate("+e.rotation+"deg)"),void 0!==e.rotationX&&(t+="rotateX("+e.rotationX+"deg)"),void 0!==e.rotationY&&(t+="rotateY("+e.rotationY+"deg)"),void 0!==e.rotationZ&&(t+="rotateZ("+e.rotationZ+"deg)"),void 0!==e.skewX&&(t+="skewX("+e.skewX+"deg)"),void 0!==e.skewY&&(t+="skewY("+e.skewY+"deg)"),void 0!==e.perspective&&(t+="perspective("+e.perspective+"px)"),t}},{key:"isTransform",value:function(e){return~this.TRANSFORMS.indexOf(e)}},{key:"getAllTransforms",value:function(e){for(var t={},n=0;n<this.TRANSFORMS.length;n++){var i=this.TRANSFORMS[n],r=e[i];0!==r&&"number"==typeof r&&(t[i]=r)}return t}},{key:"getEase",value:function(e){return this.CSS_EASES[e]||this.CSS_EASES.easeOutCubic}}]),e}();TweenManager.init();var CSSTransition=function e(t,n,i,r,a,s){_classCallCheck(this,e);var o=this,u=void 0,l=void 0;function c(){return!o||o.kill||!t||!t.element}function h(){c()||(o.kill=!0,t.element.style[Device.vendor("Transition")]="",t.cssTween=null,t.willChange(null),t=n=null,Utils.nullObject(o))}!function(){var e=TweenManager.getAllTransforms(t),i=[];for(var r in n)TweenManager.isTransform(r)?(e.use=!0,e[r]=n[r],delete n[r]):("number"==typeof n[r]||~r.indexOf("-"))&&i.push(r);e.use&&(i.push(Device.transformProperty),delete e.use);u=e,l=i}(),function(){if(c())return;t.cssTween&&(t.cssTween.kill=!0);t.cssTween=o;var e=function(e,t,n){for(var i="",r="",a=0;a<l.length;a++){var s=l[a];i+=(i.length?", ":"")+s,r+=(r.length?", ":"")+s+" "+e+"ms "+TweenManager.getEase(t)+" "+n+"ms"}return{props:i,transition:r}}(i,r,a);t.willChange(e.props),Timer.create(function(){c()||(t.element.style[Device.vendor("Transition")]=e.transition,t.css(n),t.transform(u),Timer.create(function(){c()||(h(),s&&s())},i+a))},50)}(),this.stop=h},Interface=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"div",i=arguments[2];if(_classCallCheck(this,e),this.events=new Events,this.classes=[],this.timers=[],this.loops=[],void 0!==t){if("string"==typeof t){if(this.name=t,this.type=n,"svg"===n){var r=i||"svg";i=!0,this.element=document.createElementNS("http://www.w3.org/2000/svg",r),this.element.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")}else this.element=document.createElement(n),"."!==t[0]?this.element.id=t:this.element.className=t.substr(1);this.element.style.position="absolute",i||document.body.appendChild(this.element)}else this.element=t;this.element.object=this}}return _createClass(e,[{key:"initClass",value:function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var r=new(Function.prototype.bind.apply(e,[null].concat(n)));return this.add(r),r}},{key:"add",value:function(e){var t=this.element;return e.element?(t.appendChild(e.element),this.classes.push(e),e.parent=this):e.nodeName&&t.appendChild(e),this}},{key:"delayedCall",value:function(e){for(var t=arguments.length,n=Array(t>2?t-2:0),i=2;i<t;i++)n[i-2]=arguments[i];var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=Timer.create(function(){e&&e.apply(void 0,n)},r);return this.timers.push(a),this.timers.length>50&&this.timers.shift(),a}},{key:"clearTimers",value:function(){for(var e=this.timers.length-1;e>=0;e--)Timer.clearTimeout(this.timers[e]);this.timers.length=0}},{key:"startRender",value:function(e,t){this.loops.push(e),Render.start(e,t)}},{key:"stopRender",value:function(e){this.loops.remove(e),Render.stop(e)}},{key:"clearRenders",value:function(){for(var e=this.loops.length-1;e>=0;e--)this.stopRender(this.loops[e]);this.loops.length=0}},{key:"destroy",value:function(){this.removed=!0;var e=this.parent;e&&!e.removed&&e.remove&&e.remove(this);for(var t=this.classes.length-1;t>=0;t--){var n=this.classes[t];n&&n.destroy&&n.destroy()}return this.classes.length=0,this.element.object=null,this.clearRenders(),this.clearTimers(),this.events.destroy(),Utils.nullObject(this)}},{key:"remove",value:function(e){e.element.parentNode.removeChild(e.element),this.classes.remove(e)}},{key:"create",value:function(t,n){var i=new e(t,n);return this.add(i),i}},{key:"clone",value:function(){return new e(this.element.cloneNode(!0))}},{key:"empty",value:function(){return this.element.innerHTML="",this}},{key:"text",value:function(e){return void 0===e?this.element.textContent:(this.element.textContent=e,this)}},{key:"html",value:function(e){return void 0===e?this.element.innerHTML:(this.element.innerHTML=e,this)}},{key:"hide",value:function(){return this.element.style.display="none",this}},{key:"show",value:function(){return this.element.style.display="",this}},{key:"visible",value:function(){return this.element.style.visibility="visible",this}},{key:"invisible",value:function(){return this.element.style.visibility="hidden",this}},{key:"setZ",value:function(e){return this.element.style.zIndex=e,this}},{key:"clearAlpha",value:function(){return this.element.style.opacity="",this}},{key:"size",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;return void 0!==e&&("string"==typeof e||"string"==typeof t?("string"!=typeof e&&(e+="px"),"string"!=typeof t&&(t+="px"),this.element.style.width=e,this.element.style.height=t):(this.element.style.width=e+"px",this.element.style.height=t+"px",this.element.style.backgroundSize=e+"px "+t+"px")),this.width=this.element.offsetWidth,this.height=this.element.offsetHeight,this}},{key:"mouseEnabled",value:function(e){return this.element.style.pointerEvents=e?"auto":"none",this}},{key:"fontStyle",value:function(e,t,n,i){return this.css({fontFamily:e,fontSize:t,color:n,fontStyle:i}),this}},{key:"bg",value:function(e,t,n,i){return e.includes(["data:","."])?this.element.style.backgroundImage="url("+e+")":this.element.style.backgroundColor=e,void 0!==t&&(t="number"==typeof t?t+"px":t,n="number"==typeof n?n+"px":n,this.element.style.backgroundPosition=t+" "+n),i&&(this.element.style.backgroundSize="",this.element.style.backgroundRepeat=i),"cover"!==t&&"contain"!==t||(this.element.style.backgroundSize=t,this.element.style.backgroundRepeat="no-repeat",this.element.style.backgroundPosition=void 0!==n?n+" "+i:"center"),this}},{key:"center",value:function(e,t,n){var i={};return void 0===e?(i.left="50%",i.top="50%",i.marginLeft=-this.width/2,i.marginTop=-this.height/2):(e&&(i.left="50%",i.marginLeft=-this.width/2),t&&(i.top="50%",i.marginTop=-this.height/2)),n&&(delete i.left,delete i.top),this.css(i),this}},{key:"mask",value:function(e){return this.element.style[Device.vendor("Mask")]=(~e.indexOf(".")?"url("+e+")":e)+" no-repeat",this.element.style[Device.vendor("MaskSize")]="contain",this}},{key:"blendMode",value:function(e,t){return this.element.style[t?"background-blend-mode":"mix-blend-mode"]=e,this}},{key:"css",value:function(e,t){if("object"!==(void 0===e?"undefined":_typeof(e))){if(t)return this.element.style[e]=t,this;var n=this.element.style[e];return"number"!=typeof n&&(~n.indexOf("px")&&(n=Number(n.slice(0,-2))),"opacity"===e&&(n=isNaN(Number(this.element.style.opacity))?1:Number(this.element.style.opacity))),n||0}for(var i in e){var r=e[i];"string"!=typeof r&&"number"!=typeof r||("string"!=typeof r&&"opacity"!==i&&"zIndex"!==i&&(r+="px"),this.element.style[i]=r)}return this}},{key:"transform",value:function(e){if(e)for(var t in e)"number"==typeof e[t]&&(this[t]=e[t]);else e=this;return this.element.style[Device.vendor("Transform")]=TweenManager.parseTransform(e),this}},{key:"willChange",value:function(e){var t="string"==typeof e;this.element.style["will-change"]=e?t?e:Device.transformProperty+", opacity":""}},{key:"backfaceVisibility",value:function(e){this.element.style[Device.vendor("BackfaceVisibility")]=e?"visible":"hidden"}},{key:"enable3D",value:function(e,t,n){return this.element.style[Device.vendor("TransformStyle")]="preserve-3d",e&&(this.element.style[Device.vendor("Perspective")]=e+"px"),void 0!==t&&(t="number"==typeof t?t+"px":t,n="number"==typeof n?n+"px":n,this.element.style[Device.vendor("PerspectiveOrigin")]=t+" "+n),this}},{key:"disable3D",value:function(){return this.element.style[Device.vendor("TransformStyle")]="",this.element.style[Device.vendor("Perspective")]="",this}},{key:"transformPoint",value:function(e,t,n){var i="";return void 0!==e&&(i+="number"==typeof e?e+"px ":e+" "),void 0!==t&&(i+="number"==typeof t?t+"px ":t+" "),void 0!==n&&(i+="number"==typeof n?n+"px":n),this.element.style[Device.vendor("TransformOrigin")]=i,this}},{key:"tween",value:function(e,t,n,i,r){"number"!=typeof i&&(r=i,i=0);var a=null;"undefined"!=typeof Promise&&(a=Promise.create(),r&&a.then(r),r=a.resolve);var s=new CSSTransition(this,e,t,n,i,r);return a||s}},{key:"clearTransform",value:function(){return"number"==typeof this.x&&(this.x=0),"number"==typeof this.y&&(this.y=0),"number"==typeof this.z&&(this.z=0),"number"==typeof this.scale&&(this.scale=1),"number"==typeof this.scaleX&&(this.scaleX=1),"number"==typeof this.scaleY&&(this.scaleY=1),"number"==typeof this.rotation&&(this.rotation=0),"number"==typeof this.rotationX&&(this.rotationX=0),"number"==typeof this.rotationY&&(this.rotationY=0),"number"==typeof this.rotationZ&&(this.rotationZ=0),"number"==typeof this.skewX&&(this.skewX=0),"number"==typeof this.skewY&&(this.skewY=0),this.element.style[Device.transformProperty]="",this}},{key:"clearTween",value:function(){return this.cssTween&&this.cssTween.stop(),this.mathTween&&this.mathTween.stop(),this}},{key:"attr",value:function(e,t){return void 0===t?this.element.getAttribute(e):(""===t?this.element.removeAttribute(e):this.element.setAttribute(e,t),this)}},{key:"convertTouchEvent",value:function(e){var t={x:0,y:0};return e?(e.touches||e.changedTouches?e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.changedTouches[0].pageX,t.y=e.changedTouches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t):t}},{key:"click",value:function(e){var t=this,n=function(n){if(!t.element)return!1;n.object="hit"===t.element.className?t.parent:t,n.action="click",e&&e(n)};return this.element.addEventListener("click",n,!0),this.element.style.cursor="pointer",this}},{key:"hover",value:function(e){var t=this,n=function(n){if(!t.element)return!1;n.object="hit"===t.element.className?t.parent:t,n.action="mouseout"===n.type?"out":"over",e&&e(n)};return this.element.addEventListener("mouseover",n,!0),this.element.addEventListener("mouseout",n,!0),this}},{key:"press",value:function(e){var t=this,n=function(n){if(!t.element)return!1;n.object="hit"===t.element.className?t.parent:t,n.action="mousedown"===n.type?"down":"up",e&&e(n)};return this.element.addEventListener("mousedown",n,!0),this.element.addEventListener("mouseup",n,!0),this}},{key:"bind",value:function(e,t){var n=this;"touchstart"!==e||Device.mobile?"touchmove"!==e||Device.mobile?"touchend"!==e||Device.mobile||(e="mouseup"):e="mousemove":e="mousedown",this.events["bind_"+e]||(this.events["bind_"+e]=[]);var i=this.events["bind_"+e];i.push({target:this.element,callback:t});var r=function(e){var t=n.convertTouchEvent(e);e instanceof MouseEvent||(e.x=t.x,e.y=t.y),i.forEach(function(t){t.target===e.currentTarget&&t.callback(e)})};return this.events["fn_"+e]||(this.events["fn_"+e]=r,this.element.addEventListener(e,r,!0)),this}},{key:"unbind",value:function(e,t){"touchstart"!==e||Device.mobile?"touchmove"!==e||Device.mobile?"touchend"!==e||Device.mobile||(e="mouseup"):e="mousemove":e="mousedown";var n=this.events["bind_"+e];return n?(n.forEach(function(e,i){e.callback===t&&n.splice(i,1)}),this.events["fn_"+e]&&!n.length&&(this.element.removeEventListener(e,this.events["fn_"+e],!0),this.events["fn_"+e]=null),this):this}},{key:"interact",value:function(e,t){return this.hit=this.create(".hit"),this.hit.css({position:"absolute",left:0,top:0,width:"100%",height:"100%",zIndex:99999}),Device.mobile?this.hit.touchClick(e,t):this.hit.hover(e).click(t),this}},{key:"touchClick",value:function(e,t){var n=this,i={},r=void 0,a=void 0,s=void 0,o=function(e){var t=n.convertTouchEvent(e);e.touchX=t.x,e.touchY=t.y,i.x=e.touchX,i.y=e.touchY};return this.element.addEventListener("touchmove",function(e){if(!n.element)return!1;var t,r,o,u;s=n.convertTouchEvent(e),t=i,o=(r=s).x-t.x,u=r.y-t.y,a=Math.sqrt(o*o+u*u)>5},{passive:!0}),this.element.addEventListener("touchstart",function(t){if(!n.element)return!1;r=performance.now(),t.object="hit"===n.element.className?n.parent:n,t.action="over",o(t),e&&!a&&e(t)},{passive:!0}),this.element.addEventListener("touchend",function(i){if(!n.element)return!1;var s=performance.now();i.object="hit"===n.element.className?n.parent:n,o(i),r&&s-r<750&&t&&!a&&(i.action="click",t(i)),e&&(i.action="out",e(i)),a=!1},{passive:!0}),this}},{key:"split",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t={position:"relative",display:"block",width:"auto",height:"auto",margin:0,padding:0,cssFloat:"left"},n=[],i=this.text().split(e);this.empty()," "===e&&(e="&nbsp;");for(var r=0;r<i.length;r++)" "===i[r]&&(i[r]="&nbsp;"),n.push(this.create(".t","span").html(i[r]).css(t)),""!==e&&r<i.length-1&&n.push(this.create(".t","span").html(e).css(t));return n}}]),e}(),Stage=new Interface("Stage");Stage.css({overflow:"hidden"}),window.addEventListener("load",function(){var e=void 0;function t(){Stage.size(),Stage.orientation=window.innerWidth>window.innerHeight?"landscape":"portrait"}window.addEventListener("focus",function(){"focus"!==e&&(e="focus",Events.emitter.fire(Events.VISIBILITY,{type:"focus"}))},!0),window.addEventListener("blur",function(){"blur"!==e&&(e="blur",Events.emitter.fire(Events.VISIBILITY,{type:"blur"}))},!0),window.addEventListener("keydown",function(e){return Events.emitter.fire(Events.KEYBOARD_DOWN,e)},!0),window.addEventListener("keyup",function(e){return Events.emitter.fire(Events.KEYBOARD_UP,e)},!0),window.addEventListener("keypress",function(e){return Events.emitter.fire(Events.KEYBOARD_PRESS,e)},!0),window.addEventListener("resize",function(){return Events.emitter.fire(Events.RESIZE)},!0),window.addEventListener("orientationchange",function(){return Events.emitter.fire(Events.RESIZE)},!0),Stage.events.add(Events.RESIZE,t),t()},!0);var Vector2=function(){function e(t,n){_classCallCheck(this,e),this.x="number"==typeof t?t:0,this.y="number"==typeof n?n:0,this.type="vector2"}return _createClass(e,[{key:"set",value:function(e,t){return this.x=e||0,this.y=t||0,this}},{key:"clear",value:function(){return this.x=0,this.y=0,this}},{key:"copyTo",value:function(e){return e.x=this.x,e.y=this.y,this}},{key:"copyFrom",value:function(e){return this.x=e.x||0,this.y=e.y||0,this}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y||1e-5}},{key:"length",value:function(){return Math.sqrt(this.lengthSq())}},{key:"normalize",value:function(){var e=this.length();return this.x/=e,this.y/=e,this}},{key:"setLength",value:function(e){return this.normalize().multiply(e),this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this}},{key:"multiply",value:function(e){return this.x*=e,this.y*=e,this}},{key:"divide",value:function(e){return this.x/=e,this.y/=e,this}},{key:"perpendicular",value:function(){var e=this.x,t=this.y;return this.x=-t,this.y=e,this}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}},{key:"deltaLerp",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=0;i<n;i++)this.lerp(e,t);return this}},{key:"interp",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;this.calc||(this.calc=new e),this.calc.subVectors(this,t);var a=Interpolation.convertEase(i)(Math.clamp(Math.range(this.calc.lengthSq(),0,r*r,1,0),0,1)*(n/10));return this.lerp(t,a)}},{key:"setAngleRadius",value:function(e,t){return this.x=Math.cos(e)*t,this.y=Math.sin(e)*t,this}},{key:"addAngleRadius",value:function(e,t){return this.x+=Math.cos(e)*t,this.y+=Math.sin(e)*t,this}},{key:"dot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return e.x*t.x+e.y*t.y}},{key:"clone",value:function(){return new e(this.x,this.y)}},{key:"distanceTo",value:function(e,t){var n=this.x-e.x,i=this.y-e.y;return t?n*n+i*i:Math.sqrt(n*n+i*i)}},{key:"solveAngle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return Math.atan2(e.y-t.y,e.x-t.x)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ";return this.x+e+this.y}}]),e}(),Interaction=function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Stage;if(_classCallCheck(this,e),!e.initialized){e.CLICK="interaction_click",e.START="interaction_start",e.MOVE="interaction_move",e.DRAG="interaction_drag",e.END="interaction_end";var i={touchstart:[],touchmove:[],touchend:[]},r=function(e){return i.touchend.forEach(function(t){return t(e)})};e.bind=function(e,t){return i[e].push(t)},e.unbind=function(e,t){return i[e].remove(t)},Stage.bind("touchstart",function(e){return i.touchstart.forEach(function(t){return t(e)})}),Stage.bind("touchmove",function(e){return i.touchmove.forEach(function(t){return t(e)})}),Stage.bind("touchend",r),Stage.bind("touchcancel",r),e.initialized=!0}var a=this;this.events=new Events,this.x=0,this.y=0,this.hold=new Vector2,this.last=new Vector2,this.delta=new Vector2,this.move=new Vector2,this.velocity=new Vector2;var s=void 0,o=void 0,u=void 0;function l(t){t.preventDefault(),a.isTouching=!0,a.x=t.x,a.y=t.y,a.hold.x=a.last.x=t.x,a.hold.y=a.last.y=t.y,a.delta.x=a.move.x=a.velocity.x=0,a.delta.y=a.move.y=a.velocity.y=0,s=0,a.events.fire(e.START,t,!0),o=u=Render.TIME}function c(t){a.isTouching&&(a.move.x=t.x-a.hold.x,a.move.y=t.y-a.hold.y),a.x=t.x,a.y=t.y,a.delta.x=t.x-a.last.x,a.delta.y=t.y-a.last.y,a.last.x=t.x,a.last.y=t.y,s+=a.delta.length();var n=Math.max(.001,Render.TIME-(u||Render.TIME));u=Render.TIME,a.velocity.x=Math.abs(a.delta.x)/n,a.velocity.y=Math.abs(a.delta.y)/n,a.events.fire(e.MOVE,t,!0),a.isTouching&&a.events.fire(e.DRAG,t,!0)}function h(t){a.isTouching&&(a.isTouching=!1,a.move.x=0,a.move.y=0,Math.max(.001,Render.TIME-(u||Render.TIME))>100&&(a.delta.x=0,a.delta.y=0),a.events.fire(e.END,t,!0),s<20&&Render.TIME-o<2e3&&a.events.fire(e.CLICK,t,!0))}!function(){n===Stage?e.bind("touchstart",l):n.bind("touchstart",l);e.bind("touchmove",c),e.bind("touchend",h)}(),this.destroy=function(){return e.unbind("touchstart",l),e.unbind("touchmove",c),e.unbind("touchend",h),n!==Stage&&n.unbind&&n.unbind("touchstart",l),t.events.destroy(),Utils.nullObject(t)}},Accelerometer=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this;this.x=0,this.y=0,this.z=0,this.alpha=0,this.beta=0,this.gamma=0,this.heading=0,this.rotationRate={},this.rotationRate.alpha=0,this.rotationRate.beta=0,this.rotationRate.gamma=0,this.toRadians="ios"===Device.os?Math.PI/180:1,window.addEventListener("devicemotion",function(t){switch(window.orientation){case 0:e.x=-t.accelerationIncludingGravity.x,e.y=t.accelerationIncludingGravity.y,e.z=t.accelerationIncludingGravity.z,t.rotationRate&&(e.rotationRate.alpha=t.rotationRate.beta*e.toRadians,e.rotationRate.beta=-t.rotationRate.alpha*e.toRadians,e.rotationRate.gamma=t.rotationRate.gamma*e.toRadians);break;case 180:e.x=t.accelerationIncludingGravity.x,e.y=-t.accelerationIncludingGravity.y,e.z=t.accelerationIncludingGravity.z,t.rotationRate&&(e.rotationRate.alpha=-t.rotationRate.beta*e.toRadians,e.rotationRate.beta=t.rotationRate.alpha*e.toRadians,e.rotationRate.gamma=t.rotationRate.gamma*e.toRadians);break;case 90:e.x=t.accelerationIncludingGravity.y,e.y=t.accelerationIncludingGravity.x,e.z=t.accelerationIncludingGravity.z,t.rotationRate&&(e.rotationRate.alpha=t.rotationRate.alpha*e.toRadians,e.rotationRate.beta=t.rotationRate.beta*e.toRadians,e.rotationRate.gamma=t.rotationRate.gamma*e.toRadians);break;case-90:e.x=-t.accelerationIncludingGravity.y,e.y=-t.accelerationIncludingGravity.x,e.z=t.accelerationIncludingGravity.z,t.rotationRate&&(e.rotationRate.alpha=-t.rotationRate.alpha*e.toRadians,e.rotationRate.beta=-t.rotationRate.beta*e.toRadians,e.rotationRate.gamma=t.rotationRate.gamma*e.toRadians)}},!0),window.addEventListener("deviceorientation",function(t){for(var n in t)~n.toLowerCase().indexOf("heading")&&(e.heading=t[n]);switch(window.orientation){case 0:e.alpha=t.beta*e.toRadians,e.beta=-t.alpha*e.toRadians,e.gamma=t.gamma*e.toRadians;break;case 180:e.alpha=-t.beta*e.toRadians,e.beta=t.alpha*e.toRadians,e.gamma=t.gamma*e.toRadians;break;case 90:e.alpha=t.alpha*e.toRadians,e.beta=t.beta*e.toRadians,e.gamma=t.gamma*e.toRadians;break;case-90:e.alpha=-t.alpha*e.toRadians,e.beta=-t.beta*e.toRadians,e.gamma=t.gamma*e.toRadians}e.tilt=t.beta*e.toRadians,e.yaw=t.alpha*e.toRadians,e.roll=-t.gamma*e.toRadians,"Android"===Device.os&&(e.heading=function(e,t,n){var i=Math.PI/180,r=t?t*i:0,a=n?n*i:0,s=e?e*i:0,o=Math.cos(a),u=Math.cos(s),l=Math.sin(r),c=Math.sin(a),h=Math.sin(s),f=-u*c-h*l*o,d=-h*c+u*l*o,v=Math.atan(f/d);d<0?v+=Math.PI:f<0&&(v+=2*Math.PI);return v*(180/Math.PI)}(t.alpha,t.beta,t.gamma))},!0)}}]),e}(),Mouse=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this;function t(t){e.x=t.x,e.y=t.y,e.normal.x=t.x/Stage.width,e.normal.y=t.y/Stage.height,e.tilt.x=2*e.normal.x-1,e.tilt.y=1-2*e.normal.y,e.inverseNormal.x=e.normal.x,e.inverseNormal.y=1-e.normal.y}this.x=0,this.y=0,this.normal={x:0,y:0},this.tilt={x:0,y:0},this.inverseNormal={x:0,y:0},this.input=new Interaction,Stage.events.add(this.input,Interaction.START,t),Stage.events.add(this.input,Interaction.MOVE,t),t({x:Stage.width/2,y:Stage.height/2})}}]),e}(),Assets=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this;this.CDN="",this.CORS=null;var t={};this.createImage=function(n,i,r){"boolean"!=typeof i&&(r=i,i=void 0);var a=new Image;return a.crossOrigin=e.CORS,a.src=n,a.onload=r,a.onerror=r,i&&(t[n]=a),a},this.getImage=function(e){return t[e]}}},{key:"loadImage",value:function(e){"string"==typeof e&&(e=this.createImage(e));var t=Promise.create();return e.onload=t.resolve,e.onerror=t.resolve,t}}]),e}();Assets.init();var AssetLoader=function(e){function t(e,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));Array.isArray(e)&&(e=e.map(function(e){return Utils.basename(e)}).reduce(function(t,n,i){return t[n]=e[i],t},{}));var r=i;i.events=new Events;var a=Object.keys(e).length,s=0;for(var o in e)u(o,Assets.CDN+e[o]);function u(e,t){var n=Utils.extension(t);if(!n.includes(["jpg","jpeg","png","gif","svg"]))return n.includes(["mp3","m4a","ogg","wav","aif"])?window.AudioContext&&window.WebAudio?void window.WebAudio.createSound(e,t,l):l():void window.get(t).then(function(e){"js"===n&&window.eval(e.replace("use strict","")),l()}).catch(function(){l()});Assets.createImage(t,l)}function l(){r.percent=++s/a,r.events.fire(Events.PROGRESS,{percent:r.percent},!0),s===a&&(r.events.fire(Events.COMPLETE,null,!0),n&&n())}return i}return _inherits(t,Component),_createClass(t,null,[{key:"loadAssets",value:function(e,n){var i=Promise.create();return n||(n=i.resolve),i.loader=new t(e,n),i}}]),t}(),MultiLoader=function(e){function t(){_classCallCheck(this,t);var e=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),n=e;e.events=new Events;var i=[],r=0;function a(){for(var e=0,t=0;t<i.length;t++)e+=i[t].percent||0;e/=i.length,n.events.fire(Events.PROGRESS,{percent:e},!0)}function s(){++r===i.length&&n.events.fire(Events.COMPLETE,null,!0)}return e.push=function(t){i.push(t),e.events.add(t,Events.PROGRESS,a),e.events.add(t,Events.COMPLETE,s)},e.complete=function(){e.events.fire(Events.PROGRESS,{percent:1},!0),e.events.fire(Events.COMPLETE,null,!0)},e}return _inherits(t,Component),t}(),FontLoader=function(e){function t(e,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i;i.events=new Events;var a,s=void 0;return function(){Array.isArray(e)||(e=[e]);s=Stage.create("FontLoader");for(var t=0;t<e.length;t++)s.create("font").fontStyle(e[t],12,"#000").text("LOAD").css({top:-999})}(),a=function(){s.destroy(),r.percent=1,r.events.fire(Events.PROGRESS,{percent:r.percent},!0),r.events.fire(Events.COMPLETE,null,!0),n&&n()},document.fonts&&document.fonts.ready?document.fonts.ready.then(a):r.delayedCall(a,500),i}return _inherits(t,Component),_createClass(t,null,[{key:"loadFonts",value:function(e,n){var i=Promise.create();return n||(n=i.resolve),i.loader=new t(e,n),i}}]),t}(),StateDispatcher=function e(t){var n=this;_classCallCheck(this,e);var i=this;this.events=new Events,this.locked=!1;var r=void 0,a=void 0,s="/";function o(){return t?location.hash.slice(3):"/"!==s?location.pathname.split(s)[1]:location.pathname.slice(1)||""}function u(e,n){n!==r&&(i.locked?r&&(t?location.hash="!/"+r:history.pushState(a,null,s+r)):(r=n,a=e,i.events.fire(Events.UPDATE,{value:e,path:n},!0)))}t?window.addEventListener("hashchange",function(){return u(null,o())},!0):window.addEventListener("popstate",function(e){return u(e.state,o())},!0),r=o(),this.getState=function(){var e=o();return{value:a,path:e}},this.setState=function(e,n){"object"!==(void 0===e?"undefined":_typeof(e))&&(n=e,e=null),n!==r&&(r=n,a=e,t?location.hash="!/"+n:history.pushState(e,null,s+n))},this.replaceState=function(e,n){"object"!==(void 0===e?"undefined":_typeof(e))&&(n=e,e=null),n!==r&&(r=n,a=e,t?history.replaceState(null,null,"#!/"+n):history.replaceState(e,null,s+n))},this.setTitle=function(e){return document.title=e},this.lock=function(){return n.locked=!0},this.unlock=function(){return n.locked=!1},this.forceHash=function(){return t=!0},this.setPathRoot=function(e){s="/"===e.charAt(0)?e:"/"+e}},Storage=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"set",value:function(e,t){null!==t&&"object"===(void 0===t?"undefined":_typeof(t))&&(t=JSON.stringify(t)),null===t?window.localStorage.removeItem(e):window.localStorage[e]=t}},{key:"get",value:function(e){var t=window.localStorage[e];if(t){var n=void 0;t.charAt&&(n=t.charAt(0)),"{"!==n&&"["!==n||(t=JSON.parse(t)),"true"!==t&&"false"!==t||(t="true"===t)}return t}}]),e}();window.AudioContext||(window.AudioContext=window.webkitAudioContext||window.mozAudioContext||window.oAudioContext);var WebAudio=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"init",value:function(){var e=this,t=this,n={},i=void 0;window.AudioContext&&(i=new AudioContext),i&&(this.globalGain=i.createGain(),this.globalGain.connect(i.destination),this.globalGain.value=this.globalGain.gain.defaultValue,this.gain={set value(e){t.globalGain.value=e,t.globalGain.gain.setTargetAtTime(e,i.currentTime,.01)},get value(){return t.globalGain.value}},this.loadSound=function(t,n){var r=Promise.create();n&&r.then(n),n=r.resolve;var a=e.getSound(t);window.fetch(a.asset).then(function(e){if(!e.ok)return n();e.arrayBuffer().then(function(e){i.decodeAudioData(e,function(e){a.buffer=e,a.complete=!0,n()})})}).catch(function(){n()}),a.ready=function(){return r}},this.createSound=function(t,r,a){var s={};s.asset=r,s.audioGain=i.createGain(),s.audioGain.connect(e.globalGain),s.audioGain.value=s.audioGain.gain.defaultValue,s.gain={set value(e){s.audioGain.value=e,s.audioGain.gain.setTargetAtTime(e,i.currentTime,.01)},get value(){return s.audioGain.value}},n[t]=s,"ios"===Device.os?a():e.loadSound(t,a)},this.getSound=function(e){return n[e]},this.trigger=function(t){if(i){"suspended"===i.state&&i.resume();var n=e.getSound(t);n.ready||e.loadSound(t),n.ready().then(function(){if(n.complete){var e=i.createBufferSource();e.buffer=n.buffer,e.connect(n.audioGain),n.audioGain.gain.setValueAtTime(n.audioGain.value,i.currentTime),e.loop=!!n.loop,e.start(0)}})}},this.mute=function(){i&&TweenManager.tween(e.gain,{value:0},300,"easeOutSine")},this.unmute=function(){i&&TweenManager.tween(e.gain,{value:1},500,"easeOutSine")},window.WebAudio=this)}}]),e}(),CanvasValues=function(){function e(t){_classCallCheck(this,e),this.styles={},t?this.styled=!1:this.data=new Float32Array(6)}return _createClass(e,[{key:"setTRSA",value:function(e,t,n,i,r,a){var s=this.data;s[0]=e,s[1]=t,s[2]=n,s[3]=i,s[4]=r,s[5]=a}},{key:"calculate",value:function(e){var t=e.data,n=this.data;n[0]=n[0]+t[0],n[1]=n[1]+t[1],n[2]=n[2]+t[2],n[3]=n[3]*t[3],n[4]=n[4]*t[4],n[5]=n[5]*t[5]}},{key:"calculateStyle",value:function(e){if(!e.styled)return!1;this.styled=!0;var t=e.values;for(var n in t)this.styles[n]||(this.styles[n]=t[n])}},{key:"shadowOffsetX",set:function(e){this.styled=!0,this.styles.shadowOffsetX=e},get:function(){return this.styles.shadowOffsetX}},{key:"shadowOffsetY",set:function(e){this.styled=!0,this.styles.shadowOffsetY=e},get:function(){return this.styles.shadowOffsetY}},{key:"shadowBlur",set:function(e){this.styled=!0,this.styles.shadowBlur=e},get:function(){return this.styles.shadowBlur}},{key:"shadowColor",set:function(e){this.styled=!0,this.styles.shadowColor=e},get:function(){return this.styles.shadowColor}},{key:"values",get:function(){return this.styles}}]),e}(),CanvasObject=function(){function e(){_classCallCheck(this,e),this.visible=!0,this.blendMode="source-over",this.x=0,this.y=0,this.px=0,this.py=0,this.clipX=0,this.clipY=0,this.clipWidth=0,this.clipHeight=0,this.width=0,this.height=0,this.rotation=0,this.scale=1,this.opacity=1,this.values=new CanvasValues,this.styles=new CanvasValues(!0),this.children=[]}return _createClass(e,[{key:"updateValues",value:function(){this.values.setTRSA(this.x,this.y,Math.radians(this.rotation),this.scaleX||this.scale,this.scaleY||this.scale,this.opacity),this.parent.values&&this.values.calculate(this.parent.values),this.parent.styles&&this.styles.calculateStyle(this.parent.styles)}},{key:"render",value:function(e){if(!this.visible)return!1;this.updateValues(),this.draw&&this.draw(e);for(var t=0;t<this.children.length;t++)this.children[t].render(e)}},{key:"startDraw",value:function(e,t,n){var i=this.canvas.context,r=this.values.data,a=r[0]+(e||0),s=r[1]+(t||0);if(i.save(),n||(i.globalCompositeOperation=this.blendMode),i.translate(a,s),i.rotate(r[2]),i.scale(r[3],r[4]),i.globalAlpha=r[5],this.styles.styled){var o=this.styles.values;for(var u in o)i[u]=o[u]}}},{key:"endDraw",value:function(){this.canvas.context.restore()}},{key:"add",value:function(e){e.setCanvas(this.canvas),e.parent=this,this.children.push(e),e.z=this.children.length}},{key:"setCanvas",value:function(e){this.canvas=e;for(var t=0;t<this.children.length;t++)this.children[t].setCanvas(e)}},{key:"remove",value:function(e){e.canvas=null,e.parent=null,this.children.remove(e)}},{key:"isMask",value:function(){for(var e=this;e;){if(e.masked)return!0;e=e.parent}return!1}},{key:"unmask",value:function(){this.masked.mask(null),this.masked=null}},{key:"setZ",value:function(e){this.z=e,this.parent.children.sort(function(e,t){return e.z-t.z})}},{key:"follow",value:function(e){return this.x=e.x,this.y=e.y,this.px=e.px,this.py=e.py,this.clipX=e.clipX,this.clipY=e.clipY,this.clipWidth=e.clipWidth,this.clipHeight=e.clipHeight,this.width=e.width,this.height=e.height,this.rotation=e.rotation,this.scale=e.scale,this.scaleX=e.scaleX||e.scale,this.scaleY=e.scaleY||e.scale,this}},{key:"visible",value:function(){return this.visible=!0,this}},{key:"invisible",value:function(){return this.visible=!1,this}},{key:"transform",value:function(e){for(var t in e)"number"==typeof e[t]&&(this[t]=e[t]);return this}},{key:"transformPoint",value:function(e,t){return this.px="number"==typeof e?e:this.width*(parseFloat(e)/100),this.py="number"==typeof t?t:this.height*(parseFloat(t)/100),this}},{key:"clip",value:function(e,t,n,i){return this.clipX=e,this.clipY=t,this.clipWidth=n,this.clipHeight=i,this}},{key:"destroy",value:function(){for(var e=this.children.length-1;e>=0;e--)this.children[e].destroy();return Utils.nullObject(this)}}]),e}(),CanvasGraphics=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e;_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i;i.width=e,i.height=n,i.props={};var a=[],s=void 0;return i.draw=function(e){if(i.isMask()&&!e)return!1;var t=i.canvas.context;i.startDraw(i.px,i.py,e),function(e){for(var t in r.props)e[t]=r.props[t]}(t),i.clipWidth&&i.clipHeight&&(t.beginPath(),t.rect(i.clipX,i.clipY,i.clipWidth,i.clipHeight),t.clip());for(var n=0;n<a.length;n++){var o=a[n];if(o){var u=o.shift();t[u].apply(t,o),o.unshift(u)}}i.endDraw(),s&&(t.globalCompositeOperation=s.blendMode,s.render(!0))},i.clear=function(){for(var e=a.length-1;e>=0;e--)a[e].length=0;a.length=0},i.arc=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.radius||i.width/2,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];e&&!t&&(n=e,e=0,t=0),n-=90,s-=90,a.push(["beginPath"]),a.push(["arc",e,t,r,Math.radians(s),Math.radians(n),o])},i.quadraticCurveTo=function(e,t,n,i){a.push(["quadraticCurveTo",e,t,n,i])},i.bezierCurveTo=function(e,t,n,i,r,s){a.push(["bezierCurveTo",e,t,n,i,r,s])},i.fillRect=function(e,t,n,i){a.push(["fillRect",e,t,n,i])},i.clearRect=function(e,t,n,i){a.push(["clearRect",e,t,n,i])},i.strokeRect=function(e,t,n,i){a.push(["strokeRect",e,t,n,i])},i.moveTo=function(e,t){a.push(["moveTo",e,t])},i.lineTo=function(e,t){a.push(["lineTo",e,t])},i.stroke=function(){a.push(["stroke"])},i.fill=function(){s||a.push(["fill"])},i.beginPath=function(){a.push(["beginPath"])},i.closePath=function(){a.push(["closePath"])},i.fillText=function(e,t,n){a.push(["fillText",e,t,n])},i.strokeText=function(e,t,n){a.push(["strokeText",e,t,n])},i.setLineDash=function(e){a.push(["setLineDash",e])},i.drawImage=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:e.width,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.height,o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,u=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,l=arguments.length>7&&void 0!==arguments[7]?arguments[7]:e.width,c=arguments.length>8&&void 0!==arguments[8]?arguments[8]:e.height;a.push(["drawImage",e,t,n,r,s,o+-i.px,u+-i.py,l,c])},i.mask=function(e){if(!e)return s=null;s=e,e.masked=i;for(var t=0;t<a.length;t++)"fill"!==a[t][0]&&"stroke"!==a[t][0]||(a[t].length=0,a.splice(t,1))},i.clone=function(){var e=new t(i.width,i.height);return e.visible=i.visible,e.blendMode=i.blendMode,e.opacity=i.opacity,e.follow(i),e.props=Utils.cloneObject(i.props),e.setDraw(Utils.cloneArray(a)),e},i.setDraw=function(e){a=e},i}return _inherits(t,CanvasObject),_createClass(t,[{key:"strokeStyle",set:function(e){this.props.strokeStyle=e},get:function(){return this.props.strokeStyle}},{key:"fillStyle",set:function(e){this.props.fillStyle=e},get:function(){return this.props.fillStyle}},{key:"lineWidth",set:function(e){this.props.lineWidth=e},get:function(){return this.props.lineWidth}},{key:"lineCap",set:function(e){this.props.lineCap=e},get:function(){return this.props.lineCap}},{key:"lineDashOffset",set:function(e){this.props.lineDashOffset=e},get:function(){return this.props.lineDashOffset}},{key:"lineJoin",set:function(e){this.props.lineJoin=e},get:function(){return this.props.lineJoin}},{key:"miterLimit",set:function(e){this.props.miterLimit=e},get:function(){return this.props.miterLimit}},{key:"font",set:function(e){this.props.font=e},get:function(){return this.props.font}},{key:"textAlign",set:function(e){this.props.textAlign=e},get:function(){return this.props.textAlign}},{key:"textBaseline",set:function(e){this.props.textBaseline=e},get:function(){return this.props.textBaseline}}]),t}(),Canvas=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this,r=arguments[2],a=arguments[3];_classCallCheck(this,e);var s=this;function o(e,t,n){var i=n?2:1;if(s.element.width=e*i,s.element.height=t*i,s.width=e,s.height=t,s.scale=i,s.object.size(s.width,s.height),s.context.scale(i,i),s.element.style.width=e+"px",s.element.style.height=t+"px",a){var r=new CanvasGraphics(s.width,s.height);r.fillStyle="rgba(255, 255, 255, 0.002)",r.fillRect(0,0,s.width,s.height),r.setCanvas(s),r.parent=s,s.children[0]=r,r.z=1}}this.element=document.createElement("canvas"),this.context=this.element.getContext("2d"),this.object=new Interface(this.element),this.children=[],this.retina=r,o(t,n,r),this.size=o,this.toDataURL=function(e,t){return i.element.toDataURL(e,t)},this.render=function(e){"boolean"==typeof e&&e||i.clear();for(var t=0;t<i.children.length;t++)i.children[t].render()},this.clear=function(){i.context.clearRect(0,0,i.element.width,i.element.height)},this.add=function(e){e.setCanvas(i),e.parent=i,i.children.push(e),e.z=i.children.length},this.remove=function(e){e.canvas=null,e.parent=null,i.children.remove(e)},this.destroy=function(){for(var e=i.children.length-1;e>=0;e--)i.children[e].destroy();return i.object.destroy(),Utils.nullObject(i)},this.getImageData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:i.element.width,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:i.element.height;return i.imageData=i.context.getImageData(e,t,n,r),i.imageData},this.getPixel=function(e,t,n){i.imageData&&!n||i.getImageData();var r={},a=4*(e+t*i.element.width),s=i.imageData.data;return r.r=s[a],r.g=s[a+1],r.b=s[a+2],r.a=s[a+3],r},this.putImageData=function(e){i.context.putImageData(e,0,0)}},CanvasFont=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"createText",value:function(e,t,n,i,r,a,s){var o=s.textBaseline,u=void 0===o?"alphabetic":o,l=s.lineHeight,c=void 0===l?n:l,h=s.letterSpacing,f=void 0===h?0:h,d=s.textAlign,v=void 0===d?"start":d,m=e.context;if(n===c)return R(e,t,n,i,r,a,u,f,v);var p=new CanvasGraphics(t,n),y=i.split(" "),g=[],b="";p.totalWidth=0,p.totalHeight=0,m.font=r;for(var w=0;w<y.length;w++){for(var k=b+y[w]+" ",x=k.split(""),E=0,C=0;C<x.length;C++)E+=m.measureText(x[C]).width+f;E>t&&w>0?(g.push(b),b=y[w]+" "):b=k}return g.push(b),g.forEach(function(n,i){var s=R(e,t,c,n.slice(0,-1),r,a,u,f,v);s.y=i*c,p.add(s),p.totalWidth=Math.max(s.totalWidth,p.totalWidth),p.totalHeight+=c}),p;function R(e,t,n,i,r,a,s,o,u){var l=e.context,c=new CanvasGraphics(t,n);c.font=r,c.fillStyle=a,c.textBaseline=s,c.totalWidth=0,c.totalHeight=n;var h=i.split(""),f=void 0,d=0,v=0;l.font=r;for(var m=0;m<h.length;m++)c.totalWidth+=l.measureText(h[m]).width+o;switch(u){case"start":case"left":v=0;break;case"end":case"right":v=t-c.totalWidth;break;case"center":v=(t-c.totalWidth)/2}do{f=h[d++],c.fillText(f,v,0),v+=l.measureText(f).width+o}while(d<i.length);return c}}}]),e}(),Video=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;n.loaded={start:0,end:0,percent:0};var r={},a=void 0,s=void 0,o=void 0,u=void 0,l=0;function c(){if(!i.element)return i.stopRender(c);i.duration=i.element.duration,i.time=i.element.currentTime,i.element.currentTime===a?++l>30&&!s&&(s=!0,i.events.fire(Events.ERROR,null,!0)):(l=0,s&&(i.events.fire(Events.READY,null,!0),s=!1)),a=i.element.currentTime,i.element.currentTime>=(i.duration||i.element.duration)-.001&&(i.loop||(u||i.stopRender(c),i.events.fire(Events.COMPLETE,null,!0))),r.time=i.element.currentTime,r.duration=i.element.duration,r.loaded=i.loaded,i.events.fire(Events.UPDATE,r,!0)}function h(){if(!i.element)return!1;if(o){var e=i.element.seekable,t=-1;if(e){for(var n=0;n<e.length;n++)e.start(n)<o&&(t=e.end(n)-.5);t>=o&&(i.buffered=!0)}else i.buffered=!0}else i.buffered=i.element.readyState===i.element.HAVE_ENOUGH_DATA;i.buffered&&(i.stopRender(h),i.events.fire(Events.READY,null,!0))}function f(){if(i.ready()){for(var e=i.element.buffered,t=i.element.currentTime,n=0;!(e.start(n)<=t&&t<=e.end(n));)n+=1;i.loaded.start=e.start(n)/i.element.duration,i.loaded.end=e.end(n)/i.element.duration,i.loaded.percent=i.loaded.end-i.loaded.start,i.events.fire(Events.PROGRESS,i.loaded,!0)}}return function(){var t=e.src;t&&(t=Assets.CDN+t);i.element=document.createElement("video"),t&&(i.element.src=t);i.element.controls=e.controls,i.element.id=e.id||"",i.element.width=e.width,i.element.height=e.height,i.element.loop=e.loop,i.object=new Interface(i.element),i.width=e.width,i.height=e.height,i.object.size(i.width,i.height),Device.mobile&&(i.object.attr("webkit-playsinline",!0),i.object.attr("playsinline",!0))}(),!1!==e.preload&&(i.element.preload="auto",i.element.load()),n.play=function(){n.playing=!0,n.element.play(),n.startRender(c)},n.pause=function(){n.playing=!1,n.element.pause(),n.stopRender(c)},n.stop=function(){n.playing=!1,n.element.pause(),n.stopRender(c),n.ready()&&(n.element.currentTime=0)},n.volume=function(e){n.element.volume=e,n.muted&&(n.muted=!1,n.object.attr("muted",""))},n.mute=function(){n.volume(0),n.muted=!0,n.object.attr("muted",!0)},n.seek=function(e){n.element.readyState<=1?n.delayedCall(function(){n.seek&&n.seek(e)},32):n.element.currentTime=e},n.canPlayTo=function(e){return o=null,e&&(o=e),n.buffered||n.startRender(h),n.buffered},n.ready=function(){return n.element.readyState>n.element.HAVE_CURRENT_DATA},n.size=function(e,t){n.element.width=n.width=e,n.element.height=n.height=t,n.object.size(n.width,n.height)},n.forceRender=function(){u=!0,n.startRender(c)},n.trackProgress=function(){n.element.addEventListener("progress",f,!0)},n.destroy=function(){return n.stop(),n.element.src="",n.object.destroy(),_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",n).call(n)},n}return _inherits(t,Component),_createClass(t,[{key:"loop",set:function(e){this.element.loop=e},get:function(){return this.element.loop}},{key:"src",set:function(e){this.element.src=Assets.CDN+e},get:function(){return this.element.src}}]),t}(),SVG=function e(t,n,i){var r=this;_classCallCheck(this,e);var a=this,s=void 0;function o(){s=new Interface(t,"svg",n),"circle"===n?["cx","cy","r"].forEach(function(e){i.stroke&&"r"===e?s.element.setAttributeNS(null,e,i.width/2-i.stroke):s.element.setAttributeNS(null,e,i.width/2)}):"radialGradient"===n&&(["cx","cy","r","fx","fy","name"].forEach(function(e){s.element.setAttributeNS(null,"name"===e?"id":e,i[e])}),s.element.setAttributeNS(null,"gradientUnits","userSpaceOnUse")),a.object=s}function u(){o(),i.colors.forEach(function(e){var t,n;s.element.appendChild((t=e,n=document.createElementNS("http://www.w3.org/2000/svg","stop"),["offset","style"].forEach(function(e){n.setAttributeNS(null,e,"style"===e?"stop-color:"+t[e]:t[e])}),n))})}!function(){switch(n){case"svg":!function(){(s=new Interface(t,"svg")).element.setAttribute("preserveAspectRatio","xMinYMid meet"),s.element.setAttribute("version","1.1"),s.element.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.width&&(s.element.setAttribute("viewBox","0 0 "+i.width+" "+i.height),s.element.style.width=i.width+"px",s.element.style.height=i.height+"px");a.object=s}();break;case"radialGradient":case"linearGradient":u();break;default:o()}}(),this.addTo=function(e){e.points?e=e.points:e.element?e=e.element:e.object&&(e=e.object.element),e.appendChild(s.element)},this.destroy=function(){return r.object.destroy(),Utils.nullObject(r)}},Scroll=function(e){function t(e,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));e&&e.element||(n=e,e=null),n||(n={});var r=i;i.x=0,i.y=0,i.max={x:0,y:0},i.delta={x:0,y:0},i.enabled=!0;var a={x:0,y:0},s=["x","y"];function o(){TweenManager.clearTween(a)}function u(e){r.enabled&&(e.preventDefault(),o(),s.forEach(function(t){r.max[t]&&(a[t]+=e["delta"+t.toUpperCase()])}))}function l(){r.enabled&&o()}function c(){r.enabled&&s.forEach(function(e){r.max[e]&&(a[e]-=Mouse.input.delta[e])})}function h(){if(r.enabled){var e="android"===Device.os?35:25,t={};s.forEach(function(n){r.max[n]&&(t[n]=a[n]-Mouse.input.delta[n]*e)}),TweenManager.tween(a,t,2500,"easeOutQuint")}}function f(){if(r.enabled&&(o(),r.object)){var e={};Device.mobile&&s.forEach(function(t){return e[t]=r.max[t]?a[t]/r.max[t]:0}),void 0===n.height&&(r.max.y=r.object.element.scrollHeight-r.object.element.clientHeight),void 0===n.width&&(r.max.x=r.object.element.scrollWidth-r.object.element.clientWidth),Device.mobile&&s.forEach(function(t){return r[t]=a[t]=e[t]*r.max[t]})}}return function(){r.object=e,r.hitObject=n.hitObject||r.object,r.max.y=n.height||0,r.max.x=n.width||0,Array.isArray(n.axes)&&(s=n.axes);r.object&&r.object.css({overflow:"auto"})}(),function(){Stage.bind("wheel",u),r.hitObject&&r.hitObject.bind("touchstart",function(e){return e.preventDefault()});var e=r.hitObject?new Interaction(r.hitObject):Mouse.input;r.events.add(e,Interaction.START,l),r.events.add(e,Interaction.DRAG,c),r.events.add(e,Interaction.END,h),r.events.add(Events.RESIZE,f),f()}(),i.startRender(function(){s.forEach(function(e){r.max[e]&&(a[e]=Math.clamp(a[e],0,r.max[e]),r.delta[e]=a[e]-r[e],r[e]+=r.delta[e],r.object&&("x"===e&&(r.object.element.scrollLeft=r.x),"y"===e&&(r.object.element.scrollTop=r.y)))})}),i.destroy=function(){return Stage.unbind("wheel",u),_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",i).call(i)},i}return _inherits(t,Component),t}(),Slide=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=n;n.x=0,n.y=0,n.max={x:0,y:0},n.delta={x:0,y:0},n.direction={x:0,y:0},n.position=0,n.progress=0,n.floor=0,n.ceil=0,n.index=0,n.enabled=!0;var r={x:0,y:0},a={x:0,y:0},s=Interpolation.convertEase("easeOutSine"),o={},u=["x","y"],l=void 0;function c(){i.isInertia=!1,TweenManager.clearTween(r)}function h(e){i.enabled&&(e.preventDefault&&e.preventDefault(),c(),u.forEach(function(t){i.max[t]&&(r[t]+=e["delta"+t.toUpperCase()])}))}function f(){i.enabled&&c()}function d(){i.enabled&&u.forEach(function(e){i.max[e]&&(r[e]+=4*-Mouse.input.delta[e],a[e]=4*-Mouse.input.delta[e],i.isInertia=!0)})}function v(e){i.enabled&&(40===e.keyCode&&i.next(),39===e.keyCode&&i.next(),38===e.keyCode&&i.prev(),37===e.keyCode&&i.prev())}function m(){i.enabled&&c()}return function(){i.num=e.num||0,e.max&&(i.max=e.max);e.index&&(i.index=e.index,i.x=r.x=i.index*i.max.x,i.y=r.y=i.index*i.max.y);e.axes&&(u=e.axes)}(),Stage.bind("wheel",h),i.events.add(Mouse.input,Interaction.START,f),i.events.add(Mouse.input,Interaction.DRAG,d),i.events.add(Events.KEYBOARD_DOWN,v),i.events.add(Events.RESIZE,m),m(),n.startRender(function(){u.forEach(function(e){if(i.max[e]){var t=i[e]/i.max[e],n=Math.round(t);if(r[e]!==n*i.max[e]){0!==a[e]&&(a[e]*=.9,Math.abs(a[e])<.001&&(a[e]=0),r[e]+=a[e]);var o=.035*i.max[e];r[e]+=s(Math.round(i.progress)-i.progress)*o,Math.abs(r[e]-i[e])>o?r[e]-=.5*(r[e]-i[e]):Math.abs(r[e]-i[e])<.001&&(r[e]=n*i.max[e]),i.delta[e]=r[e]-i[e],i.delta[e]=i.delta[e]<0?Math.max(i.delta[e],-o):Math.min(i.delta[e],o),i[e]+=i.delta[e]}}}),i.position=(i.x+i.y)/(i.max.x+i.max.y)%i.num+i.num,i.progress=i.position%1,i.floor=Math.floor(i.position)%i.num,i.ceil=Math.ceil(i.position)%i.num,i.index=Math.round(i.position)%i.num,l!==i.index&&(l=i.index,i.direction.x=i.delta.x<0?-1:1,i.direction.y=i.delta.y<0?-1:1,o.index=i.index,o.direction=i.direction,i.events.fire(Events.UPDATE,o,!0))}),n.goto=function(e){var t={};t.x=e*n.max.x,t.y=e*n.max.y,TweenManager.tween(r,t,2500,"easeOutQuint")},n.next=function(){var e=(n.x+n.y)/(n.max.x+n.max.y),t=Math.round(e);n.goto(t+1)},n.prev=function(){var e=(n.x+n.y)/(n.max.x+n.max.y),t=Math.round(e);n.goto(t-1)},n.destroy=function(){return Stage.unbind("wheel",h),_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",n).call(n)},n}return _inherits(t,Component),t}(),SlideVideo=function(e){function t(e,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));t.initialized||(t.test=t.test||!Device.mobile&&"safari"!==Device.browser&&!Device.detect("trident"),t.initialized=!0);var r=i;if(i.events=new Events,i.img=e.img,i.img&&(i.img=Assets.CDN+i.img),i.src=e.src,i.src&&(i.src=Assets.CDN+i.src),i.src&&t.test)window.fetch(i.src).then(function(e){if(!e.ok)return s();e.blob().then(function(e){i.element=document.createElement("video"),i.element.src=URL.createObjectURL(e),i.element.muted=!0,i.element.loop=!0,r.element.addEventListener("playing",o,!0),r.element.addEventListener("pause",u,!0),r.willPlay&&r.play(),n&&n()})}).catch(function(){s(),n&&n()});else{var a=Assets.createImage(i.img);a.onload=function(){i.element=a,n&&n()},a.onerror=s}function s(){r.events.fire(Events.ERROR,null,!0)}function o(){r.playing=!0,r.events.fire(Events.READY,null,!0)}function u(){r.playing=!1}return i.resume=function(){i.play(!0)},i.play=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];i.willPlay=!0,i.element&&i.element.paused&&!i.playing&&(e||(i.element.currentTime=0),i.element.play())},i.pause=function(){i.willPlay=!1,i.element&&!i.element.paused&&i.playing&&i.element.pause()},i.ready=function(){return i.element.readyState>i.element.HAVE_CURRENT_DATA},i.destroy=function(){return i.pause(),i.element.src="",_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",i).call(i)},i}return _inherits(t,Component),t}(),SlideLoader=function(e){function t(e,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i;i.events=new Events,i.list=[],i.pathList=[];var a=0;function s(){r.percent=++a/r.list.length,r.events.fire(Events.PROGRESS,{percent:r.percent},!0),a===r.list.length&&(r.events.fire(Events.COMPLETE,null,!0),n&&n())}return e.forEach(function(e){i.list.push(i.initClass(SlideVideo,e,s)),i.pathList.push(e.path)}),i}return _inherits(t,Component),_createClass(t,null,[{key:"loadSlides",value:function(e,n){var i=Promise.create();return n||(n=i.resolve),i.loader=new t(e,n),i}}]),t}(),LinkedList=function e(){var t=this;_classCallCheck(this,e),this.first=null,this.last=null,this.current=null,this.prev=null;var n=[];this.push=function(e){var i=function(e){return n[n.push({object:e,prev:null,next:null})-1]}(e);t.first?(i.next=t.first,i.prev=t.last,t.last.next=i,t.last=i):i.next=i.prev=t.last=t.first=i},this.remove=function(e){var i=function(e){for(var t=0;t<n.length;t++)if(n[t].object===e)return n[t];return null}(e);i&&i.next&&(n.length<=1?t.empty():i===t.first?(t.first=i.next,t.last.next=t.first,t.first.prev=t.last):i==t.last?(t.last=i.prev,t.last.next=t.first,t.first.prev=t.last):(i.prev.next=i.next,i.next.prev=i.prev),function(e){for(var t=n.length-1;t>=0;t--)if(n[t].object===e){n[t]=null,n.splice(t,1);break}}(e))},this.empty=function(){t.first=null,t.last=null,t.current=null,t.prev=null},this.start=function(){return t.current=t.first,t.prev=t.current,t.current},this.next=function(){if(t.current&&1!==n.length&&t.prev.next!==t.first)return t.current=t.current.next,t.prev=t.current,t.current},this.destroy=function(){for(var e=n.length-1;e>=0;e--)n[e]=null,n.splice(e,1);return Utils.nullObject(this)}},ObjectPool=function e(t,n){var i=this;_classCallCheck(this,e);var r=[];if(this.array=r,t)for(var a=0;;a++)r.push(new t);this.get=function(){return r.shift()||(t?new t:null)},this.empty=function(){r.length=0},this.put=function(e){r.push(e)},this.insert=function(e){Array.isArray(e)||(e=[e]),r.push.apply(r,_toConsumableArray(e))},this.length=function(){return r.length},this.destroy=function(){for(var e=r.length-1;e>=0;e--)r[e].destroy&&r[e].destroy();return Utils.nullObject(i)}},Vector3=function(){function e(t,n,i,r){_classCallCheck(this,e),this.x="number"==typeof t?t:0,this.y="number"==typeof n?n:0,this.z="number"==typeof i?i:0,this.w="number"==typeof r?r:1,this.type="vector3"}return _createClass(e,[{key:"set",value:function(e,t,n,i){return this.x=e||0,this.y=t||0,this.z=n||0,this.w=i||1,this}},{key:"clear",value:function(){return this.x=0,this.y=0,this.z=0,this.w=1,this}},{key:"copyTo",value:function(e){return e.x=this.x,e.y=this.y,e.z=this.z,e.w=this.w,e}},{key:"copyFrom",value:function(e){return this.x=e.x||0,this.y=e.y||0,this.z=e.z||0,this.w=e.w||1,this}},{key:"lengthSq",value:function(){return this.x*this.x+this.y*this.y+this.z*this.z}},{key:"length",value:function(){return Math.sqrt(this.lengthSq())}},{key:"normalize",value:function(){var e=1/this.length();return this.set(this.x*e,this.y*e,this.z*e),this}},{key:"setLength",value:function(e){return this.normalize().multiply(e),this}},{key:"addVectors",value:function(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}},{key:"subVectors",value:function(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}},{key:"multiplyVectors",value:function(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}},{key:"add",value:function(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}},{key:"sub",value:function(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}},{key:"multiply",value:function(e){return this.x*=e,this.y*=e,this.z*=e,this}},{key:"divide",value:function(e){return this.x/=e,this.y/=e,this.z/=e,this}},{key:"limit",value:function(e){this.length()>e&&(this.normalize(),this.multiply(e))}},{key:"heading2D",value:function(){return-Math.atan2(-this.y,this.x)}},{key:"lerp",value:function(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}},{key:"deltaLerp",value:function(e,t){for(var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,i=0;i<n;i++)this.lerp(e,t);return this}},{key:"interp",value:function(t,n,i){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:5e3;this.calc||(this.calc=new e),this.calc.subVectors(this,t);var a=Interpolation.convertEase(i)(Math.clamp(Math.range(this.calc.lengthSq(),0,r*r,1,0),0,1)*(n/10));return this.lerp(t,a)}},{key:"setAngleRadius",value:function(e,t){return this.x=Math.cos(e)*t,this.y=Math.sin(e)*t,this.z=Math.sin(e)*t,this}},{key:"addAngleRadius",value:function(e,t){return this.x+=Math.cos(e)*t,this.y+=Math.sin(e)*t,this.z+=Math.sin(e)*t,this}},{key:"applyQuaternion",value:function(e){var t=this.x,n=this.y,i=this.z,r=e.x,a=e.y,s=e.z,o=e.w,u=o*t+a*i-s*n,l=o*n+s*t-r*i,c=o*i+r*n-a*t,h=-r*t-a*n-s*i;return this.x=u*o+h*-r+l*-s-c*-a,this.y=l*o+h*-a+c*-r-u*-s,this.z=c*o+h*-s+u*-a-l*-r,this}},{key:"dot",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return e.x*t.x+e.y*t.y+e.z*t.z}},{key:"clone",value:function(){return new e(this.x,this.y,this.z)}},{key:"cross",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=e.y*t.z-e.z*t.y,i=e.z*t.x-e.x*t.z,r=e.x*t.y-e.y*t.x;return this.set(n,i,r,this.w),this}},{key:"distanceTo",value:function(e,t){var n=this.x-e.x,i=this.y-e.y,r=this.z-e.z;return t?n*n+i*i+r*r:Math.sqrt(n*n+i*i+r*r)}},{key:"solveAngle",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this;return Math.acos(e.dot(t)/(e.length()*t.length()||1e-5))}},{key:"solveAngle2D",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,n=new Vector2,i=new Vector2;return n.copyFrom(e),i.copyFrom(t),n.solveAngle(i)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y&&this.z===e.z}},{key:"toString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ";return this.x+e+this.y+e+this.z}}]),e}(),Utils3D=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"decompose",value:function(e,t){e.matrixWorld.decompose(t.position,t.quaternion,t.scale)}},{key:"createDebug",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:40,t=arguments[1],n=new THREE.IcosahedronGeometry(e,1),i=t?new THREE.MeshBasicMaterial({color:t}):new THREE.MeshNormalMaterial;return new THREE.Mesh(n,i)}},{key:"createRT",value:function(e,t){var n={minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,format:THREE.RGBAFormat,stencilBuffer:!1};return new THREE.WebGLRenderTarget(e,t,n)}},{key:"getTexture",value:function(e){if(this.textures||(this.textures={}),!this.textures[e]){var t=Assets.createImage(Assets.CDN+e),n=new THREE.Texture(t);t.onload=function(){n.needsUpdate=!0,n.onload&&(n.onload(),n.onload=null),THREE.Math.isPowerOfTwo(t.width*t.height)||(n.minFilter=THREE.LinearFilter)},this.textures[e]=n}return this.textures[e]}},{key:"setInfinity",value:function(e){var t=Number.POSITIVE_INFINITY;return e.set(t,t,t),e}},{key:"freezeMatrix",value:function(e){e.matrixAutoUpdate=!1,e.updateMatrix()}},{key:"getCubemap",value:function(e){var t=this,n="cube_"+(Array.isArray(e)?e[0]:e);if(this.textures||(this.textures={}),!this.textures[n]){for(var i=[],r=0;r<6;r++){var a=Assets.createImage(Assets.CDN+(Array.isArray(e)?e[r]:e));i.push(a),a.onload=function(){return t.textures[n].needsUpdate=!0}}this.textures[n]=new THREE.Texture(i),this.textures[n].minFilter=THREE.LinearFilter}return this.textures[n]}},{key:"loadObject",value:function(e){return this.objectLoader||(this.objectLoader=new THREE.ObjectLoader),this.objectLoader.parse(e)}},{key:"loadGeometry",value:function(e){return this.geomLoader||(this.geomLoader=new THREE.JSONLoader),this.bufferGeomLoader||(this.bufferGeomLoader=new THREE.BufferGeometryLoader),"BufferGeometry"===e.type?this.bufferGeomLoader.parse(e):this.geomLoader.parse(e.data).geometry}},{key:"disposeAllTextures",value:function(){for(var e in this.textures)this.textures[e].dispose()}},{key:"loadBufferGeometry",value:function(e){var t=new THREE.BufferGeometry;return e.data&&(e=e.data),t.addAttribute("position",new THREE.BufferAttribute(new Float32Array(e.position),3)),t.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(e.normal||e.position.length),3)),t.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(e.uv||e.position.length/3*2),2)),t}},{key:"loadSkinnedGeometry",value:function(e){var t=new THREE.BufferGeometry;return t.addAttribute("position",new THREE.BufferAttribute(new Float32Array(e.position),3)),t.addAttribute("normal",new THREE.BufferAttribute(new Float32Array(e.normal),3)),t.addAttribute("uv",new THREE.BufferAttribute(new Float32Array(e.uv),2)),t.addAttribute("skinIndex",new THREE.BufferAttribute(new Float32Array(e.skinIndices),4)),t.addAttribute("skinWeight",new THREE.BufferAttribute(new Float32Array(e.skinWeights),4)),t.bones=e.bones,t}},{key:"loadCurve",value:function(e){for(var t=[],n=0;n<e.length;n+=3)t.push(new THREE.Vector3(e[n+0],e[n+1],e[n+2]));return new THREE.CatmullRomCurve3(t)}},{key:"setLightCamera",value:function(e,t,n,i,r){e.shadow.camera.left=-t,e.shadow.camera.right=t,e.shadow.camera.top=t,e.shadow.camera.bottom=-t,e.castShadow=!0,n&&(e.shadow.camera.near=n),i&&(e.shadow.camera.far=i),r&&(e.shadow.mapSize.width=e.shadow.mapSize.height=r),e.shadow.camera.updateProjectionMatrix()}},{key:"getRepeatTexture",value:function(e){var t=this.getTexture(e);return t.onload=function(){return t.wrapS=t.wrapT=THREE.RepeatWrapping},t}}]),e}(),Raycaster=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));n.camera=e;var i=new THREE.Vector2,r=new THREE.Raycaster,a=void 0;function s(e,t){return e.distance-t.distance}function o(e){Array.isArray(e)||(e=[e]);var t,n=[];return e.forEach(function(e){return function e(t,n,i,r){if(!1!==t.visible){for(var a=t.parent;a;){if(!1===a.visible)return;a=a.parent}t.raycast(n,i),!0===r&&t.children.forEach(function(t){return e(t,n,i,!0)})}}(e,r,n,!1)}),n.sort(s),a&&((t=a.geometry.vertices)[0].copy(r.ray.origin.clone()),t[1].copy(r.ray.origin.clone().add(r.ray.direction.clone().multiplyScalar(1e4))),a.geometry.verticesNeedUpdate=!0),n}return n.pointsThreshold=function(e){r.params.Points.threshold=e},n.debug=function(e){var t=new THREE.Geometry;t.vertices.push(new THREE.Vector3(-100,0,0)),t.vertices.push(new THREE.Vector3(100,0,0));var n=new THREE.LineBasicMaterial({color:255});a=new THREE.Line(t,n),e.add(a)},n.checkHit=function(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Mouse,s=n.rect||Stage;return a===Mouse&&s===Stage?i.copy(Mouse.tilt):(i.x=a.x/s.width*2-1,i.y=-a.y/s.height*2+1),r.setFromCamera(i,e),o(t)},n.checkFromValues=function(e,t,n){return r.set(t,n,0,Number.POSITIVE_INFINITY),o(e)},n}return _inherits(t,Component),t}(),Interaction3D=function(){function e(t){var n=this;_classCallCheck(this,e),e.initialized||(e.HOVER="interaction3d_hover",e.CLICK="interaction3d_click",e.initialized=!0);var i=this;this.events=new Events,this.ray=new Raycaster(t),this.meshes=[],this.meshCallbacks=[],this.cursor="auto",this.enabled=!0;var r={},a=void 0,s=void 0;function o(){if(i.enabled){var e=u();e?(s=e.object).time=Render.TIME:s=null}}function u(){if(i.enabled){var e=i.ray.checkHit(i.meshes)[0];if(e){var t=e.object;return t!==a&&(a&&c("out",a),c("over",a=t),Stage.css("cursor","pointer")),e}return a&&(c("out",a),a=null,Stage.css("cursor",i.cursor)),!1}}function l(){if(i.enabled&&s){var t=i.ray.checkHit(i.meshes)[0];t&&t.object===s&&function(t){r.action="click",r.mesh=t,i.events.fire(e.CLICK,r,!0);var n=i.meshes.indexOf(s);i.meshCallbacks[n].clickCallback&&i.meshCallbacks[n].clickCallback(r)}(s),s=null}}function c(t,n){r.action=t,r.mesh=n,i.events.fire(e.HOVER,r,!0);var s=i.meshes.indexOf(a);i.meshCallbacks[s].hoverCallback&&i.meshCallbacks[s].hoverCallback(r)}function h(e){Array.isArray(e)||(e=[e]);var t=[];return e.forEach(function e(n){"Mesh"===n.type&&n.mouseEnabled&&t.push(n);n.children.length&&n.children.forEach(e)}),t}Mouse.input.events.add(Interaction.START,o),Mouse.input.events.add(Interaction.MOVE,u),Mouse.input.events.add(Interaction.CLICK,l),this.add=function(e,t,i,r){Array.isArray(e)&&!r||(e=h(e)),e.forEach(function(e){n.meshes.push(e),n.meshCallbacks.push({hoverCallback:t,clickCallback:i})})},this.remove=function(e,t){Array.isArray(e)&&!t||(e=h(e)),e.forEach(function(e){e===a&&(c("out",a),a=null,Stage.css("cursor",n.cursor));for(var t=n.meshes.length-1;t>=0;t--)n.meshes[t]===e&&(n.meshes.splice(t,1),n.meshCallbacks.splice(t,1))})},this.destroy=function(){return Utils.nullObject(n)}}return _createClass(e,[{key:"camera",set:function(e){this.ray.camera=e}}]),e}(),ScreenProjection=function(e){function t(e){_classCallCheck(this,t);var n=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),i=new THREE.Vector3,r=new THREE.Vector3,a=new THREE.Vector3;return n.set=function(t){e=t},n.unproject=function(t,r){var s=n.rect||Stage;i.set(t.x/s.width*2-1,-t.y/s.height*2+1,.5),i.unproject(e);var o=e.position;i.sub(o).normalize();var u=r||-o.z/i.z;return a.copy(o).add(i.multiplyScalar(u)),a},n.project=function(t){var i=n.rect||Stage;return t instanceof THREE.Object3D?(t.updateMatrixWorld(),r.set(0,0,0).setFromMatrixPosition(t.matrixWorld)):r.copy(t),r.project(e),r.x=(r.x+1)/2*i.width,r.y=-(r.y-1)/2*i.height,r},n}return _inherits(t,Component),t}(),Shader=function(e){function t(e,n,i){_classCallCheck(this,t);var r=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),a=r;function s(e,t){return(e=("vs"===t?["precision highp float;","precision highp int;","attribute vec2 uv;","attribute vec3 position;","attribute vec3 normal;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 modelMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;"].join("\n"):[~e.indexOf("dFdx")?"#extension GL_OES_standard_derivatives : enable":"","precision highp float;","precision highp int;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 modelMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;"].join("\n"))+"\n\n"+e).replace(/#s?chunk\(\s?(\w+)\s?\);/g,function(e,t){return THREE.ShaderChunk[t]+"\n"})}return r.uniforms={},r.properties={},function(){for(var e in i)void 0!==i[e].value?a.uniforms[e]=i[e]:a.properties[e]=i[e]}(),function(){var t={};for(var i in t.vertexShader=s(e,"vs"),t.fragmentShader=s(n,"fs"),t.uniforms=a.uniforms,a.properties)t[i]=a.properties[i];a.material=new THREE.RawShaderMaterial(t),a.material.shader=a,a.uniforms=a.material.uniforms}(),r}return _inherits(t,Component),_createClass(t,[{key:"set",value:function(e,t){TweenManager.clearTween(this.uniforms[e]),this.uniforms[e].value=t}},{key:"tween",value:function(e,t,n,i,r,a,s){return TweenManager.tween(this.uniforms[e],{value:t},n,i,r,a,s)}},{key:"getValues",value:function(){var e={};for(var t in this.uniforms)e[t]=this.uniforms[t].value;return e}},{key:"copyUniformsTo",value:function(e){for(var t in this.uniforms)e.uniforms[t]=this.uniforms[t]}},{key:"cloneUniformsTo",value:function(e){for(var t in this.uniforms)e.uniforms[t]={type:this.uniforms[t].type,value:this.uniforms[t].value}}},{key:"destroy",value:function(){return this.material.dispose(),_get(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"destroy",this).call(this)}}]),t}(),Effects=function(e){function t(e,n){_classCallCheck(this,t);var i=_possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this)),r=i;i.stage=e,i.renderer=n.renderer,i.scene=n.scene,i.camera=n.camera,i.shader=n.shader,i.dpr=n.dpr||1;var a=void 0,s=void 0,o=void 0,u=void 0;function l(){a.dispose(),a=Utils3D.createRT(r.stage.width*r.dpr,r.stage.height*r.dpr),s.left=r.stage.width/-2,s.right=r.stage.width/2,s.top=r.stage.height/2,s.bottom=r.stage.height/-2,s.updateProjectionMatrix()}return a=Utils3D.createRT(r.stage.width*r.dpr,r.stage.height*r.dpr),r.texture=a.texture,r.texture.minFilter=THREE.LinearFilter,s=new THREE.OrthographicCamera(r.stage.width/-2,r.stage.width/2,r.stage.height/2,r.stage.height/-2,1,1e3),o=new THREE.Scene,u=new THREE.Mesh(new THREE.PlaneBufferGeometry(2,2),r.shader.material),o.add(u),r.events.add(Events.RESIZE,l),i.render=function(){i.renderer.render(i.scene,i.camera,a,!0),u.material.uniforms.texture.value=a.texture,i.renderer.render(o,s)},i}return _inherits(t,Component),t}();
  