diff --git a/src/third-party/model3d/1.1.1/box3d-runtime.min.js b/src/third-party/model3d/1.1.1/box3d-runtime.min.js index 97118b207..bf5ec77c9 100644 --- a/src/third-party/model3d/1.1.1/box3d-runtime.min.js +++ b/src/third-party/model3d/1.1.1/box3d-runtime.min.js @@ -1,18 +1,18 @@ (function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("THREE")):"function"==typeof define&&define.amd?define("Box3D",["THREE"],t):"object"==typeof exports?exports.Box3D=t(require("THREE")):e.Box3D=t(e.THREE)})(this,function(e){return function(e){function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var r={};return t.m=e,t.c=r,t.i=function(e){return e},t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=272)}([function(e,t,r){"use strict";function i(e,t){function r(){this.constructor=e}g(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function n(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(e);n=0;s--)(n=e[s])&&(o=(a<3?n(o):a>3?n(t,r,o):n(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function o(e,t){return function(r,i){t(r,i,e)}}function s(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function u(e,t,r,i){return new(r||(r=Promise))(function(n,a){function o(e){try{u(i.next(e))}catch(e){a(e)}}function s(e){try{u(i.throw(e))}catch(e){a(e)}}function u(e){e.done?n(e.value):new r(function(t){t(e.value)}).then(o,s)}u((i=i.apply(e,t||[])).next())})}function p(e,t){function r(e){return function(t){return i([e,t])}}function i(r){if(n)throw new TypeError("Generator is already executing.");for(;u;)try{if(n=1,a&&(o=a[2&r[0]?"return":r[0]?"throw":"next"])&&!(o=o.call(a,r[1])).done)return o;switch(a=0,o&&(r=[0,o.value]),r[0]){case 0:case 1:o=r;break;case 4:return u.label++,{value:r[1],done:!1};case 5:u.label++,a=r[1],r=[0];continue;case 7:r=u.ops.pop(),u.trys.pop();continue;default:if(o=u.trys,!(o=o.length>0&&o[o.length-1])&&(6===r[0]||2===r[0])){u=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=a.next()).done;)o.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}function h(){for(var e=[],t=0;t=e&&(t.engine.off("update",i,t),t.trigger("endTimer"))};this.engine.on("update",i,this)},t.events={load:{params:[],action:!1,category:"Loading"},loadBase:{params:[],action:!1,category:"Loading"},loadDependencies:{params:[],action:!1,category:"Loading"},startTimer:{params:[{name:"time",description:"The time (in seconds) that will elapse before the 'endTimer' event will be fired.",type:"f",default:5}],action:!0,category:"General"},endTimer:{params:[],action:!1,category:"General"}},t.validators={},t.defaults={},t.schema={},t}(t.baseEntityMixins);t.default=f},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.on("setVisible",this.setVisible,this),this.on("setInvisible",this.setInvisible,this),this.on("toggleVisibility",this.toggleVisibility,this),this.on("change:children",this.onChildrenChanged,this)},t.prototype.uninitialize=function(){this.off("setVisible",this.setVisible,this),this.off("setInvisible",this.setInvisible,this),this.off("toggleVisibility",this.toggleVisibility,this),this.off("change:children",this.onChildrenChanged,this),this.uninitPrefabBindings(),e.prototype.uninitialize.call(this)},t.prototype.getRootObject=function(){var e=this.getParentObject();return e?e.getRootObject():this},t.prototype.reset=function(){this.runtimeData&&(this.runtimeData.position.copy(this.getPosition()),this.runtimeData.quaternion.copy(this.getQuaternion()),this.runtimeData.scale.copy(this.getScale()))},t.prototype.createRuntimeData=function(e){this.runtimeData=new a.Object3D,this.runtimeData.name=this.getRuntimeName(),e()},t.prototype.clone=function(t,r){void 0===r&&(r=!0);var i=e.prototype.clone.call(this,t);if(i.set("parentId",null),i.set("prefabAssetId",this.get("prefabAssetId")),i.set("prefabObjectId",this.get("prefabObjectId")),r){var n=this.getChildren();n.forEach(function(e){var t=e.clone(void 0,r);i.addChild(t)}),this.isInstanceTop()&&(i.set("prefabInstanceId",i.id),i.traverse(function(e){e.set("prefabInstanceId",i.id)}))}return i},t.prototype.alignToPosition=function(e,t){var r=new a.Vector3(e.x||0,e.y||0,e.z||0),n=this.getQuaternion(),o=this.getScale(),s=this.getCenter(),u=new a.Quaternion(n.x,n.y,n.z,n.w),p=this.getBounds(),c={};c.min=new a.Vector3(p.min.x,p.min.y,p.min.z),c.max=new a.Vector3(p.max.x,p.max.y,p.max.z),c.min.applyQuaternion(u),c.max.applyQuaternion(u);var l=new a.Vector3(s.x,s.y,s.z);l.applyQuaternion(u),c.min.multiply(o),c.max.multiply(o),l.multiply(o),t&&Object.keys(t).forEach(function(e){var i=Math.min(c.min[e],c.max[e]),n=Math.max(c.min[e],c.max[e]),a=.5*t[e]+.5;r[e]-=(1-a)*i+a*n}),this.setProperty("position",i.__assign({},r))},t.prototype.getPosition=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("position")),t},t.prototype.setPosition=function(e,t,r){if(void 0===r)throw new Error("Calling setPosition with invalid arguments. Expected setPosition( x, y, z ).");this.setProperty("position",{x:e,y:t,z:r})},t.prototype.getQuaternion=function(e){var t=e||new a.Quaternion;return t.copy(this.getProperty("quaternion")),t},t.prototype.setQuaternion=function(e,t,r,i){if(void 0===i)throw new Error("Calling setQuaternion with invalid arguments. Expected setQuaternion( x, y, z, w ).");this.setProperty("quaternion",{x:e,y:t,z:r,w:i})},t.prototype.getScale=function(e){var t=e||new a.Vector3;return t.copy(this.getProperty("scale")),t},t.prototype.setScale=function(e,t,r){if(void 0===r)throw new Error("Calling setScale with invalid arguments. Expected setScale( x, y, z ).");this.setProperty("scale",{x:e,y:t,z:r})},t.prototype.getCenter=function(e){var t=e||new a.Vector3,r=this.getBounds();return t.copy(r.min),t.add(r.max),t.multiplyScalar(.5),t},t.prototype.setVisible=function(){this.setProperty("visible",!0),this.engine.needsRender=!0},t.prototype.setInvisible=function(){this.setProperty("visible",!1),this.engine.needsRender=!0},t.prototype.toggleVisibility=function(){var e=!this.getProperty("visible");this.setProperty("visible",e),this.engine.needsRender=!0},t.prototype.loadBase=function(t){e.prototype.loadBase.call(this,t),this.isInstance()&&this.initPrefabBindings()},t.prototype.reloadBase=function(t){var r=this;this.isInstance()&&this.uninitPrefabBindings();var i=this.runtimeData&&this.runtimeData.parent;i&&i.remove(this.runtimeData);var n=this.runtimeData&&this.runtimeData.children;e.prototype.reloadBase.call(this,function(){i&&i.add(r.runtimeData),n&&n.forEach(function(e){return r.runtimeData.add(e)}),"function"==typeof t&&t()})},t.prototype.unload=function(t){var r=this;if(void 0===t&&(t=!1),this.runtimeData&&this.runtimeData.parent&&this.runtimeData.parent.remove(this.runtimeData),t){var i=this.getChildIds();i.forEach(function(e){var i=r.engine.getObjectById(e);i&&i.unload(t)})}e.prototype.unload.call(this)},t.prototype.destroy=function(){this.engine.destroyObjectById(this.id)},t.prototype.traverse=function(e){var t=this,r=this.getChildren();r.forEach(function(r){e(r,t),r.traverse(e)})},t.prototype.traverseWhile=function(e){var t=this,r=this.getChildren();return r.some(function(r){return e(r,t)||r.traverseWhile(e)})},t.prototype.traverseSome=function(e){var t=this,r=this.getChildren();r.forEach(function(r){e(r,t)||r.traverseSome(e)})},t.prototype.getAncestors=function(e){var t=this.getParentObject();return t?e&&!e(t)?t.getAncestors(e):[t].concat(t.getAncestors(e)):[]},t.prototype.getDescendants=function(e){var t=[],r="function"!=typeof e; return this.traverse(function(i){(r||e(i))&&t.push(i)}),t},t.prototype.getDescendant=function(e){var t,r="function"!=typeof e;return this.traverseWhile(function(i){if(!t&&(r||e(i)))return t=i,!0}),t},t.prototype.getDescendantById=function(e){return this.getDescendant(function(t){return t.id===e})},t.prototype.getDescendantByName=function(e){return this.getDescendant(function(t){return t.getName()===e})},t.prototype.getDescendantByType=function(e){return this.getDescendant(function(t){return t.type===e})},t.prototype.getDescendantByClass=function(e){return this.getDescendant(function(t){return t instanceof e})},t.prototype.getDescendantsByType=function(e){return this.getDescendants(function(t){return t.type===e})},t.prototype.getDescendantsByClass=function(e){return this.getDescendants(function(t){return t instanceof e})},t.prototype.getDescendantsByName=function(e){return this.getDescendants(function(t){return t.getName()===e})},t.prototype.getChildById=function(e){return this.sharedData.children.indexOf(e)!==-1?this.engine.getObjectById(e):null},t.prototype.getChild=function(e){var t=this.getChildren(e);return t.length?t[0]:null},t.prototype.getChildren=function(e){var t=this,r=this.getChildIds(),i="function"!=typeof e;return r.filter(function(r){var n=t.getChildById(r);return n&&(i||e(n))}).map(function(e){return t.engine.getObjectById(e)})},t.prototype.getChildrenMap=function(e){var t={},r=this.getChildren(e);return r.forEach(function(e){e&&(t[e.id]=e)}),t},t.prototype.getParentObject=function(){return this.engine.getObjectById(this.get("parentId"))},t.prototype.addChild=function(e,t){this.addChildById(e.id,t)},t.prototype.addChildById=function(e,t){var r=this.engine.getObjectById(e);if(!r)throw new Error("Can't find child object with id, "+e);this.engine.entityDispatcher.dispatchChildAdded(this.id,e,t)},t.prototype.removeChild=function(e,t){this.removeChildById(e.id,t)},t.prototype.removeChildById=function(e,t){var r=this.getChildById(e);return r?void this.engine.entityDispatcher.dispatchChildRemoved(this.id,e,t):void n.default.warn("Object, "+e+", is not a child of this object")},t.prototype.getChildIds=function(e){var t="function"!=typeof e;return t?this.sharedData.children.slice():this.sharedData.children.filter(function(t){return e(t)})},t.prototype.setChildIds=function(e,t){void 0===t&&(t=!1),this.engine.entityDispatcher.dispatchChildChanged(this.id,e,t)},t.prototype.scaleToSize=function(e){var t={},r=this.getBounds();t.min=new a.Vector3(r.min.x,r.min.y,r.min.z),t.max=new a.Vector3(r.max.x,r.max.y,r.max.z);var i=t.min.distanceTo(t.max),n=e/i;n<=0&&(n=1),this.setProperty("scale",{x:n,y:n,z:n})},t.prototype.getBounds=function(e){var t=this.getProperty("bounds"),r=e||new a.Box3;return t?r.set(t.min,t.max):this.computeBounds(r)},t.prototype.getSphericalBounds=function(e){var t=e||new a.Sphere,r=this.getBounds();return t.radius=t.center.subVectors(r.max,r.min).multiplyScalar(.5).length(),t.center.addVectors(r.max,r.min).multiplyScalar(.5),t},t.prototype.getLocalBounds=function(e){var t=e||new a.Box3;return t.min.set(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),t.max.set(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),t},t.prototype.computeBounds=function(e){var t=this.getChildren(),r=this.getLocalBounds(e||new a.Box3),i=new a.Matrix4;return t.forEach(function(e){var t=e.computeBounds();t.isEmpty()||(i.compose(e.getPosition(),e.getQuaternion(),e.getScale()),t.applyMatrix4(i),r.union(t))}),this.setProperty("bounds",{min:{x:r.min.x,y:r.min.y,z:r.min.z},max:{x:r.max.x,y:r.max.y,z:r.max.z}}),r},t.prototype.getPreviousProperty=function(e){var t=this.sharedData.previousProperties[e];if(void 0!==t)return t;var r=this.getPrefabObject();return r?r.getProperty(e):this.getDefaultProperty(e)},t.prototype.getProperty=function(e){var t=this.getOwnProperty(e);if(void 0!==t)return t;var r=this.getPrefabProperty(e);return r?r:this.getDefaultProperty(e)},t.prototype.getProperties=function(){var e=this.getOwnProperties(),t=this.getPrefabObject(),r=this.getDefaultProperties();if(t){var i=t.getOwnProperties();return Object.assign(r,i,e)}return Object.assign(r,e)},t.prototype.getInstanceTop=function(){var e=this.get("prefabInstanceId");return e?this.engine.getObjectById(e):null},t.prototype.getPrefabObject=function(){return this.engine.getObjectById(this.get("prefabObjectId"))},t.prototype.getPrefabProperty=function(e){var t=this.getPrefabObject();if(t)return t.getProperty(e)},t.prototype.isInstance=function(){return!!this.get("prefabObjectId")},t.prototype.isInstanceTop=function(){return this.get("prefabInstanceId")===this.id},t.prototype.breakPrefabLink=function(e){if(void 0===e&&(e=!0),!this.isInstance())throw new Error("breakPrefabLink: Can't call this on an entity that isn't an instance.");e&&this.getChildren().forEach(function(t){t.breakPrefabLink(e)}),this.uninitPrefabBindings(),this.mergeProperties(this.getPrefabObject());var t={};t.prefabInstanceId=void 0,t.prefabObjectId=void 0,t.prefabAssetId=void 0},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),t.hasOwnProperty("static")){var i=this.getProperty("static");this.runtimeData.matrixAutoUpdate=!i,this.runtimeData.rotationAutoUpdate=!i,i&&(this.runtimeData.matrixWorldNeedsUpdate=!0,this.runtimeData.updateMatrix())}if(t.hasOwnProperty("visible")&&(this.runtimeData.visible=this.getProperty("visible")),t.hasOwnProperty("castShadow")&&(this.runtimeData.castShadow=this.getProperty("castShadow")),t.hasOwnProperty("receiveShadow")&&(this.runtimeData.receiveShadow=this.getProperty("receiveShadow")),t.hasOwnProperty("frustumCulled")&&(this.runtimeData.frustumCulled=this.getProperty("frustumCulled")),t.hasOwnProperty("position")){var n=this.getPosition();this.runtimeData.position.set(n.x,n.y,n.z)}if(t.hasOwnProperty("quaternion")){var a=this.getQuaternion();this.runtimeData.quaternion.set(a.x,a.y,a.z,a.w)}if(t.hasOwnProperty("scale")){var o=this.getScale();this.runtimeData.scale.set(o.x,o.y,o.z)}this.engine.needsRender=!0},t.prototype.getRuntimeName=function(){return this.engine.getRuntimeName(this.getSid())},t.prototype.initPrefabBindings=function(){var e=this.getPrefabObject();e&&e.on("change:properties",this.onPrefabEntityChanged,this)},t.prototype.uninitPrefabBindings=function(){var e=this.getPrefabObject();e&&e.off("change:properties",this.onPrefabEntityChanged,this)},t.prototype.onPrefabEntityChanged=function(){n.default.warn("TODO - re-implement updating from prefab changes")},t.prototype.onChildLoaded=function(e){var t=this;this.when("loadBase",function(){t.runtimeData.add(e.runtimeData),t.engine.needsRender=!0})},t.prototype.onChildrenChanged=function(e,t){var r=this;t.forEach(function(e){e&&(e.set("parentId",null),r.unregisterDependency(e),r.stopListening(e,"loadBase",r.onChildLoaded),r.isBaseLoaded()&&e.isBaseLoaded()&&(r.runtimeData.remove(e.runtimeData),r.engine.needsRender=!0))}),e.forEach(function(e){var t=e.getParentObject();t&&t.id!==r.id&&t.removeChildById(e.id,!0),e.set("parentId",r.id),r.listenTo(e,"loadBase",r.onChildLoaded),e.isBaseLoaded()&&(r.isBaseLoaded()?(r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0):r.when("loadBase",function(){r.runtimeData.add(e.runtimeData),r.engine.needsRender=!0})),r.registerDependency(e)}),this.unsetProperty("bounds"),this.getAncestors().forEach(function(e){return e.unsetProperty("bounds")})},t.events={toggleVisibility:{params:[],action:!0,category:"Rendering"},setVisible:{params:[],action:!0,category:"Rendering"},setInvisible:{params:[],action:!0,category:"Rendering"}},t}(o.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={LOAD:"load",STATE_CHANGE:"state_change",CANCEL:"cancel",ERROR:"error",PROGRESS:"progress",DONE:"done"};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,n=r(0),a=r(1),o=r(6),s=r(3);(function(e){e[e.Normal=101]="Normal",e[e.Stereo2dOverUnder=102]="Stereo2dOverUnder",e[e.Stereo2dUnderOver=103]="Stereo2dUnderOver",e[e.Stereo2dLeftRight=104]="Stereo2dLeftRight",e[e.Stereo2dRightLeft=105]="Stereo2dRightLeft",e[e.StereoCubeHorizontal=106]="StereoCubeHorizontal"})(i=t.ImageLayout||(t.ImageLayout={}));var u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadedBytes=0,t}return n.__extends(t,e),t.getThreeImageFormat=function(e){switch(e){case"alpha":return a.AlphaFormat;case"rgb":return a.RGBFormat;case"rgba":return a.RGBAFormat;case"luminance":return a.LuminanceFormat;case"luminanceAlpha":return a.LuminanceAlphaFormat;default:return s.default.warn("Unexpected format: "+e+", defaulting to THREE.RGBFormat"),a.RGBFormat}},t.getThreeImageEncoding=function(e){switch(e){case"linear":return a.LinearEncoding;case"srgb":return a.sRGBEncoding;case"gamma":return a.GammaEncoding;case"rgbe":return a.RGBEEncoding;case"logLuv":return a.LogLuvEncoding;case"rgbm7":return a.RGBM7Encoding;case"rgbm16":return a.RGBM16Encoding;case"rgbd":return a.RGBDEncoding;case"depth":return a.BasicDepthPacking;case"rgbaDepth":return a.RGBADepthPacking;default:return s.default.warn("Unexpected format: "+e+", defaulting to THREE.sRGBEncoding"),a.sRGBEncoding}},t.getThreeDataType=function(e){switch(e){case"uByte":return a.UnsignedByteType;case"byte":return a.ByteType;case"short":return a.ShortType;case"uShort":return a.UnsignedShortType;case"int":return a.IntType;case"uInt":return a.UnsignedIntType;case"float":return a.FloatType;case"halfFloat":return a.HalfFloatType;case"uShort4444":return a.UnsignedShort4444Type;case"uShort5551":return a.UnsignedShort5551Type;case"uShort565":return a.UnsignedShort565Type;default:return s.default.warn("Unexpected format: "+e+", defaulting to THREE.UnsignedByteType"),a.UnsignedByteType}},t.getChannelCountFromFormat=function(e){switch(e){case"alpha":case"luminance":return 1;case"luminanceAlpha":return 2;case"rgb":return 3;case"rgba":return 4;default:return 0}},t.prototype.unload=function(){this.loadedBytes=0,e.prototype.unload.call(this)},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.getDataSizeLoadedSelf=function(){return this.loadedBytes},t.prototype.applyPropertiesUnloaded=function(t){void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),this.engine.trigger("imageChanged",this.id,t)},t.prototype.getDataSizeDownloadSelf=function(){return this.chosenRepresentation?this.chosenRepresentation.contentLength:1},t.prototype.getFormat=function(){return"rgb"},t.prototype.isPowerOfTwo=function(){var e=this.getWidth(),t=this.getHeight();return a.Math.isPowerOfTwo(e)&&a.Math.isPowerOfTwo(t)},t.prototype.getWidth=function(){var e=this.getMaxRepresentationWidth(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getHeight=function(){var e=this.getMaxRepresentationHeight(),t=this.getMaxTextureSize();return Math.max(1,Math.min(t,e))},t.prototype.getMaxRepresentationWidth=function(){return 0},t.prototype.getMaxRepresentationHeight=function(){return 0},t.prototype.getOriginalWidth=function(){return 0},t.prototype.getOriginalHeight=function(){return 0},t.prototype.getMaxTextureSize=function(){return Number.MAX_VALUE},t}(o.default);t.default=u},function(e,t,r){"use strict";function i(e,t){if(void 0!==e&&null!==e)return Array.isArray(e)?e.forEach(t):void Object.keys(e).forEach(function(r){t(e[r],r)})}function n(e){return Array.isArray(e)?[].concat.apply([],e.map(function(e){return n(e)})):e}function a(e,t){return e.reduce(function(e,r){return e[r[t]]=r,e},{})}function o(e,t){return n(u(e,t))}function s(e){return e}function u(e,t){var r;return void 0===e||null===e?e:Array.isArray(e)?e.map(t):(r={},Object.keys(e).forEach(function(i){r[i]=t(e[i],i)}),r)}function p(e,t){return Object.keys(e).reduce(function(r,i){return t.indexOf(i)===-1&&(r[i]=e[i]),r},{})}e.exports={each:i,flatMap:o,flatten:n,identity:s,indexBy:a,map:u,omit:p}},function(e,t,r){"use strict";function i(e,t){var r=Math.floor(e),i=t?t:{r:(r>>16&255)/255,g:(r>>8&255)/255,b:(255&r)/255};return i}Object.defineProperty(t,"__esModule",{value:!0});var n,a=r(0),o=r(3),s=r(1),u=r(6),p=r(5),c=r(4),l=r(229);(function(e){e[e.STANDIN_TEXTURE_WHITE=0]="STANDIN_TEXTURE_WHITE",e[e.STANDIN_TEXTURE_WHITE_CUBE=1]="STANDIN_TEXTURE_WHITE_CUBE",e[e.STANDIN_TEXTURE_BLACK=2]="STANDIN_TEXTURE_BLACK",e[e.STANDIN_TEXTURE_BLACK_CUBE=3]="STANDIN_TEXTURE_BLACK_CUBE",e[e.STANDIN_TEXTURE_NORMAL=4]="STANDIN_TEXTURE_NORMAL"})(n=t.StandInTexture||(t.StandInTexture={}));var d=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.listenTo(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.uninitialize=function(){e.prototype.uninitialize.call(this),this.stopListening(this.engine,"textureDeleted",this.onTextureDeleted)},t.prototype.getProperty=function(t){var r=e.prototype.getProperty.call(this,t);if(void 0===r){var i=this.getShader().getProperty("parameters");i[t]&&(r=i[t].default)}return r},t.prototype.getDefaultProperties=function(){var t=e.prototype.getDefaultProperties.call(this),r=this.getShader().getProperty("parameters");return Object.keys(r).forEach(function(e){t[e]=r[e].default}),t},t.prototype.verifyProperty=function(r,i){return!t.schema.properties[r]||e.prototype.verifyProperty.call(this,r,i)},t.prototype.setProperty=function(r,n,a){if(t.schema.properties[r])return e.prototype.setProperty.call(this,r,n,a);var s=this.getShader(),u=s.getProperty("parameters");if(u[r]){var p,c=u[r].type;if("t"===c&&("string"==typeof n||null===n)||"f"===c&&"number"==typeof n||"b"===c&&"boolean"==typeof n||"i"===c&&"number"==typeof n&&Math.round(n)===n||"opt"===c&&u[r].options.hasOwnProperty(n))p=n;else if("c"===c){if(p=this.sharedData.properties.hasOwnProperty(r)&&"object"==typeof this.sharedData.properties[r]?this.sharedData.properties[r]:{r:0,g:0,b:0},"string"==typeof n){var l=n;"0x"!==l.slice(0,2)&&(l=String(parseInt(l,10)),l="0x"+l.toString()),i(parseInt(l,16),p)}else if("number"==typeof n){var d=Math.max(0,Math.max(16777215,n));i(d,p)}else if(n&&"number"==typeof n.r&&"number"==typeof n.g&&"number"==typeof n.b){p.r=n.r,p.g=n.g,p.b=n.b;var h=u[r].min,f=u[r].max;void 0!==h&&(p.r=Math.max(p.r,h),p.g=Math.max(p.g,h),p.b=Math.max(p.b,h)),void 0!==f&&(p.r=Math.min(p.r,f),p.g=Math.min(p.g,f),p.b=Math.min(p.b,f))}}else"v"===c.charAt(0)&&"number"==typeof n.x&&"number"==typeof n.y?(p=this.sharedData.properties.hasOwnProperty(r)?this.sharedData.properties[r]:{},p.x=n.x,p.y=n.y,"v3"===c&&"number"==typeof n.z?p.z=n.z:"v4"===c&&"number"==typeof n.z&&"number"==typeof n.w&&(p.z=n.z,p.w=n.w)):"undefined"==typeof n?p=void 0:o.default.error("Wrong type specified for "+r);this.engine.entityDispatcher.dispatchPropertyChanged(this.id,r,p,a)}},t.prototype.getReferencedAssetsList=function(e){var t=this,r=[],i={},n=this.getShader(),a=n.getProperty("parameters");return p.forEach(a,function(n,a){var o,s;"t"===n.type&&(t.isParameterUsed(a)&&(o=t.getProperty(a)),o&&(s=t.engine.getAssetById(o),i[o]?e&&r.push(s):(i[o]=s,r.push(s))))}),r},t.prototype.getShader=function(){var t=e.prototype.getProperty.call(this,"shaderId");return this.engine.getAssetById(t)||(t=this.getDefaultProperty("shaderId")),this.engine.getAssetById(t)},t.prototype.isParameterEditable=function(e){var t=this.getShader();if(!t)return!1;var r=t.getProperty("parameters");return!!r[e]&&(!r[e].displayWhen||this.testParameterConditions(r[e].displayWhen))},t.prototype.getStandInTexture=function(e,t){var r=this.engine.getAssetById(this.getProperty(e));if(r){var i;return t?"normal"===t?i=n.STANDIN_TEXTURE_NORMAL:"bump"===t&&(i=r.isCubeMap()?n.STANDIN_TEXTURE_BLACK:n.STANDIN_TEXTURE_BLACK_CUBE):i=r.isCubeMap()?n.STANDIN_TEXTURE_WHITE_CUBE:n.STANDIN_TEXTURE_WHITE,this.engine.materialUtilities.getStandInTexture(i)}},t.prototype.unload=function(){var t=this;if(this.getDependencies().forEach(function(e){return t.stopListening(e,"load")}),this.runtimeData){this.engine.trigger("materialUnloaded",this.id),o.default.info(this.engine.getName()+" - Unloading material, "+this.getName());for(var r in this.runtimeData)this.runtimeData.hasOwnProperty(r)&&(this.runtimeData[r].dispose(),delete this.runtimeData[r]);this.runtimeData=null,e.prototype.unload.call(this)}},t.prototype.applyPropertiesLoaded=function(r,i){var n=this;if(e.prototype.applyPropertiesLoaded.call(this,r,i),r.hasOwnProperty("shaderId")){var a=this.getShader(),o=this.getPreviousProperty("shaderId");if(o!==a.id&&"init"!==i&&this.getThreeConstructor()!==this.getThreeConstructor(o))return void this.reloadBase();a.when("load",function(){p.forEach(t.materialObjectTypes,function(e,t){var r=n.runtimeData[t];r instanceof s.ShaderMaterial&&(r.vertexShader=a.runtimeData.vertexShader,r.fragmentShader=a.runtimeData.fragmentShader,r.uniforms=s.UniformsUtils.clone(a.runtimeData.uniforms),n.addSharedUniforms(r.uniforms)),r.needsUpdate=!0}),n.updateMaterialDefines(),n.updateShaderParameters(n.getProperties()),n.updateTransparency(),n.updateDerivatives(),n.engine.needsRender=!0}),a.isUnloaded()&&a.load()}else{var u=this.getShader(),c=u.getProperty("parameters"),l=!1,d=!1,h=!1;for(var f in r)if(r.hasOwnProperty(f)&&c[f]){if(c[f].transparency&&(l=!0),"undefined"!=typeof c[f].derivatives&&(d=!0),u.getDependentParameters(f).length||c[f].forceUpdate){h=!0;break}this.updateShaderParameter(f)}h&&(this.updateMaterialDefines(),this.updateShaderParameters(this.getProperties()),l=!0,d=!0),l&&this.updateTransparency(),d&&this.updateDerivatives(),this.engine.needsRender=!0}},t.prototype.applyPropertiesUnloaded=function(t){var r=this;void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t);var i,n,a=this.getShader(),o=a.getProperty("parameters"),s=!1;t&&(t.hasOwnProperty("shaderId")&&this.cleanShaderParameters(),p.forEach(t,function(e,t){o[t]&&("t"===o[t].type&&(i=r.getProperty(t),n=r.getPreviousProperty(t),r.isParameterUsed(t)?n!==i&&(r.registerDependencyById(i),r.unregisterDependencyById(n)):n!==i&&(s=!0)),(a.getDependentParameters(t).length||o[t].forceUpdate)&&(s=!0))}),s&&this.resetDependencies())},t.prototype.createRuntimeData=function(e){var r=this,i=this.getShader();i.when("load",function(){r.runtimeData={};var n={},a=r.getThreeConstructor();a===s.ShaderMaterial&&(n.vertexShader=i.runtimeData.vertexShader,n.fragmentShader=i.runtimeData.fragmentShader,n.uniforms=s.UniformsUtils.clone(i.runtimeData.uniforms),r.addSharedUniforms(n.uniforms)),Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e]=new a(n),r.runtimeData[e].name=r.getName();var i=t.materialObjectTypes[e];p.forEach(i,function(t,i){r.runtimeData[e].hasOwnProperty(i)&&(r.runtimeData[e][i]=p.deepClone(t))})}),e()},this),i.isUnloaded()&&i.load()},t.prototype.getThreeConstructor=function(e){var t=e?this.engine.getAssetById(e):this.getShader();if(!t)throw new Error("Bad or unknown shader ID, "+e);t.isUnloaded()&&t.load();var r;switch(t.runtimeData.vertexShader){case"MeshPhongMaterial":r=s.MeshPhongMaterial;break;case"MeshLambertMaterial":r=s.MeshLambertMaterial;break;default:r=s.ShaderMaterial}return r},t.prototype.testParameterCondition=function(e,t){var r=this.getShader(),i=r.getProperty("parameters");if(!i[e])return!1;var n=this.getProperty(e);"t"===i[e].type&&(this.engine.getAssetById(n)||(n=null));for(var a in t)if(t.hasOwnProperty(a))switch(a){case"equals":if(!p.shallowEquals(n,t[a]))return!1;break;case"notEquals":if(p.shallowEquals(n,t[a]))return!1;break;case"equalsDefault":if(!p.shallowEquals(n,i[e].default))return!1;break;case"notEqualsDefault":if(p.shallowEquals(n,i[e].default))return!1;break;default:return!1}return!0},t.prototype.testParameterConditions=function(e){var t=!0;for(var r in e)if(e.hasOwnProperty(r))if("or"===r){if(!this.testParameterConditionsOr(e[r])){t=!1;break}}else if(!this.testParameterCondition(r,e[r])){t=!1;break}return t},t.prototype.testParameterConditionsOr=function(e){for(var t=!1,r=0,i=e;r1;if("NotFalsy"===t)return this.getProperty(e);if("HasAlpha"===t&&"t"===i[e].type){var n=this.engine.getAssetById(this.getProperty(e));return n&&"rgba"===n.getFormat()}}return!1},t.prototype.isParameterUsed=function(e){var t,r=this.getShader(),i=!1;if(r)return t=r.getProperty("parameters"),t[e]&&(i=!t[e].enabledWhen||this.testParameterConditions(t[e].enabledWhen)),i},t.prototype.onTextureLoaded=function(e){var r=this;if(!e.isLoadFailed()){var i=e.getThreeTexture();if(i){var n=this.getShader();if(n){var a=n.getProperty("parameters"),o=Object.keys(a).filter(function(t){return"t"===a[t].type&&r.isParameterUsed(t)&&r.getProperty(t)===e.id});o.forEach(function(e){r.setThreeValue(e,i)});var s=o.some(function(e){return a[e].forceUpdate});s&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0}),this.engine.needsRender=!0}}}},t.prototype.updateShaderParameter=function(e){var r=this,i=this.getShader(),n=i.getProperty("parameters"),a=n[e];if(a){var o=!0,s=this.getProperty(e);switch(a.type.charAt(0)){case"t":var u=this.engine.getAssetById(s);if(u&&this.isParameterUsed(e)){var p=this.getPreviousProperty(e);if(p!==this.getProperty(e)){var c=this.engine.getEntityById(p);c&&this.stopListening(c,"loadBase",this.onTextureLoaded)}this.stopListening(u,"loadBase",this.onTextureLoaded),this.listenTo(u,"loadBase",this.onTextureLoaded),s=this.getStandInTexture(e,a.textureUsage),this.engine.needsRender=!0,u.isUnloaded()?u.load():u.isBaseLoaded()&&this.onTextureLoaded.call(this,u),u.isBaseLoaded()&&(o=!1)}else s=null;break;case"b":a.animation&&s&&(t.timeValueInUse=!0),s=s?1:0;break;case"v":a.animation&&(s.x||s.y||s.z||s.w)&&(t.timeValueInUse=!0);break;case"o":s=a.options[s]}o&&this.setThreeValue(e,s),a.forceUpdate&&Object.keys(t.materialObjectTypes).forEach(function(e){r.runtimeData[e].needsUpdate=!0})}},t.prototype.getThreeValue=function(e,t){var r,i=this.getShader(),n=i.getProperty("parameters"),a=n[e],o=a.uniformName||e;if(a.isRenderParam)r=this.runtimeData[t][o];else if(a.isUniform){var u=this.runtimeData[t].uniforms[o];r=u?u.value:null}if("c"===a.type)r||(r=new s.Color(a.default.r,a.default.g,a.default.b));else if("v"===a.type.charAt(0)&&!r){var p=a.default;switch(a.type.charAt(1)){case"4":r=new s.Vector4(p.x,p.y,p.z,p.w);break;case"3":r=new s.Vector3(p.x,p.y,p.z);break;case"2":r=new s.Vector2(p.x,p.y)}}return r},t.prototype.setThreeValue=function(e,r){var i=this;if(this.runtimeData){var n=this.getShader(),a=n.getProperty("parameters"),o=a[e],s=o.uniformName||e;Object.keys(t.materialObjectTypes).forEach(function(t){var n=i.getThreeValue(e,t);if("c"===o.type)n.setRGB(r.r,r.g,r.b);else if("b"===o.type)n=!!r;else if("v"===o.type.charAt(0))switch(o.type.charAt(1)){case"4":n.w=r.w;case"3":n.z=r.z;case"2":n.x=r.x,n.y=r.y}else"t"===o.type?(n&&r&&n.encoding===r.encoding&&n.mapping===r.mapping||(i.runtimeData[t].needsUpdate=!0),n=r):n=r;if(o.isUniform){var a=i.runtimeData[t].uniforms[s];if(!a)throw new Error("Trying to set non-existent uniform "+s);a.value=n}o.isRenderParam&&(i.runtimeData[t][s]=n)})}},t.prototype.setExtension=function(e,r){var i=this;this.runtimeData&&Object.keys(t.materialObjectTypes).forEach(function(t){i.runtimeData[t].extensions&&i.runtimeData[t].extensions.hasOwnProperty(e)&&(i.runtimeData[t].extensions[e]=r)})},t.prototype.onTextureDeleted=function(e){var t=this,r=this.getOwnProperties(),i=Object.keys(r).filter(function(t){return r[t]===e});i.forEach(function(e){t.setProperty(e,null)})},t.builtInAssetDescriptors={missingMaterial:{id:"missingMaterial",type:"material",properties:{name:"Missing Material",albedoColor:{r:.8275,g:.8275,b:.8275}}}},t.materialObjectTypes={static:{lights:!0,fog:!0,skinning:!1},skinned:{lights:!0,fog:!0,skinning:!0},staticTangents:{lights:!0,fog:!0,skinning:!1,defines:{USE_TANGENTS:!0}},skinnedTangents:{lights:!0,fog:!0,skinning:!0,defines:{USE_TANGENTS:!0}},depthStatic:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!1,defines:{DEPTH_PASS:!0}},depthSkinned:{lights:!1,fog:!1,vertexColors:s.NoColors,skinning:!0,defines:{DEPTH_PASS:!0}}},t.sharedUniforms={time:{type:"f",value:0},screenDimensions:{type:"v4",value:new s.Vector4}},t.timeValueInUse=!1,t}(u.default);c.addSchemas("MaterialAsset",d),t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i;(function(e){e[e.BUFFER=1]="BUFFER",e[e.IMAGE=2]="IMAGE",e[e.VIDEO=3]="VIDEO",e[e.ENTITIES=4]="ENTITIES",e[e.JSON=5]="JSON"})(i||(i={})),t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(39),a=i.__assign({},n.default,{id:"baseObject",title:"BaseObjectDef",properties:i.__assign({},n.default.properties,{parentId:{type:"string",description:"The ID of the entity's parent."},prefabAssetId:{type:"string"},prefabObjectId:{type:"string"},prefabInstanceId:{type:"string"},children:{type:"array",items:{type:"string"},default:[],description:"The IDs of this entity's children."},previousChildren:{type:"array",items:{type:"string"},default:[],description:"The previous IDs of this entity's children."},properties:{$ref:"baseObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(40),a=i.__assign({},n.default,{id:"baseObjectProperties",title:"BaseObjectPropertiesDef",properties:i.__assign({},n.default.properties,{position:{$ref:"vector3.json",default:{x:0,y:0,z:0}},quaternion:{$ref:"vector4.json",default:{x:0,y:0,z:0,w:1}},scale:{$ref:"vector3.json",default:{x:1,y:1,z:1}},castShadow:{type:"boolean",default:!0},receiveShadow:{type:"boolean",default:!0},visible:{type:"boolean",default:!0},bounds:{$ref:"box3.json",description:"#read-only"}})});t.default=a},function(e,t,r){var i=r(270),n=r(271),a=n;a.v1=i,a.v4=n,e.exports=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(9),s=r(6),u=r(12),p=r(12),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.createColorTexture=function(e,t,r,i){void 0===e&&(e=255),void 0===t&&(t=255),void 0===r&&(r=255);var n=a.RGBFormat,o=void 0!==i?4:3,s=new Uint8Array(o);s[0]=e,s[1]=t,s[2]=r,4===o&&(s[3]=i,n=a.RGBAFormat);var u=new a.DataTexture(s,1,1,n,void 0,void 0,void 0,void 0,void 0,void 0);return u.needsUpdate=!0,u},t.createColorTextureCube=function(e,r,i,n){void 0===e&&(e=255),void 0===r&&(r=255),void 0===i&&(i=255);var o=[0,1,2,3,4,5].map(function(a){return t.createColorTexture(e,r,i,n)}),s=new a.CubeTexture(o);return s.generateMipmaps=!1,s.format=o[0].format,s.minFilter=a.NearestFilter,s.magFilter=a.NearestFilter,s.needsUpdate=!0,s},t.getBytesPerPixel=function(e,t){var r=0;switch(t){case"float":case"uInt":case"int":r=4;break;case"halfFloat":case"short":case"uShort":r=2;break;case"uByte":case"byte":r=1;break;case"uShort4444":case"uShort5551":case"uShort565":return 2}return u.default.getChannelCountFromFormat(e)*r},t.getMissingTexture=function(){return t.missingTexture2d||(t.missingTexture2d=t.createColorTexture()),t.missingTexture2d},t.getMissingTextureCube=function(){return t.missingTextureCube||(t.missingTextureCube=t.createColorTextureCube()),t.missingTextureCube},t.prototype.initialize=function(){var t=this;e.prototype.initialize.call(this),this.listenTo(this.engine,"imageUnloaded",function(e){t.getProperty("imageId")===e&&t.unload()})},t.prototype.createRuntimeData=function(e){var r=this,i=function(){r.runtimeData=t.getMissingTexture(),r.setState(o.StateType.Base,o.State.Failed),r.trigger("loadProgress",r),"function"==typeof e&&e.call(r)},n=this.getImage();if(n){var a=function(t){return t.runtimeData?(r.createTextureData(t.runtimeData),void("function"==typeof e&&e.call(r))):void i()};this.listenTo(n,"load",a),n.isLoaded()&&a.call(this,n),n.isUnloaded()&&n.load()}else i()},t.prototype.createTextureData=function(e){n.default.warn("Need to implement createTextureData in derrived class.")},t.prototype.unload=function(){var t=this.getImage();t&&this.stopListening(t,"load"),this.runtimeData&&(this.engine.trigger("textureUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading texture, "+this.getName()),this.runtimeData.dispose()),e.prototype.unload.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r);var i=this.runtimeData instanceof a.WebGLRenderTarget?this.runtimeData.texture:this.runtimeData;t.hasOwnProperty("wrapModeU")&&(i.wrapS=this.getThreeAddressMode(this.getAddressModeU())),t.hasOwnProperty("wrapModeV")&&(i.wrapT=this.getThreeAddressMode(this.getAddressModeV())),t.hasOwnProperty("anisotropy")&&(i.anisotropy=this.getProperty("anisotropy")),t.hasOwnProperty("minFilter")&&(i.minFilter=this.getThreeFilter(this.getMinFilter())),t.hasOwnProperty("magFilter")&&(i.magFilter=this.getThreeFilter(this.getMagFilter())),t.hasOwnProperty("useMipmap")&&(i.generateMipmaps=this.isMipmapsEnabled()),this.engine.needsRender=!0},t.prototype.applyPropertiesUnloaded=function(t){if(void 0===t&&(t={}),e.prototype.applyPropertiesUnloaded.call(this,t),t.hasOwnProperty("imageId")){var r=this.getPreviousProperty("imageId");r&&this.unregisterDependencyById(r),t.imageId&&this.registerDependencyById(this.getProperty("imageId"))}this.engine.trigger("textureChanged",this.id,t); },t.prototype.getAddressModeU=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeU"))},t.prototype.getAddressModeV=function(){return this.getSupportedAddressMode(this.getProperty("wrapModeV"))},t.prototype.getSupportedAddressMode=function(e){var t=this.getImage();return t&&!t.isPowerOfTwo()?"clampToEdge":e},t.prototype.getLayout=function(){var e=this.getProperty("layout");if(e)return e;var t=this.getImage();return t?t.getProperty("layout"):p.ImageLayout.Normal},t.prototype.getWidth=function(){var e=this.getImage();return e?e.getWidth():1},t.prototype.getHeight=function(){var e=this.getImage();return e?e.getHeight():1},t.prototype.getMinFilter=function(){return this.getSupportedFilter(this.getProperty("minFilter"))},t.prototype.getMagFilter=function(){return this.getSupportedFilter(this.getProperty("magFilter"))},t.prototype.getSupportedFilter=function(e){var t=this.getDataType();if(!this.isLinearFilterAvailableForType(t))return"nearest";if(!this.isMipmapsEnabled())switch(e){default:case"nearest":case"nearestWithNearestMipmap":case"nearestWithLinearMipmap":return"nearest";case"linear":case"linearWithNearestMipmap":case"linearWithLinearMipmap":return"linear"}return e},t.prototype.getBytesPerPixel=function(){return t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.getDataType=function(){var e=this.getProperty("type"),t=e,r=this.engine.getThreeRenderer(),i=r.extensions;switch(e){case"float":if(i.get("OES_texture_float")){t="float";break}case"halfFloat":t=i.get("OES_texture_half_float")?"halfFloat":"uByte";break;default:t=e}return t},t.prototype.getEncoding=function(){var e=this.getProperty("encoding");if(e)return e;var t=this.getImage();if(!t)return"srgb";var r=t.getChosenRepresentation();if(!r)return"srgb";switch(r.colorspace){case"rgb":case"gray":return"linear";default:return"srgb"}},t.prototype.getFormat=function(){var e=this.getOwnProperty("format");if(!e){var t=this.getImage();if(t)return t.getFormat()}return this.getProperty("format")},t.prototype.getThreeFormat=function(){return u.default.getThreeImageFormat(this.getFormat())},t.prototype.getThreeDataType=function(){return u.default.getThreeDataType(this.getDataType())},t.prototype.getThreeEncoding=function(){return u.default.getThreeImageEncoding(this.getEncoding())},t.prototype.getMipCount=function(){if(!this.isMipmapsEnabled())return 1;var e=this.getWidth(),t=this.getHeight(),r=Math.max(e,t);return Math.floor(Math.log2(Math.max(r,1)))+1},t.prototype.getImage=function(){return this.engine.getAssetById(this.getProperty("imageId"))},t.prototype.getDataSizeInMemorySelf=function(){var e=this.getImage();if(e instanceof u.default){var r=e.getChosenRepresentation();if(!r)return e.getDataSizeInMemory();if(r.compression&&"zip"!==r.compression&&"jpeg"!==r.compression)return e.getDataSizeDownloadSelf();if(this.getHdrPackingType(r.channels))return this.getWidth()*this.getHeight()*t.getBytesPerPixel("rgb",this.getDataType())}return this.getWidth()*this.getHeight()*t.getBytesPerPixel(this.getFormat(),this.getDataType())},t.prototype.isCubeMap=function(){return!1},t.prototype.isLinearFilterAvailableForType=function(e){var t=this.engine.getThreeRenderer(),r=t.extensions;switch(e){case"halfFloat":return!!r.get("OES_texture_half_float_linear");case"float":return!!r.get("OES_texture_float_linear");default:return!0}},t.prototype.isMipmapsEnabled=function(){if(!this.isLinearFilterAvailableForType(this.getDataType()))return!1;var e=this.getImage();return!(e&&!e.isPowerOfTwo())&&this.getProperty("useMipmap")},t.prototype.getHdrPackingType=function(e){return e&&4===e.length&&"exponent"===e[3]?"rgbe":null},t.prototype.createDdsTexture=function(e,t){var r=this.parseDDS(e,!0),i=new a.CompressedTexture(null,0,0);i.format=r.format,i.generateMipmaps=!1;var n=function(e){return e.width<=t&&e.height<=t};if(r.isCubemap){i.flipY=!1;for(var o=i.image=[],s=r.mipmaps.length/r.mipmapCount,u=0;u>8&255,e>>16&255,e>>24&255)}function o(e,t,r,i){var n,a,o,s,u,p,c=r*i*4,l=new Uint8Array(e,t,c),d=new Uint8Array(c),h=0,f=0;for(a=0;ae?t.video.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.video&&t.video.height>e?t.video.height:e},0):0},t.prototype.onUpdate=function(){if(this.runtimeData){var e=this.runtimeData.imageData;e&&!e.paused&&!e.error&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.engine.needsRender=!0)}},t.prototype.pause=function(){this.runtimeData&&this.runtimeData.image.pause()},t.prototype.play=function(e,t){this.runtimeData&&(e&&(this.runtimeData.imageData.currentTime=t),this.runtimeData.imageData.play())},t.prototype.stop=function(){this.runtimeData&&(this.runtimeData.imageData.pause(),this.runtimeData.imageData.currentTime=0)},t.prototype.toggle=function(){this.runtimeData&&(this.runtimeData.imageData.paused?this.play():this.pause())},t.prototype.getOriginalWidth=function(){var e=this.getProperty("streams")||[];return e.reduce(function(e,t){return Math.max(t.width||0,e)},0)},t.prototype.getOriginalHeight=function(){var e=this.getProperty("streams")||[];return e.reduce(function(e,t){return Math.max(t.height||0,e)},0)},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxHeight:u},e),i=t.map(function(e){return r.maxHeight-(e.video||{}).height||0}),n=i.reduce(function(e,t,r){var n=e>=0?i[e]:Number.MAX_VALUE;return t>=0&&t=0?t[n]:null},t.events={pause:{params:[],action:!0,category:""},play:{params:[{name:"seek",type:"b",description:"",default:!1},{name:"seekTime",type:"f",description:"",default:0}],action:!0,category:""},stop:{params:[],action:!0,category:""},toggle:{params:[],action:!0,category:""}},t}(n.default);s.addSchemas("VideoAsset",p),t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(10),s=r(14),u=r(23),p=r(4),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.initialize=function(){e.prototype.initialize.call(this),this.engine.on("materialDeleted",this.onMaterialDeleted,this),this.on("setMaterial",this.setMaterial,this),this.on("castShadowsEnable",this.castShadowsEnable,this),this.on("castShadowsDisable",this.castShadowsDisable,this),this.on("castShadowsToggle",this.castShadowsToggle,this)},t.prototype.uninitialize=function(){this.off("setMaterial",this.setMaterial,this),this.off("castShadowsEnable",this.castShadowsEnable,this),this.off("castShadowsDisable",this.castShadowsDisable,this),this.off("castShadowsToggle",this.castShadowsToggle,this),this.engine.off("materialDeleted",this.onMaterialDeleted,this),e.prototype.uninitialize.call(this)},t.prototype.unload=function(t){void 0===t&&(t=!1),this.runtimeData&&(this.runtimeData.material=null,this.runtimeData.geometry=null),e.prototype.unload.call(this,t)},t.prototype.castShadowsDisable=function(){this.setProperty("castShadow",!1)},t.prototype.castShadowsEnable=function(){this.setProperty("castShadow",!0)},t.prototype.castShadowsToggle=function(){var e=!this.getProperty("castShadow");this.setProperty("castShadow",e)},t.prototype.createRuntimeData=function(e){var t=this,r=this.getProperty("geometryId"),i=this.getProperty("skinId"),a=this.engine.materialUtilities.getMissingMaterial(),o=a?a.id:null;Promise.all([this.loadAsset(o),this.loadAsset(r),this.loadAsset(i)]).then(function(){t.createMeshLoaded(),e()}).catch(function(r){t.isDestroyed()||(n.default.error(t.engine.getName()+" - MeshObject: "+r.toString()),t.createDefaultMesh(),"function"==typeof e&&e())})},t.prototype.getGeometry=function(){var e=this.getGeometryAsset();return e?e.getGeometry(u.default.primitiveType.TRIANGLES):null},t.prototype.getGeometryAsset=function(){var e=this.getProperty("geometryId");return e?this.engine.getAssetById(e):null},t.prototype.getLocalBounds=function(e){var r=this.getGeometryAsset();return r?r.getBounds(e):e?e.set(t.defaultLocalBounds.min,t.defaultLocalBounds.max):t.defaultLocalBounds},t.prototype.getMaterial=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=!0),e<0||e>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getPreviousMaterial=function(e,t){if(void 0===e&&(e=0),void 0===t&&(t=!0),e<0||e>=this.getMaterialCount())throw new Error("Invalid index parameter");var r=this.getPreviousMaterialIds()[e];if(r){var i=this.engine.getAssetById(r);if(i)return i}return t?this.engine.materialUtilities.getMissingMaterial():null},t.prototype.getMaterialCount=function(){return this.getMaterialIds().length},t.prototype.getMaterials=function(e){void 0===e&&(e=!0);for(var t=[],r=this.getMaterialCount(),i=0;i=this.getMaterialCount())throw new Error("Invalid index parameter");var r=e instanceof s.default?e.id:e,i=(this.getOwnProperty("materials")||[]).slice();i[t]!==r&&(i[t]=r,this.setProperty("materials",i))},t.prototype.getMaterialIds=function(){for(var e=this.getProperty("materials"),t=this.getPrefabObject(),r=t?t.getProperty("materials"):[],i=[],n=Math.max(e.length,r.length),a=0;athis.pitchAngleBoundsMax?this.targetEuler.x=this.pitchAngleBoundsMax:this.targetEuler.x1&&n.default.warn('Clip "'+e+'" contains multiple layers, but AnimationAsset.prototype.createAnimation() only supports a single layer.');var i=this.getLayer(r.layers[0]),o=i?i.channels.map(function(e){return t.getChannel(e)}):[],s=o.map(function(e){return t.createKeyframeTrack(e,r.start,r.stop)});return new a.AnimationClip(r.name,r.stop-r.start,s)},t.prototype.createKeyframeTrack=function(e,t,r){var i=this,n=e.times.split("#"),o=n[0],u=n[1],p=this.engine.getEntityById(o);if(!p)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+o);var c=p.getAccessor(u),l=p.getArray(u);if(!c||!l)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+u);var d=e.values.split("#"),h=d[0],f=d[1],m=this.engine.getEntityById(h);if(!m)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+h);var y=m.getAccessor(f),g=m.getArray(f);if(!y||!g)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+f);var v,b=e.targetObject.map(function(e){return i.engine.getRuntimeName(e)}),P=b.join("/")+"."+e.targetProperty,x="quaternion"===e.targetProperty?a.QuaternionKeyframeTrack:a.VectorKeyframeTrack,E=-1;for(v=0;v=t){E=v;break}var w=-1;for(v=l.length;v-- >0;)if(l[v]<=r){w=v;break}var _=E>=0?E:0,S=w>=0?w+1:l.length,D=s.default.getTypeSize(y.type),A=l.subarray(_,S),T=g.subarray(_*D,S*D),M=0===t?A:A.slice().map(function(e){return e-t});return new x(P,M,T,null)},t}(o.default);p.addSchemas("AnimationAsset",c),t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.uninitialize=function(){this.runtimeData&&this.runtimeData.pause(),e.prototype.uninitialize.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),this.runtimeData&&(t.hasOwnProperty("loop")&&(this.runtimeData.loop=this.getProperty("loop")),t.hasOwnProperty("state")))switch(this.getProperty("state")){case"pause":this.runtimeData.pause();break;case"play":this.runtimeData.play()}},t}(n.default);a.addSchemas("AudioAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(19),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.createRTImageData(),this.trigger("loadProgress",this),e()},t.prototype.getLayout=function(){return this.getProperty("layout")},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r),(t.hasOwnProperty("format")||t.hasOwnProperty("type")||t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&(this.runtimeData.__webglFramebuffer&&(this.runtimeData.dispose(),delete this.runtimeData.__webglFramebuffer),this.runtimeData.texture.format=this.getThreeFormat(), -this.runtimeData.texture.type=this.getThreeDataType(),this.runtimeData.texture.height=this.getHeight(),this.runtimeData.texture.width=this.getWidth()),this.runtimeData.texture.encoding=this.getThreeEncoding()},t}(n.default);t.default=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(23),s=r(9),u=r(20),p=r(5),c=r(4),l=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(r,t),r.prototype.getBounds=function(e){var t=this.getProperty("bounds"),r=e||new a.Box3;return r.set(t.min,t.max)},r.prototype.getDataSizeInMemorySelf=function(){return 0},r.prototype.applyPropertiesUnloaded=function(e){t.prototype.applyPropertiesUnloaded.call(this,e),e.accessorId&&this.registerBufferDependency()},r.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){var r=t.getDependencies(),i=r.some(function(e){return e.isLoadFailed()});if(i)t.setState(s.StateType.Base,s.State.Failed);else try{t.decode()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},r.prototype.createBufferAttribute=function(e,t,r,i){var n=r.num_points(),o=i.components_count(),s=n*o,u=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,u);for(var p=new Float32Array(s),c=0;c0&&(f.addGroup(v,x,g),v+=x),g=P}}var E=3*c-v;E>0&&f.addGroup(v,E,g),e.destroy(y)}else f.addGroup(0,3*c,-1);var w=this.getProperty("bounds"),_=new a.Vector3(w.min.x,w.min.y,w.min.z),S=new a.Vector3(w.max.x,w.max.y,w.max.z);f.boundingBox=new a.Box3(_,S),f.computeBoundingSphere(),this.addMissingAttributes(f),this.setGeometry(o.default.primitiveType.TRIANGLES,f)},r.prototype.decode=function(){var t=e.Module;if(!t)throw new Error("Draco module not found");var r=u.default.getBufferArray(this.engine,this.getProperty("accessorId")),i=new t.DecoderBuffer;i.Init(r,r.byteLength),i.Init(r,r.byteLength);var a=new t.WebIDLWrapper,o=a.GetEncodedGeometryType(i);if(o===t.TRIANGULAR_MESH){var s=a.DecodeMeshFromBuffer(i);this.createBufferGeometry(t,a,s),t.destroy(s)}else n.default.warn(this.engine.getName()+(" - DracoGeometryAsset: Unrecognized geometry type '"+o+"'"));t.destroy(a),t.destroy(i)},r.prototype.registerBufferDependency=function(){var e=this.getProperty("accessorId"),t=e.split("#");if(2!==t.length)throw new Error(this.engine.getName()+" - DracoGeometryAsset: Invalid accessorId, "+e);this.registerDependencyById(t[0])},r}(o.default);c.addSchemas("DracoGeometryAsset",l),t.default=l}).call(t,r(74))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(9),o=r(12),s=r(11),u=r(15),p=r(4),c=["red","green","blue"],l="rgb",d=16384,h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadPriority=2,t}return i.__extends(t,e),t.prototype.unload=function(){this.runtimeData&&(this.engine.trigger("imageUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading image, "+this.getName()),e.prototype.unload.call(this))},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.isCompressed=function(){return this.runtimeData?"jpeg"!==this.runtimeData.compression&&"zip"!==this.runtimeData.compression:this.getProperty("useCompression")},t.prototype.getCompressionFormat=function(){if(this.getProperty("useCompression")){var e=this.engine.getThreeRenderer();if(e){var t=e.extensions;if(t.get("WEBGL_compressed_texture_s3tc"))return"dxt";if(t.get("WEBGL_compressed_texture_pvrtc"))return"pvrtc"}}},t.prototype.getFormat=function(){var e=this.getChosenRepresentation();if(e.channels)switch(e.channels.length){case 4:return"alpha"===e.channels[3]?"rgba":"rgb";case 3:return"rgb";case 2:return"luminanceAlpha";case 1:return"luminance";default:return l}},t.prototype.getOriginalWidth=function(){return this.getProperty("width")||0},t.prototype.getOriginalHeight=function(){return this.getProperty("height")||0},t.prototype.getMaxRepresentationWidth=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.width>e?t.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.height>e?t.height:e},0):0},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.getImageResponseType=function(e){switch(e){case"image/vnd-ms.dds":return"arraybuffer";default:return"blob"}},t.prototype.applyPropertiesUnloaded=function(e){var t={maxSize:Math.max(this.getWidth(),this.getHeight()),compression:this.getCompressionFormat()};this.chosenRepresentation=this.findRepresentation(t)},t.prototype.createRuntimeData=function(e){var t=this;if(!this.chosenRepresentation)throw new Error("No suitable representation found to load");this.loadLowResImage(e).then(function(){return t.loadHighResImage(e)}).catch(this.onImageLoadError.bind(this))},t.prototype.loadLowResImage=function(e){var t=this;if(this.loadPriority=2,!this.getProperty("stream"))return Promise.resolve();var r={maxSize:64},i=this.findRepresentation(r);return i?new Promise(function(r,n){var a=t.loadResource(i.src,u.default.IMAGE,e,{priority:t.loadPriority,responseType:t.getImageResponseType(i.contentType),isExternal:i.isExternal});a.once(s.default.LOAD,function(e){t.onImageLoad(e,i),t.loadPriority=8,r()}),a.once(s.default.CANCEL,function(){n(new Error("Failed to load low res texture"))}),a.once(s.default.ERROR,n)}):Promise.resolve()},t.prototype.loadHighResImage=function(e){var t=this;if(!this.isDestroyed())return new Promise(function(r,i){var n=function(e){t.isDestroyed()||(t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t))};t.setState(a.StateType.Base,a.State.InProgress);var o=t.chosenRepresentation,p=t.loadResource(o.src,u.default.IMAGE,e,{responseType:t.getImageResponseType(o.contentType),isExternal:o.isExternal,priority:t.loadPriority});p.once(s.default.PROGRESS,n),p.once(s.default.LOAD,function(e){t.onImageLoad(e,o)}),p.once(s.default.ERROR,i)})},t.prototype.onImageLoad=function(e,t){if(this.runtimeData||(this.runtimeData={}),this.runtimeData.contentType=t.contentType,this.runtimeData.compression=t.compression,this.runtimeData.colorspace=t.colorspace,this.runtimeData.channels=t.channels||c,this.runtimeData.width=t.width,this.runtimeData.height=t.height,!(e instanceof ArrayBuffer||e instanceof Image))throw new Error("Unknown container type for image data!");this.runtimeData.imageData=e,this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this)},t.prototype.onImageLoadError=function(e){this.isDestroyed()||(n.default.error("There was an error loading the image, "+this.getName(),e),this.setState(a.StateType.Base,a.State.Failed),this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this))},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxSize:d},e),i=t.filter(function(e){if(e.compression===r.compression)return!0;switch(e.compression){case"zip":case"jpeg":return!r.compression;case"dxt":case"dxt1":case"dxt5":return"dxt"===r.compression}return!1});0===i.length&&(i=t.filter(function(e){return"zip"===e.compression||"jpeg"===e.compression}));var n=i.filter(function(e){var t=e.channels||c;return!r.channels||t.toString()===r.channels.toString()});0===n.length&&(n=i);var a=["image/vnd-ms.dds"],o=n.filter(function(e){var t=Math.max(e.width,e.height),i=a.indexOf(e.contentType)!==-1;return t<=r.maxSize||i}),s=o.reduce(function(e,t,r){var i=Math.max(t.width,t.height),n=e>=0?Math.max(o[e].width,o[e].height):0;return i>n?r:e},-1);return s>=0?o[s]:null},t}(o.default);p.addSchemas("ImageAsset",h),t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(23),s=r(9),u=r(20),p=r(5),c=r(4),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDataSizeInMemorySelf=function(){var e=this,t=this.getProperty("attributes");return Object.keys(t).map(function(r){var i=t[r],n=u.default.getBufferAccessor(e.engine,i.accessorId);return u.default.getComponentTypeSize(n.componentType)*u.default.getTypeSize(n.type)*n.count}).reduce(function(e,t){return t+e},0)},t.prototype.applyPropertiesUnloaded=function(t){e.prototype.applyPropertiesUnloaded.call(this,t),(t.attributes||t.indices)&&this.registerBufferDependency()},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){var r=t.getDependencies(),i=r.some(function(e){return e.isLoadFailed()});if(i)t.setState(s.StateType.Base,s.State.Failed);else try{t.createBufferGeometry()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},t.prototype.createAttributes=function(e){var t=this,r={indices:"index",positions:"position",normals:"normal",tangents:"tangent",colors:"color",uvs1:"uv",uvs2:"uv2",skinIndices:"skinIndex",skinWeights:"skinWeight"},i=Object.assign({indices:{accessorId:this.getProperty("indices")}},this.getProperty("attributes")),n={};return p.forEach(r,function(r,a){if(i.hasOwnProperty(a)){var o=i[a].accessorId;n[r]=t.createBufferAttribute(o,e[r])}}),n},t.prototype.createBufferAttribute=function(e,t){var r=u.default.getBufferAccessor(this.engine,e),i=u.default.getBufferArray(this.engine,e),n=u.default.getTypeSize(r.type);if(void 0===t||n===t)return new a.BufferAttribute(i,n);for(var o=new i.constructor(r.count*t),s=Math.min(n,t),p=0;p=this.updateFrameInterval&&this.isEnabled()&&(this.framesElapsed=0,this.captureScene()))},t.prototype.getCubeCamera=function(){return this.cubeCamera},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTextureCube({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_cube"),this.tempRenderTexture.load()},t.prototype.initCameras=function(){this.cubeCamera=new n.Object3D;var e=90,t=1;this.cameraPX=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraPX.up.set(0,-1,0),this.cameraPX.lookAt(new n.Vector3(1,0,0)),this.cubeCamera.add(this.cameraPX),this.cameraNX=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraNX.up.set(0,-1,0),this.cameraNX.lookAt(new n.Vector3(-1,0,0)),this.cubeCamera.add(this.cameraNX),this.cameraPY=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraPY.up.set(0,0,1),this.cameraPY.lookAt(new n.Vector3(0,1,0)),this.cubeCamera.add(this.cameraPY),this.cameraNY=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraNY.up.set(0,0,-1),this.cameraNY.lookAt(new n.Vector3(0,-1,0)),this.cubeCamera.add(this.cameraNY),this.cameraPZ=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraPZ.up.set(0,-1,0),this.cameraPZ.lookAt(new n.Vector3(0,0,1)),this.cubeCamera.add(this.cameraPZ),this.cameraNZ=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraNZ.up.set(0,-1,0),this.cameraNZ.lookAt(new n.Vector3(0,0,-1)),this.cubeCamera.add(this.cameraNZ)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(5),o=r(1),s=r(2),u=function(e){function t(){var t=e.call(this)||this;return t.controlPoints=void 0,t.prevControlPointsLength=0,t.closed=!1,t.tempVector=new o.Vector3,t.tempVector4=new o.Vector4,t.tempMatrix=new o.Matrix4,t.visualizationCurveColor=2236962,t.visualizationSelectedCurveColor=874150,t.orientationHelpers=[],t.canTryUpdateAgain=!0,t.curveMaterial=void 0,t.curveGeometry=void 0,t.curveMesh=void 0,t.curveTessellation=200,t.selected=!1,t.updateStarted=!1,t}return i.__extends(t,e),t.prototype.onSelected=function(){this.selected=!0,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationSelectedCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!0})})},t.prototype.onUnselected=function(){this.selected=!1,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!1})})},t.prototype.isCurveInit=function(){return this.curve.points.length>0},t.prototype.onStartup=function(){this.initCurve()},t.prototype.onAttributesChanged=function(){this.initCurve()},t.prototype.onShutdown=function(){this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.cleanupCurveMaterial()},t.prototype.initCurve=function(){!this.updateStarted&&this.controlPoints&&this.controlPoints.length&&(this.updateStarted=!0,this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.prevControlPointsLength=this.controlPoints.length,this.createCurve(),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh(),this.updateOrientationHelpers()))},t.prototype.createCurve=function(){var e=this;this.controlPoints.forEach(function(t){return t.off("change:properties",e.updateCurve,e)}),this.curve=new o.CatmullRomCurve3,this.closed&&(this.curve.closed=!0);var t=this.getEntity().getRootObject();t.when("loadDependencies",function(r){t.runtimeData.updateMatrixWorld(!0),a.forEach(e.controlPoints,function(t){if(t){var r=t.getPosition().clone();e.curve.points.push(r),e.tempMatrix.makeRotationFromQuaternion(t.runtimeData.quaternion);var i=e.tempMatrix.toArray();e.tempVector.set(i[0],i[1],i[2]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,r,.25,16711680)),e.tempVector.set(i[4],i[5],i[6]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,r,.25,65280)),e.tempVector.set(i[8],i[9],i[10]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,r,.25,255)),t.on("change:properties",e.updateCurve,e)}else e.tempVector.set(0,0,0),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680))}),e.updateCurve({}),e.updateStarted=!1,e.selected||e.onUnselected(),e.trigger("curveInit")},this)},t.prototype.updateCurve=function(e){var t=this,r=0;e.hasOwnProperty("position")&&(a.forEach(this.controlPoints,function(e){e&&(e.runtimeData.parent?(e.getPosition(t.tempVector),t.tempVector4.set(t.tempVector.x,t.tempVector.y,t.tempVector.z,1),t.tempVector4.applyMatrix4(e.runtimeData.parent.matrixWorld),t.curve.points[r].set(t.tempVector4.x,t.tempVector4.y,t.tempVector4.z),r++):t.canTryUpdateAgain&&(t.canTryUpdateAgain=!1,setTimeout(function(){n.default.info("Trying again"),t.updateCurve({})},10)))}),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh()),this.canTryUpdateAgain=!0),e.hasOwnProperty("quaternion")&&this.updateOrientationHelpers()},t.prototype.cleanupCurveMaterial=function(){this.curveMaterial&&(this.curveMaterial.dispose(),this.curveMaterial=void 0)},t.prototype.cleanupOrientationHelpers=function(){var e=this;this.orientationHelpers.forEach(function(t){e.getRootThreeObject().remove(t)}),this.orientationHelpers=[]},t.prototype.cleanupCurveMesh=function(){this.enableVisualizations&&this.curveMesh&&(this.getRootThreeObject().remove(this.curveMesh),this.curveGeometry.dispose(),this.curveMesh.material=void 0)},t.prototype.createCurveMesh=function(){var e=this;this.curveMaterial||(this.curveMaterial=new o.MeshPhongMaterial({color:this.visualizationCurveColor,transparent:!1,opacity:.75,blending:o.AdditiveBlending})),this.curve.points.length&&(this.curveGeometry=new o.TubeGeometry(this.curve,this.curveTessellation,.1,8,this.closed),this.curveMesh=new o.Mesh(this.curveGeometry,this.curveMaterial),this.getRootObject().when("loadBase",function(){e.getRootThreeObject().add(e.curveMesh),a.forEach(e.orientationHelpers,function(t){e.getRootThreeObject().add(t)})},this),this.updateOrientationHelpers())},t.prototype.updateOrientationHelpers=function(){var e=this;this.controlPoints.forEach(function(t,r){var i=t.runtimeData;e.orientationHelpers[3*r].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+1].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+2].position.copy(e.curve.points[r]),e.tempMatrix.makeRotationFromQuaternion(i.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers[3*r].setDirection(e.tempVector),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers[3*r+1].setDirection(e.tempVector),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers[3*r+2].setDirection(e.tempVector)})},t}(s.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this;this.logTag=document.createElement("div"),this.logTag.id="consoleLogger",this.logTag.style.position="absolute",this.logTag.style.top="0",this.logTag.style.left="0",this.logTag.style.width="100%",this.logTag.style.height="100%",this.logTag.style.margin="0",this.logTag.style.padding="0",this.logTag.style.color="#000",this.logTag.style.background="rgba(0,0,0,0.5)",this.logTag.style.fontWeight="bold",this.logTag.style.textAlign="left",this.logTag.style.overflow="scroll",this.logTag.style["pointer-events"]="none",this.logTag.style["z-index"]="1",window.document.body.appendChild(this.logTag),this.oldLog=window.console.log,this.oldError=window.console.error,this.oldWarn=window.console.warn,window.console.log=window.console.error=window.console.warn=function(t){e.logTag.innerHTML+=t+"
"}},t.prototype.onShutdown=function(){this.logTag&&(window.document.body.removeChild(this.logTag),window.console.log=this.oldLog,window.console.error=this.oldError,window.console.warn=this.oldWarn,this.logTag=void 0)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(269),o=function(e){function t(){var t=e.call(this)||this;return t.stats=new a,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.stats.showPanel(0)},t.prototype.onPreUpdate=function(){this.isEnabled()&&this.stats.begin()},t.prototype.onPostRender=function(){this.isEnabled()&&this.stats.end()},t.prototype.onEnable=function(){document.body.appendChild(this.stats.dom),this.initialized=!0},t.prototype.onDisable=function(){this.initialized&&(document.body.removeChild(this.stats.dom),this.initialized=!1)},t}(n.default);t.default=o},function(e,t,r){"use strict";function i(e,t){if(e&&e.style)for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r])}function n(e,t){e.classList?e.classList.add(t):e.className+=" "+t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),o=r(1),s=r(2),u=r(5),p=r(19),c=r(217),l={position:"absolute",left:"0",top:"0",padding:"8px","border-radius":"5px","font-family":"proxima_nova_regular,Helvetica,Arial,sans-serif","max-width":"25%","min-width":"25px",transition:"opacity 0.1s ease-in-out, background 0.1s ease-in-out",cursor:"pointer"},d=function(e){function t(){var t=e.call(this)||this;return t.renderEventName="render",t.textureRegistryById={},t}return a.__extends(t,e),t.prototype.onAwake=function(){this.getEngine().on("assetLoaded",this.registerTexture,this),this.getEngine().on("assetUnloaded",this.unregisterTexture,this)},t.prototype.onStartup=function(){var e=this;this.init2dScene(),this.initCubeScene(),this.renderEventName+="Group"+this.renderGroup,this.getEngine().on(this.renderEventName,this.renderView,this),this.listenTo(this.getEngine(),"rendererResize",this.resize),this.getEngine().getAssetsByClass(p.default).forEach(function(t){return e.registerTexture(t)}),this.resize()},t.prototype.onShutdown=function(){this.getEngine().off("assetLoaded",this.registerTexture,this),this.getEngine().off("assetUnloaded",this.unregisterTexture,this),this.getEngine().off(this.renderEventName,this.renderView,this)},t.prototype.init2dScene=function(){this.camera2D=new o.OrthographicCamera(-1,1,1,-1,0,1),this.scene2D=new o.Scene,this.material2D=new o.ShaderMaterial(c.default),this.material2D.transparent=!0,this.mesh2D=new o.Mesh(new o.PlaneGeometry(2,2),this.material2D),this.scene2D.add(this.mesh2D)},t.prototype.initCubeScene=function(){var e=90,t=1,r=o.ShaderLib.cube;this.sceneCube=new o.Scene,this.geoCube=new o.BoxGeometry(100,100,100),this.materialCube=new o.ShaderMaterial({fragmentShader:r.fragmentShader,vertexShader:r.vertexShader,uniforms:r.uniforms,depthWrite:!1,depthTest:!1,side:o.BackSide}),this.meshCube=new o.Mesh(this.geoCube,this.materialCube),this.cameraPX=new o.PerspectiveCamera(e,t,1,1e3),this.cameraPX.up.set(0,1,0),this.cameraPX.lookAt(new o.Vector3(1,0,0)),this.sceneCube.add(this.cameraPX),this.cameraNX=new o.PerspectiveCamera(e,t,1,1e3),this.cameraNX.up.set(0,1,0),this.cameraNX.lookAt(new o.Vector3(-1,0,0)),this.sceneCube.add(this.cameraNX),this.cameraPY=new o.PerspectiveCamera(e,t,1,1e3),this.cameraPY.up.set(0,0,-1),this.cameraPY.lookAt(new o.Vector3(0,1,0)),this.sceneCube.add(this.cameraPY),this.cameraNY=new o.PerspectiveCamera(e,t,1,1e3),this.cameraNY.up.set(0,0,1),this.cameraNY.lookAt(new o.Vector3(0,-1,0)),this.sceneCube.add(this.cameraNY),this.cameraPZ=new o.PerspectiveCamera(e,t,1,1e3),this.cameraPZ.up.set(0,1,0),this.cameraPZ.lookAt(new o.Vector3(0,0,1)),this.sceneCube.add(this.cameraPZ),this.cameraNZ=new o.PerspectiveCamera(e,t,1,1e3),this.cameraNZ.up.set(0,1,0),this.cameraNZ.lookAt(new o.Vector3(0,0,-1)),this.sceneCube.add(this.cameraNZ),this.sceneCube.add(this.meshCube)},t.prototype.setTexture=function(e){var t=this;this.currentTexture=this.textureRegistryById[e],this.currentTexture?this.currentTexture.load(function(){switch(t.currentTexture.type){case"renderTextureCube":case"textureCube":t.materialCube.uniforms.tCube.value=t.currentTexture.getThreeTexture();break;case"texture2D":case"renderTexture2D":t.material2D.uniforms.tDiffuse.value=t.currentTexture.getThreeTexture()}t.mesh2D.visible=!0,t.meshCube.visible=!0}):(this.mesh2D.visible=!1,this.meshCube.visible=!1)},t.prototype.updateViewport=function(){var e,t=this.getEngine().getRenderer().getWidth(),r=this.getEngine().getRenderer().getHeight();"%"===this.viewportBottom.slice(-1)?(e=.01*parseFloat(this.viewportBottom.slice(0,-1)),this.y=e*r):this.y=parseInt(this.viewportBottom,10),"%"===this.viewportLeft.slice(-1)?(e=.01*parseFloat(this.viewportLeft.slice(0,-1)),this.x=e*t):this.x=parseInt(this.viewportLeft,10),"%"===this.viewportWidth.slice(-1)?(e=.01*parseFloat(this.viewportWidth.slice(0,-1)),this.width=e*t):this.width=parseInt(this.viewportWidth,10),"%"===this.viewportHeight.slice(-1)?(e=.01*parseFloat(this.viewportHeight.slice(0,-1)),this.height=e*r):this.height=parseInt(this.viewportHeight,10),this.x<0&&(this.x+=t),this.y<0&&(this.y+=r)},t.prototype.updateTextureDropdown=function(){var e=this;this.isEnabled()&&setTimeout(function(){var t;if(!e.textureDropDown){if(e.textureDropDown=document.createElement("select"),e.textureDropDown.name="Textures",e.textureDropDown.id="Textures",n(e.textureDropDown,"debugger-dropdown"),i(e.textureDropDown,l),!e.getThreeRenderer())return;var r=e.getThreeRenderer().domElement;r.parentElement?r.parentElement.appendChild(e.textureDropDown):r.appendChild(e.textureDropDown),e.textureDropDown.onchange=function(){e.setTexture(e.textureDropDown.value)}}e.textureDropDown.options.length=0,t=document.createElement("option"),t.value=0,t.text="None",e.textureDropDown.appendChild(t),u.forEach(e.textureRegistryById,function(r,i){t=document.createElement("option"),t.value=i,t.text=""!==r.name?r.getName():i,e.textureDropDown.appendChild(t)}),e.textureDropDown.style.top=e.getEngine().getRenderer().getHeight()-e.y-e.height+"px",e.textureDropDown.style.left=e.x+"px",e.textureDropDown.style.zIndex="200"},0)},t.prototype.resize=function(){this.isEnabled()&&(this.updateTextureDropdown(),this.updateViewport())},t.prototype.renderView=function(){var e=this.getThreeRenderer();if(this.isEnabled()&&this.currentTexture)switch(e.setRenderTarget(null),this.currentTexture.type){case"texture2D":case"renderTexture2D":e.setViewport(this.x,this.y,this.width,this.height),e.render(this.scene2D,this.camera2D);break;case"textureCube":case"renderTextureCube":var t=.25*this.width,r=.3333*this.height;e.setViewport(this.x,this.y+r,t,r),e.render(this.sceneCube,this.cameraPX,null,!1),e.setViewport(this.x+1.999*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNX,null,!1),e.setViewport(this.x+t,this.y+1.99*r,t,r),e.render(this.sceneCube,this.cameraPY,null,!1),e.setViewport(this.x+t,this.y,t,r),e.render(this.sceneCube,this.cameraNY,null,!1),e.setViewport(this.x+t,this.y+r,t,r),e.render(this.sceneCube,this.cameraPZ,null,!1),e.setViewport(this.x+2.99*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNZ,null,!1)}},t.prototype.registerTexture=function(e){if(e)switch(e.type){case"renderTextureCube":case"textureCube":case"texture2D":case"renderTexture2D":this.textureRegistryById[e.id]=e}},t.prototype.unregisterTexture=function(e){e&&this.textureRegistryById[e.id]&&delete this.textureRegistryById[e.id]},t}(s.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(){function e(e,t,r,i){this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i,this.previousValues={},this.lastTimeSavings=0,this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i}return e}();t.QualityChangeLevel=a;var o=.9,s=function(e){function t(){var t=e.call(this)||this;return t.QualityChangeLevel=a,t.frameTimeThreshold=33.333333333,t.testInterval=2e3,t.qualityChangeLevels=[],t.currentLevel=t.qualityChangeLevels.length,t.elapsedRenderTime=0,t.framesRecorded=0,t.justStarted=!0,t.justAutoSteppedDown=!1,t.autoOptimize=!0,t}return i.__extends(t,e),t.prototype.setQualityChangeLevels=function(e){this.setMaxQuality(),this.qualityChangeLevels=e,this.currentLevel=this.qualityChangeLevels.length,this.isEnabled()&&(this.autoOptimize=!0)},t.prototype.setFrameTimeThreshold=function(e){this.frameTimeThreshold=e},t.prototype.setTestInterval=function(e){this.testInterval=e,this.elapsedRenderTime=0,this.framesRecorded=0},t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&(this.elapsedRenderTime+=1e3*e,this.framesRecorded++,!(this.elapsedRenderTimethis.frameTimeThreshold?(this.stepRenderingQualityDown(),this.justAutoSteppedDown=!0):this.qualityChangeLevels[this.currentLevel]&&this.lastAvgFrameTime0;)this.currentLevel=this.currentLevel>1?this.currentLevel-1:0,e=!this.stepRenderingQuality(!1);e||(this.qualityChangeLevels[this.currentLevel].frameTimeAtDrop=this.lastAvgFrameTime)},t.prototype.stepRenderingQualityUp=function(){for(var e=!0;e&&this.currentLevelthis.time?1:n(Math.max(0,Math.min(1,this.currentTime/this.time)));this.objects.forEach(function(e,i){var n=e.runtimeData.parent.worldToLocal(l.copy(t.destinations[i])).clone(),a=t.direction>0?t.sources[i]:n,o=t.direction>0?n:t.sources[i];l.lerpVectors(a,o,r),e.setPosition(l.x,l.y,l.z)}),this.currentTime>this.time&&this.getEntity().trigger(this.direction>0?"endExplode":"endContract")}},t.prototype.reset=function(){var e=this;this.objects.forEach(function(t,r){t.setPosition(e.sources[r].x,e.sources[r].y,e.sources[r].z)}),this.objects.length=0,this.sources.length=0,this.destinations.length=0,this.currentTime=this.time},t.prototype.contract=function(){this.isEnabled()&&(this.direction=-1,this.currentTime=0,this.getEntity().trigger("beginContract"))},t.prototype.explode=function(e,t){var r=this;if(this.isEnabled()){this.reset();var i=this.getEntity().getDescendantsByType("mesh"),n=this.getEntity().getCenter();n.applyMatrix4(this.getRuntimeData().matrixWorld);var a=new p.Quaternion;a.setFromRotationMatrix(this.getRuntimeData().matrixWorld);var o=this.getFormationFunc(e||this.formation,i.length,n,a,t||this.scale).bind(this);i.forEach(function(e,t){o(t,l,e),r.objects.push(e),r.sources.push(e.getPosition()),r.destinations.push(l.clone())}),this.currentTime=0,this.direction=1,this.getEntity().trigger("beginExplode")}},t.prototype.toggleExplode=function(){this.direction>0?this.contract():this.explode()},t.prototype.getFormationFunc=function(e,t,r,i,n){switch(e){case"Grid":return a(t,r,n,i);case"Scale":return o(r,n);default:case"Circle":return s(t,r,n,i)}},t}(c.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=e.call(this)||this;return t.el=void 0,t.fsEnabled=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.toggle=this.toggle.bind(this),this.getEntity().on("toggleFullscreen",this.toggle,this),this.listenTo(this.getGlobalEvents(),"fullscreen::toggle",this.toggle),this.listenTo(this.getGlobalEvents(),"fullscreen::enable",this.enableFullscreen),this.listenTo(this.getGlobalEvents(),"fullscreen::disable",this.disableFullscreen)},t.prototype.toggle=function(){this.fsEnabled?this.disableFullscreen():this.enableFullscreen()},t.prototype.enableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.el.requestFullscreen(),this.fsEnabled=!0},t.prototype.disableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.fsEnabled&&document.exitFullscreen(),this.fsEnabled=!1},t.prototype.attachFullscreenAPI=function(){this.el=this.getEngine().container,this.el.requestFullscreen=this.el.requestFullscreen||this.el.requestFullScreen||this.el.mozRequestFullscreen||this.el.mozRequestFullScreen||this.el.webkitRequestFullscreen||this.el.webkitRequestFullScreen||this.el.msRequestFullscreen||this.el.msRequestFullScreen,document.exitFullscreen=document.exitFullscreen||document.exitFullScreen||document.mozCancelFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.webkitExitFullScreen||document.msExitFullscreen||document.msExitFullScreen,document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("msfullscreenchange",this.onFullscreenChange.bind(this),!1)},t.prototype.onFullscreenChange=function(e){this.getGlobalEvents().trigger("fullscreen::change",e)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(5),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t.axes=[],t.workVector1=new n.Vector3,t.workVector2=new n.Vector3,t.workQuaternion1=new n.Quaternion,t.workQuaternion2=new n.Quaternion,t.workEuler=new n.Euler,t.meshControlMap={},t.updateAxes=!1,t.updateButtons=[],t.gamepadDevice=null,t}return i.__extends(t,e),t.prototype.onUpdate=function(e){var t=this;this.gamepadDevice||(this.gamepadDevice=this.getGamepadDevice(),this.gamepadDevice&&(this.listenTo(this.gamepadDevice,"gamepadButtonChanged",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonTouched",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonReleased",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadAxisChanged",this.onGamepadAxisEvent))),this.updateButtons.forEach(function(e,r){e&&t.updateButtonTransform(r)}),this.updateAxes&&(this.updateAxes=!1,this.updateAxesTransforms())},t.prototype.getAxisMeshes=function(e){return this.axes[e].map(function(e){return e.mesh})},t.prototype.getButtonMeshes=function(e){return this.buttons[e].map(function(e){return e.mesh})},t.prototype.onAttributesChanged=function(e){var t=this;e.indexOf("axes")===-1&&e.indexOf("buttons")===-1||(this.meshControlMap={},this.axes.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&(t.meshControlMap[n.id]||(t.meshControlMap[n.id]={axes:[],axesMeshIdx:[],buttons:[],buttonMeshIdx:[]}),t.meshControlMap[n.id].axes.push(r),t.meshControlMap[n.id].axesMeshIdx.push(i)); -})}),this.buttons.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&t.meshControlMap[n.id]&&(t.meshControlMap[n.id].buttons.push(r),t.meshControlMap[n.id].buttonMeshIdx.push(i))})}))},t.prototype.getGamepadDevice=function(){if(this.gamepadDevice)return this.gamepadDevice;var e=this.getEntity().getAncestors(),t=e.find(function(e){return!!e.getComponentByScriptId("motion_gamepad_device")});return t?(this.gamepadDevice=t.getComponentByScriptId("motion_gamepad_device"),this.gamepadDevice):(this.gamepadDevice=null,null)},t.prototype.onGamepadButtonEvent=function(e,t){this.currentGamepadState=e,this.updateButtons[t]=!0},t.prototype.updateButtonTransform=function(e){var t=this,r=this.currentGamepadState.buttons[e].value,i=this.buttons[e];i.forEach(function(i){if(i.mesh){switch(i.movementType){case"translate":t.workVector1.copy(i.offset).multiplyScalar(r),i.mesh.setPosition(t.workVector1.x,t.workVector1.y,t.workVector1.z);break;case"rotate":t.workVector2.copy(i.rotation).multiplyScalar(r),t.workEuler.setFromVector3(t.workVector2),t.workQuaternion1.setFromEuler(t.workEuler),t.workVector1.copy(i.pivot),t.workVector2.copy(t.workVector1).multiplyScalar(-1),t.workVector2.applyQuaternion(t.workQuaternion1),t.workVector2.add(t.workVector1),i.mesh.setQuaternion(t.workQuaternion1.x,t.workQuaternion1.y,t.workQuaternion1.z,t.workQuaternion1.w),i.mesh.setPosition(t.workVector2.x,t.workVector2.y,t.workVector2.z)}i.renderOnTouchOnly&&t.currentGamepadState.buttons[e].hasOwnProperty("touched")&&i.mesh.setProperty("visible",t.currentGamepadState.buttons[e].touched)}})},t.prototype.onGamepadAxisEvent=function(e,t){this.currentGamepadState=e,this.updateAxes=!0},t.prototype.updateAxesTransforms=function(){var e=this;o.forEach(this.meshControlMap,function(t,r){var i=e.getEngine().getObjectById(r);if(i){var n=e.axes[0][t.axesMeshIdx[0]].movementType;if(e.workVector1.set(0,0,0),t.axes.reduce(function(r,i,a){var o=e.axes[i][t.axesMeshIdx[a]];if(o.movementType!==n)return log.error("Can't perform multiple types of axis transformations on same mesh."),r;if("translate"===n){var s=e.currentGamepadState.axes[i];e.workVector2.copy(o.offset).multiplyScalar(s)}else"rotate"===n&&e.workVector2.copy(o.pivot).multiplyScalar(-1);return r.lerp(e.workVector2,0===a?1:.5)},e.workVector1),e.workQuaternion1.set(0,0,0,1),"rotate"===n&&(t.axes.reduce(function(r,i,n){var a=e.axes[i][t.axesMeshIdx[n]],o=e.currentGamepadState.axes[i];return e.workVector2.copy(a.rotation).multiplyScalar(o),e.workEuler.setFromVector3(e.workVector2),e.workQuaternion2.setFromEuler(e.workEuler),r.slerp(e.workQuaternion2,0===n?1:.5)},e.workQuaternion1),e.workVector2.copy(e.workVector1),e.workVector1.applyQuaternion(e.workQuaternion1),e.workVector2.multiplyScalar(-1),e.workVector1.add(e.workVector2)),i.setQuaternion(e.workQuaternion1.x,e.workQuaternion1.y,e.workQuaternion1.z,e.workQuaternion1.w),i.setPosition(e.workVector1.x,e.workVector1.y,e.workVector1.z),t.buttons.length){var a=t.buttons[0],o=e.currentGamepadState.buttons[a].value,s=e.buttons[a][0].offset;e.workVector2.copy(s).multiplyScalar(o),e.workVector2.applyQuaternion(e.workQuaternion1),e.workVector2.add(e.workVector1),i.setPosition(e.workVector2.x,e.workVector2.y,e.workVector2.z)}}})},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gamepadStates=[],t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&navigator.getGamepads)for(var t=navigator.getGamepads(),r=0;r":187,"<":188,_:189,".":190,"/":191,"[":219,"]":221};var d=function(e){function r(){var t=e.call(this)||this;return t.mouseButtons={left:0,middle:1,right:2},t.inputQueue=[],t.inputPool=[],t.mouseButtonState=new Array(3),t.mouseButtonStatePrevious=new Array(3),t.mousePosition=new u.Vector2,t.mousePositionPercent=new u.Vector2,t.mousePreviousPosition=new u.Vector2,t.mouseDragState=new Array(3),t.mouseDragStatePrevious=new Array(3),t.mouseDragDistance=[new u.Vector2,new u.Vector2,new u.Vector2],t.touchPosition=new u.Vector2,t.touchPositionPercent=new u.Vector2,t.touchPreviousPosition=new u.Vector2,t.touchDragState=!1,t.touchDragStatePrevious=!1,t.doubleTapHandle=null,t.doubleTapPosition=new u.Vector2,t.listenForTouchStart=!1,t.listenForTouchEnd=!1,t.touchesStart=[],t.keyState=new Array(256),t.keyStatePrevious=new Array(256),t.canvas=null,t.pointerLockEnabled=!1,t}return i.__extends(r,e),r.prototype.mouseButtonDown=function(e){if("any"===e){for(var t in this.mouseButtons)if(this.mouseButtonState[this.mouseButtons[t]])return!0;return!1}return this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonUp=function(e){return!this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonPressed=function(e){return!(!this.mouseButtonState[this.mouseButtons[e]]||this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.mouseButtonReleased=function(e){return!(this.mouseButtonState[this.mouseButtons[e]]||!this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.keyPressed=function(e){return!(!this.keyState[t.keyCodes[e]]||this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyReleased=function(e){return!(this.keyState[t.keyCodes[e]]||!this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyDown=function(e){return!!this.keyState[t.keyCodes[e]]},r.prototype.keyUp=function(e){return!this.keyState[t.keyCodes[e]]},r.prototype.getMouseDragState=function(e){return this.mouseDragState[this.mouseButtons[e||"left"]]},r.prototype.getPreviousMouseDragState=function(e){return this.mouseDragStatePrevious[this.mouseButtons[e||"left"]]},r.prototype.getTouchDragState=function(){return this.touchDragState},r.prototype.getPreviousTouchDragState=function(){return this.touchDragStatePrevious},r.prototype.enablePointerLock=function(){this.pointerLockEnabled=!0,this.canvas.requestPointerLock()},r.prototype.disablePointerLock=function(){this.pointerLockEnabled=!1,document.exitPointerLock()},r.prototype.togglePointerLock=function(){this.pointerLockEnabled?this.enablePointerLock():this.disablePointerLock()},r.prototype.onStartup=function(){this.canvas=this.getEngine().canvas,this.canvas.requestPointerLock=this.canvas.requestPointerLock||this.canvas.mozRequestPointerLock||this.canvas.webkitRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,this.clearKeyStates=this.clearKeyStates.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchLeave=this.onTouchLeave.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onDoubleTap=this.onDoubleTap.bind(this),window.addEventListener("blur",this.clearKeyStates,!1),this.isEnabled()&&(this.mouseEvents.enable&&this.enableMouseEvents(),this.keyEvents.enable&&this.enableKeyEvents(),this.touchEvents.enable&&this.enableTouchEvents())},r.prototype.onPreUpdate=function(){if(this.isEnabled())for(;this.inputQueue.length>0;)this.getEngine().trigger(this.inputQueue[0].name,this.inputQueue[0].event),this.recycleInputEvent(this.inputQueue.splice(0,1)[0])},r.prototype.onPostUpdate=function(){if(this.isEnabled()){if(this.keyEvents.enable)for(var e=0;ethis.mouseEvents.dragBufferDistance&&(this.mouseDragState[t]=!0)}else this.mouseDragState[t]=!1;this.inputQueue.push(this.getInputEvent(e,"mouseMove"))},r.prototype.onMouseDown=function(e){if(this.getScenePercent(e,e),this.mouseUpBound||(this.mouseUpBound=!0,document.addEventListener("mouseup",this.onMouseUp)),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.mouseEvents.preventDownDefault&&e.preventDefault(),this.mouseButtonState[e.button]=!0,this.inputQueue.push(this.getInputEvent(e,"mouseDown")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_down_"+t)}},r.prototype.onMouseUp=function(e){if(this.getScenePercent(e,e),this.mouseButtonState[e.button]=!1,this.mouseDragState[e.button]=!1,this.mouseDragDistance[e.button].x=0,this.mouseDragDistance[e.button].y=0,this.mouseButtonUp("left")&&this.mouseButtonUp("right")&&this.mouseButtonUp("middle")&&(this.mouseUpBound=!1,document.removeEventListener("mouseup",this.onMouseUp)),this.inputQueue.push(this.getInputEvent(e,"mouseUp")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_up_"+t)}},r.prototype.onDoubleClick=function(e){this.getScenePercent(e,e),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.inputQueue.push(this.getInputEvent(e,"doubleClick"))},r.prototype.onMouseWheel=function(e){this.mouseEvents.preventScrollDefault&&e.preventDefault();var t;t=void 0!==e.wheelDeltaY?.025*e.wheelDeltaY:s.isIE()?-e.deltaY/40:-e.deltaY,this.inputQueue.push(this.getInputEvent(t,"mouseScroll"))},r.prototype.onMouseLeave=function(e){for(var t=0,r=this.mouseButtonState;tthis.touchEvents.dragBufferDistance?void this.clearDoubleTapState():(this.listenForTouchStart||this.listenForTouchEnd?!this.listenForTouchStart&&this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0):this.listenForTouchStart&&!this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0,this.listenForTouchEnd=!0,this.canvas.addEventListener("touchend",this.onDoubleTap)):(this.clearDoubleTapState(),this.onTouchEvent(e,"doubleTap")):(this.doubleTapPosition.copy(this.touchPosition),this.clearDoubleTapState(),this.canvas.addEventListener("touchend",this.onDoubleTap),this.listenForTouchEnd=!0),void(this.doubleTapHandle=setTimeout(this.clearDoubleTapState.bind(this),p)))},r.prototype.clearDoubleTapState=function(){clearTimeout(this.doubleTapHandle),this.doubleTapHandle=null,this.listenForTouchStart=!1,this.listenForTouchEnd=!1,this.canvas.removeEventListener("touchend",this.onDoubleTap)},r.prototype.onTouchCancel=function(e){this.touchEvents.preventCancelDefault&&e.preventDefault(),this.touchDragState=!1;var t={};t.originalEvent=e,t.touches=[],this.inputQueue.push(this.getInputEvent(t,"touchCancel"))},r.prototype.onTouchLeave=function(e){this.touchEvents.preventLeaveDefault&&e.preventDefault(),this.touchDragState=!1,this.onTouchEvent(e,"touchLeave")},r.prototype.onTouchMove=function(e){this.touchEvents.preventMoveDefault&&e.preventDefault();var t={};t.originalEvent=e,t.touches=[];for(var r=0;rthis.touchEvents.dragBufferDistance&&(this.touchDragState=!0),t.touches.push(i)}t.touches.length&&(this.touchPosition.x=t.touches[t.touches.length-1].sceneX,this.touchPosition.y=t.touches[t.touches.length-1].sceneY,this.touchPositionPercent.x=t.touches[t.touches.length-1].scenePercentX,this.touchPositionPercent.y=t.touches[t.touches.length-1].scenePercentY),this.inputQueue.push(this.getInputEvent(t,"touchMove"))},r.prototype.onTouchEvent=function(e,t){var r={};r.originalEvent=e,r.touches=[];for(var i=0;i=0&&(this.sourceBoundingSphere.radius=this.boundingSphereOverrideRadius)),this.sceneRoot.isBaseLoaded()&&this.sphereMesh&&(this.sphereMesh.position.copy(this.sourceBoundingSphere.center),this.sphereMesh.scale.set(this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius)),this.previousIntersections=this.currentIntersections,this.currentIntersections={},this.firstIntersectionOnly){var i=t.find(this.intersectObject.bind(this));i&&(this.previousIntersections[i.id]||(this.trigger("beginIntersection",i),this.getEntity().trigger("beginIntersection",i)),this.currentIntersections[i.id]=i)}else{var n=t.filter(this.intersectObject.bind(this));n.forEach(function(t){e.previousIntersections[t.id]||(e.trigger("beginIntersection",t),e.getEntity().trigger("beginIntersection",t)),e.currentIntersections[t.id]=t})}return o.forEach(this.previousIntersections,function(t){e.currentIntersections[t.id]||(e.trigger("endIntersection",t),e.getEntity().trigger("endIntersection",t))}),this.currentIntersections}},t.prototype.onAttributesChanged=function(e){e.indexOf("debugVisualization")!==-1&&(this.sphereMesh.visible=this.debugVisualization)},t.prototype.onPreUpdate=function(){this.checkIntersectionAlways&&this.checkIntersection()},t.prototype.generateObjectList=function(){var e=this;if(this.objectFilter.length)return this.objectFilter;var t=[];return this.sceneRoot.traverseSome(function(r){return r===e.getEntity()||!(e.objectTypeFilter.length&&!e.objectTypeFilter.some(function(e){return r.type===e}))&&void t.push(r)}),t},t.prototype.intersectObject=function(e){var t=e.runtimeData;return!!t&&(this.workMatrix.getInverse(t.matrixWorld),this.workBoundsSphere.copy(this.sourceBoundingSphere),this.workBoundsSphere.applyMatrix4(this.workMatrix),e.getBounds(this.workBoundingBox),this.workBoundingBox.intersectsSphere(this.workBoundsSphere))},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(14),o=function(e){function t(){var t=e.call(this)||this;return t.setupMaterial=t.setupMaterial.bind(t),t}return i.__extends(t,e),t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"entityCreated",function(t){t instanceof a.default&&e.setupMaterial(t)})},t.prototype.onAttributesChanged=function(e){this.setupAllMaterials()},t.prototype.onDisable=function(){this.getEngine().getAssetsByClass(a.default).forEach(function(e){var t=e.getShader().getProperty("parameters");t.envMapIrradiance&&e.setProperty("envMapIrradiance",null),t.envMapRadianceHalfGloss&&e.setProperty("envMapRadianceHalfGloss",null),t.envMapRadiance&&e.setProperty("envMapRadiance",null)})},t.prototype.onEnable=function(){this.setupAllMaterials()},t.prototype.setupAllMaterials=function(){this.getEngine().getAssetsByClass(a.default).forEach(this.setupMaterial)},t.prototype.setupMaterial=function(e){if(e&&this.isEnabled()){var t=e.getShader().getProperty("parameters");t.envMapIrradiance&&e.setProperty("envMapIrradiance",this.getAttribute("irradianceMap")),t.envMapRadiance&&e.setProperty("envMapRadiance",this.getAttribute("radianceMap")),t.envMapRadianceHalfGloss&&e.setProperty("envMapRadianceHalfGloss",this.getAttribute("radianceMapHalfGloss"))}},t}(n.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.playing=!0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.tempVec=new n.Vector3,this.tempMatrix=new n.Matrix4,this.tempQuaternion=new n.Quaternion},t.prototype.onAttributesChanged=function(e){if(!this.playing){var t=this.getEntity();t instanceof o.default&&(this.getRuntimeData().position.copy(t.getPosition()),this.getRuntimeData().quaternion.copy(t.getQuaternion()))}},t.prototype.onEnable=function(){this.playing=!0},t.prototype.onDisable=function(){this.playing=!1;var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()))},t.prototype.onPostUpdate=function(){var e;if(this.hasRuntimeData()&&this.playing&&this.isEnabled()&&(e=this.getRuntimeData(),this.target&&this.target.runtimeData)){this.getEngine().needsRender=!0;var t=this.target.runtimeData;if(this.tempVec.setFromMatrixPosition(t.matrixWorld),e.parent?this.tempMatrix.getInverse(e.parent.matrixWorld):this.tempMatrix.identity(),this.tempVec.applyMatrix4(this.tempMatrix),this.local){e.lookAt(this.tempVec);var r=this.getEntity();r instanceof o.default&&e.quaternion.multiply(r.getQuaternion())}else e.lookAt(this.tempVec)}},t.prototype.onShutdown=function(){},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(37),s=.5,u=36,p=1,c=80,l=function(e){function t(){var t=e.call(this)||this;return t.createScene(),t}return i.__extends(t,e),t.prototype.setLightingFromThreeScene=function(e){var t=this;this.resetSceneLighting(),e.traverse(function(e){e instanceof n.Light&&t.scene.add(e.clone())}),this.captureScene()},t.prototype.setLightingFromScene=function(e){var t=this;this.resetSceneLighting(),e.getDescendantsByClass(o.default).forEach(function(e){e.isUnloaded()&&e.loadBase(),t.scene.add(e.getRuntimeData().clone())}),this.captureScene()},t.prototype.onAwake=function(){this.listenTo(this.getEntity(),"change:properties",this.onMaterialChanges)},t.prototype.onEnable=function(){this.captureScene()},t.prototype.onEntityLoaded=function(){this.captureScene()},t.prototype.onAttributesChanged=function(e){e.indexOf("captureTexture")!==-1&&this.captureScene()},t.prototype.onMaterialChanges=function(e){this.captureScene()},t.prototype.createScene=function(){this.camera=new n.OrthographicCamera(-s,s,s,-s,p,c),this.scene=new n.Scene,this.createGeometry(),this.scene.add(this.sphereMesh),this.scene.add(this.planeMesh),this.scene.add(this.camera),this.camera.position.z=.5*c,this.camera.position.y=.25*c,this.camera.position.x=.25*c,this.camera.lookAt(new n.Vector3(0,0,0)),this.planeMesh.lookAt(this.camera.position)},t.prototype.createGeometry=function(){this.geometry=new n.SphereBufferGeometry(s,u,u),this.planeGeometry=new n.PlaneBufferGeometry(2*s,2);var e=Math.sqrt(.5),t=this.planeGeometry.attributes.normal;t.array=new Float32Array([-1,1,0,1,1,0,-1,-1,0,1,-1,0]);for(var r=0;r=1&&(n-=1);var a=1-i;if(r&&na){var x=1-(n-a)/i;f+=e*E/t*Math.max(.5*Math.cos(x*Math.PI+Math.PI)+.5,0)}else f+=e*E/t;(f>=1||f<0)&&(f%=1,h=0,s||(f=.99999999,c.playingCurveAnimation=!1,c.getEngine().off("update",c.curveAnim,c),c.curveAnim=void 0),c.getEntity().trigger("endAnimateAlongCurve"));var S=u.curve,D=S.getUtoTmapping(f);if(d.position.copy(S.getPoint(D)),"toCurve"===o){var A=S.getTangent(D);m.set(0,-1,0),y.crossVectors(A,m),g.crossVectors(A,y),m.copy(d.position),m.add(A),v.lookAt(d.position,m,g),d.quaternion.setFromRotationMatrix(v)}else if("toNode"===o){var T=u.closed?S.points.length:S.points.length-1,M=Math.floor(D*T),R=Math.ceil(D*T)%S.points.length;M!==w&&(M>0?u.controlPoints[M].getQuaternionInWorldSpace(b):u.controlPoints[0].getQuaternionInWorldSpace(b)),R!==_&&(R>0?u.controlPoints[R].getQuaternionInWorldSpace(P):u.controlPoints[0].getQuaternionInWorldSpace(P));var C=D*T-M;d.quaternion.copy(b),d.quaternion.slerp(P,C)}}};r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5),t>0&&(this.playingCurveAnimation=!0,u.isCurveInit()?(this.curveAnim=S,this.getEngine().on("update",this.curveAnim,this)):u.on("curveInit",function(){c.curveAnim=S,c.getEngine().on("update",c.curveAnim,c)},this))}},t.prototype.onPauseCurveAnimation=function(){this.playingCurveAnimation=!1},t.prototype.onUnpauseCurveAnimation=function(){this.playingCurveAnimation=!0},t.prototype.animateToObject=function(e,t,r,i,o){var s=this,u=this.getEngine(),p=function(e){var p=s.getRuntimeData(),c=new a.Matrix4,l=0,d=0;r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5);var h,f=1-r-i,m=1/(r/2+i/2+f),y=new a.Vector3;y.copy(p.position);var g=e.position,v=e.quaternion;if(v&&o&&(h=new a.Quaternion,h.copy(p.quaternion)),e.updateMatrixWorld(!0),g.setFromMatrixPosition(e.matrixWorld),c.extractRotation(e.matrixWorld),v.setFromRotationMatrix(c),t>0){var b=function(e){if(!s.getEntity()||!s.isEnabled())return void u.off("update",b,s);s.getEngine().needsRender=!0,l+=e;var n=l/t,a=1-i;if(r&&na){var f=1-(n-a)/i;d+=e*m/t*Math.max(.5*Math.cos(f*Math.PI+Math.PI)+.5,0)}else d+=e*m/t;d=Math.min(d,1),(d>=1||d<0)&&(s.getEngine().off("update",b,s),s.getEntity().trigger("endAnimateToObject")),p.position.copy(y),p.position.lerp(g,d),v&&o&&(p.quaternion.copy(h),p.quaternion.slerp(v,d))};s.getEngine().on("update",b,s)}else p.position.copy(g),v&&p.quaternion.copy(v),s.getEntity().trigger("endAnimateToObject")},c=this.getEngine().getEntityById(e);c.runtimeData?p(c.runtimeData):(c.once("loadBase",function(){p(c.runtimeData)},this),c.load())},t.prototype.animateTranslation=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Vector3,h=new a.Vector3;h.copy(i);var f=h.length();if(u.updateMatrixWorld(),h.applyQuaternion(u.quaternion),h.normalize(),o){var m=(1-t-r)*e,y=.5*(t+r)*e;"middle"===o?(d.copy(i),d.multiplyScalar(-.5*(m+y)),u.position.add(d)):"end"===o&&(d.copy(i),d.multiplyScalar(-1*(m+y)),u.position.add(d))}if(e>0){var g=function(i){if(!s.getEntity()||!s.isEnabled())return void c.off("update",g,s);d.copy(h),s.getEngine().needsRender=!0,p+=i;var n=Math.min(p/e,1),a=1-r,o=e*a;if(t&&po){var y=1-(n-a)/r;d.multiplyScalar(i*f*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else d.multiplyScalar(i*f);p>=e&&(s.getEngine().off("update",g,s),s.getEntity().trigger("endAnimateTranslation")),u.position.add(d)};this.getEngine().on("update",g,this)}},t.prototype.animateRotation=function(e,t,r,i,o,s){var u=this,p=this.getRuntimeData();p.position.copy(this.getEntity().getPosition()),p.quaternion.copy(this.getEntity().getQuaternion()),p.scale.copy(this.getEntity().getScale());var c=0,l=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var d=e*t,h=new a.Quaternion,f=new a.Quaternion,m=new a.Vector3,y=new a.Euler(i.x,i.y,i.z,s);if(h.setFromEuler(y),f.copy(h),p.updateMatrixWorld(),o){var g=(1-t-r)*e,v=.5*(t+r)*e;"middle"===o?(m.copy(i),m.multiplyScalar(-.5*(g+v)),y.set(m.x,m.y,m.z),h.setFromEuler(y),p.quaternion.multiply(h)):"end"===o&&(m.copy(i),m.multiplyScalar(-1*(g+v)),y.set(m.x,m.y,m.z),h.setFromEuler(y),p.quaternion.multiply(h))}if(e>0){var b=function(i){if(!u.getEntity()||!u.isEnabled())return void l.off("update",b,u);var n=1;u.getEngine().needsRender=!0,c+=i;var a=Math.min(c/e,1),o=1-r,s=e*o;if(t&&cs){var y=1-(a-o)/r;n*=i*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0)}else n*=i;c>=e&&(u.getEngine().off("update",b,u),u.getEntity().trigger("endAnimateTranslation")),h.set(0,0,0,1),h.slerp(f,n),p.quaternion.multiply(h)};this.getEngine().on("update",b,this)}},t.prototype.animateScale=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Vector3;if(u.updateMatrixWorld(),o){var h=(1-t-r)*e,f=.5*(t+r)*e;"middle"===o?(d.copy(i),d.multiplyScalar(-.5*(h+f)),u.scale.add(d)):"end"===o&&(d.copy(i),d.multiplyScalar(-1*(h+f)),u.scale.add(d))}if(e>0){var m=function(n){if(!s.getEntity()||!s.isEnabled())return void c.off("update",m,s);d.copy(i),s.getEngine().needsRender=!0,p+=n;var a=Math.min(p/e,1),o=1-r,h=e*o;if(t&&ph){var y=1-(a-o)/r;d.multiplyScalar(n*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else d.multiplyScalar(n);p>=e&&(s.getEngine().off("update",m,s),s.getEntity().trigger("endAnimateTranslation")),u.scale.add(d)};this.getEngine().on("update",m,this)}},t}(o.default);t.default=s},function(e,t,r){"use strict";function i(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1}function n(e,t,r,i){var n=e.x+(t.x-e.x)*r,a=e.y+(t.y-e.y)*r,o=e.z+(t.z-e.z)*r;i.set(n,a,o)}function a(e){return e.object.visible&&"Mesh"===e.object.type}Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),s=r(1),u=r(2),p=r(22),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.speed=.8,t.zoomSteps=5,t.zoomBuffer=.1,t.time=-1,t.isMouseDown=!1,t.targetZoom=0,t.srcZoom=0,t.lastFocusPosition=new s.Vector3(-1,-1,-1),t}return o.__extends(t,e),t.prototype.onDisable=function(){this.interrupt()},t.prototype.onUpdate=function(e){if(this.isEnabled()&&!(this.time<0)){var t=this.getRuntimeData(),r=i(1-1/(this.speed/this.time));n(this.srcLook,this.targetLook,r,this.currentLook),t.lookAt(this.currentLook);var a=this.srcZoom+(this.targetZoom-this.srcZoom)*r;this.zoomComponent.lerpZoom(a),this.time-=e,this.time<=0&&this.onEnd(),this.getEngine().needsRender=!0}},t.prototype.onStartup=function(){if(this.orbitCam=this.getEntity().getComponentByScriptName("Orbit Camera"),!this.orbitCam)throw new Error("Focus component requires OrbitCamera on the entity: "+this.getId());var e=this.getEngine(),t=this.getEntity();p.isMobile()?(this.listenTo(e,"touchStart",this.onMouseDown),this.listenTo(e,"touchMove",this.onMouseMove),this.listenTo(e,"touchEnd",this.onMouseUp),this.listenTo(e,"doubleTap",this.onDoubleClick)):(this.listenTo(e,"mouseScroll",this.interrupt),this.listenTo(e,"keyDown",this.interrupt),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseUp",this.onMouseUp),this.listenTo(e,"doubleClick",this.onDoubleClick)),this.listenTo(t,"resetOrbitCamera",this.onReset),this.zoomComponent=t.getComponentByScriptId("camera_zoom"),this.zoomComponent||(this.zoomComponent=t.addComponent("camera_zoom"))},t.prototype.onReset=function(){this.orbitCam.enable(),this.time=-1},t.prototype.onMouseDown=function(){this.isEnabled()&&(this.isMouseDown=!0)},t.prototype.onMouseUp=function(){this.isMouseDown=!1},t.prototype.onMouseMove=function(){this.isMouseDown&&this.interrupt()},t.prototype.onDoubleClick=function(e){if(this.isEnabled()&&this.hasRuntimeData()){this.raycaster||this.initializeRaycaster();var t=p.isMobile()?this.getInput().touchPositionPercent.x:e.scenePercentX,r=p.isMobile()?this.getInput().touchPositionPercent.y:e.scenePercentY;this.mouseVector.set(2*t-1,2*-r+1);var i=this.getIntersection(this.mouseVector);this.interrupt();var n=this.time>0?this.currentLook:this.orbitCam.pivotPoint.position;this.srcLook.copy(n),i?this.lookAtPoint(i.point):this.resetToOrigin(),this.time=this.speed,this.srcZoom=this.zoomComponent.getZoomLevel()}},t.prototype.lookAtPoint=function(e){this.orbitCam.disable(),this.targetLook.copy(e),this.lastFocusPosition.x===-1&&this.lastFocusPosition.copy(this.targetLook),this.targetLook.distanceTo(this.lastFocusPosition)0&&this.onEnd()},t.prototype.onEnd=function(){this.time=-1,this.orbitCam.enable(),this.orbitCam.setPivotPosition(this.currentLook),this.orbitCam.setOrbitDistance(this.getRuntimeData().position.distanceTo(this.currentLook)),this.orbitCam.resetOrbitRotation()},t.prototype.getIntersection=function(e){this.raycaster.far=this.orbitCam.getOrbitDistance()+1,this.raycaster.setFromCamera(e,this.getRuntimeData());var t=this.raycaster.intersectObjects(this.getRootThreeObject().children,!0).filter(a);return t.length>0?t[0]:void 0},t}(u.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(36),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.position=new n.Vector2,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseScroll",this.onMouseScroll)},t.prototype.onMouseDown=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=e.scenePercentX,this.position.y=e.scenePercentY;var r=t?o.orbitEvents.startOrbit:void 0;r&&this.trigger(r,this.position)}},t.prototype.onMouseMove=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=t?e.scenePercentX:e.scenePercentDeltaX,this.position.y=t?e.scenePercentY:e.scenePercentDeltaY;var r=this.getInput().mouseButtonDown("right"),i=r?o.orbitEvents.pan:t?o.orbitEvents.orbit:void 0;i&&this.trigger(i,this.position)}},t.prototype.onMouseScroll=function(e){this.isEnabled()&&this.trigger(o.orbitEvents.zoom,e)},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(36),s=20,u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOrbiting=!1,t.isPanning=!1,t.isZooming=!1,t.panMidpoint=new n.Vector2,t.lastPanMidpoint=new n.Vector2,t.panDelta=new n.Vector2,t.lastZoomDistance=0,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"touchStart",this.cancelActions),this.listenTo(e,"touchCancel",this.cancelActions),this.listenTo(e,"touchLeave",this.cancelActions),this.listenTo(e,"touchEnd",this.cancelActions),this.listenTo(e,"touchMove",this.onTouchMove)},t.prototype.cancelActions=function(){this.isOrbiting=!1,this.isPanning=!1,this.isZooming=!1,this.panMidpoint.set(0,0),this.lastPanMidpoint.set(0,0),this.panDelta.set(0,0),this.lastZoomDistance=0},t.prototype.onTouchMove=function(e){this.isEnabled()&&e.touches.length&&(1===e.touches.length?this.onSingleTouchMove(e.touches[0]):this.onMultiTouchMove(e.touches[0],e.touches[1]))},t.prototype.onSingleTouchMove=function(e){var t=new n.Vector2(e.scenePercentX,e.scenePercentY);this.isOrbiting?this.orbit(t):(this.isOrbiting=!0,this.startOrbit(t))},t.prototype.onMultiTouchMove=function(e,t){var r=new n.Vector2(e.scenePercentX,e.scenePercentY),i=new n.Vector2(t.scenePercentX,t.scenePercentY);this.pan(r,i),this.zoom(r,i)},t.prototype.startOrbit=function(e){this.trigger(o.orbitEvents.startOrbit,e)},t.prototype.orbit=function(e){this.trigger(o.orbitEvents.orbit,e)},t.prototype.pan=function(e,t){this.panMidpoint.addVectors(e,t),this.panMidpoint.multiplyScalar(.5),this.isPanning||(this.isPanning=!0,this.lastPanMidpoint.copy(this.panMidpoint)),this.panDelta.subVectors(this.panMidpoint,this.lastPanMidpoint),this.panDelta.length()&&this.trigger(o.orbitEvents.pan,this.panDelta),this.lastPanMidpoint.copy(this.panMidpoint),this.panDelta.set(0,0)},t.prototype.zoom=function(e,t){var r=e.distanceTo(t);if(r){this.isZooming||(this.isZooming=!0,this.lastZoomDistance=r);var i=r-this.lastZoomDistance;i&&this.trigger(o.orbitEvents.zoom,i*s),this.lastZoomDistance=r}},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxScene=void 0,t.cameras=[null,null,null,null,null,null],t}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(e.indexOf("inputTexture")!==-1){var t=this.getPreviousAttribute("inputTexture");this.unregisterDependency(t),this.registerDependency(this.inputTexture),this.updateTexture()}},t.prototype.onStartup=function(){this.skyboxScene=new n.Scene,this.registerDependency(this.inputTexture),this.initCameras(),this.createSkybox()},t.prototype.onEntityReady=function(){this.updateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&(this.unregisterDependency(this.inputTexture),this.inputTexture.off("load",this.renderToCube,this)),this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.equirectMaterial&&this.equirectMaterial.dispose(),this.skyboxScene=void 0,this.skyboxMesh=void 0,this.inputTexture=void 0},t.prototype.updateTexture=function(){this.inputTexture&&!this.getEntity().isUnloaded()&&(this.inputTexture.off("load",this.renderToCube,this),this.inputTexture.when("load",this.renderToCube,this),this.inputTexture.isBaseUnloaded()&&this.inputTexture.load())},t.prototype.createSkybox=function(){var e=n.ShaderLib.equirect;e.uniforms.tFlip.value=1,this.equirectMaterial=new n.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:n.BackSide}),this.skyboxGeometry=new n.BoxGeometry(100,100,100,1,1,1),this.skyboxMesh=new n.Mesh(this.skyboxGeometry,this.equirectMaterial),this.skyboxMesh.frustumCulled=!1,this.skyboxMesh.castShadow=!1,this.skyboxMesh.receiveShadow=!1,this.isEnabled()&&this.skyboxScene.add(this.skyboxMesh)},t.prototype.initCameras=function(){var e=90,t=1;this.cameras[0]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[0].up.set(0,-1,0),this.cameras[0].lookAt(new n.Vector3(1,0,0)),this.skyboxScene.add(this.cameras[0]),this.cameras[1]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[1].up.set(0,-1,0),this.cameras[1].lookAt(new n.Vector3(-1,0,0)),this.skyboxScene.add(this.cameras[1]),this.cameras[2]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[2].up.set(0,0,1),this.cameras[2].lookAt(new n.Vector3(0,1,0)),this.skyboxScene.add(this.cameras[2]),this.cameras[3]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[3].up.set(0,0,-1),this.cameras[3].lookAt(new n.Vector3(0,-1,0)),this.skyboxScene.add(this.cameras[3]),this.cameras[4]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[4].up.set(0,-1,0),this.cameras[4].lookAt(new n.Vector3(0,0,1)),this.skyboxScene.add(this.cameras[4]),this.cameras[5]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[5].up.set(0,-1,0),this.cameras[5].lookAt(new n.Vector3(0,0,-1)),this.skyboxScene.add(this.cameras[5])},t.prototype.renderToCube=function(){if(this.hasRuntimeData()){this.equirectMaterial.uniforms.tEquirect.value=this.inputTexture.getThreeTexture();var e=this.getRuntimeData(),t=this.getThreeRenderer();e.texture.generateMipmaps=!1,t.setViewport(0,0,e.width,e.height);for(var r=0;r<5;r++)e.activeCubeFace=r,t.render(this.skyboxScene,this.cameras[r],e);e.texture.generateMipmaps=this.getEntity().getProperty("useMipmap"),e.activeCubeFace=5,t.render(this.skyboxScene,this.cameras[5],e)}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=.0174532925,u={"+X":new a.Vector3(1,0,0),"-X":new a.Vector3(-1,0,0),"+Y":new a.Vector3(0,1,0),"-Y":new a.Vector3(0,-1,0),"+Z":new a.Vector3(0,0,1),"-Z":new a.Vector3(0,0,-1)},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.time=0,t.target=new a.Quaternion,t.tempQuat=new a.Quaternion,t}return i.__extends(t,e),t.prototype.getRightVector=function(e){return new a.Vector3(e.elements[0],e.elements[1],e.elements[2])},t.prototype.getUpVector=function(e){return new a.Vector3(e.elements[4],e.elements[5],e.elements[6])},t.prototype.getForwardVector=function(e){return new a.Vector3(e.elements[8],e.elements[9],e.elements[10])},t.prototype.setRightVector=function(e,t){e.elements[0]=t.x,e.elements[1]=t.y,e.elements[2]=t.z},t.prototype.setUpVector=function(e,t){e.elements[4]=t.x,e.elements[5]=t.y,e.elements[6]=t.z},t.prototype.setForwardVector=function(e,t){e.elements[8]=t.x,e.elements[9]=t.y,e.elements[10]=t.z},t.prototype.setAxes=function(e,t,r){var i=u[e],o=u[t];if(!i)return n.default.error("No Up Axis available For ",e);if(!o)return n.default.error("No Forward Axis available For ",t);var s=new a.Vector3,p=new a.Matrix4;this.setUpVector(p,i),this.setForwardVector(p,o),s.crossVectors(i,o),this.setRightVector(p,s),this.target.setFromRotationMatrix(p),r?this.time=this.speed:(this.setRotation(this.target),this.getEntity().trigger("axis_transition_complete"))},t.prototype.eulerFromObject=function(e){var t=isNaN(e.x)?0:e.x*s,r=isNaN(e.y)?0:e.y*s,i=isNaN(e.z)?0:e.z*s,n=new a.Euler(t,r,i);return n.order="YXZ",n},t.prototype.rotateOnWorldAxis=function(e,t,r){if(!(this.time>0)){var i=this.getRuntimeData(),n=new a.Vector3,o=new a.Vector3;n.copy(i.position),o.copy(i.scale),i.position.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix();var u=(new a.Matrix4).makeRotationX((e.x||0)*s),p=(new a.Matrix4).makeRotationY((e.y||0)*s),c=(new a.Matrix4).makeRotationZ((e.z||0)*s);c.multiply(p),c.multiply(u),t&&c.multiply(i.matrix),this.target.setFromRotationMatrix(c),r?(this.setRotation(this.target),this.getEngine().needsRender=!0):this.time=this.speed,i.position.copy(n),i.scale.copy(o)}},t.prototype.rotateToEuler=function(e){this.target.setFromEuler(this.eulerFromObject(e)),this.time=this.speed},t.prototype.setLocalRotation=function(e){this.time=0,this.target.setFromEuler(this.eulerFromObject(e)),this.setRotation(this.target)},t.prototype.setRotation=function(e){this.getEntity().setQuaternion(e.x,e.y,e.z,e.w),this.hasRuntimeData()&&!this.getRuntimeData().quaternion.equals(e)&&this.getRuntimeData().quaternion.copy(e),this.getEngine().needsRender=!0},t.prototype.getSign=function(e){return e>0?"+":"-"},t.prototype.getAxes=function(e){var t=this.getRuntimeData().matrix,r=this.getUpVector(t).normalize(),i=this.getForwardVector(t).normalize(),n=Math.abs(r.x),a=Math.abs(r.y),o=Math.abs(r.z),s=n=0&&this.hasRuntimeData()&&(this.time-=e,this.tempQuat.copy(this.getRuntimeData().quaternion),this.tempQuat.slerp(this.target,Math.min(1,Math.max(0,1-1/(this.speed/this.time)))),this.getEntity().setQuaternion(this.tempQuat.x,this.tempQuat.y,this.tempQuat.z,this.tempQuat.w),this.getEngine().needsRender=!0,this.time<0&&(this.setRotation(this.target),this.getEntity().trigger("axis_transition_complete")))},t}(o.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.framesElapsed=0,t.reflectionNormal=new n.Vector3(0,1,0),t.reflectionPlane=new n.Plane,t.clipPlane=new n.Vector4,t.reflectionPosition=new n.Vector3,t.cameraWorldPosition=new n.Vector3,t.rotationMatrix=new n.Matrix4,t.lookAtPosition=new n.Vector3(0,0,-1),t.up=new n.Vector3(0,1,0),t.perspectiveCamera=null,t.orthoCamera=null,t}return i.__extends(t,e),t.prototype.captureScene=function(e,t){if(!t)throw new Error("Call to ReflectionCapture.captureScene without specifying a camera.");this.updateReflection(t);var r=this.captureTexture?this.captureTexture.runtimeData:null,i=r?r:this.tempRenderTexture.runtimeData;this.getRenderer().renderView(e,this.reflectionCamera,{renderTarget:i,clearDepth:!0,enableShadows:!1,enablePreRenderFunctions:!1})},t.prototype.onEntityReady=function(){this.initCameras(),this.initTexture()},t.prototype.onAttributesChanged=function(e){e.indexOf("captureTexture")!==-1&&this.initTexture()},t.prototype.onPreRenderView=function(e,t){this.isEnabled()&&(this.framesElapsed>=this.updateFrameInterval?(this.captureScene(e,t),this.framesElapsed=0):this.framesElapsed++)},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTexture2d({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_reflection"),this.tempRenderTexture.load()},t.prototype.initTexture=function(){var e=this;this.captureTexture?(this.captureTexture.when("load",function(){e.tempRenderTexture&&e.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.createTempRenderTexture()},t.prototype.initCameras=function(){this.captureTexture&&this.captureTexture.load(),this.perspectiveCamera=new n.PerspectiveCamera,this.orthoCamera=new n.OrthographicCamera(-1,1,-1,1)},t.prototype.updateReflection=function(e){if(this.isEnabled()){var t=function(e){return e<0?-1:1};this.getEntity().runtimeData.updateMatrixWorld(),e.updateMatrixWorld(!1),this.reflectionPosition.setFromMatrixPosition(this.getEntity().runtimeData.matrixWorld),this.cameraWorldPosition.setFromMatrixPosition(e.matrixWorld),this.rotationMatrix.extractRotation(this.getEntity().runtimeData.matrixWorld),this.reflectionNormal.set(0,1,0),this.reflectionNormal.applyMatrix4(this.rotationMatrix);var r=this.reflectionPosition.clone().sub(this.cameraWorldPosition),i=r.reflect(this.reflectionNormal).negate();i.add(this.reflectionPosition),this.rotationMatrix.extractRotation(e.matrixWorld),this.lookAtPosition.set(0,0,-1),this.lookAtPosition.applyMatrix4(this.rotationMatrix),this.lookAtPosition.add(this.cameraWorldPosition);var a=this.reflectionPosition.clone().sub(this.lookAtPosition),o=a.reflect(this.reflectionNormal).negate();o.add(this.reflectionPosition),this.up.set(0,-1,0),this.up.applyMatrix4(this.rotationMatrix);var s=this.up.reflect(this.reflectionNormal).negate();if(e instanceof n.PerspectiveCamera&&this.perspectiveCamera)this.perspectiveCamera.aspect=e.aspect,this.perspectiveCamera.fov=e.fov,this.perspectiveCamera.near=e.near,this.perspectiveCamera.far=e.far,this.reflectionCamera=this.perspectiveCamera;else{if(!(e instanceof n.OrthographicCamera&&this.orthoCamera))return;this.orthoCamera.left=e.left,this.orthoCamera.right=e.right,this.orthoCamera.top=e.top,this.orthoCamera.bottom=e.bottom,this.orthoCamera.near=e.near,this.orthoCamera.far=e.far,this.reflectionCamera=this.orthoCamera}this.reflectionCamera.position.copy(i),this.reflectionCamera.up=s,this.reflectionCamera.lookAt(o),this.reflectionCamera.updateProjectionMatrix(),this.reflectionCamera.updateMatrixWorld(!1),this.reflectionCamera.matrixWorldInverse.getInverse(this.reflectionCamera.matrixWorld),this.reflectionPlane.setFromNormalAndCoplanarPoint(this.reflectionNormal,this.reflectionPosition),this.reflectionPlane.applyMatrix4(this.reflectionCamera.matrixWorldInverse),this.clipPlane.set(this.reflectionPlane.normal.x,this.reflectionPlane.normal.y,this.reflectionPlane.normal.z,this.reflectionPlane.constant);var u=new n.Vector4,p=this.reflectionCamera.projectionMatrix;p.copy(e.projectionMatrix),p.elements[8]*=-1,u.x=(t(this.clipPlane.x)+p.elements[8])/p.elements[0],u.y=(t(this.clipPlane.y)+p.elements[9])/p.elements[5],u.z=-1,u.w=(1+p.elements[10])/p.elements[14];var c=this.clipPlane.multiplyScalar(2/this.clipPlane.dot(u));p.elements[2]=c.x,p.elements[6]=c.y,p.elements[10]=c.z+1-this.clipBias,p.elements[14]=c.w}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(15),o=r(11),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.instance=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"createRemoteInstance",this.createRemoteInstance),this.listenTo(this.getGlobalEvents(),"createRemoteInstance",this.createRemoteInstance)},t.prototype.createRemoteInstance=function(e){var t=this;if(this.isEnabled()){var r=this.getEngine();r.fetchRemoteRepresentationsFromBox(e).then(function(i){var n=i.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json");r.resourceLoader.load(n,a.default.ENTITIES,{}).on(o.default.LOAD,function(i){var n=i.filter(function(e){return"prefab"===e.type}),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)});a.length||(r.addEntities(i),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)})),t.recreateInstance(a,e)})})}},t.prototype.recreateInstance=function(e,t){var r=this,i=this.getEngine();if(this.instance&&(this.instance.destroy(),this.instance=null),e.length>1)this.instance=i.createNode(),e.forEach(function(e){var t=i.getAssetById(e.id);r.instance.addChild(t.createInstance())});else{var n=i.getAssetById(e[0].id);this.instance=n.createInstance()}this.instance&&this.getEntity().addChild(this.instance),this.getEntity().trigger("remoteInstanceCreated",t),this.getGlobalEvents().trigger("remoteInstanceCreated",t)},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(2),s=r(22),u=r(5),p=r(190),c=r(14),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.threeRenderer=null,t.caps={},t.antialias=!1,t.preserveDrawingBuffer=!0,t.precision="highp",t.autoClear=!1,t.devicePixelRatio=1,t.shadowsEnabled=!0,t.shadowsEnabledMobile=!1,t.shadowType=n.PCFSoftShadowMap,t.shadowReverseSided=!1,t.maxTextureSize2d=Number.MAX_SAFE_INTEGER,t.maxTextureSizeCube=Number.MAX_SAFE_INTEGER,t.clearColor=new n.Color,t.clearAlpha=0,t.renderOnDemand=!0,t}return i.__extends(t,e),t.prototype.onAwake=function(){this.canvas=this.getEngine().canvas,this.initDefaultRenderer(),this.getEngine().setRenderer(this);var e=this.getThreeRenderer();e.gammaInput=!1,e.gammaOutput=!0},t.prototype.onStartup=function(){this.listenTo(this.getEngine(),"resize",this.onContainerResize),this.getEngine().renderOnDemand=this.renderOnDemand,this.shadowsEnabledMobile||(this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled),this.applyRenderSettings()},t.prototype.onShutdown=function(){this.threeRenderer&&(this.threeRenderer.context=null),this.threeRenderer=null,this.canvas=void 0},t.prototype.onAttributesChanged=function(e){var t=!1;e.indexOf("shadowsEnabledMobile")!==-1&&(t=!0),this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled,this.applyRenderSettings(),this.getEngine().renderOnDemand=this.renderOnDemand,e.indexOf("clearAlpha")!==-1&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),e.indexOf("clearColor")!==-1&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),e.indexOf("gammaOutput")!==-1&&(t=!0),e.indexOf("gammaInput")!==-1&&(t=!0),e.indexOf("shadowsEnabled")!==-1&&(t=!0),e.indexOf("shadowType")!==-1&&(this.shadowType=parseInt(String(this.shadowType),10),t=!0),e.indexOf("devicePixelRatio")!==-1&&this.onContainerResize(),t&&(a.default.info("Rebuilding materials!!!"),this.getEngine().trigger("rebuildMaterials"))},t.prototype.getGPUCapability=function(e){return this.caps[e]},t.prototype.getMaxTextureSize2d=function(){return this.maxTextureSize2d?Math.min(this.maxTextureSize2d,this.getGPUCapability("MAX_TEXTURE_SIZE")):this.getGPUCapability("MAX_TEXTURE_SIZE")},t.prototype.getMaxTextureSizeCube=function(){return this.maxTextureSizeCube?Math.min(this.maxTextureSizeCube,this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")):this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")},t.prototype.onPreRender=function(){this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(!0,!0,!0),this.threeRenderer.setViewport(0,0,this.getWidth(),this.getHeight())},t.prototype.renderView=function(e,t,r){void 0===r&&(r={});var i;if(t){r.enablePreRenderFunctions&&this.getEngine().trigger("preRenderView",e,t,r);var n=this.getCanvas().style;void 0===r.opacity||r.viewPort&&(r.viewPort.width!==this.getWidth()||r.viewPort.height!==this.getHeight())?1!==parseFloat(n.opacity)&&(n.opacity="1.0"):parseFloat(n.opacity)!==r.opacity&&(n.opacity=""+r.opacity), -r.renderTarget?this.threeRenderer.setRenderTarget(r.renderTarget):this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(r.clearColor,r.clearDepth,r.clearStencil),r.viewPort&&(i=c.default.sharedUniforms.screenDimensions,i.value.x=r.viewPort.x,i.value.y=r.viewPort.y,i.value.z=r.viewPort.width*this.devicePixelRatio,i.value.w=r.viewPort.height*this.devicePixelRatio,this.threeRenderer.setViewport(r.viewPort.x,r.viewPort.y,r.viewPort.width,r.viewPort.height));var a=r.effect?r.effect:this.threeRenderer;r.renderTarget?a.render(e,t,r.renderTarget,!1):a.render(e,t),this.getEngine().trigger("postRenderView",e,t,r)}},t.prototype.getWidth=function(){return this.canvas.clientWidth?this.canvas.clientWidth:this.canvas.width/this.devicePixelRatio},t.prototype.getHeight=function(){return this.canvas.clientHeight?this.canvas.clientHeight:this.canvas.height/this.devicePixelRatio},t.prototype.getCanvasWidth=function(){return this.canvas.width},t.prototype.getCanvasHeight=function(){return this.canvas.height},t.prototype.getCanvas=function(){return this.threeRenderer.domElement},t.prototype.onContainerResize=function(){if(this.canvas.parentElement){var e=this.canvas.parentElement.clientWidth,t=this.canvas.parentElement.clientHeight;if(this.threeRenderer.setPixelRatio(this.devicePixelRatio),s.isIOS()){var r=this.canvas;this.threeRenderer.setSize(e,t,!1),r.style.width=e+1+"px",r.style.height=t+1+"px",setTimeout(function(){r.style.width=e+"px",r.style.height=t+"px"},100)}else this.threeRenderer.setSize(e,t,!0);this.getEngine().trigger("rendererResize")}else{var i=this.canvas.width/this.devicePixelRatio,n=this.canvas.height/this.devicePixelRatio;this.threeRenderer.setPixelRatio(this.devicePixelRatio),this.threeRenderer.setSize(i,n,!0)}},t.prototype.storeGpuCaps=function(){var e=this.threeRenderer.getContext();a.default.info("WebGL VENDOR is "+e.getParameter(e.VENDOR)),a.default.info("WebGL SHADING_LANGUAGE_VERSION is "+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.default.info("WebGL RENDERER is "+e.getParameter(e.RENDERER));var t=e.FRAGMENT_SHADER,r=e.LOW_FLOAT,i=e.MEDIUM_FLOAT,n=e.HIGH_FLOAT,o=e.getShaderPrecisionFormat(t,r);if(a.default.info("Fragment Shader lowp is "+o.precision),o=e.getShaderPrecisionFormat(t,i),a.default.info("Fragment Shader mediump is "+o.precision),o=e.getShaderPrecisionFormat(t,n),a.default.info("Fragment Shader highp is "+o.precision),!navigator.isCocoonJS){this.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_CUBE_MAP_TEXTURE_SIZE=0,this.caps.MAX_FRAGMENT_UNIFORM_VECTORS=0,this.caps.MAX_RENDERBUFFER_SIZE=0,this.caps.MAX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_TEXTURE_SIZE=0,this.caps.MAX_VARYING_VECTORS=0,this.caps.MAX_VERTEX_ATTRIBS=0,this.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_VERTEX_UNIFORM_VECTORS=0,this.caps.MAX_VIEWPORT_DIMS=0,this.caps.ALIASED_POINT_SIZE_RANGE=0,this.caps.ALIASED_LINE_WIDTH_RANGE=0,this.caps.SAMPLES=0,this.caps.SAMPLE_BUFFERS=0,this.caps.RED_BITS=0,this.caps.GREEN_BITS=0,this.caps.BLUE_BITS=0,this.caps.ALPHA_BITS=0,this.caps.DEPTH_BITS=0,this.caps.STENCIL_BITS=0,this.caps.SUBPIXEL_BITS=0,this.caps.COMPRESSED_TEXTURE_FORMATS=0,this.caps=u.map(this.caps,function(t,r){return e.getParameter(e[r])}),this.caps.EXTENSIONS=e.getSupportedExtensions();var s=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");this.caps.maxAnisotropy=s?e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,a.default.info("GPU Capabilities:",this.caps)}},t.prototype.initDefaultRenderer=function(){if(!p.default.isWebGLEnabled())throw new Error("WebGL is not supported, no fallbacks available.");this.threeRenderer=new n.WebGLRenderer({canvas:this.canvas,antialias:this.antialias,preserveDrawingBuffer:this.preserveDrawingBuffer,alpha:!0,precision:this.precision,logarithmicDepthBuffer:this.logarithmicDepthBuffer}),this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(this.devicePixelRatio>0?this.devicePixelRatio:window.devicePixelRatio),this.storeGpuCaps()},t.prototype.applyRenderSettings=function(){var e=this;this.threeRenderer&&(u.forEach(this,function(t,r){void 0!==e.threeRenderer[r]&&(e.threeRenderer[r]=t)}),this.devicePixelRatio>0||(this.devicePixelRatio=window.devicePixelRatio),this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),this.shadowsEnabled&&(this.threeRenderer.shadowMap.enabled=!0,this.threeRenderer.shadowMap.type=this.shadowType,this.threeRenderer.shadowMap.renderReverseSided=this.shadowReverseSided))},t}(o.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=new n.Vector3,u=new n.Euler,p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.quaternion=new n.Quaternion,t.currentGlobalQuaternion=new n.Quaternion,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.rotate=this.autoRotate,this.getEntity().on("startRotate",this.onStartRotate,this),this.getEntity().on("stopRotate",this.onStopRotate,this),this.getEntity().on("toggleRotate",this.onToggleRotate,this)},t.prototype.onShutdown=function(){this.getEntity().off("startRotate",this.onStartRotate,this),this.getEntity().off("stopRotate",this.onStopRotate,this),this.getEntity().off("toggleRotate",this.onToggleRotate,this)},t.prototype.onEnable=function(){this.rotate=this.autoRotate,this.initRotation()},t.prototype.onDisable=function(){var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()),this.rotate=!1)},t.prototype.onAttributesChanged=function(e){e.indexOf("rotation")&&this.rotation&&this.initRotation()},t.prototype.onEntityReady=function(){this.initialQuaternion=new n.Quaternion,this.initialQuaternion.copy(this.getRuntimeData().quaternion),this.initRotation()},t.prototype.onUpdate=function(e){this.rotate&&this.isEnabled()&&(this.getEngine().needsRender=!0,this.getRuntimeData()&&this.rotation&&(s.copy(this.rotation).multiplyScalar(e),u.set(s.x,s.y,s.z),this.quaternion.setFromEuler(u),this.local?this.getRuntimeData().quaternion.multiply(this.quaternion):(this.currentGlobalQuaternion.multiply(this.quaternion),this.getRuntimeData().quaternion.multiplyQuaternions(this.currentGlobalQuaternion,this.initialQuaternion))))},t.prototype.initRotation=function(){u.set(this.rotation.x,this.rotation.y,this.rotation.z),this.local?this.getRuntimeData().quaternion.copy(this.initialQuaternion):this.currentGlobalQuaternion.set(0,0,0,1)},t.prototype.onStartRotate=function(){this.rotate=!0},t.prototype.onStopRotate=function(){this.rotate=!1},t.prototype.onToggleRotate=function(){this.rotate=!this.rotate},t}(a.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertiesChanged),this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onAttributesChanged=function(e){e.indexOf("size")!==-1&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onDisable=function(){this.getEntity().setScale(1,1,1)},t.prototype.onEnable=function(){this.getEntity().scaleToSize(this.size)},t.prototype.onPropertiesChanged=function(e){e.hasOwnProperty("bounds")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(236),s=r(235),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autoLoad=!0,t.uniforms=null,t.noiseMat=null,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"changeNoiseValues",this.changeNoiseValues),this.listenTo(this.getEntity(),"renderNoise",this.changeNoiseValues),this.uniforms={time:{type:"f",value:1},scale:{type:"v2",value:this.scale},offset:{type:"v2",value:this.offset},layerAmplitude:{type:"v4",value:this.layerAmplitude},layerScale:{type:"v4",value:this.layerScale}},this.noiseMat=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:o,fragmentShader:s}),this.cameraRTT=new n.OrthographicCamera(-.5,.5,.5,-.5,-10,10),this.cameraRTT.position.z=1,this.sceneRTT=new n.Scene,this.sceneRTT.add(this.cameraRTT),this.quadGeo=new n.PlaneGeometry(1,1),this.quadRTT=new n.Mesh(this.quadGeo,this.noiseMat),this.quadRTT.position.z=-5,this.sceneRTT.add(this.quadRTT),this.initialized=!0},t.prototype.onShutdown=function(){this.sceneRTT&&(this.sceneRTT.remove(this.cameraRTT),this.sceneRTT.remove(this.quadRTT)),this.sceneRTT=void 0,this.quadRTT=void 0,this.quadGeo&&this.quadGeo.dispose(),this.noiseMat&&this.noiseMat.dispose(),this.uniforms=void 0},t.prototype.onEntityReady=function(){this.autoLoad&&this.renderNoise()},t.prototype.onAttributesChanged=function(e){this.initialized&&(e.indexOf("scale")!==-1&&void 0!==this.scale.x&&(this.uniforms.scale.value.x=this.scale.x,this.uniforms.scale.value.y=this.scale.y),e.indexOf("offset")!==-1&&void 0!==this.offset.x&&(this.uniforms.offset.value.x=this.offset.x,this.uniforms.offset.value.y=this.offset.y),e.indexOf("layerScale")!==-1&&void 0!==this.layerScale.x&&(this.uniforms.layerScale.value.x=this.layerScale.x,this.uniforms.layerScale.value.y=this.layerScale.y,this.uniforms.layerScale.value.z=this.layerScale.z,this.uniforms.layerScale.value.w=this.layerScale.w),e.indexOf("layerAmplitude")!==-1&&void 0!==this.layerAmplitude.x&&(this.uniforms.layerAmplitude.value.x=this.layerAmplitude.x,this.uniforms.layerAmplitude.value.y=this.layerAmplitude.y,this.uniforms.layerAmplitude.value.z=this.layerAmplitude.z,this.uniforms.layerAmplitude.value.w=this.layerAmplitude.w),this.renderNoise())},t.prototype.renderNoise=function(){this.getThreeRenderer().render(this.sceneRTT,this.cameraRTT,this.getRuntimeData(),!0),this.getThreeRenderer().setRenderTarget(null)},t.prototype.changeNoiseValues=function(e,t,r,i){this.layerAmplitude=e,this.layerScale=t,this.scale=r,this.offset=i,this.onAttributesChanged(["layerAmplitude","layerScale","scale","offset"])},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(12),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxTexture=null,t.stereoEnabled=!1,t.size=100,t.skyboxMesh=null,t.skyboxMeshRightEye=null,t.skyboxGeometry=null,t.skyboxGeometryRightEye=null,t.skyboxMaterialCube=null,t.skyboxUniforms=null,t.skyboxVShader=null,t.skyboxPShader=null,t.skyboxMaterial2D=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initMaterials()},t.prototype.onShutdown=function(){this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye&&this.skyboxGeometryRightEye.dispose(),this.skyboxMaterialCube&&this.skyboxMaterialCube.dispose(),this.skyboxMaterial2D&&this.skyboxMaterial2D.dispose(),this.skyboxMesh=null,this.skyboxGeometry=null,this.skyboxGeometryRightEye=null,this.skyboxMaterialCube=null,this.skyboxMaterial2D=null,this.skyboxUniforms=null,this.skyboxTexture=null},t.prototype.getMesh=function(e){return void 0===e&&(e="left"),"left"===e?this.skyboxMesh:this.skyboxMeshRightEye},t.prototype.onAttributesChanged=function(e){if(e.indexOf("skyboxTexture")!==-1){var t=this.getPreviousAttribute("skyboxTexture");if(t){var r=this.getEngine().getEntityById(t);this.stopListening(r)}this.getEntity().unregisterDependencyById(this.getPreviousAttribute("skyboxTexture"));var i=this.getEntity().getOwnDependencyInfo(),n=this.getAttribute("skyboxTexture");i[n]||this.getEntity().registerDependencyById(this.getAttribute("skyboxTexture"))}this.getEntity().isBaseLoaded()&&(e.indexOf("skyboxTexture")===-1&&e.indexOf("stereoEnabled")===-1||this.initSkybox(),e.indexOf("size")!==-1&&this.skyboxMesh&&(this.skyboxMesh.scale.set(this.size,this.size,this.size),this.skyboxMeshRightEye.scale.set(this.size,this.size,this.size)))},t.prototype.onEnable=function(){this.getRuntimeData()&&(this.getRuntimeData().add(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().add(this.skyboxMeshRightEye),this.skyboxTexture&&this.skyboxTexture.isUnloaded()&&this.skyboxTexture.load())},t.prototype.onDisable=function(){this.getRuntimeData()&&(this.getRuntimeData().remove(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().remove(this.skyboxMeshRightEye))},t.prototype.onEntityReady=function(){this.initSkybox()},t.prototype.isStereo=function(){if(!this.skyboxTexture||!this.stereoEnabled)return!1;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:case o.ImageLayout.Stereo2dUnderOver:case o.ImageLayout.Stereo2dLeftRight:case o.ImageLayout.Stereo2dRightLeft:return this.stereoEnabled;default:return!1}},t.prototype.initGeometry=function(){this.skyboxGeometry&&(this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye.dispose()),this.skyboxGeometry=new n.SphereBufferGeometry(1,64,64),this.skyboxGeometryRightEye=this.skyboxGeometry.clone()},t.prototype.initStereoUvs=function(){if(this.skyboxTexture){var e=new n.Vector2,t=new n.Vector2,r=new n.Vector2,i=new n.Vector2;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:e.set(1,.5),t.set(0,0),r.set(1,.5),i.set(0,.5);break;case o.ImageLayout.Stereo2dUnderOver:e.set(1,.5),t.set(0,.5),r.set(1,.5),i.set(0,0);break;case o.ImageLayout.Stereo2dLeftRight:e.set(.5,1),t.set(0,0),r.set(.5,1),i.set(.5,0);break;case o.ImageLayout.Stereo2dRightLeft:e.set(.5,1),t.set(.5,0),r.set(.5,1),i.set(0,0);break;default:return}for(var a=this.skyboxGeometry.getAttribute("uv").array,s=this.skyboxGeometryRightEye.getAttribute("uv").array,u=0;un&&i>0?(e.fillText(s,r,u),s=t+" ",u+=a):s=o}),e.fillText(s,r,u)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.standing=!0,t.userHeight=6,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.standingMatrix=new n.Matrix4,t.workVector=new n.Vector3,t.scale=1,t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&this.hasRuntimeData()){var t=this.getEngine(),r=t.getVrDisplay();if(r){t.needsRender=!0,r.getFrameData(this.frameData);var i=this.frameData.pose,n=this.getRuntimeData(),a=this.getEntity();null!==i.orientation&&(a.setQuaternion(i.orientation[0],i.orientation[1],i.orientation[2],i.orientation[3]),r.capabilities.hasPosition&&i.position&&a.setPosition(i.position[0],i.position[1],i.position[2]),this.standing&&r.stageParameters?(n.updateMatrix(),this.standingMatrix.fromArray(r.stageParameters.sittingToStandingTransform),n.applyMatrix(this.standingMatrix),a.setQuaternion(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),n.position.multiplyScalar(this.scale),a.setPosition(n.position.x,n.position.y,n.position.z)):(a.getPosition(this.workVector),this.workVector.multiplyScalar(this.scale),a.setPosition(this.workVector.x,this.workVector.y,this.workVector.z)))}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(22),o=r(3),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scale=1,t.isPresenting=!1,t.wasPresenting=!1,t.vrDisplays=null,t.previousPixelRatio=1,t}return i.__extends(t,e),t.prototype.getScale=function(){return this.scale},t.prototype.setScale=function(e){this.scale=e},t.prototype.getDisplays=function(){return this.vrDisplays},t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"enableVrRendering",this.onEnableVr),this.listenTo(this.getEngine(),"disableVrRendering",this.onDisableVr),this.listenTo(this.getEngine(),"toggleVrRendering",this.onToggleVr),this.onVrDisplayPresentChange=this.onVrDisplayPresentChange.bind(this),window.addEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1),navigator.getVRDisplays?navigator.getVRDisplays().then(function(t){e.vrDisplays=t,e.trigger("displaysInitialized")}):this.vrDisplays=[]},t.prototype.onShutdown=function(){e.prototype.onShutdown.call(this),window.removeEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1)},t.prototype.onDisable=function(){this.isPresenting&&this.onDisableVr()},t.prototype.whenDisplaysAvailable=function(e){var t=this;this.vrDisplays?e.call(this,this.vrDisplays):this.listenToOnce(this,"displaysInitialized",function(){e.call(t,t.vrDisplays)})},t.prototype.onPostRender=function(e){var t=this.getEngine().getVrDisplay();t&&this.isPresenting&&t.submitFrame()},t.prototype.onEnableVr=function(){if(this.isEnabled()){if(!this.vrDisplays)return void this.listenToOnce(this,"displaysInitialized",this.onEnableVr.bind(this));if(this.vrDisplays.length){var e=this.vrDisplays[0];this.getEngine().setVrDisplay(e);var t=this.getRenderer().getCanvas();e.requestPresent([{source:t}]).catch(function(e){o.default.error("Failed to present to VR display",e.message)})}}},t.prototype.onDisableVr=function(){if(this.isPresenting){var e=this.getEngine().getVrDisplay();e&&(e.exitPresent(),this.getEngine().setVrDisplay(null))}},t.prototype.onToggleVr=function(){this.isPresenting?this.onDisableVr():this.onEnableVr()},t.prototype.onVrDisplayPresentChange=function(){this.wasPresenting=this.isPresenting;var e=this.getEngine().getVrDisplay();this.isPresenting=e&&e.isPresenting;var t=this.getThreeRenderer();if(this.isPresenting){var r=e.getEyeParameters("left"),i=r.renderWidth,n=r.renderHeight;if(!this.wasPresenting){if(this.previousPixelRatio=t.getPixelRatio(),a.isMobile()){var o=t.capabilities.maxTextureSize,s=2*i;s*this.previousPixelRatio>o&&(this.previousPixelRatio=Math.floor(o/s)),t.setPixelRatio(this.previousPixelRatio)}else t.setPixelRatio(1);t.setSize(2*i,n,!1),this.getEngine().trigger("vrRenderingEnabled")}}else this.wasPresenting&&(t.setPixelRatio(this.previousPixelRatio),this.getEngine().setVrDisplay(null),this.getEngine().trigger("resize"),this.getEngine().trigger("vrRenderingDisabled"))},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(65),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enablePreRenderFunctions=!0,t.enableShadows=!0,t.eyeTranslationL=new n.Vector3,t.eyeTranslationR=new n.Vector3,t.defaultLeftBounds=[0,0,.5,1],t.defaultRightBounds=[.5,0,.5,1],t.renderRectL={x:0,y:0,width:256,height:256},t.renderRectR={x:128,y:0,width:256,height:256},t.cameraL=new n.PerspectiveCamera,t.cameraR=new n.PerspectiveCamera,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.scale=1,t}return i.__extends(t,e),t.prototype.renderView=function(t){if(this.isEnabled()&&this.hasRuntimeData()){var r=this.getRootObject();if(r.isBaseLoaded()){var i=r.getRuntimeData(),n=this.getEngine().getVrDisplay();if(!n)return e.prototype.renderView.call(this,t);var a=i.autoUpdate;a&&(i.updateMatrixWorld(),i.autoUpdate=!1);var o=n.getEyeParameters("left"),s=n.getEyeParameters("right");this.eyeTranslationL.fromArray(o.offset),this.eyeTranslationR.fromArray(s.offset);var u,p,c=this.getThreeRenderer(),l=c.getSize(),d=n.getLayers();if(d.length){var h=d[0];u=null!==h.leftBounds&&4===h.leftBounds.length?h.leftBounds:this.defaultLeftBounds,p=null!==h.rightBounds&&4===h.rightBounds.length?h.rightBounds:this.defaultRightBounds}else u=this.defaultLeftBounds,p=this.defaultRightBounds;this.renderRectL={x:Math.round(l.width*u[0]),y:Math.round(l.height*u[1]),width:Math.round(l.width*u[2]),height:Math.round(l.height*u[3])},this.renderRectR={x:Math.round(l.width*p[0]),y:Math.round(l.height*p[1]),width:Math.round(l.width*p[2]),height:Math.round(l.height*p[3])};var f=this.getRuntimeData();null===f.parent&&f.updateMatrixWorld(),f.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),f.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale),this.cameraL.translateOnAxis(this.eyeTranslationL,this.scale),this.cameraR.translateOnAxis(this.eyeTranslationR,this.scale),n.depthNear=f.near,n.depthFar=f.far,n.getFrameData(this.frameData),this.cameraL.projectionMatrix.elements=this.frameData.leftProjectionMatrix,this.cameraR.projectionMatrix.elements=this.frameData.rightProjectionMatrix,c.setScissor(this.renderRectL.x,this.renderRectL.y,this.renderRectL.width,this.renderRectL.height),this.getRenderer().renderView(i,this.cameraL,{renderTarget:this.renderTarget,clearDepth:!0,clearColor:!0,viewPort:this.renderRectL,enablePreRenderFunctions:!0}),c.setScissor(this.renderRectR.x,this.renderRectR.y,this.renderRectR.width,this.renderRectR.height),this.getRenderer().renderView(i,this.cameraR,{renderTarget:this.renderTarget,clearDepth:!1,clearColor:!1,viewPort:this.renderRectR,enablePreRenderFunctions:!0}),a&&(i.autoUpdate=!0)}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBoxApiBase="https://api.box.com/2.0/"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(208),s=r(207),u=r(209),p=r(204),c=r(216),l=r(27),d=r(76),h=r(35),f=r(14),m=r(46),y=r(45),g=r(9),v=r(34),b=r(15),P=r(11),x=r(117),E=function(e){var t;return e&&e.jquery?e.get(0):"string"==typeof e?(t=document.querySelectorAll(e),t.length&&t[0]):e};t.engineMixins=y.default({},[u.default,s.default,l.default]);var w=function(e){function t(t){var r=e.call(this)||this;r.renderOnDemand=!1,r.needsRender=!0,r.container=void 0,r.globalEvents=void 0,r.engineName="Unnamed Instance of Box3D Engine",r.audioContext=void 0,r.paused=!1,r.runMode="player",r.runtimeNames={},r.nextRuntimeName=1,a.default.info("Engine Initialization"),r.globalScope=t.globalScope||window;var i=function(){if(r.globalEvents=t&&t.globalEvents||m.default,!r.globalEvents)throw new Error("No global event system supplied or found")},s=function(){r.container=r.container||E(t.container)},u=function(){if(r.canvas=r.canvas||E(t.canvas),r.canvas||(r.canvas=document.createElement("canvas"),r.container&&r.container.appendChild(r.canvas),r.canvasCreatedByEngine=!0),!(r.canvas instanceof HTMLCanvasElement))throw new Error("Failed to create canvas element")},l=function(){if(r.resourceLoader=t.resourceLoader,!r.resourceLoader)throw new Error("No resource loader passed to Engine")},y=function(){r.engineName=t.engineName||r.engineName,r.clock=new n.Clock(!0),r.frameDelta=0,r.frameDeltaAggregate=0,r.frameCount=0,r.lastFrameDelta=r.getTimeNow(),r.avgFrameTime=0,r.paused=!1,r.documentVisible=!0,r.state="initializing",r.setRunMode(t.runMode),r.entityDispatcher=t.entityDispatcher||new o.default,r.entityDispatcher.addEngine(r)},g=function(){r.scriptRegistry=new d.default(r),Object.keys(h.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(h.default.builtInAssetDescriptors[e])}),Object.keys(f.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(f.default.builtInAssetDescriptors[e])})},v=function(){r.materialUtilities=new c.default(r)},b=function(){r.geometryUtilities=new p.default},P=function(){r.onResize=function(){r.needsRender=!0},r.onBlur=function(){r.trigger("blur")},r.onFocus=function(){r.trigger("focus")},r.onVisibilityChange=function(){var e=document.hidden||document.mozHidden||document.msHidden||document.webkitHidden;r.documentVisible&&e?r.documentVisible=!1:r.documentVisible||(r.frameDelta=0,r.lastFrameDelta=r.getTimeNow(),r.documentVisible=!0)},window.addEventListener("blur",r.onBlur),window.addEventListener("focus",r.onFocus),r.listenTo(r,"resize",r.onResize),document.addEventListener("visibilitychange",r.onVisibilityChange)},x=function(){r.globalScope[r.engineName]=r,r.update(),r.state="initialized"};return i(),s(),u(),l(),v(),b(),y(),g(),P(),x(),r}return i.__extends(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),a.default.info(this.engineName+" - Destroying engine."),window[this.engineName]&&delete window[this.engineName],this.baseRenderer=void 0,this.resourceLoader.destroy(),this.materialUtilities.destroy(),this.geometryUtilities.destroy(),window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.stopListening(this,"resize",this.onResize),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onBlur=void 0,this.onFocus=void 0,this.onResize=void 0,this.onVisibilityChange=void 0,this.trigger("shutdown"),this.state="uninitializing",this.cancelAnimationFrame(this.animationRequestID),this.canvas&&this.canvas.parentNode&&this.canvasCreatedByEngine&&this.canvas.parentNode.removeChild(this.canvas),this.entityDispatcher&&this.entityDispatcher.removeEngine(this),this.clock=void 0,this.canvas=void 0,this.container=void 0,this.threeRenderer=void 0,this.baseRenderer=void 0,this.engineName=void 0,this.entityDispatcher=void 0,this.state="uninitialized"},t.prototype.getName=function(){return this.engineName},t.prototype.addEntities=function(e){return this.entityDispatcher?this.entityDispatcher.addEntities(e):[]},t.prototype.addRemoteEntities=function(e,t){var r=this;return void 0===t&&(t={}),new Promise(function(i,n){r.resourceLoader.load(e,b.default.ENTITIES,t).on(P.default.LOAD,function(e){i(r.addEntities(e))}).on(P.default.ERROR,function(e){return n(e)})})},t.prototype.addRemoteEntitiesFromBox=function(e,t,r){var i=this;return void 0===t&&(t={}),void 0===r&&(r=x.defaultBoxApiBase),this.fetchRemoteRepresentationsFromBox(e,t,r).then(function(e){return i.addRemoteEntities(e.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json"),t)})},t.prototype.fetchRemoteRepresentationsFromBox=function(e,t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=x.defaultBoxApiBase);var a=r+"files/"+e+"?fields=representations";return new Promise(function(e,r){return n.resourceLoader.load(a,b.default.JSON,i.__assign({headers:{"X-Rep-Hints":"[3d]"}},t)).on(P.default.LOAD,function(t){return e(t)}).on(P.default.ERROR,function(e){return r(e)})})},t.prototype.loadEntities=function(e,t,r){var i=this;void 0===r&&(r="load"),Promise.all(e.map(function(e){var t=e instanceof g.default?e.id:e;return new Promise(function(e,n){var a=i.getEntityById(t);a?(a.when(r,function(){e()}),a.isUnloaded()&&a.load()):n(new Error("Entity can't be found."))})})).then(function(){"function"==typeof t&&t.call(i)}).catch(function(e){"function"==typeof t&&(a.default.error("loadEntities error: "+e),t.call(i,e))})},t.prototype.setVrDisplay=function(e){var t=this;this.cancelAnimationFrame(this.animationRequestID),this.vrDevice=e,this.animationRequestID=this.requestAnimationFrame(function(){t.needsRender=!0,t.update()})},t.prototype.getVrDisplay=function(){ -return this.vrDevice},t.prototype.getApplication=function(){var e=this.getAssetsByClass(v.default);return e.find(function(e){return e.isBaseLoaded()})},t.prototype.setRunMode=function(e){this.runMode="editor"===e?e:"player"},t.prototype.getRunMode=function(){return this.runMode},t.prototype.getRenderer=function(){return this.baseRenderer},t.prototype.setRenderer=function(e){this.baseRenderer&&(this.baseRenderer.onShutdown(),this.baseRenderer.stopListening()),this.baseRenderer=e,this.threeRenderer=e.threeRenderer},t.prototype.getThreeRenderer=function(){return this.threeRenderer},t.prototype.getGPUCapability=function(e){return this.baseRenderer.caps[e]},t.prototype.getAudioContext=function(){if(!this.audioContext){var e=this.globalScope.AudioContext||this.globalScope.webkitAudioContext;e&&(this.audioContext=new e,this.audioContext||a.default.warn(this.engineName+" - Failed to create Web Audio API context"))}return this.audioContext},t.prototype.getRuntimeName=function(e){return this.runtimeNames.hasOwnProperty(e)||(this.runtimeNames[e]=this.nextRuntimeName.toString(),this.nextRuntimeName++),this.runtimeNames[e]},t.prototype.pause=function(){this.paused||(this.paused=!0,this.clock.stop(),this.cancelAnimationFrame(this.animationRequestID),a.default.info(this.engineName+" engine has been paused."))},t.prototype.unpause=function(){this.paused&&(this.paused=!1,this.frameDelta=0,this.lastFrameDelta=this.getTimeNow(),this.clock.start(),a.default.info(this.engineName+" engine has been unpaused."),this.update())},t.prototype.setCurrentApp=function(e){var t=this.getAssetById(e);t&&(this.currentApplication&&(a.default.warn("Already an application running in this engine. Stop it before starting the "+t.getName()+" application."),this.currentApplication.unload()),this.currentApplication=t)},t.prototype.getTimeNow=function(){return.001*(window.performance&&window.performance.now?window.performance.now():Date.now())},t.prototype.update=function(){var e=this;this.paused||(this.animationRequestID=this.requestAnimationFrame(function(){e.update()}),this.documentVisible&&(this.frameCount++,this.frameDelta=this.getTimeNow()-this.lastFrameDelta,this.lastFrameDelta=this.getTimeNow(),this.frameDeltaAggregate+=this.frameDelta,this.avgFrameTime=this.frameDeltaAggregate/this.frameCount,this.trigger("preUpdate",this.frameDelta),this.trigger("update",this.frameDelta),this.trigger("postUpdate",this.frameDelta),this.renderOnDemand&&!this.needsRender||(this.needsRender=!1,this.trigger("preRender",this.frameDelta),this.trigger("render",this.frameDelta),this.trigger("renderGroup1",this.frameDelta),this.trigger("renderGroup2",this.frameDelta),this.trigger("renderGroup3",this.frameDelta),this.trigger("renderGroup4",this.frameDelta),this.trigger("renderGroup5",this.frameDelta),this.trigger("renderGroup6",this.frameDelta),this.trigger("renderGroup7",this.frameDelta),this.trigger("renderGroup8",this.frameDelta),this.trigger("renderGroup9",this.frameDelta),this.trigger("renderGroup10",this.frameDelta),this.trigger("postRender",this.frameDelta))))},t.prototype.requestAnimationFrame=function(e){return this.vrDevice?this.vrDevice.requestAnimationFrame(e):requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){return this.vrDevice?this.vrDevice.cancelAnimationFrame(e):cancelAnimationFrame(e)},t}(t.engineMixins);t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n={side:{displayName:"Cull Mode",description:"This controls which side of the geometry will be visible.",type:"opt",isRenderParam:!0,options:{frontOnly:i.FrontSide,backOnly:i.BackSide,doubleSided:i.DoubleSide},default:"doubleSided"},wireframe:{displayName:"Wireframe",description:"This controls whether the material displays as a wireframe.",type:"b",isRenderParam:!0,default:!1},fog:{displayName:"Enable Fog",description:"This controls whether this material is affected by fog or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},depthFunc:{displayName:"Depth Function",description:"The function to use when comparing the current depth value with the one that already exists in the buffer.",isRenderParam:!0,type:"opt",options:{never:i.NeverDepth,always:i.AlwaysDepth,lessThan:i.LessDepth,lessThanOrEqual:i.LessEqualDepth,equal:i.EqualDepth,greaterThanOrEqual:i.GreaterEqualDepth,greaterThan:i.GreaterDepth,notEqual:i.NotEqualDepth},default:"lessThanOrEqual"},depthWrite:{displayName:"Enable Depth Write",description:"This controls whether the depth values of a mesh rendered with this material are recorded.",isRenderParam:!0,type:"b",default:!0},depthTest:{displayName:"Enable Depth Test",description:"This controls whether a depth check is done before this material is rendered so that it can be occluded.",isRenderParam:!0,type:"b",default:!0},blending:{displayName:"Blending Mode",description:"This controls how the material will be blended with the color behind it.",isRenderParam:!0,type:"opt",options:{none:i.NoBlending,normal:i.NormalBlending,additive:i.AdditiveBlending,subtractive:i.SubtractiveBlending,multiplicative:i.MultiplyBlending,custom:i.CustomBlending},default:"normal",transparency:"GreaterThanOne"},blendEquation:{displayName:"Blending Equation",description:"The function to use when blending the current color with the one already in the buffer.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"}}},blendSrc:{displayName:"Blend Source",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"}}},blendDst:{displayName:"Blend Destination",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"}}},useSeparateAlphaBlend:{displayName:"Separate Blend for Alpha",description:"Use different blend values for the alpha channel.",type:"b",default:!1,displayWhen:{blending:{equals:"custom"}}},blendEquationAlpha:{displayName:"Alpha Blend Equation",description:"The function to use when blending the current alpha with the one already in the buffer.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},blendSrcAlpha:{displayName:"Alpha Blend Source",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},blendDstAlpha:{displayName:"Alpha Blend Destination",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},polygonOffset:{displayName:"Polygon Offset",description:"Turns on rendering with polygon offsets. This can be used to work around z-fighting.",isRenderParam:!0,type:"b",default:!1},polygonOffsetFactor:{displayName:"Polygon Offset Factor",description:"Scales the maximum Z slope, with respect to X or Y of the polygon.",isRenderParam:!0,type:"f",default:1},polygonOffsetUnits:{displayName:"Polygon Offset Units",description:"Scales the minimum resolvable depth buffer value.",isRenderParam:!0,type:"f",default:1},alphaTest:{displayName:"Alpha Test",description:'Pixels with an alpha value below the given value will not be rendered. This value will only be used when this material\'s Transparency blending mode is set to "Masked"',isRenderParam:!0,forceUpdate:!0,type:"f",default:.2,min:0,max:1,step:.001}};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={diffuse:{displayName:"Diffuse Color",description:"The color of light diffusely reflected by the surface.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"color"},diffuseTexture:{displayName:"Diffuse Map",description:"The color reflected diffusely by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"map",enabledWhen:{diffuseTexture:{notEqualsDefault:!0}},transparency:"HasAlpha"},ambientFactor:{displayName:"Ambient Intensity",description:"A value to multiple the ambient color by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"aoMapIntensity"},ambientTexture:{displayName:"Ambient Texture",description:"The color reflected by the surface from ambient lights.",type:"t",default:null,isRenderParam:!0,uniformName:"aoMap",enabledWhen:{ambientTexture:{notEqualsDefault:!0}}},emissive:{displayName:"Emissive Color",description:"A color emitted by the surface which is not affected by external lights.",type:"c",default:{r:0,g:0,b:0},min:0,max:1,isRenderParam:!0,uniformName:"emissive"},emissiveFactor:{displayName:"Emissive Intensity",description:"A value to multiple the emissive color by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"emissiveIntensity"},emissiveTexture:{displayName:"Emissive Texture",description:"The color emitted by the surface which is not affected by external lights.",type:"t",default:null,isRenderParam:!0,uniformName:"emissiveMap",enabledWhen:{emissiveTexture:{notEqualsDefault:!0}}},bumpTexture:{displayName:"Bump Texture",description:"The height map of the surface, used to fake its shape when shading.",type:"t",default:null,isRenderParam:!0,uniformName:"bumpMap",enabledWhen:{bumpTexture:{notEqualsDefault:!0},normalMapTexture:{equalsDefault:!0}}},bumpFactor:{displayName:"Bump Scale",description:"A value to multiple the bump amount by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"bumpScale"},normalMapTexture:{displayName:"Normal Texture",description:"The tangent-space surface directions, used to fake its shape when shading.",type:"t",default:null,isRenderParam:!0,uniformName:"normalMap",enabledWhen:{normalMapTexture:{notEqualsDefault:!0}}},normalFactor:{displayName:"Normal Scale",description:"A value to divide the normal-z amount by. i.e. lower value results in smoother surface.",type:"v2",default:{x:1,y:1},min:0,max:100,isRenderParam:!0,uniformName:"normalScale"},transparencyFactor:{displayName:"Opacity",description:"The opacity of the surface.",type:"f",default:1,min:0,max:1,isRenderParam:!0,uniformName:"opacity",transparency:"LessThanOne"},transparencyFactorTexture:{displayName:"Alpha Map",description:"The opacity of the surface.",type:"t",default:null,isRenderParam:!0,uniformName:"alphaMap",transparency:"NotFalsy",enabledWhen:{transparencyFactorTexture:{notEqualsDefault:!0}}},displacementColorTexture:{displayName:"Displacement Map",description:"A texture that stores the displacement amount at each texel.",type:"t",default:null,isRenderParam:!0,uniformName:"displacementMap",enabledWhen:{displacementColorTexture:{notEqualsDefault:!0}}},displacementFactor:{displayName:"Displacement Scale",description:"A value to multiple the displacement by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"displacementScale"},displacementBias:{displayName:"Displacement Bias",description:"A value to bias the displacement by.",type:"f",default:0,min:-1,max:1,isRenderParam:!0,uniformName:"displacementScale"}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"accessor",title:"AccessorDef",type:"object",description:"A typed-view into raw binary data.",properties:{componentType:{type:"string",enum:["int8","uint8","int16","int32","uint32","float32","float64"],description:"These correspond to typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array."},type:{type:"string",enum:["scalar","vec2","vec3","vec4","mat2","mat3","mat4"],description:"Specifies if elements are scalars, vectors or matrices."},byteOffset:{type:"integer",description:"Byte offset into the binary data."},byteStride:{type:"integer",description:"The number of bytes between successive elements (0 indicates that the elements are tightly packed)."},count:{type:"integer",description:"The number of elements, not to be confused with the number of components or bytes. For example, the number of positions, not the number of floats."}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"animationAsset",title:"AnimationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["animation"]},properties:{$ref:"animationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"animationAssetProperties",title:"AnimationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{clips:{type:"object",properties:{},additionalProperties:{$ref:"animationClip.json"},default:{}},layers:{type:"object",properties:{},additionalProperties:{$ref:"animationLayer.json"},defualt:{}},channels:{type:"object",properties:{},additionalProperties:{$ref:"animationChannel.json"},default:{}}}),required:["clips","layers","channels"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationChannel",title:"AnimationChannelDef",type:"object",description:"An animation channel.",properties:{name:{type:"string",description:"The channel's name."},targetObject:{type:"array",description:"The path of the object to animate.",items:{type:"string"},default:[]},targetProperty:{type:"string",description:"The path of the property to animate."},values:{type:"string",description:"The ID of the accessor for the channel values."},times:{type:"string",description:"The ID of the accessor for the channel times."},interpolation:{type:"string",enum:["linear"],description:"The interpolation type for the channel."}},required:["name","targetObject","targetProperty","values","times","interpolation"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationClip",title:"AnimationClipDef",type:"object",description:"An animation clip.",properties:{name:{type:"string",description:"The clip's name."},start:{type:"number",description:"The take's start time, in seconds.",default:0},stop:{type:"number",description:"The take's stop time, in seconds.",default:0},layers:{type:"array",items:{type:"string"},default:[]}},required:["name","start","stop","layers"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationLayer",title:"AnimationLayerDef",type:"object",description:"An animation layer.",properties:{name:{type:"string",description:"The layer's name."},blendMode:{enum:["additive"],description:"The layer's blend mode.",default:"additive"},blendWeight:{type:"number",description:"The layer's blend weight.",default:1},channels:{type:"array",items:{type:"string"},default:[]}},required:["name","blendMode","blendWeight","channels"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"applicationAsset",title:"ApplicationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["application"]},properties:{$ref:"applicationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"applicationAssetProperties",title:"ApplicationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{startupSceneId:{type:["string","null"],description:"#entity-PrefabAsset"}}),required:["startupSceneId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"audioAsset",title:"AudioAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["audio"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"audioRepresentation.json"}}),properties:{$ref:"audioAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"audioAssetProperties",title:"AudioAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"audioRepresentation",title:"AudioRepresentationDef",properties:i.__assign({},n.default.properties,{bitRate:{type:"number"},sampleRate:{type:"number"},stereo:{type:"boolean"},startTime:{type:"number"},duration:{type:"number"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"boneObject",title:"BoneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["bone"]},properties:{$ref:"boneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"boneObjectProperties",title:"BoneObjectPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"box3",title:"Box3Def",type:"object",properties:{min:{$ref:"vector3.json"},max:{$ref:"vector3.json"}},required:["min","max"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"bufferAsset",title:"BufferAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["buffer"]},properties:{$ref:"bufferAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"bufferAssetProperties",title:"BufferAssetPropertiesDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the binary file."},isExternal:{type:"boolean",description:"True is the asset should be loaded from outside of the base data provider/content provider.",default:!1},contentLength:{type:"number",description:"The HTTP Content-Length."},accessors:{type:"object",properties:{},additionalProperties:{$ref:"accessor.json"},description:"Typed-views into the binary file."}}),required:["src","contentLength"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"cameraObject",title:"CameraObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["camera"]},properties:{$ref:"cameraObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"cameraObjectProperties",title:"CameraObjectPropertiesDef",properties:i.__assign({},n.default.properties,{cameraType:{type:"string",description:"",enum:["perspective","orthographic"],default:"perspective"},fov:{type:"number",default:50,dependencies:{cameraType:["perspective"]}},aspect:{type:"number",default:1.7777777777777777},near:{type:"number",default:.1},far:{type:"number",default:12e3},right:{type:"number",default:10,dependencies:{cameraType:["orthographic"]}},left:{type:"number",default:-10,dependencies:{cameraType:["orthographic"]}},top:{type:"number",default:10,dependencies:{cameraType:["orthographic"]}},bottom:{type:"number",default:-10,dependencies:{cameraType:["orthographic"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"colorRgb",title:"ColorRgb",type:"object",properties:{r:{type:"number"},g:{type:"number"},b:{type:"number"}},required:["r","g","b"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"component",title:"ComponentDef",type:"object",properties:{id:{type:"string"},scriptId:{type:"string"},name:{type:"string"},enabled:{type:"boolean"},attributes:{type:"object",properties:{},additionalProperties:{$ref:"componentAttribute.json"}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"componentAttribute",title:"ComponentAttributeDef",type:"object",properties:{type:{type:"string"},subType:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1},attributes:{type:"array",items:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"documentAsset",title:"DocumentAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["document"]},properties:{$ref:"documentAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"documentAssetProperties",title:"DocumentAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"dracoAttribute",title:"DracoAttributeDef",type:"object",description:"Specifies the name and ID of a Draco attribute.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},id:{type:"string",description:"The ID of the Draco attribute."}},required:["name","id"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"dracoGeometryAsset",title:"DracoGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["dracoGeometry"]},properties:{$ref:"dracoGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"dracoGeometryAssetProperties",title:"DracoGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{accessorId:{type:["string","null"],description:"The ID of the accessor containing the draco geometry: #."},attributes:{type:"object",properties:{},additionalProperties:{$ref:"dracoAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements."}}),required:["accessorId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(70),a=i.__assign({},n.default,{id:"imageAsset",title:"ImageAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["image"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"imageRepresentation.json"}}),properties:{$ref:"imageAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(41),a=i.__assign({},n.default,{id:"imageAssetProperties",title:"ImageAssetPropertiesDef",properties:i.__assign({},n.default.properties,{useCompression:{type:"boolean",description:"True if we will try to use a hardware-compressed version of the image 'instead of a regular one. This depends on the hardware capabilities of the user and the data formats available.",default:!0}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a={id:"imageRepresentation",title:"ImageRepresentationDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the representation."},channels:{type:"array",items:{type:"string"}},compression:{type:"string",enum:["dxt","dxt1","dxt5","jpeg","zip"]},isExternal:{type:"boolean"},width:{type:"integer",description:"The width, in pixels, of the representation."},height:{type:"integer",description:"The height, in pixels, of the representation."},colorspace:{type:"string",enum:["srgb","rgb"]}}),required:["src"],additionalProperties:!1};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"lightObject",title:"LightObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["light"]},properties:{$ref:"lightObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"lightObjectProperties",title:"LightObjectPropertiesDef",properties:i.__assign({},n.default.properties,{lightType:{type:"string",enum:["directional","point","spot","hemisphere","ambient"],default:"directional"},color:{$ref:"colorRgb.json",default:{r:.7333,g:.7333,b:.7333}},intensity:{type:"number",minimum:0,default:1},distance:{type:"number",default:0,minimum:0,dependencies:{lightType:["point","spot"]}},decay:{type:"number",default:1,minimum:0,maximum:5,dependencies:{lightType:["point","spot"]}},angle:{type:"number",default:Math.PI/3,minimum:1,maximum:Math.PI,dependencies:{lightType:["spot"]}},penumbra:{type:"number",default:Math.PI/4,minimum:.001,maximum:Math.PI/2,dependencies:{lightType:["spot"]}},groundColor:{$ref:"colorRgb.json",dependencies:{lightType:["hemisphere"]},default:{r:.033,g:.333,b:.7333}},castShadow:{type:"boolean",default:!1,description:"#read-only"},receiveShadow:{description:"#unused"},shadowCameraNear:{type:"number",default:.1,description:"#read-only"},shadowCameraFar:{type:"number",default:20,description:"#read-only"},shadowCameraLeft:{type:"number",default:-10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowCameraRight:{type:"number",default:10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowCameraTop:{type:"number",default:10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowCameraBottom:{type:"number",default:-10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowBias:{type:"number",default:-.0015,description:"#read-only"},shadowMapWidth:{type:"integer",default:1024,description:"#read-only"},shadowMapHeight:{type:"integer",default:1024,description:"#read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"materialAsset",title:"MaterialAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["material"]},properties:{$ref:"materialAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"materialAssetProperties",title:"MaterialAssetPropertiesDef",properties:i.__assign({},n.default.properties,{shaderId:{type:"string",default:"fbx_surface_phong_shader"}}),additionalProperties:!0});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"meshAttribute",title:"MeshAttributeDef",type:"object",description:"Specifies a range of attribute data for the vertices of a mesh.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},accessorId:{type:["string","null"],description:"The ID of the buffer asset and accessor: #."}},required:["name","accessorId"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"meshGeometryAsset",title:"MeshGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["meshGeometry"]},properties:{$ref:"meshGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"meshGeometryAssetProperties",title:"MeshGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",properties:{},additionalProperties:{$ref:"meshAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements."},indices:{type:["string","null"],description:"The ID of the accessor containing the vertex indices: #."},primitives:{type:"array",items:{$ref:"meshPrimitive.json"},description:"The primitives (points, lines, triangles) that make up the mesh."}}),required:["attributes","indices","primitives"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"meshObject",title:"MeshObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["mesh"]},properties:{$ref:"meshObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"meshObjectProperties",title:"MeshObjectPropertiesDef",properties:i.__assign({},n.default.properties,{customDepthMaterial:{type:["string","null"],default:null},materials:{type:"array",description:"#entity-MaterialAsset",default:["missingMaterial"]},geometryId:{type:["string","null"],description:"#entity-BaseGeometryAsset",default:null},skinId:{type:["string","null"],description:"#entity-SkinAsset",default:null}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={$schema:"http://json-schema.org/draft-04/schema",id:"meshPrimitve",title:"meshPrimitiveDef",type:"object",description:"A mesh primitive with an optional material assignment.",properties:{primitive:{enum:["points","lines","triangles"],description:"The type of primitive to render.",default:"triangles"},count:{type:"integer",description:"The number of vertices to draw.",default:0},start:{type:"integer", -description:"The index of the first vertex to draw.",default:0},offset:{type:"integer",description:"An offset to apply to each index. This can be used to overcome the 16-bit index limit imposed by WebGL. For example, the first component of a vertex attribute with a value size of 3 would be referenced as follows: values[3 * (offset + indices[start + i])].",default:0},materialIndex:{type:"integer",description:"The index of the material to apply to the primitive being rendered.",default:0}},required:["primitve","count"],additionalProperties:!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"nodeObject",title:"NodeObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["node"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"nodeObjectProperties",title:"NodeObjectPropertiesDef",properties:i.__assign({},n.default.properties)});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"prefabAsset",title:"PrefabAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["prefab"]},properties:{$ref:"prefabAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"prefabAssetProperties",title:"PrefabAssetPropertiesDef",properties:i.__assign({},n.default.properties,{rootObjectId:{type:["string","null"],default:null,description:"The ID of the BaseObject that serves as the root node of a hierarchy. #entity-BaseObject"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"primitiveGeometryAsset",title:"PrimitiveGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["primitiveGeometry"]},properties:{$ref:"primitiveGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"primitiveGeometryAssetProperties",title:"PrimitiveGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{type:{type:"string",default:"sphere",enum:["sphere","box","plane","torus","cylinder"]},radius:{type:"number",default:.5,min:0,dependencies:{type:["sphere","torus"]}},segmentsU:{type:"integer",default:24,min:0,dependencies:{type:["torus","sphere","cylinder"]}},segmentsV:{type:"integer",default:24,min:0,dependencies:{type:["torus","sphere","cylinder"]}},sizeX:{type:"number",default:1,dependencies:{type:["box","plane"]}},sizeY:{type:"number",default:1,dependencies:{type:["box","plane"]}},sizeZ:{type:"number",default:1,dependencies:{type:["box"]}},segmentsX:{type:"integer",default:1,min:0,dependencies:{type:["box","plane"]}},segmentsY:{type:"integer",default:1,min:0,dependencies:{type:["box","plane"]}},segmentsZ:{type:"integer",default:1,min:0,dependencies:{type:["box"]}},radiusTop:{type:"number",default:.5,min:0,dependencies:{type:["cylinder"]}},radiusBottom:{type:"number",default:.5,min:0,dependencies:{type:["cylinder"]}},height:{type:"number",default:1,min:0,dependencies:{type:["cylinder"]}},open:{type:"boolean",default:!1,dependencies:{type:["cylinder"]}},tubeRadius:{type:"number",default:.1,min:0,dependencies:{type:["torus"]}},arcAngle:{type:"number",default:6.283185307179586,min:0,max:6.283185307179586,dependencies:{type:["torus"]}},phiStart:{type:"number",default:0,min:0,max:6.283185307179586,dependencies:{type:["sphere"]}},phiLength:{type:"number",default:6.283185307179586,min:0,max:6.283185307179586,dependencies:{type:["sphere"]}},thetaStart:{type:"number",default:0,min:0,max:6.283185307179586,dependencies:{type:["sphere","cylinder"]}},thetaLength:{type:"number",default:3.141592653589793,min:0,max:6.283185307179586,dependencies:{type:["sphere","cylinder"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(42),a=i.__assign({},n.default,{id:"renderTexture2DAsset",title:"RenderTexture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTexture2D"]},properties:{$ref:"renderTexture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"renderTexture2DAssetProperties",title:"RenderTexture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(42),a=i.__assign({},n.default,{id:"renderTextureCubeAsset",title:"RenderTextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTextureCube"]},properties:{$ref:"renderTextureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"renderTextureCubeAssetProperties",title:"RenderTextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",description:"his value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"sceneObject",title:"SceneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["scene"]},properties:{$ref:"sceneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"sceneObjectProperties",title:"SceneObjectPropertiesDef",properties:i.__assign({},n.default.properties,{fogEnabled:{type:"boolean",default:!1},fogType:{type:"string",default:"FogExp2"},fogColor:{type:["number","string"],default:12303291},fogDensity:{type:"number",default:4e-4}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"scriptAsset",title:"ScriptAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["script"]},properties:{$ref:"scriptAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"scriptAssetProperties",title:"ScriptAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",default:{}},description:{type:"string",default:""},events:{type:"object",default:{}},externalDependencies:{type:"array",default:[]},filter:{type:"array",items:{type:"string"},default:[]},category:{type:"string",default:""},executeIn:{type:"string",enum:["player","editor","all"],default:"player"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"shaderAsset",title:"ShaderAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["shader"]},properties:{$ref:"shaderAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"shaderAssetProperties",title:"ShaderAssetPropertiesDef",properties:i.__assign({},n.default.properties,{parameters:{type:"object",default:{},additionalProperties:{$ref:"shaderParameter.json"}},uniforms:{type:"object",default:{}},vertexShader:{type:"string",default:""},fragmentShader:{type:"string",default:""}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={type:"object",id:"shaderConditions",title:"ShaderConditionsDef",properties:{or:{type:"array",items:{type:"object",properties:{},additionalProperties:!0}},equals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},notEquals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},equalsDefault:{type:"boolean"},notEqualsDefault:{type:"boolean"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={id:"shaderParameter",title:"ShaderParameterDef",properties:{displayName:{type:"string"},description:{type:"string"},isRenderParam:{type:"boolean"},isUniform:{type:"boolean"},uniformName:{type:"string"},type:{type:"string",enum:["b","c","f","t","opt","v2","v3","v4"]},min:{type:"number"},max:{type:"number"},options:{type:"object",properties:{},additionalProperties:!0},displayWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},enabledWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},defines:{properties:{},additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"}]}},derivatives:{type:"boolean"},default:{anyOf:[{type:"null"},{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"},{type:"object",properties:{},additionalProperties:!0}]},transparency:{enum:["LessThanOne","GreaterThanOne","NotFalsy","HasAlpha"]},textureUsage:{enum:["bump","normal"]},forceUpdate:{type:"boolean"},textureType:{enum:["Cube"]},step:{type:"number"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"skinAsset",title:"SkinAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["skin"]},properties:{$ref:"skinAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"skinAssetProperties",title:"SkinAssetPropertiesDef",properties:i.__assign({},n.default.properties,{bindShapeMatrix:{type:"array",description:"Bind shape matrix specifying how the mesh should be transformed into the right coordinate system for use with the joints.",items:{type:"number"},minItems:16,maxItems:16,default:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},inverseBindMatrices:{type:["string","null"],description:"The ID of the accessor containing the inverse bind matrices: #."},jointNames:{type:"array",description:"Names of the joints in this skin.",items:{type:"string"},uniqueItems:!0,default:[]}}),required:["bindShapeMatrix","inverseBindMatrices","jointNames"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"texture2DAsset",title:"Texture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["texture2D"]},properties:{$ref:"texture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(21),a=i.__assign({},n.default,{id:"texture2DAssetProperties",title:"Texture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"textureCubeAsset",title:"TextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["textureCube"]},properties:{$ref:"textureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(21),a=i.__assign({},n.default,{id:"textureCubeAssetProperties",title:"TextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector2",title:"Vector2Def",type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector3",title:"Vector3Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector4",title:"Vector4Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},required:["x","y","z","w"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"videoAsset",title:"VideoAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["video"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"videoRepresentation.json"}}),properties:{$ref:"videoAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(41),a=r(21),o=i.__assign({},n.default,a.default,{id:"videoAssetProperties",title:"VideoAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{autoPlay:{type:"boolean",default:!0},muted:{type:"boolean",default:!0},state:{type:"string",default:"play"},loop:{type:"boolean",default:!0},querySelector:{type:"string"}})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"videoRepresentation",title:"VideoRepresentationDef",properties:i.__assign({},n.default.properties,{video:{type:"object",properties:{height:{type:"integer"},width:{type:"integer"}}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e;try{e=window.WebGLRenderingContext?document.createElement("canvas").getContext("experimental-webgl"):void 0}catch(e){}var t=!!e,r=!!t&&!!e.getExtension("OES_texture_float"),i=!!t&&!(0===e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS));return e=void 0,{isWebGLEnabled:function(){return t},isFloatingPointTexturesEnabeled:function(){return r},isVertexTexturesEnabeled:function(){return i}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return"node"===e.type||"camera"===e.type||"scene"===e.type||"light"===e.type||"mesh"===e.type||"bone"===e.type},t.isAsset=function(e){return!t.isObject(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var i=r(245);e.exports=function(e,t,r){if(i(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,n){return e.call(t,r,i,n)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,r){var i=r(260)("wks"),n=r(195),a=r(33).Symbol,o="function"==typeof a,s=e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:n)("Symbol."+e))};s.store=i},function(e,t){function r(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=r},function(e,t,r){(function(t){var r,i=t.crypto||t.msCrypto;if(i&&i.getRandomValues){var n=new Uint8Array(16);r=function(){return i.getRandomValues(n),n}}if(!r){var a=new Array(16);r=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}e.exports=r}).call(t,r(74))},function(e,t,r){function i(e){return r(n(e))}function n(e){var t=a[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var a={"./accessor":121,"./accessor.ts":121,"./animationAsset":122,"./animationAsset.ts":122,"./animationAssetProperties":123,"./animationAssetProperties.ts":123,"./animationChannel":124,"./animationChannel.ts":124,"./animationClip":125,"./animationClip.ts":125,"./animationLayer":126,"./animationLayer.ts":126,"./applicationAsset":127,"./applicationAsset.ts":127,"./applicationAssetProperties":128,"./applicationAssetProperties.ts":128,"./audioAsset":129,"./audioAsset.ts":129,"./audioAssetProperties":130,"./audioAssetProperties.ts":130,"./audioRepresentation":131,"./audioRepresentation.ts":131,"./baseAsset":7,"./baseAsset.ts":7,"./baseAssetProperties":8,"./baseAssetProperties.ts":8,"./baseEntity":39,"./baseEntity.ts":39,"./baseEntityProperties":40,"./baseEntityProperties.ts":40,"./baseGeometryAsset":28,"./baseGeometryAsset.ts":28,"./baseGeometryAssetProperties":29,"./baseGeometryAssetProperties.ts":29,"./baseImageAsset":70,"./baseImageAsset.ts":70,"./baseImageAssetProperties":41,"./baseImageAssetProperties.ts":41,"./baseObject":16,"./baseObject.ts":16,"./baseObjectProperties":17,"./baseObjectProperties.ts":17,"./baseRenderTextureAsset":42,"./baseRenderTextureAsset.ts":42,"./baseRenderTextureAssetProperties":43,"./baseRenderTextureAssetProperties.ts":43,"./baseTextureAsset":30,"./baseTextureAsset.ts":30,"./baseTextureAssetProperties":21,"./baseTextureAssetProperties.ts":21,"./boneObject":132,"./boneObject.ts":132,"./boneObjectProperties":133,"./boneObjectProperties.ts":133,"./box3":134,"./box3.ts":134,"./bufferAsset":135,"./bufferAsset.ts":135,"./bufferAssetProperties":136,"./bufferAssetProperties.ts":136,"./cameraObject":137,"./cameraObject.ts":137,"./cameraObjectProperties":138,"./cameraObjectProperties.ts":138,"./colorRgb":139,"./colorRgb.ts":139,"./commonImageProperties":44,"./commonImageProperties.ts":44,"./component":140,"./component.ts":140,"./componentAttribute":141,"./componentAttribute.ts":141,"./documentAsset":142,"./documentAsset.ts":142,"./documentAssetProperties":143,"./documentAssetProperties.ts":143,"./dracoAttribute":144,"./dracoAttribute.ts":144,"./dracoGeometryAsset":145,"./dracoGeometryAsset.ts":145,"./dracoGeometryAssetProperties":146,"./dracoGeometryAssetProperties.ts":146,"./imageAsset":147,"./imageAsset.ts":147,"./imageAssetProperties":148,"./imageAssetProperties.ts":148,"./imageRepresentation":149,"./imageRepresentation.ts":149,"./index":4,"./index.ts":4,"./lightObject":150,"./lightObject.ts":150,"./lightObjectProperties":151,"./lightObjectProperties.ts":151,"./materialAsset":152,"./materialAsset.ts":152,"./materialAssetProperties":153,"./materialAssetProperties.ts":153,"./meshAttribute":154,"./meshAttribute.ts":154,"./meshGeometryAsset":155,"./meshGeometryAsset.ts":155,"./meshGeometryAssetProperties":156,"./meshGeometryAssetProperties.ts":156,"./meshObject":157,"./meshObject.ts":157,"./meshObjectProperties":158,"./meshObjectProperties.ts":158,"./meshPrimitive":159,"./meshPrimitive.ts":159,"./nodeObject":160,"./nodeObject.ts":160,"./nodeObjectProperties":161,"./nodeObjectProperties.ts":161,"./prefabAsset":162,"./prefabAsset.ts":162,"./prefabAssetProperties":163,"./prefabAssetProperties.ts":163,"./primitiveGeometryAsset":164,"./primitiveGeometryAsset.ts":164,"./primitiveGeometryAssetProperties":165,"./primitiveGeometryAssetProperties.ts":165,"./renderTexture2DAsset":166,"./renderTexture2DAsset.ts":166,"./renderTexture2DAssetProperties":167,"./renderTexture2DAssetProperties.ts":167,"./renderTextureCubeAsset":168,"./renderTextureCubeAsset.ts":168,"./renderTextureCubeAssetProperties":169,"./renderTextureCubeAssetProperties.ts":169,"./representation":31,"./representation.ts":31,"./sceneObject":170,"./sceneObject.ts":170,"./sceneObjectProperties":171,"./sceneObjectProperties.ts":171,"./scriptAsset":172,"./scriptAsset.ts":172,"./scriptAssetProperties":173,"./scriptAssetProperties.ts":173,"./shaderAsset":174,"./shaderAsset.ts":174,"./shaderAssetProperties":175,"./shaderAssetProperties.ts":175,"./shaderConditions":176,"./shaderConditions.ts":176,"./shaderParameter":177,"./shaderParameter.ts":177,"./skinAsset":178,"./skinAsset.ts":178,"./skinAssetProperties":179,"./skinAssetProperties.ts":179,"./texture2DAsset":180,"./texture2DAsset.ts":180,"./texture2DAssetProperties":181,"./texture2DAssetProperties.ts":181,"./textureCubeAsset":182,"./textureCubeAsset.ts":182,"./textureCubeAssetProperties":183,"./textureCubeAssetProperties.ts":183,"./vector2":184,"./vector2.ts":184,"./vector3":185,"./vector3.ts":185,"./vector4":186,"./vector4.ts":186,"./videoAsset":187,"./videoAsset.ts":187,"./videoAssetProperties":188,"./videoAssetProperties.ts":188,"./videoRepresentation":189,"./videoRepresentation.ts":189};i.keys=function(){return Object.keys(a)},i.resolve=n,e.exports=i,i.id=199},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n="0.0.0-semantic-release";t.version=n;var a=r(1);t.THREE=a;var o=r(231);t.Components=o;var s=r(117);t.Constants=s;var u=r(4);t.Schemas=u.default;var p=r(118);t.Engine=p.default;var c=r(76);t.ScriptRegistry=c.default;var l=r(9);t.BaseEntity=l.default;var d=r(48);t.AnimationAsset=d.default;var h=r(34);t.ApplicationAsset=h.default;var f=r(49);t.AudioAsset=f.default;var m=r(6);t.BaseAsset=m.default;var y=r(23);t.BaseGeometryAsset=y.default;var g=r(12);t.BaseImageAsset=g.default;var v=r(50);t.BaseRenderTextureAsset=v.default;var b=r(19);t.BaseTextureAsset=b.default;var P=r(20);t.BufferAsset=P.default;var x=r(75);t.DocumentAsset=x.default;var E=r(51);t.DracoGeometryAsset=E.default;var w=r(52);t.ImageAsset=w.default;var _=r(14);t.MaterialAsset=_.default;var S=r(53);t.MeshGeometryAsset=S.default;var D=r(54);t.PrefabAsset=D.default;var A=r(55);t.PrimitiveGeometryAsset=A.default;var T=r(56);t.RenderTexture2DAsset=T.default;var M=r(57);t.RenderTextureCubeAsset=M.default;var R=r(58);t.ScriptAsset=R.default;var C=r(35);t.ShaderAsset=C.default;var O=r(59);t.SkinAsset=O.default;var I=r(60);t.Texture2DAsset=I.default;var j=r(61);t.TextureCubeAsset=j.default;var k=r(24);t.VideoAsset=k.default;var L=r(10);t.BaseObject=L.default;var B=r(68);t.NodeObject=B.default;var N=r(66);t.BoneObject=N.default;var V=r(67);t.CameraObject=V.default;var U=r(37);t.LightObject=U.default;var z=r(25);t.MeshObject=z.default;var F=r(38);t.SceneObject=F.default;var G=r(15);t.LoadingType=G.default;var q=r(11);t.LoadingEvent=q.default;var H=r(69);t.LoadingState=H.default;var $=r(2);t.BaseComponent=$.default;var W=r(63);t.Handedness=W.Handedness;var X=r(64);t.RenderMode=X.RenderMode;var Q=r(3);t.log=Q.default;var Z=r(228);t.XhrResourceLoader=Z.default,i.__exportStar(r(22),t);var Y=r(46);t.globalEvents=Y.default;var K=r(190);t.browserCaps=K.default},function(e,t,r){r(265),e.exports=r(32).Array.find},function(e,t,r){r(266),e.exports=r(32).Math.log10},function(e,t,r){r(267),e.exports=r(32).Math.log2},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(){var e=this;this.defaultGeometry=new i.BufferGeometry,this.defaultGeometry.setIndex(new i.BufferAttribute(new Uint16Array(0),1));var t={position:new i.BufferAttribute(new Float32Array(0),3),normal:new i.BufferAttribute(new Float32Array(0),3,!0),skinWeight:new i.BufferAttribute(new Float32Array(0),4,!0),skinIndex:new i.BufferAttribute(new Uint16Array(0),4,!0)};Object.keys(t).forEach(function(r){var i=t[r];e.defaultGeometry.addAttribute(r,i)})}return e.prototype.destroy=function(){this.defaultGeometry&&(this.defaultGeometry.dispose(),this.defaultGeometry=void 0)},e.prototype.getDefaultGeometry=function(){return this.defaultGeometry},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(5),a=function(){function e(){this.components=[]}return e.prototype.initializeComponents=function(){this.listenTo(this.engine,"scriptDeleted",this.onScriptDeleted),this.listenTo(this,"change:component",this.onComponentChanged),this.listenTo(this,"remove:component",this.onComponentRemoved),this.listenTo(this,"add:component",this.onComponentAdded)},e.prototype.getComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.components;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getPreviousComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.previousComponents;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getComponentDescriptors=function(e){var t="function"!=typeof e,r=this.sharedData.components;return r.filter(function(r){return t||e(r)}).map(function(e){return n.deepClone(e)})},e.prototype.getComponentDescriptorById=function(e){return this.getComponentDescriptor(function(t){return t.id===e})},e.prototype.getPreviousComponentDescriptorById=function(e){return this.getPreviousComponentDescriptor(function(t){return t.id===e})},e.prototype.addComponent=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r="");var i={scriptId:"string"==typeof e?e:e.id,attributes:t,enabled:!0,name:r},n=this.engine.entityDispatcher;return n.dispatchComponentAdded(this.id,i),this.components[this.components.length-1]},e.prototype.removeComponent=function(e){var t=e.getIndex();return t>=0&&(this.engine.entityDispatcher.dispatchComponentRemoved(this.id,t),!0)},e.prototype.getComponentByIndex=function(e){return this.components[e]||null},e.prototype.getComponentByName=function(e){return this.getComponent(function(t){return t.getName()===e})},e.prototype.getComponentsByName=function(e){return this.getComponents(function(t){return t.getName()===e})},e.prototype.getComponentByScriptId=function(e){return this.getComponent(function(t){return t.getScriptId()===e})},e.prototype.getComponentsByScriptId=function(e){return this.getComponents(function(t){return t.getScriptId()===e})},e.prototype.getComponentByScriptName=function(e){return this.getComponent(function(t){return t.getScriptName()===e})},e.prototype.getComponentsByScriptName=function(e){return this.getComponents(function(t){return t.getScriptName()===e})},e.prototype.getComponent=function(e){var t="function"!=typeof e;return this.components.find(function(r){return t||e(r)})},e.prototype.getComponentById=function(e){return this.getComponent(function(t){return t.getId()===e})},e.prototype.getComponents=function(e){var t="function"!=typeof e;return this.components.filter(function(r){return t||e(r)})},e.prototype.setComponents=function(e,t){var r=this;void 0===t&&(t=!1);for(var i=this.engine.entityDispatcher,n=this.sharedData.components.length;n>=0;n--)i.dispatchComponentRemoved(this.id,n);e.forEach(function(e){i.dispatchComponentAdded(r.id,e)})},e.prototype.startComponents=function(){var e=this;this.components.forEach(function(t){return e.startComponent(t)})},e.prototype.stopComponents=function(){var e=this;this.components.forEach(function(t){return e.stopComponent(t)})},e.prototype.onScriptDeleted=function(e){var t=this,r=this.getComponentsByScriptId(e);r.forEach(function(e){t.removeComponent(e)})},e.prototype.onComponentChanged=function(e,t){var r=this.getComponentByIndex(e);if(!r)throw new Error("Don't have a component at index "+e);if(t.attributes){this.assignAttributeValues(r,t.attributes);var i=Object.keys(t.attributes);r.trigger("attributesChanged",i)}t.name&&(r.name=t.name)},e.prototype.onComponentAdded=function(e){var t=this.createComponentObject(e);t.trigger("awake"),this.assignAttributeValues(t);var r=t.getScriptAsset(),i=Object.keys(r.getProperty("attributes"));t.trigger("attributesChanged",i),this.isBaseUnloaded()||this.startComponent(t)},e.prototype.onComponentRemoved=function(e){var t=this.components[e];if(!t)throw new Error("Can't find component at index "+e+" to remove.");this.stopComponent(t),this.components.splice(e,1)},e.prototype.translateAttributeValue=function(e,t,r,n){var a=this,o=this.engine;if(!r)throw new Error("Attribute "+t+" does not exist for this component.");switch(r.type){case"asset":e[t]=o.getAssetById(n);break;case"object":e[t]=o.getObjectById(n);break;case"custom":e[t]=e[t]||{},Object.keys(n).forEach(function(i){a.translateAttributeValue(e[t],i,r.attributes[i],n[i])});break;case"c":e[t]=e[t]||new i.Color,e[t].setRGB(n.r,n.g,n.b);break;case"a":e[t]=e[t]||[];var s;switch(r.subType.type){case"asset":n.forEach(function(r,i){e[t][i]=o.getAssetById(r)});break;case"object":n.forEach(function(r,i){e[t][i]=o.getObjectById(r)});break;case"custom":n.forEach(function(i,o){e[t][o]=e[t][o]||{},Object.keys(i).forEach(function(i){a.translateAttributeValue(e[t][o],i,r.subType.attributes[i],n[o][i])})});break;case"a":n.forEach(function(i,o){e[t][o]=e[t][o]||[],i.forEach(function(i,s){a.translateAttributeValue(e[t][o],s.toString(10),r.subType.subType,n[o][s])})});break;case"v2":s=i.Vector2;case"v3":s=s?s:i.Vector3;case"v4":s=s?s:i.Vector4;case"q":s=s?s:i.Quaternion,n.forEach(function(r,i){e[t][i]=e[t][i]||new s,e[t][i].copy(r)});break;default:n.forEach(function(r,i){e[t][i]=r})}break;case"v2":s=i.Vector2;case"v3":s=s?s:i.Vector3;case"v4":s=s?s:i.Vector4;case"q":s=s?s:i.Quaternion,e[t]=e[t]||new s,e[t].copy(n);break;default:e[t]=n}},e.prototype.assignAttributeValues=function(e,t){var r=this,i="object"!=typeof t,n=e.getScriptAsset(),a=n.getProperty("attributes")||{};Object.keys(a).forEach(function(n){if(i||t.hasOwnProperty(n)){var o=a[n],s=e.getAttribute(o.name);r.translateAttributeValue(e,o.name,o,s)}})},e.prototype.createComponentObject=function(e){var t=e.scriptId,r=this.engine.getAssetById(t);if(!r)throw new Error("Unable to find script asset for "+t);r.isUnloaded()&&r.load();var i=new r.sharedData.classConstructor;return this.components.push(i),Object.assign(i,{id:e.id,name:e.name,scriptName:r.getName(),scriptId:t,enabled:!!e.enabled,entity:this}),i.bindSelfEvents(),i},e.prototype.startComponent=function(e){e.trigger("startup")},e.prototype.stopComponent=function(e){e.trigger("shutdown")},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(3),a=function(){function e(){this.ownDependencies={},this.dependencies={}}return e.prototype.getOwnDependencies=function(){var e=this;return Object.keys(this.ownDependencies).map(function(t){return e.engine.getEntityById(t)}).filter(function(e){return e})},e.prototype.getOwnDependencyInfo=function(){return this.ownDependencies},e.prototype.getDependencies=function(e){var t=this,r="function"!=typeof e;return Object.keys(this.dependencies).map(function(e){return t.engine.getEntityById(e)}).filter(function(t){return r||e(t)})},e.prototype.getDependenciesByClass=function(e){return this.getDependencies(function(t){return t instanceof e})},e.prototype.getDependenciesByType=function(e){return this.getDependencies(function(t){return t.type===e})},e.prototype.getDependencyInfo=function(){return this.dependencies},e.prototype.registerDependencyById=function(e){this.registerDependency(this.engine.getEntityById(e))},e.prototype.registerDependency=function(e){var t=this;if(!e)return void n.default.warn("Trying to register invalid entity as a dependency.");var r=this.getOwnDependencyInfo(),a=e.id;r[a]?r[a].count++:(r[a]={count:1},r[a].onSubDependencyChange=function(e,i){if(r[a])for(var n=0;n=r.components.length-1)){var i=Math.min(Math.max(t,0),r.components.length-1);i<0||(r.previousComponents=r.components?r.components.slice():[],r.components.splice(i,1),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){var r=t.getEntityById(e);r.trigger("remove:component",i)}))}},e.prototype.dispatchComponentAdded=function(e,t){var r=this.entities[e];if(r){r.previousComponents=r.components?r.components.slice():[];var i=a.deepClone(t);i.id=i.id||n.v4(),i.name=i.name||"unnamed component",i.attributes=i.attributes||{},i.enabled=i.enabled!==!1,r.components.push(i),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){var r=t.getEntityById(e);r.trigger("add:component",i)})}},e.prototype.fireExternalUpdate=function(e,t,r){var i=new u.default;i.type=r?r:"updateEntity",i.entityId=e,i.entityData=t,o.default.trigger("EntityUpdates",i)},e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(48),n=r(34),a=r(49),o=r(6),s=r(66),u=r(20),p=r(67),c=r(75),l=r(51),d=r(52),h=r(37),f=r(14),m=r(25),y=r(53),g=r(68),v=r(54),b=r(55),P=r(56),x=r(57),E=r(38),w=r(58),_=r(35),S=r(59),D=r(60),A=r(61),T=r(24),M=function(){function e(){this.objects={},this.assets={}}return e.prototype.destroy=function(){var e=this;this.getAssets().forEach(function(t){return e.unregisterEntity(t)}),this.getObjects().forEach(function(t){return e.unregisterEntity(t)})},e.prototype.getAsset=function(e){return this.getEntity(e,this.assets)},e.prototype.getAssets=function(e){return this.getEntities(e,this.assets)},e.prototype.getAssetById=function(e){return this.assets[e]||null},e.prototype.getAssetByName=function(e){return this.getAsset(function(t){return t.getName()===e})},e.prototype.getAssetsByName=function(e){return this.getAssets(function(t){return t.getName()===e})},e.prototype.getAssetByClass=function(e){return this.getAsset(function(t){return t instanceof e})},e.prototype.getAssetByType=function(e){return this.getAsset(function(t){return t.type===e})},e.prototype.getAssetsByClass=function(e){return this.getAssets(function(t){return t instanceof e})},e.prototype.getAssetsByType=function(e){return this.getAssets(function(t){return t.type===e})},e.prototype.getObject=function(e){return this.getEntity(e,this.objects)},e.prototype.getObjects=function(e){return this.getEntities(e,this.objects)},e.prototype.getObjectById=function(e){return this.objects[e]||null},e.prototype.getObjectByName=function(e){return this.getObject(function(t){return t.getName()===e})},e.prototype.getObjectsByName=function(e){return this.getObjects(function(t){return t.getName()===e})},e.prototype.getObjectByClass=function(e){return this.getObject(function(t){return t instanceof e})},e.prototype.getObjectByType=function(e){return this.getObject(function(t){return t.type===e})},e.prototype.getObjectsByType=function(e){return this.getObjects(function(t){return t.type===e})},e.prototype.getObjectsByClass=function(e){return this.getObjects(function(t){return t instanceof e})},e.prototype.getEntity=function(e,t){if(!t)return this.getAsset(e)||this.getObject(e);var r=Object.keys(t).find(function(r){return e(t[r])});return t[r]},e.prototype.getEntities=function(e,t){if(!t)return this.getObjects(e).concat(this.getAssets(e));var r="function"!=typeof e;return Object.keys(t).filter(function(i){return r||e(t[i])}).map(function(e){return t[e]})},e.prototype.getEntityById=function(e){return this.assets[e]||this.objects[e]||null},e.prototype.getEntityByClass=function(e){return this.getEntity(function(t){return t instanceof e})},e.prototype.getEntityByType=function(e){return this.getEntity(function(t){return t.type===e})},e.prototype.getEntitiesByClass=function(e){return this.getEntities(function(t){return t instanceof e})},e.prototype.getEntitiesByType=function(e){return this.getEntities(function(t){return t.type===e})},e.prototype.getEntityByName=function(e){return this.getEntity(function(t){return t.getName()===e})},e.prototype.getEntitiesByName=function(e){return this.getEntities(function(t){return t.getName()===e})},e.prototype.unregisterEntityById=function(e){this.unregisterEntity(this.getEntityById(e))},e.prototype.unregisterEntity=function(e){e&&(e.uninitialize(),this.objects[e.id]?delete this.objects[e.id]:(e.off("load",this.onAssetLoaded,this),e.off("unload",this.onAssetUnloaded,this),delete this.assets[e.id]))},e.prototype.getClassType=function(e){switch(e){case i.default:return"animation";case n.default:return"application";case a.default:return"audio";case s.default:return"bone";case u.default:return"buffer";case p.default:return"camera";case c.default:return"document";case l.default:return"dracoGeometry";case d.default:return"image";case h.default:return"light";case f.default:return"material";case m.default:return"mesh";case y.default:return"meshGeometry";case g.default:return"node";case v.default:return"prefab";case b.default:return"primitiveGeometry";case P.default:return"renderTexture2D";case x.default:return"renderTextureCube";case E.default:return"scene";case w.default:return"script";case _.default:return"shader";case S.default:return"skin";case D.default:return"texture2D";case A.default:return"textureCube";case T.default:return"video";default:return null}},e.prototype.getEntityClass=function(t){return e.entityNameTypeMap[t]?e.entityNameTypeMap[t]:null},e.prototype.registerEntity=function(e){var t=new(this.getEntityClass(e.type))(e);t.engine=this,t instanceof o.default?(this.assets[t.id]=t,t.on("load",this.onAssetLoaded,this),t.on("unload",this.onAssetUnloaded,this)):this.objects[t.id]=t},e.prototype.onAssetLoaded=function(e){this.trigger("assetLoaded",e)},e.prototype.onAssetUnloaded=function(e){this.trigger("assetUnloaded",e)},e.entityNameTypeMap={animation:i.default,application:n.default,audio:a.default,bone:s.default,buffer:u.default,camera:p.default,document:c.default,dracoGeometry:l.default,image:d.default,light:h.default,material:f.default,mesh:m.default,meshGeometry:y.default,node:g.default,prefab:v.default,primitiveGeometry:b.default,renderTexture2D:P.default,renderTextureCube:x.default,scene:E.default,script:w.default,shader:_.default,skin:S.default,texture2D:D.default,textureCube:A.default,video:T.default},e}();t.default=M},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.type="updateEntity",this.entityId="",this.entityData={}}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(213),a=r(238),o=r(237),s={id:"box3d_pbr_shader",type:"shader",properties:{name:"PBR Shader",vertexShader:a,fragmentShader:o,parameters:n.default,uniforms:i.UniformsUtils.merge([i.UniformsLib.common,i.UniformsLib.emissivemap,i.UniformsLib.bumpmap,i.UniformsLib.normalmap,i.UniformsLib.roughnessmap,i.UniformsLib.metalnessmap,i.UniformsLib.displacementmap,i.UniformsLib.fog,i.UniformsLib.lights,{time:{value:1},emissive:{value:new i.Color(0)},specular:{value:new i.Color(1118481)},roughness:{value:0},metalness:{value:0},clearCoat:{value:0},clearCoatRoughness:{value:0},envMapIntensity:{value:1}}])}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={albedoColor:{displayName:"Base Albedo",description:"A color to tint the material with.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isUniform:!0,uniformName:"diffuse"},albedoMap:{displayName:"Albedo Map",description:"A texture that modifies the diffuse color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,uniformName:"map",enabledWhen:{albedoMap:{notEqualsDefault:!0}}},opacity:{displayName:"Opacity",description:"This option controls the total opacity of the material.",type:"f",default:1,min:0,max:1,isUniform:!0,isRenderParam:!0,transparency:"LessThanOne"},alphaMap:{displayName:"Alpha Map",description:"A texture that stores the transparency info of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,transparency:"NotFalsy",enabledWhen:{alphaMap:{notEqualsDefault:!0}}},specularColor:{displayName:"Specular Color",description:"A color to tint the material with.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isUniform:!0,uniformName:"specular"},specularMap:{displayName:"Specular Map",description:"A texture that contains the specular color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{specularMap:{notEqualsDefault:!0}}},metalness:{displayName:"Metalness",description:"How metallic the surface appears (multiplied by the metalness texture).",type:"f",min:0,max:1,default:0,isUniform:!0,enabledWhen:{metalness:{notEqualsDefault:!0}}},metalnessMap:{displayName:"Metalness Map",description:"A texture that contains the metalness of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{metalnessMap:{notEqualsDefault:!0}}},glossMap:{displayName:"Gloss Map",description:"A texture that stores the gloss info of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{glossMap:{notEqualsDefault:!0},roughnessMap:{equalsDefault:!0}}},roughness:{displayName:"Roughness",description:"How rough the surface appears.",type:"f",min:0,max:1,default:0,isUniform:!0,isRenderParam:!0},roughnessMap:{displayName:"Roughness Map",description:"A texture that stores the roughness info of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{roughnessMap:{notEqualsDefault:!0}}},reflectivity:{displayName:"Reflectivity",description:"Reflectivity at normal incidence. i.e. when viewing the surface directly.",type:"f",min:0,max:1,default:.02,isUniform:!0,isRenderParam:!0,uniformName:"reflectivity"},normalMap:{displayName:"Normal Map",description:"",type:"t",default:null,isUniform:!0,isRenderParam:!0,derivatives:!0,textureUsage:"normal",enabledWhen:{normalMap:{notEqualsDefault:!0}}},normalScale:{displayName:"Normal Scale",description:"blah",type:"v2",default:{x:1,y:1},isUniform:!0,isRenderParam:!0},bumpMap:{displayName:"Bump Map",description:"",type:"t",default:null,isUniform:!0,isRenderParam:!0,derivatives:!0,textureUsage:"bump",enabledWhen:{normalMap:{equalsDefault:!0},bumpMap:{notEqualsDefault:!0}}},bumpScale:{displayName:"Bump Scale",description:"blah",type:"f",min:0,max:20,default:1,isUniform:!0,isRenderParam:!0,enabledWhen:{normalMap:{equalsDefault:!0},bumpMap:{notEqualsDefault:!0}},displayWhen:{useBump:{equals:!0}}},clearCoat:{displayName:"Clear Coat",type:"f",min:0,max:1,isUniform:!0,isRenderParam:!0,default:0,enabledWhen:{clearCoat:{notEquals:0}}},clearCoatRoughness:{displayName:"Clear Coat Roughness",type:"f",min:0,max:1,isUniform:!0,isRenderParam:!0,default:0,enabledWhen:{clearCoat:{notEquals:0}}},envMapRadiance:{displayName:"Radiance Light Map",description:"A map that represents the surrounding environment. Used for reflections.",type:"t",default:null,isUniform:!0,forceUpdate:!0,enabledWhen:{envMapRadiance:{notEqualsDefault:!0}}},envMapRadianceHalfGloss:{displayName:"Half Radiance Light Map",description:"A cube-map that represents the surrounding environment. Used for reflections.",type:"t",textureType:"Cube",default:null,isUniform:!0,enabledWhen:{envMapIrradiance:{notEqualsDefault:!0},envMapRadiance:{notEqualsDefault:!0},envMapRadianceHalfGloss:{notEqualsDefault:!0}}},envMapIrradiance:{displayName:"Irradiance Light Map",description:"A cube-map that represents the surrounding environment. Used for reflections.",type:"t",textureType:"Cube",default:null,isUniform:!0,enabledWhen:{envMapIrradiance:{notEqualsDefault:!0}},displayWhen:{envMapIrradiance:{notEqualsDefault:!0}}},envMapGlossVariance:{displayName:"Environment Map Gloss Variance",description:"Turn on multi-sampling of environment map based on varying glossiness of surface.",type:"b",default:!0,forceUpdate:!0,enabledWhen:{envMapGlossVariance:{equals:!0}}},emissiveColor:{displayName:"Emissive Color",description:"A color that represents the light emitted by the material.",type:"c",default:{r:0,g:0,b:0},isUniform:!0,isRenderParam:!0,uniformName:"emissive",enabledWhen:{emissiveColor:{notEqualsDefault:!0}}},emissiveMap:{displayName:"Emissive Map",description:"A texture that modifies the emissive color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{emissiveMap:{notEqualsDefault:!0}}},aoMap:{displayName:"AO Map",description:"The ambient occlusion of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{aoMap:{notEqualsDefault:!0}}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(120),a=r(119),o={id:"fbx_surface_lambert_shader",type:"shader",properties:{name:"FBX Surface Lambert Shader",vertexShader:"MeshLambertMaterial",fragmentShader:"MeshLambertMaterial",parameters:i.__assign({},n.default,a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(120),a=r(119),o={id:"fbx_surface_phong_shader",type:"shader",properties:{name:"FBX Surface Phong Shader",vertexShader:"MeshPhongMaterial",fragmentShader:"MeshPhongMaterial",parameters:i.__assign({},n.default,{specular:{displayName:"Specular Color",description:"The color reflected specularly by the surface from lights",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"specular"},specularTexture:{displayName:"Specular Map",description:"The color reflected specularly by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"specularMap",enabledWhen:{specularTexture:{notEqualsDefault:!0}}},shininess:{displayName:"Shininess",description:"The shininess exponent of the surface. Higher is glossier.",type:"f",default:30,min:0,max:512,isRenderParam:!0,uniformName:"shininess"},reflectionFactor:{displayName:"Reflectivity",description:"A value to scale the reflectivity by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"reflectivity"},reflectionTexture:{displayName:"Reflection Texture",description:"A texture that represents the environment around the surface.",type:"t",default:null,isRenderParam:!0,uniformName:"envMap",enabledWhen:{reflectionTexture:{notEqualsDefault:!0}}}},a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),n=r(19),a=function(){function e(e){this.engine=e,this.standInTextures=[],this.engine=e,this.engine.on("rebuildMaterials",this.rebuildAll,this),this.engine.on("rendererResize",this.onResize,this),this.engine.on("update",this.update,this),this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE]={texture:null,color:[255,255,255]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE_CUBE]={texture:null,color:[255,255,255],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK]={texture:null,color:[0,0,0]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK_CUBE]={texture:null,color:[0,0,0],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_NORMAL]={texture:null,color:[127,127,255]}}return e.prototype.destroy=function(){this.engine.off("rebuildMaterials",this.rebuildAll,this),this.engine.off("rendererResize",this.onResize,this),this.engine.off("update",this.update,this),this.standInTextures.forEach(function(e){e.texture&&e.texture.dispose()})},e.prototype.getMissingMaterial=function(){return this.engine.getAssetById("missingMaterial")},e.prototype.getStandInTexture=function(e){if(!this.standInTextures[e])return null;if(!this.standInTextures[e].texture){var t=this.standInTextures[e].color;"Cube"===this.standInTextures[e].type?this.standInTextures[e].texture=n.default.createColorTextureCube(t[0],t[1],t[2]):this.standInTextures[e].texture=n.default.createColorTexture(t[0],t[1],t[2])}return this.standInTextures[e].texture},e.prototype.update=function(e){i.default.timeValueInUse&&(this.engine.needsRender=!0),i.default.sharedUniforms.time.value=e},e.prototype.rebuildAll=function(){var e=this.engine.getAssetsByClass(i.default);e.forEach(function(e){e.runtimeData&&Object.keys(i.default.materialObjectTypes).forEach(function(t){e.runtimeData[t].needsUpdate=!0})})},e.prototype.onResize=function(){var e=i.default.sharedUniforms.screenDimensions;e.value.x=0,e.value.y=0;var t=this.engine.getRenderer();t?(e.value.z=t.getCanvasWidth(),e.value.w=t.getCanvasHeight()):(e.value.z=128,e.value.w=128)},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t="tDiffuse"),this.enabled=!0,this.needsSwap=!0,this.renderToScreen=!1,this.clear=!1,this.textureId=t,this.uniforms=i.UniformsUtils.clone(e.uniforms),this.material=new i.ShaderMaterial({blending:i.NormalBlending,transparent:!0,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.camera=new i.OrthographicCamera(-1,1,1,-1,0,1), -this.scene=new i.Scene,this.quad=new i.Mesh(new i.PlaneGeometry(2,2),null),this.scene.add(this.quad),this.prevViewPort=new i.Vector4}return e.prototype.render=function(e,t,r){this.uniforms[this.textureId]&&(this.uniforms[this.textureId].value=r),this.quad.material=this.material,this.renderToScreen?(this.viewPort&&e.setViewport(this.viewPort.x,this.viewPort.y,this.viewPort.width,this.viewPort.height),(this.clearColor||this.clearDepth)&&e.clear(!!this.clearColor,!!this.clearDepth,!1),e.render(this.scene,this.camera)):this.renderToTexture?((this.clearColor||this.clearDepth)&&e.clear(this.clearColor,this.clearDepth,!1),e.render(this.scene,this.camera,this.renderToTexture)):e.render(this.scene,this.camera,t,this.clear)},e.prototype.dispose=function(){this.quad.geometry.dispose(),this.quad=void 0,this.camera=void 0,this.scene=void 0,this.material.dispose(),this.material=void 0,this.uniforms=void 0},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{type:"t",value:null},rgbmMultiplier:{type:"f",value:9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","#ifdef FLIP_Y","vUv.y = 1.0 - vUv.y;","#endif","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float rgbmMultiplier;","const mat3 InverseLogLuvMatrix = mat3(","6.0014, -2.7008, -1.7996,","-1.3320, 3.1029, -5.7721,","0.3008, -1.0882, 5.6268);","vec3 HDRDecodeLOGLUV(in vec4 vLogLuv)","{","float Le = vLogLuv.z * 255.0 + vLogLuv.w;","vec3 Xp_Y_XYZp;","Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);","Xp_Y_XYZp.z = Xp_Y_XYZp.y / vLogLuv.y;","Xp_Y_XYZp.x = vLogLuv.x * Xp_Y_XYZp.z;","vec3 vRGB = InverseLogLuvMatrix * Xp_Y_XYZp;","return vRGB;","}","vec3 HDRDecodeRGBM( vec4 rgbm ) {","return rgbmMultiplier * rgbm.rgb * rgbm.a;","}","vec3 HDRDecodeRGBD( vec4 rgbd ) {","return rgbd.rgb / max(rgbd.a, 0.003);","}","vec3 HDRDecodeRGBE( vec4 rgbe ) {","float f = exp2( rgbe.w * 255.0 - (128.0 + 0.0) );","return rgbe.rgb * f;","}","varying vec2 vUv;","void main() {","vec3 hdrColour;","#ifdef HDR_RGBM","hdrColour = HDRDecodeRGBM( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBD)","hdrColour = HDRDecodeRGBD( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBE)","hdrColour = HDRDecodeRGBE( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_LOGLUV)","hdrColour = HDRDecodeLOGLUV( texture2D( tDiffuse, vUv ) );","#else","hdrColour = texture2D( tDiffuse, vUv ).xyz;","#endif","gl_FragColor = vec4( hdrColour, 1.0 );","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(27),a=r(69),o=r(11),s=r(227),u=r(45);t.loadableResourceMixins=u.default({},[n.default]);var p=function(e){function t(t,r,i){void 0===i&&(i={});var n=e.call(this)||this;if(n.path=t,n.type=r,n.params=i,n.state=a.default.STARTING,n.error=void 0,n.data=void 0,n.loaderData={},!t)throw new Error("Missing required `path` argument");if(!r)throw new Error("Missing required `type` argument");return n}return i.__extends(t,e),t.prototype.setState=function(e){switch(e){case a.default.STARTING:throw new s.default(this.state,e);case a.default.LOADING:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.PROCESSING:if(this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.COMPLETE:if(this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.CANCELLED:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING&&this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.ERROR:break;default:throw new Error("Unknown state: "+e)}return this.state=e,this.trigger(o.default.STATE_CHANGE,e),e},t.prototype.setLoading=function(){this.setState(a.default.LOADING)},t.prototype.setProcessing=function(){this.setState(a.default.PROCESSING)},t.prototype.setComplete=function(e){this.setState(a.default.COMPLETE),this.data=e,this.trigger(o.default.LOAD,e),this.done()},t.prototype.setError=function(e){this.setState(a.default.ERROR),this.error=e,this.trigger(o.default.ERROR,e),this.done()},t.prototype.setCancelled=function(){this.setState(a.default.CANCELLED),this.trigger(o.default.CANCEL),this.done()},t.prototype.isCancelled=function(){return this.state===a.default.CANCELLED},t.prototype.done=function(){this.trigger(o.default.DONE,this.state),this.off()},t}(t.loadableResourceMixins);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return e.setProcessing(),e.setComplete(e.loaderData.xhr.response),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("arraybuffer")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(240),n=r(191),a=r(26),o=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response,r=e.path.indexOf("?"),a=r>=0?r:e.path.length,o=e.path.slice(0,e.path.lastIndexOf("/",a)+1);if(void 0===t||void 0===t.version||t.version.major>4)return Promise.reject(new Error("Unsupported data version"));var s=new RegExp(/^(?:[a-z]+:)?\/\//i),u=new RegExp(/^\//),p=function(e){return!e.match(s)&&!e.match(u)},c=i.mapEntities(t.entities,t.version);return c.forEach(function(e){if(n.isAsset(e)&&e.representations&&e.representations.forEach(function(e){e.src&&p(e.src)&&(e.src=o+e.src)}),"buffer"===e.type){var t=e.properties;t.src&&p(t.src)&&(t.src=o+t.src)}}),e.setComplete(c),Promise.resolve(e)};t.default=function(e,t){return a.retry(function(e){return 202===e.loaderData.xhr.status},[a.unlessCancelled(a.makeXhr(t)),a.unlessCancelled(a.setResponseType("json")),a.unlessCancelled(a.setCustomHeaders),a.unlessCancelled(a.loadXhr)])(e).then(a.unlessCancelled(a.requireStatus(function(e){return 200===e}))).then(a.unlessCancelled(o)).catch(a.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return new Promise(function(t){if(e.setProcessing(),e.loaderData.xhr.response instanceof Blob){var r=URL.createObjectURL(e.loaderData.xhr.response),i=new Image;i.onload=function(){e.setComplete(i),t(e)},i.src=r}else e.setComplete(e.loaderData.xhr.response),t(e)})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response;return e.setComplete(t),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("json")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return new Promise(function(t,r){e.setProcessing();var i=URL.createObjectURL(e.loaderData.xhr.response),n=document.createElement("video");n.addEventListener("loadeddata",function(){e.setComplete(n),t(e)}),n.addEventListener("error",function(){return r(new Error("Failed to load video"))}),n.src=i,n.load()})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=r(11),a=r(9),o=function(){function e(){this.loadingResources=[]}return e.prototype.loadResource=function(e,t,r,o){var s=this;void 0===o&&(o={});var u=this.engine.resourceLoader.load(e,t,o);return this.loadingResources.push(u),u.on(n.default.ERROR,function(e){i.default.error(s.engine.getName()+(" - ResourceLifecycle: Error loading "+s.type+",")+(s.getName()+", "+e.toString())),s.setState(a.StateType.Base,a.State.Failed)}),u.on(n.default.DONE,function(){s.loadingResources=s.loadingResources.filter(function(e){return e!==u}),"function"==typeof r&&r()}),u},e.prototype.abortRequests=function(){this.loadingResources.forEach(function(e){return e.setCancelled()})},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(69),a=function(e){function t(t,r){var i=e.call(this,'Illegal state transition "'+n.default[t]+'" -> "'+n.default[r]+'"')||this;return i.from=t,i.to=r,i}return i.__extends(t,e),t}(Error);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(220),n=r(230),a=r(221),o=r(223),s=r(224),u=r(225),p=r(222),c=r(11),l=r(15),d=4,h=function(e,t){var r=new XMLHttpRequest;return r.open("GET",e),Promise.resolve(r)},f=[];f[l.default.BUFFER]=a.default,f[l.default.IMAGE]=o.default,f[l.default.VIDEO]=u.default,f[l.default.ENTITIES]=p.default,f[l.default.JSON]=s.default;var m=function(){function e(e,t){if(void 0===e&&(e=h),void 0===t&&(t=f),this.xhrPromise=e,this.strategies=t,this.resources={},!e)throw new Error("Must provide argument `xhrPromise`!");if(!t)throw new Error("Must provide argument `strategies`!");this.queue=n.default(d)}return e.prototype.destroy=function(){this.queue.destroy()},e.prototype.load=function(e,t,r){var n=this;if(!this.strategies[t])throw new Error("Unsupported type: "+t);if(this.resources[e])return this.resources[e];var a=this.resources[e]=new i.default(e,t,r);return this.queue.add(function(){return new Promise(function(r){var i=function(){delete n.resources[e],a.off(c.default.LOAD,i),a.off(c.default.ERROR,i),a.off(c.default.CANCEL,i),r(a)};a.once(c.default.LOAD,i),a.once(c.default.ERROR,i),a.once(c.default.CANCEL,i),n.strategies[t](a,n.xhrPromise)})},r.priority),a},e}();t.default=m},function(e,t,r){"use strict";function i(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z])([a-z])/,"$1_$2$3").toUpperCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e?e:"";return t=t.replace(/_([a-z])/gi,function(e,t){return"_"+t.toUpperCase()}),t=t.replace(/\s+/g,"_"),t=t.replace(/([a-z])([0-9])/g,"$1_$2"),t=i(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=4,n=5,a=function(e,t){void 0===e&&(e=i),void 0===t&&(t=n);var r=[],a=[],o=!0,s=function(){for(var t=function(){var e=r.pop();a.push(e),e.fn().then(function(){var t=a.indexOf(e);t>=0&&(a.splice(t,1),s())})};r.length>0&&a.lengththis.pitchAngleBoundsMax?this.targetEuler.x=this.pitchAngleBoundsMax:this.targetEuler.x1&&n.default.warn('Clip "'+e+'" contains multiple layers, but AnimationAsset.prototype.createAnimation() only supports a single layer.');var i=this.getLayer(r.layers[0]),o=i?i.channels.map(function(e){return t.getChannel(e)}):[],s=o.map(function(e){return t.createKeyframeTrack(e,r.start,r.stop)});return new a.AnimationClip(r.name,r.stop-r.start,s)},t.prototype.createKeyframeTrack=function(e,t,r){var i=this,n=e.times.split("#"),o=n[0],u=n[1],p=this.engine.getEntityById(o);if(!p)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+o);var c=p.getAccessor(u),l=p.getArray(u);if(!c||!l)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+u);var d=e.values.split("#"),h=d[0],f=d[1],m=this.engine.getEntityById(h);if(!m)throw new Error(this.engine.getName()+" - AnimationAsset: BufferAsset not found, "+h);var y=m.getAccessor(f),g=m.getArray(f);if(!y||!g)throw new Error(this.engine.getName()+" - AnimationAsset: Accessor not found, "+f);var v,b=e.targetObject.map(function(e){return i.engine.getRuntimeName(e)}),P=b.join("/")+"."+e.targetProperty,x="quaternion"===e.targetProperty?a.QuaternionKeyframeTrack:a.VectorKeyframeTrack,E=-1;for(v=0;v=t){E=v;break}var w=-1;for(v=l.length;v-- >0;)if(l[v]<=r){w=v;break}var _=E>=0?E:0,S=w>=0?w+1:l.length,D=s.default.getTypeSize(y.type),A=l.subarray(_,S),T=g.subarray(_*D,S*D),M=0===t?A:A.slice().map(function(e){return e-t});return new x(P,M,T,null)},t}(o.default);p.addSchemas("AnimationAsset",c),t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(6),a=r(4),o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.uninitialize=function(){this.runtimeData&&this.runtimeData.pause(),e.prototype.uninitialize.call(this)},t.prototype.applyPropertiesLoaded=function(t,r){if(e.prototype.applyPropertiesLoaded.call(this,t,r),this.runtimeData&&(t.hasOwnProperty("loop")&&(this.runtimeData.loop=this.getProperty("loop")),t.hasOwnProperty("state")))switch(this.getProperty("state")){case"pause":this.runtimeData.pause();break;case"play":this.runtimeData.play()}},t}(n.default);a.addSchemas("AudioAsset",o),t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(19),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.createRuntimeData=function(e){this.createRTImageData(),this.trigger("loadProgress",this),e()},t.prototype.getLayout=function(){return this.getProperty("layout")},t.prototype.getWidth=function(){return this.getProperty("width")},t.prototype.getHeight=function(){return this.getProperty("height")},t.prototype.applyPropertiesLoaded=function(t,r){e.prototype.applyPropertiesLoaded.call(this,t,r),(t.hasOwnProperty("format")||t.hasOwnProperty("type")||t.hasOwnProperty("width")||t.hasOwnProperty("height"))&&(this.runtimeData.__webglFramebuffer&&(this.runtimeData.dispose(), +delete this.runtimeData.__webglFramebuffer),this.runtimeData.texture.format=this.getThreeFormat(),this.runtimeData.texture.type=this.getThreeDataType(),this.runtimeData.texture.height=this.getHeight(),this.runtimeData.texture.width=this.getWidth()),this.runtimeData.texture.encoding=this.getThreeEncoding()},t}(n.default);t.default=a},function(e,t,r){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(23),s=r(9),u=r(20),p=r(5),c=r(4),l=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return i.__extends(r,t),r.prototype.getBounds=function(e){var t=this.getProperty("bounds"),r=e||new a.Box3;return r.set(t.min,t.max)},r.prototype.getDataSizeInMemorySelf=function(){return 0},r.prototype.applyPropertiesUnloaded=function(e){t.prototype.applyPropertiesUnloaded.call(this,e),e.accessorId&&this.registerBufferDependency()},r.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){var r=t.getDependencies(),i=r.some(function(e){return e.isLoadFailed()});if(i)t.setState(s.StateType.Base,s.State.Failed);else try{t.decode()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},r.prototype.createBufferAttribute=function(e,t,r,i){var n=r.num_points(),o=i.components_count(),s=n*o,u=new e.DracoFloat32Array;t.GetAttributeFloatForAllPoints(r,i,u);for(var p=new Float32Array(s),c=0;c0&&(f.addGroup(v,x,g),v+=x),g=P}}var E=3*c-v;E>0&&f.addGroup(v,E,g),e.destroy(y)}else f.addGroup(0,3*c,-1);var w=this.getProperty("bounds"),_=new a.Vector3(w.min.x,w.min.y,w.min.z),S=new a.Vector3(w.max.x,w.max.y,w.max.z);f.boundingBox=new a.Box3(_,S),f.computeBoundingSphere(),this.addMissingAttributes(f),this.setGeometry(o.default.primitiveType.TRIANGLES,f)},r.prototype.decode=function(){var t=e.Module;if(!t)throw new Error("Draco module not found");var r=u.default.getBufferArray(this.engine,this.getProperty("accessorId")),i=new t.DecoderBuffer;i.Init(r,r.byteLength),i.Init(r,r.byteLength);var a=new t.WebIDLWrapper,o=a.GetEncodedGeometryType(i);if(o===t.TRIANGULAR_MESH){var s=a.DecodeMeshFromBuffer(i);this.createBufferGeometry(t,a,s),t.destroy(s)}else n.default.warn(this.engine.getName()+(" - DracoGeometryAsset: Unrecognized geometry type '"+o+"'"));t.destroy(a),t.destroy(i)},r.prototype.registerBufferDependency=function(){var e=this.getProperty("accessorId"),t=e.split("#");if(2!==t.length)throw new Error(this.engine.getName()+" - DracoGeometryAsset: Invalid accessorId, "+e);this.registerDependencyById(t[0])},r}(o.default);c.addSchemas("DracoGeometryAsset",l),t.default=l}).call(t,r(74))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(9),o=r(12),s=r(11),u=r(15),p=r(4),c=["red","green","blue"],l="rgb",d=16384,h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.loadPriority=2,t}return i.__extends(t,e),t.prototype.unload=function(){this.runtimeData&&(this.engine.trigger("imageUnloaded",this.id),n.default.info(this.engine.getName()+" - Unloading image, "+this.getName()),e.prototype.unload.call(this))},t.prototype.getChosenRepresentation=function(){return this.chosenRepresentation},t.prototype.isCompressed=function(){return this.runtimeData?"jpeg"!==this.runtimeData.compression&&"zip"!==this.runtimeData.compression:this.getProperty("useCompression")},t.prototype.getCompressionFormat=function(){if(this.getProperty("useCompression")){var e=this.engine.getThreeRenderer();if(e){var t=e.extensions;if(t.get("WEBGL_compressed_texture_s3tc"))return"dxt";if(t.get("WEBGL_compressed_texture_pvrtc"))return"pvrtc"}}},t.prototype.getFormat=function(){var e=this.getChosenRepresentation();if(e.channels)switch(e.channels.length){case 4:return"alpha"===e.channels[3]?"rgba":"rgb";case 3:return"rgb";case 2:return"luminanceAlpha";case 1:return"luminance";default:return l}},t.prototype.getOriginalWidth=function(){return this.getProperty("width")||0},t.prototype.getOriginalHeight=function(){return this.getProperty("height")||0},t.prototype.getMaxRepresentationWidth=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.width>e?t.width:e},0):0},t.prototype.getMaxRepresentationHeight=function(){var e=this.get("representations");return e?e.reduce(function(e,t){return t.height>e?t.height:e},0):0},t.prototype.getMaxTextureSize=function(){var t=this.engine.getRenderer();return t?t.getMaxTextureSize2d():e.prototype.getMaxTextureSize.call(this)},t.prototype.getImageResponseType=function(e){switch(e){case"image/vnd-ms.dds":return"arraybuffer";default:return"blob"}},t.prototype.applyPropertiesUnloaded=function(e){var t={maxSize:Math.max(this.getWidth(),this.getHeight()),compression:this.getCompressionFormat()};this.chosenRepresentation=this.findRepresentation(t)},t.prototype.createRuntimeData=function(e){var t=this;if(!this.chosenRepresentation)throw new Error("No suitable representation found to load");this.loadLowResImage(e).then(function(){return t.loadHighResImage(e)}).catch(this.onImageLoadError.bind(this))},t.prototype.loadLowResImage=function(e){var t=this;if(this.loadPriority=2,!this.getProperty("stream"))return Promise.resolve();var r={maxSize:64},i=this.findRepresentation(r);return i?new Promise(function(r,n){var a=t.loadResource(i.src,u.default.IMAGE,e,{priority:t.loadPriority,responseType:t.getImageResponseType(i.contentType),isExternal:i.isExternal});a.once(s.default.LOAD,function(e){t.onImageLoad(e,i),t.loadPriority=8,r()}),a.once(s.default.CANCEL,function(){n(new Error("Failed to load low res texture"))}),a.once(s.default.ERROR,n)}):Promise.resolve()},t.prototype.loadHighResImage=function(e){var t=this;if(!this.isDestroyed())return new Promise(function(r,i){var n=function(e){t.isDestroyed()||(t.loadedBytes=t.getDataSizeDownload()*e.loaded/e.total,t.trigger("loadProgress",t))};t.setState(a.StateType.Base,a.State.InProgress);var o=t.chosenRepresentation,p=t.loadResource(o.src,u.default.IMAGE,e,{responseType:t.getImageResponseType(o.contentType),isExternal:o.isExternal,priority:t.loadPriority});p.once(s.default.PROGRESS,n),p.once(s.default.LOAD,function(e){t.onImageLoad(e,o)}),p.once(s.default.ERROR,i)})},t.prototype.onImageLoad=function(e,t){if(this.runtimeData||(this.runtimeData={}),this.runtimeData.contentType=t.contentType,this.runtimeData.compression=t.compression,this.runtimeData.colorspace=t.colorspace,this.runtimeData.channels=t.channels||c,this.runtimeData.width=t.width,this.runtimeData.height=t.height,!(e instanceof ArrayBuffer||e instanceof Image))throw new Error("Unknown container type for image data!");this.runtimeData.imageData=e,this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this)},t.prototype.onImageLoadError=function(e){this.isDestroyed()||(n.default.error("There was an error loading the image, "+this.getName(),e),this.setState(a.StateType.Base,a.State.Failed),this.loadedBytes=this.getDataSizeDownload(),this.trigger("loadProgress",this))},t.prototype.findRepresentation=function(e){void 0===e&&(e={});var t=this.get("representations");if(!t||0===t.length)return null;var r=Object.assign({maxSize:d},e),i=t.filter(function(e){if(e.compression===r.compression)return!0;switch(e.compression){case"zip":case"jpeg":return!r.compression;case"dxt":case"dxt1":case"dxt5":return"dxt"===r.compression}return!1});0===i.length&&(i=t.filter(function(e){return"zip"===e.compression||"jpeg"===e.compression}));var n=i.filter(function(e){var t=e.channels||c;return!r.channels||t.toString()===r.channels.toString()});0===n.length&&(n=i);var a=["image/vnd-ms.dds"],o=n.filter(function(e){var t=Math.max(e.width,e.height),i=a.indexOf(e.contentType)!==-1;return t<=r.maxSize||i}),s=o.reduce(function(e,t,r){var i=Math.max(t.width,t.height),n=e>=0?Math.max(o[e].width,o[e].height):0;return i>n?r:e},-1);return s>=0?o[s]:null},t}(o.default);p.addSchemas("ImageAsset",h),t.default=h},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(23),s=r(9),u=r(20),p=r(5),c=r(4),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.getDataSizeInMemorySelf=function(){var e=this,t=this.getProperty("attributes");return Object.keys(t).map(function(r){var i=t[r],n=u.default.getBufferAccessor(e.engine,i.accessorId);return u.default.getComponentTypeSize(n.componentType)*u.default.getTypeSize(n.type)*n.count}).reduce(function(e,t){return t+e},0)},t.prototype.applyPropertiesUnloaded=function(t){e.prototype.applyPropertiesUnloaded.call(this,t),(t.attributes||t.indices)&&this.registerBufferDependency()},t.prototype.createRuntimeData=function(e){var t=this;this.when("loadDependencies",function(){if(!t.isDestroyed()){var r=t.getDependencies(),i=r.some(function(e){return e.isLoadFailed()});if(i)t.setState(s.StateType.Base,s.State.Failed);else try{t.createBufferGeometry()}catch(e){n.default.error(e.toString()),t.setState(s.StateType.Base,s.State.Failed)}e()}})},t.prototype.createAttributes=function(e){var t=this,r={indices:"index",positions:"position",normals:"normal",tangents:"tangent",colors:"color",uvs1:"uv",uvs2:"uv2",skinIndices:"skinIndex",skinWeights:"skinWeight"},i=Object.assign({indices:{accessorId:this.getProperty("indices")}},this.getProperty("attributes")),n={};return p.forEach(r,function(r,a){if(i.hasOwnProperty(a)){var o=i[a].accessorId;n[r]=t.createBufferAttribute(o,e[r])}}),n},t.prototype.createBufferAttribute=function(e,t){var r=u.default.getBufferAccessor(this.engine,e),i=u.default.getBufferArray(this.engine,e),n=u.default.getTypeSize(r.type);if(void 0===t||n===t)return new a.BufferAttribute(i,n);for(var o=new i.constructor(r.count*t),s=Math.min(n,t),p=0;p=this.updateFrameInterval&&this.isEnabled()&&(this.framesElapsed=0,this.captureScene()))},t.prototype.getCubeCamera=function(){return this.cubeCamera},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTextureCube({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_cube"),this.tempRenderTexture.load()},t.prototype.initCameras=function(){this.cubeCamera=new n.Object3D;var e=90,t=1;this.cameraPX=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraPX.up.set(0,-1,0),this.cameraPX.lookAt(new n.Vector3(1,0,0)),this.cubeCamera.add(this.cameraPX),this.cameraNX=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraNX.up.set(0,-1,0),this.cameraNX.lookAt(new n.Vector3(-1,0,0)),this.cubeCamera.add(this.cameraNX),this.cameraPY=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraPY.up.set(0,0,1),this.cameraPY.lookAt(new n.Vector3(0,1,0)),this.cubeCamera.add(this.cameraPY),this.cameraNY=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraNY.up.set(0,0,-1),this.cameraNY.lookAt(new n.Vector3(0,-1,0)),this.cubeCamera.add(this.cameraNY),this.cameraPZ=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraPZ.up.set(0,-1,0),this.cameraPZ.lookAt(new n.Vector3(0,0,1)),this.cubeCamera.add(this.cameraPZ),this.cameraNZ=new n.PerspectiveCamera(e,t,this.near,this.far),this.cameraNZ.up.set(0,-1,0),this.cameraNZ.lookAt(new n.Vector3(0,0,-1)),this.cubeCamera.add(this.cameraNZ)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(5),o=r(1),s=r(2),u=function(e){function t(){var t=e.call(this)||this;return t.controlPoints=void 0,t.prevControlPointsLength=0,t.closed=!1,t.tempVector=new o.Vector3,t.tempVector4=new o.Vector4,t.tempMatrix=new o.Matrix4,t.visualizationCurveColor=2236962,t.visualizationSelectedCurveColor=874150,t.orientationHelpers=[],t.canTryUpdateAgain=!0,t.curveMaterial=void 0,t.curveGeometry=void 0,t.curveMesh=void 0,t.curveTessellation=200,t.selected=!1,t.updateStarted=!1,t}return i.__extends(t,e),t.prototype.onSelected=function(){this.selected=!0,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationSelectedCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!0})})},t.prototype.onUnselected=function(){this.selected=!1,this.curveMaterial&&this.curveMaterial.color.setHex(this.visualizationCurveColor),this.orientationHelpers.forEach(function(e){return e.traverse(function(e){e.visible=!1})})},t.prototype.isCurveInit=function(){return this.curve.points.length>0},t.prototype.onStartup=function(){this.initCurve()},t.prototype.onAttributesChanged=function(){this.initCurve()},t.prototype.onShutdown=function(){this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.cleanupCurveMaterial()},t.prototype.initCurve=function(){!this.updateStarted&&this.controlPoints&&this.controlPoints.length&&(this.updateStarted=!0,this.cleanupCurveMesh(),this.cleanupOrientationHelpers(),this.prevControlPointsLength=this.controlPoints.length,this.createCurve(),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh(),this.updateOrientationHelpers()))},t.prototype.createCurve=function(){var e=this;this.controlPoints.forEach(function(t){return t.off("change:properties",e.updateCurve,e)}),this.curve=new o.CatmullRomCurve3,this.closed&&(this.curve.closed=!0);var t=this.getEntity().getRootObject();t.when("loadDependencies",function(r){t.runtimeData.updateMatrixWorld(!0),a.forEach(e.controlPoints,function(t){if(t){var r=t.getPosition().clone();e.curve.points.push(r),e.tempMatrix.makeRotationFromQuaternion(t.runtimeData.quaternion);var i=e.tempMatrix.toArray();e.tempVector.set(i[0],i[1],i[2]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,r,.25,16711680)),e.tempVector.set(i[4],i[5],i[6]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,r,.25,65280)),e.tempVector.set(i[8],i[9],i[10]),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,r,.25,255)),t.on("change:properties",e.updateCurve,e)}else e.tempVector.set(0,0,0),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680)),e.orientationHelpers.push(new o.ArrowHelper(e.tempVector,e.tempVector,.25,16711680))}),e.updateCurve({}),e.updateStarted=!1,e.selected||e.onUnselected(),e.trigger("curveInit")},this)},t.prototype.updateCurve=function(e){var t=this,r=0;e.hasOwnProperty("position")&&(a.forEach(this.controlPoints,function(e){e&&(e.runtimeData.parent?(e.getPosition(t.tempVector),t.tempVector4.set(t.tempVector.x,t.tempVector.y,t.tempVector.z,1),t.tempVector4.applyMatrix4(e.runtimeData.parent.matrixWorld),t.curve.points[r].set(t.tempVector4.x,t.tempVector4.y,t.tempVector4.z),r++):t.canTryUpdateAgain&&(t.canTryUpdateAgain=!1,setTimeout(function(){n.default.info("Trying again"),t.updateCurve({})},10)))}),this.enableVisualizations&&(this.cleanupCurveMesh(),this.createCurveMesh()),this.canTryUpdateAgain=!0),e.hasOwnProperty("quaternion")&&this.updateOrientationHelpers()},t.prototype.cleanupCurveMaterial=function(){this.curveMaterial&&(this.curveMaterial.dispose(),this.curveMaterial=void 0)},t.prototype.cleanupOrientationHelpers=function(){var e=this;this.orientationHelpers.forEach(function(t){e.getRootThreeObject().remove(t)}),this.orientationHelpers=[]},t.prototype.cleanupCurveMesh=function(){this.enableVisualizations&&this.curveMesh&&(this.getRootThreeObject().remove(this.curveMesh),this.curveGeometry.dispose(),this.curveMesh.material=void 0)},t.prototype.createCurveMesh=function(){var e=this;this.curveMaterial||(this.curveMaterial=new o.MeshPhongMaterial({color:this.visualizationCurveColor,transparent:!1,opacity:.75,blending:o.AdditiveBlending})),this.curve.points.length&&(this.curveGeometry=new o.TubeGeometry(this.curve,this.curveTessellation,.1,8,this.closed),this.curveMesh=new o.Mesh(this.curveGeometry,this.curveMaterial),this.getRootObject().when("loadBase",function(){e.getRootThreeObject().add(e.curveMesh),a.forEach(e.orientationHelpers,function(t){e.getRootThreeObject().add(t)})},this),this.updateOrientationHelpers())},t.prototype.updateOrientationHelpers=function(){var e=this;this.controlPoints.forEach(function(t,r){var i=t.runtimeData;e.orientationHelpers[3*r].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+1].position.copy(e.curve.points[r]),e.orientationHelpers[3*r+2].position.copy(e.curve.points[r]),e.tempMatrix.makeRotationFromQuaternion(i.quaternion);var n=e.tempMatrix.toArray();e.tempVector.set(n[0],n[1],n[2]),e.orientationHelpers[3*r].setDirection(e.tempVector),e.tempVector.set(n[4],n[5],n[6]),e.orientationHelpers[3*r+1].setDirection(e.tempVector),e.tempVector.set(n[8],n[9],n[10]),e.orientationHelpers[3*r+2].setDirection(e.tempVector)})},t}(s.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return e.call(this)||this}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this;this.logTag=document.createElement("div"),this.logTag.id="consoleLogger",this.logTag.style.position="absolute",this.logTag.style.top="0",this.logTag.style.left="0",this.logTag.style.width="100%",this.logTag.style.height="100%",this.logTag.style.margin="0",this.logTag.style.padding="0",this.logTag.style.color="#000",this.logTag.style.background="rgba(0,0,0,0.5)",this.logTag.style.fontWeight="bold",this.logTag.style.textAlign="left",this.logTag.style.overflow="scroll",this.logTag.style["pointer-events"]="none",this.logTag.style["z-index"]="1",window.document.body.appendChild(this.logTag),this.oldLog=window.console.log,this.oldError=window.console.error,this.oldWarn=window.console.warn,window.console.log=window.console.error=window.console.warn=function(t){e.logTag.innerHTML+=t+"
"}},t.prototype.onShutdown=function(){this.logTag&&(window.document.body.removeChild(this.logTag),window.console.log=this.oldLog,window.console.error=this.oldError,window.console.warn=this.oldWarn,this.logTag=void 0)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(269),o=function(e){function t(){var t=e.call(this)||this;return t.stats=new a,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.stats.showPanel(0)},t.prototype.onPreUpdate=function(){this.isEnabled()&&this.stats.begin()},t.prototype.onPostRender=function(){this.isEnabled()&&this.stats.end()},t.prototype.onEnable=function(){document.body.appendChild(this.stats.dom),this.initialized=!0},t.prototype.onDisable=function(){this.initialized&&(document.body.removeChild(this.stats.dom),this.initialized=!1)},t}(n.default);t.default=o},function(e,t,r){"use strict";function i(e,t){if(e&&e.style)for(var r in t)t.hasOwnProperty(r)&&(e.style[r]=t[r])}function n(e,t){e.classList?e.classList.add(t):e.className+=" "+t}Object.defineProperty(t,"__esModule",{value:!0});var a=r(0),o=r(1),s=r(2),u=r(5),p=r(19),c=r(217),l={position:"absolute",left:"0",top:"0",padding:"8px","border-radius":"5px","font-family":"proxima_nova_regular,Helvetica,Arial,sans-serif","max-width":"25%","min-width":"25px",transition:"opacity 0.1s ease-in-out, background 0.1s ease-in-out",cursor:"pointer"},d=function(e){function t(){var t=e.call(this)||this;return t.renderEventName="render",t.textureRegistryById={},t}return a.__extends(t,e),t.prototype.onAwake=function(){this.getEngine().on("assetLoaded",this.registerTexture,this),this.getEngine().on("assetUnloaded",this.unregisterTexture,this)},t.prototype.onStartup=function(){var e=this;this.init2dScene(),this.initCubeScene(),this.renderEventName+="Group"+this.renderGroup,this.getEngine().on(this.renderEventName,this.renderView,this),this.listenTo(this.getEngine(),"rendererResize",this.resize),this.getEngine().getAssetsByClass(p.default).forEach(function(t){return e.registerTexture(t)}),this.resize()},t.prototype.onShutdown=function(){this.getEngine().off("assetLoaded",this.registerTexture,this),this.getEngine().off("assetUnloaded",this.unregisterTexture,this),this.getEngine().off(this.renderEventName,this.renderView,this)},t.prototype.init2dScene=function(){this.camera2D=new o.OrthographicCamera(-1,1,1,-1,0,1),this.scene2D=new o.Scene,this.material2D=new o.ShaderMaterial(c.default),this.material2D.transparent=!0,this.mesh2D=new o.Mesh(new o.PlaneGeometry(2,2),this.material2D),this.scene2D.add(this.mesh2D)},t.prototype.initCubeScene=function(){var e=90,t=1,r=o.ShaderLib.cube;this.sceneCube=new o.Scene,this.geoCube=new o.BoxGeometry(100,100,100),this.materialCube=new o.ShaderMaterial({fragmentShader:r.fragmentShader,vertexShader:r.vertexShader,uniforms:r.uniforms,depthWrite:!1,depthTest:!1,side:o.BackSide}),this.meshCube=new o.Mesh(this.geoCube,this.materialCube),this.cameraPX=new o.PerspectiveCamera(e,t,1,1e3),this.cameraPX.up.set(0,1,0),this.cameraPX.lookAt(new o.Vector3(1,0,0)),this.sceneCube.add(this.cameraPX),this.cameraNX=new o.PerspectiveCamera(e,t,1,1e3),this.cameraNX.up.set(0,1,0),this.cameraNX.lookAt(new o.Vector3(-1,0,0)),this.sceneCube.add(this.cameraNX),this.cameraPY=new o.PerspectiveCamera(e,t,1,1e3),this.cameraPY.up.set(0,0,-1),this.cameraPY.lookAt(new o.Vector3(0,1,0)),this.sceneCube.add(this.cameraPY),this.cameraNY=new o.PerspectiveCamera(e,t,1,1e3),this.cameraNY.up.set(0,0,1),this.cameraNY.lookAt(new o.Vector3(0,-1,0)),this.sceneCube.add(this.cameraNY),this.cameraPZ=new o.PerspectiveCamera(e,t,1,1e3),this.cameraPZ.up.set(0,1,0),this.cameraPZ.lookAt(new o.Vector3(0,0,1)),this.sceneCube.add(this.cameraPZ),this.cameraNZ=new o.PerspectiveCamera(e,t,1,1e3),this.cameraNZ.up.set(0,1,0),this.cameraNZ.lookAt(new o.Vector3(0,0,-1)),this.sceneCube.add(this.cameraNZ),this.sceneCube.add(this.meshCube)},t.prototype.setTexture=function(e){var t=this;this.currentTexture=this.textureRegistryById[e],this.currentTexture?this.currentTexture.load(function(){switch(t.currentTexture.type){case"renderTextureCube":case"textureCube":t.materialCube.uniforms.tCube.value=t.currentTexture.getThreeTexture();break;case"texture2D":case"renderTexture2D":t.material2D.uniforms.tDiffuse.value=t.currentTexture.getThreeTexture()}t.mesh2D.visible=!0,t.meshCube.visible=!0}):(this.mesh2D.visible=!1,this.meshCube.visible=!1)},t.prototype.updateViewport=function(){var e,t=this.getEngine().getRenderer().getWidth(),r=this.getEngine().getRenderer().getHeight();"%"===this.viewportBottom.slice(-1)?(e=.01*parseFloat(this.viewportBottom.slice(0,-1)),this.y=e*r):this.y=parseInt(this.viewportBottom,10),"%"===this.viewportLeft.slice(-1)?(e=.01*parseFloat(this.viewportLeft.slice(0,-1)),this.x=e*t):this.x=parseInt(this.viewportLeft,10),"%"===this.viewportWidth.slice(-1)?(e=.01*parseFloat(this.viewportWidth.slice(0,-1)),this.width=e*t):this.width=parseInt(this.viewportWidth,10),"%"===this.viewportHeight.slice(-1)?(e=.01*parseFloat(this.viewportHeight.slice(0,-1)),this.height=e*r):this.height=parseInt(this.viewportHeight,10),this.x<0&&(this.x+=t),this.y<0&&(this.y+=r)},t.prototype.updateTextureDropdown=function(){var e=this;this.isEnabled()&&setTimeout(function(){var t;if(!e.textureDropDown){if(e.textureDropDown=document.createElement("select"),e.textureDropDown.name="Textures",e.textureDropDown.id="Textures",n(e.textureDropDown,"debugger-dropdown"),i(e.textureDropDown,l),!e.getThreeRenderer())return;var r=e.getThreeRenderer().domElement;r.parentElement?r.parentElement.appendChild(e.textureDropDown):r.appendChild(e.textureDropDown),e.textureDropDown.onchange=function(){e.setTexture(e.textureDropDown.value)}}e.textureDropDown.options.length=0,t=document.createElement("option"),t.value=0,t.text="None",e.textureDropDown.appendChild(t),u.forEach(e.textureRegistryById,function(r,i){t=document.createElement("option"),t.value=i,t.text=""!==r.name?r.getName():i,e.textureDropDown.appendChild(t)}),e.textureDropDown.style.top=e.getEngine().getRenderer().getHeight()-e.y-e.height+"px",e.textureDropDown.style.left=e.x+"px",e.textureDropDown.style.zIndex="200"},0)},t.prototype.resize=function(){this.isEnabled()&&(this.updateTextureDropdown(),this.updateViewport())},t.prototype.renderView=function(){var e=this.getThreeRenderer();if(this.isEnabled()&&this.currentTexture)switch(e.setRenderTarget(null),this.currentTexture.type){case"texture2D":case"renderTexture2D":e.setViewport(this.x,this.y,this.width,this.height),e.render(this.scene2D,this.camera2D);break;case"textureCube":case"renderTextureCube":var t=.25*this.width,r=.3333*this.height;e.setViewport(this.x,this.y+r,t,r),e.render(this.sceneCube,this.cameraPX,null,!1),e.setViewport(this.x+1.999*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNX,null,!1),e.setViewport(this.x+t,this.y+1.99*r,t,r),e.render(this.sceneCube,this.cameraPY,null,!1),e.setViewport(this.x+t,this.y,t,r),e.render(this.sceneCube,this.cameraNY,null,!1),e.setViewport(this.x+t,this.y+r,t,r),e.render(this.sceneCube,this.cameraPZ,null,!1),e.setViewport(this.x+2.99*t,this.y+r,t,r),e.render(this.sceneCube,this.cameraNZ,null,!1)}},t.prototype.registerTexture=function(e){if(e)switch(e.type){case"renderTextureCube":case"textureCube":case"texture2D":case"renderTexture2D":this.textureRegistryById[e.id]=e}},t.prototype.unregisterTexture=function(e){e&&this.textureRegistryById[e.id]&&delete this.textureRegistryById[e.id]},t}(s.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(){function e(e,t,r,i){this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i,this.previousValues={},this.lastTimeSavings=0,this.targetEntityType=e,this.targetComponentName=t,this.propertyName=r,this.targetValue=i}return e}();t.QualityChangeLevel=a;var o=.9,s=function(e){function t(){var t=e.call(this)||this;return t.QualityChangeLevel=a,t.frameTimeThreshold=33.333333333,t.testInterval=2e3,t.qualityChangeLevels=[],t.currentLevel=t.qualityChangeLevels.length,t.elapsedRenderTime=0,t.framesRecorded=0,t.justStarted=!0,t.justAutoSteppedDown=!1,t.autoOptimize=!0,t}return i.__extends(t,e),t.prototype.setQualityChangeLevels=function(e){this.setMaxQuality(),this.qualityChangeLevels=e,this.currentLevel=this.qualityChangeLevels.length,this.isEnabled()&&(this.autoOptimize=!0)},t.prototype.setFrameTimeThreshold=function(e){this.frameTimeThreshold=e},t.prototype.setTestInterval=function(e){this.testInterval=e,this.elapsedRenderTime=0,this.framesRecorded=0},t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&(this.elapsedRenderTime+=1e3*e,this.framesRecorded++,!(this.elapsedRenderTimethis.frameTimeThreshold?(this.stepRenderingQualityDown(),this.justAutoSteppedDown=!0):this.qualityChangeLevels[this.currentLevel]&&this.lastAvgFrameTime0;)this.currentLevel=this.currentLevel>1?this.currentLevel-1:0,e=!this.stepRenderingQuality(!1);e||(this.qualityChangeLevels[this.currentLevel].frameTimeAtDrop=this.lastAvgFrameTime)},t.prototype.stepRenderingQualityUp=function(){for(var e=!0;e&&this.currentLevelthis.time?1:n(Math.max(0,Math.min(1,this.currentTime/this.time)));this.objects.forEach(function(e,i){var n=e.runtimeData.parent.worldToLocal(l.copy(t.destinations[i])).clone(),a=t.direction>0?t.sources[i]:n,o=t.direction>0?n:t.sources[i];l.lerpVectors(a,o,r),e.setPosition(l.x,l.y,l.z)}),this.currentTime>this.time&&this.getEntity().trigger(this.direction>0?"endExplode":"endContract")}},t.prototype.reset=function(){var e=this;this.objects.forEach(function(t,r){t.setPosition(e.sources[r].x,e.sources[r].y,e.sources[r].z)}),this.objects.length=0,this.sources.length=0,this.destinations.length=0,this.currentTime=this.time},t.prototype.contract=function(){this.isEnabled()&&(this.direction=-1,this.currentTime=0,this.getEntity().trigger("beginContract"))},t.prototype.explode=function(e,t){var r=this;if(this.isEnabled()){this.reset();var i=this.getEntity().getDescendantsByType("mesh"),n=this.getEntity().getCenter();n.applyMatrix4(this.getRuntimeData().matrixWorld);var a=new p.Quaternion;a.setFromRotationMatrix(this.getRuntimeData().matrixWorld);var o=this.getFormationFunc(e||this.formation,i.length,n,a,t||this.scale).bind(this);i.forEach(function(e,t){o(t,l,e),r.objects.push(e),r.sources.push(e.getPosition()),r.destinations.push(l.clone())}),this.currentTime=0,this.direction=1,this.getEntity().trigger("beginExplode")}},t.prototype.toggleExplode=function(){this.direction>0?this.contract():this.explode()},t.prototype.getFormationFunc=function(e,t,r,i,n){switch(e){case"Grid":return a(t,r,n,i);case"Scale":return o(r,n);default:case"Circle":return s(t,r,n,i)}},t}(c.default);t.default=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=e.call(this)||this;return t.el=void 0,t.fsEnabled=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.toggle=this.toggle.bind(this),this.getEntity().on("toggleFullscreen",this.toggle,this),this.listenTo(this.getGlobalEvents(),"fullscreen::toggle",this.toggle),this.listenTo(this.getGlobalEvents(),"fullscreen::enable",this.enableFullscreen),this.listenTo(this.getGlobalEvents(),"fullscreen::disable",this.disableFullscreen)},t.prototype.toggle=function(){this.fsEnabled?this.disableFullscreen():this.enableFullscreen()},t.prototype.enableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.el.requestFullscreen(),this.fsEnabled=!0},t.prototype.disableFullscreen=function(){this.el||this.attachFullscreenAPI(),this.fsEnabled&&document.exitFullscreen(),this.fsEnabled=!1},t.prototype.attachFullscreenAPI=function(){this.el=this.getEngine().container,this.el.requestFullscreen=this.el.requestFullscreen||this.el.requestFullScreen||this.el.mozRequestFullscreen||this.el.mozRequestFullScreen||this.el.webkitRequestFullscreen||this.el.webkitRequestFullScreen||this.el.msRequestFullscreen||this.el.msRequestFullScreen,document.exitFullscreen=document.exitFullscreen||document.exitFullScreen||document.mozCancelFullscreen||document.mozCancelFullScreen||document.webkitExitFullscreen||document.webkitExitFullScreen||document.msExitFullscreen||document.msExitFullScreen,document.addEventListener("fullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("mozfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("webkitfullscreenchange",this.onFullscreenChange.bind(this),!1),document.addEventListener("msfullscreenchange",this.onFullscreenChange.bind(this),!1)},t.prototype.onFullscreenChange=function(e){this.getGlobalEvents().trigger("fullscreen::change",e)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(5),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.buttons=[],t.axes=[],t.workVector1=new n.Vector3,t.workVector2=new n.Vector3,t.workQuaternion1=new n.Quaternion,t.workQuaternion2=new n.Quaternion,t.workEuler=new n.Euler,t.meshControlMap={},t.updateAxes=!1,t.updateButtons=[],t.gamepadDevice=null,t}return i.__extends(t,e),t.prototype.onUpdate=function(e){var t=this;this.gamepadDevice||(this.gamepadDevice=this.getGamepadDevice(),this.gamepadDevice&&(this.listenTo(this.gamepadDevice,"gamepadButtonChanged",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonTouched",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadButtonReleased",this.onGamepadButtonEvent),this.listenTo(this.gamepadDevice,"gamepadAxisChanged",this.onGamepadAxisEvent))),this.updateButtons.forEach(function(e,r){e&&t.updateButtonTransform(r)}),this.updateAxes&&(this.updateAxes=!1,this.updateAxesTransforms())},t.prototype.getAxisMeshes=function(e){return this.axes[e].map(function(e){return e.mesh})},t.prototype.getButtonMeshes=function(e){return this.buttons[e].map(function(e){return e.mesh})},t.prototype.onAttributesChanged=function(e){var t=this;e.indexOf("axes")===-1&&e.indexOf("buttons")===-1||(this.meshControlMap={},this.axes.forEach(function(e,r){e.forEach(function(e,i){ +var n=e.mesh;n&&(t.meshControlMap[n.id]||(t.meshControlMap[n.id]={axes:[],axesMeshIdx:[],buttons:[],buttonMeshIdx:[]}),t.meshControlMap[n.id].axes.push(r),t.meshControlMap[n.id].axesMeshIdx.push(i))})}),this.buttons.forEach(function(e,r){e.forEach(function(e,i){var n=e.mesh;n&&t.meshControlMap[n.id]&&(t.meshControlMap[n.id].buttons.push(r),t.meshControlMap[n.id].buttonMeshIdx.push(i))})}))},t.prototype.getGamepadDevice=function(){if(this.gamepadDevice)return this.gamepadDevice;var e=this.getEntity().getAncestors(),t=e.find(function(e){return!!e.getComponentByScriptId("motion_gamepad_device")});return t?(this.gamepadDevice=t.getComponentByScriptId("motion_gamepad_device"),this.gamepadDevice):(this.gamepadDevice=null,null)},t.prototype.onGamepadButtonEvent=function(e,t){this.currentGamepadState=e,this.updateButtons[t]=!0},t.prototype.updateButtonTransform=function(e){var t=this,r=this.currentGamepadState.buttons[e].value,i=this.buttons[e];i.forEach(function(i){if(i.mesh){switch(i.movementType){case"translate":t.workVector1.copy(i.offset).multiplyScalar(r),i.mesh.setPosition(t.workVector1.x,t.workVector1.y,t.workVector1.z);break;case"rotate":t.workVector2.copy(i.rotation).multiplyScalar(r),t.workEuler.setFromVector3(t.workVector2),t.workQuaternion1.setFromEuler(t.workEuler),t.workVector1.copy(i.pivot),t.workVector2.copy(t.workVector1).multiplyScalar(-1),t.workVector2.applyQuaternion(t.workQuaternion1),t.workVector2.add(t.workVector1),i.mesh.setQuaternion(t.workQuaternion1.x,t.workQuaternion1.y,t.workQuaternion1.z,t.workQuaternion1.w),i.mesh.setPosition(t.workVector2.x,t.workVector2.y,t.workVector2.z)}i.renderOnTouchOnly&&t.currentGamepadState.buttons[e].hasOwnProperty("touched")&&i.mesh.setProperty("visible",t.currentGamepadState.buttons[e].touched)}})},t.prototype.onGamepadAxisEvent=function(e,t){this.currentGamepadState=e,this.updateAxes=!0},t.prototype.updateAxesTransforms=function(){var e=this;o.forEach(this.meshControlMap,function(t,r){var i=e.getEngine().getObjectById(r);if(i){var n=e.axes[0][t.axesMeshIdx[0]].movementType;if(e.workVector1.set(0,0,0),t.axes.reduce(function(r,i,a){var o=e.axes[i][t.axesMeshIdx[a]];if(o.movementType!==n)return log.error("Can't perform multiple types of axis transformations on same mesh."),r;if("translate"===n){var s=e.currentGamepadState.axes[i];e.workVector2.copy(o.offset).multiplyScalar(s)}else"rotate"===n&&e.workVector2.copy(o.pivot).multiplyScalar(-1);return r.lerp(e.workVector2,0===a?1:.5)},e.workVector1),e.workQuaternion1.set(0,0,0,1),"rotate"===n&&(t.axes.reduce(function(r,i,n){var a=e.axes[i][t.axesMeshIdx[n]],o=e.currentGamepadState.axes[i];return e.workVector2.copy(a.rotation).multiplyScalar(o),e.workEuler.setFromVector3(e.workVector2),e.workQuaternion2.setFromEuler(e.workEuler),r.slerp(e.workQuaternion2,0===n?1:.5)},e.workQuaternion1),e.workVector2.copy(e.workVector1),e.workVector1.applyQuaternion(e.workQuaternion1),e.workVector2.multiplyScalar(-1),e.workVector1.add(e.workVector2)),i.setQuaternion(e.workQuaternion1.x,e.workQuaternion1.y,e.workQuaternion1.z,e.workQuaternion1.w),i.setPosition(e.workVector1.x,e.workVector1.y,e.workVector1.z),t.buttons.length){var a=t.buttons[0],o=e.currentGamepadState.buttons[a].value,s=e.buttons[a][0].offset;e.workVector2.copy(s).multiplyScalar(o),e.workVector2.applyQuaternion(e.workQuaternion1),e.workVector2.add(e.workVector1),i.setPosition(e.workVector2.x,e.workVector2.y,e.workVector2.z)}}})},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.gamepadStates=[],t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&navigator.getGamepads)for(var t=navigator.getGamepads(),r=0;r":187,"<":188,_:189,".":190,"/":191,"[":219,"]":221};var d=function(e){function r(){var t=e.call(this)||this;return t.mouseButtons={left:0,middle:1,right:2},t.inputQueue=[],t.inputPool=[],t.mouseButtonState=new Array(3),t.mouseButtonStatePrevious=new Array(3),t.mousePosition=new u.Vector2,t.mousePositionPercent=new u.Vector2,t.mousePreviousPosition=new u.Vector2,t.mouseDragState=new Array(3),t.mouseDragStatePrevious=new Array(3),t.mouseDragDistance=[new u.Vector2,new u.Vector2,new u.Vector2],t.touchPosition=new u.Vector2,t.touchPositionPercent=new u.Vector2,t.touchPreviousPosition=new u.Vector2,t.touchDragState=!1,t.touchDragStatePrevious=!1,t.doubleTapHandle=null,t.doubleTapPosition=new u.Vector2,t.listenForTouchStart=!1,t.listenForTouchEnd=!1,t.touchesStart=[],t.keyState=new Array(256),t.keyStatePrevious=new Array(256),t.canvas=null,t.pointerLockEnabled=!1,t}return i.__extends(r,e),r.prototype.mouseButtonDown=function(e){if("any"===e){for(var t in this.mouseButtons)if(this.mouseButtonState[this.mouseButtons[t]])return!0;return!1}return this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonUp=function(e){return!this.mouseButtonState[this.mouseButtons[e]]},r.prototype.mouseButtonPressed=function(e){return!(!this.mouseButtonState[this.mouseButtons[e]]||this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.mouseButtonReleased=function(e){return!(this.mouseButtonState[this.mouseButtons[e]]||!this.mouseButtonStatePrevious[this.mouseButtons[e]])},r.prototype.keyPressed=function(e){return!(!this.keyState[t.keyCodes[e]]||this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyReleased=function(e){return!(this.keyState[t.keyCodes[e]]||!this.keyStatePrevious[t.keyCodes[e]])},r.prototype.keyDown=function(e){return!!this.keyState[t.keyCodes[e]]},r.prototype.keyUp=function(e){return!this.keyState[t.keyCodes[e]]},r.prototype.getMouseDragState=function(e){return this.mouseDragState[this.mouseButtons[e||"left"]]},r.prototype.getPreviousMouseDragState=function(e){return this.mouseDragStatePrevious[this.mouseButtons[e||"left"]]},r.prototype.getTouchDragState=function(){return this.touchDragState},r.prototype.getPreviousTouchDragState=function(){return this.touchDragStatePrevious},r.prototype.enablePointerLock=function(){this.pointerLockEnabled=!0,this.canvas.requestPointerLock()},r.prototype.disablePointerLock=function(){this.pointerLockEnabled=!1,document.exitPointerLock()},r.prototype.togglePointerLock=function(){this.pointerLockEnabled?this.enablePointerLock():this.disablePointerLock()},r.prototype.onStartup=function(){this.canvas=this.getEngine().canvas,this.canvas.requestPointerLock=this.canvas.requestPointerLock||this.canvas.mozRequestPointerLock||this.canvas.webkitRequestPointerLock,document.exitPointerLock=document.exitPointerLock||document.mozExitPointerLock||document.webkitExitPointerLock,this.clearKeyStates=this.clearKeyStates.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseWheel=this.onMouseWheel.bind(this),this.onMouseLeave=this.onMouseLeave.bind(this),this.onContextMenu=this.onContextMenu.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.onTouchStart=this.onTouchStart.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this),this.onTouchCancel=this.onTouchCancel.bind(this),this.onTouchLeave=this.onTouchLeave.bind(this),this.onTouchMove=this.onTouchMove.bind(this),this.onDoubleClick=this.onDoubleClick.bind(this),this.onDoubleTap=this.onDoubleTap.bind(this),window.addEventListener("blur",this.clearKeyStates,!1),this.isEnabled()&&(this.mouseEvents.enable&&this.enableMouseEvents(),this.keyEvents.enable&&this.enableKeyEvents(),this.touchEvents.enable&&this.enableTouchEvents())},r.prototype.onPreUpdate=function(){if(this.isEnabled())for(;this.inputQueue.length>0;)this.getEngine().trigger(this.inputQueue[0].name,this.inputQueue[0].event),this.recycleInputEvent(this.inputQueue.splice(0,1)[0])},r.prototype.onPostUpdate=function(){if(this.isEnabled()){if(this.keyEvents.enable)for(var e=0;ethis.mouseEvents.dragBufferDistance&&(this.mouseDragState[t]=!0)}else this.mouseDragState[t]=!1;this.inputQueue.push(this.getInputEvent(e,"mouseMove"))},r.prototype.onMouseDown=function(e){if(this.getScenePercent(e,e),this.mouseUpBound||(this.mouseUpBound=!0,document.addEventListener("mouseup",this.onMouseUp)),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.mouseEvents.preventDownDefault&&e.preventDefault(),this.mouseButtonState[e.button]=!0,this.inputQueue.push(this.getInputEvent(e,"mouseDown")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_down_"+t)}},r.prototype.onMouseUp=function(e){if(this.getScenePercent(e,e),this.mouseButtonState[e.button]=!1,this.mouseDragState[e.button]=!1,this.mouseDragDistance[e.button].x=0,this.mouseDragDistance[e.button].y=0,this.mouseButtonUp("left")&&this.mouseButtonUp("right")&&this.mouseButtonUp("middle")&&(this.mouseUpBound=!1,document.removeEventListener("mouseup",this.onMouseUp)),this.inputQueue.push(this.getInputEvent(e,"mouseUp")),this.mouseEvents.eventHandler){var t=this.getKeyByValue(this.mouseButtons,e.button);t&&this.getGlobalEvents().trigger("mouse_up_"+t)}},r.prototype.onDoubleClick=function(e){this.getScenePercent(e,e),Array.prototype.forEach.call(document.querySelectorAll("input, textarea, select, option"),function(e){e.blur()}),this.inputQueue.push(this.getInputEvent(e,"doubleClick"))},r.prototype.onMouseWheel=function(e){this.mouseEvents.preventScrollDefault&&e.preventDefault();var t;t=void 0!==e.wheelDeltaY?.025*e.wheelDeltaY:s.isIE()?-e.deltaY/40:-e.deltaY,this.inputQueue.push(this.getInputEvent(t,"mouseScroll"))},r.prototype.onMouseLeave=function(e){for(var t=0,r=this.mouseButtonState;tthis.touchEvents.dragBufferDistance?void this.clearDoubleTapState():(this.listenForTouchStart||this.listenForTouchEnd?!this.listenForTouchStart&&this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0):this.listenForTouchStart&&!this.listenForTouchEnd?(this.clearDoubleTapState(),this.listenForTouchStart=!0,this.listenForTouchEnd=!0,this.canvas.addEventListener("touchend",this.onDoubleTap)):(this.clearDoubleTapState(),this.onTouchEvent(e,"doubleTap")):(this.doubleTapPosition.copy(this.touchPosition),this.clearDoubleTapState(),this.canvas.addEventListener("touchend",this.onDoubleTap),this.listenForTouchEnd=!0),void(this.doubleTapHandle=setTimeout(this.clearDoubleTapState.bind(this),p)))},r.prototype.clearDoubleTapState=function(){clearTimeout(this.doubleTapHandle),this.doubleTapHandle=null,this.listenForTouchStart=!1,this.listenForTouchEnd=!1,this.canvas.removeEventListener("touchend",this.onDoubleTap)},r.prototype.onTouchCancel=function(e){this.touchEvents.preventCancelDefault&&e.preventDefault(),this.touchDragState=!1;var t={};t.originalEvent=e,t.touches=[],this.inputQueue.push(this.getInputEvent(t,"touchCancel"))},r.prototype.onTouchLeave=function(e){this.touchEvents.preventLeaveDefault&&e.preventDefault(),this.touchDragState=!1,this.onTouchEvent(e,"touchLeave")},r.prototype.onTouchMove=function(e){this.touchEvents.preventMoveDefault&&e.preventDefault();var t={};t.originalEvent=e,t.touches=[];for(var r=0;rthis.touchEvents.dragBufferDistance&&(this.touchDragState=!0),t.touches.push(i)}t.touches.length&&(this.touchPosition.x=t.touches[t.touches.length-1].sceneX,this.touchPosition.y=t.touches[t.touches.length-1].sceneY,this.touchPositionPercent.x=t.touches[t.touches.length-1].scenePercentX,this.touchPositionPercent.y=t.touches[t.touches.length-1].scenePercentY),this.inputQueue.push(this.getInputEvent(t,"touchMove"))},r.prototype.onTouchEvent=function(e,t){var r={};r.originalEvent=e,r.touches=[];for(var i=0;i=0&&(this.sourceBoundingSphere.radius=this.boundingSphereOverrideRadius)),this.sceneRoot.isBaseLoaded()&&this.sphereMesh&&(this.sphereMesh.position.copy(this.sourceBoundingSphere.center),this.sphereMesh.scale.set(this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius,this.sourceBoundingSphere.radius)),this.previousIntersections=this.currentIntersections,this.currentIntersections={},this.firstIntersectionOnly){var i=t.find(this.intersectObject.bind(this));i&&(this.previousIntersections[i.id]||(this.trigger("beginIntersection",i),this.getEntity().trigger("beginIntersection",i)),this.currentIntersections[i.id]=i)}else{var n=t.filter(this.intersectObject.bind(this));n.forEach(function(t){e.previousIntersections[t.id]||(e.trigger("beginIntersection",t),e.getEntity().trigger("beginIntersection",t)),e.currentIntersections[t.id]=t})}return o.forEach(this.previousIntersections,function(t){e.currentIntersections[t.id]||(e.trigger("endIntersection",t),e.getEntity().trigger("endIntersection",t))}),this.currentIntersections}},t.prototype.onAttributesChanged=function(e){e.indexOf("debugVisualization")!==-1&&(this.sphereMesh.visible=this.debugVisualization)},t.prototype.onPreUpdate=function(){this.checkIntersectionAlways&&this.checkIntersection()},t.prototype.generateObjectList=function(){var e=this;if(this.objectFilter.length)return this.objectFilter;var t=[];return this.sceneRoot.traverseSome(function(r){return r===e.getEntity()||!(e.objectTypeFilter.length&&!e.objectTypeFilter.some(function(e){return r.type===e}))&&void t.push(r)}),t},t.prototype.intersectObject=function(e){var t=e.runtimeData;return!!t&&(this.workMatrix.getInverse(t.matrixWorld),this.workBoundsSphere.copy(this.sourceBoundingSphere),this.workBoundsSphere.applyMatrix4(this.workMatrix),e.getBounds(this.workBoundingBox),this.workBoundingBox.intersectsSphere(this.workBoundsSphere))},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(14),o=function(e){function t(){var t=e.call(this)||this;return t.setupMaterial=t.setupMaterial.bind(t),t}return i.__extends(t,e),t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"entityCreated",function(t){t instanceof a.default&&e.setupMaterial(t)})},t.prototype.onAttributesChanged=function(e){this.setupAllMaterials()},t.prototype.onDisable=function(){this.getEngine().getAssetsByClass(a.default).forEach(function(e){var t=e.getShader().getProperty("parameters");t.envMapIrradiance&&e.setProperty("envMapIrradiance",null),t.envMapRadianceHalfGloss&&e.setProperty("envMapRadianceHalfGloss",null),t.envMapRadiance&&e.setProperty("envMapRadiance",null)})},t.prototype.onEnable=function(){this.setupAllMaterials()},t.prototype.setupAllMaterials=function(){this.getEngine().getAssetsByClass(a.default).forEach(this.setupMaterial)},t.prototype.setupMaterial=function(e){if(e&&this.isEnabled()){var t=e.getShader().getProperty("parameters");t.envMapIrradiance&&e.setProperty("envMapIrradiance",this.getAttribute("irradianceMap")),t.envMapRadiance&&e.setProperty("envMapRadiance",this.getAttribute("radianceMap")),t.envMapRadianceHalfGloss&&e.setProperty("envMapRadianceHalfGloss",this.getAttribute("radianceMapHalfGloss"))}},t}(n.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.playing=!0,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.tempVec=new n.Vector3,this.tempMatrix=new n.Matrix4,this.tempQuaternion=new n.Quaternion},t.prototype.onAttributesChanged=function(e){if(!this.playing){var t=this.getEntity();t instanceof o.default&&(this.getRuntimeData().position.copy(t.getPosition()),this.getRuntimeData().quaternion.copy(t.getQuaternion()))}},t.prototype.onEnable=function(){this.playing=!0},t.prototype.onDisable=function(){this.playing=!1;var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()))},t.prototype.onPostUpdate=function(){var e;if(this.hasRuntimeData()&&this.playing&&this.isEnabled()&&(e=this.getRuntimeData(),this.target&&this.target.runtimeData)){this.getEngine().needsRender=!0;var t=this.target.runtimeData;if(this.tempVec.setFromMatrixPosition(t.matrixWorld),e.parent?this.tempMatrix.getInverse(e.parent.matrixWorld):this.tempMatrix.identity(),this.tempVec.applyMatrix4(this.tempMatrix),this.local){e.lookAt(this.tempVec);var r=this.getEntity();r instanceof o.default&&e.quaternion.multiply(r.getQuaternion())}else e.lookAt(this.tempVec)}},t.prototype.onShutdown=function(){},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(37),s=.5,u=36,p=1,c=80,l=function(e){function t(){var t=e.call(this)||this;return t.createScene(),t}return i.__extends(t,e),t.prototype.setLightingFromThreeScene=function(e){var t=this;this.resetSceneLighting(),e.traverse(function(e){e instanceof n.Light&&t.scene.add(e.clone())}),this.captureScene()},t.prototype.setLightingFromScene=function(e){var t=this;this.resetSceneLighting(),e.getDescendantsByClass(o.default).forEach(function(e){e.isUnloaded()&&e.loadBase(),t.scene.add(e.getRuntimeData().clone())}),this.captureScene()},t.prototype.onAwake=function(){this.listenTo(this.getEntity(),"change:properties",this.onMaterialChanges)},t.prototype.onEnable=function(){this.captureScene()},t.prototype.onEntityLoaded=function(){this.captureScene()},t.prototype.onAttributesChanged=function(e){e.indexOf("captureTexture")!==-1&&this.captureScene()},t.prototype.onMaterialChanges=function(e){this.captureScene()},t.prototype.createScene=function(){this.camera=new n.OrthographicCamera(-s,s,s,-s,p,c),this.scene=new n.Scene,this.createGeometry(),this.scene.add(this.sphereMesh),this.scene.add(this.planeMesh),this.scene.add(this.camera),this.camera.position.z=.5*c,this.camera.position.y=.25*c,this.camera.position.x=.25*c,this.camera.lookAt(new n.Vector3(0,0,0)),this.planeMesh.lookAt(this.camera.position)},t.prototype.createGeometry=function(){this.geometry=new n.SphereBufferGeometry(s,u,u),this.planeGeometry=new n.PlaneBufferGeometry(2*s,2);var e=Math.sqrt(.5),t=this.planeGeometry.attributes.normal;t.array=new Float32Array([-1,1,0,1,1,0,-1,-1,0,1,-1,0]);for(var r=0;r=1&&(n-=1);var a=1-i;if(r&&na){var x=1-(n-a)/i;f+=e*E/t*Math.max(.5*Math.cos(x*Math.PI+Math.PI)+.5,0)}else f+=e*E/t;(f>=1||f<0)&&(f%=1,h=0,s||(f=.99999999,c.playingCurveAnimation=!1,c.getEngine().off("update",c.curveAnim,c),c.curveAnim=void 0),c.getEntity().trigger("endAnimateAlongCurve"));var S=u.curve,D=S.getUtoTmapping(f);if(d.position.copy(S.getPoint(D)),"toCurve"===o){var A=S.getTangent(D);m.set(0,-1,0),y.crossVectors(A,m),g.crossVectors(A,y),m.copy(d.position),m.add(A),v.lookAt(d.position,m,g),d.quaternion.setFromRotationMatrix(v)}else if("toNode"===o){var T=u.closed?S.points.length:S.points.length-1,M=Math.floor(D*T),R=Math.ceil(D*T)%S.points.length;M!==w&&(M>0?u.controlPoints[M].getQuaternionInWorldSpace(b):u.controlPoints[0].getQuaternionInWorldSpace(b)),R!==_&&(R>0?u.controlPoints[R].getQuaternionInWorldSpace(P):u.controlPoints[0].getQuaternionInWorldSpace(P));var C=D*T-M;d.quaternion.copy(b),d.quaternion.slerp(P,C)}}};r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5),t>0&&(this.playingCurveAnimation=!0,u.isCurveInit()?(this.curveAnim=S,this.getEngine().on("update",this.curveAnim,this)):u.on("curveInit",function(){c.curveAnim=S,c.getEngine().on("update",c.curveAnim,c)},this))}},t.prototype.onPauseCurveAnimation=function(){this.playingCurveAnimation=!1},t.prototype.onUnpauseCurveAnimation=function(){this.playingCurveAnimation=!0},t.prototype.animateToObject=function(e,t,r,i,o){var s=this,u=this.getEngine(),p=function(e){var p=s.getRuntimeData(),c=new a.Matrix4,l=0,d=0;r+i>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),r=.5,i=.5);var h,f=1-r-i,m=1/(r/2+i/2+f),y=new a.Vector3;y.copy(p.position);var g=e.position,v=e.quaternion;if(v&&o&&(h=new a.Quaternion,h.copy(p.quaternion)),e.updateMatrixWorld(!0),g.setFromMatrixPosition(e.matrixWorld),c.extractRotation(e.matrixWorld),v.setFromRotationMatrix(c),t>0){var b=function(e){if(!s.getEntity()||!s.isEnabled())return void u.off("update",b,s);s.getEngine().needsRender=!0,l+=e;var n=l/t,a=1-i;if(r&&na){var f=1-(n-a)/i;d+=e*m/t*Math.max(.5*Math.cos(f*Math.PI+Math.PI)+.5,0)}else d+=e*m/t;d=Math.min(d,1),(d>=1||d<0)&&(s.getEngine().off("update",b,s),s.getEntity().trigger("endAnimateToObject")),p.position.copy(y),p.position.lerp(g,d),v&&o&&(p.quaternion.copy(h),p.quaternion.slerp(v,d))};s.getEngine().on("update",b,s)}else p.position.copy(g),v&&p.quaternion.copy(v),s.getEntity().trigger("endAnimateToObject")},c=this.getEngine().getEntityById(e);c.runtimeData?p(c.runtimeData):(c.once("loadBase",function(){p(c.runtimeData)},this),c.load())},t.prototype.animateTranslation=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Vector3,h=new a.Vector3;h.copy(i);var f=h.length();if(u.updateMatrixWorld(),h.applyQuaternion(u.quaternion),h.normalize(),o){var m=(1-t-r)*e,y=.5*(t+r)*e;"middle"===o?(d.copy(i),d.multiplyScalar(-.5*(m+y)),u.position.add(d)):"end"===o&&(d.copy(i),d.multiplyScalar(-1*(m+y)),u.position.add(d))}if(e>0){var g=function(i){if(!s.getEntity()||!s.isEnabled())return void c.off("update",g,s);d.copy(h),s.getEngine().needsRender=!0,p+=i;var n=Math.min(p/e,1),a=1-r,o=e*a;if(t&&po){var y=1-(n-a)/r;d.multiplyScalar(i*f*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else d.multiplyScalar(i*f);p>=e&&(s.getEngine().off("update",g,s),s.getEntity().trigger("endAnimateTranslation")),u.position.add(d)};this.getEngine().on("update",g,this)}},t.prototype.animateRotation=function(e,t,r,i,o,s){var u=this,p=this.getRuntimeData();p.position.copy(this.getEntity().getPosition()),p.quaternion.copy(this.getEntity().getQuaternion()),p.scale.copy(this.getEntity().getScale());var c=0,l=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var d=e*t,h=new a.Quaternion,f=new a.Quaternion,m=new a.Vector3,y=new a.Euler(i.x,i.y,i.z,s);if(h.setFromEuler(y),f.copy(h),p.updateMatrixWorld(),o){var g=(1-t-r)*e,v=.5*(t+r)*e;"middle"===o?(m.copy(i),m.multiplyScalar(-.5*(g+v)),y.set(m.x,m.y,m.z),h.setFromEuler(y),p.quaternion.multiply(h)):"end"===o&&(m.copy(i),m.multiplyScalar(-1*(g+v)),y.set(m.x,m.y,m.z),h.setFromEuler(y),p.quaternion.multiply(h))}if(e>0){var b=function(i){if(!u.getEntity()||!u.isEnabled())return void l.off("update",b,u);var n=1;u.getEngine().needsRender=!0,c+=i;var a=Math.min(c/e,1),o=1-r,s=e*o;if(t&&cs){var y=1-(a-o)/r;n*=i*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0)}else n*=i;c>=e&&(u.getEngine().off("update",b,u),u.getEntity().trigger("endAnimateTranslation")),h.set(0,0,0,1),h.slerp(f,n),p.quaternion.multiply(h)};this.getEngine().on("update",b,this)}},t.prototype.animateScale=function(e,t,r,i,o){var s=this,u=this.getRuntimeData();u.position.copy(this.getEntity().getPosition()),u.quaternion.copy(this.getEntity().getQuaternion()),u.scale.copy(this.getEntity().getScale());var p=0,c=this.getEngine();t+r>1&&(n.default.warn("Ease-In and Ease-Out value can't total more than 1.0."),t=.5,r=.5);var l=e*t,d=new a.Vector3;if(u.updateMatrixWorld(),o){var h=(1-t-r)*e,f=.5*(t+r)*e;"middle"===o?(d.copy(i),d.multiplyScalar(-.5*(h+f)),u.scale.add(d)):"end"===o&&(d.copy(i),d.multiplyScalar(-1*(h+f)),u.scale.add(d))}if(e>0){var m=function(n){if(!s.getEntity()||!s.isEnabled())return void c.off("update",m,s);d.copy(i),s.getEngine().needsRender=!0,p+=n;var a=Math.min(p/e,1),o=1-r,h=e*o;if(t&&ph){var y=1-(a-o)/r;d.multiplyScalar(n*Math.max(.5*Math.cos(y*Math.PI+Math.PI)+.5,0))}else d.multiplyScalar(n);p>=e&&(s.getEngine().off("update",m,s),s.getEntity().trigger("endAnimateTranslation")),u.scale.add(d)};this.getEngine().on("update",m,this)}},t}(o.default);t.default=s},function(e,t,r){"use strict";function i(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1}function n(e,t,r,i){var n=e.x+(t.x-e.x)*r,a=e.y+(t.y-e.y)*r,o=e.z+(t.z-e.z)*r;i.set(n,a,o)}function a(e){return e.object.visible&&"Mesh"===e.object.type}Object.defineProperty(t,"__esModule",{value:!0});var o=r(0),s=r(1),u=r(2),p=r(22),c=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.speed=.8,t.zoomSteps=5,t.zoomBuffer=.1,t.time=-1,t.isMouseDown=!1,t.targetZoom=0,t.srcZoom=0,t.lastFocusPosition=new s.Vector3(-1,-1,-1),t}return o.__extends(t,e),t.prototype.onDisable=function(){this.interrupt()},t.prototype.onUpdate=function(e){if(this.isEnabled()&&!(this.time<0)){var t=this.getRuntimeData(),r=i(1-1/(this.speed/this.time));n(this.srcLook,this.targetLook,r,this.currentLook),t.lookAt(this.currentLook);var a=this.srcZoom+(this.targetZoom-this.srcZoom)*r;this.zoomComponent.lerpZoom(a),this.time-=e,this.time<=0&&this.onEnd(),this.getEngine().needsRender=!0}},t.prototype.onStartup=function(){if(this.orbitCam=this.getEntity().getComponentByScriptName("Orbit Camera"),!this.orbitCam)throw new Error("Focus component requires OrbitCamera on the entity: "+this.getId());var e=this.getEngine(),t=this.getEntity();p.isMobile()?(this.listenTo(e,"touchStart",this.onMouseDown),this.listenTo(e,"touchMove",this.onMouseMove),this.listenTo(e,"touchEnd",this.onMouseUp),this.listenTo(e,"doubleTap",this.onDoubleClick)):(this.listenTo(e,"mouseScroll",this.interrupt),this.listenTo(e,"keyDown",this.interrupt),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseUp",this.onMouseUp),this.listenTo(e,"doubleClick",this.onDoubleClick)),this.listenTo(t,"resetOrbitCamera",this.onReset),this.zoomComponent=t.getComponentByScriptId("camera_zoom"),this.zoomComponent||(this.zoomComponent=t.addComponent("camera_zoom"))},t.prototype.onReset=function(){this.orbitCam.enable(),this.time=-1},t.prototype.onMouseDown=function(){this.isEnabled()&&(this.isMouseDown=!0)},t.prototype.onMouseUp=function(){this.isMouseDown=!1},t.prototype.onMouseMove=function(){this.isMouseDown&&this.interrupt()},t.prototype.onDoubleClick=function(e){if(this.isEnabled()&&this.hasRuntimeData()){this.raycaster||this.initializeRaycaster();var t=p.isMobile()?this.getInput().touchPositionPercent.x:e.scenePercentX,r=p.isMobile()?this.getInput().touchPositionPercent.y:e.scenePercentY;this.mouseVector.set(2*t-1,2*-r+1);var i=this.getIntersection(this.mouseVector);this.interrupt();var n=this.time>0?this.currentLook:this.orbitCam.pivotPoint.position;this.srcLook.copy(n),i?this.lookAtPoint(i.point):this.resetToOrigin(),this.time=this.speed,this.srcZoom=this.zoomComponent.getZoomLevel()}},t.prototype.lookAtPoint=function(e){this.orbitCam.disable(),this.targetLook.copy(e),this.lastFocusPosition.x===-1&&this.lastFocusPosition.copy(this.targetLook),this.targetLook.distanceTo(this.lastFocusPosition)0&&this.onEnd()},t.prototype.onEnd=function(){this.time=-1,this.orbitCam.enable(),this.orbitCam.setPivotPosition(this.currentLook),this.orbitCam.setOrbitDistance(this.getRuntimeData().position.distanceTo(this.currentLook)),this.orbitCam.resetOrbitRotation()},t.prototype.getIntersection=function(e){this.raycaster.far=this.orbitCam.getOrbitDistance()+1,this.raycaster.setFromCamera(e,this.getRuntimeData());var t=this.raycaster.intersectObjects(this.getRootThreeObject().children,!0).filter(a);return t.length>0?t[0]:void 0},t}(u.default);t.default=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(36),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.position=new n.Vector2,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"mouseDown",this.onMouseDown),this.listenTo(e,"mouseMove",this.onMouseMove),this.listenTo(e,"mouseScroll",this.onMouseScroll)},t.prototype.onMouseDown=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=e.scenePercentX,this.position.y=e.scenePercentY;var r=t?o.orbitEvents.startOrbit:void 0;r&&this.trigger(r,this.position)}},t.prototype.onMouseMove=function(e){if(this.isEnabled()){var t=this.getInput().mouseButtonDown("left");this.position.x=t?e.scenePercentX:e.scenePercentDeltaX,this.position.y=t?e.scenePercentY:e.scenePercentDeltaY;var r=this.getInput().mouseButtonDown("right"),i=r?o.orbitEvents.pan:t?o.orbitEvents.orbit:void 0;i&&this.trigger(i,this.position)}},t.prototype.onMouseScroll=function(e){this.isEnabled()&&this.trigger(o.orbitEvents.zoom,e)},t}(a.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(36),s=20,u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.isOrbiting=!1,t.isPanning=!1,t.isZooming=!1,t.panMidpoint=new n.Vector2,t.lastPanMidpoint=new n.Vector2,t.panDelta=new n.Vector2,t.lastZoomDistance=0,t}return i.__extends(t,e),t.prototype.onStartup=function(){var e=this.getEngine();this.listenTo(e,"touchStart",this.cancelActions),this.listenTo(e,"touchCancel",this.cancelActions),this.listenTo(e,"touchLeave",this.cancelActions),this.listenTo(e,"touchEnd",this.cancelActions),this.listenTo(e,"touchMove",this.onTouchMove)},t.prototype.cancelActions=function(){this.isOrbiting=!1,this.isPanning=!1,this.isZooming=!1,this.panMidpoint.set(0,0),this.lastPanMidpoint.set(0,0),this.panDelta.set(0,0),this.lastZoomDistance=0},t.prototype.onTouchMove=function(e){this.isEnabled()&&e.touches.length&&(1===e.touches.length?this.onSingleTouchMove(e.touches[0]):this.onMultiTouchMove(e.touches[0],e.touches[1]))},t.prototype.onSingleTouchMove=function(e){var t=new n.Vector2(e.scenePercentX,e.scenePercentY);this.isOrbiting?this.orbit(t):(this.isOrbiting=!0,this.startOrbit(t))},t.prototype.onMultiTouchMove=function(e,t){var r=new n.Vector2(e.scenePercentX,e.scenePercentY),i=new n.Vector2(t.scenePercentX,t.scenePercentY);this.pan(r,i),this.zoom(r,i)},t.prototype.startOrbit=function(e){this.trigger(o.orbitEvents.startOrbit,e)},t.prototype.orbit=function(e){this.trigger(o.orbitEvents.orbit,e)},t.prototype.pan=function(e,t){this.panMidpoint.addVectors(e,t),this.panMidpoint.multiplyScalar(.5),this.isPanning||(this.isPanning=!0,this.lastPanMidpoint.copy(this.panMidpoint)),this.panDelta.subVectors(this.panMidpoint,this.lastPanMidpoint),this.panDelta.length()&&this.trigger(o.orbitEvents.pan,this.panDelta),this.lastPanMidpoint.copy(this.panMidpoint),this.panDelta.set(0,0)},t.prototype.zoom=function(e,t){var r=e.distanceTo(t);if(r){this.isZooming||(this.isZooming=!0,this.lastZoomDistance=r);var i=r-this.lastZoomDistance;i&&this.trigger(o.orbitEvents.zoom,i*s),this.lastZoomDistance=r}},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxScene=void 0,t.cameras=[null,null,null,null,null,null],t}return i.__extends(t,e),t.prototype.onAttributesChanged=function(e){if(e.indexOf("inputTexture")!==-1){var t=this.getPreviousAttribute("inputTexture");this.unregisterDependency(t),this.registerDependency(this.inputTexture),this.updateTexture()}},t.prototype.onStartup=function(){this.skyboxScene=new n.Scene,this.registerDependency(this.inputTexture),this.initCameras(),this.createSkybox()},t.prototype.onEntityReady=function(){this.updateTexture()},t.prototype.onShutdown=function(){this.inputTexture&&(this.unregisterDependency(this.inputTexture),this.inputTexture.off("load",this.renderToCube,this)),this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.equirectMaterial&&this.equirectMaterial.dispose(),this.skyboxScene=void 0,this.skyboxMesh=void 0,this.inputTexture=void 0},t.prototype.updateTexture=function(){this.inputTexture&&!this.getEntity().isUnloaded()&&(this.inputTexture.off("load",this.renderToCube,this),this.inputTexture.when("load",this.renderToCube,this),this.inputTexture.isBaseUnloaded()&&this.inputTexture.load())},t.prototype.createSkybox=function(){var e=n.ShaderLib.equirect;e.uniforms.tFlip.value=1,this.equirectMaterial=new n.ShaderMaterial({fragmentShader:e.fragmentShader,vertexShader:e.vertexShader,uniforms:e.uniforms,depthWrite:!1,side:n.BackSide}),this.skyboxGeometry=new n.BoxGeometry(100,100,100,1,1,1),this.skyboxMesh=new n.Mesh(this.skyboxGeometry,this.equirectMaterial),this.skyboxMesh.frustumCulled=!1,this.skyboxMesh.castShadow=!1,this.skyboxMesh.receiveShadow=!1,this.isEnabled()&&this.skyboxScene.add(this.skyboxMesh)},t.prototype.initCameras=function(){var e=90,t=1;this.cameras[0]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[0].up.set(0,-1,0),this.cameras[0].lookAt(new n.Vector3(1,0,0)),this.skyboxScene.add(this.cameras[0]),this.cameras[1]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[1].up.set(0,-1,0),this.cameras[1].lookAt(new n.Vector3(-1,0,0)),this.skyboxScene.add(this.cameras[1]),this.cameras[2]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[2].up.set(0,0,1),this.cameras[2].lookAt(new n.Vector3(0,1,0)),this.skyboxScene.add(this.cameras[2]),this.cameras[3]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[3].up.set(0,0,-1),this.cameras[3].lookAt(new n.Vector3(0,-1,0)),this.skyboxScene.add(this.cameras[3]),this.cameras[4]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[4].up.set(0,-1,0),this.cameras[4].lookAt(new n.Vector3(0,0,1)),this.skyboxScene.add(this.cameras[4]),this.cameras[5]=new n.PerspectiveCamera(e,t,1,1e3),this.cameras[5].up.set(0,-1,0),this.cameras[5].lookAt(new n.Vector3(0,0,-1)),this.skyboxScene.add(this.cameras[5])},t.prototype.renderToCube=function(){if(this.hasRuntimeData()){this.equirectMaterial.uniforms.tEquirect.value=this.inputTexture.getThreeTexture();var e=this.getRuntimeData(),t=this.getThreeRenderer();e.texture.generateMipmaps=!1,t.setViewport(0,0,e.width,e.height);for(var r=0;r<5;r++)e.activeCubeFace=r,t.render(this.skyboxScene,this.cameras[r],e);e.texture.generateMipmaps=this.getEntity().getProperty("useMipmap"),e.activeCubeFace=5,t.render(this.skyboxScene,this.cameras[5],e)}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(3),a=r(1),o=r(2),s=.0174532925,u={"+X":new a.Vector3(1,0,0),"-X":new a.Vector3(-1,0,0),"+Y":new a.Vector3(0,1,0),"-Y":new a.Vector3(0,-1,0),"+Z":new a.Vector3(0,0,1),"-Z":new a.Vector3(0,0,-1)},p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.time=0,t.target=new a.Quaternion,t.tempQuat=new a.Quaternion,t}return i.__extends(t,e),t.prototype.getRightVector=function(e){return new a.Vector3(e.elements[0],e.elements[1],e.elements[2])},t.prototype.getUpVector=function(e){return new a.Vector3(e.elements[4],e.elements[5],e.elements[6])},t.prototype.getForwardVector=function(e){return new a.Vector3(e.elements[8],e.elements[9],e.elements[10])},t.prototype.setRightVector=function(e,t){e.elements[0]=t.x,e.elements[1]=t.y,e.elements[2]=t.z},t.prototype.setUpVector=function(e,t){e.elements[4]=t.x,e.elements[5]=t.y,e.elements[6]=t.z},t.prototype.setForwardVector=function(e,t){e.elements[8]=t.x,e.elements[9]=t.y,e.elements[10]=t.z},t.prototype.setAxes=function(e,t,r){var i=u[e],o=u[t];if(!i)return n.default.error("No Up Axis available For ",e);if(!o)return n.default.error("No Forward Axis available For ",t);var s=new a.Vector3,p=new a.Matrix4;this.setUpVector(p,i),this.setForwardVector(p,o),s.crossVectors(i,o),this.setRightVector(p,s),this.target.setFromRotationMatrix(p),r?this.time=this.speed:(this.setRotation(this.target),this.getEntity().trigger("axis_transition_complete"))},t.prototype.eulerFromObject=function(e){var t=isNaN(e.x)?0:e.x*s,r=isNaN(e.y)?0:e.y*s,i=isNaN(e.z)?0:e.z*s,n=new a.Euler(t,r,i);return n.order="YXZ",n},t.prototype.rotateOnWorldAxis=function(e,t,r){if(!(this.time>0)){var i=this.getRuntimeData(),n=new a.Vector3,o=new a.Vector3;n.copy(i.position),o.copy(i.scale),i.position.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix();var u=(new a.Matrix4).makeRotationX((e.x||0)*s),p=(new a.Matrix4).makeRotationY((e.y||0)*s),c=(new a.Matrix4).makeRotationZ((e.z||0)*s);c.multiply(p),c.multiply(u),t&&c.multiply(i.matrix),this.target.setFromRotationMatrix(c),r?(this.setRotation(this.target),this.getEngine().needsRender=!0):this.time=this.speed,i.position.copy(n),i.scale.copy(o)}},t.prototype.rotateToEuler=function(e){this.target.setFromEuler(this.eulerFromObject(e)),this.time=this.speed},t.prototype.setLocalRotation=function(e){this.time=0,this.target.setFromEuler(this.eulerFromObject(e)),this.setRotation(this.target)},t.prototype.setRotation=function(e){this.getEntity().setQuaternion(e.x,e.y,e.z,e.w),this.hasRuntimeData()&&!this.getRuntimeData().quaternion.equals(e)&&this.getRuntimeData().quaternion.copy(e),this.getEngine().needsRender=!0},t.prototype.getSign=function(e){return e>0?"+":"-"},t.prototype.getAxes=function(e){var t=this.getRuntimeData().matrix,r=this.getUpVector(t).normalize(),i=this.getForwardVector(t).normalize(),n=Math.abs(r.x),a=Math.abs(r.y),o=Math.abs(r.z),s=n=0&&this.hasRuntimeData()&&(this.time-=e,this.tempQuat.copy(this.getRuntimeData().quaternion),this.tempQuat.slerp(this.target,Math.min(1,Math.max(0,1-1/(this.speed/this.time)))),this.getEntity().setQuaternion(this.tempQuat.x,this.tempQuat.y,this.tempQuat.z,this.tempQuat.w),this.getEngine().needsRender=!0,this.time<0&&(this.setRotation(this.target),this.getEntity().trigger("axis_transition_complete")))},t}(o.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.framesElapsed=0,t.reflectionNormal=new n.Vector3(0,1,0),t.reflectionPlane=new n.Plane,t.clipPlane=new n.Vector4,t.reflectionPosition=new n.Vector3,t.cameraWorldPosition=new n.Vector3,t.rotationMatrix=new n.Matrix4,t.lookAtPosition=new n.Vector3(0,0,-1),t.up=new n.Vector3(0,1,0),t.perspectiveCamera=null,t.orthoCamera=null,t}return i.__extends(t,e),t.prototype.captureScene=function(e,t){if(!t)throw new Error("Call to ReflectionCapture.captureScene without specifying a camera.");this.updateReflection(t);var r=this.captureTexture?this.captureTexture.runtimeData:null,i=r?r:this.tempRenderTexture.runtimeData;this.getRenderer().renderView(e,this.reflectionCamera,{renderTarget:i,clearDepth:!0,enableShadows:!1,enablePreRenderFunctions:!1})},t.prototype.onEntityReady=function(){this.initCameras(),this.initTexture()},t.prototype.onAttributesChanged=function(e){e.indexOf("captureTexture")!==-1&&this.initTexture()},t.prototype.onPreRenderView=function(e,t){this.isEnabled()&&(this.framesElapsed>=this.updateFrameInterval?(this.captureScene(e,t),this.framesElapsed=0):this.framesElapsed++)},t.prototype.createTempRenderTexture=function(){this.tempRenderTexture=this.getEngine().createRenderTexture2d({width:512,height:512,format:"rgba",type:"uByte"},"render_tex_reflection"),this.tempRenderTexture.load()},t.prototype.initTexture=function(){var e=this;this.captureTexture?(this.captureTexture.when("load",function(){e.tempRenderTexture&&e.tempRenderTexture.unload()}),this.captureTexture.isBaseUnloaded()&&this.captureTexture.load()):this.createTempRenderTexture()},t.prototype.initCameras=function(){this.captureTexture&&this.captureTexture.load(),this.perspectiveCamera=new n.PerspectiveCamera,this.orthoCamera=new n.OrthographicCamera(-1,1,-1,1)},t.prototype.updateReflection=function(e){if(this.isEnabled()){var t=function(e){return e<0?-1:1};this.getEntity().runtimeData.updateMatrixWorld(),e.updateMatrixWorld(!1),this.reflectionPosition.setFromMatrixPosition(this.getEntity().runtimeData.matrixWorld),this.cameraWorldPosition.setFromMatrixPosition(e.matrixWorld),this.rotationMatrix.extractRotation(this.getEntity().runtimeData.matrixWorld),this.reflectionNormal.set(0,1,0),this.reflectionNormal.applyMatrix4(this.rotationMatrix);var r=this.reflectionPosition.clone().sub(this.cameraWorldPosition),i=r.reflect(this.reflectionNormal).negate();i.add(this.reflectionPosition),this.rotationMatrix.extractRotation(e.matrixWorld),this.lookAtPosition.set(0,0,-1),this.lookAtPosition.applyMatrix4(this.rotationMatrix),this.lookAtPosition.add(this.cameraWorldPosition);var a=this.reflectionPosition.clone().sub(this.lookAtPosition),o=a.reflect(this.reflectionNormal).negate();o.add(this.reflectionPosition),this.up.set(0,-1,0),this.up.applyMatrix4(this.rotationMatrix);var s=this.up.reflect(this.reflectionNormal).negate();if(e instanceof n.PerspectiveCamera&&this.perspectiveCamera)this.perspectiveCamera.aspect=e.aspect,this.perspectiveCamera.fov=e.fov,this.perspectiveCamera.near=e.near,this.perspectiveCamera.far=e.far,this.reflectionCamera=this.perspectiveCamera;else{if(!(e instanceof n.OrthographicCamera&&this.orthoCamera))return;this.orthoCamera.left=e.left,this.orthoCamera.right=e.right,this.orthoCamera.top=e.top,this.orthoCamera.bottom=e.bottom,this.orthoCamera.near=e.near,this.orthoCamera.far=e.far,this.reflectionCamera=this.orthoCamera}this.reflectionCamera.position.copy(i),this.reflectionCamera.up=s,this.reflectionCamera.lookAt(o),this.reflectionCamera.updateProjectionMatrix(),this.reflectionCamera.updateMatrixWorld(!1),this.reflectionCamera.matrixWorldInverse.getInverse(this.reflectionCamera.matrixWorld),this.reflectionPlane.setFromNormalAndCoplanarPoint(this.reflectionNormal,this.reflectionPosition),this.reflectionPlane.applyMatrix4(this.reflectionCamera.matrixWorldInverse),this.clipPlane.set(this.reflectionPlane.normal.x,this.reflectionPlane.normal.y,this.reflectionPlane.normal.z,this.reflectionPlane.constant);var u=new n.Vector4,p=this.reflectionCamera.projectionMatrix;p.copy(e.projectionMatrix),p.elements[8]*=-1,u.x=(t(this.clipPlane.x)+p.elements[8])/p.elements[0],u.y=(t(this.clipPlane.y)+p.elements[9])/p.elements[5],u.z=-1,u.w=(1+p.elements[10])/p.elements[14];var c=this.clipPlane.multiplyScalar(2/this.clipPlane.dot(u));p.elements[2]=c.x,p.elements[6]=c.y,p.elements[10]=c.z+1-this.clipBias,p.elements[14]=c.w}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(15),o=r(11),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.instance=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"createRemoteInstance",this.createRemoteInstance),this.listenTo(this.getGlobalEvents(),"createRemoteInstance",this.createRemoteInstance)},t.prototype.createRemoteInstance=function(e){var t=this;if(this.isEnabled()){var r=this.getEngine();r.fetchRemoteRepresentationsFromBox(e).then(function(i){var n=i.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json");r.resourceLoader.load(n,a.default.ENTITIES,{}).on(o.default.LOAD,function(i){var n=i.filter(function(e){return"prefab"===e.type}),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)});a.length||(r.addEntities(i),a=n.filter(function(e){return r.getAssetById(e.id)}).map(function(e){return r.getAssetById(e.id)})),t.recreateInstance(a,e)})})}},t.prototype.recreateInstance=function(e,t){var r=this,i=this.getEngine();if(this.instance&&(this.instance.destroy(),this.instance=null),e.length>1)this.instance=i.createNode(),e.forEach(function(e){var t=i.getAssetById(e.id);r.instance.addChild(t.createInstance())});else{var n=i.getAssetById(e[0].id);this.instance=n.createInstance()}this.instance&&this.getEntity().addChild(this.instance),this.getEntity().trigger("remoteInstanceCreated",t),this.getGlobalEvents().trigger("remoteInstanceCreated",t)},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(2),s=r(22),u=r(5),p=r(190),c=r(14),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.threeRenderer=null,t.caps={},t.antialias=!1,t.preserveDrawingBuffer=!0,t.precision="highp",t.autoClear=!1,t.devicePixelRatio=1,t.shadowsEnabled=!0,t.shadowsEnabledMobile=!1,t.shadowType=n.PCFSoftShadowMap,t.shadowReverseSided=!1,t.maxTextureSize2d=Number.MAX_SAFE_INTEGER,t.maxTextureSizeCube=Number.MAX_SAFE_INTEGER,t.clearColor=new n.Color,t.clearAlpha=0,t.renderOnDemand=!0,t}return i.__extends(t,e),t.prototype.onAwake=function(){this.canvas=this.getEngine().canvas,this.initDefaultRenderer(),this.getEngine().setRenderer(this);var e=this.getThreeRenderer();e.gammaInput=!1,e.gammaOutput=!0},t.prototype.onStartup=function(){this.listenTo(this.getEngine(),"resize",this.onContainerResize),this.getEngine().renderOnDemand=this.renderOnDemand,this.shadowsEnabledMobile||(this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled),this.applyRenderSettings()},t.prototype.onShutdown=function(){this.threeRenderer&&(this.threeRenderer.context=null),this.threeRenderer=null,this.canvas=void 0},t.prototype.onAttributesChanged=function(e){var t=!1;e.indexOf("shadowsEnabledMobile")!==-1&&(t=!0),this.shadowsEnabled=s.isMobile()?this.shadowsEnabledMobile&&this.shadowsEnabled:this.shadowsEnabled,this.applyRenderSettings(),this.getEngine().renderOnDemand=this.renderOnDemand,e.indexOf("clearAlpha")!==-1&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),e.indexOf("clearColor")!==-1&&this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),e.indexOf("gammaOutput")!==-1&&(t=!0),e.indexOf("gammaInput")!==-1&&(t=!0),e.indexOf("shadowsEnabled")!==-1&&(t=!0),e.indexOf("shadowType")!==-1&&(this.shadowType=parseInt(String(this.shadowType),10),t=!0),e.indexOf("devicePixelRatio")!==-1&&this.onContainerResize(),t&&(a.default.info("Rebuilding materials!!!"),this.getEngine().trigger("rebuildMaterials"))},t.prototype.getGPUCapability=function(e){return this.caps[e]},t.prototype.getMaxTextureSize2d=function(){return this.maxTextureSize2d?Math.min(this.maxTextureSize2d,this.getGPUCapability("MAX_TEXTURE_SIZE")):this.getGPUCapability("MAX_TEXTURE_SIZE")},t.prototype.getMaxTextureSizeCube=function(){return this.maxTextureSizeCube?Math.min(this.maxTextureSizeCube,this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")):this.getGPUCapability("MAX_CUBE_MAP_TEXTURE_SIZE")},t.prototype.onPreRender=function(){this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(!0,!0,!0),this.threeRenderer.setViewport(0,0,this.getWidth(),this.getHeight())},t.prototype.renderView=function(e,t,r){void 0===r&&(r={});var i;if(t){r.enablePreRenderFunctions&&this.getEngine().trigger("preRenderView",e,t,r); +var n=this.getCanvas().style;void 0===r.opacity||r.viewPort&&(r.viewPort.width!==this.getWidth()||r.viewPort.height!==this.getHeight())?1!==parseFloat(n.opacity)&&(n.opacity="1.0"):parseFloat(n.opacity)!==r.opacity&&(n.opacity=""+r.opacity),r.renderTarget?this.threeRenderer.setRenderTarget(r.renderTarget):this.threeRenderer.setRenderTarget(null),this.threeRenderer.clear(r.clearColor,r.clearDepth,r.clearStencil),r.viewPort&&(i=c.default.sharedUniforms.screenDimensions,i.value.x=r.viewPort.x,i.value.y=r.viewPort.y,i.value.z=r.viewPort.width*this.devicePixelRatio,i.value.w=r.viewPort.height*this.devicePixelRatio,this.threeRenderer.setViewport(r.viewPort.x,r.viewPort.y,r.viewPort.width,r.viewPort.height));var a=r.effect?r.effect:this.threeRenderer;r.renderTarget?a.render(e,t,r.renderTarget,!1):a.render(e,t),this.getEngine().trigger("postRenderView",e,t,r)}},t.prototype.getWidth=function(){return this.canvas.clientWidth?this.canvas.clientWidth:this.canvas.width/this.devicePixelRatio},t.prototype.getHeight=function(){return this.canvas.clientHeight?this.canvas.clientHeight:this.canvas.height/this.devicePixelRatio},t.prototype.getCanvasWidth=function(){return this.canvas.width},t.prototype.getCanvasHeight=function(){return this.canvas.height},t.prototype.getCanvas=function(){return this.threeRenderer.domElement},t.prototype.onContainerResize=function(){if(this.canvas.parentElement){var e=this.canvas.parentElement.clientWidth,t=this.canvas.parentElement.clientHeight;if(this.threeRenderer.setPixelRatio(this.devicePixelRatio),s.isIOS()){var r=this.canvas;this.threeRenderer.setSize(e,t,!1),r.style.width=e+1+"px",r.style.height=t+1+"px",setTimeout(function(){r.style.width=e+"px",r.style.height=t+"px"},100)}else this.threeRenderer.setSize(e,t,!0);this.getEngine().trigger("rendererResize")}else{var i=this.canvas.width/this.devicePixelRatio,n=this.canvas.height/this.devicePixelRatio;this.threeRenderer.setPixelRatio(this.devicePixelRatio),this.threeRenderer.setSize(i,n,!0)}},t.prototype.storeGpuCaps=function(){var e=this.threeRenderer.getContext();a.default.info("WebGL VENDOR is "+e.getParameter(e.VENDOR)),a.default.info("WebGL SHADING_LANGUAGE_VERSION is "+e.getParameter(e.SHADING_LANGUAGE_VERSION)),a.default.info("WebGL RENDERER is "+e.getParameter(e.RENDERER));var t=e.FRAGMENT_SHADER,r=e.LOW_FLOAT,i=e.MEDIUM_FLOAT,n=e.HIGH_FLOAT,o=e.getShaderPrecisionFormat(t,r);if(a.default.info("Fragment Shader lowp is "+o.precision),o=e.getShaderPrecisionFormat(t,i),a.default.info("Fragment Shader mediump is "+o.precision),o=e.getShaderPrecisionFormat(t,n),a.default.info("Fragment Shader highp is "+o.precision),!navigator.isCocoonJS){this.caps.MAX_COMBINED_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_CUBE_MAP_TEXTURE_SIZE=0,this.caps.MAX_FRAGMENT_UNIFORM_VECTORS=0,this.caps.MAX_RENDERBUFFER_SIZE=0,this.caps.MAX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_TEXTURE_SIZE=0,this.caps.MAX_VARYING_VECTORS=0,this.caps.MAX_VERTEX_ATTRIBS=0,this.caps.MAX_VERTEX_TEXTURE_IMAGE_UNITS=0,this.caps.MAX_VERTEX_UNIFORM_VECTORS=0,this.caps.MAX_VIEWPORT_DIMS=0,this.caps.ALIASED_POINT_SIZE_RANGE=0,this.caps.ALIASED_LINE_WIDTH_RANGE=0,this.caps.SAMPLES=0,this.caps.SAMPLE_BUFFERS=0,this.caps.RED_BITS=0,this.caps.GREEN_BITS=0,this.caps.BLUE_BITS=0,this.caps.ALPHA_BITS=0,this.caps.DEPTH_BITS=0,this.caps.STENCIL_BITS=0,this.caps.SUBPIXEL_BITS=0,this.caps.COMPRESSED_TEXTURE_FORMATS=0,this.caps=u.map(this.caps,function(t,r){return e.getParameter(e[r])}),this.caps.EXTENSIONS=e.getSupportedExtensions();var s=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic");this.caps.maxAnisotropy=s?e.getParameter(s.MAX_TEXTURE_MAX_ANISOTROPY_EXT):0,a.default.info("GPU Capabilities:",this.caps)}},t.prototype.initDefaultRenderer=function(){if(!p.default.isWebGLEnabled())throw new Error("WebGL is not supported, no fallbacks available.");this.threeRenderer=new n.WebGLRenderer({canvas:this.canvas,antialias:this.antialias,preserveDrawingBuffer:this.preserveDrawingBuffer,alpha:!0,precision:this.precision,logarithmicDepthBuffer:this.logarithmicDepthBuffer}),this.threeRenderer.physicallyCorrectLights=!0,this.threeRenderer.setPixelRatio(this.devicePixelRatio>0?this.devicePixelRatio:window.devicePixelRatio),this.storeGpuCaps()},t.prototype.applyRenderSettings=function(){var e=this;this.threeRenderer&&(u.forEach(this,function(t,r){void 0!==e.threeRenderer[r]&&(e.threeRenderer[r]=t)}),this.devicePixelRatio>0||(this.devicePixelRatio=window.devicePixelRatio),this.threeRenderer.setClearColor(this.clearColor,this.clearAlpha),this.shadowsEnabled&&(this.threeRenderer.shadowMap.enabled=!0,this.threeRenderer.shadowMap.type=this.shadowType,this.threeRenderer.shadowMap.renderReverseSided=this.shadowReverseSided))},t}(o.default);t.default=l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(10),s=new n.Vector3,u=new n.Euler,p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.quaternion=new n.Quaternion,t.currentGlobalQuaternion=new n.Quaternion,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.rotate=this.autoRotate,this.getEntity().on("startRotate",this.onStartRotate,this),this.getEntity().on("stopRotate",this.onStopRotate,this),this.getEntity().on("toggleRotate",this.onToggleRotate,this)},t.prototype.onShutdown=function(){this.getEntity().off("startRotate",this.onStartRotate,this),this.getEntity().off("stopRotate",this.onStopRotate,this),this.getEntity().off("toggleRotate",this.onToggleRotate,this)},t.prototype.onEnable=function(){this.rotate=this.autoRotate,this.initRotation()},t.prototype.onDisable=function(){var e=this.getEntity();e instanceof o.default&&(this.getRuntimeData().position.copy(e.getPosition()),this.getRuntimeData().quaternion.copy(e.getQuaternion()),this.rotate=!1)},t.prototype.onAttributesChanged=function(e){e.indexOf("rotation")&&this.rotation&&this.initRotation()},t.prototype.onEntityReady=function(){this.initialQuaternion=new n.Quaternion,this.initialQuaternion.copy(this.getRuntimeData().quaternion),this.initRotation()},t.prototype.onUpdate=function(e){this.rotate&&this.isEnabled()&&(this.getEngine().needsRender=!0,this.getRuntimeData()&&this.rotation&&(s.copy(this.rotation).multiplyScalar(e),u.set(s.x,s.y,s.z),this.quaternion.setFromEuler(u),this.local?this.getRuntimeData().quaternion.multiply(this.quaternion):(this.currentGlobalQuaternion.multiply(this.quaternion),this.getRuntimeData().quaternion.multiplyQuaternions(this.currentGlobalQuaternion,this.initialQuaternion))))},t.prototype.initRotation=function(){u.set(this.rotation.x,this.rotation.y,this.rotation.z),this.local?this.getRuntimeData().quaternion.copy(this.initialQuaternion):this.currentGlobalQuaternion.set(0,0,0,1)},t.prototype.onStartRotate=function(){this.rotate=!0},t.prototype.onStopRotate=function(){this.rotate=!1},t.prototype.onToggleRotate=function(){this.rotate=!this.rotate},t}(a.default);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"change:properties",this.onPropertiesChanged),this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onAttributesChanged=function(e){e.indexOf("size")!==-1&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t.prototype.onDisable=function(){this.getEntity().setScale(1,1,1)},t.prototype.onEnable=function(){this.getEntity().scaleToSize(this.size)},t.prototype.onPropertiesChanged=function(e){e.hasOwnProperty("bounds")&&this.isEnabled()&&this.getEntity().scaleToSize(this.size)},t}(n.default);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(236),s=r(235),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.autoLoad=!0,t.uniforms=null,t.noiseMat=null,t.initialized=!1,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.listenTo(this.getEntity(),"changeNoiseValues",this.changeNoiseValues),this.listenTo(this.getEntity(),"renderNoise",this.changeNoiseValues),this.uniforms={time:{type:"f",value:1},scale:{type:"v2",value:this.scale},offset:{type:"v2",value:this.offset},layerAmplitude:{type:"v4",value:this.layerAmplitude},layerScale:{type:"v4",value:this.layerScale}},this.noiseMat=new n.ShaderMaterial({uniforms:this.uniforms,vertexShader:o,fragmentShader:s}),this.cameraRTT=new n.OrthographicCamera(-.5,.5,.5,-.5,-10,10),this.cameraRTT.position.z=1,this.sceneRTT=new n.Scene,this.sceneRTT.add(this.cameraRTT),this.quadGeo=new n.PlaneGeometry(1,1),this.quadRTT=new n.Mesh(this.quadGeo,this.noiseMat),this.quadRTT.position.z=-5,this.sceneRTT.add(this.quadRTT),this.initialized=!0},t.prototype.onShutdown=function(){this.sceneRTT&&(this.sceneRTT.remove(this.cameraRTT),this.sceneRTT.remove(this.quadRTT)),this.sceneRTT=void 0,this.quadRTT=void 0,this.quadGeo&&this.quadGeo.dispose(),this.noiseMat&&this.noiseMat.dispose(),this.uniforms=void 0},t.prototype.onEntityReady=function(){this.autoLoad&&this.renderNoise()},t.prototype.onAttributesChanged=function(e){this.initialized&&(e.indexOf("scale")!==-1&&void 0!==this.scale.x&&(this.uniforms.scale.value.x=this.scale.x,this.uniforms.scale.value.y=this.scale.y),e.indexOf("offset")!==-1&&void 0!==this.offset.x&&(this.uniforms.offset.value.x=this.offset.x,this.uniforms.offset.value.y=this.offset.y),e.indexOf("layerScale")!==-1&&void 0!==this.layerScale.x&&(this.uniforms.layerScale.value.x=this.layerScale.x,this.uniforms.layerScale.value.y=this.layerScale.y,this.uniforms.layerScale.value.z=this.layerScale.z,this.uniforms.layerScale.value.w=this.layerScale.w),e.indexOf("layerAmplitude")!==-1&&void 0!==this.layerAmplitude.x&&(this.uniforms.layerAmplitude.value.x=this.layerAmplitude.x,this.uniforms.layerAmplitude.value.y=this.layerAmplitude.y,this.uniforms.layerAmplitude.value.z=this.layerAmplitude.z,this.uniforms.layerAmplitude.value.w=this.layerAmplitude.w),this.renderNoise())},t.prototype.renderNoise=function(){this.getThreeRenderer().render(this.sceneRTT,this.cameraRTT,this.getRuntimeData(),!0),this.getThreeRenderer().setRenderTarget(null)},t.prototype.changeNoiseValues=function(e,t,r,i){this.layerAmplitude=e,this.layerScale=t,this.scale=r,this.offset=i,this.onAttributesChanged(["layerAmplitude","layerScale","scale","offset"])},t}(a.default);t.default=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=r(12),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.skyboxTexture=null,t.stereoEnabled=!1,t.size=100,t.skyboxMesh=null,t.skyboxMeshRightEye=null,t.skyboxGeometry=null,t.skyboxGeometryRightEye=null,t.skyboxMaterialCube=null,t.skyboxUniforms=null,t.skyboxVShader=null,t.skyboxPShader=null,t.skyboxMaterial2D=null,t}return i.__extends(t,e),t.prototype.onStartup=function(){this.initMaterials()},t.prototype.onShutdown=function(){this.skyboxGeometry&&this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye&&this.skyboxGeometryRightEye.dispose(),this.skyboxMaterialCube&&this.skyboxMaterialCube.dispose(),this.skyboxMaterial2D&&this.skyboxMaterial2D.dispose(),this.skyboxMesh=null,this.skyboxGeometry=null,this.skyboxGeometryRightEye=null,this.skyboxMaterialCube=null,this.skyboxMaterial2D=null,this.skyboxUniforms=null,this.skyboxTexture=null},t.prototype.getMesh=function(e){return void 0===e&&(e="left"),"left"===e?this.skyboxMesh:this.skyboxMeshRightEye},t.prototype.onAttributesChanged=function(e){if(e.indexOf("skyboxTexture")!==-1){var t=this.getPreviousAttribute("skyboxTexture");if(t){var r=this.getEngine().getEntityById(t);this.stopListening(r)}this.getEntity().unregisterDependencyById(this.getPreviousAttribute("skyboxTexture"));var i=this.getEntity().getOwnDependencyInfo(),n=this.getAttribute("skyboxTexture");i[n]||this.getEntity().registerDependencyById(this.getAttribute("skyboxTexture"))}this.getEntity().isBaseLoaded()&&(e.indexOf("skyboxTexture")===-1&&e.indexOf("stereoEnabled")===-1||this.initSkybox(),e.indexOf("size")!==-1&&this.skyboxMesh&&(this.skyboxMesh.scale.set(this.size,this.size,this.size),this.skyboxMeshRightEye.scale.set(this.size,this.size,this.size)))},t.prototype.onEnable=function(){this.getRuntimeData()&&(this.getRuntimeData().add(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().add(this.skyboxMeshRightEye),this.skyboxTexture&&this.skyboxTexture.isUnloaded()&&this.skyboxTexture.load())},t.prototype.onDisable=function(){this.getRuntimeData()&&(this.getRuntimeData().remove(this.skyboxMesh),this.isStereo()&&this.getRuntimeData().remove(this.skyboxMeshRightEye))},t.prototype.onEntityReady=function(){this.initSkybox()},t.prototype.isStereo=function(){if(!this.skyboxTexture||!this.stereoEnabled)return!1;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:case o.ImageLayout.Stereo2dUnderOver:case o.ImageLayout.Stereo2dLeftRight:case o.ImageLayout.Stereo2dRightLeft:return this.stereoEnabled;default:return!1}},t.prototype.initGeometry=function(){this.skyboxGeometry&&(this.skyboxGeometry.dispose(),this.skyboxGeometryRightEye.dispose()),this.skyboxGeometry=new n.SphereBufferGeometry(1,64,64),this.skyboxGeometryRightEye=this.skyboxGeometry.clone()},t.prototype.initStereoUvs=function(){if(this.skyboxTexture){var e=new n.Vector2,t=new n.Vector2,r=new n.Vector2,i=new n.Vector2;switch(this.skyboxTexture.getLayout()){case o.ImageLayout.Stereo2dOverUnder:e.set(1,.5),t.set(0,0),r.set(1,.5),i.set(0,.5);break;case o.ImageLayout.Stereo2dUnderOver:e.set(1,.5),t.set(0,.5),r.set(1,.5),i.set(0,0);break;case o.ImageLayout.Stereo2dLeftRight:e.set(.5,1),t.set(0,0),r.set(.5,1),i.set(.5,0);break;case o.ImageLayout.Stereo2dRightLeft:e.set(.5,1),t.set(.5,0),r.set(.5,1),i.set(0,0);break;default:return}for(var a=this.skyboxGeometry.getAttribute("uv").array,s=this.skyboxGeometryRightEye.getAttribute("uv").array,u=0;un&&i>0?(e.fillText(s,r,u),s=t+" ",u+=a):s=o}),e.fillText(s,r,u)},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(2),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.standing=!0,t.userHeight=6,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.standingMatrix=new n.Matrix4,t.workVector=new n.Vector3,t.scale=1,t}return i.__extends(t,e),t.prototype.onPreUpdate=function(e){if(this.isEnabled()&&this.hasRuntimeData()){var t=this.getEngine(),r=t.getVrDisplay();if(r){t.needsRender=!0,r.getFrameData(this.frameData);var i=this.frameData.pose,n=this.getRuntimeData(),a=this.getEntity();null!==i.orientation&&(a.setQuaternion(i.orientation[0],i.orientation[1],i.orientation[2],i.orientation[3]),r.capabilities.hasPosition&&i.position&&a.setPosition(i.position[0],i.position[1],i.position[2]),this.standing&&r.stageParameters?(n.updateMatrix(),this.standingMatrix.fromArray(r.stageParameters.sittingToStandingTransform),n.applyMatrix(this.standingMatrix),a.setQuaternion(n.quaternion.x,n.quaternion.y,n.quaternion.z,n.quaternion.w),n.position.multiplyScalar(this.scale),a.setPosition(n.position.x,n.position.y,n.position.z)):(a.getPosition(this.workVector),this.workVector.multiplyScalar(this.scale),a.setPosition(this.workVector.x,this.workVector.y,this.workVector.z)))}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(2),a=r(22),o=r(3),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.scale=1,t.isPresenting=!1,t.wasPresenting=!1,t.vrDisplays=null,t.previousPixelRatio=1,t}return i.__extends(t,e),t.prototype.getScale=function(){return this.scale},t.prototype.setScale=function(e){this.scale=e},t.prototype.getDisplays=function(){return this.vrDisplays},t.prototype.onAwake=function(){var e=this;this.listenTo(this.getEngine(),"enableVrRendering",this.onEnableVr),this.listenTo(this.getEngine(),"disableVrRendering",this.onDisableVr),this.listenTo(this.getEngine(),"toggleVrRendering",this.onToggleVr),this.onVrDisplayPresentChange=this.onVrDisplayPresentChange.bind(this),window.addEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1),navigator.getVRDisplays?navigator.getVRDisplays().then(function(t){e.vrDisplays=t,e.trigger("displaysInitialized")}):this.vrDisplays=[]},t.prototype.onShutdown=function(){e.prototype.onShutdown.call(this),window.removeEventListener("vrdisplaypresentchange",this.onVrDisplayPresentChange,!1)},t.prototype.onDisable=function(){this.isPresenting&&this.onDisableVr()},t.prototype.whenDisplaysAvailable=function(e){var t=this;this.vrDisplays?e.call(this,this.vrDisplays):this.listenToOnce(this,"displaysInitialized",function(){e.call(t,t.vrDisplays)})},t.prototype.onPostRender=function(e){var t=this.getEngine().getVrDisplay();t&&this.isPresenting&&t.submitFrame()},t.prototype.onEnableVr=function(){if(this.isEnabled()){if(!this.vrDisplays)return void this.listenToOnce(this,"displaysInitialized",this.onEnableVr.bind(this));if(this.vrDisplays.length){var e=this.vrDisplays[0];this.getEngine().setVrDisplay(e);var t=this.getRenderer().getCanvas();e.requestPresent([{source:t}]).catch(function(e){o.default.error("Failed to present to VR display",e.message)})}}},t.prototype.onDisableVr=function(){if(this.isPresenting){var e=this.getEngine().getVrDisplay();e&&(e.exitPresent(),this.getEngine().setVrDisplay(null))}},t.prototype.onToggleVr=function(){this.isPresenting?this.onDisableVr():this.onEnableVr()},t.prototype.onVrDisplayPresentChange=function(){this.wasPresenting=this.isPresenting;var e=this.getEngine().getVrDisplay();this.isPresenting=e&&e.isPresenting;var t=this.getThreeRenderer();if(this.isPresenting){var r=e.getEyeParameters("left"),i=r.renderWidth,n=r.renderHeight;if(!this.wasPresenting){if(this.previousPixelRatio=t.getPixelRatio(),a.isMobile()){var o=t.capabilities.maxTextureSize,s=2*i;s*this.previousPixelRatio>o&&(this.previousPixelRatio=Math.floor(o/s)),t.setPixelRatio(this.previousPixelRatio)}else t.setPixelRatio(1);t.setSize(2*i,n,!1),this.getEngine().trigger("vrRenderingEnabled")}}else this.wasPresenting&&(t.setPixelRatio(this.previousPixelRatio),this.getEngine().setVrDisplay(null),this.getEngine().trigger("resize"),this.getEngine().trigger("vrRenderingDisabled"))},t}(n.default);t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(65),o=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.enablePreRenderFunctions=!0,t.enableShadows=!0,t.eyeTranslationL=new n.Vector3,t.eyeTranslationR=new n.Vector3,t.defaultLeftBounds=[0,0,.5,1],t.defaultRightBounds=[.5,0,.5,1],t.renderRectL={x:0,y:0,width:256,height:256},t.renderRectR={x:128,y:0,width:256,height:256},t.cameraL=new n.PerspectiveCamera,t.cameraR=new n.PerspectiveCamera,t.frameData=window.hasOwnProperty("VRFrameData")?new VRFrameData:{},t.scale=1,t}return i.__extends(t,e),t.prototype.renderView=function(t){if(this.isEnabled()&&this.hasRuntimeData()){var r=this.getRootObject();if(r.isBaseLoaded()){var i=r.getRuntimeData(),n=this.getEngine().getVrDisplay();if(!n)return e.prototype.renderView.call(this,t);var a=i.autoUpdate;a&&(i.updateMatrixWorld(),i.autoUpdate=!1);var o=n.getEyeParameters("left"),s=n.getEyeParameters("right");this.eyeTranslationL.fromArray(o.offset),this.eyeTranslationR.fromArray(s.offset);var u,p,c=this.getThreeRenderer(),l=c.getSize(),d=n.getLayers();if(d.length){var h=d[0];u=null!==h.leftBounds&&4===h.leftBounds.length?h.leftBounds:this.defaultLeftBounds,p=null!==h.rightBounds&&4===h.rightBounds.length?h.rightBounds:this.defaultRightBounds}else u=this.defaultLeftBounds,p=this.defaultRightBounds;this.renderRectL={x:Math.round(l.width*u[0]),y:Math.round(l.height*u[1]),width:Math.round(l.width*u[2]),height:Math.round(l.height*u[3])},this.renderRectR={x:Math.round(l.width*p[0]),y:Math.round(l.height*p[1]),width:Math.round(l.width*p[2]),height:Math.round(l.height*p[3])};var f=this.getRuntimeData();null===f.parent&&f.updateMatrixWorld(),f.matrixWorld.decompose(this.cameraL.position,this.cameraL.quaternion,this.cameraL.scale),f.matrixWorld.decompose(this.cameraR.position,this.cameraR.quaternion,this.cameraR.scale),this.cameraL.translateOnAxis(this.eyeTranslationL,this.scale),this.cameraR.translateOnAxis(this.eyeTranslationR,this.scale),n.depthNear=f.near,n.depthFar=f.far,n.getFrameData(this.frameData),this.cameraL.projectionMatrix.elements=this.frameData.leftProjectionMatrix,this.cameraR.projectionMatrix.elements=this.frameData.rightProjectionMatrix,c.setScissor(this.renderRectL.x,this.renderRectL.y,this.renderRectL.width,this.renderRectL.height),this.getRenderer().renderView(i,this.cameraL,{renderTarget:this.renderTarget,clearDepth:!0,clearColor:!0,viewPort:this.renderRectL,enablePreRenderFunctions:!0}),c.setScissor(this.renderRectR.x,this.renderRectR.y,this.renderRectR.width,this.renderRectR.height),this.getRenderer().renderView(i,this.cameraR,{renderTarget:this.renderTarget,clearDepth:!1,clearColor:!1,viewPort:this.renderRectR,enablePreRenderFunctions:!0}),a&&(i.autoUpdate=!0)}}},t}(a.default);t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.defaultBoxApiBase="https://api.box.com/2.0/"},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(1),a=r(3),o=r(208),s=r(207),u=r(209),p=r(204),c=r(216),l=r(27),d=r(76),h=r(35),f=r(14),m=r(46),y=r(45),g=r(9),v=r(34),b=r(15),P=r(11),x=r(117),E=function(e){var t;return e&&e.jquery?e.get(0):"string"==typeof e?(t=document.querySelectorAll(e),t.length&&t[0]):e};t.engineMixins=y.default({},[u.default,s.default,l.default]);var w=function(e){function t(t){var r=e.call(this)||this;r.renderOnDemand=!1,r.needsRender=!0,r.container=void 0,r.globalEvents=void 0,r.engineName="Unnamed Instance of Box3D Engine",r.audioContext=void 0,r.paused=!1,r.runMode="player",r.runtimeNames={},r.nextRuntimeName=1,a.default.info("Engine Initialization"),r.globalScope=t.globalScope||window;var i=function(){if(r.globalEvents=t&&t.globalEvents||m.default,!r.globalEvents)throw new Error("No global event system supplied or found")},s=function(){r.container=r.container||E(t.container)},u=function(){if(r.canvas=r.canvas||E(t.canvas),r.canvas||(r.canvas=document.createElement("canvas"),r.container&&r.container.appendChild(r.canvas),r.canvasCreatedByEngine=!0),!(r.canvas instanceof HTMLCanvasElement))throw new Error("Failed to create canvas element")},l=function(){if(r.resourceLoader=t.resourceLoader,!r.resourceLoader)throw new Error("No resource loader passed to Engine")},y=function(){r.engineName=t.engineName||r.engineName,r.clock=new n.Clock(!0),r.frameDelta=0,r.frameDeltaAggregate=0,r.frameCount=0,r.lastFrameDelta=r.getTimeNow(),r.avgFrameTime=0,r.paused=!1,r.documentVisible=!0,r.state="initializing",r.setRunMode(t.runMode),r.entityDispatcher=t.entityDispatcher||new o.default,r.entityDispatcher.addEngine(r)},g=function(){r.scriptRegistry=new d.default(r),Object.keys(h.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(h.default.builtInAssetDescriptors[e])}),Object.keys(f.default.builtInAssetDescriptors).forEach(function(e){r.createEntity(f.default.builtInAssetDescriptors[e])})},v=function(){r.materialUtilities=new c.default(r)},b=function(){r.geometryUtilities=new p.default},P=function(){r.onResize=function(){r.needsRender=!0},r.onBlur=function(){r.trigger("blur")},r.onFocus=function(){r.trigger("focus")},r.onVisibilityChange=function(){var e=document.hidden||document.mozHidden||document.msHidden||document.webkitHidden;r.documentVisible&&e?r.documentVisible=!1:r.documentVisible||(r.frameDelta=0,r.lastFrameDelta=r.getTimeNow(),r.documentVisible=!0)},window.addEventListener("blur",r.onBlur),window.addEventListener("focus",r.onFocus),r.listenTo(r,"resize",r.onResize),document.addEventListener("visibilitychange",r.onVisibilityChange)},x=function(){r.globalScope[r.engineName]=r,r.update(),r.state="initialized"};return i(),s(),u(),l(),v(),b(),y(),g(),P(),x(),r}return i.__extends(t,e),t.prototype.destroy=function(){e.prototype.destroy.call(this),a.default.info(this.engineName+" - Destroying engine."),window[this.engineName]&&delete window[this.engineName],this.baseRenderer=void 0,this.resourceLoader.destroy(),this.materialUtilities.destroy(),this.geometryUtilities.destroy(),window.removeEventListener("blur",this.onBlur),window.removeEventListener("focus",this.onFocus),this.stopListening(this,"resize",this.onResize),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.onBlur=void 0,this.onFocus=void 0,this.onResize=void 0,this.onVisibilityChange=void 0,this.trigger("shutdown"),this.state="uninitializing",this.cancelAnimationFrame(this.animationRequestID),this.canvas&&this.canvas.parentNode&&this.canvasCreatedByEngine&&this.canvas.parentNode.removeChild(this.canvas),this.entityDispatcher&&this.entityDispatcher.removeEngine(this),this.clock=void 0,this.canvas=void 0,this.container=void 0,this.threeRenderer=void 0,this.baseRenderer=void 0,this.engineName=void 0,this.entityDispatcher=void 0,this.state="uninitialized"},t.prototype.getName=function(){return this.engineName},t.prototype.addEntities=function(e){return this.entityDispatcher?this.entityDispatcher.addEntities(e):[]},t.prototype.addRemoteEntities=function(e,t){var r=this;return void 0===t&&(t={}),new Promise(function(i,n){r.resourceLoader.load(e,b.default.ENTITIES,t).on(P.default.LOAD,function(e){i(r.addEntities(e))}).on(P.default.ERROR,function(e){return n(e)})})},t.prototype.addRemoteEntitiesFromBox=function(e,t,r){var i=this;return void 0===t&&(t={}),void 0===r&&(r=x.defaultBoxApiBase),this.fetchRemoteRepresentationsFromBox(e,t,r).then(function(e){return i.addRemoteEntities(e.representations.entries[0].content.url_template.replace("{+asset_path}","entities.json"),t)})},t.prototype.fetchRemoteRepresentationsFromBox=function(e,t,r){var n=this;void 0===t&&(t={}),void 0===r&&(r=x.defaultBoxApiBase);var a=r+"files/"+e+"?fields=representations";return new Promise(function(e,r){return n.resourceLoader.load(a,b.default.JSON,i.__assign({headers:{"X-Rep-Hints":"[3d]"}},t)).on(P.default.LOAD,function(t){return e(t)}).on(P.default.ERROR,function(e){return r(e)})})},t.prototype.loadEntities=function(e,t,r){var i=this;void 0===r&&(r="load"),Promise.all(e.map(function(e){var t=e instanceof g.default?e.id:e;return new Promise(function(e,n){var a=i.getEntityById(t);a?(a.when(r,function(){e()}),a.isUnloaded()&&a.load()):n(new Error("Entity can't be found."))})})).then(function(){"function"==typeof t&&t.call(i)}).catch(function(e){"function"==typeof t&&(a.default.error("loadEntities error: "+e),t.call(i,e))})},t.prototype.setVrDisplay=function(e){ +var t=this;this.cancelAnimationFrame(this.animationRequestID),this.vrDevice=e,this.animationRequestID=this.requestAnimationFrame(function(){t.needsRender=!0,t.update()})},t.prototype.getVrDisplay=function(){return this.vrDevice},t.prototype.getApplication=function(){var e=this.getAssetsByClass(v.default);return e.find(function(e){return e.isBaseLoaded()})},t.prototype.setRunMode=function(e){this.runMode="editor"===e?e:"player"},t.prototype.getRunMode=function(){return this.runMode},t.prototype.getRenderer=function(){return this.baseRenderer},t.prototype.setRenderer=function(e){this.baseRenderer&&(this.baseRenderer.onShutdown(),this.baseRenderer.stopListening()),this.baseRenderer=e,this.threeRenderer=e.threeRenderer},t.prototype.getThreeRenderer=function(){return this.threeRenderer},t.prototype.getGPUCapability=function(e){return this.baseRenderer.caps[e]},t.prototype.getAudioContext=function(){if(!this.audioContext){var e=this.globalScope.AudioContext||this.globalScope.webkitAudioContext;e&&(this.audioContext=new e,this.audioContext||a.default.warn(this.engineName+" - Failed to create Web Audio API context"))}return this.audioContext},t.prototype.getRuntimeName=function(e){return this.runtimeNames.hasOwnProperty(e)||(this.runtimeNames[e]=this.nextRuntimeName.toString(),this.nextRuntimeName++),this.runtimeNames[e]},t.prototype.pause=function(){this.paused||(this.paused=!0,this.clock.stop(),this.cancelAnimationFrame(this.animationRequestID),a.default.info(this.engineName+" engine has been paused."))},t.prototype.unpause=function(){this.paused&&(this.paused=!1,this.frameDelta=0,this.lastFrameDelta=this.getTimeNow(),this.clock.start(),a.default.info(this.engineName+" engine has been unpaused."),this.update())},t.prototype.setCurrentApp=function(e){var t=this.getAssetById(e);t&&(this.currentApplication&&(a.default.warn("Already an application running in this engine. Stop it before starting the "+t.getName()+" application."),this.currentApplication.unload()),this.currentApplication=t)},t.prototype.getTimeNow=function(){return.001*(window.performance&&window.performance.now?window.performance.now():Date.now())},t.prototype.update=function(){var e=this;this.paused||(this.animationRequestID=this.requestAnimationFrame(function(){e.update()}),this.documentVisible&&(this.frameCount++,this.frameDelta=this.getTimeNow()-this.lastFrameDelta,this.lastFrameDelta=this.getTimeNow(),this.frameDeltaAggregate+=this.frameDelta,this.avgFrameTime=this.frameDeltaAggregate/this.frameCount,this.trigger("preUpdate",this.frameDelta),this.trigger("update",this.frameDelta),this.trigger("postUpdate",this.frameDelta),this.renderOnDemand&&!this.needsRender||(this.needsRender=!1,this.trigger("preRender",this.frameDelta),this.trigger("render",this.frameDelta),this.trigger("renderGroup1",this.frameDelta),this.trigger("renderGroup2",this.frameDelta),this.trigger("renderGroup3",this.frameDelta),this.trigger("renderGroup4",this.frameDelta),this.trigger("renderGroup5",this.frameDelta),this.trigger("renderGroup6",this.frameDelta),this.trigger("renderGroup7",this.frameDelta),this.trigger("renderGroup8",this.frameDelta),this.trigger("renderGroup9",this.frameDelta),this.trigger("renderGroup10",this.frameDelta),this.trigger("postRender",this.frameDelta))))},t.prototype.requestAnimationFrame=function(e){return this.vrDevice?this.vrDevice.requestAnimationFrame(e):requestAnimationFrame(e)},t.prototype.cancelAnimationFrame=function(e){return this.vrDevice?this.vrDevice.cancelAnimationFrame(e):cancelAnimationFrame(e)},t}(t.engineMixins);t.default=w},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n={side:{displayName:"Cull Mode",description:"This controls which side of the geometry will be visible.",type:"opt",isRenderParam:!0,options:{frontOnly:i.FrontSide,backOnly:i.BackSide,doubleSided:i.DoubleSide},default:"doubleSided"},wireframe:{displayName:"Wireframe",description:"This controls whether the material displays as a wireframe.",type:"b",isRenderParam:!0,default:!1},fog:{displayName:"Enable Fog",description:"This controls whether this material is affected by fog or not.",isRenderParam:!0,forceUpdate:!0,type:"b",default:!0},depthFunc:{displayName:"Depth Function",description:"The function to use when comparing the current depth value with the one that already exists in the buffer.",isRenderParam:!0,type:"opt",options:{never:i.NeverDepth,always:i.AlwaysDepth,lessThan:i.LessDepth,lessThanOrEqual:i.LessEqualDepth,equal:i.EqualDepth,greaterThanOrEqual:i.GreaterEqualDepth,greaterThan:i.GreaterDepth,notEqual:i.NotEqualDepth},default:"lessThanOrEqual"},depthWrite:{displayName:"Enable Depth Write",description:"This controls whether the depth values of a mesh rendered with this material are recorded.",isRenderParam:!0,type:"b",default:!0},depthTest:{displayName:"Enable Depth Test",description:"This controls whether a depth check is done before this material is rendered so that it can be occluded.",isRenderParam:!0,type:"b",default:!0},blending:{displayName:"Blending Mode",description:"This controls how the material will be blended with the color behind it.",isRenderParam:!0,type:"opt",options:{none:i.NoBlending,normal:i.NormalBlending,additive:i.AdditiveBlending,subtractive:i.SubtractiveBlending,multiplicative:i.MultiplyBlending,custom:i.CustomBlending},default:"normal",transparency:"GreaterThanOne"},blendEquation:{displayName:"Blending Equation",description:"The function to use when blending the current color with the one already in the buffer.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"}}},blendSrc:{displayName:"Blend Source",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"}}},blendDst:{displayName:"Blend Destination",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"}}},useSeparateAlphaBlend:{displayName:"Separate Blend for Alpha",description:"Use different blend values for the alpha channel.",type:"b",default:!1,displayWhen:{blending:{equals:"custom"}}},blendEquationAlpha:{displayName:"Alpha Blend Equation",description:"The function to use when blending the current alpha with the one already in the buffer.",isRenderParam:!0,type:"opt",options:{add:i.AddEquation,subtract:i.SubtractEquation,reverseSubtract:i.ReverseSubtractEquation,minimum:i.MinEquation,maximum:i.MaxEquation},default:"add",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},blendSrcAlpha:{displayName:"Alpha Blend Source",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor},default:"sourceAlpha",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},blendDstAlpha:{displayName:"Alpha Blend Destination",description:"",isRenderParam:!0,type:"opt",options:{zero:i.ZeroFactor,one:i.OneFactor,sourceColor:i.SrcColorFactor,oneMinusSourceColor:i.OneMinusSrcColorFactor,sourceAlpha:i.SrcAlphaFactor,oneMinusSourceAlpha:i.OneMinusSrcAlphaFactor,destinationAlpha:i.DstAlphaFactor,oneMinusDestinationAlpha:i.OneMinusDstAlphaFactor,destinationColor:i.DstColorFactor,oneMinusDestinationColor:i.OneMinusDstColorFactor,sourceAlphaSaturate:i.SrcAlphaSaturateFactor},default:"one",displayWhen:{blending:{equals:"custom"},useSeparateAlphaBlend:{equals:!0}},enabledWhen:{useSeparateAlphaBlend:{equals:!0}}},polygonOffset:{displayName:"Polygon Offset",description:"Turns on rendering with polygon offsets. This can be used to work around z-fighting.",isRenderParam:!0,type:"b",default:!1},polygonOffsetFactor:{displayName:"Polygon Offset Factor",description:"Scales the maximum Z slope, with respect to X or Y of the polygon.",isRenderParam:!0,type:"f",default:1},polygonOffsetUnits:{displayName:"Polygon Offset Units",description:"Scales the minimum resolvable depth buffer value.",isRenderParam:!0,type:"f",default:1},alphaTest:{displayName:"Alpha Test",description:'Pixels with an alpha value below the given value will not be rendered. This value will only be used when this material\'s Transparency blending mode is set to "Masked"',isRenderParam:!0,forceUpdate:!0,type:"f",default:.2,min:0,max:1,step:.001}};t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={diffuse:{displayName:"Diffuse Color",description:"The color of light diffusely reflected by the surface.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"color"},diffuseTexture:{displayName:"Diffuse Map",description:"The color reflected diffusely by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"map",enabledWhen:{diffuseTexture:{notEqualsDefault:!0}},transparency:"HasAlpha"},ambientFactor:{displayName:"Ambient Intensity",description:"A value to multiple the ambient color by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"aoMapIntensity"},ambientTexture:{displayName:"Ambient Texture",description:"The color reflected by the surface from ambient lights.",type:"t",default:null,isRenderParam:!0,uniformName:"aoMap",enabledWhen:{ambientTexture:{notEqualsDefault:!0}}},emissive:{displayName:"Emissive Color",description:"A color emitted by the surface which is not affected by external lights.",type:"c",default:{r:0,g:0,b:0},min:0,max:1,isRenderParam:!0,uniformName:"emissive"},emissiveFactor:{displayName:"Emissive Intensity",description:"A value to multiple the emissive color by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"emissiveIntensity"},emissiveTexture:{displayName:"Emissive Texture",description:"The color emitted by the surface which is not affected by external lights.",type:"t",default:null,isRenderParam:!0,uniformName:"emissiveMap",enabledWhen:{emissiveTexture:{notEqualsDefault:!0}}},bumpTexture:{displayName:"Bump Texture",description:"The height map of the surface, used to fake its shape when shading.",type:"t",default:null,isRenderParam:!0,uniformName:"bumpMap",enabledWhen:{bumpTexture:{notEqualsDefault:!0},normalMapTexture:{equalsDefault:!0}}},bumpFactor:{displayName:"Bump Scale",description:"A value to multiple the bump amount by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"bumpScale"},normalMapTexture:{displayName:"Normal Texture",description:"The tangent-space surface directions, used to fake its shape when shading.",type:"t",default:null,isRenderParam:!0,uniformName:"normalMap",enabledWhen:{normalMapTexture:{notEqualsDefault:!0}}},normalFactor:{displayName:"Normal Scale",description:"A value to divide the normal-z amount by. i.e. lower value results in smoother surface.",type:"v2",default:{x:1,y:1},min:0,max:100,isRenderParam:!0,uniformName:"normalScale"},transparencyFactor:{displayName:"Opacity",description:"The opacity of the surface.",type:"f",default:1,min:0,max:1,isRenderParam:!0,uniformName:"opacity",transparency:"LessThanOne"},transparencyFactorTexture:{displayName:"Alpha Map",description:"The opacity of the surface.",type:"t",default:null,isRenderParam:!0,uniformName:"alphaMap",transparency:"NotFalsy",enabledWhen:{transparencyFactorTexture:{notEqualsDefault:!0}}},displacementColorTexture:{displayName:"Displacement Map",description:"A texture that stores the displacement amount at each texel.",type:"t",default:null,isRenderParam:!0,uniformName:"displacementMap",enabledWhen:{displacementColorTexture:{notEqualsDefault:!0}}},displacementFactor:{displayName:"Displacement Scale",description:"A value to multiple the displacement by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"displacementScale"},displacementBias:{displayName:"Displacement Bias",description:"A value to bias the displacement by.",type:"f",default:0,min:-1,max:1,isRenderParam:!0,uniformName:"displacementScale"}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"accessor",title:"AccessorDef",type:"object",description:"A typed-view into raw binary data.",properties:{componentType:{type:"string",enum:["int8","uint8","int16","int32","uint32","float32","float64"],description:"These correspond to typed arrays: Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array."},type:{type:"string",enum:["scalar","vec2","vec3","vec4","mat2","mat3","mat4"],description:"Specifies if elements are scalars, vectors or matrices."},byteOffset:{type:"integer",description:"Byte offset into the binary data."},byteStride:{type:"integer",description:"The number of bytes between successive elements (0 indicates that the elements are tightly packed)."},count:{type:"integer",description:"The number of elements, not to be confused with the number of components or bytes. For example, the number of positions, not the number of floats."}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"animationAsset",title:"AnimationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["animation"]},properties:{$ref:"animationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"animationAssetProperties",title:"AnimationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{clips:{type:"object",properties:{},additionalProperties:{$ref:"animationClip.json"},default:{}},layers:{type:"object",properties:{},additionalProperties:{$ref:"animationLayer.json"},defualt:{}},channels:{type:"object",properties:{},additionalProperties:{$ref:"animationChannel.json"},default:{}}}),required:["clips","layers","channels"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationChannel",title:"AnimationChannelDef",type:"object",description:"An animation channel.",properties:{name:{type:"string",description:"The channel's name."},targetObject:{type:"array",description:"The path of the object to animate.",items:{type:"string"},default:[]},targetProperty:{type:"string",description:"The path of the property to animate."},values:{type:"string",description:"The ID of the accessor for the channel values."},times:{type:"string",description:"The ID of the accessor for the channel times."},interpolation:{type:"string",enum:["linear"],description:"The interpolation type for the channel."}},required:["name","targetObject","targetProperty","values","times","interpolation"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationClip",title:"AnimationClipDef",type:"object",description:"An animation clip.",properties:{name:{type:"string",description:"The clip's name."},start:{type:"number",description:"The take's start time, in seconds.",default:0},stop:{type:"number",description:"The take's stop time, in seconds.",default:0},layers:{type:"array",items:{type:"string"},default:[]}},required:["name","start","stop","layers"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"animationLayer",title:"AnimationLayerDef",type:"object",description:"An animation layer.",properties:{name:{type:"string",description:"The layer's name."},blendMode:{enum:["additive"],description:"The layer's blend mode.",default:"additive"},blendWeight:{type:"number",description:"The layer's blend weight.",default:1},channels:{type:"array",items:{type:"string"},default:[]}},required:["name","blendMode","blendWeight","channels"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"applicationAsset",title:"ApplicationAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["application"]},properties:{$ref:"applicationAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"applicationAssetProperties",title:"ApplicationAssetPropertiesDef",type:"object",properties:i.__assign({},n.default.properties,{startupSceneId:{type:["string","null"],description:"#entity-PrefabAsset"}}),required:["startupSceneId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"audioAsset",title:"AudioAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["audio"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"audioRepresentation.json"}}),properties:{$ref:"audioAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"audioAssetProperties",title:"AudioAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"audioRepresentation",title:"AudioRepresentationDef",properties:i.__assign({},n.default.properties,{bitRate:{type:"number"},sampleRate:{type:"number"},stereo:{type:"boolean"},startTime:{type:"number"},duration:{type:"number"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"boneObject",title:"BoneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["bone"]},properties:{$ref:"boneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"boneObjectProperties",title:"BoneObjectPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"box3",title:"Box3Def",type:"object",properties:{min:{$ref:"vector3.json"},max:{$ref:"vector3.json"}},required:["min","max"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"bufferAsset",title:"BufferAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["buffer"]},properties:{$ref:"bufferAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"bufferAssetProperties",title:"BufferAssetPropertiesDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the binary file."},isExternal:{type:"boolean",description:"True is the asset should be loaded from outside of the base data provider/content provider.",default:!1},contentLength:{type:"number",description:"The HTTP Content-Length."},accessors:{type:"object",properties:{},additionalProperties:{$ref:"accessor.json"},description:"Typed-views into the binary file."}}),required:["src","contentLength"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"cameraObject",title:"CameraObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["camera"]},properties:{$ref:"cameraObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"cameraObjectProperties",title:"CameraObjectPropertiesDef",properties:i.__assign({},n.default.properties,{cameraType:{type:"string",description:"",enum:["perspective","orthographic"],default:"perspective"},fov:{type:"number",default:50,dependencies:{cameraType:["perspective"]}},aspect:{type:"number",default:1.7777777777777777},near:{type:"number",default:.1},far:{type:"number",default:12e3},right:{type:"number",default:10,dependencies:{cameraType:["orthographic"]}},left:{type:"number",default:-10,dependencies:{cameraType:["orthographic"]}},top:{type:"number",default:10,dependencies:{cameraType:["orthographic"]}},bottom:{type:"number",default:-10,dependencies:{cameraType:["orthographic"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"colorRgb",title:"ColorRgb",type:"object",properties:{r:{type:"number"},g:{type:"number"},b:{type:"number"}},required:["r","g","b"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"component",title:"ComponentDef",type:"object",properties:{id:{type:"string"},scriptId:{type:"string"},name:{type:"string"},enabled:{type:"boolean"},attributes:{type:"object",properties:{},additionalProperties:{$ref:"componentAttribute.json"}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"componentAttribute",title:"ComponentAttributeDef",type:"object",properties:{type:{type:"string"},subType:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1},attributes:{type:"array",items:{type:"object",properties:{type:{type:"string"},attributes:{}},additionalProperties:!1}}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"documentAsset",title:"DocumentAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["document"]},properties:{$ref:"documentAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"documentAssetProperties",title:"DocumentAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"dracoAttribute",title:"DracoAttributeDef",type:"object",description:"Specifies the name and ID of a Draco attribute.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},id:{type:"string",description:"The ID of the Draco attribute."}},required:["name","id"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"dracoGeometryAsset",title:"DracoGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["dracoGeometry"]},properties:{$ref:"dracoGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"dracoGeometryAssetProperties",title:"DracoGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{accessorId:{type:["string","null"],description:"The ID of the accessor containing the draco geometry: #."},attributes:{type:"object",properties:{},additionalProperties:{$ref:"dracoAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements."}}),required:["accessorId"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(70),a=i.__assign({},n.default,{id:"imageAsset",title:"ImageAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["image"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"imageRepresentation.json"}}),properties:{$ref:"imageAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(41),a=i.__assign({},n.default,{id:"imageAssetProperties",title:"ImageAssetPropertiesDef",properties:i.__assign({},n.default.properties,{useCompression:{type:"boolean",description:"True if we will try to use a hardware-compressed version of the image 'instead of a regular one. This depends on the hardware capabilities of the user and the data formats available.",default:!0}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a={id:"imageRepresentation",title:"ImageRepresentationDef",properties:i.__assign({},n.default.properties,{src:{type:"string",description:"The URL of the representation."},channels:{type:"array",items:{type:"string"}},compression:{type:"string",enum:["dxt","dxt1","dxt5","jpeg","zip"]},isExternal:{type:"boolean"},width:{type:"integer",description:"The width, in pixels, of the representation."},height:{type:"integer",description:"The height, in pixels, of the representation."},colorspace:{type:"string",enum:["srgb","rgb"]}}),required:["src"],additionalProperties:!1};t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"lightObject",title:"LightObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["light"]},properties:{$ref:"lightObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"lightObjectProperties",title:"LightObjectPropertiesDef",properties:i.__assign({},n.default.properties,{lightType:{type:"string",enum:["directional","point","spot","hemisphere","ambient"],default:"directional"},color:{$ref:"colorRgb.json",default:{r:.7333,g:.7333,b:.7333}},intensity:{type:"number",minimum:0,default:1},distance:{type:"number",default:0,minimum:0,dependencies:{lightType:["point","spot"]}},decay:{type:"number",default:1,minimum:0,maximum:5,dependencies:{lightType:["point","spot"]}},angle:{type:"number",default:Math.PI/3,minimum:1,maximum:Math.PI,dependencies:{lightType:["spot"]}},penumbra:{type:"number",default:Math.PI/4,minimum:.001,maximum:Math.PI/2,dependencies:{lightType:["spot"]}},groundColor:{$ref:"colorRgb.json",dependencies:{lightType:["hemisphere"]},default:{r:.033,g:.333,b:.7333}},castShadow:{type:"boolean",default:!1,description:"#read-only"},receiveShadow:{description:"#unused"},shadowCameraNear:{type:"number",default:.1,description:"#read-only"},shadowCameraFar:{type:"number",default:20,description:"#read-only"},shadowCameraLeft:{type:"number",default:-10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowCameraRight:{type:"number",default:10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowCameraTop:{type:"number",default:10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowCameraBottom:{type:"number",default:-10,dependencies:{lightType:["directional"]},description:"#read-only"},shadowBias:{type:"number",default:-.0015,description:"#read-only"},shadowMapWidth:{type:"integer",default:1024,description:"#read-only"},shadowMapHeight:{type:"integer",default:1024,description:"#read-only"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"materialAsset",title:"MaterialAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["material"]},properties:{$ref:"materialAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"materialAssetProperties",title:"MaterialAssetPropertiesDef",properties:i.__assign({},n.default.properties,{shaderId:{type:"string",default:"fbx_surface_phong_shader"}}),additionalProperties:!0});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"meshAttribute",title:"MeshAttributeDef",type:"object",description:"Specifies a range of attribute data for the vertices of a mesh.",properties:{name:{type:"string",description:"The name of the this attribute. For example, texture's have a uvSet property that contains the name of a UV attribute."},accessorId:{type:["string","null"],description:"The ID of the buffer asset and accessor: #."}},required:["name","accessorId"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"meshGeometryAsset",title:"MeshGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["meshGeometry"]},properties:{$ref:"meshGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"meshGeometryAssetProperties",title:"MeshGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",properties:{},additionalProperties:{$ref:"meshAttribute.json"},description:"A collection of vertex attributes. All attributes must have the same number of elements.#unused"},indices:{type:["string","null"],description:"The ID of the accessor containing the vertex indices: #.#unused"},primitives:{type:"array",items:{$ref:"meshPrimitive.json"},description:"The primitives (points, lines, triangles) that make up the mesh.#unused"}}),required:["attributes","indices","primitives"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"meshObject",title:"MeshObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["mesh"]},properties:{$ref:"meshObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"meshObjectProperties",title:"MeshObjectPropertiesDef",properties:i.__assign({},n.default.properties,{customDepthMaterial:{type:["string","null"],default:null},materials:{type:"array",description:"#entity-MaterialAsset",items:{type:["string","null"]},default:["missingMaterial"]},geometryId:{type:["string","null"],description:"#entity-BaseGeometryAsset",default:null},skinId:{type:["string","null"],description:"#entity-SkinAsset",default:null}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={$schema:"http://json-schema.org/draft-04/schema",id:"meshPrimitve",title:"meshPrimitiveDef",type:"object",description:"A mesh primitive with an optional material assignment.", +properties:{primitive:{enum:["points","lines","triangles"],description:"The type of primitive to render.",default:"triangles"},count:{type:"integer",description:"The number of vertices to draw.",default:0},start:{type:"integer",description:"The index of the first vertex to draw.",default:0},offset:{type:"integer",description:"An offset to apply to each index. This can be used to overcome the 16-bit index limit imposed by WebGL. For example, the first component of a vertex attribute with a value size of 3 would be referenced as follows: values[3 * (offset + indices[start + i])].",default:0},materialIndex:{type:"integer",description:"The index of the material to apply to the primitive being rendered.",default:0}},required:["primitve","count"],additionalProperties:!1}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"nodeObject",title:"NodeObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["node"]}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"nodeObjectProperties",title:"NodeObjectPropertiesDef",properties:i.__assign({},n.default.properties)});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"prefabAsset",title:"PrefabAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["prefab"]},properties:{$ref:"prefabAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"prefabAssetProperties",title:"PrefabAssetPropertiesDef",properties:i.__assign({},n.default.properties,{rootObjectId:{type:["string","null"],default:null,description:"The ID of the BaseObject that serves as the root node of a hierarchy. #entity-BaseObject"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(28),a=i.__assign({},n.default,{id:"primitiveGeometryAsset",title:"PrimitiveGeometryAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["primitiveGeometry"]},properties:{$ref:"primitiveGeometryAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(29),a=i.__assign({},n.default,{id:"primitiveGeometryAssetProperties",title:"PrimitiveGeometryAssetPropertiesDef",properties:i.__assign({},n.default.properties,{type:{type:"string",default:"sphere",enum:["sphere","box","plane","torus","cylinder"]},radius:{type:"number",default:.5,min:0,dependencies:{type:["sphere","torus"]}},segmentsU:{type:"integer",default:24,min:0,dependencies:{type:["torus","sphere","cylinder"]}},segmentsV:{type:"integer",default:24,min:0,dependencies:{type:["torus","sphere","cylinder"]}},sizeX:{type:"number",default:1,dependencies:{type:["box","plane"]}},sizeY:{type:"number",default:1,dependencies:{type:["box","plane"]}},sizeZ:{type:"number",default:1,dependencies:{type:["box"]}},segmentsX:{type:"integer",default:1,min:0,dependencies:{type:["box","plane"]}},segmentsY:{type:"integer",default:1,min:0,dependencies:{type:["box","plane"]}},segmentsZ:{type:"integer",default:1,min:0,dependencies:{type:["box"]}},radiusTop:{type:"number",default:.5,min:0,dependencies:{type:["cylinder"]}},radiusBottom:{type:"number",default:.5,min:0,dependencies:{type:["cylinder"]}},height:{type:"number",default:1,min:0,dependencies:{type:["cylinder"]}},open:{type:"boolean",default:!1,dependencies:{type:["cylinder"]}},tubeRadius:{type:"number",default:.1,min:0,dependencies:{type:["torus"]}},arcAngle:{type:"number",default:6.283185307179586,min:0,max:6.283185307179586,dependencies:{type:["torus"]}},phiStart:{type:"number",default:0,min:0,max:6.283185307179586,dependencies:{type:["sphere"]}},phiLength:{type:"number",default:6.283185307179586,min:0,max:6.283185307179586,dependencies:{type:["sphere"]}},thetaStart:{type:"number",default:0,min:0,max:6.283185307179586,dependencies:{type:["sphere","cylinder"]}},thetaLength:{type:"number",default:3.141592653589793,min:0,max:6.283185307179586,dependencies:{type:["sphere","cylinder"]}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(42),a=i.__assign({},n.default,{id:"renderTexture2DAsset",title:"RenderTexture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTexture2D"]},properties:{$ref:"renderTexture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"renderTexture2DAssetProperties",title:"RenderTexture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(42),a=i.__assign({},n.default,{id:"renderTextureCubeAsset",title:"RenderTextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["renderTextureCube"]},properties:{$ref:"renderTextureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(43),a=i.__assign({},n.default,{id:"renderTextureCubeAssetProperties",title:"RenderTextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",description:"his value is temporarily here for compatibility with three.js. Remove it when adding a separate transform object to textures.",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(16),a=i.__assign({},n.default,{id:"sceneObject",title:"SceneObjectDef",properties:i.__assign({},n.default.properties,{type:{enum:["scene"]},properties:{$ref:"sceneObjectProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(17),a=i.__assign({},n.default,{id:"sceneObjectProperties",title:"SceneObjectPropertiesDef",properties:i.__assign({},n.default.properties,{fogEnabled:{type:"boolean",default:!1},fogType:{type:"string",default:"FogExp2"},fogColor:{type:["number","string"],default:12303291},fogDensity:{type:"number",default:4e-4}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"scriptAsset",title:"ScriptAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["script"]},properties:{$ref:"scriptAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"scriptAssetProperties",title:"ScriptAssetPropertiesDef",properties:i.__assign({},n.default.properties,{attributes:{type:"object",default:{}},description:{type:"string",default:""},events:{type:"object",default:{}},externalDependencies:{type:"array",default:[]},filter:{type:"array",items:{type:"string"},default:[]},category:{type:"string",default:""},executeIn:{type:"string",enum:["player","editor","all"],default:"player"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"shaderAsset",title:"ShaderAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["shader"]},properties:{$ref:"shaderAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"shaderAssetProperties",title:"ShaderAssetPropertiesDef",properties:i.__assign({},n.default.properties,{parameters:{type:"object",default:{},additionalProperties:{$ref:"shaderParameter.json"}},uniforms:{type:"object",default:{}},vertexShader:{type:"string",default:""},fragmentShader:{type:"string",default:""}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={type:"object",id:"shaderConditions",title:"ShaderConditionsDef",properties:{or:{type:"array",items:{type:"object",properties:{},additionalProperties:!0}},equals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},notEquals:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"object"}]},equalsDefault:{type:"boolean"},notEqualsDefault:{type:"boolean"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={id:"shaderParameter",title:"ShaderParameterDef",properties:{displayName:{type:"string"},description:{type:"string"},isRenderParam:{type:"boolean"},isUniform:{type:"boolean"},uniformName:{type:"string"},type:{type:"string",enum:["b","c","f","t","opt","v2","v3","v4"]},min:{type:"number"},max:{type:"number"},options:{type:"object",properties:{},additionalProperties:!0},displayWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},enabledWhen:{properties:{},additionalProperties:{$ref:"shaderConditions.json"}},defines:{properties:{},additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"}]}},derivatives:{type:"boolean"},default:{anyOf:[{type:"null"},{type:"string"},{type:"number"},{type:"integer"},{type:"boolean"},{type:"object",properties:{},additionalProperties:!0}]},transparency:{enum:["LessThanOne","GreaterThanOne","NotFalsy","HasAlpha"]},textureUsage:{enum:["bump","normal"]},forceUpdate:{type:"boolean"},textureType:{enum:["Cube"]},step:{type:"number"}},additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"skinAsset",title:"SkinAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["skin"]},properties:{$ref:"skinAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(8),a=i.__assign({},n.default,{id:"skinAssetProperties",title:"SkinAssetPropertiesDef",properties:i.__assign({},n.default.properties,{bindShapeMatrix:{type:"array",description:"Bind shape matrix specifying how the mesh should be transformed into the right coordinate system for use with the joints.",items:{type:"number"},minItems:16,maxItems:16,default:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]},inverseBindMatrices:{type:["string","null"],description:"The ID of the accessor containing the inverse bind matrices: #."},jointNames:{type:"array",description:"Names of the joints in this skin.",items:{type:"string"},uniqueItems:!0,default:[]}}),required:["bindShapeMatrix","inverseBindMatrices","jointNames"]});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"texture2DAsset",title:"Texture2DAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["texture2D"]},properties:{$ref:"texture2DAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(21),a=i.__assign({},n.default,{id:"texture2DAssetProperties",title:"Texture2DAssetPropertiesDef"});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(30),a=i.__assign({},n.default,{id:"textureCubeAsset",title:"TextureCubeAssetDef",properties:i.__assign({},n.default.properties,{type:{enum:["textureCube"]},properties:{$ref:"textureCubeAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(21),a=i.__assign({},n.default,{id:"textureCubeAssetProperties",title:"TextureCubeAssetPropertiesDef",properties:i.__assign({},n.default.properties,{mappingType:{type:"string",default:"environment"},textureUse:{type:"string",enum:["standard","sphericalReflection","sphereReflection","shadow","light","bumpNormal"],description:"Hints at the type of data that the texture contains.",default:"sphericalReflection"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector2",title:"Vector2Def",type:"object",properties:{x:{type:"number"},y:{type:"number"}},required:["x","y"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector3",title:"Vector3Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"}},required:["x","y","z"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={$schema:"http://json-schema.org/draft-04/schema",id:"vector4",title:"Vector4Def",type:"object",properties:{x:{type:"number"},y:{type:"number"},z:{type:"number"},w:{type:"number"}},required:["x","y","z","w"],additionalProperties:!1};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(7),a=i.__assign({},n.default,{id:"videoAsset",title:"VideoAssetDef",type:"object",properties:i.__assign({},n.default.properties,{type:{enum:["video"]},representations:i.__assign({},n.default.properties.representations,{type:{$ref:"videoRepresentation.json"}}),properties:{$ref:"videoAssetProperties.json"}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(41),a=r(21),o=i.__assign({},n.default,a.default,{id:"videoAssetProperties",title:"VideoAssetPropertiesDef",properties:i.__assign({},n.default.properties,a.default.properties,{autoPlay:{type:"boolean",default:!0},muted:{type:"boolean",default:!0},state:{type:"string",default:"play"},loop:{type:"boolean",default:!0},querySelector:{type:"string"}})});t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(31),a=i.__assign({},n.default,{id:"videoRepresentation",title:"VideoRepresentationDef",properties:i.__assign({},n.default.properties,{video:{type:"object",properties:{height:{type:"integer"},width:{type:"integer"}}}})});t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e;try{e=window.WebGLRenderingContext?document.createElement("canvas").getContext("experimental-webgl"):void 0}catch(e){}var t=!!e,r=!!t&&!!e.getExtension("OES_texture_float"),i=!!t&&!(0===e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS));return e=void 0,{isWebGLEnabled:function(){return t},isFloatingPointTexturesEnabeled:function(){return r},isVertexTexturesEnabeled:function(){return i}}}()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObject=function(e){return"node"===e.type||"camera"===e.type||"scene"===e.type||"light"===e.type||"mesh"===e.type||"bone"===e.type},t.isAsset=function(e){return!t.isObject(e)}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,r){var i=r(245);e.exports=function(e,t,r){if(i(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,i){return e.call(t,r,i)};case 3:return function(r,i,n){return e.call(t,r,i,n)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,r){var i=r(260)("wks"),n=r(195),a=r(33).Symbol,o="function"==typeof a,s=e.exports=function(e){return i[e]||(i[e]=o&&a[e]||(o?a:n)("Symbol."+e))};s.store=i},function(e,t){function r(e,t){var r=t||0,n=i;return n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+"-"+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]+n[e[r++]]}for(var i=[],n=0;n<256;++n)i[n]=(n+256).toString(16).substr(1);e.exports=r},function(e,t,r){(function(t){var r,i=t.crypto||t.msCrypto;if(i&&i.getRandomValues){var n=new Uint8Array(16);r=function(){return i.getRandomValues(n),n}}if(!r){var a=new Array(16);r=function(){for(var e,t=0;t<16;t++)0===(3&t)&&(e=4294967296*Math.random()),a[t]=e>>>((3&t)<<3)&255;return a}}e.exports=r}).call(t,r(74))},function(e,t,r){function i(e){return r(n(e))}function n(e){var t=a[e];if(!(t+1))throw new Error("Cannot find module '"+e+"'.");return t}var a={"./accessor":121,"./accessor.ts":121,"./animationAsset":122,"./animationAsset.ts":122,"./animationAssetProperties":123,"./animationAssetProperties.ts":123,"./animationChannel":124,"./animationChannel.ts":124,"./animationClip":125,"./animationClip.ts":125,"./animationLayer":126,"./animationLayer.ts":126,"./applicationAsset":127,"./applicationAsset.ts":127,"./applicationAssetProperties":128,"./applicationAssetProperties.ts":128,"./audioAsset":129,"./audioAsset.ts":129,"./audioAssetProperties":130,"./audioAssetProperties.ts":130,"./audioRepresentation":131,"./audioRepresentation.ts":131,"./baseAsset":7,"./baseAsset.ts":7,"./baseAssetProperties":8,"./baseAssetProperties.ts":8,"./baseEntity":39,"./baseEntity.ts":39,"./baseEntityProperties":40,"./baseEntityProperties.ts":40,"./baseGeometryAsset":28,"./baseGeometryAsset.ts":28,"./baseGeometryAssetProperties":29,"./baseGeometryAssetProperties.ts":29,"./baseImageAsset":70,"./baseImageAsset.ts":70,"./baseImageAssetProperties":41,"./baseImageAssetProperties.ts":41,"./baseObject":16,"./baseObject.ts":16,"./baseObjectProperties":17,"./baseObjectProperties.ts":17,"./baseRenderTextureAsset":42,"./baseRenderTextureAsset.ts":42,"./baseRenderTextureAssetProperties":43,"./baseRenderTextureAssetProperties.ts":43,"./baseTextureAsset":30,"./baseTextureAsset.ts":30,"./baseTextureAssetProperties":21,"./baseTextureAssetProperties.ts":21,"./boneObject":132,"./boneObject.ts":132,"./boneObjectProperties":133,"./boneObjectProperties.ts":133,"./box3":134,"./box3.ts":134,"./bufferAsset":135,"./bufferAsset.ts":135,"./bufferAssetProperties":136,"./bufferAssetProperties.ts":136,"./cameraObject":137,"./cameraObject.ts":137,"./cameraObjectProperties":138,"./cameraObjectProperties.ts":138,"./colorRgb":139,"./colorRgb.ts":139,"./commonImageProperties":44,"./commonImageProperties.ts":44,"./component":140,"./component.ts":140,"./componentAttribute":141,"./componentAttribute.ts":141,"./documentAsset":142,"./documentAsset.ts":142,"./documentAssetProperties":143,"./documentAssetProperties.ts":143,"./dracoAttribute":144,"./dracoAttribute.ts":144,"./dracoGeometryAsset":145,"./dracoGeometryAsset.ts":145,"./dracoGeometryAssetProperties":146,"./dracoGeometryAssetProperties.ts":146,"./imageAsset":147,"./imageAsset.ts":147,"./imageAssetProperties":148,"./imageAssetProperties.ts":148,"./imageRepresentation":149,"./imageRepresentation.ts":149,"./index":4,"./index.ts":4,"./lightObject":150,"./lightObject.ts":150,"./lightObjectProperties":151,"./lightObjectProperties.ts":151,"./materialAsset":152,"./materialAsset.ts":152,"./materialAssetProperties":153,"./materialAssetProperties.ts":153,"./meshAttribute":154,"./meshAttribute.ts":154,"./meshGeometryAsset":155,"./meshGeometryAsset.ts":155,"./meshGeometryAssetProperties":156,"./meshGeometryAssetProperties.ts":156,"./meshObject":157,"./meshObject.ts":157,"./meshObjectProperties":158,"./meshObjectProperties.ts":158,"./meshPrimitive":159,"./meshPrimitive.ts":159,"./nodeObject":160,"./nodeObject.ts":160,"./nodeObjectProperties":161,"./nodeObjectProperties.ts":161,"./prefabAsset":162,"./prefabAsset.ts":162,"./prefabAssetProperties":163,"./prefabAssetProperties.ts":163,"./primitiveGeometryAsset":164,"./primitiveGeometryAsset.ts":164,"./primitiveGeometryAssetProperties":165,"./primitiveGeometryAssetProperties.ts":165,"./renderTexture2DAsset":166,"./renderTexture2DAsset.ts":166,"./renderTexture2DAssetProperties":167,"./renderTexture2DAssetProperties.ts":167,"./renderTextureCubeAsset":168,"./renderTextureCubeAsset.ts":168,"./renderTextureCubeAssetProperties":169,"./renderTextureCubeAssetProperties.ts":169,"./representation":31,"./representation.ts":31,"./sceneObject":170,"./sceneObject.ts":170,"./sceneObjectProperties":171,"./sceneObjectProperties.ts":171,"./scriptAsset":172,"./scriptAsset.ts":172,"./scriptAssetProperties":173,"./scriptAssetProperties.ts":173,"./shaderAsset":174,"./shaderAsset.ts":174,"./shaderAssetProperties":175,"./shaderAssetProperties.ts":175,"./shaderConditions":176,"./shaderConditions.ts":176,"./shaderParameter":177,"./shaderParameter.ts":177,"./skinAsset":178,"./skinAsset.ts":178,"./skinAssetProperties":179,"./skinAssetProperties.ts":179,"./texture2DAsset":180,"./texture2DAsset.ts":180,"./texture2DAssetProperties":181,"./texture2DAssetProperties.ts":181,"./textureCubeAsset":182,"./textureCubeAsset.ts":182,"./textureCubeAssetProperties":183,"./textureCubeAssetProperties.ts":183,"./vector2":184,"./vector2.ts":184,"./vector3":185,"./vector3.ts":185,"./vector4":186,"./vector4.ts":186,"./videoAsset":187,"./videoAsset.ts":187,"./videoAssetProperties":188,"./videoAssetProperties.ts":188,"./videoRepresentation":189,"./videoRepresentation.ts":189};i.keys=function(){return Object.keys(a)},i.resolve=n,e.exports=i,i.id=199},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n="0.0.0-semantic-release";t.version=n;var a=r(1);t.THREE=a;var o=r(231);t.Components=o;var s=r(117);t.Constants=s;var u=r(4);t.Schemas=u.default;var p=r(118);t.Engine=p.default;var c=r(76);t.ScriptRegistry=c.default;var l=r(9);t.BaseEntity=l.default;var d=r(48);t.AnimationAsset=d.default;var h=r(34);t.ApplicationAsset=h.default;var f=r(49);t.AudioAsset=f.default;var m=r(6);t.BaseAsset=m.default;var y=r(23);t.BaseGeometryAsset=y.default;var g=r(12);t.BaseImageAsset=g.default;var v=r(50);t.BaseRenderTextureAsset=v.default;var b=r(19);t.BaseTextureAsset=b.default;var P=r(20);t.BufferAsset=P.default;var x=r(75);t.DocumentAsset=x.default;var E=r(51);t.DracoGeometryAsset=E.default;var w=r(52);t.ImageAsset=w.default;var _=r(14);t.MaterialAsset=_.default;var S=r(53);t.MeshGeometryAsset=S.default;var D=r(54);t.PrefabAsset=D.default;var A=r(55);t.PrimitiveGeometryAsset=A.default;var T=r(56);t.RenderTexture2DAsset=T.default;var M=r(57);t.RenderTextureCubeAsset=M.default;var R=r(58);t.ScriptAsset=R.default;var C=r(35);t.ShaderAsset=C.default;var O=r(59);t.SkinAsset=O.default;var I=r(60);t.Texture2DAsset=I.default;var j=r(61);t.TextureCubeAsset=j.default;var k=r(24);t.VideoAsset=k.default;var L=r(10);t.BaseObject=L.default;var B=r(68);t.NodeObject=B.default;var N=r(66);t.BoneObject=N.default;var V=r(67);t.CameraObject=V.default;var U=r(37);t.LightObject=U.default;var z=r(25);t.MeshObject=z.default;var F=r(38);t.SceneObject=F.default;var G=r(15);t.LoadingType=G.default;var q=r(11);t.LoadingEvent=q.default;var H=r(69);t.LoadingState=H.default;var $=r(2);t.BaseComponent=$.default;var W=r(63);t.Handedness=W.Handedness;var X=r(64);t.RenderMode=X.RenderMode;var Q=r(3);t.log=Q.default;var Z=r(228);t.XhrResourceLoader=Z.default,i.__exportStar(r(22),t);var Y=r(46);t.globalEvents=Y.default;var K=r(190);t.browserCaps=K.default},function(e,t,r){r(265),e.exports=r(32).Array.find},function(e,t,r){r(266),e.exports=r(32).Math.log10},function(e,t,r){r(267),e.exports=r(32).Math.log2},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(){var e=this;this.defaultGeometry=new i.BufferGeometry,this.defaultGeometry.setIndex(new i.BufferAttribute(new Uint16Array(0),1));var t={position:new i.BufferAttribute(new Float32Array(0),3),normal:new i.BufferAttribute(new Float32Array(0),3,!0),skinWeight:new i.BufferAttribute(new Float32Array(0),4,!0),skinIndex:new i.BufferAttribute(new Uint16Array(0),4,!0)};Object.keys(t).forEach(function(r){var i=t[r];e.defaultGeometry.addAttribute(r,i)})}return e.prototype.destroy=function(){this.defaultGeometry&&(this.defaultGeometry.dispose(),this.defaultGeometry=void 0)},e.prototype.getDefaultGeometry=function(){return this.defaultGeometry},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(5),a=function(){function e(){this.components=[]}return e.prototype.initializeComponents=function(){this.listenTo(this.engine,"scriptDeleted",this.onScriptDeleted),this.listenTo(this,"change:component",this.onComponentChanged),this.listenTo(this,"remove:component",this.onComponentRemoved),this.listenTo(this,"add:component",this.onComponentAdded)},e.prototype.getComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.components;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getPreviousComponentDescriptor=function(e){var t="function"!=typeof e,r=this.sharedData.previousComponents;return n.deepClone(r.find(function(r){return t||e(r)}))},e.prototype.getComponentDescriptors=function(e){var t="function"!=typeof e,r=this.sharedData.components;return r.filter(function(r){return t||e(r)}).map(function(e){return n.deepClone(e)})},e.prototype.getComponentDescriptorById=function(e){return this.getComponentDescriptor(function(t){return t.id===e})},e.prototype.getPreviousComponentDescriptorById=function(e){return this.getPreviousComponentDescriptor(function(t){return t.id===e})},e.prototype.addComponent=function(e,t,r){void 0===t&&(t={}),void 0===r&&(r="");var i={scriptId:"string"==typeof e?e:e.id,attributes:t,enabled:!0,name:r},n=this.engine.entityDispatcher;return n.dispatchComponentAdded(this.id,i),this.components[this.components.length-1]},e.prototype.removeComponent=function(e){var t=e.getIndex();return t>=0&&(this.engine.entityDispatcher.dispatchComponentRemoved(this.id,t),!0)},e.prototype.getComponentByIndex=function(e){return this.components[e]||null},e.prototype.getComponentByName=function(e){return this.getComponent(function(t){return t.getName()===e})},e.prototype.getComponentsByName=function(e){return this.getComponents(function(t){return t.getName()===e})},e.prototype.getComponentByScriptId=function(e){return this.getComponent(function(t){return t.getScriptId()===e})},e.prototype.getComponentsByScriptId=function(e){return this.getComponents(function(t){return t.getScriptId()===e})},e.prototype.getComponentByScriptName=function(e){return this.getComponent(function(t){return t.getScriptName()===e})},e.prototype.getComponentsByScriptName=function(e){return this.getComponents(function(t){return t.getScriptName()===e})},e.prototype.getComponent=function(e){var t="function"!=typeof e;return this.components.find(function(r){return t||e(r)})},e.prototype.getComponentById=function(e){return this.getComponent(function(t){return t.getId()===e})},e.prototype.getComponents=function(e){var t="function"!=typeof e;return this.components.filter(function(r){return t||e(r)})},e.prototype.setComponents=function(e,t){var r=this;void 0===t&&(t=!1);for(var i=this.engine.entityDispatcher,n=this.sharedData.components.length;n>=0;n--)i.dispatchComponentRemoved(this.id,n);e.forEach(function(e){i.dispatchComponentAdded(r.id,e)})},e.prototype.startComponents=function(){var e=this;this.components.forEach(function(t){return e.startComponent(t)})},e.prototype.stopComponents=function(){var e=this;this.components.forEach(function(t){return e.stopComponent(t)})},e.prototype.onScriptDeleted=function(e){var t=this,r=this.getComponentsByScriptId(e);r.forEach(function(e){t.removeComponent(e)})},e.prototype.onComponentChanged=function(e,t){var r=this.getComponentByIndex(e);if(!r)throw new Error("Don't have a component at index "+e);if(t.attributes){this.assignAttributeValues(r,t.attributes);var i=Object.keys(t.attributes);r.trigger("attributesChanged",i)}t.name&&(r.name=t.name)},e.prototype.onComponentAdded=function(e){var t=this.createComponentObject(e);t.trigger("awake"),this.assignAttributeValues(t);var r=t.getScriptAsset(),i=Object.keys(r.getProperty("attributes"));t.trigger("attributesChanged",i),this.isBaseUnloaded()||this.startComponent(t)},e.prototype.onComponentRemoved=function(e){var t=this.components[e];if(!t)throw new Error("Can't find component at index "+e+" to remove.");this.stopComponent(t),this.components.splice(e,1)},e.prototype.translateAttributeValue=function(e,t,r,n){var a=this,o=this.engine;if(!r)throw new Error("Attribute "+t+" does not exist for this component.");switch(r.type){case"asset":e[t]=o.getAssetById(n);break;case"object":e[t]=o.getObjectById(n);break;case"custom":e[t]=e[t]||{},Object.keys(n).forEach(function(i){a.translateAttributeValue(e[t],i,r.attributes[i],n[i])});break;case"c":e[t]=e[t]||new i.Color,e[t].setRGB(n.r,n.g,n.b);break;case"a":e[t]=e[t]||[];var s;switch(r.subType.type){case"asset":n.forEach(function(r,i){e[t][i]=o.getAssetById(r)});break;case"object":n.forEach(function(r,i){e[t][i]=o.getObjectById(r)});break;case"custom":n.forEach(function(i,o){e[t][o]=e[t][o]||{},Object.keys(i).forEach(function(i){a.translateAttributeValue(e[t][o],i,r.subType.attributes[i],n[o][i])})});break;case"a":n.forEach(function(i,o){e[t][o]=e[t][o]||[],i.forEach(function(i,s){a.translateAttributeValue(e[t][o],s.toString(10),r.subType.subType,n[o][s])})});break;case"v2":s=i.Vector2;case"v3":s=s?s:i.Vector3;case"v4":s=s?s:i.Vector4;case"q":s=s?s:i.Quaternion,n.forEach(function(r,i){e[t][i]=e[t][i]||new s,e[t][i].copy(r)});break;default:n.forEach(function(r,i){e[t][i]=r})}break;case"v2":s=i.Vector2;case"v3":s=s?s:i.Vector3;case"v4":s=s?s:i.Vector4;case"q":s=s?s:i.Quaternion,e[t]=e[t]||new s,e[t].copy(n);break;default:e[t]=n}},e.prototype.assignAttributeValues=function(e,t){var r=this,i="object"!=typeof t,n=e.getScriptAsset(),a=n.getProperty("attributes")||{};Object.keys(a).forEach(function(n){if(i||t.hasOwnProperty(n)){var o=a[n],s=e.getAttribute(o.name);r.translateAttributeValue(e,o.name,o,s)}})},e.prototype.createComponentObject=function(e){var t=e.scriptId,r=this.engine.getAssetById(t);if(!r)throw new Error("Unable to find script asset for "+t);r.isUnloaded()&&r.load();var i=new r.sharedData.classConstructor;return this.components.push(i),Object.assign(i,{id:e.id,name:e.name,scriptName:r.getName(),scriptId:t,enabled:!!e.enabled,entity:this}),i.bindSelfEvents(),i},e.prototype.startComponent=function(e){e.trigger("startup")},e.prototype.stopComponent=function(e){e.trigger("shutdown")},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(9),n=r(3),a=function(){function e(){this.ownDependencies={},this.dependencies={}}return e.prototype.getOwnDependencies=function(){var e=this;return Object.keys(this.ownDependencies).map(function(t){return e.engine.getEntityById(t)}).filter(function(e){return e})},e.prototype.getOwnDependencyInfo=function(){return this.ownDependencies},e.prototype.getDependencies=function(e){var t=this,r="function"!=typeof e;return Object.keys(this.dependencies).map(function(e){return t.engine.getEntityById(e)}).filter(function(t){return r||e(t)})},e.prototype.getDependenciesByClass=function(e){return this.getDependencies(function(t){return t instanceof e})},e.prototype.getDependenciesByType=function(e){return this.getDependencies(function(t){return t.type===e})},e.prototype.getDependencyInfo=function(){return this.dependencies},e.prototype.registerDependencyById=function(e){this.registerDependency(this.engine.getEntityById(e))},e.prototype.registerDependency=function(e){var t=this;if(!e)return void n.default.warn("Trying to register invalid entity as a dependency.");var r=this.getOwnDependencyInfo(),a=e.id;r[a]?r[a].count++:(r[a]={count:1},r[a].onSubDependencyChange=function(e,i){if(r[a])for(var n=0;n=r.components.length-1)){var i=Math.min(Math.max(t,0),r.components.length-1);i<0||(r.previousComponents=r.components?r.components.slice():[],r.components.splice(i,1),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){var r=t.getEntityById(e);r.trigger("remove:component",i)}))}},e.prototype.dispatchComponentAdded=function(e,t){var r=this.entities[e];if(r){r.previousComponents=r.components?r.components.slice():[];var i=a.deepClone(t);i.id=i.id||n.v4(),i.name=i.name||"unnamed component",i.attributes=i.attributes||{},i.enabled=i.enabled!==!1,r.components.push(i),this.fireExternalUpdate(e,{components:r.components}),this.engines.forEach(function(t){var r=t.getEntityById(e);r.trigger("add:component",i)})}},e.prototype.fireExternalUpdate=function(e,t,r){var i=new u.default;i.type=r?r:"updateEntity",i.entityId=e,i.entityData=t,o.default.trigger("EntityUpdates",i)},e}();t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(48),n=r(34),a=r(49),o=r(6),s=r(66),u=r(20),p=r(67),c=r(75),l=r(51),d=r(52),h=r(37),f=r(14),m=r(25),y=r(53),g=r(68),v=r(54),b=r(55),P=r(56),x=r(57),E=r(38),w=r(58),_=r(35),S=r(59),D=r(60),A=r(61),T=r(24),M=function(){function e(){this.objects={},this.assets={}}return e.prototype.destroy=function(){var e=this;this.getAssets().forEach(function(t){return e.unregisterEntity(t)}),this.getObjects().forEach(function(t){return e.unregisterEntity(t)})},e.prototype.getAsset=function(e){return this.getEntity(e,this.assets)},e.prototype.getAssets=function(e){return this.getEntities(e,this.assets)},e.prototype.getAssetById=function(e){return this.assets[e]||null},e.prototype.getAssetByName=function(e){return this.getAsset(function(t){return t.getName()===e})},e.prototype.getAssetsByName=function(e){return this.getAssets(function(t){return t.getName()===e})},e.prototype.getAssetByClass=function(e){return this.getAsset(function(t){return t instanceof e})},e.prototype.getAssetByType=function(e){return this.getAsset(function(t){return t.type===e})},e.prototype.getAssetsByClass=function(e){return this.getAssets(function(t){return t instanceof e})},e.prototype.getAssetsByType=function(e){return this.getAssets(function(t){return t.type===e})},e.prototype.getObject=function(e){return this.getEntity(e,this.objects)},e.prototype.getObjects=function(e){return this.getEntities(e,this.objects)},e.prototype.getObjectById=function(e){return this.objects[e]||null},e.prototype.getObjectByName=function(e){return this.getObject(function(t){return t.getName()===e})},e.prototype.getObjectsByName=function(e){return this.getObjects(function(t){return t.getName()===e})},e.prototype.getObjectByClass=function(e){return this.getObject(function(t){return t instanceof e})},e.prototype.getObjectByType=function(e){return this.getObject(function(t){return t.type===e})},e.prototype.getObjectsByType=function(e){return this.getObjects(function(t){return t.type===e})},e.prototype.getObjectsByClass=function(e){return this.getObjects(function(t){return t instanceof e})},e.prototype.getEntity=function(e,t){if(!t)return this.getAsset(e)||this.getObject(e);var r=Object.keys(t).find(function(r){return e(t[r])});return t[r]},e.prototype.getEntities=function(e,t){if(!t)return this.getObjects(e).concat(this.getAssets(e));var r="function"!=typeof e;return Object.keys(t).filter(function(i){return r||e(t[i])}).map(function(e){return t[e]})},e.prototype.getEntityById=function(e){return this.assets[e]||this.objects[e]||null},e.prototype.getEntityByClass=function(e){return this.getEntity(function(t){return t instanceof e})},e.prototype.getEntityByType=function(e){return this.getEntity(function(t){return t.type===e})},e.prototype.getEntitiesByClass=function(e){return this.getEntities(function(t){return t instanceof e})},e.prototype.getEntitiesByType=function(e){return this.getEntities(function(t){return t.type===e})},e.prototype.getEntityByName=function(e){return this.getEntity(function(t){return t.getName()===e})},e.prototype.getEntitiesByName=function(e){return this.getEntities(function(t){return t.getName()===e})},e.prototype.unregisterEntityById=function(e){this.unregisterEntity(this.getEntityById(e))},e.prototype.unregisterEntity=function(e){e&&(e.uninitialize(),this.objects[e.id]?delete this.objects[e.id]:(e.off("load",this.onAssetLoaded,this),e.off("unload",this.onAssetUnloaded,this),delete this.assets[e.id]))},e.prototype.getClassType=function(e){switch(e){case i.default:return"animation";case n.default:return"application";case a.default:return"audio";case s.default:return"bone";case u.default:return"buffer";case p.default:return"camera";case c.default:return"document";case l.default:return"dracoGeometry";case d.default:return"image";case h.default:return"light";case f.default:return"material";case m.default:return"mesh";case y.default:return"meshGeometry";case g.default:return"node";case v.default:return"prefab";case b.default:return"primitiveGeometry";case P.default:return"renderTexture2D";case x.default:return"renderTextureCube";case E.default:return"scene";case w.default:return"script";case _.default:return"shader";case S.default:return"skin";case D.default:return"texture2D";case A.default:return"textureCube";case T.default:return"video";default:return null}},e.prototype.getEntityClass=function(t){return e.entityNameTypeMap[t]?e.entityNameTypeMap[t]:null},e.prototype.registerEntity=function(e){var t=new(this.getEntityClass(e.type))(e);t.engine=this,t instanceof o.default?(this.assets[t.id]=t,t.on("load",this.onAssetLoaded,this),t.on("unload",this.onAssetUnloaded,this)):this.objects[t.id]=t},e.prototype.onAssetLoaded=function(e){this.trigger("assetLoaded",e)},e.prototype.onAssetUnloaded=function(e){this.trigger("assetUnloaded",e)},e.entityNameTypeMap={animation:i.default,application:n.default,audio:a.default,bone:s.default,buffer:u.default,camera:p.default,document:c.default,dracoGeometry:l.default,image:d.default,light:h.default,material:f.default,mesh:m.default,meshGeometry:y.default,node:g.default,prefab:v.default,primitiveGeometry:b.default,renderTexture2D:P.default,renderTextureCube:x.default,scene:E.default,script:w.default,shader:_.default,skin:S.default,texture2D:D.default,textureCube:A.default,video:T.default},e}();t.default=M},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){this.type="updateEntity",this.entityId="",this.entityData={}}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e}();t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=r(213),a=r(238),o=r(237),s={id:"box3d_pbr_shader",type:"shader",properties:{name:"PBR Shader",vertexShader:a,fragmentShader:o,parameters:n.default,uniforms:i.UniformsUtils.merge([i.UniformsLib.common,i.UniformsLib.emissivemap,i.UniformsLib.bumpmap,i.UniformsLib.normalmap,i.UniformsLib.roughnessmap,i.UniformsLib.metalnessmap,i.UniformsLib.displacementmap,i.UniformsLib.fog,i.UniformsLib.lights,{time:{value:1},emissive:{value:new i.Color(0)},specular:{value:new i.Color(1118481)},roughness:{value:0},metalness:{value:0},clearCoat:{value:0},clearCoatRoughness:{value:0},envMapIntensity:{value:1}}])}};t.default=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i={albedoColor:{displayName:"Base Albedo",description:"A color to tint the material with.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isUniform:!0,uniformName:"diffuse"},albedoMap:{displayName:"Albedo Map",description:"A texture that modifies the diffuse color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,uniformName:"map",enabledWhen:{albedoMap:{notEqualsDefault:!0}}},opacity:{displayName:"Opacity",description:"This option controls the total opacity of the material.",type:"f",default:1,min:0,max:1,isUniform:!0,isRenderParam:!0,transparency:"LessThanOne"},alphaMap:{displayName:"Alpha Map",description:"A texture that stores the transparency info of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,transparency:"NotFalsy",enabledWhen:{alphaMap:{notEqualsDefault:!0}}},specularColor:{displayName:"Specular Color",description:"A color to tint the material with.",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isUniform:!0,uniformName:"specular"},specularMap:{displayName:"Specular Map",description:"A texture that contains the specular color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{specularMap:{notEqualsDefault:!0}}},metalness:{displayName:"Metalness",description:"How metallic the surface appears (multiplied by the metalness texture).",type:"f",min:0,max:1,default:0,isUniform:!0,enabledWhen:{metalness:{notEqualsDefault:!0}}},metalnessMap:{displayName:"Metalness Map",description:"A texture that contains the metalness of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{metalnessMap:{notEqualsDefault:!0}}},glossMap:{displayName:"Gloss Map",description:"A texture that stores the gloss info of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{glossMap:{notEqualsDefault:!0},roughnessMap:{equalsDefault:!0}}},roughness:{displayName:"Roughness",description:"How rough the surface appears.",type:"f",min:0,max:1,default:0,isUniform:!0,isRenderParam:!0},roughnessMap:{displayName:"Roughness Map",description:"A texture that stores the roughness info of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{roughnessMap:{notEqualsDefault:!0}}},reflectivity:{displayName:"Reflectivity",description:"Reflectivity at normal incidence. i.e. when viewing the surface directly.",type:"f",min:0,max:1,default:.02,isUniform:!0,isRenderParam:!0,uniformName:"reflectivity"},normalMap:{displayName:"Normal Map",description:"",type:"t",default:null,isUniform:!0,isRenderParam:!0,derivatives:!0,textureUsage:"normal",enabledWhen:{normalMap:{notEqualsDefault:!0}}},normalScale:{displayName:"Normal Scale",description:"blah",type:"v2",default:{x:1,y:1},isUniform:!0,isRenderParam:!0},bumpMap:{displayName:"Bump Map",description:"",type:"t",default:null,isUniform:!0,isRenderParam:!0,derivatives:!0,textureUsage:"bump",enabledWhen:{normalMap:{equalsDefault:!0},bumpMap:{notEqualsDefault:!0}}},bumpScale:{displayName:"Bump Scale",description:"blah",type:"f",min:0,max:20,default:1,isUniform:!0,isRenderParam:!0,enabledWhen:{normalMap:{equalsDefault:!0},bumpMap:{notEqualsDefault:!0}},displayWhen:{useBump:{equals:!0}}},clearCoat:{displayName:"Clear Coat",type:"f",min:0,max:1,isUniform:!0,isRenderParam:!0,default:0,enabledWhen:{clearCoat:{notEquals:0}}},clearCoatRoughness:{displayName:"Clear Coat Roughness",type:"f",min:0,max:1,isUniform:!0,isRenderParam:!0,default:0,enabledWhen:{clearCoat:{notEquals:0}}},envMapRadiance:{displayName:"Radiance Light Map",description:"A map that represents the surrounding environment. Used for reflections.",type:"t",default:null,isUniform:!0,forceUpdate:!0,enabledWhen:{envMapRadiance:{notEqualsDefault:!0}}},envMapRadianceHalfGloss:{displayName:"Half Radiance Light Map",description:"A cube-map that represents the surrounding environment. Used for reflections.",type:"t",textureType:"Cube",default:null,isUniform:!0,enabledWhen:{envMapIrradiance:{notEqualsDefault:!0},envMapRadiance:{notEqualsDefault:!0},envMapRadianceHalfGloss:{notEqualsDefault:!0}}},envMapIrradiance:{displayName:"Irradiance Light Map",description:"A cube-map that represents the surrounding environment. Used for reflections.",type:"t",textureType:"Cube",default:null,isUniform:!0,enabledWhen:{envMapIrradiance:{notEqualsDefault:!0}},displayWhen:{envMapIrradiance:{notEqualsDefault:!0}}},envMapGlossVariance:{displayName:"Environment Map Gloss Variance",description:"Turn on multi-sampling of environment map based on varying glossiness of surface.",type:"b",default:!0,forceUpdate:!0,enabledWhen:{envMapGlossVariance:{equals:!0}}},emissiveColor:{displayName:"Emissive Color",description:"A color that represents the light emitted by the material.",type:"c",default:{r:0,g:0,b:0},isUniform:!0,isRenderParam:!0,uniformName:"emissive",enabledWhen:{emissiveColor:{notEqualsDefault:!0}}},emissiveMap:{displayName:"Emissive Map",description:"A texture that modifies the emissive color of the material.",type:"t",default:null,isUniform:!0,isRenderParam:!0,enabledWhen:{emissiveMap:{notEqualsDefault:!0}}},aoMap:{displayName:"AO Map",description:"The ambient occlusion of the material.",type:"t",default:null,isUniform:!0,enabledWhen:{aoMap:{notEqualsDefault:!0}}}};t.default=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(120),a=r(119),o={id:"fbx_surface_lambert_shader",type:"shader",properties:{name:"FBX Surface Lambert Shader",vertexShader:"MeshLambertMaterial",fragmentShader:"MeshLambertMaterial",parameters:i.__assign({},n.default,a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(120),a=r(119),o={id:"fbx_surface_phong_shader",type:"shader",properties:{name:"FBX Surface Phong Shader",vertexShader:"MeshPhongMaterial",fragmentShader:"MeshPhongMaterial",parameters:i.__assign({},n.default,{specular:{displayName:"Specular Color",description:"The color reflected specularly by the surface from lights",type:"c",default:{r:1,g:1,b:1},min:0,max:1,isRenderParam:!0,uniformName:"specular"},specularTexture:{displayName:"Specular Map",description:"The color reflected specularly by the surface from lights",type:"t",default:null,isRenderParam:!0,uniformName:"specularMap",enabledWhen:{specularTexture:{notEqualsDefault:!0}}},shininess:{displayName:"Shininess",description:"The shininess exponent of the surface. Higher is glossier.",type:"f",default:30,min:0,max:512,isRenderParam:!0,uniformName:"shininess"},reflectionFactor:{displayName:"Reflectivity",description:"A value to scale the reflectivity by.",type:"f",default:1,min:0,max:100,isRenderParam:!0,uniformName:"reflectivity"},reflectionTexture:{displayName:"Reflection Texture",description:"A texture that represents the environment around the surface.",type:"t",default:null,isRenderParam:!0,uniformName:"envMap",enabledWhen:{reflectionTexture:{notEqualsDefault:!0}}}},a.default)}};t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(14),n=r(19),a=function(){function e(e){this.engine=e,this.standInTextures=[],this.engine=e,this.engine.on("rebuildMaterials",this.rebuildAll,this),this.engine.on("rendererResize",this.onResize,this),this.engine.on("update",this.update,this),this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE]={texture:null,color:[255,255,255]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_WHITE_CUBE]={texture:null,color:[255,255,255],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK]={texture:null,color:[0,0,0]},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_BLACK_CUBE]={texture:null,color:[0,0,0],type:"Cube"},this.standInTextures[i.StandInTexture.STANDIN_TEXTURE_NORMAL]={texture:null,color:[127,127,255]}}return e.prototype.destroy=function(){this.engine.off("rebuildMaterials",this.rebuildAll,this),this.engine.off("rendererResize",this.onResize,this),this.engine.off("update",this.update,this),this.standInTextures.forEach(function(e){e.texture&&e.texture.dispose()})},e.prototype.getMissingMaterial=function(){return this.engine.getAssetById("missingMaterial")},e.prototype.getStandInTexture=function(e){if(!this.standInTextures[e])return null;if(!this.standInTextures[e].texture){var t=this.standInTextures[e].color;"Cube"===this.standInTextures[e].type?this.standInTextures[e].texture=n.default.createColorTextureCube(t[0],t[1],t[2]):this.standInTextures[e].texture=n.default.createColorTexture(t[0],t[1],t[2])}return this.standInTextures[e].texture},e.prototype.update=function(e){i.default.timeValueInUse&&(this.engine.needsRender=!0),i.default.sharedUniforms.time.value=e},e.prototype.rebuildAll=function(){var e=this.engine.getAssetsByClass(i.default);e.forEach(function(e){e.runtimeData&&Object.keys(i.default.materialObjectTypes).forEach(function(t){e.runtimeData[t].needsUpdate=!0})})},e.prototype.onResize=function(){var e=i.default.sharedUniforms.screenDimensions;e.value.x=0,e.value.y=0;var t=this.engine.getRenderer();t?(e.value.z=t.getCanvasWidth(),e.value.w=t.getCanvasHeight()):(e.value.z=128,e.value.w=128)},e}();t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","vec4 texel = texture2D( tDiffuse, vUv );","gl_FragColor = opacity * texel;","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(1),n=function(){function e(e,t){void 0===t&&(t="tDiffuse"),this.enabled=!0,this.needsSwap=!0,this.renderToScreen=!1,this.clear=!1,this.textureId=t,this.uniforms=i.UniformsUtils.clone(e.uniforms), +this.material=new i.ShaderMaterial({blending:i.NormalBlending,transparent:!0,uniforms:this.uniforms,vertexShader:e.vertexShader,fragmentShader:e.fragmentShader}),this.camera=new i.OrthographicCamera(-1,1,1,-1,0,1),this.scene=new i.Scene,this.quad=new i.Mesh(new i.PlaneGeometry(2,2),null),this.scene.add(this.quad),this.prevViewPort=new i.Vector4}return e.prototype.render=function(e,t,r){this.uniforms[this.textureId]&&(this.uniforms[this.textureId].value=r),this.quad.material=this.material,this.renderToScreen?(this.viewPort&&e.setViewport(this.viewPort.x,this.viewPort.y,this.viewPort.width,this.viewPort.height),(this.clearColor||this.clearDepth)&&e.clear(!!this.clearColor,!!this.clearDepth,!1),e.render(this.scene,this.camera)):this.renderToTexture?((this.clearColor||this.clearDepth)&&e.clear(this.clearColor,this.clearDepth,!1),e.render(this.scene,this.camera,this.renderToTexture)):e.render(this.scene,this.camera,t,this.clear)},e.prototype.dispose=function(){this.quad.geometry.dispose(),this.quad=void 0,this.camera=void 0,this.scene=void 0,this.material.dispose(),this.material=void 0,this.uniforms=void 0},e}();t.default=n},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={uniforms:{tDiffuse:{type:"t",value:null},rgbmMultiplier:{type:"f",value:9}},vertexShader:["varying vec2 vUv;","void main() {","vUv = uv;","#ifdef FLIP_Y","vUv.y = 1.0 - vUv.y;","#endif","gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform sampler2D tDiffuse;","uniform float rgbmMultiplier;","const mat3 InverseLogLuvMatrix = mat3(","6.0014, -2.7008, -1.7996,","-1.3320, 3.1029, -5.7721,","0.3008, -1.0882, 5.6268);","vec3 HDRDecodeLOGLUV(in vec4 vLogLuv)","{","float Le = vLogLuv.z * 255.0 + vLogLuv.w;","vec3 Xp_Y_XYZp;","Xp_Y_XYZp.y = exp2((Le - 127.0) / 2.0);","Xp_Y_XYZp.z = Xp_Y_XYZp.y / vLogLuv.y;","Xp_Y_XYZp.x = vLogLuv.x * Xp_Y_XYZp.z;","vec3 vRGB = InverseLogLuvMatrix * Xp_Y_XYZp;","return vRGB;","}","vec3 HDRDecodeRGBM( vec4 rgbm ) {","return rgbmMultiplier * rgbm.rgb * rgbm.a;","}","vec3 HDRDecodeRGBD( vec4 rgbd ) {","return rgbd.rgb / max(rgbd.a, 0.003);","}","vec3 HDRDecodeRGBE( vec4 rgbe ) {","float f = exp2( rgbe.w * 255.0 - (128.0 + 0.0) );","return rgbe.rgb * f;","}","varying vec2 vUv;","void main() {","vec3 hdrColour;","#ifdef HDR_RGBM","hdrColour = HDRDecodeRGBM( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBD)","hdrColour = HDRDecodeRGBD( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_RGBE)","hdrColour = HDRDecodeRGBE( texture2D( tDiffuse, vUv ) );","#elif defined(HDR_LOGLUV)","hdrColour = HDRDecodeLOGLUV( texture2D( tDiffuse, vUv ) );","#else","hdrColour = texture2D( tDiffuse, vUv ).xyz;","#endif","gl_FragColor = vec4( hdrColour, 1.0 );","}"].join("\n")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(27),a=r(69),o=r(11),s=r(227),u=r(45);t.loadableResourceMixins=u.default({},[n.default]);var p=function(e){function t(t,r,i){void 0===i&&(i={});var n=e.call(this)||this;if(n.path=t,n.type=r,n.params=i,n.state=a.default.STARTING,n.error=void 0,n.data=void 0,n.loaderData={},!t)throw new Error("Missing required `path` argument");if(!r)throw new Error("Missing required `type` argument");return n}return i.__extends(t,e),t.prototype.setState=function(e){switch(e){case a.default.STARTING:throw new s.default(this.state,e);case a.default.LOADING:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.PROCESSING:if(this.state!==a.default.LOADING)throw new s.default(this.state,e);break;case a.default.COMPLETE:if(this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.CANCELLED:if(this.state!==a.default.STARTING&&this.state!==a.default.LOADING&&this.state!==a.default.PROCESSING)throw new s.default(this.state,e);break;case a.default.ERROR:break;default:throw new Error("Unknown state: "+e)}return this.state=e,this.trigger(o.default.STATE_CHANGE,e),e},t.prototype.setLoading=function(){this.setState(a.default.LOADING)},t.prototype.setProcessing=function(){this.setState(a.default.PROCESSING)},t.prototype.setComplete=function(e){this.setState(a.default.COMPLETE),this.data=e,this.trigger(o.default.LOAD,e),this.done()},t.prototype.setError=function(e){this.setState(a.default.ERROR),this.error=e,this.trigger(o.default.ERROR,e),this.done()},t.prototype.setCancelled=function(){this.setState(a.default.CANCELLED),this.trigger(o.default.CANCEL),this.done()},t.prototype.isCancelled=function(){return this.state===a.default.CANCELLED},t.prototype.done=function(){this.trigger(o.default.DONE,this.state),this.off()},t}(t.loadableResourceMixins);t.default=p},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return e.setProcessing(),e.setComplete(e.loaderData.xhr.response),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("arraybuffer")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(240),n=r(191),a=r(26),o=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response,r=e.path.indexOf("?"),a=r>=0?r:e.path.length,o=e.path.slice(0,e.path.lastIndexOf("/",a)+1);if(void 0===t||void 0===t.version||t.version.major>4)return Promise.reject(new Error("Unsupported data version"));var s=new RegExp(/^(?:[a-z]+:)?\/\//i),u=new RegExp(/^\//),p=function(e){return!e.match(s)&&!e.match(u)},c=i.mapEntities(t.entities,t.version);return c.forEach(function(e){if(n.isAsset(e)&&e.representations&&e.representations.forEach(function(e){e.src&&p(e.src)&&(e.src=o+e.src)}),"buffer"===e.type){var t=e.properties;t.src&&p(t.src)&&(t.src=o+t.src)}}),e.setComplete(c),Promise.resolve(e)};t.default=function(e,t){return a.retry(function(e){return 202===e.loaderData.xhr.status},[a.unlessCancelled(a.makeXhr(t)),a.unlessCancelled(a.setResponseType("json")),a.unlessCancelled(a.setCustomHeaders),a.unlessCancelled(a.loadXhr)])(e).then(a.unlessCancelled(a.requireStatus(function(e){return 200===e}))).then(a.unlessCancelled(o)).catch(a.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return new Promise(function(t){if(e.setProcessing(),e.loaderData.xhr.response instanceof Blob){var r=URL.createObjectURL(e.loaderData.xhr.response),i=new Image;i.onload=function(){e.setComplete(i),t(e)},i.src=r}else e.setComplete(e.loaderData.xhr.response),t(e)})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){e.setProcessing();var t="string"==typeof e.loaderData.xhr.response?JSON.parse(e.loaderData.xhr.response):e.loaderData.xhr.response;return e.setComplete(t),Promise.resolve(e)};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("json")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(26),n=function(e){return new Promise(function(t,r){e.setProcessing();var i=URL.createObjectURL(e.loaderData.xhr.response),n=document.createElement("video");n.addEventListener("loadeddata",function(){e.setComplete(n),t(e)}),n.addEventListener("error",function(){return r(new Error("Failed to load video"))}),n.src=i,n.load()})};t.default=function(e,t){return i.retry(function(e){return 202===e.loaderData.xhr.status},[i.unlessCancelled(i.makeXhr(t)),i.unlessCancelled(i.setResponseType("blob")),i.unlessCancelled(i.setCustomHeaders),i.unlessCancelled(i.loadXhr)])(e).then(i.unlessCancelled(i.requireStatus(function(e){return 200===e}))).then(i.unlessCancelled(n)).catch(i.handleError(e))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(3),n=r(11),a=r(9),o=function(){function e(){this.loadingResources=[]}return e.prototype.loadResource=function(e,t,r,o){var s=this;void 0===o&&(o={});var u=this.engine.resourceLoader.load(e,t,o);return this.loadingResources.push(u),u.on(n.default.ERROR,function(e){i.default.error(s.engine.getName()+(" - ResourceLifecycle: Error loading "+s.type+",")+(s.getName()+", "+e.toString())),s.setState(a.StateType.Base,a.State.Failed)}),u.on(n.default.DONE,function(){s.loadingResources=s.loadingResources.filter(function(e){return e!==u}),"function"==typeof r&&r()}),u},e.prototype.abortRequests=function(){this.loadingResources.forEach(function(e){return e.setCancelled()})},e}();t.default=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(0),n=r(69),a=function(e){function t(t,r){var i=e.call(this,'Illegal state transition "'+n.default[t]+'" -> "'+n.default[r]+'"')||this;return i.from=t,i.to=r,i}return i.__extends(t,e),t}(Error);t.default=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(220),n=r(230),a=r(221),o=r(223),s=r(224),u=r(225),p=r(222),c=r(11),l=r(15),d=4,h=function(e,t){var r=new XMLHttpRequest;return r.open("GET",e),Promise.resolve(r)},f=[];f[l.default.BUFFER]=a.default,f[l.default.IMAGE]=o.default,f[l.default.VIDEO]=u.default,f[l.default.ENTITIES]=p.default,f[l.default.JSON]=s.default;var m=function(){function e(e,t){if(void 0===e&&(e=h),void 0===t&&(t=f),this.xhrPromise=e,this.strategies=t,this.resources={},!e)throw new Error("Must provide argument `xhrPromise`!");if(!t)throw new Error("Must provide argument `strategies`!");this.queue=n.default(d)}return e.prototype.destroy=function(){this.queue.destroy()},e.prototype.load=function(e,t,r){var n=this;if(!this.strategies[t])throw new Error("Unsupported type: "+t);if(this.resources[e])return this.resources[e];var a=this.resources[e]=new i.default(e,t,r);return this.queue.add(function(){return new Promise(function(r){var i=function(){delete n.resources[e],a.off(c.default.LOAD,i),a.off(c.default.ERROR,i),a.off(c.default.CANCEL,i),r(a)};a.once(c.default.LOAD,i),a.once(c.default.ERROR,i),a.once(c.default.CANCEL,i),n.strategies[t](a,n.xhrPromise)})},r.priority),a},e}();t.default=m},function(e,t,r){"use strict";function i(e){return e.replace(/([a-z])([A-Z])/g,"$1_$2").replace(/([A-Z]+)([A-Z])([a-z])/,"$1_$2$3").toUpperCase()}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t="string"==typeof e?e:"";return t=t.replace(/_([a-z])/gi,function(e,t){return"_"+t.toUpperCase()}),t=t.replace(/\s+/g,"_"),t=t.replace(/([a-z])([0-9])/g,"$1_$2"),t=i(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=4,n=5,a=function(e,t){void 0===e&&(e=i),void 0===t&&(t=n);var r=[],a=[],o=!0,s=function(){for(var t=function(){var e=r.pop();a.push(e),e.fn().then(function(){var t=a.indexOf(e);t>=0&&(a.splice(t,1),s())})};r.length>0&&a.length=1&&r<=12&&i>=1&&i<=m[r]}function a(e,t){var r=e.match(y);if(!r)return!1;var i=r[1],n=r[2],a=r[3],o=r[5];return i<=23&&n<=59&&a<=59&&(!t||o)}function o(e){var t=e.split(E);return 2==t.length&&n(t[0])&&a(t[1],!0)}function s(e){return e.length<=255&&g.test(e)}function u(e){return w.test(e)&&v.test(e)}function p(e){try{return new RegExp(e),!0}catch(e){return!1}}function c(e,t){if(e&&t)return e>t?1:et?1:e=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function o(e,t,r){var i=s.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function s(e,t,r){for(var i=0;i=55296&&t<=56319&&n=t)throw new Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw new Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!n)return a}for(var s=a,p=n.split("/"),c=0;c",_="result"+n,S=e.opts.v5&&o&&o.$data;if(S?(i+=" var schema"+n+" = "+e.util.getData(o.$data,a,e.dataPathArr)+"; ",v="schema"+n):v=o,E){var D=e.util.getData(x.$data,a,e.dataPathArr),A="exclusive"+n,T="op"+n,M="' + "+T+" + '";i+=" var schemaExcl"+n+" = "+D+"; ",D="schemaExcl"+n,i+=" if (typeof "+D+" != 'boolean' && "+D+" !== undefined) { "+l+" = false; ";var r=P,R=R||[];R.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(r||"_formatExclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: '"+P+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var C=i;i=R.pop(),i+=!e.compositeRule&&p?e.async?" throw new ValidationError(["+C+"]); ":" validate.errors = ["+C+"]; return false; ":" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",p&&(f+="}",i+=" else { "),S&&(i+=" if ("+v+" === undefined) "+l+" = true; else if (typeof "+v+" != 'string') "+l+" = false; else { ",f+="}"),h&&(i+=" if (!"+g+") "+l+" = true; else { ",f+="}"),i+=" var "+_+" = "+g+"("+c+", ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+_+" === undefined) "+l+" = false; var "+A+" = "+D+" === true; if ("+l+" === undefined) { "+l+" = "+A+" ? "+_+" "+w+" 0 : "+_+" "+w+"= 0; } if (!"+l+") var op"+n+" = "+A+" ? '"+w+"' : '"+w+"=';"}else{var A=x===!0,M=w;A||(M+="=");var T="'"+M+"'";S&&(i+=" if ("+v+" === undefined) "+l+" = true; else if (typeof "+v+" != 'string') "+l+" = false; else { ",f+="}"),h&&(i+=" if (!"+g+") "+l+" = true; else { ",f+="}"),i+=" var "+_+" = "+g+"("+c+", ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" ); if ("+_+" === undefined) "+l+" = false; if ("+l+" === undefined) "+l+" = "+_+" "+w,A||(i+="="),i+=" 0;"}i+=""+f+"if (!"+l+") { ";var r=t,R=R||[];R.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(r||"_formatLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+T+", limit: ",i+=S?""+v:""+e.util.toQuotedString(o),i+=" , exclusive: "+A+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be "+M+' "',i+=S?"' + "+v+" + '":""+e.util.escapeQuotes(o),i+="\"' "),e.opts.verbose&&(i+=" , schema: ",i+=S?"validate.schema"+s:""+e.util.toQuotedString(o),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var C=i;return i=R.pop(),i+=!e.compositeRule&&p?e.async?" throw new ValidationError(["+C+"]); ":" validate.errors = ["+C+"]; return false; ":" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="}"}},{}],14:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maximum"==t,f=h?"exclusiveMaximum":"exclusiveMinimum",m=e.schema[f],y=e.opts.v5&&m&&m.$data,g=h?"<":">",v=h?">":"<";if(y){var b=e.util.getData(m.$data,o,e.dataPathArr),P="exclusive"+a,x="op"+a,E="' + "+x+" + '";n+=" var schemaExcl"+a+" = "+b+"; ",b="schemaExcl"+a,n+=" var exclusive"+a+"; if (typeof "+b+" != 'boolean' && typeof "+b+" != 'undefined') { ";var r=f,w=w||[];w.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",e.opts.messages!==!1&&(n+=" , message: '"+f+" should be boolean' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var _=n;n=w.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+_+"]); ":" validate.errors = ["+_+"]; return false; ":" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else if( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" ((exclusive"+a+" = "+b+" === true) ? "+l+" "+v+"= "+i+" : "+l+" "+v+" "+i+") || "+l+" !== "+l+") { var op"+a+" = exclusive"+a+" ? '"+g+"' : '"+g+"=';"}else{var P=m===!0,E=g;P||(E+="=");var x="'"+E+"'";n+=" if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+l+" "+v,P&&(n+="="),n+=" "+i+" || "+l+" !== "+l+") {"}var r=t,w=w||[];w.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+x+", limit: "+i+", exclusive: "+P+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be "+E+" ",n+=d?"' + "+i:""+s+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var _=n;return n=w.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+_+"]); ":" validate.errors = ["+_+"]; return false; ":" var err = "+_+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { "),n}},{}],15:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maxItems"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" "+l+".length "+h+" "+i+") { "; var r=t,f=f||[];f.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have ",n+="maxItems"==t?"more":"less",n+=" than ",n+=d?"' + "+i+" + '":""+s,n+=" items' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],16:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maxLength"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=e.opts.unicode===!1?" "+l+".length ":" ucs2length("+l+") ",n+=" "+h+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT be ",n+="maxLength"==t?"longer":"shorter",n+=" than ",n+=d?"' + "+i+" + '":""+s,n+=" characters' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],17:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var h="maxProperties"==t?">":"<";n+="if ( ",d&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),n+=" Object.keys("+l+").length "+h+" "+i+") { ";var r=t,f=f||[];f.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { limit: "+i+" } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have ",n+="maxProperties"==t?"more":"less",n+=" than ",n+=d?"' + "+i+" + '":""+s,n+=" properties' "),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;return n=f.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],18:[function(e,t,r){"use strict";t.exports=function(e,t){var r=" ",i=e.schema[t],n=e.schemaPath+e.util.getProperty(t),a=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,s=e.util.copy(e),u="";s.level++;var p="valid"+s.level,c=s.baseId,l=!0,d=i;if(d)for(var h,f=-1,m=d.length-1;f "+D+") { ";var T=c+"["+D+"]";h.schema=S,h.schemaPath=s+"["+D+"]",h.errSchemaPath=u+"/"+D,h.errorPath=e.util.getPathExpr(e.errorPath,D,e.opts.jsonPointers,!0),h.dataPathArr[g]=D;var M=e.validate(h);h.baseId=b,i+=e.util.varOccurences(M,v)<2?" "+e.util.varReplace(M,v,T)+" ":" var "+v+" = "+T+"; "+M+" ",i+=" } ",p&&(i+=" if ("+m+") { ",f+="}")}if("object"==typeof P&&e.util.schemaHasRules(P,e.RULES.all)){h.schema=P,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+m+" = true; if ("+c+".length > "+o.length+") { for (var "+y+" = "+o.length+"; "+y+" < "+c+".length; "+y+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var T=c+"["+y+"]";h.dataPathArr[g]=y;var M=e.validate(h);h.baseId=b,i+=e.util.varOccurences(M,v)<2?" "+e.util.varReplace(M,v,T)+" ":" var "+v+" = "+T+"; "+M+" ",p&&(i+=" if (!"+m+") break; "),i+=" } } ",p&&(i+=" if ("+m+") { ",f+="}")}}else if(e.util.schemaHasRules(o,e.RULES.all)){h.schema=o,h.schemaPath=s,h.errSchemaPath=u,i+=" for (var "+y+" = 0; "+y+" < "+c+".length; "+y+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var T=c+"["+y+"]";h.dataPathArr[g]=y;var M=e.validate(h);h.baseId=b,i+=e.util.varOccurences(M,v)<2?" "+e.util.varReplace(M,v,T)+" ":" var "+v+" = "+T+"; "+M+" ",p&&(i+=" if (!"+m+") break; "),i+=" } ",p&&(i+=" if ("+m+") { ",f+="}")}return p&&(i+=" "+f+" if ("+d+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],26:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d=e.opts.v5&&s&&s.$data;d?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s,n+="var division"+a+";if (",d&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),n+=" (division"+a+" = "+l+" / "+i+", ",n+=e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",d&&(n+=" ) "),n+=" ) { ";var h=h||[];h.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"multipleOf")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { multipleOf: "+i+" } ",e.opts.messages!==!1&&(n+=" , message: 'should be multiple of ",n+=d?"' + "+i:""+s+"'"),e.opts.verbose&&(n+=" , schema: ",n+=d?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var f=n;return n=h.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+f+"]); ":" validate.errors = ["+f+"]; return false; ":" var err = "+f+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",c&&(n+=" else { "),n}},{}],27:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),l="errs__"+n,d=e.util.copy(e);d.level++;var h="valid"+d.level;if(e.util.schemaHasRules(o,e.RULES.all)){d.schema=o,d.schemaPath=s,d.errSchemaPath=u,i+=" var "+l+" = errors; ";var f=e.compositeRule;e.compositeRule=d.compositeRule=!0,d.createErrors=!1;var m;d.opts.allErrors&&(m=d.opts.allErrors,d.opts.allErrors=!1),i+=" "+e.validate(d)+" ",d.createErrors=!0,m&&(d.opts.allErrors=m),e.compositeRule=d.compositeRule=f,i+=" if ("+h+") { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(r||"not")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var g=i;i=y.pop(),i+=!e.compositeRule&&p?e.async?" throw new ValidationError(["+g+"]); ":" validate.errors = ["+g+"]; return false; ":" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+l+"; if (vErrors !== null) { if ("+l+") vErrors.length = "+l+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: '"+(r||"not")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",p&&(i+=" if (false) { ");return i}},{}],28:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i=" ",n=e.level,a=e.dataLevel,o=e.schema[t],s=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,p=!e.opts.allErrors,c="data"+(a||""),l="valid"+n,d="errs__"+n,h=e.util.copy(e),f="";h.level++;var m="valid"+h.level;i+="var "+d+" = errors;var prevValid"+n+" = false;var "+l+" = false;";var y=h.baseId,g=e.compositeRule;e.compositeRule=h.compositeRule=!0;var v=o;if(v)for(var b,P=-1,x=v.length-1;P5)i+=" || validate.schema"+s+"["+y+"] ";else{var j=b;if(j)for(var k,L=-1,B=j.length-1;L= "+me+"; ",u=e.errSchemaPath+"/patternGroups/minimum",i+=" if (!"+l+") { ";var X=X||[];X.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(r||"patternGroups")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { reason: '"+ve+"', limit: "+ge+", pattern: '"+e.util.escapeQuotes(G)+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have "+be+" than "+ge+' properties matching pattern "'+e.util.escapeQuotes(G)+"\"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var Q=i;i=X.pop(),i+=!e.compositeRule&&p?e.async?" throw new ValidationError(["+Q+"]); ":" validate.errors = ["+Q+"]; return false; ":" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",void 0!==ye&&(i+=" else ")}if(void 0!==ye){var ge=ye,ve="maximum",be="more";i+=" "+l+" = pgPropCount"+n+" <= "+ye+"; ",u=e.errSchemaPath+"/patternGroups/maximum",i+=" if (!"+l+") { ";var X=X||[];X.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(r||"patternGroups")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { reason: '"+ve+"', limit: "+ge+", pattern: '"+e.util.escapeQuotes(G)+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have "+be+" than "+ge+' properties matching pattern "'+e.util.escapeQuotes(G)+"\"' "),e.opts.verbose&&(i+=" , schema: validate.schema"+s+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),i+=" } "):i+=" {} ";var Q=i;i=X.pop(),i+=!e.compositeRule&&p?e.async?" throw new ValidationError(["+Q+"]); ":" validate.errors = ["+Q+"]; return false; ":" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}u=W,p&&(i+=" if ("+l+") { ",f+="}")}}}}return p&&(i+=" "+f+" if ("+d+" == errors) {"),i=e.util.cleanUpCode(i)}},{}],32:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n,a=" ",o=e.level,s=e.dataLevel,u=e.schema[t],p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(s||""),d="valid"+o;if("#"==u||"#/"==u)e.isRoot?(i=e.async,n="validate"):(i=e.root.schema.$async===!0,n="root.refVal[0]");else{var h=e.resolveRef(e.baseId,u,e.isRoot);if(void 0===h){var f="can't resolve reference "+u+" from id "+e.baseId;if("fail"==e.opts.missingRefs){console.log(f);var m=m||[];m.push(a),a="",e.createErrors!==!1?(a+=" { keyword: '"+(r||"$ref")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { ref: '"+e.util.escapeQuotes(u)+"' } ",e.opts.messages!==!1&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(u)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(u)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),a+=" } "):a+=" {} ";var y=a;a=m.pop(),a+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+y+"]); ":" validate.errors = ["+y+"]; return false; ":" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c&&(a+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs){var g=new Error(f);throw g.missingRef=e.resolve.url(e.baseId,u),g.missingSchema=e.resolve.normalizeId(e.resolve.fullPath(g.missingRef)),g}console.log(f),c&&(a+=" if (true) { ")}}else if(h.inline){var v=e.util.copy(e);v.level++;var b="valid"+v.level;v.schema=h.schema,v.schemaPath="",v.errSchemaPath=u;var P=e.validate(v).replace(/validate\.schema/g,h.code);a+=" "+P+" ",c&&(a+=" if ("+b+") { ")}else i=h.$async===!0,n=h.code}if(n){var m=m||[];m.push(a),a="",a+=e.opts.passContext?" "+n+".call(this, ":" "+n+"( ",a+=" "+l+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var x=s?"data"+(s-1||""):"parentData",E=s?e.dataPathArr[s]:"parentDataProperty";a+=" , "+x+" , "+E+", rootData) ";var w=a;if(a=m.pop(),i){if(!e.async)throw new Error("async schema referenced by sync schema");a+=" try { ",c&&(a+="var "+d+" ="),a+=" "+e.yieldAwait+" "+w+"; } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; } ",c&&(a+=" if ("+d+") { ")}else a+=" if (!"+w+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",c&&(a+=" else { ")}return a}},{}],33:[function(e,t,r){"use strict";t.exports=function(e,t){var r,i,n=" ",a=e.level,o=e.dataLevel,s=e.schema[t],u=e.schemaPath+e.util.getProperty(t),p=e.errSchemaPath+"/"+t,c=!e.opts.allErrors,l="data"+(o||""),d="valid"+a,h=e.opts.v5&&s&&s.$data;h?(n+=" var schema"+a+" = "+e.util.getData(s.$data,o,e.dataPathArr)+"; ",i="schema"+a):i=s;var f="schema"+a;if(!h)if(s.length=e.opts.loopRequired;if(c)if(n+=" var missing"+a+"; ",E){h||(n+=" var "+f+" = validate.schema"+u+"; ");var w="i"+a,_="schema"+a+"["+w+"]",S="' + "+_+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(x,_,e.opts.jsonPointers)),n+=" var "+d+" = true; ",h&&(n+=" if (schema"+a+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+a+")) "+d+" = false; else {"),n+=" for (var "+w+" = 0; "+w+" < "+f+".length; "+w+"++) { "+d+" = "+l+"["+f+"["+w+"]] !== undefined; if (!"+d+") break; } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var D=D||[];D.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"required")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { missingProperty: '"+S+"' } ",e.opts.messages!==!1&&(n+=" , message: '",n+=e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+S+"\\'",n+="' "),e.opts.verbose&&(n+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var A=n;n=D.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+A+"]); ":" validate.errors = ["+A+"]; return false; ":" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } else { "}else{n+=" if ( ";var T=m;if(T)for(var M,w=-1,R=T.length-1;w 1) { var i = "+l+".length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal("+l+"[i], "+l+"[j])) { "+d+" = false; break outer; } } } } ",h&&(n+=" } "),n+=" if (!"+d+") { ";var f=f||[];f.push(n),n="",e.createErrors!==!1?(n+=" { keyword: '"+(r||"uniqueItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(n+=" , schema: ",n+=h?"validate.schema"+u:""+s,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+l+" "),n+=" } "):n+=" {} ";var m=n;n=f.pop(),n+=!e.compositeRule&&c?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",c&&(n+=" else { ")}else c&&(n+=" if (true) { ");return n}},{}],36:[function(e,t,r){"use strict";t.exports=function(e,t){function r(e){for(var t=0;t