@arcgis/core 4.24.0-next.20220329 → 4.24.0-next.20220401

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 (456) hide show
  1. package/PopupTemplate.js +1 -1
  2. package/WebMap.js +1 -1
  3. package/WebScene.js +1 -1
  4. package/analysis/LineOfSightAnalysisObserver.js +1 -1
  5. package/analysis/LineOfSightAnalysisTarget.js +1 -1
  6. package/arcade/featureset/actions/Adapted.js +1 -1
  7. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  8. package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
  9. package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
  10. package/arcade/featureset/support/FeatureSet.js +1 -1
  11. package/arcade/featureset/support/RecentlyUsedCache.js +1 -1
  12. package/arcade/featureset/support/shared.js +1 -1
  13. package/arcade/functions/convertdirection.js +1 -1
  14. package/arcade/lib/character.js +1 -1
  15. package/arcade/lib/scanner.js +1 -1
  16. package/arcade/lib/tokenizer.js +1 -1
  17. package/arcade/request.js +1 -1
  18. package/arcade/treeAnalysis.js +1 -1
  19. package/assets/esri/core/workers/RemoteClient.js +1 -1
  20. package/assets/esri/core/workers/chunks/0bfedb1dbdff8205e468.js +1 -0
  21. package/assets/esri/core/workers/chunks/{5e472c89a38d6a42b84d.js → 0e29250c24a3a7b1ce13.js} +1 -1
  22. package/assets/esri/core/workers/chunks/0eb9c9477d36cd212f8b.js +1 -0
  23. package/assets/esri/core/workers/chunks/10779a256841c37f2429.js +1 -0
  24. package/assets/esri/core/workers/chunks/10a119889d1ab13402a3.js +1 -0
  25. package/assets/esri/core/workers/chunks/125b14c2ccd96d7c20c2.js +1 -0
  26. package/assets/esri/core/workers/chunks/23ec33a30db201e8b2c3.js +1 -0
  27. package/assets/esri/core/workers/chunks/2530e8ccf6e12787ce76.js +1 -0
  28. package/assets/esri/core/workers/chunks/2d9e97ba5b50aec4dd01.js +1 -0
  29. package/assets/esri/core/workers/chunks/365dc146398420f13f82.js +1 -0
  30. package/assets/esri/core/workers/chunks/3ae2827e8d55d6713d20.js +1 -0
  31. package/assets/esri/core/workers/chunks/3e3eebaa0844742db2f2.js +1 -0
  32. package/assets/esri/core/workers/chunks/3fd5b2d6eccd9098d492.js +1 -0
  33. package/assets/esri/core/workers/chunks/404f1d7bce014c7e6965.js +1 -0
  34. package/assets/esri/core/workers/chunks/411b7777bb5e943c156f.js +1 -0
  35. package/assets/esri/core/workers/chunks/{12ca192a5233bb2875d0.js → 4312902ab6e42fbe119b.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{4ef07f50da39f8607c1c.js → 44e95e87bd9e820aeb53.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{4d4c5e535d8b9ceb865a.js → 4810edf605838d07e5c5.js} +1 -1
  38. package/assets/esri/core/workers/chunks/4bce446391176a9d4588.js +1 -0
  39. package/assets/esri/core/workers/chunks/52a0e387073ea264e194.js +1 -0
  40. package/assets/esri/core/workers/chunks/560234694f3e53802aff.js +1 -0
  41. package/assets/esri/core/workers/chunks/5633710daeb3bbb79bcf.js +1 -0
  42. package/assets/esri/core/workers/chunks/5682039666f874836451.js +1 -0
  43. package/assets/esri/core/workers/chunks/6f01905936396fe87865.js +1 -0
  44. package/assets/esri/core/workers/chunks/6f7917da7166e8c6854b.js +1 -0
  45. package/assets/esri/core/workers/chunks/7388824eac8da01ea03d.js +1 -0
  46. package/assets/esri/core/workers/chunks/7745efef7d5119d0b087.js +1 -0
  47. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +1 -0
  48. package/assets/esri/core/workers/chunks/{da64dedf9270b64f42b2.js → 79bdb26244ec7b4472fe.js} +1 -1
  49. package/assets/esri/core/workers/chunks/79ec28b3e3c57fe026aa.js +1 -0
  50. package/assets/esri/core/workers/chunks/81e9d860a044acec74ce.js +1 -0
  51. package/assets/esri/core/workers/chunks/831dc0187f71e658550c.js +1 -0
  52. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +1 -0
  53. package/assets/esri/core/workers/chunks/{fb7397da8d4ec2ae4587.js → 87458fbf395338511662.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{1a859be598ad96bb4719.js → 8771296b537f366596c4.js} +18 -18
  55. package/assets/esri/core/workers/chunks/8958cd555f4887526e8b.js +1 -0
  56. package/assets/esri/core/workers/chunks/{e57b71ba70f088a3a052.js → 90dcd86cdef90099abfa.js} +1 -1
  57. package/assets/esri/core/workers/chunks/93067e27eea5844edc6c.js +1 -0
  58. package/assets/esri/core/workers/chunks/{9fbee2d9bf50c4c148c6.js → 9a146c9e9b4bf7fba88f.js} +1 -1
  59. package/assets/esri/core/workers/chunks/9b9821772b6cbe189fe0.js +1 -0
  60. package/assets/esri/core/workers/chunks/{6c4ce530b493c6f7c430.js → 9df2f9f7c28b31866be8.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{d0620ce99b620621d8bc.js → a0552044e123a3c51ddf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/acc1a4acd57f5657e782.js +1 -0
  63. package/assets/esri/core/workers/chunks/b055ae7c54796751b64c.js +1 -0
  64. package/assets/esri/core/workers/chunks/{acc2cfb116fee7f82ae9.js → b26bd8fde2fc65bb67fb.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{9b45b94c4dbdc8d2c5fd.js → b34ba22c7a5adce8a7a2.js} +1 -1
  66. package/assets/esri/core/workers/chunks/b75665d0bf417c6ef24a.js +1 -0
  67. package/assets/esri/core/workers/chunks/bd50ec30688463b821d1.js +1 -0
  68. package/assets/esri/core/workers/chunks/c28f7ae4756ad1ba94bd.js +1 -0
  69. package/assets/esri/core/workers/chunks/c4f713959d4115b87c6c.js +1 -0
  70. package/assets/esri/core/workers/chunks/c58aa209492bd94b7aad.js +1 -0
  71. package/assets/esri/core/workers/chunks/{9b117097b7be0efd21d4.js → c59b0b58e24e6a60cf3e.js} +1 -1
  72. package/assets/esri/core/workers/chunks/c7bd5a4d318299388645.js +1 -0
  73. package/assets/esri/core/workers/chunks/c7cee13a962396b23a5e.js +1 -0
  74. package/assets/esri/core/workers/chunks/{3bbff5ea1ea0e955c592.js → cd3679fa86129ebabfdf.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{1a36dc0daffd536ea44d.js → cee7ce362860717713bf.js} +1 -1
  76. package/assets/esri/core/workers/chunks/cf463d6309f14df2f2fa.js +1 -0
  77. package/assets/esri/core/workers/chunks/{224c0e64160bdc170051.js → d076627bb7dadea89e89.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{fff4200bc61b82dd6193.js → d1d1c45243af614f2e74.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{1e0498dc9836658d9aba.js → d5fd12ea541c1a6b7fce.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{10322d990cda5aedf2f0.js → d6e32ca237ad9309c76a.js} +1 -1
  81. package/assets/esri/core/workers/chunks/e06ad3a3d71154fed654.js +1 -0
  82. package/assets/esri/core/workers/chunks/{7a77d4cd27c30f1a5cae.js → ee3387a43dfbb3df23e1.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{5d5fa2b1fc48a17eb9ab.js → f4fc165420d449e442b8.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{3d6d9906a534ddd8fa37.js → f5ee03f3fca7a75192de.js} +1 -1
  85. package/assets/esri/themes/base/widgets/_Daylight.scss +1 -1
  86. package/assets/esri/themes/base/widgets/_ElevationProfile.scss +1 -1
  87. package/assets/esri/themes/base/widgets/_Weather.scss +1 -1
  88. package/assets/esri/themes/base/widgets/_Widget.scss +12 -0
  89. package/assets/esri/themes/dark/main.css +1 -1
  90. package/assets/esri/themes/dark-blue/main.css +1 -1
  91. package/assets/esri/themes/dark-green/main.css +1 -1
  92. package/assets/esri/themes/dark-purple/main.css +1 -1
  93. package/assets/esri/themes/dark-red/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/assets/esri/themes/light-blue/main.css +1 -1
  97. package/assets/esri/themes/light-green/main.css +1 -1
  98. package/assets/esri/themes/light-purple/main.css +1 -1
  99. package/assets/esri/themes/light-red/main.css +1 -1
  100. package/chunks/ComponentShader.glsl.js +25 -25
  101. package/chunks/HighlightApply.glsl.js +36 -0
  102. package/chunks/HighlightBlur.glsl.js +26 -0
  103. package/chunks/HighlightDownsample.glsl.js +12 -0
  104. package/chunks/ImageMaterial.glsl.js +8 -8
  105. package/chunks/LineCallout.glsl.js +1 -1
  106. package/chunks/Pattern.glsl.js +2 -2
  107. package/chunks/SimpleAtmosphere.glsl.js +7 -7
  108. package/chunks/Stars.glsl.js +1 -1
  109. package/chunks/arcade.js +1 -1
  110. package/chunks/color.js +1 -1
  111. package/chunks/languageUtils.js +1 -1
  112. package/chunks/mat3.js +1 -1
  113. package/copyright.txt +2 -2
  114. package/core/AsyncUpdate.js +1 -1
  115. package/core/Evented.js +1 -1
  116. package/core/PooledArray.js +1 -1
  117. package/core/accessorSupport/diffUtils.js +1 -1
  118. package/core/accessorSupport/get.js +1 -1
  119. package/core/accessorSupport/read.js +1 -1
  120. package/core/accessorSupport/set.js +1 -1
  121. package/core/accessorSupport/tracking.js +1 -1
  122. package/core/accessorSupport/utils.js +1 -1
  123. package/core/arrayUtils.js +1 -1
  124. package/core/libs/gl-matrix-2/mat3.js +1 -1
  125. package/core/libs/gl-matrix-2/math/mat3.js +1 -1
  126. package/core/number.js +1 -1
  127. package/core/object.js +1 -1
  128. package/core/string.js +1 -1
  129. package/core/unitUtils.js +1 -1
  130. package/core/watchUtils.js +1 -1
  131. package/core/workers/RemoteClient.js +1 -1
  132. package/exports/csv.js +1 -1
  133. package/geometry/support/heightModelInfoUtils.js +1 -1
  134. package/geometry/support/meshUtils/exporters/gltf/geometry.js +1 -1
  135. package/geometry/support/normalizeUtils.js +1 -1
  136. package/identity/IdentityManagerBase.js +1 -1
  137. package/interfaces.d.ts +155 -20
  138. package/layers/ImageryLayer.js +1 -1
  139. package/layers/MapImageLayer.js +1 -1
  140. package/layers/RouteLayer.js +1 -1
  141. package/layers/SceneLayer.js +1 -1
  142. package/layers/SubtypeGroupLayer.js +1 -1
  143. package/layers/TileLayer.js +1 -1
  144. package/layers/VectorTileLayer.js +1 -1
  145. package/layers/WMSLayer.js +1 -1
  146. package/layers/WMTSLayer.js +1 -1
  147. package/layers/WebTileLayer.js +1 -1
  148. package/layers/graphics/data/AttributesBuilder.js +1 -1
  149. package/layers/graphics/data/QueryEngine.js +1 -1
  150. package/layers/graphics/editingSupport.js +1 -1
  151. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  152. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  153. package/layers/graphics/sources/support/inferenceUtils.js +1 -1
  154. package/layers/mixins/ArcGISCachedService.js +1 -1
  155. package/layers/mixins/ArcGISImageService.js +1 -1
  156. package/layers/ogc/ogcFeatureUtils.js +1 -1
  157. package/layers/support/ExportImageServiceParameters.js +1 -1
  158. package/layers/support/PixelBlock.js +1 -1
  159. package/layers/support/RasterJobHandler.js +1 -1
  160. package/layers/support/SpriteSource.js +1 -1
  161. package/layers/support/Sublayer.js +1 -1
  162. package/layers/support/TilemapCache.js +1 -1
  163. package/layers/support/WMTSSublayer.js +1 -1
  164. package/layers/support/arcgisLayerUrl.js +1 -1
  165. package/layers/support/fieldUtils.js +1 -1
  166. package/layers/support/kmlUtils.js +1 -1
  167. package/layers/support/layerUtils.js +1 -1
  168. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  169. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  170. package/layers/support/rasterDatasets/RasterFactory.js +1 -1
  171. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  172. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  173. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  174. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  175. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  176. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  177. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  178. package/layers/support/vectorTileLayerLoader.js +1 -1
  179. package/layers/support/wmsUtils.js +1 -1
  180. package/layers/support/wmtsUtils.js +1 -1
  181. package/libs/i3s/I3SModule.js +1 -1
  182. package/libs/vxl/VxlModule.js +1 -1
  183. package/package.json +1 -1
  184. package/portal/Portal.js +1 -1
  185. package/portal/PortalItem.js +1 -1
  186. package/portal/schemas/definitions.js +1 -1
  187. package/portal/support/layersLoader.js +1 -1
  188. package/portal/support/portalItemUtils.js +1 -1
  189. package/portal/support/portalLayers.js +1 -1
  190. package/renderers/support/AuthoringInfoVisualVariable.js +1 -1
  191. package/renderers/support/DictionaryLoader.js +1 -1
  192. package/renderers/support/RasterSymbolizer.js +1 -1
  193. package/renderers/support/numberUtils.js +1 -1
  194. package/renderers/support/rasterRendererHelper.js +1 -1
  195. package/renderers/support/utils.js +1 -1
  196. package/request.js +1 -1
  197. package/rest/imageService.js +1 -1
  198. package/rest/operations/find.js +1 -1
  199. package/rest/query/operations/query.js +1 -1
  200. package/rest/query/operations/queryRelatedRecords.js +1 -1
  201. package/rest/query/operations/queryTopFeatures.js +1 -1
  202. package/rest/support/DirectionLine.js +1 -1
  203. package/rest/support/DirectionPoint.js +1 -1
  204. package/rest/support/PointBarrier.js +1 -1
  205. package/rest/support/PolygonBarrier.js +1 -1
  206. package/rest/support/PolylineBarrier.js +1 -1
  207. package/rest/support/RouteInfo.js +1 -1
  208. package/rest/support/Stop.js +1 -1
  209. package/smartMapping/labels/clusters.js +1 -1
  210. package/smartMapping/popup/dotDensity.js +1 -1
  211. package/smartMapping/popup/support/clusterUtils.js +1 -1
  212. package/smartMapping/popup/support/utils.js +1 -1
  213. package/smartMapping/raster/support/utils.js +1 -1
  214. package/smartMapping/renderers/color.js +1 -1
  215. package/smartMapping/renderers/location.js +1 -1
  216. package/smartMapping/renderers/predominance.js +1 -1
  217. package/smartMapping/renderers/relationship.js +1 -1
  218. package/smartMapping/renderers/size.js +1 -1
  219. package/smartMapping/renderers/support/utils.js +1 -1
  220. package/smartMapping/renderers/type.js +1 -1
  221. package/smartMapping/renderers/univariateColorSize.js +1 -1
  222. package/smartMapping/statistics/summaryStatisticsForAge.js +1 -1
  223. package/smartMapping/statistics/support/ageUtils.js +1 -1
  224. package/smartMapping/statistics/support/utils.js +1 -1
  225. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  226. package/smartMapping/support/adapters/support/utils.js +1 -1
  227. package/smartMapping/support/utils.js +1 -1
  228. package/smartMapping/symbology/support/Theme.js +1 -1
  229. package/smartMapping/symbology/support/colorRamps.js +1 -1
  230. package/smartMapping/symbology/support/symbologyUtils.js +1 -1
  231. package/smartMapping/symbology/support/utils.js +1 -1
  232. package/statistics/utils.js +1 -1
  233. package/support/basemapDefinitions.js +1 -1
  234. package/support/basemapUtils.js +1 -1
  235. package/support/elevationInfoUtils.js +1 -1
  236. package/support/popupUtils.js +1 -1
  237. package/support/revision.js +1 -1
  238. package/symbols/cim/CIMSymbolRasterizer.js +1 -1
  239. package/symbols/cim/cimAnalyzer.js +1 -1
  240. package/symbols/cim/utils.js +1 -1
  241. package/symbols/support/previewSymbol3D.js +1 -1
  242. package/symbols/support/renderUtils.js +1 -1
  243. package/symbols/support/symbolLayerUtils.js +1 -1
  244. package/views/2d/engine/Bitmap.js +1 -1
  245. package/views/2d/engine/flow/FlowDisplayObject.js +1 -1
  246. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  247. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  248. package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
  249. package/views/2d/engine/vectorTiles/TileParser.js +1 -1
  250. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  251. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  252. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  253. package/views/2d/engine/webgl/Profiler.js +1 -1
  254. package/views/2d/engine/webgl/Utils.js +1 -1
  255. package/views/2d/engine/webgl/brushes/WGLGeometryBrush.js +1 -1
  256. package/views/2d/engine/webgl/definitions.js +1 -1
  257. package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
  258. package/views/2d/engine/webgl/effects/HittestEffectVTL.js +1 -1
  259. package/views/2d/engine/webgl/mesh/templates/WGLTemplateStore.js +1 -1
  260. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  261. package/views/2d/engine/webgl/util/Lock.js +1 -1
  262. package/views/2d/layers/RouteLayerView2D.js +1 -1
  263. package/views/2d/layers/features/schemaUtils.js +1 -1
  264. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  265. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  266. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  267. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  268. package/views/2d/layers/support/webStyleUtils.js +1 -1
  269. package/views/2d/support/Timeline.js +1 -1
  270. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  271. package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
  272. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  273. package/views/3d/analysis/Slice/SliceController.js +1 -1
  274. package/views/3d/environment/PanoramicAtmosphere.js +1 -1
  275. package/views/3d/environment/SceneViewAtmosphere.js +1 -1
  276. package/views/3d/environment/StarsTechnique.js +1 -1
  277. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  278. package/views/3d/glTF/loader.js +1 -1
  279. package/views/3d/interactive/analysisTools/lineOfSight/LineOfSightTool.js +1 -1
  280. package/views/3d/interactive/analysisTools/slice/SliceTool.js +1 -1
  281. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  282. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  283. package/views/3d/layers/I3SMeshView3D.js +1 -1
  284. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  285. package/views/3d/layers/LayerView3D.js +1 -1
  286. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  287. package/views/3d/layers/RouteLayerView3D.js +1 -1
  288. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  289. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  290. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  291. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  292. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  293. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  294. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  295. package/views/3d/layers/i3s/IDBMockCache.js +5 -0
  296. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  297. package/views/3d/layers/support/PopupSceneLayerView.js +1 -1
  298. package/views/3d/state/ViewStateManager.js +1 -1
  299. package/views/3d/state/controllers/RotateController.js +1 -1
  300. package/views/3d/state/controllers/global/PinchAndPanController.js +1 -1
  301. package/views/3d/state/controllers/global/ZoomController.js +1 -1
  302. package/views/3d/state/controllers/global/ZoomStepController.js +1 -1
  303. package/views/3d/state/controllers/local/PinchAndPanController.js +1 -1
  304. package/views/3d/state/controllers/local/ZoomController.js +1 -1
  305. package/views/3d/support/HighlightOptions.js +1 -1
  306. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  307. package/views/3d/support/debugFlags.js +1 -1
  308. package/views/3d/support/orientedBoundingBox.js +1 -1
  309. package/views/3d/terrain/TerrainSurface.js +1 -1
  310. package/views/3d/webgl-engine/Stage.js +1 -1
  311. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  312. package/views/3d/webgl-engine/collections/Component/DepthRange.js +1 -1
  313. package/views/3d/webgl-engine/core/shaderLibrary/ForwardLinearDepth.glsl.js +3 -3
  314. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +5 -5
  315. package/views/3d/webgl-engine/core/shaderModules/ShaderBuilder.js +1 -1
  316. package/views/3d/webgl-engine/lib/HighlightHelper.js +1 -1
  317. package/views/3d/webgl-engine/lib/Object3D.js +1 -1
  318. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  319. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  320. package/views/3d/webgl-engine/lib/edgeRendering/EdgeShaderParameters.js +1 -1
  321. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  322. package/views/3d/webgl-engine/lib/lodRendering/InstanceData.js +1 -1
  323. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  324. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  325. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  326. package/views/3d/webgl-engine/parts/ScreenshotManager.js +1 -1
  327. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +5 -0
  328. package/views/3d/webgl-engine/shaders/HighlightApplyTechnique.js +5 -0
  329. package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +5 -0
  330. package/views/3d/webgl-engine/shaders/HighlightBlurTechnique.js +5 -0
  331. package/views/3d/webgl-engine/shaders/HighlightDownsample.glsl.js +5 -0
  332. package/views/3d/webgl-engine/shaders/HighlightDownsampleTechnique.js +5 -0
  333. package/views/3d/webgl-engine/shaders/HighlightOptions.js +4 -0
  334. package/views/3d/webgl-engine/shaders/HighlightPassParameters.js +5 -0
  335. package/views/3d/webgl-engine/shaders/ImageMaterial.glsl.js +1 -1
  336. package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
  337. package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
  338. package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
  339. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +5 -7
  340. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +14 -14
  341. package/views/SceneView.js +1 -1
  342. package/views/draw/support/GraphicMover.js +1 -1
  343. package/views/input/InputHandler.js +1 -1
  344. package/views/input/InputManager.js +1 -1
  345. package/views/layers/ImageryTileLayerView.js +1 -1
  346. package/views/layers/MapImageLayerView.js +1 -1
  347. package/views/layers/TileLayerView.js +1 -1
  348. package/views/layers/support/popupUtils.js +1 -1
  349. package/views/support/DefaultsFromMap.js +1 -1
  350. package/views/support/Scheduler.js +1 -1
  351. package/views/support/screenshotUtils.js +1 -1
  352. package/views/ui/DefaultUI.js +1 -1
  353. package/views/webgl/ShaderTranspiler.js +1 -1
  354. package/webscene/Slide.js +1 -1
  355. package/webscene/spec-certification/spec.js +1 -1
  356. package/widgets/AreaMeasurement3D/AreaMeasurement3DViewModel.js +1 -1
  357. package/widgets/Attachments/support/attachmentUtils.js +1 -1
  358. package/widgets/Attachments.js +1 -1
  359. package/widgets/Attribution.js +1 -1
  360. package/widgets/BasemapLayerList.js +1 -1
  361. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  362. package/widgets/Bookmarks.js +1 -1
  363. package/widgets/BuildingExplorer/support/filterUtils.js +1 -1
  364. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  365. package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
  366. package/widgets/CoordinateConversion/support/formatUtils.js +1 -1
  367. package/widgets/DirectLineMeasurement3D/DirectLineMeasurement3DViewModel.js +1 -1
  368. package/widgets/Directions/DirectionsViewModel.js +1 -1
  369. package/widgets/Directions.js +1 -1
  370. package/widgets/Editor/EditorViewModel.js +1 -1
  371. package/widgets/Editor/workflowUtils.js +1 -1
  372. package/widgets/Editor.js +1 -1
  373. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  374. package/widgets/Feature/FeatureMedia.js +1 -1
  375. package/widgets/Feature/support/featureUtils.js +1 -1
  376. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  377. package/widgets/FeatureForm/InputField.js +1 -1
  378. package/widgets/FeatureForm.js +1 -1
  379. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  380. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  381. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  382. package/widgets/FeatureTemplates.js +1 -1
  383. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  384. package/widgets/LayerList/ListItemPanel.js +1 -1
  385. package/widgets/LayerList.js +1 -1
  386. package/widgets/Legend/LegendViewModel.js +1 -1
  387. package/widgets/Legend/styles/Card.js +1 -1
  388. package/widgets/Legend/styles/Classic.js +1 -1
  389. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  390. package/widgets/Legend/support/colorRampUtils.js +1 -1
  391. package/widgets/Legend/support/relationshipRampUtils.js +1 -1
  392. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  393. package/widgets/Popup/PopupViewModel.js +1 -1
  394. package/widgets/Popup/actionUtils.js +1 -1
  395. package/widgets/Print/PrintViewModel.js +1 -1
  396. package/widgets/Print.js +1 -1
  397. package/widgets/ScaleBar/ScaleBarViewModel.js +1 -1
  398. package/widgets/Search/SearchViewModel.js +1 -1
  399. package/widgets/Search/support/layerSearchUtils.js +1 -1
  400. package/widgets/Slider.js +1 -1
  401. package/widgets/Swipe.js +1 -1
  402. package/widgets/TableList.js +1 -1
  403. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  404. package/widgets/TimeSlider.js +1 -1
  405. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  406. package/widgets/support/DatePicker.js +1 -1
  407. package/widgets/support/Popover.js +1 -1
  408. package/widgets/support/SnappingControls.js +1 -1
  409. package/widgets/support/TimePicker.js +1 -1
  410. package/widgets/support/timeWidgetUtils.js +1 -1
  411. package/assets/esri/core/workers/chunks/083a5d10f8e243641cb9.js +0 -1
  412. package/assets/esri/core/workers/chunks/0872812ce4d0ec8faf8f.js +0 -1
  413. package/assets/esri/core/workers/chunks/0bc26899780c33637746.js +0 -1
  414. package/assets/esri/core/workers/chunks/113362697da1b69deaed.js +0 -1
  415. package/assets/esri/core/workers/chunks/11a2f9708938eac98815.js +0 -1
  416. package/assets/esri/core/workers/chunks/11a45709b703be84caaf.js +0 -1
  417. package/assets/esri/core/workers/chunks/1c1294ff1ebbd8f774f7.js +0 -1
  418. package/assets/esri/core/workers/chunks/1c915cc9a9d5729b6f17.js +0 -1
  419. package/assets/esri/core/workers/chunks/31786756b3d44540f8c0.js +0 -1
  420. package/assets/esri/core/workers/chunks/36a6f34fe40785beff5d.js +0 -1
  421. package/assets/esri/core/workers/chunks/373c16f8b8093d001064.js +0 -1
  422. package/assets/esri/core/workers/chunks/382a331a592abb61267f.js +0 -1
  423. package/assets/esri/core/workers/chunks/3bf106fe34e3992032c4.js +0 -1
  424. package/assets/esri/core/workers/chunks/3dcec610f1c1497d87bc.js +0 -1
  425. package/assets/esri/core/workers/chunks/46495e726d8739260d44.js +0 -1
  426. package/assets/esri/core/workers/chunks/4a82a6a473b3d540d0be.js +0 -1
  427. package/assets/esri/core/workers/chunks/4b6719377a95ac10fa43.js +0 -1
  428. package/assets/esri/core/workers/chunks/4d2ef57ff3a5cfc1313f.js +0 -1
  429. package/assets/esri/core/workers/chunks/4fd2b8153d62592210a2.js +0 -1
  430. package/assets/esri/core/workers/chunks/56e6a1079269e2964b02.js +0 -1
  431. package/assets/esri/core/workers/chunks/5b4d9786c010d265346c.js +0 -1
  432. package/assets/esri/core/workers/chunks/604637e1c3937b376a0d.js +0 -1
  433. package/assets/esri/core/workers/chunks/60f83257e361f87fa6fd.js +0 -1
  434. package/assets/esri/core/workers/chunks/6d3f80be6fceb2c18b5d.js +0 -1
  435. package/assets/esri/core/workers/chunks/6f827a32646bab0a8777.js +0 -1
  436. package/assets/esri/core/workers/chunks/70bd2ab42e3801ef5974.js +0 -1
  437. package/assets/esri/core/workers/chunks/746222184b361b50d6ba.js +0 -1
  438. package/assets/esri/core/workers/chunks/7fb72b2d11e8d840f982.js +0 -1
  439. package/assets/esri/core/workers/chunks/85bb6a1a7704fcdcbec2.js +0 -1
  440. package/assets/esri/core/workers/chunks/8b4c76cebb100e6c06f8.js +0 -1
  441. package/assets/esri/core/workers/chunks/9586a6b320edb1922926.js +0 -1
  442. package/assets/esri/core/workers/chunks/99638697ffda9022ce92.js +0 -1
  443. package/assets/esri/core/workers/chunks/a9da1cb118ca62a9581d.js +0 -1
  444. package/assets/esri/core/workers/chunks/aaa41a5013eef713c032.js +0 -1
  445. package/assets/esri/core/workers/chunks/ac321f939dd488ff6ce4.js +0 -1
  446. package/assets/esri/core/workers/chunks/add6027a96398ecf69de.js +0 -1
  447. package/assets/esri/core/workers/chunks/b75206b46ba81606087c.js +0 -1
  448. package/assets/esri/core/workers/chunks/bf8456828e38a768eba3.js +0 -1
  449. package/assets/esri/core/workers/chunks/c0720d0d8adcba6738d4.js +0 -1
  450. package/assets/esri/core/workers/chunks/c5bb712d5cf8c05a4e13.js +0 -1
  451. package/assets/esri/core/workers/chunks/d343f05a3366f95e0494.js +0 -1
  452. package/assets/esri/core/workers/chunks/d8b1f00075983d769985.js +0 -1
  453. package/chunks/Highlight.glsl.js +0 -88
  454. package/views/3d/webgl-engine/shaders/Highlight.glsl.js +0 -5
  455. package/views/3d/webgl-engine/shaders/HighlightTechnique.js +0 -5
  456. package/views/3d/webgl-engine/shaders/HighlightTechniqueConfiguration.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{webSceneRendererTypes as r}from"../renderers/support/types.js";import s from"../request.js";import o from"../core/Collection.js";import i from"../core/Error.js";import a from"../core/Logger.js";import{isSome as n,isNone as p}from"../core/maybe.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{getProperties as h}from"../core/accessorSupport/utils.js";import"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../core/accessorSupport/PropertyOrigin.js";import b from"./Layer.js";import{APIKeyMixin as I}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{SceneService as F,SaveOperationType as O}from"./mixins/SceneService.js";import{zeroCapabilities as T}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as _,legendEnabled as x,popupEnabled as P,screenSizePerspectiveEnabled as A}from"./support/commonProperties.js";import{FeatureReduction as D}from"./support/FeatureReduction.js";import R from"./support/FeatureReductionSelection.js";import{FetchAssociatedFeatureLayer as U}from"./support/FetchAssociatedFeatureLayer.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import Q from"./support/FieldsIndex.js";import{fixRendererFields as N}from"./support/fieldUtils.js";import{I3SNodePageDefinition as k,I3SMaterialDefinition as C,I3STextureSetDefinition as V,I3SGeometryDefinition as G}from"./support/I3SLayerDefinitions.js";import K from"./support/LabelClass.js";import{reader as M}from"./support/labelingInfo.js";import $ from"./support/LayerFloorInfo.js";import{RangeInfo as W}from"./support/RangeInfo.js";import{loadStyleRenderer as z}from"../renderers/support/styleUtils.js";import Z from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{transparencyToOpacity as H}from"../webdoc/support/opacityUtils.js";const J=["3DObject","Point"],X=a.getLogger("esri.layers.SceneLayer"),Y=q();let ee=class extends(F(j(w(L(S(l(I(b)))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new o,this.definitionExpression=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var r,s,o,i;const a=null==(r=this.getFeatureType(null==t?void 0:t.feature))||null==(s=r.domains)?void 0:s[e];return a&&"inherited"!==a.type?a:null!=(o=null==(i=this.getField(e))?void 0:i.domain)?o:null}getFeatureType(e){return e&&n(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return n(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return n(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return n(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new Q(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:k.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return re[this.profile]||"mesh"}set renderer(e){N(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=n(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:T,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsReturnServiceEditsInSourceSpatialReference:i},data:{supportsZ:a,supportsM:p,isVersioned:l,supportsAttachment:d},operations:{supportsEditing:y,supportsUpdate:u,supportsQuery:c,supportsQueryAttachments:f}}=e,h=e.operations.supportsChangeTracking;return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:i,supportsRollbackOnFailure:s,supportsGeometryUpdate:!1,supportsUploadWithItemId:o},data:{supportsAttachment:d,supportsZ:a,supportsM:p,isVersioned:l},operations:{supportsQuery:c,supportsQueryAttachments:f,supportsEditing:y&&h,supportsAdd:!1,supportsDelete:!1,supportsUpdate:u&&h}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}get defaultPopupTemplate(){return n(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return n(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&te[r]?te[r]:(X.error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=n(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d).then((()=>this._fetchService(t))).then((()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t)]))).then((()=>this._validateElevationInfo())).then((()=>this._applyAssociatedLayerOverrides())).then((()=>this._populateFieldUsageInfo())).then((()=>z(this,{origin:"service"},t))).then((()=>N(this.renderer,this.fieldsIndex))).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}createQuery(){const e=new Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(X.error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return B(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return n(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),p(this.associatedLayer))throw new i("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new i("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new i("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const o of this.statisticsInfo)if(o.name===r.name){const e=c(this.parsedUrl.path,o.href);return s(e,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new i("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(O.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(O.SAVE,e)}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");if(await this.load(),p(this.associatedLayer))throw new i(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),r.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&-1===J.indexOf(e.layerType))throw new i("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,s=!1;if(null==e)r=!0,s=!0;else{const o=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,s=o;break;case"vertex-reference-frame":r=!0,s=!o;break;default:r=!1}}if(!r)throw new i("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!s)throw new i("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new i("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!(n(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some((t=>t&&e.name===t.name))),s={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=s}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(p(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(p(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=h(this);for(let r=0;r<e.length;r++){const s=e[r],o=this.originIdOf(s),i=this.associatedLayer.originIdOf(s);o<i&&(i===v.SERVICE||i===v.PORTAL_ITEM)&&t.setAtOrigin(s,this.associatedLayer[s],i)}}async _setAssociatedFeatureLayer(e){if(-1===["mesh-pyramids","points"].indexOf(this.profile))return;const t=new U(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(r){y(r)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?X.warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):X.info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"absolute-height"!==e.mode&&X.warn(".elevationInfo=","Mesh scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&X.warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};e([f({types:{key:"type",base:D,typeMap:{selection:R}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ee.prototype,"featureReduction",void 0),e([f({type:[W],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ee.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],ee.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],ee.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],ee.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],ee.prototype,"type",void 0),e([f({...Y.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ee.prototype,"fields",void 0),e([f()],ee.prototype,"types",null),e([f()],ee.prototype,"typeIdField",null),e([f()],ee.prototype,"formTemplate",null),e([f({readOnly:!0})],ee.prototype,"fieldsIndex",null),e([f({type:$,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ee.prototype,"floorInfo",void 0),e([f(Y.outFields)],ee.prototype,"outFields",void 0),e([f({type:k,readOnly:!0,json:{read:!1}})],ee.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],ee.prototype,"readNodePages",null),e([f({type:[C],readOnly:!0})],ee.prototype,"materialDefinitions",void 0),e([f({type:[V],readOnly:!0})],ee.prototype,"textureSetDefinitions",void 0),e([f({type:[G],readOnly:!0})],ee.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],ee.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],ee.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],ee.prototype,"statisticsInfo",void 0),e([f({type:o.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ee.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ee.prototype,"definitionExpression",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ee.prototype,"path",void 0),e([f(E)],ee.prototype,"elevationInfo",null),e([f({type:String})],ee.prototype,"geometryType",null),e([f(_)],ee.prototype,"labelsVisible",void 0),e([f({type:[K],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:M},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:M},write:!0}})],ee.prototype,"labelingInfo",void 0),e([f(x)],ee.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var r,s;if("number"==typeof e&&e>=0&&e<=1)return e;const o=null==(r=t.layerDefinition)||null==(s=r.drawingInfo)?void 0:s.transparency;return void 0!==o?H(o):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ee.prototype,"opacity",void 0),e([f({types:r,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ee.prototype,"renderer",null),e([f({json:{read:!1}})],ee.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],ee.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],ee.prototype,"editingEnabled",null),e([f(P)],ee.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:!0}})],ee.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"defaultPopupTemplate",null),e([f({type:String,json:{read:!1}})],ee.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],ee.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],ee.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],ee.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],ee.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ee.prototype,"normalReferenceFrame",void 0),e([f(A)],ee.prototype,"screenSizePerspectiveEnabled",void 0),ee=e([g("esri.layers.SceneLayer")],ee);const te={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},re={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},se=ee;export{se as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{webSceneRendererTypes as r}from"../renderers/support/types.js";import s from"../request.js";import o from"../core/Collection.js";import i from"../core/Error.js";import a from"../core/Logger.js";import{isSome as n,isNone as p}from"../core/maybe.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as y}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{join as c}from"../core/urlUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{getProperties as h}from"../core/accessorSupport/utils.js";import"../core/accessorSupport/ensureType.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as g}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as v}from"../core/accessorSupport/PropertyOrigin.js";import b from"./Layer.js";import{APIKeyMixin as I}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import{SceneService as F,SaveOperationType as O}from"./mixins/SceneService.js";import{zeroCapabilities as T}from"./support/capabilities.js";import{elevationInfo as E,labelsVisible as _,legendEnabled as P,popupEnabled as x,screenSizePerspectiveEnabled as A}from"./support/commonProperties.js";import{FeatureReduction as D}from"./support/FeatureReduction.js";import R from"./support/FeatureReductionSelection.js";import{FetchAssociatedFeatureLayer as U}from"./support/FetchAssociatedFeatureLayer.js";import{defineFieldProperties as q}from"./support/fieldProperties.js";import Q from"./support/FieldsIndex.js";import{fixRendererFields as N}from"./support/fieldUtils.js";import{I3SNodePageDefinition as k,I3SMaterialDefinition as C,I3STextureSetDefinition as V,I3SGeometryDefinition as G}from"./support/I3SLayerDefinitions.js";import K from"./support/LabelClass.js";import{reader as M}from"./support/labelingInfo.js";import $ from"./support/LayerFloorInfo.js";import{RangeInfo as W}from"./support/RangeInfo.js";import{loadStyleRenderer as z}from"../renderers/support/styleUtils.js";import Z from"../rest/support/Query.js";import{createPopupTemplate as B}from"../support/popupUtils.js";import{transparencyToOpacity as H}from"../webdoc/support/opacityUtils.js";const J=["3DObject","Point"],X=a.getLogger("esri.layers.SceneLayer"),Y=q();let ee=class extends(F(j(w(L(S(l(I(b)))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new o,this.definitionExpression=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var r,s,o,i;const a=null==(r=this.getFeatureType(null==t?void 0:t.feature))||null==(s=r.domains)?void 0:s[e];return a&&"inherited"!==a.type?a:null!=(o=null==(i=this.getField(e))?void 0:i.domain)?o:null}getFeatureType(e){return e&&n(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){return n(this.associatedLayer)?this.associatedLayer.types:[]}get typeIdField(){return n(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return n(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new Q(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:k.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return re[this.profile]||"mesh"}set renderer(e){N(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){const e=n(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:T,{query:t,editing:{supportsGlobalId:r,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsReturnServiceEditsInSourceSpatialReference:i},data:{supportsZ:a,supportsM:p,isVersioned:l,supportsAttachment:d},operations:{supportsEditing:y,supportsUpdate:u,supportsQuery:c,supportsQueryAttachments:f}}=e,h=e.operations.supportsChangeTracking;return{query:t,editing:{supportsGlobalId:r,supportsReturnServiceEditsInSourceSpatialReference:i,supportsRollbackOnFailure:s,supportsGeometryUpdate:!1,supportsUploadWithItemId:o},data:{supportsAttachment:d,supportsZ:a,supportsM:p,isVersioned:l},operations:{supportsQuery:c,supportsQueryAttachments:f,supportsEditing:y&&h,supportsAdd:!1,supportsDelete:!1,supportsUpdate:u&&h}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){null!=e?this._override("editingEnabled",e):this._clearOverride("editingEnabled")}get defaultPopupTemplate(){return n(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return n(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const r=t.store.profile;return null!=r&&te[r]?te[r]:(X.error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}load(e){const t=n(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d).then((()=>this._fetchService(t))).then((()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t)]))).then((()=>this._validateElevationInfo())).then((()=>this._applyAssociatedLayerOverrides())).then((()=>this._populateFieldUsageInfo())).then((()=>z(this,{origin:"service"},t))).then((()=>N(this.renderer,this.fieldsIndex))).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}createQuery(){const e=new Z;return"mesh"!==this.geometryType&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(X.error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return B(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return n(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),p(this.associatedLayer))throw new i("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new i("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new i("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const r=this.fieldsIndex.get(e);if(!r)throw new i("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const o of this.statisticsInfo)if(o.name===r.name){const e=c(this.parsedUrl.path,o.href);return s(e,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then((e=>e.data))}throw new i("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(O.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(O.SAVE,e)}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");if(await this.load(),p(this.associatedLayer))throw new i(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),r.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!J.includes(e.layerType))throw new i("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new i("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new i("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,s=!1;if(null==e)r=!0,s=!0;else{const o=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,s=o;break;case"vertex-reference-frame":r=!0,s=!o;break;default:r=!1}}if(!r)throw new i("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!s)throw new i("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new i("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some((t=>t.name===e.name))),r=!!(n(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some((t=>t&&e.name===t.name))),s={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=s}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(p(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(p(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=h(this);for(let r=0;r<e.length;r++){const s=e[r],o=this.originIdOf(s),i=this.associatedLayer.originIdOf(s);o<i&&(i===v.SERVICE||i===v.PORTAL_ITEM)&&t.setAtOrigin(s,this.associatedLayer[s],i)}}async _setAssociatedFeatureLayer(e){if(!["mesh-pyramids","points"].includes(this.profile))return;const t=new U(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedLayer=await t.fetch()}catch(r){y(r)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?X.warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):X.info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&("mesh-pyramids"===this.profile&&"absolute-height"!==e.mode&&X.warn(".elevationInfo=","Mesh scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&"0"!==e.featureExpressionInfo.expression&&X.warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};e([f({types:{key:"type",base:D,typeMap:{selection:R}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],ee.prototype,"featureReduction",void 0),e([f({type:[W],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],ee.prototype,"rangeInfos",void 0),e([f({json:{read:!1}})],ee.prototype,"associatedLayer",void 0),e([f({type:["show","hide"]})],ee.prototype,"listMode",void 0),e([f({type:["ArcGISSceneServiceLayer"]})],ee.prototype,"operationalLayerType",void 0),e([f({json:{read:!1},readOnly:!0})],ee.prototype,"type",void 0),e([f({...Y.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],ee.prototype,"fields",void 0),e([f()],ee.prototype,"types",null),e([f()],ee.prototype,"typeIdField",null),e([f()],ee.prototype,"formTemplate",null),e([f({readOnly:!0})],ee.prototype,"fieldsIndex",null),e([f({type:$,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],ee.prototype,"floorInfo",void 0),e([f(Y.outFields)],ee.prototype,"outFields",void 0),e([f({type:k,readOnly:!0,json:{read:!1}})],ee.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],ee.prototype,"readNodePages",null),e([f({type:[C],readOnly:!0})],ee.prototype,"materialDefinitions",void 0),e([f({type:[V],readOnly:!0})],ee.prototype,"textureSetDefinitions",void 0),e([f({type:[G],readOnly:!0})],ee.prototype,"geometryDefinitions",void 0),e([f({readOnly:!0})],ee.prototype,"serviceUpdateTimeStamp",void 0),e([f({readOnly:!0})],ee.prototype,"attributeStorageInfo",void 0),e([f({readOnly:!0})],ee.prototype,"statisticsInfo",void 0),e([f({type:o.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],ee.prototype,"excludeObjectIds",void 0),e([f({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],ee.prototype,"definitionExpression",void 0),e([f({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ee.prototype,"path",void 0),e([f(E)],ee.prototype,"elevationInfo",null),e([f({type:String})],ee.prototype,"geometryType",null),e([f(_)],ee.prototype,"labelsVisible",void 0),e([f({type:[K],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:M},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:M},write:!0}})],ee.prototype,"labelingInfo",void 0),e([f(P)],ee.prototype,"legendEnabled",void 0),e([f({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var r,s;if("number"==typeof e&&e>=0&&e<=1)return e;const o=null==(r=t.layerDefinition)||null==(s=r.drawingInfo)?void 0:s.transparency;return void 0!==o?H(o):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],ee.prototype,"opacity",void 0),e([f({types:r,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],ee.prototype,"renderer",null),e([f({json:{read:!1}})],ee.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],ee.prototype,"readCachedDrawingInfo",null),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"capabilities",null),e([f({type:Boolean,json:{read:!1}})],ee.prototype,"editingEnabled",null),e([f(x)],ee.prototype,"popupEnabled",void 0),e([f({type:t,json:{name:"popupInfo",write:!0}})],ee.prototype,"popupTemplate",void 0),e([f({readOnly:!0,json:{read:!1}})],ee.prototype,"defaultPopupTemplate",null),e([f({type:String,json:{read:!1}})],ee.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],ee.prototype,"readObjectIdField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],ee.prototype,"readGlobalIdField",null),e([f({readOnly:!0,type:String,json:{read:!1}})],ee.prototype,"displayField",null),e([f({type:String,json:{read:!1}})],ee.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],ee.prototype,"readProfile",null),e([f({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],ee.prototype,"normalReferenceFrame",void 0),e([f(A)],ee.prototype,"screenSizePerspectiveEnabled",void 0),ee=e([g("esri.layers.SceneLayer")],ee);const te={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},re={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},se=ee;export{se as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import t from"../renderers/SimpleRenderer.js";import r from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as o,webSceneRendererTypes as s}from"../renderers/support/types.js";import a from"../request.js";import{symbolTypes as n,symbolTypesRenderer as l}from"../symbols.js";import p from"../core/Collection.js";import u from"../core/Error.js";import{HandleOwnerMixin as d}from"../core/HandleOwner.js";import c from"../core/Handles.js";import y from"../core/has.js";import{JSONMap as h}from"../core/jsonMap.js";import m from"../core/Logger.js";import{destroyMaybe as f,isSome as b,unwrapOr as g}from"../core/maybe.js";import{MultiOriginJSONMixin as v}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as w}from"../core/object.js";import{throwIfAbortError as S,throwIfAborted as I}from"../core/promiseUtils.js";import{parseWhereClause as F}from"../core/sql.js";import{urlToObject as j,join as E}from"../core/urlUtils.js";import{property as x}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as D}from"../core/accessorSupport/decorators/cast.js";import{reader as C}from"../core/accessorSupport/decorators/reader.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{writer as R}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as A}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import T from"../form/FormTemplate.js";import O from"../geometry/Extent.js";import L from"../geometry/HeightModelInfo.js";import _ from"../geometry/SpatialReference.js";import P from"./Layer.js";import{MemorySource as Q}from"./graphics/sources/MemorySource.js";import{ArcGISService as q}from"./mixins/ArcGISService.js";import{BlendLayer as G}from"./mixins/BlendLayer.js";import{CustomParametersMixin as U}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as V}from"./mixins/OperationalLayer.js";import{PortalLayer as B}from"./mixins/PortalLayer.js";import{RefreshableLayer as z}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as N}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as k,parse as $,cleanTitle as Z,sanitizeUrlWithLayerId as H,writeUrlWithLayerId as J,isHostedAgolService as K}from"./support/arcgisLayerUrl.js";import{elevationInfo as X,id as Y,opacityDrawingInfo as ee,legendEnabled as te,minScale as re,maxScale as ie,screenSizePerspectiveEnabled as oe,url as se}from"./support/commonProperties.js";import{FeatureIndex as ae}from"./support/FeatureIndex.js";import{featureReductionProperty as ne}from"./support/featureReductionUtils.js";import{defineFieldProperties as le}from"./support/fieldProperties.js";import{fixRendererFields as pe,fixTimeInfoFields as ue}from"./support/fieldUtils.js";import de from"./support/GeometryFieldsInfo.js";import ce from"./support/LayerFloorInfo.js";import ye from"./support/Relationship.js";import he from"./support/SubtypeSublayer.js";import me from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as fe}from"./support/versionUtils.js";import{DataLayerSource as be}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as ge}from"../renderers/support/styleUtils.js";import ve from"../rest/support/AttachmentQuery.js";import we from"../rest/support/FeatureSet.js";import Se from"../rest/support/Query.js";import Ie from"../rest/support/RelationshipQuery.js";const Fe=new h({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),je={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},Ee="SubtypeGroupLayer",xe=m.getLogger("esri.layers.SubtypeGroupLayer");function De(e){return e&&e instanceof p}function Ce(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function Me(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function Re(e){var t;const r=null==e||null==(t=e.supportedSpatialAggregationStatistics)?void 0:t.map((e=>e.toLowerCase()));return{envelope:!(null==r||!r.includes("envelopeaggregate")),centroid:!(null==r||!r.includes("centroidaggregate")),convexHull:!(null==r||!r.includes("convexhullaggregate"))}}const Ae=le();function Te(e,t,r){const i=!(null==r||!r.writeLayerSchema);return{enabled:i,ignoreOrigin:i}}let Oe=class extends(G(W(N(z(q(V(B(v(U(d(P))))))))))){constructor(...e){super(...e),this._handles=new c,this.capabilities=null,this.charts=null,this.copyright=null,this.displayField=null,this.definitionExpression=null,this.dynamicDataSource=null,this.editFieldsInfo=null,this.editingEnabled=!0,this.editingInfo=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.formTemplate=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.legendEnabled=!0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.outFields=null,this.path=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.screenSizePerspectiveEnabled=!0,this.serviceDefinitionExpression=null,this.spatialReference=_.WGS84,this.subtypeField=null,this.sublayers=new(p.ofType(he)),this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.trackIdField=null,this.type="subtype-group",this.typeIdField=null,this.indexes=new(p.ofType(ae)),this.userIsAdmin=!1,this.version=void 0,this.visible=!0,this._handles.add(this.watch("sublayers",((e,t)=>this._handleSublayersChange(e,t)),!0))}destroy(){var e;null==(e=this.source)||e.destroy(),this._handles=f(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=b(e)?e.signal:null;if(this.portalItem&&this.portalItem.loaded&&this.source)return void this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this._initLayerProperties(e))));const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(S).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new u("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,{attachment:this._readAttachmentCapabilities(t.attachmentProperties),data:this._readDataCapabilities(t),metadata:this._readMetadataCapabilities(t),operations:this._readOperationsCapabilities(t.capabilities||e,t),query:this._readQueryCapabilities(t),queryRelated:this._readQueryRelatedCapabilities(t),editing:this._readEditingCapabilities(t)}}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")||0)+1}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}readIsTable(e,t){return"Table"===(t=t&&t.layerDefinition||t).type||!t.geometryType}writeIsTable(e,t,r,i){null!=i&&i.writeLayerSchema&&w(r,e?"Table":"Feature Layer",t)}readMinScale(e,t){return t.effectiveMinScale||e||0}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeGlobalID"===r.type)return r.name}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeOID"===r.type)return r.name}get parsedUrl(){const e=this.url?j(this.url):null;return null!=e&&(null!=this.dynamicDataSource?e.path=E(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=E(e.path,this.layerId.toString()))),e}set renderer(e){pe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){const a=(o=o.layerDefinition||o).drawingInfo&&o.drawingInfo.renderer||void 0;if(a){const e=i(a,o,s)||void 0;return e||xe.error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),e}if(o.defaultSymbol)return o.types&&o.types.length?new r({defaultSymbol:Le(o.defaultSymbol,o,s),field:o.typeIdField,uniqueValueInfos:o.types.map((e=>({id:e.id,symbol:Le(e.symbol,e,s)})))}):new t({symbol:Le(o.defaultSymbol,o,s)})}set source(e){const t=this._get("source");t!==e&&(De(t)&&this._resetMemorySource(t),De(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof p?new Q({layer:this,items:e}):e:null}readSource(e,t){const r=we.fromJSON(t.featureSet);return new Q({layer:this,items:r&&r.features||[]})}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readTitle(e,t){const r=t.layerDefinition&&t.layerDefinition.name||t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const e=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return this.url?k(this.url,r):r;let t=r;if(!t&&this.url){const e=$(this.url);b(e)&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),Z(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}set url(e){const t=H({layer:this,url:e,nonStandardUrlAllowed:!0,logger:xe});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){J(this,e,null,t,i)}readVersion(e,t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}readVisible(e,t){return t.layerDefinition&&null!=t.layerDefinition.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}addAttachment(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("addAttachment"in this.source))throw new u(Ee,"Layer source does not support addAttachment capability");return this.source.addAttachment(e,t)}))}updateAttachment(e,t,r){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("updateAttachment"in this.source))throw new u(Ee,"Layer source does not support updateAttachment capability");return this.source.updateAttachment(e,t,r)}))}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");return await this.load(),r.applyEdits(this,this.source,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){if(this._hasMemorySource())return this.emit("graphics-source-create",{graphicsSource:this.source}),this.source.load({signal:e});const t=await import("./graphics/sources/FeatureLayerSource.js");I(e);const r=await new t.default({layer:this}).load({signal:e});return this.emit("graphics-source-create",{graphicsSource:r}),r}createQuery(){const e=new Se,t=this.get("capabilities.data"),r=this.get("capabilities.query"),i=this.sublayers.map((e=>e.subtypeCode));e.dynamicDataSource=this.dynamicDataSource,e.gdbVersion=this.gdbVersion,e.historicMoment=this.historicMoment,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),t&&(t.supportsZ&&null!=this.returnZ&&(e.returnZ=this.returnZ),t.supportsM&&null!=this.returnM&&(e.returnM=this.returnM)),e.outFields=["*"],e.where=`${this.subtypeField} IN (${i.join(",")})`,this.definitionExpression&&(e.where+=` AND (${this.definitionExpression})`);const{timeOffset:o,timeExtent:s}=this;return e.timeExtent=null!=o&&null!=s?s.offset(-o.value,o.unit):s||null,e.multipatchOption="multipatch"===this.geometryType?"xyFootprint":null,e}deleteAttachments(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("deleteAttachments"in this.source))throw new u(Ee,"Layer source does not support deleteAttachments capability");return this.source.deleteAttachments(e,t)}))}fetchRecomputedExtents(e){return this.load({signal:null==e?void 0:e.signal}).then((()=>{if(this.source.fetchRecomputedExtents)return this.source.fetchRecomputedExtents(e);throw new u(Ee,"Layer source does not support fetchUpdates capability")}))}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}queryAttachments(e,t){return e=ve.from(e),this.load().then((()=>{if(!this.get("capabilities.data.supportsAttachment"))throw new u(Ee,"this layer doesn't support attachments");const{attachmentTypes:t,objectIds:r,globalIds:i,num:o,size:s,start:a,where:n}=e;if(!this.get("capabilities.operations.supportsQueryAttachments")){const l=r&&r.length>1,p=t&&t.length,d=i&&i.length,c=s&&s.length;if(l||p||d||c||o||a||n)throw new u(Ee,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",e)}if(!(r&&r.length||n))throw new u(Ee,"'objectIds' or 'where' are required to perform attachment query",e);if(!("queryAttachments"in this.source))throw new u(Ee,"Layer source does not support queryAttachments capability",e);return this.source.queryAttachments(e)}))}queryFeatures(e,t){const r=Se.from(e)||this.createQuery(),i=g(r.outFields,[]);return i.find((e=>e===this.subtypeField))||(i.push(this.subtypeField),r.outFields=i),this.load().then((()=>this.source.queryFeatures(r,t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=this._findSublayerForFeature(t),t.sourceLayer=this;return e}))}_findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.sublayers.find((e=>e.subtypeCode===r))}queryObjectIds(e,t){return this.load().then((()=>{if(this.source.queryObjectIds)return this.source.queryObjectIds(Se.from(e)||this.createQuery(),t);throw new u(Ee,"Layer source does not support queryObjectIds capability")}))}queryFeatureCount(e,t){return this.load().then((()=>{if(this.source.queryFeatureCount)return this.source.queryFeatureCount(Se.from(e)||this.createQuery(),t);throw new u(Ee,"Layer source does not support queryFeatureCount capability")}))}queryExtent(e,t){return this.load().then((()=>{if(this.source.queryExtent)return this.source.queryExtent(Se.from(e)||this.createQuery(),t);throw new u(Ee,"Layer source does not support queryExtent capability")}))}queryRelatedFeatures(e,t){return this.load().then((()=>{if("queryRelatedFeatures"in this.source)return this.source.queryRelatedFeatures(Ie.from(e),t);throw new u(Ee,"Layer source does not support queryRelatedFeatures capability")}))}queryRelatedFeaturesCount(e,t){return this.load().then((()=>{if("queryRelatedFeaturesCount"in this.source)return this.source.queryRelatedFeaturesCount(Ie.from(e),t);throw new u(Ee,"Layer source does not support queryRelatedFeaturesCount capability")}))}read(e,t){const r=e.featureCollection;if(r){const e=r.layers;e&&1===e.length&&(super.read(e[0],t),null!=r.showLegend&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&this.revert(["objectIdField","fields","timeInfo","spatialReference"],"service")}write(e,t){var r,i;const o=(t={...t,writeLayerSchema:null!=(r=null==(i=t)?void 0:i.writeLayerSchema)?r:this._hasMemorySource()}).origin,s=t.layerContainerType,a=t.messages;if(this.isTable){if("web-scene"===o||"web-map"===o&&"tables"!==s)return a&&a.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Table source cannot be written to web scenes and web maps`,{layer:this})),null;if(this._hasMemorySource())return a&&a.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using an in-memory Table source cannot be written to web scenes and web maps`,{layer:this})),null}else if(this.loaded&&"web-map"===o&&"tables"===s)return a&&a.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a non-table source cannot be written to tables in web maps`,{layer:this})),null;return super.write(e,t)}serviceSupportsSpatialReference(e){return fe(this,e)}_readEditingEnabled(e,t,r){var i;let o=null==(i=e.layerDefinition)?void 0:i.capabilities;return o?this._hasEditingCapability(o):(o=e.capabilities,!(t&&"web-map"===(null==r?void 0:r.origin)&&!this._hasMemorySource()&&o)||this._hasEditingCapability(o))}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){var o,s;const e=null!=(o=this.capabilities)&&null!=(s=o.operations)&&s.supportsSync?"Query,Sync":"Query";w("layerDefinition.capabilities",e,t),!r||null!=i&&i.writeLayerSchema||(t.capabilities=e)}}_checkAttachmentSupport(e){const{attributes:t}=e,{objectIdField:r}=this;return this.get("capabilities.data.supportsAttachment")?e?t?t[r]?void 0:Promise.reject(new u(Ee,`feature is missing the identifying attribute ${r}`)):Promise.reject(new u(Ee,"'attributes' are required on a feature to query attachments")):Promise.reject(new u(Ee,"A feature is required to add/delete/update attachments")):Promise.reject(new u(Ee,"this layer doesn't support attachments"))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return a(this.url,{query:{f:"json",...this.customParameters},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return Array.isArray(t.layers)&&t.layers.length>0?t.layers[0].id:Array.isArray(t.tables)&&t.tables.length>0?t.tables[0].id:void 0}))}async _initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",url:this.parsedUrl})),this._verifySource(),this._verifyFields(),pe(this.renderer,this.fieldsIndex),ue(this.timeInfo,this.fieldsIndex),ge(this,{origin:"service"})}async hasDataChanged(){var e;if(null!=(e=this.source)&&e.refresh)try{var t;const{dataChanged:e,updates:r}=await(null==(t=this.source)?void 0:t.refresh());if(b(r)&&(this.sourceJSON={...this.sourceJSON,...r},this.read(r,{origin:"service",url:this.parsedUrl})),e)return!0}catch{}if(this.definitionExpression)try{return(await F(this.definitionExpression,this.fieldsIndex)).hasDateFunctions}catch{}return!1}_verifyFields(){const e=this.parsedUrl&&this.parsedUrl.path||"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields&&this.fields.some((function(e){return"geometry"===e.type}))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new u("feature-layer:mixed-source-and-url","SubtypeGroupLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new u("feature-layer:source-or-url-required","SubtypeGroupLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._handles.add([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}_readAttachmentCapabilities(e){const t={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1};return e&&Array.isArray(e)&&e.forEach((e=>{const r=je[e.name];r&&(t[r]=!!e.isEnabled)})),t}_readDataCapabilities(e){return{isVersioned:Ce(e,"isDataVersioned",!1),supportsAttachment:Ce(e,"hasAttachments",!1),supportsM:Ce(e,"hasM",!1),supportsZ:Ce(e,"hasZ",!1)}}_readMetadataCapabilities(e){return{supportsAdvancedFieldProperties:Ce(e,"supportsFieldDescriptionProperty",!1)}}_readOperationsCapabilities(e,t){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=-1!==r.indexOf("editing");let o=i&&-1!==r.indexOf("create"),s=i&&-1!==r.indexOf("delete"),a=i&&-1!==r.indexOf("update");const n=-1!==r.indexOf("changetracking");return i&&!(o||s||a)&&(o=s=a=!0),{supportsCalculate:Ce(t,"supportsCalculate",!1),supportsTruncate:Ce(t,"supportsTruncate",!1),supportsValidateSql:Ce(t,"supportsValidateSql",!1),supportsAdd:o,supportsDelete:s,supportsEditing:i,supportsChangeTracking:n,supportsQuery:-1!==r.indexOf("query"),supportsQueryAttachments:Ce(t.advancedQueryCapabilities,"supportsQueryAttachments",!1),supportsResizeAttachments:Ce(t,"supportsAttachmentsResizing",!1),supportsSync:-1!==r.indexOf("sync"),supportsUpdate:a,supportsExceedsLimitStatistics:Ce(t,"supportsExceedsLimitStatistics",!1)}}_readQueryCapabilities(e){var t;const r=e.advancedQueryCapabilities,i=e.ownershipBasedAccessControlForFeatures,o=e.archivingInfo,s=null==(t=this.url)?void 0:t.includes("MapServer"),a=!y("mapserver-pbf-enabled")&&s&&this.version<10.81,n=K(this.url),l=(e.supportedQueryFormats||"").split(",").reduce(((e,t)=>{const r=t.toLowerCase().trim();return r&&e.add(r),e}),new Set);return{supportsStatistics:Ce(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:Ce(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:Ce(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Re(r),supportsCentroid:Ce(r,"supportsReturningGeometryCentroid",!1),supportsDistance:Ce(r,"supportsQueryWithDistance",!1),supportsDistinct:Ce(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:Ce(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:Ce(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:Ce(r,"supportsHavingClause",!1),supportsOrderBy:Ce(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:Ce(r,"supportsPagination",!1),supportsQuantization:Ce(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:Ce(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:Ce(e,"supportsReturningQueryGeometry",!1),supportsResultType:Ce(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:Ce(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:Ce(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:Ce(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:Ce(r,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:Ce(i,"allowOthersToQuery",!0),supportsHistoricMoment:Ce(o,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!a&&l.has("pbf"),supportsDisjointSpatialRelationship:Ce(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:Ce(r,"supportsQueryWithCacheHint",!1),supportsDefaultSpatialReference:Ce(r,"supportsDefaultSR",!1),supportsCompactGeometry:n,maxRecordCountFactor:Me(e,"maxRecordCountFactor",void 0),maxRecordCount:Me(e,"maxRecordCount",void 0),standardMaxRecordCount:Me(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Me(e,"tileMaxRecordCount",void 0)}}_readQueryRelatedCapabilities(e){const t=e.advancedQueryCapabilities,r=Ce(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:Ce(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r}}_readEditingCapabilities(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:Ce(e,"allowGeometryUpdates",!0),supportsGlobalId:Ce(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:Ce(e,"supportsReturnServiceEditsInSourceSpatialReference",!1),supportsRollbackOnFailure:Ce(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:Ce(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:Ce(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:Ce(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:Ce(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:Ce(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:Ce(t,"allowOthersToUpdate",!0)}}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.handles.remove("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}};e([x({readOnly:!0,json:{read:!1}})],Oe.prototype,"capabilities",void 0),e([C("service","capabilities",["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"])],Oe.prototype,"readCapabilities",null),e([x({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Oe.prototype,"charts",void 0),e([x({readOnly:!0})],Oe.prototype,"createQueryVersion",null),e([x({type:String,json:{read:{source:"layerDefinition.copyrightText"},origins:{service:{read:{source:"copyrightText"}}}}})],Oe.prototype,"copyright",void 0),e([x({type:String,json:{read:{source:"layerDefinition.displayField"},origins:{service:{read:{source:"displayField"}}}}})],Oe.prototype,"displayField",void 0),e([x({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Oe.prototype,"definitionExpression",void 0),e([x({types:n,readOnly:!0})],Oe.prototype,"defaultSymbol",void 0),e([x({type:be})],Oe.prototype,"dynamicDataSource",void 0),e([x({readOnly:!0})],Oe.prototype,"editFieldsInfo",void 0),e([x({type:Boolean})],Oe.prototype,"editingEnabled",void 0),e([C(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Oe.prototype,"readEditingEnabled",null),e([C("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Oe.prototype,"readEditingEnabledFromWebMap",null),e([R(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Oe.prototype,"writeEditingEnabled",null),e([R("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Oe.prototype,"writeEditingEnabledToWebMap",null),e([x({readOnly:!0})],Oe.prototype,"editingInfo",void 0),e([C("editingInfo")],Oe.prototype,"readEditingInfo",null),e([x(X)],Oe.prototype,"elevationInfo",void 0),e([x(ne)],Oe.prototype,"featureReduction",void 0),e([x({...Ae.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{read:!0},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Te}}}}})],Oe.prototype,"fields",void 0),e([x(Ae.fieldsIndex)],Oe.prototype,"fieldsIndex",void 0),e([x({type:ce,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"},origins:{"web-scene":{write:!1}}}})],Oe.prototype,"floorInfo",void 0),e([x({type:T,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Oe.prototype,"formTemplate",void 0),e([x({type:O,json:{origins:{service:{read:{source:"extent"}}},read:{source:"layerDefinition.extent"}}})],Oe.prototype,"fullExtent",void 0),e([x()],Oe.prototype,"gdbVersion",void 0),e([x({readOnly:!0,type:de,json:{read:{source:"geometryProperties"}}})],Oe.prototype,"geometryFieldsInfo",void 0),e([x({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:Fe.read},"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Te,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&w(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Oe.prototype,"geometryType",void 0),e([x({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasM"}}})],Oe.prototype,"hasM",void 0),e([x({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasZ"}}})],Oe.prototype,"hasZ",void 0),e([x({readOnly:!0,type:L})],Oe.prototype,"heightModelInfo",void 0),e([x({type:Date})],Oe.prototype,"historicMoment",void 0),e([x(Y)],Oe.prototype,"id",void 0),e([x({readOnly:!0,json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Oe.prototype,"isTable",void 0),e([C("service","isTable",["type","geometryType"]),C("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Oe.prototype,"readIsTable",null),e([R("web-map","isTable")],Oe.prototype,"writeIsTable",null),e([x(ee)],Oe.prototype,"opacity",void 0),e([x({type:Number,json:{origins:{service:{read:{source:"id"}}},read:!1}})],Oe.prototype,"layerId",void 0),e([x(te)],Oe.prototype,"legendEnabled",void 0),e([x({type:["show","hide"]})],Oe.prototype,"listMode",void 0),e([x(re)],Oe.prototype,"minScale",void 0),e([C("service","minScale",["minScale","effectiveMinScale"])],Oe.prototype,"readMinScale",null),e([x(ie)],Oe.prototype,"maxScale",void 0),e([C("service","maxScale",["maxScale","effectiveMaxScale"])],Oe.prototype,"readMaxScale",null),e([x({type:String})],Oe.prototype,"globalIdField",void 0),e([C("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"]),C("service","globalIdField",["globalIdField","fields"])],Oe.prototype,"readGlobalIdFieldFromService",null),e([x({type:String,json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Te}}}}})],Oe.prototype,"objectIdField",void 0),e([C("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"]),C("service","objectIdField",["objectIdField","fields"])],Oe.prototype,"readObjectIdFieldFromService",null),e([x({value:"ArcGISSubtypeGroupLayer",type:["ArcGISSubtypeGroupLayer"]})],Oe.prototype,"operationalLayerType",void 0),e([x(Ae.outFields)],Oe.prototype,"outFields",void 0),e([x({readOnly:!0})],Oe.prototype,"parsedUrl",null),e([x({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Oe.prototype,"path",void 0),e([x({type:[ye],readOnly:!0})],Oe.prototype,"relationships",void 0),e([x({types:o,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:s,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:null==r?void 0:r.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:null==r?void 0:r.writeLayerSchema})}}})],Oe.prototype,"renderer",null),e([C("service","renderer",["drawingInfo.renderer","defaultSymbol"]),C("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Oe.prototype,"readRenderer",null),e([x()],Oe.prototype,"sourceJSON",void 0),e([x({type:Boolean})],Oe.prototype,"returnM",void 0),e([x({type:Boolean})],Oe.prototype,"returnZ",void 0),e([x(oe)],Oe.prototype,"screenSizePerspectiveEnabled",void 0),e([x()],Oe.prototype,"source",null),e([D("source")],Oe.prototype,"castSource",null),e([C("portal-item","source",["featureSet"]),C("web-map","source",["featureSet"])],Oe.prototype,"readSource",null),e([x({readOnly:!0})],Oe.prototype,"serviceDefinitionExpression",void 0),e([C("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Oe.prototype,"readServiceDefinitionExpression",null),e([x({type:_,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:{source:"layerDefinition.extent.spatialReference"}}})],Oe.prototype,"spatialReference",void 0),e([x({type:String})],Oe.prototype,"subtypeField",void 0),e([x({type:p.ofType(he),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const o=e.map((e=>new he({subtypeCode:e.code,renderer:i(t.drawingInfo.renderer,t,r),title:e.name})));return new(p.ofType(he))(o)}}}}}})],Oe.prototype,"sublayers",void 0),e([x({type:me})],Oe.prototype,"timeInfo",void 0),e([x()],Oe.prototype,"title",void 0),e([C("service","title",["name"]),C("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Oe.prototype,"readTitle",null),e([C("web-map","title",["layerDefinition.name","title"])],Oe.prototype,"readTitleFromWebMap",null),e([x({type:String})],Oe.prototype,"sublayerTitleMode",void 0),e([x({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Oe.prototype,"trackIdField",void 0),e([x({json:{read:!1}})],Oe.prototype,"type",void 0),e([x({type:String})],Oe.prototype,"typeIdField",void 0),e([C("service","typeIdField"),C("typeIdField",["layerDefinition.typeIdField"])],Oe.prototype,"readTypeIdField",null),e([x({readOnly:!0,json:{write:!1}})],Oe.prototype,"serverGens",void 0),e([x({type:p.ofType(ae),readOnly:!0})],Oe.prototype,"indexes",void 0),e([x(se)],Oe.prototype,"url",null),e([R("url")],Oe.prototype,"writeUrl",null),e([x({readOnly:!0})],Oe.prototype,"userIsAdmin",void 0),e([x({json:{origins:{service:{read:!0}},read:!1}})],Oe.prototype,"version",void 0),e([C("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Oe.prototype,"readVersion",null),e([x({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],Oe.prototype,"visible",void 0),e([C("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Oe.prototype,"readVisible",null),Oe=e([M("esri.layers.SubtypeGroupLayer")],Oe);const Le=A({types:l}),_e=Oe;export{_e as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/Renderer.js";import t from"../renderers/SimpleRenderer.js";import r from"../renderers/UniqueValueRenderer.js";import{read as i}from"../renderers/support/jsonUtils.js";import{rendererTypes as o,webSceneRendererTypes as s}from"../renderers/support/types.js";import a from"../request.js";import{symbolTypes as n,symbolTypesRenderer as l}from"../symbols.js";import p from"../core/Collection.js";import u from"../core/Error.js";import{HandleOwnerMixin as d}from"../core/HandleOwner.js";import c from"../core/Handles.js";import y from"../core/has.js";import{JSONMap as h}from"../core/jsonMap.js";import m from"../core/Logger.js";import{destroyMaybe as f,isSome as b,unwrapOr as g}from"../core/maybe.js";import{MultiOriginJSONMixin as v}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as w}from"../core/object.js";import{throwIfAbortError as S,throwIfAborted as I}from"../core/promiseUtils.js";import{parseWhereClause as F}from"../core/sql.js";import{urlToObject as j,join as E}from"../core/urlUtils.js";import{property as D}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import{cast as x}from"../core/accessorSupport/decorators/cast.js";import{reader as C}from"../core/accessorSupport/decorators/reader.js";import{subclass as M}from"../core/accessorSupport/decorators/subclass.js";import{writer as R}from"../core/accessorSupport/decorators/writer.js";import{createTypeReader as A}from"../core/accessorSupport/extensions/serializableProperty/reader.js";import T from"../form/FormTemplate.js";import L from"../geometry/Extent.js";import _ from"../geometry/HeightModelInfo.js";import P from"../geometry/SpatialReference.js";import O from"./Layer.js";import{MemorySource as Q}from"./graphics/sources/MemorySource.js";import{ArcGISService as q}from"./mixins/ArcGISService.js";import{BlendLayer as G}from"./mixins/BlendLayer.js";import{CustomParametersMixin as U}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as V}from"./mixins/OperationalLayer.js";import{PortalLayer as B}from"./mixins/PortalLayer.js";import{RefreshableLayer as z}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as N}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{titleFromUrlAndName as k,parse as $,cleanTitle as Z,sanitizeUrlWithLayerId as H,writeUrlWithLayerId as J,isHostedAgolService as K}from"./support/arcgisLayerUrl.js";import{elevationInfo as X,id as Y,opacityDrawingInfo as ee,legendEnabled as te,minScale as re,maxScale as ie,screenSizePerspectiveEnabled as oe,url as se}from"./support/commonProperties.js";import{FeatureIndex as ae}from"./support/FeatureIndex.js";import{featureReductionProperty as ne}from"./support/featureReductionUtils.js";import{defineFieldProperties as le}from"./support/fieldProperties.js";import{fixRendererFields as pe,fixTimeInfoFields as ue}from"./support/fieldUtils.js";import de from"./support/GeometryFieldsInfo.js";import ce from"./support/LayerFloorInfo.js";import ye from"./support/Relationship.js";import he from"./support/SubtypeSublayer.js";import me from"./support/TimeInfo.js";import{serviceSupportsSpatialReference as fe}from"./support/versionUtils.js";import{DataLayerSource as be}from"./support/source/DataLayerSource.js";import{loadStyleRenderer as ge}from"../renderers/support/styleUtils.js";import ve from"../rest/support/AttachmentQuery.js";import we from"../rest/support/FeatureSet.js";import Se from"../rest/support/Query.js";import Ie from"../rest/support/RelationshipQuery.js";const Fe=new h({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),je={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"},Ee="SubtypeGroupLayer",De=m.getLogger("esri.layers.SubtypeGroupLayer");function xe(e){return e&&e instanceof p}function Ce(e,t,r){return!!(e&&e.hasOwnProperty(t)?e[t]:r)}function Me(e,t,r){return e&&e.hasOwnProperty(t)?e[t]:r}function Re(e){var t;const r=null==e||null==(t=e.supportedSpatialAggregationStatistics)?void 0:t.map((e=>e.toLowerCase()));return{envelope:!(null==r||!r.includes("envelopeaggregate")),centroid:!(null==r||!r.includes("centroidaggregate")),convexHull:!(null==r||!r.includes("convexhullaggregate"))}}const Ae=le();function Te(e,t,r){const i=!(null==r||!r.writeLayerSchema);return{enabled:i,ignoreOrigin:i}}let Le=class extends(G(W(N(z(q(V(B(v(U(d(O))))))))))){constructor(...e){super(...e),this._handles=new c,this.capabilities=null,this.charts=null,this.copyright=null,this.displayField=null,this.definitionExpression=null,this.dynamicDataSource=null,this.editFieldsInfo=null,this.editingEnabled=!0,this.editingInfo=null,this.elevationInfo=null,this.featureReduction=null,this.fields=null,this.fieldsIndex=null,this.floorInfo=null,this.formTemplate=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.legendEnabled=!0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.outFields=null,this.path=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.screenSizePerspectiveEnabled=!0,this.serviceDefinitionExpression=null,this.spatialReference=P.WGS84,this.subtypeField=null,this.sublayers=new(p.ofType(he)),this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.trackIdField=null,this.type="subtype-group",this.typeIdField=null,this.indexes=new(p.ofType(ae)),this.userIsAdmin=!1,this.version=void 0,this.visible=!0,this._handles.add(this.watch("sublayers",((e,t)=>this._handleSublayersChange(e,t)),!0))}destroy(){var e;null==(e=this.source)||e.destroy(),this._handles=f(this._handles)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=b(e)?e.signal:null;if(this.portalItem&&this.portalItem.loaded&&this.source)return void this.addResolvingPromise(this.createGraphicsSource(t).then((e=>this._initLayerProperties(e))));const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(S).then((async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new u("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this._initLayerProperties(await this.createGraphicsSource(t))})).then((()=>this.finishLoadEditablePortalLayer(e)));return this.addResolvingPromise(r),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,{attachment:this._readAttachmentCapabilities(t.attachmentProperties),data:this._readDataCapabilities(t),metadata:this._readMetadataCapabilities(t),operations:this._readOperationsCapabilities(t.capabilities||e,t),query:this._readQueryCapabilities(t),queryRelated:this._readQueryRelatedCapabilities(t),editing:this._readEditingCapabilities(t)}}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")||0)+1}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}readIsTable(e,t){return"Table"===(t=t&&t.layerDefinition||t).type||!t.geometryType}writeIsTable(e,t,r,i){null!=i&&i.writeLayerSchema&&w(r,e?"Table":"Feature Layer",t)}readMinScale(e,t){return t.effectiveMinScale||e||0}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readGlobalIdFieldFromService(e,t){if((t=t.layerDefinition||t).globalIdField)return t.globalIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeGlobalID"===r.type)return r.name}readObjectIdFieldFromService(e,t){if((t=t.layerDefinition||t).objectIdField)return t.objectIdField;if(t.fields)for(const r of t.fields)if("esriFieldTypeOID"===r.type)return r.name}get parsedUrl(){const e=this.url?j(this.url):null;return null!=e&&(null!=this.dynamicDataSource?e.path=E(e.path,"dynamicLayer"):null!=this.layerId&&(e.path=E(e.path,this.layerId.toString()))),e}set renderer(e){pe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,o,s){const a=(o=o.layerDefinition||o).drawingInfo&&o.drawingInfo.renderer||void 0;if(a){const e=i(a,o,s)||void 0;return e||De.error("Failed to create renderer",{rendererDefinition:o.drawingInfo.renderer,layer:this,context:s}),e}if(o.defaultSymbol)return o.types&&o.types.length?new r({defaultSymbol:_e(o.defaultSymbol,o,s),field:o.typeIdField,uniqueValueInfos:o.types.map((e=>({id:e.id,symbol:_e(e.symbol,e,s)})))}):new t({symbol:_e(o.defaultSymbol,o,s)})}set source(e){const t=this._get("source");t!==e&&(xe(t)&&this._resetMemorySource(t),xe(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof p?new Q({layer:this,items:e}):e:null}readSource(e,t){const r=we.fromJSON(t.featureSet);return new Q({layer:this,items:r&&r.features||[]})}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readTitle(e,t){const r=t.layerDefinition&&t.layerDefinition.name||t.name,i=t.title||t.layerDefinition&&t.layerDefinition.title;if(r){const e=this.portalItem&&this.portalItem.title;if("item-title"===this.sublayerTitleMode)return this.url?k(this.url,r):r;let t=r;if(!t&&this.url){const e=$(this.url);b(e)&&(t=e.title)}if(!t)return;return"item-title-and-service-name"===this.sublayerTitleMode&&e&&e!==t&&(t=e+" - "+t),Z(t)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find((e=>e.name.toLowerCase()===r));e&&(r=e.name)}return r}set url(e){const t=H({layer:this,url:e,nonStandardUrlAllowed:!0,logger:De});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){J(this,e,null,t,i)}readVersion(e,t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}readVisible(e,t){return t.layerDefinition&&null!=t.layerDefinition.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}addAttachment(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("addAttachment"in this.source))throw new u(Ee,"Layer source does not support addAttachment capability");return this.source.addAttachment(e,t)}))}updateAttachment(e,t,r){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("updateAttachment"in this.source))throw new u(Ee,"Layer source does not support updateAttachment capability");return this.source.updateAttachment(e,t,r)}))}async applyEdits(e,t){const r=await import("./graphics/editingSupport.js");return await this.load(),r.applyEdits(this,this.source,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){if(this._hasMemorySource())return this.emit("graphics-source-create",{graphicsSource:this.source}),this.source.load({signal:e});const t=await import("./graphics/sources/FeatureLayerSource.js");I(e);const r=await new t.default({layer:this}).load({signal:e});return this.emit("graphics-source-create",{graphicsSource:r}),r}createQuery(){const e=new Se,t=this.get("capabilities.data"),r=this.get("capabilities.query"),i=this.sublayers.map((e=>e.subtypeCode));e.dynamicDataSource=this.dynamicDataSource,e.gdbVersion=this.gdbVersion,e.historicMoment=this.historicMoment,e.returnGeometry=!0,r&&(e.compactGeometryEnabled=r.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=r.supportsDefaultSpatialReference),t&&(t.supportsZ&&null!=this.returnZ&&(e.returnZ=this.returnZ),t.supportsM&&null!=this.returnM&&(e.returnM=this.returnM)),e.outFields=["*"],e.where=`${this.subtypeField} IN (${i.join(",")})`,this.definitionExpression&&(e.where+=` AND (${this.definitionExpression})`);const{timeOffset:o,timeExtent:s}=this;return e.timeExtent=null!=o&&null!=s?s.offset(-o.value,o.unit):s||null,e.multipatchOption="multipatch"===this.geometryType?"xyFootprint":null,e}deleteAttachments(e,t){return this.load().then((()=>this._checkAttachmentSupport(e))).then((()=>{if(!("deleteAttachments"in this.source))throw new u(Ee,"Layer source does not support deleteAttachments capability");return this.source.deleteAttachments(e,t)}))}fetchRecomputedExtents(e){return this.load({signal:null==e?void 0:e.signal}).then((()=>{if(this.source.fetchRecomputedExtents)return this.source.fetchRecomputedExtents(e);throw new u(Ee,"Layer source does not support fetchUpdates capability")}))}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}queryAttachments(e,t){return e=ve.from(e),this.load().then((()=>{if(!this.get("capabilities.data.supportsAttachment"))throw new u(Ee,"this layer doesn't support attachments");const{attachmentTypes:t,objectIds:r,globalIds:i,num:o,size:s,start:a,where:n}=e;if(!this.get("capabilities.operations.supportsQueryAttachments")){const l=r&&r.length>1,p=t&&t.length,d=i&&i.length,c=s&&s.length;if(l||p||d||c||o||a||n)throw new u(Ee,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",e)}if(!(r&&r.length||n))throw new u(Ee,"'objectIds' or 'where' are required to perform attachment query",e);if(!("queryAttachments"in this.source))throw new u(Ee,"Layer source does not support queryAttachments capability",e);return this.source.queryAttachments(e)}))}queryFeatures(e,t){const r=Se.from(e)||this.createQuery(),i=g(r.outFields,[]);return i.find((e=>e===this.subtypeField))||(i.push(this.subtypeField),r.outFields=i),this.load().then((()=>this.source.queryFeatures(r,t))).then((e=>{if(null!=e&&e.features)for(const t of e.features)t.layer=this._findSublayerForFeature(t),t.sourceLayer=this;return e}))}_findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.sublayers.find((e=>e.subtypeCode===r))}queryObjectIds(e,t){return this.load().then((()=>{if(this.source.queryObjectIds)return this.source.queryObjectIds(Se.from(e)||this.createQuery(),t);throw new u(Ee,"Layer source does not support queryObjectIds capability")}))}queryFeatureCount(e,t){return this.load().then((()=>{if(this.source.queryFeatureCount)return this.source.queryFeatureCount(Se.from(e)||this.createQuery(),t);throw new u(Ee,"Layer source does not support queryFeatureCount capability")}))}queryExtent(e,t){return this.load().then((()=>{if(this.source.queryExtent)return this.source.queryExtent(Se.from(e)||this.createQuery(),t);throw new u(Ee,"Layer source does not support queryExtent capability")}))}queryRelatedFeatures(e,t){return this.load().then((()=>{if("queryRelatedFeatures"in this.source)return this.source.queryRelatedFeatures(Ie.from(e),t);throw new u(Ee,"Layer source does not support queryRelatedFeatures capability")}))}queryRelatedFeaturesCount(e,t){return this.load().then((()=>{if("queryRelatedFeaturesCount"in this.source)return this.source.queryRelatedFeaturesCount(Ie.from(e),t);throw new u(Ee,"Layer source does not support queryRelatedFeaturesCount capability")}))}read(e,t){const r=e.featureCollection;if(r){const e=r.layers;e&&1===e.length&&(super.read(e[0],t),null!=r.showLegend&&super.read({showLegend:r.showLegend},t))}super.read(e,t),t&&"service"===t.origin&&this.revert(["objectIdField","fields","timeInfo","spatialReference"],"service")}write(e,t){var r,i;const o=(t={...t,writeLayerSchema:null!=(r=null==(i=t)?void 0:i.writeLayerSchema)?r:this._hasMemorySource()}).origin,s=t.layerContainerType,a=t.messages;if(this.isTable){if("web-scene"===o||"web-map"===o&&"tables"!==s)return a&&a.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Table source cannot be written to web scenes and web maps`,{layer:this})),null;if(this._hasMemorySource())return a&&a.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using an in-memory Table source cannot be written to web scenes and web maps`,{layer:this})),null}else if(this.loaded&&"web-map"===o&&"tables"===s)return a&&a.push(new u("layer:unsupported",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a non-table source cannot be written to tables in web maps`,{layer:this})),null;return super.write(e,t)}serviceSupportsSpatialReference(e){return fe(this,e)}_readEditingEnabled(e,t,r){var i;let o=null==(i=e.layerDefinition)?void 0:i.capabilities;return o?this._hasEditingCapability(o):(o=e.capabilities,!(t&&"web-map"===(null==r?void 0:r.origin)&&!this._hasMemorySource()&&o)||this._hasEditingCapability(o))}_hasEditingCapability(e){return e.toLowerCase().split(",").map((e=>e.trim())).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){var o,s;const e=null!=(o=this.capabilities)&&null!=(s=o.operations)&&s.supportsSync?"Query,Sync":"Query";w("layerDefinition.capabilities",e,t),!r||null!=i&&i.writeLayerSchema||(t.capabilities=e)}}_checkAttachmentSupport(e){const{attributes:t}=e,{objectIdField:r}=this;return this.get("capabilities.data.supportsAttachment")?e?t?t[r]?void 0:Promise.reject(new u(Ee,`feature is missing the identifying attribute ${r}`)):Promise.reject(new u(Ee,"'attributes' are required on a feature to query attachments")):Promise.reject(new u(Ee,"A feature is required to add/delete/update attachments")):Promise.reject(new u(Ee,"this layer doesn't support attachments"))}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return a(this.url,{query:{f:"json",...this.customParameters},responseType:"json",signal:e}).then((e=>{const t=e.data;if(t)return Array.isArray(t.layers)&&t.layers.length>0?t.layers[0].id:Array.isArray(t.tables)&&t.tables.length>0?t.tables[0].id:void 0}))}async _initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",url:this.parsedUrl})),this._verifySource(),this._verifyFields(),pe(this.renderer,this.fieldsIndex),ue(this.timeInfo,this.fieldsIndex),ge(this,{origin:"service"})}async hasDataChanged(){var e;if(null!=(e=this.source)&&e.refresh)try{var t;const{dataChanged:e,updates:r}=await(null==(t=this.source)?void 0:t.refresh());if(b(r)&&(this.sourceJSON={...this.sourceJSON,...r},this.read(r,{origin:"service",url:this.parsedUrl})),e)return!0}catch{}if(this.definitionExpression)try{return(await F(this.definitionExpression,this.fieldsIndex)).hasDateFunctions}catch{}return!1}_verifyFields(){const e=this.parsedUrl&&this.parsedUrl.path||"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields&&this.fields.some((function(e){return"geometry"===e.type}))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new u("feature-layer:mixed-source-and-url","SubtypeGroupLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new u("feature-layer:source-or-url-required","SubtypeGroupLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach((e=>{e.layer=this,e.sourceLayer=this})),this._handles.add([e.on("after-add",(e=>{e.item.layer=this,e.item.sourceLayer=this})),e.on("after-remove",(e=>{e.item.layer=null,e.item.sourceLayer=null}))],"fl-source")}_resetMemorySource(e){e.forEach((e=>{e.layer=null,e.sourceLayer=null})),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}_readAttachmentCapabilities(e){const t={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1};return e&&Array.isArray(e)&&e.forEach((e=>{const r=je[e.name];r&&(t[r]=!!e.isEnabled)})),t}_readDataCapabilities(e){return{isVersioned:Ce(e,"isDataVersioned",!1),supportsAttachment:Ce(e,"hasAttachments",!1),supportsM:Ce(e,"hasM",!1),supportsZ:Ce(e,"hasZ",!1)}}_readMetadataCapabilities(e){return{supportsAdvancedFieldProperties:Ce(e,"supportsFieldDescriptionProperty",!1)}}_readOperationsCapabilities(e,t){const r=e?e.toLowerCase().split(",").map((e=>e.trim())):[],i=r.includes("editing");let o=i&&r.includes("create"),s=i&&r.includes("delete"),a=i&&r.includes("update");const n=r.includes("changetracking");return i&&!(o||s||a)&&(o=s=a=!0),{supportsCalculate:Ce(t,"supportsCalculate",!1),supportsTruncate:Ce(t,"supportsTruncate",!1),supportsValidateSql:Ce(t,"supportsValidateSql",!1),supportsAdd:o,supportsDelete:s,supportsEditing:i,supportsChangeTracking:n,supportsQuery:r.includes("query"),supportsQueryAttachments:Ce(t.advancedQueryCapabilities,"supportsQueryAttachments",!1),supportsResizeAttachments:Ce(t,"supportsAttachmentsResizing",!1),supportsSync:r.includes("sync"),supportsUpdate:a,supportsExceedsLimitStatistics:Ce(t,"supportsExceedsLimitStatistics",!1)}}_readQueryCapabilities(e){var t;const r=e.advancedQueryCapabilities,i=e.ownershipBasedAccessControlForFeatures,o=e.archivingInfo,s=null==(t=this.url)?void 0:t.includes("MapServer"),a=!y("mapserver-pbf-enabled")&&s&&this.version<10.81,n=K(this.url),l=(e.supportedQueryFormats||"").split(",").reduce(((e,t)=>{const r=t.toLowerCase().trim();return r&&e.add(r),e}),new Set);return{supportsStatistics:Ce(r,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:Ce(r,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:Ce(r,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Re(r),supportsCentroid:Ce(r,"supportsReturningGeometryCentroid",!1),supportsDistance:Ce(r,"supportsQueryWithDistance",!1),supportsDistinct:Ce(r,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:Ce(r,"supportsReturningQueryExtent",!1),supportsGeometryProperties:Ce(r,"supportsReturningGeometryProperties",!1),supportsHavingClause:Ce(r,"supportsHavingClause",!1),supportsOrderBy:Ce(r,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:Ce(r,"supportsPagination",!1),supportsQuantization:Ce(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:Ce(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:Ce(e,"supportsReturningQueryGeometry",!1),supportsResultType:Ce(r,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:Ce(r,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:Ce(r,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:Ce(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:Ce(r,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:Ce(i,"allowOthersToQuery",!0),supportsHistoricMoment:Ce(o,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!a&&l.has("pbf"),supportsDisjointSpatialRelationship:Ce(r,"supportsDisjointSpatialRel",!1),supportsCacheHint:Ce(r,"supportsQueryWithCacheHint",!1),supportsDefaultSpatialReference:Ce(r,"supportsDefaultSR",!1),supportsCompactGeometry:n,maxRecordCountFactor:Me(e,"maxRecordCountFactor",void 0),maxRecordCount:Me(e,"maxRecordCount",void 0),standardMaxRecordCount:Me(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Me(e,"tileMaxRecordCount",void 0)}}_readQueryRelatedCapabilities(e){const t=e.advancedQueryCapabilities,r=Ce(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:Ce(t,"supportsQueryRelatedPagination",!1),supportsCount:r,supportsOrderBy:r}}_readEditingCapabilities(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:Ce(e,"allowGeometryUpdates",!0),supportsGlobalId:Ce(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:Ce(e,"supportsReturnServiceEditsInSourceSpatialReference",!1),supportsRollbackOnFailure:Ce(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:Ce(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:Ce(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:Ce(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:Ce(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:Ce(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:Ce(t,"allowOthersToUpdate",!0)}}_handleSublayersChange(e,t){t&&(t.forEach((e=>{e.parent=null})),this.handles.remove("sublayers-owner")),e&&(e.forEach((e=>{e.parent=this})),this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this})),e.on("after-remove",(({item:e})=>{e.parent=null}))],"sublayers-owner"))}};e([D({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",void 0),e([C("service","capabilities",["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"])],Le.prototype,"readCapabilities",null),e([D({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Le.prototype,"charts",void 0),e([D({readOnly:!0})],Le.prototype,"createQueryVersion",null),e([D({type:String,json:{read:{source:"layerDefinition.copyrightText"},origins:{service:{read:{source:"copyrightText"}}}}})],Le.prototype,"copyright",void 0),e([D({type:String,json:{read:{source:"layerDefinition.displayField"},origins:{service:{read:{source:"displayField"}}}}})],Le.prototype,"displayField",void 0),e([D({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),e([D({types:n,readOnly:!0})],Le.prototype,"defaultSymbol",void 0),e([D({type:be})],Le.prototype,"dynamicDataSource",void 0),e([D({readOnly:!0})],Le.prototype,"editFieldsInfo",void 0),e([D({type:Boolean})],Le.prototype,"editingEnabled",void 0),e([C(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],Le.prototype,"readEditingEnabled",null),e([C("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],Le.prototype,"readEditingEnabledFromWebMap",null),e([R(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],Le.prototype,"writeEditingEnabled",null),e([R("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],Le.prototype,"writeEditingEnabledToWebMap",null),e([D({readOnly:!0})],Le.prototype,"editingInfo",void 0),e([C("editingInfo")],Le.prototype,"readEditingInfo",null),e([D(X)],Le.prototype,"elevationInfo",void 0),e([D(ne)],Le.prototype,"featureReduction",void 0),e([D({...Ae.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{read:!0},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Te}}}}})],Le.prototype,"fields",void 0),e([D(Ae.fieldsIndex)],Le.prototype,"fieldsIndex",void 0),e([D({type:ce,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"},origins:{"web-scene":{write:!1}}}})],Le.prototype,"floorInfo",void 0),e([D({type:T,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],Le.prototype,"formTemplate",void 0),e([D({type:L,json:{origins:{service:{read:{source:"extent"}}},read:{source:"layerDefinition.extent"}}})],Le.prototype,"fullExtent",void 0),e([D()],Le.prototype,"gdbVersion",void 0),e([D({readOnly:!0,type:de,json:{read:{source:"geometryProperties"}}})],Le.prototype,"geometryFieldsInfo",void 0),e([D({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:Fe.read},"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Te,writer(e,t,r){const i=e?Fe.toJSON(e):null;i&&w(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Fe.read}}})],Le.prototype,"geometryType",void 0),e([D({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasM"}}})],Le.prototype,"hasM",void 0),e([D({type:Boolean,json:{origins:{service:{read:!0}},read:{source:"layerDefinition.hasZ"}}})],Le.prototype,"hasZ",void 0),e([D({readOnly:!0,type:_})],Le.prototype,"heightModelInfo",void 0),e([D({type:Date})],Le.prototype,"historicMoment",void 0),e([D(Y)],Le.prototype,"id",void 0),e([D({readOnly:!0,json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],Le.prototype,"isTable",void 0),e([C("service","isTable",["type","geometryType"]),C("isTable",["layerDefinition.type","layerDefinition.geometryType"])],Le.prototype,"readIsTable",null),e([R("web-map","isTable")],Le.prototype,"writeIsTable",null),e([D(ee)],Le.prototype,"opacity",void 0),e([D({type:Number,json:{origins:{service:{read:{source:"id"}}},read:!1}})],Le.prototype,"layerId",void 0),e([D(te)],Le.prototype,"legendEnabled",void 0),e([D({type:["show","hide"]})],Le.prototype,"listMode",void 0),e([D(re)],Le.prototype,"minScale",void 0),e([C("service","minScale",["minScale","effectiveMinScale"])],Le.prototype,"readMinScale",null),e([D(ie)],Le.prototype,"maxScale",void 0),e([C("service","maxScale",["maxScale","effectiveMaxScale"])],Le.prototype,"readMaxScale",null),e([D({type:String})],Le.prototype,"globalIdField",void 0),e([C("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"]),C("service","globalIdField",["globalIdField","fields"])],Le.prototype,"readGlobalIdFieldFromService",null),e([D({type:String,json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Te}}}}})],Le.prototype,"objectIdField",void 0),e([C("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"]),C("service","objectIdField",["objectIdField","fields"])],Le.prototype,"readObjectIdFieldFromService",null),e([D({value:"ArcGISSubtypeGroupLayer",type:["ArcGISSubtypeGroupLayer"]})],Le.prototype,"operationalLayerType",void 0),e([D(Ae.outFields)],Le.prototype,"outFields",void 0),e([D({readOnly:!0})],Le.prototype,"parsedUrl",null),e([D({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Le.prototype,"path",void 0),e([D({type:[ye],readOnly:!0})],Le.prototype,"relationships",void 0),e([D({types:o,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:s,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,r)=>({ignoreOrigin:null==r?void 0:r.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:null==r?void 0:r.writeLayerSchema})}}})],Le.prototype,"renderer",null),e([C("service","renderer",["drawingInfo.renderer","defaultSymbol"]),C("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],Le.prototype,"readRenderer",null),e([D()],Le.prototype,"sourceJSON",void 0),e([D({type:Boolean})],Le.prototype,"returnM",void 0),e([D({type:Boolean})],Le.prototype,"returnZ",void 0),e([D(oe)],Le.prototype,"screenSizePerspectiveEnabled",void 0),e([D()],Le.prototype,"source",null),e([x("source")],Le.prototype,"castSource",null),e([C("portal-item","source",["featureSet"]),C("web-map","source",["featureSet"])],Le.prototype,"readSource",null),e([D({readOnly:!0})],Le.prototype,"serviceDefinitionExpression",void 0),e([C("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],Le.prototype,"readServiceDefinitionExpression",null),e([D({type:P,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:{source:"layerDefinition.extent.spatialReference"}}})],Le.prototype,"spatialReference",void 0),e([D({type:String})],Le.prototype,"subtypeField",void 0),e([D({type:p.ofType(he),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const o=e.map((e=>new he({subtypeCode:e.code,renderer:i(t.drawingInfo.renderer,t,r),title:e.name})));return new(p.ofType(he))(o)}}}}}})],Le.prototype,"sublayers",void 0),e([D({type:me})],Le.prototype,"timeInfo",void 0),e([D()],Le.prototype,"title",void 0),e([C("service","title",["name"]),C("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],Le.prototype,"readTitle",null),e([C("web-map","title",["layerDefinition.name","title"])],Le.prototype,"readTitleFromWebMap",null),e([D({type:String})],Le.prototype,"sublayerTitleMode",void 0),e([D({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],Le.prototype,"trackIdField",void 0),e([D({json:{read:!1}})],Le.prototype,"type",void 0),e([D({type:String})],Le.prototype,"typeIdField",void 0),e([C("service","typeIdField"),C("typeIdField",["layerDefinition.typeIdField"])],Le.prototype,"readTypeIdField",null),e([D({readOnly:!0,json:{write:!1}})],Le.prototype,"serverGens",void 0),e([D({type:p.ofType(ae),readOnly:!0})],Le.prototype,"indexes",void 0),e([D(se)],Le.prototype,"url",null),e([R("url")],Le.prototype,"writeUrl",null),e([D({readOnly:!0})],Le.prototype,"userIsAdmin",void 0),e([D({json:{origins:{service:{read:!0}},read:!1}})],Le.prototype,"version",void 0),e([C("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],Le.prototype,"readVersion",null),e([D({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],Le.prototype,"visible",void 0),e([C("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],Le.prototype,"readVisible",null),Le=e([M("esri.layers.SubtypeGroupLayer")],Le);const _e=A({types:l}),Pe=Le;export{Pe as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../request.js";import t from"../core/Error.js";import{HandleOwnerMixin as s}from"../core/HandleOwner.js";import{isSome as i}from"../core/maybe.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{urlToObject as l,objectToQuery as n,makeAbsolute as p}from"../core/urlUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import y from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as v}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as g}from"./mixins/ArcGISCachedService.js";import{ArcGISMapService as S}from"./mixins/ArcGISMapService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RefreshableLayer as O}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as R}from"./mixins/SublayersOwner.js";import{parse as x,isHostedAgolService as U,isArcGISUrl as P}from"./support/arcgisLayerUrl.js";import{url as A}from"./support/commonProperties.js";import W from"./support/Sublayer.js";const I=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let M=class extends(j(R(L(T(w(g(S(_(o(s(O(v(b(f)))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=i(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(a).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){var e;const r=null==(e=this.parsedUrl)?void 0:e.path.toLowerCase();return r&&this._getDefaultAttribution(this._getMapName(r))}readSpatialReference(e,r){return(e=e||r.tileInfo&&r.tileInfo.spatialReference)&&y.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),o=[],a={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},a);o.push(r)}));o.some((e=>Object.keys(e).length>1))&&(r.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>l(e).path)):null}fetchTile(e,t,s,i={}){const{signal:o}=i,a=this.getTileUrl(e,t,s),l={responseType:"image",signal:o,query:{...this.refreshParameters}};return r(a,l).then((e=>e.data))}getTileUrl(e,r,t){const s=!this.tilemapCache&&this.supportsBlankTile,i=n({...this.parsedUrl.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[r%o.length]:this.parsedUrl.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}_fetchService(e){return new Promise(((s,o)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void s({data:this.sourceJSON})}if(!this.parsedUrl)throw new t("tile-layer:undefined-url","layer's url is not defined");const a=x(this.parsedUrl.path);if(i(a)&&"ImageServer"===a.serverType)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(s,o)})).then((r=>{if(r.ssl&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!U(this.url))return this._fetchServerVersion(this.url,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,s){if(!P(e))return Promise.reject();const i=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return r(i,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:s}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new t("tile-layer:version-not-available")}))}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r&&r[2]}_getDefaultAttribution(e){if(!e)return;let r;e=e.toLowerCase();for(let t=0,s=I.length;t<s;t++)if(r=I[t],r.toLowerCase().indexOf(e)>-1)return p("//static.arcgis.com/attribution/"+r)}_getDefaultTileServers(e){const r=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),t=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return r||t?[e,e.replace(r?/server\.arcgisonline/i:/services\.arcgisonline/i,r?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile.__isDefault__}};e([c({readOnly:!0})],M.prototype,"attributionDataUrl",null),e([c({type:["show","hide","hide-children"]})],M.prototype,"listMode",void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],M.prototype,"isReference",void 0),e([c({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],M.prototype,"operationalLayerType",void 0),e([c({type:Boolean})],M.prototype,"resampling",void 0),e([c()],M.prototype,"sourceJSON",void 0),e([c({type:y})],M.prototype,"spatialReference",void 0),e([m("spatialReference",["spatialReference","tileInfo"])],M.prototype,"readSpatialReference",null),e([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],M.prototype,"path",void 0),e([c({readOnly:!0})],M.prototype,"sublayers",void 0),e([d("sublayers",{layers:{type:[W]}})],M.prototype,"writeSublayers",null),e([c({json:{read:!1,write:!1}})],M.prototype,"popupEnabled",void 0),e([c()],M.prototype,"tileServers",null),e([u("tileServers")],M.prototype,"castTileServers",null),e([c({readOnly:!0,json:{read:!1}})],M.prototype,"type",void 0),e([c(A)],M.prototype,"url",void 0),M=e([h("esri.layers.TileLayer")],M),M.prototype.fetchTile.__isDefault__=!0;const C=M;export{C as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import r from"../request.js";import t from"../core/Error.js";import{HandleOwnerMixin as s}from"../core/HandleOwner.js";import{isSome as i}from"../core/maybe.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as a}from"../core/promiseUtils.js";import{urlToObject as l,objectToQuery as n,makeAbsolute as p}from"../core/urlUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as u}from"../core/accessorSupport/decorators/cast.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as h}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import y from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as v}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as g}from"./mixins/ArcGISCachedService.js";import{ArcGISMapService as S}from"./mixins/ArcGISMapService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as T}from"./mixins/OperationalLayer.js";import{PortalLayer as w}from"./mixins/PortalLayer.js";import{RefreshableLayer as O}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{SublayersOwner as R}from"./mixins/SublayersOwner.js";import{parse as U,isHostedAgolService as x,isArcGISUrl as P}from"./support/arcgisLayerUrl.js";import{url as A}from"./support/commonProperties.js";import W from"./support/Sublayer.js";const I=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let M=class extends(j(R(L(T(w(g(S(_(o(s(O(v(b(f)))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=i(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(a).then((()=>this._fetchService(r)))),Promise.resolve(this)}get attributionDataUrl(){var e;const r=null==(e=this.parsedUrl)?void 0:e.path.toLowerCase();return r&&this._getDefaultAttribution(this._getMapName(r))}readSpatialReference(e,r){return(e=e||r.tileInfo&&r.tileInfo.spatialReference)&&y.fromJSON(e)}writeSublayers(e,r,t,s){if(!this.loaded||!e)return;const i=e.slice().reverse().flatten((({sublayers:e})=>e&&e.toArray().reverse())).toArray(),o=[],a={writeSublayerStructure:!1,...s};i.forEach((e=>{const r=e.write({},a);o.push(r)}));o.some((e=>Object.keys(e).length>1))&&(r.layers=o)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl.path)}castTileServers(e){return Array.isArray(e)?e.map((e=>l(e).path)):null}fetchTile(e,t,s,i={}){const{signal:o}=i,a=this.getTileUrl(e,t,s),l={responseType:"image",signal:o,query:{...this.refreshParameters}};return r(a,l).then((e=>e.data))}getTileUrl(e,r,t){const s=!this.tilemapCache&&this.supportsBlankTile,i=n({...this.parsedUrl.query,blankTile:!s&&null,...this.customParameters,token:this.apiKey}),o=this.tileServers;return`${o&&o.length?o[r%o.length]:this.parsedUrl.path}/tile/${e}/${r}/${t}${i?"?"+i:""}`}_fetchService(e){return new Promise(((s,o)=>{if(this.sourceJSON){if(null!=this.sourceJSON.bandCount&&null!=this.sourceJSON.pixelSizeX)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void s({data:this.sourceJSON})}if(!this.parsedUrl)throw new t("tile-layer:undefined-url","layer's url is not defined");const a=U(this.parsedUrl.path);if(i(a)&&"ImageServer"===a.serverType)throw new t("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");r(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(s,o)})).then((r=>{if(r.ssl&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),10.1===this.version&&!x(this.url))return this._fetchServerVersion(this.url,e).then((e=>{this.read({currentVersion:e})})).catch((()=>{}))}))}_fetchServerVersion(e,s){if(!P(e))return Promise.reject();const i=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return r(i,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:s}).then((e=>{if(e.data&&e.data.currentVersion)return e.data.currentVersion;throw new t("tile-layer:version-not-available")}))}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r&&r[2]}_getDefaultAttribution(e){if(!e)return;let r;e=e.toLowerCase();for(let t=0,s=I.length;t<s;t++)if(r=I[t],r.toLowerCase().includes(e))return p("//static.arcgis.com/attribution/"+r)}_getDefaultTileServers(e){const r=-1!==e.search(/^(?:https?:)?\/\/server\.arcgisonline\.com/i),t=-1!==e.search(/^(?:https?:)?\/\/services\.arcgisonline\.com/i);return r||t?[e,e.replace(r?/server\.arcgisonline/i:/services\.arcgisonline/i,r?"services.arcgisonline":"server.arcgisonline")]:[]}get hasOverriddenFetchTile(){return!this.fetchTile.__isDefault__}};e([c({readOnly:!0})],M.prototype,"attributionDataUrl",null),e([c({type:["show","hide","hide-children"]})],M.prototype,"listMode",void 0),e([c({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],M.prototype,"isReference",void 0),e([c({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],M.prototype,"operationalLayerType",void 0),e([c({type:Boolean})],M.prototype,"resampling",void 0),e([c()],M.prototype,"sourceJSON",void 0),e([c({type:y})],M.prototype,"spatialReference",void 0),e([m("spatialReference",["spatialReference","tileInfo"])],M.prototype,"readSpatialReference",null),e([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],M.prototype,"path",void 0),e([c({readOnly:!0})],M.prototype,"sublayers",void 0),e([d("sublayers",{layers:{type:[W]}})],M.prototype,"writeSublayers",null),e([c({json:{read:!1,write:!1}})],M.prototype,"popupEnabled",void 0),e([c()],M.prototype,"tileServers",null),e([u("tileServers")],M.prototype,"castTileServers",null),e([c({readOnly:!0,json:{read:!1}})],M.prototype,"type",void 0),e([c(A)],M.prototype,"url",void 0),M=e([h("esri.layers.TileLayer")],M),M.prototype.fetchTile.__isDefault__=!0;const C=M;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as s}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as i,createTask as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as I}from"./support/imageUtils.js";import x from"./support/SpriteSource.js";import U from"./support/TileInfo.js";import{loadMetadata as P}from"./support/vectorTileLayerLoader.js";import{createForItem as R}from"../portal/support/jsonContext.js";import{areSchemasOverlapping as O,unionTileInfos as M}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import V from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as D}from"../views/webgl/capabilities.js";let k=class extends(j(L(v(_(w(T(b(g(s(f)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.type="vector-tile",this.url=null,this.symbolCollisionBoxesVisible=!1,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))null==e||e.destroy();this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(i).then((async()=>{if(!this.portalItem||!this.portalItem.id)return;const r=`${this.portalItem.itemUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},R(this.portalItem))})).catch(i).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return(null==(e=this.primarySource)?void 0:e.fullExtent)||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo&&this.tileInfo.spatialReference||null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`),t.styleUrl=e}get tileInfo(){var e;const t=[];for(const o in this.sourceNameToSource)t.push(this.sourceNameToSource[o]);let r=(null==(e=this.primarySource)?void 0:e.tileInfo)||new U;if(t.length>1)for(let o=0;o<t.length;o++)O(r,t[o].tileInfo)&&(r=M(r,t[o].tileInfo));return r}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){var r;const o=D("2d").maxTextureSize,s=null!=(r=this.currentStyleInfo)&&r.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,i=new x(s,e,o,this.currentStyleInfo.spriteFormat);await i.load(t),this._spriteSourceMap.set(e,i)}return Promise.resolve(this._spriteSourceMap.get(e))}async setSpriteSource(e,t="png",r=1,o){const s=D("2d").maxTextureSize,l=e?n(e,{...this.customParameters,token:this.apiKey}):null;if(!l)return null;const a=new x(l,r,s,t);try{return await a.load(o),this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,a),this.currentStyleInfo.spriteUrl=l,this.emit("spriteSource-change",{spriteSource:a}),a}catch(p){i(p)}return null}async loadStyle(e,t){var r;const o=e||this.style||this.url;return this._loadingTask&&"string"==typeof o&&this.url===o||(null==(r=this._loadingTask)||r.abort(),this._loadingTask=l((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(o,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const o=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||o})}getStyleLayer(e){return o(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 o(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)}write(e,t){return null!=t&&t.origin&&!this.styleUrl?(t.messages&&t.messages.push(new r("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await P(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await I("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new V(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["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"];if(!t)return;const o=t[2]&&t[2].toLowerCase();if(!o)return;const s=t[1]||"";for(const i of r)if(i.toLowerCase().includes(o))return y(`//static.arcgis.com/attribution/Vector${s}/${i}`)}async _loadStyle(e){var t,r;return null!=(t=null==(r=this._loadingTask)?void 0:r.promise)?t:this.loadStyle(null,e)}};e([u({readOnly:!0})],k.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],k.prototype,"listMode",void 0),e([u({readOnly:!0,json:{read:!1}})],k.prototype,"capabilities",null),e([u({readOnly:!0})],k.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],k.prototype,"fullExtent",null),e([u()],k.prototype,"style",void 0),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],k.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],k.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],k.prototype,"parsedUrl",null),e([u({readOnly:!0})],k.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],k.prototype,"spatialReference",null),e([u({readOnly:!0})],k.prototype,"styleRepository",void 0),e([u({readOnly:!0})],k.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],k.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],k.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],k.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:U})],k.prototype,"tileInfo",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],k.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],k.prototype,"url",void 0),e([u({readOnly:!0})],k.prototype,"version",void 0),e([c("version",["version","currentVersion"])],k.prototype,"readVersion",null),e([u({type:Boolean})],k.prototype,"symbolCollisionBoxesVisible",void 0),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],k.prototype,"path",void 0),k=e([m("esri.layers.VectorTileLayer")],k);const C=k;export{C as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Error.js";import{clone as o}from"../core/lang.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as s,createTask as l}from"../core/promiseUtils.js";import{urlToObject as a,addQueryParameters as n,isProtocolRelative as p,normalize as y}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import d from"../geometry/Extent.js";import S from"../geometry/SpatialReference.js";import f from"./Layer.js";import{APIKeyMixin as g}from"./mixins/APIKeyMixin.js";import{ArcGISCachedService as v}from"./mixins/ArcGISCachedService.js";import{ArcGISService as _}from"./mixins/ArcGISService.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as b}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as T}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as L}from"./mixins/ScaleRangeLayer.js";import{checkWebPSupport as I}from"./support/imageUtils.js";import x from"./support/SpriteSource.js";import U from"./support/TileInfo.js";import{loadMetadata as P}from"./support/vectorTileLayerLoader.js";import{createForItem as R}from"../portal/support/jsonContext.js";import{areSchemasOverlapping as O,unionTileInfos as M}from"../views/2d/engine/vectorTiles/tileInfoUtils.js";import V from"../views/2d/engine/vectorTiles/style/StyleRepository.js";import{getWebGLCapabilities as D}from"../views/webgl/capabilities.js";let k=class extends(j(L(v(_(w(T(b(g(i(f)))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.type="vector-tile",this.url=null,this.symbolCollisionBoxesVisible=!1,this.path=null}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))null==e||e.destroy();this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const r=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(s).then((async()=>{if(!this.portalItem||!this.portalItem.id)return;const r=`${this.portalItem.itemUrl}/resources/styles/root.json`;(await t(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},R(this.portalItem))})).catch(s).then((()=>this._loadStyle(e)));return this.addResolvingPromise(r),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&a(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?n(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return(null==(e=this.primarySource)?void 0:e.fullExtent)||null}get parsedUrl(){return this.serviceUrl?a(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo&&this.tileInfo.spatialReference||null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&p(e)&&(e=`https:${e}`),t.styleUrl=e}get tileInfo(){var e;const t=[];for(const o in this.sourceNameToSource)t.push(this.sourceNameToSource[o]);let r=(null==(e=this.primarySource)?void 0:e.tileInfo)||new U;if(t.length>1)for(let o=0;o<t.length;o++)O(r,t[o].tileInfo)&&(r=M(r,t[o].tileInfo));return r}readVersion(e,t){return t.version?parseFloat(t.version):parseFloat(t.currentVersion)}async loadSpriteSource(e=1,t){if(!this._spriteSourceMap.has(e)){var r;const o=D("2d").maxTextureSize,i=null!=(r=this.currentStyleInfo)&&r.spriteUrl?n(this.currentStyleInfo.spriteUrl,{...this.customParameters,token:this.apiKey}):null,s=new x(i,e,o,this.currentStyleInfo.spriteFormat);await s.load(t),this._spriteSourceMap.set(e,s)}return this._spriteSourceMap.get(e)}async setSpriteSource(e,t="png",r=1,o){const i=D("2d").maxTextureSize,l=e?n(e,{...this.customParameters,token:this.apiKey}):null;if(!l)return null;const a=new x(l,r,i,t);try{return await a.load(o),this._spriteSourceMap.clear(),this._spriteSourceMap.set(r,a),this.currentStyleInfo.spriteUrl=l,this.emit("spriteSource-change",{spriteSource:a}),a}catch(p){s(p)}return null}async loadStyle(e,t){var r;const o=e||this.style||this.url;return this._loadingTask&&"string"==typeof o&&this.url===o||(null==(r=this._loadingTask)||r.abort(),this._loadingTask=l((e=>(this._spriteSourceMap.clear(),this._getSourceAndStyle(o,{signal:e}))),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return o(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const o=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||o})}getStyleLayer(e){return o(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 o(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)}write(e,t){return null!=t&&t.origin&&!this.styleUrl?(t.messages&&t.messages.push(new r("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await P(e,{...t,query:{...this.customParameters,token:this.apiKey}});if("webp"===r.spriteFormat){await I("lossy")||(r.spriteFormat="png")}this._set("currentStyleInfo",{...r}),"string"==typeof e?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new V(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["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"];if(!t)return;const o=t[2]&&t[2].toLowerCase();if(!o)return;const i=t[1]||"";for(const s of r)if(s.toLowerCase().includes(o))return y(`//static.arcgis.com/attribution/Vector${i}/${s}`)}async _loadStyle(e){var t,r;return null!=(t=null==(r=this._loadingTask)?void 0:r.promise)?t:this.loadStyle(null,e)}};e([u({readOnly:!0})],k.prototype,"attributionDataUrl",null),e([u({type:["show","hide"]})],k.prototype,"listMode",void 0),e([u({readOnly:!0,json:{read:!1}})],k.prototype,"capabilities",null),e([u({readOnly:!0})],k.prototype,"currentStyleInfo",void 0),e([u({json:{read:!1},readOnly:!0,type:d})],k.prototype,"fullExtent",null),e([u()],k.prototype,"style",void 0),e([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],k.prototype,"isReference",void 0),e([u({type:["VectorTileLayer"]})],k.prototype,"operationalLayerType",void 0),e([u({readOnly:!0})],k.prototype,"parsedUrl",null),e([u({readOnly:!0})],k.prototype,"serviceUrl",null),e([u({type:S,readOnly:!0})],k.prototype,"spatialReference",null),e([u({readOnly:!0})],k.prototype,"styleRepository",void 0),e([u({readOnly:!0})],k.prototype,"sourceNameToSource",void 0),e([u({readOnly:!0})],k.prototype,"primarySource",void 0),e([u({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],k.prototype,"styleUrl",null),e([h(["portal-item","web-document"],"styleUrl")],k.prototype,"writeStyleUrl",null),e([u({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:U})],k.prototype,"tileInfo",null),e([u({json:{read:!1},readOnly:!0,value:"vector-tile"})],k.prototype,"type",void 0),e([u({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],k.prototype,"url",void 0),e([u({readOnly:!0})],k.prototype,"version",void 0),e([c("version",["version","currentVersion"])],k.prototype,"readVersion",null),e([u({type:Boolean})],k.prototype,"symbolCollisionBoxesVisible",void 0),e([u({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],k.prototype,"path",void 0),k=e([m("esri.layers.VectorTileLayer")],k);const C=k;export{C as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../config.js";import t from"../Graphic.js";import s from"../PopupTemplate.js";import o from"../request.js";import i from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{HandleOwnerMixin as n}from"../core/HandleOwner.js";import{JSONMap as l}from"../core/jsonMap.js";import{clone as p}from"../core/lang.js";import{isSome as m}from"../core/maybe.js";import{MultiOriginJSONMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y}from"../core/promiseUtils.js";import{addQueryParameters as c,Url as d}from"../core/urlUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import{Integer as h}from"../core/accessorSupport/ensureType.js";import{reader as g}from"../core/accessorSupport/decorators/reader.js";import{subclass as b}from"../core/accessorSupport/decorators/subclass.js";import{writer as w}from"../core/accessorSupport/decorators/writer.js";import{willPropertyWrite as v}from"../core/accessorSupport/write.js";import x from"../geometry/Extent.js";import j from"../geometry/SpatialReference.js";import{getScale as S}from"../geometry/support/scaleUtils.js";import{equals as I}from"../geometry/support/spatialReferenceUtils.js";import R from"./Layer.js";import{BlendLayer as E}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{PortalLayer as O}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as L}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as q}from"./ogc/crsUtils.js";import{isWmsServer as M}from"./support/arcgisLayerUrl.js";import{legendEnabled as T,url as C}from"./support/commonProperties.js";import{ExportWMSImageParameters as W}from"./support/ExportWMSImageParameters.js";import $ from"./support/WMSSublayer.js";import{normalizeWKID as N,toISOString as _,getPopupLayers as H,parseCapabilities as k}from"./support/wmsUtils.js";const A=new l({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});let B=class extends(n(E(L(P(F(U(O(u(R))))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormat=null,this.featureInfoUrl=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.url=null,this.version=null,this.watch("sublayers",((e,r)=>{if(r){for(const e of r)e.layer=null;this.handles.remove("wms-sublayer")}if(e){for(const r of e)r.parent=this,r.layer=this;this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"wms-sublayer")}}),!0)}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=m(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(y).then((()=>this._fetchService(r)))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,r){const t=r.extent;return new x({xmin:t[0][0],ymin:t[0][1],xmax:t[1][0],ymax:t[1][1]})}writeFullExtent(e,r){r.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.indexOf("image/png")>-1?"image/png":t&&t[0]}readSpatialReferenceFromItemOrDocument(e,r){return new j(r.spatialReferences[0])}writeSpatialReferences(e,r){const t=this.spatialReference&&this.spatialReference.wkid;e&&t?(r.spatialReferences=e.filter((e=>e!==t)),r.spatialReferences.unshift(t)):r.spatialReferences=e}readSublayersFromItemOrMap(e,r,t){return G(r.layers,t,r.visibleLayers)}readSublayers(e,r,t){return G(r.layers,t)}writeSublayers(e,r,t,s){r.layers=[];const o=new Map,i=e.flatten((({sublayers:e})=>e&&e.toArray())).toArray();i.forEach((e=>{"number"==typeof e.parent.id&&(o.has(e.parent.id)?o.get(e.parent.id).push(e.id):o.set(e.parent.id,[e.id]))})),i.forEach((e=>{const t={sublayer:e,...s},i=e.write({parentLayerId:"number"==typeof e.parent.id?e.parent.id:-1},t);if(o.has(e.id)&&(i.sublayerIds=o.get(e.id)),!e.sublayers&&e.name){const s=e.write({},t);delete s.id,r.layers.push(s)}})),r.visibleLayers=i.filter((e=>e.visible&&!e.sublayers)).map((e=>e.name))}createExportImageParameters(e,r,t,s){const o=s&&s.pixelRatio||1,i=S({extent:e,width:r})*o,a=new W({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,y=N(u,this.spatialReferences),c="1.3.0"===this.version&&q(y)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,d=a.toJSON();return{bbox:c,["1.3.0"===this.version?"crs":"srs"]:isNaN(y)?void 0:"EPSG:"+y,...d}}async fetchImage(e,r,t,s){var i,a;const n=this.mapUrl,l=this.createExportImageParameters(e,r,t,s);if(!l.layers){const e=document.createElement("canvas");return e.width=r,e.height=t,e}const p=null==s||null==(i=s.timeExtent)?void 0:i.start,u=null==s||null==(a=s.timeExtent)?void 0:a.end,y=m(p)&&m(u)?p.getTime()===u.getTime()?_(p):`${_(p)}/${_(u)}`:void 0,c={responseType:"image",query:this._mixCustomParameters({width:r,height:t,...l,time:y,...this.refreshParameters}),signal:null==s?void 0:s.signal};return o(n,c).then((e=>e.data))}fetchFeatureInfo(e,r,o,i,a){const n=S({extent:e,width:r}),l=new W({layer:this,scale:n}),p=H(l.visibleSublayers);if(!this.featureInfoUrl||!p)return null;const m="1.3.0"===this.version?{I:i,J:a}:{x:i,y:a},u={query_layers:p,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:r,height:o,...m},y={...this.createExportImageParameters(e,r,o),...u},d=this._mixCustomParameters(y),f=c(this.featureInfoUrl,d),h=document.createElement("iframe");h.src=f,h.style.border="none",h.style.margin="0",h.style.width="100%",h.setAttribute("sandbox","");const g=new s({title:this.title,content:h});return new t({sourceLayer:this,popupTemplate:g})}findSublayerById(e){return this.allSublayers.find((r=>r.id===e))}findSublayerByName(e){return this.allSublayers.find((r=>r.name===e))}serviceSupportsSpatialReference(e){return M(this.url)||this.spatialReferences.some((r=>{const t=900913===r?j.WebMercator:new j({wkid:r});return I(t,e)}))}async _fetchService(e){if(!this.resourceInfo){this.parsedUrl.query&&this.parsedUrl.query.service&&(this.parsedUrl.query.SERVICE=this.parsedUrl.query.service,delete this.parsedUrl.query.service),this.parsedUrl.query&&this.parsedUrl.query.request&&(this.parsedUrl.query.REQUEST=this.parsedUrl.query.request,delete this.parsedUrl.query.request);const r=await o(this.parsedUrl.path,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...this.parsedUrl.query,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=k(r.data)}if(this.parsedUrl){const e=new d(this.parsedUrl.path);"https"!==e.scheme||e.port&&"443"!==e.port||-1!==r.request.httpsDomains.indexOf(e.host)||r.request.httpsDomains.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const r={...this.customParameters,...this.customLayerParameters};for(const t in r)e[t.toLowerCase()]=r[t];return e}};function D(e,r){return e.some((e=>{for(const t in e)if(v(e,t,null,r))return!0;return!1}))}function G(e,r,t){const s=new Map;e.every((e=>null==e.id))&&(e=p(e)).forEach(((e,r)=>e.id=r));for(const i of e){const e=new $;e.read(i,r),-1===(null==t?void 0:t.indexOf(e.name))&&(e.visible=!1),s.set(e.id,e)}const o=[];for(const a of e){const e=s.get(a.id);if(null!=a.parentLayerId&&a.parentLayerId>=0){const r=s.get(a.parentLayerId);r.sublayers||(r.sublayers=new i),r.sublayers.unshift(e)}else o.unshift(e)}return o}e([f({readOnly:!0})],B.prototype,"allSublayers",void 0),e([f({json:{type:Object,write:!0}})],B.prototype,"customParameters",void 0),e([f({json:{type:Object,write:!0}})],B.prototype,"customLayerParameters",void 0),e([f({type:String,json:{write:!0}})],B.prototype,"copyright",void 0),e([f()],B.prototype,"description",void 0),e([f({readOnly:!0})],B.prototype,"dimensions",void 0),e([f({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],B.prototype,"fullExtent",void 0),e([g(["web-document","portal-item"],"fullExtent",["extent"])],B.prototype,"readFullExtentFromItemOrMap",null),e([w(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],B.prototype,"writeFullExtent",null),e([f()],B.prototype,"fullExtents",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"featureInfoFormat",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"featureInfoUrl",void 0),e([f({type:String,json:{origins:{"web-document":{default:"image/png",type:A.jsonValues,read:{reader:A.read,source:"format"},write:{writer:A.write,target:"format"}}}}})],B.prototype,"imageFormat",void 0),e([g("imageFormat",["supportedImageFormatTypes"])],B.prototype,"readImageFormat",null),e([f({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],B.prototype,"imageMaxHeight",void 0),e([f({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],B.prototype,"imageMaxWidth",void 0),e([f()],B.prototype,"imageTransparency",void 0),e([f(T)],B.prototype,"legendEnabled",void 0),e([f({type:["show","hide","hide-children"]})],B.prototype,"listMode",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"mapUrl",void 0),e([f({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([f({type:["WMS"]})],B.prototype,"operationalLayerType",void 0),e([f()],B.prototype,"resourceInfo",void 0),e([f({type:j,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],B.prototype,"spatialReference",void 0),e([g(["web-document","portal-item"],"spatialReference",["spatialReferences"])],B.prototype,"readSpatialReferenceFromItemOrDocument",null),e([f({type:[h],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],B.prototype,"spatialReferences",void 0),e([w(["web-document","portal-item"],"spatialReferences")],B.prototype,"writeSpatialReferences",null),e([f({type:i.ofType($),json:{write:{target:"layers",overridePolicy(e,r,t){if(D(this.allSublayers,t))return{ignoreOrigin:!0}}}}})],B.prototype,"sublayers",void 0),e([g(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],B.prototype,"readSublayersFromItemOrMap",null),e([g("service","sublayers",["layers"])],B.prototype,"readSublayers",null),e([w("sublayers",{layers:{type:[$]},visibleLayers:{type:[String]}})],B.prototype,"writeSublayers",null),e([f({json:{read:!1},readOnly:!0,value:"wms"})],B.prototype,"type",void 0),e([f(C)],B.prototype,"url",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"version",void 0),B=e([b("esri.layers.WMSLayer")],B);const J=B;export{J as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import r from"../config.js";import t from"../Graphic.js";import s from"../PopupTemplate.js";import o from"../request.js";import i from"../core/Collection.js";import a from"../core/CollectionFlattener.js";import{HandleOwnerMixin as n}from"../core/HandleOwner.js";import{JSONMap as l}from"../core/jsonMap.js";import{clone as p}from"../core/lang.js";import{isSome as m}from"../core/maybe.js";import{MultiOriginJSONMixin as u}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as y}from"../core/promiseUtils.js";import{addQueryParameters as c,Url as d}from"../core/urlUtils.js";import{property as f}from"../core/accessorSupport/decorators/property.js";import{Integer as h}from"../core/accessorSupport/ensureType.js";import{reader as g}from"../core/accessorSupport/decorators/reader.js";import{subclass as b}from"../core/accessorSupport/decorators/subclass.js";import{writer as w}from"../core/accessorSupport/decorators/writer.js";import{willPropertyWrite as v}from"../core/accessorSupport/write.js";import x from"../geometry/Extent.js";import j from"../geometry/SpatialReference.js";import{getScale as S}from"../geometry/support/scaleUtils.js";import{equals as I}from"../geometry/support/spatialReferenceUtils.js";import R from"./Layer.js";import{BlendLayer as E}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{PortalLayer as O}from"./mixins/PortalLayer.js";import{RefreshableLayer as P}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as L}from"./mixins/TemporalLayer.js";import{isAxesOrderReversedForWkid as q}from"./ogc/crsUtils.js";import{isWmsServer as M}from"./support/arcgisLayerUrl.js";import{legendEnabled as T,url as C}from"./support/commonProperties.js";import{ExportWMSImageParameters as W}from"./support/ExportWMSImageParameters.js";import $ from"./support/WMSSublayer.js";import{normalizeWKID as N,toISOString as _,getPopupLayers as H,parseCapabilities as k}from"./support/wmsUtils.js";const A=new l({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});let B=class extends(n(E(L(P(F(U(O(u(R))))))))){constructor(...e){super(...e),this.allSublayers=new a({getCollections:()=>[this.sublayers],getChildrenFunction:e=>e.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormat=null,this.featureInfoUrl=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.url=null,this.version=null,this.watch("sublayers",((e,r)=>{if(r){for(const e of r)e.layer=null;this.handles.remove("wms-sublayer")}if(e){for(const r of e)r.parent=this,r.layer=this;this.handles.add([e.on("after-add",(({item:e})=>{e.parent=this,e.layer=this})),e.on("after-remove",(({item:e})=>{e.parent=null,e.layer=null}))],"wms-sublayer")}}),!0)}normalizeCtorArgs(e,r){return"string"==typeof e?{url:e,...r}:e}load(e){const r=m(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(y).then((()=>this._fetchService(r)))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,r){const t=r.extent;return new x({xmin:t[0][0],ymin:t[0][1],xmax:t[1][0],ymax:t[1][1]})}writeFullExtent(e,r){r.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}readImageFormat(e,r){const t=r.supportedImageFormatTypes;return t&&t.includes("image/png")?"image/png":t&&t[0]}readSpatialReferenceFromItemOrDocument(e,r){return new j(r.spatialReferences[0])}writeSpatialReferences(e,r){const t=this.spatialReference&&this.spatialReference.wkid;e&&t?(r.spatialReferences=e.filter((e=>e!==t)),r.spatialReferences.unshift(t)):r.spatialReferences=e}readSublayersFromItemOrMap(e,r,t){return G(r.layers,t,r.visibleLayers)}readSublayers(e,r,t){return G(r.layers,t)}writeSublayers(e,r,t,s){r.layers=[];const o=new Map,i=e.flatten((({sublayers:e})=>e&&e.toArray())).toArray();i.forEach((e=>{"number"==typeof e.parent.id&&(o.has(e.parent.id)?o.get(e.parent.id).push(e.id):o.set(e.parent.id,[e.id]))})),i.forEach((e=>{const t={sublayer:e,...s},i=e.write({parentLayerId:"number"==typeof e.parent.id?e.parent.id:-1},t);if(o.has(e.id)&&(i.sublayerIds=o.get(e.id)),!e.sublayers&&e.name){const s=e.write({},t);delete s.id,r.layers.push(s)}})),r.visibleLayers=i.filter((e=>e.visible&&!e.sublayers)).map((e=>e.name))}createExportImageParameters(e,r,t,s){const o=s&&s.pixelRatio||1,i=S({extent:e,width:r})*o,a=new W({layer:this,scale:i}),{xmin:n,ymin:l,xmax:p,ymax:m,spatialReference:u}=e,y=N(u,this.spatialReferences),c="1.3.0"===this.version&&q(y)?`${l},${n},${m},${p}`:`${n},${l},${p},${m}`,d=a.toJSON();return{bbox:c,["1.3.0"===this.version?"crs":"srs"]:isNaN(y)?void 0:"EPSG:"+y,...d}}async fetchImage(e,r,t,s){var i,a;const n=this.mapUrl,l=this.createExportImageParameters(e,r,t,s);if(!l.layers){const e=document.createElement("canvas");return e.width=r,e.height=t,e}const p=null==s||null==(i=s.timeExtent)?void 0:i.start,u=null==s||null==(a=s.timeExtent)?void 0:a.end,y=m(p)&&m(u)?p.getTime()===u.getTime()?_(p):`${_(p)}/${_(u)}`:void 0,c={responseType:"image",query:this._mixCustomParameters({width:r,height:t,...l,time:y,...this.refreshParameters}),signal:null==s?void 0:s.signal};return o(n,c).then((e=>e.data))}fetchFeatureInfo(e,r,o,i,a){const n=S({extent:e,width:r}),l=new W({layer:this,scale:n}),p=H(l.visibleSublayers);if(!this.featureInfoUrl||!p)return null;const m="1.3.0"===this.version?{I:i,J:a}:{x:i,y:a},u={query_layers:p,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:r,height:o,...m},y={...this.createExportImageParameters(e,r,o),...u},d=this._mixCustomParameters(y),f=c(this.featureInfoUrl,d),h=document.createElement("iframe");h.src=f,h.style.border="none",h.style.margin="0",h.style.width="100%",h.setAttribute("sandbox","");const g=new s({title:this.title,content:h});return new t({sourceLayer:this,popupTemplate:g})}findSublayerById(e){return this.allSublayers.find((r=>r.id===e))}findSublayerByName(e){return this.allSublayers.find((r=>r.name===e))}serviceSupportsSpatialReference(e){return M(this.url)||this.spatialReferences.some((r=>{const t=900913===r?j.WebMercator:new j({wkid:r});return I(t,e)}))}async _fetchService(e){if(!this.resourceInfo){this.parsedUrl.query&&this.parsedUrl.query.service&&(this.parsedUrl.query.SERVICE=this.parsedUrl.query.service,delete this.parsedUrl.query.service),this.parsedUrl.query&&this.parsedUrl.query.request&&(this.parsedUrl.query.REQUEST=this.parsedUrl.query.request,delete this.parsedUrl.query.request);const r=await o(this.parsedUrl.path,{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...this.parsedUrl.query,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=k(r.data)}if(this.parsedUrl){const e=new d(this.parsedUrl.path);"https"!==e.scheme||e.port&&"443"!==e.port||r.request.httpsDomains.includes(e.host)||r.request.httpsDomains.push(e.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const r={...this.customParameters,...this.customLayerParameters};for(const t in r)e[t.toLowerCase()]=r[t];return e}};function D(e,r){return e.some((e=>{for(const t in e)if(v(e,t,null,r))return!0;return!1}))}function G(e,r,t){const s=new Map;e.every((e=>null==e.id))&&(e=p(e)).forEach(((e,r)=>e.id=r));for(const i of e){const e=new $;e.read(i,r),-1===(null==t?void 0:t.indexOf(e.name))&&(e.visible=!1),s.set(e.id,e)}const o=[];for(const a of e){const e=s.get(a.id);if(null!=a.parentLayerId&&a.parentLayerId>=0){const r=s.get(a.parentLayerId);r.sublayers||(r.sublayers=new i),r.sublayers.unshift(e)}else o.unshift(e)}return o}e([f({readOnly:!0})],B.prototype,"allSublayers",void 0),e([f({json:{type:Object,write:!0}})],B.prototype,"customParameters",void 0),e([f({json:{type:Object,write:!0}})],B.prototype,"customLayerParameters",void 0),e([f({type:String,json:{write:!0}})],B.prototype,"copyright",void 0),e([f()],B.prototype,"description",void 0),e([f({readOnly:!0})],B.prototype,"dimensions",void 0),e([f({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],B.prototype,"fullExtent",void 0),e([g(["web-document","portal-item"],"fullExtent",["extent"])],B.prototype,"readFullExtentFromItemOrMap",null),e([w(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],B.prototype,"writeFullExtent",null),e([f()],B.prototype,"fullExtents",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"featureInfoFormat",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"featureInfoUrl",void 0),e([f({type:String,json:{origins:{"web-document":{default:"image/png",type:A.jsonValues,read:{reader:A.read,source:"format"},write:{writer:A.write,target:"format"}}}}})],B.prototype,"imageFormat",void 0),e([g("imageFormat",["supportedImageFormatTypes"])],B.prototype,"readImageFormat",null),e([f({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],B.prototype,"imageMaxHeight",void 0),e([f({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],B.prototype,"imageMaxWidth",void 0),e([f()],B.prototype,"imageTransparency",void 0),e([f(T)],B.prototype,"legendEnabled",void 0),e([f({type:["show","hide","hide-children"]})],B.prototype,"listMode",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"mapUrl",void 0),e([f({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],B.prototype,"isReference",void 0),e([f({type:["WMS"]})],B.prototype,"operationalLayerType",void 0),e([f()],B.prototype,"resourceInfo",void 0),e([f({type:j,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],B.prototype,"spatialReference",void 0),e([g(["web-document","portal-item"],"spatialReference",["spatialReferences"])],B.prototype,"readSpatialReferenceFromItemOrDocument",null),e([f({type:[h],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],B.prototype,"spatialReferences",void 0),e([w(["web-document","portal-item"],"spatialReferences")],B.prototype,"writeSpatialReferences",null),e([f({type:i.ofType($),json:{write:{target:"layers",overridePolicy(e,r,t){if(D(this.allSublayers,t))return{ignoreOrigin:!0}}}}})],B.prototype,"sublayers",void 0),e([g(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],B.prototype,"readSublayersFromItemOrMap",null),e([g("service","sublayers",["layers"])],B.prototype,"readSublayers",null),e([w("sublayers",{layers:{type:[$]},visibleLayers:{type:[String]}})],B.prototype,"writeSublayers",null),e([f({json:{read:!1},readOnly:!0,value:"wms"})],B.prototype,"type",void 0),e([f(C)],B.prototype,"url",void 0),e([f({type:String,json:{write:{ignoreOrigin:!0}}})],B.prototype,"version",void 0),B=e([b("esri.layers.WMSLayer")],B);const J=B;export{J as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import s from"../core/Handles.js";import{clone as a}from"../core/lang.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{getDeepValue as l}from"../core/object.js";import{throwIfAbortError as n}from"../core/promiseUtils.js";import{urlToObject as m,objectToQuery as p}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import h from"../geometry/Extent.js";import f from"./Layer.js";import v from"./WebTileLayer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import M from"./support/TileInfo.js";import T from"./support/TileInfoTilemapCache.js";import{WMTSLayerInfo as P}from"./support/WMTSLayerInfo.js";import b from"./support/WMTSSublayer.js";import{getTileUrlFromResourceUrls as j,getTileUrlTemplateFromResourceUrls as x,parseCapabilities as _,parseResourceInfo as E}from"./support/wmtsUtils.js";const C={"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":""},O=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let R=class extends(g(I(S(w(L(o(f))))))){constructor(...e){super(...e),this._sublayersHandles=new s,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.watch("activeLayer",((e,t)=>{t&&(t.layer=null),e&&(e.layer=this)}),!0),this.watch("sublayers",((e,t)=>{t&&(t.forEach((e=>{e.layer=null})),this._sublayersHandles.removeAll(),this._sublayersHandles=null),e&&(e.forEach((e=>{e.layer=this})),this._sublayersHandles||(this._sublayersHandles=new s),this._sublayersHandles.add([e.on("after-add",(({item:e})=>{e.layer=this})),e.on("after-remove",(({item:e})=>{e.layer=null}))]))}),!0)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if("KVP"===this.serviceMode||"RESTful"===this.serviceMode)return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(n).then((()=>this._fetchService(e))).catch((e=>{throw n(e),new i("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})}))),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new b);let i=t.layers.find((e=>e.id===this.activeLayer.id));return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=null==i?void 0:i.layerIdentifier;let o=null;const l=null==i?void 0:i.tileMatrixSet;l&&(Array.isArray(l)?l.length&&(o=l[0]):o=l);const n=null==s?void 0:s.format,m=null==s?void 0:s.style;return new b({id:a,imageFormat:n,styleId:m,tileMatrixSetId:o})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=l("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.indexOf("?")>-1?"KVP":"RESTful"}readSublayersFromService(e,t,r){return U(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets.map((e=>e.tileInfo.spatialReference)).toArray()}get tilemapCache(){var e,t;const r=null==(e=this.activeLayer)||null==(t=e.tileMatrixSet)?void 0:t.tileInfo;return new T(r)}get title(){var e,t;return null!=(e=null==(t=this.activeLayer)?void 0:t.title)?e:"Layer"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return this._get("url")}set url(e){e&&"/"===e.substr(-1)?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId).tileInfo,i=e.fullExtent,s=new P({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new v({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,r,i){const s=this.getTileUrl(e,r,i);return t(s,{responseType:"image"}).then((e=>e.data))}findSublayerById(e){return this.sublayers.find((t=>t.id===e))}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId).tileInfo.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let a=this.resourceInfo?"":j({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);if(!a){a=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)}return a=this._appendCustomLayerParameters(a),a}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=x({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return C[r.toLowerCase()]&&(s=C[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)"KVP"===this.resourceInfo.serviceMode&&(this.url+=this.url.indexOf("?")>-1?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e)}catch{const s="KVP"===this.serviceMode?"RESTful":"KVP";try{t=await this._getCapabilities(s,e),this.serviceMode=s}catch(r){throw new i("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:r})}}this.resourceInfo?t.data=E(t.data):t.data=_(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,r){const i=this._getCapabilitiesUrl(e);return await t(i,{...r,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id).tileMatrixSets.find((t=>t.id===e))}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=m(e),i={...r.query,...t},s=p(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){let t;return this.url=this.url.split("?")[0],"KVP"===e?t=this.url+"?request=GetCapabilities&service=WMTS&version="+this.version:"RESTful"===e&&(t=this.url+"/"+this.version+"/WMTSCapabilities.xml"),t=this._appendCustomParameters(t),t}_getLowerCasedUrlParams(e){if(!e)return null;const t=m(e).query;if(!t)return null;const r={};return Object.keys(t).forEach((e=>{r[e.toLowerCase()]=t[e]})),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?a(e):{},t.forEach((t=>{e.hasOwnProperty(t)||O.has(t)||(e[t]=r[t])})))}return e}};function U(e,t){return e.map((e=>{const r=new b;return r.read(e,t),r}))}e([u()],R.prototype,"dimensionMap",void 0),e([u()],R.prototype,"layerMap",void 0),e([u({type:b,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],R.prototype,"activeLayer",null),e([c("service","activeLayer",["layers"])],R.prototype,"readActiveLayerFromService",null),e([c(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],R.prototype,"readActiveLayerFromItemOrWebDoc",null),e([d(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:M},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],R.prototype,"writeActiveLayer",null),e([u({type:String,value:"",json:{write:!0}})],R.prototype,"copyright",void 0),e([u({type:["show","hide"]})],R.prototype,"listMode",void 0),e([u({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"}}}}})],R.prototype,"customParameters",void 0),e([c(["portal-item","web-document"],"customParameters")],R.prototype,"readCustomParameters",null),e([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],R.prototype,"customLayerParameters",void 0),e([u({type:h,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],R.prototype,"fullExtent",void 0),e([u({readOnly:!0})],R.prototype,"fullExtents",null),e([u({type:["WebTiledLayer"]})],R.prototype,"operationalLayerType",void 0),e([u()],R.prototype,"resourceInfo",void 0),e([u()],R.prototype,"serviceMode",void 0),e([c(["portal-item","web-document"],"serviceMode",["templateUrl"])],R.prototype,"readServiceMode",null),e([u({type:r.ofType(b)})],R.prototype,"sublayers",void 0),e([c("service","sublayers",["layers"])],R.prototype,"readSublayersFromService",null),e([u({readOnly:!0})],R.prototype,"supportedSpatialReferences",null),e([u({readOnly:!0})],R.prototype,"tilemapCache",null),e([u({json:{read:{source:"title"}}})],R.prototype,"title",null),e([u({json:{read:!1},readOnly:!0,value:"wmts"})],R.prototype,"type",void 0),e([u({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"}}}}})],R.prototype,"url",null),e([u()],R.prototype,"version",void 0),R=e([y("esri.layers.WMTSLayer")],R);const W=R;export{W as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import r from"../core/Collection.js";import i from"../core/Error.js";import s from"../core/Handles.js";import{clone as a}from"../core/lang.js";import{MultiOriginJSONMixin as o}from"../core/MultiOriginJSONSupport.js";import{getDeepValue as l}from"../core/object.js";import{throwIfAbortError as n}from"../core/promiseUtils.js";import{urlToObject as m,objectToQuery as p}from"../core/urlUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{reader as c}from"../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import h from"../geometry/Extent.js";import f from"./Layer.js";import v from"./WebTileLayer.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{OperationalLayer as w}from"./mixins/OperationalLayer.js";import{PortalLayer as L}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as S}from"./mixins/ScaleRangeLayer.js";import M from"./support/TileInfo.js";import T from"./support/TileInfoTilemapCache.js";import{WMTSLayerInfo as P}from"./support/WMTSLayerInfo.js";import b from"./support/WMTSSublayer.js";import{getTileUrlFromResourceUrls as j,getTileUrlTemplateFromResourceUrls as x,parseCapabilities as _,parseResourceInfo as E}from"./support/wmtsUtils.js";const C={"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 U=class extends(g(I(S(w(L(o(f))))))){constructor(...e){super(...e),this._sublayersHandles=new s,this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.watch("activeLayer",((e,t)=>{t&&(t.layer=null),e&&(e.layer=this)}),!0),this.watch("sublayers",((e,t)=>{t&&(t.forEach((e=>{e.layer=null})),this._sublayersHandles.removeAll(),this._sublayersHandles=null),e&&(e.forEach((e=>{e.layer=this})),this._sublayersHandles||(this._sublayersHandles=new s),this._sublayersHandles.add([e.on("after-add",(({item:e})=>{e.layer=this})),e.on("after-remove",(({item:e})=>{e.layer=null}))]))}),!0)}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){if("KVP"===this.serviceMode||"RESTful"===this.serviceMode)return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(n).then((()=>this._fetchService(e))).catch((e=>{throw n(e),new i("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:e})}))),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new b);let i=t.layers.find((e=>e.id===this.activeLayer.id));return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,a=null==i?void 0:i.layerIdentifier;let o=null;const l=null==i?void 0:i.tileMatrixSet;l&&(Array.isArray(l)?l.length&&(o=l[0]):o=l);const n=null==s?void 0:s.format,m=null==s?void 0:s.style;return new b({id:a,imageFormat:n,styleId:m,tileMatrixSetId:o})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const a=l("tileMatrixSet.tileInfo",s);t.tileInfo=a?a.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return O(t.layers,r)}get supportedSpatialReferences(){return this.activeLayer.tileMatrixSets.map((e=>e.tileInfo.spatialReference)).toArray()}get tilemapCache(){var e,t;const r=null==(e=this.activeLayer)||null==(t=e.tileMatrixSet)?void 0:t.tileInfo;return new T(r)}get title(){var e,t;return null!=(e=null==(t=this.activeLayer)?void 0:t.title)?e:"Layer"}set title(e){e?this._override("title",e):this._clearOverride("title")}get url(){return this._get("url")}set url(e){e&&"/"===e.substr(-1)?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=this._getTileMatrixSetById(e.tileMatrixSetId).tileInfo,i=e.fullExtent,s=new P({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new v({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,r,i){const s=this.getTileUrl(e,r,i);return t(s,{responseType:"image"}).then((e=>e.data))}findSublayerById(e){return this.sublayers.find((t=>t.id===e))}getTileUrl(e,t,r){const i=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId).tileInfo.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let a=this.resourceInfo?"":j({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);if(!a){a=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)}return a=this._appendCustomLayerParameters(a),a}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const r=x({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(r)return r}if("KVP"===this.serviceMode)return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if("RESTful"===this.serviceMode){let s="";return C[r.toLowerCase()]&&(s=C[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)"KVP"===this.resourceInfo.serviceMode&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e)}catch{const s="KVP"===this.serviceMode?"RESTful":"KVP";try{t=await this._getCapabilities(s,e),this.serviceMode=s}catch(r){throw new i("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:r})}}this.resourceInfo?t.data=E(t.data):t.data=_(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,r){const i=this._getCapabilitiesUrl(e);return await t(i,{...r,responseType:"text"})}_getTileMatrixSetById(e){return this.findSublayerById(this.activeLayer.id).tileMatrixSets.find((t=>t.id===e))}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...a(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=m(e),i={...r.query,...t},s=p(i);return""===s?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){let t;return this.url=this.url.split("?")[0],"KVP"===e?t=this.url+"?request=GetCapabilities&service=WMTS&version="+this.version:"RESTful"===e&&(t=this.url+"/"+this.version+"/WMTSCapabilities.xml"),t=this._appendCustomParameters(t),t}_getLowerCasedUrlParams(e){if(!e)return null;const t=m(e).query;if(!t)return null;const r={};return Object.keys(t).forEach((e=>{r[e.toLowerCase()]=t[e]})),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const t=Object.keys(r);t.length&&(e=e?a(e):{},t.forEach((t=>{e.hasOwnProperty(t)||R.has(t)||(e[t]=r[t])})))}return e}};function O(e,t){return e.map((e=>{const r=new b;return r.read(e,t),r}))}e([u()],U.prototype,"dimensionMap",void 0),e([u()],U.prototype,"layerMap",void 0),e([u({type:b,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],U.prototype,"activeLayer",null),e([c("service","activeLayer",["layers"])],U.prototype,"readActiveLayerFromService",null),e([c(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],U.prototype,"readActiveLayerFromItemOrWebDoc",null),e([d(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:M},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],U.prototype,"writeActiveLayer",null),e([u({type:String,value:"",json:{write:!0}})],U.prototype,"copyright",void 0),e([u({type:["show","hide"]})],U.prototype,"listMode",void 0),e([u({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"}}}}})],U.prototype,"customParameters",void 0),e([c(["portal-item","web-document"],"customParameters")],U.prototype,"readCustomParameters",null),e([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],U.prototype,"customLayerParameters",void 0),e([u({type:h,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],U.prototype,"fullExtent",void 0),e([u({readOnly:!0})],U.prototype,"fullExtents",null),e([u({type:["WebTiledLayer"]})],U.prototype,"operationalLayerType",void 0),e([u()],U.prototype,"resourceInfo",void 0),e([u()],U.prototype,"serviceMode",void 0),e([c(["portal-item","web-document"],"serviceMode",["templateUrl"])],U.prototype,"readServiceMode",null),e([u({type:r.ofType(b)})],U.prototype,"sublayers",void 0),e([c("service","sublayers",["layers"])],U.prototype,"readSublayersFromService",null),e([u({readOnly:!0})],U.prototype,"supportedSpatialReferences",null),e([u({readOnly:!0})],U.prototype,"tilemapCache",null),e([u({json:{read:{source:"title"}}})],U.prototype,"title",null),e([u({json:{read:!1},readOnly:!0,value:"wmts"})],U.prototype,"type",void 0),e([u({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"}}}}})],U.prototype,"url",null),e([u()],U.prototype,"version",void 0),U=e([y("esri.layers.WMTSLayer")],U);const W=U;export{W as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../request.js";import r from"../core/Error.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{replace as o}from"../core/string.js";import{Url as s,isProtocolRelative as i,normalize as n}from"../core/urlUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import c from"./Layer.js";import{BlendLayer as f}from"./mixins/BlendLayer.js";import{OperationalLayer as y}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RefreshableLayer as d}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import w from"./support/LOD.js";import g from"./support/TileInfo.js";import{WMTSLayerInfo as j}from"./support/WMTSLayerInfo.js";import T from"../geometry/Extent.js";import b from"../geometry/SpatialReference.js";import S from"../geometry/Point.js";let R=class extends(f(d(v(y(h(l(c))))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new T(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,b.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=b.WebMercator,this.subDomains=null,this.tileInfo=new g({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new S({x:-20037508.342787,y:20037508.342787,spatialReference:b.WebMercator}),spatialReference:b.WebMercator,lods:[new w({level:0,scale:591657527.591555,resolution:156543.033928}),new w({level:1,scale:295828763.795777,resolution:78271.5169639999}),new w({level:2,scale:147914381.897889,resolution:39135.7584820001}),new w({level:3,scale:73957190.948944,resolution:19567.8792409999}),new w({level:4,scale:36978595.474472,resolution:9783.93962049996}),new w({level:5,scale:18489297.737236,resolution:4891.96981024998}),new w({level:6,scale:9244648.868618,resolution:2445.98490512499}),new w({level:7,scale:4622324.434309,resolution:1222.99245256249}),new w({level:8,scale:2311162.217155,resolution:611.49622628138}),new w({level:9,scale:1155581.108577,resolution:305.748113140558}),new w({level:10,scale:577790.554289,resolution:152.874056570411}),new w({level:11,scale:288895.277144,resolution:76.4370282850732}),new w({level:12,scale:144447.638572,resolution:38.2185141425366}),new w({level:13,scale:72223.819286,resolution:19.1092570712683}),new w({level:14,scale:36111.909643,resolution:9.55462853563415}),new w({level:15,scale:18055.954822,resolution:4.77731426794937}),new w({level:16,scale:9027.977411,resolution:2.38865713397468}),new w({level:17,scale:4513.988705,resolution:1.19432856685505}),new w({level:18,scale:2256.994353,resolution:.597164283559817}),new w({level:19,scale:1128.497176,resolution:.298582141647617}),new w({level:20,scale:564.248588,resolution:.14929107082380833}),new w({level:21,scale:282.124294,resolution:.07464553541190416}),new w({level:22,scale:141.062147,resolution:.03732276770595208}),new w({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return"string"==typeof e?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then((()=>{let e="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const t=new s(this.urlTemplate);!!this.subDomains&&this.subDomains.length>0||-1===t.authority.indexOf("{subDomain}")||(e="is missing 'subDomains' property")}else e="spatialReference must match tileInfo.spatialReference";else e="is missing the required 'urlTemplate' property value";if(e)throw new r("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)}));return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&b.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,l=new s(t),o=l.scheme?l.scheme+"://":"//",i=o+l.authority+"/";if(-1===l.authority.indexOf("{subDomain}"))e.push(i);else if(r&&r.length>0&&l.authority.split(".").length>1)for(const s of r)e.push(o+l.authority.replace(/\{subDomain\}/gi,s)+"/");return e.map((e=>("/"!==e.charAt(e.length-1)&&(e+="/"),e)))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new s(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&i(e)&&(e="https:"+e),e&&(e=e.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),e=n(e)),t.templateUrl=e}fetchTile(e,r,l,o={}){const{signal:s}=o,i=this.getTileUrl(e,r,l),n={responseType:"image",signal:s,query:{...this.refreshParameters}};return t(i,n).then((e=>e.data))}getTileUrl(e,t,r){const l=this.levelValues[e];return this.tileServers[t%this.tileServers.length]+o(this.urlPath,{level:l,z:l,col:r,x:r,row:t,y:t})}};e([a({type:String,value:"",json:{write:!0}})],R.prototype,"copyright",void 0),e([a({type:T,json:{write:!0},nonNullable:!0})],R.prototype,"fullExtent",void 0),e([a({readOnly:!0,json:{read:!1,write:!1}})],R.prototype,"legendEnabled",void 0),e([a({type:["show","hide"]})],R.prototype,"listMode",void 0),e([a()],R.prototype,"levelValues",null),e([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],R.prototype,"isReference",void 0),e([a({type:["WebTiledLayer"],value:"WebTiledLayer"})],R.prototype,"operationalLayerType",void 0),e([a({readOnly:!0,json:{read:!1,write:!1}})],R.prototype,"popupEnabled",void 0),e([a({type:b})],R.prototype,"spatialReference",void 0),e([p("spatialReference",["spatialReference","fullExtent.spatialReference"])],R.prototype,"readSpatialReference",null),e([a({type:[String],json:{write:!0}})],R.prototype,"subDomains",void 0),e([a({type:g,json:{write:!0}})],R.prototype,"tileInfo",void 0),e([a({readOnly:!0})],R.prototype,"tileServers",null),e([a({json:{read:!1}})],R.prototype,"type",void 0),e([a()],R.prototype,"urlPath",null),e([a({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],R.prototype,"urlTemplate",void 0),e([p("urlTemplate",["urlTemplate","templateUrl"])],R.prototype,"readUrlTemplate",null),e([m("urlTemplate",{templateUrl:{type:String}})],R.prototype,"writeUrlTemplate",null),e([a({type:j,json:{write:!0}})],R.prototype,"wmtsInfo",void 0),R=e([u("esri.layers.WebTileLayer")],R);const x=R;export{x as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../geometry.js";import t from"../request.js";import r from"../core/Error.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{replace as o}from"../core/string.js";import{Url as s,isProtocolRelative as i,normalize as n}from"../core/urlUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{reader as p}from"../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import c from"./Layer.js";import{BlendLayer as y}from"./mixins/BlendLayer.js";import{OperationalLayer as f}from"./mixins/OperationalLayer.js";import{PortalLayer as h}from"./mixins/PortalLayer.js";import{RefreshableLayer as d}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as v}from"./mixins/ScaleRangeLayer.js";import w from"./support/LOD.js";import g from"./support/TileInfo.js";import{WMTSLayerInfo as j}from"./support/WMTSLayerInfo.js";import T from"../geometry/Extent.js";import b from"../geometry/SpatialReference.js";import S from"../geometry/Point.js";let R=class extends(y(d(v(f(h(l(c))))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new T(-20037508.342787,-20037508.34278,20037508.34278,20037508.342787,b.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=b.WebMercator,this.subDomains=null,this.tileInfo=new g({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new S({x:-20037508.342787,y:20037508.342787,spatialReference:b.WebMercator}),spatialReference:b.WebMercator,lods:[new w({level:0,scale:591657527.591555,resolution:156543.033928}),new w({level:1,scale:295828763.795777,resolution:78271.5169639999}),new w({level:2,scale:147914381.897889,resolution:39135.7584820001}),new w({level:3,scale:73957190.948944,resolution:19567.8792409999}),new w({level:4,scale:36978595.474472,resolution:9783.93962049996}),new w({level:5,scale:18489297.737236,resolution:4891.96981024998}),new w({level:6,scale:9244648.868618,resolution:2445.98490512499}),new w({level:7,scale:4622324.434309,resolution:1222.99245256249}),new w({level:8,scale:2311162.217155,resolution:611.49622628138}),new w({level:9,scale:1155581.108577,resolution:305.748113140558}),new w({level:10,scale:577790.554289,resolution:152.874056570411}),new w({level:11,scale:288895.277144,resolution:76.4370282850732}),new w({level:12,scale:144447.638572,resolution:38.2185141425366}),new w({level:13,scale:72223.819286,resolution:19.1092570712683}),new w({level:14,scale:36111.909643,resolution:9.55462853563415}),new w({level:15,scale:18055.954822,resolution:4.77731426794937}),new w({level:16,scale:9027.977411,resolution:2.38865713397468}),new w({level:17,scale:4513.988705,resolution:1.19432856685505}),new w({level:18,scale:2256.994353,resolution:.597164283559817}),new w({level:19,scale:1128.497176,resolution:.298582141647617}),new w({level:20,scale:564.248588,resolution:.14929107082380833}),new w({level:21,scale:282.124294,resolution:.07464553541190416}),new w({level:22,scale:141.062147,resolution:.03732276770595208}),new w({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return"string"==typeof e?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then((()=>{let e="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const t=new s(this.urlTemplate);!(!!this.subDomains&&this.subDomains.length>0)&&t.authority.includes("{subDomain}")&&(e="is missing 'subDomains' property")}else e="spatialReference must match tileInfo.spatialReference";else e="is missing the required 'urlTemplate' property value";if(e)throw new r("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${e}`)}));return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&b.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:r}=this,l=new s(t),o=l.scheme?l.scheme+"://":"//",i=o+l.authority+"/";if(l.authority.includes("{subDomain}")){if(r&&r.length>0&&l.authority.split(".").length>1)for(const s of r)e.push(o+l.authority.replace(/\{subDomain\}/gi,s)+"/")}else e.push(i);return e.map((e=>("/"!==e.charAt(e.length-1)&&(e+="/"),e)))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new s(e),r=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(r.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&i(e)&&(e="https:"+e),e&&(e=e.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),e=n(e)),t.templateUrl=e}fetchTile(e,r,l,o={}){const{signal:s}=o,i=this.getTileUrl(e,r,l),n={responseType:"image",signal:s,query:{...this.refreshParameters}};return t(i,n).then((e=>e.data))}getTileUrl(e,t,r){const l=this.levelValues[e];return this.tileServers[t%this.tileServers.length]+o(this.urlPath,{level:l,z:l,col:r,x:r,row:t,y:t})}};e([a({type:String,value:"",json:{write:!0}})],R.prototype,"copyright",void 0),e([a({type:T,json:{write:!0},nonNullable:!0})],R.prototype,"fullExtent",void 0),e([a({readOnly:!0,json:{read:!1,write:!1}})],R.prototype,"legendEnabled",void 0),e([a({type:["show","hide"]})],R.prototype,"listMode",void 0),e([a()],R.prototype,"levelValues",null),e([a({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],R.prototype,"isReference",void 0),e([a({type:["WebTiledLayer"],value:"WebTiledLayer"})],R.prototype,"operationalLayerType",void 0),e([a({readOnly:!0,json:{read:!1,write:!1}})],R.prototype,"popupEnabled",void 0),e([a({type:b})],R.prototype,"spatialReference",void 0),e([p("spatialReference",["spatialReference","fullExtent.spatialReference"])],R.prototype,"readSpatialReference",null),e([a({type:[String],json:{write:!0}})],R.prototype,"subDomains",void 0),e([a({type:g,json:{write:!0}})],R.prototype,"tileInfo",void 0),e([a({readOnly:!0})],R.prototype,"tileServers",null),e([a({json:{read:!1}})],R.prototype,"type",void 0),e([a()],R.prototype,"urlPath",null),e([a({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],R.prototype,"urlTemplate",void 0),e([p("urlTemplate",["urlTemplate","templateUrl"])],R.prototype,"readUrlTemplate",null),e([m("urlTemplate",{templateUrl:{type:String}})],R.prototype,"writeUrlTemplate",null),e([a({type:j,json:{write:!0}})],R.prototype,"wmtsInfo",void 0),R=e([u("esri.layers.WebTileLayer")],R);const x=R;export{x as default};