// All material copyright Esri, All Rights Reserved, unless otherwise specified. // See https://js.arcgis.com/4.30/esri/copyright.txt for details. //>>built require({cache:{"esri/views/webgl/BufferObject":function(){define("exports ../../core/arrayUtils ../../core/has ../../core/Logger ../../core/typedArrayUtil ./checkWebGLError ./enums".split(" "),function(c,a,y,e,n,z,h){class m{static createIndex(w,v,d){return new m(w,h.BufferType.ELEMENT_ARRAY_BUFFER,v,d)}static createVertex(w,v,d){return new m(w,h.BufferType.ARRAY_BUFFER,v,d)}static createUniform(w,v,d){return new m(w,h.BufferType.UNIFORM_BUFFER,v,d)}static createPixelPack(w,v=h.Usage.STREAM_READ, d){w=new m(w,h.BufferType.PIXEL_PACK_BUFFER,v);d&&w.setSize(d);return w}static createPixelUnpack(w,v=h.Usage.STREAM_DRAW,d){return new m(w,h.BufferType.PIXEL_UNPACK_BUFFER,v,d)}static createTransformFeedback(w,v=h.Usage.STATIC_DRAW,d){w=new m(w,h.BufferType.TRANSFORM_FEEDBACK_BUFFER,v);w.setSize(d);return w}constructor(w,v,d,k){this._context=w;this.bufferType=v;this.usage=d;this._glName=null;this._size=-1;this._indexType=void 0;w.instanceCounter.increment(h.ResourceType.BufferObject,this);this._glName= this._context.gl.createBuffer();z.checkWebGLError(this._context.gl);k&&this.setData(k)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get usedMemory(){return this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER?this._indexType===h.DataType.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER||this.bufferType===h.BufferType.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&& (this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(h.ResourceType.BufferObject,this),this._context=null):this._glName&&e.getLogger("esri.views.webgl.BufferObject").warn("Leaked WebGL buffer object")}setSize(w,v=null){if(this.bufferType===h.BufferType.ELEMENT_ARRAY_BUFFER&&null!=v)switch(this._indexType=v,v){case h.DataType.UNSIGNED_SHORT:w*=2;break;case h.DataType.UNSIGNED_INT:w*=4}this._setBufferData(w)}setData(w){if(w){var v=w.byteLength;this.bufferType=== h.BufferType.ELEMENT_ARRAY_BUFFER&&(n.isUint16Array(w)&&(v/=2,this._indexType=h.DataType.UNSIGNED_SHORT),n.isUint32Array(w)&&(v/=4,this._indexType=h.DataType.UNSIGNED_INT));this._setBufferData(v,w)}}_setBufferData(w,v=null){this._size=w;const d=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null);this._context.bindBuffer(this);const k=this._context.gl;null!=v?k.bufferData(this.bufferType,v,this.usage):k.bufferData(this.bufferType,w,this.usage);z.checkWebGLError(k);this._isVAOAware&& this._context.bindVAO(d)}setSubData(w,v,d,k){if(w){var q=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null);this._context.bindBuffer(this);var {gl:A}=this._context;A.bufferSubData(this.bufferType,v*w.BYTES_PER_ELEMENT,w,d,k-d);z.checkWebGLError(A);this._isVAOAware&&this._context.bindVAO(q)}}getSubData(w,v=0,d,k){if(!(0>d||0>k)){var q=a.isArrayLike(w)?w.BYTES_PER_ELEMENT:1;q*((d??0)+(k??0))>w.byteLength||(v+q*(k??0)>this.usedMemory&&e.getLogger("esri.views.webgl.BufferObject").warn("Potential problem getting subdata: requested data exceeds buffer size!"), q=this._context.gl,this.bufferType===h.BufferType.TRANSFORM_FEEDBACK_BUFFER?(this._context.bindBuffer(this,h.BufferType.TRANSFORM_FEEDBACK_BUFFER),q.getBufferSubData(h.BufferType.TRANSFORM_FEEDBACK_BUFFER,v,w,d,k),this._context.unbindBuffer(h.BufferType.TRANSFORM_FEEDBACK_BUFFER)):(this._context.bindBuffer(this,h.BufferType.COPY_READ_BUFFER),q.getBufferSubData(h.BufferType.COPY_READ_BUFFER,v,w,d,k),this._context.unbindBuffer(h.BufferType.COPY_READ_BUFFER)))}}async getSubDataAsync(w,v=0,d,k){await this._context.clientWaitAsync(); this.getSubData(w,v,d,k)}}c.BufferObject=m;c.tracer=null;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/checkWebGLError":function(){define(["exports","../../core/Error","../../core/has","../../core/Logger"],function(c,a,y,e){function n(h,m){switch(m){case h.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case h.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case h.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state."; case h.INVALID_FRAMEBUFFER_OPERATION:return"Invalid Framebuffer operation. The currently bound framebuffer is not framebuffer complete when trying to render to or to read from it.";case h.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case h.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const z=!!y("enable-feature:webgl-debug");c.checkWebGLError=function(h){if(z){var m=h.getError();m&&(h=n(h,m),m=Error().stack,e.getLogger("esri.views.webgl.checkWebGLError").error(new a("webgl-error", "WebGL error occurred",{message:h,stack:m})))}};c.hasFeatureFlagWebGLDebug=z;c.webglDebugEnabled=function(){return z};c.webglValidateShadersEnabled=function(){return z};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/enums":function(){define(["exports"],function(c){c.ClearBufferBit=void 0;(function(a){a[a.DEPTH_BUFFER_BIT=256]="DEPTH_BUFFER_BIT";a[a.STENCIL_BUFFER_BIT=1024]="STENCIL_BUFFER_BIT";a[a.COLOR_BUFFER_BIT=16384]="COLOR_BUFFER_BIT"})(c.ClearBufferBit||(c.ClearBufferBit= {}));c.PrimitiveType=void 0;(function(a){a[a.POINTS=0]="POINTS";a[a.LINES=1]="LINES";a[a.LINE_LOOP=2]="LINE_LOOP";a[a.LINE_STRIP=3]="LINE_STRIP";a[a.TRIANGLES=4]="TRIANGLES";a[a.TRIANGLE_STRIP=5]="TRIANGLE_STRIP";a[a.TRIANGLE_FAN=6]="TRIANGLE_FAN"})(c.PrimitiveType||(c.PrimitiveType={}));c.BlendFactor=void 0;(function(a){a[a.ZERO=0]="ZERO";a[a.ONE=1]="ONE";a[a.SRC_COLOR=768]="SRC_COLOR";a[a.ONE_MINUS_SRC_COLOR=769]="ONE_MINUS_SRC_COLOR";a[a.SRC_ALPHA=770]="SRC_ALPHA";a[a.ONE_MINUS_SRC_ALPHA=771]= "ONE_MINUS_SRC_ALPHA";a[a.DST_ALPHA=772]="DST_ALPHA";a[a.ONE_MINUS_DST_ALPHA=773]="ONE_MINUS_DST_ALPHA";a[a.DST_COLOR=774]="DST_COLOR";a[a.ONE_MINUS_DST_COLOR=775]="ONE_MINUS_DST_COLOR";a[a.SRC_ALPHA_SATURATE=776]="SRC_ALPHA_SATURATE";a[a.CONSTANT_COLOR=32769]="CONSTANT_COLOR";a[a.ONE_MINUS_CONSTANT_COLOR=32770]="ONE_MINUS_CONSTANT_COLOR";a[a.CONSTANT_ALPHA=32771]="CONSTANT_ALPHA";a[a.ONE_MINUS_CONSTANT_ALPHA=32772]="ONE_MINUS_CONSTANT_ALPHA"})(c.BlendFactor||(c.BlendFactor={}));c.BlendOperation= void 0;(function(a){a[a.ADD=32774]="ADD";a[a.MIN=32775]="MIN";a[a.MAX=32776]="MAX";a[a.SUBTRACT=32778]="SUBTRACT";a[a.REVERSE_SUBTRACT=32779]="REVERSE_SUBTRACT"})(c.BlendOperation||(c.BlendOperation={}));c.BufferType=void 0;(function(a){a[a.ARRAY_BUFFER=34962]="ARRAY_BUFFER";a[a.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER";a[a.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER";a[a.PIXEL_PACK_BUFFER=35051]="PIXEL_PACK_BUFFER";a[a.PIXEL_UNPACK_BUFFER=35052]="PIXEL_UNPACK_BUFFER";a[a.COPY_READ_BUFFER=36662]= "COPY_READ_BUFFER";a[a.COPY_WRITE_BUFFER=36663]="COPY_WRITE_BUFFER";a[a.TRANSFORM_FEEDBACK_BUFFER=35982]="TRANSFORM_FEEDBACK_BUFFER"})(c.BufferType||(c.BufferType={}));c.Face=void 0;(function(a){a[a.FRONT=1028]="FRONT";a[a.BACK=1029]="BACK";a[a.FRONT_AND_BACK=1032]="FRONT_AND_BACK"})(c.Face||(c.Face={}));c.CullMode=void 0;(function(a){a[a.CW=2304]="CW";a[a.CCW=2305]="CCW"})(c.CullMode||(c.CullMode={}));c.DataType=void 0;(function(a){a[a.BYTE=5120]="BYTE";a[a.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";a[a.SHORT= 5122]="SHORT";a[a.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";a[a.INT=5124]="INT";a[a.UNSIGNED_INT=5125]="UNSIGNED_INT";a[a.FLOAT=5126]="FLOAT";a[a.HALF_FLOAT=5131]="HALF_FLOAT"})(c.DataType||(c.DataType={}));c.CompareFunction=void 0;(function(a){a[a.NEVER=512]="NEVER";a[a.LESS=513]="LESS";a[a.EQUAL=514]="EQUAL";a[a.LEQUAL=515]="LEQUAL";a[a.GREATER=516]="GREATER";a[a.NOTEQUAL=517]="NOTEQUAL";a[a.GEQUAL=518]="GEQUAL";a[a.ALWAYS=519]="ALWAYS"})(c.CompareFunction||(c.CompareFunction={}));c.StencilOperation= void 0;(function(a){a[a.ZERO=0]="ZERO";a[a.KEEP=7680]="KEEP";a[a.REPLACE=7681]="REPLACE";a[a.INCR=7682]="INCR";a[a.DECR=7683]="DECR";a[a.INVERT=5386]="INVERT";a[a.INCR_WRAP=34055]="INCR_WRAP";a[a.DECR_WRAP=34056]="DECR_WRAP"})(c.StencilOperation||(c.StencilOperation={}));c.TextureSamplingMode=void 0;(function(a){a[a.NEAREST=9728]="NEAREST";a[a.LINEAR=9729]="LINEAR";a[a.NEAREST_MIPMAP_NEAREST=9984]="NEAREST_MIPMAP_NEAREST";a[a.LINEAR_MIPMAP_NEAREST=9985]="LINEAR_MIPMAP_NEAREST";a[a.NEAREST_MIPMAP_LINEAR= 9986]="NEAREST_MIPMAP_LINEAR";a[a.LINEAR_MIPMAP_LINEAR=9987]="LINEAR_MIPMAP_LINEAR"})(c.TextureSamplingMode||(c.TextureSamplingMode={}));c.TextureWrapMode=void 0;(function(a){a[a.CLAMP_TO_EDGE=33071]="CLAMP_TO_EDGE";a[a.REPEAT=10497]="REPEAT";a[a.MIRRORED_REPEAT=33648]="MIRRORED_REPEAT"})(c.TextureWrapMode||(c.TextureWrapMode={}));c.TextureType=void 0;(function(a){a[a.TEXTURE_2D=3553]="TEXTURE_2D";a[a.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP";a[a.TEXTURE_3D=32879]="TEXTURE_3D";a[a.TEXTURE_CUBE_MAP_POSITIVE_X= 34069]="TEXTURE_CUBE_MAP_POSITIVE_X";a[a.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X";a[a.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y";a[a.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y";a[a.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z";a[a.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z";a[a.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY"})(c.TextureType||(c.TextureType={}));c.PixelFormat=void 0;(function(a){a[a.DEPTH_COMPONENT= 6402]="DEPTH_COMPONENT";a[a.DEPTH_STENCIL=34041]="DEPTH_STENCIL";a[a.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8";a[a.ALPHA=6406]="ALPHA";a[a.RGB=6407]="RGB";a[a.RGBA=6408]="RGBA";a[a.LUMINANCE=6409]="LUMINANCE";a[a.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA";a[a.RED=6403]="RED";a[a.RG=33319]="RG";a[a.RED_INTEGER=36244]="RED_INTEGER";a[a.RG_INTEGER=33320]="RG_INTEGER";a[a.RGB_INTEGER=36248]="RGB_INTEGER";a[a.RGBA_INTEGER=36249]="RGBA_INTEGER"})(c.PixelFormat||(c.PixelFormat={}));c.SizedPixelFormat=void 0; (function(a){a[a.RGBA4=32854]="RGBA4";a[a.R16F=33325]="R16F";a[a.RG16F=33327]="RG16F";a[a.RGB32F=34837]="RGB32F";a[a.RGBA16F=34842]="RGBA16F";a[a.R32F=33326]="R32F";a[a.RG32F=33328]="RG32F";a[a.RGBA32F=34836]="RGBA32F";a[a.R11F_G11F_B10F=35898]="R11F_G11F_B10F";a[a.RGB8=32849]="RGB8";a[a.RGBA8=32856]="RGBA8";a[a.RGB5_A1=32855]="RGB5_A1";a[a.R8=33321]="R8";a[a.RG8=33323]="RG8";a[a.R8I=33329]="R8I";a[a.R8UI=33330]="R8UI";a[a.R16I=33331]="R16I";a[a.R16UI=33332]="R16UI";a[a.R32I=33333]="R32I";a[a.R32UI= 33334]="R32UI";a[a.RG8I=33335]="RG8I";a[a.RG8UI=33336]="RG8UI";a[a.RG16I=33337]="RG16I";a[a.RG16UI=33338]="RG16UI";a[a.RG32I=33339]="RG32I";a[a.RG32UI=33340]="RG32UI";a[a.RGB16F=34843]="RGB16F";a[a.RGB9_E5=35901]="RGB9_E5";a[a.SRGB8=35905]="SRGB8";a[a.SRGB8_ALPHA8=35907]="SRGB8_ALPHA8";a[a.RGB565=36194]="RGB565";a[a.RGBA32UI=36208]="RGBA32UI";a[a.RGB32UI=36209]="RGB32UI";a[a.RGBA16UI=36214]="RGBA16UI";a[a.RGB16UI=36215]="RGB16UI";a[a.RGBA8UI=36220]="RGBA8UI";a[a.RGB8UI=36221]="RGB8UI";a[a.RGBA32I= 36226]="RGBA32I";a[a.RGB32I=36227]="RGB32I";a[a.RGBA16I=36232]="RGBA16I";a[a.RGB16I=36233]="RGB16I";a[a.RGBA8I=36238]="RGBA8I";a[a.RGB8I=36239]="RGB8I";a[a.R8_SNORM=36756]="R8_SNORM";a[a.RG8_SNORM=36757]="RG8_SNORM";a[a.RGB8_SNORM=36758]="RGB8_SNORM";a[a.RGBA8_SNORM=36759]="RGBA8_SNORM";a[a.RGB10_A2=32857]="RGB10_A2";a[a.RGB10_A2UI=36975]="RGB10_A2UI"})(c.SizedPixelFormat||(c.SizedPixelFormat={}));c.PixelType=void 0;(function(a){a[a.FLOAT=5126]="FLOAT";a[a.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE";a[a.UNSIGNED_INT_24_8= 34042]="UNSIGNED_INT_24_8";a[a.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4";a[a.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1";a[a.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5";a[a.BYTE=5120]="BYTE";a[a.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT";a[a.SHORT=5122]="SHORT";a[a.UNSIGNED_INT=5125]="UNSIGNED_INT";a[a.INT=5124]="INT";a[a.HALF_FLOAT=5131]="HALF_FLOAT";a[a.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV";a[a.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV"; a[a.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV";a[a.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV"})(c.PixelType||(c.PixelType={}));c.RenderbufferFormat=void 0;(function(a){a[a.DEPTH_COMPONENT16=33189]="DEPTH_COMPONENT16";a[a.STENCIL_INDEX8=36168]="STENCIL_INDEX8";a[a.DEPTH_STENCIL=34041]="DEPTH_STENCIL";a[a.DEPTH_COMPONENT24=33190]="DEPTH_COMPONENT24";a[a.DEPTH_COMPONENT32F=36012]="DEPTH_COMPONENT32F";a[a.DEPTH24_STENCIL8=35056]="DEPTH24_STENCIL8";a[a.DEPTH32F_STENCIL8= 36013]="DEPTH32F_STENCIL8"})(c.RenderbufferFormat||(c.RenderbufferFormat={}));c.Usage=void 0;(function(a){a[a.STATIC_DRAW=35044]="STATIC_DRAW";a[a.DYNAMIC_DRAW=35048]="DYNAMIC_DRAW";a[a.STREAM_DRAW=35040]="STREAM_DRAW";a[a.STATIC_READ=35045]="STATIC_READ";a[a.DYNAMIC_READ=35049]="DYNAMIC_READ";a[a.STREAM_READ=35041]="STREAM_READ";a[a.STATIC_COPY=35046]="STATIC_COPY";a[a.DYNAMIC_COPY=35050]="DYNAMIC_COPY";a[a.STREAM_COPY=35042]="STREAM_COPY"})(c.Usage||(c.Usage={}));c.ShaderType=void 0;(function(a){a[a.FRAGMENT_SHADER= 35632]="FRAGMENT_SHADER";a[a.VERTEX_SHADER=35633]="VERTEX_SHADER"})(c.ShaderType||(c.ShaderType={}));c.FramebufferTarget=void 0;(function(a){a[a.FRAMEBUFFER=36160]="FRAMEBUFFER";a[a.READ_FRAMEBUFFER=36008]="READ_FRAMEBUFFER";a[a.DRAW_FRAMEBUFFER=36009]="DRAW_FRAMEBUFFER"})(c.FramebufferTarget||(c.FramebufferTarget={}));c.ResourceType=void 0;(function(a){a[a.Texture=0]="Texture";a[a.BufferObject=1]="BufferObject";a[a.VertexArrayObject=2]="VertexArrayObject";a[a.Shader=3]="Shader";a[a.Program=4]="Program"; a[a.FramebufferObject=5]="FramebufferObject";a[a.Renderbuffer=6]="Renderbuffer";a[a.TransformFeedback=7]="TransformFeedback";a[a.Sync=8]="Sync";a[a.UNCOUNTED=9]="UNCOUNTED";a[a.LinesOfCode=9]="LinesOfCode";a[a.Uniform=10]="Uniform";a[a.COUNT=11]="COUNT"})(c.ResourceType||(c.ResourceType={}));c.ColorAttachment=void 0;(function(a){a[a.COLOR_ATTACHMENT0=36064]="COLOR_ATTACHMENT0";a[a.COLOR_ATTACHMENT1=36065]="COLOR_ATTACHMENT1";a[a.COLOR_ATTACHMENT2=36066]="COLOR_ATTACHMENT2";a[a.COLOR_ATTACHMENT3=36067]= "COLOR_ATTACHMENT3";a[a.COLOR_ATTACHMENT4=36068]="COLOR_ATTACHMENT4";a[a.COLOR_ATTACHMENT5=36069]="COLOR_ATTACHMENT5";a[a.COLOR_ATTACHMENT6=36070]="COLOR_ATTACHMENT6";a[a.COLOR_ATTACHMENT7=36071]="COLOR_ATTACHMENT7";a[a.COLOR_ATTACHMENT8=36072]="COLOR_ATTACHMENT8";a[a.COLOR_ATTACHMENT9=36073]="COLOR_ATTACHMENT9";a[a.COLOR_ATTACHMENT10=36074]="COLOR_ATTACHMENT10";a[a.COLOR_ATTACHMENT11=36075]="COLOR_ATTACHMENT11";a[a.COLOR_ATTACHMENT12=36076]="COLOR_ATTACHMENT12";a[a.COLOR_ATTACHMENT13=36077]="COLOR_ATTACHMENT13"; a[a.COLOR_ATTACHMENT14=36078]="COLOR_ATTACHMENT14";a[a.COLOR_ATTACHMENT15=36079]="COLOR_ATTACHMENT15"})(c.ColorAttachment||(c.ColorAttachment={}));c.SpecialDrawBuffers=void 0;(function(a){a[a.NONE=0]="NONE";a[a.BACK=1029]="BACK"})(c.SpecialDrawBuffers||(c.SpecialDrawBuffers={}));c.CompressedTextureFormat=void 0;(function(a){a[a.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT";a[a.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT";a[a.COMPRESSED_RGBA_S3TC_DXT3_EXT= 33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT";a[a.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT";a[a.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC";a[a.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC";a[a.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC";a[a.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC";a[a.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2";a[a.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2";a[a.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2= 37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2";a[a.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2";a[a.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC";a[a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC"})(c.CompressedTextureFormat||(c.CompressedTextureFormat={}));c.UniformType=void 0;(function(a){a[a.FLOAT=5126]="FLOAT";a[a.FLOAT_VEC2=35664]="FLOAT_VEC2";a[a.FLOAT_VEC3=35665]="FLOAT_VEC3";a[a.FLOAT_VEC4=35666]= "FLOAT_VEC4";a[a.INT=5124]="INT";a[a.INT_VEC2=35667]="INT_VEC2";a[a.INT_VEC3=35668]="INT_VEC3";a[a.INT_VEC4=35669]="INT_VEC4";a[a.BOOL=35670]="BOOL";a[a.BOOL_VEC2=35671]="BOOL_VEC2";a[a.BOOL_VEC3=35672]="BOOL_VEC3";a[a.BOOL_VEC4=35673]="BOOL_VEC4";a[a.FLOAT_MAT2=35674]="FLOAT_MAT2";a[a.FLOAT_MAT3=35675]="FLOAT_MAT3";a[a.FLOAT_MAT4=35676]="FLOAT_MAT4";a[a.SAMPLER_2D=35678]="SAMPLER_2D";a[a.SAMPLER_CUBE=35680]="SAMPLER_CUBE";a[a.UNSIGNED_INT=5125]="UNSIGNED_INT";a[a.UNSIGNED_INT_VEC2=36294]="UNSIGNED_INT_VEC2"; a[a.UNSIGNED_INT_VEC3=36295]="UNSIGNED_INT_VEC3";a[a.UNSIGNED_INT_VEC4=36296]="UNSIGNED_INT_VEC4";a[a.FLOAT_MAT2x3=35685]="FLOAT_MAT2x3";a[a.FLOAT_MAT2x4=35686]="FLOAT_MAT2x4";a[a.FLOAT_MAT3x2=35687]="FLOAT_MAT3x2";a[a.FLOAT_MAT3x4=35688]="FLOAT_MAT3x4";a[a.FLOAT_MAT4x2=35689]="FLOAT_MAT4x2";a[a.FLOAT_MAT4x3=35690]="FLOAT_MAT4x3";a[a.SAMPLER_3D=35679]="SAMPLER_3D";a[a.SAMPLER_2D_SHADOW=35682]="SAMPLER_2D_SHADOW";a[a.SAMPLER_2D_ARRAY=36289]="SAMPLER_2D_ARRAY";a[a.SAMPLER_2D_ARRAY_SHADOW=36292]="SAMPLER_2D_ARRAY_SHADOW"; a[a.SAMPLER_CUBE_SHADOW=36293]="SAMPLER_CUBE_SHADOW";a[a.INT_SAMPLER_2D=36298]="INT_SAMPLER_2D";a[a.INT_SAMPLER_3D=36299]="INT_SAMPLER_3D";a[a.INT_SAMPLER_CUBE=36300]="INT_SAMPLER_CUBE";a[a.INT_SAMPLER_2D_ARRAY=36303]="INT_SAMPLER_2D_ARRAY";a[a.UNSIGNED_INT_SAMPLER_2D=36306]="UNSIGNED_INT_SAMPLER_2D";a[a.UNSIGNED_INT_SAMPLER_3D=36307]="UNSIGNED_INT_SAMPLER_3D";a[a.UNSIGNED_INT_SAMPLER_CUBE=36308]="UNSIGNED_INT_SAMPLER_CUBE";a[a.UNSIGNED_INT_SAMPLER_2D_ARRAY=36311]="UNSIGNED_INT_SAMPLER_2D_ARRAY"})(c.UniformType|| (c.UniformType={}));c.SyncParameter=void 0;(function(a){a[a.OBJECT_TYPE=37138]="OBJECT_TYPE";a[a.SYNC_CONDITION=37139]="SYNC_CONDITION";a[a.SYNC_STATUS=37140]="SYNC_STATUS";a[a.SYNC_FLAGS=37141]="SYNC_FLAGS"})(c.SyncParameter||(c.SyncParameter={}));c.SyncStatus=void 0;(function(a){a[a.UNSIGNALED=37144]="UNSIGNALED";a[a.SIGNALED=37145]="SIGNALED"})(c.SyncStatus||(c.SyncStatus={}));c.ClientWaitSyncStatus=void 0;(function(a){a[a.ALREADY_SIGNALED=37146]="ALREADY_SIGNALED";a[a.TIMEOUT_EXPIRED=37147]="TIMEOUT_EXPIRED"; a[a.CONDITION_SATISFIED=37148]="CONDITION_SATISFIED";a[a.WAIT_FAILED=37149]="WAIT_FAILED"})(c.ClientWaitSyncStatus||(c.ClientWaitSyncStatus={}));c.SyncCondition=void 0;(function(a){a[a.SYNC_GPU_COMMANDS_COMPLETE=37143]="SYNC_GPU_COMMANDS_COMPLETE"})(c.SyncCondition||(c.SyncCondition={}));c.SyncFlag=void 0;(function(a){a[a.SYNC_FLUSH_COMMANDS_BIT=1]="SYNC_FLUSH_COMMANDS_BIT"})(c.SyncFlag||(c.SyncFlag={}));c.DepthStencilAttachment=33306;c.baseTextureUnit=33984;Object.defineProperty(c,Symbol.toStringTag, {value:"Module"})})},"esri/views/webgl/FramebufferObject":function(){define("exports ../../core/has ../../core/Logger ../../core/maybe ./BufferObject ./checkWebGLError ./enums ./GLObjectType ./Renderbuffer ./Texture".split(" "),function(c,a,y,e,n,z,h,m,w,v){function d(f){return null!=f&&"type"in f&&f.type===m.GLObjectType.Texture}function k(f,x){const g=Math.max(f.width,f.height);return g>x?(y.getLogger("esri.views.webgl.FramebufferObject").warn(`Resizing FBO attachment size ${f.width}x${f.height} to device limit ${x}`), x/=g,f.width=Math.round(f.width*x),f.height=Math.round(f.height*x),!1):!0}function q(f){return f.descriptor.target===h.TextureType.TEXTURE_CUBE_MAP?h.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X:h.TextureType.TEXTURE_2D}class A{constructor(f,x,g=null){this._context=f;this._glName=null;this._colorAttachments=new Map;this._depthStencilTexture=this._depthStencilBuffer=null;this._initialized=!1;f.instanceCounter.increment(h.ResourceType.FramebufferObject,this);f=d(x)?x:new v.Texture(this._context,x);this._colorAttachments.set(h.ColorAttachment.COLOR_ATTACHMENT0, f);this._validateTextureDescriptor(f.descriptor);this._validateColorAttachmentPoint(h.ColorAttachment.COLOR_ATTACHMENT0);null!=g&&(d(g)||null!=g&&"pixelFormat"in g?(this._depthStencilTexture=d(g)?g:new v.Texture(this._context,g),this._validateTextureDescriptor(this._depthStencilTexture.descriptor)):(this._depthStencilBuffer=g=null!=g&&"type"in g&&g.type===m.GLObjectType.RenderBuffer?g:new w.Renderbuffer(this._context,g),this._validateRenderBufferDescriptor(g.descriptor)))}dispose(){if(0!==this._colorAttachments.size|| this._glName){var f=this._context.getBoundFramebufferObject();this._colorAttachments.forEach((x,g)=>this.detachColorTexture(g)?.dispose());this.detachDepthStencilBuffer()?.dispose();this.detachDepthStencilTexture()?.dispose();this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null);this._context.bindFramebuffer(f);this._context.instanceCounter.decrement(h.ResourceType.FramebufferObject,this)}}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture|| this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.width??0}get height(){return this._colorAttachments.get(h.ColorAttachment.COLOR_ATTACHMENT0)?.descriptor?.height??0}get usedMemory(){return[...this._colorAttachments].reduce((f,[,x])=>f+x.usedMemory,this.depthStencil?.usedMemory??0)}getColorTexture(f){return(f=this._colorAttachments.get(f))&&d(f)?f:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(f, x=h.ColorAttachment.COLOR_ATTACHMENT0){f&&(this._validateColorAttachmentPoint(x),this._validateTextureDescriptor(f.descriptor),this.detachColorTexture(x)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(f.glName,x)),this._colorAttachments.set(x,f))}detachColorTexture(f=h.ColorAttachment.COLOR_ATTACHMENT0){const x=this._colorAttachments.get(f);if(x){if(this._initialized){const g=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this); this._framebufferTexture2D(null,f);this._context.bindFramebuffer(g)}this._colorAttachments.delete(f);return x}}setColorTextureTarget(f,x=h.ColorAttachment.COLOR_ATTACHMENT0){const g=this._colorAttachments.get(x);g&&this._framebufferTexture2D(g.glName,x,f)}attachDepthStencil(f){if(f)switch(f.type){case m.GLObjectType.Texture:return this._attachDepthStencilTexture(f);case m.GLObjectType.RenderBuffer:return this._attachDepthStencilBuffer(f)}}_attachDepthStencilTexture(f){if(null!=f){var x=f.descriptor; x.pixelFormat!==h.PixelFormat.DEPTH_STENCIL&&x.pixelFormat!==h.PixelFormat.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!");x.dataType!==h.PixelType.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!");this._validateTextureDescriptor(x);this._disposeDepthStencilAttachments();this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(f.glName,h.DepthStencilAttachment));this._depthStencilTexture?.dispose(); this._depthStencilTexture=f}}detachDepthStencilTexture(){const f=this._depthStencilTexture;if(f&&this._initialized){const x=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);this._framebufferTexture2D(null,h.DepthStencilAttachment);this._context.bindFramebuffer(x)}this._depthStencilTexture=null;return f}_attachDepthStencilBuffer(f){if(null!=f){var x=f.descriptor;this._validateRenderBufferDescriptor(x);this._disposeDepthStencilAttachments();if(this._initialized){this._context.bindFramebuffer(this); const g=this._context.gl;x=this._getGLAttachmentPoint(x);g.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,x,g.RENDERBUFFER,f.glName)}this._depthStencilBuffer=f}}detachDepthStencilBuffer(){const f=this._depthStencilBuffer;if(f&&this._initialized){const x=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this);const g=this._context.gl,b=this._getGLAttachmentPoint(f.descriptor);g.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,b,g.RENDERBUFFER,null);this._context.bindFramebuffer(x)}this._depthStencilBuffer= null;return f}copyToTexture(f,x,g,b,l,p,r){(0>f||0>x||0>l||0>p)&&console.error("Offsets cannot be negative!");(0>=g||0>=b)&&console.error("Copy width and height must be greater than zero!");var E=r.descriptor;r.descriptor.target!==h.TextureType.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!");(null==E?.width||null==E?.height||f+g>this.width||x+b>this.height||l+g>E.width||p+b>E.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!"); E=this._context;r=E.bindTexture(r,v.Texture.TEXTURE_UNIT_FOR_UPDATES);E.setActiveTexture(v.Texture.TEXTURE_UNIT_FOR_UPDATES);E.bindFramebuffer(this);E.gl.copyTexSubImage2D(h.TextureType.TEXTURE_2D,0,l,p,f,x,g,b);E.bindTexture(r,v.Texture.TEXTURE_UNIT_FOR_UPDATES)}readPixels(f,x,g,b,l,p,r){(0>=g||0>=b)&&console.error("Copy width and height must be greater than zero!");r||console.error("Target memory is not initialized!");this._context.bindFramebuffer(this);this._context.gl.readPixels(f,x,g,b,l,p,r)}async readPixelsAsync(f, x,g,b,l,p,r){const {gl:E}=this._context,G=n.BufferObject.createPixelPack(this._context,h.Usage.STREAM_READ,r.byteLength);this._context.bindBuffer(G);this._context.bindFramebuffer(this);E.readPixels(f,x,g,b,l,p,0);this._context.unbindBuffer(h.BufferType.PIXEL_PACK_BUFFER);await G.getSubDataAsync(r);G.dispose()}resize(f,x){if(this.width!==f||this.height!==x){var g={width:f,height:x};k(g,this._context.parameters.maxTextureSize);this._colorAttachments.forEach(b=>b.resize(g.width,g.height));this._depthStencilTexture?.resize(g.width, g.height);this._initialized&&(k(g,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(g.width,g.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}}initializeAndBind(f=h.FramebufferTarget.FRAMEBUFFER){const x=this._context.gl;if(this._initialized)x.bindFramebuffer(f,this.glName);else{this._glName&&x.deleteFramebuffer(this._glName);var g=x.createFramebuffer();x.bindFramebuffer(f,g);this._colorAttachments.forEach((b, l)=>this._framebufferTexture2D(b.glName,l,q(b),f));if(this._depthStencilBuffer){const b=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);x.framebufferRenderbuffer(f,b,x.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,x.DEPTH_STENCIL_ATTACHMENT,q(this._depthStencilTexture),f);z.webglDebugEnabled()&&x.checkFramebufferStatus(f)!==x.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"); this._glName=g;this._initialized=!0}}_framebufferTexture2D(f,x=h.ColorAttachment.COLOR_ATTACHMENT0,g=h.TextureType.TEXTURE_2D,b=h.FramebufferTarget.FRAMEBUFFER,l=0){this._context.gl.framebufferTexture2D(b,x,g,f,l)}_disposeDepthStencilAttachments(){const f=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const x=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);f.framebufferRenderbuffer(h.FramebufferTarget.FRAMEBUFFER,x,f.RENDERBUFFER, null)}this._depthStencilBuffer=e.disposeMaybe(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,f.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=e.disposeMaybe(this._depthStencilTexture))}_validateTextureDescriptor(f){f.target!==h.TextureType.TEXTURE_2D&&f.target!==h.TextureType.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!");k(f,this._context.parameters.maxTextureSize); this._validateBufferDimensions(f)}_validateRenderBufferDescriptor(f){k(f,this._context.parameters.maxRenderbufferSize);this._validateBufferDimensions(f)}_validateBufferDimensions(f){0>=f.width&&(f.width=this.width);0>=f.height&&(f.height=this.height);0A._MAX_COLOR_ATTACHMENTS&&y.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject", `illegal attachment point for color attachment: ${f+1}. Implementation supports up to ${A._MAX_COLOR_ATTACHMENTS} color attachments`)}}A._MAX_COLOR_ATTACHMENTS=-1;c.FramebufferObject=A;c.ensureAttachmentMaxSize=k;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/GLObjectType":function(){define(["exports"],function(c){c.GLObjectType=void 0;var a=c.GLObjectType||(c.GLObjectType={});a[a.Texture=0]="Texture";a[a.RenderBuffer=1]="RenderBuffer";Object.defineProperty(c,Symbol.toStringTag, {value:"Module"})})},"esri/views/webgl/Renderbuffer":function(){define(["exports","./enums","./GLObjectType","./RenderbufferDescriptor"],function(c,a,y,e){class n{constructor(z,h){this._context=z;this._descriptor=h;this.type=y.GLObjectType.RenderBuffer;this._context.instanceCounter.increment(a.ResourceType.Renderbuffer,this);z=this._context.gl;this.glName=z.createRenderbuffer();this._context.bindRenderbuffer(this);const {width:m,height:w,internalFormat:v,multisampled:d}=h;d?z.renderbufferStorageMultisample(z.RENDERBUFFER, this.samples,v,m,w):z.renderbufferStorage(z.RENDERBUFFER,v,m,w);this._context.bindRenderbuffer(null)}get descriptor(){return this._descriptor}get samples(){const z=this._descriptor.samples,h=this._context.parameters.maxSamples;return z?Math.min(z,h):h}get usedMemory(){return e.estimateMemory(this._descriptor)}resize(z,h){const m=this._descriptor;if(m.width!==z||m.height!==h)m.width=z,m.height=h,z=this._context.gl,this._context.bindRenderbuffer(this),m.multisampled?z.renderbufferStorageMultisample(z.RENDERBUFFER, this.samples,m.internalFormat,m.width,m.height):z.renderbufferStorage(z.RENDERBUFFER,m.internalFormat,m.width,m.height),this._context.bindRenderbuffer(null)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(a.ResourceType.Renderbuffer,this),this._context=null)}}c.Renderbuffer=n;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/RenderbufferDescriptor":function(){define(["exports","./Util"],function(c,a){class y{constructor(e, n,z=n){this.internalFormat=e;this.width=n;this.height=z;this.multisampled=!1;this.samples=1}}c.RenderbufferDescriptor=y;c.estimateMemory=function(e){return 0>=e.width||0>=e.height||null==e.internalFormat?0:e.width*e.height*a.getBytesPerElementFormat(e.internalFormat)};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Util":function(){define(["exports","../../core/has","./checkWebGLError","./enums","./getDataTypeBytes"],function(c,a,y,e,n){function z(m){m=m.gl;switch(m.getError()){case m.NO_ERROR:return null; case m.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case m.INVALID_VALUE:return"An unacceptable value has been specified for an argument";case m.INVALID_OPERATION:return"The specified command is not allowed for the current state";case m.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case m.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case m.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"} function h(m){return m[0].stride}c.bindVertexBufferLayout=function(m,w,v,d,k=0){const q=m.gl;m.bindBuffer(v);for(const f of d)if(d=w.get(f.name),void 0===d)console.warn(`There is no location for vertex attribute '${f.name}' defined.`);else{v=k*f.stride;if(4>=f.count)q.vertexAttribPointer(d,f.count,f.type,f.normalized,f.stride,f.offset+v),q.enableVertexAttribArray(d),0A;A++)q.vertexAttribPointer(d+A,3,f.type,f.normalized, f.stride,f.offset+12*A+v),q.enableVertexAttribArray(d+A),0A;A++)q.vertexAttribPointer(d+A,4,f.type,f.normalized,f.stride,f.offset+16*A+v),q.enableVertexAttribArray(d+A),0=q.count)k.disableVertexAttribArray(v),q.divisor&&0d;d++)k.disableVertexAttribArray(v+d),q.divisor&&0d;d++)k.disableVertexAttribArray(v+d),q.divisor&&0g.width||null!=g.height&&0>g.height||null!=g.depth&&0>g.depth)&&console.error("Negative dimension parameters are not allowed!")}function v(g,b){let l=b.samplingMode,p=b.samplingMode;if(l===n.TextureSamplingMode.LINEAR_MIPMAP_NEAREST||l===n.TextureSamplingMode.LINEAR_MIPMAP_LINEAR)l=n.TextureSamplingMode.LINEAR,b.hasMipmap||(p=n.TextureSamplingMode.LINEAR);else if(l===n.TextureSamplingMode.NEAREST_MIPMAP_NEAREST||l===n.TextureSamplingMode.NEAREST_MIPMAP_LINEAR)l= n.TextureSamplingMode.NEAREST,b.hasMipmap||(p=n.TextureSamplingMode.NEAREST);g.texParameteri(b.target,g.TEXTURE_MAG_FILTER,l);g.texParameteri(b.target,g.TEXTURE_MIN_FILTER,p)}function d(g,b){"number"===typeof b.wrapMode?(g.texParameteri(b.target,g.TEXTURE_WRAP_S,b.wrapMode),g.texParameteri(b.target,g.TEXTURE_WRAP_T,b.wrapMode)):(g.texParameteri(b.target,g.TEXTURE_WRAP_S,b.wrapMode.s),g.texParameteri(b.target,g.TEXTURE_WRAP_T,b.wrapMode.t))}function k(g,b){const l=g.capabilities.textureFilterAnisotropic; l&&g.gl.texParameterf(b.target,l.TEXTURE_MAX_ANISOTROPY,b.maxAnisotropy??1)}function q(g){return null!=g&&"type"in g&&"compressed"===g.type}function A(g){return null!=g&&!q(g)&&!(null!=g&&"byteLength"in g)}function f(g){return g===n.TextureType.TEXTURE_3D||g===n.TextureType.TEXTURE_2D_ARRAY}function x(g,b,l,p=1){b=Math.max(b,l);g===n.TextureType.TEXTURE_3D&&(b=Math.max(b,p));return Math.round(Math.log(b)/Math.LN2)+1}y=class g{constructor(b,l=null,p=null){this.type=z.GLObjectType.Texture;this._glName= null;this._wasImmutablyAllocated=this._wrapModeDirty=this._samplingModeDirty=!1;if("context"in b)this._descriptor=b,p=l;else{b=m.ValidatedTextureDescriptor.validate(b,l);if(!b)throw new a("Texture descriptor invalid");this._descriptor=b}this._descriptor.target===n.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(p):this.setData(p)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return h.estimateMemory(this._descriptor)}get isDirty(){return this._samplingModeDirty|| this._wrapModeDirty}dispose(){this._glName&&this._descriptor.context.instanceCounter.decrement(n.ResourceType.Texture,this);this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(b,l){const p=this._descriptor;if(p.width!==b||p.height!==l){if(this._wasImmutablyAllocated)throw new a("Immutable textures can't be resized!");p.width=b;p.height=l;this._descriptor.target=== n.TextureType.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(b=null){for(let l=n.TextureType.TEXTURE_CUBE_MAP_POSITIVE_X;l<=n.TextureType.TEXTURE_CUBE_MAP_NEGATIVE_Z;l++)this._setData(b,l)}setData(b){this._setData(b)}_setData(b,l){if(this._descriptor.context?.gl){var p=this._descriptor.context.gl;e.checkWebGLError(p);this._glName||(this._glName=p.createTexture())&&this._descriptor.context.instanceCounter.increment(n.ResourceType.Texture,this);void 0===b&&(b=null); var r=this._descriptor,E=l??r.target,G=f(E);null===b&&(r.width=r.width||4,r.height=r.height||4,G&&(r.depth=r.depth??1));l=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES);w(r);this._configurePixelStorage();e.checkWebGLError(p);var u=this._deriveInternalFormat();if(A(b)){let C="width"in b?b.width:b.codedWidth,D="height"in b?b.height:b.codedHeight;b instanceof HTMLVideoElement&&(C=b.videoWidth,D=b.videoHeight); r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(E,u,r.hasMipmap,C,D,1);this._texImage(E,0,u,C,D,1,b);e.checkWebGLError(p);r.hasMipmap&&this.generateMipmap();r.width||(r.width=C);r.height||(r.height=D);G&&!r.depth&&(r.depth=1)}else{const {width:C,height:D,depth:t}=r;if(null==C||null==D)throw new a("Width and height must be specified!");if(G&&null==t)throw new a("Depth must be specified!");r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(E,u,r.hasMipmap,C,D,t);if(q(b)){const B= b.levels;b=x(E,C,D,t);b=Math.min(b-1,B.length-1);p.texParameteri(r.target,this._descriptor.context.gl.TEXTURE_MAX_LEVEL,b);if(!(u in n.CompressedTextureFormat))throw new a("Attempting to use compressed data with an uncompressed format!");this._forEachMipmapLevel((F,I,J,K)=>{this._compressedTexImage(E,F,u,I,J,K,B[Math.min(F,B.length-1)])},b)}else this._texImage(E,0,u,C,D,t,b),e.checkWebGLError(p),r.hasMipmap&&this.generateMipmap()}v(p,this._descriptor);d(p,this._descriptor);k(this._descriptor.context, this._descriptor);e.checkWebGLError(p);this._descriptor.context.bindTexture(l,g.TEXTURE_UNIT_FOR_UPDATES)}}updateData(b,l,p,r,E,G,u=0){G||console.error("An attempt to use uninitialized data!");this._glName||console.error("An attempt to update uninitialized texture!");var C=this._descriptor;const D=this._deriveInternalFormat(),{context:t,pixelFormat:B,dataType:F,target:I,isImmutable:J}=C;if(J&&!this._wasImmutablyAllocated)throw new a("Cannot update immutable texture before allocation!");const K=t.bindTexture(this, g.TEXTURE_UNIT_FOR_UPDATES,!0);(0>l||0>p||l+r>C.width||p+E>C.height)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:C}=t);u&&C.pixelStorei(C.UNPACK_SKIP_ROWS,u);A(G)?C.texSubImage2D(I,b,l,p,r,E,B,F,G):q(G)?C.compressedTexSubImage2D(I,b,l,p,r,E,D,G.levels[b]):C.texSubImage2D(I,b,l,p,r,E,B,F,G);u&&C.pixelStorei(C.UNPACK_SKIP_ROWS,0);t.bindTexture(K,g.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(b,l,p,r,E,G,u,C){C||console.error("An attempt to use uninitialized data!"); this._glName||console.error("An attempt to update uninitialized texture!");var D=this._descriptor;const t=this._deriveInternalFormat(),{context:B,pixelFormat:F,dataType:I,isImmutable:J,target:K}=D;if(J&&!this._wasImmutablyAllocated)throw new a("Cannot update immutable texture before allocation!");f(K)||console.warn("Attempting to set 3D texture data on a non-3D texture");const L=B.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);B.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES);(0>l||0>p||0>r||l+E>D.width|| p+G>D.height||r+u>D.depth)&&console.error("An attempt to update out of bounds of the texture!");this._configurePixelStorage();({gl:D}=B);q(C)?(C=C.levels[b],D.compressedTexSubImage3D(K,b,l,p,r,E,G,u,t,C)):D.texSubImage3D(K,b,l,p,r,E,G,u,F,I,C);B.bindTexture(L,g.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const b=this._descriptor;if(!b.hasMipmap){if(this._wasImmutablyAllocated)throw new a("Cannot add mipmaps to immutable texture after allocation");this._samplingModeDirty=b.hasMipmap=!0;w(b)}b.samplingMode=== n.TextureSamplingMode.LINEAR?(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.LINEAR_MIPMAP_NEAREST):b.samplingMode===n.TextureSamplingMode.NEAREST&&(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.NEAREST_MIPMAP_NEAREST);const l=this._descriptor.context.bindTexture(this,g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(g.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.gl.generateMipmap(b.target);this._descriptor.context.bindTexture(l,g.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const b= this._descriptor;if(b.hasMipmap){if(this._wasImmutablyAllocated)throw new a("Cannot delete mipmaps to immutable texture after allocation");b.hasMipmap=!1;this._samplingModeDirty=!0;w(b)}b.samplingMode===n.TextureSamplingMode.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.LINEAR):b.samplingMode===n.TextureSamplingMode.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,b.samplingMode=n.TextureSamplingMode.NEAREST)}setSamplingMode(b){b!==this._descriptor.samplingMode&& (this._descriptor.samplingMode=b,this._samplingModeDirty=!0)}setWrapMode(b){b!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=b,w(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const b=this._descriptor,l=b.context.gl;this._samplingModeDirty&&(v(l,b),this._samplingModeDirty=!1);this._wrapModeDirty&&(d(l,b),this._wrapModeDirty=!1)}_deriveInternalFormat(){if(null!=this._descriptor.internalFormat)return this._descriptor.internalFormat===n.PixelFormat.DEPTH_STENCIL&&(this._descriptor.internalFormat= n.PixelFormat.DEPTH24_STENCIL8),this._descriptor.internalFormat;switch(this._descriptor.dataType){case n.PixelType.FLOAT:switch(this._descriptor.pixelFormat){case n.PixelFormat.RGBA:return this._descriptor.internalFormat=n.SizedPixelFormat.RGBA32F;case n.PixelFormat.RGB:return this._descriptor.internalFormat=n.SizedPixelFormat.RGB32F;default:throw new a("Unable to derive format");}case n.PixelType.UNSIGNED_BYTE:switch(this._descriptor.pixelFormat){case n.PixelFormat.RGBA:return this._descriptor.internalFormat= n.SizedPixelFormat.RGBA8;case n.PixelFormat.RGB:return this._descriptor.internalFormat=n.SizedPixelFormat.RGB8}}return this._descriptor.internalFormat=this._descriptor.pixelFormat===n.PixelFormat.DEPTH_STENCIL?n.PixelFormat.DEPTH24_STENCIL8:this._descriptor.pixelFormat}_configurePixelStorage(){const b=this._descriptor.context.gl,{unpackAlignment:l,flipped:p,preMultiplyAlpha:r}=this._descriptor;b.pixelStorei(b.UNPACK_ALIGNMENT,l);b.pixelStorei(b.UNPACK_FLIP_Y_WEBGL,p?1:0);b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, r?1:0)}_texStorage(b,l,p,r,E,G){const {gl:u}=this._descriptor.context;if(!(l in n.SizedPixelFormat))throw new a("Immutable textures must have a sized internal format");if(this._descriptor.isImmutable){p=p?x(b,r,E,G):1;if(f(b)){if(null==G)throw new a("Missing depth dimension for 3D texture upload");u.texStorage3D(b,p,l,r,E,G)}else u.texStorage2D(b,p,l,r,E);this._wasImmutablyAllocated=!0}}_texImage(b,l,p,r,E,G,u){const C=this._descriptor.context.gl,D=f(b),{isImmutable:t,pixelFormat:B,dataType:F}=this._descriptor; if(t){if(null!=u)if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload");C.texSubImage3D(b,l,0,0,0,r,E,G,B,F,u)}else C.texSubImage2D(b,l,0,0,r,E,B,F,u)}else if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload");C.texImage3D(b,l,p,r,E,G,0,B,F,u)}else C.texImage2D(b,l,p,r,E,0,B,F,u)}_compressedTexImage(b,l,p,r,E,G,u){const C=this._descriptor.context.gl,D=f(b);if(this._descriptor.isImmutable){if(null!=u)if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload"); C.compressedTexSubImage3D(b,l,0,0,0,r,E,G,p,u)}else C.compressedTexSubImage2D(b,l,0,0,r,E,p,u)}else if(D){if(null==G)throw new a("Missing depth dimension for 3D texture upload");C.compressedTexImage3D(b,l,p,r,E,G,0,u)}else C.compressedTexImage2D(b,l,p,r,E,0,u)}_forEachMipmapLevel(b,l=Infinity){let {width:p,height:r,depth:E,hasMipmap:G,target:u}=this._descriptor;const C=u===n.TextureType.TEXTURE_3D;if(null==p||null==r||C&&null==E)throw new a("Missing texture dimensions for mipmap calculation");for(let D= 0;;++D){b(D,p,r,E);if(!G||1===p&&1===r&&(!C||1===E)||D>=l)break;p=Math.max(1,p>>1);r=Math.max(1,r>>1);C&&(E=Math.max(1,E>>1))}}};y.TEXTURE_UNIT_FOR_UPDATES=0;c.Texture=y;c.tracer=null;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/TextureDescriptor":function(){define(["exports","./enums","./Util"],function(c,a,y){class e{constructor(n=0,z=n){this.width=n;this.height=z;this.target=a.TextureType.TEXTURE_2D;this.pixelFormat=a.PixelFormat.RGBA;this.dataType=a.PixelType.UNSIGNED_BYTE; this.samplingMode=a.TextureSamplingMode.LINEAR;this.wrapMode=a.TextureWrapMode.REPEAT;this.maxAnisotropy=1;this.isOpaque=this.hasMipmap=this.flipped=!1;this.unpackAlignment=4;this.preMultiplyAlpha=!1;this.depth=1;this.isImmutable=!1}}c.TextureDescriptor=e;c.estimateMemory=function(n){return 0>=n.width||0>=n.height?0:Math.round(n.width*n.height*(n.hasMipmap?4/3:1)*(null==n.internalFormat?4:y.getBytesPerElementFormat(n.internalFormat)))};Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})}, "esri/views/webgl/ValidatedTextureDescriptor":function(){define(["exports","./enums","./TextureDescriptor"],function(c,a,y){class e extends y.TextureDescriptor{constructor(n,z){super();this.context=n;Object.assign(this,z);switch(this.internalFormat){case a.SizedPixelFormat.R16F:case a.SizedPixelFormat.R16I:case a.SizedPixelFormat.R16UI:case a.SizedPixelFormat.R32F:case a.SizedPixelFormat.R32I:case a.SizedPixelFormat.R32UI:case a.SizedPixelFormat.R8_SNORM:case a.SizedPixelFormat.R8:case a.SizedPixelFormat.R8I:case a.SizedPixelFormat.R8UI:this.pixelFormat= a.PixelFormat.RED}}static validate(n,z){return new e(n,z)}}c.ValidatedTextureDescriptor=e;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/Program":function(){define(["exports","../../core/has","./checkWebGLError","./enums","./ShaderTranspiler"],function(c,a,y,e,n){function z(d,k,q){d=d.gl;const A=d.createShader(k);d.shaderSource(A,q);d.compileShader(A);y.webglValidateShadersEnabled()&&!d.getShaderParameter(A,d.COMPILE_STATUS)&&(console.error("Compile error in ".concat(k=== e.ShaderType.VERTEX_SHADER?"vertex":"fragment"," shader")),console.error(d.getShaderInfoLog(A)),console.error(h(q)));return A}function h(d){let k=2;return d.replaceAll("\n",()=>{var q=k++;q=1E3<=q?q.toString():(" "+q).slice(-3);return"\n"+q+":"})}function m(d,k,q){const A=d.get(k);if(!A)return d.set(k,Array.from(q)),!0;const f=q.length;if(A.length!==f)return d.set(k,Array.from(q)),!0;for(d=0;dg.bindAttribLocation(b,l,p));this._transformFeedbackVaryings?.length&&g.transformFeedbackVaryings(b,this._transformFeedbackVaryings,g.SEPARATE_ATTRIBS);g.linkProgram(b);y.webglValidateShadersEnabled()&&!g.getProgramParameter(b,g.LINK_STATUS)&&console.error("Could not link shader\n"+ `validated: ${g.getProgramParameter(b,g.VALIDATE_STATUS)}`+`, gl error ${g.getError()}`+`, vertex: ${g.getShaderParameter(this._vShader,g.COMPILE_STATUS)}`+`, fragment: ${g.getShaderParameter(this._fShader,g.COMPILE_STATUS)}`+`, info log: ${g.getProgramInfoLog(b)}`+`, vertex source: ${this.vertexShader}`+`, fragment source: ${this.fragmentShader}`);for(const [l,p]of this._uniformBlockBindings)d=g.getUniformBlockIndex(b,l),4294967295>d&&g.uniformBlockBinding(b,d,p);this._glName=b;this._context.instanceCounter.increment(e.ResourceType.Program, this)}get glName(){return this._glName}get hasGLName(){return null!=this._glName}get hasTransformFeedbackVaryings(){return!!this._transformFeedbackVaryings?.length}get compiled(){if(this._compiled)return!0;const d=this._context.gl.getExtension("KHR_parallel_shader_compile");return null==d||null==this.glName?this._compiled=!0:this._compiled=!!this._context.gl.getProgramParameter(this.glName,d.COMPLETION_STATUS_KHR)}dispose(){if(!(0<--this._refCount)){var d=this._context.gl,k=this._context.instanceCounter; this._nameToUniformLocation.forEach(q=>q&&k.decrement(e.ResourceType.Uniform,q));this._nameToUniformLocation.clear();this._vShader&&(0"eof"!==b.type?b.data:"").join("")}function w(g,b="100",l="300 es"){const p=/^\s*#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const r of g)if("preprocessor"===r.type){const E=p.exec(r.data);if(E){g=E[1].replaceAll(/\s{2,}/g," ");if(g=== l)return g;if(g===b)return r.data="#version "+l,b;throw Error("unknown glsl version: "+g);}}g.splice(0,0,{type:"preprocessor",data:"#version "+l},{type:"whitespace",data:"\n"});return null}function v(g,b,l,p){p=p||l;for(const r of g)if("ident"===r.type&&r.data===l)return p in b?b[p]++:b[p]=0,v(g,b,p+"_"+b[p],p);return l}function d(g,b,l="afterVersion"){const p={data:"\n",type:"whitespace"},r=G=>Gz.forEach(h=>h.dispose()));this._store.clear()}acquire(z,h,m,w){const v=this._store.get(z,h);if(null!=v)return v.ref(),v;m=new e.Program(this._rctx,z,h,m,w);m.ref();this._store.set(z,h,m);return m}get test(){}} c.ProgramCache=n;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/core/NestedMap":function(){define(["exports"],function(c){class a{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get(y,e){return this._outer.get(y)?.get(e)}set(y,e,n){const z=this._outer.get(y);z?z.set(e,n):this._outer.set(y,new Map([[e,n]]))}delete(y,e){const n=this._outer.get(y);n&&(n.delete(e),0===n.size&&this._outer.delete(y))}forEach(y){this._outer.forEach((e, n)=>y(e,n))}}c.NestedMap=a;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/ShaderCompiler":function(){define(["exports"],function(c){class a{constructor(y){this._readFile=y}resolveIncludes(y){return this._resolve(y)}_resolve(y,e=new Map){if(e.has(y))return e.get(y);const n=this._read(y);if(!n)throw Error(`cannot find shader file ${y}`);const z=/^[^\S\n]*#include\s+<(\S+)>[^\S\n]?/gm;let h=z.exec(n);const m=[];for(;null!=h;)m.push({path:h[1],start:h.index,length:h[0].length}), h=z.exec(n);let w=0,v="";m.forEach(d=>{v+=n.slice(w,d.start);v+=e.has(d.path)?"":this._resolve(d.path,e);w=d.start+d.length});v+=n.slice(w);e.set(y,v);return v}_read(y){return this._readFile(y)}}c.ShaderCompiler=a;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})})},"esri/views/webgl/VertexArrayObject":function(){define("exports ../../core/Logger ../../core/maybe ../../core/typedArrayUtil ./enums ./Util".split(" "),function(c,a,y,e,n,z){const h=()=>a.getLogger("esri.views.webgl.VertexArrayObject"); c.VertexArrayObject=class{constructor(m,w,v,d,k=null){this._context=m;this._locations=w;this._layout=v;this._buffers=d;this._indexBuffer=k;this._glName=null;this._initialized=!1}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get byteSize(){return Object.keys(this._buffers).reduce((m,w)=>m+this._buffers[w].usedMemory,null!=this._indexBuffer?this._indexBuffer.usedMemory:0)}get layout(){return this._layout}get locations(){return this._locations}get usedMemory(){return this.byteSize+ (Object.keys(this._buffers).length+(this._indexBuffer?1:0))*e.typedArrayStaticSize}dispose(){if(this._context){this._context.getBoundVAO()===this&&this._context.bindVAO(null);for(const m in this._buffers)this._buffers[m]?.dispose(),delete this._buffers[m];this._indexBuffer=y.disposeMaybe(this._indexBuffer);this.disposeVAOOnly()}else(this._glName||0