@arcgis/core 4.28.5 → 4.28.7

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.
Files changed (65) hide show
  1. package/README.md +15 -25
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0c08d59c5d65921ba5ae.js +1 -0
  4. package/assets/esri/core/workers/chunks/0dbf3fa096d02d83b222.js +1 -0
  5. package/assets/esri/core/workers/chunks/16453ca31cc3e09fde46.js +1 -0
  6. package/assets/esri/core/workers/chunks/{1da721608993783dc9cf.js → 24d04cca452ba2fec5d4.js} +1 -1
  7. package/assets/esri/core/workers/chunks/2c121541cde5c24b1fbe.js +1 -0
  8. package/assets/esri/core/workers/chunks/2efd2496f7310142f928.js +1 -0
  9. package/assets/esri/core/workers/chunks/42880f0fac5f1606201c.js +1 -0
  10. package/assets/esri/core/workers/chunks/5b17de91091fc17d9821.js +1 -0
  11. package/assets/esri/core/workers/chunks/70eba80261d7fdc624ad.js +1 -0
  12. package/assets/esri/core/workers/chunks/{3dcb2a82e1e4b520c9c9.js → 7b901d0b68e5cc17533a.js} +1 -1
  13. package/assets/esri/core/workers/chunks/7f68c2cc1048d136fd1b.js +1 -0
  14. package/assets/esri/core/workers/chunks/85d6dd6703b228248e30.js +1 -0
  15. package/assets/esri/core/workers/chunks/adc138e5d9983a5752d4.js +1 -0
  16. package/assets/esri/core/workers/chunks/b35e87cf2b8244e3584f.js +1 -0
  17. package/assets/esri/core/workers/chunks/b49f830a8d74c4564ed8.js +1 -0
  18. package/assets/esri/core/workers/chunks/b6d77edf9eec757e88da.js +1 -0
  19. package/assets/esri/core/workers/chunks/c9306fb3ec1a2d5e137a.js +1 -0
  20. package/assets/esri/core/workers/chunks/cd201c627e9396edf6b9.js +1 -0
  21. package/assets/esri/core/workers/chunks/ceeaa8d1b0034b59eae7.js +1 -0
  22. package/assets/esri/core/workers/chunks/dc4a71e72e56cbdff49a.js +1 -0
  23. package/assets/esri/core/workers/chunks/f78b1bfacd95a6ccf7b4.js +1 -0
  24. package/assets/esri/themes/base/widgets/_LabeledSwitch.scss +6 -1
  25. package/assets/esri/themes/dark/main.css +1 -1
  26. package/assets/esri/themes/light/main.css +1 -1
  27. package/assets/esri/themes/light/view.css +1 -1
  28. package/core/sql/WhereClause.js +1 -1
  29. package/core/sql/sqlCompareUtils.js +1 -1
  30. package/core/sql/sqlDateParsingUtils.js +1 -1
  31. package/kernel.js +1 -1
  32. package/layers/support/FieldsIndex.js +1 -1
  33. package/package.json +1 -1
  34. package/support/revision.js +1 -1
  35. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +1 -1
  36. package/views/webgl/FramebufferObject.js +1 -1
  37. package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
  38. package/widgets/Editor/workflowUtils.js +1 -1
  39. package/widgets/FeatureForm/featureFormUtils.js +1 -1
  40. package/widgets/FeatureForm.js +1 -1
  41. package/widgets/Features.js +1 -1
  42. package/widgets/Popup.js +1 -1
  43. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  44. package/widgets/Sketch.js +1 -1
  45. package/widgets/support/LabeledSwitch.js +1 -1
  46. package/widgets/support/dateUtils.js +1 -1
  47. package/assets/esri/core/workers/chunks/16b56e541afa438dfb7f.js +0 -1
  48. package/assets/esri/core/workers/chunks/340ab726ba40fe3a99c8.js +0 -1
  49. package/assets/esri/core/workers/chunks/46b4a17ec898ab744861.js +0 -1
  50. package/assets/esri/core/workers/chunks/4747741429e8ff7112bb.js +0 -1
  51. package/assets/esri/core/workers/chunks/4f0412b52844aa9c7bd4.js +0 -1
  52. package/assets/esri/core/workers/chunks/5b80ae1eb79f1db75dc6.js +0 -1
  53. package/assets/esri/core/workers/chunks/80fcb63476829b6a48d2.js +0 -1
  54. package/assets/esri/core/workers/chunks/84725021c43f1122056a.js +0 -1
  55. package/assets/esri/core/workers/chunks/8cdece03397d01767593.js +0 -1
  56. package/assets/esri/core/workers/chunks/9607460895182d31aef9.js +0 -1
  57. package/assets/esri/core/workers/chunks/a0a86383e69932a25e50.js +0 -1
  58. package/assets/esri/core/workers/chunks/a3bf50d9e24ad1de9847.js +0 -1
  59. package/assets/esri/core/workers/chunks/a5db3be5eeb3005df3c1.js +0 -1
  60. package/assets/esri/core/workers/chunks/a87ab14d6a6ccc9004a0.js +0 -1
  61. package/assets/esri/core/workers/chunks/a8cf23c3a55c1834178c.js +0 -1
  62. package/assets/esri/core/workers/chunks/ba00df2e707550939a6f.js +0 -1
  63. package/assets/esri/core/workers/chunks/cfa6d1b63b794febe70a.js +0 -1
  64. package/assets/esri/core/workers/chunks/e0382138cf58191a9697.js +0 -1
  65. package/assets/esri/core/workers/chunks/fe0c6814ef56604540b3.js +0 -1
@@ -623,7 +623,7 @@ return mat3(T, B, normal);
623
623
  }`),t.textureCoordinateType!==i.N.None&&(e.include(o.i,t),r.uniforms.add(t.pbrTextureBindType===c.P.Pass?new l.A("normalTexture",(e=>e.textureNormal)):new s.R("normalTexture",(e=>e.textureNormal))),r.code.add(a.H`vec3 computeTextureNormal(mat3 tangentSpace, vec2 uv) {
624
624
  vec3 rawNormal = textureLookup(normalTexture, uv).rgb * 2.0 - 1.0;
625
625
  return tangentSpace * rawNormal;
626
- }`))}},21627:(e,t,r)=>{r.d(t,{K:()=>he});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801),r(44553);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=M(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return M(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=M(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&M(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t)return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e)),this._colorAttachments.delete(e),t}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};y(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(y(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,C(t),e))),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,C(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),y(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){y(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function M(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function y(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH_STENCIL_BUFFER,new b(m.Tg.DEPTH24_STENCIL8,4),G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(92036),V=r(55039);const W={required:[]},j=(V.H.Depth,V.H.CompositeColor,V.H.Highlight,{required:[V.H.Depth,V.H.Normal]});class q extends z.Z{consumes(){return W}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class k extends q{}var X=r(78869),$=r(14589),Y=r(83475),J=r(59377),Z=r(59915),K=r(27097);class Q extends $.A{initializeProgram(e){return new J.$(e.rctx,Q.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}Q.shader=new X.J(Z.S,(()=>r.e(8092).then(r.bind(r,88092))));var ee=r(97323);class te extends i.K{constructor(){super(...arguments),this.projScale=1}}class re extends te{constructor(){super(...arguments),this.intensity=1}}class ie extends i.K{}class oe extends ie{constructor(){super(...arguments),this.blurSize=(0,ee.a)()}}var ne,ae=r(25377);class se extends $.A{initializeProgram(e){return new J.$(e.rctx,se.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}se.shader=new X.J(ae.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ne||(ne={}));var le=r(97995);const ce=2;let ue=class extends k{constructor(e){super(e),this._context=null,this._passParameters=new re,this._drawParameters=new oe,this.produces=new Map([[le.r.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?j:W}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ne.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(se)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Q)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}renderNode(e,t,r){const i=e.bindParameters,o=i.linearDepth?.colorTexture,n=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==o||!n)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=i.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=o,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*de/(0,ae.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=Math.round(u/ce),p=Math.round(d/ce),g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,i).bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,i);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,ce/d),_.bindDraw(this._drawParameters,i,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,ce/u,0),_.bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],ue.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],ue.prototype,"_context",void 0),ue=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ue);const de=.5;function he(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/ce),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
626
+ }`))}},21627:(e,t,r)=>{r.d(t,{K:()=>he});var i=r(74709),o=r(98069),n=r(43697),a=r(70586),s=r(17445),l=r(76882),c=r(5600),u=(r(75215),r(67676)),d=(r(80442),r(52011)),h=r(4307);r(69801),r(44553);var m=r(35371),f=r(92604),p=r(1533),g=r(49300),v=r(7575);const _=f.Z.getLogger("esri.views.webgl.BufferObject");class T{static createIndex(e,t,r){return new T(e,m.w0.ELEMENT_ARRAY_BUFFER,t,r)}static createVertex(e,t,r){return new T(e,m.w0.ARRAY_BUFFER,t,r)}static createUniform(e,t,r){if(e.type!==v.zO.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new T(e,m.w0.UNIFORM_BUFFER,t,r)}static createPixelPack(e,t=m.l1.STREAM_READ,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const i=new T(e,m.w0.PIXEL_PACK_BUFFER,t);return r&&i.setSize(r),i}static createPixelUnpack(e,t=m.l1.STREAM_DRAW,r){if(e.type!==v.zO.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new T(e,m.w0.PIXEL_UNPACK_BUFFER,t,r)}constructor(e,t,r,i){this._context=e,this.bufferType=t,this.usage=r,this._glName=null,this._size=-1,this._indexType=void 0,e.instanceCounter.increment(m._g.BufferObject,this),this._glName=this._context.gl.createBuffer(),(0,g.zu)(this._context.gl),i&&this.setData(i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteLength(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER?this._indexType===m.g.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER||this.bufferType===m.w0.ARRAY_BUFFER}dispose(){this._context?.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(m._g.BufferObject,this),this._context=null):this._glName&&_.warn("Leaked WebGL buffer object")}setSize(e,t=null){if(e<=0&&_.error("Buffer size needs to be positive!"),this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&null!=t)switch(this._indexType=t,t){case m.g.UNSIGNED_SHORT:e*=2;break;case m.g.UNSIGNED_INT:e*=4}this._setBufferData(e)}setData(e){if(!e)return;let t=e.byteLength;this.bufferType===m.w0.ELEMENT_ARRAY_BUFFER&&((0,p.Uc)(e)&&(t/=2,this._indexType=m.g.UNSIGNED_SHORT),(0,p.ZY)(e)&&(t/=4,this._indexType=m.g.UNSIGNED_INT)),this._setBufferData(t,e)}_setBufferData(e,t=null){this._size=e;const r=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const i=this._context.gl;null!=t?i.bufferData(this.bufferType,t,this.usage):i.bufferData(this.bufferType,e,this.usage),(0,g.zu)(i),this._isVAOAware&&this._context.bindVAO(r)}setSubData(e,t,r,i){if(!e)return;(t<0||t*e.BYTES_PER_ELEMENT>=this.byteLength)&&_.error("offset is out of range!"),r>=i&&_.error("end must be bigger than start!"),(t+(i-r))*e.BYTES_PER_ELEMENT>this.byteLength&&_.error("An attempt to write beyond the end of the buffer!");const o=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const n=this._context.gl;if(this._context.type===v.zO.WEBGL2)n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,e,r,i-r);else{const o=0===r&&i===e.length?e:e.subarray(r,i);n.bufferSubData(this.bufferType,t*e.BYTES_PER_ELEMENT,o)}(0,g.zu)(n),this._isVAOAware&&this._context.bindVAO(o)}getSubData(e,t=0,r,i){if(this._context.type!==v.zO.WEBGL2)return void _.error("Get buffer subdata is supported in WebGL2 only!");if(r<0||i<0)return void _.error("Problem getting subdata: offset and length were less than zero!");const o=function(e){return(0,u.zG)(e)}(e)?e.BYTES_PER_ELEMENT:1;if(o*((r??0)+(i??0))>e.byteLength)return void _.error("Problem getting subdata: offset and length exceeded destination size!");t+o*(i??0)>this.byteLength&&_.warn("Potential problem getting subdata: requested data exceeds buffer size!");const n=this._context.gl;this._context.bindBuffer(this,m.w0.COPY_READ_BUFFER),n.getBufferSubData(m.w0.COPY_READ_BUFFER,t,e,r,i),this._context.unbindBuffer(m.w0.COPY_READ_BUFFER)}async getSubDataAsync(e,t=0,r,i){this._context.type===v.zO.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(e,t,r,i)):_.error("Get buffer subdata is supported in WebGL2 only!")}}var x=r(4375),E=r(45762);class b{constructor(e,t,r=t){this.internalFormat=e,this.width=t,this.height=r,this.multisampled=!1,this.samples=1}}class A{constructor(e,t){this._context=e,this._descriptor=t,this.type=x.B.RenderBuffer,this._context.instanceCounter.increment(m._g.Renderbuffer,this);const r=this._context.gl;this.glName=r.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:i,height:o,internalFormat:n,multisampled:a}=t;if(a){if(this._context.type!==v.zO.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");r.renderbufferStorageMultisample(r.RENDERBUFFER,this.samples,n,i,o)}else r.renderbufferStorage(r.RENDERBUFFER,n,i,o)}get descriptor(){return this._descriptor}get samples(){const e=this._descriptor.samples,t=this._context.parameters.maxSamples;return e?Math.min(e,t):t}get gpuMemoryUsage(){return(e=this._descriptor).width<=0||e.height<=0||null==e.internalFormat?0:e.width*e.height*(0,E.RG)(e.internalFormat);var e}resize(e,t){const r=this._descriptor;if(r.width===e&&r.height===t)return;r.width=e,r.height=t;const i=this._context.gl;this._context.bindRenderbuffer(this),r.multisampled?i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,r.internalFormat,r.width,r.height):i.renderbufferStorage(i.RENDERBUFFER,r.internalFormat,r.width,r.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(m._g.Renderbuffer,this),this._context=null)}}var S=r(57088);const R=f.Z.getLogger("esri.views.webgl.FramebufferObject");class w{constructor(e,t,r=null){this._context=e,this._glName=null,this._colorAttachments=new Map,this._depthStencilBuffer=null,this._depthStencilTexture=null,this._initialized=!1,e.instanceCounter.increment(m._g.FramebufferObject,this);const i=M(t)?t:new S.x(this._context,t);if(this._colorAttachments.set(m.VY.COLOR_ATTACHMENT0,i),this._validateTextureDescriptor(i.descriptor),this._validateColorAttachmentPoint(m.VY.COLOR_ATTACHMENT0),null!=r)if(function(e){return M(e)||null!=e&&"pixelFormat"in e}(r))this._context.capabilities.depthTexture||console.error("Setting the depth/stencil texture as an attachment requires WEBGL_depth_texture or WebGL2"),this._depthStencilTexture=M(r)?r:new S.x(this._context,r),this._validateTextureDescriptor(this._depthStencilTexture.descriptor);else{const e=function(e){return null!=e&&"type"in e&&e.type===x.B.RenderBuffer}(r)?r:new A(this._context,r);this._depthStencilBuffer=e,this._validateRenderBufferDescriptor(e.descriptor)}}dispose(){if(0===this._colorAttachments.size&&!this._glName)return;const e=this._context.getBoundFramebufferObject();this._colorAttachments.forEach(((e,t)=>this.detachColorTexture(t)?.dispose())),this.detachDepthStencilBuffer()?.dispose(),this.detachDepthStencilTexture()?.dispose(),this._glName&&(this._context.gl.deleteFramebuffer(this._glName),this._glName=null),this._context.bindFramebuffer(e),this._context.instanceCounter.decrement(m._g.FramebufferObject,this)}get glName(){return this._glName}get colorTexture(){return this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0)}get depthStencil(){return this._depthStencilTexture||this._depthStencilBuffer}get depthStencilTexture(){return this._depthStencilTexture}get width(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.width??0}get height(){const e=this._colorAttachments.get(m.VY.COLOR_ATTACHMENT0);return e?.descriptor?.height??0}get gpuMemoryUsage(){return[...this._colorAttachments].reduce(((e,[t,r])=>e+r.gpuMemoryUsage),this.depthStencil?.gpuMemoryUsage??0)}getColorTexture(e){const t=this._colorAttachments.get(e);return t&&M(t)?t:null}get colorAttachments(){return[...this._colorAttachments.keys()]}attachColorTexture(e,t=m.VY.COLOR_ATTACHMENT0){if(!e)return;this._validateColorAttachmentPoint(t);const r=e.descriptor;this._validateTextureDescriptor(r),this.detachColorTexture(t)?.dispose(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,t)),this._colorAttachments.set(t,e)}detachColorTexture(e=m.VY.COLOR_ATTACHMENT0){const t=this._colorAttachments.get(e);if(t){if(this._initialized){const t=this._context.getBoundFramebufferObject();this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e),this._context.bindFramebuffer(t)}return this._colorAttachments.delete(e),t}}setColorTextureTarget(e,t=m.VY.COLOR_ATTACHMENT0){const r=this._colorAttachments.get(t);r&&this._framebufferTexture2D(r.glName,t,e)}attachDepthStencil(e){if(e)switch(e.type){case x.B.Texture:return this._attachDepthStencilTexture(e);case x.B.RenderBuffer:return this._attachDepthStencilBuffer(e)}}_attachDepthStencilTexture(e){if(null==e)return;const t=e.descriptor;t.pixelFormat!==m.VI.DEPTH_STENCIL&&t.pixelFormat!==m.VI.DEPTH24_STENCIL8&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),t.dataType!==m.Br.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),this._validateTextureDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(e.glName,m.Lu)),this._depthStencilTexture?.dispose(),this._depthStencilTexture=e}detachDepthStencilTexture(){const e=this._depthStencilTexture;return e&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,m.Lu)),this._depthStencilTexture=null,e}_attachDepthStencilBuffer(e){if(null==e)return;const t=e.descriptor;if(this._validateRenderBufferDescriptor(t),this._disposeDepthStencilAttachments(),this._initialized){this._context.bindFramebuffer(this);const r=this._context.gl,i=this._getGLAttachmentPoint(t);r.framebufferRenderbuffer(m.qi.FRAMEBUFFER,i,r.RENDERBUFFER,e.glName)}this._depthStencilBuffer=e}detachDepthStencilBuffer(){const e=this._depthStencilBuffer;if(e&&this._initialized){this._context.bindFramebuffer(this);const t=this._context.gl,r=this._getGLAttachmentPoint(e.descriptor);t.framebufferRenderbuffer(m.qi.FRAMEBUFFER,r,t.RENDERBUFFER,null)}return this._depthStencilBuffer=null,e}copyToTexture(e,t,r,i,o,n,a){(e<0||t<0||o<0||n<0)&&console.error("Offsets cannot be negative!"),(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!");const s=a.descriptor;a.descriptor.target!==m.No.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),(null==s?.width||null==s?.height||e+r>this.width||t+i>this.height||o+r>s.width||n+i>s.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const l=this._context,c=l.bindTexture(a,S.x.TEXTURE_UNIT_FOR_UPDATES);l.setActiveTexture(S.x.TEXTURE_UNIT_FOR_UPDATES),l.bindFramebuffer(this),l.gl.copyTexSubImage2D(m.No.TEXTURE_2D,0,o,n,e,t,r,i),l.bindTexture(c,S.x.TEXTURE_UNIT_FOR_UPDATES)}readPixels(e,t,r,i,o,n,a){(r<=0||i<=0)&&console.error("Copy width and height must be greater than zero!"),a||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(e,t,r,i,o,n,a)}async readPixelsAsync(e,t,r,i,o,n,a){if(this._context.type!==v.zO.WEBGL2)return(0,g.hZ)()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(e,t,r,i,o,n,a);const s=this._context.gl,l=T.createPixelPack(this._context,m.l1.STREAM_READ,a.byteLength);this._context.bindBuffer(l),this._context.bindFramebuffer(this),s.readPixels(e,t,r,i,o,n,0),this._context.unbindBuffer(m.w0.PIXEL_PACK_BUFFER),await l.getSubDataAsync(a),l.dispose()}resize(e,t){if(this.width===e&&this.height===t)return;const r={width:e,height:t};y(r,this._context.parameters.maxTextureSize),this._colorAttachments.forEach((e=>e.resize(r.width,r.height))),this._depthStencilTexture?.resize(r.width,r.height),this._initialized&&(y(r,this._context.parameters.maxRenderbufferSize),this._depthStencilBuffer?.resize(r.width,r.height),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1)}initializeAndBind(e=m.qi.FRAMEBUFFER){const t=this._context.gl;if(this._initialized)return void t.bindFramebuffer(e,this.glName);this._glName&&t.deleteFramebuffer(this._glName);const r=t.createFramebuffer();if(t.bindFramebuffer(e,r),this._colorAttachments.forEach(((t,r)=>this._framebufferTexture2D(t.glName,r,C(t),e))),this._depthStencilBuffer){const r=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);t.framebufferRenderbuffer(e,r,t.RENDERBUFFER,this._depthStencilBuffer.glName)}else this._depthStencilTexture&&this._framebufferTexture2D(this._depthStencilTexture.glName,t.DEPTH_STENCIL_ATTACHMENT,C(this._depthStencilTexture),e);(0,g.hZ)()&&t.checkFramebufferStatus(e)!==t.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=r,this._initialized=!0}_framebufferTexture2D(e,t=m.VY.COLOR_ATTACHMENT0,r=m.No.TEXTURE_2D,i=m.qi.FRAMEBUFFER,o=0){this._context.gl.framebufferTexture2D(i,t,r,e,o)}_disposeDepthStencilAttachments(){const e=this._context.gl;if(this._depthStencilBuffer){if(this._initialized){this._context.bindFramebuffer(this);const t=this._getGLAttachmentPoint(this._depthStencilBuffer.descriptor);e.framebufferRenderbuffer(m.qi.FRAMEBUFFER,t,e.RENDERBUFFER,null)}this._depthStencilBuffer=(0,a.M2)(this._depthStencilBuffer)}this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,e.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture=(0,a.M2)(this._depthStencilTexture))}_validateTextureDescriptor(e){e.target!==m.No.TEXTURE_2D&&e.target!==m.No.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),y(e,this._context.parameters.maxTextureSize),this._validateBufferDimensions(e)}_validateRenderBufferDescriptor(e){y(e,this._context.parameters.maxRenderbufferSize),this._validateBufferDimensions(e)}_validateBufferDimensions(e){e.width<=0&&(e.width=this.width),e.height<=0&&(e.height=this.height),this.width>0&&this.height>0&&(this.width===e.width&&this.height===e.height||console.error("Attachment size must match framebuffer size!"))}_getGLAttachmentPoint(e){switch(e.internalFormat){case m.Tg.DEPTH_COMPONENT16:case m.Tg.DEPTH_COMPONENT24:case m.Tg.DEPTH_COMPONENT32F:return this._context.gl.DEPTH_ATTACHMENT;case m.Tg.DEPTH24_STENCIL8:case m.Tg.DEPTH32F_STENCIL8:case m.Tg.DEPTH_STENCIL:return this._context.gl.DEPTH_STENCIL_ATTACHMENT;case m.Tg.STENCIL_INDEX8:return this._context.gl.STENCIL_ATTACHMENT}}_validateColorAttachmentPoint(e){if(-1===w._MAX_COLOR_ATTACHMENTS){const e=this._context.capabilities.drawBuffers;if(e){const t=this._context.gl;w._MAX_COLOR_ATTACHMENTS=t.getParameter(e.MAX_COLOR_ATTACHMENTS)}else w._MAX_COLOR_ATTACHMENTS=1}const t=e-m.VY.COLOR_ATTACHMENT0;t+1>w._MAX_COLOR_ATTACHMENTS&&f.Z.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${t+1}. Implementation supports up to ${w._MAX_COLOR_ATTACHMENTS} color attachments`)}}function M(e){return null!=e&&"type"in e&&e.type===x.B.Texture}function y(e,t){const r=Math.max(e.width,e.height);if(r>t){R.warn(`Resizing FBO attachment size ${e.width}x${e.height} to device limit ${t}`);const i=t/r;return e.width=Math.round(e.width*i),e.height=Math.round(e.height*i),!1}return!0}function C(e){return e.descriptor.target===m.No.TEXTURE_CUBE_MAP?m.No.TEXTURE_CUBE_MAP_POSITIVE_X:m.No.TEXTURE_2D}w._MAX_COLOR_ATTACHMENTS=-1;var O,I,P=r(47859);(I=O||(O={}))[I.RED=0]="RED",I[I.RG=1]="RG",I[I.RGBA4=2]="RGBA4",I[I.RGBA=3]="RGBA",I[I.RGBA_MIPMAP=4]="RGBA_MIPMAP",I[I.R16F=5]="R16F",I[I.RGBA16F=6]="RGBA16F";const N=new P.X;N.pixelFormat=m.VI.RED,N.internalFormat=m.lP.R8,N.wrapMode=m.e8.CLAMP_TO_EDGE;const L=new P.X;L.pixelFormat=m.VI.RG,L.internalFormat=m.lP.RG8,L.wrapMode=m.e8.CLAMP_TO_EDGE;const D=new P.X;D.internalFormat=m.lP.RGBA4,D.dataType=m.Br.UNSIGNED_SHORT_4_4_4_4,D.wrapMode=m.e8.CLAMP_TO_EDGE;(new P.X).wrapMode=m.e8.CLAMP_TO_EDGE;const F=new P.X;F.wrapMode=m.e8.CLAMP_TO_EDGE,F.samplingMode=m.cw.LINEAR_MIPMAP_LINEAR,F.hasMipmap=!0,F.maxAnisotropy=8;const H=new P.X;H.pixelFormat=m.VI.RED,H.dataType=m.Br.HALF_FLOAT,H.internalFormat=m.lP.R16F,H.samplingMode=m.cw.NEAREST;const B=new P.X;var G;B.dataType=m.Br.HALF_FLOAT,B.internalFormat=m.lP.RGBA16F,B.samplingMode=m.cw.NEAREST,O.RED,O.RG,O.RGBA4,O.RGBA,O.RGBA_MIPMAP,O.R16F,O.RGBA16F,function(e){e[e.DEPTH_STENCIL_TEXTURE=0]="DEPTH_STENCIL_TEXTURE",e[e.DEPTH_STENCIL_BUFFER=1]="DEPTH_STENCIL_BUFFER",e[e.DEPTH24_BUFFER=2]="DEPTH24_BUFFER",e[e.DEPTH16_BUFFER=3]="DEPTH16_BUFFER"}(G||(G={}));const U=new P.X;U.pixelFormat=m.VI.DEPTH_STENCIL,U.dataType=m.Br.UNSIGNED_INT_24_8,U.samplingMode=m.cw.NEAREST,U.wrapMode=m.e8.CLAMP_TO_EDGE,G.DEPTH_STENCIL_TEXTURE,G.DEPTH_STENCIL_BUFFER,new b(m.Tg.DEPTH24_STENCIL8,4),G.DEPTH24_BUFFER,new b(m.Tg.DEPTH_COMPONENT24,4),G.DEPTH16_BUFFER,new b(m.Tg.DEPTH_COMPONENT16,4);var z=r(92036),V=r(55039);const W={required:[]},j=(V.H.Depth,V.H.CompositeColor,V.H.Highlight,{required:[V.H.Depth,V.H.Normal]});class q extends z.Z{consumes(){return W}get usedMemory(){return 0}get isDecoration(){return!1}get running(){return!1}}class k extends q{}var X=r(78869),$=r(14589),Y=r(83475),J=r(59377),Z=r(59915),K=r(27097);class Q extends $.A{initializeProgram(e){return new J.$(e.rctx,Q.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}Q.shader=new X.J(Z.S,(()=>r.e(8092).then(r.bind(r,88092))));var ee=r(97323);class te extends i.K{constructor(){super(...arguments),this.projScale=1}}class re extends te{constructor(){super(...arguments),this.intensity=1}}class ie extends i.K{}class oe extends ie{constructor(){super(...arguments),this.blurSize=(0,ee.a)()}}var ne,ae=r(25377);class se extends $.A{initializeProgram(e){return new J.$(e.rctx,se.shader.get().build(),Y.i)}initializePipeline(){return(0,K.sm)({colorWrite:K.BK})}}se.shader=new X.J(ae.S,(()=>r.e(9243).then(r.bind(r,49243)))),r(95720),function(e){e[e.Antialiasing=0]="Antialiasing",e[e.HighQualityTransparency=1]="HighQualityTransparency",e[e.HighResolutionVoxel=2]="HighResolutionVoxel",e[e.HighResolutionAtmosphere=3]="HighResolutionAtmosphere",e[e.SSAO=4]="SSAO",e[e.WaterReflection=5]="WaterReflection",e[e.HighResolutionShadows=6]="HighResolutionShadows",e[e.PhysicalPixelRendering=7]="PhysicalPixelRendering"}(ne||(ne={}));var le=r(97995);const ce=2;let ue=class extends k{constructor(e){super(e),this._context=null,this._passParameters=new re,this._drawParameters=new oe,this.produces=new Map([[le.r.SSAO,()=>this._produces()]])}_produces(){return null!=this._enableTime&&null!=this._context}consumes(){return this._produces()?j:W}initializeRenderContext(e){this._context=e,this.addHandles([(0,s.YP)((()=>this.view.qualitySettings.ambientOcclusion||this._context?.isFeatureEnabled(ne.SSAO)),(e=>e?this._enable():this._disable()),s.tX)])}uninitializeRenderContext(){this._disable(),this._context=null}_disable(){this._passParameters.noiseTexture=(0,a.M2)(this._passParameters.noiseTexture),this._enableTime=null}destroy(){this._disable()}_enable(){if(null!=this._enableTime||!this._context)return;const e=Uint8Array.from(atob("eXKEvZaUc66cjIKElE1jlJ6MjJ6Ufkl+jn2fcXp5jBx7c6KEflSGiXuXeW6OWs+tfqZ2Yot2Y7Zzfo2BhniEj3xoiXuXj4eGZpqEaHKDWjSMe7palFlzc3BziYOGlFVzg6Zzg7CUY5JrjFF7eYJ4jIKEcyyEonSXe7qUfqZ7j3xofqZ2c4R5lFZ5Y0WUbppoe1l2cIh2ezyUho+BcHN2cG6DbpqJhqp2e1GcezhrdldzjFGUcyxjc3aRjDyEc1h7Sl17c6aMjH92pb6Mjpd4dnqBjMOEhqZleIOBYzB7gYx+fnqGjJuEkWlwnCx7fGl+c4hjfGyRe5qMlNOMfnqGhIWHc6OMi4GDc6aMfqZuc6aMzqJzlKZ+lJ6Me3qRfoFue0WUhoR5UraEa6qMkXiPjMOMlJOGe7JrUqKMjK6MeYRzdod+Sl17boiPc6qEeYBlcIh2c1WEe7GDiWCDa0WMjEmMdod+Y0WcdntzhmN8WjyMjKJjiXtzgYxYaGd+a89zlEV7e2GJfnd+lF1rcK5zc4p5cHuBhL6EcXp5eYB7fnh8iX6HjIKEeaxuiYOGc66RfG2Ja5hzjlGMjEmMe9OEgXuPfHyGhPeEdl6JY02McGuMfnqGhFiMa3WJfnx2l4hwcG1uhmN8c0WMc39og1GBbrCEjE2EZY+JcIh2cIuGhIWHe0mEhIVrc09+gY5+eYBlnCyMhGCDl3drfmmMgX15aGd+gYx+fnuRfnhzY1SMsluJfnd+hm98WtNrcIuGh4SEj0qPdkqOjFF7jNNjdnqBgaqUjMt7boeBhnZ4jDR7c5pze4GGjEFrhLqMjHyMc0mUhKZze4WEa117kWlwbpqJjHZ2eX2Bc09zeId+e0V7WlF7jHJ2l72BfId8l3eBgXyBe897jGl7c66cgW+Xc76EjKNbgaSEjGx4fId8jFFjgZB8cG6DhlFziZhrcIh2fH6HgUqBgXiPY8dahGFzjEmMhEFre2dxhoBzc5SGfleGe6alc7aUeYBlhKqUdlp+cH5za4OEczxza0Gcc4J2jHZ5iXuXjH2Jh5yRjH2JcFx+hImBjH+MpddCl3dreZeJjIt8ZW18bm1zjoSEeIOBlF9oh3N7hlqBY4+UeYFwhLJjeYFwaGd+gUqBYxiEYot2fqZ2ondzhL6EYyiEY02Ea0VjgZB8doaGjHxoc66cjEGEiXuXiXWMiZhreHx8frGMe75rY02Ec5pzfnhzlEp4a3VzjM+EhFFza3mUY7Zza1V5e2iMfGyRcziEhDyEkXZ2Y4OBnCx7g5t2eyBjgV6EhEFrcIh2dod+c4Z+nJ5zjm15jEmUeYxijJp7nL6clIpjhoR5WrZraGd+fnuRa6pzlIiMg6ZzfHx5foh+eX1ufnB5eX1ufnB5aJt7UqKMjIh+e3aBfm5lbYSBhGFze6J4c39oc0mUc4Z+e0V7fKFVe0WEdoaGY02Ec4Z+Y02EZYWBfH6HgU1+gY5+hIWUgW+XjJ57ebWRhFVScHuBfJ6PhBx7WqJzlM+Ujpd4gHZziX6HjHmEgZN+lJt5boiPe2GJgX+GjIGJgHZzeaxufnB5hF2JtdN7jJ57hp57hK6ElFVzg6ZzbmiEbndzhIWHe3uJfoFue3qRhJd2j3xoc65zlE1jc3p8lE1jhniEgXJ7e657vZaUc3qBh52BhIF4aHKDa9drgY5+c52GWqZzbpqJe8tjnM+UhIeMfo2BfGl+hG1zSmmMjKJjZVaGgX15c1lze0mEp4OHa3mUhIWHhDyclJ6MeYOJkXiPc0VzhFiMlKaEboSJa5Jze41re3qRhn+HZYWBe0mEc4p5fnORbox5lEp4hGFjhGGEjJuEc1WEhLZjeHeGa7KlfHx2hLaMeX1ugY5+hIWHhKGPjMN7c1WEho1zhoBzZYx7fnhzlJt5exyUhFFziXtzfmmMa6qMYyiEiXxweV12kZSMeWqXSl17fnhzxmmMrVGEe1mcc4p5eHeGjK6MgY5+doaGa6pzlGV7g1qBh4KHkXiPeW6OaKqafqZ2eXZ5e1V7jGd7boSJc3BzhJd2e0mcYot2h1RoY8dahK6EQmWEWjx7e1l2lL6UgXyBdnR4eU9zc0VreX1umqaBhld7fo2Bc6KEc5Z+hDyEcIeBWtNrfHyGe5qMhMuMe5qMhEGEbVVupcNzg3aHhIF4boeBe0mEdlptc39ofFl5Y8uUlJOGiYt2UmGEcyxjjGx4jFF7a657ZYWBnElzhp57iXtrgZN+tfOEhIOBjE2HgU1+e8tjjKNbiWCDhE15gUqBgYN7fnqGc66ce9d7iYSBj0qPcG6DnGGcT3eGa6qMZY+JlIiMl4hwc3aRdnqBlGV7eHJ2hLZjfnuRhDyEeX6MSk17g6Z+c6aUjHmEhIF4gXyBc76EZW18fGl+fkl+jCxrhoVwhDyUhIqGlL2DlI6EhJd2tdN7eYORhEGMa2Faa6pzc3Bzc4R5lIRznM+UY9eMhDycc5Z+c4p5c4iGY117pb6MgXuPrbJafnx2eYOJeXZ5e657hDyEcziElKZjfoB5eHeGj4WRhGGEe6KGeX1utTStc76EhFGJnCyMa5hzfH6HnNeceYB7hmN8gYuMhIVrczSMgYF8h3N7c5pza5hzjJqEYIRdgYuMlL2DeYRzhGGEeX1uhLaEc4iGeZ1zdl6JhrVteX6Me2iMfm5lWqJzSpqEa6pzdnmchHx2c6OMhNdrhoR5g3aHczxzeW52gV6Ejm15frGMc0Vzc4Z+l3drfniJe+9rWq5rlF1rhGGEhoVwe9OEfoh+e7pac09+c3qBY0lrhDycdnp2lJ6MiYOGhGCDc3aRlL2DlJt5doaGdnp2gYF8gWeOjF2Uc4R5c5Z+jEmMe7KEc4mEeYJ4dmyBe0mcgXiPbqJ7eYB7fmGGiYSJjICGlF1reZ2PnElzbpqJfH6Hc39oe4WEc5eJhK6EhqyJc3qBgZB8c09+hEmEaHKDhFGJc5SGiXWMUpaEa89zc6OMnCyMiXtrho+Be5qMc7KEjJ57dmN+hKGPjICGbmiEe7prdod+hGCDdnmchBx7eX6MkXZ2hGGEa657hm98jFFjY5JreYOJgY2EjHZ2a295Y3FajJ6Mc1J+YzB7e4WBjF2Uc4R5eV12gYxzg1qBeId+c9OUc5pzjFFjgY5+hFiMlIaPhoR5lIpjjIKBlNdSe7KEeX2BfrGMhIqGc65zjE2UhK6EklZ+QmWEeziMWqZza3VzdnR4foh+gYF8n3iJiZhrnKp7gYF8eId+lJ6Me1lrcIuGjKJjhmN8c66MjFF7a6prjJ6UnJ5zezyUfruRWlF7nI5zfHyGe657h4SEe8tjhBx7jFFjc09+c39ojICMeZeJeXt+YzRzjHZ2c0WEcIeBeXZ5onSXkVR+gYJ+eYFwdldzgYF7eX2BjJ6UiXuXlE1jh4SEe1mchLJjc4Z+hqZ7eXZ5bm1zlL6Ue5p7iWeGhKqUY5pzjKJjcIeBe8t7gXyBYIRdlEp4a3mGnK6EfmmMZpqEfFl5gYxzjKZuhGFjhoKGhHx2fnx2eXuMe3aBiWeGvbKMe6KGa5hzYzB7gZOBlGV7hmN8hqZlYot2Y117a6pzc6KEfId8foB5rctrfneJfJ6PcHN2hFiMc5pzjH92c0VzgY2EcElzdmCBlFVzg1GBc65zY4OBboeBcHiBeYJ4ewxzfHx5lIRzlEmEnLKEbk1zfJ6PhmN8eYBljBiEnMOEiXxwezyUcIeBe76EdsKEeX2BdnR4jGWUrXWMjGd7fkl+j4WRlEGMa5Jzho+BhDyEfnqMeXt+g3aHlE1jczClhNN7ZW18eHx8hGFjZW18iXWMjKJjhH57gYuMcIuGWjyMe4ZtjJuExmmMj4WRdntzi4GDhFFzYIRdnGGcjJp7Y0F7e4WEkbCGiX57fnSHa657a6prhBCMe3Z+SmmMjH92eHJ2hK6EY1FzexhrvbKMnI5za4OEfnd+eXuMhImBe897hLaMjN+EfG+BeIOBhF1+eZeJi4GDkXZ2eXKEgZ6Ejpd4c2GHa1V5e5KUfqZuhCx7jKp7lLZrg11+hHx2hFWUoot2nI5zgbh5mo9zvZaUe3qRbqKMfqZ2kbCGhFiM"),(e=>e.charCodeAt(0))),t=new P.X;t.wrapMode=m.e8.CLAMP_TO_EDGE,t.pixelFormat=m.VI.RGB,t.wrapMode=m.e8.REPEAT,t.hasMipmap=!0,t.width=32,t.height=32,this._passParameters.noiseTexture=new S.x(this._context.renderContext.rctx,t,e),null==this._ssaoTechnique&&(this._ssaoTechnique=this._context.techniqueRepository.acquire(se)),null==this._blurTechnique&&(this._blurTechnique=this._context.techniqueRepository.acquire(Q)),this._enableTime=(0,l.HA)(0),this._context?.requestRender()}renderNode(e,t,r){const i=e.bindParameters,o=i.linearDepth?.colorTexture,n=r?.normal?.colorTexture;if(null==this._enableTime||null==this._context||null==o||!n)return;if(!this._ssaoTechnique.compiled||!this._blurTechnique.compiled)return this._enableTime=e.time,void this._context.requestRender();0===this._enableTime&&(this._enableTime=e.time);const a=e.rctx,s=i.camera,l=this.view.qualitySettings.fadeDuration,c=l>0?Math.min(l,e.time-this._enableTime)/l:1;this._passParameters.normalTexture=n,this._passParameters.depthTexture=o,this._passParameters.projScale=1/s.computeScreenPixelSizeAtDist(1),this._passParameters.intensity=4*de/(0,ae.g)(s)**6*c;const u=s.fullViewport[2],d=s.fullViewport[3],f=Math.round(u/ce),p=Math.round(d/ce),g=this._context.fbos,v=g.acquire(O.RED,u,d);a.bindFramebuffer(v.fbo),a.setViewport(0,0,u,d),a.bindTechnique(this._ssaoTechnique,this._passParameters,i).bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw();const _=a.bindTechnique(this._blurTechnique,this._passParameters,i);a.setViewport(0,0,f,p);const T=g.acquire(O.RED,f,p);a.bindFramebuffer(T.fbo),this._drawParameters.colorTexture=v.colorTexture,(0,h.s)(this._drawParameters.blurSize,0,ce/d),_.bindDraw(this._drawParameters,i,this._passParameters),a.setViewport(0,0,f,p),a.screen.draw(),v.release();const x=g.acquire(O.RED,f,p);return a.bindFramebuffer(x.fbo),a.setViewport(0,0,u,d),a.setClearColor(1,1,1,0),a.clear(m.lk.COLOR_BUFFER_BIT),a.setViewport(0,0,f,p),this._drawParameters.colorTexture=T.colorTexture,(0,h.s)(this._drawParameters.blurSize,ce/u,0),_.bindDraw(this._drawParameters,i,this._passParameters),a.screen.draw(),a.setViewport4fv(s.fullViewport),T.release(),c<1&&this._context.requestRender(),x}};(0,n._)([(0,c.Cb)({constructOnly:!0})],ue.prototype,"view",void 0),(0,n._)([(0,c.Cb)()],ue.prototype,"_context",void 0),ue=(0,n._)([(0,d.j)("esri.views.3d.webgl-engine.effects.ssao.SSAO")],ue);const de=.5;function he(e,t){const r=e.fragment;t.receiveAmbientOcclusion?(r.uniforms.add(new o.A("ssaoTex",((e,t)=>t.ssao?.colorTexture))),r.constants.add("blurSizePixelsInverse","float",1/ce),r.code.add(i.H`float evaluateAmbientOcclusionInverse() {
627
627
  vec2 ssaoTextureSizeInverse = 1.0 / vec2(textureSize(ssaoTex, 0));
628
628
  return texture(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).r;
629
629
  }
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4608,5935],{1542:(e,t,r)=>{r.d(t,{A4:()=>s,L9:()=>o,yV:()=>n});var i=r(17126);class n{}function s(e){return e instanceof i.ld?e===n.instance:"unknown"===e?.toString().toLowerCase()}function o(e){return s(e)?n.instance:e}n.instance=new i.vF("Etc/UTC")},60590:(e,t,r)=>{r.r(t),r.d(t,{default:()=>Bt});var i=r(43697),n=r(51773),s=r(2368),o=r(20102),a=r(16453),l=r(95330),u=r(5600),p=r(75215),c=(r(67676),r(80442),r(52011)),d=r(30556),m=r(87085),h=r(66577),y=r(38171),f=r(30030),g=r(3172),b=r(60235),w=r(22974),v=r(92604),R=r(17445),_=r(17452),S=r(71715),F=r(8744),C=r(21506),x=r(35956),I=r(96674),T=r(45663),N=r(81578);const D={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}};var j=r(93010),P=r(75509),O=r(23847);const Z=new Set(["u1","u2","u4","u8","s8","u16","s16"]),M={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},A=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function V(e){return A.has(e.type)}function J(e,t){if(!e||!t)return(0,w.d9)(e||t);const r=(0,w.d9)(e);if(r.functionDefinition&&t.rasterFunctionDefinition){const e=t.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=void 0),E(r.functionDefinition.arguments,t),r.rasterFunctionDefinition=r.functionDefinition.toJSON()}else"none"!==t.functionName?.toLowerCase()&&(G(r.functionArguments).Raster=t);return r}function E(e,t){for(const r in e)"raster"===r.toLowerCase()&&("RasterFunctionVariable"===e[r].type?(e[r]=t.rasterFunctionDefinition,e[r].type="RasterFunctionTemplate"):"RasterFunctionTemplate"===e[r].type&&E(e[r].arguments,t))}function q(e){const t=(0,w.d9)(D[e.functionName+"Function"]),r=e.functionArguments;for(const e in r)"raster"===e.toLowerCase()?(t.arguments[e]=q(r[e]),t.arguments[e].type="RasterFunctionTemplate"):"colormap"===e.toLowerCase()?(t.arguments[e].value=U(r[e]),t.arguments.ColorSchemeType.value=0):t.arguments[e].value=r[e];return t}function G(e){const t=e?.Raster??e?.raster;return t&&"esri.layers.support.RasterFunction"===t.declaredClass?G(t.functionArguments):e}const z={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function L(e,t){const r=Z.has(t)?(0,N.r)(t):null;return r&&e.push([Math.floor(r[0]-1),0,0,0],[Math.ceil(r[1]+1),0,0,0]),e}function B(e){if(null==e)return;const{fields:t}=e,r=t?.find((e=>e?.name&&"value"===e.name.toLowerCase()));return r?.name}function H(e){const t=[];return e?.forEach((e=>{const r=e;if(Array.isArray(r))t.push(r);else{if(null==r.min||null==r.max)return;const e=[r.min,r.max,r.avg||0,r.stddev||0];t.push(e)}})),t}function U(e){const t=[],r=[];return e.forEach((e=>{t.push(e[0]),r.push((0,j.oI)([...e.slice(1),255]))})),{type:"RasterColormap",values:t,colors:r}}var k=r(98974),Q=r(69608);let $=class extends I.wq{constructor(){super(...arguments),this.layer=null,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}get adjustAspectRatio(){return this.layer.adjustAspectRatio}writeAdjustAspectRatio(e,t,r){this.layer.version<10.3||(t[r]=e)}get bandIds(){return this.layer.bandIds}get compressionQuality(){return this.layer.compressionQuality}writeCompressionQuality(e,t,r){this.format&&this.format.toLowerCase().includes("jpg")&&null!=e&&(t[r]=e)}get compressionTolerance(){return this.layer.compressionTolerance}writeCompressionTolerance(e,t,r){"lerc"===this.format&&null!=e&&(t[r]=e)}get format(){return"vector-field"===this.layer.renderer?.type?"lerc":this.layer.format}get interpolation(){return this.layer.interpolation}get noData(){return this.layer.noData}get noDataInterpretation(){return this.layer.noDataInterpretation}writeLercVersion(e,t,r){"lerc"===this.format&&this.layer.version>=10.5&&(t[r]=e)}get version(){const e=this.layer;return e.commitProperty("bandIds"),e.commitProperty("format"),e.commitProperty("compressionQuality"),e.commitProperty("compressionTolerance"),e.commitProperty("interpolation"),e.commitProperty("noData"),e.commitProperty("noDataInterpretation"),e.commitProperty("mosaicRule"),e.commitProperty("rasterFunction"),e.commitProperty("adjustAspectRatio"),e.commitProperty("pixelFilter"),e.commitProperty("definitionExpression"),e.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(e){this._set("version",e)}get mosaicRule(){const e=this.layer;let t=e.mosaicRule;const r=e.definitionExpression;return t?r&&r!==t.where&&(t=t.clone(),t.where=r):r&&(t=new k.Z({where:r})),t}get rasterFunction(){const e=this.layer;let{rasterFunction:t}=e;const r=e.pixelFilter,i=!e.format||e.format.includes("jpg")||e.format.includes("png");t=this._addResampleRasterFunction(t);const n=e.multidimensionalSubset?.areaOfInterest;return n&&(t=this._addClipFunction(t,n)),i&&!r&&"vector-field"!==e.renderer?.type&&(t=this.combineRendererWithRenderingRule(t)),t}combineRendererWithRenderingRule(e){const t=this.layer,{rasterInfo:r,renderer:i}=t;return e=e||t.rasterFunction,i&&V(i)?J(function(e,t){switch(t=t||{},e.type){case"raster-stretch":return function(e,t){const r=t.convertToRFT,i=new T.Z;i.functionName="Stretch";const n=z[P.v.toJSON(e.stretchType)],s="u8",o={StretchType:n,Statistics:H(e.statistics??[]),DRA:e.dynamicRangeAdjustment,UseGamma:e.useGamma,Gamma:e.gamma,ComputeGamma:e.computeGamma};if(null!=e.outputMin&&(o.Min=e.outputMin),null!=e.outputMax&&(o.Max=e.outputMax),n===z.standardDeviation?(o.NumberOfStandardDeviations=e.numberOfStandardDeviations,i.outputPixelType=s):n===z.percentClip?(o.MinPercent=e.minPercent,o.MaxPercent=e.maxPercent,i.outputPixelType=s):n===z.minMax?i.outputPixelType=s:n===z.sigmoid&&(o.SigmoidStrengthLevel=e.sigmoidStrengthLevel),i.functionArguments=o,i.variableName="Raster",e.colorRamp){const n=e.colorRamp,s=new T.Z;if(r)s.functionArguments={ColorRamp:(0,j.pM)(n)};else{const r=(0,j.Uh)(n,!0);if(r)s.functionArguments={colorRampName:r};else if(!t.convertColorRampToColormap||"algorithmic"!==n.type&&"multipart"!==n.type){const t=e.colorRamp.toJSON();"algorithmic"===t.type?t.algorithm=t.algorithm||"esriCIELabAlgorithm":"multipart"===t.type&&t.colorRamps?.length&&t.colorRamps.forEach((e=>e.algorithm=e.algorithm||"esriCIELabAlgorithm")),s.functionArguments={colorRamp:t}}else s.functionArguments={Colormap:(0,j.Jw)(n)}}return s.variableName="Raster",s.functionName="Colormap",s.functionArguments.Raster=i,r?new T.Z({rasterFunctionDefinition:q(s)}):s}return r?new T.Z({rasterFunctionDefinition:q(i)}):i}(e,t);case"class-breaks":return function(e,t){const r=[],i=[],n=[],s=[],o=1e-4,{pixelType:a,rasterAttributeTable:l}=t,u=null==l?null:l.features,p=B(l);if(p&&u&&Array.isArray(u)&&e.classBreakInfos){e.classBreakInfos.forEach(((t,r)=>{const i=t.symbol?.color;let n;i?.a&&null!=t.minValue&&null!=t.maxValue&&u.forEach((o=>{null!=t.minValue&&null!=t.maxValue&&(n=o.attributes[e.field],(n>=t.minValue&&n<t.maxValue||r===e.classBreakInfos.length-1&&n>=t.minValue)&&s.push([o.attributes[p],i.r,i.g,i.b]))}))}));const r=a?L(s,a):s,i=new T.Z;return i.functionName="Colormap",i.functionArguments={},i.functionArguments.Colormap=r,i.variableName="Raster",t.convertToRFT?new T.Z({rasterFunctionDefinition:q(i)}):i}e.classBreakInfos.forEach(((e,t)=>{if(null==e.minValue||null==e.maxValue)return;const a=e.symbol&&e.symbol.color;a?.a?(0===t?r.push(e.minValue,e.maxValue+o):r.push(e.minValue+o,e.maxValue+o),i.push(t),s.push([t,a.r,a.g,a.b])):n.push(e.minValue,e.maxValue)}));const c=a?L(s,a):s,d=new T.Z;d.functionName="Remap",d.functionArguments={InputRanges:r,OutputValues:i,NoDataRanges:n},d.variableName="Raster";const m=new T.Z;return m.functionName="Colormap",m.functionArguments={Colormap:c,Raster:d},t.convertToRFT?new T.Z({rasterFunctionDefinition:q(m)}):m}(e,t);case"unique-value":return function(e,t){const r=[],{pixelType:i,rasterAttributeTable:n}=t,s=null==n?null:n.features,o=B(n),a=e.defaultSymbol?.color?.toRgb(),l=e.uniqueValueInfos;if(l)if(s){if(o){const t=new Map;l.forEach((e=>{const r=e.value,i=e.symbol?.color;null!=r&&i?.a&&t.set(String(r),i.toRgb())}));const i=e.field;s.forEach((({attributes:e})=>{const n=String(e[i]),s=e[o],l=t.get(n);l?r.push([s,...l]):a&&r.push([s,...a])}))}}else for(let e=0;e<l.length;e++){const t=l[e],i=t.symbol?.color,n=+t.value;if(i?.a){if(isNaN(n))return null;r.push([n,i.r,i.g,i.b])}}const u=i?L(r,i):r,p=new T.Z;return p.functionName="Colormap",p.functionArguments={},p.functionArguments.Colormap=u,p.variableName="Raster",t.convertToRFT?new T.Z({rasterFunctionDefinition:q(p)}):p}(e,t);case"raster-colormap":return function(e,t){const r=e.extractColormap();if(!r||0===r.length)return null;const{pixelType:i}=t,n=i?L(r,i):r,s=new T.Z;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=n,t.convertToRFT?new T.Z({rasterFunctionDefinition:q(s)}):s}(e,t);case"vector-field":return function(e,t){const r=new T.Z;r.functionName="VectorFieldRenderer";const{dataType:i,bandNames:n}=t,s="vector-uv"===i;let o,a;if(n&&2===n.length){const e=n.map((e=>e.toLowerCase()));o=e.indexOf("magnitude"),a=e.indexOf("direction")}-1!==o&&null!==o||(o=0,a=1);const l="arithmetic"===e.rotationType?1:2,u="flow-from"===e.flowRepresentation?0:1,p=e.visualVariables?e.visualVariables.find((e=>"Magnitude"===e.field)):new O.Z,c={magnitudeBandID:o,directionBandID:a,isUVComponents:s,referenceSystem:l,massFlowAngleRepresentation:u,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:M[e.style.toLowerCase().replace("-","_")],minimumMagnitude:p.minDataValue,maximumMagnitude:p.maxDataValue,minimumSymbolSize:p.minSize,maximumSymbolSize:p.maxSize};r.functionArguments=c;const d=q(r);return t.convertToRFT?T.Z.fromJSON({rasterFunctionDefinition:d}):r}(e,t);case"raster-shaded-relief":return function(e,t){const r=t.convertToRFT;if("elevation"!==t.dataType&&("generic"!==t.dataType||1!==t.bandCount||"s16"!==t.pixelType&&"s32"!==t.pixelType&&"f32"!==t.pixelType&&"f64"!==t.pixelType))return new T.Z;const i=new T.Z;i.functionName="Hillshade";const n="traditional"===e.hillshadeType?0:1,s="none"===e.scalingType?1:3,o={HillshadeType:n,SlopeType:s,ZFactor:e.zFactor};return 0===n&&(o.Azimuth=e.azimuth,o.Altitude=e.altitude),3===s&&(o.PSPower=e.pixelSizePower,o.PSZFactor=e.pixelSizeFactor),i.functionArguments=o,i.variableName="Raster",e.colorRamp&&(i.functionName="ShadedRelief",r?o.ColorRamp=(0,j.pM)(e.colorRamp):o.Colormap=(0,j.Jw)(e.colorRamp)),r?new T.Z({rasterFunctionDefinition:q(i)}):i}(e,t);case"flow":throw new Error("Unsupported rendering rule.")}}(i,{rasterAttributeTable:r.attributeTable,pixelType:r.pixelType,dataType:r.dataType,bandNames:r.bandInfos.map((({name:e})=>e)),convertColorRampToColormap:t.version<10.6,convertToRFT:!!e?.rasterFunctionDefinition,bandCount:r.bandCount}),e):e}_addResampleRasterFunction(e){if("vector-field"!==this.layer.renderer?.type||"Resample"===e?.functionName)return e;const t="esriImageServiceDataTypeVector-UV"===this.layer.serviceDataType?7:10,r=this.layer.serviceRasterInfo.pixelSize;let i=new T.Z({functionName:"Resample",functionArguments:{ResamplingType:t,InputCellSize:r}});return i=e?.rasterFunctionDefinition?new T.Z({rasterFunctionDefinition:q(i)}):i,J(i,e)}_addClipFunction(e,t){return J(new T.Z({functionName:"Clip",functionArguments:{ClippingGeometry:t.toJSON(),ClippingType:1}}),e)}};(0,i._)([(0,u.Cb)()],$.prototype,"layer",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"adjustAspectRatio",null),(0,i._)([(0,d.c)("adjustAspectRatio")],$.prototype,"writeAdjustAspectRatio",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"bandIds",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"compression",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"compressionQuality",null),(0,i._)([(0,d.c)("compressionQuality")],$.prototype,"writeCompressionQuality",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"compressionTolerance",null),(0,i._)([(0,d.c)("compressionTolerance")],$.prototype,"writeCompressionTolerance",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"format",null),(0,i._)([(0,u.Cb)({type:String,json:{read:{reader:Q.cl.read},write:{writer:Q.cl.write}}})],$.prototype,"interpolation",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"noData",null),(0,i._)([(0,u.Cb)({type:String,json:{read:{reader:Q.kQ.read},write:{writer:Q.kQ.write}}})],$.prototype,"noDataInterpretation",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"pixelType",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"lercVersion",void 0),(0,i._)([(0,d.c)("lercVersion")],$.prototype,"writeLercVersion",null),(0,i._)([(0,u.Cb)({type:Number})],$.prototype,"version",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],$.prototype,"mosaicRule",null),(0,i._)([(0,u.Cb)({json:{write:!0,name:"renderingRule"}})],$.prototype,"rasterFunction",null),$=(0,i._)([(0,c.j)("esri.layers.mixins.ExportImageServiceParameters")],$);var W=r(1231),X=r(99514),Y=r(90082),K=r(29876),ee=r(5847),te=r(25972),re=r(88281),ie=r(99815),ne=r(75993),se=r(80676),oe=r(67058),ae=r(72758),le=r(16306),ue=r(11282),pe=r(82971);let ce=class extends I.wq{constructor(e){super(e),this.north=null,this.up=null,this.spatialReference=null}};(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],ce.prototype,"north",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],ce.prototype,"up",void 0),(0,i._)([(0,u.Cb)({type:pe.Z,json:{write:!0}})],ce.prototype,"spatialReference",void 0),ce=(0,i._)([(0,c.j)("esri.rest.support.ImageAngleResult")],ce);const de=ce;var me=r(67900);let he=class extends I.wq{constructor(){super(...arguments),this.value=null,this.displayValue=null,this.uncertainty=null}};(0,i._)([(0,u.Cb)({type:Number,json:{read:!0,write:!0}})],he.prototype,"value",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],he.prototype,"displayValue",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{read:!0,write:!0}})],he.prototype,"uncertainty",void 0),he=(0,i._)([(0,c.j)("esri.rest.support.ImageMeasureResultValue")],he);let ye=class extends he{constructor(){super(...arguments),this.unit=null}};(0,i._)([(0,u.Cb)({type:String,json:{read:me.Jo.read,write:me.Jo.write}})],ye.prototype,"unit",void 0),ye=(0,i._)([(0,c.j)("esri.rest.support.ImageMeasureResultLengthValue")],ye);let fe=class extends he{constructor(){super(...arguments),this.unit=null}};(0,i._)([(0,u.Cb)({type:String,json:{read:me.gV.read,write:me.gV.write}})],fe.prototype,"unit",void 0),fe=(0,i._)([(0,c.j)("esri.rest.support.ImageMeasureResultAreaValue")],fe);let ge=class extends he{constructor(){super(...arguments),this.unit=null}};(0,i._)([(0,u.Cb)({type:String,json:{read:me.CN.read,write:me.CN.write}})],ge.prototype,"unit",void 0),ge=(0,i._)([(0,c.j)("esri.rest.support.ImageMeasureResultAngleValue")],ge);let be=class extends I.wq{constructor(){super(...arguments),this.name=null,this.sensorName=null}};(0,i._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],be.prototype,"name",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:!0,write:!0}})],be.prototype,"sensorName",void 0),be=(0,i._)([(0,c.j)("esri.rest.support.BaseImageMeasureResult")],be);let we=class extends be{constructor(){super(...arguments),this.area=null,this.perimeter=null}};(0,i._)([(0,u.Cb)({type:fe,json:{read:!0,write:!0}})],we.prototype,"area",void 0),(0,i._)([(0,u.Cb)({type:ye,json:{read:!0,write:!0}})],we.prototype,"perimeter",void 0),we=(0,i._)([(0,c.j)("esri.rest.support.ImageAreaResult")],we);const ve=we;let Re=class extends be{constructor(){super(...arguments),this.distance=null,this.azimuthAngle=null,this.elevationAngle=null}};(0,i._)([(0,u.Cb)({type:ye,json:{read:!0,write:!0}})],Re.prototype,"distance",void 0),(0,i._)([(0,u.Cb)({type:ge,json:{read:!0,write:!0}})],Re.prototype,"azimuthAngle",void 0),(0,i._)([(0,u.Cb)({type:ge,json:{read:!0,write:!0}})],Re.prototype,"elevationAngle",void 0),Re=(0,i._)([(0,c.j)("esri.rest.support.ImageDistanceResult")],Re);const _e=Re;let Se=class extends be{constructor(){super(...arguments),this.height=null}};(0,i._)([(0,u.Cb)({type:ye,json:{read:!0,write:!0}})],Se.prototype,"height",void 0),Se=(0,i._)([(0,c.j)("esri.rest.support.ImageHeightResult")],Se);const Fe=Se;var Ce=r(94139),xe=r(74889);let Ie=class extends I.wq{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};(0,i._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"catalogItemVisibilities",void 0),(0,i._)([(0,u.Cb)({type:xe.Z,json:{write:!0}})],Ie.prototype,"catalogItems",void 0),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{write:!0}})],Ie.prototype,"location",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"name",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"objectId",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"processedValues",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"properties",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Ie.prototype,"value",void 0),Ie=(0,i._)([(0,c.j)("esri.rest.support.ImageIdentifyResult")],Ie);const Te=Ie;let Ne=class extends I.wq{constructor(){super(...arguments),this.geometries=null}};(0,i._)([(0,u.Cb)({json:{write:!0}})],Ne.prototype,"geometries",void 0),Ne=(0,i._)([(0,c.j)("esri.rest.support.ImagePixelLocationResult")],Ne);const De=Ne;let je=class extends be{constructor(){super(...arguments),this.point=null}};(0,i._)([(0,u.Cb)({type:Ce.Z,json:{name:"point.value",read:!0,write:!0}})],je.prototype,"point",void 0),je=(0,i._)([(0,c.j)("esri.rest.support.ImagePointResult")],je);const Pe=je;let Oe=class extends I.wq{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};(0,i._)([(0,u.Cb)({json:{write:!0}})],Oe.prototype,"attributes",void 0),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{write:!0}})],Oe.prototype,"location",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Oe.prototype,"locationId",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Oe.prototype,"rasterId",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Oe.prototype,"resolution",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],Oe.prototype,"pixelValue",void 0),Oe=(0,i._)([(0,c.j)("esri.rest.support.ImageSample")],Oe);const Ze=Oe;let Me=class extends I.wq{constructor(){super(...arguments),this.samples=null}};(0,i._)([(0,u.Cb)({type:[Ze],json:{write:!0}})],Me.prototype,"samples",void 0),Me=(0,i._)([(0,c.j)("esri.rest.support.ImageSampleResult")],Me);const Ae=Me;function Ve(e){const t=e?.time;if(t&&(null!=t.start||null!=t.end)){const r=[];null!=t.start&&r.push(t.start),null==t.end||r.includes(t.end)||r.push(t.end),e.time=r.join(",")}}async function Je(e,t,r){const i=(0,ue.en)(e),n=t.geometry?[t.geometry]:[],s=await(0,le.aX)(n),o=t.toJSON();Ve(o);const a=s?.[0];null!=a&&(o.geometry=a.toJSON());const l=(0,ue.cv)({...i.query,f:"json",...o});return(0,ue.lA)(l,r)}async function Ee(e,t,r){const i=(0,ue.en)(e),n=t.geometry?[t.geometry]:[];return(0,le.aX)(n).then((e=>{const n=t.toJSON(),s=e?.[0];null!=s&&(n.geometry=JSON.stringify(s.toJSON()));const o=(0,ue.cv)({...i.query,f:"json",...n}),a=(0,ue.lA)(o,r);return(0,g.Z)(i.path+"/identify",a)})).then((e=>Te.fromJSON(e.data)))}async function qe(e,t,r,i){const n=(0,ue.en)(e),s=await(0,le.aX)(r),o=t.toJSON();null!=s[0]&&(o.fromGeometry=JSON.stringify(Ge(s[0]))),null!=s[1]&&(o.toGeometry=JSON.stringify(Ge(s[1])));const a=(0,ue.cv)({...n.query,f:"json",...o}),l=(0,ue.lA)(a,i),{data:u}=await(0,g.Z)(n.path+"/measure",l);return u}function Ge(e){const t=e.toJSON();return e.spatialReference?.imageCoordinateSystem&&(t.spatialReference=ze(e.spatialReference)),t}function ze(e){const{imageCoordinateSystem:t}=e;if(t){const{id:e,referenceServiceName:r}=t;return null!=e?r?{icsid:e,icsns:r}:{icsid:e}:{ics:t}}return e.toJSON()}function Le(e,t){if(!e.imageCoordinateSystem)return(0,F.B9)(e);const r=ze(e),{icsid:i,icsns:n}=r;return null==i||null!=n&&!t?.toLowerCase().includes("/"+n.toLowerCase()+"/")?JSON.stringify(r):`0:${i}`}r(10158);var Be,He=r(4967),Ue=(r(68773),r(40330),r(2109),r(98732),r(6570)),ke=(r(9361),r(65091)),Qe=r(38913),$e=(r(58901),r(45091),r(14165)),We=(r(98326),r(56545),r(41818)),Xe=r(5396),Ye=(r(75935),r(28141),r(26059)),Ke=r(36679);let et=Be=class extends I.wq{constructor(e){super(e),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Be((0,w.d9)({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};(0,i._)([(0,u.Cb)({type:[String],json:{name:"angleName",write:!0}})],et.prototype,"angleNames",void 0),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{write:!0}})],et.prototype,"point",void 0),(0,i._)([(0,u.Cb)({type:pe.Z,json:{write:!0}})],et.prototype,"spatialReference",void 0),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],et.prototype,"rasterId",void 0),et=Be=(0,i._)([(0,c.j)("esri.rest.support.ImageAngleParameters")],et);const tt=et;var rt=r(33955);const it=new(r(35454).X)({esriMensurationPoint:"point",esriMensurationCentroid:"centroid",esriMensurationDistanceAndAngle:"distance-and-angle",esriMensurationAreaAndPerimeter:"area-and-perimeter",esriMensurationHeightFromBaseAndTop:"base-and-top",esriMensurationHeightFromBaseAndTopShadow:"base-and-top-shadow",esriMensurationHeightFromTopAndTopShadow:"top-and-top-shadow",esriMensurationPoint3D:"point-3D",esriMensurationCentroid3D:"centroid-3D",esriMensurationDistanceAndAngle3D:"distance-and-angle-3D",esriMensurationAreaAndPerimeter3D:"area-and-perimeter-3D"});let nt=class extends I.wq{constructor(){super(...arguments),this.type=null,this.measureOperation=null,this.mosaicRule=null,this.pixelSize=null,this.raster=void 0}};var st;(0,i._)([(0,u.Cb)()],nt.prototype,"type",void 0),(0,i._)([(0,u.Cb)({type:it.apiValues,json:{read:it.read,write:it.write}})],nt.prototype,"measureOperation",void 0),(0,i._)([(0,u.Cb)({type:k.Z,json:{write:!0}})],nt.prototype,"mosaicRule",void 0),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{write:!0}})],nt.prototype,"pixelSize",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],nt.prototype,"raster",void 0),nt=(0,i._)([(0,c.j)("esri.rest.support.BaseImageMeasureParameters")],nt);let ot=st=class extends nt{constructor(){super(...arguments),this.type="area-perimeter",this.geometry=null,this.is3D=!1,this.linearUnit="meters",this.areaUnit="square-meters"}writeGeometry(e,t,r){null!=e&&(t.geometryType=(0,rt.Ji)(e),t[r]=e.toJSON())}get measureOperation(){return this.is3D?"area-and-perimeter-3D":"area-and-perimeter"}clone(){return new st((0,w.d9)({geometry:this.geometry,is3D:this.is3D,linearUnit:this.linearUnit,areaUnit:this.areaUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};(0,i._)([(0,u.Cb)({types:h.qM,json:{name:"fromGeometry",read:!0,write:!0}})],ot.prototype,"geometry",void 0),(0,i._)([(0,d.c)("geometry")],ot.prototype,"writeGeometry",null),(0,i._)([(0,u.Cb)({type:it.apiValues,json:{write:it.write}})],ot.prototype,"measureOperation",null),(0,i._)([(0,u.Cb)({json:{read:!0}})],ot.prototype,"is3D",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:me.Jo.read,write:me.Jo.write}})],ot.prototype,"linearUnit",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:me.gV.read,write:me.gV.write}})],ot.prototype,"areaUnit",void 0),ot=st=(0,i._)([(0,c.j)("esri.rest.support.ImageAreaParameters")],ot);const at=ot;var lt;let ut=lt=class extends nt{constructor(){super(...arguments),this.type="distance-angle",this.fromGeometry=null,this.toGeometry=null,this.is3D=!1,this.linearUnit="meters",this.angularUnit="degrees"}writeFromGeometry(e,t,r){null!=e&&(t.geometryType=(0,rt.Ji)(e),t[r]=e.toJSON())}get measureOperation(){return this.is3D?"distance-and-angle-3D":"distance-and-angle"}clone(){return new lt((0,w.d9)({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,is3D:this.is3D,linearUnit:this.linearUnit,angularUnit:this.angularUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};(0,i._)([(0,u.Cb)({type:Ce.Z,json:{read:!0,write:!0}})],ut.prototype,"fromGeometry",void 0),(0,i._)([(0,d.c)("fromGeometry")],ut.prototype,"writeFromGeometry",null),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{read:!0,write:!0}})],ut.prototype,"toGeometry",void 0),(0,i._)([(0,u.Cb)({type:it.apiValues,json:{write:it.write}})],ut.prototype,"measureOperation",null),(0,i._)([(0,u.Cb)({json:{read:!0}})],ut.prototype,"is3D",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:me.Jo.read,write:me.Jo.write}})],ut.prototype,"linearUnit",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:me.CN.read,write:me.CN.write}})],ut.prototype,"angularUnit",void 0),ut=lt=(0,i._)([(0,c.j)("esri.rest.support.ImageDistanceParameters")],ut);const pt=ut;var ct;let dt=ct=class extends nt{constructor(){super(...arguments),this.type="height",this.fromGeometry=null,this.toGeometry=null,this.operationType="base-and-top",this.linearUnit="meters"}writeFromGeometry(e,t,r){null!=e&&(t.geometryType=(0,rt.Ji)(e),t[r]=e.toJSON())}get measureOperation(){return this.operationType}clone(){return new ct((0,w.d9)({fromGeometry:this.fromGeometry,toGeometry:this.toGeometry,operationType:this.operationType,linearUnit:this.linearUnit,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};(0,i._)([(0,u.Cb)({type:Ce.Z,json:{read:!0}})],dt.prototype,"fromGeometry",void 0),(0,i._)([(0,d.c)("fromGeometry")],dt.prototype,"writeFromGeometry",null),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{read:!0,write:!0}})],dt.prototype,"toGeometry",void 0),(0,i._)([(0,u.Cb)({type:it.apiValues,json:{write:it.write}})],dt.prototype,"measureOperation",null),(0,i._)([(0,u.Cb)({json:{read:!0}})],dt.prototype,"operationType",void 0),(0,i._)([(0,u.Cb)({type:String,json:{read:me.Jo.read,write:me.Jo.write}})],dt.prototype,"linearUnit",void 0),dt=ct=(0,i._)([(0,c.j)("esri.rest.support.ImageHeightParameters")],dt);const mt=dt;var ht,yt=r(79681),ft=r(92835);let gt=ht=class extends I.wq{constructor(){super(...arguments),this.geometry=null,this.rasterFunctions=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(e,t,r){null!=e&&(t.geometryType=(0,rt.Ji)(e),t[r]=JSON.stringify(e.toJSON()))}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=k.Z.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}writeMosaicRule(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON()))}get renderingRule(){return(0,b.Mr)(v.Z.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._get("rasterFunction")}set renderingRule(e){(0,b.Mr)(v.Z.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}get renderingRules(){return(0,b.Mr)(v.Z.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._get("rasterFunctions")}set renderingRules(e){(0,b.Mr)(v.Z.getLogger(this),"renderingRules",{replacement:"rasterFunctions",version:"4.27",warnOnce:!0}),this._set("rasterFunctions",e)}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=T.Z.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}writeRasterFunction(e,t,r){null!=e&&(t[r]=JSON.stringify(e.toJSON())),e.rasterFunctionDefinition&&(t[r]=JSON.stringify(e.rasterFunctionDefinition))}writeRasterFunctions(e,t,r){null!=e&&(t[r]=JSON.stringify(e.map((e=>e.rasterFunctionDefinition||e.toJSON()))))}writePixelSize(e,t,r){null!=e&&(t[r]=JSON.stringify(e))}writeTimeExtent(e,t,r){if(null!=e){const i=null!=e.start?e.start.getTime():null,n=null!=e.end?e.end.getTime():null;t[r]=null!=i?null!=n?`${i},${n}`:`${i}`:null}}clone(){return new ht((0,w.d9)({geometry:this.geometry,mosaicRule:this.mosaicRule,rasterFunction:this.rasterFunction,rasterFunctions:this.rasterFunctions,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};(0,i._)([(0,u.Cb)({json:{write:!0}})],gt.prototype,"geometry",void 0),(0,i._)([(0,d.c)("geometry")],gt.prototype,"writeGeometry",null),(0,i._)([(0,u.Cb)({type:k.Z,json:{write:!0}})],gt.prototype,"mosaicRule",null),(0,i._)([(0,d.c)("mosaicRule")],gt.prototype,"writeMosaicRule",null),(0,i._)([(0,u.Cb)({type:T.Z})],gt.prototype,"renderingRule",null),(0,i._)([(0,u.Cb)({type:[T.Z]})],gt.prototype,"renderingRules",null),(0,i._)([(0,u.Cb)({type:T.Z,json:{write:!0,name:"renderingRule"}})],gt.prototype,"rasterFunction",null),(0,i._)([(0,d.c)("rasterFunction")],gt.prototype,"writeRasterFunction",null),(0,i._)([(0,u.Cb)({type:[T.Z],json:{write:!0,name:"renderingRules"}})],gt.prototype,"rasterFunctions",void 0),(0,i._)([(0,d.c)("rasterFunctions")],gt.prototype,"writeRasterFunctions",null),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{write:!0}})],gt.prototype,"pixelSize",void 0),(0,i._)([(0,d.c)("pixelSize")],gt.prototype,"writePixelSize",null),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],gt.prototype,"returnGeometry",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],gt.prototype,"returnCatalogItems",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],gt.prototype,"returnPixelValues",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],gt.prototype,"maxItemCount",void 0),(0,i._)([(0,u.Cb)({type:ft.Z,json:{write:{target:"time"}}})],gt.prototype,"timeExtent",void 0),(0,i._)([(0,d.c)("timeExtent")],gt.prototype,"writeTimeExtent",null),(0,i._)([(0,u.Cb)({json:{write:!0}})],gt.prototype,"raster",void 0),(0,i._)([(0,u.Cb)({json:{write:!0}})],gt.prototype,"viewId",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],gt.prototype,"processAsMultidimensional",void 0),gt=ht=(0,i._)([(0,c.j)("esri.rest.support.ImageIdentifyParameters")],gt);const bt=gt;var wt;let vt=wt=class extends I.wq{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(e,t,r){t.geometries={geometryType:"esriGeometryPoint",geometries:e.map((e=>e.toJSON()))}}clone(){return new wt({geometries:this.geometries?.map((e=>e.clone()))??[],rasterId:this.rasterId})}};(0,i._)([(0,u.Cb)({type:[Ce.Z],json:{write:!0}})],vt.prototype,"geometries",void 0),(0,i._)([(0,d.c)("geometries")],vt.prototype,"writeGeometry",null),(0,i._)([(0,u.Cb)({type:p.z8,json:{write:!0}})],vt.prototype,"rasterId",void 0),vt=wt=(0,i._)([(0,c.j)("esri.rest.support.ImagePixelLocationParameters")],vt);const Rt=vt;var _t;let St=_t=class extends nt{constructor(){super(...arguments),this.type="point",this.geometry=null,this.is3D=!1}writeGeometry(e,t,r){null!=e&&(t.geometryType=(0,rt.Ji)(e),t[r]=e.toJSON())}get measureOperation(){const{is3D:e,geometry:t}=this;return"point"===t.type?e?"point-3D":"point":e?"centroid-3D":"centroid"}clone(){return new _t((0,w.d9)({geometry:this.geometry,is3D:this.is3D,mosaicRule:this.mosaicRule,pixelSize:this.pixelSize,raster:this.raster}))}};(0,i._)([(0,u.Cb)({types:h.qM,json:{name:"fromGeometry",read:rt.im}})],St.prototype,"geometry",void 0),(0,i._)([(0,d.c)("geometry")],St.prototype,"writeGeometry",null),(0,i._)([(0,u.Cb)({type:it.apiValues,json:{read:it.read,write:it.write}})],St.prototype,"measureOperation",null),(0,i._)([(0,u.Cb)({json:{read:!0}})],St.prototype,"is3D",void 0),St=_t=(0,i._)([(0,c.j)("esri.rest.support.ImagePointParameters")],St);const Ft=St;var Ct;let xt=Ct=class extends I.wq{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(e,t,r){null!=e&&(t.geometryType=(0,rt.Ji)(e),t[r]=e.toJSON())}set locations(e){if(e?.length){const t=new ke.Z({spatialReference:e[0].spatialReference});t.points=e.map((e=>[e.x,e.y])),this._set("locations",e),this.geometry=t}}clone(){return new Ct((0,w.d9)({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};(0,i._)([(0,u.Cb)({types:h.qM,json:{read:rt.im}})],xt.prototype,"geometry",void 0),(0,i._)([(0,d.c)("geometry")],xt.prototype,"writeGeometry",null),(0,i._)([(0,u.Cb)()],xt.prototype,"locations",null),(0,i._)([(0,u.Cb)({type:String,json:{type:Q.cl.jsonValues,read:Q.cl.read,write:Q.cl.write}})],xt.prototype,"interpolation",void 0),(0,i._)([(0,u.Cb)({type:k.Z,json:{write:!0}})],xt.prototype,"mosaicRule",void 0),(0,i._)([(0,u.Cb)({type:[String],json:{write:!0}})],xt.prototype,"outFields",void 0),(0,i._)([(0,u.Cb)({type:Ce.Z,json:{write:!0}})],xt.prototype,"pixelSize",void 0),(0,i._)([(0,u.Cb)({type:String,json:{write:!0}})],xt.prototype,"raster",void 0),(0,i._)([(0,u.Cb)({type:Boolean,json:{write:!0}})],xt.prototype,"returnFirstValueOnly",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],xt.prototype,"sampleDistance",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],xt.prototype,"sampleCount",void 0),(0,i._)([(0,u.Cb)({type:Number,json:{write:!0}})],xt.prototype,"sliceId",void 0),(0,i._)([(0,u.Cb)({type:ft.Z,json:{read:{source:"time"},write:{target:"time"}}})],xt.prototype,"timeExtent",void 0),xt=Ct=(0,i._)([(0,c.j)("esri.rest.support.ImageSampleParameters")],xt);const It=xt;var Tt=r(23808);const Nt=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),Dt=(0,u.Eg)(p.q9,{min:0,max:255}),jt=e=>{let t=class extends e{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new $({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.length<1||null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.forEach((t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,"_"),t.name)})),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every((e=>"number"==typeof e)))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,r){null!=e&&"lerc"!==this.format&&(t[r]=e)}writeCompressionTolerance(e,t,r){"lerc"===this.format&&null!=e&&(t[r]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?k.Z.fromJSON(t):null}get fieldsIndex(){return this.fields?new X.Z(this.fields):null}set format(e){e&&Nt.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return"esriImageServiceDataTypeVector-UV"===t.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===t.serviceDataType||null!=this.pixelFilter?"lerc":"jpgpng"}readMinScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}readMaxScale(e,t){return null!=t.minLOD&&null!=t.maxLOD?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=k.Z.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const r=e||t.mosaicRule;return r?k.Z.fromJSON(r):this._isMosaicRuleSupported(t)?k.Z.fromJSON(t):null}writeMosaicRule(e,t,r){let i=this.mosaicRule;const n=this.definitionExpression;i?n&&n!==i.where&&(i=i.clone(),i.where=n):n&&(i=new k.Z({where:n})),this._isValidCustomizedMosaicRule(i)&&(t[r]=i.toJSON())}writeNoData(e,t,r){null!=e&&"number"==typeof e&&(t[r]=Dt(e))}readObjectIdField(e,t){if(!e){const r=t.fields.find((e=>"esriFieldTypeOID"===e.type||"oid"===e.type));e=r?.name}return e}get parsedUrl(){return(0,_.mN)(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer,n=(0,f.ij)(i,r);return null==n?null:("vector-field"===n.type&&t.symbolTileSize&&!i.symbolTileSize&&(n.symbolTileSize=t.symbolTileSize),V(n)||v.Z.getLogger(this).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),n)}writeRenderer(e,t,r){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),"vector-field"===e.type&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){const e=this._rasterAttributeTableFieldPrefix,t=new W.Z({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),r=new W.Z({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),i=new W.Z({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let n=this.fields?(0,w.d9)(this.fields):[];n.push(r),this.capabilities?.operations.supportsQuery&&this.fields&&this.fields.length>0&&n.push(t),this.version>=10.4&&null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.some((e=>"none"===e.name.toLowerCase()))&&n.push(i),null!=this.rasterFunctionInfos&&this.rasterFunctionInfos.filter((e=>"none"!==e.name.toLowerCase())).forEach((e=>{n.push(new W.Z({name:"Raster.ServicePixelValue."+e.name,alias:e.name,domain:null,editable:!1,length:50,type:"string"}))})),this._isVectorDataSet()&&(n.push(new W.Z({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),n.push(new W.Z({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:s}=this.rasterInfo??{};if(null!=s){const t=s.fields.filter((e=>"esriFieldTypeOID"!==e.type&&"value"!==e.name.toLowerCase())).map((t=>{const r=(0,w.d9)(t);return r.name=e+t.name,r}));n=n.concat(t)}return n}get renderingRule(){return(0,b.Mr)(v.Z.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this.rasterFunction}set renderingRule(e){(0,b.Mr)(v.Z.getLogger(this),"renderingRule",{replacement:"rasterFunction",version:"4.27",warnOnce:!0}),this._set("rasterFunction",e)}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=T.Z.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("rasterFunction",t)}readRasterFunction(e,t){const r=t.rasterFunctionInfos;return t.renderingRule||r?.length&&"None"!==r[0].name?this._isRFTJson(t.renderingRule)?T.Z.fromJSON({rasterFunctionDefinition:t.renderingRule}):T.Z.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}readSpatialReference(e,t){const r=e||t.extent.spatialReference;return r?pe.Z.fromJSON(r):null}readPixelType(e){return Q.sM.fromJSON(e)||e}writePixelType(e,t,r){null!=this.serviceRasterInfo&&this.pixelType===this.serviceRasterInfo.pixelType||(t[r]=Q.sM.toJSON(e))}readVersion(e,t){let r=t.currentVersion;return r||(r=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),r}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let r=e;const{renderer:i,symbolizer:n,pixelFilter:s,bandIds:o}=this;if(!this._isPicture()&&i&&n&&!s){const s=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(i.toJSON()),a=this._rasterJobHandler.instance;if(a){s&&(n.bind(),await a.updateSymbolizer(n,t),this._cachedRendererJson=i.toJSON());const l=await a.symbolize({bandIds:o,...e},t);r={extent:e.extent,pixelBlock:l}}else r={extent:e.extent,pixelBlock:n.symbolize({bandIds:o,...e})}}return r}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new o.Z("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=(0,p.TJ)(tt,e).clone(),async function(e,t,r){const i=t.toJSON();null!=i.angleName&&(i.angleName=i.angleName.join(",")),t?.point?.spatialReference?.imageCoordinateSystem&&(i.point.spatialReference=ze(t.point.spatialReference)),t?.spatialReference?.imageCoordinateSystem&&(i.spatialReference=Le(t.spatialReference));const n=(0,ue.en)(e),s=(0,ue.cv)({...n.query,f:"json",...i}),o=(0,ue.lA)(s,r),{data:a}=await(0,g.Z)(`${n.path}/computeAngles`,o);return a.spatialReference=a.spatialReference?null!=a.spatialReference.geodataXform?new pe.Z({wkid:0,imageCoordinateSystem:a.spatialReference}):pe.Z.fromJSON(a.spatialReference):null,"NaN"===a.north&&(a.north=null),"NaN"===a.up&&(a.up=null),new de(a)}(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new o.Z("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=(0,p.TJ)(Rt,e).clone(),async function(e,t,r){const i=t.toJSON(),{geometries:n}=t;if(n)for(let e=0;e<n.length;e++)n[e].spatialReference?.imageCoordinateSystem&&(i.geometries.geometries[e].spatialReference=ze(n[e].spatialReference));const s=(0,ue.en)(e),o=(0,ue.cv)({...s.query,f:"json",...i}),a=(0,ue.lA)(o,r),{data:l}=await(0,g.Z)(`${s.path}/computePixelLocation`,a);return De.fromJSON(l)}(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new o.Z("imagery-layer:compute-histograms","this operation is not supported on the input image service");return e=(0,p.TJ)(yt.Z,e).clone(),this._applyMosaicAndRenderingRules(e),async function(e,t,r){const i=await Je(e,t,r),n=(0,ue.en)(e),{data:s}=await(0,g.Z)(`${n.path}/computeHistograms`,i);return{histograms:s.histograms}}(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new o.Z("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");return e=(0,p.TJ)(yt.Z,e).clone(),this._applyMosaicAndRenderingRules(e),async function(e,t,r){const i=await Je(e,t,r),n=(0,ue.en)(e),{data:s}=await(0,g.Z)(`${n.path}/computeStatisticsHistograms`,i),{statistics:o}=s;return o?.length&&o.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:o,histograms:s.histograms}}(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){const r=await this._fetchCapabilities(t?.signal);if(!("base-and-top"===e.operationType?r.mensuration.supportsHeightFromBaseAndTop:"base-and-top-shadow"===e.operationType?r.mensuration.supportsHeightFromBaseAndTopShadow:r.mensuration.supportsHeightFromTopAndTopShadow))throw new o.Z("imagery-layer:measure-height","this operation is not supported on the input image service");return e=(0,p.TJ)(mt,e).clone(),this._applyMosaicAndRenderingRules(e),async function(e,t,r){const i=await qe(e,t,[t.fromGeometry,t.toGeometry],r);return Fe.fromJSON(i)}(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){const r=await this._fetchCapabilities(t?.signal);if(!r.mensuration.supportsAreaAndPerimeter||e.is3D&&!r.mensuration.supports3D)throw new o.Z("imagery-layer:measure-area-and-perimeter","this operation is not supported on the input image service");return e=(0,p.TJ)(at,e).clone(),this._applyMosaicAndRenderingRules(e),async function(e,t,r){const i=await qe(e,t,[t.geometry],r);return ve.fromJSON(i)}(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){const r=await this._fetchCapabilities(t?.signal);if(!r.mensuration.supportsDistanceAndAngle||e.is3D&&!r.mensuration.supports3D)throw new o.Z("imagery-layer:measure-distance-and-angle","this operation is not supported on the input image service");return e=(0,p.TJ)(pt,e).clone(),this._applyMosaicAndRenderingRules(e),async function(e,t,r){const i=await qe(e,t,[t.fromGeometry,t.toGeometry],r);return _e.fromJSON(i)}(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){const r=await this._fetchCapabilities(t?.signal);if(!r.mensuration.supportsPointOrCentroid||e.is3D&&!r.mensuration.supports3D)throw new o.Z("imagery-layer:measure-point-or-centroid","this operation is not supported on the input image service");return e=(0,p.TJ)(Ft,e).clone(),this._applyMosaicAndRenderingRules(e),async function(e,t,r){const i=await qe(e,t,[t.geometry],r);return Pe.fromJSON(i)}(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return null!=t?t.get(e):void 0}getFieldDomain(e,t){const r=this.getField(e);return r?r.domain:null}async fetchImage(e,t,i,n={}){if(null==e||null==t||null==i)throw new o.Z("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const e=await this._generateRasterInfo(this.rasterFunction,{signal:n.signal});e&&(this.rasterInfo=e)}const s=this.getExportImageServiceParameters(e,t,i,n.timeExtent);if(null==s){if(n.requestAsImageElement&&this._canRequestImageElement(this.format)){const e=document.createElement("canvas");return e.width=t,e.height=i,n.returnImageBitmap?{imageBitmap:await(0,Y.g)(e,`${r(this.parsedUrl)}/exportImage`,n.signal)}:{imageOrCanvasElement:e}}const{bandIds:s,rasterInfo:o}=this,a=(s?.length||o.bandCount)??0,l=t*i,u=o.pixelType,p=[];for(let e=0;e<a;e++)p.push(ee.Z.createEmptyBand(u,l));return{pixelData:{pixelBlock:new ee.Z({width:t,height:i,pixels:p,mask:new Uint8Array(l),pixelType:u}),extent:e}}}const a=!!n.requestAsImageElement&&!this.pixelFilter,l=a&&!!n.returnImageBitmap,u={imageServiceParameters:s,imageProps:{extent:e,width:t,height:i,format:this.format},requestAsImageElement:a,returnImageBitmap:l,signal:n.signal};return this._requestArrayBuffer(u)}fetchKeyProperties(e){return(0,g.Z)(r(this.parsedUrl)+"/keyProperties",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then((e=>e.data))}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new o.Z("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):(0,g.Z)(r(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then((e=>xe.Z.fromJSON(e.data)))}getCatalogItemRasterInfo(e,t){const i={...t,query:this._getQueryParams()};return async function(e,t,r){const i=(0,ue.en)(e),n=(0,ue.cv)({...i?.query,f:"json"}),s=(0,ue.lA)(n,r),o=`${i?.path}/${t}/info`,a=(0,g.Z)(`${o}`,s),l=(0,g.Z)(`${o}/keyProperties`,s),u=await Promise.allSettled([a,l]),p="fulfilled"===u[0].status?u[0].value.data:null,c="fulfilled"===u[1].status?u[1].value.data:null;let d=null;p.statistics?.length&&(d=p.statistics.map((e=>({min:e[0],max:e[1],avg:e[2],stddev:e[3]}))));const m=Ue.Z.fromJSON(p.extent),h=Math.ceil(m.width/p.pixelSizeX-.1),y=Math.ceil(m.height/p.pixelSizeY-.1),f=m.spatialReference,b=new Ce.Z({x:p.pixelSizeX,y:p.pixelSizeY,spatialReference:f}),w=p.histograms?.length?p.histograms:null,v=new Ke.Z({origin:p.origin,blockWidth:p.blockWidth,blockHeight:p.blockHeight,firstPyramidLevel:p.firstPyramidLevel,maximumPyramidLevel:p.maxPyramidLevel});return new te.Z({width:h,height:y,bandCount:p.bandCount,extent:m,spatialReference:f,pixelSize:b,pixelType:p.pixelType.toLowerCase(),statistics:d,histograms:w,keyProperties:c,storageInfo:v})}(r(this.parsedUrl),e,i)}async getCatalogItemICSInfo(e,t){const{data:i}=await(0,g.Z)(r(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),n=i?.ics;if(!n)return;let s=null;try{s=(await(0,g.Z)(r(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!s||!s.spatialReference)return{ics:n,icsToPixelTransform:null,icsExtent:null,northDirection:null};const o=this.version>=10.7?(0,g.Z)(r(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then((e=>e.data)).catch((()=>({}))):{},a=s.spatialReference,l={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[s]}),inSR:(0,F.B9)(a),outSR:"0:"+e},u=(0,g.Z)(r(this.parsedUrl)+"/project",{query:this._getQueryParams(l),...t}).then((e=>e.data)).catch((()=>({}))),p=(s.xmin+s.xmax)/2,c=(s.ymax-s.ymin)/6,d=s.ymin+c,m=[];for(let e=0;e<5;e++)m.push({x:p,y:d+c*e});const h={geometries:JSON.stringify({geometryType:"esriGeometryPoint",geometries:m}),inSR:(0,F.B9)(a),outSR:"0:"+e},y=(0,g.Z)(r(this.parsedUrl)+"/project",{query:this._getQueryParams(h),...t}).then((e=>e.data)).catch((()=>({}))),f=await Promise.all([o,u,y]);let b=f[0].ipxf;if(null==b){const e=n.geodataXform?.xf_0;"topup"===e?.name?.toLowerCase()&&6===e?.coefficients?.length&&(b={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:e.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const w=Ue.Z.fromJSON(f[1]?.geometries?.[0]);w&&(w.spatialReference=new pe.Z({wkid:0,imageCoordinateSystem:n}));const v=f[2].geometries?f[2].geometries.filter((e=>null!=e?.x&&null!=e.y&&"NaN"!==e.x&&"NaN"!==e.y)):[],R=v.length;if(R<3)return{ics:n,icsToPixelTransform:b,icsExtent:w,northDirection:null};let _=0,S=0,C=0,x=0;for(let e=0;e<R;e++)_+=v[e].x,S+=v[e].y,C+=v[e].x*v[e].x,x+=v[e].x*v[e].y;const I=(R*x-_*S)/(R*C-_*_);let T=0;const N=v[4].x>v[0].x,D=v[4].y>v[0].y;return I===1/0?T=D?90:270:0===I?T=N?0:180:I>0?T=N?180*Math.atan(I)/Math.PI:180*Math.atan(I)/Math.PI+180:I<0&&(T=D?180+180*Math.atan(I)/Math.PI:360+180*Math.atan(I)/Math.PI),{ics:n,icsToPixelTransform:b,icsExtent:w,northDirection:T}}async generateRasterInfo(e,t){if(e=(0,p.TJ)(T.Z,e),this.serviceRasterInfo&&(!e||"none"===e.functionName?.toLowerCase()||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const i=function(e){if(!e)return null;const t=JSON.stringify(e).match(/"rasterFunction":"(.*?")/gi),r=t?.map((e=>e.replace('"rasterFunction":"',"").replace('"',"")));return r?r.join("/"):null}(e);if(!i)throw new o.Z("imagery-layer:generate-raster-info","the rendering rule is not supported");if(this._functionRasterInfos[i])return this._functionRasterInfos[i];const n={...t,query:this._getQueryParams()},s=(0,Ye.Nb)(r(this.parsedUrl),e,n);this._functionRasterInfos[i]=s;try{return await s}catch(e){throw this._functionRasterInfos[i]=null,e}}getExportImageServiceParameters(e,t,i,n){const s=Le((e=e.clone().shiftCentralMeridian()).spatialReference,r(this.parsedUrl));this.pixelType!==this.serviceRasterInfo.pixelType&&(this.exportImageServiceParameters.pixelType=this.pixelType);const o=this.exportImageServiceParameters.toJSON(),{bandIds:a,noData:l}=o;let{renderingRule:u}=o;const p=this.rasterFunction?.rasterFunctionDefinition,c=!this.renderer||"raster-stretch"===this.renderer.type;if(a?.length&&this._hasRasterFunction(this.rasterFunction)&&!p&&c){const e={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:a}};if("Stretch"===u.rasterFunction)e.rasterFunctionArguments.Raster=u.rasterFunctionArguments.Raster,u.rasterFunctionArguments.Raster=e;else if("Colormap"===u.rasterFunction){const t=u.rasterFunctionArguments.Raster;"Stretch"===t?.rasterFunction?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,u.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=u,u=e;o.bandIds=void 0}else o.bandIds=a?.join(",");l instanceof Array&&l.length>0&&(o.noData=l.join(","));const d=this._processMultidimensionalIntersection(null,n,this.exportImageServiceParameters.mosaicRule);if(d.isOutSide)return null;o.mosaicRule=null!=d.mosaicRule?JSON.stringify(d.mosaicRule):null,n=d.timeExtent,o.renderingRule=this._getRenderingRuleString(T.Z.fromJSON(u));const m={};if(null!=n){const{start:e,end:t}=n.toJSON();e&&t&&e===t?m.time=""+e:null==e&&null==t||(m.time=`${e??"null"},${t??"null"}`)}return{bbox:e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:s,imageSR:s,size:t+","+i,...o,...m}}async getSamples(e,t){const r=await this._fetchCapabilities(t?.signal);if(!r?.operations.supportsGetSamples)throw new o.Z("imagery-layer:get-samples","getSamples operation is not supported on the input image service");e=(0,p.TJ)(It,e).clone();const{raster:i}=this;return i&&null==e.raster&&(e.raster=i),async function(e,t,r){const i=t.toJSON();Ve(i),i.outFields?.length&&(i.outFields=i.outFields.join(","));const n=await(0,le.aX)(t.geometry),s=n?.[0];null!=s&&(i.geometry=s.toJSON());const o=(0,ue.en)(e),a=(0,ue.cv)({...o.query,f:"json",...i}),l=(0,ue.lA)(a,r),{data:u}=await(0,g.Z)(`${o.path}/getSamples`,l),p=u?.samples?.map((e=>{const t="NaN"===e.value||""===e.value?null:e.value.split(" ").map((e=>Number(e)));return{...e,pixelValue:t}}));return Ae.fromJSON({samples:p})}(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new o.Z("imagery-layer:identify","identify operation is not supported on the input image service");e=(0,p.TJ)(bt,e).clone(),this.version<10.91&&"extent"===e.geometry?.type&&(e.geometry=Qe.Z.fromExtent(e.geometry));const r=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(r.isOutSide)throw new o.Z("imagery-layer:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");e.timeExtent=r.timeExtent,e.mosaicRule=r.mosaicRule;const{raster:i,rasterFunction:n}=this;return n&&null==e.rasterFunction&&(e.rasterFunction=n),i&&null==e.raster&&(e.raster=i),Ee(this.url,e,this._getRequestOptions(t))}createQuery(){const e=new $e.Z;return e.outFields=["*"],e.returnGeometry=!0,e.where=this.definitionExpression||"1=1",e}async queryRasters(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,He.e)(this.url,e,t)}async queryObjectIds(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,Xe.G)(this.url,e,t)}async queryRasterCount(e,t){return({query:e,requestOptions:t}=await this._prepareForQuery(e,t)),(0,We.P)(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new o.Z("imagery-layer: query-visible-rasters","missing query parameter");await this.load();const{pixelSize:r,returnDomainValues:i,returnTopmostRaster:n,showNoDataRecords:s}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1};let a=!1,l=null,u=null;const p="raster.servicepixelvalue",c=this._rasterFunctionNamesIndex;if(null!=e.outFields&&(a=e.outFields.some((e=>!e.toLowerCase().includes(p))),this.version>=10.4)){const t=e.outFields.filter((e=>e.toLowerCase().includes(p)&&e.length>24)).map((e=>{const t=e.slice(25);return[this._updateRenderingRulesFunctionName(t,c),t]}));l=t.map((e=>new T.Z({functionName:e[0]}))),u=t.map((e=>e[1]));const{rasterFunction:r}=this;0===l.length?r?.functionName?(l.push(r),u.push(r.functionName)):l=null:r?.functionName&&!l.some((e=>e.functionName===r.functionName))&&(l.push(r),u.push(r.functionName))}const d=null==e.outSpatialReference||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:m}=this;let h=e.timeExtent||this.timeExtent;if(m){const{isOutside:t,intersection:r}=(0,ie.W2)(m,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new o.Z("imagery-layer:query-visible-rasters","the request cannot be fulfilled when falling outside of the multidimensional subset");null!=r?.timeExtent&&(h=r.timeExtent)}const y=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,h);let f=e.geometry;this.version<10.91&&"extent"===f?.type&&(f=Qe.Z.fromExtent(f));const g=this._getQueryParams({geometry:f,timeExtent:h,mosaicRule:y,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:l,pixelSize:r,returnCatalogItems:a,returnGeometry:d,raster:this.raster,maxItemCount:n?1:null});delete g.f;const b=new bt(g);try{await this._generateRasterInfo(this.rasterFunction);const r=await Ee(this.url,b,{signal:t?.signal,query:{...this.customParameters}}),n=e.outFields,o=null!=r.value&&r.value.toLowerCase().includes("nodata");if(!a||d||!r?.catalogItems?.features.length||!s&&o)return this._processVisibleRastersResponse(r,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:s,templateFields:n});const l=this.objectIdField||"ObjectId",p=r.catalogItems?.features??[],c=p.map((e=>e.attributes?.[l])),m=new $e.Z({objectIds:c,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[l]}),h=await this.queryRasters(m);return h?.features?.length&&h.features.forEach((t=>{p.forEach((r=>{r.attributes[l]===t.attributes[l]&&(r.geometry=new Qe.Z(t.geometry),null!=e.outSpatialReference&&(r.geometry.spatialReference=e.outSpatialReference))}))})),this._processVisibleRastersResponse(r,{returnDomainValues:i,templateRRFunctionNames:u,showNoDataRecords:s,templateFields:n})}catch{throw new o.Z("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const i=(0,g.Z)(r(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.statistics)),n=(0,g.Z)(r(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then((e=>e.data?.histograms)),s=await Promise.all([i,n]);return s[0]&&s[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:s[0]||null,histograms:s[1]||null}}async createFlowMesh(e,t){const r=this._rasterJobHandler.instance;return r?r.createFlowMesh(e,t):(0,Tt.GE)(e.meshType,e.simulationSettings,e.flowData,null!=t.signal?t.signal:(new AbortController).signal)}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo.multidimensionalInfo;return(0,ie.jj)(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,i=null!=this.serviceRasterInfo?Promise.resolve(this.serviceRasterInfo):(0,Ye.gh)(r(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then((e=>(this._set("serviceRasterInfo",e),this._set("multidimensionalInfo",e.multidimensionalInfo),(0,Ye.n$)(e,t),e))),n=this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):null,s=this._getRasterFunctionInfos();return Promise.all([i,n,s]).then((e=>{e[1]?this._set("rasterInfo",e[1]):this._set("rasterInfo",e[0]),e[2]&&this._set("rasterFunctionInfos",e[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),v.Z.getLogger(this).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([(0,R.YP)((()=>this.rasterFunction),(e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then((e=>{e&&(this.rasterInfo=e)}))}))]);const{serviceRasterInfo:t}=this;null!=t.multidimensionalInfo&&this._updateMultidimensionalDefinition(t)}))}_combineMosaicRuleWithTimeExtent(e,t){const r=this.timeInfo,{multidimensionalInfo:i}=this.serviceRasterInfo;if(null==e||null==i||null==t||null==r?.startField)return e;const{startField:n}=r,s=i.variables.some((e=>e.dimensions.some((e=>e.name===n))))?n:"StdTime";if(e=e.clone(),"mosaic-dataset"===this.sourceType)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter((e=>e.dimensionName!==s)),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const o=e.multidimensionalDefinition.filter((e=>e.dimensionName===s)),a=null!=t.start?t.start.getTime():null,l=null!=t.end?t.end.getTime():null,u=null==a||null==l||a===l,p=u?[a||l]:[[a,l]],c=this.version>=10.8;if(o.length)o.forEach((e=>{e.dimensionName===s&&(c?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=u,e.values=p))}));else if(!c){const t=e.multidimensionalDefinition.filter((e=>null!=e.variableName&&null==e.dimensionName));t.length?t.forEach((e=>{e.dimensionName=s,e.isSlice=u,e.values=p})):e.multidimensionalDefinition.push(new x.Z({variableName:"",dimensionName:s,isSlice:u,values:p}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return null==e?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter((e=>!(!e.variableName&&!e.dimensionName))),0===e.multidimensionalDefinition.length&&(e.multidimensionalDefinition=null)),"mosaic-dataset"!==this.sourceType&&null==e.multidimensionalDefinition?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new o.Z("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=null!=e?(0,p.TJ)($e.Z,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(null!=this._rasterJobHandler.connectionPromise)return this._rasterJobHandler.connectionPromise;const e=new re.Z;this._rasterJobHandler.connectionPromise=e.initialize().then((()=>{this._rasterJobHandler.instance=e}),(()=>{})),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,rasterFunction:r}=this;return"unique-value"===e.type&&this._hasRasterFunction(r)&&1===t?.bandCount&&["u8","s8"].includes(t.pixelType)||null!=t&&null!=e&&(0,oe.U0)(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){const{data:i,ssl:n}=await(0,g.Z)(r(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=i,this.sourceJSON=t,n&&(this.url=this.url.replace(/^http:/i,"https:"))}if(t.capabilities?.toLowerCase().split(",").map((e=>e.trim())).indexOf("tilesonly")>-1)throw new o.Z("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?"esriImageServiceSourceTypeMosaicDataset"===e.serviceSourceType:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;const t=this._isMosaicDataset(e),r=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||r}_isVectorFieldResampleFunction(e){if(null==e)return!1;const{functionName:t,functionArguments:r}=e,i="resample"===t?.toLowerCase(),n=r?.ResampleType||r?.resampleType;return i&&(7===n||10===n)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){const t=this._isPicture(),{rasterInfo:r}=this;if(!t&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&r.bandCount>=3){const e=(0,oe.YD)(r);!e||3===r.bandCount&&0===e[0]&&1===e[1]&&2===e[2]||(this.bandIds=e)}e||(e=(0,oe.Ob)(r,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}));const t=(0,oe.ol)(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=t,this.symbolizer.rasterInfo=r):this.symbolizer=new ae.Z({rendererJSON:t,rasterInfo:r}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return null==e?e:{extent:e.extent&&e.extent.clone(),pixelBlock:null!=e.pixelBlock?e.pixelBlock.clone():null}}_getQueryParams(e){null!=e?.renderingRule&&"string"!=typeof e.renderingRule&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:r}=this;return{raster:t,viewId:r,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,r){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):(0,ne.J)(e,t,r)}async _getRasterFunctionInfos(e){const t=this.sourceJSON.rasterFunctionInfos;if(this.loaded)return t;if(t&&this.version>=10.3){if(1===t.length&&"none"===t[0].name.toLowerCase())return t;const i=await(0,g.Z)(r(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e});return i.data?.rasterFunctionInfos}return null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:i,returnImageBitmap:n,signal:s}=e;if(i&&this._canRequestImageElement(t.format)){const i=`${r(this.parsedUrl)}/exportImage`,{data:o}=await(0,g.Z)(i,{responseType:n?"blob":"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:s});return o instanceof Blob?{imageBitmap:await(0,Y.g)(o,i,s),params:t}:{imageOrCanvasElement:o,params:t}}const a=this._initJobHandler(),l=(0,g.Z)(r(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:s}),u=(await Promise.all([l,a]))[0].data,p=t.format||"jpgpng";let c=p;if("bsq"!==c&&"bip"!==c&&(c=(0,ne.y)(u)),!c)throw new o.Z("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(u)));const d={signal:s},m="gif"===p||"bmp"===p||p.includes("png")&&("png"===c||"jpg"===c)?(0,ne.J)(u,{useCanvas:!0,...t},d):this._decodePixelBlock(u,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:p},d);return{pixelData:{pixelBlock:await m,extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch((()=>null))}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=(0,ie.Tj)(e,{multidimensionalSubset:this.multidimensionalSubset});if(null!=t&&t.length>0){this.mosaicRule=this.mosaicRule||new k.Z;const e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&"none"!==this.rasterFunction.functionName?.toLowerCase()&&t.forEach((e=>e.variableName="")),t=t.filter((({variableName:e,dimensionName:t})=>e&&"*"!==e||t)),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){t=t||{};const r=e.value,{templateRRFunctionNames:i,showNoDataRecords:n,returnDomainValues:s,templateFields:o}=t,a=e.processedValues;let l=e.catalogItems?.features,u=e.properties?.Values?.map((e=>e.replaceAll(/ /gi,", ")))||[];const p=this.objectIdField||"ObjectId",c="string"==typeof r&&r.toLowerCase().includes("nodata"),d=[];if(r&&!l&&!c){const e={};e[p]=0,u=[r],l=[new y.Z(this.fullExtent,null,e)]}if(!l)return[];let m,h,f;this._updateResponseFieldNames(l,o),c&&!n&&(l=[]);for(let e=0;e<l.length;e++){if(m=l[e],null!=r){if(h=u[e],f=this.rasterFunction&&a&&a.length>0&&i&&i.length>0&&i.includes(this.rasterFunction.functionName)?a[i.indexOf(this.rasterFunction.functionName)]:r,"nodata"===h.toLowerCase()&&!n)continue;const t="Raster.ItemPixelValue",s="Raster.ServicePixelValue";m.attributes[t]=h,m.attributes[s]=f,this._updateFeatureWithMagDirValues(m,h);const o=this.fields&&this.fields.length>0;let l=this.rasterFunction&&null!=this.serviceRasterInfo.attributeTable?o?h:r:f;this.rasterFunction||(l=o?h:r),this._updateFeatureWithRasterAttributeTableValues(m,l)}if(m.sourceLayer=m.layer=this,s&&this._updateFeatureWithDomainValues(m),i&&a&&i.length===a.length)for(let e=0;e<i.length;e++){const t="Raster.ServicePixelValue."+i[e];m.attributes[t]=a[e]}d.push(l[e])}return d}_processMultidimensionalIntersection(e,t,r){const{multidimensionalSubset:i}=this;if(!i)return{isOutSide:!1,timeExtent:t,mosaicRule:r=this._combineMosaicRuleWithTimeExtent(r,t)};if(i){const{isOutside:r,intersection:n}=(0,ie.W2)(i,{geometry:e,timeExtent:t});if(r)return{isOutSide:!0,timeExtent:null,mosaicRule:null};null!=n?.timeExtent&&(t=n.timeExtent)}if(r=this._combineMosaicRuleWithTimeExtent(r,t),r?.multidimensionalDefinition){const{isOutside:e}=(0,ie.W2)(i,{multidimensionalDefinition:r.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:r}}_updateFeatureWithRasterAttributeTableValues(e,t){const r=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(null==r)return;const{features:i,fields:n}=r,s=n.map((e=>e.name)).find((e=>"value"===e.toLowerCase()));if(!s)return;const o=i.filter((e=>e.attributes[s]===(null!=t?parseInt(t,10):null)));o&&o[0]&&n.forEach((t=>{const r=this._rasterAttributeTableFieldPrefix+t.name;e.attributes[r]=o[0].attributes[t.name]}))}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const r=t.split(/,\s*/).map((e=>parseFloat(e))),i=r.map((e=>[e])),n=r.map((e=>({minValue:e,maxValue:e,noDataValue:null}))),s=new ee.Z({height:1,width:1,pixelType:"f32",pixels:i,statistics:n});null!=this.pixelFilter&&this.pixelFilter({pixelBlock:s,extent:new Ue.Z(0,0,0,0,this.spatialReference)});const o="esriImageServiceDataTypeVector-MagDir"===this.serviceDataType?[s.pixels[0][0],s.pixels[1][0]]:(0,se.Tg)([s.pixels[0][0],s.pixels[1][0]]);e.attributes["Raster.Magnitude"]=o[0],e.attributes["Raster.Direction"]=o[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter((e=>e.domain&&"coded-value"===e.domain.type));null!=t&&t.forEach((t=>{const r=e.attributes[t.name];if(null!=r){const i=t.domain.codedValues.find((e=>e.code===r));i&&(e.attributes[t.name]=i.name)}}))}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const r=this.fieldsIndex;null!=r&&e.forEach((e=>{if(e?.attributes)for(const i of t){const t=r.get(i)?.name;t&&t!==i&&(e.attributes[i]=e.attributes[t],delete e.attributes[t])}}))}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return null!=e?.functionName&&"none"!==e.functionName.toLowerCase()}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if("Raw"===e)return e.replace("Raw","None");const r=e.toLowerCase().replaceAll(/ /gi,"_");return t.has(r)?t.get(r):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return"esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType}_applyMosaicAndRenderingRules(e){const{raster:t,mosaicRule:r,rasterFunction:i}=this;i&&e instanceof yt.Z&&null==e.rasterFunction&&(e.rasterFunction=i),r&&null==e.mosaicRule&&(e.mosaicRule=r),t&&null==e.raster&&(e.raster=t)}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map((e=>e.trim())):["image","catalog"],{currentVersion:r,advancedQueryCapabilities:i,maxRecordCount:n}=e,s=t.includes("image"),o="esriImageServiceDataTypeElevation"===e.serviceDataType,a=!(!e.spatialReference&&!e.extent?.spatialReference),l=t.includes("edit"),u=t.includes("mensuration")&&a,p=null==e.mensurationCapabilities?[]:e.mensurationCapabilities.toLowerCase().split(",").map((e=>e.trim())),c=u&&p.includes("basic");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:s,supportsExportImage:s,supportsIdentify:s,supportsMeasure:u,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:r>=10.2&&s,supportsProject:r>=10.3&&s,supportsComputeStatisticsHistograms:r>=10.4&&s,supportsQueryBoundary:r>=10.6&&s,supportsCalculateVolume:r>=10.7&&o,supportsComputePixelLocation:r>=10.7&&t.includes("catalog"),supportsComputeAngles:r>=10.91,supportsAdd:l,supportsDelete:l,supportsEditing:l,supportsUpdate:l,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:n,maxRecordCountFactor:void 0,supportsStatistics:!!i?.supportsStatistics,supportsOrderBy:!!i?.supportsOrderBy,supportsDistinct:!!i?.supportsDistinct,supportsPagination:!!i?.supportsPagination,supportsStandardizedQueriesOnly:!!i?.useStandardizedQueries,supportsPercentileStatistics:!!i?.supportsPercentileStatistics,supportsCentroid:!!i?.supportsReturningGeometryCentroid,supportsDistance:!!i?.supportsQueryWithDistance,supportsExtent:!!i?.supportsReturningQueryExtent,supportsGeometryProperties:!!i?.supportsReturningGeometryProperties,supportsHavingClause:!!i?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!i?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0},mensuration:{supportsDistanceAndAngle:c,supportsAreaAndPerimeter:c,supportsPointOrCentroid:c,supportsHeightFromBaseAndTop:u&&p.includes("base-top height"),supportsHeightFromBaseAndTopShadow:u&&p.includes("base-top shadow height"),supportsHeightFromTopAndTopShadow:u&&p.includes("top-top shadow height"),supports3D:u&&p.includes("3d")}}}};function r(e){return e?.path??""}return(0,i._)([(0,u.Cb)({clonable:!1})],t.prototype,"_functionRasterInfos",void 0),(0,i._)([(0,u.Cb)({clonable:!1})],t.prototype,"_rasterJobHandler",void 0),(0,i._)([(0,u.Cb)({clonable:!1})],t.prototype,"_cachedRendererJson",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_serviceSupportsMosaicRule",void 0),(0,i._)([(0,S.r)("_serviceSupportsMosaicRule",["currentVersion","fields"])],t.prototype,"readServiceSupportsMosaicRule",null),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_rasterAttributeTableFieldPrefix",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"_rasterFunctionNamesIndex",null),(0,i._)([(0,u.Cb)()],t.prototype,"adjustAspectRatio",void 0),(0,i._)([(0,u.Cb)({type:[p.z8],json:{write:!0}})],t.prototype,"bandIds",void 0),(0,i._)([(0,S.r)("bandIds")],t.prototype,"readBandIds",null),(0,i._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],t.prototype,"capabilities",void 0),(0,i._)([(0,S.r)("service","capabilities",["capabilities","currentVersion","serviceDataType"])],t.prototype,"readCapabilities",null),(0,i._)([(0,u.Cb)({type:Number})],t.prototype,"compressionQuality",void 0),(0,i._)([(0,d.c)("compressionQuality")],t.prototype,"writeCompressionQuality",null),(0,i._)([(0,u.Cb)({type:Number})],t.prototype,"compressionTolerance",void 0),(0,i._)([(0,d.c)("compressionTolerance")],t.prototype,"writeCompressionTolerance",null),(0,i._)([(0,u.Cb)({json:{read:{source:"copyrightText"}}})],t.prototype,"copyright",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],t.prototype,"defaultMosaicRule",void 0),(0,i._)([(0,S.r)("defaultMosaicRule",["defaultMosaicMethod"])],t.prototype,"readDefaultMosaicRule",null),(0,i._)([(0,u.Cb)({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,constructOnly:!0})],t.prototype,"exportImageServiceParameters",void 0),(0,i._)([(0,u.Cb)()],t.prototype,"rasterInfo",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,type:[W.Z]})],t.prototype,"fields",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"fieldsIndex",null),(0,i._)([(0,u.Cb)({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],t.prototype,"format",null),(0,i._)([(0,S.r)("service","format",["serviceDataType"])],t.prototype,"readFormat",null),(0,i._)([(0,u.Cb)({type:Ue.Z})],t.prototype,"fullExtent",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"hasMultidimensions",void 0),(0,i._)([(0,u.Cb)({json:{read:{source:"maxImageHeight"}}})],t.prototype,"imageMaxHeight",void 0),(0,i._)([(0,u.Cb)({json:{read:{source:"maxImageWidth"}}})],t.prototype,"imageMaxWidth",void 0),(0,i._)([(0,u.Cb)({type:String,json:{type:Q.cl.jsonValues,read:Q.cl.read,write:Q.cl.write}})],t.prototype,"interpolation",void 0),(0,i._)([(0,u.Cb)()],t.prototype,"minScale",void 0),(0,i._)([(0,S.r)("service","minScale")],t.prototype,"readMinScale",null),(0,i._)([(0,u.Cb)()],t.prototype,"maxScale",void 0),(0,i._)([(0,S.r)("service","maxScale")],t.prototype,"readMaxScale",null),(0,i._)([(0,u.Cb)({type:k.Z})],t.prototype,"mosaicRule",null),(0,i._)([(0,S.r)("mosaicRule",["mosaicRule","defaultMosaicMethod"])],t.prototype,"readMosaicRule",null),(0,i._)([(0,d.c)("mosaicRule")],t.prototype,"writeMosaicRule",null),(0,i._)([(0,u.Cb)()],t.prototype,"multidimensionalInfo",void 0),(0,i._)([(0,u.Cb)({type:K.Z,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),(0,i._)([(0,u.Cb)({json:{type:p.z8}})],t.prototype,"noData",void 0),(0,i._)([(0,d.c)("noData")],t.prototype,"writeNoData",null),(0,i._)([(0,u.Cb)({type:String,json:{type:Q.kQ.jsonValues,read:Q.kQ.read,write:Q.kQ.write}})],t.prototype,"noDataInterpretation",void 0),(0,i._)([(0,u.Cb)({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],t.prototype,"objectIdField",void 0),(0,i._)([(0,S.r)("objectIdField")],t.prototype,"readObjectIdField",null),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"geometryType",void 0),(0,i._)([(0,u.Cb)({})],t.prototype,"typeIdField",void 0),(0,i._)([(0,u.Cb)({})],t.prototype,"types",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"parsedUrl",null),(0,i._)([(0,u.Cb)({type:Function})],t.prototype,"pixelFilter",void 0),(0,i._)([(0,u.Cb)()],t.prototype,"raster",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"sourceType",void 0),(0,i._)([(0,S.r)("sourceType",["serviceSourceType","fields"])],t.prototype,"readSourceType",null),(0,i._)([(0,u.Cb)()],t.prototype,"viewId",void 0),(0,i._)([(0,u.Cb)({types:f.dr,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:f.FK,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],t.prototype,"renderer",null),(0,i._)([(0,S.r)("renderer")],t.prototype,"readRenderer",null),(0,i._)([(0,d.c)("renderer")],t.prototype,"writeRenderer",null),(0,i._)([(0,u.Cb)({clonable:!1})],t.prototype,"symbolizer",void 0),(0,i._)([(0,u.Cb)(C.Oh)],t.prototype,"opacity",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"rasterFields",null),(0,i._)([(0,u.Cb)({constructOnly:!0})],t.prototype,"rasterFunctionInfos",void 0),(0,i._)([(0,u.Cb)({type:T.Z})],t.prototype,"renderingRule",null),(0,i._)([(0,u.Cb)({type:T.Z,json:{name:"renderingRule"}})],t.prototype,"rasterFunction",null),(0,i._)([(0,S.r)("rasterFunction",["renderingRule","rasterFunctionInfos"])],t.prototype,"readRasterFunction",null),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"serviceDataType",void 0),(0,i._)([(0,u.Cb)({readOnly:!0,type:pe.Z})],t.prototype,"spatialReference",void 0),(0,i._)([(0,S.r)("spatialReference",["spatialReference","extent"])],t.prototype,"readSpatialReference",null),(0,i._)([(0,u.Cb)({json:{type:Q.sM.jsonValues}})],t.prototype,"pixelType",void 0),(0,i._)([(0,S.r)("pixelType")],t.prototype,"readPixelType",null),(0,i._)([(0,d.c)("pixelType")],t.prototype,"writePixelType",null),(0,i._)([(0,u.Cb)({constructOnly:!0,type:te.Z})],t.prototype,"serviceRasterInfo",void 0),(0,i._)([(0,u.Cb)()],t.prototype,"sourceJSON",void 0),(0,i._)([(0,u.Cb)(C.HQ)],t.prototype,"url",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],t.prototype,"version",void 0),(0,i._)([(0,S.r)("version",["currentVersion","fields","timeInfo"])],t.prototype,"readVersion",null),t=(0,i._)([(0,c.j)("esri.layers.mixins.ArcGISImageService")],t),t};var Pt=r(17287),Ot=r(71612),Zt=r(17017),Mt=r(38009),At=r(16859),Vt=r(34760),Jt=r(72965),Et=r(28294),qt=r(60199),Gt=r(32163),zt=r(12259);let Lt=class extends((0,Ot.h)((0,Et.n)((0,Jt.M)((0,Mt.q)((0,At.I)(jt((0,Vt.Q)((0,Zt.N)((0,Pt.Y)((0,a.R)((0,s.J)(m.Z)))))))))))){constructor(...e){super(...e),this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery",this._debouncedSaveOperations=(0,l.Ds)((async(e,t,i)=>{const{save:n,saveAs:s}=await r.e(4697).then(r.bind(r,64697));switch(e){case zt.x.SAVE:return n(this,t);case zt.x.SAVE_AS:return s(this,i,t)}}))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(l.r9).then((()=>this._fetchService(t)))),Promise.resolve(this)}get legendEnabled(){return!this._isPreviewLayer&&(this._get("legendEnabled")??!0)}set legendEnabled(e){this._set("legendEnabled",e)}get listMode(){return this._isPreviewLayer?"hide":this._get("listMode")}set listMode(e){this._set("listMode",e)}writeOperationalLayerType(e,t,r){const i="vector-field"===this.renderer?.type;t[r]=i?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}get _isPreviewLayer(){return!(!this.raster||!this.url?.toLowerCase().includes("/rasterrendering/imageserver"))}createPopupTemplate(e){const t=this.rasterFields,r=this.title,i=new Set;let n=!1,s=!1;this.capabilities&&(n=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,s="esriImageServiceDataTypeVector-UV"===this.serviceDataType||"esriImageServiceDataTypeVector-MagDir"===this.serviceDataType);const o=new Set;n&&o.add("raster.itempixelvalue");for(const e of t){const t=e.name.toLowerCase();o.has(t)||t.includes("raster.servicepixelvalue.")||i.add(e.name)}s&&i.add("raster.magnitude").add("raster.direction");const a=(0,Gt.eZ)({fields:t,title:r},{...e,visibleFieldNames:i});return a?.fieldInfos&&this.rasterInfo?.pixelType.startsWith("f")&&a.fieldInfos.forEach((({format:e,fieldName:t})=>{e&&/^raster\.(item|service)pixelvalue/i.test(t)&&(e.places=2)})),a}queryFeatures(e,t){return this.queryRasters(e,t).then((e=>{if(e?.features)for(const t of e.features)t.layer=t.sourceLayer=this;return e}))}queryFeatureCount(e,t){return this.queryRasterCount(e,t)}redraw(){this.emit("redraw")}async save(e){return this._debouncedSaveOperations(zt.x.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(zt.x.SAVE_AS,t,e)}serviceSupportsSpatialReference(e){return(0,qt.D)(this,e)}write(e,t){if(!this._isPreviewLayer)return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new o.Z("layer:unsupported",`Imagery preview layer (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}};(0,i._)([(0,u.Cb)(C.rn)],Lt.prototype,"legendEnabled",null),(0,i._)([(0,u.Cb)({type:["show","hide"]})],Lt.prototype,"listMode",null),(0,i._)([(0,u.Cb)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Lt.prototype,"isReference",void 0),(0,i._)([(0,u.Cb)({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],Lt.prototype,"operationalLayerType",void 0),(0,i._)([(0,d.c)("web-map","operationalLayerType")],Lt.prototype,"writeOperationalLayerType",null),(0,i._)([(0,u.Cb)(C.C_)],Lt.prototype,"popupEnabled",void 0),(0,i._)([(0,u.Cb)({type:n.Z,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Lt.prototype,"popupTemplate",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],Lt.prototype,"defaultPopupTemplate",null),(0,i._)([(0,u.Cb)({readOnly:!0,json:{read:!1}})],Lt.prototype,"type",void 0),(0,i._)([(0,u.Cb)({readOnly:!0})],Lt.prototype,"_isPreviewLayer",null),Lt=(0,i._)([(0,c.j)("esri.layers.ImageryLayer")],Lt);const Bt=Lt},70272:(e,t,r)=>{r.d(t,{S6:()=>n,nd:()=>s,u_:()=>i});class i{constructor(e=null,t={},r,i){this.geometry=e,this.attributes=t,this.centroid=r,this.objectId=i,this.displayId=0,this.geohashX=0,this.geohashY=0}weakClone(){const e=new i(this.geometry,this.attributes,this.centroid,this.objectId);return e.displayId=this.displayId,e.geohashX=this.geohashX,e.geohashY=this.geohashY,e}}function n(e){return!!e.geometry?.coords?.length}class s extends i{}},44876:(e,t,r)=>{r.d(t,{Z:()=>i});class i{constructor(){this.objectIdFieldName=null,this.globalIdFieldName=null,this.geohashFieldName=null,this.geometryProperties=null,this.geometryType=null,this.spatialReference=null,this.hasZ=!1,this.hasM=!1,this.features=[],this.fields=[],this.transform=null,this.exceededTransferLimit=!1,this.uniqueIdField=null,this.queryGeometryType=null,this.queryGeometry=null}weakClone(){const e=new i;return e.objectIdFieldName=this.objectIdFieldName,e.globalIdFieldName=this.globalIdFieldName,e.geohashFieldName=this.geohashFieldName,e.geometryProperties=this.geometryProperties,e.geometryType=this.geometryType,e.spatialReference=this.spatialReference,e.hasZ=this.hasZ,e.hasM=this.hasM,e.features=this.features,e.fields=this.fields,e.transform=this.transform,e.exceededTransferLimit=this.exceededTransferLimit,e.uniqueIdField=this.uniqueIdField,e.queryGeometry=this.queryGeometry,e.queryGeometryType=this.queryGeometryType,e}}},5428:(e,t,r)=>{r.d(t,{Z:()=>i});class i{constructor(e=[],t=[],r=!1){this.lengths=e??[],this.coords=t??[],this.hasIndeterminateRingOrder=r}static fromRect(e){const[t,r,n,s]=e,o=n-t,a=s-r;return new i([5],[t,r,o,0,0,a,-o,0,0,-a])}get isPoint(){return 0===this.lengths.length}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((e,t)=>e+t))}forEachVertex(e){let t=0;this.lengths.length||e(this.coords[0],this.coords[1]);for(let r=0;r<this.lengths.length;r++){const i=this.lengths[r];for(let r=0;r<i;r++)e(this.coords[2*(r+t)],this.coords[2*(r+t)+1]);t+=i}}clone(e){return e?(e.set(this.coords),new i(this.lengths.slice(),e,this.hasIndeterminateRingOrder)):new i(this.lengths.slice(),this.coords.slice(),this.hasIndeterminateRingOrder)}}},98732:(e,t,r)=>{r.d(t,{$:()=>re,$g:()=>ie,EI:()=>B,GH:()=>H,IN:()=>R,Iv:()=>Z,J6:()=>A,Jd:()=>v,Nh:()=>Y,RZ:()=>X,Uy:()=>E,XA:()=>z,Yn:()=>L,cn:()=>Q,dd:()=>O,di:()=>U,eG:()=>J,fQ:()=>S,hY:()=>ne,h_:()=>$,lM:()=>W,lz:()=>oe,zj:()=>K});var i=r(20102),n=r(92604),s=r(70586),o=r(60437),a=r(24470),l=r(33955),u=r(70272),p=r(44876),c=r(5428);function d(e,t){return e?t?4:3:t?3:2}const m=n.Z.getLogger("esri.layers.graphics.featureConversionUtils"),h={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0,esriGeometryEnvelope:0},y=(e,t,r,i,n,s)=>{e[r]=n,e[r+1]=s},f=(e,t,r,i,n,s)=>{e[r]=n,e[r+1]=s,e[r+2]=t[i+2]},g=(e,t,r,i,n,s)=>{e[r]=n,e[r+1]=s,e[r+2]=t[i+3]},b=(e,t,r,i,n,s)=>{e[r]=n,e[r+1]=s,e[r+2]=t[i+2],e[r+3]=t[i+3]};function w(e,t,r,i){if(e){if(r)return t&&i?b:f;if(t&&i)return g}else if(t&&i)return f;return y}function v({scale:e,translate:t},r){return Math.round((r-t[0])/e[0])}function R({scale:e,translate:t},r){return Math.round((t[1]-r)/e[1])}function _({scale:e,translate:t},r,i){return r*e[i]+t[i]}function S(e,t,r){return e?t?r?D(e):x(e):r?T(e):F(e):null}function F(e){const t=e.coords;return{x:t[0],y:t[1]}}function C(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function x(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function I(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function T(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function N(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function D(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function j(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function P(e,t){return e&&t?j:e?I:t?N:C}function O(e,t,r=P(null!=t.z,null!=t.m)){return r(e,t)}function Z(e,t,r){if(null==e)return null;const i=d(t,r),n=[];for(let t=0;t<e.coords.length;t+=i){const r=[];for(let n=0;n<i;n++)r.push(e.coords[t+n]);n.push(r)}return t?r?{points:n,hasZ:t,hasM:r}:{points:n,hasZ:t}:r?{points:n,hasM:r}:{points:n}}function M(e,t,r=d(t.hasZ,t.hasM)){e.lengths[0]=t.points.length;const i=e.coords;let n=0;for(const e of t.points)for(let t=0;t<r;t++)i[n++]=e[t];return e}function A(e,t,r){if(!e)return null;const i=d(t,r),{coords:n,lengths:s}=e,o=[];let a=0;for(const e of s){const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<i;t++)e.push(n[a++]);t.push(e)}o.push(t)}return t?r?{paths:o,hasZ:t,hasM:r}:{paths:o,hasZ:t}:r?{paths:o,hasM:r}:{paths:o}}function V(e,t,r=d(t.hasZ,t.hasM)){const{lengths:i,coords:n}=e;let s=0;for(const e of t.paths){for(const t of e)for(let e=0;e<r;e++)n[s++]=t[e];i.push(e.length)}return e}function J(e,t,r){if(!e)return null;const i=d(t,r),{coords:n,lengths:s}=e,o=[];let a=0;for(const e of s){const t=[];for(let r=0;r<e;r++){const e=[];for(let t=0;t<i;t++)e.push(n[a++]);t.push(e)}o.push(t)}return t?r?{rings:o,hasZ:t,hasM:r}:{rings:o,hasZ:t}:r?{rings:o,hasM:r}:{rings:o}}function E(e,t,r=t.hasZ,i=t.hasM){return function(e,t,r,i){const n=d(r,i),{lengths:s,coords:o}=e;let a=0;ae(e);for(const e of t){for(const t of e)for(let e=0;e<n;e++)o[a++]=t[e];s.push(e.length)}return e}(e,t.rings,r,i)}const q=[],G=[];function z(e,t,r,i,n){q[0]=e;const[s]=L(G,q,t,r,i,n);return le(q),le(G),s}function L(e,t,r,n,s,o){if(le(e),!r){for(const r of t){const t=o?r.attributes[o]:void 0;e.push(new u.u_(null,r.attributes,null,t))}return e}switch(r){case"esriGeometryPoint":return function(e,t,r,i,n){const s=P(r,i);for(const{geometry:r,attributes:i}of t){const t=null!=r?s(new c.Z,r):null;e.push(new u.u_(t,i,null,n?i[n]:void 0))}return e}(e,t,n,s,o);case"esriGeometryMultipoint":return function(e,t,r,i,n){const s=d(r,i);for(const{geometry:r,attributes:i}of t){const t=null!=r?M(new c.Z,r,s):null;e.push(new u.u_(t,i,null,n?i[n]:void 0))}return e}(e,t,n,s,o);case"esriGeometryPolyline":return function(e,t,r,i,n){const s=d(r,i);for(const{geometry:r,attributes:i}of t){const t=null!=r?V(new c.Z,r,s):null;e.push(new u.u_(t,i,null,n?i[n]:void 0))}return e}(e,t,n,s,o);case"esriGeometryPolygon":return function(e,t,r,i,n){for(const{geometry:s,centroid:o,attributes:a}of t){const t=null!=s?E(new c.Z,s,r,i):null,l=n?a[n]:void 0;null!=o?e.push(new u.u_(t,a,C(new c.Z,o),l)):e.push(new u.u_(t,a,null,l))}return e}(e,t,n,s,o);default:m.error("convertToFeatureSet:unknown-geometry",new i.Z(`Unable to parse unknown geometry type '${r}'`)),le(e)}return e}function B(e,t,r,i){G[0]=e,k(q,G,t,r,i);const n=q[0];return le(q),le(G),n}function H(e,t,r){if(null==e)return null;const n=new c.Z;return"hasZ"in e&&null==t&&(t=e.hasZ),"hasM"in e&&null==r&&(r=e.hasM),(0,l.wp)(e)?P(null!=t?t:null!=e.z,null!=r?r:null!=e.m)(n,e):(0,l.oU)(e)?E(n,e,t,r):(0,l.l9)(e)?V(n,e,d(t,r)):(0,l.aW)(e)?M(n,e,d(t,r)):void m.error("convertFromGeometry:unknown-geometry",new i.Z(`Unable to parse unknown geometry type '${e}'`))}function U(e,t,r,n){const s=e&&("coords"in e?e:e.geometry);if(null==s)return null;switch(t){case"esriGeometryPoint":{let e=F;return r&&n?e=D:r?e=x:n&&(e=T),e(s)}case"esriGeometryMultipoint":return Z(s,r,n);case"esriGeometryPolyline":return A(s,r,n);case"esriGeometryPolygon":return J(s,r,n);default:return m.error("convertToGeometry:unknown-geometry",new i.Z(`Unable to parse unknown geometry type '${t}'`)),null}}function k(e,t,r,n,s){if(le(e),null==r)return function(e,t){for(const r of t)e.push({attributes:r.attributes});return e}(e,t);switch(r){case"esriGeometryPoint":return function(e,t,r,i){let n=F;r&&i?n=D:r?n=x:i&&(n=T);for(const r of t){const{geometry:t,attributes:i}=r,s=null!=t?n(t):null;e.push({attributes:i,geometry:s})}return e}(e,t,n,s);case"esriGeometryMultipoint":return function(e,t,r,i){for(const{geometry:n,attributes:s}of t)e.push({attributes:s,geometry:null!=n?Z(n,r,i):null});return e}(e,t,n,s);case"esriGeometryPolyline":return function(e,t,r,i){for(const{geometry:n,attributes:s}of t)e.push({attributes:s,geometry:null!=n?A(n,r,i):null});return e}(e,t,n,s);case"esriGeometryPolygon":return function(e,t,r,i){for(const{geometry:n,attributes:s,centroid:o}of t){const t=null!=n?J(n,r,i):null;if(null!=o){const r=F(o);e.push({attributes:s,centroid:r,geometry:t})}else e.push({attributes:s,geometry:t})}return e}(e,t,n,s);default:m.error("convertToFeatureSet:unknown-geometry",new i.Z(`Unable to parse unknown geometry type '${r}'`))}return e}function Q(e){const{objectIdFieldName:t,spatialReference:r,transform:i,fields:n,hasM:s,hasZ:o,features:a,geometryType:l,exceededTransferLimit:u,uniqueIdField:p,queryGeometry:c,queryGeometryType:d}=e,m={features:k([],a,l,o,s),fields:n,geometryType:l,objectIdFieldName:t,spatialReference:r,uniqueIdField:p,queryGeometry:U(c,d,!1,!1)};return i&&(m.transform=i),u&&(m.exceededTransferLimit=u),s&&(m.hasM=s),o&&(m.hasZ=o),m}function $(e,t){const r=new p.Z,{hasM:n,hasZ:s,features:o,objectIdFieldName:a,spatialReference:l,geometryType:u,exceededTransferLimit:c,transform:d,fields:h}=e;return h&&(r.fields=h),r.geometryType=u??null,r.objectIdFieldName=a??t??null,r.spatialReference=l??null,r.objectIdFieldName?(o&&L(r.features,o,u,s,n,r.objectIdFieldName),c&&(r.exceededTransferLimit=c),n&&(r.hasM=n),s&&(r.hasZ=s),d&&(r.transform=d),r):(m.error(new i.Z("optimized-features:invalid-objectIdFieldName","objectIdFieldName is missing")),r)}function W(e){const{transform:t,features:r,hasM:i,hasZ:n}=e;if(!t)return e;for(const e of r)null!=e.geometry&&ie(e.geometry,e.geometry,i,n,t),null!=e.centroid&&ie(e.centroid,e.centroid,i,n,t);return e.transform=null,e}function X(e,t){const{geometryType:r,features:i,hasM:n,hasZ:s}=t;if(!e)return t;for(let t=0;t<i.length;t++){const o=i[t],a=o.weakClone();a.geometry=new c.Z,Y(a.geometry,o.geometry,n,s,r,e),o.centroid&&(a.centroid=new c.Z,Y(a.centroid,o.centroid,n,s,"esriGeometryPoint",e)),i[t]=a}return t.transform=e,t}function Y(e,t,r,i,n,s,o=r,a=i){if(ae(e),!t?.coords.length)return null;const l=h[n],{coords:u,lengths:p}=t,c=d(r,i),m=d(r&&o,i&&a),y=w(r,i,o,a);if(!p.length)return y(e.coords,u,0,0,v(s,u[0]),R(s,u[1])),ae(e,c,0),e;let f,g,b,_,S=0,F=0,C=F;for(const t of p){if(t<l)continue;let r=0;F=C,b=f=v(s,u[S]),_=g=R(s,u[S+1]),y(e.coords,u,F,S,b,_),r++,S+=c,F+=m;for(let i=1;i<t;i++,S+=c)b=v(s,u[S]),_=R(s,u[S+1]),b===f&&_===g||(y(e.coords,u,F,S,b-f,_-g),F+=m,r++,f=b,g=_);r>=l&&(e.lengths.push(r),C=F)}return le(e.coords,C),e.coords.length?e:null}function K(e,t,r,i,n,s,o=r,a=i){if(ae(e),!t?.coords.length)return null;const l=h[n],{coords:u,lengths:p}=t,c=d(r,i),m=d(r&&o,i&&a),y=w(r,i,o,a);if(!p.length)return y(e.coords,u,0,0,u[0],u[1]),ae(e,c,0),e;let f=0;const g=s*s;for(const t of p){if(t<l){f+=t*c;continue}const r=e.coords.length/m,i=f,n=f+(t-1)*c;y(e.coords,u,e.coords.length,i,u[i],u[i+1]),te(e.coords,u,c,g,y,i,n),y(e.coords,u,e.coords.length,n,u[n],u[n+1]);const s=e.coords.length/m-r;s>=l?e.lengths.push(s):le(e.coords,r*m),f+=t*c}return e.coords.length?e:null}function ee(e,t,r,i){const n=e[t],s=e[t+1],o=e[r],a=e[r+1],l=e[i],u=e[i+1];let p=o,c=a,d=l-p,m=u-c;if(0!==d||0!==m){const e=((n-p)*d+(s-c)*m)/(d*d+m*m);e>1?(p=l,c=u):e>0&&(p+=d*e,c+=m*e)}return d=n-p,m=s-c,d*d+m*m}function te(e,t,r,i,n,s,o){let a,l=i,u=0;for(let e=s+r;e<o;e+=r)a=ee(t,e,s,o),a>l&&(u=e,l=a);l>i&&(u-s>r&&te(e,t,r,i,n,s,u),n(e,t,e.length,u,t[u],t[u+1]),o-u>r&&te(e,t,r,i,n,u,o))}function re(e,t,r,i){if(!t?.coords?.length)return null;const n=d(r,i);let s=Number.POSITIVE_INFINITY,l=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,p=Number.NEGATIVE_INFINITY;if(t&&t.coords){const e=t.coords;for(let t=0;t<e.length;t+=n){const r=e[t],i=e[t+1];s=Math.min(s,r),u=Math.max(u,r),l=Math.min(l,i),p=Math.max(p,i)}}return(0,o.is)(e)?(0,o.bZ)(e,s,l,u,p):(0,a.al)(s,l,u,p,e),e}function ie(e,t,r,i,n){const{coords:o,lengths:a}=t,l=d(r,i);if(!o.length)return e!==t&&ae(e),e;(0,s.O3)(n);const{originPosition:u,scale:p,translate:c}=n,m=ue;m.originPosition=u;const h=m.scale;h[0]=p[0]??1,h[1]=-(p[1]??1),h[2]=p[2]??1,h[3]=p[3]??1;const y=m.translate;if(y[0]=c[0]??0,y[1]=c[1]??0,y[2]=c[2]??0,y[3]=c[3]??0,!a.length){for(let t=0;t<l;++t)e.coords[t]=_(m,o[t],t);return e!==t&&ae(e,l,0),e}let f=0;for(let t=0;t<a.length;t++){const r=a[t];e.lengths[t]=r;for(let t=0;t<l;++t)e.coords[f+t]=_(m,o[f+t],t);let i=e.coords[f],n=e.coords[f+1];f+=l;for(let t=1;t<r;t++,f+=l){i+=o[f]*h[0],n+=o[f+1]*h[1],e.coords[f]=i,e.coords[f+1]=n;for(let t=2;t<l;++t)e.coords[f+t]=_(m,o[f+t],t)}}return e!==t&&ae(e,o.length,a.length),e}function ne(e,t,r,i,n,s){if(ae(e),e.lengths.push(...t.lengths),r===n&&i===s)for(let r=0;r<t.coords.length;r++)e.coords.push(t.coords[r]);else{const o=d(r,i),a=w(r,i,n,s),l=t.coords;for(let t=0;t<l.length;t+=o)a(e.coords,l,e.coords.length,t,l[t],l[t+1])}return e}function se(e,t,r,i){let n=0,s=e[i*t],o=e[i*(t+1)];for(let a=1;a<r;a++){const r=s+e[i*(t+a)],l=o+e[i*(t+a)+1],u=(r-s)*(l+o);s=r,o=l,n+=u}return.5*n}function oe(e,t){const{coords:r,lengths:i}=e;let n=0,s=0;for(let e=0;e<i.length;e++){const o=i[e];s+=se(r,n,o,t),n+=o}return Math.abs(s)}function ae(e,t=0,r=0){le(e.lengths,r),le(e.coords,t)}function le(e,t=0){e.length!==t&&(e.length=t)}const ue={originPosition:"lowerLeft",scale:[1,1,1,1],translate:[0,0,0,0]}},99514:(e,t,r)=>{r.d(t,{Z:()=>d});var i=r(20102),n=r(96674),s=r(92604),o=r(30175),a=r(1542),l=r(69165),u=r(25031),p=r(17126);const c=new Map;class d{static fromJSON(e){return new d(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new d(e.fields??[],f(e))}static fromLayerJSON(e){return new d(e.fields??[],f(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const r=[];for(const e of this.fields){const t=e?.name,i=h(t);if(t&&i){const n=m(t);this._fieldsMap.set(t,e),this._fieldsMap.set(n,e),this._normalizedFieldsMap.set(i,e),r.push(`${n}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.y2)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.H7)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.Dl)(e)||(0,l.Se)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}r.sort(),this.uid=r.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.Dl)(e)||(0,l.Se)(e)||e.nullable||void 0!==(0,l.os)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(m(e))??this._normalizedFieldsMap.get(h(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.Z.getLogger("esri.layers.support.FieldsIndex").error(new i.Z("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.pt):y.has(t.type)?u._4:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u._4?a.yV.instance:t===u.pt?p.Qf.utcInstance:(0,o.s1)(c,t,(()=>p.vF.create(t))):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.sX)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map((e=>(0,n.AK)(e)?e.toJSON():e)),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function m(e){return e.trim().toLowerCase()}function h(e){return(0,l.q6)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function f(e){const t=new Map;if(!e.fields)return t;const r=!0===e.datesInUnknownTimezone,{timeInfo:i,editFieldsInfo:n}=e,s=(i?"startField"in i?i.startField:i.startTimeField:"")??"",o=(i?"endField"in i?i.endField:i.endTimeField:"")??"",a=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,u.Jv)(e.dateFieldsTimeReference):null,l=n?function(e){return"timeZone"in e}(n)?n.timeZone??a:n.dateFieldsTimeReference?(0,u.Jv)(n.dateFieldsTimeReference):a??u.pt:null,p=i?function(e){return"timeZone"in e}(i)?i.timeZone??a:i.timeReference?(0,u.Jv)(i.timeReference):a:null,c=new Map([[m(n?.creationDateField??""),l],[m(n?.editDateField??""),l],[m(s),p],[m(o),p]]);for(const{name:i,type:n}of e.fields)if(y.has(n))t.set(i,u._4);else if("date"!==n&&"esriFieldTypeDate"!==n)t.set(i,null);else if(r)t.set(i,u._4);else{const e=c.get(m(i??""))??a;t.set(i,e)}return t}},90082:(e,t,r)=>{r.d(t,{V:()=>o,g:()=>s});var i=r(20102),n=r(95330);async function s(e,t,r){let s;try{s=await createImageBitmap(e)}catch(e){throw new i.Z("request:server",`Unable to load ${t}`,{url:t,error:e})}return(0,n.k_)(r),s}async function o(e,t,r,s,o){let a;try{a=await createImageBitmap(e)}catch(e){throw new i.Z("request:server",`Unable to load tile ${t}/${r}/${s}`,{error:e,level:t,row:r,col:s})}return(0,n.k_)(o),a}},60199:(e,t,r)=>{r.d(t,{D:()=>s});var i=r(66677);const n=[];function s(e,t){if((0,i.M8)(e.url??""))return!0;const{wkid:r}=t;for(const t of n){if((e.version??0)>=t[0])return!0;if("function"==typeof t[1]&&(t[1]=t[1]()),t[1].has(r))return!1}return!0}n.push([10.91,()=>{const e=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)e.add(t);for(let t=9748;t<=9749;t++)e.add(t);for(let t=20904;t<=20932;t++)e.add(t);for(let t=21004;t<=21032;t++)e.add(t);for(let t=21207;t<=21264;t++)e.add(t);for(let t=21307;t<=21364;t++)e.add(t);for(let t=23301;t<=23333;t++)e.add(t);for(let t=102759;t<=102760;t++)e.add(t);for(let t=102934;t<=102955;t++)e.add(t);return e}]),n.push([10.9,()=>{const e=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)e.add(t);for(let t=9404;t<=9407;t++)e.add(t);for(let t=9476;t<=9482;t++)e.add(t);for(let t=9487;t<=9494;t++)e.add(t);for(let t=9697;t<=9699;t++)e.add(t);return e}]),n.push([10.81,()=>{const e=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)e.add(t);for(let t=9271;t<=9273;t++)e.add(t);for(let t=9284;t<=9285;t++)e.add(t);for(let t=21453;t<=21463;t++)e.add(t);return e}]),n.push([10.8,()=>{const e=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)e.add(t);for(let t=8455;t<=8456;t++)e.add(t);for(let t=8518;t<=8529;t++)e.add(t);for(let t=8533;t<=8536;t++)e.add(t);for(let t=8538;t<=8540;t++)e.add(t);for(let t=8677;t<=8679;t++)e.add(t);for(let t=8902;t<=8903;t++)e.add(t);for(let t=8907;t<=8910;t++)e.add(t);for(let t=8949;t<=8951;t++)e.add(t);for(let t=8972;t<=8987;t++)e.add(t);for(let t=9039;t<=9040;t++)e.add(t);for(let t=9068;t<=9069;t++)e.add(t);for(let t=9140;t<=9141;t++)e.add(t);for(let t=9148;t<=9150;t++)e.add(t);for(let t=9153;t<=9159;t++)e.add(t);for(let t=9205;t<=9218;t++)e.add(t);for(let t=9221;t<=9222;t++)e.add(t);for(let t=54098;t<=54101;t++)e.add(t);return e}]),n.push([10.71,()=>{const e=new Set([6316]);for(let t=8351;t<=8353;t++)e.add(t);for(let t=9294;t<=9297;t++)e.add(t);for(let t=22619;t<=22621;t++)e.add(t);for(let t=103586;t<=103594;t++)e.add(t);return e}]),n.push([10.7,()=>{const e=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)e.add(t);for(let t=8082;t<=8083;t++)e.add(t);for(let t=8379;t<=8385;t++)e.add(t);for(let t=8836;t<=8840;t++)e.add(t);for(let t=8857;t<=8860;t++)e.add(t);for(let t=53035;t<=53037;t++)e.add(t);for(let t=54090;t<=54091;t++)e.add(t);for(let t=102498;t<=102499;t++)e.add(t);return e}]),n.push([10.61,()=>new Set([102497])]),n.push([10.6,()=>{const e=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)e.add(t);for(let t=7791;t<=7795;t++)e.add(t);for(let t=7799;t<=7801;t++)e.add(t);for(let t=7825;t<=7831;t++)e.add(t);for(let t=7877;t<=7878;t++)e.add(t);for(let t=7882;t<=7883;t++)e.add(t);for(let t=7991;t<=7992;t++)e.add(t);for(let t=8042;t<=8043;t++)e.add(t);for(let t=8058;t<=8059;t++)e.add(t);for(let t=8311;t<=8348;t++)e.add(t);for(let t=9060;t<=9067;t++)e.add(t);for(let t=102562;t<=102568;t++)e.add(t);for(let t=102799;t<=102900;t++)e.add(t);return e}])},41818:(e,t,r)=>{r.d(t,{P:()=>o});var i=r(11282),n=r(34599),s=r(14165);async function o(e,t,r){const o=(0,i.en)(e);return(0,n.hH)(o,s.Z.from(t),{...r}).then((e=>e.data.count))}},5396:(e,t,r)=>{r.d(t,{G:()=>o});var i=r(11282),n=r(34599),s=r(14165);async function o(e,t,r){const o=(0,i.en)(e);return(0,n.Ev)(o,s.Z.from(t),{...r}).then((e=>e.data.objectIds))}},4967:(e,t,r)=>{r.d(t,{F:()=>l,e:()=>a});var i=r(11282),n=r(34599),s=r(74889),o=r(14165);async function a(e,t,r){const i=await l(e,t,r);return s.Z.fromJSON(i)}async function l(e,t,r){const s=(0,i.en)(e),a={...r},l=o.Z.from(t),{data:u}=await(0,n.JT)(s,l,l.sourceSpatialReference,a);return u}},28694:(e,t,r)=>{r.d(t,{p:()=>n});var i=r(69285);function n(e,t,r){if(!r?.features||!r.hasZ)return;const n=(0,i.k)(r.geometryType,t,e.outSpatialReference);if(null!=n)for(const e of r.features)n(e.geometry)}},98326:(e,t,r)=>{r.d(t,{Z:()=>c});var i,n=r(43697),s=r(96674),o=r(5600),a=r(75215),l=(r(67676),r(80442),r(52011));const u={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let p=i=class extends s.wq{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=function(e){const{exifInfo:t,exifName:r,tagName:i}=e;if(!t||!r||!i)return null;const n=t.find((e=>e.name===r));return n?function(e){const{tagName:t,tags:r}=e;if(!r||!t)return null;const i=r.find((e=>e.name===t));return i?.value||null}({tagName:i,tags:n.tags}):null}({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return u[t]||null}clone(){return new i({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};(0,n._)([(0,o.Cb)({type:String})],p.prototype,"contentType",void 0),(0,n._)([(0,o.Cb)()],p.prototype,"exifInfo",void 0),(0,n._)([(0,o.Cb)({readOnly:!0})],p.prototype,"orientationInfo",null),(0,n._)([(0,o.Cb)({type:a.z8})],p.prototype,"id",void 0),(0,n._)([(0,o.Cb)({type:String})],p.prototype,"globalId",void 0),(0,n._)([(0,o.Cb)({type:String})],p.prototype,"keywords",void 0),(0,n._)([(0,o.Cb)({type:String})],p.prototype,"name",void 0),(0,n._)([(0,o.Cb)({json:{read:!1}})],p.prototype,"parentGlobalId",void 0),(0,n._)([(0,o.Cb)({json:{read:!1}})],p.prototype,"parentObjectId",void 0),(0,n._)([(0,o.Cb)({type:a.z8})],p.prototype,"size",void 0),(0,n._)([(0,o.Cb)({json:{read:!1}})],p.prototype,"url",void 0),p=i=(0,n._)([(0,l.j)("esri.layers.support.AttachmentInfo")],p);const c=p},56545:(e,t,r)=>{r.d(t,{Z:()=>d});var i,n=r(43697),s=r(96674),o=r(22974),a=r(5600),l=r(75215),u=r(52011),p=r(30556);let c=i=class extends s.wq{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new i((0,o.d9)({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};(0,n._)([(0,a.Cb)({type:[String],json:{write:!0}})],c.prototype,"attachmentTypes",void 0),(0,n._)([(0,a.Cb)({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],c.prototype,"attachmentsWhere",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],c.prototype,"cacheHint",void 0),(0,n._)([(0,a.Cb)({type:[String],json:{write:!0}})],c.prototype,"keywords",void 0),(0,n._)([(0,a.Cb)({type:[Number],json:{write:!0}})],c.prototype,"globalIds",void 0),(0,n._)([(0,a.Cb)({json:{write:!0}})],c.prototype,"name",void 0),(0,n._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],c.prototype,"num",void 0),(0,n._)([(0,a.Cb)({type:[Number],json:{write:!0}})],c.prototype,"objectIds",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{default:!1,write:!0}})],c.prototype,"returnMetadata",void 0),(0,n._)([(0,a.Cb)({type:[Number],json:{write:!0}})],c.prototype,"size",void 0),(0,n._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],c.prototype,"start",void 0),(0,n._)([(0,p.c)("start"),(0,p.c)("num")],c.prototype,"writeStart",null),(0,n._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],c.prototype,"where",void 0),c=i=(0,n._)([(0,u.j)("esri.rest.support.AttachmentQuery")],c),c.from=(0,l.se)(c);const d=c},75935:(e,t,r)=>{r.r(t),r.d(t,{default:()=>h});var i,n=r(43697),s=(r(66577),r(96674)),o=r(22974),a=r(5600),l=r(75215),u=r(52011),p=r(30556),c=r(10158),d=r(82971);let m=i=class extends s.wq{constructor(e){super(e),this.cacheHint=void 0,this.dynamicDataSource=void 0,this.gdbVersion=null,this.geometryPrecision=void 0,this.historicMoment=null,this.maxAllowableOffset=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.relationshipId=void 0,this.start=void 0,this.num=void 0,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.where=null}_writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,this.start>0&&null==this.where&&(t.definitionExpression="1=1")}clone(){return new i((0,o.d9)({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};(0,n._)([(0,a.Cb)({type:Boolean,json:{write:!0}})],m.prototype,"cacheHint",void 0),(0,n._)([(0,a.Cb)({type:c.n,json:{write:!0}})],m.prototype,"dynamicDataSource",void 0),(0,n._)([(0,a.Cb)({type:String,json:{write:!0}})],m.prototype,"gdbVersion",void 0),(0,n._)([(0,a.Cb)({type:Number,json:{write:!0}})],m.prototype,"geometryPrecision",void 0),(0,n._)([(0,a.Cb)({type:Date})],m.prototype,"historicMoment",void 0),(0,n._)([(0,p.c)("historicMoment")],m.prototype,"_writeHistoricMoment",null),(0,n._)([(0,a.Cb)({type:Number,json:{write:!0}})],m.prototype,"maxAllowableOffset",void 0),(0,n._)([(0,a.Cb)({type:[Number],json:{write:!0}})],m.prototype,"objectIds",void 0),(0,n._)([(0,a.Cb)({type:[String],json:{write:!0}})],m.prototype,"orderByFields",void 0),(0,n._)([(0,a.Cb)({type:[String],json:{write:!0}})],m.prototype,"outFields",void 0),(0,n._)([(0,a.Cb)({type:d.Z,json:{read:{source:"outSR"},write:{target:"outSR"}}})],m.prototype,"outSpatialReference",void 0),(0,n._)([(0,a.Cb)({json:{write:!0}})],m.prototype,"relationshipId",void 0),(0,n._)([(0,a.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],m.prototype,"start",void 0),(0,n._)([(0,p.c)("start"),(0,p.c)("num")],m.prototype,"writeStart",null),(0,n._)([(0,a.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],m.prototype,"num",void 0),(0,n._)([(0,a.Cb)({json:{write:!0}})],m.prototype,"returnGeometry",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"returnM",void 0),(0,n._)([(0,a.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],m.prototype,"returnZ",void 0),(0,n._)([(0,a.Cb)({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],m.prototype,"where",void 0),m=i=(0,n._)([(0,u.j)("esri.rest.support.RelationshipQuery")],m),m.from=(0,l.se)(m);const h=m},28141:(e,t,r)=>{r.d(t,{Z:()=>_});var i,n=r(43697),s=r(66577),o=r(92835),a=r(35454),l=r(96674),u=r(22974),p=r(5600),c=r(75215),d=r(52011),m=r(30556),h=r(33955);r(67676),r(80442);let y=i=class extends l.wq{constructor(e){super(e),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new i({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};(0,n._)([(0,p.Cb)({type:[String],json:{write:!0}})],y.prototype,"groupByFields",void 0),(0,n._)([(0,p.Cb)({type:Number,json:{write:!0}})],y.prototype,"topCount",void 0),(0,n._)([(0,p.Cb)({type:[String],json:{write:!0}})],y.prototype,"orderByFields",void 0),y=i=(0,n._)([(0,d.j)("esri.rest.support.TopFilter")],y);const f=y;var g,b=r(82971);const w=new a.X({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),v=new a.X({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let R=g=class extends l.wq{constructor(e){super(e),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new g((0,u.d9)({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};(0,n._)([(0,p.Cb)({type:Boolean,json:{write:!0}})],R.prototype,"cacheHint",void 0),(0,n._)([(0,p.Cb)({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],R.prototype,"distance",void 0),(0,n._)([(0,p.Cb)({types:s.qM,json:{read:h.im,write:!0}})],R.prototype,"geometry",void 0),(0,n._)([(0,p.Cb)({type:Number,json:{write:!0}})],R.prototype,"geometryPrecision",void 0),(0,n._)([(0,p.Cb)({type:Number,json:{write:!0}})],R.prototype,"maxAllowableOffset",void 0),(0,n._)([(0,p.Cb)({type:Number,json:{read:{source:"resultRecordCount"}}})],R.prototype,"num",void 0),(0,n._)([(0,p.Cb)({json:{write:!0}})],R.prototype,"objectIds",void 0),(0,n._)([(0,p.Cb)({type:[String],json:{write:!0}})],R.prototype,"orderByFields",void 0),(0,n._)([(0,p.Cb)({type:[String],json:{write:!0}})],R.prototype,"outFields",void 0),(0,n._)([(0,p.Cb)({type:b.Z,json:{read:{source:"outSR"},write:{target:"outSR"}}})],R.prototype,"outSpatialReference",void 0),(0,n._)([(0,p.Cb)({type:String,json:{write:!0}})],R.prototype,"resultType",void 0),(0,n._)([(0,p.Cb)({json:{write:!0}})],R.prototype,"returnGeometry",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],R.prototype,"returnM",void 0),(0,n._)([(0,p.Cb)({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],R.prototype,"returnZ",void 0),(0,n._)([(0,p.Cb)({type:Number,json:{read:{source:"resultOffset"}}})],R.prototype,"start",void 0),(0,n._)([(0,m.c)("start"),(0,m.c)("num")],R.prototype,"writeStart",null),(0,n._)([(0,p.Cb)({type:String,json:{read:{source:"spatialRel",reader:w.read},write:{target:"spatialRel",writer:w.write}}})],R.prototype,"spatialRelationship",void 0),(0,n._)([(0,p.Cb)({type:o.Z,json:{write:!0}})],R.prototype,"timeExtent",void 0),(0,n._)([(0,p.Cb)({type:f,json:{write:!0}})],R.prototype,"topFilter",void 0),(0,n._)([(0,p.Cb)({type:String,json:{read:v.read,write:{writer:v.write,overridePolicy(e){return{enabled:null!=e&&null!=this.distance&&this.distance>0}}}}})],R.prototype,"units",void 0),(0,n._)([(0,p.Cb)({type:String,json:{write:!0}})],R.prototype,"where",void 0),R=g=(0,n._)([(0,d.j)("esri.rest.support.TopFeaturesQuery")],R),R.from=(0,c.se)(R);const _=R}}]);