@arcgis/core 4.32.0-next.20250104 → 4.32.0-next.20250106

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 (37) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/13720b1d97fb7d80e972.js +1 -0
  3. package/assets/esri/core/workers/chunks/{00c0fbe19c12691cf2c3.js → 368a36be515e60e35154.js} +1 -1
  4. package/core/MemCachePool.js +1 -1
  5. package/interfaces.d.ts +90 -0
  6. package/package.json +1 -1
  7. package/support/revision.js +1 -1
  8. package/views/2d/engine/webgl/Painter.js +1 -1
  9. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  10. package/views/2d/engine/webgl/meshing/SimpleMesh.js +1 -1
  11. package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
  12. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  13. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityResources.js +1 -1
  14. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  15. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  16. package/views/2d/input/MapViewInputManager.js +1 -1
  17. package/views/2d/input/handlers/DragPan.js +1 -1
  18. package/views/2d/input/handlers/DragRotate.js +1 -1
  19. package/views/2d/input/handlers/MouseWheelZoom.js +1 -1
  20. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  21. package/views/3d/input/SceneInputManager.js +1 -1
  22. package/views/3d/input/handlers/DragRotate.js +1 -1
  23. package/views/3d/input/handlers/DragZoom.js +1 -1
  24. package/views/3d/input/handlers/MouseWheelZoom.js +1 -1
  25. package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
  26. package/views/3d/layerViewModuleImportUtils.js +1 -1
  27. package/views/3d/layers/GroupLayerView3D.js +5 -0
  28. package/views/3d/terrain/OverlayManager.js +1 -1
  29. package/views/3d/webgl-engine/lib/Intersector.js +1 -1
  30. package/views/View2D.js +1 -1
  31. package/views/input/handlers/support.js +1 -1
  32. package/views/navigation/Navigation.js +1 -1
  33. package/views/navigation/NavigationActionMap.d.ts +4 -0
  34. package/views/navigation/NavigationActionMap.js +5 -0
  35. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  36. package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
  37. package/assets/esri/core/workers/chunks/3582836342fa78873fe4.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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{RemoveMode as e,NoPriority as c}from"./MemCache.js";class t{constructor(c,t){this._cache=c(t,((c,t,h)=>{switch(t){case e.ALL:return c.forEach((e=>e.dispose())),0;case e.SOME:{const e=c.shift();return e&&(h-=Math.round(e.cachedMemory),e.dispose()),h}}}))}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}getSize(e){return this._cache.getSize(e)}pop(e){const c=this._cache.peek(e);if(!c)return;const t=c.pop();return c.length>0?t&&(c.cachedMemory=this._cache.getSize(e)-Math.round(t.cachedMemory),this._cache.updateSize(e,c)):this._cache.pop(e),t}put(e,t,s=c){const r=this._cache.peek(e);if(r)r.push(t),r.cachedMemory=this._cache.getSize(e)+Math.round(t.cachedMemory),this._cache.updateSize(e,r);else{const c=new h(t);this._cache.put(e,c,s)}}}class h extends Array{constructor(e){super(),this.item=e,this.cachedMemory=e.cachedMemory,this.push(e)}}export{t as MemCachePool};
5
+ import e from"./Logger.js";import{RemoveMode as c,NoPriority as t}from"./MemCache.js";const h=()=>e.getLogger("esri/core/MemCachePool");class r{constructor(e,t){this._cache=e(t,((e,t,r)=>{switch(t){case c.ALL:return e.forEach((e=>e.dispose())),0;case c.SOME:{const c=e.shift();return c?(r-=Math.round(c.cachedMemory),c.dispose()):r>0&&(h().warn("Encountered empty MemCachePool with non-zero memory."),r=0),r}}}))}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}getSize(e){return this._cache.getSize(e)}pop(e){const c=this._cache.peek(e);if(!c)return;const t=c.pop();return c.length>0?t&&(c.cachedMemory=this._cache.getSize(e)-Math.round(t.cachedMemory),this._cache.updateSize(e,c)):this._cache.pop(e),t}put(e,c,h=t){const r=this._cache.peek(e);if(r)r.push(c),r.cachedMemory=this._cache.getSize(e)+Math.round(c.cachedMemory),this._cache.updateSize(e,r);else{const t=new s(c);this._cache.put(e,t,h)}}}class s extends Array{constructor(e){super(),this.item=e,this.cachedMemory=e.cachedMemory,this.push(e)}}export{r as MemCachePool};
package/interfaces.d.ts CHANGED
@@ -92383,6 +92383,12 @@ declare namespace __esri {
92383
92383
  }
92384
92384
 
92385
92385
  export class Navigation extends Accessor {
92386
+ /**
92387
+ * The navigation action map defines the default behavior of the navigation controls.
92388
+ *
92389
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#actionMap Read more...}
92390
+ */
92391
+ actionMap: NavigationActionMap;
92386
92392
  /**
92387
92393
  * Indicates if single finger touch {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-drag drag} events are enabled or disabled.
92388
92394
  *
@@ -92409,6 +92415,7 @@ declare namespace __esri {
92409
92415
  * Indicates whether the view can be zoomed in or out with the mouse wheel.
92410
92416
  *
92411
92417
  * @default true
92418
+ * @deprecated since version 4.32. Use {@link module:esri/views/navigation/NavigationActionMap#mouseWheel actionMap.mouseWheel} instead.
92412
92419
  *
92413
92420
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#mouseWheelZoomEnabled Read more...}
92414
92421
  */
@@ -92422,6 +92429,12 @@ declare namespace __esri {
92422
92429
  }
92423
92430
 
92424
92431
  interface NavigationProperties {
92432
+ /**
92433
+ * The navigation action map defines the default behavior of the navigation controls.
92434
+ *
92435
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#actionMap Read more...}
92436
+ */
92437
+ actionMap?: NavigationActionMapProperties;
92425
92438
  /**
92426
92439
  * Indicates if single finger touch {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-drag drag} events are enabled or disabled.
92427
92440
  *
@@ -92443,11 +92456,88 @@ declare namespace __esri {
92443
92456
  /**
92444
92457
  * Indicates whether the view can be zoomed in or out with the mouse wheel.
92445
92458
  *
92459
+ * @deprecated since version 4.32. Use {@link module:esri/views/navigation/NavigationActionMap#mouseWheel actionMap.mouseWheel} instead.
92460
+ *
92446
92461
  * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#mouseWheelZoomEnabled Read more...}
92447
92462
  */
92448
92463
  mouseWheelZoomEnabled?: boolean;
92449
92464
  }
92450
92465
 
92466
+ export class NavigationActionMap extends Accessor {
92467
+ /**
92468
+ * The primary drag navigation action.
92469
+ *
92470
+ * @default "pan"
92471
+ *
92472
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragPrimary Read more...}
92473
+ */
92474
+ dragPrimary: DragAction;
92475
+ /**
92476
+ * The secondary drag navigation action.
92477
+ *
92478
+ * @default "rotate"
92479
+ *
92480
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragSecondary Read more...}
92481
+ */
92482
+ dragSecondary: DragAction;
92483
+ /**
92484
+ * The tertiary drag navigation action.
92485
+ *
92486
+ * @default "zoom"
92487
+ *
92488
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragTertiary Read more...}
92489
+ */
92490
+ dragTertiary: DragAction;
92491
+ /**
92492
+ * The mouse wheel zoom action.
92493
+ *
92494
+ * @default "zoom"
92495
+ *
92496
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#mouseWheel Read more...}
92497
+ */
92498
+ mouseWheel: "zoom" | "none";
92499
+ /**
92500
+ * The navigation action map defines the default behavior of the navigation controls.
92501
+ *
92502
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html Read more...}
92503
+ */
92504
+ constructor(properties?: NavigationActionMapProperties);
92505
+ }
92506
+
92507
+ interface NavigationActionMapProperties {
92508
+ /**
92509
+ * The primary drag navigation action.
92510
+ *
92511
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragPrimary Read more...}
92512
+ */
92513
+ dragPrimary?: DragAction;
92514
+ /**
92515
+ * The secondary drag navigation action.
92516
+ *
92517
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragSecondary Read more...}
92518
+ */
92519
+ dragSecondary?: DragAction;
92520
+ /**
92521
+ * The tertiary drag navigation action.
92522
+ *
92523
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragTertiary Read more...}
92524
+ */
92525
+ dragTertiary?: DragAction;
92526
+ /**
92527
+ * The mouse wheel zoom action.
92528
+ *
92529
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#mouseWheel Read more...}
92530
+ */
92531
+ mouseWheel?: "zoom" | "none";
92532
+ }
92533
+
92534
+ /**
92535
+ * Type of action to be performed when a drag gesture is performed.
92536
+ *
92537
+ * {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#DragAction Read more...}
92538
+ */
92539
+ export type DragAction = "pan" | "rotate" | "zoom" | "none";
92540
+
92451
92541
  export class PopupView {
92452
92542
  popup: Popup;
92453
92543
  popupEnabled: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.32.0-next.20250104",
3
+ "version": "4.32.0-next.20250106",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- const b="20250104",c="2ba12bd5f0eb40cb900c28ed37dc2a34f6ba6b93";export{b as buildDate,c as commitHash};
5
+ const d="20250106",a="75a956abdbdedb2376d9c36946215a28d51f26d3";export{d as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import l from"./TextureManager.js";import{TextureUploadManager as h}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,CompareFunction as w,BlendFactor as M,RenderbufferFormat as P,BlendOperation as B,Face as C}from"../../../webgl/enums.js";import{FramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as T}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as N}from"../../../webgl/TextureDescriptor.js";class O{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new l(t),this.textureUploadManager=new h(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new N(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new F(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(w.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||A(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||A(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const l=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,l,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new N(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new T(P.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new F(this.context,s,this._stencilBuf),effect0:new F(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(s,o,r,i??{},n??{});return l.setUniforms(r),l.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=this._programCache.getProgram(i,{},n,a??{},o??{});if(l.setUniforms(n),l.bind(e),this.updatePipelineState(e),r)for(const h of r)s.bind(e,h),s.draw(e);else for(let h=0;h<s.parts.length;h++)s.bind(e,h),s.draw(e);s.unbind(e),l.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(M.ONE,M.ONE,M.ONE,M.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA)}}if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(C.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,r,i)}}}}}function A(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{O as default};
5
+ import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import l from"./TextureManager.js";import{TextureUploadManager as h}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,CompareFunction as w,BlendFactor as M,RenderbufferFormat as P,BlendOperation as B,Face as C}from"../../../webgl/enums.js";import{FramebufferObject as F}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as T}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as N}from"../../../webgl/TextureDescriptor.js";class O{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new l(t),this.textureUploadManager=new h(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach((e=>e.dispose())),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new N(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new F(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(w.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||A(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(r.gl.COLOR_BUFFER_BIT|r.gl.DEPTH_BUFFER_BIT),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(r.gl.STENCIL_BUFFER_BIT)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||A(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const l=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,l,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map((e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e))));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new N(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new T(P.DEPTH_STENCIL,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new F(this.context,s,this._stencilBuf),effect0:new F(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(s,o,r,i??{},n??{});return l.setUniforms(r),l.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=this._programCache.getProgram(i,{},n,a??{},o??{});if(l.setUniforms(n),l.bind(e),this.updatePipelineState(e),r)for(const h of r)s.bind(e,t.shader.locationInfo,h),s.draw(e);else for(let h=0;h<s.parts.length;h++)s.bind(e,t.shader.locationInfo,h),s.draw(e);s.unbind(e),l.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(M.ONE,M.ONE,M.ONE,M.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(M.ONE,M.ONE_MINUS_SRC_ALPHA,M.ONE,M.ONE_MINUS_SRC_ALPHA)}}if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(C.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(C.FRONT_AND_BACK,s,r,i)}}}}}function A(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{O 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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{dataSizeInBytes as t}from"./definitions.js";import{BufferObject as e}from"../../../../webgl/BufferObject.js";import{Usage as r,DataType as s}from"../../../../webgl/enums.js";import{VertexArrayObject as n}from"../../../../webgl/VertexArrayObject.js";import{VertexElementDescriptor as o}from"../../../../webgl/VertexElementDescriptor.js";class i{constructor(t,i){this._boundPart=null,this.vertexBuffers=new Map;for(const[s,n]of Object.entries(i.vertex)){const o=e.createVertex(t,r.STATIC_DRAW,n);this.vertexBuffers.set(s,o)}const a=new Map;for(const[s,n]of Object.entries(i.index??{})){const o=e.createIndex(t,r.STATIC_DRAW,n);a.set(s,o)}this.groups=[];for(const e of i.groups){let r;if(null!=e.index){if(!i.index?.[e.index])throw new Error("No index data.");const{BYTES_PER_ELEMENT:t}=i.index[e.index];2===t?r=s.UNSIGNED_SHORT:4===t&&(r=s.UNSIGNED_INT)}const d=null!=e.index?a.get(e.index):null,u=new Map,c=new Map;for(const t of e.attributes){const{name:e,count:r,type:s,offset:n,normalized:i,divisor:a,stride:d,vertex:f,location:l}=t;let p=c.get(f);p||(p=[],c.set(f,p));const h=new o(e,r,s,n,d,i,a);p.push(h),u.set(e,l)}const f=new n(t,u,c,this.vertexBuffers,d);this.groups.push({...e,vertexArray:f,locations:u,layout:c,indexing:r})}this.parts=i.parts}bind(t,e){this._boundPart=e;const{group:r}=this.parts[this._boundPart],{vertexArray:s}=this.groups[r];t.bindVAO(s)}draw(e){if(null==this._boundPart)throw new Error("Mesh.bind() has not been called.");const{start:r,count:s}=this.parts[this._boundPart],{group:n}=this.parts[this._boundPart],{indexing:o,primitive:i}=this.groups[n];o?e.drawElements(i,s,o,r*t[o]):e.drawArrays(i,r,s)}unbind(t){this._boundPart=null,t.bindVAO(null)}destroy(){for(const{vertexArray:t}of this.groups)t.dispose()}}export{i as Mesh};
5
+ import{BufferObject as e}from"../../../../webgl/BufferObject.js";import"../../../../webgl/FramebufferObject.js";import"../../../../../core/has.js";import"../../../../webgl/checkWebGLError.js";import{Usage as r}from"../../../../webgl/enums.js";import"../../../../webgl/GLObjectType.js";import"../../../../webgl/Texture.js";import{VertexArrayObject as t}from"../../../../webgl/VertexArrayObject.js";import{dataSizeInBytes as s}from"./definitions.js";class o{constructor(t,s){this._boundPart=null,this.vertexBuffers=new Map,this.indexBuffers=new Map,this.groups=[];for(const o in s.vertex){const{data:i,attributes:n}=s.vertex[o],f=e.createVertex(t,r.STATIC_DRAW,i);this.vertexBuffers.set(o,{buffer:f,attributes:n})}for(const[o,i]of Object.entries(s.index??{})){const s=e.createIndex(t,r.STATIC_DRAW,i);this.indexBuffers.set(o,{buffer:s})}for(const e of s.groups)this.groups.push({...e,vertexArrays:new Map});this.parts=s.parts}bind(e,r,s){this._boundPart=s;const{group:o}=this.parts[this._boundPart],i=this.groups[o];if(!i)throw new Error(`Missing group ${o}.`);let n=i.vertexArrays.get(r.stringHash);if(!n){const s=new Set(r.locations.keys()),o=i.index?this.indexBuffers.get(i.index)?.buffer:null,f=new Map,u=new Map;for(const[e,{buffer:r,attributes:t}]of this.vertexBuffers){const o=t.filter((e=>s.has(e.name)));o.length>0&&(f.set(e,o),u.set(e,r))}n=new t(e,r.locations,f,u,o),i.vertexArrays.set(r.stringHash,n)}e.bindVAO(n)}draw(e){if(null==this._boundPart)throw new Error("Mesh.bind() has not been called.");const{start:r,count:t}=this.parts[this._boundPart],{group:o}=this.parts[this._boundPart],{primitive:i,index:n}=this.groups[o];if(n){const o=this.indexBuffers.get(n);if(!o)throw new Error(`Missing index buffer "${n}".`);const{indexType:f}=o.buffer;if(!f)throw new Error("Buffer type error.");e.drawElements(i,t,f,r*s[f])}else e.drawArrays(i,r,t)}unbind(e){this._boundPart=null,e.bindVAO(null)}destroy(){for(const{vertexArrays:e}of this.groups)for(const[r,t]of e)t.disposeVAOOnly();for(const{buffer:e}of this.vertexBuffers.values())e.dispose();for(const{buffer:e}of this.indexBuffers.values())e.dispose()}}export{o as Mesh};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{dataSizeInBytes as t}from"./definitions.js";import{Mesh as e}from"./Mesh.js";import{DataType as i,PrimitiveType as r}from"../../../../webgl/enums.js";const n={position:{type:i.SHORT,count:2}};class o extends e{static create(e,i,r){const n=[];let{stride:s}=i;if(null==s){s=0;for(const[e,{count:r,type:n,offset:o}]of Object.entries(i.layout)){if(null!=o)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");s+=r*t[n]}}let a=0;for(const[o,{count:f,offset:d,type:m,normalized:x}]of Object.entries(i.layout)){null!=d&&(a=d);const e=r.get(o);if(null==e)throw new Error("Locations must be specified at mesh initialization.");const i={name:o,location:e,vertex:"vertexData",count:f,type:m,offset:a,stride:s,divisor:0,normalized:null!=x&&x};n.push(i),a+=f*t[m]}const l={attributes:n,primitive:i.primitive};null!=i.index&&(l.index="indexData");let{count:u}=i;if(null==u&&(u=i.index?i.index.length:i.vertex.byteLength/s,Math.floor(u)!==u))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${s}.`);const c={start:0,count:u,group:0,primitive:i.primitive},p={vertex:{vertexData:i.vertex},parts:[c],groups:[l]};return null!=i.index&&(p.index={indexData:i.index}),new o(e,p,i.layout)}static fromVertexStream(t,e){return o.create(t,{primitive:r.TRIANGLE_STRIP,vertex:new Uint16Array(e),layout:n},new Map([["position",0]]))}constructor(t,e,i){super(t,e),this._spec=i}bind(t,e=0){super.bind(t,e)}}export{o as SimpleMesh};
5
+ import{dataSizeInBytes as t}from"./definitions.js";import{Mesh as e}from"./Mesh.js";import{DataType as r,PrimitiveType as i}from"../../../../webgl/enums.js";import{VertexElementDescriptor as n}from"../../../../webgl/VertexElementDescriptor.js";const o={position:{type:r.SHORT,count:2}};class s extends e{static create(e,r){const i=[];let{stride:o}=r;if(null==o){o=0;for(const[e,{count:i,type:n,offset:s}]of Object.entries(r.layout)){if(null!=s)throw new Error("Stride cannot be computed automatically when attribute offsets are supplied explicitly.");o+=i*t[n]}}let a=0;for(const[s,{count:d,offset:f,type:m,normalized:x}]of Object.entries(r.layout)){null!=f&&(a=f);const e=new n(s,d,m,a,o,null!=x&&x,0);i.push(e),a+=d*t[m]}const l={primitive:r.primitive};null!=r.index&&(l.index="indexData");let{count:u}=r;if(null==u&&(u=r.index?r.index.length:r.vertex.byteLength/o,Math.floor(u)!==u))throw new Error(`The byte length of vertex data must be an exact multiple of the stride, which is ${o}.`);const c={start:0,count:u,group:0,primitive:r.primitive},p={vertex:{vertexData:{data:r.vertex,attributes:i}},parts:[c],groups:[l]};return null!=r.index&&(p.index={indexData:{data:r.index}}),new s(e,p,r.layout)}static fromVertexStream(t,e){return s.create(t,{primitive:i.TRIANGLE_STRIP,vertex:new Uint16Array(e),layout:o})}constructor(t,e,r){super(t,e),this._spec=r}bind(t,e,r=0){super.bind(t,e,r)}}export{s as SimpleMesh};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{numericHash as t}from"../../../../../core/string.js";import{TypedShaderProgram as e}from"./typed/TypedShaderProgram.js";class o{constructor(){this.computeAttributes={}}get locationsMap(){const t=new Map;for(const e in this.locations)t.set(e,this.locations[e].index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set(Object.keys(this.options));this._optionPropertyKeys=t}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,o=Array.from(e.entries()).map((([t,e])=>`${t}.${e}`)).join("."),n=t(o);this._locationInfo={hash:n,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const[e,o]of this.locationsMap.entries())t.set("a_"+e,o);return t}getShaderKey(t,e,o){return`${Object.keys(t).map((e=>`${e}.${t[e]}`)).join(".")}.${Object.keys(o).filter((t=>o[t])).map((t=>`${t}_${o[t].toString()}`)).join(".")}.${Object.keys(e).filter((t=>this.optionPropertyKeys.has(t))).join(".")}`}getProgram(t,o,n,r){let i="",s="";for(const e in n)if(n[e]){const t="boolean"==typeof n[e]?`#define ${e}\n`:`#define ${e} ${n[e]}\n`;i+=t,s+=t}return i+=this.vertexShader,s+=this.fragmentShader,new e(i,s,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(o),this._transformFeedbackBindings)}_getUniformBindings(t){const e=[];for(const o in this.required){const t=this.required[o];e.push({uniformHydrated:null,shaderModulePath:o,uniformName:o,uniformType:t.type,uniformArrayElementType:n(t),uniformArrayLength:r(t)})}for(const o in t){const i=this.options[o];if(t[o])for(const t in i){const s=i[t];e.push({uniformHydrated:null,shaderModulePath:`${o}.${t}`,uniformName:t,uniformType:s.type,uniformArrayElementType:n(s),uniformArrayLength:r(s)})}}return e}}const n=t=>"array"===t.type?t.elementType?.type:void 0,r=t=>"array"===t.type?t.size:void 0;export{o as GLSLShaderModule};
5
+ import{numericHash as t}from"../../../../../core/string.js";import{TypedShaderProgram as e}from"./typed/TypedShaderProgram.js";class o{constructor(){this.computeAttributes={}}get locationsMap(){const t=new Map;for(const e in this.locations)t.set(e,this.locations[e].index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set(Object.keys(this.options));this._optionPropertyKeys=t}return this._optionPropertyKeys}get _transformFeedbackBindings(){return[]}get locationInfo(){if(!this._locationInfo){const e=this.locationsMap,o=Array.from(e.entries()).map((([t,e])=>`${t}.${e}`)).join("."),n=t(o);this._locationInfo={hash:n,stringHash:o,locations:e,computeAttributeMap:this.computeAttributes}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const[e,o]of this.locationsMap.entries())t.set("a_"+e,o);return t}getShaderKey(t,e,o){return`${Object.keys(t).map((e=>`${e}.${t[e]}`)).join(".")}.${Object.keys(o).filter((t=>o[t])).map((t=>`${t}_${o[t].toString()}`)).join(".")}.${Object.keys(e).filter((t=>this.optionPropertyKeys.has(t))).join(".")}`}getProgram(t,o,n,r){let i="",s="";for(const e in n)if(n[e]){const t="boolean"==typeof n[e]?`#define ${e}\n`:`#define ${e} ${n[e]}\n`;i+=t,s+=t}return i+=this.vertexShader,s+=this.fragmentShader,new e(i,s,this.renamedLocationsMap,this.locationInfo,this._getUniformBindings(o),this._transformFeedbackBindings)}_getUniformBindings(t){const e=[];for(const o in this.required){const t=this.required[o];e.push({uniformHydrated:null,shaderModulePath:o,uniformName:o,uniformType:t.type,uniformArrayElementType:n(t),uniformArrayLength:r(t)})}for(const o in t){const i=this.options[o];if(t[o])for(const t in i){const s=i[t];e.push({uniformHydrated:null,shaderModulePath:`${o}.${t}`,uniformName:t,uniformType:s.type,uniformArrayElementType:n(s),uniformArrayLength:r(s)})}}return e}}const n=t=>"array"===t.type?t.elementType?.type:void 0,r=t=>"array"===t.type?t.size:void 0;export{o as GLSLShaderModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{ShaderBuilder2D as o}from"./ShaderBuilder2D.js";import{Float as n,Int as s,Vec4 as i,Vec2 as p}from"./graph/glsl.js";import{GlslShaderWriter as a}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as u}from"./graph/ShaderGraphContext.js";import{setReachableUids as c}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as y}from"./typed/TypedShaderProgram.js";function d(t){return new t}function f(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function h(t,e){return(r,o)=>{f(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{f(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{f(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{f(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{f(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{f(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{f(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const C=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class b{}b.builtins=[],t([C("gl_VertexID",s)],b.prototype,"glVertexID",void 0);class I{}class v{}v.builtins=[],t([C("gl_FragCoord",i)],v.prototype,"glFragCoord",void 0),t([C("gl_PointCoord",p)],v.prototype,"glPointCoord",void 0);class w{}class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new y(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new y("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),p=this._hydrateComputeInput(),y=p&&this._injectComputePackPrecisionFactor(p,t),d=this.vertex(i,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const a in h){const t=h[a];c(l,t)}const m=this._getVertexInputBuiltins(),g=u.createVertex({...s,...p},d,m,n,this.transformFeedbackBindings,l);(new a).write(g);const _=this._getFragmentInputBuiltins(h);_.set("glPointCoord","gl_PointCoord");const K=u.createFragment(f,h,_,n,g,this.transformFeedbackBindings);(new a).write(K);const x=this._createShaderBuilder(g,K),C=x.generate("vertex",!0),b=x.generate("fragment",!0);return this.logShader&&(console.log(C),console.log(b)),{vertex:C,fragment:b,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const o in t){const s=t[o],i=e[o];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[o]=s.divide(new n(i))}else r[o]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},o=new Map;for(const n in this.computeAttributes)for(const t of this.computeAttributes[n]??[])o.set(t,n);for(const s in t){const i=t[s],p=o.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new n(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new o;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,b as VertexInput,l as builtin,K as define,m as input,h as location,_ as option,x as transformFeedback,g as uniform};
5
+ import{_ as t}from"../../../../../chunks/tslib.es6.js";import"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{numericHash as r}from"../../../../../core/string.js";import{ShaderBuilder2D as o}from"./ShaderBuilder2D.js";import{Float as n,Int as s,Vec4 as i,Vec2 as p}from"./graph/glsl.js";import{GlslShaderWriter as a}from"./graph/GlslGraphWriter.js";import{ShaderGraphContext as u}from"./graph/ShaderGraphContext.js";import{setReachableUids as c}from"./graph/ShaderGraphNode.js";import{TypedShaderProgram as y}from"./typed/TypedShaderProgram.js";function d(t){return new t}function f(t,e,r){const o=t.constructor[e]??[];t.constructor.hasOwnProperty(e)||Object.defineProperty(t.constructor,e,{value:o.slice()}),t.constructor[e].push(r)}function h(t,e){return(r,o)=>{f(r,"locations",{typeCtor:e,propertyKey:o,parameterIndex:null,index:t})}}const l=t=>(e,r)=>{f(e,"builtins",{builtin:t,propertyKey:r})},m=t=>(e,r,o)=>{f(e,"inputs",{inputCtor:t,propertyKey:r,parameterIndex:o})},g=t=>(e,r)=>{f(e,"uniforms",{typeCtor:t,propertyKey:r})},_=t=>(e,r)=>{f(e,"options",{typeCtor:t,propertyKey:r})},K=(t,e)=>{f(t,"defines",{propertyKey:e})};function x(t){return(e,r)=>{f(e,"transformFeedbackBindings",{propertyKey:r,parameterIndex:null,index:t})}}const C=(t,e)=>(r,o)=>{r.constructor.builtins.push({builtin:t,propertyKey:o,typeCtor:e})};class b{}b.builtins=[],t([C("gl_VertexID",s)],b.prototype,"glVertexID",void 0);class I{}class v{}v.builtins=[],t([C("gl_FragCoord",i)],v.prototype,"glFragCoord",void 0),t([C("gl_PointCoord",p)],v.prototype,"glPointCoord",void 0);class w{}class P{constructor(){this.type="uniform-group"}get _uniforms(){return this.constructor.uniforms??[]}}class j{constructor(){this.logShader=!1,this.computeAttributes={}}get vertexInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&0===t.parameterIndex));if(!t)throw new Error("Unable to find vertex input parameter");return t}get computeInput(){return this._shaderModuleClass.inputs.findLast((t=>"vertex"===t.propertyKey&&1===t.parameterIndex))}get fragmentInput(){const t=this._shaderModuleClass.inputs.findLast((t=>"fragment"===t.propertyKey));if(!t)throw new Error("Unable to find fragment input parameter");return t}get transformFeedbackBindings(){return this.fragmentInput.inputCtor.transformFeedbackBindings??[]}get locations(){return[...this.vertexInput.inputCtor.locations,...this.computeInput?.inputCtor.locations??[]]}get locationsMap(){const t=new Map,r=new Set;for(const o of this.locations)r.has(o.index)?e.getLogger("esri.views.2d.engine.webgl.shaderGraph.GraphShaderModule").warnOnce("mapview-rendering",`Unable to assigned attribute ${o.propertyKey} to ${o.index}. Index already in use`,{locationsMap:t}):(t.set(o.propertyKey,o.index),r.add(o.index));return t}get locationInfo(){if(!this._locationInfo){const t=this.locationsMap,e=Array.from(t.entries()).map((([t,e])=>`${t}.${e}`)).join("."),o=r(e),n=this.computeAttributes;this._locationInfo={hash:o,stringHash:e,locations:t,computeAttributeMap:n}}return this._locationInfo}get renamedLocationsMap(){const t=new Map;for(const e of this.locations)t.set("a_"+e.propertyKey,e.index);return t}get optionPropertyKeys(){if(!this._optionPropertyKeys){const t=new Set;for(const e of this._options)t.add(e.propertyKey);this._optionPropertyKeys=t}return this._optionPropertyKeys}get _shaderModuleClass(){return this.constructor}get _defines(){return this._shaderModuleClass.defines??[]}get _options(){return this._shaderModuleClass.options??[]}get _uniforms(){return this._shaderModuleClass.uniforms??[]}getProgram(t,e,r,o){try{const{vertex:n,fragment:s,uniformBindings:i}=this._generateShaders(t,e,r,o);return new y(n,s,this.renamedLocationsMap,this.locationInfo,i,this.transformFeedbackBindings)}catch(n){return new y("","",this.renamedLocationsMap,this.locationInfo,[],this.transformFeedbackBindings)}}getDebugUniformClassInfo(t){const e=this._options.find((e=>e.propertyKey===t));if(e)return{type:"option",className:e.typeCtor};const r=this._uniforms.find((e=>e.propertyKey===t));if(!r)throw new Error(`Unable to find uniform class type for property: ${t}`);return{type:"required",className:r.typeCtor}}getShaderKey(t,e,r,o){const n=Object.keys(t).map((e=>`${e}.${t[e]}`)).join("."),s=Object.keys(r).map((t=>`${t}.${r[t]}`)).join("."),i=Object.keys(o).map((t=>`${t}.${o[t]}`)).join("."),p=Object.keys(e).filter((t=>this.optionPropertyKeys.has(t)&&e[t])).join(".");return`${this.constructor.name}.${n}.${s}.${i}.${p}`}_generateShaders(t,e,r,o){const n=[];this._setDefines(r),this._setOptionalUniforms(n,e),this._setRequiredUniforms(n);const s=this._hydrateVertexInput(o),i=this._injectPackPrecisionFactor(s,t),p=this._hydrateComputeInput(),y=p&&this._injectComputePackPrecisionFactor(p,t),d=this.vertex(i,y),f=this._hydrateFragmentInput(d),h=this.fragment(f),l=new Set;for(const a in h){const t=h[a];c(l,t)}const m=this._getVertexInputBuiltins(),g=u.createVertex({...s,...p},d,m,n,this.transformFeedbackBindings,l);(new a).write(g);const _=this._getFragmentInputBuiltins(h);_.set("glPointCoord","gl_PointCoord");const K=u.createFragment(f,h,_,n,g,this.transformFeedbackBindings);(new a).write(K);const x=this._createShaderBuilder(g,K),C=x.generate("vertex",!0),b=x.generate("fragment",!0);return this.logShader&&(console.log(C),console.log(b)),{vertex:C,fragment:b,uniformBindings:n}}_setDefines(t){for(const e in t)this[e]=t[e]}_setOptionalUniforms(t,e){for(const r of this._options){e[r.propertyKey]?this[r.propertyKey]=this._hydrateUniformGroup(t,r):this[r.propertyKey]=null}}_setRequiredUniforms(t){for(const e of this._uniforms)this[e.propertyKey]=this._hydrateUniformGroup(t,e)}_hydrateUniformGroup(t,e){const r=new(0,e.typeCtor);for(const o of r._uniforms??[]){const n=d(o.typeCtor),s=`u_${e.propertyKey}_${o.propertyKey}`,i=n.type,p=[e.propertyKey,o.propertyKey].join(".");if("type"in o.typeCtor&&"array"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else if("type"in o.typeCtor&&"array-2d"===o.typeCtor.type){const e=n;t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformArrayLength:e.size,uniformArrayElementType:e.elementType.type,uniformHydrated:n})}else t.push({shaderModulePath:p,uniformName:s,uniformType:i,uniformHydrated:n});r[o.propertyKey]=n}return r}_hydrateVertexInput(t){const e=this.vertexInput.inputCtor,r=e.locations.reduce(((e,r)=>!1===t[r.propertyKey]?e:{...e,[r.propertyKey]:d(r.typeCtor)}),{});for(const{propertyKey:o,typeCtor:n}of e.builtins){const t=d(n);r[o]=t}return r}_hydrateComputeInput(){if(null==this.computeInput)return null;return this.computeInput.inputCtor.locations.reduce(((t,e)=>({...t,[e.propertyKey]:d(e.typeCtor)})),{})}_injectPackPrecisionFactor(t,e){const r={};for(const o in t){const s=t[o],i=e[o];if(i){if("float"!==s.type&&"vec2"!==s.type&&"vec3"!==s.type&&"vec4"!==s.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${s.type}`);r[o]=s.divide(new n(i))}else r[o]=s}return r}_injectComputePackPrecisionFactor(t,e){const r={},o=new Map;for(const n in this.computeAttributes)for(const t of this.computeAttributes[n]??[])o.set(t,n);for(const s in t){const i=t[s],p=o.get(s);if(!p)continue;const a=e[p];if(a){if("float"!==i.type&&"vec2"!==i.type&&"vec3"!==i.type&&"vec4"!==i.type)throw new Error(`InternalError: packPrecisionFactor requires GenType, but found ${i.type}`);r[s]=i.divide(new n(a))}else r[s]=i}return r}_hydrateFragmentInput(t){const e={};for(const r in t)e[r]=t[r];for(const{propertyKey:r,typeCtor:o}of v.builtins){const t=d(o);e[r]=t}return e}_getVertexInputBuiltins(){const t=this.vertexInput.inputCtor,e=new Map;for(const{builtin:r,propertyKey:o}of t.builtins)e.set(o,r);return e}_getFragmentInputBuiltins(t){const e=t.constructor,r=new Map;for(const o of e.builtins??[])r.set(o.propertyKey,o.builtin);return r}_createShaderBuilder(t,e){const r=new o;return this._insertDebugInfo(r),t.insertVertexShader(r),e.insertFragmentShader(r),r}_insertDebugInfo(t){t.vertex.code.add("// DEFINES: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._defines)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`);t.vertex.code.add(""),t.vertex.code.add("// OPTIONS: "),t.vertex.code.add("// --------------------------------------------------------- ");for(const e of this._options)this[e.propertyKey]?t.vertex.code.add(`// ${e.propertyKey}: true`):t.vertex.code.add(`// ${e.propertyKey}: false`)}}export{I as ComputeVertexInput,v as FragmentInput,w as FragmentOutput,j as GraphShaderModule,P as UniformGroup,b as VertexInput,l as builtin,K as define,m as input,h as location,_ as option,x as transformFeedback,g as uniform};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,RenderbufferFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH_STENCIL,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t,o){if(null==this._dotMesh){const r=e,i=r*r,n=2,d=new Int16Array(i*n);for(let t=0;t<r;t++)for(let e=0;e<r;e++)d[n*(e+t*r)]=e,d[n*(e+t*r)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:d,count:i,layout:p},o)}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
5
+ import t from"../../../../../../../core/RandomLCG.js";import{tileSize as e}from"../../../definitions.js";import{SimpleMesh as s}from"../../../meshing/SimpleMesh.js";import{DataType as o,TextureSamplingMode as r,TextureWrapMode as i,RenderbufferFormat as n,PrimitiveType as h,PixelType as d}from"../../../../../../webgl/enums.js";import{FramebufferObject as u}from"../../../../../../webgl/FramebufferObject.js";import{Renderbuffer as l}from"../../../../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as _}from"../../../../../../webgl/RenderbufferDescriptor.js";import{Texture as T}from"../../../../../../webgl/Texture.js";import{TextureDescriptor as m}from"../../../../../../webgl/TextureDescriptor.js";const p={pos:{count:2,type:o.UNSIGNED_SHORT}};class f{constructor(){this._dotTextureSize=0,this._dotTextures=null,this._dotMesh=null}destroy(){this._disposeTextures(),this._dotFBO&&this._dotFBO.dispose(),this._dotMesh&&this._dotMesh.destroy()}getFBO(t){if(null==this._dotFBO){const s=e,o=e,h=new m(s,o);h.samplingMode=r.NEAREST,h.wrapMode=i.CLAMP_TO_EDGE;const d=new l(t,new _(n.DEPTH_STENCIL,s,o));this._dotFBO=new u(t,h,d)}return this._dotFBO}getDotDensityMesh(t){if(null==this._dotMesh){const o=e,r=o*o,i=2,n=new Int16Array(r*i);for(let t=0;t<o;t++)for(let e=0;e<o;e++)n[i*(e+t*o)]=e,n[i*(e+t*o)+1]=t;this._dotMesh=s.create(t,{primitive:h.POINTS,vertex:n,count:r,layout:p})}return this._dotMesh}getDotDensityTextures(e,s,o){if(this._dotTextureSize===s&&this._seed===o||(this._disposeTextures(),this._dotTextureSize=s,this._seed=o),null===this._dotTextures){const r=new t(o);this._dotTextures=[this._allocDotDensityTexture(e,s,r),this._allocDotDensityTexture(e,s,r)]}return this._dotTextures}_disposeTextures(){if(this._dotTextures){for(let t=0;t<this._dotTextures.length;t++)this._dotTextures[t].dispose();this._dotTextures=null}}_allocDotDensityTexture(t,e,s){const o=new Float32Array(e*e*4);for(let r=0;r<o.length;r++)o[r]=s.getFloat();const i=new m;return i.dataType=d.FLOAT,i.samplingMode=r.NEAREST,i.width=e,i.height=e,new T(t,i,o)}}export{f as DotDensityResources};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{tileSize as e,textureBindingRenderer0 as t,textureBindingRenderer1 as i}from"../../../definitions.js";import{getLocations as o}from"../../utils.js";import{FeatureTechnique as r}from"../FeatureTechnique.js";import{isHighlight as s,isHittest as n,getFeatureUniforms as a,getSelectionDefines as l,getFeaturePipelineState as d,getViewUniforms as u}from"../featureTechniqueUtils.js";import{TechniqueType as c}from"../TechniqueType.js";import{DotDensityPointShader as p}from"./DotDensityPointShader.js";import{DotDensityPolygonShader as h}from"./DotDensityPolygonShader.js";import{DotDensityResources as m}from"./DotDensityResources.js";import{FillShader as f}from"../shaders/FillShader.js";import{FramebufferBit as w}from"../../../../../../webgl/enums.js";class g extends r{constructor(){super(...arguments),this.type=c.DotDensity,this.shaders={polygon:new h,point:new p,fill:new f},this._resources=new Map}render(e,t){s(e)||n(e)?this._renderPolygons(e,t):this._renderDotDensity(e,t)}_renderPolygons(e,t){const{painter:i}=e;i.setShader({shader:this.shaders.fill,uniforms:{...a(e,t.target),visualVariableColor:null,visualVariableOpacity:null},defines:{...l(e)},optionalAttributes:{zoomRange:!1},useComputeBuffer:n(e)}),i.setPipelineState(d(e)),i.submitDraw(e,t)}_renderDotDensity(r,s){const{context:n,painter:c,requiredLevel:p}=r,h=s.instance.getInput().uniforms,m=this._getOrCreateResourcesRecord(n),f=m.getDotDensityTextures(n,e,h.seed),g=1/2**(p-s.target.key.level),x=e,D=x*window.devicePixelRatio*x*window.devicePixelRatio,y=1/g*(1/g),b=h.dotScale?r.state.scale/h.dotScale:1,R=h.dotValue*b*y;c.setShader({shader:this.shaders.polygon,uniforms:{...a(r,s.target),instance:{isActive:h.isActive,colors:h.colors,dotValue:Math.max(1,R)},draw:{dotTexture0:{unit:t,texture:f[0]},dotTexture1:{unit:i,texture:f[1]},tileZoomFactor:g,pixelRatio:window.devicePixelRatio,tileDotsOverArea:D/(e*window.devicePixelRatio*e*window.devicePixelRatio)}},defines:{...l(r),blending:h.blending},optionalAttributes:{},useComputeBuffer:!1});const v=n.getViewport();n.setViewport(0,0,e,e);const P=n.getBoundFramebufferObject(),S=m.getFBO(n);n.bindFramebuffer(S),n.setClearColor(0,0,0,0),n.clear(w.COLOR),c.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),c.updatePipelineState(n),c.submitDraw(r,s),n.bindFramebuffer(P),n.setViewport(v.x,v.y,v.width,v.height);const j=m.getFBO(n).colorTexture,_={shader:this.shaders.point,uniforms:{view:u(r,s.target),instance:{dotSize:h.dotSize},draw:{locations:{unit:t,texture:j},tileZoomFactor:1,pixelRatio:window.devicePixelRatio}},defines:{...l(r)},optionalAttributes:{},useComputeBuffer:!1};c.setPipelineState(d(r)),c.submitDrawMesh(n,_,m.getDotDensityMesh(n,o(this.shaders.point)))}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e)}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return null==t&&(t=new m,this._resources.set(e,t)),t}}export{g as DotDensityTechnique};
5
+ import{tileSize as e,textureBindingRenderer0 as t,textureBindingRenderer1 as i}from"../../../definitions.js";import{FeatureTechnique as o}from"../FeatureTechnique.js";import{isHighlight as r,isHittest as s,getFeatureUniforms as n,getSelectionDefines as a,getFeaturePipelineState as l,getViewUniforms as d}from"../featureTechniqueUtils.js";import{TechniqueType as u}from"../TechniqueType.js";import{DotDensityPointShader as c}from"./DotDensityPointShader.js";import{DotDensityPolygonShader as p}from"./DotDensityPolygonShader.js";import{DotDensityResources as h}from"./DotDensityResources.js";import{FillShader as m}from"../shaders/FillShader.js";import{FramebufferBit as f}from"../../../../../../webgl/enums.js";class w extends o{constructor(){super(...arguments),this.type=u.DotDensity,this.shaders={polygon:new p,point:new c,fill:new m},this._resources=new Map}render(e,t){r(e)||s(e)?this._renderPolygons(e,t):this._renderDotDensity(e,t)}_renderPolygons(e,t){const{painter:i}=e;i.setShader({shader:this.shaders.fill,uniforms:{...n(e,t.target),visualVariableColor:null,visualVariableOpacity:null},defines:{...a(e)},optionalAttributes:{zoomRange:!1},useComputeBuffer:s(e)}),i.setPipelineState(l(e)),i.submitDraw(e,t)}_renderDotDensity(o,r){const{context:s,painter:u,requiredLevel:c}=o,p=r.instance.getInput().uniforms,h=this._getOrCreateResourcesRecord(s),m=h.getDotDensityTextures(s,e,p.seed),w=1/2**(c-r.target.key.level),g=e,x=g*window.devicePixelRatio*g*window.devicePixelRatio,D=1/w*(1/w),y=p.dotScale?o.state.scale/p.dotScale:1,b=p.dotValue*y*D;u.setShader({shader:this.shaders.polygon,uniforms:{...n(o,r.target),instance:{isActive:p.isActive,colors:p.colors,dotValue:Math.max(1,b)},draw:{dotTexture0:{unit:t,texture:m[0]},dotTexture1:{unit:i,texture:m[1]},tileZoomFactor:w,pixelRatio:window.devicePixelRatio,tileDotsOverArea:x/(e*window.devicePixelRatio*e*window.devicePixelRatio)}},defines:{...a(o),blending:p.blending},optionalAttributes:{},useComputeBuffer:!1});const R=s.getViewport();s.setViewport(0,0,e,e);const v=s.getBoundFramebufferObject(),P=h.getFBO(s);s.bindFramebuffer(P),s.setClearColor(0,0,0,0),s.clear(f.COLOR),u.setPipelineState({color:{write:[!0,!0,!0,!0],blendMode:"composite"},depth:!1,stencil:!1}),u.updatePipelineState(s),u.submitDraw(o,r),s.bindFramebuffer(v),s.setViewport(R.x,R.y,R.width,R.height);const S=h.getFBO(s).colorTexture,_={shader:this.shaders.point,uniforms:{view:d(o,r.target),instance:{dotSize:p.dotSize},draw:{locations:{unit:t,texture:S},tileZoomFactor:1,pixelRatio:window.devicePixelRatio}},defines:{...a(o)},optionalAttributes:{},useComputeBuffer:!1};u.setPipelineState(l(o)),u.submitDrawMesh(s,_,h.getDotDensityMesh(s))}shutdown(e){super.shutdown(e),this._resources.get(e)?.destroy(),this._resources.delete(e)}_getOrCreateResourcesRecord(e){let t=this._resources.get(e);return null==t&&(t=new h,this._resources.set(e,t)),t}}export{w as DotDensityTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as i}from"../Technique.js";import{TechniqueType as o}from"../TechniqueType.js";import{OverlayShader as r}from"../shaders/OverlayShader.js";import{CompareFunction as n,StencilOperation as a,DataType as p,PrimitiveType as h}from"../../../../../../webgl/enums.js";class u extends i{constructor(){super(...arguments),this.type=o.Overlay,this._mesh=null,this.shaders={overlay:new r}}render(e,t){const{context:i,painter:o}=e,r=this._getMesh(e,t);o.setPipelineState(s);const{isWrapAround:p,wrapAroundShift:h}=t.config,u={...t.config,wrapAroundShift:0},m={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:u},defines:null,optionalAttributes:null,useComputeBuffer:!1};o.setPipelineState({...s,stencil:{write:!1,test:{compare:n.EQUAL,op:{fail:a.KEEP,zFail:a.KEEP,zPass:a.REPLACE},ref:0,mask:255}}}),o.submitDrawMeshUntyped(i,m,r),p&&(u.wrapAroundShift=h,o.submitDrawMeshUntyped(i,m,r))}shutdown(){e(this._mesh)}_getMesh(e,s){const{context:i}=e;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.setData(s.position)}else{const e=null!=s.index?s.index.length:s.position.length/2;this._mesh=new t(i,{vertex:{positions:s.position,uvs:s.tex},index:null!=s.index?{index:s.index}:void 0,groups:[{attributes:[{name:"pos",count:2,type:p.FLOAT,location:0,vertex:"positions",stride:8,offset:0},{name:"tex",count:2,type:p.UNSIGNED_SHORT,location:1,vertex:"uvs",stride:4,offset:0}],index:null!=s.index?"index":void 0,primitive:h.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}}export{u as OverlayTechnique};
5
+ import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as s}from"../../utils.js";import{Technique as r}from"../Technique.js";import{TechniqueType as i}from"../TechniqueType.js";import{OverlayShader as o}from"../shaders/OverlayShader.js";import{CompareFunction as n,StencilOperation as a,DataType as h,PrimitiveType as p}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as m}from"../../../../../../webgl/VertexElementDescriptor.js";class u extends r{constructor(){super(...arguments),this.type=i.Overlay,this._mesh=null,this.shaders={overlay:new o}}render(e,t){const{context:r,painter:i}=e,o=this._getMesh(e,t);i.setPipelineState(s);const{isWrapAround:h,wrapAroundShift:p}=t.config,m={...t.config,wrapAroundShift:0},u={shader:this.shaders.overlay,uniforms:{transform:t.transform,config:m},defines:null,optionalAttributes:null,useComputeBuffer:!1};i.setPipelineState({...s,stencil:{write:!1,test:{compare:n.EQUAL,op:{fail:a.KEEP,zFail:a.KEEP,zPass:a.REPLACE},ref:0,mask:255}}}),i.submitDrawMeshUntyped(r,u,o),h&&(m.wrapAroundShift=p,i.submitDrawMeshUntyped(r,u,o))}shutdown(){e(this._mesh)}_getMesh(e,s){const{context:r}=e;if(this._mesh){const e=this._mesh.vertexBuffers.get("positions");if(!e)throw new Error("Buffer not found");e.buffer.setData(s.position)}else{const e=null!=s.index?s.index.length:s.position.length/2;this._mesh=new t(r,{vertex:{positions:{data:s.position,attributes:[new m("pos",2,h.FLOAT,0,8)]},uvs:{data:s.tex,attributes:[new m("tex",2,h.UNSIGNED_SHORT,0,4)]}},index:null!=s.index?{index:{data:s.index}}:void 0,groups:[{index:null!=s.index?"index":void 0,primitive:p.TRIANGLE_STRIP}],parts:[{group:0,start:0,count:e}]})}return this._mesh}}export{u as OverlayTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n}from"../../../core/reactiveUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as p}from"./handlers/DoubleTapDragZoom.js";import{DragPan as m}from"./handlers/DragPan.js";import{DragRotate as u}from"./handlers/DragRotate.js";import{GamepadNavigation as l}from"./handlers/GamepadNavigation.js";import{KeyPan as h}from"./handlers/KeyPan.js";import{KeyRotate as w}from"./handlers/KeyRotate.js";import{KeyZoom as d}from"./handlers/KeyZoom.js";import{MouseWheelZoom as v}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as g}from"./handlers/PinchAction.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as j,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{DoubleTapDrag as D}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as A}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as M}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as b}from"../../input/recognizers/SingleAndDoubleClick.js";const T={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}};let z=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r((()=>!e()),(()=>this._disconnect())),r(e,(()=>this._connect()))])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new f(e,this.view.input),o=[new M,new P,new b,new A(this.view.navigation),new D],r=new j({eventSource:t,recognizers:o});r.installHandlers("prevent-context-menu",[new _],y.INTERNAL),r.installHandlers("navigation",[new g(this.view),new l(this.view),new v(this.view),new c(this.view),new c(this.view,[T.counter]),new m(this.view,"primary"),new h(this.view,T.pan),new d(this.view,T.zoom),new w(this.view,T.rotate),new u(this.view,"secondary"),new p(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,i((()=>this.view?.navigation?.browserTouchPanEnabled),(e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)}),n)}get test(){}};e([s()],z.prototype,"view",void 0),e([s()],z.prototype,"latestPointerType",null),e([s()],z.prototype,"latestPointerLocation",null),e([s()],z.prototype,"multiTouchActive",null),z=e([a("esri.views.2d.input.MapViewInputManager")],z);const C=z;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as p}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as m}from"./handlers/DoubleTapDragZoom.js";import{DragPan as l}from"./handlers/DragPan.js";import{DragRotate as u}from"./handlers/DragRotate.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyPan as w}from"./handlers/KeyPan.js";import{KeyRotate as d}from"./handlers/KeyRotate.js";import{KeyZoom as v}from"./handlers/KeyZoom.js";import{MouseWheelZoom as g}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as f}from"./handlers/PinchAction.js";import{BrowserEventSource as j}from"../../input/BrowserEventSource.js";import{InputManager as A,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{DoubleTapDrag as M}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as P}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as z}from"../../input/recognizers/SingleAndDoubleClick.js";const C={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},L=Symbol("handles");let k=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r((()=>!e()),(()=>this._disconnect())),r(e,(()=>this._connect()))])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(L),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new j(e,this.view.input),o=[new P,new T,new z,new b(this.view.navigation),new M],r=new A({eventSource:t,recognizers:o}),a=new l(this.view,["primary"]),c=new u(this.view,["secondary"]);r.installHandlers("prevent-context-menu",[new _],y.INTERNAL),r.installHandlers("navigation",[new f(this.view),new h(this.view),new g(this.view),new p(this.view),new p(this.view,[C.counter]),a,new w(this.view,C.pan),new v(this.view,C.zoom),new d(this.view,C.rotate),c,new m(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,this.addHandles([i((()=>this.view?.navigation?.browserTouchPanEnabled),(e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)}),n),i((()=>{const{actionMap:e}=this.view.navigation;return{panActions:D("pan",e),rotateActions:D("rotate",e)}}),(({panActions:e,rotateActions:t})=>{a.pointerActions=e,c.pointerActions=t}),s)],L)}get test(){}};e([a()],k.prototype,"view",void 0),e([a()],k.prototype,"latestPointerType",null),e([a()],k.prototype,"latestPointerLocation",null),e([a()],k.prototype,"multiTouchActive",null),k=e([c("esri.views.2d.input.MapViewInputManager")],k);const E=k;export{E 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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{DragEventSeparator as t}from"../../../input/DragEventSeparator.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{eventMatchesPointerAction as a}from"../../../input/handlers/support.js";class n extends i{constructor(t,i,a){super(!0),this.view=t,this.pointerAction=i,this.registerIncoming("drag",a,(t=>this._handleDrag(t))),this.registerIncoming("pointer-down",(()=>this.stopMomentumNavigation()))}onInstall(i){super.onInstall(i),this._dragEventSeparator=new t({start:(t,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(t,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(t,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(t,i)=>1===t&&a(i.data,this.pointerAction)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}}export{n as DragPan};
5
+ import{DragEventSeparator as t}from"../../../input/DragEventSeparator.js";import{InputHandler as i}from"../../../input/InputHandler.js";import{eventMatchesPointerActions as a}from"../../../input/handlers/support.js";class n extends i{constructor(t,i,a){super(!0),this.view=t,this.pointerActions=i,this.registerIncoming("drag",a,(t=>this._handleDrag(t))),this.registerIncoming("pointer-down",(()=>this.stopMomentumNavigation()))}onInstall(i){super.onInstall(i),this._dragEventSeparator=new t({start:(t,i)=>{this.view.mapViewNavigation.pan.begin(this.view,i.data),i.stopPropagation()},update:(t,i)=>{this.view.mapViewNavigation.pan.update(this.view,i.data),i.stopPropagation()},end:(t,i)=>{this.view.mapViewNavigation.pan.end(this.view,i.data),i.stopPropagation()},condition:(t,i)=>1===t&&a(i.data,this.pointerActions)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}}export{n as DragPan};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{DragEventSeparator as t}from"../../../input/DragEventSeparator.js";import{InputHandler as a}from"../../../input/InputHandler.js";import{eventMatchesPointerAction as i}from"../../../input/handlers/support.js";class o extends a{constructor(a,o,r){super(!0),this._view=a,this.pointerAction=o;const e=this._view.mapViewNavigation;this._dragEventSeparator=new t({start:(t,a)=>{e.rotate.begin(this._view,a.data),a.stopPropagation()},update:(t,a)=>{e.rotate.update(this._view,a.data),a.stopPropagation()},end:(t,a)=>{e.rotate.end(),a.stopPropagation()},condition:(t,a)=>1===t&&i(a.data,this.pointerAction)}),this.registerIncoming("drag",r,(t=>this._dragEventSeparator.handle(t)))}}export{o as DragRotate};
5
+ import{DragEventSeparator as t}from"../../../input/DragEventSeparator.js";import{InputHandler as a}from"../../../input/InputHandler.js";import{eventMatchesPointerActions as i}from"../../../input/handlers/support.js";class o extends a{constructor(a,o,r){super(!0),this._view=a,this.pointerActions=o;const e=this._view.mapViewNavigation;this._dragEventSeparator=new t({start:(t,a)=>{e.rotate.begin(this._view,a.data),a.stopPropagation()},update:(t,a)=>{e.rotate.update(this._view,a.data),a.stopPropagation()},end:(t,a)=>{e.rotate.end(),a.stopPropagation()},condition:(t,a)=>1===t&&i(a.data,this.pointerActions)}),this.registerIncoming("drag",r,(t=>this._dragEventSeparator.handle(t)))}}export{o as DragRotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{InputHandler as e}from"../../../input/InputHandler.js";const t=.6;class o extends e{constructor(e,t){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",t,(e=>this._handleMouseWheel(e)))}_handleMouseWheel(e){if(!this._view.navigation.mouseWheelZoomEnabled)return;if(e.preventDefault(),e.stopPropagation(),!this._canZoom)return;const o=this._view.mapViewNavigation,{x:n,y:i,deltaY:s}=e.data,a=1/t**(1/60*s),h=o.zoom(a,[n,i]);h&&(this._canZoom=!1,h.catch((()=>{})).then((()=>{this._canZoom=!0,o.end()})))}}export{o as MouseWheelZoom};
5
+ import{InputHandler as e}from"../../../input/InputHandler.js";const t=.6;class o extends e{constructor(e,t){super(!0),this._view=e,this._canZoom=!0,this.registerIncoming("mouse-wheel",t,(e=>this._handleMouseWheel(e)))}_handleMouseWheel(e){if("zoom"!==this._view.navigation.actionMap.mouseWheel)return;if(e.preventDefault(),e.stopPropagation(),!this._canZoom)return;const o=this._view.mapViewNavigation,{x:i,y:n,deltaY:s}=e.data,a=1/t**(1/60*s),h=o.zoom(a,[i,n]);h&&(this._canZoom=!1,h.catch((()=>{})).then((()=>{this._canZoom=!0,o.end()})))}}export{o as MouseWheelZoom};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{s as i,c as n,n as c,h as a,g as l}from"../../../../chunks/vec32.js";import{clone as m,create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as u,copy as d,fromPoints as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as I}from"../../terrain/Intersector.js";import{newIntersector as v}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as b}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as R}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import P from"../../../../geometry/Point.js";let L=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=v(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=w.MIN}getScreenPointIntersection(e){const r=t(e,g.get()),o=j(this.view.state.camera,r,U);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=w.MIN,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const n=p();if(!s.getIntersectionPoint(n))return null;if(null!=r?.maxDistance&&i(n,e.origin)>r.maxDistance**2)return null;const c=t.renderCoordsHelper.fromRenderCoords(n,new P({spatialReference:t.spatialReference})),a=m(s.normal);if(I(s))return new h({type:b.TERRAIN,id:s.target.lij.slice(),mapPoint:c,renderPoint:n,normal:a,ray:d(e),graphic:null});const l=R(s,t);if(null==l)return null;const{layer:u,sourceLayer:f}=l,g="scene"===f?.type?y(l,f.objectIdField):l.uid;return new h({type:b.OBJECT,id:`${u?.uid}/${g}`,mapPoint:c,renderPoint:n,normal:a,ray:d(e),graphic:l})}updateFromGroundIntersection(e,r,t){const o=S,s=x,i=C,p=O;n(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,i),c(i,i);const u=this.view.basemapTerrain.visibleElevationBounds,d=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));a(p,i,d),l(o,s,p),f(o,s,U);const g=this._getRayIntersection(U,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=g){const e=O;return a(e,i,r),l(t,g.renderPoint,e),m(g.normal)}return n(t,e),null}};e([o()],L.prototype,"view",void 0),e([o()],L.prototype,"intersector",void 0),L=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],L);const S=p(),x=p(),C=p(),O=p(),U=u();export{L as LineOfSightRayIntersector};
5
+ import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as i,n,h as c,g as a}from"../../../../chunks/vec32.js";import{clone as l,create as m}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{create as p,copy as u,fromPoints as d}from"../../../../geometry/support/ray.js";import{sv2d as f}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as g}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as y}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as j}from"../../terrain/Intersector.js";import{newIntersector as I}from"../../webgl-engine/lib/Intersector.js";import{StoreResults as w,IntersectorType as v}from"../../webgl-engine/lib/IntersectorInterfaces.js";import{toGraphic as b}from"../../webgl-engine/lib/intersectorUtilsConversions.js";import R from"../../../../geometry/Point.js";let P=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=I(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=w.MIN}getScreenPointIntersection(e){const r=t(e,f.get()),o=y(this.view.state.camera,r,O);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=w.MIN,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const i=m();if(!s.getIntersectionPoint(i))return null;if(null!=r?.maxDistance&&!s.withinDistance(r.maxDistance))return null;const n=t.renderCoordsHelper.fromRenderCoords(i,new R({spatialReference:t.spatialReference})),c=l(s.normal);if(j(s))return new h({type:v.TERRAIN,id:s.target.lij.slice(),mapPoint:n,renderPoint:i,normal:c,ray:u(e),graphic:null});const a=b(s,t);if(null==a)return null;const{layer:p,sourceLayer:d}=a,f="scene"===d?.type?g(a,d.objectIdField):a.uid;return new h({type:v.OBJECT,id:`${p?.uid}/${f}`,mapPoint:n,renderPoint:i,normal:c,ray:u(e),graphic:a})}updateFromGroundIntersection(e,r,t){const o=L,s=S,m=x,p=C;i(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,m),n(m,m);const u=this.view.basemapTerrain.visibleElevationBounds,f=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));c(p,m,f),a(o,s,p),d(o,s,O);const g=this._getRayIntersection(O,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:f});if(null!=g){const e=C;return c(e,m,r),a(t,g.renderPoint,e),l(g.normal)}return i(t,e),null}};e([o()],P.prototype,"view",void 0),e([o()],P.prototype,"intersector",void 0),P=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],P);const L=m(),S=m(),x=m(),C=m(),O=p();export{P as LineOfSightRayIntersector};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{watch as r,initial as i}from"../../../core/reactiveUtils.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as s}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as d}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as c}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as l}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as u}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as g}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as h}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as w}from"../../input/BrowserEventSource.js";import{InputManager as y,ViewEventPriorities as _}from"../../input/InputManager.js";import{PreventContextMenu as f}from"../../input/handlers/PreventContextMenu.js";import{Drag as v}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as D}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as A}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as j}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as M}from"../../input/recognizers/VerticalTwoFingerDrag.js";import{PivotPoint as P}from"../state/controllers/RotateController.js";let b=class extends e{destroy(){this.disconnect()}get primaryDragAction(){return this._get("primaryDragAction")}set primaryDragAction(t){"pan"!==t&&"rotate"!==t||t===this._get("primaryDragAction")||(this._set("primaryDragAction",t),this._updateMode())}get mode(){return this._get("mode")}set mode(t){"default"!==t&&"pro"!==t||t===this._get("mode")||(this._set("mode",t),this._updateMode())}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=o(this._inputManager),this._source=o(this._source)}connect(){const t=this.view;this._source=new w(this.view.surface,t.input);const e=[new D,new A,new j,new v(this.view.navigation),new M],o=new y({eventSource:this._source,recognizers:e});this._inputManager=o,o.installHandlers("prevent-context-menu",[new f],_.INTERNAL);const n={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new u(t,"primary"),this._modeDragRotate=new m(t,"secondary",P.CENTER),this._modeDragZoom=new p(t,"tertiary",n.fov),this._modeKeyboardNavigation=new c(t,n),o.installHandlers("navigation",[new g(t),new s(t),new d(t),new l(t,n.fov),new m(t,"primary",P.EYE,[n.lookAround.modifier]),new m(t,"secondary",P.CENTER,[n.lookAround.modifier]),new u(t,"tertiary",[n.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new h(t)],_.INTERNAL),this.view.viewEvents.connect(o),this._updateMode(),this.addHandles(r((()=>this.view.navigation?.browserTouchPanEnabled),(t=>{this._source.browserTouchPanningEnabled=!t}),i))}isModifierKeyDown(t){return this._inputManager?.isModifierKeyDown(t)??!1}_updateMode(){const t=this.mode,e=this.primaryDragAction,o=T.get(t)?.get(e);o&&(this._modeDragPan&&(this._modeDragPan.pointerAction=o.pan),this._modeDragRotate&&(this._modeDragRotate.pointerAction=o.rotate),this._modeDragZoom&&(this._modeDragZoom.pointerAction=o.zoom))}get test(){}};t([n()],b.prototype,"view",void 0),t([n({value:"pan"})],b.prototype,"primaryDragAction",null),t([n({value:"default"})],b.prototype,"mode",null),t([n({readOnly:!0})],b.prototype,"updating",null),t([n()],b.prototype,"latestPointerType",null),t([n()],b.prototype,"latestPointerLocation",null),t([n()],b.prototype,"multiTouchActive",null),t([n()],b.prototype,"_inputManager",void 0),b=t([a("esri.views.3d.input.SceneInputManager")],b);const T=new Map,z=new Map,R=new Map;z.set("pan",{pan:"primary",rotate:"secondary",zoom:"tertiary"}),z.set("rotate",{pan:"secondary",rotate:"primary",zoom:"tertiary"}),R.set("pan",{pan:"primary",rotate:"tertiary",zoom:"secondary"}),R.set("rotate",{pan:"tertiary",rotate:"primary",zoom:"secondary"}),T.set("default",z),T.set("pro",R);const E=b;export{E as default};
5
+ import{_ as o}from"../../../chunks/tslib.es6.js";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as c}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as g}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as l}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as u}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as y}from"../../input/BrowserEventSource.js";import{InputManager as f,ViewEventPriorities as v}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as j}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as A}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as T}from"../../input/recognizers/VerticalTwoFingerDrag.js";import{PivotPoint as b}from"../state/controllers/RotateController.js";let R=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new y(this.view.surface,o.input);const r=[new A,new P,new M,new j(this.view.navigation),new T],t=new f({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],v.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new u(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],b.CENTER),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new g(o,a),t.installHandlers("navigation",[new h(o),new d(o),new c(o),new l(o,a.fov),new m(o,["primary"],b.EYE,[a.lookAround.modifier]),new m(o,["secondary"],b.CENTER,[a.lookAround.modifier]),new u(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],v.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e((()=>this.view.navigation?.browserTouchPanEnabled),(o=>{this._source.browserTouchPanningEnabled=!o}),i),e((()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}}),this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],R.prototype,"view",void 0),o([a({type:["default","pro"]})],R.prototype,"mode",void 0),o([a({readOnly:!0})],R.prototype,"updating",null),o([a()],R.prototype,"latestPointerType",null),o([a()],R.prototype,"latestPointerLocation",null),o([a()],R.prototype,"multiTouchActive",null),o([a()],R.prototype,"_inputManager",void 0),R=o([s("esri.views.3d.input.SceneInputManager")],R);const E=R;export{E 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/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{RotateController as r}from"../../state/controllers/RotateController.js";export{PivotPoint}from"../../state/controllers/RotateController.js";import{InputHandler as e}from"../../../input/InputHandler.js";import{eventMatchesMousePointerAction as o}from"../../../input/handlers/support.js";class a extends e{constructor(t,r,e,o){super(!0),this._view=t,this.pointerAction=r,this._pivot=e,this.registerIncoming("drag",o,(t=>this._handleDrag(t)))}_handleDrag(e){const a=e.data;if(a.pointers.size>1)return;if(!o(e.data,this.pointerAction))return;const i=t(a.center.x,a.center.y);switch(a.action){case"start":this._cameraController&&(this._cameraController.end(),this._cameraController=null),this._cameraController=new r({view:this._view,pivot:this._pivot}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(i);break;case"update":this._cameraController&&this._cameraController.update(i);break;case"end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}e.stopPropagation()}}export{a as DragRotate};
5
+ import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{RotateController as r}from"../../state/controllers/RotateController.js";export{PivotPoint}from"../../state/controllers/RotateController.js";import{InputHandler as e}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as o}from"../../../input/handlers/support.js";class s extends e{constructor(t,r,e,o){super(!0),this._view=t,this.pointerActions=r,this._pivot=e,this.registerIncoming("drag",o,(t=>this._handleDrag(t)))}_handleDrag(e){const s=e.data;if(s.pointers.size>1)return;if(!o(e.data,this.pointerActions))return;const a=t(s.center.x,s.center.y);switch(s.action){case"start":this._cameraController&&(this._cameraController.end(),this._cameraController=null),this._cameraController=new r({view:this._view,pivot:this._pivot}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(a);break;case"update":this._cameraController&&this._cameraController.update(a);break;case"end":this._cameraController&&(this._cameraController.end(),this._cameraController=null)}e.stopPropagation()}}export{s as DragRotate};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{FovController as o}from"../../state/controllers/FovController.js";import{ZoomControllerGlobal as r}from"../../state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as e}from"../../state/controllers/ZoomControllerLocal.js";import{InputHandler as s}from"../../../input/InputHandler.js";import{eventMatchesMousePointerAction as i}from"../../../input/handlers/support.js";class n extends s{constructor(t,o,r){super(!0),this._view=t,this.pointerAction=o,this._fovModifier=r,this.registerIncoming("drag",[r],(t=>this._handleZoom(t))),this.registerIncoming("drag",(t=>this._handleZoom(t)))}_handleZoom(s){const n=s.data;if(n.pointers.size>1)return;if(!i(s.data,this.pointerAction))return;const a=t(n.center.x,n.center.y);switch(n.action){case"start":{this._cameraController?.finish();const t=this._view,i=s.modifiers.has(this._fovModifier);this._cameraController=i?new o({view:t,onStop:()=>this._stopController()}):t.state.isGlobal?new r({view:t}):new e({view:t}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(a);break}case"update":this._cameraController?.update(a);break;case"end":this._cameraController instanceof o?this._cameraController.updateTimeout():this._stopController()}s.stopPropagation()}_stopController(){this._cameraController?.finish(),this._cameraController=null}}export{n as DragZoom};
5
+ import{createScreenPointArray as t}from"../../../../core/screenUtils.js";import{FovController as o}from"../../state/controllers/FovController.js";import{ZoomControllerGlobal as r}from"../../state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as e}from"../../state/controllers/ZoomControllerLocal.js";import{InputHandler as s}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as i}from"../../../input/handlers/support.js";class n extends s{constructor(t,o,r){super(!0),this._view=t,this.pointerActions=o,this._fovModifier=r,this.registerIncoming("drag",[r],(t=>this._handleZoom(t))),this.registerIncoming("drag",(t=>this._handleZoom(t)))}_handleZoom(s){const n=s.data;if(n.pointers.size>1)return;if(!i(s.data,this.pointerActions))return;const a=t(n.center.x,n.center.y);switch(n.action){case"start":{this._cameraController?.finish();const t=this._view,i=s.modifiers.has(this._fovModifier);this._cameraController=i?new o({view:t,onStop:()=>this._stopController()}):t.state.isGlobal?new r({view:t}):new e({view:t}),this._view.state.switchCameraController(this._cameraController),this._cameraController.begin(a);break}case"update":this._cameraController?.update(a);break;case"end":this._cameraController instanceof o?this._cameraController.updateTimeout():this._stopController()}s.stopPropagation()}_stopController(){this._cameraController?.finish(),this._cameraController=null}}export{n as DragZoom};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{State as t}from"../../state/controllers/CameraController.js";import{FovController as e}from"../../state/controllers/FovController.js";import{ZoomStepControllerGlobal as r}from"../../state/controllers/ZoomStepControllerGlobal.js";import{ZoomStepControllerLocal as l}from"../../state/controllers/ZoomStepControllerLocal.js";import{InputHandler as i}from"../../../input/InputHandler.js";class s extends i{constructor(o,t){super(!0),this._view=o,this.registerIncoming("mouse-wheel",[t],(o=>this._handleFov(o))),this.registerIncoming("mouse-wheel",(o=>this._handleZoom(o)))}_handleZoom(t){if(!this._view.navigation.mouseWheelZoomEnabled)return;const e=t.data;this._zoomController?.running||(this._stopFovController(),this._zoomController=this._view.state.isGlobal?new r({view:this._view,mode:"interaction"}):new l({view:this._view,mode:"interaction"}),this._view.state.switchCameraController(this._zoomController)),this._zoomController.step(-e.deltaY/60,o(e.x,e.y)),t.preventDefault(),t.stopPropagation()}_handleFov(o){this._view.navigation.mouseWheelZoomEnabled&&(this._fovController?.running||(this._zoomController?.finish(),this._fovController?.hideOverlay(),this._fovController=new e({view:this._view,onStop:()=>this._stopFovController()}),this._view.state.switchCameraController(this._fovController),this._fovController.state!==t.Rejected)?(this._fovController.updateTimeout(),this._fovController.step(o.data.deltaY/20),o.preventDefault(),o.stopPropagation()):this._stopFovController())}_stopFovController(){this._fovController?.finish(),this._fovController=null}}export{s as MouseWheelZoom};
5
+ import{createScreenPointArray as o}from"../../../../core/screenUtils.js";import{State as t}from"../../state/controllers/CameraController.js";import{FovController as e}from"../../state/controllers/FovController.js";import{ZoomStepControllerGlobal as r}from"../../state/controllers/ZoomStepControllerGlobal.js";import{ZoomStepControllerLocal as l}from"../../state/controllers/ZoomStepControllerLocal.js";import{InputHandler as s}from"../../../input/InputHandler.js";class i extends s{constructor(o,t){super(!0),this._view=o,this.registerIncoming("mouse-wheel",[t],(o=>this._handleFov(o))),this.registerIncoming("mouse-wheel",(o=>this._handleZoom(o)))}_handleZoom(t){if(!this._mouseWheelZoomEnabled)return;const e=t.data;this._zoomController?.running||(this._stopFovController(),this._zoomController=this._view.state.isGlobal?new r({view:this._view,mode:"interaction"}):new l({view:this._view,mode:"interaction"}),this._view.state.switchCameraController(this._zoomController)),this._zoomController.step(-e.deltaY/60,o(e.x,e.y)),t.preventDefault(),t.stopPropagation()}_handleFov(o){this._mouseWheelZoomEnabled&&(this._fovController?.running||(this._zoomController?.finish(),this._fovController?.hideOverlay(),this._fovController=new e({view:this._view,onStop:()=>this._stopFovController()}),this._view.state.switchCameraController(this._fovController),this._fovController.state!==t.Rejected)?(this._fovController.updateTimeout(),this._fovController.step(o.data.deltaY/20),o.preventDefault(),o.stopPropagation()):this._stopFovController())}get _mouseWheelZoomEnabled(){return"zoom"===this._view.navigation.actionMap.mouseWheel}_stopFovController(){this._fovController?.finish(),this._fovController=null}}export{i as MouseWheelZoom};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import{PinchAndPanControllerGlobal as t}from"../../state/controllers/PinchAndPanControllerGlobal.js";import{PinchAndPanControllerLocal as e}from"../../state/controllers/PinchAndPanControllerLocal.js";import{InputHandler as s}from"../../../input/InputHandler.js";import{eventMatchesMousePointerAction as r}from"../../../input/handlers/support.js";class i extends s{constructor(t,e,s){super(!0),this._view=t,this.pointerAction=e,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming("drag",s,(t=>this._handleDrag(t)))}_handleDrag(t){if("mouse"===t.data.pointerType&&!r(t.data,this.pointerAction))return;const e=t.timestamp-this._lastEndTimestamp,s=40,i=this._momentum&&this._momentum.running&&e<s;switch(t.data.action){case"start":case"update":if(i)break;this._controller&&this._controller.running?t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp):this._startController(t);break;case"end":case"removed":this._endController(t,!0);break;case"added":this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(t,e){if(this._controller?.running){this._lastEndTimestamp=t.timestamp;const s=this._controller.end(t.data);e&&s&&(this._momentum=s,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(t){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(t.data),this._lastTimestamp=t.timestamp}_createController(){return this._view.state.isGlobal?new t({view:this._view}):new e({view:this._view})}}export{i as PinchAndPanNavigation};
5
+ import{PinchAndPanControllerGlobal as t}from"../../state/controllers/PinchAndPanControllerGlobal.js";import{PinchAndPanControllerLocal as e}from"../../state/controllers/PinchAndPanControllerLocal.js";import{InputHandler as s}from"../../../input/InputHandler.js";import{eventMatchesMousePointerActions as r}from"../../../input/handlers/support.js";class i extends s{constructor(t,e,s){super(!0),this._view=t,this.pointerActions=e,this._lastEndTimestamp=0,this._lastTimestamp=0,this.registerIncoming("drag",s,(t=>this._handleDrag(t)))}_handleDrag(t){if("mouse"===t.data.pointerType&&!r(t.data,this.pointerActions))return;const e=t.timestamp-this._lastEndTimestamp,s=40,i=this._momentum&&this._momentum.running&&e<s;switch(t.data.action){case"start":case"update":if(i)break;this._controller&&this._controller.running?t.data.timestamp-this._lastTimestamp>2&&(this._controller.update(t.data),this._lastTimestamp=t.timestamp):this._startController(t);break;case"end":case"removed":this._endController(t,!0);break;case"added":this._endController(t,!1),this._startController(t)}t.stopPropagation()}_endController(t,e){if(this._controller?.running){this._lastEndTimestamp=t.timestamp;const s=this._controller.end(t.data);e&&s&&(this._momentum=s,this._view.state.switchCameraController(this._momentum))}this._controller=null}_startController(t){this._controller=this._createController(),this._view.state.switchCameraController(this._controller),this._controller.begin(t.data),this._lastTimestamp=t.timestamp}_createController(){return this._view.state.isGlobal?new t({view:this._view}):new e({view:this._view})}}export{i as PinchAndPanNavigation};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.32/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";const r=()=>import("./layers/TileLayerView3D.js"),a=()=>import("./layers/ElevationLayerView3D.js"),i={"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":a,"base-tile":r,"bing-maps":r,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),catalog:()=>import("./layers/CatalogLayerView3D.js"),"catalog-dynamic-group":()=>import("./layers/CatalogDynamicGroupLayerView3D.js"),"catalog-footprint":()=>import("./layers/CatalogFootprintLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),dimension:()=>import("./layers/DimensionLayerView3D.js"),elevation:a,feature:()=>import("./layers/FeatureLayerView3D.js"),focusArea:()=>import("./layers/FocusAreaLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("../layers/GroupLayerView.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"integrated-mesh-3dtiles":()=>import("./layers/IntegratedMesh3DTilesLayerView3D.js"),"line-of-sight":()=>import("./layers/LineOfSightLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":r,"oriented-imagery":()=>import("./layers/FeatureLayerView3D.js"),"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),viewshed:()=>import("./layers/ViewshedLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:r,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":r,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),parquet:null,"geo-rss":null,kml:null,"knowledge-graph":null,"link-chart":null,"knowledge-graph-sublayer":null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null,video:null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",i=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${i}:view-not-supported`,`${a} is not supported in 3D`)}const l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=i[e.type];if(null==r)throw s(e);return r(e)}};export{l as layerView3DImporter};
5
+ import e from"../../core/Error.js";const r=()=>import("./layers/TileLayerView3D.js"),a=()=>import("./layers/ElevationLayerView3D.js"),i={"base-dynamic":()=>import("./layers/BaseDynamicLayerView3D.js"),"base-elevation":a,"base-tile":r,"bing-maps":r,"building-scene":()=>import("./layers/BuildingSceneLayerView3D.js"),catalog:()=>import("./layers/CatalogLayerView3D.js"),"catalog-dynamic-group":()=>import("./layers/CatalogDynamicGroupLayerView3D.js"),"catalog-footprint":()=>import("./layers/CatalogFootprintLayerView3D.js"),csv:()=>import("./layers/CSVLayerView3D.js"),dimension:()=>import("./layers/DimensionLayerView3D.js"),elevation:a,feature:()=>import("./layers/FeatureLayerView3D.js"),focusArea:()=>import("./layers/FocusAreaLayerView3D.js"),geojson:()=>import("./layers/GeoJSONLayerView3D.js"),graphics:()=>import("./layers/GraphicsLayerView3D.js"),group:()=>import("./layers/GroupLayerView3D.js"),imagery:()=>import("./layers/ImageryLayerView3D.js"),"integrated-mesh":()=>import("./layers/IntegratedMeshLayerView3D.js"),"integrated-mesh-3dtiles":()=>import("./layers/IntegratedMesh3DTilesLayerView3D.js"),"line-of-sight":()=>import("./layers/LineOfSightLayerView3D.js"),"map-image":()=>import("./layers/MapImageLayerView3D.js"),media:()=>import("./layers/MediaLayerView3D.js"),"ogc-feature":()=>import("./layers/OGCFeatureLayerView3D.js"),"open-street-map":r,"oriented-imagery":()=>import("./layers/FeatureLayerView3D.js"),"point-cloud":()=>import("./layers/PointCloudLayerView3D.js"),viewshed:()=>import("./layers/ViewshedLayerView3D.js"),voxel:()=>import("./layers/VoxelLayerView3D.js"),route:()=>import("./layers/RouteLayerView3D.js"),scene:e=>null==e.profile||"mesh-pyramids"===e.profile?import("./layers/SceneLayerView3D.js"):import("./layers/SceneLayerGraphicsView3D.js"),stream:()=>import("./layers/StreamLayerView3D.js"),tile:r,"imagery-tile":()=>import("./layers/ImageryTileLayerView3D.js"),"vector-tile":()=>import("./layers/VectorTileLayerView3D.js"),wcs:()=>import("./layers/ImageryTileLayerView3D.js"),"web-tile":r,wfs:()=>import("./layers/WFSLayerView3D.js"),wms:()=>import("./layers/WMSLayerView3D.js"),wmts:()=>import("./layers/WMTSLayerView3D.js"),parquet:null,"geo-rss":null,kml:null,"knowledge-graph":null,"link-chart":null,"knowledge-graph-sublayer":null,"map-notes":null,"subtype-group":null,unknown:null,unsupported:null,video:null};function s(r){const a=r.declaredClass?r.declaredClass.slice(r.declaredClass.lastIndexOf(".")+1):"Unknown",i=a.replaceAll(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new e(`${i}:view-not-supported`,`${a} is not supported in 3D`)}const l={hasLayerViewModule:e=>null!=i[e.type],importLayerView:e=>{const r=i[e.type];if(null==r)throw s(e);return r(e)}};export{l as layerView3DImporter};