@arcgis/core 4.34.0-next.20 → 4.34.0-next.21

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 (176) hide show
  1. package/analysis/VolumeMeasurement/CutFillOptions.js +5 -0
  2. package/analysis/VolumeMeasurement/volumeMeasurementUtils.js +5 -0
  3. package/analysis/VolumeMeasurementAnalysis.d.ts +4 -0
  4. package/analysis/VolumeMeasurementAnalysis.js +5 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/06c3725d6cc21e7e4bcf.js +1 -0
  7. package/assets/esri/core/workers/chunks/{28b525963420f022fb0a.js → 1cc30073f8200b67cff6.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9432a5466eec397710a4.js → 273ff53a68714e4daad5.js} +1 -1
  9. package/assets/esri/core/workers/chunks/32756905bcf11699b3f7.js +1 -0
  10. package/assets/esri/core/workers/chunks/41f487713c6278d389a1.js +1 -0
  11. package/assets/esri/core/workers/chunks/5b276962c46c57155166.js +1 -0
  12. package/assets/esri/core/workers/chunks/5ce62d9fff80d014d186.js +1 -0
  13. package/assets/esri/core/workers/chunks/5e805c9e9012dd39ec86.js +1 -0
  14. package/assets/esri/core/workers/chunks/66757fc16316a5c50e1e.js +1 -0
  15. package/assets/esri/core/workers/chunks/6a0fbc54638f7de138c1.js +1 -0
  16. package/assets/esri/core/workers/chunks/871fae52d2fddc9e7794.js +1 -0
  17. package/assets/esri/core/workers/chunks/8b19fe829a9dc26fb3fe.js +1 -0
  18. package/assets/esri/core/workers/chunks/8eea6251aa09725e654e.js +1 -0
  19. package/assets/esri/core/workers/chunks/916691122d7fb38497d6.js +1 -0
  20. package/assets/esri/core/workers/chunks/919d2fd7ebc0c840a759.js +1 -0
  21. package/assets/esri/core/workers/chunks/97324f030738fc0d456b.js +1 -0
  22. package/assets/esri/core/workers/chunks/9c510df592befb9ff892.js +1 -0
  23. package/assets/esri/core/workers/chunks/9d2cb559dd9af4e1727c.js +1 -0
  24. package/assets/esri/core/workers/chunks/{2e54be3094e41fd3026d.js → 9eb1a171f5ef1fef42ed.js} +1 -1
  25. package/assets/esri/core/workers/chunks/aba520714efc01bead36.js +1 -0
  26. package/assets/esri/core/workers/chunks/accff253af360c34e8a8.js +1 -0
  27. package/assets/esri/core/workers/chunks/ad3871f497ecea1a08c9.js +1 -0
  28. package/assets/esri/core/workers/chunks/ae6eed26fc932bc08356.js +1 -0
  29. package/assets/esri/core/workers/chunks/c317819ab0544c50c078.js +1 -0
  30. package/assets/esri/core/workers/chunks/fc8bbc571216edd9ef5a.js +1 -0
  31. package/config.js +1 -1
  32. package/core/libs/rbush/PooledRBush.js +1 -1
  33. package/core/scheduling.js +1 -1
  34. package/geometry/support/buffer/BufferView.js +1 -1
  35. package/geometry/support/float16.js +1 -1
  36. package/interfaces.d.ts +1040 -146
  37. package/kernel.js +1 -1
  38. package/layers/SubtypeGroupLayer.js +1 -1
  39. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  40. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  41. package/layers/mixins/ArcGISMapService.js +1 -1
  42. package/layers/save/mapImageLayerUtils.js +1 -1
  43. package/layers/support/TilemapCache.js +1 -1
  44. package/layers/support/TitleCreator.js +1 -1
  45. package/layers/support/arcgisLayerUrl.js +1 -1
  46. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  47. package/package.json +1 -1
  48. package/rest/knowledgeGraph/GraphAddFieldIndexResult.d.ts +4 -0
  49. package/rest/knowledgeGraph/GraphAddPropertyResult.d.ts +4 -0
  50. package/rest/knowledgeGraph/GraphDataModelOperationResult.d.ts +4 -0
  51. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.d.ts +4 -0
  52. package/rest/knowledgeGraph/GraphDeletePropertyResult.d.ts +4 -0
  53. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.d.ts +4 -0
  54. package/rest/knowledgeGraph/GraphUpdatePropertyResult.d.ts +4 -0
  55. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.d.ts +4 -0
  56. package/rest/knowledgeGraphService.d.ts +7 -0
  57. package/support/requestUtils.js +1 -1
  58. package/support/revision.js +1 -1
  59. package/views/2d/engine/ManagedCanvas.js +1 -1
  60. package/views/2d/engine/ParentChildStage.js +5 -0
  61. package/views/2d/engine/Stage.js +1 -1
  62. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  63. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  64. package/views/2d/engine/webgl/Painter.js +1 -1
  65. package/views/2d/engine/webgl/VideoScreenRenderer.js +5 -0
  66. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  67. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +5 -0
  68. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +5 -0
  69. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  70. package/views/2d/layers/MediaLayerView2D.js +1 -1
  71. package/views/2d/layers/TileLayerView2D.js +1 -1
  72. package/views/2d/layers/features/Processor.js +1 -1
  73. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  74. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  75. package/views/2d/mapViewDeps.js +1 -1
  76. package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
  77. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +4 -0
  78. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +5 -0
  79. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  80. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  81. package/views/3d/layers/graphics/DeconflictAABR.js +1 -1
  82. package/views/3d/layers/graphics/ExtentSet.js +1 -1
  83. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  84. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  85. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  86. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  87. package/views/3d/layers/graphics/Labeler.js +1 -1
  88. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  89. package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
  90. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  91. package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
  92. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  93. package/views/3d/layers/support/FeatureTileDescriptor.js +1 -1
  94. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  95. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  96. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  97. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  98. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  99. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  100. package/views/3d/support/StreamDataLoader.js +1 -1
  101. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  102. package/views/3d/terrain/OverlayManager.js +1 -1
  103. package/views/3d/terrain/OverlayRenderer.js +1 -1
  104. package/views/3d/terrain/TerrainSurface.js +1 -1
  105. package/views/3d/webgl-engine/Stage.js +1 -1
  106. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  107. package/views/3d/webgl-engine/core/FBOPool.js +1 -1
  108. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  109. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  110. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  111. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  112. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  113. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  114. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  115. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  116. package/views/SceneView.js +1 -1
  117. package/views/VideoView.js +1 -1
  118. package/views/View2D.js +1 -1
  119. package/views/Viewport2DBaseMixin.js +5 -0
  120. package/views/Viewport2DMixin.js +1 -1
  121. package/views/layers/FeatureLayerView.js +1 -1
  122. package/views/support/Scheduler.js +1 -1
  123. package/views/video/VideoOperationalDataView.js +5 -0
  124. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  125. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +4 -0
  126. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  127. package/widgets/BatchAttributeForm/inputs/EditableInput.d.ts +4 -0
  128. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  129. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +4 -0
  130. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  131. package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +4 -0
  132. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  133. package/widgets/BatchAttributeForm/inputs/InputBase.d.ts +4 -0
  134. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  135. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  136. package/widgets/Directions.js +1 -1
  137. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  138. package/widgets/FeatureForm/EditableInput.d.ts +2 -2
  139. package/widgets/FeatureForm/FieldInput.d.ts +2 -2
  140. package/widgets/FeatureForm/GroupInput.d.ts +2 -2
  141. package/widgets/FeatureForm/InputBase.d.ts +2 -2
  142. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  143. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  144. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  145. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  146. package/widgets/OrientedImageryViewer.js +1 -1
  147. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  148. package/widgets/VideoPlayer.js +1 -1
  149. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  150. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  151. package/widgets/support/SelectionList/LayerItem.js +1 -1
  152. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  153. package/widgets/support/SelectionList.js +1 -1
  154. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  155. package/assets/esri/core/workers/chunks/034950f7d0596e77a7dd.js +0 -1
  156. package/assets/esri/core/workers/chunks/0808b7b2a18331ac0cf6.js +0 -1
  157. package/assets/esri/core/workers/chunks/093938edee5f0532d7da.js +0 -1
  158. package/assets/esri/core/workers/chunks/116bbff428cc2dc1832e.js +0 -1
  159. package/assets/esri/core/workers/chunks/1646699188ed0cd4ce24.js +0 -1
  160. package/assets/esri/core/workers/chunks/2999ae2a7d4d1ad6447b.js +0 -1
  161. package/assets/esri/core/workers/chunks/3541714d448958c9bc38.js +0 -1
  162. package/assets/esri/core/workers/chunks/629a257509b148ff38c0.js +0 -1
  163. package/assets/esri/core/workers/chunks/6b5fc9da8ae34c889b83.js +0 -1
  164. package/assets/esri/core/workers/chunks/707b34e15937c4f7902f.js +0 -1
  165. package/assets/esri/core/workers/chunks/770e609a6bd3533ceda9.js +0 -1
  166. package/assets/esri/core/workers/chunks/851baab753d9c8e967bd.js +0 -1
  167. package/assets/esri/core/workers/chunks/aa6c37f116c07ddca5fb.js +0 -1
  168. package/assets/esri/core/workers/chunks/bc0c3b5a5ab3fcb8f77a.js +0 -1
  169. package/assets/esri/core/workers/chunks/cac281604a41af9b1759.js +0 -1
  170. package/assets/esri/core/workers/chunks/d25c8c30ce4058937d4f.js +0 -1
  171. package/assets/esri/core/workers/chunks/d638ae7814acf6c0fb8e.js +0 -1
  172. package/assets/esri/core/workers/chunks/d6ce99a713afdb03e332.js +0 -1
  173. package/assets/esri/core/workers/chunks/dc3816eef53d17074eab.js +0 -1
  174. package/assets/esri/core/workers/chunks/dd70b060ea4f632c2430.js +0 -1
  175. package/assets/esri/core/workers/chunks/e2e5e8bd3406609d8996.js +0 -1
  176. package/assets/esri/core/workers/chunks/f6c815f7d3ca072172ce.js +0 -1
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../core/mathUtils.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import n from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../chunks/pe.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as p}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import b from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as T,MapServiceLayerViewHelper as G}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{defaultHighlightName as V}from"../../support/HighlightDefaults.js";import{TaskPriority as v}from"../../support/Scheduler.js";const I=[0,0];let P=class extends(b(p(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:v.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),T(this,this.layer)){const e=this._highlightView=new n({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new G({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=t?.name??V;return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,n=null;try{if(n=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(p){if(s(p))throw p;if(this.resampling&&"unknown"===n&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const C=P;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{makeHandle as i}from"../../../core/handleUtils.js";import t from"../../../core/Logger.js";import{isAbortError as s,waitTick as r}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{equals as h}from"../../../geometry/support/spatialReferenceUtils.js";import{GraphicsCollection as a}from"../../../support/GraphicsCollection.js";import"../../../core/Error.js";import"../../../core/scheduling.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Extent.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../core/mathUtils.js";import"../../../symbols/Font.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import n from"./graphics/GraphicsView2D.js";import"../../../core/accessorSupport/watch.js";import"../../../core/accessorSupport/tracking/SimpleTrackingTarget.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import{BitmapTileLayerView2D as p}from"./BitmapTileLayerView2D.js";import{LayerView2DMixin as m}from"./LayerView2D.js";import c from"./graphics/HighlightGraphicContainer.js";import{createBlankImage as g,resampleImage as f}from"./support/imageUtils.js";import u from"../tiling/TileInfoView.js";import d from"../tiling/TileKey.js";import j from"../tiling/TileQueue.js";import y from"../tiling/TileStrategy.js";import w from"../../layers/LayerView.js";import b from"../../layers/RefreshableLayerView.js";import{getHighlightGraphics as _}from"../../layers/support/highlightUtils.js";import{isMapServiceLayerView as T,MapServiceLayerViewHelper as G}from"../../layers/support/MapServiceLayerViewHelper.js";import{createQueryGeometry as q}from"../../support/drapedUtils.js";import{defaultHighlightName as V}from"../../support/HighlightDefaults.js";import{TaskPriority as v}from"../../support/Scheduler.js";const I=[0,0];let P=class extends(b(p(m(w)))){constructor(){super(...arguments),this._fetchQueue=null,this._highlightGraphics=new a,this._highlightView=null,this._popupHighlightHelper=null,this._tileStrategy=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||!1!==this.layer.resampling}get tilemapCache(){return"tilemapCache"in this.layer?this.layer.tilemapCache:null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume(),this._highlightView?.processUpdate(e)}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null,i=this.tilemapCache;if(this._tileInfoView=new u(this.layer.tileInfo,this.layer.fullExtent,i?.effectiveMinLOD,i?.effectiveMaxLOD),this._fetchQueue=new j({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(e,i)=>this.fetchTile(e,i),scheduler:this.scheduler,priority:v.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new y({cachePolicy:"keep",resampling:this.resampling,acquireTile:e=>this.acquireTile(e),releaseTile:e=>this.releaseTile(e),tileInfoView:this._tileInfoView}),T(this,this.layer)){const e=this._highlightView=new n({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new c(this.view.featuresTilingScheme),defaultPointSymbolEnabled:!1});this.container.addChild(this._highlightView.container),this._popupHighlightHelper=new G({createFetchPopupFeaturesQueryGeometry:(e,i)=>q(e,i,this.view),highlightGraphics:this._highlightGraphics,highlightGraphicUpdated:({graphic:i,property:t})=>e.graphicUpdateHandler({graphic:i,property:t}),layerView:this,updatingHandles:this._updatingHandles})}this.requestUpdate(),this.addAttachHandles(this._updatingHandles.add(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._popupHighlightHelper?.destroy(),this._highlightView?.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=this._popupHighlightHelper=null}async fetchPopupFeaturesAtLocation(e,i){return this._popupHighlightHelper?this._popupHighlightHelper.fetchPopupFeaturesAtLocation(e,i):[]}highlight(e,t){const s=_(e);if(0===s.length)return i();const r=t?.name??V;return this._addHighlightGraphics(s,r),i(()=>!this.destroyed&&this._removeHighlightGraphics(s,r))}_processHighlight(){const e=this._getHighlights();this._highlightView?.setHighlight(e)}_addHighlightGraphics(e,i){this._highlightGraphics.addMany(e),this._addHighlights(e.map(e=>e.uid),i)}_removeHighlightGraphics(e,i){this._highlightGraphics.removeMany(e),this._removeHighlights(e.map(e=>e.uid),i)}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){return h(this.layer.tileInfo?.spatialReference,e)}async doRefresh(){if(this.attached){if(this.suspended)return this._tileStrategy.clear(),void this.requestUpdate();this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updatingHandles.addPromise(this._enqueueTileFetch(e)))}}acquireTile(e){const i=this._bitmapView.createTile(e),t=i.bitmap;return[t.x,t.y]=this._tileInfoView.getTileCoords(I,i.key),t.resolution=this._tileInfoView.getTileResolution(i.key),[t.width,t.height]=this._tileInfoView.tileInfo.size,this._updatingHandles.addPromise(this._enqueueTileFetch(i)),this._bitmapView.addChild(i),this.requestUpdate(),i}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,i={}){return this.tilemapCache?this._fetchTileWithTilemapCache(e,i):this._fetchTileWithoutTilemapCache(e,i)}async _fetchTileWithoutTilemapCache(e,i={}){const{signal:t,resamplingLevel:r=0}=i;try{return await this._fetchImage(e,t)}catch(o){if(s(o))throw o;if(!this.resampling)return g(this._tileInfoView.tileInfo.size);if(r<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){const s=new d(t),o=await this._fetchTileWithoutTilemapCache(s,{...i,resamplingLevel:r+1});return f(this._tileInfoView,o,s,e)}}return g(this._tileInfoView.tileInfo.size)}}async _fetchTileWithTilemapCache(e,i={}){const t=this.tilemapCache,{signal:o,resamplingLevel:l=0}=i,h=new d(0,0,0,0);let a,n=null;try{if(n=await t.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:o}),!this.resampling&&h.level!==e.level)return await r(i),g(this._tileInfoView.tileInfo.size);a=await this._fetchImage(h,o)}catch(p){if(s(p))throw p;if(this.resampling&&"unknown"===n&&l<3){const t=this._tileInfoView.getTileParentId(e.id);if(t){h.set(t);try{a=await this._fetchTileWithTilemapCache(h,{...i,resamplingLevel:l+1})}catch{}}}}return a?this.resampling?f(this._tileInfoView,a,h,e):a:g(this._tileInfoView.tileInfo.size)}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key);e.bitmap.source=i,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(i){s(i)||t.getLogger(this).error(i)}this.requestUpdate()}}async _fetchImage(e,i){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:i})}};e([o()],P.prototype,"resampling",null),e([o()],P.prototype,"tilemapCache",null),P=e([l("esri.views.2d.layers.TileLayerView2D")],P);const C=P;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as p}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as g}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as y}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new p,this._proxy=new u({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(e,s,r,i,o){const c=e.processor,u=t(this._schema?.storage,c.storage),p=t(this._schema?.mesh.properties,c.mesh.properties),y=t(this._schema?.mesh.factory,c.mesh.factory),d=t(this._schema?.mesh.strategy,c.mesh.strategy),_=S(this._schema?.expressionProperties,c.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,w=m||f,I=p||y||d;if(!(u||I||(m||l||f))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,c),schema:c}),this._schema=c;const x=n.fromJSON(this._source.service.outSpatialReference),v=new b({fields:this._source.metadata.fieldsIndex,spatialReference:x}),M={currentUser:c.mesh.properties.currentUser};if((u||I||l)&&(await this._attributeStore.update(c.storage,v,this._source.metadata,s),this._strategy?.invalidateAttributeData(j(c))),!i&&!I&&!w)return!1;(d||p||w)&&await this._updateStrategy(c.mesh.strategy,x,o,j(c),M),this._updateSortKey(v,"sortKey"in c.mesh.properties?c.mesh.properties.sortKey:null);const k="dictionary"===c.mesh.factory.symbology.type?c.mesh.factory.symbology.fieldMap:null,U=new g(v,this._proxy,r,this._registry,k);return(y||"dictionary"===c.mesh.factory.symbology.type)&&(this._factory=await h.create(U,c.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new y({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch(e=>s(e));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,r,i);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r,i);break;case"cluster":this._strategy=await _.create(this._connection,e,t,this._source,this._attributeStore,r,i);break;case"track":this._strategy=await m.create(e,t,this._source,this._attributeStore,r,i)}for(const a of s)this._strategy.onSubscribe(a)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,s),r(t.signal);const i=await this._write(e,t.tile.createArcadeEvaluationOptions(j(this._schema)),s),a=t.tile.tileInfoView.getLODInfoAt(t.tile.key);r(t.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:e.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)c.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(c,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(j(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s){const a=e.subscription.tile,o=e.reader?.getCursor(),n=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,p=new c(a.key,this._strategy.enablePixelBuffering,h,u,n);if(!o)return p;const g=a.createArcadeEvaluationOptions(j(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(e.subscription));const n=this._getSortKeyValue(o,t);p.entityStart(o.getDisplayId(),n),this._factory.write(p,this._proxy,o,g,s,a.level),p.entityEnd()}return p}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function j(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{w as default};
5
+ import has from"../../../../core/has.js";import{destroyMaybe as e}from"../../../../core/maybe.js";import{notDeepEqual as t}from"../../../../core/object.js";import{throwIfNotAbortError as s,throwIfAborted as r,after as i}from"../../../../core/promiseUtils.js";import{diff as a}from"../../../../core/accessorSupport/diffUtils.js";import{ignoreConnectionErrors as o}from"../../../../core/workers/utils.js";import n from"../../../../geometry/SpatialReference.js";import{MultiTileMeshData as c}from"../../engine/webgl/mesh/MultiTileMeshData.js";import{FeatureMeshFactory as h}from"../../engine/webgl/mesh/factories/FeatureMeshFactory.js";import{ResourceProxy as u}from"../../engine/webgl/mesh/factories/ResourceProxy.js";import{MeshWriterRegistry as p}from"../../engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{MatcherContext as g}from"../../engine/webgl/util/MatcherContext.js";import{ProcessorTileMessageQueue as y}from"./ProcessorTileMessageQueue.js";import{BinningStrategy as d}from"./processor/BinningStrategy.js";import{ClusterStrategy as _}from"./processor/ClusterStrategy.js";import{FeatureUpdateStrategy as l}from"./processor/FeatureUpdateStrategy.js";import{TrackStrategy as m}from"./processor/TrackStrategy.js";import{AttributeStore as f}from"./support/AttributeStore.js";import{ComputedAttributeStorage as b}from"./support/ComputedAttributeStorage.js";class w{constructor(e,t){this._connection=e,this._source=t,this._version=1,this._registry=new p,this._proxy=new u({fetch:(e,t)=>this._connection.layerView.fetch(e,t),fetchDictionary:(e,t)=>this._connection.layerView.fetchDictionary(e,t)}),this._attributeStore=new f({isLocal:!1,update:e=>o(this._connection.container.updateAttributeView(e))})}destroy(){this._proxy.destroy(),this._strategy?.destroy(),this._attributeStore.destroy()}get aggregateQueryEngine(){return this._strategy?.aggregateQueryEngine}get version(){return this._version}getDisplayFeatures(e){return this._strategy?this._strategy.getDisplayFeatures(e):{features:[],aggregates:[],tracks:[]}}getDisplayIds(e){const t={};return this._strategy?(this._strategy.displayMap(e,e=>e,(e,s,r)=>{t[r]=e}),t):t}getFeatureObjectIdsForAggregate(e){return this._strategy?this._strategy.getFeatureObjectIdsForAggregate(e):[]}onSubscribe(e){this._strategy?.onSubscribe(e)}onUnsubscribe(e){this._strategy?.onUnsubscribe(e)}requiresInvalidation(){return this._strategy?.requiresInvalidation()??!1}async update(e,s,r,i,o){const c=e.processor,u=t(this._schema?.storage,c.storage),p=t(this._schema?.mesh.properties,c.mesh.properties),y=t(this._schema?.mesh.factory,c.mesh.factory),d=t(this._schema?.mesh.strategy,c.mesh.strategy),_=S(this._schema?.expressionProperties,c.expressionProperties),l=_.some(e=>this._attributeStore.hasArcadeDependency(e)),m=_.some(e=>this._factory?.hasArcadeDependency(e)??!1),f=_.some(e=>this._strategy?.hasArcadeDependency(e))||this._strategy?.isAggregate&&l,w=m||f,I=p||y||d;if(!(u||I||(m||l||f))&&!i)return!1;has("esri-2d-update-debug")&&console.debug(`Version[${this._version}] SymbolProcessor.update`,{changes:a(this._schema,c),schema:c}),this._schema=c;const x=n.fromJSON(this._source.service.outSpatialReference),v=new b({fields:this._source.metadata.fieldsIndex,spatialReference:x}),M={currentUser:c.mesh.properties.currentUser};if((u||I||l)&&(await this._attributeStore.update(c.storage,v,this._source.metadata,s),this._strategy?.invalidateAttributeData(j(c))),!i&&!I&&!w)return!1;(d||p||w)&&await this._updateStrategy(c.mesh.strategy,x,o,j(c),M),this._updateSortKey(v,"sortKey"in c.mesh.properties?c.mesh.properties.sortKey:null);const k="dictionary"===c.mesh.factory.symbology.type?c.mesh.factory.symbology.fieldMap:null,U=new g(v,this._proxy,r,this._registry,k);return(y||"dictionary"===c.mesh.factory.symbology.type)&&(this._factory=await h.create(U,c.mesh.factory)),this._version=s,!0}async applyOverrideUpdate(e){if(!this._strategy)return;const t=this._strategy.applyOverrideUpdate(e);for await(const r of t)try{await this._process(r)}catch(s){}}async updateChunks(){await this._doUpdateChunks(),this._strategy?.afterUpdateChunks()}async removeChunks(e){this._strategy?.removeChunks(e),this._attributeStore.incrementDisplayIdGeneration()}updateHighlight({highlights:e}){if(!this._strategy||!this._strategy.hasSubscribers)return void this._attributeStore.setHighlight(e.map(({objectId:e,highlightFlags:t})=>({objectId:e,highlightFlags:t,displayId:-1})),e);const t=this._strategy.displayMap(e,({objectId:e})=>e,(e,{highlightFlags:t},s)=>({objectId:s,displayId:e,highlightFlags:t}));this._attributeStore.setHighlight(t,e)}invalidate(){this._strategy&&this._strategy.invalidate()}async _doUpdateChunks(){if(!this._strategy)return;const e=this._strategy.updateChunks(),t=[],r=new Map;for await(const a of e){let e=r.get(a.id);null==e&&(e=new y({concurrency:16,process:e=>this._process(e)}),r.set(a.id,e));const i=e.push(a).catch(e=>s(e));t.push(i)}try{await Promise.all(t)}catch(i){}has("esri-2d-update-debug")&&console.log("SendUpdates"),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")&&console.log("SendUpdates.await")}async _updateStrategy(e,t,s,r,i){switch(this._strategy?.destroy(),e.type){case"feature":this._strategy=new l(this._source,this._attributeStore,r,i);break;case"binning":this._strategy=await d.create(e,t,this._source,this._attributeStore,r,i);break;case"cluster":this._strategy=await _.create(this._connection,e,t,this._source,this._attributeStore,r,i);break;case"track":this._strategy=await m.create(e,t,this._source,this._attributeStore,r,i)}for(const a of s)this._strategy.onSubscribe(a)}async _updateSortKey(t,s){if(this._sortInfo=e(this._sortInfo?.computed),null!=s){const e=s.byRenderer?null:await t.createComputedField(s);this._sortInfo={...s,computed:e}}}async _process(e){const t=e.subscription;if(has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process`)}const s={currentUser:this._schema?.mesh.properties.currentUser};await this._fetchResources(e,s),r(t.signal);const i=await this._write(e,t.tile.createArcadeEvaluationOptions(j(this._schema)),s),a=t.tile.tileInfoView.getLODInfoAt(t.tile.key);r(t.signal);const{message:o,transferList:n}=i.serialize(a),c={objectIdMap:null,inner:e.createMessage(o,this._version,this._attributeStore.epoch)};if(this._schema?.mesh.properties.returnMeshObjectId){c.objectIdMap={};const t=e.reader?.getCursor();if(t)for(;t.next();)c.objectIdMap[t.getDisplayId()]=t.getObjectId()}if(r(t.signal),await this._connection.container.onMessage(c,{signal:t.signal,transferList:n}),this._attributeStore.sendUpdates(),has("esri-2d-update-debug")){const s=t.tile;console.debug(`Version[${this._version}] Tile[${s.key.id}, end=${e.end}] Processor._process.await`)}}async _fetchResources(e,t){await this._fetchMatcherResources(e),await this._fetchWriterResources(e,t)}async _fetchMatcherResources(e){if(e.reader)return this._factory.enqueueMatcherRequests(this._proxy,e.reader)}async _fetchWriterResources(e,t){if(!e.reader)return;const s=e.reader.getCursor(),r=e.subscription.tile.createArcadeEvaluationOptions(j(this._schema));for(;s.next();)this._factory.enqueueWriterRequests(this._proxy,s,r,t);await this._proxy.fetchEnqueuedResources()}async _write(e,t,s){const a=e.subscription.tile,o=e.reader?.getCursor(),n=o?.getSize()??0,h=a.tileInfoView.tileInfo.isWrappable,u=a.tileInfoView.tileInfo.spatialReference.isWGS84,p=new c(a.key,this._strategy.enablePixelBuffering,h,u,n);if(!o)return p;const g=a.createArcadeEvaluationOptions(j(this._schema));let y=0;for(;o.next();){++y%1e3||(await i(0),r(e.subscription));const n=this._getSortKeyValue(o,t);p.entityStart(o.getDisplayId(),n),this._factory.write(p,this._proxy,o,g,s,a.level),p.entityEnd()}return p}_getSortKeyValue(e,t){if(!this._sortInfo)return 0;const{computed:s,order:r,byRenderer:i}=this._sortInfo,a=i?this._factory.getSortKey(e,t):s?.read(e,t);return null==a||isNaN(a)?0:a*("asc"===r?-1:1)}}function S(e,t){const s=[];return e?.timeExtent?.start===t.timeExtent?.start&&e?.timeExtent?.end===t.timeExtent?.end||s.push("timeProperties"),s}function j(e){const{timeZone:t}=e?.mesh.properties??{},{timeExtent:s}=e?.expressionProperties??{};return{timeZone:t,timeExtent:s}}export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- class t{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class e{constructor(t,e,s){this._source=t,this._attributeStore=e,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}requiresInvalidation(){return!1}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,t=>t,t=>t)}getDisplayAndObjectIds(t){return this.displayMap(t,t=>t,(t,e,s)=>[t,s])}afterUpdateChunks(){}}export{e as AProcessorStrategy,t as ASendState};
5
+ class t{constructor(t){this.subscription=t,this.handledChunks=new Set}destroy(){}}class e{constructor(t,e,s){this._source=t,this._attributeStore=e,this._sqlOptions=s,this._sendStates=new Map}destroy(){}get enablePixelBuffering(){return!0}get isAggregate(){return!1}onSubscribe(t){const e=this.createState(t);this._sendStates.set(t.key.id,e),this.updateChunks()}onUnsubscribe(t){this._sendStates.get(t.key.id)?.destroy(),this._sendStates.delete(t.key.id)}get hasSubscribers(){return this._sendStates.size>0}requiresInvalidation(){return!1}invalidate(){const t=Array.from(this._sendStates.values());this._sendStates.clear();for(const e of t)e.destroy(),this.onSubscribe(e.subscription)}invalidateAttributeData(t){}hasArcadeDependency(t){return!1}getFeatureObjectIdsForAggregate(t){throw new Error("InternalError: AggregateId lookup not supported")}getDisplayIds(t){return this.displayMap(t,t=>t,t=>t)}getDisplayAndObjectIds(t){return this.displayMap(t,t=>t,(t,e,s)=>[t,s])}afterUpdateChunks(){}}export{e as AProcessorStrategy,t as ASendState};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a,AttributeDataType as n}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as o}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as l}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as h}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as d,DEBUG_ATTR_UPDATES as c}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as u}from"./DisplayIdGenerator.js";import p from"./FeatureFilterEvaluator.js";import{PixelType as g}from"../../../../webgl/enums.js";function _(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const y=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),m=d(c,y()),f={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class b{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=o(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=o(t),r=1<<e;0!==(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):y().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=l(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class x{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new u,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=g.FLOAT;m(`Creating AttributeStore ${f.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:g.UNSIGNED_BYTE,layout:1},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:g.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map(t=>t?p.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map(async t=>{const i=await this._bind(e,t);this._updateReferences(i)}));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map(async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)}))}}}setHighlight(t,e){const i=this._getBlock(0);i.unsetComponentAllTexels(0,(1<<a)-1);for(const{displayId:s,highlightFlags:r}of t){if(null==s)continue;const t=o(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=o(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,l=1,d=4;let c=null;a&&(c="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,c?.size&&c.forEach((t,s)=>{const a=s*l%d,o=Math.floor(s*l/d),c=this._getBlock(o+n.VV);let u=t.field?.read(e,i);t.valueRepresentation&&(u=_(u,t.valueRepresentation));(null===u||isNaN(u)||u===1/0||u===-1/0)&&(u=h),c.setData(r,a,u)}))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map(t=>null!=t?t.toMessage():null),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(n.Animation),this._getBlock(n.GPGPU),this._getBlock(n.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null)})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;m(`Initializing AttributeBlock at index ${t}`);const i=new b(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;m("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return y().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{x as AttributeStore,_ as getVisualVariableSizeValueRepresentationRatio};
5
+ import t from"../../../../../core/Error.js";import has from"../../../../../core/has.js";import e from"../../../../../core/Logger.js";import{diff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{collectExpressionDependencies as s}from"../../../../../support/ArcadeExpression.js";import{attributeStoreInitialSize as r,maxHighlightReasons as a,AttributeDataType as n}from"../../../engine/webgl/definitions.js";import{getDisplayIdTexel as o}from"../../../engine/webgl/DisplayId.js";import{getPixelArrayCtor as l}from"../../../engine/webgl/Utils.js";import{nanMagicNumber as h}from"../../../engine/webgl/shaderGraph/techniques/shaders/constants.js";import{createDebugLogger as d,DEBUG_ATTR_UPDATES as c}from"../../../engine/webgl/util/debug.js";import{DisplayIdGenerator as u}from"./DisplayIdGenerator.js";import p from"./FeatureFilterEvaluator.js";import{PixelType as g}from"../../../../webgl/enums.js";function _(t,e){if(!t||!e)return t;switch(e){case"radius":case"distance":return 2*t;case"diameter":case"width":return t;case"area":return Math.sqrt(t)}return t}const y=()=>e.getLogger("esri.views.layers.2d.features.support.AttributeStore"),m=d(c,y()),f={sharedArrayBuffer:has("esri-shared-array-buffer"),atomics:has("esri-atomics")};class b{constructor(t,e,i){this.size=0,this.texelSize=4,this.dirtyStart=0,this.dirtyEnd=0;const{pixelType:s,layout:r,textureOnly:a}=e;this.textureOnly=a||!1,this.pixelType=s,this.layout=r,this._resetRange(),this.size=t,this.isLocal=i,a||(this.data=this._initData(s,t))}get buffer(){return this.data?.buffer}unsetComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]&=~e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponentAllTexels(t,e){const i=this.data;for(let s=0;s<this.size*this.size;s++)i[s*this.texelSize+t]|=255&e;this.dirtyStart=0,this.dirtyEnd=this.size*this.size-1}setComponent(t,e,i){const s=this.data;for(const r of i)s[r*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,r),this.dirtyEnd=Math.max(this.dirtyEnd,r)}setComponentTexel(t,e,i){this.data[i*this.texelSize+t]|=e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}unsetComponentTexel(t,e,i){this.data[i*this.texelSize+t]&=~e,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i)}getData(t,e){const i=o(t);return this.data[i*this.texelSize+e]}setData(t,e,i){const s=o(t),r=1<<e;0!==(this.layout&r)?null!=this.data&&(this.data[s*this.texelSize+e]=i,this.dirtyStart=Math.min(this.dirtyStart,s),this.dirtyEnd=Math.max(this.dirtyEnd,s)):y().error("mapview-attributes-store","Tried to set a value for a texel's readonly component")}expand(t){if(this.size=t,!this.textureOnly){const e=this._initData(this.pixelType,t),i=this.data;e.set(i),this.data=e}}toMessage(){const t=this.dirtyStart,e=this.dirtyEnd,i=this.texelSize;if(t>e)return null;this._resetRange();const s=!this.isLocal,r=this.pixelType,a=this.layout,n=this.data;return{start:t,end:e,data:s&&n.slice(t*i,(e+1)*i)||null,pixelType:r,layout:a}}_initData(t,e){const i=ArrayBuffer,s=l(t),r=new s(new i(e*e*4*s.BYTES_PER_ELEMENT));for(let a=0;a<r.length;a+=4)r[a+1]=255;return r}_resetRange(){this.dirtyStart=2147483647,this.dirtyEnd=0}}class x{constructor(t){this._client=t,this._filters=[],this._blocks=new Array,this._attributeComputeInfo=null,this._abortController=new AbortController,this._size=r,this._idsToHighlight=new Map,this._arcadeDependencies=new Set,this._initialized=!1,this.version=0,this._idGenerator=new u,this._epoch=1}destroy(){this._abortController.abort()}_initialize(){if(null!=this._blockDescriptors)return;const t=g.FLOAT;m(`Creating AttributeStore ${f.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:g.UNSIGNED_BYTE,layout:1},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:g.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:t,layout:15},{pixelType:g.FLOAT,layout:15}],this._blocks=this._blockDescriptors.map(()=>null)}get hasHighlight(){return this._idsToHighlight.size>0}createDisplayIdForObjectId(t){return this._idGenerator.createIdForObjectId(t)}releaseDisplayIdForObjectId(t){return this._idGenerator.releaseIdForObjectId(t)}getDisplayIdForObjectId(t){return this._idGenerator.getDisplayIdForObjectId(t)}incrementDisplayIdGeneration(){this._idGenerator.incrementGeneration()}hasArcadeDependency(t){return this._arcadeDependencies.has(t)}releaseAllIds(){this._idGenerator.releaseAll()}async update(t,e,s,r=0){const a=i(this._schema,t);if(this.version=r,a&&(has("esri-2d-update-debug")&&console.debug(`Version[${r}] AttributeStore.update`,{changed:a}),this._schema=t,this._attributeComputeInfo=null,this._initialize(),null!=t))if(s&&(this._filters=await Promise.all(t.filters.map(t=>t?p.create({geometryType:s.geometryType,hasM:!1,hasZ:!1,timeInfo:s.timeInfo,fieldsIndex:s.fieldsIndex,spatialReference:s.outSpatialReference,filterJSON:t}):null))),"multi"!==t.type)this._attributeComputeInfo={type:"feature",map:new Map},await Promise.all(t.bindings.map(async t=>{const i=await this._bind(e,t);this._updateReferences(i)}));else{this._attributeComputeInfo={type:"multi",keyField:t.keyField,map:new Map};for(const i in t.bindings){const s=t.bindings[i];await Promise.all(s.map(async t=>{const s=await this._bind(e,t,parseInt(i,10));this._updateReferences(s)}))}}}setHighlight(t,e){let i=null;for(const{displayId:s,highlightFlags:r}of t){if(null==s||-1===s)continue;i||(i=this._getBlock(0),i.unsetComponentAllTexels(0,(1<<a)-1));const t=o(s);i.setComponent(0,r,[t])}this._idsToHighlight.clear();for(const{objectId:s,highlightFlags:r}of t)this._idsToHighlight.set(s,r);for(const{objectId:s,highlightFlags:r}of e)this._idsToHighlight.set(s,r)}setData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(e).setData(t,i,s)}getData(t,e,i){return this._getBlock(e).getData(t,i)}getHighlightFlags(t){return this._idsToHighlight.get(t)||0}unsetAttributeData(t){const e=o(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e,i,s){const r=o(t);this._ensureSizeForTexel(r),this._getBlock(0).setData(r,0,this.getFilterFlags(e,s));const a=this._attributeComputeInfo,l=1,d=4;let c=null;a&&(c="multi"===a.type?a.map.get(e.readAttribute(a.keyField)):a.map,c?.size&&c.forEach((t,s)=>{const a=s*l%d,o=Math.floor(s*l/d),c=this._getBlock(o+n.VV);let u=t.field?.read(e,i);t.valueRepresentation&&(u=_(u,t.valueRepresentation));(null===u||isNaN(u)||u===1/0||u===-1/0)&&(u=h),c.setData(r,a,u)}))}get epoch(){return this._epoch}sendUpdates(){const t=this._blocks.map(t=>null!=t?t.toMessage():null),e=this._getInitArgs();has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.start"),this._client.update({initArgs:e,blockData:t,version:this.version,sendUpdateEpoch:this._epoch}),this._epoch+=1,has("esri-2d-log-updating")&&console.log("AttributeStore: _doSendUpdate.end")}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}async _bind(t,e,i){const s=await t.createComputedField(e),{valueRepresentation:r}=e,a=this._attributeComputeInfo;if("multi"===a.type){const t=a.map.get(i)??new Map;t.set(e.binding,{field:s,valueRepresentation:r}),a.map.set(i,t)}else a.map.set(e.binding,{field:s,valueRepresentation:r});return s}_getInitArgs(){return this._initialized?null:(this._initialized=!0,this._getBlock(n.Animation),this._getBlock(n.GPGPU),this._getBlock(n.LocalTimeOrigin),{blockSize:this._size,blockDescriptors:this._blocks.map(t=>null!=t?{textureOnly:t.textureOnly,buffer:t.buffer,pixelType:t.pixelType}:null)})}_getBlock(t){const e=this._blocks[t];if(null!=e)return e;m(`Initializing AttributeBlock at index ${t}`);const i=new b(this._size,this._blockDescriptors[t],this._client.isLocal);return this._blocks[t]=i,this._initialized=!1,i}_expand(){if(this._size<this._schema.capabilities.maxTextureSize){const t=this._size<<=1;m("Expanding block size to",t,this._blocks);for(const e of this._blocks)e?.expand(t);return this._initialized=!1,this._size=t,0}return y().error(new t("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}_updateReferences(t){s(this._arcadeDependencies,t)}isVisible(t){return!!(this._getBlock(0).getData(t,0)&1<<a)}getFilterFlags(t,e){let i=0;for(let r=0;r<this._filters.length;r++){const s=!!(1<<r),a=this._filters[r];i|=(!s||null==a||a.check(t,e)?1:0)<<r}let s=0;if(this._idsToHighlight.size){const e=t.getObjectId();s=this.getHighlightFlags(e)}return i<<a|s}}export{x as AttributeStore,_ as getVisualVariableSizeValueRepresentationRatio};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- export{Stage}from"./engine/Stage.js";export{LabelManager}from"./LabelManager.js";export{default as GraphicsView2D}from"./layers/graphics/GraphicsView2D.js";export{default as GraphicContainer}from"./layers/graphics/GraphicContainer.js";export{default as MapViewNavigation}from"./navigation/MapViewNavigation.js";export{default as MagnifierView2D}from"./magnifier/MagnifierView2D.js";export{default as GridView2D}from"./grid/GridView2D.js";
5
+ export{Stage}from"./engine/Stage.js";export{ChildStage,ParentStage}from"./engine/ParentChildStage.js";export{LabelManager}from"./LabelManager.js";export{default as GraphicsView2D}from"./layers/graphics/GraphicsView2D.js";export{default as GraphicContainer}from"./layers/graphics/GraphicContainer.js";export{default as MapViewNavigation}from"./navigation/MapViewNavigation.js";export{default as MagnifierView2D}from"./magnifier/MagnifierView2D.js";export{default as GridView2D}from"./grid/GridView2D.js";
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import a from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{removeMaybe as o,destroyMaybe as l,abortMaybe as c}from"../../../core/maybe.js";import{createAbortError as d,isAborted as h,onAbort as w,createResolver as y}from"../../../core/promiseUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";const V="analyses-owner-handles";var p,A;!function(e){e[e.PENDING=0]="PENDING",e[e.CREATED=1]="CREATED"}(p||(p={})),function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED"}(A||(A={}));let v=class extends s{constructor(e){super(e),this._allAnalysisViews=new t,this._creatingViewCount=0,this._items=new Map,this._scheduledUpdateHandle=null,this._attachedToViewResolver=f(),this._analysisModules={"area-measurement":{module:null},dimension:{module:null},"direct-line-measurement":{module:null},"line-of-sight":{module:null},slice:{module:null},viewshed:{module:null}},this._emitOnView=(e,s)=>this.view.emit(e,s)}destroy(){this._disconnectOwners(),this._attachedToViewResolver.reject(d("AnalysisViewManager was destroyed"))}attach(){this._connectOwners(),this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners(),this._attachedToViewResolver.reject(d()),this._attachedToViewResolver=f()}get updating(){return!this.view.ready||0!==this._creatingViewCount||this._allAnalysisViews.some(e=>e.updating)}get testInfo(){}async whenAnalysisView(e){await this._attachedToViewResolver.promise;const s=this._items.get(e);if(null==s||s.state.list===A.REMOVED){throw new a("AnalysisViewManager:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e})}return s.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses),V)}_disconnectOwners(){this.removeHandles(V),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const t of e)this._addAnalysis(t);const s=e.on("after-add",e=>this._addAnalysis(e.item)),i=e.on("after-remove",e=>this._removeAnalysis(e.item));return n(()=>{s.remove(),i.remove();for(const s of e)this._removeAnalysis(s)})}_addAnalysis(e){const s=this._items.get(e);if(null==s){const s={state:{view:p.PENDING,list:A.ADDED},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,s),s.createAnalysisViewTask=i(i=>this._createAnalysisViewPromise(s,i).then(s=>(this._emitOnView("analysis-view-create",{analysis:e,analysisView:s}),s),s=>{throw this._emitOnView("analysis-view-create-error",{analysis:e,error:s}),s}))}else s.state.list=A.ADDED}_removeAnalysis(e){const s=this._items.get(e);null!=s?(s.state.list=A.REMOVED,this._scheduleUpdate()):r.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=m(()=>this._update()))}_update(){this._scheduledUpdateHandle=o(this._scheduledUpdateHandle),this._items.forEach(e=>{if(e.state.list!==A.REMOVED)return;const{analysis:s,view:i}=e;switch(this._items.delete(s),e.state.view){case p.PENDING:e.createAnalysisViewTask=c(e.createAnalysisViewTask);break;case p.CREATED:null!=i&&(this._allAnalysisViews.remove(i),e.view=l(i),e.createAnalysisViewTask=null,this._emitOnView("analysis-view-destroy",{analysis:s,analysisView:i}))}})}async _createAnalysisViewPromise(e,s){const i=e.analysis,t=i.type,a=this._analysisModules[t];if(this._creatingViewCount+=1,null==a.module)try{a.module=await this._loadAnalysisModule(t)}catch(o){throw this._creatingViewCount-=1,o}if(h(s))throw this._creatingViewCount-=1,d("AnalysisView creation aborted");const n=new a.module.default({analysis:i,view:this.view});let r=!0;w(s,()=>{r&&this._destroyAnalysisView(i,n)});try{await n.when()}catch(o){throw r=!1,this._destroyAnalysisView(i,n),o}if(h(s))throw d();return r=!1,e.view=n,e.state.view=p.CREATED,this._allAnalysisViews.add(n),this._creatingViewCount-=1,n}_destroyAnalysisView(e,s){s.destroyed||(this._creatingViewCount-=1,s.destroy(),this._emitOnView("analysis-view-destroy",{analysis:e,analysisView:s}))}_loadAnalysisModule(e){switch(e){case"area-measurement":return import("./AreaMeasurementAnalysisView3D.js");case"dimension":return import("./DimensionAnalysisView3D.js");case"direct-line-measurement":return import("./DirectLineMeasurementAnalysisView3D.js");case"line-of-sight":return import("./LineOfSightAnalysisView3D.js");case"slice":return import("./SliceAnalysisView3D.js");case"viewshed":return import("./ViewshedAnalysisView3D.js")}}};function f(){const e=y();return e.promise.catch(()=>{}),e}e([u()],v.prototype,"updating",null),e([u({constructOnly:!0})],v.prototype,"view",void 0),e([u()],v.prototype,"_allAnalysisViews",void 0),e([u()],v.prototype,"_creatingViewCount",void 0),v=e([_("esri.views.3d.analysis.AnalysisViewManager3D")],v);const D=v;export{D as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import s from"../../../core/Accessor.js";import{createTask as i}from"../../../core/asyncUtils.js";import t from"../../../core/Collection.js";import a from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import r from"../../../core/Logger.js";import{removeMaybe as o,destroyMaybe as l,abortMaybe as c}from"../../../core/maybe.js";import{createAbortError as d,isAborted as h,onAbort as w,createResolver as m}from"../../../core/promiseUtils.js";import{schedule as u}from"../../../core/scheduling.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";const V="analyses-owner-handles";var p,A;!function(e){e[e.PENDING=0]="PENDING",e[e.CREATED=1]="CREATED"}(p||(p={})),function(e){e[e.ADDED=0]="ADDED",e[e.REMOVED=1]="REMOVED"}(A||(A={}));let v=class extends s{constructor(e){super(e),this._allAnalysisViews=new t,this._creatingViewCount=0,this._items=new Map,this._scheduledUpdateHandle=null,this._attachedToViewResolver=f(),this._analysisModules={"area-measurement":{module:null},dimension:{module:null},"direct-line-measurement":{module:null},"line-of-sight":{module:null},slice:{module:null},viewshed:{module:null},"volume-measurement":{module:null}},this._emitOnView=(e,s)=>this.view.emit(e,s)}destroy(){this._disconnectOwners(),this._attachedToViewResolver.reject(d("AnalysisViewManager was destroyed"))}attach(){this._connectOwners(),this._attachedToViewResolver.resolve()}detach(){this._disconnectOwners(),this._attachedToViewResolver.reject(d()),this._attachedToViewResolver=f()}get updating(){return!this.view.ready||0!==this._creatingViewCount||this._allAnalysisViews.some(e=>e.updating)}get testInfo(){}async whenAnalysisView(e){await this._attachedToViewResolver.promise;const s=this._items.get(e);if(null==s||s.state.list===A.REMOVED){throw new a("AnalysisViewManager:no-analysisview-for-analysis","The analysis has not been added to view.analyses",{analysis:e})}return s.createAnalysisViewTask.promise}_connectOwners(){this.addHandles(this._connectAnalysesCollection(this.view.analyses),V)}_disconnectOwners(){this.removeHandles(V),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const t of e)this._addAnalysis(t);const s=e.on("after-add",e=>this._addAnalysis(e.item)),i=e.on("after-remove",e=>this._removeAnalysis(e.item));return n(()=>{s.remove(),i.remove();for(const s of e)this._removeAnalysis(s)})}_addAnalysis(e){const s=this._items.get(e);if(null==s){const s={state:{view:p.PENDING,list:A.ADDED},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,s),s.createAnalysisViewTask=i(i=>this._createAnalysisViewPromise(s,i).then(s=>(this._emitOnView("analysis-view-create",{analysis:e,analysisView:s}),s),s=>{throw this._emitOnView("analysis-view-create-error",{analysis:e,error:s}),s}))}else s.state.list=A.ADDED}_removeAnalysis(e){const s=this._items.get(e);null!=s?(s.state.list=A.REMOVED,this._scheduleUpdate()):r.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=u(()=>this._update()))}_update(){this._scheduledUpdateHandle=o(this._scheduledUpdateHandle),this._items.forEach(e=>{if(e.state.list!==A.REMOVED)return;const{analysis:s,view:i}=e;switch(this._items.delete(s),e.state.view){case p.PENDING:e.createAnalysisViewTask=c(e.createAnalysisViewTask);break;case p.CREATED:null!=i&&(this._allAnalysisViews.remove(i),e.view=l(i),e.createAnalysisViewTask=null,this._emitOnView("analysis-view-destroy",{analysis:s,analysisView:i}))}})}async _createAnalysisViewPromise(e,s){const i=e.analysis,t=i.type,a=this._analysisModules[t];if(this._creatingViewCount+=1,null==a.module)try{a.module=await this._loadAnalysisModule(t)}catch(o){throw this._creatingViewCount-=1,o}if(h(s))throw this._creatingViewCount-=1,d("AnalysisView creation aborted");const n=new a.module.default({analysis:i,view:this.view});let r=!0;w(s,()=>{r&&this._destroyAnalysisView(i,n)});try{await n.when()}catch(o){throw r=!1,this._destroyAnalysisView(i,n),o}if(h(s))throw d();return r=!1,e.view=n,e.state.view=p.CREATED,this._allAnalysisViews.add(n),this._creatingViewCount-=1,n}_destroyAnalysisView(e,s){s.destroyed||(this._creatingViewCount-=1,s.destroy(),this._emitOnView("analysis-view-destroy",{analysis:e,analysisView:s}))}_loadAnalysisModule(e){switch(e){case"area-measurement":return import("./AreaMeasurementAnalysisView3D.js");case"dimension":return import("./DimensionAnalysisView3D.js");case"direct-line-measurement":return import("./DirectLineMeasurementAnalysisView3D.js");case"line-of-sight":return import("./LineOfSightAnalysisView3D.js");case"slice":return import("./SliceAnalysisView3D.js");case"viewshed":return import("./ViewshedAnalysisView3D.js");case"volume-measurement":return import("./VolumeMeasurementAnalysisView3D.js")}}};function f(){const e=m();return e.promise.catch(()=>{}),e}e([y()],v.prototype,"updating",null),e([y({constructOnly:!0})],v.prototype,"view",void 0),e([y()],v.prototype,"_allAnalysisViews",void 0),e([y()],v.prototype,"_creatingViewCount",void 0),v=e([_("esri.views.3d.analysis.AnalysisViewManager3D")],v);const D=v;export{D as default};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import VolumeMeasurementAnalysisView3D = __esri.VolumeMeasurementAnalysisView3D;
4
+ export default VolumeMeasurementAnalysisView3D;
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{_ as s}from"../../../chunks/tslib.es6.js";import o from"../../../core/Accessor.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as t}from"./AnalysisView3D.js";let l=class extends(t(o)){constructor(s){super(s),this.type="volume-measurement-view-3d",this.analysis=null}get result(){return null}};s([r({readOnly:!0})],l.prototype,"type",void 0),s([r({constructOnly:!0,nonNullable:!0})],l.prototype,"analysis",void 0),s([r()],l.prototype,"result",null),l=s([e("esri.views.3d.analysis.VolumeMeasurementAnalysisView3D")],l);const p=l;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{destroyMaybe as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as p}from"../../../layers/support/timeSupport.js";import o from"../../../rest/support/Query.js";import{UpdatePolicy as l}from"../webgl-engine/lib/UpdatePolicy.js";import{defaultHighlightName as u}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as h,hasLayerBasedScaleVisibility as y}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as c}from"../../support/projectionUtils.js";const g=g=>{let d=class extends g{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=l.SYNC,this.slicePlaneEnabled=!1,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new r("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await c(this.layer.fullExtent,this.view.spatialReference):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=i(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return y()?h(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return p(this.layer,this.view?.timeExtent,this._get("timeExtent"))}getHit(e){if(has("feature-pipeline-3d-test"))return this._getHitMock(e);const t=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==t)return null;const r=a(t,this.layer);return{type:"graphic",graphic:r,layer:r.layer}}_getHitMock(e){const r=this.layer,i={};i[this.layer.objectIdField]=e;const s=new t({layer:r,sourceLayer:r,visible:!0,symbol:null,attributes:i,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():o.from(e)}highlight(e,t){return this.graphicsPipeline.highlight(e,t?.name??u)}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new r("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAttributeBins(){throw new Error("Not implemented")}queryAggregates(){throw new Error("Not implemented")}};return e([s()],d.prototype,"graphicsPipeline",void 0),e([s({readOnly:!0})],d.prototype,"dataUpdating",null),e([s()],d.prototype,"highlightOptions",void 0),e([s()],d.prototype,"suspended",void 0),e([s({readOnly:!0})],d.prototype,"legendEnabled",null),e([s({readOnly:!0})],d.prototype,"visibleAtCurrentScale",null),e([s()],d.prototype,"updating",void 0),e([s({readOnly:!0})],d.prototype,"updatePolicy",void 0),e([s({type:Boolean})],d.prototype,"slicePlaneEnabled",void 0),e([s({readOnly:!0})],d.prototype,"suspendInfo",void 0),e([s()],d.prototype,"symbologySnappingSupported",null),e([s({readOnly:!0})],d.prototype,"hasAllFeatures",null),e([s({readOnly:!0})],d.prototype,"hasAllFeaturesInView",null),e([s({readOnly:!0})],d.prototype,"hasFullGeometries",null),e([s({readOnly:!0})],d.prototype,"timeExtent",null),d=e([n("esri.views.3d.layers.FeatureLikeLayerView3D")],d),d};export{g as FeatureLikeLayerView3D};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../Graphic.js";import i from"../../../core/Error.js";import{makeHandle as r}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{destroyMaybe as s}from"../../../core/maybe.js";import n from"../../../core/ReactiveMap.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{hydrateGraphic as a}from"../../../layers/graphics/hydratedFeatures.js";import{combineTimeExtent as p}from"../../../layers/support/timeSupport.js";import h from"../../../rest/support/Query.js";import{isQuery as u,isGraphic as g}from"../../../support/guards.js";import{attributeLookup as c}from"./support/attributeUtils.js";import{normalizeHighlightTargetExceptQuery as y,emptyHighlightHandle as d,isObjectId as m}from"./support/highlightUtils.js";import{UpdatePolicy as f}from"../webgl-engine/lib/UpdatePolicy.js";import{defaultHighlightName as P}from"../../support/HighlightDefaults.js";import{isInEffectiveScaleRange as b,hasLayerBasedScaleVisibility as v}from"../../support/layerViewUtils.js";import{projectWithZConversionSilent as w}from"../../support/projectionUtils.js";const j=j=>{let I=class extends j{constructor(){super(...arguments),this.highlightOptions=null,this.updatePolicy=f.SYNC,this.slicePlaneEnabled=!1,this._highlightCounter=new n,this.fullExtentInLocalViewSpatialReference=null,this.supportsHeightUnitConversion=!0}initialize(){const e=this.layer;"isTable"in e&&e.isTable?this.addResolvingPromise(Promise.reject(new i("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e}))):(this.addResolvingPromise(this._validateGeometryType()),this.addResolvingPromise((async()=>{if(this.destroyed)return;this.fullExtentInLocalViewSpatialReference="local"===this.view.viewingMode?await w(this.layer.fullExtent,this.view.spatialReference):null;const e=await this.createGraphicsPipeline();this.destroyed?e.destroy():(this.graphicsPipeline=e,await e.when())})()),this.notifyChange("updating"))}destroy(){this.graphicsPipeline=s(this.graphicsPipeline)}get dataUpdating(){return!!this.graphicsPipeline?.dataUpdating}get legendEnabled(){return this.canResume()&&this.graphicsPipeline?.legendEnabled}get visibleAtCurrentScale(){return v()?b(this.layer.effectiveScaleRange,this.view.scale):!this.graphicsPipeline?.scaleVisibilitySuspended}get symbologySnappingSupported(){return this.graphicsPipeline.symbologySnappingSupported}get hasAllFeatures(){return this.graphicsPipeline.hasAllFeatures}get hasAllFeaturesInView(){return this.graphicsPipeline.hasAllFeaturesInView}get hasFullGeometries(){return this.graphicsPipeline.hasFullGeometries}get timeExtent(){return p(this.layer,this.view?.timeExtent,this._get("timeExtent"))}get highlightIds(){return Array.from(this._highlightCounter.keys())}get hasHighlight(){return this._highlightCounter.size>0}getHit(e){if(has("feature-pipeline-3d-test"))return this._getHitMock(e);const t=this.graphicsPipeline.findGraphic(t=>t.uid===e);if(null==t)return null;const i=a(t,this.layer);return{type:"graphic",graphic:i,layer:i.layer}}_getHitMock(e){const i=this.layer,r={};r[this.layer.objectIdField]=e;const s=new t({layer:i,sourceLayer:i,visible:!0,symbol:null,attributes:r,geometry:null});return{type:"graphic",graphic:s,layer:s.layer}}whenGraphicBounds(e,t){return this.graphicsPipeline?.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.graphicsPipeline?.computeAttachmentOrigin(e,t)}async elevationAlignPointsInFeatures(e,t){return this.graphicsPipeline.elevationAlignPointsInFeatures(e,t)}async queryForSymbologySnapping(e,t){return this.graphicsPipeline.graphicsQuery.queryForSymbologySnapping(e,t)}queryFeatures(e,t){return this.graphicsPipeline.graphicsQuery.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this.graphicsPipeline.graphicsQuery.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return null==e?this.createQuery():h.from(e)}_addHighlightIds(e){for(const t of e){const e=this._highlightCounter.get(t)??0;this._highlightCounter.set(t,e+1)}}_removeHighlightIds(e){for(const t of e){let e=this._highlightCounter.get(t);null!=e&&(e--,e>0?this._highlightCounter.set(t,e):this._highlightCounter.delete(t))}}highlight(e,t){const i=t?.name??P,s=this.layer.objectIdField;if(u(e))return this.graphicsPipeline.highlightByQuery(e,i);const n=y(e);if(0===n.length)return d;if(g(n[0])){const e=n;if(null!=c(this.layer.fieldsIndex,e[0].attributes,s)){const t=e.map(e=>c(this.layer.fieldsIndex,e.attributes,s)),n=this.graphicsPipeline.highlightByObjectIds(t,i);return this._addHighlightIds(t),r(()=>{this._removeHighlightIds(t),n.remove()})}return this.graphicsPipeline.highlightByGraphics(e,i)}if(m(n[0])){const e=n;this._addHighlightIds(e);const t=this.graphicsPipeline.highlightByObjectIds(e,i);return r(()=>{t.remove(),this._removeHighlightIds(e)})}return d}maskOccludee(e){return this.graphicsPipeline.maskOccludee(e)}getSuspendInfo(){return{...super.getSuspendInfo(),...this.graphicsPipeline.suspendInfo}}isUpdating(){return!(!this.graphicsPipeline||this.graphicsPipeline.destroyed)&&!(!this.graphicsPipeline?.updating&&this.view?.basemapTerrain?.ready)}async _validateGeometryType(){switch(this.layer.geometryType){case"multipatch":case"multipoint":throw new i("featurelayerview3d:unsupported-geometry-type","Unsupported geometry type ${geometryType}",{geometryType:this.layer.geometryType})}}get performanceInfo(){return this.graphicsPipeline.performanceInfo}queryAttributeBins(){throw new Error("Not implemented")}queryAggregates(){throw new Error("Not implemented")}};return e([o()],I.prototype,"graphicsPipeline",void 0),e([o({readOnly:!0})],I.prototype,"dataUpdating",null),e([o()],I.prototype,"highlightOptions",void 0),e([o()],I.prototype,"suspended",void 0),e([o({readOnly:!0})],I.prototype,"legendEnabled",null),e([o({readOnly:!0})],I.prototype,"visibleAtCurrentScale",null),e([o()],I.prototype,"updating",void 0),e([o({readOnly:!0})],I.prototype,"updatePolicy",void 0),e([o({type:Boolean})],I.prototype,"slicePlaneEnabled",void 0),e([o({readOnly:!0})],I.prototype,"suspendInfo",void 0),e([o()],I.prototype,"symbologySnappingSupported",null),e([o({readOnly:!0})],I.prototype,"hasAllFeatures",null),e([o({readOnly:!0})],I.prototype,"hasAllFeaturesInView",null),e([o({readOnly:!0})],I.prototype,"hasFullGeometries",null),e([o({readOnly:!0})],I.prototype,"timeExtent",null),I=e([l("esri.views.3d.layers.FeatureLikeLayerView3D")],I),I};export{j as FeatureLikeLayerView3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{estimateNumberArrayMemory as i}from"../../../core/memoryEstimations.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{generateUID as n}from"../../../core/uid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{i as u}from"../../../chunks/vec32.js";import{create as h,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as m}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as g,extentContainsCoords2D as y}from"../../../geometry/support/contains.js";import{newDoubleArray as f,doubleArrayFrom as _}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as v}from"../../../layers/LayerConstants.js";import{estimateSize as x}from"../../../layers/graphics/dehydratedFeatures.js";import{makeDehydratedPoint as I}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as E}from"../../../layers/graphics/hydratedFeatures.js";import w from"../../../layers/graphics/controllers/I3SOnDemandController.js";import j from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayerView as C}from"../../../support/basemapUtils.js";import{I3SPointsWorkerHandle as O}from"./I3SPointsWorkerHandle.js";import{LayerView3D as D}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as S}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as F}from"./graphics/QueryEngine.js";import{QueryEngineContext as G}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as A,normalizeEditResultsEvent as V,processAttributeEdits as P}from"./i3s/featureEditing.js";import{getCachedAttributeValue as L}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as R}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as M}from"./i3s/I3SOverrides.js";import{checkRecyclable as H,checkSpatialReferences as Q,containsDraco as U,whenGraphicAttributes as q}from"./i3s/I3SUtil.js";import{DefinitionExpressionSceneLayerView as T}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as B}from"./support/fieldProperties.js";import{LayerViewPerformanceInfo as k}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as z}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as W}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as K}from"./support/TemporalSceneLayerView.js";import{debugFlags as Z}from"../support/debugFlags.js";import{compute as Y}from"../support/orientedBoundingBox.js";import{updatingProgress as $}from"../support/updatingProperties.js";import{Vertices as J}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as X}from"../webgl-engine/lib/UpdatePolicy.js";import ee from"../../layers/SceneLayerView.js";import{hasPopupTemplate as te}from"../../layers/support/popupUtils.js";import{defaultHighlightName as re}from"../../support/HighlightDefaults.js";import{hasLayerBasedScaleVisibility as ie,isInEffectiveScaleRange as se}from"../../support/layerViewUtils.js";import{TaskPriority as oe}from"../../support/Scheduler.js";const ae=B();class ne{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}get cachedMemory(){return this.graphics.reduce((e,t)=>x(t)+e,i(this.featureIds)+1024)}}let le=class extends(K(T(z(D(ee))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new R((e,t,r)=>pe(e,t,r),e=>this.processor.graphicsCore.recreateGraphics(e)),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),H(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this._i3sOverrides=new M({view:this.view,layer:e,memoryController:i}),r(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new M({view:this.view,layer:this.layer,memoryController:e}),Q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new W({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set("processor",new S({owner:this,preferredUpdatePolicy:X.ASYNC,scaleVisibilityEnabled:!ie(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new w({layerView:this}),U(this.layer.geometryDefinitions)&&(this._worker=new O(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}),a(()=>Z.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&Z.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||!this._treeDebugger||Z.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},o)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,o),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=r(this._treeDebugger),this._i3sOverrides=r(this._i3sOverrides),this._set("processor",r(this.processor)),this._controller=r(this._controller),this._queryEngine=r(this._queryEngine),this._worker=r(this._worker),this._memCache=r(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=r(this._fieldsHelper)}get i3slayer(){return this.layer}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return ie()?se(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(e,t){return q(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=E(this.loadedGraphics.find(t=>t.uid===e),this.layer),r=this._getObjectIdField();return t?.attributes?.[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){return this.processor.highlight(e,this.layer.objectIdField,t?.name??re)}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return A(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new O(e=>this.view.resourceController.immediate.schedule(e)));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,r,i){if(!he(r)&&!ue(r))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void t.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?me(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=he(r)?await this._extractBinaryPointPositions(e,r,i):this._extractLegacyPointPositions(r),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;c(a,l,0,a,d,0,o.length);const u=he(r)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new ne(h,o,r.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,r.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),ce(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const t of p.graphics)this._verticalScale(t.geometry);const m=this.view.stage.renderView.olidRenderHelper;if(m){const e=C(this.view,this.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];m.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&te(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0),e.serviceObbInIndexSR=Y(new J(t,3)),i.isGeographic&&(m(e.serviceObbInIndexSR.center,s,ye,i),e.serviceObbInIndexSR.center=ye)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=f(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:p,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?_(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=f(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??ge[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,r,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=r.length,n=3;for(let l=0;l<a;l++){const r=l*n;u(ye,i[r],i[r+1],i[r+2]);const a=!Number.isNaN(i[2]);null==s||(a?g(s,ye):y(s,ye))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(ye[0],ye[1],ye[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??n(),m=h*o,g=isNaN(t[m+2])?void 0:t[m+2],y=I(t[m],t[m+1],g,u),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(fe.property="geometry",fe.graphic=f,fe.oldValue=f.geometry,fe.newValue=y,f.geometry=y,f.level=i,l.graphicUpdateHandler(fe),_e()),d.push(f);else{const e=n();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,r,i,s){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,i,s),r.attributeInfo=i,this.loadedGraphics.addNode(e.index,r),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),ce(r),this._filterNode(r),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,r)=>e.push(r))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){ce(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach(e=>e.nodeIndex===t&&i.push(e.uid)),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||v}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every((e,t)=>s[t]===o[t])||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&t.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,r=this._excludeObjectIds,i=this._getObjectIdField();for(const s of e.graphics){const e=s.visible,o=this._evaluateClause(t,s),a=!r.has(s.attributes[i]);s.visible=o&&a,e!==s.visible&&(fe.graphic=s,fe.property="visible",fe.oldValue=e,fe.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(fe),_e())}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:s,resourceController:o}=t,a=new G(s,e,o,()=>this.processor.featureStore,i,r);this._queryEngine=new F({context:a,priority:oe.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await V(t,e);P(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new k(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],le.prototype,"processor",void 0),e([l({type:j})],le.prototype,"filter",void 0),e([l()],le.prototype,"loadedGraphics",void 0),e([l()],le.prototype,"i3slayer",null),e([l()],le.prototype,"layerViewUid",null),e([l()],le.prototype,"_controller",void 0),e([l()],le.prototype,"updating",void 0),e([l()],le.prototype,"suspended",void 0),e([l($)],le.prototype,"updatingProgress",void 0),e([l()],le.prototype,"updatingProgressValue",null),e([l({readOnly:!0})],le.prototype,"visibleAtCurrentScale",null),e([l(ae.requiredFields)],le.prototype,"requiredFields",null),e([l(ae.availableFields)],le.prototype,"availableFields",void 0),e([l()],le.prototype,"_fieldsHelper",void 0),e([l({type:Number})],le.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],le.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],le.prototype,"_excludeObjectIds",null),e([l({readOnly:!0})],le.prototype,"lodFactor",null),e([l({readOnly:!0})],le.prototype,"hasM",null),e([l({readOnly:!0})],le.prototype,"hasZ",null),e([l()],le.prototype,"contentVisible",null),e([l({readOnly:!0})],le.prototype,"legendEnabled",null),le=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],le);const de=le;function ue(e){return"pointData"in e}function he(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function pe(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=L(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function ce(e){const t=e.attributeInfo;if(null==t?.loadedAttributes||null==t.attributeData)return;const r=e.node.index;for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=L(t.attributeData[e],i))}}}function me(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const ge={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},ye=h(),fe={graphic:null,property:null,oldValue:null,newValue:null};function _e(){fe.graphic=null,fe.property=null,fe.oldValue=null,fe.newValue=null}export{de as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../core/has.js";import t from"../../../core/Logger.js";import{destroyMaybe as r}from"../../../core/maybe.js";import{estimateNumberArrayMemory as i}from"../../../core/memoryEstimations.js";import{throwIfAborted as s}from"../../../core/promiseUtils.js";import{initial as o,watch as a}from"../../../core/reactiveUtils.js";import{generateUID as n}from"../../../core/uid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{i as u}from"../../../chunks/vec32.js";import{create as h,ZEROS as p}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectBuffer as c}from"../../../geometry/projection/projectBuffer.js";import{projectVectorToVector as m}from"../../../geometry/projection/projectVectorToVector.js";import{extentContainsCoords3D as g,extentContainsCoords2D as y}from"../../../geometry/support/contains.js";import{newDoubleArray as f,doubleArrayFrom as _}from"../../../geometry/support/DoubleArray.js";import{getGeometryZScaler as b}from"../../../geometry/support/zscale.js";import{fallbackObjectIDAttribute as v}from"../../../layers/LayerConstants.js";import{estimateSize as I}from"../../../layers/graphics/dehydratedFeatures.js";import{makeDehydratedPoint as x}from"../../../layers/graphics/dehydratedPoint.js";import{hydrateGraphic as E}from"../../../layers/graphics/hydratedFeatures.js";import w from"../../../layers/graphics/controllers/I3SOnDemandController.js";import j from"../../../layers/support/FeatureFilter.js";import N from"../../../rest/support/Query.js";import{isBasemapLayerView as O}from"../../../support/basemapUtils.js";import{isQuery as C,isGraphic as D}from"../../../support/guards.js";import{I3SPointsWorkerHandle as S}from"./I3SPointsWorkerHandle.js";import{LayerView3D as F}from"./LayerView3D.js";import{Graphics3DFeatureProcessor as G}from"./graphics/Graphics3DFeatureProcessor.js";import{QueryEngine as A}from"./graphics/QueryEngine.js";import{QueryEngineContext as V}from"./graphics/QueryEngineContext.js";import{createInteractiveEditSession as P,normalizeEditResultsEvent as L,processAttributeEdits as R}from"./i3s/featureEditing.js";import{getCachedAttributeValue as M}from"./i3s/I3SBinaryReader.js";import{I3SGraphicsMap as H}from"./i3s/I3SGraphicsMap.js";import{I3SOverrides as Q}from"./i3s/I3SOverrides.js";import{checkRecyclable as U,checkSpatialReferences as q,containsDraco as T,whenGraphicAttributes as B}from"./i3s/I3SUtil.js";import{attributeLookup as k}from"./support/attributeUtils.js";import{DefinitionExpressionSceneLayerView as z}from"./support/DefinitionExpressionSceneLayerView.js";import{defineFieldProperties as W}from"./support/fieldProperties.js";import{normalizeHighlightTargetExceptQuery as K,emptyHighlightHandle as Z,isObjectId as Y}from"./support/highlightUtils.js";import{LayerViewPerformanceInfo as $}from"./support/LayerViewPerformanceInfo.js";import{PopupSceneLayerView as J}from"./support/PopupSceneLayerView.js";import{SceneLayerViewRequiredFields as X}from"./support/SceneLayerViewRequiredFields.js";import{TemporalSceneLayerView as ee}from"./support/TemporalSceneLayerView.js";import{debugFlags as te}from"../support/debugFlags.js";import{compute as re}from"../support/orientedBoundingBox.js";import{updatingProgress as ie}from"../support/updatingProperties.js";import{Vertices as se}from"../webgl-engine/lib/Attribute.js";import{UpdatePolicy as oe}from"../webgl-engine/lib/UpdatePolicy.js";import ae from"../../layers/SceneLayerView.js";import{hasPopupTemplate as ne}from"../../layers/support/popupUtils.js";import{defaultHighlightName as le}from"../../support/HighlightDefaults.js";import{hasLayerBasedScaleVisibility as de,isInEffectiveScaleRange as ue}from"../../support/layerViewUtils.js";import{TaskPriority as he}from"../../support/Scheduler.js";const pe=W();class ce{constructor(e,t,r,i){this.graphics=e,this.featureIds=t,this.attributeInfo=r,this.node=i}get cachedMemory(){return this.graphics.reduce((e,t)=>I(t)+e,i(this.featureIds)+1024)}}let me=class extends(ee(z(J(F(ae))))){constructor(){super(...arguments),this.type="scene-layer-graphics-3d",this._queryEngine=null,this._memCache=null,this._interactiveEditingSessions=new Map,this._pendingEditsQueue=Promise.resolve(),this.loadedGraphics=new H((e,t,r)=>_e(e,t,r),e=>this.processor.graphicsCore.recreateGraphics(e)),this.holeFilling="always",this.progressiveLoadFactor=1,this.supportsHeightUnitConversion=!0,this._coordinatesOutsideExtentErrors=0,this._maxCoordinatesOutsideExtentErrors=20}tryRecycleWith(e,t){return e.url===this.layer.url&&this._i3sOverrides.isEmpty?e.load(t).then(()=>{s(t),U(this.layer,e,this._i3sOverrides),this.layer=e,this._i3sOverrides.destroy();const i=this.view.resourceController?.memoryController;this._i3sOverrides=new Q({view:this.view,layer:e,memoryController:i}),r(this._queryEngine),this._setupQueryEngine(),this.processor.resetObjectStates()}):null}initialize(){this.addResolvingPromise(this.layer.indexInfo);const e=this.view.resourceController?.memoryController;this._i3sOverrides=new Q({view:this.view,layer:this.layer,memoryController:e}),q(this.layer,this.view.spatialReference,this.view.viewingMode),this._fieldsHelper=new X({layerView:this}),this._updatingHandles.add(()=>this.layer.rangeInfos,e=>this._rangeInfosChanged(e),o),this._updatingHandles.add(()=>this.layer.renderer,(e,t)=>this._rendererChange(e,t)),this._updatingHandles.add(()=>[this.parsedDefinitionExpression,this.layer.excludeObjectIds],()=>this._filterChange()),this._set("processor",new G({owner:this,preferredUpdatePolicy:oe.ASYNC,scaleVisibilityEnabled:!de(),filterVisibilityEnabled:!0,timeExtentEnabled:!1,frustumVisibilityEnabled:!1,elevationAlignmentEnabled:!0,elevationFeatureExpressionEnabled:!1,setUidToIdOnAdd:!1,dataExtent:this.layer.fullExtent,updateClippingExtent:e=>this._updateClippingExtent(e)})),this.processor.elevationAlignment?.events.on("invalidate-elevation",({extent:e,spatialReference:t})=>this._controller.updateElevationChanged(e,t)),this.supportsHeightUnitConversion&&(this._verticalScale=b("point",this.layer.spatialReference,this.view.spatialReference)),this.addResolvingPromise(this.processor.when()),this._memCache=this.view.resourceController.memoryController.newCache(`psl-${this.uid}`),this._controller=new w({layerView:this}),T(this.layer.geometryDefinitions)&&(this._worker=new S(e=>this.view.resourceController.immediate.schedule(e))),this.addHandles(this.layer.on("apply-edits",e=>this._updatingHandles.addPromise(e.result))),this.addHandles([this.layer.on("edits",e=>{const t=this._pendingEditsQueue.then(()=>this._handleEdits(e)).then();this._pendingEditsQueue=t,this._updatingHandles.addPromise(t)}),a(()=>te.I3S_TREE_SHOW_TILES,e=>{if(e&&!this._treeDebugger){const e=this._controller.crsIndex;import("./support/I3STreeDebugger.js").then(({I3STreeDebugger:t})=>{!this._treeDebugger&&te.I3S_TREE_SHOW_TILES&&(this._treeDebugger=new t({lv:this,view:this.view,nodeSR:e}))})}else e||!this._treeDebugger||te.I3S_TREE_SHOW_TILES||(this._treeDebugger.destroy(),this._treeDebugger=null)},o)]),this.when(()=>{this._setupQueryEngine(),this._updatingHandles.add(()=>this.maximumNumberOfFeatures,e=>this._controller.featureTarget=e,o),this._updatingHandles.add(()=>this.suspended,e=>{e&&this._removeAllNodeData()})})}destroy(){this._treeDebugger=r(this._treeDebugger),this._i3sOverrides=r(this._i3sOverrides),this._set("processor",r(this.processor)),this._controller=r(this._controller),this._queryEngine=r(this._queryEngine),this._worker=r(this._worker),this._memCache=r(this._memCache),this.loadedGraphics.clear(),this._fieldsHelper=r(this._fieldsHelper)}get i3slayer(){return this.layer}get layerViewUid(){return this.uid}get updatingProgressValue(){return this._controller?.updatingProgress??1}get visibleAtCurrentScale(){return de()?ue(this.layer.effectiveScaleRange,this.view.scale):!this.processor?.scaleVisibilitySuspended}get requiredFields(){return this._fieldsHelper?.requiredFields??[]}get maximumNumberOfFeatures(){const e=this.processor?.graphicsCore?.displayFeatureLimit;return e?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){null!=e?(this._override("maximumNumberOfFeatures",e),this._controller.fixedFeatureTarget=!0):(this._clearOverride("maximumNumberOfFeatures"),this._controller.fixedFeatureTarget=!1)}get maximumNumberOfFeaturesExceeded(){return!this.suspended&&(!!this._controller?.useMaximumNumberOfFeatures&&!this._controller.leavesReached)}get _excludeObjectIds(){return new Set(this.layer.excludeObjectIds)}get lodFactor(){return"Labels"===this.layer.semantic?1:this.view.qualitySettings.sceneService.point.lodFactor}get hasM(){return!1}get hasZ(){return!0}get contentVisible(){return!this.suspended&&!!this._controller?.rootNodeVisible}get legendEnabled(){return this.contentVisible&&!0===this.i3slayer?.legendEnabled}async whenGraphicAttributes(e,t){return B(this.layer,e,this._getObjectIdField(),t,()=>[...this.loadedGraphics.nodes()])}getHit(e){if(!this.loadedGraphics)return null;const t=E(this.loadedGraphics.find(t=>t.uid===e),this.layer),r=this._getObjectIdField();return t?.attributes?.[r]?(t.layer=this.layer,t.sourceLayer=this.layer,{type:"graphic",graphic:t,layer:t.layer}):null}whenGraphicBounds(e,t){return this.processor.whenGraphicBounds(e,t)}computeAttachmentOrigin(e,t){return this.processor.computeAttachmentOrigin(e,t)}isUpdating(){return!!(this._controller?.updating||this.processor?.updating||this._fieldsHelper?.updating||this.layerFilterUpdating)}highlight(e,t){const r=t?.name??le,i=this.layer.objectIdField;if(C(e))return this.processor.highlightByQuery(e,i,r);const s=K(e);if(0===s.length)return Z;if(D(s[0])){const e=s;if(null!=k(this.layer.fieldsIndex,e[0].attributes,i)){const t=e.map(e=>k(this.layer.fieldsIndex,e.attributes,i));return this.processor.highlightByObjectIds(t,i,r)}return this.processor.highlightByGraphics(e,r)}return Y(s[0])?this.processor.highlightByObjectIds(s,i,r):Z}get updatePolicy(){return this.processor.graphicsCore.effectiveUpdatePolicy}createInteractiveEditSession(e){return P(this._attributeEditingContext,e)}async _decompressBinaryPointData(e,t){const r={geometryBuffer:e.geometryBuffer};null==this._worker&&(this._worker=new S(e=>this.view.resourceController.immediate.schedule(e)));const i=await this._worker.invoke(r,t);if(null==i)throw new Error("Failed to decompress Draco point data");return{positionData:i.positions,featureIds:i.featureIds}}async addNode(e,r,i){if(!fe(r)&&!ye(r))throw new Error;if(this.loadedGraphics.hasNode(e.index))return void t.getLogger(this).error("I3S node "+e.id+" already added");const s=null!=this.layer.fullExtent?ve(this.layer.fullExtent.clone(),.5):null,{featureIds:o,pointPositions:a}=fe(r)?await this._extractBinaryPointPositions(e,r,i):this._extractLegacyPointPositions(r),n=new Array;this._validatePositions(e,o,a,s,n);const l=this._controller.crsVertex,d=this.view.spatialReference;c(a,l,0,a,d,0,o.length);const u=fe(r)?e.level:0,h=this._createGraphics(o,a,e.index,u),p=new ce(h,o,r.attributeDataInfo,e);if(await this._i3sOverrides.applyAttributeOverrides(p.featureIds,r.attributeDataInfo,i),e.numFeatures=p.graphics.length,this._updateNodeMemory(e),be(p),n.length>0&&(this._computeObb(e,n,l),this._controller.updateVisibility(e.index)),!this._controller.isGeometryVisible(e))return void this._cacheNodeData(p);if(null!=this._verticalScale)for(const t of p.graphics)this._verticalScale(t.geometry);const m=this.view.stage.renderView.olidRenderHelper;if(m){const e=O(this.view,this.uid);for(let t=0;t<p.featureIds.length;t++){const r=p.featureIds[t];m.setUidToObjectAndLayerId(r,p.graphics[t].uid,this.layer.id,this.uid,this.layer.popupEnabled&&!e&&ne(this.layer,this.view.popup?.defaultPopupTemplateEnabled),p.node.resources.attributes,t)}}this.loadedGraphics.addNode(e.index,p),this._controller.updateLoadStatus(e.index,!0),this._filterNode(p),this._treeDebugger&&this._treeDebugger.update()}_computeObb(e,t,r){const i=this._controller.crsIndex,s=i.isGeographic?this.view.renderSpatialReference:i;c(t,r,0,t,s,0),e.serviceObbInIndexSR=re(new se(t,3)),i.isGeographic&&(m(e.serviceObbInIndexSR.center,s,xe,i),e.serviceObbInIndexSR.center=xe)}isNodeLoaded(e){return this.loadedGraphics.hasNode(e)}isNodeReloading(){return!1}updateNodeState(){}getNodeComponentHandle(){}async _extractBinaryPointPositions(e,t,r){const i=await this._decompressBinaryPointData(t,r),s=i.positionData,o=3,a=s.length/o,n=f(3*a),l=null!=e.serviceObbInIndexSR?e.serviceObbInIndexSR.center:p,d=Math.abs(l[2])*2**-20;for(let u=0;u<a;u++){const e=u*o;n[e]=s[e]+l[0],n[e+1]=s[e+1]+l[1],n[e+2]=s[e+2]+l[2],Math.abs(n[e+2])<d&&(n[e+2]=0)}return{featureIds:i.featureIds?_(i.featureIds):[],pointPositions:n}}_extractLegacyPointPositions(e){const t=e.pointData.length,r=f(3*t),i=new Array;for(let s=0;s<t;s++){const t=e.pointData[s],o=t.featureDataPosition,a=o.length,n=t.geometries?.[0]??Ie[a],l=t.featureIds[0];if("Embedded"!==n.type||"points"!==n.params.type||a<2||a>3)continue;const d=n.params.vertexAttributes?.position??[0,0,0],u=3*i.length;r[u]=o[0]+d[0],r[u+1]=o[1]+d[1],r[u+2]=3===a?o[2]+d[2]:NaN,i.push(l)}return{featureIds:i,pointPositions:r}}_validatePositions(e,r,i,s,o){if(null==s&&e.serviceObbInIndexSR)return;const a=r.length,n=3;for(let l=0;l<a;l++){const r=l*n;u(xe,i[r],i[r+1],i[r+2]);const a=!Number.isNaN(i[2]);null==s||(a?g(s,xe):y(s,xe))||(this._coordinatesOutsideExtentErrors<this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Service Error: Coordinates outside of layer extent"),this._coordinatesOutsideExtentErrors+1===this._maxCoordinatesOutsideExtentErrors&&t.getLogger(this).error("Maximum number of errors reached. Further errors are ignored."),this._coordinatesOutsideExtentErrors++),e.serviceObbInIndexSR||o.push(xe[0],xe[1],xe[2])}}_createGraphics(e,t,r,i){const s=e.length,o=3,a=this._getObjectIdField(),l=this.processor.graphicsCore,d=new Array,u=this.view.spatialReference;for(let h=0;h<s;h++){const s=e[h],p={};null!=s&&(p[a]=s);const c=s??n(),m=h*o,g=isNaN(t[m+2])?void 0:t[m+2],y=x(t[m],t[m+1],g,u),f=this.loadedGraphics.get(c);if(null!=f)(null==f.level||f.level<i)&&(Ee.property="geometry",Ee.graphic=f,Ee.oldValue=f.geometry,Ee.newValue=y,f.geometry=y,f.level=i,l.graphicUpdateHandler(Ee),we()),d.push(f);else{const e=n();d.push({objectId:c,uid:e,geometry:y,attributes:p,visible:!0,nodeIndex:r,level:i})}}return d}_updateNodeMemory(e){e.memory=4096+(e.numFeatures??0)*this.processor.graphicsCore.usedMemoryPerGraphic}_cacheNodeData(e){this._memCache.put(this._getMemCacheKey(e.node),e)}_getMemCacheKey(e){return`${e.index}`}_removeAllNodeData(){this.loadedGraphics.forEachNode((e,t)=>{if(e){const t=e.node;this._updateNodeMemory(t),this._cacheNodeData(e)}this._controller.updateLoadStatus(t,!1)}),this._treeDebugger&&this._treeDebugger.update(),this.loadedGraphics.clear()}removeNode(e){const t=this._removeNodeStageData(e);t&&(this._updateNodeMemory(t.node),this._cacheNodeData(t))}_removeNodeStageData(e){const t=this.loadedGraphics.getNode(e);return null==t?null:(this._controller.updateLoadStatus(e,!1),this.loadedGraphics.removeNode(e),this._treeDebugger&&this._treeDebugger.update(),t)}async loadCachedNodeData(e){return this._memCache?.pop(this._getMemCacheKey(e))}async addCachedNodeData(e,r,i,s){this.loadedGraphics.hasNode(e.index)?t.getLogger(this).error("I3S node "+e.id+" already added"):(await this._i3sOverrides.applyAttributeOverrides(r.featureIds,i,s),r.attributeInfo=i,this.loadedGraphics.addNode(e.index,r),this._controller.updateLoadStatus(e.index,!0),this._updateNodeMemory(e),be(r),this._filterNode(r),this._treeDebugger&&this._treeDebugger.update())}getLoadedNodeIds(){const e=[];return this.loadedGraphics.forEachNode(t=>e.push(t.node.id)),e.sort()}getVisibleNodes(){const e=new Array;return this.loadedGraphics.forEachNode(t=>e.push(t.node)),e}getLoadedNodeIndices(e){this.loadedGraphics.forEachNode((t,r)=>e.push(r))}getLoadedAttributes(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.loadedAttributes}getAttributeData(e){const t=this.loadedGraphics.getNode(e);if(null!=t?.attributeInfo)return t.attributeInfo.attributeData}_setAttributeData(e,t){const r=this.loadedGraphics.getNode(e);null!=r?.attributeInfo&&(r.attributeInfo.attributeData=t,this._attributeValuesChanged(r))}async updateAttributes(e,t,r){const i=this.loadedGraphics.getNode(e);null!=i&&(await this._i3sOverrides.applyAttributeOverrides(i.featureIds,t,r),i.attributeInfo=t,this._attributeValuesChanged(i))}_attributeValuesChanged(e){be(e),this._filterNode(e);const{processor:t}=this,{graphicsCore:r}=t;if(r.labelsEnabled){const t=e.node.index,i=new Array;e.graphics.forEach(e=>e.nodeIndex===t&&i.push(e.uid)),r.updateLabelingInfo(i)}t.refreshFilter()}_updateClippingExtent(e){return this._controller&&this._controller.updateClippingArea(e),!1}_getObjectIdField(){return this.layer.objectIdField||v}_getGlobalIdField(){return this.layer.globalIdField}async _rendererChange(e,t){const{layer:{fieldsIndex:r}}=this,i=new Set;let s,o;e?(await e.collectRequiredFields(i,r),s=Array.from(i).sort()):s=[],i.clear(),t?(await t.collectRequiredFields(i,r),o=Array.from(i).sort()):o=[],s.length===o.length&&s.every((e,t)=>s[t]===o[t])||this._reloadAllNodes()}_rangeInfosChanged(e){null!=e&&e.length>0&&t.getLogger(this).warn("Unsupported property: rangeInfos are currently only serialized to and from web scenes but do not affect rendering.")}_filterChange(){this.loadedGraphics.forEachNode(e=>this._filterNode(e))}_reloadAllNodes(){this._removeAllNodeData(),this._controller&&this._controller.restartNodeLoading()}_filterNode(e){const t=this.parsedDefinitionExpression,r=this._excludeObjectIds,i=this._getObjectIdField();for(const s of e.graphics){const e=s.visible,o=this._evaluateClause(t,s),a=!r.has(s.attributes[i]);s.visible=o&&a,e!==s.visible&&(Ee.graphic=s,Ee.property="visible",Ee.oldValue=e,Ee.newValue=s.visible,this.processor.graphicsCore.graphicUpdateHandler(Ee),we())}}createQuery(){const e={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return this.filter?.createQuery(e)??new N(e)}queryFeatures(e,t){return this._queryEngine.executeQuery(this._ensureQuery(e),t?.signal)}queryObjectIds(e,t){return this._queryEngine.executeQueryForIds(this._ensureQuery(e),t?.signal)}queryFeatureCount(e,t){return this._queryEngine.executeQueryForCount(this._ensureQuery(e),t?.signal)}queryExtent(e,t){return this._queryEngine.executeQueryForExtent(this._ensureQuery(e),t?.signal)}_ensureQuery(e){return this._addDefinitionExpressionToQuery(null==e?this.createQuery():N.from(e))}_setupQueryEngine(){const{layer:e,view:t,hasM:r,hasZ:i}=this,{spatialReference:s,resourceController:o}=t,a=new V(s,e,o,()=>this.processor.featureStore,i,r);this._queryEngine=new A({context:a,priority:he.FEATURE_QUERY_ENGINE})}get usedMemory(){return this.processor?.graphicsCore?.usedMemory??0}get unloadedMemory(){return.8*((this._controller?.unloadedMemoryEstimate??0)+(this.processor?.graphicsCore?.unprocessedMemoryEstimate??0))}get ignoresMemoryFactor(){return this._controller&&this._controller.fixedFeatureTarget}async _handleEdits(e){const t=this._attributeEditingContext,r=await L(t,e);R(t,r)}get _attributeEditingContext(){const e=this._getObjectIdField(),t=this._getGlobalIdField();return{sessions:this._interactiveEditingSessions,fieldsIndex:this.layer.fieldsIndex,objectIdField:e,globalIdField:t,forEachNode:e=>this.loadedGraphics.forEachNode(t=>e(t.node,t.featureIds)),attributeStorageInfo:this.i3slayer.attributeStorageInfo??[],i3sOverrides:this._i3sOverrides,getAttributeData:e=>this.getAttributeData(e),setAttributeData:(t,r,i)=>{this._setAttributeData(t,r);const s=this.loadedGraphics.getNode(t);if(null!=i){const t=this.loadedGraphics.get(i.attributes[e]);null!=t&&this.processor.graphicsCore.recreateGraphics([t])}else null!=s&&this.processor.graphicsCore.recreateGraphics(s.graphics)},clearMemCache:()=>{}}}get performanceInfo(){return new $(this.usedMemory,this.loadedGraphics.length,-1,this.maximumNumberOfFeatures,this.loadedGraphics.nodeCount,this.processor.graphicsCore.performanceInfo)}get test(){}};e([l()],me.prototype,"processor",void 0),e([l({type:j})],me.prototype,"filter",void 0),e([l()],me.prototype,"loadedGraphics",void 0),e([l()],me.prototype,"i3slayer",null),e([l()],me.prototype,"layerViewUid",null),e([l()],me.prototype,"_controller",void 0),e([l()],me.prototype,"updating",void 0),e([l()],me.prototype,"suspended",void 0),e([l(ie)],me.prototype,"updatingProgress",void 0),e([l()],me.prototype,"updatingProgressValue",null),e([l({readOnly:!0})],me.prototype,"visibleAtCurrentScale",null),e([l(pe.requiredFields)],me.prototype,"requiredFields",null),e([l(pe.availableFields)],me.prototype,"availableFields",void 0),e([l()],me.prototype,"_fieldsHelper",void 0),e([l({type:Number})],me.prototype,"maximumNumberOfFeatures",null),e([l({readOnly:!0})],me.prototype,"maximumNumberOfFeaturesExceeded",null),e([l()],me.prototype,"_excludeObjectIds",null),e([l({readOnly:!0})],me.prototype,"lodFactor",null),e([l({readOnly:!0})],me.prototype,"hasM",null),e([l({readOnly:!0})],me.prototype,"hasZ",null),e([l()],me.prototype,"contentVisible",null),e([l({readOnly:!0})],me.prototype,"legendEnabled",null),me=e([d("esri.views.3d.layers.SceneLayerGraphicsView3D")],me);const ge=me;function ye(e){return"pointData"in e}function fe(e){return"geometryBuffer"in e&&null!==e.geometryBuffer}function _e(e,t,r){const i=t.attributeInfo;if(null==i?.loadedAttributes||null==i.attributeData)return!1;let s=!1;for(const{name:o}of i.loadedAttributes)if(i.attributeData[o]){const t=M(i.attributeData[o],r);t!==e.attributes[o]&&(e.attributes[o]=t,s=!0)}return s}function be(e){const t=e.attributeInfo;if(null==t?.loadedAttributes||null==t.attributeData)return;const r=e.node.index;for(let i=0;i<e.graphics.length;i++){const s=e.graphics[i];if(s.nodeIndex===r){s.attributes||(s.attributes={});for(const{name:e}of t.loadedAttributes)t.attributeData[e]&&(s.attributes[e]=M(t.attributeData[e],i))}}}function ve(e,t){return e.xmin-=t,e.ymin-=t,e.xmax+=t,e.ymax+=t,null!=e.zmin&&null!=e.zmax&&(e.zmin-=t,e.zmax+=t),null!=e.mmin&&null!=e.mmax&&(e.mmin-=t,e.mmax+=t),e}const Ie={2:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0]}}},3:{type:"Embedded",params:{type:"points",vertexAttributes:{position:[0,0,0]}}}},xe=h(),Ee={graphic:null,property:null,oldValue:null,newValue:null};function we(){Ee.graphic=null,Ee.property=null,Ee.oldValue=null,Ee.newValue=null}export{ge as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import i from"../../../../core/HeapSort.js";import s from"../../../../core/PooledArray.js";import{intersects as t}from"../../../../geometry/support/aaBoundingRect.js";import{drawPoly as c,drawAccelerationStruct as n}from"./deconflictorDebug.js";class e{constructor(i,s,t){this._setVisibility=i,this._canConflict=s,this._compare=t,this.done=!1,this._items=new Array,this._accBinsNumX=15,this._accBinsNumY=20,this._accBinsSizeX=0,this._accBinsSizeY=0,this._accBins=null}destroy(){this._generator=null}reset(i,s){this._initBins(i,s),this._items.length=0,this.done=!1,this._generator=null}add(i){this._items.push(i)}run(i){this._generator??=this._run(i),this.done=!!this._generator.next(i).done}*_run(i){yield*this._sort(i),yield*this._deconflict(i),n(()=>({bins:this._accBins,numX:this._accBinsNumX,numY:this._accBinsNumY,sizeX:this._accBinsSizeX,sizeY:this._accBinsSizeY,numTests:0,numVisible:this._items.length}))}*_sort(s){for(const t of i.iterableSort(this._items,0,this._items.length,this._compare))s.madeProgress(),s.done&&(s=yield)}_isConflicted(i){let s=!0;return this._forEachBin(i.aabr,c=>(s=!1,c.some(s=>this._canConflict(s,i)&&t(s.aabr,i.aabr))))||s}*_deconflict(i){for(const s of this._items){i.done&&(i=yield);const t=!this._isConflicted(s);this._setVisibility(s,t),c(s.aabr,t),t&&this._addToBins(s),i.madeProgress()}}_initBins(i,t){if(null==this._accBins){this._accBins=[];for(let i=0;i<this._accBinsNumX;i++){this._accBins.push([]);const i=this._accBins[this._accBins.length-1];for(let t=0;t<this._accBinsNumY;t++)i.push(new s)}}else for(let s=0;s<this._accBinsNumX;s++)for(let i=0;i<this._accBinsNumY;i++)this._accBins[s][i].clear();this._accBinsSizeX=i/this._accBinsNumX,this._accBinsSizeY=t/this._accBinsNumY}_addToBins(i){this._forEachBin(i.aabr,s=>s.push(i))}_forEachBin(i,s){if(!this._accBins)return!1;const t=Math.max(Math.floor(i[0]/this._accBinsSizeX),0),c=Math.max(Math.floor(i[1]/this._accBinsSizeY),0),n=Math.min(Math.floor(i[2]/this._accBinsSizeX),this._accBinsNumX-1),e=Math.min(Math.floor(i[3]/this._accBinsSizeY),this._accBinsNumY-1);for(let h=t;h<=n;h++)for(let i=c;i<=e;i++)if(s(this._accBins[h][i]))return!0;return!1}}export{e as DeconflictAABR};
5
+ import i from"../../../../core/HeapSort.js";import s from"../../../../core/PooledArray.js";import{intersects as t}from"../../../../geometry/support/aaBoundingRect.js";import{drawPoly as n,drawAccelerationStruct as c}from"./deconflictorDebug.js";class e{constructor(i,s,t){this._setVisibility=i,this._canConflict=s,this._compare=t,this.done=!1,this._items=new Array,this._accBinsNumX=15,this._accBinsNumY=20,this._accBinsSizeX=0,this._accBinsSizeY=0,this._accBins=null}destroy(){this._generator=null,this._accBins=null,this._items.length=0}reset(i,s){this._initBins(i,s),this._items.length=0,this.done=!1,this._generator=null}add(i){this._items.push(i)}run(i){this._generator??=this._run(i),this.done=!!this._generator.next(i).done}*_run(i){yield*this._sort(i),yield*this._deconflict(i),c(()=>({bins:this._accBins,numX:this._accBinsNumX,numY:this._accBinsNumY,sizeX:this._accBinsSizeX,sizeY:this._accBinsSizeY,numTests:0,numVisible:this._items.length}))}*_sort(s){for(const t of i.iterableSort(this._items,0,this._items.length,this._compare))s.madeProgress(),s.done&&(s=yield)}_isConflicted(i){let s=!0;return this._forEachBin(i.aabr,n=>(s=!1,n.some(s=>this._canConflict(s,i)&&t(s.aabr,i.aabr))))||s}*_deconflict(i){for(const s of this._items){i.done&&(i=yield);const t=!this._isConflicted(s);this._setVisibility(s,t),n(s.aabr,t),t&&this._addToBins(s),i.madeProgress()}}_initBins(i,t){if(null==this._accBins){this._accBins=[];for(let i=0;i<this._accBinsNumX;i++){this._accBins.push([]);const i=this._accBins[this._accBins.length-1];for(let t=0;t<this._accBinsNumY;t++)i.push(new s)}}else for(let s=0;s<this._accBinsNumX;s++)for(let i=0;i<this._accBinsNumY;i++)this._accBins[s][i].clear();this._accBinsSizeX=i/this._accBinsNumX,this._accBinsSizeY=t/this._accBinsNumY}_addToBins(i){this._forEachBin(i.aabr,s=>s.push(i))}_forEachBin(i,s){if(!this._accBins)return!1;const t=Math.max(Math.floor(i[0]/this._accBinsSizeX),0),n=Math.max(Math.floor(i[1]/this._accBinsSizeY),0),c=Math.min(Math.floor(i[2]/this._accBinsSizeX),this._accBinsNumX-1),e=Math.min(Math.floor(i[3]/this._accBinsSizeY),this._accBinsNumY-1);for(let h=t;h<=c;h++)for(let i=n;i<=e;i++)if(s(this._accBins[h][i]))return!0;return!1}}export{e as DeconflictAABR};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import t from"../../../../core/PooledArray.js";import{create as e,copy as r,area as s,expand as n,contains as o}from"../../../../geometry/support/aaBoundingRect.js";import{noBudget as i}from"../../../support/Scheduler.js";const h=.05;class a{constructor(){this._extents=new t({allocator:t=>t||e()}),this._tmpExtent=e(),this._dirty=!1}get empty(){return 0===this._extents.length}get size(){return this._extents.length}clear(){this._extents.clear()}add(t){this._contains(t)||(this._removeContained(t),r(this._extents.pushNew(),t),this._dirty=!0)}pop(){return this._dirty&&this._mergeTight(),this._extents.pop()}merge(t){return this._mergeTight(t),t.hasProgressed}_mergeTight(t=i){const e=this._extents,o=new Set;let a=0;for(;a!==e.length;){e.sort((t,e)=>t[0]-e[0]),a=e.length,o.clear();for(let i=0;i<e.length;++i){if(t.done)return;const a=e.at(i);if(a){for(let t=i+1;t<e.length;++t){const r=e.at(t);if(null==r||r[0]>=a[2])break;o.add(r)}o.forEach(i=>{if(a===i)return;if(i[2]<=a[0])return void o.delete(i);const l=s(a),_=s(i),c=this._tmpExtent;n(a,i,c);const d=l+_;(s(c)-d)/d<h&&(r(a,c),o.delete(i),e.remove(i),t.madeProgress())}),o.add(a)}}}this._dirty=!1}_contains(t){return this._extents.some(e=>o(e,t))}_removeContained(t){this._extents.filterInPlace(e=>!o(t,e))}get test(){}}export{a as ExtentSet};
5
+ import"../../../../core/has.js";import t from"../../../../core/PooledArray.js";import{create as e,copy as r,area as s,expand as n,contains as o}from"../../../../geometry/support/aaBoundingRect.js";import{noBudget as i}from"../../../support/Scheduler.js";const h=.05;class a{constructor(){this._extents=new t({allocator:t=>t||e()}),this._tmpExtent=e(),this._dirty=!1}destroy(){this._extents.prune()}get empty(){return 0===this._extents.length}get size(){return this._extents.length}clear(){this._extents.clear()}add(t){this._contains(t)||(this._removeContained(t),r(this._extents.pushNew(),t),this._dirty=!0)}pop(){return this._dirty&&this._mergeTight(),this._extents.pop()}merge(t){return this._mergeTight(t),t.hasProgressed}_mergeTight(t=i){const e=this._extents,o=new Set;let a=0;for(;a!==e.length;){e.sort((t,e)=>t[0]-e[0]),a=e.length,o.clear();for(let i=0;i<e.length;++i){if(t.done)return;const a=e.at(i);if(a){for(let t=i+1;t<e.length;++t){const r=e.at(t);if(null==r||r[0]>=a[2])break;o.add(r)}o.forEach(i=>{if(a===i)return;if(i[2]<=a[0])return void o.delete(i);const l=s(a),_=s(i),d=this._tmpExtent;n(a,i,d);const c=l+_;(s(d)-c)/c<h&&(r(a,d),o.delete(i),e.remove(i),t.madeProgress())}),o.add(a)}}}this._dirty=!1}_contains(t){return this._extents.some(e=>o(e,t))}_removeContained(t){this._extents.filterInPlace(e=>!o(t,e))}get test(){}}export{a as ExtentSet};