@arcgis/core 4.33.0-next.20250327 → 4.33.0-next.20250329

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 (253) hide show
  1. package/applications/Components/reactiveUtils.d.ts +4 -0
  2. package/applications/Components/reactiveUtils.js +1 -1
  3. package/applications/KnowledgeStudio/layerInternalAccessUtils.d.ts +1 -0
  4. package/applications/KnowledgeStudio/layerInternalAccessUtils.js +1 -1
  5. package/applications/MapViewer/templateUtils.js +1 -1
  6. package/assets/esri/core/workers/RemoteClient.js +1 -1
  7. package/assets/esri/core/workers/chunks/{66cae76da0582cfa8656.js → 0943695a1dcd21c45e83.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{c6bcfa99fb222894fa0e.js → 0a0e5d699ddb7052c5c0.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0a675f9f69b8b13b7443.js +1 -0
  10. package/assets/esri/core/workers/chunks/{0a98dc3ea67ce97a6e7b.js → 0b6ceb0194a07bbc3433.js} +1 -1
  11. package/assets/esri/core/workers/chunks/0eed612e82a279ac8d1e.js +1 -0
  12. package/assets/esri/core/workers/chunks/{458f4c6c8820c1f62f69.js → 1322096a72e910f23167.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{cbe22c58b3230b12b31a.js → 13ad4ee2e064d13ca34d.js} +1 -1
  14. package/assets/esri/core/workers/chunks/176e7c7c2a871bcb512e.js +1 -0
  15. package/assets/esri/core/workers/chunks/1cd9b5ef62582b25df9b.js +1 -0
  16. package/assets/esri/core/workers/chunks/1cf8a431e5da946c7d27.js +1 -0
  17. package/assets/esri/core/workers/chunks/{add0770399a63b7635b5.js → 1df34b7fd68f5ab55bd3.js} +1 -1
  18. package/assets/esri/core/workers/chunks/201db423e3c6f947b77c.js +1 -0
  19. package/assets/esri/core/workers/chunks/213e82a7e3fa5b253ec1.js +1 -0
  20. package/assets/esri/core/workers/chunks/{22618753349eb9d8b3df.js → 222446da9cb58c3c3b7e.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{e1b42fc5c1d89333e834.js → 239821543abbd63c5787.js} +2 -2
  22. package/assets/esri/core/workers/chunks/{0f37b3a797d8a55439a4.js → 277b61af8982092a4c81.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2a654d8de99be40dd0e6.js +1 -0
  24. package/assets/esri/core/workers/chunks/2b07bdb6c4c4a5b2f968.js +1 -0
  25. package/assets/esri/core/workers/chunks/2bda2cfc6e81818d7d33.js +1 -0
  26. package/assets/esri/core/workers/chunks/2cbab0c078d0b844934c.js +1 -0
  27. package/assets/esri/core/workers/chunks/{193b4fecdfee927d6200.js → 37e4f588a6896f98bce3.js} +1 -1
  28. package/assets/esri/core/workers/chunks/392e64a573f67817db02.js +1 -0
  29. package/assets/esri/core/workers/chunks/3a743653b786b010a57f.js +1 -0
  30. package/assets/esri/core/workers/chunks/3be007f32ea1e18b8b3b.js +1 -0
  31. package/assets/esri/core/workers/chunks/451555af283b32a10fef.js +1 -0
  32. package/assets/esri/core/workers/chunks/{835fa4484c58d9b31c78.js → 460afde071df9f35182d.js} +1 -1
  33. package/assets/esri/core/workers/chunks/{26bedec014488e1fc5e4.js → 4816cf647eca2f4cecc2.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{fdc9bd8f309af610fa62.js → 48ad7beb48dcc2693cc3.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{1e631e34ee495eb0e76e.js → 49ed3ab9bd6d7c52e864.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{09c9e4e94f09ba9f4c22.js → 4aa0a58ded4465ea28bd.js} +1 -1
  37. package/assets/esri/core/workers/chunks/{82692bff98b4ec781544.js → 4d798da25a726f179089.js} +1 -1
  38. package/assets/esri/core/workers/chunks/51339193abddfe37745d.js +1 -0
  39. package/assets/esri/core/workers/chunks/52d160cb7921ae7a4f57.js +1 -0
  40. package/assets/esri/core/workers/chunks/{630a9afdf0523c27ddb6.js → 555c95b149e3a82a4460.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{eab1e3c101158675abba.js → 5660f479c005149bce8d.js} +1 -1
  42. package/assets/esri/core/workers/chunks/5a51c75a2932d9da001a.js +1 -0
  43. package/assets/esri/core/workers/chunks/{37a3533f004bf2e888da.js → 5d01f0b86566d08ba29d.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{0576b035c1654a43ad5c.js → 5de3aee547113bfd59df.js} +1 -1
  45. package/assets/esri/core/workers/chunks/5e79642851e888eddfe4.js +1 -0
  46. package/assets/esri/core/workers/chunks/{45eee326f7a649c5a15b.js → 626db8488f9d931cf55c.js} +2 -2
  47. package/assets/esri/core/workers/chunks/{5a6f7360183693f8490d.js → 6339a24874c698594101.js} +1 -1
  48. package/assets/esri/core/workers/chunks/63dade3e1cc7f5b76846.js +1 -0
  49. package/assets/esri/core/workers/chunks/6c378e7a6ca29d530880.js +1 -0
  50. package/assets/esri/core/workers/chunks/71e46e866c23372b0b58.js +1 -0
  51. package/assets/esri/core/workers/chunks/{c591527543fd75a917d4.js → 72c7126dbd27fa48fcdb.js} +1 -1
  52. package/assets/esri/core/workers/chunks/738e4f46feb3758456e0.js +1 -0
  53. package/assets/esri/core/workers/chunks/{d459c790a3b89ac53d2d.js → 759c12b0715279e3c0f6.js} +1 -1
  54. package/assets/esri/core/workers/chunks/75fa861b5757551f8fdc.js +1 -0
  55. package/assets/esri/core/workers/chunks/7655be1470ce39f0e494.js +1 -0
  56. package/assets/esri/core/workers/chunks/77660e18ea793ae85f83.js +1 -0
  57. package/assets/esri/core/workers/chunks/796cf1c2ca9955595836.js +1 -0
  58. package/assets/esri/core/workers/chunks/79c4f10da8360ee60cd2.js +1 -0
  59. package/assets/esri/core/workers/chunks/{49c346d2fb8538990f45.js → 7d1c39c2a80e20a0595f.js} +1 -1
  60. package/assets/esri/core/workers/chunks/7f36cffc6ed984b7e467.js +1 -0
  61. package/assets/esri/core/workers/chunks/82353e59ac6d909dcf41.js +1 -0
  62. package/assets/esri/core/workers/chunks/82493f51a2182f76dd2f.js +1 -0
  63. package/assets/esri/core/workers/chunks/84d301e1b6b0d0b48f51.js +1 -0
  64. package/assets/esri/core/workers/chunks/86931186095c23e47c0c.js +1 -0
  65. package/assets/esri/core/workers/chunks/879d672d12f9ef2e1b50.js +1 -0
  66. package/assets/esri/core/workers/chunks/{59e4e780dcdfed555ca5.js → 8ef5e6f1c606e5e41002.js} +1 -1
  67. package/assets/esri/core/workers/chunks/90c893959145827961ac.js +1 -0
  68. package/assets/esri/core/workers/chunks/921b41b101957cfc1cfd.js +1 -0
  69. package/assets/esri/core/workers/chunks/931275cfa2c55eb0f504.js +1 -0
  70. package/assets/esri/core/workers/chunks/{f128d3431da86e484117.js → 94292c7afff18694d55e.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{7e0e9ca84490a0c67197.js → 98da74243df03e0cc70d.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{354117429b3a0a0794c9.js → 999e8dbe6f4d0665b3ab.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{c0400c25c53fd90fc90e.js → 9e156e135f34f9b06032.js} +1 -1
  74. package/assets/esri/core/workers/chunks/9f18de17fbcad0e5c140.js +1 -0
  75. package/assets/esri/core/workers/chunks/{4eb1a2433f675bde12ad.js → a01c86910fe4984eb788.js} +1 -1
  76. package/assets/esri/core/workers/chunks/a348ff2dd936c6bf9399.js +1 -0
  77. package/assets/esri/core/workers/chunks/a53e9f5092de715da025.js +1 -0
  78. package/assets/esri/core/workers/chunks/a9b6377f1fef5826f28d.js +1 -0
  79. package/assets/esri/core/workers/chunks/{21016d58428b15f7427c.js → aa712f850fd129ca5ed8.js} +1 -1
  80. package/assets/esri/core/workers/chunks/ab0113d1269675dcd520.js +1 -0
  81. package/assets/esri/core/workers/chunks/ba4d91816f6a0bf0d812.js +1 -0
  82. package/assets/esri/core/workers/chunks/bf453744067267e84d1b.js +1 -0
  83. package/assets/esri/core/workers/chunks/c2f38c66fae2cdb57445.js +1 -0
  84. package/assets/esri/core/workers/chunks/c7aa4a8263e21f631004.js +1 -0
  85. package/assets/esri/core/workers/chunks/{3be465c653236d6d8c1f.js → d2c7067bb6654c0e2793.js} +1 -1
  86. package/assets/esri/core/workers/chunks/{bc3f42401131a12fce9b.js → d2eb3802fa003c2d497e.js} +1 -1
  87. package/assets/esri/core/workers/chunks/da7c14ae1a25fc7163ce.js +1 -0
  88. package/assets/esri/core/workers/chunks/da8a002d18544def5383.js +1 -0
  89. package/assets/esri/core/workers/chunks/daa54c8a317c27881763.js +1 -0
  90. package/assets/esri/core/workers/chunks/dde03a893f9cef8e0f45.js +1 -0
  91. package/assets/esri/core/workers/chunks/e15c612caadf7bac4ab9.js +1 -0
  92. package/assets/esri/core/workers/chunks/{a2377969f76640f1d6fe.js → e2029267cddb8e2effab.js} +1 -1
  93. package/assets/esri/core/workers/chunks/e3ef0451dcdc2e966628.js +1 -0
  94. package/assets/esri/core/workers/chunks/{fc7ce48c7b31a4665a9b.js → e792603b7cc3ddd133f3.js} +1 -1
  95. package/assets/esri/core/workers/chunks/e7e987558cf017c62458.js +1 -0
  96. package/assets/esri/core/workers/chunks/eabfab23246d4a052ea3.js +1 -0
  97. package/assets/esri/core/workers/chunks/ed3d1d0465f4a4d8df4a.js +1 -0
  98. package/assets/esri/core/workers/chunks/{0c9e933b392616460e62.js → f0c864425f000ab87a7b.js} +1 -1
  99. package/assets/esri/core/workers/chunks/{ed4afafbcb31491c2049.js → f452ca61842dbe8de9af.js} +1 -1
  100. package/assets/esri/core/workers/chunks/f54546c155fba2fd3a7e.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4c8164955f8d844c09ee.js → f8d1c7df671733c3325c.js} +1 -1
  102. package/assets/esri/core/workers/chunks/{e45404a982e173459990.js → f92d521ed3df3c9f737b.js} +1 -1
  103. package/assets/esri/core/workers/chunks/{b2289c18c02c868a2939.js → f9bedb421d4e115a888f.js} +1 -1
  104. package/assets/esri/core/workers/chunks/{55f7b1de8882569861c0.js → faed301a25252c619cff.js} +1 -1
  105. package/assets/esri/core/workers/chunks/fb22b2e4988ecf4d6376.js +1 -0
  106. package/assets/esri/core/workers/chunks/fb455fd89b74b70a6a2b.js +1 -0
  107. package/assets/esri/core/workers/chunks/{6d77c7e9dec323fc4145.js → fb603edd374e24f366ff.js} +1 -1
  108. package/assets/esri/core/workers/chunks/fc5ca7b08915177c5e33.js +1 -0
  109. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList.json +1 -1
  110. package/assets/esri/widgets/BasemapLayerList/t9n/BasemapLayerList_en.json +1 -1
  111. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList.json +1 -1
  112. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_en.json +1 -1
  113. package/assets/esri/widgets/LayerList/t9n/LayerList.json +1 -1
  114. package/assets/esri/widgets/LayerList/t9n/LayerList_en.json +1 -1
  115. package/core/Accessor.js +1 -1
  116. package/core/accessorSupport/utils.js +1 -1
  117. package/core/workers/registry.js +1 -1
  118. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  119. package/geometry/operators/polygonOverlayOperator.js +1 -1
  120. package/geometry/support/meshUtils/elevation.js +1 -1
  121. package/geometry/support/meshUtils.js +1 -1
  122. package/interfaces.d.ts +152 -16
  123. package/intl/locale.js +1 -1
  124. package/layers/OrientedImageryLayer.js +1 -1
  125. package/layers/SceneLayer.js +1 -1
  126. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  127. package/layers/support/RasterWorker.js +1 -1
  128. package/layers/support/VideoElement.js +1 -1
  129. package/layers/support/commonProperties.js +1 -1
  130. package/layers/support/rasterDatasets/FunctionRaster.js +1 -1
  131. package/layers/support/rasterFunctions/clipUtils.js +1 -1
  132. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  133. package/networks/RulesTable.js +1 -1
  134. package/networks/UtilityNetwork.js +1 -1
  135. package/networks/support/utils.js +1 -1
  136. package/package.json +2 -2
  137. package/portal/schemas/definitions.js +1 -1
  138. package/portal/schemas/sceneLayerItem.js +1 -1
  139. package/rest/networks/queryAssociations.js +1 -1
  140. package/support/actions/actionUtils.js +1 -1
  141. package/support/revision.js +1 -1
  142. package/symbols/WebStyleSymbol.js +1 -1
  143. package/symbols/support/symbolUtils.js +1 -1
  144. package/tables/AttributeTableTemplate.js +1 -1
  145. package/tables/elements/AttributeTableAttachmentElement.js +1 -1
  146. package/tables/elements/AttributeTableFieldElement.js +1 -1
  147. package/tables/elements/AttributeTableGroupElement.js +1 -1
  148. package/tables/elements/AttributeTableRelationshipElement.js +1 -1
  149. package/tables/support/FieldOrder.js +5 -0
  150. package/tables/support/tablesUtils.js +1 -1
  151. package/views/2d/LabelManager.js +1 -1
  152. package/views/2d/engine/webgl/Overlay.js +1 -1
  153. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  154. package/views/2d/layers/features/schema/processor/symbols/SymbolSchema.js +1 -1
  155. package/views/2d/layers/graphics/GraphicsView2D.js +1 -1
  156. package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
  157. package/views/3d/terrain/TerrainSurface.js +1 -1
  158. package/views/3d/terrain/Tile.js +1 -1
  159. package/views/3d/terrain/TileRenderer.js +1 -1
  160. package/views/DOMContainer.js +1 -1
  161. package/views/FocusArea.js +1 -1
  162. package/views/GroundView.js +1 -1
  163. package/views/PopupView.js +1 -1
  164. package/views/VideoView.js +1 -1
  165. package/views/support/GroundViewElevationSampler.js +1 -1
  166. package/views/support/TextureCompressionHelper.js +1 -1
  167. package/views/support/TextureCompressionWorker.js +5 -0
  168. package/views/support/TextureCompressionWorkerHandle.js +5 -0
  169. package/views/support/imageReprojection.js +1 -1
  170. package/views/webgl/Texture.js +1 -1
  171. package/webscene/Slide.js +1 -1
  172. package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
  173. package/widgets/CatalogLayerList.js +1 -1
  174. package/widgets/Directions.js +1 -1
  175. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  176. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  177. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  178. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  179. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  180. package/widgets/FeatureTable.js +1 -1
  181. package/widgets/Features/FeaturesDrillIn.js +1 -1
  182. package/widgets/Features.js +1 -1
  183. package/widgets/LayerList/LayerListItem.js +1 -1
  184. package/widgets/LayerList/ListItem.js +1 -1
  185. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  186. package/widgets/Legend.js +1 -1
  187. package/widgets/Search.js +1 -1
  188. package/widgets/TableList/ListItem.js +1 -1
  189. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  190. package/widgets/UtilityNetworkTrace.js +1 -1
  191. package/widgets/ValuePicker.js +1 -1
  192. package/widgets/Widget.js +1 -1
  193. package/widgets/support/tests.js +1 -1
  194. package/widgets/support/uriUtils.js +1 -1
  195. package/assets/esri/core/workers/chunks/07910d16d1efae41d4bc.js +0 -1
  196. package/assets/esri/core/workers/chunks/0a3c1642cfabf9acd5c5.js +0 -1
  197. package/assets/esri/core/workers/chunks/0b7331613f91a3258352.js +0 -1
  198. package/assets/esri/core/workers/chunks/1a09dfb2c9fd7cd84cd4.js +0 -1
  199. package/assets/esri/core/workers/chunks/1dd6d68d23ba07587ae4.js +0 -1
  200. package/assets/esri/core/workers/chunks/2079f9d28e4199714f22.js +0 -1
  201. package/assets/esri/core/workers/chunks/29ba2022c2978e9bd53e.js +0 -1
  202. package/assets/esri/core/workers/chunks/29fe3e9a0ecab74bb729.js +0 -1
  203. package/assets/esri/core/workers/chunks/2bb508701ad8ccc3d6ab.js +0 -1
  204. package/assets/esri/core/workers/chunks/2ce80c764cca9e6a20cd.js +0 -1
  205. package/assets/esri/core/workers/chunks/2f23fc27d005ffa18f47.js +0 -1
  206. package/assets/esri/core/workers/chunks/35f3eef81fac7924a487.js +0 -1
  207. package/assets/esri/core/workers/chunks/4539a802cba77a7a7cc7.js +0 -1
  208. package/assets/esri/core/workers/chunks/470cf066294b053c2732.js +0 -1
  209. package/assets/esri/core/workers/chunks/4d7bd2bbe9045a2fee7a.js +0 -1
  210. package/assets/esri/core/workers/chunks/50b6be13c270d7ac80d3.js +0 -1
  211. package/assets/esri/core/workers/chunks/54ace3e4802934f3f9f2.js +0 -1
  212. package/assets/esri/core/workers/chunks/55c7c51e56d72f507c22.js +0 -1
  213. package/assets/esri/core/workers/chunks/5656cc44e3d4547668db.js +0 -1
  214. package/assets/esri/core/workers/chunks/597f450a57750637cb4d.js +0 -1
  215. package/assets/esri/core/workers/chunks/605eddec7aac891ed141.js +0 -1
  216. package/assets/esri/core/workers/chunks/6e7577cb6378ff34e722.js +0 -1
  217. package/assets/esri/core/workers/chunks/6eb8d7edafeafeb10cae.js +0 -1
  218. package/assets/esri/core/workers/chunks/71bd94cc789a55910f92.js +0 -1
  219. package/assets/esri/core/workers/chunks/74541f1a6d4228275c52.js +0 -1
  220. package/assets/esri/core/workers/chunks/75ec4d2ae9d427a1434f.js +0 -1
  221. package/assets/esri/core/workers/chunks/762567124623f6d11e67.js +0 -1
  222. package/assets/esri/core/workers/chunks/77845cd5d824c1004bfa.js +0 -1
  223. package/assets/esri/core/workers/chunks/78683f1aadc1377be5fd.js +0 -1
  224. package/assets/esri/core/workers/chunks/7a4413a188a8f1affb2f.js +0 -1
  225. package/assets/esri/core/workers/chunks/7d3b2bdc75525d47389c.js +0 -1
  226. package/assets/esri/core/workers/chunks/8063e35dacf8f99471d8.js +0 -1
  227. package/assets/esri/core/workers/chunks/81f2f1614ea27f4c2e65.js +0 -1
  228. package/assets/esri/core/workers/chunks/85a9025c2990a8bbd61b.js +0 -1
  229. package/assets/esri/core/workers/chunks/901c957c049f53318e87.js +0 -1
  230. package/assets/esri/core/workers/chunks/94f41ef15f6c61562e5e.js +0 -1
  231. package/assets/esri/core/workers/chunks/95f23bd17ce9e07fc8ef.js +0 -1
  232. package/assets/esri/core/workers/chunks/96d7f47ea8fbf345101c.js +0 -1
  233. package/assets/esri/core/workers/chunks/9f312f7284e506a84ed7.js +0 -1
  234. package/assets/esri/core/workers/chunks/a68b48fd1a529f69705e.js +0 -1
  235. package/assets/esri/core/workers/chunks/ac86d0b31f6368bd1fb1.js +0 -1
  236. package/assets/esri/core/workers/chunks/ad9b3b83aa96db7b79ea.js +0 -1
  237. package/assets/esri/core/workers/chunks/b02ac03503bfff1ff922.js +0 -1
  238. package/assets/esri/core/workers/chunks/b2666b89755323a84fcb.js +0 -1
  239. package/assets/esri/core/workers/chunks/b948fe33b4d650eea796.js +0 -1
  240. package/assets/esri/core/workers/chunks/be002f24beb832a369ce.js +0 -1
  241. package/assets/esri/core/workers/chunks/bf3c4c1bff8b71bc0b13.js +0 -1
  242. package/assets/esri/core/workers/chunks/d45ff061bf71b73e9f26.js +0 -1
  243. package/assets/esri/core/workers/chunks/d8ddff920725acb99200.js +0 -1
  244. package/assets/esri/core/workers/chunks/db4c110ab4c26c4b768c.js +0 -1
  245. package/assets/esri/core/workers/chunks/dfa4be2e07cc4c0938b0.js +0 -1
  246. package/assets/esri/core/workers/chunks/e491daf73ab1264aa1b9.js +0 -1
  247. package/assets/esri/core/workers/chunks/f2a6287c8d28be24f71e.js +0 -1
  248. package/assets/esri/core/workers/chunks/f4861d73c62096f73e48.js +0 -1
  249. package/assets/esri/core/workers/chunks/f70dd16f14279bb7e60d.js +0 -1
  250. package/assets/esri/core/workers/chunks/fa011ad649c05201e92a.js +0 -1
  251. package/views/3d/webgl-engine/lib/TextureCompressionWorker.js +0 -5
  252. package/views/3d/webgl-engine/lib/TextureCompressionWorkerHandle.js +0 -5
  253. /package/assets/esri/core/workers/chunks/{e1b42fc5c1d89333e834.js.LICENSE.txt → 239821543abbd63c5787.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{whenOnce as n}from"../../core/reactiveUtils.js";import{isAbsolute as l,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as m}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{writer as v}from"../../core/accessorSupport/decorators/writer.js";import y from"./MediaElementBase.js";import{mediaElementUrlProperty as g,mediaTypeProperty as f}from"./mediaUtils.js";import{VideoElementSymbol as j}from"../../support/mediaLayerUtils.js";import{i as w}from"../../chunks/persistableUrlUtils.js";var U;let b=class extends y{static{U=j}constructor(e){super(e),this.autoplay=!0,this.content=null,this.controller=null,this.type="video",this[U]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(Promise.all([this._preProcessVideoUrl(e),import("../video/VideoController.js")]).then((async([e,{default:t}])=>{this.controller=new t,this.controller.playerUrl=e,await n((()=>this.controller?.element)),this.controller.loop=!0,this.controller.muted=!0,this.controller.playsInline=!0,this.controller.crossOrigin="anonymous",await n((()=>"can-play"===this.controller?.state)),await this.controller.play(),this.autoplay||this.controller.pause(),this._set("content",this.controller.element)}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.controller?.currentTime}set currentTime(e){if(!this.controller)return;const t=i(e,0,this.controller.duration);this.controller?.setCurrentTime(t)}get duration(){return this.controller?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!l(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const n=a(i);!w(n)?t[r]=n:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{return d(e,!0)}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],b.prototype,"autoplay",void 0),e([u({readOnly:!0})],b.prototype,"content",void 0),e([u({readOnly:!0})],b.prototype,"contentWidth",null),e([u({readOnly:!0})],b.prototype,"contentHeight",null),e([u()],b.prototype,"controller",void 0),e([u({type:Number})],b.prototype,"currentTime",null),e([u({type:Number})],b.prototype,"duration",null),e([u(g)],b.prototype,"video",null),e([v("video")],b.prototype,"writeVideo",null),e([u(f)],b.prototype,"type",void 0),b=e([h("esri.layers.support.VideoElement")],b);const P=b;function V(e){return"string"==typeof e&&!m(e)&&!p(e)}export{P as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import o from"../../core/Error.js";import{once as r}from"../../core/events.js";import s from"../../core/Logger.js";import{clamp as i}from"../../core/mathUtils.js";import{isAbsolute as n,makeAbsolute as a,getProxyRule as c,addProxy as d,isBlobProtocol as p,isDataProtocol as l}from"../../core/urlUtils.js";import{property as u}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import{writer as h}from"../../core/accessorSupport/decorators/writer.js";import v from"./MediaElementBase.js";import{mediaElementUrlProperty as y,mediaTypeProperty as g}from"./mediaUtils.js";import{VideoElementSymbol as f}from"../../support/mediaLayerUtils.js";import{i as j}from"../../chunks/persistableUrlUtils.js";var b;let U=class extends v{static{b=f}constructor(e){super(e),this.autoplay=!0,this.content=null,this.type="video",this[b]=!0}load(){const e=this.video;return"string"==typeof e?this.addResolvingPromise(this._preProcessVideoUrl(e).then((async e=>{const t=document.createElement("video");return t.src=e,t.crossOrigin="anonymous",t.autoplay=!1,t.muted=!0,t.loop=!0,t.playsInline=!0,this._loadVideo(t).then((()=>{this._set("content",t)}))}))):e instanceof HTMLVideoElement?this.addResolvingPromise(this._loadVideo(e).then((()=>{this._set("content",e)}))):this.addResolvingPromise(Promise.reject(new o("video-element:invalid-video-type","Invalid video type",{video:e}))),Promise.resolve(this)}get contentWidth(){return this.content?.videoWidth??0}get contentHeight(){return this.content?.videoHeight??0}get currentTime(){return this.content?.currentTime}set currentTime(e){if(!this.content)return;const t=i(e,0,this.content.duration);"fastSeek"in this.content?this.content.fastSeek(t):this.content.currentTime=t,this.content.play().then((()=>{this.content?.pause()})).catch((()=>{}))}get duration(){return this.content?.duration}set video(e){"not-loaded"===this.loadStatus?this._set("video",e):s.getLogger(this).error("#video","video cannot be changed after the element is loaded.")}writeVideo(e,t,r,s){if(!e)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source is missing")));const i=V(e)?e:null;if(!i)return void(s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source must be an absolute url")));!n(i)&&s?.blockedRelativeUrls&&s.blockedRelativeUrls.push(i);const c=a(i);!j(c)?t[r]=c:s?.messages&&s.messages.push(new o("video-element:unsupported-video","video source cannot be an item resource"))}async _preProcessVideoUrl(e){if(c(e))return d(e);try{return await t(e,{method:"head"}),e}catch{try{return d(e,!0)}catch{return e}}}_loadVideo(e){return new Promise(((t,o)=>{const s=r(e,"canplay",(()=>{this.removeHandles("canplay"),this.autoplay?e.play().then(t,o):t()}));this.addHandles(s,"canplay"),"anonymous"!==e.crossOrigin&&(e.crossOrigin="anonymous",p(e.src)||(e.src=e.src))}))}};e([u()],U.prototype,"autoplay",void 0),e([u({readOnly:!0})],U.prototype,"content",void 0),e([u({readOnly:!0})],U.prototype,"contentWidth",null),e([u({readOnly:!0})],U.prototype,"contentHeight",null),e([u({type:Number})],U.prototype,"currentTime",null),e([u({type:Number})],U.prototype,"duration",null),e([u(y)],U.prototype,"video",null),e([h("video")],U.prototype,"writeVideo",null),e([u(g)],U.prototype,"type",void 0),U=e([m("esri.layers.support.VideoElement")],U);const w=U;function V(e){return"string"==typeof e&&!l(e)&&!p(e)}export{w as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as t}from"../../webdoc/support/opacityUtils.js";const s={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:e}}},l={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,n){r[n]=!e}}}},p={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:e}}},y={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},d={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:e}}},c={value:null,type:a,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:e}}};function m(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const w={write:{enabled:!0,layerContainerTypes:e},read:!0},f={type:Number,json:{origins:{"web-document":w,"portal-item":{write:{layerContainerTypes:e}}}}},b={...f,json:{...f.json,origins:{"web-document":{...w,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,n)=>n&&"service"!==n.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?t(r.layerDefinition.drawingInfo.transparency):void 0:t(r.drawingInfo.transparency)}}},g={type:r,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,i)=>{const a=r.fromJSON(e);return null!=i.spatialReference&&"object"==typeof i.spatialReference&&(a.spatialReference=n.fromJSON(i.spatialReference)),a}}}},read:!1}},u={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},j={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:e}}},v={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:e}}},T={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},I={type:o,json:{name:"attributeTableInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}};export{I as attributeTableTemplate,c as elevationInfo,u as id,p as labelsVisible,d as legendEnabled,T as listMode,v as maxScale,j as minScale,f as opacity,b as opacityDrawingInfo,l as popupEnabled,m as readOnlyService,g as sceneLayerFullExtent,s as screenSizePerspectiveEnabled,y as url};
5
+ import{excludeTables as e}from"../../core/accessorSupport/layerContainerType.js";import r from"../../geometry/Extent.js";import n from"../../geometry/SpatialReference.js";import{w as i}from"../../chunks/persistableUrlUtils.js";import a from"../../symbols/support/ElevationInfo.js";import o from"../../tables/AttributeTableTemplate.js";import{transparencyToOpacity as t}from"../../webdoc/support/opacityUtils.js";const s={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:e}}},l={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,n){r[n]=!e}}}},p={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:e}}},y={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:i}}},d={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:e}}},m={value:null,type:a,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:e}}};function c(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const f={write:{enabled:!0,layerContainerTypes:e},read:!0},w={type:Number,json:{origins:{"web-document":f,"portal-item":{write:{layerContainerTypes:e}}}}},b={...w,json:{...w.json,origins:{"web-document":{...f,write:{enabled:!0,layerContainerTypes:e,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,n)=>n&&"service"!==n.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?t(r.layerDefinition.drawingInfo.transparency):void 0:t(r.drawingInfo.transparency)}}},g={type:r,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,i)=>{const a=r.fromJSON(e);return null!=i.spatialReference&&"object"==typeof i.spatialReference&&(a.spatialReference=n.fromJSON(i.spatialReference)),a}}}},read:!1}},u={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},j={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:e}}},v={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:e}}},T={json:{write:{ignoreOrigin:!0,layerContainerTypes:e},origins:{"web-map":{read:!1,write:!1}}}},I={type:o,json:{name:"attributeTableInfo",write:!0}};export{I as attributeTableTemplate,m as elevationInfo,u as id,p as labelsVisible,d as legendEnabled,T as listMode,v as maxScale,j as minScale,w as opacity,b as opacityDrawingInfo,l as popupEnabled,c as readOnlyService,g as sceneLayerFullExtent,s as screenSizePerspectiveEnabled,y as url};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Polygon.js";import o from"./BaseRaster.js";import{clip as n}from"../rasterFunctions/clipUtils.js";import{approximateTransform as a}from"../rasterFunctions/pixelUtils.js";import{projectPolygon as l}from"../rasterFunctions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends o{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,s={}){const{rasters:i,rasterIds:o}=this.primaryRasters;let l=!1;const{interpolation:c}=s,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&p&&(l=1===i.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:l});const m=i.map((i=>i.fetchPixels(t,e,r,s))),u=await Promise.all(m),h=u.map((t=>t.pixelBlock)),f=l||s.requestRawData?u.map((t=>t.srcTilePixelSize)):null;if(s.skipRasterFunction||h.every((t=>null==t)))return u[0];const d=u.find((t=>null!=t.pixelBlock))?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o});const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=s.noClip?null:this.getClippingGeometry(d.spatialReference);return s.noClip||s.requestRawData||null==y||!t||(y=await n(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock}else R=a(y,{width:e,height:r},g.coefficients,x,c);const w=s.noClip?null:this.getClippingGeometry(t.spatialReference);return s.noClip||s.requestRawData||null==R||null==w||(R=await n(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=f(t);let s=this._clippingGeometry.get(r);return null!=s||(s=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,s)),s}async _open(t){const{rasterFunction:r}=this;this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((t=>t.rasterJobHandler=this.rasterJobHandler)));const{rasters:s,rasterIds:i}=this.primaryRasters,o=s.map((e=>e.rasterInfo?void 0:e.open(t)));await Promise.all(o);const n=s.map((({rasterInfo:t})=>t)),a=r.bind({rasterInfos:n,rasterIds:i});if(r.rawSourceRasterInfos=n,!a.success||0===n.length)throw new e("raster-function:open",`cannot bind the function: ${a.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=n[0];this.hasUniqueSourceStorageInfo=1===n.length||n.slice(1).every((t=>h(t,p))),this.set("sourceJSON",s[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,{difference:r,densify:s}=await import("../../../geometry/geometryEngine.js");let o=s(i.fromExtent(t),2*(t.width+t.height)/p);o=l(o,e.spatialReference),e=r(o,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([s("esri.layers.support.rasterDatasets.FunctionRaster")],m);const u=m;function h(t,e){const{storageInfo:r,pixelSize:s,spatialReference:i,extent:o}=t,{storageInfo:n,pixelSize:a,spatialReference:l,extent:c}=e;return s.x===a.x&&s.y===a.y&&i.equals(l)&&o.equals(c)&&r.blockHeight===n.blockHeight&&r.blockWidth===n.blockWidth&&r.maximumPyramidLevel===n.maximumPyramidLevel}function f(t){return String(t.wkid??t.wkt??t.wkt2)}export{u as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import e from"../../../core/Error.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import i from"../../../geometry/Polygon.js";import o from"./BaseRaster.js";import{clip as a}from"../rasterFunctions/clipUtils.js";import{approximateTransform as n}from"../rasterFunctions/pixelUtils.js";import{projectPolygon as l}from"../rasterFunctions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends o{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,s={}){const{rasters:i,rasterIds:o}=this.primaryRasters;let l=!1;const{interpolation:c}=s,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!s.requestRawData&&p&&(l=1===i.length&&!s.skipRasterFunction,s={...s,interpolation:"bilinear",requestRawData:l});const m=i.map((i=>i.fetchPixels(t,e,r,s))),u=await Promise.all(m),h=u.map((t=>t.pixelBlock)),f=l||s.requestRawData?u.map((t=>t.srcTilePixelSize)):null;if(s.skipRasterFunction||h.every((t=>null==t)))return u[0];const d=u.find((t=>null!=t.pixelBlock))?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:o});const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=s.noClip?null:this.getClippingGeometry(d.spatialReference);return s.noClip||s.requestRawData||null==y||!t||(y=await a(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},s)).pixelBlock}else R=n(y,{width:e,height:r},g.coefficients,x,c);const w=s.noClip?null:this.getClippingGeometry(t.spatialReference);return s.noClip||s.requestRawData||null==R||null==w||(R=await a(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=f(t);let s=this._clippingGeometry.get(r);return null!=s||(s=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,s)),s}async _open(t){const{rasterFunction:r}=this;this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach((t=>t.rasterJobHandler=this.rasterJobHandler)));const{rasters:s,rasterIds:i}=this.primaryRasters,o=s.map((e=>e.rasterInfo?void 0:e.open(t)));await Promise.all(o);const a=s.map((({rasterInfo:t})=>t)),n=r.bind({rasterInfos:a,rasterIds:i});if(r.rawSourceRasterInfos=a,!n.success||0===a.length)throw new e("raster-function:open",`cannot bind the function: ${n.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=a[0];this.hasUniqueSourceStorageInfo=1===a.length||a.slice(1).every((t=>h(t,p))),this.set("sourceJSON",s[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,r=await import("../../../geometry/operators/densifyOperator.js"),s=await import("../../../geometry/operators/differenceOperator.js");let o=r.execute(i.fromExtent(t),2*(t.width+t.height)/p);o=l(o,e.spatialReference),e=s.execute(o,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([s("esri.layers.support.rasterDatasets.FunctionRaster")],m);const u=m;function h(t,e){const{storageInfo:r,pixelSize:s,spatialReference:i,extent:o}=t,{storageInfo:a,pixelSize:n,spatialReference:l,extent:c}=e;return s.x===n.x&&s.y===n.y&&i.equals(l)&&o.equals(c)&&r.blockHeight===a.blockHeight&&r.blockWidth===a.blockWidth&&r.maximumPyramidLevel===a.maximumPyramidLevel}function f(t){return String(t.wkid??t.wkt??t.wkt2)}export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"../PixelBlock.js";function a(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function h(t,e,i){if("extent"===i.type)return o(t,e,i);const{width:a,height:h}=t,m=new Uint8Array(a*h),{contains:l,intersects:s}=await import("../../../geometry/geometryEngine.js");return s(e,i)?"polyline"===i.type?r(t,e,i):l(i,e)?t:x(t,e,i):new n({pixelType:t.pixelType,width:a,height:h,mask:m,maskIsAlpha:!1,pixels:[...t.pixels]})}function x(t,e,i){if(!t)return t;const{width:a,height:h}=t,x=e.width/a,o=e.height/h,{xmin:r,ymax:m}=e;let l;if("extent"===i.type){const t=(i.xmin-r)/x,e=(i.xmax-r)/x,n=(m-i.ymax)/o,a=(m-i.ymin)/o;l=[[[t,n],[t,a],[e,a],[e,n],[t,n]]]}else l=i.rings.map((t=>t.map((([t,e])=>[(t-r)/x,(m-e)/o]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const y=p.getImageData(0,0,a,h).data,f=t.mask,c=a*h,M=new Uint8Array(c);for(let n=0;n<c;n++)f&&!f[n]||(M[n]=y[4*n+3]>127?255:0);return new n({pixelType:t.pixelType,width:a,height:h,mask:M,maskIsAlpha:!1,pixels:[...t.pixels]})}function o(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h;if(i.width/o<.5||i.height/r<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const{xmin:m,xmax:l,ymin:s,ymax:p}=e,{xmin:y,xmax:f,ymin:c,ymax:M}=i,u=Math.max(m,y),d=Math.min(l,f),w=Math.max(s,c),g=Math.min(p,M),T=.5*o,k=.5*r;if(d-u<T||g-w<k||d<m+T||u>l-T||w>p-k||g<s+k)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const R=Math.max(0,(u-m)/o),A=Math.min(a,Math.max(0,(d-m)/o)),j=Math.max(0,(p-g)/r),U=Math.min(h,Math.max(0,(p-w)/r)),E=Math.round(R),P=Math.round(A)-1,S=Math.round(j),z=Math.round(U)-1;if(E===P&&R%1>.5&&A%1<.5||S===z&&j%1>.5&&U%1<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});if(0===E&&0===S&&P===a&&z===h)return t;const I=t.mask;for(let n=S;n<=z;n++)for(let t=E;t<=P;t++){const e=n*a+t;x[e]=I?I[e]:255}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function r(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h,{xmin:m,ymax:l}=e,{paths:s}=i,p=t.mask;for(let n=0;n<s.length;n++){const t=s[n];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,y]=t[e+1];let f=Math.floor((l-n)/r),c=Math.floor((l-y)/r);if(c<f){const t=f;f=c,c=t}f=Math.max(0,f),c=Math.min(h-1,c);const M=(s-i)/(y-n);for(let t=f;t<=c;t++){const e=t===f?Math.max(n,y):(h+1-t)*r,l=t===c?Math.min(n,y):e-r;let u=y===n?Math.floor((i-m)/o):Math.floor((M*(e-n)+i-m)/o),d=y===n?Math.floor((s-m)/o):Math.floor((M*(l-n)+i-m)/o);if(d<u){const t=u;u=d,d=t}const w=t*a;u=Math.max(0,u),d=Math.min(a-1,d);for(let t=w+u;t<=w+d;t++)x[t]=p?p[t]:255}}}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function m(t,e){const{extent:n}=l(t,e,new i({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(n.xmax=Math.min(n.xmax,a.xmax),n.ymax=Math.min(n.ymax,a.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:i}=t.pixelSize,a=Math.round(n.width/e),h=Math.round(n.height/i);t.extent=n,t.width=a,t.height=h}}function l(t,i,n,h=!0){const{spatialReference:x}=t,{x:o,y:r}=a(n,x);let m,l,s;const p="extent"===i.type?i:i.extent;let{xmin:y,xmax:f,ymax:c,ymin:M}=p;const{xmin:u,ymax:d}=t.extent;return h?(y=u+(y>u?o*Math.round((y-u)/o):0),c=d-(c<d?r*Math.round((d-c)/r):0),f=u+(f>u?o*Math.round((f-u)/o):0),M=d-(M<d?r*Math.round((d-M)/r):0),m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x}),l=Math.round(m.width/o),s=Math.round(m.height/r)):(l=Math.floor((f-y)/o+.8),s=Math.floor((c-M)/r+.8),y=u+(y>u?o*Math.floor((y-u)/o+.1):0),c=d-(c<d?r*Math.floor((d-c)/r+.1):0),f=y+l*o,M=c-s*r,m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x})),{extent:m,width:l,height:s}}export{h as clip,m as clipRasterInfo,l as snapToRaster};
5
+ import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"../PixelBlock.js";function a(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function h(t,e,i){if("extent"===i.type)return r(t,e,i);const{width:a,height:h}=t,m=new Uint8Array(a*h);if(!(await import("../../../geometry/operators/intersectsOperator.js")).execute(e,i))return new n({pixelType:t.pixelType,width:a,height:h,mask:m,maskIsAlpha:!1,pixels:[...t.pixels]});if("polyline"===i.type)return x(t,e,i);return(await import("../../../geometry/operators/containsOperator.js")).execute(i,e)?t:o(t,e,i)}function o(t,e,i){if(!t)return t;const{width:a,height:h}=t,o=e.width/a,r=e.height/h,{xmin:x,ymax:m}=e;let l;if("extent"===i.type){const t=(i.xmin-x)/o,e=(i.xmax-x)/o,n=(m-i.ymax)/r,a=(m-i.ymin)/r;l=[[[t,n],[t,a],[e,a],[e,n],[t,n]]]}else l=i.rings.map((t=>t.map((([t,e])=>[(t-x)/o,(m-e)/r]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const y=p.getImageData(0,0,a,h).data,f=t.mask,c=a*h,u=new Uint8Array(c);for(let n=0;n<c;n++)f&&!f[n]||(u[n]=y[4*n+3]>127?255:0);return new n({pixelType:t.pixelType,width:a,height:h,mask:u,maskIsAlpha:!1,pixels:[...t.pixels]})}function r(t,e,i){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h;if(i.width/r<.5||i.height/x<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const{xmin:m,xmax:l,ymin:s,ymax:p}=e,{xmin:y,xmax:f,ymin:c,ymax:u}=i,M=Math.max(m,y),w=Math.min(l,f),d=Math.max(s,c),g=Math.min(p,u),T=.5*r,k=.5*x;if(w-M<T||g-d<k||w<m+T||M>l-T||d>p-k||g<s+k)return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});const R=Math.max(0,(M-m)/r),j=Math.min(a,Math.max(0,(w-m)/r)),A=Math.max(0,(p-g)/x),U=Math.min(h,Math.max(0,(p-d)/x)),P=Math.round(R),S=Math.round(j)-1,z=Math.round(A),E=Math.round(U)-1;if(P===S&&R%1>.5&&j%1<.5||z===E&&A%1>.5&&U%1<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]});if(0===P&&0===z&&S===a&&E===h)return t;const I=t.mask;for(let n=z;n<=E;n++)for(let t=P;t<=S;t++){const e=n*a+t;o[e]=I?I[e]:255}return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function x(t,e,i){const{width:a,height:h}=t,o=new Uint8Array(a*h),r=e.width/a,x=e.height/h,{xmin:m,ymax:l}=e,{paths:s}=i,p=t.mask;for(let n=0;n<s.length;n++){const t=s[n];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,y]=t[e+1];let f=Math.floor((l-n)/x),c=Math.floor((l-y)/x);if(c<f){const t=f;f=c,c=t}f=Math.max(0,f),c=Math.min(h-1,c);const u=(s-i)/(y-n);for(let t=f;t<=c;t++){const e=t===f?Math.max(n,y):(h+1-t)*x,l=t===c?Math.min(n,y):e-x;let M=y===n?Math.floor((i-m)/r):Math.floor((u*(e-n)+i-m)/r),w=y===n?Math.floor((s-m)/r):Math.floor((u*(l-n)+i-m)/r);if(w<M){const t=M;M=w,w=t}const d=t*a;M=Math.max(0,M),w=Math.min(a-1,w);for(let t=d+M;t<=d+w;t++)o[t]=p?p[t]:255}}}return new n({pixelType:t.pixelType,width:a,height:h,mask:o,pixels:[...t.pixels]})}function m(t,e){const{extent:n}=l(t,e,new i({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(n.xmax=Math.min(n.xmax,a.xmax),n.ymax=Math.min(n.ymax,a.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:i}=t.pixelSize,a=Math.round(n.width/e),h=Math.round(n.height/i);t.extent=n,t.width=a,t.height=h}}function l(t,i,n,h=!0){const{spatialReference:o}=t,{x:r,y:x}=a(n,o);let m,l,s;const p="extent"===i.type?i:i.extent;let{xmin:y,xmax:f,ymax:c,ymin:u}=p;const{xmin:M,ymax:w}=t.extent;return h?(y=M+(y>M?r*Math.round((y-M)/r):0),c=w-(c<w?x*Math.round((w-c)/x):0),f=M+(f>M?r*Math.round((f-M)/r):0),u=w-(u<w?x*Math.round((w-u)/x):0),m=new e({xmin:y,ymax:c,xmax:f,ymin:u,spatialReference:o}),l=Math.round(m.width/r),s=Math.round(m.height/x)):(l=Math.floor((f-y)/r+.8),s=Math.floor((c-u)/x+.8),y=M+(y>M?r*Math.floor((y-M)/r+.1):0),c=w-(c<w?x*Math.floor((w-c)/x+.1):0),f=y+l*r,u=c-s*x,m=new e({xmin:y,ymax:c,xmax:f,ymin:u,spatialReference:o})),{extent:m,width:l,height:s}}export{h as clip,m as clipRasterInfo,l as snapToRaster};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/unitUtils.js";import i from"../../../geometry/Extent.js";import{P as o,a as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import c from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{canProjectWithoutEngine as u,isLoaded as m,load as x,getTransformation as h,project as p}from"../../../geometry/projection.js";import g from"../../../geometry/SpatialReference.js";import{getInfo as y}from"../../../geometry/support/spatialReferenceUtils.js";var d;function w(e,t,n){return!u(e,t,n)}function M(e,n,i){const o=w(e,n,i);if(o&&!m())throw new t("rasterprojectionhelper-project","projection engine is not loaded");return o}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(d||(d={}));const R=(e,t,n,i=0)=>{if(1===n[0])return[0,0];let o=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(o=o>e[g]?e[g]:o,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-o)/l/n[0],u=(a-s)/c/n[1],m=2*i;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,i=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,o=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((i-e[n+2*c+2])/f),s=Math.abs((o-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},S={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},P=32,b=4,G=b,k=new Map,E=new Map,N=500,T=39.37,v=96;let C=null;async function j(){C&&m()||(m()||await x(),C=await import("../../../geometry/geometryEngine.js"))}function _(e,t,n){M(e.spatialReference,t);return n?h(t,e.spatialReference,e):h(e.spatialReference,t,e)}function z(e,t,n,o=null){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;M(r,t,o);const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=p(a,t,o),c=te(t);return null==l||null!=c&&l.width>=c?L(e,r,t):{x:l.width,y:l.height}}function L(e,t,i){const o=n(t)/n(i);return{x:e.x*o,y:e.y*o}}function I(e,i,o){const{spatialReference:r}=o;if(!r||!i||r.equals(i))return e;if(r.isGeographic&&i.isGeographic)return L(e,r,i);if(M(r,i),!C)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*n(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const u=256,m=s*u/2,x=a*u/2,{x:h,y:g}=o.center,y=[];for(let t=0;t<=u;t++)y.push([h-m,g-x+t*a]);for(let t=1;t<=u;t++)y.push([h-m+t*s,g+x]);for(let t=1;t<=u;t++)y.push([h+m,g+x-t*a]);for(let t=1;t<u;t++)y.push([h+m-t*s,g-x]);y.push(y[0]);const d=new f({rings:[y],spatialReference:r}),w=p(d,i);if(!w)return L(e,r,i);const R=w.extent,S=te(i);if(null==R||null!=S&&R.width>=S)return L(e,r,i);const P=C.planarArea(w),b=s*a*u*u,G=Math.sqrt(P/b)/c,k={x:R.width/c/u,y:R.height/c/u},E={x:s*G,y:a*G},N=k.x*k.y;return Math.abs(N-E.x*E.y)/N<.1?k:E}function W(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*n(t)*v*T}function O(e,t){const{pixelSize:n,extent:i}=e;return W(I(n,t,i),t)}function A(e,t=.01){return n(e)?t/n(e):0}function B(e,t,n=null,i=!0){const o=e.spatialReference;if(o.equals(t))return e;M(o,t,n);const r=p(e,t,n);return i&&r?(F([e],[r],o,t),r):r}function F(e,t,n,i){const o=ne(n,!0),r=ne(i,!0),s=A(n,N),a=A(i,N);if(s&&null!=o&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:i}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(i-o[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(i-o[1])<s&&(n.x+=r[1]-r[0])}}function q(e){const{inSR:t,outSR:n,datumTransformation:i,preferPE:o}=e;if(t.equals(n)){const{points:t}=D(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return U(e);if(M(t,n,i)&&o){if(t.isGeographic)return J(e);if(null!=X(t))return J(e)}return Y(e)}function Y(e){const{points:t}=D(e,null),{inSR:n,outSR:i,datumTransformation:o}=e,r=t.map((e=>new c(e[0],e[1],n))),s=p(r,i,o);return o&&F(r,s,n,i),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function J(e){const{inSR:t,outSR:n,datumTransformation:i}=e,l=X(t),{points:c,mask:f}=D(e,l);if(!t.isGeographic){const e=t.wkid?o.coordsys(t.wkid):o.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt2||t.wkt);s.projToGeog(e,c.length,c)}if(null!=i&&i.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map((([e])=>e>t?1:e<-179.9955?-1:0))),i.steps.forEach((e=>{const t=e.wkid?o.geogtran(e.wkid):o.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);a.geogToGeog(t,c.length,c,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<c.length;n++){const i=e[n],o=c[n][0],r=o>t?1:o<-179.9955?-1:0;i&&r&&i!==r&&(c[n][0]=i>0?o+360:o-360)}}if(!n.isGeographic){const e=X(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];H(c,t);const i=n.wkid?o.coordsys(n.wkid):o.fromString(n.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,n.wkt2||n.wkt);s.geogToProj(i,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function U(e){const{cols:t,rows:n,xres:i,yres:o,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:f}=e;r&&(l+=i/2,f-=o/2);const u=[],m=[],x=Math.max(t,n);for(let g=0;g<x;g++){const e=l+i*Math.min(t,g),r=f-o*Math.min(n,g),x=p(new c({x:e,y:r,spatialReference:s}),a);g<=t&&u.push(x.x),g<=n&&m.push(x.y)}const h=[];for(let c=0;c<t;c++)for(let e=0;e<n;e++)h.push([u[c],m[e]]);return h}function X(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),k.has(n)){const e=k.get(n);return t?e?.gcs:e?.pcs}const i=e.wkid?o.coordsys(e.wkid):o.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt2||e.wkt),s=K(i,A(e,1e-4)),a=K(i,0,!0);return k.set(n,{pcs:s,gcs:a}),t?a:s}function K(e,t=0,n=!1){const i=l.generate(e),o=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!i||!o?.length)return null;let r=!1,s=o.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=o.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===i.getNorthPoleLocation()?1:0)|(2===i.getSouthPoleLocation()?2:0),c=i.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[x,h]=f[0],[p,g]=f[0];for(let l=0,y=f.length;l<y;l++){u++,u===y&&(u=0);const[e,t]=f[l],[n,i]=f[u];if(i===t)m.push([e,n,t,i,2]);else{const o=(n-e)/(i-t||1e-4),r=e-o*t;t<i?m.push([o,r,t,i,0]):m.push([o,r,i,t,1])}x=x<e?x:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:m,bbox:[x,h,p,g],poleLocation:a}}function D(e,t){const n=[],{cols:i,rows:o,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<i;e++)for(let t=0;t<o;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(i*o);if(t.isEnvelope){const{bbox:[e,a,u,m]}=t;for(let x=0,h=0;x<i;x++){const i=l+r*x,p=t.isPannable||i>=e&&i<=u;for(let e=0;e<o;e++,h++){const t=c-s*e;p&&t>=a&&t<=m&&(n.push([i,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,m=[];for(let x=0;x<o;x++){const e=c-s*x,t=[],n=[];for(let o=0;o<u.length;o++){const[i,r,s,a,l]=u[o];if(e===s&&s===a)t.push(i),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const o=i*e+r;t.push(o),n.push(l)}}let i=t;if(t.length>2){let e=2===n[0]?0:n[0],o=t[0];i=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(i.push(0===e?Math.min(o,t[r-1]):Math.max(o,t[r-1])),e=n[r],o=t[r]),r===n.length-1&&i.push(0===n[r]?Math.min(o,t[r]):Math.max(o,t[r])));i.sort(((e,t)=>e-t))}else t[0]>t[1]&&(i=[t[1],t[0]]);m.push(i)}for(let x=0,h=0;x<i;x++){const e=l+r*x;for(let t=0;t<o;t++,h++){const i=c-s*t,o=m[t];if(2===o.length)e>=o[0]&&e<=o[1]&&(n.push([e,i]),f[h]=1);else if(o.length>2){let t=!1;for(let n=0;n<o.length;n+=2)if(e>=o[n]&&e<=o[n+1]){t=!0;break}t&&(n.push([e,i]),f[h]=1)}}}return{points:n,mask:f}}function H(e,t){const[n,i]=t;for(let o=0;o<e.length;o++){const t=e[o][1];(t<n||t>i)&&(e[o]=[NaN,NaN])}}function Q(e,t){const n=te(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??A(e[0].spatialReference),1===(e=e.filter((e=>e.width>t))).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function V(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n))return t;const a=oe(t),l=te(s,!0),c=te(n);if(0===a||null==l||null==c){const e=ee(t,n,o,r);if(null==l&&null!=c&&Math.abs(e.width-c)<A(n)&&m()){const i=X(s);if(null!=i&&i.poleLocation===d.None&&t.width<(i.bbox[2]-i.bbox[0])/2)return $(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>A(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return Q(f.map((e=>ee(e,n,o,r))).filter(e))}function Z(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:i,ymax:o,spatialReference:r}=e;e=new f({rings:[[[t,o],[i,o],[i,n],[t,n],[t,o]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(M(e.spatialReference,t,n),p(e,t,n))}function $(e,t){const n=te(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new f({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),u=p(c,t);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:m}=u,x=A(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=m[i][0][0],r=a=m[i][0][1];for(let e=0;e<m[i].length;e++)o=o>m[i][e][0]?m[i][e][0]:o,s=s<m[i][e][0]?m[i][e][0]:s,r=r>m[i][e][1]?m[i][e][1]:r,a=a<m[i][e][1]?m[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<x)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<x))return null;h.xmax=s+n}}return h}function ee(e,t,n=null,i=!0,o=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;M(r,t,n);const s=p(e,t,n);if(o&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!i||!s)return s;const a=ne(r,!0),l=ne(t,!0);if(null==a||null==l)return s;const f=A(r,.001),u=A(r,N),m=A(t,.001);if(Math.abs(s.xmin-l[0])<m&&Math.abs(s.xmax-l[1])<m){const i=Math.abs(e.xmin-a[0]),o=Math.abs(a[1]-e.xmax);if(i<f&&o>u){s.xmin=l[0];const i=[];i.push(new c(e.xmax,e.ymin,r)),i.push(new c(e.xmax,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmax,e.ymax,r));const o=i.map((e=>B(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmax=Math.max.apply(null,o)}if(o<f&&i>u){s.xmax=l[1];const i=[];i.push(new c(e.xmin,e.ymin,r)),i.push(new c(e.xmin,(e.ymin+e.ymax)/2,r)),i.push(new c(e.xmin,e.ymax,r));const o=i.map((e=>B(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmin=Math.min.apply(null,o)}}else{const e=A(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function te(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*S[e.wkid]||null}function ne(e,t=!1){if(e.isGeographic)return[-180,180];const n=te(e,t);return null!=n?[-n/2,n/2]:null}function ie(e,t,n,i){let o=(e-t)/n;return o-Math.floor(o)!=0?o=Math.floor(o):i&&(o-=1),o}function oe(e,t=!1){const n=te(e.spatialReference);if(null==n)return 0;const i=t?0:-(n/2),o=A(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<o?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<o?-n/2:e.xmin;return ie(r,i,n,!0)-ie(s,i,n,!1)}function re(e){const t=e.storageInfo.origin.x,n=te(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const i=n/2,{nativePixelSize:o,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=o.x;const u=[],m=null!=e.transform&&"gcs-shift"===e.transform.type,x=t+(m?0:i),h=m?n-t:i-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)==0?e:Math.ceil(e),i=h/f/l,o=i-Math.floor(i)==0?i:Math.ceil(i),r=Math.floor(x/f/l),a=Math.round(x/f)%l,m=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:o,leftMargin:a,rightPadding:m,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:i,pyramidsInfo:u,hasGCSSShiftTransform:m}}function se(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(E.has(t))n=E.get(t);else{n=(e.wkid?o.coordsys(e.wkid):o.fromString(r.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),E.set(t,n)}return new g({wkid:n})}function ae(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[P,P],i=le(e),o={cols:i.size[0]+1,rows:i.size[1]+1};const r=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let s=i.outofBoundPointCount===i.offsets.length/2||t&&r?[0,0]:R(i.offsets,o,n,G);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>G)){w(l,c,e.datumTransformation)&&(l.isGeographic||X(l)),n=[b,b],i=le({...e,spacing:n}),o={cols:i.size[0]+1,rows:i.size[1]+1},s=R(i.offsets,o,n,G)}if(i.error=s,n[0]>1&&(i.coefficients=ce(i.offsets,o,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:n};else{const t=X(l);if(null!=t&&!t.isEnvelope){const t=se(l),s=V(e.projectedExtent,t),{offsets:a}=le({...e,srcBufferExtent:s,spacing:n}),c=ce(a,o,r);i.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return i}function le(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:i,datumTransformation:o,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference,l=M(s,a),{xmin:f,ymin:u,xmax:m,ymax:x}=t,h=te(a),p=null!=h&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[P,P],y=g[0]*i.x,d=g[1]*i.y,w=1===g[0],R=Math.ceil((m-f)/y-.1/g[0])+(w?0:1),S=Math.ceil((x-u)/d-.1/g[1])+(w?0:1),G=q({cols:R,rows:S,xmin:f,ymax:x,xres:y,yres:d,inSR:s,outSR:a,datumTransformation:o,preferPE:g[0]<=b,usePixelCenter:w}),k=[];let E,T=0;const v=w?-1:NaN,{xmin:C,xmax:j,ymax:_,width:z,height:L}=n,I=A(a,N),W=null!=h&&C>0&&j>h/2;let O=!1;if(l){const e=X(s);O=null!=e&&e.poleLocation>0}for(let M=0;M<R;M++){const e=[];for(let t=0;t<S;t++){let n=G[M*S+t];if(p&&n[0]>j&&n[0]>h/2-I?n[0]-=h:p&&0===M&&n[0]<0&&W&&!r&&(n[0]+=h),!n||isNaN(n[0])||isNaN(n[1]))k.push(v),k.push(v),e.push(null),T++;else{if(r){const e=r.inverseTransform(new c({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),M>0&&p&&E[t]&&n[0]<E[t][0]&&(n[0]+=h,O&&n[0]>j&&n[0]>h&&(n[0]-=h)),k.push((n[0]-C)/z),k.push((_-n[1])/L)}}E=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:w?[R,S]:[R-1,S-1]}}function ce(e,t,n){const{cols:i,rows:o}=t,r=new Float32Array((i-1)*(o-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<i-1;l++){for(let t=0;t<o-1;t++){let n=l*o*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*o;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(i-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function fe(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:Q(n,t)}function ue(e){const{spatialReference:t}=e,n=y(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function me(e,t,i){const{storageInfo:o,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=o,f="mixed"===o.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,o.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=l&&l.length){const e=l[l.length-1],o=(e.x+e.y)/2,f=(r.x+r.y)/2;if(u<=f)s=0;else if(u>=o)s=l.length,a=u/o>8;else{let e,t=f;for(let n=1;n<=l.length;n++){if(e=(l[n-1].x+l[n-1].y)/2,u<=e){u===e?s=n:"down"===i?(s=n-1,a=u/t>8):s="up"===i||u-t>e-u||u/t>2?n:n-1;break}t=e}}const m=0===s?r:l[s-1];if(a){Math.min(m.x,m.y)*n(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new c({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:a}}const m=Math.log(e.x/r.x)/Math.LN2,x=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===i?Math.floor(Math.min(m,x)):"up"===i?Math.ceil(Math.max(m,x)):Math.round((m+x)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new c({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function xe(e,t,n=!1){const{pixelSize:i,extent:o}=e,r=_(o,t,!1),s=V(fe(o,(i.x+i.y)/16),t,r);return n||0===oe(s)?s:ee(o,t,r)}function he(e,t,n){const i=n?.tileSize??512,o=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,spatialReference:a,pixelSize:l}=e,c=I(l,t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=W(f,t),m=t.isGeographic?256/i*295828763.7958547:256/i*591657527.591555;let x="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const h=xe(e,t,!0),p=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(m/2/u)/Math.LN2));if(!x&&o&&(t.isGeographic||t.isWebMercator)){const n=te(t);if(x=oe(h)>0||null!=n&&h.width>n/4,!x&&null!=n){let t=-1;if(p<3)t=2**p*f*i;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:o=2}=e.storageInfo;t=o**n*f*i}const o=Math.ceil(n/t);x=1===o||2===o&&n/2-h.xmax<t}}let y,d=u;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(x){d=m;const n=t.isGeographic?1341104507446289e-21:.29858214164761665,i=W(n,t),o=t.isGeographic?4326:3857;y=I({x:n,y:n},a,xe(e,new g({wkid:o}),!0)),y.x*=d/i,y.y*=d/i}else{y={x:l.x,y:l.y};let e=0;for(;d<m*(w/2)&&e<p;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,m)/Math.min(d,m)<=w&&(d=m)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,u)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*l.x;let t=S.findIndex((t=>t.x>=l.x-e&&t.x<=l.x+e));t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex((t=>t.x<=l.x+e)),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:c,scales:R,srcResolutions:S,isCustomTilingScheme:!x}}export{he as computeProjectedScales,P as defaultGridSpacing,G as defaultProjectionToleranceInPixels,_ as getDefaultDatumTransformationForDataset,q as getProjectedGridPoints,ae as getProjectionOffsetGrid,re as getRasterDatasetAlignmentInfo,O as getSourceScale,te as getWorldWidth,oe as getWorldWrapCount,j as load,b as minimumGridSpacing,xe as projectDatasetExtent,I as projectDatasetResolution,V as projectExtent,B as projectPoint,Z as projectPolygon,z as projectResolution,w as requirePE,ue as shiftExtent,fe as snapExtent,me as snapPyramid};
5
+ import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{createResolver as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import i from"../../../geometry/Extent.js";import{P as r,a as s,g as a,h as l,j as c}from"../../../chunks/pe.js";import f from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as m}from"../../../geometry/projection.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as h}from"../../../geometry/support/spatialReferenceUtils.js";var p;function g(){if(!j)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(p||(p={}));const y=(e,t,n,o=0)=>{if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},d={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},w=32,M=4,R=M,S=new Map,P=new Map,b=500,G=39.37,k=96;let N,E,T,j=!1;async function v(){return N||(N=n(),E=await import("../../../geometry/operators/projectOperator.js"),T=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),E.isLoaded()||await E.load(),T.isLoaded()||await T.load(),j=!0,N.resolve()),N.promise}function C(e,t,n){if(g(),n){const n=E.execute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function _(e,t,n,o){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;g();const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=E.execute(a,t,{geographicTransformation:o}),c=ee(t);return null==l||null!=c&&l.width>=c?z(e,r,t):{x:l.width,y:l.height}}function z(e,t,n){const i=o(t)/o(n);return{x:e.x*i,y:e.y*i}}function L(e,n,i){const{spatialReference:r}=i;if(!r||!n||r.equals(n))return e;if(r.isGeographic&&n.isGeographic)return z(e,r,n);if(g(),!j)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*o(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const f=256,m=s*f/2,x=a*f/2,{x:h,y:p}=i.center,y=[];for(let t=0;t<=f;t++)y.push([h-m,p-x+t*a]);for(let t=1;t<=f;t++)y.push([h-m+t*s,p+x]);for(let t=1;t<=f;t++)y.push([h+m,p+x-t*a]);for(let t=1;t<f;t++)y.push([h+m-t*s,p-x]);y.push(y[0]);const d=new u({rings:[y],spatialReference:r}),w=E.execute(d,n);if(!w)return z(e,r,n);const M=w.extent,R=ee(n);if(null==M||null!=R&&M.width>=R)return z(e,r,n);const S=he(w.rings),P=s*a*f*f,b=Math.sqrt(S/P)/c,G={x:M.width/c/f,y:M.height/c/f},k={x:s*b,y:a*b},N=G.x*G.y;return Math.abs(N-k.x*k.y)/N<.1?G:k}function I(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*o(t)*k*G}function O(e,t){const{pixelSize:n,extent:o}=e;return I(L(n,t,o),t)}function W(e,t=.01){return o(e)?t/o(e):0}function A(e,t,n,o=!0){const i=e.spatialReference;if(i.equals(t))return e;g();const r=E.execute(e,t,{geographicTransformation:n});return o&&r?(B([e],[r],i,t),r):r}function B(e,t,n,o){const i=te(n,!0),r=te(o,!0),s=W(n,b),a=W(o,b);if(s&&null!=i&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:o}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(o-i[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(o-i[1])<s&&(n.x+=r[1]-r[0])}}function F(e){const{inSR:t,outSR:n,preferPE:o}=e;if(t.equals(n)){const{points:t}=K(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return U(e);if(o){if(t.isGeographic)return Y(e);if(null!=J(t))return Y(e)}return q(e)}function q(e){const{points:t}=K(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map((e=>new f(e[0],e[1],n))),s=E.executeMany(r,o,{geographicTransformation:i});return i&&B(r,s,n,o),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function Y(e){const{inSR:t,outSR:n,datumTransformation:o}=e,i=J(t),{points:c,mask:f}=K(e,i);if(!t.isGeographic){const e=t.wkid?r.coordsys(t.wkid):r.fromString(t.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=o&&o.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map((([e])=>e>t?1:e<-179.9955?-1:0))),o.steps.forEach((e=>{const t=e.wkid?r.geogtran(e.wkid):r.fromString(s.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?s.PE_TRANSFORM_2_TO_1:s.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<c.length;n++){const o=e[n],i=c[n][0],r=i>t?1:i<-179.9955?-1:0;o&&r&&o!==r&&(c[n][0]=o>0?i+360:i-360)}}if(!n.isGeographic){const e=J(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];D(c,t);const o=n.wkid?r.coordsys(n.wkid):r.fromString(n.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(o,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function U(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const u=[],x=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),h=m(new f({x:e,y:r,spatialReference:s}),s,a);g<=t&&u.push(h.x),g<=n&&x.push(h.y)}const p=[];for(let f=0;f<t;f++)for(let e=0;e<n;e++)p.push([u[f],x[e]]);return p}function J(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),S.has(n)){const e=S.get(n);return t?e?.gcs:e?.pcs}const o=e.wkid?r.coordsys(e.wkid):r.fromString(e.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,e.wkt2||e.wkt),i=X(o,W(e,1e-4)),a=X(o,0,!0);return S.set(n,{pcs:i,gcs:a}),t?a:i}function X(e,t=0,n=!1){const o=c.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),l=o.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:l,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[x,h]=f[0],[p,g]=f[0];for(let c=0,y=f.length;c<y;c++){u++,u===y&&(u=0);const[e,t]=f[c],[n,o]=f[u];if(o===t)m.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?m.push([i,r,t,o,0]):m.push([i,r,o,t,1])}x=x<e?x:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:l,vertices:f,coef:m,bbox:[x,h,p,g],poleLocation:a}}function K(e,t){const n=[],{cols:o,rows:i,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<o;e++)for(let t=0;t<i;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(o*i);if(t.isEnvelope){const{bbox:[e,a,u,m]}=t;for(let x=0,h=0;x<o;x++){const o=l+r*x,p=t.isPannable||o>=e&&o<=u;for(let e=0;e<i;e++,h++){const t=c-s*e;p&&t>=a&&t<=m&&(n.push([o,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,m=[];for(let x=0;x<i;x++){const e=c-s*x,t=[],n=[];for(let i=0;i<u.length;i++){const[o,r,s,a,l]=u[i];if(e===s&&s===a)t.push(o),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const i=o*e+r;t.push(i),n.push(l)}}let o=t;if(t.length>2){let e=2===n[0]?0:n[0],i=t[0];o=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(o.push(0===e?Math.min(i,t[r-1]):Math.max(i,t[r-1])),e=n[r],i=t[r]),r===n.length-1&&o.push(0===n[r]?Math.min(i,t[r]):Math.max(i,t[r])));o.sort(((e,t)=>e-t))}else t[0]>t[1]&&(o=[t[1],t[0]]);m.push(o)}for(let x=0,h=0;x<o;x++){const e=l+r*x;for(let t=0;t<i;t++,h++){const o=c-s*t,i=m[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(n.push([e,o]),f[h]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(n.push([e,o]),f[h]=1)}}}return{points:n,mask:f}}function D(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function H(e,t){const n=ee(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??W(e[0].spatialReference),1===(e=e.filter((e=>e.width>t))).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function Q(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=oe(t),l=ee(s,!0),c=ee(n);if(0===a||null==l||null==c){const e=$(t,n,o,r);if(null==l&&null!=c&&Math.abs(e.width-c)<W(n)&&E.isLoaded()){const o=J(s);if(null!=o&&o.poleLocation===p.None&&t.width<(o.bbox[2]-o.bbox[0])/2)return Z(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>W(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return H(f.map((e=>$(e,n,o,r))).filter(e))}function V(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:o,ymax:i,spatialReference:r}=e;e=new u({rings:[[[t,i],[o,i],[o,n],[t,n],[t,i]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(g(),E.execute(e,t,{geographicTransformation:n}))}function Z(e,t){const n=ee(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new u({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),f=E.execute(c,t);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:m}=f,x=W(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=m[i][0][0],r=a=m[i][0][1];for(let e=0;e<m[i].length;e++)o=o>m[i][e][0]?m[i][e][0]:o,s=s<m[i][e][0]?m[i][e][0]:s,r=r>m[i][e][1]?m[i][e][1]:r,a=a<m[i][e][1]?m[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<x)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<x))return null;h.xmax=s+n}}return h}function $(e,t,n,o=!0,i=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;g();const s=E.execute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!o||!s)return s;const a=te(r,!0),l=te(t,!0);if(null==a||null==l)return s;const c=W(r,.001),u=W(r,b),m=W(t,.001);if(Math.abs(s.xmin-l[0])<m&&Math.abs(s.xmax-l[1])<m){const o=Math.abs(e.xmin-a[0]),i=Math.abs(a[1]-e.xmax);if(o<c&&i>u){s.xmin=l[0];const o=[];o.push(new f(e.xmax,e.ymin,r)),o.push(new f(e.xmax,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmax,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmax=Math.max.apply(null,i)}if(i<c&&o>u){s.xmax=l[1];const o=[];o.push(new f(e.xmin,e.ymin,r)),o.push(new f(e.xmin,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmin,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmin=Math.min.apply(null,i)}}else{const e=W(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function ee(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*d[e.wkid]||null}function te(e,t=!1){if(e.isGeographic)return[-180,180];const n=ee(e,t);return null!=n?[-n/2,n/2]:null}function ne(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function oe(e,t=!1){const n=ee(e.spatialReference);if(null==n)return 0;const o=t?0:-(n/2),i=W(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<i?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<i?-n/2:e.xmin;return ne(r,o,n,!0)-ne(s,o,n,!1)}function ie(e){const t=e.storageInfo.origin.x,n=ee(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const o=n/2,{nativePixelSize:i,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=i.x;const u=[],m=null!=e.transform&&"gcs-shift"===e.transform.type,x=t+(m?0:o),h=m?n-t:o-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)==0?e:Math.ceil(e),o=h/f/l,i=o-Math.floor(o)==0?o:Math.ceil(o),r=Math.floor(x/f/l),a=Math.round(x/f)%l,m=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:m,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:o,pyramidsInfo:u,hasGCSSShiftTransform:m}}function re(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(P.has(t))n=P.get(t);else{n=(e.wkid?r.coordsys(e.wkid):r.fromString(s.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),P.set(t,n)}return new x({wkid:n})}function se(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[w,w],o=ae(e),i={cols:o.size[0]+1,rows:o.size[1]+1};const r=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;let s=o.outofBoundPointCount===o.offsets.length/2||t&&r?[0,0]:y(o.offsets,i,n,R);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>R)&&(l.isGeographic||J(l),n=[M,M],o=ae({...e,spacing:n}),i={cols:o.size[0]+1,rows:o.size[1]+1},s=y(o.offsets,i,n,R)),o.error=s,n[0]>1&&(o.coefficients=le(o.offsets,i,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:n};else{const t=J(l);if(null!=t&&!t.isEnvelope){const t=re(l),s=Q(e.projectedExtent,t),{offsets:a}=ae({...e,srcBufferExtent:s,spacing:n}),c=le(a,i,r);o.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return o}function ae(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:o,datumTransformation:i,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;g();const{xmin:l,ymin:c,xmax:u,ymax:m}=t,x=ee(a),h=null!=x&&(e.hasWrapAround||"gcs-shift"===r?.type),p=e.spacing||[w,w],y=p[0]*o.x,d=p[1]*o.y,R=1===p[0],S=Math.ceil((u-l)/y-.1/p[0])+(R?0:1),P=Math.ceil((m-c)/d-.1/p[1])+(R?0:1),G=F({cols:S,rows:P,xmin:l,ymax:m,xres:y,yres:d,inSR:s,outSR:a,datumTransformation:i,preferPE:p[0]<=M,usePixelCenter:R}),k=[];let N,E=0;const T=R?-1:NaN,{xmin:j,xmax:v,ymax:C,width:_,height:z}=n,L=W(a,b),I=null!=x&&j>0&&v>x/2,O=J(s),A=null!=O&&O.poleLocation>0;for(let g=0;g<S;g++){const e=[];for(let t=0;t<P;t++){let n=G[g*P+t];if(h&&n[0]>v&&n[0]>x/2-L?n[0]-=x:h&&0===g&&n[0]<0&&I&&!r&&(n[0]+=x),!n||isNaN(n[0])||isNaN(n[1]))k.push(T),k.push(T),e.push(null),E++;else{if(r){const e=r.inverseTransform(new f({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),g>0&&h&&N[t]&&n[0]<N[t][0]&&(n[0]+=x,A&&n[0]>v&&n[0]>x&&(n[0]-=x)),k.push((n[0]-j)/_),k.push((C-n[1])/z)}}N=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:E,spacing:p,size:R?[S,P]:[S-1,P-1]}}function le(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ce(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:H(n,t)}function fe(e){const{spatialReference:t}=e,n=h(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ue(e,t,n){const{storageInfo:i,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=i,c="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/c;if(null!=l&&l.length){const e=l[l.length-1],i=(e.x+e.y)/2,c=(r.x+r.y)/2;if(u<=c)s=0;else if(u>=i)s=l.length,a=u/i>8;else{let e,t=c;for(let o=1;o<=l.length;o++){if(e=(l[o-1].x+l[o-1].y)/2,u<=e){u===e?s=o:"down"===n?(s=o-1,a=u/t>8):s="up"===n||u-t>e-u||u/t>2?o:o-1;break}t=e}}const m=0===s?r:l[s-1];if(a){Math.min(m.x,m.y)*o(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new f({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:a}}const m=Math.log(e.x/r.x)/Math.LN2,x=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===n?Math.floor(Math.min(m,x)):"up"===n?Math.ceil(Math.max(m,x)):Math.round((m+x)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new f({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function me(e,t,n=!1){const{pixelSize:o,extent:i}=e,r=C(i,t,!1),s=Q(ce(i,(o.x+o.y)/16),t,r);return n||0===oe(s)?s:$(i,t,r)}function xe(e,t,n){const o=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,spatialReference:a,pixelSize:l}=e,c=L(l,t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=I(f,t),m=t.isGeographic?256/o*295828763.7958547:256/o*591657527.591555;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=me(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(m/2/u)/Math.LN2));if(!h&&i&&(t.isGeographic||t.isWebMercator)){const n=ee(t);if(h=oe(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*f*o;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*f*o}const i=Math.ceil(n/t);h=1===i||2===i&&n/2-p.xmax<t}}let y,d=u;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=m;const n=t.isGeographic?1341104507446289e-21:.29858214164761665,o=I(n,t),i=t.isGeographic?4326:3857;y=L({x:n,y:n},a,me(e,new x({wkid:i}),!0)),y.x*=d/o,y.y*=d/o}else{y={x:l.x,y:l.y};let e=0;for(;d<m*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,m)/Math.min(d,m)<=w&&(d=m)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,u)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*l.x;let t=S.findIndex((t=>t.x>=l.x-e&&t.x<=l.x+e));t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex((t=>t.x<=l.x+e)),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:c,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function he(e){let t=0;for(const n of e){const e=n.length;let o=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)o+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=o/2}return Math.abs(t)}export{xe as computeProjectedScales,w as defaultGridSpacing,R as defaultProjectionToleranceInPixels,C as getDefaultDatumTransformationForDataset,F as getProjectedGridPoints,se as getProjectionOffsetGrid,ie as getRasterDatasetAlignmentInfo,O as getSourceScale,ee as getWorldWidth,oe as getWorldWrapCount,v as load,M as minimumGridSpacing,me as projectDatasetExtent,L as projectDatasetResolution,Q as projectExtent,A as projectPoint,V as projectPolygon,_ as projectResolution,fe as shiftExtent,ce as snapExtent,ue as snapPyramid};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import r from"../request.js";import t from"../core/JSONSupport.js";import o from"../core/Loadable.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as u}from"../core/accessorSupport/decorators/subclass.js";import{isSubtypeSublayer as a,isFeatureLayer as n}from"../layers/support/layerUtils.js";import{RuleType as i}from"./support/typeUtils.js";let d=class extends(t.JSONSupportMixin(o)){constructor(e){super(e),this.rulesCategorized={attachment:[],containment:[],connectivity:[]},this.request=r}initialize(){}async load(e){const r=this.rulesLayer.load(e).then((()=>this._initializeRulesTable()));return this.addResolvingPromise(r),this}getFeaturesCanAssociateWithClause(e,r,t){return this._getWhereClauseForCompatibleFeatures(e,r,t)}getFeaturesCanAssociateWith(e,r,t){return null==this._getFeatureSourceLayerId(e)?[]:r.filter((r=>this.canAssociateFeatures(e,r,t)))}canAssociateFeatures(e,r,t){const[o,s]=this._getFeatureAssetCodes(e),u=this._getFeatureSourceLayerId(e),[a,n]=this._getFeatureAssetCodes(r),i=this._getFeatureSourceLayerId(r);return null!=u&&null!=i&&t.some((e=>{const{type:r,direction:t}=e;return this._getRulesForAssociationType(r).some((e=>{const d=this._getRuleFieldValuesForAssociation(e,r,t);return d?.some((e=>u===e?.ruleLayerIdForSource&&o===e?.ruleAssetGroupCodeForSource&&s===e?.ruleAssetTypeCodeForSource&&i===e?.ruleLayerIdForTarget&&a===e?.ruleAssetGroupCodeForTarget&&n===e?.ruleAssetTypeCodeForTarget))}))}))}getLayersCanAssociateWith(e,r,t){return null==this._getFeatureSourceLayerId(e)?[]:r.filter((r=>this.canAssociateFeatureToLayer(e,r,t)))}canAssociateFeatureToLayer(e,r,t){const o=a(r)?r.parent:r;if(!o)return!1;const s=o.layerId,u=a(r)?r.subtypeCode:null,[n,i]=this._getFeatureAssetCodes(e),d=this._getFeatureSourceLayerId(e);return null!=d&&t.some((e=>{const{type:r,direction:t}=e;return this._getRulesForAssociationType(r).some((e=>{const o=this._getRuleFieldValuesForAssociation(e,r,t);return o?.some((e=>d===e?.ruleLayerIdForSource&&n===e?.ruleAssetGroupCodeForSource&&i===e?.ruleAssetTypeCodeForSource&&s===e?.ruleLayerIdForTarget&&(null==u||u===e?.ruleAssetGroupCodeForTarget)))}))}))}getFeatureSQL(e,r){const t=e.layerId.toString(),o=e.fieldsIndex?.normalizeFieldName("assetGroup"),s=e.fieldsIndex?.normalizeFieldName("assetType"),u=o?r.attributes[o]:null,a=s?r.attributes[s]:null,n=this.rulesHash[t];if(n){const e=n.assetGroupHash[u];if(e){return e.assetTypeHash[a]||null}}return null}async _initializeRulesTable(){const e={};let r;!function(e){e[e.from=0]="from",e[e.to=1]="to",e[e.via=2]="via"}(r||(r={}));const t=[{networkSourceId:"fromNetworkSource",assetGroupId:"fromAssetGroup",assetTypeId:"fromAssetType"},{networkSourceId:"toNetworkSource",assetGroupId:"toAssetGroup",assetTypeId:"toAssetType"},{networkSourceId:"viaNetworkSource",assetGroupId:"viaAssetGroup",assetTypeId:"viaAssetType"}];this.rulesCategorized={attachment:[],containment:[],connectivity:[]};for(const o of this.rules){if(o.ruleType===i.RTAttachment){this.rulesCategorized.attachment.push(o);continue}if(o.ruleType===i.RTContainment){this.rulesCategorized.containment.push(o);continue}if(o.ruleType===i.RTJunctionJunctionConnectivity){this.rulesCategorized.connectivity.push(o);continue}this.rulesCategorized.connectivity.push(o);let s=[[r.from,r.to],[r.to,r.from]];o.ruleType===i.RTEdgeJunctionEdgeConnectivity&&(s=[[r.from,r.via],[r.via,r.from],[r.to,r.via],[r.via,r.to]]);for(const u of s){const s=u.shift(),a=u.shift();let n=!1;switch(o.ruleType){case i.RTEdgeJunctionEdgeConnectivity:n=s===r.from||s===r.to;break;case i.RTJunctionEdgeConnectivity:n=s===r.to}const d=t[s],c=o[d.networkSourceId]?.layerId.toString()??"",l=o[d.assetGroupId]?.assetGroupCode?.toString(),p=o[d.assetTypeId],y=p?.assetTypeCode?.toString(),T=t[a],C=o[T.networkSourceId]?.layerId.toString()??"",A=o[T.assetGroupId]?.assetGroupCode?.toString(),F=o[T.assetTypeId],g=F?.assetTypeCode?.toString(),m=e[c]??{assetGroupHash:{}};if(!(l&&y&&A&&g))continue;const S=m.assetGroupHash[l]??{assetTypeHash:{}},f=S.assetTypeHash[y]??{};if(f[C]=f[C]??{},n){f[c]=f[c]??{};const e=`(assetgroup = ${l} AND assettype = ${y})`;"esriNECPEndVertex"===F?.connectivityPolicy?f[c].endVertex=f[c]?.endVertex?`${f[c].endVertex}`:`${e}`:f[c].anyVertex=f[c].anyVertex?`${f[c].anyVertex}`:`${e}`}const G=`(assetgroup = ${A} AND assettype = ${g})`;"esriNECPEndVertex"===F?.connectivityPolicy?f[C].endVertex=f[C]?.endVertex?`${f[C].endVertex} OR ${G}`:`${G}`:f[C].anyVertex=f[C]?.anyVertex?`${f[C].anyVertex} OR ${G}`:`${G}`,S.assetTypeHash[y]=f,m.assetGroupHash[l]=S,e[c]=m}}this._set("rulesHash",e)}_getRuleFieldValuesForAssociation(e,r,t="from"){switch(r){case"attachment":case"containment":return"from"===t?[{ruleLayerIdForSource:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.fromAssetType?.assetTypeCode,ruleLayerIdForTarget:e.toNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.toAssetType?.assetTypeCode}]:[{ruleLayerIdForSource:e.toNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.toAssetType?.assetTypeCode,ruleLayerIdForTarget:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.fromAssetType?.assetTypeCode}];case"connectivity":case"junction-junction-connectivity":return[{ruleLayerIdForSource:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.fromAssetType?.assetTypeCode,ruleLayerIdForTarget:e.toNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.toAssetType?.assetTypeCode},{ruleLayerIdForSource:e.toNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.toAssetType?.assetTypeCode,ruleLayerIdForTarget:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.fromAssetType?.assetTypeCode}];case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":return e.ruleType===i.RTEdgeJunctionEdgeConnectivity?[{ruleLayerIdForSource:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.fromAssetType?.assetTypeCode,ruleLayerIdForTarget:e.viaNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.viaAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.viaAssetType?.assetTypeCode},{ruleLayerIdForSource:e.viaNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.viaAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.viaAssetType?.assetTypeCode,ruleLayerIdForTarget:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.fromAssetType?.assetTypeCode},{ruleLayerIdForSource:e.toNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.toAssetType?.assetTypeCode,ruleLayerIdForTarget:e.viaNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.viaAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.viaAssetType?.assetTypeCode},{ruleLayerIdForSource:e.viaNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.viaAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.viaAssetType?.assetTypeCode,ruleLayerIdForTarget:e.toNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.toAssetType?.assetTypeCode}]:[{ruleLayerIdForSource:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.fromAssetType?.assetTypeCode,ruleLayerIdForTarget:e.toNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.toAssetType?.assetTypeCode},{ruleLayerIdForSource:e.toNetworkSource?.layerId,ruleAssetGroupCodeForSource:e.toAssetGroup?.assetGroupCode,ruleAssetTypeCodeForSource:e.toAssetType?.assetTypeCode,ruleLayerIdForTarget:e.fromNetworkSource?.layerId,ruleAssetGroupCodeForTarget:e.fromAssetGroup?.assetGroupCode,ruleAssetTypeCodeForTarget:e.fromAssetType?.assetTypeCode}];default:return[]}}_getWhereClauseForCompatibleFeatures(e,r,t){const o=new Map,[s,u]=this._getAssetFieldNames(e.sourceLayer),[n,i]=this._getFeatureAssetCodes(e),d=this._getFeatureSourceLayerId(e),c=a(r)?r.parent:r,l=a(r)?r.subtypeCode:null;t.forEach((e=>{const{type:r,direction:t}=e;this._getRulesForAssociationType(r).forEach((e=>{this._getRuleFieldValuesForAssociation(e,r,t).forEach((e=>{if(null!=e.ruleAssetGroupCodeForTarget&&null!=e.ruleAssetTypeCodeForTarget&&d===e?.ruleLayerIdForSource&&n===e?.ruleAssetGroupCodeForSource&&i===e?.ruleAssetTypeCodeForSource&&c.layerId===e?.ruleLayerIdForTarget&&(null==l||l===e?.ruleAssetGroupCodeForTarget)){const r=o.get(e.ruleAssetGroupCodeForTarget)??new Set;r.add(e.ruleAssetTypeCodeForTarget),o.set(e.ruleAssetGroupCodeForTarget,r)}}))}))}));let p=[];return this._mergeAssetCodes(o).forEach(((e,r)=>p.push(`${s} IN (${r}) AND ${u} IN (${Array.from(e).sort().join(", ")})`))),p.length>1&&(p=p.map((e=>`(${e})`))),p.join(" OR ")}_getRulesForAssociationType(e){const{rulesCategorized:r}=this;switch(e){case"attachment":return r.attachment;case"containment":return r.containment;case"connectivity":case"junction-junction-connectivity":return r.connectivity.filter((e=>e.ruleType===i.RTJunctionJunctionConnectivity));case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":return r.connectivity.filter((e=>e.ruleType===i.RTJunctionEdgeConnectivity||e.ruleType===i.RTEdgeJunctionEdgeConnectivity));default:return[]}}_getFeatureSourceLayerId(e){const{sourceLayer:r}=e;let t;return n(r)?t=r.layerId:a(r)&&(t=r.parent?.layerId),t??null}_getAssetFieldNames(e){if(!e||!("fieldsIndex"in e))return[null,null];return[e.fieldsIndex.normalizeFieldName("assetGroup")??null,e.fieldsIndex.normalizeFieldName("assetType")??null]}_getFeatureAssetCodes(e){const[r,t]=this._getAssetFieldNames(e.sourceLayer);return[r?e.attributes[r]:null,t?e.attributes[t]:null]}_areSetsEqual(e,r){if(e.size!==r.size)return!1;for(const t of e)if(!r.has(t))return!1;return!0}_mergeAssetCodes(e){const r=new Map,t=new Set;for(const[o,s]of e){const u=new Set([o]);for(const[r,n]of e)o!==r&&!t.has(r)&&this._areSetsEqual(s,n)&&(u.add(r),t.add(r));const a=Array.from(u).sort().join(", ");r.set(a,s)}return r}};e([s({constructOnly:!0})],d.prototype,"rulesLayer",void 0),e([s({constructOnly:!0})],d.prototype,"rules",void 0),e([s({readOnly:!0})],d.prototype,"rulesHash",void 0),e([s()],d.prototype,"rulesCategorized",void 0),e([s({constructOnly:!0})],d.prototype,"request",void 0),d=e([u("esri.networks.RulesTable")],d);const c=d;export{c as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../request.js";import s from"../core/JSONSupport.js";import o from"../core/Loadable.js";import{sqlIn as r,sqlOr as n,sqlAnd as i}from"../core/sql.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as c}from"../core/accessorSupport/decorators/subclass.js";import{RuleType as u}from"./support/typeUtils.js";import{getAssetFieldNames as p,getRuleValues as l,getCompatibleRuleElements as d,getFeatureSourceLayerId as y,doesRuleAllowAssociation as h}from"./support/utils.js";import{isGraphic as f}from"../support/guards.js";let m=class extends(s.JSONSupportMixin(o)){constructor(e){super(e),this.rulesCategorized={attachment:[],containment:[],connectivity:[]},this.request=t}initialize(){}async load(e){const t=this.rulesLayer.load(e).then((()=>this._initializeRulesTable()));return this.addResolvingPromise(t),this}getFeaturesCanAssociateWithClause(e,t,s){const o=new Map,[n,a]=p(e.sourceLayer);if(!n||!a)return"";const c=l(e),u=l(t);s.forEach((e=>{const{type:t,direction:s}=e;this._getRulesForAssociationType(t).forEach((e=>{d(e,c,s).filter((e=>e.networkSource?.layerId===u.layerId)).forEach((e=>{const t=e.assetGroup?.assetGroupCode,s=e.assetType?.assetTypeCode;if(null!=t&&null!=s){const e=o.get(t)??new Set;e.add(s),o.set(t,e)}}))}))}));let y=[];return this._mergeAssetCodes(o).forEach(((e,t)=>{const s=`${n} IN (${t})`,o=r(a,[...e]);s&&o&&y.push(i(s,o))})),y.length>1&&(y=y.map((e=>`(${e})`))),y.join(" OR ")}getFeaturesCanAssociateWith(e,t,s){return null==y(e)?[]:t.filter((t=>this.canAssociateFeatures(e,t,s)))}canAssociateFeatures(e,t,s){if(!this._canSupportAssociations([e,t]))return!1;const o=l(e),r=l(t);return s.some((e=>{const{type:t,direction:s}=e;return this._getRulesForAssociationType(t).some((e=>"to"===s?h(e,r,o):h(e,o,r)))}))}getLayersCanAssociateWith(e,t,s){return null==y(e)?[]:t.filter((t=>this.canAssociateFeatureToLayer(e,t,s)))}canAssociateFeatureToLayer(e,t,s){if(!this._canSupportAssociations([e,t]))return!1;const o=l(e),r=l(t);return s.some((e=>{const{type:t,direction:s}=e;return this._getRulesForAssociationType(t).some((e=>"to"===s?h(e,r,o):h(e,o,r)))}))}getFeatureSQL(e,t){const s=e.layerId.toString(),o=e.fieldsIndex?.normalizeFieldName("assetGroup"),r=e.fieldsIndex?.normalizeFieldName("assetType"),n=o?t.attributes[o]:null,i=r?t.attributes[r]:null,a=this.rulesHash[s];if(a){const e=a.assetGroupHash[n];if(e){return e.assetTypeHash[i]||null}}return null}async _initializeRulesTable(){const e={};let t;!function(e){e[e.from=0]="from",e[e.to=1]="to",e[e.via=2]="via"}(t||(t={}));const s=[{networkSourceId:"fromNetworkSource",assetGroupId:"fromAssetGroup",assetTypeId:"fromAssetType"},{networkSourceId:"toNetworkSource",assetGroupId:"toAssetGroup",assetTypeId:"toAssetType"},{networkSourceId:"viaNetworkSource",assetGroupId:"viaAssetGroup",assetTypeId:"viaAssetType"}];this.rulesCategorized={attachment:[],containment:[],connectivity:[]};for(const o of this.rules){if(o.ruleType===u.RTAttachment){this.rulesCategorized.attachment.push(o);continue}if(o.ruleType===u.RTContainment){this.rulesCategorized.containment.push(o);continue}if(o.ruleType===u.RTJunctionJunctionConnectivity){this.rulesCategorized.connectivity.push(o);continue}this.rulesCategorized.connectivity.push(o);let r=[[t.from,t.to],[t.to,t.from]];o.ruleType===u.RTEdgeJunctionEdgeConnectivity&&(r=[[t.from,t.via],[t.via,t.from],[t.to,t.via],[t.via,t.to]]);for(const a of r){const r=a.shift(),c=a.shift();let p=!1;switch(o.ruleType){case u.RTEdgeJunctionEdgeConnectivity:p=r===t.from||r===t.to;break;case u.RTJunctionEdgeConnectivity:p=r===t.to}const l=s[r],d=o[l.networkSourceId]?.layerId.toString()??"",y=o[l.assetGroupId]?.assetGroupCode?.toString(),h=o[l.assetTypeId],f=h?.assetTypeCode?.toString(),m=s[c],g=o[m.networkSourceId]?.layerId.toString()??"",T=o[m.assetGroupId]?.assetGroupCode?.toString(),v=o[m.assetTypeId],C=v?.assetTypeCode?.toString(),S=e[d]??{assetGroupHash:{}};if(!(y&&f&&T&&C))continue;const A=S.assetGroupHash[y]??{assetTypeHash:{}},I=A.assetTypeHash[f]??{};if(I[g]=I[g]??{},p){I[d]=I[d]??{};const e=i(`assetgroup = ${y}`,`assettype = ${f}`);"esriNECPEndVertex"===v?.connectivityPolicy?I[d].endVertex=I[d]?.endVertex?`${I[d].endVertex}`:`(${e})`:I[d].anyVertex=I[d].anyVertex?`${I[d].anyVertex}`:`(${e})`}const j=i(`assetgroup = ${T}`,`assettype = ${C}`);"esriNECPEndVertex"===v?.connectivityPolicy?I[g].endVertex=I[g]?.endVertex?n(I[g].endVertex,j):`(${j})`:I[g].anyVertex=I[g]?.anyVertex?n(I[g].anyVertex,j):`(${j})`,A.assetTypeHash[f]=I,S.assetGroupHash[y]=A,e[d]=S}}this._set("rulesHash",e)}_getRulesForAssociationType(e){const{rulesCategorized:t}=this;switch(e){case"attachment":return t.attachment;case"containment":return t.containment;case"connectivity":case"junction-junction-connectivity":return t.connectivity.filter((e=>e.ruleType===u.RTJunctionJunctionConnectivity));case"junction-edge-from-connectivity":case"junction-edge-midspan-connectivity":case"junction-edge-to-connectivity":return t.connectivity.filter((e=>e.ruleType===u.RTJunctionEdgeConnectivity||e.ruleType===u.RTEdgeJunctionEdgeConnectivity));default:return[]}}_areSetsEqual(e,t){if(e.size!==t.size)return!1;for(const s of e)if(!t.has(s))return!1;return!0}_mergeAssetCodes(e){const t=new Map,s=new Set;for(const[o,r]of e){const n=new Set([o]);for(const[t,a]of e)o!==t&&!s.has(t)&&this._areSetsEqual(r,a)&&(n.add(t),s.add(t));const i=Array.from(n).sort().join(",");t.set(i,r)}return t}_canSupportAssociations(e){return e.every((e=>{const t=f(e)?e.sourceLayer:e,[s,o]=p(t);return null!=s&&null!=o}))}};e([a({constructOnly:!0})],m.prototype,"rulesLayer",void 0),e([a({constructOnly:!0})],m.prototype,"rules",void 0),e([a({readOnly:!0})],m.prototype,"rulesHash",void 0),e([a()],m.prototype,"rulesCategorized",void 0),e([a({constructOnly:!0})],m.prototype,"request",void 0),m=e([c("esri.networks.RulesTable")],m);const g=m;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import o from"../layers/FeatureLayer.js";import{queryAllJSON as a}from"../layers/support/featureQueryAll.js";import i from"./Network.js";import n from"./RulesTable.js";import l from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as u}from"./support/networkFieldUtils.js";import m from"./support/NetworkSystemLayers.js";import d from"./support/TerminalConfiguration.js";import c from"./support/TraceJobInfo.js";import{RuleType as y,AssociationTypeEnum as p}from"./support/typeUtils.js";import f from"../rest/support/Query.js";let I=class extends i{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._terminalById=new Map}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new m({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map((e=>d.fromJSON(e)))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map((e=>e.domainNetworkName))||[]}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map((t=>{t?.edgeSources?.map((({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})),t?.junctionSources?.map((({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}))})),e}async load(e){return this.addResolvingPromise(super.load(e)),this.addResolvingPromise(this._loadNamedTraceConfigurationsFromNetwork(e)),this}getTerminalConfiguration(e){let t=null,r=null;const s=e.layer;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const a=e.attributes;if(null==a)return null;for(const l of Object.keys(a))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let i=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find((e=>e.layerId===o));if(e){const s=e.assetGroups?.find((e=>e.assetGroupCode===t));if(s){const e=s.assetTypes?.find((e=>e.assetTypeCode===r));if(e?.isTerminalConfigurationSupported){i=e.terminalConfigurationId;break}}}}if(null!=i){const e=this.dataElement.terminalConfigurations,t=e?.find((e=>e.terminalConfigurationId===i));return t?d.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find((t=>t.domainNetworkName===e));return t?.tiers.map((e=>e.name))||[]}async getRulesTable(){return this._sharedRulesTable||(this._sharedRulesTable=this._createRulesTable()),await this._sharedRulesTable}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach((e=>{e.terminals.forEach((e=>{this._terminalById.set(e.id,e)}))})),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?this._utilityLayerList.has(e?.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new c({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;await t.load();const r=(e,t)=>e?1===e.terminalId?!t?.terminalId||t?.terminalId===e.terminalId:e.terminalId===t?.terminalId:!t?.terminalId,s=e=>({fromRuleElement:{networkSource:e.fromNetworkSource,assetGroup:e.fromAssetGroup,assetType:e.fromAssetType,terminal:e.fromTerminal},viaRuleElement:e.viaNetworkSource?{networkSource:e.viaNetworkSource,assetGroup:e.viaAssetGroup,assetType:e.viaAssetType,terminal:e.viaTerminal}:void 0,toRuleElement:{networkSource:e.toNetworkSource,assetGroup:e.toAssetGroup,assetType:e.toAssetType,terminal:e.toTerminal}}),o=(e,t,s=!0)=>e.networkSource?.sourceId===t.networkSourceId&&e.assetGroup?.assetGroupCode===t.assetGroupCode&&e.assetType?.assetTypeCode===t.assetTypeCode&&(!s||r(e.terminal,t)),a=(e,t)=>{const{fromRuleElement:r,toRuleElement:a}=s(e);return o(r,t.fromNetworkElement,!1)&&o(a,t.toNetworkElement,!1)},i=(e,t)=>{const{fromRuleElement:r,toRuleElement:a}=s(e);return o(r,t.fromNetworkElement)&&o(a,t.toNetworkElement)||o(r,t.toNetworkElement)&&o(a,t.fromNetworkElement)},n=(e,t)=>{const{fromRuleElement:r,toRuleElement:a,viaRuleElement:i}=s(e);return o(r,t.fromNetworkElement)&&o(i,t.toNetworkElement)||o(r,t.toNetworkElement)&&o(i,t.fromNetworkElement)||o(i,t.fromNetworkElement)&&o(a,t.toNetworkElement)||o(i,t.toNetworkElement)&&o(a,t.fromNetworkElement)};if("containment"===e.associationType){return t.rulesCategorized.containment.some((t=>a(t,e)))}if("attachment"===e.associationType){return t.rulesCategorized.attachment.some((t=>a(t,e)))}return t.rulesCategorized.connectivity.some((t=>t.ruleType===y.RTEdgeJunctionEdgeConnectivity?n(t,e):i(t,e)))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:a,toNetworkSourceId:i,toGlobalId:n,toTerminalId:l,associationType:m,isContentVisible:d,percentAlong:c,globalId:y}=u(r);return{addFeatures:e.map((e=>new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[a]:e.fromNetworkElement?.terminalId,[i]:e.toNetworkElement?.networkSourceId,[n]:e.toNetworkElement?.globalId,[l]:e.toNetworkElement?.terminalId,[m]:p[e.associationType],[d]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[c]:e.percentAlong,[y]:e.globalId}}))),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers;return{deleteFeatures:e.map((e=>({globalId:e.globalId}))),id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map((e=>e.globalId)),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find((e=>e.globalId===s.globalId));if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}async _createRulesTable(){const e=this.networkSystemLayers.rulesTableUrl,t=new o({url:e});await t.load();const r=this.dataElement?.domainNetworks;if(!r)return null;const s=r.flatMap((e=>[...e.edgeSources||[],...e.junctionSources||[]])),a=(await T(t)).map((e=>this._hydrateRuleInfo(t,s,e)));return new n({rulesLayer:t,rules:a})}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),a=s.get("CREATIONDATE"),i=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),m=s.get("TONETWORKSOURCEID"),d=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),p=s.get("TOTERMINALID"),f=s.get("VIANETWORKSOURCEID"),I=s.get("VIAASSETGROUP"),T=s.get("VIAASSETTYPE"),h=s.get("VIATERMINALID"),w=r.attributes[o.name],b=new Date(r.attributes[a.name]),g=[{networkSourceId:r.attributes[i.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[m.name],assetGroupId:r.attributes[d.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[p.name]},{networkSourceId:r.attributes[f.name],assetGroupId:r.attributes[I.name],assetTypeId:r.attributes[T.name],terminalId:r.attributes[h.name]}];let k;!function(e){e[e.from=0]="from",e[e.to=1]="to",e[e.via=2]="via"}(k||(k={}));const S={ruleType:w,creationDate:b};for(const N of[k.from,k.to,k.via]){if(w!==y.RTEdgeJunctionEdgeConnectivity&&N===k.via)continue;const e=g[N],r=t.find((t=>t.sourceId===e.networkSourceId)),s=r?.assetGroups.find((t=>t.assetGroupCode===e.assetGroupId)),o=s?.assetTypes.find((t=>t.assetTypeCode===e.assetTypeId)),a=this._getTerminal(o,e);let i="";switch(N){case k.from:i="from";break;case k.to:i="to";break;case k.via:i="via"}S[`${i}NetworkSource`]=r,S[`${i}AssetGroup`]=s,S[`${i}AssetType`]=o,S[`${i}Terminal`]=a?.toJSON()}return S}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find((e=>e.id===r));return s?.terminals?.find((e=>e.id===t.terminalId))??null}};async function T(e){const t=new f({where:"1=1",outFields:["*"]});return(await a(e,t)).features}e([r({type:[l],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],I.prototype,"sharedNamedTraceConfigurations",void 0),e([r({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],I.prototype,"type",void 0),e([r({readOnly:!0})],I.prototype,"serviceTerritoryFeatureLayerId",null),e([r({readOnly:!0})],I.prototype,"networkSystemLayers",null),e([r({readOnly:!0})],I.prototype,"terminalConfigurations",null),e([r({readOnly:!0})],I.prototype,"domainNetworkNames",null),I=e([s("esri.networks.UtilityNetwork")],I);const h=I;export{h as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import o from"../layers/FeatureLayer.js";import{queryAllJSON as a}from"../layers/support/featureQueryAll.js";import i from"./Network.js";import n from"./RulesTable.js";import l from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as u}from"./support/networkFieldUtils.js";import d from"./support/NetworkSystemLayers.js";import m from"./support/TerminalConfiguration.js";import c from"./support/TraceJobInfo.js";import{AssociationTypeEnum as y,RuleType as p}from"./support/typeUtils.js";import{doesRuleAllowAssociation as f}from"./support/utils.js";import h from"../rest/support/Query.js";let I=class extends i{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._terminalById=new Map}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new d({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map((e=>m.fromJSON(e)))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map((e=>e.domainNetworkName))||[]}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map((t=>{t?.edgeSources?.map((({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})),t?.junctionSources?.map((({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}))})),e}async load(e){return this.addResolvingPromise(super.load(e)),this.addResolvingPromise(this._loadNamedTraceConfigurationsFromNetwork(e)),this}getTerminalConfiguration(e){let t=null,r=null;const s=e.layer;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const a=e.attributes;if(null==a)return null;for(const l of Object.keys(a))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let i=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find((e=>e.layerId===o));if(e){const s=e.assetGroups?.find((e=>e.assetGroupCode===t));if(s){const e=s.assetTypes?.find((e=>e.assetTypeCode===r));if(e?.isTerminalConfigurationSupported){i=e.terminalConfigurationId;break}}}}if(null!=i){const e=this.dataElement.terminalConfigurations,t=e?.find((e=>e.terminalConfigurationId===i));return t?m.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find((t=>t.domainNetworkName===e));return t?.tiers.map((e=>e.name))||[]}async getRulesTable(){return this._sharedRulesTable||(this._sharedRulesTable=this._createRulesTable()),await this._sharedRulesTable}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach((e=>{e.terminals.forEach((e=>{this._terminalById.set(e.id,e)}))})),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?this._utilityLayerList.has(e?.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new c({statusUrl:o})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some((e=>f(e,r,s)))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:a,toNetworkSourceId:i,toGlobalId:n,toTerminalId:l,associationType:d,isContentVisible:m,percentAlong:c,globalId:p}=u(r);return{addFeatures:e.map((e=>new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[a]:e.fromNetworkElement?.terminalId,[i]:e.toNetworkElement?.networkSourceId,[n]:e.toNetworkElement?.globalId,[l]:e.toNetworkElement?.terminalId,[d]:y[e.associationType],[m]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[c]:e.percentAlong,[p]:e.globalId}}))),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers;return{deleteFeatures:e.map((e=>({globalId:e.globalId}))),id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map((e=>e.globalId)),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find((e=>e.globalId===s.globalId));if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}async _createRulesTable(){const e=this.networkSystemLayers.rulesTableUrl,t=new o({url:e});await t.load();const r=this.dataElement?.domainNetworks;if(!r)return null;const s=r.flatMap((e=>[...e.edgeSources||[],...e.junctionSources||[]])),a=(await b(t)).map((e=>this._hydrateRuleInfo(t,s,e)));return new n({rulesLayer:t,rules:a})}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),a=s.get("CREATIONDATE"),i=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),f=s.get("VIANETWORKSOURCEID"),h=s.get("VIAASSETGROUP"),I=s.get("VIAASSETTYPE"),b=s.get("VIATERMINALID"),g=r.attributes[o.name],T=new Date(r.attributes[a.name]),w=[{networkSourceId:r.attributes[i.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[f.name],assetGroupId:r.attributes[h.name],assetTypeId:r.attributes[I.name],terminalId:r.attributes[b.name]}];let S;!function(e){e[e.from=0]="from",e[e.to=1]="to",e[e.via=2]="via"}(S||(S={}));const k={ruleType:g,creationDate:T};for(const N of[S.from,S.to,S.via]){if(g!==p.RTEdgeJunctionEdgeConnectivity&&N===S.via)continue;const e=w[N],r=t.find((t=>t.sourceId===e.networkSourceId)),s=r?.assetGroups.find((t=>t.assetGroupCode===e.assetGroupId)),o=s?.assetTypes.find((t=>t.assetTypeCode===e.assetTypeId)),a=this._getTerminal(o,e);let i="";switch(N){case S.from:i="from";break;case S.to:i="to";break;case S.via:i="via"}k[`${i}NetworkSource`]=r,k[`${i}AssetGroup`]=s,k[`${i}AssetType`]=o,k[`${i}Terminal`]=a?.toJSON()}return k}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find((e=>e.id===r));return s?.terminals?.find((e=>e.id===t.terminalId))??null}};async function b(e){const t=new h({where:"1=1",outFields:["*"]});return(await a(e,t)).features}e([r({type:[l],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],I.prototype,"sharedNamedTraceConfigurations",void 0),e([r({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],I.prototype,"type",void 0),e([r({readOnly:!0})],I.prototype,"serviceTerritoryFeatureLayerId",null),e([r({readOnly:!0})],I.prototype,"networkSystemLayers",null),e([r({readOnly:!0})],I.prototype,"terminalConfigurations",null),e([r({readOnly:!0})],I.prototype,"domainNetworkNames",null),I=e([s("esri.networks.UtilityNetwork")],I);const g=I;export{g as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../request.js";import t from"../../core/Error.js";import{queryAllJSON as r}from"../../layers/support/featureQueryAll.js";import a from"../../portal/PortalItem.js";import o from"../../rest/support/FeatureSet.js";async function n(e,t){const a=e.layers,n=e.layerInfos,l=e.returnGeometry||!1,i=e.outSpatialReference;await Promise.all(a.map((async e=>{await e.load()})));return(await Promise.all(a.map((async e=>{const a=n.find((t=>t.layerUrl===e.parsedUrl?.path));if(!a?.objectIds?.length)return{layer:e,featureSet:void 0};const s=e.createQuery();s.returnGeometry=l,s.outFields=a.outFields||["*"],s.outSpatialReference=i,s.gdbVersion=e.gdbVersion,s.objectIds=a.objectIds,t&&(s.where="1=1");const p=o.fromJSON(await r(e,s));return p.features.forEach((t=>{t.layer=e})),{layer:e,featureSet:p}})))).filter((e=>void 0!==e.featureSet))}async function l(e,t){if("Utility Network Layer"===e){const{default:e}=await import("../UtilityNetwork.js");return new e({layerUrl:t})}return null}async function i(r){let o="portalItem"in r?r:{portalItem:r};!o.portalItem||o.portalItem instanceof a||(o={...o,portalItem:new a(o.portalItem)});const n=o.portalItem;if(await n.load(),"Feature Service"!==n.type)throw new t("portal:unknown-item-type","Unknown item type '${type}'",{type:n.type});const i=n.url,s=await e(i,{responseType:"json",query:{f:"json"}}),p="Network Layer";if(s.data.type?.includes(p))return l(s.data.type,i);if(s.data.layers){const e=s.data.layers.find((e=>e.type.includes(p)));if(e){const t=`${i}/${e.id}`;return l(e.type,t)}}return null}export{n as getFeaturesFromLayers,i as networkFromPortalItem};
5
+ import e from"../../request.js";import t from"../../core/Error.js";import{queryAllJSON as r}from"../../layers/support/featureQueryAll.js";import{isSubtypeSublayer as n,isFeatureLayer as o}from"../../layers/support/layerUtils.js";import{RuleType as a}from"./typeUtils.js";import s from"../../portal/PortalItem.js";import u from"../../rest/support/FeatureSet.js";import{isGraphic as l}from"../../support/guards.js";function i(e,t,r="from"){const{fromRuleElement:n,viaRuleElement:o,toRuleElement:s}=f(e),u=[];switch(e.ruleType){case a.RTContainment:case a.RTAttachment:"from"===r&&y(t,n,!1)?u.push(s):"to"===r&&y(t,s,!1)&&u.push(n);break;case a.RTJunctionEdgeConnectivity:case a.RTJunctionJunctionConnectivity:y(t,n,!0)?u.push(s):y(t,s,!0)&&u.push(n);break;case a.RTEdgeJunctionEdgeConnectivity:o&&(y(t,o,!0)?(u.push(n),u.push(s)):(y(t,n,!0)||y(t,s,!0))&&u.push(o));break;default:return[]}return u}function c(e,t,r){const{fromRuleElement:n,viaRuleElement:o,toRuleElement:s}=f(e);switch(e.ruleType){case a.RTContainment:case a.RTAttachment:return p(t,r,n,s,!1,!1);case a.RTJunctionEdgeConnectivity:case a.RTJunctionJunctionConnectivity:return p(t,r,n,s,!0,!0);case a.RTEdgeJunctionEdgeConnectivity:return p(t,r,n,o,!0,!0)||p(t,r,s,o,!0,!0);default:return!1}}function p(e,t,r,n,o,a){if(!r||!n)return!1;const s=y(e,r,a),u=y(t,n,a);if(o){const o=y(e,n,a),l=y(t,r,a);return s&&u||o&&l}return s&&u}function m(e,t){const r=e.terminal?.terminalId,n=t.terminalId;return null==r&&null==n||(1===r?null==n||1===n:r===n)}function y(e,t,r){const{assetGroupCode:n,assetTypeCode:o}=e;return("layerId"in e?e.layerId===t.networkSource?.layerId:e.networkSourceId===t.networkSource?.sourceId)&&(null==n||n===t.assetGroup?.assetGroupCode)&&(null==o||o===t.assetType?.assetTypeCode)&&(!r||!("terminalId"in e)||m(t,e))}function f(e){return{fromRuleElement:{networkSource:e.fromNetworkSource,assetGroup:e.fromAssetGroup,assetType:e.fromAssetType,terminal:e.fromTerminal},viaRuleElement:e.viaNetworkSource?{networkSource:e.viaNetworkSource,assetGroup:e.viaAssetGroup,assetType:e.viaAssetType,terminal:e.viaTerminal}:void 0,toRuleElement:{networkSource:e.toNetworkSource,assetGroup:e.toAssetGroup,assetType:e.toAssetType,terminal:e.toTerminal}}}function d(e){let t=null,r=null,o=null;if(l(e))t=w(e),[r,o]=I(e);else if(n(e)){t=e.parent?.layerId??null;const[n]=T(e);n===e.subtypeField&&(r=e.subtypeCode)}else t=e.layerId??null;return{layerId:t,assetGroupCode:r,assetTypeCode:o}}function w(e){const{sourceLayer:t}=e;let r;return o(t)?r=t.layerId:n(t)&&(r=t.parent?.layerId),r??null}function I(e){const[t,r]=T(e.sourceLayer);return[t?e.attributes[t]:null,r?e.attributes[r]:null]}function T(e){if(!e||!("fieldsIndex"in e))return[null,null];return[e.fieldsIndex.normalizeFieldName("assetGroup")??null,e.fieldsIndex.normalizeFieldName("assetType")??null]}async function R(e,t){const n=e.layers,o=e.layerInfos,a=e.returnGeometry||!1,s=e.outSpatialReference;await Promise.all(n.map((async e=>{await e.load()})));return(await Promise.all(n.map((async e=>{const n=o.find((t=>t.layerUrl===e.parsedUrl?.path));if(!n?.objectIds?.length)return{layer:e,featureSet:void 0};const l=e.createQuery();l.returnGeometry=a,l.outFields=n.outFields||["*"],l.outSpatialReference=s,l.gdbVersion=e.gdbVersion,l.objectIds=n.objectIds,t&&(l.where="1=1");const i=u.fromJSON(await r(e,l));return i.features.forEach((t=>{t.layer=e})),{layer:e,featureSet:i}})))).filter((e=>void 0!==e.featureSet))}async function k(e,t){if("Utility Network Layer"===e){const{default:e}=await import("../UtilityNetwork.js");return new e({layerUrl:t})}return null}async function v(r){let n="portalItem"in r?r:{portalItem:r};!n.portalItem||n.portalItem instanceof s||(n={...n,portalItem:new s(n.portalItem)});const o=n.portalItem;if(await o.load(),"Feature Service"!==o.type)throw new t("portal:unknown-item-type","Unknown item type '${type}'",{type:o.type});const a=o.url,u=await e(a,{responseType:"json",query:{f:"json"}}),l="Network Layer";if(u.data.type?.includes(l))return k(u.data.type,a);if(u.data.layers){const e=u.data.layers.find((e=>e.type.includes(l)));if(e){const t=`${a}/${e.id}`;return k(e.type,t)}}return null}export{p as doElementsMatchRule,c as doesRuleAllowAssociation,T as getAssetFieldNames,i as getCompatibleRuleElements,f as getElementsFromRule,I as getFeatureAssetCodes,w as getFeatureSourceLayerId,R as getFeaturesFromLayers,d as getRuleValues,y as isRuleElementMatch,m as isTerminalMatch,v as networkFromPortalItem};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.33.0-next.20250327",
3
+ "version": "4.33.0-next.20250329",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -30,7 +30,7 @@
30
30
  "@petamoriken/float16": "~3.9.2",
31
31
  "@vaadin/grid": "~24.7.1",
32
32
  "@zip.js/zip.js": "~2.7.57",
33
- "luxon": "~3.5.0",
33
+ "luxon": "~3.6.0",
34
34
  "marked": "~15.0.7"
35
35
  },
36
36
  "type": "module"