@arcgis/core 6.0.0-next.40 → 6.0.0-next.42

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 (529) hide show
  1. package/Camera.js +1 -1
  2. package/applications/Components/arcadeFeatureUtils.d.ts +12 -0
  3. package/applications/Components/arcadeFeatureUtils.js +1 -1
  4. package/arcgisGlobal.d.ts +0 -2
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/00d43f02119167531d1b.js +1 -0
  7. package/assets/esri/core/workers/chunks/{1c406ab2bf99ac563316.js → 0696fa44a04b99738d7b.js} +1 -1
  8. package/assets/esri/core/workers/chunks/075fe33152fd79fe6d72.js +1 -0
  9. package/assets/esri/core/workers/chunks/098ac10877d92fde1006.js +1 -0
  10. package/assets/esri/core/workers/chunks/0a29d87b6e58a3c6df8f.js +1 -0
  11. package/assets/esri/core/workers/chunks/0d04353843ccb7440342.js +1 -0
  12. package/assets/esri/core/workers/chunks/0d87cb6417672de95d53.js +1 -0
  13. package/assets/esri/core/workers/chunks/11877d4dc97f756e4711.js +1 -0
  14. package/assets/esri/core/workers/chunks/1860104c2b33f68785dd.js +1 -0
  15. package/assets/esri/core/workers/chunks/1980fd7ae1617ef4d19d.js +1 -0
  16. package/assets/esri/core/workers/chunks/1c7096eb48a3a7f27d4f.js +1 -0
  17. package/assets/esri/core/workers/chunks/1cc03067f8405285057c.js +1 -0
  18. package/assets/esri/core/workers/chunks/{14d81280807a3d3c1b7e.js → 244ffdb91237d1cbade3.js} +1 -1
  19. package/assets/esri/core/workers/chunks/24bdeafbb16ae83bb8c3.js +1 -0
  20. package/assets/esri/core/workers/chunks/2690d5fcd9d5ca92ebf6.js +1 -0
  21. package/assets/esri/core/workers/chunks/2b27d3bc492e000bbe58.js +1 -0
  22. package/assets/esri/core/workers/chunks/2d64a13c2303e9cae613.js +1 -0
  23. package/assets/esri/core/workers/chunks/2e760d04641755d1820d.js +1 -0
  24. package/assets/esri/core/workers/chunks/{0b21d0e2e5a91c34a108.js → 2f54e4feb554c1a7b9c4.js} +1 -1
  25. package/assets/esri/core/workers/chunks/348f28d7ab46df878c6f.js +1 -0
  26. package/assets/esri/core/workers/chunks/{7023651ed6398dcf8efb.js → 36bafcc29ac133a05558.js} +7 -7
  27. package/assets/esri/core/workers/chunks/36e5f070009b29b7ac3d.js +1 -0
  28. package/assets/esri/core/workers/chunks/39c23a52d7c3e1ee121c.js +1 -0
  29. package/assets/esri/core/workers/chunks/{5504ec9bd9ee4d10af07.js → 3f74c61359b4bd6dcf00.js} +1 -1
  30. package/assets/esri/core/workers/chunks/{00311d1b18d5952a014b.js → 446d172834f8675f1202.js} +1 -1
  31. package/assets/esri/core/workers/chunks/45aaefbdffe5e15dfb24.js +1 -0
  32. package/assets/esri/core/workers/chunks/48c6230b8a6d3a8a7906.js +1 -0
  33. package/assets/esri/core/workers/chunks/4c73c493dabe949c2512.js +1 -0
  34. package/assets/esri/core/workers/chunks/{592b5db1459c02cf6a0c.js → 4d62877f521cc9663535.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{2fcd7db1e192858a650e.js → 503ee206e7de1f65e291.js} +1 -1
  36. package/assets/esri/core/workers/chunks/55c0c074e4afe05f5d4d.js +1 -0
  37. package/assets/esri/core/workers/chunks/5bfb962ca192f90a2724.js +1 -0
  38. package/assets/esri/core/workers/chunks/{76e80381fa6d1e084796.js → 5dea74fe52583e77f3ce.js} +1 -1
  39. package/assets/esri/core/workers/chunks/6699fac01ccd842851ba.js +1 -0
  40. package/assets/esri/core/workers/chunks/672a5390182b20d632be.js +1 -0
  41. package/assets/esri/core/workers/chunks/67c2e5953087dadfd245.js +1 -0
  42. package/assets/esri/core/workers/chunks/67caef2ecf0dc5f2eed3.js +1 -0
  43. package/assets/esri/core/workers/chunks/68fd7b314377d27aaa54.js +1 -0
  44. package/assets/esri/core/workers/chunks/6d863761f29f31a030eb.js +1 -0
  45. package/assets/esri/core/workers/chunks/{ce8ef2eec290e1df6b2a.js → 7390af96250e89194332.js} +1 -1
  46. package/assets/esri/core/workers/chunks/7452b5ae971a9ff2e6e9.js +1 -0
  47. package/assets/esri/core/workers/chunks/7672c123cfb960f4ddad.js +1 -0
  48. package/assets/esri/core/workers/chunks/{9934e8e19f94e9169eea.js → 776b64a1e1a57878c34c.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{1ec772eaa63eb6937231.js → 8140ed6e44c3d8536d3e.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{58716a3a6106a1b0fb9d.js → 832c887fdc5af4c08cf2.js} +1 -1
  51. package/assets/esri/core/workers/chunks/84fb27e3425515cd0e3f.js +1 -0
  52. package/assets/esri/core/workers/chunks/867502158997cb2d6406.js +1 -0
  53. package/assets/esri/core/workers/chunks/8ceb6697e8adbeffe019.js +1 -0
  54. package/assets/esri/core/workers/chunks/8fe22c2370219f25c15b.js +1 -0
  55. package/assets/esri/core/workers/chunks/91586bf29492735e692d.js +1 -0
  56. package/assets/esri/core/workers/chunks/{b2d6b1ac9fbb50c7c8ab.js → 929ca32ddbb43328ef31.js} +1 -1
  57. package/assets/esri/core/workers/chunks/a03f15f2cbc3fed291c2.js +1 -0
  58. package/assets/esri/core/workers/chunks/{123541f79be7adff0818.js → a422a801e55fa125546e.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{22e73501e1435a896826.js → a5f17e9a025ac2b6e1bf.js} +1 -1
  60. package/assets/esri/core/workers/chunks/a6e846361bf5dd3a11c7.js +1 -0
  61. package/assets/esri/core/workers/chunks/{fd967a9f3cf0e2890dbb.js → a91dc05a6a609d04ed04.js} +1 -1
  62. package/assets/esri/core/workers/chunks/a99c50b4e1c7568210e1.js +1 -0
  63. package/assets/esri/core/workers/chunks/ab48faea5432e2dbd45c.js +1 -0
  64. package/assets/esri/core/workers/chunks/afe3e89737fb45189a99.js +1 -0
  65. package/assets/esri/core/workers/chunks/b18459c1bed75dbdec08.js +1 -0
  66. package/assets/esri/core/workers/chunks/{d03b82e962c70a3fd377.js → b4928831a2a13b2da745.js} +1 -1
  67. package/assets/esri/core/workers/chunks/b7205620ca248f4efc88.js +1 -0
  68. package/assets/esri/core/workers/chunks/bbddeb1c893ff8bbae5d.js +1 -0
  69. package/assets/esri/core/workers/chunks/bc2e2bdf1194e6e9eb5e.js +1 -0
  70. package/assets/esri/core/workers/chunks/{dae2036faa28dade2119.js → beccbfff549902733c4e.js} +1 -1
  71. package/assets/esri/core/workers/chunks/c3ba1a3247e14f6b7b3a.js +1 -0
  72. package/assets/esri/core/workers/chunks/c5d0a034ff31d5954571.js +1 -0
  73. package/assets/esri/core/workers/chunks/{396299c22994c502e41c.js → c8057b47c7c6c02a0bda.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{9e2c30b67bab5795306e.js → cb2329d1ea72ce5cc057.js} +1 -1
  75. package/assets/esri/core/workers/chunks/cd46d9b4a8de644e7332.js +1 -0
  76. package/assets/esri/core/workers/chunks/d0172d31389dbfaaa848.js +1 -0
  77. package/assets/esri/core/workers/chunks/{f07fb9b3fa30d7ee1681.js → d4c8673ca65df874a7ce.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{947f3a1cad976bba9738.js → d5e251cddd41d643510c.js} +1 -1
  79. package/assets/esri/core/workers/chunks/da1e6962ba0c85c37953.js +1 -0
  80. package/assets/esri/core/workers/chunks/dff845574c0037a1dca6.js +1 -0
  81. package/assets/esri/core/workers/chunks/e0864ca82ffa3c9a0776.js +1 -0
  82. package/assets/esri/core/workers/chunks/e0cf6e1e21d0ee739009.js +1 -0
  83. package/assets/esri/core/workers/chunks/e69cd62f824ce7a22fa0.js +1 -0
  84. package/assets/esri/core/workers/chunks/{c9feffb9884cfed52c4b.js → f190a3124d6d03417d73.js} +1 -1
  85. package/assets/esri/core/workers/chunks/f4135779bfdaf349352a.js +1 -0
  86. package/assets/esri/core/workers/chunks/fbe3a3b9d6c8c0b52f65.js +1 -0
  87. package/assets/esri/core/workers/chunks/fd17c4a9e13bf77aa86a.js +1 -0
  88. package/assets/esri/core/workers/chunks/fdd2b35388f9fe42b623.js +1 -0
  89. package/assets/esri/core/workers/chunks/fe7184993ef5713d13fb.js +1 -0
  90. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  91. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  92. package/assets/esri/themes/base/_core.scss +0 -2
  93. package/assets/esri/themes/dark/main.css +1 -1
  94. package/assets/esri/themes/light/main.css +1 -1
  95. package/assets/esri/themes/light/view.css +1 -1
  96. package/chunks/cameraUtilsPlanar.js +1 -1
  97. package/chunks/cameraUtilsSpherical.js +1 -1
  98. package/chunks/lyr3DMain.js +1 -1
  99. package/chunks/lyr3DWorker.js +1 -1
  100. package/config.js +1 -1
  101. package/core/Accessor.d.ts +1 -1
  102. package/core/Accessor.js +1 -1
  103. package/core/Logger.js +1 -1
  104. package/core/accessorSupport/DefaultsStore.js +1 -1
  105. package/core/accessorSupport/Properties.js +1 -1
  106. package/core/accessorSupport/Property.js +1 -1
  107. package/core/accessorSupport/watch.js +1 -1
  108. package/core/deprecate.js +1 -1
  109. package/core/has.js +1 -1
  110. package/core/libs/gl-matrix-2/math/mat4.js +1 -1
  111. package/core/types.d.ts +0 -5
  112. package/core/workers/workers.js +1 -6
  113. package/core/workers.d.ts +1 -2
  114. package/geometry/Extent.js +1 -1
  115. package/geometry/Geometry.js +1 -1
  116. package/geometry/Multipoint.js +1 -1
  117. package/geometry/Point.js +1 -1
  118. package/geometry/Polygon.js +1 -1
  119. package/geometry/Polyline.js +1 -1
  120. package/geometry/coordinateFormatter.js +1 -1
  121. package/geometry/operators/gx/operatorRelate.js +2 -0
  122. package/geometry/operators/relateOperator.js +1 -1
  123. package/identity/IdentityModal.js +1 -1
  124. package/interfaces.d.ts +0 -17
  125. package/kernel.js +1 -1
  126. package/layers/BaseElevationLayer.js +1 -1
  127. package/layers/BaseTileLayer.js +1 -1
  128. package/layers/BuildingSceneLayer.js +1 -1
  129. package/layers/CatalogLayer.js +1 -1
  130. package/layers/ElevationLayer.d.ts +1 -1
  131. package/layers/ElevationLayer.js +1 -1
  132. package/layers/FeatureLayer.js +1 -1
  133. package/layers/GeoRSSLayer.js +1 -1
  134. package/layers/ImageryLayer.js +1 -1
  135. package/layers/ImageryTileLayer.js +1 -1
  136. package/layers/IntegratedMesh3DTilesLayer.d.ts +4 -3
  137. package/layers/IntegratedMeshLayer.d.ts +4 -3
  138. package/layers/IntegratedMeshLayer.js +1 -1
  139. package/layers/KMLLayer.js +1 -1
  140. package/layers/Layer.js +1 -1
  141. package/layers/LinkChartLayer.js +1 -1
  142. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  143. package/layers/MapImageLayer.js +1 -1
  144. package/layers/OpenStreetMapLayer.js +1 -1
  145. package/layers/PointCloudLayer.js +1 -1
  146. package/layers/SceneLayer.js +1 -1
  147. package/layers/StreamLayer.js +1 -1
  148. package/layers/SubtypeGroupLayer.js +1 -1
  149. package/layers/TileLayer.js +1 -1
  150. package/layers/VectorTileLayer.js +1 -1
  151. package/layers/WCSLayer.js +1 -1
  152. package/layers/WMSLayer.js +1 -1
  153. package/layers/WMTSLayer.js +1 -1
  154. package/layers/WebTileLayer.js +1 -1
  155. package/layers/graphics/sources/CSVSource.js +1 -1
  156. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  157. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  158. package/layers/graphics/sources/MemorySource.js +1 -1
  159. package/layers/graphics/sources/WFSSource.js +1 -1
  160. package/layers/graphics/sources/support/QueryTask.js +1 -1
  161. package/layers/mixins/ArcGISImageService.js +1 -1
  162. package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
  163. package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
  164. package/layers/orientedImagery/transformations/updateElevationUtils.js +1 -1
  165. package/layers/raster/datasets/BaseRaster.js +1 -1
  166. package/layers/raster/datasets/ImageServerRaster.js +1 -1
  167. package/layers/raster/datasets/MRFRaster.js +1 -1
  168. package/layers/raster/datasets/RasterFactory.js +1 -1
  169. package/layers/raster/datasets/ZarrRaster.js +2 -0
  170. package/layers/raster/datasets/datasetUtils.js +1 -1
  171. package/layers/raster/datasets/zarrParser.js +2 -0
  172. package/layers/raster/datasets/zarrUtils.js +2 -0
  173. package/layers/raster/formats/pixelRangeUtils.js +1 -1
  174. package/layers/raster/formats/tiffParser.js +1 -1
  175. package/layers/raster/functions/rasterProjectionHelper.js +1 -1
  176. package/layers/support/GeometryDescriptor.js +1 -1
  177. package/layers/support/KMLSublayer.js +1 -1
  178. package/layers/support/SceneModifications.d.ts +1 -3
  179. package/layers/support/SceneModifications.js +1 -1
  180. package/layers/support/TileInfo.js +1 -1
  181. package/layers/support/featureLayerUtils.js +1 -1
  182. package/layers/support/tiles3DUtils.js +1 -1
  183. package/layers/support/wmtsUtils.js +1 -1
  184. package/layers/video/videoUtils.js +1 -1
  185. package/legend/ActiveLayerInfo.js +1 -1
  186. package/package.json +4 -4
  187. package/portal/Portal.js +1 -1
  188. package/portal/PortalItem.js +1 -1
  189. package/rest/query/executePivotQuery.js +1 -1
  190. package/rest/query/operations/queryPivot.js +1 -1
  191. package/rest/query/operations/queryUtils.js +1 -1
  192. package/rest/support/PivotQuery.js +1 -1
  193. package/rest/support/Query.js +1 -1
  194. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  195. package/support/LayersMixin.d.ts +2 -2
  196. package/symbols/PictureFillSymbol.js +1 -1
  197. package/symbols/PictureMarkerSymbol.js +1 -1
  198. package/symbols/SimpleFillSymbol.js +1 -1
  199. package/symbols/SimpleLineSymbol.js +1 -1
  200. package/symbols/SimpleMarkerSymbol.js +1 -1
  201. package/symbols/Symbol3D.js +1 -1
  202. package/symbols/TextSymbol.js +1 -1
  203. package/symbols/cim/Rasterizer.js +1 -1
  204. package/symbols/cim/utils.js +1 -1
  205. package/views/2d/PaddedViewState.js +1 -1
  206. package/views/2d/ViewState.js +1 -1
  207. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  208. package/views/2d/engine/webgl/TextureManager.js +1 -1
  209. package/views/2d/engine/webgl/VideoScreenRenderer.js +1 -1
  210. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  211. package/views/2d/layers/features/sources/FeatureSourceQueryInfo.js +1 -1
  212. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  213. package/views/2d/layers/graphics/GraphicStore.js +1 -1
  214. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  215. package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
  216. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  217. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  218. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  219. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  220. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  221. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  222. package/views/3d/layers/DrapedSubView3D.js +1 -1
  223. package/views/3d/layers/FeatureLikeLayerViewBase3D.js +1 -1
  224. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  225. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  226. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  227. package/views/3d/layers/SceneLayerView3D.js +1 -1
  228. package/views/3d/layers/WMSLayerView3D.js +1 -1
  229. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  230. package/views/3d/layers/graphics/Graphics3DObjectStateSet.js +1 -1
  231. package/views/3d/layers/graphics/Graphics3DObjectStates.js +1 -1
  232. package/views/3d/layers/i3s/Highlights.js +1 -1
  233. package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
  234. package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
  235. package/views/3d/layers/support/Tiles3DLayerViewRegistration.js +2 -0
  236. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  237. package/views/3d/layers/support/createFeatureFilterHighlight.js +2 -0
  238. package/views/3d/layers/support/createTileBVHForLayer.js +2 -0
  239. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  240. package/views/3d/layers/support/highlightUtils.js +1 -1
  241. package/views/3d/layers/support/selectTiles3DSpatialReference.js +2 -0
  242. package/views/3d/layers/support/tileBoundingVolumeUtils.js +2 -0
  243. package/views/3d/support/GaussianSplatSortWorker.js +1 -1
  244. package/views/3d/support/cameraUtils.js +1 -1
  245. package/views/3d/support/earthUtils.js +1 -1
  246. package/views/3d/support/engineContent/line.js +1 -1
  247. package/views/3d/support/flow/geometryUtils.js +1 -1
  248. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  249. package/views/3d/support/gaussianSplatting/GaussianSplatIntersectionHandler.js +1 -1
  250. package/views/3d/support/gaussianSplatting/GaussianSplatSortCoordinator.js +2 -0
  251. package/views/3d/support/gaussianSplatting/GaussianTile.js +1 -1
  252. package/views/3d/support/hitTest.js +1 -1
  253. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  254. package/views/3d/terrain/TextureFader.js +1 -1
  255. package/views/3d/webgl-engine/Stage.js +1 -1
  256. package/views/3d/webgl-engine/createWebGLContext.js +2 -0
  257. package/views/3d/webgl-engine/lib/BufferGeometry.js +1 -1
  258. package/views/3d/webgl-engine/lib/GaussianSplatRenderer.js +1 -1
  259. package/views/3d/webgl-engine/lib/LineMaterial.js +1 -1
  260. package/views/3d/webgl-engine/lib/TriangleIntersectionData.js +1 -1
  261. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  262. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  263. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  264. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  265. package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
  266. package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
  267. package/views/3d/webgl-engine/materials/internal/ribbonLineBufferUtils.js +1 -1
  268. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  269. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  270. package/views/3d/webgl-engine/shaders/ShadedMaterialConfiguration.js +2 -0
  271. package/views/3d/webgl.d.ts +2 -1
  272. package/views/3d/webgl.js +1 -1
  273. package/views/SceneView.d.ts +9 -5
  274. package/views/SceneView.js +1 -1
  275. package/views/VideoView.js +1 -1
  276. package/views/View.d.ts +1 -3
  277. package/views/View2D.d.ts +2 -2
  278. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  279. package/views/draw/support/Box.js +1 -1
  280. package/views/interactive/options/ViewOptions.d.ts +0 -2
  281. package/views/layers/FeatureLikeLayerView.d.ts +3 -1
  282. package/views/layers/FeatureLikeLayerView.js +1 -1
  283. package/views/layers/GraphicsLayerView.d.ts +3 -1
  284. package/views/layers/ImageryLayerView.js +1 -1
  285. package/views/layers/ImageryTileLayerView.js +1 -1
  286. package/views/layers/SceneLayerView.d.ts +3 -2
  287. package/views/layers/SceneLayerView.js +1 -1
  288. package/views/support/Scheduler.js +1 -1
  289. package/views/types.d.ts +1 -0
  290. package/webscene/version.js +1 -1
  291. package/widgets/AreaMeasurement2D.js +1 -1
  292. package/widgets/AreaMeasurement3D.js +1 -1
  293. package/widgets/Attachments.js +1 -1
  294. package/widgets/Attribution.js +1 -1
  295. package/widgets/BasemapGallery.js +1 -1
  296. package/widgets/BasemapLayerList.js +1 -1
  297. package/widgets/BasemapToggle.js +1 -1
  298. package/widgets/BatchAttributeForm.js +1 -1
  299. package/widgets/Bookmarks.js +1 -1
  300. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  301. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  302. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  303. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  304. package/widgets/BuildingExplorer.js +1 -1
  305. package/widgets/CatalogLayerList.js +1 -1
  306. package/widgets/Compass.js +1 -1
  307. package/widgets/CoordinateConversion.js +1 -1
  308. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  309. package/widgets/Daylight.js +1 -1
  310. package/widgets/DirectLineMeasurement3D.js +1 -1
  311. package/widgets/Directions.js +1 -1
  312. package/widgets/DistanceMeasurement2D.js +1 -1
  313. package/widgets/Editor/EditorViewModel.d.ts +0 -1
  314. package/widgets/Editor.d.ts +0 -1
  315. package/widgets/Editor.js +1 -1
  316. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  317. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  318. package/widgets/ElevationProfile/support/chartUtils.js +1 -1
  319. package/widgets/ElevationProfile.js +1 -1
  320. package/widgets/Expand.js +1 -1
  321. package/widgets/Feature/FeatureAttachments.js +1 -1
  322. package/widgets/Feature/FeatureContent.js +1 -1
  323. package/widgets/Feature/FeatureExpression.js +1 -1
  324. package/widgets/Feature/FeatureFields.js +1 -1
  325. package/widgets/Feature/FeatureMedia.js +1 -1
  326. package/widgets/Feature/FeatureRelationship.js +1 -1
  327. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  328. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  329. package/widgets/Feature/support/FeatureElementInfo.js +1 -1
  330. package/widgets/Feature.js +1 -1
  331. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  332. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  333. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +1 -1
  334. package/widgets/FeatureForm.js +1 -1
  335. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  336. package/widgets/FeatureTable.js +1 -1
  337. package/widgets/FeatureTemplates.js +1 -1
  338. package/widgets/Features/FeaturesDrillIn.js +1 -1
  339. package/widgets/Features.js +1 -1
  340. package/widgets/FloorFilter.js +1 -1
  341. package/widgets/Fullscreen.js +1 -1
  342. package/widgets/Histogram.js +1 -1
  343. package/widgets/HistogramRangeSlider.js +1 -1
  344. package/widgets/Home.js +1 -1
  345. package/widgets/LayerList/ListItemPanel.js +1 -1
  346. package/widgets/LayerList.js +1 -1
  347. package/widgets/Legend/styles/card/CardView.js +1 -1
  348. package/widgets/Legend/styles/card/ColorRamp.js +1 -1
  349. package/widgets/Legend/styles/card/LegendElement.js +1 -1
  350. package/widgets/Legend/styles/card/SizeRamp.js +1 -1
  351. package/widgets/Legend/styles/card/UnivariateAboveAndBelowRamp.js +1 -1
  352. package/widgets/Legend/styles/card/UnivariateColorSizeRamp.js +1 -1
  353. package/widgets/Legend/styles/classic/ClassicView.js +1 -1
  354. package/widgets/Legend/styles/classic/ColorRamp.js +1 -1
  355. package/widgets/Legend/styles/classic/LegendElement.js +1 -1
  356. package/widgets/Legend/styles/classic/SizeRamp.js +1 -1
  357. package/widgets/Legend/styles/classic/UnivariateAboveAndBelowRamp.js +1 -1
  358. package/widgets/Legend/styles/classic/UnivariateColorSizeRamp.js +1 -1
  359. package/widgets/Legend.js +1 -1
  360. package/widgets/LineOfSight.js +1 -1
  361. package/widgets/Locate.js +1 -1
  362. package/widgets/Measurement.js +1 -1
  363. package/widgets/NavigationToggle.js +1 -1
  364. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  365. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  366. package/widgets/OrientedImageryViewer/support/geometryUtils.js +1 -1
  367. package/widgets/OrientedImageryViewer.js +1 -1
  368. package/widgets/Popup.js +1 -1
  369. package/widgets/Print.js +1 -1
  370. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  371. package/widgets/ScaleBar.js +1 -1
  372. package/widgets/ScaleRangeSlider.js +1 -1
  373. package/widgets/Search/SearchResultRenderer.js +1 -1
  374. package/widgets/Search.js +1 -1
  375. package/widgets/ShadowCast/components/ShadowTooltip.js +1 -1
  376. package/widgets/ShadowCast/components/ShadowTooltipContent.js +1 -1
  377. package/widgets/ShadowCast.js +1 -1
  378. package/widgets/Sketch/SketchViewModel.d.ts +0 -1
  379. package/widgets/Sketch.d.ts +0 -1
  380. package/widgets/Sketch.js +1 -1
  381. package/widgets/Slice.js +1 -1
  382. package/widgets/Slider.js +1 -1
  383. package/widgets/Spinner.js +1 -1
  384. package/widgets/Swipe.js +1 -1
  385. package/widgets/TableList/ListItemPanel.js +1 -1
  386. package/widgets/TableList.js +1 -1
  387. package/widgets/TimeSlider.js +1 -1
  388. package/widgets/TimeZoneLabel.js +1 -1
  389. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsLineSymbolPicker.js +1 -1
  390. package/widgets/UtilityNetworkAssociations.js +1 -1
  391. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  392. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  393. package/widgets/UtilityNetworkTrace.js +1 -1
  394. package/widgets/ValuePicker/ValuePickerBaseComponent.js +1 -1
  395. package/widgets/ValuePicker/ValuePickerCollection.js +1 -1
  396. package/widgets/ValuePicker/ValuePickerCombobox.js +1 -1
  397. package/widgets/ValuePicker/ValuePickerLabel.js +1 -1
  398. package/widgets/ValuePicker/ValuePickerSlider.js +1 -1
  399. package/widgets/ValuePicker.js +1 -1
  400. package/widgets/Widget.js +1 -1
  401. package/widgets/Zoom.js +1 -1
  402. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  403. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  404. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  405. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  406. package/widgets/smartMapping/ColorSlider.js +1 -1
  407. package/widgets/smartMapping/HeatmapSlider.js +1 -1
  408. package/widgets/smartMapping/OpacitySlider.js +1 -1
  409. package/widgets/smartMapping/SizeSlider.js +1 -1
  410. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  411. package/widgets/support/ColorPicker.js +1 -1
  412. package/widgets/support/FilterBuilder.js +1 -1
  413. package/widgets/support/FilterCondition.js +1 -1
  414. package/widgets/support/GridControls.js +1 -1
  415. package/widgets/support/MeasurementWidgetContent.js +1 -1
  416. package/widgets/support/PluginSettingsControls.js +1 -1
  417. package/widgets/support/SelectionList.js +1 -1
  418. package/widgets/support/SelectionToolbar.d.ts +1 -1
  419. package/widgets/support/SelectionToolbar.js +1 -1
  420. package/widgets/support/SketchTooltipControls.js +1 -1
  421. package/widgets/support/SnappingControls.js +1 -1
  422. package/widgets/support/TimezonePicker.js +1 -1
  423. package/widgets/support/UnitSelect.js +1 -1
  424. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  425. package/assets/esri/core/workers/chunks/01803f76bc0d9f2cd566.js +0 -1
  426. package/assets/esri/core/workers/chunks/02940f7ddaf98e69521e.js +0 -1
  427. package/assets/esri/core/workers/chunks/07e5482e1fc69be5de09.js +0 -1
  428. package/assets/esri/core/workers/chunks/0c893837f67829757df7.js +0 -1
  429. package/assets/esri/core/workers/chunks/15950c2fb173b62ee0ec.js +0 -1
  430. package/assets/esri/core/workers/chunks/1a91443970d64a59521d.js +0 -1
  431. package/assets/esri/core/workers/chunks/1deca3de77b1a9a07da4.js +0 -1
  432. package/assets/esri/core/workers/chunks/1fd82fcba2758741996a.js +0 -1
  433. package/assets/esri/core/workers/chunks/20a2124cbe43e5527c40.js +0 -1
  434. package/assets/esri/core/workers/chunks/26ea39dfdf887f357fce.js +0 -1
  435. package/assets/esri/core/workers/chunks/276a0b549acf048e8673.js +0 -1
  436. package/assets/esri/core/workers/chunks/2c3612379111457c3221.js +0 -1
  437. package/assets/esri/core/workers/chunks/34467f7d84baffd772a3.js +0 -1
  438. package/assets/esri/core/workers/chunks/398ec098fffe6abceedd.js +0 -1
  439. package/assets/esri/core/workers/chunks/3b32a24488b3068f0cb7.js +0 -1
  440. package/assets/esri/core/workers/chunks/427d929dc7f89b0a1ea9.js +0 -1
  441. package/assets/esri/core/workers/chunks/432728c557be5dfa26b5.js +0 -1
  442. package/assets/esri/core/workers/chunks/4c240ca50f70bf30813f.js +0 -1
  443. package/assets/esri/core/workers/chunks/4d8833f48348cbbcc947.js +0 -1
  444. package/assets/esri/core/workers/chunks/514cc15acb77dc85035c.js +0 -1
  445. package/assets/esri/core/workers/chunks/585ae43c7bcb86a26762.js +0 -1
  446. package/assets/esri/core/workers/chunks/5e48898cebb6dbaf09b5.js +0 -1
  447. package/assets/esri/core/workers/chunks/5ec5a6cef9ee9a8cc400.js +0 -1
  448. package/assets/esri/core/workers/chunks/601e1d020b8115497944.js +0 -1
  449. package/assets/esri/core/workers/chunks/687deb918eb48a963c8f.js +0 -1
  450. package/assets/esri/core/workers/chunks/6a21dc13a465757ba007.js +0 -1
  451. package/assets/esri/core/workers/chunks/6e910342ada398c98e30.js +0 -1
  452. package/assets/esri/core/workers/chunks/78818c2a898444f7e890.js +0 -1
  453. package/assets/esri/core/workers/chunks/7d2cbc767c336d15e4d5.js +0 -1
  454. package/assets/esri/core/workers/chunks/7d497df6e13162156342.js +0 -1
  455. package/assets/esri/core/workers/chunks/7dbf4c7480bf9c72820d.js +0 -1
  456. package/assets/esri/core/workers/chunks/80c234ee5276ea1645db.js +0 -1
  457. package/assets/esri/core/workers/chunks/8c3779de09291170497f.js +0 -1
  458. package/assets/esri/core/workers/chunks/966204d6dedc8149c3e9.js +0 -1
  459. package/assets/esri/core/workers/chunks/9ab0735e86cf8932bf9d.js +0 -1
  460. package/assets/esri/core/workers/chunks/a0356702f2d3f787aeac.js +0 -1
  461. package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +0 -1
  462. package/assets/esri/core/workers/chunks/ab0ea4042f4e13874aed.js +0 -1
  463. package/assets/esri/core/workers/chunks/ab98ade3257360015d6c.js +0 -1
  464. package/assets/esri/core/workers/chunks/b13d8f4e4e80ef00b1bd.js +0 -1
  465. package/assets/esri/core/workers/chunks/b15a8d4322f3b7819d2f.js +0 -1
  466. package/assets/esri/core/workers/chunks/b3aa29589dcfb5b93106.js +0 -1
  467. package/assets/esri/core/workers/chunks/b472c0a21ae29e653f7d.js +0 -1
  468. package/assets/esri/core/workers/chunks/b90271ce38522bcf813b.js +0 -1
  469. package/assets/esri/core/workers/chunks/ba91df9835cdea7698a9.js +0 -1
  470. package/assets/esri/core/workers/chunks/bd812dd75d2a3d7d0441.js +0 -1
  471. package/assets/esri/core/workers/chunks/bfe13ac9fa1aafb190a1.js +0 -1
  472. package/assets/esri/core/workers/chunks/c1cf3edce15f09648eb4.js +0 -1
  473. package/assets/esri/core/workers/chunks/c31830ee897d5a7f2582.js +0 -1
  474. package/assets/esri/core/workers/chunks/c48d97c38e821be17dc5.js +0 -1
  475. package/assets/esri/core/workers/chunks/c7ad62f54d2abe1d17a0.js +0 -1
  476. package/assets/esri/core/workers/chunks/cf21b217b13770757cb8.js +0 -1
  477. package/assets/esri/core/workers/chunks/d42a4f47843e075c56a8.js +0 -1
  478. package/assets/esri/core/workers/chunks/deb408bee61ca192b2ce.js +0 -1
  479. package/assets/esri/core/workers/chunks/e121d15b883184ee83e7.js +0 -1
  480. package/assets/esri/core/workers/chunks/e4042e43f0081fe49f7b.js +0 -1
  481. package/assets/esri/core/workers/chunks/e932951598499befabf5.js +0 -1
  482. package/assets/esri/core/workers/chunks/eaab787a5f2445be5e5a.js +0 -1
  483. package/assets/esri/core/workers/chunks/f06ef153e106b26a6748.js +0 -1
  484. package/assets/esri/core/workers/chunks/faae3c43048b42341536.js +0 -1
  485. package/assets/esri/themes/base/widgets/_UtilityNetworkValidateTopology.scss +0 -46
  486. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ar.json +0 -1
  487. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bg.json +0 -1
  488. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.bs.json +0 -1
  489. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ca.json +0 -1
  490. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.cs.json +0 -1
  491. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.da.json +0 -1
  492. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.de.json +0 -1
  493. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.el.json +0 -1
  494. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.en.json +0 -1
  495. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.es.json +0 -1
  496. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.et.json +0 -1
  497. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fi.json +0 -1
  498. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.fr.json +0 -1
  499. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.he.json +0 -1
  500. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hr.json +0 -1
  501. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.hu.json +0 -1
  502. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.id.json +0 -1
  503. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.it.json +0 -1
  504. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ja.json +0 -1
  505. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ko.json +0 -1
  506. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lt.json +0 -1
  507. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.lv.json +0 -1
  508. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.nl.json +0 -1
  509. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.no.json +0 -1
  510. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pl.json +0 -1
  511. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-BR.json +0 -1
  512. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.pt-PT.json +0 -1
  513. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ro.json +0 -1
  514. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.ru.json +0 -1
  515. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sk.json +0 -1
  516. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sl.json +0 -1
  517. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sr.json +0 -1
  518. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.sv.json +0 -1
  519. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.th.json +0 -1
  520. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.tr.json +0 -1
  521. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.uk.json +0 -1
  522. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.vi.json +0 -1
  523. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-CN.json +0 -1
  524. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-HK.json +0 -1
  525. package/assets/esri/widgets/UtilityNetworkValidateTopology/t9n/messages.zh-TW.json +0 -1
  526. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.d.ts +0 -72
  527. package/widgets/UtilityNetworkValidateTopology/UtilityNetworkValidateTopologyViewModel.js +0 -2
  528. package/widgets/UtilityNetworkValidateTopology.d.ts +0 -130
  529. package/widgets/UtilityNetworkValidateTopology.js +0 -2
@@ -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"../request.js";import{createTask as n}from"../core/asyncUtils.js";import{clone as r}from"../core/lang.js";import{MultiOriginJSONSupportMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{urlToObject as o,addQueryParameters as s,isProtocolRelative as c,normalize as l}from"../core/urlUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import f from"../geometry/Extent.js";import p from"../geometry/SpatialReference.js";import m from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as g}from"./mixins/ArcGISCachedService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as v}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as S}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{url as w}from"./support/commonProperties.js";import{checkWebPSupport as T}from"./support/imageUtils.js";import E from"./support/SpriteSource.js";import D from"./support/TileInfo.js";import{TilemapCache as O}from"./support/TilemapCache.js";import{loadMetadata as k}from"./support/vectorTileLayerLoader.js";import{createForItemRead as A}from"../portal/support/jsonContext.js";import{parseKnownArcGISOnlineDomain as j}from"../portal/support/urlUtils.js";import{e as M}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as N,unionTileInfos as P}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import F from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as I}from"../views/webgl/capabilities.js";import{addLayerUnsupportedError as L}from"../webdoc/support/unsupportedErrors.js";import{writer as R}from"../core/accessorSupport/decorators/writer.js";import{reader as z}from"../core/accessorSupport/decorators/reader.js";let B=class extends v(C(S(g(_(b(x(y(h(i(m)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType=`VectorTileLayer`,this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type=`vector-tile`,this.graphicOrigin=null}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(let e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){let n=this.loadFromPortal({supportedTypes:[`Vector Tile Service`],supportsData:!1},e).catch(a).then(async()=>{if(!this.portalItem?.id)return;let n=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(n,{...e,query:{f:`json`,...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:n},A(this.portalItem,`portal-item`))}).catch(a).then(()=>this._loadStyle(e));return this.addResolvingPromise(n),Promise.resolve(this)}get apiKey(){return super.apiKey}set apiKey(e){super.apiKey=e}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}get attributionDataUrl(){let e=this.currentStyleInfo,t=e?.serviceUrl&&o(e.serviceUrl);if(!t)return null;let n=this._getDefaultAttribution(t.path);return n?s(n,{...this.customParameters,token:this.apiKey}):null}get capabilities(){let e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?o(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&c(e)&&(e=`https:${e}`);let n=j(e);t.styleUrl=M(e,n)}get tileInfo(){let e=[];for(let t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new D;if(e.length>1)for(let n=0;n<e.length;n++)N(t,e[n].tileInfo)&&(t=P(t,e[n].tileInfo));return t}readTilemapCache(e,t){return t.capabilities?.includes(`Tilemap`)?new O({layer:this}):null}set url(e){if(!e){this._set(`url`,e);return}let t=o(e);this._set(`url`,t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){let n=I().maxTextureSize,r=this.currentStyleInfo?.spriteUrl?s(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,i=new E({type:`url`,spriteUrl:r,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},n);await i.load(t),this._spriteSourceMap.set(e,i)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;let n=I().maxTextureSize,r=e.spriteUrl,i=r?s(r,{...this.customParameters,token:this.apiKey}):null;if(!i&&e.type===`url`)return null;let o=new E(e,n);try{await o.load(t);let n=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(n,o),i&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=i),this.emit(`spriteSource-change`,{spriteSource:o}),o}catch(e){a(e)}return null}async loadStyle(e,t){let r=e||this.style||this.url;return this._loadingTask&&typeof r==`string`&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=n(e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return r(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){let n=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);let r=this.styleRepository.isPainterDataDriven(e);this.emit(`paint-change`,{layer:e,paint:t,isDataDriven:n||r})}getStyleLayer(e){return r(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit(`style-layer-change`,{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit(`delete-style-layer`,{layer:e})}getLayoutProperties(e){return r(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit(`layout-change`,{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit(`style-layer-visibility-change`,{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)?`visible`:`none`}write(e,t){return t?.origin&&!this.styleUrl?(L(t,this,`style defined by JSON only are not supported`),null):super.write(e,t)}getTileUrl(e,t,n){return null}async _getSourceAndStyle(e,t){if(!e)throw Error(`invalid style!`);let n=await k(e,{...t,query:{...this.customParameters,token:this.apiKey}});n.spriteFormat===`webp`&&(await T(`lossy`)||(n.spriteFormat=`png`)),this._set(`currentStyleInfo`,{...n}),typeof e==`string`?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set(`sourceNameToSource`,n.sourceNameToSource),this._set(`primarySource`,n.sourceNameToSource[n.primarySourceName]),this._set(`styleRepository`,new F(n.style,!1)),this.read(n.layerDefinition,{origin:`service`}),this.emit(`load-style`)}_getDefaultAttribution(e){let t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),n=[`OpenBasemap_v2`,`OpenBasemap_GCS_v2`,`OpenStreetMap_v2`,`OpenStreetMap_Daylight_v2`,`OpenStreetMap_Export_v2`,`OpenStreetMap_FTS_v2`,`OpenStreetMap_GCS_v2`,`World_Basemap`,`World_Basemap_v2`,`World_Basemap_Export_v2`,`World_Basemap_GCS_v2`,`World_Basemap_WGS84`,`World_Contours_v2`,`World_Hillshade_v2`];if(!t)return;let r=t[2]&&t[2].toLowerCase();if(!r)return;let i=t[1]||``;for(let e of n)if(e.toLowerCase().includes(r))return l(`//static.arcgis.com/attribution/Vector${i}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],B.prototype,`attributionDataUrl`,null),e([u({type:[`show`,`hide`]})],B.prototype,`listMode`,void 0),e([u({json:{read:!0,write:!0}})],B.prototype,`blendMode`,void 0),e([u({readOnly:!0,json:{read:!1}})],B.prototype,`capabilities`,null),e([u({readOnly:!0})],B.prototype,`currentStyleInfo`,void 0),e([u({json:{read:!1},readOnly:!0,type:f})],B.prototype,`fullExtent`,null),e([u({json:{read:!1},readOnly:!0,type:f})],B.prototype,`initialExtent`,null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,`isReference`,void 0),e([u({type:[`VectorTileLayer`]})],B.prototype,`operationalLayerType`,void 0),e([u({readOnly:!0})],B.prototype,`parsedUrl`,null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,`path`,void 0),e([u({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],B.prototype,`refreshInterval`,void 0),e([u()],B.prototype,`style`,void 0),e([u({readOnly:!0})],B.prototype,`serviceUrl`,null),e([u({type:p,readOnly:!0})],B.prototype,`spatialReference`,null),e([u({readOnly:!0})],B.prototype,`styleRepository`,void 0),e([u({readOnly:!0})],B.prototype,`sourceNameToSource`,void 0),e([u({readOnly:!0})],B.prototype,`primarySource`,void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],B.prototype,`styleUrl`,null),e([R([`portal-item`,`web-document`],`styleUrl`)],B.prototype,`writeStyleUrl`,null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:D})],B.prototype,`tileInfo`,null),e([u()],B.prototype,`tilemapCache`,void 0),e([z(`service`,`tilemapCache`,[`capabilities`,`tileInfo`])],B.prototype,`readTilemapCache`,null),e([u({json:{read:!1},readOnly:!0,value:`vector-tile`})],B.prototype,`type`,void 0),e([u({readOnly:!0,clonable:!1})],B.prototype,`graphicOrigin`,void 0),e([u({json:{origins:{"web-document":{read:{source:`styleUrl`}},"portal-item":{read:{source:`url`}}},write:!1,read:!1}}),u(w)],B.prototype,`url`,null),e([u({readOnly:!0})],B.prototype,`version`,void 0),e([z(`version`,[`version`,`currentVersion`])],B.prototype,`readVersion`,null),B=e([d(`esri.layers.VectorTileLayer`)],B);const V=B;export{V as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import{createTask as n}from"../core/asyncUtils.js";import{clone as r}from"../core/lang.js";import{MultiOriginJSONSupportMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{urlToObject as o,addQueryParameters as s,isProtocolRelative as c,normalize as l}from"../core/urlUtils.js";import{property as u,subclass as d}from"../core/accessorSupport/decorators.js";import f from"../geometry/Extent.js";import p from"../geometry/SpatialReference.js";import m from"./Layer.js";import{APIKeyMixin as h}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as g}from"./mixins/ArcGISCachedService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as v}from"./mixins/BlendLayer.js";import{CustomParametersMixin as y}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as b}from"./mixins/OperationalLayer.js";import{PortalLayer as x}from"./mixins/PortalLayer.js";import{RefreshableLayer as S}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as C}from"./mixins/ScaleRangeLayer.js";import{url as w}from"./support/commonProperties.js";import{checkWebPSupport as T}from"./support/imageUtils.js";import E from"./support/SpriteSource.js";import D from"./support/TileInfo.js";import{TilemapCache as O}from"./support/TilemapCache.js";import{loadMetadata as k}from"./support/vectorTileLayerLoader.js";import{createForItemRead as A}from"../portal/support/jsonContext.js";import{parseKnownArcGISOnlineDomain as j}from"../portal/support/urlUtils.js";import{e as M}from"../chunks/persistableUrlUtils.js";import{areSchemasOverlapping as N,unionTileInfos as P}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import F from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as I}from"../views/webgl/capabilities.js";import{addLayerUnsupportedError as L}from"../webdoc/support/unsupportedErrors.js";import{writer as R}from"../core/accessorSupport/decorators/writer.js";import{reader as z}from"../core/accessorSupport/decorators/reader.js";let B=class extends v(C(S(g(_(b(x(y(h(i(m)))))))))){constructor(e){super(e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.isReference=null,this.operationalLayerType=`VectorTileLayer`,this.path=null,this.refreshInterval=0,this.style=null,this.tilemapCache=null,this.type=`vector-tile`,this.graphicOrigin=null}destroy(){if(this.sourceNameToSource)for(let e of Object.values(this.sourceNameToSource))e?.destroy();this.primarySource?.destroy(),this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){let n=this.loadFromPortal({supportedTypes:[`Vector Tile Service`],supportsData:!1},e).catch(a).then(async()=>{if(!this.portalItem?.id)return;let n=`${this.portalItem.itemCdnUrl}/resources/styles/root.json`;(await t(n,{...e,query:{f:`json`,...this.customParameters,token:this.apiKey},authMode:this.portalItem.portal.authMode})).data&&this.read({url:n},A(this.portalItem,`portal-item`))}).catch(a).then(()=>this._loadStyle(e));return this.addResolvingPromise(n),Promise.resolve(this)}get apiKey(){return super.apiKey}set apiKey(e){super.apiKey=e}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}get attributionDataUrl(){let e=this.currentStyleInfo,t=e?.serviceUrl&&o(e.serviceUrl);if(!t)return null;let n=this._getDefaultAttribution(t.path);return n?s(n,{...this.customParameters,token:this.apiKey}):null}get capabilities(){let e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){return this.primarySource?.fullExtent||null}get initialExtent(){return this.primarySource?.initialExtent||null}get parsedUrl(){return this.serviceUrl?o(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo?.serviceUrl||null}get spatialReference(){return this.tileInfo?.spatialReference??null}get styleUrl(){return this.currentStyleInfo?.styleUrl||null}writeStyleUrl(e,t){e&&c(e)&&(e=`https:${e}`);let n=j(e);t.styleUrl=M(e,n)}get tileInfo(){let e=[];for(let t in this.sourceNameToSource)e.push(this.sourceNameToSource[t]);let t=this.primarySource?.tileInfo||new D;if(e.length>1)for(let n=0;n<e.length;n++)N(t,e[n].tileInfo)&&(t=P(t,e[n].tileInfo));return t}readTilemapCache(e,t){return t.capabilities?.includes(`Tilemap`)?new O({layer:this}):null}set url(e){if(!e){this._set(`url`,e);return}let t=o(e);this._set(`url`,t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){let n=I().maxTextureSize,r=this.currentStyleInfo?.spriteUrl?s(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,i=new E({type:`url`,spriteUrl:r,pixelRatio:e,spriteFormat:this.currentStyleInfo?.spriteFormat},n);await i.load(t),this._spriteSourceMap.set(e,i)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t){if(!e)return null;let n=I().maxTextureSize,r=e.spriteUrl,i=r?s(r,{...this.customParameters,token:this.apiKey}):null;if(!i&&e.type===`url`)return null;let o=new E(e,n);try{await o.load(t);let n=e.pixelRatio||1;return this._spriteSourceMap.clear(),this._spriteSourceMap.set(n,o),i&&this.currentStyleInfo&&(this.currentStyleInfo.spriteUrl=i),this.emit(`spriteSource-change`,{spriteSource:o}),o}catch(e){a(e)}return null}async loadStyle(e,t){let r=e||this.style||this.url;return this._loadingTask&&typeof r==`string`&&this.url===r||(this._loadingTask?.abort(),this._loadingTask=n(e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:e})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return r(this.styleRepository?.getPaintProperties(e))}setPaintProperties(e,t){let n=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);let r=this.styleRepository.isPainterDataDriven(e);this.emit(`paint-change`,{layer:e,paint:t,isDataDriven:n||r})}getStyleLayer(e){return r(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit(`style-layer-change`,{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit(`delete-style-layer`,{layer:e})}getLayoutProperties(e){return r(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit(`layout-change`,{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit(`style-layer-visibility-change`,{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)?`visible`:`none`}write(e,t){return t?.origin&&!this.styleUrl?(L(t,this,`style defined by JSON only are not supported`),null):super.write(e,t)}getTileUrl(e,t,n){return null}async _getSourceAndStyle(e,t){if(!e)throw Error(`invalid style!`);let n=await k(e,{...t,query:{...this.customParameters,token:this.apiKey}});n.spriteFormat===`webp`&&(await T(`lossy`)||(n.spriteFormat=`png`)),this._set(`currentStyleInfo`,{...n}),typeof e==`string`?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set(`sourceNameToSource`,n.sourceNameToSource),this._set(`primarySource`,n.sourceNameToSource[n.primarySourceName]),this._set(`styleRepository`,new F(n.style,!1)),this.read(n.layerDefinition,{origin:`service`}),this.emit(`load-style`)}_getDefaultAttribution(e){let t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^/]+)?\/arcgis\/rest\/services\/([^/]+(\/[^/]+)*)\/vectortileserver/i),n=[`OpenBasemap_v2`,`OpenBasemap_GCS_v2`,`OpenStreetMap_v2`,`OpenStreetMap_Daylight_v2`,`OpenStreetMap_Export_v2`,`OpenStreetMap_FTS_v2`,`OpenStreetMap_GCS_v2`,`World_Basemap`,`World_Basemap_v2`,`World_Basemap_Export_v2`,`World_Basemap_GCS_v2`,`World_Basemap_WGS84`,`World_Contours_v2`,`World_Hillshade_v2`];if(!t)return;let r=t[2]&&t[2].toLowerCase();if(!r)return;let i=t[1]||``;for(let e of n)if(e.toLowerCase().includes(r))return l(`//static.arcgis.com/attribution/Vector${i}/${e}`)}async _loadStyle(e){return this._loadingTask?.promise??this.loadStyle(null,e)}};e([u({readOnly:!0})],B.prototype,`attributionDataUrl`,null),e([u({type:[`show`,`hide`]})],B.prototype,`listMode`,void 0),e([u({json:{read:!0,write:!0}})],B.prototype,`blendMode`,void 0),e([u({readOnly:!0,json:{read:!1}})],B.prototype,`capabilities`,null),e([u({readOnly:!0})],B.prototype,`currentStyleInfo`,void 0),e([u({json:{read:!1},readOnly:!0,type:f})],B.prototype,`fullExtent`,null),e([u({json:{read:!1},readOnly:!0,type:f})],B.prototype,`initialExtent`,null),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,`isReference`,void 0),e([u({type:[`VectorTileLayer`]})],B.prototype,`operationalLayerType`,void 0),e([u({readOnly:!0})],B.prototype,`parsedUrl`,null),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],B.prototype,`path`,void 0),e([u({type:Number,json:{write:!1,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],B.prototype,`refreshInterval`,void 0),e([u()],B.prototype,`style`,void 0),e([u({readOnly:!0})],B.prototype,`serviceUrl`,null),e([u({type:p,readOnly:!0})],B.prototype,`spatialReference`,null),e([u({readOnly:!0})],B.prototype,`styleRepository`,void 0),e([u({readOnly:!0})],B.prototype,`sourceNameToSource`,void 0),e([u({readOnly:!0})],B.prototype,`primarySource`,void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],B.prototype,`styleUrl`,null),e([R([`portal-item`,`web-document`],`styleUrl`)],B.prototype,`writeStyleUrl`,null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:D})],B.prototype,`tileInfo`,null),e([u()],B.prototype,`tilemapCache`,void 0),e([z(`service`,`tilemapCache`,[`capabilities`,`tileInfo`])],B.prototype,`readTilemapCache`,null),e([u({json:{read:!1},readOnly:!0,value:`vector-tile`})],B.prototype,`type`,void 0),e([u({readOnly:!0,clonable:!1})],B.prototype,`graphicOrigin`,void 0),e([u({json:{origins:{"web-document":{read:{source:`styleUrl`}},"portal-item":{read:{source:`url`}}},write:!1,read:!1}}),u(w)],B.prototype,`url`,null),e([u({readOnly:!0})],B.prototype,`version`,void 0),e([z(`version`,[`version`,`currentVersion`])],B.prototype,`readVersion`,null),B=e([d(`esri.layers.VectorTileLayer`)],B);const V=B;export{V 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"../PopupTemplate.js";import{ClonableMixin as n}from"../core/Clonable.js";import r from"../core/Error.js";import{MultiOriginJSONSupportMixin as i}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as o}from"../core/promiseUtils.js";import{watch as s}from"../core/reactiveUtils.js";import{property as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"../graphic/WCSGraphicOrigin.js";import d from"./Layer.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as p}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as g}from"./mixins/RasterJobHandlerMixin.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as y}from"./mixins/TemporalLayer.js";import{TiledImagery as b}from"./mixins/TiledImagery.js";import x from"./raster/datasets/WCSRaster.js";import{legendEnabled as S,popupEnabled as C}from"./support/commonProperties.js";import w from"./support/Field.js";import{getServicePixelValueField as T,getMultidimensionalFields as E}from"./support/rasterFieldUtils.js";import{createPopupTemplate as D}from"../support/popupUtils.js";const O=new Set([`milliseconds`,`seconds`,`minutes`,`hours`,`days`,`weeks`,`months`,`years`,`decades`,`centuries`]);let k=class extends f(v(m(h(p(b(g(y(_(i(n(d))))))))))){constructor(...e){super(...e),this.charts=null,this.coverageId=null,this.version=null,this.isReference=null,this.graphicOrigin=new u(this),this.legendEnabled=!0,this.noData=0,this.operationalLayerType=`WCS`,this.type=`wcs`,this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=a(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:[`WCS`]},e).catch(o).then(()=>this._openRaster(t))),Promise.resolve(this)}get renderer(){return super.renderer}set renderer(e){super.renderer=e}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[T(`Pixel Value`)],t=(this.raster?.rasterInfo??this.serviceRasterInfo)?.multidimensionalInfo;if(t){let n=E(t);e.push(...n)}return e}createPopupTemplate(e){return D({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _openRaster(e){let t=new x({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new r(`wcs-layer:load`,`cannot load resources on `+this.url);let{rasterInfo:n}=t;n.noDataValue??=this.noData,this._set(`serviceRasterInfo`,n),this._set(`spatialReference`,n.spatialReference),this.title??this.setAtOrigin(`title`,t.datasetName,`service`),this.coverageId??this.setAtOrigin(`coverageId`,t.coverageInfo.id,`service`),this.version==null&&t.version&&this.setAtOrigin(`version`,t.version,`service`),this.setAtOrigin(`tileInfo`,t.rasterInfo.storageInfo.tileInfo,`service`);let{multidimensionalInfo:i}=n;if(i!=null){let e=i.variables[0].dimensions.find(({name:e})=>e===`StdTime`);if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);let r=O.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set(`timeInfo`,{startField:`StdTime`,fullTimeExtent:{start:t,end:n},timeZone:null,interval:r?{value:e.interval,unit:r}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles(s(()=>this.customParameters,e=>this.raster.ioConfig.customFetchParameters=e))}};e([c({json:{origins:{"web-scene":{write:!1}},write:!0}})],k.prototype,`charts`,void 0),e([c({type:String,nonNullable:!0,json:{name:`wcsInfo.coverageId`,write:{isRequired:!0,ignoreOrigin:!0}}})],k.prototype,`coverageId`,void 0),e([c()],k.prototype,`coverageInfo`,null),e([c({type:[`1.0.0`,`1.1.0`,`1.1.1`,`1.1.2`,`2.0.1`],nonNullable:!0,json:{name:`wcsInfo.version`,write:{isRequired:!0,ignoreOrigin:!0}}})],k.prototype,`version`,void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],k.prototype,`isReference`,void 0),e([c({json:{read:!0,write:!0}})],k.prototype,`blendMode`,void 0),e([c({readOnly:!0,clonable:!1})],k.prototype,`graphicOrigin`,void 0),e([c(S)],k.prototype,`legendEnabled`,void 0),e([c({type:[`show`,`hide`]})],k.prototype,`listMode`,void 0),e([c()],k.prototype,`noData`,void 0),e([c({type:[`WCS`]})],k.prototype,`operationalLayerType`,void 0),e([c()],k.prototype,`raster`,void 0),e([c({readOnly:!0})],k.prototype,`type`,void 0),e([c(C)],k.prototype,`popupEnabled`,void 0),e([c({type:t,json:{name:`popupInfo`,write:!0}})],k.prototype,`popupTemplate`,void 0),e([c({readOnly:!0})],k.prototype,`defaultPopupTemplate`,null),e([c({readOnly:!0,type:[w]})],k.prototype,`fields`,void 0),e([c({readOnly:!0,type:[w]})],k.prototype,`rasterFields`,null),k=e([l(`esri.layers.WCSLayer`)],k);const A=k;export{A 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{MultiOriginJSONSupportMixin as i}from"../core/MultiOriginJSONSupport.js";import{debounce as a,throwIfAbortError as o}from"../core/promiseUtils.js";import{watch as s}from"../core/reactiveUtils.js";import{property as c,subclass as l}from"../core/accessorSupport/decorators.js";import u from"../graphic/WCSGraphicOrigin.js";import d from"./Layer.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{CustomParametersMixin as p}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as m}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RasterJobHandlerMixin as g}from"./mixins/RasterJobHandlerMixin.js";import{RefreshableLayer as _}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as y}from"./mixins/TemporalLayer.js";import{TiledImagery as b}from"./mixins/TiledImagery.js";import x from"./raster/datasets/WCSRaster.js";import{legendEnabled as S,popupEnabled as C}from"./support/commonProperties.js";import w from"./support/Field.js";import{getServicePixelValueField as T,getMultidimensionalFields as E}from"./support/rasterFieldUtils.js";import{createPopupTemplate as D}from"../support/popupUtils.js";const O=new Set([`milliseconds`,`seconds`,`minutes`,`hours`,`days`,`weeks`,`months`,`years`,`decades`,`centuries`]);let k=class extends f(v(m(h(p(b(g(y(_(i(n(d))))))))))){constructor(e){super(e),this.charts=null,this.coverageId=null,this.version=null,this.isReference=null,this.graphicOrigin=new u(this),this.legendEnabled=!0,this.noData=0,this.operationalLayerType=`WCS`,this.type=`wcs`,this.popupEnabled=!0,this.popupTemplate=null,this.fields=null,this._debouncedSaveOperations=a(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)}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`WCS`]},e).catch(o).then(()=>this._openRaster(t))),Promise.resolve(this)}get renderer(){return super.renderer}set renderer(e){super.renderer=e}get coverageInfo(){return this.raster.coverageInfo}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){let e=[T(`Pixel Value`)],t=(this.raster?.rasterInfo??this.serviceRasterInfo)?.multidimensionalInfo;if(t){let n=E(t);e.push(...n)}return e}createPopupTemplate(e){return D({fields:this.rasterFields,title:this.title},e)}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}async _openRaster(e){let t=new x({url:this.url,version:this.version,coverageId:this.coverageId,ioConfig:{sampling:`closest`,...this.ioConfig,customFetchParameters:this.customParameters}});if(await t.open({signal:e}),!t.rasterInfo)throw t.destroy(),new r(`wcs-layer:load`,`cannot load resources on `+this.url);let{rasterInfo:n}=t;n.noDataValue??=this.noData,this._set(`serviceRasterInfo`,n),this._set(`spatialReference`,n.spatialReference),this.title??this.setAtOrigin(`title`,t.datasetName,`service`),this.coverageId??this.setAtOrigin(`coverageId`,t.coverageInfo.id,`service`),this.version==null&&t.version&&this.setAtOrigin(`version`,t.version,`service`),this.setAtOrigin(`tileInfo`,t.rasterInfo.storageInfo.tileInfo,`service`);let{multidimensionalInfo:i}=n;if(i!=null){let e=i.variables[0].dimensions.find(({name:e})=>e===`StdTime`);if(e){let t=e.extent?.[0]??e.values[0];Array.isArray(t)&&(t=t[0]);let n=e.extent?.[1]??e.values[e.values.length-1];Array.isArray(n)&&(n=n[1]);let r=O.has(e.intervalUnit?.toLowerCase())?e.intervalUnit?.toLowerCase():null;this.set(`timeInfo`,{startField:`StdTime`,fullTimeExtent:{start:t,end:n},timeZone:null,interval:r?{value:e.interval,unit:r}:null})}}this.raster=t,this._configDefaultSettings(),this.addHandles(s(()=>this.customParameters,e=>this.raster.ioConfig.customFetchParameters=e))}};e([c({json:{origins:{"web-scene":{write:!1}},write:!0}})],k.prototype,`charts`,void 0),e([c({type:String,nonNullable:!0,json:{name:`wcsInfo.coverageId`,write:{isRequired:!0,ignoreOrigin:!0}}})],k.prototype,`coverageId`,void 0),e([c()],k.prototype,`coverageInfo`,null),e([c({type:[`1.0.0`,`1.1.0`,`1.1.1`,`1.1.2`,`2.0.1`],nonNullable:!0,json:{name:`wcsInfo.version`,write:{isRequired:!0,ignoreOrigin:!0}}})],k.prototype,`version`,void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],k.prototype,`isReference`,void 0),e([c({json:{read:!0,write:!0}})],k.prototype,`blendMode`,void 0),e([c({readOnly:!0,clonable:!1})],k.prototype,`graphicOrigin`,void 0),e([c(S)],k.prototype,`legendEnabled`,void 0),e([c({type:[`show`,`hide`]})],k.prototype,`listMode`,void 0),e([c()],k.prototype,`noData`,void 0),e([c({type:[`WCS`]})],k.prototype,`operationalLayerType`,void 0),e([c()],k.prototype,`raster`,void 0),e([c({readOnly:!0})],k.prototype,`type`,void 0),e([c(C)],k.prototype,`popupEnabled`,void 0),e([c({type:t,json:{name:`popupInfo`,write:!0}})],k.prototype,`popupTemplate`,void 0),e([c({readOnly:!0})],k.prototype,`defaultPopupTemplate`,null),e([c({readOnly:!0,type:[w]})],k.prototype,`fields`,void 0),e([c({readOnly:!0,type:[w]})],k.prototype,`rasterFields`,null),k=e([l(`esri.layers.WCSLayer`)],k);const A=k;export{A 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)])}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{__decorate as e}from"tslib";import t from"../request.js";import{isSome as n}from"../core/arrayUtils.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{clone as a}from"../core/lang.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{watch as c,sync as l,on as u}from"../core/reactiveUtils.js";import{urlToObject as d,objectToQuery as f}from"../core/urlUtils.js";import{property as p,subclass as m}from"../core/accessorSupport/decorators.js";import h from"../geometry/Extent.js";import g from"./Layer.js";import _ from"./WebTileLayer.js";import{BlendLayer as v}from"./mixins/BlendLayer.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{createTileBitmap as C}from"./support/imageBitmapUtils.js";import w from"./support/TileInfo.js";import T from"./support/TileInfoTilemapCache.js";import{WMTSLayerInfo as E}from"./support/WMTSLayerInfo.js";import D from"./support/WMTSSublayer.js";import{getTileUrlFromResourceUrls as O,getTileUrlTemplateFromResourceUrls as k,parseResourceInfo as A,parseText as j,validateCapabilities as M,parseCapabilities as N}from"./support/wmtsUtils.js";import{reader as P}from"../core/accessorSupport/decorators/reader.js";import{writer as F}from"../core/accessorSupport/decorators/writer.js";var I;const L={"image/png":`.png`,"image/png8":`.png`,"image/png24":`.png`,"image/png32":`.png`,"image/jpg":`.jpg`,"image/jpeg":`.jpeg`,"image/gif":`.gif`,"image/bmp":`.bmp`,"image/tiff":`.tif`,"image/jpgpng":``,"image/jpegpng":``,"image/unknown":``},R=new Set([`version`,`service`,`request`,`layer`,`style`,`format`,`tilematrixset`,`tilematrix`,`tilerow`,`tilecol`]);let z=I=class extends v(x(S(y(b(o(g)))))){constructor(...e){super(...e),this.activeLayer=null,this.copyright=``,this.customParameters=null,this.customLayerParameters=null,this.operationalLayerType=`WebTiledLayer`,this.resourceInfo=null,this.serviceMode=`RESTful`,this.sublayers=null,this.type=`wmts`,this.version=`1.0.0`,this.addHandles([c(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},l),u(()=>this.sublayers,`after-add`,({item:e})=>{e.layer=this,e.parent=this},l),u(()=>this.sublayers,`after-remove`,({item:e})=>{e.layer=null,e.parent=null},l),c(()=>this.sublayers,(e,t)=>{if(t)for(let e of t)e.layer=null,e.parent=null;if(e)for(let t of e)t.layer=this,t.parent=this},l)])}normalizeCtorArgs(e,t){return typeof e==`string`?{url:e,...t}:e}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`WMTS`]},e).catch(s).then(()=>this._fetchService(e)).catch(e=>{throw s(e),new i(`wmtslayer:unsupported-service-data`,`Invalid response from the WMTS service.`,{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,n){this.activeLayer||=new D;let r=t.layers.find(e=>e.id===this.activeLayer.id);return r||=t.layers[0],this.activeLayer.read(r,n),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){let{templateUrl:n,wmtsInfo:r}=t,i=n?this._getLowerCasedUrlParams(n):null,a=r?.layerIdentifier,o=null,s=r?.tileMatrixSet;s&&(Array.isArray(s)?s.length&&(o=s[0]):o=s);let c=i?.format,l=i?.style;return new D({id:a,imageFormat:c,styleId:l,tileMatrixSetId:o})}writeActiveLayer(e,t,n,r){let{activeLayer:i,loaded:a}=this,{id:o,tileMatrixSet:s,tileMatrixSetId:c,imageFormat:l,styleId:u}=i;t.templateUrl=a?this.getUrlTemplate(o,c,l,u):void 0,t.tileInfo=a?s?.tileInfo?.toJSON(r)??null:void 0,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:o,tileMatrixSet:c}}readCustomParameters(e,t){let n=t.wmtsInfo;return n?this._mergeParams(n.customParameters,n.url):null}get fullExtent(){return this.fullExtents?.[0]}set fullExtent(e){this._override(`fullExtent`,e)}get fullExtents(){return this.activeLayer?.fullExtents}readServiceMode(e,t){return t.templateUrl.includes(`?`)?`KVP`:`RESTful`}readSublayersFromService(e,t,n){return B(t.layers,n)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(n)??[]}get tilemapCache(){let e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T(e):void 0}get title(){return this.activeLayer?.title??`Layer`}set title(e){this._overrideIfSome(`title`,e)}get url(){return this._get(`url`)}set url(e){e&&e.endsWith(`/`)?this._set(`url`,e.slice(0,-1)):this._set(`url`,e)}createWebTileLayer(e){let t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),n=this._getTileMatrixSetById(e.tileMatrixSetId)?.tileInfo,r=e.fullExtent,i=new E({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(i.customLayerParameters=this.customLayerParameters),this.customParameters&&(i.customParameters=this.customParameters),new _({fullExtent:r,urlTemplate:t,tileInfo:n,wmtsInfo:i})}async fetchTile(e,n,r,i={}){let{signal:a}=i,o=this.getTileUrl(e,n,r,i.tileMatrixSetId),{data:s}=await t(o,{responseType:`image`,signal:a});return s}async fetchImageBitmapTile(e,n,r,i={}){let{signal:a}=i;if(this.fetchTile!==I.prototype.fetchTile){let t=await this.fetchTile(e,n,r,i);return C(t,e,n,r,i)}let o=this.getTileUrl(e,n,r,i.tileMatrixSetId),{data:s}=await t(o,{responseType:`blob`,signal:a});return C(s,e,n,r,i)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,n,r=this.activeLayer.tileMatrixSetId){let i=this._getTileMatrixSetById(r)?.tileInfo?.lods[e],a=i?i.levelValue||`${i.level}`:`${e}`,o=this.resourceInfo?``:O({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,r,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,n);return o||=this.getUrlTemplate(this.activeLayer.id,r,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${n}`),o=this._appendCustomLayerParameters(o),o}updateFrom(e){let{tileMatrixSet:t}=e;t&&(this.activeLayer.tileMatrixSetId=t.id,this.fullExtent=t.fullExtent?.clone()??null)}getUrlTemplate(e,t,n,r){if(!this.resourceInfo){let n=k({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,r);if(n)return n}if(this.serviceMode===`KVP`)return this.url+`?SERVICE=WMTS&VERSION=`+this.version+`&REQUEST=GetTile&LAYER=`+e+`&STYLE=`+r+`&FORMAT=`+n+`&TILEMATRIXSET=`+t+`&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}`;if(this.serviceMode===`RESTful`){let i=``,a=n.toLowerCase();return L[a]&&(i=L[a]),this.url+e+`/`+r+`/`+t+`/{level}/{row}/{col}`+i}return``}async _fetchService(e){if(this.resourceInfo){this.resourceInfo.serviceMode===`KVP`&&!this.url.includes(`?`)&&(this.url+=`?`),A(this.resourceInfo),this.read(this.resourceInfo,{origin:`service`});return}let t=null;try{let{data:n}=await this._getCapabilities(this.serviceMode,e);t=j(n),M(t)}catch{let n=this.serviceMode===`KVP`?`RESTful`:`KVP`;try{let{data:r}=await this._getCapabilities(n,e);t=j(r),M(t),this.serviceMode=n}catch(e){throw new i(`wmtslayer:unsupported-service-data`,`Services does not support RESTful or KVP service modes.`,{error:e})}}let{serviceMode:n,url:r}=this,a=N(t,{serviceMode:n,url:r});this.read(a,{origin:`service`})}async _getCapabilities(e,n){let r=this._getCapabilitiesUrl(e);return await t(r,{...n,responseType:`text`})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){let n=d(e),r={...n.query,...t},i=f(r);return i===``?n.path:`${n.path}?${i}`}_getCapabilitiesUrl(e){this.url=d(this.url).path;let t=this.url;switch(e){case`KVP`:t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case`RESTful`:{let e=`/${this.version}/WMTSCapabilities.xml`,n=new RegExp(e,`i`);t=t.replace(n,``),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;let t=d(e).query;if(!t)return null;let n={};return Object.keys(t).forEach(e=>{n[e.toLowerCase()]=t[e]}),n}_mergeParams(e,t){let n=this._getLowerCasedUrlParams(t);if(n){let t=Object.keys(n);t.length&&(e=e?a(e):{},t.forEach(t=>{!e.hasOwnProperty(t)&&!R.has(t)&&(e[t]=n[t])}))}return e}};e([p()],z.prototype,`dimensionMap`,void 0),e([p()],z.prototype,`layerMap`,void 0),e([p({type:D,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],z.prototype,`activeLayer`,void 0),e([P(`service`,`activeLayer`,[`layers`])],z.prototype,`readActiveLayerFromService`,null),e([P([`web-document`,`portal-item`],`activeLayer`,[`wmtsInfo`])],z.prototype,`readActiveLayerFromItemOrWebDoc`,null),e([F([`web-document`,`portal-item`],`activeLayer`,{templateUrl:{type:String},tileInfo:{type:w},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],z.prototype,`writeActiveLayer`,null),e([p({type:String,value:``,json:{write:!0}})],z.prototype,`copyright`,void 0),e([p({type:[`show`,`hide`]})],z.prototype,`listMode`,void 0),e([p({json:{read:!0,write:!0}})],z.prototype,`blendMode`,void 0),e([p({json:{origins:{"web-document":{read:{source:[`wmtsInfo.customParameters`,`wmtsInfo.url`]},write:{target:`wmtsInfo.customParameters`}},"portal-item":{read:{source:[`wmtsInfo.customParameters`,`wmtsInfo.url`]},write:{target:`wmtsInfo.customParameters`}}}}})],z.prototype,`customParameters`,void 0),e([P([`portal-item`,`web-document`],`customParameters`)],z.prototype,`readCustomParameters`,null),e([p({json:{origins:{"web-document":{read:{source:`wmtsInfo.customLayerParameters`},write:{target:`wmtsInfo.customLayerParameters`}},"portal-item":{read:{source:`wmtsInfo.customLayerParameters`},write:{target:`wmtsInfo.customLayerParameters`}}}}})],z.prototype,`customLayerParameters`,void 0),e([p({type:h,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:`fullExtent`}},"portal-item":{read:{source:`fullExtent`}}}}})],z.prototype,`fullExtent`,null),e([p({readOnly:!0})],z.prototype,`fullExtents`,null),e([p({type:[`WebTiledLayer`]})],z.prototype,`operationalLayerType`,void 0),e([p()],z.prototype,`resourceInfo`,void 0),e([p()],z.prototype,`serviceMode`,void 0),e([P([`portal-item`,`web-document`],`serviceMode`,[`templateUrl`])],z.prototype,`readServiceMode`,null),e([p({type:r.ofType(D)})],z.prototype,`sublayers`,void 0),e([P(`service`,`sublayers`,[`layers`])],z.prototype,`readSublayersFromService`,null),e([p({readOnly:!0})],z.prototype,`supportedSpatialReferences`,null),e([p({readOnly:!0})],z.prototype,`tilemapCache`,null),e([p({json:{read:{source:`title`}}})],z.prototype,`title`,null),e([p({json:{read:!1},readOnly:!0,value:`wmts`})],z.prototype,`type`,void 0),e([p({json:{origins:{service:{read:{source:`tileUrl`}},"web-document":{read:{source:`wmtsInfo.url`},write:{target:`wmtsInfo.url`}},"portal-item":{read:{source:`wmtsInfo.url`},write:{target:`wmtsInfo.url`}}}}})],z.prototype,`url`,null),e([p()],z.prototype,`version`,void 0),z=I=e([m(`esri.layers.WMTSLayer`)],z);function B(e,t){return e.map(e=>{let n=new D;return n.read(e,t),n})}const V=z;export{V as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import{isSome as n}from"../core/arrayUtils.js";import r from"../core/Collection.js";import i from"../core/Error.js";import{clone as a}from"../core/lang.js";import{MultiOriginJSONSupportMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s}from"../core/promiseUtils.js";import{watch as c,sync as l,on as u}from"../core/reactiveUtils.js";import{urlToObject as d,objectToQuery as f}from"../core/urlUtils.js";import{property as p,subclass as m}from"../core/accessorSupport/decorators.js";import h from"../geometry/Extent.js";import g from"./Layer.js";import _ from"./WebTileLayer.js";import{BlendLayer as v}from"./mixins/BlendLayer.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as b}from"./mixins/PortalLayer.js";import{RefreshableLayer as x}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{createTileBitmap as C}from"./support/imageBitmapUtils.js";import w from"./support/TileInfo.js";import T from"./support/TileInfoTilemapCache.js";import{WMTSLayerInfo as E}from"./support/WMTSLayerInfo.js";import D from"./support/WMTSSublayer.js";import{getTileUrlFromResourceUrls as O,getTileUrlTemplateFromResourceUrls as k,parseResourceInfo as A,parseText as j,validateCapabilities as M,parseCapabilities as N}from"./support/wmtsUtils.js";import{reader as P}from"../core/accessorSupport/decorators/reader.js";import{writer as F}from"../core/accessorSupport/decorators/writer.js";var I;const L={"image/png":`.png`,"image/png8":`.png`,"image/png24":`.png`,"image/png32":`.png`,"image/jpg":`.jpg`,"image/jpeg":`.jpeg`,"image/gif":`.gif`,"image/bmp":`.bmp`,"image/tiff":`.tif`,"image/jpgpng":``,"image/jpegpng":``,"image/unknown":``},R=new Set([`version`,`service`,`request`,`layer`,`style`,`format`,`tilematrixset`,`tilematrix`,`tilerow`,`tilecol`]);let z=I=class extends v(x(S(y(b(o(g)))))){constructor(e){super(e),this.activeLayer=null,this.copyright=``,this.customParameters=null,this.customLayerParameters=null,this.operationalLayerType=`WebTiledLayer`,this.resourceInfo=null,this.serviceMode=`RESTful`,this.sublayers=null,this.type=`wmts`,this.version=`1.0.0`,this.addHandles([c(()=>this.activeLayer,(e,t)=>{t&&!this.sublayers?.includes(t)&&(t.layer=null,t.parent=null),e&&(e.layer=this,e.parent=this)},l),u(()=>this.sublayers,`after-add`,({item:e})=>{e.layer=this,e.parent=this},l),u(()=>this.sublayers,`after-remove`,({item:e})=>{e.layer=null,e.parent=null},l),c(()=>this.sublayers,(e,t)=>{if(t)for(let e of t)e.layer=null,e.parent=null;if(e)for(let t of e)t.layer=this,t.parent=this},l)])}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:[`WMTS`]},e).catch(s).then(()=>this._fetchService(e)).catch(e=>{throw s(e),new i(`wmtslayer:unsupported-service-data`,`Invalid response from the WMTS service.`,{error:e})})),Promise.resolve(this)}readActiveLayerFromService(e,t,n){this.activeLayer||=new D;let r=t.layers.find(e=>e.id===this.activeLayer.id);return r||=t.layers[0],this.activeLayer.read(r,n),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){let{templateUrl:n,wmtsInfo:r}=t,i=n?this._getLowerCasedUrlParams(n):null,a=r?.layerIdentifier,o=null,s=r?.tileMatrixSet;s&&(Array.isArray(s)?s.length&&(o=s[0]):o=s);let c=i?.format,l=i?.style;return new D({id:a,imageFormat:c,styleId:l,tileMatrixSetId:o})}writeActiveLayer(e,t,n,r){let{activeLayer:i,loaded:a}=this,{id:o,tileMatrixSet:s,tileMatrixSetId:c,imageFormat:l,styleId:u}=i;t.templateUrl=a?this.getUrlTemplate(o,c,l,u):void 0,t.tileInfo=a?s?.tileInfo?.toJSON(r)??null:void 0,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:o,tileMatrixSet:c}}readCustomParameters(e,t){let n=t.wmtsInfo;return n?this._mergeParams(n.customParameters,n.url):null}get fullExtent(){return this.fullExtents?.[0]}set fullExtent(e){this._override(`fullExtent`,e)}get fullExtents(){return this.activeLayer?.fullExtents}readServiceMode(e,t){return t.templateUrl.includes(`?`)?`KVP`:`RESTful`}readSublayersFromService(e,t,n){return B(t.layers,n)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets?.map(e=>e.tileInfo?.spatialReference).toArray().filter(n)??[]}get tilemapCache(){let e=this.activeLayer?.tileMatrixSet?.tileInfo;return e?new T(e):void 0}get title(){return this.activeLayer?.title??`Layer`}set title(e){this._overrideIfSome(`title`,e)}get url(){return this._get(`url`)}set url(e){e&&e.endsWith(`/`)?this._set(`url`,e.slice(0,-1)):this._set(`url`,e)}createWebTileLayer(e){let t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),n=this._getTileMatrixSetById(e.tileMatrixSetId)?.tileInfo,r=e.fullExtent,i=new E({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(i.customLayerParameters=this.customLayerParameters),this.customParameters&&(i.customParameters=this.customParameters),new _({fullExtent:r,urlTemplate:t,tileInfo:n,wmtsInfo:i})}async fetchTile(e,n,r,i={}){let{signal:a}=i,o=this.getTileUrl(e,n,r,i.tileMatrixSetId),{data:s}=await t(o,{responseType:`image`,signal:a});return s}async fetchImageBitmapTile(e,n,r,i={}){let{signal:a}=i;if(this.fetchTile!==I.prototype.fetchTile){let t=await this.fetchTile(e,n,r,i);return C(t,e,n,r,i)}let o=this.getTileUrl(e,n,r,i.tileMatrixSetId),{data:s}=await t(o,{responseType:`blob`,signal:a});return C(s,e,n,r,i)}findSublayerById(e){return this.sublayers?.find(t=>t.id===e)}getTileUrl(e,t,n,r=this.activeLayer.tileMatrixSetId){let i=this._getTileMatrixSetById(r)?.tileInfo?.lods[e],a=i?i.levelValue||`${i.level}`:`${e}`,o=this.resourceInfo?``:O({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,r,this.activeLayer.imageFormat,this.activeLayer.styleId,a,t,n);return o||=this.getUrlTemplate(this.activeLayer.id,r,this.activeLayer.imageFormat,this.activeLayer.styleId).replaceAll(/\{level\}/gi,a).replaceAll(/\{row\}/gi,`${t}`).replaceAll(/\{col\}/gi,`${n}`),o=this._appendCustomLayerParameters(o),o}updateFrom(e){let{tileMatrixSet:t}=e;t&&(this.activeLayer.tileMatrixSetId=t.id,this.fullExtent=t.fullExtent?.clone()??null)}getUrlTemplate(e,t,n,r){if(!this.resourceInfo){let n=k({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,r);if(n)return n}if(this.serviceMode===`KVP`)return this.url+`?SERVICE=WMTS&VERSION=`+this.version+`&REQUEST=GetTile&LAYER=`+e+`&STYLE=`+r+`&FORMAT=`+n+`&TILEMATRIXSET=`+t+`&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}`;if(this.serviceMode===`RESTful`){let i=``,a=n.toLowerCase();return L[a]&&(i=L[a]),this.url+e+`/`+r+`/`+t+`/{level}/{row}/{col}`+i}return``}async _fetchService(e){if(this.resourceInfo){this.resourceInfo.serviceMode===`KVP`&&!this.url.includes(`?`)&&(this.url+=`?`),A(this.resourceInfo),this.read(this.resourceInfo,{origin:`service`});return}let t=null;try{let{data:n}=await this._getCapabilities(this.serviceMode,e);t=j(n),M(t)}catch{let n=this.serviceMode===`KVP`?`RESTful`:`KVP`;try{let{data:r}=await this._getCapabilities(n,e);t=j(r),M(t),this.serviceMode=n}catch(e){throw new i(`wmtslayer:unsupported-service-data`,`Services does not support RESTful or KVP service modes.`,{error:e})}}let{serviceMode:n,url:r}=this,a=N(t,{serviceMode:n,url:r});this.read(a,{origin:`service`})}async _getCapabilities(e,n){let r=this._getCapabilitiesUrl(e);return await t(r,{...n,responseType:`text`})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id)?.tileMatrixSets?.find(({id:t})=>t===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){let n=d(e),r={...n.query,...t},i=f(r);return i===``?n.path:`${n.path}?${i}`}_getCapabilitiesUrl(e){this.url=d(this.url).path;let t=this.url;switch(e){case`KVP`:t+=`?request=GetCapabilities&service=WMTS&version=${this.version}`;break;case`RESTful`:{let e=`/${this.version}/WMTSCapabilities.xml`,n=new RegExp(e,`i`);t=t.replace(n,``),t+=e;break}}return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;let t=d(e).query;if(!t)return null;let n={};return Object.keys(t).forEach(e=>{n[e.toLowerCase()]=t[e]}),n}_mergeParams(e,t){let n=this._getLowerCasedUrlParams(t);if(n){let t=Object.keys(n);t.length&&(e=e?a(e):{},t.forEach(t=>{!e.hasOwnProperty(t)&&!R.has(t)&&(e[t]=n[t])}))}return e}};e([p()],z.prototype,`dimensionMap`,void 0),e([p()],z.prototype,`layerMap`,void 0),e([p({type:D,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],z.prototype,`activeLayer`,void 0),e([P(`service`,`activeLayer`,[`layers`])],z.prototype,`readActiveLayerFromService`,null),e([P([`web-document`,`portal-item`],`activeLayer`,[`wmtsInfo`])],z.prototype,`readActiveLayerFromItemOrWebDoc`,null),e([F([`web-document`,`portal-item`],`activeLayer`,{templateUrl:{type:String},tileInfo:{type:w},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],z.prototype,`writeActiveLayer`,null),e([p({type:String,value:``,json:{write:!0}})],z.prototype,`copyright`,void 0),e([p({type:[`show`,`hide`]})],z.prototype,`listMode`,void 0),e([p({json:{read:!0,write:!0}})],z.prototype,`blendMode`,void 0),e([p({json:{origins:{"web-document":{read:{source:[`wmtsInfo.customParameters`,`wmtsInfo.url`]},write:{target:`wmtsInfo.customParameters`}},"portal-item":{read:{source:[`wmtsInfo.customParameters`,`wmtsInfo.url`]},write:{target:`wmtsInfo.customParameters`}}}}})],z.prototype,`customParameters`,void 0),e([P([`portal-item`,`web-document`],`customParameters`)],z.prototype,`readCustomParameters`,null),e([p({json:{origins:{"web-document":{read:{source:`wmtsInfo.customLayerParameters`},write:{target:`wmtsInfo.customLayerParameters`}},"portal-item":{read:{source:`wmtsInfo.customLayerParameters`},write:{target:`wmtsInfo.customLayerParameters`}}}}})],z.prototype,`customLayerParameters`,void 0),e([p({type:h,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:`fullExtent`}},"portal-item":{read:{source:`fullExtent`}}}}})],z.prototype,`fullExtent`,null),e([p({readOnly:!0})],z.prototype,`fullExtents`,null),e([p({type:[`WebTiledLayer`]})],z.prototype,`operationalLayerType`,void 0),e([p()],z.prototype,`resourceInfo`,void 0),e([p()],z.prototype,`serviceMode`,void 0),e([P([`portal-item`,`web-document`],`serviceMode`,[`templateUrl`])],z.prototype,`readServiceMode`,null),e([p({type:r.ofType(D)})],z.prototype,`sublayers`,void 0),e([P(`service`,`sublayers`,[`layers`])],z.prototype,`readSublayersFromService`,null),e([p({readOnly:!0})],z.prototype,`supportedSpatialReferences`,null),e([p({readOnly:!0})],z.prototype,`tilemapCache`,null),e([p({json:{read:{source:`title`}}})],z.prototype,`title`,null),e([p({json:{read:!1},readOnly:!0,value:`wmts`})],z.prototype,`type`,void 0),e([p({json:{origins:{service:{read:{source:`tileUrl`}},"web-document":{read:{source:`wmtsInfo.url`},write:{target:`wmtsInfo.url`}},"portal-item":{read:{source:`wmtsInfo.url`},write:{target:`wmtsInfo.url`}}}}})],z.prototype,`url`,null),e([p()],z.prototype,`version`,void 0),z=I=e([m(`esri.layers.WMTSLayer`)],z);function B(e,t){return e.map(e=>{let n=new D;return n.read(e,t),n})}const V=z;export{V 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"../request.js";import n from"../core/Error.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{replace as i}from"../core/string.js";import{Url as a,ensureTrailingSlash as o,isProtocolRelative as s,normalize as c}from"../core/urlUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import d from"../geometry/Extent.js";import f from"../geometry/Point.js";import p from"../geometry/SpatialReference.js";import m from"./Layer.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{RefreshableLayer as v}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as y}from"./mixins/ScaleRangeLayer.js";import{createTileBitmap as b}from"./support/imageBitmapUtils.js";import x from"./support/LOD.js";import S from"./support/TileInfo.js";import{WMTSLayerInfo as C}from"./support/WMTSLayerInfo.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{writer as T}from"../core/accessorSupport/decorators/writer.js";var E;let D=E=class extends h(v(y(g(_(r(m)))))){constructor(...e){super(...e),this.copyright=``,this.fullExtent=new d(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,p.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=p.WebMercator,this.subDomains=null,this.tileInfo=new S({size:[256,256],dpi:96,format:`png8`,compressionQuality:0,origin:new f({x:-20037508.342787,y:20037508.342787,spatialReference:p.WebMercator}),spatialReference:p.WebMercator,lods:[new x({level:0,scale:591657527.591555,resolution:156543.033928}),new x({level:1,scale:295828763.795777,resolution:78271.5169639999}),new x({level:2,scale:147914381.897889,resolution:39135.7584820001}),new x({level:3,scale:73957190.948944,resolution:19567.8792409999}),new x({level:4,scale:36978595.474472,resolution:9783.93962049996}),new x({level:5,scale:18489297.737236,resolution:4891.96981024998}),new x({level:6,scale:9244648.868618,resolution:2445.98490512499}),new x({level:7,scale:4622324.434309,resolution:1222.99245256249}),new x({level:8,scale:2311162.217155,resolution:611.49622628138}),new x({level:9,scale:1155581.108577,resolution:305.748113140558}),new x({level:10,scale:577790.554289,resolution:152.874056570411}),new x({level:11,scale:288895.277144,resolution:76.4370282850732}),new x({level:12,scale:144447.638572,resolution:38.2185141425366}),new x({level:13,scale:72223.819286,resolution:19.1092570712683}),new x({level:14,scale:36111.909643,resolution:9.55462853563415}),new x({level:15,scale:18055.954822,resolution:4.77731426794937}),new x({level:16,scale:9027.977411,resolution:2.38865713397468}),new x({level:17,scale:4513.988705,resolution:1.19432856685505}),new x({level:18,scale:2256.994353,resolution:.597164283559817}),new x({level:19,scale:1128.497176,resolution:.298582141647617}),new x({level:20,scale:564.248588,resolution:.14929107082380833}),new x({level:21,scale:282.124294,resolution:.07464553541190416}),new x({level:22,scale:141.062147,resolution:.03732276770595208}),new x({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type=`web-tile`,this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e==`string`?{urlTemplate:e,...t}:e}load(e){let t=this.loadFromPortal({supportedTypes:[`WMTS`]},e).then(()=>{let e=``;if(!this.urlTemplate)e=`is missing the required 'urlTemplate' property value`;else if(!this.spatialReference.equals(this.tileInfo.spatialReference))e=`spatialReference must match tileInfo.spatialReference`;else{let t=new a(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&t.authority?.includes(`{subDomain}`)&&(e=`is missing 'subDomains' property`)}if(e)throw new n(`web-tile-layer:load`,`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){let e=[];if(!this.tileInfo)return null;for(let t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}get loaded(){return super.loaded}readSpatialReference(e,t){return e||p.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;let e=[],{urlTemplate:t,subDomains:n}=this,r=new a(t),i=r.scheme?r.scheme+`://`:`//`,s=i+r.authority+`/`,c=r.authority;if(!c?.includes(`{subDomain}`))e.push(s);else if(n&&n.length>0&&c.split(`.`).length>1)for(let t of n)e.push(i+c.replaceAll(/\{subDomain\}/gi,t)+`/`);return e.map(o)}get urlPath(){if(!this.urlTemplate)return null;let e=this.urlTemplate,t=new a(e),n=(t.scheme?t.scheme+`://`:`//`)+t.authority+`/`;return e.slice(n.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){s(e)&&(e=`https:`+e),e&&=(e=e.replaceAll(/\{z\}/gi,`{level}`).replaceAll(/\{x\}/gi,`{col}`).replaceAll(/\{y\}/gi,`{row}`),c(e)),t.templateUrl=e}fetchTile(e,n,r,i={}){let{signal:a}=i,o=this.getTileUrl(e,n,r),s={responseType:`image`,signal:a,query:{...this.refreshParameters}};return t(o,s).then(e=>e.data)}async fetchImageBitmapTile(e,n,r,i={}){let{signal:a}=i;if(this.fetchTile!==E.prototype.fetchTile){let t=await this.fetchTile(e,n,r,i);return b(t,e,n,r,i)}let o=this.getTileUrl(e,n,r),s={responseType:`blob`,signal:a,query:{...this.refreshParameters}},{data:c}=await t(o,s);return b(c,e,n,r,i)}getTileUrl(e,t,n){let{levelValues:r,tileServers:a,urlPath:o}=this;if(!r||!a||!o)return``;let s=r[e];return a[t%a.length]+i(o,{level:s,z:s,col:n,x:n,row:t,y:t})}};e([l({type:String,value:``,json:{write:!0}})],D.prototype,`copyright`,void 0),e([l({type:d,json:{write:!0},nonNullable:!0})],D.prototype,`fullExtent`,void 0),e([l({readOnly:!0,json:{read:!1,write:!1}})],D.prototype,`legendEnabled`,void 0),e([l({type:[`show`,`hide`]})],D.prototype,`listMode`,void 0),e([l({json:{read:!0,write:!0}})],D.prototype,`blendMode`,void 0),e([l()],D.prototype,`levelValues`,null),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],D.prototype,`isReference`,void 0),e([l({type:[`WebTiledLayer`],value:`WebTiledLayer`})],D.prototype,`operationalLayerType`,void 0),e([l({readOnly:!0,json:{read:!1,write:!1}})],D.prototype,`popupEnabled`,void 0),e([l({type:p})],D.prototype,`spatialReference`,void 0),e([w(`spatialReference`,[`spatialReference`,`fullExtent.spatialReference`])],D.prototype,`readSpatialReference`,null),e([l({type:[String],json:{write:!0}})],D.prototype,`subDomains`,void 0),e([l({type:S,json:{write:!0}})],D.prototype,`tileInfo`,void 0),e([l({readOnly:!0})],D.prototype,`tileServers`,null),e([l({json:{read:!1}})],D.prototype,`type`,void 0),e([l()],D.prototype,`urlPath`,null),e([l({type:String,json:{origins:{"portal-item":{read:{source:`url`}}}}})],D.prototype,`urlTemplate`,void 0),e([w(`urlTemplate`,[`urlTemplate`,`templateUrl`])],D.prototype,`readUrlTemplate`,null),e([T(`urlTemplate`,{templateUrl:{type:String}})],D.prototype,`writeUrlTemplate`,null),e([l({type:C,json:{write:!0}})],D.prototype,`wmtsInfo`,void 0),D=E=e([u(`esri.layers.WebTileLayer`)],D);export{D as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import n from"../core/Error.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{replace as i}from"../core/string.js";import{Url as a,ensureTrailingSlash as o,isProtocolRelative as s,normalize as c}from"../core/urlUtils.js";import{property as l,subclass as u}from"../core/accessorSupport/decorators.js";import d from"../geometry/Extent.js";import f from"../geometry/Point.js";import p from"../geometry/SpatialReference.js";import m from"./Layer.js";import{BlendLayer as h}from"./mixins/BlendLayer.js";import{OperationalLayer as g}from"./mixins/OperationalLayer.js";import{PortalLayer as _}from"./mixins/PortalLayer.js";import{RefreshableLayer as v}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as y}from"./mixins/ScaleRangeLayer.js";import{createTileBitmap as b}from"./support/imageBitmapUtils.js";import x from"./support/LOD.js";import S from"./support/TileInfo.js";import{WMTSLayerInfo as C}from"./support/WMTSLayerInfo.js";import{reader as w}from"../core/accessorSupport/decorators/reader.js";import{writer as T}from"../core/accessorSupport/decorators/writer.js";var E;let D=E=class extends h(v(y(g(_(r(m)))))){constructor(e){super(e),this.copyright=``,this.fullExtent=new d({xmin:-20037508.342787,ymin:-20037508.34278,xmax:20037508.34278,ymax:20037508.342787,spatialReference:p.WebMercator}),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=p.WebMercator,this.subDomains=null,this.tileInfo=new S({size:[256,256],dpi:96,format:`png8`,compressionQuality:0,origin:new f({x:-20037508.342787,y:20037508.342787,spatialReference:p.WebMercator}),spatialReference:p.WebMercator,lods:[new x({level:0,scale:591657527.591555,resolution:156543.033928}),new x({level:1,scale:295828763.795777,resolution:78271.5169639999}),new x({level:2,scale:147914381.897889,resolution:39135.7584820001}),new x({level:3,scale:73957190.948944,resolution:19567.8792409999}),new x({level:4,scale:36978595.474472,resolution:9783.93962049996}),new x({level:5,scale:18489297.737236,resolution:4891.96981024998}),new x({level:6,scale:9244648.868618,resolution:2445.98490512499}),new x({level:7,scale:4622324.434309,resolution:1222.99245256249}),new x({level:8,scale:2311162.217155,resolution:611.49622628138}),new x({level:9,scale:1155581.108577,resolution:305.748113140558}),new x({level:10,scale:577790.554289,resolution:152.874056570411}),new x({level:11,scale:288895.277144,resolution:76.4370282850732}),new x({level:12,scale:144447.638572,resolution:38.2185141425366}),new x({level:13,scale:72223.819286,resolution:19.1092570712683}),new x({level:14,scale:36111.909643,resolution:9.55462853563415}),new x({level:15,scale:18055.954822,resolution:4.77731426794937}),new x({level:16,scale:9027.977411,resolution:2.38865713397468}),new x({level:17,scale:4513.988705,resolution:1.19432856685505}),new x({level:18,scale:2256.994353,resolution:.597164283559817}),new x({level:19,scale:1128.497176,resolution:.298582141647617}),new x({level:20,scale:564.248588,resolution:.14929107082380833}),new x({level:21,scale:282.124294,resolution:.07464553541190416}),new x({level:22,scale:141.062147,resolution:.03732276770595208}),new x({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type=`web-tile`,this.urlTemplate=null,this.wmtsInfo=null}load(e){let t=this.loadFromPortal({supportedTypes:[`WMTS`]},e).then(()=>{let e=``;if(!this.urlTemplate)e=`is missing the required 'urlTemplate' property value`;else if(!this.spatialReference.equals(this.tileInfo.spatialReference))e=`spatialReference must match tileInfo.spatialReference`;else{let t=new a(this.urlTemplate);!(this.subDomains&&this.subDomains.length>0)&&t.authority?.includes(`{subDomain}`)&&(e=`is missing 'subDomains' property`)}if(e)throw new n(`web-tile-layer:load`,`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){let e=[];if(!this.tileInfo)return null;for(let t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}get loaded(){return super.loaded}readSpatialReference(e,t){return e||p.fromJSON(t.fullExtent?.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;let e=[],{urlTemplate:t,subDomains:n}=this,r=new a(t),i=r.scheme?r.scheme+`://`:`//`,s=i+r.authority+`/`,c=r.authority;if(!c?.includes(`{subDomain}`))e.push(s);else if(n&&n.length>0&&c.split(`.`).length>1)for(let t of n)e.push(i+c.replaceAll(/\{subDomain\}/gi,t)+`/`);return e.map(o)}get urlPath(){if(!this.urlTemplate)return null;let e=this.urlTemplate,t=new a(e),n=(t.scheme?t.scheme+`://`:`//`)+t.authority+`/`;return e.slice(n.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){s(e)&&(e=`https:`+e),e&&=(e=e.replaceAll(/\{z\}/gi,`{level}`).replaceAll(/\{x\}/gi,`{col}`).replaceAll(/\{y\}/gi,`{row}`),c(e)),t.templateUrl=e}fetchTile(e,n,r,i={}){let{signal:a}=i,o=this.getTileUrl(e,n,r),s={responseType:`image`,signal:a,query:{...this.refreshParameters}};return t(o,s).then(e=>e.data)}async fetchImageBitmapTile(e,n,r,i={}){let{signal:a}=i;if(this.fetchTile!==E.prototype.fetchTile){let t=await this.fetchTile(e,n,r,i);return b(t,e,n,r,i)}let o=this.getTileUrl(e,n,r),s={responseType:`blob`,signal:a,query:{...this.refreshParameters}},{data:c}=await t(o,s);return b(c,e,n,r,i)}getTileUrl(e,t,n){let{levelValues:r,tileServers:a,urlPath:o}=this;if(!r||!a||!o)return``;let s=r[e];return a[t%a.length]+i(o,{level:s,z:s,col:n,x:n,row:t,y:t})}};e([l({type:String,value:``,json:{write:!0}})],D.prototype,`copyright`,void 0),e([l({type:d,json:{write:!0},nonNullable:!0})],D.prototype,`fullExtent`,void 0),e([l({readOnly:!0,json:{read:!1,write:!1}})],D.prototype,`legendEnabled`,void 0),e([l({type:[`show`,`hide`]})],D.prototype,`listMode`,void 0),e([l({json:{read:!0,write:!0}})],D.prototype,`blendMode`,void 0),e([l()],D.prototype,`levelValues`,null),e([l({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],D.prototype,`isReference`,void 0),e([l({type:[`WebTiledLayer`],value:`WebTiledLayer`})],D.prototype,`operationalLayerType`,void 0),e([l({readOnly:!0,json:{read:!1,write:!1}})],D.prototype,`popupEnabled`,void 0),e([l({type:p})],D.prototype,`spatialReference`,void 0),e([w(`spatialReference`,[`spatialReference`,`fullExtent.spatialReference`])],D.prototype,`readSpatialReference`,null),e([l({type:[String],json:{write:!0}})],D.prototype,`subDomains`,void 0),e([l({type:S,json:{write:!0}})],D.prototype,`tileInfo`,void 0),e([l({readOnly:!0})],D.prototype,`tileServers`,null),e([l({json:{read:!1}})],D.prototype,`type`,void 0),e([l()],D.prototype,`urlPath`,null),e([l({type:String,json:{origins:{"portal-item":{read:{source:`url`}}}}})],D.prototype,`urlTemplate`,void 0),e([w(`urlTemplate`,[`urlTemplate`,`templateUrl`])],D.prototype,`readUrlTemplate`,null),e([T(`urlTemplate`,{templateUrl:{type:String}})],D.prototype,`writeUrlTemplate`,null),e([l({type:C,json:{write:!0}})],D.prototype,`wmtsInfo`,void 0),D=E=e([u(`esri.layers.WebTileLayer`)],D);export{D 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 has from"../../../core/has.js";import{Loadable as t}from"../../../core/Loadable.js";import{debounce as n}from"../../../core/promiseUtils.js";import{open as r}from"../../../core/workers.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import{applyTimeExtentToQuery as s}from"./support/timeQueryUtils.js";import c from"../../../rest/support/FeatureSet.js";let l=class extends t{constructor(e){super(e),this.type=`csv`,this.refresh=n(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return t&&(this.sourceJSON.extent=t),n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t);return c.fromJSON(r)}async queryFeaturesJSON(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:o.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){await this.load();let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}async _startWorker(e){this._connection=await r(`CSVSourceWorker`,{strategy:has(`feature-layers-workers`)?`dedicated`:`local`,signal:e,registryTarget:this});let{url:t,delimiter:n,fields:i,latitudeField:a,longitudeField:o,spatialReference:s,timeInfo:c}=this.loadOptions,l=await this._connection.invoke(`load`,{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:n,fields:i?.map(e=>e.toJSON()),latitudeField:a,longitudeField:o,spatialReference:s?.toJSON(),timeInfo:c?.toJSON()}},{signal:e});this.locationInfo=l.locationInfo,this.sourceJSON=l.layerDefinition,this.delimiter=l.delimiter}};e([i()],l.prototype,`type`,void 0),e([i()],l.prototype,`loadOptions`,void 0),e([i()],l.prototype,`customParameters`,void 0),e([i({constructOnly:!0})],l.prototype,`layer`,void 0),e([i()],l.prototype,`locationInfo`,void 0),e([i()],l.prototype,`sourceJSON`,void 0),e([i()],l.prototype,`delimiter`,void 0),l=e([a(`esri.layers.graphics.sources.CSVSource`)],l);export{l as CSVSource};
2
+ import{__decorate as e}from"tslib";import{Loadable as t}from"../../../core/Loadable.js";import{debounce as n}from"../../../core/promiseUtils.js";import{open as r}from"../../../core/workers.js";import{property as i,subclass as a}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import{applyTimeExtentToQuery as s}from"./support/timeQueryUtils.js";import c from"../../../rest/support/FeatureSet.js";let l=class extends t{constructor(e){super(e),this.type=`csv`,this.refresh=n(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return t&&(this.sourceJSON.extent=t),n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t);return c.fromJSON(r)}async queryFeaturesJSON(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){await this.load(t);let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:o.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){await this.load();let n=s(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}async _startWorker(e){this._connection=await r(`CSVSourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{url:t,delimiter:n,fields:i,latitudeField:a,longitudeField:o,spatialReference:s,timeInfo:c}=this.loadOptions,l=await this._connection.invoke(`load`,{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:n,fields:i?.map(e=>e.toJSON()),latitudeField:a,longitudeField:o,spatialReference:s?.toJSON(),timeInfo:c?.toJSON()}},{signal:e});this.locationInfo=l.locationInfo,this.sourceJSON=l.layerDefinition,this.delimiter=l.delimiter}};e([i()],l.prototype,`type`,void 0),e([i()],l.prototype,`loadOptions`,void 0),e([i()],l.prototype,`customParameters`,void 0),e([i({constructOnly:!0})],l.prototype,`layer`,void 0),e([i()],l.prototype,`locationInfo`,void 0),e([i()],l.prototype,`sourceJSON`,void 0),e([i()],l.prototype,`delimiter`,void 0),l=e([a(`esri.layers.graphics.sources.CSVSource`)],l);export{l as CSVSource};
@@ -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"../../../request.js";import{isSome as r,remove as i}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as o}from"../../../core/jsonMap.js";import{Loadable as s}from"../../../core/Loadable.js";import c from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as u,after as d,throwIfAbortError as f}from"../../../core/promiseUtils.js";import{watch as p}from"../../../core/reactiveUtils.js";import{join as m}from"../../../core/urlUtils.js";import{generateBracedUUID as h}from"../../../core/uuid.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import v from"../../../geometry/Extent.js";import y from"../../../geometry/SpatialReference.js";import b from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as S}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as C,getFeatureJSON as w,getFeatureIds as T,getAttachmentEditsJSON as E,isProtectedOrPrivateVersionError as D,unpackEditResultData as O,createEditedFeatures as k}from"../applyEditsUtils.js";import{createDrawingInfo as A}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as M}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as N}from"../../support/featureLayerUtils.js";import{getAssetMapTable as P}from"../../support/infoFor3D.js";import F from"../../support/TimeInformation.js";import{executeQueryJSON as I}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as L}from"../../../rest/query/operations/editsZScale.js";import R from"../../../rest/support/Query.js";import z from"../../../time/TimeExtent.js";import{isSafeToEditVersion as B,isVersionInEditSession as V,isHistoricVersion as H,currentSessionId as U}from"../../../versionManagement/support/versionManagementUtils.js";const W=new o({originalAndCurrentFeatures:`original-and-current-features`,none:`none`}),G=new o({Started:`published`,Publishing:`publishing`,Stopped:`unavailable`});let K=class extends s{constructor(e){super(e),this.type=`feature-layer`,this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`,`Annotation Layer`,`Dimension Layer`]),this.refresh=u(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,n=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(n),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([p(()=>{let e=this.layer;return e&&`lastEditsEventDate`in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{layer:e}=this,{capabilities:t,parsedUrl:n,gdbVersion:r,spatialReference:i,fieldsIndex:a,uniqueIdFields:o}=e,s=`infoFor3D`in e?e.infoFor3D:null,c=`dynamicDataSource`in e?e.dynamicDataSource:null,l=has(`featurelayer-pbf`)&&t?.query.supportsFormatPBF&&s==null,u=l&&t?.query.supportsFormatPBFWithCurves,d=t?.operations?.supportsQueryAttachments??!1,f=t?.query?.relativeTimeBinWindow??0,p=new F({fieldsIndex:a,layer:e}),m=n.path;return new j({dynamicDataSource:c,fieldsIndex:a,gdbVersion:r,infoFor3D:s,pbfSupported:l,pbfSupportedWithCurves:u,queryAttachmentsSupported:d,relativeTimeBinWindow:f,sourceSpatialReference:i,timeInformation:p,uniqueIdFields:o,url:m})}async addAttachment(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/addAttachment`,s=this._getLayerRequestOptions({query:r}),c=this._getFormDataForAttachment(t,s.query);try{let e=await n(o,{body:c});return C(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(a,e)}}async updateAttachment(e,t,r,i){await this.load();let{layer:a}=this;await N(a,`editing`);let o=e.attributes[a.objectIdField],s=a.parsedUrl.path+`/`+o+`/updateAttachment`,c=this._getLayerRequestOptions({query:{attachmentId:t,...i}}),l=this._getFormDataForAttachment(r,c.query);try{let e=await n(s,{body:l});return C(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(o,e)}}async applyEdits(e,t){await this.load();let{layer:i}=this;await N(i,`editing`);let o=`infoFor3D`in i?i.infoFor3D:null,s=o!=null,c=s||(t?.globalIdUsed??!1),l=s?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,u=e.addFeatures?.map(e=>w(this.layer,e,o))??[],d=(await Promise.all(u)).filter(r),f=e.updateFeatures?.map(e=>w(this.layer,e,o))??[],p=(await Promise.all(f)).filter(r),m=T(this.layer,e.deleteFeatures,c);L(d,p,i.spatialReference);let h=await E(this.layer,e),g=i.capabilities.editing.supportsAsyncApplyEdits&&s,_=t?.gdbVersion||i.gdbVersion,v={gdbVersion:_,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:c,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:g};await B(this.layer.url,_,!0);let y=V(this.layer.url,_||null);if(await H(i.url,_,i.historicMoment))throw new a(`feature-layer-source:historic-version`,`Editing a historic version is not allowed`);t?.returnServiceEditsOption?(v.edits=JSON.stringify([{id:i.layerId,adds:d.length?d:null,updates:p.length?p:null,deletes:m.length?m:null,attachments:h,assetMaps:l}]),v.returnServiceEditsOption=W.toJSON(t?.returnServiceEditsOption),v.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(v.adds=d.length?JSON.stringify(d):null,v.updates=p.length?JSON.stringify(p):null,v.deletes=m.length?c?JSON.stringify(m):m.join(`,`):null,v.attachments=h&&JSON.stringify(h),v.assetMaps=l==null?void 0:JSON.stringify(l));let b=this._getLayerRequestOptions({method:`post`,query:v});y&&(b.authMode=`immediate`,b.query.returnEditMoment=!0,b.query.sessionId=U);let x=t?.returnServiceEditsOption?i.url:i.parsedUrl.path,S;try{S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b)}catch(e){if(D(e))b.authMode=`immediate`,S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b);else throw e}return this._createEditsResult(S)}async deleteAttachments(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/deleteAttachments`;try{return(await n(o,this._getLayerRequestOptions({query:{attachmentIds:t.join(`,`),...r},method:`post`}))).data.deleteAttachmentResults.map(C)}catch(e){throw this._createAttachmentErrorResult(a,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:i}=this.layer,{data:a}=await n(`${i}/${r}`,t),{id:o,extent:s,fullExtent:c,timeExtent:l}=a,u=s||c;return{id:o,fullExtent:u&&v.fromJSON(u),timeExtent:l&&z.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let n=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,n)}async queryFeatures(e,t){await this.load();let n=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&n.features.length){let t=new Map;if(n.features.forEach(n=>{let r=n.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let n=e.toLowerCase();n&&n in r&&e!==n&&(r[e]=r[n],delete r[n],t.set(n,e))}})}),n.fields!=null)for(let e of n.fields){let n=t.get(e.name.toLowerCase());n!=null&&(e.name=n)}}return n}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!M(this.layer.url))return`unavailable`;let e=m(this.layer.url,`status`),t=await n(e,{query:{f:`json`}});return G.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:n}=await import(`./support/uploadAssets.js`);return n(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(e==null||!(`capabilities`in t)||!(`effectiveCapabilities`in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let n=t.url;if(n==null)return;`layerId`in t&&(n=m(n,t.layerId.toString()));let r=this._getOrCreateEditInterceptor(n);r.before=t=>{let n=t.requestOptions.method??`auto`;if(n===`auto`||n===`head`){let n=t.requestOptions.query??{};n._ts=e.getTime(),t.requestOptions.query=n}}}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(i(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await n(e,t)).data.statusUrl;for(;;){let e=(await n(r,{query:{f:`json`},responseType:`json`})).data;switch(e.status){case`Completed`:return n(e.resultUrl,{query:{f:`json`},responseType:`json`});case`CompletedWithErrors`:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed.`);case`Failed ImportChanges`:case`InProgress`:case`Pending`:case`ExportAttachments`:case`ExportChanges`:case`ExportingData`:case`ExportingSnapshot`:case`ImportAttachments`:case`ProvisioningReplica`:case`UnRegisteringReplica`:break;default:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed (undefined response status)`)}await d(q)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};has(`featurelayer-advanced-symbols`)&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:i}=await n(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=i}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new a(`feature-layer-source:unsupported-type`,`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if(e.type!==`Table`&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=A(e.geometryType).renderer;l(`drawingInfo.renderer`,t,e)}if(e.geometryType===`esriGeometryMultiPatch`&&e.infoFor3D&&(e.geometryType=`mesh`),e.extent==null)try{let{data:r}=await n(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){f(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let n=e.addFeatures.filter(e=>e.geometry);if(t.length!==n.length+e.updateFeatures.length)throw new a(`feature-layer-source:unsupported-mesh-edits`,`Mixing attribute only edits with mesh geometry edits is not currently supported`);let r=[],i=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:n}=t;if(x(n))r.push(t);else{let n=t.origin,{convertMeshVertexSpace:a}=await import(`../../../geometry/support/meshUtils/convertMeshVertexSpace.js`),o=await a(t,new b({origin:[n.x,n.y,n.z??0]}));i.set(o,t),e.geometry=o,r.push(o)}}await this.uploadAssets(r);for(let[e,t]of i)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],n=this.layer.globalIdField,r=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(r),o=i.getAttribute(n);if(a.length===0){c.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:s}=a.find(S)??a[0];for(let e of s.assets)e.parts.length===1?t.push({globalId:h(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]}):c.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){let t=e.data,{layerId:n}=this.layer,r=[],i=null;if(Array.isArray(t))for(let e of t)e.editedFeatures!=null&&r.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===n&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=O(i);if(r.length>0){a.editedFeatureResults=[];for(let e of r){let{editedFeatures:t}=e,n=t?.spatialReference?new y(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:k(t,n)})}}return a}_createAttachmentErrorResult(e,t){let n=t.details.messages?.[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new a(`feature-layer-source:attachment-failure`,n,{code:r})}}_getFormDataForAttachment(e,t){let n=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(n)for(let e in t){let r=t[e];r!=null&&(n.set?n.set(e,r):n.append(e,r))}return n}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:n,gdbVersion:r}}=this;return{...e,query:{gdbVersion:r,layer:`dynamicDataSource`in t&&t.dynamicDataSource?JSON.stringify(t.dynamicDataSource.toLayerSourceJSON()):void 0,...n.query,f:`json`,...this._createRequestQueryOptions(e)},responseType:`json`}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:n,parsedUrl:i}=t,a=`infoFor3D`in t?t.infoFor3D:null;if(a==null||n==null)return!1;let o=P(a);if(o==null)return!1;let s=m(i.path,`../${o.id}`),c=[];for(let t of e)if(t.geometry.metadata.getExternalSourcesOnService(i).length>0)c.push(t);else return!1;let l=c.map(e=>e.getAttribute(n)).filter(r);if(l.length===0)return!1;let{assetMapFieldRoles:{parentGlobalId:u,assetHash:d}}=a,f=new R({where:`${u} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,u],returnGeometry:!1}),{features:p}=await I(s,f);return p.length!==0&&!c.some(e=>{let t=e.getAttribute(n);if(!t)return!0;let{metadata:r}=e.geometry,a=p.filter(e=>e.getAttribute(u)===t);if(a.length===0)return!0;let o=a.map(e=>e.getAttribute(d));return r.getExternalSourcesOnService(i).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>o.every(t=>e!==t))})}};e([g()],K.prototype,`type`,void 0),e([g({constructOnly:!0})],K.prototype,`layer`,void 0),e([g({constructOnly:!0})],K.prototype,`supportedSourceTypes`,void 0),e([g({readOnly:!0})],K.prototype,`queryTask`,null),K=e([_(`esri.layers.graphics.sources.FeatureLayerSource`)],K);const q=1e3;export{K as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../config.js";import n from"../../../request.js";import{isSome as r,remove as i}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as o}from"../../../core/jsonMap.js";import{Loadable as s}from"../../../core/Loadable.js";import c from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as u,after as d,throwIfAbortError as f}from"../../../core/promiseUtils.js";import{watch as p}from"../../../core/reactiveUtils.js";import{join as m}from"../../../core/urlUtils.js";import{generateBracedUUID as h}from"../../../core/uuid.js";import{property as g,subclass as _}from"../../../core/accessorSupport/decorators.js";import v from"../../../geometry/Extent.js";import y from"../../../geometry/SpatialReference.js";import b from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as x}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as S}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as C,getFeatureJSON as w,getFeatureIds as T,getAttachmentEditsJSON as E,isProtectedOrPrivateVersionError as D,unpackEditResultData as O,createEditedFeatures as k}from"../applyEditsUtils.js";import{createDrawingInfo as A}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as M}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as N}from"../../support/featureLayerUtils.js";import{getAssetMapTable as P}from"../../support/infoFor3D.js";import F from"../../support/TimeInformation.js";import{executeQueryJSON as I}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as L}from"../../../rest/query/operations/editsZScale.js";import R from"../../../rest/support/Query.js";import z from"../../../time/TimeExtent.js";import{isSafeToEditVersion as B,isVersionInEditSession as V,isHistoricVersion as H,currentSessionId as U}from"../../../versionManagement/support/versionManagementUtils.js";const W=new o({originalAndCurrentFeatures:`original-and-current-features`,none:`none`}),G=new o({Started:`published`,Publishing:`publishing`,Stopped:`unavailable`});let K=class extends s{constructor(e){super(e),this.type=`feature-layer`,this.supportedSourceTypes=new Set([`Feature Layer`,`Oriented Imagery Layer`,`Table`,`Catalog Layer`,`Annotation Layer`,`Dimension Layer`]),this.refresh=u(async()=>{await this.load();let e=this.sourceJSON.editingInfo?.lastEditDate;if(e==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}let t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}}),this._ongoingAssetUploads=new Map}load(e){let t=this.layer.sourceJSON,n=this._fetchService(t,{...e}).then(()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e)).then(()=>this._ensureLatestMetadata(e));return this.addResolvingPromise(n),Promise.resolve(this)}async reload(e){let t=this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0;await this._fetchService(null,{...e,cacheBust:t})}initialize(){this.addHandles([p(()=>{let e=this.layer;return e&&`lastEditsEventDate`in e?e.lastEditsEventDate:null},e=>this._handleLastEditsEventChange(e))])}destroy(){this._removeEditInterceptor()}get queryTask(){let{layer:e}=this,{capabilities:t,parsedUrl:n,gdbVersion:r,spatialReference:i,fieldsIndex:a,uniqueIdFields:o}=e,s=`infoFor3D`in e?e.infoFor3D:null,c=`dynamicDataSource`in e?e.dynamicDataSource:null,l=has(`featurelayer-pbf`)&&t?.query.supportsFormatPBF&&s==null,u=l&&t?.query.supportsFormatPBFWithCurves,d=t?.operations?.supportsQueryAttachments??!1,f=t?.query?.relativeTimeBinWindow??0,p=new F({fieldsIndex:a,layer:e}),m=n.path;return new j({dynamicDataSource:c,encodingCapabilities:t?.query,fieldsIndex:a,gdbVersion:r,infoFor3D:s,pbfSupported:l,pbfSupportedWithCurves:u,queryAttachmentsSupported:d,relativeTimeBinWindow:f,sourceSpatialReference:i,timeInformation:p,uniqueIdFields:o,url:m})}async addAttachment(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/addAttachment`,s=this._getLayerRequestOptions({query:r}),c=this._getFormDataForAttachment(t,s.query);try{let e=await n(o,{body:c});return C(e.data.addAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(a,e)}}async updateAttachment(e,t,r,i){await this.load();let{layer:a}=this;await N(a,`editing`);let o=e.attributes[a.objectIdField],s=a.parsedUrl.path+`/`+o+`/updateAttachment`,c=this._getLayerRequestOptions({query:{attachmentId:t,...i}}),l=this._getFormDataForAttachment(r,c.query);try{let e=await n(s,{body:l});return C(e.data.updateAttachmentResult)}catch(e){throw this._createAttachmentErrorResult(o,e)}}async applyEdits(e,t){await this.load();let{layer:i}=this;await N(i,`editing`);let o=`infoFor3D`in i?i.infoFor3D:null,s=o!=null,c=s||(t?.globalIdUsed??!1),l=s?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,u=e.addFeatures?.map(e=>w(this.layer,e,o))??[],d=(await Promise.all(u)).filter(r),f=e.updateFeatures?.map(e=>w(this.layer,e,o))??[],p=(await Promise.all(f)).filter(r),m=T(this.layer,e.deleteFeatures,c);L(d,p,i.spatialReference);let h=await E(this.layer,e),g=i.capabilities.editing.supportsAsyncApplyEdits&&s,_=t?.gdbVersion||i.gdbVersion,v={gdbVersion:_,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:c,returnEditMoment:t?.returnEditMoment,trueCurveClient:t?.editsRespectTrueCurves,usePreviousEditMoment:t?.usePreviousEditMoment,async:g};await B(this.layer.url,_,!0);let y=V(this.layer.url,_||null);if(await H(i.url,_,i.historicMoment))throw new a(`feature-layer-source:historic-version`,`Editing a historic version is not allowed`);t?.returnServiceEditsOption?(v.edits=JSON.stringify([{id:i.layerId,adds:d.length?d:null,updates:p.length?p:null,deletes:m.length?m:null,attachments:h,assetMaps:l}]),v.returnServiceEditsOption=W.toJSON(t?.returnServiceEditsOption),v.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(v.adds=d.length?JSON.stringify(d):null,v.updates=p.length?JSON.stringify(p):null,v.deletes=m.length?c?JSON.stringify(m):m.join(`,`):null,v.attachments=h&&JSON.stringify(h),v.assetMaps=l==null?void 0:JSON.stringify(l));let b=this._getLayerRequestOptions({method:`post`,query:v});y&&(b.authMode=`immediate`,b.query.returnEditMoment=!0,b.query.sessionId=U);let x=t?.returnServiceEditsOption?i.url:i.parsedUrl.path,S;try{S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b)}catch(e){if(D(e))b.authMode=`immediate`,S=g?await this._asyncApplyEdits(x+`/applyEdits`,b):await n(x+`/applyEdits`,b);else throw e}return this._createEditsResult(S)}async deleteAttachments(e,t,r){await this.load();let{layer:i}=this;await N(i,`editing`);let a=e.attributes[i.objectIdField],o=i.parsedUrl.path+`/`+a+`/deleteAttachments`;try{return(await n(o,this._getLayerRequestOptions({query:{attachmentIds:t.join(`,`),...r},method:`post`}))).data.deleteAttachmentResults.map(C)}catch(e){throw this._createAttachmentErrorResult(a,e)}}fetchRecomputedExtents(e={}){let t=e.signal;return this.load({signal:t}).then(async()=>{let t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:i}=this.layer,{data:a}=await n(`${i}/${r}`,t),{id:o,extent:s,fullExtent:c,timeExtent:l}=a,u=s||c;return{id:o,fullExtent:u&&v.fromJSON(u),timeExtent:l&&z.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(e,t={}){await this.load();let n=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,n)}async queryFeatures(e,t){await this.load();let n=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});if(e.outStatistics?.length&&n.features.length){let t=new Map;if(n.features.forEach(n=>{let r=n.attributes;e.outStatistics?.forEach(({outStatisticFieldName:e})=>{if(e){let n=e.toLowerCase();n&&n in r&&e!==n&&(r[e]=r[n],delete r[n],t.set(n,e))}})}),n.fields!=null)for(let e of n.fields){let n=t.get(e.name.toLowerCase());n!=null&&(e.name=n)}}return n}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryPivot(e,t){return await this.load(),this.queryTask.executePivotQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryAttributeBins(e,t){return await this.load(),this.queryTask.executeAttributeBinsQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!M(this.layer.url))return`unavailable`;let e=m(this.layer.url,`status`),t=await n(e,{query:{f:`json`}});return G.fromJSON(t.data.status)}async uploadAssets(e,t){let{uploadAssets:n}=await import(`./support/uploadAssets.js`);return n(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){let t=this.layer;if(e==null||!(`capabilities`in t)||!(`effectiveCapabilities`in t)||t.capabilities?.operations?.supportsEditing||!t.effectiveCapabilities?.operations?.supportsEditing)return;let n=t.url;if(n==null)return;`layerId`in t&&(n=m(n,t.layerId.toString()));let r=this._getOrCreateEditInterceptor(n);r.before=t=>{let n=t.requestOptions.method??`auto`;if(n===`auto`||n===`head`){let n=t.requestOptions.query??{};n._ts=e.getTime(),t.requestOptions.query=n}}}_getOrCreateEditInterceptor(e){return this._editInterceptor??(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){this._editInterceptor!=null&&(i(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){let r=(await n(e,t)).data.statusUrl;for(;;){let e=(await n(r,{query:{f:`json`},responseType:`json`})).data;switch(e.status){case`Completed`:return n(e.resultUrl,{query:{f:`json`},responseType:`json`});case`CompletedWithErrors`:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed.`);case`Failed ImportChanges`:case`InProgress`:case`Pending`:case`ExportAttachments`:case`ExportChanges`:case`ExportingData`:case`ExportingSnapshot`:case`ImportAttachments`:case`ProvisioningReplica`:case`UnRegisteringReplica`:break;default:throw new a(`async-applyEdits-failed`,`asynchronous applyEdits call failed (undefined response status)`)}await d(q)}}_createRequestQueryOptions(e){let t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){let r={};has(`featurelayer-advanced-symbols`)&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());let{data:i}=await n(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=i}this.layer.applyPreferredHost(e),this.sourceJSON=await this._patchServiceJSON(e,t?.signal);let r=e.type;if(!this.supportedSourceTypes.has(r))throw new a(`feature-layer-source:unsupported-type`,`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if(e.type!==`Table`&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){let t=A(e.geometryType).renderer;l(`drawingInfo.renderer`,t,e)}if(e.geometryType===`esriGeometryMultiPatch`&&e.infoFor3D&&(e.geometryType=`mesh`),e.extent==null)try{let{data:r}=await n(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(e){f(e)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){let{addAssetFeatures:t}=e;if(!t?.length||await this._areAllAssetsAlreadyMapped(t))return null;let n=e.addFeatures.filter(e=>e.geometry);if(t.length!==n.length+e.updateFeatures.length)throw new a(`feature-layer-source:unsupported-mesh-edits`,`Mixing attribute only edits with mesh geometry edits is not currently supported`);let r=[],i=new Map;for(let e of t){let{geometry:t}=e,{vertexSpace:n}=t;if(x(n))r.push(t);else{let n=t.origin,{convertMeshVertexSpace:a}=await import(`../../../geometry/support/meshUtils/convertMeshVertexSpace.js`),o=await a(t,new b({origin:[n.x,n.y,n.z??0]}));i.set(o,t),e.geometry=o,r.push(o)}}await this.uploadAssets(r);for(let[e,t]of i)t.addExternalSources(e.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){let t=[],n=this.layer.globalIdField,r=this.layer.parsedUrl;for(let i of e){let{metadata:e}=i.geometry,a=e.getExternalSourcesOnService(r),o=i.getAttribute(n);if(a.length===0){c.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}let{source:s}=a.find(S)??a[0];for(let e of s.assets)e.parts.length===1?t.push({globalId:h(),parentGlobalId:o,assetName:e.assetName,assetHash:e.parts[0].partHash,flags:[]}):c.getLogger(this).error(`Skipping asset ${e.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){let t=e.data,{layerId:n}=this.layer,r=[],i=null;if(Array.isArray(t))for(let e of t)e.editedFeatures!=null&&r.push({id:e.id,editedFeatures:e.editedFeatures}),e.id===n&&(i={addResults:e.addResults??[],updateResults:e.updateResults??[],deleteResults:e.deleteResults??[],attachments:e.attachments,editMoment:e.editMoment});else i=t;let a=O(i);if(r.length>0){a.editedFeatureResults=[];for(let e of r){let{editedFeatures:t}=e,n=t?.spatialReference?new y(t.spatialReference):null;a.editedFeatureResults.push({layerId:e.id,editedFeatures:k(t,n)})}}return a}_createAttachmentErrorResult(e,t){let n=t.details.messages?.[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new a(`feature-layer-source:attachment-failure`,n,{code:r})}}_getFormDataForAttachment(e,t){let n=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(n)for(let e in t){let r=t[e];r!=null&&(n.set?n.set(e,r):n.append(e,r))}return n}_getLayerRequestOptions(e={}){let{layer:t,layer:{parsedUrl:n,gdbVersion:r}}=this;return{...e,query:{gdbVersion:r,layer:`dynamicDataSource`in t&&t.dynamicDataSource?JSON.stringify(t.dynamicDataSource.toLayerSourceJSON()):void 0,...n.query,f:`json`,...this._createRequestQueryOptions(e)},responseType:`json`}}async _areAllAssetsAlreadyMapped(e){let{layer:t}=this,{globalIdField:n,parsedUrl:i}=t,a=`infoFor3D`in t?t.infoFor3D:null;if(a==null||n==null)return!1;let o=P(a);if(o==null)return!1;let s=m(i.path,`../${o.id}`),c=[];for(let t of e)if(t.geometry.metadata.getExternalSourcesOnService(i).length>0)c.push(t);else return!1;let l=c.map(e=>e.getAttribute(n)).filter(r);if(l.length===0)return!1;let{assetMapFieldRoles:{parentGlobalId:u,assetHash:d}}=a,f=new R({where:`${u} IN (${l.map(e=>`'${e}'`)})`,outFields:[d,u],returnGeometry:!1}),{features:p}=await I(s,f);return p.length!==0&&!c.some(e=>{let t=e.getAttribute(n);if(!t)return!0;let{metadata:r}=e.geometry,a=p.filter(e=>e.getAttribute(u)===t);if(a.length===0)return!0;let o=a.map(e=>e.getAttribute(d));return r.getExternalSourcesOnService(i).flatMap(({source:e})=>e.assets.flatMap(e=>e.parts.map(e=>e.partHash))).some(e=>o.every(t=>e!==t))})}};e([g()],K.prototype,`type`,void 0),e([g({constructOnly:!0})],K.prototype,`layer`,void 0),e([g({constructOnly:!0})],K.prototype,`supportedSourceTypes`,void 0),e([g({readOnly:!0})],K.prototype,`queryTask`,null),K=e([_(`esri.layers.graphics.sources.FeatureLayerSource`)],K);const q=1e3;export{K 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"../../../core/Error.js";import has from"../../../core/has.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i}from"../../../core/promiseUtils.js";import{open as a}from"../../../core/workers.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import c from"../../../geometry/Extent.js";import l from"../../../geometry/Polygon.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d}from"./support/clientSideDefaults.js";import{applyTimeExtentToQuery as f}from"./support/timeQueryUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends n{constructor(){super(...arguments),this.type=`geojson`,this.refresh=i(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return this.sourceJSON.extent=t,n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}).then(e=>p.fromJSON(e))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)})}queryFeatureCount(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)})}queryObjectIds(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)})}queryExtent(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryExtent`,n.toJSON(),t)}).then(e=>({count:e.count,extent:c.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke(`querySnapping`,e,t))}async queryAttributeBins(e,t={}){await this.load();let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}_applyEdits(e){if(!this._connection)throw new t(`geojson-layer-source:edit-failure`,`Memory source not loaded`);let n=this.layer.objectIdField,r=[],i=[],a=[];if(e.addFeatures)for(let t of e.addFeatures)r.push(this._serializeFeature(t));if(e.deleteFeatures)for(let t of e.deleteFeatures)`objectId`in t&&t.objectId!=null?i.push(t.objectId):`attributes`in t&&t.attributes[n]!=null&&i.push(t.attributes[n]);if(e.updateFeatures)for(let t of e.updateFeatures)a.push(this._serializeFeature(t));return this._connection.invoke(`applyEdits`,{adds:r,updates:a,deletes:i}).then(({extent:e,timeExtent:t,featureEditResults:n})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(n)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let n=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:n?new t(`geojson-layer-source:edit-failure`,n.description,{code:n.code}):null}}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e);return n?{geometry:n.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:t.type===`mesh`||t.type===`extent`?l.fromExtent(t.extent):t}async _startWorker(e){this._connection=await a(`GeoJSONSourceWorker`,{strategy:has(`feature-layers-workers`)?`dedicated`:`local`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,hasZ:i,geometryType:o,objectIdField:s,url:c,timeInfo:l,customParameters:f}=this.layer,p=this.layer.originOf(`spatialReference`)===`defaults`,m={url:c,customParameters:f,fields:t&&t.map(e=>e.toJSON()),geometryType:u.toJSON(o),hasZ:i,objectIdField:s,timeInfo:l?l.toJSON():null,spatialReference:p?null:n&&n.toJSON()},h=await this._connection.invoke(`load`,m,{signal:e});for(let e of h.warnings)r.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});h.featureErrors.length&&r.getLogger(this.layer).warn(`#load()`,`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=d(this.sourceJSON.hasZ,!0,!this.sourceJSON.geometryType)}};e([o()],m.prototype,`capabilities`,void 0),e([o()],m.prototype,`type`,void 0),e([o({constructOnly:!0})],m.prototype,`layer`,void 0),e([o()],m.prototype,`sourceJSON`,void 0),m=e([s(`esri.layers.graphics.sources.GeoJSONSource`)],m);export{m as GeoJSONSource};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i}from"../../../core/promiseUtils.js";import{open as a}from"../../../core/workers.js";import{property as o,subclass as s}from"../../../core/accessorSupport/decorators.js";import c from"../../../geometry/Extent.js";import l from"../../../geometry/Polygon.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d}from"./support/clientSideDefaults.js";import{applyTimeExtentToQuery as f}from"./support/timeQueryUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends n{constructor(){super(...arguments),this.type=`geojson`,this.refresh=i(async e=>{await this.load();let{extent:t,timeExtent:n}=await this._connection.invoke(`refresh`,e);return this.sourceJSON.extent=t,n&&(this.sourceJSON.timeInfo.timeExtent=[n.start,n.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)}).then(e=>p.fromJSON(e))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatures`,n.toJSON(),t)})}queryFeatureCount(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)})}queryObjectIds(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)})}queryExtent(e,t={}){return this.load(t).then(()=>{let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryExtent`,n.toJSON(),t)}).then(e=>({count:e.count,extent:c.fromJSON(e.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke(`querySnapping`,e,t))}async queryAttributeBins(e,t={}){await this.load();let n=f(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryAttributeBins`,n.toJSON(),t)}_applyEdits(e){if(!this._connection)throw new t(`geojson-layer-source:edit-failure`,`Memory source not loaded`);let n=this.layer.objectIdField,r=[],i=[],a=[];if(e.addFeatures)for(let t of e.addFeatures)r.push(this._serializeFeature(t));if(e.deleteFeatures)for(let t of e.deleteFeatures)`objectId`in t&&t.objectId!=null?i.push(t.objectId):`attributes`in t&&t.attributes[n]!=null&&i.push(t.attributes[n]);if(e.updateFeatures)for(let t of e.updateFeatures)a.push(this._serializeFeature(t));return this._connection.invoke(`applyEdits`,{adds:r,updates:a,deletes:i}).then(({extent:e,timeExtent:t,featureEditResults:n})=>(this.sourceJSON.extent=e,t&&(this.sourceJSON.timeInfo.timeExtent=[t.start,t.end]),this._createEditsResult(n)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let n=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:n?new t(`geojson-layer-source:edit-failure`,n.description,{code:n.code}):null}}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e);return n?{geometry:n.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:t.type===`mesh`||t.type===`extent`?l.fromExtent(t.extent):t}async _startWorker(e){this._connection=await a(`GeoJSONSourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,hasZ:i,geometryType:o,objectIdField:s,url:c,timeInfo:l,customParameters:f}=this.layer,p=this.layer.originOf(`spatialReference`)===`defaults`,m={url:c,customParameters:f,fields:t&&t.map(e=>e.toJSON()),geometryType:u.toJSON(o),hasZ:i,objectIdField:s,timeInfo:l?l.toJSON():null,spatialReference:p?null:n&&n.toJSON()},h=await this._connection.invoke(`load`,m,{signal:e});for(let e of h.warnings)r.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});h.featureErrors.length&&r.getLogger(this.layer).warn(`#load()`,`Encountered ${h.featureErrors.length} validation errors while loading features. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{errors:h.featureErrors}),this.sourceJSON=h.layerDefinition,this.capabilities=d(this.sourceJSON.hasZ,!0,!this.sourceJSON.geometryType)}};e([o()],m.prototype,`capabilities`,void 0),e([o()],m.prototype,`type`,void 0),e([o({constructOnly:!0})],m.prototype,`layer`,void 0),e([o()],m.prototype,`sourceJSON`,void 0),m=e([s(`esri.layers.graphics.sources.GeoJSONSource`)],m);export{m as GeoJSONSource};
@@ -1,4 +1,4 @@
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"../../../core/Collection.js";import r from"../../../core/Error.js";import has from"../../../core/has.js";import{LoadableMixin as i}from"../../../core/Loadable.js";import a from"../../../core/Logger.js";import{EsriPromiseMixin as o}from"../../../core/Promise.js";import{isAborted as s,createAbortError as c}from"../../../core/promiseUtils.js";import{open as l}from"../../../core/workers.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{ensureType as f}from"../../../core/accessorSupport/ensureType.js";import p from"../../../geometry/Extent.js";import m from"../../../geometry/Polygon.js";import{typeKebabDictionary as h}from"../../../geometry/support/typeUtils.js";import{createFeatureIdFromLayer as g}from"../data/createFeatureId.js";import{applyTimeExtentToQuery as _}from"./support/timeQueryUtils.js";import{unapplyEditsZUnitScaling as v}from"../../../rest/query/operations/editsZScale.js";import y from"../../../rest/support/FeatureSet.js";import{shared as b}from"../../../core/accessorSupport/decorators/shared.js";let x=0,S=class extends i(o(n)){constructor(e){super(e),this._idToClientGeometry=null,this.type=`memory`}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){let e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?`polygon`:e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t),i=y.fromJSON(r);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return i;let a=this.layer.objectIdField;for(let e of i.features){let t=e.attributes[a],n=this._idToClientGeometry.get(t);n!==void 0&&(e.geometry=n)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new r(`query-features-json:unsupported`,`Cannot query in JSON format for client only geometry types (mesh and extent)`);if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return await this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:p.fromJSON(r.extent)}}async querySnapping(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();return this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryAttributeBins`,n.toJSON(),t);return(await import(`../../../rest/support/AttributeBinsFeatureSet.js`)).default.fromJSON(r)}async _applyEdits(e){if(!this._connection)throw new r(`feature-layer-source:edit-failure`,`Memory source not loaded`);let t=this.layer.objectIdField,n=this.layer.uniqueIdFields,i=null,a=[],o=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);let s=e=>n?.length&&`attributes`in e?g(e,this.layer):`objectId`in e&&e.objectId!=null?e.objectId:`attributes`in e&&e.attributes[t]!=null?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(let t of e.deleteFeatures){let e=s(t);e!=null&&a.push(e)}let c=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures){for(let t of e.updateFeatures)if(o.push(this._serializeFeature(t)),c&&t.geometry!=null){let e=s(t);e!=null&&c.set(e,t)}}v(i?i.features:null,o,this.layer.spatialReference);let{fullExtent:l,featureEditResults:u}=await this._connection.invoke(`applyEdits`,{adds:i?i.features:[],updates:o,deletes:a});return this.fullExtent=l,i&&i.finish(u.uidToObjectId),this._updateIdToClientGeometries(c,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!==`mesh`||e==null)return;let n=[];for(let{geometry:r}of e)r!=null&&r.type===`mesh`&&!r.hasExtent&&!r.loaded&&n.push(r.load({signal:t}));n.length&&await Promise.all(n)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(let n of t.updateResults){if(!n.success)continue;let t=e.get(n.objectId);t!=null&&this._addIdToClientGeometry(t)}for(let e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let t=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:t?new r(`feature-layer-source:edit-failure`,t.description,{code:t.code}):null}}_prepareAddFeatures(e){let t=new Map,n=Array(e.length),r=null;for(let i=0;i<e.length;i++){let a=e[i],o=this._serializeFeature(a);!r&&a.geometry!=null&&(r=a.geometry.type),n[i]=o,t.set(`${o.uid}`,a)}let i=this;return{features:n,inferredGeometryType:r,finish(e){let n=i.sourceJSON.objectIdField;for(let r in e){let a=e[r],o=t.get(r);o&&(o.attributes||={},a===-1?delete o.attributes[n]:o.attributes[n]=a,i._addIdToClientGeometry(o))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;let t=this.sourceJSON.objectIdField,n=e.attributes?.[t];n!=null&&this._idToClientGeometry.set(n,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return e===`mesh`||e===`multipatch`||e===`extent`}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e),r=(x++).toString();return n?{uid:r,geometry:n.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?m.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await l(`MemorySourceWorker`,{strategy:has(`feature-layers-workers`)?`dedicated`:`local`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,objectIdField:r,hasM:i,hasZ:o,timeInfo:s,dateFieldsTimeZone:c}=this.layer,u=this.layer.originOf(`spatialReference`)===`defaults`;await this._prepareClientMapping(this.items,e);let d=this._prepareAddFeatures(this.items);this.addHandles(this.on(`before-changes`,e=>{a.getLogger(this).error(`Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead`),e.preventDefault()}));let{uniqueIdFields:f}=this.layer,p=f?.length?{type:f.length>1?`composite`:`simple`,fields:f.slice(),OIDFieldContainsHashValue:f?.length!==1||f.at(0)!==this.layer.objectIdField}:void 0,m={features:d.features,fields:t?.map(e=>e.toJSON()),geometryType:h.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!==`mesh`&&i,hasZ:this._layerOrSourceGeometryType===`mesh`||o,objectIdField:r,spatialReference:u?null:n&&n.toJSON(),timeInfo:s?.toJSON()??null,dateFieldsTimeZone:c,uniqueIdInfo:p},g=await this._connection.invoke(`load`,m,{signal:e});for(let e of g.warnings)a.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});g.featureErrors.length&&a.getLogger(this.layer).error(`#load()`,`Failed to load ${g.featureErrors.length} features due to errors. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}').`,g.featureErrors.map(e=>`
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Collection.js";import r from"../../../core/Error.js";import{LoadableMixin as i}from"../../../core/Loadable.js";import a from"../../../core/Logger.js";import{EsriPromiseMixin as o}from"../../../core/Promise.js";import{isAborted as s,createAbortError as c}from"../../../core/promiseUtils.js";import{open as l}from"../../../core/workers.js";import{property as u,subclass as d}from"../../../core/accessorSupport/decorators.js";import{ensureType as f}from"../../../core/accessorSupport/ensureType.js";import p from"../../../geometry/Extent.js";import m from"../../../geometry/Polygon.js";import{typeKebabDictionary as h}from"../../../geometry/support/typeUtils.js";import{createFeatureIdFromLayer as g}from"../data/createFeatureId.js";import{applyTimeExtentToQuery as _}from"./support/timeQueryUtils.js";import{unapplyEditsZUnitScaling as v}from"../../../rest/query/operations/editsZScale.js";import y from"../../../rest/support/FeatureSet.js";import{shared as b}from"../../../core/accessorSupport/decorators/shared.js";let x=0,S=class extends i(o(n)){constructor(e){super(e),this._idToClientGeometry=null,this.type=`memory`}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null}get _workerGeometryType(){let e=this.layer?.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?`polygon`:e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryFeatures`,n.toJSON(),t),i=y.fromJSON(r);if(!this._requiresClientGraphicMapping()||!this._idToClientGeometry)return i;let a=this.layer.objectIdField;for(let e of i.features){let t=e.attributes[a],n=this._idToClientGeometry.get(t);n!==void 0&&(e.geometry=n)}return i.geometryType=this.layer.geometryType,i}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new r(`query-features-json:unsupported`,`Cannot query in JSON format for client only geometry types (mesh and extent)`);if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return await this._connection.invoke(`queryFeatures`,n.toJSON(),t)}async queryFeatureCount(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryFeatureCount`,n.toJSON(),t)}async queryObjectIds(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex);return this._connection.invoke(`queryObjectIds`,n.toJSON(),t)}async queryExtent(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryExtent`,n.toJSON(),t);return{count:r.count,extent:p.fromJSON(r.extent)}}async querySnapping(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();return this._connection.invoke(`querySnapping`,e,t)}async queryAttributeBins(e,t={}){if(await this.load(t),s(t)||this._connection==null)throw c();let n=_(e,this.layer.timeInfo,this.sourceJSON.timeInfo,this.layer.fieldsIndex),r=await this._connection.invoke(`queryAttributeBins`,n.toJSON(),t);return(await import(`../../../rest/support/AttributeBinsFeatureSet.js`)).default.fromJSON(r)}async _applyEdits(e){if(!this._connection)throw new r(`feature-layer-source:edit-failure`,`Memory source not loaded`);let t=this.layer.objectIdField,n=this.layer.uniqueIdFields,i=null,a=[],o=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);let s=e=>n?.length&&`attributes`in e?g(e,this.layer):`objectId`in e&&e.objectId!=null?e.objectId:`attributes`in e&&e.attributes[t]!=null?e.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(let t of e.deleteFeatures){let e=s(t);e!=null&&a.push(e)}let c=e.updateFeatures&&this._idToClientGeometry?new Map:null;if(e.updateFeatures){for(let t of e.updateFeatures)if(o.push(this._serializeFeature(t)),c&&t.geometry!=null){let e=s(t);e!=null&&c.set(e,t)}}v(i?i.features:null,o,this.layer.spatialReference);let{fullExtent:l,featureEditResults:u}=await this._connection.invoke(`applyEdits`,{adds:i?i.features:[],updates:o,deletes:a});return this.fullExtent=l,i&&i.finish(u.uidToObjectId),this._updateIdToClientGeometries(c,u),this._createEditsResult(u)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!==`mesh`||e==null)return;let n=[];for(let{geometry:r}of e)r!=null&&r.type===`mesh`&&!r.hasExtent&&!r.loaded&&n.push(r.load({signal:t}));n.length&&await Promise.all(n)}_updateIdToClientGeometries(e,t){if(this._idToClientGeometry){if(e)for(let n of t.updateResults){if(!n.success)continue;let t=e.get(n.objectId);t!=null&&this._addIdToClientGeometry(t)}for(let e of t.deleteResults)e.success&&this._idToClientGeometry.delete(e.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){let t=e.success===!0?null:e.error||{code:void 0,description:``};return{objectId:e.objectId,globalId:e.globalId,error:t?new r(`feature-layer-source:edit-failure`,t.description,{code:t.code}):null}}_prepareAddFeatures(e){let t=new Map,n=Array(e.length),r=null;for(let i=0;i<e.length;i++){let a=e[i],o=this._serializeFeature(a);!r&&a.geometry!=null&&(r=a.geometry.type),n[i]=o,t.set(`${o.uid}`,a)}let i=this;return{features:n,inferredGeometryType:r,finish(e){let n=i.sourceJSON.objectIdField;for(let r in e){let a=e[r],o=t.get(r);o&&(o.attributes||={},a===-1?delete o.attributes[n]:o.attributes[n]=a,i._addIdToClientGeometry(o))}}}}_addIdToClientGeometry(e){if(!this._idToClientGeometry)return;let t=this.sourceJSON.objectIdField,n=e.attributes?.[t];n!=null&&this._idToClientGeometry.set(n,e.geometry??null)}get _layerOrSourceGeometryType(){return this.layer?.geometryType??this.sourceJSON?.geometryType}_requiresClientGraphicMapping(){return this._geometryTypeRequiresClientGraphicMapping(this._layerOrSourceGeometryType)}_geometryRequiresClientGraphicMapping(e){return this._geometryTypeRequiresClientGraphicMapping(e.type)}_geometryTypeRequiresClientGraphicMapping(e){return e===`mesh`||e===`multipatch`||e===`extent`}_serializeFeature(e){let{attributes:t}=e,n=this._geometryForSerialization(e),r=(x++).toString();return n?{uid:r,geometry:n.toJSON(),attributes:t}:{uid:r,attributes:t}}_geometryForSerialization(e){let{geometry:t}=e;return t==null?null:this._geometryRequiresClientGraphicMapping(t)?t.extent?m.fromExtent(t.extent):null:t}async _startWorker(e){this._connection=await l(`MemorySourceWorker`,{strategy:`dedicated`,signal:e,registryTarget:this});let{fields:t,spatialReference:n,objectIdField:r,hasM:i,hasZ:o,timeInfo:s,dateFieldsTimeZone:c}=this.layer,u=this.layer.originOf(`spatialReference`)===`defaults`;await this._prepareClientMapping(this.items,e);let d=this._prepareAddFeatures(this.items);this.addHandles(this.on(`before-changes`,e=>{a.getLogger(this).error(`Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead`),e.preventDefault()}));let{uniqueIdFields:f}=this.layer,p=f?.length?{type:f.length>1?`composite`:`simple`,fields:f.slice(),OIDFieldContainsHashValue:f?.length!==1||f.at(0)!==this.layer.objectIdField}:void 0,m={features:d.features,fields:t?.map(e=>e.toJSON()),geometryType:h.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!==`mesh`&&i,hasZ:this._layerOrSourceGeometryType===`mesh`||o,objectIdField:r,spatialReference:u?null:n&&n.toJSON(),timeInfo:s?.toJSON()??null,dateFieldsTimeZone:c,uniqueIdInfo:p},g=await this._connection.invoke(`load`,m,{signal:e});for(let e of g.warnings)a.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});g.featureErrors.length&&a.getLogger(this.layer).error(`#load()`,`Failed to load ${g.featureErrors.length} features due to errors. (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}').`,g.featureErrors.map(e=>`
3
3
 
4
4
  - `+e.error.description).join(``));let _=g.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(d.inferredGeometryType)&&(_.geometryType=h.toJSON(d.inferredGeometryType)),this.sourceJSON=_,this._requiresClientGraphicMapping()&&(this._idToClientGeometry=new Map),d.finish(g.assignedObjectIds)}};e([b({Type:t,ensureType:f(t)})],S.prototype,`itemType`,void 0),e([u()],S.prototype,`type`,void 0),e([u({constructOnly:!0})],S.prototype,`layer`,void 0),e([u({readOnly:!0})],S.prototype,`_workerGeometryType`,null),e([u()],S.prototype,`sourceJSON`,void 0),S=e([d(`esri.layers.graphics.sources.MemorySource`)],S);export{S as MemorySource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import has from"../../../core/has.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i,eachAlways as a}from"../../../core/promiseUtils.js";import{open as o}from"../../../core/workers.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d,createDrawingInfo as f}from"./support/clientSideDefaults.js";import{getCapabilities as p,getWFSLayerInfo as m,prepareWFSLayerFields as h,findFeatureType as g}from"../../ogc/wfsUtils.js";import _ from"../../../rest/support/AttributeBinsFeatureSet.js";import v from"../../../rest/support/FeatureSet.js";import{utc as y}from"../../../time/constants.js";let b=class extends n{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=d(!1,!1),this.type=`wfs`,this.refresh=i(async()=>{await this.load();let e=this.layer.maxRecordCount,t={customParameters:this.layer.customParameters,maxRecordCount:Math.min(e,this.wfsCapabilities.operations.GetFeature.countDefault??e),maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:n}=await this._workerHandler.refresh(t);return n&&(this.sourceJSON.extent=n),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){let n=await this.queryFeaturesJSON(e,t);return v.fromJSON(n)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._workerHandler.queryFeatures(e?e.toJSON():void 0,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,t)}async queryObjectIds(e,t={}){return await this.load(t),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,t)}async queryExtent(e,t={}){await this.load(t);let n=await this._workerHandler.queryExtent(e?e.toJSON():void 0,t);return{count:n.count,extent:l.fromJSON(n.extent)}}async querySnapping(e,t={}){return await this.load(t),this._workerHandler.querySnapping(e,t)}async queryAttributeBins(e,t={}){await this.load(t);let n=await this._workerHandler.queryAttributeBins(e?.toJSON(),t);return _.fromJSON(n)}async _createLoadOptions(e){let{url:n,customParameters:r,name:i,namespaceUri:a,fields:o,geometryType:s,maxRecordCount:c,maxPageCount:l,maxTotalRecordCount:d,swapXY:f}=this.layer,_=this.layer.originOf(`spatialReference`)===`defaults`?void 0:this.layer.spatialReference;if(!n)throw new t(`wfs-layer:missing-url`,`WFSLayer must be created with a url`);this.wfsCapabilities||=await p(n,{customParameters:r,...e});let v=[`fields`,`geometryType`,`name`,`namespaceUri`,`swapXY`].some(e=>this.layer[e]==null)?await m(this.wfsCapabilities,i,a,{spatialReference:_,customParameters:r,signal:e?.signal}):{...h(o??[]),geometryType:s,name:i,namespaceUri:a,spatialReference:_,swapXY:f},y=g(this.wfsCapabilities.readFeatureTypes(),v.name,v.namespaceUri),b=u.toJSON(v.geometryType),{operations:x}=this.wfsCapabilities,S=x.GetFeature.url,C=x.GetFeature.outputFormat;return{customParameters:r,featureType:y,fields:v.fields?.map(e=>e.toJSON())??[],geometryField:v.geometryField,geometryType:b,getFeatureUrl:S,getFeatureOutputFormat:C,maxRecordCount:Math.min(c,x.GetFeature.countDefault??c),maxPageCount:l,maxTotalRecordCount:d,objectIdField:v.objectIdField,spatialReference:v.spatialReference?.toJSON(),swapXY:!!v.swapXY}}async _startWorker(e){let[t,n]=await a([this._createLoadOptions(e),o(`WFSSourceWorker`,{...e,strategy:has(`feature-layers-workers`)?`dedicated`:`local`,registryTarget:this})]),i=t.error||n.error||null,s=n.value||null;if(i)throw s&&s.close(),i;let c=t.value;this._connection=n.value,this._workerHandler=this._connection.createInvokeProxy();let l=await this._workerHandler.load(c,e);for(let e of l.warnings)r.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:y},extent:l.extent,fields:c.fields,geometryType:c.geometryType,objectIdField:c.objectIdField,geometryField:c.geometryField,drawingInfo:f(c.geometryType),name:c.featureType.title,wfsInfo:{name:c.featureType.name,featureUrl:c.getFeatureUrl,maxFeatures:this.wfsCapabilities.operations.GetFeature.countDefault??c.maxRecordCount,swapXY:c.swapXY,supportedSpatialReferences:c.featureType.supportedSpatialReferences,version:`2.0.0`,wfsNamespace:c.featureType.namespaceUri}}}};e([s()],b.prototype,`capabilities`,void 0),e([s({constructOnly:!0})],b.prototype,`layer`,void 0),e([s()],b.prototype,`sourceJSON`,void 0),e([s()],b.prototype,`type`,void 0),e([s()],b.prototype,`wfsCapabilities`,void 0),b=e([c(`esri.layers.graphics.sources.WFSSource`)],b);export{b as WFSSource};
2
+ import{__decorate as e}from"tslib";import t from"../../../core/Error.js";import{Loadable as n}from"../../../core/Loadable.js";import r from"../../../core/Logger.js";import{debounce as i,eachAlways as a}from"../../../core/promiseUtils.js";import{open as o}from"../../../core/workers.js";import{property as s,subclass as c}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Extent.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as d,createDrawingInfo as f}from"./support/clientSideDefaults.js";import{getCapabilities as p,getWFSLayerInfo as m,prepareWFSLayerFields as h,findFeatureType as g}from"../../ogc/wfsUtils.js";import _ from"../../../rest/support/AttributeBinsFeatureSet.js";import v from"../../../rest/support/FeatureSet.js";import{utc as y}from"../../../time/constants.js";let b=class extends n{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=d(!1,!1),this.type=`wfs`,this.refresh=i(async()=>{await this.load();let e=this.layer.maxRecordCount,t={customParameters:this.layer.customParameters,maxRecordCount:Math.min(e,this.wfsCapabilities.operations.GetFeature.countDefault??e),maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:n}=await this._workerHandler.refresh(t);return n&&(this.sourceJSON.extent=n),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){let t=e==null?null:e.signal;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){let n=await this.queryFeaturesJSON(e,t);return v.fromJSON(n)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._workerHandler.queryFeatures(e?e.toJSON():void 0,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,t)}async queryObjectIds(e,t={}){return await this.load(t),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,t)}async queryExtent(e,t={}){await this.load(t);let n=await this._workerHandler.queryExtent(e?e.toJSON():void 0,t);return{count:n.count,extent:l.fromJSON(n.extent)}}async querySnapping(e,t={}){return await this.load(t),this._workerHandler.querySnapping(e,t)}async queryAttributeBins(e,t={}){await this.load(t);let n=await this._workerHandler.queryAttributeBins(e?.toJSON(),t);return _.fromJSON(n)}async _createLoadOptions(e){let{url:n,customParameters:r,name:i,namespaceUri:a,fields:o,geometryType:s,maxRecordCount:c,maxPageCount:l,maxTotalRecordCount:d,swapXY:f}=this.layer,_=this.layer.originOf(`spatialReference`)===`defaults`?void 0:this.layer.spatialReference;if(!n)throw new t(`wfs-layer:missing-url`,`WFSLayer must be created with a url`);this.wfsCapabilities||=await p(n,{customParameters:r,...e});let v=[`fields`,`geometryType`,`name`,`namespaceUri`,`swapXY`].some(e=>this.layer[e]==null)?await m(this.wfsCapabilities,i,a,{spatialReference:_,customParameters:r,signal:e?.signal}):{...h(o??[]),geometryType:s,name:i,namespaceUri:a,spatialReference:_,swapXY:f},y=g(this.wfsCapabilities.readFeatureTypes(),v.name,v.namespaceUri),b=u.toJSON(v.geometryType),{operations:x}=this.wfsCapabilities,S=x.GetFeature.url,C=x.GetFeature.outputFormat;return{customParameters:r,featureType:y,fields:v.fields?.map(e=>e.toJSON())??[],geometryField:v.geometryField,geometryType:b,getFeatureUrl:S,getFeatureOutputFormat:C,maxRecordCount:Math.min(c,x.GetFeature.countDefault??c),maxPageCount:l,maxTotalRecordCount:d,objectIdField:v.objectIdField,spatialReference:v.spatialReference?.toJSON(),swapXY:!!v.swapXY}}async _startWorker(e){let[t,n]=await a([this._createLoadOptions(e),o(`WFSSourceWorker`,{...e,strategy:`dedicated`,registryTarget:this})]),i=t.error||n.error||null,s=n.value||null;if(i)throw s&&s.close(),i;let c=t.value;this._connection=n.value,this._workerHandler=this._connection.createInvokeProxy();let l=await this._workerHandler.load(c,e);for(let e of l.warnings)r.getLogger(this.layer).warn(`#load()`,`${e.message} (title: '${this.layer.title||`no title`}', id: '${this.layer.id??`no id`}')`,{warning:e});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:y},extent:l.extent,fields:c.fields,geometryType:c.geometryType,objectIdField:c.objectIdField,geometryField:c.geometryField,drawingInfo:f(c.geometryType),name:c.featureType.title,wfsInfo:{name:c.featureType.name,featureUrl:c.getFeatureUrl,maxFeatures:this.wfsCapabilities.operations.GetFeature.countDefault??c.maxRecordCount,swapXY:c.swapXY,supportedSpatialReferences:c.featureType.supportedSpatialReferences,version:`2.0.0`,wfsNamespace:c.featureType.namespaceUri}}}};e([s()],b.prototype,`capabilities`,void 0),e([s({constructOnly:!0})],b.prototype,`layer`,void 0),e([s()],b.prototype,`sourceJSON`,void 0),e([s()],b.prototype,`type`,void 0),e([s()],b.prototype,`wfsCapabilities`,void 0),b=e([c(`esri.layers.graphics.sources.WFSSource`)],b);export{b as WFSSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as r}from"../../../../core/promiseUtils.js";import{urlToObject as i}from"../../../../core/urlUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as c}from"../../../support/infoFor3D.js";import{parseUrl as l}from"../../../../rest/utils.js";import{dynamicDataSourceTypes as u}from"../../../../rest/layerSources/typeUtils.js";import{executeForCount as d}from"../../../../rest/query/executeForCount.js";import{executeForExtent as f}from"../../../../rest/query/executeForExtent.js";import{executeForIds as p}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as m}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import g from"../../../../rest/support/FeatureSet.js";import _ from"../../../../rest/support/Query.js";let v=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return i(this.url)}async execute(e,t){let n=await this.executeJSON(e,t);return this.featureSetFromJSON(e,n,t)}async executeJSON(e,t){let n=this._normalizeQuery(e),r=e.outStatistics?.[0]!=null,i=has(`featurelayer-pbf-statistics`),a=this.pbfSupported&&(!r||i)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves),o;if(a)try{o=await h(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}catch(e){if(e.name===`query:parsing-pbf`)this.pbfSupported=!1;else throw e}return o??=await m(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,n){if(!this._queryGet3DObjectFormat(e)||this.infoFor3D==null||!t.features)return g.fromJSON(t);let{meshFeatureSetFromJSON:i}=await r(import(`../../../../rest/support/meshFeatureSet.js`),n);return i(e,this.infoFor3D,t)}executeForCount(e,t){return d(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return f(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForIds(e,t){return p(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:n},{executeRelationshipQuery:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:n},{executeRelationshipQueryForCount:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:n,fetchAttachments:i,processAttachmentQueryResult:a}=await r(import(`../../../../rest/query/operations/queryAttachments.js`),t),o=l(this.url);return a(o,await(this.queryAttachmentsSupported?n(o,e,t):i(o,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:n}=await r(import(`../../../../rest/query/executeAttributeBinsQuery.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executePivotQuery(e,t){let{executePivotQuery:n}=await r(import(`../../../../rest/query/executePivotQuery.js`),t);return n(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:n}=await r(import(`../../../../rest/query/executeTopFeaturesQuery.js`),t);return n(this.parsedUrl,e,this.sourceSpatialReference,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopIds(e,t){let{executeForTopIds:n}=await r(import(`../../../../rest/query/executeForTopIds.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopExtents(e,t){let{executeForTopExtents:n}=await r(import(`../../../../rest/query/executeForTopExtents.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopCount(e,t){let{executeForTopCount:n}=await r(import(`../../../../rest/query/executeForTopCount.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,i=this._queryGet3DObjectFormat(e);if(r!=null&&i){if(t=t===e?t.clone():t,t.formatOf3DObjects=i,t.outSpatialReference&&!s(t.outSpatialReference,this.sourceSpatialReference))throw new n(`query:unsupported-out-spatial-reference`,`3D object feature services do not support projection of geometries`);if(t.outFields==null||!t.outFields.includes(`*`)){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:n,originY:i,originZ:a,translationX:o,translationY:s,translationZ:c,scaleX:l,scaleY:u,scaleZ:d,rotationX:f,rotationY:p,rotationZ:m,rotationDeg:h}=r.transformFieldRoles;t.outFields.push(n,i,a,o,s,c,l,u,d,f,p,m,h)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:n}){return e===!0&&t!==`xyFootprint`&&!n?c(this.infoFor3D):null}};e([a({types:u})],v.prototype,`dynamicDataSource`,void 0),e([a()],v.prototype,`fieldsIndex`,void 0),e([a()],v.prototype,`gdbVersion`,void 0),e([a()],v.prototype,`infoFor3D`,void 0),e([a({readOnly:!0})],v.prototype,`parsedUrl`,null),e([a()],v.prototype,`pbfSupported`,void 0),e([a()],v.prototype,`pbfSupportedWithCurves`,void 0),e([a()],v.prototype,`queryAttachmentsSupported`,void 0),e([a()],v.prototype,`relativeTimeBinWindow`,void 0),e([a()],v.prototype,`sourceSpatialReference`,void 0),e([a()],v.prototype,`timeInformation`,void 0),e([a()],v.prototype,`uniqueIdFields`,void 0),e([a({type:String})],v.prototype,`url`,void 0),v=e([o(`esri.layers.graphics.sources.support.QueryTask`)],v);export{v as default};
2
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as r}from"../../../../core/promiseUtils.js";import{urlToObject as i}from"../../../../core/urlUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as c}from"../../../support/infoFor3D.js";import{parseUrl as l}from"../../../../rest/utils.js";import{dynamicDataSourceTypes as u}from"../../../../rest/layerSources/typeUtils.js";import{executeForCount as d}from"../../../../rest/query/executeForCount.js";import{executeForExtent as f}from"../../../../rest/query/executeForExtent.js";import{executeForIds as p}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as m}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import g from"../../../../rest/support/FeatureSet.js";import _ from"../../../../rest/support/Query.js";let v=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.encodingCapabilities=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return i(this.url)}get _layerMetadata(){return{encodingCapabilities:this.encodingCapabilities,timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}}async execute(e,t){let n=await this.executeJSON(e,t);return this.featureSetFromJSON(e,n,t)}async executeJSON(e,t){let n=this._normalizeQuery(e),r=e.outStatistics?.[0]!=null,i=has(`featurelayer-pbf-statistics`),a=this.pbfSupported&&(!r||i)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves),o;if(a)try{o=await h(this.url,n,t,this._layerMetadata)}catch(e){if(e.name===`query:parsing-pbf`)this.pbfSupported=!1;else throw e}return o??=await m(this.url,n,t,this._layerMetadata),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,n){if(!this._queryGet3DObjectFormat(e)||this.infoFor3D==null||!t.features)return g.fromJSON(t);let{meshFeatureSetFromJSON:i}=await r(import(`../../../../rest/support/meshFeatureSet.js`),n);return i(e,this.infoFor3D,t)}executeForCount(e,t){return d(this.url,this._normalizeQuery(e),t,this._layerMetadata)}executeForExtent(e,t){return f(this.url,this._normalizeQuery(e),t,this._layerMetadata)}executeForIds(e,t){return p(this.url,this._normalizeQuery(e),t,this._layerMetadata)}async executeRelationshipQuery(e,t){let[{default:n},{executeRelationshipQuery:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:n},{executeRelationshipQueryForCount:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:n,fetchAttachments:i,processAttachmentQueryResult:a}=await r(import(`../../../../rest/query/operations/queryAttachments.js`),t),o=l(this.url);return a(o,await(this.queryAttachmentsSupported?n(o,e,t):i(o,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:n}=await r(import(`../../../../rest/query/executeAttributeBinsQuery.js`),t);return n(this.parsedUrl,e,t,this._layerMetadata)}async executePivotQuery(e,t){let{executePivotQuery:n}=await r(import(`../../../../rest/query/executePivotQuery.js`),t);return n(this.parsedUrl,e,t,this._layerMetadata)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:n}=await r(import(`../../../../rest/query/executeTopFeaturesQuery.js`),t);return n(this.parsedUrl,e,this.sourceSpatialReference,t,this._layerMetadata)}async executeForTopIds(e,t){let{executeForTopIds:n}=await r(import(`../../../../rest/query/executeForTopIds.js`),t);return n(this.parsedUrl,e,t,this._layerMetadata)}async executeForTopExtents(e,t){let{executeForTopExtents:n}=await r(import(`../../../../rest/query/executeForTopExtents.js`),t);return n(this.parsedUrl,e,t,this._layerMetadata)}async executeForTopCount(e,t){let{executeForTopCount:n}=await r(import(`../../../../rest/query/executeForTopCount.js`),t);return n(this.parsedUrl,e,t,this._layerMetadata)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,i=this._queryGet3DObjectFormat(e);if(r!=null&&i){if(t=t===e?t.clone():t,t.formatOf3DObjects=i,t.outSpatialReference&&!s(t.outSpatialReference,this.sourceSpatialReference))throw new n(`query:unsupported-out-spatial-reference`,`3D object feature services do not support projection of geometries`);if(t.outFields==null||!t.outFields.includes(`*`)){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:n,originY:i,originZ:a,translationX:o,translationY:s,translationZ:c,scaleX:l,scaleY:u,scaleZ:d,rotationX:f,rotationY:p,rotationZ:m,rotationDeg:h}=r.transformFieldRoles;t.outFields.push(n,i,a,o,s,c,l,u,d,f,p,m,h)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:n}){return e===!0&&t!==`xyFootprint`&&!n?c(this.infoFor3D):null}};e([a({types:u})],v.prototype,`dynamicDataSource`,void 0),e([a()],v.prototype,`encodingCapabilities`,void 0),e([a()],v.prototype,`fieldsIndex`,void 0),e([a()],v.prototype,`gdbVersion`,void 0),e([a()],v.prototype,`infoFor3D`,void 0),e([a({readOnly:!0})],v.prototype,`parsedUrl`,null),e([a()],v.prototype,`pbfSupported`,void 0),e([a()],v.prototype,`pbfSupportedWithCurves`,void 0),e([a()],v.prototype,`queryAttachmentsSupported`,void 0),e([a()],v.prototype,`relativeTimeBinWindow`,void 0),e([a()],v.prototype,`sourceSpatialReference`,void 0),e([a()],v.prototype,`timeInformation`,void 0),e([a()],v.prototype,`uniqueIdFields`,void 0),e([a({type:String})],v.prototype,`url`,void 0),e([a()],v.prototype,`_layerMetadata`,null),v=e([o(`esri.layers.graphics.sources.support.QueryTask`)],v);export{v as default};