@arcgis/core 5.0.0-next.42 → 5.0.0-next.43

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 (89) hide show
  1. package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +1 -0
  4. package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +1 -0
  5. package/assets/esri/core/workers/chunks/{c320a29df40e85fb4a8e.js → 15a0750c10b510564a42.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{816227de5bd42b437df4.js → 233f9eb617f3d72995b5.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{fb9643b74cf35221ff98.js → 249504f7d356be80d214.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9d95f38da21f97214f83.js → 324d66962aeec17d3e28.js} +10 -10
  9. package/assets/esri/core/workers/chunks/385cfd3087f00dbd1146.js +1 -0
  10. package/assets/esri/core/workers/chunks/{4f4d51181ae7db9fbe6d.js → 4404b6f931f681cca342.js} +1 -1
  11. package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +1 -0
  12. package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +1 -0
  13. package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +1 -0
  14. package/assets/esri/core/workers/chunks/{da517b4b07d4d27ce94c.js → 8e26831f71634288f834.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{c367c7e553be3682f2db.js → 93c5f097bb7b380bb175.js} +1 -1
  16. package/assets/esri/core/workers/chunks/9c7682b300b877f60095.js +1 -0
  17. package/assets/esri/core/workers/chunks/{f3b3b193959db809c8c6.js → ab520fd1ae917daf07d8.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{2c9865e34f32fb5683e5.js → af8d6e6949930d0e6c7b.js} +1 -1
  19. package/assets/esri/core/workers/chunks/c9942ca57f542582ab4d.js +1 -0
  20. package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +1 -0
  21. package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +1 -0
  22. package/assets/esri/core/workers/chunks/e8a9971c8354569cb81d.js +1 -0
  23. package/assets/esri/core/workers/chunks/ed550bf27f2bbf8d30fa.js +1 -0
  24. package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +1 -0
  25. package/assets/esri/core/workers/chunks/{1357cc637524cd254974.js → ffcdc7ae03b0570e0db8.js} +1 -1
  26. package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
  27. package/assets/esri/themes/dark/main.css +1 -1
  28. package/assets/esri/themes/light/main.css +1 -1
  29. package/assets/esri/themes/light/view.css +1 -1
  30. package/config.js +1 -1
  31. package/core/PooledArray.js +1 -1
  32. package/geometry/FlatGeometry.js +1 -1
  33. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  34. package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
  35. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  36. package/interfaces.d.ts +31 -35
  37. package/kernel.js +1 -1
  38. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  39. package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
  40. package/package.json +1 -1
  41. package/support/revision.js +1 -1
  42. package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
  44. package/views/2d/engine/webgl/textureUtils.js +1 -1
  45. package/views/2d/layers/MediaLayerView2D.js +1 -1
  46. package/views/2d/layers/TileLayerView2D.js +1 -1
  47. package/views/3d/glTF/LoaderResult.js +1 -1
  48. package/views/3d/glTF/internal/Resource.js +1 -1
  49. package/views/3d/glTF/loader.js +1 -1
  50. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  51. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  52. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  53. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  54. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  55. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  56. package/views/3d/layers/i3s/I3SGraphicsMap.js +1 -1
  57. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  58. package/views/3d/support/buffer/glUtil.js +1 -1
  59. package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
  60. package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
  61. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  62. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
  63. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -10
  64. package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
  65. package/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js +1 -1
  66. package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
  67. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  68. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  69. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  70. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +9 -9
  71. package/views/VideoView.js +1 -1
  72. package/views/webgl/ShaderBuilder.js +1 -1
  73. package/views/webgl/Util.js +1 -1
  74. package/views/webgl/VertexElementDescriptor.js +1 -1
  75. package/widgets/Editor.js +1 -1
  76. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  77. package/assets/esri/core/workers/chunks/0a5427127634738aa239.js +0 -1
  78. package/assets/esri/core/workers/chunks/110429583b28c28c36ee.js +0 -1
  79. package/assets/esri/core/workers/chunks/145c6a7cdcc9893efb27.js +0 -1
  80. package/assets/esri/core/workers/chunks/1bacdd17e199e22b5cd1.js +0 -1
  81. package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +0 -1
  82. package/assets/esri/core/workers/chunks/5dc0d853c21ccb6054c7.js +0 -1
  83. package/assets/esri/core/workers/chunks/613cbac9cb925cd20b48.js +0 -1
  84. package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +0 -1
  85. package/assets/esri/core/workers/chunks/c4de24582c29fda5a033.js +0 -1
  86. package/assets/esri/core/workers/chunks/d786b17cc9062b1450ac.js +0 -1
  87. package/assets/esri/core/workers/chunks/d9958654c6438f28237b.js +0 -1
  88. package/assets/esri/core/workers/chunks/e6fa6f9c278589c8a713.js +0 -1
  89. package/assets/esri/core/workers/chunks/e7f4d135ef9665de1468.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import"../../../webgl/BufferObject.js";import{FramebufferObject as e}from"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as r}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as s,SizedPixelFormat as a}from"../../../webgl/enums.js";import"../../../webgl/checkWebGLError.js";import{initialSplatAtlasTextureHeight as i,GaussianSplatAtlasPages as o,splatAtlasTextureWidth as l,elementsPerSplatPage as h}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class p{constructor(t,e,r){this._splatAtlasTextureHeight=i,this.texture=null,this._rctx=t,this._fboCache=r,this.pageAllocator=new o,this._cache=e.newCache("gaussian texture cache",t=>t.dispose())}ensureTextureAtlas(){if(this.texture)return;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=l,e.pixelFormat=36249,e.dataType=s.UNSIGNED_INT,e.internalFormat=a.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new r(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const r=Math.floor(this._splatAtlasTextureHeight*t);if(r*l>this._rctx.parameters.maxPreferredTexturePixels)return!1;const s=new e(this._rctx,this.texture),a=this._fboCache.acquire(l,r,"gaussian splat atlas resize",11);return this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,l,this._splatAtlasTextureHeight,0,0,l,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=a.fbo?.detachColorTexture(),s.dispose(),a.dispose(),this._splatAtlasTextureHeight=r,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,r){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,h,1,r)}_updatePageAllocator(){const t=l*this._splatAtlasTextureHeight/h;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose()}}export{p as GaussianSplatTextureAtlas};
5
+ import{reallocGrowthFactor as t}from"../../../../core/arrayUtils.js";import"../../../webgl/BufferObject.js";import{FramebufferObject as e}from"../../../webgl/FramebufferObject.js";import"../../../webgl/Program.js";import"../../../../core/has.js";import"../../../webgl/Renderbuffer.js";import{Texture as r}from"../../../webgl/Texture.js";import"../../../../core/Logger.js";import{PixelType as s,SizedPixelFormat as a}from"../../../webgl/enums.js";import"../../../webgl/Util.js";import{initialSplatAtlasTextureHeight as i,GaussianSplatAtlasPages as o,splatAtlasTextureWidth as l,elementsPerSplatPage as h}from"./GaussianSplatAtlasPages.js";import{TextureDescriptor as u}from"../../../webgl/TextureDescriptor.js";class p{constructor(t,e,r){this._splatAtlasTextureHeight=i,this.texture=null,this._rctx=t,this._fboCache=r,this.pageAllocator=new o,this._cache=e.newCache("gaussian texture cache",t=>t.dispose())}ensureTextureAtlas(){if(this.texture)return;const t=this._cache.pop("splatTextureAtlas");if(t)return void(this.texture=t);const e=new u;e.height=this._splatAtlasTextureHeight,e.width=l,e.pixelFormat=36249,e.dataType=s.UNSIGNED_INT,e.internalFormat=a.RGBA32UI,e.samplingMode=9728,e.wrapMode=33071,e.isImmutable=!0,this.texture=new r(this._rctx,e),this._updatePageAllocator()}grow(){if(!this.texture)return this.ensureTextureAtlas(),!1;const r=Math.floor(this._splatAtlasTextureHeight*t);if(r*l>this._rctx.parameters.maxPreferredTexturePixels)return!1;const s=new e(this._rctx,this.texture),a=this._fboCache.acquire(l,r,"gaussian splat atlas resize",11);return this._rctx.blitFramebuffer(s,a.fbo,16384,9728,0,0,l,this._splatAtlasTextureHeight,0,0,l,this._splatAtlasTextureHeight),this.texture?.dispose(),this.texture=a.fbo?.detachColorTexture(),s.dispose(),a.dispose(),this._splatAtlasTextureHeight=r,this._updatePageAllocator(),!0}requestPage(){let t=this.pageAllocator.findFirstFreePage();return null===t&&this.grow()&&(t=this.pageAllocator.findFirstFreePage()),null!==t&&this.pageAllocator.allocate(t),t}freePage(t){this.pageAllocator.free(t)}update(t,e,r){this.ensureTextureAtlas(),this.texture.updateData(0,t,e,h,1,r)}_updatePageAllocator(){const t=l*this._splatAtlasTextureHeight/h;this.pageAllocator.pageCount!==t&&this.pageAllocator.resize(t)}clear(){this.texture&&(this._cache.put("splatTextureAtlas",this.texture),this.texture=null)}destroy(){this._cache.destroy(),this.texture?.dispose()}}export{p as GaussianSplatTextureAtlas};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as o}from"../../../../../../core/compilerUtils.js";import{DecodeSymbolColor as e}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as r}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as t}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as d}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as n,If as a}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as l}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as i}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{olidEnabled as s}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as c,componentDataOlidLayout as m}from"../../../materials/DefaultLayouts.js";function u(e,r){switch(r.componentData){case 1:return M(e,r);case 0:return h(e,r);case 2:return;default:o(r.componentData)}}const v=(o,e)=>"emissiveSourceMode"===o||"emissiveStrength"===o?e.hasEmission:"olidColor"!==o||9===e.output,f=new i("componentTextureBuffer",o=>o.textureBackedBuffer?.texture),C=new r(c,"componentIndex",f,v),x=new r(m,"componentIndex",f,v);function p(){return s()?x:C}function M(o,r){const{vertex:t,fragment:d}=o,{output:l,hasEmission:i}=r,s=9===l,{getTextureAttribute:c,TextureBackedBufferModule:m}=p();o.include(m,r),o.attributes.add("componentIndex","float"),o.varyings.add("vExternalColorMixMode","mediump float"),o.varyings.add("vExternalColor","vec4"),s&&o.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(o.varyings.add("emissiveStrength","float"),o.varyings.add("emissiveSource","int")),o.include(e),t.code.add(n`
5
+ import{neverReached as o}from"../../../../../../core/compilerUtils.js";import{DecodeSymbolColor as e}from"./DecodeSymbolColor.glsl.js";import{TextureBackedBufferModule as r}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{Float4DrawUniform as t}from"../../../core/shaderModules/Float4DrawUniform.js";import{FloatDrawUniform as d}from"../../../core/shaderModules/FloatDrawUniform.js";import{glsl as n,If as a}from"../../../core/shaderModules/glsl.js";import{IntegerDrawUniform as l}from"../../../core/shaderModules/IntegerDrawUniform.js";import{Texture2DUintDrawUniform as i}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{olidEnabled as s}from"../../../effects/geometry/olidUtils.js";import{componentDataLayout as c,componentDataOlidLayout as m}from"../../../materials/DefaultLayouts.js";function u(e,r){switch(r.componentData){case 1:return M(e,r);case 0:return h(e,r);case 2:return;default:o(r.componentData)}}const v=(o,e)=>"emissiveSourceMode"===o||"emissiveStrength"===o?e.hasEmission:"olidColor"!==o||9===e.output,C=new i("componentTextureBuffer",o=>o.textureBackedBuffer?.texture),f=new r(c,"componentIndex",C,v),x=new r(m,"componentIndex",C,v);function p(){return s()?x:f}function M(o,r){const{vertex:t,fragment:d}=o,{output:l,hasEmission:i}=r,s=9===l,{getTextureAttribute:c,TextureBackedBufferModule:m}=p();o.include(m,r),o.attributes.add("componentIndex","uint"),o.varyings.add("vExternalColorMixMode","mediump float"),o.varyings.add("vExternalColor","vec4"),s&&o.varyings.add("vObjectAndLayerIdColor","vec4"),i&&(o.varyings.add("emissiveStrength","float"),o.varyings.add("emissiveSource","int")),o.include(e),t.code.add(n`
6
6
  float readElevationOffset() {
7
7
  return ${c("elevationOffset")};
8
8
  }
@@ -2,13 +2,13 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{generateUID as e}from"../../../../../core/uid.js";import{unpackFloat4x8 as t,unpackHalf2x8 as o,glslType as d,glslDecodeField as a}from"./TextureBackedBufferFields.glsl.js";import{glsl as r}from"../shaderModules/glsl.js";import{assert as n}from"../../lib/Util.js";class i{constructor(t,o,d,a=()=>!0){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`,this.TextureBackedBufferModule=(e,r)=>c(this.namespace,e,r,o,d,t,a),this.getTextureAttribute=s(this.namespace)}}function c(e,i,c,s,l,u,m){const{vertex:$}=i;$.include(t),$.include(o);const x=`${e}tbbStride`,h=`${e}TextureBackedBufferItemData`,p=`${e}fetchTextureBackedBufferItemData`,B=f(e);for(const t of[x,h,p,B])n(t.length<1024,"Identifiers do not have a valid length");$.constants.add(x,"float",u.texelStride),$.uniforms.add(l);const I=new Array;for(const t of u.fields.values())m(t.name,c)&&I.push(t);if(0===I.length)return;const g=[];for(let t=0;t<u.texelStride;++t)g.push(!1);for(const t of I)for(let e=0;e<t.numTexels;++e)g[t.startTexel+e]=!0;$.code.add(r`
6
- struct ${h} {`);for(const t of I)$.code.add(r`\t${d(t)} ${t.name};`);$.code.add(r`};`),$.code.add(r`
7
- ${h} ${p}(float itemIndex) {
8
- ${h} itemData;
9
- float index = itemIndex * ${x};
10
- float texSize = float(textureSize(${l.name}, 0).x);
11
- float coordX = mod(index, texSize) + 0.5;
12
- float coordY = floor(index / texSize) + 0.5;
13
- `);for(let t=0;t<g.length;++t)!1!==g[t]&&$.code.add(r`lowp uvec4 texel${r.int(t)} = texelFetch(${l.name}, ivec2(coordX + ${r.float(t)}, coordY), 0);`);for(const t of I)$.code.add(r`itemData.${t.name} = ${a(t)};`);$.code.add(r`return itemData;
14
- }`),$.code.add(r`${h} ${B};`),$.main.add(r`${B} = ${p}(${s});`)}function s(e){const t=f(e);return e=>r`${t}.${e}`}function f(e){return`${e}ItemData`}export{i as TextureBackedBufferModule};
5
+ import{generateUID as e}from"../../../../../core/uid.js";import{unpackFloat4x8 as t,unpackHalf2x8 as o,glslType as d,glslDecodeField as n}from"./TextureBackedBufferFields.glsl.js";import{glsl as i}from"../shaderModules/glsl.js";import{assert as r}from"../../lib/Util.js";class a{constructor(t,o,d,n=()=>!0){this.moduleId=e(),this.namespace=`_tbb_${this.moduleId}_`,this.TextureBackedBufferModule=(e,i)=>c(this.namespace,e,i,o,d,t,n),this.getTextureAttribute=s(this.namespace)}}function c(e,a,c,s,f,l,m){const{vertex:h}=a;h.include(t),h.include(o);const $=`${e}tbbStride`,x=`${e}TextureBackedBufferItemData`,p=`${e}fetchTextureBackedBufferItemData`,g=u(e);for(const t of[$,x,p,g])r(t.length<1024,"Identifiers do not have a valid length");h.constants.add($,"uint",l.texelStride),h.uniforms.add(f);const B=new Array;for(const t of l.fields.values())m(t.name,c)&&B.push(t);if(0===B.length)return;const I=[];for(let t=0;t<l.texelStride;++t)I.push(!1);for(const t of B)for(let e=0;e<t.numTexels;++e)I[t.startTexel+e]=!0;h.code.add(i`
6
+ struct ${x} {`);for(const t of B)h.code.add(i`\t${d(t)} ${t.name};`);h.code.add(i`};`),h.code.add(i`
7
+ ${x} ${p}(highp uint itemIndex) {
8
+ ${x} itemData;
9
+ highp uint index = itemIndex * ${$};
10
+ highp uint rowWidth = uint(textureSize(${f.name}, 0).x);
11
+ int coordX = int(index % rowWidth);
12
+ int coordY = int(index / rowWidth);
13
+ `);for(let t=0;t<I.length;++t)!1!==I[t]&&h.code.add(i`lowp uvec4 texel${i.int(t)} = texelFetch(${f.name}, ivec2(coordX + ${i.int(t)}, coordY), 0);`);for(const t of B)h.code.add(i`itemData.${t.name} = ${n(t)};`);h.code.add(i`return itemData;
14
+ }`),h.code.add(i`${x} ${g};`),h.main.add(i`${g} = ${p}(${s});`)}function s(e){const t=u(e);return e=>i`${t}.${e}`}function u(e){return`${e}ItemData`}export{a as TextureBackedBufferModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{glLayout as e}from"../../../support/buffer/glUtil.js";import{newLayout as o}from"../../../support/buffer/InterleavedLayout.js";import{TextureBackedBufferLayout as t}from"../TextureBackedBuffer/TextureBackedBufferLayout.js";import{fromLayouts as r}from"../../../../webgl/VertexAttributeLocations.js";const n=o().vec3f("position").u16("componentIndex").freeze(),i=o().vec2u8("sideness").freeze(),a=e(i),m=o().vec3f("position0").vec3f("position1").vec2i16("normalCompressed").u16("componentIndex").u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).freeze(),f=o().vec3f("position0").vec3f("position1").vec2i16("normalCompressed").vec2i16("normal2Compressed").u16("componentIndex").u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).freeze(),p=e(m,1),s=e(f,1),u=r([a,p]),c=r([a,s]),l=new t([{name:"color",type:"vec4unorm8"},{name:"lineWidth",type:"u8"},{name:"extensionLength",type:"u8"},{name:"materialType",type:"u8"},{name:"opacity",type:"unorm8"},{name:"elevationOffset",type:"f32"}]);export{n as EdgeInputBufferLayout,p as RegularEdgeInstancesGLLayout,m as RegularEdgeInstancesLayout,u as RegularEdgeLocations,s as SilhouetteEdgeInstancesGLLayout,f as SilhouetteEdgeInstancesLayout,c as SilhouetteEdgeLocations,i as VertexLayout,l as edgeViewTextureLayout,a as glVertexLayout};
5
+ import{glLayout as e}from"../../../support/buffer/glUtil.js";import{newLayout as t}from"../../../support/buffer/InterleavedLayout.js";import{TextureBackedBufferLayout as o}from"../TextureBackedBuffer/TextureBackedBufferLayout.js";import{fromLayouts as r}from"../../../../webgl/VertexAttributeLocations.js";const n=t().vec3f("position").u16("componentIndex",{integer:!0}).freeze(),i=t().vec2u8("sideness").freeze(),a=e(i),m=t().vec3f("position0").vec3f("position1").vec2i16("normalCompressed").u16("componentIndex",{integer:!0}).u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).freeze(),f=t().vec3f("position0").vec3f("position1").vec2i16("normalCompressed").vec2i16("normal2Compressed").u16("componentIndex",{integer:!0}).u8("variantOffset",{glNormalized:!0}).u8("variantStroke").u8("variantExtension",{glNormalized:!0}).freeze(),p=e(m,1),s=e(f,1),u=r([a,p]),c=r([a,s]),l=new o([{name:"color",type:"vec4unorm8"},{name:"lineWidth",type:"u8"},{name:"extensionLength",type:"u8"},{name:"materialType",type:"u8"},{name:"opacity",type:"unorm8"},{name:"elevationOffset",type:"f32"}]);export{n as EdgeInputBufferLayout,p as RegularEdgeInstancesGLLayout,m as RegularEdgeInstancesLayout,u as RegularEdgeLocations,s as SilhouetteEdgeInstancesGLLayout,f as SilhouetteEdgeInstancesLayout,c as SilhouetteEdgeLocations,i as VertexLayout,l as edgeViewTextureLayout,a as glVertexLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{deduplicate as e}from"../../../../../geometry/support/meshUtils/deduplicate.js";import{computeNeighbors as t}from"../../../support/meshProcessing.js";import{newLayout as i}from"../../../support/buffer/InterleavedLayout.js";import{EdgeInputBufferLayout as s}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as r,SilhouetteEdgeBufferWriter as n}from"./edgeBufferWriters.js";import{extractEdges as o}from"./edgePreprocessing.js";function c(e){const t=f(e.data,e.skipDeduplicate,e.indices,e.indicesLength);return p.updateSettings(e.writerSettings),d.updateSettings(e.writerSettings),o(t,p,d)}function f(i,r,n,o){if(r){const e=t(n,o,i.count);return new u(n,o,e,i)}const c=e(i.buffer,i.stride/4,{originalIndices:n}),f=t(c.indices,o,c.uniqueCount);return{faces:c.indices,facesLength:c.indices.length,neighbors:f,vertices:s.createView(c.buffer)}}class u{constructor(e,t,i,s){this.faces=e,this.facesLength=t,this.neighbors=i,this.vertices=s}}const p=new r,d=new n,a=i().vec3f("position0").vec3f("position1"),g=i().vec3f("position0").vec3f("position1").u16("componentIndex");export{c as extract,g as extractComponentsEdgeLocationsLayout,f as extractEdgeInformation,a as extractEdgeLocationsLayout};
5
+ import{deduplicate as e}from"../../../../../geometry/support/meshUtils/deduplicate.js";import{computeNeighbors as t}from"../../../support/meshProcessing.js";import{newLayout as i}from"../../../support/buffer/InterleavedLayout.js";import{EdgeInputBufferLayout as s}from"./bufferLayouts.js";import{RegularEdgeBufferWriter as r,SilhouetteEdgeBufferWriter as n}from"./edgeBufferWriters.js";import{extractEdges as o}from"./edgePreprocessing.js";function c(e){const t=f(e.data,e.skipDeduplicate,e.indices,e.indicesLength);return p.updateSettings(e.writerSettings),d.updateSettings(e.writerSettings),o(t,p,d)}function f(i,r,n,o){if(r){const e=t(n,o,i.count);return new u(n,o,e,i)}const c=e(i.buffer,i.stride/4,{originalIndices:n}),f=t(c.indices,o,c.uniqueCount);return{faces:c.indices,facesLength:c.indices.length,neighbors:f,vertices:s.createView(c.buffer)}}class u{constructor(e,t,i,s){this.faces=e,this.facesLength=t,this.neighbors=i,this.vertices=s}}const p=new r,d=new n,g=i().vec3f("position0").vec3f("position1"),a=i().vec3f("position0").vec3f("position1").u16("componentIndex",{integer:!0});export{c as extract,a as extractComponentsEdgeLocationsLayout,f as extractEdgeInformation,g as extractEdgeLocationsLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{glLayout as e}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as f}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";const r=o().vec3f("position").freeze(),i=o().vec3f("position").vec2f16("uv0").freeze(),n=o().vec3f("position").vec4u8("color").freeze(),u=o().vec3f("position").vec2f("uv0").freeze(),c=o().vec3f("position").vec2f("uv0").vec4u8("olidColor").freeze(),s=e(o().u16("componentIndex")),p=[{name:"colorAndCastShadows",type:"vec4u8"},{name:"elevationOffset",type:"f32"},{name:"emissiveStrength",type:"f16"},{name:"emissiveSourceMode",type:"u8"}],v={name:"olidColor",type:"vec4u8"},m=new f(p),a=new f([...p,v]);function l(){return t()?a:m}export{n as PositionColorLayout,r as PositionLayout,i as PositionUvLayout,u as PositionUvf32Layout,c as PositionUvf32OlidLayout,m as componentDataLayout,a as componentDataOlidLayout,l as getComponentDataLayout,s as indexGlLayout};
5
+ import{glLayout as e}from"../../support/buffer/glUtil.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{olidEnabled as t}from"../effects/geometry/olidUtils.js";import{TextureBackedBufferLayout as r}from"../lib/TextureBackedBuffer/TextureBackedBufferLayout.js";const f=o().vec3f("position").freeze(),i=o().vec3f("position").vec2f16("uv0").freeze(),n=o().vec3f("position").vec4u8("color").freeze(),u=o().vec3f("position").vec2f("uv0").freeze(),c=o().vec3f("position").vec2f("uv0").vec4u8("olidColor").freeze(),s=e(o().u16("componentIndex",{integer:!0})),p=[{name:"colorAndCastShadows",type:"vec4u8"},{name:"elevationOffset",type:"f32"},{name:"emissiveStrength",type:"f16"},{name:"emissiveSourceMode",type:"u8"}],v={name:"olidColor",type:"vec4u8"},m=new r(p),a=new r([...p,v]);function l(){return t()?a:m}export{n as PositionColorLayout,f as PositionLayout,i as PositionUvLayout,u as PositionUvf32Layout,c as PositionUvf32OlidLayout,m as componentDataLayout,a as componentDataOlidLayout,l as getComponentDataLayout,s as indexGlLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{m as e,h as r,d as t,n as s,e as a,b as i,j as o,g as n,t as l}from"../../../../chunks/vec32.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLikeOutput as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as S}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as M,DefaultMaterialTechnique as O}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as w}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class y extends T{constructor(e,r){super(e,D),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new C(r.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:r,opacity:t,externalColor:s}=this.parameters;return e*("replace"===r?1:t)*("ignore"===r||isNaN(s[3])?1:s[3])>=R}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,r){const{parameters:t,_configuration:s}=this,{treeRendering:a,doubleSided:i,doubleSidedType:o}=t;return super.getConfiguration(e,r,this._configuration),s.hasNormalTexture=t.hasNormalTexture,s.hasColorTexture=t.hasColorTexture,s.hasMetallicRoughnessTexture=t.hasMetallicRoughnessTexture,s.hasOcclusionTexture=t.hasOcclusionTexture,s.hasVertexTangents=!a&&t.hasVertexTangents,s.instanced=t.instanced,s.instancedDoublePrecision=t.instancedDoublePrecision,s.hasVVColor=!!t.vvColor,s.hasVVSize=!!t.vvSize,s.hasVerticalOffset=null!=t.verticalOffset,s.hasScreenSizePerspective=null!=t.screenSizePerspective,s.hasSlicePlane=t.hasSlicePlane,s.alphaDiscardMode=t.textureAlphaMode,s.normalType=a?0:t.normalType,s.transparent=this.transparent,s.writeDepth=t.writeDepth,s.customDepthTest=t.customDepthTest??0,s.hasOccludees=r.hasOccludees,s.cullFace=t.hasSlicePlane?0:t.cullFace,s.cullAboveTerrain=r.cullAboveTerrain,s.hasModelTransformation=!a&&null!=t.modelTransformation,s.hasVertexColors=t.hasVertexColors,s.hasSymbolColors=t.hasSymbolColors,s.doubleSidedMode=a?2:i&&"normal"===o?1:i&&"winding-order"===o?2:0,s.instancedFeatureAttribute=t.instancedFeatureAttribute,s.instancedColor=t.instancedColor,d(e)?(s.terrainDepthTest=r.terrainDepthTest,s.receiveShadows=t.receiveShadows,s.receiveAmbientOcclusion=t.receiveAmbientOcclusion&&null!=r.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!t.textureAlphaPremultiplied,s.pbrMode=t.usePBR?t.isSchematic?2:1:0,s.emissionSource=t.emissionSource,s.offsetBackfaces=!(!this.transparent||!t.offsetTransparentBackfaces),s.oitPass=r.oitPass,s.enableOffset=r.enableOffset,s.snowCover=r.snowCover>0,s.hasColorTextureTransform=!!t.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!t.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!t.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!t.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!t.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;r(N,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(I,N);break;case 2:p=t(I,B)}let d=0;const f=a(z,N,e.eye),T=i(f),x=o(f,f,1/T);let g=null;this.parameters.screenSizePerspective&&(g=n(p,x)),d+=S(e,T,this.parameters.verticalOffset,g??0,this.parameters.screenSizePerspective,null),o(p,p,d),l(_,p,c.transform.inverseRotation),h=a(A,h,_),m=a(V,m,_)}x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new P(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return j(this.parameters)}}class P extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const t=this._material.parameters;this.updateTexture(t.textureId);const s=e.camera.viewInverseTransposeMatrix;return r(t.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(t.treeRendering?w:O,e)}}class D extends M{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function j(e){const{drivenOpacity:r,opacity:t,externalColor:s,layerOpacity:a,texture:i,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return r||t<1&&"replace"!==l||u<1&&"ignore"!==l||a<1||(null!=i||null!=o)&&1!==n&&2!==n&&"replace"!==l}const A=c(),V=c(),B=h(0,0,1),I=c(),_=c(),N=c(),z=c();export{P as DefaultGLMaterial,y as DefaultMaterial,D as DefaultMaterialParameters,j as isTransparent};
5
+ import{m as e,h as t,d as r,n as s,e as i,b as a,j as o,g as n,t as l}from"../../../../chunks/vec32.js";import{ZEROS as u,create as c,fromValues as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{is3DGeometryOutputMRT as m,isShadowLikeOutput as p,isColor as d}from"../core/shaderLibrary/ShaderOutput.js";import{GLTextureMaterial as f}from"../lib/GLTextureMaterial.js";import{Material as T}from"../lib/Material.js";import{intersectTriangleGeometry as x}from"../lib/RayIntersections.js";import{getVerticalOffsetObject3D as g}from"../lib/verticalOffsetUtils.js";import{DefaultBufferWriter as v}from"./DefaultBufferWriter.js";import{verticalOffsetAtDistance as S}from"./internal/MaterialUtil.js";import{getLayout as b,DefaultMaterialPassParameters as M,DefaultMaterialTechnique as O}from"../shaders/DefaultMaterialTechnique.js";import{DefaultMaterialTechniqueConfiguration as C}from"../shaders/DefaultMaterialTechniqueConfiguration.js";import{RealisticTreeTechnique as w}from"../shaders/RealisticTreeTechnique.js";import{alphaCutoff as R}from"../../../../webscene/support/AlphaCutoff.js";class y extends T{constructor(e,t){super(e,D),this.materialType="default",this.supportsEdges=!0,this.intersectDraped=void 0,this.produces=new Map([[2,e=>(m(e)||p(e))&&!this.transparent],[4,e=>(m(e)||p(e))&&this.transparent&&this.parameters.writeDepth],[9,e=>(m(e)||p(e))&&this.transparent&&!this.parameters.writeDepth]]),this._layout=b(this.parameters),this._configuration=new C(t.spherical)}isVisibleForOutput(e){return 3!==e&&5!==e&&4!==e||this.parameters.castShadows}get visible(){const{layerOpacity:e,colorMixMode:t,opacity:r,externalColor:s}=this.parameters;return e*("replace"===t?1:r)*("ignore"===t||isNaN(s[3])?1:s[3])>=R}get _hasEmissiveBase(){return!!this.parameters.emissiveTextureId||!e(this.parameters.emissiveBaseColor,u)}get hasEmissions(){return this.parameters.emissiveStrength>0&&(0===this.parameters.emissiveSource&&this._hasEmissiveBase||1===this.parameters.emissiveSource)}getConfiguration(e,t){const{parameters:r,_configuration:s}=this,{treeRendering:i,doubleSided:a,doubleSidedType:o}=r;return super.getConfiguration(e,t,this._configuration),s.hasNormalTexture=r.hasNormalTexture,s.hasColorTexture=r.hasColorTexture,s.hasMetallicRoughnessTexture=r.hasMetallicRoughnessTexture,s.hasOcclusionTexture=r.hasOcclusionTexture,s.hasVertexTangents=!i&&r.hasVertexTangents,s.instanced=r.instanced,s.instancedDoublePrecision=r.instancedDoublePrecision,s.hasVVColor=!!r.vvColor,s.hasVVSize=!!r.vvSize,s.hasVerticalOffset=null!=r.verticalOffset,s.hasScreenSizePerspective=null!=r.screenSizePerspective,s.hasSlicePlane=r.hasSlicePlane,s.alphaDiscardMode=r.textureAlphaMode,s.normalType=i?0:r.normalType,s.transparent=this.transparent,s.writeDepth=r.writeDepth,s.customDepthTest=r.customDepthTest??0,s.hasOccludees=t.hasOccludees,s.cullFace=r.hasSlicePlane?0:r.cullFace,s.cullAboveTerrain=t.cullAboveTerrain,s.hasModelTransformation=!i&&null!=r.modelTransformation,s.hasVertexColors=r.hasVertexColors,s.hasSymbolColors=r.hasSymbolColors,s.doubleSidedMode=i?2:a&&"normal"===o?1:a&&"winding-order"===o?2:0,s.instancedFeatureAttribute=r.instancedFeatureAttribute,s.instancedColor=r.instancedColor,d(e)?(s.terrainDepthTest=t.terrainDepthTest,s.receiveShadows=r.receiveShadows,s.receiveAmbientOcclusion=r.receiveAmbientOcclusion&&null!=t.ssao):(s.terrainDepthTest=!1,s.receiveShadows=s.receiveAmbientOcclusion=!1),s.textureAlphaPremultiplied=!!r.textureAlphaPremultiplied,s.pbrMode=r.usePBR?r.isSchematic?2:1:0,s.emissionSource=r.emissionSource,s.offsetBackfaces=!(!this.transparent||!r.offsetTransparentBackfaces),s.oitPass=t.oitPass,s.enableOffset=t.enableOffset,s.snowCover=t.snowCover>0,s.hasColorTextureTransform=!!r.colorTextureTransformMatrix,s.hasNormalTextureTransform=!!r.normalTextureTransformMatrix,s.hasEmissionTextureTransform=!!r.emissiveTextureTransformMatrix,s.hasOcclusionTextureTransform=!!r.occlusionTextureTransformMatrix,s.hasMetallicRoughnessTextureTransform=!!r.metallicRoughnessTextureTransformMatrix,s}intersect(e,u,c,h,m,p){if(null!=this.parameters.verticalOffset){const e=c.camera;t(N,u[12],u[13],u[14]);let p=null;switch(c.viewingMode){case 1:p=s(I,N);break;case 2:p=r(I,B)}let d=0;const f=i(z,N,e.eye),T=a(f),x=o(f,f,1/T);let g=null;this.parameters.screenSizePerspective&&(g=n(p,x)),d+=S(e,T,this.parameters.verticalOffset,g??0,this.parameters.screenSizePerspective,null),o(p,p,d),l(_,p,c.transform.inverseRotation),h=i(A,h,_),m=i(V,m,_)}x(e,c,h,m,g(c.verticalOffset),p)}createGLMaterial(e){return new P(e)}createBufferWriter(){return new v(this._layout)}get transparent(){return j(this.parameters)}}class P extends f{constructor(e){super({...e,...e.material.parameters})}beginSlot(e){this._material.setParameters({receiveShadows:e.shadowMap.enabled});const r=this._material.parameters;this.updateTexture(r.textureId);const s=e.camera.viewInverseTransposeMatrix;return t(r.origin,s[3],s[7],s[11]),this._material.setParameters(this.textureBindParameters),this.getTechnique(r.treeRendering?w:O,e)}}class D extends M{constructor(){super(...arguments),this.treeRendering=!1,this.hasVertexTangents=!1}get hasNormalTexture(){return!this.treeRendering&&!!this.normalTextureId}get hasColorTexture(){return!!this.textureId}get hasMetallicRoughnessTexture(){return!this.treeRendering&&!!this.metallicRoughnessTextureId}get hasOcclusionTexture(){return!this.treeRendering&&!!this.occlusionTextureId}get emissiveStrength(){return this.emissiveStrengthFromSymbol*this.emissiveStrengthKHR}get emissionSource(){return this.treeRendering?0:null!=this.emissiveTextureId&&0===this.emissiveSource?3:this.usePBR?0===this.emissiveSource?2:1:0}get hasTextures(){return this.hasColorTexture||this.hasNormalTexture||this.hasMetallicRoughnessTexture||3===this.emissionSource||this.hasOcclusionTexture}}function j(e){const{drivenOpacity:t,opacity:r,externalColor:s,layerOpacity:i,texture:a,textureId:o,textureAlphaMode:n,colorMixMode:l}=e,u=s[3];return t||r<1&&"replace"!==l||u<1&&"ignore"!==l||i<1||(null!=a||null!=o)&&1!==n&&2!==n&&"replace"!==l}const A=c(),V=c(),B=h(0,0,1),I=c(),_=c(),N=c(),z=c();export{P as DefaultGLMaterial,y as DefaultMaterial,D as DefaultMaterialParameters,j as isTransparent};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as a}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as n}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as c,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as u}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as p,depthTest as f,blending as h,drawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as b,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{advancedMRRFactors as j}from"./pbrUtils.js";import{P as v}from"../../../../chunks/Path.glsl.js";import{makePipelineState as S,defaultColorWrite as y,defaultDepthWrite as P,frontFaceCullingParams as T}from"../../../webgl/renderState.js";class V extends a{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=j,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=s}}let x=class extends c{constructor(e,r){super(e,r,z(r).locations),this.shader=new n(v,()=>import("../shaders/Path.glsl.js"))}initializePipeline(e){const{output:r,hasEmission:t,transparent:i,hasSlicePlane:s,doubleSidedMode:o,hasOccludees:a,oitPass:n}=e,c=0===n,u=2===n;return S({blending:l(r)&&i?h(n):null,culling:s&&!i&&0!==o?T:null,depthTest:f(n),depthWrite:c||u?P:null,drawBuffers:m(r,d(n,t)),colorWrite:y,stencilWrite:a?g:null,stencilTest:a?b:null,polygonOffset:c||u?null:p})}};function z(e){const r=o().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),u()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}x=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],x);export{V as PathPassParameters,x as PathTechnique,z as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{freeze as t,create as i,ZEROS as s}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{newLayout as o}from"../../support/buffer/InterleavedLayout.js";import{isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{PathVertexPositionPassParameters as a}from"../core/shaderLibrary/attributes/PathVertexPosition.glsl.js";import{ReloadableShader as n}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m,depthOnlyOutputBuffersOr as c}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as u}from"../effects/geometry/olidUtils.js";import{OITPolygonOffset as h,depthTest as p,blending as f,drawBuffers as d}from"../lib/OrderIndependentTransparency.js";import{stencilBaseAllZerosParams as b,stencilWriteMaskOn as g}from"../lib/StencilUtils.js";import{advancedMRRFactors as S}from"./pbrUtils.js";import{P as j}from"../../../../chunks/Path.glsl.js";import{makePipelineState as v,defaultColorWrite as y,defaultDepthWrite as P,frontFaceCullingParams as T}from"../../../webgl/renderState.js";class V extends a{constructor(){super(...arguments),this.ambient=t(.2,.2,.2),this.diffuse=t(.8,.8,.8),this.opacity=1,this.origin=i(),this.modelTransformation=null,this.mrrFactors=S,this.emissiveStrengthFromSymbol=0,this.emissiveSource=1,this.emissiveBaseColor=s}get emissiveStrength(){return this.emissiveStrengthFromSymbol}}let x=class extends m{constructor(e,r){super(e,r,z(r).locations),this.shader=new n(j,()=>import("../shaders/Path.glsl.js"))}initializePipeline(e){const{output:r,hasEmission:t,transparent:i,hasSlicePlane:s,doubleSidedMode:o,hasOccludees:a,oitPass:n}=e,m=0===n,u=2===n;return v({blending:l(r)&&i?f(n):null,culling:s&&!i&&0!==o?T:null,depthTest:p(n),depthWrite:m||u?P:null,drawBuffers:c(r,d(n,t)),colorWrite:y,stencilWrite:a?g:null,stencilTest:a?b:null,polygonOffset:m||u?null:h})}};function z(e){const r=o().vec3f("position").vec4f16("profileVertexAndNormal").vec2i16("profileRight",{glNormalized:!0}).vec2i16("profileUp",{glNormalized:!0});return e.hasVVSize&&r.f32("sizeFeatureAttribute"),e.hasVVColor&&r.f32("colorFeatureAttribute"),e.hasVVOpacity&&r.f32("opacityFeatureAttribute"),u()&&r.vec4u8("olidColor"),r.vec3f16("profileAuxData"),r.freeze()}x=e([r("esri.views.3d.webgl-engine.materials.PathTechnique")],x);export{V as PathPassParameters,x as PathTechnique,z as getLayout};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as p,depthOnlyOutputBuffersOr as m}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as w,defaultColorWrite as D}from"../../../webgl/renderState.js";import{fromLayouts as V}from"../../../webgl/VertexAttributeLocations.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class M extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrength=0,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=A,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class k extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let z=class extends p{constructor(e,t){const i=[l(R(t))];t.instanced&&t.instancedDoublePrecision&&i.push(l(C(t))),super(e,t,V(i)),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:L(e)?w(l):null,depthTest:b(i,F(n)),depthWrite:v(e),drawBuffers:m(s,S(i,r)),colorWrite:D,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function F(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function L(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function R(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}z=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],z);export{k as DefaultMaterialDrawParameters,M as DefaultMaterialPassParameters,z as DefaultMaterialTechnique,R as getLayout};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../../core/accessorSupport/decorators.js";import{ZEROS as i,freeze as s,create as r}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as o}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{glLayout as l}from"../../support/buffer/glUtil.js";import{newLayout as n}from"../../support/buffer/InterleavedLayout.js";import{isColor as a}from"../core/shaderLibrary/ShaderOutput.js";import{VertexNormalPassParameters as c,VertexNormalDrawParameters as h}from"../core/shaderLibrary/attributes/VertexNormal.glsl.js";import{ReloadableShader as u}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as m,depthOnlyOutputBuffersOr as p}from"../core/shaderTechnique/ShaderTechnique.js";import{olidEnabled as d}from"../effects/geometry/olidUtils.js";import{oitPolygonOffset as f,depthWrite as v,depthTest as b,blending as g,drawBuffers as S}from"../lib/OrderIndependentTransparency.js";import{stencilToolMaskBaseParams as y,stencilBaseAllZerosParams as j,stencilWriteMaskOn as x}from"../lib/StencilUtils.js";import{getRenderInstanceDataLayout as C}from"../lib/lodRendering/RenderInstanceData.js";import{advancedMRRFactors as P}from"../materials/pbrUtils.js";import{D as T}from"../../../../chunks/DefaultMaterial.glsl.js";import{makePipelineState as O,cullingParams as w,defaultColorWrite as D}from"../../../webgl/renderState.js";import{fromLayouts as V}from"../../../webgl/VertexAttributeLocations.js";import{alphaCutoff as A}from"../../../../webscene/support/AlphaCutoff.js";class M extends c{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=P,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=2,this.instanced=!1,this.instancedFeatureAttribute=!1,this.instancedColor=!1,this.instanceColorEncodesAlphaIgnore=!1,this.emissiveStrengthFromSymbol=0,this.emissiveStrengthKHR=1,this.emissiveSource=1,this.emissiveBaseColor=i,this.instancedDoublePrecision=!1,this.normalType=0,this.receiveShadows=!0,this.receiveAmbientOcclusion=!0,this.castShadows=!0,this.ambient=s(.2,.2,.2),this.diffuse=s(.8,.8,.8),this.externalColor=o(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=r(),this.hasSlicePlane=!1,this.offsetTransparentBackfaces=!1,this.vvSize=null,this.vvColor=null,this.vvOpacity=null,this.vvSymbolAnchor=null,this.vvSymbolRotationMatrix=null,this.modelTransformation=null,this.drivenOpacity=!1,this.writeDepth=!0,this.customDepthTest=0,this.textureAlphaMode=0,this.textureAlphaCutoff=A,this.textureAlphaPremultiplied=!1,this.renderOccluded=1,this.isDecoration=!1}get hasVVSize(){return!!this.vvSize}get hasVVColor(){return!!this.vvColor}get hasVVOpacity(){return!!this.vvOpacity}}class F extends h{constructor(){super(...arguments),this.origin=r(),this.slicePlaneLocalOrigin=this.origin}}let R=class extends m{constructor(e,t){const i=[l(L(t))];t.instanced&&t.instancedDoublePrecision&&i.push(l(C(t))),super(e,t,V(i)),this.shader=new u(T,()=>import("./DefaultMaterial.glsl.js"))}_makePipeline(e,t){const{oitPass:i,output:s,hasEmission:r,transparent:o,cullFace:l,customDepthTest:n,hasOccludees:c}=e;return O({blending:a(s)&&o?g(i):null,culling:z(e)?w(l):null,depthTest:b(i,k(n)),depthWrite:v(e),drawBuffers:p(s,S(i,r)),colorWrite:D,stencilWrite:c?x:null,stencilTest:c?t?y:j:null,polygonOffset:f(e)})}initializePipeline(e){return this._occludeePipelineState=this._makePipeline(e,!0),this._makePipeline(e,!1)}getPipeline(e,t){return t?this._occludeePipelineState:super.getPipeline(e)}};function k(e){switch(e){case 1:return 515;case 0:case 3:return 513;case 2:return 516}}function z(e){return 0!==e.cullFace||!e.hasSlicePlane&&(!e.transparent&&!e.doubleSidedMode)}function L(e){const t=n().vec3f("position");return 1===e.normalType?t.vec2i16("normalCompressed",{glNormalized:!0}):t.vec3f("normal"),e.hasVertexTangents&&t.vec4f("tangent"),e.hasTextures&&t.vec2f16("uv0"),e.hasVertexColors&&t.vec4u8("color"),e.hasSymbolColors&&t.vec4u8("symbolColor"),!e.instanced&&d()&&t.vec4u8("olidColor"),t}R=e([t("esri.views.3d.webgl-engine.shaders.DefaultMaterialTechnique")],R);export{F as DefaultMaterialDrawParameters,M as DefaultMaterialPassParameters,R as DefaultMaterialTechnique,L as getLayout};
@@ -2,7 +2,7 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as l}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as n}from"../../../core/shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as m}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintDrawUniform as s}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{edgeViewTextureLayout as i}from"../../../lib/edgeRendering/bufferLayouts.js";const c=new o(i,"componentIndex",new s("componentTextureBuffer",o=>o.componentDataTextureBuffer?.texture));function f(o,s){const{vertex:i}=o;o.include(e,s);const{silhouette:f,legacy:u,spherical:v}=s;o.attributes.add("componentIndex","float");const{getTextureAttribute:w,TextureBackedBufferModule:p}=c;o.include(p);const F=8,M=128;i.constants.add("lineWidthFractionFactor","float",F),i.constants.add("extensionLengthOffset","float",M),i.code.add(l`
5
+ import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBackedBuffer.glsl.js";import{NormalAttribute as e}from"../../../core/shaderLibrary/attributes/NormalAttribute.glsl.js";import{DoublePrecision as r}from"../../../core/shaderLibrary/util/DoublePrecision.glsl.js";import{Float3DrawUniform as t}from"../../../core/shaderModules/Float3DrawUniform.js";import{Float3PassUniform as a}from"../../../core/shaderModules/Float3PassUniform.js";import{glsl as l}from"../../../core/shaderModules/glsl.js";import{Matrix3DrawUniform as n}from"../../../core/shaderModules/Matrix3DrawUniform.js";import{Matrix3PassUniform as d}from"../../../core/shaderModules/Matrix3PassUniform.js";import{Matrix4BindUniform as m}from"../../../core/shaderModules/Matrix4BindUniform.js";import{Texture2DUintDrawUniform as i}from"../../../core/shaderModules/Texture2DUintDrawUniform.js";import{edgeViewTextureLayout as s}from"../../../lib/edgeRendering/bufferLayouts.js";const c=new o(s,"componentIndex",new i("componentTextureBuffer",o=>o.componentDataTextureBuffer?.texture));function f(o,i){const{vertex:s}=o;o.include(e,i);const{silhouette:f,legacy:u,spherical:v}=i;o.attributes.add("componentIndex","uint");const{getTextureAttribute:w,TextureBackedBufferModule:p}=c;o.include(p);const F=8,M=128;s.constants.add("lineWidthFractionFactor","float",F),s.constants.add("extensionLengthOffset","float",M),s.code.add(l`
6
6
  struct ComponentData {
7
7
  vec4 color;
8
8
  vec3 normal;
@@ -35,21 +35,21 @@ import{TextureBackedBufferModule as o}from"../../../core/shaderLibrary/TextureBa
35
35
  verticalOffset
36
36
  );
37
37
  }
38
- `),u?i.code.add(l`vec3 _modelToWorldNormal(vec3 normal) {
38
+ `),u?s.code.add(l`vec3 _modelToWorldNormal(vec3 normal) {
39
39
  return (model * vec4(normal, 0.0)).xyz;
40
40
  }
41
41
  vec3 _modelToViewNormal(vec3 normal) {
42
42
  return (localView * model * vec4(normal, 0.0)).xyz;
43
- }`):(i.uniforms.add(new n("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),i.code.add(l`vec3 _modelToWorldNormal(vec3 normal) {
43
+ }`):(s.uniforms.add(new n("transformNormalGlobalFromModel",o=>o.transformNormalGlobalFromModel)),s.code.add(l`vec3 _modelToWorldNormal(vec3 normal) {
44
44
  return transformNormalGlobalFromModel * normal;
45
- }`)),f?(o.attributes.add("normal2Compressed","vec2"),i.code.add(l`vec3 worldNormal(ComponentData data) {
45
+ }`)),f?(o.attributes.add("normal2Compressed","vec2"),s.code.add(l`vec3 worldNormal(ComponentData data) {
46
46
  return _modelToWorldNormal(normalize(data.normal + data.normal2));
47
- }`)):i.code.add(l`vec3 worldNormal(ComponentData data) {
47
+ }`)):s.code.add(l`vec3 worldNormal(ComponentData data) {
48
48
  return _modelToWorldNormal(data.normal);
49
- }`),u?i.code.add(l`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
49
+ }`),u?s.code.add(l`void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
50
50
  worldPos = (model * vec4(modelPos, 1.0)).xyz;
51
51
  viewPos = (localView * vec4(worldPos, 1.0)).xyz;
52
- }`):(i.include(r,s),i.uniforms.add(new d("transformViewFromCameraRelativeRS",o=>o.transformViewFromCameraRelativeRS),new n("transformWorldFromModelRS",o=>o.transformWorldFromModelRS),new t("transformWorldFromModelTL",o=>o.transformWorldFromModelTL),new t("transformWorldFromModelTH",o=>o.transformWorldFromModelTH),new a("transformWorldFromViewTL",o=>o.transformWorldFromViewTL),new a("transformWorldFromViewTH",o=>o.transformWorldFromViewTH)),i.code.add(l`
52
+ }`):(s.include(r,i),s.uniforms.add(new d("transformViewFromCameraRelativeRS",o=>o.transformViewFromCameraRelativeRS),new n("transformWorldFromModelRS",o=>o.transformWorldFromModelRS),new t("transformWorldFromModelTL",o=>o.transformWorldFromModelTL),new t("transformWorldFromModelTH",o=>o.transformWorldFromModelTH),new a("transformWorldFromViewTL",o=>o.transformWorldFromViewTL),new a("transformWorldFromViewTH",o=>o.transformWorldFromViewTH)),s.code.add(l`
53
53
  void worldAndViewFromModelPosition(vec3 modelPos, float verticalOffset, out vec3 worldPos, out vec3 viewPos) {
54
54
  vec3 rotatedModelPosition = transformWorldFromModelRS * modelPos;
55
55
 
@@ -69,8 +69,8 @@ viewPos = (localView * vec4(worldPos, 1.0)).xyz;
69
69
 
70
70
  viewPos = transformViewFromCameraRelativeRS * worldPos;
71
71
  }
72
- `)),i.uniforms.add(new m("transformProjFromView",o=>o.camera.projectionMatrix)).code.add(l`vec4 projFromViewPosition(vec3 position) {
72
+ `)),s.uniforms.add(new m("transformProjFromView",o=>o.camera.projectionMatrix)).code.add(l`vec4 projFromViewPosition(vec3 position) {
73
73
  return transformProjFromView * vec4(position, 1.0);
74
- }`),i.code.add(l`float calculateExtensionLength(float extensionLength, float lineLength) {
74
+ }`),s.code.add(l`float calculateExtensionLength(float extensionLength, float lineLength) {
75
75
  return extensionLength / (log2(max(1.0, 256.0 / lineLength)) * 0.2 + 1.0);
76
76
  }`)}function u(o){return 1===o||2===o}export{f as EdgeUtil,u as usesSketchLogic};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as r}from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,initial as l,whenOnce as p,syncAndInitial as m}from"../core/reactiveUtils.js";import{property as h,cast as d,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import u from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{load as j,execute as w}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as v}from"../layers/support/MediaElementView.js";import M from"../layers/support/TileInfo.js";import _ from"../layers/support/VideoElement.js";import{DOMContainer as S}from"./DOMContainer.js";import{Viewport2DBaseMixin as C}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as V}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import P from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/has.js";import"../core/scheduling.js";import"../core/RandomLCG.js";import"../core/Logger.js";import"../core/mathUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/spatialReferenceUtils.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/Program.js";import"./webgl/checkWebGLError.js";import"./webgl/VertexAttributeLayouts.js";import"./webgl/BufferObject.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/Renderbuffer.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../core/sql/UnknownTimeZone.js";import"luxon";import"../intl/locale.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/animations/instructions.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import{ManagedCanvas as E}from"./2d/engine/ManagedCanvas.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import D from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as R}from"./2d/ViewStateManager.js";import q from"./2d/engine/webgl/Overlay.js";import z from"./2d/engine/webgl/OverlayContainer.js";import O from"./navigation/Navigation.js";import T from"./ui/DefaultUI.js";import W from"./ui/video/DefaultUIVideo.js";const A=new t("#000");let U;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);U=e}const B=.01,F=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let H=class extends(V(C(S(r(a(s)))))){constructor(e){super(e),this._isValid=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.layer=null,this.map=null,this.navigation=new O,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new R({constraints:new P({view:this,minScale:1,maxScale:B})}),this.type="2d",this.ui=new W,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.layer,(e,t)=>{t&&(this._teardown(),this._startup()),this.addResolvingPromise(p(()=>this.ready))},l),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},m)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},m)]),this.addResolvingPromise(k().then(()=>(this._isValid=!0,p(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}async hitTest(e,t){return this._operationalDataView&&this._operationalDataView.ready?this._operationalDataView.hitTest(e,t):{screenPoint:e,results:[]}}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:A,groundControlPoints:()=>this.layer?.groundControlPoints,getSize:()=>this.videoSize},i=new U(this.surface,t,new E(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new x({view:this});this._set("animationManager",s);const r=new D({view:this,animationManager:s});this._set("mapViewNavigation",r),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new u({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,m),n(()=>this.state.id,()=>e.state=this.state,m),n(()=>this.renderingOptions,t=>e.renderingOptions=t,m)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new v({element:new _({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new q(this._videoElementView);this._overlayContainer=new z,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(F).has(e.type),width:this.size[0],height:this.size[1],map:t}),p(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},m),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),r=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:o}=t[e];s[e]=w(new u(o,i),r)}let o=1/0,a=1/0,n=-1/0,l=-1/0;for(const e of s)o=Math.min(o,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),l=Math.max(l,e.y);const p=f.fromJSON({xmin:o,ymin:a,xmax:n,ymax:l,spatialReference:r});await(this._operationalDataView?.goTo(p,{animate:!1}).catch(()=>{}))},m)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>B;r/=2)i.push(r);i.push(B);const{lods:s}=M.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([h()],H.prototype,"_overlayContainer",void 0),e([h()],H.prototype,"_isValid",void 0),e([h()],H.prototype,"_effectsContainer",void 0),e([h()],H.prototype,"constraintsInfo",null),e([h()],H.prototype,"operationalDataVisible",void 0),e([h()],H.prototype,"layer",void 0),e([h()],H.prototype,"map",void 0),e([h({type:O,nonNullable:!0})],H.prototype,"navigation",void 0),e([h({readOnly:!0})],H.prototype,"preconditionsReady",null),e([h({readOnly:!0})],H.prototype,"ready",void 0),e([h({readOnly:!0})],H.prototype,"rendering",null),e([h()],H.prototype,"scale",null),e([h()],H.prototype,"spatialReference",void 0),e([h()],H.prototype,"stateManager",void 0),e([h()],H.prototype,"type",void 0),e([h(),d(e=>e instanceof T?e:g(W,e))],H.prototype,"ui",void 0),e([h({readOnly:!0})],H.prototype,"videoSize",null),e([h({readOnly:!0})],H.prototype,"view2dType",void 0),H=e([c("esri.views.VideoView")],H);const L=H;export{L as default};
5
+ import{__decorate as e}from"tslib";import t from"../Color.js";import i from"../Viewpoint.js";import s from"../core/Accessor.js";import{EventedMixin as r}from"../core/Evented.js";import{destroyMaybe as o}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{watch as n,initial as l,whenOnce as p,syncAndInitial as m}from"../core/reactiveUtils.js";import{property as h,cast as d,subclass as c}from"../core/accessorSupport/decorators.js";import{ensureClass as g}from"../core/accessorSupport/ensureType.js";import f from"../geometry/Extent.js";import u from"../geometry/Point.js";import y from"../geometry/SpatialReference.js";import{load as j,execute as w}from"../geometry/operators/projectOperator.js";import b from"../layers/support/ExtentAndRotationGeoreference.js";import{MediaElementView as v}from"../layers/support/MediaElementView.js";import M from"../layers/support/TileInfo.js";import _ from"../layers/support/VideoElement.js";import{DOMContainer as S}from"./DOMContainer.js";import{Viewport2DBaseMixin as C}from"./Viewport2DBaseMixin.js";import{Viewport2DMixin as V}from"./Viewport2DMixin.js";import x from"./2d/AnimationManager.js";import P from"./2d/MapViewConstraints.js";import"../core/Error.js";import"../core/has.js";import"../core/scheduling.js";import"../core/RandomLCG.js";import"../core/Logger.js";import"../core/mathUtils.js";import"../config.js";import"../symbols/cim/defaultCIMValues.js";import"../core/floatRGBA.js";import"../geometry/Geometry.js";import"../geometry/Multipoint.js";import"../geometry/Polygon.js";import"../geometry/Polyline.js";import"../symbols/Font.js";import"../core/ObjectPool.js";import"../geometry/support/spatialReferenceUtils.js";import"../symbols/cim/effects/EffectAddControlPoints.js";import"../symbols/cim/effects/EffectArrow.js";import"../symbols/cim/effects/EffectBuffer.js";import"../symbols/cim/effects/EffectControlMeasureLine.js";import"../symbols/cim/effects/EffectCut.js";import"../symbols/cim/effects/EffectDashes.js";import"../symbols/cim/effects/EffectDonut.js";import"../symbols/cim/effects/EffectEnclosingPolygon.js";import"../symbols/cim/effects/EffectJog.js";import"../symbols/cim/effects/EffectMove.js";import"../symbols/cim/effects/EffectOffset.js";import"../symbols/cim/effects/EffectRadial.js";import"../symbols/cim/effects/EffectReverse.js";import"../symbols/cim/effects/EffectRotate.js";import"../symbols/cim/effects/EffectScale.js";import"../symbols/cim/effects/EffectSuppress.js";import"../symbols/cim/effects/EffectTaperedPolygon.js";import"../symbols/cim/effects/EffectWave.js";import"../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../symbols/cim/placements/PlacementAtExtremities.js";import"../symbols/cim/placements/PlacementAtMeasuredUnits.js";import"../symbols/cim/placements/PlacementAtRatioPositions.js";import"../symbols/cim/placements/PlacementInsidePolygon.js";import"../symbols/cim/placements/PlacementOnLine.js";import"../symbols/cim/placements/PlacementOnVertices.js";import"../symbols/cim/placements/PlacementPolygonCenter.js";import"../symbols/cim/constants.js";import"../core/libs/gl-matrix-2/factories/vec2f32.js";import"../symbols/support/defaults.js";import"../symbols/cim/OverrideHelper.js";import{Container as G}from"./2d/engine/Container.js";import"../core/libs/gl-matrix-2/factories/vec4f32.js";import"./webgl/enums.js";import"./2d/engine/webgl/shaders/BackgroundPrograms.js";import"./webgl/Program.js";import"./webgl/Util.js";import"./webgl/VertexAttributeLayouts.js";import"./webgl/BufferObject.js";import"./2d/engine/webgl/AFeatureTile.js";import"./2d/engine/webgl/DisplayEntity.js";import"./2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"./2d/engine/webgl/cpuMapped/MappedMesh.js";import"./2d/engine/webgl/number.js";import"./2d/engine/webgl/shaders/TileInfoPrograms.js";import"./webgl/Texture.js";import"./2d/engine/webgl/shaders/BitBlitPrograms.js";import"../request.js";import"../core/urlUtils.js";import"../core/pbf.js";import"./2d/engine/webgl/shaders/StencilPrograms.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"./2d/engine/webgl/shaders/HighlightPrograms.js";import"./webgl/FramebufferObject.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js";import"./2d/engine/webgl/meshing/SimpleMesh.js";import"./webgl/Renderbuffer.js";import"./2d/engine/webgl/PooledUint32Array.js";import"./2d/engine/webgl/Profiler.js";import"./2d/engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"./2d/engine/webgl/shaderGraph/techniques/animated/attributes.js";import"./2d/engine/webgl/mesh/templates/templateUtils.js";import"./2d/engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../geometry/support/aaBoundingBox.js";import"./2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"./2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../core/sql/UnknownTimeZone.js";import"luxon";import"../intl/locale.js";import"../layers/support/fieldUtils.js";import"../time/constants.js";import"./2d/engine/webgl/animations/instructions.js";import"./2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"./webgl/checkWebGLError.js";import"./webgl/renderState.js";import"./3d/webgl-engine/core/shaderModules/glsl.js";import"./webgl/testSVGPremultipliedAlpha.js";import{ManagedCanvas as E}from"./2d/engine/ManagedCanvas.js";import"./2d/engine/transitions/FadeTransition.js";import"./2d/engine/webgl/meshing/definitions.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"./2d/LabelManager.js";import"./2d/layers/graphics/GraphicsView2D.js";import"../chunks/earcut.js";import"../core/libs/gl-matrix-2/factories/vec3f32.js";import"../geometry/support/normalizeUtils.js";import"./2d/layers/support/util.js";import D from"./2d/navigation/MapViewNavigation.js";import"../core/asyncUtils.js";import"../core/support/UpdatingHandles.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../core/units.js";import"../geometry/ellipsoidUtils.js";import"../geometry/operators/support/GeographicTransformation.js";import"../geometry/projection/projectors.js";import"./2d/engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../geometry/support/geodesicConstants.js";import"../geometry/support/Ellipsoid.js";import{ViewStateManager as R}from"./2d/ViewStateManager.js";import q from"./2d/engine/webgl/Overlay.js";import z from"./2d/engine/webgl/OverlayContainer.js";import O from"./navigation/Navigation.js";import T from"./ui/DefaultUI.js";import W from"./ui/video/DefaultUIVideo.js";const A=new t("#000");let U;async function k(){const[,{ParentStage:e}]=await Promise.all([import("./2d/webglDeps.js"),import("./2d/mapViewDeps.js")]);U=e}const B=.01,F=["feature","geojson","csv","stream","ogc-feature","catalog","wfs","parquet","graphics","group"];let H=class extends(V(C(S(r(a(s)))))){constructor(e){super(e),this._isValid=!1,this._prevZoomEnabled=!1,this._prevRotationEnabled=!1,this.stage=null,this.childStage=null,this._operationalDataView=null,this.operationalDataVisible=!1,this.layer=null,this.map=null,this.navigation=new O,this.ready=!1,this.spatialReference=new y({wkid:0}),this.stateManager=new R({constraints:new P({view:this,minScale:1,maxScale:B})}),this.type="2d",this.ui=new W,this.view2dType="video",this.addHandles([n(()=>this.preconditionsReady,e=>e?this._startup():this._teardown()),n(()=>this.layer,(e,t)=>{t&&(this._teardown(),this._startup()),this.addResolvingPromise(p(()=>this.ready))},l),n(()=>this.videoSize,([e,t])=>{this._extent&&e&&t&&(this._extent.xmax=e,this._extent.ymax=t)}),n(()=>this.size,e=>{this._operationalDataView&&this._operationalDataView.stateManager.resize(e[0],e[1])}),n(()=>[this.layer?.frameEffect,this._effectsContainer],()=>{this._effectsContainer&&(this._effectsContainer.effect=this.layer?.frameEffect??null)},m)])}initialize(){this._prevZoomEnabled="zoom"===this.navigation.actionMap.mouseWheel&&this.ui.components.includes("zoom"),this._prevRotationEnabled="rotate"===this.navigation.actionMap.dragSecondary&&this.ui.components.includes("compass"),this.addHandles([n(()=>[this.operationalDataVisible,this.childStage],()=>{this.childStage&&(this.childStage.videoScreenRenderer.visible=this.operationalDataVisible),this.operationalDataVisible&&(this.scale=1,this.rotation=0),this.navigation&&(this._prevZoomEnabled&&(this.navigation.actionMap.mouseWheel=this.operationalDataVisible?"none":"zoom",this.navigation.actionMap.dragPrimary=this.operationalDataVisible?"none":"pan",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"zoom"!==e):[...new Set([...this.ui.components,"zoom"])])),this._prevRotationEnabled&&(this.navigation.actionMap.dragSecondary=this.operationalDataVisible?"none":"rotate",this.ui.components&&(this.ui.components=this.operationalDataVisible?this.ui.components.filter(e=>"compass"!==e):[...new Set([...this.ui.components,"compass"])])))},m)]),this.addResolvingPromise(k().then(()=>(this._isValid=!0,p(()=>this.ready))))}destroy(){this._teardown(),this.removeAllHandles(),this._set("preconditionsReady",!1),this.frameTask=o(this.frameTask),this.goToManager.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get constraintsInfo(){return{lods:null,spatialReference:this.spatialReference}}get preconditionsReady(){return!(!this._isValid||0===this.width||0===this.height||0===this.videoSize[0]||0===this.videoSize[1])}get rendering(){return this.stage?.renderRequested??!1}get scale(){return this.stateManager?.scale??0}set scale(e){this.stateManager&&(this.stateManager.scale=e)}get videoSize(){if(!this.layer?.videoWidth||!this.layer?.videoHeight)return[0,0];const[e,t]=this.size,i=(this.layer?.videoWidth||0)/(this.layer?.videoHeight||0),s=t*i,r=e/i;return e/t>=1?i>=1?s<=e?[s,t]:[e,r]:r<=t?[e,r]:[s,t]:i>=1?r<=t?[e,r]:[s,t]:s<=e?[s,t]:[e,r]}async hitTest(e,t){return this._operationalDataView&&this._operationalDataView.ready?this._operationalDataView.hitTest(e,t):{screenPoint:e,results:[]}}_startup(){if(!this.layer)return;const e=this._getViewpoint();this.stateManager.startup(e,this.size,e.targetGeometry.spatialReference);const t={renderingOptions:this.renderingOptions,backgroundColor:A,groundControlPoints:()=>this.layer?.groundControlPoints,getSize:()=>this.videoSize},i=new U(this.surface,t,new E(this.surface));this.stage=i,this._prepareStage(this.stage),this.childStage=i.childStage,this._prepareChildStage(this.childStage);const s=new x({view:this});this._set("animationManager",s);const r=new D({view:this,animationManager:s});this._set("mapViewNavigation",r),this._updateConstraints(),this.frameTask.start(),this._set("ready",!0)}_teardown(){this.stage.destroy(),this.stage=null,this._videoElementView=null,this._overlayContainer.removeAllChildren(),this._overlayContainer=null,this.removeHandles("video-view"),this._set("ready",!1),this.stateManager.teardown(),this.frameTask.stop(),this.stationaryManager.clear()}_getViewpoint(){return new i({targetGeometry:new u({x:this.videoSize[0]/2,y:this.videoSize[1]/2,spatialReference:this.spatialReference}),scale:1})}_prepareStage(e){this.addHandles([n(()=>this.stationary,t=>e.stationary=t,m),n(()=>this.state.id,()=>e.state=this.state,m),n(()=>this.renderingOptions,t=>e.renderingOptions=t,m)],"video-view"),this._extent=new f({xmin:0,ymin:0,xmax:this.videoSize[0],ymax:this.videoSize[1],spatialReference:{wkid:0}}),this._videoElementView=new v({element:new _({video:this.layer?.videoElement,georeference:new b({extent:this._extent}),autoplay:!1}),spatialReference:this.spatialReference});const t=new q(this._videoElementView);this._overlayContainer=new z,this._overlayContainer.addChild(t),this._effectsContainer=new G,this._effectsContainer.addChild(this._overlayContainer),this.stage.addChild(this._effectsContainer);const i=document.createElement("div");i.classList.add("esri-video-poster"),this.container?.classList.add("esri-video-view"),this.container?.appendChild(i)}_prepareChildStage(e){this.addHandles([n(()=>this.map,async t=>{if(!t)return;const{default:i}=await import("./video/VideoOperationalDataView.js");this._operationalDataView=new i({stage:e,layerViewFilter:e=>new Set(F).has(e.type),width:this.size[0],height:this.size[1],map:t}),p(()=>this._operationalDataView?.ready).then(()=>{e.videoScreenRenderer.visible=this.operationalDataVisible})},m),n(()=>this.layer?.groundControlPoints,async()=>{if(!this.layer?.groundControlPoints||!e.state)return;const t=this.layer.groundControlPoints,i=t?.length;if(!i)return;await j();const s=new Array(i),r=e.state.spatialReference;for(let e=0;e<i;e++){const{lat:i,lon:o}=t[e];s[e]=w(new u(o,i),r)}let o=1/0,a=1/0,n=-1/0,l=-1/0;for(const e of s)o=Math.min(o,e.x),a=Math.min(a,e.y),n=Math.max(n,e.x),l=Math.max(l,e.y);const p=f.fromJSON({xmin:o,ymin:a,xmax:n,ymax:l,spatialReference:r});await(this._operationalDataView?.goTo(p,{animate:!1}).catch(()=>{}))},m)])}_updateConstraints(){this._updateZoomConstraints(),this._updatePanConstraints()}_updateZoomConstraints(){const e=this.videoSize,t=Math.max(e[0]/this.size[0],e[1]/this.size[1]),i=[];for(let r=t;r>B;r/=2)i.push(r);i.push(B);const{lods:s}=M.create({scales:i});this.constraints.set({lods:s,minScale:t})}_updatePanConstraints(){const e=e=>{if(!e.targetGeometry)return e;const[t,i]=this.videoSize,s=t*e.scale/2,r=i*e.scale/2,o=e.targetGeometry.clone();return o.x=Math.max(s,Math.min(t-s,o.x)),o.y=Math.max(r,Math.min(i-r,o.y)),e.targetGeometry=o,e};this.constraints.customConstraints.add({constrain:e,applyPanConstraint:e})}};e([h()],H.prototype,"_overlayContainer",void 0),e([h()],H.prototype,"_isValid",void 0),e([h()],H.prototype,"_effectsContainer",void 0),e([h()],H.prototype,"constraintsInfo",null),e([h()],H.prototype,"operationalDataVisible",void 0),e([h()],H.prototype,"layer",void 0),e([h()],H.prototype,"map",void 0),e([h({type:O,nonNullable:!0})],H.prototype,"navigation",void 0),e([h({readOnly:!0})],H.prototype,"preconditionsReady",null),e([h({readOnly:!0})],H.prototype,"ready",void 0),e([h({readOnly:!0})],H.prototype,"rendering",null),e([h()],H.prototype,"scale",null),e([h()],H.prototype,"spatialReference",void 0),e([h()],H.prototype,"stateManager",void 0),e([h()],H.prototype,"type",void 0),e([h(),d(e=>e instanceof T?e:g(W,e))],H.prototype,"ui",void 0),e([h({readOnly:!0})],H.prototype,"videoSize",null),e([h({readOnly:!0})],H.prototype,"view2dType",void 0),H=e([c("esri.views.VideoView")],H);const L=H;export{L as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import"../../core/has.js";import t from"../../core/Logger.js";const r=()=>t.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class n{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends n{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new c,this.varyings=new h,this.outputs=new m}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s="vertex"===e?this.vertex:this.fragment,i=s.uniforms.generateSource(),a=s.code.generateSource(),o=s.main.generateSource(t),u=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?_:d,h=s.constants.generateSource(),m=this.outputs.generateSource(e);return`#version 300 es\n${u}\n${c}\n${h.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${n.join("\n")}\n${m.join("\n")}\n${a.join("\n")}\n${o.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),n=r.length;return t=>{for(let s=0;s<n;++s)r[s](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),n=r.length;return(t,s)=>{for(let i=0;i<n;++i)r[i](e,t,s)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),n=r.length;return(t,s,i)=>{for(let a=0;a<n;++a)r[a](e,i,t,s)}}}class i{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else r().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class a{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new e("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class o{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends n{constructor(){super(...arguments),this.uniforms=new i(this),this.main=new a(this),this.code=new o(this),this.constants=new l(this)}get builder(){return this}}class c{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class h{constructor(){this._entries=new Map}add(e,t,n){this._entries.has(e)?r().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:n?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,n)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${n};`)),t}}class m{constructor(){this._entries=new Map}add(e,t,n=0){const s=this._entries.get(n);s?.name!==e||s?.type!==t?this._entries.set(n,{name:e,type:t}):r().warn(`Fragment shader output location ${n} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class l{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=l._numberToFloatStr(r);break;case"int":n=l._numberToIntStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])}, ${l._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${l._numberToFloatStr(r[0])}, ${l._numberToFloatStr(r[1])}, ${l._numberToFloatStr(r[2])}, ${l._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])}, ${l._numberToIntStr(r[3])})`;break;case"uvec2":n=`uvec2(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])})`;break;case"uvec3":n=`uvec3(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])})`;break;case"uvec4":n=`uvec4(${l._numberToIntStr(r[0])}, ${l._numberToIntStr(r[1])}, ${l._numberToIntStr(r[2])}, ${l._numberToIntStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,e=>l._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const d="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",_="precision highp float;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n ";export{o as Code,n as Includes,a as Main,s as ShaderBuilder,u as Stage,i as Uniforms};
5
+ import e from"../../core/Error.js";import"../../core/has.js";import t from"../../core/Logger.js";const r=()=>t.getLogger("esri.views.3d.webgl-engine.core.shaderModules.shaderBuilder");class n{constructor(){this._includedModules=new Map}include(e,t){this._includedModules.has(e)?this._includedModules.get(e):(this._includedModules.set(e,t),e(this.builder,t))}}class s extends n{constructor(){super(...arguments),this.vertex=new u,this.fragment=new u,this.attributes=new c,this.varyings=new h,this.outputs=new m}get fragmentUniforms(){return this.fragment.uniforms.entries}get attributeNames(){return this.attributes.names}get builder(){return this}generate(e,t=!1){const r=this.attributes.generateSource(e),n=this.varyings.generateSource(e),s="vertex"===e?this.vertex:this.fragment,i=s.uniforms.generateSource(),a=s.code.generateSource(),o=s.main.generateSource(t),u=this.debugName?`// ${this.debugName}\n`:"",c="vertex"===e?_:l,h=s.constants.generateSource(),m=this.outputs.generateSource(e);return`#version 300 es\n${u}\n${c}\n${h.join("\n")}\n${i.join("\n")}\n${r.join("\n")}\n${n.join("\n")}\n${m.join("\n")}\n${a.join("\n")}\n${o.join("\n")}`}generateBind(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[0];r&&t.set(e.name,r)});const r=Array.from(t.values()),n=r.length;return t=>{for(let s=0;s<n;++s)r[s](e,t)}}generateBindPass(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[1];r&&t.set(e.name,r)});const r=Array.from(t.values()),n=r.length;return(t,s)=>{for(let i=0;i<n;++i)r[i](e,t,s)}}generateBindDraw(e){const t=new Map;this.vertex.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)}),this.fragment.uniforms.entries.forEach(e=>{const r=e.bind[2];r&&t.set(e.name,r)});const r=Array.from(t.values()),n=r.length;return(t,s,i)=>{for(let a=0;a<n;++a)r[a](e,i,t,s)}}}class i{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(const t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(null!=t){if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e("shaderbuilder:duplicate-uniform",`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}else r().error(`Trying to add null Uniform from ${(new Error).stack}.`)}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:r})=>null!=t?`uniform ${r} ${e}[${t}];`:`uniform ${r} ${e};`)}get entries(){return Array.from(this._entries.values())}}class a{constructor(e){this._stage=e,this._bodies=new Array}add(e){return this._bodies.push(e),this._stage}generateSource(t){if(this._bodies.length>0)return[`void main() {\n ${this._bodies.join("\n")||""} \n}`];if(t)throw new e("shaderbuilder:missing-main","Shader does not contain main function body.");return[]}}class o{constructor(e){this._stage=e,this._entries=new Array}add(e){return this._entries.push(e),this._stage}generateSource(){return this._entries}}class u extends n{constructor(){super(...arguments),this.uniforms=new i(this),this.main=new a(this),this.code=new o(this),this.constants=new d(this)}get builder(){return this}}class c{constructor(){this._entries=new Array}add(e,t){this._entries.push([e,t])}generateSource(e){return"fragment"===e?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class h{constructor(){this._entries=new Map}add(e,t,n){this._entries.has(e)?r().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:n?.invariant??!1})}generateSource(e){const t=new Array;return this._entries.forEach((r,n)=>t.push((r.invariant&&"vertex"===e?"invariant ":"")+("int"===r.type?"flat ":"")+("vertex"===e?"out":"in")+` ${r.type} ${n};`)),t}}class m{constructor(){this._entries=new Map}add(e,t,n=0){const s=this._entries.get(n);s?.name!==e||s?.type!==t?this._entries.set(n,{name:e,type:t}):r().warn(`Fragment shader output location ${n} occupied`)}static{this.DEFAULT_TYPE="vec4"}static{this.DEFAULT_NAME="fragColor"}generateSource(e){if("vertex"===e)return[];0===this._entries.size&&this._entries.set(0,{name:m.DEFAULT_NAME,type:m.DEFAULT_TYPE});const t=new Array;return this._entries.forEach((e,r)=>t.push(`layout(location = ${r}) out ${e.type} ${e.name};`)),t}}class d{constructor(e){this._stage=e,this._entries=new Set}add(e,t,r){let n="ERROR_CONSTRUCTOR_STRING";switch(t){case"float":n=d._numberToFloatStr(r);break;case"int":n=d._numberToIntStr(r);break;case"uint":n=d._numberToUintStr(r);break;case"bool":n=r.toString();break;case"vec2":n=`vec2(${d._numberToFloatStr(r[0])}, ${d._numberToFloatStr(r[1])})`;break;case"vec3":n=`vec3(${d._numberToFloatStr(r[0])}, ${d._numberToFloatStr(r[1])}, ${d._numberToFloatStr(r[2])})`;break;case"vec4":n=`vec4(${d._numberToFloatStr(r[0])}, ${d._numberToFloatStr(r[1])}, ${d._numberToFloatStr(r[2])}, ${d._numberToFloatStr(r[3])})`;break;case"ivec2":n=`ivec2(${d._numberToIntStr(r[0])}, ${d._numberToIntStr(r[1])})`;break;case"ivec3":n=`ivec3(${d._numberToIntStr(r[0])}, ${d._numberToIntStr(r[1])}, ${d._numberToIntStr(r[2])})`;break;case"ivec4":n=`ivec4(${d._numberToIntStr(r[0])}, ${d._numberToIntStr(r[1])}, ${d._numberToIntStr(r[2])}, ${d._numberToIntStr(r[3])})`;break;case"uvec2":n=`uvec2(${d._numberToUintStr(r[0])}, ${d._numberToUintStr(r[1])})`;break;case"uvec3":n=`uvec3(${d._numberToUintStr(r[0])}, ${d._numberToUintStr(r[1])}, ${d._numberToUintStr(r[2])})`;break;case"uvec4":n=`uvec4(${d._numberToUintStr(r[0])}, ${d._numberToUintStr(r[1])}, ${d._numberToUintStr(r[2])}, ${d._numberToUintStr(r[3])})`;break;case"mat2":case"mat3":case"mat4":n=`${t}(${Array.prototype.map.call(r,e=>d._numberToFloatStr(e)).join(", ")})`}return this._entries.add(`const ${t} ${e} = ${n};`),this._stage}static _numberToIntStr(e){return e.toFixed(0)}static _numberToUintStr(e){return`${e.toFixed(0)}u`}static _numberToFloatStr(e){return Number.isInteger(e)?e.toFixed(1):e.toString()}generateSource(){return Array.from(this._entries)}}const l="#ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n#else\n precision mediump float;\n precision mediump int;\n precision mediump sampler2D;\n precision mediump usampler2D;\n precision mediump sampler2DArray;\n precision mediump sampler2DShadow;\n#endif",_="precision highp float;\n precision highp int;\n precision highp sampler2D;\n precision highp usampler2D;\n precision highp sampler2DArray;\n precision highp sampler2DShadow;\n\n\n invariant gl_Position;\n ";export{o as Code,n as Includes,a as Main,s as ShaderBuilder,u as Stage,i as Uniforms};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"../../core/has.js";import{webglDebugEnabled as e,getErrorMessage as s}from"./checkWebGLError.js";import{CompressedTextureFormat as c,SizedPixelFormat as a,SizedDepthStencilFormat as r,SizedDepthFormat as t}from"./enums.js";function R(c,a,r,t=0){const R=c.gl;c.bindBuffer(r);for(const n of r.layout){const r=a.get(n.name);if(null==r){console.warn(`There is no location for vertex attribute '${n.name}' defined.`);continue}const _=t*n.stride;if(n.count<=4)R.vertexAttribPointer(r,n.count,n.type,n.normalized,n.stride,n.offset+_),R.enableVertexAttribArray(r),n.divisor>0&&R.vertexAttribDivisor(r,n.divisor);else if(9===n.count)for(let e=0;e<3;e++)R.vertexAttribPointer(r+e,3,n.type,n.normalized,n.stride,n.offset+12*e+_),R.enableVertexAttribArray(r+e),n.divisor>0&&R.vertexAttribDivisor(r+e,n.divisor);else if(16===n.count)for(let e=0;e<4;e++)R.vertexAttribPointer(r+e,4,n.type,n.normalized,n.stride,n.offset+16*e+_),R.enableVertexAttribArray(r+e),n.divisor>0&&R.vertexAttribDivisor(r+e,n.divisor);else console.error("Unsupported vertex attribute element count: "+n.count);if(e()){const e=s(c.gl);e&&console.error(`Unable to bind vertex attribute "${n.name}" with baseInstanceOffset ${_}:`,e,n)}}}function n(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function _(e){switch(e){case 6406:case 6409:case 6403:case 36244:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case t.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case t.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case t.DEPTH_COMPONENT32F:case r.DEPTH24_STENCIL8:return 4;case r.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case c.COMPRESSED_RGB_S3TC_DXT1_EXT:case c.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case c.COMPRESSED_RGBA_S3TC_DXT3_EXT:case c.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case c.COMPRESSED_R11_EAC:case c.COMPRESSED_SIGNED_R11_EAC:case c.COMPRESSED_RGB8_ETC2:case c.COMPRESSED_SRGB8_ETC2:case c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case c.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case c.COMPRESSED_RG11_EAC:case c.COMPRESSED_SIGNED_RG11_EAC:case c.COMPRESSED_RGBA8_ETC2_EAC:case c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}export{R as bindVertexBufferLayout,_ as getFormatBytesPerElement,n as getFormatComponents};
5
+ import"../../core/has.js";import{webglDebugEnabled as e,getErrorMessage as s}from"./checkWebGLError.js";import{CompressedTextureFormat as c,SizedPixelFormat as a,SizedDepthStencilFormat as r,SizedDepthFormat as t,DataType as R}from"./enums.js";const n=new Set([R.BYTE,R.SHORT,R.INT,R.UNSIGNED_BYTE,R.UNSIGNED_SHORT,R.UNSIGNED_INT]);function i(c,a,r,t=0){const R=c.gl;c.bindBuffer(r);for(const i of r.layout){const r=a.get(i.name);if(null==r){console.warn(`There is no location for vertex attribute '${i.name}' defined.`);continue}const o=t*i.stride;if(i.count<=4)i.integer&&n.has(i.type)?R.vertexAttribIPointer(r,i.count,i.type,i.stride,i.offset+o):R.vertexAttribPointer(r,i.count,i.type,i.normalized,i.stride,i.offset+o),R.enableVertexAttribArray(r),i.divisor>0&&R.vertexAttribDivisor(r,i.divisor);else if(9===i.count)for(let e=0;e<3;e++)R.vertexAttribPointer(r+e,3,i.type,i.normalized,i.stride,i.offset+12*e+o),R.enableVertexAttribArray(r+e),i.divisor>0&&R.vertexAttribDivisor(r+e,i.divisor);else if(16===i.count)for(let e=0;e<4;e++)R.vertexAttribPointer(r+e,4,i.type,i.normalized,i.stride,i.offset+16*e+o),R.enableVertexAttribArray(r+e),i.divisor>0&&R.vertexAttribDivisor(r+e,i.divisor);else console.error("Unsupported vertex attribute element count: "+i.count);if(e()){const e=s(c.gl);e&&console.error(`Unable to bind vertex attribute "${i.name}" with baseInstanceOffset ${o}:`,e,i)}}}function o(e){switch(e){case 6406:case 6409:case 6403:case 36244:case 6402:case 34041:return 1;case 6410:case 33319:case 33320:return 2;case 6407:case 36248:return 3;case 6408:case 36249:return 4}return 0}function _(e){switch(e){case 6406:case 6409:case 6403:case 36244:case a.R8:case a.R8I:case a.R8UI:case a.R8_SNORM:case 36168:return 1;case 6410:case 33319:case 33320:case a.RGBA4:case a.R16F:case a.R16I:case a.R16UI:case a.RG8:case a.RG8I:case a.RG8UI:case a.RG8_SNORM:case a.RGB565:case a.RGB5_A1:case t.DEPTH_COMPONENT16:return 2;case 6407:case 36248:case a.RGB8:case a.RGB8I:case a.RGB8UI:case a.RGB8_SNORM:case a.SRGB8:case t.DEPTH_COMPONENT24:return 3;case 6408:case 36249:case a.RGBA8:case a.R32F:case a.R11F_G11F_B10F:case a.RG16F:case a.R32I:case a.R32UI:case a.RG16I:case a.RG16UI:case a.RGBA8I:case a.RGBA8UI:case a.RGBA8_SNORM:case a.SRGB8_ALPHA8:case a.RGB9_E5:case a.RGB10_A2UI:case a.RGB10_A2:case t.DEPTH_COMPONENT32F:case r.DEPTH24_STENCIL8:return 4;case r.DEPTH32F_STENCIL8:return 5;case a.RGB16F:case a.RGB16I:case a.RGB16UI:return 6;case a.RG32F:case a.RG32I:case a.RG32UI:case a.RGBA16F:case a.RGBA16I:case a.RGBA16UI:return 8;case a.RGB32F:case a.RGB32I:case a.RGB32UI:return 12;case a.RGBA32F:case a.RGBA32I:case a.RGBA32UI:return 16;case c.COMPRESSED_RGB_S3TC_DXT1_EXT:case c.COMPRESSED_RGBA_S3TC_DXT1_EXT:return.5;case c.COMPRESSED_RGBA_S3TC_DXT3_EXT:case c.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case c.COMPRESSED_R11_EAC:case c.COMPRESSED_SIGNED_R11_EAC:case c.COMPRESSED_RGB8_ETC2:case c.COMPRESSED_SRGB8_ETC2:case c.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case c.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return.5;case c.COMPRESSED_RG11_EAC:case c.COMPRESSED_SIGNED_RG11_EAC:case c.COMPRESSED_RGBA8_ETC2_EAC:case c.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}export{i as bindVertexBufferLayout,_ as getFormatBytesPerElement,o as getFormatComponents};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t,s,i,h,o,e=!1,r=0){this.name=t,this.count=s,this.type=i,this.offset=h,this.stride=o,this.normalized=e,this.divisor=r}}export{t as VertexElementDescriptor};
5
+ class t{constructor(t,s,i,e,h,o=!1,r=0,n=!1){this.name=t,this.count=s,this.type=i,this.offset=e,this.stride=h,this.normalized=o,this.divisor=r,this.integer=n}}export{t as VertexElementDescriptor};