@arcgis/core 5.0.0-next.7 → 5.0.0-next.8

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 (286) hide show
  1. package/applications/KnowledgeStudio/resourceSerializationUtils.js +1 -1
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{8f56f298e7c1a283f407.js → 0030d68d9edf42b4af57.js} +1 -1
  4. package/assets/esri/core/workers/chunks/01d460398f3ba6767a37.js +1 -0
  5. package/assets/esri/core/workers/chunks/{17d5f8dba6ebb1184506.js → 042cd64e1f4eb326c30f.js} +1 -1
  6. package/assets/esri/core/workers/chunks/05429f9d292a7a714309.js +316 -0
  7. package/assets/esri/core/workers/chunks/{66db5f77e09d25e33951.js → 063905fbf9a0c6586949.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{9486032af3e934d85582.js → 0a5d74414dd02a2fb8e1.js} +1 -1
  9. package/assets/esri/core/workers/chunks/{3815ffa13e7b439bca6e.js → 0d5212f59e9b62c16164.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{73487b9d85e726e9c012.js → 1257c37bf04d39c27b62.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{398f356b11fd33bd3831.js → 136a7d781dad05a7463b.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{1e4e7aedf4b779241a02.js → 15c7c10ff9ac63f0e792.js} +1 -1
  13. package/assets/esri/core/workers/chunks/17784cf16fa91504b9ea.js +1 -0
  14. package/assets/esri/core/workers/chunks/{a395373e3173e6458a56.js → 1ab37e13947d0e2e4181.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{f03635ddf56e2ef90e4c.js → 1d06fcae4c2f02fb1c95.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{020c8913d8e35d63080b.js → 1d15d1b20dc10fde6def.js} +1 -1
  17. package/assets/esri/core/workers/chunks/1dfca37f95f2b968aa54.js +1 -0
  18. package/assets/esri/core/workers/chunks/20975513be0a3a1da286.js +1 -0
  19. package/assets/esri/core/workers/chunks/{285762ff92d5388b6024.js → 2166238a7ad63a2d43c7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{620a94b54be3ed78350d.js → 22ca80f491e070b2a5e7.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{88074189fa10c335370b.js → 24cd7b84cd0f3de4bff2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{9fac5a12e878cd745354.js → 28020063048e644f17a5.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{95c594a87b732f5c4979.js → 2a8dff8521e1e6a10cf6.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{7e43c105f1cfc44b7bd0.js → 2fa01bd3f3608616fd7f.js} +1 -1
  25. package/assets/esri/core/workers/chunks/30e220f4f843681a4cdd.js +1 -0
  26. package/assets/esri/core/workers/chunks/{5d3661d1fe46dd29aae9.js → 311b564e44ae637c960d.js} +1 -1
  27. package/assets/esri/core/workers/chunks/31c7ce65e16f7858400f.js +1 -0
  28. package/assets/esri/core/workers/chunks/{8a314b3790313e6dc5db.js → 333b62dad3811cff0f14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/36d067c8d03d7a894f5f.js +1 -0
  30. package/assets/esri/core/workers/chunks/{e31192ae920e3e19b6aa.js → 37c1f155da14de91565a.js} +1 -1
  31. package/assets/esri/core/workers/chunks/{aa54b6f2aba6952af149.js → 38cc18fd93c18815ded0.js} +1 -1
  32. package/assets/esri/core/workers/chunks/{c55c096669677321a227.js → 38cd3648932bf2534b0f.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{ac26e3e77df4302f47a2.js → 3afb83f5de033dda89ec.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{f5e47eea8720ba84665b.js → 3c07aa2015ab1dff5f7b.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{e9311386f58f3cb95c22.js → 42a1e71d09e8583a7327.js} +1 -1
  36. package/assets/esri/core/workers/chunks/443dfe7029ec208f670c.js +1 -0
  37. package/assets/esri/core/workers/chunks/{b75930d60449eceb0f1c.js → 4baf6f6e7ddedb25f806.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{bb5484b5eeacc9ad2ceb.js → 4d0cbf9584446f411a37.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{17103e6542aae53c7301.js → 4e3e27673d0671fc2b58.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{5fc7b61f467f1d60a284.js → 51ab2acac4ecc1ca9c34.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{fc4417d1260b717a9385.js → 52282f767bd0e99ddca0.js} +1 -1
  42. package/assets/esri/core/workers/chunks/{fc06014fb484fc8c697e.js → 53654edd766d9b4ef750.js} +1 -1
  43. package/assets/esri/core/workers/chunks/{90f8b4bda28af43ea019.js → 538f509d7fc8337d37ac.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{ed8a85efbd90241512bb.js → 588533c3abe876f20f62.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c8733cd621105afab2ac.js → 59d3cac32ad6dad941dc.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{72846fb9c87c6642daf0.js → 5e2ce34def5e053913b2.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{8c056eac35d05d9524b7.js → 5f29422a051311ef9b3c.js} +1 -1
  48. package/assets/esri/core/workers/chunks/5f402b3c00bc4afc77b2.js +1 -0
  49. package/assets/esri/core/workers/chunks/{ff35a077ac6776469805.js → 61d970ed75c2c358b1e9.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{7a6a96edc892d7060b7d.js → 629127877042ad784ad2.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{fd2efd1d1cf9d95a87e6.js → 63a6f3e70d2b6ea57e40.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{90b2b43b8b54c9a1ec35.js → 664ae441617afe4b17ec.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{c4e4da69969499a89a2c.js → 695cdef5057e5461078a.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{4c5a7249a311070d8f43.js → 6af18d7a0d314d7c1756.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{f35aaa04cca676c2d3f8.js → 6b59f94040c7d2f6728a.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{811d4c46c75cf6a63e78.js → 6bb7dbc46787b8e34bd9.js} +1 -1
  57. package/assets/esri/core/workers/chunks/6d9f2b113d6bde936a04.js +1 -0
  58. package/assets/esri/core/workers/chunks/{5132ca68e8c7af111a47.js → 6e22b02a9715c10578d0.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{cd1930f08e1fc8b30b14.js → 6ee2f0f708494102a493.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{f0e0a63962784acb4ba1.js → 6f0aec7428021e440ac9.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{deb2854bb7d082a26f52.js → 7005d956c990a04ee8b2.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{a3991ae8caa713d4ddcd.js → 731f7b552dde0fb325cd.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{464d42bebb365287808d.js → 773f2c6c9d38db76dfed.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{3f3d492f1093b7832aab.js → 7803495f8862d9025bcd.js} +1 -1
  65. package/assets/esri/core/workers/chunks/78694ad8229347903f41.js +1 -0
  66. package/assets/esri/core/workers/chunks/7e4c14d4502e3f06d94b.js +1 -0
  67. package/assets/esri/core/workers/chunks/{7544316a75dbd981aea6.js → 86cb097deec50b0da3f3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/8a40ed2ee4b032822c30.js +1 -0
  69. package/assets/esri/core/workers/chunks/{09de8be660174a229efb.js → 8cbb28476151a37ae958.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{62a49cfd9a2508950e9f.js → 8fedfd33c37172dba6bf.js} +1 -1
  71. package/assets/esri/core/workers/chunks/90cbd627d4113db3b686.js +1 -0
  72. package/assets/esri/core/workers/chunks/91aa1157da32f650983b.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e7638b9ab6674bc8a18f.js → 91dfd29e2dba200eab09.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{794748fd1edc29a621cd.js → 9698f36c143953a975d4.js} +1 -1
  75. package/assets/esri/core/workers/chunks/98584902c9db6faa3e4d.js +1 -0
  76. package/assets/esri/core/workers/chunks/9e5e05d6430712b0b1bc.js +1 -0
  77. package/assets/esri/core/workers/chunks/{6f4bd0ee85e7e5a74340.js → a31635a6366347dcef0f.js} +1 -1
  78. package/assets/esri/core/workers/chunks/a6ee40dfc471d6612f3c.js +1 -0
  79. package/assets/esri/core/workers/chunks/{ccc0da0e01f023c8aa1f.js → a876d6159ca120c1567e.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{a4db5c9a90107e097df8.js → af47272aaaef0ea57e71.js} +1 -1
  81. package/assets/esri/core/workers/chunks/{d1fe816b6990918c13c7.js → afc13d5b842275db7dbc.js} +1 -1
  82. package/assets/esri/core/workers/chunks/aff8e40a641c6822af1d.js +1 -0
  83. package/assets/esri/core/workers/chunks/{22d6b8102e75bdef204c.js → b0365cbc3d2a41969e3b.js} +1 -1
  84. package/assets/esri/core/workers/chunks/{79968c183135281d2a6f.js → b3613a38178cad2ebc82.js} +1 -1
  85. package/assets/esri/core/workers/chunks/b548910e820d731ffe8a.js +1 -0
  86. package/assets/esri/core/workers/chunks/{5bd36dbf46c25bd961c8.js → b708792c84620b73c847.js} +1 -1
  87. package/assets/esri/core/workers/chunks/c29486c4eeb3e72effff.js +1 -0
  88. package/assets/esri/core/workers/chunks/{2b94623cabc6ae0f86ce.js → c37f7756d48ff9af2656.js} +1 -1
  89. package/assets/esri/core/workers/chunks/{1c52999a6392370844a6.js → c4090a60d149a5962179.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{73c1d43070b4fe1e5c1e.js → c8e686efe344a33a0258.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{6bb5158de43c4b59107f.js → c9b16fd41cd59d452522.js} +1 -1
  92. package/assets/esri/core/workers/chunks/ce98416437cc1a89d8ea.js +1 -0
  93. package/assets/esri/core/workers/chunks/{279366e6b743f9680603.js → cfff044859e6e6dcc75d.js} +1 -1
  94. package/assets/esri/core/workers/chunks/d07f911d40bf05fc0306.js +1 -0
  95. package/assets/esri/core/workers/chunks/{8833c3d168951be4bf20.js → d0d79dd3e88eecf5c314.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{76ae1702fecc7ad7017c.js → d1e97cce5047f1791e22.js} +1 -1
  97. package/assets/esri/core/workers/chunks/{17acde0245ecd956306c.js → d233cc33497a663450f9.js} +1 -1
  98. package/assets/esri/core/workers/chunks/{36fe6b8228e622407ec2.js → d8793eead02491136841.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{dedc4583b5f32a278124.js → d88f2fe680b8d5603ef8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/{4d599008e1ea42321b37.js → da24ad57747714ac5eda.js} +1 -1
  101. package/assets/esri/core/workers/chunks/{facb3886714222772ab2.js → ddfd01bb9ba8577c3ffc.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{50d9f69d5255af4b29bb.js → df5afa06c6deb6b40109.js} +1 -1
  103. package/assets/esri/core/workers/chunks/e25c4b4a03270d48f408.js +1 -0
  104. package/assets/esri/core/workers/chunks/e3294318daf1192b8319.js +1 -0
  105. package/assets/esri/core/workers/chunks/{da573ecc68e6aa8f6da9.js → e767f83f9e2de6650f80.js} +1 -1
  106. package/assets/esri/core/workers/chunks/e9d4cae2144974489d6e.js +1 -0
  107. package/assets/esri/core/workers/chunks/{91df8638b8b904e6d8c5.js → ead8d0cbcebd12dbfad7.js} +1 -1
  108. package/assets/esri/core/workers/chunks/{f9324e88c359c03f35aa.js → eb9c166db0db6fa60e95.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{8ffd4710d168c2fcfd96.js → ebf23b46db56aaa88841.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{bc241c7735e4efba734a.js → f34e3fa0c5b28531e289.js} +1 -1
  111. package/assets/esri/core/workers/chunks/f64037a88ab03662dc2a.js +1 -0
  112. package/assets/esri/core/workers/chunks/{d97fadbc69e055d183a0.js → f77f4bd6a577b92cf66f.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{16d66770ef841564ee3f.js → f89c90f98c85667b0ebc.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{4c4227b0ea21a5e429ab.js → fb192de7e4fa152342bb.js} +1 -1
  115. package/assets/esri/core/workers/chunks/fbd8d2f61f8a15bcf3db.js +1 -0
  116. package/assets/esri/core/workers/chunks/{2f78861afe0e9037dd8d.js → fe49321dca22dc60d105.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{fe77ae6cf232a7a3298e.js → fef45bc59c71f88c60b5.js} +1 -1
  118. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  119. package/chunks/MultiPathImpl.js +1 -1
  120. package/chunks/Point2D.js +1 -1
  121. package/chunks/UnitFactory.js +1 -1
  122. package/config.js +1 -1
  123. package/core/QueueProcessor.js +1 -1
  124. package/core/SetUtils.js +1 -1
  125. package/core/has.js +1 -1
  126. package/geometry/operators/gx/operatorOffset.js +1 -1
  127. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  128. package/identity/Credential.js +1 -1
  129. package/identity/IdentityManager.js +1 -1
  130. package/identity/IdentityManagerBase.js +1 -1
  131. package/interfaces.d.ts +67 -27
  132. package/kernel.js +1 -1
  133. package/layers/FeatureLayer.js +1 -1
  134. package/layers/SceneLayer.js +1 -1
  135. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  136. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  137. package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
  138. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  139. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  140. package/layers/support/fieldConfigUtils.js +1 -1
  141. package/layers/support/rasterDatasets/pixelReader.js +1 -1
  142. package/layers/support/source/DataLayerSource.js +1 -1
  143. package/package.json +3 -3
  144. package/popup/FieldInfo.js +1 -1
  145. package/processRequest.js +5 -0
  146. package/request.js +1 -1
  147. package/requestConfig.js +5 -0
  148. package/requestQueue.js +5 -0
  149. package/rest/query/executeForCount.js +1 -1
  150. package/rest/query/executeForExtent.js +1 -1
  151. package/rest/query/executeForIds.js +1 -1
  152. package/rest/query/executeQueryJSON.js +1 -1
  153. package/rest/query/executeQueryPBF.js +1 -1
  154. package/rest/query/operations/query.js +1 -1
  155. package/rest/support/BaseImageMeasureResultValue.js +5 -0
  156. package/rest/support/ImageAreaResult.js +1 -1
  157. package/rest/support/ImageDistanceResult.js +1 -1
  158. package/rest/support/ImageHeightResult.js +1 -1
  159. package/rest/support/ImageMeasureResultAngleValue.js +5 -0
  160. package/rest/support/ImageMeasureResultAreaValue.js +5 -0
  161. package/rest/support/ImageMeasureResultLengthValue.js +5 -0
  162. package/rest/support/ImageWithType.js +5 -0
  163. package/rest/support/imageMeasureUtils.js +1 -1
  164. package/support/revision.js +1 -1
  165. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  166. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  167. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  168. package/views/2d/layers/features/schema/SourceSchema.js +1 -1
  169. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  170. package/views/2d/layers/features/sources/strategies/AFeatureLoadStrategy.js +1 -1
  171. package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
  172. package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +1 -1
  173. package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +1 -1
  174. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  175. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  176. package/views/{3d/support/ImageWithType.js → 2d/layers/features/sources/strategies/constants.js} +1 -1
  177. package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
  178. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  179. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  180. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementErrors.js +1 -1
  181. package/views/3d/glTF/DefaultLoadingContext.js +1 -1
  182. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  183. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
  184. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  185. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  186. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  187. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  188. package/views/3d/layers/graphics/FeatureGraphics3DGraphicsPipeline.js +1 -1
  189. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  190. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  191. package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
  192. package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
  193. package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
  194. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  195. package/views/3d/layers/graphics/pipeline/fetching/Tile3DFetcher.js +1 -1
  196. package/views/3d/layers/graphics/wosrLoader.js +1 -1
  197. package/views/3d/layers/i3s/I3SDataRequester.js +5 -0
  198. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  199. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  200. package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
  201. package/views/3d/layers/support/FeatureTile.js +1 -1
  202. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  203. package/views/3d/layers/support/MediaLayerInteractionOptions.js +1 -1
  204. package/views/3d/layers/support/MediaLayerInteractionReshapeOptions.js +5 -0
  205. package/views/3d/layers/support/SampledGeometryMaxDistanceRatio.js +5 -0
  206. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  207. package/views/3d/layers/support/fetchTile.js +1 -1
  208. package/views/3d/support/ResourceController.js +1 -1
  209. package/views/3d/support/SharedSymbolResources.js +1 -1
  210. package/views/3d/support/StreamTextureCollection.js +1 -1
  211. package/views/3d/terrain/TerrainSurface.js +1 -1
  212. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  213. package/views/3d/webgl-engine/lighting/SceneLighting.js +1 -1
  214. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +6 -0
  215. package/views/SceneView.js +1 -1
  216. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  217. package/views/analysis/ElevationProfile/elevationProfileGeometryUtils.js +1 -1
  218. package/views/draw/MultipointDrawAction.js +1 -1
  219. package/views/draw/PointDrawAction.js +1 -1
  220. package/views/draw/PolygonDrawAction.js +1 -1
  221. package/views/draw/PolylineDrawAction.js +1 -1
  222. package/views/draw/SegmentDrawAction.js +1 -1
  223. package/views/draw/input/CursorUpdateEvents.js +5 -0
  224. package/views/draw/input/DrawCompleteEvent.js +5 -0
  225. package/views/draw/input/VertexAddEvent.js +5 -0
  226. package/views/draw/input/VertexRemoveEvent.js +5 -0
  227. package/views/draw/input/VertexUpdateEvent.js +5 -0
  228. package/views/interactive/editGeometry/CheckpointingEditGeometryOperations.js +5 -0
  229. package/views/interactive/editGeometry/EditGeometry.js +1 -1
  230. package/views/interactive/editGeometry/operations/ReplayableAppendVertex.js +5 -0
  231. package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
  232. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  233. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  234. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  235. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTilesSimple.js +1 -1
  236. package/webscene/spec-certification/api.js +1 -1
  237. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  238. package/widgets/CoordinateConversion.js +1 -1
  239. package/widgets/Editor.js +1 -1
  240. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  241. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  242. package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
  243. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  244. package/widgets/PanoramicViewer/PanoramicZoomManager.js +1 -1
  245. package/widgets/PanoramicViewer/support/PanoramicMeshManager.js +1 -1
  246. package/widgets/PanoramicViewer/support/PanoramicTileNode.js +1 -1
  247. package/widgets/PanoramicViewer/support/PanoramicTilePyramid.js +1 -1
  248. package/widgets/PanoramicViewer/support/getVisibleTiles.js +5 -0
  249. package/widgets/Sketch/CreateToolVisibilityMap.js +5 -0
  250. package/widgets/Sketch/SelectionToolVisibilityMap.js +5 -0
  251. package/widgets/Sketch/VisibleElements.js +1 -1
  252. package/widgets/Sketch.js +1 -1
  253. package/assets/esri/core/workers/chunks/02e69f0c63d97661da60.js +0 -1
  254. package/assets/esri/core/workers/chunks/05eee334d58a0b9f6316.js +0 -1
  255. package/assets/esri/core/workers/chunks/087973e7c4fea5fcfa5e.js +0 -1
  256. package/assets/esri/core/workers/chunks/326a76a4e80269d4029d.js +0 -1
  257. package/assets/esri/core/workers/chunks/377a66034e7c1bad5599.js +0 -1
  258. package/assets/esri/core/workers/chunks/4442817beb7a76c95770.js +0 -1
  259. package/assets/esri/core/workers/chunks/459a67928bde4a62b6a4.js +0 -1
  260. package/assets/esri/core/workers/chunks/53bd8996e8812f1ad7b2.js +0 -1
  261. package/assets/esri/core/workers/chunks/557960763695abee4a83.js +0 -1
  262. package/assets/esri/core/workers/chunks/6201356f7f91e5c06425.js +0 -1
  263. package/assets/esri/core/workers/chunks/6c3b99209d542efa64d4.js +0 -1
  264. package/assets/esri/core/workers/chunks/7413e582bc2b16af6a0f.js +0 -1
  265. package/assets/esri/core/workers/chunks/7461124454bfb4fb6474.js +0 -1
  266. package/assets/esri/core/workers/chunks/75bf27271a31e26e1b21.js +0 -1
  267. package/assets/esri/core/workers/chunks/7aaaebbabee27690283c.js +0 -1
  268. package/assets/esri/core/workers/chunks/7c4a63aeead2505d6f02.js +0 -1
  269. package/assets/esri/core/workers/chunks/90250e9239c173aace88.js +0 -1
  270. package/assets/esri/core/workers/chunks/9786f91455350eaae493.js +0 -1
  271. package/assets/esri/core/workers/chunks/99859dce1925b406ccd0.js +0 -1
  272. package/assets/esri/core/workers/chunks/9c5cbf8810f37b1a4718.js +0 -1
  273. package/assets/esri/core/workers/chunks/9e8dceef4c961f56940d.js +0 -1
  274. package/assets/esri/core/workers/chunks/a06bac9b8f9e18874de8.js +0 -316
  275. package/assets/esri/core/workers/chunks/a712cdff78fc826acd8c.js +0 -1
  276. package/assets/esri/core/workers/chunks/d305a21666b1ed5bf33d.js +0 -1
  277. package/assets/esri/core/workers/chunks/d40f57f9fc47f9a9f97c.js +0 -1
  278. package/assets/esri/core/workers/chunks/e82f5437bd66779c6740.js +0 -1
  279. package/assets/esri/core/workers/chunks/f4d0ae6be1b3984228d0.js +0 -1
  280. package/assets/esri/core/workers/chunks/f6c8beb60f6d29945a2e.js +0 -1
  281. package/assets/esri/core/workers/chunks/f746e3f7ebff2bbdf333.js +0 -1
  282. package/views/3d/layers/i3s/I3SStreamDataController.js +0 -5
  283. package/views/3d/support/StreamDataLoader.js +0 -5
  284. package/views/3d/support/StreamDataRequester.js +0 -5
  285. package/views/3d/support/downloadSlots.js +0 -5
  286. package/views/draw/input/DrawEvents.js +0 -5
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4649,7136],{159:(e,t,i)=>{i.d(t,{A:()=>u});var n,s=i(31635),r=i(69622),a=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(99157);let u=n=class extends r.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new n;for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}};(0,s.Cg)([(0,a.MZ)({type:[l.A],nonNullable:!0})],u.prototype,"steps",void 0),u=n=(0,s.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformation")],u)},4197:(e,t,i)=>{i.d(t,{Vj:()=>u,cj:()=>l,jh:()=>r,l5:()=>o,xm:()=>a});var n=i(34275),s=i(9093);function r(e){return e<=n.y9?new Array(e).fill(0):new Float64Array(e)}function a(e){return((0,n.iu)(e)?e.byteLength/8:e.length)<=n.y9?Array.from(e):new Float64Array(e)}function o(e,t,i){return Array.isArray(e)?e.slice(t,t+i):e.subarray(t,t+i)}function l(e){return[...e]}function u(e){const t=(0,s.vt)();for(let i=0;i<16;++i)t[i]=e[i];return t}},5834:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266),c=i(41366);function d(e,t,i){(0,s.sM)(i,e instanceof Date?e.getTime():e,t)}let p=class extends((0,c.K)(u.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"numBins",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:d}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:d}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,o.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=(0,n.Cg)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],p),p.from=(0,a.dp)(p)},8384:(e,t,i)=>{i.d(t,{G:()=>M});var n=i(4718),s=i(12359),r=i(90634),a=i(62577),o=i(21325),l=i(29441),u=i(51441),c=i(30524),d=i(87445),p=i(1873),f=i(43668);class h{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let e=0;for(const t of n){const n=(0,l.Wq)(t),s=this.fieldsIndex.get(n),r=s?null:(0,l.j4)(n,i),a=s?s.name:(0,l.SY)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:r})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){const n=i?i.name:t;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:i||(s=(0,l.j4)(t,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),i?this.featureAdapter.getAttribute(e,n):s?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const n=t.normalizationType,s=t.normalizationTotal,r=this.fieldsIndex.get(t.field),a=(0,c.zD)(r)||(0,c.Ah)(r),o=(0,c.OH)(r);return e.map(e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(r=`${(0,p.gJ)(r)}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof r&&i&&(a?r=r?new Date(r).getTime():null:o&&(r=r?(0,d.rb)(r):null)),n&&Number.isFinite(r)){const i="field"===n&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,p.zS)(r,n,i,s)}return r})}async getExpressionValues(e,t,i,n,s){const{arcadeUtils:r}=await(0,f.l)(),a=r.hasGeometryOperations(t);a&&await r.enableGeometryOperations();const o=r.createFunction(t),l=r.getViewInfo(i),c={fields:this.fieldsIndex.fields};return e.map(e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:c,geometry:a?{...(0,u.pL)(n.geometryType,this.featureAdapter.getGeometry(e)),spatialReference:i?.spatialReference}:null},d=r.createExecContext(t,l,s);return r.executeFunction(o,d)})}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const i={};for(const n of t){const{alias:t,clause:s}=this._fieldDataCache.get(n);i[t]=s?s.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return i}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const n of t){const{alias:t}=this._fieldDataCache.get(n);i.push(e[t])}else for(const t in e)i.push(e[t]);const n=`${(t||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}}var m=i(31464),y=i(58727);function g(e,t,i){return{objectId:e,target:t,distance:i,type:"vertex"}}function x(e,t,i,n,s,r=!1){return{objectId:e,target:t,distance:i,type:"edge",start:n,end:s,draped:r}}var F=i(5834),_=i(59977),v=i(57231),w=i(11440),S=i(60909),I=i(98623),R=i(28097);const T="bin";class M{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new h(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:n}=this.query,s=t?.length;if(!s)return 1;const r=new Map,a=new Map,o=new Set;for(const s of n){const{statisticType:n}=s,l="exceedslimit"!==n?s.onStatisticField:void 0;if(!a.has(l)){const i=[];for(const n of t){const t=this._getAttributeValues(e,n,this.items,r);i.push(t)}a.set(l,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:n,items:s}=u[t],r=n.join(",");i&&!e.validateItems(s,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,o.fn)(this.query.outSR)&&!(0,o.aI)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,u.ag)({spatialReference:this.query.outSR,...(0,m.Cv)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,u.ag)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const n=this.featureAdapter,s=A(this.hasZ,this.hasM),{point:r,mode:a}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,d="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,p=this._getPointCreator(a,t,this.spatialReference,i),f=new z(null,0),h=new z(null,0),m={x:0,y:0,z:0};for(const t of this.items){const i=n.getGeometry(t);if(null==i)continue;const{coords:a}=i,y=i.isPoint?C:i.lengths;if(f.coords=a,h.coords=a,e.returnEdge){let e=0;for(let i=0;i<y.length;i++){const a=y[i],d=e;for(let i=0;i<a;i++,e+=s){if(!c&&i===a-1)continue;const y=f;y.coordsIndex=e;const g=h;g.coordsIndex=i===a-1?d:e+s;const F=m;if(!b(m,r,y,g))continue;const _=(r.x-F.x)/o,v=(r.y-F.y)/l,w=_*_+v*v;w<=1&&u.candidates.push(x(n.getObjectId(t),p(F),Math.sqrt(w),p(y),p(g)))}}}if("all"===e.vertexMode){let e=0;for(let i=0;i<y.length;i++){const a=y[i],d=e,m=h;m.coordsIndex=d;for(let i=0;i<a;i++,e+=s){const s=f;if(s.coordsIndex=e,c&&i===a-1&&s.x===m.x&&s.y===m.y)continue;const d=(r.x-s.x)/o,h=(r.y-s.y)/l,y=d*d+h*h;y<=1&&u.candidates.push(g(n.getObjectId(t),p(s),Math.sqrt(y)))}}}else if(d&&"ends"===e.vertexMode){let e=0;const i=[];for(let t=0;t<y.length;t++){i.push(e);const n=y[t];e+=n*s,!c&&n>1&&i.push(e-s)}for(const e of i){const i=f;i.coordsIndex=e;const s=(r.x-i.x)/o,a=(r.y-i.y)/l,c=s*s+a*a;c<=1&&u.candidates.push(g(n.getObjectId(t),p(i),Math.sqrt(c)))}}}return u.candidates.sort((e,t)=>e.distance-t.distance),u}_getPointCreator(e,t,i,n){const s=null==n||(0,o.aI)(i,n)?e=>e:e=>(0,m.Cv)(e,i,n),{hasZ:r}=this;return"3d"===e?r&&t?({x:e,y:t,z:i})=>s({x:e,y:t,z:i}):({x:e,y:t})=>s({x:e,y:t,z:0}):({x:e,y:t})=>s({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,minValue:a,maxValue:o,scale:l,timeZone:u,outStatisticTypes:d}=e,f=this.fieldsIndex.get(t),h=(0,c.vE)(f)||(0,c.zD)(f)||(0,c.Ah)(f),m=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:l,timeZone:u},this.items),y=(0,p.Vb)({normalizationType:s,normalizationField:n,minValue:a,maxValue:o}),g={value:.5,fieldType:f?.type},x=(0,c.yM)(f)?(0,p.z9)({values:m,supportsNullCount:y,percentileParams:g,outStatisticTypes:d}):(0,p.G_)({values:m,minValue:a,maxValue:o,useSampleStdDev:!s,supportsNullCount:y,percentileParams:g,outStatisticTypes:d});return(0,p.oZ)(x,d,h)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:n,returnAllCodedValues:s,scale:r,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:a},this.items,!1),l=(0,p.b3)(o);return(0,p.lv)(l,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:d,timeZone:f}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:d,timeZone:f},this.items),m=(0,p.Rw)(h,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,p.jM)(m,a)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:d,timeZone:f}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:d,timeZone:f},this.items);return(0,p.$y)(h,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const n of t.slice().reverse()){const t=n.split(" "),s=t[0],r=this.fieldsIndex.get(s),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,p.FM)(r?.type,a);e.sort((e,t)=>{const n=i(e,s,r),a=i(t,s,r);return o(n,a)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:n,hasZ:s,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:d,resultRecordCount:p,resultOffset:f,returnZ:h,returnM:m}=e,y=null!=p&&t.length>(f||0)+p,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:n&&m,hasZ:s&&h,objectIdFieldName:r,spatialReference:(0,u.ag)(c||o),transform:d&&(0,a.VV)(d)||null}}_createFeatures(e,t){const i=new h(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:d,resultOffset:p,resultRecordCount:f,returnZ:m=!1,returnM:y=!1}=e,g=s&&m,x=n&&y;let F=[],_=0;const v=[...t];if(this._sortFeatures(v,r,(e,t,n)=>i.getFieldValue(e,t,n)),this.geometryType&&(l||c)){const e=(0,a.VV)(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const n of v){const s=this.featureAdapter.getGeometry(n),r=this._addFeatureJSONMetadata(n,{attributes:i.getAttributes(n),geometry:(0,u.pL)(this.geometryType,s,d,e,g,x)});t&&s&&!r.geometry&&(r.centroid=(0,u.LQ)(this,this.featureAdapter.getCentroid(n,this),e)),F[_++]=r}else if(!l&&c)for(const t of v)F[_++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,u.LQ)(this,this.featureAdapter.getCentroid(t,this),e)});else for(const t of v)F[_++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,u.LQ)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,u.pL)(this.geometryType,this.featureAdapter.getGeometry(t),d,e,g,x)})}else for(const e of v){const t=i.getAttributes(e);t&&(F[_++]=this._addFeatureJSONMetadata(e,{attributes:t}))}const w=p||0;if(null!=f){const e=w+f;F=F.slice(w,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const i=this.featureAdapter.getMetadata?.(e);return void 0!==i&&(t.metadata=i),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(const e of this.query.outStatistics??[])if("exceedslimit"===e.statisticType){t=null!=e.maxPointCount?e.maxPointCount:Number.POSITIVE_INFINITY,i=null!=e.maxRecordCount?e.maxRecordCount:Number.POSITIVE_INFINITY,n=null!=e.maxVertexCount?e.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=A(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce((e,t)=>{const n=i.getGeometry(t);return e+(null!=n&&n.coords.length||0)},0)/t>n}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const n=[],s=new Map,r=new Map,a=new Map,o=new Map,l=new h(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:d,having:p,orderByFields:f,resultRecordCount:m}=e,y=d?.length,g=!!y,x=g?d[0]:null,F=g&&!this.fieldsIndex.get(x);for(const e of u??[]){const{outStatisticFieldName:u,statisticType:f}=e,h=e,m="exceedslimit"!==f?e.onStatisticField:void 0,_="percentile_disc"===f||"percentile_cont"===f,v="EnvelopeAggregate"===f||"CentroidAggregate"===f||"ConvexHullAggregate"===f,w=g&&1===y&&(m===x||F)&&"count"===f;if(g){if(!a.has(m)){const e=[];for(const i of d){const n=this._getAttributeValues(l,i,t,s);e.push(n)}a.set(m,this._calculateUniqueValues(e,t,!v&&l.returnDistinctValues))}const e=a.get(m);if(!e)continue;const i=Object.keys(e);for(const n of i){const{count:i,data:r,items:a,itemPositions:c}=e[n],f=r.join(",");if(!p||l.validateItems(a,p)){const e=o.get(f)||{attributes:{}};if(v){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:i}=await this._getAggregateGeometry(h,a);e.aggregateGeometries[i]=t}else{let n=null;if(w)n=i;else{const e=this._getAttributeValues(l,m,t,s),i=c.map(t=>e[t]);n=_&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,l.returnDistinctValues)}e.attributes[u]=n}let n=0;d.forEach((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++n]=r[i]),o.set(f,e)}}}else if(v){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:n}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[n]=e}else{const e=this._getAttributeValues(l,m,t,s);i.attributes[u]=_&&"statisticParameters"in h?this._getPercentileValue(h,e):this._getStatisticValue(h,e,r,l.returnDistinctValues)}const S="min"!==f&&"max"!==f||!(0,c.yM)(this.fieldsIndex.get(m))&&!this._isAnyDateField(m)?null:this.fieldsIndex.get(m)?.type;n.push({name:u,alias:u,type:S||"esriFieldTypeDouble"})}const _=g?Array.from(o.values()):[i];return this._sortFeatures(_,f,(e,t)=>e.attributes[t]),m&&(_.length=Math.min(m,_.length)),{fields:n,features:_}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,c.vE)(t)||(0,c.zD)(t)||(0,c.Ah)(t)||(0,c.OH)(t)}async _getAggregateGeometry(e,t){const{convexHull:n,union:a}=await Promise.all([i.e(3209),i.e(7559)]).then(i.bind(i,47559)),{statisticType:o,outStatisticFieldName:l}=e,{featureAdapter:c,spatialReference:d,geometryType:p}=this,f=t.map(e=>(0,u.pL)(p,c.getGeometry(e))),h=n(d,f,!0)[0],m={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===o){const e=h?(0,r.v)(h):(0,r.HA)(a(d,f));m.aggregateGeometries={...e,spatialReference:d},m.outStatisticFieldName=l||"extent"}else if("CentroidAggregate"===o){const e=h?(0,s.l8)(h):(0,s.Z4)((0,r.HA)(a(d,f)));m.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},m.outStatisticFieldName=l||"centroid"}else"ConvexHullAggregate"===o&&(m.aggregateGeometries=h,m.outStatisticFieldName=l||"convexHull");return m}_getStatisticValue(e,t,i,n){const{onStatisticField:s,statisticType:r}=e;let a=null;return a=i?.has(s)?i.get(s):(0,c.yM)(this.fieldsIndex.get(s))||this._isAnyDateField(s)?(0,p.z9)({values:t,returnDistinct:n}):(0,p.G_)({values:n?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,a),a["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:n,statisticType:s}=e,{value:r,orderBy:a}=n,o=this.fieldsIndex.get(i);return(0,p.qg)(t,{value:r,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===s})}_getAttributeValues(e,t,i,n){if(n.has(t))return n.get(t);const s=this.fieldsIndex.get(t),r=i.map(i=>e.getFieldValue(i,t,s));return n.set(t,r),r}_calculateUniqueValues(e,t,i){const n={},s=t.length;for(let r=0;r<s;r++){const s=t[r],a=[];for(const t of e)a.push(t[r]);const o=a.join(",");null==n[o]?n[o]={count:1,data:a,items:[s],itemPositions:[r]}:(i||n[o].count++,n[o].items.push(s),n[o].itemPositions.push(r))}return n}async _getDataValues(e,t,i=!0){const s=new h(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:a,timeZone:o}=e;return r?s.getExpressionValues(t,r,{viewingMode:"map",scale:a,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):s.getDataValues(t,(0,n.o8)(e),i)}_calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const n=t.intervals,s=t.min??0,r=t.max??0,a=n.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let t=0;t<e.length;t++){const o=e[t],l=i[t];if(null!=o&&o>=s&&o<=r){const e=(0,p.Ak)(n,o);e>-1&&(a[e].count++,a[e].items.push(l))}}return a}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:n,valueType:s}=t,r=[],a=[{name:n??i,alias:n??i,type:s??"esriFieldTypeString"},{name:T,alias:T,type:"esriFieldTypeInteger"}],o=new h(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[i],(e,t,i)=>o.getFieldValue(e,t,i));const c=this._getAttributeValues(o,i,u,l),d=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const t in d){const{items:s}=d[t],o=await this._createBinsResponse(e,s);if(r.push(...o.features.map(e=>({...e,attributes:{...e.attributes,[n??i]:t}}))),o.fields)for(const e of o.fields)a.some(t=>t.name===e.name)||a.push(e)}return{fields:a,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(F.A.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.A.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(w.A.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(S.A.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:n,normalizationField:s,numBins:r,normalizationType:a,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),d=(0,p.sU)(c,{field:n,normalizationField:s,normalizationType:a,normalizationTotal:o,numBins:r,minValue:(0,y.dO)(l,!1),maxValue:(0,y.dO)(u,!1)}),f=this._calculateHistogramBins(c,d,i);return this._createFeaturesFromHistogramBins(f,t)}async _createDateBinsResponse(e,t,i){const{field:n,interval:s,start:r,end:a,snapToData:o,returnFullIntervalBin:l}=e,u=s.unit,d=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),p=(0,c.OH)(this.fieldsIndex.get(n)),f=v.g.toJSON(u),h=d.filter(Boolean).sort((e,t)=>e-t),m=null!=r?(0,y.dO)(r,p):h[0],g=null!=a?(0,y.dO)(a,p):h[h.length-1],x=[];if(null!=m&&null!=g){const e={zone:t.outTimeReference?.ianaTimeZone??I.n$},i=R.c9.fromMillis(m,e),n=R.c9.fromMillis(g,e);if("last"===o){let e=n;for(;e>i;){const t=e.minus({[f]:s.value});if(t<i){x.unshift([l?t.toMillis():i.toMillis(),e.toMillis()]);break}x.unshift([t.toMillis(),e.toMillis()]),e=t}}else{let e="first"===o?i:i.startOf(f);for(;e<=n;){const t=e.plus({[f]:s.value});if(t>n){x.push([e.toMillis(),l?t.toMillis():n.toMillis()]);break}x.push([e.toMillis(),t.toMillis()]),e=t}}}const F=this._calculateHistogramBins(d,{intervals:x,min:m,max:g},i);return this._createFeaturesFromHistogramBins(F,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:n}=e,s=await this._getDataValues({field:n,timeZone:t.outTimeReference?.ianaTimeZone},i),r=(0,c.OH)(this.fieldsIndex.get(n)),a=e.boundaries.map(e=>(0,y.dO)(e,r)).sort((e,t)=>e-t),o=[];for(let e=0;e<a.length-1;e++)o.push([a[e],a[e+1]]);const l={intervals:o,min:a.at(0),max:a.at(-1)},u=this._calculateHistogramBins(s,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:n,interval:s,start:r,end:a}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=(0,c.OH)(this.fieldsIndex.get(n)),u=(0,p.sU)(o,{field:n,classificationMethod:"defined-interval",definedInterval:s,minValue:(0,y.dO)(r,l),maxValue:(0,y.dO)(a,l)},!0),d=this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(d,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:n}=t,s=n||"lowerBoundary",r=i||"upperBoundary",a=[],o=[{name:s,alias:s,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:T,alias:T,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const d="dateBin"===t.bin.type,p=t.outTimeReference?.ianaTimeZone;for(const i of e){const{minValue:e,maxValue:n,items:f}=i,h={attributes:{}};let m;if(h.attributes[s]=d&&p&&null!=e?R.c9.fromMillis(e,{zone:p}).toISO():e,h.attributes[r]=d&&p&&null!=n?R.c9.fromMillis(n,{zone:p}).toISO():n,l?(m=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},f),h.attributes[T]=++c,"flat"===t.bin.jsonStyle?a.push(...m.features.map(({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...h.attributes}:{...t,...h.attributes}}))):(h.stackedAttributes=m.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),a.push(h))):(t.bin?.splitBy&&(h.attributes[T]=++c),m=await this._createStatisticsQueryResponse(t,f,h),a.push(h)),m.fields)for(const e of m.fields)o.some(t=>t.name===e.name)||o.push(e)}return"desc"===t.binOrder&&a.reverse(),{fields:o,features:a}}}function b(e,t,i,n){const s=n.x-i.x,r=n.y-i.y,a=t.x-i.x,o=t.y-i.y,l=s*s+r*r;if(0===l)return!1;const u=a*s+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+s*c,e.y=i.y+r*c,!0}function A(e,t){return e?t?4:3:t?3:2}class z{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const C=[1]},9093:(e,t,i)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}i.d(t,{o8:()=>s,vt:()=>n,zK:()=>r});const r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:r,clone:s,create:n,fromValues:function(e,t,i,n,s,r,a,o,l,u,c,d,p,f,h,m){return[e,t,i,n,s,r,a,o,l,u,c,d,p,f,h,m]}},Symbol.toStringTag,{value:"Module"}))},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>s});var n=i(37539);function s(e,t,i,s,r,a,o=Math.floor(e.length/3)){const l=(0,n.jd)(t,r);if(null==l)return!1;if(l===n.pO){if(e===s&&i===a)return!0;const t=i+3*o;for(let n=i,r=a;n<t;n++,r++)s[r]=e[n];return!0}const u=i+3*o;for(let t=i,n=a;t<u;t+=3,n+=3)l(e,t,s,n);return!0}},11006:(e,t,i)=>{function n(e,t,i,n,r){s(e,t,i||0,n||e.length-1,r||a)}function s(e,t,i,n,a){for(;n>i;){if(n-i>600){var o=n-i+1,l=t-i+1,u=Math.log(o),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);s(e,t,Math.max(i,Math.floor(t-l*c/o+d)),Math.min(n,Math.floor(t+(o-l)*c/o+d)),a)}var p=e[t],f=i,h=n;for(r(e,i,t),a(e[n],p)>0&&r(e,i,n);f<h;){for(r(e,f,h),f++,h--;a(e[f],p)<0;)f++;for(;a(e[h],p)>0;)h--}0===a(e[i],p)?r(e,i,h):r(e,++h,n),h<=t&&(i=h+1),t<=h&&(n=h-1)}}function r(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function a(e,t){return e<t?-1:e>t?1:0}i.d(t,{q:()=>n})},11440:(e,t,i)=>{i.d(t,{A:()=>c});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266);let c=class extends u.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,s.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map(e=>e.getTime()):e,t)}}}})],c.prototype,"boundaries",void 0),(0,n.Cg)([(0,o.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,n.Cg)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],c),c.from=(0,a.dp)(c)},17136:(e,t,i)=>{i.d(t,{Y_:()=>M,O7:()=>R,el:()=>I});var n=i(92602),s=i(69052),r=i(49186),a=i(53966),o=i(39829),l=i(82799),u=i(16930),c=i(80754),d=i(21325),p=i(28735),f=i(78888),h=i(65864),m=i(2272),y=i(84952),g=i(92300);const x=()=>a.A.getLogger("esri.geometry.support.normalizeUtils");function F(e){return"polygon"===e[0].type}function _(e){return"polyline"===e[0].type}function v(e,t,i){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof o.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new r.A("internal:geometry",e)}const i=(0,c.r8)(e),n=[];for(const e of i){const i=[];n.push(i),i.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],r=e[n][1],a=e[n+1][0],o=e[n+1][1],l=Math.sqrt((a-s)*(a-s)+(o-r)*(o-r)),u=(o-r)/l,c=(a-s)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const n=e*t,a=c*n+s,o=u*n+r;i.push([a,o])}const e=(l+Math.floor(d-1)*t)/2,n=c*e+s,a=u*e+r;i.push([n,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.A({rings:n,spatialReference:e.spatialReference}):new l.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,p.ci)(t,!0)}return i&&(e=(0,c.kS)(e,i)),e}function w(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=(0,c.kd)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=(0,c.kd)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=(0,c.kd)(n,t);e=e.clone().offset(i*(-2*t),0)}else if(n<i){const t=(0,c.kd)(n,i);e=e.clone().offset(t*(-2*i),0)}}return e}function S(e,t){let i=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],r=t.geometries[n],a=(0,c.r8)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some(i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const n=t[e][0];i=n>i?n:i}i=Number(i.toFixed(9));const n=-360*(0,c.kd)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(n,0))}return!0}})}if(s===i){if(F(e))for(const t of(0,c.r8)(r))e[s]=e[s].addRing(t);else if(_(e))for(const t of(0,c.r8)(r))e[s]=e[s].addPath(t)}else i=s,e[s]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let r,a,u,F,_,R,T,M,b=0;const A=[],z=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,a=(0,d.Vp)(r),u=r.isWebMercator,R=u?102100:4326,F=c.j7[R].maxX,_=c.j7[R].minX,T=c.j7[R].plus180Line,M=c.j7[R].minus180Line),a)if("mesh"===t.type)z.push(t);else if("point"===t.type)z.push(w(t.clone(),F,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>w(e,F,_)),z.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,a);z.push(e.rings?new o.A(e):e)}else if(t.extent){const e=t.extent,i=(0,c.kd)(e.xmin,_)*(2*F);let n=0===i?t.clone():(0,c.kS)(t.clone(),i);e.offset(i,0);let{xmin:s,xmax:r}=e;s=Number(s.toFixed(9)),r=Number(r.toFixed(9)),e.intersects(T)&&r!==F?(b=r>b?r:b,n=v(n,u),A.push(n),z.push("cut")):e.intersects(M)&&s!==_?(b=r*(2*F)>b?r*(2*F):b,n=v(n,u,360),A.push(n),z.push("cut")):z.push(n)}else z.push(t.clone());else z.push(t);else z.push(t);let C=(0,c.kd)(b,F),B=-90;const N=C,O=new l.A;for(;C>0;){const e=360*C-180;O.addPath([[e,B],[e,-1*B]]),B*=-1,C--}if(A.length>0&&N>0){const t=S(A,await async function(e,t,i,n){const s=(0,m.Dl)(e),r=t[0].spatialReference,a={...n,responseType:"json",query:{...s.query,f:"json",sr:(0,d.YX)(r),target:JSON.stringify({geometryType:(0,h.$B)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,f.A)(s.path+"/cut",a),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map(e=>{const t=(0,h.rS)(e);return t.spatialReference=r,t})}}(s,A,O,i)),n=[],r=[];for(let i=0;i<z.length;i++){const s=z[i];if("cut"!==s)r.push(s);else{const s=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&s.rings.length>=a.rings.length?(n.push(s),r.push("simplify")):r.push(u?(0,p.Gh)(s):s)}}if(!n.length)return r;const a=await async function(e,t,i){const n="string"==typeof e?(0,y.An)(e):e,s=t[0].spatialReference,r=(0,h.$B)(t[0]),a={...i,query:{...n.query,f:"json",sr:(0,d.YX)(s),geometries:JSON.stringify((0,g.X)(t))}},{data:o}=await(0,f.A)(n.path+"/simplify",a);return(0,g.V)(o.geometries,r,s)}(s,n,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(u?(0,p.Gh)(a.shift()):a.shift())}return o}const q=[];for(let e=0;e<z.length;e++){const t=z[e];if("cut"!==t)q.push(t);else{const e=A.shift();q.push(!0===u?(0,p.Gh)(e):e)}}return q}function R(e,t,i){const n=(0,d.Vp)(i);if(null==n)return e;const[s,r]=n.valid,a=2*r;let o=0,l=0;t>r?o=Math.ceil(Math.abs(t-r)/a):t<s&&(o=-Math.ceil(Math.abs(t-s)/a)),e>r?l=Math.ceil(Math.abs(e-r)/a):e<s&&(l=-Math.ceil(Math.abs(e-s)/a));let u=e+(o-l)*a;const c=u-t;return c>r?u-=a:c<s&&(u+=a),u}function T(e){const t=(0,d.Vp)(e);if(null==t)return null;const[i,n]=t.valid;return new s.hr(i,n)}const M=T(u.A.WGS84);T(u.A.WebMercator)},29441:(e,t,i)=>{i.d(t,{MG:()=>x,SN:()=>f,SY:()=>g,VW:()=>c,Wq:()=>y,eD:()=>h,j4:()=>m,vl:()=>u});var n=i(49186),s=i(44123),r=i(98453);const a=new s.WhereClauseCache(50,500),o="unsupported-query",l=" as ",u=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),c=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),d=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...u,...c]);function p(e,t,i={}){const s=m(t,e);if(!s){const i=a.getError(t,e);throw new n.A(o,"invalid SQL expression",{expression:t,error:i})}const r=i.expressionName||"expression";if(i.validateStandardized&&!s.isStandardized)throw new n.A(o,`${r} is not standard`,{expression:t});if(i.validateAggregate&&!s.isAggregate)throw new n.A(o,`${r} does not contain a valid aggregate function`,{expression:t});return s.fieldNames}function f(e,t,i,n){if(!i)return!0;const s="where clause";return x(e,t,p(e,i,{validateStandardized:!0,expressionName:s}),{expressionName:s,query:n}),!0}function h(e,t,i,s,r){if(!i)return!0;const a="having clause",l=p(e,i,{validateAggregate:!0,expressionName:a});x(e,t,l,{expressionName:a,query:r});const u=m(i,e),c=u?.getExpressions().every(t=>{const{aggregateType:i,field:n}=t,r=e.get(n)?.name;return s.some(t=>{const{onStatisticField:n,statisticType:s}=t,a=e.get(n)?.name;return a===r&&s.toLowerCase().trim()===i})});if(!c)throw new n.A(o,"expressions in having clause should also exist in outStatistics",{having:i});return!0}function m(e,t){return e?a.get(e,t):null}function y(e){return/\((.*?)\)/.test(e)?e:e.split(l)[0]}function g(e){return e.split(l)[1]}function x(e,t,i,s={}){const r=new Map;if(function(e,t,i,n,s){const r=s.includes("*")?[...i,...s.filter(e=>"*"!==e)]:s;for(const s of r)if(t.get(s))F(e,t,i,n,s);else try{const r=p(t,y(s),{validateStandardized:!0});for(const s of r)F(e,t,i,n,s)}catch(t){e.set(s,{type:"expression-error",expression:s,error:t})}}(r,e,t,s.allowedFieldTypes??d,i),r.size){const e=s.expressionName??"expression";throw new n.A(o,`${e} contains invalid or missing fields`,{errors:Array.from(r.values()),query:s.query})}}function F(e,t,i,n,s){const a=t.get(s);a?i.has(a.name)?"all"!==n&&!1===n?.has(a.type)&&e.set(s,{type:"invalid-type",fieldName:a.name,fieldType:r.m.fromJSON(a.type),allowedFieldTypes:Array.from(n,e=>r.m.fromJSON(e))}):e.set(s,{type:"missing-field",fieldName:a.name}):e.set(s,{type:"invalid-field",fieldName:s})}},31464:(e,t,i)=>{i.d(t,{Cv:()=>m,Nk:()=>p,lK:()=>g});var n=i(4576),s=i(74887),r=i(91218),a=i(21325),o=i(28735);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,l),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,l),[i.xmax,i.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:d(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const i=[];for(const n of e)i.push(d(n,t));return i}function d(e,t){const i=[];for(const n of e){const e=t(n[0],n[1],[0,0]);i.push(e),n.length>2&&e.push(n[2]),n.length>3&&e.push(n[3])}return i}async function p(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map(e=>null!=e.geometry?e.geometry.spatialReference:null).filter(n.Ru):[e];await(0,r.initializeProjection)(i.map(e=>({source:e,dest:t})))}const f=u.bind(null,o.je),h=u.bind(null,o.tD);function m(e,t,i,n){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,a.fn)(t)||!(0,a.fn)(i)||(0,a.aI)(t,i))return e;if((0,o.y7)(t,i)){const t=(0,a.K8)(i)?f(e):h(e);return t.spatialReference=i,t}return(0,r.projectMany)([e],t,i,n)[0]}const y=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,n){if(!e?.length||!t||!i||(0,a.aI)(t,i))return e;const r={geometries:e,inSpatialReference:t,outSpatialReference:i,options:n,resolve:(0,s.Tw)()};return this._jobs.push(r),this._timer??=setTimeout(this._process,10),r.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:n,resolve:s,options:l}=e;(0,o.y7)(i,n)&&null==l?.extendedParams?(0,a.K8)(n)?s(t.map(f)):s(t.map(h)):s((0,r.projectMany)(t,i,n,l)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function g(e,t,i,n){return y.push(e,t,i,n)}},37539:(e,t,i)=>{i.d(t,{pO:()=>m,jd:()=>p,Tp:()=>f,w5:()=>d});var n=i(34727),s=i(83047),r=i(73941),a=i(79258);Math.PI;const o=a.$O.radius,l=a.$O.eccentricitySquared,u={a1:o*l,a2:o*l*o*l,a3:o*l*l/2,a4:o*l*o*l*2.5,a5:o*l+o*l*l/2,a6:1-l};a.$O.radius,a.$O.flattening,a.Sw.radius,a.Sw.flattening,a.sH.radius,a.sH.flattening,a.sH.radius;var c=i(21325);const d={2:{5:m,7:null,9:null,10:m,1:S,6:null,8:null,0:null,3:g,11:x,2:m,4:b},5:{5:m,7:null,9:null,10:m,1:S,6:null,8:null,0:null,3:g,11:x,2:m,4:b},7:{5:null,7:m,9:null,10:m,1:null,6:w,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:m,10:m,1:null,6:null,8:v,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,i,n){const s=e[t]/O,r=N-2*Math.atan(Math.exp(-e[t+1]/O)),a=O+e[t+2],o=Math.cos(r)*a;i[n]=Math.cos(s)*o,i[n+1]=Math.sin(s)*o,i[n+2]=Math.sin(r)*a},6:null,8:null,0:null,3:m,11:function(e,t,i,n){y(e,t,i,n),x(i,n,i,n)},2:y,4:function(e,t,i,n){y(e,t,i,n),b(i,n,i,n)}},4:{5:A,7:null,9:null,10:A,1:function(e,t,i,n){A(e,t,i,n),S(i,n,i,n)},6:null,8:null,0:null,3:function(e,t,i,n){A(e,t,i,n),g(i,n,i,n)},11:function(e,t,i,n){A(e,t,i,n),x(i,n,i,n)},2:A,4:m},1:{5:M,7:null,9:null,10:M,1:m,6:null,8:null,0:null,3:function(e,t,i,n){M(e,t,i,n),g(i,n,i,n)},11:function(e,t,i,n){M(e,t,i,n),x(i,n,i,n)},2:M,4:function(e,t,i,n){M(e,t,i,n),b(i,n,i,n)}},6:{5:null,7:T,9:null,10:T,1:null,6:m,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:R,10:R,1:null,6:null,8:m,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:m,3:null,11:null,2:null,4:null},10:{5:m,7:m,9:m,10:m,1:S,6:w,8:v,0:null,3:g,11:x,2:m,4:b},11:{5:F,7:null,9:null,10:F,1:function(e,t,i,n){F(e,t,i,n),S(i,n,i,n)},6:null,8:null,0:null,3:function(e,t,i,n){F(e,t,i,n),g(i,n,i,n)},11:m,2:F,4:function(e,t,i,n){F(e,t,i,n),b(i,n,i,n)}}};function p(e,t){return f(e,t)?.projector}function f(e,t){if(null==e||null==t)return null;if(z.source.spatialReference===e&&z.dest.spatialReference===t)return z;const i=h(e,z.source),n=h(t,z.dest);return 0===i&&0===n?(0,c.aI)(e,t)?z.projector=m:z.projector=null:z.projector=d[i][n],z}function h(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function m(e,t,i,n){e!==i&&(i[n++]=e[t++],i[n++]=e[t++],i[n]=e[t])}function y(e,t,i,n){i[n]=B*(e[t]/O),i[n+1]=B*(N-2*Math.atan(Math.exp(-e[t+1]/O))),i[n+2]=e[t+2]}function g(e,t,i,s){!function(e,t,i,s,r){const a=.4999999*Math.PI,o=(0,n.qE)(C*e[t+1],-a,a),l=Math.sin(o);i[s++]=C*e[t]*r.radius,i[s++]=r.halfSemiMajorAxis*Math.log((1+l)/(1-l)),i[s]=e[t+2]}(e,t,i,s,a.$O)}function x(e,t,i,n){i[n]=e[t]*q,i[n+1]=e[t+1]*q,i[n+2]=e[t+2]}function F(e,t,i,n){i[n]=e[t]*G,i[n+1]=e[t+1]*G,i[n+2]=e[t+2]}function _(e,t,i,n,s){const r=s+e[t+2],a=C*e[t+1],o=C*e[t],l=Math.cos(a)*r;i[n]=Math.cos(o)*l,i[n+1]=Math.sin(o)*l,i[n+2]=Math.sin(a)*r}function v(e,t,i,n){_(e,t,i,n,a.Sw.radius)}function w(e,t,i,n){_(e,t,i,n,a.sH.radius)}function S(e,t,i,n){_(e,t,i,n,a.$O.radius)}function I(e,t,i,s,r){const a=e[t],o=e[t+1],l=e[t+2],u=Math.sqrt(a*a+o*o+l*l),c=(0,n.YN)(l/(0===u?1:u)),d=Math.atan2(o,a);i[s++]=B*d,i[s++]=B*c,i[s]=u-r}function R(e,t,i,n){I(e,t,i,n,a.Sw.radius)}function T(e,t,i,n){I(e,t,i,n,a.sH.radius)}function M(e,t,i,n){I(e,t,i,n,a.$O.radius)}function b(e,t,i,n){!function(e,t,i,n,s){const r=C*e[t],a=C*e[t+1],o=e[t+2],l=Math.sin(a),u=Math.cos(a),c=s.radius/Math.sqrt(1-s.eccentricitySquared*l*l);i[n++]=(c+o)*u*Math.cos(r),i[n++]=(c+o)*u*Math.sin(r),i[n++]=(c*(1-s.eccentricitySquared)+o)*l}(e,t,i,n,a.$O)}function A(e,t,i,n){const s=u,r=e[t],o=e[t+1],l=e[t+2];let c,d,p,f,h,m,y,g,x,F,_,v,w,S,I,R,T,M,b,A,z;c=Math.abs(l),d=r*r+o*o,p=Math.sqrt(d),f=d+l*l,h=Math.sqrt(f),A=Math.atan2(o,r),m=l*l/f,y=d/f,S=s.a2/h,I=s.a3-s.a4/h,y>.3?(g=c/h*(1+y*(s.a1+S+m*I)/h),b=Math.asin(g),F=g*g,x=Math.sqrt(1-F)):(x=p/h*(1-m*(s.a5-S-y*I)/h),b=Math.acos(x),F=1-x*x,g=Math.sqrt(F)),_=1-a.$O.eccentricitySquared*F,v=a.$O.radius/Math.sqrt(_),w=s.a6*v,S=p-v*x,I=c-w*g,T=x*S+g*I,R=x*I-g*S,M=R/(w/_+T),b+=M,z=T+R*M/2,l<0&&(b=-b),i[n++]=B*A,i[n++]=B*b,i[n]=z}const z={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:m},C=(0,n.kU)(1),B=(0,n.KJ)(1),N=.5*Math.PI,O=a.$O.radius,q=O*Math.PI/180,G=180/(O*Math.PI)},41266:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(31635),s=i(69540),r=i(66552),a=i(25482),o=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),u=i(64108),c=i(56507);const d=new r.J({esriFieldTypeInteger:"integer",esriFieldTypeString:"string"});let p=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"outAlias",write:!0}})],p.prototype,"alias",void 0),(0,n.Cg)([(0,o.MZ)({type:String})],p.prototype,"responseType",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"type",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"value",void 0),(0,n.Cg)([(0,l.e)(d)],p.prototype,"valueType",void 0),p=(0,n.Cg)([(0,u.$)("esri.rest.support.AttributeBinsGrouping")],p);const f=p;p.from=(0,c.dp)(p);const h=new r.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),m=new r.J({naturalLog:"natural-log",squareRoot:"square-root"});let y=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],y.prototype,"expression",void 0),(0,n.Cg)([(0,l.e)(h,{name:"onExpression.valueType"})],y.prototype,"expressionValueType",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"onField",write:!0}})],y.prototype,"field",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"firstDayOfWeek",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"hideUpperBound",void 0),(0,n.Cg)([(0,o.MZ)({type:f,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],y.prototype,"splitBy",void 0),(0,n.Cg)([(0,o.MZ)({type:f,json:{write:{target:{stackBy:{type:f},jsonStyle:{type:String}},writer:(e,t)=>{e&&(t.stackBy=e.toJSON(),null!=e.responseType&&(t.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,t)=>f.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],y.prototype,"stackBy",void 0),(0,n.Cg)([(0,l.e)(m)],y.prototype,"transformation",void 0),y=(0,n.Cg)([(0,u.$)("esri.rest.support.BinParametersBase")],y)},41366:(e,t,i)=>{i.d(t,{K:()=>p,Q:()=>u});var n=i(31635),s=i(66552),r=i(53966),a=i(10107),o=(i(44208),i(87811),i(93223)),l=i(64108);const u=(0,s.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",p=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&d||i&&c||null,t&&i&&r.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,n.Cg)([(0,o.e)(u,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,n.Cg)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],i),i}},44123:(e,t,i)=>{i.r(t),i.d(t,{WhereClauseCache:()=>r});var n=i(66344),s=i(88368);class r{constructor(e,t){this._cache=new n.q(e),this._invalidCache=new n.q(t)}get(e,t){const i=`${t?.uid}:${e}`,n=this._cache.get(i);if(n)return n;if(null!=this._invalidCache.get(i))return null;try{const n=s.A.create(e,{fieldsIndex:t});return this._cache.put(i,n),n}catch(e){return this._invalidCache.put(i,e),null}}getError(e,t){const i=`${t?.uid}:${e}`;return this._invalidCache.get(i)??null}}},44794:(e,t,i)=>{i.d(t,{v:()=>o});var n=i(4718),s=i(62788),r=i(95488);class a{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,s.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=n.gh){return new a(e,t)}},51441:(e,t,i)=>{i.d(t,{LQ:()=>s,ag:()=>a,pL:()=>r});var n=i(90708);function s(e,t,i,s=e.hasZ,r=e.hasM){if(null==t)return null;const a=e.hasZ&&s,o=e.hasM&&r;if(i){const e=(0,n.Nl)(t,"esriGeometryPoint",i,s,r);return(0,n.DF)(e,a,o)}return(0,n.DF)(t,a,o)}function r(e,t,i,s,r,a){if(null==t)return null;const o="coords"in t?t:t.geometry;if(null==o)return null;const{hasZ:l,hasM:u}=o,c=l&&(r??=l),d=u&&(a??=u);if(i){let t=(0,n.kz)(o,e,i,r,a);return s&&(t=(0,n.Nl)(t,e,s)),(0,n.zv)(t,e,c,d)}if(s){const t=(0,n.Nl)(o,e,s,r,a);return(0,n.zv)(t,e,c,d)}return(0,n.zv)(o,e,c,d)}function a(e){return e&&o in e?JSON.parse(JSON.stringify(e,l)):e}const o="_geVersion",l=(e,t)=>e===o?void 0:t},54339:(e,t,i)=>{function n(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const i=[];for(const n of t.fieldNames)i.push(e.attributes[n]??null);return JSON.stringify(i)}}}function s(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const i=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(i)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}i.d(t,{W:()=>n,r:()=>s})},56390:(e,t,i)=>{i.d(t,{do:()=>L,Wc:()=>U});var n=i(4576),s=i(21818),r=i(49186),a=(i(44208),i(4718)),o=i(97768),l=i(74887),u=i(83047),c=i(12195),d=i(91218),p=i(70328),f=i(19419),h=i(6606),m=i(65864),y=i(17136),g=i(21325),x=i(90708),F=i(29441),_=i(51441),v=i(31464);class w{constructor(){this._storage=new Map,this._purgeInterval=5,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const e=1e3*this._purgeInterval,t=performance.now()-e;for(const[i,n]of this._storage){if(!(n.time<t))return void(this._storage.size>0&&(this._timer=setTimeout(this._sweep,e)));this._storage.delete(i)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}put(e,t){this._storage?.set(e,new I(t)),this._scheduleSweep()}get(e){const t=this._storage?.get(e);if(t)return this._storage?.delete(e),t.time=performance.now(),this._storage?.set(e,t),t.items}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}get test(){}}let S=0;class I{constructor(e){this.items=e,this.time=performance.now(),this.id=S++}}var R=i(99352),T=i(8384),M=i(58727),b=i(62660),A=i(43668);const z="unsupported-query";async function C(e,{fieldsIndex:t,geometryType:i,spatialReference:n,availableFields:s}){if(null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.A(z,"Unsupported query options",{query:e});return B(t,s,e),function(e,t,i){const{outStatistics:n,groupByFieldsForStatistics:s,having:a}=i,o=s?.length,l=n?.length;if(a){if(!o||!l)throw new r.A(z,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:i});(0,F.eD)(e,t,a,n,i)}if(l){if(null==(u=n)||!u.every(e=>"exceedslimit"!==e.statisticType))return;const a=n.map(e=>e.onStatisticField).filter(Boolean);(0,F.MG)(e,t,a,{expressionName:"onStatisticFields",query:i}),o&&(0,F.MG)(e,t,s,{expressionName:"groupByFieldsForStatistics",query:i});for(const s of n){const{onStatisticField:n,statisticType:a}=s;if("percentile_disc"!==a&&"percentile_cont"!==a||!("statisticParameters"in s))e.get(n)&&"count"!==a&&"min"!==a&&"max"!==a&&(0,F.MG)(e,t,[n],{expressionName:`outStatistics with '${a}' statistic type`,allowedFieldTypes:N,query:i});else{const{statisticParameters:e}=s;if(!e)throw new r.A(z,"statisticParameters should be set for percentile type",{definition:s,query:i})}}}var u}(t,s,e),Promise.all([(0,b.c0)(e,i,n),(0,v.Nk)(n,e.outSR)]).then(()=>e)}function B(e,t,i){const{returnDistinctValues:n,outStatistics:s}=i,a=s?s.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in i&&i.orderByFields&&i.orderByFields.length>0){const n=" asc",s=" desc",r=i.orderByFields.map(e=>{const t=e.toLowerCase();return t.includes(n)?t.split(n)[0]:t.includes(s)?t.split(s)[0]:e}).filter(e=>!a.includes(e));(0,F.MG)(e,t,r,{expressionName:"orderByFields",query:i})}if("outFields"in i)if(i.outFields?.length)(0,F.MG)(e,t,i.outFields,{expressionName:"outFields",query:i,allowedFieldTypes:"all"});else if(n)throw new r.A(z,"outFields should be specified for returnDistinctValues",{query:i});(0,F.SN)(e,t,i.where,i)}const N=new Set([...F.vl,...F.VW]);async function O(e,t,i,n){let s=[];if(i.valueExpression){const{arcadeUtils:e}=await(0,A.l)();s=e.extractFieldNames(i.valueExpression)}if(i.field&&s.push(i.field),i.field2&&s.push(i.field2),i.field3&&s.push(i.field3),i.normalizationField&&s.push(i.normalizationField),!s.length&&!i.valueExpression)throw new r.A(z,"field or valueExpression is required",{params:i});(0,F.MG)(e,t,s,{expressionName:"statistics",query:n})}var q=i(86420),G=i(95466),P=(i(71511),i(53966),i(36708),i(44794),i(78659)),E=i(31635),j=i(69622),D=i(10107),V=(i(87811),i(64108));let Z=class extends j.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,E.Cg)([(0,D.MZ)()],Z.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,E.Cg)([(0,D.MZ)()],Z.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Z=(0,E.Cg)([(0,V.$)("esri.views.support.debugFlags")],Z),new Z,Symbol("Yield");new Map([["immediate",0],["schedule",4],["slide",0],["stream loader",0],["elevation query",0],["terrain",1],["surface geometry updates",1],["LoD renderer",2],["Graphics3D",2],["I3S",2],["point cloud",2],["feature fetcher",2],["stream controller",2],["clouds generator",2],["overlay",4],["overlay renderer",4],["stage",4],["graphics deconflictor",4],["graphics filter visibility",4],["graphics scale visibility",4],["graphics frustum visibility",4],["POI frequent",6],["POI infrequent",30],["labeler",8],["feature query",8],["feature tile tree",16],["fast feature tile tree",0],["elevation alignment",12],["elevation alignment scene",14],["text texture atlas",12],["texture unload",12],["line of sight tool",16],["interactive line of sight tool",0],["snapping",0],["shadow accumulator",30],["flow generator",12],["mapview fetch queue",0],["mapview layerview update",2],["mapview vector tile parsing queue",0]]),(0,P.l5)(6.5),(0,P.l5)(1),(0,P.l5)(30),(0,P.l5)(1e3/30),(0,P.l5)(100);const Q=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};Q.enabled=!1;const k=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,l.G4)(t)){const e=(0,l.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,l.z7)(e(Q))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,l.G4)(t)){const e=(0,l.NK)();if(i)return i(e);throw e}const n=e(Q);for(;;){const e=n.next(Q),s=(0,l.$X)(e)?await e:e;if((0,l.G4)(t)){const e=(0,l.NK)();if(i){const t=i(e);return n.return(null),t}throw n.throw(e),e}if(s.done)return s.value}}};class L{constructor(e){this._changeHandle=null,this.capabilities={query:R.F},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new w,this.timeInfo=e.timeInfo,this.featureIdInfo=e.featureIdInfo,"object-id"===e.featureIdInfo.type&&(this.objectIdField=e.featureIdInfo.fieldName),this._changeHandle=this.featureStore.events.on("changed",()=>this._clearCache()),this.fieldsIndex=(0,c.W)(e.fieldsIndex)?e.fieldsIndex:G.A.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map(e=>e.name)):this.availableFields=new Set(e.availableFields.map(e=>this.fieldsIndex.get(e)?.name).filter(e=>null!=e)),e.scheduler&&e.priority?this._frameTask=e.scheduler.registerTask(e.priority):this._frameTask=k}destroy(){this._changeHandle=(0,o.xt)(this._changeHandle),this._frameTask=(0,o.xt)(this._frameTask),this._clearCache(),(0,o.pR)(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}async executeQuery(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryFeatureSet(e),i)}async executeQueryForCount(e={},t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForCount(e),i)}async executeQueryForExtent(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForExtent(e),i)}async executeQueryForIds(e,t){return Array.from(await this.executeQueryForIdSet(e,t))}async executeQueryForIdSet(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForIdSet(e),i)}async executeQueryForLatestObservations(e,t){const i=(0,l.Mq)(t);if(!this.timeInfo?.trackIdField)throw new r.A("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});return await this._frameTask.scheduleGenerator(()=>this._executeQueryForLatestObservations(e),i)}async executeQueryForOpaqueFeatures(e,t){const i=(0,l.Mq)(t);return(await this._frameTask.scheduleGenerator(()=>this._executeQuery(e,{}),i)).items}async executeAttributeBinsQuery(e,t){const i=(0,l.Mq)(t);return e=(0,a.o8)(e),await this._frameTask.scheduleGenerator(()=>this._executeAttributeBinsQuery(e),i)}async executeQueryForSummaryStatistics(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSummaryStatistics(e,t),n)}async executeQueryForUniqueValues(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForUniqueValues(e,t),n)}async executeQueryForClassBreaks(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForClassBreaks(e,t),n)}async executeQueryForHistogram(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForHistogram(e,t),n)}async executeQueryForSnapping(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSnapping(e,i),i)}async fetchRecomputedExtents(e){const t=(0,l.Mq)(e);this._timeExtentPromise||=(0,q.W)(this.timeInfo,this.featureStore);const[i,n]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,l.Te)(t),{fullExtent:i,timeExtent:n}}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async*_executeQueryFeatureSet(e){try{const t=yield*this._executeQuery(e,{});return yield,await t.createQueryResponse()}catch(t){if(t!==M.v8)throw t;return await new T.G([],e,this).createQueryResponse()}}async*_executeQueryForCount(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null});return yield,t.createQueryResponseForCount()}catch(e){if(e!==M.v8)throw e;return 0}}async*_executeQueryForExtent(e){const t=e.outSR;try{const i=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const n=i.size;if(!n)return{count:0,extent:null};const s=await this._getBounds(i.items,i.spatialReference,t??this.spatialReference);return yield,{count:n,extent:s}}catch(e){if(e===M.v8)return{count:0,extent:null};throw e}}async*_executeQueryForIdSet(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const i=t.items,n=new Set;for(const e of i)n.add(t.featureAdapter.getObjectId(e));return n}catch(e){if(e===M.v8)return new Set;throw e}}async*_executeQueryForLatestObservations(e){try{const t=yield*this._executeQuery(e,{});return yield,this._filterLatest(t),yield,await t.createQueryResponse()}catch(t){if(t!==M.v8)throw t;return await new T.G([],e,this).createQueryResponse()}}async*_executeAttributeBinsQuery(e){let t;try{e=await(0,M.iJ)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t){const i=e.bin;if(!i.onField&&!i.onExpression?.value||"autoIntervalBin"===i.type&&null==i.parameters.numberOfBins||"dateBin"===i.type&&(null==i.parameters.number||null==i.parameters.unit)||"fixedBoundariesBin"===i.type&&null==i.parameters.boundaries||"fixedIntervalBin"===i.type&&null==i.parameters.interval)throw new r.A(z,"Unsupported query options",{query:e});return C(e,t)}(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield,t=yield*this._executeGeometryQuery(e,i),yield,this._executeAggregateIdsQuery(t),yield,this._executeObjectIdsQuery(t),yield,this._executeTimeQuery(t),yield,this._executeAttributesQuery(t),yield}catch(i){if(i!==M.v8)throw i;t=new T.G([],e,this)}return await t.createQueryBinsResponse(e)}async*_executeQueryForSummaryStatistics(e={},t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createSummaryStatisticsResponse(t)}async*_executeQueryForUniqueValues(e={},t){const{field:i,field2:n,field3:s,valueExpression:r}=t,a=yield*this._executeQueryForStatistics(e,{field:i,field2:n,field3:s,valueExpression:r});return yield,await a.createUniqueValuesResponse(t)}async*_executeQueryForClassBreaks(e,t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createClassBreaksResponse(t)}async*_executeQueryForHistogram(e,t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createHistogramResponse(t)}async*_executeQueryForSnapping(e,t){const{point:i,distance:n,returnEdge:s,vertexMode:r}=e;if(!s&&"none"===r)return{candidates:[]};let o=(0,a.o8)(e.query);o=await(0,M.T2)(o,this.definitionExpression,this.spatialReference),yield,o=await C(o,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const l=!(0,g.aI)(i.spatialReference,this.spatialReference);l&&(await(0,v.Nk)(i.spatialReference,this.spatialReference),yield);const u="number"==typeof n?n:n.x,c="number"==typeof n?n:n.y,d={xmin:i.x-u,xmax:i.x+u,ymin:i.y-c,ymax:i.y+c,spatialReference:i.spatialReference},p=l?(0,v.Cv)(d,this.spatialReference):d;if(!p)return{candidates:[]};const f=(await(0,y.el)((0,m.rS)(i),null,{signal:t}))[0];yield;const h=(await(0,y.el)((0,m.rS)(p),null,{signal:t}))[0];if(yield,null==f||null==h)return{candidates:[]};const x=await this._searchFeatures($(h.toJSON()));yield;const F=new T.G(x,o,this);this._executeObjectIdsQuery(F),yield,this._executeTimeQuery(F),yield,this._executeAttributesQuery(F),yield,yield*this._executeGeometryQueryForSnapping(F),yield;const _=f.toJSON(),w=l?(0,v.Cv)(_,this.spatialReference):_,S=l?Math.max(p.xmax-p.xmin,p.ymax-p.ymin)/2:n;return F.createSnappingResponse({...e,point:w,distance:S},o.returnZ,i.spatialReference)}async _getBounds(e,t,i){const n=(0,p.hZ)((0,p.vt)(),p.qv);return await this.featureStore.forEachBounds(e,e=>(0,p.RF)(n,e)),U(n,t,i,this.spatialReference,this.hasZ)}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _getAllFeaturesQueryEngineResult(e){return new T.G(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach(t=>e.push(t)))().then(()=>(0,s.zI)(e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async*_executeQuery(e,t){e=(0,a.o8)(e),e=await(0,M.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await C(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield,e={...e,...t};const i=yield*this._executeSceneFilterQuery(e);yield;const n=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(n),yield,this._executeObjectIdsQuery(n),yield,this._executeTimeQuery(n),yield,this._executeAttributesQuery(n),n}async*_executeSceneFilterQuery(e){if(null==e.sceneFilter)return null;const{outSR:t,returnGeometry:i,returnCentroid:n}=e,s=this.featureStore.featureSpatialReference,r=e.sceneFilter.geometry,a=null==s||(0,g.aI)(s,r.spatialReference)?r:(0,v.Cv)(r,s);if(!a)return null;const o=i||n,l=(0,g.fn)(t)&&!(0,g.aI)(this.spatialReference,t)&&o?async e=>this._project(e,t):e=>e;yield;const u=this.featureAdapter,c=await this._searchFeatures($(a));if(yield,"disjoint"===e.sceneFilter.spatialRelationship){if(!c.length)return null;const t=new Set;for(const e of c)t.add(u.getObjectId(e));const i=await this._getAllFeatures();yield;const n=await(0,b.xt)("esriSpatialRelDisjoint",a,this.geometryType);yield;const s=e=>!t.has(u.getObjectId(e))||n(u.getGeometry(e)),r=yield*this._runSpatialFilter(i,s);yield;const o=new T.G(r,e,this);return await l(o)}if(!c.length)return new T.G([],e,this);if(this._canExecuteSinglePass(a,e))return await l(new T.G(c,e,this));const d=await(0,b.xt)("esriSpatialRelContains",a,this.geometryType);yield;const p=yield*this._runSpatialFilter(c,e=>d(u.getGeometry(e)));return yield,await l(new T.G(p,e,this))}async*_executeGeometryQuery(e,t){if(null!=t&&0===t.items.length)return t;const{geometry:i,outSR:s,returnGeometry:r,returnCentroid:a}=e,o=t?null:this._getCacheKey(e),l=o?this._cache.get(o):null;if(l)return new T.G(l,e,this);const u=(0,g.fn)(s)&&!(0,g.aI)(this.spatialReference,s),c=r||a,d=async e=>(u&&c&&await this._project(e,s),o&&this._cache.put(o,e.items),e),p=this.featureStore.featureSpatialReference,f=!i||null==p||(0,g.aI)(p,i.spatialReference)?i:(0,v.Cv)(i,p);if(!f)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));yield;const h=this.featureAdapter;let m=await this._searchFeatures($(i));yield;const y=e.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===y){if(!m.length)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of m)i.add(h.getObjectId(e));let n;null!=t?n=t.items:(yield,n=await this._getAllFeatures(),yield);const s=await(0,b.xt)(y,f,this.geometryType);yield;const r=e=>!i.has(h.getObjectId(e))||s(h.getGeometry(e)),a=yield*this._runSpatialFilter(n,r);yield;const o=new T.G(a,e,this);return await d(o)}if(null!=t){const e=new n.vW;m=m.filter(i=>(0,n.qh)(t.items,i,t.items.length,e)>=0)}if(!m.length){const t=new T.G([],e,this);return o&&this._cache.put(o,t.items),t}if(this._canExecuteSinglePass(f,e))return await d(new T.G(m,e,this));const x=await(0,b.xt)(y,f,this.geometryType);yield;const F=yield*this._runSpatialFilter(m,e=>x(h.getGeometry(e)));return yield,await d(new T.G(F,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(e=>t.add(e));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,q.I)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=(0,F.j4)(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(e=>t.testFeature(e,this.featureAdapter))}}async*_executeGeometryQueryForSnapping(e){const{query:t}=e,{spatialRel:i}=t;if(!e?.items?.length||!t.geometry||!i)return;const n=await(0,b.xt)(i,t.geometry,this.geometryType);yield;const s=this.featureAdapter,r=yield*this._runSpatialFilter(e.items,e=>n(s.getGeometry(e)));e.items=r}*_runSpatialFilter(e,t){if(!t)return e;if(null==this._frameTask)return e.filter(e=>t(e));let i=yield;const n=new Array;for(const s of e)t(s)&&n.push(s),i.madeProgress(),i.done&&(i=yield);return n}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:n}=this.timeInfo,s=n||i,r=new Map,a=this.featureAdapter.getAttribute;for(const i of e.items){const e=a(i,t),n=a(i,s),o=r.get(e);(!o||n>a(o,s))&&r.set(e,i)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:i,returnGeometry:n,returnCentroid:s,outSR:r,resultType:a,cacheHint:o}=e;if("tile"!==a&&!o)return null;const l=n||s;return(0,g.fn)(r)&&!(0,g.aI)(this.spatialReference,r)&&l?JSON.stringify([t,i,r]):JSON.stringify([t,i])}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return(0,b.tC)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i))}async _project(e,t){if(!t||(0,g.aI)(this.spatialReference,t))return e;const i=this.featureAdapter,n=(0,d.isLoaded)()?await this._getFullExtent():void 0,r=await(0,v.lK)(e.items.map(e=>(0,_.pL)(this.geometryType,i.getGeometry(e))),this.spatialReference,t,{areaOfInterestExtent:n});return e.items=(0,s.zI)(r.map((t,n)=>i.cloneWithGeometry(e.items[n],(0,x.Ux)(t,this.hasZ,this.hasM)))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(e=>this.featureStore.forEachInBounds(e,e=>t.add(e))));const i=Array.from(t.values());return t.clear(),i}async*_executeQueryForStatistics(e,t){e=(0,a.o8)(e);try{e=await(0,M.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t,{fieldsIndex:i,geometryType:n,spatialReference:s,availableFields:a}){if(null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.A(z,"Unsupported query options",{query:e});return B(i,a,e),Promise.all([O(i,a,t,e),(0,b.c0)(e,n,s),(0,v.Nk)(s,e.outSR)]).then(()=>e)}(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield;const n=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(n),yield,this._executeObjectIdsQuery(n),yield,this._executeTimeQuery(n),yield,this._executeAttributesQuery(n),yield,n}catch(t){if(t!==M.v8)throw t;return new T.G([],e,this)}}get test(){}}function $(e){if((0,b.tC)(e)){if((0,m.ZC)(e))return[(0,f.fA)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,m.Bi)(e))return e.rings.map(e=>(0,f.fA)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[(0,h.Rg)((0,f.vt)(),e)]}function U(e,t,i,n,s){const r={xmin:e[0],ymin:e[1],xmax:e[3],ymax:e[4],spatialReference:(0,_.ag)(n)};s&&isFinite(e[2])&&isFinite(e[5])&&(r.zmin=e[2],r.zmax=e[5],r.hasZ=!0);const a=(0,v.Cv)(r,t,i);if(a.spatialReference=(0,_.ag)(i),a.xmax-a.xmin===0){const e=(0,u.GA)(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin===0){const e=(0,u.GA)(a.spatialReference);a.ymin-=e,a.ymax+=e}if(s&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin===0){const e=(0,u.GA)(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}},57231:(e,t,i)=>{i.d(t,{g:()=>n});const n=(0,i(66552).O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"})},58727:(e,t,i)=>{i.d(t,{GC:()=>y,T2:()=>g,VY:()=>p,dO:()=>F,iJ:()=>m,v8:()=>f});var n=i(49186),s=i(66552),r=i(83047),a=i(91218),o=i(90634),l=i(65864),u=i(17136),c=i(21325),d=i(31464);const p=new s.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),f=Object.freeze({}),h="frequency";async function m(e,t,i){const n=e.bin;return n.onField&&(n.onField=n.onField.trim()),n.onExpression?.value&&(n.onExpression.value=n.onExpression.value.trim()),n.splitBy&&(n.splitBy.value&&(n.splitBy.value=n.splitBy.value.trim()),n.splitBy.outAlias&&(n.splitBy.outAlias=n.splitBy.outAlias.trim())),n.stackBy&&(n.stackBy.value&&(n.stackBy.value=n.stackBy.value.trim()),n.stackBy.outAlias&&(n.stackBy.outAlias=n.stackBy.outAlias.trim())),"normalizationField"in n.parameters&&n.parameters.normalizationField&&(n.parameters.normalizationField=n.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:h}]),y(e,t,i)}async function y(e,t,i){const{outFields:n,orderByFields:s,groupByFieldsForStatistics:r,outStatistics:a}=e;if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),g(e,t,i)}async function g(e,t,s){if(!e)return null;let{where:a}=e;if(e.where=a=a?.trim(),(!a||/^1 *= *1$/.test(a)||t&&t===a)&&(e.where=null),!e.geometry)return e;let h=await async function(e){const{distance:t,units:s}=e,a=e.geometry;if(null==t||"vertexAttributes"in a)return a;const o=a.spatialReference,u=s?p.fromJSON(s):(0,r.Ij)(o),f=o&&((0,c.EA)(o)||(0,c.K8)(o))?a:await(0,d.Nk)(o,c.KK).then(()=>(0,d.Cv)(a,c.KK)),h=await i.e(9159).then(i.bind(i,49159));await h.load();const m=h.execute(f,t||1,{unit:u})??void 0;if(!m||!(0,l.Bi)(m)||0===m.rings.length)throw new n.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return m}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;h=(0,o.HA)(h),h.spatialReference=t}if(h){await(0,d.Nk)(h.spatialReference,s),h=function(e,t){const i=e.spatialReference;return x(e,t)&&(0,l.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(h,s);const t=(await(0,u.el)((0,l.rS)(h)))[0];if(null==t)throw f;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,n=i&&x(h,s)?{extendedParams:{densificationStep:8*i}}:void 0,r=t.toJSON(),a=(0,d.Cv)(r,r.spatialReference,s,n);if(!a)throw f;a.spatialReference=s,e.geometry=a}return e}function x(e,t){if(!e)return!1;const i=e.spatialReference;return((0,l.ZC)(e)||(0,l.Bi)(e)||(0,l.Rg)(e))&&!(0,c.aI)(i,t)&&!(0,a.canProjectWithoutEngine)(i,t)}function F(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},59977:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266),c=i(69540),d=i(25482),p=i(57231);let f=class extends((0,c.OU)(d.o)){constructor(e){super(e),this.value=null,this.unit=null}};(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"number",write:!0}})],f.prototype,"value",void 0),(0,n.Cg)([(0,o.e)(p.g)],f.prototype,"unit",void 0),f=(0,n.Cg)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],f);const h=f;function m(e,t,i){(0,s.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function y(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}f.from=(0,a.dp)(f);let g=class extends u.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=!1,this.start=null,this.snapToData=null,this.type="date"}};(0,n.Cg)([(0,r.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>y(t,"end")},write:{writer:m}}})],g.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({type:h,json:{name:"parameters",write:!0}})],g.prototype,"interval",void 0),(0,n.Cg)([(0,r.MZ)({type:h,json:{name:"parameters.offset",write:!0}})],g.prototype,"offset",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],g.prototype,"returnFullIntervalBin",void 0),(0,n.Cg)([(0,r.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>y(t,"start")},write:{writer:m}}})],g.prototype,"start",void 0),(0,n.Cg)([(0,r.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],g.prototype,"snapToData",void 0),(0,n.Cg)([(0,o.e)({dateBin:"date"},{readOnly:!0})],g.prototype,"type",void 0),g=(0,n.Cg)([(0,l.$)("esri.rest.support.DateBinParameters")],g),g.from=(0,a.dp)(g)},60909:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266),c=i(41366);function d(e,t,i){(0,s.sM)(i,e instanceof Date?e.getTime():e,t)}let p=class extends((0,c.K)(u.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:d}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],p.prototype,"interval",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:d}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,o.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=(0,n.Cg)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],p),p.from=(0,a.dp)(p)},62660:(e,t,i)=>{i.d(t,{tC:()=>_,c0:()=>F,xt:()=>x});var n=i(49186),s=i(94078),r=i(12176),a=i(65864),o=i(21325);function l(e,t){return c(e,t.coords[0],t.coords[1])}function u(e,t){const{coords:i,lengths:n,stride:s}=t;if(!n)return!1;for(let t=0,r=0;t<n.length;t++,r+=s)if(!c(e,i[r],i[r+1]))return!1;return!0}function c(e,t,i){if(!e)return!1;const{coords:n,lengths:s,stride:r}=e;let a=!1,o=0;for(const e of s)a=d(a,n,r,o,e,t,i),o+=e*r;return a}function d(e,t,i,n,s,r,a){let o=e,l=n;for(let e=n,u=n+s*i;e<u;e+=i){l=e+i,l===u&&(l=n);const s=t[e],c=t[e+1],d=t[l],p=t[l+1];(c<a&&p>=a||p<a&&c>=a)&&s+(a-c)/(p-c)*(d-s)<r&&(o=!o)}return o}var p=i(90708),f=i(51441),h=i(31464);const m="unsupported-query",y={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!1,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}},g={esriSpatialRelIntersects:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(7360)]).then(i.bind(i,55284)),esriSpatialRelContains:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1867)]).then(i.bind(i,29127)),esriSpatialRelCrosses:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(9700)]).then(i.bind(i,85672)),esriSpatialRelDisjoint:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1598)]).then(i.bind(i,7978)),esriSpatialRelEnvelopeIntersects:null,esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1414)]).then(i.bind(i,46178)),esriSpatialRelTouches:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(2503)]).then(i.bind(i,83547)),esriSpatialRelWithin:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(9265)]).then(i.bind(i,85445)),esriSpatialRelRelation:null};async function x(e,t,i){if((0,a.Bi)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,p.Ye)(t,!1,!1);return t=>l(e,t)}if("esriGeometryMultipoint"===i){const i=(0,p.Ye)(t,!1,!1);if("esriSpatialRelContains"===e)return e=>u(i,e)}}if((0,a.ZC)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return e=>(0,s.qz)(t,(0,f.pL)(i,e));if("esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return e=>(0,s.rL)(t,(0,f.pL)(i,e));if("esriSpatialRelIntersects"===e){const e="mesh"===(n=i)?r.xB:(0,r.xK)(n);return n=>e(t,(0,f.pL)(i,n))}}var n;"esriSpatialRelEnvelopeIntersects"===e&&(e="esriSpatialRelIntersects");const o=await function(e){const t=g[e];if(null==t)throw new Error(`Cannot load unsupported spatial operator: ${e}`);return t()}(e);return e=>o.execute(t,(0,f.pL)(i,e))}async function F(e,t,i){const{spatialRel:s,geometry:r}=e;if(r){if(null==(l=s)||!0!==y.spatialRelationship[l])throw new n.A(m,"Unsupported query spatial relationship",{query:e});if((0,o.fn)(r.spatialReference)&&(0,o.fn)(i)){if(!function(e){return null!=e&&!0===y.queryGeometry[(0,a.$B)(e)]}(r))throw new n.A(m,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===y.layerGeometry[e]}(t))throw new n.A(m,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,h.Nk)(e.geometry?.spatialReference,e.outSR)}}var l}function _(e){if((0,a.ZC)(e))return!0;if((0,a.Bi)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},62815:(e,t,i)=>{i.d(t,{N:()=>a});var n=i(83047),s=i(73941),r=i(21325);function a(e,t,i){if(null==t||null==i||i.vcsWkid||(0,r.aI)(t,i)||(0,s.xP)(t)||(0,s.xP)(i))return null;const a=(0,n.G9)(t)/(0,n.G9)(i);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,a);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},69052:(e,t,i)=>{i.d(t,{hr:()=>s,ie:()=>l,uC:()=>o});var n=i(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,i=!1){return r(this.range,this.min,this.max,e,t,i)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+a(this.range,e-t,i)}minimalMonotonic(e,t,i){return r(this.range,e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);const i=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(n)?i:n}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}function r(e,t,i,n,s=0,r=!1){return(n-=s)<t?n+=a(e,t-n):n>i&&(n-=a(e,n-i)),r&&n===i&&(n=t),n+s}function a(e,t,i=0){return Math.ceil((t-i)/e)*e+i}const o=new s(0,2*Math.PI),l=(new s(-Math.PI,Math.PI),new s(0,360))},70328:(e,t,i)=>{i.d(t,{BI:()=>F,DC:()=>d,Ej:()=>f,Ie:()=>g,Jt:()=>x,Ne:()=>h,RF:()=>c,aI:()=>v,fA:()=>a,gE:()=>l,hZ:()=>y,iT:()=>p,is:()=>_,qv:()=>w,vI:()=>m,vY:()=>o,v_:()=>S,vt:()=>r,w1:()=>u});var n=i(5443),s=(i(19419),i(4197));function r(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function a(e,t,i,n,s,a,o=r()){return o[0]=e,o[1]=t,o[2]=i,o[3]=n,o[4]=s,o[5]=a,o}function o(e,t=r()){return function(e,t,i,n=r()){return y(n,w),function(e,t,i=0,n=t.length/3){let s=e[0],r=e[1],a=e[2],o=e[3],l=e[4],u=e[5];for(let e=0;e<n;e++)s=Math.min(s,t[i+3*e]),r=Math.min(r,t[i+3*e+1]),a=Math.min(a,t[i+3*e+2]),o=Math.max(o,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=s,e[1]=r,e[2]=a,e[3]=o,e[4]=l,e[5]=u}(n,e,t,i),n}(e,0,e.length/3,t)}function l(e,t=(0,s.jh)(24)){const[i,n,r,a,o,l]=e;return t[0]=i,t[1]=n,t[2]=r,t[3]=i,t[4]=n,t[5]=l,t[6]=i,t[7]=o,t[8]=r,t[9]=i,t[10]=o,t[11]=l,t[12]=a,t[13]=n,t[14]=r,t[15]=a,t[16]=n,t[17]=l,t[18]=a,t[19]=o,t[20]=r,t[21]=a,t[22]=o,t[23]=l,t}function u(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new n.A(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function d(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function p(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function f(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function h(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function m(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function g(e){return e?y(e,w):r(w)}function x(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function F(e,t,i,n,s){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function _(e){return 6===e.length}function v(e,t,i){if(null==e||null==t)return e===t;if(!_(e)||!_(t))return!1;if(i){for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const w=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];r()},80754:(e,t,i)=>{i.d(t,{j7:()=>a,kS:()=>l,kd:()=>o,r8:()=>u});var n=i(82799),s=i(16930),r=i(65864);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=u(e);for(const e of i)for(const i of e)i[0]+=t;return e}function u(e){return(0,r.Bi)(e)?e.rings:e.paths}},86420:(e,t,i)=>{i.d(t,{I:()=>r,W:()=>s});var n=i(21818);async function s(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:s,endTimeField:r}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(s&&r)await t.forEach(e=>{const t=i.getAttribute((0,n.zI)(e),s),l=i.getAttribute((0,n.zI)(e),r);null==t||isNaN(t)||(a=Math.min(a,t)),null==l||isNaN(l)||(o=Math.max(o,l))});else{const e=s||r;await t.forEach(t=>{const s=i.getAttribute((0,n.zI)(t),e);null==s||isNaN(s)||(a=Math.min(a,s),o=Math.max(o,s))})}return{start:a,end:o}}function r(e,t,i){if(!t||!e)return null;const{startTimeField:n,endTimeField:s}=e;if(!n&&!s)return null;const{start:r,end:a}=t;if(null===r&&null===a)return null;if(void 0===r&&void 0===a)return()=>!1;const o=i.getAttributeAsTimestamp?.bind(i)??i.getAttribute.bind(i);return n&&s?function(e,t,i,n,s){return null!=n&&null!=s?r=>{const a=e(r,t),o=e(r,i);return(null==a||a<=s)&&(null==o||o>=n)}:null!=n?t=>{const s=e(t,i);return null==s||s>=n}:null!=s?i=>{const n=e(i,t);return null==n||n<=s}:void 0}(o,n,s,r,a):function(e,t,i,n){return null!=i&&null!=n&&i===n?n=>e(n,t)===i:null!=i&&null!=n?s=>{const r=e(s,t);return null!=r&&r>=i&&r<=n}:null!=i?n=>{const s=e(n,t);return null!=s&&s>=i}:null!=n?i=>{const s=e(i,t);return null!=s&&s<=n}:void 0}(o,n||s,r,a)}},91218:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>k,initializeProjection:()=>$,isEqualBaseGCS:()=>L,isLoaded:()=>z,isLoadedOrLoad:()=>C,isLoadedOrLoadFor:()=>B,load:()=>O,project:()=>q,projectExtent:()=>ie,projectMany:()=>G,projectMultipoint:()=>W,projectOrLoad:()=>P,projectOrLoadMany:()=>E,projectPoint:()=>H,projectPolygon:()=>ee,projectPolyline:()=>Y,projectWithZConversion:()=>Q,projectWithoutEngine:()=>U,requiresLoad:()=>N,test:()=>V,tryProjectWithZConversion:()=>Z,unload:()=>D});var n=i(49186),s=i(74887),r=i(62788),a=i(95488),o=i(51850),l=i(21276),u=i(73941),c=i(5443),d=i(91075),p=i(48526),f=i(86738),h=i(39829),m=i(82799),y=i(16930),g=i(159),x=i(9762),F=i(37539);function _(e,t,i,n,s,r){return v[0]=e,v[1]=t,v[2]=i,(0,x.projectBuffer)(v,n,0,s,r,0)}const v=(0,o.vt)();var w=i(21325),S=i(62815);let I=null,R=null,T=null,M=null,b={};const A=new a.I;function z(){return!!(R?.isLoaded()&&T?.isLoaded()&&M?.isLoaded())}function C(){return!!z()||((0,r.gc)(A),O(),!1)}function B(e,t){return!e||!t||k(e,t)||C()}function N(e,t){return!k(e,t)&&!z()}async function O(e){null==I&&(I=Promise.all([i.e(3276).then(i.bind(i,83276)).then(e=>(R=e,R.load())),i.e(8377).then(i.bind(i,8377)).then(e=>(T=e,T.load())),i.e(2158).then(i.bind(i,12158)).then(e=>(M=e,M.load()))])),await I,(0,s.Te)(e),A.notify()}function q(e,t,i){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),G(e,e[0].spatialReference,t,i)):((0,l.f)(e),G([e],e.spatialReference,t,i)[0])}function G(e,t,i,n){if(null==t||null==i)return e;if(k(t,i,n))return e.map(e=>U(e,t,i));if(null==n?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>U(e,t,y.A.WGS84)).map(e=>Z(e,i));if(null==n?.geographicTransformation&&(0,u.jA)(i))return e.map(e=>Z(e,y.A.WGS84)).map(e=>U(e,y.A.WGS84,i));if(!z())throw new j;if(!n?.geographicTransformation)if(n?.extendedParams)n={...n,geographicTransformation:M.getTransformation(t,i,n.areaOfInterestExtent)||new g.A};else if(!n?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,i);let s=b[e];s||(s=M.getTransformation(t,i)||new g.A,b[e]=s),n={geographicTransformation:s}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof d.A?R.executeMany(e,i,n):T.executeMany(e,i,n)}function P(e,t){const i=E([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function E(e,t){if(!z())for(const i of e)if(null!=i&&!(0,w.aI)(i.spatialReference,t)&&(0,w.fn)(i.spatialReference)&&(0,w.fn)(t)&&!k(i.spatialReference,t))return(0,r.gc)(A),{pending:O(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,w.aI)(e.spatialReference,t)?e:(0,w.fn)(e.spatialReference)&&(0,w.fn)(t)?Z(e,t):null)}}class j extends n.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function D(){I=null,R=null,T=null,M=null,b={}}const V={get loadPromise(){return I}};function Z(e,t){try{const i=q(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const n=(0,S.N)(i.type,e.spatialReference,t);return null!=n&&n(i),i}catch(e){if(!(e instanceof j))throw e;return null}}async function Q(e,t,i){const n=e.spatialReference;return null!=n&&null!=t&&await $(n,t,null,i),Z(e,t)}function k(e,t,i){return!(i?.areaOfInterestExtent||i?.extendedParams||i?.geographicTransformation)&&(!!(0,w.aI)(e,t)||(0,w.fn)(e)&&(0,w.fn)(t)&&!!(0,F.jd)(e,t))}function L(e,t){if((0,w.aI)(e,t))return!0;if(!(0,w.fn)(e)||!(0,w.fn)(t))return!1;const i=(0,w.oT)(e)||(0,w.K8)(e)||(0,w.x1)(e),n=(0,w.oT)(t)||(0,w.K8)(t)||(0,w.x1)(t);return i&&n}async function $(e,t,i,n){if(z())return(0,s.NO)(n);if(Array.isArray(e)){for(const{source:t,dest:i,options:s}of e)if(t&&i&&!k(t,i,s))return O(n)}else if(e&&t&&!k(e,t,i))return O(n);return(0,s.NO)(n)}function U(e,t,i){return e?"x"in e?J(e,t,new f.A,i,0):"xmin"in e?ne(e,t,new c.A,i,0):"rings"in e?te(e,t,new h.A,i,0):"paths"in e?X(e,t,new m.A,i,0):"points"in e?K(e,t,new p.A,i,0):null:null}function H(e,t,i=t.spatialReference,n=0){return null!=i&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,i,n)}function J(e,t,i,n,s){re[0]=e.x,re[1]=e.y;const r=e.z;return re[2]=void 0!==r?r:s,(0,x.projectBuffer)(re,t,0,re,n,0)?(i.x=re[0],i.y=re[1],i.spatialReference=n,void 0!==r||(0,u.xP)(n)?(i.z=re[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function W(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=K(e,e.spatialReference,t,i,n)}function K(e,t,i,n,s){const{points:r,hasZ:a,hasM:o}=e,l=[],c=r.length,d=[];for(const e of r)d.push(e[0],e[1],a?e[2]:s);if(!(0,x.projectBuffer)(d,t,0,d,n,0,c))return null;const p=a||(0,u.xP)(n);for(let e=0;e<c;++e){const t=3*e,i=d[t],n=d[t+1];p&&o?l.push([i,n,d[t+2],r[e][3]]):p?l.push([i,n,d[t+2]]):o?l.push([i,n,r[e][2]]):l.push([i,n])}return i.points=l,i.spatialReference=n,i.hasZ=a,i.hasM=o,i}function Y(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=X(e,e.spatialReference,t,i,n)}function X(e,t,i,n,s){const{paths:r,hasZ:a,hasM:o}=e,l=[];if(!se(r,a??!1,o??!1,t,l,n,s))return null;const c=a||(0,u.xP)(n);return i.paths=l,i.spatialReference=n,i.hasZ=c,i.hasM=o,i}function ee(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=te(e,e.spatialReference,t,i,n)}function te(e,t,i,n,s){const{rings:r,hasZ:a,hasM:o}=e,l=[];if(!se(r,a??!1,o??!1,t,l,n,s))return null;const c=a||(0,u.xP)(n);return i.rings=l,i.spatialReference=n,i.hasZ=c,i.hasM=o,i}function ie(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=ne(e,e.spatialReference,t,i,n)}function ne(e,t,i,n,s){const{xmin:r,ymin:a,xmax:o,ymax:l,hasZ:c,hasM:d}=e;if(!_(r,a,c?e.zmin:s,t,re,n))return null;const p=c||(0,u.xP)(n);return i.xmin=re[0],i.ymin=re[1],p&&(i.zmin=re[2]),_(o,l,c?e.zmax:s,t,re,n)?(i.xmax=re[0],i.ymax=re[1],p&&(i.zmax=re[2]),d&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=n,i):null}function se(e,t,i,n,s,r,a=0){const o=new Array;for(const i of e)for(const e of i)o.push(e[0],e[1],t?e[2]:a);if(!(0,x.projectBuffer)(o,n,0,o,r,0))return!1;let l=0;s.length=0;const c=t||(0,u.xP)(r);for(const t of e){const e=new Array;for(const n of t)c&&i?e.push([o[l++],o[l++],o[l++],n[3]]):c?e.push([o[l++],o[l++],o[l++]]):i?(e.push([o[l++],o[l++],n[2]]),l++):(e.push([o[l++],o[l++]]),l++);s.push(e)}return!0}const re=(0,o.vt)()},92300:(e,t,i)=>{i.d(t,{V:()=>r,X:()=>s});var n=i(65864);function s(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function r(e,t,i){const s=(0,n.xD)(t);return e.map(e=>{const t=s.fromJSON(e);return t.spatialReference=i,t})}},95466:(e,t,i)=>{i.d(t,{A:()=>f});var n=i(49186),s=i(53966),r=i(91869),a=i(3330),o=i(12195),l=i(30524),u=i(98623),c=i(56400),d=i(28097);const p=new Map;class f{static fromJSON(e){return new f(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new f(e.fields??[],g(e))}static fromLayerJSON(e){return new f(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const i=[];for(const e of this.fields){const t=e?.name,n=m(t);if(t&&n){const s=h(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(n,e),i.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.te)(e)||(0,l.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.te)(e)||(0,l.Xz)(e)||e.nullable||void 0!==(0,l.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(h(e))??this._normalizedFieldsMap.get(m(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new n.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):y.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?a.GB.instance:t===u.n$?d.mQ.utcInstance:(0,r.tE)(p,t,()=>d.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,o.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function h(e){return e.trim().toLowerCase()}function m(e){return(0,l.rS)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const i=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:s}=e,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",a=(n?"endField"in n?n.endField:n.endTimeField:"")??"",o=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,l=s?function(e){return"timeZone"in e}(s)?s.timeZone??o:s.dateFieldsTimeReference?(0,c.ZS)(s.dateFieldsTimeReference):o??u.n$:null,d=n?function(e){return"timeZone"in e}(n)?n.timeZone??o:n.timeReference?(0,c.ZS)(n.timeReference):o:null,p=new Map([[h(s?.creationDateField??""),l],[h(s?.editDateField??""),l],[h(r),d],[h(a),d]]);for(const{name:n,type:s}of e.fields)if(y.has(s))t.set(n,u.L5);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(n,null);else if(i)t.set(n,u.L5);else{const e=p.get(h(n??""))??o;t.set(n,e)}return t}},99157:(e,t,i)=>{i.d(t,{A:()=>l});var n,s=i(31635),r=i(69622),a=i(10107),o=(i(44208),i(53966),i(87811),i(64108));let l=n=class extends r.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new n({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,a.MZ)()],l.prototype,"isInverse",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"wkt",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"wkid",void 0),l=n=(0,s.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformationStep")],l)},99352:(e,t,i)=>{i.d(t,{F:()=>n,P:()=>s});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},s={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}}}]);
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[4649,7136],{159:(e,t,i)=>{i.d(t,{A:()=>u});var n,s=i(31635),r=i(69622),a=i(10107),o=(i(44208),i(53966),i(87811),i(64108)),l=i(99157);let u=n=class extends r.A{constructor(e){super(e),this.steps=[]}getInverse(){const e=new n;for(let t=this.steps.length-1;t>=0;t--){const i=this.steps[t];e.steps.push(i.getInverse())}return e}};(0,s.Cg)([(0,a.MZ)({type:[l.A],nonNullable:!0})],u.prototype,"steps",void 0),u=n=(0,s.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformation")],u)},4197:(e,t,i)=>{i.d(t,{Vj:()=>u,cj:()=>l,jh:()=>r,l5:()=>o,xm:()=>a});var n=i(34275),s=i(9093);function r(e){return e<=n.y9?new Array(e).fill(0):new Float64Array(e)}function a(e){return((0,n.iu)(e)?e.byteLength/8:e.length)<=n.y9?Array.from(e):new Float64Array(e)}function o(e,t,i){return Array.isArray(e)?e.slice(t,t+i):e.subarray(t,t+i)}function l(e){return[...e]}function u(e){const t=(0,s.vt)();for(let i=0;i<16;++i)t[i]=e[i];return t}},5834:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266),c=i(41366);function d(e,t,i){(0,s.sM)(i,e instanceof Date?e.getTime():e,t)}let p=class extends((0,c.K)(u.A)){constructor(e){super(e),this.numBins=null,this.end=null,this.start=null,this.type="auto-interval"}};(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.numberOfBins",write:!0}})],p.prototype,"numBins",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:d}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:d}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,o.e)({autoIntervalBin:"auto-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=(0,n.Cg)([(0,l.$)("esri.rest.support.AutoIntervalBinParameters")],p),p.from=(0,a.dp)(p)},8384:(e,t,i)=>{i.d(t,{G:()=>M});var n=i(4718),s=i(12359),r=i(90634),a=i(62577),o=i(21325),l=i(29441),u=i(51441),c=i(30524),d=i(87445),p=i(1873),f=i(43668);class h{constructor(e,t,i){this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=e.returnDistinctValues??!1,this.fieldsIndex=i,this.featureAdapter=t;const n=e.outFields;if(n&&!n.includes("*")){this.outFields=n;let e=0;for(const t of n){const n=(0,l.Wq)(t),s=this.fieldsIndex.get(n),r=s?null:(0,l.j4)(n,i),a=s?s.name:(0,l.SY)(t)||"FIELD_EXP_"+e++;this._fieldDataCache.set(t,{alias:a,clause:r})}}}countDistinctValues(e){return this.returnDistinctValues?(e.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):e.length}getAttributes(e){const t=this._processAttributesForOutFields(e);return this._processAttributesForDistinctValues(t)}getFieldValue(e,t,i){const n=i?i.name:t;let s=null;return this._fieldDataCache.has(n)?s=this._fieldDataCache.get(n)?.clause:i||(s=(0,l.j4)(t,this.fieldsIndex),this._fieldDataCache.set(n,{alias:n,clause:s})),i?this.featureAdapter.getAttribute(e,n):s?.calculateValue(e,this.featureAdapter)}getDataValues(e,t,i=!0){const n=t.normalizationType,s=t.normalizationTotal,r=this.fieldsIndex.get(t.field),a=(0,c.zD)(r)||(0,c.Ah)(r),o=(0,c.OH)(r);return e.map(e=>{let r=t.field&&this.getFieldValue(e,t.field,this.fieldsIndex.get(t.field));if(t.field2?(r=`${(0,p.gJ)(r)}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field2,this.fieldsIndex.get(t.field2)))}`,t.field3&&(r=`${r}${t.fieldDelimiter}${(0,p.gJ)(this.getFieldValue(e,t.field3,this.fieldsIndex.get(t.field3)))}`)):"string"==typeof r&&i&&(a?r=r?new Date(r).getTime():null:o&&(r=r?(0,d.rb)(r):null)),n&&Number.isFinite(r)){const i="field"===n&&t.normalizationField?this.getFieldValue(e,t.normalizationField,this.fieldsIndex.get(t.normalizationField)):null;r=(0,p.zS)(r,n,i,s)}return r})}async getExpressionValues(e,t,i,n,s){const{arcadeUtils:r}=await(0,f.l)(),a=r.hasGeometryOperations(t);a&&await r.enableGeometryOperations();const o=r.createFunction(t),l=r.getViewInfo(i),c={fields:this.fieldsIndex.fields};return e.map(e=>{const t={attributes:this.featureAdapter.getAttributes(e),layer:c,geometry:a?{...(0,u.pL)(n.geometryType,this.featureAdapter.getGeometry(e)),spatialReference:i?.spatialReference}:null},d=r.createExecContext(t,l,s);return r.executeFunction(o,d)})}validateItem(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testFeature(e,this.featureAdapter)??!1}validateItems(e,t){return this._fieldDataCache.has(t)||this._fieldDataCache.set(t,{alias:t,clause:(0,l.j4)(t,this.fieldsIndex)}),this._fieldDataCache.get(t)?.clause?.testSet(e,this.featureAdapter)??!1}_processAttributesForOutFields(e){const t=this.outFields;if(!t?.length)return this.featureAdapter.getAttributes(e);const i={};for(const n of t){const{alias:t,clause:s}=this._fieldDataCache.get(n);i[t]=s?s.calculateValue(e,this.featureAdapter):this.featureAdapter.getAttribute(e,t)}return i}_processAttributesForDistinctValues(e){if(null==e||!this.returnDistinctValues)return e;const t=this.outFields,i=[];if(t)for(const n of t){const{alias:t}=this._fieldDataCache.get(n);i.push(e[t])}else for(const t in e)i.push(e[t]);const n=`${(t||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(n)||0;return this._returnDistinctMap.set(n,++s),s>1?null:e}}var m=i(31464),y=i(58727);function g(e,t,i){return{objectId:e,target:t,distance:i,type:"vertex"}}function x(e,t,i,n,s,r=!1){return{objectId:e,target:t,distance:i,type:"edge",start:n,end:s,draped:r}}var F=i(5834),_=i(59977),v=i(57231),w=i(11440),S=i(60909),I=i(98623),R=i(28097);const T="bin";class M{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new h(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:n}=this.query,s=t?.length;if(!s)return 1;const r=new Map,a=new Map,o=new Set;for(const s of n){const{statisticType:n}=s,l="exceedslimit"!==n?s.onStatisticField:void 0;if(!a.has(l)){const i=[];for(const n of t){const t=this._getAttributeValues(e,n,this.items,r);i.push(t)}a.set(l,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=a.get(l);for(const t in u){const{data:n,items:s}=u[t],r=n.join(",");i&&!e.validateItems(s,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(e=this.query.outStatistics?this.query.outStatistics.some(e=>"exceedslimit"===e.statisticType)?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items):this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry){const t=this.query.geometry;(0,o.fn)(this.query.outSR)&&!(0,o.aI)(t.spatialReference,this.query.outSR)?e.queryGeometry=(0,u.ag)({spatialReference:this.query.outSR,...(0,m.Cv)(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=(0,u.ag)({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const n=this.featureAdapter,s=A(this.hasZ,this.hasM),{point:r,mode:a}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,d="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,p=this._getPointCreator(a,t,this.spatialReference,i),f=new z(null,0),h=new z(null,0),m={x:0,y:0,z:0};for(const t of this.items){const i=n.getGeometry(t);if(null==i)continue;const{coords:a}=i,y=i.isPoint?C:i.lengths;if(f.coords=a,h.coords=a,e.returnEdge){let e=0;for(let i=0;i<y.length;i++){const a=y[i],d=e;for(let i=0;i<a;i++,e+=s){if(!c&&i===a-1)continue;const y=f;y.coordsIndex=e;const g=h;g.coordsIndex=i===a-1?d:e+s;const F=m;if(!b(m,r,y,g))continue;const _=(r.x-F.x)/o,v=(r.y-F.y)/l,w=_*_+v*v;w<=1&&u.candidates.push(x(n.getObjectId(t),p(F),Math.sqrt(w),p(y),p(g)))}}}if("all"===e.vertexMode){let e=0;for(let i=0;i<y.length;i++){const a=y[i],d=e,m=h;m.coordsIndex=d;for(let i=0;i<a;i++,e+=s){const s=f;if(s.coordsIndex=e,c&&i===a-1&&s.x===m.x&&s.y===m.y)continue;const d=(r.x-s.x)/o,h=(r.y-s.y)/l,y=d*d+h*h;y<=1&&u.candidates.push(g(n.getObjectId(t),p(s),Math.sqrt(y)))}}}else if(d&&"ends"===e.vertexMode){let e=0;const i=[];for(let t=0;t<y.length;t++){i.push(e);const n=y[t];e+=n*s,!c&&n>1&&i.push(e-s)}for(const e of i){const i=f;i.coordsIndex=e;const s=(r.x-i.x)/o,a=(r.y-i.y)/l,c=s*s+a*a;c<=1&&u.candidates.push(g(n.getObjectId(t),p(i),Math.sqrt(c)))}}}return u.candidates.sort((e,t)=>e.distance-t.distance),u}_getPointCreator(e,t,i,n){const s=null==n||(0,o.aI)(i,n)?e=>e:e=>(0,m.Cv)(e,i,n),{hasZ:r}=this;return"3d"===e?r&&t?({x:e,y:t,z:i})=>s({x:e,y:t,z:i}):({x:e,y:t})=>s({x:e,y:t,z:0}):({x:e,y:t})=>s({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,minValue:a,maxValue:o,scale:l,timeZone:u,outStatisticTypes:d}=e,f=this.fieldsIndex.get(t),h=(0,c.vE)(f)||(0,c.zD)(f)||(0,c.Ah)(f),m=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:l,timeZone:u},this.items),y=(0,p.Vb)({normalizationType:s,normalizationField:n,minValue:a,maxValue:o}),g={value:.5,fieldType:f?.type},x=(0,c.yM)(f)?(0,p.z9)({values:m,supportsNullCount:y,percentileParams:g,outStatisticTypes:d}):(0,p.G_)({values:m,minValue:a,maxValue:o,useSampleStdDev:!s,supportsNullCount:y,percentileParams:g,outStatisticTypes:d});return(0,p.oZ)(x,d,h)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:n,returnAllCodedValues:s,scale:r,timeZone:a}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:a},this.items,!1),l=(0,p.b3)(o);return(0,p.lv)(l,n,s,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:d,timeZone:f}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:d,timeZone:f},this.items),m=(0,p.Rw)(h,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return(0,p.jM)(m,a)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:d,timeZone:f}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:n,normalizationType:s,normalizationTotal:r,scale:d,timeZone:f},this.items);return(0,p.$y)(h,{field:t,normalizationField:n,normalizationType:s,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const n of t.slice().reverse()){const t=n.split(" "),s=t[0],r=this.fieldsIndex.get(s),a=!!t[1]&&"desc"===t[1].toLowerCase(),o=(0,p.FM)(r?.type,a);e.sort((e,t)=>{const n=i(e,s,r),a=i(t,s,r);return o(n,a)})}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:n,hasZ:s,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:d,resultRecordCount:p,resultOffset:f,returnZ:h,returnM:m}=e,y=null!=p&&t.length>(f||0)+p,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map(e=>this.fieldsIndex.get(e)));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:n&&m,hasZ:s&&h,objectIdFieldName:r,spatialReference:(0,u.ag)(c||o),transform:d&&(0,a.VV)(d)||null}}_createFeatures(e,t){const i=new h(e,this.featureAdapter,this.fieldsIndex),{hasM:n,hasZ:s}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:d,resultOffset:p,resultRecordCount:f,returnZ:m=!1,returnM:y=!1}=e,g=s&&m,x=n&&y;let F=[],_=0;const v=[...t];if(this._sortFeatures(v,r,(e,t,n)=>i.getFieldValue(e,t,n)),this.geometryType&&(l||c)){const e=(0,a.VV)(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const n of v){const s=this.featureAdapter.getGeometry(n),r=this._addFeatureJSONMetadata(n,{attributes:i.getAttributes(n),geometry:(0,u.pL)(this.geometryType,s,d,e,g,x)});t&&s&&!r.geometry&&(r.centroid=(0,u.LQ)(this,this.featureAdapter.getCentroid(n,this),e)),F[_++]=r}else if(!l&&c)for(const t of v)F[_++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,u.LQ)(this,this.featureAdapter.getCentroid(t,this),e)});else for(const t of v)F[_++]=this._addFeatureJSONMetadata(t,{attributes:i.getAttributes(t),centroid:(0,u.LQ)(this,this.featureAdapter.getCentroid(t,this),e),geometry:(0,u.pL)(this.geometryType,this.featureAdapter.getGeometry(t),d,e,g,x)})}else for(const e of v){const t=i.getAttributes(e);t&&(F[_++]=this._addFeatureJSONMetadata(e,{attributes:t}))}const w=p||0;if(null!=f){const e=w+f;F=F.slice(w,Math.min(F.length,e))}return F}_addFeatureJSONMetadata(e,t){const i=this.featureAdapter.getMetadata?.(e);return void 0!==i&&(t.metadata=i),t}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,n=Number.POSITIVE_INFINITY;for(const e of this.query.outStatistics??[])if("exceedslimit"===e.statisticType){t=null!=e.maxPointCount?e.maxPointCount:Number.POSITIVE_INFINITY,i=null!=e.maxRecordCount?e.maxRecordCount:Number.POSITIVE_INFINITY,n=null!=e.maxVertexCount?e.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=A(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce((e,t)=>{const n=i.getGeometry(t);return e+(null!=n&&n.coords.length||0)},0)/t>n}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const n=[],s=new Map,r=new Map,a=new Map,o=new Map,l=new h(e,this.featureAdapter,this.fieldsIndex),u=e.outStatistics,{groupByFieldsForStatistics:d,having:p,orderByFields:f,resultRecordCount:m}=e,y=d?.length,g=!!y,x=g?d[0]:null,F=g&&!this.fieldsIndex.get(x);for(const e of u??[]){const{outStatisticFieldName:u,statisticType:f}=e,h=e,m="exceedslimit"!==f?e.onStatisticField:void 0,_="percentile_disc"===f||"percentile_cont"===f,v="EnvelopeAggregate"===f||"CentroidAggregate"===f||"ConvexHullAggregate"===f,w=g&&1===y&&(m===x||F)&&"count"===f;if(g){if(!a.has(m)){const e=[];for(const i of d){const n=this._getAttributeValues(l,i,t,s);e.push(n)}a.set(m,this._calculateUniqueValues(e,t,!v&&l.returnDistinctValues))}const e=a.get(m);if(!e)continue;const i=Object.keys(e);for(const n of i){const{count:i,data:r,items:a,itemPositions:c}=e[n],f=r.join(",");if(!p||l.validateItems(a,p)){const e=o.get(f)||{attributes:{}};if(v){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:t,outStatisticFieldName:i}=await this._getAggregateGeometry(h,a);e.aggregateGeometries[i]=t}else{let n=null;if(w)n=i;else{const e=this._getAttributeValues(l,m,t,s),i=c.map(t=>e[t]);n=_&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,l.returnDistinctValues)}e.attributes[u]=n}let n=0;d.forEach((t,i)=>e.attributes[this.fieldsIndex.get(t)?t:"EXPR_"+ ++n]=r[i]),o.set(f,e)}}}else if(v){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:n}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[n]=e}else{const e=this._getAttributeValues(l,m,t,s);i.attributes[u]=_&&"statisticParameters"in h?this._getPercentileValue(h,e):this._getStatisticValue(h,e,r,l.returnDistinctValues)}const S="min"!==f&&"max"!==f||!(0,c.yM)(this.fieldsIndex.get(m))&&!this._isAnyDateField(m)?null:this.fieldsIndex.get(m)?.type;n.push({name:u,alias:u,type:S||"esriFieldTypeDouble"})}const _=g?Array.from(o.values()):[i];return this._sortFeatures(_,f,(e,t)=>e.attributes[t]),m&&(_.length=Math.min(m,_.length)),{fields:n,features:_}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return(0,c.vE)(t)||(0,c.zD)(t)||(0,c.Ah)(t)||(0,c.OH)(t)}async _getAggregateGeometry(e,t){const{convexHull:n,union:a}=await Promise.all([i.e(3209),i.e(7559)]).then(i.bind(i,47559)),{statisticType:o,outStatisticFieldName:l}=e,{featureAdapter:c,spatialReference:d,geometryType:p}=this,f=t.map(e=>(0,u.pL)(p,c.getGeometry(e))),h=n(d,f,!0)[0],m={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===o){const e=h?(0,r.v)(h):(0,r.HA)(a(d,f));m.aggregateGeometries={...e,spatialReference:d},m.outStatisticFieldName=l||"extent"}else if("CentroidAggregate"===o){const e=h?(0,s.l8)(h):(0,s.Z4)((0,r.HA)(a(d,f)));m.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},m.outStatisticFieldName=l||"centroid"}else"ConvexHullAggregate"===o&&(m.aggregateGeometries=h,m.outStatisticFieldName=l||"convexHull");return m}_getStatisticValue(e,t,i,n){const{onStatisticField:s,statisticType:r}=e;let a=null;return a=i?.has(s)?i.get(s):(0,c.yM)(this.fieldsIndex.get(s))||this._isAnyDateField(s)?(0,p.z9)({values:t,returnDistinct:n}):(0,p.G_)({values:n?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,a),a["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:n,statisticType:s}=e,{value:r,orderBy:a}=n,o=this.fieldsIndex.get(i);return(0,p.qg)(t,{value:r,orderBy:a,fieldType:o?.type,isDiscrete:"percentile_disc"===s})}_getAttributeValues(e,t,i,n){if(n.has(t))return n.get(t);const s=this.fieldsIndex.get(t),r=i.map(i=>e.getFieldValue(i,t,s));return n.set(t,r),r}_calculateUniqueValues(e,t,i){const n={},s=t.length;for(let r=0;r<s;r++){const s=t[r],a=[];for(const t of e)a.push(t[r]);const o=a.join(",");null==n[o]?n[o]={count:1,data:a,items:[s],itemPositions:[r]}:(i||n[o].count++,n[o].items.push(s),n[o].itemPositions.push(r))}return n}async _getDataValues(e,t,i=!0){const s=new h(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:a,timeZone:o}=e;return r?s.getExpressionValues(t,r,{viewingMode:"map",scale:a,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):s.getDataValues(t,(0,n.o8)(e),i)}_calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const n=t.intervals,s=t.min??0,r=t.max??0,a=n.map(([e,t])=>({minValue:e,maxValue:t,count:0,items:[]}));for(let t=0;t<e.length;t++){const o=e[t],l=i[t];if(null!=o&&o>=s&&o<=r){const e=(0,p.Ak)(n,o);e>-1&&(a[e].count++,a[e].items.push(l))}}return a}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:n,valueType:s}=t,r=[],a=[{name:n??i,alias:n??i,type:s??"esriFieldTypeString"},{name:T,alias:T,type:"esriFieldTypeInteger"}],o=new h(e,this.featureAdapter,this.fieldsIndex),l=new Map,u=[...this.items];this._sortFeatures(u,[i],(e,t,i)=>o.getFieldValue(e,t,i));const c=this._getAttributeValues(o,i,u,l),d=this._calculateUniqueValues([c],u,o.returnDistinctValues);for(const t in d){const{items:s}=d[t],o=await this._createBinsResponse(e,s);if(r.push(...o.features.map(e=>({...e,attributes:{...e.attributes,[n??i]:t}}))),o.fields)for(const e of o.fields)a.some(t=>t.name===e.name)||a.push(e)}return{fields:a,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(F.A.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.A.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(w.A.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(S.A.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:n,normalizationField:s,numBins:r,normalizationType:a,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),d=(0,p.sU)(c,{field:n,normalizationField:s,normalizationType:a,normalizationTotal:o,numBins:r,minValue:(0,y.dO)(l,!1),maxValue:(0,y.dO)(u,!1)}),f=this._calculateHistogramBins(c,d,i);return this._createFeaturesFromHistogramBins(f,t)}async _createDateBinsResponse(e,t,i){const{field:n,interval:s,start:r,end:a,snapToData:o,returnFullIntervalBin:l}=e,u=s.unit,d=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),p=(0,c.OH)(this.fieldsIndex.get(n)),f=v.g.toJSON(u),h=d.filter(Boolean).sort((e,t)=>e-t),m=null!=r?(0,y.dO)(r,p):h[0],g=null!=a?(0,y.dO)(a,p):h[h.length-1],x=[];if(null!=m&&null!=g){const e={zone:t.outTimeReference?.ianaTimeZone??I.n$},i=R.c9.fromMillis(m,e),n=R.c9.fromMillis(g,e);if("last"===o){let e=n;for(;e>i;){const t=e.minus({[f]:s.value});if(t<i){x.unshift([l?t.toMillis():i.toMillis(),e.toMillis()]);break}x.unshift([t.toMillis(),e.toMillis()]),e=t}}else{let e="first"===o?i:i.startOf(f);for(;e<=n;){const t=e.plus({[f]:s.value});if(t>n){x.push([e.toMillis(),l?t.toMillis():n.toMillis()]);break}x.push([e.toMillis(),t.toMillis()]),e=t}}}const F=this._calculateHistogramBins(d,{intervals:x,min:m,max:g},i);return this._createFeaturesFromHistogramBins(F,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:n}=e,s=await this._getDataValues({field:n,timeZone:t.outTimeReference?.ianaTimeZone},i),r=(0,c.OH)(this.fieldsIndex.get(n)),a=e.boundaries.map(e=>(0,y.dO)(e,r)).sort((e,t)=>e-t),o=[];for(let e=0;e<a.length-1;e++)o.push([a[e],a[e+1]]);const l={intervals:o,min:a.at(0),max:a.at(-1)},u=this._calculateHistogramBins(s,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:n,interval:s,start:r,end:a}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=(0,c.OH)(this.fieldsIndex.get(n)),u=(0,p.sU)(o,{field:n,classificationMethod:"defined-interval",definedInterval:s,minValue:(0,y.dO)(r,l),maxValue:(0,y.dO)(a,l)},!0),d=this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(d,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:n}=t,s=n||"lowerBoundary",r=i||"upperBoundary",a=[],o=[{name:s,alias:s,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:T,alias:T,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const d="dateBin"===t.bin.type,p=t.outTimeReference?.ianaTimeZone;for(const i of e){const{minValue:e,maxValue:n,items:f}=i,h={attributes:{}};let m;if(h.attributes[s]=d&&p&&null!=e?R.c9.fromMillis(e,{zone:p}).toISO():e,h.attributes[r]=d&&p&&null!=n?R.c9.fromMillis(n,{zone:p}).toISO():n,l?(m=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},f),h.attributes[T]=++c,"flat"===t.bin.jsonStyle?a.push(...m.features.map(({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...h.attributes}:{...t,...h.attributes}}))):(h.stackedAttributes=m.features.map(({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t),a.push(h))):(t.bin?.splitBy&&(h.attributes[T]=++c),m=await this._createStatisticsQueryResponse(t,f,h),a.push(h)),m.fields)for(const e of m.fields)o.some(t=>t.name===e.name)||o.push(e)}return"desc"===t.binOrder&&a.reverse(),{fields:o,features:a}}}function b(e,t,i,n){const s=n.x-i.x,r=n.y-i.y,a=t.x-i.x,o=t.y-i.y,l=s*s+r*r;if(0===l)return!1;const u=a*s+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+s*c,e.y=i.y+r*c,!0}function A(e,t){return e?t?4:3:t?3:2}class z{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const C=[1]},9093:(e,t,i)=>{function n(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function s(e){return[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8],e[9],e[10],e[11],e[12],e[13],e[14],e[15]]}i.d(t,{o8:()=>s,vt:()=>n,zK:()=>r});const r=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];Object.freeze(Object.defineProperty({__proto__:null,IDENTITY:r,clone:s,create:n,fromValues:function(e,t,i,n,s,r,a,o,l,u,c,d,p,f,h,m){return[e,t,i,n,s,r,a,o,l,u,c,d,p,f,h,m]}},Symbol.toStringTag,{value:"Module"}))},9762:(e,t,i)=>{i.r(t),i.d(t,{projectBuffer:()=>s});var n=i(37539);function s(e,t,i,s,r,a,o=Math.floor(e.length/3)){const l=(0,n.jd)(t,r);if(null==l)return!1;if(l===n.pO){if(e===s&&i===a)return!0;const t=i+3*o;for(let n=i,r=a;n<t;n++,r++)s[r]=e[n];return!0}const u=i+3*o;for(let t=i,n=a;t<u;t+=3,n+=3)l(e,t,s,n);return!0}},11006:(e,t,i)=>{function n(e,t,i,n,r){s(e,t,i||0,n||e.length-1,r||a)}function s(e,t,i,n,a){for(;n>i;){if(n-i>600){var o=n-i+1,l=t-i+1,u=Math.log(o),c=.5*Math.exp(2*u/3),d=.5*Math.sqrt(u*c*(o-c)/o)*(l-o/2<0?-1:1);s(e,t,Math.max(i,Math.floor(t-l*c/o+d)),Math.min(n,Math.floor(t+(o-l)*c/o+d)),a)}var p=e[t],f=i,h=n;for(r(e,i,t),a(e[n],p)>0&&r(e,i,n);f<h;){for(r(e,f,h),f++,h--;a(e[f],p)<0;)f++;for(;a(e[h],p)>0;)h--}0===a(e[i],p)?r(e,i,h):r(e,++h,n),h<=t&&(i=h+1),t<=h&&(n=h-1)}}function r(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function a(e,t){return e<t?-1:e>t?1:0}i.d(t,{q:()=>n})},11440:(e,t,i)=>{i.d(t,{A:()=>c});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266);let c=class extends u.A{constructor(e){super(e),this.boundaries=[],this.type="fixed-boundaries"}};(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.boundaries",write:{writer:function(e,t,i){(0,s.sM)(i,e&&function(e){return e[0]instanceof Date}(e)?e.map(e=>e.getTime()):e,t)}}}})],c.prototype,"boundaries",void 0),(0,n.Cg)([(0,o.e)({fixedBoundariesBin:"fixed-boundaries"},{readOnly:!0})],c.prototype,"type",void 0),c=(0,n.Cg)([(0,l.$)("esri.rest.support.FixedBoundariesBinParameters")],c),c.from=(0,a.dp)(c)},17136:(e,t,i)=>{i.d(t,{Y_:()=>M,O7:()=>R,el:()=>I});var n=i(92602),s=i(69052),r=i(49186),a=i(53966),o=i(39829),l=i(82799),u=i(16930),c=i(80754),d=i(21325),p=i(28735),f=i(43773),h=i(65864),m=i(2272),y=i(84952),g=i(92300);const x=()=>a.A.getLogger("esri.geometry.support.normalizeUtils");function F(e){return"polygon"===e[0].type}function _(e){return"polyline"===e[0].type}function v(e,t,i){if(t){const t=function(e,t){if(!(e instanceof l.A||e instanceof o.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new r.A("internal:geometry",e)}const i=(0,c.r8)(e),n=[];for(const e of i){const i=[];n.push(i),i.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const s=e[n][0],r=e[n][1],a=e[n+1][0],o=e[n+1][1],l=Math.sqrt((a-s)*(a-s)+(o-r)*(o-r)),u=(o-r)/l,c=(a-s)/l,d=l/t;if(d>1){for(let e=1;e<=d-1;e++){const n=e*t,a=c*n+s,o=u*n+r;i.push([a,o])}const e=(l+Math.floor(d-1)*t)/2,n=c*e+s,a=u*e+r;i.push([n,a])}i.push([a,o])}}return function(e){return"polygon"===e.type}(e)?new o.A({rings:n,spatialReference:e.spatialReference}):new l.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,p.ci)(t,!0)}return i&&(e=(0,c.kS)(e,i)),e}function w(e,t,i){if(Array.isArray(e)){const n=e[0];if(n>t){const i=(0,c.kd)(n,t);e[0]=n+i*(-2*t)}else if(n<i){const t=(0,c.kd)(n,i);e[0]=n+t*(-2*i)}}else{const n=e.x;if(n>t){const i=(0,c.kd)(n,t);e=e.clone().offset(i*(-2*t),0)}else if(n<i){const t=(0,c.kd)(n,i);e=e.clone().offset(t*(-2*i),0)}}return e}function S(e,t){let i=-1;for(let n=0;n<t.cutIndexes.length;n++){const s=t.cutIndexes[n],r=t.geometries[n],a=(0,c.r8)(r);for(let e=0;e<a.length;e++){const t=a[e];t.some(i=>{if(i[0]<180)return!0;{let i=0;for(let e=0;e<t.length;e++){const n=t[e][0];i=n>i?n:i}i=Number(i.toFixed(9));const n=-360*(0,c.kd)(i,180);for(let i=0;i<t.length;i++){const t=r.getPoint(e,i);r.setPoint(e,i,t.clone().offset(n,0))}return!0}})}if(s===i){if(F(e))for(const t of(0,c.r8)(r))e[s]=e[s].addRing(t);else if(_(e))for(const t of(0,c.r8)(r))e[s]=e[s].addPath(t)}else i=s,e[s]=r}return e}async function I(e,t,i){if(!Array.isArray(e))return I([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const s="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let r,a,u,F,_,R,T,M,b=0;const A=[],z=[];for(const t of e)if(null!=t)if(r||(r=t.spatialReference,a=(0,d.Vp)(r),u=r.isWebMercator,R=u?102100:4326,F=c.j7[R].maxX,_=c.j7[R].minX,T=c.j7[R].plus180Line,M=c.j7[R].minus180Line),a)if("mesh"===t.type)z.push(t);else if("point"===t.type)z.push(w(t.clone(),F,_));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>w(e,F,_)),z.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,a);z.push(e.rings?new o.A(e):e)}else if(t.extent){const e=t.extent,i=(0,c.kd)(e.xmin,_)*(2*F);let n=0===i?t.clone():(0,c.kS)(t.clone(),i);e.offset(i,0);let{xmin:s,xmax:r}=e;s=Number(s.toFixed(9)),r=Number(r.toFixed(9)),e.intersects(T)&&r!==F?(b=r>b?r:b,n=v(n,u),A.push(n),z.push("cut")):e.intersects(M)&&s!==_?(b=r*(2*F)>b?r*(2*F):b,n=v(n,u,360),A.push(n),z.push("cut")):z.push(n)}else z.push(t.clone());else z.push(t);else z.push(t);let C=(0,c.kd)(b,F),B=-90;const N=C,O=new l.A;for(;C>0;){const e=360*C-180;O.addPath([[e,B],[e,-1*B]]),B*=-1,C--}if(A.length>0&&N>0){const t=S(A,await async function(e,t,i,n){const s=(0,m.Dl)(e),r=t[0].spatialReference,a={...n,responseType:"json",query:{...s.query,f:"json",sr:(0,d.YX)(r),target:JSON.stringify({geometryType:(0,h.$B)(t[0]),geometries:t}),cutter:JSON.stringify(i)}},o=await(0,f.A)(s.path+"/cut",a),{cutIndexes:l,geometries:u=[]}=o.data;return{cutIndexes:l,geometries:u.map(e=>{const t=(0,h.rS)(e);return t.spatialReference=r,t})}}(s,A,O,i)),n=[],r=[];for(let i=0;i<z.length;i++){const s=z[i];if("cut"!==s)r.push(s);else{const s=t.shift(),a=e[i];null!=a&&"polygon"===a.type&&a.rings&&a.rings.length>1&&s.rings.length>=a.rings.length?(n.push(s),r.push("simplify")):r.push(u?(0,p.Gh)(s):s)}}if(!n.length)return r;const a=await async function(e,t,i){const n="string"==typeof e?(0,y.An)(e):e,s=t[0].spatialReference,r=(0,h.$B)(t[0]),a={...i,query:{...n.query,f:"json",sr:(0,d.YX)(s),geometries:JSON.stringify((0,g.X)(t))}},{data:o}=await(0,f.A)(n.path+"/simplify",a);return(0,g.V)(o.geometries,r,s)}(s,n,i),o=[];for(let e=0;e<r.length;e++){const t=r[e];"simplify"!==t?o.push(t):o.push(u?(0,p.Gh)(a.shift()):a.shift())}return o}const q=[];for(let e=0;e<z.length;e++){const t=z[e];if("cut"!==t)q.push(t);else{const e=A.shift();q.push(!0===u?(0,p.Gh)(e):e)}}return q}function R(e,t,i){const n=(0,d.Vp)(i);if(null==n)return e;const[s,r]=n.valid,a=2*r;let o=0,l=0;t>r?o=Math.ceil(Math.abs(t-r)/a):t<s&&(o=-Math.ceil(Math.abs(t-s)/a)),e>r?l=Math.ceil(Math.abs(e-r)/a):e<s&&(l=-Math.ceil(Math.abs(e-s)/a));let u=e+(o-l)*a;const c=u-t;return c>r?u-=a:c<s&&(u+=a),u}function T(e){const t=(0,d.Vp)(e);if(null==t)return null;const[i,n]=t.valid;return new s.hr(i,n)}const M=T(u.A.WGS84);T(u.A.WebMercator)},29441:(e,t,i)=>{i.d(t,{MG:()=>x,SN:()=>f,SY:()=>g,VW:()=>c,Wq:()=>y,eD:()=>h,j4:()=>m,vl:()=>u});var n=i(49186),s=i(44123),r=i(98453);const a=new s.WhereClauseCache(50,500),o="unsupported-query",l=" as ",u=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeBigInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong"]),c=new Set(["esriFieldTypeDate","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]),d=new Set(["esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...u,...c]);function p(e,t,i={}){const s=m(t,e);if(!s){const i=a.getError(t,e);throw new n.A(o,"invalid SQL expression",{expression:t,error:i})}const r=i.expressionName||"expression";if(i.validateStandardized&&!s.isStandardized)throw new n.A(o,`${r} is not standard`,{expression:t});if(i.validateAggregate&&!s.isAggregate)throw new n.A(o,`${r} does not contain a valid aggregate function`,{expression:t});return s.fieldNames}function f(e,t,i,n){if(!i)return!0;const s="where clause";return x(e,t,p(e,i,{validateStandardized:!0,expressionName:s}),{expressionName:s,query:n}),!0}function h(e,t,i,s,r){if(!i)return!0;const a="having clause",l=p(e,i,{validateAggregate:!0,expressionName:a});x(e,t,l,{expressionName:a,query:r});const u=m(i,e),c=u?.getExpressions().every(t=>{const{aggregateType:i,field:n}=t,r=e.get(n)?.name;return s.some(t=>{const{onStatisticField:n,statisticType:s}=t,a=e.get(n)?.name;return a===r&&s.toLowerCase().trim()===i})});if(!c)throw new n.A(o,"expressions in having clause should also exist in outStatistics",{having:i});return!0}function m(e,t){return e?a.get(e,t):null}function y(e){return/\((.*?)\)/.test(e)?e:e.split(l)[0]}function g(e){return e.split(l)[1]}function x(e,t,i,s={}){const r=new Map;if(function(e,t,i,n,s){const r=s.includes("*")?[...i,...s.filter(e=>"*"!==e)]:s;for(const s of r)if(t.get(s))F(e,t,i,n,s);else try{const r=p(t,y(s),{validateStandardized:!0});for(const s of r)F(e,t,i,n,s)}catch(t){e.set(s,{type:"expression-error",expression:s,error:t})}}(r,e,t,s.allowedFieldTypes??d,i),r.size){const e=s.expressionName??"expression";throw new n.A(o,`${e} contains invalid or missing fields`,{errors:Array.from(r.values()),query:s.query})}}function F(e,t,i,n,s){const a=t.get(s);a?i.has(a.name)?"all"!==n&&!1===n?.has(a.type)&&e.set(s,{type:"invalid-type",fieldName:a.name,fieldType:r.m.fromJSON(a.type),allowedFieldTypes:Array.from(n,e=>r.m.fromJSON(e))}):e.set(s,{type:"missing-field",fieldName:a.name}):e.set(s,{type:"invalid-field",fieldName:s})}},31464:(e,t,i)=>{i.d(t,{Cv:()=>m,Nk:()=>p,lK:()=>g});var n=i(4576),s=i(74887),r=i(91218),a=i(21325),o=i(28735);const l=[0,0];function u(e,t){if(!t)return null;if("x"in t){const i={x:0,y:0};return[i.x,i.y]=e(t.x,t.y,l),null!=t.z&&(i.z=t.z),null!=t.m&&(i.m=t.m),i}if("xmin"in t){const i={xmin:0,ymin:0,xmax:0,ymax:0};return[i.xmin,i.ymin]=e(t.xmin,t.ymin,l),[i.xmax,i.ymax]=e(t.xmax,t.ymax,l),t.hasZ&&(i.zmin=t.zmin,i.zmax=t.zmax,i.hasZ=!0),t.hasM&&(i.mmin=t.mmin,i.mmax=t.mmax,i.hasM=!0),i}return"rings"in t?{rings:c(t.rings,e),hasM:t.hasM,hasZ:t.hasZ}:"paths"in t?{paths:c(t.paths,e),hasM:t.hasM,hasZ:t.hasZ}:"points"in t?{points:d(t.points,e),hasM:t.hasM,hasZ:t.hasZ}:null}function c(e,t){const i=[];for(const n of e)i.push(d(n,t));return i}function d(e,t){const i=[];for(const n of e){const e=t(n[0],n[1],[0,0]);i.push(e),n.length>2&&e.push(n[2]),n.length>3&&e.push(n[3])}return i}async function p(e,t){if(!e||!t)return;const i=Array.isArray(e)?e.map(e=>null!=e.geometry?e.geometry.spatialReference:null).filter(n.Ru):[e];await(0,r.initializeProjection)(i.map(e=>({source:e,dest:t})))}const f=u.bind(null,o.je),h=u.bind(null,o.tD);function m(e,t,i,n){if(!e)return null;if(i||(i=t,t=e.spatialReference),!(0,a.fn)(t)||!(0,a.fn)(i)||(0,a.aI)(t,i))return e;if((0,o.y7)(t,i)){const t=(0,a.K8)(i)?f(e):h(e);return t.spatialReference=i,t}return(0,r.projectMany)([e],t,i,n)[0]}const y=new class{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(e,t,i,n){if(!e?.length||!t||!i||(0,a.aI)(t,i))return e;const r={geometries:e,inSpatialReference:t,outSpatialReference:i,options:n,resolve:(0,s.Tw)()};return this._jobs.push(r),this._timer??=setTimeout(this._process,10),r.resolve.promise}_process(){this._timer=null;const e=this._jobs.shift();if(!e)return;const{geometries:t,inSpatialReference:i,outSpatialReference:n,resolve:s,options:l}=e;(0,o.y7)(i,n)&&null==l?.extendedParams?(0,a.K8)(n)?s(t.map(f)):s(t.map(h)):s((0,r.projectMany)(t,i,n,l)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}};function g(e,t,i,n){return y.push(e,t,i,n)}},37539:(e,t,i)=>{i.d(t,{pO:()=>m,jd:()=>p,Tp:()=>f,w5:()=>d});var n=i(34727),s=i(83047),r=i(73941),a=i(79258);Math.PI;const o=a.$O.radius,l=a.$O.eccentricitySquared,u={a1:o*l,a2:o*l*o*l,a3:o*l*l/2,a4:o*l*o*l*2.5,a5:o*l+o*l*l/2,a6:1-l};a.$O.radius,a.$O.flattening,a.Sw.radius,a.Sw.flattening,a.sH.radius,a.sH.flattening,a.sH.radius;var c=i(21325);const d={2:{5:m,7:null,9:null,10:m,1:S,6:null,8:null,0:null,3:g,11:x,2:m,4:b},5:{5:m,7:null,9:null,10:m,1:S,6:null,8:null,0:null,3:g,11:x,2:m,4:b},7:{5:null,7:m,9:null,10:m,1:null,6:w,8:null,0:null,3:null,11:null,2:null,4:null},9:{5:null,7:null,9:m,10:m,1:null,6:null,8:v,0:null,3:null,11:null,2:null,4:null},3:{5:y,7:null,9:null,10:y,1:function(e,t,i,n){const s=e[t]/O,r=N-2*Math.atan(Math.exp(-e[t+1]/O)),a=O+e[t+2],o=Math.cos(r)*a;i[n]=Math.cos(s)*o,i[n+1]=Math.sin(s)*o,i[n+2]=Math.sin(r)*a},6:null,8:null,0:null,3:m,11:function(e,t,i,n){y(e,t,i,n),x(i,n,i,n)},2:y,4:function(e,t,i,n){y(e,t,i,n),b(i,n,i,n)}},4:{5:A,7:null,9:null,10:A,1:function(e,t,i,n){A(e,t,i,n),S(i,n,i,n)},6:null,8:null,0:null,3:function(e,t,i,n){A(e,t,i,n),g(i,n,i,n)},11:function(e,t,i,n){A(e,t,i,n),x(i,n,i,n)},2:A,4:m},1:{5:M,7:null,9:null,10:M,1:m,6:null,8:null,0:null,3:function(e,t,i,n){M(e,t,i,n),g(i,n,i,n)},11:function(e,t,i,n){M(e,t,i,n),x(i,n,i,n)},2:M,4:function(e,t,i,n){M(e,t,i,n),b(i,n,i,n)}},6:{5:null,7:T,9:null,10:T,1:null,6:m,8:null,0:null,3:null,11:null,2:null,4:null},8:{5:null,7:null,9:R,10:R,1:null,6:null,8:m,0:null,3:null,11:null,2:null,4:null},0:{5:null,7:null,9:null,10:null,1:null,6:null,8:null,0:m,3:null,11:null,2:null,4:null},10:{5:m,7:m,9:m,10:m,1:S,6:w,8:v,0:null,3:g,11:x,2:m,4:b},11:{5:F,7:null,9:null,10:F,1:function(e,t,i,n){F(e,t,i,n),S(i,n,i,n)},6:null,8:null,0:null,3:function(e,t,i,n){F(e,t,i,n),g(i,n,i,n)},11:m,2:F,4:function(e,t,i,n){F(e,t,i,n),b(i,n,i,n)}}};function p(e,t){return f(e,t)?.projector}function f(e,t){if(null==e||null==t)return null;if(z.source.spatialReference===e&&z.dest.spatialReference===t)return z;const i=h(e,z.source),n=h(t,z.dest);return 0===i&&0===n?(0,c.aI)(e,t)?z.projector=m:z.projector=null:z.projector=d[i][n],z}function h(e,t){return e?t.spatialReference===e?t.spatialReferenceId:(t.spatialReference=e,"metersPerUnit"in t&&(t.metersPerUnit=(0,s.GA)(e,1)),(0,r.jA)(e)?t.spatialReferenceId=1:(0,c.oT)(e)?t.spatialReferenceId=2:(0,c.K8)(e)?t.spatialReferenceId=3:(0,c.r1)(e)?t.spatialReferenceId=11:e.wkt===r.Ro.wkt?t.spatialReferenceId=4:4490===e.wkid?t.spatialReferenceId=5:e.wkt===r.FY.wkt?t.spatialReferenceId=6:e.wkt===r.LJ.wkt?t.spatialReferenceId=8:(0,c.q8)(e)?t.spatialReferenceId=7:(0,c.KQ)(e)?t.spatialReferenceId=9:t.spatialReferenceId=0):0}function m(e,t,i,n){e!==i&&(i[n++]=e[t++],i[n++]=e[t++],i[n]=e[t])}function y(e,t,i,n){i[n]=B*(e[t]/O),i[n+1]=B*(N-2*Math.atan(Math.exp(-e[t+1]/O))),i[n+2]=e[t+2]}function g(e,t,i,s){!function(e,t,i,s,r){const a=.4999999*Math.PI,o=(0,n.qE)(C*e[t+1],-a,a),l=Math.sin(o);i[s++]=C*e[t]*r.radius,i[s++]=r.halfSemiMajorAxis*Math.log((1+l)/(1-l)),i[s]=e[t+2]}(e,t,i,s,a.$O)}function x(e,t,i,n){i[n]=e[t]*q,i[n+1]=e[t+1]*q,i[n+2]=e[t+2]}function F(e,t,i,n){i[n]=e[t]*G,i[n+1]=e[t+1]*G,i[n+2]=e[t+2]}function _(e,t,i,n,s){const r=s+e[t+2],a=C*e[t+1],o=C*e[t],l=Math.cos(a)*r;i[n]=Math.cos(o)*l,i[n+1]=Math.sin(o)*l,i[n+2]=Math.sin(a)*r}function v(e,t,i,n){_(e,t,i,n,a.Sw.radius)}function w(e,t,i,n){_(e,t,i,n,a.sH.radius)}function S(e,t,i,n){_(e,t,i,n,a.$O.radius)}function I(e,t,i,s,r){const a=e[t],o=e[t+1],l=e[t+2],u=Math.sqrt(a*a+o*o+l*l),c=(0,n.YN)(l/(0===u?1:u)),d=Math.atan2(o,a);i[s++]=B*d,i[s++]=B*c,i[s]=u-r}function R(e,t,i,n){I(e,t,i,n,a.Sw.radius)}function T(e,t,i,n){I(e,t,i,n,a.sH.radius)}function M(e,t,i,n){I(e,t,i,n,a.$O.radius)}function b(e,t,i,n){!function(e,t,i,n,s){const r=C*e[t],a=C*e[t+1],o=e[t+2],l=Math.sin(a),u=Math.cos(a),c=s.radius/Math.sqrt(1-s.eccentricitySquared*l*l);i[n++]=(c+o)*u*Math.cos(r),i[n++]=(c+o)*u*Math.sin(r),i[n++]=(c*(1-s.eccentricitySquared)+o)*l}(e,t,i,n,a.$O)}function A(e,t,i,n){const s=u,r=e[t],o=e[t+1],l=e[t+2];let c,d,p,f,h,m,y,g,x,F,_,v,w,S,I,R,T,M,b,A,z;c=Math.abs(l),d=r*r+o*o,p=Math.sqrt(d),f=d+l*l,h=Math.sqrt(f),A=Math.atan2(o,r),m=l*l/f,y=d/f,S=s.a2/h,I=s.a3-s.a4/h,y>.3?(g=c/h*(1+y*(s.a1+S+m*I)/h),b=Math.asin(g),F=g*g,x=Math.sqrt(1-F)):(x=p/h*(1-m*(s.a5-S-y*I)/h),b=Math.acos(x),F=1-x*x,g=Math.sqrt(F)),_=1-a.$O.eccentricitySquared*F,v=a.$O.radius/Math.sqrt(_),w=s.a6*v,S=p-v*x,I=c-w*g,T=x*S+g*I,R=x*I-g*S,M=R/(w/_+T),b+=M,z=T+R*M/2,l<0&&(b=-b),i[n++]=B*A,i[n++]=B*b,i[n]=z}const z={source:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:0,metersPerUnit:1},projector:m},C=(0,n.kU)(1),B=(0,n.KJ)(1),N=.5*Math.PI,O=a.$O.radius,q=O*Math.PI/180,G=180/(O*Math.PI)},41266:(e,t,i)=>{i.d(t,{A:()=>y});var n=i(31635),s=i(69540),r=i(66552),a=i(25482),o=i(10107),l=(i(44208),i(53966),i(87811),i(93223)),u=i(64108),c=i(56507);const d=new r.J({esriFieldTypeInteger:"integer",esriFieldTypeString:"string"});let p=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.alias=null,this.responseType=null,this.type=null,this.value=null,this.valueType=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"outAlias",write:!0}})],p.prototype,"alias",void 0),(0,n.Cg)([(0,o.MZ)({type:String})],p.prototype,"responseType",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"type",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],p.prototype,"value",void 0),(0,n.Cg)([(0,l.e)(d)],p.prototype,"valueType",void 0),p=(0,n.Cg)([(0,u.$)("esri.rest.support.AttributeBinsGrouping")],p);const f=p;p.from=(0,c.dp)(p);const h=new r.J({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeDate:"date",esriFieldTypeDateOnly:"date-only",esriFieldTypeTimeOnly:"time-only",esriFieldTypeTimestampOffset:"timestamp-offset"}),m=new r.J({naturalLog:"natural-log",squareRoot:"square-root"});let y=class extends((0,s.OU)(a.o)){constructor(e){super(e),this.expression=null,this.expressionValueType=null,this.field=null,this.firstDayOfWeek=null,this.hideUpperBound=null,this.splitBy=null,this.stackBy=null,this.transformation=null}};(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"onExpression.value",write:!0}})],y.prototype,"expression",void 0),(0,n.Cg)([(0,l.e)(h,{name:"onExpression.valueType"})],y.prototype,"expressionValueType",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{name:"onField",write:!0}})],y.prototype,"field",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"firstDayOfWeek",void 0),(0,n.Cg)([(0,o.MZ)({type:String,json:{write:!0}})],y.prototype,"hideUpperBound",void 0),(0,n.Cg)([(0,o.MZ)({type:f,json:{write:{overridePolicy(){return{enabled:null!=this.splitBy?.value||null!=this.splitBy?.type}}}}})],y.prototype,"splitBy",void 0),(0,n.Cg)([(0,o.MZ)({type:f,json:{write:{target:{stackBy:{type:f},jsonStyle:{type:String}},writer:(e,t)=>{e&&(t.stackBy=e.toJSON(),null!=e.responseType&&(t.jsonStyle=e.responseType))},overridePolicy(){return{enabled:null!=this.stackBy?.value||null!=this.stackBy?.type}}},read:{source:["stackBy","jsonStyle"],reader:(e,t)=>f.fromJSON({...t.stackBy,responseType:t.jsonStyle})}}})],y.prototype,"stackBy",void 0),(0,n.Cg)([(0,l.e)(m)],y.prototype,"transformation",void 0),y=(0,n.Cg)([(0,u.$)("esri.rest.support.BinParametersBase")],y)},41366:(e,t,i)=>{i.d(t,{K:()=>p,Q:()=>u});var n=i(31635),s=i(66552),r=i(53966),a=i(10107),o=(i(44208),i(87811),i(93223)),l=i(64108);const u=(0,s.O)()({naturalLog:"natural-log",squareRoot:"square-root",percentOfTotal:"percent-of-total",log:"log",field:"field"}),c="percent-of-total",d="field",p=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.normalizationField=null,this.normalizationMaxValue=null,this.normalizationMinValue=null,this.normalizationTotal=null}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=null!=this.normalizationTotal;return t||i?(e=t&&d||i&&c||null,t&&i&&r.A.getLogger(this).warn("warning: both normalizationField and normalizationTotal are set!")):e!==d&&e!==c||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}};return(0,n.Cg)([(0,a.MZ)({type:String,json:{name:"parameters.normalizationField",write:!0}})],i.prototype,"normalizationField",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMaxValue",write:!0}})],i.prototype,"normalizationMaxValue",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationMinValue",write:!0}})],i.prototype,"normalizationMinValue",void 0),(0,n.Cg)([(0,a.MZ)({type:Number,json:{name:"parameters.normalizationTotal",write:!0}})],i.prototype,"normalizationTotal",void 0),(0,n.Cg)([(0,o.e)(u,{name:"parameters.normalizationType"})],i.prototype,"normalizationType",null),i=(0,n.Cg)([(0,l.$)("esri.rest.support.NormalizationBinParametersMixin")],i),i}},44123:(e,t,i)=>{i.r(t),i.d(t,{WhereClauseCache:()=>r});var n=i(66344),s=i(88368);class r{constructor(e,t){this._cache=new n.q(e),this._invalidCache=new n.q(t)}get(e,t){const i=`${t?.uid}:${e}`,n=this._cache.get(i);if(n)return n;if(null!=this._invalidCache.get(i))return null;try{const n=s.A.create(e,{fieldsIndex:t});return this._cache.put(i,n),n}catch(e){return this._invalidCache.put(i,e),null}}getError(e,t){const i=`${t?.uid}:${e}`;return this._invalidCache.get(i)??null}}},44794:(e,t,i)=>{i.d(t,{v:()=>o});var n=i(4718),s=i(62788),r=i(95488);class a{constructor(e,t){this._observable=new r.I,this._value=e,this._equalityFunction=t}get value(){return(0,s.gc)(this._observable),this._value}set value(e){this._equalityFunction(e,this._value)||(this._value=e,this._observable.notify())}mutate(e){e(this._value),this._observable.notify()}}function o(e,t=n.gh){return new a(e,t)}},51441:(e,t,i)=>{i.d(t,{LQ:()=>s,ag:()=>a,pL:()=>r});var n=i(90708);function s(e,t,i,s=e.hasZ,r=e.hasM){if(null==t)return null;const a=e.hasZ&&s,o=e.hasM&&r;if(i){const e=(0,n.Nl)(t,"esriGeometryPoint",i,s,r);return(0,n.DF)(e,a,o)}return(0,n.DF)(t,a,o)}function r(e,t,i,s,r,a){if(null==t)return null;const o="coords"in t?t:t.geometry;if(null==o)return null;const{hasZ:l,hasM:u}=o,c=l&&(r??=l),d=u&&(a??=u);if(i){let t=(0,n.kz)(o,e,i,r,a);return s&&(t=(0,n.Nl)(t,e,s)),(0,n.zv)(t,e,c,d)}if(s){const t=(0,n.Nl)(o,e,s,r,a);return(0,n.zv)(t,e,c,d)}return(0,n.zv)(o,e,c,d)}function a(e){return e&&o in e?JSON.parse(JSON.stringify(e,l)):e}const o="_geVersion",l=(e,t)=>e===o?void 0:t},54339:(e,t,i)=>{function n(e,t){switch(t.type){case"object-id":case"unique-id-simple":return e.attributes[t.fieldName];case"unique-id-composite":{const i=[];for(const n of t.fieldNames)i.push(e.attributes[n]??null);return JSON.stringify(i)}}}function s(e,t){if("uniqueIdFields"in t&&t.uniqueIdFields?.length){if(1===t.uniqueIdFields.length)return e.attributes?.[t.uniqueIdFields[0]];const i=t.uniqueIdFields.map(t=>e.attributes?.[t]);return JSON.stringify(i)}return"objectIdField"in t&&t.objectIdField?e.attributes?.[t.objectIdField]:null}i.d(t,{W:()=>n,r:()=>s})},56390:(e,t,i)=>{i.d(t,{do:()=>L,Wc:()=>U});var n=i(4576),s=i(21818),r=i(49186),a=(i(44208),i(4718)),o=i(97768),l=i(74887),u=i(83047),c=i(12195),d=i(91218),p=i(70328),f=i(19419),h=i(6606),m=i(65864),y=i(17136),g=i(21325),x=i(90708),F=i(29441),_=i(51441),v=i(31464);class w{constructor(){this._storage=new Map,this._purgeInterval=5,this._sweep=()=>{if(this._timer=void 0,!this._storage)return;const e=1e3*this._purgeInterval,t=performance.now()-e;for(const[i,n]of this._storage){if(!(n.time<t))return void(this._storage.size>0&&(this._timer=setTimeout(this._sweep,e)));this._storage.delete(i)}}}destroy(){this._storage?.clear(),this._storage=null,clearTimeout(this._timer)}put(e,t){this._storage?.set(e,new I(t)),this._scheduleSweep()}get(e){const t=this._storage?.get(e);if(t)return this._storage?.delete(e),t.time=performance.now(),this._storage?.set(e,t),t.items}clear(){this._storage?.clear()}_scheduleSweep(){this._storage&&(this._timer??=setTimeout(this._sweep,1e3*this._purgeInterval))}get test(){}}let S=0;class I{constructor(e){this.items=e,this.time=performance.now(),this.id=S++}}var R=i(99352),T=i(8384),M=i(58727),b=i(62660),A=i(43668);const z="unsupported-query";async function C(e,{fieldsIndex:t,geometryType:i,spatialReference:n,availableFields:s}){if(null!=e.geometryPrecision||e.multipatchOption&&"xyFootprint"!==e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new r.A(z,"Unsupported query options",{query:e});return B(t,s,e),function(e,t,i){const{outStatistics:n,groupByFieldsForStatistics:s,having:a}=i,o=s?.length,l=n?.length;if(a){if(!o||!l)throw new r.A(z,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:i});(0,F.eD)(e,t,a,n,i)}if(l){if(null==(u=n)||!u.every(e=>"exceedslimit"!==e.statisticType))return;const a=n.map(e=>e.onStatisticField).filter(Boolean);(0,F.MG)(e,t,a,{expressionName:"onStatisticFields",query:i}),o&&(0,F.MG)(e,t,s,{expressionName:"groupByFieldsForStatistics",query:i});for(const s of n){const{onStatisticField:n,statisticType:a}=s;if("percentile_disc"!==a&&"percentile_cont"!==a||!("statisticParameters"in s))e.get(n)&&"count"!==a&&"min"!==a&&"max"!==a&&(0,F.MG)(e,t,[n],{expressionName:`outStatistics with '${a}' statistic type`,allowedFieldTypes:N,query:i});else{const{statisticParameters:e}=s;if(!e)throw new r.A(z,"statisticParameters should be set for percentile type",{definition:s,query:i})}}}var u}(t,s,e),Promise.all([(0,b.c0)(e,i,n),(0,v.Nk)(n,e.outSR)]).then(()=>e)}function B(e,t,i){const{returnDistinctValues:n,outStatistics:s}=i,a=s?s.map(e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if("orderByFields"in i&&i.orderByFields&&i.orderByFields.length>0){const n=" asc",s=" desc",r=i.orderByFields.map(e=>{const t=e.toLowerCase();return t.includes(n)?t.split(n)[0]:t.includes(s)?t.split(s)[0]:e}).filter(e=>!a.includes(e));(0,F.MG)(e,t,r,{expressionName:"orderByFields",query:i})}if("outFields"in i)if(i.outFields?.length)(0,F.MG)(e,t,i.outFields,{expressionName:"outFields",query:i,allowedFieldTypes:"all"});else if(n)throw new r.A(z,"outFields should be specified for returnDistinctValues",{query:i});(0,F.SN)(e,t,i.where,i)}const N=new Set([...F.vl,...F.VW]);async function O(e,t,i,n){let s=[];if(i.valueExpression){const{arcadeUtils:e}=await(0,A.l)();s=e.extractFieldNames(i.valueExpression)}if(i.field&&s.push(i.field),i.field2&&s.push(i.field2),i.field3&&s.push(i.field3),i.normalizationField&&s.push(i.normalizationField),!s.length&&!i.valueExpression)throw new r.A(z,"field or valueExpression is required",{params:i});(0,F.MG)(e,t,s,{expressionName:"statistics",query:n})}var q=i(86420),G=i(95466),P=(i(71511),i(53966),i(36708),i(44794),i(78659)),E=i(31635),j=i(69622),D=i(10107),V=(i(87811),i(64108));let Z=class extends j.A{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};(0,E.Cg)([(0,D.MZ)()],Z.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),(0,E.Cg)([(0,D.MZ)()],Z.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Z=(0,E.Cg)([(0,V.$)("esri.views.support.debugFlags")],Z),new Z,Symbol("Yield");new Map([["immediate",0],["schedule",4],["slide",0],["stream loader",0],["elevation query",0],["terrain",1],["surface geometry updates",1],["LoD renderer",2],["Graphics3D",2],["I3S",2],["point cloud",2],["feature fetcher",2],["stream controller",2],["clouds generator",2],["overlay",4],["overlay renderer",4],["stage",4],["graphics deconflictor",4],["graphics filter visibility",4],["graphics scale visibility",4],["graphics frustum visibility",4],["POI frequent",6],["POI infrequent",30],["labeler",8],["feature query",8],["feature tile tree",16],["fast feature tile tree",0],["elevation alignment",12],["elevation alignment scene",14],["text texture atlas",12],["texture unload",12],["line of sight tool",16],["interactive line of sight tool",0],["snapping",0],["shadow accumulator",30],["flow generator",12],["mapview fetch queue",0],["mapview layerview update",2],["mapview vector tile parsing queue",0]]),(0,P.l5)(6.5),(0,P.l5)(1),(0,P.l5)(30),(0,P.l5)(1e3/30),(0,P.l5)(100);const Q=new class{constructor(){this._begin=performance?.now()??0,this._budget=0,this._done=!1,this._progressed=!1,this._enabled=!0}run(e){return!this.done&&(!0===e()&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){return this._progressed=!0,this._done=this.elapsed>=this._budget&&this._enabled,this._done}get enabled(){return this._enabled}set enabled(e){this._enabled=e}reset(e){this._begin=this.now(),this._budget=e,this.resetProgress()}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return this.now()-this._begin}resetProgress(){this._progressed=!1,this._done=!1}get hasProgressed(){return this._progressed}};Q.enabled=!1;const k=new class{remove(){}processQueue(){}schedule(e,t,i){try{if((0,l.G4)(t)){const e=(0,l.NK)();return i?Promise.resolve(i(e)):Promise.reject(e)}return(0,l.z7)(e(Q))}catch(e){return Promise.reject(e)}}reschedule(e,t,i){return this.schedule(e,t,i)}async scheduleGenerator(e,t,i){if((0,l.G4)(t)){const e=(0,l.NK)();if(i)return i(e);throw e}const n=e(Q);for(;;){const e=n.next(Q),s=(0,l.$X)(e)?await e:e;if((0,l.G4)(t)){const e=(0,l.NK)();if(i){const t=i(e);return n.return(null),t}throw n.throw(e),e}if(s.done)return s.value}}};class L{constructor(e){this._changeHandle=null,this.capabilities={query:R.F},this.geometryType=e.geometryType,this.hasM=!!e.hasM,this.hasZ=!!e.hasZ,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._cache=e.cache??new w,this.timeInfo=e.timeInfo,this.featureIdInfo=e.featureIdInfo,"object-id"===e.featureIdInfo.type&&(this.objectIdField=e.featureIdInfo.fieldName),this._changeHandle=this.featureStore.events.on("changed",()=>this._clearCache()),this.fieldsIndex=(0,c.W)(e.fieldsIndex)?e.fieldsIndex:G.A.fromJSON(e.fieldsIndex),!e.availableFields||1===e.availableFields.length&&"*"===e.availableFields[0]?this.availableFields=new Set(this.fieldsIndex.fields.map(e=>e.name)):this.availableFields=new Set(e.availableFields.map(e=>this.fieldsIndex.get(e)?.name).filter(e=>null!=e)),e.scheduler&&e.priority?this._frameTask=e.scheduler.registerTask(e.priority):this._frameTask=k}destroy(){this._changeHandle=(0,o.xt)(this._changeHandle),this._frameTask=(0,o.xt)(this._frameTask),this._clearCache(),(0,o.pR)(this._cache)}get featureAdapter(){return this.featureStore.featureAdapter}async executeQuery(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryFeatureSet(e),i)}async executeQueryForCount(e={},t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForCount(e),i)}async executeQueryForExtent(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForExtent(e),i)}async executeQueryForIds(e,t){return Array.from(await this.executeQueryForIdSet(e,t))}async executeQueryForIdSet(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForIdSet(e),i)}async executeQueryForLatestObservations(e,t){const i=(0,l.Mq)(t);if(!this.timeInfo?.trackIdField)throw new r.A("unsupported-query","Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});return await this._frameTask.scheduleGenerator(()=>this._executeQueryForLatestObservations(e),i)}async executeQueryForOpaqueFeatures(e,t){const i=(0,l.Mq)(t);return(await this._frameTask.scheduleGenerator(()=>this._executeQuery(e,{}),i)).items}async executeAttributeBinsQuery(e,t){const i=(0,l.Mq)(t);return e=(0,a.o8)(e),await this._frameTask.scheduleGenerator(()=>this._executeAttributeBinsQuery(e),i)}async executeQueryForSummaryStatistics(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSummaryStatistics(e,t),n)}async executeQueryForUniqueValues(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForUniqueValues(e,t),n)}async executeQueryForClassBreaks(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForClassBreaks(e,t),n)}async executeQueryForHistogram(e={},t,i){const n=(0,l.Mq)(i);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForHistogram(e,t),n)}async executeQueryForSnapping(e,t){const i=(0,l.Mq)(t);return await this._frameTask.scheduleGenerator(()=>this._executeQueryForSnapping(e,i),i)}async fetchRecomputedExtents(e){const t=(0,l.Mq)(e);this._timeExtentPromise||=(0,q.W)(this.timeInfo,this.featureStore);const[i,n]=await Promise.all([this._getFullExtent(),this._timeExtentPromise]);return(0,l.Te)(t),{fullExtent:i,timeExtent:n}}_clearCache(){this._cache.clear(),this._allFeaturesPromise=null,this._timeExtentPromise=null,this._fullExtentPromise=null}async*_executeQueryFeatureSet(e){try{const t=yield*this._executeQuery(e,{});return yield,await t.createQueryResponse()}catch(t){if(t!==M.v8)throw t;return await new T.G([],e,this).createQueryResponse()}}async*_executeQueryForCount(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null});return yield,t.createQueryResponseForCount()}catch(e){if(e!==M.v8)throw e;return 0}}async*_executeQueryForExtent(e){const t=e.outSR;try{const i=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const n=i.size;if(!n)return{count:0,extent:null};const s=await this._getBounds(i.items,i.spatialReference,t??this.spatialReference);return yield,{count:n,extent:s}}catch(e){if(e===M.v8)return{count:0,extent:null};throw e}}async*_executeQueryForIdSet(e){try{const t=yield*this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null});yield;const i=t.items,n=new Set;for(const e of i)n.add(t.featureAdapter.getObjectId(e));return n}catch(e){if(e===M.v8)return new Set;throw e}}async*_executeQueryForLatestObservations(e){try{const t=yield*this._executeQuery(e,{});return yield,this._filterLatest(t),yield,await t.createQueryResponse()}catch(t){if(t!==M.v8)throw t;return await new T.G([],e,this).createQueryResponse()}}async*_executeAttributeBinsQuery(e){let t;try{e=await(0,M.iJ)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t){const i=e.bin;if(!i.onField&&!i.onExpression?.value||"autoIntervalBin"===i.type&&null==i.parameters.numberOfBins||"dateBin"===i.type&&(null==i.parameters.number||null==i.parameters.unit)||"fixedBoundariesBin"===i.type&&null==i.parameters.boundaries||"fixedIntervalBin"===i.type&&null==i.parameters.interval)throw new r.A(z,"Unsupported query options",{query:e});return C(e,t)}(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield,t=yield*this._executeGeometryQuery(e,i),yield,this._executeAggregateIdsQuery(t),yield,this._executeObjectIdsQuery(t),yield,this._executeTimeQuery(t),yield,this._executeAttributesQuery(t),yield}catch(i){if(i!==M.v8)throw i;t=new T.G([],e,this)}return await t.createQueryBinsResponse(e)}async*_executeQueryForSummaryStatistics(e={},t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createSummaryStatisticsResponse(t)}async*_executeQueryForUniqueValues(e={},t){const{field:i,field2:n,field3:s,valueExpression:r}=t,a=yield*this._executeQueryForStatistics(e,{field:i,field2:n,field3:s,valueExpression:r});return yield,await a.createUniqueValuesResponse(t)}async*_executeQueryForClassBreaks(e,t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createClassBreaksResponse(t)}async*_executeQueryForHistogram(e,t){const{field:i,normalizationField:n,valueExpression:s}=t,r=yield*this._executeQueryForStatistics(e,{field:i,normalizationField:n,valueExpression:s});return yield,await r.createHistogramResponse(t)}async*_executeQueryForSnapping(e,t){const{point:i,distance:n,returnEdge:s,vertexMode:r}=e;if(!s&&"none"===r)return{candidates:[]};let o=(0,a.o8)(e.query);o=await(0,M.T2)(o,this.definitionExpression,this.spatialReference),yield,o=await C(o,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const l=!(0,g.aI)(i.spatialReference,this.spatialReference);l&&(await(0,v.Nk)(i.spatialReference,this.spatialReference),yield);const u="number"==typeof n?n:n.x,c="number"==typeof n?n:n.y,d={xmin:i.x-u,xmax:i.x+u,ymin:i.y-c,ymax:i.y+c,spatialReference:i.spatialReference},p=l?(0,v.Cv)(d,this.spatialReference):d;if(!p)return{candidates:[]};const f=(await(0,y.el)((0,m.rS)(i),null,{signal:t}))[0];yield;const h=(await(0,y.el)((0,m.rS)(p),null,{signal:t}))[0];if(yield,null==f||null==h)return{candidates:[]};const x=await this._searchFeatures($(h.toJSON()));yield;const F=new T.G(x,o,this);this._executeObjectIdsQuery(F),yield,this._executeTimeQuery(F),yield,this._executeAttributesQuery(F),yield,yield*this._executeGeometryQueryForSnapping(F),yield;const _=f.toJSON(),w=l?(0,v.Cv)(_,this.spatialReference):_,S=l?Math.max(p.xmax-p.xmin,p.ymax-p.ymin)/2:n;return F.createSnappingResponse({...e,point:w,distance:S},o.returnZ,i.spatialReference)}async _getBounds(e,t,i){const n=(0,p.hZ)((0,p.vt)(),p.qv);return await this.featureStore.forEachBounds(e,e=>(0,p.RF)(n,e)),U(n,t,i,this.spatialReference,this.hasZ)}_getFullExtent(){return this._fullExtentPromise||="getFullExtent"in this.featureStore&&this.featureStore.getFullExtent?Promise.resolve(this.featureStore.getFullExtent(this.spatialReference)):this._getAllFeatures().then(e=>this._getBounds(e,this.spatialReference,this.spatialReference)),this._fullExtentPromise}async _getAllFeaturesQueryEngineResult(e){return new T.G(await this._getAllFeatures(),e,this)}async _getAllFeatures(){if(null==this._allFeaturesPromise){const e=[];this._allFeaturesPromise=(async()=>await this.featureStore.forEach(t=>e.push(t)))().then(()=>(0,s.zI)(e))}const e=this._allFeaturesPromise,t=await e;return e===this._allFeaturesPromise?t.slice():this._getAllFeatures()}async*_executeQuery(e,t){e=(0,a.o8)(e),e=await(0,M.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await C(e,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield,e={...e,...t};const i=yield*this._executeSceneFilterQuery(e);yield;const n=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(n),yield,this._executeObjectIdsQuery(n),yield,this._executeTimeQuery(n),yield,this._executeAttributesQuery(n),n}async*_executeSceneFilterQuery(e){if(null==e.sceneFilter)return null;const{outSR:t,returnGeometry:i,returnCentroid:n}=e,s=this.featureStore.featureSpatialReference,r=e.sceneFilter.geometry,a=null==s||(0,g.aI)(s,r.spatialReference)?r:(0,v.Cv)(r,s);if(!a)return null;const o=i||n,l=(0,g.fn)(t)&&!(0,g.aI)(this.spatialReference,t)&&o?async e=>this._project(e,t):e=>e;yield;const u=this.featureAdapter,c=await this._searchFeatures($(a));if(yield,"disjoint"===e.sceneFilter.spatialRelationship){if(!c.length)return null;const t=new Set;for(const e of c)t.add(u.getObjectId(e));const i=await this._getAllFeatures();yield;const n=await(0,b.xt)("esriSpatialRelDisjoint",a,this.geometryType);yield;const s=e=>!t.has(u.getObjectId(e))||n(u.getGeometry(e)),r=yield*this._runSpatialFilter(i,s);yield;const o=new T.G(r,e,this);return await l(o)}if(!c.length)return new T.G([],e,this);if(this._canExecuteSinglePass(a,e))return await l(new T.G(c,e,this));const d=await(0,b.xt)("esriSpatialRelContains",a,this.geometryType);yield;const p=yield*this._runSpatialFilter(c,e=>d(u.getGeometry(e)));return yield,await l(new T.G(p,e,this))}async*_executeGeometryQuery(e,t){if(null!=t&&0===t.items.length)return t;const{geometry:i,outSR:s,returnGeometry:r,returnCentroid:a}=e,o=t?null:this._getCacheKey(e),l=o?this._cache.get(o):null;if(l)return new T.G(l,e,this);const u=(0,g.fn)(s)&&!(0,g.aI)(this.spatialReference,s),c=r||a,d=async e=>(u&&c&&await this._project(e,s),o&&this._cache.put(o,e.items),e),p=this.featureStore.featureSpatialReference,f=!i||null==p||(0,g.aI)(p,i.spatialReference)?i:(0,v.Cv)(i,p);if(!f)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));yield;const h=this.featureAdapter;let m=await this._searchFeatures($(i));yield;const y=e.spatialRel??"esriSpatialRelIntersects";if("esriSpatialRelDisjoint"===y){if(!m.length)return await d(null!=t?t:await this._getAllFeaturesQueryEngineResult(e));const i=new Set;for(const e of m)i.add(h.getObjectId(e));let n;null!=t?n=t.items:(yield,n=await this._getAllFeatures(),yield);const s=await(0,b.xt)(y,f,this.geometryType);yield;const r=e=>!i.has(h.getObjectId(e))||s(h.getGeometry(e)),a=yield*this._runSpatialFilter(n,r);yield;const o=new T.G(a,e,this);return await d(o)}if(null!=t){const e=new n.vW;m=m.filter(i=>(0,n.qh)(t.items,i,t.items.length,e)>=0)}if(!m.length){const t=new T.G([],e,this);return o&&this._cache.put(o,t.items),t}if(this._canExecuteSinglePass(f,e))return await d(new T.G(m,e,this));const x=await(0,b.xt)(y,f,this.geometryType);yield;const F=yield*this._runSpatialFilter(m,e=>x(h.getGeometry(e)));return yield,await d(new T.G(F,e,this))}_executeAggregateIdsQuery(e){if(0===e.items.length||!e.query.aggregateIds?.length||null==this.aggregateAdapter)return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(e=>t.add(e));const i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeObjectIdsQuery(e){if(0===e.items.length||!e.query.objectIds?.length)return;const t=new Set(e.query.objectIds),i=this.featureAdapter.getObjectId;e.items=e.items.filter(e=>t.has(i(e)))}_executeTimeQuery(e){if(0===e.items.length)return;const t=(0,q.I)(this.timeInfo,e.query.timeExtent,this.featureAdapter);null!=t&&(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(0===e.items.length)return;const t=(0,F.j4)(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(e=>t.testFeature(e,this.featureAdapter))}}async*_executeGeometryQueryForSnapping(e){const{query:t}=e,{spatialRel:i}=t;if(!e?.items?.length||!t.geometry||!i)return;const n=await(0,b.xt)(i,t.geometry,this.geometryType);yield;const s=this.featureAdapter,r=yield*this._runSpatialFilter(e.items,e=>n(s.getGeometry(e)));e.items=r}*_runSpatialFilter(e,t){if(!t)return e;if(null==this._frameTask)return e.filter(e=>t(e));let i=yield;const n=new Array;for(const s of e)t(s)&&n.push(s),i.madeProgress(),i.done&&(i=yield);return n}_filterLatest(e){const{trackIdField:t,startTimeField:i,endTimeField:n}=this.timeInfo,s=n||i,r=new Map,a=this.featureAdapter.getAttribute;for(const i of e.items){const e=a(i,t),n=a(i,s),o=r.get(e);(!o||n>a(o,s))&&r.set(e,i)}e.items=Array.from(r.values())}_getCacheKey(e){const{geometry:t,spatialRel:i,returnGeometry:n,returnCentroid:s,outSR:r,resultType:a,cacheHint:o}=e;if("tile"!==a&&!o)return null;const l=n||s;return(0,g.fn)(r)&&!(0,g.aI)(this.spatialReference,r)&&l?JSON.stringify([t,i,r]):JSON.stringify([t,i])}_canExecuteSinglePass(e,t){const{spatialRel:i}=t;return(0,b.tC)(e)&&("esriSpatialRelEnvelopeIntersects"===i||"esriGeometryPoint"===this.geometryType&&("esriSpatialRelIntersects"===i||"esriSpatialRelContains"===i))}async _project(e,t){if(!t||(0,g.aI)(this.spatialReference,t))return e;const i=this.featureAdapter,n=(0,d.isLoaded)()?await this._getFullExtent():void 0,r=await(0,v.lK)(e.items.map(e=>(0,_.pL)(this.geometryType,i.getGeometry(e))),this.spatialReference,t,{areaOfInterestExtent:n});return e.items=(0,s.zI)(r.map((t,n)=>i.cloneWithGeometry(e.items[n],(0,x.Ux)(t,this.hasZ,this.hasM)))),e}async _searchFeatures(e){const t=new Set;await Promise.all(e.map(e=>this.featureStore.forEachInBounds(e,e=>t.add(e))));const i=Array.from(t.values());return t.clear(),i}async*_executeQueryForStatistics(e,t){e=(0,a.o8)(e);try{e=await(0,M.GC)(e,this.definitionExpression,this.spatialReference),yield,e=await async function(e,t,{fieldsIndex:i,geometryType:n,spatialReference:s,availableFields:a}){if(null!=e.geometryPrecision||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new r.A(z,"Unsupported query options",{query:e});return B(i,a,e),Promise.all([O(i,a,t,e),(0,b.c0)(e,n,s),(0,v.Nk)(s,e.outSR)]).then(()=>e)}(e,t,{availableFields:this.availableFields,fieldsIndex:this.fieldsIndex,geometryType:this.geometryType,spatialReference:this.spatialReference}),yield;const i=yield*this._executeSceneFilterQuery(e);yield;const n=yield*this._executeGeometryQuery(e,i);return yield,this._executeAggregateIdsQuery(n),yield,this._executeObjectIdsQuery(n),yield,this._executeTimeQuery(n),yield,this._executeAttributesQuery(n),yield,n}catch(t){if(t!==M.v8)throw t;return new T.G([],e,this)}}get test(){}}function $(e){if((0,b.tC)(e)){if((0,m.ZC)(e))return[(0,f.fA)(Math.min(e.xmin,e.xmax),Math.min(e.ymin,e.ymax),Math.max(e.xmin,e.xmax),Math.max(e.ymin,e.ymax))];if((0,m.Bi)(e))return e.rings.map(e=>(0,f.fA)(Math.min(e[0][0],e[2][0]),Math.min(e[0][1],e[2][1]),Math.max(e[0][0],e[2][0]),Math.max(e[0][1],e[2][1])))}return[(0,h.Rg)((0,f.vt)(),e)]}function U(e,t,i,n,s){const r={xmin:e[0],ymin:e[1],xmax:e[3],ymax:e[4],spatialReference:(0,_.ag)(n)};s&&isFinite(e[2])&&isFinite(e[5])&&(r.zmin=e[2],r.zmax=e[5],r.hasZ=!0);const a=(0,v.Cv)(r,t,i);if(a.spatialReference=(0,_.ag)(i),a.xmax-a.xmin===0){const e=(0,u.GA)(a.spatialReference);a.xmin-=e,a.xmax+=e}if(a.ymax-a.ymin===0){const e=(0,u.GA)(a.spatialReference);a.ymin-=e,a.ymax+=e}if(s&&null!=a.zmin&&null!=a.zmax&&a.zmax-a.zmin===0){const e=(0,u.GA)(a.spatialReference);a.zmin-=e,a.zmax+=e}return a}},57231:(e,t,i)=>{i.d(t,{g:()=>n});const n=(0,i(66552).O)()({year:"years",quarter:"quarters",month:"months",week:"weeks",day:"days",hour:"hours",minute:"minutes",second:"seconds"})},58727:(e,t,i)=>{i.d(t,{GC:()=>y,T2:()=>g,VY:()=>p,dO:()=>F,iJ:()=>m,v8:()=>f});var n=i(49186),s=i(66552),r=i(83047),a=i(91218),o=i(90634),l=i(65864),u=i(17136),c=i(21325),d=i(31464);const p=new s.J({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),f=Object.freeze({}),h="frequency";async function m(e,t,i){const n=e.bin;return n.onField&&(n.onField=n.onField.trim()),n.onExpression?.value&&(n.onExpression.value=n.onExpression.value.trim()),n.splitBy&&(n.splitBy.value&&(n.splitBy.value=n.splitBy.value.trim()),n.splitBy.outAlias&&(n.splitBy.outAlias=n.splitBy.outAlias.trim())),n.stackBy&&(n.stackBy.value&&(n.stackBy.value=n.stackBy.value.trim()),n.stackBy.outAlias&&(n.stackBy.outAlias=n.stackBy.outAlias.trim())),"normalizationField"in n.parameters&&n.parameters.normalizationField&&(n.parameters.normalizationField=n.parameters.normalizationField.trim()),e.outStatistics?.length||(e.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:h}]),y(e,t,i)}async function y(e,t,i){const{outFields:n,orderByFields:s,groupByFieldsForStatistics:r,outStatistics:a}=e;if(n)for(let e=0;e<n.length;e++)n[e]=n[e].trim();if(s)for(let e=0;e<s.length;e++)s[e]=s[e].trim();if(r)for(let e=0;e<r.length;e++)r[e]=r[e].trim();if(a)for(let e=0;e<a.length;e++)a[e].onStatisticField&&(a[e].onStatisticField=a[e].onStatisticField.trim());return e.geometry&&!e.outSR&&(e.outSR=e.geometry.spatialReference),g(e,t,i)}async function g(e,t,s){if(!e)return null;let{where:a}=e;if(e.where=a=a?.trim(),(!a||/^1 *= *1$/.test(a)||t&&t===a)&&(e.where=null),!e.geometry)return e;let h=await async function(e){const{distance:t,units:s}=e,a=e.geometry;if(null==t||"vertexAttributes"in a)return a;const o=a.spatialReference,u=s?p.fromJSON(s):(0,r.Ij)(o),f=o&&((0,c.EA)(o)||(0,c.K8)(o))?a:await(0,d.Nk)(o,c.KK).then(()=>(0,d.Cv)(a,c.KK)),h=await i.e(9159).then(i.bind(i,49159));await h.load();const m=h.execute(f,t||1,{unit:u})??void 0;if(!m||!(0,l.Bi)(m)||0===m.rings.length)throw new n.A("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return m}(e);if(e.distance=0,e.units=null,"esriSpatialRelEnvelopeIntersects"===e.spatialRel){const{spatialReference:t}=e.geometry;h=(0,o.HA)(h),h.spatialReference=t}if(h){await(0,d.Nk)(h.spatialReference,s),h=function(e,t){const i=e.spatialReference;return x(e,t)&&(0,l.ZC)(e)?{spatialReference:i,rings:[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]}:e}(h,s);const t=(await(0,u.el)((0,l.rS)(h)))[0];if(null==t)throw f;const i="quantizationParameters"in e&&e.quantizationParameters?.tolerance||"maxAllowableOffset"in e&&e.maxAllowableOffset||0,n=i&&x(h,s)?{extendedParams:{densificationStep:8*i}}:void 0,r=t.toJSON(),a=(0,d.Cv)(r,r.spatialReference,s,n);if(!a)throw f;a.spatialReference=s,e.geometry=a}return e}function x(e,t){if(!e)return!1;const i=e.spatialReference;return((0,l.ZC)(e)||(0,l.Bi)(e)||(0,l.Rg)(e))&&!(0,c.aI)(i,t)&&!(0,a.canProjectWithoutEngine)(i,t)}function F(e,t){return null==e?null:"string"==typeof e?t?new Date(`1970-01-01T${e}Z`).getTime():new Date(e).getTime():e instanceof Date?e.getTime():e}},59977:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266),c=i(69540),d=i(25482),p=i(57231);let f=class extends((0,c.OU)(d.o)){constructor(e){super(e),this.value=null,this.unit=null}};(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"number",write:!0}})],f.prototype,"value",void 0),(0,n.Cg)([(0,o.e)(p.g)],f.prototype,"unit",void 0),f=(0,n.Cg)([(0,l.$)("esri.rest.support.DateBinTimeInterval")],f);const h=f;function m(e,t,i){(0,s.sM)(i,"string"==typeof e?e:e?.getTime(),t)}function y(e,t){const i=e.parameters[t];return i?"string"==typeof i?i:new Date(i):null}f.from=(0,a.dp)(f);let g=class extends u.A{constructor(e){super(e),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=!1,this.start=null,this.snapToData=null,this.type="date"}};(0,n.Cg)([(0,r.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.end",read:{reader:(e,t)=>y(t,"end")},write:{writer:m}}})],g.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({type:h,json:{name:"parameters",write:!0}})],g.prototype,"interval",void 0),(0,n.Cg)([(0,r.MZ)({type:h,json:{name:"parameters.offset",write:!0}})],g.prototype,"offset",void 0),(0,n.Cg)([(0,r.MZ)({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],g.prototype,"returnFullIntervalBin",void 0),(0,n.Cg)([(0,r.MZ)({cast:e=>null!=e?"string"==typeof e?e:new Date(e):null,json:{name:"parameters.start",read:{reader:(e,t)=>y(t,"start")},write:{writer:m}}})],g.prototype,"start",void 0),(0,n.Cg)([(0,r.MZ)({type:String,json:{name:"parameters.snapToData",write:!0}})],g.prototype,"snapToData",void 0),(0,n.Cg)([(0,o.e)({dateBin:"date"},{readOnly:!0})],g.prototype,"type",void 0),g=(0,n.Cg)([(0,l.$)("esri.rest.support.DateBinParameters")],g),g.from=(0,a.dp)(g)},60909:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(31635),s=i(93637),r=i(10107),a=i(56507),o=(i(44208),i(87811),i(93223)),l=i(64108),u=i(41266),c=i(41366);function d(e,t,i){(0,s.sM)(i,e instanceof Date?e.getTime():e,t)}let p=class extends((0,c.K)(u.A)){constructor(e){super(e),this.end=null,this.interval=null,this.start=null,this.type="fixed-interval"}};(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.end",write:{writer:d}}})],p.prototype,"end",void 0),(0,n.Cg)([(0,r.MZ)({type:Number,json:{name:"parameters.interval",write:!0}})],p.prototype,"interval",void 0),(0,n.Cg)([(0,r.MZ)({json:{name:"parameters.start",write:{writer:d}}})],p.prototype,"start",void 0),(0,n.Cg)([(0,o.e)({fixedIntervalBin:"fixed-interval"},{readOnly:!0})],p.prototype,"type",void 0),p=(0,n.Cg)([(0,l.$)("esri.rest.support.FixedIntervalBinParameters")],p),p.from=(0,a.dp)(p)},62660:(e,t,i)=>{i.d(t,{tC:()=>_,c0:()=>F,xt:()=>x});var n=i(49186),s=i(94078),r=i(12176),a=i(65864),o=i(21325);function l(e,t){return c(e,t.coords[0],t.coords[1])}function u(e,t){const{coords:i,lengths:n,stride:s}=t;if(!n)return!1;for(let t=0,r=0;t<n.length;t++,r+=s)if(!c(e,i[r],i[r+1]))return!1;return!0}function c(e,t,i){if(!e)return!1;const{coords:n,lengths:s,stride:r}=e;let a=!1,o=0;for(const e of s)a=d(a,n,r,o,e,t,i),o+=e*r;return a}function d(e,t,i,n,s,r,a){let o=e,l=n;for(let e=n,u=n+s*i;e<u;e+=i){l=e+i,l===u&&(l=n);const s=t[e],c=t[e+1],d=t[l],p=t[l+1];(c<a&&p>=a||p<a&&c>=a)&&s+(a-c)/(p-c)*(d-s)<r&&(o=!o)}return o}var p=i(90708),f=i(51441),h=i(31464);const m="unsupported-query",y={spatialRelationship:{esriSpatialRelIntersects:!0,esriSpatialRelContains:!0,esriSpatialRelWithin:!0,esriSpatialRelCrosses:!0,esriSpatialRelDisjoint:!0,esriSpatialRelTouches:!0,esriSpatialRelOverlaps:!0,esriSpatialRelEnvelopeIntersects:!0,esriSpatialRelIndexIntersects:!1,esriSpatialRelRelation:!1},queryGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!1,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!0},layerGeometry:{esriGeometryPoint:!0,esriGeometryMultiPatch:!0,esriGeometryMultipoint:!0,esriGeometryPolyline:!0,esriGeometryPolygon:!0,esriGeometryEnvelope:!1}},g={esriSpatialRelIntersects:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(7360)]).then(i.bind(i,55284)),esriSpatialRelContains:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1867)]).then(i.bind(i,29127)),esriSpatialRelCrosses:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(9700)]).then(i.bind(i,85672)),esriSpatialRelDisjoint:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1598)]).then(i.bind(i,7978)),esriSpatialRelEnvelopeIntersects:null,esriSpatialRelIndexIntersects:null,esriSpatialRelOverlaps:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(1414)]).then(i.bind(i,46178)),esriSpatialRelTouches:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(2503)]).then(i.bind(i,83547)),esriSpatialRelWithin:()=>Promise.all([i.e(3661),i.e(1878),i.e(9117),i.e(3299),i.e(9265)]).then(i.bind(i,85445)),esriSpatialRelRelation:null};async function x(e,t,i){if((0,a.Bi)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e)){const e=(0,p.Ye)(t,!1,!1);return t=>l(e,t)}if("esriGeometryMultipoint"===i){const i=(0,p.Ye)(t,!1,!1);if("esriSpatialRelContains"===e)return e=>u(i,e)}}if((0,a.ZC)(t)){if("esriGeometryPoint"===i&&("esriSpatialRelIntersects"===e||"esriSpatialRelContains"===e))return e=>(0,s.qz)(t,(0,f.pL)(i,e));if("esriGeometryMultipoint"===i&&"esriSpatialRelContains"===e)return e=>(0,s.rL)(t,(0,f.pL)(i,e));if("esriSpatialRelIntersects"===e){const e="mesh"===(n=i)?r.xB:(0,r.xK)(n);return n=>e(t,(0,f.pL)(i,n))}}var n;"esriSpatialRelEnvelopeIntersects"===e&&(e="esriSpatialRelIntersects");const o=await function(e){const t=g[e];if(null==t)throw new Error(`Cannot load unsupported spatial operator: ${e}`);return t()}(e);return e=>o.execute(t,(0,f.pL)(i,e))}async function F(e,t,i){const{spatialRel:s,geometry:r}=e;if(r){if(null==(l=s)||!0!==y.spatialRelationship[l])throw new n.A(m,"Unsupported query spatial relationship",{query:e});if((0,o.fn)(r.spatialReference)&&(0,o.fn)(i)){if(!function(e){return null!=e&&!0===y.queryGeometry[(0,a.$B)(e)]}(r))throw new n.A(m,"Unsupported query geometry type",{query:e});if(!function(e){return null!=e&&!0===y.layerGeometry[e]}(t))throw new n.A(m,"Unsupported layer geometry type",{query:e});if(e.outSR)return(0,h.Nk)(e.geometry?.spatialReference,e.outSR)}}var l}function _(e){if((0,a.ZC)(e))return!0;if((0,a.Bi)(e)){for(const t of e.rings){if(5!==t.length)return!1;if(t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1}return!0}return!1}},62815:(e,t,i)=>{i.d(t,{N:()=>a});var n=i(83047),s=i(73941),r=i(21325);function a(e,t,i){if(null==t||null==i||i.vcsWkid||(0,r.aI)(t,i)||(0,s.xP)(t)||(0,s.xP)(i))return null;const a=(0,n.G9)(t)/(0,n.G9)(i);if(1===a)return null;switch(e){case"point":case"esriGeometryPoint":return e=>function(e,t){null!=e?.z&&(e.z*=t)}(e,a);case"polyline":case"esriGeometryPolyline":return e=>function(e,t){if(e)for(const i of e.paths)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"polygon":case"esriGeometryPolygon":return e=>function(e,t){if(e)for(const i of e.rings)for(const e of i)e.length>2&&(e[2]*=t)}(e,a);case"multipoint":case"esriGeometryMultipoint":return e=>function(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}(e,a);case"extent":case"esriGeometryEnvelope":return e=>function(e,t){e&&null!=e.zmin&&null!=e.zmax&&(e.zmin*=t,e.zmax*=t)}(e,a);default:return null}}},69052:(e,t,i)=>{i.d(t,{hr:()=>s,ie:()=>l,uC:()=>o});var n=i(34727);class s{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,i=!1){return r(this.range,this.min,this.max,e,t,i)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,i){return e<t?t:t+a(this.range,e-t,i)}minimalMonotonic(e,t,i){return r(this.range,e,e+this.range,t,i)}center(e,t,i){return t=this.monotonic(e,t,i),this.normalize((e+t)/2,i)}diff(e,t,i){return this.monotonic(e,t,i)-e}shortestSignedDiff(e,t){e=this.normalize(e);const i=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(i)<Math.abs(n)?i:n}contains(e,t,i){return t=this.minimalMonotonic(e,t),(i=this.minimalMonotonic(e,i))>e&&i<t}}function r(e,t,i,n,s=0,r=!1){return(n-=s)<t?n+=a(e,t-n):n>i&&(n-=a(e,n-i)),r&&n===i&&(n=t),n+s}function a(e,t,i=0){return Math.ceil((t-i)/e)*e+i}const o=new s(0,2*Math.PI),l=(new s(-Math.PI,Math.PI),new s(0,360))},70328:(e,t,i)=>{i.d(t,{BI:()=>F,DC:()=>d,Ej:()=>f,Ie:()=>g,Jt:()=>x,Ne:()=>h,RF:()=>c,aI:()=>v,fA:()=>a,gE:()=>l,hZ:()=>y,iT:()=>p,is:()=>_,qv:()=>w,vI:()=>m,vY:()=>o,v_:()=>S,vt:()=>r,w1:()=>u});var n=i(5443),s=(i(19419),i(4197));function r(e=S){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function a(e,t,i,n,s,a,o=r()){return o[0]=e,o[1]=t,o[2]=i,o[3]=n,o[4]=s,o[5]=a,o}function o(e,t=r()){return function(e,t,i,n=r()){return y(n,w),function(e,t,i=0,n=t.length/3){let s=e[0],r=e[1],a=e[2],o=e[3],l=e[4],u=e[5];for(let e=0;e<n;e++)s=Math.min(s,t[i+3*e]),r=Math.min(r,t[i+3*e+1]),a=Math.min(a,t[i+3*e+2]),o=Math.max(o,t[i+3*e]),l=Math.max(l,t[i+3*e+1]),u=Math.max(u,t[i+3*e+2]);e[0]=s,e[1]=r,e[2]=a,e[3]=o,e[4]=l,e[5]=u}(n,e,t,i),n}(e,0,e.length/3,t)}function l(e,t=(0,s.jh)(24)){const[i,n,r,a,o,l]=e;return t[0]=i,t[1]=n,t[2]=r,t[3]=i,t[4]=n,t[5]=l,t[6]=i,t[7]=o,t[8]=r,t[9]=i,t[10]=o,t[11]=l,t[12]=a,t[13]=n,t[14]=r,t[15]=a,t[16]=n,t[17]=l,t[18]=a,t[19]=o,t[20]=r,t[21]=a,t[22]=o,t[23]=l,t}function u(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new n.A(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function c(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function d(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[3]=Math.max(e[3],t[2]),e[4]=Math.max(e[4],t[3])}function p(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function f(e,t=[0,0,0]){return t[0]=function(e){return e[0]>=e[3]?0:e[3]-e[0]}(e),t[1]=function(e){return e[1]>=e[4]?0:e[4]-e[1]}(e),t[2]=function(e){return e[2]>=e[5]?0:e[5]-e[2]}(e),t}function h(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function m(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function y(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function g(e){return e?y(e,w):r(w)}function x(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function F(e,t,i,n,s){return e[0]=t,e[1]=i,e[2]=Number.NEGATIVE_INFINITY,e[3]=n,e[4]=s,e[5]=Number.POSITIVE_INFINITY,e}function _(e){return 6===e.length}function v(e,t,i){if(null==e||null==t)return e===t;if(!_(e)||!_(t))return!1;if(i){for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1}else for(let i=0;i<e.length;i++)if(e[i]!==t[i])return!1;return!0}const w=[1/0,1/0,1/0,-1/0,-1/0,-1/0],S=[0,0,0,0,0,0];r()},80754:(e,t,i)=>{i.d(t,{j7:()=>a,kS:()=>l,kd:()=>o,r8:()=>u});var n=i(82799),s=i(16930),r=i(65864);const a={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:s.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:s.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:s.A.WGS84})}};function o(e,t){return Math.ceil((e-t)/(2*t))}function l(e,t){const i=u(e);for(const e of i)for(const i of e)i[0]+=t;return e}function u(e){return(0,r.Bi)(e)?e.rings:e.paths}},86420:(e,t,i)=>{i.d(t,{I:()=>r,W:()=>s});var n=i(21818);async function s(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:s,endTimeField:r}=e;let a=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY;if(s&&r)await t.forEach(e=>{const t=i.getAttribute((0,n.zI)(e),s),l=i.getAttribute((0,n.zI)(e),r);null==t||isNaN(t)||(a=Math.min(a,t)),null==l||isNaN(l)||(o=Math.max(o,l))});else{const e=s||r;await t.forEach(t=>{const s=i.getAttribute((0,n.zI)(t),e);null==s||isNaN(s)||(a=Math.min(a,s),o=Math.max(o,s))})}return{start:a,end:o}}function r(e,t,i){if(!t||!e)return null;const{startTimeField:n,endTimeField:s}=e;if(!n&&!s)return null;const{start:r,end:a}=t;if(null===r&&null===a)return null;if(void 0===r&&void 0===a)return()=>!1;const o=i.getAttributeAsTimestamp?.bind(i)??i.getAttribute.bind(i);return n&&s?function(e,t,i,n,s){return null!=n&&null!=s?r=>{const a=e(r,t),o=e(r,i);return(null==a||a<=s)&&(null==o||o>=n)}:null!=n?t=>{const s=e(t,i);return null==s||s>=n}:null!=s?i=>{const n=e(i,t);return null==n||n<=s}:void 0}(o,n,s,r,a):function(e,t,i,n){return null!=i&&null!=n&&i===n?n=>e(n,t)===i:null!=i&&null!=n?s=>{const r=e(s,t);return null!=r&&r>=i&&r<=n}:null!=i?n=>{const s=e(n,t);return null!=s&&s>=i}:null!=n?i=>{const s=e(i,t);return null!=s&&s<=n}:void 0}(o,n||s,r,a)}},91218:(e,t,i)=>{i.r(t),i.d(t,{canProjectWithoutEngine:()=>k,initializeProjection:()=>$,isEqualBaseGCS:()=>L,isLoaded:()=>z,isLoadedOrLoad:()=>C,isLoadedOrLoadFor:()=>B,load:()=>O,project:()=>q,projectExtent:()=>ie,projectMany:()=>G,projectMultipoint:()=>W,projectOrLoad:()=>P,projectOrLoadMany:()=>E,projectPoint:()=>H,projectPolygon:()=>ee,projectPolyline:()=>Y,projectWithZConversion:()=>Q,projectWithoutEngine:()=>U,requiresLoad:()=>N,test:()=>V,tryProjectWithZConversion:()=>Z,unload:()=>D});var n=i(49186),s=i(74887),r=i(62788),a=i(95488),o=i(51850),l=i(21276),u=i(73941),c=i(5443),d=i(91075),p=i(48526),f=i(86738),h=i(39829),m=i(82799),y=i(16930),g=i(159),x=i(9762),F=i(37539);function _(e,t,i,n,s,r){return v[0]=e,v[1]=t,v[2]=i,(0,x.projectBuffer)(v,n,0,s,r,0)}const v=(0,o.vt)();var w=i(21325),S=i(62815);let I=null,R=null,T=null,M=null,b={};const A=new a.I;function z(){return!!(R?.isLoaded()&&T?.isLoaded()&&M?.isLoaded())}function C(){return!!z()||((0,r.gc)(A),O(),!1)}function B(e,t){return!e||!t||k(e,t)||C()}function N(e,t){return!k(e,t)&&!z()}async function O(e){null==I&&(I=Promise.all([i.e(3276).then(i.bind(i,83276)).then(e=>(R=e,R.load())),i.e(8377).then(i.bind(i,8377)).then(e=>(T=e,T.load())),i.e(2158).then(i.bind(i,12158)).then(e=>(M=e,M.load()))])),await I,(0,s.Te)(e),A.notify()}function q(e,t,i){return Array.isArray(e)?0===e.length?[]:((0,l.H)(e),G(e,e[0].spatialReference,t,i)):((0,l.f)(e),G([e],e.spatialReference,t,i)[0])}function G(e,t,i,n){if(null==t||null==i)return e;if(k(t,i,n))return e.map(e=>U(e,t,i));if(null==n?.geographicTransformation&&(0,u.jA)(t))return e.map(e=>U(e,t,y.A.WGS84)).map(e=>Z(e,i));if(null==n?.geographicTransformation&&(0,u.jA)(i))return e.map(e=>Z(e,y.A.WGS84)).map(e=>U(e,y.A.WGS84,i));if(!z())throw new j;if(!n?.geographicTransformation)if(n?.extendedParams)n={...n,geographicTransformation:M.getTransformation(t,i,n.areaOfInterestExtent)||new g.A};else if(!n?.areaOfInterestExtent){const e=function(e,t){return[e.wkid?.toString()??"-1",e.wkt?.toString()??"",e.wkt2?.toString()??"",t.wkid?.toString()??"-1",t.wkt?.toString()??"",t.wkt2?.toString()??""].join()}(t,i);let s=b[e];s||(s=M.getTransformation(t,i)||new g.A,b[e]=s),n={geographicTransformation:s}}return e[0].spatialReference||(e[0].spatialReference=t),e[0]instanceof d.A?R.executeMany(e,i,n):T.executeMany(e,i,n)}function P(e,t){const i=E([e],t);return null!=i.pending?{pending:i.pending,geometry:null}:null!=i.geometries?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function E(e,t){if(!z())for(const i of e)if(null!=i&&!(0,w.aI)(i.spatialReference,t)&&(0,w.fn)(i.spatialReference)&&(0,w.fn)(t)&&!k(i.spatialReference,t))return(0,r.gc)(A),{pending:O(),geometries:null};return{pending:null,geometries:e.map(e=>null==e?null:(0,w.aI)(e.spatialReference,t)?e:(0,w.fn)(e.spatialReference)&&(0,w.fn)(t)?Z(e,t):null)}}class j extends n.A{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}function D(){I=null,R=null,T=null,M=null,b={}}const V={get loadPromise(){return I}};function Z(e,t){try{const i=q(e,t);if(null==i)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const n=(0,S.N)(i.type,e.spatialReference,t);return null!=n&&n(i),i}catch(e){if(!(e instanceof j))throw e;return null}}async function Q(e,t,i){const n=e.spatialReference;return null!=n&&null!=t&&await $(n,t,null,i),Z(e,t)}function k(e,t,i){return!(i?.areaOfInterestExtent||i?.extendedParams||i?.geographicTransformation)&&(!!(0,w.aI)(e,t)||(0,w.fn)(e)&&(0,w.fn)(t)&&!!(0,F.jd)(e,t))}function L(e,t){if((0,w.aI)(e,t))return!0;if(!(0,w.fn)(e)||!(0,w.fn)(t))return!1;const i=(0,w.oT)(e)||(0,w.K8)(e)||(0,w.x1)(e),n=(0,w.oT)(t)||(0,w.K8)(t)||(0,w.x1)(t);return i&&n}async function $(e,t,i,n){if(z())return(0,s.NO)(n);if(Array.isArray(e)){for(const{source:t,dest:i,options:s}of e)if(t&&i&&!k(t,i,s))return O(n)}else if(e&&t&&!k(e,t,i))return O(n);return(0,s.NO)(n)}function U(e,t,i){return e?"x"in e?J(e,t,new f.A,i,0):"xmin"in e?ne(e,t,new c.A,i,0):"rings"in e?te(e,t,new h.A,i,0):"paths"in e?X(e,t,new m.A,i,0):"points"in e?K(e,t,new p.A,i,0):null:null}function H(e,t,i=t.spatialReference,n=0){return null!=i&&null!=e.spatialReference&&null!=J(e,e.spatialReference,t,i,n)}function J(e,t,i,n,s){re[0]=e.x,re[1]=e.y;const r=e.z;return re[2]=void 0!==r?r:s,(0,x.projectBuffer)(re,t,0,re,n,0)?(i.x=re[0],i.y=re[1],i.spatialReference=n,void 0!==r||(0,u.xP)(n)?(i.z=re[2],i.hasZ=!0):(i.z=void 0,i.hasZ=!1),void 0===e.m?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function W(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=K(e,e.spatialReference,t,i,n)}function K(e,t,i,n,s){const{points:r,hasZ:a,hasM:o}=e,l=[],c=r.length,d=[];for(const e of r)d.push(e[0],e[1],a?e[2]:s);if(!(0,x.projectBuffer)(d,t,0,d,n,0,c))return null;const p=a||(0,u.xP)(n);for(let e=0;e<c;++e){const t=3*e,i=d[t],n=d[t+1];p&&o?l.push([i,n,d[t+2],r[e][3]]):p?l.push([i,n,d[t+2]]):o?l.push([i,n,r[e][2]]):l.push([i,n])}return i.points=l,i.spatialReference=n,i.hasZ=a,i.hasM=o,i}function Y(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=X(e,e.spatialReference,t,i,n)}function X(e,t,i,n,s){const{paths:r,hasZ:a,hasM:o}=e,l=[];if(!se(r,a??!1,o??!1,t,l,n,s))return null;const c=a||(0,u.xP)(n);return i.paths=l,i.spatialReference=n,i.hasZ=c,i.hasM=o,i}function ee(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=te(e,e.spatialReference,t,i,n)}function te(e,t,i,n,s){const{rings:r,hasZ:a,hasM:o}=e,l=[];if(!se(r,a??!1,o??!1,t,l,n,s))return null;const c=a||(0,u.xP)(n);return i.rings=l,i.spatialReference=n,i.hasZ=c,i.hasM=o,i}function ie(e,t,i=t.spatialReference,n=0){return null!=e.spatialReference&&null!=i&&null!=ne(e,e.spatialReference,t,i,n)}function ne(e,t,i,n,s){const{xmin:r,ymin:a,xmax:o,ymax:l,hasZ:c,hasM:d}=e;if(!_(r,a,c?e.zmin:s,t,re,n))return null;const p=c||(0,u.xP)(n);return i.xmin=re[0],i.ymin=re[1],p&&(i.zmin=re[2]),_(o,l,c?e.zmax:s,t,re,n)?(i.xmax=re[0],i.ymax=re[1],p&&(i.zmax=re[2]),d&&(i.mmin=e.mmin,i.mmax=e.mmax),i.spatialReference=n,i):null}function se(e,t,i,n,s,r,a=0){const o=new Array;for(const i of e)for(const e of i)o.push(e[0],e[1],t?e[2]:a);if(!(0,x.projectBuffer)(o,n,0,o,r,0))return!1;let l=0;s.length=0;const c=t||(0,u.xP)(r);for(const t of e){const e=new Array;for(const n of t)c&&i?e.push([o[l++],o[l++],o[l++],n[3]]):c?e.push([o[l++],o[l++],o[l++]]):i?(e.push([o[l++],o[l++],n[2]]),l++):(e.push([o[l++],o[l++]]),l++);s.push(e)}return!0}const re=(0,o.vt)()},92300:(e,t,i)=>{i.d(t,{V:()=>r,X:()=>s});var n=i(65864);function s(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function r(e,t,i){const s=(0,n.xD)(t);return e.map(e=>{const t=s.fromJSON(e);return t.spatialReference=i,t})}},95466:(e,t,i)=>{i.d(t,{A:()=>f});var n=i(49186),s=i(53966),r=i(91869),a=i(3330),o=i(12195),l=i(30524),u=i(98623),c=i(56400),d=i(28097);const p=new Map;class f{static fromJSON(e){return new f(e.fields,e.timeZoneByFieldName)}static fromLayer(e){return new f(e.fields??[],g(e))}static fromLayerJSON(e){return new f(e.fields??[],g(e))}constructor(e=[],t){this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this._requiredFields=null,this.dateFields=[],this.numericFields=[],this.fields=e||[],this._timeZoneByFieldName=t?new Map(t):null;const i=[];for(const e of this.fields){const t=e?.name,n=m(t);if(t&&n){const s=h(t);this._fieldsMap.set(t,e),this._fieldsMap.set(s,e),this._normalizedFieldsMap.set(n,e),i.push(`${s}:${e.type}:${this._timeZoneByFieldName?.get(t)}`),(0,l.vE)(e)?(this.dateFields.push(e),this._dateFieldsSet.add(e)):(0,l.WA)(e)&&(this._numericFieldsSet.add(e),this.numericFields.push(e)),(0,l.te)(e)||(0,l.Xz)(e)||(e.editable=null==e.editable||!!e.editable,e.nullable=null==e.nullable||!!e.nullable)}}i.sort(),this.uid=i.join()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const e of this.fields)(0,l.te)(e)||(0,l.Xz)(e)||e.nullable||void 0!==(0,l.lD)(e)||this._requiredFields.push(e)}return this._requiredFields}equals(e){return this.uid===e?.uid}has(e){return null!=this.get(e)}get(e){if(!e)return;let t=this._fieldsMap.get(e);return t||(t=this._fieldsMap.get(h(e))??this._normalizedFieldsMap.get(m(e)),t&&this._fieldsMap.set(e,t),t)}getTimeZone(e){const t=this.get(e&&"string"!=typeof e?e.name:e);return t?this._timeZoneByFieldName?this._timeZoneByFieldName.get(t.name):"date"===t.type||"esriFieldTypeDate"===t.type?(s.A.getLogger("esri.layers.support.FieldsIndex").errorOnce(new n.A("getTimeZone:no-timezone-information",`no time zone information for field '${t.name}'`)),u.n$):y.has(t.type)?u.L5:null:null}getLuxonTimeZone(e){const t=this.getTimeZone(e);return t?t===u.L5?a.GB.instance:t===u.n$?d.mQ.utcInstance:(0,r.tE)(p,t,()=>d.oh.create(t)):null}isDateField(e){return this._dateFieldsSet.has(this.get(e))}isTimeOnlyField(e){return(0,l.OH)(this.get(e))}isNumericField(e){return this._numericFieldsSet.has(this.get(e))}normalizeFieldName(e){return this.get(e)?.name??void 0}toJSON(){return{fields:this.fields.map(e=>(0,o.W)(e)?e.toJSON():e),timeZoneByFieldName:this._timeZoneByFieldName?Array.from(this._timeZoneByFieldName.entries()):null}}}function h(e){return e.trim().toLowerCase()}function m(e){return(0,l.rS)(e)?.toLowerCase()??""}const y=new Set(["time-only","date-only","timestamp-offset","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"]);function g(e){const t=new Map;if(!e.fields)return t;const i=!0===e.datesInUnknownTimezone,{timeInfo:n,editFieldsInfo:s}=e,r=(n?"startField"in n?n.startField:n.startTimeField:"")??"",a=(n?"endField"in n?n.endField:n.endTimeField:"")??"",o=function(e){return"dateFieldsTimeZone"in e}(e)?e.dateFieldsTimeZone??null:e.dateFieldsTimeReference?(0,c.ZS)(e.dateFieldsTimeReference):null,l=s?function(e){return"timeZone"in e}(s)?s.timeZone??o:s.dateFieldsTimeReference?(0,c.ZS)(s.dateFieldsTimeReference):o??u.n$:null,d=n?function(e){return"timeZone"in e}(n)?n.timeZone??o:n.timeReference?(0,c.ZS)(n.timeReference):o:null,p=new Map([[h(s?.creationDateField??""),l],[h(s?.editDateField??""),l],[h(r),d],[h(a),d]]);for(const{name:n,type:s}of e.fields)if(y.has(s))t.set(n,u.L5);else if("date"!==s&&"esriFieldTypeDate"!==s)t.set(n,null);else if(i)t.set(n,u.L5);else{const e=p.get(h(n??""))??o;t.set(n,e)}return t}},99157:(e,t,i)=>{i.d(t,{A:()=>l});var n,s=i(31635),r=i(69622),a=i(10107),o=(i(44208),i(53966),i(87811),i(64108));let l=n=class extends r.A{constructor(e){super(e),this.isInverse=!1,this.wkt=null,this.wkid=null}getInverse(){return new n({isInverse:!this.isInverse,wkid:this.wkid,wkt:this.wkt})}};(0,s.Cg)([(0,a.MZ)()],l.prototype,"isInverse",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"wkt",void 0),(0,s.Cg)([(0,a.MZ)()],l.prototype,"wkid",void 0),l=n=(0,s.Cg)([(0,o.$)("esri.geometry.operators.support.GeographicTransformationStep")],l)},99352:(e,t,i)=>{i.d(t,{F:()=>n,P:()=>s});const n={supportsStatistics:!0,supportsPercentileStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsCentroid:!0,supportsCentroidOnDegeneratedQuantizedGeometry:!0,supportsCacheHint:!0,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!0,supportsDistinct:!0,supportsExtent:!0,supportsGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsPaginationOnAggregatedQueries:!1,supportsQuantization:!0,supportsQuantizationEditMode:!1,supportsQueryGeometry:!0,supportsResultType:!0,supportsReturnMesh:!1,supportsSqlExpression:!0,supportsMaxRecordCountFactor:!1,supportsStandardizedQueriesOnly:!0,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!0,supportsQueryByOthers:!0,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!0,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,maxRecordCountFactor:void 0,maxRecordCount:void 0,maxUniqueIDCount:void 0,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},s={supportsDate:!0,supportsFixedInterval:!0,supportsAutoInterval:!0,supportsFixedBoundaries:!0,supportsStackBy:!0,supportsSplitBy:!0,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!0,supportedStatistics:{count:!0,sum:!0,avg:!0,var:!0,stddev:!0,min:!0,max:!0,percentileContinuous:!0,percentileDiscrete:!0,envelope:!0,centroid:!0,convexHull:!0},supportedNormalizationTypes:{field:!0,log:!0,naturalLog:!0,percentOfTotal:!0,squareRoot:!0}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[1698,7375],{21015:(e,t,r)=>{r.d(t,{R:()=>u});var n=r(43773),o=r(60999),s=r(49186),a=r(74887),i=r(84952);class u{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,i.DB)(e)?((0,a.Te)(t),(0,i.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const i=await(0,o.Ke)((0,n.A)(t,{responseType:e,...r}));if(i.ok)return i.value.data;throw(0,a.QP)(i.error),new s.A("gltf-loader-request-error",`Request for resource failed: ${i.error}`)}}},24045:(e,t,r)=>{function n(e,t){const r=e.count;t||(t=new e.TypedArrayConstructor(r));for(let n=0;n<r;n++)t[n]=e.get(n);return t}r.d(t,{m:()=>n}),Object.freeze(Object.defineProperty({__proto__:null,makeDense:n},Symbol.toStringTag,{value:"Module"}))},43609:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>a,n:()=>o});var n=r(34275);function o(e,t){s(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r=2,o=r){const s=t.length/2;let a=0,i=0;if(!(0,n.iu)(t)||(0,n.dk)(t)){for(let n=0;n<s;++n)e[a]=t[i],e[a+1]=t[i+1],a+=r,i+=o;return}const u=(0,n.a3)(t);if((0,n.JI)(t))for(let n=0;n<s;++n)e[a]=Math.max(t[i]/u,-1),e[a+1]=Math.max(t[i+1]/u,-1),a+=r,i+=o;else for(let n=0;n<s;++n)e[a]=t[i]/u,e[a+1]=t[i+1]/u,a+=r,i+=o}function a(e,t,r,n){const o=e.typedBuffer,s=e.typedBufferStride,a=n?.count??e.count;let i=(n?.dstIndex??0)*s;for(let e=0;e<a;++e)o[i]=t,o[i+1]=r,i+=s}Object.freeze(Object.defineProperty({__proto__:null,fill:a,normalizeIntegerBuffer:s,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},46140:(e,t,r)=>{r.d(t,{R:()=>o});var n=r(49186);let o=class e{constructor(e,t,r=""){this.major=e,this.minor=t,this._context=r}lessThan(e,t){return this.major<e||e===this.major&&this.minor<t}greaterEqual(e,t){return!this.lessThan(e,t)}validate(e){if(this.major!==e.major){const t=this._context&&this._context+":",r=this._context&&this._context+" ";throw new n.A(t+"unsupported-version",`Required major ${r}version is '${this.major}', but got '\${version.major}.\${version.minor}'`,{version:e})}}clone(){return new e(this.major,this.minor,this._context)}static parse(t,r=""){const[o,s]=t.split("."),a=/^\s*\d+\s*$/;if(!o?.match||!a.test(o))throw new n.A((r&&r+":")+"invalid-version","Expected major version to be a number, but got '${version}'",{version:t});if(!s?.match||!a.test(s))throw new n.A((r&&r+":")+"invalid-version","Expected minor version to be a number, but got '${version}'",{version:t});const i=parseInt(o,10),u=parseInt(s,10);return new e(i,u,r)}}},51530:(e,t,r)=>{r.d(t,{KB:()=>a,Xi:()=>o,pn:()=>i,x3:()=>s});var n=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function s(e){return"encoded-mesh-texture"===e?.type}async function a(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function i(e,t){if("image/ktx2"===t)return new o(e);const r=new Blob([e],{type:t});let s=URL.createObjectURL(r);switch(t){case"image/jpeg":s+="#.jpg";break;case"image/png":s+="#.png"}const a=new Image;if((0,n.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{o(),e(a)},n=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(s),a.removeEventListener("load",r),a.removeEventListener("error",n)};a.addEventListener("load",r),a.addEventListener("error",n),a.src=s});try{a.src=s,await a.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(s),a}},51698:(e,t,r)=>{r.d(t,{loadGLTF:()=>H});var n=r(53966),o=r(93637),s=r(9093),a=r(49186),i=r(91869),u=r(74887),l=r(84952),c=r(46140),f=r(58083),d=r(67026),p=r(82534),m=r(13030),h=r(24045),T=(r(44208),r(2741));let _;function y(){return _??=(async()=>{const{default:e}=await r.e(2423).then(r.bind(r,2423));return await e({locateFile:e=>(0,T.s)(`esri/libs/dracoMeshDecoder/${e}`)})})(),_}class g{constructor(e){this._data=e,this._offset4=0,this._dataUint32=new Uint32Array(this._data,0,Math.floor(this._data.byteLength/4))}readUint32(){const e=this._offset4;return this._offset4+=1,this._dataUint32[e]}readUint8Array(e){const t=4*this._offset4;return this._offset4+=e/4,new Uint8Array(this._data,t,e)}remainingBytes(){return this._data.byteLength-4*this._offset4}}var w=r(21818);const b={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1},x={pbrMetallicRoughness:b,emissiveFactor:[0,0,0],alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1},S={ESRI_externalColorMixMode:"tint",ESRI_receiveShadows:!0,ESRI_receiveAmbientOcclusion:!0},R=(e={})=>{const t={...b,...e.pbrMetallicRoughness},r=function(e){switch(e.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:(0,w.Xb)(e.ESRI_externalColorMixMode),e.ESRI_externalColorMixMode="tint"}return e}({...S,...e.extras});return{...x,...e,pbrMetallicRoughness:t,extras:r}},A={magFilter:9729,minFilter:9987,wrapS:10497,wrapT:10497},E=e=>({...A,...e});var O=r(51530),N=r(63907);const I=1179937895;class v{constructor(e,t,r,n){if(this._context=e,this.uri=t,this.json=r,this._glbBuffer=n,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._dracoBuffersSize=0,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._supportedExtensions=["KHR_texture_basisu","KHR_texture_transform","KHR_draco_mesh_compression"],this._baseUri=function(e){let t,r;return e.replace(/^(.*\/)?([^/]*)$/,(e,n,o)=>(t=n||"",r=o||"","")),{dirPart:t,filePart:r}}(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),null==r.scenes)throw new a.A("gltf-loader-unsupported-feature","Scenes must be defined.");if(null==r.meshes)throw new a.A("gltf-loader-unsupported-feature","Meshes must be defined");if(null==r.nodes)throw new a.A("gltf-loader-unsupported-feature","Nodes must be defined.");this._computeNodeParents()}static async load(e,t,r){if((0,l.DB)(t)){const r=(0,l.r$)(t);if(r&&"model/gltf-binary"!==r.mediaType)try{const n=JSON.parse(r.isBase64?atob(r.data):r.data);return new v(e,t,n)}catch{}const n=(0,l.lJ)(t);if(v._isGLBData(n))return this._fromGLBData(e,t,n)}if(F.test(t)||"gltf"===r?.expectedType){const n=await e.loadJSON(t,r);return new v(e,t,n)}const n=await e.loadBinary(t,r);if(v._isGLBData(n))return this._fromGLBData(e,t,n);if(P.test(t)||"glb"===r?.expectedType)throw new a.A("gltf-loader-invalid-glb","This is not a valid glb file.");const o=await e.loadJSON(t,r);return new v(e,t,o)}static _isGLBData(e){if(null==e)return!1;const t=new g(e);return t.remainingBytes()>=4&&t.readUint32()===I}static async _fromGLBData(e,t,r){const n=await v._parseGLBData(r);return new v(e,t,n.json,n.binaryData)}static async _parseGLBData(e){const t=new g(e);if(t.remainingBytes()<12)throw new a.A("gltf-loader-error","glb binary data is insufficiently large.");const r=t.readUint32(),o=t.readUint32(),s=t.readUint32();if(r!==I)throw new a.A("gltf-loader-error","Magic first 4 bytes do not fit to expected glb value.");if(e.byteLength<s)throw new a.A("gltf-loader-error","glb binary data is smaller than header specifies.");if(2!==o)throw new a.A("gltf-loader-unsupported-feature","An unsupported glb container version was detected. Only version 2 is supported.");let i,u,l=0;for(;t.remainingBytes()>=8;){const e=t.readUint32(),r=t.readUint32();if(0===l){if(1313821514!==r)throw new a.A("gltf-loader-error","First glb chunk must be JSON.");if(e<0)throw new a.A("gltf-loader-error","No JSON data found.");i=await(0,O.KB)(t.readUint8Array(e))}else if(1===l){if(5130562!==r)throw new a.A("gltf-loader-unsupported-feature","Second glb chunk expected to be BIN.");u=t.readUint8Array(e)}else n.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] More than 2 glb chunks detected. Skipping.");l+=1}if(!i)throw new a.A("gltf-loader-error","No glb JSON chunk detected.");return{json:i,binaryData:u}}async getBuffer(e,t){const r=this.json.buffers[e];if(null==r.uri){if(null==this._glbBuffer)throw new a.A("gltf-loader-error","glb buffer not present");return this._glbBuffer}const n=await this._getBufferLoader(e,t);if(n.byteLength!==r.byteLength)throw new a.A("gltf-loader-error","Buffer byte lengths should match.");return n}async _getBufferLoader(e,t){const r=this._bufferLoaders.get(e);if(r)return r;const n=this.json.buffers[e].uri,o=this._context.loadBinary(this._resolveUri(n),t).then(e=>new Uint8Array(e));return this._bufferLoaders.set(e,o),o}_validateAccessor(e){if(!this.json.accessors)throw new a.A("gltf-loader-unsupported-feature","Accessors missing.");const t=this.json.accessors[e];if(t.type in["MAT2","MAT3","MAT4"])throw new a.A("gltf-loader-unsupported-feature",`AttributeType ${t.type} is not supported`);return t}_getComponentInfo(e,t){const r=L[e.type],n=t?.componentType||e.componentType,o=M[n];return{componentType:n,componentCount:r,componentByteSize:o,denseByteStride:r*o}}getDracoAccessor(e,t){const r=this._validateAccessor(e),n=t.accessorInfos.get(e),{componentType:o,componentCount:s,componentByteSize:a,denseByteStride:i}=this._getComponentInfo(r,n);return{raw:t.data.buffer,byteStride:i,byteOffset:t.data.byteOffset+(n?.byteOffset||0),entryCount:n?.count??r.count,isDenselyPacked:!0,componentCount:s,componentByteSize:a,componentType:o,min:r.min,max:r.max,normalized:!!r.normalized}}async getAccessor(e,t){const r=this._validateAccessor(e);if(null==r?.bufferView)throw new a.A("gltf-loader-unsupported-feature","Some accessor does not specify a bufferView.");const{componentCount:n,componentByteSize:o,denseByteStride:s}=this._getComponentInfo(r),i=this.json.bufferViews[r.bufferView],u=await this.getBuffer(i.buffer,t),l=i.byteStride||s;return{raw:u.buffer,byteStride:l,byteOffset:u.byteOffset+(i.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:l===s,componentCount:n,componentByteSize:o,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t,r){if(null==e.indices)return;const n=e.indices,o=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(o.isDenselyPacked)switch(o.componentType){case N.pe.UNSIGNED_BYTE:return new Uint8Array(o.raw,o.byteOffset,o.entryCount);case N.pe.UNSIGNED_SHORT:return new Uint16Array(o.raw,o.byteOffset,o.entryCount);case N.pe.UNSIGNED_INT:return new Uint32Array(o.raw,o.byteOffset,o.entryCount)}else switch(o.componentType){case N.pe.UNSIGNED_BYTE:return(0,h.m)(U(m.SL,o));case N.pe.UNSIGNED_SHORT:return(0,h.m)(U(m.h,o));case N.pe.UNSIGNED_INT:return(0,h.m)(U(m.P,o))}}async getPositionData(e,t,r){if(null==e.attributes.POSITION)throw new a.A("gltf-loader-unsupported-feature","No POSITION vertex data found.");const n=e.attributes.POSITION,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(s.componentType!==N.pe.FLOAT)throw new a.A("gltf-loader-unsupported-feature","Expected type FLOAT for POSITION vertex attribute, but found "+(0,o.i7)(N.pe,s.componentType));if(3!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","POSITION vertex attribute must have 3 components, but found "+s.componentCount.toFixed());return U(m.xs,s)}async getNormalData(e,t,r){if(null==e.attributes.NORMAL)throw new a.A("gltf-loader-error","No NORMAL vertex data found.");const n=e.attributes.NORMAL,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(s.componentType!==N.pe.FLOAT)throw new a.A("gltf-loader-unsupported-feature","Expected type FLOAT for NORMAL vertex attribute, but found "+(0,o.i7)(N.pe,s.componentType));if(3!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","NORMAL vertex attribute must have 3 components, but found "+s.componentCount.toFixed());return U(m.xs,s)}async getTangentData(e,t,r){if(null==e.attributes.TANGENT)throw new a.A("gltf-loader-error","No TANGENT vertex data found.");const n=e.attributes.TANGENT,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(s.componentType!==N.pe.FLOAT)throw new a.A("gltf-loader-unsupported-feature","Expected type FLOAT for TANGENT vertex attribute, but found "+(0,o.i7)(N.pe,s.componentType));if(4!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","TANGENT vertex attribute must have 4 components, but found "+s.componentCount.toFixed());return U(m.Eq,s)}async getTextureCoordinates(e,t,r){if(null==e.attributes.TEXCOORD_0)throw new a.A("gltf-loader-error","No TEXCOORD_0 vertex data found.");const n=e.attributes.TEXCOORD_0,o=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(2!==o.componentCount)throw new a.A("gltf-loader-unsupported-feature","TEXCOORD_0 vertex attribute must have 2 components, but found "+o.componentCount.toFixed());if(o.componentType===N.pe.FLOAT)return U(m.gH,o);if(!o.normalized)throw new a.A("gltf-loader-unsupported-feature","Integer component types are only supported for a normalized accessor for TEXCOORD_0.");return function(e){switch(e.componentType){case N.pe.BYTE:return new m.D6(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.UNSIGNED_BYTE:return new m.LC(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.SHORT:return new m.mJ(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.UNSIGNED_SHORT:return new m.Yi(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.UNSIGNED_INT:return new m.An(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount);case N.pe.FLOAT:return new m.gH(e.raw,e.byteOffset,e.byteStride,e.byteOffset+e.byteStride*e.entryCount)}}(o)}async getVertexColors(e,t,r){if(null==e.attributes.COLOR_0)throw new a.A("gltf-loader-error","No COLOR_0 vertex data found.");const n=e.attributes.COLOR_0,s=r?this.getDracoAccessor(n,r):await this.getAccessor(n,t);if(4!==s.componentCount&&3!==s.componentCount)throw new a.A("gltf-loader-unsupported-feature","COLOR_0 attribute must have 3 or 4 components, but found "+s.componentCount.toFixed());if(4===s.componentCount){if(s.componentType===N.pe.FLOAT)return U(m.Eq,s);if(s.componentType===N.pe.UNSIGNED_BYTE)return U(m.XP,s);if(s.componentType===N.pe.UNSIGNED_SHORT)return U(m.Uz,s)}else if(3===s.componentCount){if(s.componentType===N.pe.FLOAT)return U(m.xs,s);if(s.componentType===N.pe.UNSIGNED_BYTE)return U(m.eI,s);if(s.componentType===N.pe.UNSIGNED_SHORT)return U(m.nS,s)}throw new a.A("gltf-loader-unsupported-feature","Unsupported component type for COLOR_0 attribute: "+(0,o.i7)(N.pe,s.componentType))}hasPositions(e){return void 0!==e.attributes.POSITION}hasNormals(e){return void 0!==e.attributes.NORMAL}hasVertexColors(e){return void 0!==e.attributes.COLOR_0}hasTextureCoordinates(e){return void 0!==e.attributes.TEXCOORD_0}hasTangents(e){return void 0!==e.attributes.TANGENT}async getMaterial(e,t,r){let n=e.material?this._materialCache.get(e.material):void 0;if(!n){const o=null!=e.material?R(this.json.materials[e.material]):R(),s=o.pbrMetallicRoughness,a=this.hasVertexColors(e),i=this.getTexture(s.baseColorTexture,t),u=this.getTexture(o.normalTexture,t),l=r?this.getTexture(o.occlusionTexture,t):void 0,c=r?this.getTexture(o.emissiveTexture,t):void 0,f=r?this.getTexture(s.metallicRoughnessTexture,t):void 0,d=null!=e.material?e.material:-1;n={alphaMode:o.alphaMode,alphaCutoff:o.alphaCutoff,color:s.baseColorFactor,doubleSided:!!o.doubleSided,colorTexture:await i,normalTexture:await u,name:o.name,id:d,occlusionTexture:await l,emissiveTexture:await c,emissiveFactor:o.emissiveFactor,metallicFactor:s.metallicFactor,roughnessFactor:s.roughnessFactor,metallicRoughnessTexture:await f,hasVertexColors:a,ESRI_externalColorMixMode:o.extras.ESRI_externalColorMixMode,colorTextureTransform:s?.baseColorTexture?.extensions?.KHR_texture_transform,normalTextureTransform:o.normalTexture?.extensions?.KHR_texture_transform,occlusionTextureTransform:o.occlusionTexture?.extensions?.KHR_texture_transform,emissiveTextureTransform:o.emissiveTexture?.extensions?.KHR_texture_transform,metallicRoughnessTextureTransform:s?.metallicRoughnessTexture?.extensions?.KHR_texture_transform,receiveAmbientOcclusion:o.extras.ESRI_receiveAmbientOcclusion,receiveShadows:o.extras.ESRI_receiveShadows}}return n}async decode(e,t){const r=e.extensions?.KHR_draco_mesh_compression;if(!r)return;if(null==e.indices)throw new a.A("gltf-loader-error","Found Draco compressed primitive without indices.");const n=this.json.bufferViews[r.bufferView],o=await this.getBuffer(n.buffer,t),s=(await y()).decode(new Uint8Array(o.buffer,o.byteOffset+(n.byteOffset||0),n.byteLength));this._bufferLoaders.delete(n.buffer);const i=new Map([[e.indices,s.indices],[e.attributes.POSITION,s.positions]]);return e.attributes.TEXCOORD_0&&i.set(e.attributes.TEXCOORD_0,s.uvs),e.attributes.NORMAL&&i.set(e.attributes.NORMAL,s.normals),e.attributes.COLOR_0&&i.set(e.attributes.COLOR_0,s.colors),e.attributes.TANGENT&&i.set(e.attributes.TANGENT,s.tangents),this._dracoBuffersSize+=s.buffer.byteLength,{data:s.buffer,accessorInfos:i}}async getTexture(e,t){if(!e)return;if(0!==(e.texCoord||0))throw new a.A("gltf-loader-unsupported-feature","Only TEXCOORD with index 0 is supported.");const r=e.index,n=this.json.textures[r],o=E(null!=n.sampler?this.json.samplers[n.sampler]:{}),s=D(n),u=this.json.images[s],l=await this._loadTextureImageData(r,n,t);return(0,i.tE)(this._textureCache,r,()=>{const e=e=>33071===e||33648===e||10497===e,t=e=>{throw new a.A("gltf-loader-error",`Unexpected TextureSampler WrapMode: ${e}`)};return{data:l,wrapS:e(o.wrapS)?o.wrapS:t(o.wrapS),wrapT:e(o.wrapT)?o.wrapT:t(o.wrapT),minFilter:o.minFilter,name:u.name,id:r}})}getNodeTransform(e){if(void 0===e)return C;let t=this._nodeTransformCache.get(e);if(!t){const r=this.getNodeTransform(this._getNodeParent(e)),n=this.json.nodes[e];n.matrix?t=(0,f.lw)((0,s.vt)(),r,n.matrix):n.translation||n.rotation||n.scale?(t=(0,s.o8)(r),n.translation&&(0,f.Tl)(t,t,n.translation),n.rotation&&(G[3]=(0,d.Xd)(G,n.rotation),(0,f.e$)(t,t,G[3],G)),n.scale&&(0,f.hs)(t,t,n.scale)):t=(0,s.o8)(r),this._nodeTransformCache.set(e,t)}return t}_resolveUri(e){return(0,l.s2)(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=c.R.parse(this.json.asset.version,"glTF");B.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json;if(e.extensionsRequired&&!e.extensionsRequired.every(e=>this._supportedExtensions.includes(e)))throw new a.A("gltf-loader-unsupported-feature","gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(e=>{this._nodeParentMap.set(e,t)})})}async _loadTextureImageData(e,t,r){const n=this._textureLoaders.get(e);if(n)return n;const o=this._createTextureLoader(t,r);return this._textureLoaders.set(e,o),o}async _createTextureLoader(e,t){const r=D(e),n=this.json.images[r];if(n.uri){if(n.uri.endsWith(".ktx2")){const e=await this._context.loadBinary(this._resolveUri(n.uri),t);return new O.Xi(new Uint8Array(e))}return this._context.loadImage(this._resolveUri(n.uri),t)}if(null==n.bufferView)throw new a.A("gltf-loader-unsupported-feature","Image bufferView must be defined.");if(null==n.mimeType)throw new a.A("gltf-loader-unsupported-feature","Image mimeType must be defined.");const o=this.json.bufferViews[n.bufferView],s=await this.getBuffer(o.buffer,t);if(null!=o.byteStride)throw new a.A("gltf-loader-unsupported-feature","byteStride not supported for image buffer");const i=s.byteOffset+(o.byteOffset||0);return(0,O.pn)(new Uint8Array(s.buffer,i,o.byteLength),n.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await(0,u.nA)(Array.from(this._bufferLoaders.values())),t=await(0,u.nA)(Array.from(this._textureLoaders.values()));return e.reduce((e,t)=>e+(t?.byteLength??0),0)+this._dracoBuffersSize+t.reduce((e,t)=>e+(t?(0,O.x3)(t)?t.data.byteLength:t.width*t.height*4:0),0)}}const C=(0,f.hM)((0,s.vt)(),Math.PI/2),B=new c.R(2,0,"glTF"),G=(0,p.vt)(),L={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},M={[N.pe.BYTE]:1,[N.pe.UNSIGNED_BYTE]:1,[N.pe.SHORT]:2,[N.pe.UNSIGNED_SHORT]:2,[N.pe.HALF_FLOAT]:2,[N.pe.FLOAT]:4,[N.pe.INT]:4,[N.pe.UNSIGNED_INT]:4};function U(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}function D(e){if(null!=e.extensions?.KHR_texture_basisu)return e.extensions.KHR_texture_basisu.source;if(null!==e.source)return e.source;throw new a.A("gltf-loader-unsupported-feature","Source is expected to be defined for a texture. It can also be omitted in favour of an KHR_texture_basisu extension tag.")}const F=/\.gltf$/i,P=/\.glb$/i;let j=0;async function H(e,t,r={},a=!0){const i=await v.load(e,t,r),u="gltf_"+j++,l={lods:[],materials:new Map,textures:new Map,meta:$(i)},c=!(!i.json.asset.extras||"symbolResource"!==i.json.asset.extras.ESRI_type),f=i.json.asset.extras?.ESRI_webstyleSymbol?.webstyle,d=new Map;let p=!1;await k(i,async(e,t,c,f)=>{const m=d.get(c)??0;d.set(c,m+1);const h=void 0!==e.mode?e.mode:N.WR.TRIANGLES,T=h===N.WR.TRIANGLES||h===N.WR.TRIANGLE_STRIP||h===N.WR.TRIANGLE_FAN?h:null;if(null==T)return void n.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Unsupported primitive mode ("+(0,o.i7)(N.WR,h)+"). Skipping primitive.");if(!i.hasPositions(e))return void n.A.getLogger("esri.views.3d.glTF").warn("Skipping primitive without POSITION vertex attribute.");const _=await i.decode(e,r);p||=!!_;const y=i.getPositionData(e,r,_),g=i.getMaterial(e,r,a),w=i.hasNormals(e)?i.getNormalData(e,r,_):null,b=i.hasTangents(e)?i.getTangentData(e,r,_):null,x=i.hasTextureCoordinates(e)?i.getTextureCoordinates(e,r,_):null,S=i.hasVertexColors(e)?i.getVertexColors(e,r,_):null,R=i.getIndexData(e,r,_),A={name:f,transform:(0,s.o8)(t),attributes:{position:await y,normal:w?await w:null,texCoord0:x?await x:null,color:S?await S:null,tangent:b?await b:null},indices:await R,primitiveType:T,material:z(l,await g,u)};let E=null;null!=l.meta?.ESRI_lod&&"screenSpaceRadius"===l.meta.ESRI_lod.metric&&(E=l.meta.ESRI_lod.thresholds[c]),l.lods[c]=l.lods[c]||{parts:[],name:f,lodThreshold:E},l.lods[c].parts[m]=A});for(const e of l.lods)e.parts=e.parts.filter(e=>!!e);const m=await i.getLoadedBuffersSize();return{model:l,meta:{isEsriSymbolResource:c,uri:i.uri,ESRI_webstyle:f,isDracoDecompressed:p},customMeta:{},usedMemory:m}}function $(e){const t=e.json;let r=null;return t.nodes.forEach(e=>{const t=e.extras;null!=t&&(t.ESRI_proxyEllipsoid||t.ESRI_lod)&&(r=t)}),r}async function k(e,t){const r=e.json,o=r.scenes[r.scene||0].nodes,s=o.length>1,a=[];for(const e of o){const t=r.nodes[e];a.push(i(e,0)),V(t)&&!s&&t.extensions.MSFT_lod.ids.forEach((e,t)=>i(e,t+1))}async function i(o,s){const u=r.nodes[o],l=e.getNodeTransform(o);if(null!=u.weights&&n.A.getLogger("esri.views.3d.glTF").warn("[Unsupported Feature] Morph targets are not supported."),null!=u.mesh){const e=r.meshes[u.mesh];for(const r of e.primitives)a.push(t(r,l,s,e.name))}for(const e of u.children||[])a.push(i(e,s))}await Promise.all(a)}function V(e){return e.extensions?.MSFT_lod&&Array.isArray(e.extensions.MSFT_lod.ids)}function z(e,t,r){const n=t=>{const n=`${r}_tex_${t&&t.id}${t?.name?"_"+t.name:""}`;if(t&&!e.textures.has(n)){const r=function(e,t={}){return{data:e,parameters:{wrap:{s:10497,t:10497,...t.wrap},noUnpackFlip:!0,mipmap:!1,...t}}}(t.data,{wrap:{s:t.wrapS,t:t.wrapT},mipmap:X.has(t.minFilter),noUnpackFlip:!0});e.textures.set(n,r)}return n},o=`${r}_mat_${t.id}_${t.name}`;if(!e.materials.has(o)){const r=function(e={}){return{color:[1,1,1],opacity:1,alphaMode:"OPAQUE",alphaCutoff:.5,doubleSided:!1,castShadows:!0,receiveShadows:!0,receiveAmbientOcclusion:!0,colorTexture:null,normalTexture:null,occlusionTexture:null,emissiveTexture:null,metallicRoughnessTexture:null,colorTextureTransform:null,normalTextureTransform:null,occlusionTextureTransform:null,emissiveTextureTransform:null,metallicRoughnessTextureTransform:null,emissiveFactor:[0,0,0],metallicFactor:1,roughnessFactor:1,colorMixMode:"multiply",...e}}({color:[t.color[0],t.color[1],t.color[2]],opacity:t.color[3],alphaMode:t.alphaMode,alphaCutoff:t.alphaCutoff,doubleSided:t.doubleSided,colorMixMode:t.ESRI_externalColorMixMode,colorTexture:t.colorTexture?n(t.colorTexture):void 0,normalTexture:t.normalTexture?n(t.normalTexture):void 0,occlusionTexture:t.occlusionTexture?n(t.occlusionTexture):void 0,emissiveTexture:t.emissiveTexture?n(t.emissiveTexture):void 0,metallicRoughnessTexture:t.metallicRoughnessTexture?n(t.metallicRoughnessTexture):void 0,emissiveFactor:[t.emissiveFactor[0],t.emissiveFactor[1],t.emissiveFactor[2]],colorTextureTransform:t.colorTextureTransform,normalTextureTransform:t.normalTextureTransform,occlusionTextureTransform:t.occlusionTextureTransform,emissiveTextureTransform:t.emissiveTextureTransform,metallicRoughnessTextureTransform:t.metallicRoughnessTextureTransform,metallicFactor:t.metallicFactor,roughnessFactor:t.roughnessFactor,receiveShadows:t.receiveShadows,receiveAmbientOcclusion:t.receiveAmbientOcclusion});e.materials.set(o,r)}return o}const X=new Set([9987,9985])},63907:(e,t,r)=>{r.d(t,{$0:()=>f,CQ:()=>T,Fq:()=>m,H0:()=>s,SB:()=>u,WR:()=>n,XN:()=>a,iE:()=>i,ld:()=>l,nI:()=>h,pe:()=>o,r6:()=>d,vt:()=>c,yI:()=>p});const n={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},o={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,HALF_FLOAT:5131},s={RGBA4:32854,R16F:33325,RG16F:33327,RGB32F:34837,RGBA16F:34842,R32F:33326,RG32F:33328,RGBA32F:34836,R11F_G11F_B10F:35898,RGB8:32849,RGBA8:32856,RGB5_A1:32855,R8:33321,RG8:33323,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,RGB16F:34843,RGB9_E5:35901,SRGB8:35905,SRGB8_ALPHA8:35907,RGB565:36194,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,RGB10_A2:32857,RGB10_A2UI:36975},a=Object.values(s),i={DEPTH24_STENCIL8:35056,DEPTH32F_STENCIL8:36013},u={DEPTH_COMPONENT16:33189,DEPTH_COMPONENT24:33190,DEPTH_COMPONENT32F:36012},l={FLOAT:o.FLOAT,UNSIGNED_BYTE:o.UNSIGNED_BYTE,UNSIGNED_INT_24_8:34042,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,BYTE:o.BYTE,UNSIGNED_SHORT:o.UNSIGNED_SHORT,SHORT:o.SHORT,UNSIGNED_INT:o.UNSIGNED_INT,INT:o.INT,HALF_FLOAT:5131,UNSIGNED_INT_2_10_10_10_REV:33640,UNSIGNED_INT_10F_11F_11F_REV:35899,UNSIGNED_INT_5_9_9_9_REV:35902,FLOAT_32_UNSIGNED_INT_24_8_REV:36269},c={Texture:0,TileTexture:1,BufferObject:2,VertexArrayObject:3,Shader:4,Program:5,FramebufferObject:6,Renderbuffer:7,TransformFeedback:8,Sync:9,UNCOUNTED:10,LinesOfCode:10,Uniform:11,COUNT:12},f=0,d=36064,p=36065,m=36066,h=33306,T={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497}},84498:(e,t,r)=>{r.d(t,{x:()=>a});var n=r(34275),o=r(97146),s=r(63907);function a(e,t){switch(t){case s.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,n.mg)(e)?new Uint16Array(e):e}(e);case s.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,n=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(n[e++]=t,n[e++]=t+1,n[e++]=t+2):(n[e++]=t+1,n[e++]=t,n[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(n[t++]=e[o],n[t++]=e[o+1],n[t++]=e[o+2]):(n[t++]=e[o+1],n[t++]=e[o],n[t++]=e[o+2])}return n}(e);case s.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)n[e++]=0,n[e++]=t+1,n[e++]=t+2;return n}const o=e[0];let s=e[1],a=0;for(let t=0;t<r;++t){const r=e[t+2];n[a++]=o,n[a++]=s,n[a++]=r,s=r}return n}(e)}}},90239:(e,t,r)=>{function n(e){switch(e){case"u8":case"i8":return 1;case"u16":case"i16":case"f16":return 2;case"u32":case"i32":case"f32":return 4;case"f64":return 8}}r.d(t,{GJ:()=>n})},97375:(e,t,r)=>{r.r(t),r.d(t,{loadGLTFMesh:()=>G});var n=r(68197),o=r(40876),s=r(49186),a=r(91869),i=r(34727),u=r(77690),l=r(29242),c=r(51850),f=r(91829),d=r(16939),p=r(80882),m=r(35063),h=r(51147),T=r(1193),_=r(27615),y=r(13030),g=r(73354),w=r(65686),b=r(90239);Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r?.dstIndex??0)*o,l=(r?.srcIndex??0)*a;for(let e=0;e<i;++e){for(let e=0;e<9;++e)n[u+e]=s[l+e];u+=o,l+=a}}},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,copy:function(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,s=t.typedBuffer,a=t.typedBufferStride,i=r?r.count:t.count;let u=(r?.dstIndex??0)*o,l=(r?.srcIndex??0)*a;for(let e=0;e<i;++e){for(let e=0;e<16;++e)n[u+e]=s[l+e];u+=o,l+=a}}},Symbol.toStringTag,{value:"Module"})),r(24045);var x=r(43609);function S(e,t,r=3,n=r){const o=t.length/n;let s=0,a=0;for(let i=0;i<o;++i)e[s]=t[a],e[s+1]=t[a+1],e[s+2]=t[a+2],s+=r,a+=n}function R(e,t,r,n,o){const s=e.typedBuffer,a=e.typedBufferStride,i=o?.count??e.count;let u=(o?.dstIndex??0)*a;for(let e=0;e<i;++e)s[u]=t,s[u+1]=r,s[u+2]=n,u+=a}function A(e,t,r=4){const n=t.typedBuffer,o=t.typedBufferStride,s=t.count;let a=0,i=0;for(let t=0;t<s;++t)e[a]=n[i],e[a+1]=n[i+1],e[a+2]=n[i+2],e[a+3]=n[i+3],a+=r,i+=o}function E(e,t,r,n,o,s){const a=e.typedBuffer,i=e.typedBufferStride,u=s?.count??e.count;let l=(s?.dstIndex??0)*i;for(let e=0;e<u;++e)a[l]=t,a[l+1]=r,a[l+2]=n,a[l+3]=o,l+=i}function O(e,t){return new e(new ArrayBuffer(t*e.ElementCount*(0,b.GJ)(e.ElementType)))}Object.freeze(Object.defineProperty({__proto__:null,copy:S,copyView:function(e,t){S(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)},fill:R},Symbol.toStringTag,{value:"Module"})),Object.freeze(Object.defineProperty({__proto__:null,copy:A,copyView:function(e,t){A(e.typedBuffer,t,e.typedBufferStride)},fill:E},Symbol.toStringTag,{value:"Module"}));var N=r(72258),I=r(21015),v=r(51698),C=r(84498),B=r(51530);async function G(e,t,r){const o=new I.R(r?.resolveFile),u=await(0,v.loadGLTF)(o,t,r,!0),l=u.model,d=l.lods.shift(),g=new Map,w=new Map;l.textures.forEach((e,t)=>g.set(t,function(e){return new m.A({data:((0,B.x3)(e.data),e.data),wrap:F(e.parameters.wrap)})}(e))),l.materials.forEach((e,t)=>w.set(t,function(e,t){const r=new n.A(function(e,t){return(0,f.fA)(j(e[0]),j(e[1]),j(e[2]),t)}(e.color,e.opacity)),o=e.emissiveFactor?new n.A(function(e){return(0,c.fA)(j(e[0]),j(e[1]),j(e[2]))}(e.emissiveFactor)):null,s=e=>e?new h.A({scale:e.scale?[e.scale[0],e.scale[1]]:[1,1],rotation:(0,i.KJ)(e.rotation??0),offset:e.offset?[e.offset[0],e.offset[1]]:[0,0]}):null;return new p.A({color:r,colorTexture:t.get(e.colorTexture),normalTexture:t.get(e.normalTexture),emissiveColor:o,emissiveTexture:t.get(e.emissiveTexture),occlusionTexture:t.get(e.occlusionTexture),alphaMode:D(e.alphaMode),alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,metallic:e.metallicFactor,roughness:e.roughnessFactor,metallicRoughnessTexture:t.get(e.metallicRoughnessTexture),colorTextureTransform:s(e.colorTextureTransform),normalTextureTransform:s(e.normalTextureTransform),occlusionTextureTransform:s(e.occlusionTextureTransform),emissiveTextureTransform:s(e.emissiveTextureTransform),metallicRoughnessTextureTransform:s(e.metallicRoughnessTextureTransform)})}(e,g)));const b=function(e){let t=0;const r={color:!1,tangent:!1,normal:!1,texCoord0:!1},n=new Map,o=new Map,s=[];for(const i of e.parts){const{position:e,normal:u,color:l,tangent:c,texCoord0:f}=i.attributes,d=`\n ${L(e,n)}/\n ${L(u,n)}/\n ${L(l,n)}/\n ${L(c,n)}/\n ${L(f,n)}/\n ${M(i.transform)}\n `;let p=!1;const m=(0,a.tE)(o,d,()=>(p=!0,{start:t,length:e.count}));p&&(t+=e.count),u&&(r.normal=!0),l&&(r.color=!0),c&&(r.tangent=!0),f&&(r.texCoord0=!0),s.push({gltf:i,writeVertices:p,region:m})}return{vertexAttributes:{position:O(y.Xm,t),normal:r.normal?O(y.xs,t):null,tangent:r.tangent?O(y.Eq,t):null,color:r.color?O(y.XP,t):null,texCoord0:r.texCoord0?O(y.gH,t):null},parts:s,components:[]}}(d);for(const e of b.parts)U(b,e,w);const{position:x,normal:S,tangent:R,color:A,texCoord0:E}=b.vertexAttributes,C=(0,_.TE)(e,r),G=e.spatialReference.isGeographic?(0,_.TE)(e):C,P=(0,N.UR)({vertexAttributes:{position:x.typedBuffer,normal:S?.typedBuffer,tangent:R?.typedBuffer},vertexSpace:G,spatialReference:e.spatialReference},C,{allowBufferReuse:!0,sourceUnit:r?.unitConversionDisabled?void 0:"meters"});if(!P)throw new s.A("load-gltf-mesh:vertex-space-projection",`Failed to load mesh from glTF because we could not convert the vertex space from ${G.type} to ${C.type}`);return{mesh:{transform:null,vertexSpace:C,components:b.components,spatialReference:e.spatialReference,vertexAttributes:new T.H({...P,color:A?.typedBuffer,uv:E?.typedBuffer})},meta:u.meta}}function L(e,t){if(null==e)return"-";const r=e.typedBuffer;return`${(0,a.tE)(t,r.buffer,()=>t.size)}/${r.byteOffset}/${r.byteLength}`}function M(e){return null!=e?e.toString():"-"}function U(e,t,r){t.writeVertices&&function(e,t){const{position:r,normal:n,tangent:o,color:s,texCoord0:a}=e.vertexAttributes,c=t.region.start,{attributes:f,transform:d}=t.gltf,p=f.position.count;if((0,g.d)(r.slice(c,p),f.position,d),null!=f.normal&&null!=n){const e=(0,u.Ge)((0,l.vt)(),d),t=n.slice(c,p);(0,g.c)(t,f.normal,e),(0,i.or)(e)&&(0,g.e)(t,t)}else null!=n&&R(n,0,0,1,{dstIndex:c,count:p});if(null!=f.tangent&&null!=o){const e=(0,u.z0)((0,l.vt)(),d),t=o.slice(c,p);(0,w.a)(t,f.tangent,e),(0,i.or)(e)&&(0,w.n)(t,t)}else null!=o&&E(o,0,0,1,1,{dstIndex:c,count:p});if(null!=f.texCoord0&&null!=a?(0,x.n)(a.slice(c,p),f.texCoord0):null!=a&&(0,x.f)(a,0,0,{dstIndex:c,count:p}),null!=f.color&&null!=s){const e=f.color,t=s.slice(c,p);if(4===e.elementCount)e instanceof y.Eq?(0,w.l)(t,e,1,255):(e instanceof y.XP||e instanceof y.Uz)&&(0,w.l)(t,e,1/255,255);else{E(t,255,255,255,255);const r=y.eI.fromTypedArray(t.typedBuffer,t.typedBufferStride);e instanceof y.xs?(0,g.l)(r,e,1,255):(e instanceof y.eI||e instanceof y.nS)&&(0,g.l)(r,e,1/255,255)}}else null!=s&&E(s.slice(c,p),255,255,255,255)}(e,t);const{indices:n,attributes:o,primitiveType:s,material:a}=t.gltf;let c=(0,C.x)(n||o.position.count,s);const f=t.region.start;if(f){const e=new Uint32Array(c);for(let t=0;t<c.length;t++)e[t]+=f;c=e}e.components.push(new d.A({name:t.gltf.name,faces:c,material:r.get(a),shading:o.normal?"source":"flat",trustSourceNormals:!0}))}function D(e){switch(e){case"OPAQUE":return"opaque";case"MASK":return"mask";case"BLEND":return"blend"}}function F(e){return{horizontal:P(e.s),vertical:P(e.t)}}function P(e){switch(e){case 33071:return"clamp";case 33648:return"mirror";case 10497:return"repeat"}}function j(e){return e**(1/o.Tf)*255}}}]);