@arcgis/core 6.0.0-next.14 → 6.0.0-next.16

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 (398) hide show
  1. package/analysis/LineOfSightAnalysis.d.ts +49 -32
  2. package/analysis/LineOfSightAnalysisObserver.d.ts +19 -3
  3. package/analysis/LineOfSightAnalysisTarget.d.ts +19 -3
  4. package/analysis/Viewshed.d.ts +23 -3
  5. package/analysis/ViewshedAnalysis.d.ts +33 -13
  6. package/arcade/geometry/operatorsWorkerConnection.js +1 -1
  7. package/assets/esri/core/workers/RemoteClient.js +1 -1
  8. package/assets/esri/core/workers/chunks/00d66e3fba5ab4d2aa3c.js +1 -0
  9. package/assets/esri/core/workers/chunks/{d994bcf0a65d1c07160f.js → 0320cbd825f9a4222042.js} +1 -1
  10. package/assets/esri/core/workers/chunks/08fe248e412bb170210d.js +1 -0
  11. package/assets/esri/core/workers/chunks/{fb444954be74c1962ced.js → 10d80e793019dfb45ca2.js} +1 -1
  12. package/assets/esri/core/workers/chunks/14d5d219e7fe017f23f0.js +1 -0
  13. package/assets/esri/core/workers/chunks/164e74d586297946a717.js +1 -0
  14. package/assets/esri/core/workers/chunks/{1bca39e0e651426bdbb5.js → 1b1d3f6916d2cb751435.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ed6e9d7f71bfd2691717.js → 1c77de1e79860f8d2228.js} +1 -1
  16. package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +1 -0
  17. package/assets/esri/core/workers/chunks/237a1f68a0efbfe5b77c.js +1 -0
  18. package/assets/esri/core/workers/chunks/23c43f09c4a4749516e1.js +1 -0
  19. package/assets/esri/core/workers/chunks/{3418877328f4f0830300.js → 24dac4970526a4e0ae63.js} +1 -1
  20. package/assets/esri/core/workers/chunks/26ceb0ff8d93dbb9b84f.js +1 -0
  21. package/assets/esri/core/workers/chunks/2acf2952cef69e382a35.js +1 -0
  22. package/assets/esri/core/workers/chunks/{481589c3eddad6e026ad.js → 369780276b2755361f7d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{4df6cb1bee5d0720a43e.js → 36cbd614454581aaf334.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{1e0d2715d603f48a7e0b.js → 370aad23df597db80d65.js} +1 -1
  25. package/assets/esri/core/workers/chunks/3baa4a9c52f41bfd6abb.js +1 -0
  26. package/assets/esri/core/workers/chunks/42d44c7d532df5ee70e9.js +1 -0
  27. package/assets/esri/core/workers/chunks/42e985a576d7aaeed0cf.js +1 -0
  28. package/assets/esri/core/workers/chunks/{6400446b7615b97c3521.js → 45f826554499c38968c6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/48cc58890fddbcf69cef.js +1 -0
  30. package/assets/esri/core/workers/chunks/494bd434fee9032e1d02.js +1 -0
  31. package/assets/esri/core/workers/chunks/{33e4ff228a8c81b99022.js → 4abd3753cd9b80e4d937.js} +1 -1
  32. package/assets/esri/core/workers/chunks/4bbe1f28f5f16a6bef05.js +1 -0
  33. package/assets/esri/core/workers/chunks/4c389472b8cdb0c55154.js +1 -0
  34. package/assets/esri/core/workers/chunks/4e4f747de424941a0bfa.js +1 -0
  35. package/assets/esri/core/workers/chunks/5529831dd891382c79df.js +1 -0
  36. package/assets/esri/core/workers/chunks/5736feefa261589b6273.js +1 -0
  37. package/assets/esri/core/workers/chunks/576248e9ae2654569420.js +1 -0
  38. package/assets/esri/core/workers/chunks/5acb422fe3cf693d9d4f.js +1 -0
  39. package/assets/esri/core/workers/chunks/{aeaaff7a4b1a99540f52.js → 5cb26bbaa08114aec5ce.js} +1 -1
  40. package/assets/esri/core/workers/chunks/661c6324529dd17b297e.js +1 -0
  41. package/assets/esri/core/workers/chunks/68dd1fd2025c7125ead1.js +1 -0
  42. package/assets/esri/core/workers/chunks/{89e76de5ae3328d821a4.js → 69f6d5997b8ff1326e39.js} +1 -1
  43. package/assets/esri/core/workers/chunks/6a8dd8b18b0b825b0c1b.js +1 -0
  44. package/assets/esri/core/workers/chunks/{a40b6d8b5c73e06e14d4.js → 6c255c029d67423e4dac.js} +1 -1
  45. package/assets/esri/core/workers/chunks/7446d0dfebf93e86c098.js +1 -0
  46. package/assets/esri/core/workers/chunks/{688f2dbf784e66082308.js → 74c866e0b66e61751861.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{3ffda5bf0b91700dc308.js → 78643f116677950ea29a.js} +1 -1
  48. package/assets/esri/core/workers/chunks/{916b363c342b61ba5461.js → 787c1a8bda7d745633f2.js} +1 -1
  49. package/assets/esri/core/workers/chunks/7b5f3c79e0605c32b267.js +1 -0
  50. package/assets/esri/core/workers/chunks/7bbfe9ff352afc566367.js +1 -0
  51. package/assets/esri/core/workers/chunks/{ac5a6603f7fa78d3e4c8.js → 7e8611cb709f105946f5.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{05cd33d41d91f8d09633.js → 7fb7493f483cd9878bfa.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{acfa03c65ba3ca6c5685.js → 8715661a838361d4211a.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{601e1d020b8115497944.js → 8a485130781b49dbf608.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{0ccab50877b24f862d6e.js → 8ac2098ecdc40ad41055.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{a655ebdb4bf0660615a2.js → 8b4e9fd88c0c313416d4.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{4e544de61f07ca660236.js → 8c12269d26f5a4c753cb.js} +1 -1
  58. package/assets/esri/core/workers/chunks/8e19629899a5becf8e19.js +1 -0
  59. package/assets/esri/core/workers/chunks/91dd65cf877c8f2e01a7.js +1 -0
  60. package/assets/esri/core/workers/chunks/{46b4fb6a7fe4877b0efc.js → 94baa354e50c03b82b25.js} +2 -2
  61. package/assets/esri/core/workers/chunks/950d4578dc450467404c.js +1 -0
  62. package/assets/esri/core/workers/chunks/{68be3fb88ca61f82fb90.js → 95dbbddac6581b9d671f.js} +1 -1
  63. package/assets/esri/core/workers/chunks/98be2f621801e230aa01.js +1 -0
  64. package/assets/esri/core/workers/chunks/9b051745d24d1f43480b.js +1 -0
  65. package/assets/esri/core/workers/chunks/9d61740ef8bdcc162be1.js +1 -0
  66. package/assets/esri/core/workers/chunks/{eb04e1717a1002cda3ab.js → 9f06ec95bdf0d0b52b41.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{fafb92ca2c5e4b0b2c23.js → a09d2e1e2540921e4717.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{3b3e519f15ed52c83f0c.js → a49fe94933b65b4b64f8.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{1819c45655c836b9a8d7.js → a4d3944700f1cc240176.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{90bdf86f553e2742d67c.js → a7bd5ba4d7d97411fd33.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{900181f68449d8f82eeb.js → aa1ac7954e4f0fefe15b.js} +1 -1
  72. package/assets/esri/core/workers/chunks/ac24b4370dc7194a3107.js +1 -0
  73. package/assets/esri/core/workers/chunks/{b8337492e2b753aefac4.js → ace41659a5ca0e5abfc3.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{3c0ed15b544df6fb0903.js → b48952e1fb4cb7360dd0.js} +1 -1
  75. package/assets/esri/core/workers/chunks/b5e7475cc5fbf31289d3.js +1 -0
  76. package/assets/esri/core/workers/chunks/{f3da30d7300b92bd8bb0.js → befa32b9e7b3fbdd431e.js} +1 -1
  77. package/assets/esri/core/workers/chunks/{0f617980c7dd9ad0444f.js → bf35927979fc5e7e0478.js} +1 -1
  78. package/assets/esri/core/workers/chunks/c4ddac23bd649d24f3f2.js +1 -0
  79. package/assets/esri/core/workers/chunks/{4e6f40cbdb8c508e6df1.js → c5a9e77977e867a75ff2.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{25f19fc929f25ddd628c.js → c79934cd6883307203f8.js} +1 -1
  81. package/assets/esri/core/workers/chunks/cddc3e285f763ccf33c2.js +1 -0
  82. package/assets/esri/core/workers/chunks/d08ff41e2a9bcd58b64a.js +1 -0
  83. package/assets/esri/core/workers/chunks/d311ff96a5a2791d8cfc.js +1 -0
  84. package/assets/esri/core/workers/chunks/d62afb71f4ece4283994.js +1 -0
  85. package/assets/esri/core/workers/chunks/dc1761cba0454fda3cf9.js +1 -0
  86. package/assets/esri/core/workers/chunks/{4ac1d3e49e242e373a92.js → e0650b1408197d3ac862.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{3ff6d1ed3c0f1285f3e7.js → e0d9dc97985561320bd4.js} +1 -1
  88. package/assets/esri/core/workers/chunks/eaddffcc7004101fc230.js +1 -0
  89. package/assets/esri/core/workers/chunks/eb2652ec48faa78de3c5.js +1 -0
  90. package/assets/esri/core/workers/chunks/eca44e53bcee9b08d70a.js +1 -0
  91. package/assets/esri/core/workers/chunks/f00458654c7c34c369ef.js +1 -0
  92. package/assets/esri/core/workers/chunks/f3cd610084e3f4d8656b.js +1 -0
  93. package/assets/esri/core/workers/chunks/f47fe4433b05fca5c3ad.js +1 -0
  94. package/assets/esri/core/workers/chunks/f7bfa3d33b05b250ce33.js +1 -0
  95. package/assets/esri/core/workers/chunks/f91bc1cb1014e05be763.js +1 -0
  96. package/assets/esri/core/workers/chunks/{aadfe34a99c9ec7a0e11.js → f9c5aa0bbf23e780fecc.js} +1 -1
  97. package/assets/esri/core/workers/chunks/f9ff27cfcf0538ac5e26.js +1 -0
  98. package/assets/esri/core/workers/chunks/{19676b2c5f8b0a5ee680.js → facd1ff23203fed67686.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{40a584cb952e94326e9e.js → fcb86d24fc7e0666b564.js} +1 -1
  100. package/assets/esri/libs/pdfjs/wasm/openjpeg_nowasm_fallback.js +1 -0
  101. package/chunks/Distance2DCalculator-DjIp2uQi.js +1 -1
  102. package/chunks/Envelope.js +1 -1
  103. package/chunks/MultiPathImpl.js +1 -1
  104. package/chunks/OperatorGeodeticArea.js +1 -1
  105. package/chunks/OperatorShapePreservingLength.js +1 -1
  106. package/chunks/OperatorShapePreservingProject.js +1 -1
  107. package/chunks/UnitFactory.js +1 -1
  108. package/chunks/basis_encoder.js +1 -1
  109. package/chunks/basis_transcoder.js +1 -1
  110. package/chunks/index.js +1 -1
  111. package/chunks/lclayout.js +1 -1
  112. package/config.d.ts +2 -0
  113. package/config.js +1 -1
  114. package/core/ObjectPool.js +1 -1
  115. package/core/PooledArray.js +1 -1
  116. package/core/accessorSupport/DefaultsStore.js +1 -1
  117. package/core/accessorSupport/MultiOriginStore.js +1 -1
  118. package/core/accessorSupport/Store.js +1 -1
  119. package/core/accessorSupport/decorators/reader.js +1 -1
  120. package/core/accessorSupport/decorators/writer.js +1 -1
  121. package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
  122. package/core/workers/WorkerOwner.js +1 -1
  123. package/core/workers/workerFactory.js +1 -1
  124. package/core/workers/workers.js +2 -2
  125. package/core/workers.d.ts +9 -0
  126. package/form/elements/inputs/DynamicChoiceInput.d.ts +4 -2
  127. package/geometry/Mesh.js +1 -1
  128. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  129. package/geometry/operators/gx/operatorOffset.js +1 -1
  130. package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
  131. package/geometry/operators/support/jsonConverter.js +1 -1
  132. package/geometry/support/buffer/BufferPool.js +1 -1
  133. package/geometry/support/coordsUtils.js +1 -1
  134. package/geometry/support/curves/bezierCurveUtils.js +1 -1
  135. package/geometry/support/curves/ellipticArc7Utils.js +1 -1
  136. package/geometry/support/meshUtils/merge.js +1 -1
  137. package/geometry/support/meshUtils/rotate.js +1 -1
  138. package/geometry/support/meshUtils.d.ts +5 -6
  139. package/geometry/support/polygonExtentClipping.js +1 -1
  140. package/identity/Credential.js +1 -1
  141. package/interfaces.d.ts +18 -9
  142. package/kernel.js +1 -1
  143. package/layers/AnnotationFeatureLayer.d.ts +2 -2
  144. package/layers/AnnotationFeatureLayer.js +1 -1
  145. package/layers/CatalogLayer.d.ts +2 -2
  146. package/layers/CatalogLayer.js +1 -1
  147. package/layers/DimensionFeatureLayer.d.ts +2 -2
  148. package/layers/DimensionFeatureLayer.js +1 -1
  149. package/layers/FeatureLayer.d.ts +4 -4
  150. package/layers/FeatureLayer.js +1 -1
  151. package/layers/GeospatialPDFLayer.d.ts +154 -4
  152. package/layers/ImageryTileLayer.js +1 -1
  153. package/layers/Layer.d.ts +2 -0
  154. package/layers/LineOfSightLayer.d.ts +10 -8
  155. package/layers/SceneLayer.js +1 -1
  156. package/layers/SubtypeGroupLayer.d.ts +2 -2
  157. package/layers/SubtypeGroupLayer.js +1 -1
  158. package/layers/ViewshedLayer.d.ts +1 -1
  159. package/layers/VoxelLayer.js +1 -1
  160. package/layers/WMSLayer.js +1 -1
  161. package/layers/geospatialPDF/GeospatialPDFFrame.js +1 -1
  162. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +9 -9
  163. package/layers/geospatialPDF/GeospatialPDFWorkerClient.js +1 -1
  164. package/layers/geospatialPDF/LGIDictMapFrame.js +1 -1
  165. package/layers/geospatialPDF/ViewportMeasureFrame.js +1 -1
  166. package/layers/geospatialPDF/geospatialPDFParserUtils.js +1 -1
  167. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  168. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  169. package/layers/graphics/data/QueryEngineResult.js +1 -1
  170. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  171. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  172. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  173. package/layers/mixins/{FeatureLayerReload.d.ts → ReloadableLayer.d.ts} +5 -3
  174. package/layers/mixins/ReloadableLayer.js +2 -0
  175. package/layers/raster/datasets/BaseRaster.js +1 -1
  176. package/layers/raster/datasets/GeospatialPDFRaster.js +1 -1
  177. package/layers/raster/datasets/ImageAuxRaster.js +2 -2
  178. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  179. package/layers/raster/datasets/InMemoryRaster.js +1 -1
  180. package/layers/raster/datasets/MRFRaster.js +1 -1
  181. package/layers/raster/datasets/TIFFRaster.js +1 -1
  182. package/layers/raster/datasets/WCSRaster.js +1 -1
  183. package/layers/raster/formats/ImageCanvasDecoder.js +1 -1
  184. package/layers/raster/formats/RasterCodec.js +1 -1
  185. package/layers/raster/formats/TiffDecoder.js +1 -1
  186. package/layers/raster/formats/Zlib.js +1 -1
  187. package/layers/raster/functions/stretchUtils.js +1 -1
  188. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  189. package/layers/support/FieldsIndex.js +1 -1
  190. package/layers/support/LabelClass.d.ts +3 -2
  191. package/layers/support/PortalItemData.d.ts +31 -8
  192. package/layers/support/RasterWorker.js +1 -1
  193. package/layers/support/featureReductionProperties.js +1 -1
  194. package/layers/support/kmlUtils.js +1 -1
  195. package/layers/support/types.d.ts +4 -1
  196. package/layers/video/VideoController.js +10 -10
  197. package/libs/maquette/projection.js +1 -1
  198. package/networks/UtilityNetworkTraceAnalysis.js +1 -1
  199. package/package.json +5 -5
  200. package/popup/FeatureModel.js +1 -1
  201. package/popup/FeaturesModel.js +1 -1
  202. package/portal/Portal.js +1 -1
  203. package/request/process.js +1 -1
  204. package/request/types.d.ts +7 -0
  205. package/rest/knowledgeGraph/ObjectValue.js +1 -1
  206. package/rest/knowledgeGraphService.js +1 -1
  207. package/rest/networks/trace.js +1 -1
  208. package/rest/query/executeQuery.js +1 -1
  209. package/smartMapping/raster/renderers/shadedRelief.js +1 -1
  210. package/smartMapping/renderers/univariateColorSize.js +1 -1
  211. package/smartMapping/statistics/support/statsWorker.js +1 -1
  212. package/smartMapping/statistics/support/utils.js +1 -1
  213. package/smartMapping/support/clusterUtils.js +1 -1
  214. package/statistics/utils.js +1 -1
  215. package/symbols/cim/CIMCursor.js +1 -1
  216. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  217. package/symbols/cim/cimAnalyzer.js +1 -1
  218. package/symbols/support/ElevationInfo.d.ts +4 -3
  219. package/undoredo/support/Services.js +1 -1
  220. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +2 -2
  221. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  222. package/views/2d/grid/GridView2D.js +1 -1
  223. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  224. package/views/2d/layers/features/sources/strategies/FeatureHybridTileLoadStrategy.js +1 -1
  225. package/views/2d/layers/features/sources/strategies/FeaturePagedTileLoadStrategy.js +1 -1
  226. package/views/2d/layers/features/sources/strategies/FeatureSnapshotLoadStrategy.js +1 -1
  227. package/views/2d/viewpointUtils.js +1 -1
  228. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  229. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  230. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  231. package/views/3d/analysis/LineOfSight/LineOfSightItemTool.js +1 -1
  232. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  233. package/views/3d/analysis/LineOfSight/{LineOfSightRootPlugin.js → LineOfSightPlacementRootPlugin.js} +1 -1
  234. package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
  235. package/views/3d/analysis/LineOfSight/types.d.ts +14 -3
  236. package/views/3d/analysis/LineOfSightAnalysisView3D.d.ts +39 -13
  237. package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
  238. package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
  239. package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
  240. package/views/3d/analysis/Viewshed/types.d.ts +7 -0
  241. package/views/3d/analysis/ViewshedAnalysisView3D.d.ts +43 -15
  242. package/views/3d/input/handlers/KeyboardNavigation.js +1 -1
  243. package/views/3d/interactive/editingTools/ManipulatedObject3DGraphic.js +1 -1
  244. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  245. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  246. package/views/3d/interactive/editingTools/transform/ExtentTransformTool.js +1 -1
  247. package/views/3d/interactive/editingTools/transform/ScaleRotateTransform.js +1 -1
  248. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  249. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  250. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  251. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  252. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  253. package/views/3d/layers/graphics/Graphics3DGraphic.js +1 -1
  254. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  255. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  256. package/views/3d/layers/graphics/SpatialIndex2D.js +1 -1
  257. package/views/3d/layers/i3s/I3SNode.js +1 -1
  258. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  259. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  260. package/views/3d/layers/i3s/LayerElevationProvider.js +1 -1
  261. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  262. package/views/3d/layers/support/FeatureTileFetcher3DDebugger.js +1 -1
  263. package/views/3d/layers/support/ImageHighlightHelper3D.js +1 -1
  264. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  265. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  266. package/views/3d/support/MemoryController.js +1 -1
  267. package/views/3d/support/elevationUpdateExtentUtils.js +1 -1
  268. package/views/3d/support/elevationUpdateUtils.js +1 -1
  269. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  270. package/views/3d/support/sphereExtentUtils.js +2 -0
  271. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  272. package/views/3d/terrain/OverlayRenderer.js +1 -1
  273. package/views/3d/terrain/PatchRenderData.js +1 -1
  274. package/views/3d/terrain/TerrainData.js +1 -1
  275. package/views/3d/terrain/terrainUtils.js +1 -1
  276. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  277. package/views/3d/webgl-engine/effects/geometry/RenderOccluded.js +1 -1
  278. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  279. package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
  280. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  281. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  282. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  283. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  284. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  285. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  286. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  287. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  288. package/views/3d/webgl-engine/materials/internal/MaterialUtil.js +1 -1
  289. package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
  290. package/views/SceneView.js +1 -1
  291. package/views/ToolViewManager.js +1 -1
  292. package/views/draw/DrawOperation.js +1 -1
  293. package/views/draw/support/InteractiveHandle.js +1 -1
  294. package/views/draw/support/Reshape.js +1 -1
  295. package/views/draw/support/createUtils.js +1 -1
  296. package/views/draw/support/editingSessionUtils.js +1 -1
  297. package/views/draw/support/managers/InteractiveHandleManager.js +1 -1
  298. package/views/interactive/SegmentLabels.js +1 -1
  299. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  300. package/views/interactive/editGeometry/EditGeometryOperations.js +1 -1
  301. package/views/interactive/editGeometry/operations/SetAllVertexPositions.js +1 -1
  302. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  303. package/views/interactive/options/TooltipOptions.d.ts +2 -0
  304. package/views/interactive/sketch/SketchTooltipOptions.d.ts +2 -0
  305. package/views/interactive/sketch/constraintUtils.js +1 -1
  306. package/views/interactive/snapping/SnappingDragPipelineStep.js +1 -1
  307. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  308. package/views/layers/LayerView.js +1 -1
  309. package/views/layers/LineOfSightLayerView.d.ts +35 -13
  310. package/views/layers/SketchLayerView.d.ts +1 -0
  311. package/views/layers/ViewshedLayerView.d.ts +36 -12
  312. package/views/webgl/Program.js +1 -1
  313. package/views/webgl/Texture.js +1 -1
  314. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  315. package/widgets/BatchAttributeForm/inputs/support/DynamicChoiceController.js +1 -1
  316. package/widgets/BatchAttributeForm.js +1 -1
  317. package/widgets/Directions.js +1 -1
  318. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  319. package/widgets/Editor/EditorViewModel.d.ts +10 -1
  320. package/widgets/Editor/legacy/CreateFeaturesWorkflow.js +1 -1
  321. package/widgets/Editor.d.ts +10 -1
  322. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  323. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  324. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  325. package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
  326. package/widgets/FeatureTable/support/TableTemplate.js +1 -1
  327. package/widgets/HistogramRangeSlider.d.ts +2 -2
  328. package/widgets/HistogramRangeSlider.js +1 -1
  329. package/widgets/Legend.d.ts +1 -0
  330. package/widgets/Print.js +1 -1
  331. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.d.ts +5 -2
  332. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  333. package/widgets/ScaleRangeSlider.js +1 -1
  334. package/widgets/Slice.js +1 -1
  335. package/widgets/UtilityNetworkTraceAnalysis/UtilityNetworkTraceAnalysisViewModel.js +1 -1
  336. package/widgets/ValuePicker/ValuePickerBaseComponent.d.ts +5 -1
  337. package/widgets/ValuePicker/ValuePickerCollection.d.ts +2 -0
  338. package/widgets/ValuePicker/ValuePickerCombobox.d.ts +7 -1
  339. package/widgets/ValuePicker/ValuePickerLabel.d.ts +7 -1
  340. package/widgets/ValuePicker/ValuePickerSlider.d.ts +2 -0
  341. package/widgets/ValuePicker/ValuePickerSliderVisibleElements.d.ts +5 -1
  342. package/widgets/ValuePicker/ValuePickerVisibleElements.d.ts +5 -1
  343. package/widgets/ValuePicker/types.d.ts +2 -0
  344. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  345. package/widgets/support/SelectionList.js +1 -1
  346. package/widgets/support/componentsUtils.js +1 -1
  347. package/assets/esri/core/workers/chunks/024b44c0c8876627f904.js +0 -1
  348. package/assets/esri/core/workers/chunks/02c5d027bdaee67869cf.js +0 -1
  349. package/assets/esri/core/workers/chunks/03261b9451e293a0fac8.js +0 -1
  350. package/assets/esri/core/workers/chunks/037a8cc19debbaaa4e10.js +0 -1
  351. package/assets/esri/core/workers/chunks/0c8c01097847617261b9.js +0 -1
  352. package/assets/esri/core/workers/chunks/0d931c7579b6409a696d.js +0 -1
  353. package/assets/esri/core/workers/chunks/12c154342fff876f2f1e.js +0 -1
  354. package/assets/esri/core/workers/chunks/1c65ab9ed611c322ce27.js +0 -1
  355. package/assets/esri/core/workers/chunks/1e11d2e97d17685b878a.js +0 -1
  356. package/assets/esri/core/workers/chunks/1f339247b68b061ab0a4.js +0 -1
  357. package/assets/esri/core/workers/chunks/21ddb26526bcb2b122c3.js +0 -1
  358. package/assets/esri/core/workers/chunks/22e8c0aad2fe75943865.js +0 -1
  359. package/assets/esri/core/workers/chunks/2eae542fe7f0f6576ac1.js +0 -1
  360. package/assets/esri/core/workers/chunks/408e81c8f1eff8a7b379.js +0 -1
  361. package/assets/esri/core/workers/chunks/444e5f214abce3d607cd.js +0 -1
  362. package/assets/esri/core/workers/chunks/46a7da93a63663878583.js +0 -1
  363. package/assets/esri/core/workers/chunks/4a1e23e021bac37a88ab.js +0 -1
  364. package/assets/esri/core/workers/chunks/4c4117e28ea358a32088.js +0 -1
  365. package/assets/esri/core/workers/chunks/54b18559280a7d2a8d93.js +0 -1
  366. package/assets/esri/core/workers/chunks/59b216b60464611742d4.js +0 -1
  367. package/assets/esri/core/workers/chunks/5bfea0c55aca826de536.js +0 -1
  368. package/assets/esri/core/workers/chunks/62ac588f7dd1d24d0c9d.js +0 -1
  369. package/assets/esri/core/workers/chunks/62c8c9ad09e0166207fd.js +0 -1
  370. package/assets/esri/core/workers/chunks/62d6e101e9bd9557a410.js +0 -1
  371. package/assets/esri/core/workers/chunks/6558488ea96620439f34.js +0 -1
  372. package/assets/esri/core/workers/chunks/665e31c494d2af505acc.js +0 -1
  373. package/assets/esri/core/workers/chunks/6f4e6022a52de0c54aab.js +0 -1
  374. package/assets/esri/core/workers/chunks/7267b17de212207142c9.js +0 -1
  375. package/assets/esri/core/workers/chunks/7ef182e24cad50815b4e.js +0 -1
  376. package/assets/esri/core/workers/chunks/8293600f94553afc8c38.js +0 -1
  377. package/assets/esri/core/workers/chunks/8431ca60ad33d594e323.js +0 -1
  378. package/assets/esri/core/workers/chunks/876f7633c15f1e31078d.js +0 -1
  379. package/assets/esri/core/workers/chunks/8ca9648eacb894283513.js +0 -1
  380. package/assets/esri/core/workers/chunks/91ebb2ccab1889eb7e81.js +0 -1
  381. package/assets/esri/core/workers/chunks/9ce91a909eccc4dfe388.js +0 -1
  382. package/assets/esri/core/workers/chunks/9e1a3b6a08c96dcefdde.js +0 -1
  383. package/assets/esri/core/workers/chunks/9e3e442a9874ed23a043.js +0 -1
  384. package/assets/esri/core/workers/chunks/ad76f7ab2f3e6d5a5b3c.js +0 -1
  385. package/assets/esri/core/workers/chunks/aff32980d91dab07dfb7.js +0 -1
  386. package/assets/esri/core/workers/chunks/bbf993dba74850bbf9d7.js +0 -1
  387. package/assets/esri/core/workers/chunks/d8f1cefcad02d7353d4b.js +0 -1
  388. package/assets/esri/core/workers/chunks/d938987344bce83cc660.js +0 -1
  389. package/assets/esri/core/workers/chunks/ddf0671976648f621269.js +0 -1
  390. package/assets/esri/core/workers/chunks/de02f60258e6985ef676.js +0 -1
  391. package/assets/esri/core/workers/chunks/e10b57aefcc89671116e.js +0 -1
  392. package/assets/esri/core/workers/chunks/e65dfa19f030ec298437.js +0 -1
  393. package/assets/esri/core/workers/chunks/f122c18af10e56f9ec2b.js +0 -1
  394. package/assets/esri/core/workers/chunks/f92364afaefbac7e8f77.js +0 -1
  395. package/assets/esri/core/workers/chunks/fd9663952d5a94f3a83f.js +0 -1
  396. package/assets/esri/core/workers/chunks/fe9879ecd69ac4329291.js +0 -1
  397. package/layers/mixins/FeatureLayerReload.js +0 -2
  398. /package/views/3d/analysis/LineOfSight/{lineOfSightPlacementUtils.js → placementUtils.js} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Error.js";import i from"../core/Logger.js";import{removeMaybe as a}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as s,throwIfAbortError as ee}from"../core/promiseUtils.js";import{watch as c}from"../core/reactiveUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import f from"../graphic/ImageryTileGraphicOrigin.js";import p from"./Layer.js";import{ArcGISService as m}from"./mixins/ArcGISService.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{CustomParametersMixin as te}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as v}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as y}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as b}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{TiledImagery as C}from"./mixins/TiledImagery.js";import{isFunctionRaster as w,getPrimaryRasters as T}from"./raster/datasets/datasetUtils.js";import E from"./raster/datasets/FunctionRaster.js";import D from"./raster/datasets/RasterFactory.js";import{getPrimaryRasterUrls as O,create as k}from"./raster/functions/rasterFunctionHelper.js";import{legendEnabled as A,screenSizePerspectiveEnabled as j}from"./support/commonProperties.js";import M from"./support/Field.js";import{getServicePixelValueField as N,getRawServicePixelValueField as P,getRasterAttributeTableFields as F,getMagnitudeField as I,getDirectionField as L,getMultidimensionalFields as R,commonRasterFieldNames as z,setDefaultRasterFieldFormats as B}from"./support/rasterFieldUtils.js";import V from"./support/RasterFunction.js";import{getRasterJobHandler as H,releaseRasterJobHandler as U}from"./support/rasterJobHelper.js";import W from"./support/TileInfo.js";import{logInvalidElevationInfoWarning as G,elevationModeUnsupportedMessage as K,featureExpressionUnsupportedMessage as q}from"../support/elevationInfoUtils.js";import{createPopupTemplate as J}from"../support/popupUtils.js";import Y from"../symbols/support/ElevationInfo.js";import{addLayerUnsupportedError as X}from"../webdoc/support/unsupportedErrors.js";let Z=class extends h(x(g(_(y(te(C(v(S(m(b(o(n(p))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new f(this),this.legendEnabled=!0,this.isReference=null,this.listMode=`show`,this.sourceJSON=null,this.version=null,this.type=`imagery-tile`,this.operationalLayerType=`ArcGISTiledImageServiceLayer`,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=s(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/imageryUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`Image Service`]},e).catch(ee).then(()=>this._openRaster(t))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=a(this._releaseWorkerHandle)}set elevationInfo(e){e?.mode!==`relative-to-scene`&&this._set(`elevationInfo`,e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[N(`Pixel Value`),P(`Raw Pixel Value`)],t=this.raster?.rasterInfo??this.serviceRasterInfo,n=t?.attributeTable;if(n){let t=F(n);e.push(...t)}let r=t?.dataType,i=t?.multidimensionalInfo;if((r===`vector-magdir`||r===`vector-uv`)&&i!=null){let t=i.variables[0].unit?.trim(),n=I(t),r=L();e.push(n,r)}if(i){let t=R(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){let{rasterFields:t}=this,n=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==z.rawServicePixelValue)),r=J({fields:t,title:this.title},{...e,visibleFieldNames:n}),{rasterInfo:i}=this.raster;return r?.fieldInfos&&i&&B(r.fieldInfos,i),r}async generateRasterInfo(e,t){let n=d(V,e);if(await this.load(),!n||n.functionName?.toLowerCase()===`none`)return this.serviceRasterInfo;try{let{rasterInfo:e}=await this._openFunctionRaster(n,t);return e}catch(e){throw e instanceof r?e:new r(`imagery-tile-layer`,`the given raster function is not supported`)}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsExportMapTiles(){let e=this._primaryRasters[0]??this.raster,t=e?.datasetFormat===`RasterTileServer`,n=!!this.sourceJSON?.exportTilesAllowed,r=this.sourceJSON?.datasetFormat?.toLowerCase(),i=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&e?.tileType===`Raster`&&(r===`cache/jpegplus`||r===`cache/jpegpng`),a=e?.tileType===`Map`||i;return t&&n&&a}supportsWrite(){let e=this._primaryRasters[0]??this.raster;return!!(this.loaded?e.datasetFormat===`RasterTileServer`&&(e.tileType===`Raster`||e.tileType===`Map`):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):(X(t,this),null)}async hasDataChanged(){try{let e=this._primaryRasters[0]??this.raster,{dataChanged:t,updates:n}=await e.refresh();return t&&(this.serviceRasterInfo!==e.rasterInfo&&this._set(`serviceRasterInfo`,e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),n&&this.read(n,{origin:`service`,url:this.parsedUrl,ignoreDefaults:!0})),t}catch{return!1}}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=w(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{let{url:t,rasterFunction:n,source:i}=this;if(!(t||i))throw new r(`imagery-tile-layer:open`,`missing url or source parameter`);i?await this._openFromSource(i,e):n?await this._openFromUrlWithRasterFunction(t,n,e):await this._openFromUrl(t,e)}let n=this.raster.rasterInfo;if(!n)throw new r(`imagery-tile-layer:load`,`cannot load resources on `+this.url);if(this._set(`serviceRasterInfo`,t?n:this._primaryRasters[0].rasterInfo),this._set(`spatialReference`,n.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){let e=this.raster.tileType===`Map`&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:`service`})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:`service`});this.title||=this.raster.datasetName,this.raster.tileType===`Map`&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(c(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=T(e),this.url||=this._primaryRasters[0].url}async _openFromUrlWithRasterFunction(e,t,n){let i=[e];t&&O(t.toJSON(),i);let a;i.some(e=>$(e))&&(a=await H(),this._releaseWorkerHandle={remove:()=>U()});let o=await Promise.all(i.map(e=>D.open({url:e,rasterInfo:i.length===1?this.serviceRasterInfo:void 0,sourceJSON:i.length===1?this.sourceJSON:void 0,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:a,signal:n}))),s=o.findIndex(e=>e==null);if(s>-1)throw new r(`imagery-tile-layer:open`,`cannot open raster: ${i[s]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){let n;$(e)&&(n=await H(),this._releaseWorkerHandle={remove:()=>U()});let i=await D.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:n,signal:t});if(i==null)throw new r(`imagery-tile-layer:open`,`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){let n=`the tiled imagery data source is not supported`,i=e.type?.toLowerCase()===`coverage`?`CovJSON`:e.extent&&e.pixelBlock?`MEMORY`:null;if(!i)throw new r(`imagery-tile-layer:open`,n);i===`MEMORY`&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});let a=await D.open({url:``,source:e,datasetFormat:i,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(a==null)throw new r(`imagery-tile-layer:open`,n);this._primaryRasters=[a],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=a}async _openFunctionRaster(e,t){let n={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>n[e.url]=e);let r=k(e.functionDefinition?.toJSON()??e.toJSON(),n),i=new E({rasterFunction:r});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof r&&i.getLogger(this).error(`imagery-tile-layer:open`,e.message),i.getLogger(this).warn(`imagery-tile-layer:open`,`the raster function cannot be applied and is removed`),this._set(`rasterFunction`,null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){G(i.getLogger(this),K(`ImageryTile layers`,`relative-to-scene`,e)),G(i.getLogger(this),q(`ImageryTile layers`,e))}};e([l({clonable:!1})],Z.prototype,`_primaryRasters`,void 0),e([l({clonable:!1})],Z.prototype,`_releaseWorkerHandle`,void 0),e([l({json:{origins:{"web-scene":{write:!1}},write:!0}})],Z.prototype,`charts`,void 0),e([l({type:Y,value:null,json:{name:`layerDefinition.elevationInfo`,write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Z.prototype,`elevationInfo`,null),e([l({type:W})],Z.prototype,`tileInfo`,void 0),e([l({readOnly:!0,clonable:!1})],Z.prototype,`graphicOrigin`,void 0),e([l(A)],Z.prototype,`legendEnabled`,void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Z.prototype,`isReference`,void 0),e([l({type:[`show`,`hide`]})],Z.prototype,`listMode`,void 0),e([l({json:{read:!0,write:!0}})],Z.prototype,`blendMode`,void 0),e([l({type:V,json:{name:`renderingRule`,write:!0}})],Z.prototype,`rasterFunction`,void 0),e([l()],Z.prototype,`sourceJSON`,void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:`currentVersion`}}}}})],Z.prototype,`version`,void 0),e([l({readOnly:!0,json:{read:!1}})],Z.prototype,`type`,void 0),e([l({type:[`ArcGISTiledImageServiceLayer`]})],Z.prototype,`operationalLayerType`,void 0),e([l({type:Boolean,value:!0,json:{read:{source:`disablePopup`,reader(e,t){return!t.disablePopup}},write:{target:`disablePopup`,overridePolicy(){return{enabled:!this.loaded||this.raster.tileType===`Raster`}},writer(e,t,n){t[n]=!e}}}})],Z.prototype,`popupEnabled`,void 0),e([l({type:t,json:{read:{source:`popupInfo`},write:{target:`popupInfo`,overridePolicy(){return{enabled:!this.loaded||this.raster.tileType===`Raster`}}}}})],Z.prototype,`popupTemplate`,void 0),e([l({readOnly:!0})],Z.prototype,`defaultPopupTemplate`,null),e([l(j)],Z.prototype,`screenSizePerspectiveEnabled`,void 0),e([l({readOnly:!0,type:[M]})],Z.prototype,`fields`,void 0),e([l({readOnly:!0,type:[M]})],Z.prototype,`rasterFields`,null),e([l({constructOnly:!0})],Z.prototype,`source`,void 0),Z=e([u(`esri.layers.ImageryTileLayer`)],Z);const Q=Z;function $(e){return/\.(png|gif|bmp)$/i.test(e)}export{Q as default};
2
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Error.js";import i from"../core/Logger.js";import{removeMaybe as a}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as s,throwIfAbortError as ee}from"../core/promiseUtils.js";import{watch as c}from"../core/reactiveUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import{ensureClass as d}from"../core/accessorSupport/ensureType.js";import f from"../graphic/ImageryTileGraphicOrigin.js";import p from"./Layer.js";import{ArcGISService as m}from"./mixins/ArcGISService.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{CustomParametersMixin as te}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as v}from"./mixins/RasterJobHandlerMixin.js";import{RasterPresetRendererMixin as y}from"./mixins/RasterPresetRendererMixin.js";import{RefreshableLayer as b}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{TiledImagery as C}from"./mixins/TiledImagery.js";import{isFunctionRaster as w,getPrimaryRasters as T}from"./raster/datasets/datasetUtils.js";import E from"./raster/datasets/FunctionRaster.js";import D from"./raster/datasets/RasterFactory.js";import{getPrimaryRasterUrls as O,create as k}from"./raster/functions/rasterFunctionHelper.js";import{legendEnabled as A,screenSizePerspectiveEnabled as j}from"./support/commonProperties.js";import M from"./support/Field.js";import{getServicePixelValueField as N,getRawServicePixelValueField as P,getRasterAttributeTableFields as F,getMagnitudeField as I,getDirectionField as L,getMultidimensionalFields as R,commonRasterFieldNames as z,setDefaultRasterFieldFormats as B}from"./support/rasterFieldUtils.js";import V from"./support/RasterFunction.js";import{getRasterJobHandler as H,releaseRasterJobHandler as U}from"./support/rasterJobHelper.js";import W from"./support/TileInfo.js";import{logInvalidElevationInfoWarning as G,elevationModeUnsupportedMessage as K,featureExpressionUnsupportedMessage as q}from"../support/elevationInfoUtils.js";import{createPopupTemplate as J}from"../support/popupUtils.js";import Y from"../symbols/support/ElevationInfo.js";import{addLayerUnsupportedError as X}from"../webdoc/support/unsupportedErrors.js";let Z=class extends h(x(g(_(y(te(C(v(S(m(b(o(n(p))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.charts=null,this.graphicOrigin=new f(this),this.legendEnabled=!0,this.isReference=null,this.listMode=`show`,this.sourceJSON=null,this.version=null,this.type=`imagery-tile`,this.operationalLayerType=`ArcGISTiledImageServiceLayer`,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=s(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/imageryUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}})}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`Image Service`]},e).catch(ee).then(()=>this._openRaster(t))),Promise.resolve(this)}destroy(){super.destroy(),this._releaseWorkerHandle=a(this._releaseWorkerHandle)}set elevationInfo(e){e?.mode!==`relative-to-scene`&&this._set(`elevationInfo`,e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[N(`Pixel Value`),P(`Raw Pixel Value`)],t=this.raster?.rasterInfo??this.serviceRasterInfo,n=t?.attributeTable;if(n){let t=F(n);e.push(...t)}let r=t?.dataType,i=t?.multidimensionalInfo;if((r===`vector-magdir`||r===`vector-uv`)&&i!=null){let t=i.variables[0].unit?.trim(),n=I(t),r=L();e.push(n,r)}if(i){let t=R(i);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){let{rasterFields:t}=this,n=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==z.rawServicePixelValue)),r=J({fields:t,title:this.title},{...e,visibleFieldNames:n}),{rasterInfo:i}=this.raster;return r?.fieldInfos&&i&&B(r.fieldInfos,i),r}async generateRasterInfo(e,t){let n=d(V,e);if(await this.load(),!n||n.functionName?.toLowerCase()===`none`)return this.serviceRasterInfo;try{let{rasterInfo:e}=await this._openFunctionRaster(n,t);return e}catch(e){throw e instanceof r?e:new r(`imagery-tile-layer`,`the given raster function is not supported`)}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsExportMapTiles(){let e=this._primaryRasters[0]??this.raster,t=e?.datasetFormat===`RasterTileServer`,n=!!this.sourceJSON?.exportTilesAllowed,r=this.sourceJSON?.datasetFormat?.toLowerCase(),i=!/\/tiledimageservices[^.]*\.arcgis\.com/i.test(this.url)&&e?.tileType===`Raster`&&(r===`cache/jpegplus`||r===`cache/jpegpng`),a=e?.tileType===`Map`||i;return t&&n&&a}supportsWrite(){let e=this._primaryRasters[0]??this.raster;return!!(this.loaded?e.datasetFormat===`RasterTileServer`&&(e.tileType===`Raster`||e.tileType===`Map`):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){return this.supportsWrite()?super.write(e,t):(X(t,this),null)}async hasDataChanged(){try{let e=this._primaryRasters[0]??this.raster,{dataChanged:t,updates:n}=await e.refresh();return t&&(this.serviceRasterInfo!==e.rasterInfo&&this._set(`serviceRasterInfo`,e.rasterInfo),e.sourceJSON&&this.sourceJSON!==e.sourceJSON&&(this.sourceJSON=e.sourceJSON),n&&this.read(n,{origin:`service`,url:this.parsedUrl,ignoreDefaults:!0})),t}catch{return!1}}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=w(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{let{url:t,rasterFunction:n,source:i}=this;if(!(t||i))throw new r(`imagery-tile-layer:open`,`missing url or source parameter`);i?await this._openFromSource(i,e):n?await this._openFromUrlWithRasterFunction(t,n,e):await this._openFromUrl(t,e)}let n=this.raster.rasterInfo;if(!n)throw new r(`imagery-tile-layer:load`,`cannot load resources on `+this.url);if(this._set(`serviceRasterInfo`,t?n:this._primaryRasters[0].rasterInfo),this._set(`spatialReference`,n.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){let e=this.raster.tileType===`Map`&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:`service`})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:`service`});this.title||=this.raster.datasetName,this.raster.tileType===`Map`&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(c(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=T(e),this.url||=this._primaryRasters[0].url}async _openFromUrlWithRasterFunction(e,t,n){let i=[e];t&&O(t.toJSON(),i);let a;i.some(e=>$(e,this.ioConfig))&&(a=await H(),this._releaseWorkerHandle={remove:()=>U()});let o=await Promise.all(i.map(e=>D.open({url:e,rasterInfo:i.length===1?this.serviceRasterInfo:void 0,sourceJSON:i.length===1?this.sourceJSON:void 0,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:a,signal:n}))),s=o.findIndex(e=>e==null);if(s>-1)throw new r(`imagery-tile-layer:open`,`cannot open raster: ${i[s]}`);return this._primaryRasters=o,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){let n;$(e,this.ioConfig)&&(n=await H(),this._releaseWorkerHandle={remove:()=>U()});let i=await D.open({url:e,rasterInfo:this.serviceRasterInfo,sourceJSON:this.sourceJSON,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters},rasterJobHandler:n,signal:t});if(i==null)throw new r(`imagery-tile-layer:open`,`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){let n=`the tiled imagery data source is not supported`,i=e.type?.toLowerCase()===`coverage`?`CovJSON`:e.extent&&e.pixelBlock?`MEMORY`:null;if(!i)throw new r(`imagery-tile-layer:open`,n);i===`MEMORY`&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});let a=await D.open({url:``,source:e,datasetFormat:i,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(a==null)throw new r(`imagery-tile-layer:open`,n);this._primaryRasters=[a],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=a}async _openFunctionRaster(e,t){let n={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>n[e.url]=e);let r=k(e.functionDefinition?.toJSON()??e.toJSON(),n),i=new E({rasterFunction:r});return await i.open(t),i}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof r&&i.getLogger(this).error(`imagery-tile-layer:open`,e.message),i.getLogger(this).warn(`imagery-tile-layer:open`,`the raster function cannot be applied and is removed`),this._set(`rasterFunction`,null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){G(i.getLogger(this),K(`ImageryTile layers`,`relative-to-scene`,e)),G(i.getLogger(this),q(`ImageryTile layers`,e))}};e([l({clonable:!1})],Z.prototype,`_primaryRasters`,void 0),e([l({clonable:!1})],Z.prototype,`_releaseWorkerHandle`,void 0),e([l({json:{origins:{"web-scene":{write:!1}},write:!0}})],Z.prototype,`charts`,void 0),e([l({type:Y,value:null,json:{name:`layerDefinition.elevationInfo`,write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],Z.prototype,`elevationInfo`,null),e([l({type:W})],Z.prototype,`tileInfo`,void 0),e([l({readOnly:!0,clonable:!1})],Z.prototype,`graphicOrigin`,void 0),e([l(A)],Z.prototype,`legendEnabled`,void 0),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Z.prototype,`isReference`,void 0),e([l({type:[`show`,`hide`]})],Z.prototype,`listMode`,void 0),e([l({json:{read:!0,write:!0}})],Z.prototype,`blendMode`,void 0),e([l({type:V,json:{name:`renderingRule`,write:!0}})],Z.prototype,`rasterFunction`,void 0),e([l()],Z.prototype,`sourceJSON`,void 0),e([l({readOnly:!0,json:{origins:{service:{read:{source:`currentVersion`}}}}})],Z.prototype,`version`,void 0),e([l({readOnly:!0,json:{read:!1}})],Z.prototype,`type`,void 0),e([l({type:[`ArcGISTiledImageServiceLayer`]})],Z.prototype,`operationalLayerType`,void 0),e([l({type:Boolean,value:!0,json:{read:{source:`disablePopup`,reader(e,t){return!t.disablePopup}},write:{target:`disablePopup`,overridePolicy(){return{enabled:!this.loaded||this.raster.tileType===`Raster`}},writer(e,t,n){t[n]=!e}}}})],Z.prototype,`popupEnabled`,void 0),e([l({type:t,json:{read:{source:`popupInfo`},write:{target:`popupInfo`,overridePolicy(){return{enabled:!this.loaded||this.raster.tileType===`Raster`}}}}})],Z.prototype,`popupTemplate`,void 0),e([l({readOnly:!0})],Z.prototype,`defaultPopupTemplate`,null),e([l(j)],Z.prototype,`screenSizePerspectiveEnabled`,void 0),e([l({readOnly:!0,type:[M]})],Z.prototype,`fields`,void 0),e([l({readOnly:!0,type:[M]})],Z.prototype,`rasterFields`,null),e([l({constructOnly:!0})],Z.prototype,`source`,void 0),Z=e([u(`esri.layers.ImageryTileLayer`)],Z);const Q=Z;function $(e,t){let{tileGeneration:n}=t??{};return n===`immediate`||/\.(png|gif|bmp)$/i.test(e)}export{Q as default};
package/layers/Layer.d.ts CHANGED
@@ -142,6 +142,7 @@ export interface FromArcGISServerUrlParameters {
142
142
  * [WMTSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WMTSLayer/) | WMTS tile services, ArcGIS portal item | Image tiles | OGC specification | N/A
143
143
  * [WebTileLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WebTileLayer/) | non-ArcGIS, non-OGC, and non-OSM tile services | Image tiles | N/A | No editing, client-side rendering, or popup templates.
144
144
  * [BingMapsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BingMapsLayer/) | Bing Spatial Data Service data | Image tiles | Displays Microsoft's Bing tiled content | Bing Maps key is required; three map styles are supported: `road`, `aerial`, and `hybrid`
145
+ * [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/) | PDF File, ArcGIS portal item | PDF documents | Displays a geospatial PDF document as georeferenced raster imagery | Documents that require a password to open are not supported
145
146
  * [MediaLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/MediaLayer/) | HTMLVideoElement, HTMLImageElement, or HTMLCanvasElement | Image/video element | Displays image and video elements in the map at specified geographic locations | GIF/APNG not currently
146
147
  * [VideoLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VideoLayer/) | ArcGIS VideoServer, ArcGIS portal item | Video | Displays a georeferenced video in the map | No 3D support
147
148
  *
@@ -263,6 +264,7 @@ export default abstract class Layer extends LayerSuperclass {
263
264
  * > **Known Limitations**
264
265
  * >
265
266
  * > - This method does not currently work with [OGCFeatureServer portal items](https://developers.arcgis.com/rest/users-groups-and-items/items-and-item-types/#layers).
267
+ * > - This method does not currently work with [GeospatialPDFLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeospatialPDFLayer/)
266
268
  *
267
269
  * @param params - The parameters for loading the portal item.
268
270
  * @returns Returns a promise which resolves to the new layer instance.
@@ -101,16 +101,17 @@ export interface LineOfSightLayerProperties extends LayerProperties, Operational
101
101
  * abortController.abort();
102
102
  * ```
103
103
  *
104
- * If the [observer position](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/#position) or
105
- * [target position](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/#position) have [z-values](https://developers.arcgis.com/javascript/latest/references/core/geometry/Point/#hasZ)
106
- * then these will be treated as absolute values, otherwise the points will be aligned to the ground.
107
- *
108
104
  * > [!WARNING]
109
105
  * >
110
- * > **Known Limitations**
111
- * >
112
- * > This layer is only supported in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
113
- * > The results of the tool vary depending on the zoom level, as changes in zoom level affect the level of detail (LOD) of the scene geometry.
106
+ * > **Things to consider:**
107
+ * > * This layer is only supported in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
108
+ * > * The results of the tool vary depending on the zoom level, as changes in zoom level affect the level of detail (LOD) of the scene geometry.
109
+ * > * Snapping, tooltips, display units, and input units used during interactive placement and editing are inherited from
110
+ * [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/).
111
+ * > * Snapping is enabled by default. This can be temporarily disabled by holding the `CTRL` key.
112
+ * > * Layer types currently supported for snapping are: [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/), [GraphicsLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GraphicsLayer/) (except Mesh geometries),
113
+ * > [GeoJSONLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GeoJSONLayer/), [WFSLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/WFSLayer/), [CSVLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/CSVLayer/),
114
+ * > [3D Object SceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/SceneLayer/), and [BuildingSceneLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/BuildingSceneLayer/).
114
115
  *
115
116
  * @since 4.24
116
117
  * @see [LineOfSightLayerView](https://developers.arcgis.com/javascript/latest/references/core/views/layers/LineOfSightLayerView/)
@@ -118,6 +119,7 @@ export interface LineOfSightLayerProperties extends LayerProperties, Operational
118
119
  * @see [LineOfSightAnalysisTarget](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisTarget/)
119
120
  * @see [LineOfSightAnalysisObserver](https://developers.arcgis.com/javascript/latest/references/core/analysis/LineOfSightAnalysisObserver/)
120
121
  * @see [LineOfSightAnalysisView3D](https://developers.arcgis.com/javascript/latest/references/core/views/3d/analysis/LineOfSightAnalysisView3D/)
122
+ * @see [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/)
121
123
  * @see [Line Of Sight component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-line-of-sight/)
122
124
  */
123
125
  export default class LineOfSightLayer extends LineOfSightLayerSuperclass {
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../Graphic.js";import n from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import i from"../core/Collection.js";import a from"../core/Error.js";import{abortHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u,throwIfAborted as d,isAbortError as f,throwIfNotAbortError as p}from"../core/promiseUtils.js";import{whenOnce as m}from"../core/reactiveUtils.js";import{property as h,subclass as g}from"../core/accessorSupport/decorators.js";import{getProperties as _}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as y}from"../geometry/projectionUtils.js";import b from"../graphic/SceneGraphicOrigin.js";import x from"./Layer.js";import{NoModelError as ee,MultipleModelsError as S}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as C}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{CustomParametersMixin as te}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as ne}from"./mixins/EditBusLayer.js";import{OperationalLayer as re}from"./mixins/OperationalLayer.js";import{PortalLayer as ie}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as ae}from"./mixins/ScaleRangeLayer.js";import{SceneService as oe}from"./mixins/SceneService.js";import{useViewTimeProperty as se}from"./mixins/TemporalLayer.js";import{isHostedAgolService as T}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as ce}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as le}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as D,legendEnabled as O,popupEnabled as k,attributeTableTemplate as A,screenSizePerspectiveEnabled as j,timeInfo as M}from"./support/commonProperties.js";import{getFieldDomain as N,computeEffectiveEditingEnabled as P,getGlobalIdToObjectIdMap as F}from"./support/featureLayerUtils.js";import I from"./support/FeatureReductionSelection.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import R from"./support/FieldsIndex.js";import{fixRendererFields as z,fixTimeInfoFields as B,unpackFieldNames as V}from"./support/fieldUtils.js";import{I3SNodePageDefinition as H,I3SMaterialDefinition as U,I3STextureSetDefinition as W,I3SGeometryDefinition as ue}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as de,isFileSupported as fe}from"./support/infoFor3D.js";import pe from"./support/LabelClass.js";import{reader as G}from"./support/labelingInfo.js";import me from"./support/LayerFloorInfo.js";import{layersLoaderMap as he}from"./support/layersLoader.js";import{getMeshTransformForMetersToSpatialReference as ge}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as _e}from"./support/RangeInfo.js";import ve from"./support/SceneFilter.js";import{cacheIsOutOfSync as K}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{SceneServiceTimeInfo as be}from"./support/SceneServiceTimeInfo.js";import xe from"./support/TimeInfo.js";import{loadStyleRenderer as Se}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Ce}from"../renderers/support/typeUtils.js";import we from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as q,elevationModeUnsupportedMessage as Te,featureExpressionUnsupportedMessage as Ee}from"../support/elevationInfoUtils.js";import{createPopupTemplate as De}from"../support/popupUtils.js";import{extractZipFiles as Oe}from"../support/zipUtils.js";import J from"../time/TimeExtent.js";import ke from"../time/TimeInterval.js";import{queryAttributesFromCachedAttributesId as Ae}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as je,getFetchPopupTemplate as Me}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Ne}from"../webdoc/support/opacityUtils.js";import{reader as Y}from"../core/accessorSupport/decorators/reader.js";const X=new Set([`3DObject`,`Point`]),Z=L();let Q=class extends ne(oe(w(re(ie(ae(l(te(C(r(x)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType=`ArcGISSceneServiceLayer`,this.type=`scene`,this.fields=null,this.graphicOrigin=new b(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new i,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0,this.serviceTimeInfo=null}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){this._set(`renderer`,null),this.associatedLayer=c(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){let n=this.getField(e)?.domain??null;return this.associatedLayer?N(this.associatedLayer,e,t,n):n}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new R(this.fields)}readNodePages(e,t,n){return t.layerType===`Point`&&(e=t.pointNodePages),typeof e!=`object`||!e?null:H.fromJSON(e,n)}set elevationInfo(e){this._set(`elevationInfo`,e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&P(this.associatedLayer)}get geometryType(){return Pe[this.profile]||`mesh`}set renderer(e){z(e,this.fieldsIndex),this._set(`renderer`,e)}readCachedDrawingInfo(e){return(typeof e!=`object`||!e)&&(e={}),e.color??(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e??=le;let{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsRollbackOnFailure:i,supportsUploadWithItemId:a,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:s},data:{supportsZ:c,supportsM:l,isVersioned:u,supportsAttachment:d},operations:{supportsEditing:f,supportsAdd:p,supportsUpdate:m,supportsDelete:h,supportsQuery:g,supportsQueryAttachments:_,supportsAsyncConvert3D:v},attachment:y}=e,b=e.operations.supportsChangeTracking,x=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:s,supportsRollbackOnFailure:i,supportsGeometryUpdate:x&&o,supportsUploadWithItemId:a},data:{supportsAttachment:d,supportsZ:c,supportsM:l,isVersioned:u,queryFormats:e.data.queryFormats,sourceFormats:e.data.sourceFormats},operations:{supportsQuery:g,supportsQueryAttachments:_,supportsEditing:f&&b,supportsAdd:x&&p&&b,supportsDelete:x&&h&&b,supportsUpdate:m&&b,supportsAsyncConvert3D:v},attachment:y}}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeOID`&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeGlobalID`&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){let n=t.store.profile;return n!=null&&$[n]?$[n]:(s.getLogger(this).error(`Unknown or missing profile`,{profile:n,layer:this}),`mesh-pyramids`)}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override(`useViewTime`,e)}get timeInfo(){let e=this.associatedLayer?.timeInfo;if(e==null)return null;let t=e.clone();return B(t,this.fieldsIndex),t}set timeInfo(e){B(e,this.fieldsIndex),this._override(`timeInfo`,e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override(`timeExtent`,e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override(`timeOffset`,e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override(`datesInUnknownTimezone`,e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){let t=e?.signal;await this.loadFromPortal({supportedTypes:[`Scene Service`]},e).catch(u),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await Se(this,{origin:`service`},t),z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){s.getLogger(this).error(`#_loadFilterGeometries()`,this,`Failed to load filter geometries. Geometry filter will not be applied for this layer.`,{error:e}),this.filter=null}}createQuery(){let e=new we;this.geometryType===`mesh`?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0);let{timeOffset:t,timeExtent:n}=this;return e.timeExtent=t!=null&&n!=null?n.offset(-t.value,t.unit):n||null,e.where=this.definitionExpression||`1=1`,e.sqlFormat=`standard`,e.outFields=[`*`],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(let t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryModels(e,t){let[n,{queryModels:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryModel(e,t){let[n,{queryModel:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){let n=V(this.fieldsIndex,await je(this,Me(this)));return Ae(this.parsedUrl?.path??``,this.attributeStorageInfo??[],e,t,n,this.apiKey,this.customParameters)}async queryCachedFeature(e,n){let r=await this.queryCachedAttributes(e,[n]);if(!r||r.length===0)throw new a(`scenelayer:feature-not-in-cached-data`,`Feature not found in cached data`);let i=new t;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i.origin=this.graphicOrigin,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryAttachments(e,t))}getFieldUsageInfo(e){let t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(s.getLogger(this).error(`#getFieldUsageInfo()`,`Unavailable until layer is loaded`),t)}createPopupTemplate(e){return De(this,e)}_getAssociatedLayerForQuery(){let e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a(`scenelayer:query-not-available`,`SceneLayer associated feature layer could not be loaded`,{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`},e)}async save(){return this._debouncedSaveOperations(0,{getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`})}async applyEdits(e,t){let{applyEdits:n}=await import(`./graphics/editingSupport.js`),r=t;await this.load();let i=this.associatedLayer;if(!i)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);await i.load();let{globalIdField:o}=i,s=!!i.infoFor3D,c=r?.globalIdUsed??!0;if(s&&o==null)throw new a(`${this.type}-layer:not-editable`,`Valid globalIdField expected on editable SceneLayer`);if(s&&!c)throw new a(`${this.type}-layer:globalid-required`,`globalIdUsed must not be false for SceneLayer editing as globalIds are required.`);return T(i.url)&&s&&e.deleteFeatures!=null&&o!=null&&(r={...r,globalIdToObjectId:await F(i,e.deleteFeatures,o)}),n(this,i.source,e,r)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};let n=e=>{throw s.getLogger(this).error(`.convertMesh()`,e.message),e};await this.load(t),this.infoFor3D||n(new a(`invalid:layer`,`SceneLayer has no capability for mesh conversion`));let r=await this.extractAndFilterFiles(e);d(t);let i=r.reduce((e,t)=>de(this.infoFor3D,t)?e+1:e,0);i===0&&n(new ee),i>1&&n(new S);let o=this.spatialReference,c=t.origin,l=await y(c??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:o}),o,t),u=o.isGeographic?`local`:`georeferenced`,{createWithExternalSource:f}=await import(`../geometry/support/meshUtils.js`);d(t);let p=f(l,{type:`client`,files:r},{vertexSpace:u,transform:ge(o),unitConversionDisabled:!0}),[m]=await this.uploadAssets([p],{...t,useAssetOrigin:!c});return m}async extractAndFilterFiles(e){await this.load();let t=this.infoFor3D;return t?(await Oe(e)).filter(e=>fe(t,e)):e}validateLayer(e){if(e.layerType&&!X.has(e.layerType))throw new a(`scenelayer:layer-type-not-supported`,`SceneLayer does not support this layer type`,{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a(`layer:service-version-not-supported`,`Service version is not supported.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});if(this.version.major>2)throw new a(`layer:service-version-too-new`,`Service version is too new.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});t(this.normalReferenceFrame,this.spatialReference);function t(e,t){let n=!1,r=!1;if(e==null)n=!0,r=!0;else{let i=t&&t.isGeographic;switch(e){case`east-north-up`:case`earth-centered`:n=!0,r=i;break;case`vertex-reference-frame`:n=!0,r=!i;break;default:n=!1}}if(!n)throw new a(`scenelayer:unsupported-normal-reference-frame`,`Normal reference frame is invalid.`);if(!r)throw new a(`scenelayer:incompatible-normal-reference-frame`,`Normal reference frame is incompatible with layer spatial reference.`)}}get isUsedAsGroundLayer(){return!1}_getTypeKeywords(){let e=[];if(this.profile===`points`)e.push(`Point`);else if(this.profile===`mesh-pyramids`)e.push(`3DObject`);else throw new a(`scenelayer:unknown-profile`,`SceneLayer:save() encountered an unknown SceneLayer profile: `+this.profile);return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(let e of this.fields){let t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),n=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),r={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||n,supportsLayerQuery:n};this._fieldUsageInfo[e.name]=r}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(let t of this.associatedLayer.fields){let n=this.getField(t.name);n?(!n.domain&&t.domain&&(n.domain=t.domain.clone()),n.editable=t.editable,n.nullable=t.nullable,n.length=t.length):(e||=this.fields?this.fields.slice():[],e.push(t.clone()))}e&&this._set(`fields`,e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;let e=[`popupTemplate`,`popupEnabled`,`attributeTableTemplate`],t=_(this);for(let n=0;n<e.length;n++){let r=e[n],i=this.originIdOf(r),a=this.associatedLayer.originIdOf(r);i<a&&(a===2||a===3)&&t.setAtOrigin(r,this.associatedLayer[r],a)}}_applyAssociatedLayerExtentOverride(){let e=this.associatedLayer?.getAtOrigin(`fullExtent`,`service`);this.associatedLayer?.infoFor3D!=null&&e&&T(this.associatedLayer?.url)&&K(this)&&_(this).setAtOrigin(`fullExtent`,e.clone(),2)}_applyAssociatedLayerPrivileges(){let e=this.associatedLayer;e&&(this._set(`userHasEditingPrivileges`,e.userHasEditingPrivileges),this._set(`userHasFullEditingPrivileges`,e.userHasFullEditingPrivileges),this._set(`userHasUpdateItemPrivileges`,e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if([`mesh-pyramids`,`points`].includes(this.profile))try{let{serverUrl:t,layerId:n,portalItem:r}=await ce(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),i=await he.FeatureLayer();this.associatedLayer=new i({url:t,customParameters:this.customParameters,apiKey:this.apiKey,layerId:n,portalItem:r}),await this.associatedLayer.load()}catch(e){f(e)||this._logWarningOnPopupEnabled().catch(()=>{})}}async _logWarningOnPopupEnabled(){let e=new AbortController;this.addHandles(o(e));try{await m(()=>this.popupEnabled&&this.popupTemplate!=null,e.signal)}catch(e){p(e);return}let t=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?s.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):s.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){let e=this.elevationInfo;this.profile===`mesh-pyramids`&&q(s.getLogger(this),Te(`Mesh scene layers`,`relative-to-scene`,e)),q(s.getLogger(this),Ee(`Scene layers`,e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:`scenelayer`,fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??``,customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}async loadTimeInfoFromService(e){let{serviceTimeInfo:t}=this;if(t==null)return;let{startTimeField:n,endTimeField:r}=t;if(n==null&&r==null||K({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;let i=async t=>{let r=null;try{r=(await this.fetchStatistics(t,e))?.stats}catch{}if(r==null)return null;let{minTimeStr:i,min:a,maxTimeStr:o,max:s}=r,c=t===n?i??a:o??s;return c==null?null:new Date(c)},[a,o]=await Promise.all([i(n),i(r)]);if(n!=null&&a==null||r!=null&&o==null)return;let s=new J({start:a,end:o});this.setAtOrigin(`timeInfo`,new xe({endField:r,startField:n,fullTimeExtent:s}),`service`)}};e([h({types:{key:`type`,base:null,typeMap:{selection:I}},json:{origins:{"web-scene":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}},"portal-item":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}}}}})],Q.prototype,`featureReduction`,void 0),e([h({type:[_e],json:{read:!1,origins:{"web-scene":{name:`layerDefinition.rangeInfos`,write:!0},"portal-item":{name:`layerDefinition.rangeInfos`,write:!0}}},clonable:!1})],Q.prototype,`rangeInfos`,void 0),e([h({json:{read:!1}})],Q.prototype,`associatedLayer`,void 0),e([h({type:[`show`,`hide`]})],Q.prototype,`listMode`,void 0),e([h({type:[`ArcGISSceneServiceLayer`]})],Q.prototype,`operationalLayerType`,void 0),e([h({json:{read:!1},readOnly:!0})],Q.prototype,`type`,void 0),e([h({...Z.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`fields`,void 0),e([h()],Q.prototype,`types`,null),e([h()],Q.prototype,`typeIdField`,null),e([h()],Q.prototype,`templates`,null),e([h()],Q.prototype,`formTemplate`,null),e([h({readOnly:!0})],Q.prototype,`graphicOrigin`,void 0),e([h({readOnly:!0,clonable:!1})],Q.prototype,`fieldsIndex`,null),e([h({type:me,json:{read:{source:`layerDefinition.floorInfo`},write:{target:`layerDefinition.floorInfo`}}})],Q.prototype,`floorInfo`,void 0),e([h(Z.outFields)],Q.prototype,`outFields`,void 0),e([h({type:H,readOnly:!0,json:{read:!1},clonable:!1})],Q.prototype,`nodePages`,void 0),e([Y(`service`,`nodePages`,[`nodePages`,`pointNodePages`])],Q.prototype,`readNodePages`,null),e([h({type:[U],readOnly:!0,clonable:!1})],Q.prototype,`materialDefinitions`,void 0),e([h({type:[W],readOnly:!0,clonable:!1})],Q.prototype,`textureSetDefinitions`,void 0),e([h({type:[ue],readOnly:!0,clonable:!1})],Q.prototype,`geometryDefinitions`,void 0),e([h({readOnly:!0})],Q.prototype,`serviceUpdateTimeStamp`,void 0),e([h({readOnly:!0})],Q.prototype,`attributeStorageInfo`,void 0),e([h({readOnly:!0})],Q.prototype,`statisticsInfo`,void 0),e([h({type:i.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.excludeObjectIds`,write:{enabled:!0}}})],Q.prototype,`excludeObjectIds`,void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Q.prototype,`definitionExpression`,void 0),e([h({type:ve,json:{name:`layerDefinition.polygonFilter`,write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Q.prototype,`filter`,void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Q.prototype,`path`,void 0),e([h(E)],Q.prototype,`elevationInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`effectiveCapabilities`,null),e([h({readOnly:!0})],Q.prototype,`effectiveEditingEnabled`,null),e([h({type:String})],Q.prototype,`geometryType`,null),e([h(D)],Q.prototype,`labelsVisible`,void 0),e([h({type:[pe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:{reader:G},write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:G},write:!0}})],Q.prototype,`labelingInfo`,void 0),e([h(O)],Q.prototype,`legendEnabled`,void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:[`opacity`,`layerDefinition.drawingInfo.transparency`],reader(e,t){if(typeof e==`number`&&e>=0&&e<=1)return e;let n=t.layerDefinition?.drawingInfo?.transparency;return n===void 0?void 0:Ne(n)}}},"portal-item":{write:!0},service:{read:!1}}}})],Q.prototype,`opacity`,void 0),e([h({type:[`Low`,`High`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`priority`,void 0),e([h({type:[`Labels`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`semantic`,void 0),e([h({types:Ce,json:{origins:{service:{read:{source:`drawingInfo.renderer`}}},name:`layerDefinition.drawingInfo.renderer`,write:!0},value:null})],Q.prototype,`renderer`,null),e([h({json:{read:!1}})],Q.prototype,`cachedDrawingInfo`,void 0),e([Y(`service`,`cachedDrawingInfo`)],Q.prototype,`readCachedDrawingInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`capabilities`,null),e([h({type:Boolean,json:{read:!1}})],Q.prototype,`editingEnabled`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`infoFor3D`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`relationships`,null),e([h(k)],Q.prototype,`popupEnabled`,void 0),e([h({type:n,json:{name:`popupInfo`,write:!0}})],Q.prototype,`popupTemplate`,void 0),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`defaultPopupTemplate`,null),e([h(A)],Q.prototype,`attributeTableTemplate`,void 0),e([h({type:String,json:{read:!1}})],Q.prototype,`objectIdField`,void 0),e([Y(`service`,`objectIdField`,[`objectIdField`,`fields`])],Q.prototype,`readObjectIdField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`globalIdField`,void 0),e([Y(`service`,`globalIdField`,[`globalIdField`,`fields`])],Q.prototype,`readGlobalIdField`,null),e([h({readOnly:!0,type:String,json:{read:!1}})],Q.prototype,`displayField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`profile`,void 0),e([Y(`service`,`profile`,[`store.profile`])],Q.prototype,`readProfile`,null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:`store.normalReferenceFrame`}}},read:!1}})],Q.prototype,`normalReferenceFrame`,void 0),e([h(j)],Q.prototype,`screenSizePerspectiveEnabled`,void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`serviceItemId`,void 0),e([h(se)],Q.prototype,`useViewTime`,null),e([h(M({disableServiceOrigin:!0,webDocumentOrigin:`web-scene`}))],Q.prototype,`timeInfo`,null),e([h({type:J,json:{read:!1,write:!1}})],Q.prototype,`timeExtent`,null),e([h({type:ke,json:{read:!1,write:!1}})],Q.prototype,`timeOffset`,null),e([h({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],Q.prototype,`datesInUnknownTimezone`,null),e([h({type:be,readOnly:!0,json:{read:{source:`timeInfo`}},clonable:!1})],Q.prototype,`serviceTimeInfo`,void 0),e([h()],Q.prototype,`isUsedAsGroundLayer`,null),Q=e([g(`esri.layers.SceneLayer`)],Q);const $={"mesh-pyramids":`mesh-pyramids`,meshpyramids:`mesh-pyramids`,"features-meshes":`mesh-pyramids`,points:`points`,"features-points":`points`,lines:`lines`,"features-lines":`lines`,polygons:`polygons`,"features-polygons":`polygons`},Pe={"mesh-pyramids":`mesh`,points:`point`},Fe=Q;export{Fe as default};
2
+ import{__decorate as e}from"tslib";import t from"../Graphic.js";import n from"../PopupTemplate.js";import{ClonableMixin as r}from"../core/Clonable.js";import i from"../core/Collection.js";import a from"../core/Error.js";import{abortHandle as o}from"../core/handleUtils.js";import s from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as u,throwIfAborted as d,isAbortError as f,throwIfNotAbortError as p}from"../core/promiseUtils.js";import{whenOnce as m}from"../core/reactiveUtils.js";import{property as h,subclass as g}from"../core/accessorSupport/decorators.js";import{getProperties as _}from"../core/accessorSupport/utils.js";import v from"../geometry/Point.js";import{projectAsync as y}from"../geometry/projectionUtils.js";import b from"../graphic/SceneGraphicOrigin.js";import x from"./Layer.js";import{NoModelError as ee,MultipleModelsError as S}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as C}from"./mixins/APIKeyMixin.js";import{ArcGISService as w}from"./mixins/ArcGISService.js";import{CustomParametersMixin as te}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as ne}from"./mixins/EditBusLayer.js";import{OperationalLayer as re}from"./mixins/OperationalLayer.js";import{PortalLayer as ie}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as ae}from"./mixins/ScaleRangeLayer.js";import{SceneService as oe}from"./mixins/SceneService.js";import{useViewTimeProperty as se}from"./mixins/TemporalLayer.js";import{isHostedAgolService as T}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as ce}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as le}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as D,legendEnabled as O,popupEnabled as k,attributeTableTemplate as A,screenSizePerspectiveEnabled as j,timeInfo as M}from"./support/commonProperties.js";import{getFieldDomain as N,computeEffectiveEditingEnabled as P,getGlobalIdToObjectIdMap as F}from"./support/featureLayerUtils.js";import I from"./support/FeatureReductionSelection.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import R from"./support/FieldsIndex.js";import{fixRendererFields as z,fixTimeInfoFields as B,unpackFieldNames as V}from"./support/fieldUtils.js";import{I3SNodePageDefinition as H,I3SMaterialDefinition as U,I3STextureSetDefinition as W,I3SGeometryDefinition as ue}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as de,isFileSupported as fe}from"./support/infoFor3D.js";import pe from"./support/LabelClass.js";import{reader as G}from"./support/labelingInfo.js";import me from"./support/LayerFloorInfo.js";import{layersLoaderMap as he}from"./support/layersLoader.js";import{getMeshTransformForMetersToSpatialReference as ge}from"./support/meshSpatialReferenceScaleUtils.js";import{RangeInfo as _e}from"./support/RangeInfo.js";import ve from"./support/SceneFilter.js";import{cacheIsOutOfSync as K}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as ye}from"./support/sceneLayerStatistics.js";import{SceneServiceTimeInfo as be}from"./support/SceneServiceTimeInfo.js";import xe from"./support/TimeInfo.js";import{loadStyleRenderer as Se}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Ce}from"../renderers/support/typeUtils.js";import we from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as q,elevationModeUnsupportedMessage as Te,featureExpressionUnsupportedMessage as Ee}from"../support/elevationInfoUtils.js";import{createPopupTemplate as De}from"../support/popupUtils.js";import{extractZipFiles as Oe}from"../support/zipUtils.js";import J from"../time/TimeExtent.js";import ke from"../time/TimeInterval.js";import{queryAttributesFromCachedAttributesId as Ae}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as je,getFetchPopupTemplate as Me}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as Ne}from"../webdoc/support/opacityUtils.js";import{reader as Y}from"../core/accessorSupport/decorators/reader.js";const X=new Set([`3DObject`,`Point`]),Z=L();let Q=class extends ne(oe(w(re(ie(ae(l(te(C(r(x)))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType=`ArcGISSceneServiceLayer`,this.type=`scene`,this.fields=null,this.graphicOrigin=new b(this),this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new i,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.attributeTableTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0,this.serviceTimeInfo=null}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){this._set(`renderer`,null),this.associatedLayer=c(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){let n=this.getField(e)?.domain??null;return this.associatedLayer?N(this.associatedLayer,e,t,n):n}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get fieldsIndex(){return new R(this.fields)}readNodePages(e,t,n){return t.layerType===`Point`&&(e=t.pointNodePages),typeof e!=`object`||!e?null:H.fromJSON(e,n)}set elevationInfo(e){this._set(`elevationInfo`,e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return this.associatedLayer!=null&&P(this.associatedLayer)}get geometryType(){return Pe[this.profile]||`mesh`}set renderer(e){z(e,this.fieldsIndex),this._set(`renderer`,e)}readCachedDrawingInfo(e){return typeof e==`object`&&e||(e={}),e.color??(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e??=le;let{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsRollbackOnFailure:i,supportsUploadWithItemId:a,supportsGeometryUpdate:o,supportsReturnServiceEditsInSourceSpatialReference:s},data:{supportsZ:c,supportsM:l,isVersioned:u,supportsAttachment:d},operations:{supportsEditing:f,supportsAdd:p,supportsUpdate:m,supportsDelete:h,supportsQuery:g,supportsQueryAttachments:_,supportsAsyncConvert3D:v},attachment:y}=e,b=e.operations.supportsChangeTracking,x=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:n,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:s,supportsRollbackOnFailure:i,supportsGeometryUpdate:x&&o,supportsUploadWithItemId:a},data:{supportsAttachment:d,supportsZ:c,supportsM:l,isVersioned:u,queryFormats:e.data.queryFormats,sourceFormats:e.data.sourceFormats},operations:{supportsQuery:g,supportsQueryAttachments:_,supportsEditing:f&&b,supportsAdd:x&&p&&b,supportsDelete:x&&h&&b,supportsUpdate:m&&b,supportsAsyncConvert3D:v},attachment:y}}get editingEnabled(){return this._isOverridden(`editingEnabled`)?this._get(`editingEnabled`):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome(`editingEnabled`,e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeOID`&&(e=t.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(t=>(t.type===`esriFieldTypeGlobalID`&&(e=t.name),!!e)),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){let n=t.store.profile;return n!=null&&$[n]?$[n]:(s.getLogger(this).error(`Unknown or missing profile`,{profile:n,layer:this}),`mesh-pyramids`)}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override(`useViewTime`,e)}get timeInfo(){let e=this.associatedLayer?.timeInfo;if(e==null)return null;let t=e.clone();return B(t,this.fieldsIndex),t}set timeInfo(e){B(e,this.fieldsIndex),this._override(`timeInfo`,e)}get timeExtent(){return this.associatedLayer?.timeExtent}set timeExtent(e){this._override(`timeExtent`,e)}get timeOffset(){return this.associatedLayer?.timeOffset}set timeOffset(e){this._override(`timeOffset`,e)}get datesInUnknownTimezone(){return this.associatedLayer?.datesInUnknownTimezone??!1}set datesInUnknownTimezone(e){this._override(`datesInUnknownTimezone`,e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){let t=e?.signal;await this.loadFromPortal({supportedTypes:[`Scene Service`]},e).catch(u),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await Se(this,{origin:`service`},t),z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){this.filter!=null&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){s.getLogger(this).error(`#_loadFilterGeometries()`,this,`Failed to load filter geometries. Geometry filter will not be applied for this layer.`,{error:e}),this.filter=null}}createQuery(){let e=new we;this.geometryType===`mesh`?this.capabilities.query.supportsReturnMesh&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0);let{timeOffset:t,timeExtent:n}=this;return e.timeExtent=t!=null&&n!=null?n.offset(-t.value,t.unit):n||null,e.where=this.definitionExpression||`1=1`,e.sqlFormat=`standard`,e.outFields=[`*`],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryFeatures(e||this.createQuery(),t)).then(e=>{if(e?.features)for(let t of e.features)t.layer=this,t.sourceLayer=this,t.origin=this.graphicOrigin;return e})}async queryModels(e,t){let[n,{queryModels:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryModel(e,t){let[n,{queryModel:r}]=await Promise.all([this._getAssociatedLayerForQuery(),import(`./scene/modelQuerySupport.js`)]);return r(this,n,e,t)}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){let n=V(this.fieldsIndex,await je(this,Me(this)));return Ae(this.parsedUrl?.path??``,this.attributeStorageInfo??[],e,t,n,this.apiKey,this.customParameters)}async queryCachedFeature(e,n){let r=await this.queryCachedAttributes(e,[n]);if(!r||r.length===0)throw new a(`scenelayer:feature-not-in-cached-data`,`Feature not found in cached data`);let i=new t;return i.attributes=r[0],i.layer=this,i.sourceLayer=this,i.origin=this.graphicOrigin,i}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(n=>n.queryAttachments(e,t))}getFieldUsageInfo(e){let t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(s.getLogger(this).error(`#getFieldUsageInfo()`,`Unavailable until layer is loaded`),t)}createPopupTemplate(e){return De(this,e)}_getAssociatedLayerForQuery(){let e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a(`scenelayer:query-not-available`,`SceneLayer queries are not available without an associated feature layer`,{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a(`scenelayer:query-not-available`,`SceneLayer associated feature layer could not be loaded`,{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(1,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`},e)}async save(){return this._debouncedSaveOperations(0,{getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:`scene`})}async applyEdits(e,t){let{applyEdits:n}=await import(`./graphics/editingSupport.js`),r=t;await this.load();let i=this.associatedLayer;if(!i)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);await i.load();let{globalIdField:o}=i,s=!!i.infoFor3D,c=r?.globalIdUsed??!0;if(s&&o==null)throw new a(`${this.type}-layer:not-editable`,`Valid globalIdField expected on editable SceneLayer`);if(s&&!c)throw new a(`${this.type}-layer:globalid-required`,`globalIdUsed must not be false for SceneLayer editing as globalIds are required.`);return T(i.url)&&s&&e.deleteFeatures!=null&&o!=null&&(r={...r,globalIdToObjectId:await F(i,e.deleteFeatures,o)}),n(this,i.source,e,r)}async uploadAssets(e,t){if(await this.load(),this.associatedLayer==null)throw new a(`${this.type}-layer:not-editable`,`Service is not editable`);return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}async convertMesh(e,t){t??={};let n=e=>{throw s.getLogger(this).error(`.convertMesh()`,e.message),e};await this.load(t),this.infoFor3D||n(new a(`invalid:layer`,`SceneLayer has no capability for mesh conversion`));let r=await this.extractAndFilterFiles(e);d(t);let i=r.reduce((e,t)=>de(this.infoFor3D,t)?e+1:e,0);i===0&&n(new ee),i>1&&n(new S);let o=this.spatialReference,c=t.origin,l=await y(c??t.defaultOrigin??new v({x:0,y:0,z:0,spatialReference:o}),o,t),u=o.isGeographic?`local`:`georeferenced`,{createWithExternalSource:f}=await import(`../geometry/support/meshUtils.js`);d(t);let p=f(l,{type:`client`,files:r},{vertexSpace:u,transform:ge(o),unitConversionDisabled:!0}),[m]=await this.uploadAssets([p],{...t,useAssetOrigin:!c});return m}async extractAndFilterFiles(e){await this.load();let t=this.infoFor3D;return t?(await Oe(e)).filter(e=>fe(t,e)):e}validateLayer(e){if(e.layerType&&!X.has(e.layerType))throw new a(`scenelayer:layer-type-not-supported`,`SceneLayer does not support this layer type`,{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a(`layer:service-version-not-supported`,`Service version is not supported.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});if(this.version.major>2)throw new a(`layer:service-version-too-new`,`Service version is too new.`,{serviceVersion:this.version.versionString,supportedVersions:`1.x, 2.x`});t(this.normalReferenceFrame,this.spatialReference);function t(e,t){let n=!1,r=!1;if(e==null)n=!0,r=!0;else{let i=t&&t.isGeographic;switch(e){case`east-north-up`:case`earth-centered`:n=!0,r=i;break;case`vertex-reference-frame`:n=!0,r=!i;break;default:n=!1}}if(!n)throw new a(`scenelayer:unsupported-normal-reference-frame`,`Normal reference frame is invalid.`);if(!r)throw new a(`scenelayer:incompatible-normal-reference-frame`,`Normal reference frame is incompatible with layer spatial reference.`)}}get isUsedAsGroundLayer(){return!1}_getTypeKeywords(){let e=[];if(this.profile===`points`)e.push(`Point`);else if(this.profile===`mesh-pyramids`)e.push(`3DObject`);else throw new a(`scenelayer:unknown-profile`,`SceneLayer:save() encountered an unknown SceneLayer profile: `+this.profile);return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(let e of this.fields){let t=!!this.attributeStorageInfo?.some(t=>t.name===e.name),n=!!this.associatedLayer?.fields?.some(t=>t&&e.name===t.name),r={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||n,supportsLayerQuery:n};this._fieldUsageInfo[e.name]=r}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPropertyOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(let t of this.associatedLayer.fields){let n=this.getField(t.name);n?(!n.domain&&t.domain&&(n.domain=t.domain.clone()),n.editable=t.editable,n.nullable=t.nullable,n.length=t.length):(e||=this.fields?this.fields.slice():[],e.push(t.clone()))}e&&this._set(`fields`,e)}_applyAssociatedLayerPropertyOverrides(){if(!this.associatedLayer)return;let e=[`popupTemplate`,`popupEnabled`,`attributeTableTemplate`],t=_(this);for(let n=0;n<e.length;n++){let r=e[n],i=this.originIdOf(r),a=this.associatedLayer.originIdOf(r);i<a&&(a===2||a===3)&&t.setAtOrigin(r,this.associatedLayer[r],a)}}_applyAssociatedLayerExtentOverride(){let e=this.associatedLayer?.getAtOrigin(`fullExtent`,`service`);this.associatedLayer?.infoFor3D!=null&&e&&T(this.associatedLayer?.url)&&K(this)&&_(this).setAtOrigin(`fullExtent`,e.clone(),2)}_applyAssociatedLayerPrivileges(){let e=this.associatedLayer;e&&(this._set(`userHasEditingPrivileges`,e.userHasEditingPrivileges),this._set(`userHasFullEditingPrivileges`,e.userHasFullEditingPrivileges),this._set(`userHasUpdateItemPrivileges`,e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if([`mesh-pyramids`,`points`].includes(this.profile))try{let{serverUrl:t,layerId:n,portalItem:r}=await ce(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),i=await he.FeatureLayer();this.associatedLayer=new i({url:t,customParameters:this.customParameters,apiKey:this.apiKey,layerId:n,portalItem:r}),await this.associatedLayer.load()}catch(e){f(e)||this._logWarningOnPopupEnabled().catch(()=>{})}}async _logWarningOnPopupEnabled(){let e=new AbortController;this.addHandles(o(e));try{await m(()=>this.popupEnabled&&this.popupTemplate!=null,e.signal)}catch(e){p(e);return}let t=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?s.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${t}`):s.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${t}`)}_validateElevationInfo(){let e=this.elevationInfo;this.profile===`mesh-pyramids`&&q(s.getLogger(this),Te(`Mesh scene layers`,`relative-to-scene`,e)),q(s.getLogger(this),Ee(`Scene layers`,e))}async fetchStatistics(e,t){return await ye({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:`scenelayer`,fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??``,customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}async loadTimeInfoFromService(e){let{serviceTimeInfo:t}=this;if(t==null)return;let{startTimeField:n,endTimeField:r}=t;if(n==null&&r==null||K({associatedLayer:this.associatedLayer,serviceUpdateTimeStamp:this.serviceUpdateTimeStamp}))return;let i=async t=>{let r=null;try{r=(await this.fetchStatistics(t,e))?.stats}catch{}if(r==null)return null;let{minTimeStr:i,min:a,maxTimeStr:o,max:s}=r,c=t===n?i??a:o??s;return c==null?null:new Date(c)},[a,o]=await Promise.all([i(n),i(r)]);if(n!=null&&a==null||r!=null&&o==null)return;let s=new J({start:a,end:o});this.setAtOrigin(`timeInfo`,new xe({endField:r,startField:n,fullTimeExtent:s}),`service`)}};e([h({types:{key:`type`,base:null,typeMap:{selection:I}},json:{origins:{"web-scene":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}},"portal-item":{name:`layerDefinition.featureReduction`,write:{allowNull:!0}}}}})],Q.prototype,`featureReduction`,void 0),e([h({type:[_e],json:{read:!1,origins:{"web-scene":{name:`layerDefinition.rangeInfos`,write:!0},"portal-item":{name:`layerDefinition.rangeInfos`,write:!0}}},clonable:!1})],Q.prototype,`rangeInfos`,void 0),e([h({json:{read:!1}})],Q.prototype,`associatedLayer`,void 0),e([h({type:[`show`,`hide`]})],Q.prototype,`listMode`,void 0),e([h({type:[`ArcGISSceneServiceLayer`]})],Q.prototype,`operationalLayerType`,void 0),e([h({json:{read:!1},readOnly:!0})],Q.prototype,`type`,void 0),e([h({...Z.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`fields`,void 0),e([h()],Q.prototype,`types`,null),e([h()],Q.prototype,`typeIdField`,null),e([h()],Q.prototype,`templates`,null),e([h()],Q.prototype,`formTemplate`,null),e([h({readOnly:!0})],Q.prototype,`graphicOrigin`,void 0),e([h({readOnly:!0,clonable:!1})],Q.prototype,`fieldsIndex`,null),e([h({type:me,json:{read:{source:`layerDefinition.floorInfo`},write:{target:`layerDefinition.floorInfo`}}})],Q.prototype,`floorInfo`,void 0),e([h(Z.outFields)],Q.prototype,`outFields`,void 0),e([h({type:H,readOnly:!0,json:{read:!1},clonable:!1})],Q.prototype,`nodePages`,void 0),e([Y(`service`,`nodePages`,[`nodePages`,`pointNodePages`])],Q.prototype,`readNodePages`,null),e([h({type:[U],readOnly:!0,clonable:!1})],Q.prototype,`materialDefinitions`,void 0),e([h({type:[W],readOnly:!0,clonable:!1})],Q.prototype,`textureSetDefinitions`,void 0),e([h({type:[ue],readOnly:!0,clonable:!1})],Q.prototype,`geometryDefinitions`,void 0),e([h({readOnly:!0})],Q.prototype,`serviceUpdateTimeStamp`,void 0),e([h({readOnly:!0})],Q.prototype,`attributeStorageInfo`,void 0),e([h({readOnly:!0})],Q.prototype,`statisticsInfo`,void 0),e([h({type:i.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.excludeObjectIds`,write:{enabled:!0}}})],Q.prototype,`excludeObjectIds`,void 0),e([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Q.prototype,`definitionExpression`,void 0),e([h({type:ve,json:{name:`layerDefinition.polygonFilter`,write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Q.prototype,`filter`,void 0),e([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Q.prototype,`path`,void 0),e([h(E)],Q.prototype,`elevationInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`effectiveCapabilities`,null),e([h({readOnly:!0})],Q.prototype,`effectiveEditingEnabled`,null),e([h({type:String})],Q.prototype,`geometryType`,null),e([h(D)],Q.prototype,`labelsVisible`,void 0),e([h({type:[pe],json:{origins:{service:{name:`drawingInfo.labelingInfo`,read:{reader:G},write:!1}},name:`layerDefinition.drawingInfo.labelingInfo`,read:{reader:G},write:!0}})],Q.prototype,`labelingInfo`,void 0),e([h(O)],Q.prototype,`legendEnabled`,void 0),e([h({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:[`opacity`,`layerDefinition.drawingInfo.transparency`],reader(e,t){if(typeof e==`number`&&e>=0&&e<=1)return e;let n=t.layerDefinition?.drawingInfo?.transparency;return n===void 0?void 0:Ne(n)}}},"portal-item":{write:!0},service:{read:!1}}}})],Q.prototype,`opacity`,void 0),e([h({type:[`Low`,`High`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`priority`,void 0),e([h({type:[`Labels`],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`semantic`,void 0),e([h({types:Ce,json:{origins:{service:{read:{source:`drawingInfo.renderer`}}},name:`layerDefinition.drawingInfo.renderer`,write:!0},value:null})],Q.prototype,`renderer`,null),e([h({json:{read:!1}})],Q.prototype,`cachedDrawingInfo`,void 0),e([Y(`service`,`cachedDrawingInfo`)],Q.prototype,`readCachedDrawingInfo`,null),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`capabilities`,null),e([h({type:Boolean,json:{read:!1}})],Q.prototype,`editingEnabled`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`infoFor3D`,null),e([h({readOnly:!0,json:{write:!1,read:!1}})],Q.prototype,`relationships`,null),e([h(k)],Q.prototype,`popupEnabled`,void 0),e([h({type:n,json:{name:`popupInfo`,write:!0}})],Q.prototype,`popupTemplate`,void 0),e([h({readOnly:!0,json:{read:!1}})],Q.prototype,`defaultPopupTemplate`,null),e([h(A)],Q.prototype,`attributeTableTemplate`,void 0),e([h({type:String,json:{read:!1}})],Q.prototype,`objectIdField`,void 0),e([Y(`service`,`objectIdField`,[`objectIdField`,`fields`])],Q.prototype,`readObjectIdField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`globalIdField`,void 0),e([Y(`service`,`globalIdField`,[`globalIdField`,`fields`])],Q.prototype,`readGlobalIdField`,null),e([h({readOnly:!0,type:String,json:{read:!1}})],Q.prototype,`displayField`,null),e([h({type:String,json:{read:!1}})],Q.prototype,`profile`,void 0),e([Y(`service`,`profile`,[`store.profile`])],Q.prototype,`readProfile`,null),e([h({readOnly:!0,type:String,json:{origins:{service:{read:{source:`store.normalReferenceFrame`}}},read:!1}})],Q.prototype,`normalReferenceFrame`,void 0),e([h(j)],Q.prototype,`screenSizePerspectiveEnabled`,void 0),e([h({json:{read:!1,origins:{service:{read:!0}}}})],Q.prototype,`serviceItemId`,void 0),e([h(se)],Q.prototype,`useViewTime`,null),e([h(M({disableServiceOrigin:!0,webDocumentOrigin:`web-scene`}))],Q.prototype,`timeInfo`,null),e([h({type:J,json:{read:!1,write:!1}})],Q.prototype,`timeExtent`,null),e([h({type:ke,json:{read:!1,write:!1}})],Q.prototype,`timeOffset`,null),e([h({type:Boolean,nonNullable:!0,json:{read:!1,write:!1}})],Q.prototype,`datesInUnknownTimezone`,null),e([h({type:be,readOnly:!0,json:{read:{source:`timeInfo`}},clonable:!1})],Q.prototype,`serviceTimeInfo`,void 0),e([h()],Q.prototype,`isUsedAsGroundLayer`,null),Q=e([g(`esri.layers.SceneLayer`)],Q);const $={"mesh-pyramids":`mesh-pyramids`,meshpyramids:`mesh-pyramids`,"features-meshes":`mesh-pyramids`,points:`points`,"features-points":`points`,lines:`lines`,"features-lines":`lines`,polygons:`polygons`,"features-polygons":`polygons`},Pe={"mesh-pyramids":`mesh`,points:`point`},Fe=Q;export{Fe as default};
@@ -19,10 +19,10 @@ import type { CustomParametersMixin, CustomParametersMixinProperties } from "./m
19
19
  import type { DisplayFilteredLayer, DisplayFilteredLayerProperties } from "./mixins/DisplayFilteredLayer.js";
20
20
  import type { EditBusLayer, EditBusLayerEvents } from "./mixins/EditBusLayer.js";
21
21
  import type { FeatureLayerBase, FeatureLayerBaseProperties } from "./mixins/FeatureLayerBase.js";
22
- import type { FeatureLayerReload } from "./mixins/FeatureLayerReload.js";
23
22
  import type { OperationalLayer, OperationalLayerProperties } from "./mixins/OperationalLayer.js";
24
23
  import type { PortalLayer, PortalLayerProperties } from "./mixins/PortalLayer.js";
25
24
  import type { RefreshableLayerEvents, RefreshableLayer, RefreshableLayerProperties } from "./mixins/RefreshableLayer.js";
25
+ import type { ReloadableLayer } from "./mixins/ReloadableLayer.js";
26
26
  import type { ScaleRangeLayer, ScaleRangeLayerProperties } from "./mixins/ScaleRangeLayer.js";
27
27
  import type { TemporalLayer, TemporalLayerProperties } from "./mixins/TemporalLayer.js";
28
28
  import type { PortalItemProperties } from "../portal/PortalItem.js";
@@ -880,4 +880,4 @@ export default class SubtypeGroupLayer extends SubtypeGroupLayerSuperclass {
880
880
  */
881
881
  updateAttachment(feature: Graphic, attachmentId: number, attachment: HTMLFormElement | FormData, options?: AttachmentEditOptions): Promise<FeatureEditResult>;
882
882
  }
883
- declare const SubtypeGroupLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof EditBusLayer & typeof DisplayFilteredLayer & typeof FeatureLayerBase & typeof FeatureLayerReload
883
+ declare const SubtypeGroupLayerSuperclass: typeof Layer & typeof ClonableMixin & typeof APIKeyMixin & typeof CustomParametersMixin & typeof MultiOriginJSONSupportMixin & typeof PortalLayer & typeof OperationalLayer & typeof RefreshableLayer & typeof ScaleRangeLayer & typeof TemporalLayer & typeof BlendLayer & typeof EditBusLayer & typeof DisplayFilteredLayer & typeof FeatureLayerBase & typeof ReloadableLayer
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import n from"../core/Collection.js";import r from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{getOrCreateMapValue as a}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as s,throwIfAbortError as ee,whenOrAbort as c}from"../core/promiseUtils.js";import{watch as te,sync as ne}from"../core/reactiveUtils.js";import{sqlAnd as re}from"../core/sql.js";import{property as l,subclass as ie}from"../core/accessorSupport/decorators.js";import u from"./Layer.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{ArcGISService as ae}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as p}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as m}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as h}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as g}from"./mixins/FeatureLayerBase.js";import{FeatureLayerReload as _}from"./mixins/FeatureLayerReload.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as y}from"./mixins/PortalLayer.js";import{RefreshableLayer as b}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as w}from"./support/commonProperties.js";import{ensureLayerCredential as T,computeEffectiveEditingEnabled as E,addAttachment as D,updateAttachment as O,applyEdits as k,createQuery as A,deleteAttachments as oe,fetchRecomputedExtents as j,computeDomainFromSubtypes as M,getFeatureSubtype as N,queryAttachments as P,queryObjectIds as F,queryFeatureCount as I,queryExtent as L,queryRelatedFeatures as R,queryRelatedFeaturesCount as z,hasDataChanged as B}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as U,createSimpleRenderersWithUniqueColors as W}from"./support/subtypeGroupLayerUtils.js";import G from"./support/SubtypeSublayer.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import q from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{addLayerUnsupportedError as J}from"../webdoc/support/unsupportedErrors.js";import{reader as ce}from"../core/accessorSupport/decorators/reader.js";const Y=`SubtypeGroupLayer`;function X(e,t){let n=[];for(let r of e){let e=new G;e.read(r,t),n.push(e)}return n}const Z=V();function Q(){return{name:`layerType`,read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let $=class extends _(g(m(h(f(S(x(b(ae(v(y(o(p(d(t(u))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(n.ofType(G)),this.useUniqueColorsForSublayers=!0,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Table`]),this.title=`Layer`,this.type=`subtype-group`,this._debouncedSaveOperations=s(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}}),this.addHandles(te(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(ee).then(async()=>{if(!this.url)throw new r(`subtype-grouplayer:missing-url-or-source`,`SubtypeGroupLayer must be created with either a url or a portal item`);if(this.layerId==null)throw new r(`subtype-grouplayer:missing-layerid`,`layerId is required for a SubtypeGroupLayer created with url`);this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>T(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`gdbVersion`),this.commitProperty(`historicMoment`),this.commitProperty(`returnZ`),this.commitProperty(`capabilities`),this.commitProperty(`returnM`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return E(this)}get operationalLayerType(){return this.isTable?`SubtypeGroupTable`:`SubtypeGroupLayer`}set source(e){this._get(`source`)!==e&&this._set(`source`,e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t,n){let r=await D(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await O(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return k(this,e,t)}async createGraphicsSource(e){let{default:t}=await c(import(`./graphics/sources/FeatureLayerSource.js`),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){let e=A(this),t=this.sublayers.map(e=>e.subtypeCode);return e.where=re(`${this.subtypeField} IN (${t.join(`,`)})`,this.definitionExpression),e}async deleteAttachments(e,t,n){let r=await oe(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return j(this,e,Y)}findSublayerForFeature(e){let t=this.fieldsIndex.get(this.subtypeField),n=e.attributes[t.name];return this.findSublayerForSubtypeCode(n)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){let t=M(this,e);if(t)return t}let n=N(this,t?.feature);if(n){let t=n.domains?.[e];return t?.type===`inherited`?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return P(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=q.from(e)??n.createQuery(),i=r.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),r.outFields=i);let a=await n.source.queryFeatures(r,t);if(a?.features)for(let e of a.features)e.origin=this.findSublayerForFeature(e)?.graphicOrigin,e.layer=e.sourceLayer=this.findSublayerForFeature(e);return a}async queryObjectIds(e,t){return(await F(this,e,t,Y)).filter(se)}async queryFeatureCount(e,t){return I(this,e,t,Y)}async queryExtent(e,t){return L(this,e,t,Y)}async queryRelatedFeatures(e,t){return R(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return z(this,e,t,Y)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){let{origin:n,layerContainerType:i,messages:a}=t;if(this.isTable){if(n===`web-scene`||n===`web-map`&&i!==`tables`)return J(t,this,`a table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&n===`web-map`&&i===`tables`)return J(t,this,`a non-table source cannot be written to tables in web maps`),null;return this.sublayers?.length?super.write(e,t):(a?.push(new r(`web-document-write:invalid-property`,`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return this.loaded?K(this,e):!1}async getFeatureTitle(e,t){let n=this.findSublayerForFeature(e);return n?await n.getFeatureTitle(e,t):this._getFeatureTitleForUnknownSublayer(e)}async getFeatureTitles(e,t){let n=new Map,r=new Map,i=[],o=[r];if(e.forEach(e=>{let o=this.findSublayerForFeature(e);if(o)a(n,o,()=>[]).push(e);else{let n=e.getObjectId()??e.attributes[this.objectIdField];t?.fetchMissingFields?i.push(e):r.set(n,this._getFeatureTitleForUnknownSublayer(e))}}),i.length>0){let e=new Set(this.featureTitleFields);e.add(this.objectIdField),e.add(this.subtypeField);let t=await this.queryFeatures({outFields:[...e],returnGeometry:!1,objectIds:i.map(e=>e.getObjectId()??e.attributes[this.objectIdField])}),o=new Set;for(let e of t.features??[]){let t=e.getObjectId()??e.attributes[this.objectIdField];o.add(t);let i=this.findSublayerForFeature(e);i?a(n,i,()=>[]).push(e):r.set(t,this._getFeatureTitleForUnknownSublayer(e))}for(let e of i){let t=e.getObjectId()??e.attributes[this.objectIdField];o.has(t)||r.set(t,this._getFeatureTitleForUnknownSublayer(e))}}(await Promise.all(Array.from(n).map(([e,n])=>e.getFeatureTitles(n,t)))).forEach(e=>o.push(e));let s=new Map(o.flatMap(e=>[...e]));return r.forEach((e,t)=>{s.set(t,e)}),s}get featureTitleFields(){let e=new Set;for(let t of this.sublayers){let n=t.featureTitleFields;for(let t of n)e.add(t)}return[...e]}_getLayerDomain(e){let t=this.fieldsIndex.get(e);return t?t.domain:null}_initLayerProperties(e){this._set(`source`,e);let{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:`service`,url:this.parsedUrl})),!this.subtypes?.length)throw new r(`subtype-grouplayer:missing-subtypes`,`SubtypeGroupLayer must be created using a layer with subtypes`);this._verifyFields(),H(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),this._initLayerProperties(t)}async hasDataChanged(){return B(this)}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`SubtypeGroupLayer: 'objectIdField' property is not defined (url: `+e+`)`),!this.isTable&&e.search(/\/FeatureServer\//i)===-1&&!this.fields?.some(e=>e.type===`geometry`)&&console.log(`SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: `+e+`)`)}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles(`sublayers-owner`),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on(`after-remove`,({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],`sublayers-owner`))}_getFeatureTitleForUnknownSublayer(e){let{displayField:t,fieldsIndex:n,objectIdField:r}=this;if(t&&n.has(t))return e.attributes[n.get(t).name]??``;let i=e.getObjectId();return i==null?r&&n.has(r)?e.attributes[n.get(r).name]??``:``:i.toString()}};e([l({readOnly:!0})],$.prototype,`createQueryVersion`,null),e([l({readOnly:!0})],$.prototype,`editingEnabled`,null),e([l({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([l({...Z.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`fields`,void 0),e([l(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),e([l(w)],$.prototype,`id`,void 0),e([l({type:[`show`,`hide`,`hide-children`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],$.prototype,`listMode`,void 0),e([l({type:[`SubtypeGroupLayer`,`SubtypeGroupTable`],json:{...Q(),origins:{"web-document":Q(),"portal-item":Q()}}})],$.prototype,`operationalLayerType`,null),e([l(Z.outFields)],$.prototype,`outFields`,void 0),e([l({clonable:!1})],$.prototype,`source`,null),e([l({type:n.ofType(G),json:{origins:{service:{read:{source:`subtypes`,reader(e,t,r){let i=null;if(this.useUniqueColorsForSublayers){let n=U(t,r);i=n?W(e.length,n):null}let a=e.map(({code:e},n)=>{let a=new G({subtypeCode:e});a.read(t,r);let o=i?.[n];return o&&a.read({drawingInfo:{renderer:o.toJSON()}},r),a});return new(n.ofType(G))(a)}}}},read:{source:[`layers`,`tables`],reader(e,t,r){let i;return t.layerType===`SubtypeGroupLayer`&&t.layers?.length?i=X(t.layers,r):t.layerType===`SubtypeGroupTable`&&t.tables?.length&&(i=X(t.tables,r)),new(n.ofType(G))(i)}},write:{ignoreOrigin:!0,writer(e,t,n,r){let i=[];for(let t of e){let e=t.write({},r);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],$.prototype,`sublayers`,void 0),e([l()],$.prototype,`useUniqueColorsForSublayers`,void 0),e([l({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],$.prototype,`title`,void 0),e([ce(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),e([l({json:{read:!1}})],$.prototype,`type`,void 0),e([l({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),$=e([ie(`esri.layers.SubtypeGroupLayer`)],$);const le=$;export{le as default};
2
+ import{__decorate as e}from"tslib";import{ClonableMixin as t}from"../core/Clonable.js";import n from"../core/Collection.js";import r from"../core/Error.js";import{loadAll as i}from"../core/loadAll.js";import{getOrCreateMapValue as a}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{debounce as s,throwIfAbortError as ee,whenOrAbort as c}from"../core/promiseUtils.js";import{watch as te,sync as ne}from"../core/reactiveUtils.js";import{sqlAnd as re}from"../core/sql.js";import{property as l,subclass as ie}from"../core/accessorSupport/decorators.js";import u from"./Layer.js";import{APIKeyMixin as d}from"./mixins/APIKeyMixin.js";import{ArcGISService as ae}from"./mixins/ArcGISService.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as p}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as m}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as h}from"./mixins/EditBusLayer.js";import{FeatureLayerBase as g}from"./mixins/FeatureLayerBase.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as v}from"./mixins/PortalLayer.js";import{RefreshableLayer as y}from"./mixins/RefreshableLayer.js";import{ReloadableLayer as b}from"./mixins/ReloadableLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as S}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as C}from"./support/arcgisLayerUrl.js";import{id as w}from"./support/commonProperties.js";import{ensureLayerCredential as T,computeEffectiveEditingEnabled as E,addAttachment as D,updateAttachment as O,applyEdits as k,createQuery as A,deleteAttachments as oe,fetchRecomputedExtents as j,computeDomainFromSubtypes as M,getFeatureSubtype as N,queryAttachments as P,queryObjectIds as F,queryFeatureCount as I,queryExtent as L,queryRelatedFeatures as R,queryRelatedFeaturesCount as z,hasDataChanged as B}from"./support/featureLayerUtils.js";import{defineFieldProperties as V}from"./support/fieldProperties.js";import{fixTimeInfoFields as H}from"./support/fieldUtils.js";import{getSymbolWithColorSupport as U,createSimpleRenderersWithUniqueColors as W}from"./support/subtypeGroupLayerUtils.js";import G from"./support/SubtypeSublayer.js";import{serviceSupportsSpatialReference as K}from"./support/versionUtils.js";import q from"../rest/support/Query.js";import{isNumber as se}from"../support/guards.js";import{addLayerUnsupportedError as J}from"../webdoc/support/unsupportedErrors.js";import{reader as ce}from"../core/accessorSupport/decorators/reader.js";const Y=`SubtypeGroupLayer`;function X(e,t){let n=[];for(let r of e){let e=new G;e.read(r,t),n.push(e)}return n}const Z=V();function Q(){return{name:`layerType`,read:{enabled:!0},write:{enabled:!0,ignoreOrigin:!0,isRequired:!0}}}let $=class extends b(g(m(h(f(S(x(y(ae(_(v(o(p(d(t(u))))))))))))))){constructor(...e){super(...e),this._sublayerLookup=new Map,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.sublayers=new(n.ofType(G)),this.useUniqueColorsForSublayers=!0,this.supportedPortalItemTypes=[`Feature Service`],this.supportedSourceTypes=new Set([`Feature Layer`,`Table`]),this.title=`Layer`,this.type=`subtype-group`,this._debouncedSaveOperations=s(async(e,t,n)=>{let{save:r,saveAs:i}=await import(`./save/featureLayerUtils.js`);switch(e){case 0:return r(this,t);case 1:return i(this,n,t)}}),this.addHandles(te(()=>this.sublayers,(e,t)=>this._handleSublayersChange(e,t),ne))}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:this.supportedPortalItemTypes},e).catch(ee).then(async()=>{if(!this.url)throw new r(`subtype-grouplayer:missing-url-or-source`,`SubtypeGroupLayer must be created with either a url or a portal item`);if(this.layerId==null)throw new r(`subtype-grouplayer:missing-layerid`,`layerId is required for a SubtypeGroupLayer created with url`);this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>T(this,`load`,e));return this.addResolvingPromise(n),Promise.resolve(this)}get createQueryVersion(){return this.commitProperty(`definitionExpression`),this.commitProperty(`timeExtent`),this.commitProperty(`timeOffset`),this.commitProperty(`geometryType`),this.commitProperty(`gdbVersion`),this.commitProperty(`historicMoment`),this.commitProperty(`returnZ`),this.commitProperty(`capabilities`),this.commitProperty(`returnM`),(this._get(`createQueryVersion`)??0)+1}get editingEnabled(){return this.loaded&&this.capabilities!=null&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get effectiveEditingEnabled(){return E(this)}get operationalLayerType(){return this.isTable?`SubtypeGroupTable`:`SubtypeGroupLayer`}set source(e){this._get(`source`)!==e&&this._set(`source`,e)}readTitleFromService(e,{name:t}){return this.url?C(this.url,t):t}async addAttachment(e,t,n){let r=await D(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,n,r){let i=await O(this,e,t,n,Y,r);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return k(this,e,t)}async createGraphicsSource(e){let{default:t}=await c(import(`./graphics/sources/FeatureLayerSource.js`),e);return new t({layer:this,supportedSourceTypes:this.supportedSourceTypes}).load({signal:e})}createQuery(){let e=A(this),t=this.sublayers.map(e=>e.subtypeCode);return e.where=re(`${this.subtypeField} IN (${t.join(`,`)})`,this.definitionExpression),e}async deleteAttachments(e,t,n){let r=await oe(this,e,t,Y,n);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return j(this,e,Y)}findSublayerForFeature(e){let t=this.fieldsIndex.get(this.subtypeField),n=e.attributes[t.name];return this.findSublayerForSubtypeCode(n)}findSublayerForSubtypeCode(e){return this._sublayerLookup.get(e)}getFieldDomain(e,t){if(!t?.excludeImpliedDomains){let t=M(this,e);if(t)return t}let n=N(this,t?.feature);if(n){let t=n.domains?.[e];return t?.type===`inherited`?this._getLayerDomain(e):t}return this._getLayerDomain(e)}loadAll(){return i(this,e=>{e(this.sublayers)})}async queryAttachments(e,t){return P(this,e,t,Y)}async queryFeatures(e,t){let n=await this.load(),r=q.from(e)??n.createQuery(),i=r.outFields??[];i.includes(this.subtypeField)||(i.push(this.subtypeField),r.outFields=i);let a=await n.source.queryFeatures(r,t);if(a?.features)for(let e of a.features)e.origin=this.findSublayerForFeature(e)?.graphicOrigin,e.layer=e.sourceLayer=this.findSublayerForFeature(e);return a}async queryObjectIds(e,t){return(await F(this,e,t,Y)).filter(se)}async queryFeatureCount(e,t){return I(this,e,t,Y)}async queryExtent(e,t){return L(this,e,t,Y)}async queryRelatedFeatures(e,t){return R(this,e,t,Y)}async queryRelatedFeaturesCount(e,t){return z(this,e,t,Y)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}write(e,t){let{origin:n,layerContainerType:i,messages:a}=t;if(this.isTable){if(n===`web-scene`||n===`web-map`&&i!==`tables`)return J(t,this,`a table source cannot be written to web scenes and web maps`),null}else if(this.loaded&&n===`web-map`&&i===`tables`)return J(t,this,`a non-table source cannot be written to tables in web maps`),null;return this.sublayers?.length?super.write(e,t):(a?.push(new r(`web-document-write:invalid-property`,`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return this.loaded?K(this,e):!1}async getFeatureTitle(e,t){let n=this.findSublayerForFeature(e);return n?await n.getFeatureTitle(e,t):this._getFeatureTitleForUnknownSublayer(e)}async getFeatureTitles(e,t){let n=new Map,r=new Map,i=[],o=[r];if(e.forEach(e=>{let o=this.findSublayerForFeature(e);if(o)a(n,o,()=>[]).push(e);else{let n=e.getObjectId()??e.attributes[this.objectIdField];t?.fetchMissingFields?i.push(e):r.set(n,this._getFeatureTitleForUnknownSublayer(e))}}),i.length>0){let e=new Set(this.featureTitleFields);e.add(this.objectIdField),e.add(this.subtypeField);let t=await this.queryFeatures({outFields:[...e],returnGeometry:!1,objectIds:i.map(e=>e.getObjectId()??e.attributes[this.objectIdField])}),o=new Set;for(let e of t.features??[]){let t=e.getObjectId()??e.attributes[this.objectIdField];o.add(t);let i=this.findSublayerForFeature(e);i?a(n,i,()=>[]).push(e):r.set(t,this._getFeatureTitleForUnknownSublayer(e))}for(let e of i){let t=e.getObjectId()??e.attributes[this.objectIdField];o.has(t)||r.set(t,this._getFeatureTitleForUnknownSublayer(e))}}(await Promise.all(Array.from(n).map(([e,n])=>e.getFeatureTitles(n,t)))).forEach(e=>o.push(e));let s=new Map(o.flatMap(e=>[...e]));return r.forEach((e,t)=>{s.set(t,e)}),s}get featureTitleFields(){let e=new Set;for(let t of this.sublayers){let n=t.featureTitleFields;for(let t of n)e.add(t)}return[...e]}_getLayerDomain(e){let t=this.fieldsIndex.get(e);return t?t.domain:null}_initLayerProperties(e){this._set(`source`,e);let{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:`service`,url:this.parsedUrl})),!this.subtypes?.length)throw new r(`subtype-grouplayer:missing-subtypes`,`SubtypeGroupLayer must be created using a layer with subtypes`);this._verifyFields(),H(this.timeInfo,this.fieldsIndex)}async reloadFromService(e){let t=this.source;await t.reload({signal:e}),this._initLayerProperties(t)}async hasDataChanged(){return B(this)}_verifyFields(){let e=this.parsedUrl?.path??`undefined`;this.objectIdField||console.log(`SubtypeGroupLayer: 'objectIdField' property is not defined (url: `+e+`)`),!this.isTable&&e.search(/\/FeatureServer\//i)===-1&&!this.fields?.some(e=>e.type===`geometry`)&&console.log(`SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: `+e+`)`)}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles(`sublayers-owner`),this._sublayerLookup.clear()),e&&(e.forEach(e=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),this.addHandles([e.on(`after-add`,({item:e})=>{e.parent=this,this._sublayerLookup.set(e.subtypeCode,e)}),e.on(`after-remove`,({item:e})=>{e.parent=null,this._sublayerLookup.delete(e.subtypeCode)})],`sublayers-owner`))}_getFeatureTitleForUnknownSublayer(e){let{displayField:t,fieldsIndex:n,objectIdField:r}=this;if(t&&n.has(t))return e.attributes[n.get(t).name]??``;let i=e.getObjectId();return i==null?r&&n.has(r)?e.attributes[n.get(r).name]??``:``:i.toString()}};e([l({readOnly:!0})],$.prototype,`createQueryVersion`,null),e([l({readOnly:!0})],$.prototype,`editingEnabled`,null),e([l({readOnly:!0})],$.prototype,`effectiveEditingEnabled`,null),e([l({...Z.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],$.prototype,`fields`,void 0),e([l(Z.fieldsIndex)],$.prototype,`fieldsIndex`,void 0),e([l(w)],$.prototype,`id`,void 0),e([l({type:[`show`,`hide`,`hide-children`],json:{origins:{"portal-item":{read:!1,write:!1}}}})],$.prototype,`listMode`,void 0),e([l({type:[`SubtypeGroupLayer`,`SubtypeGroupTable`],json:{...Q(),origins:{"web-document":Q(),"portal-item":Q()}}})],$.prototype,`operationalLayerType`,null),e([l(Z.outFields)],$.prototype,`outFields`,void 0),e([l({clonable:!1})],$.prototype,`source`,null),e([l({type:n.ofType(G),json:{origins:{service:{read:{source:`subtypes`,reader(e,t,r){let i=null;if(this.useUniqueColorsForSublayers){let n=U(t,r);i=n?W(e.length,n):null}let a=e.map(({code:e},n)=>{let a=new G({subtypeCode:e});a.read(t,r);let o=i?.[n];return o&&a.read({drawingInfo:{renderer:o.toJSON()}},r),a});return new(n.ofType(G))(a)}}}},read:{source:[`layers`,`tables`],reader(e,t,r){let i;return t.layerType===`SubtypeGroupLayer`&&t.layers?.length?i=X(t.layers,r):t.layerType===`SubtypeGroupTable`&&t.tables?.length&&(i=X(t.tables,r)),new(n.ofType(G))(i)}},write:{ignoreOrigin:!0,writer(e,t,n,r){let i=[];for(let t of e){let e=t.write({},r);i.push(e)}this.isTable?t.tables=i:t.layers=i}}}})],$.prototype,`sublayers`,void 0),e([l()],$.prototype,`useUniqueColorsForSublayers`,void 0),e([l({json:{origins:{"portal-item":{write:{enabled:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],$.prototype,`title`,void 0),e([ce(`service`,`title`,[`name`])],$.prototype,`readTitleFromService`,null),e([l({json:{read:!1}})],$.prototype,`type`,void 0),e([l({clonable:!1,readOnly:!0})],$.prototype,`featureTitleFields`,null),$=e([ie(`esri.layers.SubtypeGroupLayer`)],$);const le=$;export{le as default};
@@ -64,7 +64,7 @@ export interface ViewshedLayerProperties extends LayerProperties, OperationalLay
64
64
  * const layerView = await view.whenLayerView(viewshedLayer);
65
65
  *
66
66
  * // allow existing viewsheds in the layer to be selected and edited
67
- * // select a viewshed by hovering and clicking on their field-of-view manipulators
67
+ * // select a viewshed by hovering and clicking on their observer
68
68
  * layerView.interactive = true;
69
69
  *
70
70
  * // start placing new viewsheds interactively
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import n from"../core/Collection.js";import r from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import{Integer as l}from"../core/accessorSupport/ensureType.js";import{normalize as u}from"../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../geometry/Extent.js";import p from"../graphic/VoxelGraphicOrigin.js";import m from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as y}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{SceneService as x}from"./mixins/SceneService.js";import{sanitizeUrl as S}from"./support/arcgisLayerUrl.js";import{legendEnabled as C,url as w}from"./support/commonProperties.js";import T from"./support/Field.js";import E from"./support/FieldsIndex.js";import D from"./support/TimeInfo.js";import O from"./voxel/VoxelSection.js";import k from"./voxel/VoxelSimpleShading.js";import A from"./voxel/VoxelVariable.js";import j from"./voxel/VoxelVariableStyle.js";import M from"./voxel/VoxelVolume.js";import N from"./voxel/VoxelVolumeIndex.js";import P from"./voxel/VoxelVolumeStyle.js";import{createPopupTemplate as F}from"../support/popupUtils.js";import I from"../time/TimeExtent.js";import L from"../time/TimeInterval.js";import{reader as R}from"../core/accessorSupport/decorators/reader.js";let z=class extends x(g(v(y(b(a(_(h(m)))))))){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 p(this),this.shading=new k,this.opacity=1,this.variables=new n,this.volumes=new n,this.index=null,this.minScale=0,this.maxScale=0,this.type=`voxel`,this.version={major:NaN,minor: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(n.ofType(P)),this.variableStyles=new(n.ofType(j)),this.sections=new(n.ofType(O))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set(`url`,S(e,i.getLogger(this)))}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:[`Scene Service`]},e).catch(o).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(n),Promise.resolve(this)}read(e,t){super.read(e,t),t?.origin===`service`&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin(`popupTemplate`,`service`)&&this.setAtOrigin(`popupTemplate`,this.createPopupTemplate(),`service`);for(let e of this.volumes)e.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new r(`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 r(`layer:service-version-not-supported`,`Service version is not supported.`,{serviceVersion:this.version.versionString,supportedVersions:`3.x`});if(this.version.major>3)throw new r(`layer:service-version-too-new`,`Service version is too new.`,{serviceVersion:this.version.versionString,supportedVersions:`3.x`})}readFullExtent(e,t,n){if(typeof e==`object`&&e){let r=f.fromJSON(e,n);if(r.zmin===0&&r.zmax===0&&Array.isArray(t.volumes)){let e=M.fromJSON(t.volumes[0]);if(e.isValid&&e.volumeType!==`xyt`){let t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,n=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>n){let t=e;e=n,n=t}r.zmin=e,r.zmax=n}}}return r}return null}get fields(){let 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(let t of this.variables){let n=new T({name:t.name,alias:t.description,domain:null,editable:!1,length:128,type:t.renderingFormat.continuity===`discrete`?`string`:`double`});e.push(n)}let t=this.getVolume(null);if(t!=null){if(t.volumeType===`xyzt`||t.volumeType===`xyt`){let t=new T({name:`Voxel.LocalTime`,alias:`Local Time`,domain:null,editable:!1,length:256,type:`date`});e.push(t);let n=new T({name:`Voxel.SourceTime`,alias:`Source Time`,domain:null,editable:!1,length:256,type:`string`});e.push(n)}if(t.volumeType!==`xyt`){let 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 E(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){let t=this.fields;return F({fields:t,title:`{Voxel.Position}`},e)}getConfiguration(){let 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;if(t=e??this.currentVariableId,!this.variableStyles||t===-1)return null;let n=this.variableStyles.findIndex(e=>e.variableId===t);return n<0?null:this.variableStyles.at(n)}getVariable(e){let t=-1;if(t=e??this.currentVariableId,!this.variables||t===-1)return null;let n=this.variables.findIndex(e=>e.id===t);return n<0?null:this.variables.at(n)}getVolume(e){let t=this.getVariable(e);return t==null?null:this.volumes.find(({id:e})=>e===t.volumeId)}get timeInfo(){let e=this.getVolume(null);if(e?.volumeType!==`xyzt`)return null;let t=e.timeStops;if(!t?.length)return null;let n=new I({start:t[0],end:t.at(-1)});return new D({fullTimeExtent:n,stops:t})}getVolumeStyle(e){let t=this.getVariable(e);return t==null?null:this.volumeStyles.find(({volumeId:e})=>e===t.volumeId)}getColorForContinuousDataValue(e,t,n){let r=this.getVariable(e);if(r==null||r.renderingFormat?.continuity!==`continuous`||!this.variableStyles)return null;let i=this.variableStyles.findIndex(t=>t.variableId===e);if(i<0)return null;let a=this.variableStyles.at(i);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(t,n):null}getSections(){let e=[];for(let t of this.sections)e.push(new O({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(){let e=[];for(let t of this.variableStyles){let n=this._getVariable(t);if(n!=null){let r=t.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),i.getLogger(this).error(`A maximum of 4 isosurfaces are supported for Voxel Layers.`));for(let e of r.isosurfaces)if(!e.colorLocked){let t=this.getColorForContinuousDataValue(r.variableId,e.value,!1);t!=null&&!t.equals(e.color)&&(e.color=t)}if(n.renderingFormat.continuity===`continuous`)(r.transferFunction===null||r.transferFunction.colorStops.length<2)&&i.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),r.transferFunction!==null&&(!Array.isArray(r.transferFunction.stretchRange)||r.transferFunction.stretchRange.length!==2)&&(i.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll());else if(n.renderingFormat.continuity===`discrete`){if(t.uniqueValues.length===0)i.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(let e of t.uniqueValues)(e.label===null||e.label===void 0)&&e.value!==null&&e.value!==void 0&&(e.label=e.value.toString())}e.push(r)}else i.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){let e=[];for(let t of this.volumeStyles){let n=this._getVolumeFromVolumeId(t.volumeId);if(n!=null){let r=t.clone();for(let e of r.slices)this._isPlaneValid(e,[0,1,n.zDimension],n.dimensions)||(e.enabled=!1,e.label=`invalid`);for(let e of r.dynamicSections)this._isPlaneValid(e,[0,1,n.zDimension],n.dimensions)||(e.enabled=!1,e.label=`invalid`);e.push(r)}else i.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){let t=e.variableId;for(let e of this.variables)if(e.id===t)return e;return null}_getVolumeFromVolumeId(e){for(let t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,n){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;let r=d(e.normal[0],e.normal[1],e.normal[2]);return u(r,r),Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])<1e-6?!1:(e.normal[0]=r[0],e.normal[1]=r[1],e.normal[2]=r[2],!0)}};e([s({type:[`Voxel`]})],z.prototype,`operationalLayerType`,void 0),e([s(C)],z.prototype,`legendEnabled`,void 0),e([s({json:{write:!0}})],z.prototype,`title`,void 0),e([s(w)],z.prototype,`url`,null),e([s({type:n.ofType(O),json:{origins:{"web-scene":{name:`layerDefinition.sections`,write:!0}}}})],z.prototype,`sections`,void 0),e([s({type:l,json:{origins:{"web-scene":{name:`layerDefinition.style.currentVariableId`,write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:`style.currentVariableId`}}}})],z.prototype,`currentVariableId`,void 0),e([s({type:n.ofType(P),json:{origins:{"web-scene":{name:`layerDefinition.style.volumeStyles`,write:!0},service:{name:`style.volumeStyles`}}}})],z.prototype,`volumeStyles`,void 0),e([s({type:[`volume`,`surfaces`],json:{origins:{"web-scene":{name:`layerDefinition.style.renderMode`,write:!0},service:{name:`style.renderMode`}}}})],z.prototype,`renderMode`,void 0),e([s({type:n.ofType(j),json:{origins:{"web-scene":{name:`layerDefinition.style.variableStyles`,write:!0},service:{name:`style.variableStyles`}}}})],z.prototype,`variableStyles`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableSlices`,write:!0},service:{name:`style.enableSlices`}}}})],z.prototype,`enableSlices`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableSections`,write:!0},service:{name:`style.enableSections`}}}})],z.prototype,`enableSections`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableDynamicSections`,write:!0},service:{name:`style.enableDynamicSections`}}}})],z.prototype,`enableDynamicSections`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableIsosurfaces`,write:!0},service:{name:`style.enableIsosurfaces`}}}})],z.prototype,`enableIsosurfaces`,void 0),e([s({readOnly:!0})],z.prototype,`graphicOrigin`,void 0),e([s({type:k,json:{origins:{"web-scene":{name:`layerDefinition.style.shading`,write:!0},service:{name:`style.shading`}}}})],z.prototype,`shading`,void 0),e([s({type:[`show`,`hide`]})],z.prototype,`listMode`,void 0),e([s({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}}}})],z.prototype,`opacity`,void 0),e([s({type:n.ofType(A)})],z.prototype,`variables`,void 0),e([s({type:n.ofType(M)})],z.prototype,`volumes`,void 0),e([s({type:N})],z.prototype,`index`,void 0),e([s({type:Number,json:{name:`layerDefinition.minScale`,write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,`minScale`,void 0),e([s({type:Number,json:{name:`layerDefinition.maxScale`,write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,`maxScale`,void 0),e([s({json:{read:!1},readOnly:!0})],z.prototype,`type`,void 0),e([s({readOnly:!0,json:{name:`serviceVersion`}})],z.prototype,`version`,void 0),e([R(`service`,`version`)],z.prototype,`readVersion`,null),e([s({type:f})],z.prototype,`fullExtent`,void 0),e([R(`service`,`fullExtent`,[`fullExtent`])],z.prototype,`readFullExtent`,null),e([s({readOnly:!0,clonable:!1,json:{read:!1}})],z.prototype,`fields`,null),e([s({readOnly:!0})],z.prototype,`fieldsIndex`,null),e([s({type:Boolean,json:{name:`disablePopup`,read:{reader(e,t){return!t.disablePopup}},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,n){t[n]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],z.prototype,`popupEnabled`,void 0),e([s({type:t,json:{name:`popupInfo`,write:!0}})],z.prototype,`popupTemplate`,void 0),e([s({readOnly:!0,json:{read:!1}})],z.prototype,`defaultPopupTemplate`,null),e([s({type:D,readOnly:!0,json:{read:!1}})],z.prototype,`timeInfo`,null),e([s({type:I,json:{read:!1}})],z.prototype,`timeExtent`,void 0),e([s({type:L,json:{read:!1}})],z.prototype,`timeOffset`,void 0),e([s({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:`timeAnimation`,write:!0},service:{read:!1}}}})],z.prototype,`useViewTime`,void 0),z=e([c(`esri.layers.VoxelLayer`)],z);const B=z;export{B as default};
2
+ import{__decorate as e}from"tslib";import t from"../PopupTemplate.js";import n from"../core/Collection.js";import r from"../core/Error.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as o}from"../core/promiseUtils.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import{Integer as l}from"../core/accessorSupport/ensureType.js";import{normalize as u}from"../core/libs/gl-matrix-2/math/vec3.js";import{fromValues as d}from"../core/libs/gl-matrix-2/factories/vec3f64.js";import f from"../geometry/Extent.js";import p from"../graphic/VoxelGraphicOrigin.js";import m from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISService as g}from"./mixins/ArcGISService.js";import{CustomParametersMixin as _}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{PortalLayer as y}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as b}from"./mixins/ScaleRangeLayer.js";import{SceneService as x}from"./mixins/SceneService.js";import{sanitizeUrl as S}from"./support/arcgisLayerUrl.js";import{legendEnabled as C,url as w}from"./support/commonProperties.js";import T from"./support/Field.js";import E from"./support/FieldsIndex.js";import D from"./support/TimeInfo.js";import O from"./voxel/VoxelSection.js";import k from"./voxel/VoxelSimpleShading.js";import A from"./voxel/VoxelVariable.js";import j from"./voxel/VoxelVariableStyle.js";import M from"./voxel/VoxelVolume.js";import N from"./voxel/VoxelVolumeIndex.js";import P from"./voxel/VoxelVolumeStyle.js";import{createPopupTemplate as F}from"../support/popupUtils.js";import I from"../time/TimeExtent.js";import L from"../time/TimeInterval.js";import{reader as R}from"../core/accessorSupport/decorators/reader.js";let z=class extends x(g(v(y(b(a(_(h(m)))))))){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 p(this),this.shading=new k,this.opacity=1,this.variables=new n,this.volumes=new n,this.index=null,this.minScale=0,this.maxScale=0,this.type=`voxel`,this.version={major:NaN,minor: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(n.ofType(P)),this.variableStyles=new(n.ofType(j)),this.sections=new(n.ofType(O))}normalizeCtorArgs(e){return e?.constantUpscaling&&(this.test={constantUpscaling:!0},delete e.constantUpscaling),e}set url(e){this._set(`url`,S(e,i.getLogger(this)))}load(e){let t=e==null?null:e.signal,n=this.loadFromPortal({supportedTypes:[`Scene Service`]},e).catch(o).then(()=>this._fetchService(t)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(n),Promise.resolve(this)}read(e,t){super.read(e,t),t?.origin===`service`&&this.version.major<=3&&this.version.minor<=0&&!this.getAtOrigin(`popupTemplate`,`service`)&&this.setAtOrigin(`popupTemplate`,this.createPopupTemplate(),`service`);for(let e of this.volumes)e.spatialReference=this.spatialReference}readVersion(e,t){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new r(`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 r(`layer:service-version-not-supported`,`Service version is not supported.`,{serviceVersion:this.version.versionString,supportedVersions:`3.x`});if(this.version.major>3)throw new r(`layer:service-version-too-new`,`Service version is too new.`,{serviceVersion:this.version.versionString,supportedVersions:`3.x`})}readFullExtent(e,t,n){if(typeof e==`object`&&e){let r=f.fromJSON(e,n);if(r.zmin===0&&r.zmax===0&&Array.isArray(t.volumes)){let e=M.fromJSON(t.volumes[0]);if(e.isValid&&e.volumeType!==`xyt`){let t=e.dimensions[2];if(t.isRegular){let e=t.regularSpacing.offset,n=t.regularSpacing.offset+t.regularSpacing.scale*(t.size-1);if(e>n){let t=e;e=n,n=t}r.zmin=e,r.zmax=n}}}return r}return null}get fields(){let 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(let t of this.variables){let n=new T({name:t.name,alias:t.description,domain:null,editable:!1,length:128,type:t.renderingFormat.continuity===`discrete`?`string`:`double`});e.push(n)}let t=this.getVolume(null);if(t!=null){if(t.volumeType===`xyzt`||t.volumeType===`xyt`){let t=new T({name:`Voxel.LocalTime`,alias:`Local Time`,domain:null,editable:!1,length:256,type:`date`});e.push(t);let n=new T({name:`Voxel.SourceTime`,alias:`Source Time`,domain:null,editable:!1,length:256,type:`string`});e.push(n)}if(t.volumeType!==`xyt`){let 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 E(this.fields):null}getField(e){return this.fieldsIndex?.get(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(e){let t=this.fields;return F({fields:t,title:`{Voxel.Position}`},e)}getConfiguration(){let 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;if(t=e??this.currentVariableId,!this.variableStyles||t===-1)return null;let n=this.variableStyles.findIndex(e=>e.variableId===t);return n<0?null:this.variableStyles.at(n)}getVariable(e){let t=-1;if(t=e??this.currentVariableId,!this.variables||t===-1)return null;let n=this.variables.findIndex(e=>e.id===t);return n<0?null:this.variables.at(n)}getVolume(e){let t=this.getVariable(e);return t==null?null:this.volumes.find(({id:e})=>e===t.volumeId)}get timeInfo(){let e=this.getVolume(null);if(e?.volumeType!==`xyzt`)return null;let t=e.timeStops;if(!t?.length)return null;let n=new I({start:t[0],end:t.at(-1)});return new D({fullTimeExtent:n,stops:t})}getVolumeStyle(e){let t=this.getVariable(e);return t==null?null:this.volumeStyles.find(({volumeId:e})=>e===t.volumeId)}getColorForContinuousDataValue(e,t,n){let r=this.getVariable(e);if(r==null||r.renderingFormat?.continuity!==`continuous`||!this.variableStyles)return null;let i=this.variableStyles.findIndex(t=>t.variableId===e);if(i<0)return null;let a=this.variableStyles.at(i);return a?.transferFunction?a.transferFunction.getColorForContinuousDataValue(t,n):null}getSections(){let e=[];for(let t of this.sections)e.push(new O({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(){let e=[];for(let t of this.variableStyles){let n=this._getVariable(t);if(n!=null){let r=t.clone();r.isosurfaces.length>4&&(r.isosurfaces=r.isosurfaces.slice(0,3),i.getLogger(this).error(`A maximum of 4 isosurfaces are supported for Voxel Layers.`));for(let e of r.isosurfaces)if(!e.colorLocked){let t=this.getColorForContinuousDataValue(r.variableId,e.value,!1);t!=null&&!t.equals(e.color)&&(e.color=t)}if(n.renderingFormat.continuity===`continuous`)(r.transferFunction===null||r.transferFunction.colorStops.length<2)&&i.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),r.transferFunction!==null&&(Array.isArray(r.transferFunction.stretchRange)&&r.transferFunction.stretchRange.length===2||(i.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),r.transferFunction.stretchRange=[0,1],r.transferFunction.colorStops.removeAll()));else if(n.renderingFormat.continuity===`discrete`){if(t.uniqueValues.length===0)i.getLogger(this).error(`VoxelVariableStyle for variable ${n.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(let e of t.uniqueValues)(e.label===null||e.label===void 0)&&e.value!==null&&e.value!==void 0&&(e.label=e.value.toString())}e.push(r)}else i.getLogger(this).error(`VoxelVariable ID=${t.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){let e=[];for(let t of this.volumeStyles){let n=this._getVolumeFromVolumeId(t.volumeId);if(n!=null){let r=t.clone();for(let e of r.slices)this._isPlaneValid(e,[0,1,n.zDimension],n.dimensions)||(e.enabled=!1,e.label=`invalid`);for(let e of r.dynamicSections)this._isPlaneValid(e,[0,1,n.zDimension],n.dimensions)||(e.enabled=!1,e.label=`invalid`);e.push(r)}else i.getLogger(this).error(`VoxelVolume ID=${t.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){let t=e.variableId;for(let e of this.variables)if(e.id===t)return e;return null}_getVolumeFromVolumeId(e){for(let t of this.volumes)if(t.id===e)return t;return null}_isPlaneValid(e,t,n){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;let r=d(e.normal[0],e.normal[1],e.normal[2]);return u(r,r),Math.abs(r[0])+Math.abs(r[1])+Math.abs(r[2])<1e-6?!1:(e.normal[0]=r[0],e.normal[1]=r[1],e.normal[2]=r[2],!0)}};e([s({type:[`Voxel`]})],z.prototype,`operationalLayerType`,void 0),e([s(C)],z.prototype,`legendEnabled`,void 0),e([s({json:{write:!0}})],z.prototype,`title`,void 0),e([s(w)],z.prototype,`url`,null),e([s({type:n.ofType(O),json:{origins:{"web-scene":{name:`layerDefinition.sections`,write:!0}}}})],z.prototype,`sections`,void 0),e([s({type:l,json:{origins:{"web-scene":{name:`layerDefinition.style.currentVariableId`,write:{enabled:!0,isRequired:!0,ignoreOrigin:!0}},service:{name:`style.currentVariableId`}}}})],z.prototype,`currentVariableId`,void 0),e([s({type:n.ofType(P),json:{origins:{"web-scene":{name:`layerDefinition.style.volumeStyles`,write:!0},service:{name:`style.volumeStyles`}}}})],z.prototype,`volumeStyles`,void 0),e([s({type:[`volume`,`surfaces`],json:{origins:{"web-scene":{name:`layerDefinition.style.renderMode`,write:!0},service:{name:`style.renderMode`}}}})],z.prototype,`renderMode`,void 0),e([s({type:n.ofType(j),json:{origins:{"web-scene":{name:`layerDefinition.style.variableStyles`,write:!0},service:{name:`style.variableStyles`}}}})],z.prototype,`variableStyles`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableSlices`,write:!0},service:{name:`style.enableSlices`}}}})],z.prototype,`enableSlices`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableSections`,write:!0},service:{name:`style.enableSections`}}}})],z.prototype,`enableSections`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableDynamicSections`,write:!0},service:{name:`style.enableDynamicSections`}}}})],z.prototype,`enableDynamicSections`,void 0),e([s({type:Boolean,json:{origins:{"web-scene":{name:`layerDefinition.style.enableIsosurfaces`,write:!0},service:{name:`style.enableIsosurfaces`}}}})],z.prototype,`enableIsosurfaces`,void 0),e([s({readOnly:!0})],z.prototype,`graphicOrigin`,void 0),e([s({type:k,json:{origins:{"web-scene":{name:`layerDefinition.style.shading`,write:!0},service:{name:`style.shading`}}}})],z.prototype,`shading`,void 0),e([s({type:[`show`,`hide`]})],z.prototype,`listMode`,void 0),e([s({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}}}})],z.prototype,`opacity`,void 0),e([s({type:n.ofType(A)})],z.prototype,`variables`,void 0),e([s({type:n.ofType(M)})],z.prototype,`volumes`,void 0),e([s({type:N})],z.prototype,`index`,void 0),e([s({type:Number,json:{name:`layerDefinition.minScale`,write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,`minScale`,void 0),e([s({type:Number,json:{name:`layerDefinition.maxScale`,write:!0,origins:{service:{read:!1,write:!1}}}})],z.prototype,`maxScale`,void 0),e([s({json:{read:!1},readOnly:!0})],z.prototype,`type`,void 0),e([s({readOnly:!0,json:{name:`serviceVersion`}})],z.prototype,`version`,void 0),e([R(`service`,`version`)],z.prototype,`readVersion`,null),e([s({type:f})],z.prototype,`fullExtent`,void 0),e([R(`service`,`fullExtent`,[`fullExtent`])],z.prototype,`readFullExtent`,null),e([s({readOnly:!0,clonable:!1,json:{read:!1}})],z.prototype,`fields`,null),e([s({readOnly:!0})],z.prototype,`fieldsIndex`,null),e([s({type:Boolean,json:{name:`disablePopup`,read:{reader(e,t){return!t.disablePopup}},write:{enabled:!0,ignoreOrigin:!0,writer(e,t,n){t[n]=!e}},origins:{"portal-item":{default:!0},"web-scene":{default:!0}}}})],z.prototype,`popupEnabled`,void 0),e([s({type:t,json:{name:`popupInfo`,write:!0}})],z.prototype,`popupTemplate`,void 0),e([s({readOnly:!0,json:{read:!1}})],z.prototype,`defaultPopupTemplate`,null),e([s({type:D,readOnly:!0,json:{read:!1}})],z.prototype,`timeInfo`,null),e([s({type:I,json:{read:!1}})],z.prototype,`timeExtent`,void 0),e([s({type:L,json:{read:!1}})],z.prototype,`timeOffset`,void 0),e([s({type:Boolean,nonNullable:!0,json:{origins:{"web-scene":{name:`timeAnimation`,write:!0},service:{read:!1}}}})],z.prototype,`useViewTime`,void 0),z=e([c(`esri.layers.VoxelLayer`)],z);const B=z;export{B as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../config.js";import n from"../Graphic.js";import r from"../PopupTemplate.js";import i from"../request.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import{JSONMap as c}from"../core/jsonMap.js";import{clone as l}from"../core/lang.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d}from"../core/promiseUtils.js";import{on as f,sync as p,watch as m}from"../core/reactiveUtils.js";import{renderingSanitizer as h}from"../core/sanitizerUtils.js";import{urlToObject as g,addQueryParameters as _,addProxy as v,makeAbsolute as y,Url as b}from"../core/urlUtils.js";import{property as x,subclass as S}from"../core/accessorSupport/decorators.js";import{Integer as C}from"../core/accessorSupport/ensureType.js";import{willPropertyWrite as w}from"../core/accessorSupport/write.js";import T from"../geometry/Extent.js";import E from"../geometry/SpatialReference.js";import{getScale as D}from"../geometry/support/scaleUtils.js";import{equals as O}from"../geometry/support/spatialReferenceUtils.js";import ee from"./Layer.js";import{BlendLayer as te}from"./mixins/BlendLayer.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as M}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as P}from"./ogc/crsUtils.js";import{isWmsServer as F}from"./support/arcgisLayerUrl.js";import{legendEnabled as I,url as L}from"./support/commonProperties.js";import{ExportWMSImageParameters as R}from"./support/ExportWMSImageParameters.js";import{createBitmap as z}from"./support/imageBitmapUtils.js";import B from"./support/WMSSublayer.js";import{normalizeWKID as V,toTimeQueryParameter as H,getPopupLayers as U,parseCapabilities as W}from"./support/wmsUtils.js";import G from"../time/TimeExtent.js";import K from"../time/TimeInterval.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as J}from"../core/accessorSupport/decorators/writer.js";const Y=new c({bmp:`image/bmp`,gif:`image/gif`,jpg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`},{ignoreUnknown:!1});function X(e){return e===`text/html`}function Z(e){return e===`text/plain`}let Q=class extends te(N(j(M(k(A(u(ee))))))){constructor(...e){super(...e),this.allSublayers=new o({getCollections:()=>[this.sublayers],getChildrenFunction(e){return e.sublayers}}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType=`WMS`,this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type=`wms`,this.version=null,this.addHandles([f(()=>this.sublayers,`after-add`,({item:e})=>{e.parent=e.layer=this},p),f(()=>this.sublayers,`after-remove`,({item:e})=>{e.layer=e.parent=null},p),m(()=>this.sublayers,(e,t)=>{if(t)for(let e of t)e.layer=e.parent=null;if(e)for(let t of e)t.parent=t.layer=this},p)])}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`WMS`]},e).catch(d).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}get timeInfo(){return super.timeInfo}set timeInfo(e){super.timeInfo=e}readFullExtentFromItemOrMap(e,t){let n=t.extent;return n?new T({xmin:n[0][0],ymin:n[0][1],xmax:n[1][0],ymax:n[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(X)??this.featureInfoFormats.find(Z)??null}set featureInfoFormat(e){e==null?(this.revertToOrigin(`featureInfoFormat`,`service`),this._clearOverride(`featureInfoFormat`)):(X(e)||Z(e))&&this._override(`featureInfoFormat`,e)}readImageFormat(e,t){let n=t.supportedImageFormatTypes;return n&&n.includes(`image/png`)?`image/png`:n&&n[0]}readSpatialReferenceFromItemOrDocument(e,t){return new E(t.spatialReferences[0])}writeSpatialReferences(e,t){let n=this.spatialReference?.wkid;e&&n?(t.spatialReferences=e.filter(e=>e!==n),t.spatialReferences.unshift(n)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,n){return $(t.layers,n,t.visibleLayers)}readSublayers(e,t,n){return $(t.layers,n)}writeSublayers(e,t,n,r){t.layers=[];let i=new Map,a=e.flatten(({sublayers:e})=>e??[]);for(let e of a)if(typeof e.parent?.id==`number`){let t=i.get(e.parent.id);t==null?i.set(e.parent.id,[e.id]):t.push(e.id)}for(let e of a){let n={sublayer:e,...r},a=e.write({parentLayerId:typeof e.parent?.id==`number`?e.parent.id:-1},n);if(i.has(e.id)&&(a.sublayerIds=i.get(e.id)),!e.sublayers&&e.name){let r=e.write({},n);delete r.id,t.layers.push(r)}}t.visibleLayers=a.filter(({visible:e,sublayers:t})=>e&&!t).map(({name:e})=>e).toArray()}set url(e){if(!e){this._set(`url`,e);return}let{path:t,query:n}=g(e);for(let e in n)/^(request|service)$/i.test(e)&&delete n[e];let r=_(t,n??{});this._set(`url`,r)}createExportImageParameters(e,t,n,r){let i=r?.pixelRatio??1,a=D({extent:e,width:t})*i,o=new R({layer:this,scale:a}),{xmin:s,ymin:c,xmax:l,ymax:u,spatialReference:d}=e,f=V(d,this.spatialReferences),p=this.version===`1.3.0`&&P(f)?`${c},${s},${u},${l}`:`${s},${c},${l},${u}`,m=o.toJSON();return{bbox:p,[this.version===`1.3.0`?`crs`:`srs`]:f==null||isNaN(f)?void 0:`EPSG:`+f,...m}}async fetchImage(e,t,n,r){let a=this.mapUrl,o=this.createExportImageParameters(e,t,n,r);if(!o.layers){let e=document.createElement(`canvas`);return e.width=t,e.height=n,e}let s=H(r?.timeExtent),c={responseType:`image`,query:this._mixCustomParameters({width:t,height:n,...o,time:s,...this.refreshParameters}),signal:r?.signal};return i(a??``,c).then(e=>e.data)}async fetchImageBitmap(e,t,n,r){let a=this.mapUrl??``,o=this.createExportImageParameters(e,t,n,r);if(!o.layers){let e=document.createElement(`canvas`);return e.width=t,e.height=n,e}let s=H(r?.timeExtent),c={responseType:`blob`,query:this._mixCustomParameters({width:t,height:n,...o,time:s,...this.refreshParameters}),signal:r?.signal},{data:l}=await i(a,c);return z(l,a,r)}fetchFeatureInfo(e,t,n,r,i){let a=D({extent:e,width:t}),o=new R({layer:this,scale:a}),s=U(o.visibleSublayers);if(this.featureInfoUrl==null||s==null||this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);let c=this.version===`1.3.0`?{I:r,J:i}:{x:r,y:i},l={query_layers:s,request:`GetFeatureInfo`,info_format:this.featureInfoFormat,feature_count:25,width:t,height:n,...c},u={...this.createExportImageParameters(e,t,n),...l},d=this._mixCustomParameters(u);return this.fetchFeatureInfoFunction==null?this._defaultFetchFeatureInfoFunction(_(this.featureInfoUrl,d)):this.fetchFeatureInfoFunction(d)}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return F(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{let n=t===900913?E.WebMercator:new E({wkid:t});return O(n,e)})}_defaultFetchFeatureInfoFunction(e){let t=document.createElement(`iframe`);t.src=v(h.sanitizeUrl(y(e))),t.style.border=`none`,t.style.margin=`0`,t.style.width=`100%`,t.setAttribute(`sandbox`,``);let i=new r({title:this.title,content:t}),a=new n({sourceLayer:this,popupTemplate:i});return Promise.resolve([a])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){let{path:t,query:n}=this.parsedUrl,{data:r}=await i(t,{query:{SERVICE:`WMS`,REQUEST:`GetCapabilities`,...n,...this.customParameters},responseType:`xml`,signal:e});this.resourceInfo=W(r)}if(this.parsedUrl){let e=new b(this.parsedUrl.path),{httpsDomains:n}=t.request;e.scheme===`https`&&(!e.port||e.port===`443`)&&e.host&&!n.includes(e.host)&&n.push(e.host)}this.read(this.resourceInfo,{origin:`service`})}_checkLayerValidity(){if(!this.allSublayers.length)throw new s(`wmslayer:empty-layer`,`The layer doesn't have any sublayer`)}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;let t={...this.customParameters,...this.customLayerParameters};for(let n in t)e[n.toLowerCase()]=t[n];return e}};e([x({type:G})],Q.prototype,`timeExtent`,void 0),e([x({type:K})],Q.prototype,`timeOffset`,void 0),e([x({readOnly:!0})],Q.prototype,`allSublayers`,void 0),e([x({json:{type:Object,write:!0}})],Q.prototype,`customParameters`,void 0),e([x({json:{type:Object,write:!0}})],Q.prototype,`customLayerParameters`,void 0),e([x({type:String,json:{write:!0}})],Q.prototype,`copyright`,void 0),e([x()],Q.prototype,`description`,void 0),e([x({readOnly:!0})],Q.prototype,`dimensions`,void 0),e([x({json:{type:[[Number]],read:{source:`extent`},write:{target:`extent`},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],Q.prototype,`fullExtent`,void 0),e([q([`web-document`,`portal-item`],`fullExtent`,[`extent`])],Q.prototype,`readFullExtentFromItemOrMap`,null),e([J([`web-document`,`portal-item`],`fullExtent`,{extent:{type:[[Number]]}})],Q.prototype,`writeFullExtent`,null),e([x({type:[T]})],Q.prototype,`fullExtents`,void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`featureInfoFormat`,null),e([x({type:[String],readOnly:!0})],Q.prototype,`featureInfoFormats`,void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`featureInfoUrl`,void 0),e([x()],Q.prototype,`fetchFeatureInfoFunction`,void 0),e([x({type:String,json:{origins:{"web-document":{default:`image/png`,type:Y.jsonValues,read:{reader:Y.read,source:`format`},write:{writer:Y.write,target:`format`}}}}})],Q.prototype,`imageFormat`,void 0),e([q(`imageFormat`,[`supportedImageFormatTypes`])],Q.prototype,`readImageFormat`,null),e([x({type:Number,json:{read:{source:`maxHeight`},write:{target:`maxHeight`}}})],Q.prototype,`imageMaxHeight`,void 0),e([x({type:Number,json:{read:{source:`maxWidth`},write:{target:`maxWidth`}}})],Q.prototype,`imageMaxWidth`,void 0),e([x()],Q.prototype,`imageTransparency`,void 0),e([x(I)],Q.prototype,`legendEnabled`,void 0),e([x({type:[`show`,`hide`,`hide-children`]})],Q.prototype,`listMode`,void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`mapUrl`,void 0),e([x({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Q.prototype,`isReference`,void 0),e([x({type:[`WMS`]})],Q.prototype,`operationalLayerType`,void 0),e([x()],Q.prototype,`resourceInfo`,void 0),e([x({type:E,json:{origins:{service:{read:{source:`extent.spatialReference`}}},write:!1}})],Q.prototype,`spatialReference`,void 0),e([q([`web-document`,`portal-item`],`spatialReference`,[`spatialReferences`])],Q.prototype,`readSpatialReferenceFromItemOrDocument`,null),e([x({type:[C],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],Q.prototype,`spatialReferences`,void 0),e([J([`web-document`,`portal-item`],`spatialReferences`)],Q.prototype,`writeSpatialReferences`,null),e([x({type:a.ofType(B),json:{write:{target:`layers`,overridePolicy(e,t,n){if(ne(this.allSublayers,n))return{ignoreOrigin:!0}}}}})],Q.prototype,`sublayers`,void 0),e([q([`web-document`,`portal-item`],`sublayers`,[`layers`,`visibleLayers`])],Q.prototype,`readSublayersFromItemOrMap`,null),e([q(`service`,`sublayers`,[`layers`])],Q.prototype,`readSublayers`,null),e([J(`sublayers`,{layers:{type:[B]},visibleLayers:{type:[String]}})],Q.prototype,`writeSublayers`,null),e([x({json:{read:!1},readOnly:!0,value:`wms`})],Q.prototype,`type`,void 0),e([x(L)],Q.prototype,`url`,null),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`version`,void 0),Q=e([S(`esri.layers.WMSLayer`)],Q);function ne(e,t){return e.some(e=>{for(let n in e)if(w(e,n,null,t))return!0;return!1})}function $(e,t,n){e??=[];let r=new Map;e.every(e=>e.id==null)&&(e=l(e),e.forEach((e,t)=>e.id=t));for(let i of e){let e=new B;e.read(i,t),n&&!n.includes(e.name)&&(e.visible=!1),r.set(e.id,e)}let i=[];for(let t of e){let e=t.id==null?null:r.get(t.id);if(e){if(t.parentLayerId!=null&&t.parentLayerId>=0){let n=r.get(t.parentLayerId);if(!n)continue;n.sublayers||=new a,n.sublayers.push(e)}else i.push(e)}}return i}const re=Q;export{re as default};
2
+ import{__decorate as e}from"tslib";import t from"../config.js";import n from"../Graphic.js";import r from"../PopupTemplate.js";import i from"../request.js";import a from"../core/Collection.js";import o from"../core/CollectionFlattener.js";import s from"../core/Error.js";import{JSONMap as c}from"../core/jsonMap.js";import{clone as l}from"../core/lang.js";import{MultiOriginJSONSupportMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d}from"../core/promiseUtils.js";import{on as f,sync as p,watch as m}from"../core/reactiveUtils.js";import{renderingSanitizer as h}from"../core/sanitizerUtils.js";import{urlToObject as g,addQueryParameters as _,addProxy as v,makeAbsolute as y,Url as b}from"../core/urlUtils.js";import{property as x,subclass as S}from"../core/accessorSupport/decorators.js";import{Integer as C}from"../core/accessorSupport/ensureType.js";import{willPropertyWrite as w}from"../core/accessorSupport/write.js";import T from"../geometry/Extent.js";import E from"../geometry/SpatialReference.js";import{getScale as D}from"../geometry/support/scaleUtils.js";import{equals as O}from"../geometry/support/spatialReferenceUtils.js";import ee from"./Layer.js";import{BlendLayer as te}from"./mixins/BlendLayer.js";import{OperationalLayer as k}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{RefreshableLayer as j}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as M}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as N}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as P}from"./ogc/crsUtils.js";import{isWmsServer as F}from"./support/arcgisLayerUrl.js";import{legendEnabled as I,url as L}from"./support/commonProperties.js";import{ExportWMSImageParameters as R}from"./support/ExportWMSImageParameters.js";import{createBitmap as z}from"./support/imageBitmapUtils.js";import B from"./support/WMSSublayer.js";import{normalizeWKID as V,toTimeQueryParameter as H,getPopupLayers as U,parseCapabilities as W}from"./support/wmsUtils.js";import G from"../time/TimeExtent.js";import K from"../time/TimeInterval.js";import{reader as q}from"../core/accessorSupport/decorators/reader.js";import{writer as J}from"../core/accessorSupport/decorators/writer.js";const Y=new c({bmp:`image/bmp`,gif:`image/gif`,jpg:`image/jpeg`,png:`image/png`,svg:`image/svg+xml`},{ignoreUnknown:!1});function X(e){return e===`text/html`}function Z(e){return e===`text/plain`}let Q=class extends te(N(j(M(k(A(u(ee))))))){constructor(...e){super(...e),this.allSublayers=new o({getCollections:()=>[this.sublayers],getChildrenFunction(e){return e.sublayers}}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType=`WMS`,this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type=`wms`,this.version=null,this.addHandles([f(()=>this.sublayers,`after-add`,({item:e})=>{e.parent=e.layer=this},p),f(()=>this.sublayers,`after-remove`,({item:e})=>{e.layer=e.parent=null},p),m(()=>this.sublayers,(e,t)=>{if(t)for(let e of t)e.layer=e.parent=null;if(e)for(let t of e)t.parent=t.layer=this},p)])}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){this.allSublayers.destroy()}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`WMS`]},e).catch(d).then(()=>this._fetchService(t)).then(()=>this._checkLayerValidity())),Promise.resolve(this)}get timeInfo(){return super.timeInfo}set timeInfo(e){super.timeInfo=e}readFullExtentFromItemOrMap(e,t){let n=t.extent;return n?new T({xmin:n[0][0],ymin:n[0][1],xmax:n[1][0],ymax:n[1][1]}):null}writeFullExtent(e,t){t.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){return this.featureInfoFormats==null?null:this.featureInfoFormats.find(X)??this.featureInfoFormats.find(Z)??null}set featureInfoFormat(e){e==null?(this.revertToOrigin(`featureInfoFormat`,`service`),this._clearOverride(`featureInfoFormat`)):(X(e)||Z(e))&&this._override(`featureInfoFormat`,e)}readImageFormat(e,t){let n=t.supportedImageFormatTypes;return n&&n.includes(`image/png`)?`image/png`:n&&n[0]}readSpatialReferenceFromItemOrDocument(e,t){return new E(t.spatialReferences[0])}writeSpatialReferences(e,t){let n=this.spatialReference?.wkid;e&&n?(t.spatialReferences=e.filter(e=>e!==n),t.spatialReferences.unshift(n)):t.spatialReferences=e}readSublayersFromItemOrMap(e,t,n){return $(t.layers,n,t.visibleLayers)}readSublayers(e,t,n){return $(t.layers,n)}writeSublayers(e,t,n,r){t.layers=[];let i=new Map,a=e.flatten(({sublayers:e})=>e??[]);for(let e of a)if(typeof e.parent?.id==`number`){let t=i.get(e.parent.id);t==null?i.set(e.parent.id,[e.id]):t.push(e.id)}for(let e of a){let n={sublayer:e,...r},a=e.write({parentLayerId:typeof e.parent?.id==`number`?e.parent.id:-1},n);if(i.has(e.id)&&(a.sublayerIds=i.get(e.id)),!e.sublayers&&e.name){let r=e.write({},n);delete r.id,t.layers.push(r)}}t.visibleLayers=a.filter(({visible:e,sublayers:t})=>e&&!t).map(({name:e})=>e).toArray()}set url(e){if(!e){this._set(`url`,e);return}let{path:t,query:n}=g(e);for(let e in n)/^(request|service)$/i.test(e)&&delete n[e];let r=_(t,n??{});this._set(`url`,r)}createExportImageParameters(e,t,n,r){let i=r?.pixelRatio??1,a=D({extent:e,width:t})*i,o=new R({layer:this,scale:a}),{xmin:s,ymin:c,xmax:l,ymax:u,spatialReference:d}=e,f=V(d,this.spatialReferences),p=this.version===`1.3.0`&&P(f)?`${c},${s},${u},${l}`:`${s},${c},${l},${u}`,m=o.toJSON();return{bbox:p,[this.version===`1.3.0`?`crs`:`srs`]:f==null||isNaN(f)?void 0:`EPSG:`+f,...m}}async fetchImage(e,t,n,r){let a=this.mapUrl,o=this.createExportImageParameters(e,t,n,r);if(!o.layers){let e=document.createElement(`canvas`);return e.width=t,e.height=n,e}let s=H(r?.timeExtent),c={responseType:`image`,query:this._mixCustomParameters({width:t,height:n,...o,time:s,...this.refreshParameters}),signal:r?.signal};return i(a??``,c).then(e=>e.data)}async fetchImageBitmap(e,t,n,r){let a=this.mapUrl??``,o=this.createExportImageParameters(e,t,n,r);if(!o.layers){let e=document.createElement(`canvas`);return e.width=t,e.height=n,e}let s=H(r?.timeExtent),c={responseType:`blob`,query:this._mixCustomParameters({width:t,height:n,...o,time:s,...this.refreshParameters}),signal:r?.signal},{data:l}=await i(a,c);return z(l,a,r)}fetchFeatureInfo(e,t,n,r,i){let a=D({extent:e,width:t}),o=new R({layer:this,scale:a}),s=U(o.visibleSublayers);if(this.featureInfoUrl==null||s==null||this.fetchFeatureInfoFunction==null&&this.featureInfoFormat==null)return Promise.resolve([]);let c=this.version===`1.3.0`?{I:r,J:i}:{x:r,y:i},l={query_layers:s,request:`GetFeatureInfo`,info_format:this.featureInfoFormat,feature_count:25,width:t,height:n,...c},u={...this.createExportImageParameters(e,t,n),...l},d=this._mixCustomParameters(u);return this.fetchFeatureInfoFunction==null?this._defaultFetchFeatureInfoFunction(_(this.featureInfoUrl,d)):this.fetchFeatureInfoFunction(d)}findSublayerById(e){return this.allSublayers.find(t=>t.id===e)}findSublayerByName(e){return this.allSublayers.find(t=>t.name===e)}serviceSupportsSpatialReference(e){return F(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(t=>{let n=t===900913?E.WebMercator:new E({wkid:t});return O(n,e)})}_defaultFetchFeatureInfoFunction(e){let t=document.createElement(`iframe`);t.src=v(h.sanitizeUrl(y(e))),t.style.border=`none`,t.style.margin=`0`,t.style.width=`100%`,t.setAttribute(`sandbox`,``);let i=new r({title:this.title,content:t}),a=new n({sourceLayer:this,popupTemplate:i});return Promise.resolve([a])}async _fetchService(e){if(!this.resourceInfo&&this.parsedUrl?.path){let{path:t,query:n}=this.parsedUrl,{data:r}=await i(t,{query:{SERVICE:`WMS`,REQUEST:`GetCapabilities`,...n,...this.customParameters},responseType:`xml`,signal:e});this.resourceInfo=W(r)}if(this.parsedUrl){let e=new b(this.parsedUrl.path),{httpsDomains:n}=t.request;e.scheme!==`https`||e.port&&e.port!==`443`||!e.host||n.includes(e.host)||n.push(e.host)}this.read(this.resourceInfo,{origin:`service`})}_checkLayerValidity(){if(!this.allSublayers.length)throw new s(`wmslayer:empty-layer`,`The layer doesn't have any sublayer`)}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;let t={...this.customParameters,...this.customLayerParameters};for(let n in t)e[n.toLowerCase()]=t[n];return e}};e([x({type:G})],Q.prototype,`timeExtent`,void 0),e([x({type:K})],Q.prototype,`timeOffset`,void 0),e([x({readOnly:!0})],Q.prototype,`allSublayers`,void 0),e([x({json:{type:Object,write:!0}})],Q.prototype,`customParameters`,void 0),e([x({json:{type:Object,write:!0}})],Q.prototype,`customLayerParameters`,void 0),e([x({type:String,json:{write:!0}})],Q.prototype,`copyright`,void 0),e([x()],Q.prototype,`description`,void 0),e([x({readOnly:!0})],Q.prototype,`dimensions`,void 0),e([x({json:{type:[[Number]],read:{source:`extent`},write:{target:`extent`},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],Q.prototype,`fullExtent`,void 0),e([q([`web-document`,`portal-item`],`fullExtent`,[`extent`])],Q.prototype,`readFullExtentFromItemOrMap`,null),e([J([`web-document`,`portal-item`],`fullExtent`,{extent:{type:[[Number]]}})],Q.prototype,`writeFullExtent`,null),e([x({type:[T]})],Q.prototype,`fullExtents`,void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`featureInfoFormat`,null),e([x({type:[String],readOnly:!0})],Q.prototype,`featureInfoFormats`,void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`featureInfoUrl`,void 0),e([x()],Q.prototype,`fetchFeatureInfoFunction`,void 0),e([x({type:String,json:{origins:{"web-document":{default:`image/png`,type:Y.jsonValues,read:{reader:Y.read,source:`format`},write:{writer:Y.write,target:`format`}}}}})],Q.prototype,`imageFormat`,void 0),e([q(`imageFormat`,[`supportedImageFormatTypes`])],Q.prototype,`readImageFormat`,null),e([x({type:Number,json:{read:{source:`maxHeight`},write:{target:`maxHeight`}}})],Q.prototype,`imageMaxHeight`,void 0),e([x({type:Number,json:{read:{source:`maxWidth`},write:{target:`maxWidth`}}})],Q.prototype,`imageMaxWidth`,void 0),e([x()],Q.prototype,`imageTransparency`,void 0),e([x(I)],Q.prototype,`legendEnabled`,void 0),e([x({type:[`show`,`hide`,`hide-children`]})],Q.prototype,`listMode`,void 0),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`mapUrl`,void 0),e([x({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],Q.prototype,`isReference`,void 0),e([x({type:[`WMS`]})],Q.prototype,`operationalLayerType`,void 0),e([x()],Q.prototype,`resourceInfo`,void 0),e([x({type:E,json:{origins:{service:{read:{source:`extent.spatialReference`}}},write:!1}})],Q.prototype,`spatialReference`,void 0),e([q([`web-document`,`portal-item`],`spatialReference`,[`spatialReferences`])],Q.prototype,`readSpatialReferenceFromItemOrDocument`,null),e([x({type:[C],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],Q.prototype,`spatialReferences`,void 0),e([J([`web-document`,`portal-item`],`spatialReferences`)],Q.prototype,`writeSpatialReferences`,null),e([x({type:a.ofType(B),json:{write:{target:`layers`,overridePolicy(e,t,n){if(ne(this.allSublayers,n))return{ignoreOrigin:!0}}}}})],Q.prototype,`sublayers`,void 0),e([q([`web-document`,`portal-item`],`sublayers`,[`layers`,`visibleLayers`])],Q.prototype,`readSublayersFromItemOrMap`,null),e([q(`service`,`sublayers`,[`layers`])],Q.prototype,`readSublayers`,null),e([J(`sublayers`,{layers:{type:[B]},visibleLayers:{type:[String]}})],Q.prototype,`writeSublayers`,null),e([x({json:{read:!1},readOnly:!0,value:`wms`})],Q.prototype,`type`,void 0),e([x(L)],Q.prototype,`url`,null),e([x({type:String,json:{write:{ignoreOrigin:!0}}})],Q.prototype,`version`,void 0),Q=e([S(`esri.layers.WMSLayer`)],Q);function ne(e,t){return e.some(e=>{for(let n in e)if(w(e,n,null,t))return!0;return!1})}function $(e,t,n){e??=[];let r=new Map;e.every(e=>e.id==null)&&(e=l(e),e.forEach((e,t)=>e.id=t));for(let i of e){let e=new B;e.read(i,t),n&&!n.includes(e.name)&&(e.visible=!1),r.set(e.id,e)}let i=[];for(let t of e){let e=t.id==null?null:r.get(t.id);if(e){if(t.parentLayerId!=null&&t.parentLayerId>=0){let n=r.get(t.parentLayerId);if(!n)continue;n.sublayers||=new a,n.sublayers.push(e)}else i.push(e)}}return i}const re=Q;export{re as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import e from"../../core/Error.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as r}from"../../core/libs/gl-matrix-2/math/vec2.js";import i from"../../geometry/Extent.js";import a from"../../geometry/Polygon.js";import{densifyExecute as o}from"../../geometry/operators/densifyOperator.js";import{projectExecute as s}from"../../geometry/operators/projectOperator.js";class c{constructor(e){this.ctm=e.ctm,this.spatialReference=e.toSpatialReference(),this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=this._getExtentFromArray(e.outerExtentMediaBox),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){let e=[];for(let[t,n]of this.outerMediaBox){let r=l(this.ctm,t,n);e.push([r[0],r[1]])}return new a({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){let e=[];for(let[t,n]of this.pairedNeatline){let r=l(this.ctm,t,n);e.push([r[0],r[1]])}return new a({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(n,r,i){t(i);let a=n;if(a.spatialReference.equals(r))return a;if(!a||!a.extent)throw new e(`geospatial-pdf-layer:load`,`Could not project neatline`);let c=Math.max(a.extent.width,a.extent.height)/256,l=o(a,c);return s(l,r)}toExtent(){return this._getExtentFromArray(this.pairedNeatline)}_getExtentFromArray(e){let t=1/0,n=1/0,r=-1/0,a=-1/0;for(let i=0;i<e.length;i++){let o=l(this.ctm,e[i][0],e[i][1]);t=Math.min(t,o[0]),n=Math.min(n,o[1]),r=Math.max(r,o[0]),a=Math.max(a,o[1])}return new i({xmin:t,ymin:n,xmax:r,ymax:a,spatialReference:this.spatialReference})}}function l(e,t,i){let[a,o,s,c,l,u]=e,d=n();return r(d,a*t+s*i+l,o*t+c*i+u),d}export{c as default};
2
+ import e from"../../core/Error.js";import{throwIfAborted as t}from"../../core/promiseUtils.js";import{create as n}from"../../core/libs/gl-matrix-2/factories/vec2f64.js";import{set as r}from"../../core/libs/gl-matrix-2/math/vec2.js";import i from"../../geometry/Extent.js";import a from"../../geometry/Polygon.js";import{densifyExecute as o}from"../../geometry/operators/densifyOperator.js";import{projectExecute as s}from"../../geometry/operators/projectOperator.js";class c{constructor(e){this.ctm=e.ctm,this.spatialReference=e.spatialReference,this.pairedNeatline=e.pairedNeatline,this.outerExtentMediabox=l(e.outerExtentMediaBox,this.ctm,this.spatialReference),this.geoControlPoints=e.geoControlPoints,this.outerMediaBox=e.outerExtentMediaBox,this.sourceMediaBoxPolygon=this.createSourceMediaBoxPolygon(),this.sourceNeatlinePolygon=this.createSourceNeatlinePolygon()}createSourceMediaBoxPolygon(){let e=[];for(let[t,n]of this.outerMediaBox){let r=u(this.ctm,t,n);e.push([r[0],r[1]])}return new a({rings:[e],spatialReference:this.spatialReference})}createSourceNeatlinePolygon(){let e=[];for(let[t,n]of this.pairedNeatline){let r=u(this.ctm,t,n);e.push([r[0],r[1]])}return new a({rings:[e],spatialReference:this.spatialReference})}createProjectedPolygon(n,r,i){t(i);let a=n;if(a.spatialReference.equals(r))return a;if(!a||!a.extent)throw new e(`geospatial-pdf-layer:load`,`Could not project neatline`);let c=Math.max(a.extent.width,a.extent.height)/256,l=o(a,c);return s(l,r)}toExtent(){return l(this.pairedNeatline,this.ctm,this.spatialReference)}}function l(e,t,n){let r=1/0,a=1/0,o=-1/0,s=-1/0;for(let n=0;n<e.length;n++){let i=u(t,e[n][0],e[n][1]);r=Math.min(r,i[0]),a=Math.min(a,i[1]),o=Math.max(o,i[0]),s=Math.max(s,i[1])}return new i({xmin:r,ymin:a,xmax:o,ymax:s,spatialReference:n})}function u(e,t,i){let[a,o,s,c,l,u]=e,d=n();return r(d,a*t+s*i+l,o*t+c*i+u),d}export{c as default};