@arcgis/core 5.2.0-next.41 → 5.2.0-next.42

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 (129) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/321dbc60f44819c2b4de.js +1 -0
  3. package/assets/esri/core/workers/chunks/399e23d777a043efa9f1.js +1 -0
  4. package/assets/esri/core/workers/chunks/5133083222588799493f.js +1 -0
  5. package/assets/esri/core/workers/chunks/{2b8909a488cf3b231eec.js → 590e977f8eeb379b86c8.js} +8 -8
  6. package/assets/esri/core/workers/chunks/{7ea65aa6d3e684e12082.js → 67468c50ecb1fbedda87.js} +1 -1
  7. package/assets/esri/core/workers/chunks/{b45a013039bbd2614525.js → 7684f0c771d312e05bb4.js} +7 -7
  8. package/assets/esri/core/workers/chunks/{dd65c32ae55fcf1282fe.js → 934044f2ef6ce199b399.js} +1 -1
  9. package/assets/esri/core/workers/chunks/c1845682cc9a5aac8703.js +261 -0
  10. package/assets/esri/core/workers/chunks/{4056659d5c7698265129.js → d66d58ed5d66520ab1bf.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{aa0fb77c62a2d4eb20a5.js → e6b5c015205d38abe037.js} +1 -1
  12. package/assets/esri/core/workers/chunks/f4eda59ec1e816ecc827.js +1 -0
  13. package/assets/esri/core/workers/chunks/f8f0de841be17cd05c8f.js +1 -0
  14. package/assets/esri/themes/base/_core.scss +0 -6
  15. package/assets/esri/themes/dark/main.css +1 -1
  16. package/assets/esri/themes/light/main.css +1 -1
  17. package/assets/esri/themes/light/view.css +1 -1
  18. package/chunks/CutFillMinMaxDepth.glsl.js +2 -0
  19. package/chunks/CutFillTotalDepth.glsl.js +2 -0
  20. package/chunks/EdgeShader.glsl.js +9 -9
  21. package/chunks/GaussianSplat.glsl.js +1 -1
  22. package/chunks/cameraUtilsSpherical.js +1 -1
  23. package/config.js +1 -1
  24. package/editing/geometry/coordUtils.js +1 -1
  25. package/geohash/geohashUtils.js +1 -1
  26. package/geometry/support/aaBoundingRect.js +1 -1
  27. package/geometry/support/quantizationUtils.js +1 -1
  28. package/intl/date.js +1 -1
  29. package/kernel.js +1 -1
  30. package/layers/graphics/featureConversionUtils.js +1 -1
  31. package/layers/graphics/sources/support/sourceUtils.js +1 -1
  32. package/layers/raster/formats/Lerc.js +1 -1
  33. package/layers/support/fieldUtils.js +1 -1
  34. package/package.json +1 -1
  35. package/support/revision.js +1 -1
  36. package/views/2d/engine/vectorTiles/GeometryUtils.js +1 -1
  37. package/views/2d/engine/webgl/Painter.js +1 -1
  38. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  39. package/views/2d/engine/webgl/effects/HighlightEffect.js +1 -1
  40. package/views/2d/engine/webgl/effects/highlight/HighlightGradient.js +1 -1
  41. package/views/2d/engine/webgl/mesh/templates/segmentUtils.js +1 -1
  42. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  43. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitBlitShader.js +2 -0
  44. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DebugOverlayShader.js +2 -0
  45. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HighlightShader.js +2 -0
  46. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/WorldExtentStencilShader.js +2 -0
  47. package/views/2d/engine/webgl/shaderGraph/techniques/utility/BitBlitTechnique.js +2 -0
  48. package/views/2d/engine/webgl/shaderGraph/techniques/utility/DebugOverlayTechnique.js +2 -0
  49. package/views/2d/engine/webgl/shaderGraph/techniques/utility/HighlightTechnique.js +2 -0
  50. package/views/2d/engine/webgl/shaderGraph/techniques/utility/WorldExtentClipTechnique.js +2 -0
  51. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  52. package/views/2d/layers/support/DebugOverlay.js +1 -1
  53. package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
  54. package/views/3d/layers/i3s/I3SNode.js +1 -1
  55. package/views/3d/layers/i3s/SphereCone.js +1 -1
  56. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  57. package/views/3d/support/cameraUtilsSpherical.js +1 -1
  58. package/views/3d/terrain/OverlayRenderer.js +1 -1
  59. package/views/3d/webgl/RenderCamera.js +1 -1
  60. package/views/3d/webgl-engine/core/shaderLibrary/Laserline.glsl.js +2 -2
  61. package/views/3d/webgl-engine/core/shaderLibrary/util/emissionFilter.glsl.js +1 -1
  62. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  63. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  64. package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
  65. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  66. package/views/3d/webgl-engine/lib/CutFillComputation.js +1 -1
  67. package/views/3d/webgl-engine/lib/GaussianSplatShadows.js +1 -1
  68. package/views/3d/webgl-engine/lib/IntersectorInterfaces.js +1 -1
  69. package/views/3d/webgl-engine/lib/PolygonIntersections2D.js +2 -0
  70. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  71. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  72. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  73. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/AdjustProjectedPosition.glsl.js +1 -1
  74. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/DiscardNonSilhouetteEdges.glsl.js +1 -1
  75. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  76. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShader.glsl.js +1 -1
  77. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/EdgeUtil.glsl.js +1 -1
  78. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineAmplitude.glsl.js +1 -1
  79. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/LineOffset.glsl.js +1 -1
  80. package/views/3d/webgl-engine/{shaders/sources/edgeRenderer → lib/edgeRendering}/UnpackAttributes.glsl.js +1 -1
  81. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  82. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  83. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  84. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  85. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  86. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  87. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  88. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  89. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  90. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  91. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  92. package/views/3d/webgl-engine/materials/TriangleMaterial.js +1 -1
  93. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  94. package/views/3d/webgl-engine/shaders/CutFillMinMaxDepth.glsl.js +2 -0
  95. package/views/3d/webgl-engine/shaders/CutFillMinMaxDepthTechnique.js +2 -0
  96. package/views/3d/webgl-engine/shaders/{CutFillDepth.glsl.js → CutFillTotalDepth.glsl.js} +1 -1
  97. package/views/3d/webgl-engine/shaders/CutFillTotalDepthTechnique.js +2 -0
  98. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  99. package/views/input/BrowserEventSource.js +1 -1
  100. package/views/input/InputManager.js +1 -1
  101. package/views/interactive/snapping/snappingUtils.js +1 -1
  102. package/views/support/euclideanLengthMeasurementUtils.js +1 -1
  103. package/views/webgl/VertexAttributeLayouts.js +1 -1
  104. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  105. package/widgets/BatchAttributeForm/inputs/support/multipleChoiceInputUtils.js +1 -1
  106. package/widgets/Legend/support/relationshipRampUtils.js +1 -1
  107. package/widgets/OrientedImageryViewer/utils.js +1 -1
  108. package/assets/esri/core/workers/chunks/002356e675769d20e5c0.js +0 -1
  109. package/assets/esri/core/workers/chunks/06e71d52773eb656a4bf.js +0 -261
  110. package/assets/esri/core/workers/chunks/352d144d7651da8a29c9.js +0 -1
  111. package/assets/esri/core/workers/chunks/4f2a61dfae6ca8ed1ec8.js +0 -1
  112. package/assets/esri/core/workers/chunks/ea8f224da4c5c95a3547.js +0 -1
  113. package/assets/esri/core/workers/chunks/f30578843f4faefd53b4.js +0 -1
  114. package/assets/esri/themes/base/_colorVariables.scss +0 -1
  115. package/assets/esri/themes/base/widgets/_DatePicker.scss +0 -170
  116. package/assets/esri/themes/base/widgets/_FeatureUtilityNetworkAssociationList.scss +0 -13
  117. package/assets/esri/themes/base/widgets/_TimePicker.scss +0 -15
  118. package/chunks/CutFillDepth.glsl.js +0 -2
  119. package/core/PLRUCache.js +0 -2
  120. package/views/2d/engine/webgl/BitBlitRenderer.js +0 -2
  121. package/views/2d/engine/webgl/WorldExtentClipRenderer.js +0 -2
  122. package/views/2d/engine/webgl/effects/highlight/HighlightRenderer.js +0 -2
  123. package/views/2d/engine/webgl/shaders/BitBlitPrograms.js +0 -2
  124. package/views/2d/engine/webgl/shaders/HighlightPrograms.js +0 -2
  125. package/views/2d/engine/webgl/shaders/StencilPrograms.js +0 -2
  126. package/views/3d/webgl-engine/shaders/CutFillDepthTechnique.js +0 -2
  127. package/views/3d/webgl-engine/shaders/CutFillDepthTechniqueConfiguration.js +0 -2
  128. package/views/support/euclideanAreaMeasurementUtils.js +0 -2
  129. package/widgets/ShadowCast/ShadowVisualizationType.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOLIDOrDepth as n}from"../core/shaderLibrary/ShaderOutput.js";import h from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as m}from"./internal/bufferWriterUtils.js";import{getLayout as p,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>10===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[10,e=>n(e)&&8===this.parameters.renderOccluded],[11,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)],[18,e=>a(e)||10===e]]),this.intersectRayDraped=void 0,this._configuration=new d(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=18===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=f}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new S(p(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends h{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,o,n,h){if(null==h)return;const{buffer:c,offset:l}=h,p=o.get("position").data,u=p.length/3;let d=[1,0,0];const f=o.get("normal");this._parameters.worldSpace&&null!=f&&(d=f.data);let g=1,_=0;this._parameters.vvSize?_=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(g=o.get("size").data[0]);let v=[1,1,1,1],S=0;this._parameters.vvColor?S=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(v=o.get("color").data);let w=0;this._parameters.vvOpacity&&(w=o.get("opacityFeatureAttribute").data[0]);const y=new Float32Array(c.buffer),O=s(c.buffer),T=new Uint8Array(c.buffer);let V=l*(this.layout.stride/4);const k=y.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,j=4/k,M=(e,t,r,i)=>{y[V++]=e[0],y[V++]=e[1],y[V++]=e[2],m(t,e,O,V*k),V+=j;let s=V*k;if(O[s++]=r[0],O[s++]=r[1],V=Math.ceil(s/k),this._parameters.vvColor)y[V++]=S;else{const e=Math.min(4*i,v.length-4),t=4*V++;T[t]=255*v[e],T[t+1]=255*v[e+1],T[t+2]=255*v[e+2],T[t+3]=255*v[e+3]}this._parameters.vvOpacity&&(y[V++]=w),s=V*k,this._parameters.vvSize?(y[V++]=_,s+=2):O[s++]=g,this._parameters.worldSpace&&(O[s++]=d[0],O[s++]=d[1],O[s++]=d[2]),V=Math.ceil(s/k)},x=(s,a)=>{const o=e(b,p[3*s],p[3*s+1],p[3*s+2]),n=P;let h=s+a;do{e(n,p[3*h],p[3*h+1],p[3*h+2]),h+=a}while(t(o,n)&&h>=0&&h<u);i&&(r(o,o,i),r(n,n,i)),M(o,n,[-1,-1],s),M(o,n,[1,-1],s),M(o,n,[1,1],s),M(o,n,[-1,-1],s),M(o,n,[1,1],s),M(o,n,[-1,1],s)},C=this._parameters.placement;"begin"!==C&&"begin-end"!==C||x(0,1),"end"!==C&&"begin-end"!==C||x(u-1,-1)}}const b=i(),P=i();export{g as LineMarkerMaterial,v as Parameters};
2
+ import{set as e,equals as t,transformMat4 as r}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeFloat16Array as s}from"../../../../geometry/support/float16.js";import{isColor as a,isDepth as o,isColorHighlightOLIDOrDepth as n}from"../core/shaderLibrary/ShaderOutput.js";import h from"../lib/GLMaterial.js";import{Material as c}from"../lib/Material.js";import{VisualVariablePassParameters as l}from"./VisualVariablePassParameters.js";import{writeDeltaF16Vector as m}from"./internal/bufferWriterUtils.js";import{getLayout as p,LineMarkerTechnique as u}from"../shaders/LineMarkerTechnique.js";import{LineMarkerTechniqueConfiguration as d}from"../shaders/LineMarkerTechniqueConfiguration.js";import{alphaCutoff as f}from"../../../../webscene/support/AlphaCutoff.js";class g extends c{constructor(e,t){super(e,v),this.produces=new Map([[2,e=>10===e||a(e)&&8===this.parameters.renderOccluded],[3,e=>o(e)],[10,e=>n(e)&&8===this.parameters.renderOccluded],[11,e=>n(e)&&8===this.parameters.renderOccluded],[4,e=>a(e)],[18,e=>a(e)||10===e]]),this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this._configuration=new d(t)}updateConfiguration(e){super.updateConfiguration(e),this._configuration.space=18===e.slot?0:this.parameters.worldSpace?2:1,this._configuration.hideOnShortSegments=this.parameters.hideOnShortSegments,this._configuration.hasCap=0!==this.parameters.cap,this._configuration.anchor=this.parameters.anchor,this._configuration.hasTip=this.parameters.hasTip,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasOccludees=e.hasOccludees,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.hasScreenSizePerspective=null!=this.parameters.screenSizePerspective}get visible(){return this.parameters.color[3]>=f}intersectRay(){}intersectScreenPolygon(){return null}createBufferWriter(){return new S(p(this.parameters),this.parameters)}createGLMaterial(e){return new _(e)}}class _ extends h{dispose(){super.dispose(),this._markerTextures?.release(this._markerPrimitive),this._markerPrimitive=null}beginSlot(e){const t=this._material.parameters.markerPrimitive;return t!==this._markerPrimitive&&(this._material.setParameters({markerTexture:this._markerTextures.swap(t,this._markerPrimitive)}),this._markerPrimitive=t),this.getTechnique(u,e)}}class v extends l{constructor(){super(...arguments),this.width=0,this.color=[1,1,1,1],this.markerPrimitive="arrow",this.placement="end",this.cap=0,this.anchor=0,this.hasTip=!1,this.worldSpace=!1,this.hideOnShortSegments=!1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.stipplePattern=null,this.markerTexture=null}}class S{constructor(e,t){this.layout=e,this._parameters=t}elementCount(){return"begin-end"===this._parameters.placement?12:6}write(i,a,o,n,h){if(null==h)return;const{buffer:c,offset:l}=h,p=o.get("position").data,u=p.length/3;let d=[1,0,0];const f=o.get("normal");this._parameters.worldSpace&&null!=f&&(d=f.data);let g=1,_=0;this._parameters.vvSize?_=o.get("sizeFeatureAttribute").data[0]:o.has("size")&&(g=o.get("size").data[0]);let v=[1,1,1,1],S=0;this._parameters.vvColor?S=o.get("colorFeatureAttribute").data[0]:o.has("color")&&(v=o.get("color").data);let w=0;this._parameters.vvOpacity&&(w=o.get("opacityFeatureAttribute").data[0]);const y=new Float32Array(c.buffer),O=s(c.buffer),T=new Uint8Array(c.buffer);let V=l*(this.layout.stride/4);const k=y.BYTES_PER_ELEMENT/O.BYTES_PER_ELEMENT,j=4/k,M=(e,t,r,i)=>{y[V++]=e[0],y[V++]=e[1],y[V++]=e[2],m(t,e,O,V*k),V+=j;let s=V*k;if(O[s++]=r[0],O[s++]=r[1],V=Math.ceil(s/k),this._parameters.vvColor)y[V++]=S;else{const e=Math.min(4*i,v.length-4),t=4*V++;T[t]=255*v[e],T[t+1]=255*v[e+1],T[t+2]=255*v[e+2],T[t+3]=255*v[e+3]}this._parameters.vvOpacity&&(y[V++]=w),s=V*k,this._parameters.vvSize?(y[V++]=_,s+=2):O[s++]=g,this._parameters.worldSpace&&(O[s++]=d[0],O[s++]=d[1],O[s++]=d[2]),V=Math.ceil(s/k)},x=(s,a)=>{const o=e(b,p[3*s],p[3*s+1],p[3*s+2]),n=P;let h=s+a;do{e(n,p[3*h],p[3*h+1],p[3*h+2]),h+=a}while(t(o,n)&&h>=0&&h<u);i&&(r(o,o,i),r(n,n,i)),M(o,n,[-1,-1],s),M(o,n,[1,-1],s),M(o,n,[1,1],s),M(o,n,[-1,-1],s),M(o,n,[1,1],s),M(o,n,[-1,1],s)},C=this._parameters.placement;"begin"!==C&&"begin-end"!==C||x(0,1),"end"!==C&&"begin-end"!==C||x(u-1,-1)}}const b=i(),P=i();export{g as LineMarkerMaterial,v as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as u,MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as f,layout as h}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t){super(t,b),this._configuration=new m,this.intersectRayDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[8,t=>this._transparent&&c(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent,this._configuration.writeDepth=2===t.slot}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(t){return new C(t)}createBufferWriter(){return new _}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(f,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),j=n(),v=n(),M=n(),O=n();class _{constructor(){this.layout=h}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l,u){if(null==u)return;const{buffer:p,offset:f}=u,{data:h,indices:m}=c.get("position"),d=c.get("normal").data,g=h.length/3;m&&m.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const C=w,b=j,_=v,x=M,y=O,T=p.position,A=p.normal,L=p.uv0;let S=0;for(let w=0;w<g;++w){const c=3*w;if(t(C,h[c],h[c+1],h[c+2]),w<g-1){const o=3*(w+1);t(b,h[o],h[o+1],h[o+2]),t(y,d[o],d[o+1],d[o+2]),e(y,y),r(_,b,C),e(_,_),s(x,y,_),e(x,x)}const l=o(C,b);n&&a&&(i(C,C,n),i(b,b,n),i(x,x,a));const u=f+2*w,p=u+1;T.setVec(u,C),T.setVec(p,C),A.setVec(u,x),A.setVec(p,x),L.set(u,0,S),L.set(u,1,-1),L.set(p,0,S),L.set(p,1,1),w<g-1&&(S+=l)}const V=p.length;for(let t=0;t<2*g;++t)V.set(f+t,S)}}export{g as MeasurementArrowMaterial,b as Parameters};
2
+ import{set as t,normalize as e,subtract as r,cross as s,distance as o,transformMat4 as i}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as a}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{isColor as c}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as u,MaterialParameters as p}from"../lib/Material.js";import{MeasurementArrowTechnique as f,layout as h}from"../shaders/MeasurementArrowTechnique.js";import{MeasurementArrowTechniqueConfiguration as m}from"../shaders/MeasurementArrowTechniqueConfiguration.js";import{alphaCutoff as d}from"../../../../webscene/support/AlphaCutoff.js";class g extends u{constructor(t){super(t,b),this._configuration=new m,this.intersectRayDraped=void 0,this.intersectScreenPolygonDraped=void 0,this.produces=new Map([[2,t=>!this._transparent&&c(t)],[8,t=>this._transparent&&c(t)]])}updateConfiguration(t){super.updateConfiguration(t),this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.transparent=this._transparent,this._configuration.writeDepth=2===t.slot}get visible(){const{outlineColor:t,stripeEvenColor:e,stripeOddColor:r}=this.parameters;return t[3]>=d||e[3]>=d||r[3]>=d}intersectRay(){}intersectScreenPolygon(){return null}createGLMaterial(t){return new C(t)}createBufferWriter(){return new _}get _transparent(){const{parameters:t}=this;return t.outlineColor[3]<1||t.stripeEvenColor[3]<1||t.stripeOddColor[3]<1}}class C extends l{beginSlot(t){return this.getTechnique(f,t)}}class b extends p{constructor(){super(...arguments),this.width=32,this.outlineSize=.2,this.outlineColor=a(1,.5,0,1),this.stripeEvenColor=a(1,1,1,1),this.stripeOddColor=a(1,.5,0,1),this.stripeLength=1}}const w=n(),v=n(),j=n(),M=n(),O=n();class _{constructor(){this.layout=h}elementCount(t){return 2*(t.get("position").indices.length/2+1)}write(n,a,c,l,u){if(null==u)return;const{buffer:p,offset:f}=u,{data:h,indices:m}=c.get("position"),d=c.get("normal").data,g=h.length/3;m&&m.length!==2*(g-1)&&console.warn("MeasurementArrowMaterial does not support indices");const C=w,b=v,_=j,x=M,y=O,S=p.position,T=p.normal,A=p.uv0;let L=0;for(let w=0;w<g;++w){const c=3*w;if(t(C,h[c],h[c+1],h[c+2]),w<g-1){const o=3*(w+1);t(b,h[o],h[o+1],h[o+2]),t(y,d[o],d[o+1],d[o+2]),e(y,y),r(_,b,C),e(_,_),s(x,y,_),e(x,x)}const l=o(C,b);n&&a&&(i(C,C,n),i(b,b,n),i(x,x,a));const u=f+2*w,p=u+1;S.setVec(u,C),S.setVec(p,C),T.setVec(u,x),T.setVec(p,x),A.set(u,0,L),A.set(u,1,-1),A.set(p,0,L),A.set(p,1,1),w<g-1&&(L+=l)}const V=p.length;for(let t=0;t<2*g;++t)V.set(f+t,L)}}export{g as MeasurementArrowMaterial,b as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as s,subtract as n,dot as a,scale as c,add as l,copy as m,length as u,distance as f}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as g}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as h,fromPoints as d,closestLineSegmentPoint as j,projectPoint as b,create as y}from"../../../../geometry/support/lineSegment.js";import{fromPoints as v,signedDistance as x,getNormal as L,create as S}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as w}from"../core/shaderLibrary/ShaderOutput.js";import M from"../lib/GLMaterial.js";import{Material as T,MaterialParameters as P}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as C,screenPolygonIntersectsBufferedSegment as R}from"../lib/screenPolygonOverlapUtils.js";import{Hit as V}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as _}from"../lib/Util.js";import{DefaultBufferWriter as A}from"./DefaultBufferWriter.js";import{PositionColorLayout as N,PositionLayout as U}from"./DefaultLayouts.js";import{NativeLineTechnique as E}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as O}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";class B extends T{constructor(e){super(e,X),this._configuration=new O,this.produces=new Map([[2,e=>w(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=e.hasOccludees}get visible(){return this.parameters.color[3]>=q}intersectRay(r,t,o,p,g,b){const{options:y,camera:S,rayBegin:w,rayEnd:M}=o;if(!y.selectionMode||!r.visible||!S)return;if(!_(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const T=r.attributes.get("position").data,P=Z;i(P,o.point);const C=ae*S.pixelRatio;s(re[0],P[0]-C,P[1]+C,0),s(re[1],P[0]+C,P[1]+C,0),s(re[2],P[0]+C,P[1]-C,0),s(re[3],P[0]-C,P[1]-C,0);for(let e=0;e<4;e++)if(!S.unprojectFromRenderScreen(re[e],te[e]))return;v(S.eye,te[0],te[1],oe),v(S.eye,te[1],te[2],ie),v(S.eye,te[2],te[3],se),v(S.eye,te[3],te[0],ne);let R=Number.MAX_VALUE,V=0;for(const e of W(F,G,T,t)){if(x(oe,F)<0&&x(oe,G)<0||x(ie,F)<0&&x(ie,G)<0||x(se,F)<0&&x(se,G)<0||x(ne,F)<0&&x(ne,G)<0)continue;const r=S.projectToRenderScreen(F,k),t=S.projectToRenderScreen(G,H);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){n(I,F,G);const e=S.frustum,t=-x(e[4],F)/a(I,L(e[4]));if(c(I,I,t),l(F,F,I),!S.projectToRenderScreen(F,r))continue}else if(r[2]>0&&t[2]<0){n(I,G,F);const e=S.frustum,r=-x(e[4],G)/a(I,L(e[4]));if(c(I,I,r),l(G,G,I),!S.projectToRenderScreen(G,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=h(d(r,t,Q),P);o<R&&(R=o,m(J,F),m(K,G),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(j(d(J,K,Q),d(w,M,Y),z)){n(z,z,w);const r=u(z);c(z,z,1/r),e=r/f(w,M)}b(e,z,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!_(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new V(4);for(const e of W(F,G,c,t))for(const[r,t]of a.processLineSegment(ce,F,G))C(n,r,t,k,H)&&(n.renderToScreen(k,$),n.renderToScreen(H,ee),R(i,$,ee,ae)&&(b(d(r,t,Y),n.eye,Z),l.updateIfCloserFromValues(f(n.eye,Z),e,Z,null)));return l}intersectRayDraped(e,t,o,i,s){if(!t.options.selectionMode)return;const n=e.attributes.get("position").data,a=e.attributes.get("size"),c=a?a.data[0]:0,l=o[0],m=o[1],u=((c+1)/2+4)*e.screenToWorldRatio;let f=Number.MAX_VALUE,p=0;for(let g=0;g<n.length-5;g+=3){const e=n[g],t=n[g+1],o=l-e,i=m-t,s=n[g+3]-e,a=n[g+4]-t,c=r((s*o+a*i)/(s*s+a*a),0,1),u=s*c-o,h=a*c-i,d=u*u+h*h;d<f&&(f=d,p=g/3)}f<u*u&&i(s.distance,s.normal,p)}createGLMaterial(e){return new D(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?N:U;return new A(e)}}class D extends M{beginSlot(e){return this.getTechnique(E,e)}}function*W(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}class X extends P{constructor(){super(...arguments),this.color=g,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const F=p(),G=p(),I=p(),z=p(),k=t(),H=t(),J=p(),K=p(),Q=y(),Y=y(),Z=p(),$=o(),ee=o(),re=[t(),t(),t(),t()],te=[p(),p(),p(),p()],oe=S(),ie=S(),se=S(),ne=S(),ae=2,ce=[p(),p()];export{B as NativeLineMaterial,X as Parameters};
2
+ import e from"../../../../core/Logger.js";import{clamp as r}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as t,createScreenPointArray as o}from"../../../../core/screenUtils.js";import{copy as i,set as s}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as a,subtract as c,dot as l,scale as f,add as m,copy as u,length as p,distance as g}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as h}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{ONES as d}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{distance2 as j,fromPoints as b,closestLineSegmentPoint as y,projectPoint as v,create as x}from"../../../../geometry/support/lineSegment.js";import{fromPoints as S,signedDistance as L,getNormal as w,create as M}from"../../../../geometry/support/plane.js";import{isColorHighlightOrOLID as P}from"../core/shaderLibrary/ShaderOutput.js";import T from"../lib/GLMaterial.js";import{Material as C,MaterialParameters as R}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as V,screenPolygonIntersectsBufferedSegment as _}from"../lib/screenPolygonOverlapUtils.js";import{Hit as A,DrapedHit as N}from"../lib/screenPolygonTriangleIntersections.js";import{isTranslationMatrix as U}from"../lib/Util.js";import{DefaultBufferWriter as D}from"./DefaultBufferWriter.js";import{PositionColorLayout as E,PositionLayout as O}from"./DefaultLayouts.js";import{NativeLineTechnique as q}from"../shaders/NativeLineTechnique.js";import{NativeLineTechniqueConfiguration as B}from"../shaders/NativeLineTechniqueConfiguration.js";import{alphaCutoff as W}from"../../../../webscene/support/AlphaCutoff.js";class X extends C{constructor(e){super(e,k),this._configuration=new B,this.produces=new Map([[2,e=>P(e)]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.transparent=this.parameters.color[3]<1||this.parameters.width<1,this._configuration.hasOccludees=e.hasOccludees}get visible(){return this.parameters.color[3]>=W}intersectRay(r,t,o,s,n,h){const{options:d,camera:v,rayBegin:x,rayEnd:M}=o;if(!d.selectionMode||!r.visible||!v)return;if(!U(t))return void e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix");const P=r.attributes.get("position").data,T=oe;i(T,o.point);const C=ge*v.pixelRatio;a(ce[0],T[0]-C,T[1]+C,0),a(ce[1],T[0]+C,T[1]+C,0),a(ce[2],T[0]+C,T[1]-C,0),a(ce[3],T[0]-C,T[1]-C,0);for(let e=0;e<4;e++)if(!v.unprojectFromRenderScreen(ce[e],le[e]))return;S(v.eye,le[0],le[1],fe),S(v.eye,le[1],le[2],me),S(v.eye,le[2],le[3],ue),S(v.eye,le[3],le[0],pe);let R=Number.MAX_VALUE,V=0;for(const e of G(H,J,P,t)){if(L(fe,H)<0&&L(fe,J)<0||L(me,H)<0&&L(me,J)<0||L(ue,H)<0&&L(ue,J)<0||L(pe,H)<0&&L(pe,J)<0)continue;const r=v.projectToRenderScreen(H,Y),t=v.projectToRenderScreen(J,Z);if(null==r||null==t)continue;if(r[2]<0&&t[2]>0){c(K,H,J);const e=v.frustum,t=-L(e[4],H)/l(K,w(e[4]));if(f(K,K,t),m(H,H,K),!v.projectToRenderScreen(H,r))continue}else if(r[2]>0&&t[2]<0){c(K,J,H);const e=v.frustum,r=-L(e[4],J)/l(K,w(e[4]));if(f(K,K,r),m(J,J,K),!v.projectToRenderScreen(J,t))continue}else if(r[2]<0&&t[2]<0)continue;r[2]=0,t[2]=0;const o=j(b(r,t,re),T);o<R&&(R=o,u($,H),u(ee,J),V=e)}if(R<C*C){let e=Number.MAX_VALUE;if(y(b($,ee,re),b(x,M,te),Q)){c(Q,Q,x);const r=p(Q);f(Q,Q,1/r),e=r/g(x,M)}h(e,Q,V)}}intersectScreenPolygon(r,t,o,i){const{options:s,camera:n,screenPolygonPrimitiveProcessor:a}=o;if(!s.selectionMode||!r.visible)return null;if(!U(t))return e.getLogger("esri.views.3d.webgl-engine.materials.NativeLineMaterial").error("intersection assumes a translation-only matrix"),null;const c=r.attributes.get("position").data,l=new A(4);for(const e of G(H,J,c,t))for(const[r,t]of a.processLineSegment(he,H,J))V(n,r,t,Y,Z)&&(n.renderToScreen(Y,ie),n.renderToScreen(Z,se),_(i,ie,se,ge)&&(v(b(r,t,te),n.eye,oe),l.updateIfCloserFromValues(g(n.eye,oe),e,oe,null)));return l}intersectRayDraped(e,t,o,i,s){if(!t.options.selectionMode)return;const n=o[0],a=o[1],c=I(e);let l=Number.MAX_VALUE,f=0;for(const m of z(ne,ae,e)){const e=n-ne[0],t=a-ne[1],o=ae[0]-ne[0],i=ae[1]-ne[1],s=r((o*e+i*t)/(o*o+i*i),0,1),c=o*s-e,u=i*s-t,p=c*c+u*u;p<l&&(l=p,f=m)}l<c*c&&i(s.distance,s.normal,f)}intersectScreenPolygonDraped(e,r,t,o){if(!t.options.selectionMode)return null;const i=I(e);for(const s of z(ne,ae,e,r))if(_(o,ne,ae,i))return new N(s);return null}createGLMaterial(e){return new F(e)}createBufferWriter(){const e=this.parameters.hasVertexColors?E:O;return new D(e)}}class F extends T{beginSlot(e){return this.getTechnique(q,e)}}function*G(e,r,t,o){for(let i=0;i<t.length-5;i+=3)e[0]=t[i]+o[12],e[1]=t[i+1]+o[13],e[2]=t[i+2]+o[14],r[0]=t[i+3]+o[12],r[1]=t[i+4]+o[13],r[2]=t[i+5]+o[14],yield i/3}function I(e){const r=e.attributes.get("size");return(((r?r.data[0]:0)+1)/2+4)*e.screenToWorldRatio}function*z(e,r,t,o){const n=t.attributes.get("position").data,a=o?.[0]??0,c=o?.[1]??0;s(e,n[0]+a,n[1]+c);for(let l=3;l<n.length-2;l+=3){const t=l%n.length;s(r,n[t]+a,n[t+1]+c),yield l/3,i(e,r)}}class k extends R{constructor(){super(...arguments),this.color=d,this.hasVertexColors=!1,this.hasSlicePlane=!1,this.width=1}}const H=h(),J=h(),K=h(),Q=h(),Y=t(),Z=t(),$=h(),ee=h(),re=x(),te=x(),oe=h(),ie=o(),se=o(),ne=n(),ae=n(),ce=[t(),t(),t(),t()],le=[h(),h(),h(),h()],fe=M(),me=M(),ue=M(),pe=M(),ge=2,he=[h(),h()];export{X as NativeLineMaterial,k as Parameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{fromValues as t}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as e}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as i,BufferViewVec3f as r,BufferViewVec2Snorm16 as s,BufferViewSnorm16 as o,BufferViewFloat16 as a,BufferViewFloat as n,BufferViewVec2f as h,BufferViewVec4Unorm8 as c,BufferViewUnorm8 as p}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as u}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as f,is3DGeometry as l,isColor as g}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as m}from"../effects/geometry/olidUtils.js";import d from"../lib/GLMaterial.js";import{isPathGeometry as b}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as y}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as _,intersectAabbInvDir as S}from"../lib/RayIntersections.js";import{assert as w}from"../lib/Util.js";import{applyPolygonOffsetToHit as x}from"./intersectWithPolygonOffset.js";import{getLayout as F,getTextureLayout as V}from"./PathLayouts.js";import{PathPassParameters as P,PathTechnique as j}from"./PathTechnique.js";import{PathTechniqueConfiguration as R}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as z,writePosition as B,writeBufferVec2 as M,writeBufferInt16 as O,writeBufferFloat16 as v,writeBufferFloat as A,writeColor as T,writeBufferUint8 as I,writeOlidColor as U}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as L}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as q}from"../../../../webscene/support/AlphaCutoff.js";class D extends C{constructor(e,i){super(e,W),this.supportsEdges=!0,this._pp0=t(0,0,1),this._pp1=t(0,0,0),this.produces=new Map([[2,t=>(this.parameters.castShadows&&f(t)||l(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&f(t)||l(t))&&this.transparent]]),this._configuration=new R(i.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,g(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=L(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=q}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(t,e,i,r){return this._pp0[0]=this._pp1[0]=i[0],this._pp0[1]=this._pp1[1]=i[1],this._intersectRay(t,e,this._pp0,this._pp1,r)}intersectScreenPolygon(t,e,i,r){return b(t)?x(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(t,i,r,s,o){if(!b(t))return;const a=new _(i.tolerance,!1,i.options.normalRequired),n=t.boundingInfo;if(null==n)return void t.intersectRay(r,s,a,o);const h=e(n.bbMin[0],n.bbMin[1],n.bbMin[2],n.bbMax[0],n.bbMax[1],n.bbMax[2]),c=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],p=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]),u=[p/c[0],p/c[1],p/c[2]];S(h,r,u,i.tolerance)&&t.intersectRay(r,s,a,o)}createBufferWriter(){return new H(F(),V(this.parameters))}createGLMaterial(t){return new G(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class G extends d{beginSlot(t){return this.getTechnique(j,t)}}class W extends P{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class H{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=u}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(t,e,r,s,o){z(r,null,this.layout,t,e,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",i),h=r.get("pathVertexInfo");if(n&&h){w(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,y(o,a))}}}_writeTextureBuffer(t,e,i,u){const f=u.offset,l=u.buffer.getField("position",r),g=e.get("position");l&&g&&(w(3===g.size),B(g,t,l,f));const d=u.buffer.getField("profileRight",s),b=e.get("profileRight");d&&b&&(w(2===b.size),M(b,d,f));const y=u.buffer.getField("profileUp",s),_=e.get("profileUp");y&&_&&(w(2===_.size),M(_,y,f));const S=u.buffer.getField("profileRotation",o),x=e.get("profileRotation");S&&x&&(w(1===x.size),O(x,S,f));const F=u.buffer.getField("pathRotationUp",s),V=e.get("pathRotationUp");F&&V&&(w(2===V.size),M(V,F,f));const P=u.buffer.getField("pathMaxStretchDistance",a),j=e.get("pathMaxStretchDistance");P&&j&&(w(1===j.size),v(j,P,f));const R=u.buffer.getField("sizeFeatureAttribute",n),C=e.get("sizeFeatureAttribute");R&&C&&A(C,R,f);const z=u.buffer.getField("size",h),L=e.get("size");z&&L&&(w(2===L.size),M(L,z,f));const q=u.buffer.getField("colorFeatureAttribute",n),D=e.get("colorFeatureAttribute");q&&D&&A(D,q,f);const G=u.buffer.getField("color",c),W=e.get("color");G&&W&&T(W,4,G,f);const H=u.buffer.getField("opacityFeatureAttribute",n),k=e.get("opacityFeatureAttribute");H&&k&&A(k,H,f);const E=u.buffer.getField("opacity",p),J=e.get("opacity");if(E&&J&&(w(1===J.size),I(J,E,f)),m()){const t=u.buffer.getField("olidColor",c),e=g?.indices.length??0;i&&t&&e&&U(i,t,e,f)}}}export{W as Parameters,H as PathBufferWriter,D as PathMaterial};
2
+ import{fromValues as t}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewUint32 as e,BufferViewVec3f as i,BufferViewVec2Snorm16 as r,BufferViewSnorm16 as s,BufferViewFloat16 as o,BufferViewFloat as a,BufferViewVec2f as n,BufferViewVec4Unorm8 as h,BufferViewUnorm8 as c}from"../../../../geometry/support/buffer/BufferView.js";import{maxPathFrameIndex as u}from"../../layers/graphics/Graphics3DPathSymbolLayerConstants.js";import{isShadowLike as f,is3DGeometry as p,isColor as l}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as g}from"../effects/geometry/olidUtils.js";import m from"../lib/GLMaterial.js";import{isPathGeometry as d}from"../lib/PathGeometry.js";import{offsetPathVertexInfoFrameIndex as b}from"../lib/PathVertexInfo.js";import{MeshIntersectionOptions as y,intersectAabbInvDir as _}from"../lib/RayIntersections.js";import{assert as S}from"../lib/Util.js";import{applyPolygonOffsetToHit as w}from"./intersectWithPolygonOffset.js";import{getLayout as F,getTextureLayout as P}from"./PathLayouts.js";import{PathPassParameters as x,PathTechnique as V}from"./PathTechnique.js";import{PathTechniqueConfiguration as j}from"./PathTechniqueConfiguration.js";import{TriangleMaterial as C}from"./TriangleMaterial.js";import{writeAttributes as R,writePosition as z,writeBufferVec2 as B,writeBufferInt16 as M,writeBufferFloat16 as O,writeBufferFloat as v,writeColor as A,writeBufferUint8 as T,writeOlidColor as I}from"./internal/bufferWriterUtils.js";import{hasShadowHighlights as U}from"../shaders/ReceiveShadowsConfiguration.js";import{alphaCutoff as L}from"../../../../webscene/support/AlphaCutoff.js";class q extends C{constructor(t,e){super(t,G),this.supportsEdges=!0,this.produces=new Map([[2,t=>(this.parameters.castShadows&&f(t)||p(t))&&!this.transparent],[4,t=>(this.parameters.castShadows&&f(t)||p(t))&&this.transparent]]),this._configuration=new j(e.spherical)}get emissions(){return this.parameters.emissiveStrength>0?this.transparent?2:1:0}updateConfiguration(t){super.updateConfiguration(t),this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.transparent,this._configuration.hasOccludees=t.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?0:this.parameters.cullFace,this._configuration.offsetBackfaces=this.transparent,l(t.output)?(this._configuration.receiveShadows=t.shadowMap.enabled,this._configuration.hasShadowHighlights=U(this._configuration,t),this._configuration.receiveAmbientOcclusion=null!=t.ssao):this._configuration.receiveShadows=this._configuration.hasShadowHighlights=this._configuration.receiveAmbientOcclusion=!1,this._configuration.pbrMode=this.parameters.usePBR?2:0,this._configuration.emissionSource=this.parameters.usePBR?1:0,this._configuration.snowCover=t.snowCover>0,this._configuration.upVectorAlignment=this.parameters.upVectorAlignment,this._configuration.pathCapType=this.parameters.pathCapType,this._configuration.pathProfileType=this.parameters.profile.type,this._configuration.hasPathSize=this.parameters.hasPathSize,this._configuration.hasPathColor=this.parameters.hasPathColor,this._configuration.hasPathOpacity=this.parameters.hasPathOpacity}isVisibleForOutput(t){return 5!==t&&7!==t&&6!==t||this.parameters.castShadows}get visible(){return this.parameters.opacity>=L}intersectRay(t,e,i,r,s,o){this._intersectRay(t,i,r,s,o)}intersectRayDraped(){}intersectScreenPolygonDraped(){return null}intersectScreenPolygon(t,e,i,r){return d(t)?w(t.intersectScreenPolygon(i,e,r),this._configuration,i.camera.eye):null}_intersectRay(e,i,r,s,o){if(!d(e))return;const a=new y(i.tolerance,!1,i.options.normalRequired),n=e.boundingInfo;if(null==n)return void e.intersectRay(r,s,a,o);const h=t(n.bbMin[0],n.bbMin[1],n.bbMin[2],n.bbMax[0],n.bbMax[1],n.bbMax[2]),c=[s[0]-r[0],s[1]-r[1],s[2]-r[2]],u=Math.sqrt(c[0]*c[0]+c[1]*c[1]+c[2]*c[2]),f=[u/c[0],u/c[1],u/c[2]];_(h,r,f,i.tolerance)&&e.intersectRay(r,s,a,o)}createBufferWriter(){return new W(F(),P(this.parameters))}createGLMaterial(t){return new D(t)}get transparent(){const{parameters:t}=this;return t.drivenOpacity||t.opacity<1}}class D extends m{beginSlot(t){return this.getTechnique(V,t)}}class G extends x{constructor(){super(...arguments),this.polygonOffset=0,this.castShadows=!0,this.hasSlicePlane=!1,this.drivenOpacity=!1,this.usePBR=!1,this.upVectorAlignment=0,this.pathCapType=1,this.cullFace=2}}class W{constructor(t,e){this.layout=t,this.textureBufferLayout=e,this.maxTextureBufferItemIndex=u}elementCount(t){return t.get("pathVertexInfo")?.indices.length??0}elementCountTextureBuffer(t){return t.get("position")?.indices.length??0}write(t,e,i,r,s,o,a){null!=s&&this._writeVertexBuffer(t,e,i,s,o),null!=a&&this._writeTextureBuffer(t,i,r,a)}_writeVertexBuffer(t,i,r,s,o){R(r,null,this.layout,t,i,s);const a=o?.from??0,n=s.buffer.getField("pathVertexInfo",e),h=r.get("pathVertexInfo");if(n&&h){S(1===h.size);const{data:t,stride:e,indices:i}=h;for(let r=0;r<i.length;++r){const o=t[e*i[r]];n.set(s.offset+r,b(o,a))}}}_writeTextureBuffer(t,e,u,f){const p=f.offset,l=f.buffer.getField("position",i),m=e.get("position");l&&m&&(S(3===m.size),z(m,t,l,p));const d=f.buffer.getField("profileRight",r),b=e.get("profileRight");d&&b&&(S(2===b.size),B(b,d,p));const y=f.buffer.getField("profileUp",r),_=e.get("profileUp");y&&_&&(S(2===_.size),B(_,y,p));const w=f.buffer.getField("profileRotation",s),F=e.get("profileRotation");w&&F&&(S(1===F.size),M(F,w,p));const P=f.buffer.getField("pathRotationUp",r),x=e.get("pathRotationUp");P&&x&&(S(2===x.size),B(x,P,p));const V=f.buffer.getField("pathMaxStretchDistance",o),j=e.get("pathMaxStretchDistance");V&&j&&(S(1===j.size),O(j,V,p));const C=f.buffer.getField("sizeFeatureAttribute",a),R=e.get("sizeFeatureAttribute");C&&R&&v(R,C,p);const U=f.buffer.getField("size",n),L=e.get("size");U&&L&&(S(2===L.size),B(L,U,p));const q=f.buffer.getField("colorFeatureAttribute",a),D=e.get("colorFeatureAttribute");q&&D&&v(D,q,p);const G=f.buffer.getField("color",h),W=e.get("color");G&&W&&A(W,4,G,p);const H=f.buffer.getField("opacityFeatureAttribute",a),k=e.get("opacityFeatureAttribute");H&&k&&v(k,H,p);const E=f.buffer.getField("opacity",c),J=e.get("opacity");if(E&&J&&(S(1===J.size),T(J,E,p)),g()){const t=f.buffer.getField("olidColor",h),e=m?.indices.length??0;u&&t&&e&&I(u,t,e,p)}}}export{G as Parameters,W as PathBufferWriter,q as PathMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as i,createScreenPointArray as r}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as a}from"../../../../core/time.js";import{copy as n}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{set as o,subtract as l,dot as p,scale as m,add as c,copy as h,length as u,distance as f,lerp as d,transformMat4 as g,normalize as _}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as S}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as P,create as v}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as y}from"../../../../geometry/support/float16.js";import{fromPoints as w,distance2 as E,closestLineSegmentPoint as T,projectPoint as x,projectPointFraction as z,create as j}from"../../../../geometry/support/lineSegment.js";import{fromPoints as L,signedDistance as A,getNormal as M,create as C}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as R,BufferViewUint32 as O}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as V,isColor as F,isDepth as B,isColorHighlightOLIDOrDepth as U,is2DGeometryOutput as N}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as I}from"../effects/geometry/olidUtils.js";import k from"../lib/GLMaterial.js";import{Material as W}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as D,screenPolygonIntersectsBufferedSegment as Y}from"../lib/screenPolygonOverlapUtils.js";import{Hit as J}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as q}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as X,assert as G}from"../lib/Util.js";import{isImagePattern as H}from"./lineStippleUtils.js";import{VisualVariablePassParameters as K}from"./VisualVariablePassParameters.js";import{r as Q}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as Z,getTextureBufferLayout as $}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ee}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as te}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ie}from"../../../../webscene/support/AlphaCutoff.js";class re extends W{constructor(e,t){super(e,ae),this.produces=new Map([[2,e=>V(e)||F(e)&&8===this.parameters.renderOccluded],[3,e=>B(e)],[10,e=>U(e)&&8===this.parameters.renderOccluded],[11,e=>U(e)&&8===this.parameters.renderOccluded],[4,e=>F(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>F(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>N(e)]]),this._configuration=new te(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,i=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,r=i&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=i,this._configuration.stippleOffColorEnabled=i&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=i&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=me(this.parameters.join,i),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&pe(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!r,this._configuration.worldSizedImagePattern=r}get visible(){return this.parameters.color[3]>=ie||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ie}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:i},r,s,a,n){if(!r.options.selectionMode)return;const o=e.get("size");let l=this.parameters.width;if(this.parameters.vvSize){const i=e.get("sizeFeatureAttribute").data[0];Number.isNaN(i)?l*=this.parameters.vvSize.fallback[0]:l*=t(this.parameters.vvSize.offset[0]+i*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else o&&(l*=o.data[0]);const p=s[0],m=s[1],c=(l/2+Ue)*i;let h=Number.MAX_VALUE,u=0;const f=e.get("position").data,d=le(this.parameters,e)?f.length-2:f.length-5;for(let g=0;g<d;g+=3){const e=f[g],i=f[g+1],r=(g+3)%f.length,s=p-e,a=m-i,n=f[r]-e,o=f[r+1]-i,l=t((n*s+o*a)/(n*n+o*o),0,1),c=n*l-s,d=o*l-a,_=c*c+d*d;_<h&&(h=_,u=g/3)}h<c*c&&a(n.distance,n.normal,u)}intersectRay(t,i,r,s,a,d){const{options:g,camera:_,rayBegin:b,rayEnd:S}=r;if(!g.selectionMode||!t.visible||!_)return;if(!X(i))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,v=P.get("position").data,y=this._getLineSize(P),x=Se;n(x,r.point);const z=y*_.pixelRatio,j=Ue*_.pixelRatio,C=z/2+j;o(Ce[0],x[0]-C,x[1]+C,0),o(Ce[1],x[0]+C,x[1]+C,0),o(Ce[2],x[0]+C,x[1]-C,0),o(Ce[3],x[0]-C,x[1]-C,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ce[e],Re[e]))return;L(_.eye,Re[0],Re[1],Oe),L(_.eye,Re[1],Re[2],Ve),L(_.eye,Re[2],Re[3],Fe),L(_.eye,Re[3],Re[0],Be);let R=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(he,ue,v,i,le(this.parameters,P))){if(A(Oe,he)<0&&A(Oe,ue)<0||A(Ve,he)<0&&A(Ve,ue)<0||A(Fe,he)<0&&A(Fe,ue)<0||A(Be,he)<0&&A(Be,ue)<0)continue;const t=_.projectToRenderScreen(he,Pe),i=_.projectToRenderScreen(ue,ve);if(null==t||null==i)continue;if(t[2]<0&&i[2]>0){l(_e,he,ue);const e=_.frustum,i=-A(e[4],he)/p(_e,M(e[4]));if(m(_e,_e,i),c(he,he,_e),!_.projectToRenderScreen(he,t))continue}else if(t[2]>0&&i[2]<0){l(_e,ue,he);const e=_.frustum,t=-A(e[4],ue)/p(_e,M(e[4]));if(m(_e,_e,t),c(ue,ue,_e),!_.projectToRenderScreen(ue,i))continue}else if(t[2]<0&&i[2]<0)continue;t[2]=0,i[2]=0;const r=w(t,i,xe),s=E(r,x);if(!(s>=R)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(r,he,ue,x,_,y,j);if(s>=e*e)continue}R=s,h(Ee,he),h(Te,ue),O=e}}if(R<C*C){let e=Number.MAX_VALUE;if(T(w(Ee,Te,xe),w(b,S,ze),be)){l(be,be,b);const t=u(be);m(be,be,1/t),e=t/f(b,S)}d(e,be,O)}}intersectScreenPolygon(t,i,r,s){const{options:a,camera:n,screenPolygonPrimitiveProcessor:o}=r;if(!a.selectionMode||!t.visible)return null;if(!X(i))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,p=l.get("position").data,m=this._getLineSize(l),c=Ue,h=c*n.pixelRatio,u=new J(4);for(const e of this._forEachTransformedLineSegment(he,ue,p,i,le(this.parameters,l)))for(const[t,i]of o.processLineSegment(Ne,he,ue)){if(!D(n,t,i,Pe,ve))continue;const r=w(Pe,ve,xe);let a=m/2+c;this.parameters.screenSizePerspective&&(d(Se,Pe,ve,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(r,t,i,Se,n,m,h)/n.pixelRatio)),n.renderToScreen(Pe,ye),n.renderToScreen(ve,we),Y(s,ye,we,a)&&(x(w(t,i,ze),n.eye,fe),u.updateIfCloserFromValues(f(n.eye,fe),e,fe,null))}return u}createBufferWriter(){return new ne(Z(this.parameters),$(this.parameters),this.parameters)}createGLMaterial(e){return new se(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,i,r,s,a,n){const o=z(e,r);d(fe,t,i,o),g(de,fe,s.viewMatrix);const l=u(de),p=this.computeCameraAbsCosAngle(fe,s,this._configuration.spherical);ce.update(p,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return ce.apply(a)*s.pixelRatio/2+n}computeCameraAbsCosAngle(e,t,i){return i?_(be,e):o(be,0,0,1),l(ge,e,t.eye),_(ge,ge),Math.abs(p(be,ge))}_getLineSize(e,i=!1){let r=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?i&&(r*=this.parameters.vvSize.fallback[0]):r*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(r*=e.get("size").data[0]);return r}*_forEachTransformedLineSegment(e,t,i,r,s){const a=s?i.length-2:i.length-5;for(let n=0;n<a;n+=3){e[0]=i[n]+r[12],e[1]=i[n+1]+r[13],e[2]=i[n+2]+r[14];const s=(n+3)%i.length;t[0]=i[s]+r[12],t[1]=i[s+1]+r[13],t[2]=i[s+2]+r[14],yield n/3}}}class se extends k{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ee,e)}}class ae extends K{constructor(){super(...arguments),this._width=0,this.color=P,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return H(this.stipplePattern)&&null!=this.stippleTexture}}class ne{constructor(e,t,i){this.layout=e,this.textureBufferLayout=t,this._parameters=i,this.numJoinSubdivisions=me(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return le(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+2}elementCount(e){const t=2,i=e.get("position").indices.length/2+1,r=this._isClosed(e);let s=r?2:2*t;return s+=((r?i:i-1)-(r?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,i,r,s,a,n){null!=n&&this._writeTextureBuffer(e,i,n),null!=s&&this._writeVertexBuffer(e,i,r,s,a)}_writeTextureBuffer(e,t,i){const r=t.get("position"),s=r.data.length/3,a=s+2,n=this._isClosed(t),{buffer:o,offset:l}=i,p=o.getField("position",R);G(null!==p,"Expected valid position field in texture buffer");for(let m=0;m<s;++m)this._getTransformedPosition(Le,r.data,m,e),p.setVec(l+m+1,Le);n?(o.copyItem(l+a-2,l+0),o.copyItem(l+1,l+a-1)):(o.copyItem(l+1,l+0),o.copyItem(l+a-2,l+a-1))}_writeVertexBuffer(e,t,i,r,s){const{buffer:a,offset:n}=r,{layout:o}=this,l=t.get("position"),p=l.indices,m=l.data.length/3,c=m+2,u=t.get("distanceToStart")?.data;p&&p.length!==2*(m-1)&&console.warn("RibbonLineMaterial does not support indices");const d=a.getField("textureElementIndex",O);G(null!=d,"Missing texture buffer index field"),G(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const g=s.from;G(s.numElements===c,"Expected number of elements in TextureBuffer to equal number of points");const _=o.fields.has("sizeFeatureAttribute");let b=1,P=null;if(_){const e=t.get("sizeFeatureAttribute");1===e.data.length?b=e.data[0]:P=e.data}else b=t.get("size")?.data[0]??1;let v=[1,1,1,1],w=0,E=null;const T=o.fields.has("colorFeatureAttribute");if(T){const e=t.get("colorFeatureAttribute");1===e.data.length?w=e.data[0]:E=e.data}else v=t.get("color")?.data??v;const x=t.get("timeStamps")?.data,z=x&&o.fields.has("timeStamps"),j=o.fields.has("opacityFeatureAttribute");let L=0,A=null;if(j){const e=t.get("opacityFeatureAttribute");1===e.data.length?L=e.data[0]:A=e.data}const M=new Float32Array(a.buffer),C=y(a.buffer),R=new Uint8Array(a.buffer),V=new Uint32Array(a.buffer),F=o.stride/4;let B=n*F;const U=B;let N=0;const k=M.BYTES_PER_ELEMENT/C.BYTES_PER_ELEMENT,W=I(),D=this._isClosed(t),Y=(e,t,r,s,a,n,o,l)=>{const p=o+1;V[B]=g+p,B++,M[B++]=l;let m=B*k;if(C[m++]=a,C[m++]=n,B=Math.ceil(m/k),T)M[B]=E?.[o]??w;else{const e=Math.min(4*o,v.length-4),t=4*B;R[t]=255*v[e],R[t+1]=255*v[e+1],R[t+2]=255*v[e+2],R[t+3]=255*v[e+3]}if(B++,M[B++]=P?.[o]??b,j&&(M[B++]=A?.[o]??L),W){let e=4*B;i?(R[e++]=i[0],R[e++]=i[1],R[e++]=i[2],R[e++]=i[3]):(R[e++]=0,R[e++]=0,R[e++]=0,R[e++]=0),B=Math.ceil(.25*e)}z&&(m=B*k,C[m++]=s[0],C[m++]=s[1],C[m++]=s[2],C[m++]=s[3],B=Math.ceil(m/k))},J=()=>{h(je,Le),h(Le,Ae)},q=e=>{if(z){const t=4*e;S(Me,x[t+0],x[t+1],x[t+2],x[t+3])}},X=(e,t,i)=>{null!=u?N=u[i]:N+=f(e,t)};B+=F,this._getTransformedPosition(Le,l.data,0,e),q(0);let H=0,K=0;D?(this._getTransformedPosition(je,l.data,m-1,e),H=0,K=m):(this._getTransformedPosition(Ae,l.data,1,e),Y(Le,Le,Ae,Me,1,-4,0,0),Y(Le,Le,Ae,Me,1,4,0,0),J(),q(1),H=1,K=m-1);for(let h=H;h<K;h++){this._getTransformedPosition(Ae,l.data,(h+1)%m,e),X(je,Le,h),Y(je,Le,Ae,Me,0,-1,h,N),Y(je,Le,Ae,Me,0,1,h,N);const t=this.numJoinSubdivisions;for(let e=0;e<t;++e){const i=(e+1)/(t+1);Y(je,Le,Ae,Me,i,-1,h,N),Y(je,Le,Ae,Me,i,1,h,N)}Y(je,Le,Ae,Me,1,-2,h,N),Y(je,Le,Ae,Me,1,2,h,N),J(),q((h+1)%m)}X(je,Le,K),D?(this._getTransformedPosition(Ae,l.data,1,e),Y(je,Le,Ae,Me,0,-1,H,N),Y(je,Le,Ae,Me,0,1,H,N)):(Y(je,Le,Le,Me,0,-5,K,N),Y(je,Le,Le,Me,0,5,K,N)),oe(M,U+F,M,U,F);B=oe(M,B-F,M,B,F),this._parameters.wireframe&&this._addWireframeVertices(a,U,B,F)}_getTransformedPosition(e,t,i,r){const s=3*i;o(e,t[s+0],t[s+1],t[s+2]),r&&g(e,e,r)}_addWireframeVertices(e,t,i,r){const s=new Uint8Array(e.buffer,i*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(i-t)*Float32Array.BYTES_PER_ELEMENT),n=r*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=oe(a,e,s,o,n);for(let p=0;p<=a.length-4*n;p+=2*n)l(p),l(p+2*n),l(p+1*n),l(p+2*n),l(p+1*n),l(p+3*n)}}function oe(e,t,i,r,s){for(let a=0;a<s;a++)i[r++]=e[t++];return r}function le(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function pe(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function me(e,t){const i=t?1:0;switch(e){case"miter":case"bevel":return i;case"round":return Q+i}}const ce=new q,he=b(),ue=b(),fe=b(),de=b(),ge=b(),_e=b(),be=b(),Se=b(),Pe=i(),ve=i(),ye=r(),we=r(),Ee=b(),Te=b(),xe=j(),ze=j(),je=b(),Le=b(),Ae=b(),Me=v(),Ce=[i(),i(),i(),i()],Re=[b(),b(),b(),b()],Oe=C(),Ve=C(),Fe=C(),Be=C(),Ue=4,Ne=[b(),b()];export{ae as Parameters,re as RibbonLineMaterial};
2
+ import e from"../../../../core/Logger.js";import{clamp as t}from"../../../../core/mathUtils.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as i}from"../../../../core/screenUtils.js";import{secondsFromMilliseconds as s,Seconds as a}from"../../../../core/time.js";import{copy as n,set as o}from"../../../../core/libs/gl-matrix-2/math/vec2.js";import{create as l}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as c,subtract as p,dot as m,scale as h,add as u,copy as f,length as d,distance as g,lerp as _,transformMat4 as b,normalize as S}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{create as P}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{set as y}from"../../../../core/libs/gl-matrix-2/math/vec4.js";import{ONES as v,create as w}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{makeFloat16Array as T}from"../../../../geometry/support/float16.js";import{fromPoints as E,distance2 as x,closestLineSegmentPoint as j,projectPoint as L,projectPointFraction as z,create as A}from"../../../../geometry/support/lineSegment.js";import{fromPoints as M,signedDistance as C,getNormal as R,create as O}from"../../../../geometry/support/plane.js";import{BufferViewVec3f as V,BufferViewUint32 as B}from"../../../../geometry/support/buffer/BufferView.js";import{isHighlightOrOLID as F,isColor as U,isDepth as I,isColorHighlightOLIDOrDepth as N,is2DGeometryOutput as k}from"../core/shaderLibrary/ShaderOutput.js";import{olidEnabled as W}from"../effects/geometry/olidUtils.js";import D from"../lib/GLMaterial.js";import{Material as Y}from"../lib/Material.js";import{projectWorldLineSegmentToRenderScreen as J,screenPolygonIntersectsBufferedSegment as q}from"../lib/screenPolygonOverlapUtils.js";import{Hit as X,DrapedHit as G}from"../lib/screenPolygonTriangleIntersections.js";import{ScreenSizePerspectiveEvaluator as H}from"../lib/screenSizePerspectiveUtils.js";import{isTranslationMatrix as K,assert as Q}from"../lib/Util.js";import{isImagePattern as Z}from"./lineStippleUtils.js";import{VisualVariablePassParameters as $}from"./VisualVariablePassParameters.js";import{r as ee}from"../../../../chunks/RibbonLine.glsl.js";import{getLayout as te,getTextureBufferLayout as re}from"../shaders/RibbonLineLayouts.js";import{RibbonLineTechnique as ie}from"../shaders/RibbonLineTechnique.js";import{RibbonLineTechniqueConfiguration as se}from"../shaders/RibbonLineTechniqueConfiguration.js";import{alphaCutoff as ae}from"../../../../webscene/support/AlphaCutoff.js";class ne extends Y{constructor(e,t){super(e,le),this.produces=new Map([[2,e=>F(e)||U(e)&&8===this.parameters.renderOccluded],[3,e=>I(e)],[10,e=>N(e)&&8===this.parameters.renderOccluded],[11,e=>N(e)&&8===this.parameters.renderOccluded],[4,e=>U(e)&&this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[8,e=>U(e)&&!this.parameters.writeDepth&&8!==this.parameters.renderOccluded],[18,e=>k(e)]]),this._configuration=new se(t)}updateConfiguration(e){super.updateConfiguration(e);const t=18===e.slot,r=null!=this.parameters.stipplePattern&&null!=this.parameters.stippleTexture&&10!==e.output,i=r&&t&&this.parameters.isImagePattern();this._configuration.draped=t,this._configuration.polygonOffset=this.parameters.polygonOffset,this._configuration.stippleEnabled=r,this._configuration.stippleOffColorEnabled=r&&null!=this.parameters.stippleOffColor,this._configuration.stipplePreferContinuous=r&&this.parameters.stipplePreferContinuous,this._configuration.numJoinSubdivisions=de(this.parameters.join,r),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.roundJoins="round"===this.parameters.join,this._configuration.capType=this.parameters.cap,this._configuration.applyMarkerOffset=null!=this.parameters.markerParameters&&fe(this.parameters.markerParameters),this._configuration.polygonOffsetIndex=this.parameters.polygonOffsetIndex,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.hasVVSize=this.parameters.hasVVSize,this._configuration.hasVVColor=this.parameters.hasVVColor,this._configuration.hasVVOpacity=this.parameters.hasVVOpacity,this._configuration.innerColorEnabled=this.parameters.innerWidth>0&&null!=this.parameters.innerColor,this._configuration.falloffEnabled=this.parameters.falloff>0,this._configuration.hasOccludees=e.hasOccludees,this._configuration.occluder=8===this.parameters.renderOccluded,this._configuration.wireframe=this.parameters.wireframe,this._configuration.animation=this.parameters.animation,this._configuration.emissionSource=this.emissions?1:0,this._configuration.hasScreenSizePerspective=!!this.parameters.screenSizePerspective&&!i,this._configuration.worldSizedImagePattern=i}get visible(){return this.parameters.color[3]>=ae||null!=this.parameters.stipplePattern&&(this.parameters.stippleOffColor?.[3]??0)>ae}get emissions(){return this.parameters.emissiveStrength>0?8!==this.parameters.renderOccluded?2:1:0}setParameters(e,t){e.animation=this.parameters.animation,super.setParameters(e,t)}intersectRayDraped({attributes:e,screenToWorldRatio:r},i,s,a,n){if(!i.options.selectionMode)return;const o=this._getLineSize(e,!0),l=s[0],c=s[1],p=he(o,r);let m=Number.MAX_VALUE,h=0;for(const u of ue(Se,Pe,this.parameters,e)){const e=l-Se[0],r=c-Se[1],i=Pe[0]-Se[0],s=Pe[1]-Se[1],a=t((i*e+s*r)/(i*i+s*s),0,1),n=i*a-e,o=s*a-r,p=n*n+o*o;p<m&&(m=p,h=u)}m<p*p&&a(n.distance,n.normal,h)}intersectRay(t,r,i,s,a,o){const{options:l,camera:_,rayBegin:b,rayEnd:S}=i;if(!l.selectionMode||!t.visible||!_)return;if(!K(r))return void e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix");const P=t.attributes,y=P.get("position").data,v=this._getLineSize(P),w=xe;n(w,i.point);const T=v*_.pixelRatio,L=Je*_.pixelRatio,z=T/2+L;c(Ie[0],w[0]-z,w[1]+z,0),c(Ie[1],w[0]+z,w[1]+z,0),c(Ie[2],w[0]+z,w[1]-z,0),c(Ie[3],w[0]-z,w[1]-z,0);for(let e=0;e<4;e++)if(!_.unprojectFromRenderScreen(Ie[e],Ne[e]))return;M(_.eye,Ne[0],Ne[1],ke),M(_.eye,Ne[1],Ne[2],We),M(_.eye,Ne[2],Ne[3],De),M(_.eye,Ne[3],Ne[0],Ye);let A=Number.MAX_VALUE,O=0;for(const e of this._forEachTransformedLineSegment(_e,be,y,r,me(this.parameters,P))){if(C(ke,_e)<0&&C(ke,be)<0||C(We,_e)<0&&C(We,be)<0||C(De,_e)<0&&C(De,be)<0||C(Ye,_e)<0&&C(Ye,be)<0)continue;const t=_.projectToRenderScreen(_e,je),r=_.projectToRenderScreen(be,Le);if(null==t||null==r)continue;if(t[2]<0&&r[2]>0){p(Te,_e,be);const e=_.frustum,r=-C(e[4],_e)/m(Te,R(e[4]));if(h(Te,Te,r),u(_e,_e,Te),!_.projectToRenderScreen(_e,t))continue}else if(t[2]>0&&r[2]<0){p(Te,be,_e);const e=_.frustum,t=-C(e[4],be)/m(Te,R(e[4]));if(h(Te,Te,t),u(be,be,Te),!_.projectToRenderScreen(be,r))continue}else if(t[2]<0&&r[2]<0)continue;t[2]=0,r[2]=0;const i=E(t,r,Re),s=x(i,w);if(!(s>=A)){if(this.parameters.screenSizePerspective){const e=this.computeScreenSizePerspectiveWidth(i,_e,be,w,_,v,L);if(s>=e*e)continue}A=s,f(Me,_e),f(Ce,be),O=e}}if(A<z*z){let e=Number.MAX_VALUE;if(j(E(Me,Ce,Re),E(b,S,Oe),Ee)){p(Ee,Ee,b);const t=d(Ee);h(Ee,Ee,1/t),e=t/g(b,S)}o(e,Ee,O)}}intersectScreenPolygon(t,r,i,s){const{options:a,camera:n,screenPolygonPrimitiveProcessor:o}=i;if(!a.selectionMode||!t.visible)return null;if(!K(r))return e.getLogger("esri.views.3d.webgl-engine.materials.RibbonLineMaterial").error("intersection assumes a translation-only matrix"),null;const l=t.attributes,c=l.get("position").data,p=this._getLineSize(l),m=Je,h=m*n.pixelRatio,u=new X(4);for(const e of this._forEachTransformedLineSegment(_e,be,c,r,me(this.parameters,l)))for(const[t,r]of o.processLineSegment(qe,_e,be)){if(!J(n,t,r,je,Le))continue;const i=E(je,Le,Re);let a=p/2+m;this.parameters.screenSizePerspective&&(_(xe,je,Le,.5),a=Math.max(a,this.computeScreenSizePerspectiveWidth(i,t,r,xe,n,p,h)/n.pixelRatio)),n.renderToScreen(je,ze),n.renderToScreen(Le,Ae),q(s,ze,Ae,a)&&(L(E(t,r,Oe),n.eye,ye),u.updateIfCloserFromValues(g(n.eye,ye),e,ye,null))}return u}intersectScreenPolygonDraped({attributes:e,screenToWorldRatio:t},r,i,s){if(!i.options.selectionMode)return null;const a=he(this._getLineSize(e,!0),t);for(const n of ue(Se,Pe,this.parameters,e,r))if(q(s,Se,Pe,a))return new G(n);return null}createBufferWriter(){return new ce(te(this.parameters),re(this.parameters),this.parameters)}createGLMaterial(e){return new oe(e)}validateParameters(e){"miter"!==e.join&&(e.miterLimit=0),null!=e.markerParameters&&(e.markerScale=e.markerParameters.width/e.width)}update(e){return!!this.parameters.hasAnimation&&(this.setParameters({timeElapsed:s(e.time)},!1),0!==e.dt)}computeScreenSizePerspectiveWidth(e,t,r,i,s,a,n){const o=z(e,i);_(ye,t,r,o),b(ve,ye,s.viewMatrix);const l=d(ve),c=this.computeCameraAbsCosAngle(ye,s,this._configuration.spherical);ge.update(c,l,this.parameters.screenSizePerspective,this.parameters.screenSizePerspectiveMinPixelReferenceSize);return ge.apply(a)*s.pixelRatio/2+n}computeCameraAbsCosAngle(e,t,r){return r?S(Ee,e):c(Ee,0,0,1),p(we,e,t.eye),S(we,we),Math.abs(m(Ee,we))}_getLineSize(e,r=!1){let i=this.parameters.width;if(this.parameters.vvSize){const s=e.get("sizeFeatureAttribute").data[0];Number.isNaN(s)?r&&(i*=this.parameters.vvSize.fallback[0]):i*=t(this.parameters.vvSize.offset[0]+s*this.parameters.vvSize.factor[0],this.parameters.vvSize.minSize[0],this.parameters.vvSize.maxSize[0])}else e.has("size")&&(i*=e.get("size").data[0]);return i}*_forEachTransformedLineSegment(e,t,r,i,s){const a=s?r.length-2:r.length-5;for(let n=0;n<a;n+=3){e[0]=r[n]+i[12],e[1]=r[n+1]+i[13],e[2]=r[n+2]+i[14];const s=(n+3)%r.length;t[0]=r[s]+i[12],t[1]=r[s+1]+i[13],t[2]=r[s+2]+i[14],yield n/3}}}class oe extends D{constructor(){super(...arguments),this._stipplePattern=null}dispose(){super.dispose(),this._stippleTextures?.release(this._stipplePattern),this._stipplePattern=null}beginSlot(e){const{stipplePattern:t}=this._material.parameters;return this._stipplePattern!==t&&(this._material.setParameters({stippleTexture:this._stippleTextures.swap(t,this._stipplePattern)}),this._stipplePattern=t),this.getTechnique(ie,e)}}class le extends ${constructor(){super(...arguments),this._width=0,this.color=v,this.join="miter",this.cap=0,this.miterLimit=5,this.writeDepth=!0,this.polygonOffset=0,this.polygonOffsetIndex=0,this.stippleTexture=null,this.stipplePreferContinuous=!0,this.markerParameters=null,this.markerScale=1,this.hasSlicePlane=!1,this.vvFastUpdate=!1,this.isClosed=!1,this.falloff=0,this.innerWidth=0,this.wireframe=!1,this.timeElapsed=a(0),this.animation=0,this.animationSpeed=1,this.trailLength=1,this.startTime=a(0),this.endTime=a(1/0),this.emissiveStrength=0}get width(){return this.isImagePattern()?this.stipplePattern.width:this._width}set width(e){this._width=e}get transparent(){return this.color[3]<1||this.hasAnimation||null!=this.stipplePattern&&(this.stippleOffColor?.[3]??0)<1}get hasAnimation(){return 0!==this.animation}isImagePattern(){return Z(this.stipplePattern)&&null!=this.stippleTexture}}class ce{constructor(e,t,r){this.layout=e,this.textureBufferLayout=t,this._parameters=r,this.numJoinSubdivisions=de(this._parameters.join,null!=this._parameters.stipplePattern)}_isClosed(e){return me(this._parameters,e)}allocate(e){return this.layout.createBuffer(e)}elementCountTextureBuffer(e){return e.get("position").data.length/3+2}elementCount(e){const t=2,r=e.get("position").indices.length/2+1,i=this._isClosed(e);let s=i?2:2*t;return s+=((i?r:r-1)-(i?0:1))*(2*this.numJoinSubdivisions+4),s+=2,this._parameters.wireframe&&(s=2+4*(s-2)),s}write(e,t,r,i,s,a,n){null!=n&&this._writeTextureBuffer(e,r,n),null!=s&&this._writeVertexBuffer(e,r,i,s,a)}_writeTextureBuffer(e,t,r){const i=t.get("position"),s=i.data.length/3,a=s+2,n=this._isClosed(t),{buffer:o,offset:l}=r,c=o.getField("position",V);Q(null!==c,"Expected valid position field in texture buffer");for(let p=0;p<s;++p)this._getTransformedPosition(Be,i.data,p,e),c.setVec(l+p+1,Be);n?(o.copyItem(l+a-2,l+0),o.copyItem(l+1,l+a-1)):(o.copyItem(l+1,l+0),o.copyItem(l+a-2,l+a-1))}_writeVertexBuffer(e,t,r,i,s){const{buffer:a,offset:n}=i,{layout:o}=this,l=t.get("position"),c=l.indices,p=l.data.length/3,m=p+2,h=t.get("distanceToStart")?.data;c&&c.length!==2*(p-1)&&console.warn("RibbonLineMaterial does not support indices");const u=a.getField("textureElementIndex",B);Q(null!=u,"Missing texture buffer index field"),Q(null!=s,"Using a texture layout, but the texture range for this instance was not provided");const d=s.from;Q(s.numElements===m,"Expected number of elements in TextureBuffer to equal number of points");const _=o.fields.has("sizeFeatureAttribute");let b=1,S=null;if(_){const e=t.get("sizeFeatureAttribute");1===e.data.length?b=e.data[0]:S=e.data}else b=t.get("size")?.data[0]??1;let P=[1,1,1,1],v=0,w=null;const E=o.fields.has("colorFeatureAttribute");if(E){const e=t.get("colorFeatureAttribute");1===e.data.length?v=e.data[0]:w=e.data}else P=t.get("color")?.data??P;const x=t.get("timeStamps")?.data,j=x&&o.fields.has("timeStamps"),L=o.fields.has("opacityFeatureAttribute");let z=0,A=null;if(L){const e=t.get("opacityFeatureAttribute");1===e.data.length?z=e.data[0]:A=e.data}const M=new Float32Array(a.buffer),C=T(a.buffer),R=new Uint8Array(a.buffer),O=new Uint32Array(a.buffer),V=o.stride/4;let F=n*V;const U=F;let I=0;const N=M.BYTES_PER_ELEMENT/C.BYTES_PER_ELEMENT,k=W(),D=this._isClosed(t),Y=(e,t,i,s,a,n,o,l)=>{const c=o+1;O[F]=d+c,F++,M[F++]=l;let p=F*N;if(C[p++]=a,C[p++]=n,F=Math.ceil(p/N),E)M[F]=w?.[o]??v;else{const e=Math.min(4*o,P.length-4),t=4*F;R[t]=255*P[e],R[t+1]=255*P[e+1],R[t+2]=255*P[e+2],R[t+3]=255*P[e+3]}if(F++,M[F++]=S?.[o]??b,L&&(M[F++]=A?.[o]??z),k){let e=4*F;r?(R[e++]=r[0],R[e++]=r[1],R[e++]=r[2],R[e++]=r[3]):(R[e++]=0,R[e++]=0,R[e++]=0,R[e++]=0),F=Math.ceil(.25*e)}j&&(p=F*N,C[p++]=s[0],C[p++]=s[1],C[p++]=s[2],C[p++]=s[3],F=Math.ceil(p/N))},J=()=>{f(Ve,Be),f(Be,Fe)},q=e=>{if(j){const t=4*e;y(Ue,x[t+0],x[t+1],x[t+2],x[t+3])}},X=(e,t,r)=>{null!=h?I=h[r]:I+=g(e,t)};F+=V,this._getTransformedPosition(Be,l.data,0,e),q(0);let G=0,H=0;D?(this._getTransformedPosition(Ve,l.data,p-1,e),G=0,H=p):(this._getTransformedPosition(Fe,l.data,1,e),Y(Be,Be,Fe,Ue,1,-4,0,0),Y(Be,Be,Fe,Ue,1,4,0,0),J(),q(1),G=1,H=p-1);for(let f=G;f<H;f++){this._getTransformedPosition(Fe,l.data,(f+1)%p,e),X(Ve,Be,f),Y(Ve,Be,Fe,Ue,0,-1,f,I),Y(Ve,Be,Fe,Ue,0,1,f,I);const t=this.numJoinSubdivisions;for(let e=0;e<t;++e){const r=(e+1)/(t+1);Y(Ve,Be,Fe,Ue,r,-1,f,I),Y(Ve,Be,Fe,Ue,r,1,f,I)}Y(Ve,Be,Fe,Ue,1,-2,f,I),Y(Ve,Be,Fe,Ue,1,2,f,I),J(),q((f+1)%p)}X(Ve,Be,H),D?(this._getTransformedPosition(Fe,l.data,1,e),Y(Ve,Be,Fe,Ue,0,-1,G,I),Y(Ve,Be,Fe,Ue,0,1,G,I)):(Y(Ve,Be,Be,Ue,0,-5,H,I),Y(Ve,Be,Be,Ue,0,5,H,I)),pe(M,U+V,M,U,V);F=pe(M,F-V,M,F,V),this._parameters.wireframe&&this._addWireframeVertices(a,U,F,V)}_getTransformedPosition(e,t,r,i){const s=3*r;c(e,t[s+0],t[s+1],t[s+2]),i&&b(e,e,i)}_addWireframeVertices(e,t,r,i){const s=new Uint8Array(e.buffer,r*Float32Array.BYTES_PER_ELEMENT),a=new Uint8Array(e.buffer,t*Float32Array.BYTES_PER_ELEMENT,(r-t)*Float32Array.BYTES_PER_ELEMENT),n=i*Float32Array.BYTES_PER_ELEMENT;let o=0;const l=e=>o=pe(a,e,s,o,n);for(let c=0;c<=a.length-4*n;c+=2*n)l(c),l(c+2*n),l(c+1*n),l(c+2*n),l(c+1*n),l(c+3*n)}}function pe(e,t,r,i,s){for(let a=0;a<s;a++)r[i++]=e[t++];return i}function me(e,t){if(!e.isClosed)return!1;return t.get("position").indices.length>2}function he(e,t){return(e/2+Je)*t}function*ue(e,t,r,i,s){const a=i.get("position").data,l=me(r,i)?a.length-2:a.length-5,c=s?.[0]??0,p=s?.[1]??0;o(e,a[0]+c,a[1]+p);for(let m=3;m<l+3;m+=3){const r=m%a.length;o(t,a[r]+c,a[r+1]+p),yield m/3,n(e,t)}}function fe(e){return 1===e.anchor&&e.hideOnShortSegments&&"begin-end"===e.placement&&e.worldSpace}function de(e,t){const r=t?1:0;switch(e){case"miter":case"bevel":return r;case"round":return ee+r}}const ge=new H,_e=P(),be=P(),Se=l(),Pe=l(),ye=P(),ve=P(),we=P(),Te=P(),Ee=P(),xe=P(),je=r(),Le=r(),ze=i(),Ae=i(),Me=P(),Ce=P(),Re=A(),Oe=A(),Ve=P(),Be=P(),Fe=P(),Ue=w(),Ie=[r(),r(),r(),r()],Ne=[P(),P(),P(),P()],ke=O(),We=O(),De=O(),Ye=O(),Je=4,qe=[P(),P()];export{le as Parameters,ne as RibbonLineMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{set as e,scale as t,add as r,normalize as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as c}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as p}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as h}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as f}from"../lib/Material.js";import{intersectTriangleGeometry as u}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as g}from"../lib/screenPolygonTriangleIntersections.js";import{assert as d}from"../lib/Util.js";import{applyPolygonOffsetToHit as b,intersectWithPolygonOffset as _}from"./intersectWithPolygonOffset.js";import{writeAttributes as S,writePosition as y}from"./internal/bufferWriterUtils.js";import{getLayout as j,ShadedColorMaterialTechnique as x}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as z}from"../../../../webscene/support/AlphaCutoff.js";class D extends m{constructor(e){super(e,E),this._configuration=new w,this.supportsEdges=!0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>10===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[8,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled}get visible(){return this.parameters.color[3]>=z}intersectRay(e,t,r,s,i,a){this._intersectRay(e,r,s,i,a)}intersectRayDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersectRay(e,t,this._pp0,this._pp1,s)}intersectScreenPolygon(e,t,r,s){return b(g(e,r,t,s,this._createVertexDisplacement(e,r)),this._configuration,r.camera.eye)}_intersectRay(e,t,r,s,i){const a=_(i,this._configuration,r,s);u(e,t,r,s,this._createVertexDisplacement(e,t),a)}_createVertexDisplacement(s,i){if(!this.parameters.screenSizeEnabled)return;const a=s.attributes.get("offset").data;return{applyToVertex:(s,n,o,c,p)=>{const h=e(P,a[3*p],a[3*p+1],a[3*p+2]);e(s,n,o,c);const l=this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(h)??1);return t(h,h,l),r(s,s,h),s},applyToAabb:e=>{const t=o(e,P);return c(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}}}createGLMaterial(e){return new T(e)}createBufferWriter(){return new M(j(this.parameters))}}class T extends l{beginSlot(e){return this.getTechnique(x,e)}}class E extends f{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=s(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class M{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i){if(null==i)return;const{buffer:a,offset:n}=i;S(r,s,this.layout,e,t,i);const o=a.getField("offset",p);if(o&&r.has("offset")){const e=r.get("offset");d(3===e.size),y(e,t,o,n)}}}const P=a();export{E as Parameters,D as ShadedColorMaterial};
2
+ import{set as e,scale as t,add as r,normalize as s}from"../../../../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as i,create as a}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{center as o,scale as c}from"../../../../geometry/support/aaBoundingBox.js";import{BufferViewVec3f as p}from"../../../../geometry/support/buffer/BufferView.js";import{isColorOrOLID as h}from"../core/shaderLibrary/ShaderOutput.js";import l from"../lib/GLMaterial.js";import{Material as m,MaterialParameters as f}from"../lib/Material.js";import{intersectTriangleGeometry as u}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as g}from"../lib/screenPolygonTriangleIntersections.js";import{assert as d}from"../lib/Util.js";import{applyPolygonOffsetToHit as b,intersectWithPolygonOffset as S}from"./intersectWithPolygonOffset.js";import{writeAttributes as _,writePosition as y}from"./internal/bufferWriterUtils.js";import{getLayout as j,ShadedColorMaterialTechnique as x}from"../shaders/ShadedColorMaterialTechnique.js";import{ShadedColorMaterialTechniqueConfiguration as w}from"../shaders/ShadedColorMaterialTechniqueConfiguration.js";import{alphaCutoff as D}from"../../../../webscene/support/AlphaCutoff.js";class z extends m{constructor(e){super(e,T),this._configuration=new w,this.supportsEdges=!0,this.intersectScreenPolygonDraped=void 0,this._pp0=i(0,0,1),this._pp1=i(0,0,0),this.produces=new Map([[2,e=>10===e||h(e)&&!this.parameters.transparent],[4,e=>h(e)&&this.parameters.transparent&&this.parameters.writeDepth],[8,e=>h(e)&&this.parameters.transparent&&!this.parameters.writeDepth]])}updateConfiguration(e){super.updateConfiguration(e),this._configuration.cullFace=this.parameters.cullFace,this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,this._configuration.screenSizeEnabled=this.parameters.screenSizeEnabled,this._configuration.shadingEnabled=this.parameters.shadingEnabled}get visible(){return this.parameters.color[3]>=D}intersectRay(e,t,r,s,i,a){this._intersectRay(e,r,s,i,a)}intersectRayDraped(e,t,r,s){return this._pp0[0]=this._pp1[0]=r[0],this._pp0[1]=this._pp1[1]=r[1],this._intersectRay(e,t,this._pp0,this._pp1,s)}intersectScreenPolygon(e,t,r,s){return b(g(e,r,t,s,this._createVertexDisplacement(e,r)),this._configuration,r.camera.eye)}_intersectRay(e,t,r,s,i){const a=S(i,this._configuration,r,s);u(e,t,r,s,this._createVertexDisplacement(e,t),a)}_createVertexDisplacement(s,i){if(!this.parameters.screenSizeEnabled)return;const a=s.attributes.get("offset").data;return{applyToVertex:(s,n,o,c,p)=>{const h=e(M,a[3*p],a[3*p+1],a[3*p+2]);e(s,n,o,c);const l=this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(h)??1);return t(h,h,l),r(s,s,h),s},applyToAabb:e=>{const t=o(e,M);return c(e,this.parameters.screenSizeScale*(i.camera?.computeScreenPixelSizeAt(t)??1))}}}createGLMaterial(e){return new P(e)}createBufferWriter(){return new E(j(this.parameters))}}class P extends l{beginSlot(e){return this.getTechnique(x,e)}}class T extends f{constructor(){super(...arguments),this.color=n(1,1,1,1),this.shadingTint=n(0,0,0,.25),this.shadingDirection=s(a(),[.5,-.5,-.5]),this.screenSizeScale=14,this.forceTransparentMode=!1,this.writeDepth=!0,this.hasSlicePlane=!1,this.cullFace=0,this.screenSizeEnabled=!1,this.shadingEnabled=!0}get transparent(){return this.color[3]<1||this.forceTransparentMode}}class E{constructor(e){this.layout=e}elementCount(e){return e.get("position").indices.length}write(e,t,r,s,i){if(null==i)return;const{buffer:a,offset:n}=i;_(r,s,this.layout,e,t,i);const o=a.getField("offset",p);if(o&&r.has("offset")){const e=r.get("offset");d(3===e.size),y(e,t,o,n)}}}const M=a();export{T as Parameters,z as ShadedColorMaterial};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{Material as t,MaterialParameters as e}from"../lib/Material.js";import{intersectTriangleGeometry as n,intersectTriangleGeometry2D as r}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as o}from"../lib/screenPolygonTriangleIntersections.js";import{intersectWithPolygonOffset as s,applyPolygonOffsetToHit as i}from"./intersectWithPolygonOffset.js";class a extends t{updateConfiguration(t){super.updateConfiguration(t),this._configuration.transparent=this.transparent,this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.polygonOffset=this.parameters.polygonOffset}intersectRay(t,e,r,o,i,a){return a=s(a,this._configuration,o,i),n(t,r,o,i,null,a)}intersectRayDraped(t,e,n,o){return r(n[0],n[1],t,o)}intersectScreenPolygon(t,e,n,r){return i(o(t,n,e,r,null),this._configuration,n.camera.eye)}}class f extends e{constructor(){super(...arguments),this.polygonOffset=0}}export{a as TriangleMaterial,f as TriangleMaterialParameters};
2
+ import{Material as t,MaterialParameters as e}from"../lib/Material.js";import{intersectTriangleGeometryPolygon2D as n}from"../lib/PolygonIntersections2D.js";import{intersectTriangleGeometry as r,intersectTriangleGeometry2D as o}from"../lib/RayIntersections.js";import{intersectTriangleGeometryScreenPolygon as s,DrapedHit as i}from"../lib/screenPolygonTriangleIntersections.js";import{intersectWithPolygonOffset as a,applyPolygonOffsetToHit as l}from"./intersectWithPolygonOffset.js";class f extends t{updateConfiguration(t){super.updateConfiguration(t),this._configuration.transparent=this.transparent,this._configuration.enableOITOffset=t.enableOITOffset,this._configuration.polygonOffset=this.parameters.polygonOffset}intersectRay(t,e,n,o,s,i){return i=a(i,this._configuration,o,s),r(t,n,o,s,null,i)}intersectRayDraped(t,e,n,r){return o(n[0],n[1],t,r)}intersectScreenPolygon(t,e,n,r){return l(s(t,n,e,r,null),this._configuration,n.camera.eye)}intersectScreenPolygonDraped(t,e,r,o){const s=n(o,e,t);return null===s?null:new i(s)}}class c extends e{constructor(){super(...arguments),this.polygonOffset=0}}export{f as TriangleMaterial,c as TriangleMaterialParameters};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{Milliseconds as p}from"../../../../core/time.js";import{property as m,subclass as u}from"../../../../core/accessorSupport/decorators.js";import{isMoon as f,isMars as g}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as w}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as _}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as v}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as x}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as y}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as j}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as b}from"../effects/clouds/CloudsComposition.js";import{Fog as R}from"../effects/fog/Fog.js";import{ObjectAndLayerID as A}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as C}from"../effects/geometry/olidUtils.js";import{RenderOccluded as S}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as T}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as M}from"../effects/glow/Glow.js";import{Haze as O}from"../effects/haze/Haze.js";import{Highlight as U}from"../effects/highlight/Highlight.js";import{ShadowHighlight as q}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as D}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as L}from"../effects/magnifier/Magnifier.js";import{SMAA as F}from"../effects/smaa/SMAA.js";import{SSAO as k}from"../effects/ssao/SSAO.js";import{Stars as W}from"../effects/stars/Stars.js";import{GLMaterialRepository as B}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as E}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as H}from"../lib/Renderer.js";import{RenderingContext as I}from"../lib/RenderingContext.js";import{RenderingContextOptions as G}from"../lib/RenderingContextOptions.js";import{TextureRepository as P}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as z}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as N}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as V}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as X}from"./contextCache.js";import{removeLoadedShaderModules as Q}from"./renderUtils.js";import{ScreenshotManager as J,ScreenshotContext as K}from"./ScreenshotManager.js";import{contextCache as Y}from"./testUtils.js";import{noBudget as Z}from"../../../support/Scheduler.js";import{checkWebGLError as $}from"../../../webgl/checkWebGLError.js";const ee=has("disable-feature:async-navigation-3d-depth-readback");let te=class extends t{constructor(e,t){super(e),this.olidRenderHelper=C()?new E:null,this.waterTextures=new V,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this.fog=null,this.globalIllumination=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=N(this._rctx,r),this.markerTextures=z(this._rctx,r),this.techniques=new v(new _(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new P(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new B(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new H(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new J(this._rctx,s,e=>t.view.overlayManager.updateOverlays(Z,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new W({view:e}),f(e.spatialReference)||(this.glow=new M({view:e}),2===t?new y({view:e}):g(e.spatialReference)?new j({view:e}):(new x({view:e}),new b({view:e}),new O({view:e}),this.fog=new R({view:e}))),has("enable-feature:global-illumination")?this.globalIllumination=new T({view:e}):new k({view:e}),new F({view:e,isEnabled:()=>this.renderer.hasSMAA}),new L({view:e}),new U({view:e}),new D({view:e}),new q({view:e,viewingMode:t}),new S({view:e}),C()&&new A({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=ee?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){Q(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=p(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new K(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");$(n,!0),this._rctx=re(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new w(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=p(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}};function re(e,t){const r=new G(t);if(Y.enabled){let t=ie.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new I(e,r),ie.set(e,t),t.ref(),t)}return new I(e,r)}e([m({type:Boolean,readOnly:!0})],te.prototype,"updating",null),e([m({constructOnly:!0})],te.prototype,"view",void 0),e([m({readOnly:!0})],te.prototype,"componentObjectCollection",null),e([m()],te.prototype,"_componentObjectCollection",void 0),e([m()],te.prototype,"_needsUpdate",void 0),e([m()],te.prototype,"_needsWaterReflectionUpdate",void 0),te=e([u("esri.views.3d.webgl-engine.parts.RenderView")],te);const ie=X();export{te as RenderView};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import{toConst as r}from"../../../../core/compilerUtils.js";import{unpackFloatRGBA as i}from"../../../../core/floatRGBA.js";import has from"../../../../core/has.js";import s from"../../../../core/Logger.js";import{removeMaybe as n,destroyMaybe as o}from"../../../../core/maybe.js";import{when as a,initial as h,watch as l,syncAndInitial as d}from"../../../../core/reactiveUtils.js";import{addFrameTask as c}from"../../../../core/scheduling.js";import{signal as p}from"../../../../core/signal.js";import{Milliseconds as m}from"../../../../core/time.js";import{property as u,subclass as f}from"../../../../core/accessorSupport/decorators.js";import{isMoon as g,isMars as w}from"../../../../geometry/ellipsoidUtils.js";import{ComponentObjectCollection as _}from"../collections/Component/ComponentObjectCollection.js";import{ShaderTechniqueConstructionContext as v}from"../core/shaderTechnique/ShaderTechniqueConstructionContext.js";import{ShaderTechniqueRepository as x}from"../core/shaderTechnique/ShaderTechniqueRepository.js";import{ChapmanAtmosphere as y}from"../effects/atmosphere/ChapmanAtmosphere.js";import{LocalAtmosphere as j}from"../effects/atmosphere/LocalAtmosphere.js";import{MarsAtmosphere as b}from"../effects/atmosphere/MarsAtmosphere.js";import{CloudsComposition as R}from"../effects/clouds/CloudsComposition.js";import{Fog as A}from"../effects/fog/Fog.js";import{ObjectAndLayerID as C}from"../effects/geometry/ObjectAndLayerID.js";import{olidEnabled as S}from"../effects/geometry/olidUtils.js";import{RenderOccluded as T}from"../effects/geometry/RenderOccluded.js";import{GlobalIllumination as M}from"../effects/globalIllumination/GlobalIllumination.js";import{Glow as O}from"../effects/glow/Glow.js";import{Haze as U}from"../effects/haze/Haze.js";import{Highlight as q}from"../effects/highlight/Highlight.js";import{ShadowHighlight as D}from"../effects/highlight/ShadowHighlight.js";import{ShadowHighlightBuffer as L}from"../effects/highlight/ShadowHighlightBuffer.js";import{Magnifier as F}from"../effects/magnifier/Magnifier.js";import{SMAA as k}from"../effects/smaa/SMAA.js";import{SSAO as W}from"../effects/ssao/SSAO.js";import{Stars as B}from"../effects/stars/Stars.js";import{GLMaterialRepository as E}from"../lib/GLMaterialRepository.js";import{ObjectAndLayerIdRenderHelper as H}from"../lib/ObjectAndLayerIdRenderHelper.js";import{Renderer as I}from"../lib/Renderer.js";import{RenderingContext as G}from"../lib/RenderingContext.js";import{RenderingContextOptions as P}from"../lib/RenderingContextOptions.js";import{TextureRepository as z}from"../lib/TextureRepository.js";import{createMarkerTextureRepository as N}from"../materials/markerTextureRepository.js";import{createStippleTextureRepository as V}from"../materials/stippleTextureRepository.js";import{WaterTextureRepository as X}from"../materials/internal/WaterTextureRepository.js";import{getContextCache as Q}from"./contextCache.js";import{removeLoadedShaderModules as J}from"./renderUtils.js";import{ScreenshotManager as K,ScreenshotContext as Y}from"./ScreenshotManager.js";import{contextCache as Z}from"./testUtils.js";import{noBudget as $}from"../../../support/Scheduler.js";import{checkWebGLError as ee}from"../../../webgl/checkWebGLError.js";const te=has("disable-feature:async-navigation-3d-depth-readback");let re=class extends t{constructor(e,t){super(e),this.olidRenderHelper=S()?new H:null,this.waterTextures=new X,this._needsUpdate=!0,this._needsRender=!0,this._idleSuspend=!0,this._needsWaterReflectionUpdate=!1,this._lastAnimationUpdate=0,this.glow=null,this._fog=p(null),this.globalIllumination=null,this.test=null,this._initializeContext(t);const{memoryController:r}=t.view.resourceController;this.stippleTextures=V(this._rctx,r),this.markerTextures=N(this._rctx,r),this.techniques=new x(new v(this._rctx,this.stippleTextures,this.waterTextures,this.markerTextures)),this.textures=new z(t),this.addHandles(this.textures.events.on("changed",e=>this.requestRender(e)));const i=new E(this.textures,this.techniques,()=>this.requestRender(),()=>this.requestRender());this.renderer=new I(t,i,this.techniques,this._rctx,e=>this.requestRender(e)),this.addHandles([a(()=>t.view.ready,()=>this._createRenderNodes(),h),l(()=>this.waterTextures.updating,()=>this.requestRender(),h),l(()=>t.view.qualityProfile,e=>this.renderer?.updateRenderFeatures(e),d)]);const s={renderScene:(e,t,r,i)=>(this.renderer.setTime(t),this.renderer.render(e,r,i)),requestRenderScene:e=>this.requestRender(e),prepareOverlay:()=>t.options.screenshot.prepareOverlay(),renderOverlay:(e,r,i)=>t.options.screenshot.renderOverlay(e,r,i)};this._screenshotManager=new K(this._rctx,s,e=>t.view.overlayManager.updateOverlays($,e.camera,0)),this._registerFrameTask(t)}destroy(){const e=this.stage?.container;e?.contains(this._canvas)&&e.removeChild(this._canvas),this._frameTask=n(this._frameTask),this.techniques.destroy(),this._componentObjectCollection=o(this._componentObjectCollection),this._screenshotManager.destroy(),this.renderer.destroy(),this.textures.destroy(),this.waterTextures.destroy(),this.markerTextures.destroy(),this.stippleTextures.destroy(),this._canvas=null,this._rctx=o(this._rctx),this.test?.destroy()}_createRenderNodes(){const{view:e,viewingMode:t}=this.stage;new B({view:e}),g(e.spatialReference)||(this.glow=new O({view:e}),2===t?new j({view:e}):w(e.spatialReference)?new b({view:e}):(new y({view:e}),new R({view:e}),new U({view:e}),this._fog.value=new A({view:e}))),has("enable-feature:global-illumination")?this.globalIllumination=new M({view:e}):new W({view:e}),new k({view:e,isEnabled:()=>this.renderer.hasSMAA}),new F({view:e}),new q({view:e}),new L({view:e}),new D({view:e,viewingMode:t}),new T({view:e}),S()&&new C({view:e})}requestRender(e=1){switch(e){case 2:this.view.state.fading=!0;case 1:this._needsUpdate=!0,this.globalIllumination?.resetAccumulatedFrames();case 0:this._needsRender=!0}}get updating(){return this._needsUpdate||this._needsWaterReflectionUpdate||this.renderer.updating||this.textures.updating||this.waterTextures.updating}setIdleSuspend(e){this._idleSuspend!==e&&(this._idleSuspend=e,this.requestRender())}get renderingContext(){return this._rctx}get capabilities(){return this._rctx.capabilities}get canvas(){return this._canvas}takeScreenshot(e){return this._screenshotManager.takeScreenshot(r(e))}getAlpha(){return!!this._rctx.contextAttributes.alpha}getMinimalDepthForArea(e,t,r,i,s,n=s){let o=te?this._readMainDepthSynchronously(t,r,i,s,n):this.renderer.navigationDepthCache.getMinimalDepthForArea(t,r,i,s,n)??Number.MAX_VALUE;if(e){const s=e.pickDepth(t*i.pixelRatio,r*i.pixelRatio,i);null!=s&&o>s&&s!==i.nearFar[0]&&s!==i.nearFar[1]&&(o=s)}return o===Number.MAX_VALUE?void 0:o}_readMainDepthSynchronously(e,t,r,i,s){const n=r.constrainWindowSize(e,t,i*r.pixelRatio,s*r.pixelRatio),o=this._ensureLinearDepthArrayBuffer(n);this.renderer.readMainDepth(n,o);let a=Number.MAX_VALUE;for(let h=0;h<n[2]*n[3];h++){const e=this._linearDepthFromTexture(4*h,o,r.nearFar);a>e&&e!==r.nearFar[0]&&e!==r.nearFar[1]&&(a=e)}return a}_linearDepthFromTexture(e,t,r){return i(t,e)*(r[1]-r[0])+r[0]}_ensureLinearDepthArrayBuffer(e){const t=4*e[2]*e[3];return(null==this._tmpDepthBuffer||this._tmpDepthBuffer.byteLength<t)&&(this._tmpDepthBuffer=new Uint8Array(t)),this._tmpDepthBuffer}async reloadShaders(){J(),await this.techniques.reloadAll(),this.renderer.overlay?.reloadShaders(),this.requestRender()}_registerFrameTask(e){const t=e.view.state;let r=!1,i=0,s=!1;const n={preRender:({time:s})=>{r=this.updating,i=this._needsUpdate?1:0,this._needsRender&&this.renderer.updateSceneDepthRange(t.camera),e.commitSyncLayers(),s=this.test?.time??s;const n=m(s-this._lastAnimationUpdate);this.view.state.animationsEnabled&&(n>this.renderer.animationTimestep||r||this._needsRender)&&(this.renderer.updateAnimation(t,s)&&this.requestRender(0),this._lastAnimationUpdate=s)},render:({time:e})=>{if(e=this.test?.time??e,this.renderer.setTime(e),(this._needsRender||!this._idleSuspend||!this.renderer.isCameraFinal||this._needsWaterReflectionUpdate)&&t.camera.fullWidth>0&&t.camera.fullHeight>0){const e=this._needsUpdate&&this._idleSuspend&&this.renderer.isCameraFinal;this._needsRender=!1,this._needsUpdate=!1,this._needsWaterReflectionUpdate=!1,this.renderer.render(t,0),s=!0,e&&this.renderer.hasReflections&&(this.requestRender(0),this._needsWaterReflectionUpdate=!0)}},update:({time:e})=>{this.view.state.animationsEnabled&&this.textures.update();const r=new Y(t,this.renderer.fboCache);e=this.test?.time??e,this._screenshotManager.update(r,e)},finish:()=>{s&&(this.renderer.finish(2===t.mode?i:1),s=!1)}};this._frameTask=c(n)}_initializeContext(e){const{options:t}=e,r=t.canvas??document.createElement("canvas");r.setAttribute("style","width: 100%; height:100%; display:block;"),this._canvas=r;const i={alpha:t.alpha||!1,premultipliedAlpha:!0,antialias:!1,depth:!0,stencil:t.stencil??!0,powerPreference:"high-performance",preserveDrawingBuffer:t.preserveDrawingBuffer??!1},n=r.getContext("webgl2",i);if(null==n)return void s.getLogger(this).error("A WebGL2 context could not be created.");ee(n,!0),this._rctx=ie(n,e),this._loadShaderOnlyExtensions(),!t.alpha&&this._rctx.contextAttributes.alpha&&s.getLogger(this).error("WebGL context has alpha channel even though no alpha channel was requested");const{container:o}=e;!this._rctx.contextAttributes.alpha&&has("safari")>=11&&(o.style.backgroundColor="black"),o.contains(r)||o.appendChild(r)}_loadShaderOnlyExtensions(){this._rctx.capabilities.enable("textureFloatLinear")}get _viewingMode(){return this.stage.viewingMode}get stage(){return this.view.stage}getObjectAndLayerIdColor(e){return this.olidRenderHelper?.getObjectAndLayerIdColor(e)}get componentObjectCollection(){return this._componentObjectCollection??=new _(this.renderer.renderPassManager,this._viewingMode,this.view.spatialReference.isWebMercator),this._componentObjectCollection}updateQualitySettings(e){null!=this.test?.time&&null!=e.fadeDuration&&(this.test.savedFadeDuration=e.fadeDuration,e.fadeDuration=m(0)),this._rctx.updateOptions({maxPreferredTexturePixels:this.view.qualitySettings.maxTexturePixels})}get fog(){return r(this._fog.value)}};function ie(e,t){const r=new P(t);if(Z.enabled){let t=se.get(e);return 1===t?.refCount?(t.configure(r),t.ref(),t):(t=new G(e,r),se.set(e,t),t.ref(),t)}return new G(e,r)}e([u({type:Boolean,readOnly:!0})],re.prototype,"updating",null),e([u({constructOnly:!0})],re.prototype,"view",void 0),e([u({readOnly:!0})],re.prototype,"componentObjectCollection",null),e([u()],re.prototype,"_componentObjectCollection",void 0),e([u()],re.prototype,"_needsUpdate",void 0),e([u()],re.prototype,"_needsWaterReflectionUpdate",void 0),re=e([f("esri.views.3d.webgl-engine.parts.RenderView")],re);const se=Q();export{re as RenderView};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/ShaderBuilder.js";export{b as build}from"../../../../chunks/CutFillMinMaxDepth.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as i}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as s}from"../core/shaderTechnique/ShaderTechnique.js";import{C as t}from"../../../../chunks/CutFillMinMaxDepth.glsl.js";import{makePipelineState as o,defaultColorWrite as l}from"../../../webgl/renderState.js";let a=class extends s{constructor(){super(...arguments),this.shader=new i(t,()=>import("./CutFillMinMaxDepth.glsl.js"))}initializePipeline(){return o({colorWrite:l})}};a=e([r("esri.views.3d.webgl-engine.shaders.CutFillMinMaxDepthTechnique")],a);export{a as CutFillMinMaxDepthTechnique};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillDepthParameters,b as build}from"../../../../chunks/CutFillDepth.glsl.js";
2
+ import"../core/shaderLibrary/ScreenSpacePass.glsl.js";import"../core/shaderLibrary/output/ReadDepth.glsl.js";import"../core/shaderModules/Texture2DPassUniform.js";import"../../../webgl/NoParameters.js";import"../../../webgl/ShaderBuilder.js";export{C as CutFillDepthParameters,b as build}from"../../../../chunks/CutFillTotalDepth.glsl.js";
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import{__decorate as e}from"tslib";import{subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ReloadableShader as t}from"../core/shaderTechnique/ReloadableShader.js";import{ShaderTechnique as o}from"../core/shaderTechnique/ShaderTechnique.js";import{a as s}from"../../../../chunks/CutFillTotalDepth.glsl.js";import{makePipelineState as i,defaultColorWrite as l}from"../../../webgl/renderState.js";let a=class extends o{constructor(){super(...arguments),this.shader=new t(s,()=>import("./CutFillTotalDepth.glsl.js"))}initializePipeline(){return i({colorWrite:l})}};a=e([r("esri.views.3d.webgl-engine.shaders.CutFillTotalDepthTechnique")],a);export{a as CutFillTotalDepthTechnique};
@@ -1,5 +1,5 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isColor as o,isOITColorAlpha as i,isOITFrontFace as l}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as s}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as a}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{emissionFilter as e}from"../core/shaderLibrary/util/emissionFilter.glsl.js";import{If as n,glsl as t}from"../core/shaderModules/glsl.js";import{alphaCutoff as f}from"./alphaCutoff.glsl.js";import{ditherNoise as m}from"./ditherNoise.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function d(d,g){d.include(s,g),d.include(r,g);const{fragment:p,outputs:c}=d;p.include(a);const{output:C,hasEmission:h,oitPremultipliedAlpha:b,snowCover:E,emissionDimmingPass:v,renderOccluded:y}=g,j=11===C,O=i(C),$=l(C),A=o(C)&&!O,L=0!==C||y;let S=0;(A||O)&&c.add("fragColor","vec4",S++),O&&c.add("fragAlpha","float",S++),h&&c.add("fragEmission","vec4",S++),p.include(a),p.include(f),p.include(u,g),p.include(m,g),v&&p.include(e,g),p.code.add(t`
2
+ import{isColor as o,isOITColorAlpha as i,isOITFrontFace as l}from"../core/shaderLibrary/ShaderOutput.js";import{Emissions as r}from"../core/shaderLibrary/output/Emissions.glsl.js";import{OutputHighlight as s}from"../core/shaderLibrary/output/OutputHighlight.glsl.js";import{ColorConversion as a}from"../core/shaderLibrary/util/ColorConversion.glsl.js";import{emissionFilter as e}from"../core/shaderLibrary/util/emissionFilter.glsl.js";import{If as n,glsl as t}from"../core/shaderModules/glsl.js";import{alphaCutoff as f}from"./alphaCutoff.glsl.js";import{ditherNoise as m}from"./ditherNoise.glsl.js";import{oitResolution as u}from"./oitResolution.glsl.js";function d(d,g){d.include(s,g),d.include(r,g);const{fragment:p,outputs:c}=d;p.include(a);const{output:C,hasEmission:h,oitPremultipliedAlpha:b,snowCover:E,emissionDimmingPass:v,renderOccluded:y}=g,j=11===C,O=i(C),$=l(C),A=o(C)&&!O,L=0!==C||y;let S=0;(A||O)&&c.add("fragColor","vec4",S++),O&&c.add("fragAlpha","float",S++),h&&c.add("fragEmission","vec4",S++),p.include(a),p.include(f),p.include(u,g),p.include(m,g),v&&p.include(e),p.code.add(t`
3
3
  void outputColorHighlightOLID(vec4 finalColor, vec3 emissiveSymbolColor ${n(E,", float snow")}) {
4
4
  ${n(j,"finalColor.a = 1.0;")}
5
5
  ${n(L,"if (finalColor.a < alphaCutoff) discard;")}
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import has from"../../core/has.js";import{destroyMaybe as e}from"../../core/maybe.js";import{GamepadSource as t}from"./gamepad/GamepadSource.js";import{createScreenPointFromNativeEvent as n}from"../support/screenUtils.js";const i=has("edge"),o=has("chrome"),a=has("ff"),s=has("safari"),r="esri-view-surface",h={touchNone:`${r}--touch-none`,touchPan:`${r}--touch-pan`};class c{static{this.test={disableSubpixelCoordinates:!1}}constructor(e,n){this._active={},this._callback=()=>{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._forwardWindowModifierKeyPresses=e=>{document.activeElement!==this._element&&e.isTrusted&&"b"===e.key&&this._forwardKeyboardEvent(e)},this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),window.addEventListener("keydown",this._forwardWindowModifierKeyPresses),window.addEventListener("keyup",this._forwardWindowModifierKeyPresses),this._gamepadSource=new t(e,n),this._gamepadSource.onEvent=e=>this._callback("gamepad",e)}destroy(){this._callback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>this._releasePointerCaptureSafe(e)),this._activePointerCaptures.clear(),this._gamepadSource=e(this._gamepadSource),this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault),window.removeEventListener("keydown",this._forwardWindowModifierKeyPresses),window.removeEventListener("keyup",this._forwardWindowModifierKeyPresses)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set activeEvents(e){for(const t in this._active)if(!e||!e.has(t)){const e=this._active[t];this._element.removeEventListener(l[t],e),delete this._active[t]}e&&e.forEach(e=>{if(!this._active[e]&&l[e]){const t=(this._eventHandlers[e]||this._handleDefault).bind(this,e);this._element.addEventListener(l[e],t),this._active[e]=t}}),this._gamepadSource&&(this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1)}setPointerCapture(e,t){t?this._setPointerCaptureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?h.touchNone:h.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?h.touchPan:h.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(h.touchNone),this._element.classList.remove(h.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCaptureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch(t){}}_updateNormalizedPointerLikeEvent(e,t){const i=n(this._element,e);return c.test.disableSubpixelCoordinates&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),t.x=i.x,t.y=i.y,t}_handleKey(e,t){const{key:n}=t;n&&"key-up"===e&&this._keyDownState.delete(n);const i={native:t,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&"key-down"===e&&this._keyDownState.add(i.key),this._callback(e,i)}_handlePointer(e,t){const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,t){const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault(),this._callback(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&has("mac")&&0===e.deltaY?e.deltaX:e.deltaY}_handleMouseWheel(e,t){let n=this._getDeltaFromTrackpadOrMouseWheel(t);switch(t.deltaMode){case 0:i&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}i?n*=.7:o||s?n*=.6:a&&(n*=1.375);const r=100,h=Math.abs(n);if(h>r){n=n/h*200/(1+Math.exp(-.02*(h-r)))}const c=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:n});this._callback(e,c)}_handlePointerCaptureLost(e,t){this._activePointerCaptures.delete(t.pointerId),this._handleDefault(e,t)}_handleDefault(e,t){const n={native:t};t.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){"Alt"===e.key&&e.preventDefault()}_forwardKeyboardEvent(e){const t=new KeyboardEvent(e.type,{key:e.key,code:e.code,location:e.location,ctrlKey:e.ctrlKey,shiftKey:e.shiftKey,altKey:e.altKey,metaKey:e.metaKey,repeat:e.repeat,bubbles:!0,cancelable:!0,composed:!0});this._element.dispatchEvent(t)}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}}const l={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","touch-start":"touchstart","touch-end":"touchend","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};export{c as BrowserEventSource};
2
+ import has from"../../core/has.js";import{destroyMaybe as e}from"../../core/maybe.js";import{GamepadSource as t}from"./gamepad/GamepadSource.js";import{createScreenPointFromNativeEvent as n}from"../support/screenUtils.js";const i=has("edge"),o=has("chrome"),a=has("ff"),s=has("safari"),r="esri-view-surface",h={touchNone:`${r}--touch-none`,touchPan:`${r}--touch-pan`};class l{static{this.test={disableSubpixelCoordinates:!1}}constructor(e,n){this._active={},this._callback=()=>{},this._keyModifierCallback=()=>{},this._activePointerCaptures=new Set,this._keyDownState=new Set,this._eventId=1,this._browserTouchPanningEnabled=!1,this._forwardWindowModifierKeyPresses=e=>{if(document.activeElement===this._element)return;const t="keydown"===e.type?"key-down":"key-up";this._active[t]&&"b"===e.key&&this._keyModifierCallback(t,{native:e,key:e.key,repeat:e.repeat})},this._element=e,e.getAttribute("tabindex")||e.setAttribute("tabindex","0"),this._eventHandlers={"key-down":this._handleKey,"key-up":this._handleKey,"pointer-down":this._handlePointer,"pointer-move":this._handlePointerPreventDefault,"pointer-up":this._handlePointerPreventDefault,"pointer-enter":this._handlePointer,"pointer-leave":this._handlePointer,"pointer-cancel":this._handlePointer,"mouse-wheel":this._handleMouseWheel,"pointer-capture-lost":this._handlePointerCaptureLost},this._updateTouchAction(),this._element.addEventListener("keydown",this._preventAltKeyDefault),window.addEventListener("keydown",this._forwardWindowModifierKeyPresses),window.addEventListener("keyup",this._forwardWindowModifierKeyPresses),this._gamepadSource=new t(e,n),this._gamepadSource.onEvent=e=>this._callback("gamepad",e)}destroy(){this._callback=()=>{},this._keyModifierCallback=()=>{},this.activeEvents=null,this._activePointerCaptures.forEach(e=>this._releasePointerCaptureSafe(e)),this._activePointerCaptures.clear(),this._gamepadSource=e(this._gamepadSource),this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault),window.removeEventListener("keydown",this._forwardWindowModifierKeyPresses),window.removeEventListener("keyup",this._forwardWindowModifierKeyPresses)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(e){this._browserTouchPanningEnabled=e,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(e){this._callback=e}set onKeyModifierReceived(e){this._keyModifierCallback=e}set activeEvents(e){for(const t in this._active)if(!e||!e.has(t)){const e=this._active[t];this._element.removeEventListener(c[t],e),delete this._active[t]}e&&e.forEach(e=>{if(!this._active[e]&&c[e]){const t=(this._eventHandlers[e]||this._handleDefault).bind(this,e);this._element.addEventListener(c[e],t),this._active[e]=t}}),this._gamepadSource&&(this._gamepadSource.hasEventListeners=e?.has("gamepad")??!1)}setPointerCapture(e,t){t?this._setPointerCaptureSafe(e.pointerId):(this._releasePointerCaptureSafe(e.pointerId),this._activePointerCaptures.delete(e.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?h.touchNone:h.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?h.touchPan:h.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(h.touchNone),this._element.classList.remove(h.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_setPointerCaptureSafe(e){try{this._element.setPointerCapture(e),this._activePointerCaptures.add(e)}catch{}}_releasePointerCaptureSafe(e){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(e))return;this._element.releasePointerCapture(e)}catch(t){}}_updateNormalizedPointerLikeEvent(e,t){const i=n(this._element,e);return l.test.disableSubpixelCoordinates&&(i.x=Math.round(i.x),i.y=Math.round(i.y)),t.x=i.x,t.y=i.y,t}_handleKey(e,t){const{key:n}=t;n&&"key-up"===e&&this._keyDownState.delete(n);const i={native:t,key:n,repeat:!!n&&this._keyDownState.has(n)};n&&"key-down"===e&&this._keyDownState.add(i.key),this._callback(e,i)}_handlePointer(e,t){const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});this._callback(e,n)}_handlePointerPreventDefault(e,t){const n=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,pointerType:t.pointerType,button:t.button,buttons:t.buttons,eventId:this._eventId++});t.preventDefault(),this._callback(e,n)}_getDeltaFromTrackpadOrMouseWheel(e){return e.shiftKey&&has("mac")&&0===e.deltaY?e.deltaX:e.deltaY}_handleMouseWheel(e,t){let n=this._getDeltaFromTrackpadOrMouseWheel(t);switch(t.deltaMode){case 0:i&&(n=n/document.documentElement.clientHeight*600);break;case 1:n*=30;break;case 2:n*=900}i?n*=.7:o||s?n*=.6:a&&(n*=1.375);const r=100,h=Math.abs(n);if(h>r){n=n/h*200/(1+Math.exp(-.02*(h-r)))}const l=this._updateNormalizedPointerLikeEvent(t,{native:t,x:0,y:0,deltaY:n});this._callback(e,l)}_handlePointerCaptureLost(e,t){this._activePointerCaptures.delete(t.pointerId),this._handleDefault(e,t)}_handleDefault(e,t){const n={native:t};t.preventDefault(),this._callback(e,n)}_preventAltKeyDefault(e){"Alt"===e.key&&e.preventDefault()}_preventMultiTouchPanning(e){e.touches.length>1&&e.preventDefault()}}const c={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","touch-start":"touchstart","touch-end":"touchend","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};export{l as BrowserEventSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import i from"../../core/Logger.js";import n from"../../core/Queue.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import{primaryKey as a,isSystemModifier as l}from"./keys.js";import{LatestPen as h}from"./handlers/LatestPen.js";import{LatestPointer as p}from"./handlers/LatestPointer.js";import{MultiTouch as d}from"./handlers/MultiTouch.js";import{PropertiesPool as u}from"../support/PropertiesPool.js";class c{constructor(){this.id=0,this.type="mouse",this.location=r()}}class _{constructor(){this.tiltX=0,this.tiltY=0}}let f=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=a,this._propertiesPool=new u({latestPointerInfo:()=>new c,latestPenInfo:()=>new _},this),this._latestPointerInfo=void 0,this._latestPenInfo=void 0,this._paused=!1,this._testTimestamp=void 0}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get latestPointerInfo(){return this._latestPointerInfo}get latestPenInfo(){return this._latestPenInfo}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,i=P.INTERNAL){if(this._nameToGroup[e])return;if(0===t.length)return;const n={name:e,handlers:t.map(e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=n;for(let r=n.handlers.length-1;r>=0;r--){const e=n.handlers[r];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,i,n,r,s)=>{this._emitInputEvent(e.priorityIndex+1,t,i,n,s,r)},setPointerCapture:(t,i)=>{this._setPointerCapture(n,e,t,i)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(e=>{e.removed=!0,e.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):i.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const e=this._handlers[i];e.priorityIndex=i,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let r=n.handler.hasSideEffects;if(!r)for(const t of n.handler.outgoingEventTypes)if(e.has(t)){r=!0;break}if(r)for(const i of n.handler.incomingEventMatches){e.add(i.eventType);for(const e of i.keyModifiers)l(e)||t.add(e)}n.active=r}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i,n){const r=this._latestPointerInfo;if(null==r||r.id!==e||r.type!==t||r.location.x!==i||r.location.y!==n){const r=this._propertiesPool.get("latestPointerInfo");r.id=e,r.type=t,r.location.x=i,r.location.y=n,this._latestPointerInfo=r}}_setLatestPen(e,t){const i=this._latestPenInfo,n=null!=i&&0===e&&0===t,r=n?i?.tiltX:e,s=n?i?.tiltY:t;if(null!=r&&null!=s){if(null==i||i.tiltX!==r||i.tiltY!==s){const e=this._propertiesPool.get("latestPenInfo");e.tiltX=r,e.tiltY=s,this._latestPenInfo=e}}else null!=i&&(this._latestPenInfo=void 0)}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const i=this._testTimestamp??t.native?.timestamp,n=t.native?.cancelable;this._emitInputEventFromSource(e,t,i,n)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},r=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(n(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(n(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const i=t.key;this._keyModifiers.has(i)&&r(i,"key-down"===e)}const s=t.native;r("Alt",!!s?.altKey),r("Control",!!s?.ctrlKey),r("Ctrl",!!s?.ctrlKey),r("Shift",!!s?.shiftKey),r("Meta",!!s?.metaKey),r("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new p((e,t,i,n)=>this._setLatestPointer(e,t,i,n)),this._latestPenHandler=new h((e,t)=>this._setLatestPen(e,t)),this._multiTouchHandler=new d,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._latestPenHandler,this._multiTouchHandler],P.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,P.INTERNAL)}_setPointerCapture(e,t,i,n){const r=e.name+"-"+t.priorityIndex,s=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,s),n?(s.add(r),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):s.has(r)&&(s.delete(r),0===s.size&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,i,n){this._emitInputEvent(0,e,t,i,n)}_emitInputEvent(e,t,i,n,r,s){const o=n??this._currentPropagation?.timestamp??performance.now(),a=r??!1,l={event:new g(t,i,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new n,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:i}=e.events.pop(),n=t.data?.eventId;if(!(null!=n&&this._stoppedPropagationEventIds.has(n)))for(e.currentHandler=this._handlersPriority[i];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=n&&this._stoppedPropagationEventIds.add(n);break}if(t.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new n;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(i.eventType!==e.eventType)continue;const t=i.keyModifiers.filter(t=>e.keyModifiers.includes(t));if(t.length===i.keyModifiers.length!==(t.length===e.keyModifiers.length))return i.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(i,t[e])>=0;)e++;t.splice(e,0,i)}return t}get test(){}};e([s({readOnly:!0})],f.prototype,"hasPendingInputs",null),e([s({constructOnly:!0})],f.prototype,"eventSource",void 0),e([s({constructOnly:!0})],f.prototype,"recognizers",void 0),e([s()],f.prototype,"multiTouchActive",null),e([s()],f.prototype,"_latestPointerInfo",void 0),e([s()],f.prototype,"latestPointerInfo",null),e([s()],f.prototype,"_latestPenInfo",void 0),e([s()],f.prototype,"latestPenInfo",null),e([s()],f.prototype,"_paused",void 0),e([s({readOnly:!0})],f.prototype,"updating",null),f=e([o("esri.views.input.InputManager")],f);class g{constructor(e,t,i,n,r){this.type=e,this.data=t,this.timestamp=i,this.modifiers=n,this.cancelable=r,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return!!(1&this._propagationState)}defer(e){this._propagationState|=2;const t=(e,t)=>{this._propagationState&=-3;const i=this._resumeCallback;if(this._resumeCallback=null,i&&i(),t)throw e;return e};return("function"==typeof e?e():e).then(e=>t(e,!1),e=>t(e,!0))}shouldPausePropagation(e){return!!(2&this._propagationState)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}const P={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};export{f as InputManager,_ as LatestPenInfo,c as LatestPointerInfo,P as ViewEventPriorities};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import"../../core/has.js";import i from"../../core/Logger.js";import n from"../../core/Queue.js";import{createScreenPoint as r}from"../../core/screenUtils.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import{primaryKey as a,isSystemModifier as l}from"./keys.js";import{LatestPen as h}from"./handlers/LatestPen.js";import{LatestPointer as p}from"./handlers/LatestPointer.js";import{MultiTouch as d}from"./handlers/MultiTouch.js";import{PropertiesPool as u}from"../support/PropertiesPool.js";class c{constructor(){this.id=0,this.type="mouse",this.location=r()}}class _{constructor(){this.tiltX=0,this.tiltY=0}}let f=class extends t{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=a,this._propertiesPool=new u({latestPointerInfo:()=>new c,latestPenInfo:()=>new _},this),this._latestPointerInfo=void 0,this._latestPenInfo=void 0,this._paused=!1,this._testTimestamp=void 0}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this.eventSource.onKeyModifierReceived=this._updateKeyModifiers.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}get latestPointerInfo(){return this._latestPointerInfo}get latestPenInfo(){return this._latestPenInfo}get updating(){return this.hasPendingInputs||this._paused}installHandlers(e,t,i=y.INTERNAL){if(this._nameToGroup[e])return;if(0===t.length)return;const n={name:e,handlers:t.map(e=>({handler:e,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=n;for(let r=n.handlers.length-1;r>=0;r--){const e=n.handlers[r];this._handlers.push(e),e.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(t,i,n,r,s)=>{this._emitInputEvent(e.priorityIndex+1,t,i,n,s,r)},setPointerCapture:(t,i)=>{this._setPointerCapture(n,e,t,i)},setEventCallback:t=>{e.eventCallback=t},setUninstallCallback:t=>{e.uninstallCallback=t},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(e=>{e.removed=!0,e.uninstallCallback?.()}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):i.getLogger(this).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return void 0!==this._nameToGroup[e]}isModifierKeyDown(e){return this._activeKeyModifiers.has(e)}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const e=this._handlers[i];e.priorityIndex=i,this._handlersPriority.push(e)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const n=this._handlersPriority[i];n.priorityIndex=i;let r=n.handler.hasSideEffects;if(!r)for(const t of n.handler.outgoingEventTypes)if(e.has(t)){r=!0;break}if(r)for(const i of n.handler.incomingEventMatches){e.add(i.eventType);for(const e of i.keyModifiers)l(e)||t.add(e)}n.active=r}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i,n){const r=this._latestPointerInfo;if(null==r||r.id!==e||r.type!==t||r.location.x!==i||r.location.y!==n){const r=this._propertiesPool.get("latestPointerInfo");r.id=e,r.type=t,r.location.x=i,r.location.y=n,this._latestPointerInfo=r}}_setLatestPen(e,t){const i=this._latestPenInfo,n=null!=i&&0===e&&0===t,r=n?i?.tiltX:e,s=n?i?.tiltY:t;if(null!=r&&null!=s){if(null==i||i.tiltX!==r||i.tiltY!==s){const e=this._propertiesPool.get("latestPenInfo");e.tiltX=r,e.tiltY=s,this._latestPenInfo=e}}else null!=i&&(this._latestPenInfo=void 0)}_onEventReceived(e,t){if("pointer-capture-lost"===e){const e=t;this._pointerCaptures.delete(e.native.pointerId)}this._updateKeyModifiers(e,t);const i=this._testTimestamp??t.native?.timestamp,n=t.native?.cancelable;this._emitInputEventFromSource(e,t,i,n)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const n=()=>{i||(this._activeKeyModifiers=new Set(this._activeKeyModifiers),i=!0)},r=(e,t)=>{t&&!this._activeKeyModifiers.has(e)?(n(),this._activeKeyModifiers.add(e)):!t&&this._activeKeyModifiers.has(e)&&(n(),this._activeKeyModifiers.delete(e))};if("key-down"===e||"key-up"===e){const i=t.key;this._keyModifiers.has(i)&&r(i,"key-down"===e)}const s=t.native;r("Alt",!!s?.altKey),r("Control",!!s?.ctrlKey),r("Ctrl",!!s?.ctrlKey),r("Shift",!!s?.shiftKey),r("Meta",!!s?.metaKey),r("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new p((e,t,i,n)=>this._setLatestPointer(e,t,i,n)),this._latestPenHandler=new h((e,t)=>this._setLatestPen(e,t)),this._multiTouchHandler=new d,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._latestPenHandler,this._multiTouchHandler],y.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,y.INTERNAL)}_setPointerCapture(e,t,i,n){const r=e.name+"-"+t.priorityIndex,s=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,s),n?(s.add(r),1===s.size&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):s.has(r)&&(s.delete(r),0===s.size&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,i,n){this._emitInputEvent(0,e,t,i,n)}_emitInputEvent(e,t,i,n,r,s){const o=n??this._currentPropagation?.timestamp??performance.now(),a=r??!1,l={event:new g(t,i,o,s||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new n,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){this._paused=!1;const e=this._currentPropagation;if(e){for(;e.events.length>0;){const{event:t,priorityIndex:i}=e.events.pop(),n=t.data?.eventId;if(!(null!=n&&this._stoppedPropagationEventIds.has(n)))for(e.currentHandler=this._handlersPriority[i];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!t.shouldStopPropagation()&&e.currentHandler.eventCallback?.(t),t.shouldStopPropagation()){null!=n&&this._stoppedPropagationEventIds.add(n);break}if(t.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:t,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}}_pausePropagation(e){const t=new n;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null,this._paused=!0}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const e of t.handler.incomingEventMatches){if(i.eventType!==e.eventType)continue;const t=i.keyModifiers.filter(t=>e.keyModifiers.includes(t));if(t.length===i.keyModifiers.length!==(t.length===e.keyModifiers.length))return i.keyModifiers.length>e.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let e=0;for(;e<t.length&&this._compareHandlerPriority(i,t[e])>=0;)e++;t.splice(e,0,i)}return t}get test(){}};e([s({readOnly:!0})],f.prototype,"hasPendingInputs",null),e([s({constructOnly:!0})],f.prototype,"eventSource",void 0),e([s({constructOnly:!0})],f.prototype,"recognizers",void 0),e([s()],f.prototype,"multiTouchActive",null),e([s()],f.prototype,"_latestPointerInfo",void 0),e([s()],f.prototype,"latestPointerInfo",null),e([s()],f.prototype,"_latestPenInfo",void 0),e([s()],f.prototype,"latestPenInfo",null),e([s()],f.prototype,"_paused",void 0),e([s({readOnly:!0})],f.prototype,"updating",null),f=e([o("esri.views.input.InputManager")],f);class g{constructor(e,t,i,n,r){this.type=e,this.data=t,this.timestamp=i,this.modifiers=n,this.cancelable=r,this._propagationState=0,this._resumeCallback=null}stopPropagation(){this._propagationState|=1}shouldStopPropagation(){return!!(1&this._propagationState)}defer(e){this._propagationState|=2;const t=(e,t)=>{this._propagationState&=-3;const i=this._resumeCallback;if(this._resumeCallback=null,i&&i(),t)throw e;return e};return("function"==typeof e?e():e).then(e=>t(e,!1),e=>t(e,!0))}shouldPausePropagation(e){return!!(2&this._propagationState)&&(this._resumeCallback=e,!0)}preventDefault(){this.data.native.preventDefault()}}const y={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};export{f as InputManager,_ as LatestPenInfo,c as LatestPointerInfo,y as ViewEventPriorities};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as r}from"../../../core/SetUtils.js";import{sqlAnd as n}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{squaredDistance as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as l}from"../../input/InputManager.js";import{snappingKeys as c}from"../keybindings.js";import{fromAnyMapPoint as p}from"../sketch/normalizedPoint.js";import{isWebMap as m}from"../../../webmap/utils.js";export{screenDistance,squaredScreenDistance}from"../../../core/screenUtils.js";const g=Symbol("grid-placement-graphic");function d(e,t){const r=e.length===t.length&&e[0]===t[0]&&e[1]===t[1];switch(e.length){case 2:return r;case 3:return r&&e[2]===t[2];case 4:return r&&e[2]===t[2]&&e[3]===t[3]}return!1}function u(e,t){t.sort((t,r)=>i(t.targetPoint,e)-i(r.targetPoint,e))}function f({parameters:{point:e,distance:t,returnEdge:r,vertexMode:i,coordinateHelper:{spatialReference:l},filter:c},returnZ:p,filter:m}){const g=m?.clone()??new a({where:"1=1"});return g.returnZ=p,c&&(g.geometry=c.geometry,g.distance=c.distance,g.spatialRelationship=c.spatialRelationship,g.where=n(g.where,c.where),g.timeExtent=o(g.timeExtent,c.timeExtent),g.objectIds=h(g.objectIds,c.objectIds)),{point:s(e[0],e[1],e[2],l.toJSON()),distance:t,returnEdge:r,vertexMode:i,query:g.toJSON()}}function h(e,t){return e||t?t?e?Array.from(r(new Set(e),new Set(t))):t:e:null}function y(e,t,r){return{left:p(e.leftVertex.pos,t,r),right:p(e.rightVertex.pos,t,r)}}const j=Symbol("snapping-toggle");function w(r,n=()=>{}){const o=e(()=>({view:r.view,snappingOptions:r.snappingOptions}),({view:e,snappingOptions:t})=>{if(r.removeHandles(j),!e||!t)return;const o=l.TOOL,i=[e.on("key-down",e=>{e.key!==c.toggle||e.repeat||(t.enabledToggled=!0,n())},o),e.on("key-up",e=>{e.key===c.toggle&&(t.enabledToggled=!1,n())},o),e.on("pointer-move",e=>{const r=e.native.ctrlKey;t.enabledToggled!==r&&(t.enabledToggled=r,n())},o)];r.addHandles(i,j)},t);r.addHandles(o)}function b(e){return m(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}function v(e){return"line"===e?.type}export{y as editEdgeToSnappingEdge,g as gridPlacementGraphicSymbol,v as isLine,b as isUtilityNetworkWebMap,f as makeSnappingQuery,d as objectEqual,w as setupSnappingToggleHandles,u as sortCandidatesInPlace};
2
+ import{watch as e,syncAndInitial as t}from"../../../core/reactiveUtils.js";import{intersection as r}from"../../../core/SetUtils.js";import{sqlAnd as n}from"../../../core/sql.js";import{mergeTimeExtents as o}from"../../../core/timeUtils.js";import{squaredDistance as i}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{makeDehydratedPoint as s}from"../../../layers/graphics/dehydratedPoint.js";import a from"../../../rest/support/Query.js";import{ViewEventPriorities as p}from"../../input/InputManager.js";import{snappingKeys as l}from"../keybindings.js";import{fromAnyMapPoint as c}from"../sketch/normalizedPoint.js";import{isWebMap as m}from"../../../webmap/utils.js";export{screenDistance,squaredScreenDistance}from"../../../core/screenUtils.js";const d=Symbol("grid-placement-graphic");function g(e,t){t.sort((t,r)=>i(t.targetPoint,e)-i(r.targetPoint,e))}function u({parameters:{point:e,distance:t,returnEdge:r,vertexMode:i,coordinateHelper:{spatialReference:p},filter:l},returnZ:c,filter:m}){const d=m?.clone()??new a({where:"1=1"});return d.returnZ=c,l&&(d.geometry=l.geometry,d.distance=l.distance,d.spatialRelationship=l.spatialRelationship,d.where=n(d.where,l.where),d.timeExtent=o(d.timeExtent,l.timeExtent),d.objectIds=f(d.objectIds,l.objectIds)),{point:s(e[0],e[1],e[2],p.toJSON()),distance:t,returnEdge:r,vertexMode:i,query:d.toJSON()}}function f(e,t){return e||t?t?e?Array.from(r(new Set(e),new Set(t))):t:e:null}function y(e,t,r){return{left:c(e.leftVertex.pos,t,r),right:c(e.rightVertex.pos,t,r)}}const j=Symbol("snapping-toggle");function h(r,n=()=>{}){const o=e(()=>({view:r.view,snappingOptions:r.snappingOptions}),({view:e,snappingOptions:t})=>{if(r.removeHandles(j),!e||!t)return;const o=p.TOOL,i=[e.on("key-down",e=>{e.key!==l.toggle||e.repeat||(t.enabledToggled=!0,n())},o),e.on("key-up",e=>{e.key===l.toggle&&(t.enabledToggled=!1,n())},o),e.on("pointer-move",e=>{const r=e.native.ctrlKey;t.enabledToggled!==r&&(t.enabledToggled=r,n())},o)];r.addHandles(i,j)},t);r.addHandles(o)}function w(e){return m(e)&&"utilityNetworks"in e&&!!e.utilityNetworks?.length}function b(e){return"line"===e?.type}export{y as editEdgeToSnappingEdge,d as gridPlacementGraphicSymbol,b as isLine,w as isUtilityNetworkWebMap,u as makeSnappingQuery,h as setupSnappingToggleHandles,g as sortCandidatesInPlace};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{createLength as n}from"../../core/quantity.js";import{lengthUnitFromSpatialReference as t,verticalLengthUnitFromSpatialReference as e}from"../../core/units.js";import{distance as r,set as l}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as i}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../geometry/projection/projectVectorToVector.js";import{equals as u}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as c}from"./measurementUtils.js";function s(n){return a(n)}function a(e,r){const{hasZ:l,spatialReference:i}=e,o=c(i);let u=0;const s=t(o);if(null==s)return null;const a=R;for(const n of e.paths){if(n.length<2)continue;const t=n.length-1;for(let e=0;e<t;++e){const t=n[e];d[0]=t[0],d[1]=t[1],d[2]=l?t[2]:0;const r=n[e+1];b[0]=r[0],b[1]=r[1],b[2]=l?r[2]:0;const o=a(d,b,i);if(null==o)return null;u+=o.value}}return n(u,s)}function f(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,y(d,b,e)):null}function p(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,R(d,b,e)):null}function h(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,g(d,b,e)):null}function m(n,t){const{spatialReference:e}=n;return u(e,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,b[0]=t.x,b[1]=t.y,b[2]=t.hasZ?t.z:0,j(d,b,e)):null}function z(n){return null!=n?x(n.hasZ?n.z:0,n.spatialReference):null}function x(t,r){const l=e(r);return null!=l?n(t??0,l):null}function y(t,e,r){const l=v(t,e,r);return null!=l?{direct:n(l.direct,l.unit),horizontal:n(l.horizontal,l.unit),vertical:n(l.vertical,l.unit)}:null}function R(t,e,r){const l=v(t,e,r,0);return null!=l?n(l.direct,l.unit):null}function Z(t,e,r){const l=v(t,e,r,1);return null!=l?n(l.horizontal,l.unit):null}function g(t,e,r){const l=v(t,e,r,2);return null!=l?n(Math.abs(l.verticalSigned),l.unit):null}function j(t,e,r){const l=v(t,e,r,2);return null!=l?n(l.verticalSigned,l.unit):null}function v(n,e,i,u){const s=c(i),a=t(s);if(null==a)return null;const f=e[2]-n[2];if(2===u)return{verticalSigned:f,unit:a};if(!o(n,i,S,s)||!o(e,i,M,s))return null;if(0===u){return{direct:r(M,S),unit:a}}if(l(U,n[0],n[1],e[2]),!o(U,i,U,s))return null;const p=r(U,M);if(1===u)return{horizontal:p,unit:a};return{direct:r(M,S),horizontal:p,vertical:Math.abs(f),unit:a}}const d=i(),b=i(),S=i(),M=i(),U=i();export{z as elevationFromPoint,x as elevationFromZ,R as euclideanDirectDistance,p as euclideanDirectDistanceBetweenPoints,y as euclideanDistance,f as euclideanDistanceBetweenPoints,Z as euclideanHorizontalDistance,s as euclideanLength,g as verticalDistance,h as verticalDistanceBetweenPoints,j as verticalSignedDistance,m as verticalSignedDistanceBetweenPoints};
2
+ import{createLength as n}from"../../core/quantity.js";import{lengthUnitFromSpatialReference as t,verticalLengthUnitFromSpatialReference as r}from"../../core/units.js";import{distance as e,set as i}from"../../core/libs/gl-matrix-2/math/vec3.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as u}from"../../geometry/projection/projectVectorToVector.js";import{equals as o}from"../../geometry/support/spatialReferenceUtils.js";import{computeEuclideanMeasurementSR as c}from"./measurementUtils.js";function a(n,t){const{spatialReference:r}=n;return o(r,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,v[0]=t.x,v[1]=t.y,v[2]=t.hasZ?t.z:0,z(d,v,r)):null}function s(n,t){const{spatialReference:r}=n;return o(r,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,v[0]=t.x,v[1]=t.y,v[2]=t.hasZ?t.z:0,x(d,v,r)):null}function f(n,t){const{spatialReference:r}=n;return o(r,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,v[0]=t.x,v[1]=t.y,v[2]=t.hasZ?t.z:0,R(d,v,r)):null}function p(n,t){const{spatialReference:r}=n;return o(r,t.spatialReference)?(d[0]=n.x,d[1]=n.y,d[2]=n.hasZ?n.z:0,v[0]=t.x,v[1]=t.y,v[2]=t.hasZ?t.z:0,j(d,v,r)):null}function m(n){return null!=n?h(n.hasZ?n.z:0,n.spatialReference):null}function h(t,e){const i=r(e);return null!=i?n(t??0,i):null}function z(t,r,e){const i=Z(t,r,e);return null!=i?{direct:n(i.direct,i.unit),horizontal:n(i.horizontal,i.unit),vertical:n(i.vertical,i.unit)}:null}function x(t,r,e){const i=Z(t,r,e,0);return null!=i?n(i.direct,i.unit):null}function y(t,r,e){const i=Z(t,r,e,1);return null!=i?n(i.horizontal,i.unit):null}function R(t,r,e){const i=Z(t,r,e,2);return null!=i?n(Math.abs(i.verticalSigned),i.unit):null}function j(t,r,e){const i=Z(t,r,e,2);return null!=i?n(i.verticalSigned,i.unit):null}function Z(n,r,l,o){const a=c(l),s=t(a);if(null==s)return null;const f=r[2]-n[2];if(2===o)return{verticalSigned:f,unit:s};if(!u(n,l,g,a)||!u(r,l,b,a))return null;if(0===o){return{direct:e(b,g),unit:s}}if(i(S,n[0],n[1],r[2]),!u(S,l,S,a))return null;const p=e(S,b);if(1===o)return{horizontal:p,unit:s};return{direct:e(b,g),horizontal:p,vertical:Math.abs(f),unit:s}}const d=l(),v=l(),g=l(),b=l(),S=l();export{m as elevationFromPoint,h as elevationFromZ,x as euclideanDirectDistance,s as euclideanDirectDistanceBetweenPoints,z as euclideanDistance,a as euclideanDistanceBetweenPoints,y as euclideanHorizontalDistance,R as verticalDistance,f as verticalDistanceBetweenPoints,j as verticalSignedDistance,p as verticalSignedDistanceBetweenPoints};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{DataType as t}from"./enums.js";import{fromLayout as e}from"./VertexAttributeLocations.js";import{VertexElementDescriptor as o}from"./VertexElementDescriptor.js";const r=[new o("position",2,t.UNSIGNED_SHORT,0,4)],s=[new o("a_pos",2,t.BYTE,0,4),new o("a_tex",2,t.BYTE,2,4)],i=e(r);export{r as Pos2us,i as Pos2usLocations,s as PosTex2b};
2
+ import{DataType as t}from"./enums.js";import{fromLayout as o}from"./VertexAttributeLocations.js";import{VertexElementDescriptor as r}from"./VertexElementDescriptor.js";const e=[new r("position",2,t.UNSIGNED_SHORT,0,4)],i=o(e);export{e as Pos2us,i as Pos2usLocations};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{substitute as e}from"../../intl.js";import{equalsShallow as t}from"../../core/lang.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{isSubtypeSublayer as o,getSubtypesFromLayer as r}from"../../layers/support/layerUtils.js";import a from"../../rest/support/AttachmentQuery.js";import{unknown as s,utc as l}from"../../time/constants.js";import{ReactiveGraphic as u}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as c,isGroupInput as d}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as p}from"../support/dateUtils.js";import{isEmptyValue as m,getRangeErrorMessage as f,shouldUseScientificNotation as y,scientificNumberFormatOptions as h,numberFormatOptions as v}from"../support/forms/formUtils.js";const b=(e,t)=>null!=e&&e.input?.type===t;function g(e){return new u({source:e})}function j(t,i,n,o){const{dataType:r,minLength:a}=t,s=n?.validationErrors;if(!s||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return s.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return s.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,a={type:"date",intlOptions:{timeZone:"date"===i.type&&o?o:void 0,...p(i)}},l=f(n,s);return e(l,n,{format:{max:"date"===r?a:null!=n.max&&y(n.max)?h:v,min:"date"===r?a:null!=n.min&&y(n.min)?h:v}})}return"domain-validation-error::invalid-coded-value"===i?s.invalidCodedValue:"type-validation-error::invalid-type"===i?s.invalidType:"length-validation-error::too-short"===i?e(s.tooShort,{min:a}):"multiple-choice-validation-error::too-few-selected-choices"===i&&c(t)?e(s.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===i&&c(t)?e(s.tooManySelectedChoices,{max:t.input.maximumChoices}):"length-validation-error::too-long"===i?null:"contingent-values-validation-error::contingency-violation-warning"===i||"contingent-values-validation-error::contingency-violation-error"===i?s.valuesIncompatible:null}function w(e,t,i){const n=i?.validationErrors;if(!n)return null;let o=null;for(const r of e.invalidHiddenInputs)switch(r.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":o=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:r.effectiveVisibilityCode}return o}function x(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function I(e){return!!x(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function k(e){return I(e)&&"queryAttachments"in e}function C(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function T(e){if(!k(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!!t?.data?.supportsAttachment}async function V(e,t,r,s){const l=new Set;let u=!1;for(const i of r){if("attachment"===i.input?.type&&("any"===i.input.attachmentAssociationType||"exactOrNone"===i.input.attachmentAssociationType)){u=!0;break}if(m(i.attachmentKeyword)){u=!0;break}l.add(i.attachmentKeyword)}const c=l.size&&!u?Array.from(l):void 0,d=new a({objectIds:[t],returnMetadata:!0,keywords:c}),p=o(e)?e.parent:e;n(p)&&p.historicMoment&&(d.historicMoment=p.historicMoment);const f=await e.queryAttachments(d,{signal:s});return i(s),f[t]??[]}function F(e,t,i,n){const o=e.get(t)?.get(i)??[];if(!n?.length)return o;const r=new Set(n.map(e=>e.toLowerCase()));return o.filter(e=>r.has(e.keywords.toLowerCase()))}function A(e,i,n){const o=r(e),a=o?.find(e=>e.code===n);if(!a)return!1;const s=o?.find(e=>e.code===i);return!t(a.defaultValues,s?.defaultValues)&&Object.values(a.defaultValues).some(e=>null!=e)}function U(e){return e.reduce((e,t)=>d(t)?[...e,...t.inputs]:[...e,t],[])}function E(e){return o(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?s:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function M(e,t){return e||t?t===s?l:e&&e!==s?e:t??"system":"system"}export{g as createReactiveGraphic,U as flattenInputs,F as getAttachmentsForKeywords,M as getEffectiveTimeZone,w as getHiddenFieldsValidationErrorMessage,E as getLayerTimeZone,j as getVisibleFieldInputValidationErrorMessage,C as isAssociationsLayerUnion,I as isAttributeFormSupportedLayer,x as isAttributeFormSupportedLayerUnion,k as isAttributeFormSupportedLayerWithAttachments,b as isElementTemplateWithInputType,T as layerSupportsAttachments,V as queryAttachmentsForElements,A as subtypeChangeShouldPrompt};
2
+ import{substitute as e}from"../../intl.js";import{equalsShallow as t}from"../../core/lang.js";import{throwIfAborted as i}from"../../core/promiseUtils.js";import{isLayerWithHistoricMoment as n}from"../../layers/mixins/EditBusLayer.js";import{isSubtypeSublayer as o,getSubtypesFromLayer as r}from"../../layers/support/layerUtils.js";import a from"../../rest/support/AttachmentQuery.js";import{unknown as s,utc as l}from"../../time/constants.js";import{ReactiveGraphic as u}from"./ReactiveGraphic.js";import{isMultipleChoiceFieldInput as c,isGroupInput as d}from"./inputs/support/inputUtils.js";import{getIntlOptionsForField as p}from"../support/dateUtils.js";import{isEmptyValue as m,getRangeErrorMessage as f,shouldUseScientificNotation as y,scientificNumberFormatOptions as v,numberFormatOptions as h}from"../support/forms/formUtils.js";const b=(e,t)=>null!=e&&e.input?.type===t;function g(e){return new u({source:e})}function j(t,i,n,o){const{dataType:r,minLength:a}=t,s=n?.validationErrors;if(!s||!i)return null;if("batch-attribute-form-validation::features-have-different-errors"===i)return s.invalidBatchFormType;if("input-validation-error::cannot-be-empty"===i)return s.cannotBeNull;if("domain-validation-error::value-out-of-range"===i||"numeric-range-validation-error::out-of-range"===i){const{field:i,range:n}=t,a={type:"date",intlOptions:{timeZone:"date"===i.type&&o?o:void 0,...p(i)}},l=f(n,s);return e(l,n,{format:{max:"date"===r?a:null!=n.max&&y(n.max)?v:h,min:"date"===r?a:null!=n.min&&y(n.min)?v:h}})}return"domain-validation-error::invalid-coded-value"===i?s.invalidCodedValue:"type-validation-error::invalid-type"===i?s.invalidType:"length-validation-error::too-short"===i?e(s.tooShort,{min:a}):"multiple-choice-validation-error::too-few-selected-choices"===i&&c(t)?e(s.tooFewSelectedChoices,{min:t.input.minimumChoices}):"multiple-choice-validation-error::too-many-selected-choices"===i&&c(t)?e(s.tooManySelectedChoices,{max:t.input.maximumChoices}):"length-validation-error::too-long"===i?null:"contingent-values-validation-error::contingency-violation-warning"===i||"contingent-values-validation-error::contingency-violation-error"===i?s.valuesIncompatible:null}function w(e,t,i){const n=i?.validationErrors;if(!n)return null;let o=null;for(const r of e.invalidHiddenInputs)switch(r.effectiveVisibilityCode){case"hidden:visibility-expression:all-features":case"hidden:group-visibility-expression:all-features":case"hidden:field-definition":return"single"===t?n.nonVisibleError_changeValues:n.nonVisibleError_checkIndividualFeatures;case"hidden:no-domain-in-common":case"hidden:visibility-expression:some-features":case"hidden:group-visibility-expression:some-features":case"hidden:not-in-all-layers":o=n.nonVisibleError_checkIndividualFeatures;break;case"visible":continue;default:r.effectiveVisibilityCode}return o}function x(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"geojson"===e.type||"knowledge-graph-sublayer"===e.type||"oriented-imagery"===e.type||"scene"===e.type||"subtype-sublayer"===e.type)}function I(e){return!!x(e)||!!(null!=e&&"object"==typeof e&&"type"in e&&e.type&&"id"in e&&e.id&&"fields"in e&&e.fields&&"fieldsIndex"in e&&e.fieldsIndex&&"objectIdField"in e&&e.objectIdField&&"capabilities"in e&&"getField"in e&&e.getField)}function T(e){return I(e)&&"queryAttachments"in e}function V(e){return null!=e&&"object"==typeof e&&"type"in e&&("feature"===e.type||"subtype-sublayer"===e.type)}function k(e){if(!T(e))return!1;const t=e?.effectiveCapabilities??e?.capabilities;return!!t?.data?.supportsAttachment}async function C(e,t,r,s){const l=new Set;let u=!1;for(const i of r){if("attachment"===i.input?.type&&("any"===i.input.attachmentAssociationType||"exactOrNone"===i.input.attachmentAssociationType)){u=!0;break}if(m(i.attachmentKeyword)){u=!0;break}l.add(i.attachmentKeyword)}const c=l.size&&!u?Array.from(l):void 0,d=new a({objectIds:[t],returnMetadata:!0,keywords:c}),p=o(e)?e.parent:e;n(p)&&p.historicMoment&&(d.historicMoment=p.historicMoment);const f=await e.queryAttachments(d,{signal:s});return i(s),f[t]??[]}function F(e,i,n){const o=r(e),a=o?.find(e=>e.code===n);if(!a)return!1;const s=o?.find(e=>e.code===i);return!t(a.defaultValues,s?.defaultValues)&&Object.values(a.defaultValues).some(e=>null!=e)}function A(e){return e.reduce((e,t)=>d(t)?[...e,...t.inputs]:[...e,t],[])}function U(e){return o(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?s:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:null}function E(e,t){return e||t?t===s?l:e&&e!==s?e:t??"system":"system"}export{g as createReactiveGraphic,A as flattenInputs,E as getEffectiveTimeZone,w as getHiddenFieldsValidationErrorMessage,U as getLayerTimeZone,j as getVisibleFieldInputValidationErrorMessage,V as isAssociationsLayerUnion,I as isAttributeFormSupportedLayer,x as isAttributeFormSupportedLayerUnion,T as isAttributeFormSupportedLayerWithAttachments,b as isElementTemplateWithInputType,k as layerSupportsAttachments,C as queryAttachmentsForElements,F as subtypeChangeShouldPrompt};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{differentValuesString as e}from"./inputUtils.js";import{isEmptyValue as t}from"../../../support/forms/formUtils.js";const n="esri_BatchAttributeForm_other_choice_checked",i=new WeakMap;function r(e,t){if(null==e||""===e)return[];const n=String(e);if(!t){const e=n.trim();return""===e?[]:[e]}return n.split(t).map(e=>e.trim()).filter(e=>""!==e)}function c({input:t,choiceValue:n,currentValue:i,isChecked:c}){const{multipleChoiceInput:o,multipleChoiceValues:u}=t;if(!o||!u)return i;const{choiceDelimiter:l}=o,s=new Set(u),a=r(i,l).filter(t=>t!==e&&s.has(t)),f=a.includes(n);if(!c){const e=f?a.filter(e=>e!==n):a;return e.length>0?e.join(l):null}return f||!s.has(n)?a.length>0?a.join(l):null:[...a,n].join(l)}function o({input:e,choiceValue:t}){const n=e.multipleChoiceInput?.choiceDelimiter,i=e.multipleChoiceValues;if(null==n||!i)return{checked:!1,indeterminate:!1};const c=e.features.length;if(!c)return{checked:!1,indeterminate:!1};let o=0;for(const u of e.features){r(u.getAttribute(e.fieldName),n).includes(t)&&(o+=1)}return o===c?{checked:!0,indeterminate:!1}:0===o?{checked:!1,indeterminate:!1}:{checked:!1,indeterminate:!0}}function u({input:e}){const t=e.multipleChoiceInput?.choiceDelimiter,n=e.multipleChoiceValues;if(null==t||!n)return{checked:!1,indeterminate:!1};if(0===n.length)return{checked:!1,indeterminate:!1};let i=!0,r=!1;for(const c of n){const t=o({input:e,choiceValue:c});(t.checked||t.indeterminate)&&(r=!0),t.checked||(i=!1)}return{checked:i,indeterminate:!i&&r}}function l({input:e,otherChoiceFieldName:n}){const i=e.features.length;if(!i)return{checked:!1,indeterminate:!1};const r=e.features.toArray().filter(e=>!t(e.getAttribute(n))).length;return 0===r?{checked:!1,indeterminate:!1}:r===i?{checked:!0,indeterminate:!1}:{checked:!1,indeterminate:!0}}function s(t){return!(null==t||""===t||t===n||t===e)}function a(e,t={}){const{includeDraftValues:n=!1}=t;if(!e)return;const r=new Set;for(const i of e.sharedForm.allFieldInputs)r.add(i.expressionsManager);for(const i of e.activeForm.allFieldInputs)r.add(i.expressionsManager);for(const c of r)i.get(c)?.clear();if(n){const t=new Set;for(const n of e.sharedForm.allFieldInputs)for(const e of n.features)t.add(e);for(const e of t)e.clearStashedAttributes()}}export{s as canRestoreMultipleChoiceOtherChoiceDraftValue,a as clearMultipleChoiceOtherChoiceStateForViewModel,o as getMultipleChoiceCheckboxState,l as getMultipleChoiceOtherChoiceState,u as getMultipleChoiceSelectAllState,c as getUpdatedMultipleChoiceValueForFeature,i as multipleChoiceOtherChoiceCheckedStateByExpressionsManager,n as otherChoiceCheckedPlaceholderValue,r as splitMultipleChoiceValue};
2
+ import{differentValuesString as e}from"./inputUtils.js";const t="esri_BatchAttributeForm_other_choice_checked",n=new WeakMap;function i(e,t){if(null==e||""===e)return[];const n=String(e);if(!t){const e=n.trim();return""===e?[]:[e]}return n.split(t).map(e=>e.trim()).filter(e=>""!==e)}function r({input:t,choiceValue:n,currentValue:r,isChecked:c}){const{multipleChoiceInput:o,multipleChoiceValues:l}=t;if(!o||!l)return r;const{choiceDelimiter:u}=o,s=new Set(l),a=i(r,u).filter(t=>t!==e&&s.has(t)),f=a.includes(n);if(!c){const e=f?a.filter(e=>e!==n):a;return e.length>0?e.join(u):null}return f||!s.has(n)?a.length>0?a.join(u):null:[...a,n].join(u)}function c({input:e,choiceValue:t}){const n=e.multipleChoiceInput?.choiceDelimiter,r=e.multipleChoiceValues;if(null==n||!r)return{checked:!1,indeterminate:!1};const c=e.features.length;if(!c)return{checked:!1,indeterminate:!1};let o=0;for(const l of e.features){i(l.getAttribute(e.fieldName),n).includes(t)&&(o+=1)}return o===c?{checked:!0,indeterminate:!1}:0===o?{checked:!1,indeterminate:!1}:{checked:!1,indeterminate:!0}}function o({input:e}){const t=e.multipleChoiceInput?.choiceDelimiter,n=e.multipleChoiceValues;if(null==t||!n)return{checked:!1,indeterminate:!1};if(0===n.length)return{checked:!1,indeterminate:!1};let i=!0,r=!1;for(const o of n){const t=c({input:e,choiceValue:o});(t.checked||t.indeterminate)&&(r=!0),t.checked||(i=!1)}return{checked:i,indeterminate:!i&&r}}function l(n){return!(null==n||""===n||n===t||n===e)}function u(e,t={}){const{includeDraftValues:i=!1}=t;if(!e)return;const r=new Set;for(const n of e.sharedForm.allFieldInputs)r.add(n.expressionsManager);for(const n of e.activeForm.allFieldInputs)r.add(n.expressionsManager);for(const c of r)n.get(c)?.clear();if(i){const t=new Set;for(const n of e.sharedForm.allFieldInputs)for(const e of n.features)t.add(e);for(const e of t)e.clearStashedAttributes()}}export{l as canRestoreMultipleChoiceOtherChoiceDraftValue,u as clearMultipleChoiceOtherChoiceStateForViewModel,c as getMultipleChoiceCheckboxState,o as getMultipleChoiceSelectAllState,r as getUpdatedMultipleChoiceValueForFeature,n as multipleChoiceOtherChoiceCheckedStateByExpressionsManager,t as otherChoiceCheckedPlaceholderValue,i as splitMultipleChoiceValue};