var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.inherits=function(f,d){function p(){}p.prototype=d.prototype;f.superClass_=d.prototype;f.prototype=new p;f.prototype.constructor=f;for(var t in d)if(Object.defineProperties){var k=Object.getOwnPropertyDescriptor(d,t);k&&Object.defineProperty(f,t,k)}else f[t]=d[t]};$jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;
$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,d,p){f!=Array.prototype&&f!=Object.prototype&&(f[d]=p.value)};$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(f){return $jscomp.SYMBOL_PREFIX+(f||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var f=$jscomp.global.Symbol.iterator;f||(f=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[f]&&$jscomp.defineProperty(Array.prototype,f,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(f){var d=0;return $jscomp.iteratorPrototype(function(){return d<f.length?{done:!1,value:f[d++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(f){$jscomp.initSymbolIterator();f={next:f};f[$jscomp.global.Symbol.iterator]=function(){return this};return f};$jscomp.makeIterator=function(f){$jscomp.initSymbolIterator();var d=f[Symbol.iterator];return d?d.call(f):$jscomp.arrayIterator(f)};$jscomp.owns=function(f,d){return Object.prototype.hasOwnProperty.call(f,d)};
$jscomp.polyfill=function(f,d,p,t){if(d){p=$jscomp.global;f=f.split(".");for(t=0;t<f.length-1;t++){var k=f[t];k in p||(p[k]={});p=p[k]}f=f[f.length-1];t=p[f];d=d(t);d!=t&&null!=d&&$jscomp.defineProperty(p,f,{configurable:!0,writable:!0,value:d})}};$jscomp.polyfill("Object.assign",function(f){return f?f:function(d,f){for(var p=1;p<arguments.length;p++){var k=arguments[p];if(k)for(var y in k)$jscomp.owns(k,y)&&(d[y]=k[y])}return d}},"es6-impl","es3");$jscomp.FORCE_POLYFILL_PROMISE=!1;
$jscomp.polyfill("Promise",function(f){function d(){this.batch_=null}function p(d){return d instanceof k?d:new k(function(f,L){f(d)})}if(f&&!$jscomp.FORCE_POLYFILL_PROMISE)return f;d.prototype.asyncExecute=function(d){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(d);return this};d.prototype.asyncExecuteBatch_=function(){var d=this;this.asyncExecuteFunction(function(){d.executeBatch_()})};var t=$jscomp.global.setTimeout;d.prototype.asyncExecuteFunction=function(d){t(d,
0)};d.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var d=this.batch_;this.batch_=[];for(var f=0;f<d.length;++f){var k=d[f];delete d[f];try{k()}catch(g){this.asyncThrow_(g)}}}this.batch_=null};d.prototype.asyncThrow_=function(d){this.asyncExecuteFunction(function(){throw d;})};var k=function(d){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var f=this.createResolveAndReject_();try{d(f.resolve,f.reject)}catch(D){f.reject(D)}};k.prototype.createResolveAndReject_=
function(){function d(d){return function(g){k||(k=!0,d.call(f,g))}}var f=this,k=!1;return{resolve:d(this.resolveTo_),reject:d(this.reject_)}};k.prototype.resolveTo_=function(d){if(d===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(d instanceof k)this.settleSameAsPromise_(d);else{a:switch(typeof d){case "object":var f=null!=d;break a;case "function":f=!0;break a;default:f=!1}f?this.resolveToNonPromiseObj_(d):this.fulfill_(d)}};k.prototype.resolveToNonPromiseObj_=function(d){var f=
void 0;try{f=d.then}catch(D){this.reject_(D);return}"function"==typeof f?this.settleSameAsThenable_(f,d):this.fulfill_(d)};k.prototype.reject_=function(d){this.settle_(2,d)};k.prototype.fulfill_=function(d){this.settle_(1,d)};k.prototype.settle_=function(d,f){if(0!=this.state_)throw Error("Cannot settle("+d+", "+f|"): Promise already settled in state"+this.state_);this.state_=d;this.result_=f;this.executeOnSettledCallbacks_()};k.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var d=
this.onSettledCallbacks_,f=0;f<d.length;++f)d[f].call(),d[f]=null;this.onSettledCallbacks_=null}};var y=new d;k.prototype.settleSameAsPromise_=function(d){var f=this.createResolveAndReject_();d.callWhenSettled_(f.resolve,f.reject)};k.prototype.settleSameAsThenable_=function(d,f){var k=this.createResolveAndReject_();try{d.call(f,k.resolve,k.reject)}catch(g){k.reject(g)}};k.prototype.then=function(d,f){function p(d,f){return"function"==typeof d?function(f){try{g(d(f))}catch(q){l(q)}}:f}var g,l,t=new k(function(d,
f){g=d;l=f});this.callWhenSettled_(p(d,g),p(f,l));return t};k.prototype.catch=function(d){return this.then(void 0,d)};k.prototype.callWhenSettled_=function(d,f){function k(){switch(g.state_){case 1:d(g.result_);break;case 2:f(g.result_);break;default:throw Error("Unexpected state: "+g.state_);}}var g=this;null==this.onSettledCallbacks_?y.asyncExecute(k):this.onSettledCallbacks_.push(function(){y.asyncExecute(k)})};k.resolve=p;k.reject=function(d){return new k(function(f,k){k(d)})};k.race=function(d){return new k(function(f,
k){for(var g=$jscomp.makeIterator(d),l=g.next();!l.done;l=g.next())p(l.value).callWhenSettled_(f,k)})};k.all=function(d){var f=$jscomp.makeIterator(d),t=f.next();return t.done?p([]):new k(function(d,l){function g(f){return function(g){m[f]=g;k--;0==k&&d(m)}}var m=[],k=0;do m.push(void 0),k++,p(t.value).callWhenSettled_(g(m.length-1),l),t=f.next();while(!t.done)})};return k},"es6-impl","es3");
$jscomp.iteratorFromArray=function(f,d){$jscomp.initSymbolIterator();f instanceof String&&(f+="");var p=0,t={next:function(){if(p<f.length){var k=p++;return{value:d(k,f[k]),done:!1}}t.next=function(){return{done:!0,value:void 0}};return t.next()}};t[Symbol.iterator]=function(){return t};return t};$jscomp.polyfill("Array.prototype.keys",function(f){return f?f:function(){return $jscomp.iteratorFromArray(this,function(d){return d})}},"es6-impl","es3");
$jscomp.checkStringArgs=function(f,d,p){if(null==f)throw new TypeError("The 'this' value for String.prototype."+p+" must not be null or undefined");if(d instanceof RegExp)throw new TypeError("First argument to String.prototype."+p+" must not be a regular expression");return f+""};
$jscomp.polyfill("String.prototype.repeat",function(f){return f?f:function(d){var f=$jscomp.checkStringArgs(this,null,"repeat");if(0>d||1342177279<d)throw new RangeError("Invalid count value");d|=0;for(var t="";d;)if(d&1&&(t+=f),d>>>=1)f+=f;return t}},"es6-impl","es3");
(function(f,d){"object"===typeof exports&&"undefined"!==typeof module?d(exports,require("three")):"function"===typeof define&&define.amd?define(["exports","three"],d):d(f.WHS=f.WHS||{},f.THREE)})(this,function(f,d){function p(d,f,g){function c(b){if("function"!==typeof b)throw Error("Expected listener to be a function.");var a=!0;G===e&&(G=e.slice());G.push(b);return function(){if(a){a=!1;G===e&&(G=e.slice());var n=G.indexOf(b);G.splice(n,1)}}}function a(b){var a;if(a=null!=b&&"object"==typeof b){if(null==
b)var c=void 0===b?"[object Undefined]":"[object Null]";else if(ua&&ua in Object(b)){a=Tb.call(b,H);var d=b[H];try{b[H]=void 0,c=!0}catch(Yc){}var f=Ub.call(b);c&&(a?b[H]=d:delete b[H]);c=f}else c=Vb.call(b);a="[object Object]"==c}a?(c=Wb(b),null===c?c=!0:(c=Xb.call(c,"constructor")&&c.constructor,c="function"==typeof c&&c instanceof c&&va.call(c)==Yb)):c=!1;if(!c)throw Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"===typeof b.type)throw Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');
if(X)throw Error("Reducers may not dispatch actions.");try{X=!0,u=n(u,b)}finally{X=!1}c=e=G;for(a=0;a<c.length;a++)(0,c[a])();return b}var b;"function"===typeof f&&"undefined"===typeof g&&(g=f,f=void 0);if("undefined"!==typeof g){if("function"!==typeof g)throw Error("Expected the enhancer to be a function.");return g(p)(d,f)}if("function"!==typeof d)throw Error("Expected the reducer to be a function.");var n=d,u=f,e=[],G=e,X=!1;a({type:wa.INIT});return b={dispatch:a,subscribe:c,getState:function(){return u},
replaceReducer:function(b){if("function"!==typeof b)throw Error("Expected the nextReducer to be a function.");n=b;a({type:wa.INIT})}},b[xa]=function(){var b;return b={subscribe:function(b){function a(){b.next&&b.next(u)}if("object"!==typeof b)throw new TypeError("Expected the observer to be an object.");a();return{unsubscribe:c(a)}}},b[xa]=function(){return this},b},b}function t(){for(var d=arguments.length,f=Array(d),g=0;g<d;g++)f[g]=arguments[g];return function(c){for(var a=0;a<f.length;a++)for(var b=
f[a],n=0;n<b.map.length;n++){var d=b.map[n];Object.defineProperty(c.prototype,d,{get:b.getter(d),set:b.setter(d),configurable:b.configurable,enumerable:b.enumerable})}}}function k(){for(var d=arguments.length,f=Array(d),g=0;g<d;g++)f[g]=arguments[g];return{map:f,getter:function(c){return function(){return this.native[c]}},setter:function(c){return function(a){this.native[c].copy(a)}},configurable:!0,enumerable:!0}}var y=function Qb(d){for(var c=arguments.length,a=Array(1<c?c-1:0),b=1;b<c;b++)a[b-
1]=arguments[b];var c=!0,b=!1,n=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var u=a[Symbol.iterator](),e;!(c=(e=u.next()).done);c=!0){var f=e.value;if(f){var a=!0,g=!1,l=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var h=Object.getOwnPropertyNames(f)[Symbol.iterator](),k;!(a=(k=h.next()).done);a=!0){var m=k.value;void 0!==d[m]&&f[m]&&"[object Object]"===d[m].toString()&&"[object Object]"===f[m].toString()?d[m].constructor===Object&&Qb(d[m],f[m]):d[m]="undefined"===
typeof d[m]?f[m]:d[m];"undefined"===typeof d[m]&&Array.isArray(f[m])?d[m]=f[m].slice():"undefined"===typeof d[m]&&Array.isArray(f[m])&&(d[m]=f[m])}}catch(W){g=!0,l=W}finally{try{!a&&h.return&&h.return()}finally{if(g)throw l;}}}}}catch(W){b=!0,n=W}finally{try{!c&&u.return&&u.return()}finally{if(b)throw n;}}return d},L=function(d,f){for(var c={},a=0,b=f.length;a<b;a++)c[f[a]]=d[a];return c},ta=function Rb(c,a){for(var b in a)Array.isArray(c[b])?c[b]=L(c[b],a[b]):c[b]instanceof Object&&!Array.isArray(a[b])&&
(c[b]=Rb(c[b],a[b]));return c},D=function(d){var c={},a=[];d=d||this;d.on=function(b,a,d){(c[b]=c[b]||[]).push([a,d])};d.off=function(b,n){b||(c={});b=c[b]||a;for(var d=b.length=n?b.length:0;d--;)n==b[d][0]&&b.splice(d,1)};d.emit=function(b){for(var n=c[b]||a,n=0<n.length?n.slice(0,n.length):n,d=0,e;e=n[d++];)e[0].apply(e[1],a.slice.call(arguments,1))}},g=function(d,c){if(!(d instanceof c))throw new TypeError("Cannot call a class as a function");},l=function(){function d(c,a){for(var b=0;b<a.length;b++){var n=
a[b];n.enumerable=n.enumerable||!1;n.configurable=!0;"value"in n&&(n.writable=!0);Object.defineProperty(c,n.key,n)}}return function(c,a,b){a&&d(c.prototype,a);b&&d(c,b);return c}}(),Pb=function(d,c,a){c in d?Object.defineProperty(d,c,{value:a,enumerable:!0,configurable:!0,writable:!0}):d[c]=a;return d},m=Object.assign||function(d){for(var c=1;c<arguments.length;c++){var a=arguments[c],b;for(b in a)Object.prototype.hasOwnProperty.call(a,b)&&(d[b]=a[b])}return d},v=function c(a,b,n){null===a&&(a=Function.prototype);
var d=Object.getOwnPropertyDescriptor(a,b);if(void 0===d){if(a=Object.getPrototypeOf(a),null!==a)return c(a,b,n)}else{if("value"in d)return d.value;b=d.get;return void 0===b?void 0:b.call(n)}},r=function(c,a){if("function"!==typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function, not "+typeof a);c.prototype=Object.create(a&&a.prototype,{constructor:{value:c,enumerable:!1,writable:!0,configurable:!0}});a&&(Object.setPrototypeOf?Object.setPrototypeOf(c,a):c.__proto__=
a)},q=function(c,a){if(!c)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!a||"object"!==typeof a&&"function"!==typeof a?c:a},ya=function(){return function(c,a){if(Array.isArray(c))return c;$jscomp.initSymbol();$jscomp.initSymbolIterator();if(Symbol.iterator in Object(c)){var b=[],n=!0,d=!1,e=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var f=c[Symbol.iterator](),g;!(n=(g=f.next()).done)&&(b.push(g.value),!a||b.length!==a);n=!0);}catch(Sb){d=
!0,e=Sb}finally{try{if(!n&&f["return"])f["return"]()}finally{if(d)throw e;}}return b}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),E=function(c){function a(b,n,c){g(this,a);b=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"@"+b+": "+n));n=b.stack.split("\n");n.splice(1,2);b.stack=n.join("\n");console&&console.error("Component:",c);b.name="CompositionError";return b}r(a,c);return a}(Error),Zb=function(c){function a(b,n,c){var e=3<arguments.length&&void 0!==
arguments[3]?arguments[3]:!1;g(this,a);var d=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"@"+b+": "+n)),f=d.stack.split("\n");f.splice(1,2);d.stack=f.join("\n");console&&console.error("Active module:",c);console&&e&&console.error("Dependency published by module:",e);d.name="DependencyError";return d}r(a,c);return a}(Error),za=function(c){function a(b,n,c){var e=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1;g(this,a);var d=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,
"@"+b+": "+n)),f=d.stack.split("\n");f.splice(1,2);d.stack=f.join("\n");console&&console.error("Component:",c);console&&e&&console.error("Active module:",e);d.name="ManagerError";return d}r(a,c);return a}(Error),Aa=function(){throw Error("WhitestormJS Framework requires Three.js r84. https://threejs.org/");};try{d.REVISION||Aa()}catch(c){Aa()}var Ba=function(c){function a(){g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).apply(this,arguments))}r(a,c);l(a,[{key:"integrateModules",value:function(b){if(this.modules||
b){b&&b.modules&&(this.modules=b.modules.slice(0));if(this.modules)for(var a=0,c=this.modules.length;a<c;a++)this.applyModule(this.modules[a],!1);b&&this.applyBridge({onCopy:b})}}},{key:"applyBridge",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=this.modules;if(!a)return b;for(var c=0,e=a.length;c<e;c++)for(var d in b)if(b[d]){var f=a[c];f&&f.bridge&&f.bridge[d]&&(b[d]=f.bridge[d].apply(this,[b[d],f]))}return b}},{key:"applyCommand",value:function(b){var a=this,
c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(b,c){return b.apply(a,[c])},e=this.modules;if(e)for(var d=0,f=e.length;d<f;d++){var g=e[d];b in g&&c(g[b],g)}}},{key:"applyModule",value:function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(b){a&&this.modules?this.modules.push(b):a&&(this.modules=[b]);this.manager&&this.manager.active(b);if(b.manager&&this.manager)b.manager(this.manager);else if(b.manager)throw new za("Component","Module requires ModuleManager that is turned off for this component",
this,b);b.integrate&&b.integrate.bind(this)(b);return b}}},{key:"disposeModules",value:function(){for(;this.modules.length;)this.disposeModule(this.modules[0])}},{key:"disposeModule",value:function(b){if(b)return this.modules.splice(this.modules.indexOf(b),1),b.dispose&&b.dispose.bind(this)(b),b}},{key:"module",value:function(b){this.applyModule(b);return this}}]);return a}(D),$b="object"==typeof self&&self&&self.Object===Object&&self,I=("object"==typeof global&&global&&global.Object===Object&&global||
$b||Function("return this")()).Symbol,Ca=Object.prototype,Tb=Ca.hasOwnProperty,Ub=Ca.toString,H=I?I.toStringTag:void 0,Vb=Object.prototype.toString,ua=I?I.toStringTag:void 0,Wb=function(c,a){return function(b){return c(a(b))}}(Object.getPrototypeOf,Object),va=Function.prototype.toString,Xb=Object.prototype.hasOwnProperty,Yb=va.call(Object),xa=function(c){var a=c.Symbol;"function"===typeof a?a.observable?c=a.observable:(c=a("observable"),a.observable=c):c="@@observable";return c}("undefined"!==typeof self?
self:"undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof module?module:Function("return this")()),wa={INIT:"@@redux/INIT"},N=function(){function c(a){g(this,c);this.handler=a;this.currentModule=null;this.store=p(function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[{},""],a=arguments[1];b[0][a.key]=a.data;b[1]=a.key;return b});this.modules={}}l(c,[{key:"active",value:function(a){this.currentModule=a}},{key:"reset",value:function(){this.currentModule=
null}},{key:"define",value:function(a){this.modules[a]=this.currentModule}},{key:"use",value:function(a){return this.modules[a]}},{key:"set",value:function(a,b){this.store.dispatch({type:"ADD",key:a,data:b})}},{key:"get",value:function(a){if(!this.store.getState()[0][a])throw new Zb("ModuleManager","Module requires '"+a+"' dependency",this.currentModule);return this.store.getState()[0][a]}},{key:"has",value:function(a){return!!this.store.getState()[0][a]}},{key:"update",value:function(){var a=this,
b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.store.subscribe(function(){var c=a.store.getState(),d=ya(c,2),c=d[0],d=d[1],e=b[d];e&&e(c[d])})}},{key:"add",value:function(){console.warn(".add() method is deprecated. Use .set() instead");return this.set.apply(this,arguments)}},{key:"require",value:function(a,b){void 0===this.use(a)&&this.handler.applyModule(b())}}]);return c}(),O,Da,B=(Da=O=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=
1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions;g(this,a);var e=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));e._wait=[];e.modules=[];e.children=[];e.params=y(ta(b,d),c);e.params.manager&&(e.manager=new N(e));e.modules=e.params.modules;e.integrateModules();return e}r(a,c);l(a,[{key:"wait",value:function(b){b&&this._wait.push(b);return Promise.all(this._wait)}},{key:"defer",value:function(b){var a=
this;this.isDeffered?this.wait().then(function(){return b(a)}):b(this)}},{key:"updateParams",value:function(){return this.params=y(0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},this.params)}},{key:"clone",value:function(){return(new this.constructor(this.params)).copy(this)}},{key:"copy",value:function(b,a){this.params=m({},b.params);b.native&&(this.native=b.native.clone(b.params));a&&a();this.integrateModules(b);return this}},{key:"add",value:function(b){var a=this;b.parent=this;return new Promise(function(c,
e){a.defer(function(){var n=b.native;n||e();var d=a.applyBridge({onAdd:b}).onAdd,f=function(){a.native.add(n);a.children.push(b);c(b)};d instanceof Promise?d.then(f):f()})})}},{key:"remove",value:function(b){b.parent=null;this.native.remove(b.native)}},{key:"addTo",value:function(b){return b.add(this)}},{key:"isDeffered",get:function(){return 0<this._wait.length}},{key:"manager",get:function(){if(this._manager)return this._manager;throw new za("Component","ModuleManager is not used in this component. 'manager' parameter should be set as 'true'",
this);},set:function(b){this._manager=b}},{key:"native",get:function(){return this._native},set:function(b){this._native=b;this._native.component=this;return this._native}}]);return a}(Ba),O.defaults={modules:null,manager:!0},O.instructions={},Da),Ea,Fa,P,Ga,h=(Ea=t(k("position","rotation","quaternion","scale"),function(){for(var c=arguments.length,a=Array(c),b=0;b<c;b++)a[b]=arguments[b];return{map:a,getter:function(b){return function(){return this.native[b]}},setter:function(b){return function(a){this.native[b]=
a}},configurable:!0,enumerable:!0}}("material","geometry")),Ea(Fa=(Ga=P=function(c){function a(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions;g(this,a);var e=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,c,d));if(e.params.build){var f=e.build(e.params);if(!f)throw new E("MeshComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",e);f instanceof
Promise?(e.wait(f),e.wait(new Promise(function(b){f.then(function(a){e.native=a;e.wrap().then(b)})}))):(e.native=f,e.wait(e.wrap()))}e.applyCommand("postIntegrate");return e}r(a,c);l(a,null,[{key:"custom",value:function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:d.Mesh;return function(a){function e(){g(this,e);return q(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}r(e,a);l(e,[{key:"build",value:function(){var a=this.applyBridge({geometry:b,material:(0<arguments.length&&
void 0!==arguments[0]?arguments[0]:this.params).material});return this.applyBridge({mesh:new c(a.geometry,a.material)}).mesh}}]);return e}(a)}},{key:"create",value:function(b,c,d){return new (a.custom(b,d))(c)}},{key:"from",value:function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};c.build=!1;c=new a(c);c.native=b;c.wrap();return c}}]);l(a,[{key:"build",value:function(){throw new E("MeshComponent","Instance should have it's own .build().",this);}},{key:"wrap",value:function(){var b=
this;return new Promise(function(a){var c=b.params,e=c.position,d=c.rotation,n=c.scale,c=c.shadow;b.position.set(e.x,e.y,e.z);b.rotation.set(d.x,d.y,d.z);b.scale.set(n.x,n.y,n.z);b.native.castShadow=c.cast;b.native.receiveShadow=c.receive;b.applyBridge({onWrap:1});a(b)})}},{key:"copy",value:function(b){var c=this;return v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"copy",this).call(this,b,function(){c.position.copy(b.position);c.rotation.copy(b.rotation);c.quaternion.copy(b.quaternion)})}},
{key:"clone",value:function(b,a){var c=(new this.constructor({build:!1})).copy(this);b&&(c.geometry=c.geometry.clone());a&&(c.material=c.material.clone());return c}}]);return a}(B),P.defaults=m({},B.defaults,{build:!0,geometry:{},material:!1,shadow:{cast:!0,receive:!0},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0},scale:{x:1,y:1,z:1}}),P.instructions={position:["x","y","z"],rotation:["x","y","z"],scale:["x","y","z"]},Ga))||Fa),Ha,Ia,Q,Ja,w=(Ha=t(k("position","rotation","quaternion","target")),Ha(Ia=
(Ja=Q=function(c){function a(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions;g(this,a);var e=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,c,d));if(e.params.build){c=e.build(e.params);if(!c)throw new E("LightComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",e);c instanceof Promise?c.then(function(b){e.native=b}):e.native=c;e.wait(e.wrap())}e.applyCommand("postIntegrate");
return e}r(a,c);l(a,[{key:"build",value:function(){throw new E("MeshComponent","Instance should have it's own .build().",this);}},{key:"wrap",value:function(){var b=this;return new Promise(function(a){b.defer(function(){var c=b.params,d=c.position,c=c.rotation;b.position.set(d.x,d.y,d.z);b.rotation.set(c.x,c.y,c.z);b.applyBridge({onWrap:1});a(b)})})}},{key:"wrapShadow",value:function(){var b=this.native,a=this.params.shadow;b.castShadow=a.cast;b.shadow.mapSize.width=a.mapSize.width;b.shadow.mapSize.height=
a.mapSize.height;b.shadow.bias=a.bias;b.shadow.radius=a.radius;b=b.shadow.camera;a=a.camera;b.near=a.near;b.far=a.far;b.fov=a.fov;b.left=a.left;b.right=a.right;b.top=a.top;b.bottom=a.bottom}},{key:"copy",value:function(b){var c=this;return v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"copy",this).call(this,b,function(){c.target&&c.target.copy(b.target());c.position.copy(b.position);c.rotation.copy(b.rotation);c.quaternion.copy(b.quaternion)})}},{key:"clone",value:function(){return(new this.constructor({build:!1})).copy(this)}}]);
return a}(B),Q.defaults=m({},B.defaults,{build:!0,shadow:{cast:!0,bias:0,radius:1,mapSize:{width:1024,height:1024},camera:{near:!0,far:400,fov:90,top:200,bottom:-200,left:-200,right:200}},position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}),Q.instructions={position:["x","y","z"],rotation:["x","y","z"]},Ja))||Ia),Ka,La,R,Ma,C=(Ka=t(k("position","rotation","quaternion","target")),Ka(La=(Ma=R=function(c){function a(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,d=2<arguments.length&&
void 0!==arguments[2]?arguments[2]:a.instructions;g(this,a);var e=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,c,d));if(e.params.build){c=e.build(e.params);if(!c)throw new E("CameraComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",e);c instanceof Promise?c.then(function(b){e.native=b}):e.native=c;e.wait(e.wrap())}e.applyCommand("postIntegrate");return e}r(a,c);l(a,[{key:"build",value:function(){throw new E("CameraComponent","Instance should have it's own .build().",
this);}},{key:"wrap",value:function(){var b=this;return new Promise(function(a){b.defer(function(){b.position.set(b.params.position.x,b.params.position.y,b.params.position.z);b.rotation.set(b.params.rotation.x,b.params.rotation.y,b.params.rotation.z);b.applyBridge({onWrap:1});a(b)})})}},{key:"copy",value:function(b){var c=this;return v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"copy",this).call(this,b,function(){c.target&&c.target.copy(b.target());c.position.copy(b.position);c.rotation.copy(b.rotation);
c.quaternion.copy(b.quaternion)})}},{key:"clone",value:function(){return(new this.constructor({build:!1})).copy(this)}}]);return a}(B),R.defaults=m({},B.defaults,{build:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}),R.instructions={position:["x","y","z"],rotation:["x","y","z"],scale:["x","y","z"]},Ma))||La),z="undefined"===typeof window?global:window,ac=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];g(this,a);console.log("WHS.App 2.1.6");var c=q(this,
(a.__proto__||Object.getPrototypeOf(a)).call(this));c.enabled=!0;c.loops=[];c.manager=new N(c);c.modules=b;c.integrateModules();return c}r(a,c);l(a,[{key:"start",value:function(){function b(){a(b);if(d)for(var e=0,n=c.length;e<n;e++){var f=c[e];f.enabled&&f.execute(f.clock)}}var a=function(){return z.requestAnimationFrame||z.webkitRequestAnimationFrame||z.mozRequestAnimationFrame||function(b){z.setTimeout(b,1E3/60)}}(),c=this.loops,d=this.enabled;this.enabled=!0;b()}},{key:"stop",value:function(){this.enabled=
!1}},{key:"addLoop",value:function(b){var a=this;return new Promise(function(c){a.loops.push(b);c(b)})}},{key:"removeLoop",value:function(b){var a=this;return new Promise(function(c){var d=a.loops.indexOf(b);-1!==d&&a.loops.splice(d,1);c(b)})}},{key:"get",value:function(b){return this.manager.get(b)}},{key:"use",value:function(b){return this.manager.use(b)}}]);return a}(Ba),F=function(){function c(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;g(this,c);this.func=a;this.clock=
b?new d.Clock:null;this.enabled=!1}l(c,[{key:"start",value:function(a){this.enabled||(a&&a.addLoop(this),this.clock&&this.clock.start(),this.enabled=!0)}},{key:"stop",value:function(a){this.enabled&&(this.clock&&this.clock.stop(),this.enabled=!1,a&&a.removeLoop(this))}},{key:"execute",value:function(){return this.func(this.clock)}}]);return c}(),Na,Oa,bc=(Oa=Na=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,
b,a.defaults))}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new d.AmbientLight(b.color,b.intensity)}).light}}]);return a}(w),Na.defaults=m({},w.defaults,{color:16777215,intensity:1}),Oa),Pa,Qa,cc=(Qa=Pa=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);b=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults));b.wrapShadow();return b}r(a,c);l(a,
[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new d.DirectionalLight(b.color,b.intensity)}).light}}]);return a}(w),Pa.defaults=m({},w.defaults,{color:16777215,intensity:1}),Qa),Ra,Sa,dc=(Sa=Ra=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}r(a,c);l(a,[{key:"build",value:function(){var b=0<
arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new d.HemisphereLight(b.skyColor,b.groundColor,b.intensity)}).light}}]);return a}(w),Ra.defaults=m({},w.defaults,{skyColor:16777215,groundColor:16777215,intensity:1}),Sa),Ta,Ua,ec=(Ua=Ta=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);b=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults));b.wrapShadow();return b}r(a,c);l(a,[{key:"build",value:function(){var b=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new d.PointLight(b.color,b.intensity,b.distance,b.decay)}).light}}]);return a}(w),Ta.defaults=m({},w.defaults,{color:16777215,intensity:1,distance:100,decay:1}),Ua),Va,Wa,fc=(Wa=Va=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);b=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults));b.wrapShadow();return b}r(a,c);l(a,[{key:"build",value:function(){var b=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new d.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay)}).light}}]);return a}(w),Va.defaults=m({},w.defaults,{color:16777215,intensity:1,distance:100,angle:Math.PI/3,exponent:0,decay:1}),Wa),Xa,Ya,gc=(Ya=Xa=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}r(a,c);l(a,
[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new d.RectAreaLight(b.color,b.intensity,b.width,b.height)}).light}}]);return a}(w),Xa.defaults=m({},w.defaults,{color:16777215,intensity:1,width:10,height:10}),Ya),Za,$a,hc=($a=Za=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}r(a,c);l(a,[{key:"build",
value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new d.CubeCamera(b.near,b.far,b.cubeResolution)}).camera}}]);return a}(C),Za.defaults=m({},C.defaults,{near:1,far:1E3,cubeResolution:128}),$a),ab,bb,ic=(bb=ab=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&
void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new d.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far)}).camera}}]);return a}(C),ab.defaults=m({},C.defaults,{near:1,far:1E3,left:z.innerWidth/-2,right:z.innerWidth/2,top:z.innerHeight/2,bottom:z.innerHeight/-2}),bb),cb,db,eb=(db=cb=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}r(a,c);
l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new d.PerspectiveCamera(b.fov,b.aspect,b.near,b.far)}).camera}}]);return a}(C),cb.defaults=m({},C.defaults,{near:1,far:1E3,fov:75,aspect:z.innerWidth/z.innerHeight}),db),S,fb,jc=(fb=S=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}
r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.BoxBufferGeometry:d.BoxGeometry)(b.geometry.width,b.geometry.height,b.geometry.depth,b.geometry.widthSegments,b.geometry.heightSegments,
b.geometry.depthSegments)}}]);return a}(h),S.defaults=m({},h.defaults,{geometry:{width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1}}),S.instructions=m({},h.instructions,{geometry:"width height depth widthSegments heightSegments depthSegements".split(" ")}),fb),T,gb,kc=(gb=T=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}r(a,c);l(a,
[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.CircleBufferGeometry:d.CircleGeometry)(b.geometry.radius,b.geometry.segments,b.geometry.thetaStart,b.geometry.thetaLength)}}]);
return a}(h),T.defaults=m({},h.defaults,{geometry:{radius:50,segments:8,thetaStart:0,thetaLength:2*Math.PI}}),T.instructions=m({},h.instructions,{geometry:["radius","segments","thetaStart","thetaLength"]}),gb),Y,hb,lc=(hb=Y=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",
c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.ConeBufferGeometry:d.ConeGeometry)(b.geometry.radius,b.geometry.height,b.geometry.radiusSegments,
b.geometry.heightSegments,b.geometry.openEnded,b.geometry.thetaStart,b.geometry.thetaLength)}}]);return a}(h),Y.defaults=m({},h.defaults,{geometry:{radius:20,height:100,radiusSegments:32,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}}),Y.instructions=m({},h.instructions,{geometry:"radius height radiusSegments heightSegments openEnded thetaStart thetaLength".split(" ")}),hb),Z,ib,mc=(ib=Z=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,
a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.CylinderBufferGeometry:d.CylinderGeometry)(b.geometry.radiusTop,b.geometry.radiusBottom,b.geometry.height,b.geometry.radiusSegments,b.geometry.heightSegments,b.geometry.openEnded,b.geometry.thetaStart,b.geometry.thetaLength)}}]);return a}(h),Z.defaults=m({},h.defaults,{geometry:{radiusTop:0,radiusBottom:1,height:1,radiusSegments:32,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}}),Z.instructions=m({},
h.instructions,{geometry:"radiusTop radiusBottom height radiusSegments heightSegments openEnded thetaStart thetaLength".split(" ")}),ib),aa,jb,nc=(jb=aa=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.DodecahedronBufferGeometry:d.DodecahedronGeometry)(b.geometry.radius,b.geometry.detail)}}]);return a}(h),aa.defaults=m({},h.defaults,{geometry:{radius:1,detail:0}}),
aa.instructions=m({},h.instructions,{geometry:["radius","detail"]}),jb),ba,kb,oc=(kb=ba=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,
b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=new d.ExtrudeGeometry(b.geometry.shapes,b.geometry.options);return b.buffer?(new d.BufferGeometry).fromGeometry(a):a}}]);return a}(h),ba.defaults=m({},h.defaults,{geometry:{shapes:[],options:{}}}),ba.instructions=m({},h.instructions,{geometry:["shapes",
"options"]}),kb),ca,lb,pc=(lb=ca=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});
return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.IcosahedronBufferGeometry:d.IcosahedronGeometry)(b.geometry.radius,b.geometry.detail)}}]);return a}(h),ca.defaults=m({},h.defaults,{geometry:{radius:1,detail:0}}),ca.instructions=m({},h.instructions,{geometry:["radius","detail"]}),lb),da,mb,qc=(mb=da=function(c){function a(){var b=0<arguments.length&&void 0!==
arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},
{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.LatheBufferGeometry:d.LatheGeometry)(b.geometry.points)}}]);return a}(h),da.defaults=m({},h.defaults,{geometry:{points:[]}}),da.instructions=m({},h.instructions,{geometry:["points"]}),mb),ea,nb,rc=(nb=ea=function(c){function a(b){g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}r(a,c);l(a,[{key:"build",value:function(){var b=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Line(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=b.buffer?new d.BufferGeometry:new d.Geometry;if(b.buffer){for(var b=b.curve.getPoints(b.points),c=new Float32Array(3*b.length),e=0,f=b.length;e<f;e++){var g=3*e;c[g]=b[e].x;c[g+1]=b[e].y;
c[g+2]=b[e].z}a.addAttribute("position",new d.BufferAttribute(c,3))}else a.vertices=b.curve.getPoints(b.points);return a}}]);return a}(h),ea.defaults=m({},h.defaults,{curve:null,points:50}),ea.instructions=m({},h.instructions,{geometry:["curve","points"]}),nb),fa,ob,pb=(ob=fa=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions,!1))}r(a,c);l(a,null,[{key:"filter",
value:function(b,a){return function e(b){b.children.forEach(function(c,d){c.children&&e(c);a(c)||b.children.splice(d,1)});return b}(b)}}]);l(a,[{key:"build",value:function(){var b=this,a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(c){a.texturePath&&a.loader.setTexturePath(a.texturePath);a.loader.load(a.url,function(){for(var d=arguments.length,f=Array(d),n=0;n<d;n++)f[n]=arguments[n];a.onLoad.apply(a,f);d=a.parser.apply(b,f);a.material&&(d.material=a.material);
c(d)},a.onProgress,a.onError)})}}]);return a}(h),fa.defaults=m({},h.defaults,{url:"",loader:new d.JSONLoader,onLoad:function(){},onProgress:function(){},onError:function(){},texturePath:null,useCustomMaterial:!1,parser:function(c,a){c=this.applyBridge({geom:c,mat:a});return this.applyBridge({mesh:new d.Mesh(c.geom,c.mat)}).mesh}}),fa.instructions=m({},h.instructions),ob),qb,rb,sc=(rb=qb=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,
(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&
void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.OctahedronBufferGeometry:d.OctahedronGeometry)(b.geometry.radius,b.geometry.detail)}}]);return a}(h),qb.defaults=m({},h.defaults,{geometry:{radius:1,detail:0}}),rb),sb,tb,tc=(tb=sb=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&
void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.ParametricBufferGeometry:d.ParametricGeometry)(b.geometry.func,b.geometry.slices,b.geometry.stacks)}}]);return a}(h),sb.defaults=m({},h.defaults,{geometry:{func:function(c,a){return new d.Vector3(c,
a,0)},slices:10,stacks:10}}),tb),ga,ub,uc=(ub=ga=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),
material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.PlaneBufferGeometry:d.PlaneGeometry)(b.geometry.width,b.geometry.height,b.geometry.wSegments,b.geometry.hSegments)}}]);return a}(h),ga.defaults=m({},h.defaults,{geometry:{width:10,height:10,wSegments:1,hSegments:1}}),ga.instructions=m({},h.instructions,{geometry:["width","height",
"wSegments","hSegments"]}),ub),J,vb,wb=[-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1],xb=[2,1,0,0,3,2,0,4,7,7,3,0,0,1,5,5,4,0,1,2,6,6,5,1,2,3,7,7,6,2,4,5,6,6,7,4],vc=(vb=J=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",
value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.PolyhedronBufferGeometry:d.PolyhedronGeometry)(b.geometry.verticesOfCube,b.geometry.indicesOfFaces,b.geometry.radius,b.geometry.detail)}}]);
return a}(h),J.verticesOfCube=wb,J.indicesOfFaces=xb,J.defaults=m({},h.defaults,{geometry:{verticesOfCube:wb,indicesOfFaces:xb,radius:6,detail:2}}),J.instructions=m({},h.instructions,{geometry:["verticesOfCube","indicesOfFaces","radius","detail"]}),vb),ha,yb,wc=(yb=ha=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||
Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.RingBufferGeometry:d.RingGeometry)(b.geometry.innerRadius,
b.geometry.outerRadius,b.geometry.thetaSegments,b.geometry.phiSegments,b.geometry.thetaStart,b.geometry.thetaLength)}}]);return a}(h),ha.defaults=m({},h.defaults,{geometry:{innerRadius:0,outerRadius:50,thetaSegments:8,phiSegments:8,thetaStart:0,thetaLength:2*Math.PI}}),ha.instructions=m({},h.defaults,{geometry:"innerRadius outerRadius thetaSegments phiSegments thetaStart thetaLength".split(" ")}),yb),ia,zb,xc=(zb=ia=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:
{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.ShapeBufferGeometry:d.ShapeGeometry)(b.geometry.shapes)}}]);return a}(h),ia.defaults=m({},h.defaults,{geometry:{shapes:[]}}),ia.instructions=m({},h.instructions,{geometry:["shapes"]}),zb),ja,Ab,yc=(Ab=ja=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}r(a,c);l(a,[{key:"build",
value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.SphereBufferGeometry:d.SphereGeometry)(b.geometry.radius,b.geometry.widthSegments,b.geometry.heightSegments)}}]);return a}(h),ja.defaults=m({},
h.defaults,{geometry:{radius:1,widthSegments:8,heightSegments:6}}),ja.instructions=m({},h.instructions,{geometry:["radius","widthSegments","heightSegments"]}),Ab),ka,Bb,zc=(Bb=ka=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",
value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.TetrahedronBufferGeometry:d.TetrahedronGeometry)(b.geometry.radius,b.geometry.detail)}}]);return a}(h),ka.defaults=m({},h.defaults,{geometry:{radius:1,
detail:0}}),ka.instructions=m({},h.instructions,{geometry:["radius","detail"]}),Bb),K,Cb,Ac=(Cb=K=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);return q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}r(a,c);l(a,null,[{key:"load",value:function(b){var c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.loader;return new Promise(function(a){c.load(b,a)})}}]);l(a,[{key:"build",value:function(){var b=this,
c=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,f=new Promise(function(a){(c.font instanceof Promise?c.font:Promise.resolve(c.font)).then(function(e){e=b.applyBridge({geometry:new d.TextGeometry(c.text,Object.assign(c.geometry,{font:e})),material:c.material});a(b.applyBridge({mesh:new d.Mesh(e.geometry,e.material)}).mesh)})});v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wait",this).call(this,f);return f}}]);return a}(h),K.defaults=m({},h.defaults,{text:"Hello World!",
font:null,geometry:{size:12,height:50,curveSegments:12,font:new d.Font,bevelEnabled:!1,bevelThickness:10,bevelSize:8}}),K.instructions=m({},h.instructions),K.loader=new d.FontLoader,Cb),la,Db,Bc=(Db=la=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}
r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new d.TorusGeometry(b.geometry.radius,b.geometry.tube,b.geometry.radialSegments,b.geometry.tubularSegments,b.geometry.arc)}}]);return a}(h),
la.defaults=m({},h.defaults,{geometry:{radius:100,tube:40,radialSegments:8,tubularSegments:6,arc:2*Math.PI}}),la.instructions=m({},h.instructions,{geometry:["radius","tube","radialSegments","tubularSegments","arc"]}),Db),ma,Eb,Cc=(Eb=ma=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),
"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.TorusKnotBufferGeometry:d.TorusKnotGeometry)(b.geometry.radius,b.geometry.tube,b.geometry.radialSegments,
b.geometry.tubularSegments,b.geometry.p,b.geometry.q)}}]);return a}(h),ma.defaults=m({},h.defaults,{geometry:{radius:100,tube:40,radialSegments:64,tubularSegments:8,p:2,q:3}}),ma.instructions=m({},h.instructions,{geometry:"radius tube radialSegments tubularSegments p q".split(" ")}),Eb),na,Fb,Dc=(Fb=na=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&
(c.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",c).call(c));return c}r(a,c);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.params,b=this.applyBridge({geometry:this.buildGeometry(b),material:b.material});return this.applyBridge({mesh:new d.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return new (b.buffer?d.TubeBufferGeometry:
d.TubeGeometry)(b.geometry.path,b.geometry.segments,b.geometry.radius,b.geometry.radiusSegments,b.geometry.closed)}}]);return a}(h),na.defaults=m({},h.defaults,{geometry:{path:new d.LineCurve3(new d.Vector3(0,0,0),new d.Vector3(0,0,1)),segments:20,radius:2,radiusSegments:8,closed:!1}}),na.instructions=m({},h.instructions,{geometry:["path","segments","radius","radiusSegments","closed"]}),Fb),Ec=function(c){function a(){g(this,a);for(var b=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,{})),
c=arguments.length,f=Array(c),e=0;e<c;e++)f[e]=arguments[e];for(c=0;c<f.length;c++)e=f[c],e instanceof B?e.addTo(b):e instanceof d.Object3D&&b.native.add(e);return b}r(a,c);l(a,[{key:"build",value:function(){return new d.Object3D}}]);return a}(h),Fc=function(){function c(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:document.body;g(this,c);a.container?(console.warn("ElementModule now accepts only argument which is a DOM object, not a params object."),this.container=a.container):this.container=
a;this.createElement()}l(c,[{key:"createElement",value:function(){this.element=window.document.createElement("div");this.element.className="whs-app";this.element.style.width="inherit";this.element.style.height="inherit";this.element.style.position="relative"}},{key:"manager",value:function(a){a.set("element",this.element);a.set("container",this.container)}},{key:"integrate",value:function(a){a.container.appendChild(a.element)}}]);return c}(),Gb,Hb,Ib,Gc=(Hb=Gb=function(){function c(){var a=0<arguments.length&&
void 0!==arguments[0]?arguments[0]:{},b=arguments[1];g(this,c);Ib.call(this);var a=this.params=Object.assign({width:window.innerWidth,height:window.innerHeight,resolution:new d.Vector2(1,1),pixelRatio:window.devicePixelRatio,bgColor:0,bgOpacity:1,renderer:{},fix:function(){}},a),f=a.bgColor,u=a.bgOpacity,e=a.pixelRatio,m=a.width,l=a.height,h=a.resolution,k=a.fix;this.renderer=new d.WebGLRenderer(a.renderer);this.effects=[];this.renderer.setClearColor(f,u);e&&this.renderer.setPixelRatio(e);this.setSize(Number(m*
h.x).toFixed(),Number(l*h.y).toFixed());for(var q in b)b[q]&&this.applyAdditional(q);k(this.renderer)}l(c,[{key:"applyAdditional",value:function(a){c.additional[a].apply(this,[this.renderer])}},{key:"integrateRenderer",value:function(a,b,c){var d=this;this.scene=b;this.camera=c;this.attachToCanvas(a);return new F(function(){return d.renderer.render(d.scene,d.camera)})}},{key:"effect",value:function(a){var b=this,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(){a.render(b.scene,
b.camera)};this.renderLoop.stop();var d=this.renderer.getSize();a.setSize(d.width,d.height);c=new F(c);this.effects.push(c);this.enabled&&c.start(this.app);return this}},{key:"setSize",value:function(a,b){this.renderer&&this.renderer.setSize(a,b)}},{key:"attachToCanvas",value:function(a){var b=this.renderer.domElement;a.appendChild(b);b.style.width="100%";b.style.height="100%"}},{key:"stop",value:function(){this.enabled=!1;this.renderLoop.stop();this.effects.forEach(function(a){return a.stop()})}},
{key:"play",value:function(){this.enabled=!0;this.renderLoop.start();this.effects.forEach(function(a){return a.start()})}},{key:"manager",value:function(a){var b=this;a.define("rendering");a.set("renderer",this.renderer);this.app=a.handler;this.renderLoop=this.integrateRenderer(a.get("element"),a.get("scene"),a.get("camera").native);a.update({element:function(a){b.attachToCanvas(a)},scene:function(a){b.scene=a},camera:function(a){b.camera=a.native}})}},{key:"integrate",value:function(a){var b=this;
a.renderLoop.start(this);a.effects.forEach(function(a){return a.start(b)})}},{key:"dispose",value:function(){this.stop();this.renderer.forceContextLoss()}}]);return c}(),Gb.additional={shadow:function(c){c.shadowMap.enabled=!0}},Ib=function(){this.enabled=!0},Hb),Hc=function(){function c(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;g(this,c);this.scene=a?null:new d.Scene}l(c,[{key:"manager",value:function(a){a.set("scene",this.scene)}},{key:"integrate",value:function(a){this.children=
[];this.add=function(b){var c=this;b.parent=this;return new Promise(function(d,e){b.defer(function(){var f=b.native;f||e();var n=c.applyBridge({onAdd:b}).onAdd,g=function(){a.scene.add(f);c.children.push(b);d(b)};n instanceof Promise?n.then(g):g()})})};this.remove=function(b){b.parent=null;a.scene.remove(b.native)};this.setScene=function(b){a.scene=b;this.manager.set("scene",b)}}}]);return c}(),Ic=function(){function c(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,c);this.params=
Object.assign({auto:!0},a);this.callbacks=[this.setSize.bind(this)]}l(c,[{key:"setSize",value:function(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:1,b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:1;this.camera.native.aspect=a/b;this.camera.native.updateProjectionMatrix();this.rendering&&this.rendering.setSize(a,b)}},{key:"trigger",value:function(){var a=this.container,b=a.offsetHeight,c=this.resolution,d=Number(a.offsetWidth*c.x).toFixed(),e=Number(b*c.y).toFixed();this.callbacks.forEach(function(a){a(d,
e)})}},{key:"addAutoresize",value:function(){this.container=this.getContainer();this.resolution=this.getResolution();this.params.auto&&window.addEventListener("resize",this.trigger.bind(this))}},{key:"addCallback",value:function(a){this.callbacks.push(a)}},{key:"manager",value:function(a){a.define("resize");this.rendering=a.get("renderer");this.camera=a.get("camera");this.getResolution=function(){return a.use("rendering").params.resolution};this.getContainer=function(){return a.get("container")};
this.addAutoresize()}}]);return c}(),Jb=function(){return d.ShaderMaterial.call(this,{type:"CopyMaterial",uniforms:{tDiffuse:new d.Uniform(null),opacity:new d.Uniform(1)},fragmentShader:"uniform sampler2D tDiffuse;\r\nuniform float opacity;\r\n\r\nvarying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvec4 texel = texture2D(tDiffuse, vUv);\r\n\tgl_FragColor = opacity * texel;\r\n\r\n}\r\n",vertexShader:"varying vec2 vUv;\r\n\r\nvoid main() {\r\n\r\n\tvUv = uv;\r\n\tgl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\r\n\r\n}\r\n",
depthWrite:!1,depthTest:!1})||this};$jscomp.inherits(Jb,d.ShaderMaterial);var x=function(c,a,b){c=void 0===c?new d.Scene:c;a=void 0===a?new d.OrthographicCamera(-1,1,1,-1,0,1):a;b=void 0===b?new d.Mesh(new d.PlaneBufferGeometry(2,2),null):b;this.name="Pass";this.scene=c;this.camera=a;this.quad=b;null!==this.quad&&(this.quad.frustumCulled=!1,null!==this.scene&&this.scene.add(this.quad));this.needsSwap=!1;this.enabled=!0;this.renderToScreen=!1};x.prototype.render=function(c,a,b,d,f){throw Error("Render method not implemented!");
};x.prototype.setSize=function(c,a){};x.prototype.initialise=function(c,a){};x.prototype.dispose=function(){var c=Object.keys(this),a,c=$jscomp.makeIterator(c);for(a=c.next();!a.done;a=c.next())a=a.value,null!==this[a]&&"function"===typeof this[a].dispose&&(this[a].dispose(),this[a]=null)};var Kb=new d.Color,oa=function(c){c=void 0===c?{}:c;var a=x.call(this,null,null,null)||this;a.name="ClearPass";a.clearColor=void 0!==c.clearColor?c.clearColor:null;a.clearAlpha=void 0!==c.clearAlpha?c.clearAlpha:
0;return a};$jscomp.inherits(oa,x);oa.prototype.render=function(c,a){var b=this.clearColor;if(null!==b){Kb.copy(c.getClearColor());var d=c.getClearAlpha();c.setClearColor(b,this.clearAlpha)}c.setRenderTarget(this.renderToScreen?null:a);c.clear();null!==b&&c.setClearColor(Kb,d)};var pa=function(){var c=x.call(this,null,null,null)||this;c.name="ClearMaskPass";return c};$jscomp.inherits(pa,x);pa.prototype.render=function(c){c.state.buffers.stencil.setTest(!1)};var qa=function(c,a,b){b=void 0===b?{}:
b;c=x.call(this,c,a,null)||this;c.name="RenderPass";c.clearPass=new oa(b);c.overrideMaterial=void 0!==b.overrideMaterial?b.overrideMaterial:null;c.clearDepth=void 0!==b.clearDepth?b.clearDepth:!1;c.clear=void 0!==b.clear?b.clear:!0;return c};$jscomp.inherits(qa,x);qa.prototype.render=function(c,a){var b=this.scene;a=this.renderToScreen?null:a;this.clear?this.clearPass.render(c,a):this.clearDepth&&(c.setRenderTarget(a),c.clearDepth());b.overrideMaterial=this.overrideMaterial;c.render(b,this.camera,
a);b.overrideMaterial=null};var ra=function(c,a){c=x.call(this,c,a,null)||this;c.name="MaskPass";c.inverse=!1;c.clearStencil=!0;return c};$jscomp.inherits(ra,x);ra.prototype.render=function(c,a,b){var d=c.context,f=c.state,e=this.scene,g=this.camera,m=this.inverse?0:1,l=1-m;f.buffers.color.setMask(!1);f.buffers.depth.setMask(!1);f.buffers.color.setLocked(!0);f.buffers.depth.setLocked(!0);f.buffers.stencil.setTest(!0);f.buffers.stencil.setOp(d.REPLACE,d.REPLACE,d.REPLACE);f.buffers.stencil.setFunc(d.ALWAYS,
m,4294967295);f.buffers.stencil.setClear(l);this.clearStencil&&(c.setRenderTarget(a),c.clearStencil(),c.setRenderTarget(b),c.clearStencil());c.render(e,g,a);c.render(e,g,b);f.buffers.color.setLocked(!1);f.buffers.depth.setLocked(!1);f.buffers.stencil.setFunc(d.EQUAL,1,4294967295);f.buffers.stencil.setOp(d.KEEP,d.KEEP,d.KEEP)};var M=function(c,a){a=void 0===a?"tDiffuse":a;var b=x.call(this)||this;b.name="ShaderPass";b.needsSwap=!0;b.material=c;b.quad.material=b.material;b.textureID=a;return b};$jscomp.inherits(M,
x);M.prototype.render=function(c,a,b){void 0!==this.material.uniforms[this.textureID]&&(this.material.uniforms[this.textureID].value=a.texture);c.render(this.scene,this.camera,this.renderToScreen?null:b)};new d.Vector3;new d.Vector3;var A=function(c,a){a=void 0===a?{}:a;this.renderer=void 0===c?null:c;this.writeBuffer=this.readBuffer=null;null!==this.renderer&&(this.renderer.autoClear=!1,this.readBuffer=this.createBuffer(void 0!==a.depthBuffer?a.depthBuffer:!0,void 0!==a.stencilBuffer?a.stencilBuffer:
!1,void 0!==a.depthTexture?a.depthTexture:!1),this.writeBuffer=this.readBuffer.clone());this.copyPass=new M(new Jb);this.passes=[]};A.prototype.replaceRenderer=function(c){var a=this.renderer;if(null!==a&&a!==c){this.renderer=c;this.renderer.autoClear=!1;var b=a.domElement.parentNode;var d=a.getSize();var f=c.getSize();null!==b&&(b.removeChild(a.domElement),b.appendChild(c.domElement));d.width===f.width&&d.height===f.height||this.setSize()}return a};A.prototype.createBuffer=function(c,a,b){var f=
this.renderer.getSize(),g=this.renderer.getPixelRatio(),e=this.renderer.context.getContextAttributes().alpha;c=new d.WebGLRenderTarget(f.width*g,f.height*g,{minFilter:d.LinearFilter,magFilter:d.LinearFilter,format:e?d.RGBAFormat:d.RGBFormat,depthBuffer:c,stencilBuffer:a,depthTexture:b?new d.DepthTexture:null});b&&a&&(c.depthTexture.format=d.DepthStencilFormat,c.depthTexture.type=d.UnsignedInt248Type);c.texture.name="EffectComposer.Buffer";c.texture.generateMipmaps=!1;return c};A.prototype.addPass=
function(c,a){var b=this.renderer,d=b.getSize(),f=b.getPixelRatio();c.setSize(d.width*f,d.height*f);c.initialise(b,b.context.getContextAttributes().alpha);void 0!==a?this.passes.splice(a,0,c):this.passes.push(c)};A.prototype.removePass=function(c){this.passes.splice(this.passes.indexOf(c),1)};A.prototype.render=function(c){var a=this.passes,b=this.renderer,d=this.copyPass,f=this.readBuffer,e=this.writeBuffer,g=!1,m;var l=0;for(m=a.length;l<m;++l){var h=a[l];if(h.enabled){h.render(b,f,e,c,g);if(h.needsSwap){if(g){var k=
b.context;k.stencilFunc(k.NOTEQUAL,1,4294967295);d.render(b,f,e);k.stencilFunc(k.EQUAL,1,4294967295)}k=f;f=e;e=k}h instanceof ra?g=!0:h instanceof pa&&(g=!1)}}};A.prototype.setSize=function(c,a){var b=this.passes,d=this.renderer.getSize(),f=this.renderer.getPixelRatio();if(void 0===c||void 0===a)c=d.width,a=d.height;this.renderer.setSize(c,a);c*=f;a*=f;this.readBuffer.setSize(c,a);this.writeBuffer.setSize(c,a);d=0;for(f=b.length;d<f;++d)b[d].setSize(c,a)};A.prototype.reset=function(c){var a=this.readBuffer.depthBuffer,
b=this.readBuffer.stencilBuffer,d=null!==this.readBuffer.depthTexture;this.dispose(void 0===c?this.createBuffer(a,b,d):c)};A.prototype.dispose=function(c){var a=this.passes;null!==this.readBuffer&&null!==this.writeBuffer&&(this.readBuffer.dispose(),this.writeBuffer.dispose(),this.writeBuffer=this.readBuffer=null);for(;0<a.length;)a.pop().dispose();void 0!==c?(this.readBuffer=c,this.writeBuffer=this.readBuffer.clone()):this.copyPass.dispose()};$jscomp.global.Object.defineProperties(A.prototype,{depthTexture:{configurable:!0,
enumerable:!0,get:function(){return this.readBuffer.depthTexture},set:function(c){this.readBuffer.depthTexture=c;this.writeBuffer.depthTexture=c}}});var Lb,Mb,Nb=function(c,a){c[a]||((2<arguments.length&&void 0!==arguments[2]?arguments[2]:1)&&console.warn("@PostProcessorModule: pass."+a+"() was not found.",c),c[a]=function(){})},Jc=(Mb=Lb=function(){function c(){var a=this,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:c.defaults;g(this,c);this.currentPass=null;this.defer=new Promise(function(b){a.resolve=
b});this.debug=b.debug;this.params=b}l(c,[{key:"manager",value:function(a){var b=this;a.define("postprocessor");this.effects=a.use("rendering").effects;this.renderer=a.get("renderer");this.scene=a.get("scene");this.camera=a.get("camera");this.composer=new A(this.renderer,this.params);a.use("rendering").stop();var c=this.composer;this.renderLoop=(new F(function(a){return c.render(a.getDelta())})).start(a.handler);a.update({renderer:function(a){b.composer.replaceRenderer(a)},scene:function(a){b.scene=
a},camera:function(a){b.camera=a}});this.resolve()}},{key:"render",value:function(){var a=this;this.defer.then(function(){var b=new qa(a.scene,a.camera.native);a.composer.addPass(b);a.currentPass=b});return this}},{key:"pass",value:function(a){var b=this;this.defer.then(function(){Nb(a,"setSize",b.debug);Nb(a,"initialise",b.debug);b.composer.addPass(a);b.currentPass=a});return this}},{key:"shader",value:function(a){var b=this,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"readBuffer";this.defer.then(function(){a.uniforms[c]||
(a.uniforms[c]={value:null});var d=new M(a,c);b.composer.addPass(d);b.currentPass=d});return this}},{key:"get",value:function(a){return a?this.composer.passes.filter(function(b){return b.name===a})[0]:this.currentPass}},{key:"renderToScreen",value:function(){var a=this,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!0;this.defer.then(function(){a.currentPass.renderToScreen=b});return this}}]);return c}(),Lb.defaults={debug:!0},Mb),sa=function(){function c(){g(this,c)}l(c,[{key:"manager",
value:function(a){a.define("events");this.element=a.get("renderer").domElement}},{key:"patchEvents",value:function(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:this;(2<arguments.length&&void 0!==arguments[2]?arguments[2]:[]).forEach(function(c){return a.addEventListener(c,function(a){return b.emit(c,a)})})}},{key:"integrate",value:function(a){var b=a.patchEvents;b(a.element,this,"mousemove mouseup contextmenu mousedown click wheel touchstart touchend touchmove keydown keyup keypress".split(" "))}}]);
return c}(),Kc=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:!1;g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));c.mouse=new d.Vector2;c.raycaster=new d.Raycaster;c.world=null;c.canvas=null;c.projectionPlane=new d.Plane(new d.Vector3(0,0,1),0);c.globalMovement=b;return c}r(a,c);l(a,[{key:"update",value:function(a,c,d){var b=this.canvas.getBoundingClientRect();d=d||a.clientY;this.mouse.x=((c||a.clientX)-b.left)/(b.right-b.left)*2-1;
this.mouse.y=2*-((d-b.top)/(b.bottom-b.top))+1;this.projectionPlane.normal.copy(this.camera.getWorldDirection());this.raycaster.setFromCamera(this.mouse,this.camera);this.emit("move")}},{key:"manager",value:function(a){a.define("mouse");a.require("events",function(){return new sa});this.canvas=a.get("renderer").domElement;this.camera=a.get("camera").native}},{key:"integrate",value:function(a){var b=this;["click","mousedown","mouseup","mousemove"].forEach(function(c){return b.on(c,function(b){return a.emit(c,
b)})});a.globalX=0;a.globalY=0;this.on("mousemove",function(b){null!==document.pointerLockElement?(a.globalX+=b.movementX,a.globalY+=b.movementY,a.update(b,a.globalX,a.globalY)):a.update(b)})}},{key:"track",value:function(a){var b=this,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0,d=!1;this.on("move",function(){b.hovers(a,c)?d?a.emit("mousemove"):(a.emit("mouseover"),d=!0):d&&(a.emit("mouseout"),d=!1)});this.on("click",function(){d?a.emit("click"):a.emit("offClick")});this.on("mousedown",
function(){d&&a.emit("mousedown")});this.on("mouseup",function(){d&&a.emit("mouseup")})}},{key:"intersection",value:function(a){var b=a.native,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;if(0<b.children.length&&c){var d=[];b.traverse(function(a){return d.push(a)});return this.raycaster.intersectObjects(d)}return this.raycaster.intersectObject(b)}},{key:"project",value:function(){return this.raycaster.ray.intersectPlane(0<arguments.length&&void 0!==arguments[0]?arguments[0]:this.projectionPlane,
arguments[1])}},{key:"hovers",value:function(a){return 0<this.intersection(a,1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0).length}},{key:"ray",get:function(){return this.raycaster.ray}},{key:"x",get:function(){return this.mouse.x}},{key:"y",get:function(){return this.mouse.y}}]);return a}(D),Ob=function(){function c(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,c);this.params=Object.assign({controls:!1,fix:function(a){return a},update:function(a){this.controls.update(a.getDelta())}},
a);this.controls=this.params.controls;this.update=this.params.update}l(c,null,[{key:"from",value:function(a){return new c({controls:a})}}]);l(c,[{key:"manager",value:function(a){a.define("controls");a.require("events",function(){return new sa})}},{key:"setControls",value:function(a){this.controls=a;return this}},{key:"setUpdate",value:function(a){this.update=a;return this}},{key:"integrate",value:function(a){a.updateLoop=new F(a.update.bind(a));a.updateLoop.start(this)}}]);return c}(),Lc=function(){function c(){var a=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=arguments[1];g(this,c);this.params=Object.assign({color:15716789,density:.02,near:10,far:1E3},a);b&&"exp2"!==b?"linear"===b&&(this.fog=new d.Fog(this.params.color,this.params.near,this.params.far)):this.fog=new d.FogExp2(this.params.color,this.params.density)}l(c,[{key:"manager",value:function(a){a.set("fog",this.fog);a.get("scene").fog=this.fog}}]);return c}(),Mc=function(c,a){return c===a||c&&c.equals&&c.equals(a)?!0:!1},Nc=function(){function c(){var a=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:Mc;g(this,c);this.store=p(c.actionGenerate(a));this.configuration={};this.prevConfig=this.currentConfig="default"}l(c,null,[{key:"actionGenerate",value:function(a){return function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[{},""],c=arguments[1],d=c.key,c=c.data;if(a(b[0][d],c))return b;b[0][d]=c;b[1]=d;return b}}}]);l(c,[{key:"default",value:function(a){this.config({default:a});return this}},{key:"setEqualCheck",value:function(a){this.store.replaceReducer(c.actionGenerate(a))}},
{key:"manager",value:function(a){a.define("state")}},{key:"config",value:function(a){for(var b in a)b&&(this.configuration[b]="default"===b?a[b]:Object.assign({},this.configuration.default,a[b]))}},{key:"update",value:function(){var a=this,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.store.subscribe(function(){var c=a.store.getState(),d=ya(c,2),c=d[0],d=d[1],e=b[d];e&&e(c[d])})}},{key:"to",value:function(a){this.prevConfig=this.currentConfig;this.currentConfig=a;this.set(this.configuration[a]?
this.configuration[a]:this.configuration.default)}},{key:"set",value:function(a){for(var b in a)b&&this.store.dispatch({type:"ADD",key:b,data:a[b]})}},{key:"get",value:function(a){return this.store.getState()[0][a]}},{key:"prev",value:function(a,b,c){return this.prevConfig===a?b:c}},{key:"current",value:function(a,b,c){return this.currentConfig===a?b:c}}]);return c}(),Pc=function(c){function a(b,c,f){g(this,a);var e=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));e.object=b;e.domElement=
void 0===c?document:c;e.eventHandler=f;e.enabled=!0;e.target=new d.Vector3;e.minDistance=0;e.maxDistance=Infinity;e.minZoom=0;e.maxZoom=Infinity;e.minPolarAngle=0;e.maxPolarAngle=Math.PI;e.minAzimuthAngle=-Infinity;e.maxAzimuthAngle=Infinity;e.enableDamping=!1;e.dampingFactor=.25;e.enableZoom=!0;e.zoomSpeed=1;e.enableRotate=!0;e.rotateSpeed=1;e.enablePan=!0;e.keyPanSpeed=7;e.autoRotate=!1;e.autoRotateSpeed=2;e.enableKeys=!0;e.keys={LEFT:37,UP:38,RIGHT:39,BOTTOM:40};e.mouseButtons={ORBIT:d.MOUSE.LEFT,
ZOOM:d.MOUSE.MIDDLE,PAN:d.MOUSE.RIGHT};e.target0=e.target.clone();e.position0=e.object.position.clone();e.zoom0=e.object.zoom;e.getPolarAngle=function(){return u.phi};e.getAzimuthalAngle=function(){return u.theta};e.reset=function(){e.target.copy(e.target0);e.object.position.copy(e.position0);e.object.zoom=e.zoom0;e.object.updateProjectionMatrix();e.dispatchEvent(m);e.update();k=h.NONE};e.update=function(){var a=new d.Vector3,c=(new d.Quaternion).setFromUnitVectors(b.up,new d.Vector3(0,1,0)),f=c.clone().inverse(),
g=new d.Vector3,n=new d.Quaternion;var l=e.object.position;a.copy(l).sub(e.target);a.applyQuaternion(c);u.setFromVector3(a);e.autoRotate&&k===h.NONE&&(p.theta-=2*Math.PI/60/60*e.autoRotateSpeed);u.theta+=p.theta;u.phi+=p.phi;u.theta=Math.max(e.minAzimuthAngle,Math.min(e.maxAzimuthAngle,u.theta));u.phi=Math.max(e.minPolarAngle,Math.min(e.maxPolarAngle,u.phi));u.makeSafe();u.radius*=t;u.radius=Math.max(e.minDistance,Math.min(e.maxDistance,u.radius));e.target.add(v);a.setFromSpherical(u);a.applyQuaternion(f);
l.copy(e.target).add(a);e.object.lookAt(e.target);!0===e.enableDamping?(p.theta*=1-e.dampingFactor,p.phi*=1-e.dampingFactor):p.set(0,0,0);t=1;v.set(0,0,0);x||g.distanceToSquared(e.object.position)>r||8*(1-n.dot(e.object.quaternion))>r?(e.dispatchEvent(m),g.copy(e.object.position),n.copy(e.object.quaternion),x=!1,a=!0):a=!1;return a};e.dispose=function(){e.domElement.removeEventListener("contextmenu",T,!1);e.domElement.removeEventListener("mousedown",M,!1);e.domElement.removeEventListener("wheel",
O,!1);e.domElement.removeEventListener("touchstart",Q,!1);e.domElement.removeEventListener("touchend",S,!1);e.domElement.removeEventListener("touchmove",R,!1);document.removeEventListener("mousemove",L,!1);document.removeEventListener("mouseup",N,!1);window.removeEventListener("keydown",P,!1)};var m={type:"change"},n={type:"start"},l={type:"end"},h={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_DOLLY:4,TOUCH_PAN:5},k=h.NONE,r=1E-6,u=new d.Spherical,p=new d.Spherical,t=1,v=new d.Vector3,x=!1,
w=new d.Vector2,y=new d.Vector2,z=new d.Vector2,A=new d.Vector2,B=new d.Vector2,C=new d.Vector2,D=new d.Vector2,E=new d.Vector2,F=new d.Vector2,U=function(){return Math.pow(.95,e.zoomSpeed)},H=function(){var a=new d.Vector3;return function(b,c){a.setFromMatrixColumn(c,0);a.multiplyScalar(-b);v.add(a)}}(),J=function(){var a=new d.Vector3;return function(b,c){a.setFromMatrixColumn(c,1);a.multiplyScalar(b);v.add(a)}}(),V=function(){var a=new d.Vector3;return function(b,c){var f=e.domElement===document?
e.domElement.body:e.domElement;if(e.object instanceof d.PerspectiveCamera){a.copy(e.object.position).sub(e.target);var g=a.length(),g=g*Math.tan(e.object.fov/2*Math.PI/180);H(2*b*g/f.clientHeight,e.object.matrix);J(2*c*g/f.clientHeight,e.object.matrix)}else e.object instanceof d.OrthographicCamera?(H(b*(e.object.right-e.object.left)/e.object.zoom/f.clientWidth,e.object.matrix),J(c*(e.object.top-e.object.bottom)/e.object.zoom/f.clientHeight,e.object.matrix)):(console.warn("WARNING: OrbitControlsModule.js encountered an unknown camera type - pan disabled."),
e.enablePan=!1)}}(),I=function(a){e.object instanceof d.PerspectiveCamera?t/=a:e.object instanceof d.OrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,e.object.zoom*a)),e.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControlsModule.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)},K=function(a){e.object instanceof d.PerspectiveCamera?t*=a:e.object instanceof d.OrthographicCamera?(e.object.zoom=Math.max(e.minZoom,Math.min(e.maxZoom,
e.object.zoom/a)),e.object.updateProjectionMatrix(),x=!0):(console.warn("WARNING: OrbitControlsModule.js encountered an unknown camera type - dolly/zoom disabled."),e.enableZoom=!1)},M=function(a){if(!1!==e.enabled){a.preventDefault();if(a.button===e.mouseButtons.ORBIT){if(!1===e.enableRotate)return;w.set(a.clientX,a.clientY);k=h.ROTATE}else if(a.button===e.mouseButtons.ZOOM){if(!1===e.enableZoom)return;D.set(a.clientX,a.clientY);k=h.DOLLY}else if(a.button===e.mouseButtons.PAN){if(!1===e.enablePan)return;
A.set(a.clientX,a.clientY);k=h.PAN}k!==h.NONE&&(e.eventHandler.on("mousemove",L,!1),e.eventHandler.on("mouseup",N,!1),e.dispatchEvent(n))}},L=function(a){!1!==e.enabled&&(a.preventDefault(),k===h.ROTATE?!1!==e.enableRotate&&(y.set(a.clientX,a.clientY),z.subVectors(y,w),a=e.domElement===document?e.domElement.body:e.domElement,p.theta-=2*Math.PI*z.x/a.clientWidth*e.rotateSpeed,p.phi-=2*Math.PI*z.y/a.clientHeight*e.rotateSpeed,w.copy(y),e.update()):k===h.DOLLY?!1!==e.enableZoom&&(E.set(a.clientX,a.clientY),
F.subVectors(E,D),0<F.y?I(U()):0>F.y&&K(U()),D.copy(E),e.update()):k===h.PAN&&!1!==e.enablePan&&(B.set(a.clientX,a.clientY),C.subVectors(B,A),V(C.x,C.y),A.copy(B),e.update()))},N=function Oc(a){!1!==e.enabled&&(document.removeEventListener("mousemove",L,!1),document.removeEventListener("mouseup",Oc,!1),e.dispatchEvent(l),k=h.NONE)},O=function(a){!1===e.enabled||!1===e.enableZoom||k!==h.NONE&&k!==h.ROTATE||(a.preventDefault(),a.stopPropagation(),0>a.deltaY?K(U()):0<a.deltaY&&I(U()),e.update(),e.dispatchEvent(n),
e.dispatchEvent(l))},P=function(a){if(!1!==e.enabled&&!1!==e.enableKeys&&!1!==e.enablePan)switch(a.keyCode){case e.keys.UP:V(0,e.keyPanSpeed);e.update();break;case e.keys.BOTTOM:V(0,-e.keyPanSpeed);e.update();break;case e.keys.LEFT:V(e.keyPanSpeed,0);e.update();break;case e.keys.RIGHT:V(-e.keyPanSpeed,0),e.update()}},Q=function(a){if(!1!==e.enabled){switch(a.touches.length){case 1:if(!1===e.enableRotate)return;w.set(a.touches[0].pageX,a.touches[0].pageY);k=h.TOUCH_ROTATE;break;case 2:if(!1===e.enableZoom)return;
var b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;D.set(0,Math.sqrt(b*b+a*a));k=h.TOUCH_DOLLY;break;case 3:if(!1===e.enablePan)return;A.set(a.touches[0].pageX,a.touches[0].pageY);k=h.TOUCH_PAN;break;default:k=h.NONE}k!==h.NONE&&e.dispatchEvent(n)}},R=function(a){if(!1!==e.enabled)switch(a.preventDefault(),a.stopPropagation(),a.touches.length){case 1:if(!1===e.enableRotate)break;if(k!==h.TOUCH_ROTATE)break;y.set(a.touches[0].pageX,a.touches[0].pageY);z.subVectors(y,
w);var b=e.domElement===document?e.domElement.body:e.domElement;p.theta-=2*Math.PI*z.x/b.clientWidth*e.rotateSpeed;p.phi-=2*Math.PI*z.y/b.clientHeight*e.rotateSpeed;w.copy(y);e.update();break;case 2:if(!1===e.enableZoom)break;if(k!==h.TOUCH_DOLLY)break;b=a.touches[0].pageX-a.touches[1].pageX;a=a.touches[0].pageY-a.touches[1].pageY;E.set(0,Math.sqrt(b*b+a*a));F.subVectors(E,D);0<F.y?K(U()):0>F.y&&I(U());D.copy(E);e.update();break;case 3:if(!1===e.enablePan)break;if(k!==h.TOUCH_PAN)break;B.set(a.touches[0].pageX,
a.touches[0].pageY);C.subVectors(B,A);V(C.x,C.y);A.copy(B);e.update();break;default:k=h.NONE}},S=function(a){!1!==e.enabled&&(e.dispatchEvent(l),k=h.NONE)},T=function(a){a.preventDefault()};e.eventHandler.on("contextmenu",T,!1);e.eventHandler.on("mousedown",M,!1);e.eventHandler.on("wheel",O,!1);e.eventHandler.on("touchstart",Q,!1);e.eventHandler.on("touchend",S,!1);e.eventHandler.on("touchmove",R,!1);e.eventHandler.on("keydown",P,!1);e.update();return e}r(a,c);l(a,[{key:"center",get:function(){console.warn("OrbitControls: .center has been renamed to .target");
return this.target}},{key:"noZoom",get:function(){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.");return!this.enableZoom},set:function(a){console.warn("OrbitControls: .noZoom has been deprecated. Use .enableZoom instead.");this.enableZoom=!a}},{key:"noRotate",get:function(){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.");return!this.enableRotate},set:function(a){console.warn("OrbitControls: .noRotate has been deprecated. Use .enableRotate instead.");
this.enableRotate=!a}},{key:"noPan",get:function(){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead.");return!this.enablePan},set:function(a){console.warn("OrbitControls: .noPan has been deprecated. Use .enablePan instead.");this.enablePan=!a}},{key:"noKeys",get:function(){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.");return!this.enableKeys},set:function(a){console.warn("OrbitControls: .noKeys has been deprecated. Use .enableKeys instead.");
this.enableKeys=!a}},{key:"staticMoving",get:function(){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.");return!this.enableDamping},set:function(a){console.warn("OrbitControls: .staticMoving has been deprecated. Use .enableDamping instead.");this.enableDamping=!a}},{key:"dynamicDampingFactor",get:function(){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.");return this.dampingFactor},set:function(a){console.warn("OrbitControls: .dynamicDampingFactor has been renamed. Use .dampingFactor instead.");
this.dampingFactor=a}}]);return a}(d.EventDispatcher),Qc=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,a);var c=q(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b));c.params=Object.assign({follow:!1,object:null,target:new d.Vector3},b);return c}r(a,c);l(a,[{key:"manager",value:function(b){v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"manager",this).call(this,b);var c=this.params,d=c.object,e=c.follow,f=c.target,c=d?d.native:
b.get("camera").native,g=new Pc(c,b.get("element"),b.handler),e=e?function(a){g.update(a.getDelta());g.target.copy(f)}:function(a){g.update(a.getDelta())};this.setControls(g);this.setUpdate(e);b.update({camera:function(a){d||(g.object=a.native)}});g.target.copy(f)}}]);return a}(Ob),Rc=function(){function c(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,c);this.params=Object.assign({attributes:!1},a)}l(c,[{key:"integrate",value:function(a){var b=this;a=a.params;this.g_=function(){var a=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.buildGeometry&&(this.native.geometry=this.buildGeometry(this.updateParams({geometry:a})))};if(a.attributes){a=function(a){a&&Object.defineProperty(b,"g_"+a,{get:function(){return this.native.geometry.parameters[a]},set:function(b){this.native.geometry=this.buildGeometry(this.updateParams({geometry:Pb({},a,b)}))},configurable:!0,enumerable:!0})};for(var c in this.params.geometry)a(c)}}}]);return c}(),Sc=new d.TextureLoader,Tc=function(){function c(){var a=
this;g(this,c);this.textures=[];this.bridge={material:function(a,b){b.textures.forEach(function(b){a[b[0]]=b[1]});return a}};for(var b=arguments.length,f=Array(b),h=0;h<b;h++)f[h]=arguments[h];f.forEach(function(b){var c=b.url,e=b.type,e=void 0===e?"map":e,f=b.offset,f=void 0===f?new d.Vector2(0,0):f,g=b.repeat,g=void 0===g?new d.Vector2(1,1):g,h=b.wrap,h=void 0===h?d.RepeatWrapping:h,k=b.mapping,k=void 0===k?d.UVMapping:k;b=b.fix;b=void 0===b?function(a){return a}:b;c=Sc.load(c);0<h.length?(c.wrapS=
h[0],c.wrapT=h[1]):c.wrapS=c.wrapT=h;c.mapping=k;c.offset.copy(f);c.repeat.copy(g);c.magFilter=d.NearestFilter;c.minFilter=d.LinearMipMapLinearFilter;a.textures.push([e,b(c)])})}l(c,null,[{key:"load",value:function(a){return(new c({url:a})).textures[0][1]}}]);return c}(),Uc=function(){function c(a,b){var f=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{};g(this,c);this.bridge={mesh:function(a,b){a.geometry.skeleton=a.skeleton;b.mixer=new d.AnimationMixer(a.geometry);b.clips=a.geometry.animations;
return a}};this.params=Object.assign({speed:1},f);this.clock=new d.Clock;this.app=a;this.isDeferred=b}l(c,[{key:"play",value:function(a){a=d.AnimationClip.findByName(this.clips,a);this.mixer.clipAction(a).play()}},{key:"update",value:function(){this.mixer&&this.mixer.update(this.clock.getDelta()*this.params.speed)}},{key:"integrate",value:function(a){a.loop=new F(function(){a.update()});a.isDeferred||a.loop.start(a.app)}},{key:"manager",value:function(a){a.define("animation")}}]);return c}(),Vc=function(){function c(a,
b){g(this,c);this.name=a;this.data=b}l(c,[{key:"manager",value:function(a){a.set(this.name,this.data)}}]);return c}(),Wc=function(c){function a(b){var c;g(this,a);console.warn("Model is deprecated. Use Importer instead.");b.geometry&&(b.url=b.geometry.path,b.loader=b.geometry.loader);for(var d=arguments.length,e=Array(1<d?d-1:0),f=1;f<d;f++)e[f-1]=arguments[f];return q(this,(c=a.__proto__||Object.getPrototypeOf(a)).call.apply(c,[this,b].concat(e)))}r(a,c);return a}(pb),Xc=function(){function c(){var a=
0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};g(this,c);console.warn("CameraModule is deprecated. Use DefineModule instead.");this.camera=new eb(a)}l(c,[{key:"integrate",value:function(a){this.add(a.camera)}},{key:"manager",value:function(a){a.set("camera",this.camera)}}]);return c}();f.Component=B;f.MeshComponent=h;f.LightComponent=w;f.CameraComponent=C;f.App=ac;f.Loop=F;f.ModuleManager=N;f.AmbientLight=bc;f.DirectionalLight=cc;f.HemisphereLight=dc;f.PointLight=ec;f.SpotLight=fc;f.AreaLight=
gc;f.CubeCamera=hc;f.OrthographicCamera=ic;f.PerspectiveCamera=eb;f.Box=jc;f.Circle=kc;f.Cone=lc;f.Cylinder=mc;f.Dodecahedron=nc;f.Extrude=oc;f.Icosahedron=pc;f.Lathe=qc;f.Line=rc;f.Importer=pb;f.Octahedron=sc;f.Parametric=tc;f.Plane=uc;f.Polyhedron=vc;f.Ring=wc;f.Shape=xc;f.Sphere=yc;f.Tetrahedron=zc;f.Text=Ac;f.Torus=Bc;f.Torusknot=Cc;f.Tube=Dc;f.Group=Ec;f.extend=y;f.instruct=L;f.transformData=ta;f.toArray=function(c,a){for(var b=[],d=0,f=a.length;d<f;d++)b[d]=c[a[d]];return b};f.ElementModule=
Fc;f.RenderingModule=Gc;f.SceneModule=Hc;f.ResizeModule=Ic;f.PostProcessorModule=Jc;f.VirtualMouseModule=Kc;f.EventsPatchModule=sa;f.ControlsModule=Ob;f.FogModule=Lc;f.StateModule=Nc;f.OrbitControlsModule=Qc;f.DynamicGeometryModule=Rc;f.TextureModule=Tc;f.AnimationModule=Uc;f.DefineModule=Vc;f.Model=Wc;f.CameraModule=Xc;Object.defineProperty(f,"__esModule",{value:!0})});
