@arcgis/core 5.2.0-next.20 → 5.2.0-next.22

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 (271) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0eb0ce43b4813cae968f.js +2 -0
  4. package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js → 162dada6a199d1efdf86.js} +2 -2
  5. package/assets/esri/core/workers/chunks/1a4bec464daa9662ab2a.js +1 -0
  6. package/assets/esri/core/workers/chunks/{b375abfb2a2d9c63e20a.js → 2255a21c7b959f04d941.js} +1 -1
  7. package/assets/esri/core/workers/chunks/292498a9c7d462d215c6.js +1 -0
  8. package/assets/esri/core/workers/chunks/2ef80e003b4f0393ac2e.js +1 -0
  9. package/assets/esri/core/workers/chunks/{4517630bf869205bab87.js → 38a76bc4ef5c10ab0488.js} +1 -1
  10. package/assets/esri/core/workers/chunks/3b4fc67f6cb7393fbd97.js +1 -0
  11. package/assets/esri/core/workers/chunks/{8ce4fe00328173224ed2.js → 44e32ed3a570593a7245.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{db26cf2c2735183294b8.js → 50345dfc00380b158c96.js} +1 -1
  13. package/assets/esri/core/workers/chunks/5468a65698931603656d.js +1 -0
  14. package/assets/esri/core/workers/chunks/5b42f8aa0247adc2d065.js +1 -0
  15. package/assets/esri/core/workers/chunks/{d7acbc2ddff4cee8a465.js → 5ee887fc6e1e0e70e02f.js} +1 -1
  16. package/assets/esri/core/workers/chunks/66c2cfe11161d5dc989a.js +1 -0
  17. package/assets/esri/core/workers/chunks/6c0c77de1934f35dc45f.js +1 -0
  18. package/assets/esri/core/workers/chunks/{f7f820483e45c05ab9e4.js → 75df436e6e9773bdcfc2.js} +1 -1
  19. package/assets/esri/core/workers/chunks/780519b60aa674a61a74.js +1 -0
  20. package/assets/esri/core/workers/chunks/{a2247f4c3116efb16c4f.js → 7e23de8d9b2d938808f6.js} +1 -1
  21. package/assets/esri/core/workers/chunks/7fc8516111bd869256fc.js +1 -0
  22. package/assets/esri/core/workers/chunks/8579eba21f40630d073d.js +1 -0
  23. package/assets/esri/core/workers/chunks/{72edd08a2ff08970ba38.js → 87011d2fe14c54e296af.js} +1 -1
  24. package/assets/esri/core/workers/chunks/928b18e13e015330d44b.js +1 -0
  25. package/assets/esri/core/workers/chunks/93b40245378ced43ca08.js +1 -0
  26. package/assets/esri/core/workers/chunks/9434c76ad39c936dba90.js +1 -0
  27. package/assets/esri/core/workers/chunks/98dfe31e8ed9b522eaff.js +1 -0
  28. package/assets/esri/core/workers/chunks/{4104a0585969f8cd524c.js → a40ede4d3375184f21fe.js} +1 -1
  29. package/assets/esri/core/workers/chunks/a533d066cac26124c5ce.js +1 -0
  30. package/assets/esri/core/workers/chunks/a536904fe6f3b16fdbdc.js +1 -0
  31. package/assets/esri/core/workers/chunks/a54773c9bbc751619b3f.js +2 -0
  32. package/assets/esri/core/workers/chunks/a8167ab9fd846d699be5.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dd0c1cf921369e2bc48b.js → a90619adff41658f8057.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{ac16016964be3b684e98.js → aded4e704e09a28edc8f.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js → b0b3c67b7d37bd854d95.js} +2 -2
  36. package/assets/esri/core/workers/chunks/b419fd36337e76e2d4a3.js +680 -0
  37. package/assets/esri/core/workers/chunks/{05d597dd117766beadd8.js → b91a15522692781560b4.js} +1 -1
  38. package/assets/esri/core/workers/chunks/be4275a4b8977ec3eb61.js +1 -0
  39. package/assets/esri/core/workers/chunks/{e8d65900eefff1152207.js → c593539c2cce7a2b9d44.js} +1 -1
  40. package/assets/esri/core/workers/chunks/c86d388d216adbb15a05.js +1 -0
  41. package/assets/esri/core/workers/chunks/{0b522e05668bef729b1b.js → ceb5bd9f2afaa2ea0808.js} +1 -1
  42. package/assets/esri/core/workers/chunks/d07068c44d560e4ce02e.js +1 -0
  43. package/assets/esri/core/workers/chunks/{595bc41ff36c77324d01.js → d4e0346209fabc58f929.js} +9 -9
  44. package/assets/esri/core/workers/chunks/{5809e70a8e57e9b05959.js → dd795c95cdc3812b5b49.js} +1 -1
  45. package/assets/esri/core/workers/chunks/e29c8c10331edfa83277.js +1 -0
  46. package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js → ef94d25d1cceb25ea9fe.js} +2 -2
  47. package/assets/esri/core/workers/chunks/f02a9408ba3893484c6c.js +1 -0
  48. package/assets/esri/core/workers/chunks/f7344d855f1092383abe.js +1 -0
  49. package/assets/esri/core/workers/chunks/{5f63077ec5ba3560491b.js → fb9f8b6cc2b4ae5b60df.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{ecbf84a1f42e6188faab.js → fd629872b5c07853f695.js} +1 -1
  51. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  52. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -1
  53. package/assets/esri/themes/dark/main.css +1 -1
  54. package/assets/esri/themes/light/main.css +1 -1
  55. package/assets/esri/themes/light/view.css +1 -1
  56. package/chunks/GaussianSplat.glsl.js +4 -4
  57. package/chunks/GaussianSplatShadow.glsl.js +1 -1
  58. package/chunks/Pattern.glsl.js +17 -17
  59. package/chunks/RibbonLine.glsl.js +45 -43
  60. package/chunks/bundle2.js +1 -1
  61. package/config.js +1 -1
  62. package/core/date.js +1 -1
  63. package/form/FormTemplate.d.ts +15 -20
  64. package/form/elements/AttachmentElement.d.ts +38 -11
  65. package/form/elements/Element.d.ts +9 -6
  66. package/form/elements/FieldElement.d.ts +0 -1
  67. package/form/elements/GroupElement.d.ts +4 -6
  68. package/form/elements/RelationshipElement.d.ts +8 -8
  69. package/form/elements/inputs/attachments/AttachmentInput.d.ts +34 -18
  70. package/form/elements/inputs/attachments/AudioInput.d.ts +4 -3
  71. package/form/elements/inputs/attachments/DocumentInput.d.ts +2 -6
  72. package/form/elements/inputs/attachments/ImageInput.d.ts +4 -3
  73. package/form/elements/inputs/attachments/Input.d.ts +6 -3
  74. package/form/elements/inputs/attachments/SignatureInput.d.ts +3 -3
  75. package/form/elements/inputs/attachments/VideoInput.d.ts +4 -3
  76. package/form/elements.d.ts +6 -12
  77. package/form/types.d.ts +0 -4
  78. package/geometry/support/geometryUtils.js +1 -1
  79. package/geometry/support/intersects.js +1 -1
  80. package/geometry/support/intersectsBase.js +1 -1
  81. package/kernel.js +1 -1
  82. package/layers/AnnotationFeatureLayer.d.ts +44 -0
  83. package/layers/AnnotationFeatureLayer.js +1 -1
  84. package/layers/DimensionFeatureLayer.d.ts +40 -0
  85. package/layers/DimensionFeatureLayer.js +1 -1
  86. package/layers/DimensionLayer.d.ts +1 -0
  87. package/layers/FeatureLayer.js +1 -1
  88. package/layers/IntegratedMesh3DTilesLayer.d.ts +9 -1
  89. package/layers/OrientedImageryLayer.js +1 -1
  90. package/layers/ParquetLayer.d.ts +6 -10
  91. package/layers/ParquetLayer.js +1 -1
  92. package/layers/graphics/data/attributeSupport.js +1 -1
  93. package/layers/graphics/data/queryValidationUtils.js +1 -1
  94. package/layers/graphics/sources/ParquetSource.js +1 -1
  95. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  96. package/layers/graphics/sources/geojson/geojson.js +1 -1
  97. package/layers/graphics/sources/parquet/FileProvider.js +1 -1
  98. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  99. package/layers/graphics/sources/parquet/fileProviderChangedError.js +2 -0
  100. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  101. package/layers/mixins/ArcGISImageService.js +1 -1
  102. package/layers/mixins/EditBusLayer.js +1 -1
  103. package/layers/orientedImagery/core/utils.js +1 -1
  104. package/layers/raster/datasets/WCSRaster.js +1 -1
  105. package/layers/support/AnnotationFeatureSublayer.d.ts +5 -3
  106. package/layers/support/RasterBandInfo.js +1 -1
  107. package/layers/support/SymbolLayerDrawing.js +1 -1
  108. package/layers/types.d.ts +1 -0
  109. package/package.json +2 -2
  110. package/rest/support/AttachmentQuery.d.ts +13 -1
  111. package/rest/support/AttachmentQuery.js +1 -1
  112. package/rest/support/OutDistance.d.ts +5 -1
  113. package/rest/support/PrintParameters.d.ts +2 -1
  114. package/rest/support/Query.d.ts +2 -0
  115. package/support/basemapUtils.js +1 -1
  116. package/support/revision.js +1 -1
  117. package/symbols/SimpleMarkerSymbol.d.ts +2 -2
  118. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  119. package/views/2d/engine/AFeatureContainer.js +1 -1
  120. package/views/2d/engine/transitions/FadeTransition.js +1 -1
  121. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  122. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  123. package/views/2d/engine/webgl/TileCpuState.js +1 -1
  124. package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
  125. package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
  126. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js +1 -1
  127. package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
  128. package/views/2d/engine/webgl/shaderGraph/techniques/mesh/MeshWriter.js +1 -1
  129. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
  130. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js +1 -1
  131. package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
  132. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  133. package/views/2d/layers/LayerView2D.js +1 -1
  134. package/views/2d/layers/MediaLayerView2D.js +1 -1
  135. package/views/2d/layers/features/FeatureContainer.js +1 -1
  136. package/views/2d/layers/features/RenderState.js +1 -1
  137. package/views/2d/layers/features/aggregation/GeohashSpatialIndex.js +1 -1
  138. package/views/2d/layers/features/aggregation/GridSpatialIndex.js +1 -1
  139. package/views/2d/layers/features/layerAdapters/AnnotationLayerAdapter.js +1 -1
  140. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  141. package/views/2d/layers/features/schema/processor/SimpleProcessorSchema.js +1 -1
  142. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  143. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  144. package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
  145. package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
  146. package/views/2d/layers/support/annodime/cimAnnotations.js +1 -1
  147. package/views/3d/analysis/LineOfSight/LineOfSightDrawToolRenderer.js +1 -1
  148. package/views/3d/analysis/LineOfSight/LineOfSightInteractionVisuals.js +2 -0
  149. package/views/3d/analysis/LineOfSight/LineOfSightPlacementController.js +1 -1
  150. package/views/3d/analysis/LineOfSight/LineOfSightReshapeTool3D.js +1 -1
  151. package/views/3d/analysis/LineOfSight/LineOfSightTool2.js +1 -1
  152. package/views/3d/analysis/LineOfSight/lineOfSightPlacementUtils.js +1 -1
  153. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  154. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  155. package/views/3d/interactive/editingTools/reshape/ReshapeTool3D.js +1 -1
  156. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  157. package/views/3d/layers/GaussianSplatLayerViewPerformanceInfo.js +1 -1
  158. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  159. package/views/3d/layers/graphics/Graphics3DPathSymbolLayerConstants.js +1 -1
  160. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  161. package/views/3d/state/utils/navigationUtils.js +1 -1
  162. package/views/3d/support/gaussianSplatting/GaussianSplatAtlasPages.js +1 -1
  163. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  164. package/views/3d/support/gaussianSplatting/GaussianSplatHeaderTexture.js +2 -0
  165. package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
  166. package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
  167. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +11 -11
  168. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +6 -9
  169. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +46 -46
  170. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +46 -18
  171. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +22 -22
  172. package/views/3d/webgl-engine/core/shaderLibrary/output/Emissions.glsl.js +4 -4
  173. package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +13 -12
  174. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  175. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  176. package/views/3d/webgl-engine/effects/glow/Glow.js +1 -1
  177. package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
  178. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  179. package/views/3d/webgl-engine/lib/GaussianSplatShadowRenderNode.js +1 -1
  180. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  181. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  182. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  183. package/views/3d/webgl-engine/lib/PathGeometry.js +1 -1
  184. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  185. package/views/3d/webgl-engine/lib/PathVertexInfo.js +1 -1
  186. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  187. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  188. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferUtils.js +1 -1
  189. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
  190. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  191. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  192. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  193. package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
  194. package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +1 -1
  195. package/views/3d/webgl-engine/shaders/PatternTextureBuffer.glsl.js +1 -1
  196. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  197. package/views/3d/webgl-engine/shaders/RibbonLineLayouts.js +1 -1
  198. package/views/3d/webgl-engine/shaders/RibbonLineTextureBuffer.glsl.js +2 -0
  199. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +10 -10
  200. package/views/View2D.d.ts +2 -2
  201. package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
  202. package/views/layers/AnnotationFeatureLayerView.d.ts +9 -1
  203. package/views/layers/DimensionFeatureLayerView.d.ts +9 -1
  204. package/views/layers/FeatureLikeLayerView.js +1 -1
  205. package/views/webgl/ShaderBuilder.js +1 -1
  206. package/widgets/BasemapGallery.js +1 -1
  207. package/widgets/BatchAttributeForm/attachmentUtils.js +1 -1
  208. package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
  209. package/widgets/BatchAttributeForm/css.js +1 -1
  210. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  211. package/widgets/BatchAttributeForm.js +1 -1
  212. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  213. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  214. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  215. package/widgets/Editor/UpdateWorkflow.js +1 -1
  216. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  217. package/widgets/Editor/types.d.ts +12 -0
  218. package/widgets/Editor/workflowUtils.js +1 -1
  219. package/widgets/Editor.js +1 -1
  220. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +16 -12
  221. package/widgets/FeatureForm.d.ts +14 -16
  222. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  223. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  224. package/widgets/FeatureTable/Grid/types.d.ts +20 -0
  225. package/widgets/FeatureTable.d.ts +14 -2
  226. package/widgets/FeatureTable.js +1 -1
  227. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  228. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  229. package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
  230. package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
  231. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  232. package/widgets/OrientedImageryViewer/constants.js +1 -1
  233. package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
  234. package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
  235. package/widgets/OrientedImageryViewer/support/panConstraint.js +2 -0
  236. package/widgets/OrientedImageryViewer.js +1 -1
  237. package/widgets/Print/CustomTemplate.d.ts +7 -0
  238. package/widgets/Search/LayerSearchSource.d.ts +3 -0
  239. package/widgets/ShadowCast/ShadowCastViewModel.js +1 -1
  240. package/assets/esri/core/workers/chunks/0a259137932211b80f0e.js +0 -1
  241. package/assets/esri/core/workers/chunks/26aa8190ac439f634c5b.js +0 -1
  242. package/assets/esri/core/workers/chunks/3192586ec7fc73ed1165.js +0 -1
  243. package/assets/esri/core/workers/chunks/35a508a9311689d8df52.js +0 -1
  244. package/assets/esri/core/workers/chunks/3e89f487c5851c954d8b.js +0 -1
  245. package/assets/esri/core/workers/chunks/4fdd38d7362bf09a994b.js +0 -1
  246. package/assets/esri/core/workers/chunks/501fa9b029df2e7b73c3.js +0 -2
  247. package/assets/esri/core/workers/chunks/5216dd0544e901039c84.js +0 -1
  248. package/assets/esri/core/workers/chunks/5f0bc019add4aff3130c.js +0 -1
  249. package/assets/esri/core/workers/chunks/630ad47857de3cf726d1.js +0 -1
  250. package/assets/esri/core/workers/chunks/6ac09f4e85c664a17365.js +0 -1
  251. package/assets/esri/core/workers/chunks/6e8b9c03240ec372b587.js +0 -1
  252. package/assets/esri/core/workers/chunks/74922daaedb479ec6f03.js +0 -1
  253. package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +0 -1
  254. package/assets/esri/core/workers/chunks/7ee76504e7fea389a1c9.js +0 -1
  255. package/assets/esri/core/workers/chunks/912a8743a02f467b63b0.js +0 -2
  256. package/assets/esri/core/workers/chunks/9def4619d102f1d41578.js +0 -1
  257. package/assets/esri/core/workers/chunks/a0876a52a3c2ad849370.js +0 -1
  258. package/assets/esri/core/workers/chunks/a3c5b754a6fa0f4250bf.js +0 -1
  259. package/assets/esri/core/workers/chunks/a98905bf6050ad3b8721.js +0 -633
  260. package/assets/esri/core/workers/chunks/bf67e0f6064fb9d94ac8.js +0 -1
  261. package/assets/esri/core/workers/chunks/c9e5d3f496cefb8e3934.js +0 -1
  262. package/assets/esri/core/workers/chunks/cd892f429d5ffe8de99e.js +0 -1
  263. package/assets/esri/core/workers/chunks/d34d41a350facfa9b7c0.js +0 -1
  264. package/assets/esri/core/workers/chunks/d5a0e3a73df827dc7b06.js +0 -1
  265. package/assets/esri/core/workers/chunks/e5471373f89fd7cb9844.js +0 -1
  266. package/assets/esri/core/workers/chunks/ff00ac01f0baaecaa890.js +0 -1
  267. /package/assets/esri/core/workers/chunks/{912a8743a02f467b63b0.js.LICENSE.txt → 0eb0ce43b4813cae968f.js.LICENSE.txt} +0 -0
  268. /package/assets/esri/core/workers/chunks/{2dbd88566abac030e965.js.LICENSE.txt → 162dada6a199d1efdf86.js.LICENSE.txt} +0 -0
  269. /package/assets/esri/core/workers/chunks/{44b30bce8e9a75b9e1b3.js.LICENSE.txt → a54773c9bbc751619b3f.js.LICENSE.txt} +0 -0
  270. /package/assets/esri/core/workers/chunks/{eccbddaec4be44c86f79.js.LICENSE.txt → b0b3c67b7d37bd854d95.js.LICENSE.txt} +0 -0
  271. /package/assets/esri/core/workers/chunks/{501fa9b029df2e7b73c3.js.LICENSE.txt → ef94d25d1cceb25ea9fe.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import L from"../graphic/FeatureGraphicOrigin.js";import E from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as q}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as M}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as A}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{PublishableLayer as G}from"./mixins/PublishableLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{TrackableLayer as H}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as Z,parse as $,cleanTitle as k}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as z,id as K,labelsVisible as X,opacityDrawingInfo as Y,legendEnabled as ee,listMode as te,popupEnabled as re,screenSizePerspectiveEnabled as ie}from"./support/commonProperties.js";import{ensureLayerCredential as oe,computeEffectiveEditingEnabled as se,readGlobalIdField as ae,readObjectIdField as ne,createDefaultRenderer as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as he,getFeatureType as fe,getFieldDomain as be,queryAttachments as ge,queryObjectIds as we,queryFeatureCount as ve,queryExtent as Fe,queryRelatedFeatures as Te,queryRelatedFeaturesCount as je,validateBinsQuery as Se,hasDataChanged as Ie,geometryTypeKebabDict as Le}from"./support/featureLayerUtils.js";import Ee from"./support/FeatureTemplate.js";import De from"./support/FeatureType.js";import _e from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ce,fieldConfigurationsFromPopupTemplate as Pe,fieldConfigurationsFromFields as Oe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as xe}from"./support/fieldProperties.js";import{fixRendererFields as qe,fixTimeInfoFields as Me}from"./support/fieldUtils.js";import Ae from"./support/LabelClass.js";import{reader as Re}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Ue from"./support/SymbolLayerDrawing.js";import Ve from"./support/TimeInfo.js";import Ne from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ge}from"./support/versionUtils.js";import{read as Je}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Be}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as We,rendererTypes as He}from"../renderers/support/typeUtils.js";import Ze from"../rest/layerSources/DynamicDataLayer.js";import $e from"../rest/support/FeatureSet.js";import ke from"../rest/support/Query.js";import{isNumber as ze}from"../support/guards.js";import{createPopupTemplate as Ke}from"../support/popupUtils.js";import{symbolTypes as Xe}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Ye}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as et}from"../webdoc/support/unsupportedErrors.js";import{reader as tt}from"../core/accessorSupport/decorators/reader.js";import{writer as rt}from"../core/accessorSupport/decorators/writer.js";const it="FeatureLayer";function ot(e){return e&&e instanceof a}const st=xe();function at(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let nt=class extends(R(Q(A(G(M(q(P(V(W(x(H(B(J(C(U(N(m(O(_(s(E))))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new L(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("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(()=>oe(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ne({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}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}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}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)}get effectiveEditingEnabled(){return se(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ce(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Pe(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return ae(t.layerDefinition||t)}readObjectIdField(e,t){return ne(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){qe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Je(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return le(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),ot(t)&&this._resetMemorySource(t),ot(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=$e.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Ee.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let e=r;if(!e&&this.url){const t=$(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),k(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||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}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=De.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t,r){const i=await pe(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,r,i){const o=await ue(this,e,t,r,it,i);return this.lastEditsEventDate=new Date,o}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}createFieldConfigurations(){return Oe(this)}createPopupTemplate(e){return Ke(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t,r){const i=await me(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return he(this,e,it)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return fe(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return be(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return ge(this,e,t,it)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(ke.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await we(this,e,t,it)}async queryFeatureCount(e,t){return ve(this,e,t,it)}async queryExtent(e,t){return Fe(this,e,t,it)}async queryRelatedFeatures(e,t){return Te(this,e,t,it)}async queryRelatedFeaturesCount(e,t){return je(this,e,t,it)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(it,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(it,"Layer source does not support queryAttributeBins capability");Se(e,i,it);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ze)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return et(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return et(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return et(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return et(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(it,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ge(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),qe(this.renderer,this.fieldsIndex),Me(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Be(this,{origin:"service"})}async hasDataChanged(){return Ie(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: 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+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([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.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],nt.prototype,"_titleCreator",null),r([F(z)],nt.prototype,"attributeTableTemplate",void 0),r([tt("service","capabilities")],nt.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],nt.prototype,"charts",void 0),r([F({readOnly:!0})],nt.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],nt.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],nt.prototype,"displayField",void 0),r([F({types:Xe,readOnly:!0})],nt.prototype,"defaultSymbol",void 0),r([F({type:Ze})],nt.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],nt.prototype,"editingEnabled",null),r([tt(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],nt.prototype,"readEditingEnabled",null),r([tt("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],nt.prototype,"readEditingEnabledFromWebMap",null),r([rt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabled",null),r([rt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],nt.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],nt.prototype,"featureTitleFields",null),r([F({type:[_e],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],nt.prototype,"fieldConfigurations",null),r([F({...st.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:at}}}}})],nt.prototype,"fields",void 0),r([F(st.fieldsIndex)],nt.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],nt.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],nt.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:at,writer(e,t,r){const i=e?Le.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Le.read}}})],nt.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],nt.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],nt.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],nt.prototype,"hasZ",void 0),r([F(K)],nt.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],nt.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],nt.prototype,"isTable",void 0),r([tt("service","isTable",["type","geometryType"]),tt("isTable",["layerDefinition.type","layerDefinition.geometryType"])],nt.prototype,"readIsTable",null),r([rt("web-map","isTable")],nt.prototype,"writeIsTable",null),r([F(X)],nt.prototype,"labelsVisible",void 0),r([F({type:[Ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Re,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Re,write:{layerContainerTypes:j}}})],nt.prototype,"labelingInfo",void 0),r([F({type:Ue,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],nt.prototype,"symbolLayerDrawing",void 0),r([F((()=>{const e=d(Y);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Ye(e),t)}}},e})())],nt.prototype,"opacity",void 0),r([F(ee)],nt.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],nt.prototype,"listMode",void 0),r([tt("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],nt.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:at}}}}})],nt.prototype,"objectIdField",void 0),r([tt("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],nt.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],nt.prototype,"operationalLayerType",void 0),r([F(st.outFields)],nt.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],nt.prototype,"path",void 0),r([F(re)],nt.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],nt.prototype,"popupTemplate",void 0),r([rt("popupTemplate")],nt.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"defaultPopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"reloading",void 0),r([F({types:He,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:We,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],nt.prototype,"renderer",null),r([tt("service","renderer",["drawingInfo.renderer","defaultSymbol"]),tt("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],nt.prototype,"readRenderer",null),r([F()],nt.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(ie);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],nt.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],nt.prototype,"source",null),r([tt("portal-item","source",["featureSet"]),tt("web-map","source",["featureSet"])],nt.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],nt.prototype,"spatialReference",void 0),r([F({type:Number})],nt.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],nt.prototype,"subtypeField",void 0),r([F({readOnly:!1})],nt.prototype,"subtypes",void 0),r([F({type:[Ee]})],nt.prototype,"templates",void 0),r([tt("templates",["editFieldsInfo","creatorField","editorField","templates"])],nt.prototype,"readTemplates",null),r([F({type:Ve})],nt.prototype,"timeInfo",void 0),r([F()],nt.prototype,"title",void 0),r([tt("service","title",["name"]),tt("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],nt.prototype,"readTitle",null),r([tt("web-map","title",["layerDefinition.name","title"])],nt.prototype,"readTitleFromWebMap",null),r([F({type:String})],nt.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],nt.prototype,"type",void 0),r([F({type:String})],nt.prototype,"typeIdField",void 0),r([tt("service","typeIdField"),tt("typeIdField",["layerDefinition.typeIdField"])],nt.prototype,"readTypeIdField",null),r([F({type:[De]})],nt.prototype,"types",void 0),r([tt("service","types",["types"]),tt("types",["layerDefinition.types"])],nt.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],nt.prototype,"visible",void 0),r([tt("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],nt.prototype,"readVisible",null),nt=r([T("esri.layers.FeatureLayer")],nt);export{nt as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import L from"../graphic/FeatureGraphicOrigin.js";import D from"./Layer.js";import{MemorySource as E}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DataSeriesLayer as x}from"./mixins/DataSeriesLayer.js";import{DisplayFilteredLayer as q}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as M}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as A}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as R}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{OrderedLayer as V}from"./mixins/OrderedLayer.js";import{PortalLayer as N}from"./mixins/PortalLayer.js";import{PublishableLayer as G}from"./mixins/PublishableLayer.js";import{RefreshableLayer as J}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as B}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as W}from"./mixins/TemporalLayer.js";import{TrackableLayer as H}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as Z,parse as $,cleanTitle as k}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as z,id as K,labelsVisible as X,opacityDrawingInfo as Y,legendEnabled as ee,listMode as te,popupEnabled as re,screenSizePerspectiveEnabled as ie}from"./support/commonProperties.js";import{ensureLayerCredential as oe,computeEffectiveEditingEnabled as se,readGlobalIdField as ae,readObjectIdField as ne,createDefaultRenderer as le,addAttachment as pe,updateAttachment as ue,applyEdits as de,uploadAssets as ye,createQuery as ce,deleteAttachments as me,fetchRecomputedExtents as he,getFeatureType as fe,getFieldDomain as be,queryAttachments as ge,queryObjectIds as we,queryFeatureCount as ve,queryExtent as Fe,queryRelatedFeatures as Te,queryRelatedFeaturesCount as je,validateBinsQuery as Se,hasDataChanged as Ie,geometryTypeKebabDict as Le}from"./support/featureLayerUtils.js";import De from"./support/FeatureTemplate.js";import Ee from"./support/FeatureType.js";import _e from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as Ce,fieldConfigurationsFromPopupTemplate as Pe,fieldConfigurationsFromFields as Oe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as xe}from"./support/fieldProperties.js";import{fixRendererFields as qe,fixTimeInfoFields as Me}from"./support/fieldUtils.js";import Ae from"./support/LabelClass.js";import{reader as Re}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Ue from"./support/SymbolLayerDrawing.js";import Ve from"./support/TimeInfo.js";import Ne from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ge}from"./support/versionUtils.js";import{read as Je}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Be}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as We,rendererTypes as He}from"../renderers/support/typeUtils.js";import Ze from"../rest/layerSources/DynamicDataLayer.js";import $e from"../rest/support/FeatureSet.js";import ke from"../rest/support/Query.js";import{isNumber as ze}from"../support/guards.js";import{createPopupTemplate as Ke}from"../support/popupUtils.js";import{symbolTypes as Xe}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Ye}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as et}from"../webdoc/support/unsupportedErrors.js";import{reader as tt}from"../core/accessorSupport/decorators/reader.js";import{writer as rt}from"../core/accessorSupport/decorators/writer.js";const it="FeatureLayer";function ot(e){return e&&e instanceof a}const st=xe();function at(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let nt=class extends(R(Q(A(G(M(q(P(V(W(x(H(B(J(C(U(N(m(O(_(s(D))))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new L(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("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(()=>oe(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ne({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}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}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}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)}get effectiveEditingEnabled(){return se(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=Ce(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Pe(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readSymbolLayerDrawing(e,t){const r=t.layerDefinition?.drawingInfo,i=r?.renderer,o=r?.symbolLayerDrawing;return i&&o?new Ue(o):null}readGlobalIdField(e,t){return ae(t.layerDefinition||t)}readObjectIdField(e,t){return ne(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){qe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Je(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return le(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new E({layer:this,items:e})),ot(t)&&this._resetMemorySource(t),ot(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=$e.fromJSON(t.featureSet);return new E({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>De.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?Z(this.url,r):r;let e=r;if(!e&&this.url){const t=$(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),k(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||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}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Ee.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t,r){const i=await pe(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async updateAttachment(e,t,r,i){const o=await ue(this,e,t,r,it,i);return this.lastEditsEventDate=new Date,o}async applyEdits(e,t){return de(this,e,t)}async uploadAssets(e,t){return ye(this,e,t)}createFieldConfigurations(){return Oe(this)}createPopupTemplate(e){return Ke(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ce(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t,r){const i=await me(this,e,t,it,r);return this.lastEditsEventDate=new Date,i}async fetchRecomputedExtents(e){return he(this,e,it)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return fe(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return be(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return ge(this,e,t,it)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures(ke.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await we(this,e,t,it)}async queryFeatureCount(e,t){return ve(this,e,t,it)}async queryExtent(e,t){return Fe(this,e,t,it)}async queryRelatedFeatures(e,t){return Te(this,e,t,it)}async queryRelatedFeaturesCount(e,t){return je(this,e,t,it)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(it,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(it,"Layer source does not support queryAttributeBins capability");Se(e,i,it);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ze)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(it,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return et(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return et(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return et(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return et(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(it,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ge(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),qe(this.renderer,this.fieldsIndex),Me(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Be(this,{origin:"service"})}async hasDataChanged(){return Ie(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: 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+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([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.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],nt.prototype,"_titleCreator",null),r([F(z)],nt.prototype,"attributeTableTemplate",void 0),r([tt("service","capabilities")],nt.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],nt.prototype,"charts",void 0),r([F({readOnly:!0})],nt.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],nt.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],nt.prototype,"displayField",void 0),r([F({types:Xe,readOnly:!0})],nt.prototype,"defaultSymbol",void 0),r([F({type:Ze})],nt.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],nt.prototype,"editingEnabled",null),r([tt(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],nt.prototype,"readEditingEnabled",null),r([tt("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],nt.prototype,"readEditingEnabledFromWebMap",null),r([rt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabled",null),r([rt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],nt.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],nt.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],nt.prototype,"featureTitleFields",null),r([F({type:[_e],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],nt.prototype,"fieldConfigurations",null),r([F({...st.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:at}}}}})],nt.prototype,"fields",void 0),r([F(st.fieldsIndex)],nt.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],nt.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],nt.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:at,writer(e,t,r){const i=e?Le.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Le.read}}})],nt.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],nt.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],nt.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],nt.prototype,"hasZ",void 0),r([F(K)],nt.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],nt.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],nt.prototype,"isTable",void 0),r([tt("service","isTable",["type","geometryType"]),tt("isTable",["layerDefinition.type","layerDefinition.geometryType"])],nt.prototype,"readIsTable",null),r([rt("web-map","isTable")],nt.prototype,"writeIsTable",null),r([F(X)],nt.prototype,"labelsVisible",void 0),r([F({type:[Ae],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Re,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Re,write:{layerContainerTypes:j}}})],nt.prototype,"labelingInfo",void 0),r([F({type:Ue,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],nt.prototype,"symbolLayerDrawing",void 0),r([tt(["portal-item","web-map"],"symbolLayerDrawing",["layerDefinition.drawingInfo.renderer","layerDefinition.drawingInfo.symbolLayerDrawing"])],nt.prototype,"readSymbolLayerDrawing",null),r([F((()=>{const e=d(Y);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Ye(e),t)}}},e})())],nt.prototype,"opacity",void 0),r([F(ee)],nt.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(te.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],nt.prototype,"listMode",void 0),r([tt("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],nt.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:at}}}}})],nt.prototype,"objectIdField",void 0),r([tt("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],nt.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],nt.prototype,"operationalLayerType",void 0),r([F(st.outFields)],nt.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],nt.prototype,"path",void 0),r([F(re)],nt.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],nt.prototype,"popupTemplate",void 0),r([rt("popupTemplate")],nt.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"defaultPopupTemplate",null),r([F({readOnly:!0})],nt.prototype,"reloading",void 0),r([F({types:He,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:We,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],nt.prototype,"renderer",null),r([tt("service","renderer",["drawingInfo.renderer","defaultSymbol"]),tt("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],nt.prototype,"readRenderer",null),r([F()],nt.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(ie);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],nt.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],nt.prototype,"source",null),r([tt("portal-item","source",["featureSet"]),tt("web-map","source",["featureSet"])],nt.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],nt.prototype,"spatialReference",void 0),r([F({type:Number})],nt.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],nt.prototype,"subtypeField",void 0),r([F({readOnly:!1})],nt.prototype,"subtypes",void 0),r([F({type:[De]})],nt.prototype,"templates",void 0),r([tt("templates",["editFieldsInfo","creatorField","editorField","templates"])],nt.prototype,"readTemplates",null),r([F({type:Ve})],nt.prototype,"timeInfo",void 0),r([F()],nt.prototype,"title",void 0),r([tt("service","title",["name"]),tt("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],nt.prototype,"readTitle",null),r([tt("web-map","title",["layerDefinition.name","title"])],nt.prototype,"readTitleFromWebMap",null),r([F({type:String})],nt.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],nt.prototype,"type",void 0),r([F({type:String})],nt.prototype,"typeIdField",void 0),r([tt("service","typeIdField"),tt("typeIdField",["layerDefinition.typeIdField"])],nt.prototype,"readTypeIdField",null),r([F({type:[Ee]})],nt.prototype,"types",void 0),r([tt("service","types",["types"]),tt("types",["layerDefinition.types"])],nt.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],nt.prototype,"visible",void 0),r([tt("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],nt.prototype,"readVisible",null),nt=r([T("esri.layers.FeatureLayer")],nt);export{nt as default};
@@ -84,7 +84,7 @@ export interface IntegratedMesh3DTilesLayerProperties extends LayerProperties, A
84
84
 
85
85
  /**
86
86
  * The IntegratedMesh3DTilesLayer is designed for visualizing accurate representations of built and natural
87
- * environments in a [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
87
+ * environments in a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/).
88
88
  *
89
89
  * Integrated mesh data is typically captured by an automated process for constructing 3D features from large sets of
90
90
  * overlapping imagery. The result integrates the original input image information as a realistic textured mesh and can
@@ -105,6 +105,14 @@ export interface IntegratedMesh3DTilesLayerProperties extends LayerProperties, A
105
105
  * });
106
106
  * ```
107
107
  *
108
+ * 3D Tiles data can include the
109
+ * [ESRI_crs](https://github.com/Esri/3D-tiles-layer/blob/main/ESRI_CRS/Esri_crs_extension.md) extension, which allows
110
+ * the data to be authored for a specific projected coordinate system (PCS) while still remaining available in WGS84
111
+ * and Web Mercator scenes. In a global or local scene with a [SceneView.spatialReference](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/#spatialReference) set to WGS84 or
112
+ * Web Mercator, the layer will load in WGS84. In a local scene with a spatial reference explicitly set to the Esri_crs
113
+ * PCS, the layer will load in that PCS. If a local scene's spatial reference is dynamically determined from the layers
114
+ * in the scene, the layer will load in WGS84 unless all other layers also use the same Esri_crs PCS.
115
+ *
108
116
  * @since 4.29
109
117
  * @see [Sample - IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/sample-code/layers-integratedmesh3dtileslayer/)
110
118
  * @see [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o,subclass as a}from"../core/accessorSupport/decorators.js";import n from"../geometry/SpatialReference.js";import s from"../graphic/OrientedImageryGraphicOrigin.js";import p from"./FeatureLayer.js";import{useViewTimeProperty as l}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as d,parseSequenceOrderFields as m,orientedImageryTypeMap as y,timeIntervalUnitTypeMap as u,verticalMeasurementTypeMap as c,isOrientationAccuracy as h,padAccuracyArray as g}from"./orientedImagery/core/utils.js";import f from"./support/Field.js";import v from"../tables/AttributeTableTemplate.js";import j from"../time/TimeExtent.js";const S=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),P=new Set(["elevationSource"]),I=(e,t)=>!S.has(t)&&e,O=(e,t,i)=>{const r=`orientedImageryProperties.${e}`,o={allowNull:P.has(e),ignoreOrigin:!0};return{name:r,write:t?{...o,target:r,writer:t}:o,read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function b(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function x(e,t,i,r){const{name:o,write:a,read:n}=O(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:I(a,e),read:I(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let w=class extends p{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new s(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.verticalSearchRange=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.virtualCacheDirectory=null,this.dataStoreID=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return d(e,t,i)}get effectiveSequenceOrderField(){const{sequenceOrderField:e,fields:t}=this;return m(e,t)}get fieldConfigurations(){return super.fieldConfigurations}set fieldConfigurations(e){super.fieldConfigurations=e}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:v,json:{write:!1,read:!1}})],w.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:x("cameraHeading")})],w.prototype,"cameraHeading",void 0),e([o({type:Number,json:x("cameraHeight")})],w.prototype,"cameraHeight",void 0),e([o({type:Number,json:x("cameraPitch")})],w.prototype,"cameraPitch",void 0),e([o({type:Number,json:x("cameraRoll")})],w.prototype,"cameraRoll",void 0),e([o({type:Number,json:x("coveragePercent")})],w.prototype,"coveragePercent",void 0),e([o({type:String,json:x("demPathPrefix")})],w.prototype,"demPathPrefix",void 0),e([o({type:String,json:x("demPathSuffix")})],w.prototype,"demPathSuffix",void 0),e([o({type:String,json:x("depthImagePathPrefix")})],w.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:x("depthImagePathSuffix")})],w.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:x("elevationSource")})],w.prototype,"elevationSource",void 0),e([o({readOnly:!0})],w.prototype,"effectiveElevationSource",null),e([o({readOnly:!0})],w.prototype,"effectiveSequenceOrderField",null),e([o({type:Number,json:x("farDistance")})],w.prototype,"farDistance",void 0),e([o({type:[f]})],w.prototype,"fields",void 0),e([o()],w.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],w.prototype,"graphicOrigin",void 0),e([o({type:Number,json:x("horizontalFieldOfView")})],w.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:x("horizontalMeasurementUnit")})],w.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...x("imageGeometryField"),default:"ImageGeometry"}})],w.prototype,"imageGeometryField",void 0),e([o({type:String,json:x("imagePathPrefix")})],w.prototype,"imagePathPrefix",void 0),e([o({type:String,json:x("imagePathSuffix")})],w.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...x("imageReferenceField"),default:"OIObjectID"}})],w.prototype,"imageReferenceField",void 0),e([o({type:Number,json:x("imageRotation")})],w.prototype,"imageRotation",void 0),e([o({type:Number,json:x("maximumDistance")})],w.prototype,"maximumDistance",void 0),e([o({type:Number,json:x("nearDistance")})],w.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],w.prototype,"operationalLayerType",void 0),e([o({json:{...x("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return h(t)?g(t):[0,0,0,0,0,0,0,0]},String)}})],w.prototype,"orientationAccuracy",void 0),e([o({json:{...x("orientedImageryType",y.write,y.read,y.jsonValues.slice(1))}})],w.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...x("referenceIDField"),default:"OBJECTID"}})],w.prototype,"referenceIDField",void 0),e([o({type:String,json:{...x("sequenceOrderField"),default:"SequenceOrder"}})],w.prototype,"sequenceOrderField",void 0),e([o({type:n})],w.prototype,"spatialReference",void 0),e([o({readOnly:!0})],w.prototype,"subtypeField",void 0),e([o({readOnly:!0})],w.prototype,"subtypes",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],w.prototype,"type",void 0),e([o({type:u.apiValues,json:{...x("timeIntervalUnit",u.write,u.read,u.jsonValues)}})],w.prototype,"timeIntervalUnit",void 0),e([o(b(i(l)))],w.prototype,"useViewTime",void 0),e([o({type:Number,json:x("verticalFieldOfView")})],w.prototype,"verticalFieldOfView",void 0),e([o({type:c.apiValues,json:{...x("verticalMeasurementUnit",c.write,c.read,c.jsonValues)}})],w.prototype,"verticalMeasurementUnit",void 0),e([o({type:Number,json:x("verticalSearchRange")})],w.prototype,"verticalSearchRange",void 0),e([o({type:String,json:x("videoPathPrefix")})],w.prototype,"videoPathPrefix",void 0),e([o({type:String,json:x("videoPathSuffix")})],w.prototype,"videoPathSuffix",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.orientedImageryProperties.virtualCacheDirectory",read:!0}}}})],w.prototype,"virtualCacheDirectory",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.dsid",read:!0}}}})],w.prototype,"dataStoreID",void 0),e([o({type:j,json:{origins:{"web-scene":{write:!1,read:!1}}}})],w.prototype,"visibilityTimeExtent",void 0),w=e([a("esri.layers.OrientedImageryLayer")],w);const F=w;export{F as default};
2
+ import{__decorate as e}from"tslib";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o,subclass as n}from"../core/accessorSupport/decorators.js";import a from"../geometry/SpatialReference.js";import s from"../graphic/OrientedImageryGraphicOrigin.js";import p from"./FeatureLayer.js";import{useViewTimeProperty as l}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as d,parseSequenceOrderFields as m,orientedImageryTypeMap as y,timeIntervalUnitTypeMap as u,verticalMeasurementTypeMap as c,isOrientationAccuracy as h,padAccuracyArray as f}from"./orientedImagery/core/utils.js";import g from"./support/Field.js";import v from"../tables/AttributeTableTemplate.js";import j from"../time/TimeExtent.js";const S=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","sequenceOrderFields","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),P=new Set(["elevationSource"]),I=(e,t)=>!S.has(t)&&e,O=(e,t,i)=>{const r=`orientedImageryProperties.${e}`,o={allowNull:P.has(e),ignoreOrigin:!0};return{name:r,write:t?{...o,target:r,writer:t}:o,read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function b(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function x(e,t,i,r){const{name:o,write:n,read:a}=O(e,t,i),s={name:o,write:n,read:a,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:I(n,e),read:I(a,e)},"web-map":{name:o,write:n,read:a}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}function w(e,t,i){e?.length&&r(i,e,t)}let F=class extends p{constructor(e){super(e),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.graphicOrigin=new s(this),this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.sequenceOrderFields=[],this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.verticalSearchRange=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.virtualCacheDirectory=null,this.dataStoreID=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return d(e,t,i)}get effectiveSequenceOrderField(){const{sequenceOrderField:e,fields:t,sequenceOrderFields:i}=this;return m(e,t,i)}get fieldConfigurations(){return super.fieldConfigurations}set fieldConfigurations(e){super.fieldConfigurations=e}get portalItem(){return super.portalItem}set portalItem(e){super.portalItem=e}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}findFirstValidLayerId(e){return e.layers?.find(({type:e})=>!!e&&this.supportedSourceTypes.has(e))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:v,json:{write:!1,read:!1}})],F.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:x("cameraHeading")})],F.prototype,"cameraHeading",void 0),e([o({type:Number,json:x("cameraHeight")})],F.prototype,"cameraHeight",void 0),e([o({type:Number,json:x("cameraPitch")})],F.prototype,"cameraPitch",void 0),e([o({type:Number,json:x("cameraRoll")})],F.prototype,"cameraRoll",void 0),e([o({type:Number,json:x("coveragePercent")})],F.prototype,"coveragePercent",void 0),e([o({type:String,json:x("demPathPrefix")})],F.prototype,"demPathPrefix",void 0),e([o({type:String,json:x("demPathSuffix")})],F.prototype,"demPathSuffix",void 0),e([o({type:String,json:x("depthImagePathPrefix")})],F.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:x("depthImagePathSuffix")})],F.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:x("elevationSource")})],F.prototype,"elevationSource",void 0),e([o({readOnly:!0})],F.prototype,"effectiveElevationSource",null),e([o({readOnly:!0})],F.prototype,"effectiveSequenceOrderField",null),e([o({type:Number,json:x("farDistance")})],F.prototype,"farDistance",void 0),e([o({type:[g]})],F.prototype,"fields",void 0),e([o()],F.prototype,"geometryType",void 0),e([o({readOnly:!0,clonable:!1})],F.prototype,"graphicOrigin",void 0),e([o({type:Number,json:x("horizontalFieldOfView")})],F.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:x("horizontalMeasurementUnit")})],F.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...x("imageGeometryField"),default:"ImageGeometry"}})],F.prototype,"imageGeometryField",void 0),e([o({type:String,json:x("imagePathPrefix")})],F.prototype,"imagePathPrefix",void 0),e([o({type:String,json:x("imagePathSuffix")})],F.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...x("imageReferenceField"),default:"OIObjectID"}})],F.prototype,"imageReferenceField",void 0),e([o({type:Number,json:x("imageRotation")})],F.prototype,"imageRotation",void 0),e([o({type:Number,json:x("maximumDistance")})],F.prototype,"maximumDistance",void 0),e([o({type:Number,json:x("nearDistance")})],F.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],F.prototype,"operationalLayerType",void 0),e([o({json:{...x("orientationAccuracy",(e,t,i)=>{r(i,e.join(";"),t)},e=>{const t=e?.split(";")?.map(Number);return h(t)?f(t):[0,0,0,0,0,0,0,0]},String)}})],F.prototype,"orientationAccuracy",void 0),e([o({json:{...x("orientedImageryType",y.write,y.read,y.jsonValues.slice(1))}})],F.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...x("referenceIDField"),default:"OBJECTID"}})],F.prototype,"referenceIDField",void 0),e([o({type:String,json:{...x("sequenceOrderField"),default:"SequenceOrder"}})],F.prototype,"sequenceOrderField",void 0),e([o({json:{...x("sequenceOrderFields",w),default:[]}})],F.prototype,"sequenceOrderFields",void 0),e([o({type:a})],F.prototype,"spatialReference",void 0),e([o({readOnly:!0})],F.prototype,"subtypeField",void 0),e([o({readOnly:!0})],F.prototype,"subtypes",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],F.prototype,"type",void 0),e([o({type:u.apiValues,json:{...x("timeIntervalUnit",u.write,u.read,u.jsonValues)}})],F.prototype,"timeIntervalUnit",void 0),e([o(b(i(l)))],F.prototype,"useViewTime",void 0),e([o({type:Number,json:x("verticalFieldOfView")})],F.prototype,"verticalFieldOfView",void 0),e([o({type:c.apiValues,json:{...x("verticalMeasurementUnit",c.write,c.read,c.jsonValues)}})],F.prototype,"verticalMeasurementUnit",void 0),e([o({type:Number,json:x("verticalSearchRange")})],F.prototype,"verticalSearchRange",void 0),e([o({type:String,json:x("videoPathPrefix")})],F.prototype,"videoPathPrefix",void 0),e([o({type:String,json:x("videoPathSuffix")})],F.prototype,"videoPathSuffix",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.orientedImageryProperties.virtualCacheDirectory",read:!0}}}})],F.prototype,"virtualCacheDirectory",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.dsid",read:!0}}}})],F.prototype,"dataStoreID",void 0),e([o({type:j,json:{origins:{"web-scene":{write:!1,read:!1}}}})],F.prototype,"visibilityTimeExtent",void 0),F=e([n("esri.layers.OrientedImageryLayer")],F);const T=F;export{T as default};
@@ -294,12 +294,10 @@ export interface ParquetLayerProperties extends LayerProperties, CustomParameter
294
294
  * >
295
295
  * > **Known Limitations**
296
296
  * >
297
- * > The ParquetLayer is supported in a [Map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) or a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
298
- * > The ParquetLayer only supports geographic (WGS84) and Web Mercator spatial references.
299
- * > Time and date fields may be downgraded to numeric values.
300
- * > The [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/) does not support the [Query.outStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outStatistics),
301
- * > [Query.orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields), or [Query.returnDistinctValues](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnDistinctValues)
302
- * > query parameters when the layer has more than 20,000 features.
297
+ * > * The ParquetLayer is supported in a [Map component](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-map/) or a [MapView](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/).
298
+ * > * The ParquetLayer only supports geographic (WGS84) and Web Mercator spatial references.
299
+ * > * Time and date fields may be downgraded to numeric values.
300
+ * > * ParquetLayer supports the [orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields) query parameter for datasets containing up to 500,000 features.
303
301
  *
304
302
  * @beta
305
303
  * @since 4.33
@@ -784,10 +782,8 @@ export default class ParquetLayer extends ParquetLayerSuperclass {
784
782
  * >
785
783
  * > **Known Limitations**
786
784
  * >
787
- * > The [ParquetLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ParquetLayer/) does not support the [Query.outStatistics](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outStatistics),
788
- * > [Query.orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields), or [Query.returnDistinctValues](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnDistinctValues)
789
- * > query parameters when the layer has more than 20,000 features.
790
- * > Attribute values used in attribute queries executed against ParquetLayer are case sensitive.
785
+ * > * ParquetLayer supports the [orderByFields](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#orderByFields) query parameter for datasets containing up to 500,000 features.
786
+ * > * Attribute values used in attribute queries executed against ParquetLayer are case sensitive.
791
787
  *
792
788
  * @param query - Specifies the attributes and spatial
793
789
  * filter of the query. If no parameters are specified, then all features satisfying the layer's configuration/filters are returned.
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Error.js";import has from"../core/has.js";import p from"../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as n}from"../core/object.js";import{property as l}from"../core/accessorSupport/decorators/property.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{writer as d}from"../core/accessorSupport/decorators/writer.js";import m from"../geometry/Extent.js";import y from"../geometry/SpatialReference.js";import c from"../graphic/ParquetGraphicOrigin.js";import f from"./Layer.js";import{ParquetSource as h}from"./graphics/sources/ParquetSource.js";import{BlendLayer as g}from"./mixins/BlendLayer.js";import{CustomParametersMixin as j}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as w}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as b}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as v}from"./mixins/OperationalLayer.js";import{OrderedLayer as O}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as x}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as q,legendEnabled as E,popupEnabled as I}from"./support/commonProperties.js";import P from"./support/FeatureTemplate.js";import F from"./support/Field.js";import{defineFieldProperties as T}from"./support/fieldProperties.js";import{fixRendererFields as L}from"./support/fieldUtils.js";import S from"./support/GeometryEncodingLocation.js";import _ from"./support/GeometryEncodingWkb.js";import R from"./support/LabelClass.js";import{reader as D}from"./support/labelingInfo.js";import z from"./support/ParquetFilesData.js";import Q from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as U}from"./support/parquetUtils.js";import{rendererTypes as C}from"../renderers/support/typeUtils.js";import k from"../rest/support/Query.js";import{createPopupTemplate as G}from"../support/popupUtils.js";const J=T(),M="__OBJECTID",N={types:{key:"type",base:null,typeMap:{wkb:_,location:S}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let V=class extends(b(w(g(O(x(v(a(j(t(f)))))))))){constructor(e){super(e),this._emptyUrls=new i,this.copyright=null,this.definitionExpression=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new c(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=M,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.data=null}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===M&&"oid"===e.type)).map(e=>e.toJSON(i));n(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){L(e,this.fieldsIndex),this._set("renderer",e)}writeData(e,r,t,i){if(!e)return;const o=e.write({},i);"portal-item"!==o.type?o.urls.length&&(r.source=o):i.messages?.push(new s("parquet-layer:unsupported-data","Portal-item-backed Parquet data is not yet supported in web maps",{layer:this}))}get urls(){return"files"===this.data?.type?this.data.urls:this._emptyUrls}set urls(e){o(p.getLogger(this),"urls",{replacement:"data",version:"5.1",warnOnce:!0}),this.data=new z({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return G(this,e)}createQuery(){const e=new k;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}async createSource(e){const r=new h({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return k.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new i(e):e??new i}async _load(e){const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),["fields"].forEach(e=>this.revertToOrigin(e,"service")),L(this.renderer,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=y.WGS84)}};e([l({readOnly:!0,json:{read:!1,write:!1}})],V.prototype,"capabilities",null),e([l({type:String})],V.prototype,"copyright",void 0),e([l({readOnly:!0})],V.prototype,"defaultPopupTemplate",null),e([l({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],V.prototype,"definitionExpression",void 0),e([l()],V.prototype,"displayOptimization",void 0),e([l({type:[F],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],V.prototype,"fields",void 0),e([d("fields")],V.prototype,"writeFields",null),e([l(J.fieldsIndex)],V.prototype,"fieldsIndex",void 0),e([l(N)],V.prototype,"geometryEncoding",void 0),e([l({type:m,json:{name:"extent"}})],V.prototype,"fullExtent",void 0),e([l({type:U.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:U.read},write:{writer:U.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:U.read}}}}})],V.prototype,"geometryType",void 0),e([l({readOnly:!0,clonable:!1})],V.prototype,"graphicOrigin",void 0),e([l(q)],V.prototype,"labelsVisible",void 0),e([l({type:[R],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:D},write:!0}})],V.prototype,"labelingInfo",void 0),e([l(E)],V.prototype,"legendEnabled",void 0),e([l()],V.prototype,"file",void 0),e([l({type:String,readOnly:!0})],V.prototype,"objectIdField",void 0),e([l({type:["ParquetLayer"]})],V.prototype,"operationalLayerType",void 0),e([l(J.outFields)],V.prototype,"outFields",void 0),e([l(I)],V.prototype,"popupEnabled",void 0),e([l({type:r,json:{name:"popupInfo",write:!0}})],V.prototype,"popupTemplate",void 0),e([l({types:C,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],V.prototype,"renderer",null),e([l({type:h,readOnly:!0,cast:null,json:{read:!1}})],V.prototype,"source",void 0),e([l({type:y,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],V.prototype,"spatialReference",void 0),e([l({type:[P]})],V.prototype,"templates",void 0),e([l()],V.prototype,"title",void 0),e([l({json:{read:!1},readOnly:!0})],V.prototype,"type",void 0),e([l({types:{key:"type",base:null,typeMap:{files:z,"portal-item":Q}},json:{name:"source",origins:{"web-map":{write:{target:"source",ignoreOrigin:!0}}}}})],V.prototype,"data",void 0),e([d("web-map","data")],V.prototype,"writeData",null),e([l({type:i.ofType(String),json:{read:!1,write:!1}})],V.prototype,"urls",null),V=e([u("esri.layers.ParquetLayer")],V);export{V as default};
2
+ import{__decorate as e}from"tslib";import r from"../PopupTemplate.js";import{ClonableMixin as t}from"../core/Clonable.js";import i from"../core/Collection.js";import{deprecatedProperty as o}from"../core/deprecate.js";import s from"../core/Error.js";import has from"../core/has.js";import a from"../core/Logger.js";import{MultiOriginJSONSupportMixin as p}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as n}from"../core/object.js";import{on as l}from"../core/reactiveUtils.js";import{property as u}from"../core/accessorSupport/decorators/property.js";import{subclass as d}from"../core/accessorSupport/decorators/subclass.js";import{writer as m}from"../core/accessorSupport/decorators/writer.js";import y from"../geometry/Extent.js";import c from"../geometry/SpatialReference.js";import f from"../graphic/ParquetGraphicOrigin.js";import h from"./Layer.js";import{ParquetSource as g}from"./graphics/sources/ParquetSource.js";import{BlendLayer as j}from"./mixins/BlendLayer.js";import{CustomParametersMixin as w}from"./mixins/CustomParametersMixin.js";import{FeatureEffectLayer as b}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as v}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as O}from"./mixins/OperationalLayer.js";import{OrderedLayer as x}from"./mixins/OrderedLayer.js";import{ScaleRangeLayer as q}from"./mixins/ScaleRangeLayer.js";import{labelsVisible as E,legendEnabled as I,popupEnabled as P}from"./support/commonProperties.js";import F from"./support/FeatureTemplate.js";import T from"./support/Field.js";import{defineFieldProperties as L}from"./support/fieldProperties.js";import{fixRendererFields as S}from"./support/fieldUtils.js";import _ from"./support/GeometryEncodingLocation.js";import R from"./support/GeometryEncodingWkb.js";import D from"./support/LabelClass.js";import{reader as z}from"./support/labelingInfo.js";import U from"./support/ParquetFilesData.js";import C from"./support/ParquetPortalItemData.js";import{parquetGeometryTypeKebabDict as Q}from"./support/parquetUtils.js";import{rendererTypes as k}from"../renderers/support/typeUtils.js";import G from"../rest/support/Query.js";import{createPopupTemplate as J}from"../support/popupUtils.js";const M=L(),N="__OBJECTID",V={types:{key:"type",base:null,typeMap:{wkb:R,location:_}},json:{name:"layerDefinition.geometryEncoding",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryEncoding"}}}}};let A=class extends(v(b(j(x(q(O(p(w(t(h)))))))))){constructor(e){super(e),this._emptyUrls=new i,this.copyright=null,this.definitionExpression=null,this.displayOptimization=null,this.fields=null,this.fieldsIndex=null,this.geometryEncoding=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new f(this),this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=N,this.operationalLayerType="ParquetLayer",this.outFields=null,this.persistenceEnabled=!!has("parquetlayer-persistence-enabled"),this.popupTemplate=null,this.source=null,this.spatialReference=null,this.templates=null,this.title="Parquet",this.type="parquet",this.data=null}initialize(){this.addHandles(l(()=>this.source,"source-changed",()=>{this.emit("refresh",{dataChanged:!0})}))}destroy(){this.source?.destroy()}async load(e){return this.addResolvingPromise(this._load(e)),this}get capabilities(){return this.source?.capabilities}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,r,t,i){const o=e.filter(e=>!(e.name===N&&"oid"===e.type)).map(e=>e.toJSON(i));n(t,o,r)}get isTable(){return null==this.geometryEncoding&&null==this.displayOptimization}set renderer(e){S(e,this.fieldsIndex),this._set("renderer",e)}writeData(e,r,t,i){if(!e)return;const o=e.write({},i);"portal-item"!==o.type?o.urls.length&&(r.source=o):i.messages?.push(new s("parquet-layer:unsupported-data","Portal-item-backed Parquet data is not yet supported in web maps",{layer:this}))}get urls(){return"files"===this.data?.type?this.data.urls:this._emptyUrls}set urls(e){o(a.getLogger(this),"urls",{replacement:"data",version:"5.1",warnOnce:!0}),this.data=new U({urls:this._normalizeUrls(e)})}createPopupTemplate(e){return J(this,e)}createQuery(){const e=new G;return e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1",e}async createSource(e){const r=new g({layer:this});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async queryFeatures(e,r){await this.load();const t=await this.source.queryFeatures(this._normalizeQuery(e),r),i=this.graphicOrigin;if(t?.features)for(const o of t.features)o.layer=o.sourceLayer=this,o.origin=i;return t}async queryObjectIds(e,r){return await this.load(),this.source.queryObjectIds(this._normalizeQuery(e),r)}async queryFeatureCount(e,r){return await this.load(),this.source.queryFeatureCount(this._normalizeQuery(e),r)}async queryExtent(e,r){return await this.load(),this.source.queryExtent(this._normalizeQuery(e),r)}_normalizeQuery(e){return G.from(e)??this.createQuery()}_normalizeUrls(e){return Array.isArray(e)?new i(e):e??new i}async _load(e){"portal-item"===this.data?.type&&await this.data.portalItem.load();const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),["fields"].forEach(e=>this.revertToOrigin(e,"service")),S(this.renderer,this.fieldsIndex),null==this.spatialReference&&(this.spatialReference=c.WGS84)}};e([u({readOnly:!0,json:{read:!1,write:!1}})],A.prototype,"capabilities",null),e([u({type:String})],A.prototype,"copyright",void 0),e([u({readOnly:!0})],A.prototype,"defaultPopupTemplate",null),e([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],A.prototype,"definitionExpression",void 0),e([u()],A.prototype,"displayOptimization",void 0),e([u({type:[T],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],A.prototype,"fields",void 0),e([m("fields")],A.prototype,"writeFields",null),e([u(M.fieldsIndex)],A.prototype,"fieldsIndex",void 0),e([u(V)],A.prototype,"geometryEncoding",void 0),e([u({type:y,json:{name:"extent"}})],A.prototype,"fullExtent",void 0),e([u({type:Q.apiValues,json:{name:"layerDefinition.geometryType",read:{reader:Q.read},write:{writer:Q.write,ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"geometryType",reader:Q.read}}}}})],A.prototype,"geometryType",void 0),e([u({readOnly:!0,clonable:!1})],A.prototype,"graphicOrigin",void 0),e([u(E)],A.prototype,"labelsVisible",void 0),e([u({type:[D],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:z},write:!0}})],A.prototype,"labelingInfo",void 0),e([u(I)],A.prototype,"legendEnabled",void 0),e([u()],A.prototype,"file",void 0),e([u({type:String,readOnly:!0})],A.prototype,"objectIdField",void 0),e([u({type:["ParquetLayer"]})],A.prototype,"operationalLayerType",void 0),e([u(M.outFields)],A.prototype,"outFields",void 0),e([u(P)],A.prototype,"popupEnabled",void 0),e([u({type:r,json:{name:"popupInfo",write:!0}})],A.prototype,"popupTemplate",void 0),e([u({types:k,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{read:{source:"drawingInfo.renderer"}}}}})],A.prototype,"renderer",null),e([u({type:g,readOnly:!0,cast:null,json:{read:!1}})],A.prototype,"source",void 0),e([u({type:c,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{read:{source:"extent.spatialReference"}}}}})],A.prototype,"spatialReference",void 0),e([u({type:[F]})],A.prototype,"templates",void 0),e([u()],A.prototype,"title",void 0),e([u({json:{read:!1},readOnly:!0})],A.prototype,"type",void 0),e([u({types:{key:"type",base:null,typeMap:{files:U,"portal-item":C}},json:{name:"source",origins:{"web-map":{write:{target:"source",ignoreOrigin:!0}}}}})],A.prototype,"data",void 0),e([m("web-map","data")],A.prototype,"writeData",null),e([u({type:i.ofType(String),json:{read:!1,write:!1}})],A.prototype,"urls",null),A=e([d("esri.layers.ParquetLayer")],A);export{A as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";import{kebabDict as r}from"../../support/fieldType.js";const s=new i(50,500),t="unsupported-query",n=" as ",o=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),a=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),l=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...o,...a]);function d(i,r,n={}){const o=c(r,i);if(!o){const n=s.getError(r,i);throw new e(t,"invalid SQL expression",{expression:r,error:n})}const a=n.expressionName||"expression";if(n.validateStandardized&&!o.isStandardized)throw new e(t,`${a} is not standard`,{expression:r});if(n.validateAggregate&&!o.isAggregate)throw new e(t,`${a} does not contain a valid aggregate function`,{expression:r});return o.fieldNames}function p(e,i,r,s){if(!r)return!0;const t="where clause";return g(e,i,d(e,r,{validateStandardized:!0,expressionName:t}),{expressionName:t,query:s}),!0}function f(i,r,s,n,o){if(!s)return!0;const a="having clause",l=d(i,s,{validateAggregate:!0,expressionName:a});g(i,r,l,{expressionName:a,query:o});const p=c(s,i),f=p?.getExpressions().every(e=>{const{aggregateType:r,field:s}=e,t=i.get(s)?.name;return n.some(e=>{const{onStatisticField:s,statisticType:n}=e,o=i.get(s)?.name;return o===t&&n.toLowerCase().trim()===r})});if(!f)throw new e(t,"expressions in having clause should also exist in outStatistics",{having:s});return!0}function c(e,i){return e?s.get(e,i):null}function u(e){return/\((.*?)\)/.test(e)?e:e.split(n)[0]}function y(e){return e.split(n)[1]}function g(i,r,s,n={}){const o=new Map;if(m(o,i,r,n.allowedFieldTypes??l,s),o.size){const i=n.expressionName??"expression";throw new e(t,`${i} contains invalid or missing fields`,{errors:Array.from(o.values()),query:n.query})}}function m(e,i,r,s,t){const n=t.includes("*")?[...r,...t.filter(e=>"*"!==e)]:t;for(const a of n){if(i.get(a))T(e,i,r,s,a);else try{const t=d(i,u(a),{validateStandardized:!0});for(const n of t)T(e,i,r,s,n)}catch(o){e.set(a,{type:"expression-error",expression:a,error:o})}}}function T(e,i,s,t,n){const o=i.get(n);o?s.has(o.name)?"all"!==t&&!1===t?.has(o.type)&&e.set(n,{type:"invalid-type",fieldName:o.name,fieldType:r.fromJSON(o.type),allowedFieldTypes:Array.from(t,e=>r.fromJSON(e))}):e.set(n,{type:"missing-field",fieldName:o.name}):e.set(n,{type:"invalid-field",fieldName:n})}export{a as allDateAndTimeFieldTypes,y as getAliasFromFieldName,u as getExpressionFromFieldName,c as getWhereClause,o as numericFieldTypes,g as validateFields,f as validateHaving,p as validateWhere};
2
+ import e from"../../../core/Error.js";import{WhereClauseCache as i}from"../../../core/sql/WhereClauseCache.js";import{kebabDict as r}from"../../support/fieldType.js";const t=new i(50,500),n="unsupported-query",s=" as ",o=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),a=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),l=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...o,...a]);function d(i,r,s={}){const o=c(r,i);if(!o){const s=t.getError(r,i);throw new e(n,"invalid SQL expression",{expression:r,error:s})}const a=s.expressionName||"expression";if(s.validateStandardized&&!o.isStandardized)throw new e(n,`${a} is not standard`,{expression:r});if(s.validateAggregate&&!o.isAggregate)throw new e(n,`${a} does not contain a valid aggregate function`,{expression:r});return o.fieldNames}function p(e,i,r,t){if(!r)return!0;const n="where clause";return g(e,i,d(e,r,{validateStandardized:!0,expressionName:n}),{expressionName:n,query:t}),!0}function f(i,r,t,s,o){if(!t)return!0;const a="having clause",l=d(i,t,{validateAggregate:!0,expressionName:a});g(i,r,l,{expressionName:a,query:o});const p=c(t,i),f=p?.getExpressions().every(e=>{const{aggregateType:r,field:t}=e,n=i.get(t)?.name;return s.some(e=>{const{onStatisticField:t,statisticType:s}=e,o=i.get(t)?.name;return o===n&&s.toLowerCase().trim()===r})});if(!f)throw new e(n,"expressions in having clause should also exist in outStatistics",{having:t});return!0}function c(e,i){return e?t.get(e,i):null}function u(e){return/\((.*?)\)/.test(e)?e:e.split(s)[0]}function y(e){return e.split(s)[1]}function m(e,i,r){if(!F(i))return[];const t=new Set,n=i=>{if(i&&"*"!==i)for(const r of w(e,i))t.add(r)};for(const s of i)n(s.onStatisticField);for(const s of r??[])n(s);return Array.from(t)}function g(i,r,t,s={}){const o=new Map;if(T(o,i,r,s.allowedFieldTypes??l,t),o.size){const i=s.expressionName??"expression";throw new e(n,`${i} contains invalid or missing fields`,{errors:Array.from(o.values()),query:s.query})}}function T(e,i,r,t,n){const s=n.includes("*")?[...r,...n.filter(e=>"*"!==e)]:n;for(const a of s){if(i.get(a))x(e,i,r,t,a);else try{for(const n of w(i,a))x(e,i,r,t,n)}catch(o){e.set(a,{type:"expression-error",expression:a,error:o})}}}function w(e,i){const r=e.get(i);if(r)return[r.name];return d(e,u(i),{validateStandardized:!0})}function x(e,i,t,n,s){const o=i.get(s);o?t.has(o.name)?"all"!==n&&!1===n?.has(o.type)&&e.set(s,{type:"invalid-type",fieldName:o.name,fieldType:r.fromJSON(o.type),allowedFieldTypes:Array.from(n,e=>r.fromJSON(e))}):e.set(s,{type:"missing-field",fieldName:o.name}):e.set(s,{type:"invalid-field",fieldName:s})}function F(e){return null!=e&&e.every(e=>"exceedslimit"!==e.statisticType)}export{a as allDateAndTimeFieldTypes,y as getAliasFromFieldName,u as getExpressionFromFieldName,m as getFieldNamesFromStatistics,c as getWhereClause,F as isFieldStatisticDefinition,o as numericFieldTypes,g as validateFields,f as validateHaving,p as validateWhere};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../core/Error.js";import{validateFields as t,validateWhere as i,validateHaving as s,numericFieldTypes as r,allDateAndTimeFieldTypes as o}from"./attributeSupport.js";import{checkProjectionSupport as n}from"./projectionSupport.js";import{checkSpatialQuerySupport as a}from"./spatialQuerySupport.js";import{loadArcade as l}from"../../../support/loadArcade.js";const u="unsupported-query";async function p(t,i){const s=t.bin;if(!s.onField&&!s.onExpression?.value||"autoIntervalBin"===s.type&&null==s.parameters.numberOfBins||"dateBin"===s.type&&(null==s.parameters.number||null==s.parameters.unit)||"fixedBoundariesBin"===s.type&&null==s.parameters.boundaries||"fixedIntervalBin"===s.type&&null==s.parameters.interval)throw new e(u,"Unsupported query options",{query:t});return d(t,i)}async function d(t,{fieldsIndex:i,geometryType:s,spatialReference:r,availableFields:o}){if(null!=t.geometryPrecision||t.multipatchOption&&"xyFootprint"!==t.multipatchOption||t.pixelSize||t.relationParam||t.text)throw new e(u,"Unsupported query options",{query:t});return c(i,o,t),m(i,o,t),Promise.all([a(t,s,r),n(r,t.outSR)]).then(()=>t)}function c(s,r,o){const{returnDistinctValues:n,outStatistics:a}=o,l=a?a.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in o&&o.orderByFields&&o.orderByFields.length>0){const e=" asc",i=" desc",n=o.orderByFields.map(t=>{const s=t.toLowerCase();return s.includes(e)?s.split(e)[0]:s.includes(i)?s.split(i)[0]:t}).filter(e=>!l.includes(e));t(s,r,n,{expressionName:"orderByFields",query:o})}if("outFields"in o)if(o.outFields?.length)t(s,r,o.outFields,{expressionName:"outFields",query:o,allowedFieldTypes:"all"});else if(n)throw new e(u,"outFields should be specified for returnDistinctValues",{query:o});i(s,r,o.where,o)}const f=new Set([...r,...o]);function m(i,r,o){const{outStatistics:n,groupByFieldsForStatistics:a,having:l}=o,p=a?.length,d=n?.length;if(l){if(!p||!d)throw new e(u,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:o});s(i,r,l,n,o)}if(d){if(!h(n))return;const s=n.map(e=>e.onStatisticField).filter(Boolean);t(i,r,s,{expressionName:"onStatisticFields",query:o}),p&&t(i,r,a,{expressionName:"groupByFieldsForStatistics",query:o});for(const a of n){const{onStatisticField:s,statisticType:n}=a;if(("percentile_disc"===n||"percentile_cont"===n)&&"statisticParameters"in a){const{statisticParameters:t}=a;if(!t)throw new e(u,"statisticParameters should be set for percentile type",{definition:a,query:o})}else i.get(s)&&"count"!==n&&"min"!==n&&"max"!==n&&t(i,r,[s],{expressionName:`outStatistics with '${n}' statistic type`,allowedFieldTypes:f,query:o})}}}async function y(t,i,{fieldsIndex:s,geometryType:r,spatialReference:o,availableFields:l}){if(null!=t.geometryPrecision||t.multipatchOption||t.pixelSize||t.relationParam||t.text||t.outStatistics||t.groupByFieldsForStatistics||t.having||t.orderByFields)throw new e(u,"Unsupported query options",{query:t});return c(s,l,t),Promise.all([F(s,l,i,t),a(t,r,o),n(o,t.outSR)]).then(()=>t)}async function F(i,s,r,o){let n=[];if(r.valueExpression){const{arcadeUtils:e}=await l();n=e.extractFieldNames(r.valueExpression)}if(r.field&&n.push(r.field),r.field2&&n.push(r.field2),r.field3&&n.push(r.field3),r.normalizationField&&n.push(r.normalizationField),!n.length&&!r.valueExpression)throw new e(u,"field or valueExpression is required",{params:r});t(i,s,n,{expressionName:"statistics",query:o})}function h(e){return null!=e&&e.every(e=>"exceedslimit"!==e.statisticType)}export{p as validateAttributeBinsQuery,d as validateQuery,y as validateStatisticsQuery};
2
+ import e from"../../../core/Error.js";import{validateFields as t,validateWhere as i,validateHaving as s,isFieldStatisticDefinition as r,getFieldNamesFromStatistics as o,numericFieldTypes as n,allDateAndTimeFieldTypes as a}from"./attributeSupport.js";import{checkProjectionSupport as l}from"./projectionSupport.js";import{checkSpatialQuerySupport as u}from"./spatialQuerySupport.js";import{loadArcade as p}from"../../../support/loadArcade.js";const d="unsupported-query";async function c(t,i){const s=t.bin;if(!s.onField&&!s.onExpression?.value||"autoIntervalBin"===s.type&&null==s.parameters.numberOfBins||"dateBin"===s.type&&(null==s.parameters.number||null==s.parameters.unit)||"fixedBoundariesBin"===s.type&&null==s.parameters.boundaries||"fixedIntervalBin"===s.type&&null==s.parameters.interval)throw new e(d,"Unsupported query options",{query:t});return f(t,i)}async function f(t,{fieldsIndex:i,geometryType:s,spatialReference:r,availableFields:o}){if(null!=t.geometryPrecision||t.multipatchOption&&"xyFootprint"!==t.multipatchOption||t.pixelSize||t.relationParam||t.text)throw new e(d,"Unsupported query options",{query:t});return m(i,o,t),h(i,o,t),Promise.all([u(t,s,r),l(r,t.outSR)]).then(()=>t)}function m(s,r,o){const{returnDistinctValues:n,outStatistics:a}=o,l=a?a.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in o&&o.orderByFields&&o.orderByFields.length>0){const e=" asc",i=" desc",n=o.orderByFields.map(t=>{const s=t.toLowerCase();return s.includes(e)?s.split(e)[0]:s.includes(i)?s.split(i)[0]:t}).filter(e=>!l.includes(e));t(s,r,n,{expressionName:"orderByFields",query:o})}if("outFields"in o)if(o.outFields?.length)t(s,r,o.outFields,{expressionName:"outFields",query:o,allowedFieldTypes:"all"});else if(n)throw new e(d,"outFields should be specified for returnDistinctValues",{query:o});i(s,r,o.where,o)}const y=new Set([...n,...a]);function h(i,n,a){const{outStatistics:l,groupByFieldsForStatistics:u,having:p}=a,c=u?.length,f=l?.length;if(p){if(!c||!f)throw new e(d,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:a});s(i,n,p,l,a)}if(f){if(!r(l))return;const s=o(i,l,u);t(i,n,s,{expressionName:"statistics",query:a});for(const r of l){const{onStatisticField:s,statisticType:o}=r;if(("percentile_disc"===o||"percentile_cont"===o)&&"statisticParameters"in r){const{statisticParameters:t}=r;if(!t)throw new e(d,"statisticParameters should be set for percentile type",{definition:r,query:a})}else i.get(s)&&"count"!==o&&"min"!==o&&"max"!==o&&t(i,n,[s],{expressionName:`outStatistics with '${o}' statistic type`,allowedFieldTypes:y,query:a})}}}async function F(t,i,{fieldsIndex:s,geometryType:r,spatialReference:o,availableFields:n}){if(null!=t.geometryPrecision||t.multipatchOption||t.pixelSize||t.relationParam||t.text||t.outStatistics||t.groupByFieldsForStatistics||t.having||t.orderByFields)throw new e(d,"Unsupported query options",{query:t});return m(s,n,t),Promise.all([w(s,n,i,t),u(t,r,o),l(o,t.outSR)]).then(()=>t)}async function w(i,s,r,o){let n=[];if(r.valueExpression){const{arcadeUtils:e}=await p();n=e.extractFieldNames(r.valueExpression)}if(r.field&&n.push(r.field),r.field2&&n.push(r.field2),r.field3&&n.push(r.field3),r.normalizationField&&n.push(r.normalizationField),!n.length&&!r.valueExpression)throw new e(d,"field or valueExpression is required",{params:r});t(i,s,n,{expressionName:"statistics",query:o})}export{c as validateAttributeBinsQuery,f as validateQuery,F as validateStatisticsQuery};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{Loadable as r}from"../../../core/Loadable.js";import s from"../../../core/Logger.js";import{throwIfAborted as o}from"../../../core/promiseUtils.js";import{watch as a}from"../../../core/reactiveUtils.js";import{open as i}from"../../../core/workers.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{createFileProviderSchema as c,toParquetJSONGeometryType as l}from"../../support/parquetUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends r{constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),this.addHandles([a(()=>this.layer.data,async t=>{t&&await this._proxy.updateFileProvider(await c(t))}),a(()=>this.layer.customParameters,t=>this._setCustomParameters(t))]),Promise.resolve(this)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return p.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return s.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:r.count,extent:y.fromJSON(r.extent)}}async _initialize(t){if(!this.layer.data)throw new e("parquet:missing-data","A data source must be specified",this.layer);const r=await c(this.layer.data,{signal:t});o(t),this._connection=await i("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this}),o(t),this._proxy=this._connection.createInvokeProxy();const{layerDefinition:s,capabilities:a}=await this._proxy.load({provider:r,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?l(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters});o(t),this.sourceJSON=s,this.capabilities=a}_setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{s.getLogger(this).warn("Failed to update customParameters")})}_queryStream(t,e){return this._proxy.queryStream(t,e)}_getStreamNextFeatures(t,e){return this._proxy.getStreamNextFeatures(t,e)}};t([n()],m.prototype,"type",void 0),t([n({constructOnly:!0})],m.prototype,"layer",void 0),t([n()],m.prototype,"sourceJSON",void 0),t([n()],m.prototype,"capabilities",void 0),m=t([u("esri.layers.graphics.sources.ParquetSource")],m);export{m as ParquetSource};
2
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{EventedMixin as r}from"../../../core/Evented.js";import{Loadable as s}from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{throwIfAborted as a}from"../../../core/promiseUtils.js";import{watch as i}from"../../../core/reactiveUtils.js";import{open as n}from"../../../core/workers.js";import{property as c}from"../../../core/accessorSupport/decorators/property.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import y from"../../../geometry/Extent.js";import{createFileProviderSchema as l,toParquetJSONGeometryType as p}from"../../support/parquetUtils.js";import m from"../../../rest/support/FeatureSet.js";let d=class extends(r(s)){constructor(t){super(t),this.type="parquet"}load(t){const e=null!=t?t.signal:null;return this.addResolvingPromise(this._initialize(e)),this.addHandles([i(()=>this.layer.data,async t=>{t&&await this._proxy.updateFileProvider(await l(t))}),i(()=>this.layer.customParameters,t=>this._setCustomParameters(t))]),Promise.resolve(this)}async reload(t){const e=await this._createLoadParameters(t);return this._proxy.reload(e)}destroy(){this._connection?.destroy()}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeaturesJSON(t,e={}){return await this.load(e),this._proxy.queryFeatures(t.toJSON(),{signal:e?.signal})}async queryFeatures(t,e={}){const r=await this.queryFeaturesJSON(t,{signal:e?.signal});return m.fromJSON(r)}async queryObjectIds(t,e){return await this._proxy.queryObjectIds(t.toJSON(),{signal:e?.signal})}async queryFeatureCount(t,e){return this._proxy.queryFeatureCount(t.toJSON(),{signal:e?.signal})}async queryExtent(t,e){if(null==this.layer.geometryEncoding)return o.getLogger(this).warn("Tried to queryExtent, but source does not have a geometry. Returning null extent."),{count:0,extent:null};const r=await this._proxy.queryExtent(t.toJSON(),{signal:e?.signal});return{count:r.count,extent:y.fromJSON(r.extent)}}async _initialize(t){const e={onSourceChange:()=>this.emit("source-changed")};this._connection=await n("ParquetSourceWorker",{strategy:"dedicated",signal:t,registryTarget:this,client:e}),a(t),this._proxy=this._connection.createInvokeProxy();const r=await this._createLoadParameters(t),{layerDefinition:s,capabilities:o}=await this._proxy.load(r);a(t),this.sourceJSON=s,this.capabilities=o}async _createLoadParameters(t){if(!this.layer.data)throw new e("parquet:missing-data","A data source must be specified",this.layer);const r=await l(this.layer.data,{signal:t});return a(t),{provider:r,fields:this.layer.fields?.map(t=>t.toJSON()),geometryType:this.layer.geometryType?p(this.layer.geometryType):null,spatialReference:this.layer.spatialReference?.toJSON(),geometryEncoding:this.layer.geometryEncoding?.toJSON(),displayOptimization:this.layer.displayOptimization,customParameters:this.layer.customParameters}}_setCustomParameters(t){this._proxy.setCustomParameters(t).catch(()=>{o.getLogger(this).warn("Failed to update customParameters")})}_queryStream(t,e){return this._proxy.queryStream(t,e)}_getStreamNextFeatures(t,e){return this._proxy.getStreamNextFeatures(t,e)}};t([c()],d.prototype,"type",void 0),t([c({constructOnly:!0})],d.prototype,"layer",void 0),t([c()],d.prototype,"sourceJSON",void 0),t([c()],d.prototype,"capabilities",void 0),d=t([u("esri.layers.graphics.sources.ParquetSource")],d);export{d as ParquetSource};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as f,project as m}from"../../data/projectionSupport.js";import{QueryEngine as h}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as E,createDefaultAttributesFunction as F,createDrawingInfo as j}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as T,loadGeometryEngineForSimplify as b,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as A,getFieldDefaultLength as O}from"../../../support/fieldUtils.js";import{utc as Q}from"../../../../time/constants.js";const k={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsQueryWithResultType:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:T};class D{constructor(){this._featureIdInfo=null,this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const f=new R(o);let m=f.get(d);m?("esriFieldTypeString"!==m.type&&(m.type="esriFieldTypeOID"),m.editable=!1,m.nullable=!1,d=m.name):(m={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(m));const _={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==m.name){const e=A(a);void 0!==e&&(_[a.name]=e)}null==a.length&&(a.length=O(a))}if(c){if(c.startTimeField){const e=f.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate"):c.startTimeField=null}if(c.endTimeField){const e=f.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate"):c.endTimeField=null}if(c.trackIdField){const e=f.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const I=l?j(l):void 0,T=f.dateFields.length?{timeZoneIANA:Q}:null,b={warnings:i,featureErrors:[],layerDefinition:{...k,drawingInfo:I??void 0,templates:E(_),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:T}};this._featureIdInfo={type:"object-id",fieldName:d},this._queryEngine=new h({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:T}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:this._featureIdInfo,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const w=this._queryEngine.fieldsIndex.requiredFields.indexOf(m);w>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(w,1),this._createDefaultAttributes=F(_,d);const q=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,q);const x=this._normalizeFeatures(q,b.featureErrors);this._queryEngine.featureStore.addMany(x);const{fullExtent:S,timeExtent:D}=await this._queryEngine.fetchRecomputedExtents();if(b.layerDefinition.extent=S,D){const{start:e,end:t}=D;b.layerDefinition.timeInfo.timeExtent=[e,t]}return b}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([b(t,s),f(e.adds,t),f(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s}=this._queryEngine,i=this._featureIdInfo.fieldName,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(m(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{fieldsIndex:s}=this._queryEngine,i=[],r=this._featureIdInfo.fieldName;for(const n of e){const e=this._createDefaultAttributes(),a=w(s,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[r],i.push(n))}return i}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,p=this._featureIdInfo.fieldName,c=[];for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(l,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[p];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??o;d.geometry=m(S(d.geometry,e),e,o)}c.push(d),s.push(q(d.attributes[p]))}}u.addMany(d([],c,i,a,r,this._featureIdInfo))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,spatialReference:a,featureStore:o,fieldsIndex:u}=this._queryEngine,l=this._featureIdInfo.fieldName;for(const d of t){const{attributes:t,geometry:y}=d,f=t?.[l];if(null==f){e.push(x(`Identifier field ${l} missing`));continue}if(!o.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const h=p(o.getFeature(f),s,r,i);if(null!=y){if(s!==n(y)){e.push(x("Incorrect geometry type."));continue}const t=y.spatialReference??a;h.geometry=m(S(y,t),t,a)}if(t){const s=w(u,h.attributes,t);if(s){e.push(s);continue}}o.add(c(h,s,r,i,this._featureIdInfo)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=this._featureIdInfo.fieldName,i=e.fieldsIndex.get(s);if("esriFieldTypeString"===i.type)return()=>i.name+"-"+Date.now().toString(16);let r=Number.NEGATIVE_INFINITY;for(const n of t)n.objectId&&(r=Math.max(r,n.objectId));return r=Math.max(0,r)+1,()=>r++}_assignObjectId(e,t,s=!1){const i=this._featureIdInfo.fieldName;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await f(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{D as default};
2
+ import e from"../../../../request.js";import{createTask as t}from"../../../../core/asyncUtils.js";import s from"../../../../core/Error.js";import i from"../../../../core/Logger.js";import{isAbortError as r}from"../../../../core/promiseUtils.js";import{getJsonType as n}from"../../../../geometry/support/jsonTypeUtils.js";import{wgs84 as a,equals as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromGeometry as u,convertToGeometry as l,convertFromFeatures as d,convertToFeature as p,convertFromFeature as c}from"../../featureConversionUtils.js";import y from"../../data/FeatureStore.js";import{checkProjectionSupport as f,project as m}from"../../data/projectionSupport.js";import{QueryEngine as h}from"../../data/QueryEngine.js";import{inferLayerProperties as g,createOptimizedFeatures as _,validateGeoJSON as I}from"./geojson.js";import{createDefaultTemplate as E,createDefaultAttributesFunction as F,createDrawingInfo as j}from"../support/clientSideDefaults.js";import{queryBinsCapabilities as T,loadGeometryEngineForSimplify as b,mixAttributes as w,createFeatureEditSuccessResult as q,createFeatureEditErrorResult as x,simplify as S}from"../support/sourceUtils.js";import R from"../../../support/FieldsIndex.js";import{kebabDict as C}from"../../../support/fieldType.js";import{getFieldDefaultValue as A,getFieldDefaultLength as O}from"../../../support/fieldUtils.js";import{utc as Q}from"../../../../time/constants.js";const k={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsQueryAttachmentsCountOnly:!1,supportsQueryAttachmentOrderByFields:!1,supportsQueryAttachmentWithTypeWildcard:!1,supportsQueryBins:!0,supportsQueryPivot:!1,supportsQueryWithCacheHint:!0,supportsQueryWithDistance:!0,supportsOutDistance:!1,supportsQueryWithResultType:!0,supportsSpatialAggregationStatistics:!0,supportedSpatialAggregationStatistics:["EnvelopeAggregate","CentroidAggregate","ConvexHullAggregate"],supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0},queryBinsCapabilities:T};class D{constructor(){this._featureIdInfo=null,this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){this._queryEngine?.destroy(),this._queryEngine=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[],[r]=await Promise.all([e.url?this._fetch(t?.signal):null,this._checkProjection(e.spatialReference)]),n=g(r,{geometryType:e.geometryType}),o=e.fields||n.fields||[],u=null!=e.hasZ?e.hasZ:n.hasZ,l=n.geometryType;let d=e.objectIdField||n.objectIdFieldName||"__OBJECTID";const p=e.spatialReference||a;let c=e.timeInfo;o===n.fields&&n.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:n.unknownFields}});const f=new R(o);let m=f.dateFields.length>0,_=f.get(d);_?("esriFieldTypeString"!==_.type&&(_.type="esriFieldTypeOID"),_.editable=!1,_.nullable=!1,d=_.name):(_={alias:d,name:d,type:"string"===n.objectIdFieldType?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},o.unshift(_));const I={};for(const a of o){if(null==a.name&&(a.name=a.alias),null==a.alias&&(a.alias=a.name),!a.name)throw new s("geojson-layer:invalid-field-name","field name is missing",{field:a});if(!C.jsonValues.includes(a.type))throw new s("geojson-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a});if(a.name!==_.name){const e=A(a);void 0!==e&&(I[a.name]=e)}null==a.length&&(a.length=O(a))}if(c){if(c.startTimeField){const e=f.get(c.startTimeField);e?(c.startTimeField=e.name,e.type="esriFieldTypeDate",m=!0):c.startTimeField=null}if(c.endTimeField){const e=f.get(c.endTimeField);e?(c.endTimeField=e.name,e.type="esriFieldTypeDate",m=!0):c.endTimeField=null}if(c.trackIdField){const e=f.get(c.trackIdField);e?c.trackIdField=e.name:(c.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:c}}))}c.startTimeField||c.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:c}}),c=null)}const T=l?j(l):void 0,b=m?{timeZoneIANA:Q}:null,w={warnings:i,featureErrors:[],layerDefinition:{...k,drawingInfo:T??void 0,templates:E(I),extent:void 0,geometryType:l,objectIdField:d,fields:o,hasZ:!!u,timeInfo:c,dateFieldsTimeReference:b}};this._featureIdInfo={type:"object-id",fieldName:d},this._queryEngine=new h({fieldsIndex:R.fromLayerJSON({fields:o,timeInfo:c,dateFieldsTimeReference:b}),geometryType:l,hasM:!1,hasZ:u,featureIdInfo:this._featureIdInfo,spatialReference:p,timeInfo:c,featureStore:new y({geometryType:l,hasM:!1,hasZ:u})});const q=this._queryEngine.fieldsIndex.requiredFields.indexOf(_);q>-1&&this._queryEngine.fieldsIndex.requiredFields.splice(q,1),this._createDefaultAttributes=F(I,d);const x=this._createFeatures(r);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,x);const S=this._normalizeFeatures(x,w.featureErrors);this._queryEngine.featureStore.addMany(S);const{fullExtent:D,timeExtent:v}=await this._queryEngine.fetchRecomputedExtents();if(w.layerDefinition.extent=D,v){const{start:e,end:t}=v;w.layerDefinition.timeInfo.timeExtent=[e,t]}return w}async applyEdits(e){const{spatialReference:t,geometryType:s}=this._queryEngine;return await Promise.all([b(t,s),f(e.adds,t),f(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),await this._queryEngine.executeQueryForSnapping(e,t.signal)}async queryAttributeBins(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeAttributeBinsQuery(e,t.signal)}async refresh(e){this._loadOptions.customParameters=e,this._snapshotTask?.abort(),this._snapshotTask=t(this._snapshotFeatures),this._snapshotTask.promise.then(e=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,e);const t=this._normalizeFeatures(e);t&&this._queryEngine.featureStore.addMany(t)},e=>{this._queryEngine.featureStore.clear(),r(e)||i.getLogger("esri.layers.GeoJSONLayer").error(new s("geojson-layer:refresh","An error occurred during refresh",{error:e}))}),await this._waitSnapshotComplete();const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a}}_createFeatures(e){if(null==e)return[];const{geometryType:t,hasZ:s}=this._queryEngine,i=this._featureIdInfo.fieldName,r=_(e,{geometryType:t,hasZ:s,objectIdField:i});if(!o(this._queryEngine.spatialReference,a))for(const n of r)null!=n.geometry&&(n.geometry=u(m(l(n.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),a,this._queryEngine.spatialReference)));return r}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:s,customParameters:i}=this._loadOptions,r=(await e(s??"",{responseType:"json",query:{...i},signal:t})).data;return I(r),r}_normalizeFeatures(e,t){const{fieldsIndex:s}=this._queryEngine,i=[],r=this._featureIdInfo.fieldName;for(const n of e){const e=this._createDefaultAttributes(),a=w(s,e,n.attributes,!0);a?t?.push(a):(this._assignObjectId(e,n.attributes,!0),n.attributes=e,n.objectId=e[r],i.push(n))}return i}async _applyEdits(e){const{adds:t,updates:s,deletes:i}=e,r={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t?.length&&this._applyAddEdits(r,t),s?.length&&this._applyUpdateEdits(r,s),i?.length){for(const e of i)r.deleteResults.push(q(e));this._queryEngine.featureStore.removeManyById(i)}const{fullExtent:n,timeExtent:a}=await this._queryEngine.fetchRecomputedExtents();return{extent:n,timeExtent:a,featureEditResults:r}}_applyAddEdits(e,t){const{addResults:s}=e,{geometryType:i,hasM:r,hasZ:a,spatialReference:o,featureStore:u,fieldsIndex:l}=this._queryEngine,p=this._featureIdInfo.fieldName,c=[];for(const d of t){if(d.geometry&&i!==n(d.geometry)){s.push(x("Incorrect geometry type."));continue}const t=this._createDefaultAttributes(),r=w(l,t,d.attributes);if(r)s.push(r);else{if(this._assignObjectId(t,d.attributes),d.attributes=t,null!=d.uid){const t=d.attributes[p];e.uidToObjectId[d.uid]=t}if(null!=d.geometry){const e=d.geometry.spatialReference??o;d.geometry=m(S(d.geometry,e),e,o)}c.push(d),s.push(q(d.attributes[p]))}}u.addMany(d([],c,i,a,r,this._featureIdInfo))}_applyUpdateEdits({updateResults:e},t){const{geometryType:s,hasM:i,hasZ:r,spatialReference:a,featureStore:o,fieldsIndex:u}=this._queryEngine,l=this._featureIdInfo.fieldName;for(const d of t){const{attributes:t,geometry:y}=d,f=t?.[l];if(null==f){e.push(x(`Identifier field ${l} missing`));continue}if(!o.has(f)){e.push(x(`Feature with object id ${f} missing`));continue}const h=p(o.getFeature(f),s,r,i);if(null!=y){if(s!==n(y)){e.push(x("Incorrect geometry type."));continue}const t=y.spatialReference??a;h.geometry=m(S(y,t),t,a)}if(t){const s=w(u,h.attributes,t);if(s){e.push(s);continue}}o.add(c(h,s,r,i,this._featureIdInfo)),e.push(q(f))}}_createObjectIdGenerator(e,t){const s=this._featureIdInfo.fieldName,i=e.fieldsIndex.get(s);if("esriFieldTypeString"===i.type)return()=>i.name+"-"+Date.now().toString(16);let r=Number.NEGATIVE_INFINITY;for(const n of t)n.objectId&&(r=Math.max(r,n.objectId));return r=Math.max(0,r)+1,()=>r++}_assignObjectId(e,t,s=!1){const i=this._featureIdInfo.fieldName;e[i]=s&&i in t?t[i]:this._objectIdGenerator()}async _checkProjection(e){try{await f(a,e)}catch{throw new s("geojson-layer","Projection not supported")}}}export{D as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{isISO8601Date as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as n,convertFromPolyline as r}from"../../featureConversionUtils.js";import{OptimizedFeature as i}from"../../OptimizedFeature.js";import s from"../../OptimizedGeometry.js";import{normalizeFieldName as c,isNumericField as l}from"../../../support/fieldUtils.js";const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function f(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*a(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function*y(e,t={}){const{geometryType:o,objectIdField:n}=t;for(const r of e){const{geometry:e,properties:s,id:c}=r;if(e&&f(e.type)!==o)continue;const l=s||{};let u;n&&(u=l[n],null==c||u||(l[n]=u=c)),yield new i(e&&P(e,t),l,null,u)}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function g(e){return!h(e)}function m(e){return h(e)}function h(e){let t=0;for(let o=0;o<e.length;o++){const n=e[o],r=e[(o+1)%e.length];t+=n[0]*r[1]-r[0]*n[1]}return t<=0}function w(e){const t=e[0],o=e[e.length-1];t[0]===o[0]&&t[1]===o[1]&&t[2]===o[2]||e.push(t)}function P(e,t){const{coordinates:o,type:i}=e,c=t.hasZ??!1,l=!0;switch(i){case"Point":return new s([],[...o],c,!1);case"LineString":return r({paths:[o],hasZ:l},c,!1);case"MultiLineString":return r({paths:o,hasZ:l},c,!1);case"MultiPoint":return n({points:o,hasZ:l},c,!1);case"Polygon":case"MultiPolygon":{const e=new s([],[],c,!1);for(const t of"Polygon"===i?[o]:o){j(e,t[0],c);for(let o=1;o<t.length;o++)b(e,t[o],c)}return e}}}function j(e,t,o){w(t),g(t)?F(e,t,o):S(e,t,o)}function b(e,t,o){w(t),m(t)?F(e,t,o):S(e,t,o)}function S(e,t,o){for(const n of t)G(e,n,o);e.lengths.push(t.length)}function F(e,t,o){for(let n=t.length-1;n>=0;n--)G(e,t[n],o);e.lengths.push(t.length)}function G(e,[t,o,n],r){e.coords.push(t,o),r&&e.coords.push(n||0)}function k(t){switch(typeof t){case"string":return e(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function M(e,n=4326){if(!e)throw new t("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new t("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const i="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,s=o({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!i||!s.test(i))throw new t("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function T(e,t={}){const o=[],n=new Set,r=new Set;let i,s=!1,u=null,y=!1,{geometryType:g=null}=t;for(const l of p(e)){const{geometry:e,properties:t,id:p}=l;if(!e||(g||(g=f(e.type)),f(e.type)===g)){if(!s){s=d(a(e))}if(y||(y=null!=p,y&&(i=typeof p,t&&(u=Object.keys(t).filter(e=>t[e]===p)))),t&&u&&y&&null!=p&&(u.length>1?u=u.filter(e=>t[e]===p):1===u.length&&(u=t[u[0]]===p?u:[])),t)for(const e in t){if(n.has(e))continue;const i=k(t[e]);if("unknown"===i){r.add(e);continue}r.delete(e),n.add(e);const s=c(e);s&&o.push({name:s,alias:e,type:i})}}}const m=c(1===u?.length&&u[0]||null)??void 0;if(m)for(const c of o)if(c.name===m&&l(c)){c.type="esriFieldTypeOID";break}return{fields:o,geometryType:g,hasZ:s,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function O(e,t){return Array.from(y(p(e),t))}export{O as createOptimizedFeatures,f as getGeometryType,T as inferLayerProperties,M as validateGeoJSON};
2
+ import{isDateString as e}from"../../../../core/date.js";import t from"../../../../core/Error.js";import{isWGS84 as o}from"../../../../geometry/support/spatialReferenceUtils.js";import{convertFromMultipoint as n,convertFromPolyline as r}from"../../featureConversionUtils.js";import{OptimizedFeature as i}from"../../OptimizedFeature.js";import s from"../../OptimizedGeometry.js";import{normalizeFieldName as c,isNumericField as l}from"../../../support/fieldUtils.js";const u={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function f(e){return u[e]}function*p(e){switch(e.type){case"Feature":yield e;break;case"FeatureCollection":for(const t of e.features)t&&(yield t)}}function*a(e){if(e)switch(e.type){case"Point":yield e.coordinates;break;case"LineString":case"MultiPoint":yield*e.coordinates;break;case"MultiLineString":case"Polygon":for(const t of e.coordinates)yield*t;break;case"MultiPolygon":for(const t of e.coordinates)for(const e of t)yield*e}}function*y(e,t={}){const{geometryType:o,objectIdField:n}=t;for(const r of e){const{geometry:e,properties:s,id:c}=r;if(e&&f(e.type)!==o)continue;const l=s||{};let u;n&&(u=l[n],null==c||u||(l[n]=u=c)),yield new i(e&&P(e,t),l,null,u)}}function d(e){for(const t of e)if(t.length>2)return!0;return!1}function g(e){return!h(e)}function m(e){return h(e)}function h(e){let t=0;for(let o=0;o<e.length;o++){const n=e[o],r=e[(o+1)%e.length];t+=n[0]*r[1]-r[0]*n[1]}return t<=0}function w(e){const t=e[0],o=e[e.length-1];t[0]===o[0]&&t[1]===o[1]&&t[2]===o[2]||e.push(t)}function P(e,t){const{coordinates:o,type:i}=e,c=t.hasZ??!1,l=!0;switch(i){case"Point":return new s([],[...o],c,!1);case"LineString":return r({paths:[o],hasZ:l},c,!1);case"MultiLineString":return r({paths:o,hasZ:l},c,!1);case"MultiPoint":return n({points:o,hasZ:l},c,!1);case"Polygon":case"MultiPolygon":{const e=new s([],[],c,!1);for(const t of"Polygon"===i?[o]:o){j(e,t[0],c);for(let o=1;o<t.length;o++)b(e,t[o],c)}return e}}}function j(e,t,o){w(t),g(t)?F(e,t,o):S(e,t,o)}function b(e,t,o){w(t),m(t)?F(e,t,o):S(e,t,o)}function S(e,t,o){for(const n of t)G(e,n,o);e.lengths.push(t.length)}function F(e,t,o){for(let n=t.length-1;n>=0;n--)G(e,t[n],o);e.lengths.push(t.length)}function G(e,[t,o,n],r){e.coords.push(t,o),r&&e.coords.push(n||0)}function k(t){switch(typeof t){case"string":return e(t)?"esriFieldTypeDate":"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function M(e,n=4326){if(!e)throw new t("geojson-layer:empty","GeoJSON data is empty");if("Feature"!==e.type&&"FeatureCollection"!==e.type)throw new t("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:e});const{crs:r}=e;if(!r)return;const i="string"==typeof r?r:"name"===r.type?r.properties.name:"EPSG"===r.type?r.properties.code:null,s=o({wkid:n})?new RegExp(".*(CRS84H?|4326)$","i"):new RegExp(`.*(${n})$`,"i");if(!i||!s.test(i))throw new t("geojson:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:r})}function T(e,t={}){const o=[],n=new Set,r=new Set;let i,s=!1,u=null,y=!1,{geometryType:g=null}=t;for(const l of p(e)){const{geometry:e,properties:t,id:p}=l;if(!e||(g||(g=f(e.type)),f(e.type)===g)){if(!s){s=d(a(e))}if(y||(y=null!=p,y&&(i=typeof p,t&&(u=Object.keys(t).filter(e=>t[e]===p)))),t&&u&&y&&null!=p&&(u.length>1?u=u.filter(e=>t[e]===p):1===u.length&&(u=t[u[0]]===p?u:[])),t)for(const e in t){if(n.has(e))continue;const i=k(t[e]);if("unknown"===i){r.add(e);continue}r.delete(e),n.add(e);const s=c(e);s&&o.push({name:s,alias:e,type:i})}}}const m=c(1===u?.length&&u[0]||null)??void 0;if(m)for(const c of o)if(c.name===m&&l(c)){c.type="esriFieldTypeOID";break}return{fields:o,geometryType:g,hasZ:s,objectIdFieldName:m,objectIdFieldType:i,unknownFields:Array.from(r)}}function O(e,t){return Array.from(y(p(e),t))}export{O as createOptimizedFeatures,f as getGeometryType,T as inferLayerProperties,M as validateGeoJSON};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{__addDisposableResource as t,__disposeResources as e}from"tslib";import a from"../../../../request.js";import has from"../../../../core/has.js";import{QueueProcessor as s}from"../../../../core/QueueProcessor.js";import{isBlobProtocol as r}from"../../../../core/urlUtils.js";import{ParquetFileInfo as n}from"./ParquetFileInfo.js";import{parseFileStatisticsMap as i}from"./ParquetFileStatistics.js";import{createParquetFile as o,readMetadata as c}from"../../../../libs/parquet/parquet.js";const h="parquet.v1",u="_spatial.json",f=new s({concurrency:12,process:async t=>{const{data:e}=await a(t.url,t.options);return e}});class l{constructor(t,e=()=>{}){this._geometryInfo=t,this._getCustomParameters=e}async destroy(){await this.clear()}async clear(){if(this._infos){const t=await this._infos;for(const e of t.values())e.destroy();t.clear(),this._infos=null}}async getMetadata(){const a={stack:[],error:void 0,hasError:!1};try{const e=(await this._getParquetFileNames()).at(0);if(!e)return null;const s=t(a,await o(e,{provider:this}),!1);return c(s)}catch(s){a.error=s,a.hasError=!0}finally{e(a)}}getGeometryInfo(){return this._geometryInfo}async getFiles(){const t=await this._getInfoMap();return Array.from(t.values())}async updateGeometryInfo(t){if(this._geometryInfo)throw new Error("GeometryInfo already set");await this.clear(),this._geometryInfo=t}async fetchLength(t){const{byteLength:e,cacheTag:a}=await this._fetchLengthAndTag(t);if(!has("parquetlayer-cache-enabled"))return e;try{await this._createOrResetCache(t,a)}catch(s){}return e}async fetchRange(t,e,a,s){if(!has("parquetlayer-cache-enabled"))return this._fetchRange(t,e,a,s);const r=new URL(this._getCacheFileName(t));r.searchParams.append("range",`${e}-${a}`);try{const n=await this._openCache(t),i=await n.match(r);if(i)return await i.arrayBuffer();const o=await this._fetchRange(t,e,a,s);return await n.put(r,new Response(o,{headers:{"Content-Type":"application/octet-stream","Content-Length":o.byteLength.toString()}})),o}catch(n){return this._fetchRange(t,e,a,s)}}_getCacheFileName(t){return t}async _requestStatistics(t){const{data:e}=await a(t,{responseType:"json",query:this._getCustomParameters()});return e}async _fetchRange(t,e,a,s){const r={url:t,options:{responseType:"array-buffer",query:this._getCustomParameters()??{},cacheMode:"no-store",useQueue:!0,headers:{range:`bytes=${e}-${a}`}}};return f.push(r)}async _fetchLengthAndTag(t){if(r(t)){const{data:e}=await a(t,{responseType:"blob"});return{byteLength:e.size,cacheTag:null}}const e=await this._requestHead(t),s=e.headers.get("Content-Length");if(null==s)throw new Error("Unable to parse content length");const n=e.headers.get("etag")??e.headers.get("Last-Modified");return{byteLength:parseInt(s,10),cacheTag:n}}async _getInfoMap(){return this._infos||(this._infos=this._fetchParquetFiles()),this._infos}async _updateParquetFileInfos(t){const e=await this._getInfoMap(),a=new Set(t);for(const s of a)if(!e.get(s)){const t=e.size,a=await n.create(this.getGeometryInfo(),this,s,t,null);e.set(s,a)}for(const s of e.keys())if(!a.has(s))throw new Error("Deletion not supported")}async _getFileStatistics(t){this._statistics||(this._statistics=this._fetchStatistics());const e=await this._statistics,a=p(t);return e.get(a)}async _fetchParquetFiles(){const t=(await this._getParquetFileNames()).map(async(t,e)=>{const a=e,s=await this._getFileStatistics(t);return n.create(this.getGeometryInfo(),this,t,a,s)}),e=await Promise.all(t),a=new Map;for(const s of e)a.set(s.url,s);return a}async _fetchStatistics(){const t=await this._getStatisticsFileName();if(null==t)return new Map;const e=await this._resolveFileUrl(t),a=await this._requestStatistics(e);return i(a)}async _requestHead(t){const{data:e}=await a(t,{responseType:"native",method:"head",query:this._getCustomParameters()});return e}async _openCache(t){return caches.open(this._getCacheName(t))}_getCacheName(t){return`${h}:${this._getCacheFileName(t)}`}async _createOrResetCache(t,e){const a=this._getCacheName(t),s=new URL(this._getCacheFileName(t));if(s.searchParams.append("metadata","true"),null==e)return void await caches.delete(a);let r=await caches.open(a);const n=await r.match(s),i=await(n?.json());i?.tag!==e&&(await caches.delete(a),r=await caches.open(a));const o=JSON.stringify({tag:e});await r.put(s,new Response(o,{headers:{"Content-Type":"application/json","Content-Length":o.length.toString()}}))}}function g(t){const e=t.split(/[?#]/)[0];return e===u||e.endsWith(u)}function p(t){return t.split(/[?#]/)[0].split("/").at(-1)??t}export{l as FileProvider,g as isStatisticsFileName,u as spatialFileName};
2
+ import{__addDisposableResource as t,__disposeResources as e}from"tslib";import a from"../../../../request.js";import s from"../../../../core/Error.js";import{EventEmitter as r}from"../../../../core/Evented.js";import has from"../../../../core/has.js";import{QueueProcessor as n}from"../../../../core/QueueProcessor.js";import{isBlobProtocol as i}from"../../../../core/urlUtils.js";import{ParquetFileInfo as o}from"./ParquetFileInfo.js";import{parseFileStatisticsMap as c}from"./ParquetFileStatistics.js";import{createParquetFile as h,readMetadata as u}from"../../../../libs/parquet/parquet.js";const f="parquet.v1",l="_spatial.json",g=new n({concurrency:12,process:async t=>{const{data:e}=await a(t.url,t.options);return e}});class p{constructor(t,e=()=>{}){this._geometryInfo=t,this._getCustomParameters=e,this.events=new r}async destroy(){await this.clear()}async clear(){if(this._infos){const t=await this._infos;for(const e of t.values())e.destroy();t.clear(),this._infos=null}}async getMetadata(){const a={stack:[],error:void 0,hasError:!1};try{const e=(await this._getParquetFileNames()).at(0);if(!e)return null;const s=t(a,await h(e,{provider:this}),!1);return u(s)}catch(s){a.error=s,a.hasError=!0}finally{e(a)}}getGeometryInfo(){return this._geometryInfo}async getFiles(){const t=await this._getInfoMap();return Array.from(t.values())}async updateGeometryInfo(t){if(this._geometryInfo)throw new Error("GeometryInfo already set");await this.clear(),this._geometryInfo=t}async fetchLength(t){const{byteLength:e,cacheTag:a}=await this._fetchLengthAndTag(t);if(!has("parquetlayer-cache-enabled"))return e;try{await this._createOrResetCache(t,a)}catch(s){}return e}async fetchRange(t,e,a,s){if(!has("parquetlayer-cache-enabled"))return this._fetchRange(t,e,a,s);const r=new URL(this._getCacheFileName(t));r.searchParams.append("range",`${e}-${a}`);try{const n=await this._openCache(t),i=await n.match(r);if(i)return await i.arrayBuffer();const o=await this._fetchRange(t,e,a,s);return await n.put(r,new Response(o,{headers:{"Content-Type":"application/octet-stream","Content-Length":o.byteLength.toString()}})),o}catch(n){return this._fetchRange(t,e,a,s)}}_getCacheFileName(t){return t}async _requestStatistics(t){const{data:e}=await a(t,{responseType:"json",query:this._getCustomParameters()});return e}async _fetchRange(t,e,a,r){const n={url:t,options:{responseType:"array-buffer",query:this._getCustomParameters()??{},cacheMode:"no-store",useQueue:!0,headers:{range:`bytes=${e}-${a}`}}},i=await g.push(n),o=a-e+1;if(i.byteLength!==o)throw new s("InvalidRangeRequest",`request returned ${i.byteLength} bytes for range ${e}-${a}, expected ${o}.`);return i}async _fetchLengthAndTag(t){if(i(t)){const{data:e}=await a(t,{responseType:"blob"});return{byteLength:e.size,cacheTag:null}}const e=await this._requestHead(t),s=e.headers.get("Content-Length");if(null==s)throw new Error("Unable to parse content length");const r=e.headers.get("etag")??e.headers.get("Last-Modified");return{byteLength:parseInt(s,10),cacheTag:r}}async _getInfoMap(){return this._infos||(this._infos=this._fetchParquetFiles()),this._infos}async _updateParquetFileInfos(t){const e=await this._getInfoMap(),a=new Set(t);for(const s of a)if(!e.get(s)){const t=e.size,a=await o.create(this.getGeometryInfo(),this,s,t,null);e.set(s,a)}for(const s of e.keys())if(!a.has(s))throw new Error("Deletion not supported")}async _getFileStatistics(t){this._statistics||(this._statistics=this._fetchStatistics());const e=await this._statistics,a=m(t);return e.get(a)}async _fetchParquetFiles(){const t=(await this._getParquetFileNames()).map(async(t,e)=>{const a=e,s=await this._getFileStatistics(t);return o.create(this.getGeometryInfo(),this,t,a,s)}),e=await Promise.all(t),a=new Map;for(const s of e)a.set(s.url,s);return a}async _fetchStatistics(){const t=await this._getStatisticsFileName();if(null==t)return new Map;const e=await this._resolveFileUrl(t),a=await this._requestStatistics(e);return c(a)}async _requestHead(t){const{data:e}=await a(t,{responseType:"native",method:"head",query:this._getCustomParameters()});return e}async _openCache(t){return caches.open(this._getCacheName(t))}_getCacheName(t){return`${f}:${this._getCacheFileName(t)}`}async _createOrResetCache(t,e){const a=this._getCacheName(t),s=new URL(this._getCacheFileName(t));if(s.searchParams.append("metadata","true"),null==e)return void await caches.delete(a);let r=await caches.open(a);const n=await r.match(s),i=await(n?.json());i?.tag!==e&&(await caches.delete(a),r=await caches.open(a));const o=JSON.stringify({tag:e});await r.put(s,new Response(o,{headers:{"Content-Type":"application/json","Content-Length":o.length.toString()}}))}}function y(t){const e=t.split(/[?#]/)[0];return e===l||e.endsWith(l)}function m(t){return t.split(/[?#]/)[0].split("/").at(-1)??t}export{p as FileProvider,y as isStatisticsFileName,l as spatialFileName};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import e from"../../../../request.js";import{FileProvider as t,isStatisticsFileName as s}from"./FileProvider.js";const r=100;class a extends t{constructor(e,t,s){super(t,s),this._schema=e}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async update(e){throw new Error("Unsupported")}async _getParquetFileNames(){const e=await this._getResources();return Array.from(e.keys()).filter(e=>e.endsWith(".parquet"))}async _getStatisticsFileName(){const e=await this._getResources();return Array.from(e.keys()).find(s)??null}_getCacheFileName(e){return`${this._baseUrl}/resources/${e}`}async _resolveFileUrl(e){const t=await this._getResource(e);return t.signedUrl?t.signedUrl:`${this._baseUrl}/resources/${e}`}async _fetchLengthAndTag(e){const t=await this._getResource(e),s=this._schema.itemMetadata.modified.getTime().toString();return{byteLength:t.size,cacheTag:s}}async _fetchRange(e,t,s,r){try{const a=await this._resolveFileUrl(e);return await super._fetchRange(a,t,s,r)}catch{this._invalidate()}const a=await this._resolveFileUrl(e);return super._fetchRange(a,t,s,r)}_invalidate(){this._resources=null}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _getResource(e){const t=(await this._getResources()).get(e);if(!t)throw new Error(`Resource ${e} not found.`);return t}async _fetchResources(){const t=new Map;let s=1;const a=n(this._schema.itemMetadata.url);for(;-1!==s;){const n=await e(`${this._baseUrl}/resources`,{query:{f:"json",start:s,num:r}});for(const e of n.data.resources)e.resource.startsWith(a)&&t.set(e.resource,e);s=n.data.nextStart}return t}}function n(e){const t=e.split("/").filter(Boolean),s=t.indexOf("resources");if(-1===s||s===t.length-1)throw new Error(`URL does not contain a resources directory name: ${e}`);return`${t.slice(s+1).map(e=>decodeURIComponent(e)).join("/")}/`}export{a as PortalParquetResourcesFileProvider};
2
+ import e from"../../../../request.js";import{FileProvider as t,isStatisticsFileName as r}from"./FileProvider.js";import{createFileProviderChangedError as s}from"./fileProviderChangedError.js";const a=100;class i extends t{constructor(e,t,r){super(t,r),this._schema=e,this._directoryChanged=!1}get _baseUrl(){return this._schema.itemCdnUrl??this._schema.itemUrl}async update(e){throw new Error("Unsupported")}async _getParquetFileNames(){const e=await this._getResources();return Array.from(e.keys()).filter(e=>e.endsWith(".parquet"))}async _getStatisticsFileName(){const e=await this._getResources();return Array.from(e.keys()).find(r)??null}_getCacheFileName(e){return`${this._baseUrl}/resources/${e}`}async _resolveFileUrl(e){const t=await this._getResource(e);return t.signedUrl?t.signedUrl:`${this._baseUrl}/resources/${e}`}async _fetchLengthAndTag(e){const t=await this._getResource(e),r=this._schema.itemMetadata.modified.getTime().toString();return{byteLength:t.size,cacheTag:r}}async _fetchRange(e,t,r,a){if(this._directoryChanged)throw s();try{const s=await this._resolveFileUrl(e);return await super._fetchRange(s,t,r,a)}catch{if("directory-changed"===await this._refetchResources())throw s()}const i=await this._resolveFileUrl(e);return super._fetchRange(i,t,r,a)}_refetchResources(){return this._directoryChanged?Promise.resolve("directory-changed"):(this._updateResourcesPromise||(this._updateResourcesPromise=this._executeRefetchResources().finally(()=>{this._updateResourcesPromise=null})),this._updateResourcesPromise)}async _executeRefetchResources(){return await this._refetchPortalItemMetadata()?(this.events.emit("sourceChanged"),this._directoryChanged=!0,"directory-changed"):(this._resources=this._fetchResources(),"ok")}async _refetchPortalItemMetadata(){const t=this._schema.itemMetadata.url,r=await e(this._schema.itemUrl,{responseType:"json",query:{f:"json"}}),{modified:s,url:a}=r.data;if(null==a)throw new Error("Portal item metadata must have a url defined.");if(null==s)throw new Error("Portal item metadata must have a modified timestamp defined.");return this._schema.itemMetadata={modified:new Date(s),url:a},t!==a}async _getResources(){return this._resources||(this._resources=this._fetchResources()),await this._resources}async _getResource(e){const t=(await this._getResources()).get(e);if(!t)throw new Error(`Resource ${e} not found.`);return t}async _fetchResources(){const t=new Map;let r=1;const s=o(this._schema.itemMetadata.url);for(;-1!==r;){const i=await e(`${this._baseUrl}/resources`,{query:{f:"json",start:r,num:a}});for(const e of i.data.resources)e.resource.startsWith(s)&&t.set(e.resource,e);r=i.data.nextStart}return t}}function o(e){const t=e.split("/").filter(Boolean),r=t.indexOf("resources");if(-1===r||r===t.length-1)throw new Error(`URL does not contain a resources directory name: ${e}`);return`${t.slice(r+1).map(e=>decodeURIComponent(e)).join("/")}/`}export{i as PortalParquetResourcesFileProvider};
@@ -0,0 +1,2 @@
1
+ /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
+ import r from"../../../../core/Error.js";function e(r){return null!=r&&"object"==typeof r&&"name"in r&&"FileProviderChangedError"===r.name}function n(e=""){return new r("FileProviderChangedError",e)}export{n as createFileProviderChangedError,e as isFileProviderChangedError};