Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babylonjs-loaders

Package Overview
Dependencies
Maintainers
0
Versions
630
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babylonjs-loaders - npm Package Compare versions

Comparing version 7.30.0 to 7.30.1

2

babylon.glTF1FileLoader.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-loaders",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-loaders"]=t(require("babylonjs")):e.LOADERS=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(e=>(()=>{"use strict";var t={597:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.d(o,{default:()=>le});var a={};r.r(a),r.d(a,{GLTFValidation:()=>b});var i={};r.r(i),r.d(i,{GLTFFileLoader:()=>O,GLTFLoaderAnimationStartMode:()=>m,GLTFLoaderCoordinateSystemMode:()=>p,GLTFLoaderState:()=>v});var s={};r.r(s),r.d(s,{EBlendingFunction:()=>x,EComponentType:()=>E,ECullingType:()=>M,EParameterType:()=>T,EShaderType:()=>L,ETextureFilterType:()=>S,ETextureFormat:()=>C,ETextureWrapMode:()=>N,GLTFBinaryExtension:()=>oe,GLTFLoader:()=>ne,GLTFLoaderBase:()=>te,GLTFLoaderExtension:()=>re,GLTFMaterialsCommonExtension:()=>ae,GLTFUtils:()=>I});var l={};r.r(l),r.d(l,{GLTF1:()=>s,GLTFFileLoader:()=>O,GLTFLoaderAnimationStartMode:()=>m,GLTFLoaderCoordinateSystemMode:()=>p,GLTFLoaderState:()=>v,GLTFValidation:()=>b});var u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},u(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var d=r(597);function f(e,t,n,r){var o={externalResourceFunction:r};return n&&(o.uri="file:"===t?n:t+n),ArrayBuffer.isView(e)?GLTFValidator.validateBytes(e,o):GLTFValidator.validateString(e,o)}function h(){var e=[];onmessage=function(t){var n=t.data;switch(n.id){case"init":importScripts(n.url);break;case"validate":f(n.data,n.rootUrl,n.fileName,(function(t){return new Promise((function(n,r){var o=e.length;e.push({resolve:n,reject:r}),postMessage({id:"getExternalResource",index:o,uri:t})}))})).then((function(e){postMessage({id:"validate.resolve",value:e})}),(function(e){postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[n.index].resolve(n.value);break;case"getExternalResource.reject":e[n.index].reject(n.reason)}}}var p,m,v,b=function(){function e(){}return e.ValidateAsync=function(e,t,n,r){var o=this;return"function"==typeof Worker?new Promise((function(a,i){var s="".concat(f,"(").concat(h,")()"),l=URL.createObjectURL(new Blob([s],{type:"application/javascript"})),u=new Worker(l),c=function(e){u.removeEventListener("error",c),u.removeEventListener("message",p),i(e)},p=function(e){var t=e.data;switch(t.id){case"getExternalResource":r(t.uri).then((function(e){u.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e.buffer])}),(function(e){u.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":u.removeEventListener("error",c),u.removeEventListener("message",p),a(t.value),u.terminate();break;case"validate.reject":u.removeEventListener("error",c),u.removeEventListener("message",p),i(t.reason),u.terminate()}};if(u.addEventListener("error",c),u.addEventListener("message",p),u.postMessage({id:"init",url:d.Tools.GetBabylonScriptURL(o.Configuration.url)}),ArrayBuffer.isView(e)){var m=e.slice();u.postMessage({id:"validate",data:m,rootUrl:t,fileName:n},[m.buffer])}else u.postMessage({id:"validate",data:e,rootUrl:t,fileName:n})})):(this._LoadScriptPromise||(this._LoadScriptPromise=d.Tools.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return f(e,t,n,r)})))},e.Configuration={url:"".concat(d.Tools._DefaultCdnUrl,"/gltf_validator.js")},e}(),y="Z2xURg",A="gltf",_={".gltf":{isBinary:!1},".glb":{isBinary:!0}};function g(e,t,n){try{return Promise.resolve(new Uint8Array(e,t,n))}catch(e){return Promise.reject(e)}}!function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(p||(p={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(m||(m={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(v||(v={}));var O=function(e){function t(t){var n=e.call(this)||this;return n.onParsedObservable=new d.Observable,n.onMeshLoadedObservable=new d.Observable,n.onSkinLoadedObservable=new d.Observable,n.onTextureLoadedObservable=new d.Observable,n.onMaterialLoadedObservable=new d.Observable,n.onCameraLoadedObservable=new d.Observable,n.onCompleteObservable=new d.Observable,n.onErrorObservable=new d.Observable,n.onDisposeObservable=new d.Observable,n.onExtensionLoadedObservable=new d.Observable,n.validate=!1,n.onValidatedObservable=new d.Observable,n._loader=null,n._state=null,n._requests=new Array,n.name=A,n.extensions=_,n.onLoaderStateChangedObservable=new d.Observable,n._logIndentLevel=0,n._loggingEnabled=!1,n._log=n._logDisabled,n._capturePerformanceCounters=!1,n._startPerformanceCounter=n._startPerformanceCounterDisabled,n._endPerformanceCounter=n._endPerformanceCounterDisabled,n.copyFrom(t),n}return c(t,e),Object.defineProperty(t.prototype,"onParsed",{set:function(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),e&&(this._onParsedObserver=this.onParsedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMeshLoaded",{set:function(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),e&&(this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSkinLoaded",{set:function(e){this._onSkinLoadedObserver&&this.onSkinLoadedObservable.remove(this._onSkinLoadedObserver),e&&(this._onSkinLoadedObserver=this.onSkinLoadedObservable.add((function(t){return e(t.node,t.skinnedNode)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTextureLoaded",{set:function(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),e&&(this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMaterialLoaded",{set:function(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),e&&(this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCameraLoaded",{set:function(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),e&&(this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onComplete",{set:function(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onError",{set:function(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onExtensionLoaded",{set:function(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loggingEnabled",{get:function(){return this._loggingEnabled},set:function(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capturePerformanceCounters",{get:function(){return this._capturePerformanceCounters},set:function(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onValidated",{set:function(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._loader&&(this._loader.dispose(),this._loader=null);for(var e=0,t=this._requests;e<t.length;e++)t[e].abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()},t.prototype.loadFile=function(e,t,n,r,o,a,i,s){var l=this;if(ArrayBuffer.isView(t))return this._loadBinary(e,t,n,r,i,s),null;this._progressCallback=o;var u=t.name||d.Tools.GetFilename(t);if(a){if(this.useRangeRequests){this.validate&&d.Logger.Warn("glTF validation is not supported when range requests are enabled");var c={abort:function(){},onCompleteObservable:new d.Observable},f={readAsync:function(n,r){return new Promise((function(o,a){l._loadFile(e,t,(function(e){o(new Uint8Array(e))}),!0,(function(e){a(e)}),(function(e){e.setRequestHeader("Range","bytes=".concat(n,"-").concat(n+r-1))}))}))},byteLength:0};return this._unpackBinaryAsync(new d.DataReader(f)).then((function(e){c.onCompleteObservable.notifyObservers(c),r(e)}),i?function(e){return i(void 0,e)}:void 0),c}return this._loadFile(e,t,(function(t){l._validate(e,new Uint8Array(t,0,t.byteLength),n,u),l._unpackBinaryAsync(new d.DataReader({readAsync:function(e,n){return g(t,e,n)},byteLength:t.byteLength})).then((function(e){r(e)}),i?function(e){return i(void 0,e)}:void 0)}),!0,i)}return this._loadFile(e,t,(function(t){try{l._validate(e,t,n,u),r({json:l._parseJson(t)})}catch(e){i&&i()}}),!1,i)},t.prototype._loadBinary=function(e,t,n,r,o,a){this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n,a),this._unpackBinaryAsync(new d.DataReader({readAsync:function(e,n){return function(e,t,n){try{if(t<0||t>=e.byteLength)throw new RangeError("Offset is out of range.");if(t+n>e.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(e.buffer,e.byteOffset+t,n))}catch(e){return Promise.reject(e)}}(t,e,n)},byteLength:t.byteLength})).then((function(e){r(e)}),o?function(e){return o(void 0,e)}:void 0)},t.prototype.importMeshAsync=function(e,t,n,r,o,a){var i=this;return Promise.resolve().then((function(){return i.onParsedObservable.notifyObservers(n),i.onParsedObservable.clear(),i._log("Loading ".concat(a||"")),i._loader=i._getLoader(n),i._loader.importMeshAsync(e,t,null,n,r,o,a)}))},t.prototype.loadAsync=function(e,t,n,r,o){var a=this;return Promise.resolve().then((function(){return a.onParsedObservable.notifyObservers(t),a.onParsedObservable.clear(),a._log("Loading ".concat(o||"")),a._loader=a._getLoader(t),a._loader.loadAsync(e,t,n,r,o)}))},t.prototype.loadAssetContainerAsync=function(e,t,n,r,o){var a=this;return Promise.resolve().then((function(){a.onParsedObservable.notifyObservers(t),a.onParsedObservable.clear(),a._log("Loading ".concat(o||"")),a._loader=a._getLoader(t);var i=new d.AssetContainer(e),s=[];a.onMaterialLoadedObservable.add((function(e){s.push(e)}));var l=[];a.onTextureLoadedObservable.add((function(e){l.push(e)}));var u=[];a.onCameraLoadedObservable.add((function(e){u.push(e)}));var c=[];return a.onMeshLoadedObservable.add((function(e){e.morphTargetManager&&c.push(e.morphTargetManager)})),a._loader.importMeshAsync(null,e,i,t,n,r,o).then((function(e){return Array.prototype.push.apply(i.geometries,e.geometries),Array.prototype.push.apply(i.meshes,e.meshes),Array.prototype.push.apply(i.particleSystems,e.particleSystems),Array.prototype.push.apply(i.skeletons,e.skeletons),Array.prototype.push.apply(i.animationGroups,e.animationGroups),Array.prototype.push.apply(i.materials,s),Array.prototype.push.apply(i.textures,l),Array.prototype.push.apply(i.lights,e.lights),Array.prototype.push.apply(i.transformNodes,e.transformNodes),Array.prototype.push.apply(i.cameras,u),Array.prototype.push.apply(i.morphTargetManagers,c),i}))}))},t.prototype.canDirectLoad=function(e){return function(e){return-1!==e.indexOf("asset")&&-1!==e.indexOf("version")||e.startsWith("data:base64,"+y)||e.startsWith("data:;base64,"+y)||e.startsWith("data:application/octet-stream;base64,"+y)||e.startsWith("data:model/gltf-binary;base64,"+y)}(e)},t.prototype.directLoad=function(e,t){if(t.startsWith("base64,"+y)||t.startsWith(";base64,"+y)||t.startsWith("application/octet-stream;base64,"+y)||t.startsWith("model/gltf-binary;base64,"+y)){var n=(0,d.DecodeBase64UrlToBinary)(t);return this._validate(e,new Uint8Array(n,0,n.byteLength)),this._unpackBinaryAsync(new d.DataReader({readAsync:function(e,t){return g(n,e,t)},byteLength:n.byteLength}))}return this._validate(e,t),Promise.resolve({json:this._parseJson(t)})},t.prototype.createPlugin=function(e){return new t(e[A])},Object.defineProperty(t.prototype,"loaderState",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.whenCompleteAsync=function(){var e=this;return new Promise((function(t,n){e.onCompleteObservable.addOnce((function(){t()})),e.onErrorObservable.addOnce((function(e){n(e)}))}))},t.prototype._setState=function(e){this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(v[this._state]))},t.prototype._loadFile=function(e,t,n,r,o,a){var i=this,s=e._loadFile(t,n,(function(e){i._onProgress(e,s)}),!0,r,o,a);return s.onCompleteObservable.add((function(){s._lengthComputable=!0,s._total=s._loaded})),this._requests.push(s),s},t.prototype._onProgress=function(e,t){if(this._progressCallback){t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;for(var n=!0,r=0,o=0,a=0,i=this._requests;a<i.length;a++){var s=i[a];if(void 0===s._lengthComputable||void 0===s._loaded||void 0===s._total)return;n=n&&s._lengthComputable,r+=s._loaded,o+=s._total}this._progressCallback({lengthComputable:n,loaded:r,total:n?o:0})}},t.prototype._validate=function(e,t,n,r){var o=this;void 0===n&&(n=""),void 0===r&&(r=""),this.validate&&(this._startPerformanceCounter("Validate JSON"),b.ValidateAsync(t,n,r,(function(t){return o.preprocessUrlAsync(n+t).then((function(t){return e._loadFileAsync(t,void 0,!0,!0).then((function(e){return new Uint8Array(e,0,e.byteLength)}))}))})).then((function(e){o._endPerformanceCounter("Validate JSON"),o.onValidatedObservable.notifyObservers(e),o.onValidatedObservable.clear()}),(function(e){o._endPerformanceCounter("Validate JSON"),d.Tools.Warn("Failed to validate: ".concat(e.message)),o.onValidatedObservable.clear()})))},t.prototype._getLoader=function(e){var n=e.json.asset||{};this._log("Asset version: ".concat(n.version)),n.minVersion&&this._log("Asset minimum version: ".concat(n.minVersion)),n.generator&&this._log("Asset generator: ".concat(n.generator));var r=t._parseVersion(n.version);if(!r)throw new Error("Invalid version: "+n.version);if(void 0!==n.minVersion){var o=t._parseVersion(n.minVersion);if(!o)throw new Error("Invalid minimum version: "+n.minVersion);if(t._compareVersion(o,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+n.minVersion)}var a={1:t._CreateGLTF1Loader,2:t._CreateGLTF2Loader}[r.major];if(!a)throw new Error("Unsupported version: "+n.version);return a(this)},t.prototype._parseJson=function(e){this._startPerformanceCounter("Parse JSON"),this._log("JSON length: ".concat(e.length));var t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t},t.prototype._unpackBinaryAsync=function(e){var t=this;return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((function(){var n=e.readUint32();if(1179937895!==n)throw new d.RuntimeError("Unexpected magic: "+n,d.ErrorCodes.GLTFLoaderUnexpectedMagicError);var r=e.readUint32();t.loggingEnabled&&t._log("Binary version: ".concat(r));var o,a=e.readUint32();switch(t.useRangeRequests||a===e.buffer.byteLength||d.Logger.Warn("Length in header does not match actual data length: ".concat(a," != ").concat(e.buffer.byteLength)),r){case 1:o=t._unpackBinaryV1Async(e,a);break;case 2:o=t._unpackBinaryV2Async(e,a);break;default:throw new Error("Unsupported version: "+r)}return t._endPerformanceCounter("Unpack Binary"),o}))},t.prototype._unpackBinaryV1Async=function(e,t){var n=e.readUint32(),r=e.readUint32();if(0!==r)throw new Error("Unexpected content format: ".concat(r));var o=t-e.byteOffset,a={json:this._parseJson(e.readString(n)),bin:null};if(0!==o){var i=e.byteOffset;a.bin={readAsync:function(t,n){return e.buffer.readAsync(i+t,n)},byteLength:o}}return Promise.resolve(a)},t.prototype._unpackBinaryV2Async=function(e,t){var n=this,r=1313821514,o=e.readUint32();if(e.readUint32()!==r)throw new Error("First chunk format is not JSON");return e.byteOffset+o===t?e.loadAsync(o).then((function(){return{json:n._parseJson(e.readString(o)),bin:null}})):e.loadAsync(o+8).then((function(){var a={json:n._parseJson(e.readString(o)),bin:null},i=function(){var n=e.readUint32();switch(e.readUint32()){case r:throw new Error("Unexpected JSON chunk");case 5130562:var o=e.byteOffset;a.bin={readAsync:function(t,n){return e.buffer.readAsync(o+t,n)},byteLength:n},e.skipBytes(n);break;default:e.skipBytes(n)}return e.byteOffset!==t?e.loadAsync(8).then(i):Promise.resolve(a)};return i()}))},t._parseVersion=function(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};var t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},t._compareVersion=function(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0},t.prototype._logOpen=function(e){this._log(e),this._logIndentLevel++},t.prototype._logClose=function(){--this._logIndentLevel},t.prototype._logEnabled=function(e){var n=t._logSpaces.substring(0,2*this._logIndentLevel);d.Logger.Log("".concat(n).concat(e))},t.prototype._logDisabled=function(e){},t.prototype._startPerformanceCounterEnabled=function(e){d.Tools.StartPerformanceCounter(e)},t.prototype._startPerformanceCounterDisabled=function(e){},t.prototype._endPerformanceCounterEnabled=function(e){d.Tools.EndPerformanceCounter(e)},t.prototype._endPerformanceCounterDisabled=function(e){},t.IncrementalLoading=!0,t.HomogeneousCoordinates=!1,t._logSpaces=" ",t}(function(){function e(){this.coordinateSystemMode=p.AUTO,this.animationStartMode=m.FIRST,this.loadNodeAnimations=!0,this.loadSkins=!0,this.loadMorphTargets=!0,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.loadOnlyMaterials=!1,this.skipMaterials=!1,this.useSRGBBuffers=!0,this.targetFps=60,this.alwaysComputeSkeletonRootNode=!1,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.extensionOptions={}}return e.prototype.copyFrom=function(e){var t,n,r,o,a,i,s,l,u,c,d,f,h,p,m,v,b,y,A,_;e&&(this.onParsed=e.onParsed,this.coordinateSystemMode=null!==(t=e.coordinateSystemMode)&&void 0!==t?t:this.coordinateSystemMode,this.animationStartMode=null!==(n=e.animationStartMode)&&void 0!==n?n:this.animationStartMode,this.loadNodeAnimations=null!==(r=e.loadNodeAnimations)&&void 0!==r?r:this.loadNodeAnimations,this.loadSkins=null!==(o=e.loadSkins)&&void 0!==o?o:this.loadSkins,this.loadMorphTargets=null!==(a=e.loadMorphTargets)&&void 0!==a?a:this.loadMorphTargets,this.compileMaterials=null!==(i=e.compileMaterials)&&void 0!==i?i:this.compileMaterials,this.useClipPlane=null!==(s=e.useClipPlane)&&void 0!==s?s:this.useClipPlane,this.compileShadowGenerators=null!==(l=e.compileShadowGenerators)&&void 0!==l?l:this.compileShadowGenerators,this.transparencyAsCoverage=null!==(u=e.transparencyAsCoverage)&&void 0!==u?u:this.transparencyAsCoverage,this.useRangeRequests=null!==(c=e.useRangeRequests)&&void 0!==c?c:this.useRangeRequests,this.createInstances=null!==(d=e.createInstances)&&void 0!==d?d:this.createInstances,this.alwaysComputeBoundingBox=null!==(f=e.alwaysComputeBoundingBox)&&void 0!==f?f:this.alwaysComputeBoundingBox,this.loadAllMaterials=null!==(h=e.loadAllMaterials)&&void 0!==h?h:this.loadAllMaterials,this.loadOnlyMaterials=null!==(p=e.loadOnlyMaterials)&&void 0!==p?p:this.loadOnlyMaterials,this.skipMaterials=null!==(m=e.skipMaterials)&&void 0!==m?m:this.skipMaterials,this.useSRGBBuffers=null!==(v=e.useSRGBBuffers)&&void 0!==v?v:this.useSRGBBuffers,this.targetFps=null!==(b=e.targetFps)&&void 0!==b?b:this.targetFps,this.alwaysComputeSkeletonRootNode=null!==(y=e.alwaysComputeSkeletonRootNode)&&void 0!==y?y:this.alwaysComputeSkeletonRootNode,this.preprocessUrlAsync=null!==(A=e.preprocessUrlAsync)&&void 0!==A?A:this.preprocessUrlAsync,this.customRootNode=e.customRootNode,this.onMeshLoaded=e.onMeshLoaded,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onCameraLoaded=e.onCameraLoaded,this.extensionOptions=null!==(_=e.extensionOptions)&&void 0!==_?_:this.extensionOptions)},e}());(0,d.registerSceneLoaderPlugin)(new O);var E,L,T,N,S,C,M,x,R=void 0!==r.g?r.g:"undefined"!=typeof window?window:void 0;if(void 0!==R){for(var w in R.BABYLON=R.BABYLON||{},i)R.BABYLON[w]=i[w];for(var w in a)R.BABYLON[w]=a[w]}!function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.FLOAT=5126]="FLOAT"}(E||(E={})),function(e){e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(L||(L={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D"}(T||(T={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(N||(N={})),function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9728]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(S||(S={})),function(e){e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA"}(C||(C={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(M||(M={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(x||(x={}));var P,I=function(){function e(){}return e.SetMatrix=function(e,t,n,r,o){var a=null;if("MODEL"===n.semantic?a=t.getWorldMatrix():"PROJECTION"===n.semantic?a=e.getProjectionMatrix():"VIEW"===n.semantic?a=e.getViewMatrix():"MODELVIEWINVERSETRANSPOSE"===n.semantic?a=d.Matrix.Transpose(t.getWorldMatrix().multiply(e.getViewMatrix()).invert()):"MODELVIEW"===n.semantic?a=t.getWorldMatrix().multiply(e.getViewMatrix()):"MODELVIEWPROJECTION"===n.semantic?a=t.getWorldMatrix().multiply(e.getTransformMatrix()):"MODELINVERSE"===n.semantic?a=t.getWorldMatrix().invert():"VIEWINVERSE"===n.semantic?a=e.getViewMatrix().invert():"PROJECTIONINVERSE"===n.semantic?a=e.getProjectionMatrix().invert():"MODELVIEWINVERSE"===n.semantic?a=t.getWorldMatrix().multiply(e.getViewMatrix()).invert():"MODELVIEWPROJECTIONINVERSE"===n.semantic?a=t.getWorldMatrix().multiply(e.getTransformMatrix()).invert():"MODELINVERSETRANSPOSE"===n.semantic&&(a=d.Matrix.Transpose(t.getWorldMatrix().invert())),a)switch(n.type){case T.FLOAT_MAT2:o.setMatrix2x2(r,d.Matrix.GetAsMatrix2x2(a));break;case T.FLOAT_MAT3:o.setMatrix3x3(r,d.Matrix.GetAsMatrix3x3(a));break;case T.FLOAT_MAT4:o.setMatrix(r,a)}},e.SetUniform=function(e,t,n,r){switch(r){case T.FLOAT:return e.setFloat(t,n),!0;case T.FLOAT_VEC2:return e.setVector2(t,d.Vector2.FromArray(n)),!0;case T.FLOAT_VEC3:return e.setVector3(t,d.Vector3.FromArray(n)),!0;case T.FLOAT_VEC4:return e.setVector4(t,d.Vector4.FromArray(n)),!0;default:return!1}},e.GetWrapMode=function(e){switch(e){case N.CLAMP_TO_EDGE:return d.Texture.CLAMP_ADDRESSMODE;case N.MIRRORED_REPEAT:return d.Texture.MIRROR_ADDRESSMODE;case N.REPEAT:default:return d.Texture.WRAP_ADDRESSMODE}},e.GetByteStrideFromType=function(e){switch(e.type){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}},e.GetTextureFilterMode=function(e){switch(e){case S.LINEAR:case S.LINEAR_MIPMAP_NEAREST:case S.LINEAR_MIPMAP_LINEAR:return d.Texture.TRILINEAR_SAMPLINGMODE;case S.NEAREST:case S.NEAREST_MIPMAP_NEAREST:return d.Texture.NEAREST_SAMPLINGMODE;default:return d.Texture.BILINEAR_SAMPLINGMODE}},e.GetBufferFromBufferView=function(e,t,n,r,o){n=t.byteOffset+n;var a=e.loadedBufferViews[t.buffer];if(n+r>a.byteLength)throw new Error("Buffer access is out of range");var i=a.buffer;switch(n+=a.byteOffset,o){case E.BYTE:return new Int8Array(i,n,r);case E.UNSIGNED_BYTE:return new Uint8Array(i,n,r);case E.SHORT:return new Int16Array(i,n,r);case E.UNSIGNED_SHORT:return new Uint16Array(i,n,r);default:return new Float32Array(i,n,r)}},e.GetBufferFromAccessor=function(t,n){var r=t.bufferViews[n.bufferView],o=n.count*e.GetByteStrideFromType(n);return e.GetBufferFromBufferView(t,r,n.byteOffset,o,n.componentType)},e.DecodeBufferToText=function(e){for(var t="",n=e.byteLength,r=0;r<n;++r)t+=String.fromCharCode(e[r]);return t},e.GetDefaultMaterial=function(t){if(!e._DefaultMaterial){d.Effect.ShadersStore.GLTFDefaultMaterialVertexShader=["precision highp float;","","uniform mat4 worldView;","uniform mat4 projection;","","attribute vec3 position;","","void main(void)","{"," gl_Position = projection * worldView * vec4(position, 1.0);","}"].join("\n"),d.Effect.ShadersStore.GLTFDefaultMaterialPixelShader=["precision highp float;","","uniform vec4 u_emission;","","void main(void)","{"," gl_FragColor = u_emission;","}"].join("\n");var n={attributes:["position"],uniforms:["worldView","projection","u_emission"],samplers:new Array,needAlphaBlending:!1};e._DefaultMaterial=new d.ShaderMaterial("GLTFDefaultMaterial",t,{vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},n),e._DefaultMaterial.setColor4("u_emission",new d.Color4(.5,.5,.5,1))}return e._DefaultMaterial},e._DefaultMaterial=null,e}();!function(e){e[e.IDENTIFIER=1]="IDENTIFIER",e[e.UNKNOWN=2]="UNKNOWN",e[e.END_OF_INPUT=3]="END_OF_INPUT"}(P||(P={}));var B=function(){function e(e){this._pos=0,this.currentToken=P.UNKNOWN,this.currentIdentifier="",this.currentString="",this.isLetterOrDigitPattern=/^[a-zA-Z0-9]+$/,this._toParse=e,this._maxPos=e.length}return e.prototype.getNextToken=function(){if(this.isEnd())return P.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=P.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=P.IDENTIFIER,this.currentIdentifier=this.currentString;!this.isEnd()&&(this.isLetterOrDigitPattern.test(this.currentString=this.peek())||"_"===this.currentString);)this.currentIdentifier+=this.currentString,this.forward();return this.currentToken},e.prototype.peek=function(){return this._toParse[this._pos]},e.prototype.read=function(){return this._toParse[this._pos++]},e.prototype.forward=function(){this._pos++},e.prototype.isEnd=function(){return this._pos>=this._maxPos},e}(),F=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],V=["world","view","projection","worldView","worldViewProjection","mBones"],D=["translation","rotation","scale"],k=["position","rotationQuaternion","scaling"],U=function(e,t,n){for(var r in e){var o=e[r];n[t][r]=o}},G=function(e){if(e)for(var t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},j=function(e){if("NORMAL"===e.semantic)return"normal";if("POSITION"===e.semantic)return"position";if("JOINT"===e.semantic)return"matricesIndices";if("WEIGHT"===e.semantic)return"matricesWeights";if("COLOR"===e.semantic)return"color";if(e.semantic&&-1!==e.semantic.indexOf("TEXCOORD_")){var t=Number(e.semantic.split("_")[1]);return"uv"+(0===t?"":t+1)}return null},H=function(e){var t=null;if(e.translation||e.rotation||e.scale){var n=d.Vector3.FromArray(e.scale||[1,1,1]),r=d.Quaternion.FromArray(e.rotation||[0,0,0,1]),o=d.Vector3.FromArray(e.translation||[0,0,0]);t=d.Matrix.Compose(n,r,o)}else t=d.Matrix.FromArray(e.matrix);return t},W=function(e,t,n,r){for(var o=0;o<r.bones.length;o++)if(r.bones[o].name===n)return r.bones[o];var a=e.nodes;for(var i in a){var s=a[i];if(s.jointName){var l=s.children;for(o=0;o<l.length;o++){var u=e.nodes[l[o]];if(u.jointName&&u.jointName===n){var c=H(s),f=new d.Bone(s.name||"",r,W(e,t,s.jointName,r),c);return f.id=i,f}}}}return null},Y=function(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],o=0;o<r.node.children.length;o++)if(r.node.children[o]===t)return r.bone;return null},J=function(e,t){var n=e.nodes,r=n[t];if(r)return{node:r,id:t};for(var o in n)if((r=n[o]).jointName===t)return{node:r,id:o};return null},q=function(e,t){for(var n=0;n<e.jointNames.length;n++)if(e.jointNames[n]===t)return!0;return!1},Z=function(e,t,n,r,o){if(o||(e.scene._blockEntityCollection=!!e.assetContainer,(o=new d.Mesh(t.name||"",e.scene))._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,o.id=r),!t.babylonNode)return o;for(var a,i=[],s=null,l=[],u=[],c=[],f=[],h=0;h<n.length;h++){var p=n[h];if(x=e.meshes[p])for(var m=0;m<x.primitives.length;m++){var v=new d.VertexData,b=x.primitives[m];b.mode;var y=b.attributes,A=null,_=null;for(var g in y)if(A=e.accessors[y[g]],_=I.GetBufferFromAccessor(e,A),"NORMAL"===g)v.normals=new Float32Array(_.length),v.normals.set(_);else if("POSITION"===g){if(O.HomogeneousCoordinates){v.positions=new Float32Array(_.length-_.length/4);for(var E=0;E<_.length;E+=4)v.positions[E]=_[E],v.positions[E+1]=_[E+1],v.positions[E+2]=_[E+2]}else v.positions=new Float32Array(_.length),v.positions.set(_);u.push(v.positions.length)}else if(-1!==g.indexOf("TEXCOORD_")){var L=Number(g.split("_")[1]),T=d.VertexBuffer.UVKind+(0===L?"":L+1),N=new Float32Array(_.length);N.set(_),G(N),v.set(N,T)}else"JOINT"===g?(v.matricesIndices=new Float32Array(_.length),v.matricesIndices.set(_)):"WEIGHT"===g?(v.matricesWeights=new Float32Array(_.length),v.matricesWeights.set(_)):"COLOR"===g&&(v.colors=new Float32Array(_.length),v.colors.set(_));if(A=e.accessors[b.indices])_=I.GetBufferFromAccessor(e,A),v.indices=new Int32Array(_.length),v.indices.set(_),f.push(v.indices.length);else{var S=[];for(E=0;E<v.positions.length/3;E++)S.push(E);v.indices=new Int32Array(S),f.push(v.indices.length)}s?s.merge(v):s=v;var C=e.scene.getMaterialById(b.material);i.push(null===C?I.GetDefaultMaterial(e.scene):C),l.push(0===l.length?0:l[l.length-1]+u[u.length-2]),c.push(0===c.length?0:c[c.length-1]+f[f.length-2])}}e.scene._blockEntityCollection=!!e.assetContainer,i.length>1?(a=new d.MultiMaterial("multimat"+r,e.scene)).subMaterials=i:a=new d.StandardMaterial("multimat"+r,e.scene),1===i.length&&(a=i[0]),a._parentContainer=e.assetContainer,o.material||(o.material=a),new d.Geometry(r,e.scene,s,!1,o),o.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,o.subMeshes=[];var M=0;for(h=0;h<n.length;h++){var x;if(p=n[h],x=e.meshes[p])for(m=0;m<x.primitives.length;m++)x.primitives[m].mode,d.SubMesh.AddToMesh(M,l[M],u[M],c[M],f[M],o,o,!0),M++}return o},K=function(e,t,n,r){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=n),e.scaling&&(e.scaling=r)},Q=function(e,t,n){var r=null;if(e.importOnlyMeshes&&(t.skin||t.meshes)&&e.importMeshesNames&&e.importMeshesNames.length>0&&-1===e.importMeshesNames.indexOf(t.name||""))return null;if(t.skin){if(t.meshes){var o=e.skins[t.skin];(a=Z(e,t,t.meshes,n,t.babylonNode)).skeleton=e.scene.getLastSkeletonById(t.skin),null===a.skeleton&&(a.skeleton=function(e,t,n,r){if(r||(r=new d.Skeleton(t.name||"","",e.scene)),!t.babylonSkeleton)return r;var o=[],a=[];!function(e,t,n,r){for(var o in e.nodes){var a=e.nodes[o],i=o;if(a.jointName&&!q(n,a.jointName)){var s=H(a),l=new d.Bone(a.name||"",t,null,s);l.id=i,r.push({bone:l,node:a,id:i})}}for(var u=0;u<r.length;u++)for(var c=r[u],f=c.node.children,h=0;h<f.length;h++){for(var p=null,m=0;m<r.length;m++)if(r[m].id===f[h]){p=r[m];break}p&&(p.bone._parent=c.bone,c.bone.children.push(p.bone))}}(e,r,t,o),r.bones=[];for(var i=0;i<t.jointNames.length;i++)if(_=J(e,t.jointNames[i])){var s=_.node;if(s){var l=_.id,u=e.scene.getBoneById(l);if(u)r.bones.push(u);else{for(var c=!1,f=null,h=0;h<i;h++){var p=J(e,t.jointNames[h]);if(p){var m=p.node;if(m){var v=m.children;if(v){c=!1;for(var b=0;b<v.length;b++)if(v[b]===l){f=W(e,t,t.jointNames[h],r),c=!0;break}if(c)break}}else d.Tools.Warn("Joint named "+t.jointNames[h]+" does not exist when looking for parent")}}var y=H(s);!f&&o.length>0&&(f=Y(o,l))&&-1===a.indexOf(f)&&a.push(f),new d.Bone(s.jointName||"",r,f,y).id=l}}else d.Tools.Warn("Joint named "+t.jointNames[i]+" does not exist")}var A=r.bones;for(r.bones=[],i=0;i<t.jointNames.length;i++){var _;if(_=J(e,t.jointNames[i]))for(h=0;h<A.length;h++)if(A[h].id===_.id){r.bones.push(A[h]);break}}for(r.prepare(),i=0;i<a.length;i++)r.bones.push(a[i]);return r}(e,o,0,o.babylonSkeleton),o.babylonSkeleton||(o.babylonSkeleton=a.skeleton)),r=a}}else if(t.meshes){var a;r=a=Z(e,t,t.mesh?[t.mesh]:t.meshes,n,t.babylonNode)}else if(!t.light||t.babylonNode||e.importOnlyMeshes){if(t.camera&&!t.babylonNode&&!e.importOnlyMeshes){var i=e.cameras[t.camera];if(i){if(e.scene._blockEntityCollection=!!e.assetContainer,"orthographic"===i.type){var s=new d.FreeCamera(t.camera,d.Vector3.Zero(),e.scene,!1);s.name=t.name||"",s.mode=d.Camera.ORTHOGRAPHIC_CAMERA,s.attachControl(),r=s,s._parentContainer=e.assetContainer}else if("perspective"===i.type){var l=i[i.type],u=new d.FreeCamera(t.camera,d.Vector3.Zero(),e.scene,!1);u.name=t.name||"",u.attachControl(),l.aspectRatio||(l.aspectRatio=e.scene.getEngine().getRenderWidth()/e.scene.getEngine().getRenderHeight()),l.znear&&l.zfar&&(u.maxZ=l.zfar,u.minZ=l.znear),r=u,u._parentContainer=e.assetContainer}e.scene._blockEntityCollection=!1}}}else{var c=e.lights[t.light];if(c)if("ambient"===c.type){var f=c[c.type],h=new d.HemisphericLight(t.light,d.Vector3.Zero(),e.scene);h.name=t.name||"",f.color&&(h.diffuse=d.Color3.FromArray(f.color)),r=h}else if("directional"===c.type){var p=c[c.type],m=new d.DirectionalLight(t.light,d.Vector3.Zero(),e.scene);m.name=t.name||"",p.color&&(m.diffuse=d.Color3.FromArray(p.color)),r=m}else if("point"===c.type){var v=c[c.type],b=new d.PointLight(t.light,d.Vector3.Zero(),e.scene);b.name=t.name||"",v.color&&(b.diffuse=d.Color3.FromArray(v.color)),r=b}else if("spot"===c.type){var y=c[c.type],A=new d.SpotLight(t.light,d.Vector3.Zero(),d.Vector3.Zero(),0,0,e.scene);A.name=t.name||"",y.color&&(A.diffuse=d.Color3.FromArray(y.color)),y.fallOfAngle&&(A.angle=y.fallOfAngle),y.fallOffExponent&&(A.exponent=y.fallOffExponent),r=A}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===r){e.scene._blockEntityCollection=!!e.assetContainer;var _=new d.Mesh(t.name||"",e.scene);_._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,t.babylonNode=_,r=_}}if(null!==r){if(t.matrix&&r instanceof d.Mesh)!function(e,t){if(t.matrix){var n=new d.Vector3(0,0,0),r=new d.Quaternion,o=new d.Vector3(0,0,0);d.Matrix.FromArray(t.matrix).decompose(o,r,n),K(e,n,r,o)}else t.translation&&t.rotation&&t.scale&&K(e,d.Vector3.FromArray(t.translation),d.Quaternion.FromArray(t.rotation),d.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(r,t);else{var g=t.translation||[0,0,0],O=t.rotation||[0,0,0,1],E=t.scale||[1,1,1];K(r,d.Vector3.FromArray(g),d.Quaternion.FromArray(O),d.Vector3.FromArray(E))}r.updateCache(!0),t.babylonNode=r}return r},X=function(e,t,n,r){void 0===r&&(r=!1);var o=e.nodes[t],a=null;if(r=!(e.importOnlyMeshes&&!r&&e.importMeshesNames)||-1!==e.importMeshesNames.indexOf(o.name||"")||0===e.importMeshesNames.length,!o.jointName&&r&&null!==(a=Q(e,o,t))&&(a.id=t,a.parent=n),o.children)for(var i=0;i<o.children.length;i++)X(e,o.children[i],a,r)},z=function(e){var t=e.currentScene;if(t)for(var n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null);for(function(e){for(var t in e.animations){var n=e.animations[t];if(n.channels&&n.samplers)for(var r=null,o=0;o<n.channels.length;o++){var a=n.channels[o],i=n.samplers[a.sampler];if(i){var s=null,l=null;n.parameters?(s=n.parameters[i.input],l=n.parameters[i.output]):(s=i.input,l=i.output);var u=I.GetBufferFromAccessor(e,e.accessors[s]),c=I.GetBufferFromAccessor(e,e.accessors[l]),f=a.target.id,h=e.scene.getNodeById(f);if(null===h&&(h=e.scene.getNodeByName(f)),null!==h){var p=h instanceof d.Bone,m=a.target.path,v=D.indexOf(m);-1!==v&&(m=k[v]);var b=d.Animation.ANIMATIONTYPE_MATRIX;p||("rotationQuaternion"===m?(b=d.Animation.ANIMATIONTYPE_QUATERNION,h.rotationQuaternion=new d.Quaternion):b=d.Animation.ANIMATIONTYPE_VECTOR3);var y=null,A=[],_=0,g=!1;p&&r&&r.getKeys().length===u.length&&(y=r,g=!0),g||(e.scene._blockEntityCollection=!!e.assetContainer,y=new d.Animation(t,p?"_matrix":m,1,b,d.Animation.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(var O=0;O<u.length;O++){var E=null;if("rotationQuaternion"===m?(E=d.Quaternion.FromArray([c[_],c[_+1],c[_+2],c[_+3]]),_+=4):(E=d.Vector3.FromArray([c[_],c[_+1],c[_+2]]),_+=3),p){var L=h,T=d.Vector3.Zero(),N=new d.Quaternion,S=d.Vector3.Zero(),C=L.getBaseMatrix();g&&r&&(C=r.getKeys()[O].value),C.decompose(S,N,T),"position"===m?T=E:"rotationQuaternion"===m?N=E:S=E,E=d.Matrix.Compose(S,N,T)}g?r&&(r.getKeys()[O].value=E):A.push({frame:u[O],value:E})}!g&&y&&(y.setKeys(A),h.animations.push(y)),r=y,e.scene.stopAnimation(h),e.scene.beginAnimation(h,0,u[u.length-1],!0,1)}else d.Tools.Warn("Creating animation named "+t+". But cannot find node named "+f+" to attach to")}}}}(e),n=0;n<e.scene.skeletons.length;n++){var o=e.scene.skeletons[n];e.scene.beginAnimation(o,0,Number.MAX_VALUE,!0,1)}},$=function(e,t,n){for(var r in t.uniforms){var o=t.uniforms[r],a=t.parameters[o];if(e.currentIdentifier===r&&a.semantic&&!a.source&&!a.node){var i=F.indexOf(a.semantic);if(-1!==i)return delete n[r],V[i]}}return e.currentIdentifier},ee=function(e){for(var t in e.materials)re.LoadMaterialAsync(e,t,(function(){}),(function(){}))},te=function(){function e(){}return e.CreateRuntime=function(e,t,n){var r={extensions:{},accessors:{},buffers:{},bufferViews:{},meshes:{},lights:{},cameras:{},nodes:{},images:{},textures:{},shaders:{},programs:{},samplers:{},techniques:{},materials:{},animations:{},skins:{},extensionsUsed:[],scenes:{},buffersCount:0,shaderscount:0,scene:t,rootUrl:n,loadedBufferCount:0,loadedBufferViews:{},loadedShaderCount:0,importOnlyMeshes:!1,dummyNodes:[],assetContainer:null};return e.extensions&&U(e.extensions,"extensions",r),e.extensionsUsed&&U(e.extensionsUsed,"extensionsUsed",r),e.buffers&&function(e,t){for(var n in e){var r=e[n];t.buffers[n]=r,t.buffersCount++}}(e.buffers,r),e.bufferViews&&U(e.bufferViews,"bufferViews",r),e.accessors&&U(e.accessors,"accessors",r),e.meshes&&U(e.meshes,"meshes",r),e.lights&&U(e.lights,"lights",r),e.cameras&&U(e.cameras,"cameras",r),e.nodes&&U(e.nodes,"nodes",r),e.images&&U(e.images,"images",r),e.textures&&U(e.textures,"textures",r),e.shaders&&function(e,t){for(var n in e){var r=e[n];t.shaders[n]=r,t.shaderscount++}}(e.shaders,r),e.programs&&U(e.programs,"programs",r),e.samplers&&U(e.samplers,"samplers",r),e.techniques&&U(e.techniques,"techniques",r),e.materials&&U(e.materials,"materials",r),e.animations&&U(e.animations,"animations",r),e.skins&&U(e.skins,"skins",r),e.scenes&&(r.scenes=e.scenes),e.scene&&e.scenes&&(r.currentScene=e.scenes[e.scene]),r},e.LoadBufferAsync=function(e,t,n,r,o){var a=e.buffers[t];d.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(d.Tools.DecodeBase64(a.uri)))})):d.Tools.LoadFile(e.rootUrl+a.uri,(function(e){return n(new Uint8Array(e))}),o,void 0,!0,(function(e){e&&r(e.status+" "+e.statusText)}))},e.LoadTextureBufferAsync=function(e,t,n,r){var o=e.textures[t];if(o&&o.source)if(o.babylonTexture)n(null);else{var a=e.images[o.source];d.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(d.Tools.DecodeBase64(a.uri)))})):d.Tools.LoadFile(e.rootUrl+a.uri,(function(e){return n(new Uint8Array(e))}),void 0,void 0,!0,(function(e){e&&r(e.status+" "+e.statusText)}))}else r("")},e.CreateTextureAsync=function(e,t,n,r){var o=e.textures[t];if(o.babylonTexture)r(o.babylonTexture);else{var a=e.samplers[o.sampler],i=a.minFilter===S.NEAREST_MIPMAP_NEAREST||a.minFilter===S.NEAREST_MIPMAP_LINEAR||a.minFilter===S.LINEAR_MIPMAP_NEAREST||a.minFilter===S.LINEAR_MIPMAP_LINEAR,s=d.Texture.BILINEAR_SAMPLINGMODE,l=null==n?new Blob:new Blob([n]),u=URL.createObjectURL(l),c=function(){return URL.revokeObjectURL(u)},f=new d.Texture(u,e.scene,!i,!0,s,c,c);void 0!==a.wrapS&&(f.wrapU=I.GetWrapMode(a.wrapS)),void 0!==a.wrapT&&(f.wrapV=I.GetWrapMode(a.wrapT)),f.name=t,o.babylonTexture=f,r(f)}},e.LoadShaderStringAsync=function(e,t,n,r){var o=e.shaders[t];if(d.Tools.IsBase64(o.uri)){var a=atob(o.uri.split(",")[1]);n&&n(a)}else d.Tools.LoadFile(e.rootUrl+o.uri,n,void 0,void 0,!1,(function(e){e&&r&&r(e.status+" "+e.statusText)}))},e.LoadMaterialAsync=function(e,t,n,r){var o=e.materials[t];if(o.technique){var a=e.techniques[o.technique];if(!a){e.scene._blockEntityCollection=!!e.assetContainer;var i=new d.StandardMaterial(t,e.scene);return i._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,i.diffuseColor=new d.Color3(.5,.5,.5),i.sideOrientation=d.Material.CounterClockWiseSideOrientation,void n(i)}var s=e.programs[a.program],l=a.states,u=d.Effect.ShadersStore[s.vertexShader+"VertexShader"],c=d.Effect.ShadersStore[s.fragmentShader+"PixelShader"],f="",h="",p=new B(u),m=new B(c),v={},b=[],y=[],A=[];for(var _ in a.uniforms){var g=a.uniforms[_],O=a.parameters[g];if(v[_]=O,!O.semantic||O.node||O.source)O.type===T.SAMPLER_2D?A.push(_):b.push(_);else{var E=F.indexOf(O.semantic);-1!==E?(b.push(V[E]),delete v[_]):b.push(_)}}for(var L in a.attributes){var N=a.attributes[L];if((R=a.parameters[N]).semantic){var S=j(R);S&&y.push(S)}}for(;!p.isEnd()&&p.getNextToken();)if(p.currentToken===P.IDENTIFIER){var C=!1;for(var L in a.attributes){N=a.attributes[L];var R=a.parameters[N];if(p.currentIdentifier===L&&R.semantic){f+=j(R),C=!0;break}}C||(f+=$(p,a,v))}else f+=p.currentString;for(;!m.isEnd()&&m.getNextToken();)m.currentToken===P.IDENTIFIER?h+=$(m,a,v):h+=m.currentString;var w={vertex:s.vertexShader+t,fragment:s.fragmentShader+t},D={attributes:y,uniforms:b,samplers:A,needAlphaBlending:l&&l.enable&&-1!==l.enable.indexOf(3042)};d.Effect.ShadersStore[s.vertexShader+t+"VertexShader"]=f,d.Effect.ShadersStore[s.fragmentShader+t+"PixelShader"]=h;var k=new d.ShaderMaterial(t,e.scene,w,D);if(k.onError=function(e,t,n){return function(r,o){t.dispose(!0),n("Cannot compile program named "+e.name+". Error: "+o+". Default material will be applied")}}(s,k,r),k.onCompiled=function(e,t,n,r,o,a){return function(i){!function(e,t,n,r,o){var a=r.values||n.parameters,i=n.uniforms,s=function(n){var s=o[n],l=s.type,u=a[i[n]];if(void 0===u&&(u=s.value),!u)return"continue";var c=function(e){return function(n){s.value&&e&&(t.setTexture(e,n),delete o[e])}};l===T.SAMPLER_2D?re.LoadTextureAsync(e,r.values?u:s.value,c(n),(function(){return c(null)})):s.value&&I.SetUniform(t,n,r.values?u:s.value,l)&&delete o[n]};for(var l in o)s(l)}(e,t,n,r,o),t.onBind=function(i){!function(e,t,n,r,o,a,i){var s=a.values||o.parameters;for(var l in n){var u=n[l],c=u.type;if(c===T.FLOAT_MAT2||c===T.FLOAT_MAT3||c===T.FLOAT_MAT4)if(!u.semantic||u.source||u.node){if(u.semantic&&(u.source||u.node)){var d=t.scene.getNodeByName(u.source||u.node||"");if(null===d&&(d=t.scene.getNodeById(u.source||u.node||"")),null===d)continue;I.SetMatrix(t.scene,d,u,l,r.getEffect())}}else I.SetMatrix(t.scene,e,u,l,r.getEffect());else{var f=s[o.uniforms[l]];if(!f)continue;if(c===T.SAMPLER_2D){var h=t.textures[a.values?f:u.value].babylonTexture;if(null==h)continue;r.getEffect().setTexture(l,h)}else I.SetUniform(r.getEffect(),l,f,c)}}i(r)}(i,e,o,t,n,r,a)}}}(e,k,a,o,v,n),k.sideOrientation=d.Material.CounterClockWiseSideOrientation,l&&l.functions){var U=l.functions;U.cullFace&&U.cullFace[0]!==M.BACK&&(k.backFaceCulling=!1);var G=U.blendFuncSeparate;G&&(G[0]===x.SRC_ALPHA&&G[1]===x.ONE_MINUS_SRC_ALPHA&&G[2]===x.ONE&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_COMBINE:G[0]===x.ONE&&G[1]===x.ONE&&G[2]===x.ZERO&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_ONEONE:G[0]===x.SRC_ALPHA&&G[1]===x.ONE&&G[2]===x.ZERO&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_ADD:G[0]===x.ZERO&&G[1]===x.ONE_MINUS_SRC_COLOR&&G[2]===x.ONE&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_SUBTRACT:G[0]===x.DST_COLOR&&G[1]===x.ZERO&&G[2]===x.ONE&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_MULTIPLY:G[0]===x.SRC_ALPHA&&G[1]===x.ONE_MINUS_SRC_COLOR&&G[2]===x.ONE&&G[3]===x.ONE&&(k.alphaMode=d.Constants.ALPHA_MAXIMIZED))}}else r&&r("No technique found.")},e}(),ne=function(){function e(){}return e.RegisterExtension=function(t){e.Extensions[t.name]?d.Tools.Error('Tool with the same name "'+t.name+'" already exists'):e.Extensions[t.name]=t},e.prototype.dispose=function(){},e.prototype._importMeshAsync=function(e,t,n,r,o,a,i,s){var l=this;return t.useRightHandedSystem=!0,re.LoadRuntimeAsync(t,n,r,(function(t){t.assetContainer=o,t.importOnlyMeshes=!0,""===e?t.importMeshesNames=[]:"string"==typeof e?t.importMeshesNames=[e]:!e||e instanceof Array?(t.importMeshesNames=[],d.Tools.Warn("Argument meshesNames must be of type string or string[]")):t.importMeshesNames=[e],l._createNodes(t);var n=[],r=[];for(var i in t.nodes){var s=t.nodes[i];s.babylonNode instanceof d.AbstractMesh&&n.push(s.babylonNode)}for(var u in t.skins){var c=t.skins[u];c.babylonSkeleton instanceof d.Skeleton&&r.push(c.babylonSkeleton)}l._loadBuffersAsync(t,(function(){l._loadShadersAsync(t,(function(){ee(t),z(t),!O.IncrementalLoading&&a&&a(n,r)}))})),O.IncrementalLoading&&a&&a(n,r)}),s),!0},e.prototype.importMeshAsync=function(e,t,n,r,o,a){var i=this;return new Promise((function(s,l){i._importMeshAsync(e,t,r,o,n,(function(e,t){s({meshes:e,particleSystems:[],skeletons:t,animationGroups:[],lights:[],transformNodes:[],geometries:[],spriteManagers:[]})}),a,(function(e){l(new Error(e))}))}))},e.prototype._loadAsync=function(e,t,n,r,o,a){var i=this;e.useRightHandedSystem=!0,re.LoadRuntimeAsync(e,t,n,(function(e){re.LoadRuntimeExtensionsAsync(e,(function(){i._createNodes(e),i._loadBuffersAsync(e,(function(){i._loadShadersAsync(e,(function(){ee(e),z(e),O.IncrementalLoading||r()}))})),O.IncrementalLoading&&r()}),a)}),a)},e.prototype.loadAsync=function(e,t,n,r){var o=this;return new Promise((function(a,i){o._loadAsync(e,t,n,(function(){a()}),r,(function(e){i(new Error(e))}))}))},e.prototype._loadShadersAsync=function(e,t){var n=!1,r=function(n,r){re.LoadShaderStringAsync(e,n,(function(o){o instanceof ArrayBuffer||(e.loadedShaderCount++,o&&(d.Effect.ShadersStore[n+(r.type===L.VERTEX?"VertexShader":"PixelShader")]=o),e.loadedShaderCount===e.shaderscount&&t())}),(function(){d.Tools.Error("Error when loading shader program named "+n+" located at "+r.uri)}))};for(var o in e.shaders){n=!0;var a=e.shaders[o];a?r.bind(this,o,a)():d.Tools.Error("No shader named: "+o)}n||t()},e.prototype._loadBuffersAsync=function(e,t){var n=!1,r=function(n,r){re.LoadBufferAsync(e,n,(function(o){e.loadedBufferCount++,o&&(o.byteLength!=e.buffers[n].byteLength&&d.Tools.Error("Buffer named "+n+" is length "+o.byteLength+". Expected: "+r.byteLength),e.loadedBufferViews[n]=o),e.loadedBufferCount===e.buffersCount&&t()}),(function(){d.Tools.Error("Error when loading buffer named "+n+" located at "+r.uri)}))};for(var o in e.buffers){n=!0;var a=e.buffers[o];a?r.bind(this,o,a)():d.Tools.Error("No buffer named: "+o)}n||t()},e.prototype._createNodes=function(e){var t=e.currentScene;if(t)for(var n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null)},e.Extensions={},e}(),re=function(){function e(e){this._name=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e.prototype.loadRuntimeAsync=function(e,t,n,r,o){return!1},e.prototype.loadRuntimeExtensionsAsync=function(e,t,n){return!1},e.prototype.loadBufferAsync=function(e,t,n,r,o){return!1},e.prototype.loadTextureBufferAsync=function(e,t,n,r){return!1},e.prototype.createTextureAsync=function(e,t,n,r,o){return!1},e.prototype.loadShaderStringAsync=function(e,t,n,r){return!1},e.prototype.loadMaterialAsync=function(e,t,n,r){return!1},e.LoadRuntimeAsync=function(t,n,r,o,a){e._ApplyExtensions((function(e){return e.loadRuntimeAsync(t,n,r,o,a)}),(function(){setTimeout((function(){o&&o(te.CreateRuntime(n.json,t,r))}))}))},e.LoadRuntimeExtensionsAsync=function(t,n,r){e._ApplyExtensions((function(e){return e.loadRuntimeExtensionsAsync(t,n,r)}),(function(){setTimeout((function(){n()}))}))},e.LoadBufferAsync=function(t,n,r,o,a){e._ApplyExtensions((function(e){return e.loadBufferAsync(t,n,r,o,a)}),(function(){te.LoadBufferAsync(t,n,r,o,a)}))},e.LoadTextureAsync=function(t,n,r,o){e._LoadTextureBufferAsync(t,n,(function(a){a&&e._CreateTextureAsync(t,n,a,r,o)}),o)},e.LoadShaderStringAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadShaderStringAsync(t,n,r,o)}),(function(){te.LoadShaderStringAsync(t,n,r,o)}))},e.LoadMaterialAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadMaterialAsync(t,n,r,o)}),(function(){te.LoadMaterialAsync(t,n,r,o)}))},e._LoadTextureBufferAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadTextureBufferAsync(t,n,r,o)}),(function(){te.LoadTextureBufferAsync(t,n,r,o)}))},e._CreateTextureAsync=function(t,n,r,o,a){e._ApplyExtensions((function(e){return e.createTextureAsync(t,n,r,o,a)}),(function(){te.CreateTextureAsync(t,n,r,o)}))},e._ApplyExtensions=function(e,t){for(var n in ne.Extensions)if(e(ne.Extensions[n]))return;t()},e}();O._CreateGLTF1Loader=function(){return new ne};var oe=function(e){function t(){return e.call(this,"KHR_binary_glTF")||this}return c(t,e),t.prototype.loadRuntimeAsync=function(e,t,n,r){var o=t.json.extensionsUsed;return!(!o||-1===o.indexOf(this.name)||!t.bin||(this._bin=t.bin,r(te.CreateRuntime(t.json,e,n)),0))},t.prototype.loadBufferAsync=function(e,t,n,r){return-1!==e.extensionsUsed.indexOf(this.name)&&"binary_glTF"===t&&(this._bin.readAsync(0,this._bin.byteLength).then(n,(function(e){return r(e.message)})),!0)},t.prototype.loadTextureBufferAsync=function(e,t,n){var r=e.textures[t],o=e.images[r.source];if(!o.extensions||!(this.name in o.extensions))return!1;var a=o.extensions[this.name],i=e.bufferViews[a.bufferView];return n(I.GetBufferFromBufferView(e,i,0,i.byteLength,E.UNSIGNED_BYTE)),!0},t.prototype.loadShaderStringAsync=function(e,t,n){var r=e.shaders[t];if(!r.extensions||!(this.name in r.extensions))return!1;var o=r.extensions[this.name],a=e.bufferViews[o.bufferView],i=I.GetBufferFromBufferView(e,a,0,a.byteLength,E.UNSIGNED_BYTE);return setTimeout((function(){var e=I.DecodeBufferToText(i);n(e)})),!0},t}(re);ne.RegisterExtension(new oe);var ae=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return c(t,e),t.prototype.loadRuntimeExtensionsAsync=function(e){if(!e.extensions)return!1;var t=e.extensions[this.name];if(!t)return!1;var n=t.lights;if(n)for(var r in n){var o=n[r];switch(o.type){case"ambient":var a=new d.HemisphericLight(o.name,new d.Vector3(0,1,0),e.scene),i=o.ambient;i&&(a.diffuse=d.Color3.FromArray(i.color||[1,1,1]));break;case"point":var s=new d.PointLight(o.name,new d.Vector3(10,10,10),e.scene),l=o.point;l&&(s.diffuse=d.Color3.FromArray(l.color||[1,1,1]));break;case"directional":var u=new d.DirectionalLight(o.name,new d.Vector3(0,-1,0),e.scene),c=o.directional;c&&(u.diffuse=d.Color3.FromArray(c.color||[1,1,1]));break;case"spot":var f=o.spot;f&&(new d.SpotLight(o.name,new d.Vector3(0,10,0),new d.Vector3(0,-1,0),f.fallOffAngle||Math.PI,f.fallOffExponent||0,e.scene).diffuse=d.Color3.FromArray(f.color||[1,1,1]));break;default:d.Tools.Warn('GLTF Material Common extension: light type "'+o.type+"” not supported")}}return!1},t.prototype.loadMaterialAsync=function(e,t,n,r){var o=e.materials[t];if(!o||!o.extensions)return!1;var a=o.extensions[this.name];if(!a)return!1;var i=new d.StandardMaterial(t,e.scene);return i.sideOrientation=d.Material.CounterClockWiseSideOrientation,"CONSTANT"===a.technique&&(i.disableLighting=!0),i.backFaceCulling=void 0!==a.doubleSided&&!a.doubleSided,i.alpha=void 0===a.values.transparency?1:a.values.transparency,i.specularPower=void 0===a.values.shininess?0:a.values.shininess,"string"==typeof a.values.ambient?this._loadTexture(e,a.values.ambient,i,"ambientTexture",r):i.ambientColor=d.Color3.FromArray(a.values.ambient||[0,0,0]),"string"==typeof a.values.diffuse?this._loadTexture(e,a.values.diffuse,i,"diffuseTexture",r):i.diffuseColor=d.Color3.FromArray(a.values.diffuse||[0,0,0]),"string"==typeof a.values.emission?this._loadTexture(e,a.values.emission,i,"emissiveTexture",r):i.emissiveColor=d.Color3.FromArray(a.values.emission||[0,0,0]),"string"==typeof a.values.specular?this._loadTexture(e,a.values.specular,i,"specularTexture",r):i.specularColor=d.Color3.FromArray(a.values.specular||[0,0,0]),!0},t.prototype._loadTexture=function(e,t,n,r,o){te.LoadTextureBufferAsync(e,t,(function(o){te.CreateTextureAsync(e,t,o,(function(e){return n[r]=e}))}),o)},t}(re);ne.RegisterExtension(new ae);var ie=void 0!==r.g?r.g:"undefined"!=typeof window?window:void 0;if(void 0!==ie)for(var se in ie.BABYLON=ie.BABYLON||{},ie.BABYLON.GLTF1=ie.BABYLON.GLTF1||{},s)ie.BABYLON.GLTF1[se]=s[se];const le=l;return o.default})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("babylonjs")):"function"==typeof define&&define.amd?define("babylonjs-loaders",["babylonjs"],t):"object"==typeof exports?exports["babylonjs-loaders"]=t(require("babylonjs")):e.LOADERS=t(e.BABYLON)}("undefined"!=typeof self?self:"undefined"!=typeof global?global:this,(e=>(()=>{"use strict";var t={597:t=>{t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e](a,a.exports,r),a.exports}r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};r.d(o,{default:()=>le});var a={};r.r(a),r.d(a,{GLTFValidation:()=>b});var i={};r.r(i),r.d(i,{GLTFFileLoader:()=>O,GLTFLoaderAnimationStartMode:()=>m,GLTFLoaderCoordinateSystemMode:()=>p,GLTFLoaderState:()=>v});var s={};r.r(s),r.d(s,{EBlendingFunction:()=>x,EComponentType:()=>E,ECullingType:()=>M,EParameterType:()=>T,EShaderType:()=>L,ETextureFilterType:()=>S,ETextureFormat:()=>C,ETextureWrapMode:()=>N,GLTFBinaryExtension:()=>oe,GLTFLoader:()=>ne,GLTFLoaderBase:()=>te,GLTFLoaderExtension:()=>re,GLTFMaterialsCommonExtension:()=>ae,GLTFUtils:()=>I});var l={};r.r(l),r.d(l,{GLTF1:()=>s,GLTFFileLoader:()=>O,GLTFLoaderAnimationStartMode:()=>m,GLTFLoaderCoordinateSystemMode:()=>p,GLTFLoaderState:()=>v,GLTFValidation:()=>b});var u=function(e,t){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},u(e,t)};function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}u(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError;var d=r(597);function f(e,t,n,r){var o={externalResourceFunction:r};return n&&(o.uri="file:"===t?n:t+n),ArrayBuffer.isView(e)?GLTFValidator.validateBytes(e,o):GLTFValidator.validateString(e,o)}function h(){var e=[];onmessage=function(t){var n=t.data;switch(n.id){case"init":importScripts(n.url);break;case"validate":f(n.data,n.rootUrl,n.fileName,(function(t){return new Promise((function(n,r){var o=e.length;e.push({resolve:n,reject:r}),postMessage({id:"getExternalResource",index:o,uri:t})}))})).then((function(e){postMessage({id:"validate.resolve",value:e})}),(function(e){postMessage({id:"validate.reject",reason:e})}));break;case"getExternalResource.resolve":e[n.index].resolve(n.value);break;case"getExternalResource.reject":e[n.index].reject(n.reason)}}}var p,m,v,b=function(){function e(){}return e.ValidateAsync=function(e,t,n,r){var o=this;return"function"==typeof Worker?new Promise((function(a,i){var s="".concat(f,"(").concat(h,")()"),l=URL.createObjectURL(new Blob([s],{type:"application/javascript"})),u=new Worker(l),c=function(e){u.removeEventListener("error",c),u.removeEventListener("message",p),i(e)},p=function(e){var t=e.data;switch(t.id){case"getExternalResource":r(t.uri).then((function(e){u.postMessage({id:"getExternalResource.resolve",index:t.index,value:e},[e.buffer])}),(function(e){u.postMessage({id:"getExternalResource.reject",index:t.index,reason:e})}));break;case"validate.resolve":u.removeEventListener("error",c),u.removeEventListener("message",p),a(t.value),u.terminate();break;case"validate.reject":u.removeEventListener("error",c),u.removeEventListener("message",p),i(t.reason),u.terminate()}};if(u.addEventListener("error",c),u.addEventListener("message",p),u.postMessage({id:"init",url:d.Tools.GetBabylonScriptURL(o.Configuration.url)}),ArrayBuffer.isView(e)){var m=e.slice();u.postMessage({id:"validate",data:m,rootUrl:t,fileName:n},[m.buffer])}else u.postMessage({id:"validate",data:e,rootUrl:t,fileName:n})})):(this._LoadScriptPromise||(this._LoadScriptPromise=d.Tools.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return f(e,t,n,r)})))},e.Configuration={url:"".concat(d.Tools._DefaultCdnUrl,"/gltf_validator.js")},e}(),y="Z2xURg",A="gltf",_={".gltf":{isBinary:!1},".glb":{isBinary:!0}};function g(e,t,n){try{return Promise.resolve(new Uint8Array(e,t,n))}catch(e){return Promise.reject(e)}}!function(e){e[e.AUTO=0]="AUTO",e[e.FORCE_RIGHT_HANDED=1]="FORCE_RIGHT_HANDED"}(p||(p={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(m||(m={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(v||(v={}));var O=function(e){function t(t){var n=e.call(this)||this;return n.onParsedObservable=new d.Observable,n.onMeshLoadedObservable=new d.Observable,n.onSkinLoadedObservable=new d.Observable,n.onTextureLoadedObservable=new d.Observable,n.onMaterialLoadedObservable=new d.Observable,n.onCameraLoadedObservable=new d.Observable,n.onCompleteObservable=new d.Observable,n.onErrorObservable=new d.Observable,n.onDisposeObservable=new d.Observable,n.onExtensionLoadedObservable=new d.Observable,n.validate=!1,n.onValidatedObservable=new d.Observable,n._loader=null,n._state=null,n._requests=new Array,n.name=A,n.extensions=_,n.onLoaderStateChangedObservable=new d.Observable,n._logIndentLevel=0,n._loggingEnabled=!1,n._log=n._logDisabled,n._capturePerformanceCounters=!1,n._startPerformanceCounter=n._startPerformanceCounterDisabled,n._endPerformanceCounter=n._endPerformanceCounterDisabled,n.copyFrom(t),n}return c(t,e),Object.defineProperty(t.prototype,"onParsed",{set:function(e){this._onParsedObserver&&this.onParsedObservable.remove(this._onParsedObserver),e&&(this._onParsedObserver=this.onParsedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMeshLoaded",{set:function(e){this._onMeshLoadedObserver&&this.onMeshLoadedObservable.remove(this._onMeshLoadedObserver),e&&(this._onMeshLoadedObserver=this.onMeshLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSkinLoaded",{set:function(e){this._onSkinLoadedObserver&&this.onSkinLoadedObservable.remove(this._onSkinLoadedObserver),e&&(this._onSkinLoadedObserver=this.onSkinLoadedObservable.add((function(t){return e(t.node,t.skinnedNode)})))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTextureLoaded",{set:function(e){this._onTextureLoadedObserver&&this.onTextureLoadedObservable.remove(this._onTextureLoadedObserver),e&&(this._onTextureLoadedObserver=this.onTextureLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onMaterialLoaded",{set:function(e){this._onMaterialLoadedObserver&&this.onMaterialLoadedObservable.remove(this._onMaterialLoadedObserver),e&&(this._onMaterialLoadedObserver=this.onMaterialLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onCameraLoaded",{set:function(e){this._onCameraLoadedObserver&&this.onCameraLoadedObservable.remove(this._onCameraLoadedObserver),e&&(this._onCameraLoadedObserver=this.onCameraLoadedObservable.add(e))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onComplete",{set:function(e){this._onCompleteObserver&&this.onCompleteObservable.remove(this._onCompleteObserver),this._onCompleteObserver=this.onCompleteObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onError",{set:function(e){this._onErrorObserver&&this.onErrorObservable.remove(this._onErrorObserver),this._onErrorObserver=this.onErrorObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDispose",{set:function(e){this._onDisposeObserver&&this.onDisposeObservable.remove(this._onDisposeObserver),this._onDisposeObserver=this.onDisposeObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onExtensionLoaded",{set:function(e){this._onExtensionLoadedObserver&&this.onExtensionLoadedObservable.remove(this._onExtensionLoadedObserver),this._onExtensionLoadedObserver=this.onExtensionLoadedObservable.add(e)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"loggingEnabled",{get:function(){return this._loggingEnabled},set:function(e){this._loggingEnabled!==e&&(this._loggingEnabled=e,this._loggingEnabled?this._log=this._logEnabled:this._log=this._logDisabled)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capturePerformanceCounters",{get:function(){return this._capturePerformanceCounters},set:function(e){this._capturePerformanceCounters!==e&&(this._capturePerformanceCounters=e,this._capturePerformanceCounters?(this._startPerformanceCounter=this._startPerformanceCounterEnabled,this._endPerformanceCounter=this._endPerformanceCounterEnabled):(this._startPerformanceCounter=this._startPerformanceCounterDisabled,this._endPerformanceCounter=this._endPerformanceCounterDisabled))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onValidated",{set:function(e){this._onValidatedObserver&&this.onValidatedObservable.remove(this._onValidatedObserver),this._onValidatedObserver=this.onValidatedObservable.add(e)},enumerable:!1,configurable:!0}),t.prototype.dispose=function(){this._loader&&(this._loader.dispose(),this._loader=null);for(var e=0,t=this._requests;e<t.length;e++)t[e].abort();this._requests.length=0,delete this._progressCallback,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.onMeshLoadedObservable.clear(),this.onSkinLoadedObservable.clear(),this.onTextureLoadedObservable.clear(),this.onMaterialLoadedObservable.clear(),this.onCameraLoadedObservable.clear(),this.onCompleteObservable.clear(),this.onExtensionLoadedObservable.clear(),this.onDisposeObservable.notifyObservers(void 0),this.onDisposeObservable.clear()},t.prototype.loadFile=function(e,t,n,r,o,a,i,s){var l=this;if(ArrayBuffer.isView(t))return this._loadBinary(e,t,n,r,i,s),null;this._progressCallback=o;var u=t.name||d.Tools.GetFilename(t);if(a){if(this.useRangeRequests){this.validate&&d.Logger.Warn("glTF validation is not supported when range requests are enabled");var c={abort:function(){},onCompleteObservable:new d.Observable},f={readAsync:function(n,r){return new Promise((function(o,a){l._loadFile(e,t,(function(e){o(new Uint8Array(e))}),!0,(function(e){a(e)}),(function(e){e.setRequestHeader("Range","bytes=".concat(n,"-").concat(n+r-1))}))}))},byteLength:0};return this._unpackBinaryAsync(new d.DataReader(f)).then((function(e){c.onCompleteObservable.notifyObservers(c),r(e)}),i?function(e){return i(void 0,e)}:void 0),c}return this._loadFile(e,t,(function(t){l._validate(e,new Uint8Array(t,0,t.byteLength),n,u),l._unpackBinaryAsync(new d.DataReader({readAsync:function(e,n){return g(t,e,n)},byteLength:t.byteLength})).then((function(e){r(e)}),i?function(e){return i(void 0,e)}:void 0)}),!0,i)}return this._loadFile(e,t,(function(t){try{l._validate(e,t,n,u),r({json:l._parseJson(t)})}catch(e){i&&i()}}),!1,i)},t.prototype._loadBinary=function(e,t,n,r,o,a){this._validate(e,new Uint8Array(t.buffer,t.byteOffset,t.byteLength),n,a),this._unpackBinaryAsync(new d.DataReader({readAsync:function(e,n){return function(e,t,n){try{if(t<0||t>=e.byteLength)throw new RangeError("Offset is out of range.");if(t+n>e.byteLength)throw new RangeError("Length is out of range.");return Promise.resolve(new Uint8Array(e.buffer,e.byteOffset+t,n))}catch(e){return Promise.reject(e)}}(t,e,n)},byteLength:t.byteLength})).then((function(e){r(e)}),o?function(e){return o(void 0,e)}:void 0)},t.prototype.importMeshAsync=function(e,t,n,r,o,a){var i=this;return Promise.resolve().then((function(){return i.onParsedObservable.notifyObservers(n),i.onParsedObservable.clear(),i._log("Loading ".concat(a||"")),i._loader=i._getLoader(n),i._loader.importMeshAsync(e,t,null,n,r,o,a)}))},t.prototype.loadAsync=function(e,t,n,r,o){var a=this;return Promise.resolve().then((function(){return a.onParsedObservable.notifyObservers(t),a.onParsedObservable.clear(),a._log("Loading ".concat(o||"")),a._loader=a._getLoader(t),a._loader.loadAsync(e,t,n,r,o)}))},t.prototype.loadAssetContainerAsync=function(e,t,n,r,o){var a=this;return Promise.resolve().then((function(){a.onParsedObservable.notifyObservers(t),a.onParsedObservable.clear(),a._log("Loading ".concat(o||"")),a._loader=a._getLoader(t);var i=new d.AssetContainer(e),s=[];a.onMaterialLoadedObservable.add((function(e){s.push(e)}));var l=[];a.onTextureLoadedObservable.add((function(e){l.push(e)}));var u=[];a.onCameraLoadedObservable.add((function(e){u.push(e)}));var c=[];return a.onMeshLoadedObservable.add((function(e){e.morphTargetManager&&c.push(e.morphTargetManager)})),a._loader.importMeshAsync(null,e,i,t,n,r,o).then((function(e){return Array.prototype.push.apply(i.geometries,e.geometries),Array.prototype.push.apply(i.meshes,e.meshes),Array.prototype.push.apply(i.particleSystems,e.particleSystems),Array.prototype.push.apply(i.skeletons,e.skeletons),Array.prototype.push.apply(i.animationGroups,e.animationGroups),Array.prototype.push.apply(i.materials,s),Array.prototype.push.apply(i.textures,l),Array.prototype.push.apply(i.lights,e.lights),Array.prototype.push.apply(i.transformNodes,e.transformNodes),Array.prototype.push.apply(i.cameras,u),Array.prototype.push.apply(i.morphTargetManagers,c),i}))}))},t.prototype.canDirectLoad=function(e){return function(e){return-1!==e.indexOf("asset")&&-1!==e.indexOf("version")||e.startsWith("data:base64,"+y)||e.startsWith("data:;base64,"+y)||e.startsWith("data:application/octet-stream;base64,"+y)||e.startsWith("data:model/gltf-binary;base64,"+y)}(e)},t.prototype.directLoad=function(e,t){if(t.startsWith("base64,"+y)||t.startsWith(";base64,"+y)||t.startsWith("application/octet-stream;base64,"+y)||t.startsWith("model/gltf-binary;base64,"+y)){var n=(0,d.DecodeBase64UrlToBinary)(t);return this._validate(e,new Uint8Array(n,0,n.byteLength)),this._unpackBinaryAsync(new d.DataReader({readAsync:function(e,t){return g(n,e,t)},byteLength:n.byteLength}))}return this._validate(e,t),Promise.resolve({json:this._parseJson(t)})},t.prototype.createPlugin=function(e){return new t(e[A])},Object.defineProperty(t.prototype,"loaderState",{get:function(){return this._state},enumerable:!1,configurable:!0}),t.prototype.whenCompleteAsync=function(){var e=this;return new Promise((function(t,n){e.onCompleteObservable.addOnce((function(){t()})),e.onErrorObservable.addOnce((function(e){n(e)}))}))},t.prototype._setState=function(e){this._state!==e&&(this._state=e,this.onLoaderStateChangedObservable.notifyObservers(this._state),this._log(v[this._state]))},t.prototype._loadFile=function(e,t,n,r,o,a){var i=this,s=e._loadFile(t,n,(function(e){i._onProgress(e,s)}),!0,r,o,a);return s.onCompleteObservable.add((function(){s._lengthComputable=!0,s._total=s._loaded})),this._requests.push(s),s},t.prototype._onProgress=function(e,t){if(this._progressCallback){t._lengthComputable=e.lengthComputable,t._loaded=e.loaded,t._total=e.total;for(var n=!0,r=0,o=0,a=0,i=this._requests;a<i.length;a++){var s=i[a];if(void 0===s._lengthComputable||void 0===s._loaded||void 0===s._total)return;n=n&&s._lengthComputable,r+=s._loaded,o+=s._total}this._progressCallback({lengthComputable:n,loaded:r,total:n?o:0})}},t.prototype._validate=function(e,t,n,r){var o=this;void 0===n&&(n=""),void 0===r&&(r=""),this.validate&&(this._startPerformanceCounter("Validate JSON"),b.ValidateAsync(t,n,r,(function(t){return o.preprocessUrlAsync(n+t).then((function(t){return e._loadFileAsync(t,void 0,!0,!0).then((function(e){return new Uint8Array(e,0,e.byteLength)}))}))})).then((function(e){o._endPerformanceCounter("Validate JSON"),o.onValidatedObservable.notifyObservers(e),o.onValidatedObservable.clear()}),(function(e){o._endPerformanceCounter("Validate JSON"),d.Tools.Warn("Failed to validate: ".concat(e.message)),o.onValidatedObservable.clear()})))},t.prototype._getLoader=function(e){var n=e.json.asset||{};this._log("Asset version: ".concat(n.version)),n.minVersion&&this._log("Asset minimum version: ".concat(n.minVersion)),n.generator&&this._log("Asset generator: ".concat(n.generator));var r=t._parseVersion(n.version);if(!r)throw new Error("Invalid version: "+n.version);if(void 0!==n.minVersion){var o=t._parseVersion(n.minVersion);if(!o)throw new Error("Invalid minimum version: "+n.minVersion);if(t._compareVersion(o,{major:2,minor:0})>0)throw new Error("Incompatible minimum version: "+n.minVersion)}var a={1:t._CreateGLTF1Loader,2:t._CreateGLTF2Loader}[r.major];if(!a)throw new Error("Unsupported version: "+n.version);return a(this)},t.prototype._parseJson=function(e){this._startPerformanceCounter("Parse JSON"),this._log("JSON length: ".concat(e.length));var t=JSON.parse(e);return this._endPerformanceCounter("Parse JSON"),t},t.prototype._unpackBinaryAsync=function(e){var t=this;return this._startPerformanceCounter("Unpack Binary"),e.loadAsync(20).then((function(){var n=e.readUint32();if(1179937895!==n)throw new d.RuntimeError("Unexpected magic: "+n,d.ErrorCodes.GLTFLoaderUnexpectedMagicError);var r=e.readUint32();t.loggingEnabled&&t._log("Binary version: ".concat(r));var o,a=e.readUint32();switch(t.useRangeRequests||a===e.buffer.byteLength||d.Logger.Warn("Length in header does not match actual data length: ".concat(a," != ").concat(e.buffer.byteLength)),r){case 1:o=t._unpackBinaryV1Async(e,a);break;case 2:o=t._unpackBinaryV2Async(e,a);break;default:throw new Error("Unsupported version: "+r)}return t._endPerformanceCounter("Unpack Binary"),o}))},t.prototype._unpackBinaryV1Async=function(e,t){var n=e.readUint32(),r=e.readUint32();if(0!==r)throw new Error("Unexpected content format: ".concat(r));var o=t-e.byteOffset,a={json:this._parseJson(e.readString(n)),bin:null};if(0!==o){var i=e.byteOffset;a.bin={readAsync:function(t,n){return e.buffer.readAsync(i+t,n)},byteLength:o}}return Promise.resolve(a)},t.prototype._unpackBinaryV2Async=function(e,t){var n=this,r=1313821514,o=e.readUint32();if(e.readUint32()!==r)throw new Error("First chunk format is not JSON");return e.byteOffset+o===t?e.loadAsync(o).then((function(){return{json:n._parseJson(e.readString(o)),bin:null}})):e.loadAsync(o+8).then((function(){var a={json:n._parseJson(e.readString(o)),bin:null},i=function(){var n=e.readUint32();switch(e.readUint32()){case r:throw new Error("Unexpected JSON chunk");case 5130562:var o=e.byteOffset;a.bin={readAsync:function(t,n){return e.buffer.readAsync(o+t,n)},byteLength:n},e.skipBytes(n);break;default:e.skipBytes(n)}return e.byteOffset!==t?e.loadAsync(8).then(i):Promise.resolve(a)};return i()}))},t._parseVersion=function(e){if("1.0"===e||"1.0.1"===e)return{major:1,minor:0};var t=(e+"").match(/^(\d+)\.(\d+)/);return t?{major:parseInt(t[1]),minor:parseInt(t[2])}:null},t._compareVersion=function(e,t){return e.major>t.major?1:e.major<t.major?-1:e.minor>t.minor?1:e.minor<t.minor?-1:0},t.prototype._logOpen=function(e){this._log(e),this._logIndentLevel++},t.prototype._logClose=function(){--this._logIndentLevel},t.prototype._logEnabled=function(e){var n=t._logSpaces.substring(0,2*this._logIndentLevel);d.Logger.Log("".concat(n).concat(e))},t.prototype._logDisabled=function(e){},t.prototype._startPerformanceCounterEnabled=function(e){d.Tools.StartPerformanceCounter(e)},t.prototype._startPerformanceCounterDisabled=function(e){},t.prototype._endPerformanceCounterEnabled=function(e){d.Tools.EndPerformanceCounter(e)},t.prototype._endPerformanceCounterDisabled=function(e){},t.IncrementalLoading=!0,t.HomogeneousCoordinates=!1,t._logSpaces=" ",t}(function(){function e(){this.coordinateSystemMode=p.AUTO,this.animationStartMode=m.FIRST,this.loadNodeAnimations=!0,this.loadSkins=!0,this.loadMorphTargets=!0,this.compileMaterials=!1,this.useClipPlane=!1,this.compileShadowGenerators=!1,this.transparencyAsCoverage=!1,this.useRangeRequests=!1,this.createInstances=!0,this.alwaysComputeBoundingBox=!1,this.loadAllMaterials=!1,this.loadOnlyMaterials=!1,this.skipMaterials=!1,this.useSRGBBuffers=!0,this.targetFps=60,this.alwaysComputeSkeletonRootNode=!1,this.useGltfTextureNames=!1,this.preprocessUrlAsync=function(e){return Promise.resolve(e)},this.extensionOptions={}}return e.prototype.copyFrom=function(e){var t,n,r,o,a,i,s,l,u,c,d,f,h,p,m,v,b,y,A,_,g;e&&(this.onParsed=e.onParsed,this.coordinateSystemMode=null!==(t=e.coordinateSystemMode)&&void 0!==t?t:this.coordinateSystemMode,this.animationStartMode=null!==(n=e.animationStartMode)&&void 0!==n?n:this.animationStartMode,this.loadNodeAnimations=null!==(r=e.loadNodeAnimations)&&void 0!==r?r:this.loadNodeAnimations,this.loadSkins=null!==(o=e.loadSkins)&&void 0!==o?o:this.loadSkins,this.loadMorphTargets=null!==(a=e.loadMorphTargets)&&void 0!==a?a:this.loadMorphTargets,this.compileMaterials=null!==(i=e.compileMaterials)&&void 0!==i?i:this.compileMaterials,this.useClipPlane=null!==(s=e.useClipPlane)&&void 0!==s?s:this.useClipPlane,this.compileShadowGenerators=null!==(l=e.compileShadowGenerators)&&void 0!==l?l:this.compileShadowGenerators,this.transparencyAsCoverage=null!==(u=e.transparencyAsCoverage)&&void 0!==u?u:this.transparencyAsCoverage,this.useRangeRequests=null!==(c=e.useRangeRequests)&&void 0!==c?c:this.useRangeRequests,this.createInstances=null!==(d=e.createInstances)&&void 0!==d?d:this.createInstances,this.alwaysComputeBoundingBox=null!==(f=e.alwaysComputeBoundingBox)&&void 0!==f?f:this.alwaysComputeBoundingBox,this.loadAllMaterials=null!==(h=e.loadAllMaterials)&&void 0!==h?h:this.loadAllMaterials,this.loadOnlyMaterials=null!==(p=e.loadOnlyMaterials)&&void 0!==p?p:this.loadOnlyMaterials,this.skipMaterials=null!==(m=e.skipMaterials)&&void 0!==m?m:this.skipMaterials,this.useSRGBBuffers=null!==(v=e.useSRGBBuffers)&&void 0!==v?v:this.useSRGBBuffers,this.targetFps=null!==(b=e.targetFps)&&void 0!==b?b:this.targetFps,this.alwaysComputeSkeletonRootNode=null!==(y=e.alwaysComputeSkeletonRootNode)&&void 0!==y?y:this.alwaysComputeSkeletonRootNode,this.useGltfTextureNames=null!==(A=e.useGltfTextureNames)&&void 0!==A?A:this.useGltfTextureNames,this.preprocessUrlAsync=null!==(_=e.preprocessUrlAsync)&&void 0!==_?_:this.preprocessUrlAsync,this.customRootNode=e.customRootNode,this.onMeshLoaded=e.onMeshLoaded,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onCameraLoaded=e.onCameraLoaded,this.extensionOptions=null!==(g=e.extensionOptions)&&void 0!==g?g:this.extensionOptions)},e}());(0,d.registerSceneLoaderPlugin)(new O);var E,L,T,N,S,C,M,x,R=void 0!==r.g?r.g:"undefined"!=typeof window?window:void 0;if(void 0!==R){for(var w in R.BABYLON=R.BABYLON||{},i)R.BABYLON[w]=i[w];for(var w in a)R.BABYLON[w]=a[w]}!function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.FLOAT=5126]="FLOAT"}(E||(E={})),function(e){e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(L||(L={})),function(e){e[e.BYTE=5120]="BYTE",e[e.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",e[e.SHORT=5122]="SHORT",e[e.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",e[e.INT=5124]="INT",e[e.UNSIGNED_INT=5125]="UNSIGNED_INT",e[e.FLOAT=5126]="FLOAT",e[e.FLOAT_VEC2=35664]="FLOAT_VEC2",e[e.FLOAT_VEC3=35665]="FLOAT_VEC3",e[e.FLOAT_VEC4=35666]="FLOAT_VEC4",e[e.INT_VEC2=35667]="INT_VEC2",e[e.INT_VEC3=35668]="INT_VEC3",e[e.INT_VEC4=35669]="INT_VEC4",e[e.BOOL=35670]="BOOL",e[e.BOOL_VEC2=35671]="BOOL_VEC2",e[e.BOOL_VEC3=35672]="BOOL_VEC3",e[e.BOOL_VEC4=35673]="BOOL_VEC4",e[e.FLOAT_MAT2=35674]="FLOAT_MAT2",e[e.FLOAT_MAT3=35675]="FLOAT_MAT3",e[e.FLOAT_MAT4=35676]="FLOAT_MAT4",e[e.SAMPLER_2D=35678]="SAMPLER_2D"}(T||(T={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(N||(N={})),function(e){e[e.NEAREST=9728]="NEAREST",e[e.LINEAR=9728]="LINEAR",e[e.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST",e[e.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST",e[e.NEAREST_MIPMAP_LINEAR=9986]="NEAREST_MIPMAP_LINEAR",e[e.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"}(S||(S={})),function(e){e[e.ALPHA=6406]="ALPHA",e[e.RGB=6407]="RGB",e[e.RGBA=6408]="RGBA",e[e.LUMINANCE=6409]="LUMINANCE",e[e.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA"}(C||(C={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(M||(M={})),function(e){e[e.ZERO=0]="ZERO",e[e.ONE=1]="ONE",e[e.SRC_COLOR=768]="SRC_COLOR",e[e.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR",e[e.DST_COLOR=774]="DST_COLOR",e[e.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR",e[e.SRC_ALPHA=770]="SRC_ALPHA",e[e.ONE_MINUS_SRC_ALPHA=771]="ONE_MINUS_SRC_ALPHA",e[e.DST_ALPHA=772]="DST_ALPHA",e[e.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA",e[e.CONSTANT_COLOR=32769]="CONSTANT_COLOR",e[e.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR",e[e.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA",e[e.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA",e[e.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE"}(x||(x={}));var P,I=function(){function e(){}return e.SetMatrix=function(e,t,n,r,o){var a=null;if("MODEL"===n.semantic?a=t.getWorldMatrix():"PROJECTION"===n.semantic?a=e.getProjectionMatrix():"VIEW"===n.semantic?a=e.getViewMatrix():"MODELVIEWINVERSETRANSPOSE"===n.semantic?a=d.Matrix.Transpose(t.getWorldMatrix().multiply(e.getViewMatrix()).invert()):"MODELVIEW"===n.semantic?a=t.getWorldMatrix().multiply(e.getViewMatrix()):"MODELVIEWPROJECTION"===n.semantic?a=t.getWorldMatrix().multiply(e.getTransformMatrix()):"MODELINVERSE"===n.semantic?a=t.getWorldMatrix().invert():"VIEWINVERSE"===n.semantic?a=e.getViewMatrix().invert():"PROJECTIONINVERSE"===n.semantic?a=e.getProjectionMatrix().invert():"MODELVIEWINVERSE"===n.semantic?a=t.getWorldMatrix().multiply(e.getViewMatrix()).invert():"MODELVIEWPROJECTIONINVERSE"===n.semantic?a=t.getWorldMatrix().multiply(e.getTransformMatrix()).invert():"MODELINVERSETRANSPOSE"===n.semantic&&(a=d.Matrix.Transpose(t.getWorldMatrix().invert())),a)switch(n.type){case T.FLOAT_MAT2:o.setMatrix2x2(r,d.Matrix.GetAsMatrix2x2(a));break;case T.FLOAT_MAT3:o.setMatrix3x3(r,d.Matrix.GetAsMatrix3x3(a));break;case T.FLOAT_MAT4:o.setMatrix(r,a)}},e.SetUniform=function(e,t,n,r){switch(r){case T.FLOAT:return e.setFloat(t,n),!0;case T.FLOAT_VEC2:return e.setVector2(t,d.Vector2.FromArray(n)),!0;case T.FLOAT_VEC3:return e.setVector3(t,d.Vector3.FromArray(n)),!0;case T.FLOAT_VEC4:return e.setVector4(t,d.Vector4.FromArray(n)),!0;default:return!1}},e.GetWrapMode=function(e){switch(e){case N.CLAMP_TO_EDGE:return d.Texture.CLAMP_ADDRESSMODE;case N.MIRRORED_REPEAT:return d.Texture.MIRROR_ADDRESSMODE;case N.REPEAT:default:return d.Texture.WRAP_ADDRESSMODE}},e.GetByteStrideFromType=function(e){switch(e.type){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}},e.GetTextureFilterMode=function(e){switch(e){case S.LINEAR:case S.LINEAR_MIPMAP_NEAREST:case S.LINEAR_MIPMAP_LINEAR:return d.Texture.TRILINEAR_SAMPLINGMODE;case S.NEAREST:case S.NEAREST_MIPMAP_NEAREST:return d.Texture.NEAREST_SAMPLINGMODE;default:return d.Texture.BILINEAR_SAMPLINGMODE}},e.GetBufferFromBufferView=function(e,t,n,r,o){n=t.byteOffset+n;var a=e.loadedBufferViews[t.buffer];if(n+r>a.byteLength)throw new Error("Buffer access is out of range");var i=a.buffer;switch(n+=a.byteOffset,o){case E.BYTE:return new Int8Array(i,n,r);case E.UNSIGNED_BYTE:return new Uint8Array(i,n,r);case E.SHORT:return new Int16Array(i,n,r);case E.UNSIGNED_SHORT:return new Uint16Array(i,n,r);default:return new Float32Array(i,n,r)}},e.GetBufferFromAccessor=function(t,n){var r=t.bufferViews[n.bufferView],o=n.count*e.GetByteStrideFromType(n);return e.GetBufferFromBufferView(t,r,n.byteOffset,o,n.componentType)},e.DecodeBufferToText=function(e){for(var t="",n=e.byteLength,r=0;r<n;++r)t+=String.fromCharCode(e[r]);return t},e.GetDefaultMaterial=function(t){if(!e._DefaultMaterial){d.Effect.ShadersStore.GLTFDefaultMaterialVertexShader=["precision highp float;","","uniform mat4 worldView;","uniform mat4 projection;","","attribute vec3 position;","","void main(void)","{"," gl_Position = projection * worldView * vec4(position, 1.0);","}"].join("\n"),d.Effect.ShadersStore.GLTFDefaultMaterialPixelShader=["precision highp float;","","uniform vec4 u_emission;","","void main(void)","{"," gl_FragColor = u_emission;","}"].join("\n");var n={attributes:["position"],uniforms:["worldView","projection","u_emission"],samplers:new Array,needAlphaBlending:!1};e._DefaultMaterial=new d.ShaderMaterial("GLTFDefaultMaterial",t,{vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},n),e._DefaultMaterial.setColor4("u_emission",new d.Color4(.5,.5,.5,1))}return e._DefaultMaterial},e._DefaultMaterial=null,e}();!function(e){e[e.IDENTIFIER=1]="IDENTIFIER",e[e.UNKNOWN=2]="UNKNOWN",e[e.END_OF_INPUT=3]="END_OF_INPUT"}(P||(P={}));var B=function(){function e(e){this._pos=0,this.currentToken=P.UNKNOWN,this.currentIdentifier="",this.currentString="",this.isLetterOrDigitPattern=/^[a-zA-Z0-9]+$/,this._toParse=e,this._maxPos=e.length}return e.prototype.getNextToken=function(){if(this.isEnd())return P.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=P.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=P.IDENTIFIER,this.currentIdentifier=this.currentString;!this.isEnd()&&(this.isLetterOrDigitPattern.test(this.currentString=this.peek())||"_"===this.currentString);)this.currentIdentifier+=this.currentString,this.forward();return this.currentToken},e.prototype.peek=function(){return this._toParse[this._pos]},e.prototype.read=function(){return this._toParse[this._pos++]},e.prototype.forward=function(){this._pos++},e.prototype.isEnd=function(){return this._pos>=this._maxPos},e}(),F=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],V=["world","view","projection","worldView","worldViewProjection","mBones"],D=["translation","rotation","scale"],k=["position","rotationQuaternion","scaling"],U=function(e,t,n){for(var r in e){var o=e[r];n[t][r]=o}},G=function(e){if(e)for(var t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},j=function(e){if("NORMAL"===e.semantic)return"normal";if("POSITION"===e.semantic)return"position";if("JOINT"===e.semantic)return"matricesIndices";if("WEIGHT"===e.semantic)return"matricesWeights";if("COLOR"===e.semantic)return"color";if(e.semantic&&-1!==e.semantic.indexOf("TEXCOORD_")){var t=Number(e.semantic.split("_")[1]);return"uv"+(0===t?"":t+1)}return null},H=function(e){var t=null;if(e.translation||e.rotation||e.scale){var n=d.Vector3.FromArray(e.scale||[1,1,1]),r=d.Quaternion.FromArray(e.rotation||[0,0,0,1]),o=d.Vector3.FromArray(e.translation||[0,0,0]);t=d.Matrix.Compose(n,r,o)}else t=d.Matrix.FromArray(e.matrix);return t},W=function(e,t,n,r){for(var o=0;o<r.bones.length;o++)if(r.bones[o].name===n)return r.bones[o];var a=e.nodes;for(var i in a){var s=a[i];if(s.jointName){var l=s.children;for(o=0;o<l.length;o++){var u=e.nodes[l[o]];if(u.jointName&&u.jointName===n){var c=H(s),f=new d.Bone(s.name||"",r,W(e,t,s.jointName,r),c);return f.id=i,f}}}}return null},Y=function(e,t){for(var n=0;n<e.length;n++)for(var r=e[n],o=0;o<r.node.children.length;o++)if(r.node.children[o]===t)return r.bone;return null},J=function(e,t){var n=e.nodes,r=n[t];if(r)return{node:r,id:t};for(var o in n)if((r=n[o]).jointName===t)return{node:r,id:o};return null},q=function(e,t){for(var n=0;n<e.jointNames.length;n++)if(e.jointNames[n]===t)return!0;return!1},Z=function(e,t,n,r,o){if(o||(e.scene._blockEntityCollection=!!e.assetContainer,(o=new d.Mesh(t.name||"",e.scene))._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,o.id=r),!t.babylonNode)return o;for(var a,i=[],s=null,l=[],u=[],c=[],f=[],h=0;h<n.length;h++){var p=n[h];if(x=e.meshes[p])for(var m=0;m<x.primitives.length;m++){var v=new d.VertexData,b=x.primitives[m];b.mode;var y=b.attributes,A=null,_=null;for(var g in y)if(A=e.accessors[y[g]],_=I.GetBufferFromAccessor(e,A),"NORMAL"===g)v.normals=new Float32Array(_.length),v.normals.set(_);else if("POSITION"===g){if(O.HomogeneousCoordinates){v.positions=new Float32Array(_.length-_.length/4);for(var E=0;E<_.length;E+=4)v.positions[E]=_[E],v.positions[E+1]=_[E+1],v.positions[E+2]=_[E+2]}else v.positions=new Float32Array(_.length),v.positions.set(_);u.push(v.positions.length)}else if(-1!==g.indexOf("TEXCOORD_")){var L=Number(g.split("_")[1]),T=d.VertexBuffer.UVKind+(0===L?"":L+1),N=new Float32Array(_.length);N.set(_),G(N),v.set(N,T)}else"JOINT"===g?(v.matricesIndices=new Float32Array(_.length),v.matricesIndices.set(_)):"WEIGHT"===g?(v.matricesWeights=new Float32Array(_.length),v.matricesWeights.set(_)):"COLOR"===g&&(v.colors=new Float32Array(_.length),v.colors.set(_));if(A=e.accessors[b.indices])_=I.GetBufferFromAccessor(e,A),v.indices=new Int32Array(_.length),v.indices.set(_),f.push(v.indices.length);else{var S=[];for(E=0;E<v.positions.length/3;E++)S.push(E);v.indices=new Int32Array(S),f.push(v.indices.length)}s?s.merge(v):s=v;var C=e.scene.getMaterialById(b.material);i.push(null===C?I.GetDefaultMaterial(e.scene):C),l.push(0===l.length?0:l[l.length-1]+u[u.length-2]),c.push(0===c.length?0:c[c.length-1]+f[f.length-2])}}e.scene._blockEntityCollection=!!e.assetContainer,i.length>1?(a=new d.MultiMaterial("multimat"+r,e.scene)).subMaterials=i:a=new d.StandardMaterial("multimat"+r,e.scene),1===i.length&&(a=i[0]),a._parentContainer=e.assetContainer,o.material||(o.material=a),new d.Geometry(r,e.scene,s,!1,o),o.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,o.subMeshes=[];var M=0;for(h=0;h<n.length;h++){var x;if(p=n[h],x=e.meshes[p])for(m=0;m<x.primitives.length;m++)x.primitives[m].mode,d.SubMesh.AddToMesh(M,l[M],u[M],c[M],f[M],o,o,!0),M++}return o},K=function(e,t,n,r){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=n),e.scaling&&(e.scaling=r)},Q=function(e,t,n){var r=null;if(e.importOnlyMeshes&&(t.skin||t.meshes)&&e.importMeshesNames&&e.importMeshesNames.length>0&&-1===e.importMeshesNames.indexOf(t.name||""))return null;if(t.skin){if(t.meshes){var o=e.skins[t.skin];(a=Z(e,t,t.meshes,n,t.babylonNode)).skeleton=e.scene.getLastSkeletonById(t.skin),null===a.skeleton&&(a.skeleton=function(e,t,n,r){if(r||(r=new d.Skeleton(t.name||"","",e.scene)),!t.babylonSkeleton)return r;var o=[],a=[];!function(e,t,n,r){for(var o in e.nodes){var a=e.nodes[o],i=o;if(a.jointName&&!q(n,a.jointName)){var s=H(a),l=new d.Bone(a.name||"",t,null,s);l.id=i,r.push({bone:l,node:a,id:i})}}for(var u=0;u<r.length;u++)for(var c=r[u],f=c.node.children,h=0;h<f.length;h++){for(var p=null,m=0;m<r.length;m++)if(r[m].id===f[h]){p=r[m];break}p&&(p.bone._parent=c.bone,c.bone.children.push(p.bone))}}(e,r,t,o),r.bones=[];for(var i=0;i<t.jointNames.length;i++)if(_=J(e,t.jointNames[i])){var s=_.node;if(s){var l=_.id,u=e.scene.getBoneById(l);if(u)r.bones.push(u);else{for(var c=!1,f=null,h=0;h<i;h++){var p=J(e,t.jointNames[h]);if(p){var m=p.node;if(m){var v=m.children;if(v){c=!1;for(var b=0;b<v.length;b++)if(v[b]===l){f=W(e,t,t.jointNames[h],r),c=!0;break}if(c)break}}else d.Tools.Warn("Joint named "+t.jointNames[h]+" does not exist when looking for parent")}}var y=H(s);!f&&o.length>0&&(f=Y(o,l))&&-1===a.indexOf(f)&&a.push(f),new d.Bone(s.jointName||"",r,f,y).id=l}}else d.Tools.Warn("Joint named "+t.jointNames[i]+" does not exist")}var A=r.bones;for(r.bones=[],i=0;i<t.jointNames.length;i++){var _;if(_=J(e,t.jointNames[i]))for(h=0;h<A.length;h++)if(A[h].id===_.id){r.bones.push(A[h]);break}}for(r.prepare(),i=0;i<a.length;i++)r.bones.push(a[i]);return r}(e,o,0,o.babylonSkeleton),o.babylonSkeleton||(o.babylonSkeleton=a.skeleton)),r=a}}else if(t.meshes){var a;r=a=Z(e,t,t.mesh?[t.mesh]:t.meshes,n,t.babylonNode)}else if(!t.light||t.babylonNode||e.importOnlyMeshes){if(t.camera&&!t.babylonNode&&!e.importOnlyMeshes){var i=e.cameras[t.camera];if(i){if(e.scene._blockEntityCollection=!!e.assetContainer,"orthographic"===i.type){var s=new d.FreeCamera(t.camera,d.Vector3.Zero(),e.scene,!1);s.name=t.name||"",s.mode=d.Camera.ORTHOGRAPHIC_CAMERA,s.attachControl(),r=s,s._parentContainer=e.assetContainer}else if("perspective"===i.type){var l=i[i.type],u=new d.FreeCamera(t.camera,d.Vector3.Zero(),e.scene,!1);u.name=t.name||"",u.attachControl(),l.aspectRatio||(l.aspectRatio=e.scene.getEngine().getRenderWidth()/e.scene.getEngine().getRenderHeight()),l.znear&&l.zfar&&(u.maxZ=l.zfar,u.minZ=l.znear),r=u,u._parentContainer=e.assetContainer}e.scene._blockEntityCollection=!1}}}else{var c=e.lights[t.light];if(c)if("ambient"===c.type){var f=c[c.type],h=new d.HemisphericLight(t.light,d.Vector3.Zero(),e.scene);h.name=t.name||"",f.color&&(h.diffuse=d.Color3.FromArray(f.color)),r=h}else if("directional"===c.type){var p=c[c.type],m=new d.DirectionalLight(t.light,d.Vector3.Zero(),e.scene);m.name=t.name||"",p.color&&(m.diffuse=d.Color3.FromArray(p.color)),r=m}else if("point"===c.type){var v=c[c.type],b=new d.PointLight(t.light,d.Vector3.Zero(),e.scene);b.name=t.name||"",v.color&&(b.diffuse=d.Color3.FromArray(v.color)),r=b}else if("spot"===c.type){var y=c[c.type],A=new d.SpotLight(t.light,d.Vector3.Zero(),d.Vector3.Zero(),0,0,e.scene);A.name=t.name||"",y.color&&(A.diffuse=d.Color3.FromArray(y.color)),y.fallOfAngle&&(A.angle=y.fallOfAngle),y.fallOffExponent&&(A.exponent=y.fallOffExponent),r=A}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===r){e.scene._blockEntityCollection=!!e.assetContainer;var _=new d.Mesh(t.name||"",e.scene);_._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,t.babylonNode=_,r=_}}if(null!==r){if(t.matrix&&r instanceof d.Mesh)!function(e,t){if(t.matrix){var n=new d.Vector3(0,0,0),r=new d.Quaternion,o=new d.Vector3(0,0,0);d.Matrix.FromArray(t.matrix).decompose(o,r,n),K(e,n,r,o)}else t.translation&&t.rotation&&t.scale&&K(e,d.Vector3.FromArray(t.translation),d.Quaternion.FromArray(t.rotation),d.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(r,t);else{var g=t.translation||[0,0,0],O=t.rotation||[0,0,0,1],E=t.scale||[1,1,1];K(r,d.Vector3.FromArray(g),d.Quaternion.FromArray(O),d.Vector3.FromArray(E))}r.updateCache(!0),t.babylonNode=r}return r},X=function(e,t,n,r){void 0===r&&(r=!1);var o=e.nodes[t],a=null;if(r=!(e.importOnlyMeshes&&!r&&e.importMeshesNames)||-1!==e.importMeshesNames.indexOf(o.name||"")||0===e.importMeshesNames.length,!o.jointName&&r&&null!==(a=Q(e,o,t))&&(a.id=t,a.parent=n),o.children)for(var i=0;i<o.children.length;i++)X(e,o.children[i],a,r)},z=function(e){var t=e.currentScene;if(t)for(var n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null);for(function(e){for(var t in e.animations){var n=e.animations[t];if(n.channels&&n.samplers)for(var r=null,o=0;o<n.channels.length;o++){var a=n.channels[o],i=n.samplers[a.sampler];if(i){var s=null,l=null;n.parameters?(s=n.parameters[i.input],l=n.parameters[i.output]):(s=i.input,l=i.output);var u=I.GetBufferFromAccessor(e,e.accessors[s]),c=I.GetBufferFromAccessor(e,e.accessors[l]),f=a.target.id,h=e.scene.getNodeById(f);if(null===h&&(h=e.scene.getNodeByName(f)),null!==h){var p=h instanceof d.Bone,m=a.target.path,v=D.indexOf(m);-1!==v&&(m=k[v]);var b=d.Animation.ANIMATIONTYPE_MATRIX;p||("rotationQuaternion"===m?(b=d.Animation.ANIMATIONTYPE_QUATERNION,h.rotationQuaternion=new d.Quaternion):b=d.Animation.ANIMATIONTYPE_VECTOR3);var y=null,A=[],_=0,g=!1;p&&r&&r.getKeys().length===u.length&&(y=r,g=!0),g||(e.scene._blockEntityCollection=!!e.assetContainer,y=new d.Animation(t,p?"_matrix":m,1,b,d.Animation.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(var O=0;O<u.length;O++){var E=null;if("rotationQuaternion"===m?(E=d.Quaternion.FromArray([c[_],c[_+1],c[_+2],c[_+3]]),_+=4):(E=d.Vector3.FromArray([c[_],c[_+1],c[_+2]]),_+=3),p){var L=h,T=d.Vector3.Zero(),N=new d.Quaternion,S=d.Vector3.Zero(),C=L.getBaseMatrix();g&&r&&(C=r.getKeys()[O].value),C.decompose(S,N,T),"position"===m?T=E:"rotationQuaternion"===m?N=E:S=E,E=d.Matrix.Compose(S,N,T)}g?r&&(r.getKeys()[O].value=E):A.push({frame:u[O],value:E})}!g&&y&&(y.setKeys(A),h.animations.push(y)),r=y,e.scene.stopAnimation(h),e.scene.beginAnimation(h,0,u[u.length-1],!0,1)}else d.Tools.Warn("Creating animation named "+t+". But cannot find node named "+f+" to attach to")}}}}(e),n=0;n<e.scene.skeletons.length;n++){var o=e.scene.skeletons[n];e.scene.beginAnimation(o,0,Number.MAX_VALUE,!0,1)}},$=function(e,t,n){for(var r in t.uniforms){var o=t.uniforms[r],a=t.parameters[o];if(e.currentIdentifier===r&&a.semantic&&!a.source&&!a.node){var i=F.indexOf(a.semantic);if(-1!==i)return delete n[r],V[i]}}return e.currentIdentifier},ee=function(e){for(var t in e.materials)re.LoadMaterialAsync(e,t,(function(){}),(function(){}))},te=function(){function e(){}return e.CreateRuntime=function(e,t,n){var r={extensions:{},accessors:{},buffers:{},bufferViews:{},meshes:{},lights:{},cameras:{},nodes:{},images:{},textures:{},shaders:{},programs:{},samplers:{},techniques:{},materials:{},animations:{},skins:{},extensionsUsed:[],scenes:{},buffersCount:0,shaderscount:0,scene:t,rootUrl:n,loadedBufferCount:0,loadedBufferViews:{},loadedShaderCount:0,importOnlyMeshes:!1,dummyNodes:[],assetContainer:null};return e.extensions&&U(e.extensions,"extensions",r),e.extensionsUsed&&U(e.extensionsUsed,"extensionsUsed",r),e.buffers&&function(e,t){for(var n in e){var r=e[n];t.buffers[n]=r,t.buffersCount++}}(e.buffers,r),e.bufferViews&&U(e.bufferViews,"bufferViews",r),e.accessors&&U(e.accessors,"accessors",r),e.meshes&&U(e.meshes,"meshes",r),e.lights&&U(e.lights,"lights",r),e.cameras&&U(e.cameras,"cameras",r),e.nodes&&U(e.nodes,"nodes",r),e.images&&U(e.images,"images",r),e.textures&&U(e.textures,"textures",r),e.shaders&&function(e,t){for(var n in e){var r=e[n];t.shaders[n]=r,t.shaderscount++}}(e.shaders,r),e.programs&&U(e.programs,"programs",r),e.samplers&&U(e.samplers,"samplers",r),e.techniques&&U(e.techniques,"techniques",r),e.materials&&U(e.materials,"materials",r),e.animations&&U(e.animations,"animations",r),e.skins&&U(e.skins,"skins",r),e.scenes&&(r.scenes=e.scenes),e.scene&&e.scenes&&(r.currentScene=e.scenes[e.scene]),r},e.LoadBufferAsync=function(e,t,n,r,o){var a=e.buffers[t];d.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(d.Tools.DecodeBase64(a.uri)))})):d.Tools.LoadFile(e.rootUrl+a.uri,(function(e){return n(new Uint8Array(e))}),o,void 0,!0,(function(e){e&&r(e.status+" "+e.statusText)}))},e.LoadTextureBufferAsync=function(e,t,n,r){var o=e.textures[t];if(o&&o.source)if(o.babylonTexture)n(null);else{var a=e.images[o.source];d.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(d.Tools.DecodeBase64(a.uri)))})):d.Tools.LoadFile(e.rootUrl+a.uri,(function(e){return n(new Uint8Array(e))}),void 0,void 0,!0,(function(e){e&&r(e.status+" "+e.statusText)}))}else r("")},e.CreateTextureAsync=function(e,t,n,r){var o=e.textures[t];if(o.babylonTexture)r(o.babylonTexture);else{var a=e.samplers[o.sampler],i=a.minFilter===S.NEAREST_MIPMAP_NEAREST||a.minFilter===S.NEAREST_MIPMAP_LINEAR||a.minFilter===S.LINEAR_MIPMAP_NEAREST||a.minFilter===S.LINEAR_MIPMAP_LINEAR,s=d.Texture.BILINEAR_SAMPLINGMODE,l=null==n?new Blob:new Blob([n]),u=URL.createObjectURL(l),c=function(){return URL.revokeObjectURL(u)},f=new d.Texture(u,e.scene,!i,!0,s,c,c);void 0!==a.wrapS&&(f.wrapU=I.GetWrapMode(a.wrapS)),void 0!==a.wrapT&&(f.wrapV=I.GetWrapMode(a.wrapT)),f.name=t,o.babylonTexture=f,r(f)}},e.LoadShaderStringAsync=function(e,t,n,r){var o=e.shaders[t];if(d.Tools.IsBase64(o.uri)){var a=atob(o.uri.split(",")[1]);n&&n(a)}else d.Tools.LoadFile(e.rootUrl+o.uri,n,void 0,void 0,!1,(function(e){e&&r&&r(e.status+" "+e.statusText)}))},e.LoadMaterialAsync=function(e,t,n,r){var o=e.materials[t];if(o.technique){var a=e.techniques[o.technique];if(!a){e.scene._blockEntityCollection=!!e.assetContainer;var i=new d.StandardMaterial(t,e.scene);return i._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,i.diffuseColor=new d.Color3(.5,.5,.5),i.sideOrientation=d.Material.CounterClockWiseSideOrientation,void n(i)}var s=e.programs[a.program],l=a.states,u=d.Effect.ShadersStore[s.vertexShader+"VertexShader"],c=d.Effect.ShadersStore[s.fragmentShader+"PixelShader"],f="",h="",p=new B(u),m=new B(c),v={},b=[],y=[],A=[];for(var _ in a.uniforms){var g=a.uniforms[_],O=a.parameters[g];if(v[_]=O,!O.semantic||O.node||O.source)O.type===T.SAMPLER_2D?A.push(_):b.push(_);else{var E=F.indexOf(O.semantic);-1!==E?(b.push(V[E]),delete v[_]):b.push(_)}}for(var L in a.attributes){var N=a.attributes[L];if((R=a.parameters[N]).semantic){var S=j(R);S&&y.push(S)}}for(;!p.isEnd()&&p.getNextToken();)if(p.currentToken===P.IDENTIFIER){var C=!1;for(var L in a.attributes){N=a.attributes[L];var R=a.parameters[N];if(p.currentIdentifier===L&&R.semantic){f+=j(R),C=!0;break}}C||(f+=$(p,a,v))}else f+=p.currentString;for(;!m.isEnd()&&m.getNextToken();)m.currentToken===P.IDENTIFIER?h+=$(m,a,v):h+=m.currentString;var w={vertex:s.vertexShader+t,fragment:s.fragmentShader+t},D={attributes:y,uniforms:b,samplers:A,needAlphaBlending:l&&l.enable&&-1!==l.enable.indexOf(3042)};d.Effect.ShadersStore[s.vertexShader+t+"VertexShader"]=f,d.Effect.ShadersStore[s.fragmentShader+t+"PixelShader"]=h;var k=new d.ShaderMaterial(t,e.scene,w,D);if(k.onError=function(e,t,n){return function(r,o){t.dispose(!0),n("Cannot compile program named "+e.name+". Error: "+o+". Default material will be applied")}}(s,k,r),k.onCompiled=function(e,t,n,r,o,a){return function(i){!function(e,t,n,r,o){var a=r.values||n.parameters,i=n.uniforms,s=function(n){var s=o[n],l=s.type,u=a[i[n]];if(void 0===u&&(u=s.value),!u)return"continue";var c=function(e){return function(n){s.value&&e&&(t.setTexture(e,n),delete o[e])}};l===T.SAMPLER_2D?re.LoadTextureAsync(e,r.values?u:s.value,c(n),(function(){return c(null)})):s.value&&I.SetUniform(t,n,r.values?u:s.value,l)&&delete o[n]};for(var l in o)s(l)}(e,t,n,r,o),t.onBind=function(i){!function(e,t,n,r,o,a,i){var s=a.values||o.parameters;for(var l in n){var u=n[l],c=u.type;if(c===T.FLOAT_MAT2||c===T.FLOAT_MAT3||c===T.FLOAT_MAT4)if(!u.semantic||u.source||u.node){if(u.semantic&&(u.source||u.node)){var d=t.scene.getNodeByName(u.source||u.node||"");if(null===d&&(d=t.scene.getNodeById(u.source||u.node||"")),null===d)continue;I.SetMatrix(t.scene,d,u,l,r.getEffect())}}else I.SetMatrix(t.scene,e,u,l,r.getEffect());else{var f=s[o.uniforms[l]];if(!f)continue;if(c===T.SAMPLER_2D){var h=t.textures[a.values?f:u.value].babylonTexture;if(null==h)continue;r.getEffect().setTexture(l,h)}else I.SetUniform(r.getEffect(),l,f,c)}}i(r)}(i,e,o,t,n,r,a)}}}(e,k,a,o,v,n),k.sideOrientation=d.Material.CounterClockWiseSideOrientation,l&&l.functions){var U=l.functions;U.cullFace&&U.cullFace[0]!==M.BACK&&(k.backFaceCulling=!1);var G=U.blendFuncSeparate;G&&(G[0]===x.SRC_ALPHA&&G[1]===x.ONE_MINUS_SRC_ALPHA&&G[2]===x.ONE&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_COMBINE:G[0]===x.ONE&&G[1]===x.ONE&&G[2]===x.ZERO&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_ONEONE:G[0]===x.SRC_ALPHA&&G[1]===x.ONE&&G[2]===x.ZERO&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_ADD:G[0]===x.ZERO&&G[1]===x.ONE_MINUS_SRC_COLOR&&G[2]===x.ONE&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_SUBTRACT:G[0]===x.DST_COLOR&&G[1]===x.ZERO&&G[2]===x.ONE&&G[3]===x.ONE?k.alphaMode=d.Constants.ALPHA_MULTIPLY:G[0]===x.SRC_ALPHA&&G[1]===x.ONE_MINUS_SRC_COLOR&&G[2]===x.ONE&&G[3]===x.ONE&&(k.alphaMode=d.Constants.ALPHA_MAXIMIZED))}}else r&&r("No technique found.")},e}(),ne=function(){function e(){}return e.RegisterExtension=function(t){e.Extensions[t.name]?d.Tools.Error('Tool with the same name "'+t.name+'" already exists'):e.Extensions[t.name]=t},e.prototype.dispose=function(){},e.prototype._importMeshAsync=function(e,t,n,r,o,a,i,s){var l=this;return t.useRightHandedSystem=!0,re.LoadRuntimeAsync(t,n,r,(function(t){t.assetContainer=o,t.importOnlyMeshes=!0,""===e?t.importMeshesNames=[]:"string"==typeof e?t.importMeshesNames=[e]:!e||e instanceof Array?(t.importMeshesNames=[],d.Tools.Warn("Argument meshesNames must be of type string or string[]")):t.importMeshesNames=[e],l._createNodes(t);var n=[],r=[];for(var i in t.nodes){var s=t.nodes[i];s.babylonNode instanceof d.AbstractMesh&&n.push(s.babylonNode)}for(var u in t.skins){var c=t.skins[u];c.babylonSkeleton instanceof d.Skeleton&&r.push(c.babylonSkeleton)}l._loadBuffersAsync(t,(function(){l._loadShadersAsync(t,(function(){ee(t),z(t),!O.IncrementalLoading&&a&&a(n,r)}))})),O.IncrementalLoading&&a&&a(n,r)}),s),!0},e.prototype.importMeshAsync=function(e,t,n,r,o,a){var i=this;return new Promise((function(s,l){i._importMeshAsync(e,t,r,o,n,(function(e,t){s({meshes:e,particleSystems:[],skeletons:t,animationGroups:[],lights:[],transformNodes:[],geometries:[],spriteManagers:[]})}),a,(function(e){l(new Error(e))}))}))},e.prototype._loadAsync=function(e,t,n,r,o,a){var i=this;e.useRightHandedSystem=!0,re.LoadRuntimeAsync(e,t,n,(function(e){re.LoadRuntimeExtensionsAsync(e,(function(){i._createNodes(e),i._loadBuffersAsync(e,(function(){i._loadShadersAsync(e,(function(){ee(e),z(e),O.IncrementalLoading||r()}))})),O.IncrementalLoading&&r()}),a)}),a)},e.prototype.loadAsync=function(e,t,n,r){var o=this;return new Promise((function(a,i){o._loadAsync(e,t,n,(function(){a()}),r,(function(e){i(new Error(e))}))}))},e.prototype._loadShadersAsync=function(e,t){var n=!1,r=function(n,r){re.LoadShaderStringAsync(e,n,(function(o){o instanceof ArrayBuffer||(e.loadedShaderCount++,o&&(d.Effect.ShadersStore[n+(r.type===L.VERTEX?"VertexShader":"PixelShader")]=o),e.loadedShaderCount===e.shaderscount&&t())}),(function(){d.Tools.Error("Error when loading shader program named "+n+" located at "+r.uri)}))};for(var o in e.shaders){n=!0;var a=e.shaders[o];a?r.bind(this,o,a)():d.Tools.Error("No shader named: "+o)}n||t()},e.prototype._loadBuffersAsync=function(e,t){var n=!1,r=function(n,r){re.LoadBufferAsync(e,n,(function(o){e.loadedBufferCount++,o&&(o.byteLength!=e.buffers[n].byteLength&&d.Tools.Error("Buffer named "+n+" is length "+o.byteLength+". Expected: "+r.byteLength),e.loadedBufferViews[n]=o),e.loadedBufferCount===e.buffersCount&&t()}),(function(){d.Tools.Error("Error when loading buffer named "+n+" located at "+r.uri)}))};for(var o in e.buffers){n=!0;var a=e.buffers[o];a?r.bind(this,o,a)():d.Tools.Error("No buffer named: "+o)}n||t()},e.prototype._createNodes=function(e){var t=e.currentScene;if(t)for(var n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)X(e,t.nodes[n],null)},e.Extensions={},e}(),re=function(){function e(e){this._name=e}return Object.defineProperty(e.prototype,"name",{get:function(){return this._name},enumerable:!1,configurable:!0}),e.prototype.loadRuntimeAsync=function(e,t,n,r,o){return!1},e.prototype.loadRuntimeExtensionsAsync=function(e,t,n){return!1},e.prototype.loadBufferAsync=function(e,t,n,r,o){return!1},e.prototype.loadTextureBufferAsync=function(e,t,n,r){return!1},e.prototype.createTextureAsync=function(e,t,n,r,o){return!1},e.prototype.loadShaderStringAsync=function(e,t,n,r){return!1},e.prototype.loadMaterialAsync=function(e,t,n,r){return!1},e.LoadRuntimeAsync=function(t,n,r,o,a){e._ApplyExtensions((function(e){return e.loadRuntimeAsync(t,n,r,o,a)}),(function(){setTimeout((function(){o&&o(te.CreateRuntime(n.json,t,r))}))}))},e.LoadRuntimeExtensionsAsync=function(t,n,r){e._ApplyExtensions((function(e){return e.loadRuntimeExtensionsAsync(t,n,r)}),(function(){setTimeout((function(){n()}))}))},e.LoadBufferAsync=function(t,n,r,o,a){e._ApplyExtensions((function(e){return e.loadBufferAsync(t,n,r,o,a)}),(function(){te.LoadBufferAsync(t,n,r,o,a)}))},e.LoadTextureAsync=function(t,n,r,o){e._LoadTextureBufferAsync(t,n,(function(a){a&&e._CreateTextureAsync(t,n,a,r,o)}),o)},e.LoadShaderStringAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadShaderStringAsync(t,n,r,o)}),(function(){te.LoadShaderStringAsync(t,n,r,o)}))},e.LoadMaterialAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadMaterialAsync(t,n,r,o)}),(function(){te.LoadMaterialAsync(t,n,r,o)}))},e._LoadTextureBufferAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadTextureBufferAsync(t,n,r,o)}),(function(){te.LoadTextureBufferAsync(t,n,r,o)}))},e._CreateTextureAsync=function(t,n,r,o,a){e._ApplyExtensions((function(e){return e.createTextureAsync(t,n,r,o,a)}),(function(){te.CreateTextureAsync(t,n,r,o)}))},e._ApplyExtensions=function(e,t){for(var n in ne.Extensions)if(e(ne.Extensions[n]))return;t()},e}();O._CreateGLTF1Loader=function(){return new ne};var oe=function(e){function t(){return e.call(this,"KHR_binary_glTF")||this}return c(t,e),t.prototype.loadRuntimeAsync=function(e,t,n,r){var o=t.json.extensionsUsed;return!(!o||-1===o.indexOf(this.name)||!t.bin||(this._bin=t.bin,r(te.CreateRuntime(t.json,e,n)),0))},t.prototype.loadBufferAsync=function(e,t,n,r){return-1!==e.extensionsUsed.indexOf(this.name)&&"binary_glTF"===t&&(this._bin.readAsync(0,this._bin.byteLength).then(n,(function(e){return r(e.message)})),!0)},t.prototype.loadTextureBufferAsync=function(e,t,n){var r=e.textures[t],o=e.images[r.source];if(!o.extensions||!(this.name in o.extensions))return!1;var a=o.extensions[this.name],i=e.bufferViews[a.bufferView];return n(I.GetBufferFromBufferView(e,i,0,i.byteLength,E.UNSIGNED_BYTE)),!0},t.prototype.loadShaderStringAsync=function(e,t,n){var r=e.shaders[t];if(!r.extensions||!(this.name in r.extensions))return!1;var o=r.extensions[this.name],a=e.bufferViews[o.bufferView],i=I.GetBufferFromBufferView(e,a,0,a.byteLength,E.UNSIGNED_BYTE);return setTimeout((function(){var e=I.DecodeBufferToText(i);n(e)})),!0},t}(re);ne.RegisterExtension(new oe);var ae=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return c(t,e),t.prototype.loadRuntimeExtensionsAsync=function(e){if(!e.extensions)return!1;var t=e.extensions[this.name];if(!t)return!1;var n=t.lights;if(n)for(var r in n){var o=n[r];switch(o.type){case"ambient":var a=new d.HemisphericLight(o.name,new d.Vector3(0,1,0),e.scene),i=o.ambient;i&&(a.diffuse=d.Color3.FromArray(i.color||[1,1,1]));break;case"point":var s=new d.PointLight(o.name,new d.Vector3(10,10,10),e.scene),l=o.point;l&&(s.diffuse=d.Color3.FromArray(l.color||[1,1,1]));break;case"directional":var u=new d.DirectionalLight(o.name,new d.Vector3(0,-1,0),e.scene),c=o.directional;c&&(u.diffuse=d.Color3.FromArray(c.color||[1,1,1]));break;case"spot":var f=o.spot;f&&(new d.SpotLight(o.name,new d.Vector3(0,10,0),new d.Vector3(0,-1,0),f.fallOffAngle||Math.PI,f.fallOffExponent||0,e.scene).diffuse=d.Color3.FromArray(f.color||[1,1,1]));break;default:d.Tools.Warn('GLTF Material Common extension: light type "'+o.type+"” not supported")}}return!1},t.prototype.loadMaterialAsync=function(e,t,n,r){var o=e.materials[t];if(!o||!o.extensions)return!1;var a=o.extensions[this.name];if(!a)return!1;var i=new d.StandardMaterial(t,e.scene);return i.sideOrientation=d.Material.CounterClockWiseSideOrientation,"CONSTANT"===a.technique&&(i.disableLighting=!0),i.backFaceCulling=void 0!==a.doubleSided&&!a.doubleSided,i.alpha=void 0===a.values.transparency?1:a.values.transparency,i.specularPower=void 0===a.values.shininess?0:a.values.shininess,"string"==typeof a.values.ambient?this._loadTexture(e,a.values.ambient,i,"ambientTexture",r):i.ambientColor=d.Color3.FromArray(a.values.ambient||[0,0,0]),"string"==typeof a.values.diffuse?this._loadTexture(e,a.values.diffuse,i,"diffuseTexture",r):i.diffuseColor=d.Color3.FromArray(a.values.diffuse||[0,0,0]),"string"==typeof a.values.emission?this._loadTexture(e,a.values.emission,i,"emissiveTexture",r):i.emissiveColor=d.Color3.FromArray(a.values.emission||[0,0,0]),"string"==typeof a.values.specular?this._loadTexture(e,a.values.specular,i,"specularTexture",r):i.specularColor=d.Color3.FromArray(a.values.specular||[0,0,0]),!0},t.prototype._loadTexture=function(e,t,n,r,o){te.LoadTextureBufferAsync(e,t,(function(o){te.CreateTextureAsync(e,t,o,(function(e){return n[r]=e}))}),o)},t}(re);ne.RegisterExtension(new ae);var ie=void 0!==r.g?r.g:"undefined"!=typeof window?window:void 0;if(void 0!==ie)for(var se in ie.BABYLON=ie.BABYLON||{},ie.BABYLON.GLTF1=ie.BABYLON.GLTF1||{},s)ie.BABYLON.GLTF1[se]=s[se];const le=l;return o.default})()));
//# sourceMappingURL=babylon.glTF1FileLoader.min.js.map
{
"name": "babylonjs-loaders",
"version": "7.30.0",
"version": "7.30.1",
"main": "babylonjs.loaders.js",

@@ -18,4 +18,4 @@ "types": "babylonjs.loaders.module.d.ts",

"dependencies": {
"babylonjs": "^7.30.0",
"babylonjs-gltf2interface": "^7.30.0"
"babylonjs": "^7.30.1",
"babylonjs-gltf2interface": "^7.30.1"
},

@@ -22,0 +22,0 @@ "devDependencies": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc