UNPKG

whs

Version:

Super-fast 3D framework for Web Applications & Games. Based on Three.js

100 lines 208 kB
var $jscomp=$jscomp||{};$jscomp.scope={};$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(g,c,t){g!=Array.prototype&&g!=Object.prototype&&(g[c]=t.value)};$jscomp.getGlobal=function(g){return"undefined"!=typeof window&&window===g?g:"undefined"!=typeof global&&null!=global?global:g};$jscomp.global=$jscomp.getGlobal(this);$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(g){return $jscomp.SYMBOL_PREFIX+(g||"")+$jscomp.symbolCounter_++}; $jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var g=$jscomp.global.Symbol.iterator;g||(g=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[g]&&$jscomp.defineProperty(Array.prototype,g,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(g){var c=0;return $jscomp.iteratorPrototype(function(){return c<g.length?{done:!1,value:g[c++]}:{done:!0}})}; $jscomp.iteratorPrototype=function(g){$jscomp.initSymbolIterator();g={next:g};g[$jscomp.global.Symbol.iterator]=function(){return this};return g};$jscomp.owns=function(g,c){return Object.prototype.hasOwnProperty.call(g,c)};$jscomp.polyfill=function(g,c,t,u){if(c){t=$jscomp.global;g=g.split(".");for(u=0;u<g.length-1;u++){var r=g[u];r in t||(t[r]={});t=t[r]}g=g[g.length-1];u=t[g];c=c(u);c!=u&&null!=c&&$jscomp.defineProperty(t,g,{configurable:!0,writable:!0,value:c})}}; $jscomp.polyfill("Object.assign",function(g){return g?g:function(c,g){for(var t=1;t<arguments.length;t++){var r=arguments[t];if(r)for(var x in r)$jscomp.owns(r,x)&&(c[x]=r[x])}return c}},"es6-impl","es3");$jscomp.makeIterator=function(g){$jscomp.initSymbolIterator();var c=g[Symbol.iterator];return c?c.call(g):$jscomp.arrayIterator(g)};$jscomp.FORCE_POLYFILL_PROMISE=!1; $jscomp.polyfill("Promise",function(g){function c(){this.batch_=null}function t(c){return c instanceof r?c:new r(function(g,I){g(c)})}if(g&&!$jscomp.FORCE_POLYFILL_PROMISE)return g;c.prototype.asyncExecute=function(c){null==this.batch_&&(this.batch_=[],this.asyncExecuteBatch_());this.batch_.push(c);return this};c.prototype.asyncExecuteBatch_=function(){var c=this;this.asyncExecuteFunction(function(){c.executeBatch_()})};var u=$jscomp.global.setTimeout;c.prototype.asyncExecuteFunction=function(c){u(c, 0)};c.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var c=this.batch_;this.batch_=[];for(var g=0;g<c.length;++g){var r=c[g];delete c[g];try{r()}catch(E){this.asyncThrow_(E)}}}this.batch_=null};c.prototype.asyncThrow_=function(c){this.asyncExecuteFunction(function(){throw c;})};var r=function(c){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var g=this.createResolveAndReject_();try{c(g.resolve,g.reject)}catch(D){g.reject(D)}};r.prototype.createResolveAndReject_= function(){function c(c){return function(h){r||(r=!0,c.call(g,h))}}var g=this,r=!1;return{resolve:c(this.resolveTo_),reject:c(this.reject_)}};r.prototype.resolveTo_=function(c){if(c===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(c instanceof r)this.settleSameAsPromise_(c);else{a:switch(typeof c){case "object":var g=null!=c;break a;case "function":g=!0;break a;default:g=!1}g?this.resolveToNonPromiseObj_(c):this.fulfill_(c)}};r.prototype.resolveToNonPromiseObj_=function(c){var g= void 0;try{g=c.then}catch(D){this.reject_(D);return}"function"==typeof g?this.settleSameAsThenable_(g,c):this.fulfill_(c)};r.prototype.reject_=function(c){this.settle_(2,c)};r.prototype.fulfill_=function(c){this.settle_(1,c)};r.prototype.settle_=function(c,g){if(0!=this.state_)throw Error("Cannot settle("+c+", "+g|"): Promise already settled in state"+this.state_);this.state_=c;this.result_=g;this.executeOnSettledCallbacks_()};r.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var c= this.onSettledCallbacks_,g=0;g<c.length;++g)c[g].call(),c[g]=null;this.onSettledCallbacks_=null}};var x=new c;r.prototype.settleSameAsPromise_=function(c){var g=this.createResolveAndReject_();c.callWhenSettled_(g.resolve,g.reject)};r.prototype.settleSameAsThenable_=function(c,g){var r=this.createResolveAndReject_();try{c.call(g,r.resolve,r.reject)}catch(E){r.reject(E)}};r.prototype.then=function(c,g){function t(c,g){return"function"==typeof c?function(g){try{u(c(g))}catch(m){h(m)}}:g}var u,h,l=new r(function(c, g){u=c;h=g});this.callWhenSettled_(t(c,u),t(g,h));return l};r.prototype.catch=function(c){return this.then(void 0,c)};r.prototype.callWhenSettled_=function(c,g){function r(){switch(t.state_){case 1:c(t.result_);break;case 2:g(t.result_);break;default:throw Error("Unexpected state: "+t.state_);}}var t=this;null==this.onSettledCallbacks_?x.asyncExecute(r):this.onSettledCallbacks_.push(function(){x.asyncExecute(r)})};r.resolve=t;r.reject=function(c){return new r(function(g,r){r(c)})};r.race=function(c){return new r(function(g, r){for(var u=$jscomp.makeIterator(c),h=u.next();!h.done;h=u.next())t(h.value).callWhenSettled_(g,r)})};r.all=function(c){var g=$jscomp.makeIterator(c),u=g.next();return u.done?t([]):new r(function(c,h){function l(g){return function(h){r[g]=h;q--;0==q&&c(r)}}var r=[],q=0;do r.push(void 0),q++,t(u.value).callWhenSettled_(l(r.length-1),h),u=g.next();while(!u.done)})};return r},"es6-impl","es3"); $jscomp.iteratorFromArray=function(g,c){$jscomp.initSymbolIterator();g instanceof String&&(g+="");var t=0,u={next:function(){if(t<g.length){var r=t++;return{value:c(r,g[r]),done:!1}}u.next=function(){return{done:!0,value:void 0}};return u.next()}};u[Symbol.iterator]=function(){return u};return u};$jscomp.polyfill("Array.prototype.keys",function(g){return g?g:function(){return $jscomp.iteratorFromArray(this,function(c){return c})}},"es6-impl","es3"); $jscomp.polyfill("Math.log2",function(g){return g?g:function(c){return Math.log(c)/Math.LN2}},"es6-impl","es3");$jscomp.checkStringArgs=function(g,c,t){if(null==g)throw new TypeError("The 'this' value for String.prototype."+t+" must not be null or undefined");if(c instanceof RegExp)throw new TypeError("First argument to String.prototype."+t+" must not be a regular expression");return g+""}; $jscomp.polyfill("String.prototype.repeat",function(g){return g?g:function(c){var g=$jscomp.checkStringArgs(this,null,"repeat");if(0>c||1342177279<c)throw new RangeError("Invalid count value");c|=0;for(var u="";c;)if(c&1&&(u+=g),c>>>=1)g+=g;return u}},"es6-impl","es3"); (function(g,c){"object"===typeof exports&&"undefined"!==typeof module?c(exports,require("three")):"function"===typeof define&&define.amd?define(["exports","three"],c):c(g.WHS=g.WHS||{},g.THREE)})(this,function(g,c){function t(c,g,h){function e(b){if("function"!==typeof b)throw Error("Expected listener to be a function.");var a=!0;z===f&&(z=f.slice());z.push(b);return function(){if(a){a=!1;z===f&&(z=f.slice());var d=z.indexOf(b);z.splice(d,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(va&&va in Object(b)){a=Yb.call(b,J);var e=b[J];try{b[J]=void 0,c=!0}catch(xd){}var g=Zb.call(b);c&&(a?b[J]=e:delete b[J]);c=g}else c=$b.call(b);a="[object Object]"==c}a?(c=ac(b),null===c?c=!0:(c=bc.call(c,"constructor")&&c.constructor,c="function"==typeof c&&c instanceof c&&wa.call(c)==cc)):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(Y)throw Error("Reducers may not dispatch actions.");try{Y=!0,p=d(p,b)}finally{Y=!1}c=f=z;for(a=0;a<c.length;a++)(0,c[a])();return b}var b;"function"===typeof g&&"undefined"===typeof h&&(h=g,g=void 0);if("undefined"!==typeof h){if("function"!==typeof h)throw Error("Expected the enhancer to be a function.");return h(t)(c,g)}if("function"!==typeof c)throw Error("Expected the reducer to be a function.");var d=c,p=g,f=[],z=f,Y=!1;a({type:xa.INIT});return b={dispatch:a,subscribe:e,getState:function(){return p}, replaceReducer:function(b){if("function"!==typeof b)throw Error("Expected the nextReducer to be a function.");d=b;a({type:xa.INIT})}},b[ya]=function(){var b;return b={subscribe:function(b){function a(){b.next&&b.next(p)}if("object"!==typeof b)throw new TypeError("Expected the observer to be an object.");a();return{unsubscribe:e(a)}}},b[ya]=function(){return this},b},b}function u(){for(var c=arguments.length,g=Array(c),h=0;h<c;h++)g[h]=arguments[h];return function(c){for(var a=0;a<g.length;a++)for(var b= g[a],d=0;d<b.map.length;d++){var p=b.map[d];Object.defineProperty(c.prototype,p,{get:b.getter(p),set:b.setter(p),configurable:b.configurable,enumerable:b.enumerable})}}}function r(){for(var c=arguments.length,g=Array(c),h=0;h<c;h++)g[h]=arguments[h];return{map:g,getter:function(c){return function(){return this.native[c]}},setter:function(c){return function(a){this.native[c].copy(a)}},configurable:!0,enumerable:!0}}function x(c,g){return c+Math.random()*(g-c)}var I=function Wb(c){for(var e=arguments.length, a=Array(1<e?e-1:0),b=1;b<e;b++)a[b-1]=arguments[b];var e=!0,b=!1,d=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var p=a[Symbol.iterator](),f;!(e=(f=p.next()).done);e=!0){var z=f.value;if(z){var a=!0,g=!1,h=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var l=Object.getOwnPropertyNames(z)[Symbol.iterator](),m;!(a=(m=l.next()).done);a=!0){var k=m.value;void 0!==c[k]&&z[k]&&"[object Object]"===c[k].toString()&&"[object Object]"===z[k].toString()?c[k].constructor=== Object&&Wb(c[k],z[k]):c[k]="undefined"===typeof c[k]?z[k]:c[k];"undefined"===typeof c[k]&&Array.isArray(z[k])?c[k]=z[k].slice():"undefined"===typeof c[k]&&Array.isArray(z[k])&&(c[k]=z[k])}}catch(X){g=!0,h=X}finally{try{!a&&l.return&&l.return()}finally{if(g)throw h;}}}}}catch(X){b=!0,d=X}finally{try{!e&&p.return&&p.return()}finally{if(b)throw d;}}return c},ta=function(c,g){for(var e={},a=0,b=g.length;a<b;a++)e[g[a]]=c[a];return e},D=function Xb(c,a){for(var b in a)Array.isArray(c[b])?c[b]=ta(c[b], a[b]):c[b]instanceof Object&&!Array.isArray(a[b])&&(c[b]=Xb(c[b],a[b]));return c},E=function(c){var e={},a=[];c=c||this;c.on=function(b,a,c){(e[b]=e[b]||[]).push([a,c])};c.off=function(b,d){b||(e={});b=e[b]||a;for(var c=b.length=d?b.length:0;c--;)d==b[c][0]&&b.splice(c,1)};c.emit=function(b){for(var d=e[b]||a,d=0<d.length?d.slice(0,d.length):d,c=0,f;f=d[c++];)f[0].apply(f[1],a.slice.call(arguments,1))}},h=function(c,e){if(!(c instanceof e))throw new TypeError("Cannot call a class as a function"); },l=function(){function c(c,a){for(var b=0;b<a.length;b++){var d=a[b];d.enumerable=d.enumerable||!1;d.configurable=!0;"value"in d&&(d.writable=!0);Object.defineProperty(c,d.key,d)}}return function(e,a,b){a&&c(e.prototype,a);b&&c(e,b);return e}}(),Vb=function(c,e,a){e in c?Object.defineProperty(c,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):c[e]=a;return c},q=Object.assign||function(c){for(var e=1;e<arguments.length;e++){var a=arguments[e],b;for(b in a)Object.prototype.hasOwnProperty.call(a, b)&&(c[b]=a[b])}return c},v=function e(a,b,d){null===a&&(a=Function.prototype);var c=Object.getOwnPropertyDescriptor(a,b);if(void 0===c){if(a=Object.getPrototypeOf(a),null!==a)return e(a,b,d)}else{if("value"in c)return c.value;b=c.get;return void 0===b?void 0:b.call(d)}},m=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)},k=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},za=function(){return function(c,a){if(Array.isArray(c))return c;$jscomp.initSymbol();$jscomp.initSymbolIterator();if(Symbol.iterator in Object(c)){var b=[],d=!0,p=!1,f=void 0;try{$jscomp.initSymbol();$jscomp.initSymbolIterator();for(var e=c[Symbol.iterator](), g;!(d=(g=e.next()).done)&&(b.push(g.value),!a||b.length!==a);d=!0);}catch(W){p=!0,f=W}finally{try{if(!d&&e["return"])e["return"]()}finally{if(p)throw f;}}return b}throw new TypeError("Invalid attempt to destructure non-iterable instance");}}(),F=function(c){function a(b,d,c){h(this,a);b=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"@"+b+": "+d));d=b.stack.split("\n");d.splice(1,2);b.stack=d.join("\n");console&&console.error("Component:",c);b.name="CompositionError";return b}m(a,c);return a}(Error), dc=function(c){function a(b,d,c){var f=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1;h(this,a);var p=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"@"+b+": "+d)),e=p.stack.split("\n");e.splice(1,2);p.stack=e.join("\n");console&&console.error("Active module:",c);console&&f&&console.error("Dependency published by module:",f);p.name="DependencyError";return p}m(a,c);return a}(Error),Aa=function(c){function a(b,d,c){var f=3<arguments.length&&void 0!==arguments[3]?arguments[3]:!1; h(this,a);var p=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,"@"+b+": "+d)),e=p.stack.split("\n");e.splice(1,2);p.stack=e.join("\n");console&&console.error("Component:",c);console&&f&&console.error("Active module:",f);p.name="ManagerError";return p}m(a,c);return a}(Error),Ba=function(){throw Error("WhitestormJS Framework requires Three.js r84. https://threejs.org/");};try{c.REVISION||Ba()}catch(e){Ba()}var Ca=function(c){function a(){h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).apply(this, arguments))}m(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,f=a.length;c<f;c++)for(var e in b)if(b[e]){var g=a[c];g&&g.bridge&&g.bridge[e]&&(b[e]=g.bridge[e].apply(this, [b[e],g]))}return b}},{key:"applyCommand",value:function(b){var a=this,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:function(b,d){return b.apply(a,[d])},f=this.modules;if(f)for(var e=0,g=f.length;e<g;e++){var h=f[e];b in h&&c(h[b],h)}}},{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 Aa("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}(E),ec="object"== typeof self&&self&&self.Object===Object&&self,M=("object"==typeof global&&global&&global.Object===Object&&global||ec||Function("return this")()).Symbol,Da=Object.prototype,Yb=Da.hasOwnProperty,Zb=Da.toString,J=M?M.toStringTag:void 0,$b=Object.prototype.toString,va=M?M.toStringTag:void 0,ac=function(c,a){return function(b){return c(a(b))}}(Object.getPrototypeOf,Object),wa=Function.prototype.toString,bc=Object.prototype.hasOwnProperty,cc=wa.call(Object),ya=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")()),xa={INIT:"@@redux/INIT"},O=function(){function c(a){h(this,c);this.handler=a;this.currentModule=null;this.store=t(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 dc("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 d=a.store.getState(),c=za(d,2),d=c[0],c=c[1],f=b[c];f&&f(d[c])})}},{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}(), P,Ea,B=(Ea=P=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions;h(this,a);var f=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));f._wait=[];f.modules=[];f.children=[];f.params=I(D(b,c),d);f.params.manager&&(f.manager=new O(f));f.modules=f.params.modules;f.integrateModules();return f}m(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=I(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=q({},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(d,c){a.defer(function(){b.defer(function(){var f=b.native;f||c();var p=a.applyBridge({onAdd:b}).onAdd,e=function(){a.native.add(f);a.children.push(b);d(b)};p instanceof Promise?p.then(e):e()})})})}},{key:"remove",value:function(b){b.parent=null;this.native.remove(b.native)}},{key:"addTo",value:function(b){return b.add(this)}},{key:"get",value:function(b){return this.manager.get(b)}},{key:"use",value:function(b){return this.manager.use(b)}}, {key:"isDeffered",get:function(){return 0<this._wait.length}},{key:"manager",get:function(){if(this._manager)return this._manager;throw new Aa("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}(Ca),P.defaults={modules:null,manager:!0},P.instructions={},Ea),Fa,Ga,Q, Ha,n=(Fa=u(r("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")),Fa(Ga=(Ha=Q=function(e){function a(b){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions; h(this,a);var f=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,d,c));if(f.params.build){var e=f.build(f.params);if(!e)throw new F("MeshComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",f);e instanceof Promise?(f.wait(e),f.wait(new Promise(function(b){e.then(function(a){f.native=a;f.wrap().then(b)})}))):(f.native=e,f.wait(f.wrap()))}f.applyCommand("postIntegrate");return f}m(a,e);l(a,null,[{key:"custom",value:function(b){var d=1<arguments.length&& void 0!==arguments[1]?arguments[1]:c.Mesh;return function(a){function c(){h(this,c);return k(this,(c.__proto__||Object.getPrototypeOf(c)).apply(this,arguments))}m(c,a);l(c,[{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 d(a.geometry,a.material)}).mesh}}]);return c}(a)}},{key:"create",value:function(b,d,c){return new (a.custom(b,c))(d)}},{key:"from",value:function(b){var d= 1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};d.build=!1;d=new a(d);d.native=b;d.wrap();return d}}]);l(a,[{key:"build",value:function(){throw new F("MeshComponent","Instance should have it's own .build().",this);}},{key:"wrap",value:function(){var b=this;return new Promise(function(a){var d=b.params,c=d.position,e=d.rotation,g=d.scale,d=d.shadow;b.position.set(c.x,c.y,c.z);b.rotation.set(e.x,e.y,e.z);b.scale.set(g.x,g.y,g.z);b.native.castShadow=d.cast;b.native.receiveShadow=d.receive; b.applyBridge({onWrap:1});a(b)})}},{key:"copy",value:function(b){var d=this;return v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"copy",this).call(this,b,function(){d.position.copy(b.position);d.rotation.copy(b.rotation);d.quaternion.copy(b.quaternion)})}},{key:"clone",value:function(b,a){var d=(new this.constructor({build:!1})).copy(this);b&&(d.geometry=d.geometry.clone());a&&(d.material=d.material.clone());return d}}]);return a}(B),Q.defaults=q({},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}}),Q.instructions={position:["x","y","z"],rotation:["x","y","z"],scale:["x","y","z"]},Ha))||Ga),Ia,Ja,R,Ka,y=(Ia=u(r("position","rotation","quaternion","target")),Ia(Ja=(Ka=R=function(c){function a(b){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:a.defaults,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions;h(this,a);var f=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this, b,d,c));if(f.params.build){d=f.build(f.params);if(!d)throw new F("LightComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",f);d instanceof Promise?d.then(function(b){f.native=b}):f.native=d;f.wait(f.wrap())}f.applyCommand("postIntegrate");return f}m(a,c);l(a,null,[{key:"from",value:function(b){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:!0;d.build=!1;d=new a(d);d.native= b;d.wrap();c&&d.wrapShadow();return d}}]);l(a,[{key:"build",value:function(){throw new F("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 d=b.params,c=d.position,d=d.rotation;b.position.set(c.x,c.y,c.z);b.rotation.set(d.x,d.y,d.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 d=this;return v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"copy",this).call(this,b,function(){d.target&&d.target.copy(b.target());d.position.copy(b.position);d.rotation.copy(b.rotation);d.quaternion.copy(b.quaternion)})}},{key:"clone", value:function(){return(new this.constructor({build:!1})).copy(this)}}]);return a}(B),R.defaults=q({},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}}),R.instructions={position:["x","y","z"],rotation:["x","y","z"]},Ka))||Ja),La,Ma,S,Na,C=(La=u(r("position","rotation","quaternion","target")),La(Ma=(Na=S=function(c){function a(b){var d=1<arguments.length&& void 0!==arguments[1]?arguments[1]:a.defaults,c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:a.instructions;h(this,a);var f=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,d,c));if(f.params.build){d=f.build(f.params);if(!d)throw new F("CameraComponent",".build() method should return a THREE.Object3D or a Promise resolved with THREE.Object3D.",f);d instanceof Promise?d.then(function(b){f.native=b}):f.native=d;f.wait(f.wrap())}f.applyCommand("postIntegrate");return f}m(a,c);l(a, null,[{key:"from",value:function(b){var d=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};d.build=!1;d=new a(d);d.native=b;d.wrap();return d}}]);l(a,[{key:"build",value:function(){throw new F("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 d=this;return v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"copy",this).call(this,b,function(){d.target&&d.target.copy(b.target());d.position.copy(b.position);d.rotation.copy(b.rotation);d.quaternion.copy(b.quaternion)})}},{key:"clone",value:function(){return(new this.constructor({build:!1})).copy(this)}}]);return a}(B),S.defaults=q({},B.defaults,{build:!0,position:{x:0,y:0,z:0},rotation:{x:0,y:0,z:0}}),S.instructions= {position:["x","y","z"],rotation:["x","y","z"],scale:["x","y","z"]},Na))||Ma),A="undefined"===typeof window?global:window,fc=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[];h(this,a);console.log("WHS.App 2.1.9");var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this));d.enabled=!0;d.loops=[];d.manager=new O(d);d.modules=b;d.integrateModules();return d}m(a,c);l(a,[{key:"start",value:function(){function b(){a(b);if(f)for(var d=0,e=c.length;d<e;d++){var p= c[d];p.enabled&&p.execute(p.clock)}}var a=function(){return A.requestAnimationFrame||A.webkitRequestAnimationFrame||A.mozRequestAnimationFrame||function(b){A.setTimeout(b,1E3/60)}}(),c=this.loops,f=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(d){a.loops.push(b);d(b)})}},{key:"removeLoop",value:function(b){var a=this;return new Promise(function(d){var c=a.loops.indexOf(b);-1!==c&&a.loops.splice(c, 1);d(b)})}},{key:"get",value:function(b){return this.manager.get(b)}},{key:"use",value:function(b){return this.manager.use(b)}}]);return a}(Ca),G=function(){function e(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:!0;h(this,e);this.func=a;this.clock=b?new c.Clock:null;this.enabled=!1}l(e,[{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 e}(),Oa,Pa,gc=(Pa=Oa=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new c.AmbientLight(b.color,b.intensity)}).light}}]);return a}(y), Oa.defaults=q({},y.defaults,{color:16777215,intensity:1}),Pa),Qa,Ra,hc=(Ra=Qa=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);b=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults));b.wrapShadow();return b}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new c.DirectionalLight(b.color,b.intensity)}).light}}]);return a}(y),Qa.defaults=q({},y.defaults, {color:16777215,intensity:1}),Ra),Sa,Ta,ic=(Ta=Sa=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new c.HemisphereLight(b.skyColor,b.groundColor,b.intensity)}).light}}]);return a}(y),Sa.defaults=q({},y.defaults,{skyColor:16777215,groundColor:16777215, intensity:1}),Ta),Ua,Va,jc=(Va=Ua=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);b=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults));b.wrapShadow();return b}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new c.PointLight(b.color,b.intensity,b.distance,b.decay)}).light}}]);return a}(y),Ua.defaults=q({},y.defaults,{color:16777215,intensity:1, distance:100,decay:1}),Va),Wa,Xa,kc=(Xa=Wa=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);b=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults));b.wrapShadow();return b}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new c.SpotLight(b.color,b.intensity,b.distance,b.angle,b.exponent,b.decay)}).light}}]);return a}(y),Wa.defaults=q({},y.defaults, {color:16777215,intensity:1,distance:100,angle:Math.PI/3,exponent:0,decay:1}),Xa),Ya,Za,lc=(Za=Ya=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({light:new c.RectAreaLight(b.color,b.intensity,b.width,b.height)}).light}}]);return a}(y),Ya.defaults= q({},y.defaults,{color:16777215,intensity:1,width:10,height:10}),Za),$a,ab,mc=(ab=$a=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new c.CubeCamera(b.near,b.far,b.cubeResolution)}).camera}}]);return a}(C),$a.defaults=q({},C.defaults, {near:1,far:1E3,cubeResolution:128}),ab),bb,cb,nc=(cb=bb=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new c.OrthographicCamera(b.left,b.right,b.top,b.bottom,b.near,b.far)}).camera}}]);return a}(C),bb.defaults=q({},C.defaults,{near:1, far:1E3,left:A.innerWidth/-2,right:A.innerWidth/2,top:A.innerHeight/2,bottom:A.innerHeight/-2}),cb),db,eb,fb=(eb=db=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults))}m(a,e);l(a,[{key:"build",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return this.applyBridge({camera:new c.PerspectiveCamera(b.fov,b.aspect,b.near,b.far)}).camera}}]);return a}(C), db.defaults=q({},C.defaults,{near:1,far:1E3,fov:75,aspect:A.innerWidth/A.innerHeight}),eb),T,gb,oc=(gb=T=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}m(a,e);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 c.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?c.BoxBufferGeometry:c.BoxGeometry)(b.geometry.width,b.geometry.height,b.geometry.depth,b.geometry.widthSegments,b.geometry.heightSegments,b.geometry.depthSegments)}}]);return a}(n),T.defaults=q({},n.defaults,{geometry:{width:1,height:1,depth:1,widthSegments:1,heightSegments:1,depthSegments:1}}),T.instructions=q({},n.instructions,{geometry:"width height depth widthSegments heightSegments depthSegements".split(" ")}), gb),Z,hb,pc=(hb=Z=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}m(a,e);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 c.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?c.CircleBufferGeometry:c.CircleGeometry)(b.geometry.radius,b.geometry.segments,b.geometry.thetaStart,b.geometry.thetaLength)}}]);return a}(n),Z.defaults=q({},n.defaults,{geometry:{radius:50,segments:8,thetaStart:0,thetaLength:2*Math.PI}}),Z.instructions=q({},n.instructions,{geometry:["radius","segments","thetaStart","thetaLength"]}),hb),aa,ib,qc=(ib=aa=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]? arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.ConeBufferGeometry:c.ConeGeometry)(b.geometry.radius,b.geometry.height,b.geometry.radiusSegments,b.geometry.heightSegments,b.geometry.openEnded,b.geometry.thetaStart,b.geometry.thetaLength)}}]);return a}(n),aa.defaults=q({},n.defaults,{geometry:{radius:20,height:100,radiusSegments:32,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}}),aa.instructions=q({},n.instructions,{geometry:"radius height radiusSegments heightSegments openEnded thetaStart thetaLength".split(" ")}), ib),ba,jb,rc=(jb=ba=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.CylinderBufferGeometry:c.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}(n),ba.defaults=q({},n.defaults,{geometry:{radiusTop:0,radiusBottom:1, height:1,radiusSegments:32,heightSegments:1,openEnded:!1,thetaStart:0,thetaLength:2*Math.PI}}),ba.instructions=q({},n.instructions,{geometry:"radiusTop radiusBottom height radiusSegments heightSegments openEnded thetaStart thetaLength".split(" ")}),jb),ca,kb,sc=(kb=ca=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__|| Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.DodecahedronBufferGeometry:c.DodecahedronGeometry)(b.geometry.radius, b.geometry.detail)}}]);return a}(n),ca.defaults=q({},n.defaults,{geometry:{radius:1,detail:0}}),ca.instructions=q({},n.instructions,{geometry:["radius","detail"]}),kb),da,lb,tc=(lb=da=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.Mesh(b.geometry,b.material)}).mesh}},{key:"buildGeometry",value:function(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},a=new c.ExtrudeGeometry(b.geometry.shapes,b.geometry.options);return b.buffer?(new c.BufferGeometry).fromGeometry(a):a}}]);return a}(n),da.defaults=q({},n.defaults, {geometry:{shapes:[],options:{}}}),da.instructions=q({},n.instructions,{geometry:["shapes","options"]}),lb),ea,mb,uc=(mb=ea=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.IcosahedronBufferGeometry:c.IcosahedronGeometry)(b.geometry.radius,b.geometry.detail)}}]);return a}(n),ea.defaults=q({},n.defaults,{geometry:{radius:1,detail:0}}),ea.instructions=q({},n.instructions, {geometry:["radius","detail"]}),mb),fa,nb,vc=(nb=fa=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.LatheBufferGeometry:c.LatheGeometry)(b.geometry.points)}}]);return a}(n),fa.defaults=q({},n.defaults,{geometry:{points:[]}}),fa.instructions=q({},n.instructions,{geometry:["points"]}),nb),ga,ob,wc=(ob=ga=function(e){function a(b){h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this, b,a.defaults,a.instructions))}m(a,e);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 c.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 c.BufferGeometry:new c.Geometry;if(b.buffer){for(var b=b.curve.getPoints(b.points),e=new Float32Array(3* b.length),f=0,g=b.length;f<g;f++){var h=3*f;e[h]=b[f].x;e[h+1]=b[f].y;e[h+2]=b[f].z}a.addAttribute("position",new c.BufferAttribute(e,3))}else a.vertices=b.curve.getPoints(b.points);return a}}]);return a}(n),ga.defaults=q({},n.defaults,{curve:null,points:50}),ga.instructions=q({},n.instructions,{geometry:["curve","points"]}),ob),ha,pb,qb=(pb=ha=function(c){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this, b,a.defaults,a.instructions,!1))}m(a,c);l(a,null,[{key:"filter",value:function(b,a){return function f(b){b.children.forEach(function(d,c){d.children&&f(d);a(d)||b.children.splice(c,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(d){a.texturePath&&a.loader.setTexturePath(a.texturePath);a.loader.load(a.url,function(){for(var c=arguments.length,e=Array(c),p=0;p<c;p++)e[p]=arguments[p];a.onLoad.apply(a, e);c=a.parser.apply(b,e);a.material&&(c.material=b.applyBridge({material:a.material}).material);d(c)},a.onProgress,a.onError)})}}]);return a}(n),ha.defaults=q({},n.defaults,{url:"",loader:new c.JSONLoader,onLoad:function(){},onProgress:function(){},onError:function(){},texturePath:null,useCustomMaterial:!1,parser:function(e,a){a=this.applyBridge({geometry:e,material:a});e=a.geometry;a=a.material;return this.applyBridge({mesh:e.bones?new c.SkinnedMesh(e,a):new c.Mesh(e,a)}).mesh}}),ha.instructions= q({},n.instructions),pb),rb,sb,xc=(sb=rb=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.OctahedronBufferGeometry:c.OctahedronGeometry)(b.geometry.radius,b.geometry.detail)}}]);return a}(n),rb.defaults=q({},n.defaults,{geometry:{radius:1,detail:0}}),sb),tb,ub,yc=(ub=tb=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);return k(this, (a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}m(a,e);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 c.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?c.ParametricBufferGeometry:c.ParametricGeometry)(b.geometry.func, b.geometry.slices,b.geometry.stacks)}}]);return a}(n),tb.defaults=q({},n.defaults,{geometry:{func:function(e,a){return new c.Vector3(e,a,0)},slices:10,stacks:10}}),ub),ia,vb,zc=(vb=ia=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.PlaneBufferGeometry:c.PlaneGeometry)(b.geometry.width,b.geometry.height,b.geometry.wSegments,b.geometry.hSegments)}}]);return a}(n),ia.defaults= q({},n.defaults,{geometry:{width:10,height:10,wSegments:1,hSegments:1}}),ia.instructions=q({},n.instructions,{geometry:["width","height","wSegments","hSegments"]}),vb),K,wb,xb=[-1,-1,-1,1,-1,-1,1,1,-1,-1,1,-1,-1,-1,1,1,-1,1,1,1,1,-1,1,1],yb=[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],Ac=(wb=K=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions)); b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.PolyhedronBufferGeometry: c.PolyhedronGeometry)(b.geometry.verticesOfCube,b.geometry.indicesOfFaces,b.geometry.radius,b.geometry.detail)}}]);return a}(n),K.verticesOfCube=xb,K.indicesOfFaces=yb,K.defaults=q({},n.defaults,{geometry:{verticesOfCube:xb,indicesOfFaces:yb,radius:6,detail:2}}),K.instructions=q({},n.instructions,{geometry:["verticesOfCube","indicesOfFaces","radius","detail"]}),wb),ja,zb,Bc=(zb=ja=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__|| Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.RingBufferGeometry:c.RingGeometry)(b.geometry.innerRadius,b.geometry.outerRadius,b.geometry.thetaSegments,b.geometry.phiSegments,b.geometry.thetaStart,b.geometry.thetaLength)}}]);return a}(n),ja.defaults=q({},n.defaults,{geometry:{innerRadius:0,outerRadius:50,thetaSegments:8,phiSegments:8,thetaStart:0,thetaLength:2*Math.PI}}),ja.instructions=q({},n.defaults,{geometry:"innerRadius outerRadius thetaSegments phiSegments thetaStart thetaLength".split(" ")}), zb),ka,Ab,Cc=(Ab=ka=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&&(d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);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 c.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?c.ShapeBufferGeometry:c.ShapeGeometry)(b.geometry.shapes)}}]);return a}(n),ka.defaults=q({},n.defaults,{geometry:{shapes:[]}}),ka.instructions=q({},n.instructions,{geometry:["shapes"]}),Ab),la,Bb,Dc=(Bb=la=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a); return k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions))}m(a,e);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 c.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?c.SphereBufferGeometry: c.SphereGeometry)(b.geometry.radius,b.geometry.widthSegments,b.geometry.heightSegments)}}]);return a}(n),la.defaults=q({},n.defaults,{geometry:{radius:1,widthSegments:8,heightSegments:6}}),la.instructions=q({},n.instructions,{geometry:["radius","widthSegments","heightSegments"]}),Bb),ma,Cb,Ec=(Cb=ma=function(e){function a(){var b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};h(this,a);var d=k(this,(a.__proto__||Object.getPrototypeOf(a)).call(this,b,a.defaults,a.instructions));b.build&& (d.build(b),v(a.prototype.__proto__||Object.getPrototypeOf(a.prototype),"wrap",d).call(d));return d}m(a,e);l(a,[{key:"build",value:fun