@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
1 lines • 20.2 kB
JavaScript
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4399],{24045:(e,t,r)=>{function o(e,t){const r=e.count;t||(t=new e.TypedArrayConstructor(r));for(let o=0;o<r;o++)t[o]=e.get(o);return t}r.d(t,{m:()=>o}),Object.freeze(Object.defineProperty({__proto__:null,makeDense:o},Symbol.toStringTag,{value:"Module"}))},4399:(e,t,r)=>{r.d(t,{loadGLTF:()=>P});var o,n,s=r(53966),a=r(9093),i=r(63907),u=r(49186),l=r(91869),c=r(74887),f=r(84952),d=r(46140),p=r(58083),h=r(67026),m=r(82534),T=r(13030),w=r(24045);r(44208);class g{constructor(e){this._data=e,this._offset4=0,this._dataUint32=new Uint32Array(this._data,0,Math.floor(this._data.byteLength/4))}readUint32(){const e=this._offset4;return this._offset4+=1,this._dataUint32[e]}readUint8Array(e){const t=4*this._offset4;return this._offset4+=e/4,new Uint8Array(this._data,t,e)}remainingBytes(){return this._data.byteLength-4*this._offset4}}!function(e){e.SCALAR="SCALAR",e.VEC2="VEC2",e.VEC3="VEC3",e.VEC4="VEC4",e.MAT2="MAT2",e.MAT3="MAT3",e.MAT4="MAT4"}(o||(o={})),function(e){e[e.ARRAY_BUFFER=34962]="ARRAY_BUFFER",e[e.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(n||(n={}));var x=r(21818);const b={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},y={pbrMetallicRoughness:b,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},_={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},A=(e={})=>{const t={...b,...e.pbrMetallicRoughness},r=function(e){switch(e.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:(0,x.Xb)(e.ESRI_externalColorMixMode),e.ESRI_externalColorMixMode="tint"}return e}({..._,...e.extras});return{...y,...e,pbrMetallicRoughness:t,extras:r}},S={magFilter:i.Cj.LINEAR,minFilter:i.Cj.LINEAR_MIPMAP_LINEAR,wrapS:i.pF.REPEAT,wrapT:i.pF.REPEAT};var R=r(51530);const E=1179937895;class O{constructor(e,t,r,o){if(this._context=e,this.uri=t,this.json=r,this._glbBuffer=o,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform"],this._baseUri=function(e){let t,r;return e.replace(/^(.*\/)?([^/]*)$/,((e,o,n)=>(t=o||"",r=n||"",""))),{dirPart:t,filePart:r}}(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==r.scenes)throw new u.A("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==r.meshes)throw new u.A("gltf-loader-unsupported-feature","Meshes must be defined");if(null==r.nodes)throw new u.A("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,t,r){if((0,f.DB)(t)){const r=(0,f.r$)(t);if(r&&"model/gltf-binary"!==r.mediaType)try{const o=JSON.parse(r.isBase64?atob(r.data):r.data);return new O(e,t,o)}catch{}const o=(0,f.lJ)(t);if(O._isGLBData(o))return this._fromGLBData(e,t,o)}if(U.test(t)||"gltf"===r?.expectedType){const o=await e.loadJSON(t,r);return new O(e,t,o)}const o=await e.loadBinary(t,r);if(O._isGLBData(o))return this._fromGLBData(e,t,o);if(D.test(t)||"glb"===r?.expectedType)throw new u.A("gltf-loader-invalid-glb","This is not a valid glb file.");const n=await e.loadJSON(t,r);return new O(e,t,n)}static _isGLBData(e){if(null==e)return!1;const t=new g(e);return t.remainingBytes()>=4&&t.readUint32()===E}static async _fromGLBData(e,t,r){const o=await O._parseGLBData(r);return new O(e,t,o.json,o.binaryData)}static async _parseGLBData(e){const t=new g(e);if(t.remainingBytes()<12)throw new u.A("gltf-loader-error","glb binary data is insufficiently large.");const r=t.readUint32(),o=t.readUint32(),n=t.readUint32();if(r!==E)throw new u.A("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength<n)throw new u.A("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==o)throw new u.A("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let a,i,l=0;for(;t.remainingBytes()>=8;){const e=t.readUint32(),r=t.readUint32();if(0===l){if(1313821514!==r)throw new u.A("gltf-loader-error","First glb chunk must be JSON.");if(e<0)throw new u.A("gltf-loader-error","No JSON data found.");a=await(0,R.KB)(t.readUint8Array(e))}else if(1===l){if(5130562!==r)throw new u.A("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");i=t.readUint8Array(e)}else s.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");l+=1}if(!a)throw new u.A("gltf-loader-error","No glb JSON chunk detected.");return{json:a,binaryData:i}}async getBuffer(e,t){const r=this.json.buffers[e];if(null==r.uri){if(null==this._glbBuffer)throw new u.A("gltf-loader-error","glb buffer not present");return this._glbBuffer}const o=await this._getBufferLoader(e,t);if(o.byteLength!==r.byteLength)throw new u.A("gltf-loader-error","Buffer byte lengths should match.");return o}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const o=this.json.buffers[e].uri,n=this._context.loadBinary(this._resolveUri(o),t).then((e=>new Uint8Array(e)));return this._bufferLoaders.set(e,n),n}async getAccessor(e,t){if(!this.json.accessors)throw new u.A("gltf-loader-unsupported-feature","Accessors missing.");const r=this.json.accessors[e];if(null==r?.bufferView)throw new u.A("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");if(r.type in[o.MAT2,o.MAT3,o.MAT4])throw new u.A("gltf-loader-unsupported-feature",`AttributeType ${r.type} is not supported`);const n=this.json.bufferViews[r.bufferView],s=await this.getBuffer(n.buffer,t),a=M[r.type],i=I[r.componentType],l=a*i,c=n.byteStride||l;return{raw:s.buffer,byteStride:c,byteOffset:s.byteOffset+(n.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:c===l,componentCount:a,componentByteSize:i,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t){if(null==e.indices)return;const r=await this.getAccessor(e.indices,t);if(r.isDenselyPacked)switch(r.componentType){case i.pe.UNSIGNED_BYTE:return new Uint8Array(r.raw,r.byteOffset,r.entryCount);case i.pe.UNSIGNED_SHORT:return new Uint16Array(r.raw,r.byteOffset,r.entryCount);case i.pe.UNSIGNED_INT:return new Uint32Array(r.raw,r.byteOffset,r.entryCount)}else switch(r.componentType){case i.pe.UNSIGNED_BYTE:return(0,w.m)(L(T.SL,r));case i.pe.UNSIGNED_SHORT:return(0,w.m)(L(T.h,r));case i.pe.UNSIGNED_INT:return(0,w.m)(L(T.P,r))}}async getPositionData(e,t){if(null==e.attributes.POSITION)throw new u.A("gltf-loader-unsupported-feature","No POSITION vertex data found.");const r=await this.getAccessor(e.attributes.POSITION,t);if(r.componentType!==i.pe.FLOAT)throw new u.A("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+i.pe[r.componentType]);if(3!==r.componentCount)throw new u.A("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+r.componentCount.toFixed());return L(T.xs,r)}async getNormalData(e,t){if(null==e.attributes.NORMAL)throw new u.A("gltf-loader-error","No NORMAL vertex data found.");const r=await this.getAccessor(e.attributes.NORMAL,t);if(r.componentType!==i.pe.FLOAT)throw new u.A("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+i.pe[r.componentType]);if(3!==r.componentCount)throw new u.A("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+r.componentCount.toFixed());return L(T.xs,r)}async getTangentData(e,t){if(null==e.attributes.TANGENT)throw new u.A("gltf-loader-error","No TANGENT vertex data found.");const r=await this.getAccessor(e.attributes.TANGENT,t);if(r.componentType!==i.pe.FLOAT)throw new u.A("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+i.pe[r.componentType]);if(4!==r.componentCount)throw new u.A("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+r.componentCount.toFixed());return L(T.Eq,r)}async getTextureCoordinates(e,t){if(null==e.attributes.TEXCOORD_0)throw new u.A("gltf-loader-error","No TEXCOORD_0 vertex data found.");const r=await this.getAccessor(e.attributes.TEXCOORD_0,t);if(2!==r.componentCount)throw new u.A("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+r.componentCount.toFixed());if(r.componentType===i.pe.FLOAT)return L(T.gH,r);if(!r.normalized)throw new u.A("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return function(e){switch(e.componentType){case i.pe.BYTE:return new T.D6(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.pe.UNSIGNED_BYTE:return new T.LC(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.pe.SHORT:return new T.mJ(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.pe.UNSIGNED_SHORT:return new T.Yi(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.pe.UNSIGNED_INT:return new T.An(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case i.pe.FLOAT:return new T.gH(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}(r)}async getVertexColors(e,t){if(null==e.attributes.COLOR_0)throw new u.A("gltf-loader-error","No COLOR_0 vertex data found.");const r=await this.getAccessor(e.attributes.COLOR_0,t);if(4!==r.componentCount&&3!==r.componentCount)throw new u.A("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+r.componentCount.toFixed());if(4===r.componentCount){if(r.componentType===i.pe.FLOAT)return L(T.Eq,r);if(r.componentType===i.pe.UNSIGNED_BYTE)return L(T.XP,r);if(r.componentType===i.pe.UNSIGNED_SHORT)return L(T.Uz,r)}else if(3===r.componentCount){if(r.componentType===i.pe.FLOAT)return L(T.xs,r);if(r.componentType===i.pe.UNSIGNED_BYTE)return L(T.eI,r);if(r.componentType===i.pe.UNSIGNED_SHORT)return L(T.nS,r)}throw new u.A("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+i.pe[r.componentType])}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let o=e.material?this._materialCache.get(e.material):void 0;if(!o){const n=null!=e.material?A(this.json.materials[e.material]):A(),s=n.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(n.normalTexture,t),l=r?this.getTexture(n.occlusionTexture,t):void 0,c=r?this.getTexture(n.emissiveTexture,t):void 0,f=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,d=null!=e.material?e.material:-1;o={alphaMode:n.alphaMode,alphaCutoff:n.alphaCutoff,color:s.baseColorFactor,doubleSided:!!n.doubleSided,colorTexture:await i,normalTexture:await u,name:n.name,id:d,occlusionTexture:await l,emissiveTexture:await c,emissiveFactor:n.emissiveFactor,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await f,hasVertexColors:a,ESRI_externalColorMixMode:n.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:n.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:n.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:n.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:n.extras.ESRI_receiveAmbientOcclusion,receiveShadows:n.extras.ESRI_receiveShadows}}return o}async getTexture(e,t){if(!e)return;if(0!==(e.texCoord||0))throw new u.A("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const r=e.index,o=this.json.textures[r],n=(c=null!=o.sampler?this.json.samplers[o.sampler]:{},{...S,...c}),s=F(o),a=this.json.images[s],i=await this._loadTextureImageData(r,o,t);var c;return(0,l.tE)(this._textureCache,r,(()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>{throw new u.A("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${e}`)};return{data:i,wrapS:e(n.wrapS)?n.wrapS:t(n.wrapS),wrapT:e(n.wrapT)?n.wrapT:t(n.wrapT),minFilter:n.minFilter,name:a.name,id:r}}))}getNodeTransform(e){if(void 0===e)return N;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),o=this.json.nodes[e];o.matrix?t=(0,p.lw)((0,a.vt)(),r,o.matrix):o.translation||o.rotation||o.scale?(t=(0,a.o8)(r),o.translation&&(0,p.Tl)(t,t,o.translation),o.rotation&&(C[3]=(0,h.Xd)(C,o.rotation),(0,p.e$)(t,t,C[3],C)),o.scale&&(0,p.hs)(t,t,o.scale)):t=(0,a.o8)(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return(0,f.s2)(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=d.R.parse(this.json.asset.version,"glTF");v.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every((e=>this._supportedExtensions.includes(e))))throw new u.A("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach(((e,t)=>{e.children&&e.children.forEach((e=>{this._nodeParentMap.set(e,t)}))}))}async _loadTextureImageData(e,t,r){const o=this._textureLoaders.get(e);if(o)return o;const n=this._createTextureLoader(t,r);return this._textureLoaders.set(e,n),n}async _createTextureLoader(e,t){const r=F(e),o=this.json.images[r];if(o.uri){if(o.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(o.uri),t);return new R.Xi(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(o.uri),t)}if(null==o.bufferView)throw new u.A("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==o.mimeType)throw new u.A("gltf-loader-unsupported-feature","Image mimeType must be defined.");const n=this.json.bufferViews[o.bufferView],s=await this.getBuffer(n.buffer,t);if(null!=n.byteStride)throw new u.A("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const a=s.byteOffset+(n.byteOffset||0);return(0,R.pn)(new Uint8Array(s.buffer,a,n.byteLength),o.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await(0,c.nA)(Array.from(this._bufferLoaders.values())),t=await(0,c.nA)(Array.from(this._textureLoaders.values()));return e.reduce(((e,t)=>e+(t?.byteLength??0)),0)+t.reduce(((e,t)=>e+(t?(0,R.x3)(t)?t.data.byteLength:t.width*t.height*4:0)),0)}}const N=(0,p.hM)((0,a.vt)(),Math.PI/2),v=new d.R(2,0,"glTF"),C=(0,m.vt)(),M={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},I={[i.pe.BYTE]:1,[i.pe.UNSIGNED_BYTE]:1,[i.pe.SHORT]:2,[i.pe.UNSIGNED_SHORT]:2,[i.pe.HALF_FLOAT]:2,[i.pe.FLOAT]:4,[i.pe.INT]:4,[i.pe.UNSIGNED_INT]:4};function L(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function F(e){if(null!=e.extensions?.KHR_texture_basisu)return e.extensions.KHR_texture_basisu.source;if(null!==e.source)return e.source;throw new u.A("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const U=/\.gltf$/i,D=/\.glb$/i;let B=0;async function P(e,t,r={},o=!0){const n=await O.load(e,t,r),u="gltf_"+B++,l={lods:[],materials:new Map,textures:new Map,meta:G(n)},c=!(!n.json.asset.extras||"symbolResource"!==n.json.asset.extras.ESRI_type),f=n.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;await j(n,(async(e,t,c,f)=>{const p=d.get(c)??0;d.set(c,p+1);const h=void 0!==e.mode?e.mode:i.WR.TRIANGLES,m=h===i.WR.TRIANGLES||h===i.WR.TRIANGLE_STRIP||h===i.WR.TRIANGLE_FAN?h:null;if(null==m)return void s.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+i.WR[h]+"). Skipping primitive.");if(!n.hasPositions(e))return void s.A.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const T=n.getPositionData(e,r),w=n.getMaterial(e,r,o),g=n.hasNormals(e)?n.getNormalData(e,r):null,x=n.hasTangents(e)?n.getTangentData(e,r):null,b=n.hasTextureCoordinates(e)?n.getTextureCoordinates(e,r):null,y=n.hasVertexColors(e)?n.getVertexColors(e,r):null,_=n.getIndexData(e,r),A={name:f,transform:(0,a.o8)(t),attributes:{position:await T,normal:g?await g:null,texCoord0:b?await b:null,color:y?await y:null,tangent:x?await x:null},indices:await _,primitiveType:m,material:k(l,await w,u)};let S=null;null!=l.meta?.ESRI_lod&&"screenSpaceRadius"===l.meta.ESRI_lod.metric&&(S=l.meta.ESRI_lod.thresholds[c]),l.lods[c]=l.lods[c]||{parts:[],name:f,lodThreshold:S},l.lods[c].parts[p]=A}));for(const e of l.lods)e.parts=e.parts.filter((e=>!!e));const p=await n.getLoadedBuffersSize();return{model:l,meta:{isEsriSymbolResource:c,uri:n.uri,ESRI_webstyle:f},customMeta:{},cachedMemory:p}}function G(e){const t=e.json;let r=null;return t.nodes.forEach((e=>{const t=e.extras;null!=t&&(t.ESRI_proxyEllipsoid||t.ESRI_lod)&&(r=t)})),r}async function j(e,t){const r=e.json,o=r.scenes[r.scene||0].nodes,n=o.length>1,a=[];for(const e of o){const t=r.nodes[e];a.push(i(e,0)),V(t)&&!n&&t.extensions.MSFT_lod.ids.forEach(((e,t)=>i(e,t+1)))}async function i(o,n){const u=r.nodes[o],l=e.getNodeTransform(o);if(null!=u.weights&&s.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=u.mesh){const e=r.meshes[u.mesh];for(const r of e.primitives)a.push(t(r,l,n,e.name))}for(const e of u.children||[])a.push(i(e,n))}await Promise.all(a)}function V(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function k(e,t,r){const o=t=>{const o=`${r}_tex_${t&&t.id}${t?.name?"_"+t.name:""}`;if(t&&!e.textures.has(o)){const r=function(e,t={}){return{data:e,parameters:{wrap:{s:i.pF.REPEAT,t:i.pF.REPEAT,...t.wrap},noUnpackFlip:!0,mipmap:!1,...t}}}(t.data,{wrap:{s:t.wrapS,t:t.wrapT},mipmap:H.has(t.minFilter),noUnpackFlip:!0});e.textures.set(o,r)}return o},n=`${r}_mat_${t.id}_${t.name}`;if(!e.materials.has(n)){const r=function(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclustion:!0,colorTexture:null,normalTexture:null,occlusionTexture:null,emissiveTexture:null,metallicRoughnessTexture:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,colorTexture:t.colorTexture?o(t.colorTexture):void 0,normalTexture:t.normalTexture?o(t.normalTexture):void 0,occlusionTexture:t.occlusionTexture?o(t.occlusionTexture):void 0,emissiveTexture:t.emissiveTexture?o(t.emissiveTexture):void 0,metallicRoughnessTexture:t.metallicRoughnessTexture?o(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform,metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor,receiveShadows:t.receiveShadows,receiveAmbientOcclustion:t.receiveAmbientOcclusion});e.materials.set(n,r)}return n}const H=new Set([i.Cj.LINEAR_MIPMAP_LINEAR,i.Cj.LINEAR_MIPMAP_NEAREST])}}]);