@arcgis/core 4.33.0-next.20250514 → 4.33.0-next.20250515

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 (399) hide show
  1. package/Graphic.js +1 -1
  2. package/Map.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/applications/Components/SelectionOperation.js +1 -1
  5. package/arcade/functions/featuresetbase.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/009730713ed9bc7c7388.js +1 -0
  8. package/assets/esri/core/workers/chunks/02853ab923245459b32e.js +1 -0
  9. package/assets/esri/core/workers/chunks/0624ae07d3af8d5f1ac8.js +1 -0
  10. package/assets/esri/core/workers/chunks/{6e8c6c9112ecb867b7be.js → 0817ddd885ce8b2459cb.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{69e8aabe5a1eb2d1e414.js → 0832bd5195b5791dd803.js} +1 -1
  12. package/assets/esri/core/workers/chunks/0d23610475c85385fbff.js +1 -0
  13. package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js → 0fd6d80393722132e044.js} +2 -2
  14. package/assets/esri/core/workers/chunks/{b4f38fe9cc948a39ad87.js.LICENSE.txt → 0fd6d80393722132e044.js.LICENSE.txt} +1 -1
  15. package/assets/esri/core/workers/chunks/1051a5a57b2fb843a555.js +1 -0
  16. package/assets/esri/core/workers/chunks/133e4bde346828d4510b.js +1 -0
  17. package/assets/esri/core/workers/chunks/19a58adc75a34f84b0ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/1d7f2abfccc54659d6f2.js +1 -0
  19. package/assets/esri/core/workers/chunks/{339e7a900e2bba9d3647.js → 1f19bd3ef795c6765384.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{837f886f759fc6f0489d.js → 1f4fd9e3849f4e593375.js} +1 -1
  21. package/assets/esri/core/workers/chunks/1f9c6fbcd4d0eae1e574.js +1 -0
  22. package/assets/esri/core/workers/chunks/234117cc5cb7c6863313.js +1 -0
  23. package/assets/esri/core/workers/chunks/{1c025beaaac5ec7c04fb.js → 2adf558cd8d8155d07d7.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{47f64a340b5d56bf9e59.js → 2cf82d3645c75d311e99.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{f7ab3511f6627f467796.js → 377a7f0f7d304ff9fe5b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/3b4b4f84d594db8945f9.js +1 -0
  27. package/assets/esri/core/workers/chunks/3bf1cf6c3cba172e2f6d.js +1 -0
  28. package/assets/esri/core/workers/chunks/{b3ca65d6112079fb1d00.js → 3ce5d7ad16e41eea05be.js} +1 -1
  29. package/assets/esri/core/workers/chunks/465f2db4ab8aa9c9f907.js +1 -0
  30. package/assets/esri/core/workers/chunks/{1e13e03aad422f9e871e.js → 47fe2379f2214bf50036.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{b8b5dfd2d73a8410fba2.js → 4954e0cf4a40e45d237f.js} +1 -1
  32. package/assets/esri/core/workers/chunks/4a362a35bcdb8405a53a.js +1 -0
  33. package/assets/esri/core/workers/chunks/4f8ebd9f0758b801835c.js +1 -0
  34. package/assets/esri/core/workers/chunks/5228d39c05d660a135b6.js +1 -0
  35. package/assets/esri/core/workers/chunks/{736cb9f74bf050b70f4c.js → 52a3d0e041717da7697e.js} +1 -1
  36. package/assets/esri/core/workers/chunks/54ea93f416ab52b413c1.js +1 -0
  37. package/assets/esri/core/workers/chunks/554a8bf4626336e68798.js +1 -0
  38. package/assets/esri/core/workers/chunks/55f087bca75c3f2a4515.js +1 -0
  39. package/assets/esri/core/workers/chunks/{bbaadce582df7e20397b.js → 56d2a20c1b143697aa19.js} +1 -1
  40. package/assets/esri/core/workers/chunks/57211c35a9646f088d86.js +1 -0
  41. package/assets/esri/core/workers/chunks/58526def64536b6581ab.js +1 -0
  42. package/assets/esri/core/workers/chunks/5890740d5a761b038560.js +1 -0
  43. package/assets/esri/core/workers/chunks/{9a641fb94819574e48f6.js → 5a73d8b7b01758ed4fdd.js} +1 -1
  44. package/assets/esri/core/workers/chunks/5dbd8d81d94cfda5bb32.js +1 -0
  45. package/assets/esri/core/workers/chunks/5e52c1c076a1502f9fe4.js +1 -0
  46. package/assets/esri/core/workers/chunks/609c7c9b7046b3a7acde.js +1 -0
  47. package/assets/esri/core/workers/chunks/{30f3014c0ac6e2bc14bf.js → 622c0552ca3cd674d46c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{6e64ce0958c3432004b6.js → 62798f66872dc32e77d6.js} +1 -1
  49. package/assets/esri/core/workers/chunks/6409160d226a0bea5ac6.js +1 -0
  50. package/assets/esri/core/workers/chunks/65fd971d0574d69cbc26.js +1 -0
  51. package/assets/esri/core/workers/chunks/6993a59cbb78bc26f029.js +1 -0
  52. package/assets/esri/core/workers/chunks/6b23ca6570357f9fb724.js +1 -0
  53. package/assets/esri/core/workers/chunks/6c37a5bd00d255d1337a.js +1 -0
  54. package/assets/esri/core/workers/chunks/6ce4327f63e6eb92bba8.js +1 -0
  55. package/assets/esri/core/workers/chunks/6f9b8df290b0ce09beae.js +1 -0
  56. package/assets/esri/core/workers/chunks/{e0247252c6a0f3340e33.js → 6fa1a5b7276a037dbd6a.js} +84 -106
  57. package/assets/esri/core/workers/chunks/7c819b3e6d69c526f4b2.js +1 -0
  58. package/assets/esri/core/workers/chunks/7df147da40474b028705.js +1 -0
  59. package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js → 7e1dc8e5e18f18dd21e2.js} +2 -2
  60. package/assets/esri/core/workers/chunks/{0766ecb677d667e5fb83.js.LICENSE.txt → 7e1dc8e5e18f18dd21e2.js.LICENSE.txt} +1 -1
  61. package/assets/esri/core/workers/chunks/{e662c86b8bafc5512d3d.js → 847e88e1d6da1e74cdc8.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{6f5ec9bf7cf8a36d8e8b.js → 87eca6de502d18d8b7eb.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{10e6dffa57aa1a626708.js → 8a6aac37b3133de74cce.js} +1 -1
  64. package/assets/esri/core/workers/chunks/8a87c181b85d0b86b9bb.js.LICENSE.txt +1 -1
  65. package/assets/esri/core/workers/chunks/8f1fbfdac04e694f621d.js +1 -0
  66. package/assets/esri/core/workers/chunks/91cd29f53f07bc38fe75.js +1 -0
  67. package/assets/esri/core/workers/chunks/{5583d18032ed8bc17c74.js → 938f1eebc48871be64e9.js} +1 -1
  68. package/assets/esri/core/workers/chunks/97c148adf0347c69a79c.js +1 -0
  69. package/assets/esri/core/workers/chunks/{029a118e6dfb3f544a5c.js → 98ef17d15517368d2383.js} +1 -1
  70. package/assets/esri/core/workers/chunks/9c8224ca29475556e5ea.js +1 -0
  71. package/assets/esri/core/workers/chunks/{fd24dd602a3fed88d90e.js → 9d5eac3bd1526e2b33e3.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{38f5e6a202ce292edd9f.js → 9eb9c8db2510154c09cc.js} +1 -1
  73. package/assets/esri/core/workers/chunks/a036503087baa1f9fd00.js +1 -0
  74. package/assets/esri/core/workers/chunks/a673128da9e6656ead2e.js +1 -0
  75. package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js → ab9614555a15f04396f6.js} +2 -2
  76. package/assets/esri/core/workers/chunks/{90ae15ce22a49bd84876.js.LICENSE.txt → ab9614555a15f04396f6.js.LICENSE.txt} +1 -1
  77. package/assets/esri/core/workers/chunks/ae733c963d61065faa54.js +1 -0
  78. package/assets/esri/core/workers/chunks/b0522dffa5600345c07e.js +1 -0
  79. package/assets/esri/core/workers/chunks/{d1f7bfb8daf11ecada9f.js → b4273381dc069f4e1fa2.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{fb2e28e6a87956267d1c.js → b92a34f88569c481ed10.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{352b7dcd1633e0c98194.js → ba940ebdae84b174a7be.js} +1 -1
  82. package/assets/esri/core/workers/chunks/bf9b6b74654d303a6dae.js +1 -0
  83. package/assets/esri/core/workers/chunks/c07c1bb7ae09136dc1f6.js +1 -0
  84. package/assets/esri/core/workers/chunks/c938f5d269ba202d10ef.js +1 -0
  85. package/assets/esri/core/workers/chunks/cbbca011f8b176d4b5db.js +1 -0
  86. package/assets/esri/core/workers/chunks/{c604fefedccfd4db9953.js → ce321fd8fc5551e190ec.js} +1 -1
  87. package/assets/esri/core/workers/chunks/ce53ddda04e09ba2f860.js +1 -0
  88. package/assets/esri/core/workers/chunks/d166f805990353578494.js +1 -0
  89. package/assets/esri/core/workers/chunks/d9a23fb0c6c936d5e8ec.js +1 -0
  90. package/assets/esri/core/workers/chunks/db3f710d770adf631b28.js +2 -0
  91. package/assets/esri/core/workers/chunks/{6394ab6f629aa90292e6.js.LICENSE.txt → db3f710d770adf631b28.js.LICENSE.txt} +1 -1
  92. package/assets/esri/core/workers/chunks/{6805e7b43d6ecf3ea93c.js → dcf5719f38ad40b92941.js} +1 -1
  93. package/assets/esri/core/workers/chunks/e2cada6644c49b1b6e79.js +1 -0
  94. package/assets/esri/core/workers/chunks/e2fb4bebce3aee406efa.js +1 -0
  95. package/assets/esri/core/workers/chunks/e3638f9d4c0fda238f4b.js +1 -0
  96. package/assets/esri/core/workers/chunks/e85f892ea44d67d53ff0.js +2 -0
  97. package/assets/esri/core/workers/chunks/{3596540ef49e5330ceb2.js.LICENSE.txt → e85f892ea44d67d53ff0.js.LICENSE.txt} +1 -1
  98. package/assets/esri/core/workers/chunks/e89345c7af9d3d4d8452.js +1 -0
  99. package/assets/esri/core/workers/chunks/{a31658f544ac6e1801d6.js → ead5d4e271effc04def3.js} +1 -1
  100. package/assets/esri/core/workers/chunks/ece68a25651ef03fc95d.js +1 -0
  101. package/assets/esri/core/workers/chunks/f218a190015de1444018.js +1 -0
  102. package/assets/esri/core/workers/chunks/f229044615af3142bcb0.js +1 -0
  103. package/assets/esri/core/workers/chunks/f2692f25ef693cf12ce0.js +1 -0
  104. package/assets/esri/core/workers/chunks/f4c6ea630cecf0f260d7.js +2 -0
  105. package/assets/esri/core/workers/chunks/{e0dc8794343c2a949ffb.js.LICENSE.txt → f4c6ea630cecf0f260d7.js.LICENSE.txt} +1 -1
  106. package/assets/esri/core/workers/chunks/f718cb847c4eb1e43ad9.js +1 -0
  107. package/assets/esri/core/workers/chunks/faa40ef04604c7cce706.js +1 -0
  108. package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js → fbd2f45d5adce4ca323f.js} +2 -2
  109. package/assets/esri/core/workers/chunks/{218a66d53f7cf4f285aa.js.LICENSE.txt → fbd2f45d5adce4ca323f.js.LICENSE.txt} +1 -1
  110. package/assets/esri/core/workers/chunks/{498886c321a2501658bc.js → ffaa977cd97a2b7190c5.js} +1 -1
  111. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  112. package/assets/esri/themes/base/widgets/_SelectionToolbar.scss +5 -0
  113. package/assets/esri/themes/dark/main.css +1 -1
  114. package/assets/esri/themes/light/main.css +1 -1
  115. package/assets/esri/themes/light/view.css +1 -1
  116. package/chunks/Envelope.js +1 -1
  117. package/chunks/Jpg.js +1 -1
  118. package/chunks/LineSeries.js +1 -1
  119. package/chunks/ProjectionTransformation.js +1 -1
  120. package/chunks/QuadraticBezier.js +1 -1
  121. package/chunks/ShadowCastAccumulate.glsl.js +7 -5
  122. package/chunks/ShadowCastVisualize.glsl.js +1 -1
  123. package/chunks/ShadowHighlight.glsl.js +8 -7
  124. package/chunks/Transformation2D.js +1 -1
  125. package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
  126. package/chunks/arcgis-knowledge-client-core.js +1 -1
  127. package/chunks/basis_encoder.js +1 -1
  128. package/chunks/basis_transcoder.js +1 -1
  129. package/chunks/bundle.js +1 -1
  130. package/chunks/chartUtilsAm5.js +1 -1
  131. package/chunks/dxt_encoder.js +1 -1
  132. package/chunks/geometryEngineBase.js +1 -1
  133. package/chunks/i3s.js +1 -1
  134. package/chunks/lclayout.js +1 -1
  135. package/chunks/libtess-asm.js +1 -1
  136. package/chunks/lyr3DMain.js +1 -1
  137. package/chunks/lyr3DWorker.js +1 -1
  138. package/chunks/vec4.js +1 -1
  139. package/chunks/vxlLayer.js +1 -1
  140. package/core/arrayUtils.js +1 -1
  141. package/core/image/apng.js +1 -1
  142. package/core/image/gif.js +1 -1
  143. package/core/mathUtils.js +1 -1
  144. package/core/workers/Connection.js +1 -1
  145. package/geometry/operators/densifyOperator.d.ts +0 -1
  146. package/geometry/operators/gx/operatorOffset.js +1 -1
  147. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  148. package/geometry/support/meshProperties.js +1 -1
  149. package/geometry/support/normalizeUtilsSync.js +1 -1
  150. package/interfaces.d.ts +200 -147
  151. package/intl/date.js +1 -1
  152. package/intl/number.js +1 -1
  153. package/layers/BingMapsLayer.js +1 -1
  154. package/layers/graphics/OptimizedFeatureSet.js +1 -1
  155. package/layers/graphics/controllers/StreamController.js +1 -1
  156. package/layers/graphics/data/FeatureIdInfo.js +5 -0
  157. package/layers/graphics/data/QueryEngine.js +1 -1
  158. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  159. package/layers/graphics/data/createFeatureId.js +5 -0
  160. package/layers/graphics/featureConversionUtils.js +1 -1
  161. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  162. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  163. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  164. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  165. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  166. package/layers/ogc/ogcFeatureUtils.js +1 -1
  167. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  168. package/layers/orientedImagery/core/utils.js +1 -1
  169. package/layers/orientedImagery/queries.js +1 -1
  170. package/layers/orientedImagery/transformations/utils.js +1 -1
  171. package/layers/support/LercWorker.js +1 -1
  172. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  173. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  174. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  175. package/layers/support/wmsUtils.js +1 -1
  176. package/layers/video/VideoController.js +1 -1
  177. package/package.json +1 -1
  178. package/rest/networks/support/Association.js +1 -1
  179. package/rest/networks/support/NetworkElement.js +1 -1
  180. package/rest/networks/support/QueryAssociationsParameters.js +1 -1
  181. package/rest/networks/support/TelecomNetworkElement.js +1 -1
  182. package/rest/networks/support/TraceResult.js +1 -1
  183. package/rest/query/operations/pbfDehydratedFeatureSet.js +1 -1
  184. package/rest/query/operations/pbfJSONFeatureSet.js +1 -1
  185. package/rest/query/operations/queryRelatedRecords.js +1 -1
  186. package/smartMapping/support/adapters/InMemoryLayerAdapter.js +1 -1
  187. package/support/revision.js +1 -1
  188. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  189. package/views/2d/engine/ManagedCanvas.js +1 -1
  190. package/views/2d/engine/Stage.js +1 -1
  191. package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
  192. package/views/2d/engine/webgl/TileContainer.js +1 -1
  193. package/views/2d/engine/webgl/grouping.js +1 -1
  194. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  195. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  196. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  197. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  198. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  199. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  200. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  201. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  202. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  203. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  204. package/views/2d/layers/features/layerAdapters/featureServiceUtils.js +1 -1
  205. package/views/2d/layers/features/processor/AAggregateStrategy.js +1 -1
  206. package/views/2d/layers/features/processor/BinningStrategy.js +1 -1
  207. package/views/2d/layers/features/processor/ClusterStrategy.js +1 -1
  208. package/views/2d/layers/features/processor/TrackStrategy.js +1 -1
  209. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  210. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  211. package/views/2d/layers/features/sources/strategies/StreamLoadStrategy.js +1 -1
  212. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  213. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  214. package/views/2d/layers/features/support/FeatureMetadata.js +1 -1
  215. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  216. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  217. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  218. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  219. package/views/3d/FocusAreasView.js +1 -1
  220. package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
  221. package/views/3d/analysis/DimensionAnalysisView3D.d.ts +4 -0
  222. package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
  223. package/views/3d/camera/constraintUtils/common.js +1 -1
  224. package/views/3d/interactive/Manipulator3D.js +1 -1
  225. package/views/3d/interactive/SnappingVisualizer3D.js +1 -1
  226. package/views/3d/layers/DimensionLayerView3D.js +1 -1
  227. package/views/3d/layers/I3SMeshView3D.js +1 -1
  228. package/views/3d/layers/LineOfSightLayerView3D.js +1 -1
  229. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  230. package/views/3d/layers/ViewshedLayerView3D.js +1 -1
  231. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  232. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  233. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  234. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  235. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DTextSymbolLayer.js +1 -1
  237. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  238. package/views/3d/layers/graphics/Labeler.js +1 -1
  239. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  240. package/views/3d/layers/graphics/focusAreaStyle.js +5 -0
  241. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  242. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  243. package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
  244. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  245. package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
  246. package/views/3d/layers/i3s/PagedNodeIndex.js +1 -1
  247. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  248. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  249. package/views/3d/layers/support/LayerViewAnalysisViewManager.js +5 -0
  250. package/views/3d/terrain/PatchRenderData.js +1 -1
  251. package/views/3d/terrain/TerrainRenderer.js +1 -1
  252. package/views/3d/terrain/TerrainSurface.js +1 -1
  253. package/views/3d/terrain/TileAgent.js +1 -1
  254. package/views/3d/webgl-engine/collections/Component/IndexRange/ComponentRange.js +1 -1
  255. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  256. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +3 -3
  257. package/views/3d/webgl-engine/core/shaderLibrary/shading/ShadowmapFiltering.glsl.js +3 -25
  258. package/views/3d/webgl-engine/core/shaderLibrary/shading/calculateUVZShadow.glsl.js +1 -1
  259. package/views/3d/webgl-engine/core/shaderModules/Texture2DShadowBindUniform.js +5 -0
  260. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  261. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +3 -3
  262. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  263. package/views/3d/webgl-engine/lib/BoundingInfo.js +1 -1
  264. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  265. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  266. package/views/3d/webgl-engine/lib/Geometry.js +1 -1
  267. package/views/3d/webgl-engine/lib/Material.js +1 -1
  268. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  269. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  270. package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
  271. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  272. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  273. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  274. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  275. package/views/3d/webgl-engine/lib/verticalOffsetUtils.js +1 -1
  276. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  277. package/views/3d/webgl-engine/shaders/ShadowCastAccumulate.glsl.js +1 -1
  278. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  279. package/views/3d/webgl.js +1 -1
  280. package/views/FocusArea.js +1 -1
  281. package/views/FocusAreas.js +1 -1
  282. package/views/GroundView.js +1 -1
  283. package/views/SceneView.js +1 -1
  284. package/views/View.js +1 -1
  285. package/views/draw/support/Box.js +1 -1
  286. package/views/draw/support/GraphicMover.js +1 -1
  287. package/views/draw/support/Reshape.js +1 -1
  288. package/views/input/InputManager.js +1 -1
  289. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  290. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  291. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  292. package/views/layers/FeatureLayerView.js +1 -1
  293. package/views/support/LayerViewManager.js +1 -1
  294. package/views/webgl/RenderingContext.js +1 -1
  295. package/views/webgl/ShaderBuilder.js +1 -1
  296. package/views/webgl/Texture.js +1 -1
  297. package/views/webgl/TextureDescriptor.js +1 -1
  298. package/views/webgl/textureUtils.js +1 -1
  299. package/webscene/Slide.js +1 -1
  300. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  301. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  302. package/widgets/CoordinateConversion.js +1 -1
  303. package/widgets/Directions.js +1 -1
  304. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  305. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  306. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  307. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  308. package/widgets/FeatureForm.js +1 -1
  309. package/widgets/LayerList/LayerListItem.js +1 -1
  310. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  311. package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
  312. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  313. package/widgets/OrientedImageryViewer/components/NavigationUI.js +1 -1
  314. package/widgets/OrientedImageryViewer/components/NavigationUIPanoramicViewModel.js +5 -0
  315. package/widgets/OrientedImageryViewer/components/NavigationUIViewModel.js +1 -1
  316. package/widgets/OrientedImageryViewer/components/imageNavigationUtils.js +1 -1
  317. package/widgets/OrientedImageryViewer/constants.js +1 -1
  318. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +5 -0
  319. package/widgets/OrientedImageryViewer/navigation/NavigationManagerPanoramic.js +5 -0
  320. package/widgets/OrientedImageryViewer/navigation/errors.js +5 -0
  321. package/widgets/OrientedImageryViewer/navigation/queries.js +5 -0
  322. package/widgets/OrientedImageryViewer/navigation/utils.js +5 -0
  323. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  324. package/widgets/PanoramicViewer.js +1 -1
  325. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  326. package/widgets/Sketch/SketchViewModel.js +1 -1
  327. package/widgets/Sketch.js +1 -1
  328. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  329. package/widgets/support/SelectionToolbar.js +1 -1
  330. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  331. package/widgets/support/SnappingControls.js +1 -1
  332. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +1 -1
  333. package/widgets/support/UtilityNetworkAssociations/utils/createAssociation.js +1 -1
  334. package/assets/esri/core/workers/chunks/0516bd18334d3af6c555.js +0 -1
  335. package/assets/esri/core/workers/chunks/0d8a635c1f9aeaf7564c.js +0 -1
  336. package/assets/esri/core/workers/chunks/191a45a594ecaf7f1abb.js +0 -1
  337. package/assets/esri/core/workers/chunks/1abd026ed12c863e1d94.js +0 -1
  338. package/assets/esri/core/workers/chunks/1c6542315390037053a6.js +0 -1
  339. package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +0 -1
  340. package/assets/esri/core/workers/chunks/23de8aeed5b82c682cbe.js +0 -1
  341. package/assets/esri/core/workers/chunks/2e0af748eba93f3ea6cb.js +0 -1
  342. package/assets/esri/core/workers/chunks/3596540ef49e5330ceb2.js +0 -2
  343. package/assets/esri/core/workers/chunks/3604a77c93cf2927787b.js +0 -1
  344. package/assets/esri/core/workers/chunks/391b1c3e736a62befbaf.js +0 -1
  345. package/assets/esri/core/workers/chunks/40e556a0645af8658658.js +0 -1
  346. package/assets/esri/core/workers/chunks/4402336db7210cd583e0.js +0 -1
  347. package/assets/esri/core/workers/chunks/4899cdc8bb5085c356f9.js +0 -1
  348. package/assets/esri/core/workers/chunks/4bd5cbf6e0be2fc7e84d.js +0 -1
  349. package/assets/esri/core/workers/chunks/4c8052e81916579841f4.js +0 -1
  350. package/assets/esri/core/workers/chunks/4c9aa1dafdc0d9537231.js +0 -1
  351. package/assets/esri/core/workers/chunks/4feb774f123da26e9f2a.js +0 -1
  352. package/assets/esri/core/workers/chunks/51b5dfc7085272d26b89.js +0 -1
  353. package/assets/esri/core/workers/chunks/566c2ce50af225e556ac.js +0 -1
  354. package/assets/esri/core/workers/chunks/5ddf463c85c33428e807.js +0 -1
  355. package/assets/esri/core/workers/chunks/61032b5050464cb48056.js +0 -1
  356. package/assets/esri/core/workers/chunks/6394ab6f629aa90292e6.js +0 -2
  357. package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +0 -1
  358. package/assets/esri/core/workers/chunks/64af433e88d4dd21a2ff.js +0 -1
  359. package/assets/esri/core/workers/chunks/6e12900a9f4c3c9941ec.js +0 -1
  360. package/assets/esri/core/workers/chunks/6e5d8a6b29c06a27998c.js +0 -1
  361. package/assets/esri/core/workers/chunks/6f506303017903b9a06f.js +0 -1
  362. package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +0 -1
  363. package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +0 -1
  364. package/assets/esri/core/workers/chunks/7c49a8877bd744daa3d5.js +0 -1
  365. package/assets/esri/core/workers/chunks/7ea5bbb52e84be9a608e.js +0 -1
  366. package/assets/esri/core/workers/chunks/82c395d8649096609a8a.js +0 -1
  367. package/assets/esri/core/workers/chunks/86138c297095af1ac604.js +0 -1
  368. package/assets/esri/core/workers/chunks/8c21cc9af4ce9652cc5c.js +0 -1
  369. package/assets/esri/core/workers/chunks/8e6301006abdf47cc88d.js +0 -1
  370. package/assets/esri/core/workers/chunks/90f93091fe088875f80f.js +0 -1
  371. package/assets/esri/core/workers/chunks/91a02ee91f61cf841111.js +0 -1
  372. package/assets/esri/core/workers/chunks/9baeb3b5733acdda4e7c.js +0 -1
  373. package/assets/esri/core/workers/chunks/a1d697e2be1e892a666a.js +0 -1
  374. package/assets/esri/core/workers/chunks/a1f27c4f4b5ef3e359f7.js +0 -1
  375. package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +0 -1
  376. package/assets/esri/core/workers/chunks/b64f708f821dd2bb51cd.js +0 -1
  377. package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +0 -1
  378. package/assets/esri/core/workers/chunks/c1175477dfcdee90a453.js +0 -1
  379. package/assets/esri/core/workers/chunks/c4e2b75b9135920babc3.js +0 -1
  380. package/assets/esri/core/workers/chunks/cb80b7ddc9acf625d754.js +0 -1
  381. package/assets/esri/core/workers/chunks/d22f91bc16a7641bcbef.js +0 -1
  382. package/assets/esri/core/workers/chunks/d52cf7b795ee52034f9e.js +0 -1
  383. package/assets/esri/core/workers/chunks/d971571a957de70d5a8d.js +0 -1
  384. package/assets/esri/core/workers/chunks/d9d9d4f99140e579eabb.js +0 -1
  385. package/assets/esri/core/workers/chunks/dc3a6beb3028009b3c23.js +0 -1
  386. package/assets/esri/core/workers/chunks/e0dc8794343c2a949ffb.js +0 -2
  387. package/assets/esri/core/workers/chunks/e483d2f169e51a361742.js +0 -1
  388. package/assets/esri/core/workers/chunks/e5608e5232e983531f72.js +0 -1
  389. package/assets/esri/core/workers/chunks/e613df03ceb39e29befa.js +0 -1
  390. package/assets/esri/core/workers/chunks/e697dd4508f02dcfe329.js +0 -1
  391. package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +0 -1
  392. package/assets/esri/core/workers/chunks/ec8e8048b3df2c92008d.js +0 -1
  393. package/assets/esri/core/workers/chunks/ed6d0fea159dea638c2f.js +0 -1
  394. package/assets/esri/core/workers/chunks/f5fcba6ca6f43bf1d65d.js +0 -1
  395. package/assets/esri/core/workers/chunks/f92d76b694ff0cdb212c.js +0 -1
  396. package/chunks/NetworkElement.js +0 -5
  397. package/views/FocusAreasUtils.js +0 -5
  398. package/views/analysis/DimensionAnalysisView.d.ts +0 -4
  399. package/views/analysis/DimensionAnalysisView.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQuery as c,executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import u from"../../../../../rest/support/StatisticDefinition.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as m}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as l}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as p}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as y}from"./strategies/PagedTileLoadStrategy.js";import{ParquetLoadStrategy as _}from"./strategies/ParquetLoadStrategy.js";import{SnapshotLoadStrategy as g}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as f}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as S}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as v}from"../support/FeatureMetadata.js";import{UpdateTracking2D as b}from"../../support/UpdateTracking2D.js";class F{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._connection=r,this._cachedObjectIds=a,this._updateTracking=new b({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=v.createFeature(e.metadata),this._store=new S(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map((e=>e.close()))}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,objectIdField:s.objectIdField,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&("displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo)}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(e,t){const s=new Set,r=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),s.add(a));for(const a of t)this._cachedObjectIds.delete(a),r.add(a);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,r)}async applyCacheUpdate(){this.hasDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this._store.cleanup()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!!(i(n,"dataFilter")||i(n,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&i(n,"displayFilterInfo"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new l(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this._store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new f(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return new _(e,this._metadata,this._schema,this._store)}const a=this.service,i=m.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new g(a,i,this._store,n,this.metadata,this._connection):r?new y(a,i,this._store,this.metadata,this._connection):new p(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map((e=>this._strategy.load(e).then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))))));this._updateTracking.addPromise(i),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r)return null;return await this._executeExceedsLimitQuery(e,t,r)?null:r}async _executeExceedsLimitQuery(e,t,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(e,t,s);try{const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const i=new u;i.statisticType="exceedslimit",i.maxPointCount=s.maxFeatureCount,i.maxRecordCount=s.maxFeatureCount,i.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(i.maxVertexCount=s.maxVertexCount),a.inner.outStatistics=[i],a.inner.cacheHint=!0;const n=await c(r,a.inner,void 0,{query:a.customParameters}),o=n.data.features[0]?.attributes.exceedslimit;return!(0===o)}catch(r){return!0}}async _executeExceedsLimitFallbackQuery(e,t,s){if(s.maxVertexCount)return!0;const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1,a.inner.cacheHint=!0;try{return(await d(r,a.inner,{query:a.customParameters})).data.count>s.maxFeatureCount}catch(i){return!0}}}export{F as FeatureSource};
5
+ import e from"../../../../../request.js";import has from"../../../../../core/has.js";import{ignoreAbortErrors as t,throwIfNotAbortError as s}from"../../../../../core/promiseUtils.js";import{diff as r,hasRootDiffOnly as a,hasRootDiff as i}from"../../../../../core/accessorSupport/diffUtils.js";import{OptimizedFeature as n}from"../../../../../layers/graphics/OptimizedFeature.js";import{QueryEngine as o}from"../../../../../layers/graphics/data/QueryEngine.js";import{executeQuery as c,executeQueryForCount as d}from"../../../../../rest/query/operations/query.js";import u from"../../../../../rest/support/StatisticDefinition.js";import{FeatureStoreStatistics as h}from"../FeatureStoreStatistics.js";import{FeatureSourceQueryInfo as m}from"./FeatureSourceQueryInfo.js";import{StreamMessenger as p}from"./StreamMessenger.js";import{DrillDownTileLoadStrategy as l}from"./strategies/DrillDownTileLoadStrategy.js";import{PagedTileLoadStrategy as y}from"./strategies/PagedTileLoadStrategy.js";import{ParquetLoadStrategy as _}from"./strategies/ParquetLoadStrategy.js";import{SnapshotLoadStrategy as g}from"./strategies/SnapshotLoadStrategy.js";import{StreamLoadStrategy as f}from"./strategies/StreamLoadStrategy.js";import{FeatureSourceChunkStore as S}from"./strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as v}from"../support/FeatureMetadata.js";import{UpdateTracking2D as b}from"../../support/UpdateTracking2D.js";class E{constructor(e,t,s,r,a){this.service=e,this._aggregateAdapter=t,this._subscriptions=s,this._connection=r,this._cachedObjectIds=a,this._updateTracking=new b({debugName:"FeatureSource"}),this._didInvalidateData=!1,this._metadata=v.createFeature(e.metadata),this._store=new S(this._metadata)}destroy(){this._strategy?.destroy(),this._store.destroy(),this._streamMessenger?.destroy(),"memory"===this.service.type&&this.service.source.map((e=>e.close()))}get metadata(){if(!this._metadata)throw new Error("InternalError: Metadata not defined. Was update called?");return this._metadata}get store(){return this._store}get streamMessenger(){return null==this._streamMessenger&&this._initStreamMessenger(),this._streamMessenger}get statistics(){return h.from(this._store)}get updateTracking(){return this._updateTracking}get queryEngine(){if(!this._queryEngine){if(!this._schema)return null;const{dataFilter:e}=this._schema.mutable,t=this._schema.mutable.availableFields,s=this._metadata;this._queryEngine=new o({featureStore:this._store,fieldsIndex:s.fieldsIndex,geometryType:s.geometryType,featureIdInfo:s.featureIdInfo,hasM:!1,hasZ:!1,spatialReference:this.service.outSpatialReference,aggregateAdapter:this._aggregateAdapter,timeInfo:s.timeInfo,definitionExpression:e.definitionExpression,availableFields:t})}return this._queryEngine}get isStream(){return"stream"===this._schema.type}get hasDisplayFilter(){return!!this._schema&&("displayFilterInfo"in this._schema.mutable&&null!=this._schema.mutable.displayFilterInfo)}chunks(){return Array.from(this._store.chunks())}prepareCacheUpdate(e,t){const s=new Set,r=new Set;for(const a of e)this._cachedObjectIds.has(a)||(this._cachedObjectIds.add(a),s.add(a));for(const a of t)this._cachedObjectIds.delete(a),r.add(a);this.hasDisplayFilter&&this._strategy.prepareCacheUpdate(s,r)}async applyCacheUpdate(){this.hasDisplayFilter&&await this._updateTracking.addPromise(this._strategy.applyCacheUpdate())}cleanup(){return this._store.cleanup()}onSubscribe(e){this._connection.onEvent({type:"subscribe",tile:e.tile.id});const t=this._strategy?.load(e);t&&(t.then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))),this._updateTracking.addPromise(t))}onResume(e){this._updateTracking.addPromise(t(this._strategy?.load(e)))}onUnsubscribe(e){this._connection.onEvent({type:"unsubscribe",tile:e.tile.id}),this._strategy?.unload(e)}applyOverride(e){this._didInvalidateData=!0,this._store.applyOverride(e)}takeOverrideUpdate(){return this._store.takeOverrideUpdate()}async update(e,t){const s=e.source,n=r(this._schema?.mutable,s.mutable);if(!n)return!1;if(has("esri-2d-update-debug")&&console.debug(`Version[${t}] FeatureSource.update`,{changes:n}),this._schema=s,this._queryEngine?.destroy(),this._queryEngine=null,"feature-service"===this.service.type&&null!=this.service.queryMetadata.lastEditDate&&(this._lastEditDate=this.service.queryMetadata.lastEditDate),null==this._streamMessenger&&"stream"===this._schema.type&&this._initStreamMessenger(),a(n,"sourceRefreshVersion")&&this._strategy?.refresh)return this._strategy.refresh();if(("feature"===s.type||"parquet"===s.type)&&a(n,"availableFields")){if(await this._queryLastEditDateChanged()||this._didInvalidateData)this._didInvalidateData=!1,await this._updateStrategy(t);else{this._connection.onEvent({type:"updateFieldsStart"});try{await this._strategy.updateFields(s.mutable.availableFields),this._connection.onEvent({type:"updateFieldsEnd"})}catch(o){this._connection.onEvent({type:"updateFieldsError",error:o})}}return!1}return!!(i(n,"dataFilter")||i(n,"sourceRefreshVersion")||this._strategy.about.supportsDisplayFilter&&i(n,"displayFilterInfo"))&&(await this._updateStrategy(t),!0)}async addParquetFile(e){this._strategy.addParquetFile(e)}unsafeSetQueryHistoricMoment(e){"feature"===this._schema.type&&(this._schema.mutable.dataFilter.historicMoment=e,this._strategy.unsafeSetQueryHistoricMoment(new Date(e)))}_initStreamMessenger(){null==this._streamMessenger&&(this._streamMessenger=new p(this._connection))}async normalizeOverrides(e){const t={historicMoment:e.historicMoment,commands:{updateWeak:e.commands.updateWeak.map(n.fromJSON),removeWeak:e.commands.removeWeak,update:e.commands.update.map(n.fromJSON),remove:e.commands.remove,release:e.commands.release}},s=e.commands.updateByIdWeak,r=await this._queryOptimizedFeatures(s);return t.commands.updateWeak.push(...r),t}async _queryOptimizedFeatures(e){if(0===e.length)return[];const t=[],s=(await this._strategy.queryByObjectId(e)).getCursor();for(;s.next();)t.push(s.readOptimizedFeatureWorldSpace());return t}getObjectIdsFromGlobalIds(e){const t=this.metadata.globalIdField;if(null==t)throw new Error("InternalError: Recieved an edit with globalIds, but not supported by the service");const s=this._store.mapObjectIdsFromGlobalIds(e,t).values();return Array.from(s)}async _queryLastEditDateChanged(){if(null==this._lastEditDate)return!1;const t=this.service.source,s={...t.query,f:"json"},r=(await e(t.path,{query:s,responseType:"json"})).data.editingInfo.lastEditDate;return r!==this._lastEditDate&&(this._lastEditDate=r,!0)}async _createStrategy(){const e="isSourceHosted"in this.service&&this.service.isSourceHosted,t=Array.isArray(this.service.source),s=this.service.source&&"collection"in this.service.source,r=e||t||s;if("stream"===this._schema.type){const e=new f(this.service,this._schema.mutable.dataFilter,this._store,{outSR:this.service.outSpatialReference},this.metadata);return this._streamMessenger.strategy=e,e}if("parquet"===this._schema.type){const e=this.service;return new _(e,this._metadata,this._schema,this._store)}const a=this.service,i=m.fromSchema(a,this._schema,this._metadata),n=await this._supportSnapshotMode(a,i);return n?new g(a,i,this._store,n,this.metadata,this._connection):r?new y(a,i,this._store,this.metadata,this._connection):new l(a,i,this._store,this.metadata,this._connection)}async _updateStrategy(e){const t=await this._createStrategy();this._connection.onEvent({type:"updateStrategyStart",about:t.about});const r=!!this._strategy;this._store.clear(),this._strategy?.destroy(),this._strategy=t,has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategy`,{strategy:t});const a=Array.from(this._subscriptions.values());if(!a.length)return void this._connection.onEvent({type:"updateStrategyEnd"});const i=Promise.all(a.map((e=>this._strategy.load(e).then((()=>this._connection.onEvent({type:"loaded",tile:e.tile.id}))).catch((t=>this._connection.onEvent({type:"error",tile:e.tile.id,error:t}))))));this._updateTracking.addPromise(i),this._strategy.prepareCacheUpdate(this._cachedObjectIds);try{r&&await i}catch(n){s(n)}this._connection.onEvent({type:"updateStrategyEnd"}),has("esri-2d-update-debug")&&console.debug(`Version[${e}] FeatureSource.updateStrategyEnd`,{strategy:t})}async _supportSnapshotMode(e,t){const{queryMetadata:s}=e,r=s.snapshotInfo;if(!r)return null;return await this._executeExceedsLimitQuery(e,t,r)?null:r}async _executeExceedsLimitQuery(e,t,s){if(!s.supportsExceedsLimit)return this._executeExceedsLimitFallbackQuery(e,t,s);try{const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1;const i=new u;i.statisticType="exceedslimit",i.maxPointCount=s.maxFeatureCount,i.maxRecordCount=s.maxFeatureCount,i.outStatisticFieldName="exceedslimit",s.maxVertexCount&&(i.maxVertexCount=s.maxVertexCount),a.inner.outStatistics=[i],a.inner.cacheHint=!0;const n=await c(r,a.inner,void 0,{query:a.customParameters}),o=n.data.features[0]?.attributes.exceedslimit;return!(0===o)}catch(r){return!0}}async _executeExceedsLimitFallbackQuery(e,t,s){if(s.maxVertexCount)return!0;const r=e.source,a=t.createQuery();a.inner.orderByFields=[],a.inner.returnGeometry=!1,a.inner.cacheHint=!0;try{return(await d(r,a.inner,{query:a.customParameters})).data.count>s.maxFeatureCount}catch(i){return!0}}}export{E as FeatureSource};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getClauseForScaleRange as a}from"../../../../../layers/support/displayFilterUtils.js";import i from"../../../../../rest/support/Query.js";import{T as s}from"../../../../../chunks/TimeExtent.js";const o=4;function n(e,a,i){const o=e.orderByFields??i.objectIdField+" ASC",n=e.source,u={returnCentroid:!(null!==n&&"object"==typeof n&&"path"in n&&r(n.path))&&"esriGeometryPolygon"===i.serviceGeometryType,returnGeometry:!0,timeReferenceUnknownClient:i.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[o],where:a.mutable.dataFilter.definitionExpression??"1=1",outFields:a.mutable.availableFields,multipatchOption:"esriGeometryMultiPatch"===i.serviceGeometryType?"xyFootprint":null};if("feature"===a.type){const{gdbVersion:e,historicMoment:t,timeExtent:r}=a.mutable.dataFilter;return{...u,gdbVersion:e,historicMoment:t?new Date(t):null,timeExtent:r?s.fromJSON(r):null,outFields:a.mutable.availableFields}}return u}class u{static fromSchema(e,t,r){const a="feature"===t.type?t.mutable.dataFilter.queryScaleRanges:[],i=t.mutable.displayFilterInfo;return new u(n(e,t,r),i,a,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?o:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new i({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,r){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(r),s=i.inner;if(this._queryScaleRanges.length){const r=this._queryScaleRanges.filter((e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale))).map((e=>e.subtypeCode));if(r.length){const t=`${this._subtypeField} IN (${r})`;s.where=e(s.where,t)}}if(this._displayFilter&&(s.where=e(s.where,a(this._displayFilter,t.minScale,t.maxScale))),s.quantizationParameters=r.quantizationParameters??t.getQuantizationParameters(),s.resultType="tile",s.geometry=t.extent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(s.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(s.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(s.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),s.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,s.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(s.maxRecordCountFactor=o),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.pageSize;return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:o,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{u as FeatureSourceQueryInfo};
5
+ import has from"../../../../../core/has.js";import{sqlAnd as e}from"../../../../../core/sql.js";import t from"../../../../../geometry/SpatialReference.js";import{isHostedAgolService as r}from"../../../../../layers/support/arcgisLayerUrl.js";import{getClauseForScaleRange as a}from"../../../../../layers/support/displayFilterUtils.js";import i from"../../../../../rest/support/Query.js";import{T as s}from"../../../../../chunks/TimeExtent.js";const o=4;function n(e){switch(e.type){case"object-id":case"unique-id-simple":return`${e.fieldName} ASC`;case"unique-id-composite":return`${e.fieldNames.join(",")} ASC`}}function u(e,a,i){const o=n(i.featureIdInfo),u=e.source,l={returnCentroid:!(null!==u&&"object"==typeof u&&"path"in u&&r(u.path))&&"esriGeometryPolygon"===i.serviceGeometryType,returnGeometry:!0,timeReferenceUnknownClient:i.timeReferenceUnknownClient??void 0,outSpatialReference:t.fromJSON(e.outSpatialReference),orderByFields:"memory"===e.type?[]:[o],where:a.mutable.dataFilter.definitionExpression??"1=1",outFields:a.mutable.availableFields,multipatchOption:"esriGeometryMultiPatch"===i.serviceGeometryType?"xyFootprint":null};if("feature"===a.type){const{gdbVersion:e,historicMoment:t,timeExtent:r}=a.mutable.dataFilter;return{...l,gdbVersion:e,historicMoment:t?new Date(t):null,timeExtent:r?s.fromJSON(r):null,outFields:a.mutable.availableFields}}return l}class l{static fromSchema(e,t,r){const a="feature"===t.type?t.mutable.dataFilter.queryScaleRanges:[],i=t.mutable.displayFilterInfo;return new l(u(e,t,r),i,a,r.subtypeField,t.mutable.dataFilter.customParameters,r.geometryType,e.queryMetadata)}constructor(e,t,r,a,i,s,o){this._queryParams=e,this._displayFilter=t,this._queryScaleRanges=r,this._subtypeField=a,this._customParameters=i,this._geometryType=s,this._queryMetadata=o}get pageSize(){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support paged queries");const e=this._queryMetadata.supportsMaxRecordCountFactor?o:null,t=(this._queryMetadata.maxRecordCount??8e3)*(e??1);return Math.min(8e3,t)}get objectIdsQueryPageSize(){return this._queryMetadata?.maxRecordCount??2e3}updateHistoricMoment(e){this._queryParams.historicMoment=e}updateFields(e){this._queryParams.outFields=e}createPatchFieldsQuery(e,t,r){if(!t.getSize())return null;const a=e.clone();if("*"===this._queryParams.outFields[0]){if("*"===(a.outFields??[])[0])return null;a.outFields=this._queryParams.outFields}else{const e=new Set(this._queryParams.outFields),r=[];for(const a of e)t.hasField(a)||r.push(a);if(0===r.length)return null;a.outFields=r}a.returnGeometry=!1,a.returnCentroid=!1,a.quantizationParameters=null,a.cacheHint=!0;const i={inner:a,customParameters:this._customParameters};if(has("esri-tiles-debug")&&null!=r){const e=r.chunkId.toString().replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,chunkId:e}:{chunkId:e}}return i}createQuery(e={}){if(!this._queryParams)throw new Error("InternalError: queryInfo should be defined");return{inner:new i({...this._queryParams,...e}),customParameters:this._customParameters}}createTileQuery(t,r){if(null==this._queryMetadata)throw new Error("InternalError: Service does not support tile queries");const i=this.createQuery(r),s=i.inner;if(this._queryScaleRanges.length){const r=this._queryScaleRanges.filter((e=>(!e.minScale||e.minScale>=t.maxScale)&&(!e.maxScale||e.maxScale<=t.minScale))).map((e=>e.subtypeCode));if(r.length){const t=`${this._subtypeField} IN (${r})`;s.where=e(s.where,t)}}if(this._displayFilter&&(s.where=e(s.where,a(this._displayFilter,t.minScale,t.maxScale))),s.quantizationParameters=r.quantizationParameters??t.getQuantizationParameters(),s.resultType="tile",s.geometry=t.extent,this._queryMetadata.supportsQuantization?"esriGeometryPolyline"===this._geometryType&&(s.maxAllowableOffset=t.resolution*has("feature-polyline-generalization-factor")):"esriGeometryPolyline"!==this._geometryType&&"esriGeometryPolygon"!==this._geometryType||(s.maxAllowableOffset=t.resolution,"esriGeometryPolyline"===this._geometryType&&(s.maxAllowableOffset*=has("feature-polyline-generalization-factor"))),s.defaultSpatialReferenceEnabled=this._queryMetadata.supportsDefaultSpatialReference,s.compactGeometryEnabled=this._queryMetadata.supportsCompactGeometry,this._queryMetadata.supportsMaxRecordCountFactor&&(s.maxRecordCountFactor=o),has("esri-tiles-debug")){const e=t.id.replaceAll("/",".");i.customParameters=i.customParameters?{...i.customParameters,tileId:e}:{tileId:e}}return i}createPagedTileQuery(e,t){const r=this.pageSize;return this.createTileQuery(e,{start:r*t,num:r,returnExceededLimitFeatures:!0})}createPagedQuery(e,t){const r=this.pageSize;return this.createQuery({start:r*e,num:r,returnExceededLimitFeatures:!0,maxRecordCountFactor:o,quantizationParameters:t,cacheHint:!0})}createObjectIdsQuery(e){return this.createQuery({objectIds:e,outFields:["*"]})}}export{l as FeatureSourceQueryInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../../core/Evented.js";import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import"../../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../../core/maybe.js";import{StreamFeatureManager as n}from"../../../../../../layers/graphics/data/StreamFeatureManager.js";import{createConnection as i}from"../../../../../../layers/graphics/sources/connections/createConnection.js";import{internalTimeReceivedField as o}from"../../../../../../layers/support/streamLayerUtils.js";import{StreamConnectionState as r}from"../StreamConnectionState.js";import{StreamFeatureStore as a}from"../StreamFeatureStore.js";import{ALoadStrategy as c}from"./ALoadStrategy.js";import{StreamSourceChunk as h}from"./chunks/StreamSourceChunk.js";class m extends c{constructor(t,s,i,c,h){super(i),this._service=t,this._dataFilter=s,this._streamOptions=c,this._metadata=h,this._connectionState=new r,this._forceRefresh=!1,this.events=new e;const{objectIdField:m,timeInfo:d}=this._metadata,{purgeOptions:_}=s;this._stagingStore=new a(this._metadata.weakCloneWithAdditionalFields([{name:o,alias:"timeReceived",type:"esriFieldTypeDate"}]),(e=>this.events.emit("features-updated",e))),this._manager=new n(this._stagingStore,m,d,_),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=null!=this._chunk;return this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new h(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick"),!0):(this.events.emit("tick"),!1)}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=s(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(null!=this._connection)return;const{geometryType:e,spatialReference:s}=this._metadata,{maxReconnectionAttempts:n,maxReconnectionInterval:o,geometryDefinition:r,definitionExpression:a,customParameters:c}=this._dataFilter;this._connection=i(this._service.source,s,this._streamOptions.outSR,e,a,r,n,o,c),this._handlesGroup=t([this._connection.on("data-received",(e=>this._onFeature(e))),this._connection.on("message-received",(e=>this._onWebSocketMessage(e)))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch(t){}}}export{m as StreamLoadStrategy};
5
+ import e from"../../../../../../core/Evented.js";import{handlesGroup as t}from"../../../../../../core/handleUtils.js";import"../../../../../../core/has.js";import{destroyMaybe as s}from"../../../../../../core/maybe.js";import{StreamFeatureManager as n}from"../../../../../../layers/graphics/data/StreamFeatureManager.js";import{createConnection as o}from"../../../../../../layers/graphics/sources/connections/createConnection.js";import{internalTimeReceivedField as i}from"../../../../../../layers/support/streamLayerUtils.js";import{StreamConnectionState as r}from"../StreamConnectionState.js";import{StreamFeatureStore as a}from"../StreamFeatureStore.js";import{ALoadStrategy as c}from"./ALoadStrategy.js";import{StreamSourceChunk as h}from"./chunks/StreamSourceChunk.js";class m extends c{constructor(t,s,o,c,h){super(o),this._service=t,this._dataFilter=s,this._streamOptions=c,this._metadata=h,this._connectionState=new r,this._forceRefresh=!1,this.events=new e;const{timeInfo:m}=this._metadata,{purgeOptions:d}=s;this._stagingStore=new a(this._metadata.weakCloneWithAdditionalFields([{name:i,alias:"timeReceived",type:"esriFieldTypeDate"}]),(e=>this.events.emit("features-updated",e))),this._manager=new n(this._stagingStore,h.featureIdInfo,m,d),this.connect()}destroy(){super.destroy(),this.disconnect()}get about(){return{supportsDisplayFilter:!1,willQueryAllFeatures:!1,willQueryFullResolutionGeometry:!1}}get connectionStatus(){return this._connectionState.connectionStatus}get errorString(){return this._connectionState?.errorString}async refresh(){const e=null!=this._chunk;return this._manager.checkForUpdates()||!e||this._forceRefresh?(this._chunk&&this._store.remove(this._chunk),this._forceRefresh=!1,this._chunk=new h(this._stagingStore.reader),this._store.insert(this._chunk),this.events.emit("tick"),!0):(this.events.emit("tick"),!1)}async updateFields(e){throw new Error("Updating available fields not supported for StreamLayer")}async load(e){}unload(e){}disconnect(){this._connection=s(this._connection),this._connectionState.connection=null,this._handlesGroup?.remove()}connect(){if(null!=this._connection)return;const{geometryType:e,spatialReference:s}=this._metadata,{maxReconnectionAttempts:n,maxReconnectionInterval:i,geometryDefinition:r,definitionExpression:a,customParameters:c}=this._dataFilter;this._connection=o(this._service.source,s,this._streamOptions.outSR,e,a,r,n,i,c),this._handlesGroup=t([this._connection.on("data-received",(e=>this._onFeature(e))),this._connection.on("message-received",(e=>this._onWebSocketMessage(e)))]),this._connectionState.connection=this._connection}clear(){this._manager.checkForUpdates(),this._stagingStore.clear(),this._forceRefresh=!0}updateCustomParameters(e){this._connection?.updateCustomParameters(e)}sendMessageToSocket(e){this._connection?.sendMessageToSocket(e)}sendMessageToClient(e){this._connection?.sendMessageToClient(e)}_onWebSocketMessage(e){if("type"in e)switch(e.type){case"delete":if(e.objectIds)for(const t of e.objectIds)this._manager.removeById(t);if(e.trackIds)for(const t of e.trackIds)this._manager.removeByTrackId(t);break;case"clear":this.clear()}this.events.emit("message-received",e)}_onFeature(e){try{this._manager.add(e),this.events.emit("data-received",e)}catch(t){}}}export{m as StreamLoadStrategy};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import has from"../../../../../../../core/has.js";import t from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as e}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as r,quantizeOptimizedFeatureSet as a}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as s}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as i,executeQuery as o}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as n}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as u}from"../../../support/FeatureSetReaderPBF.js";class c{constructor(t,e){this.service=t,this._metadata=e}destroy(){}}function m(t,e){switch(t.type){case"memory":return new l(t,e);case"ogc":return new y(t,e);case"feature-service":return t.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?new d(t,e):new f(t,e)}}async function p(e){const r=new t;return await r.open(e,{}),r}class l extends c{constructor(t,e){super(t,e),this._portsOpen=p(t.source).then((t=>this.client=t))}destroy(){this.client.close(),this.client=null}async executeQuery(t,e){await this._portsOpen;const r=await this.client.invoke("queryFeatures",t.toJSON(),e);return n.fromFeatureSet(r,this._metadata)}}class d extends c{async executeQuery(t,e){const{data:r}=await i(this.service.source,t,e),a=!t.quantizationParameters;return u.fromBuffer(r,this._metadata,a)}}class f extends c{async executeQuery(t,s){const{source:i,queryMetadata:u}=this.service;if(null!=t.quantizationParameters&&!u.supportsQuantization){const u=t.clone(),c=e(u.quantizationParameters);u.quantizationParameters=null;const{data:m}=await o(i,u,this._metadata.spatialReference,s),p=r(m,this._metadata.objectIdField);return a(c,p),n.fromOptimizedFeatureSet(p,this._metadata)}const{data:c}=await o(i,t,this._metadata.spatialReference,s);return"esriGeometryPoint"===this._metadata.geometryType&&(c.features=c.features?.filter((t=>{if(null!=t.geometry){const e=t.geometry;return Number.isFinite(e.x)&&Number.isFinite(e.y)}return!0}))),n.fromFeatureSet(c,this._metadata)}}class y extends c{async executeQuery(t,r){if(t.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const i=t.clone(),o=e(i.quantizationParameters);i.quantizationParameters=null;const u=await s(this.service.source,t,r);return a(o,u),n.fromOptimizedFeatureSet(u,this._metadata)}const i=await s(this.service.source,t,r);return n.fromOptimizedFeatureSet(i,this._metadata)}}export{c as SourceAdapter,m as createQueryAdapter};
5
+ import has from"../../../../../../../core/has.js";import t from"../../../../../../../core/workers/Connection.js";import{toQuantizationTransform as e}from"../../../../../../../geometry/support/quantizationUtils.js";import{convertFromFeatureSet as r,quantizeOptimizedFeatureSet as a}from"../../../../../../../layers/graphics/featureConversionUtils.js";import{queryOptimizedFeatureSet as s}from"../../../../../../../layers/ogc/ogcFeatureUtils.js";import{executeQueryPBFBuffer as i,executeQuery as o}from"../../../../../../../rest/query/operations/query.js";import{FeatureSetReaderJSON as n}from"../../../support/FeatureSetReaderJSON.js";import{FeatureSetReaderPBF as u}from"../../../support/FeatureSetReaderPBF.js";class c{constructor(t,e){this.service=t,this._metadata=e}destroy(){}}function m(t,e){switch(t.type){case"memory":return new f(t,e);case"ogc":return new y(t,e);case"feature-service":return t.queryMetadata.supportsFormatPBF&&has("featurelayer-pbf")?new l(t,e):new d(t,e)}}async function p(e){const r=new t;return await r.open(e,{}),r}class f extends c{constructor(t,e){super(t,e),this._portsOpen=p(t.source).then((t=>this.client=t))}destroy(){this.client.close(),this.client=null}async executeQuery(t,e){await this._portsOpen;const r=await this.client.invoke("queryFeatures",t.toJSON(),e);return n.fromFeatureSet(r,this._metadata)}}class l extends c{async executeQuery(t,e){const{data:r}=await i(this.service.source,t,e),a=!t.quantizationParameters;return u.fromBuffer(r,this._metadata,a)}}class d extends c{async executeQuery(t,s){const{source:i,queryMetadata:u}=this.service;if(null!=t.quantizationParameters&&!u.supportsQuantization){const u=t.clone(),c=e(u.quantizationParameters);u.quantizationParameters=null;const{data:m}=await o(i,u,this._metadata.spatialReference,s),p=r(m,this._metadata.featureIdInfo);return a(c,p),n.fromOptimizedFeatureSet(p,this._metadata)}const{data:c}=await o(i,t,this._metadata.spatialReference,s);return"esriGeometryPoint"===this._metadata.geometryType&&(c.features=c.features?.filter((t=>{if(null!=t.geometry){const e=t.geometry;return Number.isFinite(e.x)&&Number.isFinite(e.y)}return!0}))),n.fromFeatureSet(c,this._metadata)}}class y extends c{async executeQuery(t,r){if(t.quantizationParameters&&!this.service.queryMetadata.supportsQuantization){const i=t.clone(),o=e(i.quantizationParameters);i.quantizationParameters=null;const u=await s(this.service.source,t,r);return a(o,u),n.fromOptimizedFeatureSet(u,this._metadata)}const i=await s(this.service.source,t,r);return n.fromOptimizedFeatureSet(i,this._metadata)}}export{c as SourceAdapter,m as createQueryAdapter};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/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;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){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};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,l=[]){return new i({geometryType:e,fieldsIndex:new t(l).toJSON(),objectIdField:n,subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null})}static createFeature(e){return new i(e)}constructor(i){this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(this._outSpatialReference=e.fromJSON(i.outSpatialReference)),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:this.objectIdField,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get objectIdField(){return this._options.objectIdField}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,globalIdField:this.globalIdField,objectIdField:this.objectIdField,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),objectIdField:"uid",geometryType:null,spatialReference:e,outSpatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
5
+ import e from"../../../../../geometry/SpatialReference.js";import t from"../../../../../layers/support/FieldsIndex.js";class i{static minimal(e,n,l=[]){return new i({geometryType:e,fieldsIndex:new t(l).toJSON(),featureIdInfo:{type:"object-id",fieldName:n},subtypes:null,subtypeField:null,types:null,globalIdField:null,spatialReference:null,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null,typeIdField:null})}static createFeature(e){return new i(e)}constructor(i){let n;this._options=i,this._fieldsIndex=t.fromJSON(i.fieldsIndex),i.spatialReference&&(this._spatialReference=e.fromJSON(i.spatialReference)),i.outSpatialReference&&(this._outSpatialReference=e.fromJSON(i.outSpatialReference)),"object-id"===i.featureIdInfo.type&&(n=i.featureIdInfo.fieldName),this._arcadeSchema={fields:this.fieldsIndex.fields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,objectIdField:n,globalIdField:this._options.globalIdField,spatialReference:this._spatialReference,timeInfo:this._options.timeInfo,typeIdField:this._options.typeIdField??void 0,types:this._options.types??void 0,subtypeField:this._options.subtypeField,subtypes:this._options.subtypes??void 0,datesInUnknownTimezone:this._options.timeReferenceUnknownClient??void 0,dateFieldsTimeZone:this._options.dateFieldsTimeZone??void 0}}get fieldsIndex(){return this._fieldsIndex}get geometryType(){return"esriGeometryMultiPatch"===this._options.geometryType?"esriGeometryPolygon":this._options.geometryType}get serviceGeometryType(){return this._options.geometryType}get subtypeField(){return this._options.subtypeField}get timeInfo(){return this._options.timeInfo}get featureIdInfo(){return this._options.featureIdInfo}get globalIdField(){return this._options.globalIdField}get arcadeSchema(){return this._arcadeSchema}get spatialReference(){return this._spatialReference}get outSpatialReference(){return this._outSpatialReference}get timeReferenceUnknownClient(){return this._options.timeReferenceUnknownClient}weakCloneWithAdditionalFields(e){return new i({fieldsIndex:{fields:[...this._fieldsIndex.fields,...e],timeZoneByFieldName:null},geometryType:this.geometryType,globalIdField:this.globalIdField,featureIdInfo:this.featureIdInfo,spatialReference:this.spatialReference,outSpatialReference:this.outSpatialReference,subtypeField:this.subtypeField,subtypes:this._options.subtypes,timeInfo:this.timeInfo,timeReferenceUnknownClient:this.timeReferenceUnknownClient,dateFieldsTimeZone:this._options.dateFieldsTimeZone,typeIdField:this._options.typeIdField,types:this._options.types})}}class n extends i{static createGraphics(e){return new n({fieldsIndex:(new t).toJSON(),featureIdInfo:{type:"object-id",fieldName:"uid"},geometryType:null,spatialReference:e,outSpatialReference:e,globalIdField:null,subtypeField:null,subtypes:null,timeInfo:null,typeIdField:null,types:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null})}}export{i as FeatureMetadata,n as GraphicsMetadata};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{convertFromFeatures as e,convertFromFeatureSet as t,getQuantizedArea as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as s}from"../../../../../layers/graphics/OptimizedFeature.js";import i from"../../../../../layers/support/FieldsIndex.js";import{FeatureSetReader as n}from"./FeatureSetReader.js";class u extends n{static fromFeatures(t,r){const{objectIdField:s,geometryType:i}=r,n=e([],t,i,!1,!1,s);for(let e=0;e<n.length;e++)n[e].displayId=t[e].displayId;return u.fromOptimizedFeatures(n,r)}static fromFeatureSet(e,r){const s=t(e,r.objectIdField);return u.fromOptimizedFeatureSet(s,r)}static fromOptimizedFeatureSet(e,t){const r=u.fromOptimizedFeatures(e.features,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new i(e.fields),r}static fromOptimizedFeatures(e,t,r){const s=new u(e,t);return s._fieldsIndex=t.fieldsIndex,s._transform=r,s}static empty(e){return new u([],e)}constructor(e,t){super(t),this._exceededTransferLimit=!1,this._featureIndex=-1,this._fieldsIndex=null,this._geometryType=t.geometryType,this._features=e}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new u(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readGeometryArea(){return s(this._current)?r(this._current.geometry,2):0}_readX(){return s(this._current)?this._current.geometry.coords[0]:0}_readY(){return s(this._current)?this._current.geometry.coords[1]:0}_readGeometry(){return s(this._current)?this._current.geometry??null:null}_readServerCentroid(){return this._current.centroid}_readAttribute(e,t){if(!this._fieldsIndex){const t=this._current.attributes[e];if(void 0!==t)return t;const r=e.toLowerCase();for(const e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e];return}const r=this._fieldsIndex.get(e);if(!r)return;const s=this._current.attributes[r.name];return null==s?s:t&&this.fields.isDateField(e)?new Date(s):s}_readAttributes(){return this._current.attributes}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._fieldsIndex=this._fieldsIndex}}export{u as FeatureSetReaderJSON};
5
+ import{convertFromFeatures as e,convertFromFeatureSet as t,getQuantizedArea as r}from"../../../../../layers/graphics/featureConversionUtils.js";import{hasGeometry as s}from"../../../../../layers/graphics/OptimizedFeature.js";import n from"../../../../../layers/support/FieldsIndex.js";import{FeatureSetReader as i}from"./FeatureSetReader.js";class u extends i{static fromFeatures(t,r){const{geometryType:s}=r,n=e([],t,s,!1,!1,r.featureIdInfo);for(let e=0;e<n.length;e++)n[e].displayId=t[e].displayId;return u.fromOptimizedFeatures(n,r)}static fromFeatureSet(e,r){const s=t(e,r.featureIdInfo);return u.fromOptimizedFeatureSet(s,r)}static fromOptimizedFeatureSet(e,t){const r=u.fromOptimizedFeatures(e.features,t);return r._exceededTransferLimit=e.exceededTransferLimit,r._transform=e.transform,r._fieldsIndex=new n(e.fields),r}static fromOptimizedFeatures(e,t,r){const s=new u(e,t);return s._fieldsIndex=t.fieldsIndex,s._transform=r,s}static empty(e){return new u([],e)}constructor(e,t){super(t),this._exceededTransferLimit=!1,this._featureIndex=-1,this._fieldsIndex=null,this._geometryType=t.geometryType,this._features=e}get fields(){return this._fieldsIndex}get geometryType(){return this._geometryType}get hasFeatures(){return!!this._features.length}get hasNext(){return this._featureIndex+1<this._features.length}get exceededTransferLimit(){return this._exceededTransferLimit}get hasZ(){return!1}get hasM(){return!1}get _current(){return this._features[this._featureIndex]}get usedMemory(){return this._current.usedMemory}getSize(){return this._features.length}getCursor(){return this.copy()}getInTransform(){return this._transform}getAttributeHash(){let e="";for(const t in this._current.attributes)e+=this._current.attributes[t];return e}getIndex(){return this._featureIndex}setIndex(e){this._featureIndex=e}getObjectId(){return this._current?.objectId}getDisplayId(){return this._current.displayId}setDisplayId(e){this._current.displayId=e}copy(){const e=new u(this._features,this.metadata);return this.copyInto(e),e}next(){for(;++this._featureIndex<this._features.length&&!this._getExists(););return this._featureIndex<this._features.length}readGeometryArea(){return s(this._current)?r(this._current.geometry,2):0}_readX(){return s(this._current)?this._current.geometry.coords[0]:0}_readY(){return s(this._current)?this._current.geometry.coords[1]:0}_readGeometry(){return s(this._current)?this._current.geometry??null:null}_readServerCentroid(){return this._current.centroid}_readAttribute(e,t){if(!this._fieldsIndex){const t=this._current.attributes[e];if(void 0!==t)return t;const r=e.toLowerCase();for(const e in this._current.attributes)if(e.toLowerCase()===r)return this._current.attributes[e];return}const r=this._fieldsIndex.get(e);if(!r)return;const s=this._current.attributes[r.name];return null==s?s:t&&this.fields.isDateField(e)?new Date(s):s}_readAttributes(){return this._current.attributes}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._transform=this._transform,e._fieldsIndex=this._fieldsIndex}}export{u as FeatureSetReaderJSON};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=!0,u=268435455,c=128,l=128e3,g={small:{delta:new Int32Array(c),decoded:new Int32Array(c)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(l),decoded:new Int32Array(l)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function _(e,t){return t?e<=g.small64.delta.length?g.small64:(e<=g.large64.delta.length||(g.large64.delta=new Float64Array(Math.round(1.25*e)),g.large64.decoded=new Float64Array(Math.round(1.25*e))),g.large64):e<=g.small.delta.length?g.small:(e<=g.large.delta.length||(g.large.delta=new Int32Array(Math.round(1.25*e)),g.large.decoded=new Int32Array(Math.round(1.25*e))),g.large)}function f(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return I(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function I(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n,a){return.5*Math.abs(e*s+r*a+n*t-e*a-r*t-n*s)}function p(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class x extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=f(e),a=o(n,"esriGeometryPoint"===s,r);return new x(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){return this._readAttributeAtIndex(this._header.objectIdFieldIndex)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new x(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===u?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===u)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=_(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],u=[];let c=0,l=0,g=null,f=0;const I="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,x=I||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),c+=e}g=_(2*c,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(g);for(const t of o)if(l+e*t>g.length)for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();else if(I&&d){const e=this.getAreaSimplificationThreshold(t,this._header.vertexCount);let r=2,s=1;const a=!1;let i=n.getSInt64(),h=n.getSInt64();g[l++]=i,g[l++]=h,this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();let o=n.getSInt64(),d=n.getSInt64();for(this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();r<t;){let t=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();const u=i+o,c=h+d;m(i,h,u,c,u+t,c+a)>=e?(f+=-.5*(u-i)*(c+h),s>1&&p(x,g[l-2],g[l-1],o,d)?(g[l-2]+=o,g[l-1]+=d):(g[l++]=o,g[l++]=d,s++),i=u,h=c):(t+=o,a+=d),o=t,d=a,r++}s<3||a?l-=2*s:(f+=-.5*(i+o-i)*(h+d+h),p(x,g[l-2],g[l-1],o,d)?(g[l-2]+=o,g[l-1]+=d,u.push(s)):(g[l++]=o,g[l++]=d,u.push(++s)))}else{let e=0,r=n.getSInt64(),s=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),g[l++]=r,g[l++]=s,e+=1;for(let a=1;a<t;a++){const t=n.getSInt64(),i=n.getSInt64(),h=r+t,o=s+i;f+=-.5*(h-r)*(o+s),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),a>2&&p(x,g[l-2],g[l-1],t,i)?(g[l-2]+=t,g[l-1]+=i):(g[l++]=t,g[l++]=i,e+=1),r=h,s=o}u.push(e)}break}default:n.skip()}return this._cache.area=f,u.length?new a(u,g):null!=g?this._createDeltaQuantizedExtrudedGeometry(g[0],g[1]):null}}export{x as FeatureSetReaderPBF};
5
+ import e from"../../../../../core/Error.js";import"../../../../../core/has.js";import t from"../../../../../core/Logger.js";import{assertIsSome as r}from"../../../../../core/maybe.js";import{baseObjectMemory as s}from"../../../../../core/memoryEstimations.js";import n from"../../../../../core/pbf.js";import a from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetCache as i}from"./FeatureSetCache.js";import{FeatureSetReader as h}from"./FeatureSetReader.js";import{parseHeader as o}from"./FeatureSetReaderPBFHeader.js";const d=!0,u=268435455,c=128,l=128e3,g={small:{delta:new Int32Array(c),decoded:new Int32Array(c)},small64:{delta:new Float64Array(0),decoded:new Float64Array(0)},large:{delta:new Int32Array(l),decoded:new Int32Array(l)},large64:{delta:new Float64Array(0),decoded:new Float64Array(0)}};function _(e,t){return t?e<=g.small64.delta.length?g.small64:(e<=g.large64.delta.length||(g.large64.delta=new Float64Array(Math.round(1.25*e)),g.large64.decoded=new Float64Array(Math.round(1.25*e))),g.large64):e<=g.small.delta.length?g.small:(e<=g.large.delta.length||(g.large.delta=new Int32Array(Math.round(1.25*e)),g.large.decoded=new Int32Array(Math.round(1.25*e))),g.large)}function f(r){try{const e=2,t=new n(new Uint8Array(r),new DataView(r));for(;t.next();){if(t.tag()===e)return I(t.getMessage());t.skip()}}catch(s){const r=new e("query:parsing-pbf","Error while parsing FeatureSet PBF payload",{error:s});t.getLogger("esri.view.2d.layers.features.support.FeatureSetReaderPBF").error(r)}return null}function I(e){const t=1;for(;e.next();){if(e.tag()===t)return e.getMessage();e.skip()}return null}function y(e){const t=1,r=2,s=3,n=4,a=5,i=6,h=7,o=8,d=9,u=e.getLength(),c=e.pos()+u;for(;e.pos()<c&&e.next();)switch(e.tag()){case t:return e.getString();case r:return e.getFloat();case s:return e.getDouble();case n:return e.getSInt32();case a:return e.getUInt32();case i:return e.getInt64();case h:return e.getUInt64();case o:return e.getSInt64();case d:return e.getBool();default:return e.skip(),null}return null}function m(e,t,r,s,n,a){return.5*Math.abs(e*s+r*a+n*t-e*a-r*t-n*s)}function p(e,t,r,s,n){if(!e)return!1;return 0===t*n-s*r&&t*s+r*n>0}class x extends h{static fromBuffer(e,t,r=!1){const s=t.geometryType,n=f(e),a=o(n,"esriGeometryPoint"===s,t.featureIdInfo,r);return new x(n,a,t,r)}constructor(e,t,r,s){super(r),this._use64Bit=s,this._hasNext=!1,this._isPoints=!1,this._featureIndex=-1,this._featureOffset=0,this._cache={area:0,unquantGeometry:void 0,geometry:void 0},this._parseCaches=new Array,this._geometryType=r.geometryType,this._reader=e,this._header=t,this._hasNext=t.hasFeatures,this._isPoints="esriGeometryPoint"===r.geometryType}get _size(){return this._header.featureCount}get fields(){return this._header.fields}get geometryType(){return this._geometryType}get hasZ(){return!1}get hasM(){return!1}get hasFeatures(){return this._header.hasFeatures}get hasNext(){return this._hasNext}get exceededTransferLimit(){return this._header.exceededTransferLimit}getSize(){return this._size}getInTransform(){return this._header.transform}getCursor(){return this.copy()}getIndex(){return this._featureIndex}setIndex(e){this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0,this._featureIndex=e}getAttributeHash(){let e="";for(const t of this._header.fields.fields)e+=this._readAttributeAtIndex(t.index)+".";return e}getObjectId(){if(1===this._header.idFieldIndices.length)return this._readAttributeAtIndex(this._header.idFieldIndices[0]);const e=this._header.idFieldIndices.map((e=>this._readAttributeAtIndex(e)));return JSON.stringify(e)}getDisplayId(){return this._header.displayIds[this._featureIndex]}setDisplayId(e){this._header.displayIds[this._featureIndex]=e}readGeometryArea(){return this._cache.area||this._readGeometry(!0),this._cache.area}copy(){const e=this._reader.clone(),t=new x(e,this._header,this.metadata,this._use64Bit);return this.copyInto(t),t}next(){for(this._cache.area=0,this._cache.unquantGeometry=void 0,this._cache.geometry=void 0;++this._featureIndex<this._size&&!this._getExists(););return this._featureIndex<this._size}get usedMemory(){return s+(this._cache.geometry?.usedMemory??0)}_readX(){return this._header.centroid[2*this._featureIndex]}_readY(){return this._header.centroid[2*this._featureIndex+1]}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];return e===u?null:new a([],[e,t])}_readGeometry(e=!1){if(void 0===this._cache.geometry){let r=null;if(this._isPoints){if(this._header.centroid[2*this._featureIndex]===u)return null;const e=this._header.centroid[2*this._featureIndex],t=this._header.centroid[2*this._featureIndex+1];r=new a([],[e,t])}else{const s=this._header.offsets.geometry[this._featureIndex],n=this._reader;if(0===s)return null;n.move(s);try{r=e?this._parseGeometryForDisplay(n):this._parseGeometry(n)}catch(t){return null}}return 0===r?.coords.length&&(r=null),this._cache.geometry=r,r}return this._cache.geometry}_readAttribute(e,t){const r=this._header.fields.get(e);if(null==r)return;const s=this._readAttributeAtIndex(r.index),n=this._header.fields.isDateField(r.name);return t?null==s?s:n?new Date(s):s:s}_readAttributes(){const e={};for(const t of this._header.fields.fields)e[t.name]=this._readAttributeAtIndex(t.index);return e}copyInto(e){super.copyInto(e),e._featureIndex=this._featureIndex,e._featureOffset=this._featureOffset,e._hasNext=this._hasNext,e._parseCaches=this._parseCaches}_readAttributeAtIndex(e){let t=this._parseCaches[e];if(t||(t=new i(this.getSize()),this._parseCaches[e]=t),t.has(this._featureIndex))return t.get(this._featureIndex);const r=this._header.offsets.attributes[this._featureIndex*this._header.fieldCount+e],s=this._reader;s.move(r);const n=y(s);return t.set(this._featureIndex,n),n}_readGeometryDeltaDecoded(e=!1){if(void 0===this._cache.unquantGeometry){const t=this._readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;if(!this.getInTransform())return this._cache.unquantGeometry=t,t;const r=_(t.coords.length,this._use64Bit).decoded,s=t.clone(r),n=s.coords;let a=0;for(const e of s.lengths){for(let t=1;t<e;t++){const e=2*(a+t),r=2*(a+t-1);n[e]+=n[r],n[e+1]+=n[r+1]}a+=e}return this._cache.unquantGeometry=s,s}return this._cache.unquantGeometry}_parseGeometry(e){const t=2,r=3,s=e.asUnsafe(),n=s.getLength(),i=s.pos()+n,h=[],o=[];for(;s.pos()<i&&s.next();)switch(s.tag()){case t:{const e=s.getUInt32(),t=s.pos()+e;for(;s.pos()<t;)o.push(s.getUInt32());break}case r:{const e=s.getUInt32(),t=s.pos()+e;for(h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();s.pos()<t;)h.push(s.getSInt64()),h.push(s.getSInt64()),this.hasZ&&s.getSInt64(),this.hasM&&s.getSInt64();break}default:s.skip()}return new a(o,h)}_parseGeometryForDisplay(e){const t=2,s=3,n=e.asUnsafe(),i=n.getLength(),h=n.pos()+i,o=[],u=[];let c=0,l=0,g=null,f=0;const I="esriGeometryPolygon"===this.geometryType,y="esriGeometryPolyline"===this.geometryType,x=I||y;for(;n.pos()<h&&n.next();)switch(n.tag()){case t:{const e=n.getUInt32(),t=n.pos()+e;for(;n.pos()<t;){const e=n.getUInt32();o.push(e),c+=e}g=_(2*c,this._use64Bit).delta;break}case s:{n.getUInt32();const e=2+(this.hasZ?1:0)+(this.hasM?1:0);r(g);for(const t of o)if(l+e*t>g.length)for(let e=0;e<t;e++)n.getSInt64(),n.getSInt64(),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();else if(I&&d){const e=this.getAreaSimplificationThreshold(t,this._header.vertexCount);let r=2,s=1;const a=!1;let i=n.getSInt64(),h=n.getSInt64();g[l++]=i,g[l++]=h,this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();let o=n.getSInt64(),d=n.getSInt64();for(this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();r<t;){let t=n.getSInt64(),a=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64();const u=i+o,c=h+d;m(i,h,u,c,u+t,c+a)>=e?(f+=-.5*(u-i)*(c+h),s>1&&p(x,g[l-2],g[l-1],o,d)?(g[l-2]+=o,g[l-1]+=d):(g[l++]=o,g[l++]=d,s++),i=u,h=c):(t+=o,a+=d),o=t,d=a,r++}s<3||a?l-=2*s:(f+=-.5*(i+o-i)*(h+d+h),p(x,g[l-2],g[l-1],o,d)?(g[l-2]+=o,g[l-1]+=d,u.push(s)):(g[l++]=o,g[l++]=d,u.push(++s)))}else{let e=0,r=n.getSInt64(),s=n.getSInt64();this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),g[l++]=r,g[l++]=s,e+=1;for(let a=1;a<t;a++){const t=n.getSInt64(),i=n.getSInt64(),h=r+t,o=s+i;f+=-.5*(h-r)*(o+s),this.hasZ&&n.getSInt64(),this.hasM&&n.getSInt64(),a>2&&p(x,g[l-2],g[l-1],t,i)?(g[l-2]+=t,g[l-1]+=i):(g[l++]=t,g[l++]=i,e+=1),r=h,s=o}u.push(e)}break}default:n.skip()}return this._cache.area=f,u.length?new a(u,g):null!=g?this._createDeltaQuantizedExtrudedGeometry(g[0],g[1]):null}}export{x as FeatureSetReaderPBF};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../../core/Error.js";import t from"../../../../../layers/support/FieldsIndex.js";import{parseField as s,parseTransform as r}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class o{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.objectIdFieldIndex=0,this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}function a(a,i,c=!1){const f=1,d=3,u=9,g=12,l=13,p=15,h=a.asUnsafe(),b=h.pos(),m=new o;let w=0,y=0;const I=1,k=2,x=4,L=3;let A=null,F=null,C=null,S=!1;const j=[];for(;h.next();)switch(h.tag()){case f:A=h.getString();break;case d:F=h.getString();break;case g:C=h.processMessage(r);break;case u:if(m.exceededTransferLimit=h.getBool(),m.exceededTransferLimit){m.offsets.geometry=c?new Float64Array(8e3):new Int32Array(8e3),m.centroid=c?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<m.centroid.length;e++)m.centroid[e]=n}break;case l:{const e=h.processMessage(s);e.index=w++,j.push(e);break}case p:{const e=h.getLength(),t=h.pos()+e;if(!m.exceededTransferLimit){const e=m.offsets.geometry,t=m.centroid;e.push(0),t.push(n),t.push(n)}!S&&m.exceededTransferLimit&&(S=!0,m.offsets.attributes=c?new Float64Array(8e3*w):new Uint32Array(8e3*w));let s=y*w;for(;h.pos()<t&&h.next();)switch(h.tag()){case I:{if(S)m.offsets.attributes[s++]=h.pos();else{m.offsets.attributes.push(h.pos())}const e=h.getLength();h.skipLen(e);break}case k:if(i){const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case L:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*y]=e,m.centroid[2*y+1]=t;break}default:h.skip()}}else{m.offsets.geometry[y]=h.pos();const e=h.getLength();m.vertexCount+=e,h.skipLen(e)}break;case x:{const e=h.getLength(),t=h.pos()+e;for(;h.pos()<t&&h.next();)switch(h.tag()){case L:{h.getUInt32();const e=h.getSInt64(),t=h.getSInt64();m.centroid[2*y]=e,m.centroid[2*y+1]=t;break}default:h.skip()}break}default:h.skip()}y++,m.hasFeatures=!0;break}default:h.skip()}const U=A||F;if(!U)throw new e("featurelayer:missing-objectId","FeatureSet has no objectId or globalId field name");return m.fields=new t(j),m.featureCount=y,m.fieldCount=w,m.objectIdFieldIndex=m.fields.get(U)?.index,m.transform=C,m.displayIds=new Uint32Array(m.featureCount),m.groupIds=new Uint16Array(m.featureCount),h.move(b),m}export{o as FeatureSetHeader,a as parseHeader};
5
+ import{getFeatureIdInfoFieldNames as e}from"../../../../../layers/graphics/data/FeatureIdInfo.js";import t from"../../../../../layers/support/FieldsIndex.js";import{parseField as s,parseTransform as r}from"../../../../../rest/query/operations/pbfFeatureServiceParser.js";const n=268435455;class o{constructor(){this.hasFeatures=!1,this.exceededTransferLimit=!1,this.fieldCount=0,this.featureCount=0,this.idFieldIndices=[],this.vertexCount=0,this.offsets={attributes:new Array,geometry:new Array},this.centroid=new Array}}function a(a,i,c,f=!1){const d=9,u=12,p=13,g=15,l=a.asUnsafe(),h=l.pos(),y=new o;let m=0,w=0;const k=1,x=2,I=4,b=3;let A=null,L=!1;const F=[];for(;l.next();)switch(l.tag()){case u:A=l.processMessage(r);break;case d:if(y.exceededTransferLimit=l.getBool(),y.exceededTransferLimit){y.offsets.geometry=f?new Float64Array(8e3):new Int32Array(8e3),y.centroid=f?new Float64Array(16e3):new Int32Array(16e3);for(let e=0;e<y.centroid.length;e++)y.centroid[e]=n}break;case p:{const e=l.processMessage(s);e.index=m++,F.push(e);break}case g:{const e=l.getLength(),t=l.pos()+e;if(!y.exceededTransferLimit){const e=y.offsets.geometry,t=y.centroid;e.push(0),t.push(n),t.push(n)}!L&&y.exceededTransferLimit&&(L=!0,y.offsets.attributes=f?new Float64Array(8e3*m):new Uint32Array(8e3*m));let s=w*m;for(;l.pos()<t&&l.next();)switch(l.tag()){case k:{if(L)y.offsets.attributes[s++]=l.pos();else{y.offsets.attributes.push(l.pos())}const e=l.getLength();l.skipLen(e);break}case x:if(i){const e=l.getLength(),t=l.pos()+e;for(;l.pos()<t&&l.next();)switch(l.tag()){case b:{l.getUInt32();const e=l.getSInt64(),t=l.getSInt64();y.centroid[2*w]=e,y.centroid[2*w+1]=t;break}default:l.skip()}}else{y.offsets.geometry[w]=l.pos();const e=l.getLength();y.vertexCount+=e,l.skipLen(e)}break;case I:{const e=l.getLength(),t=l.pos()+e;for(;l.pos()<t&&l.next();)switch(l.tag()){case b:{l.getUInt32();const e=l.getSInt64(),t=l.getSInt64();y.centroid[2*w]=e,y.centroid[2*w+1]=t;break}default:l.skip()}break}default:l.skip()}w++,y.hasFeatures=!0;break}default:l.skip()}y.fields=new t(F),y.featureCount=w,y.fieldCount=m;const C=e(c);return y.idFieldIndices=Array.from(C,(e=>y.fields.get(e)?.index)),y.transform=A,y.displayIds=new Uint32Array(y.featureCount),y.groupIds=new Uint16Array(y.featureCount),l.move(h),y}export{o as FeatureSetHeader,a as parseHeader};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetReader as r}from"./FeatureSetReader.js";class n extends r{constructor(t,r,n,s,i,d=new Uint32Array(s.size())){super(t),this._fields=r,this._geometryInfo=n,this._inner=s,this._chunkId=i,this._displayIds=d,this._index=-1,this.usedMemory=e,this._size=this._inner.size(),null!=t.objectIdField&&(this._objectIdFieldIndex=this._fields.get(t.objectIdField)?.index),this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this._geometryInfo.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return null!=this._objectIdFieldIndex?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new n(this.metadata,this._fields,this._geometryInfo,this._inner,this._chunkId,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[r,n]=e.translate,[s,i]=e.scale,d=this._inner.readGeometryTransformed(this._index,r,n,s,i);return d?new t(d.readLengthsUnsafe(),d.readCoordsUnsafe()):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r):null}_readX(){return this._readGeometry()?.coords[0]}_readY(){return this._readGeometry()?.coords[1]}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.index)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.index);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.index?this._inner.hasField(t.index)&&(e[t.name]=this._readAttribute(t.name,!1)):e.__OBJECTID=this.getObjectId();return e}}export{n as FeatureSetReaderParquet};
5
+ import"../../../../../core/has.js";import{baseObjectMemory as e}from"../../../../../core/memoryEstimations.js";import t from"../../../../../layers/graphics/OptimizedGeometry.js";import{FeatureSetReader as r}from"./FeatureSetReader.js";class n extends r{constructor(t,r,n,s,i,d=new Uint32Array(s.size())){super(t),this._fields=r,this._geometryInfo=n,this._inner=s,this._chunkId=i,this._displayIds=d,this._index=-1,this.usedMemory=e,this._size=this._inner.size();const o=t.featureIdInfo;"object-id"===o.type&&(this._objectIdFieldIndex=this._fields.get(o.fieldName)?.index),this._chunkId>65535&&console.error("Exceeded max allowed parquet reader size")}destroy(){super.destroy(),this._inner.free()}get fields(){return this._fields}get geometryType(){return this._geometryInfo.geometryType}get hasFeatures(){return!0}get hasNext(){throw new Error("Method not implemented.")}get exceededTransferLimit(){return!1}get hasZ(){return!1}get hasM(){return!1}getInTransform(){return null}getSize(){return this._size}getCursor(){return this.copy()}getAttributeHash(){let e="";for(const t of this.fields.fields)e+=this._readAttribute(t.name,!1)+".";return e}getObjectId(){return null!=this._objectIdFieldIndex?this._inner.readAttribute(this._index,this._objectIdFieldIndex):this._index<<16|this._chunkId}getDisplayId(){return this._displayIds[this._index]}setDisplayId(e){this._displayIds[this._index]=e}setIndex(e){this._index=e}getBoundsXMin(){return this._inner.boundsXMin(this._index)}getBoundsYMin(){return this._inner.boundsYMin(this._index)}getBoundsXMax(){return this._inner.boundsXMax(this._index)}getBoundsYMax(){return this._inner.boundsYMax(this._index)}setBoundsXMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMin(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsXMax(e){throw new Error("InternalError: Setting bounds is unsupported")}setBoundsYMax(e){throw new Error("InternalError: Setting bounds is unsupported")}getIndex(){return this._index}next(){for(;++this._index<this._size&&!this._getExists(););return this._index<this._size}readGeometryArea(){return this.readGeometryForDisplay()?.area()??0}copy(){const e=new n(this.metadata,this._fields,this._geometryInfo,this._inner,this._chunkId,this._displayIds);return this.copyInto(e),e}copyInto(e){super.copyInto(e),e._index=this._index}readGeometryForDisplayTransformed(e){const[r,n]=e.translate,[s,i]=e.scale,d=this._inner.readGeometryTransformed(this._index,r,n,s,i);return d?new t(d.readLengthsUnsafe(),d.readCoordsUnsafe()):null}_readGeometry(e){const r=this._inner.readCoords(this._index),n=this._inner.readLengths(this._index);return r&&n?new t(n,r):null}_readX(){return this._readGeometry()?.coords[0]}_readY(){return this._readGeometry()?.coords[1]}_readServerCentroid(){return null}_readAttribute(e,t){const r=this.fields.get(e);if(!r)return;if(null==r.index)return this.getObjectId();const n=this._inner.readAttribute(this._index,r.index);if(null==n)return n;const s=this.fields.isDateField(r.name);return t?null==n?n:s?new Date(n):n:n}_readAttributes(){const e={};for(const t of this._fields.fields)null!=t.index?this._inner.hasField(t.index)&&(e[t.name]=this._readAttribute(t.name,!1)):e.__OBJECTID=this.getObjectId();return e}}export{n as FeatureSetReaderParquet};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import s from"../../core/Collection.js";import{mapCollection as r}from"../../core/mapCollectionUtils.js";import{destroyMaybe as t}from"../../core/maybe.js";import{watch as i,syncAndInitial as n}from"../../core/reactiveUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{e as m}from"../../chunks/earcut.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as l}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as d}from"../../geometry/ellipsoidUtils.js";import f from"../../geometry/Point.js";import{e as h}from"../../chunks/densifyOperator.js";import{computeTranslationToOriginAndRotation as u}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as g}from"../../geometry/support/DoubleArray.js";import{earth as w}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as y}from"../../geometry/support/Indices.js";import{t as v}from"../../chunks/vec3.js";import{clonePoint as j}from"../../layers/graphics/hydratedFeatures.js";import{FocusAreaOutlineItem as A}from"../FocusAreaOutlineItem.js";import{ViewingMode as _}from"../ViewingMode.js";import{ElevationContext as R}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as C}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as N}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as b}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as x}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as P,FocusAreaMaskNode as k}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";const H=-2e4,F=65e5;let G=class extends o{constructor(e){super(e),this.style="dark",this.geometries=new Array,this._elevationContext=new R,this._outlineMap=new s}initialize(){this.addHandles([i((()=>this.view.focusAreas.style),(()=>this._updateRenderNodes()),n)]),this.addHandles([i((()=>this.view.focusAreas.activePolygons),(()=>this._updateFocusAreaGeometries()),n)]),this._outlineMap=r((()=>this.view.focusAreas.areas),(e=>new A({area:e,view:this.view})),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.forEach((e=>e.destroy()))}containsGeometry(e){if(0===this.view.focusAreas.activePolygons.length)return!0;let o;return o=e instanceof f?j(e,new f):new f(e),this.view.focusAreas.activePolygons.some((e=>e.contains(o)))}async _updateFocusAreaGeometries(){this._extrudePolygons(),this._updateRenderNodes()}_extrudePolygons(){if(!this.view.renderCoordsHelper)return;this.geometries.length=0;const e=F-H,o=l(),s=this.view.renderCoordsHelper.viewingMode===_.Global,r=p(),t=p();s||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],o);for(const i of this.view.focusAreas.areas)if(i.enabled)for(const n of i.geometries){const i=N(n);if(null==i)continue;const a=h(n,d(this.view.spatialReference).radius/w.radius*5e5,{unit:"meters"});u(a.spatialReference,[i.x,i.y,0],r,this.view.renderCoordsHelper.spatialReference);const c=this.view.renderCoordsHelper.worldUpAtPosition([r[12],r[13],r[14]],U);t[12]=-r[12],t[13]=-r[13],t[14]=-r[14];const p=b(a,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:l,mapPositions:f,position:j}=p;for(const n of l){const i=n.count,a=m(n.mapPositions,n.holeIndices,3);if(0===a.length)continue;const p=a.length,l=6*i,d=y(l+p),h=y(p),u=g(3*l),w=g(3*l),A=g(3*l),_=g(l);C(j,f,a,n,u,A,w,_,d,h,e,o,s),v(u,u,t);const R=new P(u,h,d,e,[r[12]+H*c[0],r[13]+H*c[1],r[14]+H*c[2]]);this.geometries.push(R)}}this._maskRenderNode?.updateGeometries()}_updateRenderNodes(){this.view.stage&&("none"===this.view.focusAreas.style||0===this.geometries.length?(this._maskRenderNode=t(this._maskRenderNode),this._colorRenderNode=t(this._colorRenderNode)):(this.style=this.view.focusAreas.style,this._maskRenderNode??=new k({focusAreasView:this}),this._colorRenderNode??=new x({focusAreasView:this})))}};e([a()],G.prototype,"geometries",void 0),e([a({constructOnly:!0})],G.prototype,"view",void 0),G=e([c("esri.views.3d.FocusAreasView")],G);const U=l();export{G as FocusAreasView};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import o from"../../core/Accessor.js";import{equals as s}from"../../core/arrayUtils.js";import r from"../../core/Collection.js";import{mapCollection as t}from"../../core/mapCollectionUtils.js";import{destroyMaybe as i}from"../../core/maybe.js";import{watch as n,syncAndInitial as a}from"../../core/reactiveUtils.js";import{property as l}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{e as c}from"../../chunks/earcut.js";import{create as p}from"../../core/libs/gl-matrix-2/factories/mat4f64.js";import{create as d}from"../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as u}from"../../geometry/ellipsoidUtils.js";import h from"../../geometry/Point.js";import{e as f}from"../../chunks/densifyOperator.js";import{computeTranslationToOriginAndRotation as y}from"../../geometry/projection/computeTranslationToOriginAndRotation.js";import{newDoubleArray as g}from"../../geometry/support/DoubleArray.js";import{earth as v}from"../../geometry/support/Ellipsoid.js";import{newIndexArray as w}from"../../geometry/support/Indices.js";import{t as j}from"../../chunks/vec3.js";import{FocusAreaOutlineItem as _}from"../FocusAreaOutlineItem.js";import{ViewingMode as A}from"../ViewingMode.js";import{ElevationContext as R}from"./layers/graphics/ElevationContext.js";import{extrudePolygon as b}from"./layers/graphics/Graphics3DExtrudeSymbolLayer.js";import{computeCentroid as C}from"./layers/graphics/graphicUtils.js";import{geometryToRenderInfo as N}from"./support/renderInfoUtils/polygon.js";import{FocusAreaColorNode as x}from"./webgl-engine/effects/focusArea/FocusAreaColorNode.js";import{FocusAreaGeometry as k,FocusAreaMaskNode as H}from"./webgl-engine/effects/focusArea/FocusAreaMaskNode.js";const M=-2e4,U=65e5;let P=class extends o{constructor(e){super(e),this._volumes=new Map,this._elevationContext=new R,this._outlineMap=new r}initialize(){this.addHandles([n((()=>this.areas?.style??"none"),(e=>this._ensureRenderNodes(e)),a)]),this.addHandles([n((()=>this.polygons),(e=>this._updateVolumes(e)),a)]),this._outlineMap=t((()=>this.areas?.areas),(e=>new _({area:e,view:this.view})),{recycleItems:!0})}destroy(){this.removeAllHandles(),this._outlineMap.forEach((e=>e.destroy()))}get areas(){return this.view.map?.focusAreas}get enabledAreas(){return this.areas?.areas.toArray().filter((({enabled:e})=>e))??[]}get style(){return this.areas?.style??"none"}get polygons(){return this.enabledAreas.reduce(((e,o)=>e.concat(o.geometries.toArray())),new Array)}containsGeometry(e){if(0===this.polygons.length)return!0;const o=new h(e);return this.polygons.some((e=>e.contains(o)))}_updateVolumes(e){this._extrude(e),this._ensureRenderNodes(this.style)}_extrude(e){if(!this.view.renderCoordsHelper||s(Array.from(this._volumes.keys()),e))return;const o=U-M,r=d(),t=this.view.renderCoordsHelper.viewingMode===A.Global,i=p(),n=p();t||this.view.renderCoordsHelper.worldUpAtPosition([0,0,0],r);const a=new Map;for(const s of e){const e=this._volumes.get(s);if(e){a.set(s,e);continue}const l=C(s);if(null==l)continue;const m=f(s,u(this.view.spatialReference).radius/v.radius*5e5,{unit:"meters"});y(m.spatialReference,[l.x,l.y,0],i,this.view.renderCoordsHelper.spatialReference);const p=this.view.renderCoordsHelper.worldUpAtPosition([i[12],i[13],i[14]],V);n[12]=-i[12],n[13]=-i[13],n[14]=-i[14];const d=N(m,this.view.elevationProvider,this.view.renderCoordsHelper,this._elevationContext),{polygons:h,mapPositions:_,position:A}=d;for(const u of h){const e=u.count,l=c(u.mapPositions,u.holeIndices,3);if(0===l.length)continue;const m=l.length,d=6*e,h=w(d+m),f=w(m),y=g(3*d);b(A,_,l,u,y,null,null,null,h,f,o,r,t),j(y,y,n);const v=new k(y,f,h,o,[i[12]+M*p[0],i[13]+M*p[1],i[14]+M*p[2]]);a.set(s,v)}}this._volumes=a,this._maskRenderNode?.updateGeometries()}_ensureRenderNodes(e){this.view.stage&&("none"===e||0===this.volumes.size?(this._maskRenderNode=i(this._maskRenderNode),this._colorRenderNode=i(this._colorRenderNode)):(this._maskRenderNode??=new H({focusAreasView:this}),this._colorRenderNode??=new x({focusAreasView:this})))}get volumes(){return this._volumes}};e([l()],P.prototype,"_volumes",void 0),e([l({constructOnly:!0})],P.prototype,"view",void 0),P=e([m("esri.views.3d.FocusAreasView")],P);const V=d();export{P as FocusAreasView};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/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 t}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import a from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{removeMaybe as r,destroyMaybe as l,abortMaybe as c}from"../../../core/maybe.js";import{createAbortError as d,isAborted as h,onAbort as w,createResolver as u}from"../../../core/promiseUtils.js";import{schedule as m}from"../../../core/scheduling.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../../core/accessorSupport/decorators/subclass.js";const p="analyses-owner-handles";var V,A;!function(e){e[e.PENDING=0]="PENDING",e[e.CREATED=1]="CREATED"}(V||(V={})),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 i,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}}}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),p)}_disconnectOwners(){this.removeHandles(p),this._update(),this._creatingViewCount=0}_connectAnalysesCollection(e){for(const i of e)this._addAnalysis(i);const s=e.on("after-add",(e=>this._addAnalysis(e.item))),t=e.on("after-remove",(e=>this._removeAnalysis(e.item)));return n((()=>{s.remove(),t.remove();for(const s of e)this._removeAnalysis(s)}))}_addAnalysis(e){const s=this._items.get(e);if(null==s){const s={state:{view:V.PENDING,list:A.ADDED},analysis:e,view:null,createAnalysisViewTask:null};this._items.set(e,s),s.createAnalysisViewTask=t((e=>this._createAnalysisViewPromise(s,e)))}else s.state.list=A.ADDED}_removeAnalysis(e){const s=this._items.get(e);null!=s?(s.state.list=A.REMOVED,this._scheduleUpdate()):o.getLogger(this).error("Trying to remove analysis which was not added")}_scheduleUpdate(){null==this._scheduledUpdateHandle&&(this._scheduledUpdateHandle=m((()=>this._update())))}_update(){this._scheduledUpdateHandle=r(this._scheduledUpdateHandle),this._items.forEach((e=>{if(e.state.list===A.REMOVED)switch(this._items.delete(e.analysis),e.state.view){case V.PENDING:e.createAnalysisViewTask=c(e.createAnalysisViewTask);break;case V.CREATED:null!=e.view&&(this._allAnalysisViews.remove(e.view),e.view=l(e.view),e.createAnalysisViewTask=null)}}))}async _createAnalysisViewPromise(e,s){const t=e.analysis,i=t.type,a=this._analysisModules[i];if(this._creatingViewCount+=1,null==a.module)try{a.module=await this._loadAnalysisModule(i)}catch(r){throw this._creatingViewCount-=1,r}if(h(s))throw this._creatingViewCount-=1,d("AnalysisView creation aborted");const n=new a.module.default({analysis:t,view:this.view});let o=!0;w(s,(()=>{o&&(this._creatingViewCount-=1,n.destroy())}));try{await n.when()}catch(r){throw o=!1,n.destroyed||(this._creatingViewCount-=1,n.destroy()),r}if(h(s))throw d();return o=!1,e.view=n,e.state.view=V.CREATED,this._allAnalysisViews.add(n),this._creatingViewCount-=1,n}_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=u();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};
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};
@@ -0,0 +1,4 @@
1
+ import "../../../interfaces";
2
+
3
+ import DimensionAnalysisView3D = __esri.DimensionAnalysisView3D;
4
+ export default DimensionAnalysisView3D;
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as i}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{destroyHandle as s}from"../../../core/handleUtils.js";import"../../../core/has.js";import o from"../../../core/Logger.js";import{mapCollection as e}from"../../../core/mapCollectionUtils.js";import{abortMaybe as n,destroyMaybe as r}from"../../../core/maybe.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as p}from"./AnalysisView3D.js";import{DimensionController as m}from"./Dimension/DimensionController.js";import{DimensionTool as u}from"./Dimension/DimensionTool.js";import{DimensionVisualization as c}from"./Dimension/DimensionVisualization.js";import{LengthDimensionComputation as d}from"./Dimension/LengthDimensionComputation.js";import{applyProjectionAndElevationAlignment as h,logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{connectAnalysisViewToTool as j,removeAnalysisViewTool as D,startExclusiveInteractiveOperation as g}from"../../analysis/analysisViewUtils.js";import v from"../../analysis/DimensionAnalysisView.js";let f=class extends(v(p(t))){constructor(i){super(i),this.type="dimension-view-3d",this.tool=null,this.selectedDimension=null,this.userOperation=null,this._dimensionsToComputations=new Map,this._projectAndAlignPoint=null}initialize(){this._projectAndAlignPoint=i=>{if(null==i)return null;const{spatialReference:t,elevationProvider:s}=this.view,e=h(i,t,s);return null==e&&y(this.analysis,i.spatialReference,o.getLogger(this)),e};const i=e((()=>this.analysis.dimensions),(i=>this._createComputation(i)));this.computations=i,this.addHandles([j(this,u),s(i)]),this._analysisVisualization=new c({analysisViewData:this,view:this.view,isDecoration:!this.parent}),this._analysisController=new m({analysisViewData:this,view:this.view})}destroy(){this.userOperation=n(this.userOperation),D(this),this._analysisVisualization=r(this._analysisVisualization)}get updating(){return this._analysisVisualization?.loadingMessages??!1}get results(){return this.analysis.dimensions.map((i=>this._dimensionsToComputations.get(i).result))}get selectedComputation(){const{selectedDimension:i}=this;return null==i?null:this._dimensionsToComputations.get(i)}get testInfo(){}async createLengthDimensions(i){return this.selectedDimension=null,g(this,{abortOptions:i,onToolActivated:i=>i.place("multiple")})}async place(i){return this.selectedDimension=null,g(this,{abortOptions:i,onToolActivated:i=>i.place("single")})}_createComputation(i){const{_dimensionsToComputations:t}=this,s=new d({dimension:i,projectAndAlignPoint:this._projectAndAlignPoint});return t.set(i,s),{computation:s,remove:()=>this._removeComputation(s)}}_removeComputation(i){const{dimension:t}=i;t===this.selectedDimension&&(this.selectedDimension=null),this._dimensionsToComputations.delete(t),i.destroy()}};i([a({readOnly:!0})],f.prototype,"type",void 0),i([a()],f.prototype,"tool",void 0),i([a()],f.prototype,"updating",null),i([a({readOnly:!0})],f.prototype,"results",null),i([a()],f.prototype,"computations",void 0),i([a()],f.prototype,"selectedDimension",void 0),i([a()],f.prototype,"selectedComputation",null),i([a()],f.prototype,"userOperation",void 0),i([a()],f.prototype,"_analysisVisualization",void 0),i([a()],f.prototype,"_analysisController",void 0),i([a()],f.prototype,"_dimensionsToComputations",void 0),f=i([l("esri.views.3d.analysis.DimensionAnalysisView3D")],f);const _=f;export{_ as default};
5
+ import{_ as i}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import{destroyHandle as o}from"../../../core/handleUtils.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{mapCollection as e}from"../../../core/mapCollectionUtils.js";import{abortMaybe as n,destroyMaybe as r}from"../../../core/maybe.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{AnalysisView3D as p}from"./AnalysisView3D.js";import{DimensionController as m}from"./Dimension/DimensionController.js";import{DimensionTool as u}from"./Dimension/DimensionTool.js";import{DimensionVisualization as c}from"./Dimension/DimensionVisualization.js";import{LengthDimensionComputation as d}from"./Dimension/LengthDimensionComputation.js";import{applyProjectionAndElevationAlignment as h,logFailedGeometryProjectionError as y}from"./support/projectionUtils.js";import{connectAnalysisViewToTool as v,removeAnalysisViewTool as g,startExclusiveInteractiveOperation as j}from"../../analysis/analysisViewUtils.js";let D=class extends(p(t)){constructor(i){super(i),this.type="dimension-view-3d",this.analysis=null,this.tool=null,this.selectedDimension=null,this.userOperation=null,this._dimensionsToComputations=new Map,this._projectAndAlignPoint=null}initialize(){this._projectAndAlignPoint=i=>{if(null==i)return null;const{spatialReference:t,elevationProvider:o}=this.view,e=h(i,t,o);return null==e&&y(this.analysis,i.spatialReference,s.getLogger(this)),e};const i=e((()=>this.analysis.dimensions),(i=>this._createComputation(i)));this.computations=i,this.addHandles([v(this,u),o(i)]),this._analysisVisualization=new c({analysisViewData:this,view:this.view,isDecoration:!this.parent}),this._analysisController=new m({analysisViewData:this,view:this.view})}destroy(){this.userOperation=n(this.userOperation),g(this),this._analysisVisualization=r(this._analysisVisualization)}get updating(){return this._analysisVisualization?.loadingMessages??!1}get results(){return this.analysis.dimensions.map((i=>this._dimensionsToComputations.get(i).result))}get selectedComputation(){const{selectedDimension:i}=this;return null==i?null:this._dimensionsToComputations.get(i)}get testInfo(){}async createLengthDimensions(i){return this.selectedDimension=null,j(this,{abortOptions:i,onToolActivated:i=>i.place("multiple")})}async place(i){return this.selectedDimension=null,j(this,{abortOptions:i,onToolActivated:i=>i.place("single")})}_createComputation(i){const{_dimensionsToComputations:t}=this,o=new d({dimension:i,projectAndAlignPoint:this._projectAndAlignPoint});return t.set(i,o),{computation:o,remove:()=>this._removeComputation(o)}}_removeComputation(i){const{dimension:t}=i;t===this.selectedDimension&&(this.selectedDimension=null),this._dimensionsToComputations.delete(t),i.destroy()}};i([a({readOnly:!0})],D.prototype,"type",void 0),i([a({constructOnly:!0,nonNullable:!0})],D.prototype,"analysis",void 0),i([a()],D.prototype,"tool",void 0),i([a()],D.prototype,"updating",null),i([a({readOnly:!0})],D.prototype,"results",null),i([a()],D.prototype,"computations",void 0),i([a()],D.prototype,"selectedDimension",void 0),i([a()],D.prototype,"selectedComputation",null),i([a()],D.prototype,"userOperation",void 0),i([a()],D.prototype,"_analysisVisualization",void 0),i([a()],D.prototype,"_analysisController",void 0),i([a()],D.prototype,"_dimensionsToComputations",void 0),D=i([l("esri.views.3d.analysis.DimensionAnalysisView3D")],D);const _=D;export{_ 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.33/esri/copyright.txt for details.
4
4
  */
5
- import{c as n,g as a,e as m}from"../../../../chunks/vec32.js";import{ConstraintOptions as t}from"./ConstraintOptions.js";import{ConstraintTypes as i}from"./ConstraintTypes.js";function o(n,a){return!!(n&a)}function r(n,a,m,t,i,o){0!==n&&(m?(o.min=Math.min(o.min,a),o.max=Math.max(o.max,a)):null!=t?(o.min-=Math.max(0,(a-o.min)*(1-t)),o.max+=Math.max(0,(a-o.max)*(1-t))):i&&(o.min-=Math.max(0,a-o.min-i),o.max+=Math.max(0,a-o.max-i)))}const s=new t(i.NONE);function x(t,i,o,r){return i=i||t.viewForward,n(r,i),a(r,r,Math.sign(m(i,o))),r}export{r as adjustRangeForInteraction,s as defaultConstraintOptions,o as hasConstraintType,x as interactionDirectionTowardsConstraintMinimization};
5
+ import{c as n,g as a,e as m}from"../../../../chunks/vec32.js";import{ConstraintOptions as t}from"./ConstraintOptions.js";import{ConstraintTypes as i}from"./ConstraintTypes.js";function o(n,a){return 0!==(n&a)}function r(n,a,m,t,i,o){0!==n&&(m?(o.min=Math.min(o.min,a),o.max=Math.max(o.max,a)):null!=t?(o.min-=Math.max(0,(a-o.min)*(1-t)),o.max+=Math.max(0,(a-o.max)*(1-t))):i&&(o.min-=Math.max(0,a-o.min-i),o.max+=Math.max(0,a-o.max-i)))}const s=new t(i.NONE);function x(t,i,o,r){return i=i||t.viewForward,n(r,i),a(r,r,Math.sign(m(i,o))),r}export{r as adjustRangeForInteraction,s as defaultConstraintOptions,o as hasConstraintType,x as interactionDirectionTowardsConstraintMinimization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as n,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as p,o as b,t as v,g as y,c as j,s as L,i as S,d as w}from"../../../chunks/vec32.js";import{create as O,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projection.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{distance2 as C,fromPoints as x,create as M,closestRayDistance2 as k}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as I,create as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as N}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as Y}from"../support/geometryUtils/ray.js";import J from"../webgl/RenderCamera.js";import{Object3D as K}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as Q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as Z,ManipulatorStateFlags as $}from"../../interactive/interfaces.js";class ee{constructor(e){this.metadata=void 0,this._camera=new J,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=Z.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),n=o*this.screenLocation.pixelSize,a=Y(this._camera,s,re);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=k(x(e,o,oe),a);if(null!=l&&l<n*n){const t=p(N.get(),e,o);y(t,t,.5);const i=c(N.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??R,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=Y(this._camera,s,re);if(null==c)return null;const h=l(ne,n),d=b(ue,e,h),_=v(ge,t,n);I(_,d,le);const u=_e;if(W(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=Y(this._camera,s,re);if(null==h)return null;const d=l(ne,n),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);I(u,_,le);const g=_e;if(!W(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],n);for(let t=1;t<s.length;t++){const i=v(de,s[t],n),o=C(x(e,i,oe),g);if(null!=o&&o<a*a){const t=p(N.get(),e,i);y(t,t,.5);const s=c(N.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:Q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,fe,e.spatialReference)&&P(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?$.Focused:$.Unfocused)|(this.selected?$.Selected:$.Unselected),o=this._noDisplayCount>0;for(const{stateMask:r,objects:n}of i){if(o){for(const e of n)e.visible=!1;continue}const e=(r&$.All)!==$.None,i=(r&Z.All)!==Z.None,a=!e||(s&r)==(r&$.All),c=!i||(this.state&r)==(r&Z.All);if(a&&c)for(const s of n)s.visible=!0,s.transformation=t;else for(const t of n)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new K({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:e})=>i.addMany(e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:e})=>i.removeMany(e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return w(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,he,0,o.radius),F(s(he[0]),s(he[1]),i),!0}}}const se=n(),oe=M(),re=B(),ne=h(),ae=m(),ce=m(),le=U(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=O(),fe=new A({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
5
+ import{neverReached as e}from"../../../core/compilerUtils.js";import t from"../../../core/Evented.js";import{makeHandle as i}from"../../../core/handleUtils.js";import"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{createRenderScreenPointArray3 as r,createScreenPointArray as n,screenPointObjectToArray as a,castRenderScreenPointArray as c}from"../../../core/screenUtils.js";import{fromMat4 as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{copy as d,set as _,multiply as u,identity as g}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{create as m}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{squaredDistance as f}from"../../../core/libs/gl-matrix-2/math/vec2.js";import{f as p,o as b,t as v,g as y,c as j,s as L,i as S,d as w}from"../../../chunks/vec32.js";import{create as O,ZEROS as R}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getReferenceEllipsoid as T}from"../../../geometry/ellipsoidUtils.js";import A from"../../../geometry/Point.js";import{canProjectWithoutEngine as E,projectPoint as D}from"../../../geometry/projection.js";import{computeENUToPCPFLocalRotation as F}from"../../../geometry/projection/localRotationUtils.js";import{sphericalPCPFtoLonLatElevation as z}from"../../../geometry/projection/projectors.js";import{containsPointObject as P}from"../../../geometry/support/aaBoundingRect.js";import{distance2 as C,fromPoints as x,create as M,closestRayDistance2 as k}from"../../../geometry/support/lineSegment.js";import{fromPositionAndNormal as I,create as U,intersectRay as W}from"../../../geometry/support/plane.js";import{create as B}from"../../../geometry/support/ray.js";import{sv3d as N}from"../../../geometry/support/vectorStacks.js";import{clonePoint as H,hydratedSpatialReference as q}from"../../../layers/graphics/hydratedFeatures.js";import{getElevationOffset as G}from"../../../support/elevationInfoUtils.js";import{getElevationAtPoint as V}from"../support/ElevationProvider.js";import{fromScreen as Y}from"../support/geometryUtils/ray.js";import J from"../webgl/RenderCamera.js";import{Object3D as K}from"../webgl-engine/lib/Object3D.js";import{UpdatePolicy as Q}from"../webgl-engine/lib/UpdatePolicy.js";import{WebGLLayer as X}from"../webgl-engine/lib/WebGLLayer.js";import{ManipulatorStateCustomFlags as Z,ManipulatorStateFlags as $}from"../../interactive/interfaces.js";class ee{constructor(e){this.metadata=void 0,this._camera=new J,this._elevation={offset:0,override:null},this.collisionType={type:"point"},this.collisionPriority=0,this._renderObjects=new Array,this.autoScaleRenderObjects=!0,this._available=!0,this._noDisplayCount=0,this._radius=10,this._worldSized=!1,this.focusMultiplier=2,this.touchMultiplier=2.5,this.worldOriented=!1,this._modelTransform=m(),this._worldFrame=null,this._renderLocation=O(),this._renderLocationDirty=!0,this._location=new A({x:0,y:0,z:0}),this._elevationAlignedLocation=new A,this._elevationAlignedLocationDirty=!0,this.interactive=!0,this.selectable=!1,this.grabbable=!0,this.consumesClicks=!0,this.cursor=null,this.grabCursor=null,this._grabbing=!1,this.dragging=!1,this._hovering=!1,this._selected=!1,this._state=Z.None,this._focused=!1,this.events=new t.EventEmitter,this._screenLocation={screenPointArray:n(),renderScreenPointArray:r(),pixelSize:0},this._screenLocationDirty=!0,this._engineResourcesAddedToStage=!1,this._attached=!1,this._location.spatialReference=e.view.spatialReference,Object.assign(this,e);const i=this.view.state?.camera;i&&this._camera.copyFrom(i)}destroy(){this._applyObjectTransform=pe,this._removeResourcesFromStage(),this._engineResources=null,this.view=null,this._camera=null}get _stage(){return this.view?.stage}get elevationInfo(){return this._elevationInfo}set elevationInfo(e){this._elevationInfo=e,this._elevationAlignedLocationDirty=!0,this._renderLocationDirty=!0,this._updateEngineObject()}get renderObjects(){return this._renderObjects}set renderObjects(e){this._removeResourcesFromStage(),this._engineResources=null,this._renderObjects=e.slice(),this._updateEngineObject()}set available(e){e!==this._available&&(this._available=e,this._updateEngineObject())}get available(){return this._available}disableDisplay(){return this._noDisplayCount++,1===this._noDisplayCount&&this._updateEngineObject(),i((()=>{this._noDisplayCount--,0===this._noDisplayCount&&this._updateEngineObject()}))}set radius(e){e!==this._radius&&(this._radius=e,this._updateEngineObject())}get radius(){return this._radius}set worldSized(e){e!==this._worldSized&&(this._worldSized=e,this._updateEngineObject())}get worldSized(){return this._worldSized}get modelTransform(){return this._modelTransform}set modelTransform(e){te(e)&&(this._screenLocationDirty=!0),d(this._modelTransform,e),this._updateEngineObject()}get renderLocation(){return this._renderLocationDirty&&(this._renderLocationDirty=!1,this.view.renderCoordsHelper.toRenderCoords(this.elevationAlignedLocation,this._renderLocation),this.worldOriented?(this._worldFrame||(this._worldFrame=m()),ie(this.view,this._renderLocation,this._worldFrame)):this._worldFrame&&(this._worldFrame=null)),this._renderLocation}set renderLocation(e){this.view.renderCoordsHelper.fromRenderCoords(e,this._location),this.elevationAlignedLocation=this._location}get location(){return this._location}set location(e){H(e,this._location),this._notifyLocationChanged()}_notifyLocationChanged(){this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!0,this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}get elevationAlignedLocation(){return this._elevationAlignedLocationDirty?(this._evaluateElevationAlignment(),this._updateElevationAlignedLocation(),this._elevationAlignedLocation):this._elevationAlignedLocation}set elevationAlignedLocation(e){H(e,this._location),this._evaluateElevationAlignment(),this._location.z-=this._elevation.offset,this._updateElevationAlignedLocation(),this._updateEngineObject(),this.events.emit("location-update",{location:this._location})}_updateElevationAlignedLocation(){const e=null!=this._elevation.override?this._elevation.override:this.location.z||0;this._elevationAlignedLocation.x=this.location.x,this._elevationAlignedLocation.y=this.location.y,this._elevationAlignedLocation.z=e+this._elevation.offset,this._elevationAlignedLocation.spatialReference=q(this.location.spatialReference),this._renderLocationDirty=!0,this._screenLocationDirty=!0,this._elevationAlignedLocationDirty=!1}grabbableForEvent(){return!0}get grabbing(){return this._grabbing}set grabbing(e){e!==this._grabbing&&(this._grabbing=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get hovering(){return this._hovering}set hovering(e){e!==this._hovering&&(this._hovering=e,this._setFocused(this._hovering||this._grabbing),this._updateEngineObject())}get selected(){return this._selected}set selected(e){e!==this._selected&&(this._selected=e,this._updateEngineObject(),this.events.emit("select-changed",{action:e?"select":"deselect"}))}get state(){return this._state}set state(e){e!==this._state&&(this._state=e,this._updateEngineObject())}updateStateEnabled(e,t){t?this.state|=e:this.state&=~e}_setFocused(e){e!==this._focused&&(this._focused=e,this.events.emit("focus-changed",{action:!0===e?"focus":"unfocus"}))}get focused(){return this._focused}get screenLocation(){return this._ensureScreenLocation(),this._screenLocation}_ensureScreenLocation(){if(!this._screenLocationDirty)return;this._screenLocation.pixelSize=this._camera.computeScreenPixelSizeAt(this.renderLocation),this._screenLocationDirty=!1;let e;if(te(this._modelTransform)){const t=this._calculateModelTransformOffset(me);e=p(t,t,this.renderLocation)}else e=this.renderLocation;this._camera.projectToRenderScreen(e,this._screenLocation.renderScreenPointArray),this._camera.renderToScreen(this._screenLocation.renderScreenPointArray,this._screenLocation.screenPointArray)}get applyObjectTransform(){return this._applyObjectTransform}set applyObjectTransform(e){this._applyObjectTransform=e,this._screenLocationDirty=!0,this._updateEngineObject()}get attached(){return this._attached}intersectionDistance(t,i){if(!this.available)return null;const s=a(t,se),o=this._getCollisionRadius(i),r=-1*this.collisionPriority;switch(this.collisionType.type){case"point":if(f(this.screenLocation.screenPointArray,s)<o*o)return this.screenLocation.renderScreenPointArray[2]+r;break;case"line":{const e=this.collisionType.paths,t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ce),n=o*this.screenLocation.pixelSize,a=Y(this._camera,s,re);if(null==a)return null;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],i);for(let t=1;t<s.length;t++){const o=v(de,s[t],i),l=k(x(e,o,oe),a);if(null!=l&&l<n*n){const t=p(N.get(),e,o);y(t,t,.5);const i=c(N.get());return this._camera.projectToRenderScreen(t,i),i[2]+r}j(e,o)}}break}case"disc":{const e=this.collisionType.direction,t=this.collisionType.offset??R,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this.screenLocation.pixelSize,c=Y(this._camera,s,re);if(null==c)return null;const h=l(ne,n),d=b(ue,e,h),_=v(ge,t,n);I(_,d,le);const u=_e;if(W(le,c,u)&&L(u,_)<a*a)return this.screenLocation.renderScreenPointArray[2]+r;break}case"ribbon":{const{paths:e,direction:t}=this.collisionType,i=this._getWorldToScreenObjectScale(),n=this._calculateObjectTransform(i,ce),a=o*this._camera.computeScreenPixelSizeAt(this.renderLocation),h=Y(this._camera,s,re);if(null==h)return null;const d=l(ne,n),_=b(ue,t,d),u=this._calculateModelTransformPosition(ge);I(u,_,le);const g=_e;if(!W(le,h,g))break;for(const s of e){if(0===s.length)continue;const e=v(he,s[0],n);for(let t=1;t<s.length;t++){const i=v(de,s[t],n),o=C(x(e,i,oe),g);if(null!=o&&o<a*a){const t=p(N.get(),e,i);y(t,t,.5);const s=c(N.get());return this._camera.projectToRenderScreen(t,s),s[2]+r}j(e,i)}}break}default:e(this.collisionType)}return null}attach(e={manipulator3D:{}}){const t=this._stage;if(!t)return;const i=e.manipulator3D;null==i.engineLayerId?(this._engineLayer=new X(t,{pickable:!1,updatePolicy:Q.SYNC}),i.engineLayerId=this._engineLayer.id):t?.getLayer&&(this._engineLayer=t.getLayer(i.engineLayerId)),i.engineLayerReferences=(i.engineLayerReferences||0)+1,this._camera.copyFrom(this.view.state.camera),this._attached=!0,this._updateEngineObject(),E(this._location.spatialReference,this.view.spatialReference)||(this.location=new A({x:0,y:0,z:0,spatialReference:this.view.spatialReference}))}detach(e={manipulator3D:{}}){const t=e.manipulator3D;t.engineLayerReferences--;const i=0===t.engineLayerReferences;this._removeResourcesFromStage(),i&&(t.engineLayerId=null,o(this._engineLayer)),this._engineResources=null,this._engineLayer=null,this._attached=!1}onViewChange(){this._camera.copyFrom(this.view.state.camera),this._screenLocationDirty=!0,this._updateEngineObject()}onElevationChange(e){D(this.location,fe,e.spatialReference)&&P(e.extent,fe)&&this._notifyLocationChanged()}_evaluateElevationAlignment(){if(null==this.elevationInfo)return;let e=null,t=0;const i=G(this.elevationInfo,this.location.spatialReference??this.view.elevationProvider.spatialReference);switch(this.elevationInfo.mode){case"on-the-ground":e=V(this.view.elevationProvider,this.location,"ground")??0;break;case"relative-to-ground":t=(V(this.view.elevationProvider,this.location,"ground")??0)+i;break;case"relative-to-scene":t=(V(this.view.elevationProvider,this.location,"scene")??0)+i;break;case"absolute-height":t=i}return t!==this._elevation.offset||e!==this._elevation.override?(this._elevation.offset=t,void(this._elevation.override=e)):void 0}_updateEngineObject(){if(!this._attached)return;if(!this.available)return void this._removeResourcesFromStage();const e=this._getWorldToScreenObjectScale(),t=ce;if(!0===this.autoScaleRenderObjects){const i=this._getFocusedSize(this._radius,this.focused)*e;this._calculateObjectTransform(i,t)}else this._calculateObjectTransform(e,t);const{objectsByState:i}=this._ensureEngineResources(),s=(this.focused?$.Focused:$.Unfocused)|(this.selected?$.Selected:$.Unselected),o=this._noDisplayCount>0;for(const{stateMask:r,objects:n}of i){if(o){for(const e of n)e.visible=!1;continue}const e=(r&$.All)!==$.None,i=(r&Z.All)!==Z.None,a=!e||(s&r)===(r&$.All),c=!i||(this.state&r)===(r&Z.All);if(a&&c)for(const s of n)s.visible=!0,s.transformation=t;else for(const t of n)t.visible=!1}}_ensureEngineResources(){if(null==this._engineResources){const e=this._engineLayer,t=[],i=new Set;this.renderObjects.forEach((({geometry:{material:e}})=>{i.has(e)||(t.push(e),i.add(e))}));const s=new Map;this._renderObjects.forEach((e=>{const t=new K({castShadow:!1,geometries:[e.geometry]}),i=s.get(e.stateMask)||[];i.push(t),s.set(e.stateMask,i)}));const o=[];s.forEach(((e,t)=>o.push({stateMask:t,objects:e}))),this._engineResources={objectsByState:o,layer:e,materials:t}}return this._addResourcesToStage(),this._engineResources}_addResourcesToStage(){const e=this._stage;if(this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:e})=>i.addMany(e))),this._engineResourcesAddedToStage=!0}_removeResourcesFromStage(){const e=this._stage;if(!this._engineResourcesAddedToStage||null==this._engineResources||!e)return;const{objectsByState:t,layer:i}=this._engineResources;t.forEach((({objects:e})=>i.removeMany(e))),this._engineResourcesAddedToStage=!1}_getCollisionRadius(e){return this._getFocusedSize(this.radius,!0)*("touch"===e?this.touchMultiplier:1)}_getFocusedSize(e,t){return e*(t?this.focusMultiplier:1)}_getWorldToScreenObjectScale(){return this._worldSized?1:this.screenLocation.pixelSize}_calculateModelTransformPosition(e){const t=this._getWorldToScreenObjectScale(),i=this._calculateObjectTransform(t,ae);return S(e,i[12],i[13],i[14])}_calculateModelTransformOffset(e){const t=this._calculateModelTransformPosition(e);return w(e,t,this.renderLocation)}_calculateObjectTransform(e,t){return _(t,e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1),this._worldFrame&&u(t,t,this._worldFrame),u(t,t,this._modelTransform),t[12]+=this.renderLocation[0],t[13]+=this.renderLocation[1],t[14]+=this.renderLocation[2],t[15]=1,null!=this._applyObjectTransform&&this._applyObjectTransform(t),t}get test(){}}function te(e){return 0!==e[12]||0!==e[13]||0!==e[14]}function ie(e,t,i){switch(e.viewingMode){case"local":return g(i),!0;case"global":{const o=T(e.renderCoordsHelper.spatialReference);return z(t,0,he,0,o.radius),F(s(he[0]),s(he[1]),i),!0}}}const se=n(),oe=M(),re=B(),ne=h(),ae=m(),ce=m(),le=U(),he=O(),de=O(),_e=O(),ue=O(),ge=O(),me=O(),fe=new A({x:0,y:0,z:0,spatialReference:null}),pe=()=>{};export{ee as Manipulator3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../Color.js";import{multiplyOpacity as i}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{m as t}from"../../../chunks/vec32.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as a,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{vectorToRender as s}from"./support/viewUtils.js";import{ExtendedLineVisualElement as p,ExtensionType as c}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as d}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as m}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as u}from"./visualElements/RightAngleQuadVisualElement.js";import{DrapedRenderGroup as f}from"../layers/interfaces.js";import{RenderOccludedFlag as g}from"../webgl-engine/lib/Material.js";import{toDehydratedPoint as v,isTarget as h,withSelfSnappingZ as E}from"../../interactive/sketch/normalizedPoint.js";import{defaults as C}from"../../interactive/snapping/Settings.js";import{SnappingDomain as w}from"../../interactive/snapping/SnappingDomain.js";import{LineSegmentHintType as j}from"../../interactive/snapping/snappingUtils.js";import{SnappingVisualizer as S}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as O}from"../../interactive/snapping/hints/LineSnappingHint.js";class R extends S{sortUniqueHints(e){return e.sort(((e,i)=>(i instanceof O?i.length:0)-(e instanceof O?e.length:0)))}visualizeIntersectionPoint(e,i){const{spatialReference:t,view:r}=i,o=D(i);return n(new m({view:r,primitive:"circle",geometry:v(e.intersectionPoint,t),elevationInfo:e.isDraped?a:l,size:20,outlineSize:2,color:o.intersectionPointColor,outlineColor:o.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,i){const{view:t,spatialReference:r}=i,o=D(i),a=x(e.point,e.domain,i);return n(new m({view:t,primitive:"circle",geometry:v(a,r),elevationInfo:A(e),size:20,outlineSize:2,color:o.pointColor,outlineColor:o.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,i){const{view:t,spatialReference:r}=i,o=D(i),a=x(e.lineStart,e.domain,i),l=x(e.lineEnd,e.domain,i);return n(H(e.type,a,l,r,A(e),t,o,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,i){const{view:r,spatialReference:o}=i,a=D(i),{isDraped:l}=e,s=A(e),p=x(e.lineStart,e.domain,i),c=x(e.lineEnd,e.domain,i),m=z(p,o,s,r,l),u=z(c,o,s,r,l),v=t(u,m,u,.5),h=new d({view:r,attached:!1,offset:C.parallelLineHintOffset,length:C.parallelLineHintLength,width:C.parallelLineHintWidth,color:a.parallelSignColor,location:v,renderOccluded:l?g.OccludeAndTransparent:g.Opaque,isDraped:l,renderGroup:f.SnappingHint,isDecoration:!0});return h.setDirectionFromPoints(m,v),h.attached=!0,n(h)}visualizeRightAngleQuad(e,i){const{view:t,spatialReference:r}=i,o=D(i),a=A(e),{isDraped:l}=e,s=x(e.previousVertex,e.domain,i),p=x(e.centerVertex,e.domain,i),c=x(e.nextVertex,e.domain,i),d=z(s,r,a,t,l),m=z(p,r,a,t,l),v=z(c,r,a,t,l);return n(new u({view:t,attached:!0,color:l?o.rightAngleColorDraped:o.rightAngleColor,renderOccluded:l?g.OccludeAndTransparent:g.Transparent,outlineRenderOccluded:l?g.OccludeAndTransparent:g.Opaque,outlineColor:o.rightAngleOutlineColor,outlineSize:C.rightAngleHintOutlineSize,size:C.rightAngleHintSize,isDraped:l,geometry:{previous:d,center:m,next:v},renderGroup:f.SnappingHint,isDecoration:!0}))}}function D(n){const{effectiveTheme:t}=n.view,r=e.toUnitRGBA(t.accentColor),o=[0,0,0,0];return{intersectionPointColor:o,intersectionPointOutlineColor:r,pointColor:o,pointOutlineColor:r,lineColor:r,lineOutlineColor:void 0,parallelSignColor:r,rightAngleColor:r,rightAngleColorDraped:e.toUnitRGBA(i(t.accentColor,.5)),rightAngleOutlineColor:r}}function x(e,i,{selfSnappingZ:n,view:t,spatialReference:r}){return i&w.SELF&&h(e)&&null!=n?E(e,n,t,r):e}function A(e){return e.isDraped?a:l}function H(e,i,n,t,r,o,a,l=!1,s=!0,d=!0){const m=z(i,t,r,o,l),u=z(n,t,r,o,l),v=new p({view:o,extensionType:c.FADED,start:m,end:u,isDraped:l,color:a.lineColor,renderOccluded:l?g.OccludeAndTransparent:g.Opaque,renderGroup:f.SnappingHint,isDecoration:!0});switch(e){case j.TARGET:v.width=C.lineHintWidthTarget,v.fadedExtensions={start:0,end:C.lineHintFadedExtensions};break;case j.REFERENCE_EXTENSION:v.width=C.lineHintWidthReference,v.fadedExtensions={start:0,end:0};break;case j.REFERENCE:v.width=C.lineHintWidthReference,v.fadedExtensions={start:s?C.lineHintFadedExtensions:0,end:d?C.lineHintFadedExtensions:0}}return v.attached=!0,v}function z(e,i,n,t,a){const l=r();if(a){const n=t.basemapTerrain.overlayManager.renderer.spatialReference;o(e,i,l,n)}else s(e,i,n,t,l);return l}export{R as SnappingVisualizer3D};
5
+ import e from"../../../Color.js";import{multiplyOpacity as i}from"../../../core/colorUtils.js";import"../../../core/has.js";import{destroyHandle as n}from"../../../core/handleUtils.js";import{m as t}from"../../../chunks/vec32.js";import{create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{projectVectorToVector as o}from"../../../geometry/projection/projectVectorToVector.js";import{onTheGroundElevationInfo as a,absoluteHeightElevationInfo as l}from"../../../support/elevationInfoUtils.js";import{vectorToRender as s}from"./support/viewUtils.js";import{ExtendedLineVisualElement as p,ExtensionType as c}from"./visualElements/ExtendedLineVisualElement.js";import{ParallelLineVisualElement as d}from"./visualElements/ParallelLineVisualElement.js";import{PointVisualElement as m}from"./visualElements/PointVisualElement.js";import{RightAngleQuadVisualElement as u}from"./visualElements/RightAngleQuadVisualElement.js";import{DrapedRenderGroup as f}from"../layers/interfaces.js";import{RenderOccludedFlag as g}from"../webgl-engine/lib/Material.js";import{toDehydratedPoint as v,isTarget as h,withSelfSnappingZ as E}from"../../interactive/sketch/normalizedPoint.js";import{defaults as C}from"../../interactive/snapping/Settings.js";import{SnappingDomain as w}from"../../interactive/snapping/SnappingDomain.js";import{LineSegmentHintType as j}from"../../interactive/snapping/snappingUtils.js";import{SnappingVisualizer as S}from"../../interactive/snapping/SnappingVisualizer.js";import{LineSnappingHint as O}from"../../interactive/snapping/hints/LineSnappingHint.js";class R extends S{sortUniqueHints(e){return e.sort(((e,i)=>(i instanceof O?i.length:0)-(e instanceof O?e.length:0)))}visualizeIntersectionPoint(e,i){const{spatialReference:t,view:r}=i,o=D(i);return n(new m({view:r,primitive:"circle",geometry:v(e.intersectionPoint,t),elevationInfo:e.isDraped?a:l,size:20,outlineSize:2,color:o.intersectionPointColor,outlineColor:o.intersectionPointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizePoint(e,i){const{view:t,spatialReference:r}=i,o=D(i),a=x(e.point,e.domain,i);return n(new m({view:t,primitive:"circle",geometry:v(a,r),elevationInfo:A(e),size:20,outlineSize:2,color:o.pointColor,outlineColor:o.pointOutlineColor,pixelSnappingEnabled:!1,isDecoration:!0,attached:!0}))}visualizeLine(e,i){const{view:t,spatialReference:r}=i,o=D(i),a=x(e.lineStart,e.domain,i),l=x(e.lineEnd,e.domain,i);return n(H(e.type,a,l,r,A(e),t,o,e.isDraped,e.fadeLeft,e.fadeRight))}visualizeParallelSign(e,i){const{view:r,spatialReference:o}=i,a=D(i),{isDraped:l}=e,s=A(e),p=x(e.lineStart,e.domain,i),c=x(e.lineEnd,e.domain,i),m=z(p,o,s,r,l),u=z(c,o,s,r,l),v=t(u,m,u,.5),h=new d({view:r,attached:!1,offset:C.parallelLineHintOffset,length:C.parallelLineHintLength,width:C.parallelLineHintWidth,color:a.parallelSignColor,location:v,renderOccluded:l?g.OccludeAndTransparent:g.Opaque,isDraped:l,renderGroup:f.SnappingHint,isDecoration:!0});return h.setDirectionFromPoints(m,v),h.attached=!0,n(h)}visualizeRightAngleQuad(e,i){const{view:t,spatialReference:r}=i,o=D(i),a=A(e),{isDraped:l}=e,s=x(e.previousVertex,e.domain,i),p=x(e.centerVertex,e.domain,i),c=x(e.nextVertex,e.domain,i),d=z(s,r,a,t,l),m=z(p,r,a,t,l),v=z(c,r,a,t,l);return n(new u({view:t,attached:!0,color:l?o.rightAngleColorDraped:o.rightAngleColor,renderOccluded:l?g.OccludeAndTransparent:g.Transparent,outlineRenderOccluded:l?g.OccludeAndTransparent:g.Opaque,outlineColor:o.rightAngleOutlineColor,outlineSize:C.rightAngleHintOutlineSize,size:C.rightAngleHintSize,isDraped:l,geometry:{previous:d,center:m,next:v},renderGroup:f.SnappingHint,isDecoration:!0}))}}function D(n){const{effectiveTheme:t}=n.view,r=e.toUnitRGBA(t.accentColor),o=[0,0,0,0];return{intersectionPointColor:o,intersectionPointOutlineColor:r,pointColor:o,pointOutlineColor:r,lineColor:r,lineOutlineColor:void 0,parallelSignColor:r,rightAngleColor:r,rightAngleColorDraped:e.toUnitRGBA(i(t.accentColor,.5)),rightAngleOutlineColor:r}}function x(e,i,{selfSnappingZ:n,view:t,spatialReference:r}){return 0!==(i&w.SELF)&&h(e)&&null!=n?E(e,n,t,r):e}function A(e){return e.isDraped?a:l}function H(e,i,n,t,r,o,a,l=!1,s=!0,d=!0){const m=z(i,t,r,o,l),u=z(n,t,r,o,l),v=new p({view:o,extensionType:c.FADED,start:m,end:u,isDraped:l,color:a.lineColor,renderOccluded:l?g.OccludeAndTransparent:g.Opaque,renderGroup:f.SnappingHint,isDecoration:!0});switch(e){case j.TARGET:v.width=C.lineHintWidthTarget,v.fadedExtensions={start:0,end:C.lineHintFadedExtensions};break;case j.REFERENCE_EXTENSION:v.width=C.lineHintWidthReference,v.fadedExtensions={start:0,end:0};break;case j.REFERENCE:v.width=C.lineHintWidthReference,v.fadedExtensions={start:s?C.lineHintFadedExtensions:0,end:d?C.lineHintFadedExtensions:0}}return v.attached=!0,v}function z(e,i,n,t,a){const l=r();if(a){const n=t.basemapTerrain.overlayManager.renderer.spatialReference;o(e,i,l,n)}else s(e,i,n,t,l);return l}export{R as SnappingVisualizer3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as s}from"../../../chunks/tslib.es6.js";import{createTask as i}from"../../../core/asyncUtils.js";import e from"../../../core/Error.js";import{destroyMaybe as a,abortMaybe as t}from"../../../core/maybe.js";import{isAborted as r,createAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l}from"../../../core/reactiveUtils.js";import{property as y}from"../../../core/accessorSupport/decorators/property.js";import{subclass as w}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as c}from"./LayerView3D.js";import h from"../../layers/DimensionLayerView.js";import m from"../../layers/LayerView.js";const p="analysis-view-handles";let d=class extends(c(h(m))){constructor(s){super(s),this.type="dimension-3d",this._analysisModule=null}initialize(){this.addHandles(n((()=>this.layer.source),(s=>{this._destroyAnalysisView(),null!=s&&this._createAnalysisView(s)}),l),p)}destroy(){this.removeHandles(p),this._destroyAnalysisView()}isUpdating(){return null!=this._createAnalysisViewTask||null!=this.analysisView&&this.analysisView.updating}async whenAnalysisView(){if(null!=this.analysisView)return this.analysisView;if(null!=this._createAnalysisViewTask)return this._createAnalysisViewTask.promise;throw new e("layerview:no-analysisview-for-analysis","The analysis has not been set on the DimensionLayer of this layer view")}_createAnalysisView(s){const e=i((async i=>(this.analysisView=await this._createAnalysisViewPromise(s,i),this._createAnalysisViewTask===e&&(this._createAnalysisViewTask=null),this.analysisView)));this.addResolvingPromise(e.promise),this._createAnalysisViewTask=e}_destroyAnalysisView(){this.analysisView=a(this.analysisView),this._createAnalysisViewTask=t(this._createAnalysisViewTask)}async _createAnalysisViewPromise(s,i){let e=this._analysisModule;if(null==e){const s=await this._loadAnalysisModule();this._analysisModule=s,e=s}const a=new e.default({analysis:s,view:this.view,parent:this});if(await a.when(),r(i))throw a.destroy(),o();return a}_loadAnalysisModule(){return import("../analysis/DimensionAnalysisView3D.js")}};s([y()],d.prototype,"type",void 0),s([y()],d.prototype,"analysisView",void 0),s([y()],d.prototype,"_createAnalysisViewTask",void 0),d=s([w("esri.views.3d.layers.DimensionLayerView3D")],d);const V=d;export{V as default};
5
+ import{_ as s}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import{LayerView3D as a}from"./LayerView3D.js";import{LayerViewAnalysisViewManager as r}from"./support/LayerViewAnalysisViewManager.js";import n from"../../layers/DimensionLayerView.js";import t from"../../layers/LayerView.js";let o=class extends(a(n(t))){constructor(s){super(s),this.type="dimension-3d",this._analysisViewManager=null}initialize(){this._analysisViewManager=new r({parent:this,getAnalysis:()=>this.layer.analysis,loadAnalysisViewModule:()=>import("../analysis/DimensionAnalysisView3D.js")})}destroy(){this._analysisViewManager.destroy()}get analysisView(){return this._analysisViewManager.analysisView}whenAnalysisView(){return this._analysisViewManager.whenAnalysisView()}isUpdating(){return this._analysisViewManager.updating}};s([e()],o.prototype,"type",void 0),s([e()],o.prototype,"_analysisViewManager",void 0),s([e({readOnly:!0})],o.prototype,"analysisView",null),o=s([i("esri.views.3d.layers.DimensionLayerView3D")],o);const y=o;export{y as default};