babylonjs-loaders 8.55.0 → 8.55.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- !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,n,r={7347(e,t,n){n.d(t,{T:()=>r});var r={name:"bvh",extensions:{".bvh":{isBinary:!1}}}},3914(e,t,n){n.r(t),n.d(t,{BVHFileLoader:()=>s});var r=n(8322),o=n(5597),a=n(7347),i=n(7872),s=function(){function e(t){this.name=a.T.name,this.extensions=a.T.extensions,this._loadingOptions=(0,r.Cl)((0,r.Cl)({},e._DefaultLoadingOptions),null!=t?t:{})}return Object.defineProperty(e,"_DefaultLoadingOptions",{get:function(){return{loopMode:o.Animation.ANIMATIONLOOPMODE_CYCLE}},enumerable:!1,configurable:!0}),e.prototype.createPlugin=function(t){return new e(t[a.T.name])},e.prototype.canDirectLoad=function(e){return this.isBvhHeader(e)},e.prototype.isBvhHeader=function(e){return"HIERARCHY"==e.split("\n")[0]},e.prototype.isNotBvhHeader=function(e){return!this.isBvhHeader(e)},e.prototype.importMeshAsync=function(e,t,n){if("string"!=typeof n)return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(n))return Promise.reject("BVH loader expects HIERARCHY header.");try{var r=(0,i.R)(n,t,null,this._loadingOptions);return Promise.resolve({meshes:[],particleSystems:[],skeletons:[r],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]})}catch(e){return Promise.reject(e)}},e.prototype.loadAsync=function(e,t){return"string"!=typeof t?Promise.reject("BVH loader expects string data."):this.isNotBvhHeader(t)?Promise.reject("BVH loader expects HIERARCHY header."):this.importMeshAsync(null,e,t).then((function(){}))},e.prototype.loadAssetContainerAsync=function(e,t){if("string"!=typeof t)return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(t))return Promise.reject("BVH loader expects HIERARCHY header.");var n=new o.AssetContainer(e);try{var r=(0,i.R)(t,e,n,this._loadingOptions);return n.skeletons.push(r),Promise.resolve(n)}catch(e){return Promise.reject(e)}},e}();(0,o.RegisterSceneLoaderPlugin)(new s)},7872(e,t,n){n.d(t,{R:()=>m});var r=n(5597),o="Xposition",a="Yposition",i="Zposition",s="Xrotation",l="Yrotation",u="Zrotation",c=function(e){this.loopMode=r.Animation.ANIMATIONLOOPMODE_CYCLE,this.list=[],this.root=f(),this.numFrames=0,this.frameRate=0,this.skeleton=e};function f(){return{name:"",type:"",offset:new r.Vector3,channels:[],children:[],frames:[],parent:null}}function d(e,t,n){for(var c=function(e){var t=e.offset.x,n=e.offset.y,o=e.offset.z;return r.Matrix.Translation(t,n,o)}(e),f=new r.Bone(e.name,n.skeleton,t,c),h=function(e,t){if(0===e.frames.length)return[];for(var n=[],c=e.channels.some((function(e){return e===o||e===a||e===i})),f=e.channels.some((function(e){return e===s||e===l||e===u})),d=new r.Animation("".concat(e.name,"_pos"),"position",t.frameRate,r.Animation.ANIMATIONTYPE_VECTOR3,t.loopMode),h=new r.Animation("".concat(e.name,"_rot"),"rotationQuaternion",t.frameRate,r.Animation.ANIMATIONTYPE_QUATERNION,t.loopMode),p=[],m=[],_=0;_<e.frames.length;_++){var g=e.frames[_];c&&g.position&&p.push({frame:g.frame,value:g.position.clone()}),f&&m.push({frame:g.frame,value:g.rotation.clone()})}return p.length>0&&(d.setKeys(p),n.push(d)),m.length>0&&(h.setKeys(m),n.push(h)),n}(e,n),p=0,m=h;p<m.length;p++){var _=m[p];_.getKeys()&&_.getKeys().length>0&&f.animations.push(_)}for(var g=0,b=e.children;g<b.length;g++)d(b[g],f,n)}function h(e,t,n,c){if("ENDSITE"!==n.type){var f={frame:0,position:new r.Vector3,rotation:new r.Quaternion};f.frame=t,f.position=new r.Vector3,f.rotation=new r.Quaternion,n.frames.push(f);for(var d=r.Matrix.Identity(),p=0;p<n.channels.length;++p){var m=n.channels[p],_=e[c.i++];if(_){var g=parseFloat(_.trim());if(m.endsWith("position"))switch(m){case o:f.position.x=g;break;case a:f.position.y=g;break;case i:f.position.z=g}else if(m.endsWith("rotation")){var b=r.Tools.ToRadians(g),y=void 0;switch(m){case s:y=r.Matrix.RotationX(b);break;case l:y=r.Matrix.RotationY(b);break;case u:y=r.Matrix.RotationZ(b)}d=y.multiply(d)}}}r.Quaternion.FromRotationMatrixToRef(d,f.rotation);for(var v=0,T=n.children;v<T.length;v++)h(e,t,T[v],c)}}function p(e,t,n,o){var a,i,s,l,u=f();u.parent=n,o.list.push(u);var c=t.trim().split(/\s+/);if("END"===c[0].toUpperCase()&&"SITE"===c[1].toUpperCase()?(u.type="ENDSITE",u.name="ENDSITE"):(u.name=c[1],u.type=c[0].toUpperCase()),"{"!=(null===(a=e.shift())||void 0===a?void 0:a.trim()))throw new Error("Expected opening { after type & name");var d=null===(i=e.shift())||void 0===i?void 0:i.trim().split(/\s+/);if(!d)throw new Error("Unexpected end of file: missing OFFSET");if("OFFSET"!=(c=d)[0].toUpperCase())throw new Error("Expected OFFSET, but got: "+c[0]);if(4!=c.length)throw new Error("OFFSET: Invalid number of values");var h=new r.Vector3(parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3]));if(isNaN(h.x)||isNaN(h.y)||isNaN(h.z))throw new Error("OFFSET: Invalid values");if(u.offset=h,"ENDSITE"!=u.type){if(!(c=null===(s=e.shift())||void 0===s?void 0:s.trim().split(/\s+/)))throw new Error("Unexpected end of file: missing CHANNELS");if("CHANNELS"!=c[0].toUpperCase())throw new Error("Expected CHANNELS definition");var m=parseInt(c[1]);u.channels=c.splice(2,m),u.children=[]}for(;e.length>0;){var _=null===(l=e.shift())||void 0===l?void 0:l.trim();if("}"===_)return u;_&&u.children.push(p(e,_,u,o))}throw new Error("Unexpected end of file: missing closing brace")}function m(e,t,n,o){var a=e.split("\n"),i=o.loopMode;t._blockEntityCollection=!!n;var s=new r.Skeleton("","",t);s._parentContainer=n,t._blockEntityCollection=!1;var l=new c(s);l.loopMode=i;var u=a.shift();if(!u||"HIERARCHY"!==u.trim().toUpperCase())throw new Error("HIERARCHY expected");var f=a.shift();if(!f)throw new Error("Unexpected end of file after HIERARCHY");var m=p(a,f.trim(),null,l),_=a.shift();if(!_||"MOTION"!==_.trim().toUpperCase())throw new Error("MOTION expected");var g=a.shift();if(!g)throw new Error("Unexpected end of file before frame count");var b=g.trim().split(/[\s]+/);if(b.length<2)throw new Error("Invalid frame count line");var y=parseInt(b[1]);if(isNaN(y))throw new Error("Failed to read number of frames.");l.numFrames=y;var v=a.shift();if(!v)throw new Error("Unexpected end of file before frame time");var T=v.trim().split(/[\s]+/);if(T.length<3)throw new Error("Invalid frame time line");var x=parseFloat(T[2]);if(isNaN(x))throw new Error("Failed to read frame time.");if(x<=0)throw new Error("Failed to read frame time. Invalid value "+x);l.frameRate=1/x;for(var A=0;A<y;++A){var w=a.shift();w&&h(w.trim().split(/[\s]+/)||[],A,m,{i:0})}return l.root=m,d(l.root,null,l),l.skeleton.returnToRest(),l.skeleton}},4028(e,t,n){n.d(t,{B:()=>o});var r=n(5597),o=function(){function e(){this.materials=[]}return e.prototype.parseMTL=function(t,n,o,a){if(!(n instanceof ArrayBuffer)){for(var i,s=n.split("\n"),l=/\s+/,u=null,c=0;c<s.length;c++){var f=s[c].trim();if(0!==f.length&&"#"!==f.charAt(0)){var d=f.indexOf(" "),h=d>=0?f.substring(0,d):f;h=h.toLowerCase();var p=d>=0?f.substring(d+1).trim():"";if("newmtl"===h)u&&this.materials.push(u),t._blockEntityCollection=!!a,(u=new r.StandardMaterial(p,t))._parentContainer=a,t._blockEntityCollection=!1;else if("kd"===h&&u)i=p.split(l,3).map(parseFloat),u.diffuseColor=r.Color3.FromArray(i);else if("ka"===h&&u)i=p.split(l,3).map(parseFloat),u.ambientColor=r.Color3.FromArray(i);else if("ks"===h&&u)i=p.split(l,3).map(parseFloat),u.specularColor=r.Color3.FromArray(i);else if("ke"===h&&u)i=p.split(l,3).map(parseFloat),u.emissiveColor=r.Color3.FromArray(i);else if("ns"===h&&u)u.specularPower=parseFloat(p);else if("d"===h&&u)u.alpha=parseFloat(p);else if("map_ka"===h&&u)u.ambientTexture=e._GetTexture(o,p,t);else if("map_kd"===h&&u)u.diffuseTexture=e._GetTexture(o,p,t);else if("map_ks"===h&&u)u.specularTexture=e._GetTexture(o,p,t);else if("map_ns"===h);else if("map_bump"===h&&u){var m=p.split(l),_=m.indexOf("-bm"),g=null;_>=0&&(g=m[_+1],m.splice(_,2)),u.bumpTexture=e._GetTexture(o,m.join(" "),t),u.bumpTexture&&null!==g&&(u.bumpTexture.level=parseFloat(g))}else"map_d"===h&&u&&(u.opacityTexture=e._GetTexture(o,p,t))}}u&&this.materials.push(u)}},e._GetTexture=function(t,n,o){if(!n)return null;var a=t;if("file:"===t){var i=n.lastIndexOf("\\");-1===i&&(i=n.lastIndexOf("/")),a+=i>-1?n.substring(i+1):n}else a+=n;return new r.Texture(a,o,!1,e.INVERT_TEXTURE_Y)},e.INVERT_TEXTURE_Y=!0,e}()},9363(e,t,n){n.d(t,{M:()=>r});var r={name:"obj",extensions:".obj"}},8778(e,t,n){n.r(t),n.d(t,{OBJFileLoader:()=>l});var r=n(8322),o=n(5597),a=n(9363),i=n(4028),s=n(3382),l=function(){function e(t){this.name=a.M.name,this.extensions=a.M.extensions,this._assetContainer=null,this._loadingOptions=(0,r.Cl)((0,r.Cl)({},e._DefaultLoadingOptions),null!=t?t:{})}return Object.defineProperty(e,"INVERT_TEXTURE_Y",{get:function(){return i.B.INVERT_TEXTURE_Y},set:function(e){i.B.INVERT_TEXTURE_Y=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"_DefaultLoadingOptions",{get:function(){return{computeNormals:e.COMPUTE_NORMALS,optimizeNormals:e.OPTIMIZE_NORMALS,importVertexColors:e.IMPORT_VERTEX_COLORS,invertY:e.INVERT_Y,invertTextureY:e.INVERT_TEXTURE_Y,UVScaling:e.UV_SCALING,materialLoadingFailsSilently:e.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:e.OPTIMIZE_WITH_UV,skipMaterials:e.SKIP_MATERIALS,useLegacyBehavior:e.USE_LEGACY_BEHAVIOR}},enumerable:!1,configurable:!0}),e.prototype._loadMTL=function(e,t,n,r){var a=t+e;o.Tools.LoadFile(a,n,void 0,void 0,!1,(function(e,t){r(a,t)}))},e.prototype.createPlugin=function(t){return new e(t[a.M.name])},e.prototype.canDirectLoad=function(){return!1},e.prototype.importMeshAsync=function(e,t,n,r){return this._parseSolidAsync(e,t,n,r).then((function(e){return{meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}}))},e.prototype.loadAsync=function(e,t,n){return this.importMeshAsync(null,e,t,n).then((function(){}))},e.prototype.loadAssetContainerAsync=function(e,t,n){var r=this,a=new o.AssetContainer(e);return this._assetContainer=a,this.importMeshAsync(null,e,t,n).then((function(e){return e.meshes.forEach((function(e){return a.meshes.push(e)})),e.meshes.forEach((function(e){var t=e.material;t&&-1==a.materials.indexOf(t)&&(a.materials.push(t),t.getActiveTextures().forEach((function(e){-1==a.textures.indexOf(e)&&a.textures.push(e)})))})),r._assetContainer=null,a})).catch((function(e){throw r._assetContainer=null,e}))},e.prototype._parseSolidAsync=function(e,t,n,r){var a=this,l="",u=new i.B,c=[],f=[];n=n.replace(/#.*$/gm,"").trim(),new s.n(c,f,this._loadingOptions).parse(e,n,t,this._assetContainer,(function(e){l=e}));var d=[];return""===l||this._loadingOptions.skipMaterials||d.push(new Promise((function(e,n){a._loadMTL(l,r,(function(i){try{u.parseMTL(t,i,r,a._assetContainer);for(var s=0;s<u.materials.length;s++){for(var d=0,h=[],p=void 0;(p=c.indexOf(u.materials[s].name,d))>-1;)h.push(p),d=p+1;if(-1===p&&0===h.length)u.materials[s].dispose();else for(var m=0;m<h.length;m++){var _=f[h[m]],g=u.materials[s];_.material=g,_.getTotalIndices()||(g.pointsCloud=!0)}}e()}catch(t){o.Tools.Warn("Error processing MTL file: '".concat(l,"'")),a._loadingOptions.materialLoadingFailsSilently?e():n(t)}}),(function(t,r){o.Tools.Warn("Error downloading MTL file: '".concat(l,"'")),a._loadingOptions.materialLoadingFailsSilently?e():n(r)}))}))),Promise.all(d).then((function(){var e=function(e){var t,n;return Boolean(null!==(n=null===(t=e._internalMetadata)||void 0===t?void 0:t._isLine)&&void 0!==n&&n)};return f.forEach((function(n){var r,a;if(e(n)){var i=null!==(r=n.material)&&void 0!==r?r:new o.StandardMaterial(n.name+"_line",t);i.getBindedMeshes().filter((function(t){return!e(t)})).length>0&&(i=null!==(a=i.clone(i.name+"_line"))&&void 0!==a?a:i),i.wireframe=!0,n.material=i,n._internalMetadata&&(n._internalMetadata._isLine=void 0)}})),f}))},e.OPTIMIZE_WITH_UV=!0,e.INVERT_Y=!1,e.IMPORT_VERTEX_COLORS=!1,e.COMPUTE_NORMALS=!1,e.OPTIMIZE_NORMALS=!1,e.UV_SCALING=new o.Vector2(1,1),e.SKIP_MATERIALS=!1,e.MATERIAL_LOADING_FAILS_SILENTLY=!0,e.USE_LEGACY_BEHAVIOR=!1,e}();(0,o.RegisterSceneLoaderPlugin)(new l)},3382(e,t,n){n.d(t,{n:()=>o});var r=n(5597),o=function(){function e(e,t,n){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._extColors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new r.Color4(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=e,this._babylonMeshesArray=t,this._loadingOptions=n}return e.prototype._isInArray=function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[]});var n=e[t[0]].normals.indexOf(t[1]);return-1===n?-1:e[t[0]].idx[n]},e.prototype._isInArrayUV=function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});var n=e[t[0]].normals.indexOf(t[1]);return 1!=n&&t[2]===e[t[0]].uv[n]?e[t[0]].idx[n]:-1},e.prototype._setData=function(e){var t,n,r;null!==(t=e.indiceUvsFromObj)&&void 0!==t||(e.indiceUvsFromObj=-1),null!==(n=e.indiceNormalFromObj)&&void 0!==n||(e.indiceNormalFromObj=-1),-1===(r=this._loadingOptions.optimizeWithUV?this._isInArrayUV(this._tuplePosNorm,[e.indicePositionFromObj,e.indiceNormalFromObj,e.indiceUvsFromObj]):this._isInArray(this._tuplePosNorm,[e.indicePositionFromObj,e.indiceNormalFromObj]))?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(e.positionVectorFromOBJ),void 0!==e.textureVectorFromOBJ&&this._wrappedUvsForBabylon.push(e.textureVectorFromOBJ),void 0!==e.normalsVectorFromOBJ&&this._wrappedNormalsForBabylon.push(e.normalsVectorFromOBJ),void 0!==e.positionColorsFromOBJ&&this._wrappedColorsForBabylon.push(e.positionColorsFromOBJ),this._tuplePosNorm[e.indicePositionFromObj].normals.push(e.indiceNormalFromObj),this._tuplePosNorm[e.indicePositionFromObj].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[e.indicePositionFromObj].uv.push(e.indiceUvsFromObj)):this._indicesForBabylon.push(r)},e.prototype._unwrapData=function(){try{for(var e=0;e<this._wrappedPositionForBabylon.length;e++)this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[e].x*this._handednessSign,this._wrappedPositionForBabylon[e].y,this._wrappedPositionForBabylon[e].z),this._wrappedNormalsForBabylon.length&&this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[e].x*this._handednessSign,this._wrappedNormalsForBabylon[e].y,this._wrappedNormalsForBabylon[e].z),this._wrappedUvsForBabylon.length&&this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[e].x,this._wrappedUvsForBabylon[e].y),this._unwrappedColorsForBabylon.length&&this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[e].r,this._wrappedColorsForBabylon[e].g,this._wrappedColorsForBabylon[e].b,this._wrappedColorsForBabylon[e].a);this._wrappedPositionForBabylon.length=0,this._wrappedNormalsForBabylon.length=0,this._wrappedUvsForBabylon.length=0,this._wrappedColorsForBabylon.length=0,this._tuplePosNorm.length=0,this._curPositionInIndices=0}catch(e){throw new Error("Unable to unwrap data while parsing OBJ data.",{cause:e})}},e.prototype._getTriangles=function(e,t){for(var n=t;n<e.length-1;n++)this._pushTriangle(e,n)},e.prototype._getColor=function(e){var t;return this._loadingOptions.importVertexColors?null!==(t=this._extColors[e])&&void 0!==t?t:this._colors[e]:void 0},e.prototype._setDataForCurrentFaceWithPattern1=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=parseInt(this._triangles[n])-1;this._setData({indicePositionFromObj:r,positionVectorFromOBJ:this._positions[r],positionColorsFromOBJ:this._getColor(r)})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern2=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("/"),o=parseInt(r[0])-1,a=parseInt(r[1])-1;this._setData({indicePositionFromObj:o,indiceUvsFromObj:a,positionVectorFromOBJ:this._positions[o],textureVectorFromOBJ:this._uvs[a],positionColorsFromOBJ:this._getColor(o)})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern3=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("/"),o=parseInt(r[0])-1,a=parseInt(r[1])-1,i=parseInt(r[2])-1;this._setData({indicePositionFromObj:o,indiceUvsFromObj:a,indiceNormalFromObj:i,positionVectorFromOBJ:this._positions[o],textureVectorFromOBJ:this._uvs[a],normalsVectorFromOBJ:this._normals[i]})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern4=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("//"),o=parseInt(r[0])-1,a=parseInt(r[1])-1;this._setData({indicePositionFromObj:o,indiceNormalFromObj:a,positionVectorFromOBJ:this._positions[o],normalsVectorFromOBJ:this._normals[a],positionColorsFromOBJ:this._getColor(o)})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern5=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("/"),o=this._positions.length+parseInt(r[0]),a=this._uvs.length+parseInt(r[1]),i=this._normals.length+parseInt(r[2]);this._setData({indicePositionFromObj:o,indiceUvsFromObj:a,indiceNormalFromObj:i,positionVectorFromOBJ:this._positions[o],textureVectorFromOBJ:this._uvs[a],normalsVectorFromOBJ:this._normals[i],positionColorsFromOBJ:this._getColor(o)})}this._triangles.length=0},e.prototype._addPreviousObjMesh=function(){this._meshesFromObj.length>0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice()),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon.slice()),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._handledMesh.hasLines=this._hasLineData,this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)},e.prototype._optimizeNormals=function(e){var t=e.getVerticesData(r.VertexBuffer.PositionKind),n=e.getVerticesData(r.VertexBuffer.NormalKind),o={};if(t&&n){for(var a=0;a<t.length/3;a++)(l=o[s=t[3*a+0]+"_"+t[3*a+1]+"_"+t[3*a+2]])||(l=[],o[s]=l),l.push(a);var i=new r.Vector3;for(var s in o){var l;if(!((l=o[s]).length<2)){var u=l[0];for(a=1;a<l.length;++a){var c=l[a];n[3*u+0]+=n[3*c+0],n[3*u+1]+=n[3*c+1],n[3*u+2]+=n[3*c+2]}for(i.copyFromFloats(n[3*u+0],n[3*u+1],n[3*u+2]),i.normalize(),a=0;a<l.length;++a)n[3*(c=l[a])+0]=i.x,n[3*c+1]=i.y,n[3*c+2]=i.z}}e.setVerticesData(r.VertexBuffer.NormalKind,n)}},e._IsLineElement=function(e){return e.startsWith("l")},e._IsObjectElement=function(e){return e.startsWith("o")},e._IsGroupElement=function(e){return e.startsWith("g")},e._GetZbrushMRGB=function(e,t){if(!e.startsWith("mrgb"))return null;if(e=e.replace("mrgb","").trim(),t)return[];var n=e.match(/[a-z0-9]/g);if(!n||n.length%8!=0)return[];for(var o=[],a=0;a<n.length/8;a++){var i=n[8*a+2]+n[8*a+3],s=n[8*a+4]+n[8*a+5],l=n[8*a+6]+n[8*a+7];o.push(new r.Color4(parseInt(i,16)/255,parseInt(s,16)/255,parseInt(l,16)/255,1))}return o},e.prototype.parse=function(t,n,o,a,i){var s,l,u=this;n=(n=n.replace(/#MRGB/g,"mrgb")).replace(/#.*$/gm,"").trim(),this._loadingOptions.useLegacyBehavior?(this._pushTriangle=function(e,t){return u._triangles.push(e[0],e[t],e[t+1])},this._handednessSign=1):o.useRightHandedSystem?(this._pushTriangle=function(e,t){return u._triangles.push(e[0],e[t+1],e[t])},this._handednessSign=1):(this._pushTriangle=function(e,t){return u._triangles.push(e[0],e[t],e[t+1])},this._handednessSign=-1);var c=n.split("\n"),f=[],d=[];f.push(d);for(var h=0;h<c.length;h++)if(0!==(g=c[h].trim().replace(/\s\s/g," ")).length&&"#"!==g.charAt(0))if((e._IsGroupElement(g)||e._IsObjectElement(g))&&(d=[],f.push(d)),e._IsLineElement(g))for(var p=g.split(" "),m=1;m<p.length-1;m++)d.push("l ".concat(p[m]," ").concat(p[m+1]));else d.push(g);var _=f.flat();for(h=0;h<_.length;h++){var g,b=void 0;if(0!==(g=_[h].trim().replace(/\s\s/g," ")).length&&"#"!==g.charAt(0))if(e.VertexPattern.test(g)){if(b=g.match(/[^ ]+/g),this._positions.push(new r.Vector3(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3]))),this._loadingOptions.importVertexColors)if(b.length>=7){var y=parseFloat(b[4]),v=parseFloat(b[5]),T=parseFloat(b[6]);this._colors.push(new r.Color4(y>1?y/255:y,v>1?v/255:v,T>1?T/255:T,7===b.length||void 0===b[7]?1:parseFloat(b[7])))}else this._colors.push(this._grayColor)}else if(null!==(b=e.NormalPattern.exec(g)))this._normals.push(new r.Vector3(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])));else if(null!==(b=e.UVPattern.exec(g)))this._uvs.push(new r.Vector2(parseFloat(b[1])*this._loadingOptions.UVScaling.x,parseFloat(b[2])*this._loadingOptions.UVScaling.y));else if(null!==(b=e.FacePattern3.exec(g)))this._setDataForCurrentFaceWithPattern3(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern4.exec(g)))this._setDataForCurrentFaceWithPattern4(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern5.exec(g)))this._setDataForCurrentFaceWithPattern5(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern2.exec(g)))this._setDataForCurrentFaceWithPattern2(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern1.exec(g)))this._setDataForCurrentFaceWithPattern1(b[1].trim().split(" "),1);else if(null!==(b=e.LinePattern1.exec(g)))this._setDataForCurrentFaceWithPattern1(b[1].trim().split(" "),0),this._hasLineData=!0;else if(null!==(b=e.LinePattern2.exec(g)))this._setDataForCurrentFaceWithPattern2(b[1].trim().split(" "),0),this._hasLineData=!0;else if(b=e._GetZbrushMRGB(g,!this._loadingOptions.importVertexColors))for(var x=0,A=b;x<A.length;x++){var w=A[x];this._extColors.push(w)}else if(null!==(b=e.LinePattern3.exec(g)))this._setDataForCurrentFaceWithPattern3(b[1].trim().split(" "),0),this._hasLineData=!0;else if(e.GroupDescriptor.test(g)||e.ObjectDescriptor.test(g)){var O={name:g.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:e.ObjectDescriptor.test(g)};this._addPreviousObjMesh(),this._meshesFromObj.push(O),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else e.UseMtlDescriptor.test(g)?(this._materialNameFromObj=g.substring(7).trim(),this._isFirstMaterial&&this._hasMeshes||(this._addPreviousObjMesh(),O={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1},this._increment++,this._meshesFromObj.push(O),this._hasMeshes=!0),this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)):e.MtlLibGroupDescriptor.test(g)?i(g.substring(7).trim()):e.SmoothDescriptor.test(g)||r.Logger.Log("Unhandled expression at line : "+g)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon),this._handledMesh.hasLines=this._hasLineData),!this._hasMeshes){var C=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(var M=0,E=this._positions;M<E.length;M++){var L=E[M];this._unwrappedPositionsForBabylon.push(L.x,L.y,L.z)}if(this._normals.length)for(var F=0,R=this._normals;F<R.length;F++){var P=R[F];this._unwrappedNormalsForBabylon.push(P.x,P.y,P.z)}if(this._uvs.length)for(var S=0,I=this._uvs;S<I.length;S++){var N=I[S];this._unwrappedUVForBabylon.push(N.x,N.y)}if(this._extColors.length)for(var B=0,k=this._extColors;B<k.length;B++){var H=k[B];this._unwrappedColorsForBabylon.push(H.r,H.g,H.b,H.a)}else if(this._colors.length)for(var G=0,V=this._colors;G<V.length;G++)H=V[G],this._unwrappedColorsForBabylon.push(H.r,H.g,H.b,H.a);this._materialNameFromObj||((C=new r.StandardMaterial(r.Geometry.RandomId(),o)).pointsCloud=!0,this._materialNameFromObj=C.name,this._normals.length||(C.disableLighting=!0,C.emissiveColor=r.Color3.White()))}this._meshesFromObj.push({name:r.Geometry.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:C,isObject:!0,hasLines:this._hasLineData})}for(var D=0;D<this._meshesFromObj.length;D++){if(t&&this._meshesFromObj[D].name)if(t instanceof Array){if(-1===t.indexOf(this._meshesFromObj[D].name))continue}else if(this._meshesFromObj[D].name!==t)continue;this._handledMesh=this._meshesFromObj[D],o._blockEntityCollection=!!a;var K=new r.Mesh(this._meshesFromObj[D].name,o);if(K._parentContainer=a,o._blockEntityCollection=!1,this._handledMesh._babylonMesh=K,!this._handledMesh.isObject)for(var U=D-1;U>=0;--U)if(this._meshesFromObj[U].isObject&&this._meshesFromObj[U]._babylonMesh){K.parent=this._meshesFromObj[U]._babylonMesh;break}if(this._materialToUse.push(this._meshesFromObj[D].materialName),this._handledMesh.hasLines&&(null!==(s=K._internalMetadata)&&void 0!==s||(K._internalMetadata={}),K._internalMetadata._isLine=!0),0!==(null===(l=this._handledMesh.positions)||void 0===l?void 0:l.length)){var j=new r.VertexData;if(j.indices=this._handledMesh.indices,j.positions=this._handledMesh.positions,this._loadingOptions.computeNormals||!this._handledMesh.normals){var Y=new Array;r.VertexData.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,Y),j.normals=Y}else j.normals=this._handledMesh.normals;this._handledMesh.uvs&&(j.uvs=this._handledMesh.uvs),this._handledMesh.colors&&(j.colors=this._handledMesh.colors),j.applyToMesh(K),this._loadingOptions.invertY&&(K.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(K),this._babylonMeshesArray.push(K),this._handledMesh.directMaterial&&(K.material=this._handledMesh.directMaterial)}else this._babylonMeshesArray.push(K)}},e.ObjectDescriptor=/^o/,e.GroupDescriptor=/^g/,e.MtlLibGroupDescriptor=/^mtllib /,e.UseMtlDescriptor=/^usemtl /,e.SmoothDescriptor=/^s /,e.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/,e.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,e.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,e.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/,e.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/,e.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/,e.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,e.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,e}()},9003(e,t,n){n.d(t,{B:()=>r});var r={name:"splat",extensions:{".splat":{isBinary:!0},".ply":{isBinary:!0},".spz":{isBinary:!0},".json":{isBinary:!1},".sog":{isBinary:!0}}}},1063(e,t,n){n.r(t),n.d(t,{SPLATFileLoader:()=>c});var r=n(8322),o=n(5597),a=n(9003),i=.28209479177387814;function s(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,o){var a,i=n.createCanvasImage();if(!i)throw new Error("Failed to create ImageBitmap");if(i.onload=function(){try{var e=n.createCanvas(i.width,i.height);if(!e)throw new Error("Failed to create canvas");var t=e.getContext("2d");if(!t)throw new Error("Failed to get 2D context");t.drawImage(i,0,0);var a=t.getImageData(0,0,e.width,e.height);r({bits:new Uint8Array(a.data.buffer),width:a.width})}catch(e){o("Error loading image ".concat(i.src," with exception: ").concat(e))}},i.onerror=function(e){o("Error loading image ".concat(i.src," with exception: ").concat(e))},i.crossOrigin="anonymous","string"==typeof e){if(!t)throw new Error("filename is required when using a URL");i.src=e+t}else{var s=new Blob([e],{type:"image/webp"});a=URL.createObjectURL(s),i.src=a}}))];case 1:return[2,r.sent()]}}))}))}function l(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){var a,s,l,u,c,f,d,h,p,m,_,g,b,y,v,T,x,A,w,O,C,M,E,L,F,R,P,S,I,N,B,k,H,G,V,D,K,U,j,Y,W,z,Z,q,X,J,Q,$,ee,te,ne,re,oe,ae,ie,se,le,ue,ce,fe,de,he,pe,me;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if(a=e.count?e.count:e.means.shape[0],s=new ArrayBuffer(32*a),l=new Float32Array(s),u=new Float32Array(s),c=new Uint8ClampedArray(s),f=new Uint8ClampedArray(s),d=function(e){return Math.sign(e)*(Math.exp(Math.abs(e))-1)},h=t[0].bits,p=t[1].bits,!Array.isArray(e.means.mins)||!Array.isArray(e.means.maxs))throw new Error("Missing arrays in SOG data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<3;le++)m=e.means.mins[le],_=e.means.maxs[le],g=p[C+le],b=h[C+le],U=g<<8|b,re=o.Scalar.Lerp(m,_,U/65535),l[8*ne+le]=d(re);if(y=t[2].bits,2===e.version){if(!e.scales.codebook)throw new Error("Missing codebook in SOG version 2 scales data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<3;le++)T=e.scales.codebook[y[C+le]],v=Math.exp(T),u[8*ne+3+le]=v}else{if(!Array.isArray(e.scales.mins)||!Array.isArray(e.scales.maxs))throw new Error("Missing arrays in SOG scales data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<3;le++)T=y[C+le],x=o.Scalar.Lerp(e.scales.mins[le],e.scales.maxs[le],T/255),A=Math.exp(x),u[8*ne+3+le]=A}if(w=t[4].bits,2===e.version){if(!e.sh0.codebook)throw new Error("Missing codebook in SOG version 2 sh0 data.");for(ne=0;ne<a;ne++){for(C=4*ne,le=0;le<3;le++)O=.5+e.sh0.codebook[w[C+le]]*i,c[32*ne+24+le]=Math.max(0,Math.min(255,Math.round(255*O)));c[32*ne+24+3]=w[C+3]}}else{if(!Array.isArray(e.sh0.mins)||!Array.isArray(e.sh0.maxs))throw new Error("Missing arrays in SOG sh0 data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<4;le++)M=e.sh0.mins[le],E=e.sh0.maxs[le],L=w[C+le],G=o.Scalar.Lerp(M,E,L/255),void 0,F=le<3?.5+G*i:1/(1+Math.exp(-G)),c[32*ne+24+le]=Math.max(0,Math.min(255,Math.round(255*F)))}for(R=function(e){return 2*(e/255-.5)/Math.SQRT2},P=t[3].bits,ne=0;ne<a;ne++){switch(S=P[4*ne+0],I=P[4*ne+1],N=P[4*ne+2],B=P[4*ne+3],k=R(S),H=R(I),G=R(N),V=B-252,D=k*k+H*H+G*G,K=Math.sqrt(Math.max(0,1-D)),U=void 0,V){case 0:U=[K,k,H,G];break;case 1:U=[k,K,H,G];break;case 2:U=[k,H,K,G];break;case 3:U=[k,H,G,K];break;default:throw new Error("Invalid quaternion mode")}f[32*ne+28+0]=127.5*U[0]+127.5,f[32*ne+28+1]=127.5*U[1]+127.5,f[32*ne+28+2]=127.5*U[2]+127.5,f[32*ne+28+3]=127.5*U[3]+127.5}if(!e.shN)return[3,2];for(j=[0,3,8,15],Y=e.shN.bands?j[e.shN.bands]:e.shN.shape[1]/3,W=t[5].bits,z=t[6].bits,Z=t[5].width,q=3*Y,X=Math.ceil(q/16),J=[],Q=n.getEngine(),$=Q.getCaps().maxTextureSize,ee=Math.ceil(a/$),fe=0;fe<X;fe++)te=new Uint8Array(ee*$*4*4),J.push(te);if(2===e.version){if(!e.shN.codebook)throw new Error("Missing codebook in SOG version 2 shN data.");for(ne=0;ne<a;ne++)for(re=z[4*ne+0]+(z[4*ne+1]<<8),oe=re%64*Y,ae=Math.floor(re/64),ue=0;ue<Y;ue++)for(le=0;le<3;le++)ce=3*ue+le,fe=Math.floor(ce/16),de=J[fe],he=ce%16,pe=16*ne,me=127.5*e.shN.codebook[W[4*(oe+ue)+le+ae*Z*4]]+127.5,de[he+pe]=Math.max(0,Math.min(255,me))}else for(ne=0;ne<a;ne++)for(re=z[4*ne+0]+(z[4*ne+1]<<8),oe=re%64*Y,ae=Math.floor(re/64),ie=e.shN.mins,se=e.shN.maxs,le=0;le<3;le++)for(ue=0;ue<Y/3;ue++)ce=3*ue+le,fe=Math.floor(ce/16),de=J[fe],he=ce%16,pe=16*ne,me=127.5*o.Scalar.Lerp(ie,se,W[4*(oe+ue)+le+ae*Z*4]/255)+127.5,de[he+pe]=Math.max(0,Math.min(255,me));return[4,new Promise((function(e){e({mode:0,data:s,hasVertexColors:!1,sh:J})}))];case 1:case 3:return[2,r.sent()];case 2:return[4,new Promise((function(e){e({mode:0,data:s,hasVertexColors:!1})}))]}}))}))}function u(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){var o,a,i,u,c,f=this;return(0,r.YH)(this,(function(d){switch(d.label){case 0:if(e instanceof Map){if(!(i=(a=e).get("meta.json")))throw new Error("meta.json not found in files Map");o=JSON.parse((new TextDecoder).decode(i))}else o=e;return u=(0,r.fX)((0,r.fX)((0,r.fX)((0,r.fX)([],o.means.files,!0),o.scales.files,!0),o.quats.files,!0),o.sh0.files,!0),o.shN&&u.push.apply(u,o.shN.files),[4,Promise.all(u.map((function(e){return(0,r.sH)(f,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a&&a.has(e)?[4,s(a.get(e),e,n.getEngine())]:[3,2];case 1:case 3:return[2,r.sent()];case 2:return[4,s(t,e,n.getEngine())]}}))}))})))];case 1:return c=d.sent(),[4,l(o,c,n)];case 2:return[2,d.sent()]}}))}))}var c=function(){function e(t){void 0===t&&(t=e._DefaultLoadingOptions),this.name=a.B.name,this._assetContainer=null,this.extensions=a.B.extensions,this._loadingOptions=t}return e.prototype.createPlugin=function(t){return new e(t[a.B.name])},e.prototype.importMeshAsync=function(e,t,n,o,a,i){return(0,r.sH)(this,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._parseAsync(e,t,n,o).then((function(e){return{meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}}))];case 1:return[2,r.sent()]}}))}))},e._BuildPointCloud=function(e,t){if(!t.byteLength)return!1;var n=new Uint8Array(t),r=new Float32Array(t),a=n.length/32;return e.addPoints(a,(function(e,t){var a=r[8*t+0],i=r[8*t+1],s=r[8*t+2];e.position=new o.Vector3(a,i,s);var l=n[32*t+24+0]/255,u=n[32*t+24+1]/255,c=n[32*t+24+2]/255;e.color=new o.Color4(l,u,c,1)})),!0},e._BuildMesh=function(e,t){for(var n=new o.Mesh("PLYMesh",e),r=new Uint8Array(t.data),a=new Float32Array(t.data),i=r.length/32,s=[],l=new o.VertexData,u=0;u<i;u++){var c=a[8*u+0],f=a[8*u+1],d=a[8*u+2];s.push(c,f,d)}if(t.hasVertexColors){var h=new Float32Array(4*i);for(u=0;u<i;u++){var p=r[32*u+24+0]/255,m=r[32*u+24+1]/255,_=r[32*u+24+2]/255;h[4*u+0]=p,h[4*u+1]=m,h[4*u+2]=_,h[4*u+3]=1}l.colors=h}return l.positions=s,l.indices=t.faces,l.applyToMesh(n),n},e.prototype._unzipWithFFlateAsync=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,n,a,i,s,l,u,c,f,d;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(t=this._loadingOptions.fflate)?[3,3]:void 0!==window.fflate?[3,2]:[4,o.Tools.LoadScriptAsync(null!==(d=this._loadingOptions.deflateURL)&&void 0!==d?d:"https://unpkg.com/fflate/umd/index.js")];case 1:r.sent(),r.label=2;case 2:t=window.fflate,r.label=3;case 3:for(n=t.unzipSync,a=n(e),i=new Map,s=0,l=Object.entries(a);s<l.length;s++)u=l[s],c=u[0],f=u[1],i.set(c,f);return[2,i]}}))}))},e.prototype._parseAsync=function(t,n,a,i){var s=this,l=[],c=function(e){var t;n._blockEntityCollection=!!s._assetContainer;var r=null!==(t=s._loadingOptions.gaussianSplattingMesh)&&void 0!==t?t:new o.GaussianSplattingMesh("GaussianSplatting",null,n,s._loadingOptions.keepInRam);r._parentContainer=s._assetContainer,l.push(r),r.updateData(e.data,e.sh,{flipY:!1}),r.scaling.y*=-1,r.computeWorldMatrix(!0),n._blockEntityCollection=!1};if("string"==typeof a){var f=JSON.parse(a);if(f&&f.means&&f.scales&&f.quats&&f.sh0)return new Promise((function(e){u(f,i,n).then((function(t){c(t),e(l)})).catch((function(){throw new Error("Failed to parse SOG data.")}))}))}var d=a instanceof ArrayBuffer?new Uint8Array(a):a;if(80===d[0]&&75===d[1])return new Promise((function(e){s._unzipWithFFlateAsync(d).then((function(t){u(t,i,n).then((function(t){c(t),e(l)})).catch((function(){throw new Error("Failed to parse SOG zip data.")}))}))}));var h=function(t){e._ConvertPLYToSplat(a).then((function(a){return(0,r.sH)(s,void 0,void 0,(function(){var i,s,u;return(0,r.YH)(this,(function(r){switch(r.label){case 0:switch(n._blockEntityCollection=!!this._assetContainer,a.mode){case 0:return[3,1];case 1:return[3,2];case 2:return[3,6]}return[3,7];case 1:switch((i=null!==(u=this._loadingOptions.gaussianSplattingMesh)&&void 0!==u?u:new o.GaussianSplattingMesh("GaussianSplatting",null,n,this._loadingOptions.keepInRam))._parentContainer=this._assetContainer,l.push(i),i.updateData(a.data,a.sh,{flipY:!1}),i.scaling.y*=-1,"RightHanded"===a.chirality&&(i.scaling.y*=-1),a.upAxis){case"X":i.rotation=new o.Vector3(0,0,Math.PI/2);break;case"Y":i.rotation=new o.Vector3(0,0,Math.PI);break;case"Z":i.rotation=new o.Vector3(-Math.PI/2,Math.PI,0)}return i.computeWorldMatrix(!0),[3,8];case 2:return s=new o.PointsCloudSystem("PointCloud",1,n),e._BuildPointCloud(s,a.data)?[4,s.buildMeshAsync().then((function(e){l.push(e)}))]:[3,4];case 3:return r.sent(),[3,5];case 4:s.dispose(),r.label=5;case 5:return[3,8];case 6:if(!a.faces)throw new Error("PLY mesh doesn't contain face informations.");return l.push(e._BuildMesh(n,a)),[3,8];case 7:throw new Error("Unsupported Splat mode");case 8:return n._blockEntityCollection=!1,this.applyAutoCameraLimits(a,n),t(l),[2]}}))}))}))};if(31!==d[0]||139!==d[1])return new Promise((function(e){h(e)}));var p=new ReadableStream({start:function(e){e.enqueue(new Uint8Array(a)),e.close()}}),m=new DecompressionStream("gzip"),_=p.pipeThrough(m);return new Promise((function(e){new Response(_).arrayBuffer().then((function(t){(function(e,t){var n=new Uint8Array(e),r=new Uint32Array(e.slice(0,12)),a=r[2],i=n[12],s=n[13],l=n[14],u=n[15],c=r[1];if(u||1347635022!=r[0]||2!=c&&3!=c)return new Promise((function(e){e({mode:3,data:f,hasVertexColors:!1})}));for(var f=new ArrayBuffer(32*a),d=1/(1<<s),h=new Int32Array(1),p=new Uint8Array(h.buffer),m=function(e,t){return p[0]=e[t+0],p[1]=e[t+1],p[2]=e[t+2],p[3]=128&e[t+2]?255:0,h[0]*d},_=16,g=new Float32Array(f),b=new Float32Array(f),y=new Uint8ClampedArray(f),v=new Uint8ClampedArray(f),T=0;T<a;T++)g[8*T+0]=m(n,_+0),g[8*T+1]=m(n,_+3),g[8*T+2]=m(n,_+6),_+=9;for(T=0;T<a;T++){for(var x=0;x<3;x++){var A=(n[_+a+3*T+x]-127.5)/38.25;y[32*T+24+x]=o.Scalar.Clamp(255*(.5+.282*A),0,255)}y[32*T+24+3]=n[_+T]}for(_+=4*a,T=0;T<a;T++)b[8*T+3+0]=Math.exp(n[_+0]/16-10),b[8*T+3+1]=Math.exp(n[_+1]/16-10),b[8*T+3+2]=Math.exp(n[_+2]/16-10),_+=3;if(c>=3){var w=Math.SQRT1_2;for(T=0;T<a;T++){for(var O=[n[_+0],n[_+1],n[_+2],n[_+3]],C=O[0]+(O[1]<<8)+(O[2]<<16)+(O[3]<<24),M=[],E=C>>>30,L=C,F=0,R=3;R>=0;--R)if(R!==E){var P=511&L,S=L>>>9&1;L>>>=10,M[R]=w*(P/511),1===S&&(M[R]=-M[R]),F+=M[R]*M[R]}var I=1-F;M[E]=Math.sqrt(Math.max(I,0));for(var N=[3,0,1,2],B=0;B<4;B++)v[32*T+28+B]=Math.round(127.5+127.5*M[N[B]]);_+=4}}else for(T=0;T<a;T++){var k=n[_+0],H=n[_+1],G=n[_+2],V=k/127.5-1,D=H/127.5-1,K=G/127.5-1;v[32*T+28+1]=k,v[32*T+28+2]=H,v[32*T+28+3]=G;var U=1-(V*V+D*D+K*K);v[32*T+28+0]=127.5+127.5*Math.sqrt(U<0?0:U),_+=3}if(i){for(var j=3*((i+1)*(i+1)-1),Y=Math.ceil(j/16),W=_,z=[],Z=t.getEngine().getCaps().maxTextureSize,q=Math.ceil(a/Z),X=0;X<Y;X++){var J=new Uint8Array(q*Z*4*4);z.push(J)}for(T=0;T<a;T++)for(var Q=0;Q<j;Q++){var $=n[W++];X=Math.floor(Q/16),z[X][Q%16+16*T]=$}return new Promise((function(e){e({mode:0,data:f,hasVertexColors:!1,sh:z,trainedWithAntialiasing:!!l})}))}return new Promise((function(e){e({mode:0,data:f,hasVertexColors:!1,trainedWithAntialiasing:!!l})}))})(t,n,s._loadingOptions).then((function(t){var r;n._blockEntityCollection=!!s._assetContainer;var a=null!==(r=s._loadingOptions.gaussianSplattingMesh)&&void 0!==r?r:new o.GaussianSplattingMesh("GaussianSplatting",null,n,s._loadingOptions.keepInRam);if(t.trainedWithAntialiasing){var i=a.material;i.kernelSize=.1,i.compensation=!0}a._parentContainer=s._assetContainer,l.push(a),a.updateData(t.data,t.sh,{flipY:!1}),s._loadingOptions.flipY||(a.scaling.y*=-1,a.computeWorldMatrix(!0)),n._blockEntityCollection=!1,s.applyAutoCameraLimits(t,n),e(l)}))})).catch((function(){h(e)}))}))},e.prototype.applyAutoCameraLimits=function(e,t){var n;if(!this._loadingOptions.disableAutoCameraLimits&&(void 0!==e.safeOrbitCameraRadiusMin||void 0!==e.safeOrbitCameraElevationMinMax)&&"ArcRotateCamera"===(null===(n=t.activeCamera)||void 0===n?void 0:n.getClassName())){var r=t.activeCamera;e.safeOrbitCameraElevationMinMax&&(r.lowerBetaLimit=.5*Math.PI-e.safeOrbitCameraElevationMinMax[1],r.upperBetaLimit=.5*Math.PI-e.safeOrbitCameraElevationMinMax[0]),e.safeOrbitCameraRadiusMin&&(r.lowerRadiusLimit=e.safeOrbitCameraRadiusMin)}},e.prototype.loadAssetContainerAsync=function(e,t,n){var r=this,a=new o.AssetContainer(e);return this._assetContainer=a,this.importMeshAsync(null,e,t,n).then((function(e){for(var t=0,n=e.meshes;t<n.length;t++){var o=n[t];a.meshes.push(o)}return r._assetContainer=null,a})).catch((function(e){throw r._assetContainer=null,e}))},e.prototype.loadAsync=function(e,t,n){return this.importMeshAsync(null,e,t,n).then((function(){}))},e._ConvertPLYToSplat=function(e){var t=this,n=new Uint8Array(e),a=(new TextDecoder).decode(n.slice(0,10240)),i=a.indexOf("end_header\n");if(i<0||!a)return new Promise((function(t){t({mode:0,data:e,rawSplat:!0})}));var s=parseInt(/element vertex (\d+)\n/.exec(a)[1]),l=/element face (\d+)\n/.exec(a),u=0;l&&(u=parseInt(l[1]));var c=/element chunk (\d+)\n/.exec(a),f=0;c&&(f=parseInt(c[1]));for(var d=0,h=0,p={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0},m=1,_=[],g=[],b=a.slice(0,i).split("\n"),y={},v=0,T=b;v<T.length;v++){var x=T[v];if(x.startsWith("property ")){var A=x.split(" "),w=A[1],O=A[2];if(1==m)g.push({name:O,type:w,offset:h}),h+=p[w];else if(0==m)_.push({name:O,type:w,offset:d}),d+=p[w];else if(2==m)_.push({name:O,type:w,offset:d});else if(3==m){var C=new DataView(e,h,2*p.float);y.safeOrbitCameraElevationMinMax=[C.getFloat32(0,!0),C.getFloat32(4,!0)]}else 4==m?(C=new DataView(e,h,p.float),y.safeOrbitCameraRadiusMin=C.getFloat32(0,!0)):5==m&&(C=new DataView(e,h,p.uchar),"up_axis"==O?y.upAxis=0==C.getUint8(0)?"X":1==C.getUint8(0)?"Y":"Z":"chirality"==O&&(y.chirality=0==C.getUint8(0)?"LeftHanded":"RightHanded"));p[w]||o.Logger.Warn("Unsupported property type: ".concat(w,"."))}else x.startsWith("element ")&&("chunk"==(w=x.split(" ")[1])?m=1:"vertex"==w?m=0:"sh"==w?m=2:"safe_orbit_camera_elevation_min_max_radians"==w?m=3:"safe_orbit_camera_radius_min"==w?m=4:"up_axis"!=w&&"chirality"!=w||(m=5))}var M=d,E=h;return o.GaussianSplattingMesh.ConvertPLYWithSHToSplatAsync(e).then((function(n){return(0,r.sH)(t,void 0,void 0,(function(){var t,o,a,l,c,d,h,p,m,g,b,v,T,x,A;return(0,r.YH)(this,(function(w){switch(w.label){case 0:if(t=new DataView(e,i+11),o=E*f+M*s,a=[],u)for(l=0;l<u;l++)if(3==(c=t.getUint8(o))){for(o+=1,d=0;d<c;d++)h=t.getUint32(o+4*(2-d),!0),a.push(h);o+=12}return f?[4,new Promise((function(e){e({mode:0,data:n.buffer,sh:n.sh,faces:a,hasVertexColors:!1,compressed:!0,rawSplat:!1})}))]:[3,2];case 1:case 3:return[2,w.sent()];case 2:for(p=0,m=0,g=["x","y","z","scale_0","scale_1","scale_2","opacity","rot_0","rot_1","rot_2","rot_3"],b=["red","green","blue","f_dc_0","f_dc_1","f_dc_2"],v=0;v<_.length;v++)T=_[v],g.includes(T.name)&&p++,b.includes(T.name)&&m++;return x=p==g.length&&3==m,A=u?2:x?0:1,[4,new Promise((function(e){e((0,r.Cl)((0,r.Cl)({},y),{mode:A,data:n.buffer,sh:n.sh,faces:a,hasVertexColors:!!m,compressed:!1,rawSplat:!1}))}))]}}))}))}))},e._DefaultLoadingOptions={keepInRam:!1,flipY:!1},e}();(0,o.RegisterSceneLoaderPlugin)(new c)},3291(e,t,n){n.d(t,{W:()=>r});var r={name:"stl",extensions:{".stl":{isBinary:!0}}}},7122(e,t,n){n.r(t),n.d(t,{STLFileLoader:()=>a});var r=n(5597),o=n(3291),a=function(){function e(){this.solidPattern=/solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g,this.facetsPattern=/facet([\s\S]*?)endfacet/g,this.normalPattern=/normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.vertexPattern=/vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.name=o.W.name,this.extensions=o.W.extensions}return e.prototype.importMesh=function(e,t,n,o,a){var i;if("string"!=typeof n){if(this._isBinary(n)){var s=new r.Mesh("stlmesh",t);return this._parseBinary(s,n),a&&a.push(s),!0}n=(new TextDecoder).decode(new Uint8Array(n))}for(;i=this.solidPattern.exec(n);){var l=i[1],u=i[3];if(u&&l!=u)return r.Tools.Error("Error in STL, solid name != endsolid name"),!1;if(e&&l)if(e instanceof Array){if(!e.indexOf(l))continue}else if(l!==e)continue;l=l||"stlmesh",s=new r.Mesh(l,t),this._parseASCII(s,i[2]),a&&a.push(s)}return!0},e.prototype.load=function(e,t,n){return this.importMesh(null,e,t,n,null)},e.prototype.loadAssetContainer=function(e,t,n){var o=new r.AssetContainer(e);return e._blockEntityCollection=!0,this.importMesh(null,e,t,n,o.meshes),e._blockEntityCollection=!1,o},e.prototype._isBinary=function(e){var t=new DataView(e);if(t.byteLength<=80)return!1;if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var n=[115,111,108,105,100],r=0;r<5;r++)if(t.getUint8(r)!==n[r])return!0;return!1},e.prototype._parseBinary=function(t,n){for(var o=new DataView(n),a=o.getUint32(80,!0),i=0,s=new Float32Array(3*a*3),l=new Float32Array(3*a*3),u=new Uint32Array(3*a),c=0,f=0;f<a;f++){for(var d=84+50*f,h=o.getFloat32(d,!0),p=o.getFloat32(d+4,!0),m=o.getFloat32(d+8,!0),_=1;_<=3;_++){var g=d+12*_;s[i]=o.getFloat32(g,!0),l[i]=h,e.DO_NOT_ALTER_FILE_COORDINATES?(s[i+1]=o.getFloat32(g+4,!0),s[i+2]=o.getFloat32(g+8,!0),l[i+1]=p,l[i+2]=m):(s[i+2]=o.getFloat32(g+4,!0),s[i+1]=o.getFloat32(g+8,!0),l[i+2]=p,l[i+1]=m),i+=3}e.DO_NOT_ALTER_FILE_COORDINATES?(u[c]=c,u[c+1]=c+2,u[c+2]=c+1,c+=3):(u[c]=c++,u[c]=c++,u[c]=c++)}t.setVerticesData(r.VertexBuffer.PositionKind,s),t.setVerticesData(r.VertexBuffer.NormalKind,l),t.setIndices(u),t.computeWorldMatrix(!0)},e.prototype._parseASCII=function(t,n){for(var o,a=[],i=[],s=[],l=0;o=this.facetsPattern.exec(n);){var u=o[1],c=this.normalPattern.exec(u);if(this.normalPattern.lastIndex=0,c){for(var f=[Number(c[1]),Number(c[5]),Number(c[3])],d=void 0;d=this.vertexPattern.exec(u);)e.DO_NOT_ALTER_FILE_COORDINATES?(a.push(Number(d[1]),Number(d[3]),Number(d[5])),i.push(f[0],f[2],f[1])):(a.push(Number(d[1]),Number(d[5]),Number(d[3])),i.push(f[0],f[1],f[2]));e.DO_NOT_ALTER_FILE_COORDINATES?(s.push(l,l+2,l+1),l+=3):s.push(l++,l++,l++),this.vertexPattern.lastIndex=0}}this.facetsPattern.lastIndex=0,t.setVerticesData(r.VertexBuffer.PositionKind,a),t.setVerticesData(r.VertexBuffer.NormalKind,i),t.setIndices(s),t.computeWorldMatrix(!0)},e.DO_NOT_ALTER_FILE_COORDINATES=!1,e}();(0,r.RegisterSceneLoaderPlugin)(new a)},2493(e,t,n){n.r(t),n.d(t,{EXT_lights_area:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_lights_area",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,a.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,[4,this._loader.loadNodeAsync(e,t,(function(e){var t,r,u=a.ArrayItem.Get(s,i._lights,l.light),c=u.name||e.name;i._loader.babylonScene._blockEntityCollection=!!i._loader._assetContainer;var f=void 0!==u.size?u.size:1;switch(u.type){case"rect":var d=void 0!==(null===(t=u.rect)||void 0===t?void 0:t.aspect)?u.rect.aspect*f:f,h=f;r=new o.RectAreaLight(c,o.Vector3.Zero(),d,h,i._loader.babylonScene);break;case"disk":var p=Math.sqrt(f*f*.25*Math.PI);r=new o.RectAreaLight(c,o.Vector3.Zero(),p,p,i._loader.babylonScene);break;default:throw i._loader.babylonScene._blockEntityCollection=!1,new Error("".concat(s,": Invalid area light type (").concat(u.type,")"))}r._parentContainer=i._loader._assetContainer,i._loader.babylonScene._blockEntityCollection=!1,u._babylonLight=r,r.falloffType=o.Light.FALLOFF_GLTF,r.diffuse=u.color?o.Color3.FromArray(u.color):o.Color3.White(),r.intensity=null==u.intensity?1:u.intensity;var m=new o.TransformNode("".concat(c,"_orientation"),i._loader.babylonScene);m.rotationQuaternion=o.Quaternion.RotationAxis(o.Vector3.Up(),Math.PI),m.parent=e,r.parent=m,i._loader._babylonLights.push(r),a.GLTFLoader.AddPointerMetadata(r,s),n(e)}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},4393(e,t,n){n.r(t),n.d(t,{EXT_lights_ies:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_lights_ies",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,a.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i,u,c,f,d,h=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,[4,this._loader.loadNodeAsync(e,t,(function(e){var t=(u=a.ArrayItem.Get(s,h._lights,l.light)).name||e.name;h._loader.babylonScene._blockEntityCollection=!!h._loader._assetContainer,(i=new o.SpotLight(t,o.Vector3.Zero(),o.Vector3.Backward(),0,1,h._loader.babylonScene)).angle=Math.PI/2,i.innerAngle=0,i._parentContainer=h._loader._assetContainer,h._loader.babylonScene._blockEntityCollection=!1,u._babylonLight=i,i.falloffType=o.Light.FALLOFF_GLTF,i.diffuse=l.color?o.Color3.FromArray(l.color):o.Color3.White(),i.intensity=l.multiplier||1,i.range=Number.MAX_VALUE,i.parent=e,h._loader._babylonLights.push(i),a.GLTFLoader.AddPointerMetadata(i,s),n(e)}))];case 1:return c=r.sent(),u.uri?[4,this._loader.loadUriAsync(e,u,u.uri)]:[3,3];case 2:return f=r.sent(),[3,5];case 3:return d=a.ArrayItem.Get("".concat(e,"/bufferView"),this._loader.gltf.bufferViews,u.bufferView),[4,this._loader.loadBufferViewAsync("/bufferViews/".concat(d.index),d)];case 4:f=r.sent(),r.label=5;case 5:return i.iesProfileTexture=new o.Texture(name+"_iesProfile",this._loader.babylonScene,!0,!1,void 0,null,null,f,!0,void 0,void 0,void 0,void 0,".ies"),[2,c]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3251(e,t,n){n.r(t),n.d(t,{EXT_lights_image_based:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_lights_image_based",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights}},e.prototype.loadSceneAsync=function(e,t){var n=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(n,void 0,void 0,(function(){var n,s,l=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,(n=new Array).push(this._loader.loadSceneAsync(e,t)),this._loader.logOpen("".concat(o)),s=a.ArrayItem.Get("".concat(o,"/light"),this._lights,i.light),n.push(this._loadLightAsync("/extensions/".concat(this.name,"/lights/").concat(i.light),s).then((function(e){l._loader.babylonScene.environmentTexture=e}))),this._loader.logClose(),[4,Promise.all(n).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadLightAsync=function(e,t){var n=this;if(!t._loaded){var i=new Array;this._loader.logOpen("".concat(e));for(var s=new Array(t.specularImages.length),l=function(n){var r=t.specularImages[n];s[n]=new Array(r.length);for(var o=function(t){var o="".concat(e,"/specularImages/").concat(n,"/").concat(t);u._loader.logOpen("".concat(o));var l=r[t],c=a.ArrayItem.Get(o,u._loader.gltf.images,l);i.push(u._loader.loadImageAsync("/images/".concat(l),c).then((function(e){s[n][t]=e}))),u._loader.logClose()},l=0;l<r.length;l++)o(l)},u=this,c=0;c<t.specularImages.length;c++)l(c);this._loader.logClose(),t._loaded=Promise.all(i).then((function(){return(0,r.sH)(n,void 0,void 0,(function(){var n,a,i,l,u;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if((n=new o.RawCubeTexture(this._loader.babylonScene,null,t.specularImageSize)).name=t.name||"environment",t._babylonTexture=n,null!=t.intensity&&(n.level=t.intensity),t.rotation&&(a=o.Quaternion.FromArray(t.rotation),this._loader.babylonScene.useRightHandedSystem||(a=o.Quaternion.Inverse(a)),o.Matrix.FromQuaternionToRef(a,n.getReflectionTextureMatrix())),!t.irradianceCoefficients)throw new Error("".concat(e,": Irradiance coefficients are missing"));return(i=o.SphericalHarmonics.FromArray(t.irradianceCoefficients)).scaleInPlace(t.intensity),i.convertIrradianceToLambertianRadiance(),l=o.SphericalPolynomial.FromHarmonics(i),u=(s.length-1)/Math.log2(t.specularImageSize),[4,n.updateRGBDAsync(s,l,u)];case 1:return[2,r.sent()]}}))}))}))}return t._loaded.then((function(){return t._babylonTexture}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},9499(e,t,n){n.r(t),n.d(t,{EXT_mesh_gpu_instancing:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_mesh_gpu_instancing",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,s){return(0,r.sH)(i,void 0,void 0,(function(){var i,l,u,c,f=this;return(0,r.YH)(this,(function(d){switch(d.label){case 0:return this._loader._disableInstancedMesh++,i=this._loader.loadNodeAsync("/nodes/".concat(t.index),t,n),this._loader._disableInstancedMesh--,t._primitiveBabylonMeshes?[3,2]:[4,i];case 1:case 3:return[2,d.sent()];case 2:return l=new Array,u=0,(c=function(t){if(null!=s.attributes[t]){var n=a.ArrayItem.Get("".concat(e,"/attributes/").concat(t),f._loader.gltf.accessors,s.attributes[t]);if(l.push(f._loader._loadFloatAccessorAsync("/accessors/".concat(n.bufferView),n)),0===u)u=n.count;else if(u!==n.count)throw new Error("".concat(e,"/attributes: Instance buffer accessors do not have the same count."))}else l.push(Promise.resolve(null))})("TRANSLATION"),c("ROTATION"),c("SCALE"),c("_COLOR_0"),[4,i.then((function(e){return(0,r.sH)(f,void 0,void 0,(function(){var n,a,i,s,c,f,d,h,p,m;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,Promise.all(l)];case 1:for(n=r.sent(),a=n[0],i=n[1],s=n[2],c=n[3],f=new Float32Array(16*u),o.TmpVectors.Vector3[0].copyFromFloats(0,0,0),o.TmpVectors.Quaternion[0].copyFromFloats(0,0,0,1),o.TmpVectors.Vector3[1].copyFromFloats(1,1,1),d=0;d<u;++d)a&&o.Vector3.FromArrayToRef(a,3*d,o.TmpVectors.Vector3[0]),i&&o.Quaternion.FromArrayToRef(i,4*d,o.TmpVectors.Quaternion[0]),s&&o.Vector3.FromArrayToRef(s,3*d,o.TmpVectors.Vector3[1]),o.Matrix.ComposeToRef(o.TmpVectors.Vector3[1],o.TmpVectors.Quaternion[0],o.TmpVectors.Vector3[0],o.TmpVectors.Matrix[0]),o.TmpVectors.Matrix[0].copyToArray(f,16*d);for(h=0,p=t._primitiveBabylonMeshes;h<p.length;h++)(m=p[h]).thinInstanceSetBuffer("matrix",f,16,!0),c&&(c.length===3*u?m.thinInstanceSetBuffer("color",c,3,!0):c.length===4*u?m.thinInstanceSetBuffer("color",c,4,!0):o.Logger.Warn("Unexpected size of _COLOR_0 attribute for mesh "+m.name));return[2,e]}}))}))}))]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5549(e,t,n){n.r(t),n.d(t,{EXT_meshopt_compression:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="EXT_meshopt_compression",l=function(){function e(e){this.name=s,this.enabled=e.isExtensionUsed(s),this._loader=e}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadBufferViewAsync=function(e,t){var n=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(n,void 0,void 0,(function(){var n,i,l=this;return(0,r.YH)(this,(function(u){switch(u.label){case 0:return(n=t)._meshOptData?[4,n._meshOptData]:[3,2];case 1:case 3:return[2,u.sent()];case 2:return i=o.ArrayItem.Get("".concat(e,"/buffer"),this._loader.gltf.buffers,s.buffer),n._meshOptData=this._loader.loadBufferAsync("/buffers/".concat(i.index),i,s.byteOffset||0,s.byteLength).then((function(e){return(0,r.sH)(l,void 0,void 0,(function(){return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,a.MeshoptCompression.Default.decodeGltfBufferAsync(e,s.count,s.byteStride,s.mode,s.filter)];case 1:return[2,t.sent()]}}))}))})),[4,n._meshOptData]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},6416(e,t,n){n.r(t),n.d(t,{EXT_texture_avif:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="EXT_texture_avif",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(a,void 0,void 0,(function(){var a,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a=null==t.sampler?o.GLTFLoader.DefaultSampler:o.ArrayItem.Get("".concat(e,"/sampler"),this._loader.gltf.samplers,t.sampler),l=o.ArrayItem.Get("".concat(i,"/source"),this._loader.gltf.images,s.source),[4,this._loader._createTextureAsync(e,a,l,(function(e){n(e)}),void 0,!t._textureInfo.nonColorData)];case 1:return[2,r.sent()]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},10(e,t,n){n.r(t),n.d(t,{EXT_texture_webp:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="EXT_texture_webp",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(a,void 0,void 0,(function(){var a,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a=null==t.sampler?o.GLTFLoader.DefaultSampler:o.ArrayItem.Get("".concat(e,"/sampler"),this._loader.gltf.samplers,t.sampler),l=o.ArrayItem.Get("".concat(i,"/source"),this._loader.gltf.images,s.source),[4,this._loader._createTextureAsync(e,a,l,(function(e){n(e)}),void 0,!t._textureInfo.nonColorData)];case 1:return[2,r.sent()]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},4158(e,t,n){n.r(t),n.d(t,{ExtrasAsMetadata:()=>a});var r=n(4015),o="ExtrasAsMetadata",a=function(){function e(e){this.name=o,this.enabled=!0,this._loader=e}return e.prototype._assignExtras=function(e,t){if(t.extras&&Object.keys(t.extras).length>0){var n=e.metadata=e.metadata||{};(n.gltf=n.gltf||{}).extras=t.extras}},e.prototype.dispose=function(){this._loader=null},e.prototype.loadNodeAsync=function(e,t,n){var r=this;return this._loader.loadNodeAsync(e,t,(function(e){r._assignExtras(e,t),n(e)}))},e.prototype.loadCameraAsync=function(e,t,n){var r=this;return this._loader.loadCameraAsync(e,t,(function(e){r._assignExtras(e,t),n(e)}))},e.prototype.createMaterial=function(e,t,n){var r=this._loader.createMaterial(e,t,n);return this._assignExtras(r,t),r},e.prototype.loadAnimationAsync=function(e,t){var n=this;return this._loader.loadAnimationAsync(e,t).then((function(e){return n._assignExtras(e,t),e}))},e}();(0,r.Hg)(o),(0,r.Ye)(o,!1,(function(e){return new a(e)}))},9334(e,t,n){var r=n(8322),o=n(5597),a=n(2727),i=n(8698);function s(e,t,n,r){return o.Color3.FromArray(t,n).scale(r)}function l(e,t,n,r){return t[n]*r}function u(e,t,n,r){return-t[n]*r}function c(e,t,n,r){return t[n+1]*r}function f(e,t,n,r){return t[n]*r*2}function d(e){return{scale:[new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".uScale"),l,(function(){return 2})),new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".vScale"),c,(function(){return 2}))],offset:[new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".uOffset"),l,(function(){return 2})),new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".vOffset"),c,(function(){return 2}))],rotation:[new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".wAng"),u,(function(){return 1}))]}}var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){return[{babylonAnimatable:e._babylonCamera,babylonAnimation:this._buildAnimation(t,n,r)}]},t}(a.AnimationPropertyInfo),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var o=[];for(var a in e._data)o.push({babylonAnimatable:e._data[a].babylonMaterial,babylonAnimation:this._buildAnimation(t,n,r)});return o},t}(a.AnimationPropertyInfo),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){return[{babylonAnimatable:e._babylonLight,babylonAnimation:this._buildAnimation(t,n,r)}]},t}(a.AnimationPropertyInfo),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var o=this;return e._primitiveBabylonMeshes?e._primitiveBabylonMeshes.map((function(e){return{babylonAnimatable:e,babylonAnimation:o._buildAnimation(t,n,r)}})):[]},t}(a.AnimationPropertyInfo);(0,i.ZU)("/cameras/{}/orthographic/xmag",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoLeft",u,(function(){return 1})),new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoRight",c,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/orthographic/ymag",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoBottom",u,(function(){return 1})),new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoTop",c,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/orthographic/zfar",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"maxZ",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/orthographic/znear",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"minZ",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/perspective/yfov",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"fov",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/perspective/zfar",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"maxZ",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/perspective/znear",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"minZ",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"albedoColor",s,(function(){return 4})),new p(o.Animation.ANIMATIONTYPE_FLOAT,"alpha",(function(e,t,n,r){return t[n+3]*r}),(function(){return 4}))]),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/metallicFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"metallic",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/metallicFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"roughness",l,(function(){return 1}))]);var g=d("albedoTexture");(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale",g.scale),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset",g.offset),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation",g.rotation);var b=d("metallicTexture");(0,i.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/scale",b.scale),(0,i.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/offset",b.offset),(0,i.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/rotation",b.rotation),(0,i.ZU)("/materials/{}/emissiveFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"emissiveColor",s,(function(){return 3}))]);var y=d("bumpTexture");(0,i.ZU)("/materials/{}/normalTexture/scale",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"bumpTexture.level",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/scale",y.scale),(0,i.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/offset",y.offset),(0,i.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/rotation",y.rotation),(0,i.ZU)("/materials/{}/occlusionTexture/strength",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",l,(function(){return 1}))]);var v=d("ambientTexture");(0,i.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/scale",v.scale),(0,i.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/offset",v.offset),(0,i.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/rotation",v.rotation);var T=d("emissiveTexture");(0,i.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/scale",T.scale),(0,i.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/offset",T.offset),(0,i.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/rotation",T.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyStrength",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyRotation",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"anisotropy.angle",l,(function(){return 1}))]);var x=d("anisotropy.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/scale",x.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/offset",x.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/rotation",x.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",l,(function(){return 1}))]);var A=d("clearCoat.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/scale",A.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/offset",A.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/rotation",A.rotation);var w=d("clearCoat.bumpTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/scale",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale",w.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset",w.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation",w.rotation);var O=d("clearCoat.textureRoughness");(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/scale",O.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/offset",O.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/rotation",O.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_dispersion/dispersionFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_emissive_strength/emissiveStrength",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"emissiveIntensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_ior/ior",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"indexOfRefraction",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.intensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceIor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMinimum",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMaximum",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",l,(function(){return 1}))]);var C=d("iridescence.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/scale",C.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/offset",C.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/rotation",C.rotation);var M=d("iridescence.thicknessTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/scale",M.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/offset",M.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/rotation",M.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"sheen.color",s,(function(){return 3}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"sheen.roughness",l,(function(){return 1}))]);var E=d("sheen.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/scale",E.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/offset",E.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/rotation",E.rotation);var L=d("sheen.textureRoughness");(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/scale",L.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/offset",L.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/rotation",L.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"metallicF0Factor",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",s,(function(){return 3}))]);var F=d("metallicReflectanceTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/scale",F.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/offset",F.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/rotation",F.rotation);var R=d("reflectanceTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/scale",R.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/offset",R.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/rotation",R.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",l,(function(){return 1}))]);var P=d("subSurface.refractionIntensityTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/scale",P.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/offset",P.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/rotation",P.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/attenuationColor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",s,(function(){return 3}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/attenuationDistance",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",l,(function(){return 1}))]);var S=d("subSurface.thicknessTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/scale",S.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/offset",S.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/rotation",S.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",l,(function(){return 1}))]);var I=d("subSurface.translucencyIntensityTexture");(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/scale",I.scale),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/offset",I.offset),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/rotation",I.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",s,(function(){return 3}))]);var N=d("subSurface.translucencyColorTexture");(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/scale",N.scale),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/offset",N.offset),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/rotation",N.rotation),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/color",[new m(o.Animation.ANIMATIONTYPE_COLOR3,"diffuse",s,(function(){return 3}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/intensity",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"intensity",l,(function(){return 1}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/range",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"range",l,(function(){return 1}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/spot/innerConeAngle",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"innerAngle",f,(function(){return 1}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/spot/outerConeAngle",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"angle",f,(function(){return 1}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/color",[new m(o.Animation.ANIMATIONTYPE_COLOR3,"diffuse",s,(function(){return 3}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/intensity",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"intensity",l,(function(){return 1}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/size",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"radius",l,(function(){return 1}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/rect/aspect",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"radius",l,(function(){return 1}))]),(0,i.ZU)("/nodes/{}/extensions/EXT_lights_ies/color",[new m(o.Animation.ANIMATIONTYPE_COLOR3,"diffuse",s,(function(){return 3}))]),(0,i.ZU)("/nodes/{}/extensions/EXT_lights_ies/multiplier",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"intensity",l,(function(){return 1}))]),(0,i.ZU)("/nodes/{}/extensions/KHR_node_visibility/visible",[new _(o.Animation.ANIMATIONTYPE_FLOAT,"isVisible",l,(function(){return 1}))])},5898(e,t,n){n.r(t),n.d(t,{KHR_animation_pointer:()=>s});var r=n(5597),o=n(4015),a=n(8698),i=(n(9334),"KHR_animation_pointer"),s=function(){function e(e){this.name=i,this._loader=e,this._pathToObjectConverter=(0,a.Wt)(this._loader.gltf)}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._loader.isExtensionUsed(i)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._loader=null,delete this._pathToObjectConverter},e.prototype._loadAnimationChannelAsync=function(e,t,n,o,a){var i,s=null===(i=o.target.extensions)||void 0===i?void 0:i.KHR_animation_pointer;if(!s||!this._pathToObjectConverter)return null;"pointer"!==o.target.path&&r.Logger.Warn("".concat(e,"/target/path: Value (").concat(o.target.path,") must be (").concat("pointer",") when using the ").concat(this.name," extension")),null!=o.target.node&&r.Logger.Warn("".concat(e,"/target/node: Value (").concat(o.target.node,") must not be present when using the ").concat(this.name," extension"));var l="".concat(e,"/extensions/").concat(this.name),u=s.pointer;if(!u)throw new Error("".concat(l,": Pointer is missing"));try{var c=this._pathToObjectConverter.convert(u);if(!c.info.interpolation)throw new Error("".concat(l,"/pointer: Interpolation is missing"));return this._loader._loadAnimationChannelFromTargetInfoAsync(e,t,n,o,{object:c.object,info:c.info.interpolation},a)}catch(e){return r.Logger.Warn("".concat(l,"/pointer: Invalid pointer (").concat(u,") skipped")),null}},e}();(0,o.Hg)(i),(0,o.Ye)(i,!0,(function(e){return new s(e)}))},6396(e,t,n){n.r(t),n.d(t,{KHR_draco_mesh_compression:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_draco_mesh_compression",l=function(){function e(e){this.name=s,this.useNormalizedFlagFromAccessor=!0,this._loader=e,this.enabled=o.DracoDecoder.DefaultAvailable&&this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){delete this.dracoDecoder,this._loader=null},e.prototype._loadVertexDataAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i,u,c,f,d=this;return(0,r.YH)(this,(function(h){switch(h.label){case 0:if(null!=t.mode&&4!==t.mode&&5!==t.mode)throw new Error("".concat(e,": Unsupported mode ").concat(t.mode));return i={},u={},(c=function(e,r){var o=l.attributes[e];if(null!=o&&(n._delayInfo=n._delayInfo||[],-1===n._delayInfo.indexOf(r)&&n._delayInfo.push(r),i[r]=o,d.useNormalizedFlagFromAccessor)){var s=a.ArrayItem.TryGet(d._loader.gltf.accessors,t.attributes[e]);s&&(u[r]=s.normalized||!1)}})("POSITION",o.VertexBuffer.PositionKind),c("NORMAL",o.VertexBuffer.NormalKind),c("TANGENT",o.VertexBuffer.TangentKind),c("TEXCOORD_0",o.VertexBuffer.UVKind),c("TEXCOORD_1",o.VertexBuffer.UV2Kind),c("TEXCOORD_2",o.VertexBuffer.UV3Kind),c("TEXCOORD_3",o.VertexBuffer.UV4Kind),c("TEXCOORD_4",o.VertexBuffer.UV5Kind),c("TEXCOORD_5",o.VertexBuffer.UV6Kind),c("JOINTS_0",o.VertexBuffer.MatricesIndicesKind),c("WEIGHTS_0",o.VertexBuffer.MatricesWeightsKind),c("COLOR_0",o.VertexBuffer.ColorKind),(f=a.ArrayItem.Get(s,this._loader.gltf.bufferViews,l.bufferView))._dracoBabylonGeometry||(f._dracoBabylonGeometry=this._loader.loadBufferViewAsync("/bufferViews/".concat(f.index),f).then((function(s){return(0,r.sH)(d,void 0,void 0,(function(){var l,c,f;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return l=this.dracoDecoder||o.DracoDecoder.Default,c=a.ArrayItem.TryGet(this._loader.gltf.accessors,t.attributes.POSITION),f=this._loader.parent.alwaysComputeBoundingBox||n.skeleton||!c?null:(0,a.LoadBoundingInfoFromPositionAccessor)(c),[4,l._decodeMeshToGeometryForGltfAsync(n.name,this._loader.babylonScene,s,i,u,f).catch((function(t){throw new Error("".concat(e,": ").concat(t.message))}))];case 1:return[2,r.sent()]}}))}))}))),[4,f._dracoBabylonGeometry];case 1:return[2,h.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3757(e,t,n){n.r(t),n.d(t,{KHR_interactivity:()=>u,_AddInteractivityObjectModel:()=>c});var r=n(8322),o=n(5597),a=n(4015),i=n(8698),s=n(9222),l="KHR_interactivity",u=function(){function e(e){this._loader=e,this.name=l,this.enabled=this._loader.isExtensionUsed(l),this._pathConverter=(0,i.Wt)(this._loader.gltf),e._skipStartAnimationStep=!0;var t=e.babylonScene;t&&c(t)}return e.prototype.dispose=function(){this._loader=null,delete this._pathConverter},e.prototype.onReady=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e,t,n,a,i,l=this;return(0,r.YH)(this,(function(u){switch(u.label){case 0:return this._loader.babylonScene&&this._pathConverter?(e=this._loader.babylonScene,(t=null===(i=this._loader.gltf.extensions)||void 0===i?void 0:i.KHR_interactivity)?((n=new o.FlowGraphCoordinator({scene:e})).dispatchEventsSynchronously=!1,a=t.graphs.map((function(e){return new s.W(e,l._loader.gltf,l._loader.parent.targetFps).serializeToFlowGraph()})),[4,Promise.all(a.map((function(e){return(0,r.sH)(l,void 0,void 0,(function(){return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,(0,o.ParseFlowGraphAsync)(e,{coordinator:n,pathConverter:this._pathConverter})];case 1:return[2,t.sent()]}}))}))})))]):[2]):[2];case 1:return u.sent(),n.start(),[2]}}))}))},e}();function c(e){(0,i.oR)("/extensions/KHR_interactivity/?/activeCamera/rotation",{get:function(){if(!e.activeCamera)return new o.Quaternion(NaN,NaN,NaN,NaN);var t=o.Quaternion.FromRotationMatrix(e.activeCamera.getWorldMatrix()).normalize();return e.useRightHandedSystem||(t.w*=-1,t.x*=-1),t},type:"Quaternion",getTarget:function(){return e.activeCamera}}),(0,i.oR)("/extensions/KHR_interactivity/?/activeCamera/position",{get:function(){if(!e.activeCamera)return new o.Vector3(NaN,NaN,NaN);var t=e.activeCamera.getWorldMatrix().getTranslation();return e.useRightHandedSystem||(t.x*=-1),t},type:"Vector3",getTarget:function(){return e.activeCamera}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/isPlaying",{get:function(e){var t,n;return null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.isPlaying)&&void 0!==n&&n},type:"boolean",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/minTime",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.from)&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/maxTime",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.to)&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/playhead",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.getCurrentFrame())&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/virtualPlayhead",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.getCurrentFrame())&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}})}(0,o.addToBlockFactory)(l,"FlowGraphGLTFDataProvider",(function(){return(0,r.sH)(void 0,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(n.bind(n,1274))];case 1:return[2,e.sent().FlowGraphGLTFDataProvider]}}))}))})),(0,a.Hg)(l),(0,a.Ye)(l,!0,(function(e){return new u(e)}))},1943(e,t,n){n.d(t,{KD:()=>a,U3:()=>f,X6:()=>o,rO:()=>i});var r=n(5597);function o(e){var t=e.split(":");return a({op:t[0],extension:t[1]})}function a(e,t){var n;void 0===t&&(t=!0);var o=e.extension?null===(n=s[e.extension])||void 0===n?void 0:n[e.op]:l[e.op];if(!o&&(r.Logger.Warn("No mapping found for operation ".concat(e.op," and extension ").concat(e.extension||"KHR_interactivity")),t)){var a={},i={flows:{}};if(e.inputValueSockets)for(var u in a.values={},e.inputValueSockets)a.values[u]={name:u};return e.outputValueSockets&&(i.values={},Object.keys(e.outputValueSockets).forEach((function(e){i.values[e]={name:e}}))),{blocks:[],inputs:a,outputs:i}}return o}function i(e,t,n){s[t]||(s[t]={}),s[t][e]=n}var s={BABYLON:{"flow/log":{blocks:["FlowGraphConsoleLogBlock"],inputs:{values:{message:{name:"message"}}}}}},l={"event/onStart":{blocks:["FlowGraphSceneReadyEventBlock"],outputs:{flows:{out:{name:"done"}}}},"event/onTick":{blocks:["FlowGraphSceneTickEventBlock"],inputs:{},outputs:{values:{timeSinceLastTick:{name:"deltaTime",gltfType:"number"}},flows:{out:{name:"done"}}}},"event/send":{blocks:["FlowGraphSendCustomEventBlock"],extraProcessor:function(e,t,n,r,o){var a;if("event/send"!==t.op||!e.configuration||1!==Object.keys(e.configuration).length)throw new Error("Receive event should have a single configuration object, the event itself");var i=null===(a=e.configuration.event.value)||void 0===a?void 0:a[0];if("number"!=typeof i)throw new Error("Event id should be a number");var s=r.arrays.events[i],l=o[0];return l.config||(l.config={}),l.config.eventId=s.eventId,l.config.eventData=s.eventData,o}},"event/receive":{blocks:["FlowGraphReceiveCustomEventBlock"],outputs:{flows:{out:{name:"done"}}},validation:function(e,t){var n,o;if(!e.configuration)return r.Logger.Error("Receive event should have a configuration object"),{valid:!1,error:"Receive event should have a configuration object"};var a=e.configuration.event;if(!a)return r.Logger.Error("Receive event should have a single configuration object, the event itself"),{valid:!1,error:"Receive event should have a single configuration object, the event itself"};var i=null===(n=a.value)||void 0===n?void 0:n[0];return"number"!=typeof i?(r.Logger.Error("Event id should be a number"),{valid:!1,error:"Event id should be a number"}):(null===(o=t.events)||void 0===o?void 0:o[i])?{valid:!0}:(r.Logger.Error("Event with id ".concat(i," not found")),{valid:!1,error:"Event with id ".concat(i," not found")})},extraProcessor:function(e,t,n,r,o){var a;if("event/receive"!==t.op||!e.configuration||1!==Object.keys(e.configuration).length)throw new Error("Receive event should have a single configuration object, the event itself");var i=null===(a=e.configuration.event.value)||void 0===a?void 0:a[0];if("number"!=typeof i)throw new Error("Event id should be a number");var s=r.arrays.events[i],l=o[0];return l.config||(l.config={}),l.config.eventId=s.eventId,l.config.eventData=s.eventData,o}},"math/E":u("FlowGraphEBlock"),"math/Pi":u("FlowGraphPIBlock"),"math/Inf":u("FlowGraphInfBlock"),"math/NaN":u("FlowGraphNaNBlock"),"math/abs":u("FlowGraphAbsBlock"),"math/sign":u("FlowGraphSignBlock"),"math/trunc":u("FlowGraphTruncBlock"),"math/floor":u("FlowGraphFloorBlock"),"math/ceil":u("FlowGraphCeilBlock"),"math/round":{blocks:["FlowGraphRoundBlock"],configuration:{},inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.roundHalfAwayFromZero=!0,o}},"math/fract":u("FlowGraphFractBlock"),"math/neg":u("FlowGraphNegationBlock"),"math/add":u("FlowGraphAddBlock",["a","b"],!0),"math/sub":u("FlowGraphSubtractBlock",["a","b"],!0),"math/mul":{blocks:["FlowGraphMultiplyBlock"],extraProcessor:function(e,t,n,r,o){var a;(a=o[0]).config||(a.config={}),o[0].config.useMatrixPerComponent=!0,o[0].config.preventIntegerFloatArithmetic=!0;var i=-1;return Object.keys(e.values||{}).find((function(t){var n;return void 0!==(null===(n=e.values)||void 0===n?void 0:n[t].type)&&(i=e.values[t].type,!0)})),-1!==i&&(o[0].config.type=r.arrays.types[i].flowGraphType),o},validation:function(e){return e.values?c(e):{valid:!0}}},"math/div":u("FlowGraphDivideBlock",["a","b"],!0),"math/rem":u("FlowGraphModuloBlock",["a","b"]),"math/min":u("FlowGraphMinBlock",["a","b"]),"math/max":u("FlowGraphMaxBlock",["a","b"]),"math/clamp":u("FlowGraphClampBlock",["a","b","c"]),"math/saturate":u("FlowGraphSaturateBlock"),"math/mix":u("FlowGraphMathInterpolationBlock",["a","b","c"]),"math/eq":u("FlowGraphEqualityBlock",["a","b"]),"math/lt":u("FlowGraphLessThanBlock",["a","b"]),"math/le":u("FlowGraphLessThanOrEqualBlock",["a","b"]),"math/gt":u("FlowGraphGreaterThanBlock",["a","b"]),"math/ge":u("FlowGraphGreaterThanOrEqualBlock",["a","b"]),"math/isNaN":u("FlowGraphIsNaNBlock"),"math/isInf":u("FlowGraphIsInfBlock"),"math/select":{blocks:["FlowGraphConditionalBlock"],inputs:{values:{condition:{name:"condition"},a:{name:"onTrue"},b:{name:"onFalse"}}},outputs:{values:{value:{name:"output"}}}},"math/random":{blocks:["FlowGraphRandomBlock"],outputs:{values:{value:{name:"value"}}}},"math/sin":u("FlowGraphSinBlock"),"math/cos":u("FlowGraphCosBlock"),"math/tan":u("FlowGraphTanBlock"),"math/asin":u("FlowGraphASinBlock"),"math/acos":u("FlowGraphACosBlock"),"math/atan":u("FlowGraphATanBlock"),"math/atan2":u("FlowGraphATan2Block",["a","b"]),"math/sinh":u("FlowGraphSinhBlock"),"math/cosh":u("FlowGraphCoshBlock"),"math/tanh":u("FlowGraphTanhBlock"),"math/asinh":u("FlowGraphASinhBlock"),"math/acosh":u("FlowGraphACoshBlock"),"math/atanh":u("FlowGraphATanhBlock"),"math/exp":u("FlowGraphExponentialBlock"),"math/log":u("FlowGraphLogBlock"),"math/log2":u("FlowGraphLog2Block"),"math/log10":u("FlowGraphLog10Block"),"math/sqrt":u("FlowGraphSquareRootBlock"),"math/cbrt":u("FlowGraphCubeRootBlock"),"math/pow":u("FlowGraphPowerBlock",["a","b"]),"math/length":u("FlowGraphLengthBlock"),"math/normalize":u("FlowGraphNormalizeBlock"),"math/dot":u("FlowGraphDotBlock",["a","b"]),"math/cross":u("FlowGraphCrossBlock",["a","b"]),"math/rotate2D":{blocks:["FlowGraphRotate2DBlock"],inputs:{values:{a:{name:"a"},angle:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/rotate3D":{blocks:["FlowGraphRotate3DBlock"],inputs:{values:{a:{name:"a"},rotation:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/transform":{blocks:["FlowGraphTransformVectorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/combine2":{blocks:["FlowGraphCombineVector2Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine3":{blocks:["FlowGraphCombineVector3Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine4":{blocks:["FlowGraphCombineVector4Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/extract2":{blocks:["FlowGraphExtractVector2Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"}}}},"math/extract3":{blocks:["FlowGraphExtractVector3Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"}}}},"math/extract4":{blocks:["FlowGraphExtractVector4Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/transpose":u("FlowGraphTransposeBlock"),"math/determinant":u("FlowGraphDeterminantBlock"),"math/inverse":u("FlowGraphInvertMatrixBlock"),"math/matMul":u("FlowGraphMatrixMultiplicationBlock",["a","b"]),"math/matCompose":{blocks:["FlowGraphMatrixCompose"],inputs:{values:{translation:{name:"position",gltfType:"float3"},rotation:{name:"rotationQuaternion",gltfType:"float4"},scale:{name:"scaling",gltfType:"float3"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i=o[0].dataInputs.find((function(e){return"rotationQuaternion"===e.name}));if(!i)throw new Error("Rotation quaternion input not found");return a._connectionValues[i.uniqueId]&&(a._connectionValues[i.uniqueId].type="Quaternion"),o}},"math/matDecompose":{blocks:["FlowGraphMatrixDecompose"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{translation:{name:"position"},rotation:{name:"rotationQuaternion"},scale:{name:"scaling"}}}},"math/quatConjugate":u("FlowGraphConjugateBlock",["a"]),"math/quatMul":{blocks:["FlowGraphMultiplyBlock"],inputs:{values:{a:{name:"a",gltfType:"vector4"},b:{name:"b",gltfType:"vector4"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.type="Quaternion",o}},"math/quatAngleBetween":u("FlowGraphAngleBetweenBlock",["a","b"]),"math/quatFromAxisAngle":{blocks:["FlowGraphQuaternionFromAxisAngleBlock"],inputs:{values:{axis:{name:"a",gltfType:"float3"},angle:{name:"b",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/quatToAxisAngle":u("FlowGraphAxisAngleFromQuaternionBlock",["a"]),"math/quatFromDirections":u("FlowGraphQuaternionFromDirectionsBlock",["a","b"]),"math/combine2x2":{blocks:["FlowGraphCombineMatrix2DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.inputIsColumnMajor=!0,o}},"math/extract2x2":{blocks:["FlowGraphExtractMatrix2DBlock"],inputs:{values:{a:{name:"input",gltfType:"float2x2"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/combine3x3":{blocks:["FlowGraphCombineMatrix3DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.inputIsColumnMajor=!0,o}},"math/extract3x3":{blocks:["FlowGraphExtractMatrix3DBlock"],inputs:{values:{a:{name:"input",gltfType:"float3x3"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"}}}},"math/combine4x4":{blocks:["FlowGraphCombineMatrixBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"},j:{name:"input_9",gltfType:"number"},k:{name:"input_10",gltfType:"number"},l:{name:"input_11",gltfType:"number"},m:{name:"input_12",gltfType:"number"},n:{name:"input_13",gltfType:"number"},o:{name:"input_14",gltfType:"number"},p:{name:"input_15",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.inputIsColumnMajor=!0,o}},"math/extract4x4":{blocks:["FlowGraphExtractMatrixBlock"],configuration:{},inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"},9:{name:"output_9"},10:{name:"output_10"},11:{name:"output_11"},12:{name:"output_12"},13:{name:"output_13"},14:{name:"output_14"},15:{name:"output_15"}}}},"math/not":{blocks:["FlowGraphBitwiseNotBlock"],inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l;(l=o[0]).config||(l.config={});var u=o[0].dataInputs[0];return o[0].config.valueType=null!==(s=null===(i=a._connectionValues[u.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:"FlowGraphInteger",o}},"math/and":{blocks:["FlowGraphBitwiseAndBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l,u,c;(c=o[0]).config||(c.config={});var f=o[0].dataInputs[0],d=o[0].dataInputs[1];return o[0].config.valueType=null!==(u=null!==(s=null===(i=a._connectionValues[f.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:null===(l=a._connectionValues[d.uniqueId])||void 0===l?void 0:l.type)&&void 0!==u?u:"FlowGraphInteger",o}},"math/or":{blocks:["FlowGraphBitwiseOrBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l,u,c;(c=o[0]).config||(c.config={});var f=o[0].dataInputs[0],d=o[0].dataInputs[1];return o[0].config.valueType=null!==(u=null!==(s=null===(i=a._connectionValues[f.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:null===(l=a._connectionValues[d.uniqueId])||void 0===l?void 0:l.type)&&void 0!==u?u:"FlowGraphInteger",o}},"math/xor":{blocks:["FlowGraphBitwiseXorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l,u,c;(c=o[0]).config||(c.config={});var f=o[0].dataInputs[0],d=o[0].dataInputs[1];return o[0].config.valueType=null!==(u=null!==(s=null===(i=a._connectionValues[f.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:null===(l=a._connectionValues[d.uniqueId])||void 0===l?void 0:l.type)&&void 0!==u?u:"FlowGraphInteger",o}},"math/asr":u("FlowGraphBitwiseRightShiftBlock",["a","b"]),"math/lsl":u("FlowGraphBitwiseLeftShiftBlock",["a","b"]),"math/clz":u("FlowGraphLeadingZerosBlock"),"math/ctz":u("FlowGraphTrailingZerosBlock"),"math/popcnt":u("FlowGraphOneBitsCounterBlock"),"math/rad":u("FlowGraphDegToRadBlock"),"math/deg":u("FlowGraphRadToDegBlock"),"type/boolToInt":u("FlowGraphBooleanToInt"),"type/boolToFloat":u("FlowGraphBooleanToFloat"),"type/intToBool":u("FlowGraphIntToBoolean"),"type/intToFloat":u("FlowGraphIntToFloat"),"type/floatToInt":u("FlowGraphFloatToInt"),"type/floatToBool":u("FlowGraphFloatToBoolean"),"flow/sequence":{blocks:["FlowGraphSequenceBlock"],extraProcessor:function(e,t,n,r,o){var a=o[0];return a.config||(a.config={}),a.config.outputSignalCount=Object.keys(e.flows||[]).length,a.signalOutputs.forEach((function(e,t){e.name="out_"+t})),o}},"flow/branch":{blocks:["FlowGraphBranchBlock"],outputs:{flows:{true:{name:"onTrue"},false:{name:"onFalse"}}}},"flow/switch":{blocks:["FlowGraphSwitchBlock"],configuration:{cases:{name:"cases",isArray:!0,inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"},default:{name:"default"}}},validation:function(e){var t,n=null===(t=e.configuration)||void 0===t?void 0:t.cases;if(n&&n.value){if(!n.value.every((function(e){return"number"==typeof e&&/^-?\d+$/.test(e.toString())})))return r.Logger.Warn("Switch cases should be integers. Using empty array instead."),n.value=[],{valid:!0};var o=new Set(n.value);n.value=Array.from(o)}return{valid:!0}},extraProcessor:function(e,t,n,r,o){if("flow/switch"!==t.op||!e.flows||0===Object.keys(e.flows).length)throw new Error("Switch should have a single configuration object, the cases array");return o[0].signalOutputs.forEach((function(e){"default"!==e.name&&(e.name="out_"+e.name)})),o}},"flow/while":{blocks:["FlowGraphWhileLoopBlock"],outputs:{flows:{loopBody:{name:"executionFlow"}}}},"flow/for":{blocks:["FlowGraphForLoopBlock"],configuration:{initialIndex:{name:"initialIndex",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{values:{startIndex:{name:"startIndex",gltfType:"number"},endIndex:{name:"endIndex",gltfType:"number"}}},outputs:{values:{index:{name:"index"}},flows:{loopBody:{name:"executionFlow"}}},extraProcessor:function(e,t,n,r,o){var a=o[0];return a.config||(a.config={}),a.config.incrementIndexWhenLoopDone=!0,o}},"flow/doN":{blocks:["FlowGraphDoNBlock"],configuration:{},inputs:{values:{n:{name:"maxExecutions",gltfType:"number"}}},outputs:{values:{currentCount:{name:"executionCount"}}}},"flow/multiGate":{blocks:["FlowGraphMultiGateBlock"],configuration:{isRandom:{name:"isRandom",gltfType:"boolean",inOptions:!0,defaultValue:!1},isLoop:{name:"isLoop",gltfType:"boolean",inOptions:!0,defaultValue:!1}},extraProcessor:function(e,t,n,r,o){if("flow/multiGate"!==t.op||!e.flows||0===Object.keys(e.flows).length)throw new Error("MultiGate should have a single configuration object, the number of output flows");var a=o[0];return a.config||(a.config={}),a.config.outputSignalCount=Object.keys(e.flows).length,a.signalOutputs.forEach((function(e,t){e.name="out_"+t})),o}},"flow/waitAll":{blocks:["FlowGraphWaitAllBlock"],configuration:{inputFlows:{name:"inputSignalCount",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{flows:{reset:{name:"reset"},"[segment]":{name:"in_$1"}}},validation:function(e){var t,n,r;return"number"!=typeof(null===(r=null===(n=null===(t=e.configuration)||void 0===t?void 0:t.inputFlows)||void 0===n?void 0:n.value)||void 0===r?void 0:r[0])&&(e.configuration=e.configuration||{inputFlows:{value:[0]}},e.configuration.inputFlows.value=[0]),{valid:!0}}},"flow/throttle":{blocks:["FlowGraphThrottleBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/setDelay":{blocks:["FlowGraphSetDelayBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/cancelDelay":{blocks:["FlowGraphCancelDelayBlock"]},"variable/get":{blocks:["FlowGraphGetVariableBlock"],validation:function(e){var t,n;return(null===(n=null===(t=e.configuration)||void 0===t?void 0:t.variable)||void 0===n?void 0:n.value)?{valid:!0}:(r.Logger.Error("Variable get block should have a variable configuration"),{valid:!1,error:"Variable get block should have a variable configuration"})},configuration:{variable:{name:"variable",gltfType:"number",flowGraphType:"string",inOptions:!0,isVariable:!0,dataTransformer:function(e,t){return t.getVariableName(e)}}}},"variable/set":{blocks:["FlowGraphSetVariableBlock"],configuration:{variables:{name:"variables",gltfType:"number",flowGraphType:"string",inOptions:!0,isArray:!0,dataTransformer:function(e,t){return e.map((function(e){return t.getVariableName(e)}))}}},extraProcessor:function(e,t,n,r,o){return o[0].dataInputs.forEach((function(e){e.name=r.getVariableName(+e.name)})),o}},"variable/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphContextBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing","FlowGraphGetVariableBlock"],configuration:{variable:{name:"propertyName",inOptions:!0,isVariable:!0,dataTransformer:function(e,t){return t.getVariableName(e)}},useSlerp:{name:"animationType",inOptions:!0,defaultValue:!1,dataTransformer:function(e){return!0===e?"Quaternion":void 0}}},inputs:{values:{value:{name:"value_1"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"userVariables",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:4,isVariable:!0}],extraProcessor:function(e,t,n,o,a){var i,s,l,u,c,f,d=a[0],h=null===(s=null===(i=e.configuration)||void 0===i?void 0:i.variable.value)||void 0===s?void 0:s[0];if("number"!=typeof h)throw r.Logger.Error("Variable index is not defined for variable interpolation block"),new Error("Variable index is not defined for variable interpolation block");var p=o.arrays.staticVariables[h];void 0===(null===(u=null===(l=d.config)||void 0===l?void 0:l.animationType)||void 0===u?void 0:u.value)&&(d.config||(d.config={}),(c=d.config).animationType||(c.animationType={}),d.config.animationType.value=(0,r.getAnimationTypeByFlowGraphType)(p.type));var m=a[4];return m.config||(m.config={}),(f=m.config).variable||(f.variable={}),m.config.variable.value=o.getVariableName(h),a}},"pointer/get":{blocks:["FlowGraphGetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customGetFunction",output:"getFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:function(e,t,n,r,o){return o.forEach((function(e){"FlowGraphJsonPointerParserBlock"===e.className&&(e.config||(e.config={}),e.config.outputValue=!0)})),o}},"pointer/set":{blocks:["FlowGraphSetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customSetFunction",output:"setFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:function(e,t,n,r,o){return o.forEach((function(e){"FlowGraphJsonPointerParserBlock"===e.className&&(e.config||(e.config={}),e.config.outputValue=!0)})),o}},"pointer/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphJsonPointerParserBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value_1"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customBuildAnimation",output:"generateAnimationsFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:function(e,t,n,r,o){return o.forEach((function(t){"FlowGraphJsonPointerParserBlock"===t.className?(t.config||(t.config={}),t.config.outputValue=!0):"FlowGraphInterpolationBlock"===t.className&&(t.config||(t.config={}),Object.keys(e.values||[]).forEach((function(n){var o,a=null===(o=e.values)||void 0===o?void 0:o[n];if("value"===n&&a){var i=a.type;void 0!==i&&(t.config.animationType=r.arrays.types[i].flowGraphType)}})))})),o}},"animation/start":{blocks:["FlowGraphPlayAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},speed:{name:"speed",gltfType:"number"},startTime:{name:"from",gltfType:"number",dataTransformer:function(e,t){return[e[0]*t._animationTargetFps]}},endTime:{name:"to",gltfType:"number",dataTransformer:function(e,t){return[e[0]*t._animationTargetFps]}}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s=o[o.length-1];return s.config||(s.config={}),s.config.glTF=i,o}},"animation/stop":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s=o[o.length-1];return s.config||(s.config={}),s.config.glTF=i,o}},"animation/stopAt":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{},inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},stopTime:{name:"stopAtFrame",gltfType:"number",dataTransformer:function(e,t){return[e[0]*t._animationTargetFps]}}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s=o[o.length-1];return s.config||(s.config={}),s.config.glTF=i,o}},"math/switch":{blocks:["FlowGraphDataSwitchBlock"],configuration:{cases:{name:"cases",isArray:!0,inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"}}},validation:function(e){var t,n=null===(t=e.configuration)||void 0===t?void 0:t.cases;if(n&&n.value){if(!n.value.every((function(e){return"number"==typeof e&&/^-?\d+$/.test(e.toString())})))return r.Logger.Warn("Switch cases should be integers. Using empty array instead."),n.value=[],{valid:!0};var o=new Set(n.value);n.value=Array.from(o)}return{valid:!0}},extraProcessor:function(e,t,n,r,o){var a=o[0];return a.dataInputs.forEach((function(e){"default"!==e.name&&"case"!==e.name&&(e.name="in_"+e.name)})),a.config||(a.config={}),a.config.treatCasesAsIntegers=!0,o}},"debug/log":{blocks:["FlowGraphConsoleLogBlock"],configuration:{message:{name:"messageTemplate",inOptions:!0}}}};function u(e,t,n){return void 0===t&&(t=["a"]),{blocks:[e],inputs:{values:t.reduce((function(e,t){return e[t]={name:t},e}),{})},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,r,o,a){var i;if(n){(i=a[0]).config||(i.config={}),a[0].config.preventIntegerFloatArithmetic=!0;var s=-1;Object.keys(e.values||{}).find((function(t){var n;return void 0!==(null===(n=e.values)||void 0===n?void 0:n[t].type)&&(s=e.values[t].type,!0)})),-1!==s&&(a[0].config.type=o.arrays.types[s].flowGraphType)}return a},validation:function(e){return n?c(e):{valid:!0}}}}function c(e){if(e.values){var t=Object.keys(e.values).map((function(t){return e.values[t].type})).filter((function(e){return void 0!==e}));if(!t.every((function(e){return e===t[0]})))return{valid:!1,error:"All inputs must be of the same type"}}return{valid:!0}}function f(){return Object.keys(l)}},1274(e,t,n){n.r(t),n.d(t,{FlowGraphGLTFDataProvider:()=>a});var r=n(8322),o=n(5597),a=function(e){function t(t){var n,r,a=e.call(this)||this,i=t.glTF,s=(null===(n=i.animations)||void 0===n?void 0:n.map((function(e){return e._babylonAnimationGroup})))||[];a.animationGroups=a.registerDataOutput("animationGroups",o.RichTypeAny,s);var l=(null===(r=i.nodes)||void 0===r?void 0:r.map((function(e){return e._babylonTransformNode})))||[];return a.nodes=a.registerDataOutput("nodes",o.RichTypeAny,l),a}return(0,r.C6)(t,e),t.prototype.getClassName=function(){return"FlowGraphGLTFDataProvider"},t}(o.FlowGraphBlock)},9222(e,t,n){n.d(t,{W:()=>i,u:()=>a});var r=n(1943),o=n(5597),a={float:{length:1,flowGraphType:"number",elementType:"number"},bool:{length:1,flowGraphType:"boolean",elementType:"boolean"},float2:{length:2,flowGraphType:"Vector2",elementType:"number"},float3:{length:3,flowGraphType:"Vector3",elementType:"number"},float4:{length:4,flowGraphType:"Vector4",elementType:"number"},float4x4:{length:16,flowGraphType:"Matrix",elementType:"number"},float2x2:{length:4,flowGraphType:"Matrix2D",elementType:"number"},float3x3:{length:9,flowGraphType:"Matrix3D",elementType:"number"},int:{length:1,flowGraphType:"FlowGraphInteger",elementType:"number"}},i=function(){function e(e,t,n){void 0===n&&(n=60),this._interactivityGraph=e,this._gltf=t,this._animationTargetFps=n,this._types=[],this._mappings=[],this._staticVariables=[],this._events=[],this._internalEventsCounter=0,this._nodes=[],this._parseTypes(),this._parseDeclarations(),this._parseVariables(),this._parseEvents(),this._parseNodes()}return Object.defineProperty(e.prototype,"arrays",{get:function(){return{types:this._types,mappings:this._mappings,staticVariables:this._staticVariables,events:this._events,nodes:this._nodes}},enumerable:!1,configurable:!0}),e.prototype._parseTypes=function(){if(this._interactivityGraph.types)for(var e=0,t=this._interactivityGraph.types;e<t.length;e++){var n=t[e];this._types.push(a[n.signature])}},e.prototype._parseDeclarations=function(){if(this._interactivityGraph.declarations)for(var e=0,t=this._interactivityGraph.declarations;e<t.length;e++){var n=t[e],a=(0,r.KD)(n);if(!a)throw o.Logger.Error(["No mapping found for declaration",n]),new Error("Error parsing declarations");this._mappings.push({flowGraphMapping:a,fullOperationName:n.extension?n.op+":"+n.extension:n.op})}},e.prototype._parseVariables=function(){if(this._interactivityGraph.variables)for(var e=0,t=this._interactivityGraph.variables;e<t.length;e++){var n=t[e],r=this._parseVariable(n);this._staticVariables.push(r)}},e.prototype._parseVariable=function(e,t){var n=this._types[e.type];if(!n)throw o.Logger.Error(["No type found for variable",e]),new Error("Error parsing variables");if(e.value&&e.value.length!==n.length)throw o.Logger.Error(["Invalid value length for variable",e,n]),new Error("Error parsing variables");var r=e.value||[];if(!r.length)switch(n.flowGraphType){case"boolean":r.push(!1);break;case"FlowGraphInteger":r.push(0);break;case"number":r.push(NaN);break;case"Vector2":r.push(NaN,NaN);break;case"Vector3":r.push(NaN,NaN,NaN);break;case"Vector4":case"Matrix2D":case"Quaternion":r.fill(NaN,0,4);break;case"Matrix":r.fill(NaN,0,16);break;case"Matrix3D":r.fill(NaN,0,9)}return"number"===n.elementType&&"string"==typeof r[0]&&(r[0]=parseFloat(r[0])),{type:n.flowGraphType,value:t?t(r,this):r}},e.prototype._parseEvents=function(){var e=this;if(this._interactivityGraph.events)for(var t=function(t){var r={eventId:t.id||"internalEvent_"+n._internalEventsCounter++};t.values&&(r.eventData=Object.keys(t.values).map((function(n){var r,a=null===(r=t.values)||void 0===r?void 0:r[n];if(!a)throw o.Logger.Error(["No value found for event key",n]),new Error("Error parsing events");var i=e._types[a.type];if(!i)throw o.Logger.Error(["No type found for event value",a]),new Error("Error parsing events");var s=void 0!==a.value?e._parseVariable(a):void 0;return{id:n,type:i.flowGraphType,eventData:!0,value:s}}))),n._events.push(r)},n=this,r=0,a=this._interactivityGraph.events;r<a.length;r++)t(a[r])},e.prototype._parseNodes=function(){var e;if(this._interactivityGraph.nodes)for(var t=0,n=this._interactivityGraph.nodes;t<n.length;t++){var r=n[t];if("number"!=typeof r.declaration)throw o.Logger.Error(["No declaration found for node",r]),new Error("Error parsing nodes");var a=this._mappings[r.declaration];if(!a)throw o.Logger.Error(["No mapping found for node",r]),new Error("Error parsing nodes");if(a.flowGraphMapping.validation){var i=a.flowGraphMapping.validation(r,this._interactivityGraph,this._gltf);if(!i.valid)throw new Error("Error validating interactivity node ".concat(null===(e=this._interactivityGraph.declarations)||void 0===e?void 0:e[r.declaration].op," - ").concat(i.error))}for(var s=[],l=0,u=a.flowGraphMapping.blocks;l<u.length;l++){var c=u[l],f=this._getEmptyBlock(c,a.fullOperationName);this._parseNodeConfiguration(r,f,a.flowGraphMapping,c),s.push(f)}this._nodes.push({blocks:s,fullOperationName:a.fullOperationName})}},e.prototype._getEmptyBlock=function(e,t){return{uniqueId:(0,o.RandomGUID)(),className:e,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[],config:{},type:t,metadata:{}}},e.prototype._parseNodeConfiguration=function(e,t,n,r){var a,i=e.configuration;if(i)for(var s in i){var l=i[s];if(!l)throw new Error("Error parsing node configuration");var u=null===(a=n.configuration)||void 0===a?void 0:a[s];if(u&&u.toBlock?u.toBlock===r:0===n.blocks.indexOf(r)){var c=null==u?void 0:u.defaultValue;(null==l?void 0:l.value)&&(c=l.value),(null==u?void 0:u.isArray)||(1!==c.length&&o.Logger.Warn("Invalid non-array value length: ".concat(c.length)),c=c[0]),(null==u?void 0:u.dataTransformer)&&(c=u.dataTransformer(c,this)),void 0!==c&&(t.config[(null==u?void 0:u.name)||s]={value:c})}}},e.prototype._parseNodeConnections=function(e){for(var t,n,a,i,s,l,u,c,f,d,h,p,m,_,g,b,y,v,T,x=0;x<this._nodes.length;x++){var A=null===(t=this._interactivityGraph.nodes)||void 0===t?void 0:t[x];if(!A)throw o.Logger.Error(["No node found for interactivity node",this._nodes[x]]),new Error("Error parsing node connections");var w=this._nodes[x],O=this._mappings[A.declaration];if(!O)throw o.Logger.Error(["No mapping found for node",A]),new Error("Error parsing node connections");for(var C=A.flows||{},M=Object.keys(C).sort(),E=function(e){var t=C[e],f=null===(a=null===(n=O.flowGraphMapping.outputs)||void 0===n?void 0:n.flows)||void 0===a?void 0:a[e],d=(null==f?void 0:f.name)||e,h=L._createNewSocketConnection(d,!0);(f&&f.toBlock&&w.blocks.find((function(e){return e.className===f.toBlock}))||w.blocks[0]).signalOutputs.push(h);var p=t.node,m=L._nodes[p];if(!m)throw o.Logger.Error(["No node found for input node id",p]),new Error("Error parsing node connections");var _=(0,r.X6)(m.fullOperationName);if(!_)throw o.Logger.Error(["No mapping found for input node",m]),new Error("Error parsing node connections");var g=null===(s=null===(i=_.inputs)||void 0===i?void 0:i.flows)||void 0===s?void 0:s[t.socket||"in"],b=!1;if(!g)for(var y in null===(l=_.inputs)||void 0===l?void 0:l.flows)y.startsWith("[")&&y.endsWith("]")&&(b=!0,g=null===(c=null===(u=_.inputs)||void 0===u?void 0:u.flows)||void 0===c?void 0:c[y]);var v=g?b?g.name.replace("$1",t.socket||""):g.name:t.socket||"in",T=g&&g.toBlock&&m.blocks.find((function(e){return e.className===g.toBlock}))||m.blocks[0],x=T.signalInputs.find((function(e){return e.name===v}));x||(x=L._createNewSocketConnection(v),T.signalInputs.push(x)),x.connectedPointIds.push(h.uniqueId),h.connectedPointIds.push(x.uniqueId)},L=this,F=0,R=M;F<R.length;F++)E(R[F]);for(var P=A.values||{},S=Object.keys(P),I=function(t){var n=P[t],a=null===(d=null===(f=O.flowGraphMapping.inputs)||void 0===f?void 0:f.values)||void 0===d?void 0:d[t],i=!1;if(!a)for(var s in null===(h=O.flowGraphMapping.inputs)||void 0===h?void 0:h.values)s.startsWith("[")&&s.endsWith("]")&&(i=!0,a=null===(m=null===(p=O.flowGraphMapping.inputs)||void 0===p?void 0:p.values)||void 0===m?void 0:m[s]);var l=a?i?a.name.replace("$1",t):a.name:t,u=N._createNewSocketConnection(l);if((a&&a.toBlock&&w.blocks.find((function(e){return e.className===a.toBlock}))||w.blocks[0]).dataInputs.push(u),void 0!==n.value){var c=N._parseVariable(n,a&&a.dataTransformer);e._connectionValues[u.uniqueId]=c}else{if(void 0===n.node)throw o.Logger.Error(["Invalid value for value connection",n]),new Error("Error parsing node connections");var T=n.node,x=n.socket||"value",A=N._nodes[T];if(!A)throw o.Logger.Error(["No node found for output socket reference",n]),new Error("Error parsing node connections");var C=(0,r.X6)(A.fullOperationName);if(!C)throw o.Logger.Error(["No mapping found for output socket reference",n]),new Error("Error parsing node connections");var M=null===(g=null===(_=C.outputs)||void 0===_?void 0:_.values)||void 0===g?void 0:g[x],E=!1;if(!M)for(var s in null===(b=C.outputs)||void 0===b?void 0:b.values)s.startsWith("[")&&s.endsWith("]")&&(E=!0,M=null===(v=null===(y=C.outputs)||void 0===y?void 0:y.values)||void 0===v?void 0:v[s]);var L=M?E?M.name.replace("$1",x):null==M?void 0:M.name:x,F=M&&M.toBlock&&A.blocks.find((function(e){return e.className===M.toBlock}))||A.blocks[0],R=F.dataOutputs.find((function(e){return e.name===L}));R||(R=N._createNewSocketConnection(L,!0),F.dataOutputs.push(R)),u.connectedPointIds.push(R.uniqueId),R.connectedPointIds.push(u.uniqueId)}},N=this,B=0,k=S;B<k.length;B++)I(k[B]);if(O.flowGraphMapping.interBlockConnectors)for(var H=0,G=O.flowGraphMapping.interBlockConnectors;H<G.length;H++){var V=G[H],D=V.input,K=V.output,U=V.isVariable;this._connectFlowGraphNodes(D,K,w.blocks[V.inputBlockIndex],w.blocks[V.outputBlockIndex],U)}if(O.flowGraphMapping.extraProcessor){var j=null===(T=this._interactivityGraph.declarations)||void 0===T?void 0:T[A.declaration];if(!j)throw o.Logger.Error(["No declaration found for extra processor",A]),new Error("Error parsing node connections");w.blocks=O.flowGraphMapping.extraProcessor(A,j,O.flowGraphMapping,this,w.blocks,e,this._gltf)}}},e.prototype._createNewSocketConnection=function(e,t){return{uniqueId:(0,o.RandomGUID)(),name:e,_connectionType:t?1:0,connectedPointIds:[]}},e.prototype._connectFlowGraphNodes=function(e,t,n,r,o){var a=o?n.dataInputs:n.signalInputs,i=o?r.dataOutputs:r.signalOutputs,s=a.find((function(t){return t.name===e}))||this._createNewSocketConnection(e),l=i.find((function(e){return e.name===t}))||this._createNewSocketConnection(t,!0);a.find((function(t){return t.name===e}))||a.push(s),i.find((function(e){return e.name===t}))||i.push(l),s.connectedPointIds.push(l.uniqueId),l.connectedPointIds.push(s.uniqueId)},e.prototype.getVariableName=function(e){return"staticVariable_"+e},e.prototype.serializeToFlowGraph=function(){var e={uniqueId:(0,o.RandomGUID)(),_userVariables:{},_connectionValues:{}};this._parseNodeConnections(e);for(var t=0;t<this._staticVariables.length;t++){var n=this._staticVariables[t];e._userVariables[this.getVariableName(t)]=n}return{rightHanded:!0,allBlocks:this._nodes.reduce((function(e,t){return e.concat(t.blocks)}),[]),executionContexts:[e]}},e}()},5890(e,t,n){n.r(t),n.d(t,{KHR_lights:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_lights_punctual",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,a.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,[4,this._loader.loadNodeAsync(e,t,(function(e){var t,r=a.ArrayItem.Get(s,i._lights,l.light),u=r.name||e.name;switch(i._loader.babylonScene._blockEntityCollection=!!i._loader._assetContainer,r.type){case"directional":var c=new o.DirectionalLight(u,o.Vector3.Backward(),i._loader.babylonScene);c.position.setAll(0),t=c;break;case"point":t=new o.PointLight(u,o.Vector3.Zero(),i._loader.babylonScene);break;case"spot":var f=new o.SpotLight(u,o.Vector3.Zero(),o.Vector3.Backward(),0,1,i._loader.babylonScene);f.angle=2*(r.spot&&r.spot.outerConeAngle||Math.PI/4),f.innerAngle=2*(r.spot&&r.spot.innerConeAngle||0),t=f;break;default:throw i._loader.babylonScene._blockEntityCollection=!1,new Error("".concat(s,": Invalid light type (").concat(r.type,")"))}t._parentContainer=i._loader._assetContainer,i._loader.babylonScene._blockEntityCollection=!1,r._babylonLight=t,t.falloffType=o.Light.FALLOFF_GLTF,t.diffuse=r.color?o.Color3.FromArray(r.color):o.Color3.White(),t.intensity=null==r.intensity?1:r.intensity,t.range=null==r.range?Number.MAX_VALUE:r.range,t.parent=e,i._loader._babylonLights.push(t),a.GLTFLoader.AddPointerMetadata(t,s),n(e)}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},699(e,t,n){n.r(t),n.d(t,{KHR_materials_anisotropy:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_anisotropy",s=function(){function e(e){this.name=i,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadAnisotropyPropertiesAsync(o,i,n)),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))}))},e.prototype._loadAnisotropyPropertiesAsync=function(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){var o,a,i,s,l,u,c,f;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return o=this._loader._getOrCreateMaterialAdapter(n),a=new Array,i=null!==(u=t.anisotropyStrength)&&void 0!==u?u:0,s=null!==(c=t.anisotropyRotation)&&void 0!==c?c:0,o.specularRoughnessAnisotropy=i,o.geometryTangentAngle=s,(l=null!==(f=t.extensions)&&void 0!==f?f:{}).EXT_materials_anisotropy_openpbr&&l.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled||o.configureGltfStyleAnisotropy(!0),t.anisotropyTexture&&(t.anisotropyTexture.nonColorData=!0,a.push(this._loader.loadTextureInfoAsync("".concat(e,"/anisotropyTexture"),t.anisotropyTexture,(function(e){e.name="".concat(n.name," (Anisotropy Intensity)"),o.geometryTangentTexture=e})))),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8469(e,t,n){n.r(t),n.d(t,{KHR_materials_clearcoat:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_clearcoat",s=function(){function e(e){this.name=i,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadClearCoatPropertiesAsync(o,i,n)),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))}))},e.prototype._loadClearCoatPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),o=new Array;return r.configureCoat(),r.coatWeight=void 0!==t.clearcoatFactor?t.clearcoatFactor:0,r.coatRoughness=void 0!==t.clearcoatRoughnessFactor?t.clearcoatRoughnessFactor:0,t.clearcoatTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatTexture"),t.clearcoatTexture,(function(e){e.name="".concat(n.name," (ClearCoat)"),r.coatWeightTexture=e}))),t.clearcoatRoughnessTexture&&(t.clearcoatRoughnessTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatRoughnessTexture"),t.clearcoatRoughnessTexture,(function(e){e.name="".concat(n.name," (ClearCoat Roughness)"),r.coatRoughnessTexture=e})))),t.clearcoatNormalTexture&&(t.clearcoatNormalTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatNormalTexture"),t.clearcoatNormalTexture,(function(e){var o;e.name="".concat(n.name," (ClearCoat Normal)"),r.geometryCoatNormalTexture=e,null!=(null===(o=t.clearcoatNormalTexture)||void 0===o?void 0:o.scale)&&(r.geometryCoatNormalTextureScale=t.clearcoatNormalTexture.scale)}))),r.setNormalMapInversions(!n.getScene().useRightHandedSystem,n.getScene().useRightHandedSystem)),Promise.all(o).then((function(){}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8856(e,t,n){n.r(t),n.d(t,{KHR_materials_diffuse_roughness:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_diffuse_roughness",s=function(){function e(e){this.name=i,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadDiffuseRoughnessPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadDiffuseRoughnessPropertiesAsync=function(e,t,n){var r,o=this._loader._getOrCreateMaterialAdapter(n),a=new Array;return o.baseDiffuseRoughness=null!==(r=t.diffuseRoughnessFactor)&&void 0!==r?r:0,t.diffuseRoughnessTexture&&a.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseRoughnessTexture"),t.diffuseRoughnessTexture,(function(e){e.name="".concat(n.name," (Diffuse Roughness)"),o.baseDiffuseRoughnessTexture=e}))),Promise.all(a).then((function(){}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},6528(e,t,n){n.r(t),n.d(t,{KHR_materials_diffuse_transmission:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_diffuse_transmission",l=function(){function e(e){this.name=s,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(s),this.enabled&&(e.parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadTranslucentPropertiesAsync(o,t,n,i)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadTranslucentPropertiesAsync=function(e,t,n,r){var o,i=this._loader._getOrCreateMaterialAdapter(n);i.configureSubsurface(),i.subsurfaceWeight=null!==(o=r.diffuseTransmissionFactor)&&void 0!==o?o:0,i.subsurfaceConstantTint=void 0!==r.diffuseTransmissionColorFactor?a.Color3.FromArray(r.diffuseTransmissionColorFactor):a.Color3.White();var s=new Array;return r.diffuseTransmissionTexture&&(r.diffuseTransmissionTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTransmissionTexture"),r.diffuseTransmissionTexture).then((function(e){e.name="".concat(n.name," (Diffuse Transmission)"),i.subsurfaceWeightTexture=e})))),r.diffuseTransmissionColorTexture&&s.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTransmissionColorTexture"),r.diffuseTransmissionColorTexture).then((function(e){e.name="".concat(n.name," (Diffuse Transmission Color)"),i.subsurfaceConstantTintTexture=e}))),Promise.all(s).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},9553(e,t,n){n.r(t),n.d(t,{KHR_materials_dispersion:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_dispersion",s=function(){function e(e){this.name=i,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadDispersionPropertiesAsync(o,t,n,i)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadDispersionPropertiesAsync=function(e,t,n,r){var o=this._loader._getOrCreateMaterialAdapter(n);return 0!=o.transmissionWeight&&r.dispersion?(o.transmissionDispersionAbbeNumber=20,o.transmissionDispersionScale=r.dispersion,Promise.resolve()):Promise.resolve()},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8842(e,t,n){n.r(t),n.d(t,{KHR_materials_emissive_strength:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_emissive_strength",s=function(){function e(e){this.name=i,this.order=170,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadMaterialPropertiesAsync(e,t,n)];case 1:return r.sent(),this._loadEmissiveProperties(o,i,n),[4,Promise.resolve()];case 2:return[2,r.sent()]}}))}))}))},e.prototype._loadEmissiveProperties=function(e,t,n){void 0!==t.emissiveStrength&&(this._loader._getOrCreateMaterialAdapter(n).emissionLuminance=t.emissiveStrength)},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},5613(e,t,n){n.r(t),n.d(t,{KHR_materials_ior:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_ior",s=function(){function e(e){this.name=i,this.order=180,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadIorPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadIorPropertiesAsync=function(t,n,r){var o=this._loader._getOrCreateMaterialAdapter(r),a=void 0!==n.ior?n.ior:e._DEFAULT_IOR;return o.specularIor=a,Promise.resolve()},e._DEFAULT_IOR=1.5,e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},2843(e,t,n){n.r(t),n.d(t,{KHR_materials_iridescence:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_iridescence",s=function(){function e(e){this.name=i,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadIridescencePropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadIridescencePropertiesAsync=function(e,t,n){var r,o,a,i,s,l=this._loader._getOrCreateMaterialAdapter(n),u=new Array;return l.thinFilmWeight=null!==(r=t.iridescenceFactor)&&void 0!==r?r:0,l.thinFilmIor=null!==(a=null!==(o=t.iridescenceIor)&&void 0!==o?o:t.iridescenceIOR)&&void 0!==a?a:1.3,l.thinFilmThicknessMinimum=null!==(i=t.iridescenceThicknessMinimum)&&void 0!==i?i:100,l.thinFilmThicknessMaximum=null!==(s=t.iridescenceThicknessMaximum)&&void 0!==s?s:400,t.iridescenceTexture&&u.push(this._loader.loadTextureInfoAsync("".concat(e,"/iridescenceTexture"),t.iridescenceTexture,(function(e){e.name="".concat(n.name," (Iridescence)"),l.thinFilmWeightTexture=e}))),t.iridescenceThicknessTexture&&u.push(this._loader.loadTextureInfoAsync("".concat(e,"/iridescenceThicknessTexture"),t.iridescenceThicknessTexture,(function(e){e.name="".concat(n.name," (Iridescence Thickness)"),l.thinFilmThicknessTexture=e}))),Promise.all(u).then((function(){}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},2916(e,t,n){n.r(t),n.d(t,{KHR_materials_pbrSpecularGlossiness:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_pbrSpecularGlossiness",l=function(){function e(e){this.name=s,this.order=200,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,i){return(0,r.sH)(o,void 0,void 0,(function(){var o;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(o=new Array).push(this._loader.loadMaterialBasePropertiesAsync(e,t,n)),o.push(this._loadSpecularGlossinessPropertiesAsync(a,i,n)),this._loader.loadMaterialAlphaProperties(e,t,n),[4,Promise.all(o).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadSpecularGlossinessPropertiesAsync=function(e,t,n){if(!(n instanceof o.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var r=new Array;return n.metallic=null,n.roughness=null,t.diffuseFactor?(n.albedoColor=o.Color3.FromArray(t.diffuseFactor),n.alpha=t.diffuseFactor[3]):n.albedoColor=o.Color3.White(),n.reflectivityColor=t.specularFactor?o.Color3.FromArray(t.specularFactor):o.Color3.White(),n.microSurface=null==t.glossinessFactor?1:t.glossinessFactor,t.diffuseTexture&&r.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTexture"),t.diffuseTexture,(function(e){e.name="".concat(n.name," (Diffuse)"),n.albedoTexture=e}))),t.specularGlossinessTexture&&(r.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularGlossinessTexture"),t.specularGlossinessTexture,(function(e){e.name="".concat(n.name," (Specular Glossiness)"),n.reflectivityTexture=e,n.reflectivityTexture.hasAlpha=!0}))),n.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(r).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3274(e,t,n){n.r(t),n.d(t,{KHR_materials_sheen:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_sheen",l=function(){function e(e){this.name=s,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadSheenPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadSheenPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),o=new Array;r.configureFuzz();var i=void 0!==t.sheenColorFactor?a.Color3.FromArray(t.sheenColorFactor):a.Color3.Black(),s=void 0!==t.sheenRoughnessFactor?t.sheenRoughnessFactor:0;return r.fuzzWeight=1,r.fuzzColor=i,r.fuzzRoughness=s,t.sheenColorTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/sheenColorTexture"),t.sheenColorTexture,(function(e){e.name="".concat(n.name," (Sheen Color)"),r.fuzzColorTexture=e}))),t.sheenRoughnessTexture&&(t.sheenRoughnessTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/sheenRoughnessTexture"),t.sheenRoughnessTexture,(function(e){e.name="".concat(n.name," (Sheen Roughness)"),r.fuzzRoughnessTexture=e})))),Promise.all(o).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5418(e,t,n){n.r(t),n.d(t,{KHR_materials_specular:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_specular",l=function(){function e(e){this.name=s,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a,s;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadSpecularPropertiesAsync(o,i,n)),s=this._loader._getOrCreateMaterialAdapter(n),i.extensions&&i.extensions.EXT_materials_specular_edge_color&&i.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&s.enableSpecularEdgeColor(!0),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadSpecularPropertiesAsync=function(e,t,n){var r,o=this._loader._getOrCreateMaterialAdapter(n),i=new Array;return o.specularWeight=null!==(r=t.specularFactor)&&void 0!==r?r:1,o.specularColor=void 0!==t.specularColorFactor?a.Color3.FromArray(t.specularColorFactor):new a.Color3(1,1,1),t.specularTexture&&(t.specularTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularTexture"),t.specularTexture,(function(e){e.name="".concat(n.name," (Specular)"),o.specularWeightTexture=e})))),t.specularColorTexture&&i.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularColorTexture"),t.specularColorTexture,(function(e){e.name="".concat(n.name," (Specular Color)"),o.specularColorTexture=e}))),Promise.all(i).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},4943(e,t,n){n.r(t),n.d(t,{KHR_materials_transmission:()=>u});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s=function(){function e(t,n,o){var i=this;this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options=(0,r.Cl)((0,r.Cl)({},e._GetDefaultOptions()),t),this._scene=n,this._scene._transmissionHelper=this,this._loader=o,this.onErrorObservable=new a.Observable,this._scene.onDisposeObservable.addOnce((function(){i.dispose()})),this._parseScene(),this._setupRenderTargets()}return e._GetDefaultOptions=function(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:a.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}},e.prototype.updateOptions=function(e){var t=this,n=Object.keys(e).filter((function(n){return t._options[n]!==e[n]}));if(n.length){var o=(0,r.Cl)((0,r.Cl)({},this._options),e),a=this._options;this._options=o,o.renderSize===a.renderSize&&o.renderTargetTextureType===a.renderTargetTextureType&&o.generateMipmaps===a.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=o.samples,this._opaqueRenderTarget.lodGenerationScale=o.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=o.lodGenerationOffset):this._setupRenderTargets()}},e.prototype.getOpaqueTarget=function(){return this._opaqueRenderTarget},e.prototype._addMesh=function(e){var t=this;this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),a.Tools.SetImmediate((function(){if(e.material){if(!t._loader.isMatchingMaterialType(e.material))return;var n=t._loader._getOrCreateMaterialAdapter(e.material);n.transmissionWeight>0?(n.refractionBackgroundTexture=t._opaqueRenderTarget,-1===t._transparentMeshesCache.indexOf(e)&&t._transparentMeshesCache.push(e)):-1===t._opaqueMeshesCache.indexOf(e)&&t._opaqueMeshesCache.push(e)}}))},e.prototype._removeMesh=function(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];var t=this._transparentMeshesCache.indexOf(e);-1!==t&&this._transparentMeshesCache.splice(t,1),-1!==(t=this._opaqueMeshesCache.indexOf(e))&&this._opaqueMeshesCache.splice(t,1)},e.prototype._parseScene=function(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))},e.prototype._onMeshMaterialChanged=function(e){var t=this._transparentMeshesCache.indexOf(e),n=this._opaqueMeshesCache.indexOf(e);if(this._loader.isMatchingMaterialType(e.material)){var r=e.material?this._loader._getOrCreateMaterialAdapter(e.material):null;r&&r.transmissionWeight>0?(r&&(r.refractionBackgroundTexture=this._opaqueRenderTarget),-1!==n?(this._opaqueMeshesCache.splice(n,1),this._transparentMeshesCache.push(e)):-1===t&&this._transparentMeshesCache.push(e)):-1!==t?(this._transparentMeshesCache.splice(t,1),this._opaqueMeshesCache.push(e)):-1===n&&this._opaqueMeshesCache.push(e)}},e.prototype._isRenderTargetValid=function(){var e;return null!==(null===(e=this._opaqueRenderTarget)||void 0===e?void 0:e.getInternalTexture())},e.prototype._setupRenderTargets=function(){var e,t,n,r=this;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new a.RenderTargetTexture("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=null!==(t=null===(e=this._options.clearColor)||void 0===e?void 0:e.clone())&&void 0!==t?t:this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.disableImageProcessing=!0,this._opaqueRenderTarget.onBeforeBindObservable.add((function(e){n=r._scene.environmentIntensity,r._scene.environmentIntensity=1,r._options.clearColor?e.clearColor.copyFrom(r._options.clearColor):r._scene.clearColor.toLinearSpaceToRef(e.clearColor,r._scene.getEngine().useExactSrgbConversions)})),this._opaqueRenderTarget.onAfterUnbindObservable.add((function(){r._scene.environmentIntensity=n}));for(var o=0,i=this._transparentMeshesCache;o<i.length;o++){var s=i[o];if(s.material){if(!this._loader.isMatchingMaterialType(s.material))return;var l=this._loader._getOrCreateMaterialAdapter(s.material);l.transmissionWeight>0&&(l.refractionBackgroundTexture=this._opaqueRenderTarget)}}},e.prototype.dispose=function(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]},e}(),l="KHR_materials_transmission",u=function(){function e(e){this.name=l,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(l),this.enabled&&(e.parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadTransparentPropertiesAsync(o,t,n,i)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadTransparentPropertiesAsync=function(e,t,n,r){var o,a,i=this._loader._getOrCreateMaterialAdapter(n),l=void 0!==r.transmissionFactor?r.transmissionFactor:0;if(0===l||!i)return Promise.resolve();if(i.configureTransmission(),i.transmissionWeight=l,l>0&&!this._loader.parent.dontUseTransmissionHelper){var u=n.getScene();u._transmissionHelper?(null===(o=u._transmissionHelper)||void 0===o?void 0:o._isRenderTargetValid())||null===(a=u._transmissionHelper)||void 0===a||a._setupRenderTargets():new s({},n.getScene(),this._loader)}var c=Promise.resolve(null);return r.transmissionTexture&&(r.transmissionTexture.nonColorData=!0,c=this._loader.loadTextureInfoAsync("".concat(e,"/transmissionTexture"),r.transmissionTexture,(function(e){e.name="".concat(n.name," (Transmission)"),i.transmissionWeightTexture=e}))),c.then((function(){}))},e}();(0,i.Hg)(l),(0,i.Ye)(l,!0,(function(e){return new u(e)}))},4239(e,t,n){n.r(t),n.d(t,{KHR_materials_unlit:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_unlit",l=function(){function e(e){this.name=s,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(){return(0,r.sH)(o,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loadUnlitPropertiesAsync(e,t,n)];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadUnlitPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),a=new Array,i=t.pbrMetallicRoughness;return i&&(i.baseColorFactor&&(r.baseColor=o.Color3.FromArray(i.baseColorFactor),r.geometryOpacity=i.baseColorFactor[3]),i.baseColorTexture&&a.push(this._loader.loadTextureInfoAsync("".concat(e,"/baseColorTexture"),i.baseColorTexture,(function(e){e.name="".concat(n.name," (Base Color)"),r.baseColorTexture=e})))),r.isUnlit=!0,t.doubleSided&&(r.backFaceCulling=!1,r.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,t,n),Promise.all(a).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},9437(e,t,n){n.r(t),n.d(t,{KHR_materials_variants:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_variants",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)&&!this._loader.parent.skipMaterials}return e.prototype.dispose=function(){this._loader=null},e.GetAvailableVariants=function(e){var t=this._GetExtensionMetadata(e);return t?Object.keys(t.variants):[]},e.prototype.getAvailableVariants=function(t){return e.GetAvailableVariants(t)},e.SelectVariant=function(e,t){var n=this._GetExtensionMetadata(e);if(!n)throw new Error("Cannot select variant on a glTF mesh that does not have the ".concat(s," extension"));var r=function(e){var t=n.variants[e];if(t)for(var r=0,o=t;r<o.length;r++){var a=o[r];a.mesh.material=a.material}};if(t instanceof Array)for(var o=0,a=t;o<a.length;o++)r(a[o]);else r(t);n.lastSelected=t},e.prototype.selectVariant=function(t,n){e.SelectVariant(t,n)},e.Reset=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot reset on a glTF mesh that does not have the ".concat(s," extension"));for(var n=0,r=t.original;n<r.length;n++){var o=r[n];o.mesh.material=o.material}t.lastSelected=null},e.prototype.reset=function(t){e.Reset(t)},e.GetLastSelectedVariant=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot get the last selected variant on a glTF mesh that does not have the ".concat(s," extension"));return t.lastSelected},e.prototype.getLastSelectedVariant=function(t){return e.GetLastSelectedVariant(t)},e._GetExtensionMetadata=function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e._internalMetadata)||void 0===t?void 0:t.gltf)||void 0===n?void 0:n[s])||null},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._variants=t.variants}},e.prototype.onReady=function(){var t,n=this._loader.rootBabylonMesh;if(n){var r=this._loader.parent.extensionOptions[s];(null==r?void 0:r.defaultVariant)&&e.SelectVariant(n,r.defaultVariant),null===(t=null==r?void 0:r.onLoaded)||void 0===t||t.call(r,{get variants(){return e.GetAvailableVariants(n)},get selectedVariant(){var t=e.GetLastSelectedVariant(n);return t?Array.isArray(t)?t[0]:t:e.GetAvailableVariants(n)[0]},set selectedVariant(t){e.SelectVariant(n,t)}})}},e.prototype._loadMeshPrimitiveAsync=function(t,n,i,l,u,c){var f=this;return o.GLTFLoader.LoadExtensionAsync(t,u,this.name,(function(d,h){return(0,r.sH)(f,void 0,void 0,(function(){var f,p=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(f=new Array).push(this._loader._loadMeshPrimitiveAsync(t,n,i,l,u,(function(n){if(c(n),n instanceof a.Mesh){var r=o.GLTFLoader._GetDrawMode(t,u.mode),i=p._loader.rootBabylonMesh,l=i?i._internalMetadata=i._internalMetadata||{}:{},m=l.gltf=l.gltf||{},_=m[s]=m[s]||{lastSelected:null,original:[],variants:{}};_.original.push({mesh:n,material:n.material});for(var g=function(t){var a=h.mappings[t],l=o.ArrayItem.Get("".concat(d,"/mappings/").concat(t,"/material"),p._loader.gltf.materials,a.material);f.push(p._loader._loadMaterialAsync("#/materials/".concat(a.material),l,n,r,(function(t){for(var r=function(r){var l=a.variants[r],u=o.ArrayItem.Get("/extensions/".concat(s,"/variants/").concat(l),p._variants,l);_.variants[u.name]=_.variants[u.name]||[],_.variants[u.name].push({mesh:n,material:t}),n.onClonedObservable.add((function(t){var r,o=t,a=o;do{if(!(a=a.parent))return;r=e._GetExtensionMetadata(a)}while(null===r);if(i&&r===e._GetExtensionMetadata(i)){for(var l in a._internalMetadata={},i._internalMetadata)a._internalMetadata[l]=i._internalMetadata[l];for(var l in a._internalMetadata.gltf=[],i._internalMetadata.gltf)a._internalMetadata.gltf[l]=i._internalMetadata.gltf[l];a._internalMetadata.gltf[s]={lastSelected:null,original:[],variants:{}};for(var c=0,f=r.original;c<f.length;c++){var d=f[c];a._internalMetadata.gltf[s].original.push({mesh:d.mesh,material:d.material})}for(var l in r.variants)if(Object.prototype.hasOwnProperty.call(r.variants,l)){a._internalMetadata.gltf[s].variants[l]=[];for(var h=0,p=r.variants[l];h<p.length;h++){var m=p[h];a._internalMetadata.gltf[s].variants[l].push({mesh:m.mesh,material:m.material})}}r=a._internalMetadata.gltf[s]}for(var _=0,g=r.original;_<g.length;_++)(v=g[_]).mesh===n&&(v.mesh=o);for(var b=0,y=r.variants[u.name];b<y.length;b++){var v;(v=y[b]).mesh===n&&(v.mesh=o)}}))},l=0;l<a.variants.length;++l)r(l)})))},b=0;b<h.mappings.length;++b)g(b)}}))),[4,Promise.all(f).then((function(e){return e[0]}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},1369(e,t,n){n.r(t),n.d(t,{KHR_materials_volume:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_volume",l=function(){function e(e){this.name=s,this.order=173,this._loader=e,this.enabled=this._loader.isExtensionUsed(s),this.enabled&&this._loader._disableInstancedMesh++}return e.prototype.dispose=function(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,i){return(0,r.sH)(o,void 0,void 0,(function(){var o;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(o=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),o.push(this._loadVolumePropertiesAsync(a,t,n,i)),[4,Promise.all(o).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadVolumePropertiesAsync=function(e,t,n,r){var a,i=this._loader._getOrCreateMaterialAdapter(n);if(0===i.transmissionWeight&&0===i.subsurfaceWeight||!r.thicknessFactor)return Promise.resolve();var s=void 0!==r.attenuationDistance?r.attenuationDistance:Number.MAX_VALUE,l=void 0!==r.attenuationColor&&3==r.attenuationColor.length?o.Color3.FromArray(r.attenuationColor):o.Color3.White(),u=new o.Vector3(-Math.log(l.r),-Math.log(l.g),-Math.log(l.b));u.scaleInPlace(1/Math.max(s,.001)),i.extinctionCoefficient=u,i.transmissionDepth=s,i.transmissionColor=l,i.volumeThickness=null!==(a=r.thicknessFactor)&&void 0!==a?a:0;var c=new Array;return r.thicknessTexture&&(r.thicknessTexture.nonColorData=!0,c.push(this._loader.loadTextureInfoAsync("".concat(e,"/thicknessTexture"),r.thicknessTexture,(function(e){e.name="".concat(n.name," (Thickness)"),i.volumeThicknessTexture=e})))),Promise.all(c).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},789(e,t,n){n.r(t),n.d(t,{KHR_mesh_quantization:()=>a});var r=n(4015),o="KHR_mesh_quantization",a=function(){function e(e){this.name=o,this.enabled=e.isExtensionUsed(o)}return e.prototype.dispose=function(){},e}();(0,r.Hg)(o),(0,r.Ye)(o,!0,(function(e){return new a(e)}))},8875(e,t,n){n.r(t),n.d(t,{KHR_node_hoverability:()=>c});var r=n(8322),o=n(4015),a=n(1943),i=n(8698),s="KHR_node_hoverability",l="targetMeshPointerOver_";(0,a.rO)("event/onHoverIn",s,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:function(e){return l+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s,u,c,f,d,h,p,m=o[o.length-1];m.config=m.config||{},m.config.glTF=i;var _=null===(c=null===(u=null===(s=e.configuration)||void 0===s?void 0:s.nodeIndex)||void 0===u?void 0:u.value)||void 0===c?void 0:c[0];if(void 0===_||"number"!=typeof _)throw new Error("nodeIndex not found in configuration");var g=l+_;return o[1].config.variable=g,a._userVariables[g]={className:"Mesh",id:null===(d=null===(f=null==i?void 0:i.nodes)||void 0===f?void 0:f[_]._babylonTransformNode)||void 0===d?void 0:d.id,uniqueId:null===(p=null===(h=null==i?void 0:i.nodes)||void 0===h?void 0:h[_]._babylonTransformNode)||void 0===p?void 0:p.uniqueId},o}});var u="targetMeshPointerOut_";(0,a.rO)("event/onHoverOut",s,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:function(e){return u+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s,l,c,f,d,h,p,m=o[o.length-1];m.config=m.config||{},m.config.glTF=i;var _=null===(c=null===(l=null===(s=e.configuration)||void 0===s?void 0:s.nodeIndex)||void 0===l?void 0:l.value)||void 0===c?void 0:c[0];if(void 0===_||"number"!=typeof _)throw new Error("nodeIndex not found in configuration");var g=u+_;return o[1].config.variable=g,a._userVariables[g]={className:"Mesh",id:null===(d=null===(f=null==i?void 0:i.nodes)||void 0===f?void 0:f[_]._babylonTransformNode)||void 0===d?void 0:d.id,uniqueId:null===(p=null===(h=null==i?void 0:i.nodes)||void 0===h?void 0:h[_]._babylonTransformNode)||void 0===p?void 0:p.uniqueId},o}}),(0,i.oR)("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:function(e){var t=e._babylonTransformNode;return!t||void 0===t.pointerOverDisableMeshTesting||t.pointerOverDisableMeshTesting},set:function(e,t){var n;null===(n=t._primitiveBabylonMeshes)||void 0===n||n.forEach((function(t){t.pointerOverDisableMeshTesting=!e}))},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"pointerOverDisableMeshTesting"}],type:"boolean"});var c=function(){function e(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}return e.prototype.onReady=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){return null===(e=this._loader.gltf.nodes)||void 0===e||e.forEach((function(e){var t,n,r;(null===(t=e.extensions)||void 0===t?void 0:t.KHR_node_hoverability)&&!1===(null===(n=e.extensions)||void 0===n?void 0:n.KHR_node_hoverability.hoverable)&&(null===(r=e._babylonTransformNode)||void 0===r||r.getChildMeshes().forEach((function(e){e.pointerOverDisableMeshTesting=!0})))})),[2]}))}))},e.prototype.dispose=function(){this._loader=null},e}();(0,o.Hg)(s),(0,o.Ye)(s,!0,(function(e){return new c(e)}))},6465(e,t,n){n.r(t),n.d(t,{KHR_node_selectability:()=>l});var r=n(8322),o=n(4015),a=n(1943),i=n(8698),s="KHR_node_selectability";(0,a.rO)("event/onSelect",s,{blocks:["FlowGraphMeshPickEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:function(e){return"pickedMesh_"+e}}},outputs:{values:{selectedNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"},selectionPoint:{name:"pickedPoint"},selectionRayOrigin:{name:"pickOrigin"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"asset",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"pickedMesh",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s,l,u,c,f,d,h,p=o[o.length-1];p.config=p.config||{},p.config.glTF=i;var m=null===(u=null===(l=null===(s=e.configuration)||void 0===s?void 0:s.nodeIndex)||void 0===l?void 0:l.value)||void 0===u?void 0:u[0];if(void 0===m||"number"!=typeof m)throw new Error("nodeIndex not found in configuration");var _="pickedMesh_"+m;return o[1].config.variable=_,a._userVariables[_]={className:"Mesh",id:null===(f=null===(c=null==i?void 0:i.nodes)||void 0===c?void 0:c[m]._babylonTransformNode)||void 0===f?void 0:f.id,uniqueId:null===(h=null===(d=null==i?void 0:i.nodes)||void 0===d?void 0:d[m]._babylonTransformNode)||void 0===h?void 0:h.uniqueId},o}}),(0,i.oR)("/nodes/{}/extensions/KHR_node_selectability/selectable",{get:function(e){var t=e._babylonTransformNode;return!t||void 0===t.isPickable||t.isPickable},set:function(e,t){var n;null===(n=t._primitiveBabylonMeshes)||void 0===n||n.forEach((function(t){t.isPickable=e}))},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"isPickable"}],type:"boolean"});var l=function(){function e(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}return e.prototype.onReady=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){return null===(e=this._loader.gltf.nodes)||void 0===e||e.forEach((function(e){var t,n,r;(null===(t=e.extensions)||void 0===t?void 0:t.KHR_node_selectability)&&!1===(null===(n=e.extensions)||void 0===n?void 0:n.KHR_node_selectability.selectable)&&(null===(r=e._babylonTransformNode)||void 0===r||r.getChildMeshes().forEach((function(e){e.isPickable=!1})))})),[2]}))}))},e.prototype.dispose=function(){this._loader=null},e}();(0,o.Hg)(s),(0,o.Ye)(s,!0,(function(e){return new l(e)}))},947(e,t,n){n.r(t),n.d(t,{KHR_node_visibility:()=>i});var r=n(4015),o=n(8698),a="KHR_node_visibility";(0,o.oR)("/nodes/{}/extensions/KHR_node_visibility/visible",{get:function(e){var t=e._babylonTransformNode;return!t||void 0===t.isVisible||t.isVisible},set:function(e,t){var n,r;null===(n=t._primitiveBabylonMeshes)||void 0===n||n.forEach((function(e){e.inheritVisibility=!0})),t._babylonTransformNode&&(t._babylonTransformNode.isVisible=e),null===(r=t._primitiveBabylonMeshes)||void 0===r||r.forEach((function(t){t.isVisible=e}))},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"isVisible"}],type:"boolean"});var i=function(){function e(e){this.name=a,this._loader=e,this.enabled=e.isExtensionUsed(a)}return e.prototype.onReady=function(){if(this._loader){var e=this._loader.gltf.nodes;if(e)for(var t=0,n=e;t<n.length;t++){var r=n[t],o=r._babylonTransformNode;o&&(o.inheritVisibility=!0,r.extensions&&r.extensions.KHR_node_visibility&&!1===r.extensions.KHR_node_visibility.visible&&(o.isVisible=!1))}}},e.prototype.dispose=function(){delete this._loader},e}();(0,r.Hg)(a),(0,r.Ye)(a,!0,(function(e){return new i(e)}))},5873(e,t,n){n.r(t),n.d(t,{KHR_texture_basisu:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_texture_basisu",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(a,void 0,void 0,(function(){var a,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a=null==t.sampler?o.GLTFLoader.DefaultSampler:o.ArrayItem.Get("".concat(e,"/sampler"),this._loader.gltf.samplers,t.sampler),l=o.ArrayItem.Get("".concat(i,"/source"),this._loader.gltf.images,s.source),[4,this._loader._createTextureAsync(e,a,l,(function(e){n(e)}),t._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!t._textureInfo.nonColorData)];case 1:return[2,r.sent()]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},410(e,t,n){n.r(t),n.d(t,{KHR_texture_transform:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_texture_transform",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadTextureInfoAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,s){return(0,r.sH)(i,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadTextureInfoAsync(e,t,(function(e){if(!(e instanceof o.Texture))throw new Error("".concat(a,": Texture type not supported"));s.offset&&(e.uOffset=s.offset[0],e.vOffset=s.offset[1]),e.uRotationCenter=0,e.vRotationCenter=0,s.rotation&&(e.wAng=-s.rotation),s.scale&&(e.uScale=s.scale[0],e.vScale=s.scale[1]),null!=s.texCoord&&(e.coordinatesIndex=s.texCoord),n(e)}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5299(e,t,n){n.r(t),n.d(t,{KHR_xmp_json_ld:()=>a});var r=n(4015),o="KHR_xmp_json_ld",a=function(){function e(e){this.name=o,this.order=100,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.onLoading=function(){var e,t,n;if(null!==this._loader.rootBabylonMesh){var r=null===(e=this._loader.gltf.extensions)||void 0===e?void 0:e.KHR_xmp_json_ld,o=null===(n=null===(t=this._loader.gltf.asset)||void 0===t?void 0:t.extensions)||void 0===n?void 0:n.KHR_xmp_json_ld;if(r&&o){var a=+o.packet;r.packets&&a<r.packets.length&&(this._loader.rootBabylonMesh.metadata=this._loader.rootBabylonMesh.metadata||{},this._loader.rootBabylonMesh.metadata.xmp=r.packets[a])}}},e}();(0,r.Hg)(o),(0,r.Ye)(o,!0,(function(e){return new a(e)}))},3218(e,t,n){n.r(t),n.d(t,{MSFT_audio_emitter:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="MSFT_audio_emitter",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,this._clips=null,this._emitters=null},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._clips=t.clips,this._emitters=t.emitters,a.ArrayItem.Assign(this._clips),a.ArrayItem.Assign(this._emitters)}},e.prototype.loadSceneAsync=function(e,t){var n=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(n,void 0,void 0,(function(){var n,s,l,u,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:for((n=new Array).push(this._loader.loadSceneAsync(e,t)),s=0,l=i.emitters;s<l.length;s++){if(u=l[s],null!=(c=a.ArrayItem.Get("".concat(o,"/emitters"),this._emitters,u)).refDistance||null!=c.maxDistance||null!=c.rolloffFactor||null!=c.distanceModel||null!=c.innerAngle||null!=c.outerAngle)throw new Error("".concat(o,": Direction or Distance properties are not allowed on emitters attached to a scene"));n.push(this._loadEmitterAsync("".concat(o,"/emitters/").concat(c.index),c))}return[4,Promise.all(n)];case 1:return r.sent(),[2]}}))}))}))},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,s){return(0,r.sH)(i,void 0,void 0,(function(){var i,l,u=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=new Array,[4,this._loader.loadNodeAsync(e,t,(function(t){for(var r=function(n){var r=a.ArrayItem.Get("".concat(e,"/emitters"),u._emitters,n);i.push(u._loadEmitterAsync("".concat(e,"/emitters/").concat(r.index),r).then((function(){for(var e=0,n=r._babylonSounds;e<n.length;e++){var a=n[e];a.attachToMesh(t),null==r.innerAngle&&null==r.outerAngle||(a.setLocalDirectionToMesh(o.Vector3.Forward()),a.setDirectionalCone(2*o.Tools.ToDegrees(null==r.innerAngle?Math.PI:r.innerAngle),2*o.Tools.ToDegrees(null==r.outerAngle?Math.PI:r.outerAngle),0))}})))},l=0,c=s.emitters;l<c.length;l++)r(c[l]);n(t)}))];case 1:return l=r.sent(),[4,Promise.all(i)];case 2:return r.sent(),[2,l]}}))}))}))},e.prototype.loadAnimationAsync=function(e,t){var n=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(n,void 0,void 0,(function(){var n,s,l,u,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadAnimationAsync(e,t)];case 1:for(n=r.sent(),s=new Array,a.ArrayItem.Assign(i.events),l=0,u=i.events;l<u.length;l++)c=u[l],s.push(this._loadAnimationEventAsync("".concat(o,"/events/").concat(c.index),e,t,c,n));return[4,Promise.all(s)];case 2:return r.sent(),[2,n]}}))}))}))},e.prototype._loadClipAsync=function(e,t){if(t._objectURL)return t._objectURL;var n;if(t.uri)n=this._loader.loadUriAsync(e,t,t.uri);else{var r=a.ArrayItem.Get("".concat(e,"/bufferView"),this._loader.gltf.bufferViews,t.bufferView);n=this._loader.loadBufferViewAsync("/bufferViews/".concat(r.index),r)}return t._objectURL=n.then((function(e){var n=(0,o.GetBlobBufferSource)(e);return URL.createObjectURL(new Blob([n],{type:t.mimeType}))})),t._objectURL},e.prototype._loadEmitterAsync=function(e,t){var n=this;if(t._babylonSounds=t._babylonSounds||[],!t._babylonData){for(var r=new Array,i=t.name||"emitter".concat(t.index),s={loop:!1,autoplay:!1,volume:null==t.volume?1:t.volume},l=function(e){var l="/extensions/".concat(u.name,"/clips"),c=a.ArrayItem.Get(l,u._clips,t.clips[e].clip);r.push(u._loadClipAsync("".concat(l,"/").concat(t.clips[e].clip),c).then((function(r){var a=t._babylonSounds[e]=new o.Sound(i,r,n._loader.babylonScene,null,s);a.refDistance=t.refDistance||1,a.maxDistance=t.maxDistance||256,a.rolloffFactor=t.rolloffFactor||1,a.distanceModel=t.distanceModel||"exponential"})))},u=this,c=0;c<t.clips.length;c++)l(c);var f=Promise.all(r).then((function(){var e=t.clips.map((function(e){return e.weight||1})),n=new o.WeightedSound(t.loop||!1,t._babylonSounds,e);t.innerAngle&&(n.directionalConeInnerAngle=2*o.Tools.ToDegrees(t.innerAngle)),t.outerAngle&&(n.directionalConeOuterAngle=2*o.Tools.ToDegrees(t.outerAngle)),t.volume&&(n.volume=t.volume),t._babylonData.sound=n}));t._babylonData={loaded:f}}return t._babylonData.loaded},e.prototype._getEventAction=function(e,t,n,r,o){switch(n){case"play":return function(e){var n=(o||0)+(e-r);t.play(n)};case"stop":return function(){t.stop()};case"pause":return function(){t.pause()};default:throw new Error("".concat(e,": Unsupported action ").concat(n))}},e.prototype._loadAnimationEventAsync=function(e,t,n,r,i){var s=this;if(0==i.targetedAnimations.length)return Promise.resolve();var l=i.targetedAnimations[0],u=r.emitter,c=a.ArrayItem.Get("/extensions/".concat(this.name,"/emitters"),this._emitters,u);return this._loadEmitterAsync(e,c).then((function(){var t=c._babylonData.sound;if(t){var n=new o.AnimationEvent(r.time,s._getEventAction(e,t,r.action,r.time,r.startOffset));l.animation.addEvent(n),i.onAnimationGroupEndObservable.add((function(){t.stop()})),i.onAnimationGroupPauseObservable.add((function(){t.pause()}))}}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},2658(e,t,n){n.r(t),n.d(t,{MSFT_lod:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="MSFT_lod",l=function(){function e(e){var t,n;this.name=s,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new o.Observable,this.onMaterialLODsLoadedObservable=new o.Observable,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.maxLODsToLoad=null!==(n=null===(t=this._loader.parent.extensionOptions[s])||void 0===t?void 0:t.maxLODsToLoad)&&void 0!==n?n:this.maxLODsToLoad,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()},e.prototype.onReady=function(){for(var e=this,t=function(t){var r=Promise.all(n._nodePromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Node LOD ".concat(t)),e._loader.log("Loaded node LOD ".concat(t))),e.onNodeLODsLoadedObservable.notifyObservers(t),t!==e._nodePromiseLODs.length-1&&(e._loader.startPerformanceCounter("Node LOD ".concat(t+1)),e._loadBufferLOD(e._nodeBufferLODs,t+1),e._nodeSignalLODs[t]&&e._nodeSignalLODs[t].resolve())}));n._loader._completePromises.push(r)},n=this,r=0;r<this._nodePromiseLODs.length;r++)t(r);var o=function(t){var n=Promise.all(a._materialPromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Material LOD ".concat(t)),e._loader.log("Loaded material LOD ".concat(t))),e.onMaterialLODsLoadedObservable.notifyObservers(t),t!==e._materialPromiseLODs.length-1&&(e._loader.startPerformanceCounter("Material LOD ".concat(t+1)),e._loadBufferLOD(e._materialBufferLODs,t+1),e._materialSignalLODs[t]&&e._materialSignalLODs[t].resolve())}));a._loader._completePromises.push(n)},a=this;for(r=0;r<this._materialPromiseLODs.length;r++)o(r)},e.prototype.loadSceneAsync=function(e,t){var n=this._loader.loadSceneAsync(e,t);return this._loadBufferLOD(this._bufferLODs,0),n},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,a){return(0,r.sH)(i,void 0,void 0,(function(){var i,s,l,u,c,f=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:for(s=this._getLODs(e,t,this._loader.gltf.nodes,a.ids),this._loader.logOpen("".concat(e)),l=function(e){var t=s[e];0!==e&&(u._nodeIndexLOD=e,u._nodeSignalLODs[e]=u._nodeSignalLODs[e]||new o.Deferred);var r=u._loader.loadNodeAsync("/nodes/".concat(t.index),t,(function(e){n(e),e.setEnabled(!1)})).then((function(t){if(0!==e){var n=s[e-1];n._babylonTransformNode&&(f._disposeTransformNode(n._babylonTransformNode),delete n._babylonTransformNode)}return t.setEnabled(!0),t}));u._nodePromiseLODs[e]=u._nodePromiseLODs[e]||[],0===e?i=r:(u._nodeIndexLOD=null,u._nodePromiseLODs[e].push(r))},u=this,c=0;c<s.length;c++)l(c);return this._loader.logClose(),[4,i];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadMaterialAsync=function(e,t,n,o,i){var s=this;return this._nodeIndexLOD?null:a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,a){return(0,r.sH)(s,void 0,void 0,(function(){var s,l,u,c,f,d=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:for(l=this._getLODs(e,t,this._loader.gltf.materials,a.ids),this._loader.logOpen("".concat(e)),u=function(e){var t=l[e];0!==e&&(c._materialIndexLOD=e);var r=c._loader._loadMaterialAsync("/materials/".concat(t.index),t,n,o,(function(t){0===e&&i(t)})).then((function(t){if(0!==e){i(t);var n=l[e-1]._data;n[o]&&(d._disposeMaterials([n[o].babylonMaterial]),delete n[o])}return t}));c._materialPromiseLODs[e]=c._materialPromiseLODs[e]||[],0===e?s=r:(c._materialIndexLOD=null,c._materialPromiseLODs[e].push(r))},c=this,f=0;f<l.length;f++)u(f);return this._loader.logClose(),[4,s];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadUriAsync=function(e,t,n){var a=this;if(null!==this._nodeIndexLOD){this._loader.log("deferred");var i=this._nodeIndexLOD-1;return this._nodeSignalLODs[i]=this._nodeSignalLODs[i]||new o.Deferred,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then((function(){return(0,r.sH)(a,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadUriAsync(e,t,n)];case 1:return[2,r.sent()]}}))}))}))}return null!==this._materialIndexLOD?(this._loader.log("deferred"),i=this._materialIndexLOD-1,this._materialSignalLODs[i]=this._materialSignalLODs[i]||new o.Deferred,this._materialSignalLODs[i].promise.then((function(){return(0,r.sH)(a,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadUriAsync(e,t,n)];case 1:return[2,r.sent()]}}))}))}))):null},e.prototype.loadBufferAsync=function(e,t,n,a){var i=this;if(this._loader.parent.useRangeRequests&&!t.uri){if(!this._loader.bin)throw new Error("".concat(e,": Uri is missing or the binary glTF is missing its binary chunk"));var s=function(e,t){return(0,r.sH)(i,void 0,void 0,(function(){var i,s,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return s=(i=n)+a-1,(l=e[t])?(l.start=Math.min(l.start,i),l.end=Math.max(l.end,s)):(l={start:i,end:s,loaded:new o.Deferred},e[t]=l),[4,l.loaded.promise.then((function(e){return new Uint8Array(e.buffer,e.byteOffset+n-l.start,a)}))];case 1:return[2,r.sent()]}}))}))};return this._loader.log("deferred"),null!==this._nodeIndexLOD?s(this._nodeBufferLODs,this._nodeIndexLOD):null!==this._materialIndexLOD?s(this._materialBufferLODs,this._materialIndexLOD):s(this._bufferLODs,0)}return null},e.prototype._loadBufferLOD=function(e,t){var n=e[t];n&&(this._loader.log("Loading buffer range [".concat(n.start,"-").concat(n.end,"]")),this._loader.bin.readAsync(n.start,n.end-n.start+1).then((function(e){n.loaded.resolve(e)}),(function(e){n.loaded.reject(e)})))},e.prototype._getLODs=function(e,t,n,r){if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");for(var o=[],i=r.length-1;i>=0;i--)if(o.push(a.ArrayItem.Get("".concat(e,"/ids/").concat(r[i]),n,r[i])),o.length===this.maxLODsToLoad)return o;return o.push(t),o},e.prototype._disposeTransformNode=function(e){var t=this,n=[],r=e.material;r&&n.push(r);for(var o=0,a=e.getChildMeshes();o<a.length;o++){var i=a[o];i.material&&n.push(i.material)}e.dispose();var s=n.filter((function(e){return t._loader.babylonScene.meshes.every((function(t){return t.material!=e}))}));this._disposeMaterials(s)},e.prototype._disposeMaterials=function(e){for(var t={},n=0,r=e;n<r.length;n++){for(var o=0,a=(c=r[n]).getActiveTextures();o<a.length;o++){var i=a[o];t[i.uniqueId]=i}c.dispose()}for(var s in t)for(var l=0,u=this._loader.babylonScene.materials;l<u.length;l++){var c;(c=u[l]).hasTexture(t[s])&&delete t[s]}for(var s in t)t[s].dispose()},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},4439(e,t,n){n.r(t),n.d(t,{MSFT_minecraftMesh:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="MSFT_minecraftMesh",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if(!i)return[3,2];if(!this._loader._pbrMaterialImpl)throw new Error("".concat(o,": Material type not supported"));return a=this._loader.loadMaterialPropertiesAsync(e,t,n),n.needAlphaBlending()&&(n.forceDepthWrite=!0,n.separateCullingPass=!0),n.backFaceCulling=n.forceDepthWrite,n.twoSidedLighting=!0,[4,a];case 1:return[2,r.sent()];case 2:return[2]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},6629(e,t,n){n.r(t),n.d(t,{MSFT_sRGBFactors:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="MSFT_sRGBFactors",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var o,a,s;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i?(o=this._loader._getOrCreateMaterialAdapter(n),a=this._loader.loadMaterialPropertiesAsync(e,t,n),s=n.getScene().getEngine().useExactSrgbConversions,o.baseColorTexture||o.baseColor.toLinearSpaceToRef(o.baseColor,s),o.specularColorTexture||o.specularColor.toLinearSpaceToRef(o.specularColor,s),[4,a]):[3,2];case 1:return[2,r.sent()];case 2:return[2]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8698(e,t,n){n.d(t,{oR:()=>h,tQ:()=>f,Wt:()=>c,ZU:()=>d});var r=n(5597),o=[{regex:new RegExp("^/nodes/\\d+/extensions/")}],a=function(){function e(e,t){this._gltf=e,this._infoTree=t}return e.prototype.convert=function(e){var t=this._gltf,n=this._infoTree,r=void 0;if(!e.startsWith("/"))throw new Error("Path must start with a /");var a=e.split("/");if(a.shift(),a[a.length-1].includes(".length")){var i=a[a.length-1].split(".");a.pop(),a.push.apply(a,i)}for(var s=!1,l=0,u=a;l<u.length;l++){var c=u[l],f="length"===c;if(f&&!n.__array__)throw new Error("Path ".concat(e," is invalid"));if(n.__ignoreObjectTree__&&(s=!0),n.__array__&&!f)n=n.__array__;else if(!(n=n[c]))throw new Error("Path ".concat(e," is invalid"));if(!s)if(void 0===t){if(!o.find((function(t){return t.regex.test(e)})))throw new Error("Path ".concat(e," is invalid"))}else f||(t=null==t?void 0:t[c]);(n.__target__||f)&&(r=t)}return{object:r,info:n}},e}();function i(e,t,n,r){var o=s(e);return r?o[n][r]:o[n]}function s(e,t,n){var o,a,i;return null===(i=null===(o=e._data)||void 0===o?void 0:o[null!==(a=null==n?void 0:n.fillMode)&&void 0!==a?a:r.Constants.MATERIAL_TriangleFillMode])||void 0===i?void 0:i.babylonMaterial}function l(e,t){return{offset:{componentsCount:2,type:"Vector2",get:function(n,o,a){var s=i(n,0,e,t);return new r.Vector2(null==s?void 0:s.uOffset,null==s?void 0:s.vOffset)},getTarget:s,set:function(n,r,o,a){var s=i(r,0,e,t);s.uOffset=n.x,s.vOffset=n.y},getPropertyName:[function(){return"".concat(e).concat(t?"."+t:"",".uOffset")},function(){return"".concat(e).concat(t?"."+t:"",".vOffset")}]},rotation:{type:"number",get:function(n,r,o){var a;return null===(a=i(n,0,e,t))||void 0===a?void 0:a.wAng},getTarget:s,set:function(n,r,o,a){return i(r,0,e,t).wAng=n},getPropertyName:[function(){return"".concat(e).concat(t?"."+t:"",".wAng")}]},scale:{componentsCount:2,type:"Vector2",get:function(n,o,a){var s=i(n,0,e,t);return new r.Vector2(null==s?void 0:s.uScale,null==s?void 0:s.vScale)},getTarget:s,set:function(n,r,o,a){var s=i(r,0,e,t);s.uScale=n.x,s.vScale=n.y},getPropertyName:[function(){return"".concat(e).concat(t?"."+t:"",".uScale")},function(){return"".concat(e).concat(t?"."+t:"",".vScale")}]}}}var u={cameras:{__array__:{__target__:!0,orthographic:{xmag:{componentsCount:2,type:"Vector2",get:function(e){var t,n,o,a;return new r.Vector2(null!==(n=null===(t=e._babylonCamera)||void 0===t?void 0:t.orthoLeft)&&void 0!==n?n:0,null!==(a=null===(o=e._babylonCamera)||void 0===o?void 0:o.orthoRight)&&void 0!==a?a:0)},set:function(e,t){t._babylonCamera&&(t._babylonCamera.orthoLeft=e.x,t._babylonCamera.orthoRight=e.y)},getTarget:function(e){return e},getPropertyName:[function(){return"orthoLeft"},function(){return"orthoRight"}]},ymag:{componentsCount:2,type:"Vector2",get:function(e){var t,n,o,a;return new r.Vector2(null!==(n=null===(t=e._babylonCamera)||void 0===t?void 0:t.orthoBottom)&&void 0!==n?n:0,null!==(a=null===(o=e._babylonCamera)||void 0===o?void 0:o.orthoTop)&&void 0!==a?a:0)},set:function(e,t){t._babylonCamera&&(t._babylonCamera.orthoBottom=e.x,t._babylonCamera.orthoTop=e.y)},getTarget:function(e){return e},getPropertyName:[function(){return"orthoBottom"},function(){return"orthoTop"}]},zfar:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.maxZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"maxZ"}]},znear:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.minZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"minZ"}]}},perspective:{aspectRatio:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.getEngine().getAspectRatio(e._babylonCamera)},getTarget:function(e){return e},getPropertyName:[function(){return"aspectRatio"}],isReadOnly:!0},yfov:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.fov},set:function(e,t){t._babylonCamera&&(t._babylonCamera.fov=e)},getTarget:function(e){return e},getPropertyName:[function(){return"fov"}]},zfar:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.maxZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"maxZ"}]},znear:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.minZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"minZ"}]}}}},nodes:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonTransformNode}))},getPropertyName:[function(){return"length"}]},__array__:{__target__:!0,translation:{type:"Vector3",get:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.position},set:function(e,t){var n;return null===(n=t._babylonTransformNode)||void 0===n?void 0:n.position.copyFrom(e)},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"position"}]},rotation:{type:"Quaternion",get:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.rotationQuaternion},set:function(e,t){var n,r;return null===(r=null===(n=t._babylonTransformNode)||void 0===n?void 0:n.rotationQuaternion)||void 0===r?void 0:r.copyFrom(e)},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"rotationQuaternion"}]},scale:{type:"Vector3",get:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.scaling},set:function(e,t){var n;return null===(n=t._babylonTransformNode)||void 0===n?void 0:n.scaling.copyFrom(e)},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"scaling"}]},weights:{length:{type:"number",get:function(e){return e._numMorphTargets},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"influence"}]},__array__:{__target__:!0,type:"number",get:function(e,t){var n,r;return void 0!==t?null===(r=null===(n=e._primitiveBabylonMeshes)||void 0===n?void 0:n[0].morphTargetManager)||void 0===r?void 0:r.getTarget(t).influence:void 0},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"influence"}]},type:"number[]",get:function(e,t){return[0]},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"influence"}]},matrix:{type:"Matrix",get:function(e){var t,n,o;return r.Matrix.Compose(null===(t=e._babylonTransformNode)||void 0===t?void 0:t.scaling,null===(n=e._babylonTransformNode)||void 0===n?void 0:n.rotationQuaternion,null===(o=e._babylonTransformNode)||void 0===o?void 0:o.position)},getTarget:function(e){return e._babylonTransformNode},isReadOnly:!0},globalMatrix:{type:"Matrix",get:function(e){for(var t,n,o,a,i,s,l,u=r.Matrix.Identity(),c=e.parent;c&&c.parent;)c=c.parent;var f=(null===(t=e._babylonTransformNode)||void 0===t?void 0:t.position._isDirty)||(null===(o=null===(n=e._babylonTransformNode)||void 0===n?void 0:n.rotationQuaternion)||void 0===o?void 0:o._isDirty)||(null===(a=e._babylonTransformNode)||void 0===a?void 0:a.scaling._isDirty);if(c){var d=null===(i=c._babylonTransformNode)||void 0===i?void 0:i.computeWorldMatrix(!0).invert();d&&(null===(l=null===(s=e._babylonTransformNode)||void 0===s?void 0:s.computeWorldMatrix(f))||void 0===l||l.multiplyToRef(d,u))}else e._babylonTransformNode&&u.copyFrom(e._babylonTransformNode.computeWorldMatrix(f));return u},getTarget:function(e){return e._babylonTransformNode},isReadOnly:!0},extensions:{EXT_lights_ies:{multiplier:{type:"number",get:function(e){var t,n;return null===(n=null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0])||void 0===n?void 0:n.intensity},getTarget:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0]},set:function(e,t){if(t._babylonTransformNode){var n=t._babylonTransformNode.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0];n&&(n.intensity=e)}}},color:{type:"Color3",get:function(e){var t,n;return null===(n=null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0])||void 0===n?void 0:n.diffuse},getTarget:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0]},set:function(e,t){if(t._babylonTransformNode){var n=t._babylonTransformNode.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0];n&&(n.diffuse=e)}}}},KHR_node_visibility:{visible:{type:"boolean",get:function(e){return!!e._primitiveBabylonMeshes&&e._primitiveBabylonMeshes[0].isVisible},getTarget:function(){},set:function(e,t){t._primitiveBabylonMeshes&&t._primitiveBabylonMeshes.forEach((function(t){return t.isVisible=e}))}}}}}},materials:{__array__:{__target__:!0,emissiveFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).emissiveColor},set:function(e,t,n,r){return s(t,0,r).emissiveColor.copyFrom(e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"emissiveColor"}]},emissiveTexture:{extensions:{KHR_texture_transform:l("emissiveTexture")}},normalTexture:{scale:{type:"number",get:function(e,t,n){var r;return null===(r=i(e,0,"bumpTexture"))||void 0===r?void 0:r.level},set:function(e,t,n,r){var o=i(t,0,"bumpTexture");o&&(o.level=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"level"}]},extensions:{KHR_texture_transform:l("bumpTexture")}},occlusionTexture:{strength:{type:"number",get:function(e,t,n){return s(e,0,n).ambientTextureStrength},set:function(e,t,n,r){var o=s(t,0,r);o&&(o.ambientTextureStrength=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"ambientTextureStrength"}]},extensions:{KHR_texture_transform:l("ambientTexture")}},pbrMetallicRoughness:{baseColorFactor:{type:"Color4",get:function(e,t,n){var o=s(e,0,n);return r.Color4.FromColor3(o.albedoColor,o.alpha)},set:function(e,t,n,r){var o=s(t,0,r);o.albedoColor.set(e.r,e.g,e.b),o.alpha=e.a},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"albedoColor"},function(){return"alpha"}]},baseColorTexture:{extensions:{KHR_texture_transform:l("albedoTexture")}},metallicFactor:{type:"number",get:function(e,t,n){return s(e,0,n).metallic},set:function(e,t,n,r){var o=s(t,0,r);o&&(o.metallic=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"metallic"}]},roughnessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).roughness},set:function(e,t,n,r){var o=s(t,0,r);o&&(o.roughness=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"roughness"}]},metallicRoughnessTexture:{extensions:{KHR_texture_transform:l("metallicTexture")}}},extensions:{KHR_materials_anisotropy:{anisotropyStrength:{type:"number",get:function(e,t,n){return s(e,0,n).anisotropy.intensity},set:function(e,t,n,r){s(t,0,r).anisotropy.intensity=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"anisotropy.intensity"}]},anisotropyRotation:{type:"number",get:function(e,t,n){return s(e,0,n).anisotropy.angle},set:function(e,t,n,r){s(t,0,r).anisotropy.angle=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"anisotropy.angle"}]},anisotropyTexture:{extensions:{KHR_texture_transform:l("anisotropy","texture")}}},KHR_materials_clearcoat:{clearcoatFactor:{type:"number",get:function(e,t,n){return s(e,0,n).clearCoat.intensity},set:function(e,t,n,r){s(t,0,r).clearCoat.intensity=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"clearCoat.intensity"}]},clearcoatRoughnessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).clearCoat.roughness},set:function(e,t,n,r){s(t,0,r).clearCoat.roughness=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"clearCoat.roughness"}]},clearcoatTexture:{extensions:{KHR_texture_transform:l("clearCoat","texture")}},clearcoatNormalTexture:{scale:{type:"number",get:function(e,t,n){var r;return null===(r=s(e,0,n).clearCoat.bumpTexture)||void 0===r?void 0:r.level},getTarget:s,set:function(e,t,n,r){return s(t,0,r).clearCoat.bumpTexture.level=e}},extensions:{KHR_texture_transform:l("clearCoat","bumpTexture")}},clearcoatRoughnessTexture:{extensions:{KHR_texture_transform:l("clearCoat","textureRoughness")}}},KHR_materials_dispersion:{dispersion:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.dispersion},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.dispersion=e}}},KHR_materials_emissive_strength:{emissiveStrength:{type:"number",get:function(e,t,n){return s(e,0,n).emissiveIntensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).emissiveIntensity=e}}},KHR_materials_ior:{ior:{type:"number",get:function(e,t,n){return s(e,0,n).indexOfRefraction},getTarget:s,set:function(e,t,n,r){return s(t,0,r).indexOfRefraction=e}}},KHR_materials_iridescence:{iridescenceFactor:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.intensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.intensity=e}},iridescenceIor:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.indexOfRefraction},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.indexOfRefraction=e}},iridescenceTexture:{extensions:{KHR_texture_transform:l("iridescence","texture")}},iridescenceThicknessMaximum:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.maximumThickness},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.maximumThickness=e}},iridescenceThicknessMinimum:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.minimumThickness},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.minimumThickness=e}},iridescenceThicknessTexture:{extensions:{KHR_texture_transform:l("iridescence","thicknessTexture")}}},KHR_materials_sheen:{sheenColorFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).sheen.color},getTarget:s,set:function(e,t,n,r){return s(t,0,r).sheen.color.copyFrom(e)}},sheenColorTexture:{extensions:{KHR_texture_transform:l("sheen","texture")}},sheenRoughnessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).sheen.intensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).sheen.intensity=e}},sheenRoughnessTexture:{extensions:{KHR_texture_transform:l("sheen","thicknessTexture")}}},KHR_materials_specular:{specularFactor:{type:"number",get:function(e,t,n){return s(e,0,n).metallicF0Factor},getTarget:s,set:function(e,t,n,r){return s(t,0,r).metallicF0Factor=e},getPropertyName:[function(){return"metallicF0Factor"}]},specularColorFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).metallicReflectanceColor},getTarget:s,set:function(e,t,n,r){return s(t,0,r).metallicReflectanceColor.copyFrom(e)},getPropertyName:[function(){return"metallicReflectanceColor"}]},specularTexture:{extensions:{KHR_texture_transform:l("metallicReflectanceTexture")}},specularColorTexture:{extensions:{KHR_texture_transform:l("reflectanceTexture")}}},KHR_materials_transmission:{transmissionFactor:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.refractionIntensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.refractionIntensity=e},getPropertyName:[function(){return"subSurface.refractionIntensity"}]},transmissionTexture:{extensions:{KHR_texture_transform:l("subSurface","refractionIntensityTexture")}}},KHR_materials_diffuse_transmission:{diffuseTransmissionFactor:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.translucencyIntensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.translucencyIntensity=e}},diffuseTransmissionTexture:{extensions:{KHR_texture_transform:l("subSurface","translucencyIntensityTexture")}},diffuseTransmissionColorFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).subSurface.translucencyColor},getTarget:s,set:function(e,t,n,r){var o;return e&&(null===(o=s(t,0,r).subSurface.translucencyColor)||void 0===o?void 0:o.copyFrom(e))}},diffuseTransmissionColorTexture:{extensions:{KHR_texture_transform:l("subSurface","translucencyColorTexture")}}},KHR_materials_volume:{attenuationColor:{type:"Color3",get:function(e,t,n){return s(e,0,n).subSurface.tintColor},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.tintColor.copyFrom(e)}},attenuationDistance:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.tintColorAtDistance},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.tintColorAtDistance=e}},thicknessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.maximumThickness},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.maximumThickness=e}},thicknessTexture:{extensions:{KHR_texture_transform:l("subSurface","thicknessTexture")}}}}}},extensions:{KHR_lights_punctual:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonLight}))},getPropertyName:[function(e){return"length"}]},__array__:{__target__:!0,color:{type:"Color3",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.diffuse},set:function(e,t){var n;return null===(n=t._babylonLight)||void 0===n?void 0:n.diffuse.copyFrom(e)},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"diffuse"}]},intensity:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.intensity},set:function(e,t){return t._babylonLight?t._babylonLight.intensity=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"intensity"}]},range:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.range},set:function(e,t){return t._babylonLight?t._babylonLight.range=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"range"}]},spot:{innerConeAngle:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.innerAngle},set:function(e,t){return t._babylonLight?t._babylonLight.innerAngle=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"innerConeAngle"}]},outerConeAngle:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.angle},set:function(e,t){return t._babylonLight?t._babylonLight.angle=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"outerConeAngle"}]}}}}},EXT_lights_area:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonLight}))},getPropertyName:[function(e){return"length"}]},__array__:{__target__:!0,color:{type:"Color3",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.diffuse},set:function(e,t){var n;return null===(n=t._babylonLight)||void 0===n?void 0:n.diffuse.copyFrom(e)},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"diffuse"}]},intensity:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.intensity},set:function(e,t){return t._babylonLight?t._babylonLight.intensity=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"intensity"}]},size:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.height},set:function(e,t){return t._babylonLight?t._babylonLight.height=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"size"}]},rect:{aspect:{type:"number",get:function(e){var t,n;return(null===(t=e._babylonLight)||void 0===t?void 0:t.width)/(null===(n=e._babylonLight)||void 0===n?void 0:n.height)},set:function(e,t){return t._babylonLight?t._babylonLight.width=e*t._babylonLight.height:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"aspect"}]}}}}},EXT_lights_ies:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonLight}))},getPropertyName:[function(e){return"length"}]}}},EXT_lights_image_based:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonTexture}))},getPropertyName:[function(e){return"length"}]},__array__:{__target__:!0,intensity:{type:"number",get:function(e){var t;return null===(t=e._babylonTexture)||void 0===t?void 0:t.level},set:function(e,t){t._babylonTexture&&(t._babylonTexture.level=e)},getTarget:function(e){return e._babylonTexture}},rotation:{type:"Quaternion",get:function(e){var t;return e._babylonTexture&&r.Quaternion.FromRotationMatrix(null===(t=e._babylonTexture)||void 0===t?void 0:t.getReflectionTextureMatrix())},set:function(e,t){var n;t._babylonTexture&&((null===(n=t._babylonTexture.getScene())||void 0===n?void 0:n.useRightHandedSystem)||(e=r.Quaternion.Inverse(e)),r.Matrix.FromQuaternionToRef(e,t._babylonTexture.getReflectionTextureMatrix()))},getTarget:function(e){return e._babylonTexture}}}}}},animations:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonAnimationGroup}))},getPropertyName:[function(){return"length"}]},__array__:{}},meshes:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){var t;return null===(t=e.primitives[0]._instanceData)||void 0===t?void 0:t.babylonSourceMesh}))},getPropertyName:[function(){return"length"}]},__array__:{}}};function c(e){return new a(e,u)}function f(e){for(var t=e.split("/").map((function(e){return e.replace(/{}/g,"__array__")})),n=u,r=0,o=t;r<o.length;r++){var a=o[r];a&&(n=n[a])}if(n&&n.type&&n.get)return n}function d(e,t){for(var n=e.split("/").map((function(e){return e.replace(/{}/g,"__array__")})),r=u,o=0,a=n;o<a.length;o++){var i=a[o];i&&(r=r[i])}r&&r.type&&r.get&&(r.interpolation=t)}function h(e,t){for(var n=e.split("/").map((function(e){return e.replace(/{}/g,"__array__")})),r=u,o=0,a=n;o<a.length;o++){var i=a[o];if(i){if(!r[i]){if("?"===i){r.__ignoreObjectTree__=!0;continue}r[i]={},"__array__"===i&&(r[i].__target__=!0)}r=r[i]}}Object.assign(r,t)}},8625(e,t,n){n.r(t),n.d(t,{ArrayItem:()=>c,GLTFFileLoader:()=>a.GLTFFileLoader,GLTFLoader:()=>d,LoadBoundingInfoFromPositionAccessor:()=>f});var r=n(8322),o=n(5597),a=n(6086),i=n(4015),s=n(8698),l=new o.Lazy((function(){return Promise.resolve().then(n.t.bind(n,5597,23))})),u=new o.Lazy((function(){return Promise.resolve().then(n.bind(n,2727))})),c=function(){function e(){}return e.Get=function(e,t,n){if(!t||null==n||!t[n])throw new Error("".concat(e,": Failed to find index (").concat(n,")"));return t[n]},e.TryGet=function(e,t){return e&&null!=t&&e[t]?e[t]:null},e.Assign=function(e){if(e)for(var t=0;t<e.length;t++)e[t].index=t},e}();function f(e){if(e.min&&e.max){var t=e.min,n=e.max,r=o.TmpVectors.Vector3[0].copyFromFloats(t[0],t[1],t[2]),a=o.TmpVectors.Vector3[1].copyFromFloats(n[0],n[1],n[2]);if(e.normalized&&5126!==e.componentType){var i=1;switch(e.componentType){case 5120:i=127;break;case 5121:i=255;break;case 5122:i=32767;break;case 5123:i=65535}var s=1/i;r.scaleInPlace(s),a.scaleInPlace(s)}return new o.BoundingInfo(r,a)}return null}var d=function(){function e(e){this._completePromises=new Array,this._assetContainer=null,this._babylonLights=[],this._disableInstancedMesh=0,this._allMaterialsDirtyRequired=!1,this._skipStartAnimationStep=!1,this._extensions=new Array,this._disposed=!1,this._rootUrl=null,this._fileName=null,this._uniqueRootUrl=null,this._bin=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions=new Array,this._materialAdapterCache=new WeakMap,this._pbrMaterialImpl=null,this._parent=e}return e.prototype.isMatchingMaterialType=function(e){return!(!e||!this._pbrMaterialImpl)&&e instanceof this._pbrMaterialImpl.materialClass},e.RegisterExtension=function(e,t){(0,i.Ye)(e,!1,t)},e.UnregisterExtension=function(e){return(0,i.Hg)(e)},Object.defineProperty(e.prototype,"gltf",{get:function(){if(!this._gltf)throw new Error("glTF JSON is not available");return this._gltf},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bin",{get:function(){return this._bin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"babylonScene",{get:function(){if(!this._babylonScene)throw new Error("Scene is not available");return this._babylonScene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootBabylonMesh",{get:function(){return this._rootBabylonMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootUrl",{get:function(){return this._rootUrl},enumerable:!1,configurable:!0}),e.prototype._getOrCreateMaterialAdapter=function(e){var t=this._materialAdapterCache.get(e);if(!t){if(!this._pbrMaterialImpl)throw new Error("Appropriate material adapter class not found");t=new this._pbrMaterialImpl.adapterClass(e),this._materialAdapterCache.set(e,t)}return t},e.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._completePromises.length=0,this._extensions.forEach((function(e){return e.dispose&&e.dispose()})),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())},e.prototype.importMeshAsync=function(e,t,n,o,a,i){return(0,r.sH)(this,arguments,void 0,(function(e,t,n,o,a,i,s){var l=this;return void 0===s&&(s=""),(0,r.YH)(this,(function(i){switch(i.label){case 0:return[4,Promise.resolve().then((function(){return(0,r.sH)(l,void 0,void 0,(function(){var i,l,u,c,f,d=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if(this._babylonScene=t,this._assetContainer=n,this._loadData(o),i=null,e){if(l={},this._gltf.nodes)for(u=0,c=this._gltf.nodes;u<c.length;u++)(f=c[u]).name&&(l[f.name]=f.index);i=(e instanceof Array?e:[e]).map((function(e){var t=l[e];if(void 0===t)throw new Error("Failed to find node '".concat(e,"'"));return t}))}return[4,this._loadAsync(a,s,i,(function(){return{meshes:d._getMeshes(),particleSystems:[],skeletons:d._getSkeletons(),animationGroups:d._getAnimationGroups(),lights:d._babylonLights,transformNodes:d._getTransformNodes(),geometries:d._getGeometries(),spriteManagers:[]}}))];case 1:return[2,r.sent()]}}))}))}))];case 1:return[2,i.sent()]}}))}))},e.prototype.loadAsync=function(e,t,n,o){return(0,r.sH)(this,arguments,void 0,(function(e,t,n,o,a){return void 0===a&&(a=""),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._babylonScene=e,this._loadData(t),[4,this._loadAsync(n,a,null,(function(){}))];case 1:return[2,r.sent()]}}))}))},e.prototype._loadAsync=function(e,t,i,s){return(0,r.sH)(this,void 0,void 0,(function(){var l=this;return(0,r.YH)(this,(function(u){switch(u.label){case 0:return[4,Promise.resolve().then((function(){return(0,r.sH)(l,void 0,void 0,(function(){var l,u,f,d,h,p,m,_,g,b,y,v,T,x,A=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._rootUrl=e,this._uniqueRootUrl=!e.startsWith("file:")&&t?e:"".concat(e).concat(Date.now(),"/"),this._fileName=t,this._allMaterialsDirtyRequired=!1,[4,this._loadExtensionsAsync()];case 1:return r.sent(),this.parent.skipMaterials||null!=this._pbrMaterialImpl?[3,7]:this.parent.useOpenPBR||this.isExtensionUsed("KHR_materials_openpbr")?(l=this,T={},[4,Promise.resolve().then(n.t.bind(n,5597,23))]):[3,4];case 2:return T.materialClass=r.sent().OpenPBRMaterial,[4,Promise.resolve().then(n.bind(n,3833))];case 3:return l._pbrMaterialImpl=(T.adapterClass=r.sent().OpenPBRMaterialLoadingAdapter,T),[3,7];case 4:return u=this,x={},[4,Promise.resolve().then(n.t.bind(n,5597,23))];case 5:return x.materialClass=r.sent().PBRMaterial,[4,Promise.resolve().then(n.bind(n,2561))];case 6:u._pbrMaterialImpl=(x.adapterClass=r.sent().PBRMaterialLoadingAdapter,x),r.label=7;case 7:if(f="".concat(a.GLTFLoaderState[a.GLTFLoaderState.LOADING]," => ").concat(a.GLTFLoaderState[a.GLTFLoaderState.READY]),d="".concat(a.GLTFLoaderState[a.GLTFLoaderState.LOADING]," => ").concat(a.GLTFLoaderState[a.GLTFLoaderState.COMPLETE]),this._parent._startPerformanceCounter(f),this._parent._startPerformanceCounter(d),this._parent._setState(a.GLTFLoaderState.LOADING),this._extensionsOnLoading(),h=new Array,p=this._babylonScene.blockMaterialDirtyMechanism,this._babylonScene.blockMaterialDirtyMechanism=!0,this.parent.loadOnlyMaterials||(i?h.push(this.loadSceneAsync("/nodes",{nodes:i,index:-1})):(null!=this._gltf.scene||this._gltf.scenes&&this._gltf.scenes[0])&&(m=c.Get("/scene",this._gltf.scenes,this._gltf.scene||0),h.push(this.loadSceneAsync("/scenes/".concat(m.index),m)))),!this.parent.skipMaterials&&this.parent.loadAllMaterials&&this._gltf.materials)for(_=0;_<this._gltf.materials.length;++_)g=this._gltf.materials[_],b="/materials/"+_,y=o.Material.TriangleFillMode,h.push(this._loadMaterialAsync(b,g,null,y,(function(){})));return this._allMaterialsDirtyRequired?this._babylonScene.blockMaterialDirtyMechanism=p:this._babylonScene._forceBlockMaterialDirtyMechanism(p),this._parent.compileMaterials&&h.push(this._compileMaterialsAsync()),this._parent.compileShadowGenerators&&h.push(this._compileShadowGeneratorsAsync()),v=Promise.all(h).then((function(){A._rootBabylonMesh&&A._rootBabylonMesh!==A._parent.customRootNode&&A._rootBabylonMesh.setEnabled(!0);for(var e=0,t=A._babylonScene.materials;e<t.length;e++){var n=t[e];void 0!==n.maxSimultaneousLights&&(n.maxSimultaneousLights=Math.max(n.maxSimultaneousLights,A._babylonScene.lights.length))}return A._extensionsOnReady(),A._parent._setState(a.GLTFLoaderState.READY),A._skipStartAnimationStep||A._startAnimations(),s()})),[4,v.then((function(e){return A._parent._endPerformanceCounter(f),o.Tools.SetImmediate((function(){A._disposed||Promise.all(A._completePromises).then((function(){A._parent._endPerformanceCounter(d),A._parent._setState(a.GLTFLoaderState.COMPLETE),A._parent.onCompleteObservable.notifyObservers(void 0),A._parent.onCompleteObservable.clear(),A.dispose()}),(function(e){A._parent.onErrorObservable.notifyObservers(e),A._parent.onErrorObservable.clear(),A.dispose()}))})),e}))];case 8:return[2,r.sent()]}}))}))})).catch((function(e){throw l._disposed||(l._parent.onErrorObservable.notifyObservers(e),l._parent.onErrorObservable.clear(),l.dispose()),e}))];case 1:return[2,u.sent()]}}))}))},e.prototype._loadData=function(e){if(this._gltf=e.json,this._setupData(),e.bin){var t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){var n=t[0];(n.byteLength<e.bin.byteLength-3||n.byteLength>e.bin.byteLength)&&o.Logger.Warn("Binary buffer length (".concat(n.byteLength,") from JSON does not match chunk length (").concat(e.bin.byteLength,")")),this._bin=e.bin}else o.Logger.Warn("Unexpected BIN chunk")}},e.prototype._setupData=function(){if(c.Assign(this._gltf.accessors),c.Assign(this._gltf.animations),c.Assign(this._gltf.buffers),c.Assign(this._gltf.bufferViews),c.Assign(this._gltf.cameras),c.Assign(this._gltf.images),c.Assign(this._gltf.materials),c.Assign(this._gltf.meshes),c.Assign(this._gltf.nodes),c.Assign(this._gltf.samplers),c.Assign(this._gltf.scenes),c.Assign(this._gltf.skins),c.Assign(this._gltf.textures),this._gltf.nodes){for(var e={},t=0,n=this._gltf.nodes;t<n.length;t++)if((l=n[t]).children)for(var r=0,o=l.children;r<o.length;r++)e[o[r]]=l.index;for(var a=this._createRootNode(),i=0,s=this._gltf.nodes;i<s.length;i++){var l,u=e[(l=s[i]).index];l.parent=void 0===u?a:this._gltf.nodes[u]}}},e.prototype._loadExtensionsAsync=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e,t,n,a,s,l,u,c,f,d,h,p=this;return(0,r.YH)(this,(function(m){switch(m.label){case 0:return e=[],i.Sv.forEach((function(t,n){var a;!1===(null===(a=p.parent.extensionOptions[n])||void 0===a?void 0:a.enabled)?t.isGLTFExtension&&p.isExtensionUsed(n)&&o.Logger.Warn("Extension ".concat(n," is used but has been explicitly disabled.")):t.isGLTFExtension&&!p.isExtensionUsed(n)||e.push((0,r.sH)(p,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,t.factory(this)];case 1:return(e=r.sent()).name!==n&&o.Logger.Warn("The name of the glTF loader extension instance does not match the registered name: ".concat(e.name," !== ").concat(n)),this._parent.onExtensionLoadedObservable.notifyObservers(e),[2,e]}}))})))})),n=(t=(d=this._extensions).push).apply,a=[d],[4,Promise.all(e)];case 1:if(n.apply(t,a.concat([m.sent()])),this._extensions.sort((function(e,t){return(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE)})),this._parent.onExtensionLoadedObservable.clear(),this._gltf.extensionsRequired)for(s=function(e){if(!l._extensions.some((function(t){return t.name===e&&t.enabled}))){if(!1===(null===(h=l.parent.extensionOptions[e])||void 0===h?void 0:h.enabled))throw new Error("Required extension ".concat(e," is disabled"));throw new Error("Required extension ".concat(e," is not available"))}},l=this,u=0,c=this._gltf.extensionsRequired;u<c.length;u++)f=c[u],s(f);return[2]}}))}))},e.prototype._createRootNode=function(){if(void 0!==this._parent.customRootNode)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:null===this._rootBabylonMesh?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;var t=new o.Mesh("__root__",this._babylonScene);this._rootBabylonMesh=t,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);var n={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case a.GLTFLoaderCoordinateSystemMode.AUTO:this._babylonScene.useRightHandedSystem||(n.rotation=[0,1,0,0],n.scale=[1,1,-1],e._LoadTransform(n,this._rootBabylonMesh));break;case a.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error("Invalid coordinate system mode (".concat(this._parent.coordinateSystemMode,")"))}return this._parent.onMeshLoadedObservable.notifyObservers(t),n},e.prototype.loadSceneAsync=function(e,t){var n=this,r=this._extensionsLoadSceneAsync(e,t);if(r)return r;var o=new Array;if(this.logOpen("".concat(e," ").concat(t.name||"")),t.nodes)for(var a=0,i=t.nodes;a<i.length;a++){var s=i[a],l=c.Get("".concat(e,"/nodes/").concat(s),this._gltf.nodes,s);o.push(this.loadNodeAsync("/nodes/".concat(l.index),l,(function(e){e.parent=n._rootBabylonMesh})))}for(var u=0,f=this._postSceneLoadActions;u<f.length;u++)(0,f[u])();return o.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(o).then((function(){}))},e.prototype._forEachPrimitive=function(e,t){if(e._primitiveBabylonMeshes)for(var n=0,r=e._primitiveBabylonMeshes;n<r.length;n++)t(r[n])},e.prototype._getGeometries=function(){var e=[],t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];this._forEachPrimitive(o,(function(t){var n=t.geometry;n&&-1===e.indexOf(n)&&e.push(n)}))}return e},e.prototype._getMeshes=function(){var e=[];this._rootBabylonMesh instanceof o.AbstractMesh&&e.push(this._rootBabylonMesh);var t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var a=r[n];this._forEachPrimitive(a,(function(t){e.push(t)}))}return e},e.prototype._getTransformNodes=function(){var e=[],t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];o._babylonTransformNode&&"TransformNode"===o._babylonTransformNode.getClassName()&&e.push(o._babylonTransformNode),o._babylonTransformNodeForSkin&&e.push(o._babylonTransformNodeForSkin)}return e},e.prototype._getSkeletons=function(){var e=[],t=this._gltf.skins;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];o._data&&e.push(o._data.babylonSkeleton)}return e},e.prototype._getAnimationGroups=function(){var e=[],t=this._gltf.animations;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];o._babylonAnimationGroup&&e.push(o._babylonAnimationGroup)}return e},e.prototype._startAnimations=function(){switch(this._parent.animationStartMode){case a.GLTFLoaderAnimationStartMode.NONE:break;case a.GLTFLoaderAnimationStartMode.FIRST:0!==(e=this._getAnimationGroups()).length&&e[0].start(!0);break;case a.GLTFLoaderAnimationStartMode.ALL:for(var e,t=0,n=e=this._getAnimationGroups();t<n.length;t++)n[t].start(!0);break;default:return void o.Logger.Error("Invalid animation start mode (".concat(this._parent.animationStartMode,")"))}},e.prototype.loadNodeAsync=function(t,n,r){var a=this;void 0===r&&(r=function(){});var i=this._extensionsLoadNodeAsync(t,n,r);if(i)return i;if(n._babylonTransformNode)throw new Error("".concat(t,": Invalid recursive node hierarchy"));var s=new Array;this.logOpen("".concat(t," ").concat(n.name||""));var l=function(o){if(e.AddPointerMetadata(o,t),e._LoadTransform(n,o),null!=n.camera){var i=c.Get("".concat(t,"/camera"),a._gltf.cameras,n.camera);s.push(a.loadCameraAsync("/cameras/".concat(i.index),i,(function(e){e.parent=o,a._babylonScene.useRightHandedSystem||(o.scaling.x=-1)})))}if(n.children)for(var l=0,u=n.children;l<u.length;l++){var f=u[l],d=c.Get("".concat(t,"/children/").concat(f),a._gltf.nodes,f);s.push(a.loadNodeAsync("/nodes/".concat(d.index),d,(function(e){e.parent=o})))}r(o)},u=null!=n.mesh,f=this._parent.loadSkins&&null!=n.skin;if(!u||f){var d=n.name||"node".concat(n.index);this._babylonScene._blockEntityCollection=!!this._assetContainer;var h=new o.TransformNode(d,this._babylonScene);h._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,null==n.mesh?n._babylonTransformNode=h:n._babylonTransformNodeForSkin=h,l(h)}if(u)if(f){var p=c.Get("".concat(t,"/mesh"),this._gltf.meshes,n.mesh);s.push(this._loadMeshAsync("/meshes/".concat(p.index),n,p,(function(e){var r=n._babylonTransformNodeForSkin;e.metadata=(0,o.deepMerge)(r.metadata,e.metadata||{});var i=c.Get("".concat(t,"/skin"),a._gltf.skins,n.skin);s.push(a._loadSkinAsync("/skins/".concat(i.index),n,i,(function(t){a._forEachPrimitive(n,(function(e){e.skeleton=t})),a._postSceneLoadActions.push((function(){if(null!=i.skeleton){var t=c.Get("/skins/".concat(i.index,"/skeleton"),a._gltf.nodes,i.skeleton).parent;n.index===t.index?e.parent=r.parent:e.parent=t._babylonTransformNode}else e.parent=a._rootBabylonMesh;a._parent.onSkinLoadedObservable.notifyObservers({node:r,skinnedNode:e})}))})))})))}else p=c.Get("".concat(t,"/mesh"),this._gltf.meshes,n.mesh),s.push(this._loadMeshAsync("/meshes/".concat(p.index),n,p,l));return this.logClose(),Promise.all(s).then((function(){return a._forEachPrimitive(n,(function(e){var t=e;!t.isAnInstance&&t.geometry&&t.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0,!0)})),n._babylonTransformNode}))},e.prototype._loadMeshAsync=function(e,t,n,r){var a=n.primitives;if(!a||!a.length)throw new Error("".concat(e,": Primitives are missing"));null==a[0].index&&c.Assign(a);var i=new Array;this.logOpen("".concat(e," ").concat(n.name||""));var s=t.name||"node".concat(t.index);if(1===a.length){var l=n.primitives[0];i.push(this._loadMeshPrimitiveAsync("".concat(e,"/primitives/").concat(l.index),s,t,n,l,(function(e){t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new o.TransformNode(s,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(var u=0,f=a;u<f.length;u++)l=f[u],i.push(this._loadMeshPrimitiveAsync("".concat(e,"/primitives/").concat(l.index),"".concat(s,"_primitive").concat(l.index),t,n,l,(function(e){e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}return r(t._babylonTransformNode),this.logClose(),Promise.all(i).then((function(){return t._babylonTransformNode}))},e.prototype._loadMeshPrimitiveAsync=function(t,n,a,i,s,l){var u=this,f=this._extensionsLoadMeshPrimitiveAsync(t,n,a,i,s,l);if(f)return f;this.logOpen("".concat(t));var d,h,p=0===this._disableInstancedMesh&&this._parent.createInstances&&null==a.skin&&!i.primitives[0].targets;if(p&&s._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,(d=s._instanceData.babylonSourceMesh.createInstance(n))._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,h=s._instanceData.promise;else{var m=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;var _=new o.Mesh(n,this._babylonScene);if(_._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,_.sideOrientation=this._babylonScene.useRightHandedSystem?o.Material.CounterClockWiseSideOrientation:o.Material.ClockWiseSideOrientation,this._createMorphTargets(t,a,i,s,_),m.push(this._loadVertexDataAsync(t,s,_).then((function(e){return(0,r.sH)(u,void 0,void 0,(function(){var n=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loadMorphTargetsAsync(t,s,_,e).then((function(){n._disposed||(n._babylonScene._blockEntityCollection=!!n._assetContainer,e.applyToMesh(_),e._parentContainer=n._assetContainer,n._babylonScene._blockEntityCollection=!1)}))];case 1:return[2,r.sent()]}}))}))}))),!this.parent.skipMaterials){var g=e._GetDrawMode(t,s.mode);if(null==s.material){var b=this._defaultBabylonMaterialData[g];b||(b=this._createDefaultMaterial("__GLTFLoader._default",g),this._parent.onMaterialLoadedObservable.notifyObservers(b),this._defaultBabylonMaterialData[g]=b),_.material=b}else{var y=c.Get("".concat(t,"/material"),this._gltf.materials,s.material);m.push(this._loadMaterialAsync("/materials/".concat(y.index),y,_,g,(function(e){_.material=e})))}}h=Promise.all(m),p&&(s._instanceData={babylonSourceMesh:_,promise:h}),d=_}return e.AddPointerMetadata(d,t),this._parent.onMeshLoadedObservable.notifyObservers(d),l(d),this.logClose(),h.then((function(){return d}))},e.prototype._loadVertexDataAsync=function(e,t,n){var r=this,a=this._extensionsLoadVertexDataAsync(e,t,n);if(a)return a;var i=t.attributes;if(!i)throw new Error("".concat(e,": Attributes are missing"));var s=new Array,l=new o.Geometry(n.name,this._babylonScene);if(null==t.indices)n.isUnIndexed=!0;else{var u=c.Get("".concat(e,"/indices"),this._gltf.accessors,t.indices);s.push(this._loadIndicesAccessorAsync("/accessors/".concat(u.index),u).then((function(e){l.setIndices(e)})))}var d=function(t,a,u){if(null!=i[t]){n._delayInfo=n._delayInfo||[],-1===n._delayInfo.indexOf(a)&&n._delayInfo.push(a);var d=c.Get("".concat(e,"/attributes/").concat(t),r._gltf.accessors,i[t]);s.push(r._loadVertexAccessorAsync("/accessors/".concat(d.index),d,a).then((function(e){if(e.getKind()===o.VertexBuffer.PositionKind&&!r.parent.alwaysComputeBoundingBox&&!n.skeleton){var t=f(d);t&&(l._boundingInfo=t,l.useBoundingInfoFromGeometry=!0)}l.setVerticesBuffer(e,d.count)}))),a==o.VertexBuffer.MatricesIndicesExtraKind&&(n.numBoneInfluencers=8),u&&u(d)}};return d("POSITION",o.VertexBuffer.PositionKind),d("NORMAL",o.VertexBuffer.NormalKind),d("TANGENT",o.VertexBuffer.TangentKind),d("TEXCOORD_0",o.VertexBuffer.UVKind),d("TEXCOORD_1",o.VertexBuffer.UV2Kind),d("TEXCOORD_2",o.VertexBuffer.UV3Kind),d("TEXCOORD_3",o.VertexBuffer.UV4Kind),d("TEXCOORD_4",o.VertexBuffer.UV5Kind),d("TEXCOORD_5",o.VertexBuffer.UV6Kind),d("JOINTS_0",o.VertexBuffer.MatricesIndicesKind),d("WEIGHTS_0",o.VertexBuffer.MatricesWeightsKind),d("JOINTS_1",o.VertexBuffer.MatricesIndicesExtraKind),d("WEIGHTS_1",o.VertexBuffer.MatricesWeightsExtraKind),d("COLOR_0",o.VertexBuffer.ColorKind,(function(e){"VEC4"===e.type&&(n.hasVertexAlpha=!0)})),Promise.all(s).then((function(){return l}))},e.prototype._createMorphTargets=function(e,t,n,r,a){if(r.targets&&this._parent.loadMorphTargets){if(null==t._numMorphTargets)t._numMorphTargets=r.targets.length;else if(r.targets.length!==t._numMorphTargets)throw new Error("".concat(e,": Primitives do not have the same number of targets"));var i=n.extras?n.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,a.morphTargetManager=new o.MorphTargetManager(this._babylonScene),a.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.morphTargetManager.areUpdatesFrozen=!0;for(var s=0;s<r.targets.length;s++){var l=t.weights?t.weights[s]:n.weights?n.weights[s]:0,u=i?i[s]:"morphTarget".concat(s);a.morphTargetManager.addTarget(new o.MorphTarget(u,l,a.getScene()))}}},e.prototype._loadMorphTargetsAsync=function(e,t,n,r){if(!t.targets||!this._parent.loadMorphTargets)return Promise.resolve();for(var o=new Array,a=n.morphTargetManager,i=0;i<a.numTargets;i++){var s=a.getTarget(i);o.push(this._loadMorphTargetVertexDataAsync("".concat(e,"/targets/").concat(i),r,t.targets[i],s))}return Promise.all(o).then((function(){a.areUpdatesFrozen=!1}))},e.prototype._loadMorphTargetVertexDataAsync=function(e,t,n,a){return(0,r.sH)(this,void 0,void 0,(function(){var i,s,l=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=new Array,(s=function(r,o,a){if(null!=n[r]){var s=t.getVertexBuffer(o);if(s){var u=c.Get("".concat(e,"/").concat(r),l._gltf.accessors,n[r]);i.push(l._loadFloatAccessorAsync("/accessors/".concat(u.index),u).then((function(e){a(s,e)})))}}})("POSITION",o.VertexBuffer.PositionKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),a.setPositions(n)})),s("NORMAL",o.VertexBuffer.NormalKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(n.length,(function(e,r){n[r]=t[r]+e})),a.setNormals(n)})),s("TANGENT",o.VertexBuffer.TangentKind,(function(e,t){var n=new Float32Array(t.length/3*4),r=0;e.forEach(t.length/3*4,(function(e,o){(o+1)%4!=0&&(n[r]=t[r]+e,r++)})),a.setTangents(n)})),s("TEXCOORD_0",o.VertexBuffer.UVKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),a.setUVs(n)})),s("TEXCOORD_1",o.VertexBuffer.UV2Kind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),a.setUV2s(n)})),s("COLOR_0",o.VertexBuffer.ColorKind,(function(t,n){var r=null,o=t.getSize();if(3===o){r=new Float32Array(n.length/3*4),t.forEach(n.length,(function(e,t){var o=Math.floor(t/3),a=t%3;r[4*o+a]=n[3*o+a]+e}));for(var i=0;i<n.length/3;++i)r[4*i+3]=1}else{if(4!==o)throw new Error("".concat(e,": Invalid number of components (").concat(o,") for COLOR_0 attribute"));r=new Float32Array(n.length),t.forEach(n.length,(function(e,t){r[t]=n[t]+e}))}a.setColors(r)})),[4,Promise.all(i).then((function(){}))];case 1:return[2,r.sent()]}}))}))},e._LoadTransform=function(e,t){if(null==e.skin){var n=o.Vector3.Zero(),r=o.Quaternion.Identity(),a=o.Vector3.One();e.matrix?o.Matrix.FromArray(e.matrix).decompose(a,r,n):(e.translation&&(n=o.Vector3.FromArray(e.translation)),e.rotation&&(r=o.Quaternion.FromArray(e.rotation)),e.scale&&(a=o.Vector3.FromArray(e.scale))),t.position=n,t.rotationQuaternion=r,t.scaling=a}},e.prototype._loadSkinAsync=function(e,t,n,r){var a=this;if(!this._parent.loadSkins)return Promise.resolve();var i=this._extensionsLoadSkinAsync(e,t,n);if(i)return i;if(n._data)return r(n._data.babylonSkeleton),n._data.promise;var s="skeleton".concat(n.index);this._babylonScene._blockEntityCollection=!!this._assetContainer;var l=new o.Skeleton(n.name||s,s,this._babylonScene);l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,n,l);var u=this._loadSkinInverseBindMatricesDataAsync(e,n).then((function(e){a._updateBoneMatrices(l,e)}));return n._data={babylonSkeleton:l,promise:u},r(l),u},e.prototype._loadBones=function(e,t,n){if(null==t.skeleton||this._parent.alwaysComputeSkeletonRootNode){var r=this._findSkeletonRootNode("".concat(e,"/joints"),t.joints);if(r)if(void 0===t.skeleton)t.skeleton=r.index;else{var a=c.Get("".concat(e,"/skeleton"),this._gltf.nodes,t.skeleton);a===r||function(e,t){for(;t.parent;t=t.parent)if(t.parent===e)return!0;return!1}(a,r)||(o.Logger.Warn("".concat(e,"/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root")),t.skeleton=r.index)}else o.Logger.Warn("".concat(e,": Failed to find common root"))}for(var i={},s=0,l=t.joints;s<l.length;s++){var u=l[s],f=c.Get("".concat(e,"/joints/").concat(u),this._gltf.nodes,u);this._loadBone(f,t,n,i)}},e.prototype._findSkeletonRootNode=function(e,t){if(0===t.length)return null;for(var n={},r=0,o=t;r<o.length;r++){for(var a=o[r],i=[],s=c.Get("".concat(e,"/").concat(a),this._gltf.nodes,a);-1!==s.index;)i.unshift(s),s=s.parent;n[a]=i}for(var l=null,u=0;;++u){if(u>=(i=n[t[0]]).length)return l;s=i[u];for(var f=1;f<t.length;++f)if(u>=(i=n[t[f]]).length||s!==i[u])return l;l=s}},e.prototype._loadBone=function(e,t,n,r){e._isJoint=!0;var a=r[e.index];if(a)return a;var i=null;e.index!==t.skeleton&&(e.parent&&-1!==e.parent.index?i=this._loadBone(e.parent,t,n,r):void 0!==t.skeleton&&o.Logger.Warn("/skins/".concat(t.index,"/skeleton: Skeleton node is not a common root")));var s=t.joints.indexOf(e.index);return a=new o.Bone(e.name||"joint".concat(e.index),n,i,this._getNodeMatrix(e),null,null,s),r[e.index]=a,this._postSceneLoadActions.push((function(){a.linkTransformNode(e._babylonTransformNode)})),a},e.prototype._loadSkinInverseBindMatricesDataAsync=function(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);var n=c.Get("".concat(e,"/inverseBindMatrices"),this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync("/accessors/".concat(n.index),n)},e.prototype._updateBoneMatrices=function(e,t){for(var n=0,r=e.bones;n<r.length;n++){var a=r[n],i=o.Matrix.Identity(),s=a._index;t&&-1!==s&&(o.Matrix.FromArrayToRef(t,16*s,i),i.invertToRef(i));var l=a.getParent();l&&i.multiplyToRef(l.getAbsoluteInverseBindMatrix(),i),a.updateMatrix(i,!1,!1),a._updateAbsoluteBindMatrices(void 0,!1)}},e.prototype._getNodeMatrix=function(e){return e.matrix?o.Matrix.FromArray(e.matrix):o.Matrix.Compose(e.scale?o.Vector3.FromArray(e.scale):o.Vector3.One(),e.rotation?o.Quaternion.FromArray(e.rotation):o.Quaternion.Identity(),e.translation?o.Vector3.FromArray(e.translation):o.Vector3.Zero())},e.prototype.loadCameraAsync=function(t,n,r){void 0===r&&(r=function(){});var a=this._extensionsLoadCameraAsync(t,n,r);if(a)return a;var i=new Array;this.logOpen("".concat(t," ").concat(n.name||"")),this._babylonScene._blockEntityCollection=!!this._assetContainer;var s=new o.FreeCamera(n.name||"camera".concat(n.index),o.Vector3.Zero(),this._babylonScene,!1);switch(s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,n._babylonCamera=s,s.setTarget(new o.Vector3(0,0,-1)),n.type){case"perspective":var l=n.perspective;if(!l)throw new Error("".concat(t,": Camera perspective properties are missing"));s.fov=l.yfov,s.minZ=l.znear,s.maxZ=l.zfar||0;break;case"orthographic":if(!n.orthographic)throw new Error("".concat(t,": Camera orthographic properties are missing"));s.mode=o.Camera.ORTHOGRAPHIC_CAMERA,s.orthoLeft=-n.orthographic.xmag,s.orthoRight=n.orthographic.xmag,s.orthoBottom=-n.orthographic.ymag,s.orthoTop=n.orthographic.ymag,s.minZ=n.orthographic.znear,s.maxZ=n.orthographic.zfar;break;default:throw new Error("".concat(t,": Invalid camera type (").concat(n.type,")"))}return e.AddPointerMetadata(s,t),this._parent.onCameraLoadedObservable.notifyObservers(s),r(s),this.logClose(),Promise.all(i).then((function(){return s}))},e.prototype._loadAnimationsAsync=function(){var e=this;this._parent._startPerformanceCounter("Load animations");var t=this._gltf.animations;if(!t)return Promise.resolve();for(var n=new Array,r=0;r<t.length;r++){var o=t[r];n.push(this.loadAnimationAsync("/animations/".concat(o.index),o).then((function(e){0===e.targetedAnimations.length&&e.dispose()})))}return Promise.all(n).then((function(){e._parent._endPerformanceCounter("Load animations")}))},e.prototype.loadAnimationAsync=function(e,t){var n=this;return this._parent._startPerformanceCounter("Load animation"),this._extensionsLoadAnimationAsync(e,t)||l.value.then((function(r){var o=r.AnimationGroup;n._babylonScene._blockEntityCollection=!!n._assetContainer;var a=new o(t.name||"animation".concat(t.index),n._babylonScene);a._parentContainer=n._assetContainer,n._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=a;var i=new Array;c.Assign(t.channels),c.Assign(t.samplers);for(var s=0,l=t.channels;s<l.length;s++){var u=l[s];i.push(n._loadAnimationChannelAsync("".concat(e,"/channels/").concat(u.index),e,t,u,(function(e,t){e.animations=e.animations||[],e.animations.push(t),a.addTargetedAnimation(t,e)})))}return n._parent._endPerformanceCounter("Load animation"),Promise.all(i).then((function(){return a.normalize(0),a}))}))},e.prototype._loadAnimationChannelAsync=function(e,t,n,r,o){var a=this,i=this._extensionsLoadAnimationChannelAsync(e,t,n,r,o);if(i)return i;if(null==r.target.node)return Promise.resolve();var l=c.Get("".concat(e,"/target/node"),this._gltf.nodes,r.target.node),f=r.target.path,d="weights"===f;return d&&!l._numMorphTargets||!d&&!l._babylonTransformNode?Promise.resolve():this._parent.loadNodeAnimations||d||l._isJoint?u.value.then((function(){var i,u,c,d,h;switch(f){case"translation":h=null===(i=(0,s.tQ)("/nodes/{}/translation"))||void 0===i?void 0:i.interpolation;break;case"rotation":h=null===(u=(0,s.tQ)("/nodes/{}/rotation"))||void 0===u?void 0:u.interpolation;break;case"scale":h=null===(c=(0,s.tQ)("/nodes/{}/scale"))||void 0===c?void 0:c.interpolation;break;case"weights":h=null===(d=(0,s.tQ)("/nodes/{}/weights"))||void 0===d?void 0:d.interpolation;break;default:throw new Error("".concat(e,"/target/path: Invalid value (").concat(r.target.path,")"))}if(!h)throw new Error("".concat(e,"/target/path: Could not find interpolation properties for target path (").concat(r.target.path,")"));var p={object:l,info:h};return a._loadAnimationChannelFromTargetInfoAsync(e,t,n,r,p,o)})):Promise.resolve()},e.prototype._loadAnimationChannelFromTargetInfoAsync=function(e,t,n,r,o,a){var i=this.parent.targetFps,s=1/i,l=c.Get("".concat(e,"/sampler"),n.samplers,r.sampler);return this._loadAnimationSamplerAsync("".concat(t,"/samplers/").concat(r.sampler),l).then((function(e){for(var t=0,l=o.object,u=0,c=o.info;u<c.length;u++){var f=c[u],d=f.getStride(l),h=e.input,p=e.output,m=new Array(h.length),_=0;switch(e.interpolation){case"STEP":for(var g=0;g<h.length;g++){var b=f.getValue(l,p,_,1);_+=d,m[g]={frame:h[g]*i,value:b,interpolation:1}}break;case"CUBICSPLINE":for(g=0;g<h.length;g++){var y=f.getValue(l,p,_,s);_+=d,b=f.getValue(l,p,_,1),_+=d;var v=f.getValue(l,p,_,s);_+=d,m[g]={frame:h[g]*i,inTangent:y,value:b,outTangent:v}}break;case"LINEAR":for(g=0;g<h.length;g++)b=f.getValue(l,p,_,1),_+=d,m[g]={frame:h[g]*i,value:b}}if(_>0)for(var T="".concat(n.name||"animation".concat(n.index),"_channel").concat(r.index,"_").concat(t),x=0,A=f.buildAnimations(l,T,i,m);x<A.length;x++){var w=A[x];t++,a(w.babylonAnimatable,w.babylonAnimation)}}}))},e.prototype._loadAnimationSamplerAsync=function(e,t){if(t._data)return t._data;var n=t.interpolation||"LINEAR";switch(n){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error("".concat(e,"/interpolation: Invalid value (").concat(t.interpolation,")"))}var r=c.Get("".concat(e,"/input"),this._gltf.accessors,t.input),o=c.Get("".concat(e,"/output"),this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync("/accessors/".concat(r.index),r),this._loadFloatAccessorAsync("/accessors/".concat(o.index),o)]).then((function(e){var t=e[0],r=e[1];return{input:t,interpolation:n,output:r}})),t._data},e.prototype.loadBufferAsync=function(e,t,n,r){var o=this._extensionsLoadBufferAsync(e,t,n,r);if(o)return o;if(!t._data)if(t.uri)t._data=this.loadUriAsync("".concat(e,"/uri"),t,t.uri);else{if(!this._bin)throw new Error("".concat(e,": Uri is missing or the binary glTF is missing its binary chunk"));t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((function(t){try{return new Uint8Array(t.buffer,t.byteOffset+n,r)}catch(t){throw new Error("".concat(e,": ").concat(t.message),{cause:t})}}))},e.prototype.loadBufferViewAsync=function(e,t){var n=this._extensionsLoadBufferViewAsync(e,t);if(n)return n;if(t._data)return t._data;var r=c.Get("".concat(e,"/buffer"),this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync("/buffers/".concat(r.index),r,t.byteOffset||0,t.byteLength),t._data},e.prototype._loadAccessorAsync=function(t,n,r){var a=this;if(n._data)return n._data;var i=e._GetNumComponents(t,n.type),s=i*o.VertexBuffer.GetTypeByteLength(n.componentType),l=i*n.count;if(null==n.bufferView)n._data=Promise.resolve(new r(l));else{var u=c.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,n.bufferView);n._data=this.loadBufferViewAsync("/bufferViews/".concat(u.index),u).then((function(a){if(5126!==n.componentType||n.normalized||u.byteStride&&u.byteStride!==s){var c=new r(l);return o.VertexBuffer.ForEach(a,n.byteOffset||0,u.byteStride||s,i,n.componentType,c.length,n.normalized||!1,(function(e,t){c[t]=e})),c}return e._GetTypedArray(t,n.componentType,a,n.byteOffset,l)}))}if(n.sparse){var f=n.sparse;n._data=n._data.then((function(l){var u=l,d=c.Get("".concat(t,"/sparse/indices/bufferView"),a._gltf.bufferViews,f.indices.bufferView),h=c.Get("".concat(t,"/sparse/values/bufferView"),a._gltf.bufferViews,f.values.bufferView);return Promise.all([a.loadBufferViewAsync("/bufferViews/".concat(d.index),d),a.loadBufferViewAsync("/bufferViews/".concat(h.index),h)]).then((function(a){var l,c=a[0],d=a[1],h=e._GetTypedArray("".concat(t,"/sparse/indices"),f.indices.componentType,c,f.indices.byteOffset,f.count),p=i*f.count;if(5126!==n.componentType||n.normalized){var m=e._GetTypedArray("".concat(t,"/sparse/values"),n.componentType,d,f.values.byteOffset,p);l=new r(p),o.VertexBuffer.ForEach(m,0,s,i,n.componentType,l.length,n.normalized||!1,(function(e,t){l[t]=e}))}else l=e._GetTypedArray("".concat(t,"/sparse/values"),n.componentType,d,f.values.byteOffset,p);for(var _=0,g=0;g<h.length;g++)for(var b=h[g]*i,y=0;y<i;y++)u[b++]=l[_++];return u}))}))}return n._data},e.prototype._loadFloatAccessorAsync=function(e,t){return this._loadAccessorAsync(e,t,Float32Array)},e.prototype._loadIndicesAccessorAsync=function(t,n){if("SCALAR"!==n.type)throw new Error("".concat(t,"/type: Invalid value ").concat(n.type));if(5121!==n.componentType&&5123!==n.componentType&&5125!==n.componentType)throw new Error("".concat(t,"/componentType: Invalid value ").concat(n.componentType));if(n._data)return n._data;if(n.sparse){var r=e._GetTypedArrayConstructor("".concat(t,"/componentType"),n.componentType);n._data=this._loadAccessorAsync(t,n,r)}else{var o=c.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,n.bufferView);n._data=this.loadBufferViewAsync("/bufferViews/".concat(o.index),o).then((function(r){return e._GetTypedArray(t,n.componentType,r,n.byteOffset,n.count)}))}return n._data},e.prototype._loadVertexBufferViewAsync=function(e){if(e._babylonBuffer)return e._babylonBuffer;var t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync("/bufferViews/".concat(e.index),e).then((function(e){return new o.Buffer(t,e,!1)})),e._babylonBuffer},e.prototype._loadVertexAccessorAsync=function(t,n,r){var a;if(null===(a=n._babylonVertexBuffer)||void 0===a?void 0:a[r])return n._babylonVertexBuffer[r];n._babylonVertexBuffer||(n._babylonVertexBuffer={});var i=this._babylonScene.getEngine();if(n.sparse||null==n.bufferView)n._babylonVertexBuffer[r]=this._loadFloatAccessorAsync(t,n).then((function(e){return new o.VertexBuffer(i,e,r,!1)}));else{var s=c.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,n.bufferView);n._babylonVertexBuffer[r]=this._loadVertexBufferViewAsync(s).then((function(a){var l=e._GetNumComponents(t,n.type);return new o.VertexBuffer(i,a,r,!1,void 0,s.byteStride,void 0,n.byteOffset,l,n.componentType,n.normalized,!0,void 0,!0)}))}return n._babylonVertexBuffer[r]},e.prototype._loadMaterialMetallicRoughnessPropertiesAsync=function(e,t,n){var r=new Array,a=this._getOrCreateMaterialAdapter(n);return t&&(t.baseColorFactor?(a.baseColor=o.Color3.FromArray(t.baseColorFactor),a.geometryOpacity=t.baseColorFactor[3]):a.baseColor=o.Color3.White(),a.baseMetalness=null==t.metallicFactor?1:t.metallicFactor,a.specularRoughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&r.push(this.loadTextureInfoAsync("".concat(e,"/baseColorTexture"),t.baseColorTexture,(function(e){e.name="".concat(n.name," (Base Color)"),a.baseColorTexture=e}))),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,r.push(this.loadTextureInfoAsync("".concat(e,"/metallicRoughnessTexture"),t.metallicRoughnessTexture,(function(e){e.name="".concat(n.name," (Metallic Roughness)"),a.baseMetalnessTexture=e,a.specularRoughnessTexture=e}))),a.useRoughnessFromMetallicTextureGreen=!0,a.useMetallicFromMetallicTextureBlue=!0)),Promise.all(r).then((function(){}))},e.prototype._loadMaterialAsync=function(t,n,r,o,a){void 0===a&&(a=function(){});var i=this._extensionsLoadMaterialAsync(t,n,r,o,a);if(i)return i;n._data=n._data||{};var s=n._data[o];if(!s){this.logOpen("".concat(t," ").concat(n.name||""));var l=this.createMaterial(t,n,o);s={babylonMaterial:l,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(t,n,l)},n._data[o]=s,e.AddPointerMetadata(l,t),this._parent.onMaterialLoadedObservable.notifyObservers(l),this.logClose()}return r&&(s.babylonMeshes.push(r),r.onDisposeObservable.addOnce((function(){var e=s.babylonMeshes.indexOf(r);-1!==e&&s.babylonMeshes.splice(e,1)}))),a(s.babylonMaterial),s.promise.then((function(){return s.babylonMaterial}))},e.prototype._createDefaultMaterial=function(e,t){if(!this._pbrMaterialImpl)throw new Error("PBR Material class not loaded");this._babylonScene._blockEntityCollection=!!this._assetContainer;var n=new this._pbrMaterialImpl.materialClass(e,this._babylonScene);n._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,n.fillMode=t,n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_OPAQUE;var r=this._getOrCreateMaterialAdapter(n);return r.transparencyAsAlphaCoverage=this._parent.transparencyAsCoverage,r.baseMetalness=1,r.specularRoughness=1,n},e.prototype.createMaterial=function(e,t,n){var r=this._extensionsCreateMaterial(e,t,n);if(r)return r;var o=t.name||"material".concat(t.index);return this._createDefaultMaterial(o,n)},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var r=this._extensionsLoadMaterialPropertiesAsync(e,t,n);if(r)return r;var o=new Array;return o.push(this.loadMaterialBasePropertiesAsync(e,t,n)),t.pbrMetallicRoughness&&o.push(this._loadMaterialMetallicRoughnessPropertiesAsync("".concat(e,"/pbrMetallicRoughness"),t.pbrMetallicRoughness,n)),this.loadMaterialAlphaProperties(e,t,n),Promise.all(o).then((function(){}))},e.prototype.loadMaterialBasePropertiesAsync=function(e,t,n){var r,a=new Array,i=this._getOrCreateMaterialAdapter(n);i.emissionColor=t.emissiveFactor?o.Color3.FromArray(t.emissiveFactor):new o.Color3(0,0,0),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,a.push(this.loadTextureInfoAsync("".concat(e,"/normalTexture"),t.normalTexture,(function(e){var r;e.name="".concat(n.name," (Normal)"),i.geometryNormalTexture=e,null!=(null===(r=t.normalTexture)||void 0===r?void 0:r.scale)&&(e.level=t.normalTexture.scale)}))),i.setNormalMapInversions(!this._babylonScene.useRightHandedSystem,this._babylonScene.useRightHandedSystem));var s,l=1;return t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,a.push(this.loadTextureInfoAsync("".concat(e,"/occlusionTexture"),t.occlusionTexture,(function(e){e.name="".concat(n.name," (Occlusion)"),r=e}))),null!=t.occlusionTexture.strength&&(l=t.occlusionTexture.strength)),t.emissiveTexture&&a.push(this.loadTextureInfoAsync("".concat(e,"/emissiveTexture"),t.emissiveTexture,(function(e){e.name="".concat(n.name," (Emissive)"),s=e}))),Promise.all(a).then((function(){r&&(i.ambientOcclusionTexture=r,i.ambientOcclusionTextureStrength=l),s&&(i.emissionColorTexture=s)}))},e.prototype.loadMaterialAlphaProperties=function(e,t,n){if(!this._pbrMaterialImpl)throw new Error("".concat(e,": Material type not supported"));var r=this._getOrCreateMaterialAdapter(n),o=r.baseColorTexture;switch(t.alphaMode||"OPAQUE"){case"OPAQUE":n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_OPAQUE,n.alpha=1;break;case"MASK":n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_ALPHATEST,r.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,o&&(o.hasAlpha=!0);break;case"BLEND":n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_ALPHABLEND,o&&(o.hasAlpha=!0,r.useAlphaFromBaseColorTexture=!0);break;default:throw new Error("".concat(e,"/alphaMode: Invalid value (").concat(t.alphaMode,")"))}},e.prototype.loadTextureInfoAsync=function(t,n,r){var o=this;void 0===r&&(r=function(){});var a=this._extensionsLoadTextureInfoAsync(t,n,r);if(a)return a;if(this.logOpen("".concat(t)),n.texCoord>=6)throw new Error("".concat(t,"/texCoord: Invalid value (").concat(n.texCoord,")"));var i=c.Get("".concat(t,"/index"),this._gltf.textures,n.index);i._textureInfo=n;var s=this._loadTextureAsync("/textures/".concat(n.index),i,(function(a){a.coordinatesIndex=n.texCoord||0,e.AddPointerMetadata(a,t),o._parent.onTextureLoadedObservable.notifyObservers(a),r(a)}));return this.logClose(),s},e.prototype._loadTextureAsync=function(t,n,r){void 0===r&&(r=function(){});var o=this._extensionsLoadTextureAsync(t,n,r);if(o)return o;this.logOpen("".concat(t," ").concat(n.name||""));var a=null==n.sampler?e.DefaultSampler:c.Get("".concat(t,"/sampler"),this._gltf.samplers,n.sampler),i=c.Get("".concat(t,"/source"),this._gltf.images,n.source),s=this._createTextureAsync(t,a,i,r,void 0,!n._textureInfo.nonColorData);return this.logClose(),s},e.prototype._createTextureAsync=function(e,t,n,r,a,i){var s,l,u=this;void 0===r&&(r=function(){});var c=this._loadSampler("/samplers/".concat(t.index),t),f=new Array,d=new o.Deferred;this._babylonScene._blockEntityCollection=!!this._assetContainer;var h={noMipmap:c.noMipMaps,invertY:!1,samplingMode:c.samplingMode,onLoad:function(){u._disposed||d.resolve()},onError:function(t,n){u._disposed||d.reject(new Error("".concat(e,": ").concat(n&&n.message?n.message:t||"Failed to load texture")))},mimeType:null!==(s=n.mimeType)&&void 0!==s?s:(0,o.GetMimeType)(null!==(l=n.uri)&&void 0!==l?l:""),loaderOptions:a,useSRGBBuffer:!!i&&this._parent.useSRGBBuffers},p=new o.Texture(null,this._babylonScene,h);return p._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,f.push(d.promise),f.push(this.loadImageAsync("/images/".concat(n.index),n).then((function(e){var t=n.uri||"".concat(u._fileName,"#image").concat(n.index),r="data:".concat(u._uniqueRootUrl).concat(t);p.updateURL(r,e);var o=p.getInternalTexture();o&&(o.label=n.name)}))),p.wrapU=c.wrapU,p.wrapV=c.wrapV,r(p),this._parent.useGltfTextureNames&&(p.name=n.name||n.uri||"image".concat(n.index)),Promise.all(f).then((function(){return p}))},e.prototype._loadSampler=function(t,n){return n._data||(n._data={noMipMaps:9728===n.minFilter||9729===n.minFilter,samplingMode:e._GetTextureSamplingMode(t,n),wrapU:e._GetTextureWrapMode("".concat(t,"/wrapS"),n.wrapS),wrapV:e._GetTextureWrapMode("".concat(t,"/wrapT"),n.wrapT)}),n._data},e.prototype.loadImageAsync=function(e,t){if(!t._data){if(this.logOpen("".concat(e," ").concat(t.name||"")),t.uri)t._data=this.loadUriAsync("".concat(e,"/uri"),t,t.uri);else{var n=c.Get("".concat(e,"/bufferView"),this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync("/bufferViews/".concat(n.index),n)}this.logClose()}return t._data},e.prototype.loadUriAsync=function(t,n,r){var a=this,i=this._extensionsLoadUriAsync(t,n,r);if(i)return i;if(!e._ValidateUri(r))throw new Error("".concat(t,": '").concat(r,"' is invalid"));if((0,o.IsBase64DataUrl)(r)){var s=new Uint8Array((0,o.DecodeBase64UrlToBinary)(r));return this.log("".concat(t,": Decoded ").concat(r.substring(0,64),"... (").concat(s.length," bytes)")),Promise.resolve(s)}return this.log("".concat(t,": Loading ").concat(r)),this._parent.preprocessUrlAsync(this._rootUrl+r).then((function(e){return new Promise((function(n,i){a._parent._loadFile(a._babylonScene,e,(function(e){a._disposed||(a.log("".concat(t,": Loaded ").concat(r," (").concat(e.byteLength," bytes)")),n(new Uint8Array(e)))}),!0,(function(e){i(new o.LoadFileError("".concat(t,": Failed to load '").concat(r,"'").concat(e?": "+e.status+" "+e.statusText:""),e))}))}))}))},e.AddPointerMetadata=function(e,t){e.metadata=e.metadata||{};var n=e._internalMetadata=e._internalMetadata||{},r=n.gltf=n.gltf||{};(r.pointers=r.pointers||[]).push(t)},e._GetTextureWrapMode=function(e,t){switch(t=null==t?10497:t){case 33071:return o.Texture.CLAMP_ADDRESSMODE;case 33648:return o.Texture.MIRROR_ADDRESSMODE;case 10497:return o.Texture.WRAP_ADDRESSMODE;default:return o.Logger.Warn("".concat(e,": Invalid value (").concat(t,")")),o.Texture.WRAP_ADDRESSMODE}},e._GetTextureSamplingMode=function(e,t){var n=null==t.magFilter?9729:t.magFilter,r=null==t.minFilter?9987:t.minFilter;if(9729===n)switch(r){case 9728:return o.Texture.LINEAR_NEAREST;case 9729:return o.Texture.LINEAR_LINEAR;case 9984:return o.Texture.LINEAR_NEAREST_MIPNEAREST;case 9985:return o.Texture.LINEAR_LINEAR_MIPNEAREST;case 9986:return o.Texture.LINEAR_NEAREST_MIPLINEAR;case 9987:return o.Texture.LINEAR_LINEAR_MIPLINEAR;default:return o.Logger.Warn("".concat(e,"/minFilter: Invalid value (").concat(r,")")),o.Texture.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==n&&o.Logger.Warn("".concat(e,"/magFilter: Invalid value (").concat(n,")")),r){case 9728:return o.Texture.NEAREST_NEAREST;case 9729:return o.Texture.NEAREST_LINEAR;case 9984:return o.Texture.NEAREST_NEAREST_MIPNEAREST;case 9985:return o.Texture.NEAREST_LINEAR_MIPNEAREST;case 9986:return o.Texture.NEAREST_NEAREST_MIPLINEAR;case 9987:return o.Texture.NEAREST_LINEAR_MIPLINEAR;default:return o.Logger.Warn("".concat(e,"/minFilter: Invalid value (").concat(r,")")),o.Texture.NEAREST_NEAREST_MIPNEAREST}},e._GetTypedArrayConstructor=function(e,t){try{return(0,o.GetTypedArrayConstructor)(t)}catch(t){throw new Error("".concat(e,": ").concat(t.message),{cause:t})}},e._GetTypedArray=function(t,n,r,a,i){var s=r.buffer;a=r.byteOffset+(a||0);var l=e._GetTypedArrayConstructor("".concat(t,"/componentType"),n),u=o.VertexBuffer.GetTypeByteLength(n);return a%u!==0?(o.Logger.Warn("".concat(t,": Copying buffer as byte offset (").concat(a,") is not a multiple of component type byte length (").concat(u,")")),new l(s.slice(a,a+i*u),0)):new l(s,a,i)},e._GetNumComponents=function(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error("".concat(e,": Invalid type (").concat(t,")"))},e._ValidateUri=function(e){return o.Tools.IsBase64(e)||-1===e.indexOf("..")},e._GetDrawMode=function(e,t){switch(null==t&&(t=4),t){case 0:return o.Material.PointListDrawMode;case 1:return o.Material.LineListDrawMode;case 2:return o.Material.LineLoopDrawMode;case 3:return o.Material.LineStripDrawMode;case 4:return o.Material.TriangleFillMode;case 5:return o.Material.TriangleStripDrawMode;case 6:return o.Material.TriangleFanDrawMode}throw new Error("".concat(e,": Invalid mesh primitive mode (").concat(t,")"))},e.prototype._compileMaterialsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile materials");var t=new Array;if(this._gltf.materials)for(var n=0,r=this._gltf.materials;n<r.length;n++){var o=r[n];if(o._data)for(var a in o._data)for(var i=o._data[a],s=0,l=i.babylonMeshes;s<l.length;s++){var u=l[s];u.computeWorldMatrix(!0);var c=i.babylonMaterial;t.push(c.forceCompilationAsync(u)),t.push(c.forceCompilationAsync(u,{useInstances:!0})),this._parent.useClipPlane&&(t.push(c.forceCompilationAsync(u,{clipPlane:!0})),t.push(c.forceCompilationAsync(u,{clipPlane:!0,useInstances:!0})))}}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile materials")}))},e.prototype._compileShadowGeneratorsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile shadow generators");for(var t=new Array,n=0,r=this._babylonScene.lights;n<r.length;n++){var o=r[n].getShadowGenerator();o&&t.push(o.forceCompilationAsync())}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile shadow generators")}))},e.prototype._forEachExtensions=function(e){for(var t=0,n=this._extensions;t<n.length;t++){var r=n[t];r.enabled&&e(r)}},e.prototype._applyExtensions=function(e,t,n){for(var r=0,o=this._extensions;r<o.length;r++){var a=o[r];if(a.enabled){var i="".concat(a.name,".").concat(t),s=e;s._activeLoaderExtensionFunctions=s._activeLoaderExtensionFunctions||{};var l=s._activeLoaderExtensionFunctions;if(!l[i]){l[i]=!0;try{var u=n(a);if(u)return u}finally{delete l[i]}}}}return null},e.prototype._extensionsOnLoading=function(){this._forEachExtensions((function(e){return e.onLoading&&e.onLoading()}))},e.prototype._extensionsOnReady=function(){this._forEachExtensions((function(e){return e.onReady&&e.onReady()}))},e.prototype._extensionsLoadSceneAsync=function(e,t){return this._applyExtensions(t,"loadScene",(function(n){return n.loadSceneAsync&&n.loadSceneAsync(e,t)}))},e.prototype._extensionsLoadNodeAsync=function(e,t,n){return this._applyExtensions(t,"loadNode",(function(r){return r.loadNodeAsync&&r.loadNodeAsync(e,t,n)}))},e.prototype._extensionsLoadCameraAsync=function(e,t,n){return this._applyExtensions(t,"loadCamera",(function(r){return r.loadCameraAsync&&r.loadCameraAsync(e,t,n)}))},e.prototype._extensionsLoadVertexDataAsync=function(e,t,n){return this._applyExtensions(t,"loadVertexData",(function(r){return r._loadVertexDataAsync&&r._loadVertexDataAsync(e,t,n)}))},e.prototype._extensionsLoadMeshPrimitiveAsync=function(e,t,n,r,o,a){return this._applyExtensions(o,"loadMeshPrimitive",(function(i){return i._loadMeshPrimitiveAsync&&i._loadMeshPrimitiveAsync(e,t,n,r,o,a)}))},e.prototype._extensionsLoadMaterialAsync=function(e,t,n,r,o){return this._applyExtensions(t,"loadMaterial",(function(a){return a._loadMaterialAsync&&a._loadMaterialAsync(e,t,n,r,o)}))},e.prototype._extensionsCreateMaterial=function(e,t,n){return this._applyExtensions(t,"createMaterial",(function(r){return r.createMaterial&&r.createMaterial(e,t,n)}))},e.prototype._extensionsLoadMaterialPropertiesAsync=function(e,t,n){return this._applyExtensions(t,"loadMaterialProperties",(function(r){return r.loadMaterialPropertiesAsync&&r.loadMaterialPropertiesAsync(e,t,n)}))},e.prototype._extensionsLoadTextureInfoAsync=function(e,t,n){return this._applyExtensions(t,"loadTextureInfo",(function(r){return r.loadTextureInfoAsync&&r.loadTextureInfoAsync(e,t,n)}))},e.prototype._extensionsLoadTextureAsync=function(e,t,n){return this._applyExtensions(t,"loadTexture",(function(r){return r._loadTextureAsync&&r._loadTextureAsync(e,t,n)}))},e.prototype._extensionsLoadAnimationAsync=function(e,t){return this._applyExtensions(t,"loadAnimation",(function(n){return n.loadAnimationAsync&&n.loadAnimationAsync(e,t)}))},e.prototype._extensionsLoadAnimationChannelAsync=function(e,t,n,r,o){return this._applyExtensions(n,"loadAnimationChannel",(function(a){return a._loadAnimationChannelAsync&&a._loadAnimationChannelAsync(e,t,n,r,o)}))},e.prototype._extensionsLoadSkinAsync=function(e,t,n){return this._applyExtensions(n,"loadSkin",(function(r){return r._loadSkinAsync&&r._loadSkinAsync(e,t,n)}))},e.prototype._extensionsLoadUriAsync=function(e,t,n){return this._applyExtensions(t,"loadUri",(function(r){return r._loadUriAsync&&r._loadUriAsync(e,t,n)}))},e.prototype._extensionsLoadBufferViewAsync=function(e,t){return this._applyExtensions(t,"loadBufferView",(function(n){return n.loadBufferViewAsync&&n.loadBufferViewAsync(e,t)}))},e.prototype._extensionsLoadBufferAsync=function(e,t,n,r){return this._applyExtensions(t,"loadBuffer",(function(o){return o.loadBufferAsync&&o.loadBufferAsync(e,t,n,r)}))},e.LoadExtensionAsync=function(e,t,n,r){if(!t.extensions)return null;var o=t.extensions[n];return o?r("".concat(e,"/extensions/").concat(n),o):null},e.LoadExtraAsync=function(e,t,n,r){if(!t.extras)return null;var o=t.extras[n];return o?r("".concat(e,"/extras/").concat(n),o):null},e.prototype.isExtensionUsed=function(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)},e.prototype.logOpen=function(e){this._parent._logOpen(e)},e.prototype.logClose=function(){this._parent._logClose()},e.prototype.log=function(e){this._parent._log(e)},e.prototype.startPerformanceCounter=function(e){this._parent._startPerformanceCounter(e)},e.prototype.endPerformanceCounter=function(e){this._parent._endPerformanceCounter(e)},e.DefaultSampler={index:-1},e}();a.GLTFFileLoader._CreateGLTF2Loader=function(e){return new d(e)}},2727(e,t,n){n.r(t),n.d(t,{AnimationPropertyInfo:()=>u,TransformNodeAnimationPropertyInfo:()=>c,WeightAnimationPropertyInfo:()=>f,getQuaternion:()=>s,getVector3:()=>i,getWeights:()=>l});var r=n(8322),o=n(5597),a=n(8698);function i(e,t,n,r){return o.Vector3.FromArray(t,n).scaleInPlace(r)}function s(e,t,n,r){return o.Quaternion.FromArray(t,n).scaleInPlace(r)}function l(e,t,n,r){for(var o=new Array(e._numMorphTargets),a=0;a<o.length;a++)o[a]=t[n++]*r;return o}var u=function(){function e(e,t,n,r){this.type=e,this.name=t,this.getValue=n,this.getStride=r}return e.prototype._buildAnimation=function(e,t,n){var r=new o.Animation(e,this.name,t,this.type);return r.setKeys(n,!0),r},e}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var o=[];return o.push({babylonAnimatable:e._babylonTransformNode,babylonAnimation:this._buildAnimation(t,n,r)}),o},t}(u),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var a=[];if(e._numMorphTargets)for(var i=function(i){var l=new o.Animation("".concat(t,"_").concat(i),s.name,n,s.type);if(l.setKeys(r.map((function(e){return{frame:e.frame,inTangent:e.inTangent?e.inTangent[i]:void 0,value:e.value[i],outTangent:e.outTangent?e.outTangent[i]:void 0,interpolation:e.interpolation}})),!0),e._primitiveBabylonMeshes)for(var u=0,c=e._primitiveBabylonMeshes;u<c.length;u++){var f=c[u];if(f.morphTargetManager){var d=f.morphTargetManager.getTarget(i),h=l.clone();d.animations.push(h),a.push({babylonAnimatable:d,babylonAnimation:h})}}},s=this,l=0;l<e._numMorphTargets;l++)i(l);return a},t}(u);(0,a.ZU)("/nodes/{}/translation",[new c(o.Animation.ANIMATIONTYPE_VECTOR3,"position",i,(function(){return 3}))]),(0,a.ZU)("/nodes/{}/rotation",[new c(o.Animation.ANIMATIONTYPE_QUATERNION,"rotationQuaternion",s,(function(){return 4}))]),(0,a.ZU)("/nodes/{}/scale",[new c(o.Animation.ANIMATIONTYPE_VECTOR3,"scaling",i,(function(){return 3}))]),(0,a.ZU)("/nodes/{}/weights",[new f(o.Animation.ANIMATIONTYPE_FLOAT,"influence",l,(function(e){return e._numMorphTargets}))])},4015(e,t,n){n.d(t,{Hg:()=>s,Sv:()=>a,Ye:()=>i});var r=n(5597),o=new Map,a=o;function i(e,t,n){s(e)&&r.Logger.Warn("Extension with the name '".concat(e,"' already exists")),o.set(e,{isGLTFExtension:t,factory:n})}function s(e){return o.delete(e)}},3833(e,t,n){n.r(t),n.d(t,{OpenPBRMaterialLoadingAdapter:()=>o});var r=n(5597),o=function(){function e(e){this._extinctionCoefficient=r.Vector3.Zero(),this._material=e}return Object.defineProperty(e.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUnlit",{get:function(){return this._material.unlit},set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backFaceCulling",{get:function(){return this._material.backFaceCulling},set:function(e){this._material.backFaceCulling=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"twoSidedLighting",{get:function(){return this._material.twoSidedLighting},set:function(e){this._material.twoSidedLighting=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaCutOff",{get:function(){return.5},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useAlphaFromBaseColorTexture",{get:function(){return!1},set:function(e){this._material._useAlphaFromBaseColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transparencyAsAlphaCoverage",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColor",{get:function(){return this._material.baseColor},set:function(e){this._material.baseColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColorTexture",{get:function(){return this._material.baseColorTexture},set:function(e){this._material.baseColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughness",{get:function(){return this._material.baseDiffuseRoughness},set:function(e){this._material.baseDiffuseRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughnessTexture",{get:function(){return this._material.baseDiffuseRoughnessTexture},set:function(e){this._material.baseDiffuseRoughnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalness",{get:function(){return this._material.baseMetalness},set:function(e){this._material.baseMetalness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalnessTexture",{get:function(){return this._material.baseMetalnessTexture},set:function(e){this._material.baseMetalnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useRoughnessFromMetallicTextureGreen",{set:function(e){this._material._useRoughnessFromMetallicTextureGreen=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useMetallicFromMetallicTextureBlue",{set:function(e){this._material._useMetallicFromMetallicTextureBlue=e},enumerable:!1,configurable:!0}),e.prototype.enableSpecularEdgeColor=function(e){void 0===e&&(e=!1)},Object.defineProperty(e.prototype,"specularWeight",{get:function(){return this._material.specularWeight},set:function(e){this._material.specularWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularWeightTexture",{get:function(){return this._material.specularWeightTexture},set:function(e){this._material.specularColorTexture===e?(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0):this._material.specularWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColor",{get:function(){return this._material.specularColor},set:function(e){this._material.specularColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColorTexture",{get:function(){return this._material.specularColorTexture},set:function(e){this._material.specularColorTexture=e,this._material.specularWeightTexture===this._material.specularColorTexture&&(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughness",{get:function(){return this._material.specularRoughness},set:function(e){this._material.specularRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessTexture",{get:function(){return this._material.specularRoughnessTexture},set:function(e){this._material.specularRoughnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularIor",{get:function(){return this._material.specularIor},set:function(e){this._material.specularIor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColor",{get:function(){return this._material.emissionColor},set:function(e){this._material.emissionColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionLuminance",{get:function(){return this._material.emissionLuminance},set:function(e){this._material.emissionLuminance=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColorTexture",{get:function(){return this._material.emissionColorTexture},set:function(e){this._material.emissionColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTexture",{get:function(){return this._material.ambientOcclusionTexture},set:function(e){this._material.ambientOcclusionTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTextureStrength",{get:function(){var e,t=this._material.ambientOcclusionTexture;return null!==(e=null==t?void 0:t.level)&&void 0!==e?e:1},set:function(e){var t=this._material.ambientOcclusionTexture;t&&(t.level=e)},enumerable:!1,configurable:!0}),e.prototype.configureCoat=function(){},Object.defineProperty(e.prototype,"coatWeight",{get:function(){return this._material.coatWeight},set:function(e){this._material.coatWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatWeightTexture",{get:function(){return this._material.coatWeightTexture},set:function(e){this._material.coatWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColor",{set:function(e){this._material.coatColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColorTexture",{set:function(e){this._material.coatColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughness",{get:function(){return this._material.coatRoughness},set:function(e){this._material.coatRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessTexture",{get:function(){return this._material.coatRoughnessTexture},set:function(e){this._material.coatRoughnessTexture=e,e&&(this._material._useCoatRoughnessFromGreenChannel=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatIor",{set:function(e){this._material.coatIor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkening",{set:function(e){this._material.coatDarkening=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkeningTexture",{set:function(e){this._material.coatDarkeningTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessAnisotropy",{get:function(){return this._material.coatRoughnessAnisotropy},set:function(e){this._material.coatRoughnessAnisotropy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentAngle",{set:function(e){this._material.geometryCoatTangentAngle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentTexture",{get:function(){return this._material.geometryCoatTangentTexture},set:function(e){this._material.geometryCoatTangentTexture=e,e&&(this._material._useCoatRoughnessAnisotropyFromTangentTexture=!0)},enumerable:!1,configurable:!0}),e.prototype.configureTransmission=function(){},Object.defineProperty(e.prototype,"transmissionWeight",{get:function(){return this._material.transmissionWeight},set:function(e){this._material.transmissionWeight=e,this._material.transmissionColor=this._material.baseColor,this._material.transmissionColorTexture=this._material.baseColorTexture,this._material.transmissionDepth=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionWeightTexture",{set:function(e){this._material.transmissionWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatter",{get:function(){return this._material.transmissionScatter},set:function(e){this._material.transmissionScatter=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatterTexture",{get:function(){return this._material.transmissionScatterTexture},set:function(e){this._material.transmissionScatterTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatterAnisotropy",{set:function(e){this._material.transmissionScatterAnisotropy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionAbbeNumber",{set:function(e){this._material.transmissionDispersionAbbeNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionScale",{set:function(e){this._material.transmissionDispersionScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDepth",{get:function(){return this._material.transmissionDepth},set:function(e){e!==Number.MAX_VALUE||0!==this._material.transmissionDepth?this._material.transmissionDepth=e:this._material.transmissionDepth=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionColor",{get:function(){return this._material.transmissionColor},set:function(e){e.equals(r.Color3.White())||(this._material.transmissionColor=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refractionBackgroundTexture",{get:function(){return this._material.backgroundRefractionTexture},set:function(e){this._material.backgroundRefractionTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeThicknessTexture",{set:function(e){this._material.geometryThicknessTexture=e,this._material._useGeometryThicknessFromGreenChannel=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeThickness",{set:function(e){this._material.geometryThickness=e},enumerable:!1,configurable:!0}),e.prototype.configureSubsurface=function(){},Object.defineProperty(e.prototype,"extinctionCoefficient",{get:function(){return this._extinctionCoefficient},set:function(e){this._extinctionCoefficient=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeight",{get:function(){return 0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeightTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColor",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColorTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTint",{get:function(){return r.Color3.White()},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTintTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadius",{get:function(){return 0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadiusScale",{get:function(){return r.Color3.White()},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceScatterAnisotropy",{set:function(e){},enumerable:!1,configurable:!0}),e.prototype.configureFuzz=function(){},Object.defineProperty(e.prototype,"fuzzWeight",{set:function(e){this._material.fuzzWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzWeightTexture",{set:function(e){this._material.fuzzWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColor",{set:function(e){this._material.fuzzColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColorTexture",{set:function(e){this._material.fuzzColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughness",{set:function(e){this._material.fuzzRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughnessTexture",{set:function(e){this._material.fuzzRoughnessTexture=e,this._material._useFuzzRoughnessFromTextureAlpha=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessAnisotropy",{get:function(){return this._material.specularRoughnessAnisotropy},set:function(e){this._material.specularRoughnessAnisotropy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentAngle",{set:function(e){this._material.geometryTangentAngle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentTexture",{get:function(){return this._material.geometryTangentTexture},set:function(e){this._material.geometryTangentTexture=e,this._material._useSpecularRoughnessAnisotropyFromTangentTexture=!0},enumerable:!1,configurable:!0}),e.prototype.configureGltfStyleAnisotropy=function(e){void 0===e&&(e=!0),this._material._useGltfStyleAnisotropy=e},Object.defineProperty(e.prototype,"thinFilmWeight",{set:function(e){this._material.thinFilmWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmIor",{set:function(e){this._material.thinFilmIor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMinimum",{set:function(e){this._material.thinFilmThicknessMin=e/1e3},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMaximum",{set:function(e){this._material.thinFilmThickness=e/1e3},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmWeightTexture",{set:function(e){this._material.thinFilmWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessTexture",{set:function(e){this._material.thinFilmThicknessTexture=e,this._material._useThinFilmThicknessFromTextureGreen=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unlit",{set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryOpacity",{get:function(){return this._material.geometryOpacity},set:function(e){this._material.geometryOpacity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryNormalTexture",{get:function(){return this._material.geometryNormalTexture},set:function(e){this._material.geometryNormalTexture=e},enumerable:!1,configurable:!0}),e.prototype.setNormalMapInversions=function(e,t){},Object.defineProperty(e.prototype,"geometryCoatNormalTexture",{get:function(){return this._material.geometryCoatNormalTexture},set:function(e){this._material.geometryCoatNormalTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatNormalTextureScale",{set:function(e){this._material.geometryCoatNormalTexture&&(this._material.geometryCoatNormalTexture.level=e)},enumerable:!1,configurable:!0}),e}()},2561(e,t,n){n.r(t),n.d(t,{PBRMaterialLoadingAdapter:()=>o});var r=n(5597),o=function(){function e(e){this._extinctionCoefficient=r.Vector3.Zero(),this._material=e,this._material.enableSpecularAntiAliasing=!0}return Object.defineProperty(e.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUnlit",{get:function(){return this._material.unlit},set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backFaceCulling",{get:function(){return this._material.backFaceCulling},set:function(e){this._material.backFaceCulling=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"twoSidedLighting",{get:function(){return this._material.twoSidedLighting},set:function(e){this._material.twoSidedLighting=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaCutOff",{get:function(){return this._material.alphaCutOff},set:function(e){this._material.alphaCutOff=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useAlphaFromBaseColorTexture",{get:function(){return this._material.useAlphaFromAlbedoTexture},set:function(e){this._material.useAlphaFromAlbedoTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transparencyAsAlphaCoverage",{get:function(){return this._material.useRadianceOverAlpha||this._material.useSpecularOverAlpha},set:function(e){this._material.useRadianceOverAlpha=!e,this._material.useSpecularOverAlpha=!e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColor",{get:function(){return this._material.albedoColor},set:function(e){this._material.albedoColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColorTexture",{get:function(){return this._material.albedoTexture},set:function(e){this._material.albedoTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughness",{get:function(){var e;return null!==(e=this._material.baseDiffuseRoughness)&&void 0!==e?e:0},set:function(e){this._material.baseDiffuseRoughness=e,e>0&&(this._material.brdf.baseDiffuseModel=r.Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughnessTexture",{get:function(){return this._material.baseDiffuseRoughnessTexture},set:function(e){this._material.baseDiffuseRoughnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalness",{get:function(){var e;return null!==(e=this._material.metallic)&&void 0!==e?e:1},set:function(e){this._material.metallic=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalnessTexture",{get:function(){return this._material.metallicTexture},set:function(e){this._material.metallicTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useRoughnessFromMetallicTextureGreen",{set:function(e){this._material.useRoughnessFromMetallicTextureGreen=e,this._material.useRoughnessFromMetallicTextureAlpha=!e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useMetallicFromMetallicTextureBlue",{set:function(e){this._material.useMetallnessFromMetallicTextureBlue=e},enumerable:!1,configurable:!0}),e.prototype.enableSpecularEdgeColor=function(e){void 0===e&&(e=!1),e&&(this._material.brdf.dielectricSpecularModel=r.Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR,this._material.brdf.conductorSpecularModel=r.Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR)},Object.defineProperty(e.prototype,"specularWeight",{get:function(){var e;return null!==(e=this._material.metallicF0Factor)&&void 0!==e?e:1},set:function(e){this._material.metallicF0Factor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularWeightTexture",{get:function(){return this._material.metallicReflectanceTexture},set:function(e){e?(this._material.metallicReflectanceTexture=e,this._material.useOnlyMetallicFromMetallicReflectanceTexture=!0):(this._material.metallicReflectanceTexture=null,this._material.useOnlyMetallicFromMetallicReflectanceTexture=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColor",{get:function(){return this._material.metallicReflectanceColor},set:function(e){this._material.metallicReflectanceColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColorTexture",{get:function(){return this._material.reflectanceTexture},set:function(e){this._material.reflectanceTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughness",{get:function(){var e;return null!==(e=this._material.roughness)&&void 0!==e?e:1},set:function(e){this._material.roughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessTexture",{get:function(){return this._material.metallicTexture},set:function(e){this.baseMetalnessTexture||(this._material.metallicTexture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularIor",{get:function(){return this._material.indexOfRefraction},set:function(e){this._material.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColor",{get:function(){return this._material.emissiveColor},set:function(e){this._material.emissiveColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionLuminance",{get:function(){return this._material.emissiveIntensity},set:function(e){this._material.emissiveIntensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColorTexture",{get:function(){return this._material.emissiveTexture},set:function(e){this._material.emissiveTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTexture",{get:function(){return this._material.ambientTexture},set:function(e){this._material.ambientTexture=e,e&&(this._material.useAmbientInGrayScale=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTextureStrength",{get:function(){var e;return null!==(e=this._material.ambientTextureStrength)&&void 0!==e?e:1},set:function(e){this._material.ambientTextureStrength=e},enumerable:!1,configurable:!0}),e.prototype.configureCoat=function(){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.useRoughnessFromMainTexture=!1,this._material.clearCoat.remapF0OnInterfaceChange=!1},Object.defineProperty(e.prototype,"coatWeight",{get:function(){return this._material.clearCoat.intensity},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatWeightTexture",{get:function(){return this._material.clearCoat.texture},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColor",{set:function(e){this._material.clearCoat.isTintEnabled=e!=r.Color3.White(),this._material.clearCoat.tintColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColorTexture",{set:function(e){this._material.clearCoat.tintTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughness",{get:function(){var e;return null!==(e=this._material.clearCoat.roughness)&&void 0!==e?e:0},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.roughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessTexture",{get:function(){return this._material.clearCoat.textureRoughness},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.useRoughnessFromMainTexture=!1,this._material.clearCoat.textureRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatIor",{set:function(e){this._material.clearCoat.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkening",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkeningTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessAnisotropy",{get:function(){return 0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentAngle",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentTexture",{get:function(){return null},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionWeight",{get:function(){return this._material.subSurface.isRefractionEnabled?this._material.subSurface.refractionIntensity:0},set:function(e){this._material.subSurface.isRefractionEnabled=e>0,this._material.subSurface.refractionIntensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionWeightTexture",{set:function(e){this._material.subSurface.isRefractionEnabled=!0,this._material.subSurface.refractionIntensityTexture=e,this._material.subSurface.useGltfStyleTextures=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDepth",{get:function(){return this.transmissionWeight>0?this._material.subSurface.tintColorAtDistance:0},set:function(e){this.transmissionWeight>0?this._material.subSurface.tintColorAtDistance=e:this.subsurfaceWeight>0&&this._material.subSurface.diffusionDistance.multiplyInPlace(new r.Color3(e,e,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionColor",{get:function(){return this.transmissionWeight>0?this._material.subSurface.tintColor:this.subsurfaceWeight>0?this._material.subSurface.diffusionDistance:new r.Color3(0,0,0)},set:function(e){this.transmissionWeight>0?this._material.subSurface.tintColor=e:this.subsurfaceWeight>0&&this._material.subSurface.diffusionDistance.multiplyInPlace(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatter",{get:function(){return this._material.subSurface.diffusionDistance},set:function(e){this._material.subSurface.diffusionDistance=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatterAnisotropy",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionAbbeNumber",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionScale",{set:function(e){e>0?(this._material.subSurface.isDispersionEnabled=!0,this._material.subSurface.dispersion=20/e):(this._material.subSurface.isDispersionEnabled=!1,this._material.subSurface.dispersion=0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refractionBackgroundTexture",{get:function(){return this._material.subSurface.refractionTexture},set:function(e){this._material.subSurface.refractionTexture=e},enumerable:!1,configurable:!0}),e.prototype.configureTransmission=function(){this._material.subSurface.volumeIndexOfRefraction=1,this._material.subSurface.useAlbedoToTintRefraction=!0,this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=0},Object.defineProperty(e.prototype,"volumeThicknessTexture",{set:function(e){this._material.subSurface.thicknessTexture=e,this._material.subSurface.useGltfStyleTextures=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeThickness",{set:function(e){this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=e,this._material.subSurface.useThicknessAsDepth=!0,e>0&&(this._material.subSurface.volumeIndexOfRefraction=this._material.indexOfRefraction)},enumerable:!1,configurable:!0}),e.prototype.configureSubsurface=function(){this._material.subSurface.useGltfStyleTextures=!0,this._material.subSurface.volumeIndexOfRefraction=1,this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=0,this._material.subSurface.useAlbedoToTintTranslucency=!1},Object.defineProperty(e.prototype,"extinctionCoefficient",{get:function(){return this._extinctionCoefficient},set:function(e){this._extinctionCoefficient=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeight",{get:function(){return this._material.subSurface.isTranslucencyEnabled?this._material.subSurface.translucencyIntensity:0},set:function(e){this._material.subSurface.isTranslucencyEnabled=e>0,this._material.subSurface.translucencyIntensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeightTexture",{set:function(e){this._material.subSurface.translucencyIntensityTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColor",{set:function(e){var t=this.extinctionCoefficient,n=Math.max(t.x,Math.max(t.y,t.z)),o=n>0?1/n:1;this._material.subSurface.diffusionDistance=new r.Color3(Math.exp(-t.x*o),Math.exp(-t.y*o),Math.exp(-t.z*o))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColorTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTint",{get:function(){return this._material.subSurface.tintColor},set:function(e){this._material.subSurface.tintColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTintTexture",{set:function(e){this._material.subSurface.translucencyColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadius",{get:function(){return 1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadiusScale",{get:function(){var e;return null!==(e=this._material.subSurface.scatteringDiffusionProfile)&&void 0!==e?e:r.Color3.White()},set:function(e){this._material.subSurface.scatteringDiffusionProfile=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceScatterAnisotropy",{set:function(e){},enumerable:!1,configurable:!0}),e.prototype.configureFuzz=function(){this._material.sheen.isEnabled=!0,this._material.sheen.useRoughnessFromMainTexture=!1,this._material.sheen.albedoScaling=!0},Object.defineProperty(e.prototype,"fuzzWeight",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzWeightTexture",{set:function(e){this._material.sheen.texture||(this._material.sheen.texture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColor",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.color=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColorTexture",{set:function(e){this._material.sheen.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughness",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.roughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughnessTexture",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.textureRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessAnisotropy",{get:function(){return this._material.anisotropy.intensity},set:function(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentAngle",{set:function(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.angle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentTexture",{get:function(){return this._material.anisotropy.texture},set:function(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.texture=e},enumerable:!1,configurable:!0}),e.prototype.configureGltfStyleAnisotropy=function(e){void 0===e&&(e=!0)},Object.defineProperty(e.prototype,"thinFilmWeight",{set:function(e){this._material.iridescence.isEnabled=e>0,this._material.iridescence.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmIor",{set:function(e){this._material.iridescence.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMinimum",{set:function(e){this._material.iridescence.minimumThickness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMaximum",{set:function(e){this._material.iridescence.maximumThickness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmWeightTexture",{set:function(e){this._material.iridescence.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessTexture",{set:function(e){this._material.iridescence.thicknessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unlit",{set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryOpacity",{get:function(){return this._material.alpha},set:function(e){this._material.alpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryNormalTexture",{get:function(){return this._material.bumpTexture},set:function(e){this._material.bumpTexture=e,this._material.forceIrradianceInFragment=!0},enumerable:!1,configurable:!0}),e.prototype.setNormalMapInversions=function(e,t){this._material.invertNormalMapX=e,this._material.invertNormalMapY=t},Object.defineProperty(e.prototype,"geometryCoatNormalTexture",{get:function(){return this._material.clearCoat.bumpTexture},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.bumpTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatNormalTextureScale",{set:function(e){this._material.clearCoat.bumpTexture&&(this._material.clearCoat.bumpTexture.level=e)},enumerable:!1,configurable:!0}),e}()},6423(e,t,n){n.d(t,{_:()=>o,i:()=>r});var r="Z2xURg",o={name:"gltf",extensions:{".gltf":{isBinary:!1,mimeType:"model/gltf+json"},".glb":{isBinary:!0,mimeType:"model/gltf-binary"}},canDirectLoad:function(e){return-1!==e.indexOf("asset")&&-1!==e.indexOf("version")||e.startsWith("data:base64,"+r)||e.startsWith("data:;base64,"+r)||e.startsWith("data:application/octet-stream;base64,"+r)||e.startsWith("data:model/gltf-binary;base64,"+r)}}},6086(e,t,n){n.r(t),n.d(t,{GLTFFileLoader:()=>p,GLTFLoaderAnimationStartMode:()=>o,GLTFLoaderCoordinateSystemMode:()=>r,GLTFLoaderDefaultOptions:()=>d,GLTFLoaderState:()=>a});var r,o,a,i=n(8322),s=n(5597),l=n(6472),u=n(6423);function c(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"}(r||(r={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(o||(o={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(a||(a={}));var f=function(){this.alwaysComputeBoundingBox=!1,this.alwaysComputeSkeletonRootNode=!1,this.animationStartMode=o.FIRST,this.compileMaterials=!1,this.compileShadowGenerators=!1,this.coordinateSystemMode=r.AUTO,this.createInstances=!0,this.loadAllMaterials=!1,this.loadMorphTargets=!0,this.loadNodeAnimations=!0,this.loadOnlyMaterials=!1,this.loadSkins=!0,this.skipMaterials=!1,this.targetFps=60,this.transparencyAsCoverage=!1,this.useClipPlane=!1,this.useGltfTextureNames=!1,this.useRangeRequests=!1,this.useSRGBBuffers=!0,this.validate=!1,this.useOpenPBR=!1,this.dontUseTransmissionHelper=!1},d=new f,h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.extensionOptions={},t.preprocessUrlAsync=function(e){return Promise.resolve(e)},t}return(0,i.C6)(t,e),t.prototype.copyFrom=function(e){var t,n,r,o,a,i,s,l,u,c,f,d,h,p,m,_,g,b,y,v,T,x,A,w,O,C;e&&(this.alwaysComputeBoundingBox=null!==(t=e.alwaysComputeBoundingBox)&&void 0!==t?t:this.alwaysComputeBoundingBox,this.alwaysComputeSkeletonRootNode=null!==(n=e.alwaysComputeSkeletonRootNode)&&void 0!==n?n:this.alwaysComputeSkeletonRootNode,this.animationStartMode=null!==(r=e.animationStartMode)&&void 0!==r?r:this.animationStartMode,this.capturePerformanceCounters=null!==(o=e.capturePerformanceCounters)&&void 0!==o?o:this.capturePerformanceCounters,this.compileMaterials=null!==(a=e.compileMaterials)&&void 0!==a?a:this.compileMaterials,this.compileShadowGenerators=null!==(i=e.compileShadowGenerators)&&void 0!==i?i:this.compileShadowGenerators,this.coordinateSystemMode=null!==(s=e.coordinateSystemMode)&&void 0!==s?s:this.coordinateSystemMode,this.createInstances=null!==(l=e.createInstances)&&void 0!==l?l:this.createInstances,this.customRootNode=e.customRootNode,this.extensionOptions=null!==(u=e.extensionOptions)&&void 0!==u?u:this.extensionOptions,this.loadAllMaterials=null!==(c=e.loadAllMaterials)&&void 0!==c?c:this.loadAllMaterials,this.loadMorphTargets=null!==(f=e.loadMorphTargets)&&void 0!==f?f:this.loadMorphTargets,this.loadNodeAnimations=null!==(d=e.loadNodeAnimations)&&void 0!==d?d:this.loadNodeAnimations,this.loadOnlyMaterials=null!==(h=e.loadOnlyMaterials)&&void 0!==h?h:this.loadOnlyMaterials,this.loadSkins=null!==(p=e.loadSkins)&&void 0!==p?p:this.loadSkins,this.loggingEnabled=null!==(m=e.loggingEnabled)&&void 0!==m?m:this.loggingEnabled,this.onCameraLoaded=e.onCameraLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onMeshLoaded=e.onMeshLoaded,this.onParsed=e.onParsed,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onValidated=e.onValidated,this.preprocessUrlAsync=null!==(_=e.preprocessUrlAsync)&&void 0!==_?_:this.preprocessUrlAsync,this.skipMaterials=null!==(g=e.skipMaterials)&&void 0!==g?g:this.skipMaterials,this.targetFps=null!==(b=e.targetFps)&&void 0!==b?b:this.targetFps,this.transparencyAsCoverage=null!==(y=e.transparencyAsCoverage)&&void 0!==y?y:this.transparencyAsCoverage,this.useClipPlane=null!==(v=e.useClipPlane)&&void 0!==v?v:this.useClipPlane,this.useGltfTextureNames=null!==(T=e.useGltfTextureNames)&&void 0!==T?T:this.useGltfTextureNames,this.useOpenPBR=null!==(x=e.useOpenPBR)&&void 0!==x?x:this.useOpenPBR,this.useRangeRequests=null!==(A=e.useRangeRequests)&&void 0!==A?A:this.useRangeRequests,this.useSRGBBuffers=null!==(w=e.useSRGBBuffers)&&void 0!==w?w:this.useSRGBBuffers,this.validate=null!==(O=e.validate)&&void 0!==O?O:this.validate,this.dontUseTransmissionHelper=null!==(C=e.dontUseTransmissionHelper)&&void 0!==C?C:this.dontUseTransmissionHelper)},t}(f),p=function(e){function t(t){var n=e.call(this)||this;return n.onParsedObservable=new s.Observable,n.onMeshLoadedObservable=new s.Observable,n.onSkinLoadedObservable=new s.Observable,n.onTextureLoadedObservable=new s.Observable,n.onMaterialLoadedObservable=new s.Observable,n.onCameraLoadedObservable=new s.Observable,n.onCompleteObservable=new s.Observable,n.onErrorObservable=new s.Observable,n.onDisposeObservable=new s.Observable,n.onExtensionLoadedObservable=new s.Observable,n.onValidatedObservable=new s.Observable,n._loader=null,n._state=null,n._requests=new Array,n.name=u._.name,n.extensions=u._.extensions,n.onLoaderStateChangedObservable=new s.Observable,n._logIndentLevel=0,n._loggingEnabled=!1,n._log=n._logDisabled,n._capturePerformanceCounters=!1,n._startPerformanceCounter=n._startPerformanceCounterDisabled,n._endPerformanceCounter=n._endPerformanceCounterDisabled,n.copyFrom(Object.assign((0,i.Cl)({},d),t)),n}return(0,i.C6)(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,l){var u=this;if(ArrayBuffer.isView(t))return this._loadBinary(e,t,n,r,i,l),null;this._progressCallback=o;var f=t.name||s.Tools.GetFilename(t);if(a){if(this.useRangeRequests){this.validate&&s.Logger.Warn("glTF validation is not supported when range requests are enabled");var d={abort:function(){},onCompleteObservable:new s.Observable},h={readAsync:function(n,r){return new Promise((function(o,a){u._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 s.DataReader(h)).then((function(e){d.onCompleteObservable.notifyObservers(d),r(e)}),i?function(e){return i(void 0,e)}:void 0),d}return this._loadFile(e,t,(function(t){u._validate(e,new Uint8Array(t,0,t.byteLength),n,f),u._unpackBinaryAsync(new s.DataReader({readAsync:function(e,n){return c(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{u._validate(e,t,n,f),r({json:u._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 s.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 s.AssetContainer(e),l=[];a.onMaterialLoadedObservable.add((function(e){l.push(e)}));var u=[];a.onTextureLoadedObservable.add((function(e){u.push(e)}));var c=[];a.onCameraLoadedObservable.add((function(e){c.push(e)}));var f=[];return a.onMeshLoadedObservable.add((function(e){e.morphTargetManager&&f.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,l),Array.prototype.push.apply(i.textures,u),Array.prototype.push.apply(i.lights,e.lights),Array.prototype.push.apply(i.transformNodes,e.transformNodes),Array.prototype.push.apply(i.cameras,c),Array.prototype.push.apply(i.morphTargetManagers,f),i}))}))},t.prototype.canDirectLoad=function(e){return u._.canDirectLoad(e)},t.prototype.directLoad=function(e,t){if(t.startsWith("base64,"+u.i)||t.startsWith(";base64,"+u.i)||t.startsWith("application/octet-stream;base64,"+u.i)||t.startsWith("model/gltf-binary;base64,"+u.i)){var n=(0,s.DecodeBase64UrlToBinary)(t);return this._validate(e,new Uint8Array(n,0,n.byteLength)),this._unpackBinaryAsync(new s.DataReader({readAsync:function(e,t){return c(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[u._.name])},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(a[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"),l.GLTFValidation.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"),s.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 s.RuntimeError("Unexpected magic: "+n,s.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||s.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);s.Logger.Log("".concat(n).concat(e))},t.prototype._logDisabled=function(e){},t.prototype._startPerformanceCounterEnabled=function(e){s.Tools.StartPerformanceCounter(e)},t.prototype._startPerformanceCounterDisabled=function(e){},t.prototype._endPerformanceCounterEnabled=function(e){s.Tools.EndPerformanceCounter(e)},t.prototype._endPerformanceCounterDisabled=function(e){},t.IncrementalLoading=!0,t.HomogeneousCoordinates=!1,t._logSpaces=" ",t}(h);(0,s.RegisterSceneLoaderPlugin)(new p)},6472(e,t,n){n.r(t),n.d(t,{GLTFValidation:()=>i});var r=n(5597);function o(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 a(){var e=[];onmessage=function(t){var n=t.data;switch(n.id){case"init":importScripts(n.url);break;case"validate":o(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 i=function(){function e(){}return e.ValidateAsync=function(t,n,i,s){var l=this;return"function"==typeof Worker?new Promise((function(u,c){var f="".concat(o,"(").concat(a,")()"),d=URL.createObjectURL(new Blob([f],{type:"application/javascript"})),h=new Worker(d),p=function(e){h.removeEventListener("error",p),h.removeEventListener("message",m),c(e)},m=function(t){var n=t.data;switch(n.id){case"getExternalResource":s(n.uri).then((function(e){h.postMessage({id:"getExternalResource.resolve",index:n.index,value:e},[e.buffer])}),(function(e){h.postMessage({id:"getExternalResource.reject",index:n.index,reason:e})}));break;case"validate.resolve":h.removeEventListener("error",p),h.removeEventListener("message",m),e._LastResults=n.value,u(n.value),h.terminate();break;case"validate.reject":h.removeEventListener("error",p),h.removeEventListener("message",m),c(n.reason),h.terminate()}};if(h.addEventListener("error",p),h.addEventListener("message",m),h.postMessage({id:"init",url:r.Tools.GetBabylonScriptURL(l.Configuration.url)}),ArrayBuffer.isView(t)){var _=t.slice();h.postMessage({id:"validate",data:_,rootUrl:n,fileName:i},[_.buffer])}else h.postMessage({id:"validate",data:t,rootUrl:n,fileName:i})})):(this._LoadScriptPromise||(this._LoadScriptPromise=r.Tools.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return o(t,n,i,s)})))},e.Configuration={url:"".concat(r.Tools._DefaultCdnUrl,"/gltf_validator.js")},e._LastResults=null,e}()},5597(t){t.exports=e},8322(e,t,n){n.d(t,{C6:()=>o,Cl:()=>a,YH:()=>s,fX:()=>l,sH:()=>i});var r=function(e,t){return r=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])},r(e,t)};function o(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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var s=2&r&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};a.d(i,{default:()=>Lt});var s={};a.r(s),a.d(s,{BVHFileLoader:()=>O.BVHFileLoader,ReadBvh:()=>w.R});var l={};a.r(l),a.d(l,{EBlendingFunction:()=>A,EComponentType:()=>_,ECullingType:()=>x,EParameterType:()=>b,EShaderType:()=>g,ETextureFilterType:()=>v,ETextureFormat:()=>T,ETextureWrapMode:()=>y,GLTFBinaryExtension:()=>te,GLTFLoader:()=>$,GLTFLoaderBase:()=>Q,GLTFLoaderExtension:()=>ee,GLTFMaterialsCommonExtension:()=>ne,GLTFUtils:()=>R});var u={};a.r(u);var c={};a.r(c),a.d(c,{AddObjectAccessorToKey:()=>le.oR,EXT_lights_area:()=>ge.EXT_lights_area,EXT_lights_ies:()=>pe.EXT_lights_ies,EXT_lights_image_based:()=>ue.EXT_lights_image_based,EXT_mesh_gpu_instancing:()=>ce.EXT_mesh_gpu_instancing,EXT_meshopt_compression:()=>fe.EXT_meshopt_compression,EXT_texture_avif:()=>he.EXT_texture_avif,EXT_texture_webp:()=>de.EXT_texture_webp,ExtrasAsMetadata:()=>Qe.ExtrasAsMetadata,FlowGraphGLTFDataProvider:()=>tt.FlowGraphGLTFDataProvider,GetMappingForKey:()=>le.tQ,GetPathToObjectConverter:()=>le.Wt,InteractivityGraphToFlowGraphParser:()=>et.W,KHR_animation_pointer:()=>Ue.KHR_animation_pointer,KHR_draco_mesh_compression:()=>me.KHR_draco_mesh_compression,KHR_interactivity:()=>Ze.KHR_interactivity,KHR_lights:()=>_e.KHR_lights,KHR_materials_anisotropy:()=>we.KHR_materials_anisotropy,KHR_materials_clearcoat:()=>ve.KHR_materials_clearcoat,KHR_materials_coat:()=>xe,KHR_materials_diffuse_roughness:()=>He.KHR_materials_diffuse_roughness,KHR_materials_diffuse_transmission:()=>Se.KHR_materials_diffuse_transmission,KHR_materials_dispersion:()=>ke.KHR_materials_dispersion,KHR_materials_emissive_strength:()=>Oe.KHR_materials_emissive_strength,KHR_materials_fuzz:()=>Ee,KHR_materials_ior:()=>Fe.KHR_materials_ior,KHR_materials_iridescence:()=>Ae.KHR_materials_iridescence,KHR_materials_pbrSpecularGlossiness:()=>be.KHR_materials_pbrSpecularGlossiness,KHR_materials_sheen:()=>Ce.KHR_materials_sheen,KHR_materials_specular:()=>Le.KHR_materials_specular,KHR_materials_transmission:()=>Pe.KHR_materials_transmission,KHR_materials_unlit:()=>ye.KHR_materials_unlit,KHR_materials_variants:()=>Re.KHR_materials_variants,KHR_materials_volume:()=>Ie.KHR_materials_volume,KHR_materials_volume_scatter:()=>Be,KHR_mesh_quantization:()=>Ge.KHR_mesh_quantization,KHR_node_hoverability:()=>Je.KHR_node_hoverability,KHR_node_selectability:()=>Xe.KHR_node_selectability,KHR_node_visibility:()=>qe.KHR_node_visibility,KHR_texture_basisu:()=>Ve.KHR_texture_basisu,KHR_texture_transform:()=>De.KHR_texture_transform,KHR_xmp_json_ld:()=>Ke.KHR_xmp_json_ld,MSFT_audio_emitter:()=>je.MSFT_audio_emitter,MSFT_lod:()=>Ye.MSFT_lod,MSFT_minecraftMesh:()=>We.MSFT_minecraftMesh,MSFT_sRGBFactors:()=>ze.MSFT_sRGBFactors,SetInterpolationForKey:()=>le.ZU,_AddInteractivityObjectModel:()=>Ze._AddInteractivityObjectModel,addNewInteractivityFlowGraphMapping:()=>$e.rO,getAllSupportedNativeNodeTypes:()=>$e.U3,getMappingForDeclaration:()=>$e.KD,getMappingForFullOperationName:()=>$e.X6,gltfTypeToBabylonType:()=>et.u});var f={};a.r(f),a.d(f,{AddObjectAccessorToKey:()=>le.oR,AnimationPropertyInfo:()=>ae.AnimationPropertyInfo,ArrayItem:()=>re.ArrayItem,EXT_lights_area:()=>ge.EXT_lights_area,EXT_lights_ies:()=>pe.EXT_lights_ies,EXT_lights_image_based:()=>ue.EXT_lights_image_based,EXT_mesh_gpu_instancing:()=>ce.EXT_mesh_gpu_instancing,EXT_meshopt_compression:()=>fe.EXT_meshopt_compression,EXT_texture_avif:()=>he.EXT_texture_avif,EXT_texture_webp:()=>de.EXT_texture_webp,ExtrasAsMetadata:()=>Qe.ExtrasAsMetadata,FlowGraphGLTFDataProvider:()=>tt.FlowGraphGLTFDataProvider,GLTFFileLoader:()=>re.GLTFFileLoader,GLTFLoader:()=>re.GLTFLoader,GetMappingForKey:()=>le.tQ,GetPathToObjectConverter:()=>le.Wt,InteractivityGraphToFlowGraphParser:()=>et.W,KHR_animation_pointer:()=>Ue.KHR_animation_pointer,KHR_draco_mesh_compression:()=>me.KHR_draco_mesh_compression,KHR_interactivity:()=>Ze.KHR_interactivity,KHR_lights:()=>_e.KHR_lights,KHR_materials_anisotropy:()=>we.KHR_materials_anisotropy,KHR_materials_clearcoat:()=>ve.KHR_materials_clearcoat,KHR_materials_coat:()=>xe,KHR_materials_diffuse_roughness:()=>He.KHR_materials_diffuse_roughness,KHR_materials_diffuse_transmission:()=>Se.KHR_materials_diffuse_transmission,KHR_materials_dispersion:()=>ke.KHR_materials_dispersion,KHR_materials_emissive_strength:()=>Oe.KHR_materials_emissive_strength,KHR_materials_fuzz:()=>Ee,KHR_materials_ior:()=>Fe.KHR_materials_ior,KHR_materials_iridescence:()=>Ae.KHR_materials_iridescence,KHR_materials_pbrSpecularGlossiness:()=>be.KHR_materials_pbrSpecularGlossiness,KHR_materials_sheen:()=>Ce.KHR_materials_sheen,KHR_materials_specular:()=>Le.KHR_materials_specular,KHR_materials_transmission:()=>Pe.KHR_materials_transmission,KHR_materials_unlit:()=>ye.KHR_materials_unlit,KHR_materials_variants:()=>Re.KHR_materials_variants,KHR_materials_volume:()=>Ie.KHR_materials_volume,KHR_materials_volume_scatter:()=>Be,KHR_mesh_quantization:()=>Ge.KHR_mesh_quantization,KHR_node_hoverability:()=>Je.KHR_node_hoverability,KHR_node_selectability:()=>Xe.KHR_node_selectability,KHR_node_visibility:()=>qe.KHR_node_visibility,KHR_texture_basisu:()=>Ve.KHR_texture_basisu,KHR_texture_transform:()=>De.KHR_texture_transform,KHR_xmp_json_ld:()=>Ke.KHR_xmp_json_ld,LoadBoundingInfoFromPositionAccessor:()=>re.LoadBoundingInfoFromPositionAccessor,MSFT_audio_emitter:()=>je.MSFT_audio_emitter,MSFT_lod:()=>Ye.MSFT_lod,MSFT_minecraftMesh:()=>We.MSFT_minecraftMesh,MSFT_sRGBFactors:()=>ze.MSFT_sRGBFactors,OpenPBRMaterialLoadingAdapter:()=>ie.OpenPBRMaterialLoadingAdapter,PBRMaterialLoadingAdapter:()=>se.PBRMaterialLoadingAdapter,SetInterpolationForKey:()=>le.ZU,TransformNodeAnimationPropertyInfo:()=>ae.TransformNodeAnimationPropertyInfo,WeightAnimationPropertyInfo:()=>ae.WeightAnimationPropertyInfo,_AddInteractivityObjectModel:()=>Ze._AddInteractivityObjectModel,addNewInteractivityFlowGraphMapping:()=>$e.rO,getAllSupportedNativeNodeTypes:()=>$e.U3,getMappingForDeclaration:()=>$e.KD,getMappingForFullOperationName:()=>$e.X6,getQuaternion:()=>ae.getQuaternion,getVector3:()=>ae.getVector3,getWeights:()=>ae.getWeights,gltfTypeToBabylonType:()=>et.u,registerGLTFExtension:()=>oe.Ye,registeredGLTFExtensions:()=>oe.Sv,unregisterGLTFExtension:()=>oe.Hg});var d={};a.r(d),a.d(d,{MTLFileLoader:()=>nt.B,OBJFileLoader:()=>ot.OBJFileLoader,SolidParser:()=>rt.n});var h={};a.r(h),a.d(h,{STLFileLoader:()=>at.STLFileLoader});var p={};a.r(p),a.d(p,{registerBuiltInLoaders:()=>dt});var m={};a.r(m),a.d(m,{BVHFileLoader:()=>O.BVHFileLoader,GLTF1:()=>l,GLTF2:()=>f,GLTFFileLoader:()=>C.GLTFFileLoader,GLTFLoaderAnimationStartMode:()=>C.GLTFLoaderAnimationStartMode,GLTFLoaderCoordinateSystemMode:()=>C.GLTFLoaderCoordinateSystemMode,GLTFLoaderDefaultOptions:()=>C.GLTFLoaderDefaultOptions,GLTFLoaderState:()=>C.GLTFLoaderState,GLTFValidation:()=>M.GLTFValidation,MTLFileLoader:()=>nt.B,OBJFileLoader:()=>ot.OBJFileLoader,ReadBvh:()=>w.R,SPLATFileLoader:()=>it.SPLATFileLoader,STLFileLoader:()=>at.STLFileLoader,SolidParser:()=>rt.n,registerBuiltInLoaders:()=>dt});var _,g,b,y,v,T,x,A,w=a(7872),O=a(3914),C=a(6086),M=a(6472),E=a(8322);!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"}(_||(_={})),function(e){e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(g||(g={})),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"}(b||(b={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(y||(y={})),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"}(v||(v={})),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"}(T||(T={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(x||(x={})),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"}(A||(A={}));var L,F=a(5597),R=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=F.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=F.Matrix.Transpose(t.getWorldMatrix().invert())),a)switch(n.type){case b.FLOAT_MAT2:o.setMatrix2x2(r,F.Matrix.GetAsMatrix2x2(a));break;case b.FLOAT_MAT3:o.setMatrix3x3(r,F.Matrix.GetAsMatrix3x3(a));break;case b.FLOAT_MAT4:o.setMatrix(r,a)}},e.SetUniform=function(e,t,n,r){switch(r){case b.FLOAT:return e.setFloat(t,n),!0;case b.FLOAT_VEC2:return e.setVector2(t,F.Vector2.FromArray(n)),!0;case b.FLOAT_VEC3:return e.setVector3(t,F.Vector3.FromArray(n)),!0;case b.FLOAT_VEC4:return e.setVector4(t,F.Vector4.FromArray(n)),!0;default:return!1}},e.GetWrapMode=function(e){switch(e){case y.CLAMP_TO_EDGE:return F.Texture.CLAMP_ADDRESSMODE;case y.MIRRORED_REPEAT:return F.Texture.MIRROR_ADDRESSMODE;case y.REPEAT:default:return F.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 v.LINEAR:case v.LINEAR_MIPMAP_NEAREST:case v.LINEAR_MIPMAP_LINEAR:return F.Texture.TRILINEAR_SAMPLINGMODE;case v.NEAREST:case v.NEAREST_MIPMAP_NEAREST:return F.Texture.NEAREST_SAMPLINGMODE;default:return F.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 _.BYTE:return new Int8Array(i,n,r);case _.UNSIGNED_BYTE:return new Uint8Array(i,n,r);case _.SHORT:return new Int16Array(i,n,r);case _.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){F.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"),F.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 F.ShaderMaterial("GLTFDefaultMaterial",t,{vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},n),e._DefaultMaterial.setColor4("u_emission",new F.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"}(L||(L={}));var P=function(){function e(e){this._pos=0,this.currentToken=L.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 L.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=L.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=L.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}(),S=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],I=["world","view","projection","worldView","worldViewProjection","mBones"],N=["translation","rotation","scale"],B=["position","rotationQuaternion","scaling"],k=function(e,t,n){for(var r in e){var o=e[r];n[t][r]=o}},H=function(e){if(e)for(var t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},G=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},V=function(e){var t;if(e.translation||e.rotation||e.scale){var n=F.Vector3.FromArray(e.scale||[1,1,1]),r=F.Quaternion.FromArray(e.rotation||[0,0,0,1]),o=F.Vector3.FromArray(e.translation||[0,0,0]);t=F.Matrix.Compose(n,r,o)}else t=F.Matrix.FromArray(e.matrix);return t},D=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=V(s),f=new F.Bone(s.name||"",r,D(e,t,s.jointName,r),c);return f.id=i,f}}}}return null},K=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},U=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},j=function(e,t){for(var n=0;n<e.jointNames.length;n++)if(e.jointNames[n]===t)return!0;return!1},Y=function(e,t,n,r,o){if(o||(e.scene._blockEntityCollection=!!e.assetContainer,(o=new F.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=[],d=0;d<n.length;d++){var h=n[d];if(L=e.meshes[h])for(var p=0;p<L.primitives.length;p++){var m=new F.VertexData,_=L.primitives[p];_.mode;var g=_.attributes,b=void 0,y=void 0;for(var v in g)if(b=e.accessors[g[v]],y=R.GetBufferFromAccessor(e,b),"NORMAL"===v)m.normals=new Float32Array(y.length),m.normals.set(y);else if("POSITION"===v){if(C.GLTFFileLoader.HomogeneousCoordinates){m.positions=new Float32Array(y.length-y.length/4);for(var T=0;T<y.length;T+=4)m.positions[T]=y[T],m.positions[T+1]=y[T+1],m.positions[T+2]=y[T+2]}else m.positions=new Float32Array(y.length),m.positions.set(y);u.push(m.positions.length)}else if(-1!==v.indexOf("TEXCOORD_")){var x=Number(v.split("_")[1]),A=F.VertexBuffer.UVKind+(0===x?"":x+1),w=new Float32Array(y.length);w.set(y),H(w),m.set(w,A)}else"JOINT"===v?(m.matricesIndices=new Float32Array(y.length),m.matricesIndices.set(y)):"WEIGHT"===v?(m.matricesWeights=new Float32Array(y.length),m.matricesWeights.set(y)):"COLOR"===v&&(m.colors=new Float32Array(y.length),m.colors.set(y));if(b=e.accessors[_.indices])y=R.GetBufferFromAccessor(e,b),m.indices=new Int32Array(y.length),m.indices.set(y),f.push(m.indices.length);else{var O=[];for(T=0;T<m.positions.length/3;T++)O.push(T);m.indices=new Int32Array(O),f.push(m.indices.length)}s?s.merge(m):s=m;var M=e.scene.getMaterialById(_.material);i.push(null===M?R.GetDefaultMaterial(e.scene):M),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 F.MultiMaterial("multimat"+r,e.scene)).subMaterials=i:a=new F.StandardMaterial("multimat"+r,e.scene),1===i.length&&(a=i[0]),a._parentContainer=e.assetContainer,o.material||(o.material=a),new F.Geometry(r,e.scene,s,!1,o),o.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,o.subMeshes=[];var E=0;for(d=0;d<n.length;d++){var L;if(h=n[d],L=e.meshes[h])for(p=0;p<L.primitives.length;p++)L.primitives[p].mode,F.SubMesh.AddToMesh(E,l[E],u[E],c[E],f[E],o,o,!0),E++}return o},W=function(e,t,n,r){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=n),e.scaling&&(e.scaling=r)},z=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=Y(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 F.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&&!j(n,a.jointName)){var s=V(a),l=new F.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,d=0;d<f.length;d++){for(var h=null,p=0;p<r.length;p++)if(r[p].id===f[d]){h=r[p];break}h&&(h.bone._parent=c.bone,c.bone.children.push(h.bone))}}(e,r,t,o),r.bones=[];for(var i=0;i<t.jointNames.length;i++)if(y=U(e,t.jointNames[i])){var s=y.node;if(s){var l=y.id,u=e.scene.getBoneById(l);if(u)r.bones.push(u);else{for(var c=void 0,f=null,d=0;d<i;d++){var h=U(e,t.jointNames[d]);if(h){var p=h.node;if(p){var m=p.children;if(m){c=!1;for(var _=0;_<m.length;_++)if(m[_]===l){f=D(e,t,t.jointNames[d],r),c=!0;break}if(c)break}}else F.Tools.Warn("Joint named "+t.jointNames[d]+" does not exist when looking for parent")}}var g=V(s);!f&&o.length>0&&(f=K(o,l))&&-1===a.indexOf(f)&&a.push(f),new F.Bone(s.jointName||"",r,f,g).id=l}}else F.Tools.Warn("Joint named "+t.jointNames[i]+" does not exist")}var b=r.bones;for(r.bones=[],i=0;i<t.jointNames.length;i++){var y;if(y=U(e,t.jointNames[i]))for(d=0;d<b.length;d++)if(b[d].id===y.id){r.bones.push(b[d]);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=Y(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 F.FreeCamera(t.camera,F.Vector3.Zero(),e.scene,!1);s.name=t.name||"",s.mode=F.Camera.ORTHOGRAPHIC_CAMERA,s.attachControl(),r=s,s._parentContainer=e.assetContainer}else if("perspective"===i.type){var l=i[i.type],u=new F.FreeCamera(t.camera,F.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],d=new F.HemisphericLight(t.light,F.Vector3.Zero(),e.scene);d.name=t.name||"",f.color&&(d.diffuse=F.Color3.FromArray(f.color)),r=d}else if("directional"===c.type){var h=c[c.type],p=new F.DirectionalLight(t.light,F.Vector3.Zero(),e.scene);p.name=t.name||"",h.color&&(p.diffuse=F.Color3.FromArray(h.color)),r=p}else if("point"===c.type){var m=c[c.type],_=new F.PointLight(t.light,F.Vector3.Zero(),e.scene);_.name=t.name||"",m.color&&(_.diffuse=F.Color3.FromArray(m.color)),r=_}else if("spot"===c.type){var g=c[c.type],b=new F.SpotLight(t.light,F.Vector3.Zero(),F.Vector3.Zero(),0,0,e.scene);b.name=t.name||"",g.color&&(b.diffuse=F.Color3.FromArray(g.color)),g.fallOfAngle&&(b.angle=g.fallOfAngle),g.fallOffExponent&&(b.exponent=g.fallOffExponent),r=b}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===r){e.scene._blockEntityCollection=!!e.assetContainer;var y=new F.Mesh(t.name||"",e.scene);y._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,t.babylonNode=y,r=y}}if(null!==r){if(t.matrix&&r instanceof F.Mesh)!function(e,t){if(t.matrix){var n=new F.Vector3(0,0,0),r=new F.Quaternion,o=new F.Vector3(0,0,0);F.Matrix.FromArray(t.matrix).decompose(o,r,n),W(e,n,r,o)}else t.translation&&t.rotation&&t.scale&&W(e,F.Vector3.FromArray(t.translation),F.Quaternion.FromArray(t.rotation),F.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(r,t);else{var v=t.translation||[0,0,0],T=t.rotation||[0,0,0,1],x=t.scale||[1,1,1];W(r,F.Vector3.FromArray(v),F.Quaternion.FromArray(T),F.Vector3.FromArray(x))}r.updateCache(!0),t.babylonNode=r}return r},Z=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=z(e,o,t))&&(a.id=t,a.parent=n),o.children)for(var i=0;i<o.children.length;i++)Z(e,o.children[i],a,r)},q=function(e){var t=e.currentScene;if(t)for(var n=0;n<t.nodes.length;n++)Z(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)Z(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=void 0,l=void 0;n.parameters?(s=n.parameters[i.input],l=n.parameters[i.output]):(s=i.input,l=i.output);var u=R.GetBufferFromAccessor(e,e.accessors[s]),c=R.GetBufferFromAccessor(e,e.accessors[l]),f=a.target.id,d=e.scene.getNodeById(f);if(null===d&&(d=e.scene.getNodeByName(f)),null!==d){var h=d instanceof F.Bone,p=a.target.path,m=N.indexOf(p);-1!==m&&(p=B[m]);var _=F.Animation.ANIMATIONTYPE_MATRIX;h||("rotationQuaternion"===p?(_=F.Animation.ANIMATIONTYPE_QUATERNION,d.rotationQuaternion=new F.Quaternion):_=F.Animation.ANIMATIONTYPE_VECTOR3);var g=null,b=[],y=0,v=!1;h&&r&&r.getKeys().length===u.length&&(g=r,v=!0),v||(e.scene._blockEntityCollection=!!e.assetContainer,g=new F.Animation(t,h?"_matrix":p,1,_,F.Animation.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(var T=0;T<u.length;T++){var x=void 0;if("rotationQuaternion"===p?(x=F.Quaternion.FromArray([c[y],c[y+1],c[y+2],c[y+3]]),y+=4):(x=F.Vector3.FromArray([c[y],c[y+1],c[y+2]]),y+=3),h){var A=d,w=F.Vector3.Zero(),O=new F.Quaternion,C=F.Vector3.Zero(),M=A.getBaseMatrix();v&&r&&(M=r.getKeys()[T].value),M.decompose(C,O,w),"position"===p?w=x:"rotationQuaternion"===p?O=x:C=x,x=F.Matrix.Compose(C,O,w)}v?r&&(r.getKeys()[T].value=x):b.push({frame:u[T],value:x})}!v&&g&&(g.setKeys(b),d.animations.push(g)),r=g,e.scene.stopAnimation(d),e.scene.beginAnimation(d,0,u[u.length-1],!0,1)}else F.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)}},X=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=S.indexOf(a.semantic);if(-1!==i)return delete n[r],I[i]}}return e.currentIdentifier},J=function(e){for(var t in e.materials)ee.LoadMaterialAsync(e,t,(function(){}),(function(){}))},Q=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&&k(e.extensions,"extensions",r),e.extensionsUsed&&k(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&&k(e.bufferViews,"bufferViews",r),e.accessors&&k(e.accessors,"accessors",r),e.meshes&&k(e.meshes,"meshes",r),e.lights&&k(e.lights,"lights",r),e.cameras&&k(e.cameras,"cameras",r),e.nodes&&k(e.nodes,"nodes",r),e.images&&k(e.images,"images",r),e.textures&&k(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&&k(e.programs,"programs",r),e.samplers&&k(e.samplers,"samplers",r),e.techniques&&k(e.techniques,"techniques",r),e.materials&&k(e.materials,"materials",r),e.animations&&k(e.animations,"animations",r),e.skins&&k(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];F.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(F.Tools.DecodeBase64(a.uri)))})):F.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];F.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(F.Tools.DecodeBase64(a.uri)))})):F.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===v.NEAREST_MIPMAP_NEAREST||a.minFilter===v.NEAREST_MIPMAP_LINEAR||a.minFilter===v.LINEAR_MIPMAP_NEAREST||a.minFilter===v.LINEAR_MIPMAP_LINEAR,s=F.Texture.BILINEAR_SAMPLINGMODE,l=null==n?new Blob:new Blob([(0,F.GetBlobBufferSource)(n)]),u=URL.createObjectURL(l),c=function(){return URL.revokeObjectURL(u)},f=new F.Texture(u,e.scene,!i,!0,s,c,c);void 0!==a.wrapS&&(f.wrapU=R.GetWrapMode(a.wrapS)),void 0!==a.wrapT&&(f.wrapV=R.GetWrapMode(a.wrapT)),f.name=t,o.babylonTexture=f,r(f)}},e.LoadShaderStringAsync=function(e,t,n,r){var o=e.shaders[t];if(F.Tools.IsBase64(o.uri)){var a=atob(o.uri.split(",")[1]);n&&n(a)}else F.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 F.StandardMaterial(t,e.scene);return i._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,i.diffuseColor=new F.Color3(.5,.5,.5),i.sideOrientation=F.Material.CounterClockWiseSideOrientation,void n(i)}var s=e.programs[a.program],l=a.states,u=F.Effect.ShadersStore[s.vertexShader+"VertexShader"],c=F.Effect.ShadersStore[s.fragmentShader+"PixelShader"],f="",d="",h=new P(u),p=new P(c),m={},_=[],g=[],y=[];for(var v in a.uniforms){var T=a.uniforms[v],w=a.parameters[T];if(m[v]=w,!w.semantic||w.node||w.source)w.type===b.SAMPLER_2D?y.push(v):_.push(v);else{var O=S.indexOf(w.semantic);-1!==O?(_.push(I[O]),delete m[v]):_.push(v)}}for(var C in a.attributes){var M=a.attributes[C];if((B=a.parameters[M]).semantic){var E=G(B);E&&g.push(E)}}for(;!h.isEnd()&&h.getNextToken();)if(h.currentToken===L.IDENTIFIER){var N=!1;for(var C in a.attributes){M=a.attributes[C];var B=a.parameters[M];if(h.currentIdentifier===C&&B.semantic){f+=G(B),N=!0;break}}N||(f+=X(h,a,m))}else f+=h.currentString;for(;!p.isEnd()&&p.getNextToken();)p.currentToken===L.IDENTIFIER?d+=X(p,a,m):d+=p.currentString;var k={vertex:s.vertexShader+t,fragment:s.fragmentShader+t},H={attributes:g,uniforms:_,samplers:y,needAlphaBlending:l&&l.enable&&-1!==l.enable.indexOf(3042)};F.Effect.ShadersStore[s.vertexShader+t+"VertexShader"]=f,F.Effect.ShadersStore[s.fragmentShader+t+"PixelShader"]=d;var V=new F.ShaderMaterial(t,e.scene,k,H);if(V.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,V,r),V.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===b.SAMPLER_2D?ee.LoadTextureAsync(e,r.values?u:s.value,c(n),(function(){return c(null)})):s.value&&R.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===b.FLOAT_MAT2||c===b.FLOAT_MAT3||c===b.FLOAT_MAT4)if(!u.semantic||u.source||u.node){if(u.semantic&&(u.source||u.node)){var f=t.scene.getNodeByName(u.source||u.node||"");if(null===f&&(f=t.scene.getNodeById(u.source||u.node||"")),null===f)continue;R.SetMatrix(t.scene,f,u,l,r.getEffect())}}else R.SetMatrix(t.scene,e,u,l,r.getEffect());else{var d=s[o.uniforms[l]];if(!d)continue;if(c===b.SAMPLER_2D){var h=t.textures[a.values?d:u.value].babylonTexture;if(null==h)continue;r.getEffect().setTexture(l,h)}else R.SetUniform(r.getEffect(),l,d,c)}}i(r)}(i,e,o,t,n,r,a)}}}(e,V,a,o,m,n),V.sideOrientation=F.Material.CounterClockWiseSideOrientation,l&&l.functions){var D=l.functions;D.cullFace&&D.cullFace[0]!==x.BACK&&(V.backFaceCulling=!1);var K=D.blendFuncSeparate;K&&(K[0]===A.SRC_ALPHA&&K[1]===A.ONE_MINUS_SRC_ALPHA&&K[2]===A.ONE&&K[3]===A.ONE?V.alphaMode=F.Constants.ALPHA_COMBINE:K[0]===A.ONE&&K[1]===A.ONE&&K[2]===A.ZERO&&K[3]===A.ONE?V.alphaMode=F.Constants.ALPHA_ONEONE:K[0]===A.SRC_ALPHA&&K[1]===A.ONE&&K[2]===A.ZERO&&K[3]===A.ONE?V.alphaMode=F.Constants.ALPHA_ADD:K[0]===A.ZERO&&K[1]===A.ONE_MINUS_SRC_COLOR&&K[2]===A.ONE&&K[3]===A.ONE?V.alphaMode=F.Constants.ALPHA_SUBTRACT:K[0]===A.DST_COLOR&&K[1]===A.ZERO&&K[2]===A.ONE&&K[3]===A.ONE?V.alphaMode=F.Constants.ALPHA_MULTIPLY:K[0]===A.SRC_ALPHA&&K[1]===A.ONE_MINUS_SRC_COLOR&&K[2]===A.ONE&&K[3]===A.ONE&&(V.alphaMode=F.Constants.ALPHA_MAXIMIZED))}}else r&&r("No technique found.")},e}(),$=function(){function e(){}return e.RegisterExtension=function(t){e.Extensions[t.name]?F.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,ee.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=[],F.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 F.AbstractMesh&&n.push(s.babylonNode)}for(var u in t.skins){var c=t.skins[u];c.babylonSkeleton instanceof F.Skeleton&&r.push(c.babylonSkeleton)}l._loadBuffersAsync(t,(function(){l._loadShadersAsync(t,(function(){J(t),q(t),!C.GLTFFileLoader.IncrementalLoading&&a&&a(n,r)}))})),C.GLTFFileLoader.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,ee.LoadRuntimeAsync(e,t,n,(function(e){ee.LoadRuntimeExtensionsAsync(e,(function(){i._createNodes(e),i._loadBuffersAsync(e,(function(){i._loadShadersAsync(e,(function(){J(e),q(e),C.GLTFFileLoader.IncrementalLoading||r()}))})),C.GLTFFileLoader.IncrementalLoading&&r()}),a)}),a)},e.prototype.loadAsync=function(e,t,n,r){return(0,E.sH)(this,void 0,void 0,(function(){var o=this;return(0,E.YH)(this,(function(a){switch(a.label){case 0:return[4,new Promise((function(a,i){o._loadAsync(e,t,n,(function(){a()}),r,(function(e){i(new Error(e))}))}))];case 1:return[2,a.sent()]}}))}))},e.prototype._loadShadersAsync=function(e,t){var n=!1,r=function(n,r){ee.LoadShaderStringAsync(e,n,(function(o){o instanceof ArrayBuffer||(e.loadedShaderCount++,o&&(F.Effect.ShadersStore[n+(r.type===g.VERTEX?"VertexShader":"PixelShader")]=o),e.loadedShaderCount===e.shaderscount&&t())}),(function(){F.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)():F.Tools.Error("No shader named: "+o)}n||t()},e.prototype._loadBuffersAsync=function(e,t){var n=!1,r=function(n,r){ee.LoadBufferAsync(e,n,(function(o){e.loadedBufferCount++,o&&(o.byteLength!=e.buffers[n].byteLength&&F.Tools.Error("Buffer named "+n+" is length "+o.byteLength+". Expected: "+r.byteLength),e.loadedBufferViews[n]=o),e.loadedBufferCount===e.buffersCount&&t()}),(function(){F.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)():F.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++)Z(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)Z(e,t.nodes[n],null)},e.Extensions={},e}(),ee=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(Q.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(){Q.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(){Q.LoadShaderStringAsync(t,n,r,o)}))},e.LoadMaterialAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadMaterialAsync(t,n,r,o)}),(function(){Q.LoadMaterialAsync(t,n,r,o)}))},e._LoadTextureBufferAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadTextureBufferAsync(t,n,r,o)}),(function(){Q.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(){Q.CreateTextureAsync(t,n,r,o)}))},e._ApplyExtensions=function(e,t){for(var n in $.Extensions)if(e($.Extensions[n]))return;t()},e}();C.GLTFFileLoader._CreateGLTF1Loader=function(){return new $};var te=function(e){function t(){return e.call(this,"KHR_binary_glTF")||this}return(0,E.C6)(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(Q.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(R.GetBufferFromBufferView(e,i,0,i.byteLength,_.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=R.GetBufferFromBufferView(e,a,0,a.byteLength,_.UNSIGNED_BYTE);return setTimeout((function(){var e=R.DecodeBufferToText(i);n(e)})),!0},t}(ee);$.RegisterExtension(new te);var ne=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return(0,E.C6)(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 F.HemisphericLight(o.name,new F.Vector3(0,1,0),e.scene),i=o.ambient;i&&(a.diffuse=F.Color3.FromArray(i.color||[1,1,1]));break;case"point":var s=new F.PointLight(o.name,new F.Vector3(10,10,10),e.scene),l=o.point;l&&(s.diffuse=F.Color3.FromArray(l.color||[1,1,1]));break;case"directional":var u=new F.DirectionalLight(o.name,new F.Vector3(0,-1,0),e.scene),c=o.directional;c&&(u.diffuse=F.Color3.FromArray(c.color||[1,1,1]));break;case"spot":var f=o.spot;f&&(new F.SpotLight(o.name,new F.Vector3(0,10,0),new F.Vector3(0,-1,0),f.fallOffAngle||Math.PI,f.fallOffExponent||0,e.scene).diffuse=F.Color3.FromArray(f.color||[1,1,1]));break;default:F.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 F.StandardMaterial(t,e.scene);return i.sideOrientation=F.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=F.Color3.FromArray(a.values.ambient||[0,0,0]),"string"==typeof a.values.diffuse?this._loadTexture(e,a.values.diffuse,i,"diffuseTexture",r):i.diffuseColor=F.Color3.FromArray(a.values.diffuse||[0,0,0]),"string"==typeof a.values.emission?this._loadTexture(e,a.values.emission,i,"emissiveTexture",r):i.emissiveColor=F.Color3.FromArray(a.values.emission||[0,0,0]),"string"==typeof a.values.specular?this._loadTexture(e,a.values.specular,i,"specularTexture",r):i.specularColor=F.Color3.FromArray(a.values.specular||[0,0,0]),!0},t.prototype._loadTexture=function(e,t,n,r,o){Q.LoadTextureBufferAsync(e,t,(function(o){Q.CreateTextureAsync(e,t,o,(function(e){return n[r]=e}))}),o)},t}(ee);$.RegisterExtension(new ne);var re=a(8625),oe=a(4015),ae=a(2727),ie=a(3833),se=a(2561),le=a(8698),ue=a(3251),ce=a(9499),fe=a(5549),de=a(10),he=a(6416),pe=a(4393),me=a(6396),_e=a(5890),ge=a(2493),be=a(2916),ye=a(4239),ve=a(8469),Te="KHR_materials_coat",xe=function(){function e(e){this.name=Te,this.order=191,this.useOpenPBR=!1,this._loader=e,this.enabled=this._loader.isExtensionUsed(Te)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var r=this;return re.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){return(0,E.sH)(r,void 0,void 0,(function(){var r;return(0,E.YH)(this,(function(i){switch(i.label){case 0:return(r=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),t.extensions&&t.extensions.KHR_materials_openpbr&&(this.useOpenPBR=!0),r.push(this._loadCoatPropertiesAsync(o,a,n)),[4,Promise.all(r)];case 1:return i.sent(),[2]}}))}))}))},e.prototype._loadCoatPropertiesAsync=function(e,t,n){var r,o,a=this._loader._getOrCreateMaterialAdapter(n),i=new Array;a.configureCoat(),a.coatWeight=void 0!==t.coatFactor?t.coatFactor:0,a.coatRoughness=void 0!==t.coatRoughnessFactor?t.coatRoughnessFactor:0,t.coatTexture&&i.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatTexture"),t.coatTexture,(function(e){e.name="".concat(n.name," (Coat)"),a.coatWeightTexture=e}))),t.coatRoughnessTexture&&(t.coatRoughnessTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatRoughnessTexture"),t.coatRoughnessTexture,(function(e){e.name="".concat(n.name," (Coat Roughness)"),a.coatRoughnessTexture=e})))),t.coatNormalTexture&&(t.coatNormalTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatNormalTexture"),t.coatNormalTexture,(function(e){var r;e.name="".concat(n.name," (Coat Normal)"),a.geometryCoatNormalTexture=e,null!=(null===(r=t.coatNormalTexture)||void 0===r?void 0:r.scale)&&(a.geometryCoatNormalTextureScale=t.coatNormalTexture.scale)}))),a.setNormalMapInversions(!n.getScene().useRightHandedSystem,n.getScene().useRightHandedSystem)),a.coatDarkening=void 0!==t.coatDarkeningFactor?t.coatDarkeningFactor:1,a.coatIor=void 0!==t.coatIor?t.coatIor:1.5;var s=F.Color3.White();void 0!==t.coatColorFactor&&s.fromArray(t.coatColorFactor),a.coatColor=s,t.coatColorTexture&&i.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatColorTexture"),t.coatColorTexture,(function(e){e.name="".concat(n.name," (Coat Color)"),a.coatColorTexture=e})));var l=null!==(r=t.coatAnisotropyStrength)&&void 0!==r?r:0,u=null!==(o=t.coatAnisotropyRotation)&&void 0!==o?o:0;return a.coatRoughnessAnisotropy=l,a.geometryCoatTangentAngle=u,this.useOpenPBR||a.configureGltfStyleAnisotropy(!0),t.coatAnisotropyTexture&&(t.coatAnisotropyTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatAnisotropyTexture"),t.coatAnisotropyTexture,(function(e){e.name="".concat(n.name," (Coat Anisotropy)"),a.geometryCoatTangentTexture=e})))),Promise.all(i).then((function(){}))},e}();(0,oe.Hg)(Te),(0,oe.Ye)(Te,!0,(function(e){return new xe(e)}));var Ae=a(2843),we=a(699),Oe=a(8842),Ce=a(3274),Me="KHR_materials_fuzz",Ee=function(){function e(e){this.name=Me,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(Me)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var r=this;return re.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){return(0,E.sH)(r,void 0,void 0,(function(){var r;return(0,E.YH)(this,(function(i){switch(i.label){case 0:return(r=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),r.push(this._loadFuzzPropertiesAsync(o,a,n)),[4,Promise.all(r).then((function(){}))];case 1:return[2,i.sent()]}}))}))}))},e.prototype._loadFuzzPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),o=new Array;return r.configureFuzz(),r.fuzzWeight=void 0!==t.fuzzFactor?t.fuzzFactor:0,r.fuzzColor=void 0!==t.fuzzColorFactor?F.Color3.FromArray(t.fuzzColorFactor):F.Color3.White(),r.fuzzRoughness=void 0!==t.fuzzRoughnessFactor?t.fuzzRoughnessFactor:.5,t.fuzzTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/fuzzTexture"),t.fuzzTexture,(function(e){e.name="".concat(n.name," (Fuzz)"),r.fuzzWeightTexture=e}))),t.fuzzColorTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/fuzzColorTexture"),t.fuzzColorTexture,(function(e){e.name="".concat(n.name," (Fuzz Color)"),r.fuzzColorTexture=e}))),t.fuzzRoughnessTexture&&(t.fuzzRoughnessTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/fuzzRoughnessTexture"),t.fuzzRoughnessTexture,(function(e){e.name="".concat(n.name," (Fuzz Roughness)"),r.fuzzRoughnessTexture=e})))),Promise.all(o).then((function(){}))},e}();(0,oe.Hg)(Me),(0,oe.Ye)(Me,!0,(function(e){return new Ee(e)}));var Le=a(5418),Fe=a(5613),Re=a(9437),Pe=a(4943),Se=a(6528),Ie=a(1369),Ne="KHR_materials_volume_scatter",Be=function(){function e(e){this.name=Ne,this.order=172,this._loader=e,this.enabled=this._loader.isExtensionUsed(Ne),this.enabled&&this._loader._disableInstancedMesh++}return e.prototype.dispose=function(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var r=this;return re.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,a){return(0,E.sH)(r,void 0,void 0,(function(){var r;return(0,E.YH)(this,(function(i){switch(i.label){case 0:return(r=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),r.push(this._loadVolumePropertiesAsync(o,t,n,a)),[4,Promise.all(r).then((function(){}))];case 1:return[2,i.sent()]}}))}))}))},e.prototype._loadVolumePropertiesAsync=function(e,t,n,r){var o=this._loader._getOrCreateMaterialAdapter(n);if(0===o.transmissionWeight&&0===o.subsurfaceWeight)return Promise.resolve();var a=void 0!==r.multiscatterColor&&3==r.multiscatterColor.length?F.Color3.FromArray(r.multiscatterColor):F.Color3.Black(),i=void 0!==r.scatterAnisotropy?r.scatterAnisotropy:0;if(o.transmissionWeight>0){var s=function(e){var t=new F.Vector3(e.r,e.g,e.b),n=new F.Vector3(4.09712,4.09712,4.09712);n.multiplyInPlace(t),n.addInPlace(new F.Vector3(4.20863,4.20863,4.20863));var r=new F.Vector3(9.59217,9.59217,9.59217);return r.addInPlace(new F.Vector3(41.6808,41.6808,41.6808).multiplyInPlace(t)),r.addInPlace(new F.Vector3(17.7126,17.7126,17.7126).multiplyInPlace(t.multiply(t))),n.subtractInPlace(new F.Vector3(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z))),new F.Vector3(1,1,1).subtract(n.multiply(n))}(a),l=new F.Vector3(-Math.log(o.transmissionColor.r),-Math.log(o.transmissionColor.g),-Math.log(o.transmissionColor.b));l.scaleInPlace(1/Math.max(o.transmissionDepth,.001));var u=l.multiply(s);u.scaleInPlace(o.transmissionDepth),o.transmissionScatter.set(u.x,u.y,u.z);var c=Promise.resolve(null);return r.multiscatterColorTexture&&(r.multiscatterColorTexture.nonColorData=!0,c=this._loader.loadTextureInfoAsync("".concat(e,"/multiscatterColorTexture"),r.multiscatterColorTexture,(function(e){e.name="".concat(n.name," (Transmission)"),o.transmissionWeightTexture=e}))),o.transmissionScatterAnisotropy=i,c.then((function(){}))}if(o.subsurfaceWeight>0){o.subsurfaceScatterAnisotropy=i,o.subsurfaceColor=a;var f=new F.Vector3(0!==o.extinctionCoefficient.x?1/o.extinctionCoefficient.x:1,0!==o.extinctionCoefficient.y?1/o.extinctionCoefficient.y:1,0!==o.extinctionCoefficient.z?1/o.extinctionCoefficient.z:1);o.subsurfaceRadius=Math.max(f.x,f.y,f.z),o.subsurfaceRadiusScale=new F.Color3(f.x/o.subsurfaceRadius,f.y/o.subsurfaceRadius,f.z/o.subsurfaceRadius)}return Promise.resolve()},e}();(0,oe.Hg)(Ne),(0,oe.Ye)(Ne,!0,(function(e){return new Be(e)}));var ke=a(9553),He=a(8856),Ge=a(789),Ve=a(5873),De=a(410),Ke=a(5299),Ue=a(5898),je=a(3218),Ye=a(2658),We=a(4439),ze=a(6629),Ze=a(3757),qe=a(947),Xe=a(6465),Je=a(8875),Qe=a(4158),$e=a(1943),et=a(9222),tt=a(1274),nt=a(4028),rt=a(3382),ot=a(8778),at=a(7122),it=a(1063),st=a(7347),lt=a(6423),ut=a(9363),ct=a(9003),ft=a(3291);function dt(){var e=this;(0,F.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},st.T),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3914))];case 1:return[2,new(0,e.sent().BVHFileLoader)(t[st.T.name])]}}))}))}})),(0,F.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},lt._),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8625))];case 1:return[2,new(0,e.sent().GLTFFileLoader)(t[lt._.name])]}}))}))}})),function(){var e=this;(0,oe.Ye)("EXT_lights_image_based",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3251))];case 1:return[2,new(0,e.sent().EXT_lights_image_based)(t)]}}))}))})),(0,oe.Ye)("EXT_mesh_gpu_instancing",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,9499))];case 1:return[2,new(0,e.sent().EXT_mesh_gpu_instancing)(t)]}}))}))})),(0,oe.Ye)("EXT_meshopt_compression",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5549))];case 1:return[2,new(0,e.sent().EXT_meshopt_compression)(t)]}}))}))})),(0,oe.Ye)("EXT_texture_avif",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6416))];case 1:return[2,new(0,e.sent().EXT_texture_avif)(t)]}}))}))})),(0,oe.Ye)("EXT_texture_webp",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,10))];case 1:return[2,new(0,e.sent().EXT_texture_webp)(t)]}}))}))})),(0,oe.Ye)("ExtrasAsMetadata",!1,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4158))];case 1:return[2,new(0,e.sent().ExtrasAsMetadata)(t)]}}))}))})),(0,oe.Ye)("KHR_animation_pointer",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5898))];case 1:return[2,new(0,e.sent().KHR_animation_pointer)(t)]}}))}))})),(0,oe.Ye)("KHR_draco_mesh_compression",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6396))];case 1:return[2,new(0,e.sent().KHR_draco_mesh_compression)(t)]}}))}))})),(0,oe.Ye)("KHR_interactivity",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3757))];case 1:return[2,new(0,e.sent().KHR_interactivity)(t)]}}))}))})),(0,oe.Ye)("KHR_lights_punctual",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5890))];case 1:return[2,new(0,e.sent().KHR_lights)(t)]}}))}))})),(0,oe.Ye)("EXT_lights_area",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2493))];case 1:return[2,new(0,e.sent().EXT_lights_area)(t)]}}))}))})),(0,oe.Ye)("EXT_lights_ies",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4393))];case 1:return[2,new(0,e.sent().EXT_lights_ies)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_anisotropy",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,699))];case 1:return[2,new(0,e.sent().KHR_materials_anisotropy)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_clearcoat",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8469))];case 1:return[2,new(0,e.sent().KHR_materials_clearcoat)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_diffuse_roughness",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8856))];case 1:return[2,new(0,e.sent().KHR_materials_diffuse_roughness)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_diffuse_transmission",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6528))];case 1:return[2,new(0,e.sent().KHR_materials_diffuse_transmission)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_dispersion",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,9553))];case 1:return[2,new(0,e.sent().KHR_materials_dispersion)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_emissive_strength",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8842))];case 1:return[2,new(0,e.sent().KHR_materials_emissive_strength)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_ior",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5613))];case 1:return[2,new(0,e.sent().KHR_materials_ior)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_iridescence",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2843))];case 1:return[2,new(0,e.sent().KHR_materials_iridescence)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_pbrSpecularGlossiness",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2916))];case 1:return[2,new(0,e.sent().KHR_materials_pbrSpecularGlossiness)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_sheen",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3274))];case 1:return[2,new(0,e.sent().KHR_materials_sheen)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_specular",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5418))];case 1:return[2,new(0,e.sent().KHR_materials_specular)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_transmission",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4943))];case 1:return[2,new(0,e.sent().KHR_materials_transmission)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_unlit",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4239))];case 1:return[2,new(0,e.sent().KHR_materials_unlit)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_variants",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,9437))];case 1:return[2,new(0,e.sent().KHR_materials_variants)(t)]}}))}))})),(0,oe.Ye)("KHR_materials_volume",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,1369))];case 1:return[2,new(0,e.sent().KHR_materials_volume)(t)]}}))}))})),(0,oe.Ye)("KHR_mesh_quantization",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,789))];case 1:return[2,new(0,e.sent().KHR_mesh_quantization)(t)]}}))}))})),(0,oe.Ye)("KHR_texture_basisu",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5873))];case 1:return[2,new(0,e.sent().KHR_texture_basisu)(t)]}}))}))})),(0,oe.Ye)("KHR_texture_transform",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,410))];case 1:return[2,new(0,e.sent().KHR_texture_transform)(t)]}}))}))})),(0,oe.Ye)("KHR_xmp_json_ld",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5299))];case 1:return[2,new(0,e.sent().KHR_xmp_json_ld)(t)]}}))}))})),(0,oe.Ye)("MSFT_audio_emitter",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3218))];case 1:return[2,new(0,e.sent().MSFT_audio_emitter)(t)]}}))}))})),(0,oe.Ye)("MSFT_lod",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2658))];case 1:return[2,new(0,e.sent().MSFT_lod)(t)]}}))}))})),(0,oe.Ye)("MSFT_minecraftMesh",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4439))];case 1:return[2,new(0,e.sent().MSFT_minecraftMesh)(t)]}}))}))})),(0,oe.Ye)("MSFT_sRGBFactors",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6629))];case 1:return[2,new(0,e.sent().MSFT_sRGBFactors)(t)]}}))}))})),(0,oe.Ye)("KHR_node_visibility",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,947))];case 1:return[2,new(0,e.sent().KHR_node_visibility)(t)]}}))}))})),(0,oe.Ye)("KHR_node_hoverability",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8875))];case 1:return[2,new(0,e.sent().KHR_node_hoverability)(t)]}}))}))})),(0,oe.Ye)("KHR_node_selectability",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6465))];case 1:return[2,new(0,e.sent().KHR_node_selectability)(t)]}}))}))}))}(),(0,F.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},ut.M),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8778))];case 1:return[2,new(0,e.sent().OBJFileLoader)(t[ut.M.name])]}}))}))}})),(0,F.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},ct.B),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,1063))];case 1:return[2,new(0,e.sent().SPLATFileLoader)(t[ct.B.name])]}}))}))}})),(0,F.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},ft.W),{createPlugin:function(){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,7122))];case 1:return[2,new(0,e.sent().STLFileLoader)]}}))}))}}))}var ht=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==ht)for(var pt in s)ht.BABYLON[pt]||(ht.BABYLON[pt]=s[pt]);var mt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==mt)for(var _t in mt.BABYLON=mt.BABYLON||{},p)mt.BABYLON[_t]=p[_t];var gt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==gt){for(var bt in gt.BABYLON=gt.BABYLON||{},C)gt.BABYLON[bt]=C[bt];for(var bt in M)gt.BABYLON[bt]=M[bt]}var yt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==yt)for(var vt in yt.BABYLON=yt.BABYLON||{},yt.BABYLON.GLTF1=yt.BABYLON.GLTF1||{},l)yt.BABYLON.GLTF1[vt]=l[vt];var Tt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==Tt){Tt.BABYLON=Tt.BABYLON||{};var xt=Tt.BABYLON;xt.GLTF2=xt.GLTF2||{},xt.GLTF2.Loader=xt.GLTF2.Loader||{},xt.GLTF2.Loader.Extensions=xt.GLTF2.Loader.Extensions||{};var At=[];for(var wt in c)xt.GLTF2.Loader.Extensions[wt]=c[wt],At.push(wt);for(var wt in u)xt.GLTF2.Loader[wt]=u[wt],At.push(wt);for(var wt in f)At.indexOf(wt)>-1||(xt.GLTF2[wt]=f[wt])}var Ot=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==Ot)for(var Ct in d)Ot.BABYLON[Ct]||(Ot.BABYLON[Ct]=d[Ct]);var Mt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==Mt)for(var Et in h)Mt.BABYLON[Et]||(Mt.BABYLON[Et]=h[Et]);const Lt=m;return i.default})()));
1
+ !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,n,r={7347(e,t,n){n.d(t,{T:()=>r});var r={name:"bvh",extensions:{".bvh":{isBinary:!1}}}},3914(e,t,n){n.r(t),n.d(t,{BVHFileLoader:()=>s});var r=n(8322),o=n(5597),a=n(7347),i=n(7872),s=function(){function e(t){this.name=a.T.name,this.extensions=a.T.extensions,this._loadingOptions=(0,r.Cl)((0,r.Cl)({},e._DefaultLoadingOptions),null!=t?t:{})}return Object.defineProperty(e,"_DefaultLoadingOptions",{get:function(){return{loopMode:o.Animation.ANIMATIONLOOPMODE_CYCLE}},enumerable:!1,configurable:!0}),e.prototype.createPlugin=function(t){return new e(t[a.T.name])},e.prototype.canDirectLoad=function(e){return this.isBvhHeader(e)},e.prototype.isBvhHeader=function(e){return"HIERARCHY"==e.split("\n")[0]},e.prototype.isNotBvhHeader=function(e){return!this.isBvhHeader(e)},e.prototype.importMeshAsync=function(e,t,n){if("string"!=typeof n)return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(n))return Promise.reject("BVH loader expects HIERARCHY header.");try{var r=(0,i.R)(n,t,null,this._loadingOptions);return Promise.resolve({meshes:[],particleSystems:[],skeletons:[r],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]})}catch(e){return Promise.reject(e)}},e.prototype.loadAsync=function(e,t){return"string"!=typeof t?Promise.reject("BVH loader expects string data."):this.isNotBvhHeader(t)?Promise.reject("BVH loader expects HIERARCHY header."):this.importMeshAsync(null,e,t).then((function(){}))},e.prototype.loadAssetContainerAsync=function(e,t){if("string"!=typeof t)return Promise.reject("BVH loader expects string data.");if(this.isNotBvhHeader(t))return Promise.reject("BVH loader expects HIERARCHY header.");var n=new o.AssetContainer(e);try{var r=(0,i.R)(t,e,n,this._loadingOptions);return n.skeletons.push(r),Promise.resolve(n)}catch(e){return Promise.reject(e)}},e}();(0,o.RegisterSceneLoaderPlugin)(new s)},7872(e,t,n){n.d(t,{R:()=>m});var r=n(5597),o="Xposition",a="Yposition",i="Zposition",s="Xrotation",l="Yrotation",u="Zrotation",c=function(e){this.loopMode=r.Animation.ANIMATIONLOOPMODE_CYCLE,this.list=[],this.root=f(),this.numFrames=0,this.frameRate=0,this.skeleton=e};function f(){return{name:"",type:"",offset:new r.Vector3,channels:[],children:[],frames:[],parent:null}}function d(e,t,n){for(var c=function(e){var t=e.offset.x,n=e.offset.y,o=e.offset.z;return r.Matrix.Translation(t,n,o)}(e),f=new r.Bone(e.name,n.skeleton,t,c),h=function(e,t){if(0===e.frames.length)return[];for(var n=[],c=e.channels.some((function(e){return e===o||e===a||e===i})),f=e.channels.some((function(e){return e===s||e===l||e===u})),d=new r.Animation("".concat(e.name,"_pos"),"position",t.frameRate,r.Animation.ANIMATIONTYPE_VECTOR3,t.loopMode),h=new r.Animation("".concat(e.name,"_rot"),"rotationQuaternion",t.frameRate,r.Animation.ANIMATIONTYPE_QUATERNION,t.loopMode),p=[],m=[],_=0;_<e.frames.length;_++){var g=e.frames[_];c&&g.position&&p.push({frame:g.frame,value:g.position.clone()}),f&&m.push({frame:g.frame,value:g.rotation.clone()})}return p.length>0&&(d.setKeys(p),n.push(d)),m.length>0&&(h.setKeys(m),n.push(h)),n}(e,n),p=0,m=h;p<m.length;p++){var _=m[p];_.getKeys()&&_.getKeys().length>0&&f.animations.push(_)}for(var g=0,b=e.children;g<b.length;g++)d(b[g],f,n)}function h(e,t,n,c){if("ENDSITE"!==n.type){var f={frame:0,position:new r.Vector3,rotation:new r.Quaternion};f.frame=t,f.position=new r.Vector3,f.rotation=new r.Quaternion,n.frames.push(f);for(var d=r.Matrix.Identity(),p=0;p<n.channels.length;++p){var m=n.channels[p],_=e[c.i++];if(_){var g=parseFloat(_.trim());if(m.endsWith("position"))switch(m){case o:f.position.x=g;break;case a:f.position.y=g;break;case i:f.position.z=g}else if(m.endsWith("rotation")){var b=r.Tools.ToRadians(g),y=void 0;switch(m){case s:y=r.Matrix.RotationX(b);break;case l:y=r.Matrix.RotationY(b);break;case u:y=r.Matrix.RotationZ(b)}d=y.multiply(d)}}}r.Quaternion.FromRotationMatrixToRef(d,f.rotation);for(var v=0,T=n.children;v<T.length;v++)h(e,t,T[v],c)}}function p(e,t,n,o){var a,i,s,l,u=f();u.parent=n,o.list.push(u);var c=t.trim().split(/\s+/);if("END"===c[0].toUpperCase()&&"SITE"===c[1].toUpperCase()?(u.type="ENDSITE",u.name="ENDSITE"):(u.name=c[1],u.type=c[0].toUpperCase()),"{"!=(null===(a=e.shift())||void 0===a?void 0:a.trim()))throw new Error("Expected opening { after type & name");var d=null===(i=e.shift())||void 0===i?void 0:i.trim().split(/\s+/);if(!d)throw new Error("Unexpected end of file: missing OFFSET");if("OFFSET"!=(c=d)[0].toUpperCase())throw new Error("Expected OFFSET, but got: "+c[0]);if(4!=c.length)throw new Error("OFFSET: Invalid number of values");var h=new r.Vector3(parseFloat(c[1]),parseFloat(c[2]),parseFloat(c[3]));if(isNaN(h.x)||isNaN(h.y)||isNaN(h.z))throw new Error("OFFSET: Invalid values");if(u.offset=h,"ENDSITE"!=u.type){if(!(c=null===(s=e.shift())||void 0===s?void 0:s.trim().split(/\s+/)))throw new Error("Unexpected end of file: missing CHANNELS");if("CHANNELS"!=c[0].toUpperCase())throw new Error("Expected CHANNELS definition");var m=parseInt(c[1]);u.channels=c.splice(2,m),u.children=[]}for(;e.length>0;){var _=null===(l=e.shift())||void 0===l?void 0:l.trim();if("}"===_)return u;_&&u.children.push(p(e,_,u,o))}throw new Error("Unexpected end of file: missing closing brace")}function m(e,t,n,o){var a=e.split("\n"),i=o.loopMode;t._blockEntityCollection=!!n;var s=new r.Skeleton("","",t);s._parentContainer=n,t._blockEntityCollection=!1;var l=new c(s);l.loopMode=i;var u=a.shift();if(!u||"HIERARCHY"!==u.trim().toUpperCase())throw new Error("HIERARCHY expected");var f=a.shift();if(!f)throw new Error("Unexpected end of file after HIERARCHY");var m=p(a,f.trim(),null,l),_=a.shift();if(!_||"MOTION"!==_.trim().toUpperCase())throw new Error("MOTION expected");var g=a.shift();if(!g)throw new Error("Unexpected end of file before frame count");var b=g.trim().split(/[\s]+/);if(b.length<2)throw new Error("Invalid frame count line");var y=parseInt(b[1]);if(isNaN(y))throw new Error("Failed to read number of frames.");l.numFrames=y;var v=a.shift();if(!v)throw new Error("Unexpected end of file before frame time");var T=v.trim().split(/[\s]+/);if(T.length<3)throw new Error("Invalid frame time line");var x=parseFloat(T[2]);if(isNaN(x))throw new Error("Failed to read frame time.");if(x<=0)throw new Error("Failed to read frame time. Invalid value "+x);l.frameRate=1/x;for(var A=0;A<y;++A){var w=a.shift();w&&h(w.trim().split(/[\s]+/)||[],A,m,{i:0})}return l.root=m,d(l.root,null,l),l.skeleton.returnToRest(),l.skeleton}},4028(e,t,n){n.d(t,{B:()=>o});var r=n(5597),o=function(){function e(){this.materials=[]}return e.prototype.parseMTL=function(t,n,o,a){if(!(n instanceof ArrayBuffer)){for(var i,s=n.split("\n"),l=/\s+/,u=null,c=0;c<s.length;c++){var f=s[c].trim();if(0!==f.length&&"#"!==f.charAt(0)){var d=f.indexOf(" "),h=d>=0?f.substring(0,d):f;h=h.toLowerCase();var p=d>=0?f.substring(d+1).trim():"";if("newmtl"===h)u&&this.materials.push(u),t._blockEntityCollection=!!a,(u=new r.StandardMaterial(p,t))._parentContainer=a,t._blockEntityCollection=!1;else if("kd"===h&&u)i=p.split(l,3).map(parseFloat),u.diffuseColor=r.Color3.FromArray(i);else if("ka"===h&&u)i=p.split(l,3).map(parseFloat),u.ambientColor=r.Color3.FromArray(i);else if("ks"===h&&u)i=p.split(l,3).map(parseFloat),u.specularColor=r.Color3.FromArray(i);else if("ke"===h&&u)i=p.split(l,3).map(parseFloat),u.emissiveColor=r.Color3.FromArray(i);else if("ns"===h&&u)u.specularPower=parseFloat(p);else if("d"===h&&u)u.alpha=parseFloat(p);else if("map_ka"===h&&u)u.ambientTexture=e._GetTexture(o,p,t);else if("map_kd"===h&&u)u.diffuseTexture=e._GetTexture(o,p,t);else if("map_ks"===h&&u)u.specularTexture=e._GetTexture(o,p,t);else if("map_ns"===h);else if("map_bump"===h&&u){var m=p.split(l),_=m.indexOf("-bm"),g=null;_>=0&&(g=m[_+1],m.splice(_,2)),u.bumpTexture=e._GetTexture(o,m.join(" "),t),u.bumpTexture&&null!==g&&(u.bumpTexture.level=parseFloat(g))}else"map_d"===h&&u&&(u.opacityTexture=e._GetTexture(o,p,t))}}u&&this.materials.push(u)}},e._GetTexture=function(t,n,o){if(!n)return null;var a=t;if("file:"===t){var i=n.lastIndexOf("\\");-1===i&&(i=n.lastIndexOf("/")),a+=i>-1?n.substring(i+1):n}else a+=n;return new r.Texture(a,o,!1,e.INVERT_TEXTURE_Y)},e.INVERT_TEXTURE_Y=!0,e}()},9363(e,t,n){n.d(t,{M:()=>r});var r={name:"obj",extensions:".obj"}},8778(e,t,n){n.r(t),n.d(t,{OBJFileLoader:()=>l});var r=n(8322),o=n(5597),a=n(9363),i=n(4028),s=n(3382),l=function(){function e(t){this.name=a.M.name,this.extensions=a.M.extensions,this._assetContainer=null,this._loadingOptions=(0,r.Cl)((0,r.Cl)({},e._DefaultLoadingOptions),null!=t?t:{})}return Object.defineProperty(e,"INVERT_TEXTURE_Y",{get:function(){return i.B.INVERT_TEXTURE_Y},set:function(e){i.B.INVERT_TEXTURE_Y=e},enumerable:!1,configurable:!0}),Object.defineProperty(e,"_DefaultLoadingOptions",{get:function(){return{computeNormals:e.COMPUTE_NORMALS,optimizeNormals:e.OPTIMIZE_NORMALS,importVertexColors:e.IMPORT_VERTEX_COLORS,invertY:e.INVERT_Y,invertTextureY:e.INVERT_TEXTURE_Y,UVScaling:e.UV_SCALING,materialLoadingFailsSilently:e.MATERIAL_LOADING_FAILS_SILENTLY,optimizeWithUV:e.OPTIMIZE_WITH_UV,skipMaterials:e.SKIP_MATERIALS,useLegacyBehavior:e.USE_LEGACY_BEHAVIOR}},enumerable:!1,configurable:!0}),e.prototype._loadMTL=function(e,t,n,r){var a=t+e;o.Tools.LoadFile(a,n,void 0,void 0,!1,(function(e,t){r(a,t)}))},e.prototype.createPlugin=function(t){return new e(t[a.M.name])},e.prototype.canDirectLoad=function(){return!1},e.prototype.importMeshAsync=function(e,t,n,r){return this._parseSolidAsync(e,t,n,r).then((function(e){return{meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}}))},e.prototype.loadAsync=function(e,t,n){return this.importMeshAsync(null,e,t,n).then((function(){}))},e.prototype.loadAssetContainerAsync=function(e,t,n){var r=this,a=new o.AssetContainer(e);return this._assetContainer=a,this.importMeshAsync(null,e,t,n).then((function(e){return e.meshes.forEach((function(e){return a.meshes.push(e)})),e.meshes.forEach((function(e){var t=e.material;t&&-1==a.materials.indexOf(t)&&(a.materials.push(t),t.getActiveTextures().forEach((function(e){-1==a.textures.indexOf(e)&&a.textures.push(e)})))})),r._assetContainer=null,a})).catch((function(e){throw r._assetContainer=null,e}))},e.prototype._parseSolidAsync=function(e,t,n,r){var a=this,l="",u=new i.B,c=[],f=[];n=n.replace(/#.*$/gm,"").trim(),new s.n(c,f,this._loadingOptions).parse(e,n,t,this._assetContainer,(function(e){l=e}));var d=[];return""===l||this._loadingOptions.skipMaterials||d.push(new Promise((function(e,n){a._loadMTL(l,r,(function(i){try{u.parseMTL(t,i,r,a._assetContainer);for(var s=0;s<u.materials.length;s++){for(var d=0,h=[],p=void 0;(p=c.indexOf(u.materials[s].name,d))>-1;)h.push(p),d=p+1;if(-1===p&&0===h.length)u.materials[s].dispose();else for(var m=0;m<h.length;m++){var _=f[h[m]],g=u.materials[s];_.material=g,_.getTotalIndices()||(g.pointsCloud=!0)}}e()}catch(t){o.Tools.Warn("Error processing MTL file: '".concat(l,"'")),a._loadingOptions.materialLoadingFailsSilently?e():n(t)}}),(function(t,r){o.Tools.Warn("Error downloading MTL file: '".concat(l,"'")),a._loadingOptions.materialLoadingFailsSilently?e():n(r)}))}))),Promise.all(d).then((function(){var e=function(e){var t,n;return Boolean(null!==(n=null===(t=e._internalMetadata)||void 0===t?void 0:t._isLine)&&void 0!==n&&n)};return f.forEach((function(n){var r,a;if(e(n)){var i=null!==(r=n.material)&&void 0!==r?r:new o.StandardMaterial(n.name+"_line",t);i.getBindedMeshes().filter((function(t){return!e(t)})).length>0&&(i=null!==(a=i.clone(i.name+"_line"))&&void 0!==a?a:i),i.wireframe=!0,n.material=i,n._internalMetadata&&(n._internalMetadata._isLine=void 0)}})),f}))},e.OPTIMIZE_WITH_UV=!0,e.INVERT_Y=!1,e.IMPORT_VERTEX_COLORS=!1,e.COMPUTE_NORMALS=!1,e.OPTIMIZE_NORMALS=!1,e.UV_SCALING=new o.Vector2(1,1),e.SKIP_MATERIALS=!1,e.MATERIAL_LOADING_FAILS_SILENTLY=!0,e.USE_LEGACY_BEHAVIOR=!1,e}();(0,o.RegisterSceneLoaderPlugin)(new l)},3382(e,t,n){n.d(t,{n:()=>o});var r=n(5597),o=function(){function e(e,t,n){this._positions=[],this._normals=[],this._uvs=[],this._colors=[],this._extColors=[],this._meshesFromObj=[],this._indicesForBabylon=[],this._wrappedPositionForBabylon=[],this._wrappedUvsForBabylon=[],this._wrappedColorsForBabylon=[],this._wrappedNormalsForBabylon=[],this._tuplePosNorm=[],this._curPositionInIndices=0,this._hasMeshes=!1,this._unwrappedPositionsForBabylon=[],this._unwrappedColorsForBabylon=[],this._unwrappedNormalsForBabylon=[],this._unwrappedUVForBabylon=[],this._triangles=[],this._materialNameFromObj="",this._objMeshName="",this._increment=1,this._isFirstMaterial=!0,this._grayColor=new r.Color4(.5,.5,.5,1),this._hasLineData=!1,this._materialToUse=e,this._babylonMeshesArray=t,this._loadingOptions=n}return e.prototype._isInArray=function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[]});var n=e[t[0]].normals.indexOf(t[1]);return-1===n?-1:e[t[0]].idx[n]},e.prototype._isInArrayUV=function(e,t){e[t[0]]||(e[t[0]]={normals:[],idx:[],uv:[]});var n=e[t[0]].normals.indexOf(t[1]);return 1!=n&&t[2]===e[t[0]].uv[n]?e[t[0]].idx[n]:-1},e.prototype._setData=function(e){var t,n,r;null!==(t=e.indiceUvsFromObj)&&void 0!==t||(e.indiceUvsFromObj=-1),null!==(n=e.indiceNormalFromObj)&&void 0!==n||(e.indiceNormalFromObj=-1),-1===(r=this._loadingOptions.optimizeWithUV?this._isInArrayUV(this._tuplePosNorm,[e.indicePositionFromObj,e.indiceNormalFromObj,e.indiceUvsFromObj]):this._isInArray(this._tuplePosNorm,[e.indicePositionFromObj,e.indiceNormalFromObj]))?(this._indicesForBabylon.push(this._wrappedPositionForBabylon.length),this._wrappedPositionForBabylon.push(e.positionVectorFromOBJ),void 0!==e.textureVectorFromOBJ&&this._wrappedUvsForBabylon.push(e.textureVectorFromOBJ),void 0!==e.normalsVectorFromOBJ&&this._wrappedNormalsForBabylon.push(e.normalsVectorFromOBJ),void 0!==e.positionColorsFromOBJ&&this._wrappedColorsForBabylon.push(e.positionColorsFromOBJ),this._tuplePosNorm[e.indicePositionFromObj].normals.push(e.indiceNormalFromObj),this._tuplePosNorm[e.indicePositionFromObj].idx.push(this._curPositionInIndices++),this._loadingOptions.optimizeWithUV&&this._tuplePosNorm[e.indicePositionFromObj].uv.push(e.indiceUvsFromObj)):this._indicesForBabylon.push(r)},e.prototype._unwrapData=function(){try{for(var e=0;e<this._wrappedPositionForBabylon.length;e++)this._unwrappedPositionsForBabylon.push(this._wrappedPositionForBabylon[e].x*this._handednessSign,this._wrappedPositionForBabylon[e].y,this._wrappedPositionForBabylon[e].z),this._wrappedNormalsForBabylon.length&&this._unwrappedNormalsForBabylon.push(this._wrappedNormalsForBabylon[e].x*this._handednessSign,this._wrappedNormalsForBabylon[e].y,this._wrappedNormalsForBabylon[e].z),this._wrappedUvsForBabylon.length&&this._unwrappedUVForBabylon.push(this._wrappedUvsForBabylon[e].x,this._wrappedUvsForBabylon[e].y),this._unwrappedColorsForBabylon.length&&this._unwrappedColorsForBabylon.push(this._wrappedColorsForBabylon[e].r,this._wrappedColorsForBabylon[e].g,this._wrappedColorsForBabylon[e].b,this._wrappedColorsForBabylon[e].a);this._wrappedPositionForBabylon.length=0,this._wrappedNormalsForBabylon.length=0,this._wrappedUvsForBabylon.length=0,this._wrappedColorsForBabylon.length=0,this._tuplePosNorm.length=0,this._curPositionInIndices=0}catch(e){throw new Error("Unable to unwrap data while parsing OBJ data.",{cause:e})}},e.prototype._getTriangles=function(e,t){for(var n=t;n<e.length-1;n++)this._pushTriangle(e,n)},e.prototype._getColor=function(e){var t;return this._loadingOptions.importVertexColors?null!==(t=this._extColors[e])&&void 0!==t?t:this._colors[e]:void 0},e.prototype._setDataForCurrentFaceWithPattern1=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=parseInt(this._triangles[n])-1;this._setData({indicePositionFromObj:r,positionVectorFromOBJ:this._positions[r],positionColorsFromOBJ:this._getColor(r)})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern2=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("/"),o=parseInt(r[0])-1,a=parseInt(r[1])-1;this._setData({indicePositionFromObj:o,indiceUvsFromObj:a,positionVectorFromOBJ:this._positions[o],textureVectorFromOBJ:this._uvs[a],positionColorsFromOBJ:this._getColor(o)})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern3=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("/"),o=parseInt(r[0])-1,a=parseInt(r[1])-1,i=parseInt(r[2])-1;this._setData({indicePositionFromObj:o,indiceUvsFromObj:a,indiceNormalFromObj:i,positionVectorFromOBJ:this._positions[o],textureVectorFromOBJ:this._uvs[a],normalsVectorFromOBJ:this._normals[i]})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern4=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("//"),o=parseInt(r[0])-1,a=parseInt(r[1])-1;this._setData({indicePositionFromObj:o,indiceNormalFromObj:a,positionVectorFromOBJ:this._positions[o],normalsVectorFromOBJ:this._normals[a],positionColorsFromOBJ:this._getColor(o)})}this._triangles.length=0},e.prototype._setDataForCurrentFaceWithPattern5=function(e,t){this._getTriangles(e,t);for(var n=0;n<this._triangles.length;n++){var r=this._triangles[n].split("/"),o=this._positions.length+parseInt(r[0]),a=this._uvs.length+parseInt(r[1]),i=this._normals.length+parseInt(r[2]);this._setData({indicePositionFromObj:o,indiceUvsFromObj:a,indiceNormalFromObj:i,positionVectorFromOBJ:this._positions[o],textureVectorFromOBJ:this._uvs[a],normalsVectorFromOBJ:this._normals[i],positionColorsFromOBJ:this._getColor(o)})}this._triangles.length=0},e.prototype._addPreviousObjMesh=function(){this._meshesFromObj.length>0&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._unwrapData(),this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._handledMesh.indices=this._indicesForBabylon.slice(),this._handledMesh.positions=this._unwrappedPositionsForBabylon.slice(),this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon.slice()),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon.slice()),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon.slice()),this._handledMesh.hasLines=this._hasLineData,this._indicesForBabylon.length=0,this._unwrappedPositionsForBabylon.length=0,this._unwrappedColorsForBabylon.length=0,this._unwrappedNormalsForBabylon.length=0,this._unwrappedUVForBabylon.length=0,this._hasLineData=!1)},e.prototype._optimizeNormals=function(e){var t=e.getVerticesData(r.VertexBuffer.PositionKind),n=e.getVerticesData(r.VertexBuffer.NormalKind),o={};if(t&&n){for(var a=0;a<t.length/3;a++)(l=o[s=t[3*a+0]+"_"+t[3*a+1]+"_"+t[3*a+2]])||(l=[],o[s]=l),l.push(a);var i=new r.Vector3;for(var s in o){var l;if(!((l=o[s]).length<2)){var u=l[0];for(a=1;a<l.length;++a){var c=l[a];n[3*u+0]+=n[3*c+0],n[3*u+1]+=n[3*c+1],n[3*u+2]+=n[3*c+2]}for(i.copyFromFloats(n[3*u+0],n[3*u+1],n[3*u+2]),i.normalize(),a=0;a<l.length;++a)n[3*(c=l[a])+0]=i.x,n[3*c+1]=i.y,n[3*c+2]=i.z}}e.setVerticesData(r.VertexBuffer.NormalKind,n)}},e._IsLineElement=function(e){return e.startsWith("l")},e._IsObjectElement=function(e){return e.startsWith("o")},e._IsGroupElement=function(e){return e.startsWith("g")},e._GetZbrushMRGB=function(e,t){if(!e.startsWith("mrgb"))return null;if(e=e.replace("mrgb","").trim(),t)return[];var n=e.match(/[a-z0-9]/g);if(!n||n.length%8!=0)return[];for(var o=[],a=0;a<n.length/8;a++){var i=n[8*a+2]+n[8*a+3],s=n[8*a+4]+n[8*a+5],l=n[8*a+6]+n[8*a+7];o.push(new r.Color4(parseInt(i,16)/255,parseInt(s,16)/255,parseInt(l,16)/255,1))}return o},e.prototype.parse=function(t,n,o,a,i){var s,l,u=this;n=(n=n.replace(/#MRGB/g,"mrgb")).replace(/#.*$/gm,"").trim(),this._loadingOptions.useLegacyBehavior?(this._pushTriangle=function(e,t){return u._triangles.push(e[0],e[t],e[t+1])},this._handednessSign=1):o.useRightHandedSystem?(this._pushTriangle=function(e,t){return u._triangles.push(e[0],e[t+1],e[t])},this._handednessSign=1):(this._pushTriangle=function(e,t){return u._triangles.push(e[0],e[t],e[t+1])},this._handednessSign=-1);var c=n.split("\n"),f=[],d=[];f.push(d);for(var h=0;h<c.length;h++)if(0!==(g=c[h].trim().replace(/\s\s/g," ")).length&&"#"!==g.charAt(0))if((e._IsGroupElement(g)||e._IsObjectElement(g))&&(d=[],f.push(d)),e._IsLineElement(g))for(var p=g.split(" "),m=1;m<p.length-1;m++)d.push("l ".concat(p[m]," ").concat(p[m+1]));else d.push(g);var _=f.flat();for(h=0;h<_.length;h++){var g,b=void 0;if(0!==(g=_[h].trim().replace(/\s\s/g," ")).length&&"#"!==g.charAt(0))if(e.VertexPattern.test(g)){if(b=g.match(/[^ ]+/g),this._positions.push(new r.Vector3(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3]))),this._loadingOptions.importVertexColors)if(b.length>=7){var y=parseFloat(b[4]),v=parseFloat(b[5]),T=parseFloat(b[6]);this._colors.push(new r.Color4(y>1?y/255:y,v>1?v/255:v,T>1?T/255:T,7===b.length||void 0===b[7]?1:parseFloat(b[7])))}else this._colors.push(this._grayColor)}else if(null!==(b=e.NormalPattern.exec(g)))this._normals.push(new r.Vector3(parseFloat(b[1]),parseFloat(b[2]),parseFloat(b[3])));else if(null!==(b=e.UVPattern.exec(g)))this._uvs.push(new r.Vector2(parseFloat(b[1])*this._loadingOptions.UVScaling.x,parseFloat(b[2])*this._loadingOptions.UVScaling.y));else if(null!==(b=e.FacePattern3.exec(g)))this._setDataForCurrentFaceWithPattern3(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern4.exec(g)))this._setDataForCurrentFaceWithPattern4(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern5.exec(g)))this._setDataForCurrentFaceWithPattern5(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern2.exec(g)))this._setDataForCurrentFaceWithPattern2(b[1].trim().split(" "),1);else if(null!==(b=e.FacePattern1.exec(g)))this._setDataForCurrentFaceWithPattern1(b[1].trim().split(" "),1);else if(null!==(b=e.LinePattern1.exec(g)))this._setDataForCurrentFaceWithPattern1(b[1].trim().split(" "),0),this._hasLineData=!0;else if(null!==(b=e.LinePattern2.exec(g)))this._setDataForCurrentFaceWithPattern2(b[1].trim().split(" "),0),this._hasLineData=!0;else if(b=e._GetZbrushMRGB(g,!this._loadingOptions.importVertexColors))for(var x=0,A=b;x<A.length;x++){var w=A[x];this._extColors.push(w)}else if(null!==(b=e.LinePattern3.exec(g)))this._setDataForCurrentFaceWithPattern3(b[1].trim().split(" "),0),this._hasLineData=!0;else if(e.GroupDescriptor.test(g)||e.ObjectDescriptor.test(g)){var O={name:g.substring(2).trim(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:e.ObjectDescriptor.test(g)};this._addPreviousObjMesh(),this._meshesFromObj.push(O),this._hasMeshes=!0,this._isFirstMaterial=!0,this._increment=1}else e.UseMtlDescriptor.test(g)?(this._materialNameFromObj=g.substring(7).trim(),this._isFirstMaterial&&this._hasMeshes||(this._addPreviousObjMesh(),O={name:(this._objMeshName||"mesh")+"_mm"+this._increment.toString(),indices:null,positions:null,normals:null,uvs:null,colors:null,materialName:this._materialNameFromObj,isObject:!1},this._increment++,this._meshesFromObj.push(O),this._hasMeshes=!0),this._hasMeshes&&this._isFirstMaterial&&(this._meshesFromObj[this._meshesFromObj.length-1].materialName=this._materialNameFromObj,this._isFirstMaterial=!1)):e.MtlLibGroupDescriptor.test(g)?i(g.substring(7).trim()):e.SmoothDescriptor.test(g)||r.Logger.Log("Unhandled expression at line : "+g)}if(this._hasMeshes&&(this._handledMesh=this._meshesFromObj[this._meshesFromObj.length-1],this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData(),this._handledMesh.indices=this._indicesForBabylon,this._handledMesh.positions=this._unwrappedPositionsForBabylon,this._unwrappedNormalsForBabylon.length&&(this._handledMesh.normals=this._unwrappedNormalsForBabylon),this._unwrappedUVForBabylon.length&&(this._handledMesh.uvs=this._unwrappedUVForBabylon),this._unwrappedColorsForBabylon.length&&(this._handledMesh.colors=this._unwrappedColorsForBabylon),this._handledMesh.hasLines=this._hasLineData),!this._hasMeshes){var C=null;if(this._indicesForBabylon.length)this._loadingOptions.useLegacyBehavior&&this._indicesForBabylon.reverse(),this._unwrapData();else{for(var M=0,E=this._positions;M<E.length;M++){var R=E[M];this._unwrappedPositionsForBabylon.push(R.x,R.y,R.z)}if(this._normals.length)for(var L=0,F=this._normals;L<F.length;L++){var P=F[L];this._unwrappedNormalsForBabylon.push(P.x,P.y,P.z)}if(this._uvs.length)for(var S=0,I=this._uvs;S<I.length;S++){var N=I[S];this._unwrappedUVForBabylon.push(N.x,N.y)}if(this._extColors.length)for(var B=0,H=this._extColors;B<H.length;B++){var k=H[B];this._unwrappedColorsForBabylon.push(k.r,k.g,k.b,k.a)}else if(this._colors.length)for(var G=0,V=this._colors;G<V.length;G++)k=V[G],this._unwrappedColorsForBabylon.push(k.r,k.g,k.b,k.a);this._materialNameFromObj||((C=new r.StandardMaterial(r.Geometry.RandomId(),o)).pointsCloud=!0,this._materialNameFromObj=C.name,this._normals.length||(C.disableLighting=!0,C.emissiveColor=r.Color3.White()))}this._meshesFromObj.push({name:r.Geometry.RandomId(),indices:this._indicesForBabylon,positions:this._unwrappedPositionsForBabylon,colors:this._unwrappedColorsForBabylon,normals:this._unwrappedNormalsForBabylon,uvs:this._unwrappedUVForBabylon,materialName:this._materialNameFromObj,directMaterial:C,isObject:!0,hasLines:this._hasLineData})}for(var D=0;D<this._meshesFromObj.length;D++){if(t&&this._meshesFromObj[D].name)if(t instanceof Array){if(-1===t.indexOf(this._meshesFromObj[D].name))continue}else if(this._meshesFromObj[D].name!==t)continue;this._handledMesh=this._meshesFromObj[D],o._blockEntityCollection=!!a;var K=new r.Mesh(this._meshesFromObj[D].name,o);if(K._parentContainer=a,o._blockEntityCollection=!1,this._handledMesh._babylonMesh=K,!this._handledMesh.isObject)for(var U=D-1;U>=0;--U)if(this._meshesFromObj[U].isObject&&this._meshesFromObj[U]._babylonMesh){K.parent=this._meshesFromObj[U]._babylonMesh;break}if(this._materialToUse.push(this._meshesFromObj[D].materialName),this._handledMesh.hasLines&&(null!==(s=K._internalMetadata)&&void 0!==s||(K._internalMetadata={}),K._internalMetadata._isLine=!0),0!==(null===(l=this._handledMesh.positions)||void 0===l?void 0:l.length)){var j=new r.VertexData;if(j.indices=this._handledMesh.indices,j.positions=this._handledMesh.positions,this._loadingOptions.computeNormals||!this._handledMesh.normals){var Y=new Array;r.VertexData.ComputeNormals(this._handledMesh.positions,this._handledMesh.indices,Y),j.normals=Y}else j.normals=this._handledMesh.normals;this._handledMesh.uvs&&(j.uvs=this._handledMesh.uvs),this._handledMesh.colors&&(j.colors=this._handledMesh.colors),j.applyToMesh(K),this._loadingOptions.invertY&&(K.scaling.y*=-1),this._loadingOptions.optimizeNormals&&this._optimizeNormals(K),this._babylonMeshesArray.push(K),this._handledMesh.directMaterial&&(K.material=this._handledMesh.directMaterial)}else this._babylonMeshesArray.push(K)}},e.ObjectDescriptor=/^o/,e.GroupDescriptor=/^g/,e.MtlLibGroupDescriptor=/^mtllib /,e.UseMtlDescriptor=/^usemtl /,e.SmoothDescriptor=/^s /,e.VertexPattern=/^v(\s+[\d|.|+|\-|e|E]+){3,7}/,e.NormalPattern=/^vn(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,e.UVPattern=/^vt(\s+[\d|.|+|\-|e|E]+)( +[\d|.|+|\-|e|E]+)/,e.FacePattern1=/^f\s+(([\d]{1,}[\s]?){3,})+/,e.FacePattern2=/^f\s+((([\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern3=/^f\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern4=/^f\s+((([\d]{1,}\/\/[\d]{1,}[\s]?){3,})+)/,e.FacePattern5=/^f\s+(((-[\d]{1,}\/-[\d]{1,}\/-[\d]{1,}[\s]?){3,})+)/,e.LinePattern1=/^l\s+(([\d]{1,}[\s]?){2,})+/,e.LinePattern2=/^l\s+((([\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,e.LinePattern3=/^l\s+((([\d]{1,}\/[\d]{1,}\/[\d]{1,}[\s]?){2,})+)/,e}()},9003(e,t,n){n.d(t,{B:()=>r});var r={name:"splat",extensions:{".splat":{isBinary:!0},".ply":{isBinary:!0},".spz":{isBinary:!0},".json":{isBinary:!1},".sog":{isBinary:!0}}}},1063(e,t,n){n.r(t),n.d(t,{SPLATFileLoader:()=>c});var r=n(8322),o=n(5597),a=n(9003),i=.28209479177387814;function s(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,new Promise((function(r,o){var a,i=n.createCanvasImage();if(!i)throw new Error("Failed to create ImageBitmap");if(i.onload=function(){try{var e=n.createCanvas(i.width,i.height);if(!e)throw new Error("Failed to create canvas");var t=e.getContext("2d");if(!t)throw new Error("Failed to get 2D context");t.drawImage(i,0,0);var a=t.getImageData(0,0,e.width,e.height);r({bits:new Uint8Array(a.data.buffer),width:a.width})}catch(e){o("Error loading image ".concat(i.src," with exception: ").concat(e))}},i.onerror=function(e){o("Error loading image ".concat(i.src," with exception: ").concat(e))},i.crossOrigin="anonymous","string"==typeof e){if(!t)throw new Error("filename is required when using a URL");i.src=e+t}else{var s=new Blob([e],{type:"image/webp"});a=URL.createObjectURL(s),i.src=a}}))];case 1:return[2,r.sent()]}}))}))}function l(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){var a,s,l,u,c,f,d,h,p,m,_,g,b,y,v,T,x,A,w,O,C,M,E,R,L,F,P,S,I,N,B,H,k,G,V,D,K,U,j,Y,W,z,Z,q,X,J,Q,$,ee,te,ne,re,oe,ae,ie,se,le,ue,ce,fe,de,he,pe,me;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if(a=e.count?e.count:e.means.shape[0],s=new ArrayBuffer(32*a),l=new Float32Array(s),u=new Float32Array(s),c=new Uint8ClampedArray(s),f=new Uint8ClampedArray(s),d=function(e){return Math.sign(e)*(Math.exp(Math.abs(e))-1)},h=t[0].bits,p=t[1].bits,!Array.isArray(e.means.mins)||!Array.isArray(e.means.maxs))throw new Error("Missing arrays in SOG data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<3;le++)m=e.means.mins[le],_=e.means.maxs[le],g=p[C+le],b=h[C+le],U=g<<8|b,re=o.Scalar.Lerp(m,_,U/65535),l[8*ne+le]=d(re);if(y=t[2].bits,2===e.version){if(!e.scales.codebook)throw new Error("Missing codebook in SOG version 2 scales data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<3;le++)T=e.scales.codebook[y[C+le]],v=Math.exp(T),u[8*ne+3+le]=v}else{if(!Array.isArray(e.scales.mins)||!Array.isArray(e.scales.maxs))throw new Error("Missing arrays in SOG scales data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<3;le++)T=y[C+le],x=o.Scalar.Lerp(e.scales.mins[le],e.scales.maxs[le],T/255),A=Math.exp(x),u[8*ne+3+le]=A}if(w=t[4].bits,2===e.version){if(!e.sh0.codebook)throw new Error("Missing codebook in SOG version 2 sh0 data.");for(ne=0;ne<a;ne++){for(C=4*ne,le=0;le<3;le++)O=.5+e.sh0.codebook[w[C+le]]*i,c[32*ne+24+le]=Math.max(0,Math.min(255,Math.round(255*O)));c[32*ne+24+3]=w[C+3]}}else{if(!Array.isArray(e.sh0.mins)||!Array.isArray(e.sh0.maxs))throw new Error("Missing arrays in SOG sh0 data.");for(ne=0;ne<a;ne++)for(C=4*ne,le=0;le<4;le++)M=e.sh0.mins[le],E=e.sh0.maxs[le],R=w[C+le],G=o.Scalar.Lerp(M,E,R/255),void 0,L=le<3?.5+G*i:1/(1+Math.exp(-G)),c[32*ne+24+le]=Math.max(0,Math.min(255,Math.round(255*L)))}for(F=function(e){return 2*(e/255-.5)/Math.SQRT2},P=t[3].bits,ne=0;ne<a;ne++){switch(S=P[4*ne+0],I=P[4*ne+1],N=P[4*ne+2],B=P[4*ne+3],H=F(S),k=F(I),G=F(N),V=B-252,D=H*H+k*k+G*G,K=Math.sqrt(Math.max(0,1-D)),U=void 0,V){case 0:U=[K,H,k,G];break;case 1:U=[H,K,k,G];break;case 2:U=[H,k,K,G];break;case 3:U=[H,k,G,K];break;default:throw new Error("Invalid quaternion mode")}f[32*ne+28+0]=127.5*U[0]+127.5,f[32*ne+28+1]=127.5*U[1]+127.5,f[32*ne+28+2]=127.5*U[2]+127.5,f[32*ne+28+3]=127.5*U[3]+127.5}if(!e.shN)return[3,2];for(j=[0,3,8,15],Y=e.shN.bands?j[e.shN.bands]:e.shN.shape[1]/3,W=t[5].bits,z=t[6].bits,Z=t[5].width,q=3*Y,X=Math.ceil(q/16),J=[],Q=n.getEngine(),$=Q.getCaps().maxTextureSize,ee=Math.ceil(a/$),fe=0;fe<X;fe++)te=new Uint8Array(ee*$*4*4),J.push(te);if(2===e.version){if(!e.shN.codebook)throw new Error("Missing codebook in SOG version 2 shN data.");for(ne=0;ne<a;ne++)for(re=z[4*ne+0]+(z[4*ne+1]<<8),oe=re%64*Y,ae=Math.floor(re/64),ue=0;ue<Y;ue++)for(le=0;le<3;le++)ce=3*ue+le,fe=Math.floor(ce/16),de=J[fe],he=ce%16,pe=16*ne,me=127.5*e.shN.codebook[W[4*(oe+ue)+le+ae*Z*4]]+127.5,de[he+pe]=Math.max(0,Math.min(255,me))}else for(ne=0;ne<a;ne++)for(re=z[4*ne+0]+(z[4*ne+1]<<8),oe=re%64*Y,ae=Math.floor(re/64),ie=e.shN.mins,se=e.shN.maxs,le=0;le<3;le++)for(ue=0;ue<Y/3;ue++)ce=3*ue+le,fe=Math.floor(ce/16),de=J[fe],he=ce%16,pe=16*ne,me=127.5*o.Scalar.Lerp(ie,se,W[4*(oe+ue)+le+ae*Z*4]/255)+127.5,de[he+pe]=Math.max(0,Math.min(255,me));return[4,new Promise((function(e){e({mode:0,data:s,hasVertexColors:!1,sh:J})}))];case 1:case 3:return[2,r.sent()];case 2:return[4,new Promise((function(e){e({mode:0,data:s,hasVertexColors:!1})}))]}}))}))}function u(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){var o,a,i,u,c,f=this;return(0,r.YH)(this,(function(d){switch(d.label){case 0:if(e instanceof Map){if(!(i=(a=e).get("meta.json")))throw new Error("meta.json not found in files Map");o=JSON.parse((new TextDecoder).decode(i))}else o=e;return u=(0,r.fX)((0,r.fX)((0,r.fX)((0,r.fX)([],o.means.files,!0),o.scales.files,!0),o.quats.files,!0),o.sh0.files,!0),o.shN&&u.push.apply(u,o.shN.files),[4,Promise.all(u.map((function(e){return(0,r.sH)(f,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a&&a.has(e)?[4,s(a.get(e),e,n.getEngine())]:[3,2];case 1:case 3:return[2,r.sent()];case 2:return[4,s(t,e,n.getEngine())]}}))}))})))];case 1:return c=d.sent(),[4,l(o,c,n)];case 2:return[2,d.sent()]}}))}))}var c=function(){function e(t){void 0===t&&(t=e._DefaultLoadingOptions),this.name=a.B.name,this._assetContainer=null,this.extensions=a.B.extensions,this._loadingOptions=t}return e.prototype.createPlugin=function(t){return new e(t[a.B.name])},e.prototype.importMeshAsync=function(e,t,n,o,a,i){return(0,r.sH)(this,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._parseAsync(e,t,n,o).then((function(e){return{meshes:e,particleSystems:[],skeletons:[],animationGroups:[],transformNodes:[],geometries:[],lights:[],spriteManagers:[]}}))];case 1:return[2,r.sent()]}}))}))},e._BuildPointCloud=function(e,t){if(!t.byteLength)return!1;var n=new Uint8Array(t),r=new Float32Array(t),a=n.length/32;return e.addPoints(a,(function(e,t){var a=r[8*t+0],i=r[8*t+1],s=r[8*t+2];e.position=new o.Vector3(a,i,s);var l=n[32*t+24+0]/255,u=n[32*t+24+1]/255,c=n[32*t+24+2]/255;e.color=new o.Color4(l,u,c,1)})),!0},e._BuildMesh=function(e,t){for(var n=new o.Mesh("PLYMesh",e),r=new Uint8Array(t.data),a=new Float32Array(t.data),i=r.length/32,s=[],l=new o.VertexData,u=0;u<i;u++){var c=a[8*u+0],f=a[8*u+1],d=a[8*u+2];s.push(c,f,d)}if(t.hasVertexColors){var h=new Float32Array(4*i);for(u=0;u<i;u++){var p=r[32*u+24+0]/255,m=r[32*u+24+1]/255,_=r[32*u+24+2]/255;h[4*u+0]=p,h[4*u+1]=m,h[4*u+2]=_,h[4*u+3]=1}l.colors=h}return l.positions=s,l.indices=t.faces,l.applyToMesh(n),n},e.prototype._unzipWithFFlateAsync=function(e){return(0,r.sH)(this,void 0,void 0,(function(){var t,n,a,i,s,l,u,c,f,d;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(t=this._loadingOptions.fflate)?[3,3]:void 0!==window.fflate?[3,2]:[4,o.Tools.LoadScriptAsync(null!==(d=this._loadingOptions.deflateURL)&&void 0!==d?d:"https://unpkg.com/fflate/umd/index.js")];case 1:r.sent(),r.label=2;case 2:t=window.fflate,r.label=3;case 3:for(n=t.unzipSync,a=n(e),i=new Map,s=0,l=Object.entries(a);s<l.length;s++)u=l[s],c=u[0],f=u[1],i.set(c,f);return[2,i]}}))}))},e.prototype._parseAsync=function(t,n,a,i){var s=this,l=[],c=function(e){var t;n._blockEntityCollection=!!s._assetContainer;var r=null!==(t=s._loadingOptions.gaussianSplattingMesh)&&void 0!==t?t:new o.GaussianSplattingMesh("GaussianSplatting",null,n,s._loadingOptions.keepInRam);r._parentContainer=s._assetContainer,l.push(r),r.updateData(e.data,e.sh,{flipY:!1}),r.scaling.y*=-1,r.computeWorldMatrix(!0),n._blockEntityCollection=!1};if("string"==typeof a){var f=JSON.parse(a);if(f&&f.means&&f.scales&&f.quats&&f.sh0)return new Promise((function(e){u(f,i,n).then((function(t){c(t),e(l)})).catch((function(){throw new Error("Failed to parse SOG data.")}))}))}var d=a instanceof ArrayBuffer?new Uint8Array(a):a;if(80===d[0]&&75===d[1])return new Promise((function(e){s._unzipWithFFlateAsync(d).then((function(t){u(t,i,n).then((function(t){c(t),e(l)})).catch((function(){throw new Error("Failed to parse SOG zip data.")}))}))}));var h=function(t){e._ConvertPLYToSplat(a).then((function(a){return(0,r.sH)(s,void 0,void 0,(function(){var i,s,u;return(0,r.YH)(this,(function(r){switch(r.label){case 0:switch(n._blockEntityCollection=!!this._assetContainer,a.mode){case 0:return[3,1];case 1:return[3,2];case 2:return[3,6]}return[3,7];case 1:switch((i=null!==(u=this._loadingOptions.gaussianSplattingMesh)&&void 0!==u?u:new o.GaussianSplattingMesh("GaussianSplatting",null,n,this._loadingOptions.keepInRam))._parentContainer=this._assetContainer,l.push(i),i.updateData(a.data,a.sh,{flipY:!1}),i.scaling.y*=-1,"RightHanded"===a.chirality&&(i.scaling.y*=-1),a.upAxis){case"X":i.rotation=new o.Vector3(0,0,Math.PI/2);break;case"Y":i.rotation=new o.Vector3(0,0,Math.PI);break;case"Z":i.rotation=new o.Vector3(-Math.PI/2,Math.PI,0)}return i.computeWorldMatrix(!0),[3,8];case 2:return s=new o.PointsCloudSystem("PointCloud",1,n),e._BuildPointCloud(s,a.data)?[4,s.buildMeshAsync().then((function(e){l.push(e)}))]:[3,4];case 3:return r.sent(),[3,5];case 4:s.dispose(),r.label=5;case 5:return[3,8];case 6:if(!a.faces)throw new Error("PLY mesh doesn't contain face informations.");return l.push(e._BuildMesh(n,a)),[3,8];case 7:throw new Error("Unsupported Splat mode");case 8:return n._blockEntityCollection=!1,this.applyAutoCameraLimits(a,n),t(l),[2]}}))}))}))};if(31!==d[0]||139!==d[1])return new Promise((function(e){h(e)}));var p=new ReadableStream({start:function(e){e.enqueue(new Uint8Array(a)),e.close()}}),m=new DecompressionStream("gzip"),_=p.pipeThrough(m);return new Promise((function(e){new Response(_).arrayBuffer().then((function(t){(function(e,t){var n=new Uint8Array(e),r=new Uint32Array(e.slice(0,12)),a=r[2],i=n[12],s=n[13],l=n[14],u=n[15],c=r[1];if(u||1347635022!=r[0]||2!=c&&3!=c)return new Promise((function(e){e({mode:3,data:f,hasVertexColors:!1})}));for(var f=new ArrayBuffer(32*a),d=1/(1<<s),h=new Int32Array(1),p=new Uint8Array(h.buffer),m=function(e,t){return p[0]=e[t+0],p[1]=e[t+1],p[2]=e[t+2],p[3]=128&e[t+2]?255:0,h[0]*d},_=16,g=new Float32Array(f),b=new Float32Array(f),y=new Uint8ClampedArray(f),v=new Uint8ClampedArray(f),T=0;T<a;T++)g[8*T+0]=m(n,_+0),g[8*T+1]=m(n,_+3),g[8*T+2]=m(n,_+6),_+=9;for(T=0;T<a;T++){for(var x=0;x<3;x++){var A=(n[_+a+3*T+x]-127.5)/38.25;y[32*T+24+x]=o.Scalar.Clamp(255*(.5+.282*A),0,255)}y[32*T+24+3]=n[_+T]}for(_+=4*a,T=0;T<a;T++)b[8*T+3+0]=Math.exp(n[_+0]/16-10),b[8*T+3+1]=Math.exp(n[_+1]/16-10),b[8*T+3+2]=Math.exp(n[_+2]/16-10),_+=3;if(c>=3){var w=Math.SQRT1_2;for(T=0;T<a;T++){for(var O=[n[_+0],n[_+1],n[_+2],n[_+3]],C=O[0]+(O[1]<<8)+(O[2]<<16)+(O[3]<<24),M=[],E=C>>>30,R=C,L=0,F=3;F>=0;--F)if(F!==E){var P=511&R,S=R>>>9&1;R>>>=10,M[F]=w*(P/511),1===S&&(M[F]=-M[F]),L+=M[F]*M[F]}var I=1-L;M[E]=Math.sqrt(Math.max(I,0));for(var N=[3,0,1,2],B=0;B<4;B++)v[32*T+28+B]=Math.round(127.5+127.5*M[N[B]]);_+=4}}else for(T=0;T<a;T++){var H=n[_+0],k=n[_+1],G=n[_+2],V=H/127.5-1,D=k/127.5-1,K=G/127.5-1;v[32*T+28+1]=H,v[32*T+28+2]=k,v[32*T+28+3]=G;var U=1-(V*V+D*D+K*K);v[32*T+28+0]=127.5+127.5*Math.sqrt(U<0?0:U),_+=3}if(i){for(var j=3*((i+1)*(i+1)-1),Y=Math.ceil(j/16),W=_,z=[],Z=t.getEngine().getCaps().maxTextureSize,q=Math.ceil(a/Z),X=0;X<Y;X++){var J=new Uint8Array(q*Z*4*4);z.push(J)}for(T=0;T<a;T++)for(var Q=0;Q<j;Q++){var $=n[W++];X=Math.floor(Q/16),z[X][Q%16+16*T]=$}return new Promise((function(e){e({mode:0,data:f,hasVertexColors:!1,sh:z,trainedWithAntialiasing:!!l})}))}return new Promise((function(e){e({mode:0,data:f,hasVertexColors:!1,trainedWithAntialiasing:!!l})}))})(t,n,s._loadingOptions).then((function(t){var r;n._blockEntityCollection=!!s._assetContainer;var a=null!==(r=s._loadingOptions.gaussianSplattingMesh)&&void 0!==r?r:new o.GaussianSplattingMesh("GaussianSplatting",null,n,s._loadingOptions.keepInRam);if(t.trainedWithAntialiasing){var i=a.material;i.kernelSize=.1,i.compensation=!0}a._parentContainer=s._assetContainer,l.push(a),a.updateData(t.data,t.sh,{flipY:!1}),s._loadingOptions.flipY||(a.scaling.y*=-1,a.computeWorldMatrix(!0)),n._blockEntityCollection=!1,s.applyAutoCameraLimits(t,n),e(l)}))})).catch((function(){h(e)}))}))},e.prototype.applyAutoCameraLimits=function(e,t){var n;if(!this._loadingOptions.disableAutoCameraLimits&&(void 0!==e.safeOrbitCameraRadiusMin||void 0!==e.safeOrbitCameraElevationMinMax)&&"ArcRotateCamera"===(null===(n=t.activeCamera)||void 0===n?void 0:n.getClassName())){var r=t.activeCamera;e.safeOrbitCameraElevationMinMax&&(r.lowerBetaLimit=.5*Math.PI-e.safeOrbitCameraElevationMinMax[1],r.upperBetaLimit=.5*Math.PI-e.safeOrbitCameraElevationMinMax[0]),e.safeOrbitCameraRadiusMin&&(r.lowerRadiusLimit=e.safeOrbitCameraRadiusMin)}},e.prototype.loadAssetContainerAsync=function(e,t,n){var r=this,a=new o.AssetContainer(e);return this._assetContainer=a,this.importMeshAsync(null,e,t,n).then((function(e){for(var t=0,n=e.meshes;t<n.length;t++){var o=n[t];a.meshes.push(o)}return r._assetContainer=null,a})).catch((function(e){throw r._assetContainer=null,e}))},e.prototype.loadAsync=function(e,t,n){return this.importMeshAsync(null,e,t,n).then((function(){}))},e._ConvertPLYToSplat=function(e){var t=this,n=new Uint8Array(e),a=(new TextDecoder).decode(n.slice(0,10240)),i=a.indexOf("end_header\n");if(i<0||!a)return new Promise((function(t){t({mode:0,data:e,rawSplat:!0})}));var s=parseInt(/element vertex (\d+)\n/.exec(a)[1]),l=/element face (\d+)\n/.exec(a),u=0;l&&(u=parseInt(l[1]));var c=/element chunk (\d+)\n/.exec(a),f=0;c&&(f=parseInt(c[1]));for(var d=0,h=0,p={double:8,int:4,uint:4,float:4,short:2,ushort:2,uchar:1,list:0},m=1,_=[],g=[],b=a.slice(0,i).split("\n"),y={},v=0,T=b;v<T.length;v++){var x=T[v];if(x.startsWith("property ")){var A=x.split(" "),w=A[1],O=A[2];if(1==m)g.push({name:O,type:w,offset:h}),h+=p[w];else if(0==m)_.push({name:O,type:w,offset:d}),d+=p[w];else if(2==m)_.push({name:O,type:w,offset:d});else if(3==m){var C=new DataView(e,h,2*p.float);y.safeOrbitCameraElevationMinMax=[C.getFloat32(0,!0),C.getFloat32(4,!0)]}else 4==m?(C=new DataView(e,h,p.float),y.safeOrbitCameraRadiusMin=C.getFloat32(0,!0)):5==m&&(C=new DataView(e,h,p.uchar),"up_axis"==O?y.upAxis=0==C.getUint8(0)?"X":1==C.getUint8(0)?"Y":"Z":"chirality"==O&&(y.chirality=0==C.getUint8(0)?"LeftHanded":"RightHanded"));p[w]||o.Logger.Warn("Unsupported property type: ".concat(w,"."))}else x.startsWith("element ")&&("chunk"==(w=x.split(" ")[1])?m=1:"vertex"==w?m=0:"sh"==w?m=2:"safe_orbit_camera_elevation_min_max_radians"==w?m=3:"safe_orbit_camera_radius_min"==w?m=4:"up_axis"!=w&&"chirality"!=w||(m=5))}var M=d,E=h;return o.GaussianSplattingMesh.ConvertPLYWithSHToSplatAsync(e).then((function(n){return(0,r.sH)(t,void 0,void 0,(function(){var t,o,a,l,c,d,h,p,m,g,b,v,T,x,A;return(0,r.YH)(this,(function(w){switch(w.label){case 0:if(t=new DataView(e,i+11),o=E*f+M*s,a=[],u)for(l=0;l<u;l++)if(3==(c=t.getUint8(o))){for(o+=1,d=0;d<c;d++)h=t.getUint32(o+4*(2-d),!0),a.push(h);o+=12}return f?[4,new Promise((function(e){e({mode:0,data:n.buffer,sh:n.sh,faces:a,hasVertexColors:!1,compressed:!0,rawSplat:!1})}))]:[3,2];case 1:case 3:return[2,w.sent()];case 2:for(p=0,m=0,g=["x","y","z","scale_0","scale_1","scale_2","opacity","rot_0","rot_1","rot_2","rot_3"],b=["red","green","blue","f_dc_0","f_dc_1","f_dc_2"],v=0;v<_.length;v++)T=_[v],g.includes(T.name)&&p++,b.includes(T.name)&&m++;return x=p==g.length&&3==m,A=u?2:x?0:1,[4,new Promise((function(e){e((0,r.Cl)((0,r.Cl)({},y),{mode:A,data:n.buffer,sh:n.sh,faces:a,hasVertexColors:!!m,compressed:!1,rawSplat:!1}))}))]}}))}))}))},e._DefaultLoadingOptions={keepInRam:!1,flipY:!1},e}();(0,o.RegisterSceneLoaderPlugin)(new c)},3291(e,t,n){n.d(t,{W:()=>r});var r={name:"stl",extensions:{".stl":{isBinary:!0}}}},7122(e,t,n){n.r(t),n.d(t,{STLFileLoader:()=>a});var r=n(5597),o=n(3291),a=function(){function e(){this.solidPattern=/solid (\S*)([\S\s]*?)endsolid[ ]*(\S*)/g,this.facetsPattern=/facet([\s\S]*?)endfacet/g,this.normalPattern=/normal[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.vertexPattern=/vertex[\s]+([-+]?[0-9]+\.?[0-9]*([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+[\s]+([-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?)+/g,this.name=o.W.name,this.extensions=o.W.extensions}return e.prototype.importMesh=function(e,t,n,o,a){var i;if("string"!=typeof n){if(this._isBinary(n)){var s=new r.Mesh("stlmesh",t);return this._parseBinary(s,n),a&&a.push(s),!0}n=(new TextDecoder).decode(new Uint8Array(n))}for(;i=this.solidPattern.exec(n);){var l=i[1],u=i[3];if(u&&l!=u)return r.Tools.Error("Error in STL, solid name != endsolid name"),!1;if(e&&l)if(e instanceof Array){if(!e.indexOf(l))continue}else if(l!==e)continue;l=l||"stlmesh",s=new r.Mesh(l,t),this._parseASCII(s,i[2]),a&&a.push(s)}return!0},e.prototype.load=function(e,t,n){return this.importMesh(null,e,t,n,null)},e.prototype.loadAssetContainer=function(e,t,n){var o=new r.AssetContainer(e);return e._blockEntityCollection=!0,this.importMesh(null,e,t,n,o.meshes),e._blockEntityCollection=!1,o},e.prototype._isBinary=function(e){var t=new DataView(e);if(t.byteLength<=80)return!1;if(84+50*t.getUint32(80,!0)===t.byteLength)return!0;for(var n=[115,111,108,105,100],r=0;r<5;r++)if(t.getUint8(r)!==n[r])return!0;return!1},e.prototype._parseBinary=function(t,n){for(var o=new DataView(n),a=o.getUint32(80,!0),i=0,s=new Float32Array(3*a*3),l=new Float32Array(3*a*3),u=new Uint32Array(3*a),c=0,f=0;f<a;f++){for(var d=84+50*f,h=o.getFloat32(d,!0),p=o.getFloat32(d+4,!0),m=o.getFloat32(d+8,!0),_=1;_<=3;_++){var g=d+12*_;s[i]=o.getFloat32(g,!0),l[i]=h,e.DO_NOT_ALTER_FILE_COORDINATES?(s[i+1]=o.getFloat32(g+4,!0),s[i+2]=o.getFloat32(g+8,!0),l[i+1]=p,l[i+2]=m):(s[i+2]=o.getFloat32(g+4,!0),s[i+1]=o.getFloat32(g+8,!0),l[i+2]=p,l[i+1]=m),i+=3}e.DO_NOT_ALTER_FILE_COORDINATES?(u[c]=c,u[c+1]=c+2,u[c+2]=c+1,c+=3):(u[c]=c++,u[c]=c++,u[c]=c++)}t.setVerticesData(r.VertexBuffer.PositionKind,s),t.setVerticesData(r.VertexBuffer.NormalKind,l),t.setIndices(u),t.computeWorldMatrix(!0)},e.prototype._parseASCII=function(t,n){for(var o,a=[],i=[],s=[],l=0;o=this.facetsPattern.exec(n);){var u=o[1],c=this.normalPattern.exec(u);if(this.normalPattern.lastIndex=0,c){for(var f=[Number(c[1]),Number(c[5]),Number(c[3])],d=void 0;d=this.vertexPattern.exec(u);)e.DO_NOT_ALTER_FILE_COORDINATES?(a.push(Number(d[1]),Number(d[3]),Number(d[5])),i.push(f[0],f[2],f[1])):(a.push(Number(d[1]),Number(d[5]),Number(d[3])),i.push(f[0],f[1],f[2]));e.DO_NOT_ALTER_FILE_COORDINATES?(s.push(l,l+2,l+1),l+=3):s.push(l++,l++,l++),this.vertexPattern.lastIndex=0}}this.facetsPattern.lastIndex=0,t.setVerticesData(r.VertexBuffer.PositionKind,a),t.setVerticesData(r.VertexBuffer.NormalKind,i),t.setIndices(s),t.computeWorldMatrix(!0)},e.DO_NOT_ALTER_FILE_COORDINATES=!1,e}();(0,r.RegisterSceneLoaderPlugin)(new a)},2493(e,t,n){n.r(t),n.d(t,{EXT_lights_area:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_lights_area",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,a.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,[4,this._loader.loadNodeAsync(e,t,(function(e){var t,r,u=a.ArrayItem.Get(s,i._lights,l.light),c=u.name||e.name;i._loader.babylonScene._blockEntityCollection=!!i._loader._assetContainer;var f=void 0!==u.size?u.size:1;switch(u.type){case"rect":var d=void 0!==(null===(t=u.rect)||void 0===t?void 0:t.aspect)?u.rect.aspect*f:f,h=f;r=new o.RectAreaLight(c,o.Vector3.Zero(),d,h,i._loader.babylonScene);break;case"disk":var p=Math.sqrt(f*f*.25*Math.PI);r=new o.RectAreaLight(c,o.Vector3.Zero(),p,p,i._loader.babylonScene);break;default:throw i._loader.babylonScene._blockEntityCollection=!1,new Error("".concat(s,": Invalid area light type (").concat(u.type,")"))}r._parentContainer=i._loader._assetContainer,i._loader.babylonScene._blockEntityCollection=!1,u._babylonLight=r,r.falloffType=o.Light.FALLOFF_GLTF,r.diffuse=u.color?o.Color3.FromArray(u.color):o.Color3.White(),r.intensity=null==u.intensity?1:u.intensity;var m=new o.TransformNode("".concat(c,"_orientation"),i._loader.babylonScene);m.rotationQuaternion=o.Quaternion.RotationAxis(o.Vector3.Up(),Math.PI),m.parent=e,r.parent=m,i._loader._babylonLights.push(r),a.GLTFLoader.AddPointerMetadata(r,s),n(e)}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},4393(e,t,n){n.r(t),n.d(t,{EXT_lights_ies:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_lights_ies",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,a.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i,u,c,f,d,h=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,[4,this._loader.loadNodeAsync(e,t,(function(e){var t=(u=a.ArrayItem.Get(s,h._lights,l.light)).name||e.name;h._loader.babylonScene._blockEntityCollection=!!h._loader._assetContainer,(i=new o.SpotLight(t,o.Vector3.Zero(),o.Vector3.Backward(),0,1,h._loader.babylonScene)).angle=Math.PI/2,i.innerAngle=0,i._parentContainer=h._loader._assetContainer,h._loader.babylonScene._blockEntityCollection=!1,u._babylonLight=i,i.falloffType=o.Light.FALLOFF_GLTF,i.diffuse=l.color?o.Color3.FromArray(l.color):o.Color3.White(),i.intensity=l.multiplier||1,i.range=Number.MAX_VALUE,i.parent=e,h._loader._babylonLights.push(i),a.GLTFLoader.AddPointerMetadata(i,s),n(e)}))];case 1:return c=r.sent(),u.uri?[4,this._loader.loadUriAsync(e,u,u.uri)]:[3,3];case 2:return f=r.sent(),[3,5];case 3:return d=a.ArrayItem.Get("".concat(e,"/bufferView"),this._loader.gltf.bufferViews,u.bufferView),[4,this._loader.loadBufferViewAsync("/bufferViews/".concat(d.index),d)];case 4:f=r.sent(),r.label=5;case 5:return i.iesProfileTexture=new o.Texture(name+"_iesProfile",this._loader.babylonScene,!0,!1,void 0,null,null,f,!0,void 0,void 0,void 0,void 0,".ies"),[2,c]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3251(e,t,n){n.r(t),n.d(t,{EXT_lights_image_based:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_lights_image_based",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights}},e.prototype.loadSceneAsync=function(e,t){var n=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(n,void 0,void 0,(function(){var n,s,l=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,(n=new Array).push(this._loader.loadSceneAsync(e,t)),this._loader.logOpen("".concat(o)),s=a.ArrayItem.Get("".concat(o,"/light"),this._lights,i.light),n.push(this._loadLightAsync("/extensions/".concat(this.name,"/lights/").concat(i.light),s).then((function(e){l._loader.babylonScene.environmentTexture=e}))),this._loader.logClose(),[4,Promise.all(n).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadLightAsync=function(e,t){var n=this;if(!t._loaded){var i=new Array;this._loader.logOpen("".concat(e));for(var s=new Array(t.specularImages.length),l=function(n){var r=t.specularImages[n];s[n]=new Array(r.length);for(var o=function(t){var o="".concat(e,"/specularImages/").concat(n,"/").concat(t);u._loader.logOpen("".concat(o));var l=r[t],c=a.ArrayItem.Get(o,u._loader.gltf.images,l);i.push(u._loader.loadImageAsync("/images/".concat(l),c).then((function(e){s[n][t]=e}))),u._loader.logClose()},l=0;l<r.length;l++)o(l)},u=this,c=0;c<t.specularImages.length;c++)l(c);this._loader.logClose(),t._loaded=Promise.all(i).then((function(){return(0,r.sH)(n,void 0,void 0,(function(){var n,a,i,l,u;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if((n=new o.RawCubeTexture(this._loader.babylonScene,null,t.specularImageSize)).name=t.name||"environment",t._babylonTexture=n,null!=t.intensity&&(n.level=t.intensity),t.rotation&&(a=o.Quaternion.FromArray(t.rotation),this._loader.babylonScene.useRightHandedSystem||(a=o.Quaternion.Inverse(a)),o.Matrix.FromQuaternionToRef(a,n.getReflectionTextureMatrix())),!t.irradianceCoefficients)throw new Error("".concat(e,": Irradiance coefficients are missing"));return(i=o.SphericalHarmonics.FromArray(t.irradianceCoefficients)).scaleInPlace(t.intensity),i.convertIrradianceToLambertianRadiance(),l=o.SphericalPolynomial.FromHarmonics(i),u=(s.length-1)/Math.log2(t.specularImageSize),[4,n.updateRGBDAsync(s,l,u)];case 1:return[2,r.sent()]}}))}))}))}return t._loaded.then((function(){return t._babylonTexture}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},9499(e,t,n){n.r(t),n.d(t,{EXT_mesh_gpu_instancing:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="EXT_mesh_gpu_instancing",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,s){return(0,r.sH)(i,void 0,void 0,(function(){var i,l,u,c,f=this;return(0,r.YH)(this,(function(d){switch(d.label){case 0:return this._loader._disableInstancedMesh++,i=this._loader.loadNodeAsync("/nodes/".concat(t.index),t,n),this._loader._disableInstancedMesh--,t._primitiveBabylonMeshes?[3,2]:[4,i];case 1:case 3:return[2,d.sent()];case 2:return l=new Array,u=0,(c=function(t){if(null!=s.attributes[t]){var n=a.ArrayItem.Get("".concat(e,"/attributes/").concat(t),f._loader.gltf.accessors,s.attributes[t]);if(l.push(f._loader._loadFloatAccessorAsync("/accessors/".concat(n.bufferView),n)),0===u)u=n.count;else if(u!==n.count)throw new Error("".concat(e,"/attributes: Instance buffer accessors do not have the same count."))}else l.push(Promise.resolve(null))})("TRANSLATION"),c("ROTATION"),c("SCALE"),c("_COLOR_0"),[4,i.then((function(e){return(0,r.sH)(f,void 0,void 0,(function(){var n,a,i,s,c,f,d,h,p,m;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,Promise.all(l)];case 1:for(n=r.sent(),a=n[0],i=n[1],s=n[2],c=n[3],f=new Float32Array(16*u),o.TmpVectors.Vector3[0].copyFromFloats(0,0,0),o.TmpVectors.Quaternion[0].copyFromFloats(0,0,0,1),o.TmpVectors.Vector3[1].copyFromFloats(1,1,1),d=0;d<u;++d)a&&o.Vector3.FromArrayToRef(a,3*d,o.TmpVectors.Vector3[0]),i&&o.Quaternion.FromArrayToRef(i,4*d,o.TmpVectors.Quaternion[0]),s&&o.Vector3.FromArrayToRef(s,3*d,o.TmpVectors.Vector3[1]),o.Matrix.ComposeToRef(o.TmpVectors.Vector3[1],o.TmpVectors.Quaternion[0],o.TmpVectors.Vector3[0],o.TmpVectors.Matrix[0]),o.TmpVectors.Matrix[0].copyToArray(f,16*d);for(h=0,p=t._primitiveBabylonMeshes;h<p.length;h++)(m=p[h]).thinInstanceSetBuffer("matrix",f,16,!0),c&&(c.length===3*u?m.thinInstanceSetBuffer("color",c,3,!0):c.length===4*u?m.thinInstanceSetBuffer("color",c,4,!0):o.Logger.Warn("Unexpected size of _COLOR_0 attribute for mesh "+m.name));return[2,e]}}))}))}))]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5549(e,t,n){n.r(t),n.d(t,{EXT_meshopt_compression:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="EXT_meshopt_compression",l=function(){function e(e){this.name=s,this.enabled=e.isExtensionUsed(s),this._loader=e}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadBufferViewAsync=function(e,t){var n=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(n,void 0,void 0,(function(){var n,i,l=this;return(0,r.YH)(this,(function(u){switch(u.label){case 0:return(n=t)._meshOptData?[4,n._meshOptData]:[3,2];case 1:case 3:return[2,u.sent()];case 2:return i=o.ArrayItem.Get("".concat(e,"/buffer"),this._loader.gltf.buffers,s.buffer),n._meshOptData=this._loader.loadBufferAsync("/buffers/".concat(i.index),i,s.byteOffset||0,s.byteLength).then((function(e){return(0,r.sH)(l,void 0,void 0,(function(){return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,a.MeshoptCompression.Default.decodeGltfBufferAsync(e,s.count,s.byteStride,s.mode,s.filter)];case 1:return[2,t.sent()]}}))}))})),[4,n._meshOptData]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},6416(e,t,n){n.r(t),n.d(t,{EXT_texture_avif:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="EXT_texture_avif",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(a,void 0,void 0,(function(){var a,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a=null==t.sampler?o.GLTFLoader.DefaultSampler:o.ArrayItem.Get("".concat(e,"/sampler"),this._loader.gltf.samplers,t.sampler),l=o.ArrayItem.Get("".concat(i,"/source"),this._loader.gltf.images,s.source),[4,this._loader._createTextureAsync(e,a,l,(function(e){n(e)}),void 0,!t._textureInfo.nonColorData)];case 1:return[2,r.sent()]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},10(e,t,n){n.r(t),n.d(t,{EXT_texture_webp:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="EXT_texture_webp",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(a,void 0,void 0,(function(){var a,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a=null==t.sampler?o.GLTFLoader.DefaultSampler:o.ArrayItem.Get("".concat(e,"/sampler"),this._loader.gltf.samplers,t.sampler),l=o.ArrayItem.Get("".concat(i,"/source"),this._loader.gltf.images,s.source),[4,this._loader._createTextureAsync(e,a,l,(function(e){n(e)}),void 0,!t._textureInfo.nonColorData)];case 1:return[2,r.sent()]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},4158(e,t,n){n.r(t),n.d(t,{ExtrasAsMetadata:()=>a});var r=n(4015),o="ExtrasAsMetadata",a=function(){function e(e){this.name=o,this.enabled=!0,this._loader=e}return e.prototype._assignExtras=function(e,t){if(t.extras&&Object.keys(t.extras).length>0){var n=e.metadata=e.metadata||{};(n.gltf=n.gltf||{}).extras=t.extras}},e.prototype.dispose=function(){this._loader=null},e.prototype.loadNodeAsync=function(e,t,n){var r=this;return this._loader.loadNodeAsync(e,t,(function(e){r._assignExtras(e,t),n(e)}))},e.prototype.loadCameraAsync=function(e,t,n){var r=this;return this._loader.loadCameraAsync(e,t,(function(e){r._assignExtras(e,t),n(e)}))},e.prototype.createMaterial=function(e,t,n){var r=this._loader.createMaterial(e,t,n);return this._assignExtras(r,t),r},e.prototype.loadAnimationAsync=function(e,t){var n=this;return this._loader.loadAnimationAsync(e,t).then((function(e){return n._assignExtras(e,t),e}))},e}();(0,r.Hg)(o),(0,r.Ye)(o,!1,(function(e){return new a(e)}))},9334(e,t,n){var r=n(8322),o=n(5597),a=n(2727),i=n(8698);function s(e,t,n,r){return o.Color3.FromArray(t,n).scale(r)}function l(e,t,n,r){return t[n]*r}function u(e,t,n,r){return-t[n]*r}function c(e,t,n,r){return t[n+1]*r}function f(e,t,n,r){return t[n]*r*2}function d(e){return{scale:[new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".uScale"),l,(function(){return 2})),new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".vScale"),c,(function(){return 2}))],offset:[new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".uOffset"),l,(function(){return 2})),new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".vOffset"),c,(function(){return 2}))],rotation:[new p(o.Animation.ANIMATIONTYPE_FLOAT,"".concat(e,".wAng"),u,(function(){return 1}))]}}var h=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){return[{babylonAnimatable:e._babylonCamera,babylonAnimation:this._buildAnimation(t,n,r)}]},t}(a.AnimationPropertyInfo),p=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var o=[];for(var a in e._data)o.push({babylonAnimatable:e._data[a].babylonMaterial,babylonAnimation:this._buildAnimation(t,n,r)});return o},t}(a.AnimationPropertyInfo),m=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){return[{babylonAnimatable:e._babylonLight,babylonAnimation:this._buildAnimation(t,n,r)}]},t}(a.AnimationPropertyInfo),_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var o=this;return e._primitiveBabylonMeshes?e._primitiveBabylonMeshes.map((function(e){return{babylonAnimatable:e,babylonAnimation:o._buildAnimation(t,n,r)}})):[]},t}(a.AnimationPropertyInfo);(0,i.ZU)("/cameras/{}/orthographic/xmag",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoLeft",u,(function(){return 1})),new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoRight",c,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/orthographic/ymag",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoBottom",u,(function(){return 1})),new h(o.Animation.ANIMATIONTYPE_FLOAT,"orthoTop",c,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/orthographic/zfar",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"maxZ",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/orthographic/znear",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"minZ",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/perspective/yfov",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"fov",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/perspective/zfar",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"maxZ",l,(function(){return 1}))]),(0,i.ZU)("/cameras/{}/perspective/znear",[new h(o.Animation.ANIMATIONTYPE_FLOAT,"minZ",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"albedoColor",s,(function(){return 4})),new p(o.Animation.ANIMATIONTYPE_FLOAT,"alpha",(function(e,t,n,r){return t[n+3]*r}),(function(){return 4}))]),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/metallicFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"metallic",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/metallicFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"roughness",l,(function(){return 1}))]);var g=d("albedoTexture");(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/scale",g.scale),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/offset",g.offset),(0,i.ZU)("/materials/{}/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform/rotation",g.rotation);var b=d("metallicTexture");(0,i.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/scale",b.scale),(0,i.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/offset",b.offset),(0,i.ZU)("//materials/{}/pbrMetallicRoughness/metallicRoughnessTexture/rotation",b.rotation),(0,i.ZU)("/materials/{}/emissiveFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"emissiveColor",s,(function(){return 3}))]);var y=d("bumpTexture");(0,i.ZU)("/materials/{}/normalTexture/scale",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"bumpTexture.level",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/scale",y.scale),(0,i.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/offset",y.offset),(0,i.ZU)("/materials/{}/normalTexture/extensions/KHR_texture_transform/rotation",y.rotation),(0,i.ZU)("/materials/{}/occlusionTexture/strength",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"ambientTextureStrength",l,(function(){return 1}))]);var v=d("ambientTexture");(0,i.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/scale",v.scale),(0,i.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/offset",v.offset),(0,i.ZU)("/materials/{}/occlusionTexture/extensions/KHR_texture_transform/rotation",v.rotation);var T=d("emissiveTexture");(0,i.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/scale",T.scale),(0,i.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/offset",T.offset),(0,i.ZU)("/materials/{}/emissiveTexture/extensions/KHR_texture_transform/rotation",T.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyStrength",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"anisotropy.intensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyRotation",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"anisotropy.angle",l,(function(){return 1}))]);var x=d("anisotropy.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/scale",x.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/offset",x.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_anisotropy/anisotropyTexture/extensions/KHR_texture_transform/rotation",x.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.intensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.roughness",l,(function(){return 1}))]);var A=d("clearCoat.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/scale",A.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/offset",A.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatTexture/extensions/KHR_texture_transform/rotation",A.rotation);var w=d("clearCoat.bumpTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/scale",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"clearCoat.bumpTexture.level",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/scale",w.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/offset",w.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatNormalTexture/extensions/KHR_texture_transform/rotation",w.rotation);var O=d("clearCoat.textureRoughness");(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/scale",O.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/offset",O.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_clearcoat/clearcoatRoughnessTexture/extensions/KHR_texture_transform/rotation",O.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_dispersion/dispersionFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.dispersion",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_emissive_strength/emissiveStrength",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"emissiveIntensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_ior/ior",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"indexOfRefraction",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.intensity",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceIor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.indexOfRefraction",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMinimum",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.minimumThickness",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessMaximum",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"iridescence.maximumThickness",l,(function(){return 1}))]);var C=d("iridescence.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/scale",C.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/offset",C.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceTexture/extensions/KHR_texture_transform/rotation",C.rotation);var M=d("iridescence.thicknessTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/scale",M.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/offset",M.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_iridescence/iridescenceThicknessTexture/extensions/KHR_texture_transform/rotation",M.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"sheen.color",s,(function(){return 3}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"sheen.roughness",l,(function(){return 1}))]);var E=d("sheen.texture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/scale",E.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/offset",E.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenColorTexture/extensions/KHR_texture_transform/rotation",E.rotation);var R=d("sheen.textureRoughness");(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/scale",R.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/offset",R.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_sheen/sheenRoughnessTexture/extensions/KHR_texture_transform/rotation",R.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"metallicF0Factor",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"metallicReflectanceColor",s,(function(){return 3}))]);var L=d("metallicReflectanceTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/scale",L.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/offset",L.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularTexture/extensions/KHR_texture_transform/rotation",L.rotation);var F=d("reflectanceTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/scale",F.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/offset",F.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_specular/specularColorTexture/extensions/KHR_texture_transform/rotation",F.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.refractionIntensity",l,(function(){return 1}))]);var P=d("subSurface.refractionIntensityTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/scale",P.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/offset",P.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_transmission/transmissionTexture/extensions/KHR_texture_transform/rotation",P.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/attenuationColor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"subSurface.tintColor",s,(function(){return 3}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/attenuationDistance",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.tintColorAtDistance",l,(function(){return 1}))]),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.maximumThickness",l,(function(){return 1}))]);var S=d("subSurface.thicknessTexture");(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/scale",S.scale),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/offset",S.offset),(0,i.ZU)("/materials/{}/extensions/KHR_materials_volume/thicknessTexture/extensions/KHR_texture_transform/rotation",S.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionFactor",[new p(o.Animation.ANIMATIONTYPE_FLOAT,"subSurface.translucencyIntensity",l,(function(){return 1}))]);var I=d("subSurface.translucencyIntensityTexture");(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/scale",I.scale),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/offset",I.offset),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionTexture/extensions/KHR_texture_transform/rotation",I.rotation),(0,i.ZU)("/materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorFactor",[new p(o.Animation.ANIMATIONTYPE_COLOR3,"subSurface.translucencyColor",s,(function(){return 3}))]);var N=d("subSurface.translucencyColorTexture");(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/scale",N.scale),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/offset",N.offset),(0,i.ZU)("materials/{}/extensions/KHR_materials_diffuse_transmission/diffuseTransmissionColorTexture/extensions/KHR_texture_transform/rotation",N.rotation),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/color",[new m(o.Animation.ANIMATIONTYPE_COLOR3,"diffuse",s,(function(){return 3}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/intensity",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"intensity",l,(function(){return 1}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/range",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"range",l,(function(){return 1}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/spot/innerConeAngle",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"innerAngle",f,(function(){return 1}))]),(0,i.ZU)("/extensions/KHR_lights_punctual/lights/{}/spot/outerConeAngle",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"angle",f,(function(){return 1}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/color",[new m(o.Animation.ANIMATIONTYPE_COLOR3,"diffuse",s,(function(){return 3}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/intensity",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"intensity",l,(function(){return 1}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/size",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"radius",l,(function(){return 1}))]),(0,i.ZU)("/extensions/EXT_lights_area/lights/{}/rect/aspect",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"radius",l,(function(){return 1}))]),(0,i.ZU)("/nodes/{}/extensions/EXT_lights_ies/color",[new m(o.Animation.ANIMATIONTYPE_COLOR3,"diffuse",s,(function(){return 3}))]),(0,i.ZU)("/nodes/{}/extensions/EXT_lights_ies/multiplier",[new m(o.Animation.ANIMATIONTYPE_FLOAT,"intensity",l,(function(){return 1}))]),(0,i.ZU)("/nodes/{}/extensions/KHR_node_visibility/visible",[new _(o.Animation.ANIMATIONTYPE_FLOAT,"isVisible",l,(function(){return 1}))])},5898(e,t,n){n.r(t),n.d(t,{KHR_animation_pointer:()=>s});var r=n(5597),o=n(4015),a=n(8698),i=(n(9334),"KHR_animation_pointer"),s=function(){function e(e){this.name=i,this._loader=e,this._pathToObjectConverter=(0,a.Wt)(this._loader.gltf)}return Object.defineProperty(e.prototype,"enabled",{get:function(){return this._loader.isExtensionUsed(i)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._loader=null,delete this._pathToObjectConverter},e.prototype._loadAnimationChannelAsync=function(e,t,n,o,a){var i,s=null===(i=o.target.extensions)||void 0===i?void 0:i.KHR_animation_pointer;if(!s||!this._pathToObjectConverter)return null;"pointer"!==o.target.path&&r.Logger.Warn("".concat(e,"/target/path: Value (").concat(o.target.path,") must be (").concat("pointer",") when using the ").concat(this.name," extension")),null!=o.target.node&&r.Logger.Warn("".concat(e,"/target/node: Value (").concat(o.target.node,") must not be present when using the ").concat(this.name," extension"));var l="".concat(e,"/extensions/").concat(this.name),u=s.pointer;if(!u)throw new Error("".concat(l,": Pointer is missing"));try{var c=this._pathToObjectConverter.convert(u);if(!c.info.interpolation)throw new Error("".concat(l,"/pointer: Interpolation is missing"));return this._loader._loadAnimationChannelFromTargetInfoAsync(e,t,n,o,{object:c.object,info:c.info.interpolation},a)}catch(e){return r.Logger.Warn("".concat(l,"/pointer: Invalid pointer (").concat(u,") skipped")),null}},e}();(0,o.Hg)(i),(0,o.Ye)(i,!0,(function(e){return new s(e)}))},6396(e,t,n){n.r(t),n.d(t,{KHR_draco_mesh_compression:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_draco_mesh_compression",l=function(){function e(e){this.name=s,this.useNormalizedFlagFromAccessor=!0,this._loader=e,this.enabled=o.DracoDecoder.DefaultAvailable&&this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){delete this.dracoDecoder,this._loader=null},e.prototype._loadVertexDataAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i,u,c,f,d=this;return(0,r.YH)(this,(function(h){switch(h.label){case 0:if(null!=t.mode&&4!==t.mode&&5!==t.mode)throw new Error("".concat(e,": Unsupported mode ").concat(t.mode));return i={},u={},(c=function(e,r){var o=l.attributes[e];if(null!=o&&(n._delayInfo=n._delayInfo||[],-1===n._delayInfo.indexOf(r)&&n._delayInfo.push(r),i[r]=o,d.useNormalizedFlagFromAccessor)){var s=a.ArrayItem.TryGet(d._loader.gltf.accessors,t.attributes[e]);s&&(u[r]=s.normalized||!1)}})("POSITION",o.VertexBuffer.PositionKind),c("NORMAL",o.VertexBuffer.NormalKind),c("TANGENT",o.VertexBuffer.TangentKind),c("TEXCOORD_0",o.VertexBuffer.UVKind),c("TEXCOORD_1",o.VertexBuffer.UV2Kind),c("TEXCOORD_2",o.VertexBuffer.UV3Kind),c("TEXCOORD_3",o.VertexBuffer.UV4Kind),c("TEXCOORD_4",o.VertexBuffer.UV5Kind),c("TEXCOORD_5",o.VertexBuffer.UV6Kind),c("JOINTS_0",o.VertexBuffer.MatricesIndicesKind),c("WEIGHTS_0",o.VertexBuffer.MatricesWeightsKind),c("COLOR_0",o.VertexBuffer.ColorKind),(f=a.ArrayItem.Get(s,this._loader.gltf.bufferViews,l.bufferView))._dracoBabylonGeometry||(f._dracoBabylonGeometry=this._loader.loadBufferViewAsync("/bufferViews/".concat(f.index),f).then((function(s){return(0,r.sH)(d,void 0,void 0,(function(){var l,c,f;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return l=this.dracoDecoder||o.DracoDecoder.Default,c=a.ArrayItem.TryGet(this._loader.gltf.accessors,t.attributes.POSITION),f=this._loader.parent.alwaysComputeBoundingBox||n.skeleton||!c?null:(0,a.LoadBoundingInfoFromPositionAccessor)(c),[4,l._decodeMeshToGeometryForGltfAsync(n.name,this._loader.babylonScene,s,i,u,f).catch((function(t){throw new Error("".concat(e,": ").concat(t.message))}))];case 1:return[2,r.sent()]}}))}))}))),[4,f._dracoBabylonGeometry];case 1:return[2,h.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3757(e,t,n){n.r(t),n.d(t,{KHR_interactivity:()=>u,_AddInteractivityObjectModel:()=>c});var r=n(8322),o=n(5597),a=n(4015),i=n(8698),s=n(9222),l="KHR_interactivity",u=function(){function e(e){this._loader=e,this.name=l,this.enabled=this._loader.isExtensionUsed(l),this._pathConverter=(0,i.Wt)(this._loader.gltf),e._skipStartAnimationStep=!0;var t=e.babylonScene;t&&c(t)}return e.prototype.dispose=function(){this._loader=null,delete this._pathConverter},e.prototype.onReady=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e,t,n,a,i,l=this;return(0,r.YH)(this,(function(u){switch(u.label){case 0:return this._loader.babylonScene&&this._pathConverter?(e=this._loader.babylonScene,(t=null===(i=this._loader.gltf.extensions)||void 0===i?void 0:i.KHR_interactivity)?((n=new o.FlowGraphCoordinator({scene:e})).dispatchEventsSynchronously=!1,a=t.graphs.map((function(e){return new s.W(e,l._loader.gltf,l._loader.parent.targetFps).serializeToFlowGraph()})),[4,Promise.all(a.map((function(e){return(0,r.sH)(l,void 0,void 0,(function(){return(0,r.YH)(this,(function(t){switch(t.label){case 0:return[4,(0,o.ParseFlowGraphAsync)(e,{coordinator:n,pathConverter:this._pathConverter})];case 1:return[2,t.sent()]}}))}))})))]):[2]):[2];case 1:return u.sent(),n.start(),[2]}}))}))},e}();function c(e){(0,i.oR)("/extensions/KHR_interactivity/?/activeCamera/rotation",{get:function(){if(!e.activeCamera)return new o.Quaternion(NaN,NaN,NaN,NaN);var t=o.Quaternion.FromRotationMatrix(e.activeCamera.getWorldMatrix()).normalize();return e.useRightHandedSystem||(t.w*=-1,t.x*=-1),t},type:"Quaternion",getTarget:function(){return e.activeCamera}}),(0,i.oR)("/extensions/KHR_interactivity/?/activeCamera/position",{get:function(){if(!e.activeCamera)return new o.Vector3(NaN,NaN,NaN);var t=e.activeCamera.getWorldMatrix().getTranslation();return e.useRightHandedSystem||(t.x*=-1),t},type:"Vector3",getTarget:function(){return e.activeCamera}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/isPlaying",{get:function(e){var t,n;return null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.isPlaying)&&void 0!==n&&n},type:"boolean",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/minTime",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.from)&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/maxTime",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.to)&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/playhead",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.getCurrentFrame())&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}}),(0,i.oR)("/animations/{}/extensions/KHR_interactivity/virtualPlayhead",{get:function(e){var t,n;return(null!==(n=null===(t=e._babylonAnimationGroup)||void 0===t?void 0:t.getCurrentFrame())&&void 0!==n?n:0)/60},type:"number",getTarget:function(e){return e._babylonAnimationGroup}})}(0,o.addToBlockFactory)(l,"FlowGraphGLTFDataProvider",(function(){return(0,r.sH)(void 0,void 0,void 0,(function(){return(0,r.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(n.bind(n,1274))];case 1:return[2,e.sent().FlowGraphGLTFDataProvider]}}))}))})),(0,a.Hg)(l),(0,a.Ye)(l,!0,(function(e){return new u(e)}))},1943(e,t,n){n.d(t,{KD:()=>a,U3:()=>f,X6:()=>o,rO:()=>i});var r=n(5597);function o(e){var t=e.split(":");return a({op:t[0],extension:t[1]})}function a(e,t){var n;void 0===t&&(t=!0);var o=e.extension?null===(n=s[e.extension])||void 0===n?void 0:n[e.op]:l[e.op];if(!o&&(r.Logger.Warn("No mapping found for operation ".concat(e.op," and extension ").concat(e.extension||"KHR_interactivity")),t)){var a={},i={flows:{}};if(e.inputValueSockets)for(var u in a.values={},e.inputValueSockets)a.values[u]={name:u};return e.outputValueSockets&&(i.values={},Object.keys(e.outputValueSockets).forEach((function(e){i.values[e]={name:e}}))),{blocks:[],inputs:a,outputs:i}}return o}function i(e,t,n){s[t]||(s[t]={}),s[t][e]=n}var s={BABYLON:{"flow/log":{blocks:["FlowGraphConsoleLogBlock"],inputs:{values:{message:{name:"message"}}}}}},l={"event/onStart":{blocks:["FlowGraphSceneReadyEventBlock"],outputs:{flows:{out:{name:"done"}}}},"event/onTick":{blocks:["FlowGraphSceneTickEventBlock"],inputs:{},outputs:{values:{timeSinceLastTick:{name:"deltaTime",gltfType:"number"}},flows:{out:{name:"done"}}}},"event/send":{blocks:["FlowGraphSendCustomEventBlock"],extraProcessor:function(e,t,n,r,o){var a;if("event/send"!==t.op||!e.configuration||1!==Object.keys(e.configuration).length)throw new Error("Receive event should have a single configuration object, the event itself");var i=null===(a=e.configuration.event.value)||void 0===a?void 0:a[0];if("number"!=typeof i)throw new Error("Event id should be a number");var s=r.arrays.events[i],l=o[0];return l.config||(l.config={}),l.config.eventId=s.eventId,l.config.eventData=s.eventData,o}},"event/receive":{blocks:["FlowGraphReceiveCustomEventBlock"],outputs:{flows:{out:{name:"done"}}},validation:function(e,t){var n,o;if(!e.configuration)return r.Logger.Error("Receive event should have a configuration object"),{valid:!1,error:"Receive event should have a configuration object"};var a=e.configuration.event;if(!a)return r.Logger.Error("Receive event should have a single configuration object, the event itself"),{valid:!1,error:"Receive event should have a single configuration object, the event itself"};var i=null===(n=a.value)||void 0===n?void 0:n[0];return"number"!=typeof i?(r.Logger.Error("Event id should be a number"),{valid:!1,error:"Event id should be a number"}):(null===(o=t.events)||void 0===o?void 0:o[i])?{valid:!0}:(r.Logger.Error("Event with id ".concat(i," not found")),{valid:!1,error:"Event with id ".concat(i," not found")})},extraProcessor:function(e,t,n,r,o){var a;if("event/receive"!==t.op||!e.configuration||1!==Object.keys(e.configuration).length)throw new Error("Receive event should have a single configuration object, the event itself");var i=null===(a=e.configuration.event.value)||void 0===a?void 0:a[0];if("number"!=typeof i)throw new Error("Event id should be a number");var s=r.arrays.events[i],l=o[0];return l.config||(l.config={}),l.config.eventId=s.eventId,l.config.eventData=s.eventData,o}},"math/E":u("FlowGraphEBlock"),"math/Pi":u("FlowGraphPIBlock"),"math/Inf":u("FlowGraphInfBlock"),"math/NaN":u("FlowGraphNaNBlock"),"math/abs":u("FlowGraphAbsBlock"),"math/sign":u("FlowGraphSignBlock"),"math/trunc":u("FlowGraphTruncBlock"),"math/floor":u("FlowGraphFloorBlock"),"math/ceil":u("FlowGraphCeilBlock"),"math/round":{blocks:["FlowGraphRoundBlock"],configuration:{},inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.roundHalfAwayFromZero=!0,o}},"math/fract":u("FlowGraphFractBlock"),"math/neg":u("FlowGraphNegationBlock"),"math/add":u("FlowGraphAddBlock",["a","b"],!0),"math/sub":u("FlowGraphSubtractBlock",["a","b"],!0),"math/mul":{blocks:["FlowGraphMultiplyBlock"],extraProcessor:function(e,t,n,r,o){var a;(a=o[0]).config||(a.config={}),o[0].config.useMatrixPerComponent=!0,o[0].config.preventIntegerFloatArithmetic=!0;var i=-1;return Object.keys(e.values||{}).find((function(t){var n;return void 0!==(null===(n=e.values)||void 0===n?void 0:n[t].type)&&(i=e.values[t].type,!0)})),-1!==i&&(o[0].config.type=r.arrays.types[i].flowGraphType),o},validation:function(e){return e.values?c(e):{valid:!0}}},"math/div":u("FlowGraphDivideBlock",["a","b"],!0),"math/rem":u("FlowGraphModuloBlock",["a","b"]),"math/min":u("FlowGraphMinBlock",["a","b"]),"math/max":u("FlowGraphMaxBlock",["a","b"]),"math/clamp":u("FlowGraphClampBlock",["a","b","c"]),"math/saturate":u("FlowGraphSaturateBlock"),"math/mix":u("FlowGraphMathInterpolationBlock",["a","b","c"]),"math/eq":u("FlowGraphEqualityBlock",["a","b"]),"math/lt":u("FlowGraphLessThanBlock",["a","b"]),"math/le":u("FlowGraphLessThanOrEqualBlock",["a","b"]),"math/gt":u("FlowGraphGreaterThanBlock",["a","b"]),"math/ge":u("FlowGraphGreaterThanOrEqualBlock",["a","b"]),"math/isNaN":u("FlowGraphIsNaNBlock"),"math/isInf":u("FlowGraphIsInfBlock"),"math/select":{blocks:["FlowGraphConditionalBlock"],inputs:{values:{condition:{name:"condition"},a:{name:"onTrue"},b:{name:"onFalse"}}},outputs:{values:{value:{name:"output"}}}},"math/random":{blocks:["FlowGraphRandomBlock"],outputs:{values:{value:{name:"value"}}}},"math/sin":u("FlowGraphSinBlock"),"math/cos":u("FlowGraphCosBlock"),"math/tan":u("FlowGraphTanBlock"),"math/asin":u("FlowGraphASinBlock"),"math/acos":u("FlowGraphACosBlock"),"math/atan":u("FlowGraphATanBlock"),"math/atan2":u("FlowGraphATan2Block",["a","b"]),"math/sinh":u("FlowGraphSinhBlock"),"math/cosh":u("FlowGraphCoshBlock"),"math/tanh":u("FlowGraphTanhBlock"),"math/asinh":u("FlowGraphASinhBlock"),"math/acosh":u("FlowGraphACoshBlock"),"math/atanh":u("FlowGraphATanhBlock"),"math/exp":u("FlowGraphExponentialBlock"),"math/log":u("FlowGraphLogBlock"),"math/log2":u("FlowGraphLog2Block"),"math/log10":u("FlowGraphLog10Block"),"math/sqrt":u("FlowGraphSquareRootBlock"),"math/cbrt":u("FlowGraphCubeRootBlock"),"math/pow":u("FlowGraphPowerBlock",["a","b"]),"math/length":u("FlowGraphLengthBlock"),"math/normalize":u("FlowGraphNormalizeBlock"),"math/dot":u("FlowGraphDotBlock",["a","b"]),"math/cross":u("FlowGraphCrossBlock",["a","b"]),"math/rotate2D":{blocks:["FlowGraphRotate2DBlock"],inputs:{values:{a:{name:"a"},angle:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/rotate3D":{blocks:["FlowGraphRotate3DBlock"],inputs:{values:{a:{name:"a"},rotation:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/transform":{blocks:["FlowGraphTransformVectorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}}},"math/combine2":{blocks:["FlowGraphCombineVector2Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine3":{blocks:["FlowGraphCombineVector3Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/combine4":{blocks:["FlowGraphCombineVector4Block"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/extract2":{blocks:["FlowGraphExtractVector2Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"}}}},"math/extract3":{blocks:["FlowGraphExtractVector3Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"}}}},"math/extract4":{blocks:["FlowGraphExtractVector4Block"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/transpose":u("FlowGraphTransposeBlock"),"math/determinant":u("FlowGraphDeterminantBlock"),"math/inverse":u("FlowGraphInvertMatrixBlock"),"math/matMul":u("FlowGraphMatrixMultiplicationBlock",["a","b"]),"math/matCompose":{blocks:["FlowGraphMatrixCompose"],inputs:{values:{translation:{name:"position",gltfType:"float3"},rotation:{name:"rotationQuaternion",gltfType:"float4"},scale:{name:"scaling",gltfType:"float3"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i=o[0].dataInputs.find((function(e){return"rotationQuaternion"===e.name}));if(!i)throw new Error("Rotation quaternion input not found");return a._connectionValues[i.uniqueId]&&(a._connectionValues[i.uniqueId].type="Quaternion"),o}},"math/matDecompose":{blocks:["FlowGraphMatrixDecompose"],inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{translation:{name:"position"},rotation:{name:"rotationQuaternion"},scale:{name:"scaling"}}}},"math/quatConjugate":u("FlowGraphConjugateBlock",["a"]),"math/quatMul":{blocks:["FlowGraphMultiplyBlock"],inputs:{values:{a:{name:"a",gltfType:"vector4"},b:{name:"b",gltfType:"vector4"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.type="Quaternion",o}},"math/quatAngleBetween":u("FlowGraphAngleBetweenBlock",["a","b"]),"math/quatFromAxisAngle":{blocks:["FlowGraphQuaternionFromAxisAngleBlock"],inputs:{values:{axis:{name:"a",gltfType:"float3"},angle:{name:"b",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}}},"math/quatToAxisAngle":u("FlowGraphAxisAngleFromQuaternionBlock",["a"]),"math/quatFromDirections":u("FlowGraphQuaternionFromDirectionsBlock",["a","b"]),"math/combine2x2":{blocks:["FlowGraphCombineMatrix2DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.inputIsColumnMajor=!0,o}},"math/extract2x2":{blocks:["FlowGraphExtractMatrix2DBlock"],inputs:{values:{a:{name:"input",gltfType:"float2x2"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"}}}},"math/combine3x3":{blocks:["FlowGraphCombineMatrix3DBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.inputIsColumnMajor=!0,o}},"math/extract3x3":{blocks:["FlowGraphExtractMatrix3DBlock"],inputs:{values:{a:{name:"input",gltfType:"float3x3"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"}}}},"math/combine4x4":{blocks:["FlowGraphCombineMatrixBlock"],inputs:{values:{a:{name:"input_0",gltfType:"number"},b:{name:"input_1",gltfType:"number"},c:{name:"input_2",gltfType:"number"},d:{name:"input_3",gltfType:"number"},e:{name:"input_4",gltfType:"number"},f:{name:"input_5",gltfType:"number"},g:{name:"input_6",gltfType:"number"},h:{name:"input_7",gltfType:"number"},i:{name:"input_8",gltfType:"number"},j:{name:"input_9",gltfType:"number"},k:{name:"input_10",gltfType:"number"},l:{name:"input_11",gltfType:"number"},m:{name:"input_12",gltfType:"number"},n:{name:"input_13",gltfType:"number"},o:{name:"input_14",gltfType:"number"},p:{name:"input_15",gltfType:"number"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o){var a;return(a=o[0]).config||(a.config={}),o[0].config.inputIsColumnMajor=!0,o}},"math/extract4x4":{blocks:["FlowGraphExtractMatrixBlock"],configuration:{},inputs:{values:{a:{name:"input",gltfType:"number"}}},outputs:{values:{0:{name:"output_0"},1:{name:"output_1"},2:{name:"output_2"},3:{name:"output_3"},4:{name:"output_4"},5:{name:"output_5"},6:{name:"output_6"},7:{name:"output_7"},8:{name:"output_8"},9:{name:"output_9"},10:{name:"output_10"},11:{name:"output_11"},12:{name:"output_12"},13:{name:"output_13"},14:{name:"output_14"},15:{name:"output_15"}}}},"math/not":{blocks:["FlowGraphBitwiseNotBlock"],inputs:{values:{a:{name:"a"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l;(l=o[0]).config||(l.config={});var u=o[0].dataInputs[0];return o[0].config.valueType=null!==(s=null===(i=a._connectionValues[u.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:"FlowGraphInteger",o}},"math/and":{blocks:["FlowGraphBitwiseAndBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l,u,c;(c=o[0]).config||(c.config={});var f=o[0].dataInputs[0],d=o[0].dataInputs[1];return o[0].config.valueType=null!==(u=null!==(s=null===(i=a._connectionValues[f.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:null===(l=a._connectionValues[d.uniqueId])||void 0===l?void 0:l.type)&&void 0!==u?u:"FlowGraphInteger",o}},"math/or":{blocks:["FlowGraphBitwiseOrBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l,u,c;(c=o[0]).config||(c.config={});var f=o[0].dataInputs[0],d=o[0].dataInputs[1];return o[0].config.valueType=null!==(u=null!==(s=null===(i=a._connectionValues[f.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:null===(l=a._connectionValues[d.uniqueId])||void 0===l?void 0:l.type)&&void 0!==u?u:"FlowGraphInteger",o}},"math/xor":{blocks:["FlowGraphBitwiseXorBlock"],inputs:{values:{a:{name:"a"},b:{name:"b"}}},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,n,r,o,a){var i,s,l,u,c;(c=o[0]).config||(c.config={});var f=o[0].dataInputs[0],d=o[0].dataInputs[1];return o[0].config.valueType=null!==(u=null!==(s=null===(i=a._connectionValues[f.uniqueId])||void 0===i?void 0:i.type)&&void 0!==s?s:null===(l=a._connectionValues[d.uniqueId])||void 0===l?void 0:l.type)&&void 0!==u?u:"FlowGraphInteger",o}},"math/asr":u("FlowGraphBitwiseRightShiftBlock",["a","b"]),"math/lsl":u("FlowGraphBitwiseLeftShiftBlock",["a","b"]),"math/clz":u("FlowGraphLeadingZerosBlock"),"math/ctz":u("FlowGraphTrailingZerosBlock"),"math/popcnt":u("FlowGraphOneBitsCounterBlock"),"math/rad":u("FlowGraphDegToRadBlock"),"math/deg":u("FlowGraphRadToDegBlock"),"type/boolToInt":u("FlowGraphBooleanToInt"),"type/boolToFloat":u("FlowGraphBooleanToFloat"),"type/intToBool":u("FlowGraphIntToBoolean"),"type/intToFloat":u("FlowGraphIntToFloat"),"type/floatToInt":u("FlowGraphFloatToInt"),"type/floatToBool":u("FlowGraphFloatToBoolean"),"flow/sequence":{blocks:["FlowGraphSequenceBlock"],extraProcessor:function(e,t,n,r,o){var a=o[0];return a.config||(a.config={}),a.config.outputSignalCount=Object.keys(e.flows||[]).length,a.signalOutputs.forEach((function(e,t){e.name="out_"+t})),o}},"flow/branch":{blocks:["FlowGraphBranchBlock"],outputs:{flows:{true:{name:"onTrue"},false:{name:"onFalse"}}}},"flow/switch":{blocks:["FlowGraphSwitchBlock"],configuration:{cases:{name:"cases",isArray:!0,inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"},default:{name:"default"}}},validation:function(e){var t,n=null===(t=e.configuration)||void 0===t?void 0:t.cases;if(n&&n.value){if(!n.value.every((function(e){return"number"==typeof e&&/^-?\d+$/.test(e.toString())})))return r.Logger.Warn("Switch cases should be integers. Using empty array instead."),n.value=[],{valid:!0};var o=new Set(n.value);n.value=Array.from(o)}return{valid:!0}},extraProcessor:function(e,t,n,r,o){if("flow/switch"!==t.op||!e.flows||0===Object.keys(e.flows).length)throw new Error("Switch should have a single configuration object, the cases array");return o[0].signalOutputs.forEach((function(e){"default"!==e.name&&(e.name="out_"+e.name)})),o}},"flow/while":{blocks:["FlowGraphWhileLoopBlock"],outputs:{flows:{loopBody:{name:"executionFlow"}}}},"flow/for":{blocks:["FlowGraphForLoopBlock"],configuration:{initialIndex:{name:"initialIndex",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{values:{startIndex:{name:"startIndex",gltfType:"number"},endIndex:{name:"endIndex",gltfType:"number"}}},outputs:{values:{index:{name:"index"}},flows:{loopBody:{name:"executionFlow"}}},extraProcessor:function(e,t,n,r,o){var a=o[0];return a.config||(a.config={}),a.config.incrementIndexWhenLoopDone=!0,o}},"flow/doN":{blocks:["FlowGraphDoNBlock"],configuration:{},inputs:{values:{n:{name:"maxExecutions",gltfType:"number"}}},outputs:{values:{currentCount:{name:"executionCount"}}}},"flow/multiGate":{blocks:["FlowGraphMultiGateBlock"],configuration:{isRandom:{name:"isRandom",gltfType:"boolean",inOptions:!0,defaultValue:!1},isLoop:{name:"isLoop",gltfType:"boolean",inOptions:!0,defaultValue:!1}},extraProcessor:function(e,t,n,r,o){if("flow/multiGate"!==t.op||!e.flows||0===Object.keys(e.flows).length)throw new Error("MultiGate should have a single configuration object, the number of output flows");var a=o[0];return a.config||(a.config={}),a.config.outputSignalCount=Object.keys(e.flows).length,a.signalOutputs.forEach((function(e,t){e.name="out_"+t})),o}},"flow/waitAll":{blocks:["FlowGraphWaitAllBlock"],configuration:{inputFlows:{name:"inputSignalCount",gltfType:"number",inOptions:!0,defaultValue:0}},inputs:{flows:{reset:{name:"reset"},"[segment]":{name:"in_$1"}}},validation:function(e){var t,n,r;return"number"!=typeof(null===(r=null===(n=null===(t=e.configuration)||void 0===t?void 0:t.inputFlows)||void 0===n?void 0:n.value)||void 0===r?void 0:r[0])&&(e.configuration=e.configuration||{inputFlows:{value:[0]}},e.configuration.inputFlows.value=[0]),{valid:!0}}},"flow/throttle":{blocks:["FlowGraphThrottleBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/setDelay":{blocks:["FlowGraphSetDelayBlock"],outputs:{flows:{err:{name:"error"}}}},"flow/cancelDelay":{blocks:["FlowGraphCancelDelayBlock"]},"variable/get":{blocks:["FlowGraphGetVariableBlock"],validation:function(e){var t,n;return(null===(n=null===(t=e.configuration)||void 0===t?void 0:t.variable)||void 0===n?void 0:n.value)?{valid:!0}:(r.Logger.Error("Variable get block should have a variable configuration"),{valid:!1,error:"Variable get block should have a variable configuration"})},configuration:{variable:{name:"variable",gltfType:"number",flowGraphType:"string",inOptions:!0,isVariable:!0,dataTransformer:function(e,t){return t.getVariableName(e)}}}},"variable/set":{blocks:["FlowGraphSetVariableBlock"],configuration:{variables:{name:"variables",gltfType:"number",flowGraphType:"string",inOptions:!0,isArray:!0,dataTransformer:function(e,t){return e.map((function(e){return t.getVariableName(e)}))}}},extraProcessor:function(e,t,n,r,o){return o[0].dataInputs.forEach((function(e){e.name=r.getVariableName(+e.name)})),o}},"variable/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphContextBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing","FlowGraphGetVariableBlock"],configuration:{variable:{name:"propertyName",inOptions:!0,isVariable:!0,dataTransformer:function(e,t){return t.getVariableName(e)}},useSlerp:{name:"animationType",inOptions:!0,defaultValue:!1,dataTransformer:function(e){return!0===e?"Quaternion":void 0}}},inputs:{values:{value:{name:"value_1"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"userVariables",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:4,isVariable:!0}],extraProcessor:function(e,t,n,o,a){var i,s,l,u,c,f,d=a[0],h=null===(s=null===(i=e.configuration)||void 0===i?void 0:i.variable.value)||void 0===s?void 0:s[0];if("number"!=typeof h)throw r.Logger.Error("Variable index is not defined for variable interpolation block"),new Error("Variable index is not defined for variable interpolation block");var p=o.arrays.staticVariables[h];void 0===(null===(u=null===(l=d.config)||void 0===l?void 0:l.animationType)||void 0===u?void 0:u.value)&&(d.config||(d.config={}),(c=d.config).animationType||(c.animationType={}),d.config.animationType.value=(0,r.getAnimationTypeByFlowGraphType)(p.type));var m=a[4];return m.config||(m.config={}),(f=m.config).variable||(f.variable={}),m.config.variable.value=o.getVariableName(h),a}},"pointer/get":{blocks:["FlowGraphGetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customGetFunction",output:"getFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:function(e,t,n,r,o){return o.forEach((function(e){"FlowGraphJsonPointerParserBlock"===e.className&&(e.config||(e.config={}),e.config.outputValue=!0)})),o}},"pointer/set":{blocks:["FlowGraphSetPropertyBlock","FlowGraphJsonPointerParserBlock"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customSetFunction",output:"setFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:function(e,t,n,r,o){return o.forEach((function(e){"FlowGraphJsonPointerParserBlock"===e.className&&(e.config||(e.config={}),e.config.outputValue=!0)})),o}},"pointer/interpolate":{blocks:["FlowGraphInterpolationBlock","FlowGraphJsonPointerParserBlock","FlowGraphPlayAnimationBlock","FlowGraphBezierCurveEasing"],configuration:{pointer:{name:"jsonPointer",toBlock:"FlowGraphJsonPointerParserBlock"}},inputs:{values:{value:{name:"value_1"},"[segment]":{name:"$1",toBlock:"FlowGraphJsonPointerParserBlock"},duration:{name:"duration_1",gltfType:"number"},p1:{name:"controlPoint1",toBlock:"FlowGraphBezierCurveEasing"},p2:{name:"controlPoint2",toBlock:"FlowGraphBezierCurveEasing"}},flows:{in:{name:"in",toBlock:"FlowGraphPlayAnimationBlock"}}},outputs:{flows:{err:{name:"error",toBlock:"FlowGraphPlayAnimationBlock"},out:{name:"out",toBlock:"FlowGraphPlayAnimationBlock"},done:{name:"done",toBlock:"FlowGraphPlayAnimationBlock"}}},interBlockConnectors:[{input:"object",output:"object",inputBlockIndex:2,outputBlockIndex:1,isVariable:!0},{input:"propertyName",output:"propertyName",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"customBuildAnimation",output:"generateAnimationsFunction",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"animation",output:"animation",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0},{input:"easingFunction",output:"easingFunction",inputBlockIndex:0,outputBlockIndex:3,isVariable:!0},{input:"value_0",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0}],extraProcessor:function(e,t,n,r,o){return o.forEach((function(t){"FlowGraphJsonPointerParserBlock"===t.className?(t.config||(t.config={}),t.config.outputValue=!0):"FlowGraphInterpolationBlock"===t.className&&(t.config||(t.config={}),Object.keys(e.values||[]).forEach((function(n){var o,a=null===(o=e.values)||void 0===o?void 0:o[n];if("value"===n&&a){var i=a.type;void 0!==i&&(t.config.animationType=r.arrays.types[i].flowGraphType)}})))})),o}},"animation/start":{blocks:["FlowGraphPlayAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},speed:{name:"speed",gltfType:"number"},startTime:{name:"from",gltfType:"number",dataTransformer:function(e,t){return[e[0]*t._animationTargetFps]}},endTime:{name:"to",gltfType:"number",dataTransformer:function(e,t){return[e[0]*t._animationTargetFps]}}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s=o[o.length-1];return s.config||(s.config={}),s.config.glTF=i,o}},"animation/stop":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s=o[o.length-1];return s.config||(s.config={}),s.config.glTF=i,o}},"animation/stopAt":{blocks:["FlowGraphStopAnimationBlock","FlowGraphArrayIndexBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{},inputs:{values:{animation:{name:"index",gltfType:"number",toBlock:"FlowGraphArrayIndexBlock"},stopTime:{name:"stopAtFrame",gltfType:"number",dataTransformer:function(e,t){return[e[0]*t._animationTargetFps]}}}},outputs:{flows:{err:{name:"error"}}},interBlockConnectors:[{input:"animationGroup",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"animationGroups",inputBlockIndex:1,outputBlockIndex:2,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s=o[o.length-1];return s.config||(s.config={}),s.config.glTF=i,o}},"math/switch":{blocks:["FlowGraphDataSwitchBlock"],configuration:{cases:{name:"cases",isArray:!0,inOptions:!0,defaultValue:[]}},inputs:{values:{selection:{name:"case"}}},validation:function(e){var t,n=null===(t=e.configuration)||void 0===t?void 0:t.cases;if(n&&n.value){if(!n.value.every((function(e){return"number"==typeof e&&/^-?\d+$/.test(e.toString())})))return r.Logger.Warn("Switch cases should be integers. Using empty array instead."),n.value=[],{valid:!0};var o=new Set(n.value);n.value=Array.from(o)}return{valid:!0}},extraProcessor:function(e,t,n,r,o){var a=o[0];return a.dataInputs.forEach((function(e){"default"!==e.name&&"case"!==e.name&&(e.name="in_"+e.name)})),a.config||(a.config={}),a.config.treatCasesAsIntegers=!0,o}},"debug/log":{blocks:["FlowGraphConsoleLogBlock"],configuration:{message:{name:"messageTemplate",inOptions:!0}}}};function u(e,t,n){return void 0===t&&(t=["a"]),{blocks:[e],inputs:{values:t.reduce((function(e,t){return e[t]={name:t},e}),{})},outputs:{values:{value:{name:"value"}}},extraProcessor:function(e,t,r,o,a){var i;if(n){(i=a[0]).config||(i.config={}),a[0].config.preventIntegerFloatArithmetic=!0;var s=-1;Object.keys(e.values||{}).find((function(t){var n;return void 0!==(null===(n=e.values)||void 0===n?void 0:n[t].type)&&(s=e.values[t].type,!0)})),-1!==s&&(a[0].config.type=o.arrays.types[s].flowGraphType)}return a},validation:function(e){return n?c(e):{valid:!0}}}}function c(e){if(e.values){var t=Object.keys(e.values).map((function(t){return e.values[t].type})).filter((function(e){return void 0!==e}));if(!t.every((function(e){return e===t[0]})))return{valid:!1,error:"All inputs must be of the same type"}}return{valid:!0}}function f(){return Object.keys(l)}},1274(e,t,n){n.r(t),n.d(t,{FlowGraphGLTFDataProvider:()=>a});var r=n(8322),o=n(5597),a=function(e){function t(t){var n,r,a=e.call(this)||this,i=t.glTF,s=(null===(n=i.animations)||void 0===n?void 0:n.map((function(e){return e._babylonAnimationGroup})))||[];a.animationGroups=a.registerDataOutput("animationGroups",o.RichTypeAny,s);var l=(null===(r=i.nodes)||void 0===r?void 0:r.map((function(e){return e._babylonTransformNode})))||[];return a.nodes=a.registerDataOutput("nodes",o.RichTypeAny,l),a}return(0,r.C6)(t,e),t.prototype.getClassName=function(){return"FlowGraphGLTFDataProvider"},t}(o.FlowGraphBlock)},9222(e,t,n){n.d(t,{W:()=>i,u:()=>a});var r=n(1943),o=n(5597),a={float:{length:1,flowGraphType:"number",elementType:"number"},bool:{length:1,flowGraphType:"boolean",elementType:"boolean"},float2:{length:2,flowGraphType:"Vector2",elementType:"number"},float3:{length:3,flowGraphType:"Vector3",elementType:"number"},float4:{length:4,flowGraphType:"Vector4",elementType:"number"},float4x4:{length:16,flowGraphType:"Matrix",elementType:"number"},float2x2:{length:4,flowGraphType:"Matrix2D",elementType:"number"},float3x3:{length:9,flowGraphType:"Matrix3D",elementType:"number"},int:{length:1,flowGraphType:"FlowGraphInteger",elementType:"number"}},i=function(){function e(e,t,n){void 0===n&&(n=60),this._interactivityGraph=e,this._gltf=t,this._animationTargetFps=n,this._types=[],this._mappings=[],this._staticVariables=[],this._events=[],this._internalEventsCounter=0,this._nodes=[],this._parseTypes(),this._parseDeclarations(),this._parseVariables(),this._parseEvents(),this._parseNodes()}return Object.defineProperty(e.prototype,"arrays",{get:function(){return{types:this._types,mappings:this._mappings,staticVariables:this._staticVariables,events:this._events,nodes:this._nodes}},enumerable:!1,configurable:!0}),e.prototype._parseTypes=function(){if(this._interactivityGraph.types)for(var e=0,t=this._interactivityGraph.types;e<t.length;e++){var n=t[e];this._types.push(a[n.signature])}},e.prototype._parseDeclarations=function(){if(this._interactivityGraph.declarations)for(var e=0,t=this._interactivityGraph.declarations;e<t.length;e++){var n=t[e],a=(0,r.KD)(n);if(!a)throw o.Logger.Error(["No mapping found for declaration",n]),new Error("Error parsing declarations");this._mappings.push({flowGraphMapping:a,fullOperationName:n.extension?n.op+":"+n.extension:n.op})}},e.prototype._parseVariables=function(){if(this._interactivityGraph.variables)for(var e=0,t=this._interactivityGraph.variables;e<t.length;e++){var n=t[e],r=this._parseVariable(n);this._staticVariables.push(r)}},e.prototype._parseVariable=function(e,t){var n=this._types[e.type];if(!n)throw o.Logger.Error(["No type found for variable",e]),new Error("Error parsing variables");if(e.value&&e.value.length!==n.length)throw o.Logger.Error(["Invalid value length for variable",e,n]),new Error("Error parsing variables");var r=e.value||[];if(!r.length)switch(n.flowGraphType){case"boolean":r.push(!1);break;case"FlowGraphInteger":r.push(0);break;case"number":r.push(NaN);break;case"Vector2":r.push(NaN,NaN);break;case"Vector3":r.push(NaN,NaN,NaN);break;case"Vector4":case"Matrix2D":case"Quaternion":r.fill(NaN,0,4);break;case"Matrix":r.fill(NaN,0,16);break;case"Matrix3D":r.fill(NaN,0,9)}return"number"===n.elementType&&"string"==typeof r[0]&&(r[0]=parseFloat(r[0])),{type:n.flowGraphType,value:t?t(r,this):r}},e.prototype._parseEvents=function(){var e=this;if(this._interactivityGraph.events)for(var t=function(t){var r={eventId:t.id||"internalEvent_"+n._internalEventsCounter++};t.values&&(r.eventData=Object.keys(t.values).map((function(n){var r,a=null===(r=t.values)||void 0===r?void 0:r[n];if(!a)throw o.Logger.Error(["No value found for event key",n]),new Error("Error parsing events");var i=e._types[a.type];if(!i)throw o.Logger.Error(["No type found for event value",a]),new Error("Error parsing events");var s=void 0!==a.value?e._parseVariable(a):void 0;return{id:n,type:i.flowGraphType,eventData:!0,value:s}}))),n._events.push(r)},n=this,r=0,a=this._interactivityGraph.events;r<a.length;r++)t(a[r])},e.prototype._parseNodes=function(){var e;if(this._interactivityGraph.nodes)for(var t=0,n=this._interactivityGraph.nodes;t<n.length;t++){var r=n[t];if("number"!=typeof r.declaration)throw o.Logger.Error(["No declaration found for node",r]),new Error("Error parsing nodes");var a=this._mappings[r.declaration];if(!a)throw o.Logger.Error(["No mapping found for node",r]),new Error("Error parsing nodes");if(a.flowGraphMapping.validation){var i=a.flowGraphMapping.validation(r,this._interactivityGraph,this._gltf);if(!i.valid)throw new Error("Error validating interactivity node ".concat(null===(e=this._interactivityGraph.declarations)||void 0===e?void 0:e[r.declaration].op," - ").concat(i.error))}for(var s=[],l=0,u=a.flowGraphMapping.blocks;l<u.length;l++){var c=u[l],f=this._getEmptyBlock(c,a.fullOperationName);this._parseNodeConfiguration(r,f,a.flowGraphMapping,c),s.push(f)}this._nodes.push({blocks:s,fullOperationName:a.fullOperationName})}},e.prototype._getEmptyBlock=function(e,t){return{uniqueId:(0,o.RandomGUID)(),className:e,dataInputs:[],dataOutputs:[],signalInputs:[],signalOutputs:[],config:{},type:t,metadata:{}}},e.prototype._parseNodeConfiguration=function(e,t,n,r){var a,i=e.configuration;if(i)for(var s in i){var l=i[s];if(!l)throw new Error("Error parsing node configuration");var u=null===(a=n.configuration)||void 0===a?void 0:a[s];if(u&&u.toBlock?u.toBlock===r:0===n.blocks.indexOf(r)){var c=null==u?void 0:u.defaultValue;(null==l?void 0:l.value)&&(c=l.value),(null==u?void 0:u.isArray)||(1!==c.length&&o.Logger.Warn("Invalid non-array value length: ".concat(c.length)),c=c[0]),(null==u?void 0:u.dataTransformer)&&(c=u.dataTransformer(c,this)),void 0!==c&&(t.config[(null==u?void 0:u.name)||s]={value:c})}}},e.prototype._parseNodeConnections=function(e){for(var t,n,a,i,s,l,u,c,f,d,h,p,m,_,g,b,y,v,T,x=0;x<this._nodes.length;x++){var A=null===(t=this._interactivityGraph.nodes)||void 0===t?void 0:t[x];if(!A)throw o.Logger.Error(["No node found for interactivity node",this._nodes[x]]),new Error("Error parsing node connections");var w=this._nodes[x],O=this._mappings[A.declaration];if(!O)throw o.Logger.Error(["No mapping found for node",A]),new Error("Error parsing node connections");for(var C=A.flows||{},M=Object.keys(C).sort(),E=function(e){var t=C[e],f=null===(a=null===(n=O.flowGraphMapping.outputs)||void 0===n?void 0:n.flows)||void 0===a?void 0:a[e],d=(null==f?void 0:f.name)||e,h=R._createNewSocketConnection(d,!0);(f&&f.toBlock&&w.blocks.find((function(e){return e.className===f.toBlock}))||w.blocks[0]).signalOutputs.push(h);var p=t.node,m=R._nodes[p];if(!m)throw o.Logger.Error(["No node found for input node id",p]),new Error("Error parsing node connections");var _=(0,r.X6)(m.fullOperationName);if(!_)throw o.Logger.Error(["No mapping found for input node",m]),new Error("Error parsing node connections");var g=null===(s=null===(i=_.inputs)||void 0===i?void 0:i.flows)||void 0===s?void 0:s[t.socket||"in"],b=!1;if(!g)for(var y in null===(l=_.inputs)||void 0===l?void 0:l.flows)y.startsWith("[")&&y.endsWith("]")&&(b=!0,g=null===(c=null===(u=_.inputs)||void 0===u?void 0:u.flows)||void 0===c?void 0:c[y]);var v=g?b?g.name.replace("$1",t.socket||""):g.name:t.socket||"in",T=g&&g.toBlock&&m.blocks.find((function(e){return e.className===g.toBlock}))||m.blocks[0],x=T.signalInputs.find((function(e){return e.name===v}));x||(x=R._createNewSocketConnection(v),T.signalInputs.push(x)),x.connectedPointIds.push(h.uniqueId),h.connectedPointIds.push(x.uniqueId)},R=this,L=0,F=M;L<F.length;L++)E(F[L]);for(var P=A.values||{},S=Object.keys(P),I=function(t){var n=P[t],a=null===(d=null===(f=O.flowGraphMapping.inputs)||void 0===f?void 0:f.values)||void 0===d?void 0:d[t],i=!1;if(!a)for(var s in null===(h=O.flowGraphMapping.inputs)||void 0===h?void 0:h.values)s.startsWith("[")&&s.endsWith("]")&&(i=!0,a=null===(m=null===(p=O.flowGraphMapping.inputs)||void 0===p?void 0:p.values)||void 0===m?void 0:m[s]);var l=a?i?a.name.replace("$1",t):a.name:t,u=N._createNewSocketConnection(l);if((a&&a.toBlock&&w.blocks.find((function(e){return e.className===a.toBlock}))||w.blocks[0]).dataInputs.push(u),void 0!==n.value){var c=N._parseVariable(n,a&&a.dataTransformer);e._connectionValues[u.uniqueId]=c}else{if(void 0===n.node)throw o.Logger.Error(["Invalid value for value connection",n]),new Error("Error parsing node connections");var T=n.node,x=n.socket||"value",A=N._nodes[T];if(!A)throw o.Logger.Error(["No node found for output socket reference",n]),new Error("Error parsing node connections");var C=(0,r.X6)(A.fullOperationName);if(!C)throw o.Logger.Error(["No mapping found for output socket reference",n]),new Error("Error parsing node connections");var M=null===(g=null===(_=C.outputs)||void 0===_?void 0:_.values)||void 0===g?void 0:g[x],E=!1;if(!M)for(var s in null===(b=C.outputs)||void 0===b?void 0:b.values)s.startsWith("[")&&s.endsWith("]")&&(E=!0,M=null===(v=null===(y=C.outputs)||void 0===y?void 0:y.values)||void 0===v?void 0:v[s]);var R=M?E?M.name.replace("$1",x):null==M?void 0:M.name:x,L=M&&M.toBlock&&A.blocks.find((function(e){return e.className===M.toBlock}))||A.blocks[0],F=L.dataOutputs.find((function(e){return e.name===R}));F||(F=N._createNewSocketConnection(R,!0),L.dataOutputs.push(F)),u.connectedPointIds.push(F.uniqueId),F.connectedPointIds.push(u.uniqueId)}},N=this,B=0,H=S;B<H.length;B++)I(H[B]);if(O.flowGraphMapping.interBlockConnectors)for(var k=0,G=O.flowGraphMapping.interBlockConnectors;k<G.length;k++){var V=G[k],D=V.input,K=V.output,U=V.isVariable;this._connectFlowGraphNodes(D,K,w.blocks[V.inputBlockIndex],w.blocks[V.outputBlockIndex],U)}if(O.flowGraphMapping.extraProcessor){var j=null===(T=this._interactivityGraph.declarations)||void 0===T?void 0:T[A.declaration];if(!j)throw o.Logger.Error(["No declaration found for extra processor",A]),new Error("Error parsing node connections");w.blocks=O.flowGraphMapping.extraProcessor(A,j,O.flowGraphMapping,this,w.blocks,e,this._gltf)}}},e.prototype._createNewSocketConnection=function(e,t){return{uniqueId:(0,o.RandomGUID)(),name:e,_connectionType:t?1:0,connectedPointIds:[]}},e.prototype._connectFlowGraphNodes=function(e,t,n,r,o){var a=o?n.dataInputs:n.signalInputs,i=o?r.dataOutputs:r.signalOutputs,s=a.find((function(t){return t.name===e}))||this._createNewSocketConnection(e),l=i.find((function(e){return e.name===t}))||this._createNewSocketConnection(t,!0);a.find((function(t){return t.name===e}))||a.push(s),i.find((function(e){return e.name===t}))||i.push(l),s.connectedPointIds.push(l.uniqueId),l.connectedPointIds.push(s.uniqueId)},e.prototype.getVariableName=function(e){return"staticVariable_"+e},e.prototype.serializeToFlowGraph=function(){var e={uniqueId:(0,o.RandomGUID)(),_userVariables:{},_connectionValues:{}};this._parseNodeConnections(e);for(var t=0;t<this._staticVariables.length;t++){var n=this._staticVariables[t];e._userVariables[this.getVariableName(t)]=n}return{rightHanded:!0,allBlocks:this._nodes.reduce((function(e,t){return e.concat(t.blocks)}),[]),executionContexts:[e]}},e}()},5890(e,t,n){n.r(t),n.d(t,{KHR_lights:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_lights_punctual",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,delete this._lights},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._lights=t.lights,a.ArrayItem.Assign(this._lights)}},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(s,l){return(0,r.sH)(i,void 0,void 0,(function(){var i=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._loader._allMaterialsDirtyRequired=!0,[4,this._loader.loadNodeAsync(e,t,(function(e){var t,r=a.ArrayItem.Get(s,i._lights,l.light),u=r.name||e.name;switch(i._loader.babylonScene._blockEntityCollection=!!i._loader._assetContainer,r.type){case"directional":var c=new o.DirectionalLight(u,o.Vector3.Backward(),i._loader.babylonScene);c.position.setAll(0),t=c;break;case"point":t=new o.PointLight(u,o.Vector3.Zero(),i._loader.babylonScene);break;case"spot":var f=new o.SpotLight(u,o.Vector3.Zero(),o.Vector3.Backward(),0,1,i._loader.babylonScene);f.angle=2*(r.spot&&r.spot.outerConeAngle||Math.PI/4),f.innerAngle=2*(r.spot&&r.spot.innerConeAngle||0),t=f;break;default:throw i._loader.babylonScene._blockEntityCollection=!1,new Error("".concat(s,": Invalid light type (").concat(r.type,")"))}t._parentContainer=i._loader._assetContainer,i._loader.babylonScene._blockEntityCollection=!1,r._babylonLight=t,t.falloffType=o.Light.FALLOFF_GLTF,t.diffuse=r.color?o.Color3.FromArray(r.color):o.Color3.White(),t.intensity=null==r.intensity?1:r.intensity,t.range=null==r.range?Number.MAX_VALUE:r.range,t.parent=e,i._loader._babylonLights.push(t),a.GLTFLoader.AddPointerMetadata(t,s),n(e)}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},699(e,t,n){n.r(t),n.d(t,{KHR_materials_anisotropy:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_anisotropy",s=function(){function e(e){this.name=i,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadAnisotropyPropertiesAsync(o,i,n)),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))}))},e.prototype._loadAnisotropyPropertiesAsync=function(e,t,n){return(0,r.sH)(this,void 0,void 0,(function(){var o,a,i,s,l,u,c,f;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return o=this._loader._getOrCreateMaterialAdapter(n),a=new Array,i=null!==(u=t.anisotropyStrength)&&void 0!==u?u:0,s=null!==(c=t.anisotropyRotation)&&void 0!==c?c:0,o.specularRoughnessAnisotropy=i,o.geometryTangentAngle=s,(l=null!==(f=t.extensions)&&void 0!==f?f:{}).EXT_materials_anisotropy_openpbr&&l.EXT_materials_anisotropy_openpbr.openPbrAnisotropyEnabled||o.configureGltfStyleAnisotropy(!0),t.anisotropyTexture&&(t.anisotropyTexture.nonColorData=!0,a.push(this._loader.loadTextureInfoAsync("".concat(e,"/anisotropyTexture"),t.anisotropyTexture,(function(e){e.name="".concat(n.name," (Anisotropy Intensity)"),o.geometryTangentTexture=e})))),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8469(e,t,n){n.r(t),n.d(t,{KHR_materials_clearcoat:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_clearcoat",s=function(){function e(e){this.name=i,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadClearCoatPropertiesAsync(o,i,n)),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))}))},e.prototype._loadClearCoatPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),o=new Array;return r.configureCoat(),r.coatWeight=void 0!==t.clearcoatFactor?t.clearcoatFactor:0,r.coatRoughness=void 0!==t.clearcoatRoughnessFactor?t.clearcoatRoughnessFactor:0,t.clearcoatTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatTexture"),t.clearcoatTexture,(function(e){e.name="".concat(n.name," (ClearCoat)"),r.coatWeightTexture=e}))),t.clearcoatRoughnessTexture&&(t.clearcoatRoughnessTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatRoughnessTexture"),t.clearcoatRoughnessTexture,(function(e){e.name="".concat(n.name," (ClearCoat Roughness)"),r.coatRoughnessTexture=e})))),t.clearcoatNormalTexture&&(t.clearcoatNormalTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/clearcoatNormalTexture"),t.clearcoatNormalTexture,(function(e){var o;e.name="".concat(n.name," (ClearCoat Normal)"),r.geometryCoatNormalTexture=e,null!=(null===(o=t.clearcoatNormalTexture)||void 0===o?void 0:o.scale)&&(r.geometryCoatNormalTextureScale=t.clearcoatNormalTexture.scale)}))),r.setNormalMapInversions(!n.getScene().useRightHandedSystem,n.getScene().useRightHandedSystem)),Promise.all(o).then((function(){}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},2924(e,t,n){n.r(t),n.d(t,{KHR_materials_coat:()=>l});var r=n(8322),o=n(8625),a=n(4015),i=n(5597),s="KHR_materials_coat",l=function(){function e(e){this.name=s,this.order=191,this.useOpenPBR=!1,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),t.extensions&&t.extensions.KHR_materials_openpbr&&(this.useOpenPBR=!0),a.push(this._loadCoatPropertiesAsync(o,i,n)),[4,Promise.all(a)];case 1:return r.sent(),[2]}}))}))}))},e.prototype._loadCoatPropertiesAsync=function(e,t,n){var r,o,a=this._loader._getOrCreateMaterialAdapter(n),s=new Array;a.configureCoat(),a.coatWeight=void 0!==t.coatFactor?t.coatFactor:0,a.coatRoughness=void 0!==t.coatRoughnessFactor?t.coatRoughnessFactor:0,t.coatTexture&&s.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatTexture"),t.coatTexture,(function(e){e.name="".concat(n.name," (Coat)"),a.coatWeightTexture=e}))),t.coatRoughnessTexture&&(t.coatRoughnessTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatRoughnessTexture"),t.coatRoughnessTexture,(function(e){e.name="".concat(n.name," (Coat Roughness)"),a.coatRoughnessTexture=e})))),t.coatNormalTexture&&(t.coatNormalTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatNormalTexture"),t.coatNormalTexture,(function(e){var r;e.name="".concat(n.name," (Coat Normal)"),a.geometryCoatNormalTexture=e,null!=(null===(r=t.coatNormalTexture)||void 0===r?void 0:r.scale)&&(a.geometryCoatNormalTextureScale=t.coatNormalTexture.scale)}))),a.setNormalMapInversions(!n.getScene().useRightHandedSystem,n.getScene().useRightHandedSystem)),a.coatDarkening=void 0!==t.coatDarkeningFactor?t.coatDarkeningFactor:1,a.coatIor=void 0!==t.coatIor?t.coatIor:1.5;var l=i.Color3.White();void 0!==t.coatColorFactor&&l.fromArray(t.coatColorFactor),a.coatColor=l,t.coatColorTexture&&s.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatColorTexture"),t.coatColorTexture,(function(e){e.name="".concat(n.name," (Coat Color)"),a.coatColorTexture=e})));var u=null!==(r=t.coatAnisotropyStrength)&&void 0!==r?r:0,c=null!==(o=t.coatAnisotropyRotation)&&void 0!==o?o:0;return a.coatRoughnessAnisotropy=u,a.geometryCoatTangentAngle=c,this.useOpenPBR||a.configureGltfStyleAnisotropy(!0),t.coatAnisotropyTexture&&(t.coatAnisotropyTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync("".concat(e,"/coatAnisotropyTexture"),t.coatAnisotropyTexture,(function(e){e.name="".concat(n.name," (Coat Anisotropy)"),a.geometryCoatTangentTexture=e})))),Promise.all(s).then((function(){}))},e}();(0,a.Hg)(s),(0,a.Ye)(s,!0,(function(e){return new l(e)}))},8856(e,t,n){n.r(t),n.d(t,{KHR_materials_diffuse_roughness:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_diffuse_roughness",s=function(){function e(e){this.name=i,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadDiffuseRoughnessPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadDiffuseRoughnessPropertiesAsync=function(e,t,n){var r,o=this._loader._getOrCreateMaterialAdapter(n),a=new Array;return o.baseDiffuseRoughness=null!==(r=t.diffuseRoughnessFactor)&&void 0!==r?r:0,t.diffuseRoughnessTexture&&a.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseRoughnessTexture"),t.diffuseRoughnessTexture,(function(e){e.name="".concat(n.name," (Diffuse Roughness)"),o.baseDiffuseRoughnessTexture=e}))),Promise.all(a).then((function(){}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},6528(e,t,n){n.r(t),n.d(t,{KHR_materials_diffuse_transmission:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_diffuse_transmission",l=function(){function e(e){this.name=s,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(s),this.enabled&&(e.parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadTranslucentPropertiesAsync(o,t,n,i)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadTranslucentPropertiesAsync=function(e,t,n,r){var o,i=this._loader._getOrCreateMaterialAdapter(n);i.configureSubsurface(),i.subsurfaceWeight=null!==(o=r.diffuseTransmissionFactor)&&void 0!==o?o:0,i.subsurfaceConstantTint=void 0!==r.diffuseTransmissionColorFactor?a.Color3.FromArray(r.diffuseTransmissionColorFactor):a.Color3.White();var s=new Array;return r.diffuseTransmissionTexture&&(r.diffuseTransmissionTexture.nonColorData=!0,s.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTransmissionTexture"),r.diffuseTransmissionTexture).then((function(e){e.name="".concat(n.name," (Diffuse Transmission)"),i.subsurfaceWeightTexture=e})))),r.diffuseTransmissionColorTexture&&s.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTransmissionColorTexture"),r.diffuseTransmissionColorTexture).then((function(e){e.name="".concat(n.name," (Diffuse Transmission Color)"),i.subsurfaceConstantTintTexture=e}))),Promise.all(s).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},9553(e,t,n){n.r(t),n.d(t,{KHR_materials_dispersion:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_dispersion",s=function(){function e(e){this.name=i,this.order=174,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadDispersionPropertiesAsync(o,t,n,i)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadDispersionPropertiesAsync=function(e,t,n,r){var o=this._loader._getOrCreateMaterialAdapter(n);return 0!=o.transmissionWeight&&r.dispersion?(o.transmissionDispersionAbbeNumber=20,o.transmissionDispersionScale=r.dispersion,Promise.resolve()):Promise.resolve()},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8842(e,t,n){n.r(t),n.d(t,{KHR_materials_emissive_strength:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_emissive_strength",s=function(){function e(e){this.name=i,this.order=170,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadMaterialPropertiesAsync(e,t,n)];case 1:return r.sent(),this._loadEmissiveProperties(o,i,n),[4,Promise.resolve()];case 2:return[2,r.sent()]}}))}))}))},e.prototype._loadEmissiveProperties=function(e,t,n){void 0!==t.emissiveStrength&&(this._loader._getOrCreateMaterialAdapter(n).emissionLuminance=t.emissiveStrength)},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},5478(e,t,n){n.r(t),n.d(t,{KHR_materials_fuzz:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_fuzz",l=function(){function e(e){this.name=s,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadFuzzPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadFuzzPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),o=new Array;return r.configureFuzz(),r.fuzzWeight=void 0!==t.fuzzFactor?t.fuzzFactor:0,r.fuzzColor=void 0!==t.fuzzColorFactor?a.Color3.FromArray(t.fuzzColorFactor):a.Color3.White(),r.fuzzRoughness=void 0!==t.fuzzRoughnessFactor?t.fuzzRoughnessFactor:.5,t.fuzzTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/fuzzTexture"),t.fuzzTexture,(function(e){e.name="".concat(n.name," (Fuzz)"),r.fuzzWeightTexture=e}))),t.fuzzColorTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/fuzzColorTexture"),t.fuzzColorTexture,(function(e){e.name="".concat(n.name," (Fuzz Color)"),r.fuzzColorTexture=e}))),t.fuzzRoughnessTexture&&(t.fuzzRoughnessTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/fuzzRoughnessTexture"),t.fuzzRoughnessTexture,(function(e){e.name="".concat(n.name," (Fuzz Roughness)"),r.fuzzRoughnessTexture=e})))),Promise.all(o).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5613(e,t,n){n.r(t),n.d(t,{KHR_materials_ior:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_ior",s=function(){function e(e){this.name=i,this.order=180,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadIorPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadIorPropertiesAsync=function(t,n,r){var o=this._loader._getOrCreateMaterialAdapter(r),a=void 0!==n.ior?n.ior:e._DEFAULT_IOR;return o.specularIor=a,Promise.resolve()},e._DEFAULT_IOR=1.5,e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},2843(e,t,n){n.r(t),n.d(t,{KHR_materials_iridescence:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_materials_iridescence",s=function(){function e(e){this.name=i,this.order=195,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadIridescencePropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadIridescencePropertiesAsync=function(e,t,n){var r,o,a,i,s,l=this._loader._getOrCreateMaterialAdapter(n),u=new Array;return l.thinFilmWeight=null!==(r=t.iridescenceFactor)&&void 0!==r?r:0,l.thinFilmIor=null!==(a=null!==(o=t.iridescenceIor)&&void 0!==o?o:t.iridescenceIOR)&&void 0!==a?a:1.3,l.thinFilmThicknessMinimum=null!==(i=t.iridescenceThicknessMinimum)&&void 0!==i?i:100,l.thinFilmThicknessMaximum=null!==(s=t.iridescenceThicknessMaximum)&&void 0!==s?s:400,t.iridescenceTexture&&u.push(this._loader.loadTextureInfoAsync("".concat(e,"/iridescenceTexture"),t.iridescenceTexture,(function(e){e.name="".concat(n.name," (Iridescence)"),l.thinFilmWeightTexture=e}))),t.iridescenceThicknessTexture&&u.push(this._loader.loadTextureInfoAsync("".concat(e,"/iridescenceThicknessTexture"),t.iridescenceThicknessTexture,(function(e){e.name="".concat(n.name," (Iridescence Thickness)"),l.thinFilmThicknessTexture=e}))),Promise.all(u).then((function(){}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},2916(e,t,n){n.r(t),n.d(t,{KHR_materials_pbrSpecularGlossiness:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_pbrSpecularGlossiness",l=function(){function e(e){this.name=s,this.order=200,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,i){return(0,r.sH)(o,void 0,void 0,(function(){var o;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(o=new Array).push(this._loader.loadMaterialBasePropertiesAsync(e,t,n)),o.push(this._loadSpecularGlossinessPropertiesAsync(a,i,n)),this._loader.loadMaterialAlphaProperties(e,t,n),[4,Promise.all(o).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadSpecularGlossinessPropertiesAsync=function(e,t,n){if(!(n instanceof o.PBRMaterial))throw new Error("".concat(e,": Material type not supported"));var r=new Array;return n.metallic=null,n.roughness=null,t.diffuseFactor?(n.albedoColor=o.Color3.FromArray(t.diffuseFactor),n.alpha=t.diffuseFactor[3]):n.albedoColor=o.Color3.White(),n.reflectivityColor=t.specularFactor?o.Color3.FromArray(t.specularFactor):o.Color3.White(),n.microSurface=null==t.glossinessFactor?1:t.glossinessFactor,t.diffuseTexture&&r.push(this._loader.loadTextureInfoAsync("".concat(e,"/diffuseTexture"),t.diffuseTexture,(function(e){e.name="".concat(n.name," (Diffuse)"),n.albedoTexture=e}))),t.specularGlossinessTexture&&(r.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularGlossinessTexture"),t.specularGlossinessTexture,(function(e){e.name="".concat(n.name," (Specular Glossiness)"),n.reflectivityTexture=e,n.reflectivityTexture.hasAlpha=!0}))),n.useMicroSurfaceFromReflectivityMapAlpha=!0),Promise.all(r).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3274(e,t,n){n.r(t),n.d(t,{KHR_materials_sheen:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_sheen",l=function(){function e(e){this.name=s,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadSheenPropertiesAsync(o,i,n)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadSheenPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),o=new Array;r.configureFuzz();var i=void 0!==t.sheenColorFactor?a.Color3.FromArray(t.sheenColorFactor):a.Color3.Black(),s=void 0!==t.sheenRoughnessFactor?t.sheenRoughnessFactor:0;return r.fuzzWeight=1,r.fuzzColor=i,r.fuzzRoughness=s,t.sheenColorTexture&&o.push(this._loader.loadTextureInfoAsync("".concat(e,"/sheenColorTexture"),t.sheenColorTexture,(function(e){e.name="".concat(n.name," (Sheen Color)"),r.fuzzColorTexture=e}))),t.sheenRoughnessTexture&&(t.sheenRoughnessTexture.nonColorData=!0,o.push(this._loader.loadTextureInfoAsync("".concat(e,"/sheenRoughnessTexture"),t.sheenRoughnessTexture,(function(e){e.name="".concat(n.name," (Sheen Roughness)"),r.fuzzRoughnessTexture=e})))),Promise.all(o).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5418(e,t,n){n.r(t),n.d(t,{KHR_materials_specular:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_specular",l=function(){function e(e){this.name=s,this.order=190,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a,s;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadSpecularPropertiesAsync(o,i,n)),s=this._loader._getOrCreateMaterialAdapter(n),i.extensions&&i.extensions.EXT_materials_specular_edge_color&&i.extensions.EXT_materials_specular_edge_color.specularEdgeColorEnabled&&s.enableSpecularEdgeColor(!0),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadSpecularPropertiesAsync=function(e,t,n){var r,o=this._loader._getOrCreateMaterialAdapter(n),i=new Array;return o.specularWeight=null!==(r=t.specularFactor)&&void 0!==r?r:1,o.specularColor=void 0!==t.specularColorFactor?a.Color3.FromArray(t.specularColorFactor):new a.Color3(1,1,1),t.specularTexture&&(t.specularTexture.nonColorData=!0,i.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularTexture"),t.specularTexture,(function(e){e.name="".concat(n.name," (Specular)"),o.specularWeightTexture=e})))),t.specularColorTexture&&i.push(this._loader.loadTextureInfoAsync("".concat(e,"/specularColorTexture"),t.specularColorTexture,(function(e){e.name="".concat(n.name," (Specular Color)"),o.specularColorTexture=e}))),Promise.all(i).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},4943(e,t,n){n.r(t),n.d(t,{KHR_materials_transmission:()=>u});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s=function(){function e(t,n,o){var i=this;this._opaqueRenderTarget=null,this._opaqueMeshesCache=[],this._transparentMeshesCache=[],this._materialObservers={},this._options=(0,r.Cl)((0,r.Cl)({},e._GetDefaultOptions()),t),this._scene=n,this._scene._transmissionHelper=this,this._loader=o,this.onErrorObservable=new a.Observable,this._scene.onDisposeObservable.addOnce((function(){i.dispose()})),this._parseScene(),this._setupRenderTargets()}return e._GetDefaultOptions=function(){return{renderSize:1024,samples:4,lodGenerationScale:1,lodGenerationOffset:-4,renderTargetTextureType:a.Constants.TEXTURETYPE_HALF_FLOAT,generateMipmaps:!0}},e.prototype.updateOptions=function(e){var t=this,n=Object.keys(e).filter((function(n){return t._options[n]!==e[n]}));if(n.length){var o=(0,r.Cl)((0,r.Cl)({},this._options),e),a=this._options;this._options=o,o.renderSize===a.renderSize&&o.renderTargetTextureType===a.renderTargetTextureType&&o.generateMipmaps===a.generateMipmaps&&this._opaqueRenderTarget?(this._opaqueRenderTarget.samples=o.samples,this._opaqueRenderTarget.lodGenerationScale=o.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=o.lodGenerationOffset):this._setupRenderTargets()}},e.prototype.getOpaqueTarget=function(){return this._opaqueRenderTarget},e.prototype._addMesh=function(e){var t=this;this._materialObservers[e.uniqueId]=e.onMaterialChangedObservable.add(this._onMeshMaterialChanged.bind(this)),a.Tools.SetImmediate((function(){if(e.material){if(!t._loader.isMatchingMaterialType(e.material))return;var n=t._loader._getOrCreateMaterialAdapter(e.material);n.transmissionWeight>0?(n.refractionBackgroundTexture=t._opaqueRenderTarget,-1===t._transparentMeshesCache.indexOf(e)&&t._transparentMeshesCache.push(e)):-1===t._opaqueMeshesCache.indexOf(e)&&t._opaqueMeshesCache.push(e)}}))},e.prototype._removeMesh=function(e){e.onMaterialChangedObservable.remove(this._materialObservers[e.uniqueId]),delete this._materialObservers[e.uniqueId];var t=this._transparentMeshesCache.indexOf(e);-1!==t&&this._transparentMeshesCache.splice(t,1),-1!==(t=this._opaqueMeshesCache.indexOf(e))&&this._opaqueMeshesCache.splice(t,1)},e.prototype._parseScene=function(){this._scene.meshes.forEach(this._addMesh.bind(this)),this._scene.onNewMeshAddedObservable.add(this._addMesh.bind(this)),this._scene.onMeshRemovedObservable.add(this._removeMesh.bind(this))},e.prototype._onMeshMaterialChanged=function(e){var t=this._transparentMeshesCache.indexOf(e),n=this._opaqueMeshesCache.indexOf(e);if(this._loader.isMatchingMaterialType(e.material)){var r=e.material?this._loader._getOrCreateMaterialAdapter(e.material):null;r&&r.transmissionWeight>0?(r&&(r.refractionBackgroundTexture=this._opaqueRenderTarget),-1!==n?(this._opaqueMeshesCache.splice(n,1),this._transparentMeshesCache.push(e)):-1===t&&this._transparentMeshesCache.push(e)):-1!==t?(this._transparentMeshesCache.splice(t,1),this._opaqueMeshesCache.push(e)):-1===n&&this._opaqueMeshesCache.push(e)}},e.prototype._isRenderTargetValid=function(){var e;return null!==(null===(e=this._opaqueRenderTarget)||void 0===e?void 0:e.getInternalTexture())},e.prototype._setupRenderTargets=function(){var e,t,n,r=this;this._opaqueRenderTarget&&this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=new a.RenderTargetTexture("opaqueSceneTexture",this._options.renderSize,this._scene,this._options.generateMipmaps,void 0,this._options.renderTargetTextureType),this._opaqueRenderTarget.ignoreCameraViewport=!0,this._opaqueRenderTarget.renderList=this._opaqueMeshesCache,this._opaqueRenderTarget.clearColor=null!==(t=null===(e=this._options.clearColor)||void 0===e?void 0:e.clone())&&void 0!==t?t:this._scene.clearColor.clone(),this._opaqueRenderTarget.gammaSpace=!1,this._opaqueRenderTarget.lodGenerationScale=this._options.lodGenerationScale,this._opaqueRenderTarget.lodGenerationOffset=this._options.lodGenerationOffset,this._opaqueRenderTarget.samples=this._options.samples,this._opaqueRenderTarget.renderSprites=!0,this._opaqueRenderTarget.renderParticles=!0,this._opaqueRenderTarget.disableImageProcessing=!0,this._opaqueRenderTarget.onBeforeBindObservable.add((function(e){n=r._scene.environmentIntensity,r._scene.environmentIntensity=1,r._options.clearColor?e.clearColor.copyFrom(r._options.clearColor):r._scene.clearColor.toLinearSpaceToRef(e.clearColor,r._scene.getEngine().useExactSrgbConversions)})),this._opaqueRenderTarget.onAfterUnbindObservable.add((function(){r._scene.environmentIntensity=n}));for(var o=0,i=this._transparentMeshesCache;o<i.length;o++){var s=i[o];if(s.material){if(!this._loader.isMatchingMaterialType(s.material))return;var l=this._loader._getOrCreateMaterialAdapter(s.material);l.transmissionWeight>0&&(l.refractionBackgroundTexture=this._opaqueRenderTarget)}}},e.prototype.dispose=function(){this._scene._transmissionHelper=void 0,this._opaqueRenderTarget&&(this._opaqueRenderTarget.dispose(),this._opaqueRenderTarget=null),this._transparentMeshesCache=[],this._opaqueMeshesCache=[]},e}(),l="KHR_materials_transmission",u=function(){function e(e){this.name=l,this.order=175,this._loader=e,this.enabled=this._loader.isExtensionUsed(l),this.enabled&&(e.parent.transparencyAsCoverage=!0)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(a=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),a.push(this._loadTransparentPropertiesAsync(o,t,n,i)),[4,Promise.all(a).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadTransparentPropertiesAsync=function(e,t,n,r){var o,a,i=this._loader._getOrCreateMaterialAdapter(n),l=void 0!==r.transmissionFactor?r.transmissionFactor:0;if(0===l||!i)return Promise.resolve();if(i.configureTransmission(),i.transmissionWeight=l,l>0&&!this._loader.parent.dontUseTransmissionHelper){var u=n.getScene();u._transmissionHelper?(null===(o=u._transmissionHelper)||void 0===o?void 0:o._isRenderTargetValid())||null===(a=u._transmissionHelper)||void 0===a||a._setupRenderTargets():new s({},n.getScene(),this._loader)}var c=Promise.resolve(null);return r.transmissionTexture&&(r.transmissionTexture.nonColorData=!0,c=this._loader.loadTextureInfoAsync("".concat(e,"/transmissionTexture"),r.transmissionTexture,(function(e){e.name="".concat(n.name," (Transmission)"),i.transmissionWeightTexture=e}))),c.then((function(){}))},e}();(0,i.Hg)(l),(0,i.Ye)(l,!0,(function(e){return new u(e)}))},4239(e,t,n){n.r(t),n.d(t,{KHR_materials_unlit:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_unlit",l=function(){function e(e){this.name=s,this.order=210,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(){return(0,r.sH)(o,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loadUnlitPropertiesAsync(e,t,n)];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadUnlitPropertiesAsync=function(e,t,n){var r=this._loader._getOrCreateMaterialAdapter(n),a=new Array,i=t.pbrMetallicRoughness;return i&&(i.baseColorFactor&&(r.baseColor=o.Color3.FromArray(i.baseColorFactor),r.geometryOpacity=i.baseColorFactor[3]),i.baseColorTexture&&a.push(this._loader.loadTextureInfoAsync("".concat(e,"/baseColorTexture"),i.baseColorTexture,(function(e){e.name="".concat(n.name," (Base Color)"),r.baseColorTexture=e})))),r.isUnlit=!0,t.doubleSided&&(r.backFaceCulling=!1,r.twoSidedLighting=!0),this._loader.loadMaterialAlphaProperties(e,t,n),Promise.all(a).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},9437(e,t,n){n.r(t),n.d(t,{KHR_materials_variants:()=>l});var r=n(8322),o=n(8625),a=n(5597),i=n(4015),s="KHR_materials_variants",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)&&!this._loader.parent.skipMaterials}return e.prototype.dispose=function(){this._loader=null},e.GetAvailableVariants=function(e){var t=this._GetExtensionMetadata(e);return t?Object.keys(t.variants):[]},e.prototype.getAvailableVariants=function(t){return e.GetAvailableVariants(t)},e.SelectVariant=function(e,t){var n=this._GetExtensionMetadata(e);if(!n)throw new Error("Cannot select variant on a glTF mesh that does not have the ".concat(s," extension"));var r=function(e){var t=n.variants[e];if(t)for(var r=0,o=t;r<o.length;r++){var a=o[r];a.mesh.material=a.material}};if(t instanceof Array)for(var o=0,a=t;o<a.length;o++)r(a[o]);else r(t);n.lastSelected=t},e.prototype.selectVariant=function(t,n){e.SelectVariant(t,n)},e.Reset=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot reset on a glTF mesh that does not have the ".concat(s," extension"));for(var n=0,r=t.original;n<r.length;n++){var o=r[n];o.mesh.material=o.material}t.lastSelected=null},e.prototype.reset=function(t){e.Reset(t)},e.GetLastSelectedVariant=function(e){var t=this._GetExtensionMetadata(e);if(!t)throw new Error("Cannot get the last selected variant on a glTF mesh that does not have the ".concat(s," extension"));return t.lastSelected},e.prototype.getLastSelectedVariant=function(t){return e.GetLastSelectedVariant(t)},e._GetExtensionMetadata=function(e){var t,n;return(null===(n=null===(t=null==e?void 0:e._internalMetadata)||void 0===t?void 0:t.gltf)||void 0===n?void 0:n[s])||null},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._variants=t.variants}},e.prototype.onReady=function(){var t,n=this._loader.rootBabylonMesh;if(n){var r=this._loader.parent.extensionOptions[s];(null==r?void 0:r.defaultVariant)&&e.SelectVariant(n,r.defaultVariant),null===(t=null==r?void 0:r.onLoaded)||void 0===t||t.call(r,{get variants(){return e.GetAvailableVariants(n)},get selectedVariant(){var t=e.GetLastSelectedVariant(n);return t?Array.isArray(t)?t[0]:t:e.GetAvailableVariants(n)[0]},set selectedVariant(t){e.SelectVariant(n,t)}})}},e.prototype._loadMeshPrimitiveAsync=function(t,n,i,l,u,c){var f=this;return o.GLTFLoader.LoadExtensionAsync(t,u,this.name,(function(d,h){return(0,r.sH)(f,void 0,void 0,(function(){var f,p=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(f=new Array).push(this._loader._loadMeshPrimitiveAsync(t,n,i,l,u,(function(n){if(c(n),n instanceof a.Mesh){var r=o.GLTFLoader._GetDrawMode(t,u.mode),i=p._loader.rootBabylonMesh,l=i?i._internalMetadata=i._internalMetadata||{}:{},m=l.gltf=l.gltf||{},_=m[s]=m[s]||{lastSelected:null,original:[],variants:{}};_.original.push({mesh:n,material:n.material});for(var g=function(t){var a=h.mappings[t],l=o.ArrayItem.Get("".concat(d,"/mappings/").concat(t,"/material"),p._loader.gltf.materials,a.material);f.push(p._loader._loadMaterialAsync("#/materials/".concat(a.material),l,n,r,(function(t){for(var r=function(r){var l=a.variants[r],u=o.ArrayItem.Get("/extensions/".concat(s,"/variants/").concat(l),p._variants,l);_.variants[u.name]=_.variants[u.name]||[],_.variants[u.name].push({mesh:n,material:t}),n.onClonedObservable.add((function(t){var r,o=t,a=o;do{if(!(a=a.parent))return;r=e._GetExtensionMetadata(a)}while(null===r);if(i&&r===e._GetExtensionMetadata(i)){for(var l in a._internalMetadata={},i._internalMetadata)a._internalMetadata[l]=i._internalMetadata[l];for(var l in a._internalMetadata.gltf=[],i._internalMetadata.gltf)a._internalMetadata.gltf[l]=i._internalMetadata.gltf[l];a._internalMetadata.gltf[s]={lastSelected:null,original:[],variants:{}};for(var c=0,f=r.original;c<f.length;c++){var d=f[c];a._internalMetadata.gltf[s].original.push({mesh:d.mesh,material:d.material})}for(var l in r.variants)if(Object.prototype.hasOwnProperty.call(r.variants,l)){a._internalMetadata.gltf[s].variants[l]=[];for(var h=0,p=r.variants[l];h<p.length;h++){var m=p[h];a._internalMetadata.gltf[s].variants[l].push({mesh:m.mesh,material:m.material})}}r=a._internalMetadata.gltf[s]}for(var _=0,g=r.original;_<g.length;_++)(v=g[_]).mesh===n&&(v.mesh=o);for(var b=0,y=r.variants[u.name];b<y.length;b++){var v;(v=y[b]).mesh===n&&(v.mesh=o)}}))},l=0;l<a.variants.length;++l)r(l)})))},b=0;b<h.mappings.length;++b)g(b)}}))),[4,Promise.all(f).then((function(e){return e[0]}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},1369(e,t,n){n.r(t),n.d(t,{KHR_materials_volume:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_volume",l=function(){function e(e){this.name=s,this.order=173,this._loader=e,this.enabled=this._loader.isExtensionUsed(s),this.enabled&&this._loader._disableInstancedMesh++}return e.prototype.dispose=function(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,i){return(0,r.sH)(o,void 0,void 0,(function(){var o;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(o=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),o.push(this._loadVolumePropertiesAsync(a,t,n,i)),[4,Promise.all(o).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadVolumePropertiesAsync=function(e,t,n,r){var a,i=this._loader._getOrCreateMaterialAdapter(n);if(0===i.transmissionWeight&&0===i.subsurfaceWeight||!r.thicknessFactor)return Promise.resolve();var s=void 0!==r.attenuationDistance?r.attenuationDistance:Number.MAX_VALUE,l=void 0!==r.attenuationColor&&3==r.attenuationColor.length?o.Color3.FromArray(r.attenuationColor):o.Color3.White(),u=new o.Vector3(-Math.log(l.r),-Math.log(l.g),-Math.log(l.b));u.scaleInPlace(1/Math.max(s,.001)),i.extinctionCoefficient=u,i.transmissionDepth=s,i.transmissionColor=l,i.volumeThickness=null!==(a=r.thicknessFactor)&&void 0!==a?a:0;var c=new Array;return r.thicknessTexture&&(r.thicknessTexture.nonColorData=!0,c.push(this._loader.loadTextureInfoAsync("".concat(e,"/thicknessTexture"),r.thicknessTexture,(function(e){e.name="".concat(n.name," (Thickness)"),i.volumeThicknessTexture=e})))),Promise.all(c).then((function(){}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},3320(e,t,n){n.r(t),n.d(t,{KHR_materials_volume_scatter:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_materials_volume_scatter",l=function(){function e(e){this.name=s,this.order=172,this._loader=e,this.enabled=this._loader.isExtensionUsed(s),this.enabled&&this._loader._disableInstancedMesh++}return e.prototype.dispose=function(){this.enabled&&this._loader._disableInstancedMesh--,this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var o=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,i){return(0,r.sH)(o,void 0,void 0,(function(){var o;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return(o=new Array).push(this._loader.loadMaterialPropertiesAsync(e,t,n)),o.push(this._loadVolumePropertiesAsync(a,t,n,i)),[4,Promise.all(o).then((function(){}))];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadVolumePropertiesAsync=function(e,t,n,r){var a=this._loader._getOrCreateMaterialAdapter(n);if(0===a.transmissionWeight&&0===a.subsurfaceWeight)return Promise.resolve();var i=void 0!==r.multiscatterColor&&3==r.multiscatterColor.length?o.Color3.FromArray(r.multiscatterColor):o.Color3.Black(),s=void 0!==r.scatterAnisotropy?r.scatterAnisotropy:0;if(a.transmissionWeight>0){var l=function(e){var t=new o.Vector3(e.r,e.g,e.b),n=new o.Vector3(4.09712,4.09712,4.09712);n.multiplyInPlace(t),n.addInPlace(new o.Vector3(4.20863,4.20863,4.20863));var r=new o.Vector3(9.59217,9.59217,9.59217);return r.addInPlace(new o.Vector3(41.6808,41.6808,41.6808).multiplyInPlace(t)),r.addInPlace(new o.Vector3(17.7126,17.7126,17.7126).multiplyInPlace(t.multiply(t))),n.subtractInPlace(new o.Vector3(Math.sqrt(r.x),Math.sqrt(r.y),Math.sqrt(r.z))),new o.Vector3(1,1,1).subtract(n.multiply(n))}(i),u=new o.Vector3(-Math.log(a.transmissionColor.r),-Math.log(a.transmissionColor.g),-Math.log(a.transmissionColor.b));u.scaleInPlace(1/Math.max(a.transmissionDepth,.001));var c=u.multiply(l);c.scaleInPlace(a.transmissionDepth),a.transmissionScatter.set(c.x,c.y,c.z);var f=Promise.resolve(null);return r.multiscatterColorTexture&&(r.multiscatterColorTexture.nonColorData=!0,f=this._loader.loadTextureInfoAsync("".concat(e,"/multiscatterColorTexture"),r.multiscatterColorTexture,(function(e){e.name="".concat(n.name," (Transmission)"),a.transmissionWeightTexture=e}))),a.transmissionScatterAnisotropy=s,f.then((function(){}))}if(a.subsurfaceWeight>0){a.subsurfaceScatterAnisotropy=s,a.subsurfaceColor=i;var d=new o.Vector3(0!==a.extinctionCoefficient.x?1/a.extinctionCoefficient.x:1,0!==a.extinctionCoefficient.y?1/a.extinctionCoefficient.y:1,0!==a.extinctionCoefficient.z?1/a.extinctionCoefficient.z:1);a.subsurfaceRadius=Math.max(d.x,d.y,d.z),a.subsurfaceRadiusScale=new o.Color3(d.x/a.subsurfaceRadius,d.y/a.subsurfaceRadius,d.z/a.subsurfaceRadius)}return Promise.resolve()},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},789(e,t,n){n.r(t),n.d(t,{KHR_mesh_quantization:()=>a});var r=n(4015),o="KHR_mesh_quantization",a=function(){function e(e){this.name=o,this.enabled=e.isExtensionUsed(o)}return e.prototype.dispose=function(){},e}();(0,r.Hg)(o),(0,r.Ye)(o,!0,(function(e){return new a(e)}))},8875(e,t,n){n.r(t),n.d(t,{KHR_node_hoverability:()=>c});var r=n(8322),o=n(4015),a=n(1943),i=n(8698),s="KHR_node_hoverability",l="targetMeshPointerOver_";(0,a.rO)("event/onHoverIn",s,{blocks:["FlowGraphPointerOverEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:function(e){return l+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshUnderPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s,u,c,f,d,h,p,m=o[o.length-1];m.config=m.config||{},m.config.glTF=i;var _=null===(c=null===(u=null===(s=e.configuration)||void 0===s?void 0:s.nodeIndex)||void 0===u?void 0:u.value)||void 0===c?void 0:c[0];if(void 0===_||"number"!=typeof _)throw new Error("nodeIndex not found in configuration");var g=l+_;return o[1].config.variable=g,a._userVariables[g]={className:"Mesh",id:null===(d=null===(f=null==i?void 0:i.nodes)||void 0===f?void 0:f[_]._babylonTransformNode)||void 0===d?void 0:d.id,uniqueId:null===(p=null===(h=null==i?void 0:i.nodes)||void 0===h?void 0:h[_]._babylonTransformNode)||void 0===p?void 0:p.uniqueId},o}});var u="targetMeshPointerOut_";(0,a.rO)("event/onHoverOut",s,{blocks:["FlowGraphPointerOutEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:function(e){return u+e}}},outputs:{values:{hoverNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"targetMesh",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"meshOutOfPointer",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s,l,c,f,d,h,p,m=o[o.length-1];m.config=m.config||{},m.config.glTF=i;var _=null===(c=null===(l=null===(s=e.configuration)||void 0===s?void 0:s.nodeIndex)||void 0===l?void 0:l.value)||void 0===c?void 0:c[0];if(void 0===_||"number"!=typeof _)throw new Error("nodeIndex not found in configuration");var g=u+_;return o[1].config.variable=g,a._userVariables[g]={className:"Mesh",id:null===(d=null===(f=null==i?void 0:i.nodes)||void 0===f?void 0:f[_]._babylonTransformNode)||void 0===d?void 0:d.id,uniqueId:null===(p=null===(h=null==i?void 0:i.nodes)||void 0===h?void 0:h[_]._babylonTransformNode)||void 0===p?void 0:p.uniqueId},o}}),(0,i.oR)("/nodes/{}/extensions/KHR_node_hoverability/hoverable",{get:function(e){var t=e._babylonTransformNode;return!t||void 0===t.pointerOverDisableMeshTesting||t.pointerOverDisableMeshTesting},set:function(e,t){var n;null===(n=t._primitiveBabylonMeshes)||void 0===n||n.forEach((function(t){t.pointerOverDisableMeshTesting=!e}))},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"pointerOverDisableMeshTesting"}],type:"boolean"});var c=function(){function e(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}return e.prototype.onReady=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){return null===(e=this._loader.gltf.nodes)||void 0===e||e.forEach((function(e){var t,n,r;(null===(t=e.extensions)||void 0===t?void 0:t.KHR_node_hoverability)&&!1===(null===(n=e.extensions)||void 0===n?void 0:n.KHR_node_hoverability.hoverable)&&(null===(r=e._babylonTransformNode)||void 0===r||r.getChildMeshes().forEach((function(e){e.pointerOverDisableMeshTesting=!0})))})),[2]}))}))},e.prototype.dispose=function(){this._loader=null},e}();(0,o.Hg)(s),(0,o.Ye)(s,!0,(function(e){return new c(e)}))},6465(e,t,n){n.r(t),n.d(t,{KHR_node_selectability:()=>l});var r=n(8322),o=n(4015),a=n(1943),i=n(8698),s="KHR_node_selectability";(0,a.rO)("event/onSelect",s,{blocks:["FlowGraphMeshPickEventBlock","FlowGraphGetVariableBlock","FlowGraphIndexOfBlock","KHR_interactivity/FlowGraphGLTFDataProvider"],configuration:{stopPropagation:{name:"stopPropagation"},nodeIndex:{name:"variable",toBlock:"FlowGraphGetVariableBlock",dataTransformer:function(e){return"pickedMesh_"+e}}},outputs:{values:{selectedNodeIndex:{name:"index",toBlock:"FlowGraphIndexOfBlock"},controllerIndex:{name:"pointerId"},selectionPoint:{name:"pickedPoint"},selectionRayOrigin:{name:"pickOrigin"}},flows:{out:{name:"done"}}},interBlockConnectors:[{input:"asset",output:"value",inputBlockIndex:0,outputBlockIndex:1,isVariable:!0},{input:"array",output:"nodes",inputBlockIndex:2,outputBlockIndex:3,isVariable:!0},{input:"object",output:"pickedMesh",inputBlockIndex:2,outputBlockIndex:0,isVariable:!0}],extraProcessor:function(e,t,n,r,o,a,i){var s,l,u,c,f,d,h,p=o[o.length-1];p.config=p.config||{},p.config.glTF=i;var m=null===(u=null===(l=null===(s=e.configuration)||void 0===s?void 0:s.nodeIndex)||void 0===l?void 0:l.value)||void 0===u?void 0:u[0];if(void 0===m||"number"!=typeof m)throw new Error("nodeIndex not found in configuration");var _="pickedMesh_"+m;return o[1].config.variable=_,a._userVariables[_]={className:"Mesh",id:null===(f=null===(c=null==i?void 0:i.nodes)||void 0===c?void 0:c[m]._babylonTransformNode)||void 0===f?void 0:f.id,uniqueId:null===(h=null===(d=null==i?void 0:i.nodes)||void 0===d?void 0:d[m]._babylonTransformNode)||void 0===h?void 0:h.uniqueId},o}}),(0,i.oR)("/nodes/{}/extensions/KHR_node_selectability/selectable",{get:function(e){var t=e._babylonTransformNode;return!t||void 0===t.isPickable||t.isPickable},set:function(e,t){var n;null===(n=t._primitiveBabylonMeshes)||void 0===n||n.forEach((function(t){t.isPickable=e}))},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"isPickable"}],type:"boolean"});var l=function(){function e(e){this.name=s,this._loader=e,this.enabled=e.isExtensionUsed(s)}return e.prototype.onReady=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(t){return null===(e=this._loader.gltf.nodes)||void 0===e||e.forEach((function(e){var t,n,r;(null===(t=e.extensions)||void 0===t?void 0:t.KHR_node_selectability)&&!1===(null===(n=e.extensions)||void 0===n?void 0:n.KHR_node_selectability.selectable)&&(null===(r=e._babylonTransformNode)||void 0===r||r.getChildMeshes().forEach((function(e){e.isPickable=!1})))})),[2]}))}))},e.prototype.dispose=function(){this._loader=null},e}();(0,o.Hg)(s),(0,o.Ye)(s,!0,(function(e){return new l(e)}))},947(e,t,n){n.r(t),n.d(t,{KHR_node_visibility:()=>i});var r=n(4015),o=n(8698),a="KHR_node_visibility";(0,o.oR)("/nodes/{}/extensions/KHR_node_visibility/visible",{get:function(e){var t=e._babylonTransformNode;return!t||void 0===t.isVisible||t.isVisible},set:function(e,t){var n,r;null===(n=t._primitiveBabylonMeshes)||void 0===n||n.forEach((function(e){e.inheritVisibility=!0})),t._babylonTransformNode&&(t._babylonTransformNode.isVisible=e),null===(r=t._primitiveBabylonMeshes)||void 0===r||r.forEach((function(t){t.isVisible=e}))},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"isVisible"}],type:"boolean"});var i=function(){function e(e){this.name=a,this._loader=e,this.enabled=e.isExtensionUsed(a)}return e.prototype.onReady=function(){if(this._loader){var e=this._loader.gltf.nodes;if(e)for(var t=0,n=e;t<n.length;t++){var r=n[t],o=r._babylonTransformNode;o&&(o.inheritVisibility=!0,r.extensions&&r.extensions.KHR_node_visibility&&!1===r.extensions.KHR_node_visibility.visible&&(o.isVisible=!1))}}},e.prototype.dispose=function(){delete this._loader},e}();(0,r.Hg)(a),(0,r.Ye)(a,!0,(function(e){return new i(e)}))},5873(e,t,n){n.r(t),n.d(t,{KHR_texture_basisu:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="KHR_texture_basisu",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=e.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype._loadTextureAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(i,s){return(0,r.sH)(a,void 0,void 0,(function(){var a,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return a=null==t.sampler?o.GLTFLoader.DefaultSampler:o.ArrayItem.Get("".concat(e,"/sampler"),this._loader.gltf.samplers,t.sampler),l=o.ArrayItem.Get("".concat(i,"/source"),this._loader.gltf.images,s.source),[4,this._loader._createTextureAsync(e,a,l,(function(e){n(e)}),t._textureInfo.nonColorData?{useRGBAIfASTCBC7NotAvailableWhenUASTC:!0}:void 0,!t._textureInfo.nonColorData)];case 1:return[2,r.sent()]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},410(e,t,n){n.r(t),n.d(t,{KHR_texture_transform:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="KHR_texture_transform",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadTextureInfoAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(a,s){return(0,r.sH)(i,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadTextureInfoAsync(e,t,(function(e){if(!(e instanceof o.Texture))throw new Error("".concat(a,": Texture type not supported"));s.offset&&(e.uOffset=s.offset[0],e.vOffset=s.offset[1]),e.uRotationCenter=0,e.vRotationCenter=0,s.rotation&&(e.wAng=-s.rotation),s.scale&&(e.uScale=s.scale[0],e.vScale=s.scale[1]),null!=s.texCoord&&(e.coordinatesIndex=s.texCoord),n(e)}))];case 1:return[2,r.sent()]}}))}))}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},5299(e,t,n){n.r(t),n.d(t,{KHR_xmp_json_ld:()=>a});var r=n(4015),o="KHR_xmp_json_ld",a=function(){function e(e){this.name=o,this.order=100,this._loader=e,this.enabled=this._loader.isExtensionUsed(o)}return e.prototype.dispose=function(){this._loader=null},e.prototype.onLoading=function(){var e,t,n;if(null!==this._loader.rootBabylonMesh){var r=null===(e=this._loader.gltf.extensions)||void 0===e?void 0:e.KHR_xmp_json_ld,o=null===(n=null===(t=this._loader.gltf.asset)||void 0===t?void 0:t.extensions)||void 0===n?void 0:n.KHR_xmp_json_ld;if(r&&o){var a=+o.packet;r.packets&&a<r.packets.length&&(this._loader.rootBabylonMesh.metadata=this._loader.rootBabylonMesh.metadata||{},this._loader.rootBabylonMesh.metadata.xmp=r.packets[a])}}},e}();(0,r.Hg)(o),(0,r.Ye)(o,!0,(function(e){return new a(e)}))},3218(e,t,n){n.r(t),n.d(t,{MSFT_audio_emitter:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="MSFT_audio_emitter",l=function(){function e(e){this.name=s,this._loader=e,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,this._clips=null,this._emitters=null},e.prototype.onLoading=function(){var e=this._loader.gltf.extensions;if(e&&e[this.name]){var t=e[this.name];this._clips=t.clips,this._emitters=t.emitters,a.ArrayItem.Assign(this._clips),a.ArrayItem.Assign(this._emitters)}},e.prototype.loadSceneAsync=function(e,t){var n=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(n,void 0,void 0,(function(){var n,s,l,u,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:for((n=new Array).push(this._loader.loadSceneAsync(e,t)),s=0,l=i.emitters;s<l.length;s++){if(u=l[s],null!=(c=a.ArrayItem.Get("".concat(o,"/emitters"),this._emitters,u)).refDistance||null!=c.maxDistance||null!=c.rolloffFactor||null!=c.distanceModel||null!=c.innerAngle||null!=c.outerAngle)throw new Error("".concat(o,": Direction or Distance properties are not allowed on emitters attached to a scene"));n.push(this._loadEmitterAsync("".concat(o,"/emitters/").concat(c.index),c))}return[4,Promise.all(n)];case 1:return r.sent(),[2]}}))}))}))},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,s){return(0,r.sH)(i,void 0,void 0,(function(){var i,l,u=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=new Array,[4,this._loader.loadNodeAsync(e,t,(function(t){for(var r=function(n){var r=a.ArrayItem.Get("".concat(e,"/emitters"),u._emitters,n);i.push(u._loadEmitterAsync("".concat(e,"/emitters/").concat(r.index),r).then((function(){for(var e=0,n=r._babylonSounds;e<n.length;e++){var a=n[e];a.attachToMesh(t),null==r.innerAngle&&null==r.outerAngle||(a.setLocalDirectionToMesh(o.Vector3.Forward()),a.setDirectionalCone(2*o.Tools.ToDegrees(null==r.innerAngle?Math.PI:r.innerAngle),2*o.Tools.ToDegrees(null==r.outerAngle?Math.PI:r.outerAngle),0))}})))},l=0,c=s.emitters;l<c.length;l++)r(c[l]);n(t)}))];case 1:return l=r.sent(),[4,Promise.all(i)];case 2:return r.sent(),[2,l]}}))}))}))},e.prototype.loadAnimationAsync=function(e,t){var n=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(o,i){return(0,r.sH)(n,void 0,void 0,(function(){var n,s,l,u,c;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadAnimationAsync(e,t)];case 1:for(n=r.sent(),s=new Array,a.ArrayItem.Assign(i.events),l=0,u=i.events;l<u.length;l++)c=u[l],s.push(this._loadAnimationEventAsync("".concat(o,"/events/").concat(c.index),e,t,c,n));return[4,Promise.all(s)];case 2:return r.sent(),[2,n]}}))}))}))},e.prototype._loadClipAsync=function(e,t){if(t._objectURL)return t._objectURL;var n;if(t.uri)n=this._loader.loadUriAsync(e,t,t.uri);else{var r=a.ArrayItem.Get("".concat(e,"/bufferView"),this._loader.gltf.bufferViews,t.bufferView);n=this._loader.loadBufferViewAsync("/bufferViews/".concat(r.index),r)}return t._objectURL=n.then((function(e){var n=(0,o.GetBlobBufferSource)(e);return URL.createObjectURL(new Blob([n],{type:t.mimeType}))})),t._objectURL},e.prototype._loadEmitterAsync=function(e,t){var n=this;if(t._babylonSounds=t._babylonSounds||[],!t._babylonData){for(var r=new Array,i=t.name||"emitter".concat(t.index),s={loop:!1,autoplay:!1,volume:null==t.volume?1:t.volume},l=function(e){var l="/extensions/".concat(u.name,"/clips"),c=a.ArrayItem.Get(l,u._clips,t.clips[e].clip);r.push(u._loadClipAsync("".concat(l,"/").concat(t.clips[e].clip),c).then((function(r){var a=t._babylonSounds[e]=new o.Sound(i,r,n._loader.babylonScene,null,s);a.refDistance=t.refDistance||1,a.maxDistance=t.maxDistance||256,a.rolloffFactor=t.rolloffFactor||1,a.distanceModel=t.distanceModel||"exponential"})))},u=this,c=0;c<t.clips.length;c++)l(c);var f=Promise.all(r).then((function(){var e=t.clips.map((function(e){return e.weight||1})),n=new o.WeightedSound(t.loop||!1,t._babylonSounds,e);t.innerAngle&&(n.directionalConeInnerAngle=2*o.Tools.ToDegrees(t.innerAngle)),t.outerAngle&&(n.directionalConeOuterAngle=2*o.Tools.ToDegrees(t.outerAngle)),t.volume&&(n.volume=t.volume),t._babylonData.sound=n}));t._babylonData={loaded:f}}return t._babylonData.loaded},e.prototype._getEventAction=function(e,t,n,r,o){switch(n){case"play":return function(e){var n=(o||0)+(e-r);t.play(n)};case"stop":return function(){t.stop()};case"pause":return function(){t.pause()};default:throw new Error("".concat(e,": Unsupported action ").concat(n))}},e.prototype._loadAnimationEventAsync=function(e,t,n,r,i){var s=this;if(0==i.targetedAnimations.length)return Promise.resolve();var l=i.targetedAnimations[0],u=r.emitter,c=a.ArrayItem.Get("/extensions/".concat(this.name,"/emitters"),this._emitters,u);return this._loadEmitterAsync(e,c).then((function(){var t=c._babylonData.sound;if(t){var n=new o.AnimationEvent(r.time,s._getEventAction(e,t,r.action,r.time,r.startOffset));l.animation.addEvent(n),i.onAnimationGroupEndObservable.add((function(){t.stop()})),i.onAnimationGroupPauseObservable.add((function(){t.pause()}))}}))},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},2658(e,t,n){n.r(t),n.d(t,{MSFT_lod:()=>l});var r=n(8322),o=n(5597),a=n(8625),i=n(4015),s="MSFT_lod",l=function(){function e(e){var t,n;this.name=s,this.order=100,this.maxLODsToLoad=10,this.onNodeLODsLoadedObservable=new o.Observable,this.onMaterialLODsLoadedObservable=new o.Observable,this._bufferLODs=new Array,this._nodeIndexLOD=null,this._nodeSignalLODs=new Array,this._nodePromiseLODs=new Array,this._nodeBufferLODs=new Array,this._materialIndexLOD=null,this._materialSignalLODs=new Array,this._materialPromiseLODs=new Array,this._materialBufferLODs=new Array,this._loader=e,this.maxLODsToLoad=null!==(n=null===(t=this._loader.parent.extensionOptions[s])||void 0===t?void 0:t.maxLODsToLoad)&&void 0!==n?n:this.maxLODsToLoad,this.enabled=this._loader.isExtensionUsed(s)}return e.prototype.dispose=function(){this._loader=null,this._nodeIndexLOD=null,this._nodeSignalLODs.length=0,this._nodePromiseLODs.length=0,this._nodeBufferLODs.length=0,this._materialIndexLOD=null,this._materialSignalLODs.length=0,this._materialPromiseLODs.length=0,this._materialBufferLODs.length=0,this.onMaterialLODsLoadedObservable.clear(),this.onNodeLODsLoadedObservable.clear()},e.prototype.onReady=function(){for(var e=this,t=function(t){var r=Promise.all(n._nodePromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Node LOD ".concat(t)),e._loader.log("Loaded node LOD ".concat(t))),e.onNodeLODsLoadedObservable.notifyObservers(t),t!==e._nodePromiseLODs.length-1&&(e._loader.startPerformanceCounter("Node LOD ".concat(t+1)),e._loadBufferLOD(e._nodeBufferLODs,t+1),e._nodeSignalLODs[t]&&e._nodeSignalLODs[t].resolve())}));n._loader._completePromises.push(r)},n=this,r=0;r<this._nodePromiseLODs.length;r++)t(r);var o=function(t){var n=Promise.all(a._materialPromiseLODs[t]).then((function(){0!==t&&(e._loader.endPerformanceCounter("Material LOD ".concat(t)),e._loader.log("Loaded material LOD ".concat(t))),e.onMaterialLODsLoadedObservable.notifyObservers(t),t!==e._materialPromiseLODs.length-1&&(e._loader.startPerformanceCounter("Material LOD ".concat(t+1)),e._loadBufferLOD(e._materialBufferLODs,t+1),e._materialSignalLODs[t]&&e._materialSignalLODs[t].resolve())}));a._loader._completePromises.push(n)},a=this;for(r=0;r<this._materialPromiseLODs.length;r++)o(r)},e.prototype.loadSceneAsync=function(e,t){var n=this._loader.loadSceneAsync(e,t);return this._loadBufferLOD(this._bufferLODs,0),n},e.prototype.loadNodeAsync=function(e,t,n){var i=this;return a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,a){return(0,r.sH)(i,void 0,void 0,(function(){var i,s,l,u,c,f=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:for(s=this._getLODs(e,t,this._loader.gltf.nodes,a.ids),this._loader.logOpen("".concat(e)),l=function(e){var t=s[e];0!==e&&(u._nodeIndexLOD=e,u._nodeSignalLODs[e]=u._nodeSignalLODs[e]||new o.Deferred);var r=u._loader.loadNodeAsync("/nodes/".concat(t.index),t,(function(e){n(e),e.setEnabled(!1)})).then((function(t){if(0!==e){var n=s[e-1];n._babylonTransformNode&&(f._disposeTransformNode(n._babylonTransformNode),delete n._babylonTransformNode)}return t.setEnabled(!0),t}));u._nodePromiseLODs[e]=u._nodePromiseLODs[e]||[],0===e?i=r:(u._nodeIndexLOD=null,u._nodePromiseLODs[e].push(r))},u=this,c=0;c<s.length;c++)l(c);return this._loader.logClose(),[4,i];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadMaterialAsync=function(e,t,n,o,i){var s=this;return this._nodeIndexLOD?null:a.GLTFLoader.LoadExtensionAsync(e,t,this.name,(function(e,a){return(0,r.sH)(s,void 0,void 0,(function(){var s,l,u,c,f,d=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:for(l=this._getLODs(e,t,this._loader.gltf.materials,a.ids),this._loader.logOpen("".concat(e)),u=function(e){var t=l[e];0!==e&&(c._materialIndexLOD=e);var r=c._loader._loadMaterialAsync("/materials/".concat(t.index),t,n,o,(function(t){0===e&&i(t)})).then((function(t){if(0!==e){i(t);var n=l[e-1]._data;n[o]&&(d._disposeMaterials([n[o].babylonMaterial]),delete n[o])}return t}));c._materialPromiseLODs[e]=c._materialPromiseLODs[e]||[],0===e?s=r:(c._materialIndexLOD=null,c._materialPromiseLODs[e].push(r))},c=this,f=0;f<l.length;f++)u(f);return this._loader.logClose(),[4,s];case 1:return[2,r.sent()]}}))}))}))},e.prototype._loadUriAsync=function(e,t,n){var a=this;if(null!==this._nodeIndexLOD){this._loader.log("deferred");var i=this._nodeIndexLOD-1;return this._nodeSignalLODs[i]=this._nodeSignalLODs[i]||new o.Deferred,this._nodeSignalLODs[this._nodeIndexLOD-1].promise.then((function(){return(0,r.sH)(a,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadUriAsync(e,t,n)];case 1:return[2,r.sent()]}}))}))}))}return null!==this._materialIndexLOD?(this._loader.log("deferred"),i=this._materialIndexLOD-1,this._materialSignalLODs[i]=this._materialSignalLODs[i]||new o.Deferred,this._materialSignalLODs[i].promise.then((function(){return(0,r.sH)(a,void 0,void 0,(function(){return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loader.loadUriAsync(e,t,n)];case 1:return[2,r.sent()]}}))}))}))):null},e.prototype.loadBufferAsync=function(e,t,n,a){var i=this;if(this._loader.parent.useRangeRequests&&!t.uri){if(!this._loader.bin)throw new Error("".concat(e,": Uri is missing or the binary glTF is missing its binary chunk"));var s=function(e,t){return(0,r.sH)(i,void 0,void 0,(function(){var i,s,l;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return s=(i=n)+a-1,(l=e[t])?(l.start=Math.min(l.start,i),l.end=Math.max(l.end,s)):(l={start:i,end:s,loaded:new o.Deferred},e[t]=l),[4,l.loaded.promise.then((function(e){return new Uint8Array(e.buffer,e.byteOffset+n-l.start,a)}))];case 1:return[2,r.sent()]}}))}))};return this._loader.log("deferred"),null!==this._nodeIndexLOD?s(this._nodeBufferLODs,this._nodeIndexLOD):null!==this._materialIndexLOD?s(this._materialBufferLODs,this._materialIndexLOD):s(this._bufferLODs,0)}return null},e.prototype._loadBufferLOD=function(e,t){var n=e[t];n&&(this._loader.log("Loading buffer range [".concat(n.start,"-").concat(n.end,"]")),this._loader.bin.readAsync(n.start,n.end-n.start+1).then((function(e){n.loaded.resolve(e)}),(function(e){n.loaded.reject(e)})))},e.prototype._getLODs=function(e,t,n,r){if(this.maxLODsToLoad<=0)throw new Error("maxLODsToLoad must be greater than zero");for(var o=[],i=r.length-1;i>=0;i--)if(o.push(a.ArrayItem.Get("".concat(e,"/ids/").concat(r[i]),n,r[i])),o.length===this.maxLODsToLoad)return o;return o.push(t),o},e.prototype._disposeTransformNode=function(e){var t=this,n=[],r=e.material;r&&n.push(r);for(var o=0,a=e.getChildMeshes();o<a.length;o++){var i=a[o];i.material&&n.push(i.material)}e.dispose();var s=n.filter((function(e){return t._loader.babylonScene.meshes.every((function(t){return t.material!=e}))}));this._disposeMaterials(s)},e.prototype._disposeMaterials=function(e){for(var t={},n=0,r=e;n<r.length;n++){for(var o=0,a=(c=r[n]).getActiveTextures();o<a.length;o++){var i=a[o];t[i.uniqueId]=i}c.dispose()}for(var s in t)for(var l=0,u=this._loader.babylonScene.materials;l<u.length;l++){var c;(c=u[l]).hasTexture(t[s])&&delete t[s]}for(var s in t)t[s].dispose()},e}();(0,i.Hg)(s),(0,i.Ye)(s,!0,(function(e){return new l(e)}))},4439(e,t,n){n.r(t),n.d(t,{MSFT_minecraftMesh:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="MSFT_minecraftMesh",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var a;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if(!i)return[3,2];if(!this._loader._pbrMaterialImpl)throw new Error("".concat(o,": Material type not supported"));return a=this._loader.loadMaterialPropertiesAsync(e,t,n),n.needAlphaBlending()&&(n.forceDepthWrite=!0,n.separateCullingPass=!0),n.backFaceCulling=n.forceDepthWrite,n.twoSidedLighting=!0,[4,a];case 1:return[2,r.sent()];case 2:return[2]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},6629(e,t,n){n.r(t),n.d(t,{MSFT_sRGBFactors:()=>s});var r=n(8322),o=n(8625),a=n(4015),i="MSFT_sRGBFactors",s=function(){function e(e){this.name=i,this._loader=e,this.enabled=this._loader.isExtensionUsed(i)}return e.prototype.dispose=function(){this._loader=null},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var a=this;return o.GLTFLoader.LoadExtraAsync(e,t,this.name,(function(o,i){return(0,r.sH)(a,void 0,void 0,(function(){var o,a,s;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i?(o=this._loader._getOrCreateMaterialAdapter(n),a=this._loader.loadMaterialPropertiesAsync(e,t,n),s=n.getScene().getEngine().useExactSrgbConversions,o.baseColorTexture||o.baseColor.toLinearSpaceToRef(o.baseColor,s),o.specularColorTexture||o.specularColor.toLinearSpaceToRef(o.specularColor,s),[4,a]):[3,2];case 1:return[2,r.sent()];case 2:return[2]}}))}))}))},e}();(0,a.Hg)(i),(0,a.Ye)(i,!0,(function(e){return new s(e)}))},8698(e,t,n){n.d(t,{oR:()=>h,tQ:()=>f,Wt:()=>c,ZU:()=>d});var r=n(5597),o=[{regex:new RegExp("^/nodes/\\d+/extensions/")}],a=function(){function e(e,t){this._gltf=e,this._infoTree=t}return e.prototype.convert=function(e){var t=this._gltf,n=this._infoTree,r=void 0;if(!e.startsWith("/"))throw new Error("Path must start with a /");var a=e.split("/");if(a.shift(),a[a.length-1].includes(".length")){var i=a[a.length-1].split(".");a.pop(),a.push.apply(a,i)}for(var s=!1,l=0,u=a;l<u.length;l++){var c=u[l],f="length"===c;if(f&&!n.__array__)throw new Error("Path ".concat(e," is invalid"));if(n.__ignoreObjectTree__&&(s=!0),n.__array__&&!f)n=n.__array__;else if(!(n=n[c]))throw new Error("Path ".concat(e," is invalid"));if(!s)if(void 0===t){if(!o.find((function(t){return t.regex.test(e)})))throw new Error("Path ".concat(e," is invalid"))}else f||(t=null==t?void 0:t[c]);(n.__target__||f)&&(r=t)}return{object:r,info:n}},e}();function i(e,t,n,r){var o=s(e);return r?o[n][r]:o[n]}function s(e,t,n){var o,a,i;return null===(i=null===(o=e._data)||void 0===o?void 0:o[null!==(a=null==n?void 0:n.fillMode)&&void 0!==a?a:r.Constants.MATERIAL_TriangleFillMode])||void 0===i?void 0:i.babylonMaterial}function l(e,t){return{offset:{componentsCount:2,type:"Vector2",get:function(n,o,a){var s=i(n,0,e,t);return new r.Vector2(null==s?void 0:s.uOffset,null==s?void 0:s.vOffset)},getTarget:s,set:function(n,r,o,a){var s=i(r,0,e,t);s.uOffset=n.x,s.vOffset=n.y},getPropertyName:[function(){return"".concat(e).concat(t?"."+t:"",".uOffset")},function(){return"".concat(e).concat(t?"."+t:"",".vOffset")}]},rotation:{type:"number",get:function(n,r,o){var a;return null===(a=i(n,0,e,t))||void 0===a?void 0:a.wAng},getTarget:s,set:function(n,r,o,a){return i(r,0,e,t).wAng=n},getPropertyName:[function(){return"".concat(e).concat(t?"."+t:"",".wAng")}]},scale:{componentsCount:2,type:"Vector2",get:function(n,o,a){var s=i(n,0,e,t);return new r.Vector2(null==s?void 0:s.uScale,null==s?void 0:s.vScale)},getTarget:s,set:function(n,r,o,a){var s=i(r,0,e,t);s.uScale=n.x,s.vScale=n.y},getPropertyName:[function(){return"".concat(e).concat(t?"."+t:"",".uScale")},function(){return"".concat(e).concat(t?"."+t:"",".vScale")}]}}}var u={cameras:{__array__:{__target__:!0,orthographic:{xmag:{componentsCount:2,type:"Vector2",get:function(e){var t,n,o,a;return new r.Vector2(null!==(n=null===(t=e._babylonCamera)||void 0===t?void 0:t.orthoLeft)&&void 0!==n?n:0,null!==(a=null===(o=e._babylonCamera)||void 0===o?void 0:o.orthoRight)&&void 0!==a?a:0)},set:function(e,t){t._babylonCamera&&(t._babylonCamera.orthoLeft=e.x,t._babylonCamera.orthoRight=e.y)},getTarget:function(e){return e},getPropertyName:[function(){return"orthoLeft"},function(){return"orthoRight"}]},ymag:{componentsCount:2,type:"Vector2",get:function(e){var t,n,o,a;return new r.Vector2(null!==(n=null===(t=e._babylonCamera)||void 0===t?void 0:t.orthoBottom)&&void 0!==n?n:0,null!==(a=null===(o=e._babylonCamera)||void 0===o?void 0:o.orthoTop)&&void 0!==a?a:0)},set:function(e,t){t._babylonCamera&&(t._babylonCamera.orthoBottom=e.x,t._babylonCamera.orthoTop=e.y)},getTarget:function(e){return e},getPropertyName:[function(){return"orthoBottom"},function(){return"orthoTop"}]},zfar:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.maxZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"maxZ"}]},znear:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.minZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"minZ"}]}},perspective:{aspectRatio:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.getEngine().getAspectRatio(e._babylonCamera)},getTarget:function(e){return e},getPropertyName:[function(){return"aspectRatio"}],isReadOnly:!0},yfov:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.fov},set:function(e,t){t._babylonCamera&&(t._babylonCamera.fov=e)},getTarget:function(e){return e},getPropertyName:[function(){return"fov"}]},zfar:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.maxZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.maxZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"maxZ"}]},znear:{type:"number",get:function(e){var t;return null===(t=e._babylonCamera)||void 0===t?void 0:t.minZ},set:function(e,t){t._babylonCamera&&(t._babylonCamera.minZ=e)},getTarget:function(e){return e},getPropertyName:[function(){return"minZ"}]}}}},nodes:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonTransformNode}))},getPropertyName:[function(){return"length"}]},__array__:{__target__:!0,translation:{type:"Vector3",get:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.position},set:function(e,t){var n;return null===(n=t._babylonTransformNode)||void 0===n?void 0:n.position.copyFrom(e)},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"position"}]},rotation:{type:"Quaternion",get:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.rotationQuaternion},set:function(e,t){var n,r;return null===(r=null===(n=t._babylonTransformNode)||void 0===n?void 0:n.rotationQuaternion)||void 0===r?void 0:r.copyFrom(e)},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"rotationQuaternion"}]},scale:{type:"Vector3",get:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.scaling},set:function(e,t){var n;return null===(n=t._babylonTransformNode)||void 0===n?void 0:n.scaling.copyFrom(e)},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"scaling"}]},weights:{length:{type:"number",get:function(e){return e._numMorphTargets},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"influence"}]},__array__:{__target__:!0,type:"number",get:function(e,t){var n,r;return void 0!==t?null===(r=null===(n=e._primitiveBabylonMeshes)||void 0===n?void 0:n[0].morphTargetManager)||void 0===r?void 0:r.getTarget(t).influence:void 0},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"influence"}]},type:"number[]",get:function(e,t){return[0]},getTarget:function(e){return e._babylonTransformNode},getPropertyName:[function(){return"influence"}]},matrix:{type:"Matrix",get:function(e){var t,n,o;return r.Matrix.Compose(null===(t=e._babylonTransformNode)||void 0===t?void 0:t.scaling,null===(n=e._babylonTransformNode)||void 0===n?void 0:n.rotationQuaternion,null===(o=e._babylonTransformNode)||void 0===o?void 0:o.position)},getTarget:function(e){return e._babylonTransformNode},isReadOnly:!0},globalMatrix:{type:"Matrix",get:function(e){for(var t,n,o,a,i,s,l,u=r.Matrix.Identity(),c=e.parent;c&&c.parent;)c=c.parent;var f=(null===(t=e._babylonTransformNode)||void 0===t?void 0:t.position._isDirty)||(null===(o=null===(n=e._babylonTransformNode)||void 0===n?void 0:n.rotationQuaternion)||void 0===o?void 0:o._isDirty)||(null===(a=e._babylonTransformNode)||void 0===a?void 0:a.scaling._isDirty);if(c){var d=null===(i=c._babylonTransformNode)||void 0===i?void 0:i.computeWorldMatrix(!0).invert();d&&(null===(l=null===(s=e._babylonTransformNode)||void 0===s?void 0:s.computeWorldMatrix(f))||void 0===l||l.multiplyToRef(d,u))}else e._babylonTransformNode&&u.copyFrom(e._babylonTransformNode.computeWorldMatrix(f));return u},getTarget:function(e){return e._babylonTransformNode},isReadOnly:!0},extensions:{EXT_lights_ies:{multiplier:{type:"number",get:function(e){var t,n;return null===(n=null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0])||void 0===n?void 0:n.intensity},getTarget:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0]},set:function(e,t){if(t._babylonTransformNode){var n=t._babylonTransformNode.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0];n&&(n.intensity=e)}}},color:{type:"Color3",get:function(e){var t,n;return null===(n=null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0])||void 0===n?void 0:n.diffuse},getTarget:function(e){var t;return null===(t=e._babylonTransformNode)||void 0===t?void 0:t.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0]},set:function(e,t){if(t._babylonTransformNode){var n=t._babylonTransformNode.getChildren((function(e){return e instanceof r.SpotLight}),!0)[0];n&&(n.diffuse=e)}}}},KHR_node_visibility:{visible:{type:"boolean",get:function(e){return!!e._primitiveBabylonMeshes&&e._primitiveBabylonMeshes[0].isVisible},getTarget:function(){},set:function(e,t){t._primitiveBabylonMeshes&&t._primitiveBabylonMeshes.forEach((function(t){return t.isVisible=e}))}}}}}},materials:{__array__:{__target__:!0,emissiveFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).emissiveColor},set:function(e,t,n,r){return s(t,0,r).emissiveColor.copyFrom(e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"emissiveColor"}]},emissiveTexture:{extensions:{KHR_texture_transform:l("emissiveTexture")}},normalTexture:{scale:{type:"number",get:function(e,t,n){var r;return null===(r=i(e,0,"bumpTexture"))||void 0===r?void 0:r.level},set:function(e,t,n,r){var o=i(t,0,"bumpTexture");o&&(o.level=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"level"}]},extensions:{KHR_texture_transform:l("bumpTexture")}},occlusionTexture:{strength:{type:"number",get:function(e,t,n){return s(e,0,n).ambientTextureStrength},set:function(e,t,n,r){var o=s(t,0,r);o&&(o.ambientTextureStrength=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"ambientTextureStrength"}]},extensions:{KHR_texture_transform:l("ambientTexture")}},pbrMetallicRoughness:{baseColorFactor:{type:"Color4",get:function(e,t,n){var o=s(e,0,n);return r.Color4.FromColor3(o.albedoColor,o.alpha)},set:function(e,t,n,r){var o=s(t,0,r);o.albedoColor.set(e.r,e.g,e.b),o.alpha=e.a},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"albedoColor"},function(){return"alpha"}]},baseColorTexture:{extensions:{KHR_texture_transform:l("albedoTexture")}},metallicFactor:{type:"number",get:function(e,t,n){return s(e,0,n).metallic},set:function(e,t,n,r){var o=s(t,0,r);o&&(o.metallic=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"metallic"}]},roughnessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).roughness},set:function(e,t,n,r){var o=s(t,0,r);o&&(o.roughness=e)},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"roughness"}]},metallicRoughnessTexture:{extensions:{KHR_texture_transform:l("metallicTexture")}}},extensions:{KHR_materials_anisotropy:{anisotropyStrength:{type:"number",get:function(e,t,n){return s(e,0,n).anisotropy.intensity},set:function(e,t,n,r){s(t,0,r).anisotropy.intensity=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"anisotropy.intensity"}]},anisotropyRotation:{type:"number",get:function(e,t,n){return s(e,0,n).anisotropy.angle},set:function(e,t,n,r){s(t,0,r).anisotropy.angle=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"anisotropy.angle"}]},anisotropyTexture:{extensions:{KHR_texture_transform:l("anisotropy","texture")}}},KHR_materials_clearcoat:{clearcoatFactor:{type:"number",get:function(e,t,n){return s(e,0,n).clearCoat.intensity},set:function(e,t,n,r){s(t,0,r).clearCoat.intensity=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"clearCoat.intensity"}]},clearcoatRoughnessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).clearCoat.roughness},set:function(e,t,n,r){s(t,0,r).clearCoat.roughness=e},getTarget:function(e,t,n){return s(e,0,n)},getPropertyName:[function(){return"clearCoat.roughness"}]},clearcoatTexture:{extensions:{KHR_texture_transform:l("clearCoat","texture")}},clearcoatNormalTexture:{scale:{type:"number",get:function(e,t,n){var r;return null===(r=s(e,0,n).clearCoat.bumpTexture)||void 0===r?void 0:r.level},getTarget:s,set:function(e,t,n,r){return s(t,0,r).clearCoat.bumpTexture.level=e}},extensions:{KHR_texture_transform:l("clearCoat","bumpTexture")}},clearcoatRoughnessTexture:{extensions:{KHR_texture_transform:l("clearCoat","textureRoughness")}}},KHR_materials_dispersion:{dispersion:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.dispersion},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.dispersion=e}}},KHR_materials_emissive_strength:{emissiveStrength:{type:"number",get:function(e,t,n){return s(e,0,n).emissiveIntensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).emissiveIntensity=e}}},KHR_materials_ior:{ior:{type:"number",get:function(e,t,n){return s(e,0,n).indexOfRefraction},getTarget:s,set:function(e,t,n,r){return s(t,0,r).indexOfRefraction=e}}},KHR_materials_iridescence:{iridescenceFactor:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.intensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.intensity=e}},iridescenceIor:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.indexOfRefraction},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.indexOfRefraction=e}},iridescenceTexture:{extensions:{KHR_texture_transform:l("iridescence","texture")}},iridescenceThicknessMaximum:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.maximumThickness},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.maximumThickness=e}},iridescenceThicknessMinimum:{type:"number",get:function(e,t,n){return s(e,0,n).iridescence.minimumThickness},getTarget:s,set:function(e,t,n,r){return s(t,0,r).iridescence.minimumThickness=e}},iridescenceThicknessTexture:{extensions:{KHR_texture_transform:l("iridescence","thicknessTexture")}}},KHR_materials_sheen:{sheenColorFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).sheen.color},getTarget:s,set:function(e,t,n,r){return s(t,0,r).sheen.color.copyFrom(e)}},sheenColorTexture:{extensions:{KHR_texture_transform:l("sheen","texture")}},sheenRoughnessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).sheen.intensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).sheen.intensity=e}},sheenRoughnessTexture:{extensions:{KHR_texture_transform:l("sheen","thicknessTexture")}}},KHR_materials_specular:{specularFactor:{type:"number",get:function(e,t,n){return s(e,0,n).metallicF0Factor},getTarget:s,set:function(e,t,n,r){return s(t,0,r).metallicF0Factor=e},getPropertyName:[function(){return"metallicF0Factor"}]},specularColorFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).metallicReflectanceColor},getTarget:s,set:function(e,t,n,r){return s(t,0,r).metallicReflectanceColor.copyFrom(e)},getPropertyName:[function(){return"metallicReflectanceColor"}]},specularTexture:{extensions:{KHR_texture_transform:l("metallicReflectanceTexture")}},specularColorTexture:{extensions:{KHR_texture_transform:l("reflectanceTexture")}}},KHR_materials_transmission:{transmissionFactor:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.refractionIntensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.refractionIntensity=e},getPropertyName:[function(){return"subSurface.refractionIntensity"}]},transmissionTexture:{extensions:{KHR_texture_transform:l("subSurface","refractionIntensityTexture")}}},KHR_materials_diffuse_transmission:{diffuseTransmissionFactor:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.translucencyIntensity},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.translucencyIntensity=e}},diffuseTransmissionTexture:{extensions:{KHR_texture_transform:l("subSurface","translucencyIntensityTexture")}},diffuseTransmissionColorFactor:{type:"Color3",get:function(e,t,n){return s(e,0,n).subSurface.translucencyColor},getTarget:s,set:function(e,t,n,r){var o;return e&&(null===(o=s(t,0,r).subSurface.translucencyColor)||void 0===o?void 0:o.copyFrom(e))}},diffuseTransmissionColorTexture:{extensions:{KHR_texture_transform:l("subSurface","translucencyColorTexture")}}},KHR_materials_volume:{attenuationColor:{type:"Color3",get:function(e,t,n){return s(e,0,n).subSurface.tintColor},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.tintColor.copyFrom(e)}},attenuationDistance:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.tintColorAtDistance},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.tintColorAtDistance=e}},thicknessFactor:{type:"number",get:function(e,t,n){return s(e,0,n).subSurface.maximumThickness},getTarget:s,set:function(e,t,n,r){return s(t,0,r).subSurface.maximumThickness=e}},thicknessTexture:{extensions:{KHR_texture_transform:l("subSurface","thicknessTexture")}}}}}},extensions:{KHR_lights_punctual:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonLight}))},getPropertyName:[function(e){return"length"}]},__array__:{__target__:!0,color:{type:"Color3",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.diffuse},set:function(e,t){var n;return null===(n=t._babylonLight)||void 0===n?void 0:n.diffuse.copyFrom(e)},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"diffuse"}]},intensity:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.intensity},set:function(e,t){return t._babylonLight?t._babylonLight.intensity=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"intensity"}]},range:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.range},set:function(e,t){return t._babylonLight?t._babylonLight.range=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"range"}]},spot:{innerConeAngle:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.innerAngle},set:function(e,t){return t._babylonLight?t._babylonLight.innerAngle=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"innerConeAngle"}]},outerConeAngle:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.angle},set:function(e,t){return t._babylonLight?t._babylonLight.angle=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"outerConeAngle"}]}}}}},EXT_lights_area:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonLight}))},getPropertyName:[function(e){return"length"}]},__array__:{__target__:!0,color:{type:"Color3",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.diffuse},set:function(e,t){var n;return null===(n=t._babylonLight)||void 0===n?void 0:n.diffuse.copyFrom(e)},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"diffuse"}]},intensity:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.intensity},set:function(e,t){return t._babylonLight?t._babylonLight.intensity=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"intensity"}]},size:{type:"number",get:function(e){var t;return null===(t=e._babylonLight)||void 0===t?void 0:t.height},set:function(e,t){return t._babylonLight?t._babylonLight.height=e:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"size"}]},rect:{aspect:{type:"number",get:function(e){var t,n;return(null===(t=e._babylonLight)||void 0===t?void 0:t.width)/(null===(n=e._babylonLight)||void 0===n?void 0:n.height)},set:function(e,t){return t._babylonLight?t._babylonLight.width=e*t._babylonLight.height:void 0},getTarget:function(e){return e._babylonLight},getPropertyName:[function(e){return"aspect"}]}}}}},EXT_lights_ies:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonLight}))},getPropertyName:[function(e){return"length"}]}}},EXT_lights_image_based:{lights:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonTexture}))},getPropertyName:[function(e){return"length"}]},__array__:{__target__:!0,intensity:{type:"number",get:function(e){var t;return null===(t=e._babylonTexture)||void 0===t?void 0:t.level},set:function(e,t){t._babylonTexture&&(t._babylonTexture.level=e)},getTarget:function(e){return e._babylonTexture}},rotation:{type:"Quaternion",get:function(e){var t;return e._babylonTexture&&r.Quaternion.FromRotationMatrix(null===(t=e._babylonTexture)||void 0===t?void 0:t.getReflectionTextureMatrix())},set:function(e,t){var n;t._babylonTexture&&((null===(n=t._babylonTexture.getScene())||void 0===n?void 0:n.useRightHandedSystem)||(e=r.Quaternion.Inverse(e)),r.Matrix.FromQuaternionToRef(e,t._babylonTexture.getReflectionTextureMatrix()))},getTarget:function(e){return e._babylonTexture}}}}}},animations:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){return e._babylonAnimationGroup}))},getPropertyName:[function(){return"length"}]},__array__:{}},meshes:{length:{type:"number",get:function(e){return e.length},getTarget:function(e){return e.map((function(e){var t;return null===(t=e.primitives[0]._instanceData)||void 0===t?void 0:t.babylonSourceMesh}))},getPropertyName:[function(){return"length"}]},__array__:{}}};function c(e){return new a(e,u)}function f(e){for(var t=e.split("/").map((function(e){return e.replace(/{}/g,"__array__")})),n=u,r=0,o=t;r<o.length;r++){var a=o[r];a&&(n=n[a])}if(n&&n.type&&n.get)return n}function d(e,t){for(var n=e.split("/").map((function(e){return e.replace(/{}/g,"__array__")})),r=u,o=0,a=n;o<a.length;o++){var i=a[o];i&&(r=r[i])}r&&r.type&&r.get&&(r.interpolation=t)}function h(e,t){for(var n=e.split("/").map((function(e){return e.replace(/{}/g,"__array__")})),r=u,o=0,a=n;o<a.length;o++){var i=a[o];if(i){if(!r[i]){if("?"===i){r.__ignoreObjectTree__=!0;continue}r[i]={},"__array__"===i&&(r[i].__target__=!0)}r=r[i]}}Object.assign(r,t)}},8625(e,t,n){n.r(t),n.d(t,{ArrayItem:()=>c,GLTFFileLoader:()=>a.GLTFFileLoader,GLTFLoader:()=>d,LoadBoundingInfoFromPositionAccessor:()=>f});var r=n(8322),o=n(5597),a=n(6086),i=n(4015),s=n(8698),l=new o.Lazy((function(){return Promise.resolve().then(n.t.bind(n,5597,23))})),u=new o.Lazy((function(){return Promise.resolve().then(n.bind(n,2727))})),c=function(){function e(){}return e.Get=function(e,t,n){if(!t||null==n||!t[n])throw new Error("".concat(e,": Failed to find index (").concat(n,")"));return t[n]},e.TryGet=function(e,t){return e&&null!=t&&e[t]?e[t]:null},e.Assign=function(e){if(e)for(var t=0;t<e.length;t++)e[t].index=t},e}();function f(e){if(e.min&&e.max){var t=e.min,n=e.max,r=o.TmpVectors.Vector3[0].copyFromFloats(t[0],t[1],t[2]),a=o.TmpVectors.Vector3[1].copyFromFloats(n[0],n[1],n[2]);if(e.normalized&&5126!==e.componentType){var i=1;switch(e.componentType){case 5120:i=127;break;case 5121:i=255;break;case 5122:i=32767;break;case 5123:i=65535}var s=1/i;r.scaleInPlace(s),a.scaleInPlace(s)}return new o.BoundingInfo(r,a)}return null}var d=function(){function e(e){this._completePromises=new Array,this._assetContainer=null,this._babylonLights=[],this._disableInstancedMesh=0,this._allMaterialsDirtyRequired=!1,this._skipStartAnimationStep=!1,this._extensions=new Array,this._disposed=!1,this._rootUrl=null,this._fileName=null,this._uniqueRootUrl=null,this._bin=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions=new Array,this._materialAdapterCache=new WeakMap,this._pbrMaterialImpl=null,this._parent=e}return e.prototype.isMatchingMaterialType=function(e){return!(!e||!this._pbrMaterialImpl)&&e instanceof this._pbrMaterialImpl.materialClass},e.RegisterExtension=function(e,t){(0,i.Ye)(e,!1,t)},e.UnregisterExtension=function(e){return(0,i.Hg)(e)},Object.defineProperty(e.prototype,"gltf",{get:function(){if(!this._gltf)throw new Error("glTF JSON is not available");return this._gltf},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bin",{get:function(){return this._bin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"babylonScene",{get:function(){if(!this._babylonScene)throw new Error("Scene is not available");return this._babylonScene},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootBabylonMesh",{get:function(){return this._rootBabylonMesh},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootUrl",{get:function(){return this._rootUrl},enumerable:!1,configurable:!0}),e.prototype._getOrCreateMaterialAdapter=function(e){var t=this._materialAdapterCache.get(e);if(!t){if(!this._pbrMaterialImpl)throw new Error("Appropriate material adapter class not found");t=new this._pbrMaterialImpl.adapterClass(e),this._materialAdapterCache.set(e,t)}return t},e.prototype.dispose=function(){this._disposed||(this._disposed=!0,this._completePromises.length=0,this._extensions.forEach((function(e){return e.dispose&&e.dispose()})),this._extensions.length=0,this._gltf=null,this._bin=null,this._babylonScene=null,this._rootBabylonMesh=null,this._defaultBabylonMaterialData={},this._postSceneLoadActions.length=0,this._parent.dispose())},e.prototype.importMeshAsync=function(e,t,n,o,a,i){return(0,r.sH)(this,arguments,void 0,(function(e,t,n,o,a,i,s){var l=this;return void 0===s&&(s=""),(0,r.YH)(this,(function(i){switch(i.label){case 0:return[4,Promise.resolve().then((function(){return(0,r.sH)(l,void 0,void 0,(function(){var i,l,u,c,f,d=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:if(this._babylonScene=t,this._assetContainer=n,this._loadData(o),i=null,e){if(l={},this._gltf.nodes)for(u=0,c=this._gltf.nodes;u<c.length;u++)(f=c[u]).name&&(l[f.name]=f.index);i=(e instanceof Array?e:[e]).map((function(e){var t=l[e];if(void 0===t)throw new Error("Failed to find node '".concat(e,"'"));return t}))}return[4,this._loadAsync(a,s,i,(function(){return{meshes:d._getMeshes(),particleSystems:[],skeletons:d._getSkeletons(),animationGroups:d._getAnimationGroups(),lights:d._babylonLights,transformNodes:d._getTransformNodes(),geometries:d._getGeometries(),spriteManagers:[]}}))];case 1:return[2,r.sent()]}}))}))}))];case 1:return[2,i.sent()]}}))}))},e.prototype.loadAsync=function(e,t,n,o){return(0,r.sH)(this,arguments,void 0,(function(e,t,n,o,a){return void 0===a&&(a=""),(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._babylonScene=e,this._loadData(t),[4,this._loadAsync(n,a,null,(function(){}))];case 1:return[2,r.sent()]}}))}))},e.prototype._loadAsync=function(e,t,i,s){return(0,r.sH)(this,void 0,void 0,(function(){var l=this;return(0,r.YH)(this,(function(u){switch(u.label){case 0:return[4,Promise.resolve().then((function(){return(0,r.sH)(l,void 0,void 0,(function(){var l,u,f,d,h,p,m,_,g,b,y,v,T,x,A=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return this._rootUrl=e,this._uniqueRootUrl=!e.startsWith("file:")&&t?e:"".concat(e).concat(Date.now(),"/"),this._fileName=t,this._allMaterialsDirtyRequired=!1,[4,this._loadExtensionsAsync()];case 1:return r.sent(),this.parent.skipMaterials||null!=this._pbrMaterialImpl?[3,7]:this.parent.useOpenPBR||this.isExtensionUsed("KHR_materials_openpbr")?(l=this,T={},[4,Promise.resolve().then(n.t.bind(n,5597,23))]):[3,4];case 2:return T.materialClass=r.sent().OpenPBRMaterial,[4,Promise.resolve().then(n.bind(n,3833))];case 3:return l._pbrMaterialImpl=(T.adapterClass=r.sent().OpenPBRMaterialLoadingAdapter,T),[3,7];case 4:return u=this,x={},[4,Promise.resolve().then(n.t.bind(n,5597,23))];case 5:return x.materialClass=r.sent().PBRMaterial,[4,Promise.resolve().then(n.bind(n,2561))];case 6:u._pbrMaterialImpl=(x.adapterClass=r.sent().PBRMaterialLoadingAdapter,x),r.label=7;case 7:if(f="".concat(a.GLTFLoaderState[a.GLTFLoaderState.LOADING]," => ").concat(a.GLTFLoaderState[a.GLTFLoaderState.READY]),d="".concat(a.GLTFLoaderState[a.GLTFLoaderState.LOADING]," => ").concat(a.GLTFLoaderState[a.GLTFLoaderState.COMPLETE]),this._parent._startPerformanceCounter(f),this._parent._startPerformanceCounter(d),this._parent._setState(a.GLTFLoaderState.LOADING),this._extensionsOnLoading(),h=new Array,p=this._babylonScene.blockMaterialDirtyMechanism,this._babylonScene.blockMaterialDirtyMechanism=!0,this.parent.loadOnlyMaterials||(i?h.push(this.loadSceneAsync("/nodes",{nodes:i,index:-1})):(null!=this._gltf.scene||this._gltf.scenes&&this._gltf.scenes[0])&&(m=c.Get("/scene",this._gltf.scenes,this._gltf.scene||0),h.push(this.loadSceneAsync("/scenes/".concat(m.index),m)))),!this.parent.skipMaterials&&this.parent.loadAllMaterials&&this._gltf.materials)for(_=0;_<this._gltf.materials.length;++_)g=this._gltf.materials[_],b="/materials/"+_,y=o.Material.TriangleFillMode,h.push(this._loadMaterialAsync(b,g,null,y,(function(){})));return this._allMaterialsDirtyRequired?this._babylonScene.blockMaterialDirtyMechanism=p:this._babylonScene._forceBlockMaterialDirtyMechanism(p),this._parent.compileMaterials&&h.push(this._compileMaterialsAsync()),this._parent.compileShadowGenerators&&h.push(this._compileShadowGeneratorsAsync()),v=Promise.all(h).then((function(){A._rootBabylonMesh&&A._rootBabylonMesh!==A._parent.customRootNode&&A._rootBabylonMesh.setEnabled(!0);for(var e=0,t=A._babylonScene.materials;e<t.length;e++){var n=t[e];void 0!==n.maxSimultaneousLights&&(n.maxSimultaneousLights=Math.max(n.maxSimultaneousLights,A._babylonScene.lights.length))}return A._extensionsOnReady(),A._parent._setState(a.GLTFLoaderState.READY),A._skipStartAnimationStep||A._startAnimations(),s()})),[4,v.then((function(e){return A._parent._endPerformanceCounter(f),o.Tools.SetImmediate((function(){A._disposed||Promise.all(A._completePromises).then((function(){A._parent._endPerformanceCounter(d),A._parent._setState(a.GLTFLoaderState.COMPLETE),A._parent.onCompleteObservable.notifyObservers(void 0),A._parent.onCompleteObservable.clear(),A.dispose()}),(function(e){A._parent.onErrorObservable.notifyObservers(e),A._parent.onErrorObservable.clear(),A.dispose()}))})),e}))];case 8:return[2,r.sent()]}}))}))})).catch((function(e){throw l._disposed||(l._parent.onErrorObservable.notifyObservers(e),l._parent.onErrorObservable.clear(),l.dispose()),e}))];case 1:return[2,u.sent()]}}))}))},e.prototype._loadData=function(e){if(this._gltf=e.json,this._setupData(),e.bin){var t=this._gltf.buffers;if(t&&t[0]&&!t[0].uri){var n=t[0];(n.byteLength<e.bin.byteLength-3||n.byteLength>e.bin.byteLength)&&o.Logger.Warn("Binary buffer length (".concat(n.byteLength,") from JSON does not match chunk length (").concat(e.bin.byteLength,")")),this._bin=e.bin}else o.Logger.Warn("Unexpected BIN chunk")}},e.prototype._setupData=function(){if(c.Assign(this._gltf.accessors),c.Assign(this._gltf.animations),c.Assign(this._gltf.buffers),c.Assign(this._gltf.bufferViews),c.Assign(this._gltf.cameras),c.Assign(this._gltf.images),c.Assign(this._gltf.materials),c.Assign(this._gltf.meshes),c.Assign(this._gltf.nodes),c.Assign(this._gltf.samplers),c.Assign(this._gltf.scenes),c.Assign(this._gltf.skins),c.Assign(this._gltf.textures),this._gltf.nodes){for(var e={},t=0,n=this._gltf.nodes;t<n.length;t++)if((l=n[t]).children)for(var r=0,o=l.children;r<o.length;r++)e[o[r]]=l.index;for(var a=this._createRootNode(),i=0,s=this._gltf.nodes;i<s.length;i++){var l,u=e[(l=s[i]).index];l.parent=void 0===u?a:this._gltf.nodes[u]}}},e.prototype._loadExtensionsAsync=function(){return(0,r.sH)(this,void 0,void 0,(function(){var e,t,n,a,s,l,u,c,f,d,h,p=this;return(0,r.YH)(this,(function(m){switch(m.label){case 0:return e=[],i.Sv.forEach((function(t,n){var a;!1===(null===(a=p.parent.extensionOptions[n])||void 0===a?void 0:a.enabled)?t.isGLTFExtension&&p.isExtensionUsed(n)&&o.Logger.Warn("Extension ".concat(n," is used but has been explicitly disabled.")):t.isGLTFExtension&&!p.isExtensionUsed(n)||e.push((0,r.sH)(p,void 0,void 0,(function(){var e;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,t.factory(this)];case 1:return(e=r.sent()).name!==n&&o.Logger.Warn("The name of the glTF loader extension instance does not match the registered name: ".concat(e.name," !== ").concat(n)),this._parent.onExtensionLoadedObservable.notifyObservers(e),[2,e]}}))})))})),n=(t=(d=this._extensions).push).apply,a=[d],[4,Promise.all(e)];case 1:if(n.apply(t,a.concat([m.sent()])),this._extensions.sort((function(e,t){return(e.order||Number.MAX_VALUE)-(t.order||Number.MAX_VALUE)})),this._parent.onExtensionLoadedObservable.clear(),this._gltf.extensionsRequired)for(s=function(e){if(!l._extensions.some((function(t){return t.name===e&&t.enabled}))){if(!1===(null===(h=l.parent.extensionOptions[e])||void 0===h?void 0:h.enabled))throw new Error("Required extension ".concat(e," is disabled"));throw new Error("Required extension ".concat(e," is not available"))}},l=this,u=0,c=this._gltf.extensionsRequired;u<c.length;u++)f=c[u],s(f);return[2]}}))}))},e.prototype._createRootNode=function(){if(void 0!==this._parent.customRootNode)return this._rootBabylonMesh=this._parent.customRootNode,{_babylonTransformNode:null===this._rootBabylonMesh?void 0:this._rootBabylonMesh,index:-1};this._babylonScene._blockEntityCollection=!!this._assetContainer;var t=new o.Mesh("__root__",this._babylonScene);this._rootBabylonMesh=t,this._rootBabylonMesh._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._rootBabylonMesh.setEnabled(!1);var n={_babylonTransformNode:this._rootBabylonMesh,index:-1};switch(this._parent.coordinateSystemMode){case a.GLTFLoaderCoordinateSystemMode.AUTO:this._babylonScene.useRightHandedSystem||(n.rotation=[0,1,0,0],n.scale=[1,1,-1],e._LoadTransform(n,this._rootBabylonMesh));break;case a.GLTFLoaderCoordinateSystemMode.FORCE_RIGHT_HANDED:this._babylonScene.useRightHandedSystem=!0;break;default:throw new Error("Invalid coordinate system mode (".concat(this._parent.coordinateSystemMode,")"))}return this._parent.onMeshLoadedObservable.notifyObservers(t),n},e.prototype.loadSceneAsync=function(e,t){var n=this,r=this._extensionsLoadSceneAsync(e,t);if(r)return r;var o=new Array;if(this.logOpen("".concat(e," ").concat(t.name||"")),t.nodes)for(var a=0,i=t.nodes;a<i.length;a++){var s=i[a],l=c.Get("".concat(e,"/nodes/").concat(s),this._gltf.nodes,s);o.push(this.loadNodeAsync("/nodes/".concat(l.index),l,(function(e){e.parent=n._rootBabylonMesh})))}for(var u=0,f=this._postSceneLoadActions;u<f.length;u++)(0,f[u])();return o.push(this._loadAnimationsAsync()),this.logClose(),Promise.all(o).then((function(){}))},e.prototype._forEachPrimitive=function(e,t){if(e._primitiveBabylonMeshes)for(var n=0,r=e._primitiveBabylonMeshes;n<r.length;n++)t(r[n])},e.prototype._getGeometries=function(){var e=[],t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];this._forEachPrimitive(o,(function(t){var n=t.geometry;n&&-1===e.indexOf(n)&&e.push(n)}))}return e},e.prototype._getMeshes=function(){var e=[];this._rootBabylonMesh instanceof o.AbstractMesh&&e.push(this._rootBabylonMesh);var t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var a=r[n];this._forEachPrimitive(a,(function(t){e.push(t)}))}return e},e.prototype._getTransformNodes=function(){var e=[],t=this._gltf.nodes;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];o._babylonTransformNode&&"TransformNode"===o._babylonTransformNode.getClassName()&&e.push(o._babylonTransformNode),o._babylonTransformNodeForSkin&&e.push(o._babylonTransformNodeForSkin)}return e},e.prototype._getSkeletons=function(){var e=[],t=this._gltf.skins;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];o._data&&e.push(o._data.babylonSkeleton)}return e},e.prototype._getAnimationGroups=function(){var e=[],t=this._gltf.animations;if(t)for(var n=0,r=t;n<r.length;n++){var o=r[n];o._babylonAnimationGroup&&e.push(o._babylonAnimationGroup)}return e},e.prototype._startAnimations=function(){switch(this._parent.animationStartMode){case a.GLTFLoaderAnimationStartMode.NONE:break;case a.GLTFLoaderAnimationStartMode.FIRST:0!==(e=this._getAnimationGroups()).length&&e[0].start(!0);break;case a.GLTFLoaderAnimationStartMode.ALL:for(var e,t=0,n=e=this._getAnimationGroups();t<n.length;t++)n[t].start(!0);break;default:return void o.Logger.Error("Invalid animation start mode (".concat(this._parent.animationStartMode,")"))}},e.prototype.loadNodeAsync=function(t,n,r){var a=this;void 0===r&&(r=function(){});var i=this._extensionsLoadNodeAsync(t,n,r);if(i)return i;if(n._babylonTransformNode)throw new Error("".concat(t,": Invalid recursive node hierarchy"));var s=new Array;this.logOpen("".concat(t," ").concat(n.name||""));var l=function(o){if(e.AddPointerMetadata(o,t),e._LoadTransform(n,o),null!=n.camera){var i=c.Get("".concat(t,"/camera"),a._gltf.cameras,n.camera);s.push(a.loadCameraAsync("/cameras/".concat(i.index),i,(function(e){e.parent=o,a._babylonScene.useRightHandedSystem||(o.scaling.x=-1)})))}if(n.children)for(var l=0,u=n.children;l<u.length;l++){var f=u[l],d=c.Get("".concat(t,"/children/").concat(f),a._gltf.nodes,f);s.push(a.loadNodeAsync("/nodes/".concat(d.index),d,(function(e){e.parent=o})))}r(o)},u=null!=n.mesh,f=this._parent.loadSkins&&null!=n.skin;if(!u||f){var d=n.name||"node".concat(n.index);this._babylonScene._blockEntityCollection=!!this._assetContainer;var h=new o.TransformNode(d,this._babylonScene);h._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,null==n.mesh?n._babylonTransformNode=h:n._babylonTransformNodeForSkin=h,l(h)}if(u)if(f){var p=c.Get("".concat(t,"/mesh"),this._gltf.meshes,n.mesh);s.push(this._loadMeshAsync("/meshes/".concat(p.index),n,p,(function(e){var r=n._babylonTransformNodeForSkin;e.metadata=(0,o.deepMerge)(r.metadata,e.metadata||{});var i=c.Get("".concat(t,"/skin"),a._gltf.skins,n.skin);s.push(a._loadSkinAsync("/skins/".concat(i.index),n,i,(function(t){a._forEachPrimitive(n,(function(e){e.skeleton=t})),a._postSceneLoadActions.push((function(){if(null!=i.skeleton){var t=c.Get("/skins/".concat(i.index,"/skeleton"),a._gltf.nodes,i.skeleton).parent;n.index===t.index?e.parent=r.parent:e.parent=t._babylonTransformNode}else e.parent=a._rootBabylonMesh;a._parent.onSkinLoadedObservable.notifyObservers({node:r,skinnedNode:e})}))})))})))}else p=c.Get("".concat(t,"/mesh"),this._gltf.meshes,n.mesh),s.push(this._loadMeshAsync("/meshes/".concat(p.index),n,p,l));return this.logClose(),Promise.all(s).then((function(){return a._forEachPrimitive(n,(function(e){var t=e;!t.isAnInstance&&t.geometry&&t.geometry.useBoundingInfoFromGeometry?e._updateBoundingInfo():e.refreshBoundingInfo(!0,!0)})),n._babylonTransformNode}))},e.prototype._loadMeshAsync=function(e,t,n,r){var a=n.primitives;if(!a||!a.length)throw new Error("".concat(e,": Primitives are missing"));null==a[0].index&&c.Assign(a);var i=new Array;this.logOpen("".concat(e," ").concat(n.name||""));var s=t.name||"node".concat(t.index);if(1===a.length){var l=n.primitives[0];i.push(this._loadMeshPrimitiveAsync("".concat(e,"/primitives/").concat(l.index),s,t,n,l,(function(e){t._babylonTransformNode=e,t._primitiveBabylonMeshes=[e]})))}else{this._babylonScene._blockEntityCollection=!!this._assetContainer,t._babylonTransformNode=new o.TransformNode(s,this._babylonScene),t._babylonTransformNode._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,t._primitiveBabylonMeshes=[];for(var u=0,f=a;u<f.length;u++)l=f[u],i.push(this._loadMeshPrimitiveAsync("".concat(e,"/primitives/").concat(l.index),"".concat(s,"_primitive").concat(l.index),t,n,l,(function(e){e.parent=t._babylonTransformNode,t._primitiveBabylonMeshes.push(e)})))}return r(t._babylonTransformNode),this.logClose(),Promise.all(i).then((function(){return t._babylonTransformNode}))},e.prototype._loadMeshPrimitiveAsync=function(t,n,a,i,s,l){var u=this,f=this._extensionsLoadMeshPrimitiveAsync(t,n,a,i,s,l);if(f)return f;this.logOpen("".concat(t));var d,h,p=0===this._disableInstancedMesh&&this._parent.createInstances&&null==a.skin&&!i.primitives[0].targets;if(p&&s._instanceData)this._babylonScene._blockEntityCollection=!!this._assetContainer,(d=s._instanceData.babylonSourceMesh.createInstance(n))._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,h=s._instanceData.promise;else{var m=new Array;this._babylonScene._blockEntityCollection=!!this._assetContainer;var _=new o.Mesh(n,this._babylonScene);if(_._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,_.sideOrientation=this._babylonScene.useRightHandedSystem?o.Material.CounterClockWiseSideOrientation:o.Material.ClockWiseSideOrientation,this._createMorphTargets(t,a,i,s,_),m.push(this._loadVertexDataAsync(t,s,_).then((function(e){return(0,r.sH)(u,void 0,void 0,(function(){var n=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return[4,this._loadMorphTargetsAsync(t,s,_,e).then((function(){n._disposed||(n._babylonScene._blockEntityCollection=!!n._assetContainer,e.applyToMesh(_),e._parentContainer=n._assetContainer,n._babylonScene._blockEntityCollection=!1)}))];case 1:return[2,r.sent()]}}))}))}))),!this.parent.skipMaterials){var g=e._GetDrawMode(t,s.mode);if(null==s.material){var b=this._defaultBabylonMaterialData[g];b||(b=this._createDefaultMaterial("__GLTFLoader._default",g),this._parent.onMaterialLoadedObservable.notifyObservers(b),this._defaultBabylonMaterialData[g]=b),_.material=b}else{var y=c.Get("".concat(t,"/material"),this._gltf.materials,s.material);m.push(this._loadMaterialAsync("/materials/".concat(y.index),y,_,g,(function(e){_.material=e})))}}h=Promise.all(m),p&&(s._instanceData={babylonSourceMesh:_,promise:h}),d=_}return e.AddPointerMetadata(d,t),this._parent.onMeshLoadedObservable.notifyObservers(d),l(d),this.logClose(),h.then((function(){return d}))},e.prototype._loadVertexDataAsync=function(e,t,n){var r=this,a=this._extensionsLoadVertexDataAsync(e,t,n);if(a)return a;var i=t.attributes;if(!i)throw new Error("".concat(e,": Attributes are missing"));var s=new Array,l=new o.Geometry(n.name,this._babylonScene);if(null==t.indices)n.isUnIndexed=!0;else{var u=c.Get("".concat(e,"/indices"),this._gltf.accessors,t.indices);s.push(this._loadIndicesAccessorAsync("/accessors/".concat(u.index),u).then((function(e){l.setIndices(e)})))}var d=function(t,a,u){if(null!=i[t]){n._delayInfo=n._delayInfo||[],-1===n._delayInfo.indexOf(a)&&n._delayInfo.push(a);var d=c.Get("".concat(e,"/attributes/").concat(t),r._gltf.accessors,i[t]);s.push(r._loadVertexAccessorAsync("/accessors/".concat(d.index),d,a).then((function(e){if(e.getKind()===o.VertexBuffer.PositionKind&&!r.parent.alwaysComputeBoundingBox&&!n.skeleton){var t=f(d);t&&(l._boundingInfo=t,l.useBoundingInfoFromGeometry=!0)}l.setVerticesBuffer(e,d.count)}))),a==o.VertexBuffer.MatricesIndicesExtraKind&&(n.numBoneInfluencers=8),u&&u(d)}};return d("POSITION",o.VertexBuffer.PositionKind),d("NORMAL",o.VertexBuffer.NormalKind),d("TANGENT",o.VertexBuffer.TangentKind),d("TEXCOORD_0",o.VertexBuffer.UVKind),d("TEXCOORD_1",o.VertexBuffer.UV2Kind),d("TEXCOORD_2",o.VertexBuffer.UV3Kind),d("TEXCOORD_3",o.VertexBuffer.UV4Kind),d("TEXCOORD_4",o.VertexBuffer.UV5Kind),d("TEXCOORD_5",o.VertexBuffer.UV6Kind),d("JOINTS_0",o.VertexBuffer.MatricesIndicesKind),d("WEIGHTS_0",o.VertexBuffer.MatricesWeightsKind),d("JOINTS_1",o.VertexBuffer.MatricesIndicesExtraKind),d("WEIGHTS_1",o.VertexBuffer.MatricesWeightsExtraKind),d("COLOR_0",o.VertexBuffer.ColorKind,(function(e){"VEC4"===e.type&&(n.hasVertexAlpha=!0)})),Promise.all(s).then((function(){return l}))},e.prototype._createMorphTargets=function(e,t,n,r,a){if(r.targets&&this._parent.loadMorphTargets){if(null==t._numMorphTargets)t._numMorphTargets=r.targets.length;else if(r.targets.length!==t._numMorphTargets)throw new Error("".concat(e,": Primitives do not have the same number of targets"));var i=n.extras?n.extras.targetNames:null;this._babylonScene._blockEntityCollection=!!this._assetContainer,a.morphTargetManager=new o.MorphTargetManager(this._babylonScene),a.morphTargetManager._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,a.morphTargetManager.areUpdatesFrozen=!0;for(var s=0;s<r.targets.length;s++){var l=t.weights?t.weights[s]:n.weights?n.weights[s]:0,u=i?i[s]:"morphTarget".concat(s);a.morphTargetManager.addTarget(new o.MorphTarget(u,l,a.getScene()))}}},e.prototype._loadMorphTargetsAsync=function(e,t,n,r){if(!t.targets||!this._parent.loadMorphTargets)return Promise.resolve();for(var o=new Array,a=n.morphTargetManager,i=0;i<a.numTargets;i++){var s=a.getTarget(i);o.push(this._loadMorphTargetVertexDataAsync("".concat(e,"/targets/").concat(i),r,t.targets[i],s))}return Promise.all(o).then((function(){a.areUpdatesFrozen=!1}))},e.prototype._loadMorphTargetVertexDataAsync=function(e,t,n,a){return(0,r.sH)(this,void 0,void 0,(function(){var i,s,l=this;return(0,r.YH)(this,(function(r){switch(r.label){case 0:return i=new Array,(s=function(r,o,a){if(null!=n[r]){var s=t.getVertexBuffer(o);if(s){var u=c.Get("".concat(e,"/").concat(r),l._gltf.accessors,n[r]);i.push(l._loadFloatAccessorAsync("/accessors/".concat(u.index),u).then((function(e){a(s,e)})))}}})("POSITION",o.VertexBuffer.PositionKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),a.setPositions(n)})),s("NORMAL",o.VertexBuffer.NormalKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(n.length,(function(e,r){n[r]=t[r]+e})),a.setNormals(n)})),s("TANGENT",o.VertexBuffer.TangentKind,(function(e,t){var n=new Float32Array(t.length/3*4),r=0;e.forEach(t.length/3*4,(function(e,o){(o+1)%4!=0&&(n[r]=t[r]+e,r++)})),a.setTangents(n)})),s("TEXCOORD_0",o.VertexBuffer.UVKind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),a.setUVs(n)})),s("TEXCOORD_1",o.VertexBuffer.UV2Kind,(function(e,t){var n=new Float32Array(t.length);e.forEach(t.length,(function(e,r){n[r]=t[r]+e})),a.setUV2s(n)})),s("COLOR_0",o.VertexBuffer.ColorKind,(function(t,n){var r=null,o=t.getSize();if(3===o){r=new Float32Array(n.length/3*4),t.forEach(n.length,(function(e,t){var o=Math.floor(t/3),a=t%3;r[4*o+a]=n[3*o+a]+e}));for(var i=0;i<n.length/3;++i)r[4*i+3]=1}else{if(4!==o)throw new Error("".concat(e,": Invalid number of components (").concat(o,") for COLOR_0 attribute"));r=new Float32Array(n.length),t.forEach(n.length,(function(e,t){r[t]=n[t]+e}))}a.setColors(r)})),[4,Promise.all(i).then((function(){}))];case 1:return[2,r.sent()]}}))}))},e._LoadTransform=function(e,t){if(null==e.skin){var n=o.Vector3.Zero(),r=o.Quaternion.Identity(),a=o.Vector3.One();e.matrix?o.Matrix.FromArray(e.matrix).decompose(a,r,n):(e.translation&&(n=o.Vector3.FromArray(e.translation)),e.rotation&&(r=o.Quaternion.FromArray(e.rotation)),e.scale&&(a=o.Vector3.FromArray(e.scale))),t.position=n,t.rotationQuaternion=r,t.scaling=a}},e.prototype._loadSkinAsync=function(e,t,n,r){var a=this;if(!this._parent.loadSkins)return Promise.resolve();var i=this._extensionsLoadSkinAsync(e,t,n);if(i)return i;if(n._data)return r(n._data.babylonSkeleton),n._data.promise;var s="skeleton".concat(n.index);this._babylonScene._blockEntityCollection=!!this._assetContainer;var l=new o.Skeleton(n.name||s,s,this._babylonScene);l._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,this._loadBones(e,n,l);var u=this._loadSkinInverseBindMatricesDataAsync(e,n).then((function(e){a._updateBoneMatrices(l,e)}));return n._data={babylonSkeleton:l,promise:u},r(l),u},e.prototype._loadBones=function(e,t,n){if(null==t.skeleton||this._parent.alwaysComputeSkeletonRootNode){var r=this._findSkeletonRootNode("".concat(e,"/joints"),t.joints);if(r)if(void 0===t.skeleton)t.skeleton=r.index;else{var a=c.Get("".concat(e,"/skeleton"),this._gltf.nodes,t.skeleton);a===r||function(e,t){for(;t.parent;t=t.parent)if(t.parent===e)return!0;return!1}(a,r)||(o.Logger.Warn("".concat(e,"/skeleton: Overriding with nearest common ancestor as skeleton node is not a common root")),t.skeleton=r.index)}else o.Logger.Warn("".concat(e,": Failed to find common root"))}for(var i={},s=0,l=t.joints;s<l.length;s++){var u=l[s],f=c.Get("".concat(e,"/joints/").concat(u),this._gltf.nodes,u);this._loadBone(f,t,n,i)}},e.prototype._findSkeletonRootNode=function(e,t){if(0===t.length)return null;for(var n={},r=0,o=t;r<o.length;r++){for(var a=o[r],i=[],s=c.Get("".concat(e,"/").concat(a),this._gltf.nodes,a);-1!==s.index;)i.unshift(s),s=s.parent;n[a]=i}for(var l=null,u=0;;++u){if(u>=(i=n[t[0]]).length)return l;s=i[u];for(var f=1;f<t.length;++f)if(u>=(i=n[t[f]]).length||s!==i[u])return l;l=s}},e.prototype._loadBone=function(e,t,n,r){e._isJoint=!0;var a=r[e.index];if(a)return a;var i=null;e.index!==t.skeleton&&(e.parent&&-1!==e.parent.index?i=this._loadBone(e.parent,t,n,r):void 0!==t.skeleton&&o.Logger.Warn("/skins/".concat(t.index,"/skeleton: Skeleton node is not a common root")));var s=t.joints.indexOf(e.index);return a=new o.Bone(e.name||"joint".concat(e.index),n,i,this._getNodeMatrix(e),null,null,s),r[e.index]=a,this._postSceneLoadActions.push((function(){a.linkTransformNode(e._babylonTransformNode)})),a},e.prototype._loadSkinInverseBindMatricesDataAsync=function(e,t){if(null==t.inverseBindMatrices)return Promise.resolve(null);var n=c.Get("".concat(e,"/inverseBindMatrices"),this._gltf.accessors,t.inverseBindMatrices);return this._loadFloatAccessorAsync("/accessors/".concat(n.index),n)},e.prototype._updateBoneMatrices=function(e,t){for(var n=0,r=e.bones;n<r.length;n++){var a=r[n],i=o.Matrix.Identity(),s=a._index;t&&-1!==s&&(o.Matrix.FromArrayToRef(t,16*s,i),i.invertToRef(i));var l=a.getParent();l&&i.multiplyToRef(l.getAbsoluteInverseBindMatrix(),i),a.updateMatrix(i,!1,!1),a._updateAbsoluteBindMatrices(void 0,!1)}},e.prototype._getNodeMatrix=function(e){return e.matrix?o.Matrix.FromArray(e.matrix):o.Matrix.Compose(e.scale?o.Vector3.FromArray(e.scale):o.Vector3.One(),e.rotation?o.Quaternion.FromArray(e.rotation):o.Quaternion.Identity(),e.translation?o.Vector3.FromArray(e.translation):o.Vector3.Zero())},e.prototype.loadCameraAsync=function(t,n,r){void 0===r&&(r=function(){});var a=this._extensionsLoadCameraAsync(t,n,r);if(a)return a;var i=new Array;this.logOpen("".concat(t," ").concat(n.name||"")),this._babylonScene._blockEntityCollection=!!this._assetContainer;var s=new o.FreeCamera(n.name||"camera".concat(n.index),o.Vector3.Zero(),this._babylonScene,!1);switch(s._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,n._babylonCamera=s,s.setTarget(new o.Vector3(0,0,-1)),n.type){case"perspective":var l=n.perspective;if(!l)throw new Error("".concat(t,": Camera perspective properties are missing"));s.fov=l.yfov,s.minZ=l.znear,s.maxZ=l.zfar||0;break;case"orthographic":if(!n.orthographic)throw new Error("".concat(t,": Camera orthographic properties are missing"));s.mode=o.Camera.ORTHOGRAPHIC_CAMERA,s.orthoLeft=-n.orthographic.xmag,s.orthoRight=n.orthographic.xmag,s.orthoBottom=-n.orthographic.ymag,s.orthoTop=n.orthographic.ymag,s.minZ=n.orthographic.znear,s.maxZ=n.orthographic.zfar;break;default:throw new Error("".concat(t,": Invalid camera type (").concat(n.type,")"))}return e.AddPointerMetadata(s,t),this._parent.onCameraLoadedObservable.notifyObservers(s),r(s),this.logClose(),Promise.all(i).then((function(){return s}))},e.prototype._loadAnimationsAsync=function(){var e=this;this._parent._startPerformanceCounter("Load animations");var t=this._gltf.animations;if(!t)return Promise.resolve();for(var n=new Array,r=0;r<t.length;r++){var o=t[r];n.push(this.loadAnimationAsync("/animations/".concat(o.index),o).then((function(e){0===e.targetedAnimations.length&&e.dispose()})))}return Promise.all(n).then((function(){e._parent._endPerformanceCounter("Load animations")}))},e.prototype.loadAnimationAsync=function(e,t){var n=this;return this._parent._startPerformanceCounter("Load animation"),this._extensionsLoadAnimationAsync(e,t)||l.value.then((function(r){var o=r.AnimationGroup;n._babylonScene._blockEntityCollection=!!n._assetContainer;var a=new o(t.name||"animation".concat(t.index),n._babylonScene);a._parentContainer=n._assetContainer,n._babylonScene._blockEntityCollection=!1,t._babylonAnimationGroup=a;var i=new Array;c.Assign(t.channels),c.Assign(t.samplers);for(var s=0,l=t.channels;s<l.length;s++){var u=l[s];i.push(n._loadAnimationChannelAsync("".concat(e,"/channels/").concat(u.index),e,t,u,(function(e,t){e.animations=e.animations||[],e.animations.push(t),a.addTargetedAnimation(t,e)})))}return n._parent._endPerformanceCounter("Load animation"),Promise.all(i).then((function(){return a.normalize(0),a}))}))},e.prototype._loadAnimationChannelAsync=function(e,t,n,r,o){var a=this,i=this._extensionsLoadAnimationChannelAsync(e,t,n,r,o);if(i)return i;if(null==r.target.node)return Promise.resolve();var l=c.Get("".concat(e,"/target/node"),this._gltf.nodes,r.target.node),f=r.target.path,d="weights"===f;return d&&!l._numMorphTargets||!d&&!l._babylonTransformNode?Promise.resolve():this._parent.loadNodeAnimations||d||l._isJoint?u.value.then((function(){var i,u,c,d,h;switch(f){case"translation":h=null===(i=(0,s.tQ)("/nodes/{}/translation"))||void 0===i?void 0:i.interpolation;break;case"rotation":h=null===(u=(0,s.tQ)("/nodes/{}/rotation"))||void 0===u?void 0:u.interpolation;break;case"scale":h=null===(c=(0,s.tQ)("/nodes/{}/scale"))||void 0===c?void 0:c.interpolation;break;case"weights":h=null===(d=(0,s.tQ)("/nodes/{}/weights"))||void 0===d?void 0:d.interpolation;break;default:throw new Error("".concat(e,"/target/path: Invalid value (").concat(r.target.path,")"))}if(!h)throw new Error("".concat(e,"/target/path: Could not find interpolation properties for target path (").concat(r.target.path,")"));var p={object:l,info:h};return a._loadAnimationChannelFromTargetInfoAsync(e,t,n,r,p,o)})):Promise.resolve()},e.prototype._loadAnimationChannelFromTargetInfoAsync=function(e,t,n,r,o,a){var i=this.parent.targetFps,s=1/i,l=c.Get("".concat(e,"/sampler"),n.samplers,r.sampler);return this._loadAnimationSamplerAsync("".concat(t,"/samplers/").concat(r.sampler),l).then((function(e){for(var t=0,l=o.object,u=0,c=o.info;u<c.length;u++){var f=c[u],d=f.getStride(l),h=e.input,p=e.output,m=new Array(h.length),_=0;switch(e.interpolation){case"STEP":for(var g=0;g<h.length;g++){var b=f.getValue(l,p,_,1);_+=d,m[g]={frame:h[g]*i,value:b,interpolation:1}}break;case"CUBICSPLINE":for(g=0;g<h.length;g++){var y=f.getValue(l,p,_,s);_+=d,b=f.getValue(l,p,_,1),_+=d;var v=f.getValue(l,p,_,s);_+=d,m[g]={frame:h[g]*i,inTangent:y,value:b,outTangent:v}}break;case"LINEAR":for(g=0;g<h.length;g++)b=f.getValue(l,p,_,1),_+=d,m[g]={frame:h[g]*i,value:b}}if(_>0)for(var T="".concat(n.name||"animation".concat(n.index),"_channel").concat(r.index,"_").concat(t),x=0,A=f.buildAnimations(l,T,i,m);x<A.length;x++){var w=A[x];t++,a(w.babylonAnimatable,w.babylonAnimation)}}}))},e.prototype._loadAnimationSamplerAsync=function(e,t){if(t._data)return t._data;var n=t.interpolation||"LINEAR";switch(n){case"STEP":case"LINEAR":case"CUBICSPLINE":break;default:throw new Error("".concat(e,"/interpolation: Invalid value (").concat(t.interpolation,")"))}var r=c.Get("".concat(e,"/input"),this._gltf.accessors,t.input),o=c.Get("".concat(e,"/output"),this._gltf.accessors,t.output);return t._data=Promise.all([this._loadFloatAccessorAsync("/accessors/".concat(r.index),r),this._loadFloatAccessorAsync("/accessors/".concat(o.index),o)]).then((function(e){var t=e[0],r=e[1];return{input:t,interpolation:n,output:r}})),t._data},e.prototype.loadBufferAsync=function(e,t,n,r){var o=this._extensionsLoadBufferAsync(e,t,n,r);if(o)return o;if(!t._data)if(t.uri)t._data=this.loadUriAsync("".concat(e,"/uri"),t,t.uri);else{if(!this._bin)throw new Error("".concat(e,": Uri is missing or the binary glTF is missing its binary chunk"));t._data=this._bin.readAsync(0,t.byteLength)}return t._data.then((function(t){try{return new Uint8Array(t.buffer,t.byteOffset+n,r)}catch(t){throw new Error("".concat(e,": ").concat(t.message),{cause:t})}}))},e.prototype.loadBufferViewAsync=function(e,t){var n=this._extensionsLoadBufferViewAsync(e,t);if(n)return n;if(t._data)return t._data;var r=c.Get("".concat(e,"/buffer"),this._gltf.buffers,t.buffer);return t._data=this.loadBufferAsync("/buffers/".concat(r.index),r,t.byteOffset||0,t.byteLength),t._data},e.prototype._loadAccessorAsync=function(t,n,r){var a=this;if(n._data)return n._data;var i=e._GetNumComponents(t,n.type),s=i*o.VertexBuffer.GetTypeByteLength(n.componentType),l=i*n.count;if(null==n.bufferView)n._data=Promise.resolve(new r(l));else{var u=c.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,n.bufferView);n._data=this.loadBufferViewAsync("/bufferViews/".concat(u.index),u).then((function(a){if(5126!==n.componentType||n.normalized||u.byteStride&&u.byteStride!==s){var c=new r(l);return o.VertexBuffer.ForEach(a,n.byteOffset||0,u.byteStride||s,i,n.componentType,c.length,n.normalized||!1,(function(e,t){c[t]=e})),c}return e._GetTypedArray(t,n.componentType,a,n.byteOffset,l)}))}if(n.sparse){var f=n.sparse;n._data=n._data.then((function(l){var u=l,d=c.Get("".concat(t,"/sparse/indices/bufferView"),a._gltf.bufferViews,f.indices.bufferView),h=c.Get("".concat(t,"/sparse/values/bufferView"),a._gltf.bufferViews,f.values.bufferView);return Promise.all([a.loadBufferViewAsync("/bufferViews/".concat(d.index),d),a.loadBufferViewAsync("/bufferViews/".concat(h.index),h)]).then((function(a){var l,c=a[0],d=a[1],h=e._GetTypedArray("".concat(t,"/sparse/indices"),f.indices.componentType,c,f.indices.byteOffset,f.count),p=i*f.count;if(5126!==n.componentType||n.normalized){var m=e._GetTypedArray("".concat(t,"/sparse/values"),n.componentType,d,f.values.byteOffset,p);l=new r(p),o.VertexBuffer.ForEach(m,0,s,i,n.componentType,l.length,n.normalized||!1,(function(e,t){l[t]=e}))}else l=e._GetTypedArray("".concat(t,"/sparse/values"),n.componentType,d,f.values.byteOffset,p);for(var _=0,g=0;g<h.length;g++)for(var b=h[g]*i,y=0;y<i;y++)u[b++]=l[_++];return u}))}))}return n._data},e.prototype._loadFloatAccessorAsync=function(e,t){return this._loadAccessorAsync(e,t,Float32Array)},e.prototype._loadIndicesAccessorAsync=function(t,n){if("SCALAR"!==n.type)throw new Error("".concat(t,"/type: Invalid value ").concat(n.type));if(5121!==n.componentType&&5123!==n.componentType&&5125!==n.componentType)throw new Error("".concat(t,"/componentType: Invalid value ").concat(n.componentType));if(n._data)return n._data;if(n.sparse){var r=e._GetTypedArrayConstructor("".concat(t,"/componentType"),n.componentType);n._data=this._loadAccessorAsync(t,n,r)}else{var o=c.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,n.bufferView);n._data=this.loadBufferViewAsync("/bufferViews/".concat(o.index),o).then((function(r){return e._GetTypedArray(t,n.componentType,r,n.byteOffset,n.count)}))}return n._data},e.prototype._loadVertexBufferViewAsync=function(e){if(e._babylonBuffer)return e._babylonBuffer;var t=this._babylonScene.getEngine();return e._babylonBuffer=this.loadBufferViewAsync("/bufferViews/".concat(e.index),e).then((function(e){return new o.Buffer(t,e,!1)})),e._babylonBuffer},e.prototype._loadVertexAccessorAsync=function(t,n,r){var a;if(null===(a=n._babylonVertexBuffer)||void 0===a?void 0:a[r])return n._babylonVertexBuffer[r];n._babylonVertexBuffer||(n._babylonVertexBuffer={});var i=this._babylonScene.getEngine();if(n.sparse||null==n.bufferView)n._babylonVertexBuffer[r]=this._loadFloatAccessorAsync(t,n).then((function(e){return new o.VertexBuffer(i,e,r,!1)}));else{var s=c.Get("".concat(t,"/bufferView"),this._gltf.bufferViews,n.bufferView);n._babylonVertexBuffer[r]=this._loadVertexBufferViewAsync(s).then((function(a){var l=e._GetNumComponents(t,n.type);return new o.VertexBuffer(i,a,r,!1,void 0,s.byteStride,void 0,n.byteOffset,l,n.componentType,n.normalized,!0,void 0,!0)}))}return n._babylonVertexBuffer[r]},e.prototype._loadMaterialMetallicRoughnessPropertiesAsync=function(e,t,n){var r=new Array,a=this._getOrCreateMaterialAdapter(n);return t&&(t.baseColorFactor?(a.baseColor=o.Color3.FromArray(t.baseColorFactor),a.geometryOpacity=t.baseColorFactor[3]):a.baseColor=o.Color3.White(),a.baseMetalness=null==t.metallicFactor?1:t.metallicFactor,a.specularRoughness=null==t.roughnessFactor?1:t.roughnessFactor,t.baseColorTexture&&r.push(this.loadTextureInfoAsync("".concat(e,"/baseColorTexture"),t.baseColorTexture,(function(e){e.name="".concat(n.name," (Base Color)"),a.baseColorTexture=e}))),t.metallicRoughnessTexture&&(t.metallicRoughnessTexture.nonColorData=!0,r.push(this.loadTextureInfoAsync("".concat(e,"/metallicRoughnessTexture"),t.metallicRoughnessTexture,(function(e){e.name="".concat(n.name," (Metallic Roughness)"),a.baseMetalnessTexture=e,a.specularRoughnessTexture=e}))),a.useRoughnessFromMetallicTextureGreen=!0,a.useMetallicFromMetallicTextureBlue=!0)),Promise.all(r).then((function(){}))},e.prototype._loadMaterialAsync=function(t,n,r,o,a){void 0===a&&(a=function(){});var i=this._extensionsLoadMaterialAsync(t,n,r,o,a);if(i)return i;n._data=n._data||{};var s=n._data[o];if(!s){this.logOpen("".concat(t," ").concat(n.name||""));var l=this.createMaterial(t,n,o);s={babylonMaterial:l,babylonMeshes:[],promise:this.loadMaterialPropertiesAsync(t,n,l)},n._data[o]=s,e.AddPointerMetadata(l,t),this._parent.onMaterialLoadedObservable.notifyObservers(l),this.logClose()}return r&&(s.babylonMeshes.push(r),r.onDisposeObservable.addOnce((function(){var e=s.babylonMeshes.indexOf(r);-1!==e&&s.babylonMeshes.splice(e,1)}))),a(s.babylonMaterial),s.promise.then((function(){return s.babylonMaterial}))},e.prototype._createDefaultMaterial=function(e,t){if(!this._pbrMaterialImpl)throw new Error("PBR Material class not loaded");this._babylonScene._blockEntityCollection=!!this._assetContainer;var n=new this._pbrMaterialImpl.materialClass(e,this._babylonScene);n._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,n.fillMode=t,n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_OPAQUE;var r=this._getOrCreateMaterialAdapter(n);return r.transparencyAsAlphaCoverage=this._parent.transparencyAsCoverage,r.baseMetalness=1,r.specularRoughness=1,n},e.prototype.createMaterial=function(e,t,n){var r=this._extensionsCreateMaterial(e,t,n);if(r)return r;var o=t.name||"material".concat(t.index);return this._createDefaultMaterial(o,n)},e.prototype.loadMaterialPropertiesAsync=function(e,t,n){var r=this._extensionsLoadMaterialPropertiesAsync(e,t,n);if(r)return r;var o=new Array;return o.push(this.loadMaterialBasePropertiesAsync(e,t,n)),t.pbrMetallicRoughness&&o.push(this._loadMaterialMetallicRoughnessPropertiesAsync("".concat(e,"/pbrMetallicRoughness"),t.pbrMetallicRoughness,n)),this.loadMaterialAlphaProperties(e,t,n),Promise.all(o).then((function(){}))},e.prototype.loadMaterialBasePropertiesAsync=function(e,t,n){var r,a=new Array,i=this._getOrCreateMaterialAdapter(n);i.emissionColor=t.emissiveFactor?o.Color3.FromArray(t.emissiveFactor):new o.Color3(0,0,0),t.doubleSided&&(i.backFaceCulling=!1,i.twoSidedLighting=!0),t.normalTexture&&(t.normalTexture.nonColorData=!0,a.push(this.loadTextureInfoAsync("".concat(e,"/normalTexture"),t.normalTexture,(function(e){var r;e.name="".concat(n.name," (Normal)"),i.geometryNormalTexture=e,null!=(null===(r=t.normalTexture)||void 0===r?void 0:r.scale)&&(e.level=t.normalTexture.scale)}))),i.setNormalMapInversions(!this._babylonScene.useRightHandedSystem,this._babylonScene.useRightHandedSystem));var s,l=1;return t.occlusionTexture&&(t.occlusionTexture.nonColorData=!0,a.push(this.loadTextureInfoAsync("".concat(e,"/occlusionTexture"),t.occlusionTexture,(function(e){e.name="".concat(n.name," (Occlusion)"),r=e}))),null!=t.occlusionTexture.strength&&(l=t.occlusionTexture.strength)),t.emissiveTexture&&a.push(this.loadTextureInfoAsync("".concat(e,"/emissiveTexture"),t.emissiveTexture,(function(e){e.name="".concat(n.name," (Emissive)"),s=e}))),Promise.all(a).then((function(){r&&(i.ambientOcclusionTexture=r,i.ambientOcclusionTextureStrength=l),s&&(i.emissionColorTexture=s)}))},e.prototype.loadMaterialAlphaProperties=function(e,t,n){if(!this._pbrMaterialImpl)throw new Error("".concat(e,": Material type not supported"));var r=this._getOrCreateMaterialAdapter(n),o=r.baseColorTexture;switch(t.alphaMode||"OPAQUE"){case"OPAQUE":n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_OPAQUE,n.alpha=1;break;case"MASK":n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_ALPHATEST,r.alphaCutOff=null==t.alphaCutoff?.5:t.alphaCutoff,o&&(o.hasAlpha=!0);break;case"BLEND":n.transparencyMode=this._pbrMaterialImpl.materialClass.MATERIAL_ALPHABLEND,o&&(o.hasAlpha=!0,r.useAlphaFromBaseColorTexture=!0);break;default:throw new Error("".concat(e,"/alphaMode: Invalid value (").concat(t.alphaMode,")"))}},e.prototype.loadTextureInfoAsync=function(t,n,r){var o=this;void 0===r&&(r=function(){});var a=this._extensionsLoadTextureInfoAsync(t,n,r);if(a)return a;if(this.logOpen("".concat(t)),n.texCoord>=6)throw new Error("".concat(t,"/texCoord: Invalid value (").concat(n.texCoord,")"));var i=c.Get("".concat(t,"/index"),this._gltf.textures,n.index);i._textureInfo=n;var s=this._loadTextureAsync("/textures/".concat(n.index),i,(function(a){a.coordinatesIndex=n.texCoord||0,e.AddPointerMetadata(a,t),o._parent.onTextureLoadedObservable.notifyObservers(a),r(a)}));return this.logClose(),s},e.prototype._loadTextureAsync=function(t,n,r){void 0===r&&(r=function(){});var o=this._extensionsLoadTextureAsync(t,n,r);if(o)return o;this.logOpen("".concat(t," ").concat(n.name||""));var a=null==n.sampler?e.DefaultSampler:c.Get("".concat(t,"/sampler"),this._gltf.samplers,n.sampler),i=c.Get("".concat(t,"/source"),this._gltf.images,n.source),s=this._createTextureAsync(t,a,i,r,void 0,!n._textureInfo.nonColorData);return this.logClose(),s},e.prototype._createTextureAsync=function(e,t,n,r,a,i){var s,l,u=this;void 0===r&&(r=function(){});var c=this._loadSampler("/samplers/".concat(t.index),t),f=new Array,d=new o.Deferred;this._babylonScene._blockEntityCollection=!!this._assetContainer;var h={noMipmap:c.noMipMaps,invertY:!1,samplingMode:c.samplingMode,onLoad:function(){u._disposed||d.resolve()},onError:function(t,n){u._disposed||d.reject(new Error("".concat(e,": ").concat(n&&n.message?n.message:t||"Failed to load texture")))},mimeType:null!==(s=n.mimeType)&&void 0!==s?s:(0,o.GetMimeType)(null!==(l=n.uri)&&void 0!==l?l:""),loaderOptions:a,useSRGBBuffer:!!i&&this._parent.useSRGBBuffers},p=new o.Texture(null,this._babylonScene,h);return p._parentContainer=this._assetContainer,this._babylonScene._blockEntityCollection=!1,f.push(d.promise),f.push(this.loadImageAsync("/images/".concat(n.index),n).then((function(e){var t=n.uri||"".concat(u._fileName,"#image").concat(n.index),r="data:".concat(u._uniqueRootUrl).concat(t);p.updateURL(r,e);var o=p.getInternalTexture();o&&(o.label=n.name)}))),p.wrapU=c.wrapU,p.wrapV=c.wrapV,r(p),this._parent.useGltfTextureNames&&(p.name=n.name||n.uri||"image".concat(n.index)),Promise.all(f).then((function(){return p}))},e.prototype._loadSampler=function(t,n){return n._data||(n._data={noMipMaps:9728===n.minFilter||9729===n.minFilter,samplingMode:e._GetTextureSamplingMode(t,n),wrapU:e._GetTextureWrapMode("".concat(t,"/wrapS"),n.wrapS),wrapV:e._GetTextureWrapMode("".concat(t,"/wrapT"),n.wrapT)}),n._data},e.prototype.loadImageAsync=function(e,t){if(!t._data){if(this.logOpen("".concat(e," ").concat(t.name||"")),t.uri)t._data=this.loadUriAsync("".concat(e,"/uri"),t,t.uri);else{var n=c.Get("".concat(e,"/bufferView"),this._gltf.bufferViews,t.bufferView);t._data=this.loadBufferViewAsync("/bufferViews/".concat(n.index),n)}this.logClose()}return t._data},e.prototype.loadUriAsync=function(t,n,r){var a=this,i=this._extensionsLoadUriAsync(t,n,r);if(i)return i;if(!e._ValidateUri(r))throw new Error("".concat(t,": '").concat(r,"' is invalid"));if((0,o.IsBase64DataUrl)(r)){var s=new Uint8Array((0,o.DecodeBase64UrlToBinary)(r));return this.log("".concat(t,": Decoded ").concat(r.substring(0,64),"... (").concat(s.length," bytes)")),Promise.resolve(s)}return this.log("".concat(t,": Loading ").concat(r)),this._parent.preprocessUrlAsync(this._rootUrl+r).then((function(e){return new Promise((function(n,i){a._parent._loadFile(a._babylonScene,e,(function(e){a._disposed||(a.log("".concat(t,": Loaded ").concat(r," (").concat(e.byteLength," bytes)")),n(new Uint8Array(e)))}),!0,(function(e){i(new o.LoadFileError("".concat(t,": Failed to load '").concat(r,"'").concat(e?": "+e.status+" "+e.statusText:""),e))}))}))}))},e.AddPointerMetadata=function(e,t){e.metadata=e.metadata||{};var n=e._internalMetadata=e._internalMetadata||{},r=n.gltf=n.gltf||{};(r.pointers=r.pointers||[]).push(t)},e._GetTextureWrapMode=function(e,t){switch(t=null==t?10497:t){case 33071:return o.Texture.CLAMP_ADDRESSMODE;case 33648:return o.Texture.MIRROR_ADDRESSMODE;case 10497:return o.Texture.WRAP_ADDRESSMODE;default:return o.Logger.Warn("".concat(e,": Invalid value (").concat(t,")")),o.Texture.WRAP_ADDRESSMODE}},e._GetTextureSamplingMode=function(e,t){var n=null==t.magFilter?9729:t.magFilter,r=null==t.minFilter?9987:t.minFilter;if(9729===n)switch(r){case 9728:return o.Texture.LINEAR_NEAREST;case 9729:return o.Texture.LINEAR_LINEAR;case 9984:return o.Texture.LINEAR_NEAREST_MIPNEAREST;case 9985:return o.Texture.LINEAR_LINEAR_MIPNEAREST;case 9986:return o.Texture.LINEAR_NEAREST_MIPLINEAR;case 9987:return o.Texture.LINEAR_LINEAR_MIPLINEAR;default:return o.Logger.Warn("".concat(e,"/minFilter: Invalid value (").concat(r,")")),o.Texture.LINEAR_LINEAR_MIPLINEAR}else switch(9728!==n&&o.Logger.Warn("".concat(e,"/magFilter: Invalid value (").concat(n,")")),r){case 9728:return o.Texture.NEAREST_NEAREST;case 9729:return o.Texture.NEAREST_LINEAR;case 9984:return o.Texture.NEAREST_NEAREST_MIPNEAREST;case 9985:return o.Texture.NEAREST_LINEAR_MIPNEAREST;case 9986:return o.Texture.NEAREST_NEAREST_MIPLINEAR;case 9987:return o.Texture.NEAREST_LINEAR_MIPLINEAR;default:return o.Logger.Warn("".concat(e,"/minFilter: Invalid value (").concat(r,")")),o.Texture.NEAREST_NEAREST_MIPNEAREST}},e._GetTypedArrayConstructor=function(e,t){try{return(0,o.GetTypedArrayConstructor)(t)}catch(t){throw new Error("".concat(e,": ").concat(t.message),{cause:t})}},e._GetTypedArray=function(t,n,r,a,i){var s=r.buffer;a=r.byteOffset+(a||0);var l=e._GetTypedArrayConstructor("".concat(t,"/componentType"),n),u=o.VertexBuffer.GetTypeByteLength(n);return a%u!==0?(o.Logger.Warn("".concat(t,": Copying buffer as byte offset (").concat(a,") is not a multiple of component type byte length (").concat(u,")")),new l(s.slice(a,a+i*u),0)):new l(s,a,i)},e._GetNumComponents=function(e,t){switch(t){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}throw new Error("".concat(e,": Invalid type (").concat(t,")"))},e._ValidateUri=function(e){return o.Tools.IsBase64(e)||-1===e.indexOf("..")},e._GetDrawMode=function(e,t){switch(null==t&&(t=4),t){case 0:return o.Material.PointListDrawMode;case 1:return o.Material.LineListDrawMode;case 2:return o.Material.LineLoopDrawMode;case 3:return o.Material.LineStripDrawMode;case 4:return o.Material.TriangleFillMode;case 5:return o.Material.TriangleStripDrawMode;case 6:return o.Material.TriangleFanDrawMode}throw new Error("".concat(e,": Invalid mesh primitive mode (").concat(t,")"))},e.prototype._compileMaterialsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile materials");var t=new Array;if(this._gltf.materials)for(var n=0,r=this._gltf.materials;n<r.length;n++){var o=r[n];if(o._data)for(var a in o._data)for(var i=o._data[a],s=0,l=i.babylonMeshes;s<l.length;s++){var u=l[s];u.computeWorldMatrix(!0);var c=i.babylonMaterial;t.push(c.forceCompilationAsync(u)),t.push(c.forceCompilationAsync(u,{useInstances:!0})),this._parent.useClipPlane&&(t.push(c.forceCompilationAsync(u,{clipPlane:!0})),t.push(c.forceCompilationAsync(u,{clipPlane:!0,useInstances:!0})))}}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile materials")}))},e.prototype._compileShadowGeneratorsAsync=function(){var e=this;this._parent._startPerformanceCounter("Compile shadow generators");for(var t=new Array,n=0,r=this._babylonScene.lights;n<r.length;n++){var o=r[n].getShadowGenerator();o&&t.push(o.forceCompilationAsync())}return Promise.all(t).then((function(){e._parent._endPerformanceCounter("Compile shadow generators")}))},e.prototype._forEachExtensions=function(e){for(var t=0,n=this._extensions;t<n.length;t++){var r=n[t];r.enabled&&e(r)}},e.prototype._applyExtensions=function(e,t,n){for(var r=0,o=this._extensions;r<o.length;r++){var a=o[r];if(a.enabled){var i="".concat(a.name,".").concat(t),s=e;s._activeLoaderExtensionFunctions=s._activeLoaderExtensionFunctions||{};var l=s._activeLoaderExtensionFunctions;if(!l[i]){l[i]=!0;try{var u=n(a);if(u)return u}finally{delete l[i]}}}}return null},e.prototype._extensionsOnLoading=function(){this._forEachExtensions((function(e){return e.onLoading&&e.onLoading()}))},e.prototype._extensionsOnReady=function(){this._forEachExtensions((function(e){return e.onReady&&e.onReady()}))},e.prototype._extensionsLoadSceneAsync=function(e,t){return this._applyExtensions(t,"loadScene",(function(n){return n.loadSceneAsync&&n.loadSceneAsync(e,t)}))},e.prototype._extensionsLoadNodeAsync=function(e,t,n){return this._applyExtensions(t,"loadNode",(function(r){return r.loadNodeAsync&&r.loadNodeAsync(e,t,n)}))},e.prototype._extensionsLoadCameraAsync=function(e,t,n){return this._applyExtensions(t,"loadCamera",(function(r){return r.loadCameraAsync&&r.loadCameraAsync(e,t,n)}))},e.prototype._extensionsLoadVertexDataAsync=function(e,t,n){return this._applyExtensions(t,"loadVertexData",(function(r){return r._loadVertexDataAsync&&r._loadVertexDataAsync(e,t,n)}))},e.prototype._extensionsLoadMeshPrimitiveAsync=function(e,t,n,r,o,a){return this._applyExtensions(o,"loadMeshPrimitive",(function(i){return i._loadMeshPrimitiveAsync&&i._loadMeshPrimitiveAsync(e,t,n,r,o,a)}))},e.prototype._extensionsLoadMaterialAsync=function(e,t,n,r,o){return this._applyExtensions(t,"loadMaterial",(function(a){return a._loadMaterialAsync&&a._loadMaterialAsync(e,t,n,r,o)}))},e.prototype._extensionsCreateMaterial=function(e,t,n){return this._applyExtensions(t,"createMaterial",(function(r){return r.createMaterial&&r.createMaterial(e,t,n)}))},e.prototype._extensionsLoadMaterialPropertiesAsync=function(e,t,n){return this._applyExtensions(t,"loadMaterialProperties",(function(r){return r.loadMaterialPropertiesAsync&&r.loadMaterialPropertiesAsync(e,t,n)}))},e.prototype._extensionsLoadTextureInfoAsync=function(e,t,n){return this._applyExtensions(t,"loadTextureInfo",(function(r){return r.loadTextureInfoAsync&&r.loadTextureInfoAsync(e,t,n)}))},e.prototype._extensionsLoadTextureAsync=function(e,t,n){return this._applyExtensions(t,"loadTexture",(function(r){return r._loadTextureAsync&&r._loadTextureAsync(e,t,n)}))},e.prototype._extensionsLoadAnimationAsync=function(e,t){return this._applyExtensions(t,"loadAnimation",(function(n){return n.loadAnimationAsync&&n.loadAnimationAsync(e,t)}))},e.prototype._extensionsLoadAnimationChannelAsync=function(e,t,n,r,o){return this._applyExtensions(n,"loadAnimationChannel",(function(a){return a._loadAnimationChannelAsync&&a._loadAnimationChannelAsync(e,t,n,r,o)}))},e.prototype._extensionsLoadSkinAsync=function(e,t,n){return this._applyExtensions(n,"loadSkin",(function(r){return r._loadSkinAsync&&r._loadSkinAsync(e,t,n)}))},e.prototype._extensionsLoadUriAsync=function(e,t,n){return this._applyExtensions(t,"loadUri",(function(r){return r._loadUriAsync&&r._loadUriAsync(e,t,n)}))},e.prototype._extensionsLoadBufferViewAsync=function(e,t){return this._applyExtensions(t,"loadBufferView",(function(n){return n.loadBufferViewAsync&&n.loadBufferViewAsync(e,t)}))},e.prototype._extensionsLoadBufferAsync=function(e,t,n,r){return this._applyExtensions(t,"loadBuffer",(function(o){return o.loadBufferAsync&&o.loadBufferAsync(e,t,n,r)}))},e.LoadExtensionAsync=function(e,t,n,r){if(!t.extensions)return null;var o=t.extensions[n];return o?r("".concat(e,"/extensions/").concat(n),o):null},e.LoadExtraAsync=function(e,t,n,r){if(!t.extras)return null;var o=t.extras[n];return o?r("".concat(e,"/extras/").concat(n),o):null},e.prototype.isExtensionUsed=function(e){return!!this._gltf.extensionsUsed&&-1!==this._gltf.extensionsUsed.indexOf(e)},e.prototype.logOpen=function(e){this._parent._logOpen(e)},e.prototype.logClose=function(){this._parent._logClose()},e.prototype.log=function(e){this._parent._log(e)},e.prototype.startPerformanceCounter=function(e){this._parent._startPerformanceCounter(e)},e.prototype.endPerformanceCounter=function(e){this._parent._endPerformanceCounter(e)},e.DefaultSampler={index:-1},e}();a.GLTFFileLoader._CreateGLTF2Loader=function(e){return new d(e)}},2727(e,t,n){n.r(t),n.d(t,{AnimationPropertyInfo:()=>u,TransformNodeAnimationPropertyInfo:()=>c,WeightAnimationPropertyInfo:()=>f,getQuaternion:()=>s,getVector3:()=>i,getWeights:()=>l});var r=n(8322),o=n(5597),a=n(8698);function i(e,t,n,r){return o.Vector3.FromArray(t,n).scaleInPlace(r)}function s(e,t,n,r){return o.Quaternion.FromArray(t,n).scaleInPlace(r)}function l(e,t,n,r){for(var o=new Array(e._numMorphTargets),a=0;a<o.length;a++)o[a]=t[n++]*r;return o}var u=function(){function e(e,t,n,r){this.type=e,this.name=t,this.getValue=n,this.getStride=r}return e.prototype._buildAnimation=function(e,t,n){var r=new o.Animation(e,this.name,t,this.type);return r.setKeys(n,!0),r},e}(),c=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var o=[];return o.push({babylonAnimatable:e._babylonTransformNode,babylonAnimation:this._buildAnimation(t,n,r)}),o},t}(u),f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return(0,r.C6)(t,e),t.prototype.buildAnimations=function(e,t,n,r){var a=[];if(e._numMorphTargets)for(var i=function(i){var l=new o.Animation("".concat(t,"_").concat(i),s.name,n,s.type);if(l.setKeys(r.map((function(e){return{frame:e.frame,inTangent:e.inTangent?e.inTangent[i]:void 0,value:e.value[i],outTangent:e.outTangent?e.outTangent[i]:void 0,interpolation:e.interpolation}})),!0),e._primitiveBabylonMeshes)for(var u=0,c=e._primitiveBabylonMeshes;u<c.length;u++){var f=c[u];if(f.morphTargetManager){var d=f.morphTargetManager.getTarget(i),h=l.clone();d.animations.push(h),a.push({babylonAnimatable:d,babylonAnimation:h})}}},s=this,l=0;l<e._numMorphTargets;l++)i(l);return a},t}(u);(0,a.ZU)("/nodes/{}/translation",[new c(o.Animation.ANIMATIONTYPE_VECTOR3,"position",i,(function(){return 3}))]),(0,a.ZU)("/nodes/{}/rotation",[new c(o.Animation.ANIMATIONTYPE_QUATERNION,"rotationQuaternion",s,(function(){return 4}))]),(0,a.ZU)("/nodes/{}/scale",[new c(o.Animation.ANIMATIONTYPE_VECTOR3,"scaling",i,(function(){return 3}))]),(0,a.ZU)("/nodes/{}/weights",[new f(o.Animation.ANIMATIONTYPE_FLOAT,"influence",l,(function(e){return e._numMorphTargets}))])},4015(e,t,n){n.d(t,{Hg:()=>s,Sv:()=>a,Ye:()=>i});var r=n(5597),o=new Map,a=o;function i(e,t,n){s(e)&&r.Logger.Warn("Extension with the name '".concat(e,"' already exists")),o.set(e,{isGLTFExtension:t,factory:n})}function s(e){return o.delete(e)}},3833(e,t,n){n.r(t),n.d(t,{OpenPBRMaterialLoadingAdapter:()=>o});var r=n(5597),o=function(){function e(e){this._extinctionCoefficient=r.Vector3.Zero(),this._material=e}return Object.defineProperty(e.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUnlit",{get:function(){return this._material.unlit},set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backFaceCulling",{get:function(){return this._material.backFaceCulling},set:function(e){this._material.backFaceCulling=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"twoSidedLighting",{get:function(){return this._material.twoSidedLighting},set:function(e){this._material.twoSidedLighting=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaCutOff",{get:function(){return.5},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useAlphaFromBaseColorTexture",{get:function(){return!1},set:function(e){this._material._useAlphaFromBaseColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transparencyAsAlphaCoverage",{get:function(){return!1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColor",{get:function(){return this._material.baseColor},set:function(e){this._material.baseColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColorTexture",{get:function(){return this._material.baseColorTexture},set:function(e){this._material.baseColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughness",{get:function(){return this._material.baseDiffuseRoughness},set:function(e){this._material.baseDiffuseRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughnessTexture",{get:function(){return this._material.baseDiffuseRoughnessTexture},set:function(e){this._material.baseDiffuseRoughnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalness",{get:function(){return this._material.baseMetalness},set:function(e){this._material.baseMetalness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalnessTexture",{get:function(){return this._material.baseMetalnessTexture},set:function(e){this._material.baseMetalnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useRoughnessFromMetallicTextureGreen",{set:function(e){this._material._useRoughnessFromMetallicTextureGreen=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useMetallicFromMetallicTextureBlue",{set:function(e){this._material._useMetallicFromMetallicTextureBlue=e},enumerable:!1,configurable:!0}),e.prototype.enableSpecularEdgeColor=function(e){void 0===e&&(e=!1)},Object.defineProperty(e.prototype,"specularWeight",{get:function(){return this._material.specularWeight},set:function(e){this._material.specularWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularWeightTexture",{get:function(){return this._material.specularWeightTexture},set:function(e){this._material.specularColorTexture===e?(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0):this._material.specularWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColor",{get:function(){return this._material.specularColor},set:function(e){this._material.specularColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColorTexture",{get:function(){return this._material.specularColorTexture},set:function(e){this._material.specularColorTexture=e,this._material.specularWeightTexture===this._material.specularColorTexture&&(this._material.specularWeightTexture=null,this._material._useSpecularWeightFromSpecularColorTexture=!0,this._material._useSpecularWeightFromAlpha=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughness",{get:function(){return this._material.specularRoughness},set:function(e){this._material.specularRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessTexture",{get:function(){return this._material.specularRoughnessTexture},set:function(e){this._material.specularRoughnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularIor",{get:function(){return this._material.specularIor},set:function(e){this._material.specularIor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColor",{get:function(){return this._material.emissionColor},set:function(e){this._material.emissionColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionLuminance",{get:function(){return this._material.emissionLuminance},set:function(e){this._material.emissionLuminance=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColorTexture",{get:function(){return this._material.emissionColorTexture},set:function(e){this._material.emissionColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTexture",{get:function(){return this._material.ambientOcclusionTexture},set:function(e){this._material.ambientOcclusionTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTextureStrength",{get:function(){var e,t=this._material.ambientOcclusionTexture;return null!==(e=null==t?void 0:t.level)&&void 0!==e?e:1},set:function(e){var t=this._material.ambientOcclusionTexture;t&&(t.level=e)},enumerable:!1,configurable:!0}),e.prototype.configureCoat=function(){},Object.defineProperty(e.prototype,"coatWeight",{get:function(){return this._material.coatWeight},set:function(e){this._material.coatWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatWeightTexture",{get:function(){return this._material.coatWeightTexture},set:function(e){this._material.coatWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColor",{set:function(e){this._material.coatColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColorTexture",{set:function(e){this._material.coatColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughness",{get:function(){return this._material.coatRoughness},set:function(e){this._material.coatRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessTexture",{get:function(){return this._material.coatRoughnessTexture},set:function(e){this._material.coatRoughnessTexture=e,e&&(this._material._useCoatRoughnessFromGreenChannel=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatIor",{set:function(e){this._material.coatIor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkening",{set:function(e){this._material.coatDarkening=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkeningTexture",{set:function(e){this._material.coatDarkeningTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessAnisotropy",{get:function(){return this._material.coatRoughnessAnisotropy},set:function(e){this._material.coatRoughnessAnisotropy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentAngle",{set:function(e){this._material.geometryCoatTangentAngle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentTexture",{get:function(){return this._material.geometryCoatTangentTexture},set:function(e){this._material.geometryCoatTangentTexture=e,e&&(this._material._useCoatRoughnessAnisotropyFromTangentTexture=!0)},enumerable:!1,configurable:!0}),e.prototype.configureTransmission=function(){},Object.defineProperty(e.prototype,"transmissionWeight",{get:function(){return this._material.transmissionWeight},set:function(e){this._material.transmissionWeight=e,this._material.transmissionColor=this._material.baseColor,this._material.transmissionColorTexture=this._material.baseColorTexture,this._material.transmissionDepth=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionWeightTexture",{set:function(e){this._material.transmissionWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatter",{get:function(){return this._material.transmissionScatter},set:function(e){this._material.transmissionScatter=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatterTexture",{get:function(){return this._material.transmissionScatterTexture},set:function(e){this._material.transmissionScatterTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatterAnisotropy",{set:function(e){this._material.transmissionScatterAnisotropy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionAbbeNumber",{set:function(e){this._material.transmissionDispersionAbbeNumber=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionScale",{set:function(e){this._material.transmissionDispersionScale=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDepth",{get:function(){return this._material.transmissionDepth},set:function(e){e!==Number.MAX_VALUE||0!==this._material.transmissionDepth?this._material.transmissionDepth=e:this._material.transmissionDepth=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionColor",{get:function(){return this._material.transmissionColor},set:function(e){e.equals(r.Color3.White())||(this._material.transmissionColor=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refractionBackgroundTexture",{get:function(){return this._material.backgroundRefractionTexture},set:function(e){this._material.backgroundRefractionTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeThicknessTexture",{set:function(e){this._material.geometryThicknessTexture=e,this._material._useGeometryThicknessFromGreenChannel=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeThickness",{set:function(e){this._material.geometryThickness=e},enumerable:!1,configurable:!0}),e.prototype.configureSubsurface=function(){},Object.defineProperty(e.prototype,"extinctionCoefficient",{get:function(){return this._extinctionCoefficient},set:function(e){this._extinctionCoefficient=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeight",{get:function(){return 0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeightTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColor",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColorTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTint",{get:function(){return r.Color3.White()},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTintTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadius",{get:function(){return 0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadiusScale",{get:function(){return r.Color3.White()},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceScatterAnisotropy",{set:function(e){},enumerable:!1,configurable:!0}),e.prototype.configureFuzz=function(){},Object.defineProperty(e.prototype,"fuzzWeight",{set:function(e){this._material.fuzzWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzWeightTexture",{set:function(e){this._material.fuzzWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColor",{set:function(e){this._material.fuzzColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColorTexture",{set:function(e){this._material.fuzzColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughness",{set:function(e){this._material.fuzzRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughnessTexture",{set:function(e){this._material.fuzzRoughnessTexture=e,this._material._useFuzzRoughnessFromTextureAlpha=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessAnisotropy",{get:function(){return this._material.specularRoughnessAnisotropy},set:function(e){this._material.specularRoughnessAnisotropy=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentAngle",{set:function(e){this._material.geometryTangentAngle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentTexture",{get:function(){return this._material.geometryTangentTexture},set:function(e){this._material.geometryTangentTexture=e,this._material._useSpecularRoughnessAnisotropyFromTangentTexture=!0},enumerable:!1,configurable:!0}),e.prototype.configureGltfStyleAnisotropy=function(e){void 0===e&&(e=!0),this._material._useGltfStyleAnisotropy=e},Object.defineProperty(e.prototype,"thinFilmWeight",{set:function(e){this._material.thinFilmWeight=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmIor",{set:function(e){this._material.thinFilmIor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMinimum",{set:function(e){this._material.thinFilmThicknessMin=e/1e3},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMaximum",{set:function(e){this._material.thinFilmThickness=e/1e3},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmWeightTexture",{set:function(e){this._material.thinFilmWeightTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessTexture",{set:function(e){this._material.thinFilmThicknessTexture=e,this._material._useThinFilmThicknessFromTextureGreen=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unlit",{set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryOpacity",{get:function(){return this._material.geometryOpacity},set:function(e){this._material.geometryOpacity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryNormalTexture",{get:function(){return this._material.geometryNormalTexture},set:function(e){this._material.geometryNormalTexture=e},enumerable:!1,configurable:!0}),e.prototype.setNormalMapInversions=function(e,t){},Object.defineProperty(e.prototype,"geometryCoatNormalTexture",{get:function(){return this._material.geometryCoatNormalTexture},set:function(e){this._material.geometryCoatNormalTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatNormalTextureScale",{set:function(e){this._material.geometryCoatNormalTexture&&(this._material.geometryCoatNormalTexture.level=e)},enumerable:!1,configurable:!0}),e}()},2561(e,t,n){n.r(t),n.d(t,{PBRMaterialLoadingAdapter:()=>o});var r=n(5597),o=function(){function e(e){this._extinctionCoefficient=r.Vector3.Zero(),this._material=e,this._material.enableSpecularAntiAliasing=!0}return Object.defineProperty(e.prototype,"material",{get:function(){return this._material},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isUnlit",{get:function(){return this._material.unlit},set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"backFaceCulling",{get:function(){return this._material.backFaceCulling},set:function(e){this._material.backFaceCulling=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"twoSidedLighting",{get:function(){return this._material.twoSidedLighting},set:function(e){this._material.twoSidedLighting=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"alphaCutOff",{get:function(){return this._material.alphaCutOff},set:function(e){this._material.alphaCutOff=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useAlphaFromBaseColorTexture",{get:function(){return this._material.useAlphaFromAlbedoTexture},set:function(e){this._material.useAlphaFromAlbedoTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transparencyAsAlphaCoverage",{get:function(){return this._material.useRadianceOverAlpha||this._material.useSpecularOverAlpha},set:function(e){this._material.useRadianceOverAlpha=!e,this._material.useSpecularOverAlpha=!e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColor",{get:function(){return this._material.albedoColor},set:function(e){this._material.albedoColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseColorTexture",{get:function(){return this._material.albedoTexture},set:function(e){this._material.albedoTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughness",{get:function(){var e;return null!==(e=this._material.baseDiffuseRoughness)&&void 0!==e?e:0},set:function(e){this._material.baseDiffuseRoughness=e,e>0&&(this._material.brdf.baseDiffuseModel=r.Constants.MATERIAL_DIFFUSE_MODEL_E_OREN_NAYAR)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseDiffuseRoughnessTexture",{get:function(){return this._material.baseDiffuseRoughnessTexture},set:function(e){this._material.baseDiffuseRoughnessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalness",{get:function(){var e;return null!==(e=this._material.metallic)&&void 0!==e?e:1},set:function(e){this._material.metallic=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseMetalnessTexture",{get:function(){return this._material.metallicTexture},set:function(e){this._material.metallicTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useRoughnessFromMetallicTextureGreen",{set:function(e){this._material.useRoughnessFromMetallicTextureGreen=e,this._material.useRoughnessFromMetallicTextureAlpha=!e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"useMetallicFromMetallicTextureBlue",{set:function(e){this._material.useMetallnessFromMetallicTextureBlue=e},enumerable:!1,configurable:!0}),e.prototype.enableSpecularEdgeColor=function(e){void 0===e&&(e=!1),e&&(this._material.brdf.dielectricSpecularModel=r.Constants.MATERIAL_DIELECTRIC_SPECULAR_MODEL_OPENPBR,this._material.brdf.conductorSpecularModel=r.Constants.MATERIAL_CONDUCTOR_SPECULAR_MODEL_OPENPBR)},Object.defineProperty(e.prototype,"specularWeight",{get:function(){var e;return null!==(e=this._material.metallicF0Factor)&&void 0!==e?e:1},set:function(e){this._material.metallicF0Factor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularWeightTexture",{get:function(){return this._material.metallicReflectanceTexture},set:function(e){e?(this._material.metallicReflectanceTexture=e,this._material.useOnlyMetallicFromMetallicReflectanceTexture=!0):(this._material.metallicReflectanceTexture=null,this._material.useOnlyMetallicFromMetallicReflectanceTexture=!1)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColor",{get:function(){return this._material.metallicReflectanceColor},set:function(e){this._material.metallicReflectanceColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularColorTexture",{get:function(){return this._material.reflectanceTexture},set:function(e){this._material.reflectanceTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughness",{get:function(){var e;return null!==(e=this._material.roughness)&&void 0!==e?e:1},set:function(e){this._material.roughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessTexture",{get:function(){return this._material.metallicTexture},set:function(e){this.baseMetalnessTexture||(this._material.metallicTexture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularIor",{get:function(){return this._material.indexOfRefraction},set:function(e){this._material.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColor",{get:function(){return this._material.emissiveColor},set:function(e){this._material.emissiveColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionLuminance",{get:function(){return this._material.emissiveIntensity},set:function(e){this._material.emissiveIntensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"emissionColorTexture",{get:function(){return this._material.emissiveTexture},set:function(e){this._material.emissiveTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTexture",{get:function(){return this._material.ambientTexture},set:function(e){this._material.ambientTexture=e,e&&(this._material.useAmbientInGrayScale=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ambientOcclusionTextureStrength",{get:function(){var e;return null!==(e=this._material.ambientTextureStrength)&&void 0!==e?e:1},set:function(e){this._material.ambientTextureStrength=e},enumerable:!1,configurable:!0}),e.prototype.configureCoat=function(){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.useRoughnessFromMainTexture=!1,this._material.clearCoat.remapF0OnInterfaceChange=!1},Object.defineProperty(e.prototype,"coatWeight",{get:function(){return this._material.clearCoat.intensity},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatWeightTexture",{get:function(){return this._material.clearCoat.texture},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColor",{set:function(e){this._material.clearCoat.isTintEnabled=e!=r.Color3.White(),this._material.clearCoat.tintColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatColorTexture",{set:function(e){this._material.clearCoat.tintTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughness",{get:function(){var e;return null!==(e=this._material.clearCoat.roughness)&&void 0!==e?e:0},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.roughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessTexture",{get:function(){return this._material.clearCoat.textureRoughness},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.useRoughnessFromMainTexture=!1,this._material.clearCoat.textureRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatIor",{set:function(e){this._material.clearCoat.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkening",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatDarkeningTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"coatRoughnessAnisotropy",{get:function(){return 0},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentAngle",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatTangentTexture",{get:function(){return null},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionWeight",{get:function(){return this._material.subSurface.isRefractionEnabled?this._material.subSurface.refractionIntensity:0},set:function(e){this._material.subSurface.isRefractionEnabled=e>0,this._material.subSurface.refractionIntensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionWeightTexture",{set:function(e){this._material.subSurface.isRefractionEnabled=!0,this._material.subSurface.refractionIntensityTexture=e,this._material.subSurface.useGltfStyleTextures=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDepth",{get:function(){return this.transmissionWeight>0?this._material.subSurface.tintColorAtDistance:0},set:function(e){this.transmissionWeight>0?this._material.subSurface.tintColorAtDistance=e:this.subsurfaceWeight>0&&this._material.subSurface.diffusionDistance.multiplyInPlace(new r.Color3(e,e,e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionColor",{get:function(){return this.transmissionWeight>0?this._material.subSurface.tintColor:this.subsurfaceWeight>0?this._material.subSurface.diffusionDistance:new r.Color3(0,0,0)},set:function(e){this.transmissionWeight>0?this._material.subSurface.tintColor=e:this.subsurfaceWeight>0&&this._material.subSurface.diffusionDistance.multiplyInPlace(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatter",{get:function(){return this._material.subSurface.diffusionDistance},set:function(e){this._material.subSurface.diffusionDistance=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionScatterAnisotropy",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionAbbeNumber",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transmissionDispersionScale",{set:function(e){e>0?(this._material.subSurface.isDispersionEnabled=!0,this._material.subSurface.dispersion=20/e):(this._material.subSurface.isDispersionEnabled=!1,this._material.subSurface.dispersion=0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refractionBackgroundTexture",{get:function(){return this._material.subSurface.refractionTexture},set:function(e){this._material.subSurface.refractionTexture=e},enumerable:!1,configurable:!0}),e.prototype.configureTransmission=function(){this._material.subSurface.volumeIndexOfRefraction=1,this._material.subSurface.useAlbedoToTintRefraction=!0,this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=0},Object.defineProperty(e.prototype,"volumeThicknessTexture",{set:function(e){this._material.subSurface.thicknessTexture=e,this._material.subSurface.useGltfStyleTextures=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"volumeThickness",{set:function(e){this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=e,this._material.subSurface.useThicknessAsDepth=!0,e>0&&(this._material.subSurface.volumeIndexOfRefraction=this._material.indexOfRefraction)},enumerable:!1,configurable:!0}),e.prototype.configureSubsurface=function(){this._material.subSurface.useGltfStyleTextures=!0,this._material.subSurface.volumeIndexOfRefraction=1,this._material.subSurface.minimumThickness=0,this._material.subSurface.maximumThickness=0,this._material.subSurface.useAlbedoToTintTranslucency=!1},Object.defineProperty(e.prototype,"extinctionCoefficient",{get:function(){return this._extinctionCoefficient},set:function(e){this._extinctionCoefficient=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeight",{get:function(){return this._material.subSurface.isTranslucencyEnabled?this._material.subSurface.translucencyIntensity:0},set:function(e){this._material.subSurface.isTranslucencyEnabled=e>0,this._material.subSurface.translucencyIntensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceWeightTexture",{set:function(e){this._material.subSurface.translucencyIntensityTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColor",{set:function(e){var t=this.extinctionCoefficient,n=Math.max(t.x,Math.max(t.y,t.z)),o=n>0?1/n:1;this._material.subSurface.diffusionDistance=new r.Color3(Math.exp(-t.x*o),Math.exp(-t.y*o),Math.exp(-t.z*o))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceColorTexture",{set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTint",{get:function(){return this._material.subSurface.tintColor},set:function(e){this._material.subSurface.tintColor=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceConstantTintTexture",{set:function(e){this._material.subSurface.translucencyColorTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadius",{get:function(){return 1},set:function(e){},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceRadiusScale",{get:function(){var e;return null!==(e=this._material.subSurface.scatteringDiffusionProfile)&&void 0!==e?e:r.Color3.White()},set:function(e){this._material.subSurface.scatteringDiffusionProfile=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subsurfaceScatterAnisotropy",{set:function(e){},enumerable:!1,configurable:!0}),e.prototype.configureFuzz=function(){this._material.sheen.isEnabled=!0,this._material.sheen.useRoughnessFromMainTexture=!1,this._material.sheen.albedoScaling=!0},Object.defineProperty(e.prototype,"fuzzWeight",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzWeightTexture",{set:function(e){this._material.sheen.texture||(this._material.sheen.texture=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColor",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.color=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzColorTexture",{set:function(e){this._material.sheen.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughness",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.roughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fuzzRoughnessTexture",{set:function(e){this._material.sheen.isEnabled=!0,this._material.sheen.textureRoughness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"specularRoughnessAnisotropy",{get:function(){return this._material.anisotropy.intensity},set:function(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentAngle",{set:function(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.angle=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryTangentTexture",{get:function(){return this._material.anisotropy.texture},set:function(e){this._material.anisotropy.isEnabled=!0,this._material.anisotropy.texture=e},enumerable:!1,configurable:!0}),e.prototype.configureGltfStyleAnisotropy=function(e){void 0===e&&(e=!0)},Object.defineProperty(e.prototype,"thinFilmWeight",{set:function(e){this._material.iridescence.isEnabled=e>0,this._material.iridescence.intensity=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmIor",{set:function(e){this._material.iridescence.indexOfRefraction=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMinimum",{set:function(e){this._material.iridescence.minimumThickness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessMaximum",{set:function(e){this._material.iridescence.maximumThickness=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmWeightTexture",{set:function(e){this._material.iridescence.texture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"thinFilmThicknessTexture",{set:function(e){this._material.iridescence.thicknessTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unlit",{set:function(e){this._material.unlit=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryOpacity",{get:function(){return this._material.alpha},set:function(e){this._material.alpha=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryNormalTexture",{get:function(){return this._material.bumpTexture},set:function(e){this._material.bumpTexture=e,this._material.forceIrradianceInFragment=!0},enumerable:!1,configurable:!0}),e.prototype.setNormalMapInversions=function(e,t){this._material.invertNormalMapX=e,this._material.invertNormalMapY=t},Object.defineProperty(e.prototype,"geometryCoatNormalTexture",{get:function(){return this._material.clearCoat.bumpTexture},set:function(e){this._material.clearCoat.isEnabled=!0,this._material.clearCoat.bumpTexture=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"geometryCoatNormalTextureScale",{set:function(e){this._material.clearCoat.bumpTexture&&(this._material.clearCoat.bumpTexture.level=e)},enumerable:!1,configurable:!0}),e}()},6423(e,t,n){n.d(t,{_:()=>o,i:()=>r});var r="Z2xURg",o={name:"gltf",extensions:{".gltf":{isBinary:!1,mimeType:"model/gltf+json"},".glb":{isBinary:!0,mimeType:"model/gltf-binary"}},canDirectLoad:function(e){return-1!==e.indexOf("asset")&&-1!==e.indexOf("version")||e.startsWith("data:base64,"+r)||e.startsWith("data:;base64,"+r)||e.startsWith("data:application/octet-stream;base64,"+r)||e.startsWith("data:model/gltf-binary;base64,"+r)}}},6086(e,t,n){n.r(t),n.d(t,{GLTFFileLoader:()=>p,GLTFLoaderAnimationStartMode:()=>o,GLTFLoaderCoordinateSystemMode:()=>r,GLTFLoaderDefaultOptions:()=>d,GLTFLoaderState:()=>a});var r,o,a,i=n(8322),s=n(5597),l=n(6472),u=n(6423);function c(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"}(r||(r={})),function(e){e[e.NONE=0]="NONE",e[e.FIRST=1]="FIRST",e[e.ALL=2]="ALL"}(o||(o={})),function(e){e[e.LOADING=0]="LOADING",e[e.READY=1]="READY",e[e.COMPLETE=2]="COMPLETE"}(a||(a={}));var f=function(){this.alwaysComputeBoundingBox=!1,this.alwaysComputeSkeletonRootNode=!1,this.animationStartMode=o.FIRST,this.compileMaterials=!1,this.compileShadowGenerators=!1,this.coordinateSystemMode=r.AUTO,this.createInstances=!0,this.loadAllMaterials=!1,this.loadMorphTargets=!0,this.loadNodeAnimations=!0,this.loadOnlyMaterials=!1,this.loadSkins=!0,this.skipMaterials=!1,this.targetFps=60,this.transparencyAsCoverage=!1,this.useClipPlane=!1,this.useGltfTextureNames=!1,this.useRangeRequests=!1,this.useSRGBBuffers=!0,this.validate=!1,this.useOpenPBR=!1,this.dontUseTransmissionHelper=!1},d=new f,h=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.extensionOptions={},t.preprocessUrlAsync=function(e){return Promise.resolve(e)},t}return(0,i.C6)(t,e),t.prototype.copyFrom=function(e){var t,n,r,o,a,i,s,l,u,c,f,d,h,p,m,_,g,b,y,v,T,x,A,w,O,C;e&&(this.alwaysComputeBoundingBox=null!==(t=e.alwaysComputeBoundingBox)&&void 0!==t?t:this.alwaysComputeBoundingBox,this.alwaysComputeSkeletonRootNode=null!==(n=e.alwaysComputeSkeletonRootNode)&&void 0!==n?n:this.alwaysComputeSkeletonRootNode,this.animationStartMode=null!==(r=e.animationStartMode)&&void 0!==r?r:this.animationStartMode,this.capturePerformanceCounters=null!==(o=e.capturePerformanceCounters)&&void 0!==o?o:this.capturePerformanceCounters,this.compileMaterials=null!==(a=e.compileMaterials)&&void 0!==a?a:this.compileMaterials,this.compileShadowGenerators=null!==(i=e.compileShadowGenerators)&&void 0!==i?i:this.compileShadowGenerators,this.coordinateSystemMode=null!==(s=e.coordinateSystemMode)&&void 0!==s?s:this.coordinateSystemMode,this.createInstances=null!==(l=e.createInstances)&&void 0!==l?l:this.createInstances,this.customRootNode=e.customRootNode,this.extensionOptions=null!==(u=e.extensionOptions)&&void 0!==u?u:this.extensionOptions,this.loadAllMaterials=null!==(c=e.loadAllMaterials)&&void 0!==c?c:this.loadAllMaterials,this.loadMorphTargets=null!==(f=e.loadMorphTargets)&&void 0!==f?f:this.loadMorphTargets,this.loadNodeAnimations=null!==(d=e.loadNodeAnimations)&&void 0!==d?d:this.loadNodeAnimations,this.loadOnlyMaterials=null!==(h=e.loadOnlyMaterials)&&void 0!==h?h:this.loadOnlyMaterials,this.loadSkins=null!==(p=e.loadSkins)&&void 0!==p?p:this.loadSkins,this.loggingEnabled=null!==(m=e.loggingEnabled)&&void 0!==m?m:this.loggingEnabled,this.onCameraLoaded=e.onCameraLoaded,this.onMaterialLoaded=e.onMaterialLoaded,this.onMeshLoaded=e.onMeshLoaded,this.onParsed=e.onParsed,this.onSkinLoaded=e.onSkinLoaded,this.onTextureLoaded=e.onTextureLoaded,this.onValidated=e.onValidated,this.preprocessUrlAsync=null!==(_=e.preprocessUrlAsync)&&void 0!==_?_:this.preprocessUrlAsync,this.skipMaterials=null!==(g=e.skipMaterials)&&void 0!==g?g:this.skipMaterials,this.targetFps=null!==(b=e.targetFps)&&void 0!==b?b:this.targetFps,this.transparencyAsCoverage=null!==(y=e.transparencyAsCoverage)&&void 0!==y?y:this.transparencyAsCoverage,this.useClipPlane=null!==(v=e.useClipPlane)&&void 0!==v?v:this.useClipPlane,this.useGltfTextureNames=null!==(T=e.useGltfTextureNames)&&void 0!==T?T:this.useGltfTextureNames,this.useOpenPBR=null!==(x=e.useOpenPBR)&&void 0!==x?x:this.useOpenPBR,this.useRangeRequests=null!==(A=e.useRangeRequests)&&void 0!==A?A:this.useRangeRequests,this.useSRGBBuffers=null!==(w=e.useSRGBBuffers)&&void 0!==w?w:this.useSRGBBuffers,this.validate=null!==(O=e.validate)&&void 0!==O?O:this.validate,this.dontUseTransmissionHelper=null!==(C=e.dontUseTransmissionHelper)&&void 0!==C?C:this.dontUseTransmissionHelper)},t}(f),p=function(e){function t(t){var n=e.call(this)||this;return n.onParsedObservable=new s.Observable,n.onMeshLoadedObservable=new s.Observable,n.onSkinLoadedObservable=new s.Observable,n.onTextureLoadedObservable=new s.Observable,n.onMaterialLoadedObservable=new s.Observable,n.onCameraLoadedObservable=new s.Observable,n.onCompleteObservable=new s.Observable,n.onErrorObservable=new s.Observable,n.onDisposeObservable=new s.Observable,n.onExtensionLoadedObservable=new s.Observable,n.onValidatedObservable=new s.Observable,n._loader=null,n._state=null,n._requests=new Array,n.name=u._.name,n.extensions=u._.extensions,n.onLoaderStateChangedObservable=new s.Observable,n._logIndentLevel=0,n._loggingEnabled=!1,n._log=n._logDisabled,n._capturePerformanceCounters=!1,n._startPerformanceCounter=n._startPerformanceCounterDisabled,n._endPerformanceCounter=n._endPerformanceCounterDisabled,n.copyFrom(Object.assign((0,i.Cl)({},d),t)),n}return(0,i.C6)(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,l){var u=this;if(ArrayBuffer.isView(t))return this._loadBinary(e,t,n,r,i,l),null;this._progressCallback=o;var f=t.name||s.Tools.GetFilename(t);if(a){if(this.useRangeRequests){this.validate&&s.Logger.Warn("glTF validation is not supported when range requests are enabled");var d={abort:function(){},onCompleteObservable:new s.Observable},h={readAsync:function(n,r){return new Promise((function(o,a){u._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 s.DataReader(h)).then((function(e){d.onCompleteObservable.notifyObservers(d),r(e)}),i?function(e){return i(void 0,e)}:void 0),d}return this._loadFile(e,t,(function(t){u._validate(e,new Uint8Array(t,0,t.byteLength),n,f),u._unpackBinaryAsync(new s.DataReader({readAsync:function(e,n){return c(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{u._validate(e,t,n,f),r({json:u._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 s.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 s.AssetContainer(e),l=[];a.onMaterialLoadedObservable.add((function(e){l.push(e)}));var u=[];a.onTextureLoadedObservable.add((function(e){u.push(e)}));var c=[];a.onCameraLoadedObservable.add((function(e){c.push(e)}));var f=[];return a.onMeshLoadedObservable.add((function(e){e.morphTargetManager&&f.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,l),Array.prototype.push.apply(i.textures,u),Array.prototype.push.apply(i.lights,e.lights),Array.prototype.push.apply(i.transformNodes,e.transformNodes),Array.prototype.push.apply(i.cameras,c),Array.prototype.push.apply(i.morphTargetManagers,f),i}))}))},t.prototype.canDirectLoad=function(e){return u._.canDirectLoad(e)},t.prototype.directLoad=function(e,t){if(t.startsWith("base64,"+u.i)||t.startsWith(";base64,"+u.i)||t.startsWith("application/octet-stream;base64,"+u.i)||t.startsWith("model/gltf-binary;base64,"+u.i)){var n=(0,s.DecodeBase64UrlToBinary)(t);return this._validate(e,new Uint8Array(n,0,n.byteLength)),this._unpackBinaryAsync(new s.DataReader({readAsync:function(e,t){return c(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[u._.name])},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(a[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"),l.GLTFValidation.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"),s.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 s.RuntimeError("Unexpected magic: "+n,s.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||s.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);s.Logger.Log("".concat(n).concat(e))},t.prototype._logDisabled=function(e){},t.prototype._startPerformanceCounterEnabled=function(e){s.Tools.StartPerformanceCounter(e)},t.prototype._startPerformanceCounterDisabled=function(e){},t.prototype._endPerformanceCounterEnabled=function(e){s.Tools.EndPerformanceCounter(e)},t.prototype._endPerformanceCounterDisabled=function(e){},t.IncrementalLoading=!0,t.HomogeneousCoordinates=!1,t._logSpaces=" ",t}(h);(0,s.RegisterSceneLoaderPlugin)(new p)},6472(e,t,n){n.r(t),n.d(t,{GLTFValidation:()=>i});var r=n(5597);function o(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 a(){var e=[];onmessage=function(t){var n=t.data;switch(n.id){case"init":importScripts(n.url);break;case"validate":o(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 i=function(){function e(){}return e.ValidateAsync=function(t,n,i,s){var l=this;return"function"==typeof Worker?new Promise((function(u,c){var f="".concat(o,"(").concat(a,")()"),d=URL.createObjectURL(new Blob([f],{type:"application/javascript"})),h=new Worker(d),p=function(e){h.removeEventListener("error",p),h.removeEventListener("message",m),c(e)},m=function(t){var n=t.data;switch(n.id){case"getExternalResource":s(n.uri).then((function(e){h.postMessage({id:"getExternalResource.resolve",index:n.index,value:e},[e.buffer])}),(function(e){h.postMessage({id:"getExternalResource.reject",index:n.index,reason:e})}));break;case"validate.resolve":h.removeEventListener("error",p),h.removeEventListener("message",m),e._LastResults=n.value,u(n.value),h.terminate();break;case"validate.reject":h.removeEventListener("error",p),h.removeEventListener("message",m),c(n.reason),h.terminate()}};if(h.addEventListener("error",p),h.addEventListener("message",m),h.postMessage({id:"init",url:r.Tools.GetBabylonScriptURL(l.Configuration.url)}),ArrayBuffer.isView(t)){var _=t.slice();h.postMessage({id:"validate",data:_,rootUrl:n,fileName:i},[_.buffer])}else h.postMessage({id:"validate",data:t,rootUrl:n,fileName:i})})):(this._LoadScriptPromise||(this._LoadScriptPromise=r.Tools.LoadBabylonScriptAsync(this.Configuration.url)),this._LoadScriptPromise.then((function(){return o(t,n,i,s)})))},e.Configuration={url:"".concat(r.Tools._DefaultCdnUrl,"/gltf_validator.js")},e._LastResults=null,e}()},5597(t){t.exports=e},8322(e,t,n){n.d(t,{C6:()=>o,Cl:()=>a,YH:()=>s,fX:()=>l,sH:()=>i});var r=function(e,t){return r=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])},r(e,t)};function o(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}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var a=function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},a.apply(this,arguments)};function i(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function s(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}l((r=r.apply(e,t||[])).next())}))}function s(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=s(0),i.throw=s(1),i.return=s(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create,"function"==typeof SuppressedError&&SuppressedError}},o={};function a(e){var t=o[e];if(void 0!==t)return t.exports;var n=o[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},n=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var o=Object.create(null);a.r(o);var i={};t=t||[null,n({}),n([]),n(n)];for(var s=2&r&&e;("object"==typeof s||"function"==typeof s)&&!~t.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach((t=>i[t]=()=>e[t]));return i.default=()=>e,a.d(o,i),o},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};a.d(i,{default:()=>Ct});var s={};a.r(s),a.d(s,{BVHFileLoader:()=>O.BVHFileLoader,ReadBvh:()=>w.R});var l={};a.r(l),a.d(l,{EBlendingFunction:()=>A,EComponentType:()=>_,ECullingType:()=>x,EParameterType:()=>b,EShaderType:()=>g,ETextureFilterType:()=>v,ETextureFormat:()=>T,ETextureWrapMode:()=>y,GLTFBinaryExtension:()=>te,GLTFLoader:()=>$,GLTFLoaderBase:()=>Q,GLTFLoaderExtension:()=>ee,GLTFMaterialsCommonExtension:()=>ne,GLTFUtils:()=>F});var u={};a.r(u);var c={};a.r(c),a.d(c,{AddObjectAccessorToKey:()=>le.oR,EXT_lights_area:()=>ge.EXT_lights_area,EXT_lights_ies:()=>pe.EXT_lights_ies,EXT_lights_image_based:()=>ue.EXT_lights_image_based,EXT_mesh_gpu_instancing:()=>ce.EXT_mesh_gpu_instancing,EXT_meshopt_compression:()=>fe.EXT_meshopt_compression,EXT_texture_avif:()=>he.EXT_texture_avif,EXT_texture_webp:()=>de.EXT_texture_webp,ExtrasAsMetadata:()=>qe.ExtrasAsMetadata,FlowGraphGLTFDataProvider:()=>Qe.FlowGraphGLTFDataProvider,GetMappingForKey:()=>le.tQ,GetPathToObjectConverter:()=>le.Wt,InteractivityGraphToFlowGraphParser:()=>Je.W,KHR_animation_pointer:()=>Ve.KHR_animation_pointer,KHR_draco_mesh_compression:()=>me.KHR_draco_mesh_compression,KHR_interactivity:()=>Ye.KHR_interactivity,KHR_lights:()=>_e.KHR_lights,KHR_materials_anisotropy:()=>Ae.KHR_materials_anisotropy,KHR_materials_clearcoat:()=>ve.KHR_materials_clearcoat,KHR_materials_coat:()=>Te.KHR_materials_coat,KHR_materials_diffuse_roughness:()=>Ne.KHR_materials_diffuse_roughness,KHR_materials_diffuse_transmission:()=>Fe.KHR_materials_diffuse_transmission,KHR_materials_dispersion:()=>Ie.KHR_materials_dispersion,KHR_materials_emissive_strength:()=>we.KHR_materials_emissive_strength,KHR_materials_fuzz:()=>Ce.KHR_materials_fuzz,KHR_materials_ior:()=>Ee.KHR_materials_ior,KHR_materials_iridescence:()=>xe.KHR_materials_iridescence,KHR_materials_pbrSpecularGlossiness:()=>be.KHR_materials_pbrSpecularGlossiness,KHR_materials_sheen:()=>Oe.KHR_materials_sheen,KHR_materials_specular:()=>Me.KHR_materials_specular,KHR_materials_transmission:()=>Le.KHR_materials_transmission,KHR_materials_unlit:()=>ye.KHR_materials_unlit,KHR_materials_variants:()=>Re.KHR_materials_variants,KHR_materials_volume:()=>Pe.KHR_materials_volume,KHR_materials_volume_scatter:()=>Se.KHR_materials_volume_scatter,KHR_mesh_quantization:()=>Be.KHR_mesh_quantization,KHR_node_hoverability:()=>Ze.KHR_node_hoverability,KHR_node_selectability:()=>ze.KHR_node_selectability,KHR_node_visibility:()=>We.KHR_node_visibility,KHR_texture_basisu:()=>He.KHR_texture_basisu,KHR_texture_transform:()=>ke.KHR_texture_transform,KHR_xmp_json_ld:()=>Ge.KHR_xmp_json_ld,MSFT_audio_emitter:()=>De.MSFT_audio_emitter,MSFT_lod:()=>Ke.MSFT_lod,MSFT_minecraftMesh:()=>Ue.MSFT_minecraftMesh,MSFT_sRGBFactors:()=>je.MSFT_sRGBFactors,SetInterpolationForKey:()=>le.ZU,_AddInteractivityObjectModel:()=>Ye._AddInteractivityObjectModel,addNewInteractivityFlowGraphMapping:()=>Xe.rO,getAllSupportedNativeNodeTypes:()=>Xe.U3,getMappingForDeclaration:()=>Xe.KD,getMappingForFullOperationName:()=>Xe.X6,gltfTypeToBabylonType:()=>Je.u});var f={};a.r(f),a.d(f,{AddObjectAccessorToKey:()=>le.oR,AnimationPropertyInfo:()=>ae.AnimationPropertyInfo,ArrayItem:()=>re.ArrayItem,EXT_lights_area:()=>ge.EXT_lights_area,EXT_lights_ies:()=>pe.EXT_lights_ies,EXT_lights_image_based:()=>ue.EXT_lights_image_based,EXT_mesh_gpu_instancing:()=>ce.EXT_mesh_gpu_instancing,EXT_meshopt_compression:()=>fe.EXT_meshopt_compression,EXT_texture_avif:()=>he.EXT_texture_avif,EXT_texture_webp:()=>de.EXT_texture_webp,ExtrasAsMetadata:()=>qe.ExtrasAsMetadata,FlowGraphGLTFDataProvider:()=>Qe.FlowGraphGLTFDataProvider,GLTFFileLoader:()=>re.GLTFFileLoader,GLTFLoader:()=>re.GLTFLoader,GetMappingForKey:()=>le.tQ,GetPathToObjectConverter:()=>le.Wt,InteractivityGraphToFlowGraphParser:()=>Je.W,KHR_animation_pointer:()=>Ve.KHR_animation_pointer,KHR_draco_mesh_compression:()=>me.KHR_draco_mesh_compression,KHR_interactivity:()=>Ye.KHR_interactivity,KHR_lights:()=>_e.KHR_lights,KHR_materials_anisotropy:()=>Ae.KHR_materials_anisotropy,KHR_materials_clearcoat:()=>ve.KHR_materials_clearcoat,KHR_materials_coat:()=>Te.KHR_materials_coat,KHR_materials_diffuse_roughness:()=>Ne.KHR_materials_diffuse_roughness,KHR_materials_diffuse_transmission:()=>Fe.KHR_materials_diffuse_transmission,KHR_materials_dispersion:()=>Ie.KHR_materials_dispersion,KHR_materials_emissive_strength:()=>we.KHR_materials_emissive_strength,KHR_materials_fuzz:()=>Ce.KHR_materials_fuzz,KHR_materials_ior:()=>Ee.KHR_materials_ior,KHR_materials_iridescence:()=>xe.KHR_materials_iridescence,KHR_materials_pbrSpecularGlossiness:()=>be.KHR_materials_pbrSpecularGlossiness,KHR_materials_sheen:()=>Oe.KHR_materials_sheen,KHR_materials_specular:()=>Me.KHR_materials_specular,KHR_materials_transmission:()=>Le.KHR_materials_transmission,KHR_materials_unlit:()=>ye.KHR_materials_unlit,KHR_materials_variants:()=>Re.KHR_materials_variants,KHR_materials_volume:()=>Pe.KHR_materials_volume,KHR_materials_volume_scatter:()=>Se.KHR_materials_volume_scatter,KHR_mesh_quantization:()=>Be.KHR_mesh_quantization,KHR_node_hoverability:()=>Ze.KHR_node_hoverability,KHR_node_selectability:()=>ze.KHR_node_selectability,KHR_node_visibility:()=>We.KHR_node_visibility,KHR_texture_basisu:()=>He.KHR_texture_basisu,KHR_texture_transform:()=>ke.KHR_texture_transform,KHR_xmp_json_ld:()=>Ge.KHR_xmp_json_ld,LoadBoundingInfoFromPositionAccessor:()=>re.LoadBoundingInfoFromPositionAccessor,MSFT_audio_emitter:()=>De.MSFT_audio_emitter,MSFT_lod:()=>Ke.MSFT_lod,MSFT_minecraftMesh:()=>Ue.MSFT_minecraftMesh,MSFT_sRGBFactors:()=>je.MSFT_sRGBFactors,OpenPBRMaterialLoadingAdapter:()=>ie.OpenPBRMaterialLoadingAdapter,PBRMaterialLoadingAdapter:()=>se.PBRMaterialLoadingAdapter,SetInterpolationForKey:()=>le.ZU,TransformNodeAnimationPropertyInfo:()=>ae.TransformNodeAnimationPropertyInfo,WeightAnimationPropertyInfo:()=>ae.WeightAnimationPropertyInfo,_AddInteractivityObjectModel:()=>Ye._AddInteractivityObjectModel,addNewInteractivityFlowGraphMapping:()=>Xe.rO,getAllSupportedNativeNodeTypes:()=>Xe.U3,getMappingForDeclaration:()=>Xe.KD,getMappingForFullOperationName:()=>Xe.X6,getQuaternion:()=>ae.getQuaternion,getVector3:()=>ae.getVector3,getWeights:()=>ae.getWeights,gltfTypeToBabylonType:()=>Je.u,registerGLTFExtension:()=>oe.Ye,registeredGLTFExtensions:()=>oe.Sv,unregisterGLTFExtension:()=>oe.Hg});var d={};a.r(d),a.d(d,{MTLFileLoader:()=>$e.B,OBJFileLoader:()=>tt.OBJFileLoader,SolidParser:()=>et.n});var h={};a.r(h),a.d(h,{STLFileLoader:()=>nt.STLFileLoader});var p={};a.r(p),a.d(p,{registerBuiltInLoaders:()=>ut});var m={};a.r(m),a.d(m,{BVHFileLoader:()=>O.BVHFileLoader,GLTF1:()=>l,GLTF2:()=>f,GLTFFileLoader:()=>C.GLTFFileLoader,GLTFLoaderAnimationStartMode:()=>C.GLTFLoaderAnimationStartMode,GLTFLoaderCoordinateSystemMode:()=>C.GLTFLoaderCoordinateSystemMode,GLTFLoaderDefaultOptions:()=>C.GLTFLoaderDefaultOptions,GLTFLoaderState:()=>C.GLTFLoaderState,GLTFValidation:()=>M.GLTFValidation,MTLFileLoader:()=>$e.B,OBJFileLoader:()=>tt.OBJFileLoader,ReadBvh:()=>w.R,SPLATFileLoader:()=>rt.SPLATFileLoader,STLFileLoader:()=>nt.STLFileLoader,SolidParser:()=>et.n,registerBuiltInLoaders:()=>ut});var _,g,b,y,v,T,x,A,w=a(7872),O=a(3914),C=a(6086),M=a(6472),E=a(8322);!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"}(_||(_={})),function(e){e[e.FRAGMENT=35632]="FRAGMENT",e[e.VERTEX=35633]="VERTEX"}(g||(g={})),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"}(b||(b={})),function(e){e[e.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE",e[e.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT",e[e.REPEAT=10497]="REPEAT"}(y||(y={})),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"}(v||(v={})),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"}(T||(T={})),function(e){e[e.FRONT=1028]="FRONT",e[e.BACK=1029]="BACK",e[e.FRONT_AND_BACK=1032]="FRONT_AND_BACK"}(x||(x={})),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"}(A||(A={}));var R,L=a(5597),F=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=L.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=L.Matrix.Transpose(t.getWorldMatrix().invert())),a)switch(n.type){case b.FLOAT_MAT2:o.setMatrix2x2(r,L.Matrix.GetAsMatrix2x2(a));break;case b.FLOAT_MAT3:o.setMatrix3x3(r,L.Matrix.GetAsMatrix3x3(a));break;case b.FLOAT_MAT4:o.setMatrix(r,a)}},e.SetUniform=function(e,t,n,r){switch(r){case b.FLOAT:return e.setFloat(t,n),!0;case b.FLOAT_VEC2:return e.setVector2(t,L.Vector2.FromArray(n)),!0;case b.FLOAT_VEC3:return e.setVector3(t,L.Vector3.FromArray(n)),!0;case b.FLOAT_VEC4:return e.setVector4(t,L.Vector4.FromArray(n)),!0;default:return!1}},e.GetWrapMode=function(e){switch(e){case y.CLAMP_TO_EDGE:return L.Texture.CLAMP_ADDRESSMODE;case y.MIRRORED_REPEAT:return L.Texture.MIRROR_ADDRESSMODE;case y.REPEAT:default:return L.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 v.LINEAR:case v.LINEAR_MIPMAP_NEAREST:case v.LINEAR_MIPMAP_LINEAR:return L.Texture.TRILINEAR_SAMPLINGMODE;case v.NEAREST:case v.NEAREST_MIPMAP_NEAREST:return L.Texture.NEAREST_SAMPLINGMODE;default:return L.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 _.BYTE:return new Int8Array(i,n,r);case _.UNSIGNED_BYTE:return new Uint8Array(i,n,r);case _.SHORT:return new Int16Array(i,n,r);case _.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){L.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"),L.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 L.ShaderMaterial("GLTFDefaultMaterial",t,{vertex:"GLTFDefaultMaterial",fragment:"GLTFDefaultMaterial"},n),e._DefaultMaterial.setColor4("u_emission",new L.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"}(R||(R={}));var P=function(){function e(e){this._pos=0,this.currentToken=R.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 R.END_OF_INPUT;if(this.currentString=this.read(),this.currentToken=R.UNKNOWN,"_"===this.currentString||this.isLetterOrDigitPattern.test(this.currentString))for(this.currentToken=R.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}(),S=["MODEL","VIEW","PROJECTION","MODELVIEW","MODELVIEWPROJECTION","JOINTMATRIX"],I=["world","view","projection","worldView","worldViewProjection","mBones"],N=["translation","rotation","scale"],B=["position","rotationQuaternion","scaling"],H=function(e,t,n){for(var r in e){var o=e[r];n[t][r]=o}},k=function(e){if(e)for(var t=0;t<e.length/2;t++)e[2*t+1]=1-e[2*t+1]},G=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},V=function(e){var t;if(e.translation||e.rotation||e.scale){var n=L.Vector3.FromArray(e.scale||[1,1,1]),r=L.Quaternion.FromArray(e.rotation||[0,0,0,1]),o=L.Vector3.FromArray(e.translation||[0,0,0]);t=L.Matrix.Compose(n,r,o)}else t=L.Matrix.FromArray(e.matrix);return t},D=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=V(s),f=new L.Bone(s.name||"",r,D(e,t,s.jointName,r),c);return f.id=i,f}}}}return null},K=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},U=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},j=function(e,t){for(var n=0;n<e.jointNames.length;n++)if(e.jointNames[n]===t)return!0;return!1},Y=function(e,t,n,r,o){if(o||(e.scene._blockEntityCollection=!!e.assetContainer,(o=new L.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=[],d=0;d<n.length;d++){var h=n[d];if(R=e.meshes[h])for(var p=0;p<R.primitives.length;p++){var m=new L.VertexData,_=R.primitives[p];_.mode;var g=_.attributes,b=void 0,y=void 0;for(var v in g)if(b=e.accessors[g[v]],y=F.GetBufferFromAccessor(e,b),"NORMAL"===v)m.normals=new Float32Array(y.length),m.normals.set(y);else if("POSITION"===v){if(C.GLTFFileLoader.HomogeneousCoordinates){m.positions=new Float32Array(y.length-y.length/4);for(var T=0;T<y.length;T+=4)m.positions[T]=y[T],m.positions[T+1]=y[T+1],m.positions[T+2]=y[T+2]}else m.positions=new Float32Array(y.length),m.positions.set(y);u.push(m.positions.length)}else if(-1!==v.indexOf("TEXCOORD_")){var x=Number(v.split("_")[1]),A=L.VertexBuffer.UVKind+(0===x?"":x+1),w=new Float32Array(y.length);w.set(y),k(w),m.set(w,A)}else"JOINT"===v?(m.matricesIndices=new Float32Array(y.length),m.matricesIndices.set(y)):"WEIGHT"===v?(m.matricesWeights=new Float32Array(y.length),m.matricesWeights.set(y)):"COLOR"===v&&(m.colors=new Float32Array(y.length),m.colors.set(y));if(b=e.accessors[_.indices])y=F.GetBufferFromAccessor(e,b),m.indices=new Int32Array(y.length),m.indices.set(y),f.push(m.indices.length);else{var O=[];for(T=0;T<m.positions.length/3;T++)O.push(T);m.indices=new Int32Array(O),f.push(m.indices.length)}s?s.merge(m):s=m;var M=e.scene.getMaterialById(_.material);i.push(null===M?F.GetDefaultMaterial(e.scene):M),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 L.MultiMaterial("multimat"+r,e.scene)).subMaterials=i:a=new L.StandardMaterial("multimat"+r,e.scene),1===i.length&&(a=i[0]),a._parentContainer=e.assetContainer,o.material||(o.material=a),new L.Geometry(r,e.scene,s,!1,o),o.computeWorldMatrix(!0),e.scene._blockEntityCollection=!1,o.subMeshes=[];var E=0;for(d=0;d<n.length;d++){var R;if(h=n[d],R=e.meshes[h])for(p=0;p<R.primitives.length;p++)R.primitives[p].mode,L.SubMesh.AddToMesh(E,l[E],u[E],c[E],f[E],o,o,!0),E++}return o},W=function(e,t,n,r){e.position&&(e.position=t),(e.rotationQuaternion||e.rotation)&&(e.rotationQuaternion=n),e.scaling&&(e.scaling=r)},z=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=Y(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 L.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&&!j(n,a.jointName)){var s=V(a),l=new L.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,d=0;d<f.length;d++){for(var h=null,p=0;p<r.length;p++)if(r[p].id===f[d]){h=r[p];break}h&&(h.bone._parent=c.bone,c.bone.children.push(h.bone))}}(e,r,t,o),r.bones=[];for(var i=0;i<t.jointNames.length;i++)if(y=U(e,t.jointNames[i])){var s=y.node;if(s){var l=y.id,u=e.scene.getBoneById(l);if(u)r.bones.push(u);else{for(var c=void 0,f=null,d=0;d<i;d++){var h=U(e,t.jointNames[d]);if(h){var p=h.node;if(p){var m=p.children;if(m){c=!1;for(var _=0;_<m.length;_++)if(m[_]===l){f=D(e,t,t.jointNames[d],r),c=!0;break}if(c)break}}else L.Tools.Warn("Joint named "+t.jointNames[d]+" does not exist when looking for parent")}}var g=V(s);!f&&o.length>0&&(f=K(o,l))&&-1===a.indexOf(f)&&a.push(f),new L.Bone(s.jointName||"",r,f,g).id=l}}else L.Tools.Warn("Joint named "+t.jointNames[i]+" does not exist")}var b=r.bones;for(r.bones=[],i=0;i<t.jointNames.length;i++){var y;if(y=U(e,t.jointNames[i]))for(d=0;d<b.length;d++)if(b[d].id===y.id){r.bones.push(b[d]);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=Y(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 L.FreeCamera(t.camera,L.Vector3.Zero(),e.scene,!1);s.name=t.name||"",s.mode=L.Camera.ORTHOGRAPHIC_CAMERA,s.attachControl(),r=s,s._parentContainer=e.assetContainer}else if("perspective"===i.type){var l=i[i.type],u=new L.FreeCamera(t.camera,L.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],d=new L.HemisphericLight(t.light,L.Vector3.Zero(),e.scene);d.name=t.name||"",f.color&&(d.diffuse=L.Color3.FromArray(f.color)),r=d}else if("directional"===c.type){var h=c[c.type],p=new L.DirectionalLight(t.light,L.Vector3.Zero(),e.scene);p.name=t.name||"",h.color&&(p.diffuse=L.Color3.FromArray(h.color)),r=p}else if("point"===c.type){var m=c[c.type],_=new L.PointLight(t.light,L.Vector3.Zero(),e.scene);_.name=t.name||"",m.color&&(_.diffuse=L.Color3.FromArray(m.color)),r=_}else if("spot"===c.type){var g=c[c.type],b=new L.SpotLight(t.light,L.Vector3.Zero(),L.Vector3.Zero(),0,0,e.scene);b.name=t.name||"",g.color&&(b.diffuse=L.Color3.FromArray(g.color)),g.fallOfAngle&&(b.angle=g.fallOfAngle),g.fallOffExponent&&(b.exponent=g.fallOffExponent),r=b}}if(!t.jointName){if(t.babylonNode)return t.babylonNode;if(null===r){e.scene._blockEntityCollection=!!e.assetContainer;var y=new L.Mesh(t.name||"",e.scene);y._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,t.babylonNode=y,r=y}}if(null!==r){if(t.matrix&&r instanceof L.Mesh)!function(e,t){if(t.matrix){var n=new L.Vector3(0,0,0),r=new L.Quaternion,o=new L.Vector3(0,0,0);L.Matrix.FromArray(t.matrix).decompose(o,r,n),W(e,n,r,o)}else t.translation&&t.rotation&&t.scale&&W(e,L.Vector3.FromArray(t.translation),L.Quaternion.FromArray(t.rotation),L.Vector3.FromArray(t.scale));e.computeWorldMatrix(!0)}(r,t);else{var v=t.translation||[0,0,0],T=t.rotation||[0,0,0,1],x=t.scale||[1,1,1];W(r,L.Vector3.FromArray(v),L.Quaternion.FromArray(T),L.Vector3.FromArray(x))}r.updateCache(!0),t.babylonNode=r}return r},Z=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=z(e,o,t))&&(a.id=t,a.parent=n),o.children)for(var i=0;i<o.children.length;i++)Z(e,o.children[i],a,r)},q=function(e){var t=e.currentScene;if(t)for(var n=0;n<t.nodes.length;n++)Z(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)Z(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=void 0,l=void 0;n.parameters?(s=n.parameters[i.input],l=n.parameters[i.output]):(s=i.input,l=i.output);var u=F.GetBufferFromAccessor(e,e.accessors[s]),c=F.GetBufferFromAccessor(e,e.accessors[l]),f=a.target.id,d=e.scene.getNodeById(f);if(null===d&&(d=e.scene.getNodeByName(f)),null!==d){var h=d instanceof L.Bone,p=a.target.path,m=N.indexOf(p);-1!==m&&(p=B[m]);var _=L.Animation.ANIMATIONTYPE_MATRIX;h||("rotationQuaternion"===p?(_=L.Animation.ANIMATIONTYPE_QUATERNION,d.rotationQuaternion=new L.Quaternion):_=L.Animation.ANIMATIONTYPE_VECTOR3);var g=null,b=[],y=0,v=!1;h&&r&&r.getKeys().length===u.length&&(g=r,v=!0),v||(e.scene._blockEntityCollection=!!e.assetContainer,g=new L.Animation(t,h?"_matrix":p,1,_,L.Animation.ANIMATIONLOOPMODE_CYCLE),e.scene._blockEntityCollection=!1);for(var T=0;T<u.length;T++){var x=void 0;if("rotationQuaternion"===p?(x=L.Quaternion.FromArray([c[y],c[y+1],c[y+2],c[y+3]]),y+=4):(x=L.Vector3.FromArray([c[y],c[y+1],c[y+2]]),y+=3),h){var A=d,w=L.Vector3.Zero(),O=new L.Quaternion,C=L.Vector3.Zero(),M=A.getBaseMatrix();v&&r&&(M=r.getKeys()[T].value),M.decompose(C,O,w),"position"===p?w=x:"rotationQuaternion"===p?O=x:C=x,x=L.Matrix.Compose(C,O,w)}v?r&&(r.getKeys()[T].value=x):b.push({frame:u[T],value:x})}!v&&g&&(g.setKeys(b),d.animations.push(g)),r=g,e.scene.stopAnimation(d),e.scene.beginAnimation(d,0,u[u.length-1],!0,1)}else L.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)}},X=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=S.indexOf(a.semantic);if(-1!==i)return delete n[r],I[i]}}return e.currentIdentifier},J=function(e){for(var t in e.materials)ee.LoadMaterialAsync(e,t,(function(){}),(function(){}))},Q=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&&H(e.extensions,"extensions",r),e.extensionsUsed&&H(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&&H(e.bufferViews,"bufferViews",r),e.accessors&&H(e.accessors,"accessors",r),e.meshes&&H(e.meshes,"meshes",r),e.lights&&H(e.lights,"lights",r),e.cameras&&H(e.cameras,"cameras",r),e.nodes&&H(e.nodes,"nodes",r),e.images&&H(e.images,"images",r),e.textures&&H(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&&H(e.programs,"programs",r),e.samplers&&H(e.samplers,"samplers",r),e.techniques&&H(e.techniques,"techniques",r),e.materials&&H(e.materials,"materials",r),e.animations&&H(e.animations,"animations",r),e.skins&&H(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];L.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(L.Tools.DecodeBase64(a.uri)))})):L.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];L.Tools.IsBase64(a.uri)?setTimeout((function(){return n(new Uint8Array(L.Tools.DecodeBase64(a.uri)))})):L.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===v.NEAREST_MIPMAP_NEAREST||a.minFilter===v.NEAREST_MIPMAP_LINEAR||a.minFilter===v.LINEAR_MIPMAP_NEAREST||a.minFilter===v.LINEAR_MIPMAP_LINEAR,s=L.Texture.BILINEAR_SAMPLINGMODE,l=null==n?new Blob:new Blob([(0,L.GetBlobBufferSource)(n)]),u=URL.createObjectURL(l),c=function(){return URL.revokeObjectURL(u)},f=new L.Texture(u,e.scene,!i,!0,s,c,c);void 0!==a.wrapS&&(f.wrapU=F.GetWrapMode(a.wrapS)),void 0!==a.wrapT&&(f.wrapV=F.GetWrapMode(a.wrapT)),f.name=t,o.babylonTexture=f,r(f)}},e.LoadShaderStringAsync=function(e,t,n,r){var o=e.shaders[t];if(L.Tools.IsBase64(o.uri)){var a=atob(o.uri.split(",")[1]);n&&n(a)}else L.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 L.StandardMaterial(t,e.scene);return i._parentContainer=e.assetContainer,e.scene._blockEntityCollection=!1,i.diffuseColor=new L.Color3(.5,.5,.5),i.sideOrientation=L.Material.CounterClockWiseSideOrientation,void n(i)}var s=e.programs[a.program],l=a.states,u=L.Effect.ShadersStore[s.vertexShader+"VertexShader"],c=L.Effect.ShadersStore[s.fragmentShader+"PixelShader"],f="",d="",h=new P(u),p=new P(c),m={},_=[],g=[],y=[];for(var v in a.uniforms){var T=a.uniforms[v],w=a.parameters[T];if(m[v]=w,!w.semantic||w.node||w.source)w.type===b.SAMPLER_2D?y.push(v):_.push(v);else{var O=S.indexOf(w.semantic);-1!==O?(_.push(I[O]),delete m[v]):_.push(v)}}for(var C in a.attributes){var M=a.attributes[C];if((B=a.parameters[M]).semantic){var E=G(B);E&&g.push(E)}}for(;!h.isEnd()&&h.getNextToken();)if(h.currentToken===R.IDENTIFIER){var N=!1;for(var C in a.attributes){M=a.attributes[C];var B=a.parameters[M];if(h.currentIdentifier===C&&B.semantic){f+=G(B),N=!0;break}}N||(f+=X(h,a,m))}else f+=h.currentString;for(;!p.isEnd()&&p.getNextToken();)p.currentToken===R.IDENTIFIER?d+=X(p,a,m):d+=p.currentString;var H={vertex:s.vertexShader+t,fragment:s.fragmentShader+t},k={attributes:g,uniforms:_,samplers:y,needAlphaBlending:l&&l.enable&&-1!==l.enable.indexOf(3042)};L.Effect.ShadersStore[s.vertexShader+t+"VertexShader"]=f,L.Effect.ShadersStore[s.fragmentShader+t+"PixelShader"]=d;var V=new L.ShaderMaterial(t,e.scene,H,k);if(V.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,V,r),V.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===b.SAMPLER_2D?ee.LoadTextureAsync(e,r.values?u:s.value,c(n),(function(){return c(null)})):s.value&&F.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===b.FLOAT_MAT2||c===b.FLOAT_MAT3||c===b.FLOAT_MAT4)if(!u.semantic||u.source||u.node){if(u.semantic&&(u.source||u.node)){var f=t.scene.getNodeByName(u.source||u.node||"");if(null===f&&(f=t.scene.getNodeById(u.source||u.node||"")),null===f)continue;F.SetMatrix(t.scene,f,u,l,r.getEffect())}}else F.SetMatrix(t.scene,e,u,l,r.getEffect());else{var d=s[o.uniforms[l]];if(!d)continue;if(c===b.SAMPLER_2D){var h=t.textures[a.values?d:u.value].babylonTexture;if(null==h)continue;r.getEffect().setTexture(l,h)}else F.SetUniform(r.getEffect(),l,d,c)}}i(r)}(i,e,o,t,n,r,a)}}}(e,V,a,o,m,n),V.sideOrientation=L.Material.CounterClockWiseSideOrientation,l&&l.functions){var D=l.functions;D.cullFace&&D.cullFace[0]!==x.BACK&&(V.backFaceCulling=!1);var K=D.blendFuncSeparate;K&&(K[0]===A.SRC_ALPHA&&K[1]===A.ONE_MINUS_SRC_ALPHA&&K[2]===A.ONE&&K[3]===A.ONE?V.alphaMode=L.Constants.ALPHA_COMBINE:K[0]===A.ONE&&K[1]===A.ONE&&K[2]===A.ZERO&&K[3]===A.ONE?V.alphaMode=L.Constants.ALPHA_ONEONE:K[0]===A.SRC_ALPHA&&K[1]===A.ONE&&K[2]===A.ZERO&&K[3]===A.ONE?V.alphaMode=L.Constants.ALPHA_ADD:K[0]===A.ZERO&&K[1]===A.ONE_MINUS_SRC_COLOR&&K[2]===A.ONE&&K[3]===A.ONE?V.alphaMode=L.Constants.ALPHA_SUBTRACT:K[0]===A.DST_COLOR&&K[1]===A.ZERO&&K[2]===A.ONE&&K[3]===A.ONE?V.alphaMode=L.Constants.ALPHA_MULTIPLY:K[0]===A.SRC_ALPHA&&K[1]===A.ONE_MINUS_SRC_COLOR&&K[2]===A.ONE&&K[3]===A.ONE&&(V.alphaMode=L.Constants.ALPHA_MAXIMIZED))}}else r&&r("No technique found.")},e}(),$=function(){function e(){}return e.RegisterExtension=function(t){e.Extensions[t.name]?L.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,ee.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=[],L.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 L.AbstractMesh&&n.push(s.babylonNode)}for(var u in t.skins){var c=t.skins[u];c.babylonSkeleton instanceof L.Skeleton&&r.push(c.babylonSkeleton)}l._loadBuffersAsync(t,(function(){l._loadShadersAsync(t,(function(){J(t),q(t),!C.GLTFFileLoader.IncrementalLoading&&a&&a(n,r)}))})),C.GLTFFileLoader.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,ee.LoadRuntimeAsync(e,t,n,(function(e){ee.LoadRuntimeExtensionsAsync(e,(function(){i._createNodes(e),i._loadBuffersAsync(e,(function(){i._loadShadersAsync(e,(function(){J(e),q(e),C.GLTFFileLoader.IncrementalLoading||r()}))})),C.GLTFFileLoader.IncrementalLoading&&r()}),a)}),a)},e.prototype.loadAsync=function(e,t,n,r){return(0,E.sH)(this,void 0,void 0,(function(){var o=this;return(0,E.YH)(this,(function(a){switch(a.label){case 0:return[4,new Promise((function(a,i){o._loadAsync(e,t,n,(function(){a()}),r,(function(e){i(new Error(e))}))}))];case 1:return[2,a.sent()]}}))}))},e.prototype._loadShadersAsync=function(e,t){var n=!1,r=function(n,r){ee.LoadShaderStringAsync(e,n,(function(o){o instanceof ArrayBuffer||(e.loadedShaderCount++,o&&(L.Effect.ShadersStore[n+(r.type===g.VERTEX?"VertexShader":"PixelShader")]=o),e.loadedShaderCount===e.shaderscount&&t())}),(function(){L.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)():L.Tools.Error("No shader named: "+o)}n||t()},e.prototype._loadBuffersAsync=function(e,t){var n=!1,r=function(n,r){ee.LoadBufferAsync(e,n,(function(o){e.loadedBufferCount++,o&&(o.byteLength!=e.buffers[n].byteLength&&L.Tools.Error("Buffer named "+n+" is length "+o.byteLength+". Expected: "+r.byteLength),e.loadedBufferViews[n]=o),e.loadedBufferCount===e.buffersCount&&t()}),(function(){L.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)():L.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++)Z(e,t.nodes[n],null);else for(var r in e.scenes)for(t=e.scenes[r],n=0;n<t.nodes.length;n++)Z(e,t.nodes[n],null)},e.Extensions={},e}(),ee=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(Q.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(){Q.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(){Q.LoadShaderStringAsync(t,n,r,o)}))},e.LoadMaterialAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadMaterialAsync(t,n,r,o)}),(function(){Q.LoadMaterialAsync(t,n,r,o)}))},e._LoadTextureBufferAsync=function(t,n,r,o){e._ApplyExtensions((function(e){return e.loadTextureBufferAsync(t,n,r,o)}),(function(){Q.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(){Q.CreateTextureAsync(t,n,r,o)}))},e._ApplyExtensions=function(e,t){for(var n in $.Extensions)if(e($.Extensions[n]))return;t()},e}();C.GLTFFileLoader._CreateGLTF1Loader=function(){return new $};var te=function(e){function t(){return e.call(this,"KHR_binary_glTF")||this}return(0,E.C6)(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(Q.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(F.GetBufferFromBufferView(e,i,0,i.byteLength,_.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=F.GetBufferFromBufferView(e,a,0,a.byteLength,_.UNSIGNED_BYTE);return setTimeout((function(){var e=F.DecodeBufferToText(i);n(e)})),!0},t}(ee);$.RegisterExtension(new te);var ne=function(e){function t(){return e.call(this,"KHR_materials_common")||this}return(0,E.C6)(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 L.HemisphericLight(o.name,new L.Vector3(0,1,0),e.scene),i=o.ambient;i&&(a.diffuse=L.Color3.FromArray(i.color||[1,1,1]));break;case"point":var s=new L.PointLight(o.name,new L.Vector3(10,10,10),e.scene),l=o.point;l&&(s.diffuse=L.Color3.FromArray(l.color||[1,1,1]));break;case"directional":var u=new L.DirectionalLight(o.name,new L.Vector3(0,-1,0),e.scene),c=o.directional;c&&(u.diffuse=L.Color3.FromArray(c.color||[1,1,1]));break;case"spot":var f=o.spot;f&&(new L.SpotLight(o.name,new L.Vector3(0,10,0),new L.Vector3(0,-1,0),f.fallOffAngle||Math.PI,f.fallOffExponent||0,e.scene).diffuse=L.Color3.FromArray(f.color||[1,1,1]));break;default:L.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 L.StandardMaterial(t,e.scene);return i.sideOrientation=L.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=L.Color3.FromArray(a.values.ambient||[0,0,0]),"string"==typeof a.values.diffuse?this._loadTexture(e,a.values.diffuse,i,"diffuseTexture",r):i.diffuseColor=L.Color3.FromArray(a.values.diffuse||[0,0,0]),"string"==typeof a.values.emission?this._loadTexture(e,a.values.emission,i,"emissiveTexture",r):i.emissiveColor=L.Color3.FromArray(a.values.emission||[0,0,0]),"string"==typeof a.values.specular?this._loadTexture(e,a.values.specular,i,"specularTexture",r):i.specularColor=L.Color3.FromArray(a.values.specular||[0,0,0]),!0},t.prototype._loadTexture=function(e,t,n,r,o){Q.LoadTextureBufferAsync(e,t,(function(o){Q.CreateTextureAsync(e,t,o,(function(e){return n[r]=e}))}),o)},t}(ee);$.RegisterExtension(new ne);var re=a(8625),oe=a(4015),ae=a(2727),ie=a(3833),se=a(2561),le=a(8698),ue=a(3251),ce=a(9499),fe=a(5549),de=a(10),he=a(6416),pe=a(4393),me=a(6396),_e=a(5890),ge=a(2493),be=a(2916),ye=a(4239),ve=a(8469),Te=a(2924),xe=a(2843),Ae=a(699),we=a(8842),Oe=a(3274),Ce=a(5478),Me=a(5418),Ee=a(5613),Re=a(9437),Le=a(4943),Fe=a(6528),Pe=a(1369),Se=a(3320),Ie=a(9553),Ne=a(8856),Be=a(789),He=a(5873),ke=a(410),Ge=a(5299),Ve=a(5898),De=a(3218),Ke=a(2658),Ue=a(4439),je=a(6629),Ye=a(3757),We=a(947),ze=a(6465),Ze=a(8875),qe=a(4158),Xe=a(1943),Je=a(9222),Qe=a(1274),$e=a(4028),et=a(3382),tt=a(8778),nt=a(7122),rt=a(1063),ot=a(7347),at=a(6423),it=a(9363),st=a(9003),lt=a(3291);function ut(){var e=this;(0,L.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},ot.T),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3914))];case 1:return[2,new(0,e.sent().BVHFileLoader)(t[ot.T.name])]}}))}))}})),(0,L.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},at._),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8625))];case 1:return[2,new(0,e.sent().GLTFFileLoader)(t[at._.name])]}}))}))}})),function(){var e=this;(0,oe.Hg)("EXT_lights_image_based"),(0,oe.Ye)("EXT_lights_image_based",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3251))];case 1:return[2,new(0,e.sent().EXT_lights_image_based)(t)]}}))}))})),(0,oe.Hg)("EXT_mesh_gpu_instancing"),(0,oe.Ye)("EXT_mesh_gpu_instancing",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,9499))];case 1:return[2,new(0,e.sent().EXT_mesh_gpu_instancing)(t)]}}))}))})),(0,oe.Hg)("EXT_meshopt_compression"),(0,oe.Ye)("EXT_meshopt_compression",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5549))];case 1:return[2,new(0,e.sent().EXT_meshopt_compression)(t)]}}))}))})),(0,oe.Hg)("EXT_texture_avif"),(0,oe.Ye)("EXT_texture_avif",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6416))];case 1:return[2,new(0,e.sent().EXT_texture_avif)(t)]}}))}))})),(0,oe.Hg)("EXT_texture_webp"),(0,oe.Ye)("EXT_texture_webp",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,10))];case 1:return[2,new(0,e.sent().EXT_texture_webp)(t)]}}))}))})),(0,oe.Hg)("ExtrasAsMetadata"),(0,oe.Ye)("ExtrasAsMetadata",!1,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4158))];case 1:return[2,new(0,e.sent().ExtrasAsMetadata)(t)]}}))}))})),(0,oe.Hg)("KHR_animation_pointer"),(0,oe.Ye)("KHR_animation_pointer",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5898))];case 1:return[2,new(0,e.sent().KHR_animation_pointer)(t)]}}))}))})),(0,oe.Hg)("KHR_draco_mesh_compression"),(0,oe.Ye)("KHR_draco_mesh_compression",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6396))];case 1:return[2,new(0,e.sent().KHR_draco_mesh_compression)(t)]}}))}))})),(0,oe.Hg)("KHR_interactivity"),(0,oe.Ye)("KHR_interactivity",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3757))];case 1:return[2,new(0,e.sent().KHR_interactivity)(t)]}}))}))})),(0,oe.Hg)("KHR_lights_punctual"),(0,oe.Ye)("KHR_lights_punctual",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5890))];case 1:return[2,new(0,e.sent().KHR_lights)(t)]}}))}))})),(0,oe.Hg)("EXT_lights_area"),(0,oe.Ye)("EXT_lights_area",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2493))];case 1:return[2,new(0,e.sent().EXT_lights_area)(t)]}}))}))})),(0,oe.Hg)("EXT_lights_ies"),(0,oe.Ye)("EXT_lights_ies",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4393))];case 1:return[2,new(0,e.sent().EXT_lights_ies)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_anisotropy"),(0,oe.Ye)("KHR_materials_anisotropy",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,699))];case 1:return[2,new(0,e.sent().KHR_materials_anisotropy)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_clearcoat"),(0,oe.Ye)("KHR_materials_clearcoat",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8469))];case 1:return[2,new(0,e.sent().KHR_materials_clearcoat)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_diffuse_roughness"),(0,oe.Ye)("KHR_materials_diffuse_roughness",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8856))];case 1:return[2,new(0,e.sent().KHR_materials_diffuse_roughness)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_diffuse_transmission"),(0,oe.Ye)("KHR_materials_diffuse_transmission",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6528))];case 1:return[2,new(0,e.sent().KHR_materials_diffuse_transmission)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_dispersion"),(0,oe.Ye)("KHR_materials_dispersion",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,9553))];case 1:return[2,new(0,e.sent().KHR_materials_dispersion)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_emissive_strength"),(0,oe.Ye)("KHR_materials_emissive_strength",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8842))];case 1:return[2,new(0,e.sent().KHR_materials_emissive_strength)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_ior"),(0,oe.Ye)("KHR_materials_ior",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5613))];case 1:return[2,new(0,e.sent().KHR_materials_ior)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_iridescence"),(0,oe.Ye)("KHR_materials_iridescence",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2843))];case 1:return[2,new(0,e.sent().KHR_materials_iridescence)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_pbrSpecularGlossiness"),(0,oe.Ye)("KHR_materials_pbrSpecularGlossiness",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2916))];case 1:return[2,new(0,e.sent().KHR_materials_pbrSpecularGlossiness)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_sheen"),(0,oe.Ye)("KHR_materials_sheen",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3274))];case 1:return[2,new(0,e.sent().KHR_materials_sheen)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_specular"),(0,oe.Ye)("KHR_materials_specular",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5418))];case 1:return[2,new(0,e.sent().KHR_materials_specular)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_transmission"),(0,oe.Ye)("KHR_materials_transmission",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4943))];case 1:return[2,new(0,e.sent().KHR_materials_transmission)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_unlit"),(0,oe.Ye)("KHR_materials_unlit",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4239))];case 1:return[2,new(0,e.sent().KHR_materials_unlit)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_variants"),(0,oe.Ye)("KHR_materials_variants",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,9437))];case 1:return[2,new(0,e.sent().KHR_materials_variants)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_volume"),(0,oe.Ye)("KHR_materials_volume",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,1369))];case 1:return[2,new(0,e.sent().KHR_materials_volume)(t)]}}))}))})),(0,oe.Hg)("KHR_mesh_quantization"),(0,oe.Ye)("KHR_mesh_quantization",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,789))];case 1:return[2,new(0,e.sent().KHR_mesh_quantization)(t)]}}))}))})),(0,oe.Hg)("KHR_texture_basisu"),(0,oe.Ye)("KHR_texture_basisu",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5873))];case 1:return[2,new(0,e.sent().KHR_texture_basisu)(t)]}}))}))})),(0,oe.Hg)("KHR_texture_transform"),(0,oe.Ye)("KHR_texture_transform",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,410))];case 1:return[2,new(0,e.sent().KHR_texture_transform)(t)]}}))}))})),(0,oe.Hg)("KHR_xmp_json_ld"),(0,oe.Ye)("KHR_xmp_json_ld",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5299))];case 1:return[2,new(0,e.sent().KHR_xmp_json_ld)(t)]}}))}))})),(0,oe.Hg)("MSFT_audio_emitter"),(0,oe.Ye)("MSFT_audio_emitter",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3218))];case 1:return[2,new(0,e.sent().MSFT_audio_emitter)(t)]}}))}))})),(0,oe.Hg)("MSFT_lod"),(0,oe.Ye)("MSFT_lod",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2658))];case 1:return[2,new(0,e.sent().MSFT_lod)(t)]}}))}))})),(0,oe.Hg)("MSFT_minecraftMesh"),(0,oe.Ye)("MSFT_minecraftMesh",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,4439))];case 1:return[2,new(0,e.sent().MSFT_minecraftMesh)(t)]}}))}))})),(0,oe.Hg)("MSFT_sRGBFactors"),(0,oe.Ye)("MSFT_sRGBFactors",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6629))];case 1:return[2,new(0,e.sent().MSFT_sRGBFactors)(t)]}}))}))})),(0,oe.Hg)("KHR_node_visibility"),(0,oe.Ye)("KHR_node_visibility",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,947))];case 1:return[2,new(0,e.sent().KHR_node_visibility)(t)]}}))}))})),(0,oe.Hg)("KHR_node_hoverability"),(0,oe.Ye)("KHR_node_hoverability",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8875))];case 1:return[2,new(0,e.sent().KHR_node_hoverability)(t)]}}))}))})),(0,oe.Hg)("KHR_node_selectability"),(0,oe.Ye)("KHR_node_selectability",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,6465))];case 1:return[2,new(0,e.sent().KHR_node_selectability)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_coat"),(0,oe.Ye)("KHR_materials_coat",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,2924))];case 1:return[2,new(0,e.sent().KHR_materials_coat)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_fuzz"),(0,oe.Ye)("KHR_materials_fuzz",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,5478))];case 1:return[2,new(0,e.sent().KHR_materials_fuzz)(t)]}}))}))})),(0,oe.Hg)("KHR_materials_volume_scatter"),(0,oe.Ye)("KHR_materials_volume_scatter",!0,(function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,3320))];case 1:return[2,new(0,e.sent().KHR_materials_volume_scatter)(t)]}}))}))}))}(),(0,L.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},it.M),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,8778))];case 1:return[2,new(0,e.sent().OBJFileLoader)(t[it.M.name])]}}))}))}})),(0,L.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},st.B),{createPlugin:function(t){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,1063))];case 1:return[2,new(0,e.sent().SPLATFileLoader)(t[st.B.name])]}}))}))}})),(0,L.RegisterSceneLoaderPlugin)((0,E.Cl)((0,E.Cl)({},lt.W),{createPlugin:function(){return(0,E.sH)(e,void 0,void 0,(function(){return(0,E.YH)(this,(function(e){switch(e.label){case 0:return[4,Promise.resolve().then(a.bind(a,7122))];case 1:return[2,new(0,e.sent().STLFileLoader)]}}))}))}}))}var ct=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==ct)for(var ft in s)ct.BABYLON[ft]||(ct.BABYLON[ft]=s[ft]);var dt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==dt)for(var ht in dt.BABYLON=dt.BABYLON||{},p)dt.BABYLON[ht]=p[ht];var pt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==pt){for(var mt in pt.BABYLON=pt.BABYLON||{},C)pt.BABYLON[mt]=C[mt];for(var mt in M)pt.BABYLON[mt]=M[mt]}var _t=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==_t)for(var gt in _t.BABYLON=_t.BABYLON||{},_t.BABYLON.GLTF1=_t.BABYLON.GLTF1||{},l)_t.BABYLON.GLTF1[gt]=l[gt];var bt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==bt){bt.BABYLON=bt.BABYLON||{};var yt=bt.BABYLON;yt.GLTF2=yt.GLTF2||{},yt.GLTF2.Loader=yt.GLTF2.Loader||{},yt.GLTF2.Loader.Extensions=yt.GLTF2.Loader.Extensions||{};var vt=[];for(var Tt in c)yt.GLTF2.Loader.Extensions[Tt]=c[Tt],vt.push(Tt);for(var Tt in u)yt.GLTF2.Loader[Tt]=u[Tt],vt.push(Tt);for(var Tt in f)vt.indexOf(Tt)>-1||(yt.GLTF2[Tt]=f[Tt])}var xt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==xt)for(var At in d)xt.BABYLON[At]||(xt.BABYLON[At]=d[At]);var wt=void 0!==a.g?a.g:"undefined"!=typeof window?window:void 0;if(void 0!==wt)for(var Ot in h)wt.BABYLON[Ot]||(wt.BABYLON[Ot]=h[Ot]);const Ct=m;return i.default})()));
2
2
  //# sourceMappingURL=babylonjs.loaders.min.js.map