@arcgis/core 6.0.0-next.37 → 6.0.0-next.38

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 (248) hide show
  1. package/analysis/DimensionAnalysis.js +1 -1
  2. package/analysis/DimensionSimpleStyle.js +1 -1
  3. package/analysis/LengthDimension.js +1 -1
  4. package/analysis/LineOfSightAnalysis.js +1 -1
  5. package/analysis/LineOfSightAnalysisTarget.js +1 -1
  6. package/analysis/Viewshed.js +1 -1
  7. package/analysis/ViewshedAnalysis.js +1 -1
  8. package/assets/esri/core/workers/RemoteClient.js +1 -1
  9. package/assets/esri/core/workers/chunks/{9503eedfdda55fc5adab.js → 091ec4fe83038f3558f4.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{322b22a5d54e404bebd5.js → 0c893837f67829757df7.js} +1 -1
  11. package/assets/esri/core/workers/chunks/123541f79be7adff0818.js +1 -0
  12. package/assets/esri/core/workers/chunks/{155861fbd0e5fc2db80c.js → 1a91443970d64a59521d.js} +1 -1
  13. package/assets/esri/core/workers/chunks/1e37337f47f45d6d8005.js +1 -0
  14. package/assets/esri/core/workers/chunks/{4e5405134d079bdf9b7a.js → 1f76f6dcdae9f55389cb.js} +1 -1
  15. package/assets/esri/core/workers/chunks/2d16b5a44f840147e882.js +1 -0
  16. package/assets/esri/core/workers/chunks/396299c22994c502e41c.js +1 -0
  17. package/assets/esri/core/workers/chunks/{03daf6f235c6edef6268.js → 398ec098fffe6abceedd.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +1 -0
  19. package/assets/esri/core/workers/chunks/3b5e9e0b180dc10491ec.js +1 -0
  20. package/assets/esri/core/workers/chunks/46edd6c9ed6701e6b975.js +1 -0
  21. package/assets/esri/core/workers/chunks/{8b0d5551978ab0aac0d1.js → 520f499d79fa71f262c7.js} +1 -1
  22. package/assets/esri/core/workers/chunks/5473409fee59db80f87d.js +1 -0
  23. package/assets/esri/core/workers/chunks/553a8bf5bc5c56d1bcaf.js +1 -0
  24. package/assets/esri/core/workers/chunks/{2211ff0a1f1ae8100231.js → 585ae43c7bcb86a26762.js} +1 -1
  25. package/assets/esri/core/workers/chunks/58716a3a6106a1b0fb9d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{aa6ee2aa4ff6e6d41efb.js → 5882f349f3771868e67f.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{1b17f5f720f6cf3f6d73.js → 5be386b3af867b19ff39.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{ea81f9d71b0842a4be26.js → 5e48898cebb6dbaf09b5.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{139e753d95cfc9470e74.js → 6a65fc1a2931230fe994.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{3e406043a374ee17475b.js → 6f2e7e663229b223b4df.js} +1 -1
  31. package/assets/esri/core/workers/chunks/76e80381fa6d1e084796.js +1 -0
  32. package/assets/esri/core/workers/chunks/{3b380e64566a6cce59e2.js → 7e0ed6e8f7b77e43f628.js} +1 -1
  33. package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +1 -0
  34. package/assets/esri/core/workers/chunks/8e391b5b82429f39791e.js +1 -0
  35. package/assets/esri/core/workers/chunks/947f3a1cad976bba9738.js +1 -0
  36. package/assets/esri/core/workers/chunks/{59a1b637d2c107504a04.js → 966204d6dedc8149c3e9.js} +1 -1
  37. package/assets/esri/core/workers/chunks/ac107079342251a984dd.js +1 -0
  38. package/assets/esri/core/workers/chunks/{572aec57593a08b8045b.js → b15a8d4322f3b7819d2f.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{552c36b40e5a5ec117fb.js → b472c0a21ae29e653f7d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/bdd76a0b6c14e7fb6984.js +1 -0
  41. package/assets/esri/core/workers/chunks/{f372f4eb5527238c46f5.js → c31830ee897d5a7f2582.js} +1 -1
  42. package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +1 -0
  43. package/assets/esri/core/workers/chunks/{0a508e25ec05363e1f04.js → c7ad62f54d2abe1d17a0.js} +1 -1
  44. package/assets/esri/core/workers/chunks/cb1642ea8b66231cbfb5.js +1 -0
  45. package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +1 -0
  46. package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +1 -0
  47. package/assets/esri/core/workers/chunks/e2430bc3a1edeb5c3266.js +1 -0
  48. package/assets/esri/core/workers/chunks/e9457a67befc61e11095.js +1 -0
  49. package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +1 -0
  50. package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +1 -0
  51. package/assets/esri/core/workers/chunks/fd967a9f3cf0e2890dbb.js +1 -0
  52. package/chunks/h.js +2 -0
  53. package/chunks/projector.js +2 -0
  54. package/config.js +1 -1
  55. package/core/sanitizerUtils.js +1 -1
  56. package/form/FormTemplate.js +1 -1
  57. package/form/elements/Element.js +1 -1
  58. package/form/elements/FieldElement.js +1 -1
  59. package/geometry/ellipsoidUtils.js +4 -4
  60. package/geometry/support/frustumPlanes.js +1 -1
  61. package/geometry/support/plane.js +1 -1
  62. package/geometry/support/triangle.js +1 -1
  63. package/kernel.js +1 -1
  64. package/layers/GraphicsLayer.js +1 -1
  65. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  66. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  67. package/layers/geospatialPDF/support/datumUtils.js +2 -0
  68. package/layers/geospatialPDF/support/ellipsoidUtils.js +2 -0
  69. package/layers/geospatialPDF/support/geographicProjectionUtils.js +2 -0
  70. package/layers/geospatialPDF/support/parameterUtils.js +2 -0
  71. package/layers/geospatialPDF/support/projectedProjectionUtils.js +3 -0
  72. package/layers/geospatialPDF/support/projectionToSpatialReference.js +2 -0
  73. package/layers/geospatialPDF/support/statePlaneUtils.js +2 -0
  74. package/layers/geospatialPDF/support/unitUtils.js +2 -0
  75. package/layers/geospatialPDF/support/validateProjectionUtils.js +2 -0
  76. package/layers/graphics/sources/support/clientSideDefaults.js +2 -2
  77. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  78. package/layers/ogc/ogcFeatureUtils.js +1 -1
  79. package/layers/save/imageryUtils.js +1 -1
  80. package/layers/save/mediaLayerUtils.js +1 -1
  81. package/layers/save/streamLayerUtils.js +1 -1
  82. package/layers/support/ControlPoint.js +1 -1
  83. package/layers/support/ControlPointsGeoreference.js +1 -1
  84. package/layers/support/DimensionalDefinition.js +1 -1
  85. package/layers/support/LabelClass.js +1 -1
  86. package/layers/support/LabelExpressionInfo.js +1 -1
  87. package/layers/support/MediaElementBase.js +1 -1
  88. package/layers/support/MosaicRule.js +1 -1
  89. package/layers/support/MultidimensionalSubset.js +1 -1
  90. package/layers/support/RasterBandInfo.js +1 -1
  91. package/layers/support/RasterFunction.js +1 -1
  92. package/layers/support/RasterFunctionTemplate.js +1 -1
  93. package/layers/support/RasterInfo.js +1 -1
  94. package/layers/support/RasterSensorInfo.js +1 -1
  95. package/layers/support/RasterStorageInfo.js +1 -1
  96. package/layers/support/VideoElement.js +1 -1
  97. package/layers/support/layersLoader.js +1 -1
  98. package/legend/ActiveLayerInfo.d.ts +5 -1
  99. package/legend/ActiveLayerInfo.js +1 -1
  100. package/libs/maquette-advanced-projector/projector.js +1 -1
  101. package/linkChart/LayoutSettings.js +1 -1
  102. package/linkChart/RootedLayoutSettings.js +1 -1
  103. package/package.json +2 -2
  104. package/renderers/FlowRenderer.js +1 -1
  105. package/renderers/RasterColormapRenderer.js +1 -1
  106. package/renderers/RasterShadedReliefRenderer.js +1 -1
  107. package/renderers/RasterStretchRenderer.js +1 -1
  108. package/renderers/VectorFieldRenderer.js +1 -1
  109. package/renderers/support/ColormapInfo.js +1 -1
  110. package/renderers/support/RasterPresetRenderer.js +1 -1
  111. package/renderers/support/rasterRendererHelper.js +1 -1
  112. package/rest/knowledgeGraph/GraphApplyEdits.js +1 -1
  113. package/rest/support/BaseImageMeasureParameters.js +1 -1
  114. package/rest/support/BaseImageMeasureResult.js +1 -1
  115. package/rest/support/FindImagesParameters.js +1 -1
  116. package/rest/support/FindImagesResult.js +1 -1
  117. package/rest/support/ImageAngleParameters.js +1 -1
  118. package/rest/support/ImageAngleResult.js +1 -1
  119. package/rest/support/ImageAreaParameters.js +1 -1
  120. package/rest/support/ImageAreaResult.js +1 -1
  121. package/rest/support/ImageBoundaryParameters.js +1 -1
  122. package/rest/support/ImageBoundaryResult.js +1 -1
  123. package/rest/support/ImageDistanceParameters.js +1 -1
  124. package/rest/support/ImageDistanceResult.js +1 -1
  125. package/rest/support/ImageGPSInfoParameters.js +1 -1
  126. package/rest/support/ImageGPSInfoResult.js +1 -1
  127. package/rest/support/ImageHeightParameters.js +1 -1
  128. package/rest/support/ImageHeightResult.js +1 -1
  129. package/rest/support/ImageHistogramParameters.js +1 -1
  130. package/rest/support/ImageIdentifyParameters.js +1 -1
  131. package/rest/support/ImageIdentifyResult.js +1 -1
  132. package/rest/support/ImagePixelLocationParameters.js +1 -1
  133. package/rest/support/ImagePixelLocationResult.js +1 -1
  134. package/rest/support/ImagePointParameters.js +1 -1
  135. package/rest/support/ImagePointResult.js +1 -1
  136. package/rest/support/ImageSample.js +1 -1
  137. package/rest/support/ImageSampleParameters.js +1 -1
  138. package/rest/support/ImageSampleResult.js +1 -1
  139. package/rest/support/ImageToMapMultirayParameters.js +1 -1
  140. package/rest/support/ImageToMapParameters.js +1 -1
  141. package/rest/support/ImageUrlParameters.js +1 -1
  142. package/rest/support/ImageUrlResult.js +1 -1
  143. package/rest/support/ImageVolumeParameters.js +1 -1
  144. package/rest/support/ImageVolumeResult.js +1 -1
  145. package/rest/support/MapToImageParameters.js +1 -1
  146. package/rest/support/MeasureAreaFromImageResult.js +1 -1
  147. package/rest/support/MeasureFromImageParameters.js +1 -1
  148. package/rest/support/MeasureLengthFromImageResult.js +1 -1
  149. package/symbols/support/cimSymbolUtils.js +1 -1
  150. package/symbols/support/renderUtils.js +1 -1
  151. package/views/2d/ViewState.d.ts +3 -3
  152. package/views/2d/ViewState.js +1 -1
  153. package/views/2d/ViewStateManager.js +1 -1
  154. package/views/2d/engine/vectorTiles/decluttering/CollisionJob.js +1 -1
  155. package/views/2d/engine/vectorTiles/style/geoJSONVectorTileUtils.js +1 -1
  156. package/views/2d/engine/webgl/collisions/LabelMetric.js +1 -1
  157. package/views/2d/engine/webgl/collisions/LabelStore.js +1 -1
  158. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
  159. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
  160. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  161. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  162. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
  163. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/FillShader.js +1 -1
  164. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  165. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OutlineFillShader.js +1 -1
  166. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  167. package/views/2d/engine/webgl/util/IntervalMatcher.js +1 -1
  168. package/views/3d/FocusAreasView.js +1 -1
  169. package/views/3d/GroundView3D.js +1 -1
  170. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  171. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  172. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  173. package/views/3d/state/ConstraintsManager.js +1 -1
  174. package/views/3d/state/ViewState.js +1 -1
  175. package/views/3d/state/ViewStateManager.js +1 -1
  176. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  177. package/views/3d/support/gaussianSplatting/GaussianTileLifecycle.js +2 -0
  178. package/views/3d/terrain/OverlayManager.js +1 -1
  179. package/views/3d/terrain/OverlayRenderer.js +1 -1
  180. package/views/3d/terrain/TerrainRenderer.js +1 -1
  181. package/views/3d/terrain/TerrainSurface.js +1 -1
  182. package/views/3d/terrain/Tile.js +1 -1
  183. package/views/3d/terrain/tileUtils.js +1 -1
  184. package/views/3d/webgl-engine/core/shaderLibrary/shading/readShadow.glsl.js +1 -1
  185. package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
  186. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +19 -9
  187. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  188. package/views/3d/webgl-engine/lib/GeometryUtil.js +1 -1
  189. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  190. package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
  191. package/views/3d/webgl-engine/lib/screenPolygonOverlapUtils.js +1 -1
  192. package/views/3d/webgl-engine/lib/screenPolygonTriangleIntersections.js +1 -1
  193. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  194. package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
  195. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  196. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  197. package/views/3d/webgl-engine/materials/internal/lineMarkerBufferUtils.js +1 -1
  198. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  199. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  200. package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
  201. package/views/3d/webgl-engine/shaders/hudMaterialLayouts.js +2 -0
  202. package/views/3d/webgl-engine/shaders/lineMarkerLayouts.js +2 -0
  203. package/views/overlay/LineOverlayItem.js +1 -1
  204. package/views/overlay/TextOverlayItem.js +1 -1
  205. package/views/overlay/ViewOverlay.js +1 -1
  206. package/views/support/GroundElevationSampler.js +1 -1
  207. package/views/support/HighlightOptions.d.ts +2 -2
  208. package/views/support/HighlightOptions.js +1 -1
  209. package/views/webgl/Util.js +1 -1
  210. package/views/webgl/textureUtils.js +1 -1
  211. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  212. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  213. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  214. package/widgets/OrientedImageryViewer.js +1 -1
  215. package/assets/esri/core/workers/chunks/01f55004d64309f8538b.js +0 -1
  216. package/assets/esri/core/workers/chunks/0d99bfb75dcb9fa29080.js +0 -1
  217. package/assets/esri/core/workers/chunks/144bad0c2415c345736a.js +0 -1
  218. package/assets/esri/core/workers/chunks/165ca7a97b611c8f26c4.js +0 -1
  219. package/assets/esri/core/workers/chunks/1989410a618865f02dec.js +0 -1
  220. package/assets/esri/core/workers/chunks/2f9072563194026e320e.js +0 -1
  221. package/assets/esri/core/workers/chunks/338d800d4efcc91cead1.js +0 -1
  222. package/assets/esri/core/workers/chunks/3415531224f8494d79ca.js +0 -1
  223. package/assets/esri/core/workers/chunks/59a88dd53f8806bbec06.js +0 -1
  224. package/assets/esri/core/workers/chunks/5aeb5e18514644fe2cf9.js +0 -1
  225. package/assets/esri/core/workers/chunks/6edc13a426e00bb93a9b.js +0 -1
  226. package/assets/esri/core/workers/chunks/7862abd24fb5c3b12e6b.js +0 -1
  227. package/assets/esri/core/workers/chunks/8a3dfe997712dc2ddead.js +0 -1
  228. package/assets/esri/core/workers/chunks/8f82a0a6747f673a2a7e.js +0 -1
  229. package/assets/esri/core/workers/chunks/934e1f2153e6fad6ed23.js +0 -1
  230. package/assets/esri/core/workers/chunks/b25a05c58b0fd0f6ac60.js +0 -1
  231. package/assets/esri/core/workers/chunks/c7adb7b77721c75891f4.js +0 -1
  232. package/assets/esri/core/workers/chunks/cd55cad81accf51d2989.js +0 -1
  233. package/assets/esri/core/workers/chunks/ce324dde6d7daea33638.js +0 -1
  234. package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +0 -1
  235. package/assets/esri/core/workers/chunks/dac69c0047488fdf986d.js +0 -1
  236. package/assets/esri/core/workers/chunks/dba5f44c4e4a3f075df2.js +0 -1
  237. package/assets/esri/core/workers/chunks/e67ea2f1714e5abeae44.js +0 -1
  238. package/assets/esri/core/workers/chunks/eed4b90494a54f8b337b.js +0 -1
  239. package/assets/esri/core/workers/chunks/f10c883eb26330e3421c.js +0 -1
  240. package/layers/geospatialPDF/projectionToWKTUtils.js +0 -3
  241. package/libs/maquette/cache.js +0 -2
  242. package/libs/maquette/dom.js +0 -2
  243. package/libs/maquette/h.js +0 -2
  244. package/libs/maquette/index.js +0 -2
  245. package/libs/maquette/mapping.js +0 -2
  246. package/libs/maquette/projection.js +0 -2
  247. package/libs/maquette/projector.js +0 -2
  248. package/libs/maquette/utilities/window-performance-projector-logger.js +0 -2
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=0,p=0,m=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.bounds=d,this.recordStart=f,this.recordCount=p,this.additionalRecordRanges=m,this.priority=0,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}invalidateColliders(){this._colliders=null}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let l=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,u=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,d=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),f=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:this.anchorX,yTile:this.anchorY,dxPixels:e.x-e.halfWidth+d,dyPixels:e.y-e.halfHeight+f,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:l,maxLod:u})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){t!==0&&(e===this.recordStart+this.recordCount?this.recordCount+=t:this.additionalRecordRanges.push({recordStart:e,recordCount:t}))}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this.invalidateColliders())}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this.invalidateColliders())}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},x,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
2
+ import{pt2px as e}from"../../../../../core/screenUtils.js";import{labelPlacementOffsetPadding as t}from"../definitions.js";import n from"./BoundingBox.js";import{serializeList as r,deserializeList as i}from"../util/serializationUtils.js";class a{constructor(e,t,n,r,i,a,o,s,c,l,u,d=[],f=[],p=0,m=0,h=[]){this.displayId=e,this.labelClassId=t,this.labelIdHash=n,this.hash=r,this.anchorX=i,this.anchorY=a,this.directionX=o,this.directionY=s,this.maxScale=c,this.minScale=l,this.referenceBounds=u,this.alternativePositions=d,this.bounds=f,this.recordStart=p,this.recordCount=m,this.additionalRecordRanges=h,this.priority=0,this._selectedAlternate=-1,this._colliders=null,this.referenceSymbolVVOffset=[0,0],this.uniqueSymbol=null,this.labelStoreId=null,this.selectedForRendering=!1,this._calloutCollisionBounds=null}get xTile(){return this.anchorX}get yTile(){return this.anchorY}setAlternate(e){this._colliders=null,this._selectedAlternate=e,e!=null&&e>=this.alternativePositions.length&&console.error(`invalid index!`)}invalidateColliders(){this._colliders=null}colliders(n,r){if(!this._colliders||r!=null&&r!==this._collidersScale){if(!n||r==null)throw Error(`InternalError: Label collision context and view scale are required to compute colliders`);let i=n.attributeView,a=t,o=this.referenceBounds?.size??0,s=Math.round(e(o)),c=n.labelingCollisionInfos[0].vvEvaluators[0];if(this.referenceSymbolVVOffset=[0,0],c!=null){let e=c(i.getVisualVariableData(this.displayId,0),r);if(!isNaN(e)&&e!=null&&e!==1/0){o=e;let t=(o-s)/2;this.referenceSymbolVVOffset=[this.directionX*t,this.directionY*t]}}let[l,u]=this._selectedAlternate>=0?this.alternativePositions[this._selectedAlternate]:[this.anchorX,this.anchorY],d=this.minScale?n.tilingScheme.scaleToZoom(this.minScale):0,f=this.maxScale?n.tilingScheme.scaleToZoom(this.maxScale):25,p=e(this.referenceBounds?.offsetX??0)+this.directionX*(a+o/2),m=-e(this.referenceBounds?.offsetY??0)+this.directionY*(a+o/2);this._colliders=this.bounds.map(e=>({labelId:this.labelIdHash,xTile:l,yTile:u,dxPixels:e.x-e.halfWidth+p,dyPixels:e.y-e.halfHeight+m,hard:!0,partIndex:1,width:e.width+2,height:e.height+2,angle:0,xScreen:0,yScreen:0,dxScreen:0,dyScreen:0,enabled:!0,minLod:d,maxLod:f})),this._collidersScale=r}return this._colliders}get id(){return this.displayId}includeRecordRange(e,t){t!==0&&(e===this.recordStart+this.recordCount?this.recordCount+=t:this.additionalRecordRanges.push({recordStart:e,recordCount:t}))}includeCalloutCollisionBounds(e){let t=o(e);t&&(this._calloutCollisionBounds?this._calloutCollisionBounds.extend(t):(this._calloutCollisionBounds=t,this.bounds.push(t)),this.invalidateColliders())}includeCalloutPartCollisionBounds(e){let t=o(e);t&&!this.bounds.some(e=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height)&&(this.bounds.push(t),this.invalidateColliders())}serialize(e){e.push(this.displayId),e.push(this.labelClassId),e.push(this.labelIdHash),e.push(this.hash),e.push(this.recordStart),e.push(this.recordCount),e.push(this.additionalRecordRanges.length);for(let t of this.additionalRecordRanges)e.push(t.recordStart),e.push(t.recordCount);e.writeF32(this.anchorX),e.writeF32(this.anchorY),e.writeF32(this.directionX),e.writeF32(this.directionY),e.writeF32(this.maxScale),e.writeF32(this.minScale),this.referenceBounds?(e.writeF32(this.referenceBounds.size),e.writeF32(this.referenceBounds.offsetX),e.writeF32(this.referenceBounds.offsetY)):(e.writeF32(0),e.writeF32(0),e.writeF32(0)),e.push(this.alternativePositions.length);for(let[t,n]of this.alternativePositions)e.writeF32(t),e.writeF32(n);r(e,this.bounds)}static deserialize(e){let t=e.readInt32(),r=e.readInt32(),o=e.readInt32(),s=e.readInt32(),c=e.readInt32(),l=e.readInt32(),u=e.readInt32(),d=[];for(let t=0;t<u;t++)d.push({recordStart:e.readInt32(),recordCount:e.readInt32()});let f=e.readF32(),p=e.readF32(),m=e.readF32(),h=e.readF32(),g=e.readF32(),_=e.readF32(),v=e.readF32(),y=e.readF32(),b=e.readF32(),x=e.readInt32(),S=[];for(let t=0;t<x;t++)S.push([e.readF32(),e.readF32()]);let C=i(e,n)??[];return new a(t,r,o,s,f,p,m,h,g,_,{size:v,offsetX:y,offsetY:b},S,C,c,l,d)}}function o(e){let t=e.xmax-e.xmin,r=e.ymax-e.ymin;return e.xmin==null||isNaN(e.xmin)||e.ymin==null||isNaN(e.ymin)||e.xmax==null||isNaN(e.xmax)||e.ymax==null||isNaN(e.ymax)||t<=0||r<=0?null:new n(e.xmin+t/2,-(e.ymin+r/2),t,r)}export{a as LabelMetric};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import{Texture as i}from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this._writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}invalidateColliders(){for(let e of this._entries.values())e.invalidateColliders()}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}_writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
2
+ import e from"../../../../../core/Logger.js";import{labelAnchorStoreUnit as t,labelStoreUnit as n}from"../definitions.js";import{PixelType as r}from"../../../../webgl/enums.js";import{Texture as i}from"../../../../webgl/Texture.js";import{TextureDescriptor as a}from"../../../../webgl/TextureDescriptor.js";const o=()=>e.getLogger(`esri.views.2d.engine.webgl.collisions.LabelStore`);class s{constructor(){this._data=new Uint8Array(4096),this._anchors=new Float32Array(4096),this._dirtyStart=0,this._dirtyEnd=0,this._entries=new Map,this._freeIds=[],this._nextId=1,this._size=32,this._data[3]=255}get size(){return this._size}get usedMemory(){return this._data.byteLength+this._anchors.byteLength}destroy(){this._entries.size&&o().warn(`InternalError: Leaking label store entries`),this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._entries.clear(),this._freeIds.length=0}acquire(e){if(e.labelStoreId!=null)return e.labelStoreId;let t=this._freeIds.pop()??this._nextId++;return this._ensureCapacity(t),this._entries.set(t,e),this._writeFeatureId(t,e.displayId),this.writeAnchor(t,e.anchorX,e.anchorY),this._data[t*4+3]=255,this._markDirty(t),e.labelStoreId=t,t}release(e){let t=e.labelStoreId;if(t!=null){if(this._entries.get(t)!==e)throw Error(`InternalError: expected label store entry`);this._entries.delete(t),this._data.fill(0,t*4,t*4+4),this._data[t*4+3]=255,this._anchors.fill(0,t*4,t*4+4),this._markDirty(t),e.labelStoreId=null,this._freeIds.push(t)}}invalidateColliders(){for(let e of this._entries.values())e.invalidateColliders()}setVisibility(e,t){let n=e.labelStoreId;if(n==null||this._entries.get(n)!==e)throw Error(`InternalError: expected label metric to have a store id`);let r=t?0:255,i=n*4+3;this._writeReferenceSymbolVVOffset(n,e.referenceSymbolVVOffset),this._data[i]!==r&&(this._data[i]=r,this._markDirty(n))}getVisibility(e){let t=e.labelStoreId;return t==null?255:this._data[t*4+3]}has(e){return e.labelStoreId!=null&&this._entries.get(e.labelStoreId)===e}getAnchor(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t],this._anchors[t+1]]}getReferenceSymbolVVOffset(e){if(!this._entries.has(e))return null;let t=e*4;return[this._anchors[t+2],this._anchors[t+3]]}upload(e){let t=this._texture??this._createTexture(e,!1),n=this._anchorTexture??this._createTexture(e,!0);this._uploadDirty(t,n)}getTexture(e){let r=this._texture??this._createTexture(e,!1),i=this._anchorTexture??this._createTexture(e,!0);if(this._dirtyStart!==1/0)throw Error(`InternalError: expected label store to be uploaded before rendering`);return{labelStoreTexture:{texture:r,unit:n},labelAnchorStoreTexture:{texture:i,unit:t}}}_createTexture(e,t){let n=new a(this._size);n.wrapMode=33071,n.samplingMode=9728,n.pixelFormat=6408,n.dataType=t?r.FLOAT:r.UNSIGNED_BYTE;let o=new i(e,n,t?this._anchors:this._data);return t?this._anchorTexture=o:this._texture=o,o}_ensureCapacity(e){if(e<this._size*this._size)return;let t=this._size;for(;e>=t*t;)t*=2;let n=new Uint8Array(t*t*4);n.set(this._data),this._data=n;let r=new Float32Array(t*t*4);r.set(this._anchors),this._anchors=r,this._size=t,this._texture?.dispose(),this._anchorTexture?.dispose(),this._texture=null,this._anchorTexture=null,this._dirtyStart=0,this._dirtyEnd=e}_writeFeatureId(e,t){let n=e*4;this._data[n]=t&255,this._data[n+1]=t>>8&255,this._data[n+2]=t>>16&255,this._markDirty(e)}writeAnchor(e,t,n){let r=e*4;this._anchors[r]=t,this._anchors[r+1]=n,this._markDirty(e)}_writeReferenceSymbolVVOffset(e,[t,n]){let r=e*4;(this._anchors[r+2]!==t||this._anchors[r+3]!==n)&&(this._anchors[r+2]=t,this._anchors[r+3]=n,this._markDirty(e))}_markDirty(e){this._dirtyStart=Math.min(this._dirtyStart,e),this._dirtyEnd=Math.max(this._dirtyEnd,e)}_uploadDirty(e,t){if(this._dirtyStart===1/0)return;let n=Math.floor(this._dirtyStart/this._size),r=Math.floor(this._dirtyEnd/this._size),i=n*this._size*4,a=(r+1)*this._size*4;e.updateData(0,0,n,this._size,r-n+1,this._data.subarray(i,a)),t.updateData(0,0,n,this._size,r-n+1,this._anchors.subarray(i,a)),this._dirtyStart=1/0,this._dirtyEnd=0}}export{s as LabelStore};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as n}from"../../../animations/instructions.js";import{location as r,uniform as i,texture as a,option as o}from"../../GraphShaderModule.js";import{Vec2 as s,Vec4 as c,Float as l,Sampler2D as u,cond as d,equal as f,negate as p,step as m,sin as h,cos as g,Mat3 as _,Vec3 as v,lessThanEqual as y,ifElse as b,texture2D as x,clamp as S,abs as C,block as w}from"../../graph/glsl.js";import{AnimationUniformInfo as T}from"./AnimationUniformInfo.js";import{MarkerConstants as E}from"../markers/markerConstants.js";import{FeatureVertexInput as D,AFeatureShader as O,FeatureFragmentInput as k}from"../shaders/AFeatureShader.js";import{softEdgeRatio as A}from"../shaders/constants.js";import{LocalTileOffset as j}from"../shaders/LocalTileOffset.js";import{MosaicInfo as M}from"../shaders/MosaicInfo.js";import{getBit as N,rgba2float as P}from"../shaders/utils.js";import{VisualVariableColor as F}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as I}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as L}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as R}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as z}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as V}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as H,getVisualVariableAngle as U}from"../shaders/vvUtils.js";class W extends D{}e([r(3,s)],W.prototype,`offset`,void 0),e([r(4,c)],W.prototype,`sizing`,void 0),e([r(5,c)],W.prototype,`value1Position2Value2`,void 0),e([r(6,c)],W.prototype,`animationPointerAndBaseSizeAndReferenceSize`,void 0),e([r(7,s)],W.prototype,`zoomRange`,void 0),e([r(8,l)],W.prototype,`lineLength`,void 0);class G extends k{}class K extends O{_vertexPreamble(e,t,n,r){let{animationPointerAndBaseSizeAndReferenceSize:i,sizing:a}=e,o=r??e.offset,s=this.getFeatureId(e.id,e.bitset),c=i.xy,u=i.z,h=i.w,g=a.xy,_=d([f(N(e.bitset,E.bitset.isMapAligned),new l(1)),this.view.getRotation().divide(180).multiply(Math.PI)],[!0,new l(0)]),v=p(_.add(t)),y=this._getEvalParams(e,g,n,v),b,x;if(!e.value1Position2Value2)x=e.pos,b=new l(0);else{let t;t=this.hittestRequest?new l(0):q(c,6,y).a.multiply(this.tile.getDisplayZoomFactor(this.tileInfo));let n=e.pos,r=e.value1Position2Value2.yz,i=e.value1Position2Value2.x,a=e.value1Position2Value2.w,o=t.subtract(i).divide(a.subtract(i));x=n.add(r.subtract(n).multiply(o)),b=m(new l(1),o).add(m(new l(0),p(o)))}x=this.getLabelPosition(x,e.id,e.bitset);let S=a.z,C=N(e.bitset,E.bitset.isStroke),w=a.w,T=N(e.bitset,E.bitset.scaleSymbolsProportionally),D=q(c,0,y),O=D.xy,k=D.z,A=D.w,j=N(e.bitset,E.bitset.isSDF),M=H(this,s,new l(h)).divide(new l(h));return{baseSize:u,animationPointer:c,strokeWidth:S,isOutline:C,unscaledDistanceToPx:w,scaleSymbolsProportionally:T,isSDF:j,position:this._getScreenPosition({id:s,pos:x,offset:o,referenceSize:h,translation:O,rotation:k,scale:A,vvScale:M}),evalParams:y,vvScale:M,scale:A,clip:b}}_getScreenPosition(e){let{pos:t,translation:n,rotation:r,scale:i,offset:a,id:o,vvScale:s}=e,c=U(this,o).multiply(Math.PI/180),u=n.x.multiply(4/3),d=n.y.multiply(-1).multiply(4/3),f=h(c),m=g(c),y=m.multiply(u).add(p(f).multiply(d)),b=f.multiply(u).add(m.multiply(d)),x=h(r.subtract(c)),S=g(r.subtract(c)),C=new l(0),w=new l(1),T=new _(w,C,C,C,w,C,y,b,w),E=new _(S,x.multiply(-1),C,x,S,C,0,0,w),D=i.multiply(s).multiply(4/3),O=E.multiply(D),k=this.tile.getViewScreenMat3(this.view).multiply(new v(t,1)),A=T.multiply(k).xy,j=O.multiply(new v(a,0)).xy;return A.add(j)}_clip(e,n,r){let i=super.clip(e,n,r),a=y(this._getLocalTimeOrigin(e),new l(0));return t.forceGlobalTimeOrigin||(i=i.add(d([a,()=>new l(2)],[!0,()=>new l(0)]))),i}_getLocalTimeOrigin(e){return this.getLocalTimeOrigin(e)}_toNdc(e){return this.view.displayMat3.multiply(new v(e,1)).xy}_getEvalParams(e,t,n,r){let{globalTime:i,animationTextureSize:a}=this.animationInfo;return{globalTime:i,localTimeOrigin:this._getLocalTimeOrigin(this.getFeatureId(e.id,e.bitset)),animationTextureSize:a,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:n.divide(this.tile.getDisplayZoomFactor(this.tileInfo)),globalRotation:r}}_getColor(e,t){return b(f(t.isSDF,new l(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return x(this.mosaicTexture,e).multiply(t.color)}_getSDFColor(e,t){let n=x(this.mosaicTexture,e),r=new l(.5).subtract(P(n)).multiply(t.distanceToPx).multiply(A),i=S(new l(.5).subtract(r),new l(0),new l(1)),a=t.color.multiply(i),o=t.outlineSize.multiply(.5),s=C(r).subtract(o),c=S(new l(.5).subtract(s),new l(0),new l(1)),u=t.outlineColor.multiply(c);return new l(1).subtract(u.a).multiply(a).add(u)}}e([i(M)],K.prototype,`mosaicInfo`,void 0),e([i(T)],K.prototype,`animationInfo`,void 0),e([i(j)],K.prototype,`localTileOffset`,void 0),e([a(u)],K.prototype,`mosaicTexture`,void 0),e([o(F)],K.prototype,`visualVariableColor`,void 0),e([o(I)],K.prototype,`visualVariableOpacity`,void 0),e([o(R)],K.prototype,`visualVariableSizeMinMaxValue`,void 0),e([o(z)],K.prototype,`visualVariableSizeScaleStops`,void 0),e([o(B)],K.prototype,`visualVariableSizeStops`,void 0),e([o(V)],K.prototype,`visualVariableSizeUnitValue`,void 0),e([o(L)],K.prototype,`visualVariableRotation`,void 0),e([a(u)],K.prototype,`animationTexture`,void 0);function q(e,t,r){let i=e.add(new s(t,0)),a=x(r.animationTexture,i.add(.5).divide(r.animationTextureSize)).xy;return e=e.add(a),w({animationPointer:e,...r},c,null,e=>{let{out:t}=e;if(!t)throw Error(`out is null`);return n({...e,out:t})})}export{G as AAnimatedFragmentInput,K as AAnimatedShader,W as AAnimatedVertexInput,q as getValue};
2
+ import{__decorate as e}from"tslib";import{animationDebugFlags as t}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{generateVirtualMachineSource as n}from"../../../animations/instructions.js";import{location as r,uniform as i,texture as a,option as o}from"../../GraphShaderModule.js";import{Vec2 as s,Vec4 as c,Float as l,Sampler2D as u,cond as d,equal as f,negate as p,step as m,sin as h,cos as g,Mat3 as _,Vec3 as v,lessThanEqual as y,ifElse as b,texture2D as x,clamp as S,abs as C,block as w}from"../../graph/glsl.js";import{AnimationUniformInfo as T}from"./AnimationUniformInfo.js";import{MarkerConstants as E}from"../markers/markerConstants.js";import{FeatureVertexInput as D,AFeatureShader as O,FeatureFragmentInput as k}from"../shaders/AFeatureShader.js";import{softEdgeRatio as A}from"../shaders/constants.js";import{LocalTileOffset as j}from"../shaders/LocalTileOffset.js";import{MosaicInfo as M}from"../shaders/MosaicInfo.js";import{getBit as N,rgba2float as P}from"../shaders/utils.js";import{VisualVariableColor as F}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as I}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as L}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as R}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as z}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as B}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as V}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as H,getVisualVariableAngle as U}from"../shaders/vvUtils.js";class W extends D{}e([r(3,s)],W.prototype,`offset`,void 0),e([r(4,c)],W.prototype,`sizing`,void 0),e([r(5,c)],W.prototype,`value1Position2Value2`,void 0),e([r(6,c)],W.prototype,`animationPointerAndBaseSizeAndReferenceSize`,void 0),e([r(7,s)],W.prototype,`zoomRange`,void 0),e([r(8,l)],W.prototype,`lineLength`,void 0);class G extends k{}class K extends O{_vertexPreamble(e,t,n,r){let{animationPointerAndBaseSizeAndReferenceSize:i,sizing:a}=e,o=r??e.offset,s=this.getFeatureId(e.id,e.bitset),c=i.xy,u=i.z,h=i.w,g=a.xy,_=d([f(N(e.bitset,E.bitset.isMapAligned),new l(1)),this.view.getRotation().divide(180).multiply(Math.PI)],[!0,new l(0)]),v=p(_.add(t)),y=this._getEvalParams(e,g,n,v),b,x;if(!e.value1Position2Value2)x=e.pos,b=new l(0);else{let t;t=this.hittestRequest?new l(0):q(c,6,y).a.multiply(this.tile.getDisplayZoomFactor(this.tileInfo));let n=e.pos,r=e.value1Position2Value2.yz,i=e.value1Position2Value2.x,a=e.value1Position2Value2.w,o=t.subtract(i).divide(a.subtract(i));x=n.add(r.subtract(n).multiply(o)),b=m(new l(1),o).add(m(new l(0),p(o)))}let S=a.z,C=N(e.bitset,E.bitset.isStroke),w=a.w,T=N(e.bitset,E.bitset.scaleSymbolsProportionally),D=q(c,0,y),O=D.xy,k=D.z,A=D.w,j=N(e.bitset,E.bitset.isSDF),M=H(this,s,new l(h)).divide(new l(h));return{baseSize:u,animationPointer:c,strokeWidth:S,isOutline:C,unscaledDistanceToPx:w,scaleSymbolsProportionally:T,isSDF:j,position:this._getScreenPosition({id:s,pos:x,offset:o,referenceSize:h,translation:O,rotation:k,scale:A,vvScale:M}),evalParams:y,vvScale:M,scale:A,clip:b}}_getScreenPosition(e){let{pos:t,translation:n,rotation:r,scale:i,offset:a,id:o,vvScale:s}=e,c=U(this,o).multiply(Math.PI/180),u=n.x.multiply(4/3),d=n.y.multiply(-1).multiply(4/3),f=h(c),m=g(c),y=m.multiply(u).add(p(f).multiply(d)),b=f.multiply(u).add(m.multiply(d)),x=h(r.subtract(c)),S=g(r.subtract(c)),C=new l(0),w=new l(1),T=new _(w,C,C,C,w,C,y,b,w),E=new _(S,x.multiply(-1),C,x,S,C,0,0,w),D=i.multiply(s).multiply(4/3),O=E.multiply(D),k=this.tile.getViewScreenMat3(this.view).multiply(new v(t,1)),A=T.multiply(k).xy,j=O.multiply(new v(a,0)).xy;return A.add(j)}_clip(e,n,r){let i=super.clip(e,n,r),a=y(this._getLocalTimeOrigin(e),new l(0));return t.forceGlobalTimeOrigin||(i=i.add(d([a,()=>new l(2)],[!0,()=>new l(0)]))),i}_getLocalTimeOrigin(e){return this.getLocalTimeOrigin(e)}_toNdc(e){return this.view.displayMat3.multiply(new v(e,1)).xy}_getEvalParams(e,t,n,r){let{globalTime:i,animationTextureSize:a}=this.animationInfo;return{globalTime:i,localTimeOrigin:this._getLocalTimeOrigin(this.getFeatureId(e.id,e.bitset)),animationTextureSize:a,animationTexture:this.animationTexture,pixelDimensions:t,lineLength:n.divide(this.tile.getDisplayZoomFactor(this.tileInfo)),globalRotation:r}}_getColor(e,t){return b(f(t.isSDF,new l(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return x(this.mosaicTexture,e).multiply(t.color)}_getSDFColor(e,t){let n=x(this.mosaicTexture,e),r=new l(.5).subtract(P(n)).multiply(t.distanceToPx).multiply(A),i=S(new l(.5).subtract(r),new l(0),new l(1)),a=t.color.multiply(i),o=t.outlineSize.multiply(.5),s=C(r).subtract(o),c=S(new l(.5).subtract(s),new l(0),new l(1)),u=t.outlineColor.multiply(c);return new l(1).subtract(u.a).multiply(a).add(u)}}e([i(M)],K.prototype,`mosaicInfo`,void 0),e([i(T)],K.prototype,`animationInfo`,void 0),e([i(j)],K.prototype,`localTileOffset`,void 0),e([a(u)],K.prototype,`mosaicTexture`,void 0),e([o(F)],K.prototype,`visualVariableColor`,void 0),e([o(I)],K.prototype,`visualVariableOpacity`,void 0),e([o(R)],K.prototype,`visualVariableSizeMinMaxValue`,void 0),e([o(z)],K.prototype,`visualVariableSizeScaleStops`,void 0),e([o(B)],K.prototype,`visualVariableSizeStops`,void 0),e([o(V)],K.prototype,`visualVariableSizeUnitValue`,void 0),e([o(L)],K.prototype,`visualVariableRotation`,void 0),e([a(u)],K.prototype,`animationTexture`,void 0);function q(e,t,r){let i=e.add(new s(t,0)),a=x(r.animationTexture,i.add(.5).divide(r.animationTextureSize)).xy;return e=e.add(a),w({animationPointer:e,...r},c,null,e=>{let{out:t}=e;if(!t)throw Error(`out is null`);return n({...e,out:t})})}export{G as AAnimatedFragmentInput,K as AAnimatedShader,W as AAnimatedVertexInput,q as getValue};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{animationDebugFlags as n}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as r,input as i,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec2 as o,Float as s,Vec4 as c,ifElse as l,or as u,Bool as d,mix as f,Mat3 as p,lessThan as m,Vec3 as h,distance as g,greaterThan as _,negate as v}from"../../graph/glsl.js";import{AAnimatedVertexInput as y,AAnimatedShader as b,getValue as x,AAnimatedFragmentInput as S}from"./AAnimatedShader.js";import{MarkerConstants as C}from"../markers/markerConstants.js";import{noHit as w,trueHit as T}from"../shaders/constants.js";import{isRectHittest as E,hittestMarkerRect as D,isPolygonHittest as O,hittestPolygon as k,isPointHittest as A,distPointTriangle as j,xyToBarycentric as M,inTriangle as N}from"../shaders/hittestUtils.js";import{getBitBool as P}from"../shaders/utils.js";import{getVisualVariableColor as F,getVisualVariableOpacity as I}from"../shaders/vvUtils.js";class L extends y{}e([r(9,o)],L.prototype,`uv`,void 0),e([r(10,s)],L.prototype,`angle`,void 0);class R extends a{}e([r(11,o)],R.prototype,`offsetNextVertex1`,void 0),e([r(12,o)],R.prototype,`offsetNextVertex2`,void 0),e([r(13,o)],R.prototype,`textureUVNextVertex1`,void 0),e([r(14,o)],R.prototype,`textureUVNextVertex2`,void 0);class z extends S{}function B(e,t,n,r){return t.multiply(e.x).add(n.multiply(e.y)).add(r.multiply(e.z))}class V extends b{constructor(){super(...arguments),this.type=`AnimatedMarkerShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`],uv:[`textureUVNextVertex1`,`textureUVNextVertex2`]}}vertex(e,t){let n=e.uv.divide(this.mosaicInfo.size),{position:r,animationPointer:i,evalParams:a,isOutline:o,unscaledDistanceToPx:m,vvScale:h,strokeWidth:g,scaleSymbolsProportionally:_,scale:v,isSDF:y,baseSize:b,clip:S}=this._vertexPreamble(e,e.angle,e.lineLength||new s(0)),w=this._toNdc(r),T=x(i,1,a);T=new c(T.rgb.multiply(T.a),T.a);let E=l(P(e.bitset,C.bitset.colorLocked),T,x(i,2,a));E=new c(E.rgb.multiply(E.a),E.a);let D=x(i,3,a);D=new c(D.rgb.multiply(D.a),D.a);let O=x(i,4,a).a,k=x(i,5,a).a,A=this.getFeatureId(e.id,e.bitset),j=F(this,A,T,u(P(e.bitset,C.bitset.colorLocked),new d(o))),M=f(j,E,D),N=I(this,A),L=f(N,O,k),R=M.multiply(L),z=this.clip(e.id,e.bitset,e.zoomRange).add(S.multiply(2)),B=m.multiply(h);return{glPosition:new c(w,z,1),uv:n,color:R.multiply(new s(1).subtract(o)),outlineColor:R.multiply(o),distanceToPx:B,strokeWidth:g.multiply(f(new s(1),v,_)),isOutline:o,isSDF:y,...this.maybeRunHittest(e,t,{pos:this.getLabelPosition(e.pos,e.id,e.bitset),size:b,sizeCorrection:new s(1),isMapAligned:new s(1),vvRotationMat3:new p(1,0,0,0,1,0,0,0,1),placementMat3:new p(1,0,0,0,1,0,0,0,1),outlineSize:new s(1),distanceToPx:B,isSDF:y})}}computeHittestTriangle(e,t,n){let r=new s(0);return{pos0:this._vertexPreamble(e,e.angle,r).position,pos1:this._vertexPreamble(e,e.angle,r,t.offsetNextVertex1).position,pos2:this._vertexPreamble(e,e.angle,r,t.offsetNextVertex2).position}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return n.spotlightAnimatedSymbols&&(t=t.add(new c(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,n){let r=this.computeHittestTriangle(e,t,n);return l(A(this.hittestRequest),()=>l(m(n.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,n),this._hittestMarker(e,t,n)),()=>l(E(this.hittestRequest),D(r,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),l(O(this.hittestRequest),k(r,this.hittestRequest.viewSize,this.hittestMaskTexture),new s(w))))}_hittestSmallMarker(e,t,n){let{position:r,distance:i,smallSymbolDistance:a}=this.hittestRequest,o=i.subtract(a),c=this.tile.getViewScreenMat3(this.view).multiply(new h(n.pos,1)).xy,u=n.size.multiply(.5),d=g(c,r).subtract(u).add(o);return l(_(d,this.hittestRequest.distance),new s(w),new s(T))}_hittestMarker(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,n),o=this.hittestRequest.position,c=this.hittestRequest.distance,u=j(o,r,i,a);return l(_(u,c),new s(w),this._hittestSamples(r,i,a,e,t,n))}_hittestSamples(e,t,n,r,i,a){let{outlineSize:u,isSDF:d,distanceToPx:f}=a,p=this.hittestRequest.position,m=this.hittestRequest.distance,h=M(p.add(new o(v(m),v(m))),e,t,n),g=M(p.add(new o(0,v(m))),e,t,n),y=M(p.add(new o(m,v(m))),e,t,n),b=M(p.add(new o(v(m),0)),e,t,n),x=M(p,e,t,n),S=M(p.add(new o(m,0)),e,t,n),C=M(p.add(new o(v(m),m)),e,t,n),E=M(p.add(new o(0,m)),e,t,n),D=M(p.add(new o(m,m)),e,t,n),O=r.uv.divide(this.mosaicInfo.size),k=i.textureUVNextVertex1.divide(this.mosaicInfo.size),A=i.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new c(1,1,1,1),outlineSize:u,outlineColor:new c(1,1,1,1),isSDF:d,distanceToPx:f},P=new s(0);return P=P.add(N(h).multiply(this._getColor(B(h,O,k,A),j).a)),P=P.add(N(g).multiply(this._getColor(B(g,O,k,A),j).a)),P=P.add(N(y).multiply(this._getColor(B(y,O,k,A),j).a)),P=P.add(N(b).multiply(this._getColor(B(b,O,k,A),j).a)),P=P.add(N(x).multiply(this._getColor(B(x,O,k,A),j).a)),P=P.add(N(S).multiply(this._getColor(B(S,O,k,A),j).a)),P=P.add(N(C).multiply(this._getColor(B(C,O,k,A),j).a)),P=P.add(N(E).multiply(this._getColor(B(E,O,k,A),j).a)),P=P.add(N(D).multiply(this._getColor(B(D,O,k,A),j).a)),l(_(P,new s(.05)),new s(T),new s(w))}}e([t(0,i(L)),t(1,i(R))],V.prototype,`vertex`,null),e([t(0,i(z))],V.prototype,`fragment`,null);export{z as AnimatedMarkerFragmentInput,V as AnimatedMarkerShader,L as AnimatedMarkerVertexInput};
2
+ import{__decorate as e,__param as t}from"tslib";import{animationDebugFlags as n}from"../../../../../../../symbols/cim/animationDebugFlags.js";import{location as r,input as i,ComputeVertexInput as a}from"../../GraphShaderModule.js";import{Vec2 as o,Float as s,Vec4 as c,ifElse as l,or as u,Bool as d,mix as f,Mat3 as p,lessThan as m,Vec3 as h,distance as g,greaterThan as _,negate as v}from"../../graph/glsl.js";import{AAnimatedVertexInput as y,AAnimatedShader as b,getValue as x,AAnimatedFragmentInput as S}from"./AAnimatedShader.js";import{MarkerConstants as C}from"../markers/markerConstants.js";import{noHit as w,trueHit as T}from"../shaders/constants.js";import{isRectHittest as E,hittestMarkerRect as D,isPolygonHittest as O,hittestPolygon as k,isPointHittest as A,distPointTriangle as j,xyToBarycentric as M,inTriangle as N}from"../shaders/hittestUtils.js";import{getBitBool as P}from"../shaders/utils.js";import{getVisualVariableColor as F,getVisualVariableOpacity as I}from"../shaders/vvUtils.js";class L extends y{}e([r(9,o)],L.prototype,`uv`,void 0),e([r(10,s)],L.prototype,`angle`,void 0);class R extends a{}e([r(11,o)],R.prototype,`offsetNextVertex1`,void 0),e([r(12,o)],R.prototype,`offsetNextVertex2`,void 0),e([r(13,o)],R.prototype,`textureUVNextVertex1`,void 0),e([r(14,o)],R.prototype,`textureUVNextVertex2`,void 0);class z extends S{}function B(e,t,n,r){return t.multiply(e.x).add(n.multiply(e.y)).add(r.multiply(e.z))}class V extends b{constructor(){super(...arguments),this.type=`AnimatedMarkerShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`],uv:[`textureUVNextVertex1`,`textureUVNextVertex2`]}}vertex(e,t){let n=e.uv.divide(this.mosaicInfo.size),{position:r,animationPointer:i,evalParams:a,isOutline:o,unscaledDistanceToPx:m,vvScale:h,strokeWidth:g,scaleSymbolsProportionally:_,scale:v,isSDF:y,baseSize:b,clip:S}=this._vertexPreamble(e,e.angle,e.lineLength||new s(0)),w=this._toNdc(r),T=x(i,1,a);T=new c(T.rgb.multiply(T.a),T.a);let E=l(P(e.bitset,C.bitset.colorLocked),T,x(i,2,a));E=new c(E.rgb.multiply(E.a),E.a);let D=x(i,3,a);D=new c(D.rgb.multiply(D.a),D.a);let O=x(i,4,a).a,k=x(i,5,a).a,A=this.getFeatureId(e.id,e.bitset),j=F(this,A,T,u(P(e.bitset,C.bitset.colorLocked),new d(o))),M=f(j,E,D),N=I(this,A),L=f(N,O,k),R=M.multiply(L),z=this.clip(e.id,e.bitset,e.zoomRange).add(S.multiply(2)),B=m.multiply(h);return{glPosition:new c(w,z,1),uv:n,color:R.multiply(new s(1).subtract(o)),outlineColor:R.multiply(o),distanceToPx:B,strokeWidth:g.multiply(f(new s(1),v,_)),isOutline:o,isSDF:y,...this.maybeRunHittest(e,t,{pos:e.pos,size:b,sizeCorrection:new s(1),isMapAligned:new s(1),vvRotationMat3:new p(1,0,0,0,1,0,0,0,1),placementMat3:new p(1,0,0,0,1,0,0,0,1),outlineSize:new s(1),distanceToPx:B,isSDF:y})}}computeHittestTriangle(e,t,n){let r=new s(0);return{pos0:this._vertexPreamble(e,e.angle,r).position,pos1:this._vertexPreamble(e,e.angle,r,t.offsetNextVertex1).position,pos2:this._vertexPreamble(e,e.angle,r,t.offsetNextVertex2).position}}fragment(e){let t=this._getColor(e.uv,{color:e.color,distanceToPx:e.distanceToPx,isSDF:e.isSDF,outlineColor:e.outlineColor,outlineSize:e.strokeWidth});return n.spotlightAnimatedSymbols&&(t=t.add(new c(0,.3,0,.3))),this.getFragmentOutput(t,e)}hittest(e,t,n){let r=this.computeHittestTriangle(e,t,n);return l(A(this.hittestRequest),()=>l(m(n.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,n),this._hittestMarker(e,t,n)),()=>l(E(this.hittestRequest),D(r,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),l(O(this.hittestRequest),k(r,this.hittestRequest.viewSize,this.hittestMaskTexture),new s(w))))}_hittestSmallMarker(e,t,n){let{position:r,distance:i,smallSymbolDistance:a}=this.hittestRequest,o=i.subtract(a),c=this.tile.getViewScreenMat3(this.view).multiply(new h(n.pos,1)).xy,u=n.size.multiply(.5),d=g(c,r).subtract(u).add(o);return l(_(d,this.hittestRequest.distance),new s(w),new s(T))}_hittestMarker(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,n),o=this.hittestRequest.position,c=this.hittestRequest.distance,u=j(o,r,i,a);return l(_(u,c),new s(w),this._hittestSamples(r,i,a,e,t,n))}_hittestSamples(e,t,n,r,i,a){let{outlineSize:u,isSDF:d,distanceToPx:f}=a,p=this.hittestRequest.position,m=this.hittestRequest.distance,h=M(p.add(new o(v(m),v(m))),e,t,n),g=M(p.add(new o(0,v(m))),e,t,n),y=M(p.add(new o(m,v(m))),e,t,n),b=M(p.add(new o(v(m),0)),e,t,n),x=M(p,e,t,n),S=M(p.add(new o(m,0)),e,t,n),C=M(p.add(new o(v(m),m)),e,t,n),E=M(p.add(new o(0,m)),e,t,n),D=M(p.add(new o(m,m)),e,t,n),O=r.uv.divide(this.mosaicInfo.size),k=i.textureUVNextVertex1.divide(this.mosaicInfo.size),A=i.textureUVNextVertex2.divide(this.mosaicInfo.size),j={color:new c(1,1,1,1),outlineSize:u,outlineColor:new c(1,1,1,1),isSDF:d,distanceToPx:f},P=new s(0);return P=P.add(N(h).multiply(this._getColor(B(h,O,k,A),j).a)),P=P.add(N(g).multiply(this._getColor(B(g,O,k,A),j).a)),P=P.add(N(y).multiply(this._getColor(B(y,O,k,A),j).a)),P=P.add(N(b).multiply(this._getColor(B(b,O,k,A),j).a)),P=P.add(N(x).multiply(this._getColor(B(x,O,k,A),j).a)),P=P.add(N(S).multiply(this._getColor(B(S,O,k,A),j).a)),P=P.add(N(C).multiply(this._getColor(B(C,O,k,A),j).a)),P=P.add(N(E).multiply(this._getColor(B(E,O,k,A),j).a)),P=P.add(N(D).multiply(this._getColor(B(D,O,k,A),j).a)),l(_(P,new s(.05)),new s(T),new s(w))}}e([t(0,i(L)),t(1,i(R))],V.prototype,`vertex`,null),e([t(0,i(z))],V.prototype,`fragment`,null);export{z as AnimatedMarkerFragmentInput,V as AnimatedMarkerShader,L as AnimatedMarkerVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{importLazily as e}from"../../../../../../../core/importUtils.js";import{memoize as t}from"../../../../../../../core/MapUtils.js";import{pt2px as n}from"../../../../../../../core/screenUtils.js";import{numericHash as r}from"../../../../../../../core/string.js";import{fromRotation as i,translate as a}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as s,set as c,sub as l,normalize as u,add as d,scale as f}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as p}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as m}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertGeometryToFlat as h,convertOptimizedGeometryToFlat as g,convertFlatToOptimizedGeometry as _,FlatGeometry as v}from"../../../../../../../geometry/FlatGeometry.js";import{GeometryCursor as y}from"../../../../../../../geometry/GeometryCursor.js";import{getLabelPoint as b}from"../../../../../../../geometry/support/labelPoint.js";import{generalizeOptimizedGeometry as x,convertToGeometry as S}from"../../../../../../../layers/graphics/featureConversionUtils.js";import C from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as w}from"../../../definitions.js";import T from"../../../collisions/BoundingBox.js";import{LabelMetric as E}from"../../../collisions/LabelMetric.js";import{smoothPaths as D,pathDivide as O,closestPointOnPaths as k}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as A,processColorInput as j}from"../fill/meshWriterUtils.js";import{TextMeshWriter as M,maxLabelZoom as N}from"../text/TextMeshWriter.js";const P=w*w/16;function F(e,t,n,r){if(n===0&&r===0)return null;let i=Math.max(e.xmax-e.xmin,e.ymax-e.ymin)+1;return{x:t.x-n*i,y:t.y+r*i}}const I=e(()=>import(`../../../../../../../geometry/operators/gx/operatorIntersection.js`)),L=e(()=>import(`../../../../../../../chunks/FlatGeometry.js`));function R(e,t,n){return r(`${e}${t}${n}`)}function z(e,t,n,i,a){let o=i*2**(N-a);return r(`${e}${t}${n}${o}`)}function B(e,t,n){return r(`${e}${t}${n}`)}function V(e,t,n,i,a){let o=n*2**(N-i);return r(`${e}${a}${t}${o}`)}const H=t(e=>{let t=0;if(e===0)return 1/0;for(;!(e%2);)t++,e/=2;return t});class U extends M{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!0,this._zoomLevel=0,this._calloutVisuals=[],this._calloutVisualIndex=0}async loadDependencies(){await Promise.all([super.loadDependencies(),I.getImportPromise(),L.getImportPromise()])}getCalloutEffectGeometry(e){let t=this._calloutVisuals[this._calloutVisualIndex]?.metric;return t?y.fromJSON({x:t.anchorX,y:t.anchorY}):null}getLocalCalloutReferenceInfo(){let e=this._calloutVisuals[this._calloutVisualIndex],t=e?.referenceInfo;if(!t||!e)return t;let{metric:n,featureAnchor:r}=e,i=t.anchor??{x:0,y:0},a={x:r[0]-n.anchorX,y:n.anchorY-r[1]},o={x:a.x+i.x,y:a.y+i.y},s=F(t.bodyBounds,o,n.directionX,n.directionY);return{...t,anchor:o,...s?{layoutAnchor:s}:null}}getCalloutVisualCount(){return this._calloutVisuals.length}setCalloutVisualIndex(e){if(e<0||e>=this._calloutVisuals.length)throw Error(`InternalError: callout visual index is out of bounds`);this._calloutVisualIndex=e}includeCalloutRecordRange(e,t){this._calloutVisuals[this._calloutVisualIndex]?.metric.includeRecordRange(e,t)}includeCalloutCollisionBounds(e){this._calloutVisuals[this._calloutVisualIndex]?.metric.includeCalloutCollisionBounds(e)}includeCalloutPartCollisionBounds(e){this._calloutVisuals[this._calloutVisualIndex]?.metric.includeCalloutPartCollisionBounds(e)}_write(e,{target:t,effect:n,level:r,viewExtent:i}){if(this._zoomLevel=r,this._calloutVisuals=[],this._calloutVisualIndex=0,n?.geometry!=null)throw Error(`InternalError: EffectGeometry not support for LabelMeshWriter`);switch(t.geometryType){case`esriGeometryPoint`:{let n=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,n,r,0,t);break}case`esriGeometryEnvelope`:case`esriGeometryPolygon`:this._writePolygon(e,t,i);break;case`esriGeometryMultipoint`:{let n=0,r=y.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,n++,t);break}case`esriGeometryPolyline`:this._writeLines(e,t)}}_getMetricDir(){let{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return[e===`center`?0:e===`right`?-1:1,t===`middle`?0:t===`bottom`?-1:1]}_createLineLabelMetric(e,t,n,r,i,a){let[o,s]=this._getMetricDir(),c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=this.evaluatedMeshParams.labelClassId;return new E(e,u,t,n,r,i,o,s,c,l,a)}_writePolygon(e,t,n){let r=t.readGeometryForDisplay()?.justXY();e.requiresRefresh||=(r?.area()||0)>=P;let i=this._getPolygonLabelPoint(t,n);i&&this._writePoint(e,i[0],i[1],0,t)}_getPolygonLabelPoint(e,t){if(!t){let t=e.readCentroidForDisplay()?.coords;return t?[t[0],t[1]]:null}let n=I.module,r=L.module.constructFromFlatGeometry,i=e.readGeometryForDisplay()?.justXY(),a=e.readCentroidForDisplay()?.coords,o=i?.area()||0;if(!a)return;let s=o>=P,c=r(h(t)),l=r(h({x:a[0],y:a[1]})),u=!!n.execute(l,c,null);if(!i||!s||!u)return[a[0],a[1]];let d=r(g(`polygon`,i,null)),f=n.execute(d,c,null);if(!f)return[a[0],a[1]];let p=_(new v(f.toFlatGeometry())),m=y.fromOptimized(p,`esriGeometryPolygon`,1),x=b(m)??a;return[x[0],x[1]]}_writePoint(e,t,n,r,i){if(t<0||t>w||n<0||n>w)return;let a=this._getShaping();if(!a)return;let o=i.getDisplayId(),s=this.evaluatedMeshParams.labelClassId,c=this.evaluatedMeshParams.layerId,l=R(c,i.getObjectId(),r),u=B(i.getObjectId(),s,r),[d,f]=this._getMetricDir(),p=this.evaluatedMeshParams.scaleInfo?.maxScale??0,m=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this._getPointLabelReferenceBounds(),g=new E(o,s,l,u,t,n,d,f,p,m,h);this._calloutVisuals.push({metric:g,featureAnchor:[t,n],referenceInfo:this._createLocalCalloutReferenceInfo(a,h)}),e.metricStart(g),this._writeGlyphs(e,o,t,n,a,0,h,void 0,!1),e.metricBoxWrite(a.boundsT),e.metricEnd()}_getPointReferenceBounds(){return this._references?.get(`label-reference-symbol`)?.getBoundsInfo()??null}_getPointLabelReferenceBounds(){let e=this._getPointReferenceBounds()??{offsetX:0,offsetY:0,size:0},t=this.evaluatedMeshParams.labelOffsetDistance??0,[n,r]=this._getMetricDir();return{...e,offsetX:e.offsetX+n*t,offsetY:e.offsetY-r*t}}_writeLines(e,t){let{scaleInfo:n,verticalAlignment:r}=this.evaluatedMeshParams,i=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping(`middle`);if(!a)return;let o=(e,t,n,r)=>this._placeSubdivGlyphs(e,t,n,r),s=(a.bounds.width+i)/2;this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:a,zoomRange:A(n,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},calloutPaths:t.readLegacyGeometryForDisplay().paths.map(e=>e.map(([e,t])=>[e,t])),offsetDirection:null,pathIndex:0},this._verticalPlacement=r===`bottom`?`above`:r===`top`?`below`:null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,o,s):this._writeCenterAlong(t,o,s)}_writeAboveAndBelowAlong(e,t,n){let{repeatLabel:r}=this.evaluatedMeshParams,{shaping:i}=this._current,a=i.bounds.halfHeight,o=e.readGeometryForDisplay()?.justXY();if(!o)return;let s=x(o,`esriGeometryPolyline`,1)??new C,c=W(s,a),l=W(s,-a),u=S(l,`esriGeometryPolyline`,!1,!1),d=S(c,`esriGeometryPolyline`,!1,!1),f=D(d.paths,i.bounds.width),p=D(u.paths,i.bounds.width);this._current.offsetDirection=`above`;for(let e=0;e<f.length;e++)this._current.pathIndex=e,O(f[e],n,t,!!r);this._current.offsetDirection=`below`;for(let e=0;e<p.length;e++)this._current.pathIndex=e,O(p[e],n,t,!!r)}_writeCenterAlong(e,t,n){let{repeatLabel:r}=this.evaluatedMeshParams,{shaping:i}=this._current,a=D(e.readLegacyGeometryForDisplay().paths,i.bounds.width);for(let e=0;e<a.length;e++)this._current.pathIndex=e,O(a[e],n,t,!!r)}_placeSubdivGlyphs(e,t,n,r){if(e.x<0||e.x>w||e.y<0||e.y>w)return;let{allowOverrun:i,labelPosition:a,repeatLabelDistance:o,layerId:s,labelClassId:c}=this.evaluatedMeshParams,{objId:l,shaping:u,pathIndex:d}=this._current,f=this._current.zoomRange[0],p=H(t),m=this._current.shaping.bounds.width/2,h=Math.sqrt(o||128)/2,g=Math.min(n,r-n),_=u.isMultiline?N:Math.log2(g/(h+m/2)),v=t===0?_:Math.min(p,_),y=Math.max(f,this._zoomLevel+1-v),b=this._zoomLevel-y,x=u.bounds.width/2*2**b,S=z(s,l,d,t,this._zoomLevel),C=V(l,d,t,this._zoomLevel,c);i&&b<0?this._placeStraightAlong(e,f,S,C):a===`parallel`||u.isMultiline?this._placeStraightAlong(e,y,S,C):a===`curved`&&this._placeCurved(e,y,x,S,C)}_placeCurved(e,t,n,r,i){let{out:a,id:o}=this._current,s=this._createLineLabelMetric(o,r,i,e.x,e.y);this._registerLineCalloutMetric(s),a.metricStart(s);let c=e.clone(),l=e.angle*(180/Math.PI)%360,u=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(c,t,1,l),this._placeBack(e,c,t,n,1,l),this._placeForward(e,c,t,n,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(c,t,0,u),this._placeBack(e,c,t,n,0,u),this._placeForward(e,c,t,n,0,u)),a.metricEnd()}_placeStraightAlong(e,t,r,s){let{out:c,id:l,shaping:u,zoomRange:d,referenceBounds:f}=this._current,{boxBorderLineColor:m,boxBackgroundColor:h}=this.evaluatedMeshParams,g=e.clone(),_=e.angle*(180/Math.PI)%360,v=(e.angle*(180/Math.PI)+180)%360,y=u.glyphs.length>0&&!!(m||h),b=this._createLineLabelMetric(l,r,s,e.x,e.y);if(this._registerLineCalloutMetric(b),c.metricStart(b),y){let r=Math.max(t,d[0],0),s=Math.min(N,d[1]),m=i(o(),-e.angle),h={minZoom:r,maxZoom:s,clipAngle:_,mapAligned:!0,isLineLabel:!0},g=n(this.evaluatedMeshParams.offsetX),y=n(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){let t=p(g,-1*y),[n,r]=u.shapeBackground(a(o(),m,t));c.recordStart(this.instanceId,this.attributeLayout,u.glyphs[0].textureKey),this._writeTextBox(c,l,e.x,e.y,r,f,h),c.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){let t=p(g,y),[n,r]=u.shapeBackground(a(o(),m,t));h.clipAngle=v,c.recordStart(this.instanceId,this.attributeLayout,u.glyphs[0].textureKey),this._writeTextBox(c,l,e.x,e.y,r,f,h),c.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(g,t,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(g,t,0,v,!0),c.metricEnd()}_registerLineCalloutMetric(e){this._calloutVisuals.push({metric:e,featureAnchor:k(this._current.calloutPaths,e.anchorX,e.anchorY),referenceInfo:this._createLocalCalloutReferenceInfo(this._current.shaping)})}_placeBack(e,t,n,r,i,a){let o=e.clone(),s=e.backwardLength+0;for(;o.prev()&&!(s>=r);)this._placeOnSegment(o,t,s,n,-1,i,a),s+=o.length+0}_placeForward(e,t,n,r,i,a){let o=e.clone(),s=e.remainingLength+0;for(;o.next()&&!(s>=r);)this._placeOnSegment(o,t,s,n,1,i,a),s+=o.length+0}_placeFirst(e,t,n,r,i=!1){let{out:a,id:o,shaping:s,zoomRange:c,referenceBounds:l}=this._current,u=s.glyphs,d=this._getBoundsOffset(e.angle);for(let f of u){let u=f.x>s.bounds.x?n:1-n,p=u*e.remainingLength+(1-u)*e.backwardLength,m=Math.abs(f.x+f.width/2-s.bounds.x),h=Math.max(0,this._zoomLevel+Math.log2(m/(p+0))),g=Math.max(t,i?0:h);f.angle=e.angle+(1-n)*Math.PI;let _=[Math.max(c[0],g),Math.min(c[1],N)];this._writeLineGlyph(a,o,e.x,e.y,f,_,r,l),this._writeLineGlyphBox(a,f,n,_,d)}}_placeOnSegment(e,t,n,r,i,a,o){let{out:s,id:c,shaping:l,referenceBounds:u}=this._current,d=l.glyphs,f=e.dx/e.length,p=e.dy/e.length,m={x:e.x+n*-i*f,y:e.y+n*-i*p},h=this._getBoundsOffset(e.angle);for(let t of d){let d=t.x>l.bounds.x?a:1-a;if(!(d&&i===1||!d&&i===-1))continue;let f=Math.abs(t.x+t.width/2-l.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(f/n)-.1),g=Math.max(r,this._zoomLevel+Math.log2(f/(n+e.length+0)));if(p===0)continue;t.angle=e.angle+(1-a)*Math.PI;let _=[g,p];this._writeLineGlyph(s,c,m.x,m.y,t,_,o,u),this._writeLineGlyphBox(s,t,a,_,h)}}_getBoundsOffset(e){let t=n(this.evaluatedMeshParams.offsetX),r=n(this.evaluatedMeshParams.offsetY),a=p(t,r),c=i(o(),-e);return s(a,a,c)}_writeLineGlyph(e,t,n,r,i,a,o,s){e.recordStart(this.instanceId,this.attributeLayout,i.textureKey);let{texcoords:c,offsets:l}=i,{fontSize:u,haloSize:d,outlineSize:f}=this._textMeshTransformProps,p=this._getDefaultGlyphMetrics(this.evaluatedMeshParams.glyphs),m=i.fontSize??u;this._writeQuad(e,t,n,r,{sdfSize:p.sdfSize,sdfRadius:p.sdfRadius,texcoords:c,offsets:l,fontSize:m,haloSize:d,outlineSize:f,color:i.color?j(i.color):j(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:s,minZoom:Math.max(this._current.zoomRange[0],a[0]),maxZoom:Math.min(this._current.zoomRange[1],a[1]),clipAngle:o,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,n,r,i){if((n||this._current.offsetDirection)&&this._isVisible(r)&&t.bounds){let n=t.bounds,r=new T(n.x+i[0],n.y+i[1],n.width,n.height);e.metricBoxWrite(r)}}_isVisible(e){let t=Math.max(this._current.zoomRange[0],e[0]),n=Math.min(this._current.zoomRange[1],e[1]),r=this._zoomLevel;return t<=r&&r<=n}}function W(e,t){let n=new C,{coords:r,lengths:i}=e,a=m(),o=m(),s=m(),p=m(),h=m(),g=m(),_=0;for(let e=0;e<i.length;e++){let m=i[e];for(let e=0;e<m;e++){let i=2*(e+_-1),v=2*(e+_),y=2*(e+_+1);e>0?c(a,r[i],r[i+1]):c(a,0,0),c(o,r[v],r[v+1]),e<m-1?c(s,r[y],r[y+1]):c(s,0,0),e===0?c(p,0,0):(l(p,o,a),u(p,p),c(p,p[1],-p[0])),e===m-1?c(h,0,0):(l(h,s,o),u(h,h),c(h,h[1],-h[0])),d(g,p,h),u(g,g);let b=g[0]*h[0]+g[1]*h[1];b!==0&&f(g,g,b),f(g,g,t),n.coords.push(o[0]+g[0],o[1]+g[1])}n.lengths.push(m),_+=m}return n}export{U as LabelMeshWriter,R as labelIdHash,B as labelMetricHash,z as lineLabelIdHash,V as lineLabelMetricHash};
2
+ import{importLazily as e}from"../../../../../../../core/importUtils.js";import{memoize as t}from"../../../../../../../core/MapUtils.js";import{pt2px as n}from"../../../../../../../core/screenUtils.js";import{numericHash as r}from"../../../../../../../core/string.js";import{fromRotation as i,translate as a}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as s,set as c,sub as l,normalize as u,add as d,scale as f}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as p}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as m}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{convertGeometryToFlat as h,convertOptimizedGeometryToFlat as g,convertFlatToOptimizedGeometry as _,FlatGeometry as v}from"../../../../../../../geometry/FlatGeometry.js";import{GeometryCursor as y}from"../../../../../../../geometry/GeometryCursor.js";import{getLabelPoint as b}from"../../../../../../../geometry/support/labelPoint.js";import{generalizeOptimizedGeometry as x,convertToGeometry as S}from"../../../../../../../layers/graphics/featureConversionUtils.js";import C from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as w}from"../../../definitions.js";import T from"../../../collisions/BoundingBox.js";import{LabelMetric as E}from"../../../collisions/LabelMetric.js";import{smoothPaths as D,pathDivide as O,closestPointOnPaths as k}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as A,processColorInput as j}from"../fill/meshWriterUtils.js";import{TextMeshWriter as M,maxLabelZoom as N}from"../text/TextMeshWriter.js";const P=w*w/16;function F(e,t,n,r){if(n===0&&r===0)return null;let i=Math.max(e.xmax-e.xmin,e.ymax-e.ymin)+1;return{x:t.x-n*i,y:t.y+r*i}}const I=e(()=>import(`../../../../../../../geometry/operators/gx/operatorIntersection.js`)),L=e(()=>import(`../../../../../../../chunks/FlatGeometry.js`));function R(e,t,n){return r(`${e}${t}${n}`)}function z(e,t,n,i,a){let o=i*2**(N-a);return r(`${e}${t}${n}${o}`)}function B(e,t,n){return r(`${e}${t}${n}`)}function V(e,t,n,i,a){let o=n*2**(N-i);return r(`${e}${a}${t}${o}`)}const H=t(e=>{let t=0;if(e===0)return 1/0;for(;!(e%2);)t++,e/=2;return t});class U extends M{constructor(){super(...arguments),this.calloutRecordsUseLabelPhase=!0,this._zoomLevel=0,this._calloutVisuals=[],this._calloutVisualIndex=0}async loadDependencies(){await Promise.all([super.loadDependencies(),I.getImportPromise(),L.getImportPromise()])}getCalloutEffectGeometry(e){return this._calloutVisuals[this._calloutVisualIndex]?.metric?y.fromJSON({x:0,y:0}):null}getLocalCalloutReferenceInfo(){let e=this._calloutVisuals[this._calloutVisualIndex],t=e?.referenceInfo;if(!t||!e)return t;let{metric:n,featureAnchor:r}=e,i=t.anchor??{x:0,y:0},a={x:r[0]-n.anchorX,y:n.anchorY-r[1]},o={x:a.x+i.x,y:a.y+i.y},s=F(t.bodyBounds,o,n.directionX,n.directionY);return{...t,anchor:o,...s?{layoutAnchor:s}:null}}getCalloutVisualCount(){return this._calloutVisuals.length}setCalloutVisualIndex(e){if(e<0||e>=this._calloutVisuals.length)throw Error(`InternalError: callout visual index is out of bounds`);this._calloutVisualIndex=e}includeCalloutRecordRange(e,t){this._calloutVisuals[this._calloutVisualIndex]?.metric.includeRecordRange(e,t)}includeCalloutCollisionBounds(e){this._calloutVisuals[this._calloutVisualIndex]?.metric.includeCalloutCollisionBounds(e)}includeCalloutPartCollisionBounds(e){this._calloutVisuals[this._calloutVisualIndex]?.metric.includeCalloutPartCollisionBounds(e)}_write(e,{target:t,effect:n,level:r,viewExtent:i}){if(this._zoomLevel=r,this._calloutVisuals=[],this._calloutVisualIndex=0,n?.geometry!=null)throw Error(`InternalError: EffectGeometry not support for LabelMeshWriter`);switch(t.geometryType){case`esriGeometryPoint`:{let n=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,n,r,0,t);break}case`esriGeometryEnvelope`:case`esriGeometryPolygon`:this._writePolygon(e,t,i);break;case`esriGeometryMultipoint`:{let n=0,r=y.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,n++,t);break}case`esriGeometryPolyline`:this._writeLines(e,t)}}_getMetricDir(){let{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return[e===`center`?0:e===`right`?-1:1,t===`middle`?0:t===`bottom`?-1:1]}_createLineLabelMetric(e,t,n,r,i,a){let[o,s]=this._getMetricDir(),c=this.evaluatedMeshParams.scaleInfo?.maxScale??0,l=this.evaluatedMeshParams.scaleInfo?.minScale??0,u=this.evaluatedMeshParams.labelClassId;return new E(e,u,t,n,r,i,o,s,c,l,a)}_writePolygon(e,t,n){let r=t.readGeometryForDisplay()?.justXY();e.requiresRefresh||=(r?.area()||0)>=P;let i=this._getPolygonLabelPoint(t,n);i&&this._writePoint(e,i[0],i[1],0,t)}_getPolygonLabelPoint(e,t){if(!t){let t=e.readCentroidForDisplay()?.coords;return t?[t[0],t[1]]:null}let n=I.module,r=L.module.constructFromFlatGeometry,i=e.readGeometryForDisplay()?.justXY(),a=e.readCentroidForDisplay()?.coords,o=i?.area()||0;if(!a)return;let s=o>=P,c=r(h(t)),l=r(h({x:a[0],y:a[1]})),u=!!n.execute(l,c,null);if(!i||!s||!u)return[a[0],a[1]];let d=r(g(`polygon`,i,null)),f=n.execute(d,c,null);if(!f)return[a[0],a[1]];let p=_(new v(f.toFlatGeometry())),m=y.fromOptimized(p,`esriGeometryPolygon`,1),x=b(m)??a;return[x[0],x[1]]}_writePoint(e,t,n,r,i){if(t<0||t>w||n<0||n>w)return;let a=this._getShaping();if(!a)return;let o=i.getDisplayId(),s=this.evaluatedMeshParams.labelClassId,c=this.evaluatedMeshParams.layerId,l=R(c,i.getObjectId(),r),u=B(i.getObjectId(),s,r),[d,f]=this._getMetricDir(),p=this.evaluatedMeshParams.scaleInfo?.maxScale??0,m=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this._getPointLabelReferenceBounds(),g=new E(o,s,l,u,t,n,d,f,p,m,h);this._calloutVisuals.push({metric:g,featureAnchor:[t,n],referenceInfo:this._createLocalCalloutReferenceInfo(a,h)}),e.metricStart(g),this._writeGlyphs(e,o,t,n,a,0,h,void 0,!1),e.metricBoxWrite(a.boundsT),e.metricEnd()}_getPointReferenceBounds(){return this._references?.get(`label-reference-symbol`)?.getBoundsInfo()??null}_getPointLabelReferenceBounds(){let e=this._getPointReferenceBounds()??{offsetX:0,offsetY:0,size:0},t=this.evaluatedMeshParams.labelOffsetDistance??0,[n,r]=this._getMetricDir();return{...e,offsetX:e.offsetX+n*t,offsetY:e.offsetY-r*t}}_writeLines(e,t){let{scaleInfo:n,verticalAlignment:r}=this.evaluatedMeshParams,i=this.evaluatedMeshParams.repeatLabelDistance||128,a=this._getShaping(`middle`);if(!a)return;let o=(e,t,n,r)=>this._placeSubdivGlyphs(e,t,n,r),s=(a.bounds.width+i)/2;this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:a,zoomRange:A(n,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},calloutPaths:t.readLegacyGeometryForDisplay().paths.map(e=>e.map(([e,t])=>[e,t])),offsetDirection:null,pathIndex:0},this._verticalPlacement=r===`bottom`?`above`:r===`top`?`below`:null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,o,s):this._writeCenterAlong(t,o,s)}_writeAboveAndBelowAlong(e,t,n){let{repeatLabel:r}=this.evaluatedMeshParams,{shaping:i}=this._current,a=i.bounds.halfHeight,o=e.readGeometryForDisplay()?.justXY();if(!o)return;let s=x(o,`esriGeometryPolyline`,1)??new C,c=W(s,a),l=W(s,-a),u=S(l,`esriGeometryPolyline`,!1,!1),d=S(c,`esriGeometryPolyline`,!1,!1),f=D(d.paths,i.bounds.width),p=D(u.paths,i.bounds.width);this._current.offsetDirection=`above`;for(let e=0;e<f.length;e++)this._current.pathIndex=e,O(f[e],n,t,!!r);this._current.offsetDirection=`below`;for(let e=0;e<p.length;e++)this._current.pathIndex=e,O(p[e],n,t,!!r)}_writeCenterAlong(e,t,n){let{repeatLabel:r}=this.evaluatedMeshParams,{shaping:i}=this._current,a=D(e.readLegacyGeometryForDisplay().paths,i.bounds.width);for(let e=0;e<a.length;e++)this._current.pathIndex=e,O(a[e],n,t,!!r)}_placeSubdivGlyphs(e,t,n,r){if(e.x<0||e.x>w||e.y<0||e.y>w)return;let{allowOverrun:i,labelPosition:a,repeatLabelDistance:o,layerId:s,labelClassId:c}=this.evaluatedMeshParams,{objId:l,shaping:u,pathIndex:d}=this._current,f=this._current.zoomRange[0],p=H(t),m=this._current.shaping.bounds.width/2,h=Math.sqrt(o||128)/2,g=Math.min(n,r-n),_=u.isMultiline?N:Math.log2(g/(h+m/2)),v=t===0?_:Math.min(p,_),y=Math.max(f,this._zoomLevel+1-v),b=this._zoomLevel-y,x=u.bounds.width/2*2**b,S=z(s,l,d,t,this._zoomLevel),C=V(l,d,t,this._zoomLevel,c);i&&b<0?this._placeStraightAlong(e,f,S,C):a===`parallel`||u.isMultiline?this._placeStraightAlong(e,y,S,C):a===`curved`&&this._placeCurved(e,y,x,S,C)}_placeCurved(e,t,n,r,i){let{out:a,id:o}=this._current,s=this._createLineLabelMetric(o,r,i,e.x,e.y);this._registerLineCalloutMetric(s),a.metricStart(s);let c=e.clone(),l=e.angle*(180/Math.PI)%360,u=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(c,t,1,l),this._placeBack(e,c,t,n,1,l),this._placeForward(e,c,t,n,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(c,t,0,u),this._placeBack(e,c,t,n,0,u),this._placeForward(e,c,t,n,0,u)),a.metricEnd()}_placeStraightAlong(e,t,r,s){let{out:c,id:l,shaping:u,zoomRange:d,referenceBounds:f}=this._current,{boxBorderLineColor:m,boxBackgroundColor:h}=this.evaluatedMeshParams,g=e.clone(),_=e.angle*(180/Math.PI)%360,v=(e.angle*(180/Math.PI)+180)%360,y=u.glyphs.length>0&&!!(m||h),b=this._createLineLabelMetric(l,r,s,e.x,e.y);if(this._registerLineCalloutMetric(b),c.metricStart(b),y){let r=Math.max(t,d[0],0),s=Math.min(N,d[1]),m=i(o(),-e.angle),h={minZoom:r,maxZoom:s,clipAngle:_,mapAligned:!0,isLineLabel:!0},g=n(this.evaluatedMeshParams.offsetX),y=n(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){let t=p(g,-1*y),[n,r]=u.shapeBackground(a(o(),m,t));c.recordStart(this.instanceId,this.attributeLayout,u.glyphs[0].textureKey),this._writeTextBox(c,l,e.x,e.y,r,f,h),c.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){let t=p(g,y),[n,r]=u.shapeBackground(a(o(),m,t));h.clipAngle=v,c.recordStart(this.instanceId,this.attributeLayout,u.glyphs[0].textureKey),this._writeTextBox(c,l,e.x,e.y,r,f,h),c.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(g,t,1,_,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(g,t,0,v,!0),c.metricEnd()}_registerLineCalloutMetric(e){this._calloutVisuals.push({metric:e,featureAnchor:k(this._current.calloutPaths,e.anchorX,e.anchorY),referenceInfo:this._createLocalCalloutReferenceInfo(this._current.shaping)})}_placeBack(e,t,n,r,i,a){let o=e.clone(),s=e.backwardLength+0;for(;o.prev()&&!(s>=r);)this._placeOnSegment(o,t,s,n,-1,i,a),s+=o.length+0}_placeForward(e,t,n,r,i,a){let o=e.clone(),s=e.remainingLength+0;for(;o.next()&&!(s>=r);)this._placeOnSegment(o,t,s,n,1,i,a),s+=o.length+0}_placeFirst(e,t,n,r,i=!1){let{out:a,id:o,shaping:s,zoomRange:c,referenceBounds:l}=this._current,u=s.glyphs,d=this._getBoundsOffset(e.angle);for(let f of u){let u=f.x>s.bounds.x?n:1-n,p=u*e.remainingLength+(1-u)*e.backwardLength,m=Math.abs(f.x+f.width/2-s.bounds.x),h=Math.max(0,this._zoomLevel+Math.log2(m/(p+0))),g=Math.max(t,i?0:h);f.angle=e.angle+(1-n)*Math.PI;let _=[Math.max(c[0],g),Math.min(c[1],N)];this._writeLineGlyph(a,o,e.x,e.y,f,_,r,l),this._writeLineGlyphBox(a,f,n,_,d)}}_placeOnSegment(e,t,n,r,i,a,o){let{out:s,id:c,shaping:l,referenceBounds:u}=this._current,d=l.glyphs,f=e.dx/e.length,p=e.dy/e.length,m={x:e.x+n*-i*f,y:e.y+n*-i*p},h=this._getBoundsOffset(e.angle);for(let t of d){let d=t.x>l.bounds.x?a:1-a;if(!(d&&i===1||!d&&i===-1))continue;let f=Math.abs(t.x+t.width/2-l.bounds.x),p=Math.max(0,this._zoomLevel+Math.log2(f/n)-.1),g=Math.max(r,this._zoomLevel+Math.log2(f/(n+e.length+0)));if(p===0)continue;t.angle=e.angle+(1-a)*Math.PI;let _=[g,p];this._writeLineGlyph(s,c,m.x,m.y,t,_,o,u),this._writeLineGlyphBox(s,t,a,_,h)}}_getBoundsOffset(e){let t=n(this.evaluatedMeshParams.offsetX),r=n(this.evaluatedMeshParams.offsetY),a=p(t,r),c=i(o(),-e);return s(a,a,c)}_writeLineGlyph(e,t,n,r,i,a,o,s){e.recordStart(this.instanceId,this.attributeLayout,i.textureKey);let{texcoords:c,offsets:l}=i,{fontSize:u,haloSize:d,outlineSize:f}=this._textMeshTransformProps,p=this._getDefaultGlyphMetrics(this.evaluatedMeshParams.glyphs),m=i.fontSize??u;this._writeQuad(e,t,n,r,{sdfSize:p.sdfSize,sdfRadius:p.sdfRadius,texcoords:c,offsets:l,fontSize:m,haloSize:d,outlineSize:f,color:i.color?j(i.color):j(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:s,minZoom:Math.max(this._current.zoomRange[0],a[0]),maxZoom:Math.min(this._current.zoomRange[1],a[1]),clipAngle:o,mapAligned:!0,isLineLabel:!0}),e.recordEnd()}_writeLineGlyphBox(e,t,n,r,i){if((n||this._current.offsetDirection)&&this._isVisible(r)&&t.bounds){let n=t.bounds,r=new T(n.x+i[0],n.y+i[1],n.width,n.height);e.metricBoxWrite(r)}}_isVisible(e){let t=Math.max(this._current.zoomRange[0],e[0]),n=Math.min(this._current.zoomRange[1],e[1]),r=this._zoomLevel;return t<=r&&r<=n}}function W(e,t){let n=new C,{coords:r,lengths:i}=e,a=m(),o=m(),s=m(),p=m(),h=m(),g=m(),_=0;for(let e=0;e<i.length;e++){let m=i[e];for(let e=0;e<m;e++){let i=2*(e+_-1),v=2*(e+_),y=2*(e+_+1);e>0?c(a,r[i],r[i+1]):c(a,0,0),c(o,r[v],r[v+1]),e<m-1?c(s,r[y],r[y+1]):c(s,0,0),e===0?c(p,0,0):(l(p,o,a),u(p,p),c(p,p[1],-p[0])),e===m-1?c(h,0,0):(l(h,s,o),u(h,h),c(h,h[1],-h[0])),d(g,p,h),u(g,g);let b=g[0]*h[0]+g[1]*h[1];b!==0&&f(g,g,b),f(g,g,t),n.coords.push(o[0]+g[0],o[1]+g[1])}n.lengths.push(m),_+=m}return n}export{U as LabelMeshWriter,R as labelIdHash,B as labelMetricHash,z as lineLabelIdHash,V as lineLabelMetricHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,uniform as i,texture as a,input as o,ComputeVertexInput as s}from"../../GraphShaderModule.js";import{Vec4 as c,Vec2 as l,Float as u,Sampler2D as d,Vec3 as f,min as p,max as m,Mat3 as h,ifElse as g,lessThan as _,equal as v,texture2D as y,clamp as b,abs as x,mix as S,distance as C,greaterThan as w,negate as T}from"../../graph/glsl.js";import{MarkerConstants as E}from"./markerConstants.js";import{FeatureVertexInput as D,AFeatureShader as O,FeatureFragmentInput as k}from"../shaders/AFeatureShader.js";import{c256ToRad as A,noHit as j,softEdgeRatio as M,trueHit as N}from"../shaders/constants.js";import{isRectHittest as P,hittestMarkerRect as F,isPolygonHittest as I,hittestPolygon as L,isPointHittest as ee,distPointTriangle as te,xyToBarycentric as R,inTriangle as z}from"../shaders/hittestUtils.js";import{MosaicInfo as ne}from"../shaders/MosaicInfo.js";import{getBit as B,getBitBool as V,rgba2float as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as re}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as ie}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as ae,getVisualVariableColor as oe,getVisualVariableSize as se,getVisualVariableRotation as ce}from"../shaders/vvUtils.js";class J extends D{}e([n(3,c)],J.prototype,`color`,void 0),e([n(4,c)],J.prototype,`outlineColor`,void 0),e([n(5,l)],J.prototype,`offset`,void 0),e([n(6,l)],J.prototype,`textureUV`,void 0),e([n(7,c)],J.prototype,`sizing`,void 0),e([n(8,u)],J.prototype,`placementAngle`,void 0),e([n(9,u)],J.prototype,`sdfDecodeCoeff`,void 0),e([n(10,l)],J.prototype,`zoomRange`,void 0);class Y extends s{}e([n(11,l)],Y.prototype,`offsetNextVertex1`,void 0),e([n(12,l)],Y.prototype,`offsetNextVertex2`,void 0),e([n(13,l)],Y.prototype,`textureUVNextVertex1`,void 0),e([n(14,l)],Y.prototype,`textureUVNextVertex2`,void 0);class X extends k{}function Z(e,t,n,r){return t.multiply(e.x).add(n.multiply(e.y)).add(r.multiply(e.z))}function Q(e){return e.multiply(e).divide(128)}class $ extends O{constructor(){super(...arguments),this.type=`MarkerShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`],textureUV:[`textureUVNextVertex1`,`textureUVNextVertex2`]}}vertex(e,t){let n=Q(e.sizing.x),r=Q(e.sizing.y),i=Q(e.sizing.z),a=e.placementAngle,o=B(e.bitset,E.bitset.isSDF),s=B(e.bitset,E.bitset.isMapAligned),l=B(e.bitset,E.bitset.scaleSymbolsProportionally),d=V(e.bitset,E.bitset.colorLocked),g=this.getFeatureId(e.id,e.bitset),_=ae(this,g),v=oe(this,g,e.color,d).multiply(_),y=this.getLabelPosition(e.pos.xy,e.id,e.bitset),b=this.tile.getDisplayViewScreenMat3(this.view).multiply(new f(y,1)),x=se(this,g,i).divide(i),S=n.multiply(x),C=e.offset.xy.multiply(x),w=r.multiply(l.multiply(x.subtract(1)).add(1));w=p(w,m(S.subtract(.99),new u(0)));let T=m(w,new u(1)),D=p(w,new u(1)),O=h.fromRotation(a.multiply(A)),k=ce(this,g),j=this._getViewRotationMatrix(s).multiply(k).multiply(O).multiply(new f(C.xy,0)).multiply(this.tileInfo.scaleFactor),M=this.clip(e.id,e.bitset,e.zoomRange),N=new c(b.xy.add(j.xy),M,1),P=e.textureUV.divide(this.mosaicInfo.size),F=e.outlineColor.multiply(D),I=B(e.bitset,E.bitset.overrideOutlineColor),L=e.sdfDecodeCoeff.multiply(S);return{glPosition:N,color:v,textureUV:P,outlineColor:F,outlineSize:T,distanceToPx:L,isSDF:o,overrideOutlineColor:I,...this.maybeRunHittest(e,t,{pos:y,size:S,sizeCorrection:x,scaleFactor:this.tileInfo.scaleFactor,isMapAligned:s,vvRotationMat3:k,placementMat3:O,outlineSize:T,distanceToPx:L,isSDF:o})}}fragment(e){let t=this._getColor(e.textureUV,e);return this.getFragmentOutput(t,e)}hittest(e,t,n){let r=this.computeHittestTriangle(e,t,n);return g(ee(this.hittestRequest),()=>g(_(n.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,n),this._hittestMarker(e,t,n)),()=>g(P(this.hittestRequest),F(r,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),g(I(this.hittestRequest),L(r,this.hittestRequest.viewSize,this.hittestMaskTexture),new u(j))))}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new u(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getViewScreenMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new u(1).subtract(e);return n.multiply(e).add(r.multiply(i))}_getColor(e,t){return g(v(t.isSDF,new u(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return y(this.mosaicTexture,e).multiply(t.color)}_getSDFColor(e,t){let n=y(this.mosaicTexture,e),r=new u(.5).subtract(H(n)).multiply(t.distanceToPx).multiply(M),i=b(new u(.5).subtract(r),new u(0),new u(1)),a=t.color.multiply(i),o=t.outlineSize;this.highlight&&(o=m(o,t.overrideOutlineColor.multiply(4)));let s=o.multiply(.5),c=x(r).subtract(s),l=b(new u(.5).subtract(c),new u(0),new u(1)),d=S(t.outlineColor,t.color,t.overrideOutlineColor).multiply(l);return new u(1).subtract(d.a).multiply(a).add(d)}_hittestSmallMarker(e,t,n){let{position:r,distance:i,smallSymbolDistance:a}=this.hittestRequest,o=i.subtract(a),s=this.tile.getViewScreenMat3(this.view).multiply(new f(n.pos,1)).xy,c=n.size.multiply(.5),l=C(s,r).subtract(c).add(o);return g(w(l,this.hittestRequest.distance),new u(j),new u(N))}_hittestMarker(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,n),o=this.hittestRequest.position,s=this.hittestRequest.distance,c=te(o,r,i,a);return g(w(c,s),new u(j),this._hittestSamples(r,i,a,e,t,n))}computeHittestTriangle(e,t,n){let{pos:r,sizeCorrection:i,scaleFactor:a,isMapAligned:o}=n,s=new f(e.offset.multiply(i).multiply(a),0),c=new f(t.offsetNextVertex1.multiply(i).multiply(a),0),l=new f(t.offsetNextVertex2.multiply(i).multiply(a),0),u=this.tile.getViewScreenMat3(this.view).multiply(new f(r,1)),d=this._getViewScreenMatrix(o).multiply(n.vvRotationMat3).multiply(n.placementMat3);return{pos0:u.add(d.multiply(s)).xy,pos1:u.add(d.multiply(c)).xy,pos2:u.add(d.multiply(l)).xy}}_hittestSamples(e,t,n,r,i,a){let{outlineSize:o,isSDF:s,distanceToPx:d}=a,f=this.hittestRequest.position,p=this.hittestRequest.distance,m=R(f.add(new l(T(p),T(p))),e,t,n),h=R(f.add(new l(0,T(p))),e,t,n),_=R(f.add(new l(p,T(p))),e,t,n),v=R(f.add(new l(T(p),0)),e,t,n),y=R(f,e,t,n),b=R(f.add(new l(p,0)),e,t,n),x=R(f.add(new l(T(p),p)),e,t,n),S=R(f.add(new l(0,p)),e,t,n),C=R(f.add(new l(p,p)),e,t,n),E=r.textureUV.divide(this.mosaicInfo.size),D=i.textureUVNextVertex1.divide(this.mosaicInfo.size),O=i.textureUVNextVertex2.divide(this.mosaicInfo.size),k={color:new c(1),outlineColor:new c(1),overrideOutlineColor:new u(1),outlineSize:o,distanceToPx:d,isSDF:s},A=new u(0);return A=A.add(z(m).multiply(this._getColor(Z(m,E,D,O),k).a)),A=A.add(z(h).multiply(this._getColor(Z(h,E,D,O),k).a)),A=A.add(z(_).multiply(this._getColor(Z(_,E,D,O),k).a)),A=A.add(z(v).multiply(this._getColor(Z(v,E,D,O),k).a)),A=A.add(z(y).multiply(this._getColor(Z(y,E,D,O),k).a)),A=A.add(z(b).multiply(this._getColor(Z(b,E,D,O),k).a)),A=A.add(z(x).multiply(this._getColor(Z(x,E,D,O),k).a)),A=A.add(z(S).multiply(this._getColor(Z(S,E,D,O),k).a)),A=A.add(z(C).multiply(this._getColor(Z(C,E,D,O),k).a)),g(w(A,new u(.05)),new u(N),new u(j))}}e([r(U)],$.prototype,`visualVariableColor`,void 0),e([r(W)],$.prototype,`visualVariableOpacity`,void 0),e([r(G)],$.prototype,`visualVariableRotation`,void 0),e([r(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([r(re)],$.prototype,`visualVariableSizeStops`,void 0),e([r(ie)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([i(ne)],$.prototype,`mosaicInfo`,void 0),e([a(d)],$.prototype,`mosaicTexture`,void 0),e([t(0,o(J)),t(1,o(Y))],$.prototype,`vertex`,null),e([t(0,o(X))],$.prototype,`fragment`,null);export{X as MarkerFragmentInput,$ as MarkerShader,J as MarkerVertexInput};
2
+ import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,uniform as i,texture as a,input as o,ComputeVertexInput as s}from"../../GraphShaderModule.js";import{Vec4 as c,Vec2 as l,Float as u,Sampler2D as d,Vec3 as f,min as p,max as m,Mat3 as h,ifElse as g,lessThan as _,equal as v,texture2D as y,clamp as b,abs as x,mix as S,distance as C,greaterThan as w,negate as T}from"../../graph/glsl.js";import{MarkerConstants as E}from"./markerConstants.js";import{FeatureVertexInput as D,AFeatureShader as O,FeatureFragmentInput as k}from"../shaders/AFeatureShader.js";import{c256ToRad as A,noHit as j,softEdgeRatio as M,trueHit as N}from"../shaders/constants.js";import{isRectHittest as P,hittestMarkerRect as F,isPolygonHittest as I,hittestPolygon as L,isPointHittest as ee,distPointTriangle as te,xyToBarycentric as R,inTriangle as z}from"../shaders/hittestUtils.js";import{MosaicInfo as ne}from"../shaders/MosaicInfo.js";import{getBit as B,getBitBool as V,rgba2float as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as re}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as ie}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as ae,getVisualVariableColor as oe,getVisualVariableSize as se,getVisualVariableRotation as ce}from"../shaders/vvUtils.js";class J extends D{}e([n(3,c)],J.prototype,`color`,void 0),e([n(4,c)],J.prototype,`outlineColor`,void 0),e([n(5,l)],J.prototype,`offset`,void 0),e([n(6,l)],J.prototype,`textureUV`,void 0),e([n(7,c)],J.prototype,`sizing`,void 0),e([n(8,u)],J.prototype,`placementAngle`,void 0),e([n(9,u)],J.prototype,`sdfDecodeCoeff`,void 0),e([n(10,l)],J.prototype,`zoomRange`,void 0);class Y extends s{}e([n(11,l)],Y.prototype,`offsetNextVertex1`,void 0),e([n(12,l)],Y.prototype,`offsetNextVertex2`,void 0),e([n(13,l)],Y.prototype,`textureUVNextVertex1`,void 0),e([n(14,l)],Y.prototype,`textureUVNextVertex2`,void 0);class X extends k{}function Z(e,t,n,r){return t.multiply(e.x).add(n.multiply(e.y)).add(r.multiply(e.z))}function Q(e){return e.multiply(e).divide(128)}class $ extends O{constructor(){super(...arguments),this.type=`MarkerShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`],textureUV:[`textureUVNextVertex1`,`textureUVNextVertex2`]}}vertex(e,t){let n=Q(e.sizing.x),r=Q(e.sizing.y),i=Q(e.sizing.z),a=e.placementAngle,o=B(e.bitset,E.bitset.isSDF),s=B(e.bitset,E.bitset.isMapAligned),l=B(e.bitset,E.bitset.scaleSymbolsProportionally),d=V(e.bitset,E.bitset.colorLocked),g=this.getFeatureId(e.id,e.bitset),_=ae(this,g),v=oe(this,g,e.color,d).multiply(_),y=this.getCalloutPos(e.pos,e.id,e.bitset),b=this.getCalloutTransform(this.isLabelInstance(e.bitset)).multiply(new f(y,1)).xy,x=se(this,g,i).divide(i),S=n.multiply(x),C=e.offset.xy.multiply(x),w=r.multiply(l.multiply(x.subtract(1)).add(1));w=p(w,m(S.subtract(.99),new u(0)));let T=m(w,new u(1)),D=p(w,new u(1)),O=h.fromRotation(a.multiply(A)),k=ce(this,g),j=this._getViewRotationMatrix(s).multiply(k).multiply(O).multiply(new f(C.xy,0)).multiply(this.tileInfo.scaleFactor),M=this.clip(e.id,e.bitset,e.zoomRange),N=new c(b.add(j.xy),M,1),P=e.textureUV.divide(this.mosaicInfo.size),F=e.outlineColor.multiply(D),I=B(e.bitset,E.bitset.overrideOutlineColor),L=e.sdfDecodeCoeff.multiply(S);return{glPosition:N,color:v,textureUV:P,outlineColor:F,outlineSize:T,distanceToPx:L,isSDF:o,overrideOutlineColor:I,...this.maybeRunHittest(e,t,{pos:y,size:S,sizeCorrection:x,scaleFactor:this.tileInfo.scaleFactor,isMapAligned:s,vvRotationMat3:k,placementMat3:O,outlineSize:T,distanceToPx:L,isSDF:o})}}fragment(e){let t=this._getColor(e.textureUV,e);return this.getFragmentOutput(t,e)}hittest(e,t,n){let r=this.computeHittestTriangle(e,t,n);return g(ee(this.hittestRequest),()=>g(_(n.size,this.hittestRequest.smallSymbolSizeThreshold),this._hittestSmallMarker(e,t,n),this._hittestMarker(e,t,n)),()=>g(P(this.hittestRequest),F(r,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),g(I(this.hittestRequest),L(r,this.hittestRequest.viewSize,this.hittestMaskTexture),new u(j))))}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new u(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getViewScreenMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new u(1).subtract(e);return n.multiply(e).add(r.multiply(i))}_getColor(e,t){return g(v(t.isSDF,new u(1)),this._getSDFColor(e,t),this._getSpriteColor(e,t))}_getSpriteColor(e,t){return y(this.mosaicTexture,e).multiply(t.color)}_getSDFColor(e,t){let n=y(this.mosaicTexture,e),r=new u(.5).subtract(H(n)).multiply(t.distanceToPx).multiply(M),i=b(new u(.5).subtract(r),new u(0),new u(1)),a=t.color.multiply(i),o=t.outlineSize;this.highlight&&(o=m(o,t.overrideOutlineColor.multiply(4)));let s=o.multiply(.5),c=x(r).subtract(s),l=b(new u(.5).subtract(c),new u(0),new u(1)),d=S(t.outlineColor,t.color,t.overrideOutlineColor).multiply(l);return new u(1).subtract(d.a).multiply(a).add(d)}_hittestSmallMarker(e,t,n){let{position:r,distance:i,smallSymbolDistance:a}=this.hittestRequest,o=i.subtract(a),s=this.tile.getViewScreenMat3(this.view).multiply(new f(n.pos,1)).xy,c=n.size.multiply(.5),l=C(s,r).subtract(c).add(o);return g(w(l,this.hittestRequest.distance),new u(j),new u(N))}_hittestMarker(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,n),o=this.hittestRequest.position,s=this.hittestRequest.distance,c=te(o,r,i,a);return g(w(c,s),new u(j),this._hittestSamples(r,i,a,e,t,n))}computeHittestTriangle(e,t,n){let{pos:r,sizeCorrection:i,scaleFactor:a,isMapAligned:o}=n,s=new f(e.offset.multiply(i).multiply(a),0),c=new f(t.offsetNextVertex1.multiply(i).multiply(a),0),l=new f(t.offsetNextVertex2.multiply(i).multiply(a),0),u=this.tile.getViewScreenMat3(this.view).multiply(new f(r,1)),d=this._getViewScreenMatrix(o).multiply(n.vvRotationMat3).multiply(n.placementMat3);return{pos0:u.add(d.multiply(s)).xy,pos1:u.add(d.multiply(c)).xy,pos2:u.add(d.multiply(l)).xy}}_hittestSamples(e,t,n,r,i,a){let{outlineSize:o,isSDF:s,distanceToPx:d}=a,f=this.hittestRequest.position,p=this.hittestRequest.distance,m=R(f.add(new l(T(p),T(p))),e,t,n),h=R(f.add(new l(0,T(p))),e,t,n),_=R(f.add(new l(p,T(p))),e,t,n),v=R(f.add(new l(T(p),0)),e,t,n),y=R(f,e,t,n),b=R(f.add(new l(p,0)),e,t,n),x=R(f.add(new l(T(p),p)),e,t,n),S=R(f.add(new l(0,p)),e,t,n),C=R(f.add(new l(p,p)),e,t,n),E=r.textureUV.divide(this.mosaicInfo.size),D=i.textureUVNextVertex1.divide(this.mosaicInfo.size),O=i.textureUVNextVertex2.divide(this.mosaicInfo.size),k={color:new c(1),outlineColor:new c(1),overrideOutlineColor:new u(1),outlineSize:o,distanceToPx:d,isSDF:s},A=new u(0);return A=A.add(z(m).multiply(this._getColor(Z(m,E,D,O),k).a)),A=A.add(z(h).multiply(this._getColor(Z(h,E,D,O),k).a)),A=A.add(z(_).multiply(this._getColor(Z(_,E,D,O),k).a)),A=A.add(z(v).multiply(this._getColor(Z(v,E,D,O),k).a)),A=A.add(z(y).multiply(this._getColor(Z(y,E,D,O),k).a)),A=A.add(z(b).multiply(this._getColor(Z(b,E,D,O),k).a)),A=A.add(z(x).multiply(this._getColor(Z(x,E,D,O),k).a)),A=A.add(z(S).multiply(this._getColor(Z(S,E,D,O),k).a)),A=A.add(z(C).multiply(this._getColor(Z(C,E,D,O),k).a)),g(w(A,new u(.05)),new u(N),new u(j))}}e([r(U)],$.prototype,`visualVariableColor`,void 0),e([r(W)],$.prototype,`visualVariableOpacity`,void 0),e([r(G)],$.prototype,`visualVariableRotation`,void 0),e([r(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([r(re)],$.prototype,`visualVariableSizeStops`,void 0),e([r(ie)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([i(ne)],$.prototype,`mosaicInfo`,void 0),e([a(d)],$.prototype,`mosaicTexture`,void 0),e([t(0,o(J)),t(1,o(Y))],$.prototype,`vertex`,null),e([t(0,o(X))],$.prototype,`fragment`,null);export{X as MarkerFragmentInput,$ as MarkerShader,J as MarkerVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{maxHighlightGroups as t}from"../../../definitions.js";import{location as n,define as r,option as i,uniform as a,texture as o,VertexInput as s,ComputeVertexInput as c,GraphShaderModule as l,FragmentOutput as u,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec3 as f,Float as p,Vec2 as m,Sampler2D as h,float as g,step as _,Vec4 as v,equal as y,ifElse as b,or as x,texture2D as S,Mat3 as C,textureSize as w,Int as T,mod as E}from"../../graph/glsl.js";import{trueHit as D,candidateHit as O,noHit as k,bitsetGenericLabelInstance as A}from"./constants.js";import{EntityStorage as j,EntityStorageTextures as M}from"./EntityStorage.js";import{ShaderHighlight as N}from"./ShaderHighlight.js";import{ShaderHittest as P}from"./ShaderHittest.js";import{Tile as F}from"./Tile.js";import{TileInfo as I}from"./TileInfo.js";import{getFilterBit as L,getHighlightBit as R,getBit as z,uvToClip as B,unpackDisplayIdTexel as V}from"./utils.js";import{ViewInfo as H}from"./ViewInfo.js";class U extends s{}e([n(0,f)],U.prototype,`id`,void 0),e([n(1,p)],U.prototype,`bitset`,void 0),e([n(2,m)],U.prototype,`pos`,void 0);class W extends c{}e([n(14,m)],W.prototype,`nextPos1`,void 0),e([n(15,m)],W.prototype,`nextPos2`,void 0);class G extends d{}class K extends l{clip(e,t=new p(0),n){let r=new p(0),i=this.getFeatureId(e,t),a=this.getFilterFlags(i);if(r=r.add(g(2).multiply(g(1).subtract(L(a,0)))),this.inside?r=r.add(g(2).multiply(g(1).subtract(L(a,1)))):this.outside?r=r.add(g(2).multiply(L(a,1))):this.highlight&&(r=r.add(g(2).multiply(g(1).subtract(this._checkHighlight(a))))),n!=null){let e=new p(1).subtract(_(n.x,this.tileInfo.currentZoom)),t=_(n.y,this.tileInfo.currentZoom);r=r.add(new p(2).multiply(e.add(t)))}return r=r.add(new p(2).multiply(this.getLabelHidden(e,t))),r}getFragmentOutput(e,t,n=new p(1/255)){let r=new u;return r.fragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,n)??e,r}_maybeHighlight(e,t){return this.highlight?new v(e.rgb,_(t,e.a)):null}_checkHighlight(e){let n=this._checkHighlightBit(e,0);for(let r=1;r<t;r++)n=n.add(this._checkHighlightBit(e,r));return _(new p(.1),n.add(this.highlight.highlightAll))}_checkHighlightBit(e,t){return R(e,t).multiply(z(this.highlight.activeGroups,t))}computeHittestTriangle(e,t,n){let r=this.tile.getViewScreenMat3(this.view),{nextPos1:i,nextPos2:a}=t,o=this.getLabelPosition(e.pos,e.id,e.bitset),s=this.getLabelPosition(i,e.id,e.bitset),c=this.getLabelPosition(a,e.id,e.bitset);return{pos0:r.multiply(new f(o,1)).xy,pos1:r.multiply(new f(s,1)).xy,pos2:r.multiply(new f(c,1)).xy}}maybeRunHittest(e,t,n){if(this.hittestRequest==null)return null;let r=this.hittest(e,t,n),i=y(r,new p(D)),a=y(r,new p(O)),o=b(a,()=>new v(new p(1/255),0,0,0),b(i,()=>new v(new p(2/255),0,0,0),new v(k))),s=b(x(i,a),new p(0),new p(2)),c=this.getAttributeDataCoords(this.getFeatureId(e.id,e.bitset)),l=B(c);return s=s.add(this.clip(e.id,e.bitset,e.zoomRange)),{glPointSize:new p(1),glPosition:new v(l,s,1),color:o}}_maybeWriteHittest(e){return this.hittestRequest==null?null:e.color}getAttributeDataCoords(e){return this.storage.getAttributeDataCoords(e)}getLabelReferenceSymbolVVOffset(e){return S(this.labelAnchorStoreTexture,this._getLabelStoreCoords(e)).zw}getFeatureId(e,t){let n=z(t,A);return b(y(n,new p(1)),()=>S(this.labelStoreTexture,this._getLabelStoreCoords(e)).rgb.multiply(255),e)}getLabelPosition(e,t,n){let r=z(n,A);return b(y(r,new p(1)),()=>{let n=S(this.labelAnchorStoreTexture,this._getLabelStoreCoords(t)),r=n.xy,i=y(e.x,r.x).and(y(e.y,r.y)),a=b(i,new m(0),n.zw),o=this.view.getRotation().divide(-180).multiply(Math.PI),s=C.fromRotation(o).multiply(new f(e.subtract(r).add(a),0)).xy.multiply(this.tile.getDisplayZoomFactor(this.tileInfo));return r.add(s)},e)}getLabelOffset(e,t){return b(y(z(t,A),new p(1)),()=>{let t=this.view.getRotation().divide(-180).multiply(Math.PI);return C.fromRotation(t).multiply(new f(e,0)).xy},e)}getLabelHidden(e,t){return b(y(z(t,A),new p(1)),()=>S(this.labelStoreTexture,this._getLabelStoreCoords(e)).a,new p(0))}getVVData(e){return this.storageTextures.getVVData(this.getAttributeDataCoords(e))}getFilterFlags(e){return this.storageTextures.getFilterFlags(this.getAttributeDataCoords(e))}getLocalTimeOrigin(e){return this.storageTextures.getLocalTimeOrigin(this.getAttributeDataCoords(e))}getSizeValue(e){return this.storageTextures.getSizeValue(this.getAttributeDataCoords(e))}getColorValue(e){return this.storageTextures.getColorValue(this.getAttributeDataCoords(e))}getOpacityValue(e){return this.storageTextures.getOpacityValue(this.getAttributeDataCoords(e))}getRotationValue(e){return this.storageTextures.getRotationValue(this.getAttributeDataCoords(e))}_getLabelStoreCoords(e){let t=V(e),n=t.x,r=t.y.multiply(256),i=t.z.multiply(65536),a=n.add(r).add(i),o=g(w(this.labelStoreTexture,new T(0)).x),s=E(a,o),c=a.subtract(s).divide(o);return new m(s,c).add(.5).divide(o)}}e([r],K.prototype,`inside`,void 0),e([r],K.prototype,`outside`,void 0),e([i(N)],K.prototype,`highlight`,void 0),e([a(j)],K.prototype,`storage`,void 0),e([o(M)],K.prototype,`storageTextures`,void 0),e([o(h)],K.prototype,`labelStoreTexture`,void 0),e([o(h)],K.prototype,`labelAnchorStoreTexture`,void 0),e([o(h)],K.prototype,`hittestMaskTexture`,void 0),e([a(H)],K.prototype,`view`,void 0),e([a(I)],K.prototype,`tileInfo`,void 0),e([a(F)],K.prototype,`tile`,void 0),e([i(P)],K.prototype,`hittestRequest`,void 0);export{K as AFeatureShader,W as BaseHittestVertexInput,G as FeatureFragmentInput,U as FeatureVertexInput};
2
+ import{__decorate as e}from"tslib";import{maxHighlightGroups as t}from"../../../definitions.js";import{location as n,define as r,option as i,uniform as a,texture as o,VertexInput as s,ComputeVertexInput as c,GraphShaderModule as l,FragmentOutput as u,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec3 as f,Float as p,Vec2 as m,Sampler2D as h,float as g,step as _,Vec4 as v,equal as y,ifElse as b,or as x,texture2D as S,and as C,notEqual as w,textureSize as T,Int as E,mod as D}from"../../graph/glsl.js";import{trueHit as O,candidateHit as k,noHit as A,bitsetGenericLabelInstance as j,bitsetTextIsMapAligned as M}from"./constants.js";import{EntityStorage as N,EntityStorageTextures as P}from"./EntityStorage.js";import{ShaderHighlight as F}from"./ShaderHighlight.js";import{ShaderHittest as I}from"./ShaderHittest.js";import{Tile as L}from"./Tile.js";import{TileInfo as R}from"./TileInfo.js";import{getFilterBit as z,getHighlightBit as B,getBit as V,uvToClip as H,unpackDisplayIdTexel as U}from"./utils.js";import{ViewInfo as W}from"./ViewInfo.js";class G extends s{}e([n(0,f)],G.prototype,`id`,void 0),e([n(1,p)],G.prototype,`bitset`,void 0),e([n(2,m)],G.prototype,`pos`,void 0);class K extends c{}e([n(14,m)],K.prototype,`nextPos1`,void 0),e([n(15,m)],K.prototype,`nextPos2`,void 0);class q extends d{}class J extends l{clip(e,t=new p(0),n){let r=new p(0),i=this.getFeatureId(e,t),a=this.getFilterFlags(i);if(r=r.add(g(2).multiply(g(1).subtract(z(a,0)))),this.inside?r=r.add(g(2).multiply(g(1).subtract(z(a,1)))):this.outside?r=r.add(g(2).multiply(z(a,1))):this.highlight&&(r=r.add(g(2).multiply(g(1).subtract(this._checkHighlight(a))))),n!=null){let e=new p(1).subtract(_(n.x,this.tileInfo.currentZoom)),t=_(n.y,this.tileInfo.currentZoom);r=r.add(new p(2).multiply(e.add(t)))}return r=r.add(new p(2).multiply(this.getLabelHidden(e,t))),r}getFragmentOutput(e,t,n=new p(1/255)){let r=new u;return r.fragColor=this._maybeWriteHittest(t)??this._maybeHighlight(e,n)??e,r}_maybeHighlight(e,t){return this.highlight?new v(e.rgb,_(t,e.a)):null}_checkHighlight(e){let n=this._checkHighlightBit(e,0);for(let r=1;r<t;r++)n=n.add(this._checkHighlightBit(e,r));return _(new p(.1),n.add(this.highlight.highlightAll))}_checkHighlightBit(e,t){return B(e,t).multiply(V(this.highlight.activeGroups,t))}computeHittestTriangle(e,t,n){let r=this.tile.getViewScreenMat3(this.view),{nextPos1:i,nextPos2:a}=t,o=this.getCalloutPos(e.pos,e.id,e.bitset),s=this.getCalloutPos(i,e.id,e.bitset),c=this.getCalloutPos(a,e.id,e.bitset);return{pos0:r.multiply(new f(o,1)).xy,pos1:r.multiply(new f(s,1)).xy,pos2:r.multiply(new f(c,1)).xy}}maybeRunHittest(e,t,n){if(this.hittestRequest==null)return null;let r=this.hittest(e,t,n),i=y(r,new p(O)),a=y(r,new p(k)),o=b(a,()=>new v(new p(1/255),0,0,0),b(i,()=>new v(new p(2/255),0,0,0),new v(A))),s=b(x(i,a),new p(0),new p(2)),c=this.getAttributeDataCoords(this.getFeatureId(e.id,e.bitset)),l=H(c);return s=s.add(this.clip(e.id,e.bitset,e.zoomRange)),{glPointSize:new p(1),glPosition:new v(l,s,1),color:o}}_maybeWriteHittest(e){return this.hittestRequest==null?null:e.color}getAttributeDataCoords(e){return this.storage.getAttributeDataCoords(e)}getLabelReferenceSymbolVVOffset(e){return S(this.labelAnchorStoreTexture,this._getLabelStoreCoords(e)).zw}getFeatureId(e,t){let n=V(t,j);return b(y(n,new p(1)),()=>S(this.labelStoreTexture,this._getLabelStoreCoords(e)).rgb.multiply(255),e)}getScreenAnchor(e,t){let n=S(this.labelAnchorStoreTexture,this._getLabelStoreCoords(e)),r=this.tile.getViewScreenMat3(this.view).multiply(new f(n.xy,1)).xy;if(t){let e=y(t.x,new p(0)).and(y(t.y,new p(0)));r=r.add(b(e,new m(0),n.zw))}return r}getCalloutPos(e,t,n){return b(this.isLabelInstance(n),()=>this.getScreenAnchor(t,e).add(e),e)}getLabelTextPos(e,t,n){return b(this.isAnchoredLabel(n),()=>this.getScreenAnchor(t),e)}isLabelInstance(e){return y(V(e,j),new p(1))}isAnchoredLabel(e){return C(this.isLabelInstance(e),w(V(e,M),new p(1)))}getCalloutTransform(e){return b(e,this.view.displayMat3,this.tile.getDisplayViewScreenMat3(this.view))}getLabelHidden(e,t){return b(this.isLabelInstance(t),()=>S(this.labelStoreTexture,this._getLabelStoreCoords(e)).a,new p(0))}getVVData(e){return this.storageTextures.getVVData(this.getAttributeDataCoords(e))}getFilterFlags(e){return this.storageTextures.getFilterFlags(this.getAttributeDataCoords(e))}getLocalTimeOrigin(e){return this.storageTextures.getLocalTimeOrigin(this.getAttributeDataCoords(e))}getSizeValue(e){return this.storageTextures.getSizeValue(this.getAttributeDataCoords(e))}getColorValue(e){return this.storageTextures.getColorValue(this.getAttributeDataCoords(e))}getOpacityValue(e){return this.storageTextures.getOpacityValue(this.getAttributeDataCoords(e))}getRotationValue(e){return this.storageTextures.getRotationValue(this.getAttributeDataCoords(e))}_getLabelStoreCoords(e){let t=U(e),n=t.x,r=t.y.multiply(256),i=t.z.multiply(65536),a=n.add(r).add(i),o=g(T(this.labelStoreTexture,new E(0)).x),s=D(a,o),c=a.subtract(s).divide(o);return new m(s,c).add(.5).divide(o)}}e([r],J.prototype,`inside`,void 0),e([r],J.prototype,`outside`,void 0),e([i(F)],J.prototype,`highlight`,void 0),e([a(N)],J.prototype,`storage`,void 0),e([o(P)],J.prototype,`storageTextures`,void 0),e([o(h)],J.prototype,`labelStoreTexture`,void 0),e([o(h)],J.prototype,`labelAnchorStoreTexture`,void 0),e([o(h)],J.prototype,`hittestMaskTexture`,void 0),e([a(W)],J.prototype,`view`,void 0),e([a(R)],J.prototype,`tileInfo`,void 0),e([a(L)],J.prototype,`tile`,void 0),e([i(I)],J.prototype,`hittestRequest`,void 0);export{J as AFeatureShader,K as BaseHittestVertexInput,q as FeatureFragmentInput,G as FeatureVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec4 as a,Vec2 as o,Vec3 as s,Float as c,ifElse as l,greaterThan as u}from"../../graph/glsl.js";import{BaseHittestVertexInput as d,FeatureFragmentInput as f,FeatureVertexInput as p,AFeatureShader as m}from"./AFeatureShader.js";import{noHit as h,trueHit as g}from"./constants.js";import{isRectHittest as _,hittestRect as v,isPolygonHittest as y,hittestPolygon as b,hittestFill as x,isPointHittest as S}from"./hittestUtils.js";import{VisualVariableColor as C}from"./VisualVariableColor.js";import{VisualVariableOpacity as w}from"./VisualVariableOpacity.js";import{getVisualVariableOpacity as T,getVisualVariableColor as E}from"./vvUtils.js";class D extends p{}e([n(3,a)],D.prototype,`color`,void 0),e([n(4,o)],D.prototype,`zoomRange`,void 0);class O extends m{constructor(){super(...arguments),this.type=`FillShader`,this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}vertex(e,t){let n=this.getFeatureId(e.id,e.bitset),r=T(this,n),i=E(this,n,e.color).multiply(r),o=this.tile.getDisplayViewScreenMat3(this.view).multiply(new s(this.getLabelPosition(e.pos.xy,e.id,e.bitset),1)),c=this.clip(e.id,e.bitset,e.zoomRange);return{glPosition:new a(o.xy,c,1),color:i,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new c(0))}hittest(e,t){let n=this.computeHittestTriangle(e,t,null);return l(S(this.hittestRequest),()=>{let n=x(this,e,t);return l(u(n,this.hittestRequest.distance),new c(h),new c(g))},()=>l(_(this.hittestRequest),v(n,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),l(y(this.hittestRequest),b(n,this.hittestRequest.viewSize,this.hittestMaskTexture),new c(h))))}}e([r(C)],O.prototype,`visualVariableColor`,void 0),e([r(w)],O.prototype,`visualVariableOpacity`,void 0),e([t(0,i(D)),t(1,i(d))],O.prototype,`vertex`,null),e([t(0,i(f))],O.prototype,`fragment`,null);export{O as FillShader,D as FillVertexInput};
2
+ import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec4 as a,Vec2 as o,Vec3 as s,Float as c,ifElse as l,greaterThan as u}from"../../graph/glsl.js";import{BaseHittestVertexInput as d,FeatureFragmentInput as f,FeatureVertexInput as p,AFeatureShader as m}from"./AFeatureShader.js";import{noHit as h,trueHit as g}from"./constants.js";import{isRectHittest as _,hittestRect as v,isPolygonHittest as y,hittestPolygon as b,hittestFill as x,isPointHittest as S}from"./hittestUtils.js";import{VisualVariableColor as C}from"./VisualVariableColor.js";import{VisualVariableOpacity as w}from"./VisualVariableOpacity.js";import{getVisualVariableOpacity as T,getVisualVariableColor as E}from"./vvUtils.js";class D extends p{}e([n(3,a)],D.prototype,`color`,void 0),e([n(4,o)],D.prototype,`zoomRange`,void 0);class O extends m{constructor(){super(...arguments),this.type=`FillShader`,this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}vertex(e,t){let n=this.getFeatureId(e.id,e.bitset),r=T(this,n),i=E(this,n,e.color).multiply(r),o=this.getCalloutPos(e.pos,e.id,e.bitset),c=this.getCalloutTransform(this.isLabelInstance(e.bitset)).multiply(new s(o,1)).xy,l=this.clip(e.id,e.bitset,e.zoomRange);return{glPosition:new a(c,l,1),color:i,...this.maybeRunHittest(e,t,null)}}fragment(e){return this.getFragmentOutput(e.color,e,new c(0))}hittest(e,t){let n=this.computeHittestTriangle(e,t,null);return l(S(this.hittestRequest),()=>{let n=x(this,e,t);return l(u(n,this.hittestRequest.distance),new c(h),new c(g))},()=>l(_(this.hittestRequest),v(n,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),l(y(this.hittestRequest),b(n,this.hittestRequest.viewSize,this.hittestMaskTexture),new c(h))))}}e([r(C)],O.prototype,`visualVariableColor`,void 0),e([r(w)],O.prototype,`visualVariableOpacity`,void 0),e([t(0,i(D)),t(1,i(d))],O.prototype,`vertex`,null),e([t(0,i(f))],O.prototype,`fragment`,null);export{O as FillShader,D as FillVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec4 as a,Vec2 as o,Float as s,step as c,min as l,ifElse as u,greaterThan as d,max as f,Vec3 as p,cond as m,lessThanEqual as h,length as g,clamp as _}from"../../graph/glsl.js";import{BaseHittestVertexInput as v,FeatureVertexInput as y,AFeatureShader as b,FeatureFragmentInput as x}from"./AFeatureShader.js";import{noHit as S,trueHit as C,epsilon as w,thinLineWidthFactor as T,thinLineHalfWidth as E}from"./constants.js";import{distPointSegment as D,isRectHittest as O,hittestMarkerRect as k,isPolygonHittest as A,hittestPolygon as j,isPointHittest as M}from"./hittestUtils.js";import{VisualVariableColor as N}from"./VisualVariableColor.js";import{VisualVariableOpacity as P}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as F}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as I}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as L}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as R}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as z,getVisualVariableOpacity as B,hasVisualVariableSize as V,getVisualVariableSize as H}from"./vvUtils.js";class U extends y{}e([n(3,a)],U.prototype,`color`,void 0),e([n(4,o)],U.prototype,`offset`,void 0),e([n(5,o)],U.prototype,`normal`,void 0),e([n(6,s)],U.prototype,`halfWidth`,void 0),e([n(7,s)],U.prototype,`referenceHalfWidth`,void 0),e([n(8,o)],U.prototype,`zoomRange`,void 0);class W extends x{}function G(e){return f(new s(T).multiply(c(e,new s(E))),new s(1))}function K(e,t){let{halfWidth:n,normal:r}=e,i=G(n),a=g(r).multiply(n);return _(i.multiply(n.subtract(a)).divide(t.add(i).subtract(new s(1))),new s(0),new s(1))}function q(e,t,n){let{halfWidth:r,referenceHalfWidth:i}=t;if(V(e)){let t=new s(2).multiply(i),a=H(e,n,t),o=new s(.5).multiply(a),c=new s(w);return m([h(r,c),o],[h(i,c),r],[!0,r.divide(f(i,c)).multiply(o)])}return r}function J(e,t){let{id:n,offset:r,pos:i,normal:o,zoomRange:l}=t,u=e.getFeatureId(n,t.bitset),d=e.view.getDisplayViewMat3(),m=e.tile.getDisplayViewScreenMat3(e.view),h=z(e,u,t.color),g=B(e,u),_=q(e,t,u),v=new s(.5).multiply(e.view.getAntialiasing()),y=f(_.add(v),new s(.45)).add(new s(.1).multiply(v)),b=G(y).multiply(y).multiply(r).multiply(e.tileInfo.scaleFactor),x=e.getLabelOffset(b,t.bitset),S=d.multiply(new p(x,new s(0))),C=m.multiply(new p(e.getLabelPosition(i,n,t.bitset),new s(1))).add(S),w=new s(2).multiply(c(_,new s(0))).add(e.clip(n,t.bitset,l)),T=new a(C.xy,w,1);return{color:h,opacity:g,halfWidth:y,normal:o,scaledOffset:b,scaledHalfWidth:_,glPosition:new a(T.xy,w,1)}}function Y(e,t){let{opacity:n,color:r}=e,i=K(e,t);return n.multiply(r).multiply(i)}class X extends b{constructor(){super(...arguments),this.type=`LineShader`,this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}vertex(e,t){let n=J(this,e);return{...n,...this.maybeRunHittest(e,t,n.halfWidth)}}fragment(e){let t=Y(e,this.view.getAntialiasing());return this.getFragmentOutput(t,e)}hittest(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,null),{distance:o,smallSymbolDistance:f,smallSymbolSizeThreshold:p}=this.hittestRequest,m=c(n,p.multiply(.5)).multiply(o.subtract(f)),h=this.hittestRequest.position,g=l(D(h,r,i),D(h,r,a)).subtract(n).add(m);return u(M(this.hittestRequest),u(d(g,o),new s(S),new s(C)),()=>u(O(this.hittestRequest),k({pos0:r,pos1:i,pos2:a},this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),u(A(this.hittestRequest),j({pos0:r,pos1:i,pos2:a},this.hittestRequest.viewSize,this.hittestMaskTexture),new s(S))))}}e([r(N)],X.prototype,`visualVariableColor`,void 0),e([r(P)],X.prototype,`visualVariableOpacity`,void 0),e([r(F)],X.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(I)],X.prototype,`visualVariableSizeScaleStops`,void 0),e([r(L)],X.prototype,`visualVariableSizeStops`,void 0),e([r(R)],X.prototype,`visualVariableSizeUnitValue`,void 0),e([t(0,i(U)),t(1,i(v))],X.prototype,`vertex`,null),e([t(0,i(W))],X.prototype,`fragment`,null);export{W as LineFragmentInput,X as LineShader,U as LineVertexInput,K as getLineAntialiasing,Y as getLineFragmentColor,G as getLineThinFactor,J as getLineVertexData};
2
+ import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec4 as a,Vec2 as o,Float as s,step as c,min as l,ifElse as u,greaterThan as d,max as f,Vec3 as p,cond as m,lessThanEqual as h,length as g,clamp as _}from"../../graph/glsl.js";import{BaseHittestVertexInput as v,FeatureVertexInput as y,AFeatureShader as b,FeatureFragmentInput as x}from"./AFeatureShader.js";import{noHit as S,trueHit as C,epsilon as w,thinLineWidthFactor as T,thinLineHalfWidth as E}from"./constants.js";import{distPointSegment as D,isRectHittest as O,hittestMarkerRect as k,isPolygonHittest as A,hittestPolygon as j,isPointHittest as M}from"./hittestUtils.js";import{VisualVariableColor as N}from"./VisualVariableColor.js";import{VisualVariableOpacity as P}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as F}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as I}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as L}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as R}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableColor as z,getVisualVariableOpacity as B,hasVisualVariableSize as V,getVisualVariableSize as H}from"./vvUtils.js";class U extends y{}e([n(3,a)],U.prototype,`color`,void 0),e([n(4,o)],U.prototype,`offset`,void 0),e([n(5,o)],U.prototype,`normal`,void 0),e([n(6,s)],U.prototype,`halfWidth`,void 0),e([n(7,s)],U.prototype,`referenceHalfWidth`,void 0),e([n(8,o)],U.prototype,`zoomRange`,void 0);class W extends x{}function G(e){return f(new s(T).multiply(c(e,new s(E))),new s(1))}function K(e,t){let{halfWidth:n,normal:r}=e,i=G(n),a=g(r).multiply(n);return _(i.multiply(n.subtract(a)).divide(t.add(i).subtract(new s(1))),new s(0),new s(1))}function q(e,t,n){let{halfWidth:r,referenceHalfWidth:i}=t;if(V(e)){let t=new s(2).multiply(i),a=H(e,n,t),o=new s(.5).multiply(a),c=new s(w);return m([h(r,c),o],[h(i,c),r],[!0,r.divide(f(i,c)).multiply(o)])}return r}function J(e,t){let{id:n,offset:r,pos:i,normal:o,zoomRange:l,bitset:d}=t,m=e.getFeatureId(n,t.bitset),h=z(e,m,t.color),g=B(e,m),_=q(e,t,m),v=new s(.5).multiply(e.view.getAntialiasing()),y=f(_.add(v),new s(.45)).add(new s(.1).multiply(v)),b=G(y).multiply(y).multiply(r).multiply(e.tileInfo.scaleFactor),x=e.isLabelInstance(d),S=e.getCalloutTransform(x),C=u(x,e.view.displayMat3,e.view.getDisplayViewMat3()),w=e.getCalloutPos(i,n,d),T=S.multiply(new p(w,1)),E=C.multiply(new p(b,0)),D=T.add(E).xy,O=new s(2).multiply(c(_,new s(0))).add(e.clip(n,t.bitset,l));return{color:h,opacity:g,halfWidth:y,normal:o,scaledOffset:b,scaledHalfWidth:_,glPosition:new a(D,O,1)}}function Y(e,t){let{opacity:n,color:r}=e,i=K(e,t);return n.multiply(r).multiply(i)}class X extends b{constructor(){super(...arguments),this.type=`LineShader`,this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}vertex(e,t){let n=J(this,e);return{...n,...this.maybeRunHittest(e,t,n.halfWidth)}}fragment(e){let t=Y(e,this.view.getAntialiasing());return this.getFragmentOutput(t,e)}hittest(e,t,n){let{pos0:r,pos1:i,pos2:a}=this.computeHittestTriangle(e,t,null),{distance:o,smallSymbolDistance:f,smallSymbolSizeThreshold:p}=this.hittestRequest,m=c(n,p.multiply(.5)).multiply(o.subtract(f)),h=this.hittestRequest.position,g=l(D(h,r,i),D(h,r,a)).subtract(n).add(m);return u(M(this.hittestRequest),u(d(g,o),new s(S),new s(C)),()=>u(O(this.hittestRequest),k({pos0:r,pos1:i,pos2:a},this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),u(A(this.hittestRequest),j({pos0:r,pos1:i,pos2:a},this.hittestRequest.viewSize,this.hittestMaskTexture),new s(S))))}}e([r(N)],X.prototype,`visualVariableColor`,void 0),e([r(P)],X.prototype,`visualVariableOpacity`,void 0),e([r(F)],X.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(I)],X.prototype,`visualVariableSizeScaleStops`,void 0),e([r(L)],X.prototype,`visualVariableSizeStops`,void 0),e([r(R)],X.prototype,`visualVariableSizeUnitValue`,void 0),e([t(0,i(U)),t(1,i(v))],X.prototype,`vertex`,null),e([t(0,i(W))],X.prototype,`fragment`,null);export{W as LineFragmentInput,X as LineShader,U as LineVertexInput,K as getLineAntialiasing,Y as getLineFragmentColor,G as getLineThinFactor,J as getLineVertexData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec2 as a,Vec4 as o,Float as s,greaterThan as c,ifElse as l,or as u,Vec3 as d}from"../../graph/glsl.js";import{BaseHittestVertexInput as f,FeatureVertexInput as p,AFeatureShader as m}from"./AFeatureShader.js";import{noHit as h,trueHit as g,bitsetTypeFillOutline as _,bitsetOutlineUsesColorVV as v}from"./constants.js";import{isRectHittest as y,hittestRect as b,isPolygonHittest as x,hittestPolygon as S,hittestFill as C,isPointHittest as w}from"./hittestUtils.js";import{getLineFragmentColor as T,LineFragmentInput as E,getLineVertexData as D}from"./LineShader.js";import{getBit as O,getBitBool as k}from"./utils.js";import{VisualVariableColor as A}from"./VisualVariableColor.js";import{VisualVariableOpacity as j}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as M}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as N}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as P}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as F}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as I,getVisualVariableColor as L}from"./vvUtils.js";class R extends p{}e([n(3,a)],R.prototype,`offset`,void 0),e([n(4,o)],R.prototype,`color`,void 0),e([n(5,a)],R.prototype,`normal`,void 0),e([n(6,s)],R.prototype,`halfWidth`,void 0),e([n(7,s)],R.prototype,`referenceHalfWidth`,void 0),e([n(8,a)],R.prototype,`zoomRange`,void 0);class z extends E{}function B(e,t,n){let{id:r,bitset:i}=t,a=O(i,_),u=c(a,new s(.5)),f=D(e,t),p=l(u,f.halfWidth,new s(0)),m=e.getFeatureId(r,i),h=I(e,m),g=L(e,m,t.color),y=l(u,l(k(i,v),g,t.color),g.multiply(h)),b=e.tile.getDisplayViewScreenMat3(e.view).multiply(new d(e.getLabelPosition(t.pos.xy,t.id,t.bitset),1)),x=e.clip(t.id,t.bitset,t.zoomRange),S=new o(b.xy,x,1),C=l(u,f.glPosition,S),w=n&&e.maybeRunHittest(t,n,u);return{isOutline:a,color:y,opacity:new s(1),halfWidth:p,normal:f.normal,glPosition:C,...w}}class V extends m{constructor(){super(...arguments),this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}}e([r(A)],V.prototype,`visualVariableColor`,void 0),e([r(j)],V.prototype,`visualVariableOpacity`,void 0),e([r(M)],V.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(N)],V.prototype,`visualVariableSizeScaleStops`,void 0),e([r(P)],V.prototype,`visualVariableSizeStops`,void 0),e([r(F)],V.prototype,`visualVariableSizeUnitValue`,void 0);class H extends V{constructor(){super(...arguments),this.type=`OutlineFillShader`}vertex(e,t){return B(this,e,t)}fragment(e){let{color:t,isOutline:n}=e,r=c(n,new s(.5)),i=T(e,this.view.getAntialiasing()),a=l(r,i,t),o=l(r,new s(1/255),new s(0));return this.getFragmentOutput(a,e,o)}hittest(e,t,n){let r=this.computeHittestTriangle(e,t,null);return l(w(this.hittestRequest),()=>{let r=C(this,e,t);return l(u(n,c(r,this.hittestRequest.distance)),new s(h),new s(g))},()=>l(y(this.hittestRequest),b(r,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),l(x(this.hittestRequest),S(r,this.hittestRequest.viewSize,this.hittestMaskTexture),new s(h))))}}e([t(0,i(R)),t(1,i(f))],H.prototype,`vertex`,null),e([t(0,i(z))],H.prototype,`fragment`,null);export{V as AOutlineFillShader,z as OutlineFillFragmentInput,H as OutlineFillShader,R as OutlineFillVertexInput,B as getOutlineFillVertexData};
2
+ import{__decorate as e,__param as t}from"tslib";import{location as n,option as r,input as i}from"../../GraphShaderModule.js";import{Vec2 as a,Vec4 as o,Float as s,greaterThan as c,ifElse as l,or as u,Vec3 as d}from"../../graph/glsl.js";import{BaseHittestVertexInput as f,FeatureVertexInput as p,AFeatureShader as m}from"./AFeatureShader.js";import{noHit as h,trueHit as g,bitsetTypeFillOutline as _,bitsetOutlineUsesColorVV as v}from"./constants.js";import{isRectHittest as y,hittestRect as b,isPolygonHittest as x,hittestPolygon as S,hittestFill as C,isPointHittest as w}from"./hittestUtils.js";import{getLineFragmentColor as T,LineFragmentInput as E,getLineVertexData as D}from"./LineShader.js";import{getBit as O,getBitBool as k}from"./utils.js";import{VisualVariableColor as A}from"./VisualVariableColor.js";import{VisualVariableOpacity as j}from"./VisualVariableOpacity.js";import{VisualVariableSizeMinMaxValue as M}from"./VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as N}from"./VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as P}from"./VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as F}from"./VisualVariableSizeUnitValue.js";import{getVisualVariableOpacity as I,getVisualVariableColor as L}from"./vvUtils.js";class R extends p{}e([n(3,a)],R.prototype,`offset`,void 0),e([n(4,o)],R.prototype,`color`,void 0),e([n(5,a)],R.prototype,`normal`,void 0),e([n(6,s)],R.prototype,`halfWidth`,void 0),e([n(7,s)],R.prototype,`referenceHalfWidth`,void 0),e([n(8,a)],R.prototype,`zoomRange`,void 0);class z extends E{}function B(e,t,n){let{pos:r,id:i,bitset:a}=t,u=O(a,_),f=c(u,new s(.5)),p=D(e,t),m=l(f,p.halfWidth,new s(0)),h=e.getFeatureId(i,a),g=I(e,h),y=L(e,h,t.color),b=l(f,l(k(a,v),y,t.color),y.multiply(g)),x=e.getCalloutTransform(e.isLabelInstance(a)).multiply(new d(e.getCalloutPos(r.xy,i,a),1)).xy,S=e.clip(t.id,t.bitset,t.zoomRange),C=new o(x,S,1),w=l(f,p.glPosition,C),T=n&&e.maybeRunHittest(t,n,f);return{isOutline:u,color:b,opacity:new s(1),halfWidth:m,normal:p.normal,glPosition:w,...T}}class V extends m{constructor(){super(...arguments),this.computeAttributes={pos:[`nextPos1`,`nextPos2`]}}}e([r(A)],V.prototype,`visualVariableColor`,void 0),e([r(j)],V.prototype,`visualVariableOpacity`,void 0),e([r(M)],V.prototype,`visualVariableSizeMinMaxValue`,void 0),e([r(N)],V.prototype,`visualVariableSizeScaleStops`,void 0),e([r(P)],V.prototype,`visualVariableSizeStops`,void 0),e([r(F)],V.prototype,`visualVariableSizeUnitValue`,void 0);class H extends V{constructor(){super(...arguments),this.type=`OutlineFillShader`}vertex(e,t){return B(this,e,t)}fragment(e){let{color:t,isOutline:n}=e,r=c(n,new s(.5)),i=T(e,this.view.getAntialiasing()),a=l(r,i,t),o=l(r,new s(1/255),new s(0));return this.getFragmentOutput(a,e,o)}hittest(e,t,n){let r=this.computeHittestTriangle(e,t,null);return l(w(this.hittestRequest),()=>{let r=C(this,e,t);return l(u(n,c(r,this.hittestRequest.distance)),new s(h),new s(g))},()=>l(y(this.hittestRequest),b(r,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),l(x(this.hittestRequest),S(r,this.hittestRequest.viewSize,this.hittestMaskTexture),new s(h))))}}e([t(0,i(R)),t(1,i(f))],H.prototype,`vertex`,null),e([t(0,i(z))],H.prototype,`fragment`,null);export{V as AOutlineFillShader,z as OutlineFillFragmentInput,H as OutlineFillShader,R as OutlineFillVertexInput,B as getOutlineFillVertexData};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e,__param as t}from"tslib";import{labelU16ZoomPrecisionFactor as n,labelPlacementOffsetPadding as r,packDegreesU8 as i}from"../../../definitions.js";import{location as a,option as o,uniform as s,texture as c,define as l,input as u,ComputeVertexInput as d}from"../../GraphShaderModule.js";import{Vec4 as f,Vec2 as p,Float as m,Sampler2D as h,mod as g,floor as _,step as v,and as y,lessThan as b,greaterThanEqual as x,Vec3 as S,Mat3 as ee,equal as C,ifElse as w,greaterThan as T,Bool as E,texture2D as D,smoothstep as O,Int as k,bitRShift as A,bitAnd as j}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as te,FeatureFragmentInput as N}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as ne,bitsetTextIsMapAligned as P,noHit as F,trueHit as re}from"../shaders/constants.js";import{isPointHittest as ie,distPointTriangle as ae,isRectHittest as I,hittestRect as L,isPolygonHittest as R,hittestLabelPolygon as z,hittestPolygon as B}from"../shaders/hittestUtils.js";import{MosaicInfo as V}from"../shaders/MosaicInfo.js";import{getBit as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as oe}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as se}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as J,getVisualVariableRotation as Y}from"../shaders/vvUtils.js";const ce=1/i;class X extends M{}e([a(3,f)],X.prototype,`color`,void 0),e([a(4,p)],X.prototype,`offset`,void 0),e([a(5,p)],X.prototype,`textureUV`,void 0),e([a(6,f)],X.prototype,`fontAndReferenceSize`,void 0),e([a(7,f)],X.prototype,`outlineColor`,void 0),e([a(8,f)],X.prototype,`haloColor`,void 0),e([a(9,p)],X.prototype,`outlineAndHaloSize`,void 0),e([a(10,p)],X.prototype,`zoomRange`,void 0),e([a(11,m)],X.prototype,`clipAngle`,void 0),e([a(12,f)],X.prototype,`referenceSymbol`,void 0);class Z extends d{}e([a(13,p)],Z.prototype,`offsetNextVertex1`,void 0),e([a(14,p)],Z.prototype,`offsetNextVertex2`,void 0);class Q extends N{}class $ extends te{constructor(){super(...arguments),this.type=`TextShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t){let{clipAngle:r,zoomRange:i}=e,a=r.multiply(ce),o=g(a.subtract(this.view.getRotation()),new m(360)),s=new m(0),c=n,l=_(this.tileInfo.currentZoom.multiply(c)).divide(c),u=i.x,d=i.y,f=new m(1).subtract(v(u,l)).multiply(2),p=new m(y(x(o,new m(90)),b(o,new m(270)))).multiply(2),h=new m(2).multiply(new m(1).subtract(v(l,d)));return s=s.add(t.multiply(f)),s=s.add(t.multiply(p)),s=s.add(h),s=s.add(new m(2).multiply(this.getLabelHidden(e.id,e.bitset))),s}vertex(e,t){let n=H(e.bitset,ne),i=new m(1).subtract(n),a=this.getFeatureId(e.id,e.bitset),o=e.fontAndReferenceSize[0],s=e.fontAndReferenceSize[1],c=e.fontAndReferenceSize[2],l=e.fontAndReferenceSize[3],u=o.divide(c),d=this.textRenderPassType===1?e.outlineColor:this.textRenderPassType===2?e.haloColor:this._getVertexColor(e,a),h=this.tile.getDisplayViewScreenMat3(this.view).multiply(new S(e.pos,1)),g=e.offset,_=new m(1),v=ee.identity(),y=new p(0);if(this.isLabel){if(!e.referenceSymbol)throw Error(`InternalError: Optional attribute 'referenceSymbol' expected for labels`);let t=e.referenceSymbol,n=t.xy,i=t.z,o=this._unpackDirection(t.w),s=this.getLabelReferenceSymbolVVOffset(e.id),c=C(s.x,new m(0)).and(C(s.y,new m(0))),l=w(c,J(this,a,i).divide(2),i.divide(2)),u=o.multiply(l.add(r)).add(s);y=n.add(u),g=g.add(y)}else _=J(this,a,s).divide(s),o=o.multiply(_),u=u.multiply(_),g=g.multiply(_),v=Y(this,a),g=v.multiply(new S(g,0)).xy;let b=H(e.bitset,P),x=this._getViewRotationMatrix(b).multiply(new S(g,0)).multiply(this.tileInfo.scaleFactor),D=this.isLabel?this.clipLabel(e,b):this.clip(e.id,e.bitset,e.zoomRange);D=this.isBackgroundPass?D.add(i.multiply(2)):D.add(n.multiply(2));let O=new m(0);if(this.textRenderPassType===1&&(D=D.add(w(C(e.outlineAndHaloSize.x,new m(0)),new m(2),new m(0))),O=new m(e.outlineAndHaloSize.x).divide(u).divide(l)),this.textRenderPassType===2){let t=e.outlineAndHaloSize.x,n=new m(e.outlineAndHaloSize.y);D=D.add(w(C(n,new m(0)),new m(2),new m(0))),O=n.add(t).divide(u).divide(l)}let k=this.isLabel?T(D,new m(1)):new E(!1),A=new f(h.xy.add(x.xy),D,1),j=e.textureUV.divide(this.mosaicInfo.size),M=new m(.105).multiply(c).divide(o).divide(this.view.pixelRatio);return{glPosition:A,color:d,size:u,textureUV:j,antialiasingWidth:M,outlineDistanceOffset:O,...this.maybeRunHittest(e,t,{vvSizeAdjustment:_,vvRotation:v,labelOffset:y,labelClipped:k,scaleFactor:this.tileInfo.scaleFactor})}}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new m(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getHittestAlignmentMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new m(1).subtract(e);return n.multiply(e).add(r.multiply(i))}fragment(e){let t=new m(2/8),n=new m(1).subtract(t),r=D(this.mosaicTexture,e.textureUV).a,i=n.subtract(e.outlineDistanceOffset);this.highlight&&(i=i.divide(2));let a=e.antialiasingWidth,o=O(i.subtract(a),i.add(a),r);return this.getFragmentOutput(e.color.multiply(o),e)}computeHittestTriangle(e,t,{vvSizeAdjustment:n,vvRotation:r,labelOffset:i,scaleFactor:a}){let o,s,c;this.isLabel?(o=new S(e.offset.multiply(a).add(i),0),s=new S(t.offsetNextVertex1.multiply(a).add(i),0),c=new S(t.offsetNextVertex2.multiply(a).add(i),0)):(o=r.multiply(new S(e.offset.multiply(a).multiply(n),0)),s=r.multiply(new S(t.offsetNextVertex1.multiply(a).multiply(n),0)),c=r.multiply(new S(t.offsetNextVertex2.multiply(a).multiply(n),0)));let l=this.tile.getViewScreenMat3(this.view).multiply(new S(e.pos,1)),u=H(e.bitset,P),d=this._getHittestAlignmentMatrix(u);return{pos0:l.add(d.multiply(o)).xy,pos1:l.add(d.multiply(s)).xy,pos2:l.add(d.multiply(c)).xy}}hittest(e,t,n){let{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,labelClipped:o,scaleFactor:s}=n,{pos0:c,pos1:l,pos2:u}=this.computeHittestTriangle(e,t,{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,scaleFactor:s}),d={pos0:c,pos1:l,pos2:u},f=this.isLabel?o:new E(!1);return w(f,new m(F),()=>w(ie(this.hittestRequest),()=>{let e=ae(this.hittestRequest.position,c,l,u);return w(T(e,this.hittestRequest.distance),new m(F),new m(re))},()=>w(I(this.hittestRequest),L(d,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),w(R(this.hittestRequest),this.isLabel?z(d,this.hittestRequest.viewSize,this.hittestMaskTexture):B(d,this.hittestRequest.viewSize,this.hittestMaskTexture),new m(F)))))}_unpackDirection(e){let t=new k(e),n=A(t,new k(2)),r=j(t,new k(3));return new p(new m(n).subtract(1),new m(r).subtract(1))}_getVertexColor(e,t){let n=e.color;if(this.visualVariableColor){let r=this.getColorValue(t);n=this.visualVariableColor.getColor(r,e.color,new E(!1))}if(this.visualVariableOpacity){let e=this.getOpacityValue(t),r=this.visualVariableOpacity.getOpacity(e);n=n.multiply(r)}return n}}e([o(U)],$.prototype,`visualVariableColor`,void 0),e([o(W)],$.prototype,`visualVariableOpacity`,void 0),e([o(G)],$.prototype,`visualVariableRotation`,void 0),e([o(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([o(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([o(oe)],$.prototype,`visualVariableSizeStops`,void 0),e([o(se)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([s(V)],$.prototype,`mosaicInfo`,void 0),e([c(h)],$.prototype,`mosaicTexture`,void 0),e([l],$.prototype,`textRenderPassType`,void 0),e([l],$.prototype,`isBackgroundPass`,void 0),e([l],$.prototype,`isLabel`,void 0),e([t(0,u(X)),t(1,u(Z))],$.prototype,`vertex`,null),e([t(0,u(Q))],$.prototype,`fragment`,null);export{Q as TextFragmentInput,$ as TextShader,X as TextVertexInput};
2
+ import{__decorate as e,__param as t}from"tslib";import{labelU16ZoomPrecisionFactor as n,labelPlacementOffsetPadding as r,packDegreesU8 as i}from"../../../definitions.js";import{location as a,option as o,uniform as s,texture as c,define as l,input as u,ComputeVertexInput as d}from"../../GraphShaderModule.js";import{Vec4 as f,Vec2 as p,Float as m,Sampler2D as h,mod as g,floor as _,step as v,and as y,lessThan as b,greaterThanEqual as x,Vec3 as S,Mat3 as ee,equal as C,ifElse as w,greaterThan as T,Bool as E,texture2D as D,smoothstep as O,Int as k,bitRShift as A,bitAnd as j}from"../../graph/glsl.js";import{FeatureVertexInput as M,AFeatureShader as te,FeatureFragmentInput as N}from"../shaders/AFeatureShader.js";import{bitsetTextIsBackground as ne,bitsetTextIsMapAligned as P,noHit as F,trueHit as re}from"../shaders/constants.js";import{isPointHittest as ie,distPointTriangle as ae,isRectHittest as I,hittestRect as L,isPolygonHittest as R,hittestLabelPolygon as z,hittestPolygon as B}from"../shaders/hittestUtils.js";import{MosaicInfo as V}from"../shaders/MosaicInfo.js";import{getBit as H}from"../shaders/utils.js";import{VisualVariableColor as U}from"../shaders/VisualVariableColor.js";import{VisualVariableOpacity as W}from"../shaders/VisualVariableOpacity.js";import{VisualVariableRotation as G}from"../shaders/VisualVariableRotation.js";import{VisualVariableSizeMinMaxValue as K}from"../shaders/VisualVariableSizeMinMaxValue.js";import{VisualVariableSizeScaleStops as q}from"../shaders/VisualVariableSizeScaleStops.js";import{VisualVariableSizeStops as oe}from"../shaders/VisualVariableSizeStops.js";import{VisualVariableSizeUnitValue as se}from"../shaders/VisualVariableSizeUnitValue.js";import{getVisualVariableSize as J,getVisualVariableRotation as Y}from"../shaders/vvUtils.js";const ce=1/i;class X extends M{}e([a(3,f)],X.prototype,`color`,void 0),e([a(4,p)],X.prototype,`offset`,void 0),e([a(5,p)],X.prototype,`textureUV`,void 0),e([a(6,f)],X.prototype,`fontAndReferenceSize`,void 0),e([a(7,f)],X.prototype,`outlineColor`,void 0),e([a(8,f)],X.prototype,`haloColor`,void 0),e([a(9,p)],X.prototype,`outlineAndHaloSize`,void 0),e([a(10,p)],X.prototype,`zoomRange`,void 0),e([a(11,m)],X.prototype,`clipAngle`,void 0),e([a(12,f)],X.prototype,`referenceSymbol`,void 0);class Z extends d{}e([a(13,p)],Z.prototype,`offsetNextVertex1`,void 0),e([a(14,p)],Z.prototype,`offsetNextVertex2`,void 0);class Q extends N{}class $ extends te{constructor(){super(...arguments),this.type=`TextShader`,this.computeAttributes={offset:[`offsetNextVertex1`,`offsetNextVertex2`]},this.textRenderPassType=0,this.isBackgroundPass=!1,this.isLabel=!1}clipLabel(e,t){let{clipAngle:r,zoomRange:i}=e,a=r.multiply(ce),o=g(a.subtract(this.view.getRotation()),new m(360)),s=new m(0),c=n,l=_(this.tileInfo.currentZoom.multiply(c)).divide(c),u=i.x,d=i.y,f=new m(1).subtract(v(u,l)).multiply(2),p=new m(y(x(o,new m(90)),b(o,new m(270)))).multiply(2),h=new m(2).multiply(new m(1).subtract(v(l,d)));return s=s.add(t.multiply(f)),s=s.add(t.multiply(p)),s=s.add(h),s=s.add(new m(2).multiply(this.getLabelHidden(e.id,e.bitset))),s}vertex(e,t){let n=H(e.bitset,ne),i=new m(1).subtract(n),a=this.getFeatureId(e.id,e.bitset),o=e.fontAndReferenceSize[0],s=e.fontAndReferenceSize[1],c=e.fontAndReferenceSize[2],l=e.fontAndReferenceSize[3],u=o.divide(c),d=this.textRenderPassType===1?e.outlineColor:this.textRenderPassType===2?e.haloColor:this._getVertexColor(e,a),h=this.getCalloutTransform(this.isAnchoredLabel(e.bitset)).multiply(new S(this.getLabelTextPos(e.pos,e.id,e.bitset),1)).xy,g=e.offset,_=new m(1),v=ee.identity(),y=new p(0);if(this.isLabel){if(!e.referenceSymbol)throw Error(`InternalError: Optional attribute 'referenceSymbol' expected for labels`);let t=e.referenceSymbol,n=t.xy,i=t.z,o=this._unpackDirection(t.w),s=this.getLabelReferenceSymbolVVOffset(e.id),c=C(s.x,new m(0)).and(C(s.y,new m(0))),l=w(c,J(this,a,i).divide(2),i.divide(2)),u=o.multiply(l.add(r)).add(s);y=n.add(u),g=g.add(y)}else _=J(this,a,s).divide(s),o=o.multiply(_),u=u.multiply(_),g=g.multiply(_),v=Y(this,a),g=v.multiply(new S(g,0)).xy;let b=H(e.bitset,P),x=this._getViewRotationMatrix(b).multiply(new S(g,0)).multiply(this.tileInfo.scaleFactor).xy,D=this.isLabel?this.clipLabel(e,b):this.clip(e.id,e.bitset,e.zoomRange);D=this.isBackgroundPass?D.add(i.multiply(2)):D.add(n.multiply(2));let O=new m(0);if(this.textRenderPassType===1&&(D=D.add(w(C(e.outlineAndHaloSize.x,new m(0)),new m(2),new m(0))),O=new m(e.outlineAndHaloSize.x).divide(u).divide(l)),this.textRenderPassType===2){let t=e.outlineAndHaloSize.x,n=new m(e.outlineAndHaloSize.y);D=D.add(w(C(n,new m(0)),new m(2),new m(0))),O=n.add(t).divide(u).divide(l)}let k=this.isLabel?T(D,new m(1)):new E(!1),A=new f(h.add(x),D,1),j=e.textureUV.divide(this.mosaicInfo.size),M=new m(.105).multiply(c).divide(o).divide(this.view.pixelRatio);return{glPosition:A,color:d,size:u,textureUV:j,antialiasingWidth:M,outlineDistanceOffset:O,...this.maybeRunHittest(e,t,{vvSizeAdjustment:_,vvRotation:v,labelOffset:y,labelClipped:k,scaleFactor:this.tileInfo.scaleFactor})}}_getViewRotationMatrix(e){let t=this.view.getDisplayViewMat3(),n=this.view.displayMat3,r=new m(1).subtract(e);return t.multiply(e).add(n.multiply(r))}_getHittestAlignmentMatrix(e){let t=this.tile.getTileMat3(this.view),n=this.view.viewMat3.multiply(t),r=t,i=new m(1).subtract(e);return n.multiply(e).add(r.multiply(i))}fragment(e){let t=new m(2/8),n=new m(1).subtract(t),r=D(this.mosaicTexture,e.textureUV).a,i=n.subtract(e.outlineDistanceOffset);this.highlight&&(i=i.divide(2));let a=e.antialiasingWidth,o=O(i.subtract(a),i.add(a),r);return this.getFragmentOutput(e.color.multiply(o),e)}computeHittestTriangle(e,t,{vvSizeAdjustment:n,vvRotation:r,labelOffset:i,scaleFactor:a}){let o,s,c;this.isLabel?(o=new S(e.offset.multiply(a).add(i),0),s=new S(t.offsetNextVertex1.multiply(a).add(i),0),c=new S(t.offsetNextVertex2.multiply(a).add(i),0)):(o=r.multiply(new S(e.offset.multiply(a).multiply(n),0)),s=r.multiply(new S(t.offsetNextVertex1.multiply(a).multiply(n),0)),c=r.multiply(new S(t.offsetNextVertex2.multiply(a).multiply(n),0)));let l=this.tile.getViewScreenMat3(this.view).multiply(new S(e.pos,1)),u=H(e.bitset,P),d=this._getHittestAlignmentMatrix(u);return{pos0:l.add(d.multiply(o)).xy,pos1:l.add(d.multiply(s)).xy,pos2:l.add(d.multiply(c)).xy}}hittest(e,t,n){let{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,labelClipped:o,scaleFactor:s}=n,{pos0:c,pos1:l,pos2:u}=this.computeHittestTriangle(e,t,{vvSizeAdjustment:r,vvRotation:i,labelOffset:a,scaleFactor:s}),d={pos0:c,pos1:l,pos2:u},f=this.isLabel?o:new E(!1);return w(f,new m(F),()=>w(ie(this.hittestRequest),()=>{let e=ae(this.hittestRequest.position,c,l,u);return w(T(e,this.hittestRequest.distance),new m(F),new m(re))},()=>w(I(this.hittestRequest),L(d,this.hittestRequest.rect.xy,this.hittestRequest.rect.zw),w(R(this.hittestRequest),this.isLabel?z(d,this.hittestRequest.viewSize,this.hittestMaskTexture):B(d,this.hittestRequest.viewSize,this.hittestMaskTexture),new m(F)))))}_unpackDirection(e){let t=new k(e),n=A(t,new k(2)),r=j(t,new k(3));return new p(new m(n).subtract(1),new m(r).subtract(1))}_getVertexColor(e,t){let n=e.color;if(this.visualVariableColor){let r=this.getColorValue(t);n=this.visualVariableColor.getColor(r,e.color,new E(!1))}if(this.visualVariableOpacity){let e=this.getOpacityValue(t),r=this.visualVariableOpacity.getOpacity(e);n=n.multiply(r)}return n}}e([o(U)],$.prototype,`visualVariableColor`,void 0),e([o(W)],$.prototype,`visualVariableOpacity`,void 0),e([o(G)],$.prototype,`visualVariableRotation`,void 0),e([o(K)],$.prototype,`visualVariableSizeMinMaxValue`,void 0),e([o(q)],$.prototype,`visualVariableSizeScaleStops`,void 0),e([o(oe)],$.prototype,`visualVariableSizeStops`,void 0),e([o(se)],$.prototype,`visualVariableSizeUnitValue`,void 0),e([s(V)],$.prototype,`mosaicInfo`,void 0),e([c(h)],$.prototype,`mosaicTexture`,void 0),e([l],$.prototype,`textRenderPassType`,void 0),e([l],$.prototype,`isBackgroundPass`,void 0),e([l],$.prototype,`isLabel`,void 0),e([t(0,u(X)),t(1,u(Z))],$.prototype,`vertex`,null),e([t(0,u(Q))],$.prototype,`fragment`,null);export{Q as TextFragmentInput,$ as TextShader,X as TextVertexInput};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{FeatureMatcher as e,combineMeshWriterGroups as t}from"./Matcher.js";class n extends e{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,r){let i=await e.storage.createComputedField(r),a=new n(i,r.isMaxInclusive);await Promise.all(r.intervals.map(async n=>{let r=await e.createMeshWriters(n.meshes),i=await e.createMeshWriters(n.alternateMeshes),o=t(r,i);a.add(n,o)}));let o=await e.createMeshWriters(r.defaultSymbol);a.setDefault(o);let s=await e.createMeshWriters(r.backgroundFill);return a.setBackgroundFill(s),a}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((e,t)=>e.interval.min-t.interval.min)}size(){return super.size()+this._intervals.length}hasArcadeDependency(e){return this._field?.hasArcadeDependency(e)||this._intervals.some(t=>t.result.writers.some(t=>t.hasArcadeDependency(e)))}doMatch(e,t,n){let r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let e=0;e<this._intervals.length;e++){let{interval:t,result:n}=this._intervals[e],i=r>=t.min,a=this._isMaxInclusive?r<=t.max:r<t.max;if(i&&a)return n}return null}}export{n as IntervalMatcher};
2
+ import{FeatureMatcher as e,combineMeshWriterGroups as t}from"./Matcher.js";class n extends e{constructor(e,t){super(),this._intervals=[],this._isMaxInclusive=t,this._field=e}static async fromIntervalSchema(e,r){let i=await e.storage.createComputedField(r),a=new n(i,r.isMaxInclusive),o=await Promise.all(r.intervals.map(async n=>{let r=await e.createMeshWriters(n.meshes),i=await e.createMeshWriters(n.alternateMeshes);return t(r,i)}));for(let e=0;e<r.intervals.length;e++)a.add(r.intervals[e],o[e]);let s=await e.createMeshWriters(r.defaultSymbol);a.setDefault(s);let c=await e.createMeshWriters(r.backgroundFill);return a.setBackgroundFill(c),a}add(e,t){this._intervals.push({interval:e,result:t}),this._intervals.sort((e,t)=>e.interval.min-t.interval.min)}size(){return super.size()+this._intervals.length}hasArcadeDependency(e){return this._field?.hasArcadeDependency(e)||this._intervals.some(t=>t.result.writers.some(t=>t.hasArcadeDependency(e)))}doMatch(e,t,n){let r=this._field?.read(e,t);if(r==null||isNaN(r)||r===1/0||r===-1/0)return null;for(let e=0;e<this._intervals.length;e++){let{interval:t,result:n}=this._intervals[e],i=r>=t.min,a=this._isMaxInclusive?r<=t.max:r<t.max;if(i&&a)return n}return null}}export{n as IntervalMatcher};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{equals as n}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{mapCollection as o}from"../../core/mapCollectionUtils.js";import{isPromiseLike as s}from"../../core/promiseUtils.js";import{watch as c,initial as l}from"../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import p from"../../geometry/Point.js";import{polygonToVolume as m}from"./focusAreaUtils.js";import{ElevationContext as h}from"./layers/graphics/ElevationContext.js";import{FocusArea as g}from"./webgl-engine/effects/focusArea/FocusArea.js";import{FocusAreaMask as _}from"./webgl-engine/effects/focusArea/FocusAreaMask.js";import{FocusAreaOutlineItem as v}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";let y=class extends t{get updating(){return this._updatingHandles.updating||!!this._outlineMap?.some(e=>e.updating)}constructor(e){super(e),this._updatingHandles=new f,this._elevationContext=new h,this._previousVolumes=new Map,this._outlineMap=new r}initialize(){this.addHandles([c(()=>({volumes:this.volumes,ready:this.view.groundView?.ready}),({volumes:e,ready:t})=>{this._previousVolumes=e,t&&(e.size!==0&&this._mask?.updateGeometries(),this._ensureRenderNodes())},l)]),this._outlineMap=o(()=>this.areas?.areas,e=>new v({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy(),this._updatingHandles.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??`bright`}get polygons(){return this.enabledAreas.reduce((e,t)=>e.concat(t.geometries.toArray()),[])}containsGeometry(e){if(this.polygons.length===0)return!0;let t=new p(e);return this.polygons.some(e=>e.contains(t))}get volumes(){let e=this.polygons,t=this._previousVolumes;if(n(Array.from(t?.keys()??[]),e))return t??new Map;let r=new Map;for(let n of e){let e=t?.get(n);if(e)r.set(n,e);else try{let e=m(n,this.view,this._elevationContext);if(e==null)continue;if(s(e)){this._updatingHandles.consumePromise(e);continue}r.set(n,e)}catch(e){a.getLogger(this).error(new i(`focusareasview:projection-failed`,`Failed to project focus area geometry to view spatial reference`,{geometry:n,error:e}))}}return r}_ensureRenderNodes(){if(this.view.stage){if(this.volumes.size===0){let{_mask:e,_visualization:t}=this;this._mask=this._visualization=null,t?.fadeOut(()=>{e?.destroy(),t?.destroy()})}else this._mask??=new _({focusAreasView:this}),this._visualization??=new g({focusAreasView:this}),this.view.stage.renderView.requestRender()}}};e([u()],y.prototype,`updating`,null),e([u({readOnly:!0})],y.prototype,`volumes`,null),e([u({constructOnly:!0})],y.prototype,`view`,void 0),y=e([d(`esri.views.3d.FocusAreasView`)],y);export{y as FocusAreasView};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{equals as n}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{mapCollection as o}from"../../core/mapCollectionUtils.js";import{isPromiseLike as s}from"../../core/promiseUtils.js";import{watch as c,initial as l}from"../../core/reactiveUtils.js";import{property as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../core/support/UpdatingHandles.js";import p from"../../geometry/Point.js";import{polygonToVolume as m}from"./focusAreaUtils.js";import{ElevationContext as h}from"./layers/graphics/ElevationContext.js";import{FocusArea as g}from"./webgl-engine/effects/focusArea/FocusArea.js";import{FocusAreaMask as _}from"./webgl-engine/effects/focusArea/FocusAreaMask.js";import{FocusAreaOutlineItem as v}from"./webgl-engine/effects/focusArea/FocusAreaOutlineItem.js";let y=class extends t{get updating(){return this._updatingHandles.updating||!!this._outlineMap?.some(e=>e.updating)}constructor(e){super(e),this._updatingHandles=new f,this._elevationContext=new h,this._outlineMap=new r}initialize(){this.addHandles([c(()=>({volumes:this.volumes,ready:this.view.groundView?.ready}),({volumes:e,ready:t})=>{t&&(e.size!==0&&this._mask?.updateGeometries(),this._ensureRenderNodes())},l)]),this._outlineMap=o(()=>this.areas?.areas,e=>new v({area:e,view:this.view}),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.destroy(),this._updatingHandles.destroy()}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter(({enabled:e})=>e)??[]}get style(){return this.areas?.style??`bright`}get polygons(){return this.enabledAreas.reduce((e,t)=>e.concat(t.geometries.toArray()),[])}containsGeometry(e){if(this.polygons.length===0)return!0;let t=new p(e);return this.polygons.some(e=>e.contains(t))}get volumes(){let e=this.polygons,t=this._get(`volumes`);if(n(Array.from(t?.keys()??[]),e))return t??new Map;let r=new Map;for(let n of e){let e=t?.get(n);if(e)r.set(n,e);else try{let e=m(n,this.view,this._elevationContext);if(e==null)continue;if(s(e)){this._updatingHandles.consumePromise(e);continue}r.set(n,e)}catch(e){a.getLogger(this).error(new i(`focusareasview:projection-failed`,`Failed to project focus area geometry to view spatial reference`,{geometry:n,error:e}))}}return r}_ensureRenderNodes(){if(this.view.stage){if(this.volumes.size===0){let{_mask:e,_visualization:t}=this;this._mask=this._visualization=null,t?.fadeOut(()=>{e?.destroy(),t?.destroy()})}else this._mask??=new _({focusAreasView:this}),this._visualization??=new g({focusAreasView:this}),this.view.stage.renderView.requestRender()}}};e([u()],y.prototype,`updating`,null),e([u()],y.prototype,`volumes`,null),e([u({constructOnly:!0})],y.prototype,`view`,void 0),y=e([d(`esri.views.3d.FocusAreasView`)],y);export{y as FocusAreasView};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as n,watch as r,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import d from"../GroundView.js";import{ElevationRange as f}from"./support/ElevationRange.js";import{toBoundingRect as p}from"./support/extentUtils.js";import{webMercatorWorldExtent as m,geographicWorldExtent as h}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as g}from"../support/layerViewUtils.js";const _=Symbol(`integrated-mesh-elevation-providers`);let v=class extends t(d){initialize(){super.initialize(),this.addHandles(n(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),r(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],()=>{this.removeHandles(_),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),_)},i),this.addHandles([r(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return has(`enable-feature:im-as-ground`)?[...this.view?.basemapView?.groundLayerViews.filter(g)??[],...this.layerViews.filter(g)]:[...this.view?.basemapView?.groundLayerViews.filter(g).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=p(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}isUpdating(){return this._usingTerrain&&this._terrainSurface.updating||super.isUpdating()}getElevation(e,t,n,r){let i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,n,r):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{let o=a.elevationProvider.getElevation(e,t,n,r);return o==null?i:Math.max(o,i??o)},i)}getElevations(e,t,n){let r=this.view.groundSpatialReference;if(r==null)for(let e=0;e<t;++e)n(e,null);else for(let i=0;i<t;++i){let t=i*3;n(i,this.getElevation(e[t],e[t+1],e[t+2],r))}}intersect(e,t,n,r){this._usingTerrain&&this._terrainSurface.intersect(e,t,n,r),this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,n,r))}getSphereElevationRange(e,t,n){let r=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((n,r)=>{let i=r.elevationProvider.getSphereElevationRange?.(e,t);return i==null||(n??=new f,n.expandElevationRange(i)),n},r?new f(r.minElevation,r.maxElevation):null)}getRootElevationRange(){let e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{let n=t.elevationProvider.getRootElevationRange?.();return n==null||(e??=new f,e.expandElevationRange(n)),e},e?new f(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){let e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(let e of this.ground?.allLayers??[])if(e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain&&e.loadStatus!==`failed`&&e.queryElevationCallback==null)return!1;return!0}get groundExtent(){let{fullGroundExtent:e}=this;return e?this.userClippingExtent?l(e,this.userClippingExtent,s()):this.fullGroundExtent:null}get fullGroundExtent(){let e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(this._integratedMeshGroundLayerViews.length===0)return e;let t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;let n=b(t);return e?u(e,n,s()):n}get visibleElevationRange(){let e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>e==null?new f(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new f(e.minElevation,e.maxElevation):null)??y}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return this._usingTerrain?this._terrainSurface?.wireframe??!1:!1}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>e.type===`integrated-mesh-3dtiles`&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{t.type===`integrated-mesh-3dtiles`&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!this._usingTerrain&&this._integratedMeshGroundLayerViews.length===0?!1:(!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e)}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([a()],v.prototype,`memoizedElevationQueryDependencies`,null),e([a({readOnly:!0})],v.prototype,`_integratedMeshGroundLayerViews`,null),e([a({readOnly:!0})],v.prototype,`_terrainSurface`,null),e([a({readOnly:!0})],v.prototype,`_usingTerrain`,null),e([a({readOnly:!0})],v.prototype,`spatialReference`,null),e([a({readOnly:!0})],v.prototype,`userClippingExtent`,null),e([a({readOnly:!0})],v.prototype,`elevationQueryCache`,null),e([a()],v.prototype,`elevationQueryReady`,null),e([a({readOnly:!0})],v.prototype,`groundExtent`,null),e([a({readOnly:!0})],v.prototype,`fullGroundExtent`,null),e([a({readOnly:!0})],v.prototype,`visibleElevationRange`,null),e([a({readOnly:!0})],v.prototype,`opaque`,null),e([a({readOnly:!0})],v.prototype,`invisible`,null),e([a({readOnly:!0})],v.prototype,`baseOpacity`,null),e([a({readOnly:!0})],v.prototype,`wireframe`,null),e([a()],v.prototype,`freeze`,null),e([a({readOnly:!0})],v.prototype,`suspended`,null),e([a({readOnly:!0})],v.prototype,`ready`,null),v=e([o(`esri.views.3d.GroundView3D`)],v);const y=new f(0,0);function b(e){return e.isWebMercator?m:h}export{v as GroundView3D};
2
+ import{__decorate as e}from"tslib";import{EventedMixin as t}from"../../core/Evented.js";import has from"../../core/has.js";import{when as n,watch as r,syncAndInitial as i}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import{subclass as o}from"../../core/accessorSupport/decorators/subclass.js";import{create as s,equals as c,intersection as l,union as u}from"../../geometry/support/aaBoundingRect.js";import d from"../GroundView.js";import{ElevationRange as f}from"./support/ElevationRange.js";import{toBoundingRect as p}from"./support/extentUtils.js";import{webMercatorWorldExtent as m,geographicWorldExtent as h}from"./terrain/TerrainConst.js";import{isIntegratedMeshLayerView as g}from"../support/layerViewUtils.js";const _=Symbol(`integrated-mesh-elevation-providers`);let v=class extends t(d){initialize(){super.initialize(),this.addHandles(n(()=>this._terrainSurface,e=>e.on(`elevation-change`,e=>this._elevationChange(e)))),r(()=>[this.view?.basemapView?.groundLayerViews.toArray(),this.layerViews.toArray()],()=>{this.removeHandles(_),this.addHandles(this._integratedMeshGroundLayerViews.map(({elevationProvider:e})=>e.on(`elevation-change`,e=>this._elevationChange(e))),_)},i),this.addHandles([r(()=>this.memoizedElevationQueryDependencies,()=>{this.emit(`elevation-query-change`)})])}get memoizedElevationQueryDependencies(){return(this.ground?.allLayers??[]).filter(e=>e.type===`elevation`||e.type===`integrated-mesh`||e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain).map(e=>e.memoizedElevationQueryDependencies)}_elevationChange(e){this.emit(`elevation-change`,e)}get _integratedMeshGroundLayerViews(){return has(`enable-feature:im-as-ground`)?[...this.view?.basemapView?.groundLayerViews.filter(g)??[],...this.layerViews.filter(g)]:[...this.view?.basemapView?.groundLayerViews.filter(g).filter(e=>e.replacesTerrain)??[]]}get _terrainSurface(){return this.view.basemapTerrain}get _usingTerrain(){return!this.hasTerrainReplacement&&(this._terrainSurface?.enabled??!1)}get spatialReference(){return this._terrainSurface?.spatialReference}get userClippingExtent(){let{spatialReference:e}=this,{clippingArea:t}=this.view;if(t==null||e==null)return null;let n=s(),r=p(t,n,e)?n:null,i=this._get(`userClippingExtent`);return c(r,i)?i:r}isUpdating(){return this._usingTerrain&&this._terrainSurface.updating||super.isUpdating()}getElevation(e,t,n,r){let i=this._usingTerrain?this._terrainSurface?.getElevation(e,t,n,r):null;return this._integratedMeshGroundLayerViews.reduce((i,a)=>{let o=a.elevationProvider.getElevation(e,t,n,r);return o==null?i:Math.max(o,i??o)},i)}getElevations(e,t,n){let r=this.view.groundSpatialReference;if(r==null)for(let e=0;e<t;++e)n(e,null);else for(let i=0;i<t;++i){let t=i*3;n(i,this.getElevation(e[t],e[t+1],e[t+2],r))}}intersect(e,t,n,r){this._usingTerrain&&this._terrainSurface.intersect(e,t,n,r),this._integratedMeshGroundLayerViews.forEach(i=>i.intersect(e,t,n,r))}getSphereElevationRange(e,t,n){let r=this._usingTerrain?this._terrainSurface?.getSphereElevationRange?.(e,t):null;return this._integratedMeshGroundLayerViews.reduce((n,r)=>{let i=r.elevationProvider.getSphereElevationRange?.(e,t);return i==null||(n??=new f,n.expandElevationRange(i)),n},r?new f(r.minElevation,r.maxElevation):null)}getRootElevationRange(){let e=this._usingTerrain?this._terrainSurface?.getRootElevationRange?.():null;return this._integratedMeshGroundLayerViews.reduce((e,t)=>{let n=t.elevationProvider.getRootElevationRange?.();return n==null||(e??=new f,e.expandElevationRange(n)),e},e?new f(e.minElevation,e.maxElevation):null)}get elevationQueryCache(){let e=this.view?.basemapTerrain;return e?.enabled?e.elevationQueryCache:null}get elevationQueryReady(){for(let e of this.ground?.allLayers??[])if(e.type===`integrated-mesh-3dtiles`&&e.replacesTerrain&&e.loadStatus!==`failed`&&e.queryElevationCallback==null)return!1;return!0}get groundExtent(){let{fullGroundExtent:e}=this;return e?this.userClippingExtent?l(e,this.userClippingExtent,s()):this.fullGroundExtent:null}get fullGroundExtent(){let e=this._usingTerrain?this._terrainSurface.fullGroundExtent:null;if(this._integratedMeshGroundLayerViews.length===0)return e;let t=this.view.spatialReference;if(!t.isWebMercator&&!t.isWGS84)return e;let n=b(t);return e?u(e,n,s()):n}get visibleElevationRange(){let e=this._usingTerrain?this._terrainSurface.visibleElevationRange:null,t=this._integratedMeshGroundLayerViews.reduce((e,t)=>e==null?new f(t.visibleElevationRange.minElevation,t.visibleElevationRange.maxElevation):(e.expandElevationRange(t.visibleElevationRange),e),e?new f(e.minElevation,e.maxElevation):null);return t&&!t.isEmpty?t:y}get opaque(){return this._usingTerrain&&this._terrainSurface.opaque||this._integratedMeshGroundLayerViews.some(({opaque:e})=>e)}get invisible(){return(!this._usingTerrain||this._terrainSurface.invisible)&&this._integratedMeshGroundLayerViews.every(({invisible:e})=>e)}get baseOpacity(){return this.ground?.opacity??1}get wireframe(){return this._usingTerrain?this._terrainSurface?.wireframe??!1:!1}get freeze(){return this._usingTerrain&&(this._terrainSurface?.freeze??!1)||this._integratedMeshGroundLayerViews.some(e=>e.type===`integrated-mesh-3dtiles`&&e.freeze)}set freeze(e){this._usingTerrain&&(this._terrainSurface.freeze=e),this._integratedMeshGroundLayerViews.forEach(t=>{t.type===`integrated-mesh-3dtiles`&&(t.freeze=e)})}get suspended(){return(!this._usingTerrain||super.suspended)&&this._integratedMeshGroundLayerViews.length>0&&this._integratedMeshGroundLayerViews.every(({suspended:e})=>e)}get ready(){return!this._usingTerrain&&this._integratedMeshGroundLayerViews.length===0?!1:(!this._usingTerrain||this._terrainSurface.ready)&&this._integratedMeshGroundLayerViews.every(({ready:e})=>e)}updateOverlayParameters(){this._terrainSurface?.updateOverlayParameters()}requestRender(e){this.view.stage.renderView?.requestRender(e)}};e([a()],v.prototype,`memoizedElevationQueryDependencies`,null),e([a({readOnly:!0})],v.prototype,`_integratedMeshGroundLayerViews`,null),e([a({readOnly:!0})],v.prototype,`_terrainSurface`,null),e([a({readOnly:!0})],v.prototype,`_usingTerrain`,null),e([a({readOnly:!0})],v.prototype,`spatialReference`,null),e([a({readOnly:!0})],v.prototype,`userClippingExtent`,null),e([a({readOnly:!0})],v.prototype,`elevationQueryCache`,null),e([a()],v.prototype,`elevationQueryReady`,null),e([a({readOnly:!0})],v.prototype,`groundExtent`,null),e([a({readOnly:!0})],v.prototype,`fullGroundExtent`,null),e([a({readOnly:!0})],v.prototype,`visibleElevationRange`,null),e([a({readOnly:!0})],v.prototype,`opaque`,null),e([a({readOnly:!0})],v.prototype,`invisible`,null),e([a({readOnly:!0})],v.prototype,`baseOpacity`,null),e([a({readOnly:!0})],v.prototype,`wireframe`,null),e([a()],v.prototype,`freeze`,null),e([a({readOnly:!0})],v.prototype,`suspended`,null),e([a({readOnly:!0})],v.prototype,`ready`,null),v=e([o(`esri.views.3d.GroundView3D`)],v);const y=new f(0,0);function b(e){return e.isWebMercator?m:h}export{v as GroundView3D};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{Milliseconds as l}from"../../../core/time.js";import{unitFromRESTJSON as u,convertUnit as d}from"../../../core/units.js";import{property as f,subclass as p}from"../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as m}from"../../../geometry/ellipsoidUtils.js";import h from"../../../geometry/HeightModelInfo.js";import{create as g}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as _}from"../../../geometry/support/heightModelInfoUtils.js";import{isInEffectiveScaleRange as v}from"../../../geometry/support/scaleUtils.js";import{isPlateCarree as y,isWebMercator as b,equals as x,isGeographic as S}from"../../../geometry/support/spatialReferenceUtils.js";import C from"../../../geometry/support/WKIDUnitConversion.js";import{makeCacheKey as w,getHeightModelInfoFromVCS as T}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as E}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as D}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as O}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as k}from"./LayerView3D.js";import{addLayerViewToWasm as A,getLyr3DWasm as j,removeLayerViewFromWasm as M}from"./Lyr3DWasm.js";import{LayerElevationProvider as N}from"./i3s/LayerElevationProvider.js";import{projectToBoundingBox as P}from"../support/extentUtils.js";import{GaussianSplatDataStore as F}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as I}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as L}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTileBuilder as R}from"../support/gaussianSplatting/GaussianTileBuilder.js";import{GaussianSplatDepthRenderer as z}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as B}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as V}from"../webgl-engine/lib/GaussianSplatShadows.js";import H from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as U}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";const G=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`);let K=class extends k(H){constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._tmpTilesWithChangedVisibility=[],this._renderablesBeingCreated=new Set,this._currentLyr3dVisibilityChange=0,this._tileFadeInsAwaitingInitialSort=new Set,this._pendingTileFadeOuts=new Map,this._pendingFadeDuration=l(0),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=g();return P(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;if(await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw U(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await A(this,t),a(t),this._renderer=new B({view:e,layerView:this}),this.data=new F(this._renderer,(e,t)=>this._onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._tileBuilder=new R(this.data.textureAtlas,this.data.headerTexture,()=>this._freeInvisibleTiles()),this._shadows=new V({view:e,layerView:this}),this.fadeHelper=new I(this),this._prepassDepthRenderer=new z({view:e,layerView:this});let n=new L(this);this._intersectionHandler=n,e.sceneIntersectionHelper.addIntersectionHandler(n),this._elevationProvider=new N({view:e,layerElevationSource:this,intersectionHandler:n}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return j(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return E(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return v(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let t=this._tileBuilder.prepare(e);if(!t)return G().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let n=this.view.state.isGlobal,r=n?m(this.view.spatialReference).radius:0,i={...t,isGlobal:n,ellipsoidRadius:r};this._renderablesBeingCreated.add(e.handle);let a;try{a=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(i,e),this._createRenderableAbortController.signal)}finally{this._renderablesBeingCreated.delete(e.handle)}return()=>a}*_createRenderableTask(e,t){let n=yield*this._tileBuilder.build(e,t);return this._tileHandles.set(n.handle,n),this._cacheTileMemory+=n.usedMemory,this._memCache.put(`${n.handle}`,n),{memUsageBytes:n.usedMemory,numGaussians:n.gaussianCount}}freeRenderable(e){this._tileFadeInsAwaitingInitialSort.delete(e),this._pendingTileFadeOuts.delete(e);let t=this.data?.textureAtlas,n=!1,r=this._tileHandles.get(e);if(r){let i=!1;for(let t of this._pendingTileFadeOuts.values())t.incomingTileHandles.has(e)&&(t.visibilityChange=this._currentLyr3dVisibilityChange+1,i=!0);i&&(this._currentLyr3dVisibilityChange++,n=!0),r.lifecycleState===0?this._cacheTileMemory-=r.usedMemory:(n=!0,this.fadeHelper.onTileDiscarded(r),this._usedTileMemory-=r.usedMemory,this._intersectionHandler.removeTile(r)),t&&r.pageIds.forEach(e=>t.freePage(e)),this._removeTileCacheEntry(r),this._tileHandles.delete(e)}n&&this.updateActiveTileVisibility()}_removeTileCacheEntry(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){let r=this.fadeHelper.updateFadeDuration(),i=new q(this._currentLyr3dVisibilityChange+1),a=new Set,o=!1;for(let s=0;s<n;s++){let n=this._tileHandles.get(e[s]);if(!n)continue;let c=t[s]?this._prepareTileFadeIn(n,r):this._prepareTileFadeOut(n,i);t[s]&&i.incomingTileHandles.add(n.handle),c&&a.add(n.handle),o||=c}if(o){if(this._currentLyr3dVisibilityChange++,this._pendingFadeDuration=r,this._updatePendingTileHandoffs(a,i),i.incomingTileHandles.size===0)for(let e of this._tileFadeInsAwaitingInitialSort)i.incomingTileHandles.add(e);this.updateActiveTileVisibility()}}_updatePendingTileHandoffs(e,t){for(let n of new Set(this._pendingTileFadeOuts.values())){if(n===t)continue;let r=!1;for(let i of e)n.incomingTileHandles.has(i)&&(r=!0,t.incomingTileHandles.size>0&&n.incomingTileHandles.delete(i));if(r){n.visibilityChange=t.visibilityChange;for(let e of t.incomingTileHandles)n.incomingTileHandles.add(e)}}}_prepareTileFadeIn(e,t){let n=this._pendingTileFadeOuts.delete(e.handle);return e.lifecycleState===2?(this.fadeHelper.fadeTile(e,0,t),!1):this._tileFadeInsAwaitingInitialSort.has(e.handle)?n:(e.lifecycleState===0&&this._popTileFromCache(e),e.lifecycleState=1,this._tileFadeInsAwaitingInitialSort.add(e.handle),!0)}_prepareTileFadeOut(e,t){let n=this._tileFadeInsAwaitingInitialSort.delete(e.handle);return n&&e.lifecycleState===1&&(this.moveTileToCache(e),e.lifecycleState=0),e.lifecycleState===2?this._pendingTileFadeOuts.has(e.handle)?n:(this._pendingTileFadeOuts.set(e.handle,t),!0):n}_onSortComplete(e,t){let n=this._tmpTilesWithChangedVisibility;n.length=0,this._triggerFadeIns(e,n);let r=this._triggerFadeOuts(t,n);n.length>0&&this.notifyTileObbsChanged(n),r&&this.updateActiveTileVisibility()}_triggerFadeIns(e,t){for(let n of e)this._tileHandles.get(n.handle)===n&&this._tileFadeInsAwaitingInitialSort.delete(n.handle)&&(n.lifecycleState=2,t.push(n),this.fadeHelper.fadeTile(n,0,this._pendingFadeDuration))}_triggerFadeOuts(e,t){let n=!1;for(let t of this._pendingTileFadeOuts.values())if(e>=t.visibilityChange){n=!0;break}if(!n)return!1;let r=this._pendingFadeDuration,i=this._pendingFadeDuration;for(let e of this._tileHandles.values()){let{fadeDirection:t,fadeDuration:n,fadeProgress:a}=e;if(t!==0||n==null||a==null)continue;let o=n*(1-a);r=l(Math.max(r,o)),i=l(Math.max(i,n))}let a=!1;for(let[n,o]of this._pendingTileFadeOuts){if(e<o.visibilityChange)continue;this._pendingTileFadeOuts.delete(n);let s=this._tileHandles.get(n);if(s){let e=s.lifecycleState===2,n=s.opacityModifier===1?r:i;this.fadeHelper.fadeTile(s,1,n),e&&s.lifecycleState===0&&(t.push(s),a=!0)}}return a}_popTileFromCache(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(w(e.handle))}moveTileToCache(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(w(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),M(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._tileBuilder=null,this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_canProjectWithoutEngine(){if(this.view.state.viewingMode===1||y(this.view.renderSpatialReference)||b(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&x(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(this.layer.esriCrsSpatialReference.vcsWkid===115700)return!1;let e=T(this.layer.esriCrsSpatialReference);if(!e){let t=this.layer.esriCrsSpatialReference,n=S(t),r=`meters`;!n&&t.wkid&&t.wkid!==-1&&(r=u(C.units[C[t.wkid]])),r&&(e=new h({heightModel:`gravity-related-height`,heightUnit:r}))}let t=this.view.heightModelInfo;return this._useEsriCrs=_(e,t,!1)===0,this._useEsriCrs&&(e&&(this._metersPerVCSUnit=d(1,e.heightUnit,`meters`)),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,E(e));else{let t=D(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateActiveTileVisibility(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._currentLyr3dVisibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new O(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([f()],K.prototype,`layer`,void 0),e([f({readOnly:!0})],K.prototype,`_clippingBox`,null),e([f()],K.prototype,`elevationOffset`,null),e([f({readOnly:!0})],K.prototype,`visibleAtCurrentScale`,null),e([f()],K.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([f()],K.prototype,`maximumGaussianCount`,null),K=e([p(`esri.views.3d.layers.GaussianSplatLayerView3D`)],K);class q{constructor(e){this.visibilityChange=e,this.incomingTileHandles=new Set}}const J=K;export{J as default};
2
+ import{__decorate as e}from"tslib";import"../../../core/has.js";import t from"../../../core/Logger.js";import{abortMaybe as n,removeMaybe as r,destroyMaybe as i}from"../../../core/maybe.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as o,whenOnce as s,initial as c}from"../../../core/reactiveUtils.js";import{unitFromRESTJSON as l,convertUnit as u}from"../../../core/units.js";import{property as d,subclass as f}from"../../../core/accessorSupport/decorators.js";import{getReferenceEllipsoid as p}from"../../../geometry/ellipsoidUtils.js";import m from"../../../geometry/HeightModelInfo.js";import{create as h}from"../../../geometry/support/aaBoundingBox.js";import{isCompatible as g}from"../../../geometry/support/heightModelInfoUtils.js";import{isInEffectiveScaleRange as _}from"../../../geometry/support/scaleUtils.js";import{isPlateCarree as v,isWebMercator as y,equals as b,isGeographic as x}from"../../../geometry/support/spatialReferenceUtils.js";import S from"../../../geometry/support/WKIDUnitConversion.js";import{makeCacheKey as C,getHeightModelInfoFromVCS as w}from"../../../layers/support/tiles3DUtils.js";import{getElevationOffsetInMeters as T}from"../../../support/elevationInfoUtils.js";import{getMetersPerUnit as E}from"../../../symbols/support/unitConversionUtils.js";import{GaussianSplatLayerViewPerformanceInfo as D}from"./GaussianSplatLayerViewPerformanceInfo.js";import{LayerView3D as O}from"./LayerView3D.js";import{addLayerViewToWasm as k,getLyr3DWasm as A,removeLayerViewFromWasm as j}from"./Lyr3DWasm.js";import{LayerElevationProvider as M}from"./i3s/LayerElevationProvider.js";import{projectToBoundingBox as N}from"../support/extentUtils.js";import{GaussianSplatDataStore as P}from"../support/gaussianSplatting/GaussianSplatDataStore.js";import{GaussianSplatFadeHelper as F}from"../support/gaussianSplatting/GaussianSplatFadeHelper.js";import{GaussianSplatIntersectionHandler as I}from"../support/gaussianSplatting/GaussianSplatIntersectionHandler.js";import{GaussianTileBuilder as L}from"../support/gaussianSplatting/GaussianTileBuilder.js";import{GaussianTileLifecycle as R}from"../support/gaussianSplatting/GaussianTileLifecycle.js";import{GaussianSplatDepthRenderer as z}from"../webgl-engine/lib/GaussianSplatDepthRenderer.js";import{GaussianSplatRenderer as B}from"../webgl-engine/lib/GaussianSplatRenderer.js";import{GaussianSplatShadows as V}from"../webgl-engine/lib/GaussianSplatShadows.js";import H from"../../layers/LayerView.js";import{spatialReferenceIncompatibleError as U}from"../../support/layerViewUtils.js";import{TaskPriority as W}from"../../support/Scheduler.js";const G=()=>t.getLogger(`esri.views.3d.layers.GaussianSplatLayerView3D`);let K=class extends O(H){constructor(e){super(e),this.type=`gaussian-splat-3d`,this.ignoresMemoryFactor=!1,this._tileHandles=new Map,this._renderablesBeingCreated=new Set,this._tileLifecycle=new R(this),this._createRenderableAbortController=new AbortController,this.skipHeightModelInfoValidation=!0,this._initializationController=null,this._wasmLayerId=-1,this._metersPerVCSUnit=1,this._usedTileMemory=0,this._cacheTileMemory=0,this._useEsriCrs=!1,this.fullExtentInLocalViewSpatialReference=null,this._suspendedHandle=null;let t=e.view.resourceController;this._memCache=t.memoryController.newCache(`GaussianSplat-${this.uid}`,e=>this._deleteTile(e)),this._frameTask=t.scheduler.registerTask(W.GAUSSIAN_SPLAT_TEXTURE_ATLAS)}get _clippingBox(){if(!this.view?.clippingArea)return null;let e=h();return N(this.view.clippingArea,e,this.view.renderSpatialReference)?e:null}get clippingBox(){return this._renderer?.clippingBox??null}initialize(){let{view:e}=this;this.addHandles([o(()=>e.qualitySettings.fadeDuration,e=>{this.data&&(this.fadeHelper.onFadeDurationChanged(e),this.updateFadingTexture())})]),this.addResolvingPromise(this._initializeAsync(e))}async _initializeAsync(e){this._initializationController=new AbortController;let{signal:t}=this._initializationController;if(await s(()=>e?.defaultsFromMap.heightModelInfoReady,t),a(t),!this._canProjectWithoutEngine())throw U(`layer`,this.layer.spatialReference.wkid,e.renderSpatialReference?.wkid);this._wasmLayerId=await k(this,t),a(t),this._renderer=new B({view:e,layerView:this}),this.data=new P(this._renderer,(e,t)=>this._tileLifecycle.onSortComplete(e,t),()=>this._freeInvisibleTiles()),this._tileBuilder=new L(this.data.textureAtlas,this.data.headerTexture,()=>this._freeInvisibleTiles()),this._shadows=new V({view:e,layerView:this}),this.fadeHelper=new F(this,e=>this._tileLifecycle.onTileFullyFadedOut(e)),this._prepassDepthRenderer=new z({view:e,layerView:this});let n=new I(this);this._intersectionHandler=n,e.sceneIntersectionHelper.addIntersectionHandler(n),this._elevationProvider=new M({view:e,layerElevationSource:this,intersectionHandler:n}),e.elevationProvider.register(2,this._elevationProvider),this.addHandles([o(()=>this.layer.elevationInfo,e=>this._elevationInfoChanged(e)),o(()=>this.slicePlaneEnabled,e=>this._slicePlaneEnabledChanged(e),c)]),this._suspendedHandle=o(()=>this.suspended,e=>this._wasm?.setEnabled(this,!e),c),this.addHandles([o(()=>this._clippingBox,e=>{this._renderer&&(this._renderer.clippingBox=e)},c),o(()=>this.maximumGaussianCount,e=>this._wasm?.setMaximumGaussianSplatCount(Math.min(e,this.data.textureAtlas.maximumSupportedVisibleGaussians)),c)]),this._initializationController=null}get wasmLayerId(){return this._wasmLayerId}get metersPerVCSUnit(){return this._metersPerVCSUnit}get tileHandles(){return this._tileHandles}updateFadingTexture(){this.data.fadingTexture.updateTexture(this.data.textureAtlas.pageAllocator.pageCount)}get _wasm(){return A(this.view)}get usedMemory(){return this._usedTileMemory+(this.data?.usedMemory??0)}get cachedMemory(){return this._cacheTileMemory}get unloadedMemory(){return 0}get useEsriCrs(){return this._useEsriCrs}get elevationProvider(){return this._elevationProvider}get elevationOffset(){return T(this.layer.elevationInfo)}get elevationRange(){return this._intersectionHandler?.elevationRange}getElevationRange(e){return this._intersectionHandler.getElevationRange(e)}get fullExtent(){return this.layer.fullExtent}get visibleAtCurrentScale(){return _(this.layer.effectiveScaleRange,this.view.scale)}isUpdating(){let e=this._wasm;return this._wasmLayerId<0||e==null?!1:e.isUpdating(this._wasmLayerId)||this.data.updating||this.fadeHelper.updating}updatingFlagChanged(){this.notifyChange(`updating`)}async createRenderable(e){if(this.destroyed||this.destroying)throw Error(`IntegratedMesh3DTilesLayerView3D: createRenderable called after destroy`);let t=this._tileBuilder.prepare(e);if(!t)return G().warnOnce(`encountered tile with zero Gaussians`),()=>({memUsageBytes:0,numGaussians:0});let n=this.view.state.isGlobal,r=n?p(this.view.spatialReference).radius:0,i={...t,isGlobal:n,ellipsoidRadius:r};this._renderablesBeingCreated.add(e.handle);let a;try{a=await this._frameTask.scheduleGenerator(e=>this._createRenderableTask(i,e),this._createRenderableAbortController.signal)}finally{this._renderablesBeingCreated.delete(e.handle)}return()=>a}*_createRenderableTask(e,t){let n=yield*this._tileBuilder.build(e,t);return this._tileHandles.set(n.handle,n),this._cacheTileMemory+=n.usedMemory,this._memCache.put(`${n.handle}`,n),{memUsageBytes:n.usedMemory,numGaussians:n.gaussianCount}}freeRenderable(e){this._tileLifecycle.freeTile(e)}releaseTile(e,t){let n=this.data?.textureAtlas;t?(this._usedTileMemory-=e.usedMemory,this._intersectionHandler.removeTile(e)):this._cacheTileMemory-=e.usedMemory,n&&e.pageIds.forEach(e=>n.freePage(e)),this._removeTileCacheEntry(e),this._tileHandles.delete(e.handle)}_removeTileCacheEntry(e){this._memCache.pop(`${e.handle}`)}notifyTileObbsChanged(e){this._elevationProvider&&this._elevationProvider.notifyObjectsChangedFunctional(e.length,t=>{for(let{obb:n}of e)if(!t(n))break})}setRenderableVisibility(e,t,n){this._tileLifecycle.setVisibility(e,t,n)}activateTile(e){this._usedTileMemory+=e.usedMemory,this._cacheTileMemory-=e.usedMemory,this._intersectionHandler.addTile(e),this._memCache.pop(C(e.handle))}cacheTile(e){this._usedTileMemory-=e.usedMemory,this._cacheTileMemory+=e.usedMemory,this._intersectionHandler.removeTile(e),this._memCache.put(C(e.handle),e)}destroy(){this._initializationController=n(this._initializationController),this._createRenderableAbortController.abort(),j(this),this._suspendedHandle&&=r(this._suspendedHandle),this._intersectionHandler&&=(this.view.sceneIntersectionHelper.removeIntersectionHandler(this._intersectionHandler),null),this._elevationProvider&&this.view.elevationProvider&&(this._elevationProvider.notifyObjectsChangedFunctional(this._tileHandles.size,e=>{for(let{obb:t}of this._tileHandles.values())if(!e(t))break}),this.view.elevationProvider.unregister(this._elevationProvider),this._elevationProvider=null),this._frameTask.remove(),this._tileBuilder=null,this._shadows=i(this._shadows),this._prepassDepthRenderer=i(this._prepassDepthRenderer),this._renderer=i(this._renderer),this._memCache.destroy(),this.data=i(this.data)}_canProjectWithoutEngine(){if(this.view.state.viewingMode===1||v(this.view.renderSpatialReference)||y(this.view.renderSpatialReference))return!0;if(this.layer.esriCrsSpatialReference&&b(this.layer.esriCrsSpatialReference,this.view.renderSpatialReference)){if(this.layer.esriCrsSpatialReference.vcsWkid===115700)return!1;let e=w(this.layer.esriCrsSpatialReference);if(!e){let t=this.layer.esriCrsSpatialReference,n=x(t),r=`meters`;!n&&t.wkid&&t.wkid!==-1&&(r=l(S.units[S[t.wkid]])),r&&(e=new m({heightModel:`gravity-related-height`,heightUnit:r}))}let t=this.view.heightModelInfo;return this._useEsriCrs=g(e,t,!1)===0,this._useEsriCrs&&(e&&(this._metersPerVCSUnit=u(1,e.heightUnit,`meters`)),this.fullExtentInLocalViewSpatialReference=this.layer.esriCrsFullExtent),this._useEsriCrs}return!1}_elevationInfoChanged(e){if(!e?.offset)this._wasm?.setLayerOffset(this,0);else if(!this._useEsriCrs)this._wasm?.setLayerOffset(this,T(e));else{let t=E(e?.unit)/this._metersPerVCSUnit,n=e?.offset??0;this._wasm?.setLayerOffset(this,n*t)}}_slicePlaneEnabledChanged(e){this._renderer&&(this._renderer.slicePlaneEnabled=e),this._intersectionHandler&&(this._intersectionHandler.slicePlaneEnabled=e)}updateActiveTileVisibility(){let e=[];for(let t of this._tileHandles.values())t.lifecycleState!==0&&e.push(t);this.data.updateGaussianVisibility(e,this._tileLifecycle.visibilityChange),this.notifyChange(`updating`)}get maximumGaussianCount(){return this.view.qualitySettings.gaussianSplat.maximumNumberOfGaussians*this.view.quality}set maximumGaussianCount(e){this._set(`maximumGaussianCount`,e)}_freeInvisibleTiles(){for(let e of this._tileHandles.values())e.lifecycleState===0&&!this._renderablesBeingCreated.has(e.handle)&&this._deleteTile(e)}_deleteTile(e){this._renderablesBeingCreated.has(e.handle)||this._wasm?.onRenderableEvicted(this,e.handle,e.usedMemory),this.freeRenderable(e.handle)}get performanceInfo(){let e=0,t=0;this._tileHandles.forEach(n=>{n.lifecycleState===0?t++:e++});let n=this.data?.textureAtlasMemory??0,r=this.data?.headerTextureMemory??0,i=this.data?.orderTextureMemory??0,a=this.data?.fadingTextureMemory??0,o=this.data?.sortBufferMemory??0;return new D(this.usedMemory,e,this._usedTileMemory,t,this._cacheTileMemory,n,r,i,a,o)}get test(){}};e([d()],K.prototype,`layer`,void 0),e([d({readOnly:!0})],K.prototype,`_clippingBox`,null),e([d()],K.prototype,`elevationOffset`,null),e([d({readOnly:!0})],K.prototype,`visibleAtCurrentScale`,null),e([d()],K.prototype,`fullExtentInLocalViewSpatialReference`,void 0),e([d()],K.prototype,`maximumGaussianCount`,null),K=e([f(`esri.views.3d.layers.GaussianSplatLayerView3D`)],K);const q=K;export{q as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{isSome as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{onAbortOrThrow as n,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{aggregateSymbolComplexity as i}from"./defaultSymbolComplexity.js";import{Graphics3DGraphic as a}from"./Graphics3DGraphic.js";import{Graphics3DSymbolLayerCreationContext as o}from"./Graphics3DSymbolCreationContext.js";import{Loadable as s}from"./Loadable.js";import{AggregateSymbolComplexity as c}from"./SymbolComplexity.js";import{getSymbolMemorySize as l}from"./symbolMemory.js";class u extends s{set symbol(e){this._symbol=e,e.symbolLayers.forEach((t,n)=>{let r=this.symbolLayers[n];r!=null&&(r.symbol=e,r.symbolLayer=t)})}get symbol(){return this._symbol}constructor(e,t,n){super(t.schedule),this._symbol=e,this._context=t,this._backgroundLayers=n,this._destroyed=!1,this.symbolLayers=[],this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));let a=i.length;for(;this.symbolLayers.length<i.length;)this.symbolLayers.push(null);this.symbolLayers.length=i.length;let o=[];if(!d){let{make:e}=await import(`./Graphics3DSymbolLayerFactory.js`);d=e}for(let t=0;t<a;t++){let r=i.at(t);if(r.enabled===!1)continue;f.renderPriority=1-(1+t)/a,f.renderPriorityStep=1/a,f.ignoreDrivers=r.ignoreDrivers;let s=d(this.symbol,r,this._context,f),c=n(e,()=>{this.symbolLayers[t]=null,s.destroy()});c&&o.push(c),this.symbolLayers[t]=s}if(await t(this.symbolLayers,async(e,t)=>{if(e!=null)try{await e.load(),this._extentPadding+=Math.max(this._extentPadding,e.extentPadding)}catch{this.symbolLayers[t]=null}}),o.forEach(e=>e.remove()),r(e),this.symbolLayers.length&&!this.symbolLayers.some(e=>!!e))throw Error()}getSymbolLayerSize(e){let t=this.symbolLayers[e];return t==null?null:t.getCachedSize()}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e?.queryForSnapping)}get needsUpdateFocus(){return this.symbolLayers.some(e=>e?.needsUpdateFocus===!0)}createGraphics3DGraphic(e,t){let{graphic:n}=e,r=this.symbolLayers.map(t=>t?.createGraphics3DGraphic(e)??null);return new a(n,t||this,r,e.reportGraphicSourceMemory)}get complexity(){let e=new c;return this.symbolLayers.forEach(t=>i(t?.complexity,e)),e}globalPropertyChanged(e,t){let n=this.symbolLayers.length;for(let r=0;r<n;r++){let n=this.symbolLayers[r];if(n!=null&&!n.globalPropertyChanged(e,t,e=>{let t=e.layers[r];return t?.type===`object3d`||t?.type===`buffer`?t:null}))return!1}return!0}applyRendererDiff(e,t){return this.loadStatus===1?this.symbolLayers.reduce((n,r)=>n!==0&&r!=null?Math.min(n,r.applyRendererDiff(e,t)):n,2):0}prepareSymbolPatch(e){if(this.loadStatus===2||e.diff.type!==`partial`)return;let t=e.diff.diff;if(!t.symbolLayers||t.symbolLayers.type!==`partial`)return;let n=t.symbolLayers.diff;this.symbolLayers.forEach((t,r)=>{if(t==null)return;let i=n[r];if(i){let n={diff:i,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};t.prepareSymbolLayerPatch(n),e.symbolStatePatches.push(...n.symbolLayerStatePatches),n.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((e,t)=>{let i=e.layers[r];i!=null&&n.graphics3DGraphicPatches.forEach(e=>e(i,t))})}})}updateGeometry(e){return this._updateGeometryOrTransform(e,(t,n)=>t.updateGeometry?t.updateGeometry(e.graphic,n):!1)}updateMeshTransform(e,t,n,r,i){return this._updateGeometryOrTransform(e,(e,a)=>e.updateMeshTransform?e.updateMeshTransform(a,t,n,r,i):!1)}_updateGeometryOrTransform(e,t){for(let n=0;n<this.symbolLayers.length;n++){let r=this.symbolLayers[n];if(r==null)continue;let i=e.layers[n];if(!i||!t(r,i))return!1}return!0}onRemoveGraphic(e){for(let t=0;t<this.symbolLayers.length;t++){let n=this.symbolLayers[t];if(n==null)continue;let r=e.layers[t];r!=null&&n.onRemoveGraphic(r)}}getFastUpdateStatus(){let e=!1,t=!1;for(let n of this.symbolLayers)if(n!=null){if(n.loadStatus===0)return 3;n.isFastUpdatesEnabled()?t=!0:e=!0}return t?e?2:1:e?0:4}async queryForSnapping(t,n,i,a){let o=this.symbolLayers.filter(e).filter(e=>e.queryForSnapping!=null).map(e=>e.queryForSnapping(t,n,i,a)),s=await Promise.all(o);return r(a),s.flat()}destroy(){if(!this.destroyed){super.destroy();for(let e of this.symbolLayers)e?.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}get usedMemory(){return l(this)}}let d=null;const f=new o;export{u as Graphics3DSymbol};
2
+ import{isSome as e}from"../../../../core/arrayUtils.js";import{forEach as t}from"../../../../core/asyncUtils.js";import"../../../../core/has.js";import{onAbortOrThrow as n,throwIfAborted as r}from"../../../../core/promiseUtils.js";import{aggregateSymbolComplexity as i}from"./defaultSymbolComplexity.js";import{Graphics3DGraphic as a}from"./Graphics3DGraphic.js";import{Graphics3DSymbolLayerCreationContext as o}from"./Graphics3DSymbolCreationContext.js";import{Loadable as s}from"./Loadable.js";import{AggregateSymbolComplexity as c}from"./SymbolComplexity.js";import{getSymbolMemorySize as l}from"./symbolMemory.js";class u extends s{set symbol(e){this._symbol=e,e.symbolLayers.forEach((t,n)=>{let r=this.symbolLayers[n];r!=null&&(r.symbol=e,r.symbolLayer=t)})}get symbol(){return this._symbol}constructor(e,t,n){super(t.schedule),this._symbol=e,this._context=t,this._backgroundLayers=n,this._destroyed=!1,this.symbolLayers=[],this.referenced=0,this._extentPadding=0}async doLoad(e){let i=this._symbol.symbolLayers;this._extentPadding=0,this._backgroundLayers&&(i=this._backgroundLayers.concat(i));let a=i.length;for(;this.symbolLayers.length<i.length;)this.symbolLayers.push(null);this.symbolLayers.length=i.length;let o=[];if(!d){let{make:e}=await(f??=import(`./Graphics3DSymbolLayerFactory.js`).catch(e=>{throw f=null,e}));d=e}for(let t=0;t<a;t++){let r=i.at(t);if(r.enabled===!1)continue;p.renderPriority=1-(1+t)/a,p.renderPriorityStep=1/a,p.ignoreDrivers=r.ignoreDrivers;let s=d(this.symbol,r,this._context,p),c=n(e,()=>{this.symbolLayers[t]=null,s.destroy()});c&&o.push(c),this.symbolLayers[t]=s}if(await t(this.symbolLayers,async(e,t)=>{if(e!=null)try{await e.load(),this._extentPadding+=Math.max(this._extentPadding,e.extentPadding)}catch{this.symbolLayers[t]=null}}),o.forEach(e=>e.remove()),r(e),this.symbolLayers.length&&!this.symbolLayers.some(e=>!!e))throw Error()}getSymbolLayerSize(e){let t=this.symbolLayers[e];return t==null?null:t.getCachedSize()}get extentPadding(){return this._extentPadding}get symbologySnappingSupported(){return this.symbolLayers.some(e=>e?.queryForSnapping)}get needsUpdateFocus(){return this.symbolLayers.some(e=>e?.needsUpdateFocus===!0)}createGraphics3DGraphic(e,t){let{graphic:n}=e,r=this.symbolLayers.map(t=>t?.createGraphics3DGraphic(e)??null);return new a(n,t||this,r,e.reportGraphicSourceMemory)}get complexity(){let e=new c;return this.symbolLayers.forEach(t=>i(t?.complexity,e)),e}globalPropertyChanged(e,t){let n=this.symbolLayers.length;for(let r=0;r<n;r++){let n=this.symbolLayers[r];if(n!=null&&!n.globalPropertyChanged(e,t,e=>{let t=e.layers[r];return t?.type===`object3d`||t?.type===`buffer`?t:null}))return!1}return!0}applyRendererDiff(e,t){return this.loadStatus===1?this.symbolLayers.reduce((n,r)=>n!==0&&r!=null?Math.min(n,r.applyRendererDiff(e,t)):n,2):0}prepareSymbolPatch(e){if(this.loadStatus===2||e.diff.type!==`partial`)return;let t=e.diff.diff;if(!t.symbolLayers||t.symbolLayers.type!==`partial`)return;let n=t.symbolLayers.diff;this.symbolLayers.forEach((t,r)=>{if(t==null)return;let i=n[r];if(i){let n={diff:i,graphics3DGraphicPatches:[],symbolLayerStatePatches:[]};t.prepareSymbolLayerPatch(n),e.symbolStatePatches.push(...n.symbolLayerStatePatches),n.graphics3DGraphicPatches.length&&e.graphics3DGraphicPatches.push((e,t)=>{let i=e.layers[r];i!=null&&n.graphics3DGraphicPatches.forEach(e=>e(i,t))})}})}updateGeometry(e){return this._updateGeometryOrTransform(e,(t,n)=>t.updateGeometry?t.updateGeometry(e.graphic,n):!1)}updateMeshTransform(e,t,n,r,i){return this._updateGeometryOrTransform(e,(e,a)=>e.updateMeshTransform?e.updateMeshTransform(a,t,n,r,i):!1)}_updateGeometryOrTransform(e,t){for(let n=0;n<this.symbolLayers.length;n++){let r=this.symbolLayers[n];if(r==null)continue;let i=e.layers[n];if(!i||!t(r,i))return!1}return!0}onRemoveGraphic(e){for(let t=0;t<this.symbolLayers.length;t++){let n=this.symbolLayers[t];if(n==null)continue;let r=e.layers[t];r!=null&&n.onRemoveGraphic(r)}}getFastUpdateStatus(){let e=!1,t=!1;for(let n of this.symbolLayers)if(n!=null){if(n.loadStatus===0)return 3;n.isFastUpdatesEnabled()?t=!0:e=!0}return t?e?2:1:e?0:4}async queryForSnapping(t,n,i,a){let o=this.symbolLayers.filter(e).filter(e=>e.queryForSnapping!=null).map(e=>e.queryForSnapping(t,n,i,a)),s=await Promise.all(o);return r(a),s.flat()}destroy(){if(!this.destroyed){super.destroy();for(let e of this.symbolLayers)e?.destroy();this.symbolLayers.length=0,this._destroyed=!0}}get destroyed(){return this._destroyed}get usedMemory(){return l(this)}}let d=null,f=null;const p=new o;export{u as Graphics3DSymbol};