@arcgis/core 4.34.0-next.65 → 4.34.0-next.67

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 (367) hide show
  1. package/Graphic.js +1 -1
  2. package/WebDocument2D.js +1 -1
  3. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  4. package/assets/esri/core/workers/RemoteClient.js +1 -1
  5. package/assets/esri/core/workers/chunks/0814676e4bac81f96140.js +1 -0
  6. package/assets/esri/core/workers/chunks/{6ab435423acb0ed0b1c7.js → 09dbb3e200ef8d514eb3.js} +2 -2
  7. package/assets/esri/core/workers/chunks/0b71100fa1e7ca706dbb.js +1 -0
  8. package/assets/esri/core/workers/chunks/0c4f07eb3f3dd5cd2c6c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{3167230555c63f943485.js → 0cbd5335cc92f5891bcf.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{79933271a76a1756584f.js → 12d30c2367652e2c688b.js} +1 -1
  11. package/assets/esri/core/workers/chunks/144bfd64daf103a06734.js +1 -0
  12. package/assets/esri/core/workers/chunks/{0b53bc76d38e85902748.js → 170ec7fb070c63230c81.js} +1 -1
  13. package/assets/esri/core/workers/chunks/18c7b1e1fbf7eb6c3c33.js +1 -0
  14. package/assets/esri/core/workers/chunks/1ada9e6cdd6792e3847a.js +1 -0
  15. package/assets/esri/core/workers/chunks/1e86df439c564fe752e3.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4459c8e495a37d4c4eb8.js → 25118304c9a914194e90.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{426232091caf8608e5f1.js → 26b791291689434dde09.js} +1 -1
  18. package/assets/esri/core/workers/chunks/3212a476184be25d17f8.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d823277612f971a9c2f0.js → 3245663da75e168bf85c.js} +1 -1
  20. package/assets/esri/core/workers/chunks/37d7c249114994a7dfac.js +1 -0
  21. package/assets/esri/core/workers/chunks/{e72aee3f857aa473822c.js → 39d69afc9da9db0c75ab.js} +1 -1
  22. package/assets/esri/core/workers/chunks/4102ed32b8dbdc32cb3b.js +1 -0
  23. package/assets/esri/core/workers/chunks/{7c3a1958990de095d3a1.js → 48316d91c06928f69f61.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{dbcef57073075e9cfdfe.js → 489fa17e60f25d5f33ae.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{19e5e011f929b6b940fe.js → 4bc091770bab38874848.js} +1 -1
  26. package/assets/esri/core/workers/chunks/4f0f6653b8e92c633d14.js +1 -0
  27. package/assets/esri/core/workers/chunks/{09f0c9f0b6aa58ae3c52.js → 4f22e5a7f81883e8e5b6.js} +1 -1
  28. package/assets/esri/core/workers/chunks/5185c63fecc5f493e142.js +1 -0
  29. package/assets/esri/core/workers/chunks/{6fff219dfaa86167c326.js → 5303d77a3ab1b7ddeef3.js} +1 -1
  30. package/assets/esri/core/workers/chunks/548818df658b607a364e.js +1 -0
  31. package/assets/esri/core/workers/chunks/{22ec2b0a853911692dc8.js → 5993427325d1add18ed9.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{657b01a6df8dc46c5209.js → 5b84eba4a28e25b6d5c0.js} +1 -1
  33. package/assets/esri/core/workers/chunks/5c053d197935c65792ce.js +1 -0
  34. package/assets/esri/core/workers/chunks/{497214e9e82b936fc94e.js → 5ed381a268855bcad072.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{33718ea851645d9078d1.js → 605acf18cbeb89e4f29f.js} +1 -1
  36. package/assets/esri/core/workers/chunks/66cb5b294d7f251c2cc8.js +1 -0
  37. package/assets/esri/core/workers/chunks/6a5b5b80917a5375b9f6.js +1 -0
  38. package/assets/esri/core/workers/chunks/{4d7fcec769369c576847.js → 6e59ba2afd444eb4be18.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{a700f57af6856cb5313c.js → 70dc7ec6474f0801bc04.js} +1 -1
  40. package/assets/esri/core/workers/chunks/7e95896ac41c7e2ca26a.js +1 -0
  41. package/assets/esri/core/workers/chunks/80b0c88a76bd523a406a.js +1 -0
  42. package/assets/esri/core/workers/chunks/{5d12862042b6bf9f9d54.js → 82cb5defb0593e3017ff.js} +1 -1
  43. package/assets/esri/core/workers/chunks/837830e1cf712d4243a5.js +1 -0
  44. package/assets/esri/core/workers/chunks/87fb5d755860057da164.js +1 -0
  45. package/assets/esri/core/workers/chunks/{a29fb90226bd08157bd1.js → 8a104b35708a492bd614.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{5cb238318a24b70d5ac3.js → 8bc8caa384b24af12411.js} +1 -1
  47. package/assets/esri/core/workers/chunks/8e2558b14be70b273ce4.js +1 -0
  48. package/assets/esri/core/workers/chunks/{8e40c409a9b0a2a768a9.js → 8f02349602b072186a1f.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{fa0f94318173db2034de.js → 90491262b6d6a126c32f.js} +1 -1
  50. package/assets/esri/core/workers/chunks/99f133a152afb4f1b067.js +1 -0
  51. package/assets/esri/core/workers/chunks/9eb1bfcb9b05f2a36748.js +1 -0
  52. package/assets/esri/core/workers/chunks/{0a36df6fdab95785d1ce.js → a2963ffc9a8c90822d2d.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{8e3c09c3524654830b14.js → a634764dec5404f4a1d7.js} +1 -1
  54. package/assets/esri/core/workers/chunks/a895da7fd64ebad3d5a4.js +1 -0
  55. package/assets/esri/core/workers/chunks/aa970a547c60c43d6c7f.js +1 -0
  56. package/assets/esri/core/workers/chunks/ab727ed4417b7dd94ce9.js +1 -0
  57. package/assets/esri/core/workers/chunks/{d1e8220dcae1d01d3c35.js → ad3ebd4f05cc673140f3.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{9f93513037a6e87433c4.js → adfb018f510e19a520fb.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{a1bd4eecca1e3272bffb.js → aff553c3d6544e20f188.js} +1 -1
  60. package/assets/esri/core/workers/chunks/b052d3ef5493eedb44a5.js +1 -0
  61. package/assets/esri/core/workers/chunks/b335e96f6bcac6d2f0ee.js +1 -0
  62. package/assets/esri/core/workers/chunks/b482132638f3b351724c.js +1 -0
  63. package/assets/esri/core/workers/chunks/{e1b25b1ce3bd4f0f2cda.js → bc5fa33afec5354601a1.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{dd1d9913b33d4e48baff.js → c35dad3d5ceaac6ad5a4.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e1b573840ec1f7c3afd3.js → c4b2678dd46fa1e22f7e.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{bc931865a77fc48871d3.js → c94c797864a85342b105.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{e97250ae8da4bd0d6bc9.js → cad03967e132a28512c2.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{904c116c6b093e0e970c.js → d1b361b8adf1c719a10a.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{c7a386ac90e58eb71935.js → da1a5537e2f2ca6cc247.js} +1 -1
  70. package/assets/esri/core/workers/chunks/dd447dfc50ee7f511b84.js +1 -0
  71. package/assets/esri/core/workers/chunks/e0fe6bb51ecc9b2faf69.js +1 -0
  72. package/assets/esri/core/workers/chunks/{0f9813e7d4e2b47b2c39.js → e47acdb1fbf797342716.js} +1 -1
  73. package/assets/esri/core/workers/chunks/e4e224983c3ee24fc51d.js +1 -0
  74. package/assets/esri/core/workers/chunks/{a16b471c3706ee37f9b6.js → e6f2ac738df16fb5e13a.js} +1 -1
  75. package/assets/esri/core/workers/chunks/ed1272e7681e561d843f.js +1 -0
  76. package/assets/esri/core/workers/chunks/ee391a41144855fc625d.js +1 -0
  77. package/assets/esri/core/workers/chunks/efea3e82cec476d486e0.js +1 -0
  78. package/assets/esri/core/workers/chunks/f054557e23978e174686.js +1 -0
  79. package/assets/esri/core/workers/chunks/{ff2614d96ca5228e9685.js → f4d4c1f13522f20b00d1.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{897f9775f06ddbf6486f.js → f9385d7fb5ff20f7b252.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{b30de4936caa654d7817.js → fac020b6886ff2d75015.js} +1 -1
  82. package/assets/esri/core/workers/chunks/fe353a53968827bcd9cc.js +1 -0
  83. package/chunks/GlowComposition.glsl.js +3 -3
  84. package/chunks/RibbonLine.glsl.js +2 -2
  85. package/config.js +1 -1
  86. package/core/AsyncUpdate.js +1 -1
  87. package/core/mapCollectionUtils.js +1 -1
  88. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  89. package/geometry/Polygon.js +1 -1
  90. package/geometry/support/centroid.js +1 -1
  91. package/geometry/support/geometryUtils.js +1 -1
  92. package/graphic/AggregateGraphicOrigin.js +1 -1
  93. package/graphic/BuildingGraphicOrigin.js +1 -1
  94. package/graphic/CSVGraphicOrigin.js +1 -1
  95. package/graphic/CatalogGraphicOrigin.js +1 -1
  96. package/graphic/FeatureGraphicOrigin.js +1 -1
  97. package/graphic/GeoJSONGraphicOrigin.js +1 -1
  98. package/graphic/GeoRSSGraphicOrigin.js +1 -1
  99. package/graphic/ImageryGraphicOrigin.js +1 -1
  100. package/graphic/ImageryTileGraphicOrigin.js +1 -1
  101. package/graphic/KMLGraphicOrigin.js +1 -1
  102. package/graphic/KnowledgeGraphGraphicOrigin.js +1 -1
  103. package/graphic/LinkChartGraphicOrigin.js +1 -1
  104. package/graphic/MapImageGraphicOrigin.js +1 -1
  105. package/graphic/MapNotesGraphicOrigin.js +1 -1
  106. package/graphic/OGCFeatureGraphicOrigin.js +1 -1
  107. package/graphic/OrientedImageryGraphicOrigin.js +1 -1
  108. package/graphic/ParquetGraphicOrigin.js +1 -1
  109. package/graphic/PointCloudGraphicOrigin.js +1 -1
  110. package/graphic/SceneGraphicOrigin.js +1 -1
  111. package/graphic/StreamGraphicOrigin.js +1 -1
  112. package/graphic/SubtypeGroupGraphicOrigin.js +1 -1
  113. package/graphic/TileGraphicOrigin.js +1 -1
  114. package/graphic/TrackGraphicOrigin.js +1 -1
  115. package/graphic/VectorTileGraphicOrigin.js +1 -1
  116. package/graphic/VoxelGraphicOrigin.js +1 -1
  117. package/graphic/WCSGraphicOrigin.js +1 -1
  118. package/graphic/WFSGraphicOrigin.js +1 -1
  119. package/graphic/getIdFieldsProvider.js +5 -0
  120. package/graphic/getSliceableContainer.js +5 -0
  121. package/graphic/graphicOrigins.d.ts +0 -2
  122. package/graphic/graphicOrigins.js +1 -1
  123. package/interfaces.d.ts +172 -244
  124. package/kernel.js +1 -1
  125. package/layers/GaussianSplatLayer.js +1 -1
  126. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  127. package/layers/IntegratedMeshLayer.js +1 -1
  128. package/layers/Layer.js +1 -1
  129. package/layers/LinkChartLayer.js +1 -1
  130. package/layers/MapImageLayer.js +1 -1
  131. package/layers/OrientedImageryLayer.js +1 -1
  132. package/layers/VoxelLayer.js +1 -1
  133. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  134. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  135. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  136. package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
  137. package/layers/mixins/ArcGISImageService.js +1 -1
  138. package/layers/mixins/ImageryTileMixin.js +1 -1
  139. package/layers/mixins/OperationalLayer.js +1 -1
  140. package/layers/mixins/TemporalLayer.js +1 -1
  141. package/layers/mixins/TemporalSceneLayer.js +1 -1
  142. package/layers/mixins/operationalLayers.js +1 -1
  143. package/layers/orientedImagery/core/coverageUtils.js +1 -1
  144. package/layers/support/FeatureFilter.js +1 -1
  145. package/layers/support/TimeInfo.js +1 -1
  146. package/layers/support/TrackInfo.js +1 -1
  147. package/layers/support/layersCreator.js +1 -1
  148. package/layers/support/rasterDatasets/multidimensionalUtils.js +1 -1
  149. package/package.json +2 -2
  150. package/portal/schemas/definitions.js +1 -1
  151. package/portal/support/portalLayers.js +1 -1
  152. package/rest/support/AttributeBinsQuery.js +1 -1
  153. package/rest/support/IdentifyParameters.js +1 -1
  154. package/rest/support/ImageGPSInfoParameters.js +1 -1
  155. package/rest/support/ImageHistogramParameters.js +1 -1
  156. package/rest/support/ImageIdentifyParameters.js +1 -1
  157. package/rest/support/ImageParameters.js +1 -1
  158. package/rest/support/ImageSampleParameters.js +1 -1
  159. package/rest/support/Query.js +1 -1
  160. package/rest/support/TopFeaturesQuery.js +1 -1
  161. package/smartMapping/support/adapters/FeatureLayerBinningAdapter.js +1 -1
  162. package/support/revision.js +1 -1
  163. package/support/timeUtils.js +1 -1
  164. package/symbols/support/previewCIMSymbol.js +1 -1
  165. package/symbols/support/previewSymbol2D.js +1 -1
  166. package/symbols/support/renderUtils.js +1 -1
  167. package/symbols/support/svgUtils.js +1 -1
  168. package/symbols/support/symbolUtils.js +1 -1
  169. package/symbols/support/utils.js +1 -1
  170. package/time/TimeExtent.js +1 -1
  171. package/time/TimeInterval.js +1 -1
  172. package/views/2d/analysis/ElevationProfile/ElevationProfileInputVisualization2D.js +5 -0
  173. package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +5 -0
  174. package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +5 -0
  175. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  176. package/views/2d/engine/webgl/Painter.js +1 -1
  177. package/views/2d/engine/webgl/effects/FeatureEffect.js +1 -1
  178. package/views/2d/engine/webgl/effects/post-processing/EffectManager.js +1 -1
  179. package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
  180. package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
  181. package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +5 -0
  182. package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +5 -0
  183. package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +5 -0
  184. package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
  185. package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +5 -0
  186. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
  187. package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
  188. package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
  189. package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
  190. package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
  191. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
  192. package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
  193. package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
  194. package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
  195. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
  196. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  197. package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
  198. package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
  199. package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
  200. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
  201. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js +1 -1
  202. package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +5 -0
  203. package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
  204. package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
  205. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +5 -0
  206. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +5 -0
  207. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +5 -0
  208. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +5 -0
  209. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +5 -0
  210. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PostProcessingShader.js +5 -0
  211. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
  212. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
  213. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  214. package/views/2d/layers/MediaLayerView2D.js +1 -1
  215. package/views/2d/layers/TileLayerView2D.js +1 -1
  216. package/views/2d/layers/features/FeatureContainer.js +1 -1
  217. package/views/2d/layers/features/RenderState.js +1 -1
  218. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  219. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization3D.js +5 -0
  220. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +5 -0
  221. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +5 -0
  222. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  223. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  224. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  225. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  226. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  227. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementTool.js +5 -0
  228. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementGeometryUtils.js +5 -0
  229. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  230. package/views/3d/environment/Fog.js +1 -1
  231. package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
  232. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  233. package/views/3d/layers/I3SMeshView3D.js +1 -1
  234. package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
  235. package/views/3d/layers/SceneLayerView3D.js +1 -1
  236. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  237. package/views/3d/layers/graphics/QueryEngine.js +1 -1
  238. package/views/3d/layers/graphics/graphicUtils.js +1 -1
  239. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  240. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorker.js +1 -1
  241. package/views/3d/layers/graphics/pipeline/Feature3DPipelineWorkerHandle.js +1 -1
  242. package/views/3d/layers/i3s/Intersector.js +1 -1
  243. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  244. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  245. package/views/3d/layers/support/SublayerPopupHighlightHelper3D.js +1 -1
  246. package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
  247. package/views/3d/support/hitTest.js +1 -1
  248. package/views/3d/support/viewpointUtils.js +1 -1
  249. package/views/3d/terrain/Intersector.js +1 -1
  250. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  251. package/views/3d/webgl-engine/core/FBOCacheFormats.js +1 -1
  252. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +4 -4
  253. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColor.glsl.js +5 -0
  254. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
  255. package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorTechnique.js +1 -1
  256. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMask.glsl.js +5 -0
  257. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  258. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskTechnique.js +1 -1
  259. package/views/3d/webgl-engine/effects/focusArea/FocusAreaOutlineItem.js +1 -1
  260. package/views/3d/webgl-engine/effects/glow/GlowComposition.glsl.js +1 -1
  261. package/views/3d/webgl-engine/effects/glow/GlowPresets.glsl.js +1 -1
  262. package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
  263. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  264. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  265. package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
  266. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  267. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  268. package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
  269. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  270. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +5 -0
  271. package/views/VideoView.js +1 -1
  272. package/views/View.js +1 -1
  273. package/views/View2D.js +1 -1
  274. package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
  275. package/views/analysis/ElevationProfile/ElevationProfileGenerationError.js +1 -1
  276. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +5 -0
  277. package/views/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +5 -0
  278. package/views/analysis/ElevationProfile/ElevationProfileResult.js +1 -1
  279. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  280. package/views/analysis/ElevationProfile/constants.js +1 -1
  281. package/views/analysis/ElevationProfile/elevationProfileInputVisualizationUtils.js +5 -0
  282. package/views/draw/support/createUtils.js +1 -1
  283. package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
  284. package/webdoc/support/timeProperties.js +1 -1
  285. package/webdoc/widgets/TimeSlider.js +1 -1
  286. package/webmap/InitialViewProperties.js +1 -1
  287. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  288. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  289. package/widgets/Legend/styles/card/CardView.js +1 -1
  290. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  291. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  292. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  293. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  294. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  295. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  296. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  297. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  298. package/widgets/Legend/styles/support/relationshipUtils.js +1 -1
  299. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  300. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  301. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  302. package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
  303. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  304. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  305. package/widgets/TimeSlider.js +1 -1
  306. package/widgets/UtilityNetworkTrace/support/GraphicHandler.js +1 -1
  307. package/TimeExtent.d.ts +0 -4
  308. package/TimeExtent.js +0 -5
  309. package/TimeInterval.d.ts +0 -4
  310. package/TimeInterval.js +0 -5
  311. package/assets/esri/core/workers/chunks/0264905da9fa56166538.js +0 -1
  312. package/assets/esri/core/workers/chunks/070b29cba896f46537f9.js +0 -1
  313. package/assets/esri/core/workers/chunks/0b01c87db77246632ad9.js +0 -1
  314. package/assets/esri/core/workers/chunks/0cb2f7172190babb4139.js +0 -1
  315. package/assets/esri/core/workers/chunks/0cdf6b51f2a63f348530.js +0 -1
  316. package/assets/esri/core/workers/chunks/0d82cc6905b105b3568a.js +0 -1
  317. package/assets/esri/core/workers/chunks/0e28cb5d8d89ae29cdd0.js +0 -1
  318. package/assets/esri/core/workers/chunks/1143313f2f6f34deaad7.js +0 -1
  319. package/assets/esri/core/workers/chunks/14c6461ffd36319e1d74.js +0 -1
  320. package/assets/esri/core/workers/chunks/2394ac65d64e50399d76.js +0 -1
  321. package/assets/esri/core/workers/chunks/47febd4de836a33b51b1.js +0 -1
  322. package/assets/esri/core/workers/chunks/487afbf352d12c745430.js +0 -1
  323. package/assets/esri/core/workers/chunks/56b4dcd04c844eaacd60.js +0 -1
  324. package/assets/esri/core/workers/chunks/5d65987f2c1b5c56a799.js +0 -1
  325. package/assets/esri/core/workers/chunks/77e27f318b5863dd0f5c.js +0 -1
  326. package/assets/esri/core/workers/chunks/7b7f5028a488bb9c10f4.js +0 -1
  327. package/assets/esri/core/workers/chunks/808cfed7022e3846d5b2.js +0 -1
  328. package/assets/esri/core/workers/chunks/8bd5a0ff7dcf1067bf53.js +0 -1
  329. package/assets/esri/core/workers/chunks/99b20eef2893047fac10.js +0 -1
  330. package/assets/esri/core/workers/chunks/9f4e23bae621ff3ecea3.js +0 -1
  331. package/assets/esri/core/workers/chunks/a596d6ccb6103e594031.js +0 -1
  332. package/assets/esri/core/workers/chunks/a5e6359fadbd699b1c8e.js +0 -1
  333. package/assets/esri/core/workers/chunks/a7f3cdd9a249ef4572ce.js +0 -1
  334. package/assets/esri/core/workers/chunks/a80d769b0ed025f0df64.js +0 -1
  335. package/assets/esri/core/workers/chunks/af83dddddbfe25194527.js +0 -1
  336. package/assets/esri/core/workers/chunks/b057e6d593c1607cae61.js +0 -1
  337. package/assets/esri/core/workers/chunks/b1f1a26e7a2ef5b783ee.js +0 -1
  338. package/assets/esri/core/workers/chunks/b605dfdfed8ff8eda4f3.js +0 -1
  339. package/assets/esri/core/workers/chunks/c337c1a2dbc452780dd7.js +0 -1
  340. package/assets/esri/core/workers/chunks/c601bbdafdee5074b04f.js +0 -1
  341. package/assets/esri/core/workers/chunks/c696615cae5daefa2d98.js +0 -1
  342. package/assets/esri/core/workers/chunks/c8694a27e2cf28b010e8.js +0 -1
  343. package/assets/esri/core/workers/chunks/e6457ac25c0829ee039c.js +0 -1
  344. package/assets/esri/core/workers/chunks/eadac757f74470b89a36.js +0 -1
  345. package/assets/esri/core/workers/chunks/f4167fc895d4009df1c7.js +0 -1
  346. package/assets/esri/core/workers/chunks/f76774781865cb1411b0.js +0 -1
  347. package/assets/esri/core/workers/chunks/fd04df45cdcc6ff52554.js +0 -1
  348. package/chunks/TimeExtent.js +0 -5
  349. package/chunks/TimeInterval.js +0 -5
  350. package/graphic/IntegratedMesh3DTilesGraphicOrigin.d.ts +0 -4
  351. package/graphic/IntegratedMesh3DTilesGraphicOrigin.js +0 -5
  352. package/graphic/IntegratedMeshGraphicOrigin.d.ts +0 -4
  353. package/graphic/IntegratedMeshGraphicOrigin.js +0 -5
  354. package/graphic/isIntegratedMesh3DTilesGraphicOrigin.js +0 -5
  355. package/graphic/isIntegratedMeshGraphicOrigin.js +0 -5
  356. package/views/2d/engine/webgl/effects/post-processing/Bloom.js +0 -5
  357. package/views/2d/engine/webgl/effects/post-processing/Blur.js +0 -5
  358. package/views/2d/engine/webgl/effects/post-processing/Colorize.js +0 -5
  359. package/views/2d/engine/webgl/effects/post-processing/DropShadow.js +0 -5
  360. package/views/2d/engine/webgl/effects/post-processing/Opacity.js +0 -5
  361. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointVisualization.js +0 -5
  362. package/views/3d/analysis/ElevationProfile/ElevationProfileHoveredPointsVisualization.js +0 -5
  363. package/views/3d/analysis/ElevationProfile/ElevationProfileInputVisualization.js +0 -5
  364. package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization.js +0 -5
  365. package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization.js +0 -5
  366. package/views/3d/webgl-engine/shaders/FocusAreaColor.glsl.js +0 -5
  367. package/views/3d/webgl-engine/shaders/FocusAreaMask.glsl.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.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as c}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import h from"../geometry/SpatialReference.js";import f from"../graphic/IntegratedMesh3DTilesGraphicOrigin.js";import y from"./Layer.js";import{APIKeyMixin as u}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as L,url as w}from"./support/commonProperties.js";import I from"./support/SceneModifications.js";import{initFullExtent as T}from"./support/tiles3DUtils.js";import{logInvalidElevationInfoWarning as M,elevationModeRequiredMessage as b,featureExpressionUnsupportedMessage as D}from"../support/elevationInfoUtils.js";import{f as O}from"../chunks/persistableUrlUtils.js";let _=class extends(g(v(S(x(r(j(u(y)))))))){readModifications(e,t,i){this._modificationsSource={url:O(e,i),context:i}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new h({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.graphicOrigin=new f(this),this.rootTilesetJSON=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(a){s(a)}if(null!=this._modificationsSource){const t=await I.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data,this.fullExtent=T(this.rootTilesetJSON)},e=>{s(e),o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)});await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},e=>{o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";M(o.getLogger(this),b(t,"absolute-height",e)),M(o.getLogger(this),D(t,e))}get isGroundReplacement(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],_.prototype,"operationalLayerType",void 0),e([l({type:I,clonable:e=>e.clone()}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],_.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],_.prototype,"readModifications",null),e([l({type:h})],_.prototype,"spatialReference",void 0),e([l({type:d})],_.prototype,"fullExtent",void 0),e([l(L)],_.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],_.prototype,"listMode",void 0),e([l(w)],_.prototype,"url",void 0),e([l({readOnly:!0})],_.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],_.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],_.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],_.prototype,"maxScale",void 0),e([l({readOnly:!0})],_.prototype,"graphicOrigin",void 0),_=e([m("esri.layers.IntegratedMesh3DTilesLayer")],_);const R=_;export{R as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import i from"../core/Error.js";import o from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as a,sync as n}from"../core/reactiveUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as c}from"../core/accessorSupport/decorators/persistable.js";import d from"../geometry/Extent.js";import f from"../geometry/SpatialReference.js";import h from"./Layer.js";import{APIKeyMixin as u}from"./mixins/APIKeyMixin.js";import{ArcGISService as y}from"./mixins/ArcGISService.js";import{CustomParametersMixin as g}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as S}from"./mixins/OperationalLayer.js";import{PortalLayer as j}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{elevationInfo as x,url as L}from"./support/commonProperties.js";import w from"./support/SceneModifications.js";import{initFullExtent as I}from"./support/tiles3DUtils.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as b,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as _}from"../chunks/persistableUrlUtils.js";let D=class extends(y(S(j(v(r(g(u(h)))))))){readModifications(e,t,i){this._modificationsSource={url:_(e,i),context:i}}initialize(){this.addHandles(a(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,n))}constructor(e){super(e),this.operationalLayerType="IntegratedMesh3DTilesLayer",this.modifications=null,this._modificationsSource=null,this.spatialReference=new f({wkid:4326,vcsWkid:115700}),this.fullExtent=new d(-180,-90,180,90,this.spatialReference),this.url=null,this.type="integrated-mesh-3dtiles",this.path=null,this.minScale=0,this.maxScale=0,this.rootTilesetJSON=null}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const r=null!=e?e.signal:null;try{await this.loadFromPortal({supportedTypes:["3DTiles Service"],validateItem:e=>{if(e.typeKeywords?.includes("IntegratedMesh"))return!0;throw new i("portal:invalid-layer-item-type","Invalid layer item, expected '${expectedType}' ",{expectedType:"3DTiles Service containing IntegratedMesh"})}},e)}catch(a){s(a)}if(null!=this._modificationsSource){const t=await w.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}if(this.url){const e=t(this.url,{query:{...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(e=>{this.rootTilesetJSON=e.data,this.fullExtent=I(this.rootTilesetJSON)},e=>{s(e),o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)});await e}}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},e=>{o.getLogger("IntegratedMesh3DTilesLayer").error("Layer loading failed",e)})}async fetchAttributionData(){return this.load().then(()=>({}))}_validateElevationInfo(e){const t="Integrated mesh 3d tiles layers";T(o.getLogger(this),b(t,"absolute-height",e)),T(o.getLogger(this),M(t,e))}get isGroundReplacement(){return!!this.url?.match(/.+\.googleapis.com/)}};e([l({type:["IntegratedMesh3DTilesLayer"]})],D.prototype,"operationalLayerType",void 0),e([l({type:w,clonable:e=>e.clone()}),c({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],D.prototype,"modifications",void 0),e([p(["web-scene","portal-item"],"modifications")],D.prototype,"readModifications",null),e([l({type:f})],D.prototype,"spatialReference",void 0),e([l({type:d})],D.prototype,"fullExtent",void 0),e([l(x)],D.prototype,"elevationInfo",null),e([l({type:["show","hide"]})],D.prototype,"listMode",void 0),e([l(L)],D.prototype,"url",void 0),e([l({readOnly:!0})],D.prototype,"type",void 0),e([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],D.prototype,"path",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],D.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],D.prototype,"maxScale",void 0),D=e([m("esri.layers.IntegratedMesh3DTilesLayer")],D);const R=D;export{R as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import c from"../graphic/IntegratedMeshGraphicOrigin.js";import y from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as f}from"./mixins/ArcGISService.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{SceneService as j}from"./mixins/SceneService.js";import{elevationInfo as w}from"./support/commonProperties.js";import{I3SNodePageDefinition as x,I3SMaterialDefinition as L,I3STextureSetDefinition as I,I3SGeometryDefinition as b}from"./support/I3SLayerDefinitions.js";import T from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as _,elevationModeRequiredMessage as O,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as P}from"../chunks/persistableUrlUtils.js";let U=class extends(j(f(g(v(S(r(u(h(t(y)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null,this.graphicOrigin=new c(this)}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:P(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){s(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new o("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";_(i.getLogger(this),O(t,"absolute-height",e)),_(i.getLogger(this),M(t,e))}};e([p({type:String,readOnly:!0})],U.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],U.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],U.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],U.prototype,"type",void 0),e([p({type:x,readOnly:!0,clonable:!1})],U.prototype,"nodePages",void 0),e([p({type:[L],readOnly:!0,clonable:!1})],U.prototype,"materialDefinitions",void 0),e([p({type:[I],readOnly:!0,clonable:!1})],U.prototype,"textureSetDefinitions",void 0),e([p({type:[b],readOnly:!0,clonable:!1})],U.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],U.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:T,clonable:e=>e?.clone()??e}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],U.prototype,"modifications",void 0),e([l(["web-scene","portal-item"],"modifications")],U.prototype,"readModifications",null),e([p(w)],U.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],U.prototype,"path",void 0),e([p({readOnly:!0})],U.prototype,"graphicOrigin",void 0),U=e([m("esri.layers.IntegratedMeshLayer")],U);const D=U;export{D as default};
5
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import o from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{on as n,sync as a}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as l}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{persistable as d}from"../core/accessorSupport/decorators/persistable.js";import c from"./Layer.js";import{APIKeyMixin as y}from"./mixins/APIKeyMixin.js";import{ArcGISService as h}from"./mixins/ArcGISService.js";import{CustomParametersMixin as f}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as u}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as g}from"./mixins/ScaleRangeLayer.js";import{SceneService as S}from"./mixins/SceneService.js";import{elevationInfo as j}from"./support/commonProperties.js";import{I3SNodePageDefinition as w,I3SMaterialDefinition as x,I3STextureSetDefinition as L,I3SGeometryDefinition as I}from"./support/I3SLayerDefinitions.js";import b from"./support/SceneModifications.js";import{logInvalidElevationInfoWarning as T,elevationModeRequiredMessage as _,featureExpressionUnsupportedMessage as M}from"../support/elevationInfoUtils.js";import{f as O}from"../chunks/persistableUrlUtils.js";let P=class extends(S(h(u(v(g(r(f(y(t(c)))))))))){constructor(...e){super(...e),this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this.path=null,this.definitionExpression=null}initialize(){this.addHandles(n(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,a))}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}readModifications(e,t,o){this._modificationsSource={url:O(e,o),context:o}}set elevationInfo(e){null!=e&&"absolute-height"!==e.mode||this._set("elevationInfo",e),this._validateElevationInfo(e)}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const t=e?.signal;try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(o){s(o)}if(await this._fetchService(t),null!=this._modificationsSource){const t=await b.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",t,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,t)}beforeSave(){if(null!=this._modificationsSource)return this.load().then(()=>{},()=>{})}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(0,e)}validateLayer(e){if(e.layerType&&"IntegratedMesh"!==e.layerType)throw new o("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}_validateElevationInfo(e){const t="Integrated mesh layers";T(i.getLogger(this),_(t,"absolute-height",e)),T(i.getLogger(this),M(t,e))}};e([p({type:String,readOnly:!0})],P.prototype,"geometryType",void 0),e([p({type:["show","hide"]})],P.prototype,"listMode",void 0),e([p({type:["IntegratedMeshLayer"]})],P.prototype,"operationalLayerType",void 0),e([p({json:{read:!1},readOnly:!0})],P.prototype,"type",void 0),e([p({type:w,readOnly:!0,clonable:!1})],P.prototype,"nodePages",void 0),e([p({type:[x],readOnly:!0,clonable:!1})],P.prototype,"materialDefinitions",void 0),e([p({type:[L],readOnly:!0,clonable:!1})],P.prototype,"textureSetDefinitions",void 0),e([p({type:[I],readOnly:!0,clonable:!1})],P.prototype,"geometryDefinitions",void 0),e([p({readOnly:!0})],P.prototype,"serviceUpdateTimeStamp",void 0),e([p({type:b,clonable:e=>e?.clone()??e}),d({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],P.prototype,"modifications",void 0),e([l(["web-scene","portal-item"],"modifications")],P.prototype,"readModifications",null),e([p(j)],P.prototype,"elevationInfo",null),e([p({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],P.prototype,"path",void 0),P=e([m("esri.layers.IntegratedMeshLayer")],P);const U=P;export{U as default};
package/layers/Layer.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import{EventedMixin as o}from"../core/Evented.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import{Loadable as s}from"../core/Loadable.js";import a from"../core/Logger.js";import{isAbortError as l}from"../core/promiseUtils.js";import{urlToObject as n}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import{fromPortalItem as c}from"./support/fromPortalItem.js";import{T as m}from"../chunks/TimeExtent.js";let b=0,h=class extends(o(i(s))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new d(-180,-90,180,90,u.WGS84),this.id=Date.now().toString(16)+"-layer-"+b++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=u.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await import("./support/arcgisLayers.js")).fromUrl(t)}static fromPortalItem(e){return c(e)}initialize(){this.when().catch(e=>{l(e)||a.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"groundLayers"in e&&e.groundLayers.includes(t)?e.groundLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}get parsedUrl(){return n(this.url)}createLayerView(e,t){return Promise.reject(new r("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e){return(await t(e,{query:{f:"json"},responseType:"json"})).data}throw new r("layer:no-attribution-data","Layer does not have attribution data")}};e([p({type:String})],h.prototype,"attributionDataUrl",void 0),e([p({readOnly:!0})],h.prototype,"effectiveVisible",null),e([p({type:d})],h.prototype,"fullExtent",void 0),e([p({readOnly:!0})],h.prototype,"hasAttributionData",null),e([p({type:String,clonable:!1})],h.prototype,"id",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"legendEnabled",void 0),e([p({type:["show","hide","hide-children"]})],h.prototype,"listMode",void 0),e([p({type:Number,range:{min:0,max:1},nonNullable:!0})],h.prototype,"opacity",void 0),e([p({clonable:!1})],h.prototype,"parent",void 0),e([p({readOnly:!0})],h.prototype,"parsedUrl",null),e([p({type:Boolean,readOnly:!0})],h.prototype,"persistenceEnabled",void 0),e([p({type:Boolean})],h.prototype,"popupEnabled",void 0),e([p({type:Boolean})],h.prototype,"attributionVisible",void 0),e([p({type:u})],h.prototype,"spatialReference",void 0),e([p({type:String})],h.prototype,"title",void 0),e([p({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),e([p()],h.prototype,"url",void 0),e([p({type:m})],h.prototype,"visibilityTimeExtent",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"visible",void 0),h=e([y("esri.layers.Layer")],h);export{h as default};
5
+ import{__decorate as e}from"tslib";import t from"../request.js";import r from"../core/Error.js";import{EventedMixin as o}from"../core/Evented.js";import{IdentifiableMixin as i}from"../core/Identifiable.js";import{Loadable as s}from"../core/Loadable.js";import a from"../core/Logger.js";import{isAbortError as l}from"../core/promiseUtils.js";import{urlToObject as n}from"../core/urlUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import d from"../geometry/Extent.js";import u from"../geometry/SpatialReference.js";import{fromPortalItem as c}from"./support/fromPortalItem.js";import m from"../time/TimeExtent.js";let b=0,h=class extends(o(i(s))){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new d(-180,-90,180,90,u.WGS84),this.id=Date.now().toString(16)+"-layer-"+b++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.persistenceEnabled=!1,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=u.WGS84,this.title=null,this.type=null,this.url=null,this.visibilityTimeExtent=null,this.visible=!0}static async fromArcGISServerUrl(e){const t="string"==typeof e?{url:e}:e;return(await import("./support/arcgisLayers.js")).fromUrl(t)}static fromPortalItem(e){return c(e)}initialize(){this.when().catch(e=>{l(e)||a.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}destroy(){const e=this.parent;if(e){const t=this;"layers"in e&&e.layers.includes(t)?e.layers.remove(t):"tables"in e&&e.tables.includes(t)?e.tables.remove(t):"baseLayers"in e&&e.baseLayers.includes(t)?e.baseLayers.remove(t):"groundLayers"in e&&e.groundLayers.includes(t)?e.groundLayers.remove(t):"referenceLayers"in e&&e.referenceLayers.includes(t)&&e.referenceLayers.remove(t),this._set("parent",null)}}get effectiveVisible(){let e=this.visible;const t=this.parent;return e&&t&&"effectiveVisible"in t&&(e&&=t.effectiveVisible),e}get hasAttributionData(){return null!=this.attributionDataUrl}get loaded(){return super.loaded}get parsedUrl(){return n(this.url)}createLayerView(e,t){return Promise.reject(new r("layer:create-layer-view","Layer does not support creating a layer view"))}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e){return(await t(e,{query:{f:"json"},responseType:"json"})).data}throw new r("layer:no-attribution-data","Layer does not have attribution data")}};e([p({type:String})],h.prototype,"attributionDataUrl",void 0),e([p({readOnly:!0})],h.prototype,"effectiveVisible",null),e([p({type:d})],h.prototype,"fullExtent",void 0),e([p({readOnly:!0})],h.prototype,"hasAttributionData",null),e([p({type:String,clonable:!1})],h.prototype,"id",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"legendEnabled",void 0),e([p({type:["show","hide","hide-children"]})],h.prototype,"listMode",void 0),e([p({type:Number,range:{min:0,max:1},nonNullable:!0})],h.prototype,"opacity",void 0),e([p({clonable:!1})],h.prototype,"parent",void 0),e([p({readOnly:!0})],h.prototype,"parsedUrl",null),e([p({type:Boolean,readOnly:!0})],h.prototype,"persistenceEnabled",void 0),e([p({type:Boolean})],h.prototype,"popupEnabled",void 0),e([p({type:Boolean})],h.prototype,"attributionVisible",void 0),e([p({type:u})],h.prototype,"spatialReference",void 0),e([p({type:String})],h.prototype,"title",void 0),e([p({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),e([p()],h.prototype,"url",void 0),e([p({type:m})],h.prototype,"visibilityTimeExtent",void 0),e([p({type:Boolean,nonNullable:!0})],h.prototype,"visible",void 0),h=e([y("esri.layers.Layer")],h);export{h as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import i from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as r,isAbortError as l,createAbortError as h}from"../core/promiseUtils.js";import{watch as d,sync as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{idToName as y}from"../core/accessorSupport/PropertyOrigin.js";import g from"../geometry/Extent.js";import m from"../geometry/Point.js";import f from"../geometry/Polyline.js";import w from"./Layer.js";import{convertFromGeometry as L}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as b,systemOriginIdFieldName as M,systemDestinationIdFieldName as k,systemLayoutGeometryFieldName as C,systemAggregationCountFieldName as T}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as N}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as D}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import x from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as v}from"./knowledgeGraph/layerUtils.js";import I from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as E,getRelationshipEndNodeIds as S}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as _}from"./mixins/BlendLayer.js";import{OperationalLayer as A}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as R}from"./mixins/ScaleRangeLayer.js";import{url as j}from"./support/commonProperties.js";import{LCChronologicalLayout as G,LCSimpleLayout as z,LCSmartTreeLayout as P,LCRadialTreeLayout as O,LCHierarchicalLayout as F,LCCommunityLayout as B,LCForceDirectedLayout as U,load as Q}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as W}from"../rest/knowledgeGraphService.js";let $=class extends(A(_(R(s(w))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(a.ofType(x)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new g({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(x)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new i("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(d(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),o.push(r)):"entity"===r.type?t.has(s)||(t.add(s),a.push(r)):(n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))}):(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new D({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=o,this.dataManager=s}load(e){const a=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await v(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise(e=>{a.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(i=>{W(this.url).then(async n=>{n.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),n.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const s=this.linkChart?.linkChartProperties;if(6===s?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:s?.entitiesUrl,relationshipsUrl:s?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:s?.layoutSettings??void 0,layoutMode:E(s.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const e=I.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);if(a){o(this.dataManager.sublayerCaches,t,()=>new Map).set(i.id,a)}}await a()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then(async()=>{r(e),await a()}))}i(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):n.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await S(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new i("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new i("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,()=>new Set);const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await v(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const r of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id))&&n.push(r);if(t){const e=new Set,t=[];for(const a of n)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const r of n)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);const o=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:o}),n.length>0&&(this.membershipModified=!0);const s=[];return this.layers.forEach(e=>{s.push(e.refreshCachedQueryEngine())}),await Promise.all(s),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),r(t?.signal)}catch(i){throw l(i)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),i}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const a=o(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:L(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}})})}async calculateLinkChartLayout(e="organic-standard",t){const a=[],s=[],l=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{a.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{s.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const d=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(a.length),w=new Float64Array(a.length),N=new Float64Array(a.length),D=new Float64Array(a.length),x=new Float64Array(a.length),v=new Uint32Array(s.length),I=new Uint32Array(s.length),E=new Float64Array(s.length),S=new Float64Array(s.length),_=[],A="organic-standard";let R=!1;const j=new g({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let W,$="organic-standard",H=0,K=0;const V=G.apply;switch($="geographic-organic-standard"===e?A:e,$){case"organic-standard":W=U.apply;break;case"organic-community":W=B.apply;break;case"hierarchical-bottom-to-top":W=F.apply;break;case"radial-root-centric":W=O.apply;break;case"tree-left-to-right":W=P.apply;break;default:W=z.apply}let q=!1;a.forEach(({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[b])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?y[H]=2:y[H]=0;const n=t.lockedNodeLocations.get(i.attributes[b]);w[H]=n.x,N[H]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){y[H]=2;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":w[H]=t?.x,N[H]=t?.y;break;case"esriGeometryPolygon":e=t?.centroid,null!=e?.x&&null!=e?.y?(w[H]=e.x,N[H]=e.y):y[H]=1;break;case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(w[H]=e.x,N[H]=e.y):y[H]=1;break;default:y[H]=1}(null==w[H]||null==N[H]||Number.isNaN(w[H])||Number.isNaN(N[H]))&&(y[H]=1,w[H]=0,N[H]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!q&&t?.lockedNodeLocations?.has(i.attributes[b])&&(q=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;D[H]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;x[H]=r?new Date(r).getTime():NaN,w[H]=0,N[H]=0,y[H]=1}else y[H]=1,w[H]=0,N[H]=0;u.set(i.attributes[b],H),_[H]={feature:i,typeName:a},H++}),q&&n.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let J=!1;const X=new Map;s.forEach(a=>{const i=a.feature.attributes[M],n=a.feature.attributes[k],o=u.get(i),s=u.get(n),r=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?r?.startField:null,d=h?a.feature.attributes[h]:null,p=r?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==s){let t=i+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const r=X.get(t),h=r?.has(a.typeName);h||(v[K]=o,I[K]=s,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(E[K]=d?new Date(d).getTime():NaN,S[K]=c?new Date(c).getTime():NaN),void 0===r?X.set(t,new Map([[a.typeName,K]])):r.set(a.typeName,K),K++),l.push(a)}else J=!0,this.relationshipLinkChartDiagramLookup.set(i,null)}),J&&n.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const Y=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),Z=this._convertValidatedOrganicSettingsToCalculationSettings(Y);await Q();let ee=1,te=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:ee,links:te,graphics:a}=V(()=>t?.signal?.aborted??!1,y,w,N,D,x,v.subarray(0,K),I.subarray(0,K),E.subarray(0,K),S.subarray(0,K),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===ee&&(this.chronologicalAuxiliaryGraphics=a)}else({status:ee,links:te}=W(()=>t?.signal?.aborted??!1,y,w,N,v.subarray(0,K),I.subarray(0,K),Z.computationBudgetTime,Z.idealEdgeLengthMultiplier,Z.repulsionRadiusMultiplier));if(r(t?.signal),1===ee)throw new i("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===ee)throw h();for(let i=0;i<_.length;i++){if(N[i]>84.9999?N[i]=84.9999:N[i]<-84.9999&&(N[i]=-84.9999),w[i]>179.9999?w[i]=179.9999:w[i]<-179.9999&&(w[i]=-179.9999),_[i].feature.attributes[C]=new m(w[i],N[i]),d.has(_[i].typeName)){const e=d.get(_[i].typeName);e?.set(_[i].feature.attributes[b],_[i].feature)}else{const e=new Map;e.set(_[i].feature.attributes[b],_[i].feature),d.set(_[i].typeName,e)}c.set(_[i].feature.attributes[b],_[i].feature);const e=L(_[i].feature.attributes[C]);this.entityLinkChartDiagramLookup.set(_[i].feature.attributes[b],_[i].feature.attributes[C]?e:null);const t=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,_[i].typeName,()=>({useAllData:!1,members:new Map}));o(t.members,_[i].feature.attributes[b],()=>({id:_[i].feature.attributes[b],linkChartLocation:void 0})).linkChartLocation=_[i].feature.attributes[C];const{x:a,y:n}=_[i].feature.attributes[C];if(R)j.xmin=Math.min(j.xmin,a),j.xmax=Math.max(j.xmax,a),j.ymin=Math.min(j.ymin,n),j.ymax=Math.max(j.ymax,n);else{const e=1e-7;j.xmin=a-e,j.xmax=a+e,j.ymin=n-e,j.ymax=n+e,R=!0}}if(this.linkChartExtent.xmin=j.xmin,this.linkChartExtent.xmax=j.xmax,this.linkChartExtent.ymin=j.ymin,this.linkChartExtent.ymax=j.ymax,!te)throw new i("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ae=new Map,ie=new Map,ne=new Map,oe=new Set;for(let i=0;i<l.length;i++){const a=[],s=l[i],r=s.feature.attributes[M],h=s.feature.attributes[k];let d=r+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?s.feature.attributes[a]:null,n=e?.endField;d+="-"+i+"-"+(n?s.feature.attributes[n]:null)}const y=X.get(d).get(s.typeName),g=0===y?0:te?.vertexEndIndex[y-1];if(!oe.has(y)){if(oe.add(y),2===te.types[y]){const e=[te.vertices[2*g],te.vertices[2*g+1]],t=[te.vertices[2*(g+1)],te.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],s=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(s),a.push(e)}else{if(0!==te.types[y]){n.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<te.vertexEndIndex[y];e++)a.push([te.vertices[2*e],te.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=_[u.get(r)]?.feature.attributes[C],t=_[u.get(h)]?.feature.attributes[C];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);ae.has(d)?ae.get(d).push(a):ae.set(d,[a])}const m=ae.get(d);ie.has(d)||(ie.set(d,new Map),ne.set(d,new Map));const w=ie.get(d),T=ne.get(d);w.has(s.typeName)||(w.set(s.typeName,m.shift()),T.set(s.typeName,0));const N=w.get(s.typeName);T.set(s.typeName,T.get(s.typeName)+1);const D=new f({paths:[N]});if(s.feature.attributes[C]=D,p.has(s.typeName)){const e=p.get(s.typeName);e?.set(s.feature.attributes[b],s.feature)}else{const e=new Map;e.set(s.feature.attributes[b],s.feature),p.set(s.typeName,e)}c.set(s.feature.attributes[b],s.feature);const x=L(s.feature.attributes[C]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[b],s.feature.attributes[C]?x:null);const v=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,s.typeName,()=>({useAllData:!1,members:new Map}));o(v.members,s.feature.attributes[b],()=>({id:s.feature.attributes[b],linkChartLocation:void 0})).linkChartLocation=x}for(const i of l)i.feature.attributes[T]=ne.get(i.feature.attributes[M]+"-"+i.feature.attributes[k])?.get(i.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:d,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(e=>{a.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach(t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new m({x:i.x,y:i.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach(e=>{a.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=new Set,i=[],n=this.layers.concat(this.tables);for(const r of e){if(!this._graphTypeLookup.has(r.typeName))continue;!1===n.some(e=>e.objectType.name===r.typeName)&&(this.dataManager.sublayerCaches.set(r.typeName,new Map),a.add(r.typeName));o(this.sublayerIdsCache,r.typeName,()=>new Set).add(r.id),i.push(r)}this.dataManager.addToLayer(i);for(const o of a){const e=this._graphTypeLookup.get(o);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(o):this.dataManager.relationshipTypeNames.add(o),t.geometryType?this.layers.push(t):this.tables.push(t)}}await v(this,Array.from(a),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const s={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[o,r]of this.entityLinkChartDiagramLookup.entries())r&&s.lockedNodeLocations.set(o,new m(r.coords[0],r.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,s)}_createSublayers(e,t,a){e.forEach(e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const a=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=L(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[M]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[k]);if(t&&a){const i=L(new f({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[b],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[b],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,s=e=>Object.values(N).includes(e),r=e=>a(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return o(h)?l.computationBudgetTime=h:h&&n.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&i(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,n.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(s(y)?l.idealEdgeLengthType=y:void 0!==y&&n.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&r(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&r(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===N.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===N.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new x({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),i=new Set((e.entityTypes??[]).map(e=>e.name)),o=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const a of this.layers)!a.graphType&&t.has(a.graphTypeName)&&(a.graphType=i.has(a.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):o.has(e.graphTypeName)));this.setAtOrigin("layers",e,y(this.originIdOf("layers")))}else this.layers=new a;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],a=this.layers.map(e=>e.graphTypeName).concat(t);for(const n of a)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const i=[];for(const o of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(o)||(n.getLogger(this).warn(`A named type, ${o}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(o));for(const n of i)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([c(j)],$.prototype,"url",void 0),e([c()],$.prototype,"dataPreloadedInLocalCache",void 0),e([c()],$.prototype,"initializationLinkChartConfig",void 0),e([c()],$.prototype,"membershipModified",void 0),e([c()],$.prototype,"dataManager",void 0),e([c()],$.prototype,"initializationInclusionModeDefinition",null),e([c()],$.prototype,"knowledgeGraph",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],$.prototype,"layers",void 0),e([c({readOnly:!0})],$.prototype,"linkChart",null),e([c()],$.prototype,"entityLinkChartDiagramLookup",void 0),e([c()],$.prototype,"relationshipLinkChartDiagramLookup",void 0),e([c()],$.prototype,"linkChartExtent",void 0),e([c()],$.prototype,"memberEntityTypes",void 0),e([c()],$.prototype,"memberRelationshipTypes",void 0),e([c({type:["LinkChartLayer"]})],$.prototype,"operationalLayerType",void 0),e([c()],$.prototype,"sublayerIdsCache",void 0),e([c({type:a.ofType(x),json:{write:{ignoreOrigin:!0}}})],$.prototype,"tables",void 0),e([c({json:{read:!1}})],$.prototype,"type",void 0),e([c({json:{read:!1}})],$.prototype,"chronologicalAuxiliaryGraphics",void 0),$=e([u("esri.layers.LinkChartLayer")],$);const H=$;export{H as default};
5
+ import{__decorate as e}from"tslib";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import i from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as r,isAbortError as l,createAbortError as h}from"../core/promiseUtils.js";import{watch as d,sync as p}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{idToName as y}from"../core/accessorSupport/PropertyOrigin.js";import g from"../geometry/Extent.js";import m from"../geometry/Point.js";import f from"../geometry/Polyline.js";import{polygonCentroidPoint as w}from"../geometry/support/centroid.js";import L from"./Layer.js";import{convertFromGeometry as b}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as k,systemDestinationIdFieldName as C,systemLayoutGeometryFieldName as T,systemAggregationCountFieldName as N}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as D}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as x}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import v from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{initializeLayersFromClientData as I}from"./knowledgeGraph/layerUtils.js";import E from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as S,getRelationshipEndNodeIds as _}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as A}from"./mixins/BlendLayer.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as j}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{LCChronologicalLayout as z,LCSimpleLayout as O,LCSmartTreeLayout as P,LCRadialTreeLayout as F,LCHierarchicalLayout as B,LCCommunityLayout as U,LCForceDirectedLayout as Q,load as W}from"../libs/linkchartlayout/LinkChartLayout.js";import{fetchKnowledgeGraph as $}from"../rest/knowledgeGraphService.js";let H=class extends(R(A(j(s(L))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(a.ofType(v)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new g({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(v)),this.type="link-chart",this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new i("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(d(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),p))}normalizeCtorArgs(e){if(!e)return{};const{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}=e;return{url:t,title:a,dataPreloadedInLocalCache:i,initializationLinkChartConfig:n}}_initializeLayerProperties(e){if(!this.title&&this.url){const e=this.url.split("/");this.title=e[e.length-2]}const t=new Set;let a=[],o=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new i("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((i,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),o.push(r)):"entity"===r.type?t.has(s)||(t.add(s),a.push(r)):(n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))}):(a=e.knowledgeGraph.dataModel.entityTypes??[],o=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new x({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=a,this.memberRelationshipTypes=o,this.dataManager=s}load(e){const a=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await I(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(a=>{t.push(a.refreshCachedQueryEngine()),e.push(new Promise(e=>{a.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(i=>{$(this.url).then(async n=>{n.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),n.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const s=this.linkChart?.linkChartProperties;if(6===s?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:s?.entitiesUrl,relationshipsUrl:s?.relationshipsUrl}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:s?.layoutSettings??void 0,layoutMode:S(s.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})})),this.dataPreloadedInLocalCache){const e=E.getInstance();for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const i of a.members?.values()??[]){const a=e.readFromStoreById(`${t}__${i.id}`);if(a){o(this.dataManager.sublayerCaches,t,()=>new Map).set(i.id,a)}}await a()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then(async()=>{r(e),await a()}))}i(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):n.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}async addRecords(e,t){let a=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(a=await _(e,this.dataManager.knowledgeGraph));const i=e.concat(a).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));i.length>0&&(this.membershipModified=!0),await this._handleNewRecords(i,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new i("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new i("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,()=>new Set);const a=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),a.geometryType?this.layers.push(a):this.tables.push(a),await I(this,[e]),this._refreshNamedTypes(),a}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:a=!1,overrideMembershipCheck:i=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const r of e)(i||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(r.typeName)?.members?.has(r.id))&&n.push(r);if(t){const e=new Set,t=[];for(const a of n)if(this.dataManager.nodeConnectionsLookup.has(a.id))for(const t of this.dataManager.nodeConnectionsLookup.get(a.id))e.add(t);for(const a of e)if(this.dataManager.memberIdTypeLookup.has(a))for(const e of this.dataManager.memberIdTypeLookup.get(a))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:a,typeName:e});n=n.concat(t)}this.dataManager.removeFromLayer(n);for(const r of n)this.sublayerIdsCache.get(r.typeName)?.delete(r.id),this.dataManager.relationshipTypeNames.has(r.typeName)?this.relationshipLinkChartDiagramLookup.delete(r.id):this.entityLinkChartDiagramLookup.delete(r.id);const o=a?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:o}),n.length>0&&(this.membershipModified=!0);const s=[];return this.layers.forEach(e=>{s.push(e.refreshCachedQueryEngine())}),await Promise.all(s),this._refreshNamedTypes(),n}async expand(e,t){let a=[];try{const i=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);a=i.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(a,t),i.length>0&&(this.membershipModified=!0),r(t?.signal)}catch(i){throw l(i)&&a.length>0&&await this.removeRecords(a,{overrideMembershipCheck:!0}),i}return{records:a}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const a=o(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:i})=>{if(a.add(e),i){const a="coords"in i&&"lengths"in i?i:b(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,a):this.entityLinkChartDiagramLookup.set(e,a)}})})}async calculateLinkChartLayout(e="organic-standard",t){const a=[],s=[],l=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{a.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{s.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const d=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(a.length),L=new Float64Array(a.length),D=new Float64Array(a.length),x=new Float64Array(a.length),v=new Float64Array(a.length),I=new Uint32Array(s.length),E=new Uint32Array(s.length),S=new Float64Array(s.length),_=new Float64Array(s.length),A=[],R="organic-standard";let j=!1;const G=new g({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let $,H="organic-standard",K=0,J=0;const V=z.apply;switch(H="geographic-organic-standard"===e?R:e,H){case"organic-standard":$=Q.apply;break;case"organic-community":$=U.apply;break;case"hierarchical-bottom-to-top":$=B.apply;break;case"radial-root-centric":$=F.apply;break;case"tree-left-to-right":$=P.apply;break;default:$=O.apply}let q=!1;a.forEach(({typeName:a,feature:i})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedNodeLocations?.has(i.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)?y[K]=2:y[K]=0;const n=t.lockedNodeLocations.get(i.attributes[M]);L[K]=n.x,D[K]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(a)){y[K]=2;let e=null;const t=i.attributes[this.dataManager.geographicLookup.get(a).name],n=this.dataManager.geographicLookup.get(a)?.geometryType;switch(n){case"esriGeometryPoint":L[K]=t?.x,D[K]=t?.y;break;case"esriGeometryPolygon":{const a=w(t);e=a?m.fromJSON(a):null,null!=e?.x&&null!=e?.y?(L[K]=e.x,D[K]=e.y):y[K]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(L[K]=e.x,D[K]=e.y):y[K]=1;break;default:y[K]=1}(null==L[K]||null==D[K]||Number.isNaN(L[K])||Number.isNaN(D[K]))&&(y[K]=1,L[K]=0,D[K]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!q&&t?.lockedNodeLocations?.has(i.attributes[M])&&(q=!0);const e=t?.timeInfoByTypeName?.get(a),n=e?.startField,o=n&&e?.startField?i.attributes[n]:null;x[K]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?i.attributes[s]:null;v[K]=r?new Date(r).getTime():NaN,L[K]=0,D[K]=0,y[K]=1}else y[K]=1,L[K]=0,D[K]=0;u.set(i.attributes[M],K),A[K]={feature:i,typeName:a},K++}),q&&n.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let X=!1;const Y=new Map;s.forEach(a=>{const i=a.feature.attributes[k],n=a.feature.attributes[C],o=u.get(i),s=u.get(n),r=t?.timeInfoByTypeName?.get(a.typeName),h=t?.timeInfoByTypeName?r?.startField:null,d=h?a.feature.attributes[h]:null,p=r?.endField,c=p?a.feature.attributes[p]:null;if(void 0!==o&&void 0!==s){let t=i+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const r=Y.get(t),h=r?.has(a.typeName);h||(I[J]=o,E[J]=s,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(S[J]=d?new Date(d).getTime():NaN,_[J]=c?new Date(c).getTime():NaN),void 0===r?Y.set(t,new Map([[a.typeName,J]])):r.set(a.typeName,J),J++),l.push(a)}else X=!0,this.relationshipLinkChartDiagramLookup.set(i,null)}),X&&n.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const Z=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),ee=this._convertValidatedOrganicSettingsToCalculationSettings(Z);await W();let te=1,ae=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let a;({status:te,links:ae,graphics:a}=V(()=>t?.signal?.aborted??!1,y,L,D,x,v,I.subarray(0,J),E.subarray(0,J),S.subarray(0,J),_.subarray(0,J),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===te&&(this.chronologicalAuxiliaryGraphics=a)}else({status:te,links:ae}=$(()=>t?.signal?.aborted??!1,y,L,D,I.subarray(0,J),E.subarray(0,J),ee.computationBudgetTime,ee.idealEdgeLengthMultiplier,ee.repulsionRadiusMultiplier));if(r(t?.signal),1===te)throw new i("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===te)throw h();for(let i=0;i<A.length;i++){if(D[i]>84.9999?D[i]=84.9999:D[i]<-84.9999&&(D[i]=-84.9999),L[i]>179.9999?L[i]=179.9999:L[i]<-179.9999&&(L[i]=-179.9999),A[i].feature.attributes[T]=new m(L[i],D[i]),d.has(A[i].typeName)){const e=d.get(A[i].typeName);e?.set(A[i].feature.attributes[M],A[i].feature)}else{const e=new Map;e.set(A[i].feature.attributes[M],A[i].feature),d.set(A[i].typeName,e)}c.set(A[i].feature.attributes[M],A[i].feature);const e=b(A[i].feature.attributes[T]);this.entityLinkChartDiagramLookup.set(A[i].feature.attributes[M],A[i].feature.attributes[T]?e:null);const t=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,A[i].typeName,()=>({useAllData:!1,members:new Map}));o(t.members,A[i].feature.attributes[M],()=>({id:A[i].feature.attributes[M],linkChartLocation:void 0})).linkChartLocation=A[i].feature.attributes[T];const{x:a,y:n}=A[i].feature.attributes[T];if(j)G.xmin=Math.min(G.xmin,a),G.xmax=Math.max(G.xmax,a),G.ymin=Math.min(G.ymin,n),G.ymax=Math.max(G.ymax,n);else{const e=1e-7;G.xmin=a-e,G.xmax=a+e,G.ymin=n-e,G.ymax=n+e,j=!0}}if(this.linkChartExtent.xmin=G.xmin,this.linkChartExtent.xmax=G.xmax,this.linkChartExtent.ymin=G.ymin,this.linkChartExtent.ymax=G.ymax,!ae)throw new i("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ie=new Map,ne=new Map,oe=new Map,se=new Set;for(let i=0;i<l.length;i++){const a=[],s=l[i],r=s.feature.attributes[k],h=s.feature.attributes[C];let d=r+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(s.typeName),a=t?.timeInfoByTypeName?e?.startField:null,i=a?s.feature.attributes[a]:null,n=e?.endField;d+="-"+i+"-"+(n?s.feature.attributes[n]:null)}const y=Y.get(d).get(s.typeName),g=0===y?0:ae?.vertexEndIndex[y-1];if(!se.has(y)){if(se.add(y),2===ae.types[y]){const e=[ae.vertices[2*g],ae.vertices[2*g+1]],t=[ae.vertices[2*(g+1)],ae.vertices[2*(g+1)+1]],i=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[i[0]-e[0],i[1]-e[1]],o=[i[0]+n[1],i[1]-n[0]],s=[i[0]-n[1],i[1]+n[0]];a.push(e),a.push(o),a.push(t),a.push(s),a.push(e)}else{if(0!==ae.types[y]){n.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ae.vertexEndIndex[y];e++)a.push([ae.vertices[2*e],ae.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=A[u.get(r)]?.feature.attributes[T],t=A[u.get(h)]?.feature.attributes[T];a[0][0]===e.x&&a[0][1]===e.y||(a[0]=[e.x,e.y]),a[a.length-1][0]===t.x&&a[a.length-1][1]===t.y||(a[a.length-1]=[t.x,t.y])}for(let e=1;e<a.length-1;e++)a[e][1]>85.5?a[e][1]=85.5:a[e][1]<-85.5&&(a[e][1]=-85.5),a[e][0]>179.9999?a[e][0]=179.9999:a[e][0]<-179.9999&&(a[e][0]=-179.9999);ie.has(d)?ie.get(d).push(a):ie.set(d,[a])}const m=ie.get(d);ne.has(d)||(ne.set(d,new Map),oe.set(d,new Map));const w=ne.get(d),L=oe.get(d);w.has(s.typeName)||(w.set(s.typeName,m.shift()),L.set(s.typeName,0));const N=w.get(s.typeName);L.set(s.typeName,L.get(s.typeName)+1);const D=new f({paths:[N]});if(s.feature.attributes[T]=D,p.has(s.typeName)){const e=p.get(s.typeName);e?.set(s.feature.attributes[M],s.feature)}else{const e=new Map;e.set(s.feature.attributes[M],s.feature),p.set(s.typeName,e)}c.set(s.feature.attributes[M],s.feature);const x=b(s.feature.attributes[T]);this.relationshipLinkChartDiagramLookup.set(s.feature.attributes[M],s.feature.attributes[T]?x:null);const v=o(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,s.typeName,()=>({useAllData:!1,members:new Map}));o(v.members,s.feature.attributes[M],()=>({id:s.feature.attributes[M],linkChartLocation:void 0})).linkChartLocation=x}for(const i of l)i.feature.attributes[N]=oe.get(i.feature.attributes[k]+"-"+i.feature.attributes[C])?.get(i.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:d,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){const a=[];await this._calculateLayoutWithSublayerTimeInfo(e,t),this.layers.forEach(e=>{a.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(a),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,a]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||a?.members?.forEach(t=>{const a=t.linkChartLocation;let i;const n=t.id;a&&(i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]},e.set(n,new m({x:i.x,y:i.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}a=await this.dataManager.getRelationshipsBetweenNodes(e,i,t),await this._handleNewRecords(a,t),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let a=[];try{let i=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(i=i.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}a=await this.dataManager.getRelationshipsFromNodes(e,n,i,t),await this._handleNewRecords(a,t),a.length>0&&(this.membershipModified=!0),r(t)}catch(i){throw l(i)&&this.removeRecords(a),i}return{records:a}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const a=new Map;this.layers.forEach(e=>{a.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:a,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const a=new Set,i=[],n=this.layers.concat(this.tables);for(const r of e){if(!this._graphTypeLookup.has(r.typeName))continue;!1===n.some(e=>e.objectType.name===r.typeName)&&(this.dataManager.sublayerCaches.set(r.typeName,new Map),a.add(r.typeName));o(this.sublayerIdsCache,r.typeName,()=>new Set).add(r.id),i.push(r)}this.dataManager.addToLayer(i);for(const o of a){const e=this._graphTypeLookup.get(o);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(o):this.dataManager.relationshipTypeNames.add(o),t.geometryType?this.layers.push(t):this.tables.push(t)}}await I(this,Array.from(a),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const s={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedNodeLocations:new Map};for(const[o,r]of this.entityLinkChartDiagramLookup.entries())r&&s.lockedNodeLocations.set(o,new m(r.coords[0],r.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,s)}_createSublayers(e,t,a){e.forEach(e=>{const i=this._createSublayer(e);a(i)&&t.push(i),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const a=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);a&&(t.objectType=a,t.read({title:a.name},{origin:"service"}),this._updateSublayerCaches(a))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const a=e.linkChartLocation;let i;const n=e.id;if(!a)return;i="x"in a?{x:a.x,y:a.y}:{x:a.coords[0],y:a.coords[1]};const o=b(i);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>i.x&&(this.linkChartExtent.xmin=i.x),this.linkChartExtent.xmax<i.x&&(this.linkChartExtent.xmax=i.x),this.linkChartExtent.ymin>i.y&&(this.linkChartExtent.ymin=i.y),this.linkChartExtent.ymax<i.y&&(this.linkChartExtent.ymax=i.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[k]),a=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]);if(t&&a){const i=b(new f({paths:[[[t.coords[0],t.coords[1]],[a.coords[0],a.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],i)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedNodeLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedNodeLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const a=e=>"number"==typeof e&&!isNaN(e),i=e=>a(e)&&e>=1,o=e=>a(e)&&e>=1,s=e=>Object.values(D).includes(e),r=e=>a(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return o(h)?l.computationBudgetTime=h:h&&n.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&i(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,n.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(s(y)?l.idealEdgeLengthType=y:void 0!==y&&n.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&r(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&r(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&n.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===D.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===D.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new v({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),i=new Set((e.entityTypes??[]).map(e=>e.name)),o=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const a of this.layers)!a.graphType&&t.has(a.graphTypeName)&&(a.graphType=i.has(a.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?i.has(e.graphTypeName):o.has(e.graphTypeName)));this.setAtOrigin("layers",e,y(this.originIdOf("layers")))}else this.layers=new a;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],a=this.layers.map(e=>e.graphTypeName).concat(t);for(const n of a)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const i=[];for(const o of this._originalInclusionList.namedTypeDefinitions.keys())a.includes(o)||(n.getLogger(this).warn(`A named type, ${o}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),i.push(o));for(const n of i)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([c(G)],H.prototype,"url",void 0),e([c()],H.prototype,"dataPreloadedInLocalCache",void 0),e([c()],H.prototype,"initializationLinkChartConfig",void 0),e([c()],H.prototype,"membershipModified",void 0),e([c()],H.prototype,"dataManager",void 0),e([c()],H.prototype,"initializationInclusionModeDefinition",null),e([c()],H.prototype,"knowledgeGraph",void 0),e([c({type:a.ofType(v),json:{write:{ignoreOrigin:!0}}})],H.prototype,"layers",void 0),e([c({readOnly:!0})],H.prototype,"linkChart",null),e([c()],H.prototype,"entityLinkChartDiagramLookup",void 0),e([c()],H.prototype,"relationshipLinkChartDiagramLookup",void 0),e([c()],H.prototype,"linkChartExtent",void 0),e([c()],H.prototype,"memberEntityTypes",void 0),e([c()],H.prototype,"memberRelationshipTypes",void 0),e([c({type:["LinkChartLayer"]})],H.prototype,"operationalLayerType",void 0),e([c()],H.prototype,"sublayerIdsCache",void 0),e([c({type:a.ofType(v),json:{write:{ignoreOrigin:!0}}})],H.prototype,"tables",void 0),e([c({json:{read:!1}})],H.prototype,"type",void 0),e([c({json:{read:!1}})],H.prototype,"chronologicalAuxiliaryGraphics",void 0),H=e([u("esri.layers.LinkChartLayer")],H);const K=H;export{K as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Error.js";import{loadAll as s}from"../core/loadAll.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{debounce as o,throwIfAbortError as a,isAbortError as p}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as n,inchesPerMeter as m}from"../core/unitUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import{nameToId as h}from"../core/accessorSupport/PropertyOrigin.js";import f from"../geometry/Extent.js";import{getScale as g}from"../geometry/support/scaleUtils.js";import{srToRESTValue as v}from"../geometry/support/spatialReferenceUtils.js";import b from"./Layer.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISMapService as j}from"./mixins/ArcGISMapService.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as I}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as U}from"./mixins/SublayersOwner.js";import{TemporalLayer as E}from"./mixins/TemporalLayer.js";import{url as M}from"./support/commonProperties.js";import{ExportImageParameters as R}from"./support/ExportImageParameters.js";import{createBitmap as F}from"./support/imageBitmapUtils.js";import _ from"./support/Sublayer.js";import{shouldWriteSublayerStructure as A}from"./support/sublayerUtils.js";import{serviceSupportsSpatialReference as N}from"./support/versionUtils.js";import J from"../symbols/support/ElevationInfo.js";import{T as q}from"../chunks/TimeExtent.js";import{timeZoneProperty as k}from"../time/timeZoneUtils.js";let G=class extends(I(E(T(U(j(S(O(L(i(P(x(w(b))))))))))))){constructor(...e){super(...e),this._exportImageParameters=new R({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.elevationInfo=new J({mode:"on-the-ground"}),this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null,this._debouncedSaveOperations=o(async(e,r,t)=>{const{save:s,saveAs:i}=await import("./save/mapImageLayerUtils.js");switch(e){case 0:return s(this,r);case 1:return i(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(a).then(()=>this._fetchService(r))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.includes("PNG32")?"png32":"png24"}get loaded(){return super.loaded}set portalItem(e){super.portalItem=e}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray();let o=!1;const a=h(s.origin);let p;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers)if(3===a){const e=this.createSublayersForOrigin("service").sublayers;o=A(i,e,2)}else if(a>3){const e=this.createSublayersForOrigin("portal-item");o=A(i,e.sublayers,h(e.origin)),p=e.originWithPartialOverrides}const n=[],m={writeSublayerStructure:o,...s,minimumWritableOrigin:p};let l=o||this.hasVisibleLayersForOrigin(a);i.forEach(e=>{const r=e.write({},m);n.push(r),l=l||"user"===e.originOf("visible")});n.some(e=>Object.keys(e).length>1)&&(r.layers=n),l&&(r.visibleLayers=i.filter(e=>e.visible).map(e=>e.id))}createExportImageParameters(e,r,t,s){const i=s?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=s?.floors??null,this._exportImageParameters.scale=s?.scale||g({extent:e,width:r})*i;const o=this._exportImageParameters.toJSON(),a=!s?.rotation||this.version<10.3?{}:{rotation:-s.rotation},p=e?.spatialReference,l=v(p);if(s?.scale&&e){const t=e.width/r*(n(e?.spatialReference)*m);o.dpi=s.scale/t}o.dpi*=i;const c={};if(s?.timeExtent){const{start:e,end:r}=s.timeExtent.toJSON();c.time=e&&r&&e===r?""+e:`${e??"null"},${r??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(c.time="null,null");return{bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:void 0,bboxSR:l,imageSR:l,size:r+","+t,...o,...a,...c}}async fetchImage(e,r,t,s){const{data:i}=await this._fetchImage("image",e,r,t,s);return i}async fetchImageBitmap(e,r,t,s){const{data:i,url:o}=await this._fetchImage("blob",e,r,t,s);return F(i,o,s?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:s}=await r(this.url,t),{extent:i,fullExtent:o,timeExtent:a}=s,p=i||o;return{fullExtent:p&&f.fromJSON(p),timeExtent:a&&q.fromJSON({start:a[0],end:a[1]})}}loadAll(){return s(this,e=>{e(this.allSublayers),e(this.subtables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return N(this,e)}async _fetchImage(e,s,i,o,a){const n={responseType:e,signal:a?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(s,i,o,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},m=this.parsedUrl.path+"/export";if(null!=n.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new t("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:e}=await r(m,n);return{data:e,url:m}}catch(l){if(p(l))throw l;throw new t("mapimagelayer:image-fetch-error",`Unable to load image: ${m}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:s}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});s&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(e){return!(null==e||!this.sublayersSourceJSON[e]?.visibleLayers)}};e([l(k("dateFieldsTimeReference"))],G.prototype,"dateFieldsTimeZone",void 0),e([l({type:Boolean})],G.prototype,"datesInUnknownTimezone",void 0),e([l()],G.prototype,"dpi",void 0),e([l()],G.prototype,"elevationInfo",void 0),e([l()],G.prototype,"gdbVersion",void 0),e([l()],G.prototype,"imageFormat",void 0),e([u("imageFormat",["supportedImageFormatTypes"])],G.prototype,"readImageFormat",null),e([l({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],G.prototype,"imageMaxHeight",void 0),e([l({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],G.prototype,"imageMaxWidth",void 0),e([l()],G.prototype,"imageTransparency",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],G.prototype,"isReference",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"labelsVisible",void 0),e([l({type:["ArcGISMapServiceLayer"]})],G.prototype,"operationalLayerType",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"popupEnabled",void 0),e([l(k("preferredTimeReference"))],G.prototype,"preferredTimeZone",void 0),e([l()],G.prototype,"sourceJSON",void 0),e([l({json:{write:{ignoreOrigin:!0}}})],G.prototype,"sublayers",void 0),e([y("sublayers",{layers:{type:[_]},visibleLayers:{type:[c]}})],G.prototype,"writeSublayers",null),e([l({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],G.prototype,"listMode",void 0),e([l({json:{read:!1},readOnly:!0,value:"map-image"})],G.prototype,"type",void 0),e([l(M)],G.prototype,"url",void 0),G=e([d("esri.layers.MapImageLayer")],G);const V=G;export{V as default};
5
+ import{__decorate as e}from"tslib";import r from"../request.js";import t from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{debounce as o,throwIfAbortError as a,isAbortError as p}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as n,inchesPerMeter as m}from"../core/unitUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as c}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as u}from"../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as y}from"../core/accessorSupport/decorators/writer.js";import{nameToId as h}from"../core/accessorSupport/PropertyOrigin.js";import f from"../geometry/Extent.js";import{getScale as g}from"../geometry/support/scaleUtils.js";import{srToRESTValue as v}from"../geometry/support/spatialReferenceUtils.js";import b from"./Layer.js";import{APIKeyMixin as x}from"./mixins/APIKeyMixin.js";import{ArcGISMapService as j}from"./mixins/ArcGISMapService.js";import{ArcGISService as S}from"./mixins/ArcGISService.js";import{BlendLayer as I}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as T}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as U}from"./mixins/SublayersOwner.js";import{TemporalLayer as E}from"./mixins/TemporalLayer.js";import{url as M}from"./support/commonProperties.js";import{ExportImageParameters as R}from"./support/ExportImageParameters.js";import{createBitmap as F}from"./support/imageBitmapUtils.js";import _ from"./support/Sublayer.js";import{shouldWriteSublayerStructure as A}from"./support/sublayerUtils.js";import{serviceSupportsSpatialReference as N}from"./support/versionUtils.js";import J from"../symbols/support/ElevationInfo.js";import q from"../time/TimeExtent.js";import{timeZoneProperty as k}from"../time/timeZoneUtils.js";let G=class extends(I(E(T(U(j(S(O(L(s(P(x(w(b))))))))))))){constructor(...e){super(...e),this._exportImageParameters=new R({layer:this}),this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.dpi=96,this.elevationInfo=new J({mode:"on-the-ground"}),this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.preferredTimeZone=null,this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null,this._debouncedSaveOperations=o(async(e,r,t)=>{const{save:i,saveAs:s}=await import("./save/mapImageLayerUtils.js");switch(e){case 0:return i(this,r);case 1:return s(this,t,r)}})}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(a).then(()=>this._fetchService(r))),Promise.resolve(this)}destroy(){this._exportImageParameters.destroy()}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.includes("PNG32")?"png32":"png24"}get loaded(){return super.loaded}set portalItem(e){super.portalItem=e}writeSublayers(e,r,t,i){if(!this.loaded||!e)return;const s=e.slice().reverse().flatten(({sublayers:e})=>e&&e.toArray().reverse()).toArray();let o=!1;const a=h(i.origin);let p;if(this.capabilities?.operations.supportsExportMap&&this.capabilities?.exportMap?.supportsDynamicLayers)if(3===a){const e=this.createSublayersForOrigin("service").sublayers;o=A(s,e,2)}else if(a>3){const e=this.createSublayersForOrigin("portal-item");o=A(s,e.sublayers,h(e.origin)),p=e.originWithPartialOverrides}const n=[],m={writeSublayerStructure:o,...i,minimumWritableOrigin:p};let l=o||this.hasVisibleLayersForOrigin(a);s.forEach(e=>{const r=e.write({},m);n.push(r),l=l||"user"===e.originOf("visible")});n.some(e=>Object.keys(e).length>1)&&(r.layers=n),l&&(r.visibleLayers=s.filter(e=>e.visible).map(e=>e.id))}createExportImageParameters(e,r,t,i){const s=i?.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian()),this._exportImageParameters.floors=i?.floors??null,this._exportImageParameters.scale=i?.scale||g({extent:e,width:r})*s;const o=this._exportImageParameters.toJSON(),a=!i?.rotation||this.version<10.3?{}:{rotation:-i.rotation},p=e?.spatialReference,l=v(p);if(i?.scale&&e){const t=e.width/r*(n(e?.spatialReference)*m);o.dpi=i.scale/t}o.dpi*=s;const c={};if(i?.timeExtent){const{start:e,end:r}=i.timeExtent.toJSON();c.time=e&&r&&e===r?""+e:`${e??"null"},${r??"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(c.time="null,null");return{bbox:e?e.xmin+","+e.ymin+","+e.xmax+","+e.ymax:void 0,bboxSR:l,imageSR:l,size:r+","+t,...o,...a,...c}}async fetchImage(e,r,t,i){const{data:s}=await this._fetchImage("image",e,r,t,i);return s}async fetchImageBitmap(e,r,t,i){const{data:s,url:o}=await this._fetchImage("blob",e,r,t,i);return F(s,o,i?.signal)}async fetchRecomputedExtents(e={}){const t={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:i}=await r(this.url,t),{extent:s,fullExtent:o,timeExtent:a}=i,p=s||o;return{fullExtent:p&&f.fromJSON(p),timeExtent:a&&q.fromJSON({start:a[0],end:a[1]})}}loadAll(){return i(this,e=>{e(this.allSublayers),e(this.subtables)})}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,r){return this._debouncedSaveOperations(1,r,e)}serviceSupportsSpatialReference(e){return N(this,e)}async _fetchImage(e,i,s,o,a){const n={responseType:e,signal:a?.signal??null,query:{...this.parsedUrl.query,...this.createExportImageParameters(i,s,o,a),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},m=this.parsedUrl.path+"/export";if(null!=n.query?.dynamicLayers&&!this.capabilities?.exportMap?.supportsDynamicLayers)throw new t("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:n.query});try{const{data:e}=await r(m,n);return{data:e,url:m}}catch(l){if(p(l))throw l;throw new t("mapimagelayer:image-fetch-error",`Unable to load image: ${m}`,{error:l})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:t,ssl:i}=await r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});i&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})}hasVisibleLayersForOrigin(e){return!(null==e||!this.sublayersSourceJSON[e]?.visibleLayers)}};e([l(k("dateFieldsTimeReference"))],G.prototype,"dateFieldsTimeZone",void 0),e([l({type:Boolean})],G.prototype,"datesInUnknownTimezone",void 0),e([l()],G.prototype,"dpi",void 0),e([l()],G.prototype,"elevationInfo",void 0),e([l()],G.prototype,"gdbVersion",void 0),e([l()],G.prototype,"imageFormat",void 0),e([u("imageFormat",["supportedImageFormatTypes"])],G.prototype,"readImageFormat",null),e([l({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],G.prototype,"imageMaxHeight",void 0),e([l({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],G.prototype,"imageMaxWidth",void 0),e([l()],G.prototype,"imageTransparency",void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],G.prototype,"isReference",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"labelsVisible",void 0),e([l({type:["ArcGISMapServiceLayer"]})],G.prototype,"operationalLayerType",void 0),e([l({json:{read:!1,write:!1}})],G.prototype,"popupEnabled",void 0),e([l(k("preferredTimeReference"))],G.prototype,"preferredTimeZone",void 0),e([l()],G.prototype,"sourceJSON",void 0),e([l({json:{write:{ignoreOrigin:!0}}})],G.prototype,"sublayers",void 0),e([y("sublayers",{layers:{type:[_]},visibleLayers:{type:[c]}})],G.prototype,"writeSublayers",null),e([l({type:["show","hide","hide-children"],json:{origins:{"portal-item":{read:!1,write:!1}}}})],G.prototype,"listMode",void 0),e([l({json:{read:!1},readOnly:!0,value:"map-image"})],G.prototype,"type",void 0),e([l(M)],G.prototype,"url",void 0),G=e([d("esri.layers.MapImageLayer")],G);const V=G;export{V as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../graphic/OrientedImageryGraphicOrigin.js";import s from"./FeatureLayer.js";import{useViewTimeProperty as p}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as m,orientedImageryTypeMap as l,timeIntervalUnitTypeMap as d,verticalMeasurementTypeMap as y,padAccuracyArray as u,isOrientationAccuracy as c}from"./orientedImagery/core/utils.js";import h from"../tables/AttributeTableTemplate.js";import{T as g}from"../chunks/TimeExtent.js";const f=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),v=(e,t)=>!f.has(t)&&e,j=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function P(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function S(e,t,i,r){const{name:o,write:a,read:n}=j(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:v(a,e),read:v(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let x=class extends s{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new n(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return m(e,t,i)}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(e=>this.supportedSourceTypes.has(e.type))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:h,json:{write:!1,read:!1}})],x.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:S("cameraHeading")})],x.prototype,"cameraHeading",void 0),e([o({type:Number,json:S("cameraHeight")})],x.prototype,"cameraHeight",void 0),e([o({type:Number,json:S("cameraPitch")})],x.prototype,"cameraPitch",void 0),e([o({type:Number,json:S("cameraRoll")})],x.prototype,"cameraRoll",void 0),e([o({type:Number,json:S("coveragePercent")})],x.prototype,"coveragePercent",void 0),e([o({type:String,json:S("demPathPrefix")})],x.prototype,"demPathPrefix",void 0),e([o({type:String,json:S("demPathSuffix")})],x.prototype,"demPathSuffix",void 0),e([o({type:String,json:S("depthImagePathPrefix")})],x.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:S("depthImagePathSuffix")})],x.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:S("elevationSource")})],x.prototype,"elevationSource",void 0),e([o({readOnly:!0})],x.prototype,"effectiveElevationSource",null),e([o({type:Number,json:S("farDistance")})],x.prototype,"farDistance",void 0),e([o()],x.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],x.prototype,"graphicOrigin",void 0),e([o({type:Number,json:S("horizontalFieldOfView")})],x.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:S("horizontalMeasurementUnit")})],x.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...S("imageGeometryField"),default:"ImageGeometry"}})],x.prototype,"imageGeometryField",void 0),e([o({type:String,json:S("imagePathPrefix")})],x.prototype,"imagePathPrefix",void 0),e([o({type:String,json:S("imagePathSuffix")})],x.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...S("imageReferenceField"),default:"OIObjectID"}})],x.prototype,"imageReferenceField",void 0),e([o({type:Number,json:S("imageRotation")})],x.prototype,"imageRotation",void 0),e([o({type:Number,json:S("maximumDistance")})],x.prototype,"maximumDistance",void 0),e([o({type:Number,json:S("nearDistance")})],x.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],x.prototype,"operationalLayerType",void 0),e([o({json:{...S("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return c(t)?u(t):[0,0,0,0,0,0,0,0]},String)}})],x.prototype,"orientationAccuracy",void 0),e([o({json:{...S("orientedImageryType",l.write,l.read,l.jsonValues.slice(1))}})],x.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...S("referenceIDField"),default:"OBJECTID"}})],x.prototype,"referenceIDField",void 0),e([o({type:String,json:{...S("sequenceOrderField"),default:"SequenceOrder"}})],x.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],x.prototype,"type",void 0),e([o({type:d.apiValues,json:{...S("timeIntervalUnit",d.write,d.read,d.jsonValues)}})],x.prototype,"timeIntervalUnit",void 0),e([o(P(i(p)))],x.prototype,"useViewTime",void 0),e([o({type:Number,json:S("verticalFieldOfView")})],x.prototype,"verticalFieldOfView",void 0),e([o({type:y.apiValues,json:{...S("verticalMeasurementUnit",y.write,y.read,y.jsonValues)}})],x.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:S("videoPathPrefix")})],x.prototype,"videoPathPrefix",void 0),e([o({type:String,json:S("videoPathSuffix")})],x.prototype,"videoPathSuffix",void 0),e([o({type:g,json:{origins:{"web-scene":{write:!1,read:!1}}}})],x.prototype,"visibilityTimeExtent",void 0),x=e([a("esri.layers.OrientedImageryLayer")],x);const I=x;export{I as default};
5
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"../graphic/OrientedImageryGraphicOrigin.js";import s from"./FeatureLayer.js";import{useViewTimeProperty as p}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as m,orientedImageryTypeMap as l,timeIntervalUnitTypeMap as d,verticalMeasurementTypeMap as y,padAccuracyArray as u,isOrientationAccuracy as c}from"./orientedImagery/core/utils.js";import h from"../tables/AttributeTableTemplate.js";import g from"../time/TimeExtent.js";const f=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),v=(e,t)=>!f.has(t)&&e,j=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function P(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function S(e,t,i,r){const{name:o,write:a,read:n}=j(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:v(a,e),read:v(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let x=class extends s{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new n(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return m(e,t,i)}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(e=>this.supportedSourceTypes.has(e.type))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:h,json:{write:!1,read:!1}})],x.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:S("cameraHeading")})],x.prototype,"cameraHeading",void 0),e([o({type:Number,json:S("cameraHeight")})],x.prototype,"cameraHeight",void 0),e([o({type:Number,json:S("cameraPitch")})],x.prototype,"cameraPitch",void 0),e([o({type:Number,json:S("cameraRoll")})],x.prototype,"cameraRoll",void 0),e([o({type:Number,json:S("coveragePercent")})],x.prototype,"coveragePercent",void 0),e([o({type:String,json:S("demPathPrefix")})],x.prototype,"demPathPrefix",void 0),e([o({type:String,json:S("demPathSuffix")})],x.prototype,"demPathSuffix",void 0),e([o({type:String,json:S("depthImagePathPrefix")})],x.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:S("depthImagePathSuffix")})],x.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:S("elevationSource")})],x.prototype,"elevationSource",void 0),e([o({readOnly:!0})],x.prototype,"effectiveElevationSource",null),e([o({type:Number,json:S("farDistance")})],x.prototype,"farDistance",void 0),e([o()],x.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],x.prototype,"graphicOrigin",void 0),e([o({type:Number,json:S("horizontalFieldOfView")})],x.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:S("horizontalMeasurementUnit")})],x.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...S("imageGeometryField"),default:"ImageGeometry"}})],x.prototype,"imageGeometryField",void 0),e([o({type:String,json:S("imagePathPrefix")})],x.prototype,"imagePathPrefix",void 0),e([o({type:String,json:S("imagePathSuffix")})],x.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...S("imageReferenceField"),default:"OIObjectID"}})],x.prototype,"imageReferenceField",void 0),e([o({type:Number,json:S("imageRotation")})],x.prototype,"imageRotation",void 0),e([o({type:Number,json:S("maximumDistance")})],x.prototype,"maximumDistance",void 0),e([o({type:Number,json:S("nearDistance")})],x.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],x.prototype,"operationalLayerType",void 0),e([o({json:{...S("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return c(t)?u(t):[0,0,0,0,0,0,0,0]},String)}})],x.prototype,"orientationAccuracy",void 0),e([o({json:{...S("orientedImageryType",l.write,l.read,l.jsonValues.slice(1))}})],x.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...S("referenceIDField"),default:"OBJECTID"}})],x.prototype,"referenceIDField",void 0),e([o({type:String,json:{...S("sequenceOrderField"),default:"SequenceOrder"}})],x.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],x.prototype,"type",void 0),e([o({type:d.apiValues,json:{...S("timeIntervalUnit",d.write,d.read,d.jsonValues)}})],x.prototype,"timeIntervalUnit",void 0),e([o(P(i(p)))],x.prototype,"useViewTime",void 0),e([o({type:Number,json:S("verticalFieldOfView")})],x.prototype,"verticalFieldOfView",void 0),e([o({type:y.apiValues,json:{...S("verticalMeasurementUnit",y.write,y.read,y.jsonValues)}})],x.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:S("videoPathPrefix")})],x.prototype,"videoPathPrefix",void 0),e([o({type:String,json:S("videoPathSuffix")})],x.prototype,"videoPathSuffix",void 0),e([o({type:g,json:{origins:{"web-scene":{write:!1,read:!1}}}})],x.prototype,"visibilityTimeExtent",void 0),x=e([a("esri.layers.OrientedImageryLayer")],x);const I=x;export{I as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import i from"../core/Collection.js";import o from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as a}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{n as m}from"../chunks/vec32.js";import{fromValues as c}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../geometry/Extent.js";import y from"../graphic/VoxelGraphicOrigin.js";import f from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{SceneService as V}from"./mixins/SceneService.js";import{sanitizeUrl as j}from"./support/arcgisLayerUrl.js";import{legendEnabled as w,url as I}from"./support/commonProperties.js";import T from"./support/Field.js";import D from"./support/FieldsIndex.js";import L from"./support/TimeInfo.js";import F from"./voxel/VoxelSection.js";import O from"./voxel/VoxelSimpleShading.js";import P from"./voxel/VoxelVariable.js";import N from"./voxel/VoxelVariableStyle.js";import E from"./voxel/VoxelVolume.js";import A from"./voxel/VoxelVolumeIndex.js";import R from"./voxel/VoxelVolumeStyle.js";import{createPopupTemplate as C}from"../support/popupUtils.js";import{T as M}from"../chunks/TimeExtent.js";import{T as z}from"../chunks/TimeInterval.js";let _=class extends(V(v(g(S(x(n(b(h(f))))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.graphicOrigin=new y(this),this.shading=new O,this.opacity=1,this.variables=new i,this.volumes=new i,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(i.ofType(R)),this.variableStyles=new(i.ofType(N)),this.sections=new(i.ofType(F))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",j(e,r.getLogger(this)))}load(e){const t=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(s).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(i),Promise.resolve(this)}read(e,t){super.read(e,t),"service"===t?.origin&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const i of this.volumes)i.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new o("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,i){if(null!=e&&"object"==typeof e){const o=d.fromJSON(e,i);if(0===o.zmin&&0===o.zmax&&Array.isArray(t.volumes)){const e=E.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,i=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>i){const t=e;e=i,i=t}o.zmin=e,o.zmax=i}}}return o}return null}get fields(){const e=[new T({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new T({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const i of this.variables){const t=new T({name:i.name,alias:i.description,domain:null,editable:!1,length:128,type:"discrete"===i.renderingFormat.continuity?"string":"double"});e.push(t)}const t=this.getVolume(null);if(null!=t){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new T({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(t);const i=new T({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(i)}if("xyt"!==t.volumeType){const t=new T({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(t)}}return e}get fieldsIndex(){return this.loaded?new D(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.fields;return C({fields:t,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;t=null!=e?e:this.currentVariableId;if(!this.variableStyles||-1===t)return null;const i=this.variableStyles.findIndex(e=>e.variableId===t);return i<0?null:this.variableStyles.at(i)}getVariable(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variables||-1===t)return null;const i=this.variables.findIndex(e=>e.id===t);return i<0?null:this.variables.at(i)}getVolume(e){const t=this.getVariable(e);return null!=t?this.volumes.find(({id:e})=>e===t.volumeId):null}get timeInfo(){const e=this.getVolume(null);if("xyzt"!==e?.volumeType)return null;const t=e.timeStops;if(!t?.length)return null;const i=new M({start:t[0],end:t.at(-1)});return new L({fullTimeExtent:i,stops:t})}getVolumeStyle(e){const t=this.getVariable(e);return null!=t?this.volumeStyles.find(({volumeId:e})=>e===t.volumeId):null}getColorForContinuousDataValue(e,t,i){const o=this.getVariable(e);if(null==o||"continuous"!==o.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const r=this.variableStyles.findIndex(t=>t.variableId===e);if(r<0)return null;const n=this.variableStyles.at(r);return n?.transferFunction?n.transferFunction.getColorForContinuousDataValue(t,i):null}getSections(){const e=[];for(const t of this.sections)e.push(new F({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const i=this._getVariable(t);if(null!=i){const o=t.clone();o.isosurfaces.length>4&&(o.isosurfaces=o.isosurfaces.slice(0,3),r.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of o.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(o.variableId,e.value,!1);null==t||t.equals(e.color)||(e.color=t)}if("continuous"===i.renderingFormat.continuity)(null===o.transferFunction||o.transferFunction.colorStops.length<2)&&r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==o.transferFunction&&(Array.isArray(o.transferFunction.stretchRange)&&2===o.transferFunction.stretchRange.length||(r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),o.transferFunction.stretchRange=[0,1],o.transferFunction.colorStops.removeAll()));else if("discrete"===i.renderingFormat.continuity)if(0===t.uniqueValues.length)r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(o)}else r.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const i=this._getVolumeFromVolumeId(t.volumeId);if(null!=i){const o=t.clone();for(const e of o.slices)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of o.dynamicSections)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label="invalid");e.push(o)}else r.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const i of this.variables)if(i.id===t)return i;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,i){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;const o=c(e.normal[0],e.normal[1],e.normal[2]);m(o,o);const r=1e-6;return!(Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])<r)&&(e.normal[0]=o[0],e.normal[1]=o[1],e.normal[2]=o[2],!0)}};e([l({type:["Voxel"]})],_.prototype,"operationalLayerType",void 0),e([l(w)],_.prototype,"legendEnabled",void 0),e([l({json:{write:!0}})],_.prototype,"title",void 0),e([l(I)],_.prototype,"url",null),e([l({type:i.ofType(F),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],_.prototype,"sections",void 0),e([l({type:a,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],_.prototype,"currentVariableId",void 0),e([l({type:i.ofType(R),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],_.prototype,"volumeStyles",void 0),e([l({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],_.prototype,"renderMode",void 0),e([l({type:i.ofType(N),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],_.prototype,"variableStyles",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],_.prototype,"enableSlices",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],_.prototype,"enableSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],_.prototype,"enableDynamicSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],_.prototype,"enableIsosurfaces",void 0),e([l({readOnly:!0})],_.prototype,"graphicOrigin",void 0),e([l({type:O,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],_.prototype,"shading",void 0),e([l({type:["show","hide"]})],_.prototype,"listMode",void 0),e([l({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],_.prototype,"opacity",void 0),e([l({type:i.ofType(P)})],_.prototype,"variables",void 0),e([l({type:i.ofType(E)})],_.prototype,"volumes",void 0),e([l({type:A})],_.prototype,"index",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],_.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],_.prototype,"maxScale",void 0),e([l({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([l({readOnly:!0,json:{name:"serviceVersion"}})],_.prototype,"version",void 0),e([p("service","version")],_.prototype,"readVersion",null),e([l({type:d})],_.prototype,"fullExtent",void 0),e([p("service","fullExtent",["fullExtent"])],_.prototype,"readFullExtent",null),e([l({readOnly:!0,clonable:!1,json:{read:!1}})],_.prototype,"fields",null),e([l({readOnly:!0})],_.prototype,"fieldsIndex",null),e([l({type:Boolean,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,i){t[i]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],_.prototype,"popupEnabled",void 0),e([l({type:t,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([l({readOnly:!0,json:{read:!1}})],_.prototype,"defaultPopupTemplate",null),e([l({type:L,readOnly:!0,json:{read:!1}})],_.prototype,"timeInfo",null),e([l({type:M,json:{read:!1}})],_.prototype,"timeExtent",void 0),e([l({type:z,json:{read:!1}})],_.prototype,"timeOffset",void 0),e([l({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],_.prototype,"useViewTime",void 0),_=e([u("esri.layers.VoxelLayer")],_);const q=_;export{q as default};
5
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import i from"../core/Collection.js";import o from"../core/Error.js";import r from"../core/Logger.js";import{MultiOriginJSONMixin as n}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{Integer as a}from"../core/accessorSupport/ensureType.js";import"../core/has.js";import"../core/RandomLCG.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{n as m}from"../chunks/vec32.js";import{fromValues as c}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import d from"../geometry/Extent.js";import y from"../graphic/VoxelGraphicOrigin.js";import f from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as S}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{SceneService as V}from"./mixins/SceneService.js";import{sanitizeUrl as j}from"./support/arcgisLayerUrl.js";import{legendEnabled as w,url as I}from"./support/commonProperties.js";import T from"./support/Field.js";import D from"./support/FieldsIndex.js";import L from"./support/TimeInfo.js";import F from"./voxel/VoxelSection.js";import O from"./voxel/VoxelSimpleShading.js";import P from"./voxel/VoxelVariable.js";import N from"./voxel/VoxelVariableStyle.js";import E from"./voxel/VoxelVolume.js";import A from"./voxel/VoxelVolumeIndex.js";import R from"./voxel/VoxelVolumeStyle.js";import{createPopupTemplate as C}from"../support/popupUtils.js";import M from"../time/TimeExtent.js";import z from"../time/TimeInterval.js";let _=class extends(V(v(g(S(x(n(b(h(f))))))))){constructor(e){super(e),this.serviceRoot="",this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.graphicOrigin=new y(this),this.shading=new O,this.opacity=1,this.variables=new i,this.volumes=new i,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.popupEnabled=!1,this.popupTemplate=null,this.test=null,this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0,this.volumeStyles=new(i.ofType(R)),this.variableStyles=new(i.ofType(N)),this.sections=new(i.ofType(F))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set("url",j(e,r.getLogger(this)))}load(e){const t=null!=e?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(s).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(i),Promise.resolve(this)}read(e,t){super.read(e,t),"service"===t?.origin&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin("popupTemplate","service")&&this.setAtOrigin("popupTemplate",this.createPopupTemplate(),"service");for(const i of this.volumes)i.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new o("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new o("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new o("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,t,i){if(null!=e&&"object"==typeof e){const o=d.fromJSON(e,i);if(0===o.zmin&&0===o.zmax&&Array.isArray(t.volumes)){const e=E.fromJSON(t.volumes[0]);if(e.isValid&&"xyt"!==e.volumeType){const t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,i=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>i){const t=e;e=i,i=t}o.zmin=e,o.zmax=i}}}return o}return null}get fields(){const e=[new T({name:"Voxel.Position",alias:"Voxel Position",domain:null,editable:!1,length:128,type:"string"}),new T({name:"Voxel.CurrentVariable",alias:"Current Variable",domain:null,editable:!1,length:128,type:"string"})];for(const i of this.variables){const t=new T({name:i.name,alias:i.description,domain:null,editable:!1,length:128,type:"discrete"===i.renderingFormat.continuity?"string":"double"});e.push(t)}const t=this.getVolume(null);if(null!=t){if("xyzt"===t.volumeType||"xyt"===t.volumeType){const t=new T({name:"Voxel.LocalTime",alias:"Local Time",domain:null,editable:!1,length:256,type:"date"});e.push(t);const i=new T({name:"Voxel.SourceTime",alias:"Source Time",domain:null,editable:!1,length:256,type:"string"});e.push(i)}if("xyt"!==t.volumeType){const t=new T({name:"Voxel.Depth",alias:"Depth",domain:null,editable:!1,length:128,type:"double"});e.push(t)}}return e}get fieldsIndex(){return this.loaded?new D(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){const t=this.fields;return C({fields:t,title:"{Voxel.Position}"},e)}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index?.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index?.isValid()?JSON.stringify(e):""}getVariableStyle(e){let t=-1;t=null!=e?e:this.currentVariableId;if(!this.variableStyles||-1===t)return null;const i=this.variableStyles.findIndex(e=>e.variableId===t);return i<0?null:this.variableStyles.at(i)}getVariable(e){let t=-1;if(t=null!=e?e:this.currentVariableId,!this.variables||-1===t)return null;const i=this.variables.findIndex(e=>e.id===t);return i<0?null:this.variables.at(i)}getVolume(e){const t=this.getVariable(e);return null!=t?this.volumes.find(({id:e})=>e===t.volumeId):null}get timeInfo(){const e=this.getVolume(null);if("xyzt"!==e?.volumeType)return null;const t=e.timeStops;if(!t?.length)return null;const i=new M({start:t[0],end:t.at(-1)});return new L({fullTimeExtent:i,stops:t})}getVolumeStyle(e){const t=this.getVariable(e);return null!=t?this.volumeStyles.find(({volumeId:e})=>e===t.volumeId):null}getColorForContinuousDataValue(e,t,i){const o=this.getVariable(e);if(null==o||"continuous"!==o.renderingFormat?.continuity)return null;if(!this.variableStyles)return null;const r=this.variableStyles.findIndex(t=>t.variableId===e);if(r<0)return null;const n=this.variableStyles.at(r);return n?.transferFunction?n.transferFunction.getColorForContinuousDataValue(t,i):null}getSections(){const e=[];for(const t of this.sections)e.push(new F({enabled:t.enabled,href:t.href,id:t.id,label:t.label,normal:t.normal,point:t.point,sizeInPixel:t.sizeInPixel,slices:t.slices,timeId:t.timeId,variableId:t.variableId}));return e}getVariableStyles(){const e=[];for(const t of this.variableStyles){const i=this._getVariable(t);if(null!=i){const o=t.clone();o.isosurfaces.length>4&&(o.isosurfaces=o.isosurfaces.slice(0,3),r.getLogger(this).error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const e of o.isosurfaces)if(!e.colorLocked){const t=this.getColorForContinuousDataValue(o.variableId,e.value,!1);null==t||t.equals(e.color)||(e.color=t)}if("continuous"===i.renderingFormat.continuity)(null===o.transferFunction||o.transferFunction.colorStops.length<2)&&r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),null!==o.transferFunction&&(Array.isArray(o.transferFunction.stretchRange)&&2===o.transferFunction.stretchRange.length||(r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),o.transferFunction.stretchRange=[0,1],o.transferFunction.colorStops.removeAll()));else if("discrete"===i.renderingFormat.continuity)if(0===t.uniqueValues.length)r.getLogger(this).error(`VoxelVariableStyle for variable ${i.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const e of t.uniqueValues)null!==e.label&&void 0!==e.label||null===e.value||void 0===e.value||(e.label=e.value.toString());e.push(o)}else r.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const t of this.volumeStyles){const i=this._getVolumeFromVolumeId(t.volumeId);if(null!=i){const o=t.clone();for(const e of o.slices)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label="invalid");for(const e of o.dynamicSections)this._isPlaneValid(e,[0,1,i.zDimension],i.dimensions)||(e.enabled=!1,e.label="invalid");e.push(o)}else r.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const t=e.variableId;for(const i of this.variables)if(i.id===t)return i;return null}_getVolumeFromVolumeId(e){for(const t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,i){if(!e.point)return!1;if(!Array.isArray(e.point)||3!==e.point.length)return!1;if(!e.normal)return!1;if(!Array.isArray(e.normal)||3!==e.normal.length)return!1;const o=c(e.normal[0],e.normal[1],e.normal[2]);m(o,o);const r=1e-6;return!(Math.abs(o[0])+Math.abs(o[1])+Math.abs(o[2])<r)&&(e.normal[0]=o[0],e.normal[1]=o[1],e.normal[2]=o[2],!0)}};e([l({type:["Voxel"]})],_.prototype,"operationalLayerType",void 0),e([l(w)],_.prototype,"legendEnabled",void 0),e([l({json:{write:!0}})],_.prototype,"title",void 0),e([l(I)],_.prototype,"url",null),e([l({type:i.ofType(F),json:{origins:{"web-scene":{name:"layerDefinition.sections",write:!0}}}})],_.prototype,"sections",void 0),e([l({type:a,json:{origins:{"web-scene":{name:"layerDefinition.style.currentVariableId",write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:"style.currentVariableId"}}}})],_.prototype,"currentVariableId",void 0),e([l({type:i.ofType(R),json:{origins:{"web-scene":{name:"layerDefinition.style.volumeStyles",write:!0},service:{name:"style.volumeStyles"}}}})],_.prototype,"volumeStyles",void 0),e([l({type:["volume","surfaces"],json:{origins:{"web-scene":{name:"layerDefinition.style.renderMode",write:!0},service:{name:"style.renderMode"}}}})],_.prototype,"renderMode",void 0),e([l({type:i.ofType(N),json:{origins:{"web-scene":{name:"layerDefinition.style.variableStyles",write:!0},service:{name:"style.variableStyles"}}}})],_.prototype,"variableStyles",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSlices",write:!0},service:{name:"style.enableSlices"}}}})],_.prototype,"enableSlices",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableSections",write:!0},service:{name:"style.enableSections"}}}})],_.prototype,"enableSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableDynamicSections",write:!0},service:{name:"style.enableDynamicSections"}}}})],_.prototype,"enableDynamicSections",void 0),e([l({type:Boolean,json:{origins:{"web-scene":{name:"layerDefinition.style.enableIsosurfaces",write:!0},service:{name:"style.enableIsosurfaces"}}}})],_.prototype,"enableIsosurfaces",void 0),e([l({readOnly:!0})],_.prototype,"graphicOrigin",void 0),e([l({type:O,json:{origins:{"web-scene":{name:"layerDefinition.style.shading",write:!0},service:{name:"style.shading"}}}})],_.prototype,"shading",void 0),e([l({type:["show","hide"]})],_.prototype,"listMode",void 0),e([l({type:Number,range:{min:0,max:1},nonNullable:!0,json:{read:!1,write:!1,origins:{"web-scene":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],_.prototype,"opacity",void 0),e([l({type:i.ofType(P)})],_.prototype,"variables",void 0),e([l({type:i.ofType(E)})],_.prototype,"volumes",void 0),e([l({type:A})],_.prototype,"index",void 0),e([l({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:!1,write:!1}}}})],_.prototype,"minScale",void 0),e([l({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:!1,write:!1}}}})],_.prototype,"maxScale",void 0),e([l({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([l({readOnly:!0,json:{name:"serviceVersion"}})],_.prototype,"version",void 0),e([p("service","version")],_.prototype,"readVersion",null),e([l({type:d})],_.prototype,"fullExtent",void 0),e([p("service","fullExtent",["fullExtent"])],_.prototype,"readFullExtent",null),e([l({readOnly:!0,clonable:!1,json:{read:!1}})],_.prototype,"fields",null),e([l({readOnly:!0})],_.prototype,"fieldsIndex",null),e([l({type:Boolean,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,i){t[i]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],_.prototype,"popupEnabled",void 0),e([l({type:t,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([l({readOnly:!0,json:{read:!1}})],_.prototype,"defaultPopupTemplate",null),e([l({type:L,readOnly:!0,json:{read:!1}})],_.prototype,"timeInfo",null),e([l({type:M,json:{read:!1}})],_.prototype,"timeExtent",void 0),e([l({type:z,json:{read:!1}})],_.prototype,"timeOffset",void 0),e([l({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:"timeAnimation",write:!0},service:{read:!1}}}})],_.prototype,"useViewTime",void 0),_=e([u("esri.layers.VoxelLayer")],_);const q=_;export{q as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{result as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import has from"../../../core/has.js";import s from"../../../core/Error.js";import{clone as a}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{destroyMaybe as o,removeMaybe as n,abortMaybe as h}from"../../../core/maybe.js";import{EsriPromiseMixin as u}from"../../../core/Promise.js";import{createAbortError as c,isAbortError as d}from"../../../core/promiseUtils.js";import{initial as p,watch as m,syncAndInitial as f,sync as y}from"../../../core/reactiveUtils.js";import{sqlAnd as _}from"../../../core/sql.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import{subclass as F}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as x}from"../../../core/support/UpdatingHandles.js";import{projectWithZConversion as v}from"../../../geometry/projectionUtils.js";import{isHostedAgolService as w}from"../../support/arcgisLayerUrl.js";import{checkServiceCurrentUserSupport as D}from"../../support/featureLayerUtils.js";import{getEffectiveLayerCapabilities as C}from"../../support/layerUtils.js";import b from"../../../rest/support/StatisticDefinition.js";import{FeatureTileDescriptor as S,virtualSnapshotTileId as E,virtualDisplayFilterHighlightTileId as T}from"../../../views/3d/layers/support/FeatureTileDescriptor.js";import{FeatureTileFetcher3D as V}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as H}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import{debugFlags as I}from"../../../views/3d/support/debugFlags.js";let L=class extends(u(t)){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(e){if(null!=e&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void l.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e)return;if(null!=t&&e&&t.equals(e))return;const i=null!=e?e.clone():null;this._set("extent",i)}get updating(){return!!(this._tileFetcher?.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles?.updating||this._updatingHandles?.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get hasAllFeatures(){return this.serviceDataCount===M.noServiceDataCount&&"snapshot"===this.mode&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){const e=this.context.effectiveDisplayFilter?.where||null,t=null!=e&&"1=1"!==e;return("tiles"!==this.mode||!t)&&(this._tileFetcher?.showsAllFeatures??!1)}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){const e=this.layerView.layer;if("feature"===e.type&&null!=e.infoFor3D)return"snapshot";if("catalog-footprint"===e.type)return"tiles";if(this._forceTilesMode)return"tiles";const t=this.layerView.view;if(!1===t.qualitySettings?.graphics3D?.snapshotAvailable||this.serviceDataCount===M.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return"tiles";const i=t&&t.featureTiles,r=i?.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const t=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>M.maxSnapshotMinScaleFactor)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t="snapshot"===this.mode&&this._tileFetcher?.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),s=t.levels[0];return r*((s.tileSize[0]/(s.scale/e)+s.tileSize[1]/(s.scale/e))/2)}get tileDescriptors(){if("snapshot"===this.mode){const e=new S(0,0,0,null,E);return new r([e])}const e=this.layerView.view.featureTiles;if(!e)return new r;const t=e.tiles;if(this.layerView.displayFilterEnabled&&null!=this.layerView.effectiveDisplayFilterClause&&"1=1"!==this.layerView.effectiveDisplayFilterClause){const e=new S(0,0,0,this.layerView.view.featureTiles?.tilingScheme,T);return new r([...t,e])}return t}get test(){}constructor(e){super(e),this.type="feature-tile-3d",this._updatingHandles=new x,this.serviceDataExtent=null,this.serviceDataCount=M.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=>this.displayFeatureLimit,e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal))),this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),p),this._updatingHandles.add(()=>this.mode,(e,t)=>{"tiles"===e&&"snapshot"===t&&(this._forceTilesMode=!0)},p),this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){const e=this.layerView.layer;if("ogc-feature"!==e.type&&!C(e)?.operations.supportsQuery)throw new s("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=o(this._tileFetcher),this._tilesHandle=n(this._tilesHandle),this._lifeCycleAbortController=h(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(e){return this._tileFetcher?.getMissingAttributesForFeature(e)}_refetch(e){const t=()=>{null!=this._tileFetcher&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const{layerView:t,tileDescriptors:i}=this,r=t.layer,s=new V({context:this.context,filterExtent:this.extent,tileDescriptors:i,features:this.graphics});this._tileFetcher=s,this._suspended?s.suspend():s.resume(),e&&this.addHandles(m(()=>e.quality,e=>s.memoryFactor=e,f));const a="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;a&&this.addHandles(m(()=>this.layerView.view?.qualitySettings?.graphics3D?.[a],e=>s.lodFactor=e||1,p));const l=e=>{s.maximumNumberOfFeatures=e,s.useTileCount=this.serviceDataCount>e},n=e=>{s.useTileCount=e>this.maximumNumberOfFeatures};"ogc-feature"!==r.type&&this._updatingHandles.add(()=>r.createQueryVersion,()=>this._dataFilterChanged()),this._updatingHandles.add(()=>this.layerView.effectiveDisplayFilter,()=>this._effectiveDisplayFilterChanged()),this._updatingHandles.add(()=>this.layerView.highlightIds,()=>this._displayFilterHighlightIdsChanged()),this._updatingHandles.add(()=>t.availableFields,(e,t)=>this._availableFieldsChanged(t,e)),this._updatingHandles.add(()=>t.requiredFields,(e,t)=>this._requiredFieldsChanged(t,e)),"customParameters"in r&&this._updatingHandles.add(()=>r.customParameters,()=>this.restart()),this.addHandles([r.on("apply-edits",e=>this._applyEdits(e)),m(()=>this.extent,e=>s.filterExtent=e,y),m(()=>this.tileDescriptors,e=>s.tileDescriptors=e,y),m(()=>this.maximumNumberOfFeatures,l,f),m(()=>this.serviceDataCount,n,f),m(()=>({featureTiles:e.featureTiles,show:I.FEATURE_TILE_FETCH_SHOW_TILES}),({show:t,featureTiles:i})=>{t&&s&&i?s.debugger??=new H(s,i.tilingScheme.toTileInfo(),e):s.debugger=o(s.debugger)},p)]),this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.enableFeatureTiles());break;default:l.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this._refetch({resetForceTilesMode:!0})}_effectiveDisplayFilterChanged(){"snapshot"!==this.mode&&this._refetch({resetForceTilesMode:!1})}_displayFilterHighlightIdsChanged(){"snapshot"!==this.mode&&null!=this._tileFetcher&&this._tileFetcher.refetchDisplayFilterHighlightTile()}_applyEdits(e){const t=this.layerView.layer;null!=this._tileFetcher&&this._tileFetcher.applyEdits(e).then(e=>{if(e){if(!this._lifeCycleAbortController)throw c();e.exceededTransferLimit&&"refresh"in t?t.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(e=>{if(!d(e))throw e})}_availableFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new b({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){const e=this.layerView.layer,t=this.layerView,i=e.createQuery();return i.returnGeometry=!1,i.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),t.effectiveDisplayFilter&&(i.where=_(i.where,t.effectiveDisplayFilter.where)),i}_fullExtentIsAccurate(){const e=this.layerView.layer;if("definitionExpression"in e&&e.definitionExpression)return!1;switch(e.type){case"feature":case"catalog-footprint":case"oriented-imagery":return w(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){d(t)||this._set("serviceDataExtent",a(this.layerView.fullExtentInLocalViewSpatialReference)??null)}}async _tryUpdateServiceDataExtent(e){const t=this.layerView,i=t.layer,r=i.capabilities?.query.supportsExtent??!1,s=a(t.fullExtentInLocalViewSpatialReference),l=i.fullExtent,o=this._fullExtentIsAccurate(),n=this.serviceDataCount;if(r&&n<=M.maxFeatureCountForExtent&&(!s||!o)&&"queryExtent"in i){const t=this._createDataInfoQuery(),r=await i.queryExtent(t,{timeout:M.queryExtentTimeout,signal:e});this._set("serviceDataExtent",r.extent)}else if(s)this._set("serviceDataExtent",s);else if(null!=l){const e=l.spatialReference?await v(l,t.view.spatialReference):null;this._set("serviceDataExtent",e??null)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!has("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",M.noServiceDataCount);const r=await i(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:M.queryStatisticsTimeout,signal:e}));if(!0===r.ok)this._set("serviceDataCount",r.value);else{if(d(r.error))throw r.error;this._set("serviceDataCount",M.noServiceDataCount)}}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return null!=e.capabilities&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateSnapshotLimit(e,t,r){if(null==e?.averageSymbolComplexity)return void(this._snapshotLimitExceeded=!1);const{maximumTotalNumberOfVertices:s,averageSymbolComplexity:a}=e,{verticesPerFeature:l,verticesPerCoordinate:o}=a,n=l<=0,h=this._minimumNumberOfVerticesForGeometry>1;if(!n&&!h)return void(this._snapshotLimitExceeded=!1);0!==l&&null!=t&&await t;const u=Math.min(s,A),c=this.serviceDataCount,p=c!==M.noServiceDataCount;let m=p?Math.ceil((u-c*l)/(o||1)):Math.ceil(u/(o||1));if(h&&(m=Math.min(m,N)),p&&this._minimumNumberOfVerticesForGeometry*c>m)return void(this._snapshotLimitExceeded=!0);if(!this._supportsExceedsLimitQuery||!has("featurelayer-snapshot-enabled"))return void(this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>m);const f=await i(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(m),{timeout:M.queryStatisticsTimeout,signal:r}));if(!1===f.ok){if(d(f.error))throw f.error;return void(this._snapshotLimitExceeded=!1)}const y=f.value.features[0];this._snapshotLimitExceeded=!!y?.attributes&&!!y.attributes.exceedslimit}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(),await D(this.layerView.layer);let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=Promise.allSettled([i,this._updateSnapshotLimit(this.displayFeatureLimit,i,t)]),s=r.then(()=>this._updateServiceDataExtent(t)).catch(e=>{d(e)||l.getLogger(this).error("#fetchServiceDataInfo()",e)}).then(()=>{s===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null});return e&&(this._fetchDataInfoPromise=s),this._fetchDataInfoAbortController=e,r.then(()=>{},()=>{})}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};e([g({readOnly:!0})],L.prototype,"type",void 0),e([g({constructOnly:!0})],L.prototype,"graphics",void 0),e([g({constructOnly:!0})],L.prototype,"layerView",void 0),e([g({constructOnly:!0})],L.prototype,"context",void 0),e([g({readOnly:!0})],L.prototype,"dataUpdating",null),e([g()],L.prototype,"extent",null),e([g()],L.prototype,"updating",null),e([g({readOnly:!0})],L.prototype,"_updatingHandles",void 0),e([g()],L.prototype,"updatingTotal",null),e([g()],L.prototype,"updatingRemaining",null),e([g()],L.prototype,"expectedFeatureDiff",null),e([g()],L.prototype,"memoryForUnusedFeatures",null),e([g()],L.prototype,"maximumNumberOfFeaturesExceeded",null),e([g({readOnly:!0})],L.prototype,"serviceDataExtent",void 0),e([g({readOnly:!0})],L.prototype,"serviceDataCount",void 0),e([g()],L.prototype,"_snapshotLimitExceeded",void 0),e([g()],L.prototype,"displayFeatureLimit",void 0),e([g({type:Number})],L.prototype,"maximumNumberOfFeatures",null),e([g({readOnly:!0})],L.prototype,"hasAllFeatures",null),e([g({readOnly:!0})],L.prototype,"hasAllFeaturesInView",null),e([g({readOnly:!0})],L.prototype,"hasFullGeometries",null),e([g()],L.prototype,"_forceTilesMode",void 0),e([g({readOnly:!0})],L.prototype,"mode",null),e([g({readOnly:!0})],L.prototype,"maxTotalSnapshotVertices",null),e([g({readOnly:!0})],L.prototype,"tileDescriptors",null),e([g()],L.prototype,"_tileFetcher",void 0),e([g()],L.prototype,"_fetchDataInfoPromise",void 0),L=e([F("esri.layers.graphics.controllers.FeatureTileController3D")],L);const O=1e4,A=1e6,q=12e3,j=1e4,N=5e6;function P(e,t){if(!t)return!1;for(const i of t)if(!e.has(i))return!0;return!1}class M{static{this.noServiceDataCount=1/0}static{this.maxSnapshotMinScaleFactor=5}static reset(){M.maxFeatureCountForExtent=O,M.queryStatisticsTimeout=q,M.queryExtentTimeout=j}}M.reset();export{L as FeatureTileController3D,M as FeatureTileController3DConstants};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import{result as i}from"../../../core/asyncUtils.js";import r from"../../../core/Collection.js";import has from"../../../core/has.js";import s from"../../../core/Error.js";import{clone as a}from"../../../core/lang.js";import l from"../../../core/Logger.js";import{destroyMaybe as o,removeMaybe as n,abortMaybe as h}from"../../../core/maybe.js";import{EsriPromiseMixin as u}from"../../../core/Promise.js";import{createAbortError as c,isAbortError as d}from"../../../core/promiseUtils.js";import{initial as p,watch as m,syncAndInitial as f,sync as y}from"../../../core/reactiveUtils.js";import{sqlAnd as _}from"../../../core/sql.js";import{property as g}from"../../../core/accessorSupport/decorators/property.js";import{subclass as F}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as x}from"../../../core/support/UpdatingHandles.js";import{projectWithZConversion as v}from"../../../geometry/projectionUtils.js";import{isHostedAgolService as w}from"../../support/arcgisLayerUrl.js";import{checkServiceCurrentUserSupport as D}from"../../support/featureLayerUtils.js";import{getEffectiveLayerCapabilities as C}from"../../support/layerUtils.js";import b from"../../../rest/support/StatisticDefinition.js";import{FeatureTileDescriptor as S,virtualSnapshotTileId as E,virtualDisplayFilterHighlightTileId as T}from"../../../views/3d/layers/support/FeatureTileDescriptor.js";import{FeatureTileFetcher3D as V}from"../../../views/3d/layers/support/FeatureTileFetcher3D.js";import{FeatureTileFetcher3DDebugger as H}from"../../../views/3d/layers/support/FeatureTileFetcher3DDebugger.js";import{debugFlags as I}from"../../../views/3d/support/debugFlags.js";let L=class extends(u(t)){get dataUpdating(){return this._tileFetcher?.dataUpdating??!1}set extent(e){if(null!=e&&!e.spatialReference.equals(this.layerView.view.spatialReference))return void l.getLogger(this).error("#extent=","extent needs to be in the same spatial reference as the view");const t=this._get("extent");if(t===e)return;if(null!=t&&e&&t.equals(e))return;const i=null!=e?e.clone():null;this._set("extent",i)}get updating(){return!!(this._tileFetcher?.updating||null!=this._fetchDataInfoPromise||"tiles"===this.mode&&this.layerView.view.featureTiles?.updating||this._updatingHandles?.updating)}get updatingTotal(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingTotal:0}get updatingRemaining(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.updatingRemaining:0}get expectedFeatureDiff(){return this.updating&&null!=this._tileFetcher?this._tileFetcher.expectedFeatureDiff:0}get memoryForUnusedFeatures(){return null!=this._tileFetcher?this._tileFetcher.memoryForUnusedFeatures:0}get maximumNumberOfFeaturesExceeded(){return!(null==this._tileFetcher||!this._tileFetcher.maximumNumberOfFeaturesExceeded)}get maximumNumberOfFeatures(){return this.displayFeatureLimit?.maximumNumberOfFeatures??0}set maximumNumberOfFeatures(e){e!==this.maximumNumberOfFeatures&&this._overrideIfSome("maximumNumberOfFeatures",e)}get hasMaximumNumberOfFeaturesOverride(){return this._isOverridden("maximumNumberOfFeatures")}get hasAllFeatures(){return this.serviceDataCount===M.noServiceDataCount&&"snapshot"===this.mode&&this.hasAllFeaturesInView||this.serviceDataCount===this.graphics.length}get hasAllFeaturesInView(){const e=this.context.effectiveDisplayFilter?.where||null,t=null!=e&&"1=1"!==e;return("tiles"!==this.mode||!t)&&(this._tileFetcher?.showsAllFeatures??!1)}get hasFullGeometries(){return this._tileFetcher?.hasFullGeometries??!1}get mode(){const e=this.layerView.layer;if("feature"===e.type&&null!=e.infoFor3D)return"snapshot";if("catalog-footprint"===e.type)return"tiles";if(this._forceTilesMode)return"tiles";const t=this.layerView.view;if(!1===t.qualitySettings?.graphics3D?.snapshotAvailable||this.serviceDataCount===M.noServiceDataCount||this._snapshotLimitExceeded||this.maximumNumberOfFeaturesExceeded||t.quality<1)return"tiles";const i=t&&t.featureTiles,r=i?.tilingScheme;if(e&&e.minScale&&this.serviceDataExtent&&r){const t=this._approximateExtentSizeAtScale(e.minScale,r);if((this.serviceDataExtent.width/t+this.serviceDataExtent.height/t)/2>M.maxSnapshotMinScaleFactor)return"tiles"}return!this.maximumNumberOfFeatures||this.serviceDataCount<=this.maximumNumberOfFeatures?"snapshot":"tiles"}get maxTotalSnapshotVertices(){const e=this._get("maxTotalSnapshotVertices")||0,t="snapshot"===this.mode&&this._tileFetcher?.totalVertices||0;return Math.max(e,t)}_approximateExtentSizeAtScale(e,t){const i=this.layerView.view,r=Math.ceil((i.width/t.pixelSize+i.height/t.pixelSize)/2),s=t.levels[0];return r*((s.tileSize[0]/(s.scale/e)+s.tileSize[1]/(s.scale/e))/2)}get tileDescriptors(){if("snapshot"===this.mode){const e=new S(0,0,0,null,E);return new r([e])}const e=this.layerView.view.featureTiles;if(!e)return new r;const t=e.tiles;if(this.layerView.displayFilterEnabled&&null!=this.layerView.effectiveDisplayFilterClause&&"1=1"!==this.layerView.effectiveDisplayFilterClause&&this.layerView.highlightIds?.length>0){const e=new S(0,0,0,this.layerView.view.featureTiles?.tilingScheme,T);return new r([...t,e])}return t}get test(){}constructor(e){super(e),this.type="feature-tile-3d",this._updatingHandles=new x,this.serviceDataExtent=null,this.serviceDataCount=M.noServiceDataCount,this._snapshotLimitExceeded=!1,this.displayFeatureLimit=null,this._forceTilesMode=!1,this._suspended=!1,this._tileFetcher=null,this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null,this._lifeCycleAbortController=new AbortController}initialize(){this._updatingHandles.add(()=>this.displayFeatureLimit,e=>this._updatingHandles.addPromise(this._updateSnapshotLimit(e,null,this._lifeCycleAbortController.signal))),this._updatingHandles.add(()=>this.mode,()=>this._modeChanged(),p),this._updatingHandles.add(()=>this.mode,(e,t)=>{"tiles"===e&&"snapshot"===t&&(this._forceTilesMode=!0)},p),this.addResolvingPromise(Promise.resolve().then(()=>this._verifyCapabilities()).then(()=>this._updatingHandles.addPromise(this._fetchServiceDataInfo())).then(()=>this._initializeTileFetcher()))}_verifyCapabilities(){const e=this.layerView.layer;if("ogc-feature"!==e.type&&!C(e)?.operations.supportsQuery)throw new s("graphicscontroller:query-capability-required","Service requires query capabilities to be used as a feature layer",{layer:e})}destroy(){this._cancelFetchServiceDataInfo(),this._tileFetcher=o(this._tileFetcher),this._tilesHandle=n(this._tilesHandle),this._lifeCycleAbortController=h(this._lifeCycleAbortController),this._updatingHandles.destroy(),this._set("_updatingHandles",null)}suspend(){this._suspended||(this._suspended=!0,null!=this._tileFetcher&&this._tileFetcher.suspend())}resume(){this._suspended&&(this._suspended=!1,null!=this._tileFetcher&&this._tileFetcher.resume())}restart(){const e=()=>{null!=this._tileFetcher&&this._tileFetcher.restart()};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(e,e))}refetch(){this._refetch({resetForceTilesMode:!1})}getMissingAttributesForFeature(e){return this._tileFetcher?.getMissingAttributesForFeature(e)}_refetch(e){const t=()=>{null!=this._tileFetcher&&(e.resetForceTilesMode&&(this._forceTilesMode=!1),this._tileFetcher.refetch())};this._updatingHandles.addPromise(this._fetchServiceDataInfo().then(t,t))}_initializeTileFetcher(){const e=this.layerView.view;if(!e)return;const{layerView:t,tileDescriptors:i}=this,r=t.layer,s=new V({context:this.context,filterExtent:this.extent,tileDescriptors:i,features:this.graphics});this._tileFetcher=s,this._suspended?s.suspend():s.resume(),e&&this.addHandles(m(()=>e.quality,e=>s.memoryFactor=e,f));const a="polygon"===this.context.geometryType?"polygonLodFactor":"polyline"===this.context.geometryType?"polylineLodFactor":null;a&&this.addHandles(m(()=>this.layerView.view?.qualitySettings?.graphics3D?.[a],e=>s.lodFactor=e||1,p));const l=e=>{s.maximumNumberOfFeatures=e,s.useTileCount=this.serviceDataCount>e},n=e=>{s.useTileCount=e>this.maximumNumberOfFeatures};"ogc-feature"!==r.type&&this._updatingHandles.add(()=>r.createQueryVersion,()=>this._dataFilterChanged()),this._updatingHandles.add(()=>this.layerView.effectiveDisplayFilter,()=>this._effectiveDisplayFilterChanged()),this._updatingHandles.add(()=>this.layerView.highlightIds,()=>this._displayFilterHighlightIdsChanged()),this._updatingHandles.add(()=>t.availableFields,(e,t)=>this._availableFieldsChanged(t,e)),this._updatingHandles.add(()=>t.requiredFields,(e,t)=>this._requiredFieldsChanged(t,e)),"customParameters"in r&&this._updatingHandles.add(()=>r.customParameters,()=>this.restart()),this.addHandles([r.on("apply-edits",e=>this._applyEdits(e)),m(()=>this.extent,e=>s.filterExtent=e,y),m(()=>this.tileDescriptors,e=>s.tileDescriptors=e,y),m(()=>this.maximumNumberOfFeatures,l,f),m(()=>this.serviceDataCount,n,f),m(()=>({featureTiles:e.featureTiles,show:I.FEATURE_TILE_FETCH_SHOW_TILES}),({show:t,featureTiles:i})=>{t&&s&&i?s.debugger??=new H(s,i.tilingScheme.toTileInfo(),e):s.debugger=o(s.debugger)},p)]),this._supportsExceedsLimitQuery||this._updatingHandles.add(()=>this.maxTotalSnapshotVertices,()=>this._updatingHandles.addPromise(this._updateSnapshotLimit(this.displayFeatureLimit,null,this._lifeCycleAbortController.signal)))}_modeChanged(){switch(this.mode){case"tiles":this._tilesHandle||(this._tilesHandle=this.layerView.view.enableFeatureTiles());break;default:l.getLogger(this).warn("Unhandled feature layer mode "+this.mode);case"snapshot":null!=this._tilesHandle&&(this._tilesHandle.remove(),this._tilesHandle=null)}}_dataFilterChanged(){this._set("maxTotalSnapshotVertices",0),this.notifyChange("maxTotalSnapshotVertices"),this._refetch({resetForceTilesMode:!0})}_effectiveDisplayFilterChanged(){"snapshot"!==this.mode&&this._refetch({resetForceTilesMode:!1})}_displayFilterHighlightIdsChanged(){"snapshot"!==this.mode&&null!=this._tileFetcher&&this._tileFetcher.refetchDisplayFilterHighlightTile()}_applyEdits(e){const t=this.layerView.layer;null!=this._tileFetcher&&this._tileFetcher.applyEdits(e).then(e=>{if(e){if(!this._lifeCycleAbortController)throw c();e.exceededTransferLimit&&"refresh"in t?t.refresh():(e.deletedFeatures.length||e.updatedFeatures.length||e.addedFeatures.length)&&this._updatingHandles.addPromise(this._updateServiceDataExtent(this._lifeCycleAbortController.signal))}}).catch(e=>{if(!d(e))throw e})}_availableFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this._refetch({resetForceTilesMode:!1})}_requiredFieldsChanged(e,t){null!=this._tileFetcher&&P(this._tileFetcher.availableFields,t)&&this.restart()}_createVertexLimitExceededQuery(e){const t=this.layerView.layer,i=t.createQuery();return i.returnGeometry=!1,i.outStatistics=[new b({statisticType:"exceedslimit",maxVertexCount:e,outStatisticFieldName:"exceedslimit",maxPointCount:1e8,maxRecordCount:1e8})],t.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),i}_createDataInfoQuery(){const e=this.layerView.layer,t=this.layerView,i=e.createQuery();return i.returnGeometry=!1,i.outSpatialReference=this.layerView.view.spatialReference,e.capabilities?.query.supportsCacheHint&&(i.cacheHint=!0),t.effectiveDisplayFilter&&(i.where=_(i.where,t.effectiveDisplayFilter.where)),i}_fullExtentIsAccurate(){const e=this.layerView.layer;if("definitionExpression"in e&&e.definitionExpression)return!1;switch(e.type){case"feature":case"catalog-footprint":case"oriented-imagery":return w(e.url);case"csv":case"geojson":case"ogc-feature":case"wfs":return!0;default:return}}async _updateServiceDataExtent(e){try{await this._tryUpdateServiceDataExtent(e)}catch(t){d(t)||this._set("serviceDataExtent",a(this.layerView.fullExtentInLocalViewSpatialReference)??null)}}async _tryUpdateServiceDataExtent(e){const t=this.layerView,i=t.layer,r=i.capabilities?.query.supportsExtent??!1,s=a(t.fullExtentInLocalViewSpatialReference),l=i.fullExtent,o=this._fullExtentIsAccurate(),n=this.serviceDataCount;if(r&&n<=M.maxFeatureCountForExtent&&(!s||!o)&&"queryExtent"in i){const t=this._createDataInfoQuery(),r=await i.queryExtent(t,{timeout:M.queryExtentTimeout,signal:e});this._set("serviceDataExtent",r.extent)}else if(s)this._set("serviceDataExtent",s);else if(null!=l){const e=l.spatialReference?await v(l,t.view.spatialReference):null;this._set("serviceDataExtent",e??null)}else this._set("serviceDataExtent",null)}async _updateServiceDataCount(e){const t=this.layerView.layer;if(!("queryFeatureCount"in t)||!has("featurelayer-snapshot-enabled"))return void this._set("serviceDataCount",M.noServiceDataCount);const r=await i(t.queryFeatureCount(this._createDataInfoQuery(),{timeout:M.queryStatisticsTimeout,signal:e}));if(!0===r.ok)this._set("serviceDataCount",r.value);else{if(d(r.error))throw r.error;this._set("serviceDataCount",M.noServiceDataCount)}}get _supportsExceedsLimitQuery(){const e=this.layerView.layer;return null!=e.capabilities&&e.capabilities.operations&&e.capabilities.operations.supportsExceedsLimitStatistics}get _minimumNumberOfVerticesForGeometry(){switch(this.layerView.layer.geometryType){case"point":case"multipoint":return 1;case"polygon":return 4;case"polyline":return 2;case"multipatch":case"mesh":return 3;default:return 0}}async _updateSnapshotLimit(e,t,r){if(null==e?.averageSymbolComplexity)return void(this._snapshotLimitExceeded=!1);const{maximumTotalNumberOfVertices:s,averageSymbolComplexity:a}=e,{verticesPerFeature:l,verticesPerCoordinate:o}=a,n=l<=0,h=this._minimumNumberOfVerticesForGeometry>1;if(!n&&!h)return void(this._snapshotLimitExceeded=!1);0!==l&&null!=t&&await t;const u=Math.min(s,A),c=this.serviceDataCount,p=c!==M.noServiceDataCount;let m=p?Math.ceil((u-c*l)/(o||1)):Math.ceil(u/(o||1));if(h&&(m=Math.min(m,N)),p&&this._minimumNumberOfVerticesForGeometry*c>m)return void(this._snapshotLimitExceeded=!0);if(!this._supportsExceedsLimitQuery||!has("featurelayer-snapshot-enabled"))return void(this._snapshotLimitExceeded=this.maxTotalSnapshotVertices>m);const f=await i(this.layerView.layer.queryFeatures(this._createVertexLimitExceededQuery(m),{timeout:M.queryStatisticsTimeout,signal:r}));if(!1===f.ok){if(d(f.error))throw f.error;return void(this._snapshotLimitExceeded=!1)}const y=f.value.features[0];this._snapshotLimitExceeded=!!y?.attributes&&!!y.attributes.exceedslimit}async _fetchServiceDataInfo(){this._cancelFetchServiceDataInfo(),await D(this.layerView.layer);let e=new AbortController;const t=e.signal,i=this._updateServiceDataCount(t),r=Promise.allSettled([i,this._updateSnapshotLimit(this.displayFeatureLimit,i,t)]),s=r.then(()=>this._updateServiceDataExtent(t)).catch(e=>{d(e)||l.getLogger(this).error("#fetchServiceDataInfo()",e)}).then(()=>{s===this._fetchDataInfoPromise&&(this._fetchDataInfoPromise=null,this._fetchDataInfoAbortController=null),e=null});return e&&(this._fetchDataInfoPromise=s),this._fetchDataInfoAbortController=e,r.then(()=>{},()=>{})}_cancelFetchServiceDataInfo(){const e=this._fetchDataInfoAbortController;e&&(this._fetchDataInfoAbortController=null,this._fetchDataInfoPromise=null,e.abort())}get performanceInfo(){return{storedFeatures:this._tileFetcher?.storedFeatures??0,totalFeatures:this._tileFetcher?.totalFeatures??0,totalVertices:this._tileFetcher?.totalVertices??0,missingTiles:this._tileFetcher?.missingTiles??0}}};e([g({readOnly:!0})],L.prototype,"type",void 0),e([g({constructOnly:!0})],L.prototype,"graphics",void 0),e([g({constructOnly:!0})],L.prototype,"layerView",void 0),e([g({constructOnly:!0})],L.prototype,"context",void 0),e([g({readOnly:!0})],L.prototype,"dataUpdating",null),e([g()],L.prototype,"extent",null),e([g()],L.prototype,"updating",null),e([g({readOnly:!0})],L.prototype,"_updatingHandles",void 0),e([g()],L.prototype,"updatingTotal",null),e([g()],L.prototype,"updatingRemaining",null),e([g()],L.prototype,"expectedFeatureDiff",null),e([g()],L.prototype,"memoryForUnusedFeatures",null),e([g()],L.prototype,"maximumNumberOfFeaturesExceeded",null),e([g({readOnly:!0})],L.prototype,"serviceDataExtent",void 0),e([g({readOnly:!0})],L.prototype,"serviceDataCount",void 0),e([g()],L.prototype,"_snapshotLimitExceeded",void 0),e([g()],L.prototype,"displayFeatureLimit",void 0),e([g({type:Number})],L.prototype,"maximumNumberOfFeatures",null),e([g({readOnly:!0})],L.prototype,"hasAllFeatures",null),e([g({readOnly:!0})],L.prototype,"hasAllFeaturesInView",null),e([g({readOnly:!0})],L.prototype,"hasFullGeometries",null),e([g()],L.prototype,"_forceTilesMode",void 0),e([g({readOnly:!0})],L.prototype,"mode",null),e([g({readOnly:!0})],L.prototype,"maxTotalSnapshotVertices",null),e([g({readOnly:!0})],L.prototype,"tileDescriptors",null),e([g()],L.prototype,"_tileFetcher",void 0),e([g()],L.prototype,"_fetchDataInfoPromise",void 0),L=e([F("esri.layers.graphics.controllers.FeatureTileController3D")],L);const O=1e4,A=1e6,q=12e3,j=1e4,N=5e6;function P(e,t){if(!t)return!1;for(const i of t)if(!e.has(i))return!0;return!1}class M{static{this.noServiceDataCount=1/0}static{this.maxSnapshotMinScaleFactor=5}static reset(){M.maxFeatureCountForExtent=O,M.queryStatisticsTimeout=q,M.queryExtentTimeout=j}}M.reset();export{L as FeatureTileController3D,M as FeatureTileController3DConstants};